@mmmbuto/nexuscrew 0.8.52-rc.5 → 0.8.52-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,7 +37,7 @@
37
37
  `+g[L].replace(" at new "," at ");return i.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",i.displayName)),J}while(1<=L&&0<=Y);break}}}finally{W=!1,Error.prepareStackTrace=l}return(i=i?i.displayName||i.name:"")?D(i):""}function ce(i){switch(i.tag){case 5:return D(i.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return i=ne(i.type,!1),i;case 11:return i=ne(i.type.render,!1),i;case 1:return i=ne(i.type,!0),i;default:return""}}function pe(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case O:return"Fragment";case G:return"Portal";case X:return"Profiler";case Z:return"StrictMode";case C:return"Suspense";case T:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case z:return(i.displayName||"Context")+".Consumer";case Q:return(i._context.displayName||"Context")+".Provider";case I:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case A:return r=i.displayName||null,r!==null?r:pe(i.type)||"Memo";case $:r=i._payload,i=i._init;try{return pe(i(r))}catch{}}return null}function ye(i){var r=i.type;switch(i.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=r.render,i=i.displayName||i.name||"",r.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(r);case 8:return r===Z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function me(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ae(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Pe(i){var r=ae(i)?"checked":"value",l=Object.getOwnPropertyDescriptor(i.constructor.prototype,r),d=""+i[r];if(!i.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var g=l.get,_=l.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return g.call(this)},set:function(L){d=""+L,_.call(this,L)}}),Object.defineProperty(i,r,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(L){d=""+L},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function rt(i){i._valueTracker||(i._valueTracker=Pe(i))}function Xe(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var l=r.getValue(),d="";return i&&(d=ae(i)?i.checked?"true":"false":i.value),i=d,i!==l?(r.setValue(i),!0):!1}function Me(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function qt(i,r){var l=r.checked;return B({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??i._wrapperState.initialChecked})}function wn(i,r){var l=r.defaultValue==null?"":r.defaultValue,d=r.checked!=null?r.checked:r.defaultChecked;l=me(r.value!=null?r.value:l),i._wrapperState={initialChecked:d,initialValue:l,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function Be(i,r){r=r.checked,r!=null&&F(i,"checked",r,!1)}function $t(i,r){Be(i,r);var l=me(r.value),d=r.type;if(l!=null)d==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+l):i.value!==""+l&&(i.value=""+l);else if(d==="submit"||d==="reset"){i.removeAttribute("value");return}r.hasOwnProperty("value")?At(i,r.type,l):r.hasOwnProperty("defaultValue")&&At(i,r.type,me(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(i.defaultChecked=!!r.defaultChecked)}function Nt(i,r,l){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var d=r.type;if(!(d!=="submit"&&d!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+i._wrapperState.initialValue,l||r===i.value||(i.value=r),i.defaultValue=r}l=i.name,l!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,l!==""&&(i.name=l)}function At(i,r,l){(r!=="number"||Me(i.ownerDocument)!==i)&&(l==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+l&&(i.defaultValue=""+l))}var mt=Array.isArray;function dt(i,r,l,d){if(i=i.options,r){r={};for(var g=0;g<l.length;g++)r["$"+l[g]]=!0;for(l=0;l<i.length;l++)g=r.hasOwnProperty("$"+i[l].value),i[l].selected!==g&&(i[l].selected=g),g&&d&&(i[l].defaultSelected=!0)}else{for(l=""+me(l),r=null,g=0;g<i.length;g++){if(i[g].value===l){i[g].selected=!0,d&&(i[g].defaultSelected=!0);return}r!==null||i[g].disabled||(r=i[g])}r!==null&&(r.selected=!0)}}function ut(i,r){if(r.dangerouslySetInnerHTML!=null)throw Error(n(91));return B({},r,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function re(i,r){var l=r.value;if(l==null){if(l=r.children,r=r.defaultValue,l!=null){if(r!=null)throw Error(n(92));if(mt(l)){if(1<l.length)throw Error(n(93));l=l[0]}r=l}r==null&&(r=""),l=r}i._wrapperState={initialValue:me(l)}}function xe(i,r){var l=me(r.value),d=me(r.defaultValue);l!=null&&(l=""+l,l!==i.value&&(i.value=l),r.defaultValue==null&&i.defaultValue!==l&&(i.defaultValue=l)),d!=null&&(i.defaultValue=""+d)}function Ie(i){var r=i.textContent;r===i._wrapperState.initialValue&&r!==""&&r!==null&&(i.value=r)}function Fe(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function he(i,r){return i==null||i==="http://www.w3.org/1999/xhtml"?Fe(r):i==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var ze,q=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,l,d,g){MSApp.execUnsafeLocalFunction(function(){return i(r,l,d,g)})}:i})(function(i,r){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=r;else{for(ze=ze||document.createElement("div"),ze.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=ze.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;r.firstChild;)i.appendChild(r.firstChild)}});function te(i,r){if(r){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=r;return}}i.textContent=r}var H={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},le=["Webkit","ms","Moz","O"];Object.keys(H).forEach(function(i){le.forEach(function(r){r=r+i.charAt(0).toUpperCase()+i.substring(1),H[r]=H[i]})});function ue(i,r,l){return r==null||typeof r=="boolean"||r===""?"":l||typeof r!="number"||r===0||H.hasOwnProperty(i)&&H[i]?(""+r).trim():r+"px"}function ge(i,r){i=i.style;for(var l in r)if(r.hasOwnProperty(l)){var d=l.indexOf("--")===0,g=ue(l,r[l],d);l==="float"&&(l="cssFloat"),d?i.setProperty(l,g):i[l]=g}}var Le=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _e(i,r){if(r){if(Le[i]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(n(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(n(61))}if(r.style!=null&&typeof r.style!="object")throw Error(n(62))}}function Ce(i,r){if(i.indexOf("-")===-1)return typeof r.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tt=null;function ot(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Qe=null,Tt=null,lt=null;function Ze(i){if(i=po(i)){if(typeof Qe!="function")throw Error(n(280));var r=i.stateNode;r&&(r=ja(r),Qe(i.stateNode,i.type,r))}}function Jt(i){Tt?lt?lt.push(i):lt=[i]:Tt=i}function ni(){if(Tt){var i=Tt,r=lt;if(lt=Tt=null,Ze(i),r)for(i=0;i<r.length;i++)Ze(r[i])}}function Wn(i,r){return i(r)}function ui(){}var de=!1;function Ne(i,r,l){if(de)return i(r,l);de=!0;try{return Wn(i,r,l)}finally{de=!1,(Tt!==null||lt!==null)&&(ui(),ni())}}function Ke(i,r){var l=i.stateNode;if(l===null)return null;var d=ja(l);if(d===null)return null;l=d[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(i=i.type,d=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!d;break e;default:i=!1}if(i)return null;if(l&&typeof l!="function")throw Error(n(231,r,typeof l));return l}var ht=!1;if(h)try{var gt={};Object.defineProperty(gt,"passive",{get:function(){ht=!0}}),window.addEventListener("test",gt,gt),window.removeEventListener("test",gt,gt)}catch{ht=!1}function bs(i,r,l,d,g,_,L,Y,J){var oe=Array.prototype.slice.call(arguments,3);try{r.apply(l,oe)}catch(be){this.onError(be)}}var Ui=!1,Ss=null,xs=!1,di=null,Kn={onError:function(i){Ui=!0,Ss=i}};function Wr(i,r,l,d,g,_,L,Y,J){Ui=!1,Ss=null,bs.apply(Kn,arguments)}function la(i,r,l,d,g,_,L,Y,J){if(Wr.apply(this,arguments),Ui){if(Ui){var oe=Ss;Ui=!1,Ss=null}else throw Error(n(198));xs||(xs=!0,di=oe)}}function Ot(i){var r=i,l=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(l=r.return),i=r.return;while(i)}return r.tag===3?l:null}function Kr(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function ks(i){if(Ot(i)!==i)throw Error(n(188))}function Cs(i){var r=i.alternate;if(!r){if(r=Ot(i),r===null)throw Error(n(188));return r!==i?null:i}for(var l=i,d=r;;){var g=l.return;if(g===null)break;var _=g.alternate;if(_===null){if(d=g.return,d!==null){l=d;continue}break}if(g.child===_.child){for(_=g.child;_;){if(_===l)return ks(g),i;if(_===d)return ks(g),r;_=_.sibling}throw Error(n(188))}if(l.return!==d.return)l=g,d=_;else{for(var L=!1,Y=g.child;Y;){if(Y===l){L=!0,l=g,d=_;break}if(Y===d){L=!0,d=g,l=_;break}Y=Y.sibling}if(!L){for(Y=_.child;Y;){if(Y===l){L=!0,l=_,d=g;break}if(Y===d){L=!0,d=_,l=g;break}Y=Y.sibling}if(!L)throw Error(n(189))}}if(l.alternate!==d)throw Error(n(190))}if(l.tag!==3)throw Error(n(188));return l.stateNode.current===l?i:r}function Es(i){return i=Cs(i),i!==null?qr(i):null}function qr(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var r=qr(i);if(r!==null)return r;i=i.sibling}return null}var Ns=t.unstable_scheduleCallback,Vr=t.unstable_cancelCallback,tr=t.unstable_shouldYield,ca=t.unstable_requestPaint,kt=t.unstable_now,fe=t.unstable_getCurrentPriorityLevel,He=t.unstable_ImmediatePriority,Ve=t.unstable_UserBlockingPriority,qe=t.unstable_NormalPriority,vt=t.unstable_LowPriority,wt=t.unstable_IdlePriority,Ht=null,Zt=null;function uc(i){if(Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(Ht,i,void 0,(i.current.flags&128)===128)}catch{}}var Nn=Math.clz32?Math.clz32:_b,Yr=Math.log,vb=Math.LN2;function _b(i){return i>>>=0,i===0?32:31-(Yr(i)/vb|0)|0}var ua=64,da=4194304;function Gr(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function ha(i,r){var l=i.pendingLanes;if(l===0)return 0;var d=0,g=i.suspendedLanes,_=i.pingedLanes,L=l&268435455;if(L!==0){var Y=L&~g;Y!==0?d=Gr(Y):(_&=L,_!==0&&(d=Gr(_)))}else L=l&~g,L!==0?d=Gr(L):_!==0&&(d=Gr(_));if(d===0)return 0;if(r!==0&&r!==d&&(r&g)===0&&(g=d&-d,_=r&-r,g>=_||g===16&&(_&4194240)!==0))return r;if((d&4)!==0&&(d|=l&16),r=i.entangledLanes,r!==0)for(i=i.entanglements,r&=d;0<r;)l=31-Nn(r),g=1<<l,d|=i[l],r&=~g;return d}function yb(i,r){switch(i){case 1:case 2:case 4:return r+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wb(i,r){for(var l=i.suspendedLanes,d=i.pingedLanes,g=i.expirationTimes,_=i.pendingLanes;0<_;){var L=31-Nn(_),Y=1<<L,J=g[L];J===-1?((Y&l)===0||(Y&d)!==0)&&(g[L]=yb(Y,r)):J<=r&&(i.expiredLanes|=Y),_&=~Y}}function dc(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function $f(){var i=ua;return ua<<=1,(ua&4194240)===0&&(ua=64),i}function hc(i){for(var r=[],l=0;31>l;l++)r.push(i);return r}function Xr(i,r,l){i.pendingLanes|=r,r!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,r=31-Nn(r),i[r]=l}function bb(i,r){var l=i.pendingLanes&~r;i.pendingLanes=r,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=r,i.mutableReadLanes&=r,i.entangledLanes&=r,r=i.entanglements;var d=i.eventTimes;for(i=i.expirationTimes;0<l;){var g=31-Nn(l),_=1<<g;r[g]=0,d[g]=-1,i[g]=-1,l&=~_}}function fc(i,r){var l=i.entangledLanes|=r;for(i=i.entanglements;l;){var d=31-Nn(l),g=1<<d;g&r|i[d]&r&&(i[d]|=r),l&=~g}}var ft=0;function Hf(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var Uf,pc,Wf,Kf,qf,mc=!1,fa=[],Wi=null,Ki=null,qi=null,Qr=new Map,Jr=new Map,Vi=[],Sb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Vf(i,r){switch(i){case"focusin":case"focusout":Wi=null;break;case"dragenter":case"dragleave":Ki=null;break;case"mouseover":case"mouseout":qi=null;break;case"pointerover":case"pointerout":Qr.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Jr.delete(r.pointerId)}}function Zr(i,r,l,d,g,_){return i===null||i.nativeEvent!==_?(i={blockedOn:r,domEventName:l,eventSystemFlags:d,nativeEvent:_,targetContainers:[g]},r!==null&&(r=po(r),r!==null&&pc(r)),i):(i.eventSystemFlags|=d,r=i.targetContainers,g!==null&&r.indexOf(g)===-1&&r.push(g),i)}function xb(i,r,l,d,g){switch(r){case"focusin":return Wi=Zr(Wi,i,r,l,d,g),!0;case"dragenter":return Ki=Zr(Ki,i,r,l,d,g),!0;case"mouseover":return qi=Zr(qi,i,r,l,d,g),!0;case"pointerover":var _=g.pointerId;return Qr.set(_,Zr(Qr.get(_)||null,i,r,l,d,g)),!0;case"gotpointercapture":return _=g.pointerId,Jr.set(_,Zr(Jr.get(_)||null,i,r,l,d,g)),!0}return!1}function Yf(i){var r=js(i.target);if(r!==null){var l=Ot(r);if(l!==null){if(r=l.tag,r===13){if(r=Kr(l),r!==null){i.blockedOn=r,qf(i.priority,function(){Wf(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function pa(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var l=vc(i.domEventName,i.eventSystemFlags,r[0],i.nativeEvent);if(l===null){l=i.nativeEvent;var d=new l.constructor(l.type,l);tt=d,l.target.dispatchEvent(d),tt=null}else return r=po(l),r!==null&&pc(r),i.blockedOn=l,!1;r.shift()}return!0}function Gf(i,r,l){pa(i)&&l.delete(r)}function kb(){mc=!1,Wi!==null&&pa(Wi)&&(Wi=null),Ki!==null&&pa(Ki)&&(Ki=null),qi!==null&&pa(qi)&&(qi=null),Qr.forEach(Gf),Jr.forEach(Gf)}function eo(i,r){i.blockedOn===r&&(i.blockedOn=null,mc||(mc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kb)))}function to(i){function r(g){return eo(g,i)}if(0<fa.length){eo(fa[0],i);for(var l=1;l<fa.length;l++){var d=fa[l];d.blockedOn===i&&(d.blockedOn=null)}}for(Wi!==null&&eo(Wi,i),Ki!==null&&eo(Ki,i),qi!==null&&eo(qi,i),Qr.forEach(r),Jr.forEach(r),l=0;l<Vi.length;l++)d=Vi[l],d.blockedOn===i&&(d.blockedOn=null);for(;0<Vi.length&&(l=Vi[0],l.blockedOn===null);)Yf(l),l.blockedOn===null&&Vi.shift()}var nr=M.ReactCurrentBatchConfig,ma=!0;function Cb(i,r,l,d){var g=ft,_=nr.transition;nr.transition=null;try{ft=1,gc(i,r,l,d)}finally{ft=g,nr.transition=_}}function Eb(i,r,l,d){var g=ft,_=nr.transition;nr.transition=null;try{ft=4,gc(i,r,l,d)}finally{ft=g,nr.transition=_}}function gc(i,r,l,d){if(ma){var g=vc(i,r,l,d);if(g===null)Dc(i,r,d,ga,l),Vf(i,d);else if(xb(g,i,r,l,d))d.stopPropagation();else if(Vf(i,d),r&4&&-1<Sb.indexOf(i)){for(;g!==null;){var _=po(g);if(_!==null&&Uf(_),_=vc(i,r,l,d),_===null&&Dc(i,r,d,ga,l),_===g)break;g=_}g!==null&&d.stopPropagation()}else Dc(i,r,d,null,l)}}var ga=null;function vc(i,r,l,d){if(ga=null,i=ot(d),i=js(i),i!==null)if(r=Ot(i),r===null)i=null;else if(l=r.tag,l===13){if(i=Kr(r),i!==null)return i;i=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null);return ga=i,null}function Xf(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(fe()){case He:return 1;case Ve:return 4;case qe:case vt:return 16;case wt:return 536870912;default:return 16}default:return 16}}var Yi=null,_c=null,va=null;function Qf(){if(va)return va;var i,r=_c,l=r.length,d,g="value"in Yi?Yi.value:Yi.textContent,_=g.length;for(i=0;i<l&&r[i]===g[i];i++);var L=l-i;for(d=1;d<=L&&r[l-d]===g[_-d];d++);return va=g.slice(i,1<d?1-d:void 0)}function _a(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function ya(){return!0}function Jf(){return!1}function Mn(i){function r(l,d,g,_,L){this._reactName=l,this._targetInst=g,this.type=d,this.nativeEvent=_,this.target=L,this.currentTarget=null;for(var Y in i)i.hasOwnProperty(Y)&&(l=i[Y],this[Y]=l?l(_):_[Y]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?ya:Jf,this.isPropagationStopped=Jf,this}return B(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ya)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ya)},persist:function(){},isPersistent:ya}),r}var ir={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yc=Mn(ir),no=B({},ir,{view:0,detail:0}),Nb=Mn(no),wc,bc,io,wa=B({},no,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xc,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==io&&(io&&i.type==="mousemove"?(wc=i.screenX-io.screenX,bc=i.screenY-io.screenY):bc=wc=0,io=i),wc)},movementY:function(i){return"movementY"in i?i.movementY:bc}}),Zf=Mn(wa),jb=B({},wa,{dataTransfer:0}),Rb=Mn(jb),Pb=B({},no,{relatedTarget:0}),Sc=Mn(Pb),Lb=B({},ir,{animationName:0,elapsedTime:0,pseudoElement:0}),Ab=Mn(Lb),Tb=B({},ir,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Db=Mn(Tb),Mb=B({},ir,{data:0}),ep=Mn(Mb),Ib={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ob={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Bb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zb(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=Bb[i])?!!r[i]:!1}function xc(){return zb}var Fb=B({},no,{key:function(i){if(i.key){var r=Ib[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=_a(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Ob[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xc,charCode:function(i){return i.type==="keypress"?_a(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?_a(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),$b=Mn(Fb),Hb=B({},wa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tp=Mn(Hb),Ub=B({},no,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xc}),Wb=Mn(Ub),Kb=B({},ir,{propertyName:0,elapsedTime:0,pseudoElement:0}),qb=Mn(Kb),Vb=B({},wa,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Yb=Mn(Vb),Gb=[9,13,27,32],kc=h&&"CompositionEvent"in window,so=null;h&&"documentMode"in document&&(so=document.documentMode);var Xb=h&&"TextEvent"in window&&!so,np=h&&(!kc||so&&8<so&&11>=so),ip=" ",sp=!1;function rp(i,r){switch(i){case"keyup":return Gb.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function op(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var sr=!1;function Qb(i,r){switch(i){case"compositionend":return op(r);case"keypress":return r.which!==32?null:(sp=!0,ip);case"textInput":return i=r.data,i===ip&&sp?null:i;default:return null}}function Jb(i,r){if(sr)return i==="compositionend"||!kc&&rp(i,r)?(i=Qf(),va=_c=Yi=null,sr=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return np&&r.locale!=="ko"?null:r.data;default:return null}}var Zb={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ap(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!Zb[i.type]:r==="textarea"}function lp(i,r,l,d){Jt(d),r=Ca(r,"onChange"),0<r.length&&(l=new yc("onChange","change",null,l,d),i.push({event:l,listeners:r}))}var ro=null,oo=null;function eS(i){Ep(i,0)}function ba(i){var r=cr(i);if(Xe(r))return i}function tS(i,r){if(i==="change")return r}var cp=!1;if(h){var Cc;if(h){var Ec="oninput"in document;if(!Ec){var up=document.createElement("div");up.setAttribute("oninput","return;"),Ec=typeof up.oninput=="function"}Cc=Ec}else Cc=!1;cp=Cc&&(!document.documentMode||9<document.documentMode)}function dp(){ro&&(ro.detachEvent("onpropertychange",hp),oo=ro=null)}function hp(i){if(i.propertyName==="value"&&ba(oo)){var r=[];lp(r,oo,i,ot(i)),Ne(eS,r)}}function nS(i,r,l){i==="focusin"?(dp(),ro=r,oo=l,ro.attachEvent("onpropertychange",hp)):i==="focusout"&&dp()}function iS(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return ba(oo)}function sS(i,r){if(i==="click")return ba(r)}function rS(i,r){if(i==="input"||i==="change")return ba(r)}function oS(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var ii=typeof Object.is=="function"?Object.is:oS;function ao(i,r){if(ii(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var l=Object.keys(i),d=Object.keys(r);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var g=l[d];if(!f.call(r,g)||!ii(i[g],r[g]))return!1}return!0}function fp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function pp(i,r){var l=fp(i);i=0;for(var d;l;){if(l.nodeType===3){if(d=i+l.textContent.length,i<=r&&d>=r)return{node:l,offset:r-i};i=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=fp(l)}}function mp(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?mp(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function gp(){for(var i=window,r=Me();r instanceof i.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)i=r.contentWindow;else break;r=Me(i.document)}return r}function Nc(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}function aS(i){var r=gp(),l=i.focusedElem,d=i.selectionRange;if(r!==l&&l&&l.ownerDocument&&mp(l.ownerDocument.documentElement,l)){if(d!==null&&Nc(l)){if(r=d.start,i=d.end,i===void 0&&(i=r),"selectionStart"in l)l.selectionStart=r,l.selectionEnd=Math.min(i,l.value.length);else if(i=(r=l.ownerDocument||document)&&r.defaultView||window,i.getSelection){i=i.getSelection();var g=l.textContent.length,_=Math.min(d.start,g);d=d.end===void 0?_:Math.min(d.end,g),!i.extend&&_>d&&(g=d,d=_,_=g),g=pp(l,_);var L=pp(l,d);g&&L&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==L.node||i.focusOffset!==L.offset)&&(r=r.createRange(),r.setStart(g.node,g.offset),i.removeAllRanges(),_>d?(i.addRange(r),i.extend(L.node,L.offset)):(r.setEnd(L.node,L.offset),i.addRange(r)))}}for(r=[],i=l;i=i.parentNode;)i.nodeType===1&&r.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<r.length;l++)i=r[l],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var lS=h&&"documentMode"in document&&11>=document.documentMode,rr=null,jc=null,lo=null,Rc=!1;function vp(i,r,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Rc||rr==null||rr!==Me(d)||(d=rr,"selectionStart"in d&&Nc(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),lo&&ao(lo,d)||(lo=d,d=Ca(jc,"onSelect"),0<d.length&&(r=new yc("onSelect","select",null,r,l),i.push({event:r,listeners:d}),r.target=rr)))}function Sa(i,r){var l={};return l[i.toLowerCase()]=r.toLowerCase(),l["Webkit"+i]="webkit"+r,l["Moz"+i]="moz"+r,l}var or={animationend:Sa("Animation","AnimationEnd"),animationiteration:Sa("Animation","AnimationIteration"),animationstart:Sa("Animation","AnimationStart"),transitionend:Sa("Transition","TransitionEnd")},Pc={},_p={};h&&(_p=document.createElement("div").style,"AnimationEvent"in window||(delete or.animationend.animation,delete or.animationiteration.animation,delete or.animationstart.animation),"TransitionEvent"in window||delete or.transitionend.transition);function xa(i){if(Pc[i])return Pc[i];if(!or[i])return i;var r=or[i],l;for(l in r)if(r.hasOwnProperty(l)&&l in _p)return Pc[i]=r[l];return i}var yp=xa("animationend"),wp=xa("animationiteration"),bp=xa("animationstart"),Sp=xa("transitionend"),xp=new Map,kp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Gi(i,r){xp.set(i,r),a(r,[i])}for(var Lc=0;Lc<kp.length;Lc++){var Ac=kp[Lc],cS=Ac.toLowerCase(),uS=Ac[0].toUpperCase()+Ac.slice(1);Gi(cS,"on"+uS)}Gi(yp,"onAnimationEnd"),Gi(wp,"onAnimationIteration"),Gi(bp,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi(Sp,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var co="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),dS=new Set("cancel close invalid load scroll toggle".split(" ").concat(co));function Cp(i,r,l){var d=i.type||"unknown-event";i.currentTarget=l,la(d,r,void 0,i),i.currentTarget=null}function Ep(i,r){r=(r&4)!==0;for(var l=0;l<i.length;l++){var d=i[l],g=d.event;d=d.listeners;e:{var _=void 0;if(r)for(var L=d.length-1;0<=L;L--){var Y=d[L],J=Y.instance,oe=Y.currentTarget;if(Y=Y.listener,J!==_&&g.isPropagationStopped())break e;Cp(g,Y,oe),_=J}else for(L=0;L<d.length;L++){if(Y=d[L],J=Y.instance,oe=Y.currentTarget,Y=Y.listener,J!==_&&g.isPropagationStopped())break e;Cp(g,Y,oe),_=J}}}if(xs)throw i=di,xs=!1,di=null,i}function bt(i,r){var l=r[Fc];l===void 0&&(l=r[Fc]=new Set);var d=i+"__bubble";l.has(d)||(Np(r,i,2,!1),l.add(d))}function Tc(i,r,l){var d=0;r&&(d|=4),Np(l,i,d,r)}var ka="_reactListening"+Math.random().toString(36).slice(2);function uo(i){if(!i[ka]){i[ka]=!0,s.forEach(function(l){l!=="selectionchange"&&(dS.has(l)||Tc(l,!1,i),Tc(l,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[ka]||(r[ka]=!0,Tc("selectionchange",!1,r))}}function Np(i,r,l,d){switch(Xf(r)){case 1:var g=Cb;break;case 4:g=Eb;break;default:g=gc}l=g.bind(null,r,l,i),g=void 0,!ht||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(g=!0),d?g!==void 0?i.addEventListener(r,l,{capture:!0,passive:g}):i.addEventListener(r,l,!0):g!==void 0?i.addEventListener(r,l,{passive:g}):i.addEventListener(r,l,!1)}function Dc(i,r,l,d,g){var _=d;if((r&1)===0&&(r&2)===0&&d!==null)e:for(;;){if(d===null)return;var L=d.tag;if(L===3||L===4){var Y=d.stateNode.containerInfo;if(Y===g||Y.nodeType===8&&Y.parentNode===g)break;if(L===4)for(L=d.return;L!==null;){var J=L.tag;if((J===3||J===4)&&(J=L.stateNode.containerInfo,J===g||J.nodeType===8&&J.parentNode===g))return;L=L.return}for(;Y!==null;){if(L=js(Y),L===null)return;if(J=L.tag,J===5||J===6){d=_=L;continue e}Y=Y.parentNode}}d=d.return}Ne(function(){var oe=_,be=ot(l),Se=[];e:{var we=xp.get(i);if(we!==void 0){var Re=yc,De=i;switch(i){case"keypress":if(_a(l)===0)break e;case"keydown":case"keyup":Re=$b;break;case"focusin":De="focus",Re=Sc;break;case"focusout":De="blur",Re=Sc;break;case"beforeblur":case"afterblur":Re=Sc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Re=Zf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Re=Rb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Re=Wb;break;case yp:case wp:case bp:Re=Ab;break;case Sp:Re=qb;break;case"scroll":Re=Nb;break;case"wheel":Re=Yb;break;case"copy":case"cut":case"paste":Re=Db;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Re=tp}var Oe=(r&4)!==0,Bt=!Oe&&i==="scroll",ie=Oe?we!==null?we+"Capture":null:we;Oe=[];for(var ee=oe,se;ee!==null;){se=ee;var ke=se.stateNode;if(se.tag===5&&ke!==null&&(se=ke,ie!==null&&(ke=Ke(ee,ie),ke!=null&&Oe.push(ho(ee,ke,se)))),Bt)break;ee=ee.return}0<Oe.length&&(we=new Re(we,De,null,l,be),Se.push({event:we,listeners:Oe}))}}if((r&7)===0){e:{if(we=i==="mouseover"||i==="pointerover",Re=i==="mouseout"||i==="pointerout",we&&l!==tt&&(De=l.relatedTarget||l.fromElement)&&(js(De)||De[ji]))break e;if((Re||we)&&(we=be.window===be?be:(we=be.ownerDocument)?we.defaultView||we.parentWindow:window,Re?(De=l.relatedTarget||l.toElement,Re=oe,De=De?js(De):null,De!==null&&(Bt=Ot(De),De!==Bt||De.tag!==5&&De.tag!==6)&&(De=null)):(Re=null,De=oe),Re!==De)){if(Oe=Zf,ke="onMouseLeave",ie="onMouseEnter",ee="mouse",(i==="pointerout"||i==="pointerover")&&(Oe=tp,ke="onPointerLeave",ie="onPointerEnter",ee="pointer"),Bt=Re==null?we:cr(Re),se=De==null?we:cr(De),we=new Oe(ke,ee+"leave",Re,l,be),we.target=Bt,we.relatedTarget=se,ke=null,js(be)===oe&&(Oe=new Oe(ie,ee+"enter",De,l,be),Oe.target=se,Oe.relatedTarget=Bt,ke=Oe),Bt=ke,Re&&De)t:{for(Oe=Re,ie=De,ee=0,se=Oe;se;se=ar(se))ee++;for(se=0,ke=ie;ke;ke=ar(ke))se++;for(;0<ee-se;)Oe=ar(Oe),ee--;for(;0<se-ee;)ie=ar(ie),se--;for(;ee--;){if(Oe===ie||ie!==null&&Oe===ie.alternate)break t;Oe=ar(Oe),ie=ar(ie)}Oe=null}else Oe=null;Re!==null&&jp(Se,we,Re,Oe,!1),De!==null&&Bt!==null&&jp(Se,Bt,De,Oe,!0)}}e:{if(we=oe?cr(oe):window,Re=we.nodeName&&we.nodeName.toLowerCase(),Re==="select"||Re==="input"&&we.type==="file")var $e=tS;else if(ap(we))if(cp)$e=rS;else{$e=iS;var Ue=nS}else(Re=we.nodeName)&&Re.toLowerCase()==="input"&&(we.type==="checkbox"||we.type==="radio")&&($e=sS);if($e&&($e=$e(i,oe))){lp(Se,$e,l,be);break e}Ue&&Ue(i,we,oe),i==="focusout"&&(Ue=we._wrapperState)&&Ue.controlled&&we.type==="number"&&At(we,"number",we.value)}switch(Ue=oe?cr(oe):window,i){case"focusin":(ap(Ue)||Ue.contentEditable==="true")&&(rr=Ue,jc=oe,lo=null);break;case"focusout":lo=jc=rr=null;break;case"mousedown":Rc=!0;break;case"contextmenu":case"mouseup":case"dragend":Rc=!1,vp(Se,l,be);break;case"selectionchange":if(lS)break;case"keydown":case"keyup":vp(Se,l,be)}var We;if(kc)e:{switch(i){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else sr?rp(i,l)&&(Ye="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(Ye="onCompositionStart");Ye&&(np&&l.locale!=="ko"&&(sr||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&sr&&(We=Qf()):(Yi=be,_c="value"in Yi?Yi.value:Yi.textContent,sr=!0)),Ue=Ca(oe,Ye),0<Ue.length&&(Ye=new ep(Ye,i,null,l,be),Se.push({event:Ye,listeners:Ue}),We?Ye.data=We:(We=op(l),We!==null&&(Ye.data=We)))),(We=Xb?Qb(i,l):Jb(i,l))&&(oe=Ca(oe,"onBeforeInput"),0<oe.length&&(be=new ep("onBeforeInput","beforeinput",null,l,be),Se.push({event:be,listeners:oe}),be.data=We))}Ep(Se,r)})}function ho(i,r,l){return{instance:i,listener:r,currentTarget:l}}function Ca(i,r){for(var l=r+"Capture",d=[];i!==null;){var g=i,_=g.stateNode;g.tag===5&&_!==null&&(g=_,_=Ke(i,l),_!=null&&d.unshift(ho(i,_,g)),_=Ke(i,r),_!=null&&d.push(ho(i,_,g))),i=i.return}return d}function ar(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function jp(i,r,l,d,g){for(var _=r._reactName,L=[];l!==null&&l!==d;){var Y=l,J=Y.alternate,oe=Y.stateNode;if(J!==null&&J===d)break;Y.tag===5&&oe!==null&&(Y=oe,g?(J=Ke(l,_),J!=null&&L.unshift(ho(l,J,Y))):g||(J=Ke(l,_),J!=null&&L.push(ho(l,J,Y)))),l=l.return}L.length!==0&&i.push({event:r,listeners:L})}var hS=/\r\n?/g,fS=/\u0000|\uFFFD/g;function Rp(i){return(typeof i=="string"?i:""+i).replace(hS,`
38
38
  `).replace(fS,"")}function Ea(i,r,l){if(r=Rp(r),Rp(i)!==r&&l)throw Error(n(425))}function Na(){}var Mc=null,Ic=null;function Oc(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Bc=typeof setTimeout=="function"?setTimeout:void 0,pS=typeof clearTimeout=="function"?clearTimeout:void 0,Pp=typeof Promise=="function"?Promise:void 0,mS=typeof queueMicrotask=="function"?queueMicrotask:typeof Pp<"u"?function(i){return Pp.resolve(null).then(i).catch(gS)}:Bc;function gS(i){setTimeout(function(){throw i})}function zc(i,r){var l=r,d=0;do{var g=l.nextSibling;if(i.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"){if(d===0){i.removeChild(g),to(r);return}d--}else l!=="$"&&l!=="$?"&&l!=="$!"||d++;l=g}while(l);to(r)}function Xi(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return i}function Lp(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"){if(r===0)return i;r--}else l==="/$"&&r++}i=i.previousSibling}return null}var lr=Math.random().toString(36).slice(2),hi="__reactFiber$"+lr,fo="__reactProps$"+lr,ji="__reactContainer$"+lr,Fc="__reactEvents$"+lr,vS="__reactListeners$"+lr,_S="__reactHandles$"+lr;function js(i){var r=i[hi];if(r)return r;for(var l=i.parentNode;l;){if(r=l[ji]||l[hi]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(i=Lp(i);i!==null;){if(l=i[hi])return l;i=Lp(i)}return r}i=l,l=i.parentNode}return null}function po(i){return i=i[hi]||i[ji],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function cr(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function ja(i){return i[fo]||null}var $c=[],ur=-1;function Qi(i){return{current:i}}function St(i){0>ur||(i.current=$c[ur],$c[ur]=null,ur--)}function _t(i,r){ur++,$c[ur]=i.current,i.current=r}var Ji={},mn=Qi(Ji),jn=Qi(!1),Rs=Ji;function dr(i,r){var l=i.type.contextTypes;if(!l)return Ji;var d=i.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===r)return d.__reactInternalMemoizedMaskedChildContext;var g={},_;for(_ in l)g[_]=r[_];return d&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=r,i.__reactInternalMemoizedMaskedChildContext=g),g}function Rn(i){return i=i.childContextTypes,i!=null}function Ra(){St(jn),St(mn)}function Ap(i,r,l){if(mn.current!==Ji)throw Error(n(168));_t(mn,r),_t(jn,l)}function Tp(i,r,l){var d=i.stateNode;if(r=r.childContextTypes,typeof d.getChildContext!="function")return l;d=d.getChildContext();for(var g in d)if(!(g in r))throw Error(n(108,ye(i)||"Unknown",g));return B({},l,d)}function Pa(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Ji,Rs=mn.current,_t(mn,i),_t(jn,jn.current),!0}function Dp(i,r,l){var d=i.stateNode;if(!d)throw Error(n(169));l?(i=Tp(i,r,Rs),d.__reactInternalMemoizedMergedChildContext=i,St(jn),St(mn),_t(mn,i)):St(jn),_t(jn,l)}var Ri=null,La=!1,Hc=!1;function Mp(i){Ri===null?Ri=[i]:Ri.push(i)}function yS(i){La=!0,Mp(i)}function Zi(){if(!Hc&&Ri!==null){Hc=!0;var i=0,r=ft;try{var l=Ri;for(ft=1;i<l.length;i++){var d=l[i];do d=d(!0);while(d!==null)}Ri=null,La=!1}catch(g){throw Ri!==null&&(Ri=Ri.slice(i+1)),Ns(He,Zi),g}finally{ft=r,Hc=!1}}return null}var hr=[],fr=0,Aa=null,Ta=0,qn=[],Vn=0,Ps=null,Pi=1,Li="";function Ls(i,r){hr[fr++]=Ta,hr[fr++]=Aa,Aa=i,Ta=r}function Ip(i,r,l){qn[Vn++]=Pi,qn[Vn++]=Li,qn[Vn++]=Ps,Ps=i;var d=Pi;i=Li;var g=32-Nn(d)-1;d&=~(1<<g),l+=1;var _=32-Nn(r)+g;if(30<_){var L=g-g%5;_=(d&(1<<L)-1).toString(32),d>>=L,g-=L,Pi=1<<32-Nn(r)+g|l<<g|d,Li=_+i}else Pi=1<<_|l<<g|d,Li=i}function Uc(i){i.return!==null&&(Ls(i,1),Ip(i,1,0))}function Wc(i){for(;i===Aa;)Aa=hr[--fr],hr[fr]=null,Ta=hr[--fr],hr[fr]=null;for(;i===Ps;)Ps=qn[--Vn],qn[Vn]=null,Li=qn[--Vn],qn[Vn]=null,Pi=qn[--Vn],qn[Vn]=null}var In=null,On=null,Ct=!1,si=null;function Op(i,r){var l=Qn(5,null,null,0);l.elementType="DELETED",l.stateNode=r,l.return=i,r=i.deletions,r===null?(i.deletions=[l],i.flags|=16):r.push(l)}function Bp(i,r){switch(i.tag){case 5:var l=i.type;return r=r.nodeType!==1||l.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(i.stateNode=r,In=i,On=Xi(r.firstChild),!0):!1;case 6:return r=i.pendingProps===""||r.nodeType!==3?null:r,r!==null?(i.stateNode=r,In=i,On=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(l=Ps!==null?{id:Pi,overflow:Li}:null,i.memoizedState={dehydrated:r,treeContext:l,retryLane:1073741824},l=Qn(18,null,null,0),l.stateNode=r,l.return=i,i.child=l,In=i,On=null,!0):!1;default:return!1}}function Kc(i){return(i.mode&1)!==0&&(i.flags&128)===0}function qc(i){if(Ct){var r=On;if(r){var l=r;if(!Bp(i,r)){if(Kc(i))throw Error(n(418));r=Xi(l.nextSibling);var d=In;r&&Bp(i,r)?Op(d,l):(i.flags=i.flags&-4097|2,Ct=!1,In=i)}}else{if(Kc(i))throw Error(n(418));i.flags=i.flags&-4097|2,Ct=!1,In=i}}}function zp(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;In=i}function Da(i){if(i!==In)return!1;if(!Ct)return zp(i),Ct=!0,!1;var r;if((r=i.tag!==3)&&!(r=i.tag!==5)&&(r=i.type,r=r!=="head"&&r!=="body"&&!Oc(i.type,i.memoizedProps)),r&&(r=On)){if(Kc(i))throw Fp(),Error(n(418));for(;r;)Op(i,r),r=Xi(r.nextSibling)}if(zp(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"){if(r===0){On=Xi(i.nextSibling);break e}r--}else l!=="$"&&l!=="$!"&&l!=="$?"||r++}i=i.nextSibling}On=null}}else On=In?Xi(i.stateNode.nextSibling):null;return!0}function Fp(){for(var i=On;i;)i=Xi(i.nextSibling)}function pr(){On=In=null,Ct=!1}function Vc(i){si===null?si=[i]:si.push(i)}var wS=M.ReactCurrentBatchConfig;function mo(i,r,l){if(i=l.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(n(309));var d=l.stateNode}if(!d)throw Error(n(147,i));var g=d,_=""+i;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===_?r.ref:(r=function(L){var Y=g.refs;L===null?delete Y[_]:Y[_]=L},r._stringRef=_,r)}if(typeof i!="string")throw Error(n(284));if(!l._owner)throw Error(n(290,i))}return i}function Ma(i,r){throw i=Object.prototype.toString.call(r),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i))}function $p(i){var r=i._init;return r(i._payload)}function Hp(i){function r(ie,ee){if(i){var se=ie.deletions;se===null?(ie.deletions=[ee],ie.flags|=16):se.push(ee)}}function l(ie,ee){if(!i)return null;for(;ee!==null;)r(ie,ee),ee=ee.sibling;return null}function d(ie,ee){for(ie=new Map;ee!==null;)ee.key!==null?ie.set(ee.key,ee):ie.set(ee.index,ee),ee=ee.sibling;return ie}function g(ie,ee){return ie=as(ie,ee),ie.index=0,ie.sibling=null,ie}function _(ie,ee,se){return ie.index=se,i?(se=ie.alternate,se!==null?(se=se.index,se<ee?(ie.flags|=2,ee):se):(ie.flags|=2,ee)):(ie.flags|=1048576,ee)}function L(ie){return i&&ie.alternate===null&&(ie.flags|=2),ie}function Y(ie,ee,se,ke){return ee===null||ee.tag!==6?(ee=Bu(se,ie.mode,ke),ee.return=ie,ee):(ee=g(ee,se),ee.return=ie,ee)}function J(ie,ee,se,ke){var $e=se.type;return $e===O?be(ie,ee,se.props.children,ke,se.key):ee!==null&&(ee.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===$&&$p($e)===ee.type)?(ke=g(ee,se.props),ke.ref=mo(ie,ee,se),ke.return=ie,ke):(ke=rl(se.type,se.key,se.props,null,ie.mode,ke),ke.ref=mo(ie,ee,se),ke.return=ie,ke)}function oe(ie,ee,se,ke){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==se.containerInfo||ee.stateNode.implementation!==se.implementation?(ee=zu(se,ie.mode,ke),ee.return=ie,ee):(ee=g(ee,se.children||[]),ee.return=ie,ee)}function be(ie,ee,se,ke,$e){return ee===null||ee.tag!==7?(ee=zs(se,ie.mode,ke,$e),ee.return=ie,ee):(ee=g(ee,se),ee.return=ie,ee)}function Se(ie,ee,se){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=Bu(""+ee,ie.mode,se),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case V:return se=rl(ee.type,ee.key,ee.props,null,ie.mode,se),se.ref=mo(ie,null,ee),se.return=ie,se;case G:return ee=zu(ee,ie.mode,se),ee.return=ie,ee;case $:var ke=ee._init;return Se(ie,ke(ee._payload),se)}if(mt(ee)||K(ee))return ee=zs(ee,ie.mode,se,null),ee.return=ie,ee;Ma(ie,ee)}return null}function we(ie,ee,se,ke){var $e=ee!==null?ee.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return $e!==null?null:Y(ie,ee,""+se,ke);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case V:return se.key===$e?J(ie,ee,se,ke):null;case G:return se.key===$e?oe(ie,ee,se,ke):null;case $:return $e=se._init,we(ie,ee,$e(se._payload),ke)}if(mt(se)||K(se))return $e!==null?null:be(ie,ee,se,ke,null);Ma(ie,se)}return null}function Re(ie,ee,se,ke,$e){if(typeof ke=="string"&&ke!==""||typeof ke=="number")return ie=ie.get(se)||null,Y(ee,ie,""+ke,$e);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case V:return ie=ie.get(ke.key===null?se:ke.key)||null,J(ee,ie,ke,$e);case G:return ie=ie.get(ke.key===null?se:ke.key)||null,oe(ee,ie,ke,$e);case $:var Ue=ke._init;return Re(ie,ee,se,Ue(ke._payload),$e)}if(mt(ke)||K(ke))return ie=ie.get(se)||null,be(ee,ie,ke,$e,null);Ma(ee,ke)}return null}function De(ie,ee,se,ke){for(var $e=null,Ue=null,We=ee,Ye=ee=0,nn=null;We!==null&&Ye<se.length;Ye++){We.index>Ye?(nn=We,We=null):nn=We.sibling;var ct=we(ie,We,se[Ye],ke);if(ct===null){We===null&&(We=nn);break}i&&We&&ct.alternate===null&&r(ie,We),ee=_(ct,ee,Ye),Ue===null?$e=ct:Ue.sibling=ct,Ue=ct,We=nn}if(Ye===se.length)return l(ie,We),Ct&&Ls(ie,Ye),$e;if(We===null){for(;Ye<se.length;Ye++)We=Se(ie,se[Ye],ke),We!==null&&(ee=_(We,ee,Ye),Ue===null?$e=We:Ue.sibling=We,Ue=We);return Ct&&Ls(ie,Ye),$e}for(We=d(ie,We);Ye<se.length;Ye++)nn=Re(We,ie,Ye,se[Ye],ke),nn!==null&&(i&&nn.alternate!==null&&We.delete(nn.key===null?Ye:nn.key),ee=_(nn,ee,Ye),Ue===null?$e=nn:Ue.sibling=nn,Ue=nn);return i&&We.forEach(function(ls){return r(ie,ls)}),Ct&&Ls(ie,Ye),$e}function Oe(ie,ee,se,ke){var $e=K(se);if(typeof $e!="function")throw Error(n(150));if(se=$e.call(se),se==null)throw Error(n(151));for(var Ue=$e=null,We=ee,Ye=ee=0,nn=null,ct=se.next();We!==null&&!ct.done;Ye++,ct=se.next()){We.index>Ye?(nn=We,We=null):nn=We.sibling;var ls=we(ie,We,ct.value,ke);if(ls===null){We===null&&(We=nn);break}i&&We&&ls.alternate===null&&r(ie,We),ee=_(ls,ee,Ye),Ue===null?$e=ls:Ue.sibling=ls,Ue=ls,We=nn}if(ct.done)return l(ie,We),Ct&&Ls(ie,Ye),$e;if(We===null){for(;!ct.done;Ye++,ct=se.next())ct=Se(ie,ct.value,ke),ct!==null&&(ee=_(ct,ee,Ye),Ue===null?$e=ct:Ue.sibling=ct,Ue=ct);return Ct&&Ls(ie,Ye),$e}for(We=d(ie,We);!ct.done;Ye++,ct=se.next())ct=Re(We,ie,Ye,ct.value,ke),ct!==null&&(i&&ct.alternate!==null&&We.delete(ct.key===null?Ye:ct.key),ee=_(ct,ee,Ye),Ue===null?$e=ct:Ue.sibling=ct,Ue=ct);return i&&We.forEach(function(ZS){return r(ie,ZS)}),Ct&&Ls(ie,Ye),$e}function Bt(ie,ee,se,ke){if(typeof se=="object"&&se!==null&&se.type===O&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case V:e:{for(var $e=se.key,Ue=ee;Ue!==null;){if(Ue.key===$e){if($e=se.type,$e===O){if(Ue.tag===7){l(ie,Ue.sibling),ee=g(Ue,se.props.children),ee.return=ie,ie=ee;break e}}else if(Ue.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===$&&$p($e)===Ue.type){l(ie,Ue.sibling),ee=g(Ue,se.props),ee.ref=mo(ie,Ue,se),ee.return=ie,ie=ee;break e}l(ie,Ue);break}else r(ie,Ue);Ue=Ue.sibling}se.type===O?(ee=zs(se.props.children,ie.mode,ke,se.key),ee.return=ie,ie=ee):(ke=rl(se.type,se.key,se.props,null,ie.mode,ke),ke.ref=mo(ie,ee,se),ke.return=ie,ie=ke)}return L(ie);case G:e:{for(Ue=se.key;ee!==null;){if(ee.key===Ue)if(ee.tag===4&&ee.stateNode.containerInfo===se.containerInfo&&ee.stateNode.implementation===se.implementation){l(ie,ee.sibling),ee=g(ee,se.children||[]),ee.return=ie,ie=ee;break e}else{l(ie,ee);break}else r(ie,ee);ee=ee.sibling}ee=zu(se,ie.mode,ke),ee.return=ie,ie=ee}return L(ie);case $:return Ue=se._init,Bt(ie,ee,Ue(se._payload),ke)}if(mt(se))return De(ie,ee,se,ke);if(K(se))return Oe(ie,ee,se,ke);Ma(ie,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,ee!==null&&ee.tag===6?(l(ie,ee.sibling),ee=g(ee,se),ee.return=ie,ie=ee):(l(ie,ee),ee=Bu(se,ie.mode,ke),ee.return=ie,ie=ee),L(ie)):l(ie,ee)}return Bt}var mr=Hp(!0),Up=Hp(!1),Ia=Qi(null),Oa=null,gr=null,Yc=null;function Gc(){Yc=gr=Oa=null}function Xc(i){var r=Ia.current;St(Ia),i._currentValue=r}function Qc(i,r,l){for(;i!==null;){var d=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,d!==null&&(d.childLanes|=r)):d!==null&&(d.childLanes&r)!==r&&(d.childLanes|=r),i===l)break;i=i.return}}function vr(i,r){Oa=i,Yc=gr=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&r)!==0&&(Pn=!0),i.firstContext=null)}function Yn(i){var r=i._currentValue;if(Yc!==i)if(i={context:i,memoizedValue:r,next:null},gr===null){if(Oa===null)throw Error(n(308));gr=i,Oa.dependencies={lanes:0,firstContext:i}}else gr=gr.next=i;return r}var As=null;function Jc(i){As===null?As=[i]:As.push(i)}function Wp(i,r,l,d){var g=r.interleaved;return g===null?(l.next=l,Jc(r)):(l.next=g.next,g.next=l),r.interleaved=l,Ai(i,d)}function Ai(i,r){i.lanes|=r;var l=i.alternate;for(l!==null&&(l.lanes|=r),l=i,i=i.return;i!==null;)i.childLanes|=r,l=i.alternate,l!==null&&(l.childLanes|=r),l=i,i=i.return;return l.tag===3?l.stateNode:null}var es=!1;function Zc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Kp(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Ti(i,r){return{eventTime:i,lane:r,tag:0,payload:null,callback:null,next:null}}function ts(i,r,l){var d=i.updateQueue;if(d===null)return null;if(d=d.shared,(at&2)!==0){var g=d.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),d.pending=r,Ai(i,l)}return g=d.interleaved,g===null?(r.next=r,Jc(d)):(r.next=g.next,g.next=r),d.interleaved=r,Ai(i,l)}function Ba(i,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194240)!==0)){var d=r.lanes;d&=i.pendingLanes,l|=d,r.lanes=l,fc(i,l)}}function qp(i,r){var l=i.updateQueue,d=i.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var g=null,_=null;if(l=l.firstBaseUpdate,l!==null){do{var L={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};_===null?g=_=L:_=_.next=L,l=l.next}while(l!==null);_===null?g=_=r:_=_.next=r}else g=_=r;l={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:_,shared:d.shared,effects:d.effects},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=r:i.next=r,l.lastBaseUpdate=r}function za(i,r,l,d){var g=i.updateQueue;es=!1;var _=g.firstBaseUpdate,L=g.lastBaseUpdate,Y=g.shared.pending;if(Y!==null){g.shared.pending=null;var J=Y,oe=J.next;J.next=null,L===null?_=oe:L.next=oe,L=J;var be=i.alternate;be!==null&&(be=be.updateQueue,Y=be.lastBaseUpdate,Y!==L&&(Y===null?be.firstBaseUpdate=oe:Y.next=oe,be.lastBaseUpdate=J))}if(_!==null){var Se=g.baseState;L=0,be=oe=J=null,Y=_;do{var we=Y.lane,Re=Y.eventTime;if((d&we)===we){be!==null&&(be=be.next={eventTime:Re,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var De=i,Oe=Y;switch(we=r,Re=l,Oe.tag){case 1:if(De=Oe.payload,typeof De=="function"){Se=De.call(Re,Se,we);break e}Se=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Oe.payload,we=typeof De=="function"?De.call(Re,Se,we):De,we==null)break e;Se=B({},Se,we);break e;case 2:es=!0}}Y.callback!==null&&Y.lane!==0&&(i.flags|=64,we=g.effects,we===null?g.effects=[Y]:we.push(Y))}else Re={eventTime:Re,lane:we,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},be===null?(oe=be=Re,J=Se):be=be.next=Re,L|=we;if(Y=Y.next,Y===null){if(Y=g.shared.pending,Y===null)break;we=Y,Y=we.next,we.next=null,g.lastBaseUpdate=we,g.shared.pending=null}}while(!0);if(be===null&&(J=Se),g.baseState=J,g.firstBaseUpdate=oe,g.lastBaseUpdate=be,r=g.shared.interleaved,r!==null){g=r;do L|=g.lane,g=g.next;while(g!==r)}else _===null&&(g.shared.lanes=0);Ms|=L,i.lanes=L,i.memoizedState=Se}}function Vp(i,r,l){if(i=r.effects,r.effects=null,i!==null)for(r=0;r<i.length;r++){var d=i[r],g=d.callback;if(g!==null){if(d.callback=null,d=l,typeof g!="function")throw Error(n(191,g));g.call(d)}}}var go={},fi=Qi(go),vo=Qi(go),_o=Qi(go);function Ts(i){if(i===go)throw Error(n(174));return i}function eu(i,r){switch(_t(_o,r),_t(vo,i),_t(fi,go),i=r.nodeType,i){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:he(null,"");break;default:i=i===8?r.parentNode:r,r=i.namespaceURI||null,i=i.tagName,r=he(r,i)}St(fi),_t(fi,r)}function _r(){St(fi),St(vo),St(_o)}function Yp(i){Ts(_o.current);var r=Ts(fi.current),l=he(r,i.type);r!==l&&(_t(vo,i),_t(fi,l))}function tu(i){vo.current===i&&(St(fi),St(vo))}var jt=Qi(0);function Fa(i){for(var r=i;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var nu=[];function iu(){for(var i=0;i<nu.length;i++)nu[i]._workInProgressVersionPrimary=null;nu.length=0}var $a=M.ReactCurrentDispatcher,su=M.ReactCurrentBatchConfig,Ds=0,Rt=null,Vt=null,en=null,Ha=!1,yo=!1,wo=0,bS=0;function gn(){throw Error(n(321))}function ru(i,r){if(r===null)return!1;for(var l=0;l<r.length&&l<i.length;l++)if(!ii(i[l],r[l]))return!1;return!0}function ou(i,r,l,d,g,_){if(Ds=_,Rt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,$a.current=i===null||i.memoizedState===null?CS:ES,i=l(d,g),yo){_=0;do{if(yo=!1,wo=0,25<=_)throw Error(n(301));_+=1,en=Vt=null,r.updateQueue=null,$a.current=NS,i=l(d,g)}while(yo)}if($a.current=Ka,r=Vt!==null&&Vt.next!==null,Ds=0,en=Vt=Rt=null,Ha=!1,r)throw Error(n(300));return i}function au(){var i=wo!==0;return wo=0,i}function pi(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?Rt.memoizedState=en=i:en=en.next=i,en}function Gn(){if(Vt===null){var i=Rt.alternate;i=i!==null?i.memoizedState:null}else i=Vt.next;var r=en===null?Rt.memoizedState:en.next;if(r!==null)en=r,Vt=i;else{if(i===null)throw Error(n(310));Vt=i,i={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},en===null?Rt.memoizedState=en=i:en=en.next=i}return en}function bo(i,r){return typeof r=="function"?r(i):r}function lu(i){var r=Gn(),l=r.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=i;var d=Vt,g=d.baseQueue,_=l.pending;if(_!==null){if(g!==null){var L=g.next;g.next=_.next,_.next=L}d.baseQueue=g=_,l.pending=null}if(g!==null){_=g.next,d=d.baseState;var Y=L=null,J=null,oe=_;do{var be=oe.lane;if((Ds&be)===be)J!==null&&(J=J.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),d=oe.hasEagerState?oe.eagerState:i(d,oe.action);else{var Se={lane:be,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};J===null?(Y=J=Se,L=d):J=J.next=Se,Rt.lanes|=be,Ms|=be}oe=oe.next}while(oe!==null&&oe!==_);J===null?L=d:J.next=Y,ii(d,r.memoizedState)||(Pn=!0),r.memoizedState=d,r.baseState=L,r.baseQueue=J,l.lastRenderedState=d}if(i=l.interleaved,i!==null){g=i;do _=g.lane,Rt.lanes|=_,Ms|=_,g=g.next;while(g!==i)}else g===null&&(l.lanes=0);return[r.memoizedState,l.dispatch]}function cu(i){var r=Gn(),l=r.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=i;var d=l.dispatch,g=l.pending,_=r.memoizedState;if(g!==null){l.pending=null;var L=g=g.next;do _=i(_,L.action),L=L.next;while(L!==g);ii(_,r.memoizedState)||(Pn=!0),r.memoizedState=_,r.baseQueue===null&&(r.baseState=_),l.lastRenderedState=_}return[_,d]}function Gp(){}function Xp(i,r){var l=Rt,d=Gn(),g=r(),_=!ii(d.memoizedState,g);if(_&&(d.memoizedState=g,Pn=!0),d=d.queue,uu(Zp.bind(null,l,d,i),[i]),d.getSnapshot!==r||_||en!==null&&en.memoizedState.tag&1){if(l.flags|=2048,So(9,Jp.bind(null,l,d,g,r),void 0,null),tn===null)throw Error(n(349));(Ds&30)!==0||Qp(l,r,g)}return g}function Qp(i,r,l){i.flags|=16384,i={getSnapshot:r,value:l},r=Rt.updateQueue,r===null?(r={lastEffect:null,stores:null},Rt.updateQueue=r,r.stores=[i]):(l=r.stores,l===null?r.stores=[i]:l.push(i))}function Jp(i,r,l,d){r.value=l,r.getSnapshot=d,em(r)&&tm(i)}function Zp(i,r,l){return l(function(){em(r)&&tm(i)})}function em(i){var r=i.getSnapshot;i=i.value;try{var l=r();return!ii(i,l)}catch{return!0}}function tm(i){var r=Ai(i,1);r!==null&&li(r,i,1,-1)}function nm(i){var r=pi();return typeof i=="function"&&(i=i()),r.memoizedState=r.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bo,lastRenderedState:i},r.queue=i,i=i.dispatch=kS.bind(null,Rt,i),[r.memoizedState,i]}function So(i,r,l,d){return i={tag:i,create:r,destroy:l,deps:d,next:null},r=Rt.updateQueue,r===null?(r={lastEffect:null,stores:null},Rt.updateQueue=r,r.lastEffect=i.next=i):(l=r.lastEffect,l===null?r.lastEffect=i.next=i:(d=l.next,l.next=i,i.next=d,r.lastEffect=i)),i}function im(){return Gn().memoizedState}function Ua(i,r,l,d){var g=pi();Rt.flags|=i,g.memoizedState=So(1|r,l,void 0,d===void 0?null:d)}function Wa(i,r,l,d){var g=Gn();d=d===void 0?null:d;var _=void 0;if(Vt!==null){var L=Vt.memoizedState;if(_=L.destroy,d!==null&&ru(d,L.deps)){g.memoizedState=So(r,l,_,d);return}}Rt.flags|=i,g.memoizedState=So(1|r,l,_,d)}function sm(i,r){return Ua(8390656,8,i,r)}function uu(i,r){return Wa(2048,8,i,r)}function rm(i,r){return Wa(4,2,i,r)}function om(i,r){return Wa(4,4,i,r)}function am(i,r){if(typeof r=="function")return i=i(),r(i),function(){r(null)};if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function lm(i,r,l){return l=l!=null?l.concat([i]):null,Wa(4,4,am.bind(null,r,i),l)}function du(){}function cm(i,r){var l=Gn();r=r===void 0?null:r;var d=l.memoizedState;return d!==null&&r!==null&&ru(r,d[1])?d[0]:(l.memoizedState=[i,r],i)}function um(i,r){var l=Gn();r=r===void 0?null:r;var d=l.memoizedState;return d!==null&&r!==null&&ru(r,d[1])?d[0]:(i=i(),l.memoizedState=[i,r],i)}function dm(i,r,l){return(Ds&21)===0?(i.baseState&&(i.baseState=!1,Pn=!0),i.memoizedState=l):(ii(l,r)||(l=$f(),Rt.lanes|=l,Ms|=l,i.baseState=!0),r)}function SS(i,r){var l=ft;ft=l!==0&&4>l?l:4,i(!0);var d=su.transition;su.transition={};try{i(!1),r()}finally{ft=l,su.transition=d}}function hm(){return Gn().memoizedState}function xS(i,r,l){var d=rs(i);if(l={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null},fm(i))pm(r,l);else if(l=Wp(i,r,l,d),l!==null){var g=Sn();li(l,i,d,g),mm(l,r,d)}}function kS(i,r,l){var d=rs(i),g={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null};if(fm(i))pm(r,g);else{var _=i.alternate;if(i.lanes===0&&(_===null||_.lanes===0)&&(_=r.lastRenderedReducer,_!==null))try{var L=r.lastRenderedState,Y=_(L,l);if(g.hasEagerState=!0,g.eagerState=Y,ii(Y,L)){var J=r.interleaved;J===null?(g.next=g,Jc(r)):(g.next=J.next,J.next=g),r.interleaved=g;return}}catch{}finally{}l=Wp(i,r,g,d),l!==null&&(g=Sn(),li(l,i,d,g),mm(l,r,d))}}function fm(i){var r=i.alternate;return i===Rt||r!==null&&r===Rt}function pm(i,r){yo=Ha=!0;var l=i.pending;l===null?r.next=r:(r.next=l.next,l.next=r),i.pending=r}function mm(i,r,l){if((l&4194240)!==0){var d=r.lanes;d&=i.pendingLanes,l|=d,r.lanes=l,fc(i,l)}}var Ka={readContext:Yn,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useInsertionEffect:gn,useLayoutEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useMutableSource:gn,useSyncExternalStore:gn,useId:gn,unstable_isNewReconciler:!1},CS={readContext:Yn,useCallback:function(i,r){return pi().memoizedState=[i,r===void 0?null:r],i},useContext:Yn,useEffect:sm,useImperativeHandle:function(i,r,l){return l=l!=null?l.concat([i]):null,Ua(4194308,4,am.bind(null,r,i),l)},useLayoutEffect:function(i,r){return Ua(4194308,4,i,r)},useInsertionEffect:function(i,r){return Ua(4,2,i,r)},useMemo:function(i,r){var l=pi();return r=r===void 0?null:r,i=i(),l.memoizedState=[i,r],i},useReducer:function(i,r,l){var d=pi();return r=l!==void 0?l(r):r,d.memoizedState=d.baseState=r,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:r},d.queue=i,i=i.dispatch=xS.bind(null,Rt,i),[d.memoizedState,i]},useRef:function(i){var r=pi();return i={current:i},r.memoizedState=i},useState:nm,useDebugValue:du,useDeferredValue:function(i){return pi().memoizedState=i},useTransition:function(){var i=nm(!1),r=i[0];return i=SS.bind(null,i[1]),pi().memoizedState=i,[r,i]},useMutableSource:function(){},useSyncExternalStore:function(i,r,l){var d=Rt,g=pi();if(Ct){if(l===void 0)throw Error(n(407));l=l()}else{if(l=r(),tn===null)throw Error(n(349));(Ds&30)!==0||Qp(d,r,l)}g.memoizedState=l;var _={value:l,getSnapshot:r};return g.queue=_,sm(Zp.bind(null,d,_,i),[i]),d.flags|=2048,So(9,Jp.bind(null,d,_,l,r),void 0,null),l},useId:function(){var i=pi(),r=tn.identifierPrefix;if(Ct){var l=Li,d=Pi;l=(d&~(1<<32-Nn(d)-1)).toString(32)+l,r=":"+r+"R"+l,l=wo++,0<l&&(r+="H"+l.toString(32)),r+=":"}else l=bS++,r=":"+r+"r"+l.toString(32)+":";return i.memoizedState=r},unstable_isNewReconciler:!1},ES={readContext:Yn,useCallback:cm,useContext:Yn,useEffect:uu,useImperativeHandle:lm,useInsertionEffect:rm,useLayoutEffect:om,useMemo:um,useReducer:lu,useRef:im,useState:function(){return lu(bo)},useDebugValue:du,useDeferredValue:function(i){var r=Gn();return dm(r,Vt.memoizedState,i)},useTransition:function(){var i=lu(bo)[0],r=Gn().memoizedState;return[i,r]},useMutableSource:Gp,useSyncExternalStore:Xp,useId:hm,unstable_isNewReconciler:!1},NS={readContext:Yn,useCallback:cm,useContext:Yn,useEffect:uu,useImperativeHandle:lm,useInsertionEffect:rm,useLayoutEffect:om,useMemo:um,useReducer:cu,useRef:im,useState:function(){return cu(bo)},useDebugValue:du,useDeferredValue:function(i){var r=Gn();return Vt===null?r.memoizedState=i:dm(r,Vt.memoizedState,i)},useTransition:function(){var i=cu(bo)[0],r=Gn().memoizedState;return[i,r]},useMutableSource:Gp,useSyncExternalStore:Xp,useId:hm,unstable_isNewReconciler:!1};function ri(i,r){if(i&&i.defaultProps){r=B({},r),i=i.defaultProps;for(var l in i)r[l]===void 0&&(r[l]=i[l]);return r}return r}function hu(i,r,l,d){r=i.memoizedState,l=l(d,r),l=l==null?r:B({},r,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var qa={isMounted:function(i){return(i=i._reactInternals)?Ot(i)===i:!1},enqueueSetState:function(i,r,l){i=i._reactInternals;var d=Sn(),g=rs(i),_=Ti(d,g);_.payload=r,l!=null&&(_.callback=l),r=ts(i,_,g),r!==null&&(li(r,i,g,d),Ba(r,i,g))},enqueueReplaceState:function(i,r,l){i=i._reactInternals;var d=Sn(),g=rs(i),_=Ti(d,g);_.tag=1,_.payload=r,l!=null&&(_.callback=l),r=ts(i,_,g),r!==null&&(li(r,i,g,d),Ba(r,i,g))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var l=Sn(),d=rs(i),g=Ti(l,d);g.tag=2,r!=null&&(g.callback=r),r=ts(i,g,d),r!==null&&(li(r,i,d,l),Ba(r,i,d))}};function gm(i,r,l,d,g,_,L){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(d,_,L):r.prototype&&r.prototype.isPureReactComponent?!ao(l,d)||!ao(g,_):!0}function vm(i,r,l){var d=!1,g=Ji,_=r.contextType;return typeof _=="object"&&_!==null?_=Yn(_):(g=Rn(r)?Rs:mn.current,d=r.contextTypes,_=(d=d!=null)?dr(i,g):Ji),r=new r(l,_),i.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=qa,i.stateNode=r,r._reactInternals=i,d&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=g,i.__reactInternalMemoizedMaskedChildContext=_),r}function _m(i,r,l,d){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,d),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,d),r.state!==i&&qa.enqueueReplaceState(r,r.state,null)}function fu(i,r,l,d){var g=i.stateNode;g.props=l,g.state=i.memoizedState,g.refs={},Zc(i);var _=r.contextType;typeof _=="object"&&_!==null?g.context=Yn(_):(_=Rn(r)?Rs:mn.current,g.context=dr(i,_)),g.state=i.memoizedState,_=r.getDerivedStateFromProps,typeof _=="function"&&(hu(i,r,_,l),g.state=i.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(r=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),r!==g.state&&qa.enqueueReplaceState(g,g.state,null),za(i,l,g,d),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308)}function yr(i,r){try{var l="",d=r;do l+=ce(d),d=d.return;while(d);var g=l}catch(_){g=`
39
39
  Error generating stack: `+_.message+`
40
- `+_.stack}return{value:i,source:r,stack:g,digest:null}}function pu(i,r,l){return{value:i,source:null,stack:l??null,digest:r??null}}function mu(i,r){try{console.error(r.value)}catch(l){setTimeout(function(){throw l})}}var jS=typeof WeakMap=="function"?WeakMap:Map;function ym(i,r,l){l=Ti(-1,l),l.tag=3,l.payload={element:null};var d=r.value;return l.callback=function(){Za||(Za=!0,Pu=d),mu(i,r)},l}function wm(i,r,l){l=Ti(-1,l),l.tag=3;var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var g=r.value;l.payload=function(){return d(g)},l.callback=function(){mu(i,r)}}var _=i.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(l.callback=function(){mu(i,r),typeof d!="function"&&(is===null?is=new Set([this]):is.add(this));var L=r.stack;this.componentDidCatch(r.value,{componentStack:L!==null?L:""})}),l}function bm(i,r,l){var d=i.pingCache;if(d===null){d=i.pingCache=new jS;var g=new Set;d.set(r,g)}else g=d.get(r),g===void 0&&(g=new Set,d.set(r,g));g.has(l)||(g.add(l),i=HS.bind(null,i,r,l),r.then(i,i))}function Sm(i){do{var r;if((r=i.tag===13)&&(r=i.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return i;i=i.return}while(i!==null);return null}function xm(i,r,l,d,g){return(i.mode&1)===0?(i===r?i.flags|=65536:(i.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(r=Ti(-1,1),r.tag=2,ts(l,r,1))),l.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var RS=M.ReactCurrentOwner,Pn=!1;function bn(i,r,l,d){r.child=i===null?Up(r,null,l,d):mr(r,i.child,l,d)}function km(i,r,l,d,g){l=l.render;var _=r.ref;return vr(r,g),d=ou(i,r,l,d,_,g),l=au(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(Ct&&l&&Uc(r),r.flags|=1,bn(i,r,d,g),r.child)}function Cm(i,r,l,d,g){if(i===null){var _=l.type;return typeof _=="function"&&!Ou(_)&&_.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(r.tag=15,r.type=_,Em(i,r,_,d,g)):(i=rl(l.type,null,d,r,r.mode,g),i.ref=r.ref,i.return=r,r.child=i)}if(_=i.child,(i.lanes&g)===0){var L=_.memoizedProps;if(l=l.compare,l=l!==null?l:ao,l(L,d)&&i.ref===r.ref)return Di(i,r,g)}return r.flags|=1,i=as(_,d),i.ref=r.ref,i.return=r,r.child=i}function Em(i,r,l,d,g){if(i!==null){var _=i.memoizedProps;if(ao(_,d)&&i.ref===r.ref)if(Pn=!1,r.pendingProps=d=_,(i.lanes&g)!==0)(i.flags&131072)!==0&&(Pn=!0);else return r.lanes=i.lanes,Di(i,r,g)}return gu(i,r,l,d,g)}function Nm(i,r,l){var d=r.pendingProps,g=d.children,_=i!==null?i.memoizedState:null;if(d.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},_t(br,Bn),Bn|=l;else{if((l&1073741824)===0)return i=_!==null?_.baseLanes|l:l,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:i,cachePool:null,transitions:null},r.updateQueue=null,_t(br,Bn),Bn|=i,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=_!==null?_.baseLanes:l,_t(br,Bn),Bn|=d}else _!==null?(d=_.baseLanes|l,r.memoizedState=null):d=l,_t(br,Bn),Bn|=d;return bn(i,r,g,l),r.child}function jm(i,r){var l=r.ref;(i===null&&l!==null||i!==null&&i.ref!==l)&&(r.flags|=512,r.flags|=2097152)}function gu(i,r,l,d,g){var _=Rn(l)?Rs:mn.current;return _=dr(r,_),vr(r,g),l=ou(i,r,l,d,_,g),d=au(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(Ct&&d&&Uc(r),r.flags|=1,bn(i,r,l,g),r.child)}function Rm(i,r,l,d,g){if(Rn(l)){var _=!0;Pa(r)}else _=!1;if(vr(r,g),r.stateNode===null)Ya(i,r),vm(r,l,d),fu(r,l,d,g),d=!0;else if(i===null){var L=r.stateNode,Y=r.memoizedProps;L.props=Y;var J=L.context,oe=l.contextType;typeof oe=="object"&&oe!==null?oe=Yn(oe):(oe=Rn(l)?Rs:mn.current,oe=dr(r,oe));var be=l.getDerivedStateFromProps,Se=typeof be=="function"||typeof L.getSnapshotBeforeUpdate=="function";Se||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(Y!==d||J!==oe)&&_m(r,L,d,oe),es=!1;var we=r.memoizedState;L.state=we,za(r,d,L,g),J=r.memoizedState,Y!==d||we!==J||jn.current||es?(typeof be=="function"&&(hu(r,l,be,d),J=r.memoizedState),(Y=es||gm(r,l,Y,d,we,J,oe))?(Se||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(r.flags|=4194308)):(typeof L.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=J),L.props=d,L.state=J,L.context=oe,d=Y):(typeof L.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{L=r.stateNode,Kp(i,r),Y=r.memoizedProps,oe=r.type===r.elementType?Y:ri(r.type,Y),L.props=oe,Se=r.pendingProps,we=L.context,J=l.contextType,typeof J=="object"&&J!==null?J=Yn(J):(J=Rn(l)?Rs:mn.current,J=dr(r,J));var Re=l.getDerivedStateFromProps;(be=typeof Re=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(Y!==Se||we!==J)&&_m(r,L,d,J),es=!1,we=r.memoizedState,L.state=we,za(r,d,L,g);var De=r.memoizedState;Y!==Se||we!==De||jn.current||es?(typeof Re=="function"&&(hu(r,l,Re,d),De=r.memoizedState),(oe=es||gm(r,l,oe,d,we,De,J)||!1)?(be||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(d,De,J),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(d,De,J)),typeof L.componentDidUpdate=="function"&&(r.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof L.componentDidUpdate!="function"||Y===i.memoizedProps&&we===i.memoizedState||(r.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||Y===i.memoizedProps&&we===i.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=De),L.props=d,L.state=De,L.context=J,d=oe):(typeof L.componentDidUpdate!="function"||Y===i.memoizedProps&&we===i.memoizedState||(r.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||Y===i.memoizedProps&&we===i.memoizedState||(r.flags|=1024),d=!1)}return vu(i,r,l,d,_,g)}function vu(i,r,l,d,g,_){jm(i,r);var L=(r.flags&128)!==0;if(!d&&!L)return g&&Dp(r,l,!1),Di(i,r,_);d=r.stateNode,RS.current=r;var Y=L&&typeof l.getDerivedStateFromError!="function"?null:d.render();return r.flags|=1,i!==null&&L?(r.child=mr(r,i.child,null,_),r.child=mr(r,null,Y,_)):bn(i,r,Y,_),r.memoizedState=d.state,g&&Dp(r,l,!0),r.child}function Pm(i){var r=i.stateNode;r.pendingContext?Ap(i,r.pendingContext,r.pendingContext!==r.context):r.context&&Ap(i,r.context,!1),eu(i,r.containerInfo)}function Lm(i,r,l,d,g){return pr(),Vc(g),r.flags|=256,bn(i,r,l,d),r.child}var _u={dehydrated:null,treeContext:null,retryLane:0};function yu(i){return{baseLanes:i,cachePool:null,transitions:null}}function Am(i,r,l){var d=r.pendingProps,g=jt.current,_=!1,L=(r.flags&128)!==0,Y;if((Y=L)||(Y=i!==null&&i.memoizedState===null?!1:(g&2)!==0),Y?(_=!0,r.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),_t(jt,g&1),i===null)return qc(r),i=r.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((r.mode&1)===0?r.lanes=1:i.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(L=d.children,i=d.fallback,_?(d=r.mode,_=r.child,L={mode:"hidden",children:L},(d&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=L):_=ol(L,d,0,null),i=zs(i,d,l,null),_.return=r,i.return=r,_.sibling=i,r.child=_,r.child.memoizedState=yu(l),r.memoizedState=_u,i):wu(r,L));if(g=i.memoizedState,g!==null&&(Y=g.dehydrated,Y!==null))return PS(i,r,L,d,Y,g,l);if(_){_=d.fallback,L=r.mode,g=i.child,Y=g.sibling;var J={mode:"hidden",children:d.children};return(L&1)===0&&r.child!==g?(d=r.child,d.childLanes=0,d.pendingProps=J,r.deletions=null):(d=as(g,J),d.subtreeFlags=g.subtreeFlags&14680064),Y!==null?_=as(Y,_):(_=zs(_,L,l,null),_.flags|=2),_.return=r,d.return=r,d.sibling=_,r.child=d,d=_,_=r.child,L=i.child.memoizedState,L=L===null?yu(l):{baseLanes:L.baseLanes|l,cachePool:null,transitions:L.transitions},_.memoizedState=L,_.childLanes=i.childLanes&~l,r.memoizedState=_u,d}return _=i.child,i=_.sibling,d=as(_,{mode:"visible",children:d.children}),(r.mode&1)===0&&(d.lanes=l),d.return=r,d.sibling=null,i!==null&&(l=r.deletions,l===null?(r.deletions=[i],r.flags|=16):l.push(i)),r.child=d,r.memoizedState=null,d}function wu(i,r){return r=ol({mode:"visible",children:r},i.mode,0,null),r.return=i,i.child=r}function Va(i,r,l,d){return d!==null&&Vc(d),mr(r,i.child,null,l),i=wu(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function PS(i,r,l,d,g,_,L){if(l)return r.flags&256?(r.flags&=-257,d=pu(Error(n(422))),Va(i,r,L,d)):r.memoizedState!==null?(r.child=i.child,r.flags|=128,null):(_=d.fallback,g=r.mode,d=ol({mode:"visible",children:d.children},g,0,null),_=zs(_,g,L,null),_.flags|=2,d.return=r,_.return=r,d.sibling=_,r.child=d,(r.mode&1)!==0&&mr(r,i.child,null,L),r.child.memoizedState=yu(L),r.memoizedState=_u,_);if((r.mode&1)===0)return Va(i,r,L,null);if(g.data==="$!"){if(d=g.nextSibling&&g.nextSibling.dataset,d)var Y=d.dgst;return d=Y,_=Error(n(419)),d=pu(_,d,void 0),Va(i,r,L,d)}if(Y=(L&i.childLanes)!==0,Pn||Y){if(d=tn,d!==null){switch(L&-L){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(d.suspendedLanes|L))!==0?0:g,g!==0&&g!==_.retryLane&&(_.retryLane=g,Ai(i,g),li(d,i,g,-1))}return Iu(),d=pu(Error(n(421))),Va(i,r,L,d)}return g.data==="$?"?(r.flags|=128,r.child=i.child,r=US.bind(null,i),g._reactRetry=r,null):(i=_.treeContext,On=Xi(g.nextSibling),In=r,Ct=!0,si=null,i!==null&&(qn[Vn++]=Pi,qn[Vn++]=Li,qn[Vn++]=Ps,Pi=i.id,Li=i.overflow,Ps=r),r=wu(r,d.children),r.flags|=4096,r)}function Tm(i,r,l){i.lanes|=r;var d=i.alternate;d!==null&&(d.lanes|=r),Qc(i.return,r,l)}function bu(i,r,l,d,g){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:g}:(_.isBackwards=r,_.rendering=null,_.renderingStartTime=0,_.last=d,_.tail=l,_.tailMode=g)}function Dm(i,r,l){var d=r.pendingProps,g=d.revealOrder,_=d.tail;if(bn(i,r,d.children,l),d=jt.current,(d&2)!==0)d=d&1|2,r.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Tm(i,l,r);else if(i.tag===19)Tm(i,l,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}d&=1}if(_t(jt,d),(r.mode&1)===0)r.memoizedState=null;else switch(g){case"forwards":for(l=r.child,g=null;l!==null;)i=l.alternate,i!==null&&Fa(i)===null&&(g=l),l=l.sibling;l=g,l===null?(g=r.child,r.child=null):(g=l.sibling,l.sibling=null),bu(r,!1,g,l,_);break;case"backwards":for(l=null,g=r.child,r.child=null;g!==null;){if(i=g.alternate,i!==null&&Fa(i)===null){r.child=g;break}i=g.sibling,g.sibling=l,l=g,g=i}bu(r,!0,l,null,_);break;case"together":bu(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Ya(i,r){(r.mode&1)===0&&i!==null&&(i.alternate=null,r.alternate=null,r.flags|=2)}function Di(i,r,l){if(i!==null&&(r.dependencies=i.dependencies),Ms|=r.lanes,(l&r.childLanes)===0)return null;if(i!==null&&r.child!==i.child)throw Error(n(153));if(r.child!==null){for(i=r.child,l=as(i,i.pendingProps),r.child=l,l.return=r;i.sibling!==null;)i=i.sibling,l=l.sibling=as(i,i.pendingProps),l.return=r;l.sibling=null}return r.child}function LS(i,r,l){switch(r.tag){case 3:Pm(r),pr();break;case 5:Yp(r);break;case 1:Rn(r.type)&&Pa(r);break;case 4:eu(r,r.stateNode.containerInfo);break;case 10:var d=r.type._context,g=r.memoizedProps.value;_t(Ia,d._currentValue),d._currentValue=g;break;case 13:if(d=r.memoizedState,d!==null)return d.dehydrated!==null?(_t(jt,jt.current&1),r.flags|=128,null):(l&r.child.childLanes)!==0?Am(i,r,l):(_t(jt,jt.current&1),i=Di(i,r,l),i!==null?i.sibling:null);_t(jt,jt.current&1);break;case 19:if(d=(l&r.childLanes)!==0,(i.flags&128)!==0){if(d)return Dm(i,r,l);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),_t(jt,jt.current),d)break;return null;case 22:case 23:return r.lanes=0,Nm(i,r,l)}return Di(i,r,l)}var Mm,Su,Im,Om;Mm=function(i,r){for(var l=r.child;l!==null;){if(l.tag===5||l.tag===6)i.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},Su=function(){},Im=function(i,r,l,d){var g=i.memoizedProps;if(g!==d){i=r.stateNode,Ts(fi.current);var _=null;switch(l){case"input":g=qt(i,g),d=qt(i,d),_=[];break;case"select":g=B({},g,{value:void 0}),d=B({},d,{value:void 0}),_=[];break;case"textarea":g=ut(i,g),d=ut(i,d),_=[];break;default:typeof g.onClick!="function"&&typeof d.onClick=="function"&&(i.onclick=Na)}_e(l,d);var L;l=null;for(oe in g)if(!d.hasOwnProperty(oe)&&g.hasOwnProperty(oe)&&g[oe]!=null)if(oe==="style"){var Y=g[oe];for(L in Y)Y.hasOwnProperty(L)&&(l||(l={}),l[L]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(o.hasOwnProperty(oe)?_||(_=[]):(_=_||[]).push(oe,null));for(oe in d){var J=d[oe];if(Y=g!=null?g[oe]:void 0,d.hasOwnProperty(oe)&&J!==Y&&(J!=null||Y!=null))if(oe==="style")if(Y){for(L in Y)!Y.hasOwnProperty(L)||J&&J.hasOwnProperty(L)||(l||(l={}),l[L]="");for(L in J)J.hasOwnProperty(L)&&Y[L]!==J[L]&&(l||(l={}),l[L]=J[L])}else l||(_||(_=[]),_.push(oe,l)),l=J;else oe==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,Y=Y?Y.__html:void 0,J!=null&&Y!==J&&(_=_||[]).push(oe,J)):oe==="children"?typeof J!="string"&&typeof J!="number"||(_=_||[]).push(oe,""+J):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(o.hasOwnProperty(oe)?(J!=null&&oe==="onScroll"&&bt("scroll",i),_||Y===J||(_=[])):(_=_||[]).push(oe,J))}l&&(_=_||[]).push("style",l);var oe=_;(r.updateQueue=oe)&&(r.flags|=4)}},Om=function(i,r,l,d){l!==d&&(r.flags|=4)};function xo(i,r){if(!Ct)switch(i.tailMode){case"hidden":r=i.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:d.sibling=null}}function vn(i){var r=i.alternate!==null&&i.alternate.child===i.child,l=0,d=0;if(r)for(var g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags&14680064,d|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=d,i.childLanes=l,r}function AS(i,r,l){var d=r.pendingProps;switch(Wc(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(r),null;case 1:return Rn(r.type)&&Ra(),vn(r),null;case 3:return d=r.stateNode,_r(),St(jn),St(mn),iu(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(Da(r)?r.flags|=4:i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,si!==null&&(Tu(si),si=null))),Su(i,r),vn(r),null;case 5:tu(r);var g=Ts(_o.current);if(l=r.type,i!==null&&r.stateNode!=null)Im(i,r,l,d,g),i.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!d){if(r.stateNode===null)throw Error(n(166));return vn(r),null}if(i=Ts(fi.current),Da(r)){d=r.stateNode,l=r.type;var _=r.memoizedProps;switch(d[hi]=r,d[fo]=_,i=(r.mode&1)!==0,l){case"dialog":bt("cancel",d),bt("close",d);break;case"iframe":case"object":case"embed":bt("load",d);break;case"video":case"audio":for(g=0;g<co.length;g++)bt(co[g],d);break;case"source":bt("error",d);break;case"img":case"image":case"link":bt("error",d),bt("load",d);break;case"details":bt("toggle",d);break;case"input":wn(d,_),bt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!_.multiple},bt("invalid",d);break;case"textarea":re(d,_),bt("invalid",d)}_e(l,_),g=null;for(var L in _)if(_.hasOwnProperty(L)){var Y=_[L];L==="children"?typeof Y=="string"?d.textContent!==Y&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,Y,i),g=["children",Y]):typeof Y=="number"&&d.textContent!==""+Y&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,Y,i),g=["children",""+Y]):o.hasOwnProperty(L)&&Y!=null&&L==="onScroll"&&bt("scroll",d)}switch(l){case"input":rt(d),Nt(d,_,!0);break;case"textarea":rt(d),Ie(d);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(d.onclick=Na)}d=g,r.updateQueue=d,d!==null&&(r.flags|=4)}else{L=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Fe(l)),i==="http://www.w3.org/1999/xhtml"?l==="script"?(i=L.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof d.is=="string"?i=L.createElement(l,{is:d.is}):(i=L.createElement(l),l==="select"&&(L=i,d.multiple?L.multiple=!0:d.size&&(L.size=d.size))):i=L.createElementNS(i,l),i[hi]=r,i[fo]=d,Mm(i,r,!1,!1),r.stateNode=i;e:{switch(L=Ce(l,d),l){case"dialog":bt("cancel",i),bt("close",i),g=d;break;case"iframe":case"object":case"embed":bt("load",i),g=d;break;case"video":case"audio":for(g=0;g<co.length;g++)bt(co[g],i);g=d;break;case"source":bt("error",i),g=d;break;case"img":case"image":case"link":bt("error",i),bt("load",i),g=d;break;case"details":bt("toggle",i),g=d;break;case"input":wn(i,d),g=qt(i,d),bt("invalid",i);break;case"option":g=d;break;case"select":i._wrapperState={wasMultiple:!!d.multiple},g=B({},d,{value:void 0}),bt("invalid",i);break;case"textarea":re(i,d),g=ut(i,d),bt("invalid",i);break;default:g=d}_e(l,g),Y=g;for(_ in Y)if(Y.hasOwnProperty(_)){var J=Y[_];_==="style"?ge(i,J):_==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&q(i,J)):_==="children"?typeof J=="string"?(l!=="textarea"||J!=="")&&te(i,J):typeof J=="number"&&te(i,""+J):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(o.hasOwnProperty(_)?J!=null&&_==="onScroll"&&bt("scroll",i):J!=null&&F(i,_,J,L))}switch(l){case"input":rt(i),Nt(i,d,!1);break;case"textarea":rt(i),Ie(i);break;case"option":d.value!=null&&i.setAttribute("value",""+me(d.value));break;case"select":i.multiple=!!d.multiple,_=d.value,_!=null?dt(i,!!d.multiple,_,!1):d.defaultValue!=null&&dt(i,!!d.multiple,d.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=Na)}switch(l){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return vn(r),null;case 6:if(i&&r.stateNode!=null)Om(i,r,i.memoizedProps,d);else{if(typeof d!="string"&&r.stateNode===null)throw Error(n(166));if(l=Ts(_o.current),Ts(fi.current),Da(r)){if(d=r.stateNode,l=r.memoizedProps,d[hi]=r,(_=d.nodeValue!==l)&&(i=In,i!==null))switch(i.tag){case 3:Ea(d.nodeValue,l,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Ea(d.nodeValue,l,(i.mode&1)!==0)}_&&(r.flags|=4)}else d=(l.nodeType===9?l:l.ownerDocument).createTextNode(d),d[hi]=r,r.stateNode=d}return vn(r),null;case 13:if(St(jt),d=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Ct&&On!==null&&(r.mode&1)!==0&&(r.flags&128)===0)Fp(),pr(),r.flags|=98560,_=!1;else if(_=Da(r),d!==null&&d.dehydrated!==null){if(i===null){if(!_)throw Error(n(318));if(_=r.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(n(317));_[hi]=r}else pr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;vn(r),_=!1}else si!==null&&(Tu(si),si=null),_=!0;if(!_)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=l,r):(d=d!==null,d!==(i!==null&&i.memoizedState!==null)&&d&&(r.child.flags|=8192,(r.mode&1)!==0&&(i===null||(jt.current&1)!==0?Yt===0&&(Yt=3):Iu())),r.updateQueue!==null&&(r.flags|=4),vn(r),null);case 4:return _r(),Su(i,r),i===null&&uo(r.stateNode.containerInfo),vn(r),null;case 10:return Xc(r.type._context),vn(r),null;case 17:return Rn(r.type)&&Ra(),vn(r),null;case 19:if(St(jt),_=r.memoizedState,_===null)return vn(r),null;if(d=(r.flags&128)!==0,L=_.rendering,L===null)if(d)xo(_,!1);else{if(Yt!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(L=Fa(i),L!==null){for(r.flags|=128,xo(_,!1),d=L.updateQueue,d!==null&&(r.updateQueue=d,r.flags|=4),r.subtreeFlags=0,d=l,l=r.child;l!==null;)_=l,i=d,_.flags&=14680066,L=_.alternate,L===null?(_.childLanes=0,_.lanes=i,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=L.childLanes,_.lanes=L.lanes,_.child=L.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=L.memoizedProps,_.memoizedState=L.memoizedState,_.updateQueue=L.updateQueue,_.type=L.type,i=L.dependencies,_.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),l=l.sibling;return _t(jt,jt.current&1|2),r.child}i=i.sibling}_.tail!==null&&kt()>Sr&&(r.flags|=128,d=!0,xo(_,!1),r.lanes=4194304)}else{if(!d)if(i=Fa(L),i!==null){if(r.flags|=128,d=!0,l=i.updateQueue,l!==null&&(r.updateQueue=l,r.flags|=4),xo(_,!0),_.tail===null&&_.tailMode==="hidden"&&!L.alternate&&!Ct)return vn(r),null}else 2*kt()-_.renderingStartTime>Sr&&l!==1073741824&&(r.flags|=128,d=!0,xo(_,!1),r.lanes=4194304);_.isBackwards?(L.sibling=r.child,r.child=L):(l=_.last,l!==null?l.sibling=L:r.child=L,_.last=L)}return _.tail!==null?(r=_.tail,_.rendering=r,_.tail=r.sibling,_.renderingStartTime=kt(),r.sibling=null,l=jt.current,_t(jt,d?l&1|2:l&1),r):(vn(r),null);case 22:case 23:return Mu(),d=r.memoizedState!==null,i!==null&&i.memoizedState!==null!==d&&(r.flags|=8192),d&&(r.mode&1)!==0?(Bn&1073741824)!==0&&(vn(r),r.subtreeFlags&6&&(r.flags|=8192)):vn(r),null;case 24:return null;case 25:return null}throw Error(n(156,r.tag))}function TS(i,r){switch(Wc(r),r.tag){case 1:return Rn(r.type)&&Ra(),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return _r(),St(jn),St(mn),iu(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 5:return tu(r),null;case 13:if(St(jt),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(n(340));pr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return St(jt),null;case 4:return _r(),null;case 10:return Xc(r.type._context),null;case 22:case 23:return Mu(),null;case 24:return null;default:return null}}var Ga=!1,_n=!1,DS=typeof WeakSet=="function"?WeakSet:Set,Ae=null;function wr(i,r){var l=i.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){Dt(i,r,d)}else l.current=null}function xu(i,r,l){try{l()}catch(d){Dt(i,r,d)}}var Bm=!1;function MS(i,r){if(Mc=ma,i=gp(),Nc(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var g=d.anchorOffset,_=d.focusNode;d=d.focusOffset;try{l.nodeType,_.nodeType}catch{l=null;break e}var L=0,Y=-1,J=-1,oe=0,be=0,Se=i,we=null;t:for(;;){for(var Re;Se!==l||g!==0&&Se.nodeType!==3||(Y=L+g),Se!==_||d!==0&&Se.nodeType!==3||(J=L+d),Se.nodeType===3&&(L+=Se.nodeValue.length),(Re=Se.firstChild)!==null;)we=Se,Se=Re;for(;;){if(Se===i)break t;if(we===l&&++oe===g&&(Y=L),we===_&&++be===d&&(J=L),(Re=Se.nextSibling)!==null)break;Se=we,we=Se.parentNode}Se=Re}l=Y===-1||J===-1?null:{start:Y,end:J}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ic={focusedElem:i,selectionRange:l},ma=!1,Ae=r;Ae!==null;)if(r=Ae,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,Ae=i;else for(;Ae!==null;){r=Ae;try{var De=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(De!==null){var Oe=De.memoizedProps,Bt=De.memoizedState,ie=r.stateNode,ee=ie.getSnapshotBeforeUpdate(r.elementType===r.type?Oe:ri(r.type,Oe),Bt);ie.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var se=r.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ke){Dt(r,r.return,ke)}if(i=r.sibling,i!==null){i.return=r.return,Ae=i;break}Ae=r.return}return De=Bm,Bm=!1,De}function ko(i,r,l){var d=r.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&i)===i){var _=g.destroy;g.destroy=void 0,_!==void 0&&xu(r,l,_)}g=g.next}while(g!==d)}}function Xa(i,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&i)===i){var d=l.create;l.destroy=d()}l=l.next}while(l!==r)}}function ku(i){var r=i.ref;if(r!==null){var l=i.stateNode;switch(i.tag){case 5:i=l;break;default:i=l}typeof r=="function"?r(i):r.current=i}}function zm(i){var r=i.alternate;r!==null&&(i.alternate=null,zm(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&(delete r[hi],delete r[fo],delete r[Fc],delete r[vS],delete r[_S])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Fm(i){return i.tag===5||i.tag===3||i.tag===4}function $m(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Fm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Cu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.nodeType===8?l.parentNode.insertBefore(i,r):l.insertBefore(i,r):(l.nodeType===8?(r=l.parentNode,r.insertBefore(i,l)):(r=l,r.appendChild(i)),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=Na));else if(d!==4&&(i=i.child,i!==null))for(Cu(i,r,l),i=i.sibling;i!==null;)Cu(i,r,l),i=i.sibling}function Eu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(d!==4&&(i=i.child,i!==null))for(Eu(i,r,l),i=i.sibling;i!==null;)Eu(i,r,l),i=i.sibling}var dn=null,oi=!1;function ns(i,r,l){for(l=l.child;l!==null;)Hm(i,r,l),l=l.sibling}function Hm(i,r,l){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(Ht,l)}catch{}switch(l.tag){case 5:_n||wr(l,r);case 6:var d=dn,g=oi;dn=null,ns(i,r,l),dn=d,oi=g,dn!==null&&(oi?(i=dn,l=l.stateNode,i.nodeType===8?i.parentNode.removeChild(l):i.removeChild(l)):dn.removeChild(l.stateNode));break;case 18:dn!==null&&(oi?(i=dn,l=l.stateNode,i.nodeType===8?zc(i.parentNode,l):i.nodeType===1&&zc(i,l),to(i)):zc(dn,l.stateNode));break;case 4:d=dn,g=oi,dn=l.stateNode.containerInfo,oi=!0,ns(i,r,l),dn=d,oi=g;break;case 0:case 11:case 14:case 15:if(!_n&&(d=l.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){g=d=d.next;do{var _=g,L=_.destroy;_=_.tag,L!==void 0&&((_&2)!==0||(_&4)!==0)&&xu(l,r,L),g=g.next}while(g!==d)}ns(i,r,l);break;case 1:if(!_n&&(wr(l,r),d=l.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=l.memoizedProps,d.state=l.memoizedState,d.componentWillUnmount()}catch(Y){Dt(l,r,Y)}ns(i,r,l);break;case 21:ns(i,r,l);break;case 22:l.mode&1?(_n=(d=_n)||l.memoizedState!==null,ns(i,r,l),_n=d):ns(i,r,l);break;default:ns(i,r,l)}}function Um(i){var r=i.updateQueue;if(r!==null){i.updateQueue=null;var l=i.stateNode;l===null&&(l=i.stateNode=new DS),r.forEach(function(d){var g=WS.bind(null,i,d);l.has(d)||(l.add(d),d.then(g,g))})}}function ai(i,r){var l=r.deletions;if(l!==null)for(var d=0;d<l.length;d++){var g=l[d];try{var _=i,L=r,Y=L;e:for(;Y!==null;){switch(Y.tag){case 5:dn=Y.stateNode,oi=!1;break e;case 3:dn=Y.stateNode.containerInfo,oi=!0;break e;case 4:dn=Y.stateNode.containerInfo,oi=!0;break e}Y=Y.return}if(dn===null)throw Error(n(160));Hm(_,L,g),dn=null,oi=!1;var J=g.alternate;J!==null&&(J.return=null),g.return=null}catch(oe){Dt(g,r,oe)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Wm(r,i),r=r.sibling}function Wm(i,r){var l=i.alternate,d=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(ai(r,i),mi(i),d&4){try{ko(3,i,i.return),Xa(3,i)}catch(Oe){Dt(i,i.return,Oe)}try{ko(5,i,i.return)}catch(Oe){Dt(i,i.return,Oe)}}break;case 1:ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return);break;case 5:if(ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return),i.flags&32){var g=i.stateNode;try{te(g,"")}catch(Oe){Dt(i,i.return,Oe)}}if(d&4&&(g=i.stateNode,g!=null)){var _=i.memoizedProps,L=l!==null?l.memoizedProps:_,Y=i.type,J=i.updateQueue;if(i.updateQueue=null,J!==null)try{Y==="input"&&_.type==="radio"&&_.name!=null&&Be(g,_),Ce(Y,L);var oe=Ce(Y,_);for(L=0;L<J.length;L+=2){var be=J[L],Se=J[L+1];be==="style"?ge(g,Se):be==="dangerouslySetInnerHTML"?q(g,Se):be==="children"?te(g,Se):F(g,be,Se,oe)}switch(Y){case"input":$t(g,_);break;case"textarea":xe(g,_);break;case"select":var we=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!_.multiple;var Re=_.value;Re!=null?dt(g,!!_.multiple,Re,!1):we!==!!_.multiple&&(_.defaultValue!=null?dt(g,!!_.multiple,_.defaultValue,!0):dt(g,!!_.multiple,_.multiple?[]:"",!1))}g[fo]=_}catch(Oe){Dt(i,i.return,Oe)}}break;case 6:if(ai(r,i),mi(i),d&4){if(i.stateNode===null)throw Error(n(162));g=i.stateNode,_=i.memoizedProps;try{g.nodeValue=_}catch(Oe){Dt(i,i.return,Oe)}}break;case 3:if(ai(r,i),mi(i),d&4&&l!==null&&l.memoizedState.isDehydrated)try{to(r.containerInfo)}catch(Oe){Dt(i,i.return,Oe)}break;case 4:ai(r,i),mi(i);break;case 13:ai(r,i),mi(i),g=i.child,g.flags&8192&&(_=g.memoizedState!==null,g.stateNode.isHidden=_,!_||g.alternate!==null&&g.alternate.memoizedState!==null||(Ru=kt())),d&4&&Um(i);break;case 22:if(be=l!==null&&l.memoizedState!==null,i.mode&1?(_n=(oe=_n)||be,ai(r,i),_n=oe):ai(r,i),mi(i),d&8192){if(oe=i.memoizedState!==null,(i.stateNode.isHidden=oe)&&!be&&(i.mode&1)!==0)for(Ae=i,be=i.child;be!==null;){for(Se=Ae=be;Ae!==null;){switch(we=Ae,Re=we.child,we.tag){case 0:case 11:case 14:case 15:ko(4,we,we.return);break;case 1:wr(we,we.return);var De=we.stateNode;if(typeof De.componentWillUnmount=="function"){d=we,l=we.return;try{r=d,De.props=r.memoizedProps,De.state=r.memoizedState,De.componentWillUnmount()}catch(Oe){Dt(d,l,Oe)}}break;case 5:wr(we,we.return);break;case 22:if(we.memoizedState!==null){Vm(Se);continue}}Re!==null?(Re.return=we,Ae=Re):Vm(Se)}be=be.sibling}e:for(be=null,Se=i;;){if(Se.tag===5){if(be===null){be=Se;try{g=Se.stateNode,oe?(_=g.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(Y=Se.stateNode,J=Se.memoizedProps.style,L=J!=null&&J.hasOwnProperty("display")?J.display:null,Y.style.display=ue("display",L))}catch(Oe){Dt(i,i.return,Oe)}}}else if(Se.tag===6){if(be===null)try{Se.stateNode.nodeValue=oe?"":Se.memoizedProps}catch(Oe){Dt(i,i.return,Oe)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===i)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===i)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===i)break e;be===Se&&(be=null),Se=Se.return}be===Se&&(be=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:ai(r,i),mi(i),d&4&&Um(i);break;case 21:break;default:ai(r,i),mi(i)}}function mi(i){var r=i.flags;if(r&2){try{e:{for(var l=i.return;l!==null;){if(Fm(l)){var d=l;break e}l=l.return}throw Error(n(160))}switch(d.tag){case 5:var g=d.stateNode;d.flags&32&&(te(g,""),d.flags&=-33);var _=$m(i);Eu(i,_,g);break;case 3:case 4:var L=d.stateNode.containerInfo,Y=$m(i);Cu(i,Y,L);break;default:throw Error(n(161))}}catch(J){Dt(i,i.return,J)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function IS(i,r,l){Ae=i,Km(i)}function Km(i,r,l){for(var d=(i.mode&1)!==0;Ae!==null;){var g=Ae,_=g.child;if(g.tag===22&&d){var L=g.memoizedState!==null||Ga;if(!L){var Y=g.alternate,J=Y!==null&&Y.memoizedState!==null||_n;Y=Ga;var oe=_n;if(Ga=L,(_n=J)&&!oe)for(Ae=g;Ae!==null;)L=Ae,J=L.child,L.tag===22&&L.memoizedState!==null?Ym(g):J!==null?(J.return=L,Ae=J):Ym(g);for(;_!==null;)Ae=_,Km(_),_=_.sibling;Ae=g,Ga=Y,_n=oe}qm(i)}else(g.subtreeFlags&8772)!==0&&_!==null?(_.return=g,Ae=_):qm(i)}}function qm(i){for(;Ae!==null;){var r=Ae;if((r.flags&8772)!==0){var l=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:_n||Xa(5,r);break;case 1:var d=r.stateNode;if(r.flags&4&&!_n)if(l===null)d.componentDidMount();else{var g=r.elementType===r.type?l.memoizedProps:ri(r.type,l.memoizedProps);d.componentDidUpdate(g,l.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var _=r.updateQueue;_!==null&&Vp(r,_,d);break;case 3:var L=r.updateQueue;if(L!==null){if(l=null,r.child!==null)switch(r.child.tag){case 5:l=r.child.stateNode;break;case 1:l=r.child.stateNode}Vp(r,L,l)}break;case 5:var Y=r.stateNode;if(l===null&&r.flags&4){l=Y;var J=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&l.focus();break;case"img":J.src&&(l.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var oe=r.alternate;if(oe!==null){var be=oe.memoizedState;if(be!==null){var Se=be.dehydrated;Se!==null&&to(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}_n||r.flags&512&&ku(r)}catch(we){Dt(r,r.return,we)}}if(r===i){Ae=null;break}if(l=r.sibling,l!==null){l.return=r.return,Ae=l;break}Ae=r.return}}function Vm(i){for(;Ae!==null;){var r=Ae;if(r===i){Ae=null;break}var l=r.sibling;if(l!==null){l.return=r.return,Ae=l;break}Ae=r.return}}function Ym(i){for(;Ae!==null;){var r=Ae;try{switch(r.tag){case 0:case 11:case 15:var l=r.return;try{Xa(4,r)}catch(J){Dt(r,l,J)}break;case 1:var d=r.stateNode;if(typeof d.componentDidMount=="function"){var g=r.return;try{d.componentDidMount()}catch(J){Dt(r,g,J)}}var _=r.return;try{ku(r)}catch(J){Dt(r,_,J)}break;case 5:var L=r.return;try{ku(r)}catch(J){Dt(r,L,J)}}}catch(J){Dt(r,r.return,J)}if(r===i){Ae=null;break}var Y=r.sibling;if(Y!==null){Y.return=r.return,Ae=Y;break}Ae=r.return}}var OS=Math.ceil,Qa=M.ReactCurrentDispatcher,Nu=M.ReactCurrentOwner,Xn=M.ReactCurrentBatchConfig,at=0,tn=null,Ut=null,hn=0,Bn=0,br=Qi(0),Yt=0,Co=null,Ms=0,Ja=0,ju=0,Eo=null,Ln=null,Ru=0,Sr=1/0,Mi=null,Za=!1,Pu=null,is=null,el=!1,ss=null,tl=0,No=0,Lu=null,nl=-1,il=0;function Sn(){return(at&6)!==0?kt():nl!==-1?nl:nl=kt()}function rs(i){return(i.mode&1)===0?1:(at&2)!==0&&hn!==0?hn&-hn:wS.transition!==null?(il===0&&(il=$f()),il):(i=ft,i!==0||(i=window.event,i=i===void 0?16:Xf(i.type)),i)}function li(i,r,l,d){if(50<No)throw No=0,Lu=null,Error(n(185));Xr(i,l,d),((at&2)===0||i!==tn)&&(i===tn&&((at&2)===0&&(Ja|=l),Yt===4&&os(i,hn)),An(i,d),l===1&&at===0&&(r.mode&1)===0&&(Sr=kt()+500,La&&Zi()))}function An(i,r){var l=i.callbackNode;wb(i,r);var d=ha(i,i===tn?hn:0);if(d===0)l!==null&&Vr(l),i.callbackNode=null,i.callbackPriority=0;else if(r=d&-d,i.callbackPriority!==r){if(l!=null&&Vr(l),r===1)i.tag===0?yS(Xm.bind(null,i)):Mp(Xm.bind(null,i)),mS(function(){(at&6)===0&&Zi()}),l=null;else{switch(Hf(d)){case 1:l=He;break;case 4:l=Ve;break;case 16:l=qe;break;case 536870912:l=wt;break;default:l=qe}l=sg(l,Gm.bind(null,i))}i.callbackPriority=r,i.callbackNode=l}}function Gm(i,r){if(nl=-1,il=0,(at&6)!==0)throw Error(n(327));var l=i.callbackNode;if(xr()&&i.callbackNode!==l)return null;var d=ha(i,i===tn?hn:0);if(d===0)return null;if((d&30)!==0||(d&i.expiredLanes)!==0||r)r=sl(i,d);else{r=d;var g=at;at|=2;var _=Jm();(tn!==i||hn!==r)&&(Mi=null,Sr=kt()+500,Os(i,r));do try{FS();break}catch(Y){Qm(i,Y)}while(!0);Gc(),Qa.current=_,at=g,Ut!==null?r=0:(tn=null,hn=0,r=Yt)}if(r!==0){if(r===2&&(g=dc(i),g!==0&&(d=g,r=Au(i,g))),r===1)throw l=Co,Os(i,0),os(i,d),An(i,kt()),l;if(r===6)os(i,d);else{if(g=i.current.alternate,(d&30)===0&&!BS(g)&&(r=sl(i,d),r===2&&(_=dc(i),_!==0&&(d=_,r=Au(i,_))),r===1))throw l=Co,Os(i,0),os(i,d),An(i,kt()),l;switch(i.finishedWork=g,i.finishedLanes=d,r){case 0:case 1:throw Error(n(345));case 2:Bs(i,Ln,Mi);break;case 3:if(os(i,d),(d&130023424)===d&&(r=Ru+500-kt(),10<r)){if(ha(i,0)!==0)break;if(g=i.suspendedLanes,(g&d)!==d){Sn(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=Bc(Bs.bind(null,i,Ln,Mi),r);break}Bs(i,Ln,Mi);break;case 4:if(os(i,d),(d&4194240)===d)break;for(r=i.eventTimes,g=-1;0<d;){var L=31-Nn(d);_=1<<L,L=r[L],L>g&&(g=L),d&=~_}if(d=g,d=kt()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*OS(d/1960))-d,10<d){i.timeoutHandle=Bc(Bs.bind(null,i,Ln,Mi),d);break}Bs(i,Ln,Mi);break;case 5:Bs(i,Ln,Mi);break;default:throw Error(n(329))}}}return An(i,kt()),i.callbackNode===l?Gm.bind(null,i):null}function Au(i,r){var l=Eo;return i.current.memoizedState.isDehydrated&&(Os(i,r).flags|=256),i=sl(i,r),i!==2&&(r=Ln,Ln=l,r!==null&&Tu(r)),i}function Tu(i){Ln===null?Ln=i:Ln.push.apply(Ln,i)}function BS(i){for(var r=i;;){if(r.flags&16384){var l=r.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var d=0;d<l.length;d++){var g=l[d],_=g.getSnapshot;g=g.value;try{if(!ii(_(),g))return!1}catch{return!1}}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function os(i,r){for(r&=~ju,r&=~Ja,i.suspendedLanes|=r,i.pingedLanes&=~r,i=i.expirationTimes;0<r;){var l=31-Nn(r),d=1<<l;i[l]=-1,r&=~d}}function Xm(i){if((at&6)!==0)throw Error(n(327));xr();var r=ha(i,0);if((r&1)===0)return An(i,kt()),null;var l=sl(i,r);if(i.tag!==0&&l===2){var d=dc(i);d!==0&&(r=d,l=Au(i,d))}if(l===1)throw l=Co,Os(i,0),os(i,r),An(i,kt()),l;if(l===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=r,Bs(i,Ln,Mi),An(i,kt()),null}function Du(i,r){var l=at;at|=1;try{return i(r)}finally{at=l,at===0&&(Sr=kt()+500,La&&Zi())}}function Is(i){ss!==null&&ss.tag===0&&(at&6)===0&&xr();var r=at;at|=1;var l=Xn.transition,d=ft;try{if(Xn.transition=null,ft=1,i)return i()}finally{ft=d,Xn.transition=l,at=r,(at&6)===0&&Zi()}}function Mu(){Bn=br.current,St(br)}function Os(i,r){i.finishedWork=null,i.finishedLanes=0;var l=i.timeoutHandle;if(l!==-1&&(i.timeoutHandle=-1,pS(l)),Ut!==null)for(l=Ut.return;l!==null;){var d=l;switch(Wc(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Ra();break;case 3:_r(),St(jn),St(mn),iu();break;case 5:tu(d);break;case 4:_r();break;case 13:St(jt);break;case 19:St(jt);break;case 10:Xc(d.type._context);break;case 22:case 23:Mu()}l=l.return}if(tn=i,Ut=i=as(i.current,null),hn=Bn=r,Yt=0,Co=null,ju=Ja=Ms=0,Ln=Eo=null,As!==null){for(r=0;r<As.length;r++)if(l=As[r],d=l.interleaved,d!==null){l.interleaved=null;var g=d.next,_=l.pending;if(_!==null){var L=_.next;_.next=g,d.next=L}l.pending=d}As=null}return i}function Qm(i,r){do{var l=Ut;try{if(Gc(),$a.current=Ka,Ha){for(var d=Rt.memoizedState;d!==null;){var g=d.queue;g!==null&&(g.pending=null),d=d.next}Ha=!1}if(Ds=0,en=Vt=Rt=null,yo=!1,wo=0,Nu.current=null,l===null||l.return===null){Yt=1,Co=r,Ut=null;break}e:{var _=i,L=l.return,Y=l,J=r;if(r=hn,Y.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var oe=J,be=Y,Se=be.tag;if((be.mode&1)===0&&(Se===0||Se===11||Se===15)){var we=be.alternate;we?(be.updateQueue=we.updateQueue,be.memoizedState=we.memoizedState,be.lanes=we.lanes):(be.updateQueue=null,be.memoizedState=null)}var Re=Sm(L);if(Re!==null){Re.flags&=-257,xm(Re,L,Y,_,r),Re.mode&1&&bm(_,oe,r),r=Re,J=oe;var De=r.updateQueue;if(De===null){var Oe=new Set;Oe.add(J),r.updateQueue=Oe}else De.add(J);break e}else{if((r&1)===0){bm(_,oe,r),Iu();break e}J=Error(n(426))}}else if(Ct&&Y.mode&1){var Bt=Sm(L);if(Bt!==null){(Bt.flags&65536)===0&&(Bt.flags|=256),xm(Bt,L,Y,_,r),Vc(yr(J,Y));break e}}_=J=yr(J,Y),Yt!==4&&(Yt=2),Eo===null?Eo=[_]:Eo.push(_),_=L;do{switch(_.tag){case 3:_.flags|=65536,r&=-r,_.lanes|=r;var ie=ym(_,J,r);qp(_,ie);break e;case 1:Y=J;var ee=_.type,se=_.stateNode;if((_.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(is===null||!is.has(se)))){_.flags|=65536,r&=-r,_.lanes|=r;var ke=wm(_,Y,r);qp(_,ke);break e}}_=_.return}while(_!==null)}eg(l)}catch($e){r=$e,Ut===l&&l!==null&&(Ut=l=l.return);continue}break}while(!0)}function Jm(){var i=Qa.current;return Qa.current=Ka,i===null?Ka:i}function Iu(){(Yt===0||Yt===3||Yt===2)&&(Yt=4),tn===null||(Ms&268435455)===0&&(Ja&268435455)===0||os(tn,hn)}function sl(i,r){var l=at;at|=2;var d=Jm();(tn!==i||hn!==r)&&(Mi=null,Os(i,r));do try{zS();break}catch(g){Qm(i,g)}while(!0);if(Gc(),at=l,Qa.current=d,Ut!==null)throw Error(n(261));return tn=null,hn=0,Yt}function zS(){for(;Ut!==null;)Zm(Ut)}function FS(){for(;Ut!==null&&!tr();)Zm(Ut)}function Zm(i){var r=ig(i.alternate,i,Bn);i.memoizedProps=i.pendingProps,r===null?eg(i):Ut=r,Nu.current=null}function eg(i){var r=i;do{var l=r.alternate;if(i=r.return,(r.flags&32768)===0){if(l=AS(l,r,Bn),l!==null){Ut=l;return}}else{if(l=TS(l,r),l!==null){l.flags&=32767,Ut=l;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Yt=6,Ut=null;return}}if(r=r.sibling,r!==null){Ut=r;return}Ut=r=i}while(r!==null);Yt===0&&(Yt=5)}function Bs(i,r,l){var d=ft,g=Xn.transition;try{Xn.transition=null,ft=1,$S(i,r,l,d)}finally{Xn.transition=g,ft=d}return null}function $S(i,r,l,d){do xr();while(ss!==null);if((at&6)!==0)throw Error(n(327));l=i.finishedWork;var g=i.finishedLanes;if(l===null)return null;if(i.finishedWork=null,i.finishedLanes=0,l===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var _=l.lanes|l.childLanes;if(bb(i,_),i===tn&&(Ut=tn=null,hn=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||el||(el=!0,sg(qe,function(){return xr(),null})),_=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||_){_=Xn.transition,Xn.transition=null;var L=ft;ft=1;var Y=at;at|=4,Nu.current=null,MS(i,l),Wm(l,i),aS(Ic),ma=!!Mc,Ic=Mc=null,i.current=l,IS(l),ca(),at=Y,ft=L,Xn.transition=_}else i.current=l;if(el&&(el=!1,ss=i,tl=g),_=i.pendingLanes,_===0&&(is=null),uc(l.stateNode),An(i,kt()),r!==null)for(d=i.onRecoverableError,l=0;l<r.length;l++)g=r[l],d(g.value,{componentStack:g.stack,digest:g.digest});if(Za)throw Za=!1,i=Pu,Pu=null,i;return(tl&1)!==0&&i.tag!==0&&xr(),_=i.pendingLanes,(_&1)!==0?i===Lu?No++:(No=0,Lu=i):No=0,Zi(),null}function xr(){if(ss!==null){var i=Hf(tl),r=Xn.transition,l=ft;try{if(Xn.transition=null,ft=16>i?16:i,ss===null)var d=!1;else{if(i=ss,ss=null,tl=0,(at&6)!==0)throw Error(n(331));var g=at;for(at|=4,Ae=i.current;Ae!==null;){var _=Ae,L=_.child;if((Ae.flags&16)!==0){var Y=_.deletions;if(Y!==null){for(var J=0;J<Y.length;J++){var oe=Y[J];for(Ae=oe;Ae!==null;){var be=Ae;switch(be.tag){case 0:case 11:case 15:ko(8,be,_)}var Se=be.child;if(Se!==null)Se.return=be,Ae=Se;else for(;Ae!==null;){be=Ae;var we=be.sibling,Re=be.return;if(zm(be),be===oe){Ae=null;break}if(we!==null){we.return=Re,Ae=we;break}Ae=Re}}}var De=_.alternate;if(De!==null){var Oe=De.child;if(Oe!==null){De.child=null;do{var Bt=Oe.sibling;Oe.sibling=null,Oe=Bt}while(Oe!==null)}}Ae=_}}if((_.subtreeFlags&2064)!==0&&L!==null)L.return=_,Ae=L;else e:for(;Ae!==null;){if(_=Ae,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:ko(9,_,_.return)}var ie=_.sibling;if(ie!==null){ie.return=_.return,Ae=ie;break e}Ae=_.return}}var ee=i.current;for(Ae=ee;Ae!==null;){L=Ae;var se=L.child;if((L.subtreeFlags&2064)!==0&&se!==null)se.return=L,Ae=se;else e:for(L=ee;Ae!==null;){if(Y=Ae,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:Xa(9,Y)}}catch($e){Dt(Y,Y.return,$e)}if(Y===L){Ae=null;break e}var ke=Y.sibling;if(ke!==null){ke.return=Y.return,Ae=ke;break e}Ae=Y.return}}if(at=g,Zi(),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(Ht,i)}catch{}d=!0}return d}finally{ft=l,Xn.transition=r}}return!1}function tg(i,r,l){r=yr(l,r),r=ym(i,r,1),i=ts(i,r,1),r=Sn(),i!==null&&(Xr(i,1,r),An(i,r))}function Dt(i,r,l){if(i.tag===3)tg(i,i,l);else for(;r!==null;){if(r.tag===3){tg(r,i,l);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(is===null||!is.has(d))){i=yr(l,i),i=wm(r,i,1),r=ts(r,i,1),i=Sn(),r!==null&&(Xr(r,1,i),An(r,i));break}}r=r.return}}function HS(i,r,l){var d=i.pingCache;d!==null&&d.delete(r),r=Sn(),i.pingedLanes|=i.suspendedLanes&l,tn===i&&(hn&l)===l&&(Yt===4||Yt===3&&(hn&130023424)===hn&&500>kt()-Ru?Os(i,0):ju|=l),An(i,r)}function ng(i,r){r===0&&((i.mode&1)===0?r=1:(r=da,da<<=1,(da&130023424)===0&&(da=4194304)));var l=Sn();i=Ai(i,r),i!==null&&(Xr(i,r,l),An(i,l))}function US(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),ng(i,l)}function WS(i,r){var l=0;switch(i.tag){case 13:var d=i.stateNode,g=i.memoizedState;g!==null&&(l=g.retryLane);break;case 19:d=i.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(r),ng(i,l)}var ig;ig=function(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps||jn.current)Pn=!0;else{if((i.lanes&l)===0&&(r.flags&128)===0)return Pn=!1,LS(i,r,l);Pn=(i.flags&131072)!==0}else Pn=!1,Ct&&(r.flags&1048576)!==0&&Ip(r,Ta,r.index);switch(r.lanes=0,r.tag){case 2:var d=r.type;Ya(i,r),i=r.pendingProps;var g=dr(r,mn.current);vr(r,l),g=ou(null,r,d,i,g,l);var _=au();return r.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Rn(d)?(_=!0,Pa(r)):_=!1,r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Zc(r),g.updater=qa,r.stateNode=g,g._reactInternals=r,fu(r,d,i,l),r=vu(null,r,d,!0,_,l)):(r.tag=0,Ct&&_&&Uc(r),bn(null,r,g,l),r=r.child),r;case 16:d=r.elementType;e:{switch(Ya(i,r),i=r.pendingProps,g=d._init,d=g(d._payload),r.type=d,g=r.tag=qS(d),i=ri(d,i),g){case 0:r=gu(null,r,d,i,l);break e;case 1:r=Rm(null,r,d,i,l);break e;case 11:r=km(null,r,d,i,l);break e;case 14:r=Cm(null,r,d,ri(d.type,i),l);break e}throw Error(n(306,d,""))}return r;case 0:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),gu(i,r,d,g,l);case 1:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Rm(i,r,d,g,l);case 3:e:{if(Pm(r),i===null)throw Error(n(387));d=r.pendingProps,_=r.memoizedState,g=_.element,Kp(i,r),za(r,d,null,l);var L=r.memoizedState;if(d=L.element,_.isDehydrated)if(_={element:d,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){g=yr(Error(n(423)),r),r=Lm(i,r,d,l,g);break e}else if(d!==g){g=yr(Error(n(424)),r),r=Lm(i,r,d,l,g);break e}else for(On=Xi(r.stateNode.containerInfo.firstChild),In=r,Ct=!0,si=null,l=Up(r,null,d,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(pr(),d===g){r=Di(i,r,l);break e}bn(i,r,d,l)}r=r.child}return r;case 5:return Yp(r),i===null&&qc(r),d=r.type,g=r.pendingProps,_=i!==null?i.memoizedProps:null,L=g.children,Oc(d,g)?L=null:_!==null&&Oc(d,_)&&(r.flags|=32),jm(i,r),bn(i,r,L,l),r.child;case 6:return i===null&&qc(r),null;case 13:return Am(i,r,l);case 4:return eu(r,r.stateNode.containerInfo),d=r.pendingProps,i===null?r.child=mr(r,null,d,l):bn(i,r,d,l),r.child;case 11:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),km(i,r,d,g,l);case 7:return bn(i,r,r.pendingProps,l),r.child;case 8:return bn(i,r,r.pendingProps.children,l),r.child;case 12:return bn(i,r,r.pendingProps.children,l),r.child;case 10:e:{if(d=r.type._context,g=r.pendingProps,_=r.memoizedProps,L=g.value,_t(Ia,d._currentValue),d._currentValue=L,_!==null)if(ii(_.value,L)){if(_.children===g.children&&!jn.current){r=Di(i,r,l);break e}}else for(_=r.child,_!==null&&(_.return=r);_!==null;){var Y=_.dependencies;if(Y!==null){L=_.child;for(var J=Y.firstContext;J!==null;){if(J.context===d){if(_.tag===1){J=Ti(-1,l&-l),J.tag=2;var oe=_.updateQueue;if(oe!==null){oe=oe.shared;var be=oe.pending;be===null?J.next=J:(J.next=be.next,be.next=J),oe.pending=J}}_.lanes|=l,J=_.alternate,J!==null&&(J.lanes|=l),Qc(_.return,l,r),Y.lanes|=l;break}J=J.next}}else if(_.tag===10)L=_.type===r.type?null:_.child;else if(_.tag===18){if(L=_.return,L===null)throw Error(n(341));L.lanes|=l,Y=L.alternate,Y!==null&&(Y.lanes|=l),Qc(L,l,r),L=_.sibling}else L=_.child;if(L!==null)L.return=_;else for(L=_;L!==null;){if(L===r){L=null;break}if(_=L.sibling,_!==null){_.return=L.return,L=_;break}L=L.return}_=L}bn(i,r,g.children,l),r=r.child}return r;case 9:return g=r.type,d=r.pendingProps.children,vr(r,l),g=Yn(g),d=d(g),r.flags|=1,bn(i,r,d,l),r.child;case 14:return d=r.type,g=ri(d,r.pendingProps),g=ri(d.type,g),Cm(i,r,d,g,l);case 15:return Em(i,r,r.type,r.pendingProps,l);case 17:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Ya(i,r),r.tag=1,Rn(d)?(i=!0,Pa(r)):i=!1,vr(r,l),vm(r,d,g),fu(r,d,g,l),vu(null,r,d,!0,i,l);case 19:return Dm(i,r,l);case 22:return Nm(i,r,l)}throw Error(n(156,r.tag))};function sg(i,r){return Ns(i,r)}function KS(i,r,l,d){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(i,r,l,d){return new KS(i,r,l,d)}function Ou(i){return i=i.prototype,!(!i||!i.isReactComponent)}function qS(i){if(typeof i=="function")return Ou(i)?1:0;if(i!=null){if(i=i.$$typeof,i===I)return 11;if(i===A)return 14}return 2}function as(i,r){var l=i.alternate;return l===null?(l=Qn(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&14680064,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l}function rl(i,r,l,d,g,_){var L=2;if(d=i,typeof i=="function")Ou(i)&&(L=1);else if(typeof i=="string")L=5;else e:switch(i){case O:return zs(l.children,g,_,r);case Z:L=8,g|=8;break;case X:return i=Qn(12,l,r,g|2),i.elementType=X,i.lanes=_,i;case C:return i=Qn(13,l,r,g),i.elementType=C,i.lanes=_,i;case T:return i=Qn(19,l,r,g),i.elementType=T,i.lanes=_,i;case U:return ol(l,g,_,r);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Q:L=10;break e;case z:L=9;break e;case I:L=11;break e;case A:L=14;break e;case $:L=16,d=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return r=Qn(L,l,r,g),r.elementType=i,r.type=d,r.lanes=_,r}function zs(i,r,l,d){return i=Qn(7,i,d,r),i.lanes=l,i}function ol(i,r,l,d){return i=Qn(22,i,d,r),i.elementType=U,i.lanes=l,i.stateNode={isHidden:!1},i}function Bu(i,r,l){return i=Qn(6,i,null,r),i.lanes=l,i}function zu(i,r,l){return r=Qn(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}function VS(i,r,l,d,g){this.tag=r,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hc(0),this.expirationTimes=hc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hc(0),this.identifierPrefix=d,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Fu(i,r,l,d,g,_,L,Y,J){return i=new VS(i,r,l,Y,J),r===1?(r=1,_===!0&&(r|=8)):r=0,_=Qn(3,null,null,r),i.current=_,_.stateNode=i,_.memoizedState={element:d,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zc(_),i}function YS(i,r,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:G,key:d==null?null:""+d,children:i,containerInfo:r,implementation:l}}function rg(i){if(!i)return Ji;i=i._reactInternals;e:{if(Ot(i)!==i||i.tag!==1)throw Error(n(170));var r=i;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Rn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(n(171))}if(i.tag===1){var l=i.type;if(Rn(l))return Tp(i,l,r)}return r}function og(i,r,l,d,g,_,L,Y,J){return i=Fu(l,d,!0,i,g,_,L,Y,J),i.context=rg(null),l=i.current,d=Sn(),g=rs(l),_=Ti(d,g),_.callback=r??null,ts(l,_,g),i.current.lanes=g,Xr(i,g,d),An(i,d),i}function al(i,r,l,d){var g=r.current,_=Sn(),L=rs(g);return l=rg(l),r.context===null?r.context=l:r.pendingContext=l,r=Ti(_,L),r.payload={element:i},d=d===void 0?null:d,d!==null&&(r.callback=d),i=ts(g,r,L),i!==null&&(li(i,g,L,_),Ba(i,g,L)),L}function ll(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function ag(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<r?l:r}}function $u(i,r){ag(i,r),(i=i.alternate)&&ag(i,r)}function GS(){return null}var lg=typeof reportError=="function"?reportError:function(i){console.error(i)};function Hu(i){this._internalRoot=i}cl.prototype.render=Hu.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(n(409));al(i,r,null,null)},cl.prototype.unmount=Hu.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Is(function(){al(null,i,null,null)}),r[ji]=null}};function cl(i){this._internalRoot=i}cl.prototype.unstable_scheduleHydration=function(i){if(i){var r=Kf();i={blockedOn:null,target:i,priority:r};for(var l=0;l<Vi.length&&r!==0&&r<Vi[l].priority;l++);Vi.splice(l,0,i),l===0&&Yf(i)}};function Uu(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function ul(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function cg(){}function XS(i,r,l,d,g){if(g){if(typeof d=="function"){var _=d;d=function(){var oe=ll(L);_.call(oe)}}var L=og(r,d,i,0,null,!1,!1,"",cg);return i._reactRootContainer=L,i[ji]=L.current,uo(i.nodeType===8?i.parentNode:i),Is(),L}for(;g=i.lastChild;)i.removeChild(g);if(typeof d=="function"){var Y=d;d=function(){var oe=ll(J);Y.call(oe)}}var J=Fu(i,0,!1,null,null,!1,!1,"",cg);return i._reactRootContainer=J,i[ji]=J.current,uo(i.nodeType===8?i.parentNode:i),Is(function(){al(r,J,l,d)}),J}function dl(i,r,l,d,g){var _=l._reactRootContainer;if(_){var L=_;if(typeof g=="function"){var Y=g;g=function(){var J=ll(L);Y.call(J)}}al(r,L,i,g)}else L=XS(l,r,i,g,d);return ll(L)}Uf=function(i){switch(i.tag){case 3:var r=i.stateNode;if(r.current.memoizedState.isDehydrated){var l=Gr(r.pendingLanes);l!==0&&(fc(r,l|1),An(r,kt()),(at&6)===0&&(Sr=kt()+500,Zi()))}break;case 13:Is(function(){var d=Ai(i,1);if(d!==null){var g=Sn();li(d,i,1,g)}}),$u(i,1)}},pc=function(i){if(i.tag===13){var r=Ai(i,134217728);if(r!==null){var l=Sn();li(r,i,134217728,l)}$u(i,134217728)}},Wf=function(i){if(i.tag===13){var r=rs(i),l=Ai(i,r);if(l!==null){var d=Sn();li(l,i,r,d)}$u(i,r)}},Kf=function(){return ft},qf=function(i,r){var l=ft;try{return ft=i,r()}finally{ft=l}},Qe=function(i,r,l){switch(r){case"input":if($t(i,l),r=l.name,l.type==="radio"&&r!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<l.length;r++){var d=l[r];if(d!==i&&d.form===i.form){var g=ja(d);if(!g)throw Error(n(90));Xe(d),$t(d,g)}}}break;case"textarea":xe(i,l);break;case"select":r=l.value,r!=null&&dt(i,!!l.multiple,r,!1)}},Wn=Du,ui=Is;var QS={usingClientEntryPoint:!1,Events:[po,cr,ja,Jt,ni,Du]},jo={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},JS={bundleType:jo.bundleType,version:jo.version,rendererPackageName:jo.rendererPackageName,rendererConfig:jo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:M.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Es(i),i===null?null:i.stateNode},findFiberByHostInstance:jo.findFiberByHostInstance||GS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hl.isDisabled&&hl.supportsFiber)try{Ht=hl.inject(JS),Zt=hl}catch{}}return Tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QS,Tn.createPortal=function(i,r){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uu(r))throw Error(n(200));return YS(i,r,null,l)},Tn.createRoot=function(i,r){if(!Uu(i))throw Error(n(299));var l=!1,d="",g=lg;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),r=Fu(i,1,!1,null,null,l,!1,d,g),i[ji]=r.current,uo(i.nodeType===8?i.parentNode:i),new Hu(r)},Tn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Es(r),i=i===null?null:i.stateNode,i},Tn.flushSync=function(i){return Is(i)},Tn.hydrate=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!0,l)},Tn.hydrateRoot=function(i,r,l){if(!Uu(i))throw Error(n(405));var d=l!=null&&l.hydratedSources||null,g=!1,_="",L=lg;if(l!=null&&(l.unstable_strictMode===!0&&(g=!0),l.identifierPrefix!==void 0&&(_=l.identifierPrefix),l.onRecoverableError!==void 0&&(L=l.onRecoverableError)),r=og(r,null,i,1,l??null,g,!1,_,L),i[ji]=r.current,uo(i),d)for(i=0;i<d.length;i++)l=d[i],g=l._getVersion,g=g(l._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[l,g]:r.mutableSourceEagerHydrationData.push(l,g);return new cl(r)},Tn.render=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!1,l)},Tn.unmountComponentAtNode=function(i){if(!ul(i))throw Error(n(40));return i._reactRootContainer?(Is(function(){dl(null,null,i,!1,function(){i._reactRootContainer=null,i[ji]=null})}),!0):!1},Tn.unstable_batchedUpdates=Du,Tn.unstable_renderSubtreeIntoContainer=function(i,r,l,d){if(!ul(l))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return dl(i,r,l,!1,d)},Tn.version="18.3.1-next-f1338f8080-20240426",Tn}var vg;function a0(){if(vg)return qu.exports;vg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qu.exports=o0(),qu.exports}var _g;function l0(){if(_g)return fl;_g=1;var e=a0();return fl.createRoot=e.createRoot,fl.hydrateRoot=e.hydrateRoot,fl}var c0=l0();const u0=qh(c0);function Ft(e,t,n={}){return fetch(e,{...n,headers:{...n.headers||{},Authorization:`Bearer ${t}`}})}const V_=e=>`nc_seen_${e}`;async function Te(e,t,n={}){const s=await Ft(e,t,{method:n.method||"GET",headers:{"content-type":"application/json"},body:n.body?JSON.stringify(n.body):void 0}),o=await s.json().catch(()=>({}));if(!s.ok){const a=new Error(o.error||`HTTP ${s.status}`);throw a.status=s.status,a.data=o,a}return o}const ln=e=>Array.isArray(e)&&e.length?`/api/route/${e.map(encodeURIComponent).join("/")}/_`:"/api",cn=(e,t)=>`${ln(e)}/fleet/${t}`,ws=(e,t)=>Te(cn(t,"status"),e),Yh=(e,t,n)=>Te(cn(n,"up"),e,{method:"POST",body:t}),Il=(e,t,n)=>Te(cn(n,"down"),e,{method:"POST",body:t}),Y_=(e,t,n)=>Te(cn(n,"boot"),e,{method:"POST",body:t}),Fo=(e,t,n)=>Te(cn(n,"restart"),e,{method:"POST",body:{cell:t}}),Gh=(e,t)=>Te(cn(t,"definitions"),e),d0=(e,t)=>Te(cn(t,"credentials/status"),e),yg=(e,t,n,s)=>Te(cn(s,"credentials/set"),e,{method:"POST",body:{envKey:t,value:n}}),h0=(e,t,n)=>Te(cn(n,"credentials/remove"),e,{method:"POST",body:{envKey:t}}),f0=(e,t,n)=>Te(cn(n,"define-engine"),e,{method:"POST",body:{def:t}}),p0=(e,t,n,s,o)=>Te(cn(o,"edit-engine"),e,{method:"POST",body:{id:t,patch:n,envChanges:s}}),m0=(e,t,n)=>Te(cn(n,"remove-engine"),e,{method:"POST",body:{id:t}}),g0=(e,t,n)=>Te(cn(n,"define-cell"),e,{method:"POST",body:{def:t}}),G_=(e,t,n,s)=>Te(cn(s,"edit-cell"),e,{method:"POST",body:{id:t,patch:n}}),X_=(e,t,n=!1,s)=>Te(cn(s,"remove-cell"),e,{method:"POST",body:{id:t,stop:n}}),v0=(e,t,n)=>Te(cn(n,"import-cell"),e,{method:"POST",body:t}),_0=(e,t,n)=>Te(cn(n,"restore-cells"),e,{method:"POST",body:{cells:t}}),y0=(e,t,n,s)=>Te(cn(s,"restore-engines"),e,{method:"POST",body:{engines:t,overwrite:!!n}}),Xh=(e,t,n)=>Te(`${ln(n)}/sessions/${encodeURIComponent(t)}`,e,{method:"DELETE"}),Q_=(e,t,n,s)=>Te(`${ln(s)}/sessions/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{technical:!!n}}),Qh=(e,t,n)=>Te(`${ln(n)}/fs/dirs${t?`?path=${encodeURIComponent(t)}`:""}`,e),J_=e=>Te("/api/settings",e),w0=e=>Te("/api/nodes",e),b0=e=>Te("/api/peers",e),Z_=(e,t=[])=>Te(`${ln(t)}/vl-nodes`,e),S0=(e,t,n,s={},o=[])=>Te(`${ln(o)}/vl-nodes/${encodeURIComponent(t)}/commands`,e,{method:"POST",body:{kind:n,args:s}}),x0=(e,t,n=0,s=[])=>Te(`${ln(s)}/vl-nodes/${encodeURIComponent(t)}/events${n?`?after=${encodeURIComponent(n)}`:""}`,e),ey=e=>Te("/api/topology",e),Jh=(e,t)=>Te(`${ln(t)}/sessions`,e),Zh=(e,t)=>Te(`${ln(t)}/config`,e),wg=(e,t)=>Te(`${ln(t)}/topology`,e),Ud=(e,t)=>Te("/api/settings/config",e,{method:"POST",body:t}),k0=e=>Te("/api/settings/token/rotate",e,{method:"POST"}),C0=(e,t)=>Te("/api/settings/nodes/pair",e,{method:"POST",body:t}),bg=(e,t,n=[])=>Te(`${ln(n)}/settings/peering/invite`,e,{method:"POST",body:t||{}}),ty=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/label`,e,{method:"PATCH",body:{label:n}}),E0=e=>Te("/api/settings/node-aliases",e),N0=(e,t,n)=>Te(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{alias:n}}),Sg=(e,t)=>Te(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"DELETE"}),j0=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"PATCH",body:n}),R0=(e,t)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"DELETE"}),ef=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/${n}`,e,{method:"POST"}),P0=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/share`,e,{method:"PATCH",body:{shared:n}}),L0=(e,t,n,s=[])=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{visibility:n,selected:s}}),A0=e=>Te("/api/settings/audio",e),T0=(e,t)=>Te("/api/settings/audio/consent",e,{method:"PATCH",body:{consent:t}}),D0=e=>Te("/api/settings/audio/test",e,{method:"POST",body:{}}),M0=e=>Te("/api/settings/audio/stop",e,{method:"POST",body:{}}),I0=e=>Te("/api/settings/audio/groups",e),O0=(e,t,n)=>Te(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"PUT",body:n}),B0=(e,t)=>Te(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"DELETE"}),z0=e=>Te("/api/settings/service/regenerate",e,{method:"POST"}),F0=e=>Te("/api/settings/update/check",e,{method:"POST"}),$0=e=>Te("/api/settings/update/apply",e,{method:"POST"}),Jl=(e,t)=>`${ln(e)}/diagnostics/${t}`,H0=(e,t=[])=>Te(Jl(t,"status"),e),U0=(e,{after:t=0,limit:n=200}={},s=[])=>Te(`${Jl(s,"logs")}?after=${encodeURIComponent(t)}&limit=${encodeURIComponent(n)}`,e),xg=(e,t,n,s=[])=>Te(Jl(s,"verbose"),e,{method:"PATCH",body:{enabled:t,durationSeconds:n}}),W0=(e,t=[])=>Te(Jl(t,"logs"),e,{method:"DELETE"}),K0=(e,t=!0)=>Te(`/api/asks${t?"?open=1":""}`,e),q0=(e,t,n)=>Te(`/api/asks/${encodeURIComponent(t)}/answer`,e,{method:"POST",body:{text:n}}),V0=(e,t)=>Te(`/api/asks/${encodeURIComponent(t)}`,e,{method:"DELETE"}),pl=(e,t=[])=>Te(`${ln(t)}/decks`,e),kg=(e,t,n=[])=>Te(`${ln(n)}/decks`,e,{method:"POST",body:{name:t}}),ml=(e,t,n,s,o=[])=>Te(`${ln(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PUT",body:{layout:n,expectedRevision:s}}),Y0=(e,t,n,s,o=[])=>Te(`${ln(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{name:n,expectedRevision:s}}),G0=(e,t,n,s=[])=>Te(`${ln(s)}/decks/${encodeURIComponent(t)}`,e,{method:"DELETE",body:{expectedRevision:n}}),X0={power:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3v8"}),c.jsx("path",{d:"M6.6 6.6a8 8 0 1 0 10.8 0"})]}),folder:c.jsx("path",{d:"M4 6a2 2 0 0 1 2-2h3.6a2 2 0 0 1 1.4.6L12.4 6H18a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z"}),keyboard:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"6",width:"18",height:"12",rx:"2"}),c.jsx("path",{d:"M7 10h.01M11 10h.01M15 10h.01M17 14h.01M7 14h7"})]}),mic:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3"}),c.jsx("path",{d:"M5 11a7 7 0 0 0 14 0"}),c.jsx("path",{d:"M12 18v3"})]}),enter:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M20 5v6a2 2 0 0 1-2 2H5"}),c.jsx("polyline",{points:"9 9 5 13 9 17"})]}),send:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M22 2 15 22 11 13 2 9Z"}),c.jsx("path",{d:"M22 2 11 13"})]}),trash:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M4 7h16"}),c.jsx("path",{d:"M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"}),c.jsx("path",{d:"M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12"}),c.jsx("path",{d:"M10 11v6M14 11v6"})]}),x:c.jsx("path",{d:"M6 6l12 12M18 6 6 18"}),refresh:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36L21 8"}),c.jsx("polyline",{points:"21 3 21 8 16 8"})]}),boot:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"13",rx:"2"}),c.jsx("path",{d:"M8 21h8M12 17v4M12 12V7"}),c.jsx("polyline",{points:"9 10 12 7 15 10"})]}),upload:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 16V5"}),c.jsx("polyline",{points:"8 9 12 5 16 9"}),c.jsx("path",{d:"M5 20h14"})]}),chevronLeft:c.jsx("polyline",{points:"14 6 8 12 14 18"}),chevronUp:c.jsx("polyline",{points:"6 14 12 8 18 14"}),chevronDown:c.jsx("polyline",{points:"6 10 12 16 18 10"}),history:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),c.jsx("polyline",{points:"3 3 3 8 8 8"}),c.jsx("path",{d:"M12 7v5l3 2"})]}),attach:c.jsx("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"}),file:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),c.jsx("polyline",{points:"14 2 14 8 20 8"})]}),camera:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14.5 4h-5L7.5 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3.5z"}),c.jsx("circle",{cx:"12",cy:"13",r:"3.5"})]}),image:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),c.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),c.jsx("path",{d:"M21 15l-5-5L5 21"})]}),zoomIn:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6M11 8v6"})]}),zoomOut:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6"})]}),gear:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"12",cy:"12",r:"3"}),c.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),copy:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),c.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})};function Je({name:e,size:t=20}){return c.jsx("svg",{className:"nc-icon",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:X0[e]||null})}const Q0=["all","pinned","active","off","technical"],ny="nc_sidebar_views_v1",iy="nc_sidebar_order_v1";function sy(e){return Q0.includes(e)?e:"all"}function J0(e,t=[],n="all"){const s=sy(n);return s==="technical"?e.technical===!0:e.technical===!0?!1:s==="pinned"?t.includes(e.key):s==="active"?!!e.live:s==="off"?!e.live:!0}function Z0(e,t,n=[],s=[]){const o=n.indexOf(e.key),a=n.indexOf(t.key),u=o===-1?Number.MAX_SAFE_INTEGER:o,h=a===-1?Number.MAX_SAFE_INTEGER:a,f=s.indexOf(e.key),m=s.indexOf(t.key),v=f===-1?Number.MAX_SAFE_INTEGER:f,b=m===-1?Number.MAX_SAFE_INTEGER:m;return u-h||v-b||+!!t.live-+!!e.live||+!!t.fresh-+!!e.fresh||Number(t.activity||0)-Number(e.activity||0)||String(e.label||"").localeCompare(String(t.label||""))||String(e.key||"").localeCompare(String(t.key||""))}function ex(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(iy));if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[s,o]of Object.entries(t).slice(0,64)){if(typeof s!="string"||!s||s.length>160||!Array.isArray(o))continue;const a=[...new Set(o.filter(u=>typeof u=="string"&&u&&u.length<=256))].slice(0,128);a.length&&(n[s]=a)}return n}catch{return{}}}function Fi(e,t){return Array.isArray(e==null?void 0:e[t])?e[t]:[]}function tx(e,t=globalThis.localStorage){try{t.setItem(iy,JSON.stringify(e))}catch{}return e}function nx(e,t,n,s,o=[]){if(typeof t!="string"||!t||n===s)return e;const a=[...new Set(o.filter(y=>typeof y=="string"&&y))];if(!a.includes(n)||!a.includes(s))return e;const u=Fi(e,t).filter(y=>a.includes(y)),h=[...u,...a.filter(y=>!u.includes(y))],f=h.indexOf(n),m=h.indexOf(s);h.splice(f,1);const v=h.indexOf(s),b=f<m?v+1:v;return h.splice(b,0,n),{...e,[t]:h}}function ix(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(ny));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Cg(e,t){var n,s;return{open:((n=e==null?void 0:e[t])==null?void 0:n.open)!==!1,filter:sy((s=e==null?void 0:e[t])==null?void 0:s.filter)}}function sx(e,t=globalThis.localStorage){try{t.setItem(ny,JSON.stringify(e))}catch{}return e}function Eg(e,t=""){const n=String(t||"").trim().toLocaleLowerCase();return n?[e.label,e.key,e.searchText].filter(Boolean).join(" ").toLocaleLowerCase().includes(n):!0}function gs(e=[],t=[],n="all",s=[]){return[...e].filter(o=>J0(o,t,n)).sort((o,a)=>Z0(o,a,t,s))}const tf=["it","en","es"];function rx(){try{const e=typeof navigator<"u"&&navigator.language||"",t=String(e).slice(0,2).toLowerCase();return tf.includes(t)?t:"en"}catch{return"en"}}const jl=rx(),ry="nc_lang",Wd="nc-lang";function oy(){return typeof localStorage<"u"?localStorage:null}const gl={it:{"update-available":"nuova versione {v} disponibile","install-version-mismatch":"installazione incompleta: frontend e server non coincidono (v{v})",reload:"ricarica","grid-empty":"trascina qui una sessione dalla sidebar, o doppio-clic per la vista singola","grid-full":"il deck può mostrare al massimo 9 sessioni",pin:"fissa in cima",reorder:"riordina","reorder-help":"trascina la maniglia; frecce su/giu da tastiera","rename-node":"rinomina nodo","rename-node-prompt":"Nuovo nome del nodo in NexusCrew","rename-node-invalid":"Nome non valido: massimo 64 caratteri, senza a capo.","reorder-deck-help":"trascina il deck; frecce sinistra/destra da tastiera",sessions:"sessioni","new-session":"nuova sessione",new:"nuova",fleet:"Flotta","fleet-tmux":"flotta tmux","other-sessions":"Altre sessioni","view-all":"tutte","view-pinned":"fissate","view-active":"attive","view-off":"spente","view-technical":"tecniche","mark-technical":"nascondi come sessione tecnica","mark-normal":"mostra come sessione normale","position-local":"Locale",files:"file",refresh:"aggiorna","filter-placeholder":"filtra sessioni…","loading-fleet":"carico la flotta…","no-sessions":"nessuna sessione tmux viva — la flotta parte al boot (systemd)","no-match":'nessuna sessione contiene "{q}"',"copy-url":"clicca per copiare l'URL","ssh-only":"solo tunnel SSH/VPN","new-files-outbox":"nuovi file in outbox",terminate:"termina","terminate-confirm":'Terminare la sessione "{name}"?',"cell-on":"tmux vivo","cell-off":"spenta","cell-working":"al lavoro","cell-idle":"in attesa","cell-degraded":"degradata: unit attiva, tmux morto","power-on":"accendi","power-off":"spegni","boot-enable":"attiva al boot","boot-disable":"disattiva al boot","state-on":"accesa","state-off":"spenta",engine:"Engine",model:"Modello","model-default":"Modello predefinito del provider","model-remembered":"Ultimo modello usato con questo engine","boot-persist":"avvia al boot","remove-boot":"togli anche dal boot","power-config-in-settings":"Engine, provider, profilo, modello e permessi si modificano in Impostazioni → Flotta.","no-remote-control":"⚠ engine non-native: niente RC da app claude.ai (da qui la piloti comunque)",cancel:"annulla",name:"nome","name-invalid":"nome non valido: a-zA-Z0-9._- max 64, senza '-' iniziale",cwd:"cartella",browse:"sfoglia","fs-home":"home","fs-parent":".. su",preset:"preset","preset-2x2":"griglia 2×2","preset-columns":"colonne","preset-equalize":"equalizza",collapse:"comprimi",expand:"espandi",create:"crea","auth-prompt":"Incolla il token (stampato dal server):","remember-device":"ricorda su questo device","zoom-out":"testo più piccolo","zoom-in":"testo più grande",composer:"composer",windows:"{n} finestre","empty-files":"vuota",upload:"carica","no-sessions-short":"nessuna sessione","composer-placeholder":"scrivi o detta…","composer-history-tools":"cronologia e dimensione input","composer-history":"cronologia della cella","composer-history-empty":"nessun input inviato","composer-history-clear":"cancella cronologia di questa cella","composer-expand":"espandi input","composer-collapse":"riduci input","composer-clear-data":"cancella bozze e cronologia","composer-clear-data-help":"Rimuove da questo browser tutte le bozze e la cronologia input delle celle.","composer-clear-confirm":"Cancellare tutte le bozze e la cronologia input salvate in questo browser?","composer-clear-done":"Bozze e cronologia cancellate.","composer-clear-failed":"Impossibile cancellare i dati del composer in questo browser.",attach:"allega","attach-file":"File","attach-camera":"Fotocamera","attach-gallery":"Galleria","attach-uploading":"carico…","attach-upload-progress":"allegato {n}/{total}…","attach-uploaded":"{n} allegati caricati",voice:"voice",send:"invia","composer-send-failed":"connessione non pronta — testo conservato, riprova",close:"chiudi","lang-label":"lingua",decks:"deck","new-deck":"nuovo deck","deck-name":"nome deck","open-deck-window":"apri in una nuova finestra","detach-deck":"stacca in una nuova finestra","deck-current":"questo deck (finestra corrente)","deck-owner-unavailable":"nodo owner non condiviso o non raggiungibile","rename-deck":"rinomina deck","delete-deck":"elimina deck","delete-deck-confirm":'Eliminare il deck "{name}"?',"send-to-deck":"manda al deck…","deck-autosave":"salvataggio automatico",saving:"salvataggio…",saved:"salvato","popup-blocked":"popup bloccato: apri qui","expand-owner":"espandi i deck di {owner}","collapse-owner":"comprimi i deck di {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} deck","dot-working":"in uso (finestra attiva)","dot-on":"aperta in background","dot-neutral":"non aperta","dot-warn":"nodo offline","select-drag":"trascina per selezionare","copy-manual":"seleziona e copia manualmente","toggle-sidebar":"mostra/nascondi la barra laterale",settings:"impostazioni","tab-roles":"ruoli","tab-nodes":"nodi",local:"Locale",location:"Dove","pairing-link":"link di pairing","pairing-required":"nome, alias SSH e link di pairing sono obbligatori","pairing-connect-help":"Per collegare un nodo servono: nome, Host SSH già funzionante e link/QR creato sull’altra installazione NexusCrew.","pairing-localhost-hint":"127.0.0.1 nel link è corretto: non aprirlo qui. NexusCrew usa invito e porta attraverso l’Host SSH.","scan-qr":"scansiona QR","pairing-qr-invalid":"QR di pairing non valido","invite-node":"invita un nodo","create-pairing-link":"crea link / QR","visibility-network":"tutta la rete","visibility-relay":"solo relay","visibility-selected":"nodi selezionati","hydra-simple":"locale + nodi, una sola rete","local-ready":"Questo dispositivo è pronto. Puoi usarlo da solo o collegarlo a un nodo.","local-only":"solo locale","add-node":"aggiungi nodo",connect:"collega","node-connected":"Nodo collegato. La rete verrà sincronizzata automaticamente.","tab-system":"sistema","tab-fleet":"flotta","tab-audio":"audio","system-general":"generale","system-diagnostics":"diagnostica","system-this-node":"questo nodo","system-updates":"aggiornamenti","system-security":"sicurezza","system-local-data":"dati locali del browser","system-terminal":"terminale","alternate-screen":"schermo alternato","alternate-screen-help":"Mantiene il comportamento tmux standard per le nuove sessioni NexusCrew. Un’applicazione che segue il mouse scorre da sé; le altre fanno scorrere la storia di tmux. Non modifica le celle già attive.","tab-input":"input","tab-diagnostics":"diagnostica","input-settings-local":"Preferenze locali di questo browser. Si applicano subito a vista singola e deck, senza modificare il nodo remoto.","terminal-keyboard-gesture":"Apertura tastiera virtuale dal terminale","terminal-keyboard-double-tap":"Doppio tap (predefinito)","terminal-keyboard-single-tap":"Tap singolo","terminal-keyboard-never":"Mai dal terminale","terminal-keyboard-gesture-help":"Il tastierino e STT seguono i controlli separati sotto. Mouse e tastiera fisica restano utilizzabili.","keybar-ime-lock":"Tastierino: mantieni chiusa la tastiera virtuale","keybar-ime-lock-help":"ESC, frecce, PgUp/PgDn, Enter e menu inviano direttamente al PTY senza dare focus a un campo di testo.","voice-ime-lock":"Microfono STT: mantieni chiusa la tastiera virtuale","voice-ime-lock-help":"Il tap sul microfono avvia o ferma la voce senza focalizzare il composer.","keybar-enter-show":"Mostra Enter verticale nel tastierino","keybar-enter-show-help":"Enter resta a destra di PgUp/PgDn ed è alto quanto entrambe le righe.","keybar-layout":"Layout tastierino","keybar-layout-full":"Esteso (predefinito)","keybar-layout-compact":"Compatto","keybar-layout-help":"Compatto: una riga con expand ⊞ per accedere al set completo senza cambiare la preferenza.","input-settings-reset":"ripristina predefiniti input","diagnostics-local":"Questo nodo","diagnostics-target":"Nodo da diagnosticare","diagnostics-verbose":"Log verbosi temporanei","diagnostics-duration":"Durata verbose","diagnostics-expires":"Verbose attivo fino alle {time}","diagnostics-off":"Verbose spento; warning ed errori operativi restano disponibili.","diagnostics-level":"Livello","diagnostics-all-levels":"tutti i livelli","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"scorrimento automatico","diagnostics-log":"Log diagnostico sanitizzato","diagnostics-empty":"Nessun evento diagnostico.","diagnostics-export":"esporta JSON","diagnostics-export-failed":"Esportazione non disponibile in questo browser.","diagnostics-clear":"svuota","diagnostics-clear-confirm":"Svuotare il buffer diagnostico di questo nodo?","diagnostics-unsupported":"Questo peer è offline o non supporta la diagnostica strutturata.","fleet-editor-loading":"Caricamento dell'editor Fleet…","fleet-editor-load-error":"Impossibile caricare l'editor Fleet.","fleet-editor-unavailable":"Editor Fleet non disponibile in questa posizione.","fleet-managed":"gestito da NexusCrew","fleet-custom":"comando personalizzato","fleet-managed-help":"Client, provider e avvio sono gestiti internamente; i segreti non vengono mostrati.","fleet-shell-engine-help":"Shell locale risolta sul dispositivo al momento dell’avvio; nessun percorso viene salvato nel backup.","fleet-shell-command-placeholder":"comando opzionale, es. npm test","fleet-shell-command-help":"Esecuzione tramite shell login interattiva (-lic), con PATH e alias utente. La cella si ferma quando il comando termina; gli errori immediati vengono segnalati.","fleet-shell-command-metachar":"Pipe, redirect, variabili e altri metacaratteri vengono interpretati dalla shell del dispositivo.","fleet-shell-interactive":"Vuoto: apre una shell interattiva locale e mantiene la cella attiva.","fleet-shell-launch-help":"Il comando Shell si configura nella cella da Impostazioni → Flotta.","fleet-credential-title":"API key su questo dispositivo","fleet-credential-help":"La key resta solo sul nodo selezionato, non viene mostrata, esportata o condivisa con la rete.","fleet-credential-set":"imposta key","fleet-credential-change":"cambia key","fleet-credential-forget":"dimentica","fleet-credential-saved":"Key salvata localmente.","fleet-credential-removed":"Key locale rimossa.","fleet-credential-remove-confirm":"Rimuovere la key locale {key}?","fleet-credential-source-environment":"ambiente","fleet-credential-source-local":"store locale","fleet-credential-source-compatibility":"config compatibile","fleet-credential-source-missing":"mancante","fleet-credential-source-policy":"origine credenziale","fleet-credential-source-policy-auto":"auto (precedenza legacy)","fleet-credential-source-policy-nexuscrew-store":"solo store NexusCrew","fleet-credential-source-policy-environment":"solo ambiente","fleet-key-section":"KEY","fleet-key-variable":"Variabile","fleet-key-value":"Valore per {key}","fleet-key-used-by":"Usata da: {engines}","fleet-key-used-by-none":"Non ancora usata da engine configurati su questo nodo.","fleet-key-shared-impact":"Sostituire o rimuovere {key} interessa tutti gli engine elencati: {engines}.","fleet-key-enter":"inserisci la key","fleet-key-blank-keeps":"vuoto = mantieni la fonte attuale","fleet-key-reveal":"mostra","fleet-key-hide":"nascondi","fleet-key-local-help":"Il valore resta write-only sul nodo selezionato e non entra in engine, backup o federazione.","fleet-key-create-missing":"Crea esplicitamente l’engine senza key (resterà “key richiesta”).","fleet-key-partial-create":"Engine creato; la key non è stata salvata. Puoi riprovare senza creare duplicati.","fleet-key-partial-edit":"Engine aggiornato; la key non è stata salvata. Le modifiche all’engine restano applicate.","fleet-provider-notice-claude-openrouter":"Claude Code è ottimizzato per modelli Anthropic: altri provider potrebbero non funzionare correttamente. Fast mode richiede il provider Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses è beta e stateless; Codex-VL non usa fallback Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configurazione Claude isolata con onboarding e fast mode dedicati; la configurazione Claude nativa non viene modificata.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY dal credential layer locale; qwen3.8-max-preview è il modello predefinito e non viene usato alcun fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa il login del CLI (device-code) e la propria configurazione: NexusCrew non legge né copia credenziali. Distinto dal provider "Kimi Code" di Claude Code, che resta il percorso K3 gestito.',"fleet-model-default":"modello predefinito (opzionale)","fleet-model-required":"modello (obbligatorio)","fleet-standard-permissions":"permessi standard","fleet-unsafe-permissions":"non sicuro · ignora approvazioni/sandbox","fleet-unsafe-warning":"Modalità non sicura esplicita: il worker può agire senza le normali approvazioni o protezioni sandbox.","fleet-provider-display":"nome visualizzato del provider","fleet-custom-provider-default":"Provider personalizzato","fleet-api-key-env":"NOME_VARIABILE_API_KEY","fleet-provider-id":"id-provider","fleet-custom-secret-help":"NexusCrew salva solo il nome della variabile d’ambiente, mai il suo valore.","fleet-model-override":"modello alternativo","fleet-ready":"pronto","fleet-not-ready":"non configurato","fleet-engines":"Engine","fleet-cells":"Celle / sessioni cloud","fleet-backup":"backup / ripristino","fleet-backup-help":"Esporta o ripristina selettivamente engine, celle e system prompt. Token, API key e segreti provider non entrano mai nel file.","fleet-backup-export":"esporta","fleet-backup-import":"importa","fleet-backup-download":"scarica backup","fleet-backup-restore":"ripristina selezionate","fleet-backup-import-help":"Scegli un backup JSON, controlla le celle e seleziona l’engine di destinazione prima del ripristino.","fleet-backup-overwrite":"sovrascrive la cella esistente","fleet-backup-new":"nuova cella","fleet-backup-engine-missing":"scegli un engine disponibile","fleet-backup-restore-unavailable":"Il nodo selezionato supporta solo l’esportazione; aggiornalo per ripristinare backup.","fleet-backup-restored":"{n} celle ripristinate","fleet-backup-confirm-overwrite":"Sovrascrivere queste celle? {cells}","fleet-backup-needs-restart":"riavvio necessario: {cells}","fleet-backup-empty":"nessuna cella da esportare","fleet-backup-select-one":"seleziona almeno una cella","fleet-backup-too-large":"backup troppo grande (massimo 1 MB)","fleet-backup-invalid-json":"il file non contiene JSON valido","fleet-backup-invalid-format":"formato o versione del backup non supportati","fleet-backup-invalid-cell":"il backup contiene una cella non valida","fleet-backup-duplicate-cell":"il backup contiene ID cella duplicati","fleet-backup-invalid-engine":"il backup contiene un engine non valido","fleet-backup-duplicate-engine":"il backup contiene ID engine duplicati","fleet-backup-confirm-engine-overwrite":"Sovrascrivere questi engine? I valori ambiente già configurati sul target restano invariati. {engines}","fleet-backup-env-names":"nomi ambiente","fleet-backup-env-values-required":"i valori ambiente vanno configurati sul dispositivo","fleet-system-prompt":"system prompt",characters:"caratteri","select-all":"seleziona tutte","select-none":"nessuna",edit:"modifica",save:"salva",label:"etichetta","command-path":"path assoluto del comando","args-lines":"argomenti, uno per riga","env-write-only":"I valori env sono write-only: vuoto mantiene il valore esistente.","fleet-new-engine":"Nuovo engine","fleet-new-cell":"Nuova cella","fleet-saved":"Definizione salvata.","fleet-restart-confirm":"Modifica salvata. Riavviare ora: {cells}?","fleet-remove-engine":'Eliminare l’engine "{id}"?',"fleet-remove-cell":'Eliminare la cella "{id}"? Se è attiva verrà prima fermata.',"fleet-cwd-needs-repair":"cartella da riparare","fleet-cwd-repair":"ripara","fleet-cwd-repair-title":"Ripara cartella cella {id}","fleet-cwd-repair-help":"La cartella attuale non è portabile su questo dispositivo: appartiene a un altro dispositivo o non esiste sotto la home. Scegli una cartella home-relative (~) sul dispositivo target; il backend ricalcolerà il percorso assoluto.","fleet-cwd-repair-no-source-path":"Il percorso originale non viene mostrato: è specifico del dispositivo di origine.","fleet-cwd-repair-placeholder":"es. Dev","fleet-cwd-repair-preview":"Nuova cartella: {path}","fleet-cwd-repair-browse":"sfoglia sotto ~","fleet-cwd-repair-fs-empty":"nessuna sottocartella","fleet-cwd-repair-use-current":"usa questa cartella","fleet-cwd-repair-invalid":'percorso non valido: niente assoluto, "..", barra rovesciata o lettera disco',"fleet-cwd-repair-confirm":"Impostare la cartella della cella {id} su {path}? Verrà ricalcolata sul dispositivo target.","fleet-cwd-repair-unportable":"Il percorso scelto non è portabile su questo dispositivo: deve esistere sotto la home.","fleet-cwd-repair-suggestion":"Suggerimento dal dispositivo:","fleet-cwd-repair-use-suggestion":"usa {path}","fleet-cwd-repaired":"Cartella della cella riparata.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: conferma la custom API key (Yes) nel terminale della cella, poi riavvia la cella.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: nel terminale della cella apri /config e abilita "Use custom API key", poi riavvia la cella. Se la chiave è cambiata, aggiorna la credenziale e riprova.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: nel terminale della cella esegui /login (device-code Kimi) oppure /provider, poi riavvia la cella.","fleet-recovery-client-terminal-dialog":"Completa il dialogo mostrato nel terminale della cella, poi riavvia la cella.","settings-readonly":"READONLY attivo: le modifiche sono bloccate dal server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"questa macchina guarda altri nodi via tunnel SSH","role-node":"nodo (raggiungibile)","published-port":"porta pubblicata (opzionale)","no-nodes":"nessun nodo remoto configurato","node-add":"collega installazione NexusCrew","node-connect-help":"La porta SSH serve a raggiungere il server SSH. La porta NexusCrew è invece la porta locale mostrata da `nexuscrew status` sul nodo remoto.","node-name-label":"Nome del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH su questo dispositivo","node-ssh-local-help":"Puoi sostituire l’indirizzo del link con lo stesso alias che funziona usando ssh su questo dispositivo. Alias, agent e chiavi restano locali e non viaggiano nel link.","node-ssh-port-label":"Porta SSH","node-ssh-port-help":"Di solito 22; usa la porta pubblica del server SSH.","node-app-port-label":"Porta NexusCrew sul nodo","node-app-port-help":"È la porta mostrata da `nexuscrew status` sul nodo remoto.","node-name-ph":"nome (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"porta remota (opz.)","node-remove-confirm":'Rimuovere il nodo "{name}"?',"node-remove-warning":"Elimina associazione, credenziali e tunnel locale. Non spegne il dispositivo remoto.","peer-inventory-title":"Nodi collegati al hub","peer-group-hubs":"Hub diretti","peer-group-clients":"Client collegati","peer-group-routed":"Nodi raggiungibili tramite la rete","peer-group-vl":"Nodi VL","vl-owners-unavailable":"Owner VL non raggiunti","peer-routed":"instradato","peer-routed-stale":"instradato, non raggiungibile","peer-visibility":"Visibilità nella rete","node-test":"test","tunnel-start":"avvia tunnel","tunnel-stop":"ferma tunnel","tunnel-restart":"riavvia tunnel","share-node":"Condividi questo nodo","share-local-heading":"Condivisione di questo dispositivo","share-local-hub":"Hub di condivisione","share-local-through":"Condividi {device} tramite {hub}","share-local-active":"Condiviso e raggiungibile dalla rete collegata all’hub.","share-local-pending":"Condivisione richiesta, ma il tunnel è giù: questo dispositivo non è ancora raggiungibile.","share-local-private":"Privato: solo questo dispositivo può usare il collegamento all’hub.","share-local-private-down":"Privato, ma il collegamento all’hub è giù. Riconnetti per applicare e verificare la modalità privata.","share-local-reconnect":"Riconnetti e riconcilia","share-off-hub-reconcile-pending":"Stato privato salvato; la revoca sull’hub è ancora in attesa.","fleet-cell-label":"nome leggibile (facoltativo)","share-off-local-reconcile-pending":"Revoca confermata dall’hub; il tunnel locale deve ancora riconciliarsi.","share-reverse-pool-pending":"Il canale reverse non risulta spento in modo dimostrabile: resta in quarantena, non chiuso.","share-node-off-desc":"Privato: resta collegato al nodo hub, ma gli altri client non possono raggiungerlo.","share-node-on-desc":"Condiviso: il nodo hub può mostrarlo e smistare celle e deck autorizzati.","peer-shared":"Nodo client condiviso nella rete Hydra","peer-private":"Nodo client privato: collegato, non pubblicato nella rete Hydra","peer-vl-federated":"Nodo VL: federato","row-vl-federated":"federato","node-connected-client":"client collegato","transport-used":"in uso","tunnel-up":"tunnel su","tunnel-down":"tunnel giù","vl-poll-online":"online (poll)","vl-poll-offline":"non risponde","authorized-keys-hint":"incolla questa riga in ~/.ssh/authorized_keys sull'host remoto:",copy:"copia",copied:"copiato","token-rotate":"ruota token","token-rotate-explain":"Il nuovo token NON verrà mostrato: recuperalo con `nexuscrew show token`. La sessione corrente verrà invalidata.","service-regenerate":"rigenera service","npm-auto-update":"aggiornamenti automatici da npm","npm-auto-update-help":"Controlla periodicamente latest e installa solo versioni più recenti. Mai downgrade.","npm-update-current":"installata","npm-update-latest":"npm latest","npm-update-check":"controlla ora","npm-update-install":"aggiorna ora","npm-update-restarting":"Aggiornamento avviato; NexusCrew si riaprirà dopo il riavvio del servizio.","npm-update-idle":"aggiornato","npm-update-checking":"controllo in corso","npm-update-available":"aggiornamento disponibile","npm-update-installing":"installazione in corso","npm-update-installed":"installato, riavvio in corso","npm-update-error":"controllo fallito","npm-update-unsupported":"disponibile solo con installazione npm globale","service-installed":"service installato","service-missing":"service non installato","service-active":"attivo","service-inactive":"non attivo",confirm:"conferma",add:"aggiungi",enable:"attiva","wizard-title":"benvenuto in NexusCrew","wizard-skip":"configura dopo dai settings","wizard-step-roles":"ruoli di questa installazione","wizard-step-node":"primo nodo remoto (opzionale)","wizard-done":"tutto pronto","wizard-done-desc":"setup completato — puoi cambiare tutto dai settings",next:"continua",back:"indietro",skip:"salta",finish:"fine","err-node-name":"nome non valido (a-z, 0-9, -, max 32)","err-local-name":"nome locale non valido: usa uno slug univoco, non “localhost”","err-ssh":"ssh non valido (atteso user@host o alias)","err-port":"porta non valida (1–65535)","err-ssh-port":"porta SSH non valida (1–65535)","err-node-port":"porta NexusCrew non valida (1–65535)","node-sessions":"{n} sessioni","tunnel-down-since":"tunnel giù da {t}","node-unreachable":"nodo non raggiungibile","node-passive":"client offline · stato normale","node-offline":"nodo offline","node-offline-seen":"offline · visto {t} fa","node-needs-repair":"legacy · ripeti il pairing","asks-title":"domande dalle celle","ask-dismiss":"Scarta la domanda","ask-reply-ph":"scrivi la risposta…","push-enable":"attiva notifiche push","push-disable":"disattiva notifiche push","push-on":"push attive su questo device","push-off":"push non attive","push-denied":"permesso notifiche negato dal browser","push-unsupported":"push non supportate in questo browser","notification-speech-enable":"leggi le notifiche ad alta voce","notification-speech-help":"Usa la voce del browser solo per nuove notifiche mentre questa PWA è visibile e in primo piano. Con l’app chiusa resta la notifica di sistema.","notification-speech-test":"prova voce","notification-speech-testing":"prova in corso…","notification-speech-preview":"NexusCrew. Notifiche vocali attive.","notification-speech-preview-ok":"Prova vocale completata.","notification-speech-preview-failed":"Il browser non ha avviato la prova vocale. Interagisci con la pagina e riprova.","notification-speech-needs-test":"Per questa sessione dell’app, premi “prova voce” prima di ricevere annunci vocali.","notification-speech-unsupported":"Sintesi vocale non supportata in questo browser.","audio-title":"Audio nativo del nodo","audio-help":"Consenso e controlli valgono solo per questo dispositivo. Share e visibilità non autorizzano suoni.","audio-consent":"consenti TTS su questo nodo","audio-consent-help":"Permette a celle autorizzate, locali o remote, di consegnare un comando vocale. Puoi revocarlo in ogni momento.","audio-capability":"Capability locale","audio-loading":"leggo lo stato audio locale…","audio-adapter":"adapter","audio-adapter-none":"nessuno","audio-installed":"installato","audio-installed-yes":"sì","audio-installed-no":"no","audio-liveness":"disponibilità","audio-liveness-ready":"pronto ad accettare","audio-liveness-unavailable":"non disponibile","audio-languages":"lingue dichiarate","audio-limits":"limiti","audio-test":"prova audio locale","audio-testing":"prova in corso…","audio-stop":"ferma audio locale","audio-stopping":"stop in corso…","audio-test-needs-consent":"Attiva il consenso locale prima di provare la voce.","audio-unavailable":"Nessun adapter TTS nativo disponibile su questo nodo.","audio-test-accepted":"Il nodo ha accettato la prova. Non dimostra che qualcuno l’abbia udita.","audio-test-refused":"Il nodo ha rifiutato la prova.","audio-test-unknown":"Esito della prova sconosciuto: il nodo non può confermare l’avvio.","audio-stop-stopped":"Audio locale fermato.","audio-stop-idle":"Nessun enunciato locale da fermare.","audio-groups-title":"Gruppi audio condivisi","audio-groups-help":"Decide su quali dispositivi si sente la voce quando una cella parla. Il gruppo è una preferenza locale di consegna, non un consenso. Ogni nodo conserva consenso, ACL, disponibilità e Stop locale.","audio-groups-empty":"Nessun gruppo: la voce esce solo su questo nodo.","audio-group-name":"nome gruppo","audio-group-mode":"modalità consegna","audio-group-primary":"primo disponibile (in ordine)","audio-group-fanout":"tutti i nodi elencati","audio-group-targets":"nodi target esatti","audio-group-local":"questo nodo","audio-group-unavailable-target":"non rilevato ora","audio-group-no-targets":"Nessun nodo con instanceId disponibile. Il gruppo non può usare nomi, wildcard o “tutti”.","audio-group-new":"nuovo gruppo","audio-group-edit":"modifica","audio-group-delete":"elimina","audio-group-save":"salva gruppo","audio-group-cancel":"annulla","audio-group-invalid":"Il gruppo richiede un nome valido e almeno un nodeId esatto.","audio-group-save-failed":"Salvataggio gruppo audio non riuscito.","node-display-label":"Nome (etichetta)","routed-node-aliases":"Alias nodi instradati","routed-node-aliases-help":"Visibili solo su questo dispositivo; route e nome remoto non cambiano.","node-local-alias":"Alias su questo dispositivo","alias-on-device":"Alias su questo dispositivo","reset-alias":"Ripristina nome remoto","node-slug-hint":"routing su slug: {slug}","device-name-label":"Nome dispositivo","device-name-hint":"come ti vedono i peer (modificabile)","local-route-name-label":"Nome locale / route","local-route-name-hint":"handle tecnico stabile: label leggibile + suffisso del nodeId; modificabile prima della connessione","err-label":"etichetta non valida (max 64 char, niente a capo)","fleet-inventory":"Celle e sessioni","fleet-inventory-help":"tutte le posizioni (Locale + route Hydra)","fleet-manage-location":"Gestisci posizione","fleet-network-overview":"Panoramica rete","fleet-manage-help":"crea e configura celle nella posizione selezionata","fleet-overview-help":"stato operativo di tutte le posizioni, senza duplicare l’editor","fleet-inventory-empty":"nessuna cella o sessione","cell-switcher-refreshing":"aggiorno le celle…","cell-switcher-empty-active":"nessuna cella attiva verificata","cell-switcher-not-confirmed":"stato non confermato","cell-switcher-not-active":"questa cella non è più attiva","cell-switcher-select":"seleziona una cella","cell-switcher-open":"apri cella","cell-switcher-show-all":"tutte","cell-switcher-show-active":"attive","cell-switcher-close":"chiudi selettore celle","fleet-not-available":"fleet non disponibile su questa posizione",start:"avvia",stop:"ferma",restart:"riavvia",delete:"elimina","copy-manual":"copia non riuscita — seleziona e Cmd+C, o copia a mano","copy-empty":"niente selezione: trascina con Shift per selezionare","selection-held":"evidenziazione persa, testo ancora in mano","invite-hub-only":"Un invito si conia sull’hub. Ammettere un nodo nuovo è la sola cosa che un nodo collegato non può chiedere per conto di un altro: apri NexusCrew sull’hub e crea l’invito da lì.","row-private":"privato","node-detail-open":"apri il dettaglio","node-detail-reach":"Raggiungibilità","node-detail-route":"percorso","node-detail-ssh":"SSH","node-detail-transport":"trasporto","node-detail-owner":"owner","node-detail-authority":"Cosa può fare questo nodo","authority-owner-equivalent":"Autorità pari alla tua: un nodo accoppiato può fare su questa macchina tutto quello che puoi fare tu.","authority-routed":"Non è accoppiato con questa macchina: la sua autorità vive presso l’hub che lo instrada.","authority-no-grants":"I poteri per-nodo non esistono ancora: qui non c’è niente da concedere o togliere.","node-detail-network-view":"Cosa vede di questa rete","node-detail-command":"Comando","vl-no-commands":"Il device non dichiara comandi disponibili.","vl-events-title":"Sessione","vl-events-empty":"Nessun evento in memoria: la sessione non ha ancora parlato, oppure quello che ha detto è uscito dal buffer. La storia resta sul device.","vl-events-gap":"eventi non ricevuti:","vl-events-truncated":"contenuto troncato dal device","vl-events-turn-end":"— fine turno —","vl-events-done":"— sessione conclusa —","vl-events-writer-epoch":"— cambio scrittore —","vl-events-tool":"strumento","vl-events-tool-ok":"concluso","vl-events-tool-failed":"fallito","vl-events-usage":"consumo aggiornato","vl-events-stale":"Aggiornamento non riuscito: quello che vedi potrebbe non essere l’ultimo.","vl-cmd-phase-submitted":"inviato, in attesa di conferma","vl-cmd-phase-inflight":"in corso","vl-cmd-phase-done-ok":"completato","vl-cmd-phase-done-error":"fallito","vl-cmd-status":"stato","vl-cmd-health":"salute","vl-cmd-start":"avvia","vl-cmd-stop":"ferma","vl-cmd-restart":"riavvia","vl-cmd-version":"versione","vl-cmd-capabilities":"capacità","vl-cmd-logs":"log","vl-cmd-unpair":"disaccoppia","node-grant-none":"Nessun nodo scelto: condiviso, ma verso nessuno.","node-grant-unknown":"non più in inventario","node-grant-remove":"togli","node-grant-add":"Aggiungi un nodo","node-grant-search":"Cerca fra i nodi","node-grant-no-candidates":"Nessun nodo corrisponde.","single-view":"vista singola",retract:"riduci","keybar-expand":"espandi la barra tasti","keybar-retract":"riduci la barra tasti","save-and-start":"salva e avvia",permissions:"Permessi","power-on-hint":"Spegni la cella; puoi anche toglierla dal boot.","launch-engine-help":"Provider, credenziali e nuovi engine si creano in Impostazioni → Flotta. Modello e permessi sono per questa cella.","launch-unavailable-hint":"Configurazione engine non disponibile su questo nodo.","import-as-cell":"Importa come cella","import-help":"Riconcilia una sessione tmux esistente in una cella gestita. Scegli un engine già dichiarato: nessun engine viene inventato.","import-engine-required":"scegli un engine (obbligatorio)","test-and-connect":"testa e collega","pairing-v2-hint":"Incolla o scansiona UN solo link: precompila nome, Host SSH ed etichetta quando il link li include (v2).","invite-v2-hint":"Crea un invito monouso completo. Se sei già collegato a un hub, viene usato automaticamente; altrimenti serve solo il suo indirizzo SSH raggiungibile.","invite-network-hint":"Crea un invito per la rete a cui sei già collegato. Il nuovo dispositivo entrerà attraverso l’hub, non si collegherà direttamente a questo dispositivo.","invite-network-label":"Rete di destinazione","invite-network-via":"Hub","invite-network-route":"Un solo collegamento verso l’hub; nodi, celle e deck vengono smistati internamente.","invite-endpoint-label":"Indirizzo SSH di questo hub visto dagli altri dispositivi","invite-endpoint-auto":"Endpoint già configurato","invite-endpoint-needed":"Inserisci user@host o un alias SSH condiviso. Non è 127.0.0.1 e non è l’URL HTTP NexusCrew.","invite-ssh-hint":"Il target SSH con cui L’ALTRO dispositivo raggiunge QUESTA installazione (user@host o alias). Obbligatorio: viene incluso nel link.","invite-next-steps":"copia questo link, apri NexusCrew sull’altro dispositivo e incollalo in Impostazioni → Nodi (o scansiona il QR): al resto pensa NexusCrew","pair-card-title":"collega con un solo link","pair-card-help":"Incolla il link di pairing generato sull’altro dispositivo (o scansiona il suo QR): NexusCrew decodifica, prova la connessione SSH e collega da solo.","pair-paste-ph":"incolla qui il link di pairing","pair-paste-btn":"incolla","pair-advanced":"avanzate / modifica","pair-progress":"collegamento in corso: SSH → invito → conferma → verifica…","pair-retry":"riprova","pair-invalid-link":"questo non è un link di pairing valido","pair-invalid-hint":"serve il link completo (http://…#pair=…) generato dall’altro NexusCrew: non aprirlo, incollalo qui","pair-missing-ssh":"il link non include il target SSH (formato v1): indica in “avanzate” come questo dispositivo raggiunge l’altro via SSH — non viene mai inventato","pair-missing-name":"manca il nome del nodo: completalo in “avanzate”","pair-clipboard-denied":"lettura degli appunti non consentita: incolla manualmente nel campo","pair-clipboard-empty":"appunti vuoti: copia prima il link di pairing","pair-stage-validation":"dati non validi","pair-stage-conflict":"nome già in uso","pair-stage-ssh-start":"avvio del tunnel SSH fallito","pair-stage-ssh-ready":"peer non raggiungibile via SSH","pair-stage-join":"scambio dell’invito fallito","pair-stage-tunnel-final":"tunnel negoziato fallito","pair-stage-confirm":"conferma del pairing fallita","pair-stage-health":"verifica finale della federazione fallita","pair-stage-internal":"errore interno","pair-stage-generic":"connessione fallita","qr-no-camera":"nessuna camera disponibile su questo dispositivo: usa una foto del QR","qr-permission":"permesso camera negato: consentilo nel browser o usa una foto del QR","qr-unsupported":"scanner live non supportato qui: carica una foto del QR","qr-upload":"usa una foto"},en:{"update-available":"new version {v} available","install-version-mismatch":"incomplete installation: frontend and server do not match (v{v})",reload:"reload","grid-empty":"drag a session here from the sidebar, or double-click for single view","grid-full":"a deck can show at most 9 sessions",pin:"pin to top",reorder:"reorder","reorder-help":"drag the handle; keyboard up/down arrows","rename-node":"rename node","rename-node-prompt":"New node name in NexusCrew","rename-node-invalid":"Invalid name: maximum 64 characters, no line breaks.","reorder-deck-help":"drag the deck; keyboard left/right arrows",sessions:"sessions","new-session":"new session",new:"new",fleet:"Fleet","fleet-tmux":"tmux fleet","other-sessions":"Other sessions","view-all":"all","view-pinned":"pinned","view-active":"active","view-off":"off","view-technical":"technical","mark-technical":"hide as technical session","mark-normal":"show as normal session","position-local":"Local",files:"files",refresh:"refresh","filter-placeholder":"filter sessions…","loading-fleet":"loading fleet…","no-sessions":"no live tmux sessions — the fleet starts at boot (systemd)","no-match":'no session matches "{q}"',"copy-url":"click to copy URL","ssh-only":"SSH/VPN tunnel only","new-files-outbox":"new files in outbox",terminate:"terminate","terminate-confirm":'Terminate session "{name}"?',"cell-on":"tmux alive","cell-off":"off","cell-working":"working","cell-idle":"idle","cell-degraded":"degraded: unit active, tmux dead","power-on":"power on","power-off":"power off","boot-enable":"enable at boot","boot-disable":"disable at boot","state-on":"running","state-off":"stopped",engine:"Engine",model:"Model","model-default":"Provider default model","model-remembered":"Last model used with this engine","boot-persist":"start at boot","remove-boot":"also remove from boot","power-config-in-settings":"Edit engine, provider, profile, model and permissions in Settings → Fleet.","no-remote-control":"⚠ non-native engine: no claude.ai app RC (you can still drive it from here)",cancel:"cancel",name:"name","name-invalid":"invalid name: a-zA-Z0-9._- max 64, no leading '-'",cwd:"folder",browse:"browse","fs-home":"home","fs-parent":".. up",preset:"preset","preset-2x2":"2×2 grid","preset-columns":"columns","preset-equalize":"equalize",collapse:"collapse",expand:"expand",create:"create","auth-prompt":"Paste the token (printed by the server):","remember-device":"remember on this device","zoom-out":"smaller text","zoom-in":"bigger text",composer:"composer",windows:"{n} windows","empty-files":"empty",upload:"upload","no-sessions-short":"no sessions","composer-placeholder":"type or dictate…","composer-history-tools":"input history and size","composer-history":"cell history","composer-history-empty":"no submitted input","composer-history-clear":"clear this cell history","composer-expand":"expand input","composer-collapse":"collapse input","composer-clear-data":"clear drafts and history","composer-clear-data-help":"Removes every saved cell draft and input-history entry from this browser.","composer-clear-confirm":"Clear every saved draft and input-history entry from this browser?","composer-clear-done":"Drafts and history cleared.","composer-clear-failed":"Could not clear composer data in this browser.",attach:"attach","attach-file":"File","attach-camera":"Camera","attach-gallery":"Gallery","attach-uploading":"uploading…","attach-upload-progress":"attachment {n}/{total}…","attach-uploaded":"{n} attachments uploaded",voice:"voice",send:"send","composer-send-failed":"connection not ready — text kept, try again",close:"close","lang-label":"language",decks:"decks","new-deck":"new deck","deck-name":"deck name","open-deck-window":"open in a new window","detach-deck":"detach into a new window","deck-current":"this deck (current window)","deck-owner-unavailable":"owner node is not shared or reachable","rename-deck":"rename deck","delete-deck":"delete deck","delete-deck-confirm":'Delete deck "{name}"?',"send-to-deck":"send to deck…","deck-autosave":"autosave",saving:"saving…",saved:"saved","popup-blocked":"popup blocked: open here","expand-owner":"expand {owner} decks","collapse-owner":"collapse {owner} decks","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"in use (active window)","dot-on":"open in background","dot-neutral":"not open","dot-warn":"owner offline","select-drag":"drag to select","copy-manual":"select and copy manually","toggle-sidebar":"show/hide the sidebar",settings:"settings","tab-roles":"roles","tab-nodes":"nodes",local:"Local",location:"Location","pairing-link":"pairing link","pairing-required":"name, SSH alias and pairing link are required","pairing-connect-help":"Connecting a node requires a name, a working SSH Host, and a link/QR created by the other NexusCrew installation.","pairing-localhost-hint":"127.0.0.1 in the link is correct: do not open it here. NexusCrew carries the invite and port through the SSH Host.","scan-qr":"scan QR","pairing-qr-invalid":"invalid pairing QR","invite-node":"invite a node","create-pairing-link":"create link / QR","visibility-network":"whole network","visibility-relay":"relay only","visibility-selected":"selected nodes","hydra-simple":"local + nodes, one network","local-ready":"This device is ready. Use it alone or connect it to a node.","local-only":"local only","add-node":"add node",connect:"connect","node-connected":"Node connected. The network will synchronize automatically.","tab-system":"system","tab-fleet":"fleet","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnostics","system-this-node":"this node","system-updates":"updates","system-security":"security","system-local-data":"local browser data","system-terminal":"terminal","alternate-screen":"alternate screen","alternate-screen-help":"Keeps standard tmux behaviour for new NexusCrew sessions. An application that tracks the mouse scrolls on its own; the others browse the tmux scrollback. It does not change cells already running.","tab-input":"input","tab-diagnostics":"diagnostics","input-settings-local":"Local preferences for this browser. They apply immediately to single view and decks without changing the remote node.","terminal-keyboard-gesture":"Open the virtual keyboard from the terminal","terminal-keyboard-double-tap":"Double tap (default)","terminal-keyboard-single-tap":"Single tap","terminal-keyboard-never":"Never from terminal","terminal-keyboard-gesture-help":"The keypad and STT use the separate controls below. Mouse and physical keyboard remain available.","keybar-ime-lock":"Keypad: keep the virtual keyboard closed","keybar-ime-lock-help":"ESC, arrows, PgUp/PgDn, Enter and menu send directly to the PTY without focusing a text field.","voice-ime-lock":"STT microphone: keep the virtual keyboard closed","voice-ime-lock-help":"Tapping the microphone starts or stops voice without focusing the composer.","keybar-enter-show":"Show the tall Enter keypad key","keybar-enter-show-help":"Enter stays to the right of PgUp/PgDn and spans both rows.","keybar-layout":"Keypad layout","keybar-layout-full":"Full (default)","keybar-layout-compact":"Compact","keybar-layout-help":"Compact: one row with an expand toggle that reaches the full key set without changing the preference.","input-settings-reset":"restore input defaults","diagnostics-local":"This node","diagnostics-target":"Node to diagnose","diagnostics-verbose":"Temporary verbose logs","diagnostics-duration":"Verbose duration","diagnostics-expires":"Verbose enabled until {time}","diagnostics-off":"Verbose is off; operational warnings and errors remain available.","diagnostics-level":"Level","diagnostics-all-levels":"all levels","diagnostics-component":"component","diagnostics-pause":"pause","diagnostics-autoscroll":"autoscroll","diagnostics-log":"Sanitized diagnostic log","diagnostics-empty":"No diagnostic events.","diagnostics-export":"export JSON","diagnostics-export-failed":"Export is not available in this browser.","diagnostics-clear":"clear","diagnostics-clear-confirm":"Clear this node diagnostic buffer?","diagnostics-unsupported":"This peer is offline or does not support structured diagnostics.","fleet-editor-loading":"Loading the Fleet editor…","fleet-editor-load-error":"Unable to load the Fleet editor.","fleet-editor-unavailable":"The Fleet editor is unavailable at this location.","fleet-managed":"managed by NexusCrew","fleet-custom":"custom command","fleet-managed-help":"Client, provider and launch are managed internally; secrets are never displayed.","fleet-shell-engine-help":"The local shell is resolved on the device at launch time; no executable path is stored in backups.","fleet-shell-command-placeholder":"optional command, e.g. npm test","fleet-shell-command-help":"Runs through an interactive login shell (-lic), with the user PATH and aliases. The cell stops when the command finishes; immediate failures are reported.","fleet-shell-command-metachar":"Pipes, redirects, variables, and other metacharacters are interpreted by the device shell.","fleet-shell-interactive":"Empty: opens a local interactive shell and keeps the cell active.","fleet-shell-launch-help":"Configure the Shell command on the cell in Settings → Fleet.","fleet-credential-title":"API key on this device","fleet-credential-help":"The key stays only on the selected node and is never displayed, exported or shared with the network.","fleet-credential-set":"set key","fleet-credential-change":"change key","fleet-credential-forget":"forget","fleet-credential-saved":"Key saved locally.","fleet-credential-removed":"Local key removed.","fleet-credential-remove-confirm":"Remove the local {key} key?","fleet-credential-source-environment":"environment","fleet-credential-source-local":"local store","fleet-credential-source-compatibility":"compatible config","fleet-credential-source-missing":"missing","fleet-credential-source-policy":"credential source","fleet-credential-source-policy-auto":"auto (legacy precedence)","fleet-credential-source-policy-nexuscrew-store":"NexusCrew store only","fleet-credential-source-policy-environment":"environment only","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Value for {key}","fleet-key-used-by":"Used by: {engines}","fleet-key-used-by-none":"Not yet used by configured engines on this node.","fleet-key-shared-impact":"Replacing or removing {key} affects every listed engine: {engines}.","fleet-key-enter":"enter the key","fleet-key-blank-keeps":"blank = keep the current source","fleet-key-reveal":"reveal","fleet-key-hide":"hide","fleet-key-local-help":"The value stays write-only on the selected node and never enters engines, backups or federation.","fleet-key-create-missing":"Explicitly create the engine without a key (it will remain “key required”).","fleet-key-partial-create":"Engine created; the key was not saved. Retry without creating a duplicate.","fleet-key-partial-edit":"Engine updated; the key was not saved. The engine changes remain applied.","fleet-provider-notice-claude-openrouter":"Claude Code is optimized for Anthropic models; other providers may not work correctly. Fast mode requires the first-party Anthropic provider.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses is beta and stateless; Codex-VL has no Chat Completions fallback.","fleet-provider-notice-claude-kimi-code":"Kimi Code uses isolated Claude configuration with dedicated onboarding and fast-mode flags; native Claude configuration is not modified.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal uses only ALIBABA_CODE_API_KEY from the local credential layer; qwen3.8-max-preview is the default and no OpenAI/PAYG fallback is used.","fleet-provider-notice-kimi-native":'Native Kimi Code CLI uses the CLI login (device code) and its own configuration: NexusCrew never reads or copies credentials. Distinct from the Claude Code "Kimi Code" provider, which remains the managed K3 path.',"fleet-model-default":"default model (optional)","fleet-model-required":"model (required)","fleet-standard-permissions":"standard permissions","fleet-unsafe-permissions":"unsafe · bypass approvals/sandbox","fleet-unsafe-warning":"Explicit unsafe mode: the worker can act without normal approval or sandbox gates.","fleet-provider-display":"provider display name","fleet-custom-provider-default":"Custom provider","fleet-api-key-env":"API_KEY_ENV_NAME","fleet-provider-id":"provider-id","fleet-custom-secret-help":"NexusCrew stores only the environment-variable name, never its value.","fleet-model-override":"model override","fleet-ready":"ready","fleet-not-ready":"not configured","fleet-engines":"Engines","fleet-cells":"Cells / cloud sessions","fleet-backup":"backup / restore","fleet-backup-help":"Selectively export or restore engines, cells, and system prompts. Tokens, API keys, and provider secrets never enter the file.","fleet-backup-export":"export","fleet-backup-import":"import","fleet-backup-download":"download backup","fleet-backup-restore":"restore selected","fleet-backup-import-help":"Choose a JSON backup, review the cells and select a destination engine before restoring.","fleet-backup-overwrite":"overwrites existing cell","fleet-backup-new":"new cell","fleet-backup-engine-missing":"choose an available engine","fleet-backup-restore-unavailable":"The selected node supports export only; update it to restore backups.","fleet-backup-restored":"{n} cells restored","fleet-backup-confirm-overwrite":"Overwrite these cells? {cells}","fleet-backup-needs-restart":"restart required: {cells}","fleet-backup-empty":"no cells to export","fleet-backup-select-one":"select at least one cell","fleet-backup-too-large":"backup is too large (1 MB maximum)","fleet-backup-invalid-json":"the file does not contain valid JSON","fleet-backup-invalid-format":"unsupported backup format or version","fleet-backup-invalid-cell":"the backup contains an invalid cell","fleet-backup-duplicate-cell":"the backup contains duplicate cell IDs","fleet-backup-invalid-engine":"the backup contains an invalid engine","fleet-backup-duplicate-engine":"the backup contains duplicate engine IDs","fleet-backup-confirm-engine-overwrite":"Overwrite these engines? Environment values already configured on the target stay unchanged. {engines}","fleet-backup-env-names":"environment names","fleet-backup-env-values-required":"environment values must be configured on this device","fleet-system-prompt":"system prompt",characters:"characters","select-all":"select all","select-none":"select none",edit:"edit",save:"save",label:"label","command-path":"absolute command path","args-lines":"arguments, one per line","env-write-only":"Environment values are write-only: blank keeps the existing value.","fleet-new-engine":"New engine","fleet-new-cell":"New cell","fleet-saved":"Definition saved.","fleet-restart-confirm":"Change saved. Restart now: {cells}?","fleet-remove-engine":'Delete engine "{id}"?',"fleet-remove-cell":'Delete cell "{id}"? If active it will be stopped first.',"fleet-cwd-needs-repair":"folder needs repair","fleet-cwd-repair":"repair","fleet-cwd-repair-title":"Repair cell folder {id}","fleet-cwd-repair-help":"The current folder is not portable on this device: it belongs to another device or does not exist under the home directory. Choose a home-relative (~) folder on the target device; the backend will recompute the absolute path.","fleet-cwd-repair-no-source-path":"The original path is not shown: it is specific to the source device.","fleet-cwd-repair-placeholder":"e.g. Dev","fleet-cwd-repair-preview":"New folder: {path}","fleet-cwd-repair-browse":"browse under ~","fleet-cwd-repair-fs-empty":"no subfolders","fleet-cwd-repair-use-current":"use this folder","fleet-cwd-repair-invalid":'invalid path: no absolute path, "..", backslash or drive letter',"fleet-cwd-repair-confirm":"Set the folder of cell {id} to {path}? It will be recomputed on the target device.","fleet-cwd-repair-unportable":"The chosen path is not portable on this device: it must exist under the home directory.","fleet-cwd-repair-suggestion":"Suggestion from device:","fleet-cwd-repair-use-suggestion":"use {path}","fleet-cwd-repaired":"Cell folder repaired.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirm the custom API key (Yes) in the cell terminal, then restart the cell.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: in the cell terminal open /config and enable "Use custom API key", then restart the cell. If the key changed, update the credential and retry.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: in the cell terminal run /login (Kimi device code) or /provider, then restart the cell.","fleet-recovery-client-terminal-dialog":"Complete the dialog shown in the cell terminal, then restart the cell.","settings-readonly":"READONLY active: changes are blocked by the server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"this machine watches other nodes via SSH tunnels","role-node":"node (reachable)","published-port":"published port (optional)","no-nodes":"no remote nodes configured","node-add":"connect a NexusCrew installation","node-connect-help":"The SSH port reaches the SSH server. The NexusCrew port is the local port reported by `nexuscrew status` on the remote node.","node-name-label":"Node name","node-ssh-label":"SSH host","pair-ssh-local-label":"SSH host or alias on this device","node-ssh-local-help":"You may replace the link address with the same alias that works with ssh on this device. Aliases, agents and private keys stay local and are never carried in the link.","node-ssh-port-label":"SSH port","node-ssh-port-help":"Usually 22; use the SSH server public port.","node-app-port-label":"NexusCrew port on node","node-app-port-help":"The port reported by `nexuscrew status` on the remote node.","node-name-ph":"name (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"remote port (opt.)","node-remove-confirm":'Remove node "{name}"?',"node-remove-warning":"Deletes the pairing, credentials and local tunnel. It does not power off the remote device.","peer-inventory-title":"Nodes connected to the hub","peer-group-hubs":"Direct hubs","peer-group-clients":"Connected clients","peer-group-routed":"Nodes reachable through the network","peer-group-vl":"VL nodes","vl-owners-unavailable":"VL owners unreachable","peer-routed":"routed","peer-routed-stale":"routed, unreachable","peer-visibility":"Network visibility","node-test":"test","tunnel-start":"start tunnel","tunnel-stop":"stop tunnel","tunnel-restart":"restart tunnel","share-node":"Share this node","share-local-heading":"Share this device","share-local-hub":"Sharing hub","share-local-through":"Share {device} through {hub}","share-local-active":"Shared and reachable by the network connected to the hub.","share-local-pending":"Sharing is requested, but the tunnel is down: this device is not reachable yet.","share-local-private":"Private: only this device can use its hub connection.","share-local-private-down":"Private, but the hub connection is down. Reconnect to apply and verify private mode.","share-local-reconnect":"Reconnect and reconcile","share-off-hub-reconcile-pending":"Private state saved; hub revocation is still pending.","fleet-cell-label":"readable name (optional)","share-off-local-reconcile-pending":"Hub revocation confirmed; the local tunnel still needs reconciliation.","share-reverse-pool-pending":"The reverse channel was not demonstrably shut down: it is quarantined, not closed.","share-node-off-desc":"Private: it stays connected to the hub, but other clients cannot reach it.","share-node-on-desc":"Shared: the hub may advertise it and route authorized cells and decks.","peer-shared":"Client node shared on the Hydra network","peer-private":"Private client node: connected, not published on Hydra","peer-vl-federated":"VL node: federated","row-vl-federated":"federated","node-connected-client":"connected client","transport-used":"in use","tunnel-up":"tunnel up","tunnel-down":"tunnel down","vl-poll-online":"online (poll)","vl-poll-offline":"not responding","authorized-keys-hint":"paste this line into ~/.ssh/authorized_keys on the remote host:",copy:"copy",copied:"copied","token-rotate":"rotate token","token-rotate-explain":"The new token will NOT be shown: retrieve it with `nexuscrew show token`. The current session will be invalidated.","service-regenerate":"regenerate service","npm-auto-update":"automatic updates from npm","npm-auto-update-help":"Periodically checks latest and installs only newer versions. Never downgrades.","npm-update-current":"installed","npm-update-latest":"npm latest","npm-update-check":"check now","npm-update-install":"update now","npm-update-restarting":"Update started; NexusCrew will return after the service restarts.","npm-update-idle":"up to date","npm-update-checking":"checking","npm-update-available":"update available","npm-update-installing":"installing","npm-update-installed":"installed, restarting","npm-update-error":"check failed","npm-update-unsupported":"available only for global npm installations","service-installed":"service installed","service-missing":"service not installed","service-active":"active","service-inactive":"not active",confirm:"confirm",add:"add",enable:"enable","wizard-title":"welcome to NexusCrew","wizard-skip":"configure later from settings","wizard-step-roles":"roles of this install","wizard-step-node":"first remote node (optional)","wizard-done":"all set","wizard-done-desc":"setup complete — you can change everything from settings",next:"continue",back:"back",skip:"skip",finish:"finish","err-node-name":"invalid name (a-z, 0-9, -, max 32)","err-local-name":"invalid local name: use a unique slug, not “localhost”","err-ssh":"invalid ssh (expected user@host or alias)","err-port":"invalid port (1–65535)","err-ssh-port":"invalid SSH port (1–65535)","err-node-port":"invalid NexusCrew port (1–65535)","node-sessions":"{n} sessions","tunnel-down-since":"tunnel down for {t}","node-unreachable":"node unreachable","node-passive":"client offline · expected","node-offline":"node offline","node-offline-seen":"offline · seen {t} ago","node-needs-repair":"legacy · pair again","asks-title":"questions from the cells","ask-dismiss":"Dismiss question","ask-reply-ph":"type your answer…","push-enable":"enable push notifications","push-disable":"disable push notifications","push-on":"push active on this device","push-off":"push not active","push-denied":"notification permission denied by the browser","push-unsupported":"push not supported in this browser","notification-speech-enable":"read notifications aloud","notification-speech-help":"Uses the browser voice only for new notifications while this PWA is visible and in the foreground. When the app is closed, the system notification remains available.","notification-speech-test":"test voice","notification-speech-testing":"testing voice…","notification-speech-preview":"NexusCrew. Spoken notifications are active.","notification-speech-preview-ok":"Voice test completed.","notification-speech-preview-failed":"The browser did not start the voice test. Interact with the page and try again.","notification-speech-needs-test":"For this app session, select “test voice” before spoken alerts can play.","notification-speech-unsupported":"Speech synthesis is not supported in this browser.","audio-title":"Native node audio","audio-help":"Consent and controls apply only to this device. Share and visibility do not authorize sounds.","audio-consent":"allow TTS on this node","audio-consent-help":"Allows authorized local or remote cells to deliver a voice command. You can revoke it at any time.","audio-capability":"Local capability","audio-loading":"reading local audio state…","audio-adapter":"adapter","audio-adapter-none":"none","audio-installed":"installed","audio-installed-yes":"yes","audio-installed-no":"no","audio-liveness":"availability","audio-liveness-ready":"ready to accept","audio-liveness-unavailable":"unavailable","audio-languages":"declared languages","audio-limits":"limits","audio-test":"test local audio","audio-testing":"testing audio…","audio-stop":"stop local audio","audio-stopping":"stopping audio…","audio-test-needs-consent":"Enable local consent before testing the voice.","audio-unavailable":"No native TTS adapter is available on this node.","audio-test-accepted":"The node accepted the test. It does not prove that anyone heard it.","audio-test-refused":"The node refused the test.","audio-test-unknown":"Test outcome unknown: the node could not confirm startup.","audio-stop-stopped":"Local audio stopped.","audio-stop-idle":"No local utterance to stop.","audio-groups-title":"Shared audio groups","audio-groups-help":"Chooses which devices play the voice when a cell speaks. A group is a local delivery preference, not consent. Each node keeps its own consent, ACL, availability and local Stop.","audio-groups-empty":"No group: voice plays only on this node.","audio-group-name":"group name","audio-group-mode":"delivery mode","audio-group-primary":"first available (in order)","audio-group-fanout":"all listed nodes","audio-group-targets":"exact target nodes","audio-group-local":"this node","audio-group-unavailable-target":"not currently discovered","audio-group-no-targets":"No node with an available instanceId. A group cannot use names, wildcards, or “all”.","audio-group-new":"new group","audio-group-edit":"edit","audio-group-delete":"delete","audio-group-save":"save group","audio-group-cancel":"cancel","audio-group-invalid":"A group needs a valid name and at least one exact nodeId.","audio-group-save-failed":"Could not save audio group.","node-display-label":"Name (label)","routed-node-aliases":"Routed node aliases","routed-node-aliases-help":"Visible only on this device; the route and remote name do not change.","node-local-alias":"Alias on this device","alias-on-device":"Alias on this device","reset-alias":"Reset remote name","node-slug-hint":"routing on slug: {slug}","device-name-label":"Device name","device-name-hint":"how peers see you (editable)","local-route-name-label":"Local / route name","local-route-name-hint":"stable technical handle: readable label + nodeId suffix; editable before connecting","err-label":"invalid label (max 64 chars, no line breaks)","fleet-inventory":"Cells and sessions","fleet-inventory-help":"all positions (Local + Hydra routes)","fleet-manage-location":"Manage location","fleet-network-overview":"Network overview","fleet-manage-help":"create and configure cells at the selected location","fleet-overview-help":"operational state of every location, separate from the editor","fleet-inventory-empty":"no cells or sessions","cell-switcher-refreshing":"refreshing cells…","cell-switcher-empty-active":"no verified active cells","cell-switcher-not-confirmed":"status not confirmed","cell-switcher-not-active":"this cell is no longer active","cell-switcher-select":"select a cell","cell-switcher-open":"open cell","cell-switcher-show-all":"all","cell-switcher-show-active":"active","cell-switcher-close":"close cell switcher","fleet-not-available":"fleet not available on this position",start:"start",stop:"stop",restart:"restart",delete:"delete","copy-manual":"copy failed — select and press Cmd+C, or copy manually","copy-empty":"nothing selected: drag with Shift to select","selection-held":"highlight gone, text still held","invite-hub-only":"An invite is minted on the hub. Admitting a new node is the one thing a connected node cannot ask on another’s behalf: open NexusCrew on the hub and create the invite there.","row-private":"private","node-detail-open":"open details","node-detail-reach":"Reachability","node-detail-route":"path","node-detail-ssh":"SSH","node-detail-transport":"transport","node-detail-owner":"owner","node-detail-authority":"What this node can do","authority-owner-equivalent":"Authority equal to yours: a paired node can do on this machine everything you can do.","authority-routed":"Not paired with this machine: its authority lives on the hub that routes it.","authority-no-grants":"Per-node powers do not exist yet: there is nothing to grant or withdraw here.","node-detail-network-view":"What it sees of this network","node-detail-command":"Command","vl-no-commands":"The device declares no commands available.","vl-events-title":"Session","vl-events-empty":"No events in memory: the session has not spoken yet, or what it said has left the buffer. The history stays on the device.","vl-events-gap":"events not received:","vl-events-truncated":"content truncated by the device","vl-events-turn-end":"— end of turn —","vl-events-done":"— session finished —","vl-events-writer-epoch":"— writer changed —","vl-events-tool":"tool","vl-events-tool-ok":"finished","vl-events-tool-failed":"failed","vl-events-usage":"usage updated","vl-events-stale":"Refresh failed: what you see may not be the latest.","vl-cmd-phase-submitted":"sent, awaiting confirmation","vl-cmd-phase-inflight":"in progress","vl-cmd-phase-done-ok":"completed","vl-cmd-phase-done-error":"failed","vl-cmd-status":"status","vl-cmd-health":"health","vl-cmd-start":"start","vl-cmd-stop":"stop","vl-cmd-restart":"restart","vl-cmd-version":"version","vl-cmd-capabilities":"capabilities","vl-cmd-logs":"logs","vl-cmd-unpair":"unpair","node-grant-none":"No node chosen: shared, but towards nobody.","node-grant-unknown":"no longer in the inventory","node-grant-remove":"remove","node-grant-add":"Add a node","node-grant-search":"Search the nodes","node-grant-no-candidates":"No node matches.","single-view":"single view",retract:"retract","keybar-expand":"expand the key bar","keybar-retract":"retract the key bar","save-and-start":"save and start",permissions:"Permissions","power-on-hint":"Stop the cell; you can also remove it from boot.","launch-engine-help":"Providers, credentials and new engines are created in Settings → Fleet. Model and permissions are per cell.","launch-unavailable-hint":"Engine configuration is unavailable on this node.","import-as-cell":"Import as cell","import-help":"Reconcile an existing tmux session into a managed cell. Pick an already-declared engine: no engine is invented.","import-engine-required":"pick an engine (required)","test-and-connect":"test and connect","pairing-v2-hint":"Paste or scan ONE link: it prefills name, SSH host and label when the link carries them (v2).","invite-v2-hint":"Create one complete one-time invitation. If this device already joined a hub, that hub is used automatically; otherwise only its reachable SSH address is required.","invite-network-hint":"Create an invitation for the network you already joined. The new device enters through the hub instead of connecting directly to this device.","invite-network-label":"Destination network","invite-network-via":"Hub","invite-network-route":"One connection to the hub; nodes, cells and decks are routed internally.","invite-endpoint-label":"This hub’s SSH address as seen by other devices","invite-endpoint-auto":"Configured endpoint","invite-endpoint-needed":"Enter user@host or a shared SSH alias. This is not 127.0.0.1 and not the NexusCrew HTTP URL.","invite-ssh-hint":"The SSH target the OTHER device uses to reach THIS installation (user@host or alias). Required: it is included in the link.","invite-next-steps":"copy this link, open NexusCrew on the other device and paste it in Settings → Nodes (or scan the QR): NexusCrew does the rest","pair-card-title":"connect with one link","pair-card-help":"Paste the pairing link generated on the other device (or scan its QR): NexusCrew decodes it, tests the SSH connection and connects on its own.","pair-paste-ph":"paste the pairing link here","pair-paste-btn":"paste","pair-advanced":"advanced / edit","pair-progress":"connecting: SSH → invite → confirm → verify…","pair-retry":"retry","pair-invalid-link":"this is not a valid pairing link","pair-invalid-hint":"you need the full link (http://…#pair=…) generated by the other NexusCrew: don’t open it, paste it here","pair-missing-ssh":"the link carries no SSH target (v1 format): set in “advanced” how this device reaches the other one over SSH — it is never invented","pair-missing-name":"the node name is missing: fill it in “advanced”","pair-clipboard-denied":"clipboard read not allowed: paste manually into the field","pair-clipboard-empty":"clipboard is empty: copy the pairing link first","pair-stage-validation":"invalid data","pair-stage-conflict":"name already in use","pair-stage-ssh-start":"SSH tunnel start failed","pair-stage-ssh-ready":"peer unreachable over SSH","pair-stage-join":"invite exchange failed","pair-stage-tunnel-final":"negotiated tunnel failed","pair-stage-confirm":"pairing confirmation failed","pair-stage-health":"final federation check failed","pair-stage-internal":"internal error","pair-stage-generic":"connection failed","qr-no-camera":"no camera available on this device: use a photo of the QR","qr-permission":"camera permission denied: allow it in the browser or use a photo of the QR","qr-unsupported":"live scanner not supported here: upload a photo of the QR","qr-upload":"use a photo"},es:{"update-available":"nueva versión {v} disponible","install-version-mismatch":"instalación incompleta: frontend y servidor no coinciden (v{v})",reload:"recargar","grid-empty":"arrastra aquí una sesión desde la barra lateral, o doble clic para vista única","grid-full":"un deck puede mostrar como máximo 9 sesiones",pin:"fijar arriba",reorder:"reordenar","reorder-help":"arrastra el control; flechas arriba/abajo","rename-node":"renombrar nodo","rename-node-prompt":"Nuevo nombre del nodo en NexusCrew","rename-node-invalid":"Nombre no válido: máximo 64 caracteres, sin saltos de línea.","reorder-deck-help":"arrastra el deck; flechas izquierda/derecha",sessions:"sesiones","new-session":"nueva sesión",new:"nueva",fleet:"Flota","fleet-tmux":"flota tmux","other-sessions":"Otras sesiones","view-all":"todas","view-pinned":"fijadas","view-active":"activas","view-off":"apagadas","view-technical":"técnicas","mark-technical":"ocultar como sesión técnica","mark-normal":"mostrar como sesión normal","position-local":"Local",files:"archivos",refresh:"actualizar","filter-placeholder":"filtrar sesiones…","loading-fleet":"cargando flota…","no-sessions":"sin sesiones tmux vivas — la flota arranca en el boot (systemd)","no-match":"ninguna sesión coincide con «{q}»","copy-url":"clic para copiar la URL","ssh-only":"solo túnel SSH/VPN","new-files-outbox":"archivos nuevos en outbox",terminate:"terminar","terminate-confirm":"¿Terminar la sesión «{name}»?","cell-on":"tmux activo","cell-off":"apagada","cell-working":"trabajando","cell-idle":"en espera","cell-degraded":"degradada: unit activa, tmux muerto","power-on":"encender","power-off":"apagar","boot-enable":"activar al iniciar","boot-disable":"desactivar al iniciar","state-on":"encendida","state-off":"apagada",engine:"Motor",model:"Modelo","model-default":"Modelo predeterminado del proveedor","model-remembered":"Último modelo usado con este motor","boot-persist":"iniciar en el boot","remove-boot":"quitar también del boot","power-config-in-settings":"Modifica motor, proveedor, perfil, modelo y permisos en Ajustes → Flota.","no-remote-control":"⚠ motor no nativo: sin RC de la app claude.ai (aquí puedes pilotarla igual)",cancel:"cancelar",name:"nombre","name-invalid":"nombre inválido: a-zA-Z0-9._- máx 64, sin '-' inicial",cwd:"carpeta",browse:"explorar","fs-home":"home","fs-parent":".. arriba",preset:"preset","preset-2x2":"cuadrícula 2×2","preset-columns":"columnas","preset-equalize":"igualar",collapse:"contraer",expand:"expandir",create:"crear","auth-prompt":"Pega el token (impreso por el servidor):","remember-device":"recordar en este dispositivo","zoom-out":"texto más pequeño","zoom-in":"texto más grande",composer:"composer",windows:"{n} ventanas","empty-files":"vacía",upload:"subir","no-sessions-short":"sin sesiones","composer-placeholder":"escribe o dicta…","composer-history-tools":"historial y tamaño de entrada","composer-history":"historial de la celda","composer-history-empty":"ninguna entrada enviada","composer-history-clear":"borrar historial de esta celda","composer-expand":"ampliar entrada","composer-collapse":"reducir entrada","composer-clear-data":"borrar borradores e historial","composer-clear-data-help":"Elimina de este navegador todos los borradores y el historial de entrada de las celdas.","composer-clear-confirm":"¿Borrar todos los borradores y el historial de entrada guardados en este navegador?","composer-clear-done":"Borradores e historial eliminados.","composer-clear-failed":"No se pudieron borrar los datos del composer en este navegador.",attach:"adjuntar","attach-file":"Archivo","attach-camera":"Cámara","attach-gallery":"Galería","attach-uploading":"subiendo…","attach-upload-progress":"adjunto {n}/{total}…","attach-uploaded":"{n} adjuntos subidos",voice:"voz",send:"enviar","composer-send-failed":"conexión no disponible — texto conservado, inténtalo de nuevo",close:"cerrar","lang-label":"idioma",decks:"decks","new-deck":"nuevo deck","deck-name":"nombre del deck","open-deck-window":"abrir en una ventana nueva","detach-deck":"separar en una ventana nueva","deck-current":"este deck (ventana actual)","deck-owner-unavailable":"el nodo propietario no está compartido o accesible","rename-deck":"renombrar deck","delete-deck":"eliminar deck","delete-deck-confirm":"¿Eliminar el deck «{name}»?","send-to-deck":"enviar al deck…","deck-autosave":"guardado automático",saving:"guardando…",saved:"guardado","popup-blocked":"ventana bloqueada: abrir aquí","expand-owner":"expandir decks de {owner}","collapse-owner":"comprimir decks de {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"en uso (ventana activa)","dot-on":"abierta en segundo plano","dot-neutral":"no abierta","dot-warn":"nodo sin conexión","select-drag":"arrastra para seleccionar","copy-manual":"selecciona y copia manualmente","toggle-sidebar":"mostrar/ocultar la barra lateral",settings:"ajustes","tab-roles":"roles","tab-nodes":"nodos",local:"Local",location:"Ubicación","pairing-link":"enlace de emparejamiento","pairing-required":"nombre, alias SSH y enlace son obligatorios","pairing-connect-help":"Para conectar un nodo necesitas un nombre, un Host SSH funcional y el enlace/QR creado por la otra instalación NexusCrew.","pairing-localhost-hint":"127.0.0.1 en el enlace es correcto: no lo abras aquí. NexusCrew usa la invitación y el puerto mediante el Host SSH.","scan-qr":"escanear QR","pairing-qr-invalid":"QR de emparejamiento no válido","invite-node":"invitar un nodo","create-pairing-link":"crear enlace / QR","visibility-network":"toda la red","visibility-relay":"solo relay","visibility-selected":"nodos seleccionados","hydra-simple":"local + nodos, una red","local-ready":"Este dispositivo está listo. Úsalo solo o conéctalo a un nodo.","local-only":"solo local","add-node":"añadir nodo",connect:"conectar","node-connected":"Nodo conectado. La red se sincronizará automáticamente.","tab-system":"sistema","tab-fleet":"flota","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnóstico","system-this-node":"este nodo","system-updates":"actualizaciones","system-security":"seguridad","system-local-data":"datos locales del navegador","system-terminal":"terminal","alternate-screen":"pantalla alternativa","alternate-screen-help":"Mantiene el comportamiento estándar de tmux para las nuevas sesiones NexusCrew. Una aplicación que sigue el ratón se desplaza sola; las demás recorren el historial de tmux. No modifica las celdas ya activas.","tab-input":"entrada","tab-diagnostics":"diagnóstico","input-settings-local":"Preferencias locales de este navegador. Se aplican de inmediato a la vista única y a los decks sin cambiar el nodo remoto.","terminal-keyboard-gesture":"Abrir el teclado virtual desde el terminal","terminal-keyboard-double-tap":"Doble toque (predeterminado)","terminal-keyboard-single-tap":"Toque único","terminal-keyboard-never":"Nunca desde el terminal","terminal-keyboard-gesture-help":"El teclado auxiliar y STT usan los controles separados de abajo. El ratón y el teclado físico siguen disponibles.","keybar-ime-lock":"Teclado auxiliar: mantener cerrado el teclado virtual","keybar-ime-lock-help":"ESC, flechas, PgUp/PgDn, Enter y menú envían directamente al PTY sin enfocar un campo de texto.","voice-ime-lock":"Micrófono STT: mantener cerrado el teclado virtual","voice-ime-lock-help":"Tocar el micrófono inicia o detiene la voz sin enfocar el compositor.","keybar-enter-show":"Mostrar Enter vertical en el teclado auxiliar","keybar-enter-show-help":"Enter queda a la derecha de PgUp/PgDn y ocupa las dos filas.","keybar-layout":"Distribución del teclado auxiliar","keybar-layout-full":"Completo (predeterminado)","keybar-layout-compact":"Compacto","keybar-layout-help":"Compacto: una fila con un botón expandir que alcanza el conjunto completo sin cambiar la preferencia.","input-settings-reset":"restaurar valores de entrada","diagnostics-local":"Este nodo","diagnostics-target":"Nodo a diagnosticar","diagnostics-verbose":"Logs detallados temporales","diagnostics-duration":"Duración detallada","diagnostics-expires":"Log detallado activo hasta las {time}","diagnostics-off":"El log detallado está apagado; los avisos y errores operativos siguen disponibles.","diagnostics-level":"Nivel","diagnostics-all-levels":"todos los niveles","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"desplazamiento automático","diagnostics-log":"Log de diagnóstico sanitizado","diagnostics-empty":"No hay eventos de diagnóstico.","diagnostics-export":"exportar JSON","diagnostics-export-failed":"La exportación no está disponible en este navegador.","diagnostics-clear":"vaciar","diagnostics-clear-confirm":"¿Vaciar el búfer de diagnóstico de este nodo?","diagnostics-unsupported":"Este par está desconectado o no admite diagnósticos estructurados.","fleet-editor-loading":"Cargando el editor de Fleet…","fleet-editor-load-error":"No se puede cargar el editor de Fleet.","fleet-editor-unavailable":"El editor de Fleet no está disponible en esta ubicación.","fleet-managed":"gestionado por NexusCrew","fleet-custom":"comando personalizado","fleet-managed-help":"Cliente, proveedor e inicio se gestionan internamente; los secretos nunca se muestran.","fleet-shell-engine-help":"La shell local se resuelve en el dispositivo al iniciar; no se guarda ninguna ruta ejecutable en las copias.","fleet-shell-command-placeholder":"comando opcional, p. ej. npm test","fleet-shell-command-help":"Se ejecuta mediante una shell de inicio interactiva (-lic), con PATH y alias del usuario. La celda se detiene al terminar; los fallos inmediatos se notifican.","fleet-shell-command-metachar":"Pipes, redirecciones, variables y otros metacaracteres son interpretados por la shell del dispositivo.","fleet-shell-interactive":"Vacío: abre una shell local interactiva y mantiene la celda activa.","fleet-shell-launch-help":"Configura el comando Shell de la celda en Ajustes → Flota.","fleet-credential-title":"Clave API en este dispositivo","fleet-credential-help":"La clave permanece solo en el nodo seleccionado y nunca se muestra, exporta ni comparte con la red.","fleet-credential-set":"poner clave","fleet-credential-change":"cambiar clave","fleet-credential-forget":"olvidar","fleet-credential-saved":"Clave guardada localmente.","fleet-credential-removed":"Clave local eliminada.","fleet-credential-remove-confirm":"¿Eliminar la clave local {key}?","fleet-credential-source-environment":"entorno","fleet-credential-source-local":"almacén local","fleet-credential-source-compatibility":"config compatible","fleet-credential-source-missing":"ausente","fleet-credential-source-policy":"origen de credencial","fleet-credential-source-policy-auto":"auto (precedencia legacy)","fleet-credential-source-policy-nexuscrew-store":"solo almacén NexusCrew","fleet-credential-source-policy-environment":"solo entorno","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Valor para {key}","fleet-key-used-by":"Usada por: {engines}","fleet-key-used-by-none":"Aún no la usa ningún motor configurado en este nodo.","fleet-key-shared-impact":"Sustituir o eliminar {key} afecta a todos los motores listados: {engines}.","fleet-key-enter":"introduce la clave","fleet-key-blank-keeps":"vacío = mantener la fuente actual","fleet-key-reveal":"mostrar","fleet-key-hide":"ocultar","fleet-key-local-help":"El valor permanece write-only en el nodo seleccionado y nunca entra en motores, copias ni federación.","fleet-key-create-missing":"Crear explícitamente el motor sin clave (seguirá como “clave requerida”).","fleet-key-partial-create":"Motor creado; la clave no se guardó. Puedes reintentar sin crear un duplicado.","fleet-key-partial-edit":"Motor actualizado; la clave no se guardó. Los cambios del motor siguen aplicados.","fleet-provider-notice-claude-openrouter":"Claude Code está optimizado para modelos Anthropic; otros proveedores podrían no funcionar correctamente. Fast mode requiere el proveedor Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses es beta y stateless; Codex-VL no usa fallback de Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configuración Claude aislada con onboarding y fast mode dedicados; la configuración Claude nativa no se modifica.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY de la capa local de credenciales; qwen3.8-max-preview es el modelo predeterminado y no se usa fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa el login del CLI (device-code) y su propia configuración: NexusCrew no lee ni copia credenciales. Distinto del proveedor "Kimi Code" de Claude Code, que sigue siendo la ruta K3 gestionada.',"fleet-model-default":"modelo predeterminado (opcional)","fleet-model-required":"modelo (obligatorio)","fleet-standard-permissions":"permisos estándar","fleet-unsafe-permissions":"inseguro · omitir aprobaciones/sandbox","fleet-unsafe-warning":"Modo inseguro explícito: el worker puede actuar sin las aprobaciones normales ni las protecciones del sandbox.","fleet-provider-display":"nombre visible del proveedor","fleet-custom-provider-default":"Proveedor personalizado","fleet-api-key-env":"NOMBRE_VARIABLE_API_KEY","fleet-provider-id":"id-proveedor","fleet-custom-secret-help":"NexusCrew guarda solo el nombre de la variable de entorno, nunca su valor.","fleet-model-override":"modelo alternativo","fleet-ready":"listo","fleet-not-ready":"no configurado","fleet-engines":"Motores","fleet-cells":"Celdas / sesiones cloud","fleet-backup":"copia / restauración","fleet-backup-help":"Exporta o restaura selectivamente motores, celdas y system prompts. Tokens, claves API y secretos del proveedor nunca entran en el archivo.","fleet-backup-export":"exportar","fleet-backup-import":"importar","fleet-backup-download":"descargar copia","fleet-backup-restore":"restaurar seleccionadas","fleet-backup-import-help":"Elige una copia JSON, revisa las celdas y selecciona un motor de destino antes de restaurar.","fleet-backup-overwrite":"sobrescribe la celda existente","fleet-backup-new":"celda nueva","fleet-backup-engine-missing":"elige un motor disponible","fleet-backup-restore-unavailable":"El nodo seleccionado solo admite exportación; actualízalo para restaurar copias.","fleet-backup-restored":"{n} celdas restauradas","fleet-backup-confirm-overwrite":"¿Sobrescribir estas celdas? {cells}","fleet-backup-needs-restart":"reinicio necesario: {cells}","fleet-backup-empty":"no hay celdas para exportar","fleet-backup-select-one":"selecciona al menos una celda","fleet-backup-too-large":"copia demasiado grande (máximo 1 MB)","fleet-backup-invalid-json":"el archivo no contiene JSON válido","fleet-backup-invalid-format":"formato o versión de copia no compatible","fleet-backup-invalid-cell":"la copia contiene una celda no válida","fleet-backup-duplicate-cell":"la copia contiene IDs de celda duplicados","fleet-backup-invalid-engine":"la copia contiene un motor no válido","fleet-backup-duplicate-engine":"la copia contiene IDs de motor duplicados","fleet-backup-confirm-engine-overwrite":"¿Sobrescribir estos motores? Los valores de entorno ya configurados en el destino no cambian. {engines}","fleet-backup-env-names":"nombres de entorno","fleet-backup-env-values-required":"los valores de entorno deben configurarse en este dispositivo","fleet-system-prompt":"system prompt",characters:"caracteres","select-all":"seleccionar todas","select-none":"ninguna",edit:"editar",save:"guardar",label:"etiqueta","command-path":"ruta absoluta del comando","args-lines":"argumentos, uno por línea","env-write-only":"Los valores env son de solo escritura: vacío conserva el valor existente.","fleet-new-engine":"Nuevo motor","fleet-new-cell":"Nueva celda","fleet-saved":"Definición guardada.","fleet-restart-confirm":"Cambio guardado. ¿Reiniciar ahora: {cells}?","fleet-remove-engine":'¿Eliminar el motor "{id}"?',"fleet-remove-cell":'¿Eliminar la celda "{id}"? Si está activa se detendrá primero.',"fleet-cwd-needs-repair":"carpeta a reparar","fleet-cwd-repair":"reparar","fleet-cwd-repair-title":"Reparar carpeta de celda {id}","fleet-cwd-repair-help":"La carpeta actual no es portátil en este dispositivo: pertenece a otro dispositivo o no existe bajo el directorio home. Elige una carpeta relativa a home (~) en el dispositivo destino; el backend recalculará la ruta absoluta.","fleet-cwd-repair-no-source-path":"La ruta original no se muestra: es específica del dispositivo de origen.","fleet-cwd-repair-placeholder":"p. ej. Dev","fleet-cwd-repair-preview":"Nueva carpeta: {path}","fleet-cwd-repair-browse":"examinar bajo ~","fleet-cwd-repair-fs-empty":"sin subcarpetas","fleet-cwd-repair-use-current":"usar esta carpeta","fleet-cwd-repair-invalid":'ruta no válida: nada de ruta absoluta, "..", barra invertida ni letra de unidad',"fleet-cwd-repair-confirm":"¿Establecer la carpeta de la celda {id} a {path}? Se recalculará en el dispositivo destino.","fleet-cwd-repair-unportable":"La ruta elegida no es portátil en este dispositivo: debe existir bajo el directorio home.","fleet-cwd-repair-suggestion":"Sugerencia del dispositivo:","fleet-cwd-repair-use-suggestion":"usar {path}","fleet-cwd-repaired":"Carpeta de la celda reparada.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirma la clave API personalizada (Yes) en el terminal de la celda, luego reinicia la celda.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: en el terminal de la celda abre /config y activa "Use custom API key", luego reinicia la celda. Si la clave cambió, actualiza la credencial y reintenta.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: en el terminal de la celda ejecuta /login (código de dispositivo Kimi) o /provider, luego reinicia la celda.","fleet-recovery-client-terminal-dialog":"Completa el diálogo mostrado en el terminal de la celda, luego reinicia la celda.","settings-readonly":"READONLY activo: los cambios están bloqueados por el servidor (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"esta máquina observa otros nodos vía túneles SSH","role-node":"nodo (alcanzable)","published-port":"puerto publicado (opcional)","no-nodes":"sin nodos remotos configurados","node-add":"conectar una instalación NexusCrew","node-connect-help":"El puerto SSH conecta con el servidor SSH. El puerto NexusCrew es el puerto local indicado por `nexuscrew status` en el nodo remoto.","node-name-label":"Nombre del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH en este dispositivo","node-ssh-local-help":"Puedes sustituir la dirección del enlace por el mismo alias que funciona con ssh en este dispositivo. Los alias, agentes y claves permanecen locales y nunca viajan en el enlace.","node-ssh-port-label":"Puerto SSH","node-ssh-port-help":"Normalmente 22; usa el puerto público del servidor SSH.","node-app-port-label":"Puerto NexusCrew del nodo","node-app-port-help":"El puerto indicado por `nexuscrew status` en el nodo remoto.","node-name-ph":"nombre (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"puerto remoto (opc.)","node-remove-confirm":"¿Eliminar el nodo «{name}»?","node-remove-warning":"Elimina el emparejamiento, las credenciales y el túnel local. No apaga el dispositivo remoto.","peer-inventory-title":"Nodos conectados al hub","peer-group-hubs":"Hubs directos","peer-group-clients":"Clientes conectados","peer-group-routed":"Nodos accesibles a través de la red","peer-group-vl":"Nodos VL","vl-owners-unavailable":"Owners VL no alcanzados","peer-routed":"enrutado","peer-routed-stale":"enrutado, no accesible","peer-visibility":"Visibilidad en la red","node-test":"test","tunnel-start":"iniciar túnel","tunnel-stop":"detener túnel","tunnel-restart":"reiniciar túnel","share-node":"Compartir este nodo","share-local-heading":"Compartir este dispositivo","share-local-hub":"Hub para compartir","share-local-through":"Compartir {device} mediante {hub}","share-local-active":"Compartido y accesible para la red conectada al hub.","share-local-pending":"Se solicitó compartir, pero el túnel está caído: este dispositivo aún no es accesible.","share-local-private":"Privado: solo este dispositivo puede usar la conexión al hub.","share-local-private-down":"Privado, pero la conexión al hub está caída. Reconecta para aplicar y verificar el modo privado.","share-local-reconnect":"Reconectar y reconciliar","share-off-hub-reconcile-pending":"Estado privado guardado; la revocación en el hub sigue pendiente.","fleet-cell-label":"nombre legible (opcional)","share-off-local-reconcile-pending":"Revocación confirmada por el hub; el túnel local aún debe reconciliarse.","share-reverse-pool-pending":"El canal inverso no se apagó de forma demostrable: queda en cuarentena, no cerrado.","share-node-off-desc":"Privado: sigue conectado al hub, pero otros clientes no pueden alcanzarlo.","share-node-on-desc":"Compartido: el hub puede anunciarlo y enrutar celdas y decks autorizados.","peer-shared":"Nodo cliente compartido en la red Hydra","peer-private":"Nodo cliente privado: conectado, no publicado en Hydra","peer-vl-federated":"Nodo VL: federado","row-vl-federated":"federado","node-connected-client":"cliente conectado","transport-used":"en uso","tunnel-up":"túnel activo","tunnel-down":"túnel caído","vl-poll-online":"en línea (poll)","vl-poll-offline":"sin respuesta","authorized-keys-hint":"pega esta línea en ~/.ssh/authorized_keys del host remoto:",copy:"copiar",copied:"copiado","token-rotate":"rotar token","token-rotate-explain":"El nuevo token NO se mostrará: recupéralo con `nexuscrew show token`. La sesión actual quedará invalidada.","service-regenerate":"regenerar service","npm-auto-update":"actualizaciones automáticas desde npm","npm-auto-update-help":"Comprueba latest periódicamente e instala solo versiones más recientes. Nunca baja de versión.","npm-update-current":"instalada","npm-update-latest":"npm latest","npm-update-check":"comprobar ahora","npm-update-install":"actualizar ahora","npm-update-restarting":"Actualización iniciada; NexusCrew volverá después de reiniciar el servicio.","npm-update-idle":"actualizado","npm-update-checking":"comprobando","npm-update-available":"actualización disponible","npm-update-installing":"instalando","npm-update-installed":"instalada, reiniciando","npm-update-error":"comprobación fallida","npm-update-unsupported":"disponible solo con instalación npm global","service-installed":"service instalado","service-missing":"service no instalado","service-active":"activo","service-inactive":"no activo",confirm:"confirmar",add:"añadir",enable:"activar","wizard-title":"bienvenido a NexusCrew","wizard-skip":"configura después desde ajustes","wizard-step-roles":"roles de esta instalación","wizard-step-node":"primer nodo remoto (opcional)","wizard-done":"todo listo","wizard-done-desc":"configuración completa — puedes cambiarlo todo desde ajustes",next:"continuar",back:"atrás",skip:"omitir",finish:"terminar","err-node-name":"nombre inválido (a-z, 0-9, -, máx 32)","err-local-name":"nombre local inválido: usa un slug único, no “localhost”","err-ssh":"ssh inválido (se espera user@host o alias)","err-port":"puerto inválido (1–65535)","err-ssh-port":"puerto SSH inválido (1–65535)","err-node-port":"puerto NexusCrew inválido (1–65535)","node-sessions":"{n} sesiones","tunnel-down-since":"túnel caído desde hace {t}","node-unreachable":"nodo inalcanzable","node-passive":"cliente desconectado · estado normal","node-offline":"nodo desconectado","node-offline-seen":"sin conexión · visto hace {t}","node-needs-repair":"legacy · vuelve a enlazar","asks-title":"preguntas de las celdas","ask-dismiss":"Descartar la pregunta","ask-reply-ph":"escribe la respuesta…","push-enable":"activar notificaciones push","push-disable":"desactivar notificaciones push","push-on":"push activas en este dispositivo","push-off":"push no activas","push-denied":"permiso de notificaciones denegado por el navegador","push-unsupported":"push no soportadas en este navegador","notification-speech-enable":"leer las notificaciones en voz alta","notification-speech-help":"Usa la voz del navegador solo para notificaciones nuevas mientras esta PWA está visible y en primer plano. Con la aplicación cerrada permanece la notificación del sistema.","notification-speech-test":"probar voz","notification-speech-testing":"probando voz…","notification-speech-preview":"NexusCrew. Las notificaciones por voz están activas.","notification-speech-preview-ok":"Prueba de voz completada.","notification-speech-preview-failed":"El navegador no inició la prueba de voz. Interactúa con la página y vuelve a intentarlo.","notification-speech-needs-test":"Para esta sesión de la aplicación, pulsa “probar voz” antes de recibir avisos hablados.","notification-speech-unsupported":"La síntesis de voz no está disponible en este navegador.","audio-title":"Audio nativo del nodo","audio-help":"El consentimiento y los controles valen solo para este dispositivo. Compartir y visibilidad no autorizan sonidos.","audio-consent":"permitir TTS en este nodo","audio-consent-help":"Permite que celdas autorizadas, locales o remotas, entreguen un comando de voz. Puedes revocarlo en cualquier momento.","audio-capability":"Capacidad local","audio-loading":"leyendo el estado de audio local…","audio-adapter":"adaptador","audio-adapter-none":"ninguno","audio-installed":"instalado","audio-installed-yes":"sí","audio-installed-no":"no","audio-liveness":"disponibilidad","audio-liveness-ready":"listo para aceptar","audio-liveness-unavailable":"no disponible","audio-languages":"idiomas declarados","audio-limits":"límites","audio-test":"probar audio local","audio-testing":"probando audio…","audio-stop":"detener audio local","audio-stopping":"deteniendo audio…","audio-test-needs-consent":"Activa el consentimiento local antes de probar la voz.","audio-unavailable":"No hay un adaptador TTS nativo disponible en este nodo.","audio-test-accepted":"El nodo aceptó la prueba. No demuestra que alguien la haya oído.","audio-test-refused":"El nodo rechazó la prueba.","audio-test-unknown":"Resultado de prueba desconocido: el nodo no pudo confirmar el inicio.","audio-stop-stopped":"Audio local detenido.","audio-stop-idle":"No hay enunciado local que detener.","audio-groups-title":"Grupos de audio compartido","audio-groups-help":"Decide en qué dispositivos se oye la voz cuando habla una celda. Un grupo es una preferencia local de entrega, no un consentimiento. Cada nodo conserva su consentimiento, ACL, disponibilidad y Stop local.","audio-groups-empty":"Sin grupos: la voz sale solo por este nodo.","audio-group-name":"nombre del grupo","audio-group-mode":"modo de entrega","audio-group-primary":"primero disponible (en orden)","audio-group-fanout":"todos los nodos enumerados","audio-group-targets":"nodos destino exactos","audio-group-local":"este nodo","audio-group-unavailable-target":"no detectado ahora","audio-group-no-targets":"No hay ningún nodo con instanceId disponible. Un grupo no puede usar nombres, comodines ni “todos”.","audio-group-new":"nuevo grupo","audio-group-edit":"editar","audio-group-delete":"eliminar","audio-group-save":"guardar grupo","audio-group-cancel":"cancelar","audio-group-invalid":"El grupo necesita un nombre válido y al menos un nodeId exacto.","audio-group-save-failed":"No se pudo guardar el grupo de audio.","node-display-label":"Nombre (etiqueta)","routed-node-aliases":"Alias de nodos enrutados","routed-node-aliases-help":"Visibles solo en este dispositivo; la ruta y el nombre remoto no cambian.","node-local-alias":"Alias en este dispositivo","alias-on-device":"Alias en este dispositivo","reset-alias":"Restablecer nombre remoto","node-slug-hint":"enrutado por slug: {slug}","device-name-label":"Nombre del dispositivo","device-name-hint":"cómo te ven los pares (editable)","local-route-name-label":"Nombre local / ruta","local-route-name-hint":"identificador técnico estable: etiqueta legible + sufijo del nodeId; editable antes de conectar","err-label":"etiqueta no válida (máx 64 caracteres, sin saltos de línea)","fleet-inventory":"Celdas y sesiones","fleet-inventory-help":"todas las posiciones (Local + rutas Hydra)","fleet-manage-location":"Gestionar ubicación","fleet-network-overview":"Vista de red","fleet-manage-help":"crea y configura celdas en la ubicación seleccionada","fleet-overview-help":"estado operativo de todas las ubicaciones, separado del editor","fleet-inventory-empty":"sin celdas ni sesiones","cell-switcher-refreshing":"actualizando celdas…","cell-switcher-empty-active":"no hay celdas activas verificadas","cell-switcher-not-confirmed":"estado sin confirmar","cell-switcher-not-active":"esta celda ya no está activa","cell-switcher-select":"selecciona una celda","cell-switcher-open":"abrir celda","cell-switcher-show-all":"todas","cell-switcher-show-active":"activas","cell-switcher-close":"cerrar selector de celdas","fleet-not-available":"fleet no disponible en esta posición",start:"iniciar",stop:"detener",restart:"reiniciar",delete:"eliminar","copy-manual":"copia fallida — selecciona y pulsa Cmd+C, o copia a mano","copy-empty":"nada seleccionado: arrastra con Shift para seleccionar","selection-held":"resaltado perdido, texto aún retenido","invite-hub-only":"Una invitación se acuña en el hub. Admitir un nodo nuevo es lo único que un nodo conectado no puede pedir en nombre de otro: abre NexusCrew en el hub y créala allí.","row-private":"privado","node-detail-open":"abrir el detalle","node-detail-reach":"Alcanzabilidad","node-detail-route":"ruta","node-detail-ssh":"SSH","node-detail-transport":"transporte","node-detail-owner":"propietario","node-detail-authority":"Qué puede hacer este nodo","authority-owner-equivalent":"Autoridad igual a la tuya: un nodo emparejado puede hacer en esta máquina todo lo que puedes hacer tú.","authority-routed":"No está emparejado con esta máquina: su autoridad vive en el hub que lo enruta.","authority-no-grants":"Los poderes por nodo aún no existen: aquí no hay nada que conceder ni retirar.","node-detail-network-view":"Qué ve de esta red","node-detail-command":"Comando","vl-no-commands":"El dispositivo no declara comandos disponibles.","vl-events-title":"Sesión","vl-events-empty":"Ningún evento en memoria: la sesión aún no ha hablado, o lo que dijo ha salido del búfer. El historial queda en el dispositivo.","vl-events-gap":"eventos no recibidos:","vl-events-truncated":"contenido truncado por el dispositivo","vl-events-turn-end":"— fin del turno —","vl-events-done":"— sesión terminada —","vl-events-writer-epoch":"— cambio de escritor —","vl-events-tool":"herramienta","vl-events-tool-ok":"terminada","vl-events-tool-failed":"fallida","vl-events-usage":"consumo actualizado","vl-events-stale":"Actualización fallida: puede que no estés viendo lo último.","vl-cmd-phase-submitted":"enviado, a la espera de confirmación","vl-cmd-phase-inflight":"en curso","vl-cmd-phase-done-ok":"completado","vl-cmd-phase-done-error":"fallido","vl-cmd-status":"estado","vl-cmd-health":"salud","vl-cmd-start":"iniciar","vl-cmd-stop":"detener","vl-cmd-restart":"reiniciar","vl-cmd-version":"versión","vl-cmd-capabilities":"capacidades","vl-cmd-logs":"logs","vl-cmd-unpair":"desemparejar","node-grant-none":"Ningún nodo elegido: compartido, pero hacia nadie.","node-grant-unknown":"ya no está en el inventario","node-grant-remove":"quitar","node-grant-add":"Añadir un nodo","node-grant-search":"Buscar entre los nodos","node-grant-no-candidates":"Ningún nodo coincide.","single-view":"vista única",retract:"reducir","keybar-expand":"ampliar la barra de teclas","keybar-retract":"reducir la barra de teclas","save-and-start":"guardar e iniciar",permissions:"Permisos","power-on-hint":"Detén la celda; también puedes quitarla del boot.","launch-engine-help":"Proveedores, credenciales y nuevos motores se crean en Ajustes → Flota. Modelo y permisos son por celda.","launch-unavailable-hint":"La configuración del motor no está disponible en este nodo.","import-as-cell":"Importar como celda","import-help":"Reconcilia una sesión tmux existente en una celda gestionada. Elige un motor ya declarado: no se inventa ninguno.","import-engine-required":"elige un motor (obligatorio)","test-and-connect":"probar y conectar","pairing-v2-hint":"Pega o escanea UN solo enlace: rellena nombre, Host SSH y etiqueta cuando los incluye (v2).","invite-v2-hint":"Crea una invitación completa de un solo uso. Si este dispositivo ya está unido a un hub, se usa automáticamente; si no, solo hace falta su dirección SSH alcanzable.","invite-network-hint":"Crea una invitación para la red a la que ya estás conectado. El nuevo dispositivo entra por el hub y no se conecta directamente a este dispositivo.","invite-network-label":"Red de destino","invite-network-via":"Hub","invite-network-route":"Una sola conexión al hub; nodos, celdas y decks se enrutan internamente.","invite-endpoint-label":"Dirección SSH de este hub vista por los otros dispositivos","invite-endpoint-auto":"Endpoint ya configurado","invite-endpoint-needed":"Introduce usuario@host o un alias SSH compartido. No es 127.0.0.1 ni la URL HTTP de NexusCrew.","invite-ssh-hint":"El destino SSH con el que el OTRO dispositivo alcanza ESTA instalación (usuario@host o alias). Obligatorio: se incluye en el enlace.","invite-next-steps":"copia este enlace, abre NexusCrew en el otro dispositivo y pégalo en Ajustes → Nodos (o escanea el QR): NexusCrew hace el resto","pair-card-title":"conectar con un solo enlace","pair-card-help":"Pega el enlace de emparejamiento generado en el otro dispositivo (o escanea su QR): NexusCrew lo decodifica, prueba la conexión SSH y conecta solo.","pair-paste-ph":"pega aquí el enlace de emparejamiento","pair-paste-btn":"pegar","pair-advanced":"avanzado / editar","pair-progress":"conectando: SSH → invitación → confirmación → verificación…","pair-retry":"reintentar","pair-invalid-link":"esto no es un enlace de emparejamiento válido","pair-invalid-hint":"se necesita el enlace completo (http://…#pair=…) generado por el otro NexusCrew: no lo abras, pégalo aquí","pair-missing-ssh":"el enlace no incluye el destino SSH (formato v1): indica en “avanzado” cómo este dispositivo alcanza al otro por SSH — nunca se inventa","pair-missing-name":"falta el nombre del nodo: complétalo en “avanzado”","pair-clipboard-denied":"lectura del portapapeles no permitida: pega manualmente en el campo","pair-clipboard-empty":"portapapeles vacío: copia primero el enlace","pair-stage-validation":"datos no válidos","pair-stage-conflict":"nombre ya en uso","pair-stage-ssh-start":"fallo al iniciar el túnel SSH","pair-stage-ssh-ready":"peer inaccesible por SSH","pair-stage-join":"intercambio de invitación fallido","pair-stage-tunnel-final":"túnel negociado fallido","pair-stage-confirm":"confirmación de emparejamiento fallida","pair-stage-health":"verificación final de la federación fallida","pair-stage-internal":"error interno","pair-stage-generic":"conexión fallida","qr-no-camera":"no hay cámara disponible en este dispositivo: usa una foto del QR","qr-permission":"permiso de cámara denegado: permítelo en el navegador o usa una foto del QR","qr-unsupported":"escáner en vivo no soportado aquí: sube una foto del QR","qr-upload":"usar una foto"}};function Ol(){const e=oy(),t=e?e.getItem(ry):null;return tf.includes(t)?t:jl}function ox(e){const t=oy();if(t)try{t.setItem(ry,e)}catch{}typeof window<"u"&&window.dispatchEvent(new Event(Wd))}function p(e){const t=Ol(),n=gl[t]||gl[jl];return Object.prototype.hasOwnProperty.call(n,e)?n[e]:Object.prototype.hasOwnProperty.call(gl[jl],e)?gl[jl][e]:e}function ax(e){return typeof window>"u"?()=>{}:(window.addEventListener(Wd,e),()=>window.removeEventListener(Wd,e))}const ay=tf;function kn(){return[N.useSyncExternalStore(ax,Ol,Ol),ox]}function Bl({cell:e,token:t,route:n=[],onConfirm:s,onClose:o}){var $,U;kn();const a=!!(e&&e.active),u=Array.isArray(n)?n.join("/"):"",[h,f]=N.useState([]),[m,v]=N.useState(!1);N.useEffect(()=>{let R=!0;return(async()=>{if(t)try{const K=await ws(t,u?u.split("/"):[]);if(!R)return;if(v(K.provider==="builtin"&&(K.capabilities||[]).includes("edit")),K.provider==="builtin"&&(K.capabilities||[]).includes("definitions")){const B=await Gh(t,u?u.split("/"):[]);if(!R)return;const j=new Map((K.engines||[]).map(D=>[D.id,D]));f((B.engines||[]).map(D=>{var W,ne,ce,pe,ye,me,ae;return{id:D.id,label:D.label||D.id,client:((W=D.managed)==null?void 0:W.client)||"",models:[...new Set([...((ne=j.get(D.id))==null?void 0:ne.models)||[],...((ce=D.managedInfo)==null?void 0:ce.models)||[]])].filter(Boolean),defaultModel:((pe=D.managed)==null?void 0:pe.model)||((ye=D.managedInfo)==null?void 0:ye.defaultModel)||"",policyDefault:((me=D.managed)==null?void 0:me.permissionPolicy)||((ae=D.managed)!=null&&ae.client&&D.managed.client==="claude"?"unsafe":"standard")}}))}}catch{}})(),()=>{R=!1}},[t,u]);const b=(e==null?void 0:e.engine)||(($=h[0])==null?void 0:$.id)||"",y=R=>(e==null?void 0:e.models)&&e.models[R]||"",S=R=>{const K=(e==null?void 0:e.permissionPolicies)&&e.permissionPolicies[R];if(K==="standard"||K==="unsafe")return K;const B=h.find(j=>j.id===R);return B?B.policyDefault:"standard"},[w,x]=N.useState(b),[k,P]=N.useState((e==null?void 0:e.model)||""),E=(e==null?void 0:e.permissionPolicy)==="standard"||(e==null?void 0:e.permissionPolicy)==="unsafe"?e.permissionPolicy:((U=e==null?void 0:e.permissionPolicies)==null?void 0:U[e==null?void 0:e.engine])||"",[F,M]=N.useState(E),[V,G]=N.useState((e==null?void 0:e.boot)??!0),[O,Z]=N.useState(!1),[X,Q]=N.useState(null);N.useEffect(()=>{h.length&&(x(R=>R||b),P(R=>R||y((e==null?void 0:e.engine)||b)||""),M(R=>R==="standard"||R==="unsafe"?R:S((e==null?void 0:e.engine)||b)))},[h.length]);const z=N.useMemo(()=>h.find(R=>R.id===w)||null,[h,w]),I=!!(z&&["claude","codex","codex-vl","agy","kimi"].includes(z.client)),C=(z==null?void 0:z.client)==="shell";function T(R){x(R);const K=h.find(B=>B.id===R);P(y(R)||(K==null?void 0:K.defaultModel)||""),M(S(R))}async function A(R){R.preventDefault(),Z(!0),Q(null);try{if(a)await s({action:"down",boot:V});else{const K=F==="standard"||F==="unsafe"?F:(z==null?void 0:z.policyDefault)||"standard";await s({action:"up",...m?{engine:w,model:k||"",...I?{permissionPolicy:K}:(z==null?void 0:z.client)==="pi"?{permissionPolicy:"standard"}:{}}:{},boot:V})}o()}catch(K){Q(String(K&&K.message||K)),Z(!1)}}return c.jsx("div",{className:"nc-sheet-overlay nc-launch-overlay",onClick:o,children:c.jsxs("form",{className:"nc-sheet nc-power-sheet nc-launch-sheet",onClick:R=>R.stopPropagation(),onSubmit:A,children:[c.jsxs("div",{className:"nc-sheet-head",children:[c.jsx("b",{children:e==null?void 0:e.cell}),c.jsx("span",{className:"nc-sheet-state",children:p(a?"state-on":"state-off")})]}),a?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:p("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[p("model"),": ",e.model]}),c.jsx("small",{children:p("power-on-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:V,onChange:R=>G(R.target.checked)}),p("remove-boot")]})]}):c.jsxs(c.Fragment,{children:[m&&h.length>0?c.jsxs("div",{className:"nc-launch-fields",children:[c.jsxs("label",{className:"nc-field",children:[p("engine"),c.jsx("select",{value:w,onChange:R=>T(R.target.value),children:h.map(R=>c.jsx("option",{value:R.id,children:R.label},R.id))})]}),!C&&c.jsxs("label",{className:"nc-field",children:[p("model"),c.jsx("input",{value:k,list:"nc-launch-models",placeholder:p("model-default"),onChange:R=>P(R.target.value)}),c.jsx("datalist",{id:"nc-launch-models",children:((z==null?void 0:z.models)||[]).map(R=>c.jsx("option",{value:R},R))})]}),I?c.jsxs("label",{className:"nc-field",children:[p("permissions"),c.jsxs("select",{value:F,onChange:R=>M(R.target.value),children:[c.jsx("option",{value:"standard",children:p("fleet-standard-permissions")}),c.jsx("option",{value:"unsafe",children:p("fleet-unsafe-permissions")})]})]}):c.jsx("small",{className:"nc-note",children:p("fleet-standard-permissions")}),I&&F==="unsafe"&&c.jsx("small",{className:"nc-err",children:p("fleet-unsafe-warning")}),c.jsx("small",{className:"nc-note",children:p(C?"fleet-shell-launch-help":"launch-engine-help")})]}):c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:p("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[p("model"),": ",e.model]}),c.jsx("small",{children:p("launch-unavailable-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:V,onChange:R=>G(R.target.checked)}),p("boot-persist")]})]}),X&&c.jsx("div",{className:"nc-err",children:X}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:o,disabled:O,children:p("cancel")}),c.jsx("button",{type:"submit",className:"nc-btn primary",disabled:O,children:p(a?"power-off":"save-and-start")})]})]})})}const Ng=/^[a-z0-9-]{1,32}$/;function Go(e,t){const n=Array.isArray(e)?e:[];return n.length?`${n.map(encodeURIComponent).join("/")}:${t}`:String(t)}function lx(e,t,n){const s={};for(const o of Array.isArray(t)?t:[]){const a=Array.isArray(o==null?void 0:o.route)?o.route:typeof(o==null?void 0:o.name)=="string"?[o.name]:[];if(!a.length)continue;const u=a.join("/"),h=o.status==="up"||o.tunnel&&o.tunnel.status==="up",f=o.status==="passive"||o.tunnel&&o.tunnel.status==="passive";!h&&!f&&(s[u]=e&&e[u]||n)}return s}function jg(e,t,n){return!e||!Array.isArray(e.cells)?[]:e.cells.map(s=>({...s,route:t,key:`${n}:${s.tmuxSession||s.cell}`}))}function Rg({nodes:e,topology:t,remote:n,down:s,fleet:o,aliases:a}={}){var m,v,b,y;const u=[],h=new Set,f=new Set;for(const S of Array.isArray(e)?e:[]){if(!S||typeof S.name!="string"||!Ng.test(S.name)||S.direction==="inbound"&&S.shared!==!0)continue;const w=[S.name],x=S.name;h.add(x);const k=((m=S.tunnel)==null?void 0:m.status)||"unknown",P=k==="up",E={name:S.name,label:S.label||S.name,originalLabel:S.label||S.name,alias:null,route:w,direct:!0,instanceId:S.nodeId||null,shared:S.shared===!0,tunnelStatus:k,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:S.health||null,direction:S.direction||"outbound",roles:S.roles||null,rolesKnown:S.rolesKnown===!0};if(S.nodeId&&f.add(S.nodeId),!S.nodeId&&S.paired===!1){u.push({...E,status:"needs-repair",downSince:s&&s[x]||null});continue}if(((v=S.health)==null?void 0:v.auth)==="failed"||k==="degraded"&&((b=S.health)==null?void 0:b.status)==="degraded"){u.push({...E,status:"needs-repair",downSince:s&&s[x]||null});continue}if(k==="passive"||((y=S.health)==null?void 0:y.status)==="passive"){u.push({...E,status:"passive",downSince:null});continue}if(!P){u.push({...E,status:"down",downSince:s&&s[x]||null});continue}const F=n&&(n[x]||n[S.name])||null,M=o&&(o[x]||o[S.name]),V=!!(F&&!F.error&&Array.isArray(F.sessions)),G=!!(M&&M.available===!0&&Array.isArray(M.cells));if(!V&&!G){u.push({...E,status:"unreachable"});continue}const O=(V?F.sessions:[]).filter(Q=>Q&&typeof Q.name=="string"&&Q.name).map(Q=>({...Q,node:x,route:w,key:`${x}:${Q.name}`})),Z=jg(M,w,x),X=new Set(Z.map(Q=>Q.tmuxSession).filter(Boolean));u.push({...E,status:"up",sessions:O,cells:Z,unmanaged:O.filter(Q=>!X.has(Q.name)),fleetAvailable:!!(M&&M.available),capabilities:M&&M.capabilities||[],engines:M&&M.engines||[],fleetProvider:M&&M.provider||null,sessionsAvailable:V,inventoryPartial:!V})}for(const S of Array.isArray(t)?t:[]){if(!S||!Array.isArray(S.route)||S.route.length<1||S.route.some(X=>!Ng.test(X)))continue;const w=S.route.join("/");if(h.has(w)||S.instanceId&&f.has(S.instanceId))continue;S.instanceId&&f.add(S.instanceId);const x=S.label||S.route.join(" › "),k=S.instanceId&&a&&typeof a[S.instanceId]=="string"?a[S.instanceId]:null,P={name:S.name,label:k||x,originalLabel:x,alias:k,route:[...S.route],direct:!1,instanceId:S.instanceId||null,shared:!0,tunnelStatus:null,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:S.health||null,lastSeen:S.lastSeen||null};if(S.stale){u.push({...P,status:"offline",downSince:s&&s[w]||S.lastSeen||null});continue}const E=n&&n[w]||null,F=o&&o[w],M=!!(E&&!E.error&&Array.isArray(E.sessions)),V=!!(F&&F.available===!0&&Array.isArray(F.cells));if(!M&&!V){u.push({...P,status:"unreachable",downSince:s&&s[w]||null});continue}const G=(M?E.sessions:[]).filter(X=>X&&typeof X.name=="string"&&X.name).map(X=>({...X,node:w,route:S.route,key:`${w}:${X.name}`})),O=jg(F,S.route,w),Z=new Set(O.map(X=>X.tmuxSession).filter(Boolean));u.push({...P,status:"up",sessions:G,cells:O,unmanaged:G.filter(X=>!Z.has(X.name)),fleetAvailable:!!(F&&F.available),capabilities:F&&F.capabilities||[],engines:F&&F.engines||[],fleetProvider:F&&F.provider||null,lastSeen:S.lastSeen||null,sessionsAvailable:M,inventoryPartial:!M})}return u.sort((S,w)=>S.label.localeCompare(w.label))}function ly(e,t={}){if(!e||typeof e!="object")return null;const n=typeof e.nodeId=="string"?e.nodeId:"";if(!n)return null;const s=typeof e.label=="string"&&e.label.trim()||typeof e.cell=="string"&&e.cell.trim()||n,o=Array.isArray(t.route)?[...t.route]:[];return{kind:"vl",nodeId:n,name:n,label:s,cell:e.cell??null,paired:!!e.pairedAt,online:!!e.online,lastSeen:e.lastSeen??null,generation:e.generation??null,version:e.version??null,health:e.health??null,session:e.session??null,capabilities:Array.isArray(e.capabilities)?e.capabilities:[],inflight:e.inflight??null,lastAck:e.lastAck??null,canManage:!!e.canManage,route:o,isLocal:o.length===0,ownerInstanceId:typeof t.instanceId=="string"?t.instanceId:null,ownerLabel:typeof t.label=="string"&&t.label?t.label:null}}function cx(e){var n;const t=[];for(const s of Array.isArray(e)?e:[]){if(!s||s.kind!=="vl"||!s.nodeId)continue;const o=s.online===!0,a=o&&((n=s.session)==null?void 0:n.attached)===!0,u=s.ownerInstanceId||"local";t.push({kind:"vl",name:`vl-${s.nodeId.slice(0,8)}`,label:s.label,route:Array.isArray(s.route)?[...s.route]:[],instanceId:null,direct:!1,status:o?"up":"offline",downSince:o?null:s.lastSeen??null,sessions:a?[{key:`vl:${u}:${s.nodeId}`,name:s.session.profile,attached:!0}]:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:s.health??null,peer:s})}return t}function cy(e,t){const n=e&&Array.isArray(e.nodes)?e.nodes:[],s=new Set([t]),o=[];for(const a of n){const u=a&&typeof a.instanceId=="string"?a.instanceId:"";if(!u||s.has(u)||a.stale===!0||!Array.isArray(a.route)||a.route.length===0)continue;s.add(u);const h=typeof a.label=="string"&&a.label||typeof a.name=="string"&&a.name||a.route.join(" › ");o.push({instanceId:u,route:[...a.route],label:h})}return o}const ux=4e3;function nf(e,t=!0,n=0){const[s,o]=N.useState([]),a=N.useRef({});return N.useEffect(()=>{if(!t||!e){o([]);return}let u=!0;async function h(){var M;let m=[],v=[],b={},y="";if(await Promise.all([w0(e).then(V=>{m=Array.isArray(V.nodes)?V.nodes:[]}).catch(()=>{}),ey(e).then(V=>{v=Array.isArray(V.nodes)?V.nodes:[]}).catch(()=>{}),E0(e).then(V=>{b=V&&typeof V.aliasesByInstanceId=="object"?V.aliasesByInstanceId:{}}).catch(()=>{}),Ft("/api/config",e).then(V=>V.json()).then(V=>{y=V&&typeof V.instanceId=="string"?V.instanceId:""}).catch(()=>{})]),!u)return;const S=[{instanceId:y||null,route:[],label:null},...cy(v,y)],w=[];if(await Promise.all(S.map(async V=>{try{const G=await Z_(e,V.route);for(const O of G.nodes||[]){const Z=ly(O,V);Z&&w.push(Z)}}catch{}})),!u)return;const x={},k={},P=new Set(m.map(V=>V.name)),E=[];for(const V of m)((M=V.tunnel)==null?void 0:M.status)==="up"&&(V.nodeId||V.paired!==!1)&&(V.direction!=="inbound"||V.shared===!0)&&E.push([V.name]);for(const V of v)!V.stale&&Array.isArray(V.route)&&!(V.route.length===1&&P.has(V.route[0]))&&E.push(V.route);if(await Promise.all(E.map(async V=>{const G=V.join("/");try{x[G]=await Jh(e,V)}catch{x[G]={error:"unreachable"}}try{k[G]=await ws(e,V)}catch{k[G]={available:!1}}})),!u)return;const F=Rg({nodes:m,topology:v,remote:x,fleet:k,aliases:b,down:a.current});a.current=lx(a.current,F,Math.floor(Date.now()/1e3)),o([...Rg({nodes:m,topology:v,remote:x,fleet:k,aliases:b,down:a.current}),...cx(w)])}h();const f=setInterval(h,ux);return()=>{u=!1,clearInterval(f)}},[e,t,n]),s}const Pg=52,Lg=14;function bi({position:e,itemKey:t,label:n,onMove:s,onStep:o,canMove:a=()=>!0,scope:u="roster"}){const h=N.useRef(null),f=N.useRef(0),[m,v]=N.useState(!1),b=()=>{var P,E,F,M;const k=h.current;(E=(P=k==null?void 0:k.over)==null?void 0:P.classList)==null||E.remove("nc-roster-over"),(M=(F=k==null?void 0:k.source)==null?void 0:F.classList)==null||M.remove("nc-roster-dragging"),f.current&&cancelAnimationFrame(f.current),f.current=0},y=(k=!1)=>{const P=h.current;if(!P)return;const E=P.target;b(),h.current=null,v(!1);try{P.handle.releasePointerCapture(P.pointerId)}catch{}k&&E&&E!==t&&a(t,E)&&s(t,E)},S=(k,P)=>{var Z,X,Q,z,I,C,T,A,$;const E=h.current;if(!E)return;E.x=k,E.y=P;const F=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",M=(X=(Z=document.elementFromPoint(k,P))==null?void 0:Z.closest)==null?void 0:X.call(Z,F),V=u==="node"?(Q=M==null?void 0:M.dataset)==null?void 0:Q.nodeOrderKey:(z=M==null?void 0:M.dataset)==null?void 0:z.rosterKey,O=(u==="node"||((I=M==null?void 0:M.dataset)==null?void 0:I.position)===e)&&V&&V!==t&&a(t,V);E.over!==(O?M:null)&&((T=(C=E.over)==null?void 0:C.classList)==null||T.remove("nc-roster-over"),E.over=O?M:null,($=(A=E.over)==null?void 0:A.classList)==null||$.add("nc-roster-over")),E.target=O?V:null},w=()=>{const k=h.current;if(!k){f.current=0;return}const P=k.container;if(P){const E=P.getBoundingClientRect(),F=k.y<E.top+Pg?-Lg:k.y>E.bottom-Pg?Lg:0;F&&(P.scrollTop+=F,S(k.x,k.y))}f.current=requestAnimationFrame(w)};N.useEffect(()=>{const k=E=>{E.key==="Escape"&&h.current&&(E.preventDefault(),y(!1))},P=()=>y(!1);return window.addEventListener("keydown",k),window.addEventListener("blur",P),()=>{window.removeEventListener("keydown",k),window.removeEventListener("blur",P),b(),h.current=null}},[t,e,u]);const x=k=>{var M;if(k.pointerType==="mouse"&&k.button!==0)return;k.preventDefault(),k.stopPropagation(),k.currentTarget.focus({preventScroll:!0});const P=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",E=k.currentTarget.closest(P),F=k.currentTarget.closest(".nc-side-scroll, .nc-home-scroll, .nc-cell-switcher-list");h.current={pointerId:k.pointerId,handle:k.currentTarget,source:E,container:F,target:null,over:null,x:k.clientX,y:k.clientY},(M=E==null?void 0:E.classList)==null||M.add("nc-roster-dragging");try{k.currentTarget.setPointerCapture(k.pointerId)}catch{}v(!0),f.current=requestAnimationFrame(w)};return c.jsx("button",{type:"button",className:`nc-roster-handle${m?" active":""}`,"aria-label":`${p("reorder")} ${n}`,"aria-keyshortcuts":"ArrowUp ArrowDown",title:p("reorder-help"),onClick:k=>{k.preventDefault(),k.stopPropagation()},onDragStart:k=>k.preventDefault(),onKeyDown:k=>{k.key!=="ArrowUp"&&k.key!=="ArrowDown"||(k.preventDefault(),k.stopPropagation(),o(k.key==="ArrowUp"?-1:1))},onPointerDown:x,onPointerMove:k=>{!h.current||k.pointerId!==h.current.pointerId||(k.preventDefault(),k.stopPropagation(),S(k.clientX,k.clientY))},onPointerUp:k=>{!h.current||k.pointerId!==h.current.pointerId||(k.preventDefault(),k.stopPropagation(),y(!0))},onPointerCancel:()=>y(!1),onLostPointerCapture:()=>{h.current&&y(!1)},children:"↕"})}const sf="nc_pins";function dx(){try{const e=JSON.parse(localStorage.getItem(sf));return Array.isArray(e)?e:[]}catch{return[]}}function hx(e,t){const n=e.includes(t)?e.filter(s=>s!==t):[...e,t];try{localStorage.setItem(sf,JSON.stringify(n))}catch{}return n}function fx(e,t,n){if(!e.includes(t)||!e.includes(n)||t===n)return e;const s=[...e],o=s.indexOf(t),a=s.indexOf(n);s.splice(o,1);const u=s.indexOf(n);s.splice(o<a?u+1:u,0,t);try{localStorage.setItem(sf,JSON.stringify(s))}catch{}return s}function px(e,t,n){const s=e.indexOf(t);return[s===-1?1e9:s,-(n||0)]}function mx(e,t){return e[0]-t[0]||e[1]-t[1]}function rf(){const[e,t]=N.useState(dx),[n,s]=N.useState(ix),[o,a]=N.useState(ex),u=y=>t(S=>hx(S,y)),h=y=>Cg(n,y),f=(y,S)=>s(w=>{const x={...w,[y]:{...Cg(w,y),...S}};return sx(x)}),m=(y,S)=>e.includes(y)===e.includes(S);function v(y,S,w,x){const k=e.includes(S),P=e.includes(w);if(k===P){if(k){t(E=>fx(E,S,w));return}a(E=>{var V;const F=((V=x.find(G=>G.key===S))==null?void 0:V.technical)===!0,M=gs(x,e,F?"technical":"all",Fi(E,y)).map(G=>G.key);return tx(nx(E,y,S,w,M))})}}function b(y,S,w,x){var V;const k=((V=x.find(G=>G.key===S))==null?void 0:V.technical)===!0,P=e.includes(S),E=gs(x,e,k?"technical":"all",Fi(o,y)).map(G=>G.key).filter(G=>e.includes(G)===P),F=E.indexOf(S),M=E[F+w];F>=0&&M&&v(y,S,M,x)}return{pins:e,views:n,orders:o,togglePin:u,viewFor:h,updateView:f,canMoveRoster:m,moveRoster:v,stepRoster:b}}const uy="nc_node_order_v1",gx=/^[a-f0-9]{16,64}$/;function qs(e){if(gx.test(String((e==null?void 0:e.instanceId)||"")))return`id:${e.instanceId}`;const t=Array.isArray(e==null?void 0:e.route)?e.route.filter(n=>typeof n=="string"&&n):[];return t.length?`route:${t.map(encodeURIComponent).join("/")}`:typeof(e==null?void 0:e.name)=="string"&&e.name?`name:${encodeURIComponent(e.name)}`:""}function Ag(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(uy));return Array.isArray(t)?[...new Set(t.filter(n=>typeof n=="string"&&n&&n.length<=192))].slice(0,128):[]}catch{return[]}}function vx(e,t=globalThis.localStorage){try{t.setItem(uy,JSON.stringify(e))}catch{}return e}function Tg(e=[],t=[]){const n=new Map(t.map((s,o)=>[s,o]));return e.map((s,o)=>({group:s,index:o})).sort((s,o)=>{const a=n.has(qs(s.group))?n.get(qs(s.group)):Number.MAX_SAFE_INTEGER,u=n.has(qs(o.group))?n.get(qs(o.group)):Number.MAX_SAFE_INTEGER;return a-u||s.index-o.index}).map(({group:s})=>s)}function _x(e,t,n,s=[]){if(!t||!n||t===n)return e;const o=s.map(qs).filter(Boolean);if(!o.includes(t)||!o.includes(n))return e;const a=[...e.filter(m=>o.includes(m)),...o.filter(m=>!e.includes(m))],u=a.indexOf(t),h=a.indexOf(n);a.splice(u,1);const f=a.indexOf(n);return a.splice(u<h?f+1:f,0,t),a}const Kd="nexuscrew-node-preferences";function yx(){try{window.dispatchEvent(new Event(Kd))}catch{}}function dy(){const[e,t]=N.useState(Ag);N.useEffect(()=>{const a=()=>t(Ag());return window.addEventListener("storage",a),window.addEventListener(Kd,a),()=>{window.removeEventListener("storage",a),window.removeEventListener(Kd,a)}},[]);const n=a=>Tg(a,e),s=(a,u,h)=>t(f=>{const m=_x(f,a,u,h);return vx(m),yx(),m});return{order:e,groupsFor:n,moveNode:s,stepNode:(a,u,h)=>{const f=Tg(h,e).map(qs),m=f.indexOf(a),v=f[m+u];m>=0&&v&&s(a,v,h)},nodeKey:qs}}function Tr(e,t=Math.floor(Date.now()/1e3)){if(!e)return"";const n=t-e;return n<0||n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Bi(e){return e.status==="passive"?p("node-passive"):e.status==="down"?e.downSince?p("tunnel-down-since").replace("{t}",Tr(e.downSince)):p("tunnel-down"):e.status==="unreachable"?p("node-unreachable"):e.status==="offline"?e.lastSeen?p("node-offline-seen").replace("{t}",Tr(e.lastSeen)):p("node-offline"):e.status==="needs-repair"?p("node-needs-repair"):""}function hy(e,{passive:t=null}={}){return e?e.status==="passive"?t:e.status==="healthy"?"on":"warn":null}function qo(e){return e&&(e.detail||e.status)||""}function zl(e,t,n=globalThis.localStorage){if(!(e!=null&&e.outbox)||e.outbox.count<1)return!1;const s=Number(n.getItem(V_(t))||0);return e.outbox.latest>s}function of(e,t={}){const n=e||{};if(!n.tmux){const s=`${n.engine||""}${n.key?`·${n.key}`:""}`,o=[s,n.model&&n.model!==s?n.model:""].filter(Boolean).join(" · ");return{working:!1,subtitle:String(o||p("cell-off")).trim()}}if(t.working===!0){const s=p("cell-working"),o=String(t.status||"").trim();return{working:!0,subtitle:!o||/^working(?:\.{3}|…)?$/i.test(o)?s:`${s} · ${o}`}}return t.working===!1?{working:!1,subtitle:p("cell-idle")}:{working:!1,subtitle:String(t.preview||n.preview||p("cell-on")).trim()}}function fy(e,t){return[...new Set([e.engine,e.model,e.key,t.preview,e.preview,t.status].filter(Boolean).map(String))].join(" ")}function af(e,t,n,s=globalThis.localStorage){return[...(Array.isArray(e)?e:[]).map(o=>{const a=n.get(o.tmuxSession)||{},u=Go([],o.tmuxSession),h=of(o,a);return{type:"cell",value:o,key:u,label:o.cell,live:!!o.tmux,fresh:zl(a,u,s),activity:a.activity||0,working:h.working,subtitle:h.subtitle,searchText:fy(o,a)}}),...(Array.isArray(t)?t:[]).map(o=>{const a=Go([],o.name);return{type:"session",value:o,key:a,label:o.name,live:!0,technical:o.technical===!0,fresh:zl(o,a,s),activity:o.activity||0,searchText:`${o.preview||""} ${o.cmd||""}`}})]}function Fl(e,t=globalThis.localStorage){const n=e||{},s=Array.isArray(n.route)?n.route:[],o=new Map((n.sessions||[]).map(u=>[u.name,u])),a=[...(n.cells||[]).map(u=>{const h=o.get(u.tmuxSession)||{},f=Go(s,u.tmuxSession||u.cell),m=of(u,h);return{type:"cell",value:u,key:f,label:u.cell,live:!!u.tmux,fresh:zl(h,f,t),activity:h.activity||u.activity||0,working:m.working,subtitle:m.subtitle,searchText:fy(u,h)}}),...(n.unmanaged||[]).map(u=>{const h=Go(s,u.name);return{type:"session",value:u,key:h,label:u.name,live:!0,technical:u.technical===!0,fresh:zl(u,h,t),activity:u.activity||0,searchText:`${u.preview||""} ${u.cmd||""}`}})];return{route:s,rawItems:a}}const lf=9,$l=.2,wx=/^[a-z0-9-]{1,32}(?:\/[a-z0-9-]{1,32}){0,3}$/,Dr=/^[a-f0-9]{16,64}$/,qd=e=>wx.test(e)&&new Set(e.split("/")).size===e.split("/").length;function ys(e){if(typeof e=="string"&&e){const t=e.indexOf(":");if(t<0)return{session:e};const n=e.slice(0,t),s=e.slice(t+1);return!qd(n)||!s?null:{session:s,node:n}}if(e&&typeof e=="object"&&typeof e.session=="string"&&e.session){const t=e.ownerId===void 0?void 0:typeof e.ownerId=="string"&&Dr.test(e.ownerId)?e.ownerId:null;return t===null?null:e.node===void 0||e.node===null||e.node===""?{session:e.session,...t?{ownerId:t}:{}}:typeof e.node=="string"&&qd(e.node)?{session:e.session,node:e.node,...t?{ownerId:t}:{}}:null}return null}function $n(e){const t=ys(e);return t?t.node?`${t.node}:${t.session}`:t.session:""}const py=9,my=24,ta=11,bx=e=>{const t=Number(e);return t>=py&&t<=my?t:ta};function Pr(){return{columns:[]}}function ki(e){return e.columns.flatMap(t=>t.tiles.map(n=>$n(n)))}function Sx(e){const t=[],n=Math.max(0,...e.columns.map(s=>s.tiles.length));for(let s=0;s<n;s+=1)for(const o of e.columns)o.tiles[s]&&t.push($n(o.tiles[s]));return t}const zr=e=>({columns:e.columns.map(t=>({width:t.width,tiles:t.tiles.map(n=>({...n}))}))});function cf(e,t,n,s){const o=ys(t);if(!o||ki(e).includes($n(o))||ki(e).length>=lf)return e;const a=zr(e),u={session:o.session,height:1,fontSize:ta,...s||{}};if(o.node&&(u.node=o.node),o.ownerId&&(u.ownerId=o.ownerId),n==="end")return a.columns.push({width:1,tiles:[u]}),a;if(n&&typeof n.col=="number"&&typeof n.row=="number"&&a.columns[n.col])return a.columns[n.col].tiles.splice(n.row,0,u),a;if(n&&typeof n.col=="number"){const h=Math.max(0,Math.min(a.columns.length,n.col));return a.columns.splice(h,0,{width:1,tiles:[u]}),a}return a.columns.push({width:1,tiles:[u]}),a}function gy(e,t){const n=$n(t);if(!n||ki(e).includes(n)||ki(e).length>=lf)return e;const s=ki(e).length+1,o=Math.ceil(Math.sqrt(s));if(e.columns.length>=o){let v=0;for(let b=1;b<e.columns.length;b+=1)e.columns[b].tiles.length<e.columns[v].tiles.length&&(v=b);return cf(e,t,{col:v,row:e.columns[v].tiles.length})}const a=[...Sx(e),n],u=new Map(e.columns.flatMap(v=>v.tiles.map(b=>[$n(b),b]))),h=ys(t),f=e.columns.length?e.columns.reduce((v,b)=>v+(Number(b.width)||1),0)/e.columns.length:1,m=Array.from({length:o},(v,b)=>{var y;return{width:((y=e.columns[b])==null?void 0:y.width)||f,tiles:[]}});return a.forEach((v,b)=>{const y=ys(v);if(!y)return;const S=u.get(v)||(v===n?h:{})||{},w={session:y.session,height:S.height||1,fontSize:S.fontSize||ta};y.node&&(w.node=y.node),S.ownerId&&(w.ownerId=S.ownerId),S.unavailable===!0&&(w.unavailable=!0),m[b%o].tiles.push(w)}),{columns:m.filter(v=>v.tiles.length)}}function Hl(e,t){const n=$n(t),s=zr(e);for(const o of s.columns)o.tiles=o.tiles.filter(a=>$n(a)!==n);return s.columns=s.columns.filter(o=>o.tiles.length>0),s}function xx(e,t,n){const s=$n(t);if(!ki(e).includes(s))return e;const o=e.columns.flatMap(a=>a.tiles).find(a=>$n(a)===s);return cf(Hl(e,s),s,n,{fontSize:o.fontSize,height:o.height,...o.ownerId?{ownerId:o.ownerId}:{},...o.unavailable===!0?{unavailable:!0}:{}})}function kx(e,t){if(!(t instanceof Map)||t.size===0)return e;let n=!1;const s=zr(e);for(const o of s.columns)for(const a of o.tiles){const u=t.get($n(a));if(!u)continue;const h=ys(u);h&&(a.session=h.session,h.node?a.node=h.node:delete a.node,h.ownerId&&(a.ownerId=h.ownerId),n=!0)}return n?Ys(s):e}function Cx(e,t,n){const s=zr(e);return s.columns[t]&&(s.columns[t].width=Math.max($l,Number(n)||1)),s}function Ex(e,t,n,s){const o=zr(e),a=o.columns[t]&&o.columns[t].tiles[n];return a&&(a.height=Math.max($l,Number(s)||1)),o}function Nx(e,t,n,s){if(!(e.columns[t]&&e.columns[t].tiles[n]))return e;const a=zr(e),u=a.columns[t].tiles[n],h=Number(u.fontSize)||ta;return u.fontSize=Math.max(py,Math.min(my,h+(Number(s)||0))),a}function jx(e,t,n,s){const o=e.columns[t];if(!o||!o.tiles[n])return null;switch(s){case"left":return{col:t};case"right":return{col:t+1};case"top":return{col:t,row:n};case"bottom":return{col:t,row:n+1};default:return null}}function Dg(e){for(const t of[.25,.5,.75])if(Math.abs(e-t)<=.03)return t;return e}function Ys(e){if(!e||!Array.isArray(e.columns))return Pr();const t=e.columns.map(s=>({width:Math.max($l,Number(s&&s.width)||1),tiles:(Array.isArray(s&&s.tiles)?s.tiles:[]).filter(o=>o&&typeof o.session=="string"&&o.session).filter(o=>o.node==null||typeof o.node=="string"&&qd(o.node)).filter(o=>o.ownerId==null||typeof o.ownerId=="string"&&Dr.test(o.ownerId)).map(o=>{const a={session:o.session,height:Math.max($l,Number(o.height)||1),fontSize:bx(o.fontSize)};return o.node!=null&&(a.node=o.node),o.ownerId!=null&&(a.ownerId=o.ownerId),o.unavailable===!0&&(a.unavailable=!0),a})})).filter(s=>s.tiles.length>0),n=new Set;for(const s of t)s.tiles=s.tiles.filter(o=>!n.has($n(o))&&n.add($n(o))&&n.size<=lf);return{columns:t.filter(s=>s.tiles.length>0)}}const vy=/^[a-z0-9-]{1,32}$/,Rx=/^[A-Za-z0-9._-]{1,32}$/,Px=/^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$/,Lx=320;function Vd(e){return typeof e=="string"&&vy.test(e)}const Ax=64;function Mr(e){if(typeof e!="string")return!1;const t=e.trim();return t.length>0&&t.length<=Ax&&!/[\x00-\x1f\x7f]/.test(t)}function vs(e){return String(e??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32).replace(/-+$/g,"")||"node"}function _y(e){if(typeof e!="string"||!e||e.length>Lx||e.startsWith("-")||/[\0-\x20\x7f]/.test(e))return!1;if(!e.includes("@"))return/^[A-Za-z0-9][A-Za-z0-9._:-]{0,254}$/.test(e);const t=e.indexOf("@");return t<=0||t!==e.lastIndexOf("@")?!1:Rx.test(e.slice(0,t))&&Px.test(e.slice(t+1))}function Mg(e){if(e===""||e===null||e===void 0)return null;const t=String(e).trim();if(!/^[0-9]{1,5}$/.test(t))return;const n=Number(t);return Number.isInteger(n)&&n>=1&&n<=65535?n:void 0}function Ig({name:e,ssh:t,sshPort:n,remotePort:s}={}){const o=typeof e=="string"?e.trim():e,a=typeof t=="string"?t.trim():t;if(!Vd(o))return{ok:!1,error:"err-node-name"};if(!_y(a))return{ok:!1,error:"err-ssh"};const u=Mg(n);if(u===void 0)return{ok:!1,error:"err-ssh-port"};const h=Mg(s);if(h===void 0)return{ok:!1,error:"err-node-port"};const f={name:o,ssh:a};return u!==null&&(f.sshPort=u),h!==null&&(f.remotePort=h),{ok:!0,value:f}}function Tx(e,t){if(!e||!t||t<e)return null;const n=Math.floor((t-e)/1e3);return n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Yd(e,t){const n=!!(e&&e.status==="up"),s=!!(e&&e.status==="passive");return{up:n,...s?{passive:!0}:{},label:n?"tunnel-up":s?"node-passive":"tunnel-down",since:n?Tx(e.since,t):null}}const Dx=new Set(["v","instanceId","port","label","invite"]),Mx=new Set(["v","instanceId","port","label","invite","name","ssh","sshPort"]);function Ix(e){const t=String(e).replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4),s=typeof atob=="function"?atob(n):Buffer.from(n,"base64").toString("binary"),o=Uint8Array.from(s,a=>a.charCodeAt(0));return typeof TextDecoder<"u"?new TextDecoder().decode(o):Buffer.from(o).toString("utf8")}function Ox(e){let t="";try{const u=new URL(String(e));t=new URLSearchParams(u.hash.replace(/^#/,"")).get("pair")||""}catch{return{ok:!1}}if(!t)return{ok:!1};let n;try{n=JSON.parse(Ix(t))}catch{return{ok:!1}}if(!n||typeof n!="object"||Array.isArray(n))return{ok:!1};const s=n.v===1?Dx:n.v===2?Mx:null;if(!s)return{ok:!1};for(const u of Object.keys(n))if(!s.has(u))return{ok:!1};if(!/^[a-f0-9]{16,64}$/.test(String(n.instanceId)))return{ok:!1};const o=Number(n.port);if(!Number.isInteger(o)||o<1||o>65535)return{ok:!1};if(typeof n.label!="string")return{ok:!1};if(typeof n.invite!="string"||!n.invite)return{ok:!1};const a={ok:!0,version:n.v,label:n.label,invite:n.invite,instanceId:n.instanceId,port:o};if(n.v===2){if(n.name!==void 0){if(typeof n.name!="string"||!vy.test(n.name))return{ok:!1};a.name=n.name}if(n.ssh!==void 0){if(!_y(n.ssh))return{ok:!1};a.ssh=String(n.ssh).trim()}if(n.sshPort!==void 0){const u=Number(n.sshPort);if(!Number.isInteger(u)||u<1||u>65535)return{ok:!1};a.sshPort=u}}return a}function Bx(e,t,n=new Set){if(!t||!t.ok)return e;const s={...e},o=(a,u)=>{u==null||u===""||n.has(a)||(s[a]=u)};return o("label",t.label),t.version===2&&(o("name",t.name||(t.ssh?vs(t.label):"")),o("ssh",t.ssh),t.sshPort!==void 0&&o("sshPort",String(t.sshPort))),s}const zx=["KIMI_AUTH_ACTION_REQUIRED","CLIENT_INTERACTION_REQUIRED"],Fx=["kimi-code-consent-yes","kimi-code-config-custom-api-key","kimi-cli-login","client-terminal-dialog"];function uf(e){const t=e&&typeof e=="object"?e.actionRequired:null;return!t||typeof t!="object"||!zx.includes(t.code)||!Fx.includes(t.recovery)?null:{code:t.code,recovery:t.recovery,text:p(`fleet-recovery-${t.recovery}`)}}let Gd={sessions:[],cells:[],nodeGroups:[],localNodeId:"",localFresh:!1,refreshedAt:0};function Og(){return Gd}function yy(e={}){return Gd={sessions:Array.isArray(e.sessions)?e.sessions:[],cells:Array.isArray(e.cells)?e.cells:[],nodeGroups:Array.isArray(e.nodeGroups)?e.nodeGroups:[],localNodeId:typeof e.localNodeId=="string"?e.localNodeId:"",localFresh:e.localFresh===!0,refreshedAt:Number.isFinite(e.refreshedAt)?e.refreshedAt:0},Gd}const kr=(e,t=[])=>`${t.length?t.join("/"):"local"}:${e}`;function $x({onPick:e,token:t,onSettings:n,onOpenVlSession:s}){const[o,a]=kn(),u=nf(t),[h,f]=N.useState(null),[m,v]=N.useState(null),[b,y]=N.useState(""),[S,w]=N.useState(""),[x,k]=N.useState({bind:"127.0.0.1",port:""}),[P,E]=N.useState(""),[F,M]=N.useState([]),[V,G]=N.useState([]),[O,Z]=N.useState({}),[X,Q]=N.useState(new Set),[z,I]=N.useState(null),[C,T]=N.useState(null),{pins:A,orders:$,togglePin:U,viewFor:R,updateView:K,canMoveRoster:B,moveRoster:j,stepRoster:D}=rf(),{groupsFor:W,moveNode:ne,stepNode:ce,nodeKey:pe}=dy(),ye=W(u);N.useEffect(()=>{yy({sessions:h||[],cells:F,nodeGroups:u,localNodeId:P})},[h,F,u,P]),N.useEffect(()=>{const H=new Map;for(const le of F)H.set(kr(le.cell),!!le.boot);for(const le of u){const ue=le.route||[le.name];for(const ge of le.cells||[])H.set(kr(ge.cell,ue),!!ge.boot)}Z(le=>{let ue=!1;const ge={...le};for(const[Le,_e]of Object.entries(le))H.has(Le)&&H.get(Le)===_e&&(delete ge[Le],ue=!0);return ue?ge:le})},[F,u]);async function me(){try{const le=await(await Ft("/api/sessions",t)).json();le.error?(v(le.error),f([])):(v(null),f(le.sessions||[]))}catch(H){v(String(H)),f([])}try{const H=await ws(t);M(H.available?H.cells||[]:[]),G(H.available?H.capabilities||[]:[])}catch{M([]),G([])}}N.useEffect(()=>{me(),Ft("/api/config",t).then(le=>le.json()).then(le=>{w(le.version||""),k({bind:le.bind||"127.0.0.1",port:le.port||""}),E(Dr.test(String(le.instanceId||""))?le.instanceId:"")}).catch(()=>{});const H=setInterval(me,4e3);return()=>clearInterval(H)},[]);async function ae(){if(!x.port)return;const H=`http://${x.bind}:${x.port}/#token=${t}`;try{await navigator.clipboard.writeText(H)}catch{}}function Pe(H,le,ue){const ge=kr(H,le);Z(Le=>({...Le,[ge]:!!ue}))}function rt(H,le=[]){const ue=kr(H.cell,le);return Object.prototype.hasOwnProperty.call(O,ue)?O[ue]:!!H.boot}async function Xe(H,le,ue=[]){H.stopPropagation();const ge=kr(le.cell,ue),Le=!rt(le,ue);Pe(le.cell,ue,Le),Q(_e=>new Set(_e).add(ge));try{await Y_(t,{cell:le.cell,enabled:Le},ue),ue.length||M(_e=>_e.map(Ce=>Ce.cell===le.cell?{...Ce,boot:Le}:Ce))}catch(_e){Z(Ce=>{const tt={...Ce};return delete tt[ge],tt}),v(String((_e==null?void 0:_e.message)||_e))}finally{Q(_e=>{const Ce=new Set(_e);return Ce.delete(ge),Ce})}}async function Me(H){if(!z)return;const{cell:le}=z,ue=Array.isArray(z.route)?z.route:[];if(H.action==="up"){const ge=await Yh(t,{cell:le,boot:!!H.boot,...H.engine?{engine:H.engine}:{},...H.model!==void 0?{model:H.model}:{},...H.permissionPolicy?{permissionPolicy:H.permissionPolicy}:{}},ue),Le=uf(ge);Le&&v(Le.text),Pe(le,ue,!!H.boot)}else await Il(t,{cell:le,boot:!!H.boot},ue),H.boot&&Pe(le,ue,!1);me()}async function qt(H,le=[]){try{await Xh(t,H,le)}catch{return}me()}async function wn(H,le,ue=[]){try{await Q_(t,H,le,ue)}catch{return}me()}async function Be(H){if(!(!(H!=null&&H.direct)||C)){T(H.name);try{await ef(t,H.name,H.tunnelStatus==="up"?"down":"up")}catch{}T(null)}}async function $t(H){if(!(H!=null&&H.direct))return;const le=window.prompt(p("rename-node-prompt"),H.label||H.name);if(le===null)return;const ue=String(le).trim();if(!Mr(ue)){window.alert(p("rename-node-invalid"));return}try{await ty(t,H.name,ue)}catch(ge){window.alert(String((ge==null?void 0:ge.message)||ge))}}const Nt=N.useMemo(()=>new Map((h||[]).map(H=>[H.name,H])),[h]),At=N.useMemo(()=>new Set(F.map(H=>H.tmuxSession)),[F]),mt=N.useMemo(()=>(h||[]).filter(H=>!At.has(H.name)),[h,At]),dt=N.useMemo(()=>af(F,mt,Nt),[F,mt,Nt]),ut=R("local"),re=N.useMemo(()=>gs(dt,A,ut.filter,Fi($,"local")).filter(H=>Eg(H,b)),[dt,A,ut.filter,b,$]),xe=ye.reduce((H,le)=>H+(le.cells||[]).length+(le.unmanaged||[]).filter(ue=>!ue.technical).length,0),Ie=gs(dt,A,"all",Fi($,"local")).length+xe,Fe=dt.filter(H=>H.live).length+ye.reduce((H,le)=>H+Fl(le).rawItems.filter(ue=>ue.live).length,0),he=(h||[]).filter(H=>H.attached).length+ye.reduce((H,le)=>H+(le.sessions||[]).filter(ue=>ue.attached).length,0),ze=Math.min(he,Fe),q=x.port?`${x.bind}:${x.port}`:x.bind;function te(H,le=null,ue=dt){var Tt,lt;const ge=Array.isArray(le==null?void 0:le.route)?le.route:[],Le=ge.join("/"),_e=Le||"local",Ce=ge.length?le==null?void 0:le.instanceId:P,tt=(Ze,Jt)=>e({session:Ze,...Le?{node:Le}:{},...Dr.test(String(Ce||""))?{ownerId:Ce}:{},...typeof Jt=="string"&&Jt?{cellName:Jt}:{}}),ot=B;if(H.type==="cell"){const Ze=H.value,Jt=ge.length?((le==null?void 0:le.sessions)||[]).find(ht=>ht.name===Ze.tmuxSession):Nt.get(Ze.tmuxSession),ni=Ze.degraded?p("cell-degraded"):H.working?H.subtitle:Ze.tmux?p("cell-idle"):p("cell-off"),Wn=ge.length===0||((le==null?void 0:le.capabilities)||[]).includes(Ze.active?"down":"up"),ui=ge.length===0?V.includes("boot"):((le==null?void 0:le.capabilities)||[]).includes("boot"),de=rt(Ze,ge),Ne=kr(Ze.cell,ge),Ke=`${p(de?"boot-disable":"boot-enable")} ${Ze.cell}`;return c.jsxs("div",{className:"nc-mcard","data-roster-key":H.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:H.key,label:Ze.cell,canMove:ot,onMove:(ht,gt)=>j(_e,ht,gt,ue),onStep:ht=>D(_e,H.key,ht,ue)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>Ze.tmux&&tt(Ze.tmuxSession,Ze.cell),title:ni,"aria-label":`${Ze.cell}, ${ni}`,children:[c.jsx("span",{className:`dot ${Ze.degraded?"warn":Ze.tmux?`on${H.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:Ze.cell}),c.jsx("small",{title:H.subtitle,children:H.subtitle})]})]}),H.activity?c.jsx("span",{className:"nc-rel",children:Tr(H.activity)}):null,H.fresh&&((Tt=Jt==null?void 0:Jt.outbox)==null?void 0:Tt.count)>0&&c.jsx("span",{className:"nc-badge",title:p("new-files-outbox"),children:Jt.outbox.count}),c.jsx("button",{className:`nc-act pin${A.includes(H.key)?" on":""}`,"aria-label":`${p("pin")} ${Ze.cell}`,title:p("pin"),onClick:()=>U(H.key),children:A.includes(H.key)?"★":"☆"}),ui&&c.jsx("button",{className:`nc-act boot${de?" on":""}`,disabled:X.has(Ne),onClick:ht=>Xe(ht,Ze,ge),title:Ke,"aria-label":Ke,children:c.jsx(Je,{name:"boot",size:16})}),Wn&&c.jsx("button",{className:`nc-act power${Ze.tmux?" on":""}${Ze.degraded?" warn":""}`,onClick:()=>I(ge.length?{...Ze,boot:de,route:ge,availableEngines:(le==null?void 0:le.engines)||[]}:{...Ze,boot:de}),title:Ze.active?p("power-off"):p("power-on"),"aria-label":`${Ze.active?p("power-off"):p("power-on")} ${Ze.cell}`,children:c.jsx(Je,{name:"power",size:16})})]},H.key)}const Qe=H.value;return c.jsxs("div",{className:"nc-mcard","data-roster-key":H.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:H.key,label:Qe.name,canMove:ot,onMove:(Ze,Jt)=>j(_e,Ze,Jt,ue),onStep:Ze=>D(_e,H.key,Ze,ue)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>tt(Qe.name),children:[c.jsx("span",{className:Qe.attached?"dot on":"dot"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:Qe.name}),c.jsx("small",{children:Qe.preview?Qe.preview:Qe.cmd?Qe.cmd:p("windows").replace("{n}",String(Qe.windows||0))})]})]}),H.activity?c.jsx("span",{className:"nc-rel",children:Tr(H.activity)}):null,H.fresh&&((lt=Qe.outbox)==null?void 0:lt.count)>0&&c.jsx("span",{className:"nc-badge",title:p("new-files-outbox"),children:Qe.outbox.count}),c.jsx("button",{className:`nc-act pin${A.includes(H.key)?" on":""}`,"aria-label":`${p("pin")} ${Qe.name}`,title:p("pin"),onClick:()=>U(H.key),children:A.includes(H.key)?"★":"☆"}),c.jsx("button",{className:`nc-act technical${Qe.technical?" on":""}`,title:Qe.technical?p("mark-normal"):p("mark-technical"),"aria-label":`${Qe.technical?p("mark-normal"):p("mark-technical")} ${Qe.name}`,onClick:()=>wn(Qe.name,!Qe.technical,ge),children:"T"}),c.jsx("button",{className:"nc-menu",title:p("terminate"),"aria-label":`${p("terminate")} ${Qe.name}`,onClick:()=>{window.confirm(p("terminate-confirm").replace("{name}",Qe.name))&&qt(Qe.name,ge)},children:"⋯"})]},H.key)}return c.jsxs("div",{className:"nc-home",children:[c.jsxs("header",{className:"nc-home-head",children:[c.jsxs("div",{className:"nc-wordmark",children:["NexusCrew",c.jsx("span",{className:"nc-cursor"})]}),c.jsxs("div",{className:"nc-home-sub",children:[p("fleet-tmux")," · ",Fe," ",p("sessions"),ze>0&&` · ${ze} attached`]}),c.jsxs("span",{className:"nc-head-actions",children:[c.jsx("button",{className:"nc-refresh",onClick:()=>n("nodes",!1),title:p("settings"),children:c.jsx(Je,{name:"gear",size:18})}),c.jsx("button",{className:"nc-refresh",onClick:me,title:p("refresh"),children:c.jsx(Je,{name:"refresh",size:18})})]})]}),c.jsxs("main",{className:"nc-home-scroll",children:[Ie>8&&c.jsx("input",{className:"nc-filter",type:"search",placeholder:p("filter-placeholder"),"aria-label":p("filter-placeholder"),value:b,onChange:H=>y(H.target.value)}),m&&c.jsx("div",{className:"nc-err",children:m}),c.jsxs("section",{className:"nc-group","data-position":"local",children:[c.jsx(Gu,{label:p("position-local"),count:re.length,state:ut,dotClass:"on",onToggle:()=>K("local",{open:!ut.open}),onFilter:H=>K("local",{filter:H})}),ut.open&&re.map(H=>te(H,null,dt)),ut.open&&h===null&&c.jsx("div",{className:"nc-empty",children:p("loading-fleet")}),ut.open&&h!==null&&re.length===0&&!m&&c.jsx("div",{className:"nc-empty",children:b?p("no-match").replace("{q}",b):p("no-sessions-short")})]}),ye.map(H=>{const ue=hy(H.health,{passive:"warn"})||(H.status==="up"?"on":H.status==="passive"?"":"warn"),ge=H.health?qo(H.health):H.status==="up"?"":Bi(H),_e=(H.route&&H.route.length?H.route:[H.name]).join("/"),Ce=R(_e);if(H.kind==="vl")return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":pe(H),children:[c.jsx(Gu,{label:H.label||H.name,count:H.sessions.length,state:Ce,dotClass:ue,dotTitle:ge,detail:H.status==="up"?"":Bi(H),onToggle:()=>K(_e,{open:!Ce.open}),onFilter:lt=>K(_e,{filter:lt})}),H.status==="up"&&Ce.open&&H.sessions.map(lt=>c.jsx("div",{className:"nc-mcard nc-vl-session-row",children:c.jsxs("button",{className:"nc-mcard-main",onClick:()=>s&&s(H.peer),"aria-label":`${H.label||H.name}: ${lt.name}`,children:[c.jsx("span",{className:"dot on"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:lt.name}),c.jsx("small",{children:p("vl-events-title")})]})]})},lt.key)),H.status==="up"&&Ce.open&&H.sessions.length===0&&c.jsx("div",{className:"nc-empty",children:p("no-sessions-short")})]},`nodo-vl-${_e}-${H.name}`);const{rawItems:tt}=Fl(H),ot=gs(tt,A,Ce.filter,Fi($,_e)).filter(lt=>Eg(lt,b)),Qe=H.direct&&H.health&&H.health.managed!==!1?c.jsx("button",{type:"button",className:`nc-act power${H.tunnelStatus==="up"?" on":""}`,disabled:C===H.name,title:H.tunnelStatus==="up"?p("power-off"):p("power-on"),"aria-label":`${H.tunnelStatus==="up"?p("power-off"):p("power-on")} ${H.label||H.name}`,onClick:()=>Be(H),children:c.jsx(Je,{name:"power",size:15})}):null,Tt=c.jsxs("span",{className:"nc-node-actions",children:[c.jsx(bi,{scope:"node",position:"nodes",itemKey:pe(H),label:H.label||H.name,onMove:(lt,Ze)=>ne(lt,Ze,u),onStep:lt=>ce(pe(H),lt,u)}),H.direct&&c.jsx("button",{type:"button",className:"nc-node-rename",title:p("rename-node"),"aria-label":`${p("rename-node")} ${H.label||H.name}`,onClick:()=>$t(H),children:"✎"}),Qe]});return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":pe(H),children:[c.jsx(Gu,{label:H.label||H.name,count:ot.length,state:Ce,dotClass:ue,dotTitle:ge,detail:H.status==="up"?"":H.health&&qo(H.health)||Bi(H),onToggle:()=>K(_e,{open:!Ce.open}),onFilter:lt=>K(_e,{filter:lt}),onRename:H.direct?()=>$t(H):null,action:Tt}),H.status==="up"&&Ce.open&&ot.map(lt=>te(lt,H,tt)),H.status==="up"&&Ce.open&&ot.length===0&&c.jsx("div",{className:"nc-empty",children:b?p("no-match").replace("{q}",b):p("no-sessions-short")})]},`nodo-${_e}`)}),c.jsxs("footer",{className:"nc-home-foot",onClick:ae,title:p("copy-url"),children:[c.jsxs("span",{className:"nc-home-meta",children:[S&&c.jsxs("span",{className:"nc-home-version",children:["v",S]}),c.jsxs("span",{className:"nc-home-endpoint",children:[q," · ",p("ssh-only")]})]}),c.jsx("span",{className:"nc-lang",onClick:H=>H.stopPropagation(),children:ay.map((H,le)=>c.jsxs("span",{children:[le>0&&" · ",c.jsx("button",{className:`nc-lang-btn${o===H?" on":""}`,onClick:()=>a(H),title:H,children:H.toUpperCase()})]},H))})]})]}),c.jsx("button",{className:"nc-fab",onClick:()=>n("fleet",!0),title:p("fleet-new-cell"),"aria-label":p("fleet-new-cell"),children:"+"}),z&&c.jsx(Bl,{cell:z,token:t,route:Array.isArray(z.route)?z.route:[],onConfirm:Me,onClose:()=>I(null)})]})}function Gu({label:e,count:t,state:n,dotClass:s="",dotTitle:o="",detail:a="",onToggle:u,onFilter:h,onRename:f=null,action:m=null}){return c.jsxs("div",{className:"nc-mobile-position-head",onContextMenu:f?v=>{v.preventDefault(),f()}:void 0,children:[c.jsxs("button",{type:"button",className:"nc-mobile-position-toggle",onClick:u,"aria-expanded":n.open,"aria-label":`${e} · ${p("node-sessions").replace("{n}",String(t))}`,children:[c.jsx("span",{className:"nc-mobile-chevron","aria-hidden":"true",children:n.open?"⌄":"›"}),c.jsx("span",{className:`dot ${s}`,title:o}),c.jsxs("span",{className:"nc-mobile-position-copy",children:[c.jsx("b",{children:e}),c.jsx("small",{children:a||p("node-sessions").replace("{n}",String(t))})]})]}),c.jsxs("select",{className:"nc-mobile-position-filter",value:n.filter,"aria-label":`${e} · ${p("filter-placeholder")}`,title:p(`view-${n.filter}`),onChange:v=>h(v.target.value),children:[c.jsx("option",{value:"all",children:p("view-all")}),c.jsx("option",{value:"pinned",children:p("view-pinned")}),c.jsx("option",{value:"active",children:p("view-active")}),c.jsx("option",{value:"off",children:p("view-off")}),c.jsx("option",{value:"technical",children:p("view-technical")})]}),m]})}/**
40
+ `+_.stack}return{value:i,source:r,stack:g,digest:null}}function pu(i,r,l){return{value:i,source:null,stack:l??null,digest:r??null}}function mu(i,r){try{console.error(r.value)}catch(l){setTimeout(function(){throw l})}}var jS=typeof WeakMap=="function"?WeakMap:Map;function ym(i,r,l){l=Ti(-1,l),l.tag=3,l.payload={element:null};var d=r.value;return l.callback=function(){Za||(Za=!0,Pu=d),mu(i,r)},l}function wm(i,r,l){l=Ti(-1,l),l.tag=3;var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var g=r.value;l.payload=function(){return d(g)},l.callback=function(){mu(i,r)}}var _=i.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(l.callback=function(){mu(i,r),typeof d!="function"&&(is===null?is=new Set([this]):is.add(this));var L=r.stack;this.componentDidCatch(r.value,{componentStack:L!==null?L:""})}),l}function bm(i,r,l){var d=i.pingCache;if(d===null){d=i.pingCache=new jS;var g=new Set;d.set(r,g)}else g=d.get(r),g===void 0&&(g=new Set,d.set(r,g));g.has(l)||(g.add(l),i=HS.bind(null,i,r,l),r.then(i,i))}function Sm(i){do{var r;if((r=i.tag===13)&&(r=i.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return i;i=i.return}while(i!==null);return null}function xm(i,r,l,d,g){return(i.mode&1)===0?(i===r?i.flags|=65536:(i.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(r=Ti(-1,1),r.tag=2,ts(l,r,1))),l.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var RS=M.ReactCurrentOwner,Pn=!1;function bn(i,r,l,d){r.child=i===null?Up(r,null,l,d):mr(r,i.child,l,d)}function km(i,r,l,d,g){l=l.render;var _=r.ref;return vr(r,g),d=ou(i,r,l,d,_,g),l=au(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(Ct&&l&&Uc(r),r.flags|=1,bn(i,r,d,g),r.child)}function Cm(i,r,l,d,g){if(i===null){var _=l.type;return typeof _=="function"&&!Ou(_)&&_.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(r.tag=15,r.type=_,Em(i,r,_,d,g)):(i=rl(l.type,null,d,r,r.mode,g),i.ref=r.ref,i.return=r,r.child=i)}if(_=i.child,(i.lanes&g)===0){var L=_.memoizedProps;if(l=l.compare,l=l!==null?l:ao,l(L,d)&&i.ref===r.ref)return Di(i,r,g)}return r.flags|=1,i=as(_,d),i.ref=r.ref,i.return=r,r.child=i}function Em(i,r,l,d,g){if(i!==null){var _=i.memoizedProps;if(ao(_,d)&&i.ref===r.ref)if(Pn=!1,r.pendingProps=d=_,(i.lanes&g)!==0)(i.flags&131072)!==0&&(Pn=!0);else return r.lanes=i.lanes,Di(i,r,g)}return gu(i,r,l,d,g)}function Nm(i,r,l){var d=r.pendingProps,g=d.children,_=i!==null?i.memoizedState:null;if(d.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},_t(br,Bn),Bn|=l;else{if((l&1073741824)===0)return i=_!==null?_.baseLanes|l:l,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:i,cachePool:null,transitions:null},r.updateQueue=null,_t(br,Bn),Bn|=i,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=_!==null?_.baseLanes:l,_t(br,Bn),Bn|=d}else _!==null?(d=_.baseLanes|l,r.memoizedState=null):d=l,_t(br,Bn),Bn|=d;return bn(i,r,g,l),r.child}function jm(i,r){var l=r.ref;(i===null&&l!==null||i!==null&&i.ref!==l)&&(r.flags|=512,r.flags|=2097152)}function gu(i,r,l,d,g){var _=Rn(l)?Rs:mn.current;return _=dr(r,_),vr(r,g),l=ou(i,r,l,d,_,g),d=au(),i!==null&&!Pn?(r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~g,Di(i,r,g)):(Ct&&d&&Uc(r),r.flags|=1,bn(i,r,l,g),r.child)}function Rm(i,r,l,d,g){if(Rn(l)){var _=!0;Pa(r)}else _=!1;if(vr(r,g),r.stateNode===null)Ya(i,r),vm(r,l,d),fu(r,l,d,g),d=!0;else if(i===null){var L=r.stateNode,Y=r.memoizedProps;L.props=Y;var J=L.context,oe=l.contextType;typeof oe=="object"&&oe!==null?oe=Yn(oe):(oe=Rn(l)?Rs:mn.current,oe=dr(r,oe));var be=l.getDerivedStateFromProps,Se=typeof be=="function"||typeof L.getSnapshotBeforeUpdate=="function";Se||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(Y!==d||J!==oe)&&_m(r,L,d,oe),es=!1;var we=r.memoizedState;L.state=we,za(r,d,L,g),J=r.memoizedState,Y!==d||we!==J||jn.current||es?(typeof be=="function"&&(hu(r,l,be,d),J=r.memoizedState),(Y=es||gm(r,l,Y,d,we,J,oe))?(Se||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(r.flags|=4194308)):(typeof L.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=J),L.props=d,L.state=J,L.context=oe,d=Y):(typeof L.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{L=r.stateNode,Kp(i,r),Y=r.memoizedProps,oe=r.type===r.elementType?Y:ri(r.type,Y),L.props=oe,Se=r.pendingProps,we=L.context,J=l.contextType,typeof J=="object"&&J!==null?J=Yn(J):(J=Rn(l)?Rs:mn.current,J=dr(r,J));var Re=l.getDerivedStateFromProps;(be=typeof Re=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(Y!==Se||we!==J)&&_m(r,L,d,J),es=!1,we=r.memoizedState,L.state=we,za(r,d,L,g);var De=r.memoizedState;Y!==Se||we!==De||jn.current||es?(typeof Re=="function"&&(hu(r,l,Re,d),De=r.memoizedState),(oe=es||gm(r,l,oe,d,we,De,J)||!1)?(be||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(d,De,J),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(d,De,J)),typeof L.componentDidUpdate=="function"&&(r.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof L.componentDidUpdate!="function"||Y===i.memoizedProps&&we===i.memoizedState||(r.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||Y===i.memoizedProps&&we===i.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=De),L.props=d,L.state=De,L.context=J,d=oe):(typeof L.componentDidUpdate!="function"||Y===i.memoizedProps&&we===i.memoizedState||(r.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||Y===i.memoizedProps&&we===i.memoizedState||(r.flags|=1024),d=!1)}return vu(i,r,l,d,_,g)}function vu(i,r,l,d,g,_){jm(i,r);var L=(r.flags&128)!==0;if(!d&&!L)return g&&Dp(r,l,!1),Di(i,r,_);d=r.stateNode,RS.current=r;var Y=L&&typeof l.getDerivedStateFromError!="function"?null:d.render();return r.flags|=1,i!==null&&L?(r.child=mr(r,i.child,null,_),r.child=mr(r,null,Y,_)):bn(i,r,Y,_),r.memoizedState=d.state,g&&Dp(r,l,!0),r.child}function Pm(i){var r=i.stateNode;r.pendingContext?Ap(i,r.pendingContext,r.pendingContext!==r.context):r.context&&Ap(i,r.context,!1),eu(i,r.containerInfo)}function Lm(i,r,l,d,g){return pr(),Vc(g),r.flags|=256,bn(i,r,l,d),r.child}var _u={dehydrated:null,treeContext:null,retryLane:0};function yu(i){return{baseLanes:i,cachePool:null,transitions:null}}function Am(i,r,l){var d=r.pendingProps,g=jt.current,_=!1,L=(r.flags&128)!==0,Y;if((Y=L)||(Y=i!==null&&i.memoizedState===null?!1:(g&2)!==0),Y?(_=!0,r.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),_t(jt,g&1),i===null)return qc(r),i=r.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((r.mode&1)===0?r.lanes=1:i.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(L=d.children,i=d.fallback,_?(d=r.mode,_=r.child,L={mode:"hidden",children:L},(d&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=L):_=ol(L,d,0,null),i=zs(i,d,l,null),_.return=r,i.return=r,_.sibling=i,r.child=_,r.child.memoizedState=yu(l),r.memoizedState=_u,i):wu(r,L));if(g=i.memoizedState,g!==null&&(Y=g.dehydrated,Y!==null))return PS(i,r,L,d,Y,g,l);if(_){_=d.fallback,L=r.mode,g=i.child,Y=g.sibling;var J={mode:"hidden",children:d.children};return(L&1)===0&&r.child!==g?(d=r.child,d.childLanes=0,d.pendingProps=J,r.deletions=null):(d=as(g,J),d.subtreeFlags=g.subtreeFlags&14680064),Y!==null?_=as(Y,_):(_=zs(_,L,l,null),_.flags|=2),_.return=r,d.return=r,d.sibling=_,r.child=d,d=_,_=r.child,L=i.child.memoizedState,L=L===null?yu(l):{baseLanes:L.baseLanes|l,cachePool:null,transitions:L.transitions},_.memoizedState=L,_.childLanes=i.childLanes&~l,r.memoizedState=_u,d}return _=i.child,i=_.sibling,d=as(_,{mode:"visible",children:d.children}),(r.mode&1)===0&&(d.lanes=l),d.return=r,d.sibling=null,i!==null&&(l=r.deletions,l===null?(r.deletions=[i],r.flags|=16):l.push(i)),r.child=d,r.memoizedState=null,d}function wu(i,r){return r=ol({mode:"visible",children:r},i.mode,0,null),r.return=i,i.child=r}function Va(i,r,l,d){return d!==null&&Vc(d),mr(r,i.child,null,l),i=wu(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function PS(i,r,l,d,g,_,L){if(l)return r.flags&256?(r.flags&=-257,d=pu(Error(n(422))),Va(i,r,L,d)):r.memoizedState!==null?(r.child=i.child,r.flags|=128,null):(_=d.fallback,g=r.mode,d=ol({mode:"visible",children:d.children},g,0,null),_=zs(_,g,L,null),_.flags|=2,d.return=r,_.return=r,d.sibling=_,r.child=d,(r.mode&1)!==0&&mr(r,i.child,null,L),r.child.memoizedState=yu(L),r.memoizedState=_u,_);if((r.mode&1)===0)return Va(i,r,L,null);if(g.data==="$!"){if(d=g.nextSibling&&g.nextSibling.dataset,d)var Y=d.dgst;return d=Y,_=Error(n(419)),d=pu(_,d,void 0),Va(i,r,L,d)}if(Y=(L&i.childLanes)!==0,Pn||Y){if(d=tn,d!==null){switch(L&-L){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(d.suspendedLanes|L))!==0?0:g,g!==0&&g!==_.retryLane&&(_.retryLane=g,Ai(i,g),li(d,i,g,-1))}return Iu(),d=pu(Error(n(421))),Va(i,r,L,d)}return g.data==="$?"?(r.flags|=128,r.child=i.child,r=US.bind(null,i),g._reactRetry=r,null):(i=_.treeContext,On=Xi(g.nextSibling),In=r,Ct=!0,si=null,i!==null&&(qn[Vn++]=Pi,qn[Vn++]=Li,qn[Vn++]=Ps,Pi=i.id,Li=i.overflow,Ps=r),r=wu(r,d.children),r.flags|=4096,r)}function Tm(i,r,l){i.lanes|=r;var d=i.alternate;d!==null&&(d.lanes|=r),Qc(i.return,r,l)}function bu(i,r,l,d,g){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:g}:(_.isBackwards=r,_.rendering=null,_.renderingStartTime=0,_.last=d,_.tail=l,_.tailMode=g)}function Dm(i,r,l){var d=r.pendingProps,g=d.revealOrder,_=d.tail;if(bn(i,r,d.children,l),d=jt.current,(d&2)!==0)d=d&1|2,r.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Tm(i,l,r);else if(i.tag===19)Tm(i,l,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}d&=1}if(_t(jt,d),(r.mode&1)===0)r.memoizedState=null;else switch(g){case"forwards":for(l=r.child,g=null;l!==null;)i=l.alternate,i!==null&&Fa(i)===null&&(g=l),l=l.sibling;l=g,l===null?(g=r.child,r.child=null):(g=l.sibling,l.sibling=null),bu(r,!1,g,l,_);break;case"backwards":for(l=null,g=r.child,r.child=null;g!==null;){if(i=g.alternate,i!==null&&Fa(i)===null){r.child=g;break}i=g.sibling,g.sibling=l,l=g,g=i}bu(r,!0,l,null,_);break;case"together":bu(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Ya(i,r){(r.mode&1)===0&&i!==null&&(i.alternate=null,r.alternate=null,r.flags|=2)}function Di(i,r,l){if(i!==null&&(r.dependencies=i.dependencies),Ms|=r.lanes,(l&r.childLanes)===0)return null;if(i!==null&&r.child!==i.child)throw Error(n(153));if(r.child!==null){for(i=r.child,l=as(i,i.pendingProps),r.child=l,l.return=r;i.sibling!==null;)i=i.sibling,l=l.sibling=as(i,i.pendingProps),l.return=r;l.sibling=null}return r.child}function LS(i,r,l){switch(r.tag){case 3:Pm(r),pr();break;case 5:Yp(r);break;case 1:Rn(r.type)&&Pa(r);break;case 4:eu(r,r.stateNode.containerInfo);break;case 10:var d=r.type._context,g=r.memoizedProps.value;_t(Ia,d._currentValue),d._currentValue=g;break;case 13:if(d=r.memoizedState,d!==null)return d.dehydrated!==null?(_t(jt,jt.current&1),r.flags|=128,null):(l&r.child.childLanes)!==0?Am(i,r,l):(_t(jt,jt.current&1),i=Di(i,r,l),i!==null?i.sibling:null);_t(jt,jt.current&1);break;case 19:if(d=(l&r.childLanes)!==0,(i.flags&128)!==0){if(d)return Dm(i,r,l);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),_t(jt,jt.current),d)break;return null;case 22:case 23:return r.lanes=0,Nm(i,r,l)}return Di(i,r,l)}var Mm,Su,Im,Om;Mm=function(i,r){for(var l=r.child;l!==null;){if(l.tag===5||l.tag===6)i.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},Su=function(){},Im=function(i,r,l,d){var g=i.memoizedProps;if(g!==d){i=r.stateNode,Ts(fi.current);var _=null;switch(l){case"input":g=qt(i,g),d=qt(i,d),_=[];break;case"select":g=B({},g,{value:void 0}),d=B({},d,{value:void 0}),_=[];break;case"textarea":g=ut(i,g),d=ut(i,d),_=[];break;default:typeof g.onClick!="function"&&typeof d.onClick=="function"&&(i.onclick=Na)}_e(l,d);var L;l=null;for(oe in g)if(!d.hasOwnProperty(oe)&&g.hasOwnProperty(oe)&&g[oe]!=null)if(oe==="style"){var Y=g[oe];for(L in Y)Y.hasOwnProperty(L)&&(l||(l={}),l[L]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(o.hasOwnProperty(oe)?_||(_=[]):(_=_||[]).push(oe,null));for(oe in d){var J=d[oe];if(Y=g!=null?g[oe]:void 0,d.hasOwnProperty(oe)&&J!==Y&&(J!=null||Y!=null))if(oe==="style")if(Y){for(L in Y)!Y.hasOwnProperty(L)||J&&J.hasOwnProperty(L)||(l||(l={}),l[L]="");for(L in J)J.hasOwnProperty(L)&&Y[L]!==J[L]&&(l||(l={}),l[L]=J[L])}else l||(_||(_=[]),_.push(oe,l)),l=J;else oe==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,Y=Y?Y.__html:void 0,J!=null&&Y!==J&&(_=_||[]).push(oe,J)):oe==="children"?typeof J!="string"&&typeof J!="number"||(_=_||[]).push(oe,""+J):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(o.hasOwnProperty(oe)?(J!=null&&oe==="onScroll"&&bt("scroll",i),_||Y===J||(_=[])):(_=_||[]).push(oe,J))}l&&(_=_||[]).push("style",l);var oe=_;(r.updateQueue=oe)&&(r.flags|=4)}},Om=function(i,r,l,d){l!==d&&(r.flags|=4)};function xo(i,r){if(!Ct)switch(i.tailMode){case"hidden":r=i.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:d.sibling=null}}function vn(i){var r=i.alternate!==null&&i.alternate.child===i.child,l=0,d=0;if(r)for(var g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags&14680064,d|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=d,i.childLanes=l,r}function AS(i,r,l){var d=r.pendingProps;switch(Wc(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(r),null;case 1:return Rn(r.type)&&Ra(),vn(r),null;case 3:return d=r.stateNode,_r(),St(jn),St(mn),iu(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(Da(r)?r.flags|=4:i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,si!==null&&(Tu(si),si=null))),Su(i,r),vn(r),null;case 5:tu(r);var g=Ts(_o.current);if(l=r.type,i!==null&&r.stateNode!=null)Im(i,r,l,d,g),i.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!d){if(r.stateNode===null)throw Error(n(166));return vn(r),null}if(i=Ts(fi.current),Da(r)){d=r.stateNode,l=r.type;var _=r.memoizedProps;switch(d[hi]=r,d[fo]=_,i=(r.mode&1)!==0,l){case"dialog":bt("cancel",d),bt("close",d);break;case"iframe":case"object":case"embed":bt("load",d);break;case"video":case"audio":for(g=0;g<co.length;g++)bt(co[g],d);break;case"source":bt("error",d);break;case"img":case"image":case"link":bt("error",d),bt("load",d);break;case"details":bt("toggle",d);break;case"input":wn(d,_),bt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!_.multiple},bt("invalid",d);break;case"textarea":re(d,_),bt("invalid",d)}_e(l,_),g=null;for(var L in _)if(_.hasOwnProperty(L)){var Y=_[L];L==="children"?typeof Y=="string"?d.textContent!==Y&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,Y,i),g=["children",Y]):typeof Y=="number"&&d.textContent!==""+Y&&(_.suppressHydrationWarning!==!0&&Ea(d.textContent,Y,i),g=["children",""+Y]):o.hasOwnProperty(L)&&Y!=null&&L==="onScroll"&&bt("scroll",d)}switch(l){case"input":rt(d),Nt(d,_,!0);break;case"textarea":rt(d),Ie(d);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(d.onclick=Na)}d=g,r.updateQueue=d,d!==null&&(r.flags|=4)}else{L=g.nodeType===9?g:g.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Fe(l)),i==="http://www.w3.org/1999/xhtml"?l==="script"?(i=L.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof d.is=="string"?i=L.createElement(l,{is:d.is}):(i=L.createElement(l),l==="select"&&(L=i,d.multiple?L.multiple=!0:d.size&&(L.size=d.size))):i=L.createElementNS(i,l),i[hi]=r,i[fo]=d,Mm(i,r,!1,!1),r.stateNode=i;e:{switch(L=Ce(l,d),l){case"dialog":bt("cancel",i),bt("close",i),g=d;break;case"iframe":case"object":case"embed":bt("load",i),g=d;break;case"video":case"audio":for(g=0;g<co.length;g++)bt(co[g],i);g=d;break;case"source":bt("error",i),g=d;break;case"img":case"image":case"link":bt("error",i),bt("load",i),g=d;break;case"details":bt("toggle",i),g=d;break;case"input":wn(i,d),g=qt(i,d),bt("invalid",i);break;case"option":g=d;break;case"select":i._wrapperState={wasMultiple:!!d.multiple},g=B({},d,{value:void 0}),bt("invalid",i);break;case"textarea":re(i,d),g=ut(i,d),bt("invalid",i);break;default:g=d}_e(l,g),Y=g;for(_ in Y)if(Y.hasOwnProperty(_)){var J=Y[_];_==="style"?ge(i,J):_==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&q(i,J)):_==="children"?typeof J=="string"?(l!=="textarea"||J!=="")&&te(i,J):typeof J=="number"&&te(i,""+J):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(o.hasOwnProperty(_)?J!=null&&_==="onScroll"&&bt("scroll",i):J!=null&&F(i,_,J,L))}switch(l){case"input":rt(i),Nt(i,d,!1);break;case"textarea":rt(i),Ie(i);break;case"option":d.value!=null&&i.setAttribute("value",""+me(d.value));break;case"select":i.multiple=!!d.multiple,_=d.value,_!=null?dt(i,!!d.multiple,_,!1):d.defaultValue!=null&&dt(i,!!d.multiple,d.defaultValue,!0);break;default:typeof g.onClick=="function"&&(i.onclick=Na)}switch(l){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return vn(r),null;case 6:if(i&&r.stateNode!=null)Om(i,r,i.memoizedProps,d);else{if(typeof d!="string"&&r.stateNode===null)throw Error(n(166));if(l=Ts(_o.current),Ts(fi.current),Da(r)){if(d=r.stateNode,l=r.memoizedProps,d[hi]=r,(_=d.nodeValue!==l)&&(i=In,i!==null))switch(i.tag){case 3:Ea(d.nodeValue,l,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Ea(d.nodeValue,l,(i.mode&1)!==0)}_&&(r.flags|=4)}else d=(l.nodeType===9?l:l.ownerDocument).createTextNode(d),d[hi]=r,r.stateNode=d}return vn(r),null;case 13:if(St(jt),d=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Ct&&On!==null&&(r.mode&1)!==0&&(r.flags&128)===0)Fp(),pr(),r.flags|=98560,_=!1;else if(_=Da(r),d!==null&&d.dehydrated!==null){if(i===null){if(!_)throw Error(n(318));if(_=r.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(n(317));_[hi]=r}else pr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;vn(r),_=!1}else si!==null&&(Tu(si),si=null),_=!0;if(!_)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=l,r):(d=d!==null,d!==(i!==null&&i.memoizedState!==null)&&d&&(r.child.flags|=8192,(r.mode&1)!==0&&(i===null||(jt.current&1)!==0?Yt===0&&(Yt=3):Iu())),r.updateQueue!==null&&(r.flags|=4),vn(r),null);case 4:return _r(),Su(i,r),i===null&&uo(r.stateNode.containerInfo),vn(r),null;case 10:return Xc(r.type._context),vn(r),null;case 17:return Rn(r.type)&&Ra(),vn(r),null;case 19:if(St(jt),_=r.memoizedState,_===null)return vn(r),null;if(d=(r.flags&128)!==0,L=_.rendering,L===null)if(d)xo(_,!1);else{if(Yt!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(L=Fa(i),L!==null){for(r.flags|=128,xo(_,!1),d=L.updateQueue,d!==null&&(r.updateQueue=d,r.flags|=4),r.subtreeFlags=0,d=l,l=r.child;l!==null;)_=l,i=d,_.flags&=14680066,L=_.alternate,L===null?(_.childLanes=0,_.lanes=i,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=L.childLanes,_.lanes=L.lanes,_.child=L.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=L.memoizedProps,_.memoizedState=L.memoizedState,_.updateQueue=L.updateQueue,_.type=L.type,i=L.dependencies,_.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),l=l.sibling;return _t(jt,jt.current&1|2),r.child}i=i.sibling}_.tail!==null&&kt()>Sr&&(r.flags|=128,d=!0,xo(_,!1),r.lanes=4194304)}else{if(!d)if(i=Fa(L),i!==null){if(r.flags|=128,d=!0,l=i.updateQueue,l!==null&&(r.updateQueue=l,r.flags|=4),xo(_,!0),_.tail===null&&_.tailMode==="hidden"&&!L.alternate&&!Ct)return vn(r),null}else 2*kt()-_.renderingStartTime>Sr&&l!==1073741824&&(r.flags|=128,d=!0,xo(_,!1),r.lanes=4194304);_.isBackwards?(L.sibling=r.child,r.child=L):(l=_.last,l!==null?l.sibling=L:r.child=L,_.last=L)}return _.tail!==null?(r=_.tail,_.rendering=r,_.tail=r.sibling,_.renderingStartTime=kt(),r.sibling=null,l=jt.current,_t(jt,d?l&1|2:l&1),r):(vn(r),null);case 22:case 23:return Mu(),d=r.memoizedState!==null,i!==null&&i.memoizedState!==null!==d&&(r.flags|=8192),d&&(r.mode&1)!==0?(Bn&1073741824)!==0&&(vn(r),r.subtreeFlags&6&&(r.flags|=8192)):vn(r),null;case 24:return null;case 25:return null}throw Error(n(156,r.tag))}function TS(i,r){switch(Wc(r),r.tag){case 1:return Rn(r.type)&&Ra(),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return _r(),St(jn),St(mn),iu(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 5:return tu(r),null;case 13:if(St(jt),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(n(340));pr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return St(jt),null;case 4:return _r(),null;case 10:return Xc(r.type._context),null;case 22:case 23:return Mu(),null;case 24:return null;default:return null}}var Ga=!1,_n=!1,DS=typeof WeakSet=="function"?WeakSet:Set,Ae=null;function wr(i,r){var l=i.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){Dt(i,r,d)}else l.current=null}function xu(i,r,l){try{l()}catch(d){Dt(i,r,d)}}var Bm=!1;function MS(i,r){if(Mc=ma,i=gp(),Nc(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var g=d.anchorOffset,_=d.focusNode;d=d.focusOffset;try{l.nodeType,_.nodeType}catch{l=null;break e}var L=0,Y=-1,J=-1,oe=0,be=0,Se=i,we=null;t:for(;;){for(var Re;Se!==l||g!==0&&Se.nodeType!==3||(Y=L+g),Se!==_||d!==0&&Se.nodeType!==3||(J=L+d),Se.nodeType===3&&(L+=Se.nodeValue.length),(Re=Se.firstChild)!==null;)we=Se,Se=Re;for(;;){if(Se===i)break t;if(we===l&&++oe===g&&(Y=L),we===_&&++be===d&&(J=L),(Re=Se.nextSibling)!==null)break;Se=we,we=Se.parentNode}Se=Re}l=Y===-1||J===-1?null:{start:Y,end:J}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ic={focusedElem:i,selectionRange:l},ma=!1,Ae=r;Ae!==null;)if(r=Ae,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,Ae=i;else for(;Ae!==null;){r=Ae;try{var De=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(De!==null){var Oe=De.memoizedProps,Bt=De.memoizedState,ie=r.stateNode,ee=ie.getSnapshotBeforeUpdate(r.elementType===r.type?Oe:ri(r.type,Oe),Bt);ie.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var se=r.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ke){Dt(r,r.return,ke)}if(i=r.sibling,i!==null){i.return=r.return,Ae=i;break}Ae=r.return}return De=Bm,Bm=!1,De}function ko(i,r,l){var d=r.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&i)===i){var _=g.destroy;g.destroy=void 0,_!==void 0&&xu(r,l,_)}g=g.next}while(g!==d)}}function Xa(i,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&i)===i){var d=l.create;l.destroy=d()}l=l.next}while(l!==r)}}function ku(i){var r=i.ref;if(r!==null){var l=i.stateNode;switch(i.tag){case 5:i=l;break;default:i=l}typeof r=="function"?r(i):r.current=i}}function zm(i){var r=i.alternate;r!==null&&(i.alternate=null,zm(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&(delete r[hi],delete r[fo],delete r[Fc],delete r[vS],delete r[_S])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Fm(i){return i.tag===5||i.tag===3||i.tag===4}function $m(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Fm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Cu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.nodeType===8?l.parentNode.insertBefore(i,r):l.insertBefore(i,r):(l.nodeType===8?(r=l.parentNode,r.insertBefore(i,l)):(r=l,r.appendChild(i)),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=Na));else if(d!==4&&(i=i.child,i!==null))for(Cu(i,r,l),i=i.sibling;i!==null;)Cu(i,r,l),i=i.sibling}function Eu(i,r,l){var d=i.tag;if(d===5||d===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(d!==4&&(i=i.child,i!==null))for(Eu(i,r,l),i=i.sibling;i!==null;)Eu(i,r,l),i=i.sibling}var dn=null,oi=!1;function ns(i,r,l){for(l=l.child;l!==null;)Hm(i,r,l),l=l.sibling}function Hm(i,r,l){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(Ht,l)}catch{}switch(l.tag){case 5:_n||wr(l,r);case 6:var d=dn,g=oi;dn=null,ns(i,r,l),dn=d,oi=g,dn!==null&&(oi?(i=dn,l=l.stateNode,i.nodeType===8?i.parentNode.removeChild(l):i.removeChild(l)):dn.removeChild(l.stateNode));break;case 18:dn!==null&&(oi?(i=dn,l=l.stateNode,i.nodeType===8?zc(i.parentNode,l):i.nodeType===1&&zc(i,l),to(i)):zc(dn,l.stateNode));break;case 4:d=dn,g=oi,dn=l.stateNode.containerInfo,oi=!0,ns(i,r,l),dn=d,oi=g;break;case 0:case 11:case 14:case 15:if(!_n&&(d=l.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){g=d=d.next;do{var _=g,L=_.destroy;_=_.tag,L!==void 0&&((_&2)!==0||(_&4)!==0)&&xu(l,r,L),g=g.next}while(g!==d)}ns(i,r,l);break;case 1:if(!_n&&(wr(l,r),d=l.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=l.memoizedProps,d.state=l.memoizedState,d.componentWillUnmount()}catch(Y){Dt(l,r,Y)}ns(i,r,l);break;case 21:ns(i,r,l);break;case 22:l.mode&1?(_n=(d=_n)||l.memoizedState!==null,ns(i,r,l),_n=d):ns(i,r,l);break;default:ns(i,r,l)}}function Um(i){var r=i.updateQueue;if(r!==null){i.updateQueue=null;var l=i.stateNode;l===null&&(l=i.stateNode=new DS),r.forEach(function(d){var g=WS.bind(null,i,d);l.has(d)||(l.add(d),d.then(g,g))})}}function ai(i,r){var l=r.deletions;if(l!==null)for(var d=0;d<l.length;d++){var g=l[d];try{var _=i,L=r,Y=L;e:for(;Y!==null;){switch(Y.tag){case 5:dn=Y.stateNode,oi=!1;break e;case 3:dn=Y.stateNode.containerInfo,oi=!0;break e;case 4:dn=Y.stateNode.containerInfo,oi=!0;break e}Y=Y.return}if(dn===null)throw Error(n(160));Hm(_,L,g),dn=null,oi=!1;var J=g.alternate;J!==null&&(J.return=null),g.return=null}catch(oe){Dt(g,r,oe)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)Wm(r,i),r=r.sibling}function Wm(i,r){var l=i.alternate,d=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(ai(r,i),mi(i),d&4){try{ko(3,i,i.return),Xa(3,i)}catch(Oe){Dt(i,i.return,Oe)}try{ko(5,i,i.return)}catch(Oe){Dt(i,i.return,Oe)}}break;case 1:ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return);break;case 5:if(ai(r,i),mi(i),d&512&&l!==null&&wr(l,l.return),i.flags&32){var g=i.stateNode;try{te(g,"")}catch(Oe){Dt(i,i.return,Oe)}}if(d&4&&(g=i.stateNode,g!=null)){var _=i.memoizedProps,L=l!==null?l.memoizedProps:_,Y=i.type,J=i.updateQueue;if(i.updateQueue=null,J!==null)try{Y==="input"&&_.type==="radio"&&_.name!=null&&Be(g,_),Ce(Y,L);var oe=Ce(Y,_);for(L=0;L<J.length;L+=2){var be=J[L],Se=J[L+1];be==="style"?ge(g,Se):be==="dangerouslySetInnerHTML"?q(g,Se):be==="children"?te(g,Se):F(g,be,Se,oe)}switch(Y){case"input":$t(g,_);break;case"textarea":xe(g,_);break;case"select":var we=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!_.multiple;var Re=_.value;Re!=null?dt(g,!!_.multiple,Re,!1):we!==!!_.multiple&&(_.defaultValue!=null?dt(g,!!_.multiple,_.defaultValue,!0):dt(g,!!_.multiple,_.multiple?[]:"",!1))}g[fo]=_}catch(Oe){Dt(i,i.return,Oe)}}break;case 6:if(ai(r,i),mi(i),d&4){if(i.stateNode===null)throw Error(n(162));g=i.stateNode,_=i.memoizedProps;try{g.nodeValue=_}catch(Oe){Dt(i,i.return,Oe)}}break;case 3:if(ai(r,i),mi(i),d&4&&l!==null&&l.memoizedState.isDehydrated)try{to(r.containerInfo)}catch(Oe){Dt(i,i.return,Oe)}break;case 4:ai(r,i),mi(i);break;case 13:ai(r,i),mi(i),g=i.child,g.flags&8192&&(_=g.memoizedState!==null,g.stateNode.isHidden=_,!_||g.alternate!==null&&g.alternate.memoizedState!==null||(Ru=kt())),d&4&&Um(i);break;case 22:if(be=l!==null&&l.memoizedState!==null,i.mode&1?(_n=(oe=_n)||be,ai(r,i),_n=oe):ai(r,i),mi(i),d&8192){if(oe=i.memoizedState!==null,(i.stateNode.isHidden=oe)&&!be&&(i.mode&1)!==0)for(Ae=i,be=i.child;be!==null;){for(Se=Ae=be;Ae!==null;){switch(we=Ae,Re=we.child,we.tag){case 0:case 11:case 14:case 15:ko(4,we,we.return);break;case 1:wr(we,we.return);var De=we.stateNode;if(typeof De.componentWillUnmount=="function"){d=we,l=we.return;try{r=d,De.props=r.memoizedProps,De.state=r.memoizedState,De.componentWillUnmount()}catch(Oe){Dt(d,l,Oe)}}break;case 5:wr(we,we.return);break;case 22:if(we.memoizedState!==null){Vm(Se);continue}}Re!==null?(Re.return=we,Ae=Re):Vm(Se)}be=be.sibling}e:for(be=null,Se=i;;){if(Se.tag===5){if(be===null){be=Se;try{g=Se.stateNode,oe?(_=g.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(Y=Se.stateNode,J=Se.memoizedProps.style,L=J!=null&&J.hasOwnProperty("display")?J.display:null,Y.style.display=ue("display",L))}catch(Oe){Dt(i,i.return,Oe)}}}else if(Se.tag===6){if(be===null)try{Se.stateNode.nodeValue=oe?"":Se.memoizedProps}catch(Oe){Dt(i,i.return,Oe)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===i)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===i)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===i)break e;be===Se&&(be=null),Se=Se.return}be===Se&&(be=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:ai(r,i),mi(i),d&4&&Um(i);break;case 21:break;default:ai(r,i),mi(i)}}function mi(i){var r=i.flags;if(r&2){try{e:{for(var l=i.return;l!==null;){if(Fm(l)){var d=l;break e}l=l.return}throw Error(n(160))}switch(d.tag){case 5:var g=d.stateNode;d.flags&32&&(te(g,""),d.flags&=-33);var _=$m(i);Eu(i,_,g);break;case 3:case 4:var L=d.stateNode.containerInfo,Y=$m(i);Cu(i,Y,L);break;default:throw Error(n(161))}}catch(J){Dt(i,i.return,J)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function IS(i,r,l){Ae=i,Km(i)}function Km(i,r,l){for(var d=(i.mode&1)!==0;Ae!==null;){var g=Ae,_=g.child;if(g.tag===22&&d){var L=g.memoizedState!==null||Ga;if(!L){var Y=g.alternate,J=Y!==null&&Y.memoizedState!==null||_n;Y=Ga;var oe=_n;if(Ga=L,(_n=J)&&!oe)for(Ae=g;Ae!==null;)L=Ae,J=L.child,L.tag===22&&L.memoizedState!==null?Ym(g):J!==null?(J.return=L,Ae=J):Ym(g);for(;_!==null;)Ae=_,Km(_),_=_.sibling;Ae=g,Ga=Y,_n=oe}qm(i)}else(g.subtreeFlags&8772)!==0&&_!==null?(_.return=g,Ae=_):qm(i)}}function qm(i){for(;Ae!==null;){var r=Ae;if((r.flags&8772)!==0){var l=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:_n||Xa(5,r);break;case 1:var d=r.stateNode;if(r.flags&4&&!_n)if(l===null)d.componentDidMount();else{var g=r.elementType===r.type?l.memoizedProps:ri(r.type,l.memoizedProps);d.componentDidUpdate(g,l.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var _=r.updateQueue;_!==null&&Vp(r,_,d);break;case 3:var L=r.updateQueue;if(L!==null){if(l=null,r.child!==null)switch(r.child.tag){case 5:l=r.child.stateNode;break;case 1:l=r.child.stateNode}Vp(r,L,l)}break;case 5:var Y=r.stateNode;if(l===null&&r.flags&4){l=Y;var J=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&l.focus();break;case"img":J.src&&(l.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var oe=r.alternate;if(oe!==null){var be=oe.memoizedState;if(be!==null){var Se=be.dehydrated;Se!==null&&to(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}_n||r.flags&512&&ku(r)}catch(we){Dt(r,r.return,we)}}if(r===i){Ae=null;break}if(l=r.sibling,l!==null){l.return=r.return,Ae=l;break}Ae=r.return}}function Vm(i){for(;Ae!==null;){var r=Ae;if(r===i){Ae=null;break}var l=r.sibling;if(l!==null){l.return=r.return,Ae=l;break}Ae=r.return}}function Ym(i){for(;Ae!==null;){var r=Ae;try{switch(r.tag){case 0:case 11:case 15:var l=r.return;try{Xa(4,r)}catch(J){Dt(r,l,J)}break;case 1:var d=r.stateNode;if(typeof d.componentDidMount=="function"){var g=r.return;try{d.componentDidMount()}catch(J){Dt(r,g,J)}}var _=r.return;try{ku(r)}catch(J){Dt(r,_,J)}break;case 5:var L=r.return;try{ku(r)}catch(J){Dt(r,L,J)}}}catch(J){Dt(r,r.return,J)}if(r===i){Ae=null;break}var Y=r.sibling;if(Y!==null){Y.return=r.return,Ae=Y;break}Ae=r.return}}var OS=Math.ceil,Qa=M.ReactCurrentDispatcher,Nu=M.ReactCurrentOwner,Xn=M.ReactCurrentBatchConfig,at=0,tn=null,Ut=null,hn=0,Bn=0,br=Qi(0),Yt=0,Co=null,Ms=0,Ja=0,ju=0,Eo=null,Ln=null,Ru=0,Sr=1/0,Mi=null,Za=!1,Pu=null,is=null,el=!1,ss=null,tl=0,No=0,Lu=null,nl=-1,il=0;function Sn(){return(at&6)!==0?kt():nl!==-1?nl:nl=kt()}function rs(i){return(i.mode&1)===0?1:(at&2)!==0&&hn!==0?hn&-hn:wS.transition!==null?(il===0&&(il=$f()),il):(i=ft,i!==0||(i=window.event,i=i===void 0?16:Xf(i.type)),i)}function li(i,r,l,d){if(50<No)throw No=0,Lu=null,Error(n(185));Xr(i,l,d),((at&2)===0||i!==tn)&&(i===tn&&((at&2)===0&&(Ja|=l),Yt===4&&os(i,hn)),An(i,d),l===1&&at===0&&(r.mode&1)===0&&(Sr=kt()+500,La&&Zi()))}function An(i,r){var l=i.callbackNode;wb(i,r);var d=ha(i,i===tn?hn:0);if(d===0)l!==null&&Vr(l),i.callbackNode=null,i.callbackPriority=0;else if(r=d&-d,i.callbackPriority!==r){if(l!=null&&Vr(l),r===1)i.tag===0?yS(Xm.bind(null,i)):Mp(Xm.bind(null,i)),mS(function(){(at&6)===0&&Zi()}),l=null;else{switch(Hf(d)){case 1:l=He;break;case 4:l=Ve;break;case 16:l=qe;break;case 536870912:l=wt;break;default:l=qe}l=sg(l,Gm.bind(null,i))}i.callbackPriority=r,i.callbackNode=l}}function Gm(i,r){if(nl=-1,il=0,(at&6)!==0)throw Error(n(327));var l=i.callbackNode;if(xr()&&i.callbackNode!==l)return null;var d=ha(i,i===tn?hn:0);if(d===0)return null;if((d&30)!==0||(d&i.expiredLanes)!==0||r)r=sl(i,d);else{r=d;var g=at;at|=2;var _=Jm();(tn!==i||hn!==r)&&(Mi=null,Sr=kt()+500,Os(i,r));do try{FS();break}catch(Y){Qm(i,Y)}while(!0);Gc(),Qa.current=_,at=g,Ut!==null?r=0:(tn=null,hn=0,r=Yt)}if(r!==0){if(r===2&&(g=dc(i),g!==0&&(d=g,r=Au(i,g))),r===1)throw l=Co,Os(i,0),os(i,d),An(i,kt()),l;if(r===6)os(i,d);else{if(g=i.current.alternate,(d&30)===0&&!BS(g)&&(r=sl(i,d),r===2&&(_=dc(i),_!==0&&(d=_,r=Au(i,_))),r===1))throw l=Co,Os(i,0),os(i,d),An(i,kt()),l;switch(i.finishedWork=g,i.finishedLanes=d,r){case 0:case 1:throw Error(n(345));case 2:Bs(i,Ln,Mi);break;case 3:if(os(i,d),(d&130023424)===d&&(r=Ru+500-kt(),10<r)){if(ha(i,0)!==0)break;if(g=i.suspendedLanes,(g&d)!==d){Sn(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=Bc(Bs.bind(null,i,Ln,Mi),r);break}Bs(i,Ln,Mi);break;case 4:if(os(i,d),(d&4194240)===d)break;for(r=i.eventTimes,g=-1;0<d;){var L=31-Nn(d);_=1<<L,L=r[L],L>g&&(g=L),d&=~_}if(d=g,d=kt()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*OS(d/1960))-d,10<d){i.timeoutHandle=Bc(Bs.bind(null,i,Ln,Mi),d);break}Bs(i,Ln,Mi);break;case 5:Bs(i,Ln,Mi);break;default:throw Error(n(329))}}}return An(i,kt()),i.callbackNode===l?Gm.bind(null,i):null}function Au(i,r){var l=Eo;return i.current.memoizedState.isDehydrated&&(Os(i,r).flags|=256),i=sl(i,r),i!==2&&(r=Ln,Ln=l,r!==null&&Tu(r)),i}function Tu(i){Ln===null?Ln=i:Ln.push.apply(Ln,i)}function BS(i){for(var r=i;;){if(r.flags&16384){var l=r.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var d=0;d<l.length;d++){var g=l[d],_=g.getSnapshot;g=g.value;try{if(!ii(_(),g))return!1}catch{return!1}}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function os(i,r){for(r&=~ju,r&=~Ja,i.suspendedLanes|=r,i.pingedLanes&=~r,i=i.expirationTimes;0<r;){var l=31-Nn(r),d=1<<l;i[l]=-1,r&=~d}}function Xm(i){if((at&6)!==0)throw Error(n(327));xr();var r=ha(i,0);if((r&1)===0)return An(i,kt()),null;var l=sl(i,r);if(i.tag!==0&&l===2){var d=dc(i);d!==0&&(r=d,l=Au(i,d))}if(l===1)throw l=Co,Os(i,0),os(i,r),An(i,kt()),l;if(l===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=r,Bs(i,Ln,Mi),An(i,kt()),null}function Du(i,r){var l=at;at|=1;try{return i(r)}finally{at=l,at===0&&(Sr=kt()+500,La&&Zi())}}function Is(i){ss!==null&&ss.tag===0&&(at&6)===0&&xr();var r=at;at|=1;var l=Xn.transition,d=ft;try{if(Xn.transition=null,ft=1,i)return i()}finally{ft=d,Xn.transition=l,at=r,(at&6)===0&&Zi()}}function Mu(){Bn=br.current,St(br)}function Os(i,r){i.finishedWork=null,i.finishedLanes=0;var l=i.timeoutHandle;if(l!==-1&&(i.timeoutHandle=-1,pS(l)),Ut!==null)for(l=Ut.return;l!==null;){var d=l;switch(Wc(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Ra();break;case 3:_r(),St(jn),St(mn),iu();break;case 5:tu(d);break;case 4:_r();break;case 13:St(jt);break;case 19:St(jt);break;case 10:Xc(d.type._context);break;case 22:case 23:Mu()}l=l.return}if(tn=i,Ut=i=as(i.current,null),hn=Bn=r,Yt=0,Co=null,ju=Ja=Ms=0,Ln=Eo=null,As!==null){for(r=0;r<As.length;r++)if(l=As[r],d=l.interleaved,d!==null){l.interleaved=null;var g=d.next,_=l.pending;if(_!==null){var L=_.next;_.next=g,d.next=L}l.pending=d}As=null}return i}function Qm(i,r){do{var l=Ut;try{if(Gc(),$a.current=Ka,Ha){for(var d=Rt.memoizedState;d!==null;){var g=d.queue;g!==null&&(g.pending=null),d=d.next}Ha=!1}if(Ds=0,en=Vt=Rt=null,yo=!1,wo=0,Nu.current=null,l===null||l.return===null){Yt=1,Co=r,Ut=null;break}e:{var _=i,L=l.return,Y=l,J=r;if(r=hn,Y.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var oe=J,be=Y,Se=be.tag;if((be.mode&1)===0&&(Se===0||Se===11||Se===15)){var we=be.alternate;we?(be.updateQueue=we.updateQueue,be.memoizedState=we.memoizedState,be.lanes=we.lanes):(be.updateQueue=null,be.memoizedState=null)}var Re=Sm(L);if(Re!==null){Re.flags&=-257,xm(Re,L,Y,_,r),Re.mode&1&&bm(_,oe,r),r=Re,J=oe;var De=r.updateQueue;if(De===null){var Oe=new Set;Oe.add(J),r.updateQueue=Oe}else De.add(J);break e}else{if((r&1)===0){bm(_,oe,r),Iu();break e}J=Error(n(426))}}else if(Ct&&Y.mode&1){var Bt=Sm(L);if(Bt!==null){(Bt.flags&65536)===0&&(Bt.flags|=256),xm(Bt,L,Y,_,r),Vc(yr(J,Y));break e}}_=J=yr(J,Y),Yt!==4&&(Yt=2),Eo===null?Eo=[_]:Eo.push(_),_=L;do{switch(_.tag){case 3:_.flags|=65536,r&=-r,_.lanes|=r;var ie=ym(_,J,r);qp(_,ie);break e;case 1:Y=J;var ee=_.type,se=_.stateNode;if((_.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(is===null||!is.has(se)))){_.flags|=65536,r&=-r,_.lanes|=r;var ke=wm(_,Y,r);qp(_,ke);break e}}_=_.return}while(_!==null)}eg(l)}catch($e){r=$e,Ut===l&&l!==null&&(Ut=l=l.return);continue}break}while(!0)}function Jm(){var i=Qa.current;return Qa.current=Ka,i===null?Ka:i}function Iu(){(Yt===0||Yt===3||Yt===2)&&(Yt=4),tn===null||(Ms&268435455)===0&&(Ja&268435455)===0||os(tn,hn)}function sl(i,r){var l=at;at|=2;var d=Jm();(tn!==i||hn!==r)&&(Mi=null,Os(i,r));do try{zS();break}catch(g){Qm(i,g)}while(!0);if(Gc(),at=l,Qa.current=d,Ut!==null)throw Error(n(261));return tn=null,hn=0,Yt}function zS(){for(;Ut!==null;)Zm(Ut)}function FS(){for(;Ut!==null&&!tr();)Zm(Ut)}function Zm(i){var r=ig(i.alternate,i,Bn);i.memoizedProps=i.pendingProps,r===null?eg(i):Ut=r,Nu.current=null}function eg(i){var r=i;do{var l=r.alternate;if(i=r.return,(r.flags&32768)===0){if(l=AS(l,r,Bn),l!==null){Ut=l;return}}else{if(l=TS(l,r),l!==null){l.flags&=32767,Ut=l;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Yt=6,Ut=null;return}}if(r=r.sibling,r!==null){Ut=r;return}Ut=r=i}while(r!==null);Yt===0&&(Yt=5)}function Bs(i,r,l){var d=ft,g=Xn.transition;try{Xn.transition=null,ft=1,$S(i,r,l,d)}finally{Xn.transition=g,ft=d}return null}function $S(i,r,l,d){do xr();while(ss!==null);if((at&6)!==0)throw Error(n(327));l=i.finishedWork;var g=i.finishedLanes;if(l===null)return null;if(i.finishedWork=null,i.finishedLanes=0,l===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var _=l.lanes|l.childLanes;if(bb(i,_),i===tn&&(Ut=tn=null,hn=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||el||(el=!0,sg(qe,function(){return xr(),null})),_=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||_){_=Xn.transition,Xn.transition=null;var L=ft;ft=1;var Y=at;at|=4,Nu.current=null,MS(i,l),Wm(l,i),aS(Ic),ma=!!Mc,Ic=Mc=null,i.current=l,IS(l),ca(),at=Y,ft=L,Xn.transition=_}else i.current=l;if(el&&(el=!1,ss=i,tl=g),_=i.pendingLanes,_===0&&(is=null),uc(l.stateNode),An(i,kt()),r!==null)for(d=i.onRecoverableError,l=0;l<r.length;l++)g=r[l],d(g.value,{componentStack:g.stack,digest:g.digest});if(Za)throw Za=!1,i=Pu,Pu=null,i;return(tl&1)!==0&&i.tag!==0&&xr(),_=i.pendingLanes,(_&1)!==0?i===Lu?No++:(No=0,Lu=i):No=0,Zi(),null}function xr(){if(ss!==null){var i=Hf(tl),r=Xn.transition,l=ft;try{if(Xn.transition=null,ft=16>i?16:i,ss===null)var d=!1;else{if(i=ss,ss=null,tl=0,(at&6)!==0)throw Error(n(331));var g=at;for(at|=4,Ae=i.current;Ae!==null;){var _=Ae,L=_.child;if((Ae.flags&16)!==0){var Y=_.deletions;if(Y!==null){for(var J=0;J<Y.length;J++){var oe=Y[J];for(Ae=oe;Ae!==null;){var be=Ae;switch(be.tag){case 0:case 11:case 15:ko(8,be,_)}var Se=be.child;if(Se!==null)Se.return=be,Ae=Se;else for(;Ae!==null;){be=Ae;var we=be.sibling,Re=be.return;if(zm(be),be===oe){Ae=null;break}if(we!==null){we.return=Re,Ae=we;break}Ae=Re}}}var De=_.alternate;if(De!==null){var Oe=De.child;if(Oe!==null){De.child=null;do{var Bt=Oe.sibling;Oe.sibling=null,Oe=Bt}while(Oe!==null)}}Ae=_}}if((_.subtreeFlags&2064)!==0&&L!==null)L.return=_,Ae=L;else e:for(;Ae!==null;){if(_=Ae,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:ko(9,_,_.return)}var ie=_.sibling;if(ie!==null){ie.return=_.return,Ae=ie;break e}Ae=_.return}}var ee=i.current;for(Ae=ee;Ae!==null;){L=Ae;var se=L.child;if((L.subtreeFlags&2064)!==0&&se!==null)se.return=L,Ae=se;else e:for(L=ee;Ae!==null;){if(Y=Ae,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:Xa(9,Y)}}catch($e){Dt(Y,Y.return,$e)}if(Y===L){Ae=null;break e}var ke=Y.sibling;if(ke!==null){ke.return=Y.return,Ae=ke;break e}Ae=Y.return}}if(at=g,Zi(),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(Ht,i)}catch{}d=!0}return d}finally{ft=l,Xn.transition=r}}return!1}function tg(i,r,l){r=yr(l,r),r=ym(i,r,1),i=ts(i,r,1),r=Sn(),i!==null&&(Xr(i,1,r),An(i,r))}function Dt(i,r,l){if(i.tag===3)tg(i,i,l);else for(;r!==null;){if(r.tag===3){tg(r,i,l);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(is===null||!is.has(d))){i=yr(l,i),i=wm(r,i,1),r=ts(r,i,1),i=Sn(),r!==null&&(Xr(r,1,i),An(r,i));break}}r=r.return}}function HS(i,r,l){var d=i.pingCache;d!==null&&d.delete(r),r=Sn(),i.pingedLanes|=i.suspendedLanes&l,tn===i&&(hn&l)===l&&(Yt===4||Yt===3&&(hn&130023424)===hn&&500>kt()-Ru?Os(i,0):ju|=l),An(i,r)}function ng(i,r){r===0&&((i.mode&1)===0?r=1:(r=da,da<<=1,(da&130023424)===0&&(da=4194304)));var l=Sn();i=Ai(i,r),i!==null&&(Xr(i,r,l),An(i,l))}function US(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),ng(i,l)}function WS(i,r){var l=0;switch(i.tag){case 13:var d=i.stateNode,g=i.memoizedState;g!==null&&(l=g.retryLane);break;case 19:d=i.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(r),ng(i,l)}var ig;ig=function(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps||jn.current)Pn=!0;else{if((i.lanes&l)===0&&(r.flags&128)===0)return Pn=!1,LS(i,r,l);Pn=(i.flags&131072)!==0}else Pn=!1,Ct&&(r.flags&1048576)!==0&&Ip(r,Ta,r.index);switch(r.lanes=0,r.tag){case 2:var d=r.type;Ya(i,r),i=r.pendingProps;var g=dr(r,mn.current);vr(r,l),g=ou(null,r,d,i,g,l);var _=au();return r.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Rn(d)?(_=!0,Pa(r)):_=!1,r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Zc(r),g.updater=qa,r.stateNode=g,g._reactInternals=r,fu(r,d,i,l),r=vu(null,r,d,!0,_,l)):(r.tag=0,Ct&&_&&Uc(r),bn(null,r,g,l),r=r.child),r;case 16:d=r.elementType;e:{switch(Ya(i,r),i=r.pendingProps,g=d._init,d=g(d._payload),r.type=d,g=r.tag=qS(d),i=ri(d,i),g){case 0:r=gu(null,r,d,i,l);break e;case 1:r=Rm(null,r,d,i,l);break e;case 11:r=km(null,r,d,i,l);break e;case 14:r=Cm(null,r,d,ri(d.type,i),l);break e}throw Error(n(306,d,""))}return r;case 0:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),gu(i,r,d,g,l);case 1:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Rm(i,r,d,g,l);case 3:e:{if(Pm(r),i===null)throw Error(n(387));d=r.pendingProps,_=r.memoizedState,g=_.element,Kp(i,r),za(r,d,null,l);var L=r.memoizedState;if(d=L.element,_.isDehydrated)if(_={element:d,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){g=yr(Error(n(423)),r),r=Lm(i,r,d,l,g);break e}else if(d!==g){g=yr(Error(n(424)),r),r=Lm(i,r,d,l,g);break e}else for(On=Xi(r.stateNode.containerInfo.firstChild),In=r,Ct=!0,si=null,l=Up(r,null,d,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(pr(),d===g){r=Di(i,r,l);break e}bn(i,r,d,l)}r=r.child}return r;case 5:return Yp(r),i===null&&qc(r),d=r.type,g=r.pendingProps,_=i!==null?i.memoizedProps:null,L=g.children,Oc(d,g)?L=null:_!==null&&Oc(d,_)&&(r.flags|=32),jm(i,r),bn(i,r,L,l),r.child;case 6:return i===null&&qc(r),null;case 13:return Am(i,r,l);case 4:return eu(r,r.stateNode.containerInfo),d=r.pendingProps,i===null?r.child=mr(r,null,d,l):bn(i,r,d,l),r.child;case 11:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),km(i,r,d,g,l);case 7:return bn(i,r,r.pendingProps,l),r.child;case 8:return bn(i,r,r.pendingProps.children,l),r.child;case 12:return bn(i,r,r.pendingProps.children,l),r.child;case 10:e:{if(d=r.type._context,g=r.pendingProps,_=r.memoizedProps,L=g.value,_t(Ia,d._currentValue),d._currentValue=L,_!==null)if(ii(_.value,L)){if(_.children===g.children&&!jn.current){r=Di(i,r,l);break e}}else for(_=r.child,_!==null&&(_.return=r);_!==null;){var Y=_.dependencies;if(Y!==null){L=_.child;for(var J=Y.firstContext;J!==null;){if(J.context===d){if(_.tag===1){J=Ti(-1,l&-l),J.tag=2;var oe=_.updateQueue;if(oe!==null){oe=oe.shared;var be=oe.pending;be===null?J.next=J:(J.next=be.next,be.next=J),oe.pending=J}}_.lanes|=l,J=_.alternate,J!==null&&(J.lanes|=l),Qc(_.return,l,r),Y.lanes|=l;break}J=J.next}}else if(_.tag===10)L=_.type===r.type?null:_.child;else if(_.tag===18){if(L=_.return,L===null)throw Error(n(341));L.lanes|=l,Y=L.alternate,Y!==null&&(Y.lanes|=l),Qc(L,l,r),L=_.sibling}else L=_.child;if(L!==null)L.return=_;else for(L=_;L!==null;){if(L===r){L=null;break}if(_=L.sibling,_!==null){_.return=L.return,L=_;break}L=L.return}_=L}bn(i,r,g.children,l),r=r.child}return r;case 9:return g=r.type,d=r.pendingProps.children,vr(r,l),g=Yn(g),d=d(g),r.flags|=1,bn(i,r,d,l),r.child;case 14:return d=r.type,g=ri(d,r.pendingProps),g=ri(d.type,g),Cm(i,r,d,g,l);case 15:return Em(i,r,r.type,r.pendingProps,l);case 17:return d=r.type,g=r.pendingProps,g=r.elementType===d?g:ri(d,g),Ya(i,r),r.tag=1,Rn(d)?(i=!0,Pa(r)):i=!1,vr(r,l),vm(r,d,g),fu(r,d,g,l),vu(null,r,d,!0,i,l);case 19:return Dm(i,r,l);case 22:return Nm(i,r,l)}throw Error(n(156,r.tag))};function sg(i,r){return Ns(i,r)}function KS(i,r,l,d){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(i,r,l,d){return new KS(i,r,l,d)}function Ou(i){return i=i.prototype,!(!i||!i.isReactComponent)}function qS(i){if(typeof i=="function")return Ou(i)?1:0;if(i!=null){if(i=i.$$typeof,i===I)return 11;if(i===A)return 14}return 2}function as(i,r){var l=i.alternate;return l===null?(l=Qn(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&14680064,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l}function rl(i,r,l,d,g,_){var L=2;if(d=i,typeof i=="function")Ou(i)&&(L=1);else if(typeof i=="string")L=5;else e:switch(i){case O:return zs(l.children,g,_,r);case Z:L=8,g|=8;break;case X:return i=Qn(12,l,r,g|2),i.elementType=X,i.lanes=_,i;case C:return i=Qn(13,l,r,g),i.elementType=C,i.lanes=_,i;case T:return i=Qn(19,l,r,g),i.elementType=T,i.lanes=_,i;case U:return ol(l,g,_,r);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case Q:L=10;break e;case z:L=9;break e;case I:L=11;break e;case A:L=14;break e;case $:L=16,d=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return r=Qn(L,l,r,g),r.elementType=i,r.type=d,r.lanes=_,r}function zs(i,r,l,d){return i=Qn(7,i,d,r),i.lanes=l,i}function ol(i,r,l,d){return i=Qn(22,i,d,r),i.elementType=U,i.lanes=l,i.stateNode={isHidden:!1},i}function Bu(i,r,l){return i=Qn(6,i,null,r),i.lanes=l,i}function zu(i,r,l){return r=Qn(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}function VS(i,r,l,d,g){this.tag=r,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hc(0),this.expirationTimes=hc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hc(0),this.identifierPrefix=d,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Fu(i,r,l,d,g,_,L,Y,J){return i=new VS(i,r,l,Y,J),r===1?(r=1,_===!0&&(r|=8)):r=0,_=Qn(3,null,null,r),i.current=_,_.stateNode=i,_.memoizedState={element:d,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zc(_),i}function YS(i,r,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:G,key:d==null?null:""+d,children:i,containerInfo:r,implementation:l}}function rg(i){if(!i)return Ji;i=i._reactInternals;e:{if(Ot(i)!==i||i.tag!==1)throw Error(n(170));var r=i;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Rn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(n(171))}if(i.tag===1){var l=i.type;if(Rn(l))return Tp(i,l,r)}return r}function og(i,r,l,d,g,_,L,Y,J){return i=Fu(l,d,!0,i,g,_,L,Y,J),i.context=rg(null),l=i.current,d=Sn(),g=rs(l),_=Ti(d,g),_.callback=r??null,ts(l,_,g),i.current.lanes=g,Xr(i,g,d),An(i,d),i}function al(i,r,l,d){var g=r.current,_=Sn(),L=rs(g);return l=rg(l),r.context===null?r.context=l:r.pendingContext=l,r=Ti(_,L),r.payload={element:i},d=d===void 0?null:d,d!==null&&(r.callback=d),i=ts(g,r,L),i!==null&&(li(i,g,L,_),Ba(i,g,L)),L}function ll(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function ag(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<r?l:r}}function $u(i,r){ag(i,r),(i=i.alternate)&&ag(i,r)}function GS(){return null}var lg=typeof reportError=="function"?reportError:function(i){console.error(i)};function Hu(i){this._internalRoot=i}cl.prototype.render=Hu.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(n(409));al(i,r,null,null)},cl.prototype.unmount=Hu.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Is(function(){al(null,i,null,null)}),r[ji]=null}};function cl(i){this._internalRoot=i}cl.prototype.unstable_scheduleHydration=function(i){if(i){var r=Kf();i={blockedOn:null,target:i,priority:r};for(var l=0;l<Vi.length&&r!==0&&r<Vi[l].priority;l++);Vi.splice(l,0,i),l===0&&Yf(i)}};function Uu(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function ul(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function cg(){}function XS(i,r,l,d,g){if(g){if(typeof d=="function"){var _=d;d=function(){var oe=ll(L);_.call(oe)}}var L=og(r,d,i,0,null,!1,!1,"",cg);return i._reactRootContainer=L,i[ji]=L.current,uo(i.nodeType===8?i.parentNode:i),Is(),L}for(;g=i.lastChild;)i.removeChild(g);if(typeof d=="function"){var Y=d;d=function(){var oe=ll(J);Y.call(oe)}}var J=Fu(i,0,!1,null,null,!1,!1,"",cg);return i._reactRootContainer=J,i[ji]=J.current,uo(i.nodeType===8?i.parentNode:i),Is(function(){al(r,J,l,d)}),J}function dl(i,r,l,d,g){var _=l._reactRootContainer;if(_){var L=_;if(typeof g=="function"){var Y=g;g=function(){var J=ll(L);Y.call(J)}}al(r,L,i,g)}else L=XS(l,r,i,g,d);return ll(L)}Uf=function(i){switch(i.tag){case 3:var r=i.stateNode;if(r.current.memoizedState.isDehydrated){var l=Gr(r.pendingLanes);l!==0&&(fc(r,l|1),An(r,kt()),(at&6)===0&&(Sr=kt()+500,Zi()))}break;case 13:Is(function(){var d=Ai(i,1);if(d!==null){var g=Sn();li(d,i,1,g)}}),$u(i,1)}},pc=function(i){if(i.tag===13){var r=Ai(i,134217728);if(r!==null){var l=Sn();li(r,i,134217728,l)}$u(i,134217728)}},Wf=function(i){if(i.tag===13){var r=rs(i),l=Ai(i,r);if(l!==null){var d=Sn();li(l,i,r,d)}$u(i,r)}},Kf=function(){return ft},qf=function(i,r){var l=ft;try{return ft=i,r()}finally{ft=l}},Qe=function(i,r,l){switch(r){case"input":if($t(i,l),r=l.name,l.type==="radio"&&r!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<l.length;r++){var d=l[r];if(d!==i&&d.form===i.form){var g=ja(d);if(!g)throw Error(n(90));Xe(d),$t(d,g)}}}break;case"textarea":xe(i,l);break;case"select":r=l.value,r!=null&&dt(i,!!l.multiple,r,!1)}},Wn=Du,ui=Is;var QS={usingClientEntryPoint:!1,Events:[po,cr,ja,Jt,ni,Du]},jo={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},JS={bundleType:jo.bundleType,version:jo.version,rendererPackageName:jo.rendererPackageName,rendererConfig:jo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:M.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Es(i),i===null?null:i.stateNode},findFiberByHostInstance:jo.findFiberByHostInstance||GS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hl.isDisabled&&hl.supportsFiber)try{Ht=hl.inject(JS),Zt=hl}catch{}}return Tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QS,Tn.createPortal=function(i,r){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uu(r))throw Error(n(200));return YS(i,r,null,l)},Tn.createRoot=function(i,r){if(!Uu(i))throw Error(n(299));var l=!1,d="",g=lg;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),r=Fu(i,1,!1,null,null,l,!1,d,g),i[ji]=r.current,uo(i.nodeType===8?i.parentNode:i),new Hu(r)},Tn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Es(r),i=i===null?null:i.stateNode,i},Tn.flushSync=function(i){return Is(i)},Tn.hydrate=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!0,l)},Tn.hydrateRoot=function(i,r,l){if(!Uu(i))throw Error(n(405));var d=l!=null&&l.hydratedSources||null,g=!1,_="",L=lg;if(l!=null&&(l.unstable_strictMode===!0&&(g=!0),l.identifierPrefix!==void 0&&(_=l.identifierPrefix),l.onRecoverableError!==void 0&&(L=l.onRecoverableError)),r=og(r,null,i,1,l??null,g,!1,_,L),i[ji]=r.current,uo(i),d)for(i=0;i<d.length;i++)l=d[i],g=l._getVersion,g=g(l._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[l,g]:r.mutableSourceEagerHydrationData.push(l,g);return new cl(r)},Tn.render=function(i,r,l){if(!ul(r))throw Error(n(200));return dl(null,i,r,!1,l)},Tn.unmountComponentAtNode=function(i){if(!ul(i))throw Error(n(40));return i._reactRootContainer?(Is(function(){dl(null,null,i,!1,function(){i._reactRootContainer=null,i[ji]=null})}),!0):!1},Tn.unstable_batchedUpdates=Du,Tn.unstable_renderSubtreeIntoContainer=function(i,r,l,d){if(!ul(l))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return dl(i,r,l,!1,d)},Tn.version="18.3.1-next-f1338f8080-20240426",Tn}var vg;function a0(){if(vg)return qu.exports;vg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qu.exports=o0(),qu.exports}var _g;function l0(){if(_g)return fl;_g=1;var e=a0();return fl.createRoot=e.createRoot,fl.hydrateRoot=e.hydrateRoot,fl}var c0=l0();const u0=qh(c0);function Ft(e,t,n={}){return fetch(e,{...n,headers:{...n.headers||{},Authorization:`Bearer ${t}`}})}const V_=e=>`nc_seen_${e}`;async function Te(e,t,n={}){const s=await Ft(e,t,{method:n.method||"GET",headers:{"content-type":"application/json"},body:n.body?JSON.stringify(n.body):void 0}),o=await s.json().catch(()=>({}));if(!s.ok){const a=new Error(o.error||`HTTP ${s.status}`);throw a.status=s.status,a.data=o,a}return o}const ln=e=>Array.isArray(e)&&e.length?`/api/route/${e.map(encodeURIComponent).join("/")}/_`:"/api",cn=(e,t)=>`${ln(e)}/fleet/${t}`,ws=(e,t)=>Te(cn(t,"status"),e),Yh=(e,t,n)=>Te(cn(n,"up"),e,{method:"POST",body:t}),Il=(e,t,n)=>Te(cn(n,"down"),e,{method:"POST",body:t}),Y_=(e,t,n)=>Te(cn(n,"boot"),e,{method:"POST",body:t}),Fo=(e,t,n)=>Te(cn(n,"restart"),e,{method:"POST",body:{cell:t}}),Gh=(e,t)=>Te(cn(t,"definitions"),e),d0=(e,t)=>Te(cn(t,"credentials/status"),e),yg=(e,t,n,s)=>Te(cn(s,"credentials/set"),e,{method:"POST",body:{envKey:t,value:n}}),h0=(e,t,n)=>Te(cn(n,"credentials/remove"),e,{method:"POST",body:{envKey:t}}),f0=(e,t,n)=>Te(cn(n,"define-engine"),e,{method:"POST",body:{def:t}}),p0=(e,t,n,s,o)=>Te(cn(o,"edit-engine"),e,{method:"POST",body:{id:t,patch:n,envChanges:s}}),m0=(e,t,n)=>Te(cn(n,"remove-engine"),e,{method:"POST",body:{id:t}}),g0=(e,t,n)=>Te(cn(n,"define-cell"),e,{method:"POST",body:{def:t}}),G_=(e,t,n,s)=>Te(cn(s,"edit-cell"),e,{method:"POST",body:{id:t,patch:n}}),X_=(e,t,n=!1,s)=>Te(cn(s,"remove-cell"),e,{method:"POST",body:{id:t,stop:n}}),v0=(e,t,n)=>Te(cn(n,"import-cell"),e,{method:"POST",body:t}),_0=(e,t,n)=>Te(cn(n,"restore-cells"),e,{method:"POST",body:{cells:t}}),y0=(e,t,n,s)=>Te(cn(s,"restore-engines"),e,{method:"POST",body:{engines:t,overwrite:!!n}}),Xh=(e,t,n)=>Te(`${ln(n)}/sessions/${encodeURIComponent(t)}`,e,{method:"DELETE"}),Q_=(e,t,n,s)=>Te(`${ln(s)}/sessions/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{technical:!!n}}),Qh=(e,t,n)=>Te(`${ln(n)}/fs/dirs${t?`?path=${encodeURIComponent(t)}`:""}`,e),J_=e=>Te("/api/settings",e),w0=e=>Te("/api/nodes",e),b0=e=>Te("/api/peers",e),Z_=(e,t=[])=>Te(`${ln(t)}/vl-nodes`,e),S0=(e,t,n,s={},o=[])=>Te(`${ln(o)}/vl-nodes/${encodeURIComponent(t)}/commands`,e,{method:"POST",body:{kind:n,args:s}}),x0=(e,t,n=0,s=[])=>Te(`${ln(s)}/vl-nodes/${encodeURIComponent(t)}/events${n?`?after=${encodeURIComponent(n)}`:""}`,e),ey=e=>Te("/api/topology",e),Jh=(e,t)=>Te(`${ln(t)}/sessions`,e),Zh=(e,t)=>Te(`${ln(t)}/config`,e),wg=(e,t)=>Te(`${ln(t)}/topology`,e),Ud=(e,t)=>Te("/api/settings/config",e,{method:"POST",body:t}),k0=e=>Te("/api/settings/token/rotate",e,{method:"POST"}),C0=(e,t)=>Te("/api/settings/nodes/pair",e,{method:"POST",body:t}),bg=(e,t,n=[])=>Te(`${ln(n)}/settings/peering/invite`,e,{method:"POST",body:t||{}}),ty=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/label`,e,{method:"PATCH",body:{label:n}}),E0=e=>Te("/api/settings/node-aliases",e),N0=(e,t,n)=>Te(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{alias:n}}),Sg=(e,t)=>Te(`/api/settings/node-aliases/${encodeURIComponent(t)}`,e,{method:"DELETE"}),j0=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"PATCH",body:n}),R0=(e,t)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}`,e,{method:"DELETE"}),ef=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/${n}`,e,{method:"POST"}),P0=(e,t,n)=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/share`,e,{method:"PATCH",body:{shared:n}}),L0=(e,t,n,s=[])=>Te(`/api/settings/nodes/${encodeURIComponent(t)}/visibility`,e,{method:"PATCH",body:{visibility:n,selected:s}}),A0=e=>Te("/api/settings/audio",e),T0=(e,t)=>Te("/api/settings/audio/consent",e,{method:"PATCH",body:{consent:t}}),D0=e=>Te("/api/settings/audio/test",e,{method:"POST",body:{}}),M0=e=>Te("/api/settings/audio/stop",e,{method:"POST",body:{}}),I0=e=>Te("/api/settings/audio/groups",e),O0=(e,t,n)=>Te(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"PUT",body:n}),B0=(e,t)=>Te(`/api/settings/audio/groups/${encodeURIComponent(t)}`,e,{method:"DELETE"}),z0=e=>Te("/api/settings/service/regenerate",e,{method:"POST"}),F0=e=>Te("/api/settings/update/check",e,{method:"POST"}),$0=e=>Te("/api/settings/update/apply",e,{method:"POST"}),Jl=(e,t)=>`${ln(e)}/diagnostics/${t}`,H0=(e,t=[])=>Te(Jl(t,"status"),e),U0=(e,{after:t=0,limit:n=200}={},s=[])=>Te(`${Jl(s,"logs")}?after=${encodeURIComponent(t)}&limit=${encodeURIComponent(n)}`,e),xg=(e,t,n,s=[])=>Te(Jl(s,"verbose"),e,{method:"PATCH",body:{enabled:t,durationSeconds:n}}),W0=(e,t=[])=>Te(Jl(t,"logs"),e,{method:"DELETE"}),K0=(e,t=!0)=>Te(`/api/asks${t?"?open=1":""}`,e),q0=(e,t,n)=>Te(`/api/asks/${encodeURIComponent(t)}/answer`,e,{method:"POST",body:{text:n}}),V0=(e,t)=>Te(`/api/asks/${encodeURIComponent(t)}`,e,{method:"DELETE"}),pl=(e,t=[])=>Te(`${ln(t)}/decks`,e),kg=(e,t,n=[])=>Te(`${ln(n)}/decks`,e,{method:"POST",body:{name:t}}),ml=(e,t,n,s,o=[])=>Te(`${ln(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PUT",body:{layout:n,expectedRevision:s}}),Y0=(e,t,n,s,o=[])=>Te(`${ln(o)}/decks/${encodeURIComponent(t)}`,e,{method:"PATCH",body:{name:n,expectedRevision:s}}),G0=(e,t,n,s=[])=>Te(`${ln(s)}/decks/${encodeURIComponent(t)}`,e,{method:"DELETE",body:{expectedRevision:n}}),X0={power:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 3v8"}),c.jsx("path",{d:"M6.6 6.6a8 8 0 1 0 10.8 0"})]}),folder:c.jsx("path",{d:"M4 6a2 2 0 0 1 2-2h3.6a2 2 0 0 1 1.4.6L12.4 6H18a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z"}),keyboard:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"6",width:"18",height:"12",rx:"2"}),c.jsx("path",{d:"M7 10h.01M11 10h.01M15 10h.01M17 14h.01M7 14h7"})]}),mic:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3"}),c.jsx("path",{d:"M5 11a7 7 0 0 0 14 0"}),c.jsx("path",{d:"M12 18v3"})]}),enter:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M20 5v6a2 2 0 0 1-2 2H5"}),c.jsx("polyline",{points:"9 9 5 13 9 17"})]}),send:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M22 2 15 22 11 13 2 9Z"}),c.jsx("path",{d:"M22 2 11 13"})]}),trash:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M4 7h16"}),c.jsx("path",{d:"M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"}),c.jsx("path",{d:"M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12"}),c.jsx("path",{d:"M10 11v6M14 11v6"})]}),x:c.jsx("path",{d:"M6 6l12 12M18 6 6 18"}),refresh:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36L21 8"}),c.jsx("polyline",{points:"21 3 21 8 16 8"})]}),boot:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"4",width:"18",height:"13",rx:"2"}),c.jsx("path",{d:"M8 21h8M12 17v4M12 12V7"}),c.jsx("polyline",{points:"9 10 12 7 15 10"})]}),upload:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M12 16V5"}),c.jsx("polyline",{points:"8 9 12 5 16 9"}),c.jsx("path",{d:"M5 20h14"})]}),chevronLeft:c.jsx("polyline",{points:"14 6 8 12 14 18"}),chevronUp:c.jsx("polyline",{points:"6 14 12 8 18 14"}),chevronDown:c.jsx("polyline",{points:"6 10 12 16 18 10"}),history:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),c.jsx("polyline",{points:"3 3 3 8 8 8"}),c.jsx("path",{d:"M12 7v5l3 2"})]}),attach:c.jsx("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"}),file:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),c.jsx("polyline",{points:"14 2 14 8 20 8"})]}),camera:c.jsxs(c.Fragment,{children:[c.jsx("path",{d:"M14.5 4h-5L7.5 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3.5z"}),c.jsx("circle",{cx:"12",cy:"13",r:"3.5"})]}),image:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),c.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),c.jsx("path",{d:"M21 15l-5-5L5 21"})]}),zoomIn:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6M11 8v6"})]}),zoomOut:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"11",cy:"11",r:"7"}),c.jsx("path",{d:"M21 21l-4.35-4.35"}),c.jsx("path",{d:"M8 11h6"})]}),gear:c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"12",cy:"12",r:"3"}),c.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),copy:c.jsxs(c.Fragment,{children:[c.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),c.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})};function Je({name:e,size:t=20}){return c.jsx("svg",{className:"nc-icon",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:X0[e]||null})}const Q0=["all","pinned","active","off","technical"],ny="nc_sidebar_views_v1",iy="nc_sidebar_order_v1";function sy(e){return Q0.includes(e)?e:"all"}function J0(e,t=[],n="all"){const s=sy(n);return s==="technical"?e.technical===!0:e.technical===!0?!1:s==="pinned"?t.includes(e.key):s==="active"?!!e.live:s==="off"?!e.live:!0}function Z0(e,t,n=[],s=[]){const o=n.indexOf(e.key),a=n.indexOf(t.key),u=o===-1?Number.MAX_SAFE_INTEGER:o,h=a===-1?Number.MAX_SAFE_INTEGER:a,f=s.indexOf(e.key),m=s.indexOf(t.key),v=f===-1?Number.MAX_SAFE_INTEGER:f,b=m===-1?Number.MAX_SAFE_INTEGER:m;return u-h||v-b||+!!t.live-+!!e.live||+!!t.fresh-+!!e.fresh||Number(t.activity||0)-Number(e.activity||0)||String(e.label||"").localeCompare(String(t.label||""))||String(e.key||"").localeCompare(String(t.key||""))}function ex(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(iy));if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[s,o]of Object.entries(t).slice(0,64)){if(typeof s!="string"||!s||s.length>160||!Array.isArray(o))continue;const a=[...new Set(o.filter(u=>typeof u=="string"&&u&&u.length<=256))].slice(0,128);a.length&&(n[s]=a)}return n}catch{return{}}}function Fi(e,t){return Array.isArray(e==null?void 0:e[t])?e[t]:[]}function tx(e,t=globalThis.localStorage){try{t.setItem(iy,JSON.stringify(e))}catch{}return e}function nx(e,t,n,s,o=[]){if(typeof t!="string"||!t||n===s)return e;const a=[...new Set(o.filter(y=>typeof y=="string"&&y))];if(!a.includes(n)||!a.includes(s))return e;const u=Fi(e,t).filter(y=>a.includes(y)),h=[...u,...a.filter(y=>!u.includes(y))],f=h.indexOf(n),m=h.indexOf(s);h.splice(f,1);const v=h.indexOf(s),b=f<m?v+1:v;return h.splice(b,0,n),{...e,[t]:h}}function ix(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(ny));return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Cg(e,t){var n,s;return{open:((n=e==null?void 0:e[t])==null?void 0:n.open)!==!1,filter:sy((s=e==null?void 0:e[t])==null?void 0:s.filter)}}function sx(e,t=globalThis.localStorage){try{t.setItem(ny,JSON.stringify(e))}catch{}return e}function Eg(e,t=""){const n=String(t||"").trim().toLocaleLowerCase();return n?[e.label,e.key,e.searchText].filter(Boolean).join(" ").toLocaleLowerCase().includes(n):!0}function gs(e=[],t=[],n="all",s=[]){return[...e].filter(o=>J0(o,t,n)).sort((o,a)=>Z0(o,a,t,s))}const tf=["it","en","es"];function rx(){try{const e=typeof navigator<"u"&&navigator.language||"",t=String(e).slice(0,2).toLowerCase();return tf.includes(t)?t:"en"}catch{return"en"}}const jl=rx(),ry="nc_lang",Wd="nc-lang";function oy(){return typeof localStorage<"u"?localStorage:null}const gl={it:{"update-available":"nuova versione {v} disponibile","install-version-mismatch":"installazione incompleta: frontend e server non coincidono (v{v})",reload:"ricarica","grid-empty":"trascina qui una sessione dalla sidebar, o doppio-clic per la vista singola","grid-full":"il deck può mostrare al massimo 9 sessioni",pin:"fissa in cima",reorder:"riordina","reorder-help":"trascina la maniglia; frecce su/giu da tastiera","rename-node":"rinomina nodo","rename-node-prompt":"Nuovo nome del nodo in NexusCrew","rename-node-invalid":"Nome non valido: massimo 64 caratteri, senza a capo.","reorder-deck-help":"trascina il deck; frecce sinistra/destra da tastiera",sessions:"sessioni","new-session":"nuova sessione",new:"nuova",fleet:"Flotta","fleet-tmux":"flotta tmux","other-sessions":"Altre sessioni","view-all":"tutte","view-pinned":"fissate","view-active":"attive","view-off":"spente","view-technical":"tecniche","mark-technical":"nascondi come sessione tecnica","mark-normal":"mostra come sessione normale","position-local":"Locale",files:"file",refresh:"aggiorna","filter-placeholder":"filtra sessioni…","loading-fleet":"carico la flotta…","no-sessions":"nessuna sessione tmux viva — la flotta parte al boot (systemd)","no-match":'nessuna sessione contiene "{q}"',"copy-url":"clicca per copiare l'URL","ssh-only":"solo tunnel SSH/VPN","new-files-outbox":"nuovi file in outbox",terminate:"termina","terminate-confirm":'Terminare la sessione "{name}"?',"cell-on":"tmux vivo","cell-off":"spenta","cell-working":"al lavoro","cell-idle":"in attesa","cell-degraded":"degradata: unit attiva, tmux morto","power-on":"accendi","power-off":"spegni","boot-enable":"attiva al boot","boot-disable":"disattiva al boot","state-on":"accesa","state-off":"spenta",engine:"Engine",model:"Modello","model-default":"Modello predefinito del provider","model-remembered":"Ultimo modello usato con questo engine","boot-persist":"avvia al boot","remove-boot":"togli anche dal boot","power-config-in-settings":"Engine, provider, profilo, modello e permessi si modificano in Impostazioni → Flotta.","no-remote-control":"⚠ engine non-native: niente RC da app claude.ai (da qui la piloti comunque)",cancel:"annulla",name:"nome","name-invalid":"nome non valido: a-zA-Z0-9._- max 64, senza '-' iniziale",cwd:"cartella",browse:"sfoglia","fs-home":"home","fs-parent":".. su",preset:"preset","preset-2x2":"griglia 2×2","preset-columns":"colonne","preset-equalize":"equalizza",collapse:"comprimi",expand:"espandi",create:"crea","auth-prompt":"Incolla il token (stampato dal server):","remember-device":"ricorda su questo device","zoom-out":"testo più piccolo","zoom-in":"testo più grande",composer:"composer",windows:"{n} finestre","empty-files":"vuota",upload:"carica","no-sessions-short":"nessuna sessione","composer-placeholder":"scrivi o detta…","composer-history-tools":"cronologia e dimensione input","composer-history":"cronologia della cella","composer-history-empty":"nessun input inviato","composer-history-clear":"cancella cronologia di questa cella","composer-expand":"espandi input","composer-collapse":"riduci input","composer-clear-data":"cancella bozze e cronologia","composer-clear-data-help":"Rimuove da questo browser tutte le bozze e la cronologia input delle celle.","composer-clear-confirm":"Cancellare tutte le bozze e la cronologia input salvate in questo browser?","composer-clear-done":"Bozze e cronologia cancellate.","composer-clear-failed":"Impossibile cancellare i dati del composer in questo browser.",attach:"allega","attach-file":"File","attach-camera":"Fotocamera","attach-gallery":"Galleria","attach-uploading":"carico…","attach-upload-progress":"allegato {n}/{total}…","attach-uploaded":"{n} allegati caricati",voice:"voice",send:"invia","composer-send-failed":"connessione non pronta — testo conservato, riprova",close:"chiudi","lang-label":"lingua",decks:"deck","new-deck":"nuovo deck","deck-name":"nome deck","open-deck-window":"apri in una nuova finestra","detach-deck":"stacca in una nuova finestra","deck-current":"questo deck (finestra corrente)","deck-owner-unavailable":"nodo owner non condiviso o non raggiungibile","rename-deck":"rinomina deck","delete-deck":"elimina deck","delete-deck-confirm":'Eliminare il deck "{name}"?',"send-to-deck":"manda al deck…","deck-autosave":"salvataggio automatico",saving:"salvataggio…",saved:"salvato","popup-blocked":"popup bloccato: apri qui","expand-owner":"espandi i deck di {owner}","collapse-owner":"comprimi i deck di {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} deck","dot-working":"in uso (finestra attiva)","dot-on":"aperta in background","dot-neutral":"non aperta","dot-warn":"nodo offline","select-drag":"trascina per selezionare","copy-manual":"seleziona e copia manualmente","toggle-sidebar":"mostra/nascondi la barra laterale",settings:"impostazioni","tab-roles":"ruoli","tab-nodes":"nodi",local:"Locale",location:"Dove","pairing-link":"link di pairing","pairing-required":"nome, alias SSH e link di pairing sono obbligatori","pairing-connect-help":"Per collegare un nodo servono: nome, Host SSH già funzionante e link/QR creato sull’altra installazione NexusCrew.","pairing-localhost-hint":"127.0.0.1 nel link è corretto: non aprirlo qui. NexusCrew usa invito e porta attraverso l’Host SSH.","scan-qr":"scansiona QR","pairing-qr-invalid":"QR di pairing non valido","invite-node":"invita un nodo","create-pairing-link":"crea link / QR","visibility-network":"tutta la rete","visibility-relay":"solo relay","visibility-selected":"nodi selezionati","hydra-simple":"locale + nodi, una sola rete","local-ready":"Questo dispositivo è pronto. Puoi usarlo da solo o collegarlo a un nodo.","local-only":"solo locale","add-node":"aggiungi nodo",connect:"collega","node-connected":"Nodo collegato. La rete verrà sincronizzata automaticamente.","tab-system":"sistema","tab-fleet":"flotta","tab-audio":"audio","system-general":"generale","system-diagnostics":"diagnostica","system-this-node":"questo nodo","system-updates":"aggiornamenti","system-security":"sicurezza","system-local-data":"dati locali del browser","system-terminal":"terminale","alternate-screen":"schermo alternato","alternate-screen-help":"Mantiene il comportamento tmux standard per le nuove sessioni NexusCrew. Un’applicazione che segue il mouse scorre da sé; le altre fanno scorrere la storia di tmux. Non modifica le celle già attive.","tab-input":"input","tab-diagnostics":"diagnostica","input-settings-local":"Preferenze locali di questo browser. Si applicano subito a vista singola e deck, senza modificare il nodo remoto.","terminal-keyboard-gesture":"Apertura tastiera virtuale dal terminale","terminal-keyboard-double-tap":"Doppio tap (predefinito)","terminal-keyboard-single-tap":"Tap singolo","terminal-keyboard-never":"Mai dal terminale","terminal-keyboard-gesture-help":"Il tastierino e STT seguono i controlli separati sotto. Mouse e tastiera fisica restano utilizzabili.","keybar-ime-lock":"Tastierino: mantieni chiusa la tastiera virtuale","keybar-ime-lock-help":"ESC, frecce, PgUp/PgDn, Enter e menu inviano direttamente al PTY senza dare focus a un campo di testo.","voice-ime-lock":"Microfono STT: mantieni chiusa la tastiera virtuale","voice-ime-lock-help":"Il tap sul microfono avvia o ferma la voce senza focalizzare il composer.","keybar-enter-show":"Mostra Enter verticale nel tastierino","keybar-enter-show-help":"Enter resta a destra di PgUp/PgDn ed è alto quanto entrambe le righe.","keybar-layout":"Layout tastierino","keybar-layout-full":"Esteso (predefinito)","keybar-layout-compact":"Compatto","keybar-layout-help":"Compatto: una riga con expand ⊞ per accedere al set completo senza cambiare la preferenza.","input-settings-reset":"ripristina predefiniti input","diagnostics-local":"Questo nodo","diagnostics-target":"Nodo da diagnosticare","diagnostics-verbose":"Log verbosi temporanei","diagnostics-duration":"Durata verbose","diagnostics-expires":"Verbose attivo fino alle {time}","diagnostics-off":"Verbose spento; warning ed errori operativi restano disponibili.","diagnostics-level":"Livello","diagnostics-all-levels":"tutti i livelli","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"scorrimento automatico","diagnostics-log":"Log diagnostico sanitizzato","diagnostics-empty":"Nessun evento diagnostico.","diagnostics-export":"esporta JSON","diagnostics-export-failed":"Esportazione non disponibile in questo browser.","diagnostics-clear":"svuota","diagnostics-clear-confirm":"Svuotare il buffer diagnostico di questo nodo?","diagnostics-unsupported":"Questo peer è offline o non supporta la diagnostica strutturata.","fleet-editor-loading":"Caricamento dell'editor Fleet…","fleet-editor-load-error":"Impossibile caricare l'editor Fleet.","fleet-editor-unavailable":"Editor Fleet non disponibile in questa posizione.","fleet-managed":"gestito da NexusCrew","fleet-custom":"comando personalizzato","fleet-managed-help":"Client, provider e avvio sono gestiti internamente; i segreti non vengono mostrati.","fleet-shell-engine-help":"Shell locale risolta sul dispositivo al momento dell’avvio; nessun percorso viene salvato nel backup.","fleet-shell-command-placeholder":"comando opzionale, es. npm test","fleet-shell-command-help":"Esecuzione tramite shell login interattiva (-lic), con PATH e alias utente. La cella si ferma quando il comando termina; gli errori immediati vengono segnalati.","fleet-shell-command-metachar":"Pipe, redirect, variabili e altri metacaratteri vengono interpretati dalla shell del dispositivo.","fleet-shell-interactive":"Vuoto: apre una shell interattiva locale e mantiene la cella attiva.","fleet-shell-launch-help":"Il comando Shell si configura nella cella da Impostazioni → Flotta.","fleet-credential-title":"API key su questo dispositivo","fleet-credential-help":"La key resta solo sul nodo selezionato, non viene mostrata, esportata o condivisa con la rete.","fleet-credential-set":"imposta key","fleet-credential-change":"cambia key","fleet-credential-forget":"dimentica","fleet-credential-saved":"Key salvata localmente.","fleet-credential-removed":"Key locale rimossa.","fleet-credential-remove-confirm":"Rimuovere la key locale {key}?","fleet-credential-source-environment":"ambiente","fleet-credential-source-local":"store locale","fleet-credential-source-compatibility":"config compatibile","fleet-credential-source-missing":"mancante","fleet-credential-source-policy":"origine credenziale","fleet-credential-source-policy-auto":"auto (precedenza legacy)","fleet-credential-source-policy-nexuscrew-store":"solo store NexusCrew","fleet-credential-source-policy-environment":"solo ambiente","fleet-key-section":"KEY","fleet-key-variable":"Variabile","fleet-key-value":"Valore per {key}","fleet-key-used-by":"Usata da: {engines}","fleet-key-used-by-none":"Non ancora usata da engine configurati su questo nodo.","fleet-key-shared-impact":"Sostituire o rimuovere {key} interessa tutti gli engine elencati: {engines}.","fleet-key-enter":"inserisci la key","fleet-key-blank-keeps":"vuoto = mantieni la fonte attuale","fleet-key-reveal":"mostra","fleet-key-hide":"nascondi","fleet-key-local-help":"Il valore resta write-only sul nodo selezionato e non entra in engine, backup o federazione.","fleet-key-create-missing":"Crea esplicitamente l’engine senza key (resterà “key richiesta”).","fleet-key-partial-create":"Engine creato; la key non è stata salvata. Puoi riprovare senza creare duplicati.","fleet-key-partial-edit":"Engine aggiornato; la key non è stata salvata. Le modifiche all’engine restano applicate.","fleet-provider-notice-claude-openrouter":"Claude Code è ottimizzato per modelli Anthropic: altri provider potrebbero non funzionare correttamente. Fast mode richiede il provider Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses è beta e stateless; Codex-VL non usa fallback Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configurazione Claude isolata con onboarding e fast mode dedicati; la configurazione Claude nativa non viene modificata.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY dal credential layer locale; qwen3.8-max-preview è il modello predefinito e non viene usato alcun fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa il login del CLI (device-code) e la propria configurazione: NexusCrew non legge né copia credenziali. Distinto dal provider "Kimi Code" di Claude Code, che resta il percorso K3 gestito.',"fleet-model-default":"modello predefinito (opzionale)","fleet-model-required":"modello (obbligatorio)","fleet-standard-permissions":"permessi standard","fleet-unsafe-permissions":"non sicuro · ignora approvazioni/sandbox","fleet-unsafe-warning":"Modalità non sicura esplicita: il worker può agire senza le normali approvazioni o protezioni sandbox.","fleet-provider-display":"nome visualizzato del provider","fleet-custom-provider-default":"Provider personalizzato","fleet-api-key-env":"NOME_VARIABILE_API_KEY","fleet-provider-id":"id-provider","fleet-custom-secret-help":"NexusCrew salva solo il nome della variabile d’ambiente, mai il suo valore.","fleet-model-override":"modello alternativo","fleet-ready":"pronto","fleet-not-ready":"non configurato","fleet-engines":"Engine","fleet-cells":"Celle / sessioni cloud","fleet-backup":"backup / ripristino","fleet-backup-help":"Esporta o ripristina selettivamente engine, celle e system prompt. Token, API key e segreti provider non entrano mai nel file.","fleet-backup-export":"esporta","fleet-backup-import":"importa","fleet-backup-download":"scarica backup","fleet-backup-restore":"ripristina selezionate","fleet-backup-import-help":"Scegli un backup JSON, controlla le celle e seleziona l’engine di destinazione prima del ripristino.","fleet-backup-overwrite":"sovrascrive la cella esistente","fleet-backup-new":"nuova cella","fleet-backup-engine-missing":"scegli un engine disponibile","fleet-backup-restore-unavailable":"Il nodo selezionato supporta solo l’esportazione; aggiornalo per ripristinare backup.","fleet-backup-restored":"{n} celle ripristinate","fleet-backup-confirm-overwrite":"Sovrascrivere queste celle? {cells}","fleet-backup-needs-restart":"riavvio necessario: {cells}","fleet-backup-empty":"nessuna cella da esportare","fleet-backup-select-one":"seleziona almeno una cella","fleet-backup-too-large":"backup troppo grande (massimo 1 MB)","fleet-backup-invalid-json":"il file non contiene JSON valido","fleet-backup-invalid-format":"formato o versione del backup non supportati","fleet-backup-invalid-cell":"il backup contiene una cella non valida","fleet-backup-duplicate-cell":"il backup contiene ID cella duplicati","fleet-backup-invalid-engine":"il backup contiene un engine non valido","fleet-backup-duplicate-engine":"il backup contiene ID engine duplicati","fleet-backup-confirm-engine-overwrite":"Sovrascrivere questi engine? I valori ambiente già configurati sul target restano invariati. {engines}","fleet-backup-env-names":"nomi ambiente","fleet-backup-env-values-required":"i valori ambiente vanno configurati sul dispositivo","fleet-system-prompt":"system prompt",characters:"caratteri","select-all":"seleziona tutte","select-none":"nessuna",edit:"modifica",save:"salva",label:"etichetta","command-path":"path assoluto del comando","args-lines":"argomenti, uno per riga","env-write-only":"I valori env sono write-only: vuoto mantiene il valore esistente.","fleet-new-engine":"Nuovo engine","fleet-new-cell":"Nuova cella","fleet-saved":"Definizione salvata.","fleet-restart-confirm":"Modifica salvata. Riavviare ora: {cells}?","fleet-remove-engine":'Eliminare l’engine "{id}"?',"fleet-remove-cell":'Eliminare la cella "{id}"? Se è attiva verrà prima fermata.',"fleet-cwd-needs-repair":"cartella da riparare","fleet-cwd-repair":"ripara","fleet-cwd-repair-title":"Ripara cartella cella {id}","fleet-cwd-repair-help":"La cartella attuale non è portabile su questo dispositivo: appartiene a un altro dispositivo o non esiste sotto la home. Scegli una cartella home-relative (~) sul dispositivo target; il backend ricalcolerà il percorso assoluto.","fleet-cwd-repair-no-source-path":"Il percorso originale non viene mostrato: è specifico del dispositivo di origine.","fleet-cwd-repair-placeholder":"es. Dev","fleet-cwd-repair-preview":"Nuova cartella: {path}","fleet-cwd-repair-browse":"sfoglia sotto ~","fleet-cwd-repair-fs-empty":"nessuna sottocartella","fleet-cwd-repair-use-current":"usa questa cartella","fleet-cwd-repair-invalid":'percorso non valido: niente assoluto, "..", barra rovesciata o lettera disco',"fleet-cwd-repair-confirm":"Impostare la cartella della cella {id} su {path}? Verrà ricalcolata sul dispositivo target.","fleet-cwd-repair-unportable":"Il percorso scelto non è portabile su questo dispositivo: deve esistere sotto la home.","fleet-cwd-repair-suggestion":"Suggerimento dal dispositivo:","fleet-cwd-repair-use-suggestion":"usa {path}","fleet-cwd-repaired":"Cartella della cella riparata.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: conferma la custom API key (Yes) nel terminale della cella, poi riavvia la cella.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: nel terminale della cella apri /config e abilita "Use custom API key", poi riavvia la cella. Se la chiave è cambiata, aggiorna la credenziale e riprova.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: nel terminale della cella esegui /login (device-code Kimi) oppure /provider, poi riavvia la cella.","fleet-recovery-client-terminal-dialog":"Completa il dialogo mostrato nel terminale della cella, poi riavvia la cella.","settings-readonly":"READONLY attivo: le modifiche sono bloccate dal server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"questa macchina guarda altri nodi via tunnel SSH","role-node":"nodo (raggiungibile)","published-port":"porta pubblicata (opzionale)","no-nodes":"nessun nodo remoto configurato","node-add":"collega installazione NexusCrew","node-connect-help":"La porta SSH serve a raggiungere il server SSH. La porta NexusCrew è invece la porta locale mostrata da `nexuscrew status` sul nodo remoto.","node-name-label":"Nome del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH su questo dispositivo","node-ssh-local-help":"Puoi sostituire l’indirizzo del link con lo stesso alias che funziona usando ssh su questo dispositivo. Alias, agent e chiavi restano locali e non viaggiano nel link.","node-ssh-port-label":"Porta SSH","node-ssh-port-help":"Di solito 22; usa la porta pubblica del server SSH.","node-app-port-label":"Porta NexusCrew sul nodo","node-app-port-help":"È la porta mostrata da `nexuscrew status` sul nodo remoto.","node-name-ph":"nome (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"porta remota (opz.)","node-remove-confirm":'Rimuovere il nodo "{name}"?',"node-remove-warning":"Elimina associazione, credenziali e tunnel locale. Non spegne il dispositivo remoto.","peer-inventory-title":"Nodi collegati al hub","peer-group-hubs":"Hub diretti","peer-group-clients":"Client collegati","peer-group-routed":"Nodi raggiungibili tramite la rete","peer-group-vl":"Nodi VL","vl-owners-unavailable":"Owner VL non raggiunti","peer-routed":"instradato","peer-routed-stale":"instradato, non raggiungibile","peer-visibility":"Visibilità nella rete","node-test":"test","tunnel-start":"avvia tunnel","tunnel-stop":"ferma tunnel","tunnel-restart":"riavvia tunnel","share-node":"Condividi questo nodo","share-local-heading":"Condivisione di questo dispositivo","share-local-hub":"Hub di condivisione","share-local-through":"Condividi {device} tramite {hub}","share-local-active":"Condiviso e raggiungibile dalla rete collegata all’hub.","share-local-pending":"Condivisione richiesta, ma il tunnel è giù: questo dispositivo non è ancora raggiungibile.","share-local-private":"Privato: solo questo dispositivo può usare il collegamento all’hub.","share-local-private-down":"Privato, ma il collegamento all’hub è giù. Riconnetti per applicare e verificare la modalità privata.","share-local-reconnect":"Riconnetti e riconcilia","share-off-hub-reconcile-pending":"Stato privato salvato; la revoca sull’hub è ancora in attesa.","fleet-cell-label":"nome leggibile (facoltativo)","share-off-local-reconcile-pending":"Revoca confermata dall’hub; il tunnel locale deve ancora riconciliarsi.","share-reverse-pool-pending":"Il canale reverse non risulta spento in modo dimostrabile: resta in quarantena, non chiuso.","share-node-off-desc":"Privato: resta collegato al nodo hub, ma gli altri client non possono raggiungerlo.","share-node-on-desc":"Condiviso: il nodo hub può mostrarlo e smistare celle e deck autorizzati.","peer-shared":"Nodo client condiviso nella rete Hydra","peer-private":"Nodo client privato: collegato, non pubblicato nella rete Hydra","peer-vl-federated":"Nodo VL: federato","row-vl-federated":"federato","node-connected-client":"client collegato","transport-used":"in uso","tunnel-up":"tunnel su","tunnel-down":"tunnel giù","vl-poll-online":"online (poll)","vl-poll-offline":"non risponde","authorized-keys-hint":"incolla questa riga in ~/.ssh/authorized_keys sull'host remoto:",copy:"copia",copied:"copiato","token-rotate":"ruota token","token-rotate-explain":"Il nuovo token NON verrà mostrato: recuperalo con `nexuscrew show token`. La sessione corrente verrà invalidata.","service-regenerate":"rigenera service","npm-auto-update":"aggiornamenti automatici da npm","npm-auto-update-help":"Controlla periodicamente latest e installa solo versioni più recenti. Mai downgrade.","npm-update-current":"installata","npm-update-latest":"npm latest","npm-update-check":"controlla ora","npm-update-install":"aggiorna ora","npm-update-restarting":"Aggiornamento avviato; NexusCrew si riaprirà dopo il riavvio del servizio.","npm-update-idle":"aggiornato","npm-update-checking":"controllo in corso","npm-update-available":"aggiornamento disponibile","npm-update-installing":"installazione in corso","npm-update-installed":"installato, riavvio in corso","npm-update-error":"controllo fallito","npm-update-unsupported":"disponibile solo con installazione npm globale","service-installed":"service installato","service-missing":"service non installato","service-active":"attivo","service-inactive":"non attivo",confirm:"conferma",add:"aggiungi",enable:"attiva","wizard-title":"benvenuto in NexusCrew","wizard-skip":"configura dopo dai settings","wizard-step-roles":"ruoli di questa installazione","wizard-step-node":"primo nodo remoto (opzionale)","wizard-done":"tutto pronto","wizard-done-desc":"setup completato — puoi cambiare tutto dai settings",next:"continua",back:"indietro",skip:"salta",finish:"fine","err-node-name":"nome non valido (a-z, 0-9, -, max 32)","err-local-name":"nome locale non valido: usa uno slug univoco, non “localhost”","err-ssh":"ssh non valido (atteso user@host o alias)","err-port":"porta non valida (1–65535)","err-ssh-port":"porta SSH non valida (1–65535)","err-node-port":"porta NexusCrew non valida (1–65535)","node-sessions":"{n} sessioni","tunnel-down-since":"tunnel giù da {t}","node-unreachable":"nodo non raggiungibile","node-passive":"client offline · stato normale","node-offline":"nodo offline","node-offline-seen":"offline · visto {t} fa","node-needs-repair":"legacy · ripeti il pairing","asks-title":"domande dalle celle","ask-dismiss":"Scarta la domanda","ask-reply-ph":"scrivi la risposta…","push-enable":"attiva notifiche push","push-disable":"disattiva notifiche push","push-on":"push attive su questo device","push-off":"push non attive","push-denied":"permesso notifiche negato dal browser","push-unsupported":"push non supportate in questo browser","notification-speech-enable":"leggi le notifiche ad alta voce","notification-speech-help":"Usa la voce del browser solo per nuove notifiche mentre questa PWA è visibile e in primo piano. Con l’app chiusa resta la notifica di sistema.","notification-speech-test":"prova voce","notification-speech-testing":"prova in corso…","notification-speech-preview":"NexusCrew. Notifiche vocali attive.","notification-speech-preview-ok":"Prova vocale completata.","notification-speech-preview-failed":"Il browser non ha avviato la prova vocale. Interagisci con la pagina e riprova.","notification-speech-needs-test":"Per questa sessione dell’app, premi “prova voce” prima di ricevere annunci vocali.","notification-speech-unsupported":"Sintesi vocale non supportata in questo browser.","audio-title":"Audio nativo del nodo","audio-help":"Consenso e controlli valgono solo per questo dispositivo. Share e visibilità non autorizzano suoni.","audio-consent":"consenti TTS su questo nodo","audio-consent-help":"Permette a celle autorizzate, locali o remote, di consegnare un comando vocale. Puoi revocarlo in ogni momento.","audio-capability":"Capability locale","audio-loading":"leggo lo stato audio locale…","audio-adapter":"adapter","audio-adapter-none":"nessuno","audio-installed":"installato","audio-installed-yes":"sì","audio-installed-no":"no","audio-liveness":"disponibilità","audio-liveness-ready":"pronto ad accettare","audio-liveness-unavailable":"non disponibile","audio-languages":"lingue dichiarate","audio-limits":"limiti","audio-test":"prova audio locale","audio-testing":"prova in corso…","audio-stop":"ferma audio locale","audio-stopping":"stop in corso…","audio-test-needs-consent":"Attiva il consenso locale prima di provare la voce.","audio-unavailable":"Nessun adapter TTS nativo disponibile su questo nodo.","audio-test-accepted":"Il nodo ha accettato la prova. Non dimostra che qualcuno l’abbia udita.","audio-test-refused":"Il nodo ha rifiutato la prova.","audio-test-unknown":"Esito della prova sconosciuto: il nodo non può confermare l’avvio.","audio-stop-stopped":"Audio locale fermato.","audio-stop-idle":"Nessun enunciato locale da fermare.","audio-groups-title":"Gruppi audio condivisi","audio-groups-help":"Decide su quali dispositivi si sente la voce quando una cella parla. Il gruppo è una preferenza locale di consegna, non un consenso. Ogni nodo conserva consenso, ACL, disponibilità e Stop locale.","audio-groups-empty":"Nessun gruppo: la voce esce solo su questo nodo.","audio-group-name":"nome gruppo","audio-group-mode":"modalità consegna","audio-group-primary":"primo disponibile (in ordine)","audio-group-fanout":"tutti i nodi elencati","audio-group-targets":"nodi target esatti","audio-group-local":"questo nodo","audio-group-unavailable-target":"non rilevato ora","audio-group-no-targets":"Nessun nodo con instanceId disponibile. Il gruppo non può usare nomi, wildcard o “tutti”.","audio-group-new":"nuovo gruppo","audio-group-edit":"modifica","audio-group-delete":"elimina","audio-group-save":"salva gruppo","audio-group-cancel":"annulla","audio-group-invalid":"Il gruppo richiede un nome valido e almeno un nodeId esatto.","audio-group-save-failed":"Salvataggio gruppo audio non riuscito.","node-display-label":"Nome (etichetta)","routed-node-aliases":"Alias nodi instradati","routed-node-aliases-help":"Visibili solo su questo dispositivo; route e nome remoto non cambiano.","node-local-alias":"Alias su questo dispositivo","alias-on-device":"Alias su questo dispositivo","reset-alias":"Ripristina nome remoto","node-slug-hint":"routing su slug: {slug}","device-name-label":"Nome dispositivo","device-name-hint":"come ti vedono i peer (modificabile)","local-route-name-label":"Nome locale / route","local-route-name-hint":"handle tecnico stabile: label leggibile + suffisso del nodeId; modificabile prima della connessione","err-label":"etichetta non valida (max 64 char, niente a capo)","fleet-inventory":"Celle e sessioni","fleet-inventory-help":"tutte le posizioni (Locale + route Hydra)","fleet-manage-location":"Gestisci posizione","fleet-network-overview":"Panoramica rete","fleet-manage-help":"crea e configura celle nella posizione selezionata","fleet-overview-help":"stato operativo di tutte le posizioni, senza duplicare l’editor","fleet-inventory-empty":"nessuna cella o sessione","cell-switcher-refreshing":"aggiorno le celle…","cell-switcher-empty-active":"nessuna cella attiva verificata","cell-switcher-not-confirmed":"stato non confermato","cell-switcher-not-active":"questa cella non è più attiva","cell-switcher-select":"seleziona una cella","cell-switcher-open":"apri cella","cell-switcher-show-all":"tutte","cell-switcher-show-active":"attive","cell-switcher-close":"chiudi selettore celle","fleet-not-available":"fleet non disponibile su questa posizione",start:"avvia",stop:"ferma",restart:"riavvia",delete:"elimina","copy-manual":"copia non riuscita — seleziona e Cmd+C, o copia a mano","copy-empty":"niente selezione: trascina con Shift per selezionare","selection-held":"evidenziazione persa, testo ancora in mano","invite-hub-only":"Un invito si conia sull’hub. Ammettere un nodo nuovo è la sola cosa che un nodo collegato non può chiedere per conto di un altro: apri NexusCrew sull’hub e crea l’invito da lì.","row-private":"privato","node-detail-open":"apri il dettaglio","node-detail-reach":"Raggiungibilità","node-detail-route":"percorso","node-detail-ssh":"SSH","node-detail-transport":"trasporto","node-detail-owner":"owner","node-detail-authority":"Cosa può fare questo nodo","authority-owner-equivalent":"Autorità pari alla tua: un nodo accoppiato può fare su questa macchina tutto quello che puoi fare tu.","authority-routed":"Non è accoppiato con questa macchina: la sua autorità vive presso l’hub che lo instrada.","authority-no-grants":"I poteri per-nodo non esistono ancora: qui non c’è niente da concedere o togliere.","node-detail-network-view":"Cosa vede di questa rete","node-detail-command":"Comando","vl-no-commands":"Il device non dichiara comandi disponibili.","vl-events-title":"Sessione","vl-events-empty":"Nessun evento in memoria: la sessione non ha ancora parlato, oppure quello che ha detto è uscito dal buffer. La storia resta sul device.","vl-events-gap":"eventi non ricevuti:","vl-events-truncated":"contenuto troncato dal device","vl-events-turn-end":"— fine turno —","vl-events-done":"— sessione conclusa —","vl-events-writer-epoch":"— cambio scrittore —","vl-events-tool":"strumento","vl-events-tool-ok":"concluso","vl-events-tool-failed":"fallito","vl-events-usage":"consumo aggiornato","vl-events-stale":"Aggiornamento non riuscito: quello che vedi potrebbe non essere l’ultimo.","vl-cmd-phase-submitted":"inviato, in attesa di conferma","vl-cmd-phase-inflight":"in corso","vl-cmd-phase-done-ok":"completato","vl-cmd-phase-done-error":"fallito","vl-cmd-status":"stato","vl-cmd-health":"salute","vl-cmd-start":"avvia","vl-cmd-stop":"ferma","vl-cmd-restart":"riavvia","vl-cmd-version":"versione","vl-cmd-capabilities":"capacità","vl-cmd-logs":"log","vl-cmd-unpair":"disaccoppia","node-grant-none":"Nessun nodo scelto: condiviso, ma verso nessuno.","node-grant-unknown":"non più in inventario","node-grant-remove":"togli","node-grant-add":"Aggiungi un nodo","node-grant-search":"Cerca fra i nodi","node-grant-no-candidates":"Nessun nodo corrisponde.","single-view":"vista singola",retract:"riduci","keybar-expand":"espandi la barra tasti","keybar-retract":"riduci la barra tasti","save-and-start":"salva e avvia",permissions:"Permessi","power-on-hint":"Spegni la cella; puoi anche toglierla dal boot.","launch-engine-help":"Provider, credenziali e nuovi engine si creano in Impostazioni → Flotta. Modello e permessi sono per questa cella.","launch-unavailable-hint":"Configurazione engine non disponibile su questo nodo.","import-as-cell":"Importa come cella","import-help":"Riconcilia una sessione tmux esistente in una cella gestita. Scegli un engine già dichiarato: nessun engine viene inventato.","import-engine-required":"scegli un engine (obbligatorio)","test-and-connect":"testa e collega","pairing-v2-hint":"Incolla o scansiona UN solo link: precompila nome, Host SSH ed etichetta quando il link li include (v2).","invite-v2-hint":"Crea un invito monouso completo. Se sei già collegato a un hub, viene usato automaticamente; altrimenti serve solo il suo indirizzo SSH raggiungibile.","invite-network-hint":"Crea un invito per la rete a cui sei già collegato. Il nuovo dispositivo entrerà attraverso l’hub, non si collegherà direttamente a questo dispositivo.","invite-network-label":"Rete di destinazione","invite-network-via":"Hub","invite-network-route":"Un solo collegamento verso l’hub; nodi, celle e deck vengono smistati internamente.","invite-endpoint-label":"Indirizzo SSH di questo hub visto dagli altri dispositivi","invite-endpoint-auto":"Endpoint già configurato","invite-endpoint-needed":"Inserisci user@host o un alias SSH condiviso. Non è 127.0.0.1 e non è l’URL HTTP NexusCrew.","invite-ssh-hint":"Il target SSH con cui L’ALTRO dispositivo raggiunge QUESTA installazione (user@host o alias). Obbligatorio: viene incluso nel link.","invite-next-steps":"copia questo link, apri NexusCrew sull’altro dispositivo e incollalo in Impostazioni → Nodi (o scansiona il QR): al resto pensa NexusCrew","pair-card-title":"collega con un solo link","pair-card-help":"Incolla il link di pairing generato sull’altro dispositivo (o scansiona il suo QR): NexusCrew decodifica, prova la connessione SSH e collega da solo.","pair-paste-ph":"incolla qui il link di pairing","pair-paste-btn":"incolla","pair-advanced":"avanzate / modifica","pair-progress":"collegamento in corso: SSH → invito → conferma → verifica…","pair-retry":"riprova","pair-invalid-link":"questo non è un link di pairing valido","pair-invalid-hint":"serve il link completo (http://…#pair=…) generato dall’altro NexusCrew: non aprirlo, incollalo qui","pair-missing-ssh":"il link non include il target SSH (formato v1): indica in “avanzate” come questo dispositivo raggiunge l’altro via SSH — non viene mai inventato","pair-missing-name":"manca il nome del nodo: completalo in “avanzate”","pair-clipboard-denied":"lettura degli appunti non consentita: incolla manualmente nel campo","pair-clipboard-empty":"appunti vuoti: copia prima il link di pairing","pair-stage-validation":"dati non validi","pair-stage-conflict":"nome già in uso","pair-stage-ssh-start":"avvio del tunnel SSH fallito","pair-stage-ssh-ready":"peer non raggiungibile via SSH","pair-stage-join":"scambio dell’invito fallito","pair-stage-tunnel-final":"tunnel negoziato fallito","pair-stage-confirm":"conferma del pairing fallita","pair-stage-health":"verifica finale della federazione fallita","pair-stage-internal":"errore interno","pair-stage-generic":"connessione fallita","qr-no-camera":"nessuna camera disponibile su questo dispositivo: usa una foto del QR","qr-permission":"permesso camera negato: consentilo nel browser o usa una foto del QR","qr-unsupported":"scanner live non supportato qui: carica una foto del QR","qr-upload":"usa una foto"},en:{"update-available":"new version {v} available","install-version-mismatch":"incomplete installation: frontend and server do not match (v{v})",reload:"reload","grid-empty":"drag a session here from the sidebar, or double-click for single view","grid-full":"a deck can show at most 9 sessions",pin:"pin to top",reorder:"reorder","reorder-help":"drag the handle; keyboard up/down arrows","rename-node":"rename node","rename-node-prompt":"New node name in NexusCrew","rename-node-invalid":"Invalid name: maximum 64 characters, no line breaks.","reorder-deck-help":"drag the deck; keyboard left/right arrows",sessions:"sessions","new-session":"new session",new:"new",fleet:"Fleet","fleet-tmux":"tmux fleet","other-sessions":"Other sessions","view-all":"all","view-pinned":"pinned","view-active":"active","view-off":"off","view-technical":"technical","mark-technical":"hide as technical session","mark-normal":"show as normal session","position-local":"Local",files:"files",refresh:"refresh","filter-placeholder":"filter sessions…","loading-fleet":"loading fleet…","no-sessions":"no live tmux sessions — the fleet starts at boot (systemd)","no-match":'no session matches "{q}"',"copy-url":"click to copy URL","ssh-only":"SSH/VPN tunnel only","new-files-outbox":"new files in outbox",terminate:"terminate","terminate-confirm":'Terminate session "{name}"?',"cell-on":"tmux alive","cell-off":"off","cell-working":"working","cell-idle":"idle","cell-degraded":"degraded: unit active, tmux dead","power-on":"power on","power-off":"power off","boot-enable":"enable at boot","boot-disable":"disable at boot","state-on":"running","state-off":"stopped",engine:"Engine",model:"Model","model-default":"Provider default model","model-remembered":"Last model used with this engine","boot-persist":"start at boot","remove-boot":"also remove from boot","power-config-in-settings":"Edit engine, provider, profile, model and permissions in Settings → Fleet.","no-remote-control":"⚠ non-native engine: no claude.ai app RC (you can still drive it from here)",cancel:"cancel",name:"name","name-invalid":"invalid name: a-zA-Z0-9._- max 64, no leading '-'",cwd:"folder",browse:"browse","fs-home":"home","fs-parent":".. up",preset:"preset","preset-2x2":"2×2 grid","preset-columns":"columns","preset-equalize":"equalize",collapse:"collapse",expand:"expand",create:"create","auth-prompt":"Paste the token (printed by the server):","remember-device":"remember on this device","zoom-out":"smaller text","zoom-in":"bigger text",composer:"composer",windows:"{n} windows","empty-files":"empty",upload:"upload","no-sessions-short":"no sessions","composer-placeholder":"type or dictate…","composer-history-tools":"input history and size","composer-history":"cell history","composer-history-empty":"no submitted input","composer-history-clear":"clear this cell history","composer-expand":"expand input","composer-collapse":"collapse input","composer-clear-data":"clear drafts and history","composer-clear-data-help":"Removes every saved cell draft and input-history entry from this browser.","composer-clear-confirm":"Clear every saved draft and input-history entry from this browser?","composer-clear-done":"Drafts and history cleared.","composer-clear-failed":"Could not clear composer data in this browser.",attach:"attach","attach-file":"File","attach-camera":"Camera","attach-gallery":"Gallery","attach-uploading":"uploading…","attach-upload-progress":"attachment {n}/{total}…","attach-uploaded":"{n} attachments uploaded",voice:"voice",send:"send","composer-send-failed":"connection not ready — text kept, try again",close:"close","lang-label":"language",decks:"decks","new-deck":"new deck","deck-name":"deck name","open-deck-window":"open in a new window","detach-deck":"detach into a new window","deck-current":"this deck (current window)","deck-owner-unavailable":"owner node is not shared or reachable","rename-deck":"rename deck","delete-deck":"delete deck","delete-deck-confirm":'Delete deck "{name}"?',"send-to-deck":"send to deck…","deck-autosave":"autosave",saving:"saving…",saved:"saved","popup-blocked":"popup blocked: open here","expand-owner":"expand {owner} decks","collapse-owner":"collapse {owner} decks","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"in use (active window)","dot-on":"open in background","dot-neutral":"not open","dot-warn":"owner offline","select-drag":"drag to select","copy-manual":"select and copy manually","toggle-sidebar":"show/hide the sidebar",settings:"settings","tab-roles":"roles","tab-nodes":"nodes",local:"Local",location:"Location","pairing-link":"pairing link","pairing-required":"name, SSH alias and pairing link are required","pairing-connect-help":"Connecting a node requires a name, a working SSH Host, and a link/QR created by the other NexusCrew installation.","pairing-localhost-hint":"127.0.0.1 in the link is correct: do not open it here. NexusCrew carries the invite and port through the SSH Host.","scan-qr":"scan QR","pairing-qr-invalid":"invalid pairing QR","invite-node":"invite a node","create-pairing-link":"create link / QR","visibility-network":"whole network","visibility-relay":"relay only","visibility-selected":"selected nodes","hydra-simple":"local + nodes, one network","local-ready":"This device is ready. Use it alone or connect it to a node.","local-only":"local only","add-node":"add node",connect:"connect","node-connected":"Node connected. The network will synchronize automatically.","tab-system":"system","tab-fleet":"fleet","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnostics","system-this-node":"this node","system-updates":"updates","system-security":"security","system-local-data":"local browser data","system-terminal":"terminal","alternate-screen":"alternate screen","alternate-screen-help":"Keeps standard tmux behaviour for new NexusCrew sessions. An application that tracks the mouse scrolls on its own; the others browse the tmux scrollback. It does not change cells already running.","tab-input":"input","tab-diagnostics":"diagnostics","input-settings-local":"Local preferences for this browser. They apply immediately to single view and decks without changing the remote node.","terminal-keyboard-gesture":"Open the virtual keyboard from the terminal","terminal-keyboard-double-tap":"Double tap (default)","terminal-keyboard-single-tap":"Single tap","terminal-keyboard-never":"Never from terminal","terminal-keyboard-gesture-help":"The keypad and STT use the separate controls below. Mouse and physical keyboard remain available.","keybar-ime-lock":"Keypad: keep the virtual keyboard closed","keybar-ime-lock-help":"ESC, arrows, PgUp/PgDn, Enter and menu send directly to the PTY without focusing a text field.","voice-ime-lock":"STT microphone: keep the virtual keyboard closed","voice-ime-lock-help":"Tapping the microphone starts or stops voice without focusing the composer.","keybar-enter-show":"Show the tall Enter keypad key","keybar-enter-show-help":"Enter stays to the right of PgUp/PgDn and spans both rows.","keybar-layout":"Keypad layout","keybar-layout-full":"Full (default)","keybar-layout-compact":"Compact","keybar-layout-help":"Compact: one row with an expand toggle that reaches the full key set without changing the preference.","input-settings-reset":"restore input defaults","diagnostics-local":"This node","diagnostics-target":"Node to diagnose","diagnostics-verbose":"Temporary verbose logs","diagnostics-duration":"Verbose duration","diagnostics-expires":"Verbose enabled until {time}","diagnostics-off":"Verbose is off; operational warnings and errors remain available.","diagnostics-level":"Level","diagnostics-all-levels":"all levels","diagnostics-component":"component","diagnostics-pause":"pause","diagnostics-autoscroll":"autoscroll","diagnostics-log":"Sanitized diagnostic log","diagnostics-empty":"No diagnostic events.","diagnostics-export":"export JSON","diagnostics-export-failed":"Export is not available in this browser.","diagnostics-clear":"clear","diagnostics-clear-confirm":"Clear this node diagnostic buffer?","diagnostics-unsupported":"This peer is offline or does not support structured diagnostics.","fleet-editor-loading":"Loading the Fleet editor…","fleet-editor-load-error":"Unable to load the Fleet editor.","fleet-editor-unavailable":"The Fleet editor is unavailable at this location.","fleet-managed":"managed by NexusCrew","fleet-custom":"custom command","fleet-managed-help":"Client, provider and launch are managed internally; secrets are never displayed.","fleet-shell-engine-help":"The local shell is resolved on the device at launch time; no executable path is stored in backups.","fleet-shell-command-placeholder":"optional command, e.g. npm test","fleet-shell-command-help":"Runs through an interactive login shell (-lic), with the user PATH and aliases. The cell stops when the command finishes; immediate failures are reported.","fleet-shell-command-metachar":"Pipes, redirects, variables, and other metacharacters are interpreted by the device shell.","fleet-shell-interactive":"Empty: opens a local interactive shell and keeps the cell active.","fleet-shell-launch-help":"Configure the Shell command on the cell in Settings → Fleet.","fleet-credential-title":"API key on this device","fleet-credential-help":"The key stays only on the selected node and is never displayed, exported or shared with the network.","fleet-credential-set":"set key","fleet-credential-change":"change key","fleet-credential-forget":"forget","fleet-credential-saved":"Key saved locally.","fleet-credential-removed":"Local key removed.","fleet-credential-remove-confirm":"Remove the local {key} key?","fleet-credential-source-environment":"environment","fleet-credential-source-local":"local store","fleet-credential-source-compatibility":"compatible config","fleet-credential-source-missing":"missing","fleet-credential-source-policy":"credential source","fleet-credential-source-policy-auto":"auto (legacy precedence)","fleet-credential-source-policy-nexuscrew-store":"NexusCrew store only","fleet-credential-source-policy-environment":"environment only","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Value for {key}","fleet-key-used-by":"Used by: {engines}","fleet-key-used-by-none":"Not yet used by configured engines on this node.","fleet-key-shared-impact":"Replacing or removing {key} affects every listed engine: {engines}.","fleet-key-enter":"enter the key","fleet-key-blank-keeps":"blank = keep the current source","fleet-key-reveal":"reveal","fleet-key-hide":"hide","fleet-key-local-help":"The value stays write-only on the selected node and never enters engines, backups or federation.","fleet-key-create-missing":"Explicitly create the engine without a key (it will remain “key required”).","fleet-key-partial-create":"Engine created; the key was not saved. Retry without creating a duplicate.","fleet-key-partial-edit":"Engine updated; the key was not saved. The engine changes remain applied.","fleet-provider-notice-claude-openrouter":"Claude Code is optimized for Anthropic models; other providers may not work correctly. Fast mode requires the first-party Anthropic provider.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses is beta and stateless; Codex-VL has no Chat Completions fallback.","fleet-provider-notice-claude-kimi-code":"Kimi Code uses isolated Claude configuration with dedicated onboarding and fast-mode flags; native Claude configuration is not modified.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal uses only ALIBABA_CODE_API_KEY from the local credential layer; qwen3.8-max-preview is the default and no OpenAI/PAYG fallback is used.","fleet-provider-notice-kimi-native":'Native Kimi Code CLI uses the CLI login (device code) and its own configuration: NexusCrew never reads or copies credentials. Distinct from the Claude Code "Kimi Code" provider, which remains the managed K3 path.',"fleet-model-default":"default model (optional)","fleet-model-required":"model (required)","fleet-standard-permissions":"standard permissions","fleet-unsafe-permissions":"unsafe · bypass approvals/sandbox","fleet-unsafe-warning":"Explicit unsafe mode: the worker can act without normal approval or sandbox gates.","fleet-provider-display":"provider display name","fleet-custom-provider-default":"Custom provider","fleet-api-key-env":"API_KEY_ENV_NAME","fleet-provider-id":"provider-id","fleet-custom-secret-help":"NexusCrew stores only the environment-variable name, never its value.","fleet-model-override":"model override","fleet-ready":"ready","fleet-not-ready":"not configured","fleet-engines":"Engines","fleet-cells":"Cells / cloud sessions","fleet-backup":"backup / restore","fleet-backup-help":"Selectively export or restore engines, cells, and system prompts. Tokens, API keys, and provider secrets never enter the file.","fleet-backup-export":"export","fleet-backup-import":"import","fleet-backup-download":"download backup","fleet-backup-restore":"restore selected","fleet-backup-import-help":"Choose a JSON backup, review the cells and select a destination engine before restoring.","fleet-backup-overwrite":"overwrites existing cell","fleet-backup-new":"new cell","fleet-backup-engine-missing":"choose an available engine","fleet-backup-restore-unavailable":"The selected node supports export only; update it to restore backups.","fleet-backup-restored":"{n} cells restored","fleet-backup-confirm-overwrite":"Overwrite these cells? {cells}","fleet-backup-needs-restart":"restart required: {cells}","fleet-backup-empty":"no cells to export","fleet-backup-select-one":"select at least one cell","fleet-backup-too-large":"backup is too large (1 MB maximum)","fleet-backup-invalid-json":"the file does not contain valid JSON","fleet-backup-invalid-format":"unsupported backup format or version","fleet-backup-invalid-cell":"the backup contains an invalid cell","fleet-backup-duplicate-cell":"the backup contains duplicate cell IDs","fleet-backup-invalid-engine":"the backup contains an invalid engine","fleet-backup-duplicate-engine":"the backup contains duplicate engine IDs","fleet-backup-confirm-engine-overwrite":"Overwrite these engines? Environment values already configured on the target stay unchanged. {engines}","fleet-backup-env-names":"environment names","fleet-backup-env-values-required":"environment values must be configured on this device","fleet-system-prompt":"system prompt",characters:"characters","select-all":"select all","select-none":"select none",edit:"edit",save:"save",label:"label","command-path":"absolute command path","args-lines":"arguments, one per line","env-write-only":"Environment values are write-only: blank keeps the existing value.","fleet-new-engine":"New engine","fleet-new-cell":"New cell","fleet-saved":"Definition saved.","fleet-restart-confirm":"Change saved. Restart now: {cells}?","fleet-remove-engine":'Delete engine "{id}"?',"fleet-remove-cell":'Delete cell "{id}"? If active it will be stopped first.',"fleet-cwd-needs-repair":"folder needs repair","fleet-cwd-repair":"repair","fleet-cwd-repair-title":"Repair cell folder {id}","fleet-cwd-repair-help":"The current folder is not portable on this device: it belongs to another device or does not exist under the home directory. Choose a home-relative (~) folder on the target device; the backend will recompute the absolute path.","fleet-cwd-repair-no-source-path":"The original path is not shown: it is specific to the source device.","fleet-cwd-repair-placeholder":"e.g. Dev","fleet-cwd-repair-preview":"New folder: {path}","fleet-cwd-repair-browse":"browse under ~","fleet-cwd-repair-fs-empty":"no subfolders","fleet-cwd-repair-use-current":"use this folder","fleet-cwd-repair-invalid":'invalid path: no absolute path, "..", backslash or drive letter',"fleet-cwd-repair-confirm":"Set the folder of cell {id} to {path}? It will be recomputed on the target device.","fleet-cwd-repair-unportable":"The chosen path is not portable on this device: it must exist under the home directory.","fleet-cwd-repair-suggestion":"Suggestion from device:","fleet-cwd-repair-use-suggestion":"use {path}","fleet-cwd-repaired":"Cell folder repaired.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirm the custom API key (Yes) in the cell terminal, then restart the cell.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: in the cell terminal open /config and enable "Use custom API key", then restart the cell. If the key changed, update the credential and retry.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: in the cell terminal run /login (Kimi device code) or /provider, then restart the cell.","fleet-recovery-client-terminal-dialog":"Complete the dialog shown in the cell terminal, then restart the cell.","settings-readonly":"READONLY active: changes are blocked by the server (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"this machine watches other nodes via SSH tunnels","role-node":"node (reachable)","published-port":"published port (optional)","no-nodes":"no remote nodes configured","node-add":"connect a NexusCrew installation","node-connect-help":"The SSH port reaches the SSH server. The NexusCrew port is the local port reported by `nexuscrew status` on the remote node.","node-name-label":"Node name","node-ssh-label":"SSH host","pair-ssh-local-label":"SSH host or alias on this device","node-ssh-local-help":"You may replace the link address with the same alias that works with ssh on this device. Aliases, agents and private keys stay local and are never carried in the link.","node-ssh-port-label":"SSH port","node-ssh-port-help":"Usually 22; use the SSH server public port.","node-app-port-label":"NexusCrew port on node","node-app-port-help":"The port reported by `nexuscrew status` on the remote node.","node-name-ph":"name (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"remote port (opt.)","node-remove-confirm":'Remove node "{name}"?',"node-remove-warning":"Deletes the pairing, credentials and local tunnel. It does not power off the remote device.","peer-inventory-title":"Nodes connected to the hub","peer-group-hubs":"Direct hubs","peer-group-clients":"Connected clients","peer-group-routed":"Nodes reachable through the network","peer-group-vl":"VL nodes","vl-owners-unavailable":"VL owners unreachable","peer-routed":"routed","peer-routed-stale":"routed, unreachable","peer-visibility":"Network visibility","node-test":"test","tunnel-start":"start tunnel","tunnel-stop":"stop tunnel","tunnel-restart":"restart tunnel","share-node":"Share this node","share-local-heading":"Share this device","share-local-hub":"Sharing hub","share-local-through":"Share {device} through {hub}","share-local-active":"Shared and reachable by the network connected to the hub.","share-local-pending":"Sharing is requested, but the tunnel is down: this device is not reachable yet.","share-local-private":"Private: only this device can use its hub connection.","share-local-private-down":"Private, but the hub connection is down. Reconnect to apply and verify private mode.","share-local-reconnect":"Reconnect and reconcile","share-off-hub-reconcile-pending":"Private state saved; hub revocation is still pending.","fleet-cell-label":"readable name (optional)","share-off-local-reconcile-pending":"Hub revocation confirmed; the local tunnel still needs reconciliation.","share-reverse-pool-pending":"The reverse channel was not demonstrably shut down: it is quarantined, not closed.","share-node-off-desc":"Private: it stays connected to the hub, but other clients cannot reach it.","share-node-on-desc":"Shared: the hub may advertise it and route authorized cells and decks.","peer-shared":"Client node shared on the Hydra network","peer-private":"Private client node: connected, not published on Hydra","peer-vl-federated":"VL node: federated","row-vl-federated":"federated","node-connected-client":"connected client","transport-used":"in use","tunnel-up":"tunnel up","tunnel-down":"tunnel down","vl-poll-online":"online (poll)","vl-poll-offline":"not responding","authorized-keys-hint":"paste this line into ~/.ssh/authorized_keys on the remote host:",copy:"copy",copied:"copied","token-rotate":"rotate token","token-rotate-explain":"The new token will NOT be shown: retrieve it with `nexuscrew show token`. The current session will be invalidated.","service-regenerate":"regenerate service","npm-auto-update":"automatic updates from npm","npm-auto-update-help":"Periodically checks latest and installs only newer versions. Never downgrades.","npm-update-current":"installed","npm-update-latest":"npm latest","npm-update-check":"check now","npm-update-install":"update now","npm-update-restarting":"Update started; NexusCrew will return after the service restarts.","npm-update-idle":"up to date","npm-update-checking":"checking","npm-update-available":"update available","npm-update-installing":"installing","npm-update-installed":"installed, restarting","npm-update-error":"check failed","npm-update-unsupported":"available only for global npm installations","service-installed":"service installed","service-missing":"service not installed","service-active":"active","service-inactive":"not active",confirm:"confirm",add:"add",enable:"enable","wizard-title":"welcome to NexusCrew","wizard-skip":"configure later from settings","wizard-step-roles":"roles of this install","wizard-step-node":"first remote node (optional)","wizard-done":"all set","wizard-done-desc":"setup complete — you can change everything from settings",next:"continue",back:"back",skip:"skip",finish:"finish","err-node-name":"invalid name (a-z, 0-9, -, max 32)","err-local-name":"invalid local name: use a unique slug, not “localhost”","err-ssh":"invalid ssh (expected user@host or alias)","err-port":"invalid port (1–65535)","err-ssh-port":"invalid SSH port (1–65535)","err-node-port":"invalid NexusCrew port (1–65535)","node-sessions":"{n} sessions","tunnel-down-since":"tunnel down for {t}","node-unreachable":"node unreachable","node-passive":"client offline · expected","node-offline":"node offline","node-offline-seen":"offline · seen {t} ago","node-needs-repair":"legacy · pair again","asks-title":"questions from the cells","ask-dismiss":"Dismiss question","ask-reply-ph":"type your answer…","push-enable":"enable push notifications","push-disable":"disable push notifications","push-on":"push active on this device","push-off":"push not active","push-denied":"notification permission denied by the browser","push-unsupported":"push not supported in this browser","notification-speech-enable":"read notifications aloud","notification-speech-help":"Uses the browser voice only for new notifications while this PWA is visible and in the foreground. When the app is closed, the system notification remains available.","notification-speech-test":"test voice","notification-speech-testing":"testing voice…","notification-speech-preview":"NexusCrew. Spoken notifications are active.","notification-speech-preview-ok":"Voice test completed.","notification-speech-preview-failed":"The browser did not start the voice test. Interact with the page and try again.","notification-speech-needs-test":"For this app session, select “test voice” before spoken alerts can play.","notification-speech-unsupported":"Speech synthesis is not supported in this browser.","audio-title":"Native node audio","audio-help":"Consent and controls apply only to this device. Share and visibility do not authorize sounds.","audio-consent":"allow TTS on this node","audio-consent-help":"Allows authorized local or remote cells to deliver a voice command. You can revoke it at any time.","audio-capability":"Local capability","audio-loading":"reading local audio state…","audio-adapter":"adapter","audio-adapter-none":"none","audio-installed":"installed","audio-installed-yes":"yes","audio-installed-no":"no","audio-liveness":"availability","audio-liveness-ready":"ready to accept","audio-liveness-unavailable":"unavailable","audio-languages":"declared languages","audio-limits":"limits","audio-test":"test local audio","audio-testing":"testing audio…","audio-stop":"stop local audio","audio-stopping":"stopping audio…","audio-test-needs-consent":"Enable local consent before testing the voice.","audio-unavailable":"No native TTS adapter is available on this node.","audio-test-accepted":"The node accepted the test. It does not prove that anyone heard it.","audio-test-refused":"The node refused the test.","audio-test-unknown":"Test outcome unknown: the node could not confirm startup.","audio-stop-stopped":"Local audio stopped.","audio-stop-idle":"No local utterance to stop.","audio-groups-title":"Shared audio groups","audio-groups-help":"Chooses which devices play the voice when a cell speaks. A group is a local delivery preference, not consent. Each node keeps its own consent, ACL, availability and local Stop.","audio-groups-empty":"No group: voice plays only on this node.","audio-group-name":"group name","audio-group-mode":"delivery mode","audio-group-primary":"first available (in order)","audio-group-fanout":"all listed nodes","audio-group-targets":"exact target nodes","audio-group-local":"this node","audio-group-unavailable-target":"not currently discovered","audio-group-no-targets":"No node with an available instanceId. A group cannot use names, wildcards, or “all”.","audio-group-new":"new group","audio-group-edit":"edit","audio-group-delete":"delete","audio-group-save":"save group","audio-group-cancel":"cancel","audio-group-invalid":"A group needs a valid name and at least one exact nodeId.","audio-group-save-failed":"Could not save audio group.","node-display-label":"Name (label)","routed-node-aliases":"Routed node aliases","routed-node-aliases-help":"Visible only on this device; the route and remote name do not change.","node-local-alias":"Alias on this device","alias-on-device":"Alias on this device","reset-alias":"Reset remote name","node-slug-hint":"routing on slug: {slug}","device-name-label":"Device name","device-name-hint":"how peers see you (editable)","local-route-name-label":"Local / route name","local-route-name-hint":"stable technical handle: readable label + nodeId suffix; editable before connecting","err-label":"invalid label (max 64 chars, no line breaks)","fleet-inventory":"Cells and sessions","fleet-inventory-help":"all positions (Local + Hydra routes)","fleet-manage-location":"Manage location","fleet-network-overview":"Network overview","fleet-manage-help":"create and configure cells at the selected location","fleet-overview-help":"operational state of every location, separate from the editor","fleet-inventory-empty":"no cells or sessions","cell-switcher-refreshing":"refreshing cells…","cell-switcher-empty-active":"no verified active cells","cell-switcher-not-confirmed":"status not confirmed","cell-switcher-not-active":"this cell is no longer active","cell-switcher-select":"select a cell","cell-switcher-open":"open cell","cell-switcher-show-all":"all","cell-switcher-show-active":"active","cell-switcher-close":"close cell switcher","fleet-not-available":"fleet not available on this position",start:"start",stop:"stop",restart:"restart",delete:"delete","copy-manual":"copy failed — select and press Cmd+C, or copy manually","copy-empty":"nothing selected: drag with Shift to select","selection-held":"highlight gone, text still held","invite-hub-only":"An invite is minted on the hub. Admitting a new node is the one thing a connected node cannot ask on another’s behalf: open NexusCrew on the hub and create the invite there.","row-private":"private","node-detail-open":"open details","node-detail-reach":"Reachability","node-detail-route":"path","node-detail-ssh":"SSH","node-detail-transport":"transport","node-detail-owner":"owner","node-detail-authority":"What this node can do","authority-owner-equivalent":"Authority equal to yours: a paired node can do on this machine everything you can do.","authority-routed":"Not paired with this machine: its authority lives on the hub that routes it.","authority-no-grants":"Per-node powers do not exist yet: there is nothing to grant or withdraw here.","node-detail-network-view":"What it sees of this network","node-detail-command":"Command","vl-no-commands":"The device declares no commands available.","vl-events-title":"Session","vl-events-empty":"No events in memory: the session has not spoken yet, or what it said has left the buffer. The history stays on the device.","vl-events-gap":"events not received:","vl-events-truncated":"content truncated by the device","vl-events-turn-end":"— end of turn —","vl-events-done":"— session finished —","vl-events-writer-epoch":"— writer changed —","vl-events-tool":"tool","vl-events-tool-ok":"finished","vl-events-tool-failed":"failed","vl-events-usage":"usage updated","vl-events-stale":"Refresh failed: what you see may not be the latest.","vl-cmd-phase-submitted":"sent, awaiting confirmation","vl-cmd-phase-inflight":"in progress","vl-cmd-phase-done-ok":"completed","vl-cmd-phase-done-error":"failed","vl-cmd-status":"status","vl-cmd-health":"health","vl-cmd-start":"start","vl-cmd-stop":"stop","vl-cmd-restart":"restart","vl-cmd-version":"version","vl-cmd-capabilities":"capabilities","vl-cmd-logs":"logs","vl-cmd-unpair":"unpair","node-grant-none":"No node chosen: shared, but towards nobody.","node-grant-unknown":"no longer in the inventory","node-grant-remove":"remove","node-grant-add":"Add a node","node-grant-search":"Search the nodes","node-grant-no-candidates":"No node matches.","single-view":"single view",retract:"retract","keybar-expand":"expand the key bar","keybar-retract":"retract the key bar","save-and-start":"save and start",permissions:"Permissions","power-on-hint":"Stop the cell; you can also remove it from boot.","launch-engine-help":"Providers, credentials and new engines are created in Settings → Fleet. Model and permissions are per cell.","launch-unavailable-hint":"Engine configuration is unavailable on this node.","import-as-cell":"Import as cell","import-help":"Reconcile an existing tmux session into a managed cell. Pick an already-declared engine: no engine is invented.","import-engine-required":"pick an engine (required)","test-and-connect":"test and connect","pairing-v2-hint":"Paste or scan ONE link: it prefills name, SSH host and label when the link carries them (v2).","invite-v2-hint":"Create one complete one-time invitation. If this device already joined a hub, that hub is used automatically; otherwise only its reachable SSH address is required.","invite-network-hint":"Create an invitation for the network you already joined. The new device enters through the hub instead of connecting directly to this device.","invite-network-label":"Destination network","invite-network-via":"Hub","invite-network-route":"One connection to the hub; nodes, cells and decks are routed internally.","invite-endpoint-label":"This hub’s SSH address as seen by other devices","invite-endpoint-auto":"Configured endpoint","invite-endpoint-needed":"Enter user@host or a shared SSH alias. This is not 127.0.0.1 and not the NexusCrew HTTP URL.","invite-ssh-hint":"The SSH target the OTHER device uses to reach THIS installation (user@host or alias). Required: it is included in the link.","invite-next-steps":"copy this link, open NexusCrew on the other device and paste it in Settings → Nodes (or scan the QR): NexusCrew does the rest","pair-card-title":"connect with one link","pair-card-help":"Paste the pairing link generated on the other device (or scan its QR): NexusCrew decodes it, tests the SSH connection and connects on its own.","pair-paste-ph":"paste the pairing link here","pair-paste-btn":"paste","pair-advanced":"advanced / edit","pair-progress":"connecting: SSH → invite → confirm → verify…","pair-retry":"retry","pair-invalid-link":"this is not a valid pairing link","pair-invalid-hint":"you need the full link (http://…#pair=…) generated by the other NexusCrew: don’t open it, paste it here","pair-missing-ssh":"the link carries no SSH target (v1 format): set in “advanced” how this device reaches the other one over SSH — it is never invented","pair-missing-name":"the node name is missing: fill it in “advanced”","pair-clipboard-denied":"clipboard read not allowed: paste manually into the field","pair-clipboard-empty":"clipboard is empty: copy the pairing link first","pair-stage-validation":"invalid data","pair-stage-conflict":"name already in use","pair-stage-ssh-start":"SSH tunnel start failed","pair-stage-ssh-ready":"peer unreachable over SSH","pair-stage-join":"invite exchange failed","pair-stage-tunnel-final":"negotiated tunnel failed","pair-stage-confirm":"pairing confirmation failed","pair-stage-health":"final federation check failed","pair-stage-internal":"internal error","pair-stage-generic":"connection failed","qr-no-camera":"no camera available on this device: use a photo of the QR","qr-permission":"camera permission denied: allow it in the browser or use a photo of the QR","qr-unsupported":"live scanner not supported here: upload a photo of the QR","qr-upload":"use a photo"},es:{"update-available":"nueva versión {v} disponible","install-version-mismatch":"instalación incompleta: frontend y servidor no coinciden (v{v})",reload:"recargar","grid-empty":"arrastra aquí una sesión desde la barra lateral, o doble clic para vista única","grid-full":"un deck puede mostrar como máximo 9 sesiones",pin:"fijar arriba",reorder:"reordenar","reorder-help":"arrastra el control; flechas arriba/abajo","rename-node":"renombrar nodo","rename-node-prompt":"Nuevo nombre del nodo en NexusCrew","rename-node-invalid":"Nombre no válido: máximo 64 caracteres, sin saltos de línea.","reorder-deck-help":"arrastra el deck; flechas izquierda/derecha",sessions:"sesiones","new-session":"nueva sesión",new:"nueva",fleet:"Flota","fleet-tmux":"flota tmux","other-sessions":"Otras sesiones","view-all":"todas","view-pinned":"fijadas","view-active":"activas","view-off":"apagadas","view-technical":"técnicas","mark-technical":"ocultar como sesión técnica","mark-normal":"mostrar como sesión normal","position-local":"Local",files:"archivos",refresh:"actualizar","filter-placeholder":"filtrar sesiones…","loading-fleet":"cargando flota…","no-sessions":"sin sesiones tmux vivas — la flota arranca en el boot (systemd)","no-match":"ninguna sesión coincide con «{q}»","copy-url":"clic para copiar la URL","ssh-only":"solo túnel SSH/VPN","new-files-outbox":"archivos nuevos en outbox",terminate:"terminar","terminate-confirm":"¿Terminar la sesión «{name}»?","cell-on":"tmux activo","cell-off":"apagada","cell-working":"trabajando","cell-idle":"en espera","cell-degraded":"degradada: unit activa, tmux muerto","power-on":"encender","power-off":"apagar","boot-enable":"activar al iniciar","boot-disable":"desactivar al iniciar","state-on":"encendida","state-off":"apagada",engine:"Motor",model:"Modelo","model-default":"Modelo predeterminado del proveedor","model-remembered":"Último modelo usado con este motor","boot-persist":"iniciar en el boot","remove-boot":"quitar también del boot","power-config-in-settings":"Modifica motor, proveedor, perfil, modelo y permisos en Ajustes → Flota.","no-remote-control":"⚠ motor no nativo: sin RC de la app claude.ai (aquí puedes pilotarla igual)",cancel:"cancelar",name:"nombre","name-invalid":"nombre inválido: a-zA-Z0-9._- máx 64, sin '-' inicial",cwd:"carpeta",browse:"explorar","fs-home":"home","fs-parent":".. arriba",preset:"preset","preset-2x2":"cuadrícula 2×2","preset-columns":"columnas","preset-equalize":"igualar",collapse:"contraer",expand:"expandir",create:"crear","auth-prompt":"Pega el token (impreso por el servidor):","remember-device":"recordar en este dispositivo","zoom-out":"texto más pequeño","zoom-in":"texto más grande",composer:"composer",windows:"{n} ventanas","empty-files":"vacía",upload:"subir","no-sessions-short":"sin sesiones","composer-placeholder":"escribe o dicta…","composer-history-tools":"historial y tamaño de entrada","composer-history":"historial de la celda","composer-history-empty":"ninguna entrada enviada","composer-history-clear":"borrar historial de esta celda","composer-expand":"ampliar entrada","composer-collapse":"reducir entrada","composer-clear-data":"borrar borradores e historial","composer-clear-data-help":"Elimina de este navegador todos los borradores y el historial de entrada de las celdas.","composer-clear-confirm":"¿Borrar todos los borradores y el historial de entrada guardados en este navegador?","composer-clear-done":"Borradores e historial eliminados.","composer-clear-failed":"No se pudieron borrar los datos del composer en este navegador.",attach:"adjuntar","attach-file":"Archivo","attach-camera":"Cámara","attach-gallery":"Galería","attach-uploading":"subiendo…","attach-upload-progress":"adjunto {n}/{total}…","attach-uploaded":"{n} adjuntos subidos",voice:"voz",send:"enviar","composer-send-failed":"conexión no disponible — texto conservado, inténtalo de nuevo",close:"cerrar","lang-label":"idioma",decks:"decks","new-deck":"nuevo deck","deck-name":"nombre del deck","open-deck-window":"abrir en una ventana nueva","detach-deck":"separar en una ventana nueva","deck-current":"este deck (ventana actual)","deck-owner-unavailable":"el nodo propietario no está compartido o accesible","rename-deck":"renombrar deck","delete-deck":"eliminar deck","delete-deck-confirm":"¿Eliminar el deck «{name}»?","send-to-deck":"enviar al deck…","deck-autosave":"guardado automático",saving:"guardando…",saved:"guardado","popup-blocked":"ventana bloqueada: abrir aquí","expand-owner":"expandir decks de {owner}","collapse-owner":"comprimir decks de {owner}","owner-deck-count-one":"{count} deck","owner-deck-count-many":"{count} decks","dot-working":"en uso (ventana activa)","dot-on":"abierta en segundo plano","dot-neutral":"no abierta","dot-warn":"nodo sin conexión","select-drag":"arrastra para seleccionar","copy-manual":"selecciona y copia manualmente","toggle-sidebar":"mostrar/ocultar la barra lateral",settings:"ajustes","tab-roles":"roles","tab-nodes":"nodos",local:"Local",location:"Ubicación","pairing-link":"enlace de emparejamiento","pairing-required":"nombre, alias SSH y enlace son obligatorios","pairing-connect-help":"Para conectar un nodo necesitas un nombre, un Host SSH funcional y el enlace/QR creado por la otra instalación NexusCrew.","pairing-localhost-hint":"127.0.0.1 en el enlace es correcto: no lo abras aquí. NexusCrew usa la invitación y el puerto mediante el Host SSH.","scan-qr":"escanear QR","pairing-qr-invalid":"QR de emparejamiento no válido","invite-node":"invitar un nodo","create-pairing-link":"crear enlace / QR","visibility-network":"toda la red","visibility-relay":"solo relay","visibility-selected":"nodos seleccionados","hydra-simple":"local + nodos, una red","local-ready":"Este dispositivo está listo. Úsalo solo o conéctalo a un nodo.","local-only":"solo local","add-node":"añadir nodo",connect:"conectar","node-connected":"Nodo conectado. La red se sincronizará automáticamente.","tab-system":"sistema","tab-fleet":"flota","tab-audio":"audio","system-general":"general","system-diagnostics":"diagnóstico","system-this-node":"este nodo","system-updates":"actualizaciones","system-security":"seguridad","system-local-data":"datos locales del navegador","system-terminal":"terminal","alternate-screen":"pantalla alternativa","alternate-screen-help":"Mantiene el comportamiento estándar de tmux para las nuevas sesiones NexusCrew. Una aplicación que sigue el ratón se desplaza sola; las demás recorren el historial de tmux. No modifica las celdas ya activas.","tab-input":"entrada","tab-diagnostics":"diagnóstico","input-settings-local":"Preferencias locales de este navegador. Se aplican de inmediato a la vista única y a los decks sin cambiar el nodo remoto.","terminal-keyboard-gesture":"Abrir el teclado virtual desde el terminal","terminal-keyboard-double-tap":"Doble toque (predeterminado)","terminal-keyboard-single-tap":"Toque único","terminal-keyboard-never":"Nunca desde el terminal","terminal-keyboard-gesture-help":"El teclado auxiliar y STT usan los controles separados de abajo. El ratón y el teclado físico siguen disponibles.","keybar-ime-lock":"Teclado auxiliar: mantener cerrado el teclado virtual","keybar-ime-lock-help":"ESC, flechas, PgUp/PgDn, Enter y menú envían directamente al PTY sin enfocar un campo de texto.","voice-ime-lock":"Micrófono STT: mantener cerrado el teclado virtual","voice-ime-lock-help":"Tocar el micrófono inicia o detiene la voz sin enfocar el compositor.","keybar-enter-show":"Mostrar Enter vertical en el teclado auxiliar","keybar-enter-show-help":"Enter queda a la derecha de PgUp/PgDn y ocupa las dos filas.","keybar-layout":"Distribución del teclado auxiliar","keybar-layout-full":"Completo (predeterminado)","keybar-layout-compact":"Compacto","keybar-layout-help":"Compacto: una fila con un botón expandir que alcanza el conjunto completo sin cambiar la preferencia.","input-settings-reset":"restaurar valores de entrada","diagnostics-local":"Este nodo","diagnostics-target":"Nodo a diagnosticar","diagnostics-verbose":"Logs detallados temporales","diagnostics-duration":"Duración detallada","diagnostics-expires":"Log detallado activo hasta las {time}","diagnostics-off":"El log detallado está apagado; los avisos y errores operativos siguen disponibles.","diagnostics-level":"Nivel","diagnostics-all-levels":"todos los niveles","diagnostics-component":"componente","diagnostics-pause":"pausa","diagnostics-autoscroll":"desplazamiento automático","diagnostics-log":"Log de diagnóstico sanitizado","diagnostics-empty":"No hay eventos de diagnóstico.","diagnostics-export":"exportar JSON","diagnostics-export-failed":"La exportación no está disponible en este navegador.","diagnostics-clear":"vaciar","diagnostics-clear-confirm":"¿Vaciar el búfer de diagnóstico de este nodo?","diagnostics-unsupported":"Este par está desconectado o no admite diagnósticos estructurados.","fleet-editor-loading":"Cargando el editor de Fleet…","fleet-editor-load-error":"No se puede cargar el editor de Fleet.","fleet-editor-unavailable":"El editor de Fleet no está disponible en esta ubicación.","fleet-managed":"gestionado por NexusCrew","fleet-custom":"comando personalizado","fleet-managed-help":"Cliente, proveedor e inicio se gestionan internamente; los secretos nunca se muestran.","fleet-shell-engine-help":"La shell local se resuelve en el dispositivo al iniciar; no se guarda ninguna ruta ejecutable en las copias.","fleet-shell-command-placeholder":"comando opcional, p. ej. npm test","fleet-shell-command-help":"Se ejecuta mediante una shell de inicio interactiva (-lic), con PATH y alias del usuario. La celda se detiene al terminar; los fallos inmediatos se notifican.","fleet-shell-command-metachar":"Pipes, redirecciones, variables y otros metacaracteres son interpretados por la shell del dispositivo.","fleet-shell-interactive":"Vacío: abre una shell local interactiva y mantiene la celda activa.","fleet-shell-launch-help":"Configura el comando Shell de la celda en Ajustes → Flota.","fleet-credential-title":"Clave API en este dispositivo","fleet-credential-help":"La clave permanece solo en el nodo seleccionado y nunca se muestra, exporta ni comparte con la red.","fleet-credential-set":"poner clave","fleet-credential-change":"cambiar clave","fleet-credential-forget":"olvidar","fleet-credential-saved":"Clave guardada localmente.","fleet-credential-removed":"Clave local eliminada.","fleet-credential-remove-confirm":"¿Eliminar la clave local {key}?","fleet-credential-source-environment":"entorno","fleet-credential-source-local":"almacén local","fleet-credential-source-compatibility":"config compatible","fleet-credential-source-missing":"ausente","fleet-credential-source-policy":"origen de credencial","fleet-credential-source-policy-auto":"auto (precedencia legacy)","fleet-credential-source-policy-nexuscrew-store":"solo almacén NexusCrew","fleet-credential-source-policy-environment":"solo entorno","fleet-key-section":"KEY","fleet-key-variable":"Variable","fleet-key-value":"Valor para {key}","fleet-key-used-by":"Usada por: {engines}","fleet-key-used-by-none":"Aún no la usa ningún motor configurado en este nodo.","fleet-key-shared-impact":"Sustituir o eliminar {key} afecta a todos los motores listados: {engines}.","fleet-key-enter":"introduce la clave","fleet-key-blank-keeps":"vacío = mantener la fuente actual","fleet-key-reveal":"mostrar","fleet-key-hide":"ocultar","fleet-key-local-help":"El valor permanece write-only en el nodo seleccionado y nunca entra en motores, copias ni federación.","fleet-key-create-missing":"Crear explícitamente el motor sin clave (seguirá como “clave requerida”).","fleet-key-partial-create":"Motor creado; la clave no se guardó. Puedes reintentar sin crear un duplicado.","fleet-key-partial-edit":"Motor actualizado; la clave no se guardó. Los cambios del motor siguen aplicados.","fleet-provider-notice-claude-openrouter":"Claude Code está optimizado para modelos Anthropic; otros proveedores podrían no funcionar correctamente. Fast mode requiere el proveedor Anthropic first-party.","fleet-provider-notice-codex-openrouter":"OpenRouter Responses es beta y stateless; Codex-VL no usa fallback de Chat Completions.","fleet-provider-notice-claude-kimi-code":"Kimi Code usa una configuración Claude aislada con onboarding y fast mode dedicados; la configuración Claude nativa no se modifica.","fleet-provider-notice-alibaba-token-plan":"Token Plan Personal usa solo ALIBABA_CODE_API_KEY de la capa local de credenciales; qwen3.8-max-preview es el modelo predeterminado y no se usa fallback OpenAI/PAYG.","fleet-provider-notice-kimi-native":'Kimi Code CLI nativo usa el login del CLI (device-code) y su propia configuración: NexusCrew no lee ni copia credenciales. Distinto del proveedor "Kimi Code" de Claude Code, que sigue siendo la ruta K3 gestionada.',"fleet-model-default":"modelo predeterminado (opcional)","fleet-model-required":"modelo (obligatorio)","fleet-standard-permissions":"permisos estándar","fleet-unsafe-permissions":"inseguro · omitir aprobaciones/sandbox","fleet-unsafe-warning":"Modo inseguro explícito: el worker puede actuar sin las aprobaciones normales ni las protecciones del sandbox.","fleet-provider-display":"nombre visible del proveedor","fleet-custom-provider-default":"Proveedor personalizado","fleet-api-key-env":"NOMBRE_VARIABLE_API_KEY","fleet-provider-id":"id-proveedor","fleet-custom-secret-help":"NexusCrew guarda solo el nombre de la variable de entorno, nunca su valor.","fleet-model-override":"modelo alternativo","fleet-ready":"listo","fleet-not-ready":"no configurado","fleet-engines":"Motores","fleet-cells":"Celdas / sesiones cloud","fleet-backup":"copia / restauración","fleet-backup-help":"Exporta o restaura selectivamente motores, celdas y system prompts. Tokens, claves API y secretos del proveedor nunca entran en el archivo.","fleet-backup-export":"exportar","fleet-backup-import":"importar","fleet-backup-download":"descargar copia","fleet-backup-restore":"restaurar seleccionadas","fleet-backup-import-help":"Elige una copia JSON, revisa las celdas y selecciona un motor de destino antes de restaurar.","fleet-backup-overwrite":"sobrescribe la celda existente","fleet-backup-new":"celda nueva","fleet-backup-engine-missing":"elige un motor disponible","fleet-backup-restore-unavailable":"El nodo seleccionado solo admite exportación; actualízalo para restaurar copias.","fleet-backup-restored":"{n} celdas restauradas","fleet-backup-confirm-overwrite":"¿Sobrescribir estas celdas? {cells}","fleet-backup-needs-restart":"reinicio necesario: {cells}","fleet-backup-empty":"no hay celdas para exportar","fleet-backup-select-one":"selecciona al menos una celda","fleet-backup-too-large":"copia demasiado grande (máximo 1 MB)","fleet-backup-invalid-json":"el archivo no contiene JSON válido","fleet-backup-invalid-format":"formato o versión de copia no compatible","fleet-backup-invalid-cell":"la copia contiene una celda no válida","fleet-backup-duplicate-cell":"la copia contiene IDs de celda duplicados","fleet-backup-invalid-engine":"la copia contiene un motor no válido","fleet-backup-duplicate-engine":"la copia contiene IDs de motor duplicados","fleet-backup-confirm-engine-overwrite":"¿Sobrescribir estos motores? Los valores de entorno ya configurados en el destino no cambian. {engines}","fleet-backup-env-names":"nombres de entorno","fleet-backup-env-values-required":"los valores de entorno deben configurarse en este dispositivo","fleet-system-prompt":"system prompt",characters:"caracteres","select-all":"seleccionar todas","select-none":"ninguna",edit:"editar",save:"guardar",label:"etiqueta","command-path":"ruta absoluta del comando","args-lines":"argumentos, uno por línea","env-write-only":"Los valores env son de solo escritura: vacío conserva el valor existente.","fleet-new-engine":"Nuevo motor","fleet-new-cell":"Nueva celda","fleet-saved":"Definición guardada.","fleet-restart-confirm":"Cambio guardado. ¿Reiniciar ahora: {cells}?","fleet-remove-engine":'¿Eliminar el motor "{id}"?',"fleet-remove-cell":'¿Eliminar la celda "{id}"? Si está activa se detendrá primero.',"fleet-cwd-needs-repair":"carpeta a reparar","fleet-cwd-repair":"reparar","fleet-cwd-repair-title":"Reparar carpeta de celda {id}","fleet-cwd-repair-help":"La carpeta actual no es portátil en este dispositivo: pertenece a otro dispositivo o no existe bajo el directorio home. Elige una carpeta relativa a home (~) en el dispositivo destino; el backend recalculará la ruta absoluta.","fleet-cwd-repair-no-source-path":"La ruta original no se muestra: es específica del dispositivo de origen.","fleet-cwd-repair-placeholder":"p. ej. Dev","fleet-cwd-repair-preview":"Nueva carpeta: {path}","fleet-cwd-repair-browse":"examinar bajo ~","fleet-cwd-repair-fs-empty":"sin subcarpetas","fleet-cwd-repair-use-current":"usar esta carpeta","fleet-cwd-repair-invalid":'ruta no válida: nada de ruta absoluta, "..", barra invertida ni letra de unidad',"fleet-cwd-repair-confirm":"¿Establecer la carpeta de la celda {id} a {path}? Se recalculará en el dispositivo destino.","fleet-cwd-repair-unportable":"La ruta elegida no es portátil en este dispositivo: debe existir bajo el directorio home.","fleet-cwd-repair-suggestion":"Sugerencia del dispositivo:","fleet-cwd-repair-use-suggestion":"usar {path}","fleet-cwd-repaired":"Carpeta de la celda reparada.","fleet-recovery-kimi-code-consent-yes":"Kimi Code: confirma la clave API personalizada (Yes) en el terminal de la celda, luego reinicia la celda.","fleet-recovery-kimi-code-config-custom-api-key":'Kimi Code: en el terminal de la celda abre /config y activa "Use custom API key", luego reinicia la celda. Si la clave cambió, actualiza la credencial y reintenta.',"fleet-recovery-kimi-cli-login":"Kimi Code CLI: en el terminal de la celda ejecuta /login (código de dispositivo Kimi) o /provider, luego reinicia la celda.","fleet-recovery-client-terminal-dialog":"Completa el diálogo mostrado en el terminal de la celda, luego reinicia la celda.","settings-readonly":"READONLY activo: los cambios están bloqueados por el servidor (NEXUSCREW_READONLY=1)","role-client":"client (hub)","role-client-desc":"esta máquina observa otros nodos vía túneles SSH","role-node":"nodo (alcanzable)","published-port":"puerto publicado (opcional)","no-nodes":"sin nodos remotos configurados","node-add":"conectar una instalación NexusCrew","node-connect-help":"El puerto SSH conecta con el servidor SSH. El puerto NexusCrew es el puerto local indicado por `nexuscrew status` en el nodo remoto.","node-name-label":"Nombre del nodo","node-ssh-label":"Host SSH","pair-ssh-local-label":"Host o alias SSH en este dispositivo","node-ssh-local-help":"Puedes sustituir la dirección del enlace por el mismo alias que funciona con ssh en este dispositivo. Los alias, agentes y claves permanecen locales y nunca viajan en el enlace.","node-ssh-port-label":"Puerto SSH","node-ssh-port-help":"Normalmente 22; usa el puerto público del servidor SSH.","node-app-port-label":"Puerto NexusCrew del nodo","node-app-port-help":"El puerto indicado por `nexuscrew status` en el nodo remoto.","node-name-ph":"nombre (a-z 0-9 -)","node-ssh-ph":"ssh (user@host)","node-port-ph":"puerto remoto (opc.)","node-remove-confirm":"¿Eliminar el nodo «{name}»?","node-remove-warning":"Elimina el emparejamiento, las credenciales y el túnel local. No apaga el dispositivo remoto.","peer-inventory-title":"Nodos conectados al hub","peer-group-hubs":"Hubs directos","peer-group-clients":"Clientes conectados","peer-group-routed":"Nodos accesibles a través de la red","peer-group-vl":"Nodos VL","vl-owners-unavailable":"Owners VL no alcanzados","peer-routed":"enrutado","peer-routed-stale":"enrutado, no accesible","peer-visibility":"Visibilidad en la red","node-test":"test","tunnel-start":"iniciar túnel","tunnel-stop":"detener túnel","tunnel-restart":"reiniciar túnel","share-node":"Compartir este nodo","share-local-heading":"Compartir este dispositivo","share-local-hub":"Hub para compartir","share-local-through":"Compartir {device} mediante {hub}","share-local-active":"Compartido y accesible para la red conectada al hub.","share-local-pending":"Se solicitó compartir, pero el túnel está caído: este dispositivo aún no es accesible.","share-local-private":"Privado: solo este dispositivo puede usar la conexión al hub.","share-local-private-down":"Privado, pero la conexión al hub está caída. Reconecta para aplicar y verificar el modo privado.","share-local-reconnect":"Reconectar y reconciliar","share-off-hub-reconcile-pending":"Estado privado guardado; la revocación en el hub sigue pendiente.","fleet-cell-label":"nombre legible (opcional)","share-off-local-reconcile-pending":"Revocación confirmada por el hub; el túnel local aún debe reconciliarse.","share-reverse-pool-pending":"El canal inverso no se apagó de forma demostrable: queda en cuarentena, no cerrado.","share-node-off-desc":"Privado: sigue conectado al hub, pero otros clientes no pueden alcanzarlo.","share-node-on-desc":"Compartido: el hub puede anunciarlo y enrutar celdas y decks autorizados.","peer-shared":"Nodo cliente compartido en la red Hydra","peer-private":"Nodo cliente privado: conectado, no publicado en Hydra","peer-vl-federated":"Nodo VL: federado","row-vl-federated":"federado","node-connected-client":"cliente conectado","transport-used":"en uso","tunnel-up":"túnel activo","tunnel-down":"túnel caído","vl-poll-online":"en línea (poll)","vl-poll-offline":"sin respuesta","authorized-keys-hint":"pega esta línea en ~/.ssh/authorized_keys del host remoto:",copy:"copiar",copied:"copiado","token-rotate":"rotar token","token-rotate-explain":"El nuevo token NO se mostrará: recupéralo con `nexuscrew show token`. La sesión actual quedará invalidada.","service-regenerate":"regenerar service","npm-auto-update":"actualizaciones automáticas desde npm","npm-auto-update-help":"Comprueba latest periódicamente e instala solo versiones más recientes. Nunca baja de versión.","npm-update-current":"instalada","npm-update-latest":"npm latest","npm-update-check":"comprobar ahora","npm-update-install":"actualizar ahora","npm-update-restarting":"Actualización iniciada; NexusCrew volverá después de reiniciar el servicio.","npm-update-idle":"actualizado","npm-update-checking":"comprobando","npm-update-available":"actualización disponible","npm-update-installing":"instalando","npm-update-installed":"instalada, reiniciando","npm-update-error":"comprobación fallida","npm-update-unsupported":"disponible solo con instalación npm global","service-installed":"service instalado","service-missing":"service no instalado","service-active":"activo","service-inactive":"no activo",confirm:"confirmar",add:"añadir",enable:"activar","wizard-title":"bienvenido a NexusCrew","wizard-skip":"configura después desde ajustes","wizard-step-roles":"roles de esta instalación","wizard-step-node":"primer nodo remoto (opcional)","wizard-done":"todo listo","wizard-done-desc":"configuración completa — puedes cambiarlo todo desde ajustes",next:"continuar",back:"atrás",skip:"omitir",finish:"terminar","err-node-name":"nombre inválido (a-z, 0-9, -, máx 32)","err-local-name":"nombre local inválido: usa un slug único, no “localhost”","err-ssh":"ssh inválido (se espera user@host o alias)","err-port":"puerto inválido (1–65535)","err-ssh-port":"puerto SSH inválido (1–65535)","err-node-port":"puerto NexusCrew inválido (1–65535)","node-sessions":"{n} sesiones","tunnel-down-since":"túnel caído desde hace {t}","node-unreachable":"nodo inalcanzable","node-passive":"cliente desconectado · estado normal","node-offline":"nodo desconectado","node-offline-seen":"sin conexión · visto hace {t}","node-needs-repair":"legacy · vuelve a enlazar","asks-title":"preguntas de las celdas","ask-dismiss":"Descartar la pregunta","ask-reply-ph":"escribe la respuesta…","push-enable":"activar notificaciones push","push-disable":"desactivar notificaciones push","push-on":"push activas en este dispositivo","push-off":"push no activas","push-denied":"permiso de notificaciones denegado por el navegador","push-unsupported":"push no soportadas en este navegador","notification-speech-enable":"leer las notificaciones en voz alta","notification-speech-help":"Usa la voz del navegador solo para notificaciones nuevas mientras esta PWA está visible y en primer plano. Con la aplicación cerrada permanece la notificación del sistema.","notification-speech-test":"probar voz","notification-speech-testing":"probando voz…","notification-speech-preview":"NexusCrew. Las notificaciones por voz están activas.","notification-speech-preview-ok":"Prueba de voz completada.","notification-speech-preview-failed":"El navegador no inició la prueba de voz. Interactúa con la página y vuelve a intentarlo.","notification-speech-needs-test":"Para esta sesión de la aplicación, pulsa “probar voz” antes de recibir avisos hablados.","notification-speech-unsupported":"La síntesis de voz no está disponible en este navegador.","audio-title":"Audio nativo del nodo","audio-help":"El consentimiento y los controles valen solo para este dispositivo. Compartir y visibilidad no autorizan sonidos.","audio-consent":"permitir TTS en este nodo","audio-consent-help":"Permite que celdas autorizadas, locales o remotas, entreguen un comando de voz. Puedes revocarlo en cualquier momento.","audio-capability":"Capacidad local","audio-loading":"leyendo el estado de audio local…","audio-adapter":"adaptador","audio-adapter-none":"ninguno","audio-installed":"instalado","audio-installed-yes":"sí","audio-installed-no":"no","audio-liveness":"disponibilidad","audio-liveness-ready":"listo para aceptar","audio-liveness-unavailable":"no disponible","audio-languages":"idiomas declarados","audio-limits":"límites","audio-test":"probar audio local","audio-testing":"probando audio…","audio-stop":"detener audio local","audio-stopping":"deteniendo audio…","audio-test-needs-consent":"Activa el consentimiento local antes de probar la voz.","audio-unavailable":"No hay un adaptador TTS nativo disponible en este nodo.","audio-test-accepted":"El nodo aceptó la prueba. No demuestra que alguien la haya oído.","audio-test-refused":"El nodo rechazó la prueba.","audio-test-unknown":"Resultado de prueba desconocido: el nodo no pudo confirmar el inicio.","audio-stop-stopped":"Audio local detenido.","audio-stop-idle":"No hay enunciado local que detener.","audio-groups-title":"Grupos de audio compartido","audio-groups-help":"Decide en qué dispositivos se oye la voz cuando habla una celda. Un grupo es una preferencia local de entrega, no un consentimiento. Cada nodo conserva su consentimiento, ACL, disponibilidad y Stop local.","audio-groups-empty":"Sin grupos: la voz sale solo por este nodo.","audio-group-name":"nombre del grupo","audio-group-mode":"modo de entrega","audio-group-primary":"primero disponible (en orden)","audio-group-fanout":"todos los nodos enumerados","audio-group-targets":"nodos destino exactos","audio-group-local":"este nodo","audio-group-unavailable-target":"no detectado ahora","audio-group-no-targets":"No hay ningún nodo con instanceId disponible. Un grupo no puede usar nombres, comodines ni “todos”.","audio-group-new":"nuevo grupo","audio-group-edit":"editar","audio-group-delete":"eliminar","audio-group-save":"guardar grupo","audio-group-cancel":"cancelar","audio-group-invalid":"El grupo necesita un nombre válido y al menos un nodeId exacto.","audio-group-save-failed":"No se pudo guardar el grupo de audio.","node-display-label":"Nombre (etiqueta)","routed-node-aliases":"Alias de nodos enrutados","routed-node-aliases-help":"Visibles solo en este dispositivo; la ruta y el nombre remoto no cambian.","node-local-alias":"Alias en este dispositivo","alias-on-device":"Alias en este dispositivo","reset-alias":"Restablecer nombre remoto","node-slug-hint":"enrutado por slug: {slug}","device-name-label":"Nombre del dispositivo","device-name-hint":"cómo te ven los pares (editable)","local-route-name-label":"Nombre local / ruta","local-route-name-hint":"identificador técnico estable: etiqueta legible + sufijo del nodeId; editable antes de conectar","err-label":"etiqueta no válida (máx 64 caracteres, sin saltos de línea)","fleet-inventory":"Celdas y sesiones","fleet-inventory-help":"todas las posiciones (Local + rutas Hydra)","fleet-manage-location":"Gestionar ubicación","fleet-network-overview":"Vista de red","fleet-manage-help":"crea y configura celdas en la ubicación seleccionada","fleet-overview-help":"estado operativo de todas las ubicaciones, separado del editor","fleet-inventory-empty":"sin celdas ni sesiones","cell-switcher-refreshing":"actualizando celdas…","cell-switcher-empty-active":"no hay celdas activas verificadas","cell-switcher-not-confirmed":"estado sin confirmar","cell-switcher-not-active":"esta celda ya no está activa","cell-switcher-select":"selecciona una celda","cell-switcher-open":"abrir celda","cell-switcher-show-all":"todas","cell-switcher-show-active":"activas","cell-switcher-close":"cerrar selector de celdas","fleet-not-available":"fleet no disponible en esta posición",start:"iniciar",stop:"detener",restart:"reiniciar",delete:"eliminar","copy-manual":"copia fallida — selecciona y pulsa Cmd+C, o copia a mano","copy-empty":"nada seleccionado: arrastra con Shift para seleccionar","selection-held":"resaltado perdido, texto aún retenido","invite-hub-only":"Una invitación se acuña en el hub. Admitir un nodo nuevo es lo único que un nodo conectado no puede pedir en nombre de otro: abre NexusCrew en el hub y créala allí.","row-private":"privado","node-detail-open":"abrir el detalle","node-detail-reach":"Alcanzabilidad","node-detail-route":"ruta","node-detail-ssh":"SSH","node-detail-transport":"transporte","node-detail-owner":"propietario","node-detail-authority":"Qué puede hacer este nodo","authority-owner-equivalent":"Autoridad igual a la tuya: un nodo emparejado puede hacer en esta máquina todo lo que puedes hacer tú.","authority-routed":"No está emparejado con esta máquina: su autoridad vive en el hub que lo enruta.","authority-no-grants":"Los poderes por nodo aún no existen: aquí no hay nada que conceder ni retirar.","node-detail-network-view":"Qué ve de esta red","node-detail-command":"Comando","vl-no-commands":"El dispositivo no declara comandos disponibles.","vl-events-title":"Sesión","vl-events-empty":"Ningún evento en memoria: la sesión aún no ha hablado, o lo que dijo ha salido del búfer. El historial queda en el dispositivo.","vl-events-gap":"eventos no recibidos:","vl-events-truncated":"contenido truncado por el dispositivo","vl-events-turn-end":"— fin del turno —","vl-events-done":"— sesión terminada —","vl-events-writer-epoch":"— cambio de escritor —","vl-events-tool":"herramienta","vl-events-tool-ok":"terminada","vl-events-tool-failed":"fallida","vl-events-usage":"consumo actualizado","vl-events-stale":"Actualización fallida: puede que no estés viendo lo último.","vl-cmd-phase-submitted":"enviado, a la espera de confirmación","vl-cmd-phase-inflight":"en curso","vl-cmd-phase-done-ok":"completado","vl-cmd-phase-done-error":"fallido","vl-cmd-status":"estado","vl-cmd-health":"salud","vl-cmd-start":"iniciar","vl-cmd-stop":"detener","vl-cmd-restart":"reiniciar","vl-cmd-version":"versión","vl-cmd-capabilities":"capacidades","vl-cmd-logs":"logs","vl-cmd-unpair":"desemparejar","node-grant-none":"Ningún nodo elegido: compartido, pero hacia nadie.","node-grant-unknown":"ya no está en el inventario","node-grant-remove":"quitar","node-grant-add":"Añadir un nodo","node-grant-search":"Buscar entre los nodos","node-grant-no-candidates":"Ningún nodo coincide.","single-view":"vista única",retract:"reducir","keybar-expand":"ampliar la barra de teclas","keybar-retract":"reducir la barra de teclas","save-and-start":"guardar e iniciar",permissions:"Permisos","power-on-hint":"Detén la celda; también puedes quitarla del boot.","launch-engine-help":"Proveedores, credenciales y nuevos motores se crean en Ajustes → Flota. Modelo y permisos son por celda.","launch-unavailable-hint":"La configuración del motor no está disponible en este nodo.","import-as-cell":"Importar como celda","import-help":"Reconcilia una sesión tmux existente en una celda gestionada. Elige un motor ya declarado: no se inventa ninguno.","import-engine-required":"elige un motor (obligatorio)","test-and-connect":"probar y conectar","pairing-v2-hint":"Pega o escanea UN solo enlace: rellena nombre, Host SSH y etiqueta cuando los incluye (v2).","invite-v2-hint":"Crea una invitación completa de un solo uso. Si este dispositivo ya está unido a un hub, se usa automáticamente; si no, solo hace falta su dirección SSH alcanzable.","invite-network-hint":"Crea una invitación para la red a la que ya estás conectado. El nuevo dispositivo entra por el hub y no se conecta directamente a este dispositivo.","invite-network-label":"Red de destino","invite-network-via":"Hub","invite-network-route":"Una sola conexión al hub; nodos, celdas y decks se enrutan internamente.","invite-endpoint-label":"Dirección SSH de este hub vista por los otros dispositivos","invite-endpoint-auto":"Endpoint ya configurado","invite-endpoint-needed":"Introduce usuario@host o un alias SSH compartido. No es 127.0.0.1 ni la URL HTTP de NexusCrew.","invite-ssh-hint":"El destino SSH con el que el OTRO dispositivo alcanza ESTA instalación (usuario@host o alias). Obligatorio: se incluye en el enlace.","invite-next-steps":"copia este enlace, abre NexusCrew en el otro dispositivo y pégalo en Ajustes → Nodos (o escanea el QR): NexusCrew hace el resto","pair-card-title":"conectar con un solo enlace","pair-card-help":"Pega el enlace de emparejamiento generado en el otro dispositivo (o escanea su QR): NexusCrew lo decodifica, prueba la conexión SSH y conecta solo.","pair-paste-ph":"pega aquí el enlace de emparejamiento","pair-paste-btn":"pegar","pair-advanced":"avanzado / editar","pair-progress":"conectando: SSH → invitación → confirmación → verificación…","pair-retry":"reintentar","pair-invalid-link":"esto no es un enlace de emparejamiento válido","pair-invalid-hint":"se necesita el enlace completo (http://…#pair=…) generado por el otro NexusCrew: no lo abras, pégalo aquí","pair-missing-ssh":"el enlace no incluye el destino SSH (formato v1): indica en “avanzado” cómo este dispositivo alcanza al otro por SSH — nunca se inventa","pair-missing-name":"falta el nombre del nodo: complétalo en “avanzado”","pair-clipboard-denied":"lectura del portapapeles no permitida: pega manualmente en el campo","pair-clipboard-empty":"portapapeles vacío: copia primero el enlace","pair-stage-validation":"datos no válidos","pair-stage-conflict":"nombre ya en uso","pair-stage-ssh-start":"fallo al iniciar el túnel SSH","pair-stage-ssh-ready":"peer inaccesible por SSH","pair-stage-join":"intercambio de invitación fallido","pair-stage-tunnel-final":"túnel negociado fallido","pair-stage-confirm":"confirmación de emparejamiento fallida","pair-stage-health":"verificación final de la federación fallida","pair-stage-internal":"error interno","pair-stage-generic":"conexión fallida","qr-no-camera":"no hay cámara disponible en este dispositivo: usa una foto del QR","qr-permission":"permiso de cámara denegado: permítelo en el navegador o usa una foto del QR","qr-unsupported":"escáner en vivo no soportado aquí: sube una foto del QR","qr-upload":"usar una foto"}};function Ol(){const e=oy(),t=e?e.getItem(ry):null;return tf.includes(t)?t:jl}function ox(e){const t=oy();if(t)try{t.setItem(ry,e)}catch{}typeof window<"u"&&window.dispatchEvent(new Event(Wd))}function p(e){const t=Ol(),n=gl[t]||gl[jl];return Object.prototype.hasOwnProperty.call(n,e)?n[e]:Object.prototype.hasOwnProperty.call(gl[jl],e)?gl[jl][e]:e}function ax(e){return typeof window>"u"?()=>{}:(window.addEventListener(Wd,e),()=>window.removeEventListener(Wd,e))}const ay=tf;function kn(){return[N.useSyncExternalStore(ax,Ol,Ol),ox]}function Bl({cell:e,token:t,route:n=[],onConfirm:s,onClose:o}){var $,U;kn();const a=!!(e&&e.active),u=Array.isArray(n)?n.join("/"):"",[h,f]=N.useState([]),[m,v]=N.useState(!1);N.useEffect(()=>{let R=!0;return(async()=>{if(t)try{const K=await ws(t,u?u.split("/"):[]);if(!R)return;if(v(K.provider==="builtin"&&(K.capabilities||[]).includes("edit")),K.provider==="builtin"&&(K.capabilities||[]).includes("definitions")){const B=await Gh(t,u?u.split("/"):[]);if(!R)return;const j=new Map((K.engines||[]).map(D=>[D.id,D]));f((B.engines||[]).map(D=>{var W,ne,ce,pe,ye,me,ae;return{id:D.id,label:D.label||D.id,client:((W=D.managed)==null?void 0:W.client)||"",models:[...new Set([...((ne=j.get(D.id))==null?void 0:ne.models)||[],...((ce=D.managedInfo)==null?void 0:ce.models)||[]])].filter(Boolean),defaultModel:((pe=D.managed)==null?void 0:pe.model)||((ye=D.managedInfo)==null?void 0:ye.defaultModel)||"",policyDefault:((me=D.managed)==null?void 0:me.permissionPolicy)||((ae=D.managed)!=null&&ae.client&&D.managed.client==="claude"?"unsafe":"standard")}}))}}catch{}})(),()=>{R=!1}},[t,u]);const b=(e==null?void 0:e.engine)||(($=h[0])==null?void 0:$.id)||"",y=R=>(e==null?void 0:e.models)&&e.models[R]||"",S=R=>{const K=(e==null?void 0:e.permissionPolicies)&&e.permissionPolicies[R];if(K==="standard"||K==="unsafe")return K;const B=h.find(j=>j.id===R);return B?B.policyDefault:"standard"},[w,x]=N.useState(b),[k,P]=N.useState((e==null?void 0:e.model)||""),E=(e==null?void 0:e.permissionPolicy)==="standard"||(e==null?void 0:e.permissionPolicy)==="unsafe"?e.permissionPolicy:((U=e==null?void 0:e.permissionPolicies)==null?void 0:U[e==null?void 0:e.engine])||"",[F,M]=N.useState(E),[V,G]=N.useState((e==null?void 0:e.boot)??!0),[O,Z]=N.useState(!1),[X,Q]=N.useState(null);N.useEffect(()=>{h.length&&(x(R=>R||b),P(R=>R||y((e==null?void 0:e.engine)||b)||""),M(R=>R==="standard"||R==="unsafe"?R:S((e==null?void 0:e.engine)||b)))},[h.length]);const z=N.useMemo(()=>h.find(R=>R.id===w)||null,[h,w]),I=!!(z&&["claude","codex","codex-vl","agy","kimi"].includes(z.client)),C=(z==null?void 0:z.client)==="shell";function T(R){x(R);const K=h.find(B=>B.id===R);P(y(R)||(K==null?void 0:K.defaultModel)||""),M(S(R))}async function A(R){R.preventDefault(),Z(!0),Q(null);try{if(a)await s({action:"down",boot:V});else{const K=F==="standard"||F==="unsafe"?F:(z==null?void 0:z.policyDefault)||"standard";await s({action:"up",...m?{engine:w,model:k||"",...I?{permissionPolicy:K}:(z==null?void 0:z.client)==="pi"?{permissionPolicy:"standard"}:{}}:{},boot:V})}o()}catch(K){Q(String(K&&K.message||K)),Z(!1)}}return c.jsx("div",{className:"nc-sheet-overlay nc-launch-overlay",onClick:o,children:c.jsxs("form",{className:"nc-sheet nc-power-sheet nc-launch-sheet",onClick:R=>R.stopPropagation(),onSubmit:A,children:[c.jsxs("div",{className:"nc-sheet-head",children:[c.jsx("b",{children:e==null?void 0:e.cell}),c.jsx("span",{className:"nc-sheet-state",children:p(a?"state-on":"state-off")})]}),a?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:p("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[p("model"),": ",e.model]}),c.jsx("small",{children:p("power-on-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:V,onChange:R=>G(R.target.checked)}),p("remove-boot")]})]}):c.jsxs(c.Fragment,{children:[m&&h.length>0?c.jsxs("div",{className:"nc-launch-fields",children:[c.jsxs("label",{className:"nc-field",children:[p("engine"),c.jsx("select",{value:w,onChange:R=>T(R.target.value),children:h.map(R=>c.jsx("option",{value:R.id,children:R.label},R.id))})]}),!C&&c.jsxs("label",{className:"nc-field",children:[p("model"),c.jsx("input",{value:k,list:"nc-launch-models",placeholder:p("model-default"),onChange:R=>P(R.target.value)}),c.jsx("datalist",{id:"nc-launch-models",children:((z==null?void 0:z.models)||[]).map(R=>c.jsx("option",{value:R},R))})]}),I?c.jsxs("label",{className:"nc-field",children:[p("permissions"),c.jsxs("select",{value:F,onChange:R=>M(R.target.value),children:[c.jsx("option",{value:"standard",children:p("fleet-standard-permissions")}),c.jsx("option",{value:"unsafe",children:p("fleet-unsafe-permissions")})]})]}):c.jsx("small",{className:"nc-note",children:p("fleet-standard-permissions")}),I&&F==="unsafe"&&c.jsx("small",{className:"nc-err",children:p("fleet-unsafe-warning")}),c.jsx("small",{className:"nc-note",children:p(C?"fleet-shell-launch-help":"launch-engine-help")})]}):c.jsxs("div",{className:"nc-power-config",children:[c.jsx("span",{children:p("engine")}),c.jsx("b",{children:(e==null?void 0:e.engine)||"—"}),(e==null?void 0:e.model)&&c.jsxs("small",{children:[p("model"),": ",e.model]}),c.jsx("small",{children:p("launch-unavailable-hint")})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:V,onChange:R=>G(R.target.checked)}),p("boot-persist")]})]}),X&&c.jsx("div",{className:"nc-err",children:X}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:o,disabled:O,children:p("cancel")}),c.jsx("button",{type:"submit",className:"nc-btn primary",disabled:O,children:p(a?"power-off":"save-and-start")})]})]})})}const Ng=/^[a-z0-9-]{1,32}$/;function Go(e,t){const n=Array.isArray(e)?e:[];return n.length?`${n.map(encodeURIComponent).join("/")}:${t}`:String(t)}function lx(e,t,n){const s={};for(const o of Array.isArray(t)?t:[]){const a=Array.isArray(o==null?void 0:o.route)?o.route:typeof(o==null?void 0:o.name)=="string"?[o.name]:[];if(!a.length)continue;const u=a.join("/"),h=o.status==="up"||o.tunnel&&o.tunnel.status==="up",f=o.status==="passive"||o.tunnel&&o.tunnel.status==="passive";!h&&!f&&(s[u]=e&&e[u]||n)}return s}function jg(e,t,n){return!e||!Array.isArray(e.cells)?[]:e.cells.map(s=>({...s,route:t,key:`${n}:${s.tmuxSession||s.cell}`}))}function Rg({nodes:e,topology:t,remote:n,down:s,fleet:o,aliases:a}={}){var m,v,b,y;const u=[],h=new Set,f=new Set;for(const S of Array.isArray(e)?e:[]){if(!S||typeof S.name!="string"||!Ng.test(S.name)||S.direction==="inbound"&&S.shared!==!0)continue;const w=[S.name],x=S.name;h.add(x);const k=((m=S.tunnel)==null?void 0:m.status)||"unknown",P=k==="up",E={name:S.name,label:S.label||S.name,originalLabel:S.label||S.name,alias:null,route:w,direct:!0,instanceId:S.nodeId||null,shared:S.shared===!0,tunnelStatus:k,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:S.health||null,direction:S.direction||"outbound",roles:S.roles||null,rolesKnown:S.rolesKnown===!0};if(S.nodeId&&f.add(S.nodeId),!S.nodeId&&S.paired===!1){u.push({...E,status:"needs-repair",downSince:s&&s[x]||null});continue}if(((v=S.health)==null?void 0:v.auth)==="failed"||k==="degraded"&&((b=S.health)==null?void 0:b.status)==="degraded"){u.push({...E,status:"needs-repair",downSince:s&&s[x]||null});continue}if(k==="passive"||((y=S.health)==null?void 0:y.status)==="passive"){u.push({...E,status:"passive",downSince:null});continue}if(!P){u.push({...E,status:"down",downSince:s&&s[x]||null});continue}const F=n&&(n[x]||n[S.name])||null,M=o&&(o[x]||o[S.name]),V=!!(F&&!F.error&&Array.isArray(F.sessions)),G=!!(M&&M.available===!0&&Array.isArray(M.cells));if(!V&&!G){u.push({...E,status:"unreachable"});continue}const O=(V?F.sessions:[]).filter(Q=>Q&&typeof Q.name=="string"&&Q.name).map(Q=>({...Q,node:x,route:w,key:`${x}:${Q.name}`})),Z=jg(M,w,x),X=new Set(Z.map(Q=>Q.tmuxSession).filter(Boolean));u.push({...E,status:"up",sessions:O,cells:Z,unmanaged:O.filter(Q=>!X.has(Q.name)),fleetAvailable:!!(M&&M.available),capabilities:M&&M.capabilities||[],engines:M&&M.engines||[],fleetProvider:M&&M.provider||null,sessionsAvailable:V,inventoryPartial:!V})}for(const S of Array.isArray(t)?t:[]){if(!S||!Array.isArray(S.route)||S.route.length<1||S.route.some(X=>!Ng.test(X)))continue;const w=S.route.join("/");if(h.has(w)||S.instanceId&&f.has(S.instanceId))continue;S.instanceId&&f.add(S.instanceId);const x=S.label||S.route.join(" › "),k=S.instanceId&&a&&typeof a[S.instanceId]=="string"?a[S.instanceId]:null,P={name:S.name,label:k||x,originalLabel:x,alias:k,route:[...S.route],direct:!1,instanceId:S.instanceId||null,shared:!0,tunnelStatus:null,sessions:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:S.health||null,lastSeen:S.lastSeen||null};if(S.stale){u.push({...P,status:"offline",downSince:s&&s[w]||S.lastSeen||null});continue}const E=n&&n[w]||null,F=o&&o[w],M=!!(E&&!E.error&&Array.isArray(E.sessions)),V=!!(F&&F.available===!0&&Array.isArray(F.cells));if(!M&&!V){u.push({...P,status:"unreachable",downSince:s&&s[w]||null});continue}const G=(M?E.sessions:[]).filter(X=>X&&typeof X.name=="string"&&X.name).map(X=>({...X,node:w,route:S.route,key:`${w}:${X.name}`})),O=jg(F,S.route,w),Z=new Set(O.map(X=>X.tmuxSession).filter(Boolean));u.push({...P,status:"up",sessions:G,cells:O,unmanaged:G.filter(X=>!Z.has(X.name)),fleetAvailable:!!(F&&F.available),capabilities:F&&F.capabilities||[],engines:F&&F.engines||[],fleetProvider:F&&F.provider||null,lastSeen:S.lastSeen||null,sessionsAvailable:M,inventoryPartial:!M})}return u.sort((S,w)=>S.label.localeCompare(w.label))}function ly(e,t={}){if(!e||typeof e!="object")return null;const n=typeof e.nodeId=="string"?e.nodeId:"";if(!n)return null;const s=typeof e.label=="string"&&e.label.trim()||typeof e.cell=="string"&&e.cell.trim()||n,o=Array.isArray(t.route)?[...t.route]:[];return{kind:"vl",nodeId:n,name:n,label:s,cell:e.cell??null,paired:!!e.pairedAt,online:!!e.online,lastSeen:e.lastSeen??null,generation:e.generation??null,version:e.version??null,health:e.health??null,session:e.session??null,capabilities:Array.isArray(e.capabilities)?e.capabilities:[],inflight:e.inflight??null,lastAck:e.lastAck??null,canManage:!!e.canManage,route:o,isLocal:o.length===0,ownerInstanceId:typeof t.instanceId=="string"?t.instanceId:null,ownerLabel:typeof t.label=="string"&&t.label?t.label:null}}function cx(e){var n;const t=[];for(const s of Array.isArray(e)?e:[]){if(!s||s.kind!=="vl"||!s.nodeId)continue;const o=s.online===!0,a=o&&((n=s.session)==null?void 0:n.attached)===!0,u=s.ownerInstanceId||"local";t.push({kind:"vl",name:`vl-${s.nodeId.slice(0,8)}`,label:s.label,route:Array.isArray(s.route)?[...s.route]:[],instanceId:null,direct:!1,status:o?"up":"offline",downSince:o?null:s.lastSeen??null,sessions:a?[{key:`vl:${u}:${s.nodeId}`,name:s.session.profile,attached:!0}]:[],cells:[],unmanaged:[],fleetAvailable:!1,capabilities:[],engines:[],health:s.health??null,peer:s})}return t}function cy(e,t){const n=e&&Array.isArray(e.nodes)?e.nodes:[],s=new Set([t]),o=[];for(const a of n){const u=a&&typeof a.instanceId=="string"?a.instanceId:"";if(!u||s.has(u)||a.stale===!0||!Array.isArray(a.route)||a.route.length===0)continue;s.add(u);const h=typeof a.label=="string"&&a.label||typeof a.name=="string"&&a.name||a.route.join(" › ");o.push({instanceId:u,route:[...a.route],label:h})}return o}const ux=4e3;function nf(e,t=!0,n=0){const[s,o]=N.useState([]),a=N.useRef({});return N.useEffect(()=>{if(!t||!e){o([]);return}let u=!0;async function h(){var M;let m=[],v=[],b={},y="";if(await Promise.all([w0(e).then(V=>{m=Array.isArray(V.nodes)?V.nodes:[]}).catch(()=>{}),ey(e).then(V=>{v=Array.isArray(V.nodes)?V.nodes:[]}).catch(()=>{}),E0(e).then(V=>{b=V&&typeof V.aliasesByInstanceId=="object"?V.aliasesByInstanceId:{}}).catch(()=>{}),Ft("/api/config",e).then(V=>V.json()).then(V=>{y=V&&typeof V.instanceId=="string"?V.instanceId:""}).catch(()=>{})]),!u)return;const S=[{instanceId:y||null,route:[],label:null},...cy({nodes:v},y)],w=[];if(await Promise.all(S.map(async V=>{try{const G=await Z_(e,V.route);for(const O of G.nodes||[]){const Z=ly(O,V);Z&&w.push(Z)}}catch{}})),!u)return;const x={},k={},P=new Set(m.map(V=>V.name)),E=[];for(const V of m)((M=V.tunnel)==null?void 0:M.status)==="up"&&(V.nodeId||V.paired!==!1)&&(V.direction!=="inbound"||V.shared===!0)&&E.push([V.name]);for(const V of v)!V.stale&&Array.isArray(V.route)&&!(V.route.length===1&&P.has(V.route[0]))&&E.push(V.route);if(await Promise.all(E.map(async V=>{const G=V.join("/");try{x[G]=await Jh(e,V)}catch{x[G]={error:"unreachable"}}try{k[G]=await ws(e,V)}catch{k[G]={available:!1}}})),!u)return;const F=Rg({nodes:m,topology:v,remote:x,fleet:k,aliases:b,down:a.current});a.current=lx(a.current,F,Math.floor(Date.now()/1e3)),o([...Rg({nodes:m,topology:v,remote:x,fleet:k,aliases:b,down:a.current}),...cx(w)])}h();const f=setInterval(h,ux);return()=>{u=!1,clearInterval(f)}},[e,t,n]),s}const Pg=52,Lg=14;function bi({position:e,itemKey:t,label:n,onMove:s,onStep:o,canMove:a=()=>!0,scope:u="roster"}){const h=N.useRef(null),f=N.useRef(0),[m,v]=N.useState(!1),b=()=>{var P,E,F,M;const k=h.current;(E=(P=k==null?void 0:k.over)==null?void 0:P.classList)==null||E.remove("nc-roster-over"),(M=(F=k==null?void 0:k.source)==null?void 0:F.classList)==null||M.remove("nc-roster-dragging"),f.current&&cancelAnimationFrame(f.current),f.current=0},y=(k=!1)=>{const P=h.current;if(!P)return;const E=P.target;b(),h.current=null,v(!1);try{P.handle.releasePointerCapture(P.pointerId)}catch{}k&&E&&E!==t&&a(t,E)&&s(t,E)},S=(k,P)=>{var Z,X,Q,z,I,C,T,A,$;const E=h.current;if(!E)return;E.x=k,E.y=P;const F=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",M=(X=(Z=document.elementFromPoint(k,P))==null?void 0:Z.closest)==null?void 0:X.call(Z,F),V=u==="node"?(Q=M==null?void 0:M.dataset)==null?void 0:Q.nodeOrderKey:(z=M==null?void 0:M.dataset)==null?void 0:z.rosterKey,O=(u==="node"||((I=M==null?void 0:M.dataset)==null?void 0:I.position)===e)&&V&&V!==t&&a(t,V);E.over!==(O?M:null)&&((T=(C=E.over)==null?void 0:C.classList)==null||T.remove("nc-roster-over"),E.over=O?M:null,($=(A=E.over)==null?void 0:A.classList)==null||$.add("nc-roster-over")),E.target=O?V:null},w=()=>{const k=h.current;if(!k){f.current=0;return}const P=k.container;if(P){const E=P.getBoundingClientRect(),F=k.y<E.top+Pg?-Lg:k.y>E.bottom-Pg?Lg:0;F&&(P.scrollTop+=F,S(k.x,k.y))}f.current=requestAnimationFrame(w)};N.useEffect(()=>{const k=E=>{E.key==="Escape"&&h.current&&(E.preventDefault(),y(!1))},P=()=>y(!1);return window.addEventListener("keydown",k),window.addEventListener("blur",P),()=>{window.removeEventListener("keydown",k),window.removeEventListener("blur",P),b(),h.current=null}},[t,e,u]);const x=k=>{var M;if(k.pointerType==="mouse"&&k.button!==0)return;k.preventDefault(),k.stopPropagation(),k.currentTarget.focus({preventScroll:!0});const P=u==="node"?"[data-node-order-key]":"[data-roster-key][data-position]",E=k.currentTarget.closest(P),F=k.currentTarget.closest(".nc-side-scroll, .nc-home-scroll, .nc-cell-switcher-list");h.current={pointerId:k.pointerId,handle:k.currentTarget,source:E,container:F,target:null,over:null,x:k.clientX,y:k.clientY},(M=E==null?void 0:E.classList)==null||M.add("nc-roster-dragging");try{k.currentTarget.setPointerCapture(k.pointerId)}catch{}v(!0),f.current=requestAnimationFrame(w)};return c.jsx("button",{type:"button",className:`nc-roster-handle${m?" active":""}`,"aria-label":`${p("reorder")} ${n}`,"aria-keyshortcuts":"ArrowUp ArrowDown",title:p("reorder-help"),onClick:k=>{k.preventDefault(),k.stopPropagation()},onDragStart:k=>k.preventDefault(),onKeyDown:k=>{k.key!=="ArrowUp"&&k.key!=="ArrowDown"||(k.preventDefault(),k.stopPropagation(),o(k.key==="ArrowUp"?-1:1))},onPointerDown:x,onPointerMove:k=>{!h.current||k.pointerId!==h.current.pointerId||(k.preventDefault(),k.stopPropagation(),S(k.clientX,k.clientY))},onPointerUp:k=>{!h.current||k.pointerId!==h.current.pointerId||(k.preventDefault(),k.stopPropagation(),y(!0))},onPointerCancel:()=>y(!1),onLostPointerCapture:()=>{h.current&&y(!1)},children:"↕"})}const sf="nc_pins";function dx(){try{const e=JSON.parse(localStorage.getItem(sf));return Array.isArray(e)?e:[]}catch{return[]}}function hx(e,t){const n=e.includes(t)?e.filter(s=>s!==t):[...e,t];try{localStorage.setItem(sf,JSON.stringify(n))}catch{}return n}function fx(e,t,n){if(!e.includes(t)||!e.includes(n)||t===n)return e;const s=[...e],o=s.indexOf(t),a=s.indexOf(n);s.splice(o,1);const u=s.indexOf(n);s.splice(o<a?u+1:u,0,t);try{localStorage.setItem(sf,JSON.stringify(s))}catch{}return s}function px(e,t,n){const s=e.indexOf(t);return[s===-1?1e9:s,-(n||0)]}function mx(e,t){return e[0]-t[0]||e[1]-t[1]}function rf(){const[e,t]=N.useState(dx),[n,s]=N.useState(ix),[o,a]=N.useState(ex),u=y=>t(S=>hx(S,y)),h=y=>Cg(n,y),f=(y,S)=>s(w=>{const x={...w,[y]:{...Cg(w,y),...S}};return sx(x)}),m=(y,S)=>e.includes(y)===e.includes(S);function v(y,S,w,x){const k=e.includes(S),P=e.includes(w);if(k===P){if(k){t(E=>fx(E,S,w));return}a(E=>{var V;const F=((V=x.find(G=>G.key===S))==null?void 0:V.technical)===!0,M=gs(x,e,F?"technical":"all",Fi(E,y)).map(G=>G.key);return tx(nx(E,y,S,w,M))})}}function b(y,S,w,x){var V;const k=((V=x.find(G=>G.key===S))==null?void 0:V.technical)===!0,P=e.includes(S),E=gs(x,e,k?"technical":"all",Fi(o,y)).map(G=>G.key).filter(G=>e.includes(G)===P),F=E.indexOf(S),M=E[F+w];F>=0&&M&&v(y,S,M,x)}return{pins:e,views:n,orders:o,togglePin:u,viewFor:h,updateView:f,canMoveRoster:m,moveRoster:v,stepRoster:b}}const uy="nc_node_order_v1",gx=/^[a-f0-9]{16,64}$/;function qs(e){if(gx.test(String((e==null?void 0:e.instanceId)||"")))return`id:${e.instanceId}`;const t=Array.isArray(e==null?void 0:e.route)?e.route.filter(n=>typeof n=="string"&&n):[];return t.length?`route:${t.map(encodeURIComponent).join("/")}`:typeof(e==null?void 0:e.name)=="string"&&e.name?`name:${encodeURIComponent(e.name)}`:""}function Ag(e=globalThis.localStorage){try{const t=JSON.parse(e.getItem(uy));return Array.isArray(t)?[...new Set(t.filter(n=>typeof n=="string"&&n&&n.length<=192))].slice(0,128):[]}catch{return[]}}function vx(e,t=globalThis.localStorage){try{t.setItem(uy,JSON.stringify(e))}catch{}return e}function Tg(e=[],t=[]){const n=new Map(t.map((s,o)=>[s,o]));return e.map((s,o)=>({group:s,index:o})).sort((s,o)=>{const a=n.has(qs(s.group))?n.get(qs(s.group)):Number.MAX_SAFE_INTEGER,u=n.has(qs(o.group))?n.get(qs(o.group)):Number.MAX_SAFE_INTEGER;return a-u||s.index-o.index}).map(({group:s})=>s)}function _x(e,t,n,s=[]){if(!t||!n||t===n)return e;const o=s.map(qs).filter(Boolean);if(!o.includes(t)||!o.includes(n))return e;const a=[...e.filter(m=>o.includes(m)),...o.filter(m=>!e.includes(m))],u=a.indexOf(t),h=a.indexOf(n);a.splice(u,1);const f=a.indexOf(n);return a.splice(u<h?f+1:f,0,t),a}const Kd="nexuscrew-node-preferences";function yx(){try{window.dispatchEvent(new Event(Kd))}catch{}}function dy(){const[e,t]=N.useState(Ag);N.useEffect(()=>{const a=()=>t(Ag());return window.addEventListener("storage",a),window.addEventListener(Kd,a),()=>{window.removeEventListener("storage",a),window.removeEventListener(Kd,a)}},[]);const n=a=>Tg(a,e),s=(a,u,h)=>t(f=>{const m=_x(f,a,u,h);return vx(m),yx(),m});return{order:e,groupsFor:n,moveNode:s,stepNode:(a,u,h)=>{const f=Tg(h,e).map(qs),m=f.indexOf(a),v=f[m+u];m>=0&&v&&s(a,v,h)},nodeKey:qs}}function Tr(e,t=Math.floor(Date.now()/1e3)){if(!e)return"";const n=t-e;return n<0||n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Bi(e){return e.status==="passive"?p("node-passive"):e.status==="down"?e.downSince?p("tunnel-down-since").replace("{t}",Tr(e.downSince)):p("tunnel-down"):e.status==="unreachable"?p("node-unreachable"):e.status==="offline"?e.lastSeen?p("node-offline-seen").replace("{t}",Tr(e.lastSeen)):p("node-offline"):e.status==="needs-repair"?p("node-needs-repair"):""}function hy(e,{passive:t=null}={}){return e?e.status==="passive"?t:e.status==="healthy"?"on":"warn":null}function qo(e){return e&&(e.detail||e.status)||""}function zl(e,t,n=globalThis.localStorage){if(!(e!=null&&e.outbox)||e.outbox.count<1)return!1;const s=Number(n.getItem(V_(t))||0);return e.outbox.latest>s}function of(e,t={}){const n=e||{};if(!n.tmux){const s=`${n.engine||""}${n.key?`·${n.key}`:""}`,o=[s,n.model&&n.model!==s?n.model:""].filter(Boolean).join(" · ");return{working:!1,subtitle:String(o||p("cell-off")).trim()}}if(t.working===!0){const s=p("cell-working"),o=String(t.status||"").trim();return{working:!0,subtitle:!o||/^working(?:\.{3}|…)?$/i.test(o)?s:`${s} · ${o}`}}return t.working===!1?{working:!1,subtitle:p("cell-idle")}:{working:!1,subtitle:String(t.preview||n.preview||p("cell-on")).trim()}}function fy(e,t){return[...new Set([e.engine,e.model,e.key,t.preview,e.preview,t.status].filter(Boolean).map(String))].join(" ")}function af(e,t,n,s=globalThis.localStorage){return[...(Array.isArray(e)?e:[]).map(o=>{const a=n.get(o.tmuxSession)||{},u=Go([],o.tmuxSession),h=of(o,a);return{type:"cell",value:o,key:u,label:o.cell,live:!!o.tmux,fresh:zl(a,u,s),activity:a.activity||0,working:h.working,subtitle:h.subtitle,searchText:fy(o,a)}}),...(Array.isArray(t)?t:[]).map(o=>{const a=Go([],o.name);return{type:"session",value:o,key:a,label:o.name,live:!0,technical:o.technical===!0,fresh:zl(o,a,s),activity:o.activity||0,searchText:`${o.preview||""} ${o.cmd||""}`}})]}function Fl(e,t=globalThis.localStorage){const n=e||{},s=Array.isArray(n.route)?n.route:[],o=new Map((n.sessions||[]).map(u=>[u.name,u])),a=[...(n.cells||[]).map(u=>{const h=o.get(u.tmuxSession)||{},f=Go(s,u.tmuxSession||u.cell),m=of(u,h);return{type:"cell",value:u,key:f,label:u.cell,live:!!u.tmux,fresh:zl(h,f,t),activity:h.activity||u.activity||0,working:m.working,subtitle:m.subtitle,searchText:fy(u,h)}}),...(n.unmanaged||[]).map(u=>{const h=Go(s,u.name);return{type:"session",value:u,key:h,label:u.name,live:!0,technical:u.technical===!0,fresh:zl(u,h,t),activity:u.activity||0,searchText:`${u.preview||""} ${u.cmd||""}`}})];return{route:s,rawItems:a}}const lf=9,$l=.2,wx=/^[a-z0-9-]{1,32}(?:\/[a-z0-9-]{1,32}){0,3}$/,Dr=/^[a-f0-9]{16,64}$/,qd=e=>wx.test(e)&&new Set(e.split("/")).size===e.split("/").length;function ys(e){if(typeof e=="string"&&e){const t=e.indexOf(":");if(t<0)return{session:e};const n=e.slice(0,t),s=e.slice(t+1);return!qd(n)||!s?null:{session:s,node:n}}if(e&&typeof e=="object"&&typeof e.session=="string"&&e.session){const t=e.ownerId===void 0?void 0:typeof e.ownerId=="string"&&Dr.test(e.ownerId)?e.ownerId:null;return t===null?null:e.node===void 0||e.node===null||e.node===""?{session:e.session,...t?{ownerId:t}:{}}:typeof e.node=="string"&&qd(e.node)?{session:e.session,node:e.node,...t?{ownerId:t}:{}}:null}return null}function $n(e){const t=ys(e);return t?t.node?`${t.node}:${t.session}`:t.session:""}const py=9,my=24,ta=11,bx=e=>{const t=Number(e);return t>=py&&t<=my?t:ta};function Pr(){return{columns:[]}}function ki(e){return e.columns.flatMap(t=>t.tiles.map(n=>$n(n)))}function Sx(e){const t=[],n=Math.max(0,...e.columns.map(s=>s.tiles.length));for(let s=0;s<n;s+=1)for(const o of e.columns)o.tiles[s]&&t.push($n(o.tiles[s]));return t}const zr=e=>({columns:e.columns.map(t=>({width:t.width,tiles:t.tiles.map(n=>({...n}))}))});function cf(e,t,n,s){const o=ys(t);if(!o||ki(e).includes($n(o))||ki(e).length>=lf)return e;const a=zr(e),u={session:o.session,height:1,fontSize:ta,...s||{}};if(o.node&&(u.node=o.node),o.ownerId&&(u.ownerId=o.ownerId),n==="end")return a.columns.push({width:1,tiles:[u]}),a;if(n&&typeof n.col=="number"&&typeof n.row=="number"&&a.columns[n.col])return a.columns[n.col].tiles.splice(n.row,0,u),a;if(n&&typeof n.col=="number"){const h=Math.max(0,Math.min(a.columns.length,n.col));return a.columns.splice(h,0,{width:1,tiles:[u]}),a}return a.columns.push({width:1,tiles:[u]}),a}function gy(e,t){const n=$n(t);if(!n||ki(e).includes(n)||ki(e).length>=lf)return e;const s=ki(e).length+1,o=Math.ceil(Math.sqrt(s));if(e.columns.length>=o){let v=0;for(let b=1;b<e.columns.length;b+=1)e.columns[b].tiles.length<e.columns[v].tiles.length&&(v=b);return cf(e,t,{col:v,row:e.columns[v].tiles.length})}const a=[...Sx(e),n],u=new Map(e.columns.flatMap(v=>v.tiles.map(b=>[$n(b),b]))),h=ys(t),f=e.columns.length?e.columns.reduce((v,b)=>v+(Number(b.width)||1),0)/e.columns.length:1,m=Array.from({length:o},(v,b)=>{var y;return{width:((y=e.columns[b])==null?void 0:y.width)||f,tiles:[]}});return a.forEach((v,b)=>{const y=ys(v);if(!y)return;const S=u.get(v)||(v===n?h:{})||{},w={session:y.session,height:S.height||1,fontSize:S.fontSize||ta};y.node&&(w.node=y.node),S.ownerId&&(w.ownerId=S.ownerId),S.unavailable===!0&&(w.unavailable=!0),m[b%o].tiles.push(w)}),{columns:m.filter(v=>v.tiles.length)}}function Hl(e,t){const n=$n(t),s=zr(e);for(const o of s.columns)o.tiles=o.tiles.filter(a=>$n(a)!==n);return s.columns=s.columns.filter(o=>o.tiles.length>0),s}function xx(e,t,n){const s=$n(t);if(!ki(e).includes(s))return e;const o=e.columns.flatMap(a=>a.tiles).find(a=>$n(a)===s);return cf(Hl(e,s),s,n,{fontSize:o.fontSize,height:o.height,...o.ownerId?{ownerId:o.ownerId}:{},...o.unavailable===!0?{unavailable:!0}:{}})}function kx(e,t){if(!(t instanceof Map)||t.size===0)return e;let n=!1;const s=zr(e);for(const o of s.columns)for(const a of o.tiles){const u=t.get($n(a));if(!u)continue;const h=ys(u);h&&(a.session=h.session,h.node?a.node=h.node:delete a.node,h.ownerId&&(a.ownerId=h.ownerId),n=!0)}return n?Ys(s):e}function Cx(e,t,n){const s=zr(e);return s.columns[t]&&(s.columns[t].width=Math.max($l,Number(n)||1)),s}function Ex(e,t,n,s){const o=zr(e),a=o.columns[t]&&o.columns[t].tiles[n];return a&&(a.height=Math.max($l,Number(s)||1)),o}function Nx(e,t,n,s){if(!(e.columns[t]&&e.columns[t].tiles[n]))return e;const a=zr(e),u=a.columns[t].tiles[n],h=Number(u.fontSize)||ta;return u.fontSize=Math.max(py,Math.min(my,h+(Number(s)||0))),a}function jx(e,t,n,s){const o=e.columns[t];if(!o||!o.tiles[n])return null;switch(s){case"left":return{col:t};case"right":return{col:t+1};case"top":return{col:t,row:n};case"bottom":return{col:t,row:n+1};default:return null}}function Dg(e){for(const t of[.25,.5,.75])if(Math.abs(e-t)<=.03)return t;return e}function Ys(e){if(!e||!Array.isArray(e.columns))return Pr();const t=e.columns.map(s=>({width:Math.max($l,Number(s&&s.width)||1),tiles:(Array.isArray(s&&s.tiles)?s.tiles:[]).filter(o=>o&&typeof o.session=="string"&&o.session).filter(o=>o.node==null||typeof o.node=="string"&&qd(o.node)).filter(o=>o.ownerId==null||typeof o.ownerId=="string"&&Dr.test(o.ownerId)).map(o=>{const a={session:o.session,height:Math.max($l,Number(o.height)||1),fontSize:bx(o.fontSize)};return o.node!=null&&(a.node=o.node),o.ownerId!=null&&(a.ownerId=o.ownerId),o.unavailable===!0&&(a.unavailable=!0),a})})).filter(s=>s.tiles.length>0),n=new Set;for(const s of t)s.tiles=s.tiles.filter(o=>!n.has($n(o))&&n.add($n(o))&&n.size<=lf);return{columns:t.filter(s=>s.tiles.length>0)}}const vy=/^[a-z0-9-]{1,32}$/,Rx=/^[A-Za-z0-9._-]{1,32}$/,Px=/^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$/,Lx=320;function Vd(e){return typeof e=="string"&&vy.test(e)}const Ax=64;function Mr(e){if(typeof e!="string")return!1;const t=e.trim();return t.length>0&&t.length<=Ax&&!/[\x00-\x1f\x7f]/.test(t)}function vs(e){return String(e??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32).replace(/-+$/g,"")||"node"}function _y(e){if(typeof e!="string"||!e||e.length>Lx||e.startsWith("-")||/[\0-\x20\x7f]/.test(e))return!1;if(!e.includes("@"))return/^[A-Za-z0-9][A-Za-z0-9._:-]{0,254}$/.test(e);const t=e.indexOf("@");return t<=0||t!==e.lastIndexOf("@")?!1:Rx.test(e.slice(0,t))&&Px.test(e.slice(t+1))}function Mg(e){if(e===""||e===null||e===void 0)return null;const t=String(e).trim();if(!/^[0-9]{1,5}$/.test(t))return;const n=Number(t);return Number.isInteger(n)&&n>=1&&n<=65535?n:void 0}function Ig({name:e,ssh:t,sshPort:n,remotePort:s}={}){const o=typeof e=="string"?e.trim():e,a=typeof t=="string"?t.trim():t;if(!Vd(o))return{ok:!1,error:"err-node-name"};if(!_y(a))return{ok:!1,error:"err-ssh"};const u=Mg(n);if(u===void 0)return{ok:!1,error:"err-ssh-port"};const h=Mg(s);if(h===void 0)return{ok:!1,error:"err-node-port"};const f={name:o,ssh:a};return u!==null&&(f.sshPort=u),h!==null&&(f.remotePort=h),{ok:!0,value:f}}function Tx(e,t){if(!e||!t||t<e)return null;const n=Math.floor((t-e)/1e3);return n<60?"ora":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}g`}function Yd(e,t){const n=!!(e&&e.status==="up"),s=!!(e&&e.status==="passive");return{up:n,...s?{passive:!0}:{},label:n?"tunnel-up":s?"node-passive":"tunnel-down",since:n?Tx(e.since,t):null}}const Dx=new Set(["v","instanceId","port","label","invite"]),Mx=new Set(["v","instanceId","port","label","invite","name","ssh","sshPort"]);function Ix(e){const t=String(e).replace(/-/g,"+").replace(/_/g,"/"),n=t+"=".repeat((4-t.length%4)%4),s=typeof atob=="function"?atob(n):Buffer.from(n,"base64").toString("binary"),o=Uint8Array.from(s,a=>a.charCodeAt(0));return typeof TextDecoder<"u"?new TextDecoder().decode(o):Buffer.from(o).toString("utf8")}function Ox(e){let t="";try{const u=new URL(String(e));t=new URLSearchParams(u.hash.replace(/^#/,"")).get("pair")||""}catch{return{ok:!1}}if(!t)return{ok:!1};let n;try{n=JSON.parse(Ix(t))}catch{return{ok:!1}}if(!n||typeof n!="object"||Array.isArray(n))return{ok:!1};const s=n.v===1?Dx:n.v===2?Mx:null;if(!s)return{ok:!1};for(const u of Object.keys(n))if(!s.has(u))return{ok:!1};if(!/^[a-f0-9]{16,64}$/.test(String(n.instanceId)))return{ok:!1};const o=Number(n.port);if(!Number.isInteger(o)||o<1||o>65535)return{ok:!1};if(typeof n.label!="string")return{ok:!1};if(typeof n.invite!="string"||!n.invite)return{ok:!1};const a={ok:!0,version:n.v,label:n.label,invite:n.invite,instanceId:n.instanceId,port:o};if(n.v===2){if(n.name!==void 0){if(typeof n.name!="string"||!vy.test(n.name))return{ok:!1};a.name=n.name}if(n.ssh!==void 0){if(!_y(n.ssh))return{ok:!1};a.ssh=String(n.ssh).trim()}if(n.sshPort!==void 0){const u=Number(n.sshPort);if(!Number.isInteger(u)||u<1||u>65535)return{ok:!1};a.sshPort=u}}return a}function Bx(e,t,n=new Set){if(!t||!t.ok)return e;const s={...e},o=(a,u)=>{u==null||u===""||n.has(a)||(s[a]=u)};return o("label",t.label),t.version===2&&(o("name",t.name||(t.ssh?vs(t.label):"")),o("ssh",t.ssh),t.sshPort!==void 0&&o("sshPort",String(t.sshPort))),s}const zx=["KIMI_AUTH_ACTION_REQUIRED","CLIENT_INTERACTION_REQUIRED"],Fx=["kimi-code-consent-yes","kimi-code-config-custom-api-key","kimi-cli-login","client-terminal-dialog"];function uf(e){const t=e&&typeof e=="object"?e.actionRequired:null;return!t||typeof t!="object"||!zx.includes(t.code)||!Fx.includes(t.recovery)?null:{code:t.code,recovery:t.recovery,text:p(`fleet-recovery-${t.recovery}`)}}let Gd={sessions:[],cells:[],nodeGroups:[],localNodeId:"",localFresh:!1,refreshedAt:0};function Og(){return Gd}function yy(e={}){return Gd={sessions:Array.isArray(e.sessions)?e.sessions:[],cells:Array.isArray(e.cells)?e.cells:[],nodeGroups:Array.isArray(e.nodeGroups)?e.nodeGroups:[],localNodeId:typeof e.localNodeId=="string"?e.localNodeId:"",localFresh:e.localFresh===!0,refreshedAt:Number.isFinite(e.refreshedAt)?e.refreshedAt:0},Gd}const kr=(e,t=[])=>`${t.length?t.join("/"):"local"}:${e}`;function $x({onPick:e,token:t,onSettings:n,onOpenVlSession:s}){const[o,a]=kn(),u=nf(t),[h,f]=N.useState(null),[m,v]=N.useState(null),[b,y]=N.useState(""),[S,w]=N.useState(""),[x,k]=N.useState({bind:"127.0.0.1",port:""}),[P,E]=N.useState(""),[F,M]=N.useState([]),[V,G]=N.useState([]),[O,Z]=N.useState({}),[X,Q]=N.useState(new Set),[z,I]=N.useState(null),[C,T]=N.useState(null),{pins:A,orders:$,togglePin:U,viewFor:R,updateView:K,canMoveRoster:B,moveRoster:j,stepRoster:D}=rf(),{groupsFor:W,moveNode:ne,stepNode:ce,nodeKey:pe}=dy(),ye=W(u);N.useEffect(()=>{yy({sessions:h||[],cells:F,nodeGroups:u,localNodeId:P})},[h,F,u,P]),N.useEffect(()=>{const H=new Map;for(const le of F)H.set(kr(le.cell),!!le.boot);for(const le of u){const ue=le.route||[le.name];for(const ge of le.cells||[])H.set(kr(ge.cell,ue),!!ge.boot)}Z(le=>{let ue=!1;const ge={...le};for(const[Le,_e]of Object.entries(le))H.has(Le)&&H.get(Le)===_e&&(delete ge[Le],ue=!0);return ue?ge:le})},[F,u]);async function me(){try{const le=await(await Ft("/api/sessions",t)).json();le.error?(v(le.error),f([])):(v(null),f(le.sessions||[]))}catch(H){v(String(H)),f([])}try{const H=await ws(t);M(H.available?H.cells||[]:[]),G(H.available?H.capabilities||[]:[])}catch{M([]),G([])}}N.useEffect(()=>{me(),Ft("/api/config",t).then(le=>le.json()).then(le=>{w(le.version||""),k({bind:le.bind||"127.0.0.1",port:le.port||""}),E(Dr.test(String(le.instanceId||""))?le.instanceId:"")}).catch(()=>{});const H=setInterval(me,4e3);return()=>clearInterval(H)},[]);async function ae(){if(!x.port)return;const H=`http://${x.bind}:${x.port}/#token=${t}`;try{await navigator.clipboard.writeText(H)}catch{}}function Pe(H,le,ue){const ge=kr(H,le);Z(Le=>({...Le,[ge]:!!ue}))}function rt(H,le=[]){const ue=kr(H.cell,le);return Object.prototype.hasOwnProperty.call(O,ue)?O[ue]:!!H.boot}async function Xe(H,le,ue=[]){H.stopPropagation();const ge=kr(le.cell,ue),Le=!rt(le,ue);Pe(le.cell,ue,Le),Q(_e=>new Set(_e).add(ge));try{await Y_(t,{cell:le.cell,enabled:Le},ue),ue.length||M(_e=>_e.map(Ce=>Ce.cell===le.cell?{...Ce,boot:Le}:Ce))}catch(_e){Z(Ce=>{const tt={...Ce};return delete tt[ge],tt}),v(String((_e==null?void 0:_e.message)||_e))}finally{Q(_e=>{const Ce=new Set(_e);return Ce.delete(ge),Ce})}}async function Me(H){if(!z)return;const{cell:le}=z,ue=Array.isArray(z.route)?z.route:[];if(H.action==="up"){const ge=await Yh(t,{cell:le,boot:!!H.boot,...H.engine?{engine:H.engine}:{},...H.model!==void 0?{model:H.model}:{},...H.permissionPolicy?{permissionPolicy:H.permissionPolicy}:{}},ue),Le=uf(ge);Le&&v(Le.text),Pe(le,ue,!!H.boot)}else await Il(t,{cell:le,boot:!!H.boot},ue),H.boot&&Pe(le,ue,!1);me()}async function qt(H,le=[]){try{await Xh(t,H,le)}catch{return}me()}async function wn(H,le,ue=[]){try{await Q_(t,H,le,ue)}catch{return}me()}async function Be(H){if(!(!(H!=null&&H.direct)||C)){T(H.name);try{await ef(t,H.name,H.tunnelStatus==="up"?"down":"up")}catch{}T(null)}}async function $t(H){if(!(H!=null&&H.direct))return;const le=window.prompt(p("rename-node-prompt"),H.label||H.name);if(le===null)return;const ue=String(le).trim();if(!Mr(ue)){window.alert(p("rename-node-invalid"));return}try{await ty(t,H.name,ue)}catch(ge){window.alert(String((ge==null?void 0:ge.message)||ge))}}const Nt=N.useMemo(()=>new Map((h||[]).map(H=>[H.name,H])),[h]),At=N.useMemo(()=>new Set(F.map(H=>H.tmuxSession)),[F]),mt=N.useMemo(()=>(h||[]).filter(H=>!At.has(H.name)),[h,At]),dt=N.useMemo(()=>af(F,mt,Nt),[F,mt,Nt]),ut=R("local"),re=N.useMemo(()=>gs(dt,A,ut.filter,Fi($,"local")).filter(H=>Eg(H,b)),[dt,A,ut.filter,b,$]),xe=ye.reduce((H,le)=>H+(le.cells||[]).length+(le.unmanaged||[]).filter(ue=>!ue.technical).length,0),Ie=gs(dt,A,"all",Fi($,"local")).length+xe,Fe=dt.filter(H=>H.live).length+ye.reduce((H,le)=>H+Fl(le).rawItems.filter(ue=>ue.live).length,0),he=(h||[]).filter(H=>H.attached).length+ye.reduce((H,le)=>H+(le.sessions||[]).filter(ue=>ue.attached).length,0),ze=Math.min(he,Fe),q=x.port?`${x.bind}:${x.port}`:x.bind;function te(H,le=null,ue=dt){var Tt,lt;const ge=Array.isArray(le==null?void 0:le.route)?le.route:[],Le=ge.join("/"),_e=Le||"local",Ce=ge.length?le==null?void 0:le.instanceId:P,tt=(Ze,Jt)=>e({session:Ze,...Le?{node:Le}:{},...Dr.test(String(Ce||""))?{ownerId:Ce}:{},...typeof Jt=="string"&&Jt?{cellName:Jt}:{}}),ot=B;if(H.type==="cell"){const Ze=H.value,Jt=ge.length?((le==null?void 0:le.sessions)||[]).find(ht=>ht.name===Ze.tmuxSession):Nt.get(Ze.tmuxSession),ni=Ze.degraded?p("cell-degraded"):H.working?H.subtitle:Ze.tmux?p("cell-idle"):p("cell-off"),Wn=ge.length===0||((le==null?void 0:le.capabilities)||[]).includes(Ze.active?"down":"up"),ui=ge.length===0?V.includes("boot"):((le==null?void 0:le.capabilities)||[]).includes("boot"),de=rt(Ze,ge),Ne=kr(Ze.cell,ge),Ke=`${p(de?"boot-disable":"boot-enable")} ${Ze.cell}`;return c.jsxs("div",{className:"nc-mcard","data-roster-key":H.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:H.key,label:Ze.cell,canMove:ot,onMove:(ht,gt)=>j(_e,ht,gt,ue),onStep:ht=>D(_e,H.key,ht,ue)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>Ze.tmux&&tt(Ze.tmuxSession,Ze.cell),title:ni,"aria-label":`${Ze.cell}, ${ni}`,children:[c.jsx("span",{className:`dot ${Ze.degraded?"warn":Ze.tmux?`on${H.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:Ze.cell}),c.jsx("small",{title:H.subtitle,children:H.subtitle})]})]}),H.activity?c.jsx("span",{className:"nc-rel",children:Tr(H.activity)}):null,H.fresh&&((Tt=Jt==null?void 0:Jt.outbox)==null?void 0:Tt.count)>0&&c.jsx("span",{className:"nc-badge",title:p("new-files-outbox"),children:Jt.outbox.count}),c.jsx("button",{className:`nc-act pin${A.includes(H.key)?" on":""}`,"aria-label":`${p("pin")} ${Ze.cell}`,title:p("pin"),onClick:()=>U(H.key),children:A.includes(H.key)?"★":"☆"}),ui&&c.jsx("button",{className:`nc-act boot${de?" on":""}`,disabled:X.has(Ne),onClick:ht=>Xe(ht,Ze,ge),title:Ke,"aria-label":Ke,children:c.jsx(Je,{name:"boot",size:16})}),Wn&&c.jsx("button",{className:`nc-act power${Ze.tmux?" on":""}${Ze.degraded?" warn":""}`,onClick:()=>I(ge.length?{...Ze,boot:de,route:ge,availableEngines:(le==null?void 0:le.engines)||[]}:{...Ze,boot:de}),title:Ze.active?p("power-off"):p("power-on"),"aria-label":`${Ze.active?p("power-off"):p("power-on")} ${Ze.cell}`,children:c.jsx(Je,{name:"power",size:16})})]},H.key)}const Qe=H.value;return c.jsxs("div",{className:"nc-mcard","data-roster-key":H.key,"data-position":_e,children:[c.jsx(bi,{position:_e,itemKey:H.key,label:Qe.name,canMove:ot,onMove:(Ze,Jt)=>j(_e,Ze,Jt,ue),onStep:Ze=>D(_e,H.key,Ze,ue)}),c.jsxs("button",{className:"nc-mcard-main",onClick:()=>tt(Qe.name),children:[c.jsx("span",{className:Qe.attached?"dot on":"dot"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:Qe.name}),c.jsx("small",{children:Qe.preview?Qe.preview:Qe.cmd?Qe.cmd:p("windows").replace("{n}",String(Qe.windows||0))})]})]}),H.activity?c.jsx("span",{className:"nc-rel",children:Tr(H.activity)}):null,H.fresh&&((lt=Qe.outbox)==null?void 0:lt.count)>0&&c.jsx("span",{className:"nc-badge",title:p("new-files-outbox"),children:Qe.outbox.count}),c.jsx("button",{className:`nc-act pin${A.includes(H.key)?" on":""}`,"aria-label":`${p("pin")} ${Qe.name}`,title:p("pin"),onClick:()=>U(H.key),children:A.includes(H.key)?"★":"☆"}),c.jsx("button",{className:`nc-act technical${Qe.technical?" on":""}`,title:Qe.technical?p("mark-normal"):p("mark-technical"),"aria-label":`${Qe.technical?p("mark-normal"):p("mark-technical")} ${Qe.name}`,onClick:()=>wn(Qe.name,!Qe.technical,ge),children:"T"}),c.jsx("button",{className:"nc-menu",title:p("terminate"),"aria-label":`${p("terminate")} ${Qe.name}`,onClick:()=>{window.confirm(p("terminate-confirm").replace("{name}",Qe.name))&&qt(Qe.name,ge)},children:"⋯"})]},H.key)}return c.jsxs("div",{className:"nc-home",children:[c.jsxs("header",{className:"nc-home-head",children:[c.jsxs("div",{className:"nc-wordmark",children:["NexusCrew",c.jsx("span",{className:"nc-cursor"})]}),c.jsxs("div",{className:"nc-home-sub",children:[p("fleet-tmux")," · ",Fe," ",p("sessions"),ze>0&&` · ${ze} attached`]}),c.jsxs("span",{className:"nc-head-actions",children:[c.jsx("button",{className:"nc-refresh",onClick:()=>n("nodes",!1),title:p("settings"),children:c.jsx(Je,{name:"gear",size:18})}),c.jsx("button",{className:"nc-refresh",onClick:me,title:p("refresh"),children:c.jsx(Je,{name:"refresh",size:18})})]})]}),c.jsxs("main",{className:"nc-home-scroll",children:[Ie>8&&c.jsx("input",{className:"nc-filter",type:"search",placeholder:p("filter-placeholder"),"aria-label":p("filter-placeholder"),value:b,onChange:H=>y(H.target.value)}),m&&c.jsx("div",{className:"nc-err",children:m}),c.jsxs("section",{className:"nc-group","data-position":"local",children:[c.jsx(Gu,{label:p("position-local"),count:re.length,state:ut,dotClass:"on",onToggle:()=>K("local",{open:!ut.open}),onFilter:H=>K("local",{filter:H})}),ut.open&&re.map(H=>te(H,null,dt)),ut.open&&h===null&&c.jsx("div",{className:"nc-empty",children:p("loading-fleet")}),ut.open&&h!==null&&re.length===0&&!m&&c.jsx("div",{className:"nc-empty",children:b?p("no-match").replace("{q}",b):p("no-sessions-short")})]}),ye.map(H=>{const ue=hy(H.health,{passive:"warn"})||(H.status==="up"?"on":H.status==="passive"?"":"warn"),ge=H.health?qo(H.health):H.status==="up"?"":Bi(H),_e=(H.route&&H.route.length?H.route:[H.name]).join("/"),Ce=R(_e);if(H.kind==="vl")return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":pe(H),children:[c.jsx(Gu,{label:H.label||H.name,count:H.sessions.length,state:Ce,dotClass:ue,dotTitle:ge,detail:H.status==="up"?"":Bi(H),onToggle:()=>K(_e,{open:!Ce.open}),onFilter:lt=>K(_e,{filter:lt})}),H.status==="up"&&Ce.open&&H.sessions.map(lt=>c.jsx("div",{className:"nc-mcard nc-vl-session-row",children:c.jsxs("button",{className:"nc-mcard-main",onClick:()=>s&&s(H.peer),"aria-label":`${H.label||H.name}: ${lt.name}`,children:[c.jsx("span",{className:"dot on"}),c.jsxs("span",{className:"nc-mcard-text",children:[c.jsx("b",{children:lt.name}),c.jsx("small",{children:p("vl-events-title")})]})]})},lt.key)),H.status==="up"&&Ce.open&&H.sessions.length===0&&c.jsx("div",{className:"nc-empty",children:p("no-sessions-short")})]},`nodo-vl-${_e}-${H.name}`);const{rawItems:tt}=Fl(H),ot=gs(tt,A,Ce.filter,Fi($,_e)).filter(lt=>Eg(lt,b)),Qe=H.direct&&H.health&&H.health.managed!==!1?c.jsx("button",{type:"button",className:`nc-act power${H.tunnelStatus==="up"?" on":""}`,disabled:C===H.name,title:H.tunnelStatus==="up"?p("power-off"):p("power-on"),"aria-label":`${H.tunnelStatus==="up"?p("power-off"):p("power-on")} ${H.label||H.name}`,onClick:()=>Be(H),children:c.jsx(Je,{name:"power",size:15})}):null,Tt=c.jsxs("span",{className:"nc-node-actions",children:[c.jsx(bi,{scope:"node",position:"nodes",itemKey:pe(H),label:H.label||H.name,onMove:(lt,Ze)=>ne(lt,Ze,u),onStep:lt=>ce(pe(H),lt,u)}),H.direct&&c.jsx("button",{type:"button",className:"nc-node-rename",title:p("rename-node"),"aria-label":`${p("rename-node")} ${H.label||H.name}`,onClick:()=>$t(H),children:"✎"}),Qe]});return c.jsxs("section",{className:"nc-group nc-node-order-wrap","data-position":_e,"data-node-order-key":pe(H),children:[c.jsx(Gu,{label:H.label||H.name,count:ot.length,state:Ce,dotClass:ue,dotTitle:ge,detail:H.status==="up"?"":H.health&&qo(H.health)||Bi(H),onToggle:()=>K(_e,{open:!Ce.open}),onFilter:lt=>K(_e,{filter:lt}),onRename:H.direct?()=>$t(H):null,action:Tt}),H.status==="up"&&Ce.open&&ot.map(lt=>te(lt,H,tt)),H.status==="up"&&Ce.open&&ot.length===0&&c.jsx("div",{className:"nc-empty",children:b?p("no-match").replace("{q}",b):p("no-sessions-short")})]},`nodo-${_e}`)}),c.jsxs("footer",{className:"nc-home-foot",onClick:ae,title:p("copy-url"),children:[c.jsxs("span",{className:"nc-home-meta",children:[S&&c.jsxs("span",{className:"nc-home-version",children:["v",S]}),c.jsxs("span",{className:"nc-home-endpoint",children:[q," · ",p("ssh-only")]})]}),c.jsx("span",{className:"nc-lang",onClick:H=>H.stopPropagation(),children:ay.map((H,le)=>c.jsxs("span",{children:[le>0&&" · ",c.jsx("button",{className:`nc-lang-btn${o===H?" on":""}`,onClick:()=>a(H),title:H,children:H.toUpperCase()})]},H))})]})]}),c.jsx("button",{className:"nc-fab",onClick:()=>n("fleet",!0),title:p("fleet-new-cell"),"aria-label":p("fleet-new-cell"),children:"+"}),z&&c.jsx(Bl,{cell:z,token:t,route:Array.isArray(z.route)?z.route:[],onConfirm:Me,onClose:()=>I(null)})]})}function Gu({label:e,count:t,state:n,dotClass:s="",dotTitle:o="",detail:a="",onToggle:u,onFilter:h,onRename:f=null,action:m=null}){return c.jsxs("div",{className:"nc-mobile-position-head",onContextMenu:f?v=>{v.preventDefault(),f()}:void 0,children:[c.jsxs("button",{type:"button",className:"nc-mobile-position-toggle",onClick:u,"aria-expanded":n.open,"aria-label":`${e} · ${p("node-sessions").replace("{n}",String(t))}`,children:[c.jsx("span",{className:"nc-mobile-chevron","aria-hidden":"true",children:n.open?"⌄":"›"}),c.jsx("span",{className:`dot ${s}`,title:o}),c.jsxs("span",{className:"nc-mobile-position-copy",children:[c.jsx("b",{children:e}),c.jsx("small",{children:a||p("node-sessions").replace("{n}",String(t))})]})]}),c.jsxs("select",{className:"nc-mobile-position-filter",value:n.filter,"aria-label":`${e} · ${p("filter-placeholder")}`,title:p(`view-${n.filter}`),onChange:v=>h(v.target.value),children:[c.jsx("option",{value:"all",children:p("view-all")}),c.jsx("option",{value:"pinned",children:p("view-pinned")}),c.jsx("option",{value:"active",children:p("view-active")}),c.jsx("option",{value:"off",children:p("view-off")}),c.jsx("option",{value:"technical",children:p("view-technical")})]}),m]})}/**
41
41
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
42
42
  * @license MIT
43
43
  *
@@ -90,4 +90,4 @@ Minimum version required to store current data is: `+z+`.
90
90
  `).filter(o=>o!==""),promptMode:e.promptMode};return e.modelFlag&&(s.model={flag:e.modelFlag,value:e.modelValue||""}),e.promptMode==="flag"&&(s.promptFlag=e.promptFlag),t&&(s.env=Object.fromEntries(e.envRows.filter(o=>!o.remove&&o.key).map(o=>[o.key,o.value]))),s}function $s({children:e,onClose:t,label:n,error:s=""}){const o=N.useRef(null),a=N.useRef(null),u=N.useRef(t);return u.current=t,N.useEffect(()=>{const h=document.activeElement,f=o.current,m=()=>Array.from((f==null?void 0:f.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'))||[]).filter(y=>y.offsetParent!==null),v=requestAnimationFrame(()=>{var y;return(y=m()[0]||f)==null?void 0:y.focus({preventScroll:!0})}),b=y=>{var k;if(y.key==="Escape"){y.preventDefault(),(k=u.current)==null||k.call(u);return}if(y.key!=="Tab")return;const S=m();if(!S.length){y.preventDefault(),f==null||f.focus();return}const w=S[0],x=S[S.length-1];y.shiftKey&&document.activeElement===w?(y.preventDefault(),x.focus()):!y.shiftKey&&document.activeElement===x&&(y.preventDefault(),w.focus())};return document.addEventListener("keydown",b),()=>{cancelAnimationFrame(v),document.removeEventListener("keydown",b),h&&h.isConnected&&typeof h.focus=="function"&&h.focus({preventScroll:!0})}},[]),N.useEffect(()=>{s&&requestAnimationFrame(()=>{var h;return(h=a.current)==null?void 0:h.scrollIntoView({block:"nearest"})})},[s]),c.jsx("div",{className:"nc-fleet-modal",role:"presentation",onMouseDown:h=>{h.target===h.currentTarget&&t()},children:c.jsxs("div",{ref:o,className:"nc-fleet-modal-dialog",role:"dialog","aria-modal":"true","aria-label":n||p("settings"),tabIndex:-1,children:[e,s&&c.jsx("div",{ref:a,className:"nc-err nc-fleet-modal-error",role:"alert","aria-live":"assertive",children:s})]})})}function zd({token:e,targets:t=[],readonly:n=!1,onPower:s,onImport:o}){const[a,u]=N.useState([]),[h,f]=N.useState(0);N.useEffect(()=>{let k=!0;async function P(){const F=[{route:[],label:p("local")}].concat((t||[]).map(V=>({route:Array.isArray(V.route)?V.route:[],label:V.label||(V.route||[]).join(" › ")}))),M=await Promise.all(F.map(async V=>{const G={...V,available:!1,readonly:!1,capabilities:[],provider:null,cells:[],unmanaged:[],err:""};try{const O=await ws(e,V.route);G.available=!!O.available,G.capabilities=O.capabilities||[],G.provider=O.provider||null,G.cells=(O.cells||[]).map(Z=>({...Z,route:V.route}));try{G.readonly=!!(await Zh(e,V.route)).readonlyDefault}catch{}try{const Z=await Jh(e,V.route),X=new Set(G.cells.map(Q=>Q.tmuxSession).filter(Boolean));G.unmanaged=(Z.sessions||[]).filter(Q=>Q&&!X.has(Q.name))}catch{}}catch(O){G.err=String(O&&O.message||O)}return G}));k&&u(M)}P();const E=setInterval(P,6e3);return()=>{k=!1,clearInterval(E)}},[e,t,h]);const m=(k,P)=>Array.isArray(k.capabilities)&&k.capabilities.includes(P)&&!n&&!k.readonly,v=()=>f(k=>k+1),b=(k,P)=>{s&&s({...k,route:P})},y=(k,P)=>{s&&s({...k,route:P})},S=async(k,P)=>{try{await Fo(e,k.cell,P)}catch{}v()},w=async(k,P)=>{if(window.confirm(p("fleet-remove-cell").replace("{id}",k.cell))){try{await X_(e,k.cell,!0,P)}catch{}v()}},x=async(k,P)=>{if(window.confirm(p("terminate-confirm").replace("{name}",k.name))){try{await Xh(e,k.name,P)}catch{}v()}};return c.jsxs("div",{className:"nc-fleet-inventory",children:[c.jsxs("div",{className:"nc-fleet-section-head",children:[c.jsx("b",{children:p("fleet-inventory")}),c.jsx("small",{children:p("fleet-inventory-help")})]}),a.map(k=>{const P=k.route.length?k.route.join("/"):"local";return c.jsxs("div",{className:"nc-fleet-pos",children:[c.jsxs("div",{className:"nc-fleet-pos-title",children:[c.jsx("span",{className:`dot ${k.available?"on":"warn"}`}),c.jsx("b",{children:k.label}),c.jsx("small",{children:k.available?`${k.cells.length} ${p("fleet-cells")} · ${k.unmanaged.length} ${p("fleet-tmux")}`:k.err||p("fleet-not-available")})]}),k.cells.map(E=>c.jsxs("div",{className:"nc-fleet-item nc-fleet-cell",children:[c.jsxs("span",{children:[c.jsx("b",{children:E.cell}),c.jsx("small",{children:`${E.engine||""}${E.key?`·${E.key}`:""}${E.active?"":` · ${p("cell-off")}`}`})]}),c.jsxs("span",{className:"nc-fleet-cell-actions",children:[E.active&&m(k,"down")&&c.jsx("button",{className:"nc-btn ghost",title:p("power-off"),onClick:()=>y(E,k.route),children:p("stop")}),!E.active&&m(k,"up")&&c.jsx("button",{className:"nc-btn ghost",title:p("power-on"),onClick:()=>b(E,k.route),children:p("start")}),m(k,"restart")&&E.active&&c.jsx("button",{className:"nc-btn ghost",title:p("restart"),onClick:()=>S(E,k.route),children:p("restart")}),m(k,"remove")&&c.jsx("button",{className:"nc-btn danger",title:p("delete"),onClick:()=>w(E,k.route),children:"×"})]})]},`${P}:${E.cell}`)),k.unmanaged.map(E=>c.jsxs("div",{className:"nc-fleet-item nc-fleet-unmanaged",children:[c.jsxs("span",{children:[c.jsx("b",{children:E.name}),c.jsx("small",{children:p("fleet-tmux")})]}),c.jsxs("span",{className:"nc-fleet-cell-actions",children:[m(k,"import")&&o&&c.jsx("button",{className:"nc-btn ghost",title:p("import-as-cell"),onClick:()=>o(E,k.route),children:p("import-as-cell")}),c.jsx("button",{className:"nc-btn danger",title:p("terminate"),onClick:()=>x(E,k.route),children:"×"})]})]},`${P}:u:${E.name}`)),k.available&&k.cells.length===0&&k.unmanaged.length===0&&c.jsx("div",{className:"nc-empty",children:p("fleet-inventory-empty")})]},P)})]})}function V2({cells:e=[],engines:t=[],busy:n,canRestore:s=!1,onRestore:o,onClose:a}){const[u,h]=N.useState("export"),[f,m]=N.useState(()=>new Set(e.map(C=>C.id))),[v,b]=N.useState(()=>new Set(t.map(C=>C.id))),[y,S]=N.useState([]),[w,x]=N.useState([]),[k,P]=N.useState(""),E=new Set(t.map(C=>C.id)),F=new Set(e.map(C=>C.id)),M=(C,T)=>C(A=>{const $=new Set(A);return $.has(T)?$.delete(T):$.add(T),$}),V=()=>{const C=F2(e,f,t,v);if(C.ok===!1){P(p(`fleet-backup-${C.error}`));return}const T=e.filter(K=>f.has(K.id)).length,A=t.filter(K=>v.has(K.id)).length;if(C.cells.length!==T){P(p("fleet-backup-invalid-cell"));return}if(C.engines.length!==A){P(p("fleet-backup-invalid-engine"));return}if(!C.cells.length&&!C.engines.length){P(p("fleet-backup-select-one"));return}const $=new Blob([`${JSON.stringify(C,null,2)}
91
91
  `],{type:"application/json"}),U=URL.createObjectURL($),R=document.createElement("a");R.href=U,R.download=`nexuscrew-fleet-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(R),R.click(),R.remove(),setTimeout(()=>URL.revokeObjectURL(U),0),P("")},G=async C=>{if(P(""),S([]),x([]),!!C){if(C.size>1024*1024){P(p("fleet-backup-too-large"));return}try{const T=$2(await C.text());if(!T.ok){P(p(`fleet-backup-${T.error}`));return}const A=new Set(T.engines.map($=>$.id));x(T.engines.map($=>({engine:$,exists:E.has($.id),selected:!E.has($.id)}))),S(T.cells.map($=>{const U=E.has($.engine)||A.has($.engine),R=F.has($.id);return{cell:$,engine:U?$.engine:"",selected:U&&!R,exists:R}}))}catch(T){P(String(T.message||T))}}},O=(C,T)=>S(A=>A.map(($,U)=>U===C?{...$,...T}:$)),Z=(C,T)=>x(A=>A.map(($,U)=>U===C?{...$,...T}:$)),X=new Set([...E,...w.filter(C=>C.selected).map(C=>C.engine.id)]),Q=y.filter(C=>C.selected&&C.engine&&X.has(C.engine)),z=w.filter(C=>C.selected),I=[...new Map([...t.map(C=>[C.id,C.label||C.id]),...w.filter(C=>C.selected).map(C=>[C.engine.id,C.engine.label||C.engine.id])]).entries()];return c.jsxs("div",{className:"nc-set-form nc-fleet-form nc-backup-dialog",children:[c.jsx("b",{children:p("fleet-backup")}),c.jsx("small",{children:p("fleet-backup-help")}),c.jsxs("div",{className:"nc-set-tabs nc-backup-tabs",children:[c.jsx("button",{type:"button",className:`nc-set-tabbtn${u==="export"?" on":""}`,onClick:()=>{h("export"),P("")},children:p("fleet-backup-export")}),c.jsx("button",{type:"button",className:`nc-set-tabbtn${u==="import"?" on":""}`,disabled:!s,title:s?"":p("fleet-backup-restore-unavailable"),onClick:()=>{h("import"),P("")},children:p("fleet-backup-import")})]}),u==="export"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{m(new Set(e.map(C=>C.id))),b(new Set(t.map(C=>C.id)))},children:p("select-all")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{m(new Set),b(new Set)},children:p("select-none")})]}),c.jsxs("div",{className:"nc-backup-list",children:[c.jsx("b",{children:p("fleet-engines")}),t.map(C=>{var T;return c.jsxs("label",{className:"nc-check nc-backup-row",children:[c.jsx("input",{type:"checkbox",checked:v.has(C.id),onChange:()=>M(b,C.id)}),c.jsxs("span",{children:[c.jsx("b",{children:C.label||C.id}),c.jsxs("small",{children:[C.id,(T=C.envKeys)!=null&&T.length?` · ${C.envKeys.length} ${p("fleet-backup-env-names")}`:""]})]})]},C.id)}),c.jsx("b",{children:p("fleet-cells")}),e.map(C=>c.jsxs("label",{className:"nc-check nc-backup-row",children:[c.jsx("input",{type:"checkbox",checked:f.has(C.id),onChange:()=>M(m,C.id)}),c.jsxs("span",{children:[c.jsx("b",{children:C.id}),c.jsxs("small",{children:[C.engine," · ",p("fleet-system-prompt")," ",(C.prompt||"").length," ",p("characters")]})]})]},C.id)),!e.length&&!t.length&&c.jsx("div",{className:"nc-empty",children:p("fleet-backup-empty")})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:a,children:p("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:!f.size&&!v.size,onClick:V,children:p("fleet-backup-download")})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"file",accept:"application/json,.json",disabled:n,onChange:C=>G(C.target.files&&C.target.files[0])}),c.jsx("small",{children:p("fleet-backup-import-help")}),!!(y.length||w.length)&&c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{x(C=>C.map(T=>({...T,selected:!0}))),S(C=>C.map(T=>({...T,selected:!!T.engine})))},children:p("select-all")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>{x(C=>C.map(T=>({...T,selected:!1}))),S(C=>C.map(T=>({...T,selected:!1})))},children:p("select-none")})]}),c.jsxs("div",{className:"nc-backup-list",children:[!!w.length&&c.jsx("b",{children:p("fleet-engines")}),w.map((C,T)=>{var A;return c.jsx("div",{className:"nc-backup-import-row",children:c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:C.selected,onChange:$=>Z(T,{selected:$.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:C.engine.label||C.engine.id}),c.jsxs("small",{children:[C.engine.id," · ",C.exists?p("fleet-backup-overwrite"):p("fleet-backup-new"),(A=C.engine.envKeys)!=null&&A.length?` · ${p("fleet-backup-env-values-required")}`:""]})]})]})},C.engine.id)}),!!y.length&&c.jsx("b",{children:p("fleet-cells")}),y.map((C,T)=>c.jsxs("div",{className:"nc-backup-import-row",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:C.selected,disabled:!C.engine||!X.has(C.engine),onChange:A=>O(T,{selected:A.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:C.cell.id}),c.jsxs("small",{children:[C.exists?p("fleet-backup-overwrite"):p("fleet-backup-new")," · ",p("fleet-system-prompt")," ",C.cell.systemPrompt.length," ",p("characters")]})]})]}),c.jsxs("select",{value:C.engine,onChange:A=>O(T,{engine:A.target.value,selected:!!A.target.value}),children:[c.jsx("option",{value:"",children:p("fleet-backup-engine-missing")}),I.map(([A,$])=>c.jsx("option",{value:A,children:$},A))]})]},C.cell.id))]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:a,children:p("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||!Q.length&&!z.length,onClick:()=>o({engineRows:w,cellRows:y}),children:p("fleet-backup-restore")})]})]}),k&&c.jsx("div",{className:"nc-err",children:k})]})}function Y2({state:e,setState:t,busy:n,onSave:s,catalog:o}){var P;const a=e.form,u=E=>t({...e,form:{...a,...E}}),h=a.envRows||[],f=[...new Map(o.map(E=>[E.client,E.clientLabel||E.client])).entries()],m=o.filter(E=>E.client===a.client),v=Zo(o,a),b=typeof(v==null?void 0:v.credentialEnv)=="string"?v.credentialEnv:"",y=Array.isArray(v==null?void 0:v.credentialUsedBy)?v.credentialUsedBy:[],S=(v==null?void 0:v.credentialSource)||"missing",w=!!(v!=null&&v.credentialEnv)||a.credentialProfile==="a"||a.credentialProfile==="p",x=!!b&&e.mode==="new"&&(v==null?void 0:v.authConfigured)!==!0&&!a.credentialValue&&!a.allowMissingCredential,k=E=>{E&&u({client:E.client,provider:E.provider,credentialProfile:E.credentialProfile||"",managedModel:E.model||"",protocol:E.protocol||"",permissionPolicy:E.permissionPolicyDefault||"standard",credentialSourcePolicy:"auto",rc:!!E.rc,displayName:E.custom?p("fleet-custom-provider-default"):"",baseUrl:E.custom?"":E.endpoint||"",envKey:E.defaultEnvKey||"",providerId:"nexuscrew-custom",credentialValue:"",credentialReveal:!1,allowMissingCredential:!1,...e.mode==="new"?{id:E.id,label:""}:{}})};return c.jsxs("div",{className:"nc-set-form nc-fleet-form",children:[c.jsx("b",{children:e.mode==="new"?p("fleet-new-engine"):`${p("edit")} ${a.id}`}),c.jsx("input",{value:a.id,disabled:e.mode!=="new",placeholder:"id",onChange:E=>u({id:E.target.value})}),c.jsx("input",{value:a.label,placeholder:p("label"),onChange:E=>u({label:E.target.value})}),c.jsxs("select",{value:a.kind,disabled:e.mode!=="new",onChange:E=>u({kind:E.target.value}),children:[c.jsx("option",{value:"managed",children:p("fleet-managed")}),c.jsx("option",{value:"custom",children:p("fleet-custom")})]}),a.kind==="managed"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("select",{value:a.client,disabled:e.mode!=="new",onChange:E=>k(o.find(F=>F.client===E.target.value&&F.default)||o.find(F=>F.client===E.target.value)),children:f.map(([E,F])=>c.jsx("option",{value:E,children:F},E))}),c.jsx("select",{value:((P=Zo(o,a))==null?void 0:P.id)||"",disabled:e.mode!=="new",onChange:E=>k(o.find(F=>F.id===E.target.value)),children:m.map(E=>c.jsx("option",{value:E.id,children:E.label},E.id))})]}),a.client!=="shell"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.managedModel,list:"nc-managed-models",placeholder:p(v!=null&&v.requiresModel?"fleet-model-required":"fleet-model-default"),onChange:E=>u({managedModel:E.target.value})}),c.jsx("datalist",{id:"nc-managed-models",children:[...(v==null?void 0:v.models)||[],...a.modelOptions||[]].filter((E,F,M)=>E&&M.indexOf(E)===F).map(E=>c.jsx("option",{value:E},E))})]}),v!=null&&v.supportsUnsafe?c.jsxs("select",{value:a.permissionPolicy,onChange:E=>u({permissionPolicy:E.target.value}),children:[c.jsx("option",{value:"standard",children:p("fleet-standard-permissions")}),c.jsx("option",{value:"unsafe",children:p("fleet-unsafe-permissions")})]}):c.jsx("small",{children:p("fleet-standard-permissions")}),(v==null?void 0:v.supportsUnsafe)&&a.permissionPolicy==="unsafe"&&c.jsx("small",{className:"nc-err",children:p("fleet-unsafe-warning")}),w&&c.jsxs("select",{"aria-label":p("fleet-credential-source-policy"),value:a.credentialSourcePolicy||"auto",onChange:E=>u({credentialSourcePolicy:E.target.value}),children:[c.jsx("option",{value:"auto",children:p("fleet-credential-source-policy-auto")}),c.jsx("option",{value:"nexuscrew-store",children:p("fleet-credential-source-policy-nexuscrew-store")}),c.jsx("option",{value:"environment",children:p("fleet-credential-source-policy-environment")})]}),(v==null?void 0:v.credentialEnv)===!0&&c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.envKey,placeholder:p("fleet-api-key-env"),onChange:E=>u({envKey:E.target.value})}),c.jsx("small",{children:p("fleet-custom-secret-help")})]}),b&&c.jsxs("section",{className:"nc-fleet-key","aria-label":p("fleet-key-section"),children:[c.jsxs("div",{className:"nc-fleet-key-head",children:[c.jsx("b",{children:p("fleet-key-section")}),c.jsx("span",{children:p(`fleet-credential-source-${S}`)})]}),c.jsxs("label",{className:"nc-field",children:[p("fleet-key-variable"),c.jsx("input",{value:b,readOnly:!0,"aria-label":p("fleet-key-variable")})]}),c.jsx("small",{children:y.length?p("fleet-key-used-by").replace("{engines}",y.join(", ")):p("fleet-key-used-by-none")}),y.length>0&&c.jsx("small",{children:p("fleet-key-shared-impact").replace("{key}",b).replace("{engines}",y.join(", "))}),c.jsxs("div",{className:"nc-fleet-key-input",children:[c.jsx("input",{type:a.credentialReveal?"text":"password",value:a.credentialValue||"","aria-label":p("fleet-key-value").replace("{key}",b),autoComplete:"new-password",spellCheck:!1,autoCapitalize:"none",autoCorrect:"off",placeholder:v!=null&&v.authConfigured||e.mode==="edit"?p("fleet-key-blank-keeps"):p("fleet-key-enter"),onChange:E=>u({credentialValue:E.target.value,allowMissingCredential:E.target.value?!1:a.allowMissingCredential})}),c.jsx("button",{type:"button",className:"nc-btn ghost","aria-label":p(a.credentialReveal?"fleet-key-hide":"fleet-key-reveal"),onClick:()=>u({credentialReveal:!a.credentialReveal}),children:p(a.credentialReveal?"fleet-key-hide":"fleet-key-reveal")})]}),c.jsx("small",{children:p("fleet-key-local-help")}),e.mode==="new"&&(v==null?void 0:v.authConfigured)!==!0&&!a.credentialValue&&c.jsxs("label",{className:"nc-check nc-fleet-key-missing",children:[c.jsx("input",{type:"checkbox",checked:!!a.allowMissingCredential,onChange:E=>u({allowMissingCredential:E.target.checked})}),p("fleet-key-create-missing")]}),(v==null?void 0:v.notice)&&c.jsx("small",{className:"nc-fleet-provider-notice",children:p(`fleet-provider-notice-${v.notice}`)})]}),(v==null?void 0:v.notice)&&!b&&c.jsx("small",{className:"nc-fleet-provider-notice",children:p(`fleet-provider-notice-${v.notice}`)}),a.provider==="custom"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.displayName,placeholder:p("fleet-provider-display"),onChange:E=>u({displayName:E.target.value})}),c.jsx("input",{value:a.baseUrl,placeholder:"https://api.example.com/v1",onChange:E=>u({baseUrl:E.target.value})}),((v==null?void 0:v.protocols)||[]).length>1&&c.jsx("select",{value:a.protocol,onChange:E=>u({protocol:E.target.value}),children:v.protocols.map(E=>c.jsx("option",{value:E,children:E},E))}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:a.envKey,placeholder:p("fleet-api-key-env"),onChange:E=>u({envKey:E.target.value})}),c.jsx("input",{value:a.providerId,placeholder:p("fleet-provider-id"),onChange:E=>u({providerId:E.target.value})})]}),c.jsxs("small",{children:[a.protocol," · ",p("fleet-custom-secret-help")]})]}),c.jsx("small",{children:p(a.client==="shell"?"fleet-shell-engine-help":"fleet-managed-help")})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{value:a.command,placeholder:p("command-path"),onChange:E=>u({command:E.target.value})}),c.jsx("textarea",{value:a.argsText,placeholder:p("args-lines"),onChange:E=>u({argsText:E.target.value})}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:a.rc,onChange:E=>u({rc:E.target.checked})})," remote control"]}),c.jsxs("select",{value:a.promptMode,onChange:E=>u({promptMode:E.target.value}),children:[c.jsx("option",{value:"send-keys",children:"send-keys"}),c.jsx("option",{value:"flag",children:"flag"})]}),a.promptMode==="flag"&&c.jsx("input",{value:a.promptFlag,placeholder:"prompt flag",onChange:E=>u({promptFlag:E.target.value})}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:a.modelFlag,placeholder:"model flag",onChange:E=>u({modelFlag:E.target.value})}),c.jsx("input",{value:a.modelValue,placeholder:"model default",onChange:E=>u({modelValue:E.target.value})})]}),c.jsx("small",{children:p("env-write-only")}),h.map((E,F)=>c.jsxs("div",{className:"nc-fleet-env",children:[c.jsx("input",{value:E.key,disabled:E.configured,placeholder:"ENV_KEY",onChange:M=>{const V=h.slice();V[F]={...E,key:M.target.value},u({envRows:V})}}),c.jsx("input",{type:"password",value:E.value,placeholder:E.configured?"•••••• (unchanged)":"value",onChange:M=>{const V=h.slice();V[F]={...E,value:M.target.value},u({envRows:V})}}),c.jsx("button",{className:"nc-btn danger",onClick:()=>u({envRows:h.filter((M,V)=>V!==F)}),children:"×"})]},`${E.key}-${F}`)),c.jsx("button",{className:"nc-btn ghost",onClick:()=>u({envRows:[...h,{key:"",value:"",configured:!1}]}),children:"+ env"})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>t(null),children:p("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:n||!a.id||x||a.kind==="custom"&&!a.command||a.kind==="managed"&&(v==null?void 0:v.requiresModel)&&!a.managedModel||a.kind==="managed"&&(v==null?void 0:v.credentialEnv)===!0&&!a.envKey||a.kind==="managed"&&a.provider==="custom"&&(!a.displayName||!a.baseUrl||!a.envKey||!a.providerId),onClick:s,children:p("save")})]})]})}function G2({token:e,route:t,targets:n=[],location:s,setLocation:o,state:a,setState:u,engines:h,busy:f,onSave:m}){var G;const[v,b]=N.useState(null),[y,S]=N.useState(""),w=a.form,x=O=>u({...a,form:{...w,...O}}),k=h.find(O=>O.id===w.engine),P=((G=k==null?void 0:k.managed)==null?void 0:G.client)==="shell",E=O=>{var Q,z,I,C;const Z=h.find(T=>T.id===O),X={...w.commands||{}};((Q=k==null?void 0:k.managed)==null?void 0:Q.client)==="shell"&&(w.command?X[w.engine]=w.command:delete X[w.engine]),x({engine:O,model:((z=w.models)==null?void 0:z[O])||((I=Z==null?void 0:Z.managed)==null?void 0:I.model)||((C=Z==null?void 0:Z.model)==null?void 0:C.value)||"",commands:X,command:X[O]||""})},F=O=>{const Z={...w.commands||{}};O?Z[w.engine]=O:delete Z[w.engine],x({command:O,commands:Z})},M=P&&/[|&;<>()`$*?{}\[\]~]/.test(w.command||""),V=async O=>{try{const Z=await Qh(e,O,t);b(Z),x({cwd:Z.path}),S("")}catch(Z){S(String(Z.message||Z))}};return c.jsxs("div",{className:"nc-set-form nc-fleet-form",children:[c.jsx("b",{children:a.mode==="new"?p("fleet-new-cell"):`${p("edit")} ${w.id}`}),a.mode==="new"&&c.jsxs("label",{className:"nc-field",children:[p("location"),c.jsx("span",{className:"nc-req",children:" *"}),c.jsxs("select",{value:s,onChange:O=>{o(O.target.value),x({engine:""})},children:[c.jsx("option",{value:"",children:p("local")}),n.map(O=>c.jsxs("option",{value:O.route.join("/"),disabled:O.status&&O.status!=="up",children:[O.label,O.status&&O.status!=="up"?` · ${p("node-offline")}`:""]},O.route.join("/")))]})]}),c.jsx("input",{value:w.id,disabled:a.mode!=="new",placeholder:"id",onChange:O=>x({id:O.target.value})}),c.jsx("input",{value:w.label||"",maxLength:64,placeholder:p("fleet-cell-label"),onChange:O=>x({label:O.target.value})}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:w.cwd,placeholder:p("cwd"),onChange:O=>x({cwd:O.target.value})}),c.jsx("button",{className:"nc-btn ghost",onClick:()=>v?b(null):V(w.cwd),children:p("browse")})]}),v&&c.jsxs("div",{className:"nc-fs",children:[c.jsx("div",{className:"nc-fs-path",children:v.path}),c.jsxs("div",{className:"nc-fs-list",children:[v.parent&&c.jsxs("button",{className:"nc-fs-item nc-fs-nav",onClick:()=>V(v.parent),children:["↑ ",p("fs-parent")]}),(v.dirs||[]).map(O=>c.jsxs("button",{className:"nc-fs-item",onClick:()=>V(`${v.path.replace(/\/$/,"")}/${O}`),children:["📁 ",O]},O))]})]}),y&&c.jsx("div",{className:"nc-err",children:y}),c.jsx("select",{value:w.engine,onChange:O=>E(O.target.value),children:h.map(O=>c.jsx("option",{value:O.id,children:O.label},O.id))}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:!!w.boot,onChange:O=>x({boot:O.target.checked})})," boot"]}),P?c.jsxs(c.Fragment,{children:[c.jsx("input",{value:w.command||"",maxLength:4096,placeholder:p("fleet-shell-command-placeholder"),onChange:O=>F(O.target.value)}),c.jsx("small",{children:w.command?p("fleet-shell-command-help"):p("fleet-shell-interactive")}),M&&c.jsx("small",{className:"nc-note",children:p("fleet-shell-command-metachar")})]}):c.jsxs(c.Fragment,{children:[c.jsx("input",{value:w.model||"",list:"nc-cell-models",placeholder:p("fleet-model-override"),onChange:O=>x({model:O.target.value})}),c.jsx("datalist",{id:"nc-cell-models",children:((k==null?void 0:k.availableModels)||[]).map(O=>c.jsx("option",{value:O},O))}),c.jsx("textarea",{value:w.prompt||"",placeholder:"prompt",onChange:O=>x({prompt:O.target.value})})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>u(null),children:p("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:f||!w.id||!w.cwd||!w.engine,onClick:m,children:p("save")})]})]})}function D_({token:e,route:t=[],state:n,setState:s,busy:o,onSave:a}){const[u,h]=N.useState(null),[f,m]=N.useState([]),[v,b]=N.useState(""),y=Array.isArray(t)?t.join("/"):"";N.useEffect(()=>{let P=!0;return Gh(e,y?y.split("/"):[]).then(E=>{P&&(m(E.engines||[]),b(""))}).catch(E=>{P&&(m([]),b(String(E.message||E)))}),()=>{P=!1}},[e,y]);const S=n.form,w=P=>s({...n,form:{...S,...P}}),x=async P=>{try{const E=await Qh(e,P,t);h(E),w({cwd:E.path})}catch{}},k=!S.id&&S.tmuxSession?S.tmuxSession.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32):S.id;return c.jsxs("div",{className:"nc-set-form nc-fleet-form",children:[c.jsxs("b",{children:[p("import-as-cell")," · ",S.tmuxSession]}),c.jsx("small",{children:p("import-help")}),c.jsx("input",{value:S.tmuxSession,disabled:!0,placeholder:"tmux session",readOnly:!0}),c.jsx("input",{value:S.id,placeholder:p("name"),onChange:P=>w({id:P.target.value})}),c.jsxs("div",{className:"nc-fleet-pair",children:[c.jsx("input",{value:S.cwd,placeholder:p("cwd"),onChange:P=>w({cwd:P.target.value})}),c.jsx("button",{className:"nc-btn ghost",type:"button",onClick:()=>u?h(null):x(S.cwd),children:p("browse")})]}),u&&c.jsxs("div",{className:"nc-fs",children:[c.jsx("div",{className:"nc-fs-path",children:u.path}),c.jsxs("div",{className:"nc-fs-list",children:[u.parent&&c.jsxs("button",{className:"nc-fs-item nc-fs-nav",onClick:()=>x(u.parent),children:["↑ ",p("fs-parent")]}),(u.dirs||[]).map(P=>c.jsxs("button",{className:"nc-fs-item",onClick:()=>x(`${u.path.replace(/\/$/,"")}/${P}`),children:["📁 ",P]},P))]})]}),c.jsxs("select",{value:S.engine,onChange:P=>w({engine:P.target.value}),children:[c.jsx("option",{value:"",children:p("import-engine-required")}),f.map(P=>c.jsx("option",{value:P.id,children:P.label},P.id))]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:!!S.boot,onChange:P=>w({boot:P.target.checked})})," boot"]}),(n.err||v)&&c.jsx("div",{className:"nc-err",children:n.err||v}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>s(null),children:p("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:o||!S.tmuxSession||!S.engine||!f.length,onClick:a,children:p(k?"import-as-cell":"save")})]})]})}function El(e){const t=Ks(e);return t===null?`~/${e}`:t?`~/${t}`:"~"}function X2(e){if(!e||typeof e.path!="string"||typeof e.home!="string")return"";const{path:t,home:n}=e;return!n||t===n||!t.startsWith(n+"/")?"":t.slice(n.length+1).replace(/\/+$/,"")}function Q2({token:e,route:t,cell:n,busy:s=!1,onSaved:o,onClose:a}){const[u,h]=N.useState(""),[f,m]=N.useState(null),[v,b]=N.useState(!1),[y,S]=N.useState(""),w=typeof(n==null?void 0:n.cwdSuggestion)=="string"&&Ks(n.cwdSuggestion)!==null?Ks(n.cwdSuggestion):null,[x,k]=N.useState(w),P=n==null?void 0:n.id,E=s||v,F=async X=>{const Q=Ks(X);if(Q===null){m({rel:"",dirs:[],loading:!1,err:p("fleet-cwd-repair-invalid")});return}m({rel:Q,dirs:[],loading:!0,err:""});try{const z=await Qh(e,Q,t),I=X2(z);m({rel:I,dirs:Array.isArray(z.dirs)?z.dirs:[],loading:!1,err:""})}catch(z){m({rel:Q,dirs:[],loading:!1,err:String(z&&z.message||z)})}},M=X=>{if(!f)return;const Q=f.rel?`${f.rel}/${X}`:X;F(Q)},V=()=>{f!=null&&f.rel&&F(f.rel.split("/").slice(0,-1).join("/"))},G=()=>{f&&(h(f.rel||""),m(null),S(""),k(null))},O=()=>{x!==null&&(h(x),k(null),S(""))},Z=async()=>{if(E)return;const X=Ks(u);if(X===null){S(p("fleet-cwd-repair-invalid"));return}const Q=El(X);let z=!0;try{z=window.confirm(p("fleet-cwd-repair-confirm").replace("{id}",String(P||"")).replace("{path}",Q))}catch{z=!1}if(z){b(!0),S(""),k(null);try{const I=await G_(e,P,{cwdRel:X},t);o==null||o(I)}catch(I){const C=I&&I.data||{};if(C.code==="unportable-cwd"){S(p("fleet-cwd-repair-unportable"));const T=Array.isArray(C.cells)?C.cells.find($=>$&&$.id===P):null,A=T&&typeof T.suggestion=="string"?T.suggestion:null;A!==null&&Ks(A)!==null&&k(A)}else S(String(I&&I.message||I))}finally{b(!1)}}};return c.jsxs("div",{className:"nc-set-form nc-fleet-form nc-cwd-repair",children:[c.jsx("b",{children:p("fleet-cwd-repair-title").replace("{id}",String(P||""))}),c.jsx("small",{className:"nc-set-info",children:p("fleet-cwd-repair-help")}),c.jsx("small",{className:"nc-cwd-no-source",children:p("fleet-cwd-repair-no-source-path")}),c.jsxs("label",{className:"nc-field",children:[p("cwd"),c.jsxs("div",{className:"nc-cwd-rel-row",children:[c.jsx("span",{className:"nc-cwd-rel-prefix",children:"~/"}),c.jsx("input",{value:u,placeholder:p("fleet-cwd-repair-placeholder"),autoComplete:"off",spellCheck:"false",autoCapitalize:"none",onChange:X=>h(X.target.value)}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:E,onClick:()=>f?m(null):F(""),children:p(f?"close":"fleet-cwd-repair-browse")})]})]}),c.jsx("div",{className:"nc-cwd-preview",children:p("fleet-cwd-repair-preview").replace("{path}",El(u))}),f&&c.jsxs("div",{className:"nc-fs",children:[c.jsx("div",{className:"nc-fs-path",children:El(f.rel)}),c.jsxs("div",{className:"nc-fs-list",children:[f.rel&&c.jsxs("button",{type:"button",className:"nc-fs-item nc-fs-nav",onClick:V,children:["↑ ",p("fs-parent")]}),f.loading&&c.jsx("div",{className:"nc-fs-empty",children:"…"}),!f.loading&&f.dirs.length===0&&c.jsx("div",{className:"nc-fs-empty",children:p("fleet-cwd-repair-fs-empty")}),!f.loading&&f.dirs.map(X=>c.jsxs("button",{type:"button",className:"nc-fs-item",onClick:()=>M(X),children:["📁 ",X]},X))]}),f.err&&c.jsx("div",{className:"nc-err",children:f.err}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{type:"button",className:"nc-btn primary",disabled:E||f.loading||!!f.err,onClick:G,children:p("fleet-cwd-repair-use-current")})})]}),y&&c.jsx("div",{className:"nc-err",role:"alert",children:y}),x!==null&&c.jsxs("div",{className:"nc-cwd-suggestion",role:"status",children:[c.jsx("span",{children:p("fleet-cwd-repair-suggestion")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:O,children:p("fleet-cwd-repair-use-suggestion").replace("{path}",El(x))})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:v,onClick:a,children:p("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:E,onClick:Z,children:v?"…":p("save")})]})]})}function J2({token:e,readonly:t,targets:n=[],startNewCell:s=!1,initialLocation:o=""}){const[a,u]=N.useState({engines:[],cells:[],managedCatalog:[]}),[h,f]=N.useState({available:!1,capabilities:[]}),[m,v]=N.useState(!1),[b,y]=N.useState(null),[S,w]=N.useState(null),[x,k]=N.useState(!1),[P,E]=N.useState(""),[F,M]=N.useState(""),[V,G]=N.useState(o),[O,Z]=N.useState(!1),[X,Q]=N.useState(null),[z,I]=N.useState(null),[C,T]=N.useState(null),[A,$]=N.useState(!1),[U,R]=N.useState([]),[K,B]=N.useState(null),[j,D]=N.useState("manage"),W=N.useRef(!1),ne=V?V.split("/"):[],ce=N.useCallback(async()=>{try{const re=await ws(e,ne);f(re);try{const xe=await Zh(e,ne);Z(!!xe.readonlyDefault)}catch{Z(!1)}if(re.provider==="builtin"&&(re.capabilities||[]).includes("definitions")){const xe=await Gh(e,ne),Ie=new Map((re.engines||[]).map(Fe=>[Fe.id,Fe]));if(xe.engines=(xe.engines||[]).map(Fe=>{var he;return{...Fe,availableModels:((he=Ie.get(Fe.id))==null?void 0:he.models)||[]}}),u(xe),(re.capabilities||[]).includes("credentials"))try{R((await d0(e,ne)).credentials||[])}catch{R([])}else R([])}E("")}catch(re){E(String(re.message||re))}finally{v(!0)}},[e,V]);N.useEffect(()=>{ce();const re=setInterval(ce,5e3);return()=>clearInterval(re)},[ce]);const pe=new Set((h.cells||[]).filter(re=>re.active).map(re=>re.cell)),ye=h.provider==="builtin"&&(h.capabilities||[]).includes("edit"),me=(h.capabilities||[]).includes("restore");N.useEffect(()=>{!s||W.current||!ye||!a.engines.length||(W.current=!0,w({mode:"new",form:T_(a.engines[0].id)}))},[s,ye,a.engines]);const ae=async re=>{k(!0),E(""),M("");try{await re(),await ce()}catch(xe){E(String(xe.message||xe))}k(!1)},Pe=()=>ae(async()=>{var ge;const re=b.mode==="new",xe=b.form,Ie=a.managedCatalog||[],Fe=xe.kind==="managed"?Zo(Ie,xe):null,he=typeof(Fe==null?void 0:Fe.credentialEnv)=="string"?Fe.credentialEnv:"",ze=he&&xe.credentialValue||"",q=q2(xe,re,Ie);!re&&b.form.kind==="custom"&&!b.form.modelFlag&&(q.model=null),!re&&b.form.kind==="custom"&&b.form.promptMode!=="flag"&&(q.promptFlag=null);let te;if(re)te=await f0(e,q,ne);else{const Le=b.original,_e=new Set(b.form.envRows.filter(ot=>!ot.remove).map(ot=>ot.key)),Ce=(Le.envKeys||[]).filter(ot=>!_e.has(ot)),tt=Object.fromEntries(b.form.envRows.filter(ot=>!ot.remove&&ot.key&&(!ot.configured||ot.value!=="")).map(ot=>[ot.key,ot.value]));te=await p0(e,Le.id,q,b.form.kind==="custom"?{set:tt,remove:Ce}:void 0,ne)}let H=null;if(he&&ze)try{H=await yg(e,he,ze,ne),R(H.credentials||[])}catch{throw await ce(),re&&y({mode:"edit",original:{...q,id:xe.id},form:{...xe,credentialReveal:!1}}),new Error(p(re?"fleet-key-partial-create":"fleet-key-partial-edit"))}await ce(),y(null),M(p("fleet-saved"));const le=((ge=((H==null?void 0:H.credentials)||[]).find(Le=>Le.envKey===he))==null?void 0:ge.activeCells)||[],ue=[...new Set([...(te==null?void 0:te.activeCells)||[],...le])];if(ue.length&&window.confirm(p("fleet-restart-confirm").replace("{cells}",ue.join(", "))))for(const Le of ue)await Fo(e,Le,ne)}),rt=()=>ae(async()=>{var H,le,ue,ge,Le,_e;const re=S.mode==="new",xe=S.form,Ie={...re?{id:xe.id}:{},cwd:xe.cwd,engine:xe.engine,boot:!!xe.boot},Fe={...xe.commands||{}},he=a.engines.find(Ce=>Ce.id===xe.engine);((H=he==null?void 0:he.managed)==null?void 0:H.client)==="shell"&&typeof xe.command=="string"&&xe.command.length?Fe[xe.engine]=xe.command:((le=he==null?void 0:he.managed)==null?void 0:le.client)==="shell"&&delete Fe[xe.engine],(Object.keys(Fe).length||!re)&&(Ie.commands=Fe);const ze=(xe.label||"").trim();re?ze&&(Ie.label=ze):Ie.label=ze||null,re?(((ue=he==null?void 0:he.managed)==null?void 0:ue.client)!=="shell"&&xe.model&&(Ie.model=xe.model),((ge=he==null?void 0:he.managed)==null?void 0:ge.client)!=="shell"&&xe.prompt&&(Ie.prompt=xe.prompt)):(Ie.model=((Le=he==null?void 0:he.managed)==null?void 0:Le.client)==="shell"?null:xe.model||null,((_e=he==null?void 0:he.managed)==null?void 0:_e.client)!=="shell"&&(Ie.prompt=xe.prompt||null));const q=re?await g0(e,Ie,ne):await G_(e,S.original.id,Ie,ne),te=re?xe.id:S.original.id;w(null),M(p("fleet-saved")),!re&&(q!=null&&q.active)&&window.confirm(p("fleet-restart-confirm").replace("{cells}",te))&&await Fo(e,te,ne)}),Xe=t||O,Me=re=>U.find(xe=>{var Ie;return(Ie=xe.engines)==null?void 0:Ie.includes(re.id)})||null,qt=()=>ae(async()=>{var Ie;const re=await yg(e,K.envKey,K.value,ne);R(re.credentials||[]),B(null),M(p("fleet-credential-saved"));const xe=((Ie=(re.credentials||[]).find(Fe=>Fe.envKey===K.envKey))==null?void 0:Ie.activeCells)||[];if(xe.length&&window.confirm(p("fleet-restart-confirm").replace("{cells}",xe.join(", "))))for(const Fe of xe)await Fo(e,Fe,ne)}),wn=re=>ae(async()=>{if(!window.confirm(p("fleet-credential-remove-confirm").replace("{key}",re.envKey)))return;const xe=await h0(e,re.envKey,ne);R(xe.credentials||[]),M(p("fleet-credential-removed"))}),Be=re=>Q({...re,route:Array.isArray(re==null?void 0:re.route)?re.route:ne}),$t=async re=>{if(!X)return;const xe=X.cell||X.id,Ie=Array.isArray(X.route)?X.route:ne;if(re.action==="up"){const Fe=await Yh(e,{cell:xe,boot:!!re.boot,...re.engine?{engine:re.engine}:{},...re.model!==void 0?{model:re.model}:{},...re.permissionPolicy?{permissionPolicy:re.permissionPolicy}:{}},Ie),he=uf(Fe);he&&M(he.text)}else await Il(e,{cell:xe,boot:!!re.boot},Ie)},Nt=(re,xe)=>{E(""),I({mode:"new",route:Array.isArray(xe)?xe:ne,form:{tmuxSession:re.name,id:"",engine:"",cwd:"",boot:!1},err:""})},At=()=>ae(async()=>{const re=z.form;if(!re.engine){I({...z,err:p("import-engine-required")});return}await v0(e,{tmuxSession:re.tmuxSession,id:re.id||void 0,engine:re.engine,cwd:re.cwd||void 0,boot:!!re.boot},re.route||ne),I(null),M(p("fleet-saved"))}),mt=({engineRows:re=[],cellRows:xe=[]})=>ae(async()=>{const Ie=re.filter(ge=>ge.selected),Fe=Ie.map(ge=>tb(ge.engine));if(Fe.some(ge=>!ge))throw new Error(p("fleet-backup-invalid-engine"));const he=Ie.filter(ge=>ge.exists).map(ge=>ge.engine.id);if(he.length&&!window.confirm(p("fleet-backup-confirm-engine-overwrite").replace("{engines}",he.join(", "))))return;const ze=[...new Set([...a.engines.map(ge=>ge.id),...Fe.map(ge=>ge.id)])],q=[];for(const ge of xe.filter(Le=>Le.selected)){const Le=H2(ge.cell,ge.engine,ze);if(!Le)throw new Error(`${ge.cell.id}: ${p("fleet-backup-engine-missing")}`);q.push(Le)}const te=xe.filter(ge=>ge.selected&&ge.exists).map(ge=>ge.cell.id);if(te.length&&!window.confirm(p("fleet-backup-confirm-overwrite").replace("{cells}",te.join(", "))))return;const H=Fe.length?await y0(e,Fe,he.length>0,ne):{needsRestart:[]},le=q.length?await _0(e,q,ne):{needsRestart:[]},ue=[...new Set([...H.needsRestart||[],...le.needsRestart||[]])];$(!1),M(`${p("fleet-backup-restored").replace("{n}",String(q.length))}${Fe.length?` · ${Fe.length} ${p("fleet-engines").toLowerCase()}`:""}${ue.length?` · ${p("fleet-backup-needs-restart").replace("{cells}",ue.join(", "))}`:""}`)}),dt=c.jsxs("label",{className:"nc-field",children:[p("location"),c.jsxs("select",{value:V,onChange:re=>{G(re.target.value),y(null),w(null),E(""),M(""),Z(!1),v(!1),f({available:!1,capabilities:[]}),u({engines:[],cells:[],managedCatalog:[]}),R([]),B(null)},children:[c.jsx("option",{value:"",children:p("local")}),n.map(re=>c.jsxs("option",{value:re.route.join("/"),disabled:re.status&&re.status!=="up",children:[re.label,re.status&&re.status!=="up"?` · ${p("node-offline")}`:""]},re.route.join("/")))]})]}),ut=c.jsxs("div",{className:"nc-fleet-view-tabs",role:"tablist","aria-label":p("tab-fleet"),children:[c.jsx("button",{type:"button",role:"tab","aria-selected":j==="manage",className:`nc-set-tabbtn${j==="manage"?" on":""}`,onClick:()=>D("manage"),children:p("fleet-manage-location")}),c.jsx("button",{type:"button",role:"tab","aria-selected":j==="overview",className:`nc-set-tabbtn${j==="overview"?" on":""}`,onClick:()=>D("overview"),children:p("fleet-network-overview")})]});return m?ye?c.jsxs("div",{className:"nc-set-tab nc-fleet-editor",children:[ut,j==="overview"?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:p("fleet-overview-help")}),c.jsx(zd,{token:e,targets:n,readonly:t,onPower:Be,onImport:Nt})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:p("fleet-manage-help")}),dt,c.jsxs("div",{className:"nc-set-row nc-fleet-backup-actions",children:[c.jsx("button",{className:"nc-btn ghost",disabled:Xe||x,onClick:()=>{E(""),$(!0)},children:p("fleet-backup")}),c.jsx("small",{children:p("fleet-backup-help")})]}),c.jsxs("div",{className:"nc-fleet-section-head",children:[c.jsx("b",{children:p("fleet-cells")}),c.jsx("span",{className:"nc-fleet-head-actions",children:c.jsxs("button",{className:"nc-btn primary",disabled:Xe||x||!a.engines.length,onClick:()=>{var re;E(""),w({mode:"new",form:T_((re=a.engines[0])==null?void 0:re.id)})},children:["+ ",p("add")]})})]}),a.cells.map(re=>{const xe=pe.has(re.id),Ie=h.capabilities||[],Fe=re.needsRepair===!0;return c.jsxs("div",{className:"nc-fleet-item",children:[c.jsxs("span",{children:[c.jsx("b",{children:re.id}),re.label?c.jsxs("small",{className:"nc-fleet-label",children:[" ",re.label]}):null,c.jsxs("small",{children:[re.engine," · ",Fe?c.jsx("span",{className:"nc-fleet-tag nc-fleet-tag-warn",children:p("fleet-cwd-needs-repair")}):re.cwd,xe?` · ${p("service-active")}`:` · ${p("cell-off")}`]})]}),c.jsxs("span",{children:[xe&&Ie.includes("down")&&c.jsx("button",{className:"nc-btn ghost",disabled:Xe||x,onClick:()=>ae(()=>Il(e,{cell:re.id},ne)),children:p("stop")}),!xe&&Ie.includes("up")&&c.jsx("button",{className:"nc-btn primary",disabled:Xe||x,onClick:()=>Be({cell:re.id,id:re.id,engine:re.engine,model:re.model,models:re.models,permissionPolicies:re.permissionPolicies,active:!1,boot:re.boot}),children:p("start")}),xe&&Ie.includes("restart")&&c.jsx("button",{className:"nc-btn ghost",disabled:Xe||x,onClick:()=>ae(()=>Fo(e,re.id,ne)),children:p("restart")}),Fe?c.jsx("button",{className:"nc-btn ghost",disabled:Xe||x,onClick:()=>{E(""),T(re)},children:p("fleet-cwd-repair")}):c.jsx("button",{className:"nc-btn ghost",disabled:Xe||x,onClick:()=>{var he;E(""),w({mode:"edit",original:re,form:{...re,commands:{...re.commands||{}},command:((he=re.commands)==null?void 0:he[re.engine])||""}})},children:p("edit")}),c.jsx("button",{className:"nc-btn danger",disabled:Xe||x,onClick:()=>ae(async()=>{window.confirm(p("fleet-remove-cell").replace("{id}",re.id))&&await X_(e,re.id,!0,ne)}),children:"×"})]})]},re.id)}),c.jsxs("div",{className:"nc-fleet-section-head",children:[c.jsx("b",{children:p("fleet-engines")}),c.jsxs("button",{className:"nc-btn primary",disabled:Xe||x,onClick:()=>{E(""),y({mode:"new",form:U2()})},children:["+ ",p("add")]})]}),a.engines.map(re=>{var Ie,Fe;const xe=Me(re);return c.jsxs("div",{className:"nc-fleet-item",children:[c.jsxs("span",{children:[c.jsx("b",{children:re.label}),c.jsx("small",{children:re.managed?`${re.id} · ${re.managed.client} / ${re.managed.provider} · ${(Ie=re.managedInfo)!=null&&Ie.configured?p("fleet-ready"):((Fe=re.managedInfo)==null?void 0:Fe.reason)||p("fleet-not-ready")}`:`${re.id} · ${re.command}`}),xe&&c.jsxs("small",{children:[xe.envKey," · ",p(`fleet-credential-source-${xe.source||"missing"}`)]})]}),c.jsxs("span",{children:[xe&&c.jsx("button",{className:"nc-btn ghost",disabled:Xe||x,onClick:()=>{E(""),B({envKey:xe.envKey,value:""})},children:xe.configured?p("fleet-credential-change"):p("fleet-credential-set")}),(xe==null?void 0:xe.source)==="local"&&c.jsx("button",{className:"nc-btn danger",disabled:Xe||x,onClick:()=>wn(xe),children:p("fleet-credential-forget")}),c.jsx("button",{className:"nc-btn ghost",disabled:Xe||x,onClick:()=>{E(""),y({mode:"edit",original:re,form:K2(re)})},children:p("edit")}),c.jsx("button",{className:"nc-btn danger",disabled:Xe||x,onClick:()=>ae(async()=>{window.confirm(p("fleet-remove-engine").replace("{id}",re.id))&&await m0(e,re.id,ne)}),children:"×"})]})]},re.id)})]}),b&&c.jsx($s,{onClose:()=>y(null),label:p("fleet-new-engine"),error:P,children:c.jsx(Y2,{state:b,setState:y,busy:x,onSave:Pe,catalog:a.managedCatalog||[]})}),S&&c.jsx($s,{onClose:()=>w(null),label:p("fleet-new-cell"),error:P,children:c.jsx(G2,{token:e,route:ne,targets:n,location:V,setLocation:G,state:S,setState:w,engines:a.engines,busy:x,onSave:rt})}),C&&c.jsx($s,{onClose:()=>T(null),label:p("fleet-cwd-repair-title").replace("{id}",C.id),error:"",children:c.jsx(Q2,{token:e,route:ne,cell:C,busy:x,onSaved:async()=>{T(null),M(p("fleet-cwd-repaired")),await ce()},onClose:()=>T(null)})}),F&&c.jsx("div",{className:"nc-set-note",children:F}),P&&c.jsx("div",{className:"nc-err",children:P}),A&&c.jsx($s,{onClose:()=>$(!1),label:p("fleet-backup"),error:P,children:c.jsx(V2,{cells:a.cells,engines:a.engines,busy:x,canRestore:me,onRestore:mt,onClose:()=>$(!1)})}),K&&c.jsx($s,{onClose:()=>B(null),label:p("fleet-credential-title"),error:P,children:c.jsxs("div",{className:"nc-fleet-form nc-credential-form",children:[c.jsx("b",{children:p("fleet-credential-title")}),c.jsx("small",{children:p("fleet-credential-help")}),c.jsxs("label",{className:"nc-field",children:[K.envKey,c.jsx("input",{type:"password",autoComplete:"off",spellCheck:"false",autoCapitalize:"none",value:K.value,onChange:re=>B({...K,value:re.target.value})})]}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",onClick:()=>B(null),children:p("cancel")}),c.jsx("button",{className:"nc-btn primary",disabled:x||!K.value,onClick:qt,children:p("save")})]})]})}),z&&c.jsx($s,{onClose:()=>I(null),label:p("import-as-cell"),error:P,children:c.jsx(D_,{token:e,route:z.route||ne,state:z,setState:I,busy:x,onSave:At})}),X&&c.jsx(Bl,{cell:X,token:e,route:Array.isArray(X.route)?X.route:ne,onConfirm:async re=>{try{await $t(re)}finally{await ce()}},onClose:()=>Q(null)})]}):c.jsxs("div",{className:"nc-set-tab",children:[ut,j==="overview"?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:p("fleet-overview-help")}),c.jsx(zd,{token:e,targets:n,readonly:t,onPower:Be,onImport:Nt})]}):c.jsxs(c.Fragment,{children:[dt,c.jsxs("div",{className:"nc-set-info",children:[p(P?"fleet-editor-load-error":"fleet-editor-unavailable"),!P&&h.reason?` ${h.reason}`:""]})]}),P&&c.jsx("div",{className:"nc-err",children:P}),z&&c.jsx($s,{onClose:()=>I(null),label:p("import-as-cell"),error:P,children:c.jsx(D_,{token:e,route:z.route||ne,state:z,setState:I,busy:x,onSave:At})}),X&&c.jsx(Bl,{cell:X,token:e,route:Array.isArray(X.route)?X.route:ne,onConfirm:async re=>{try{await $t(re)}finally{await ce()}},onClose:()=>Q(null)})]}):c.jsxs("div",{className:"nc-set-tab",children:[ut,j==="overview"?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-set-info",children:p("fleet-overview-help")}),c.jsx(zd,{token:e,targets:n,readonly:t,onPower:Be,onImport:Nt})]}):c.jsxs(c.Fragment,{children:[dt,c.jsx("div",{className:"nc-set-info",children:p("fleet-editor-loading")})]})]})}const Of="nc_notification_speech_v1",Nl="nc-notification-speech",Fh="nc-notification-speech-preview",Z2=320,ej=2,tj=3e4,nj=1e4,ij=6e4,sj=64,M_=Object.freeze({enabled:!1}),rj=Object.freeze({it:"it-IT",en:"en-US",es:"es-ES"}),oj=Object.freeze({it:new Set(["che","con","correzione","della","delle","difetto","il","lavoro","nessun","non","per","pronto","pubblicata","pubblicato","rilascio","sono","stato","tutti","verificata","verificato","versione","completata","completato","riepilogo"]),en:new Set(["all","and","completed","fix","for","issue","no","published","ready","release","summary","the","verified","version","with","work"]),es:new Set(["con","correccion","defecto","el","esta","para","publicada","publicado","resumen","sin","todos","trabajo","verificada","verificado","version","y"])}),Bf=new WeakSet;function zf(e){return{enabled:(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).enabled===!0}}function ib(){try{return typeof localStorage<"u"?localStorage:null}catch{return null}}function I_(e=ib()){if(!e)return{...M_};try{return zf(JSON.parse(e.getItem(Of)||"null"))}catch{return{...M_}}}function aj(e,t=ib()){const n=zf(e);if(t)try{t.setItem(Of,JSON.stringify(n))}catch{}return n}function Ur(){try{return typeof window<"u"?window:null}catch{return null}}function ea(e=Ur()){try{return!!(e&&e.speechSynthesis&&typeof e.speechSynthesis.speak=="function"&&typeof e.SpeechSynthesisUtterance=="function")}catch{return!1}}function sb(e=Ur()){return!!(e&&(typeof e=="object"||typeof e=="function")&&Bf.has(e))}function $h(e=Ur()){e&&(typeof e=="object"||typeof e=="function")&&Bf.delete(e)}function Ar(e){const t=String(e||"").trim().toLowerCase().split("-")[0];return rj[t]||""}function cc(e){return String(e||"").normalize("NFC").replace(/[\p{Cc}\p{Cf}]+/gu," ").replace(/\s+/g," ").trim()}function lj(e){const t=cc(e).normalize("NFD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase(),n=new Set(t.match(new RegExp("\\p{L}+","gu"))||[]);if(n.size<4)return"";const s=Object.entries(oj).map(([o,a])=>({lang:o,score:[...n].reduce((u,h)=>u+(a.has(h)?1:0),0)})).sort((o,a)=>a.score-o.score);return s[0].score>=3&&s[0].score-s[1].score>=2?s[0].lang:""}function cj(e,t){const n=Ar(e&&e.lang);return n||Ar(lj(e&&e.body))||Ar(t)}function rb(e){try{const t=e&&e.speechSynthesis&&e.speechSynthesis.getVoices;return typeof t=="function"?Array.from(t.call(e.speechSynthesis)||[]).filter(Boolean):[]}catch{return[]}}function ob(e,t){const n=Ar(t);if(!n)return null;const s=Array.from(e||[]).filter(h=>h&&typeof h.lang=="string"&&h.lang.trim()),o=s.filter(h=>h.lang.trim().toLowerCase()===n.toLowerCase()),a=n.slice(0,2).toLowerCase(),u=s.filter(h=>h.lang.trim().toLowerCase().split("-")[0]===a);return o.find(h=>h.default===!0)||o[0]||u.find(h=>h.default===!0)||u[0]||null}function O_(e){return cc(e).replace(/\bBearer\s+\S+/gi,"Bearer [redacted]").replace(/\b(?:sk|hf|zai|xox[baprs]|gh[pousr]|npm)[_-][A-Za-z0-9._-]{8,}\b/gi,"[redacted]").replace(/\b(?:token|password|secret|credential|api[_-]?key)\s*[=:]\s*(?:"[^"]*"|'[^']*'|\S+)/gi,"[redacted]").replace(/\b[A-Z][A-Z0-9_]{2,}\s*=\s*(?:"[^"]*"|'[^']*'|\S+)/g,"[redacted]").replace(/(?:\/home\/[^/\s]+|\/Users\/[^/\s]+|\/data\/(?:data|user\/\d+)\/[^/\s]+)(?:\/[^\s]*)?/g,"[private path]").replace(/\b[A-Za-z]:\\Users\\[^\\\s]+(?:\\[^\s]*)?/g,"[private path]")}function uj(e,t=Z2){const n=O_(e&&e.title),s=O_(e&&e.body),o=[n,s&&s!==n?s:""].filter(Boolean).join(". "),a=Array.from(o);return a.length<=t?o:`${a.slice(0,Math.max(0,t-1)).join("").trimEnd()}…`}function dj(e){try{return!!(e&&e.visibilityState==="visible"&&typeof e.hasFocus=="function"&&e.hasFocus())}catch{return!1}}function ab(e=Ur()){if(!ea(e))return!1;try{return e.speechSynthesis.cancel(),!0}catch{return!1}}function hj(e){try{e&&typeof e.dispatchEvent=="function"&&typeof e.Event=="function"&&e.dispatchEvent(new e.Event(Fh))}catch{}}function fj(e,t,n=Ur(),s={}){var m;if($h(n),!ea(n))return Promise.resolve(!1);const o=cc(e);if(!o||(m=s.signal)!=null&&m.aborted)return Promise.resolve(!1);const a=Number.isFinite(s.timeoutMs)&&s.timeoutMs>0?s.timeoutMs:nj,u=s.setTimer||((v,b)=>setTimeout(v,b)),h=s.clearTimer||(v=>clearTimeout(v)),f=s.signal;return hj(n),new Promise(v=>{let b=!1,y=!1,S=null,w=null;const x=k=>{if(!b){if(b=!0,f&&w&&f.removeEventListener("abort",w),S!==null&&h(S),k)Bf.add(n);else try{n.speechSynthesis.cancel()}catch{}v(k)}};w=()=>x(!1),f&&f.addEventListener("abort",w,{once:!0});try{n.speechSynthesis.cancel();const k=new n.SpeechSynthesisUtterance(o);k.lang=Ar(t);const P=ob(rb(n),k.lang);P&&(k.voice=P),k.onstart=()=>{y=!0},k.onend=()=>x(y),k.onerror=()=>x(!1),S=u(()=>x(!1),a),n.speechSynthesis.speak(k)}catch{x(!1)}})}function pj(e={}){const t=e.scope||Ur(),n=e.document||t&&t.document,s=Number.isInteger(e.maxPending)&&e.maxPending>=0?e.maxPending:ej,o=Number.isFinite(e.watchdogMs)&&e.watchdogMs>0?e.watchdogMs:tj,a=Number.isFinite(e.dedupWindowMs)&&e.dedupWindowMs>0?e.dedupWindowMs:ij,u=Number.isInteger(e.maxDedup)&&e.maxDedup>0?e.maxDedup:sj,h=e.now||Date.now,f=e.setTimer||((z,I)=>setTimeout(z,I)),m=e.clearTimer||(z=>clearTimeout(z)),v=e.isPrimed||(()=>sb(t)),b=t&&t.speechSynthesis;let y=null,S=null,w=[],x=[],k=()=>{};const P=new Map,E=()=>{x=rb(t)};if(E(),b&&typeof b.addEventListener=="function")b.addEventListener("voiceschanged",E),k=()=>b.removeEventListener("voiceschanged",E);else if(b&&"onvoiceschanged"in b){const z=b.onvoiceschanged,I=(...C)=>{E(),typeof z=="function"&&z.apply(b,C)};b.onvoiceschanged=I,k=()=>{b.onvoiceschanged===I&&(b.onvoiceschanged=z)}}const F=z=>{if(z&&typeof z.id=="string"&&z.id)return`id:${z.id}`;const I=Number(z&&z.ts),C=cc(z&&z.title);return Number.isFinite(I)&&C?`frame:${I}:${C}`:""},M=z=>{if(!z)return!0;const I=h();for(const[C,T]of P)I-T>=a&&P.delete(C);if(P.has(z))return!1;for(P.set(z,I);P.size>u;)P.delete(P.keys().next().value);return!0},V=()=>{S!==null&&m(S),S=null},G=()=>{V(),y&&(y.onend=null,y.onerror=null,y=null),ab(t)},O=z=>{if(!ea(t))return w=[],"unsupported";let I;try{I=new t.SpeechSynthesisUtterance(z.text),I.lang=Ar(z.lang);const T=ob(x,I.lang);T&&(I.voice=T)}catch{return w=[],"error"}y=I;const C=()=>{if(y!==I)return;V(),y=null,I.onend=null,I.onerror=null;const T=w.shift();T&&O(T)};I.onend=C,I.onerror=C;try{return S=f(()=>{if(y!==I)return;y=null,I.onend=null,I.onerror=null;try{t.speechSynthesis.cancel()}catch{}V();const T=w.shift();T&&O(T)},o),t.speechSynthesis.speak(I),"speaking"}catch{return C(),"error"}},Z=(z,I)=>{if(!ea(t))return"unsupported";const C=uj(z);if(!C)return"empty";if(!M(F(z)))return"duplicate";if(!dj(n))return"inactive";if(!v())return"unprimed";const T={text:C,lang:I};return z&&z.urgency==="high"?(w=[],G(),O(T)):y?s===0?"dropped":(w.length>=s&&w.shift(),w.push(T),"queued"):O(T)},X=()=>{w=[],G()};return{enqueue:Z,stop:X,dispose:()=>{X(),k(),k=()=>{}}}}function lb(){const[e,t]=N.useState(I_);N.useEffect(()=>{const s=o=>{if((o==null?void 0:o.type)==="storage"&&o.key!==Of&&o.key!==null)return;const a=(o==null?void 0:o.type)===Nl?zf(o.detail):I_();t(a)};return window.addEventListener(Nl,s),window.addEventListener("storage",s),()=>{window.removeEventListener(Nl,s),window.removeEventListener("storage",s)}},[]);const n=N.useCallback(s=>{const o=aj({enabled:s===!0});return t(o),window.dispatchEvent(new CustomEvent(Nl,{detail:o})),o.enabled},[]);return[e.enabled,n]}function mj({text:e}){const[t,n]=N.useState(!1),s=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}};return c.jsxs("div",{className:"nc-set-copyline",children:[c.jsx("code",{children:e}),c.jsxs("button",{type:"button",className:"nc-btn ghost",onClick:s,children:[c.jsx(Je,{name:"copy",size:14})," ",p(t?"copied":"copy")]})]})}function gj({value:e}){const[t,n]=N.useState("");return N.useEffect(()=>{let s=!0;return JN.toDataURL(e,{margin:1,width:220}).then(o=>{s&&n(o)}).catch(()=>{}),()=>{s=!1}},[e]),t?c.jsx("img",{src:t,width:"220",height:"220",alt:"NexusCrew pairing QR"}):null}function vj({token:e,nodes:t,roster:n,settings:s,readonly:o,refresh:a,refreshAliases:u,vlUnavailable:h=[]}){const[f,m]=N.useState(null),[v,b]=N.useState(null),[y,S]=N.useState(null),[w,x]=N.useState({ssh:"",sshPort:"",name:""}),[k,P]=N.useState(""),[E,F]=N.useState(""),[M,V]=N.useState(""),[G,O]=N.useState(!1),[Z,X]=N.useState(null),Q=Date.now(),z=s&&s.deviceName||"",I=(t||[]).filter(j=>j&&j.direction==="outbound"&&j.name&&j.ssh),C=I.find(j=>j.name===k)||I[0]||null,T=I.find(j=>j.name===E)||I[0]||null,A=T?Yd(T.tunnel,Q):null,$=T!=null&&T.shared?A!=null&&A.up?"share-local-active":"share-local-pending":A!=null&&A.up?"share-local-private":"share-local-private-down",U=[{key:"peer-group-hubs",rows:(t||[]).filter(j=>j.kind!=="transitive"&&j.kind!=="vl"&&j.relation!=="client")},{key:"peer-group-clients",rows:(t||[]).filter(j=>j.kind!=="transitive"&&j.kind!=="vl"&&j.relation==="client")},{key:"peer-group-routed",rows:(t||[]).filter(j=>j.kind==="transitive")},{key:"peer-group-vl",rows:(t||[]).filter(j=>j.kind==="vl")}],R=Z&&(t||[]).find(j=>`${j.kind||"direct"}:${j.nodeId||j.name}`===Z)||null,K=async j=>{if(T){m(null),b(`${T.name}:share`);try{const D=await P0(e,T.name,j);await a(),D&&D.reversePoolPending===!0&&m(`${T.name}: ${p("share-reverse-pool-pending")}`)}catch(D){const W=D!=null&&D.data&&D.data.shared===!1?D.data:null;if(W)try{await a()}catch{}const ne=D!=null&&D.data&&typeof D.data.hint=="string"?D.data.hint:"",ce=(W==null?void 0:W.revoked)===!0&&(W==null?void 0:W.localReconcilePending)===!0?p("share-off-local-reconcile-pending"):(W==null?void 0:W.revoked)===!1&&(W==null?void 0:W.reconcilePending)===!0?p("share-off-hub-reconcile-pending"):"",pe=D!=null&&D.data&&D.data.reversePoolPending===!0?p("share-reverse-pool-pending"):"",ye=D!=null&&D.data&&typeof D.data.code=="string"?D.data.code:"",me=D!=null&&D.data&&typeof D.data.detail=="string"?D.data.detail.trim():"",ae=me&&me!==String(D.message||"")?me:"";m(`${T.name}: ${String(D.message||D)}${ye?` [${ye}]`:""}${ae?` — ${ae}`:""}${ne?` — ${ne}`:""}${ce?` — ${ce}`:""}${pe?` — ${pe}`:""}`)}b(null)}},B=async()=>{if(m(null),C){const W=Ig({name:C.name,ssh:C.ssh,sshPort:C.sshPort||""});if(!W.ok){m(p(W.error));return}b("invite");try{S(await bg(e,{ssh:W.value.ssh,...W.value.sshPort?{sshPort:W.value.sshPort}:{}},[C.name]))}catch(ne){m(ne&&ne.status===404?p("invite-hub-only"):String(ne.message||ne))}b(null);return}const j=vs(w.name||M||z||"NexusCrew"),D=Ig({name:j,ssh:w.ssh,sshPort:w.sshPort});if(!D.ok){m(p(D.error));return}b("invite");try{S(await bg(e,{...M||z?{label:M||z}:{},name:j,ssh:D.value.ssh,...D.value.sshPort?{sshPort:D.value.sshPort}:{}}))}catch(W){m(String(W.message||W))}b(null)};return c.jsxs("div",{className:"nc-set-tab",children:[c.jsx("div",{className:"nc-sheet-label",children:p("peer-inventory-title")}),(t||[]).length===0&&c.jsx("div",{className:"nc-empty",children:p("no-nodes")}),U.map(j=>j.rows.length>0&&c.jsxs("div",{className:"nc-peer-group",children:[c.jsxs("div",{className:"nc-peer-group-title",children:[p(j.key)," ",c.jsx("span",{children:j.rows.length})]}),j.rows.map(D=>{const W=u2(D);if(!W)return null;const ne=`${D.kind||"direct"}:${D.nodeId||D.name}`,ce=W.routed?{up:W.reach.up,since:null}:Yd(D.tunnel,Q);return c.jsxs("button",{type:"button",className:`nc-set-node nc-node-row${W.routed?" routed":""}`,"aria-label":`${W.title} — ${p("node-detail-open")}`,onClick:()=>X(ne),children:[c.jsx("span",{className:`nc-dot ${W.reach.up?"on":""}`}),c.jsxs("span",{className:"nc-node-row-text",children:[c.jsx("b",{children:W.title}),c.jsxs("small",{children:[W.routed?W.routeLabel:`${W.subtitle} · ${p(W.exposure.shortKey)}`,!W.routed&&W.exposure.shortKey==="visibility-selected"?` (${W.exposure.count})`:""]})]}),c.jsxs("span",{className:`nc-set-tunnel${W.reach.up?" up":""}`,children:[p(W.reach.key),ce.since?` · ${ce.since}`:""]}),c.jsx("span",{className:"nc-node-row-more",children:c.jsx(Je,{name:"chevronDown",size:14})})]},ne)})]},j.key)),h.length>0&&c.jsxs("div",{className:"nc-err",children:[p("vl-owners-unavailable"),": ",h.map(j=>j.label||j.route.join("/")).join(", ")]}),R&&c.jsx(b2,{node:R,nodes:t||[],token:e,readonly:o,refresh:a,onClose:()=>X(null)}),(n||[]).some(j=>!j.direct&&j.instanceId)&&c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("routed-node-aliases")}),c.jsx("small",{className:"nc-set-hint",children:p("routed-node-aliases-help")}),(n||[]).filter(j=>!j.direct&&j.instanceId).map(j=>c.jsxs("div",{className:"nc-set-node",children:[c.jsxs("div",{className:"nc-set-node-head",children:[c.jsx("span",{className:`nc-dot ${j.status==="up"?"on":""}`}),c.jsx("b",{children:j.label||j.name}),c.jsx("small",{children:(j.route||[]).join(" › ")})]}),c.jsxs("div",{className:"nc-set-node-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:o||!!v,onClick:async()=>{const D=window.prompt(p("node-local-alias"),j.alias||"");if(D!=null){if(D.trim()&&!Mr(D.normalize("NFC"))){m(p("err-label"));return}b(`${j.instanceId}:alias`),m(null);try{D.trim()?await N0(e,j.instanceId,D):await Sg(e,j.instanceId),u()}catch(W){m(String(W.message||W))}b(null)}},children:p("alias-on-device")}),j.alias&&c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:o||!!v,onClick:async()=>{b(`${j.instanceId}:alias-reset`),m(null);try{await Sg(e,j.instanceId),u()}catch(D){m(String(D.message||D))}b(null)},children:p("reset-alias")})]})]},j.instanceId))]}),T&&c.jsxs("div",{className:"nc-set-form nc-local-share",children:[c.jsx("div",{className:"nc-sheet-label",children:p("share-local-heading")}),I.length>1&&c.jsxs("label",{className:"nc-field",children:[p("share-local-hub"),c.jsx("select",{value:T.name,disabled:o||!!v,onChange:j=>F(j.target.value),children:I.map(j=>c.jsx("option",{value:j.name,children:j.label||j.name},j.name))})]}),c.jsxs("label",{className:"nc-check nc-node-share",children:[c.jsx("input",{type:"checkbox",checked:T.shared===!0,disabled:o||!!v,onChange:j=>K(j.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("share-local-through").replace("{device}",z||p("local")).replace("{hub}",T.label||T.name)}),c.jsx("small",{children:p(T.shared?"share-node-on-desc":"share-node-off-desc")})]})]}),c.jsx("div",{className:`nc-set-test${T.shared&&(A!=null&&A.up)?" ok":A!=null&&A.up?"":" ko"}`,children:p($)}),!(A!=null&&A.up)&&c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:o||!!v,onClick:()=>K(T.shared===!0),children:p("share-local-reconnect")})]}),c.jsx(qw,{token:e,deviceDefault:z,localNodeId:s&&s.nodeId||"",localNameDefault:s&&s.localName||"",readonly:o,onSuccess:a}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("invite-node")}),c.jsx("small",{className:"nc-set-hint",children:p(C?"invite-network-hint":"invite-v2-hint")}),C?c.jsxs(c.Fragment,{children:[I.length>1&&c.jsxs("label",{className:"nc-field",children:[p("invite-network-label"),c.jsx("select",{value:C.name,disabled:o||!!v,onChange:j=>{P(j.target.value),S(null)},children:I.map(j=>c.jsx("option",{value:j.name,children:j.label||j.name},j.name))})]}),c.jsxs("div",{className:"nc-set-info nc-invite-endpoint",children:[p("invite-network-via"),": ",c.jsx("b",{children:C.label||C.name})," · ",C.ssh,C.sshPort?`:${C.sshPort}`:""]}),c.jsx("small",{className:"nc-set-hint",children:p("invite-network-route")})]}):c.jsxs("label",{className:"nc-field",children:[p("invite-endpoint-label"),c.jsx("input",{placeholder:"user@host",value:w.ssh,disabled:o,onChange:j=>x({...w,ssh:j.target.value})}),c.jsx("small",{className:"nc-set-hint",children:p("invite-endpoint-needed")})]}),!C&&G&&c.jsxs("div",{className:"nc-invite-advanced",children:[c.jsxs("label",{className:"nc-field",children:[p("node-ssh-port-label"),c.jsx("input",{inputMode:"numeric",placeholder:"22",value:w.sshPort,disabled:o,onChange:j=>x({...w,sshPort:j.target.value.replace(/[^0-9]/g,"").slice(0,5)})})]}),c.jsxs("label",{className:"nc-field",children:[p("device-name-label"),c.jsx("input",{placeholder:z||"NexusCrew",value:M,disabled:o,onChange:j=>V(j.target.value)}),c.jsx("small",{className:"nc-set-hint",children:p("device-name-hint")})]}),c.jsxs("label",{className:"nc-field",children:[p("node-name-label"),c.jsx("input",{placeholder:vs(M||z||p("node-name-ph")),value:w.name,disabled:o,onChange:j=>x({...w,name:j.target.value?vs(j.target.value):""})})]})]}),c.jsxs("div",{className:"nc-set-row nc-invite-actions",children:[c.jsx("button",{type:"button",className:"nc-btn primary",disabled:o||!!v||!C&&!w.ssh.trim(),onClick:B,children:p("create-pairing-link")}),!C&&c.jsxs("button",{type:"button",className:"nc-btn ghost",disabled:!!v,onClick:()=>O(j=>!j),children:[G?"▾":"▸"," ",p("pair-advanced")]})]}),y&&c.jsxs(c.Fragment,{children:[c.jsx(gj,{value:y.pairingUrl}),c.jsx(mj,{text:y.pairingUrl}),c.jsx("div",{className:"nc-set-info",children:p("invite-next-steps")})]})]}),f&&c.jsx("div",{className:"nc-err",children:f})]})}function _j({token:e,readonly:t}){const[n,s]=N.useState("idle"),[o,a]=N.useState(!1),[u,h]=N.useState(null);N.useEffect(()=>{let m=!1;return x2().then(v=>{m||s(v)}),()=>{m=!0}},[]);const f=async()=>{h(null),a(!0);try{n==="subscribed"?(await C2(e),s("idle")):(await k2(e),s("subscribed"))}catch(m){const v=String(m.message||m);v==="push-denied"?(s("denied"),h(p("push-denied"))):v==="push-unsupported"?(s("unsupported"),h(p("push-unsupported"))):h(v)}a(!1)};return n==="unsupported"?c.jsx("div",{className:"nc-set-info",children:p("push-unsupported")}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||o||n==="denied",title:t?p("settings-readonly"):"",onClick:f,children:p(n==="subscribed"?"push-disable":"push-enable")}),c.jsx("span",{className:"nc-set-info",children:p(n==="subscribed"?"push-on":n==="denied"?"push-denied":"push-off")})]}),u&&c.jsx("div",{className:"nc-err",children:u})]})}function yj(){const[e,t]=lb(),[n,s]=N.useState(""),[o,a]=N.useState(""),[u,h]=N.useState(!1),[f,m]=N.useState(sb),v=N.useRef(0),b=N.useRef(!1),y=N.useRef(null),S=ea();N.useEffect(()=>()=>{var k;v.current+=1,b.current&&((k=y.current)==null||k.abort(),y.current=null,b.current=!1,$h())},[]);const w=async()=>{const k=v.current+=1,P=typeof AbortController=="function"?new AbortController:null;s(""),a(""),h(!0),m(!1),b.current=!0,y.current=P;const E=await fj(p("notification-speech-preview"),Ol(),void 0,P?{signal:P.signal}:{});return k!==v.current||(y.current=null,b.current=!1,h(!1),m(E),E?a(p("notification-speech-preview-ok")):s(p("notification-speech-preview-failed"))),E},x=k=>{var P;if(t(k),s(""),a(""),k)w();else{v.current+=1;const E=b.current;(P=y.current)==null||P.abort(),y.current=null,b.current=!1,h(!1),m(!1),$h(),E||ab()}};return c.jsxs("div",{className:"nc-set-form",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":p("notification-speech-enable"),checked:e,disabled:!S,onChange:k=>x(k.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("notification-speech-enable")}),c.jsx("small",{children:p("notification-speech-help")})]})]}),S?c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:!e||u,onClick:()=>{w()},children:p(u?"notification-speech-testing":"notification-speech-test")})}):c.jsx("div",{className:"nc-set-info",children:p("notification-speech-unsupported")}),e&&!f&&!u&&!n&&c.jsx("div",{className:"nc-set-info",children:p("notification-speech-needs-test")}),o&&c.jsx("div",{className:"nc-set-info",role:"status",children:o}),n&&c.jsx("div",{className:"nc-err",children:n})]})}function wj({token:e,readonly:t,nodes:n=[],settings:s=null}){const[o,a]=N.useState(null),[u,h]=N.useState([]),[f,m]=N.useState({name:"",mode:"primary-failover",targets:[]}),[v,b]=N.useState(null),[y,S]=N.useState(!1),[w,x]=N.useState(null),[k,P]=N.useState(""),E=N.useCallback(async()=>{try{const[U,R]=await Promise.all([A0(e),I0(e)]);a(U),h(Array.isArray(R==null?void 0:R.groups)?R.groups:[]),P("")}catch(U){P(String(U.message||U))}},[e]);N.useEffect(()=>{E()},[E]);const F=async U=>{S(!0),x(null),P("");try{a(await T0(e,U))}catch(R){P(String(R.message||R))}S(!1)},M=async()=>{S(!0),x(null),P("");try{x({kind:"test",...await D0(e)})}catch(U){P(String(U.message||U))}S(!1)},V=async()=>{S(!0),x(null),P("");try{x({kind:"stop",...await M0(e)})}catch(U){P(String(U.message||U))}S(!1)},G=[],O=new Set,Z=(U,R)=>{const K=typeof U=="string"?U.toLowerCase():"";!/^[a-f0-9]{32}$/.test(K)||O.has(K)||(O.add(K),G.push({id:K,label:R||K}))};Z(s==null?void 0:s.nodeId,p("audio-group-local"));for(const U of n||[])Z((U==null?void 0:U.nodeId)||(U==null?void 0:U.instanceId),(U==null?void 0:U.label)||(U==null?void 0:U.name)||(U==null?void 0:U.nodeId));for(const U of f.targets)Z(U,`${U} (${p("audio-group-unavailable-target")})`);const X=(U=null)=>{P(""),U?(b(U.name),m({name:U.name,mode:U.mode,targets:[...U.targets||[]]})):(b(null),m({name:"",mode:"primary-failover",targets:[]}))},Q=(U,R)=>m(K=>({...K,targets:R?[...new Set([...K.targets,U])]:K.targets.filter(B=>B!==U)})),z=async()=>{const U=f.name.trim().toLowerCase();if(!/^[a-z0-9][a-z0-9-]{0,31}$/.test(U)||f.targets.length<1){P(p("audio-group-invalid"));return}S(!0),P("");try{const R=await O0(e,U,{targets:f.targets,mode:f.mode}),K=R==null?void 0:R.group;if(!K||!K.name)throw new Error(p("audio-group-save-failed"));h(B=>[...B.filter(j=>j.name!==K.name),K].sort((j,D)=>j.name.localeCompare(D.name))),X(null)}catch(R){P(String(R.message||R))}S(!1)},I=async U=>{S(!0),P("");try{await B0(e,U),h(R=>R.filter(K=>K.name!==U)),v===U&&X(null)}catch(R){P(String(R.message||R))}S(!1)},C=(o==null?void 0:o.installed)===!0,T=(o==null?void 0:o.liveness)==="ready",A=(o==null?void 0:o.consent)===!0&&C&&T,$=w?w.kind==="stop"?p(w.stopped?"audio-stop-stopped":"audio-stop-idle"):w.status==="accepted"||w.status==="spoken"?p("audio-test-accepted"):w.status==="unknown"?p("audio-test-unknown"):`${p("audio-test-refused")}${w.reason?` (${w.reason})`:""}`:"";return c.jsxs("div",{className:"nc-set-tab nc-audio-settings",children:[c.jsxs("div",{className:"nc-set-info",children:[c.jsx("b",{children:p("audio-title")}),c.jsx("br",{}),p("audio-help")]}),o?c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":p("audio-consent"),checked:o.consent===!0,disabled:t||y,onChange:U=>{F(U.target.checked)}}),c.jsxs("span",{children:[c.jsx("b",{children:p("audio-consent")}),c.jsx("small",{children:p("audio-consent-help")})]})]}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("audio-capability")}),c.jsxs("div",{className:"nc-set-info",children:[p("audio-adapter"),": ",o.adapter||p("audio-adapter-none"),c.jsx("br",{}),p("audio-installed"),": ",p(C?"audio-installed-yes":"audio-installed-no"),c.jsx("br",{}),p("audio-liveness"),": ",p(T?"audio-liveness-ready":"audio-liveness-unavailable"),Array.isArray(o.languages)&&o.languages.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("br",{}),p("audio-languages"),": ",o.languages.join(", ")]})]}),o.limits&&c.jsxs("small",{className:"nc-set-hint",children:[p("audio-limits"),": ",o.limits]})]}),!o.consent&&c.jsx("div",{className:"nc-set-info",children:p("audio-test-needs-consent")}),!C&&c.jsx("div",{className:"nc-set-info",children:p("audio-unavailable")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn primary",disabled:t||y||!A,title:t?p("settings-readonly"):"",onClick:()=>{M()},children:p(y?"audio-testing":"audio-test")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:y,onClick:()=>{V()},children:p(y?"audio-stopping":"audio-stop")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:y,onClick:()=>{E()},children:p("refresh")})]}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("audio-groups-title")}),c.jsx("small",{className:"nc-set-hint",children:p("audio-groups-help")}),u.length===0&&c.jsx("div",{className:"nc-set-info",children:p("audio-groups-empty")}),u.map(U=>{var R;return c.jsxs("div",{className:"nc-set-row",children:[c.jsxs("span",{children:[c.jsx("b",{children:U.name})," ",c.jsxs("small",{children:["· ",U.mode==="fanout"?p("audio-group-fanout"):p("audio-group-primary")," · ",((R=U.targets)==null?void 0:R.length)||0]})]}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||y,onClick:()=>X(U),children:p("audio-group-edit")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||y,onClick:()=>{I(U.name)},children:p("audio-group-delete")})]},U.name)}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:t||y,onClick:()=>X(null),children:p("audio-group-new")})}),c.jsxs("label",{className:"nc-field",children:[p("audio-group-name"),c.jsx("input",{"aria-label":p("audio-group-name"),value:f.name,maxLength:"32",disabled:t||y,onChange:U=>m(R=>({...R,name:U.target.value}))})]}),c.jsxs("label",{className:"nc-field",children:[p("audio-group-mode"),c.jsxs("select",{"aria-label":p("audio-group-mode"),value:f.mode,disabled:t||y,onChange:U=>m(R=>({...R,mode:U.target.value})),children:[c.jsx("option",{value:"primary-failover",children:p("audio-group-primary")}),c.jsx("option",{value:"fanout",children:p("audio-group-fanout")})]})]}),c.jsx("div",{className:"nc-set-info",children:p("audio-group-targets")}),G.length===0?c.jsx("small",{className:"nc-set-hint",children:p("audio-group-no-targets")}):G.map(U=>c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:f.targets.includes(U.id),disabled:t||y,onChange:R=>Q(U.id,R.target.checked)}),c.jsxs("span",{children:[U.label,c.jsx("small",{children:U.id})]})]},U.id)),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn primary",disabled:t||y,onClick:()=>{z()},children:p("audio-group-save")}),v&&c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:y,onClick:()=>X(null),children:p("audio-group-cancel")})]})]})]}):c.jsx("div",{className:"nc-set-info",children:p("audio-loading")}),$&&c.jsx("div",{className:"nc-set-note",role:"status",children:$}),k&&c.jsx("div",{className:"nc-err",children:k})]})}function bj(){const[e,t]=kf();return c.jsxs("div",{className:"nc-set-tab nc-input-settings",children:[c.jsx("div",{className:"nc-set-info",children:p("input-settings-local")}),c.jsxs("div",{className:"nc-set-form",children:[c.jsxs("label",{className:"nc-field",children:[p("terminal-keyboard-gesture"),c.jsx("select",{"aria-label":p("terminal-keyboard-gesture"),value:e.terminalKeyboardGesture,onChange:n=>t({terminalKeyboardGesture:n.target.value}),children:kw.map(n=>c.jsx("option",{value:n,children:p(`terminal-keyboard-${n}`)},n))}),c.jsx("small",{children:p("terminal-keyboard-gesture-help")})]}),c.jsxs("label",{className:"nc-field",children:[p("keybar-layout"),c.jsx("select",{"aria-label":p("keybar-layout"),value:e.keybarLayout,onChange:n=>t({keybarLayout:n.target.value}),children:Cw.map(n=>c.jsx("option",{value:n,children:p(`keybar-layout-${n}`)},n))}),c.jsx("small",{children:p("keybar-layout-help")})]})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:e.keybarKeepsKeyboardClosed,onChange:n=>t({keybarKeepsKeyboardClosed:n.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:p("keybar-ime-lock")}),c.jsx("small",{children:p("keybar-ime-lock-help")})]})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:e.voiceKeepsKeyboardClosed,onChange:n=>t({voiceKeepsKeyboardClosed:n.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:p("voice-ime-lock")}),c.jsx("small",{children:p("voice-ime-lock-help")})]})]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:e.showKeybarEnter,onChange:n=>t({showKeybarEnter:n.target.checked})}),c.jsxs("span",{children:[c.jsx("b",{children:p("keybar-enter-show")}),c.jsx("small",{children:p("keybar-enter-show-help")})]})]}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:()=>t(ps),children:p("input-settings-reset")})})]})}function Sj({token:e,roster:t=[],readonly:n}){const s=[{key:"local",route:[],label:p("diagnostics-local"),status:"up"},...t.filter(A=>Array.isArray(A.route)&&A.route.length).map(A=>({key:A.route.join("/"),route:A.route,label:A.label||A.name,status:A.status}))],[o,a]=N.useState("local"),u=s.find(A=>A.key===o)||s[0],[h,f]=N.useState(null),[m,v]=N.useState([]),[b,y]=N.useState(""),[S,w]=N.useState(!1),[x,k]=N.useState(!0),[P,E]=N.useState(900),[F,M]=N.useState("all"),[V,G]=N.useState(""),O=N.useRef(0),Z=N.useRef(null),X=N.useCallback(async()=>{try{const A=await H0(e,u.route);if(f(A),y(""),!S){const $=await U0(e,{after:O.current,limit:200},u.route);Array.isArray($.records)&&$.records.length&&(O.current=$.cursor,v(U=>[...U,...$.records].slice(-500)))}}catch(A){y(A&&A.status===404?p("diagnostics-unsupported"):String(A.message||A))}},[e,u.key,S]);N.useEffect(()=>{O.current=0,v([]),f(null),y("")},[u.key]),N.useEffect(()=>{let A=null,$=!0;const U=()=>{!$||document.visibilityState==="hidden"||X()},R=()=>{A&&clearInterval(A),A=document.visibilityState==="hidden"?null:setInterval(U,2e3),document.visibilityState!=="hidden"&&U()};return document.addEventListener("visibilitychange",R),R(),()=>{$=!1,A&&clearInterval(A),document.removeEventListener("visibilitychange",R)}},[X]),N.useEffect(()=>{x&&Z.current&&(Z.current.scrollTop=Z.current.scrollHeight)},[m,x]);const Q=m.filter(A=>(F==="all"||A.level===F)&&(!V||String(A.component||"").toLowerCase().includes(V.toLowerCase()))),z=Q.map(A=>`${A.ts} ${A.level.toUpperCase()} ${A.component} ${A.code} ${A.message}${Object.keys(A.meta||{}).length?` ${JSON.stringify(A.meta)}`:""}`).join(`
92
92
  `),I=async A=>{y("");try{const $=await A();f($),await X()}catch($){y(String($.message||$))}},C=async()=>{try{await navigator.clipboard.writeText(z)}catch{y(p("copy-manual"))}},T=()=>{try{const A=new Blob([`${JSON.stringify(Q,null,2)}
93
- `],{type:"application/json"}),$=URL.createObjectURL(A),U=document.createElement("a");U.href=$,U.download="nexuscrew-diagnostics.json",U.click(),URL.revokeObjectURL($)}catch{y(p("diagnostics-export-failed"))}};return c.jsxs("div",{className:"nc-set-tab nc-diagnostics",children:[c.jsxs("label",{className:"nc-field",children:[p("diagnostics-target"),c.jsx("select",{value:u.key,onChange:A=>a(A.target.value),children:s.map(A=>c.jsxs("option",{value:A.key,children:[A.label,A.status!=="up"?` · ${A.status}`:""]},A.key))})]}),c.jsxs("div",{className:"nc-set-form nc-diag-controls",children:[c.jsx("div",{className:"nc-sheet-label",children:p("diagnostics-verbose")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("select",{"aria-label":p("diagnostics-duration"),value:P,onChange:A=>E(Number(A.target.value)),disabled:n,children:[300,900,1800,3600].map(A=>c.jsxs("option",{value:A,children:[A/60," min"]},A))}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||(h==null?void 0:h.verbose)===!0,onClick:()=>I(()=>xg(e,!0,P,u.route)),children:p("enable")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||(h==null?void 0:h.verbose)!==!0,onClick:()=>I(()=>xg(e,!1,P,u.route)),children:p("stop")})]}),c.jsx("small",{className:"nc-set-hint",children:h!=null&&h.verbose?p("diagnostics-expires").replace("{time}",new Date(h.expiresAt).toLocaleTimeString()):p("diagnostics-off")})]}),c.jsxs("div",{className:"nc-diag-filters",children:[c.jsxs("select",{"aria-label":p("diagnostics-level"),value:F,onChange:A=>M(A.target.value),children:[c.jsx("option",{value:"all",children:p("diagnostics-all-levels")}),["debug","info","warn","error"].map(A=>c.jsx("option",{value:A,children:A},A))]}),c.jsx("input",{"aria-label":p("diagnostics-component"),placeholder:p("diagnostics-component"),value:V,onChange:A=>G(A.target.value)})]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:S,onChange:A=>w(A.target.checked)})," ",p("diagnostics-pause")]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:x,onChange:A=>k(A.target.checked)})," ",p("diagnostics-autoscroll")]})]}),c.jsx("pre",{ref:Z,className:"nc-diag-log","aria-label":p("diagnostics-log"),children:z||p("diagnostics-empty")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:C,children:p("copy")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:T,children:p("diagnostics-export")}),c.jsx("button",{type:"button",className:"nc-btn danger",disabled:n,onClick:()=>{window.confirm(p("diagnostics-clear-confirm"))&&I(async()=>{const A=await W0(e,u.route);return O.current=0,v([]),A})},children:p("diagnostics-clear")})]}),b&&c.jsx("div",{className:"nc-err",children:b})]})}function xj({token:e,settings:t,readonly:n,refresh:s,roster:o,section:a,setSection:u}){const[h,f]=N.useState(null),[m,v]=N.useState(null),[b,y]=N.useState(!1),[S,w]=N.useState(!1),[x,k]=N.useState(null),[P,E]=N.useState(!0),[F,M]=N.useState(!1);N.useEffect(()=>{k(t&&t.update||null),E(!t||t.autoUpdate!==!1),M(!!(t&&t.alternateScreen))},[t]);const V=async()=>{f(null),v(null),w(!0);try{const C=await k0(e);v(C.note||"ok"),y(!1)}catch(C){f(String(C.message||C))}w(!1)},G=async()=>{f(null),v(null),w(!0);try{const C=await z0(e);v(`${C.note||"ok"}${C.target?` (${C.target})`:""}`)}catch(C){f(String(C.message||C))}w(!1)},O=async C=>{f(null),v(null),w(!0);try{await Ud(e,{autoUpdate:C}),E(C),s&&await s()}catch(T){f(String(T.message||T))}w(!1)},Z=async C=>{f(null),v(null),w(!0);try{await Ud(e,{alternateScreen:C}),M(C),s&&await s()}catch(T){f(String(T.message||T))}w(!1)},X=async()=>{f(null),v(null),w(!0);try{k(await F0(e))}catch(C){f(String(C.message||C))}w(!1)},Q=async()=>{f(null),v(null),w(!0);try{const C=await $0(e);k(C),v(p("npm-update-restarting"))}catch(C){f(String(C.message||C))}w(!1)},z=()=>{window.confirm(p("composer-clear-confirm"))&&(f(null),$E()?(window.dispatchEvent(new Event(Dh)),v(p("composer-clear-done"))):f(p("composer-clear-failed")))},I=t&&t.service;return c.jsxs("div",{className:"nc-set-tab",children:[c.jsx("div",{className:"nc-system-tabs",role:"tablist","aria-label":p("tab-system"),children:["general","diagnostics"].map(C=>c.jsx("button",{type:"button",role:"tab","aria-selected":a===C,className:`nc-set-tabbtn${a===C?" on":""}`,onClick:()=>u(C),children:p(`system-${C}`)},C))}),a==="general"&&c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-this-node")}),t&&c.jsxs("div",{className:"nc-set-info",children:["v",t.version," · ",t.platform," · :",t.port,c.jsx("br",{}),I&&I.installed?p("service-installed"):p("service-missing"),I&&I.installed?` · ${I.active?p("service-active"):p("service-inactive")}`:"",I?` · boot ${I.boot?"on":"off"}`:""]}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S,title:n?p("settings-readonly"):"",onClick:G,children:p("service-regenerate")})}),c.jsx(_j,{token:e,readonly:n}),c.jsx(yj,{})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-updates")}),c.jsxs("div",{className:"nc-set-form nc-update-settings",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:P,disabled:n||S||x&&!x.supported,onChange:C=>O(C.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("npm-auto-update")}),c.jsx("small",{children:p("npm-auto-update-help")})]})]}),x&&c.jsxs("div",{className:"nc-set-info",children:[p("npm-update-current")," v",x.current,x.latest?` · ${p("npm-update-latest")} v${x.latest}`:""," · ",p(`npm-update-${x.supported?x.phase:"unsupported"}`)]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S||!x||!x.supported,onClick:X,children:p("npm-update-check")}),x&&x.available&&c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||S||x.phase==="installing",onClick:Q,children:p("npm-update-install")})]}),x&&x.lastError&&c.jsx("div",{className:"nc-err",children:x.lastError})]})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-security")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S,title:n?p("settings-readonly"):"",onClick:()=>{f(null),v(null),y(!0)},children:p("token-rotate")})})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-local-data")}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("composer-clear-data")}),c.jsx("small",{className:"nc-set-hint",children:p("composer-clear-data-help")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:z,children:p("composer-clear-data")})})]})]})]}),a==="diagnostics"&&c.jsxs("section",{className:"nc-system-group nc-system-diagnostics",children:[c.jsx("h3",{children:p("system-diagnostics")}),c.jsxs("div",{className:"nc-set-form nc-alternate-screen-settings",children:[c.jsx("div",{className:"nc-sheet-label",children:p("system-terminal")}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":p("alternate-screen"),checked:F,disabled:n||S,onChange:C=>Z(C.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("alternate-screen")}),c.jsx("small",{children:p("alternate-screen-help")})]})]})]}),c.jsx(Sj,{token:e,roster:o,readonly:n})]}),b&&c.jsxs("div",{className:"nc-set-confirm",children:[c.jsx("div",{children:p("token-rotate-explain")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:S,onClick:()=>y(!1),children:p("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:S,onClick:V,children:p("confirm")})]})]}),m&&c.jsx("div",{className:"nc-set-note",children:m}),h&&c.jsx("div",{className:"nc-err",children:h})]})}function kj({token:e,onClose:t,initialTab:n="nodes",initialLocation:s="",startNewCell:o=!1}){kn();const a=n==="diagnostics"?"diagnostics":"general",[u,h]=N.useState(n==="diagnostics"?"system":n),f=N.useRef(null),m=N.useRef(null),[v,b]=N.useState({start:!1,end:!1}),[y,S]=N.useState(a),[w,x]=N.useState(null),[k,P]=N.useState([]),[E,F]=N.useState([]),[M,V]=N.useState(!1),[G,O]=N.useState(null),[Z,X]=N.useState(0),Q=nf(e,!0,Z),z=N.useCallback(()=>{const C=f.current;if(!C)return;const T=C.scrollWidth>C.clientWidth+1,A={start:T&&C.scrollLeft>1,end:T&&C.scrollLeft+C.clientWidth<C.scrollWidth-1};b($=>$.start===A.start&&$.end===A.end?$:A)},[]);N.useEffect(()=>{const C=f.current;if(!C)return;const T=typeof ResizeObserver=="function"?new ResizeObserver(z):null;return T==null||T.observe(C),window.addEventListener("resize",z),z(),()=>{T==null||T.disconnect(),window.removeEventListener("resize",z)}},[z]),N.useEffect(()=>{var T,A;(A=(T=m.current)==null?void 0:T.scrollIntoView)==null||A.call(T,{behavior:"smooth",block:"nearest",inline:"nearest"});const C=window.requestAnimationFrame?window.requestAnimationFrame(z):setTimeout(z,0);return()=>{window.cancelAnimationFrame?window.cancelAnimationFrame(C):clearTimeout(C)}},[u,z]);const I=N.useCallback(async()=>{var C;try{const T=await J_(e);x(T),O(null)}catch(T){O(String(T.message||T))}try{const A=(await b0(e)).peers||[];let $=[],U=[];try{const[R,K]=await Promise.all([Ft("/api/config",e).then(W=>W.json()).catch(()=>null),ey(e).catch(()=>null)]),B=R&&typeof R.instanceId=="string"?R.instanceId:"",j=[{instanceId:B||null,route:[],label:null},...cy(K,B)],D=await Promise.all(j.map(async W=>{try{return{ok:!0,peers:((await Z_(e,W.route)).nodes||[]).map(pe=>ly(pe,W)).filter(Boolean)}}catch(ne){return{ok:!1,owner:W,error:ne}}}));for(const W of D){if(W.ok){$.push(...W.peers);continue}W.owner.route.length!==0&&U.push({instanceId:W.owner.instanceId,label:W.owner.label,route:W.owner.route,failure:/timeout/i.test(String(((C=W.error)==null?void 0:C.message)||W.error))?"timeout":"unreachable"})}}catch{}F(U),P([...A,...$])}catch(T){O(String(T.message||T))}},[e]);return N.useEffect(()=>{I();const C=setInterval(I,5e3);return()=>clearInterval(C)},[I]),N.useEffect(()=>{let C=!1;return Ft("/api/config",e).then(T=>T.json()).then(T=>{C||V(!!T.readonlyDefault)}).catch(()=>{}),()=>{C=!0}},[e]),c.jsx("div",{className:"nc-set-overlay",onClick:t,children:c.jsxs("div",{className:"nc-set-panel",onClick:C=>C.stopPropagation(),children:[c.jsxs("div",{className:"nc-set-head",children:[c.jsx(Je,{name:"gear",size:18}),c.jsx("b",{children:p("settings")}),c.jsx("button",{type:"button",className:"nc-set-close",onClick:t,title:p("close"),children:c.jsx(Je,{name:"x",size:18})})]}),M&&c.jsx("div",{className:"nc-set-readonly",children:p("settings-readonly")}),G&&c.jsx("div",{className:"nc-err",children:G}),c.jsx("div",{className:`nc-set-tabs-wrap${v.start?" has-start-overflow":""}${v.end?" has-end-overflow":""}`,children:c.jsx("div",{className:"nc-set-tabs",ref:f,onScroll:z,children:["nodes","fleet","audio","input","system"].map(C=>c.jsx("button",{ref:u===C?m:null,type:"button",className:`nc-set-tabbtn${u===C?" on":""}`,onClick:()=>h(C),children:p(`tab-${C}`)},C))})}),c.jsxs("div",{className:"nc-set-body",children:[u==="nodes"&&c.jsx(vj,{token:e,nodes:k,roster:Q,settings:w,readonly:M,vlUnavailable:E,refresh:I,refreshAliases:()=>X(C=>C+1)}),u==="fleet"&&c.jsx(J2,{token:e,readonly:M,startNewCell:o,initialLocation:s,targets:Q.map(C=>({route:C.route,label:C.label||C.name,status:C.status}))}),u==="audio"&&c.jsx(wj,{token:e,readonly:M,nodes:k,settings:w}),u==="input"&&c.jsx(bj,{}),u==="system"&&c.jsx(xj,{token:e,settings:w,readonly:M,refresh:I,roster:Q,section:y,setSection:S})]})]})})}function Cj({token:e,initialPair:t,deviceDefault:n="",localNodeId:s="",localNameDefault:o="",onPairDone:a,onDone:u}){kn();const[h,f]=N.useState(t?"pair":"welcome"),[m,v]=N.useState(!1),[b,y]=N.useState(null),S=async()=>{v(!0),y(null);try{await Ud(e,{wizardDone:!0}),a&&a(),u()}catch(w){y(String(w.message||w)),v(!1)}};return c.jsx("div",{className:"nc-wiz-overlay",children:c.jsxs("div",{className:"nc-wiz",children:[c.jsxs("div",{className:"nc-wiz-head",children:[c.jsx("b",{children:p("wizard-title")}),c.jsx("small",{children:p("hydra-simple")})]}),h==="welcome"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:p("local-ready")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:S,children:p("local-only")}),c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:()=>f("pair"),children:p("add-node")})]})]}),h==="pair"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx(qw,{token:e,initial:t||"",autoStart:!!t,deviceDefault:n,localNodeId:s,localNameDefault:o,onBusyChange:v,onSuccess:async()=>{a&&a(),f("done")}}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:()=>{a&&a(),f("welcome")},children:p("back")})})]}),h==="done"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:p("node-connected")}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:S,children:p("finish")})})]}),b&&c.jsx("div",{className:"nc-err",children:b})]})})}function Ej(e,t){if(typeof EventSource>"u"||!e)return()=>{};const n=new EventSource(`/api/events?token=${encodeURIComponent(e)}`);return n.onmessage=s=>{try{const o=JSON.parse(s.data);o&&typeof o=="object"&&typeof o.type=="string"&&t(o)}catch{}},()=>{try{n.close()}catch{}}}const Nj=6e3,jj=12e3;function Rj({n:e,onClose:t}){return c.jsxs("div",{className:`nc-ntf-toast${e.urgency==="high"?" high":""}`,role:"status","aria-live":"polite",children:[c.jsxs("div",{className:"nc-ntf-toast-txt",children:[c.jsx("b",{children:e.title}),e.body&&c.jsx("small",{children:e.body}),e.session&&c.jsx("span",{className:"nc-ntf-from",children:e.session})]}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:t,title:p("close"),children:c.jsx(Je,{name:"x",size:14})})]})}function Pj({ask:e,token:t,onAnswered:n,onDismiss:s}){const[o,a]=N.useState(""),[u,h]=N.useState(!1),[f,m]=N.useState(null),[v,b]=N.useState(!1),y=async w=>{const x=String(w||"").trim();if(!(!x||u)){m(null),h(!0);try{await q0(t,e.id,x),n(e.id)}catch(k){m(String(k.message||k))}h(!1)}},S=async()=>{if(!v){b(!0);try{await V0(t,e.id),s(e.id)}catch{b(!1)}}};return c.jsxs("div",{className:"nc-ask-card",children:[c.jsxs("div",{className:"nc-ask-head",children:[c.jsx("span",{className:"nc-ntf-from",children:e.session}),c.jsxs("code",{className:"nc-ask-id",children:["#",e.id]}),c.jsx("button",{type:"button",className:"nc-ask-dismiss",title:p("ask-dismiss"),"aria-label":p("ask-dismiss"),disabled:v,onClick:S,children:c.jsx(Je,{name:"x",size:14})})]}),c.jsx("div",{className:"nc-ask-q",children:e.question}),Array.isArray(e.options)&&e.options.length>0&&c.jsx("div",{className:"nc-ask-opts",children:e.options.map(w=>c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u,onClick:()=>y(w),children:w},w))}),c.jsxs("div",{className:"nc-ask-reply",children:[c.jsx("textarea",{rows:2,placeholder:p("ask-reply-ph"),value:o,disabled:u,onChange:w=>a(w.target.value)}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:u||!o.trim(),onClick:()=>y(o),children:p("send")})]}),f&&c.jsx("div",{className:"nc-err",children:f})]})}function Lj({token:e}){const[t]=kn(),[n]=lb(),[s,o]=N.useState([]),[a,u]=N.useState([]),[h,f]=N.useState(()=>{try{return/(?:^|[#&])ask=/.test(location.hash)}catch{return!1}}),m=N.useRef(0),v=N.useRef(null);v.current||(v.current=pj());const b=N.useRef({enabled:n,lang:t});b.current={enabled:n,lang:t};const y=N.useCallback(k=>{o(P=>P.filter(E=>E.key!==k))},[]),S=N.useCallback(k=>{const P=`t${m.current+=1}`;o(F=>[...F.slice(-3),{...k,key:P}]),setTimeout(()=>y(P),k.urgency==="high"?jj:Nj);const E=b.current;if(E.enabled)try{v.current.enqueue(k,cj(k,E.lang))}catch{}},[y]);N.useEffect(()=>{n||v.current.stop()},[n]),N.useEffect(()=>{const k=()=>{(document.visibilityState!=="visible"||!document.hasFocus())&&v.current.stop()},P=()=>v.current.stop();return document.addEventListener("visibilitychange",k),window.addEventListener("blur",k),window.addEventListener(Fh,P),()=>{document.removeEventListener("visibilitychange",k),window.removeEventListener("blur",k),window.removeEventListener(Fh,P),typeof v.current.dispose=="function"?v.current.dispose():v.current.stop()}},[]),N.useEffect(()=>{if(!e)return;let k=!1;K0(e).then(E=>{k||u(E.asks||[])}).catch(()=>{});const P=Ej(e,E=>{E.type==="notify"?S(E):E.type==="ask"&&E.ask&&E.ask.id?u(F=>F.some(M=>M.id===E.ask.id)?F:[...F,E.ask]):E.type==="ask-answered"&&E.id?u(F=>F.filter(M=>M.id!==E.id)):E.type==="ask-dismissed"&&E.id&&u(F=>F.filter(M=>M.id!==E.id))});return()=>{k=!0,P()}},[e,S]);const w=k=>u(P=>P.filter(E=>E.id!==k)),x=k=>u(P=>P.filter(E=>E.id!==k));return c.jsxs(c.Fragment,{children:[s.length>0&&c.jsx("div",{className:"nc-ntf-toasts",children:s.map(k=>c.jsx(Rj,{n:k,onClose:()=>y(k.key)},k.key))}),a.length>0&&!h&&c.jsxs("button",{type:"button",className:"nc-ask-badge",onClick:()=>f(!0),title:p("asks-title"),children:["? ",c.jsx("span",{className:"nc-ask-count",children:a.length})]}),a.length>0&&h&&c.jsxs("div",{className:"nc-ask-panel",children:[c.jsxs("div",{className:"nc-ask-panel-head",children:[c.jsx("b",{children:p("asks-title")}),c.jsx("span",{className:"nc-ask-count",children:a.length}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:()=>f(!1),title:p("close"),children:c.jsx(Je,{name:"x",size:16})})]}),c.jsx("div",{className:"nc-ask-panel-body",children:a.map(k=>c.jsx(Pj,{ask:k,token:e,onAnswered:w,onDismiss:x},k.id))})]})]})}const Aj=4e3;async function Tj(e){const t=await Ft("/api/sessions",e);if((t==null?void 0:t.ok)===!1)throw new Error(`HTTP ${t.status}`);const n=await t.json();if(!Array.isArray(n==null?void 0:n.sessions))throw new Error("invalid sessions payload");return n.sessions}async function Fd(e,t=[]){var h;const[n,s]=await Promise.allSettled([t.length?Jh(e,t):Tj(e),ws(e,t)]),o=n.status==="fulfilled"&&Array.isArray((h=n.value)==null?void 0:h.sessions)?n.value.sessions:Array.isArray(n.value)?n.value:null,a=s.status==="fulfilled"?s.value:null,u=(a==null?void 0:a.available)===!0&&Array.isArray(a.cells)?a.cells:null;return{sessions:o,cells:u,fresh:Array.isArray(o)&&Array.isArray(u)}}function cb(e,t,n){return n===!0&&(e==null?void 0:e.degraded)!==!0&&(e==null?void 0:e.active)===!0&&e.tmux!==!1&&!!e.tmuxSession&&(t||[]).some(s=>(s==null?void 0:s.name)===e.tmuxSession)}function Dj(e){const t=new Map((e.sessions||[]).map(o=>[o.name,o])),n=[],s=(o,a,u,h=[],f="")=>{const m=new Map((a||[]).map(v=>[v.name,v]));for(const v of o||[]){const b=m.get(v.tmuxSession)||{},y=of(v,b),S=cb(v,a,u);n.push({key:Go(h,v.tmuxSession||v.cell),session:v.tmuxSession,route:h,cellName:v.cell,label:v.cell,node:h.length?h.join("/"):"",nodeLabel:f,live:S,selectable:S,verified:u===!0,working:y.working,degraded:!!v.degraded,activity:b.activity||v.activity||0,subtitle:y.subtitle})}};s(e.cells,[...t.values()],e.localFresh===!0);for(const o of e.nodeGroups||[])s(o.cells,o.sessions,o.switcherFresh===!0,Array.isArray(o.route)?o.route:[],o.label||o.name||"");return n}function Mj(e){const t=new Map,n=Array.isArray(e.sessions)?e.sessions:[],s=Array.isArray(e.cells)?e.cells:[],o=new Map(n.map(u=>[u.name,u])),a=new Set(s.map(u=>u.tmuxSession).filter(Boolean));t.set("local",af(s,n.filter(u=>!a.has(u.name)),o));for(const u of e.nodeGroups||[]){const h=Array.isArray(u.route)?u.route:[];if(!h.length)continue;const f=Array.isArray(u.cells)?u.cells:[],m=Array.isArray(u.sessions)?u.sessions:[],v=new Set(f.map(b=>b.tmuxSession).filter(Boolean));t.set(h.join("/"),Fl({...u,route:h,cells:f,sessions:m,unmanaged:m.filter(b=>!v.has(b.name))}).rawItems)}return t}function Ij(e,t,n,s){return[...new Set(e.map(a=>a.node||"local"))].flatMap(a=>{const u=e.filter(v=>(v.node||"local")===a),h=new Map((t.get(a)||[]).map(v=>[v.key,v])),f=new Map(u.map(v=>[v.key,v])),m=u.map(v=>{const b=h.get(v.key);return{...v,label:(b==null?void 0:b.label)||v.label,live:(b==null?void 0:b.live)??v.live,fresh:(b==null?void 0:b.fresh)===!0,activity:(b==null?void 0:b.activity)??v.activity}});return gs(m,n,"all",Fi(s,a)).map(v=>f.get(v.key))})}function Oj({token:e,current:t,onPick:n,onClose:s}){const[o,a]=N.useState(Og),[u,h]=N.useState(!1),[f,m]=N.useState(!1),[v,b]=N.useState(""),[y,S]=N.useState(""),[w,x]=N.useState(""),k=N.useRef(null),P=N.useRef(null),E=N.useMemo(()=>Dj(o),[o]),F=N.useMemo(()=>Mj(o),[o]),{pins:M,orders:V,canMoveRoster:G,moveRoster:O,stepRoster:Z}=rf(),X=N.useMemo(()=>Ij(E,F,M,V),[E,F,M,V]),Q=N.useMemo(()=>u?X:X.filter(A=>A.selectable||A.degraded),[X,u]),z=N.useMemo(()=>E.find(A=>A.key===y&&A.selectable),[E,y]);N.useEffect(()=>{var U;const A=document.activeElement;(U=P.current)==null||U.focus();const $=R=>{R.key==="Escape"&&s()};return document.addEventListener("keydown",$),()=>{var R;document.removeEventListener("keydown",$),(R=A==null?void 0:A.focus)==null||R.call(A)}},[s]),N.useEffect(()=>{let A=!0,$=!1;const U=async()=>{if($)return;$=!0;const K=Og(),B=Array.isArray(K.nodeGroups)?K.nodeGroups:[],j=Fd(e),D=await Promise.all(B.map(async ye=>{const me=Array.isArray(ye.route)?ye.route:[];return me.length?{group:ye,result:await Fd(e,me)}:{group:ye,result:{fresh:!1,sessions:null,cells:null}}})),W=await j;if(!A)return;const ne=new Map(D.map(({group:ye,result:me})=>[JSON.stringify(ye.route||[]),me])),ce=B.map(ye=>{const me=ne.get(JSON.stringify(ye.route||[]));return me?{...ye,sessions:me.sessions||ye.sessions||[],cells:me.cells||ye.cells||[],switcherFresh:me.fresh}:{...ye,switcherFresh:!1}}),pe=yy({...K,sessions:W.sessions||K.sessions||[],cells:W.cells||K.cells||[],localFresh:W.fresh,nodeGroups:ce,refreshedAt:Date.now()});a(pe),m(!0),$=!1};U();const R=setInterval(U,Aj);return()=>{A=!1,clearInterval(R)}},[e]);const I=A=>A.degraded?p("cell-degraded"):A.verified?A.selectable?A.working?p("cell-working"):p("cell-idle"):p("cell-off"):p("cell-switcher-not-confirmed"),C=A=>{if(b(""),!A.selectable){b(p("cell-switcher-not-active"));return}S(A.key)},T=async()=>{const A=z;if(!A){b(p("cell-switcher-select"));return}b(""),x(A.key);try{const $=await Fd(e,A.route),U=($.cells||[]).find(R=>(R==null?void 0:R.cell)===A.cellName&&(R==null?void 0:R.tmuxSession)===A.session);if(!cb(U,$.sessions,$.fresh)){b(p("cell-switcher-not-active"));return}n({session:A.session,...A.node?{node:A.node}:{},cellName:A.cellName}),s()}catch{b(p("cell-switcher-not-active"))}finally{x("")}};return c.jsx("div",{className:"nc-cell-switcher-backdrop",onClick:s,children:c.jsxs("aside",{ref:k,className:"nc-cell-switcher",role:"dialog","aria-label":p("fleet-cells"),tabIndex:-1,onClick:A=>A.stopPropagation(),children:[c.jsxs("div",{className:"nc-cell-switcher-list",children:[!f&&c.jsx("div",{className:"nc-empty",role:"status",children:p("cell-switcher-refreshing")}),f&&Q.length===0&&c.jsx("div",{className:"nc-empty",role:"status",children:p("cell-switcher-empty-active")}),Q.map(A=>{const $=(t==null?void 0:t.session)===A.session&&((t==null?void 0:t.node)||"")===A.node,U=y===A.key,R=I(A),K=A.node||"local",B=F.get(K)||E.filter(j=>(j.node||"local")===K);return c.jsxs("div",{className:`nc-cell-switcher-row${$?" current":""}${U?" selected":""}${A.selectable?"":" off"}`,"data-roster-key":A.key,"data-position":K,children:[c.jsx(bi,{position:K,itemKey:A.key,label:A.cellName,canMove:G,onMove:(j,D)=>O(K,j,D,B),onStep:j=>Z(K,A.key,j,B)}),c.jsxs("button",{type:"button",className:"nc-cell-switcher-row-select","aria-current":$?"true":void 0,"aria-pressed":U,"aria-disabled":!A.selectable,disabled:w===A.key,onClick:()=>C(A),children:[c.jsx("span",{className:`nc-cell-switcher-dot${A.degraded?" warn":A.live?` on${A.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-cell-switcher-copy",children:[c.jsx("b",{children:A.cellName}),c.jsx("small",{className:"nc-cell-switcher-state",children:R}),c.jsx("small",{children:[A.nodeLabel,A.subtitle].filter(Boolean).join(" · ")})]})]})]},A.key)})]}),v&&c.jsx("div",{className:"nc-cell-switcher-notice",role:"status",children:v}),c.jsx("div",{className:"nc-cell-switcher-actions",children:c.jsx("button",{type:"button",className:"nc-cell-switcher-open",disabled:!z||!!w,onClick:T,children:z?`${p("cell-switcher-open")}: ${z.cellName}`:p("cell-switcher-select")})}),c.jsxs("div",{className:"nc-cell-switcher-controls",children:[c.jsx("b",{children:p("fleet-cells")}),c.jsx("button",{type:"button",className:"nc-cell-switcher-filter","aria-pressed":u,onClick:()=>{b(""),h(A=>!A)},children:p(u?"cell-switcher-show-active":"cell-switcher-show-all")}),c.jsx("button",{ref:P,type:"button",className:"nc-cell-switcher-close","aria-label":p("cell-switcher-close"),title:p("cell-switcher-close"),onClick:s,children:"×"})]})]})})}const Bj=2e3;function zj(e){if(e.kind==="gap")return`${p("vl-events-gap")} ${e.count||"?"}`;if(e.kind==="truncate")return p("vl-events-truncated");if(e.kind==="turn_end")return p("vl-events-turn-end");if(e.kind==="done")return p("vl-events-done");if(e.kind==="writer_epoch")return p("vl-events-writer-epoch");if(e.kind==="tool_start")return`${p("vl-events-tool")} ${e.name||""}`.trim();if(e.kind==="tool_end"){const t=e.isError?p("vl-events-tool-failed"):p("vl-events-tool-ok");return`${p("vl-events-tool")} ${e.name||""} — ${t}`.trim()}return e.kind==="usage"?e.text||p("vl-events-usage"):e.text||""}function Fj({token:e,nodeId:t,route:n=[]}){const[s,o]=N.useState([]),[a,u]=N.useState(!1),h=N.useRef(0);return N.useEffect(()=>{let f=!0;h.current=0,o([]);const m=async()=>{try{const y=await x0(e,t,h.current,n);if(!f)return;u(!1);const S=Array.isArray(y==null?void 0:y.events)?y.events:[];S.length&&(o(w=>w.concat(S).slice(-500)),h.current=S[S.length-1].seq),Number.isSafeInteger(y==null?void 0:y.cursor)&&y.cursor>h.current&&(h.current=y.cursor)}catch{f&&u(!0)}},v=()=>{m().catch(()=>{})};v();const b=setInterval(v,Bj);return()=>{f=!1,clearInterval(b)}},[e,t,JSON.stringify(n)]),c.jsxs("div",{className:"nc-vl-events",children:[a&&c.jsx("div",{className:"nc-set-hint nc-vl-events-stale",children:p("vl-events-stale")}),s.length===0&&!a&&c.jsx("small",{className:"nc-set-hint","data-testid":"vl-events-empty",children:p("vl-events-empty")}),s.length>0&&c.jsx("ol",{className:"nc-vl-events-list",children:s.map(f=>c.jsx("li",{"data-testid":`vl-ev-${f.seq}`,className:`nc-vl-ev nc-vl-ev-${f.kind}${f.isError?" error":""}${f.kind==="gap"?" gap":""}`,children:zj(f)},`${f.seq}-${f.kind}`))})]})}function B_({peer:e,token:t,onBack:n}){var s;return kn(),e?c.jsxs("section",{className:"nc-vl-session-view",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:n,title:p("back"),children:[c.jsx(Je,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:p("back")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:e.label,children:e.label}),((s=e.session)==null?void 0:s.profile)&&c.jsxs("small",{className:"nc-bar-sub",children:[e.session.profile," · ",p("vl-events-title")]})]}),c.jsx("span",{className:"nc-bar-right"})]}),c.jsx("div",{className:"nc-vl-session-body",children:c.jsx(Fj,{token:t,nodeId:e.nodeId,route:e.route||[]})})]}):null}const $d=e=>ki(Ys(e)).length===0,Hd=e=>Array.isArray(e)?e.join("/"):"";function $j(e){const t=new Set,n=[];for(const s of Array.isArray(e)?e:[])!s||!Hn.test(String(s.instanceId||""))||!Array.isArray(s.route)||!s.route.length||t.has(s.instanceId)||(t.add(s.instanceId),n.push({instanceId:s.instanceId,route:[...s.route],label:String(s.label||s.name||s.route.join(" › ")),status:s.status||"offline"}));return n.sort((s,o)=>s.label.localeCompare(o.label))}function zo(e){return{instanceId:e.ownerId,route:e.ownerRoute||[],label:e.ownerLabel,status:e.available===!1?"offline":"up"}}function Hs(e,t,n,s=!1,o=!0){const a=t.instanceId;return{...e,id:Lr(s?null:a,e.name),ownerId:a,ownerRoute:s?[]:[...t.route],ownerLabel:s?"Local":t.label,local:s,available:o,ownerTopology:Array.isArray(n)?n:[],layout:Ih(e.layout,a,n)}}function Hj(e,t,n,s,o=[]){const[a,u]=N.useState([]),[h,f]=N.useState(!1),[m,v]=N.useState("idle"),[b,y]=N.useState(""),[S,w]=N.useState(""),x=N.useRef([]),k=N.useRef([]),P=N.useRef(""),E=N.useRef(t),F=N.useRef(n),M=N.useRef(!1),V=N.useRef(!0),G=N.useRef(""),O=N.useMemo(()=>$j(o),[o]),Z=O.map(B=>`${B.instanceId}:${Hd(B.route)}:${B.status}:${B.label}`).join("|");k.current=O,F.current=n,E.current=t,x.current=a;const X=N.useCallback(B=>Oh(B.layout,P.current,k.current),[]),Q=N.useCallback((B,j=!0,D=E.current)=>{const W=Vv(B,xl()),ne=x.current.some(pe=>pe.id===D);x.current=W,u(W);const ce=W.find(pe=>pe.id===D);if(j&&ce){V.current=!0;const pe=X(ce);s(pe),ce.local&&dN(ce.name,pe)}else ne&&!ce&&(V.current=!0,s(Pr()),y("deck non più condiviso dal nodo owner"));aN(W.filter(pe=>pe.local).map(pe=>pe.name))},[s,X]),z=N.useCallback(async B=>{let j=await pl(e);const D=j.decks.find(W=>W.name==="main");if(j.decks.length===1&&D&&D.revision===0&&$d(D.layout)){const W=oN(),ne=Ys(Bh("main")||Pr());if(!$d(ne)){const ce=Ih(ne,B,[]);j.decks[0]=await ml(e,"main",ce,0,[])}for(const ce of W.filter(pe=>pe!=="main"))try{let pe=await kg(e,ce,[]);const ye=Ys(Bh(ce)||Pr());$d(ye)||(pe=await ml(e,ce,Ih(ye,B,[]),pe.revision,[]))}catch{}j=await pl(e)}return j},[e]),I=N.useCallback(async({migrate:B=!1}={})=>{const j=await Zh(e,[]),D=Hn.test(String(j.instanceId||""))?j.instanceId:"";if(!D)throw new Error("instanceId locale non disponibile");P.current=D,w(D);const[W,ne]=await Promise.all([B?z(D):pl(e),wg(e,[]).catch(()=>({nodes:[]}))]),ce={instanceId:D,route:[],label:"Local"},pe=W.decks.map(me=>Hs(me,ce,ne.nodes,!0,!0)),ye=x.current;return await Promise.all(k.current.map(async me=>{if(me.status!=="up"){pe.push(...ye.filter(ae=>!ae.local&&ae.ownerId===me.instanceId).map(ae=>({...ae,ownerRoute:[...me.route],ownerLabel:me.label,available:!1})));return}try{const[ae,Pe]=await Promise.all([pl(e,me.route),wg(e,me.route).catch(()=>({nodes:[]}))]);pe.push(...ae.decks.map(rt=>Hs(rt,me,Pe.nodes,!1,!0)))}catch{pe.push(...ye.filter(Pe=>!Pe.local&&Pe.ownerId===me.instanceId).map(Pe=>({...Pe,ownerRoute:[...me.route],ownerLabel:me.label,available:!1})))}})),pe.sort((me,ae)=>me.local===ae.local?me.ownerLabel.localeCompare(ae.ownerLabel)||(me.name==="main"?-1:ae.name==="main"?1:me.name.localeCompare(ae.name)):me.local?-1:1),pe},[e,z,Z]);N.useEffect(()=>{if(!e)return;let B=!1;const j=G.current!==e;return G.current=e,I({migrate:j}).then(D=>{if(B)return;const W=x.current.find(pe=>pe.id===E.current),ne=D.find(pe=>pe.id===E.current),ce=ne&&(!W||ne.revision>W.revision||W.available!==ne.available||Hd(W.ownerRoute)!==Hd(ne.ownerRoute));Q(D,j||!!ce&&!M.current),f(!0),ne&&y("")}).catch(D=>{B||(f(!0),y(String(D.message||D)))}),()=>{B=!0}},[Q,I,Z,e]);const C=N.useCallback(async(B=E.current)=>{if(!h||!M.current)return!0;const j=x.current.find(D=>D.id===B);if(!j)return y(`deck inesistente: ${B}`),!1;if(j.available===!1)return y(`nodo owner offline: ${j.ownerLabel}`),!1;v("saving");try{const D=Kv(Ys(F.current),j.ownerId,j.ownerTopology),W=await ml(e,j.name,D,j.revision,j.ownerRoute),ne=Hs(W,zo(j),j.ownerTopology,j.local,!0);return Q(x.current.map(ce=>ce.id===B?ne:ce),!1),M.current=!1,v("saved"),y(""),setTimeout(()=>v("idle"),1500),!0}catch(D){if(v("error"),y(String(D.message||D)),D.status===409&&D.data&&D.data.current){const W=x.current.find(ce=>ce.id===B),ne=Hs(D.data.current,zo(W),W.ownerTopology,W.local,!0);Q(x.current.map(ce=>ce.id===B?ne:ce),!1)}return!1}},[h,e,Q]);return N.useEffect(()=>{if(!h)return;if(V.current){V.current=!1;return}M.current=!0,v("saving");const B=setTimeout(C,650);return()=>clearTimeout(B)},[n,h,C]),N.useEffect(()=>{if(!h)return;const B=setInterval(async()=>{try{const j=await I(),D=x.current.find(ce=>ce.id===E.current),W=j.find(ce=>ce.id===E.current),ne=W&&(!D||W.revision>D.revision||D.available!==W.available);Q(j,ne&&!M.current)}catch{}},5e3);return()=>clearInterval(B)},[h,I,Q]),{decks:a,records:a,localNodeId:S,ready:h,saveState:m,error:b,setError:y,saveNow:C,select:async B=>{if(M.current&&!await C(E.current))throw new Error("salvataggio del deck corrente fallito: cambio annullato");const j=x.current.find(D=>D.id===B);if(!j)throw new Error(`deck inesistente: ${B}`);return M.current=!1,V.current=!0,X(j)},add:async(B,j=null)=>{const D=j===Si?x.current.find(ce=>ce.local):j?x.current.find(ce=>ce.ownerId===j):null;if(!D||D.available===!1)throw new Error("nodo owner non disponibile");const W=await kg(e,B,D.ownerRoute),ne=Hs(W,zo(D),D.ownerTopology,D.local,!0);return Q([...x.current,ne],!1),ne},rename:async(B,j)=>{const D=x.current.find(ye=>ye.id===B);if(!D)throw new Error("deck inesistente");if(B===E.current&&M.current&&!await C(B))throw new Error(`salvataggio di "${D.name}" fallito: rinomina annullata`);const W=x.current.find(ye=>ye.id===B);if(!W)throw new Error("deck inesistente");const ne=await Y0(e,W.name,j,W.revision,W.ownerRoute),ce=Hs(ne,zo(W),W.ownerTopology,W.local,!0),pe=W.local?Si:W.ownerId;return pd(cN(xl(),pe,B,ce.id)),Q(x.current.map(ye=>ye.id===B?ce:ye),!1),ce},remove:async B=>{const j=x.current.find(W=>W.id===B);if(!j)throw new Error("deck inesistente");B===E.current&&(M.current=!1),await G0(e,j.name,j.revision,j.ownerRoute);const D=j.local?Si:j.ownerId;pd(uN(xl(),D,B)),Q(x.current.filter(W=>W.id!==B),!1)},reorder:(B,j)=>{const D=x.current.find(me=>me.id===B),W=x.current.find(me=>me.id===j);if(!D||!W)return!1;const ne=D.local?Si:D.ownerId,ce=W.local?Si:W.ownerId;if(ne!==ce)return!1;const pe=x.current.filter(me=>(me.local?Si:me.ownerId)===ne).map(me=>me.id),ye=pd(lN(xl(),ne,B,j,pe));return Q(Vv(x.current,ye),!1),!0},addTileTo:async(B,j)=>{const D=x.current.find(me=>me.id===B);if(!D)throw new Error("deck inesistente");if(D.available===!1)throw new Error(`nodo owner offline: ${D.ownerLabel}`);const W=jw(j,P.current,k.current);if(!W)throw new Error("riferimento sessione non valido");const ne=X(D),ce=Kv(gy(ne,W),D.ownerId,D.ownerTopology),pe=await ml(e,D.name,ce,D.revision,D.ownerRoute),ye=Hs(pe,zo(D),D.ownerTopology,D.local,!0);return Q(x.current.map(me=>me.id===B?ye:me),!1),ye},localMainId:Lr(null,"main"),parseDeckId:sc}}const Uj="/sw.js",Hh="nc-sw-update";let Uh=null,Wh=!1,Kh=null,ub=Object.freeze({needed:!1,kind:null,version:""}),db=!1;function hb(){typeof window<"u"&&window.dispatchEvent(new Event(Hh))}function fb(){const e=Kh||(Wh?{kind:"reload",version:""}:null);ub=Object.freeze({needed:!!e,kind:(e==null?void 0:e.kind)||null,version:(e==null?void 0:e.version)||""})}function z_(){return ub}function Wj(e){return typeof window>"u"?()=>{}:(window.addEventListener(Hh,e),()=>window.removeEventListener(Hh,e))}function Ff(e){Wh!==e&&(Wh=e,fb(),hb())}function Kj(e,t,n){let s=null;e&&t&&e!==t?s={kind:"install",version:e}:t&&n&&t!==n&&(s={kind:"reload",version:t});const o=JSON.stringify(s)===JSON.stringify(Kh);Kh=s,fb(),o||hb()}function qj(e){e.addEventListener("statechange",()=>{e.state==="installed"&&navigator.serviceWorker.controller&&Ff(!0)})}function Vj(){typeof navigator>"u"||!("serviceWorker"in navigator)||(navigator.serviceWorker.addEventListener("controllerchange",()=>{db&&location.reload()}),navigator.serviceWorker.register(Uj).then(e=>{Uh=e,e.waiting&&Ff(!0),e.addEventListener("updatefound",()=>{const t=e.installing;t&&qj(t)}),setInterval(()=>{e.update().catch(()=>{})},3600*1e3)}).catch(()=>{}))}function Yj(){db=!0,Ff(!1);const e=Uh&&Uh.waiting;e?(e.postMessage({type:"SKIP_WAITING"}),setTimeout(()=>location.reload(),4e3)):location.reload()}function Gj({hash:e="",origin:t="",pathname:n="",search:s=""}={}){const o=String(e||"").replace(/^#/,""),a=`${n||""}${s||""}`;if(!o)return{token:"",pair:"",nextUrl:a};const u=new URLSearchParams(o),h=u.get("token")||"",f=u.get("pair")||"",m=f?`${t||""}${n||""}#pair=${f}`:"";return{token:h,pair:m,nextUrl:a}}const pb=9,mb=24,gb="nc_side_w",F_="nc_side_min",Xj=240,$_="(min-width:1024px) and (pointer:fine)";function Qj(){const e=Number(localStorage.getItem(gb));return e>=180&&e<=480?e:Xj}function Jj(){const e=Number(localStorage.getItem("nc_fontsize"));return e>=pb&&e<=mb?e:13}function Zj(){const e={token:"",pair:""};try{const{token:t,pair:n,nextUrl:s}=Gj({hash:location.hash,origin:location.origin,pathname:location.pathname,search:location.search});if(t){e.token=t;try{localStorage.setItem("nc_token",t)}catch{}}if(n){e.pair=n;try{sessionStorage.setItem("nc_pair",n)}catch{}}if(location.hash)try{history.replaceState(null,"",s)}catch{}}catch{}if(e.token||(e.token=sessionStorage.getItem("nc_token")||localStorage.getItem("nc_token")||""),!e.pair){const t=sessionStorage.getItem("nc_pair");t&&(e.pair=t)}return e}function eR(e){try{return Ys(Bh(e))}catch{return Pr()}}function H_(e){if(!e)return"";const t=Math.floor(Date.now()/1e3)-e;return t<0||t<60?"ora":t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}g`}function tR(){const[e,t]=N.useState(()=>window.matchMedia($_).matches);return N.useEffect(()=>{const n=window.matchMedia($_),s=o=>t(o.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[]),e}function U_({session:e,node:t,ownerId:n,cellName:s,token:o,readonly:a=!1,onBack:u,onCellSwitcher:h,cellSwitcherOpen:f=!1}){kn();const[m]=kf(),[v,b]=N.useState(!1),[y,S]=N.useState(()=>window.matchMedia("(pointer: coarse)").matches),[w,x]=N.useState(null),[k,P]=N.useState(Jj),[E,F]=N.useState(s||e),[M,V]=N.useState(""),G=$=>P(U=>{const R=Math.max(pb,Math.min(mb,U+$));return localStorage.setItem("nc_fontsize",String(R)),R}),O=N.useRef(()=>{}),Z=N.useRef(()=>!1),X=N.useRef(()=>{}),Q=N.useRef(!1),[z,I]=N.useState(!1),[C,T]=N.useState(!1),A=()=>{Q.current=!Q.current,I(Q.current)};return N.useEffect(()=>{F(s||e)},[s,e]),N.useEffect(()=>{let $=!0;const U=t?t.split("/"):[],R=t?`/api/route/${t.split("/").map(encodeURIComponent).join("/")}/_`:"/api";async function K(){let j=null,D=null;try{const ce=await(await Ft(`${R}/sessions`,o)).json();Array.isArray(ce.sessions)&&(j=ce.sessions.find(pe=>pe.name===e))}catch{}try{const ne=await ws(o,U);ne.available&&Array.isArray(ne.cells)&&(D=ne.cells.find(ce=>ce.tmuxSession===e))}catch{}if(!$)return;F(Cf({session:e,cell:D||(s?{cell:s}:null)}));let W="";D?W=`${D.engine}${D.key?`·${D.key}`:""}`:j&&(W=j.attached?`attached · ${H_(j.activity)}`:j.activity?H_(j.activity):""),V(W)}K();const B=setInterval(K,4e3);return()=>{$=!1,clearInterval(B)}},[e,t,o]),c.jsxs("div",{className:"nc-app",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:u,title:p("sessions"),children:[c.jsx(Je,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:p("sessions")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:t?`${E} · ${t}`:E,children:E}),M&&c.jsx("small",{className:"nc-bar-sub",children:M})]}),c.jsxs("span",{className:"nc-bar-right",children:[c.jsx("button",{onClick:()=>G(-1),title:p("zoom-out"),children:c.jsx(Je,{name:"zoomOut",size:18})}),c.jsx("button",{onClick:()=>G(1),title:p("zoom-in"),children:c.jsx(Je,{name:"zoomIn",size:18})}),c.jsx("button",{onClick:()=>S($=>!$),title:p("composer"),children:c.jsx(Je,{name:"keyboard",size:20})}),c.jsx("button",{onClick:()=>b($=>!$),title:p("files"),children:c.jsx(Je,{name:"folder",size:20})})]})]}),c.jsx("div",{className:"nc-termwrap",children:c.jsx(fw,{session:e,node:t,token:o,readonly:a,takeSize:!0,sendRef:O,composerRef:Z,actionRef:X,ctrlRef:Q,setCtrlArmed:I,onFiles:x,fontSize:k,selectionMode:C,onSelectionModeChange:T,keyboardGesture:m.terminalKeyboardGesture})}),c.jsx(PE,{onKeyboard:()=>S($=>!$),onCellSwitcher:h,cellSwitcherOpen:f,send:$=>O.current($),action:$=>X.current($),ctrlArmed:z,onCtrl:A,selectionMode:C,onSelectionMode:T,keepKeyboardClosed:m.keybarKeepsKeyboardClosed,showEnter:m.showKeybarEnter,keybarLayout:m.keybarLayout}),y&&c.jsx(xw,{submitText:$=>Z.current($),token:o,session:e,node:t,ownerId:n,keepKeyboardClosedOnVoice:m.voiceKeepsKeyboardClosed}),v&&c.jsx(pw,{session:e,node:t,token:o,filesEvent:w,onClose:()=>b(!1)})]})}function nR(){kn();const[e]=N.useState(Zj),[t,n]=N.useState(e.token),[s,o]=N.useState(e.pair||""),a=N.useCallback(()=>{o("");try{sessionStorage.removeItem("nc_pair")}catch{}},[]),[u,h]=N.useState(!1),f=tR(),[m]=N.useState(()=>rN(typeof location<"u"?location.pathname:"/")),[v,b]=N.useState(m.id),y=v===Lr(null,Un),[S,w]=N.useState(null),x=de=>{const Ne=ys(de);w(Ne?{...Ne,...typeof(de==null?void 0:de.cellName)=="string"&&de.cellName?{cellName:de.cellName}:{}}:null)},[k,P]=N.useState([]),[E,F]=N.useState([]),[M,V]=N.useState([]),[G,O]=N.useState(()=>m.ownerId?Pr():eR(m.name)),[Z,X]=N.useState(null),[Q,z]=N.useState(null),I=de=>z(ys(de)),[C,T]=N.useState(null),A=nf(t,f),$=N.useMemo(()=>(A||[]).filter(de=>de.instanceId).map(de=>({instanceId:de.instanceId,route:de.route,label:de.label,status:de.status})),[A]),U=Hj(t,v,G,O,$),R=U.decks;N.useEffect(()=>{const de=new Map;for(const Ne of A||[]){const Ke=(Ne.route||[Ne.name]).join("/"),ht=new Set((Ne.sessions||[]).map(gt=>gt.name));for(const gt of Ne.cells||[])!gt.cell||!gt.tmuxSession||gt.cell===gt.tmuxSession||ht.has(gt.cell)||de.set(`${Ke}:${gt.cell}`,`${Ke}:${gt.tmuxSession}`)}O(Ne=>kx(Ne,de))},[A]),N.useEffect(()=>{U.localNodeId&&O(de=>{const Ne=Oh(de,U.localNodeId,$);return JSON.stringify(Ne)===JSON.stringify(de)?de:Ne})},[$,U.localNodeId]);const[K,B]=N.useState(null),[j,D]=N.useState(null),W=N.useRef(0),[ne,ce]=N.useState(!1),[pe,ye]=N.useState(Qj),[me,ae]=N.useState(!y),[Pe,rt]=N.useState(()=>y?localStorage.getItem(F_)==="1":!0),[Xe,Me]=N.useState(!1),[qt,wn]=N.useState("nodes"),[Be,$t]=N.useState(!1),[Nt,At]=N.useState(""),[mt,dt]=N.useState(!1),ut=(de="nodes",Ne=!1,Ke="")=>{wn(de),$t(Ne),At(Ke),Me(!0)},[re,xe]=N.useState(!1),[Ie,Fe]=N.useState({deviceDefault:"",localNodeId:"",localNameDefault:""}),[he,ze]=N.useState(!1);N.useEffect(()=>{try{localStorage.setItem(gb,String(pe))}catch{}},[pe]),N.useEffect(()=>{try{localStorage.setItem(F_,Pe?"1":"")}catch{}},[Pe]),N.useEffect(()=>{if(!t)return;let de=!1;return Promise.all([J_(t),Ft("/api/config",t).then(Ne=>Ne.json())]).then(([Ne,Ke])=>{de||(Fe({deviceDefault:Ne.deviceName||"",localNodeId:Ne.nodeId||"",localNameDefault:Ne.localName||""}),ze(!!Ke.readonlyDefault),(Ne.firstRun===!0&&!Ke.readonlyDefault||s)&&xe(!0))}).catch(()=>{}),()=>{de=!0}},[t,s]);const q=N.useCallback(async()=>{try{const Ne=await(await Ft("/api/sessions",t)).json();Ne.error||P(Ne.sessions||[])}catch{}try{const de=await ws(t);F(de.available?de.cells||[]:[]),V(de.available?de.capabilities||[]:[])}catch{F([]),V([])}},[t]);N.useEffect(()=>{if(!f)return;q();const de=setInterval(q,4e3);return()=>clearInterval(de)},[f,q]),N.useEffect(()=>{let de=!1;return Ft("/api/config",t).then(Ne=>Ne.json()).then(Ne=>{de||Kj(Ne.version,Ne.uiVersion,"0.8.52-rc.5")}).catch(()=>{}),()=>{de=!0}},[t]);const te=new Set([...k.map(de=>de.name),...A.flatMap(de=>de.sessions.map(Ne=>Ne.key))]),H=ki(G),le=de=>O(Ne=>{const Ke=jw(de,U.localNodeId,$)||de,ht=gy(Ne,Ke);return ht===Ne&&ki(Ne).length>=9&&U.setError(p("grid-full")),ht}),ue=async(de,Ne=[])=>{try{await Xh(t,de,Ne)}catch{return}const Ke=Ne.length?`${Ne.join("/")}:${de}`:de;O(ht=>Hl(ht,Ke)),q()},ge=async(de,Ne,Ke=[])=>{try{await Q_(t,de,Ne,Ke)}catch{return}q()},Le=async(de,Ne,Ke=[])=>{await Y_(t,{cell:de,enabled:!!Ne},Ke),q()},_e=async de=>{if(!K)return;const{cell:Ne}=K,Ke=Array.isArray(K.route)?K.route:[];if(de.action==="up"){const gt=await Yh(t,{cell:Ne,boot:!!de.boot,...de.engine?{engine:de.engine}:{},...de.model!==void 0?{model:de.model}:{},...de.permissionPolicy?{permissionPolicy:de.permissionPolicy}:{}},Ke),bs=uf(gt);bs&&U.setError(bs.text)}else await Il(t,{cell:Ne,boot:!!de.boot},Ke);const ht=de.action==="up"?!!de.boot:de.boot?!1:!!K.boot;D({id:++W.current,cell:Ne,route:Ke,enabled:ht}),q()},Ce=N.useCallback(de=>{D(Ne=>(Ne==null?void 0:Ne.id)===de?null:Ne)},[]),tt=async de=>{if(!(!(de!=null&&de.direct)||ne)){ce(!0);try{await ef(t,de.name,de.tunnelStatus==="up"?"down":"up")}finally{ce(!1)}}},ot=async(de,Ne)=>{const Ke=String(Ne||"").trim();return!(de!=null&&de.direct)||!Mr(Ke)?!1:(await ty(t,de.name,Ke),!0)},Qe=de=>{const Ne=R.find(Ke=>Ke.id===de);if(!Ne)return!1;try{const Ke=window.open(fd(Ne,t),"_blank");return Ke&&(Ke.opener=null),!!Ke}catch{return!1}},Tt=async de=>{if(!de||de===v)return;const Ne=await U.select(de),Ke=U.records.find(ht=>ht.id===de);b(de),O(Ne),X(null),z(null);try{history.replaceState(null,"",fd(Ke||de,null))}catch{}},lt=async(de,Ne)=>{const Ke=await U.add(de,Ne);await Tt(Ke.id)},Ze=async(de,Ne)=>{const Ke=await U.rename(de,Ne);if(de===v){b(Ke.id),O(Oh(Ke.layout,U.localNodeId,$)),X(null),z(null);try{history.replaceState(null,"",fd(Ke,null))}catch{}}},Jt=async de=>{await U.remove(de),de===v&&await Tt(U.localMainId)},ni=async(de,Ne)=>{!Ne||Ne===v||(await U.addTileTo(Ne,de),O(Ke=>Hl(Ke,de)))};if(!t)return c.jsxs("div",{className:"nc-auth",children:[c.jsx("p",{children:p("auth-prompt")}),c.jsx("input",{onChange:de=>n(de.target.value.trim()),placeholder:"token"}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",checked:u,onChange:de=>h(de.target.checked)})," ",p("remember-device")]}),c.jsx("button",{onClick:()=>{(u?localStorage:sessionStorage).setItem("nc_token",t)},children:"ok"})]});const Wn=c.jsxs(c.Fragment,{children:[Xe&&c.jsx(kj,{token:t,initialTab:qt,initialLocation:Nt,startNewCell:Be,onClose:()=>{Me(!1),$t(!1),At("")}}),re&&c.jsx(Cj,{token:t,initialPair:s,...Ie,onPairDone:a,onDone:()=>xe(!1)}),c.jsx(Lj,{token:t})]});if(!f)return C?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-single-overlay",children:c.jsx(B_,{peer:C,token:t,onBack:()=>T(null)})}),Wn]}):S?c.jsxs(c.Fragment,{children:[c.jsx(U_,{session:S.session,node:S.node,ownerId:S.ownerId,cellName:S.cellName,token:t,readonly:he,onBack:()=>w(null),onCellSwitcher:()=>dt(!0),cellSwitcherOpen:mt}),mt&&c.jsx(Oj,{token:t,current:S,onPick:de=>{x(de),dt(!1)},onClose:()=>dt(!1)}),Wn]}):c.jsxs(c.Fragment,{children:[c.jsx($x,{onPick:x,token:t,onSettings:ut,onOpenVlSession:T}),Wn]});const ui=y||!me;return c.jsxs("div",{className:"nc-workspace",children:[ui&&c.jsx(VE,{sessions:k,cells:E,activeSessions:H,nodeGroups:A,fleetCapabilities:M,bootSettlement:j,onBootSettlementApplied:Ce,localNodeId:U.localNodeId,onPick:I,onAddTile:le,onPower:B,onBoot:Le,onBootError:de=>U.setError(String((de==null?void 0:de.message)||de)),onNodePower:tt,onNodeRename:ot,onKill:ue,onVisibility:ge,onNew:()=>ut("fleet",!0),onSettings:ut,onOpenVlSession:T,width:pe,collapsed:Pe,onResize:ye,onToggleCollapse:()=>rt(de=>!de)}),c.jsxs("div",{className:"nc-workspace-main",children:[c.jsx(jN,{decks:R,currentDeck:v,onCreate:lt,onRename:Ze,onDelete:Jt,onReorder:U.reorder,onOpenWindow:Qe,onNavigate:Tt,saveState:U.saveState,error:U.error,sidebarVisible:ui,onToggleSidebar:y?null:()=>ae(de=>!de)}),c.jsx(eN,{layout:G,onLayoutChange:O,token:t,readonly:he,sessionsAlive:te,focusSession:Z,onFocus:X,onOpenSingle:I,decks:R,currentDeck:v,onSendToDeck:ni,cells:E,nodeGroups:A})]}),C&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx(B_,{peer:C,token:t,onBack:()=>T(null)})}),Q&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx(U_,{session:Q.session,node:Q.node,ownerId:Q.ownerId,cellName:Cf({session:Q.session,node:Q.node,ownerId:Q.ownerId,cells:E,nodeGroups:A}),token:t,readonly:he,onBack:()=>z(null)})}),K&&c.jsx(Bl,{cell:K,token:t,route:Array.isArray(K.route)?K.route:[],onConfirm:_e,onClose:()=>B(null)}),Wn]})}function iR(){kn();const e=N.useSyncExternalStore(Wj,z_,z_);if(!e.needed)return null;const t=e.kind==="install"?p("install-version-mismatch").replace("{v}",e.version):p("update-available").replace("{v}",e.version).replace(" "," ").trim();return c.jsxs("div",{className:"nc-update",role:"status","aria-live":"polite",children:[c.jsx("span",{className:"nc-update-msg",children:t}),e.kind==="reload"&&c.jsx("button",{className:"nc-update-btn",onClick:Yj,children:p("reload")})]})}Vj();u0.createRoot(document.getElementById("root")).render(c.jsxs(i0.StrictMode,{children:[c.jsx(nR,{}),c.jsx(iR,{})]}));
93
+ `],{type:"application/json"}),$=URL.createObjectURL(A),U=document.createElement("a");U.href=$,U.download="nexuscrew-diagnostics.json",U.click(),URL.revokeObjectURL($)}catch{y(p("diagnostics-export-failed"))}};return c.jsxs("div",{className:"nc-set-tab nc-diagnostics",children:[c.jsxs("label",{className:"nc-field",children:[p("diagnostics-target"),c.jsx("select",{value:u.key,onChange:A=>a(A.target.value),children:s.map(A=>c.jsxs("option",{value:A.key,children:[A.label,A.status!=="up"?` · ${A.status}`:""]},A.key))})]}),c.jsxs("div",{className:"nc-set-form nc-diag-controls",children:[c.jsx("div",{className:"nc-sheet-label",children:p("diagnostics-verbose")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("select",{"aria-label":p("diagnostics-duration"),value:P,onChange:A=>E(Number(A.target.value)),disabled:n,children:[300,900,1800,3600].map(A=>c.jsxs("option",{value:A,children:[A/60," min"]},A))}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||(h==null?void 0:h.verbose)===!0,onClick:()=>I(()=>xg(e,!0,P,u.route)),children:p("enable")}),c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||(h==null?void 0:h.verbose)!==!0,onClick:()=>I(()=>xg(e,!1,P,u.route)),children:p("stop")})]}),c.jsx("small",{className:"nc-set-hint",children:h!=null&&h.verbose?p("diagnostics-expires").replace("{time}",new Date(h.expiresAt).toLocaleTimeString()):p("diagnostics-off")})]}),c.jsxs("div",{className:"nc-diag-filters",children:[c.jsxs("select",{"aria-label":p("diagnostics-level"),value:F,onChange:A=>M(A.target.value),children:[c.jsx("option",{value:"all",children:p("diagnostics-all-levels")}),["debug","info","warn","error"].map(A=>c.jsx("option",{value:A,children:A},A))]}),c.jsx("input",{"aria-label":p("diagnostics-component"),placeholder:p("diagnostics-component"),value:V,onChange:A=>G(A.target.value)})]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:S,onChange:A=>w(A.target.checked)})," ",p("diagnostics-pause")]}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:x,onChange:A=>k(A.target.checked)})," ",p("diagnostics-autoscroll")]})]}),c.jsx("pre",{ref:Z,className:"nc-diag-log","aria-label":p("diagnostics-log"),children:z||p("diagnostics-empty")}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:C,children:p("copy")}),c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:T,children:p("diagnostics-export")}),c.jsx("button",{type:"button",className:"nc-btn danger",disabled:n,onClick:()=>{window.confirm(p("diagnostics-clear-confirm"))&&I(async()=>{const A=await W0(e,u.route);return O.current=0,v([]),A})},children:p("diagnostics-clear")})]}),b&&c.jsx("div",{className:"nc-err",children:b})]})}function xj({token:e,settings:t,readonly:n,refresh:s,roster:o,section:a,setSection:u}){const[h,f]=N.useState(null),[m,v]=N.useState(null),[b,y]=N.useState(!1),[S,w]=N.useState(!1),[x,k]=N.useState(null),[P,E]=N.useState(!0),[F,M]=N.useState(!1);N.useEffect(()=>{k(t&&t.update||null),E(!t||t.autoUpdate!==!1),M(!!(t&&t.alternateScreen))},[t]);const V=async()=>{f(null),v(null),w(!0);try{const C=await k0(e);v(C.note||"ok"),y(!1)}catch(C){f(String(C.message||C))}w(!1)},G=async()=>{f(null),v(null),w(!0);try{const C=await z0(e);v(`${C.note||"ok"}${C.target?` (${C.target})`:""}`)}catch(C){f(String(C.message||C))}w(!1)},O=async C=>{f(null),v(null),w(!0);try{await Ud(e,{autoUpdate:C}),E(C),s&&await s()}catch(T){f(String(T.message||T))}w(!1)},Z=async C=>{f(null),v(null),w(!0);try{await Ud(e,{alternateScreen:C}),M(C),s&&await s()}catch(T){f(String(T.message||T))}w(!1)},X=async()=>{f(null),v(null),w(!0);try{k(await F0(e))}catch(C){f(String(C.message||C))}w(!1)},Q=async()=>{f(null),v(null),w(!0);try{const C=await $0(e);k(C),v(p("npm-update-restarting"))}catch(C){f(String(C.message||C))}w(!1)},z=()=>{window.confirm(p("composer-clear-confirm"))&&(f(null),$E()?(window.dispatchEvent(new Event(Dh)),v(p("composer-clear-done"))):f(p("composer-clear-failed")))},I=t&&t.service;return c.jsxs("div",{className:"nc-set-tab",children:[c.jsx("div",{className:"nc-system-tabs",role:"tablist","aria-label":p("tab-system"),children:["general","diagnostics"].map(C=>c.jsx("button",{type:"button",role:"tab","aria-selected":a===C,className:`nc-set-tabbtn${a===C?" on":""}`,onClick:()=>u(C),children:p(`system-${C}`)},C))}),a==="general"&&c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-this-node")}),t&&c.jsxs("div",{className:"nc-set-info",children:["v",t.version," · ",t.platform," · :",t.port,c.jsx("br",{}),I&&I.installed?p("service-installed"):p("service-missing"),I&&I.installed?` · ${I.active?p("service-active"):p("service-inactive")}`:"",I?` · boot ${I.boot?"on":"off"}`:""]}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S,title:n?p("settings-readonly"):"",onClick:G,children:p("service-regenerate")})}),c.jsx(_j,{token:e,readonly:n}),c.jsx(yj,{})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-updates")}),c.jsxs("div",{className:"nc-set-form nc-update-settings",children:[c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox",checked:P,disabled:n||S||x&&!x.supported,onChange:C=>O(C.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("npm-auto-update")}),c.jsx("small",{children:p("npm-auto-update-help")})]})]}),x&&c.jsxs("div",{className:"nc-set-info",children:[p("npm-update-current")," v",x.current,x.latest?` · ${p("npm-update-latest")} v${x.latest}`:""," · ",p(`npm-update-${x.supported?x.phase:"unsupported"}`)]}),c.jsxs("div",{className:"nc-set-row",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S||!x||!x.supported,onClick:X,children:p("npm-update-check")}),x&&x.available&&c.jsx("button",{type:"button",className:"nc-btn primary",disabled:n||S||x.phase==="installing",onClick:Q,children:p("npm-update-install")})]}),x&&x.lastError&&c.jsx("div",{className:"nc-err",children:x.lastError})]})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-security")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:n||S,title:n?p("settings-readonly"):"",onClick:()=>{f(null),v(null),y(!0)},children:p("token-rotate")})})]}),c.jsxs("section",{className:"nc-system-group",children:[c.jsx("h3",{children:p("system-local-data")}),c.jsxs("div",{className:"nc-set-form",children:[c.jsx("div",{className:"nc-sheet-label",children:p("composer-clear-data")}),c.jsx("small",{className:"nc-set-hint",children:p("composer-clear-data-help")}),c.jsx("div",{className:"nc-set-row",children:c.jsx("button",{type:"button",className:"nc-btn ghost",onClick:z,children:p("composer-clear-data")})})]})]})]}),a==="diagnostics"&&c.jsxs("section",{className:"nc-system-group nc-system-diagnostics",children:[c.jsx("h3",{children:p("system-diagnostics")}),c.jsxs("div",{className:"nc-set-form nc-alternate-screen-settings",children:[c.jsx("div",{className:"nc-sheet-label",children:p("system-terminal")}),c.jsxs("label",{className:"nc-check",children:[c.jsx("input",{type:"checkbox","aria-label":p("alternate-screen"),checked:F,disabled:n||S,onChange:C=>Z(C.target.checked)}),c.jsxs("span",{children:[c.jsx("b",{children:p("alternate-screen")}),c.jsx("small",{children:p("alternate-screen-help")})]})]})]}),c.jsx(Sj,{token:e,roster:o,readonly:n})]}),b&&c.jsxs("div",{className:"nc-set-confirm",children:[c.jsx("div",{children:p("token-rotate-explain")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:S,onClick:()=>y(!1),children:p("cancel")}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:S,onClick:V,children:p("confirm")})]})]}),m&&c.jsx("div",{className:"nc-set-note",children:m}),h&&c.jsx("div",{className:"nc-err",children:h})]})}function kj({token:e,onClose:t,initialTab:n="nodes",initialLocation:s="",startNewCell:o=!1}){kn();const a=n==="diagnostics"?"diagnostics":"general",[u,h]=N.useState(n==="diagnostics"?"system":n),f=N.useRef(null),m=N.useRef(null),[v,b]=N.useState({start:!1,end:!1}),[y,S]=N.useState(a),[w,x]=N.useState(null),[k,P]=N.useState([]),[E,F]=N.useState([]),[M,V]=N.useState(!1),[G,O]=N.useState(null),[Z,X]=N.useState(0),Q=nf(e,!0,Z),z=N.useCallback(()=>{const C=f.current;if(!C)return;const T=C.scrollWidth>C.clientWidth+1,A={start:T&&C.scrollLeft>1,end:T&&C.scrollLeft+C.clientWidth<C.scrollWidth-1};b($=>$.start===A.start&&$.end===A.end?$:A)},[]);N.useEffect(()=>{const C=f.current;if(!C)return;const T=typeof ResizeObserver=="function"?new ResizeObserver(z):null;return T==null||T.observe(C),window.addEventListener("resize",z),z(),()=>{T==null||T.disconnect(),window.removeEventListener("resize",z)}},[z]),N.useEffect(()=>{var T,A;(A=(T=m.current)==null?void 0:T.scrollIntoView)==null||A.call(T,{behavior:"smooth",block:"nearest",inline:"nearest"});const C=window.requestAnimationFrame?window.requestAnimationFrame(z):setTimeout(z,0);return()=>{window.cancelAnimationFrame?window.cancelAnimationFrame(C):clearTimeout(C)}},[u,z]);const I=N.useCallback(async()=>{var C;try{const T=await J_(e);x(T),O(null)}catch(T){O(String(T.message||T))}try{const A=(await b0(e)).peers||[];let $=[],U=[];try{const[R,K]=await Promise.all([Ft("/api/config",e).then(W=>W.json()).catch(()=>null),ey(e).catch(()=>null)]),B=R&&typeof R.instanceId=="string"?R.instanceId:"",j=[{instanceId:B||null,route:[],label:null},...cy(K,B)],D=await Promise.all(j.map(async W=>{try{return{ok:!0,peers:((await Z_(e,W.route)).nodes||[]).map(pe=>ly(pe,W)).filter(Boolean)}}catch(ne){return{ok:!1,owner:W,error:ne}}}));for(const W of D){if(W.ok){$.push(...W.peers);continue}W.owner.route.length!==0&&U.push({instanceId:W.owner.instanceId,label:W.owner.label,route:W.owner.route,failure:/timeout/i.test(String(((C=W.error)==null?void 0:C.message)||W.error))?"timeout":"unreachable"})}}catch{}F(U),P([...A,...$])}catch(T){O(String(T.message||T))}},[e]);return N.useEffect(()=>{I();const C=setInterval(I,5e3);return()=>clearInterval(C)},[I]),N.useEffect(()=>{let C=!1;return Ft("/api/config",e).then(T=>T.json()).then(T=>{C||V(!!T.readonlyDefault)}).catch(()=>{}),()=>{C=!0}},[e]),c.jsx("div",{className:"nc-set-overlay",onClick:t,children:c.jsxs("div",{className:"nc-set-panel",onClick:C=>C.stopPropagation(),children:[c.jsxs("div",{className:"nc-set-head",children:[c.jsx(Je,{name:"gear",size:18}),c.jsx("b",{children:p("settings")}),c.jsx("button",{type:"button",className:"nc-set-close",onClick:t,title:p("close"),children:c.jsx(Je,{name:"x",size:18})})]}),M&&c.jsx("div",{className:"nc-set-readonly",children:p("settings-readonly")}),G&&c.jsx("div",{className:"nc-err",children:G}),c.jsx("div",{className:`nc-set-tabs-wrap${v.start?" has-start-overflow":""}${v.end?" has-end-overflow":""}`,children:c.jsx("div",{className:"nc-set-tabs",ref:f,onScroll:z,children:["nodes","fleet","audio","input","system"].map(C=>c.jsx("button",{ref:u===C?m:null,type:"button",className:`nc-set-tabbtn${u===C?" on":""}`,onClick:()=>h(C),children:p(`tab-${C}`)},C))})}),c.jsxs("div",{className:"nc-set-body",children:[u==="nodes"&&c.jsx(vj,{token:e,nodes:k,roster:Q,settings:w,readonly:M,vlUnavailable:E,refresh:I,refreshAliases:()=>X(C=>C+1)}),u==="fleet"&&c.jsx(J2,{token:e,readonly:M,startNewCell:o,initialLocation:s,targets:Q.map(C=>({route:C.route,label:C.label||C.name,status:C.status}))}),u==="audio"&&c.jsx(wj,{token:e,readonly:M,nodes:k,settings:w}),u==="input"&&c.jsx(bj,{}),u==="system"&&c.jsx(xj,{token:e,settings:w,readonly:M,refresh:I,roster:Q,section:y,setSection:S})]})]})})}function Cj({token:e,initialPair:t,deviceDefault:n="",localNodeId:s="",localNameDefault:o="",onPairDone:a,onDone:u}){kn();const[h,f]=N.useState(t?"pair":"welcome"),[m,v]=N.useState(!1),[b,y]=N.useState(null),S=async()=>{v(!0),y(null);try{await Ud(e,{wizardDone:!0}),a&&a(),u()}catch(w){y(String(w.message||w)),v(!1)}};return c.jsx("div",{className:"nc-wiz-overlay",children:c.jsxs("div",{className:"nc-wiz",children:[c.jsxs("div",{className:"nc-wiz-head",children:[c.jsx("b",{children:p("wizard-title")}),c.jsx("small",{children:p("hydra-simple")})]}),h==="welcome"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:p("local-ready")}),c.jsxs("div",{className:"nc-sheet-actions",children:[c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:S,children:p("local-only")}),c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:()=>f("pair"),children:p("add-node")})]})]}),h==="pair"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx(qw,{token:e,initial:t||"",autoStart:!!t,deviceDefault:n,localNodeId:s,localNameDefault:o,onBusyChange:v,onSuccess:async()=>{a&&a(),f("done")}}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn ghost",disabled:m,onClick:()=>{a&&a(),f("welcome")},children:p("back")})})]}),h==="done"&&c.jsxs("div",{className:"nc-wiz-body",children:[c.jsx("div",{className:"nc-wiz-done",children:p("node-connected")}),c.jsx("div",{className:"nc-sheet-actions",children:c.jsx("button",{className:"nc-btn primary",disabled:m,onClick:S,children:p("finish")})})]}),b&&c.jsx("div",{className:"nc-err",children:b})]})})}function Ej(e,t){if(typeof EventSource>"u"||!e)return()=>{};const n=new EventSource(`/api/events?token=${encodeURIComponent(e)}`);return n.onmessage=s=>{try{const o=JSON.parse(s.data);o&&typeof o=="object"&&typeof o.type=="string"&&t(o)}catch{}},()=>{try{n.close()}catch{}}}const Nj=6e3,jj=12e3;function Rj({n:e,onClose:t}){return c.jsxs("div",{className:`nc-ntf-toast${e.urgency==="high"?" high":""}`,role:"status","aria-live":"polite",children:[c.jsxs("div",{className:"nc-ntf-toast-txt",children:[c.jsx("b",{children:e.title}),e.body&&c.jsx("small",{children:e.body}),e.session&&c.jsx("span",{className:"nc-ntf-from",children:e.session})]}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:t,title:p("close"),children:c.jsx(Je,{name:"x",size:14})})]})}function Pj({ask:e,token:t,onAnswered:n,onDismiss:s}){const[o,a]=N.useState(""),[u,h]=N.useState(!1),[f,m]=N.useState(null),[v,b]=N.useState(!1),y=async w=>{const x=String(w||"").trim();if(!(!x||u)){m(null),h(!0);try{await q0(t,e.id,x),n(e.id)}catch(k){m(String(k.message||k))}h(!1)}},S=async()=>{if(!v){b(!0);try{await V0(t,e.id),s(e.id)}catch{b(!1)}}};return c.jsxs("div",{className:"nc-ask-card",children:[c.jsxs("div",{className:"nc-ask-head",children:[c.jsx("span",{className:"nc-ntf-from",children:e.session}),c.jsxs("code",{className:"nc-ask-id",children:["#",e.id]}),c.jsx("button",{type:"button",className:"nc-ask-dismiss",title:p("ask-dismiss"),"aria-label":p("ask-dismiss"),disabled:v,onClick:S,children:c.jsx(Je,{name:"x",size:14})})]}),c.jsx("div",{className:"nc-ask-q",children:e.question}),Array.isArray(e.options)&&e.options.length>0&&c.jsx("div",{className:"nc-ask-opts",children:e.options.map(w=>c.jsx("button",{type:"button",className:"nc-btn ghost",disabled:u,onClick:()=>y(w),children:w},w))}),c.jsxs("div",{className:"nc-ask-reply",children:[c.jsx("textarea",{rows:2,placeholder:p("ask-reply-ph"),value:o,disabled:u,onChange:w=>a(w.target.value)}),c.jsx("button",{type:"button",className:"nc-btn primary",disabled:u||!o.trim(),onClick:()=>y(o),children:p("send")})]}),f&&c.jsx("div",{className:"nc-err",children:f})]})}function Lj({token:e}){const[t]=kn(),[n]=lb(),[s,o]=N.useState([]),[a,u]=N.useState([]),[h,f]=N.useState(()=>{try{return/(?:^|[#&])ask=/.test(location.hash)}catch{return!1}}),m=N.useRef(0),v=N.useRef(null);v.current||(v.current=pj());const b=N.useRef({enabled:n,lang:t});b.current={enabled:n,lang:t};const y=N.useCallback(k=>{o(P=>P.filter(E=>E.key!==k))},[]),S=N.useCallback(k=>{const P=`t${m.current+=1}`;o(F=>[...F.slice(-3),{...k,key:P}]),setTimeout(()=>y(P),k.urgency==="high"?jj:Nj);const E=b.current;if(E.enabled)try{v.current.enqueue(k,cj(k,E.lang))}catch{}},[y]);N.useEffect(()=>{n||v.current.stop()},[n]),N.useEffect(()=>{const k=()=>{(document.visibilityState!=="visible"||!document.hasFocus())&&v.current.stop()},P=()=>v.current.stop();return document.addEventListener("visibilitychange",k),window.addEventListener("blur",k),window.addEventListener(Fh,P),()=>{document.removeEventListener("visibilitychange",k),window.removeEventListener("blur",k),window.removeEventListener(Fh,P),typeof v.current.dispose=="function"?v.current.dispose():v.current.stop()}},[]),N.useEffect(()=>{if(!e)return;let k=!1;K0(e).then(E=>{k||u(E.asks||[])}).catch(()=>{});const P=Ej(e,E=>{E.type==="notify"?S(E):E.type==="ask"&&E.ask&&E.ask.id?u(F=>F.some(M=>M.id===E.ask.id)?F:[...F,E.ask]):E.type==="ask-answered"&&E.id?u(F=>F.filter(M=>M.id!==E.id)):E.type==="ask-dismissed"&&E.id&&u(F=>F.filter(M=>M.id!==E.id))});return()=>{k=!0,P()}},[e,S]);const w=k=>u(P=>P.filter(E=>E.id!==k)),x=k=>u(P=>P.filter(E=>E.id!==k));return c.jsxs(c.Fragment,{children:[s.length>0&&c.jsx("div",{className:"nc-ntf-toasts",children:s.map(k=>c.jsx(Rj,{n:k,onClose:()=>y(k.key)},k.key))}),a.length>0&&!h&&c.jsxs("button",{type:"button",className:"nc-ask-badge",onClick:()=>f(!0),title:p("asks-title"),children:["? ",c.jsx("span",{className:"nc-ask-count",children:a.length})]}),a.length>0&&h&&c.jsxs("div",{className:"nc-ask-panel",children:[c.jsxs("div",{className:"nc-ask-panel-head",children:[c.jsx("b",{children:p("asks-title")}),c.jsx("span",{className:"nc-ask-count",children:a.length}),c.jsx("button",{type:"button",className:"nc-ntf-x",onClick:()=>f(!1),title:p("close"),children:c.jsx(Je,{name:"x",size:16})})]}),c.jsx("div",{className:"nc-ask-panel-body",children:a.map(k=>c.jsx(Pj,{ask:k,token:e,onAnswered:w,onDismiss:x},k.id))})]})]})}const Aj=4e3;async function Tj(e){const t=await Ft("/api/sessions",e);if((t==null?void 0:t.ok)===!1)throw new Error(`HTTP ${t.status}`);const n=await t.json();if(!Array.isArray(n==null?void 0:n.sessions))throw new Error("invalid sessions payload");return n.sessions}async function Fd(e,t=[]){var h;const[n,s]=await Promise.allSettled([t.length?Jh(e,t):Tj(e),ws(e,t)]),o=n.status==="fulfilled"&&Array.isArray((h=n.value)==null?void 0:h.sessions)?n.value.sessions:Array.isArray(n.value)?n.value:null,a=s.status==="fulfilled"?s.value:null,u=(a==null?void 0:a.available)===!0&&Array.isArray(a.cells)?a.cells:null;return{sessions:o,cells:u,fresh:Array.isArray(o)&&Array.isArray(u)}}function cb(e,t,n){return n===!0&&(e==null?void 0:e.degraded)!==!0&&(e==null?void 0:e.active)===!0&&e.tmux!==!1&&!!e.tmuxSession&&(t||[]).some(s=>(s==null?void 0:s.name)===e.tmuxSession)}function Dj(e){const t=new Map((e.sessions||[]).map(o=>[o.name,o])),n=[],s=(o,a,u,h=[],f="")=>{const m=new Map((a||[]).map(v=>[v.name,v]));for(const v of o||[]){const b=m.get(v.tmuxSession)||{},y=of(v,b),S=cb(v,a,u);n.push({key:Go(h,v.tmuxSession||v.cell),session:v.tmuxSession,route:h,cellName:v.cell,label:v.cell,node:h.length?h.join("/"):"",nodeLabel:f,live:S,selectable:S,verified:u===!0,working:y.working,degraded:!!v.degraded,activity:b.activity||v.activity||0,subtitle:y.subtitle})}};s(e.cells,[...t.values()],e.localFresh===!0);for(const o of e.nodeGroups||[])s(o.cells,o.sessions,o.switcherFresh===!0,Array.isArray(o.route)?o.route:[],o.label||o.name||"");return n}function Mj(e){const t=new Map,n=Array.isArray(e.sessions)?e.sessions:[],s=Array.isArray(e.cells)?e.cells:[],o=new Map(n.map(u=>[u.name,u])),a=new Set(s.map(u=>u.tmuxSession).filter(Boolean));t.set("local",af(s,n.filter(u=>!a.has(u.name)),o));for(const u of e.nodeGroups||[]){const h=Array.isArray(u.route)?u.route:[];if(!h.length)continue;const f=Array.isArray(u.cells)?u.cells:[],m=Array.isArray(u.sessions)?u.sessions:[],v=new Set(f.map(b=>b.tmuxSession).filter(Boolean));t.set(h.join("/"),Fl({...u,route:h,cells:f,sessions:m,unmanaged:m.filter(b=>!v.has(b.name))}).rawItems)}return t}function Ij(e,t,n,s){return[...new Set(e.map(a=>a.node||"local"))].flatMap(a=>{const u=e.filter(v=>(v.node||"local")===a),h=new Map((t.get(a)||[]).map(v=>[v.key,v])),f=new Map(u.map(v=>[v.key,v])),m=u.map(v=>{const b=h.get(v.key);return{...v,label:(b==null?void 0:b.label)||v.label,live:(b==null?void 0:b.live)??v.live,fresh:(b==null?void 0:b.fresh)===!0,activity:(b==null?void 0:b.activity)??v.activity}});return gs(m,n,"all",Fi(s,a)).map(v=>f.get(v.key))})}function Oj({token:e,current:t,onPick:n,onClose:s}){const[o,a]=N.useState(Og),[u,h]=N.useState(!1),[f,m]=N.useState(!1),[v,b]=N.useState(""),[y,S]=N.useState(""),[w,x]=N.useState(""),k=N.useRef(null),P=N.useRef(null),E=N.useMemo(()=>Dj(o),[o]),F=N.useMemo(()=>Mj(o),[o]),{pins:M,orders:V,canMoveRoster:G,moveRoster:O,stepRoster:Z}=rf(),X=N.useMemo(()=>Ij(E,F,M,V),[E,F,M,V]),Q=N.useMemo(()=>u?X:X.filter(A=>A.selectable||A.degraded),[X,u]),z=N.useMemo(()=>E.find(A=>A.key===y&&A.selectable),[E,y]);N.useEffect(()=>{var U;const A=document.activeElement;(U=P.current)==null||U.focus();const $=R=>{R.key==="Escape"&&s()};return document.addEventListener("keydown",$),()=>{var R;document.removeEventListener("keydown",$),(R=A==null?void 0:A.focus)==null||R.call(A)}},[s]),N.useEffect(()=>{let A=!0,$=!1;const U=async()=>{if($)return;$=!0;const K=Og(),B=Array.isArray(K.nodeGroups)?K.nodeGroups:[],j=Fd(e),D=await Promise.all(B.map(async ye=>{const me=Array.isArray(ye.route)?ye.route:[];return me.length?{group:ye,result:await Fd(e,me)}:{group:ye,result:{fresh:!1,sessions:null,cells:null}}})),W=await j;if(!A)return;const ne=new Map(D.map(({group:ye,result:me})=>[JSON.stringify(ye.route||[]),me])),ce=B.map(ye=>{const me=ne.get(JSON.stringify(ye.route||[]));return me?{...ye,sessions:me.sessions||ye.sessions||[],cells:me.cells||ye.cells||[],switcherFresh:me.fresh}:{...ye,switcherFresh:!1}}),pe=yy({...K,sessions:W.sessions||K.sessions||[],cells:W.cells||K.cells||[],localFresh:W.fresh,nodeGroups:ce,refreshedAt:Date.now()});a(pe),m(!0),$=!1};U();const R=setInterval(U,Aj);return()=>{A=!1,clearInterval(R)}},[e]);const I=A=>A.degraded?p("cell-degraded"):A.verified?A.selectable?A.working?p("cell-working"):p("cell-idle"):p("cell-off"):p("cell-switcher-not-confirmed"),C=A=>{if(b(""),!A.selectable){b(p("cell-switcher-not-active"));return}S(A.key)},T=async()=>{const A=z;if(!A){b(p("cell-switcher-select"));return}b(""),x(A.key);try{const $=await Fd(e,A.route),U=($.cells||[]).find(R=>(R==null?void 0:R.cell)===A.cellName&&(R==null?void 0:R.tmuxSession)===A.session);if(!cb(U,$.sessions,$.fresh)){b(p("cell-switcher-not-active"));return}n({session:A.session,...A.node?{node:A.node}:{},cellName:A.cellName}),s()}catch{b(p("cell-switcher-not-active"))}finally{x("")}};return c.jsx("div",{className:"nc-cell-switcher-backdrop",onClick:s,children:c.jsxs("aside",{ref:k,className:"nc-cell-switcher",role:"dialog","aria-label":p("fleet-cells"),tabIndex:-1,onClick:A=>A.stopPropagation(),children:[c.jsxs("div",{className:"nc-cell-switcher-list",children:[!f&&c.jsx("div",{className:"nc-empty",role:"status",children:p("cell-switcher-refreshing")}),f&&Q.length===0&&c.jsx("div",{className:"nc-empty",role:"status",children:p("cell-switcher-empty-active")}),Q.map(A=>{const $=(t==null?void 0:t.session)===A.session&&((t==null?void 0:t.node)||"")===A.node,U=y===A.key,R=I(A),K=A.node||"local",B=F.get(K)||E.filter(j=>(j.node||"local")===K);return c.jsxs("div",{className:`nc-cell-switcher-row${$?" current":""}${U?" selected":""}${A.selectable?"":" off"}`,"data-roster-key":A.key,"data-position":K,children:[c.jsx(bi,{position:K,itemKey:A.key,label:A.cellName,canMove:G,onMove:(j,D)=>O(K,j,D,B),onStep:j=>Z(K,A.key,j,B)}),c.jsxs("button",{type:"button",className:"nc-cell-switcher-row-select","aria-current":$?"true":void 0,"aria-pressed":U,"aria-disabled":!A.selectable,disabled:w===A.key,onClick:()=>C(A),children:[c.jsx("span",{className:`nc-cell-switcher-dot${A.degraded?" warn":A.live?` on${A.working?" working":""}`:""}`}),c.jsxs("span",{className:"nc-cell-switcher-copy",children:[c.jsx("b",{children:A.cellName}),c.jsx("small",{className:"nc-cell-switcher-state",children:R}),c.jsx("small",{children:[A.nodeLabel,A.subtitle].filter(Boolean).join(" · ")})]})]})]},A.key)})]}),v&&c.jsx("div",{className:"nc-cell-switcher-notice",role:"status",children:v}),c.jsx("div",{className:"nc-cell-switcher-actions",children:c.jsx("button",{type:"button",className:"nc-cell-switcher-open",disabled:!z||!!w,onClick:T,children:z?`${p("cell-switcher-open")}: ${z.cellName}`:p("cell-switcher-select")})}),c.jsxs("div",{className:"nc-cell-switcher-controls",children:[c.jsx("b",{children:p("fleet-cells")}),c.jsx("button",{type:"button",className:"nc-cell-switcher-filter","aria-pressed":u,onClick:()=>{b(""),h(A=>!A)},children:p(u?"cell-switcher-show-active":"cell-switcher-show-all")}),c.jsx("button",{ref:P,type:"button",className:"nc-cell-switcher-close","aria-label":p("cell-switcher-close"),title:p("cell-switcher-close"),onClick:s,children:"×"})]})]})})}const Bj=2e3;function zj(e){if(e.kind==="gap")return`${p("vl-events-gap")} ${e.count||"?"}`;if(e.kind==="truncate")return p("vl-events-truncated");if(e.kind==="turn_end")return p("vl-events-turn-end");if(e.kind==="done")return p("vl-events-done");if(e.kind==="writer_epoch")return p("vl-events-writer-epoch");if(e.kind==="tool_start")return`${p("vl-events-tool")} ${e.name||""}`.trim();if(e.kind==="tool_end"){const t=e.isError?p("vl-events-tool-failed"):p("vl-events-tool-ok");return`${p("vl-events-tool")} ${e.name||""} — ${t}`.trim()}return e.kind==="usage"?e.text||p("vl-events-usage"):e.text||""}function Fj({token:e,nodeId:t,route:n=[]}){const[s,o]=N.useState([]),[a,u]=N.useState(!1),h=N.useRef(0);return N.useEffect(()=>{let f=!0;h.current=0,o([]);const m=async()=>{try{const y=await x0(e,t,h.current,n);if(!f)return;u(!1);const S=Array.isArray(y==null?void 0:y.events)?y.events:[];S.length&&(o(w=>w.concat(S).slice(-500)),h.current=S[S.length-1].seq),Number.isSafeInteger(y==null?void 0:y.cursor)&&y.cursor>h.current&&(h.current=y.cursor)}catch{f&&u(!0)}},v=()=>{m().catch(()=>{})};v();const b=setInterval(v,Bj);return()=>{f=!1,clearInterval(b)}},[e,t,JSON.stringify(n)]),c.jsxs("div",{className:"nc-vl-events",children:[a&&c.jsx("div",{className:"nc-set-hint nc-vl-events-stale",children:p("vl-events-stale")}),s.length===0&&!a&&c.jsx("small",{className:"nc-set-hint","data-testid":"vl-events-empty",children:p("vl-events-empty")}),s.length>0&&c.jsx("ol",{className:"nc-vl-events-list",children:s.map(f=>c.jsx("li",{"data-testid":`vl-ev-${f.seq}`,className:`nc-vl-ev nc-vl-ev-${f.kind}${f.isError?" error":""}${f.kind==="gap"?" gap":""}`,children:zj(f)},`${f.seq}-${f.kind}`))})]})}function B_({peer:e,token:t,onBack:n}){var s;return kn(),e?c.jsxs("section",{className:"nc-vl-session-view",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:n,title:p("back"),children:[c.jsx(Je,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:p("back")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:e.label,children:e.label}),((s=e.session)==null?void 0:s.profile)&&c.jsxs("small",{className:"nc-bar-sub",children:[e.session.profile," · ",p("vl-events-title")]})]}),c.jsx("span",{className:"nc-bar-right"})]}),c.jsx("div",{className:"nc-vl-session-body",children:c.jsx(Fj,{token:t,nodeId:e.nodeId,route:e.route||[]})})]}):null}const $d=e=>ki(Ys(e)).length===0,Hd=e=>Array.isArray(e)?e.join("/"):"";function $j(e){const t=new Set,n=[];for(const s of Array.isArray(e)?e:[])!s||!Hn.test(String(s.instanceId||""))||!Array.isArray(s.route)||!s.route.length||t.has(s.instanceId)||(t.add(s.instanceId),n.push({instanceId:s.instanceId,route:[...s.route],label:String(s.label||s.name||s.route.join(" › ")),status:s.status||"offline"}));return n.sort((s,o)=>s.label.localeCompare(o.label))}function zo(e){return{instanceId:e.ownerId,route:e.ownerRoute||[],label:e.ownerLabel,status:e.available===!1?"offline":"up"}}function Hs(e,t,n,s=!1,o=!0){const a=t.instanceId;return{...e,id:Lr(s?null:a,e.name),ownerId:a,ownerRoute:s?[]:[...t.route],ownerLabel:s?"Local":t.label,local:s,available:o,ownerTopology:Array.isArray(n)?n:[],layout:Ih(e.layout,a,n)}}function Hj(e,t,n,s,o=[]){const[a,u]=N.useState([]),[h,f]=N.useState(!1),[m,v]=N.useState("idle"),[b,y]=N.useState(""),[S,w]=N.useState(""),x=N.useRef([]),k=N.useRef([]),P=N.useRef(""),E=N.useRef(t),F=N.useRef(n),M=N.useRef(!1),V=N.useRef(!0),G=N.useRef(""),O=N.useMemo(()=>$j(o),[o]),Z=O.map(B=>`${B.instanceId}:${Hd(B.route)}:${B.status}:${B.label}`).join("|");k.current=O,F.current=n,E.current=t,x.current=a;const X=N.useCallback(B=>Oh(B.layout,P.current,k.current),[]),Q=N.useCallback((B,j=!0,D=E.current)=>{const W=Vv(B,xl()),ne=x.current.some(pe=>pe.id===D);x.current=W,u(W);const ce=W.find(pe=>pe.id===D);if(j&&ce){V.current=!0;const pe=X(ce);s(pe),ce.local&&dN(ce.name,pe)}else ne&&!ce&&(V.current=!0,s(Pr()),y("deck non più condiviso dal nodo owner"));aN(W.filter(pe=>pe.local).map(pe=>pe.name))},[s,X]),z=N.useCallback(async B=>{let j=await pl(e);const D=j.decks.find(W=>W.name==="main");if(j.decks.length===1&&D&&D.revision===0&&$d(D.layout)){const W=oN(),ne=Ys(Bh("main")||Pr());if(!$d(ne)){const ce=Ih(ne,B,[]);j.decks[0]=await ml(e,"main",ce,0,[])}for(const ce of W.filter(pe=>pe!=="main"))try{let pe=await kg(e,ce,[]);const ye=Ys(Bh(ce)||Pr());$d(ye)||(pe=await ml(e,ce,Ih(ye,B,[]),pe.revision,[]))}catch{}j=await pl(e)}return j},[e]),I=N.useCallback(async({migrate:B=!1}={})=>{const j=await Zh(e,[]),D=Hn.test(String(j.instanceId||""))?j.instanceId:"";if(!D)throw new Error("instanceId locale non disponibile");P.current=D,w(D);const[W,ne]=await Promise.all([B?z(D):pl(e),wg(e,[]).catch(()=>({nodes:[]}))]),ce={instanceId:D,route:[],label:"Local"},pe=W.decks.map(me=>Hs(me,ce,ne.nodes,!0,!0)),ye=x.current;return await Promise.all(k.current.map(async me=>{if(me.status!=="up"){pe.push(...ye.filter(ae=>!ae.local&&ae.ownerId===me.instanceId).map(ae=>({...ae,ownerRoute:[...me.route],ownerLabel:me.label,available:!1})));return}try{const[ae,Pe]=await Promise.all([pl(e,me.route),wg(e,me.route).catch(()=>({nodes:[]}))]);pe.push(...ae.decks.map(rt=>Hs(rt,me,Pe.nodes,!1,!0)))}catch{pe.push(...ye.filter(Pe=>!Pe.local&&Pe.ownerId===me.instanceId).map(Pe=>({...Pe,ownerRoute:[...me.route],ownerLabel:me.label,available:!1})))}})),pe.sort((me,ae)=>me.local===ae.local?me.ownerLabel.localeCompare(ae.ownerLabel)||(me.name==="main"?-1:ae.name==="main"?1:me.name.localeCompare(ae.name)):me.local?-1:1),pe},[e,z,Z]);N.useEffect(()=>{if(!e)return;let B=!1;const j=G.current!==e;return G.current=e,I({migrate:j}).then(D=>{if(B)return;const W=x.current.find(pe=>pe.id===E.current),ne=D.find(pe=>pe.id===E.current),ce=ne&&(!W||ne.revision>W.revision||W.available!==ne.available||Hd(W.ownerRoute)!==Hd(ne.ownerRoute));Q(D,j||!!ce&&!M.current),f(!0),ne&&y("")}).catch(D=>{B||(f(!0),y(String(D.message||D)))}),()=>{B=!0}},[Q,I,Z,e]);const C=N.useCallback(async(B=E.current)=>{if(!h||!M.current)return!0;const j=x.current.find(D=>D.id===B);if(!j)return y(`deck inesistente: ${B}`),!1;if(j.available===!1)return y(`nodo owner offline: ${j.ownerLabel}`),!1;v("saving");try{const D=Kv(Ys(F.current),j.ownerId,j.ownerTopology),W=await ml(e,j.name,D,j.revision,j.ownerRoute),ne=Hs(W,zo(j),j.ownerTopology,j.local,!0);return Q(x.current.map(ce=>ce.id===B?ne:ce),!1),M.current=!1,v("saved"),y(""),setTimeout(()=>v("idle"),1500),!0}catch(D){if(v("error"),y(String(D.message||D)),D.status===409&&D.data&&D.data.current){const W=x.current.find(ce=>ce.id===B),ne=Hs(D.data.current,zo(W),W.ownerTopology,W.local,!0);Q(x.current.map(ce=>ce.id===B?ne:ce),!1)}return!1}},[h,e,Q]);return N.useEffect(()=>{if(!h)return;if(V.current){V.current=!1;return}M.current=!0,v("saving");const B=setTimeout(C,650);return()=>clearTimeout(B)},[n,h,C]),N.useEffect(()=>{if(!h)return;const B=setInterval(async()=>{try{const j=await I(),D=x.current.find(ce=>ce.id===E.current),W=j.find(ce=>ce.id===E.current),ne=W&&(!D||W.revision>D.revision||D.available!==W.available);Q(j,ne&&!M.current)}catch{}},5e3);return()=>clearInterval(B)},[h,I,Q]),{decks:a,records:a,localNodeId:S,ready:h,saveState:m,error:b,setError:y,saveNow:C,select:async B=>{if(M.current&&!await C(E.current))throw new Error("salvataggio del deck corrente fallito: cambio annullato");const j=x.current.find(D=>D.id===B);if(!j)throw new Error(`deck inesistente: ${B}`);return M.current=!1,V.current=!0,X(j)},add:async(B,j=null)=>{const D=j===Si?x.current.find(ce=>ce.local):j?x.current.find(ce=>ce.ownerId===j):null;if(!D||D.available===!1)throw new Error("nodo owner non disponibile");const W=await kg(e,B,D.ownerRoute),ne=Hs(W,zo(D),D.ownerTopology,D.local,!0);return Q([...x.current,ne],!1),ne},rename:async(B,j)=>{const D=x.current.find(ye=>ye.id===B);if(!D)throw new Error("deck inesistente");if(B===E.current&&M.current&&!await C(B))throw new Error(`salvataggio di "${D.name}" fallito: rinomina annullata`);const W=x.current.find(ye=>ye.id===B);if(!W)throw new Error("deck inesistente");const ne=await Y0(e,W.name,j,W.revision,W.ownerRoute),ce=Hs(ne,zo(W),W.ownerTopology,W.local,!0),pe=W.local?Si:W.ownerId;return pd(cN(xl(),pe,B,ce.id)),Q(x.current.map(ye=>ye.id===B?ce:ye),!1),ce},remove:async B=>{const j=x.current.find(W=>W.id===B);if(!j)throw new Error("deck inesistente");B===E.current&&(M.current=!1),await G0(e,j.name,j.revision,j.ownerRoute);const D=j.local?Si:j.ownerId;pd(uN(xl(),D,B)),Q(x.current.filter(W=>W.id!==B),!1)},reorder:(B,j)=>{const D=x.current.find(me=>me.id===B),W=x.current.find(me=>me.id===j);if(!D||!W)return!1;const ne=D.local?Si:D.ownerId,ce=W.local?Si:W.ownerId;if(ne!==ce)return!1;const pe=x.current.filter(me=>(me.local?Si:me.ownerId)===ne).map(me=>me.id),ye=pd(lN(xl(),ne,B,j,pe));return Q(Vv(x.current,ye),!1),!0},addTileTo:async(B,j)=>{const D=x.current.find(me=>me.id===B);if(!D)throw new Error("deck inesistente");if(D.available===!1)throw new Error(`nodo owner offline: ${D.ownerLabel}`);const W=jw(j,P.current,k.current);if(!W)throw new Error("riferimento sessione non valido");const ne=X(D),ce=Kv(gy(ne,W),D.ownerId,D.ownerTopology),pe=await ml(e,D.name,ce,D.revision,D.ownerRoute),ye=Hs(pe,zo(D),D.ownerTopology,D.local,!0);return Q(x.current.map(me=>me.id===B?ye:me),!1),ye},localMainId:Lr(null,"main"),parseDeckId:sc}}const Uj="/sw.js",Hh="nc-sw-update";let Uh=null,Wh=!1,Kh=null,ub=Object.freeze({needed:!1,kind:null,version:""}),db=!1;function hb(){typeof window<"u"&&window.dispatchEvent(new Event(Hh))}function fb(){const e=Kh||(Wh?{kind:"reload",version:""}:null);ub=Object.freeze({needed:!!e,kind:(e==null?void 0:e.kind)||null,version:(e==null?void 0:e.version)||""})}function z_(){return ub}function Wj(e){return typeof window>"u"?()=>{}:(window.addEventListener(Hh,e),()=>window.removeEventListener(Hh,e))}function Ff(e){Wh!==e&&(Wh=e,fb(),hb())}function Kj(e,t,n){let s=null;e&&t&&e!==t?s={kind:"install",version:e}:t&&n&&t!==n&&(s={kind:"reload",version:t});const o=JSON.stringify(s)===JSON.stringify(Kh);Kh=s,fb(),o||hb()}function qj(e){e.addEventListener("statechange",()=>{e.state==="installed"&&navigator.serviceWorker.controller&&Ff(!0)})}function Vj(){typeof navigator>"u"||!("serviceWorker"in navigator)||(navigator.serviceWorker.addEventListener("controllerchange",()=>{db&&location.reload()}),navigator.serviceWorker.register(Uj).then(e=>{Uh=e,e.waiting&&Ff(!0),e.addEventListener("updatefound",()=>{const t=e.installing;t&&qj(t)}),setInterval(()=>{e.update().catch(()=>{})},3600*1e3)}).catch(()=>{}))}function Yj(){db=!0,Ff(!1);const e=Uh&&Uh.waiting;e?(e.postMessage({type:"SKIP_WAITING"}),setTimeout(()=>location.reload(),4e3)):location.reload()}function Gj({hash:e="",origin:t="",pathname:n="",search:s=""}={}){const o=String(e||"").replace(/^#/,""),a=`${n||""}${s||""}`;if(!o)return{token:"",pair:"",nextUrl:a};const u=new URLSearchParams(o),h=u.get("token")||"",f=u.get("pair")||"",m=f?`${t||""}${n||""}#pair=${f}`:"";return{token:h,pair:m,nextUrl:a}}const pb=9,mb=24,gb="nc_side_w",F_="nc_side_min",Xj=240,$_="(min-width:1024px) and (pointer:fine)";function Qj(){const e=Number(localStorage.getItem(gb));return e>=180&&e<=480?e:Xj}function Jj(){const e=Number(localStorage.getItem("nc_fontsize"));return e>=pb&&e<=mb?e:13}function Zj(){const e={token:"",pair:""};try{const{token:t,pair:n,nextUrl:s}=Gj({hash:location.hash,origin:location.origin,pathname:location.pathname,search:location.search});if(t){e.token=t;try{localStorage.setItem("nc_token",t)}catch{}}if(n){e.pair=n;try{sessionStorage.setItem("nc_pair",n)}catch{}}if(location.hash)try{history.replaceState(null,"",s)}catch{}}catch{}if(e.token||(e.token=sessionStorage.getItem("nc_token")||localStorage.getItem("nc_token")||""),!e.pair){const t=sessionStorage.getItem("nc_pair");t&&(e.pair=t)}return e}function eR(e){try{return Ys(Bh(e))}catch{return Pr()}}function H_(e){if(!e)return"";const t=Math.floor(Date.now()/1e3)-e;return t<0||t<60?"ora":t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}g`}function tR(){const[e,t]=N.useState(()=>window.matchMedia($_).matches);return N.useEffect(()=>{const n=window.matchMedia($_),s=o=>t(o.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[]),e}function U_({session:e,node:t,ownerId:n,cellName:s,token:o,readonly:a=!1,onBack:u,onCellSwitcher:h,cellSwitcherOpen:f=!1}){kn();const[m]=kf(),[v,b]=N.useState(!1),[y,S]=N.useState(()=>window.matchMedia("(pointer: coarse)").matches),[w,x]=N.useState(null),[k,P]=N.useState(Jj),[E,F]=N.useState(s||e),[M,V]=N.useState(""),G=$=>P(U=>{const R=Math.max(pb,Math.min(mb,U+$));return localStorage.setItem("nc_fontsize",String(R)),R}),O=N.useRef(()=>{}),Z=N.useRef(()=>!1),X=N.useRef(()=>{}),Q=N.useRef(!1),[z,I]=N.useState(!1),[C,T]=N.useState(!1),A=()=>{Q.current=!Q.current,I(Q.current)};return N.useEffect(()=>{F(s||e)},[s,e]),N.useEffect(()=>{let $=!0;const U=t?t.split("/"):[],R=t?`/api/route/${t.split("/").map(encodeURIComponent).join("/")}/_`:"/api";async function K(){let j=null,D=null;try{const ce=await(await Ft(`${R}/sessions`,o)).json();Array.isArray(ce.sessions)&&(j=ce.sessions.find(pe=>pe.name===e))}catch{}try{const ne=await ws(o,U);ne.available&&Array.isArray(ne.cells)&&(D=ne.cells.find(ce=>ce.tmuxSession===e))}catch{}if(!$)return;F(Cf({session:e,cell:D||(s?{cell:s}:null)}));let W="";D?W=`${D.engine}${D.key?`·${D.key}`:""}`:j&&(W=j.attached?`attached · ${H_(j.activity)}`:j.activity?H_(j.activity):""),V(W)}K();const B=setInterval(K,4e3);return()=>{$=!1,clearInterval(B)}},[e,t,o]),c.jsxs("div",{className:"nc-app",children:[c.jsxs("header",{className:"nc-bar nc-bar-single",children:[c.jsxs("button",{onClick:u,title:p("sessions"),children:[c.jsx(Je,{name:"chevronLeft",size:18}),c.jsx("span",{className:"nc-bar-label",children:p("sessions")})]}),c.jsxs("span",{className:"nc-bar-center",children:[c.jsx("b",{title:t?`${E} · ${t}`:E,children:E}),M&&c.jsx("small",{className:"nc-bar-sub",children:M})]}),c.jsxs("span",{className:"nc-bar-right",children:[c.jsx("button",{onClick:()=>G(-1),title:p("zoom-out"),children:c.jsx(Je,{name:"zoomOut",size:18})}),c.jsx("button",{onClick:()=>G(1),title:p("zoom-in"),children:c.jsx(Je,{name:"zoomIn",size:18})}),c.jsx("button",{onClick:()=>S($=>!$),title:p("composer"),children:c.jsx(Je,{name:"keyboard",size:20})}),c.jsx("button",{onClick:()=>b($=>!$),title:p("files"),children:c.jsx(Je,{name:"folder",size:20})})]})]}),c.jsx("div",{className:"nc-termwrap",children:c.jsx(fw,{session:e,node:t,token:o,readonly:a,takeSize:!0,sendRef:O,composerRef:Z,actionRef:X,ctrlRef:Q,setCtrlArmed:I,onFiles:x,fontSize:k,selectionMode:C,onSelectionModeChange:T,keyboardGesture:m.terminalKeyboardGesture})}),c.jsx(PE,{onKeyboard:()=>S($=>!$),onCellSwitcher:h,cellSwitcherOpen:f,send:$=>O.current($),action:$=>X.current($),ctrlArmed:z,onCtrl:A,selectionMode:C,onSelectionMode:T,keepKeyboardClosed:m.keybarKeepsKeyboardClosed,showEnter:m.showKeybarEnter,keybarLayout:m.keybarLayout}),y&&c.jsx(xw,{submitText:$=>Z.current($),token:o,session:e,node:t,ownerId:n,keepKeyboardClosedOnVoice:m.voiceKeepsKeyboardClosed}),v&&c.jsx(pw,{session:e,node:t,token:o,filesEvent:w,onClose:()=>b(!1)})]})}function nR(){kn();const[e]=N.useState(Zj),[t,n]=N.useState(e.token),[s,o]=N.useState(e.pair||""),a=N.useCallback(()=>{o("");try{sessionStorage.removeItem("nc_pair")}catch{}},[]),[u,h]=N.useState(!1),f=tR(),[m]=N.useState(()=>rN(typeof location<"u"?location.pathname:"/")),[v,b]=N.useState(m.id),y=v===Lr(null,Un),[S,w]=N.useState(null),x=de=>{const Ne=ys(de);w(Ne?{...Ne,...typeof(de==null?void 0:de.cellName)=="string"&&de.cellName?{cellName:de.cellName}:{}}:null)},[k,P]=N.useState([]),[E,F]=N.useState([]),[M,V]=N.useState([]),[G,O]=N.useState(()=>m.ownerId?Pr():eR(m.name)),[Z,X]=N.useState(null),[Q,z]=N.useState(null),I=de=>z(ys(de)),[C,T]=N.useState(null),A=nf(t,f),$=N.useMemo(()=>(A||[]).filter(de=>de.instanceId).map(de=>({instanceId:de.instanceId,route:de.route,label:de.label,status:de.status})),[A]),U=Hj(t,v,G,O,$),R=U.decks;N.useEffect(()=>{const de=new Map;for(const Ne of A||[]){const Ke=(Ne.route||[Ne.name]).join("/"),ht=new Set((Ne.sessions||[]).map(gt=>gt.name));for(const gt of Ne.cells||[])!gt.cell||!gt.tmuxSession||gt.cell===gt.tmuxSession||ht.has(gt.cell)||de.set(`${Ke}:${gt.cell}`,`${Ke}:${gt.tmuxSession}`)}O(Ne=>kx(Ne,de))},[A]),N.useEffect(()=>{U.localNodeId&&O(de=>{const Ne=Oh(de,U.localNodeId,$);return JSON.stringify(Ne)===JSON.stringify(de)?de:Ne})},[$,U.localNodeId]);const[K,B]=N.useState(null),[j,D]=N.useState(null),W=N.useRef(0),[ne,ce]=N.useState(!1),[pe,ye]=N.useState(Qj),[me,ae]=N.useState(!y),[Pe,rt]=N.useState(()=>y?localStorage.getItem(F_)==="1":!0),[Xe,Me]=N.useState(!1),[qt,wn]=N.useState("nodes"),[Be,$t]=N.useState(!1),[Nt,At]=N.useState(""),[mt,dt]=N.useState(!1),ut=(de="nodes",Ne=!1,Ke="")=>{wn(de),$t(Ne),At(Ke),Me(!0)},[re,xe]=N.useState(!1),[Ie,Fe]=N.useState({deviceDefault:"",localNodeId:"",localNameDefault:""}),[he,ze]=N.useState(!1);N.useEffect(()=>{try{localStorage.setItem(gb,String(pe))}catch{}},[pe]),N.useEffect(()=>{try{localStorage.setItem(F_,Pe?"1":"")}catch{}},[Pe]),N.useEffect(()=>{if(!t)return;let de=!1;return Promise.all([J_(t),Ft("/api/config",t).then(Ne=>Ne.json())]).then(([Ne,Ke])=>{de||(Fe({deviceDefault:Ne.deviceName||"",localNodeId:Ne.nodeId||"",localNameDefault:Ne.localName||""}),ze(!!Ke.readonlyDefault),(Ne.firstRun===!0&&!Ke.readonlyDefault||s)&&xe(!0))}).catch(()=>{}),()=>{de=!0}},[t,s]);const q=N.useCallback(async()=>{try{const Ne=await(await Ft("/api/sessions",t)).json();Ne.error||P(Ne.sessions||[])}catch{}try{const de=await ws(t);F(de.available?de.cells||[]:[]),V(de.available?de.capabilities||[]:[])}catch{F([]),V([])}},[t]);N.useEffect(()=>{if(!f)return;q();const de=setInterval(q,4e3);return()=>clearInterval(de)},[f,q]),N.useEffect(()=>{let de=!1;return Ft("/api/config",t).then(Ne=>Ne.json()).then(Ne=>{de||Kj(Ne.version,Ne.uiVersion,"0.8.52-rc.6")}).catch(()=>{}),()=>{de=!0}},[t]);const te=new Set([...k.map(de=>de.name),...A.flatMap(de=>de.sessions.map(Ne=>Ne.key))]),H=ki(G),le=de=>O(Ne=>{const Ke=jw(de,U.localNodeId,$)||de,ht=gy(Ne,Ke);return ht===Ne&&ki(Ne).length>=9&&U.setError(p("grid-full")),ht}),ue=async(de,Ne=[])=>{try{await Xh(t,de,Ne)}catch{return}const Ke=Ne.length?`${Ne.join("/")}:${de}`:de;O(ht=>Hl(ht,Ke)),q()},ge=async(de,Ne,Ke=[])=>{try{await Q_(t,de,Ne,Ke)}catch{return}q()},Le=async(de,Ne,Ke=[])=>{await Y_(t,{cell:de,enabled:!!Ne},Ke),q()},_e=async de=>{if(!K)return;const{cell:Ne}=K,Ke=Array.isArray(K.route)?K.route:[];if(de.action==="up"){const gt=await Yh(t,{cell:Ne,boot:!!de.boot,...de.engine?{engine:de.engine}:{},...de.model!==void 0?{model:de.model}:{},...de.permissionPolicy?{permissionPolicy:de.permissionPolicy}:{}},Ke),bs=uf(gt);bs&&U.setError(bs.text)}else await Il(t,{cell:Ne,boot:!!de.boot},Ke);const ht=de.action==="up"?!!de.boot:de.boot?!1:!!K.boot;D({id:++W.current,cell:Ne,route:Ke,enabled:ht}),q()},Ce=N.useCallback(de=>{D(Ne=>(Ne==null?void 0:Ne.id)===de?null:Ne)},[]),tt=async de=>{if(!(!(de!=null&&de.direct)||ne)){ce(!0);try{await ef(t,de.name,de.tunnelStatus==="up"?"down":"up")}finally{ce(!1)}}},ot=async(de,Ne)=>{const Ke=String(Ne||"").trim();return!(de!=null&&de.direct)||!Mr(Ke)?!1:(await ty(t,de.name,Ke),!0)},Qe=de=>{const Ne=R.find(Ke=>Ke.id===de);if(!Ne)return!1;try{const Ke=window.open(fd(Ne,t),"_blank");return Ke&&(Ke.opener=null),!!Ke}catch{return!1}},Tt=async de=>{if(!de||de===v)return;const Ne=await U.select(de),Ke=U.records.find(ht=>ht.id===de);b(de),O(Ne),X(null),z(null);try{history.replaceState(null,"",fd(Ke||de,null))}catch{}},lt=async(de,Ne)=>{const Ke=await U.add(de,Ne);await Tt(Ke.id)},Ze=async(de,Ne)=>{const Ke=await U.rename(de,Ne);if(de===v){b(Ke.id),O(Oh(Ke.layout,U.localNodeId,$)),X(null),z(null);try{history.replaceState(null,"",fd(Ke,null))}catch{}}},Jt=async de=>{await U.remove(de),de===v&&await Tt(U.localMainId)},ni=async(de,Ne)=>{!Ne||Ne===v||(await U.addTileTo(Ne,de),O(Ke=>Hl(Ke,de)))};if(!t)return c.jsxs("div",{className:"nc-auth",children:[c.jsx("p",{children:p("auth-prompt")}),c.jsx("input",{onChange:de=>n(de.target.value.trim()),placeholder:"token"}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",checked:u,onChange:de=>h(de.target.checked)})," ",p("remember-device")]}),c.jsx("button",{onClick:()=>{(u?localStorage:sessionStorage).setItem("nc_token",t)},children:"ok"})]});const Wn=c.jsxs(c.Fragment,{children:[Xe&&c.jsx(kj,{token:t,initialTab:qt,initialLocation:Nt,startNewCell:Be,onClose:()=>{Me(!1),$t(!1),At("")}}),re&&c.jsx(Cj,{token:t,initialPair:s,...Ie,onPairDone:a,onDone:()=>xe(!1)}),c.jsx(Lj,{token:t})]});if(!f)return C?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"nc-single-overlay",children:c.jsx(B_,{peer:C,token:t,onBack:()=>T(null)})}),Wn]}):S?c.jsxs(c.Fragment,{children:[c.jsx(U_,{session:S.session,node:S.node,ownerId:S.ownerId,cellName:S.cellName,token:t,readonly:he,onBack:()=>w(null),onCellSwitcher:()=>dt(!0),cellSwitcherOpen:mt}),mt&&c.jsx(Oj,{token:t,current:S,onPick:de=>{x(de),dt(!1)},onClose:()=>dt(!1)}),Wn]}):c.jsxs(c.Fragment,{children:[c.jsx($x,{onPick:x,token:t,onSettings:ut,onOpenVlSession:T}),Wn]});const ui=y||!me;return c.jsxs("div",{className:"nc-workspace",children:[ui&&c.jsx(VE,{sessions:k,cells:E,activeSessions:H,nodeGroups:A,fleetCapabilities:M,bootSettlement:j,onBootSettlementApplied:Ce,localNodeId:U.localNodeId,onPick:I,onAddTile:le,onPower:B,onBoot:Le,onBootError:de=>U.setError(String((de==null?void 0:de.message)||de)),onNodePower:tt,onNodeRename:ot,onKill:ue,onVisibility:ge,onNew:()=>ut("fleet",!0),onSettings:ut,onOpenVlSession:T,width:pe,collapsed:Pe,onResize:ye,onToggleCollapse:()=>rt(de=>!de)}),c.jsxs("div",{className:"nc-workspace-main",children:[c.jsx(jN,{decks:R,currentDeck:v,onCreate:lt,onRename:Ze,onDelete:Jt,onReorder:U.reorder,onOpenWindow:Qe,onNavigate:Tt,saveState:U.saveState,error:U.error,sidebarVisible:ui,onToggleSidebar:y?null:()=>ae(de=>!de)}),c.jsx(eN,{layout:G,onLayoutChange:O,token:t,readonly:he,sessionsAlive:te,focusSession:Z,onFocus:X,onOpenSingle:I,decks:R,currentDeck:v,onSendToDeck:ni,cells:E,nodeGroups:A})]}),C&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx(B_,{peer:C,token:t,onBack:()=>T(null)})}),Q&&c.jsx("div",{className:"nc-single-overlay",children:c.jsx(U_,{session:Q.session,node:Q.node,ownerId:Q.ownerId,cellName:Cf({session:Q.session,node:Q.node,ownerId:Q.ownerId,cells:E,nodeGroups:A}),token:t,readonly:he,onBack:()=>z(null)})}),K&&c.jsx(Bl,{cell:K,token:t,route:Array.isArray(K.route)?K.route:[],onConfirm:_e,onClose:()=>B(null)}),Wn]})}function iR(){kn();const e=N.useSyncExternalStore(Wj,z_,z_);if(!e.needed)return null;const t=e.kind==="install"?p("install-version-mismatch").replace("{v}",e.version):p("update-available").replace("{v}",e.version).replace(" "," ").trim();return c.jsxs("div",{className:"nc-update",role:"status","aria-live":"polite",children:[c.jsx("span",{className:"nc-update-msg",children:t}),e.kind==="reload"&&c.jsx("button",{className:"nc-update-btn",onClick:Yj,children:p("reload")})]})}Vj();u0.createRoot(document.getElementById("root")).render(c.jsxs(i0.StrictMode,{children:[c.jsx(nR,{}),c.jsx(iR,{})]}));