(function(){const x=document.createElement("link").relList;if(x&&x.supports&&x.supports("modulepreload"))return;for(const M of document.querySelectorAll('link[rel="modulepreload"]'))d(M);new MutationObserver(M=>{for(const _ of M)if(_.type==="childList")for(const K of _.addedNodes)K.tagName==="LINK"&&K.rel==="modulepreload"&&d(K)}).observe(document,{childList:!0,subtree:!0});function r(M){const _={};return M.integrity&&(_.integrity=M.integrity),M.referrerPolicy&&(_.referrerPolicy=M.referrerPolicy),M.crossOrigin==="use-credentials"?_.credentials="include":M.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function d(M){if(M.ep)return;M.ep=!0;const _=r(M);fetch(M.href,_)}})();var Zu={exports:{}},In={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ff;function cp(){if(ff)return In;ff=1;var u=Symbol.for("react.transitional.element"),x=Symbol.for("react.fragment");function r(d,M,_){var K=null;if(_!==void 0&&(K=""+_),M.key!==void 0&&(K=""+M.key),"key"in M){_={};for(var Z in M)Z!=="key"&&(_[Z]=M[Z])}else _=M;return M=_.ref,{$$typeof:u,type:d,key:K,ref:M!==void 0?M:null,props:_}}return In.Fragment=x,In.jsx=r,In.jsxs=r,In}var xf;function up(){return xf||(xf=1,Zu.exports=cp()),Zu.exports}var l=up(),Ku={exports:{}},ye={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hf;function rp(){if(hf)return ye;hf=1;var u=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),K=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),z=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),T=Symbol.iterator;function P(m){return m===null||typeof m!="object"?null:(m=T&&m[T]||m["@@iterator"],typeof m=="function"?m:null)}var J={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ie=Object.assign,G={};function ee(m,N,j){this.props=m,this.context=N,this.refs=G,this.updater=j||J}ee.prototype.isReactComponent={},ee.prototype.setState=function(m,N){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,N,"setState")},ee.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function ae(){}ae.prototype=ee.prototype;function $(m,N,j){this.props=m,this.context=N,this.refs=G,this.updater=j||J}var fe=$.prototype=new ae;fe.constructor=$,ie(fe,ee.prototype),fe.isPureReactComponent=!0;var oe=Array.isArray;function le(){}var W={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function pe(m,N,j){var X=j.ref;return{$$typeof:u,type:m,key:N,ref:X!==void 0?X:null,props:j}}function k(m,N){return pe(m.type,N,m.props)}function he(m){return typeof m=="object"&&m!==null&&m.$$typeof===u}function Ne(m){var N={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(j){return N[j]})}var De=/\/+/g;function L(m,N){return typeof m=="object"&&m!==null&&m.key!=null?Ne(""+m.key):N.toString(36)}function ue(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(le,le):(m.status="pending",m.then(function(N){m.status==="pending"&&(m.status="fulfilled",m.value=N)},function(N){m.status==="pending"&&(m.status="rejected",m.reason=N)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function f(m,N,j,X,I){var p=typeof m;(p==="undefined"||p==="boolean")&&(m=null);var q=!1;if(m===null)q=!0;else switch(p){case"bigint":case"string":case"number":q=!0;break;case"object":switch(m.$$typeof){case u:case x:q=!0;break;case Y:return q=m._init,f(q(m._payload),N,j,X,I)}}if(q)return I=I(m),q=X===""?"."+L(m,0):X,oe(I)?(j="",q!=null&&(j=q.replace(De,"$&/")+"/"),f(I,N,j,"",function(Je){return Je})):I!=null&&(he(I)&&(I=k(I,j+(I.key==null||m&&m.key===I.key?"":(""+I.key).replace(De,"$&/")+"/")+q)),N.push(I)),1;q=0;var w=X===""?".":X+":";if(oe(m))for(var ne=0;ne>>1,re=f[F];if(0>>1;FM(j,Q))XM(I,j)?(f[F]=I,f[X]=Q,F=X):(f[F]=j,f[N]=Q,F=N);else if(XM(I,Q))f[F]=I,f[X]=Q,F=X;else break e}}return v}function M(f,v){var Q=f.sortIndex-v.sortIndex;return Q!==0?Q:f.id-v.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var _=performance;u.unstable_now=function(){return _.now()}}else{var K=Date,Z=K.now();u.unstable_now=function(){return K.now()-Z}}var O=[],z=[],Y=1,U=null,T=3,P=!1,J=!1,ie=!1,G=!1,ee=typeof setTimeout=="function"?setTimeout:null,ae=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function fe(f){for(var v=r(z);v!==null;){if(v.callback===null)d(z);else if(v.startTime<=f)d(z),v.sortIndex=v.expirationTime,x(O,v);else break;v=r(z)}}function oe(f){if(ie=!1,fe(f),!J)if(r(O)!==null)J=!0,le||(le=!0,Ne());else{var v=r(z);v!==null&&ue(oe,v.startTime-f)}}var le=!1,W=-1,te=5,pe=-1;function k(){return G?!0:!(u.unstable_now()-pef&&k());){var F=U.callback;if(typeof F=="function"){U.callback=null,T=U.priorityLevel;var re=F(U.expirationTime<=f);if(f=u.unstable_now(),typeof re=="function"){U.callback=re,fe(f),v=!0;break t}U===r(O)&&d(O),fe(f)}else d(O);U=r(O)}if(U!==null)v=!0;else{var m=r(z);m!==null&&ue(oe,m.startTime-f),v=!1}}break e}finally{U=null,T=Q,P=!1}v=void 0}}finally{v?Ne():le=!1}}}var Ne;if(typeof $=="function")Ne=function(){$(he)};else if(typeof MessageChannel<"u"){var De=new MessageChannel,L=De.port2;De.port1.onmessage=he,Ne=function(){L.postMessage(null)}}else Ne=function(){ee(he,0)};function ue(f,v){W=ee(function(){f(u.unstable_now())},v)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(f){f.callback=null},u.unstable_forceFrameRate=function(f){0>f||125F?(f.sortIndex=Q,x(z,f),r(O)===null&&f===r(z)&&(ie?(ae(W),W=-1):ie=!0,ue(oe,Q-F))):(f.sortIndex=re,x(O,f),J||P||(J=!0,le||(le=!0,Ne()))),f},u.unstable_shouldYield=k,u.unstable_wrapCallback=function(f){var v=T;return function(){var Q=T;T=v;try{return f.apply(this,arguments)}finally{T=Q}}}})(Wu)),Wu}var yf;function op(){return yf||(yf=1,$u.exports=dp()),$u.exports}var Fu={exports:{}},gt={};/** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var bf;function mp(){if(bf)return gt;bf=1;var u=ur();function x(O){var z="https://react.dev/errors/"+O;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(x){console.error(x)}}return u(),Fu.exports=mp(),Fu.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var jf;function xp(){if(jf)return Pn;jf=1;var u=op(),x=ur(),r=fp();function d(e){var t="https://react.dev/errors/"+e;if(1re||(e.current=F[re],F[re]=null,re--)}function j(e,t){re++,F[re]=e.current,e.current=t}var X=m(null),I=m(null),p=m(null),q=m(null);function w(e,t){switch(j(p,t),j(I,e),j(X,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Rm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Rm(t),e=Um(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}N(X),j(X,e)}function ne(){N(X),N(I),N(p)}function Je(e){e.memoizedState!==null&&j(q,e);var t=X.current,a=Um(t,e.type);t!==a&&(j(I,e),j(X,a))}function We(e){I.current===e&&(N(X),N(I)),q.current===e&&(N(q),Jn._currentValue=Q)}var at,Ia;function Ut(e){if(at===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);at=t&&t[1]||"",Ia=-1)":-1s||h[n]!==A[s]){var D=` `+h[n].replace(" at new "," at ");return e.displayName&&D.includes("")&&(D=D.replace("",e.displayName)),D}while(1<=n&&0<=s);break}}}finally{$e=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ut(a):""}function ki(e,t){switch(e.tag){case 26:case 27:case 5:return Ut(e.type);case 16:return Ut("Lazy");case 13:return e.child!==t&&t!==null?Ut("Suspense Fallback"):Ut("Suspense");case 19:return Ut("SuspenseList");case 0:case 15:return an(e.type,!1);case 11:return an(e.type.render,!1);case 1:return an(e.type,!0);case 31:return Ut("Activity");default:return""}}function is(e){try{var t="",a=null;do t+=ki(e,a),a=e,e=e.return;while(e);return t}catch(n){return` Error generating stack: `+n.message+` `+n.stack}}var B=Object.prototype.hasOwnProperty,ge=u.unstable_scheduleCallback,Me=u.unstable_cancelCallback,dt=u.unstable_shouldYield,ia=u.unstable_requestPaint,Xe=u.unstable_now,cs=u.unstable_getCurrentPriorityLevel,ln=u.unstable_ImmediatePriority,nn=u.unstable_UserBlockingPriority,Pt=u.unstable_NormalPriority,Yf=u.unstable_LowPriority,xr=u.unstable_IdlePriority,Vf=u.log,Xf=u.unstable_setDisableYieldValue,sn=null,wt=null;function wa(e){if(typeof Vf=="function"&&Xf(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(sn,e)}catch{}}var Tt=Math.clz32?Math.clz32:Kf,Qf=Math.log,Zf=Math.LN2;function Kf(e){return e>>>=0,e===0?32:31-(Qf(e)/Zf|0)|0}var us=256,rs=262144,ds=4194304;function Pa(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function os(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var s=0,i=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var o=n&134217727;return o!==0?(n=o&~i,n!==0?s=Pa(n):(c&=o,c!==0?s=Pa(c):a||(a=o&~e,a!==0&&(s=Pa(a))))):(o=n&~i,o!==0?s=Pa(o):c!==0?s=Pa(c):a||(a=n&~e,a!==0&&(s=Pa(a)))),s===0?0:t!==0&&t!==s&&(t&i)===0&&(i=s&-s,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:s}function cn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Jf(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hr(){var e=ds;return ds<<=1,(ds&62914560)===0&&(ds=4194304),e}function Di(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function un(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $f(e,t,a,n,s,i){var c=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var o=e.entanglements,h=e.expirationTimes,A=e.hiddenUpdates;for(a=c&~a;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var tx=/[\n"\\]/g;function qt(e){return e.replace(tx,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Bi(e,t,a,n,s,i,c,o){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ht(t)):e.value!==""+Ht(t)&&(e.value=""+Ht(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?Gi(e,c,Ht(t)):a!=null?Gi(e,c,Ht(a)):n!=null&&e.removeAttribute("value"),s==null&&i!=null&&(e.defaultChecked=!!i),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Ht(o):e.removeAttribute("name")}function Tr(e,t,a,n,s,i,c,o){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Li(e);return}a=a!=null?""+Ht(a):"",t=t!=null?""+Ht(t):a,o||t===e.value||(e.value=t),e.defaultValue=t}n=n??s,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=o?e.checked:!!n,e.defaultChecked=!!n,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),Li(e)}function Gi(e,t,a){t==="number"&&xs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Sl(e,t,a,n){if(e=e.options,t){t={};for(var s=0;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zi=!1;if(ra)try{var mn={};Object.defineProperty(mn,"passive",{get:function(){Zi=!0}}),window.addEventListener("test",mn,mn),window.removeEventListener("test",mn,mn)}catch{Zi=!1}var Ca=null,Ki=null,ps=null;function Rr(){if(ps)return ps;var e,t=Ki,a=t.length,n,s="value"in Ca?Ca.value:Ca.textContent,i=s.length;for(e=0;e=hn),Gr=" ",Yr=!1;function Vr(e,t){switch(e){case"keyup":return Cx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wl=!1;function _x(e,t){switch(e){case"compositionend":return Xr(t);case"keypress":return t.which!==32?null:(Yr=!0,Gr);case"textInput":return e=t.data,e===Gr&&Yr?null:e;default:return null}}function Ox(e,t){if(wl)return e==="compositionend"||!Ii&&Vr(e,t)?(e=Rr(),ps=Ki=Ca=null,wl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Ir(a)}}function ed(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ed(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function td(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=xs(e.document)}return t}function tc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Bx=ra&&"documentMode"in document&&11>=document.documentMode,Tl=null,ac=null,bn=null,lc=!1;function ad(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;lc||Tl==null||Tl!==xs(n)||(n=Tl,"selectionStart"in n&&tc(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),bn&&yn(bn,n)||(bn=n,n=ri(ac,"onSelect"),0>=c,s-=c,ea=1<<32-Tt(t)+s|a<ve?(Te=ce,ce=null):Te=ce.sibling;var Oe=E(y,ce,S[ve],R);if(Oe===null){ce===null&&(ce=Te);break}e&&ce&&Oe.alternate===null&&t(y,ce),g=i(Oe,g,ve),_e===null?de=Oe:_e.sibling=Oe,_e=Oe,ce=Te}if(ve===S.length)return a(y,ce),Ce&&oa(y,ve),de;if(ce===null){for(;veve?(Te=ce,ce=null):Te=ce.sibling;var Fa=E(y,ce,Oe.value,R);if(Fa===null){ce===null&&(ce=Te);break}e&&ce&&Fa.alternate===null&&t(y,ce),g=i(Fa,g,ve),_e===null?de=Fa:_e.sibling=Fa,_e=Fa,ce=Te}if(Oe.done)return a(y,ce),Ce&&oa(y,ve),de;if(ce===null){for(;!Oe.done;ve++,Oe=S.next())Oe=H(y,Oe.value,R),Oe!==null&&(g=i(Oe,g,ve),_e===null?de=Oe:_e.sibling=Oe,_e=Oe);return Ce&&oa(y,ve),de}for(ce=n(ce);!Oe.done;ve++,Oe=S.next())Oe=C(ce,y,ve,Oe.value,R),Oe!==null&&(e&&Oe.alternate!==null&&ce.delete(Oe.key===null?ve:Oe.key),g=i(Oe,g,ve),_e===null?de=Oe:_e.sibling=Oe,_e=Oe);return e&&ce.forEach(function(ip){return t(y,ip)}),Ce&&oa(y,ve),de}function Be(y,g,S,R){if(typeof S=="object"&&S!==null&&S.type===ie&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case P:e:{for(var de=S.key;g!==null;){if(g.key===de){if(de=S.type,de===ie){if(g.tag===7){a(y,g.sibling),R=s(g,S.props.children),R.return=y,y=R;break e}}else if(g.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===te&&dl(de)===g.type){a(y,g.sibling),R=s(g,S.props),zn(R,S),R.return=y,y=R;break e}a(y,g);break}else t(y,g);g=g.sibling}S.type===ie?(R=sl(S.props.children,y.mode,R,S.key),R.return=y,y=R):(R=Es(S.type,S.key,S.props,null,y.mode,R),zn(R,S),R.return=y,y=R)}return c(y);case J:e:{for(de=S.key;g!==null;){if(g.key===de)if(g.tag===4&&g.stateNode.containerInfo===S.containerInfo&&g.stateNode.implementation===S.implementation){a(y,g.sibling),R=s(g,S.children||[]),R.return=y,y=R;break e}else{a(y,g);break}else t(y,g);g=g.sibling}R=dc(S,y.mode,R),R.return=y,y=R}return c(y);case te:return S=dl(S),Be(y,g,S,R)}if(ue(S))return se(y,g,S,R);if(Ne(S)){if(de=Ne(S),typeof de!="function")throw Error(d(150));return S=de.call(S),me(y,g,S,R)}if(typeof S.then=="function")return Be(y,g,ks(S),R);if(S.$$typeof===$)return Be(y,g,Cs(y,S),R);Ds(y,S)}return typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint"?(S=""+S,g!==null&&g.tag===6?(a(y,g.sibling),R=s(g,S),R.return=y,y=R):(a(y,g),R=rc(S,y.mode,R),R.return=y,y=R),c(y)):a(y,g)}return function(y,g,S,R){try{An=0;var de=Be(y,g,S,R);return Ll=null,de}catch(ce){if(ce===ql||ce===_s)throw ce;var _e=Mt(29,ce,null,y.mode);return _e.lanes=R,_e.return=y,_e}finally{}}}var ml=zd(!0),Ed=zd(!1),Da=!1;function Nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(ke&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=zs(e),rd(e,null,a),t}return As(e,n,t,a),zs(e)}function En(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,gr(e,a)}}function Ac(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var s=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var c={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?s=i=c:i=i.next=c,a=a.next}while(a!==null);i===null?s=i=t:i=i.next=t}else s=i=t;a={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var zc=!1;function wn(){if(zc){var e=Hl;if(e!==null)throw e}}function Tn(e,t,a,n){zc=!1;var s=e.updateQueue;Da=!1;var i=s.firstBaseUpdate,c=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var h=o,A=h.next;h.next=null,c===null?i=A:c.next=A,c=h;var D=e.alternate;D!==null&&(D=D.updateQueue,o=D.lastBaseUpdate,o!==c&&(o===null?D.firstBaseUpdate=A:o.next=A,D.lastBaseUpdate=h))}if(i!==null){var H=s.baseState;c=0,D=A=h=null,o=i;do{var E=o.lane&-536870913,C=E!==o.lane;if(C?(we&E)===E:(n&E)===E){E!==0&&E===Ul&&(zc=!0),D!==null&&(D=D.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var se=e,me=o;E=t;var Be=a;switch(me.tag){case 1:if(se=me.payload,typeof se=="function"){H=se.call(Be,H,E);break e}H=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=me.payload,E=typeof se=="function"?se.call(Be,H,E):se,E==null)break e;H=U({},H,E);break e;case 2:Da=!0}}E=o.callback,E!==null&&(e.flags|=64,C&&(e.flags|=8192),C=s.callbacks,C===null?s.callbacks=[E]:C.push(E))}else C={lane:E,tag:o.tag,payload:o.payload,callback:o.callback,next:null},D===null?(A=D=C,h=H):D=D.next=C,c|=E;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;C=o,o=C.next,C.next=null,s.lastBaseUpdate=C,s.shared.pending=null}}while(!0);D===null&&(h=H),s.baseState=h,s.firstBaseUpdate=A,s.lastBaseUpdate=D,i===null&&(s.shared.lanes=0),Ga|=c,e.lanes=c,e.memoizedState=H}}function wd(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function Td(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;ei?i:8;var c=f.T,o={};f.T=o,Xc(e,!1,t,a);try{var h=s(),A=f.S;if(A!==null&&A(o,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var D=$x(h,n);_n(e,t,D,Rt(e))}else _n(e,t,n,Rt(e))}catch(H){_n(e,t,{then:function(){},status:"rejected",reason:H},Rt())}finally{v.p=i,c!==null&&o.types!==null&&(c.types=o.types),f.T=c}}function th(){}function Yc(e,t,a,n){if(e.tag!==5)throw Error(d(476));var s=io(e).queue;so(e,s,t,Q,a===null?th:function(){return co(e),a(n)})}function io(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:Q},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function co(e){var t=io(e);t.next===null&&(t=e.alternate.memoizedState),_n(e,t.next.queue,{},Rt())}function Vc(){return ft(Jn)}function uo(){return tt().memoizedState}function ro(){return tt().memoizedState}function ah(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Rt();e=Ra(a);var n=Ua(t,e,a);n!==null&&(Et(n,t,a),En(n,t,a)),t={cache:yc()},e.payload=t;return}t=t.return}}function lh(e,t,a){var n=Rt();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Xs(e)?mo(t,a):(a=cc(e,t,a,n),a!==null&&(Et(a,e,n),fo(a,t,n)))}function oo(e,t,a){var n=Rt();_n(e,t,a,n)}function _n(e,t,a,n){var s={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Xs(e))mo(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var c=t.lastRenderedState,o=i(c,a);if(s.hasEagerState=!0,s.eagerState=o,Ct(o,c))return As(e,t,s,0),Ye===null&&Ss(),!1}catch{}finally{}if(a=cc(e,t,s,n),a!==null)return Et(a,e,n),fo(a,t,n),!0}return!1}function Xc(e,t,a,n){if(n={lane:2,revertLane:Nu(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Xs(e)){if(t)throw Error(d(479))}else t=cc(e,a,n,2),t!==null&&Et(t,e,2)}function Xs(e){var t=e.alternate;return e===be||t!==null&&t===be}function mo(e,t){Gl=Hs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function fo(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,gr(e,a)}}var On={readContext:ft,use:Bs,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useLayoutEffect:Fe,useInsertionEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useSyncExternalStore:Fe,useId:Fe,useHostTransitionStatus:Fe,useFormState:Fe,useActionState:Fe,useOptimistic:Fe,useMemoCache:Fe,useCacheRefresh:Fe};On.useEffectEvent=Fe;var xo={readContext:ft,use:Bs,useCallback:function(e,t){return bt().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:Wd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ys(4194308,4,eo.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ys(4194308,4,e,t)},useInsertionEffect:function(e,t){Ys(4,2,e,t)},useMemo:function(e,t){var a=bt();t=t===void 0?null:t;var n=e();if(fl){wa(!0);try{e()}finally{wa(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=bt();if(a!==void 0){var s=a(t);if(fl){wa(!0);try{a(t)}finally{wa(!1)}}}else s=t;return n.memoizedState=n.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},n.queue=e,e=e.dispatch=lh.bind(null,be,e),[n.memoizedState,e]},useRef:function(e){var t=bt();return e={current:e},t.memoizedState=e},useState:function(e){e=Hc(e);var t=e.queue,a=oo.bind(null,be,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Bc,useDeferredValue:function(e,t){var a=bt();return Gc(a,e,t)},useTransition:function(){var e=Hc(!1);return e=so.bind(null,be,e.queue,!0,!1),bt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=be,s=bt();if(Ce){if(a===void 0)throw Error(d(407));a=a()}else{if(a=t(),Ye===null)throw Error(d(349));(we&127)!==0||Dd(n,t,a)}s.memoizedState=a;var i={value:a,getSnapshot:t};return s.queue=i,Wd(Ud.bind(null,n,i,e),[e]),n.flags|=2048,Vl(9,{destroy:void 0},Rd.bind(null,n,i,a,t),null),a},useId:function(){var e=bt(),t=Ye.identifierPrefix;if(Ce){var a=ta,n=ea;a=(n&~(1<<32-Tt(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=qs++,0<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?c.createElement("select",{is:n.is}):c.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?c.createElement(s,{is:n.is}):c.createElement(s)}}i[ot]=t,i[vt]=n;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=i;e:switch(ht(i,s,n),s){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&ga(t)}}return Ze(t),nu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&ga(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(d(166));if(e=p.current,Dl(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,s=mt,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[ot]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||km(e.nodeValue,a)),e||Oa(t,!0)}else e=di(e).createTextNode(n),e[ot]=t,t.stateNode=e}return Ze(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Dl(t),a!==null){if(e===null){if(!n)throw Error(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[ot]=t}else il(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),e=!1}else a=xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Ot(t),t):(Ot(t),null);if((t.flags&128)!==0)throw Error(d(558))}return Ze(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Dl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(d(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(d(317));s[ot]=t}else il(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),s=!1}else s=xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Ot(t),t):(Ot(t),null)}return Ot(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,s=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(s=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==s&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),$s(t,t.updateQueue),Ze(t),null);case 4:return ne(),e===null&&Eu(t.stateNode.containerInfo),Ze(t),null;case 10:return fa(t.type),Ze(t),null;case 19:if(N(et),n=t.memoizedState,n===null)return Ze(t),null;if(s=(t.flags&128)!==0,i=n.rendering,i===null)if(s)Dn(n,!1);else{if(Ie!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Us(e),i!==null){for(t.flags|=128,Dn(n,!1),e=i.updateQueue,t.updateQueue=e,$s(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)dd(a,e),a=a.sibling;return j(et,et.current&1|2),Ce&&oa(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Xe()>ei&&(t.flags|=128,s=!0,Dn(n,!1),t.lanes=4194304)}else{if(!s)if(e=Us(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,$s(t,e),Dn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!Ce)return Ze(t),null}else 2*Xe()-n.renderingStartTime>ei&&a!==536870912&&(t.flags|=128,s=!0,Dn(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Xe(),e.sibling=null,a=et.current,j(et,s?a&1|2:a&1),Ce&&oa(t,n.treeForkCount),e):(Ze(t),null);case 22:case 23:return Ot(t),wc(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),a=t.updateQueue,a!==null&&$s(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&N(rl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),fa(lt),Ze(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function uh(e,t){switch(mc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fa(lt),ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return We(t),null;case 31:if(t.memoizedState!==null){if(Ot(t),t.alternate===null)throw Error(d(340));il()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ot(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));il()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return N(et),null;case 4:return ne(),null;case 10:return fa(t.type),null;case 22:case 23:return Ot(t),wc(),e!==null&&N(rl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fa(lt),null;case 25:return null;default:return null}}function qo(e,t){switch(mc(t),t.tag){case 3:fa(lt),ne();break;case 26:case 27:case 5:We(t);break;case 4:ne();break;case 31:t.memoizedState!==null&&Ot(t);break;case 13:Ot(t);break;case 19:N(et);break;case 10:fa(t.type);break;case 22:case 23:Ot(t),wc(),e!==null&&N(rl);break;case 24:fa(lt)}}function Rn(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var s=n.next;a=s;do{if((a.tag&e)===e){n=void 0;var i=a.create,c=a.inst;n=i(),c.destroy=n}a=a.next}while(a!==s)}}catch(o){Ue(t,t.return,o)}}function La(e,t,a){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){var c=n.inst,o=c.destroy;if(o!==void 0){c.destroy=void 0,s=t;var h=a,A=o;try{A()}catch(D){Ue(s,h,D)}}}n=n.next}while(n!==i)}}catch(D){Ue(t,t.return,D)}}function Lo(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Td(t,a)}catch(n){Ue(e,e.return,n)}}}function Bo(e,t,a){a.props=xl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){Ue(e,t,n)}}function Un(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(s){Ue(e,t,s)}}function aa(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(s){Ue(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(s){Ue(e,t,s)}else a.current=null}function Go(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(s){Ue(e,e.return,s)}}function su(e,t,a){try{var n=e.stateNode;Mh(n,e.type,a,t),n[vt]=t}catch(s){Ue(e,e.return,s)}}function Yo(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Za(e.type)||e.tag===4}function iu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yo(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Za(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cu(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=ua));else if(n!==4&&(n===27&&Za(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(cu(e,t,a),e=e.sibling;e!==null;)cu(e,t,a),e=e.sibling}function Ws(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Za(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ws(e,t,a),e=e.sibling;e!==null;)Ws(e,t,a),e=e.sibling}function Vo(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ht(t,n,a),t[ot]=e,t[vt]=a}catch(i){Ue(e,e.return,i)}}var ya=!1,it=!1,uu=!1,Xo=typeof WeakSet=="function"?WeakSet:Set,rt=null;function rh(e,t){if(e=e.containerInfo,Cu=gi,e=td(e),tc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var c=0,o=-1,h=-1,A=0,D=0,H=e,E=null;t:for(;;){for(var C;H!==a||s!==0&&H.nodeType!==3||(o=c+s),H!==i||n!==0&&H.nodeType!==3||(h=c+n),H.nodeType===3&&(c+=H.nodeValue.length),(C=H.firstChild)!==null;)E=H,H=C;for(;;){if(H===e)break t;if(E===a&&++A===s&&(o=c),E===i&&++D===n&&(h=c),(C=H.nextSibling)!==null)break;H=E,E=H.parentNode}H=C}a=o===-1||h===-1?null:{start:o,end:h}}else a=null}a=a||{start:0,end:0}}else a=null;for(Mu={focusedElem:e,selectionRange:a},gi=!1,rt=t;rt!==null;)if(t=rt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,rt=e;else for(;rt!==null;){switch(t=rt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a title"))),ht(i,n,a),i[ot]=e,ut(i),n=i;break e;case"link":var c=Wm("link","href",s).get(n+(a.href||""));if(c){for(var o=0;oBe&&(c=Be,Be=me,me=c);var y=Pr(o,me),g=Pr(o,Be);if(y&&g&&(C.rangeCount!==1||C.anchorNode!==y.node||C.anchorOffset!==y.offset||C.focusNode!==g.node||C.focusOffset!==g.offset)){var S=H.createRange();S.setStart(y.node,y.offset),C.removeAllRanges(),me>Be?(C.addRange(S),C.extend(g.node,g.offset)):(S.setEnd(g.node,g.offset),C.addRange(S))}}}}for(H=[],C=o;C=C.parentNode;)C.nodeType===1&&H.push({element:C,left:C.scrollLeft,top:C.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;oa?32:a,f.T=null,a=hu,hu=null;var i=Va,c=Sa;if(ct=0,Jl=Va=null,Sa=0,(ke&6)!==0)throw Error(d(331));var o=ke;if(ke|=4,tm(i.current),Io(i,i.current,c,a),ke=o,Yn(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(sn,i)}catch{}return!0}finally{v.p=s,f.T=n,bm(e,t)}}function jm(e,t,a){t=Bt(a,t),t=Jc(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(un(e,2),la(e))}function Ue(e,t,a){if(e.tag===3)jm(e,e,a);else for(;t!==null;){if(t.tag===3){jm(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ya===null||!Ya.has(n))){e=Bt(a,e),a=No(2),n=Ua(t,a,2),n!==null&&(So(a,n,t,e),un(n,2),la(n));break}}t=t.return}}function bu(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new mh;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(a)||(ou=!0,s.add(a),e=gh.bind(null,e,t,a),t.then(e,e))}function gh(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ye===e&&(we&a)===a&&(Ie===4||Ie===3&&(we&62914560)===we&&300>Xe()-Ps?(ke&2)===0&&$l(e,0):mu|=a,Kl===we&&(Kl=0)),la(e)}function Nm(e,t){t===0&&(t=hr()),e=nl(e,t),e!==null&&(un(e,t),la(e))}function yh(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Nm(e,a)}function bh(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(a=s.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(d(314))}n!==null&&n.delete(t),Nm(e,a)}function vh(e,t){return ge(e,t)}var ii=null,Fl=null,vu=!1,ci=!1,ju=!1,Qa=0;function la(e){e!==Fl&&e.next===null&&(Fl===null?ii=Fl=e:Fl=Fl.next=e),ci=!0,vu||(vu=!0,Nh())}function Yn(e,t){if(!ju&&ci){ju=!0;do for(var a=!1,n=ii;n!==null;){if(e!==0){var s=n.pendingLanes;if(s===0)var i=0;else{var c=n.suspendedLanes,o=n.pingedLanes;i=(1<<31-Tt(42|e)+1)-1,i&=s&~(c&~o),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Em(n,i))}else i=we,i=os(n,n===Ye?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||cn(n,i)||(a=!0,Em(n,i));n=n.next}while(a);ju=!1}}function jh(){Sm()}function Sm(){ci=vu=!1;var e=0;Qa!==0&&Oh()&&(e=Qa);for(var t=Xe(),a=null,n=ii;n!==null;){var s=n.next,i=Am(n,t);i===0?(n.next=null,a===null?ii=s:a.next=s,s===null&&(Fl=a)):(a=n,(e!==0||(i&3)!==0)&&(ci=!0)),n=s}ct!==0&&ct!==5||Yn(e),Qa!==0&&(Qa=0)}function Am(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0o)break;var D=h.transferSize,H=h.initiatorType;D&&Dm(H)&&(h=h.responseEnd,c+=D*(h"u"?null:document;function Zm(e,t,a){var n=Il;if(n&&typeof t=="string"&&t){var s=qt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),Qm.has(s)||(Qm.add(s),e={rel:e,crossOrigin:a,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),ht(t,"link",e),ut(t),n.head.appendChild(t)))}}function Gh(e){Aa.D(e),Zm("dns-prefetch",e,null)}function Yh(e,t){Aa.C(e,t),Zm("preconnect",e,t)}function Vh(e,t,a){Aa.L(e,t,a);var n=Il;if(n&&e&&t){var s='link[rel="preload"][as="'+qt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+qt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+qt(a.imageSizes)+'"]')):s+='[href="'+qt(e)+'"]';var i=s;switch(t){case"style":i=Pl(e);break;case"script":i=en(e)}Zt.has(i)||(e=U({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Zt.set(i,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(Zn(i))||t==="script"&&n.querySelector(Kn(i))||(t=n.createElement("link"),ht(t,"link",e),ut(t),n.head.appendChild(t)))}}function Xh(e,t){Aa.m(e,t);var a=Il;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+qt(n)+'"][href="'+qt(e)+'"]',i=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=en(e)}if(!Zt.has(i)&&(e=U({rel:"modulepreload",href:e},t),Zt.set(i,e),a.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Kn(i)))return}n=a.createElement("link"),ht(n,"link",e),ut(n),a.head.appendChild(n)}}}function Qh(e,t,a){Aa.S(e,t,a);var n=Il;if(n&&e){var s=jl(n).hoistableStyles,i=Pl(e);t=t||"default";var c=s.get(i);if(!c){var o={loading:0,preload:null};if(c=n.querySelector(Zn(i)))o.loading=5;else{e=U({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Zt.get(i))&&Hu(e,a);var h=c=n.createElement("link");ut(h),ht(h,"link",e),h._p=new Promise(function(A,D){h.onload=A,h.onerror=D}),h.addEventListener("load",function(){o.loading|=1}),h.addEventListener("error",function(){o.loading|=2}),o.loading|=4,mi(c,t,n)}c={type:"stylesheet",instance:c,count:1,state:o},s.set(i,c)}}}function Zh(e,t){Aa.X(e,t);var a=Il;if(a&&e){var n=jl(a).hoistableScripts,s=en(e),i=n.get(s);i||(i=a.querySelector(Kn(s)),i||(e=U({src:e,async:!0},t),(t=Zt.get(s))&&qu(e,t),i=a.createElement("script"),ut(i),ht(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function Kh(e,t){Aa.M(e,t);var a=Il;if(a&&e){var n=jl(a).hoistableScripts,s=en(e),i=n.get(s);i||(i=a.querySelector(Kn(s)),i||(e=U({src:e,async:!0,type:"module"},t),(t=Zt.get(s))&&qu(e,t),i=a.createElement("script"),ut(i),ht(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function Km(e,t,a,n){var s=(s=p.current)?oi(s):null;if(!s)throw Error(d(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Pl(a.href),a=jl(s).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Pl(a.href);var i=jl(s).hoistableStyles,c=i.get(e);if(c||(s=s.ownerDocument||s,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,c),(i=s.querySelector(Zn(e)))&&!i._p&&(c.instance=i,c.state.loading=5),Zt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Zt.set(e,a),i||Jh(s,e,a,c.state))),t&&n===null)throw Error(d(528,""));return c}if(t&&n!==null)throw Error(d(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=en(a),a=jl(s).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,e))}}function Pl(e){return'href="'+qt(e)+'"'}function Zn(e){return'link[rel="stylesheet"]['+e+"]"}function Jm(e){return U({},e,{"data-precedence":e.precedence,precedence:null})}function Jh(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),ht(t,"link",a),ut(t),e.head.appendChild(t))}function en(e){return'[src="'+qt(e)+'"]'}function Kn(e){return"script[async]"+e}function $m(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+qt(a.href)+'"]');if(n)return t.instance=n,ut(n),n;var s=U({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ut(n),ht(n,"style",s),mi(n,a.precedence,e),t.instance=n;case"stylesheet":s=Pl(a.href);var i=e.querySelector(Zn(s));if(i)return t.state.loading|=4,t.instance=i,ut(i),i;n=Jm(a),(s=Zt.get(s))&&Hu(n,s),i=(e.ownerDocument||e).createElement("link"),ut(i);var c=i;return c._p=new Promise(function(o,h){c.onload=o,c.onerror=h}),ht(i,"link",n),t.state.loading|=4,mi(i,a.precedence,e),t.instance=i;case"script":return i=en(a.src),(s=e.querySelector(Kn(i)))?(t.instance=s,ut(s),s):(n=a,(s=Zt.get(i))&&(n=U({},a),qu(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),ut(s),ht(s,"link",n),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,mi(n,a.precedence,e));return t.instance}function mi(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,i=s,c=0;c title"):null)}function $h(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Im(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Wh(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var s=Pl(n.href),i=t.querySelector(Zn(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=xi.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,ut(i);return}i=t.ownerDocument||t,n=Jm(n),(s=Zt.get(s))&&Hu(n,s),i=i.createElement("link"),ut(i);var c=i;c._p=new Promise(function(o,h){c.onload=o,c.onerror=h}),ht(i,"link",n),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=xi.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Lu=0;function Fh(e,t){return e.stylesheets&&e.count===0&&pi(e,e.stylesheets),0Lu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function xi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)pi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var hi=null;function pi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hi=new Map,t.forEach(Ih,e),hi=null,xi.call(e))}function Ih(e,t){if(!(t.state.loading&4)){var a=hi.get(e);if(a)var n=a.get(null);else{a=new Map,hi.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(x){console.error(x)}}return u(),Ju.exports=xp(),Ju.exports}var pp=hp();/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _f=(...u)=>u.filter((x,r,d)=>!!x&&x.trim()!==""&&d.indexOf(x)===r).join(" ").trim();/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gp=u=>u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yp=u=>u.replace(/^([A-Z])|[\s-_]+(\w)/g,(x,r,d)=>d?d.toUpperCase():r.toLowerCase());/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sf=u=>{const x=yp(u);return x.charAt(0).toUpperCase()+x.slice(1)};/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Iu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bp=u=>{for(const x in u)if(x.startsWith("aria-")||x==="role"||x==="title")return!0;return!1},vp=b.createContext({}),jp=()=>b.useContext(vp),Np=b.forwardRef(({color:u,size:x,strokeWidth:r,absoluteStrokeWidth:d,className:M="",children:_,iconNode:K,...Z},O)=>{const{size:z=24,strokeWidth:Y=2,absoluteStrokeWidth:U=!1,color:T="currentColor",className:P=""}=jp()??{},J=d??U?Number(r??Y)*24/Number(x??z):r??Y;return b.createElement("svg",{ref:O,...Iu,width:x??z??Iu.width,height:x??z??Iu.height,stroke:u??T,strokeWidth:J,className:_f("lucide",P,M),...!_&&!bp(Z)&&{"aria-hidden":"true"},...Z},[...K.map(([ie,G])=>b.createElement(ie,G)),...Array.isArray(_)?_:[_]])});/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ee=(u,x)=>{const r=b.forwardRef(({className:d,...M},_)=>b.createElement(Np,{ref:_,iconNode:x,className:_f(`lucide-${gp(Sf(u))}`,`lucide-${u}`,d),...M}));return r.displayName=Sf(u),r};/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sp=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],_i=Ee("activity",Sp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ap=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Of=Ee("bell",Ap);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zp=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Ep=Ee("boxes",zp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wp=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V9",key:"uvy0l4"}],["path",{d:"M19 21V3",key:"11j9sm"}]],Tp=Ee("chart-no-axes-column-increasing",wp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cp=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zi=Ee("chevron-down",Cp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mp=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],_p=Ee("chevron-left",Mp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Op=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],kf=Ee("chevron-right",Op);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kp=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Dp=Ee("circle-check",kp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rp=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Up=Ee("circle-question-mark",Rp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hp=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],qp=Ee("circle-x",Hp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lp=[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]],Bp=Ee("container",Lp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gp=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],er=Ee("copy",Gp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yp=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],sa=Ee("ellipsis",Yp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Vp=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],rr=Ee("external-link",Vp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xp=[["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M4 12v6",key:"bg1pfk"}],["path",{d:"M4 14h2",key:"1sf9f8"}],["path",{d:"M9.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v4",key:"d56i0q"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Df=Ee("file-key",Xp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qp=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],Zp=Ee("fingerprint-pattern",Qp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kp=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Jp=Ee("info",Kp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $p=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Rf=Ee("key-round",$p);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wp=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Fp=Ee("layout-dashboard",Wp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ip=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Uf=Ee("lock",Ip);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pp=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],eg=Ee("log-out",Pp);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tg=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],ag=Ee("megaphone",tg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lg=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],ng=Ee("network",lg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sg=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ls=Ee("play",sg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ig=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],yt=Ee("plus",ig);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cg=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],ug=Ee("rocket",cg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rg=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Ei=Ee("rotate-ccw",rg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dg=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ns=Ee("search",dg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const og=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],Af=Ee("server-cog",og);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mg=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],dr=Ee("settings-2",mg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fg=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ai=Ee("shield-check",fg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xg=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],or=Ee("sliders-horizontal",xg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Hf=Ee("square",hg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pg=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],mr=Ee("trash-2",pg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gg=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],yg=Ee("triangle-alert",gg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bg=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],vg=Ee("users",bg);/** * @license lucide-react v1.21.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jg=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ng=Ee("x",jg),zf=[{label:"플랫폼",items:[{label:"대시보드",icon:Fp,active:!0},{label:"런처",icon:ug,children:[{label:"버전 관리"},{label:"공통 설정"},{label:"앱 연결"}]},{label:"어플리케이션",icon:Ep,children:[{label:"앱 관리"},{label:"소스 관리"},{label:"빌드 관리"},{label:"릴리즈 관리"},{label:"배포 관리"},{label:"마이그레이션"}]},{label:"플랫폼 런타임",icon:Bp,children:[{label:"런타임 구성"},{label:"로그/이벤트"},{label:"장비 제어"}]},{label:"테일스케일",icon:ng,children:[{label:"노드 현황"},{label:"라우트"},{label:"ACL"},{label:"연결 진단"}]},{label:"Agent",icon:Ai,children:[{label:"장비 등록"},{label:"설치 상태"},{label:"SSH 키 배포"},{label:"Workspace 설정"},{label:"원격 명령"}]},{label:"플랫폼 게이트웨이",icon:Af,children:[{label:"연결 상태"},{label:"Agent 관리"},{label:"장비 동기화"}]}]},{label:"운영",items:[{label:"관리자 관리",icon:Ai},{label:"사용자/세션",icon:vg},{label:"라이센스",icon:Df},{label:"공지사항",icon:ag}]},{label:"시스템",items:[{label:"모니터링",icon:Tp},{label:"정책",icon:Ai},{label:"인프라",icon:Af}]}],Sg=[{label:"활성 앱",value:"10",delta:"+0",hint:"런처 등록 앱 10개",tone:"emerald"},{label:"접속 사용자",value:"1,284",delta:"+9.8%",hint:"활성 세션 176개",tone:"sky"},{label:"라이센스 사용률",value:"72%",delta:"+4%",hint:"468 / 650 시트",tone:"amber"},{label:"런타임 정상률",value:"96.4%",delta:"-1.2%",hint:"주의 워크로드 3개",tone:"rose"}],Ag=[{name:"Autonomy Studio Launcher",appKey:"launcher",latestVersion:"1.0.1",minimumSupportedVersion:"1.0.0",status:"활성",artifact:"autonomy-studio-launcher-1.0.1.deb",downloadUrl:"https://testfile.autonomystudio.net/media/platform/autonomy-studio-launcher-1.0.1.deb",releaseNotes:"런처 업데이트 확인 및 앱별 설치 상태 판단 기능이 추가되었습니다."}],es=[{name:"공통 인증 서버",key:"AUTH_BASE_URL",value:"http://localhost:4100",type:"endpoint",status:"활성",description:"atnmy-stdo-auth. 로그인, 토큰 갱신, 사용자 프로필, handoff 토큰을 제공하는 공통 인증 API"},{name:"인증 DB",key:"AUTH_DATABASE_URL",value:"postgres://atnmy_auth:***@auth-postgres:5432/atnmy_auth",type:"database",status:"활성",description:"users, refresh_tokens, handoff_tokens, licenses, user_app_roles, organizations 저장소"},{name:"인증 Redis",key:"AUTH_REDIS_URL",value:"redis://auth-redis:6379",type:"cache",status:"활성",description:"이메일 인증 코드, 비밀번호 재설정 코드, 로그인 실패 제한 상태를 저장"},{name:"JWT Issuer",key:"AUTH_JWT_ISSUER",value:"atnmy-stdo-auth",type:"security",status:"활성",description:"공통 인증 서버가 발급하는 access token issuer"},{name:"Refresh Cookie",key:"AUTH_REFRESH_COOKIE_NAME",value:"atnmy_refresh",type:"security",status:"활성",description:"refresh token 저장용 HttpOnly 쿠키 이름. SameSite=Lax, Path=/ 기준"},{name:"Handoff Token",key:"AUTH_HANDOFF_TOKEN_TTL_SECONDS",value:"60",type:"security",status:"활성",description:"런처에서 앱으로 인증 상태를 넘길 때 사용하는 일회성 토큰 TTL"},{name:"CORS Origins",key:"AUTH_CORS_ORIGINS",value:"5173,5174,5175,5176,4200,4300,4400",type:"cors",status:"활성",description:"런처와 앱 개발 포트에서 인증 API 호출을 허용하는 origin 목록"},{name:"인증 메일",key:"AUTH_SMTP_HOST",value:"smtp.gmail.com:587",type:"email",status:"활성",description:"회원가입 이메일 인증 코드와 비밀번호 재설정 코드 발송"},{name:"플랫폼 게이트웨이",key:"PLATFORM_GATEWAY_BASE_URL",value:"https://platform-gateway.autonomystudio.local",type:"endpoint",status:"활성",description:"런처가 클러스터, 테일스케일, 원격 실행 상태를 조회할 때 거치는 공통 게이트웨이"},{name:"런처 API",key:"LAUNCHER_API_BASE_URL",value:"https://launcher-api.autonomystudio.local",type:"endpoint",status:"활성",description:"앱 목록, 런처 버전, 공지, 다운로드 정보를 제공하는 API"},{name:"플랫폼 Gitea",key:"PLATFORM_GITEA_BASE_URL",value:"https://gitea.autonomystudio.local",type:"repository",status:"활성",description:"런처와 앱별 소스, 버전 태그, 릴리즈 산출물 기준 저장소. 앱 내부 업무용 저장소와 분리"},{name:"플랫폼 Gitea 토큰",key:"PLATFORM_GITEA_TOKEN_REF",value:"secret/platform-gitea-readonly",type:"secret",status:"활성",description:"앱 버전별 소스 조회와 릴리즈 메타데이터 수집에 사용하는 읽기 권한 토큰"},{name:"테일스케일 연결",key:"TAILSCALE_STATUS_PROVIDER",value:"platform-gateway/tailscale",type:"integration",status:"활성",description:"런처가 테일스케일 세부 설정을 직접 관리하지 않고 게이트웨이에서 연결 상태만 조회"},{name:"파일 서버",key:"DOWNLOAD_BASE_URL",value:"https://testfile.autonomystudio.net/media/platform",type:"storage",status:"활성",description:"런처와 앱 설치 파일을 제공하는 다운로드 베이스 URL"},{name:"라이센스 검증",key:"LICENSE_CHECK_MODE",value:"online",type:"policy",status:"활성",description:"런처 앱 실행 전 라이센스와 앱 권한 검증 방식"}],zg=[{group:"상태",method:"GET",path:"/health",purpose:"서비스 및 Redis 상태 확인",auth:"없음"},{group:"인증",method:"POST",path:"/auth/login",purpose:"access token 발급 및 refresh cookie 설정",auth:"없음"},{group:"인증",method:"POST",path:"/auth/refresh",purpose:"refresh token 회전 및 access token 재발급",auth:"쿠키/토큰"},{group:"인증",method:"POST",path:"/auth/logout",purpose:"refresh token 폐기 및 쿠키 제거",auth:"쿠키/토큰"},{group:"사용자",method:"GET",path:"/auth/me",purpose:"현재 사용자, 앱 권한, 라이센스, 소속 조회",auth:"Bearer"},{group:"앱 연결",method:"POST",path:"/auth/handoff",purpose:"런처에서 앱으로 넘길 handoff token 생성",auth:"Bearer"},{group:"앱 연결",method:"POST",path:"/auth/handoff/exchange",purpose:"handoff token을 앱용 token pair로 교환",auth:"없음"},{group:"관리자",method:"POST",path:"/auth/admin/users",purpose:"관리자 사용자 생성, 소속, 라이센스 할당",auth:"ADMIN"},{group:"관리자",method:"GET",path:"/auth/admin/organizations",purpose:"조직 목록 조회",auth:"ADMIN"}],tr=[{name:"ADS IDE",key:"ADS IDE",status:"활성",version:"1.1.0",containers:2,cpu:52,memory:68,gitea:"./apps/ads-ide/ads-ide-fe",release:"ADS-IDE-1.1.0.AppImage",secrets:8,launcherLinked:!0,launcherOrder:1,launchUrl:"Ingress 예정 / localhost:5175"},{name:"LMS",key:"LMS",status:"활성",version:"1.0.0",containers:3,cpu:74,memory:81,gitea:"./apps/lms/lms-fe",release:"LMS-1.0.0.AppImage",secrets:11,launcherLinked:!0,launcherOrder:2,launchUrl:"Ingress 예정 / localhost:5176"},{name:"Data Management",key:"Data Management",status:"준비중",version:"1.0.0",containers:0,cpu:31,memory:48,gitea:"미연결",release:"data-management",secrets:0,launcherLinked:!1,launcherOrder:null,launchUrl:"미설정"},{name:"FMS",key:"FMS",status:"활성",version:"2.3.1",containers:0,cpu:63,memory:57,gitea:"미연결",release:"fms",secrets:0,launcherLinked:!0,launcherOrder:3,launchUrl:"미설정"},{name:"ADS Education",key:"ADS Education",status:"활성",version:"1.0.0",containers:0,cpu:18,memory:22,gitea:"미연결",release:"ads-education",secrets:0,launcherLinked:!0,launcherOrder:4,launchUrl:"미설정"},{name:"Calibration",key:"Calibration",status:"활성",version:"1.0.4",containers:0,cpu:21,memory:26,gitea:"미연결",release:"calibration",secrets:0,launcherLinked:!1,launcherOrder:null,launchUrl:"미설정"},{name:"HDMAP Builder",key:"HDMAP Builder",status:"활성",version:"1.0.0",containers:0,cpu:15,memory:19,gitea:"미연결",release:"hdmap-builder",secrets:0,launcherLinked:!1,launcherOrder:null,launchUrl:"미설정"}],Ef=[{code:"FREE",name:"Free",description:"기본 무료 라이선스",defaultDurationDays:365,assigned:182,activeUsers:164,expiringSoon:18,status:"활성"},{code:"EDUCATION",name:"Education",description:"교육기관용 라이선스",defaultDurationDays:365,assigned:296,activeUsers:271,expiringSoon:21,status:"활성"},{code:"PROFESSIONAL",name:"Professional",description:"전문가용 라이선스",defaultDurationDays:365,assigned:172,activeUsers:158,expiringSoon:3,status:"활성"}],wf=[{user:"admin@futuredrive.net",name:"ATNMY Studio Admin",code:"PROFESSIONAL",licenseName:"Professional",startsAt:"2026년 6월 1일",expiresAt:"무기한",assignedBy:"system",status:"활성"},{user:"teacher@futuredrive.net",name:"Future Drive Teacher",code:"EDUCATION",licenseName:"Education",startsAt:"2026년 6월 2일",expiresAt:"2027년 6월 2일",assignedBy:"admin@futuredrive.net",status:"활성"},{user:"teacher@yu.ac.kr",name:"YU Instructor",code:"EDUCATION",licenseName:"Education",startsAt:"2026년 6월 2일",expiresAt:"2027년 6월 2일",assignedBy:"admin@futuredrive.net",status:"활성"},{user:"student01@example.com",name:"student01",code:"FREE",licenseName:"Free",startsAt:"2026년 6월 5일",expiresAt:"2027년 6월 5일",assignedBy:"system",status:"활성"},{user:"student03@example.com",name:"student03",code:"FREE",licenseName:"Free",startsAt:"2026년 6월 5일",expiresAt:"2027년 6월 5일",assignedBy:"system",status:"활성"},{user:"ops@autonomystudio.local",name:"ops",code:"PROFESSIONAL",licenseName:"Professional",startsAt:"2026년 6월 10일",expiresAt:"2027년 6월 10일",assignedBy:"admin@futuredrive.net",status:"활성"},{user:"viewer@example.com",name:"viewer",code:"FREE",licenseName:"Free",startsAt:"2025년 7월 1일",expiresAt:"2026년 7월 1일",assignedBy:"system",status:"주의"}],Eg=[{namespace:"stdo-launcher",app:"Autonomy Studio Launcher",workload:"Deployment/launcher-api",pod:"launcher-api-7c9d85f9b7-q2x4m",image:"registry.local/atnmy-stdo-v2-be:1.0.1",replicas:"2/2",node:"cluster-master-01",cpu:43,memory:62,restarts:0,age:"3d",status:"실행 중"},{namespace:"stdo-launcher",app:"Autonomy Studio Launcher",workload:"StatefulSet/launcher-postgres",pod:"launcher-postgres-0",image:"postgres:16",replicas:"1/1",node:"cluster-master-01",cpu:24,memory:39,restarts:0,age:"3d",status:"실행 중"},{namespace:"stdo-lms",app:"LMS",workload:"Deployment/lms-api",pod:"lms-api-5f6db8d675-jt2xk",image:"registry.local/lms-be:1.0.0",replicas:"2/2",node:"cluster-worker-01",cpu:67,memory:59,restarts:1,age:"18h",status:"실행 중"},{namespace:"stdo-lms",app:"LMS",workload:"Deployment/lms-adm-web",pod:"lms-adm-web-778b4d4f9b-bxz92",image:"registry.local/lms-adm-fe:0.1.0",replicas:"1/1",node:"cluster-worker-02",cpu:31,memory:44,restarts:0,age:"18h",status:"실행 중"},{namespace:"stdo-lms",app:"LMS",workload:"StatefulSet/lms-postgres",pod:"lms-postgres-0",image:"postgres:16",replicas:"1/1",node:"cluster-worker-01",cpu:18,memory:71,restarts:0,age:"18h",status:"실행 중"},{namespace:"stdo-ads-ide",app:"ADS IDE",workload:"Deployment/ads-ide-api",pod:"ads-ide-api-84b8787d7d-r8qkp",image:"registry.local/ads-ide-be:0.1.0",replicas:"1/1",node:"cluster-worker-02",cpu:89,memory:84,restarts:4,age:"7h",status:"주의"}],as=[{name:"cluster-master-01",ip:"100.64.0.10",role:"control-plane",user:"ops@autonomystudio.local",routes:"10.42.0.0/16, 10.43.0.0/16",lastSeen:"1분 전",status:"활성"},{name:"cluster-worker-01",ip:"100.64.0.11",role:"worker",user:"ops@autonomystudio.local",routes:"-",lastSeen:"3분 전",status:"활성"},{name:"gpu-runner-02",ip:"100.64.20.2",role:"gpu-runner",user:"mlops@autonomystudio.local",routes:"-",lastSeen:"오프라인",status:"주의"}],wg=[{name:"Tailnet",key:"TAILSCALE_TAILNET",value:"autonomy-studio.ts.net",status:"활성",description:"런처와 클러스터 운영 노드가 연결되는 tailnet"},{name:"Subnet Routes",key:"TAILSCALE_ADVERTISE_ROUTES",value:"10.42.0.0/16,10.43.0.0/16",status:"활성",description:"Pod/Service CIDR 접근용 광고 라우트"},{name:"Platform Gateway 연동",key:"TAILSCALE_GATEWAY_PROVIDER",value:"platform-gateway",status:"활성",description:"런처에는 연결 상태만 제공하고 세부 조회는 플랫폼 게이트웨이가 담당"}],Tg=[{name:"Headscale Server",endpoint:"https://headscale.autonomystudio.local",role:"노드/ACL 동기화",status:"활성",lastSync:"1분 전"},{name:"Autonomy Agent",endpoint:"agent heartbeat stream",role:"Agent 등록/상태 집계",status:"활성",lastSync:"30초 전"},{name:"Platform Gitea",endpoint:"https://gitea.autonomystudio.local",role:"런처/앱 소스 버전 저장소",status:"활성",lastSync:"5분 전"},{name:"Platform Runtime",endpoint:"runtime command bus",role:"원격 명령/로그/이벤트",status:"주의",lastSync:"12분 전"}],qf=[{name:"lab-mkmini-01",account:"student01@example.com",status:"활성",workspace:"~/autonomy-studio/workspaces",sshKey:"배포됨",lastSeen:"2분 전"},{name:"lab-f1tenth-03",account:"student03@example.com",status:"활성",workspace:"~/autonomy-studio/workspaces",sshKey:"배포됨",lastSeen:"4분 전"},{name:"sim-runner-02",account:"instructor@example.com",status:"주의",workspace:"/opt/studio/workspaces",sshKey:"대기",lastSeen:"35분 전"}],Cg=[{target:"lab-mkmini-01",command:"workspace sync",status:"완료",requestedBy:"park.ops",time:"8분 전"},{target:"lab-f1tenth-03",command:"build module",status:"실행 중",requestedBy:"kim.admin",time:"3분 전"},{target:"sim-runner-02",command:"collect logs",status:"주의",requestedBy:"choi.dev",time:"22분 전"}],ar=[{scope:"런처",title:"v1.0.1 업데이트 안내",audience:"전체 사용자",status:"게시됨",date:"2025년 4월 23일"},{scope:"ADS IDE",title:"정기 점검 안내",audience:"ADS IDE 사용자",status:"게시됨",date:"2025년 4월 10일"},{scope:"LMS",title:"신규 과제 검토 요청",audience:"강사",status:"게시됨",date:"2026년 6월 2일"},{scope:"런처",title:"로그인 화면 점검 배너",audience:"전체 사용자",status:"예약됨",date:"2026년 6월 24일"},{scope:"FMS",title:"FMS 릴리즈 사전 안내",audience:"FMS 사용자",status:"초안",date:"2026년 6월 25일"},{scope:"ADS Education",title:"교육 콘텐츠 업데이트",audience:"ADS Education 사용자",status:"게시됨",date:"2026년 6월 12일"},{scope:"Data Management",title:"베타 신청 접수",audience:"운영자",status:"초안",date:"2026년 6월 18일"},{scope:"런처",title:"구버전 런처 지원 종료 안내",audience:"전체 사용자",status:"예약됨",date:"2026년 7월 1일"},{scope:"Calibration",title:"캘리브레이션 템플릿 변경",audience:"Calibration 사용자",status:"게시됨",date:"2026년 6월 9일"},{scope:"HDMAP Builder",title:"HDMAP Builder 등록 예정",audience:"운영자",status:"초안",date:"2026년 6월 28일"},{scope:"런처",title:"파일 서버 점검 공지",audience:"전체 사용자",status:"게시됨",date:"2026년 6월 15일"},{scope:"ADS IDE",title:"IDE 확장 기능 업데이트",audience:"ADS IDE 사용자",status:"예약됨",date:"2026년 6월 30일"}],Mg=[{icon:Of,label:"확인이 필요한 워크로드 3개"},{icon:Df,label:"14일 내 만료되는 라이센스 42개"},{icon:Rf,label:"이번 주 교체된 시크릿 5개"}];function Pe(...u){return u.filter(Boolean).join(" ")}function xe({children:u,className:x}){return l.jsx("section",{className:Pe("rounded-lg border border-border bg-card shadow-sm",x),children:u})}function Ge({title:u,description:x,action:r,className:d}){return l.jsxs("div",{className:Pe("flex items-start justify-between gap-4 border-b border-border px-5 py-4",d),children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"truncate text-sm font-semibold text-foreground",children:u}),x?l.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:x}):null]}),r?l.jsx("div",{className:"shrink-0",children:r}):null]})}function V({children:u,variant:x="default",className:r,...d}){const M={default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",outline:"border border-border bg-background hover:bg-accent hover:text-accent-foreground"};return l.jsx("button",{type:"button",...d,className:Pe("inline-flex h-8 items-center justify-center gap-1.5 rounded-md px-2.5 text-[13px] font-bold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-45",M[x],r),children:u})}function Se({children:u,tone:x="neutral"}){const r={neutral:"border-border bg-muted text-muted-foreground",green:"border-emerald-500/30 bg-emerald-500/10 text-emerald-300",amber:"border-amber-500/30 bg-amber-500/10 text-amber-300",red:"border-rose-500/30 bg-rose-500/10 text-rose-300",blue:"border-sky-500/30 bg-sky-500/10 text-sky-300",violet:"border-violet-500/30 bg-violet-500/10 text-violet-300"};return l.jsx("span",{className:Pe("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-medium",r[x]),children:u})}function wi({value:u,tone:x="primary"}){const r={primary:"bg-primary",green:"bg-emerald-400",amber:"bg-amber-400",red:"bg-rose-400"};return l.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-muted",children:l.jsx("div",{className:Pe("h-full rounded-full",r[x]),style:{width:`${Math.min(u,100)}%`}})})}function Oi({title:u,description:x,rows:r,columns:d,filters:M=[],searchPlaceholder:_="검색",getSearchText:K,getRowKey:Z,pageSize:O=8,minWidth:z=980,loading:Y=!1}){const[U,T]=b.useState(""),[P,J]=b.useState({}),[ie,G]=b.useState(1),ee=b.useMemo(()=>{const le=U.trim().toLowerCase();return r.filter(W=>{const te=le?K(W).toLowerCase().includes(le):!0,pe=M.every(k=>{const he=P[k.key];return!he||k.getValue(W)===he});return te&&pe})},[P,M,K,r,U]),ae=Math.max(1,Math.ceil(ee.length/O)),$=Math.min(ie,ae),fe=ee.slice(($-1)*O,$*O),oe=(le,W)=>{J(te=>({...te,[le]:W})),G(1)};return l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsxs("div",{className:"flex flex-col gap-3 border-b border-border px-5 py-4 lg:flex-row lg:items-center lg:justify-between",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"truncate text-sm font-semibold text-foreground",children:u}),x?l.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:x}):null]}),l.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[l.jsxs("div",{className:"relative w-full max-w-md lg:w-80",children:[l.jsx(ns,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),l.jsx("input",{className:"h-9 w-full rounded-md border border-input bg-background pl-9 pr-3 text-sm outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-ring",placeholder:_,value:U,onChange:le=>{T(le.target.value),G(1)}})]}),M.length?l.jsx("div",{className:"flex flex-wrap gap-2",children:M.map(le=>l.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[le.label,l.jsxs("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground outline-none focus:ring-2 focus:ring-ring",value:P[le.key]??"",onChange:W=>oe(le.key,W.target.value),children:[l.jsx("option",{value:"",children:"전체"}),le.options.map(W=>l.jsx("option",{value:W.value,children:W.label},W.value))]})]},le.key))}):null]})]}),l.jsx("div",{className:"max-h-[560px] overflow-x-auto overflow-y-auto",children:l.jsxs("table",{className:"w-full text-left text-sm",style:{minWidth:z},children:[l.jsx("thead",{className:"sticky top-0 z-10 border-b border-border bg-card text-xs text-muted-foreground",children:l.jsx("tr",{children:d.map(le=>l.jsx("th",{className:le.className??"px-5 py-3 font-medium",children:le.header},le.key))})}),l.jsx("tbody",{className:"divide-y divide-border",children:!Y&&fe.map(le=>l.jsx("tr",{className:"hover:bg-muted/20",children:d.map(W=>l.jsx("td",{className:"px-5 py-4",children:W.cell(le)},W.key))},Z(le)))})]})}),l.jsxs("div",{className:"flex items-center justify-between gap-4 border-t border-border px-5 py-4 text-sm",children:[l.jsx("span",{className:"text-xs text-muted-foreground",children:Y?"불러오는 중":`총 ${ee.length}건 · ${$} / ${ae}`}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(V,{variant:"outline",className:"h-8 px-3 text-[13px]",disabled:$<=1,onClick:()=>G(le=>Math.max(1,le-1)),children:[l.jsx(_p,{className:"size-4"}),"이전"]}),l.jsxs(V,{variant:"outline",className:"h-8 px-3 text-[13px]",disabled:$>=ae,onClick:()=>G(le=>Math.min(ae,le+1)),children:["다음",l.jsx(kf,{className:"size-4"})]})]})]})]})}const Lf=b.createContext(null),_g={success:{icon:l.jsx(Dp,{className:"size-4"}),className:"border-emerald-500/25 bg-emerald-950/85",iconClassName:"text-emerald-300"},error:{icon:l.jsx(qp,{className:"size-4"}),className:"border-rose-500/25 bg-rose-950/85",iconClassName:"text-rose-300"},info:{icon:l.jsx(Jp,{className:"size-4"}),className:"border-sky-500/25 bg-sky-950/85",iconClassName:"text-sky-300"},warning:{icon:l.jsx(yg,{className:"size-4"}),className:"border-amber-500/25 bg-amber-950/85",iconClassName:"text-amber-300"}};function Og({children:u}){const[x,r]=b.useState([]),d=b.useRef(new Map),M=b.useCallback(Z=>{const O=d.current.get(Z);O&&window.clearTimeout(O),d.current.delete(Z),r(z=>z.filter(Y=>Y.id!==Z))},[]),_=b.useCallback(({type:Z="info",title:O="",message:z,duration:Y=3500})=>{const U=`${Date.now()}-${Math.random().toString(36).slice(2,9)}`,T={id:U,type:Z,title:O,message:z};if(r(P=>[T,...P].slice(0,4)),Y>0){const P=window.setTimeout(()=>M(U),Y);d.current.set(U,P)}return U},[M]);b.useEffect(()=>()=>{d.current.forEach(Z=>window.clearTimeout(Z)),d.current.clear()},[]);const K=b.useMemo(()=>({toast:_,dismissToast:M}),[_,M]);return l.jsxs(Lf.Provider,{value:K,children:[u,l.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[80] flex w-[min(calc(100vw-2rem),380px)] flex-col gap-2",children:x.map(Z=>{const O=_g[Z.type];return l.jsxs("div",{className:Pe("toast-enter pointer-events-auto flex gap-3 rounded-lg border px-4 py-3 text-[14px] text-foreground shadow-2xl shadow-black/30 backdrop-blur-md",O.className),children:[l.jsx("div",{className:Pe("mt-1 shrink-0",O.iconClassName),children:O.icon}),l.jsxs("div",{className:"min-w-0 flex-1 pt-0.5",children:[Z.title?l.jsx("p",{className:"text-sm font-bold leading-5",children:Z.title}):null,l.jsx("p",{className:"break-words text-[13px] leading-5 text-muted-foreground",children:Z.message})]}),l.jsx("button",{type:"button",className:"mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground","aria-label":"토스트 닫기",onClick:()=>M(Z.id),children:l.jsx(Ng,{className:"size-3.5"})})]},Z.id)})})]})}function Ea(){const u=b.useContext(Lf);if(!u)throw new Error("useToast는 ToastProvider 내부에서 사용해야 합니다.");return u}const ts={대시보드:"dashboard","버전 관리":"launcherVersions","앱 연결":"launcherApps","공통 설정":"launcherCommonSettings",공지사항:"notices","앱 관리":"appManagement","소스 관리":"appSources","빌드 관리":"appBuilds","릴리즈 관리":"appReleases","배포 관리":"appDeployments",마이그레이션:"appMigrations","연결 상태":"gatewayStatus","Agent 관리":"gatewayAgents","장비 동기화":"gatewayDevices","노드 현황":"tailscaleStatus",라우트:"tailscaleRoutes",ACL:"tailscaleAcl","연결 진단":"tailscaleDiagnostics","장비 등록":"agentRegistration","설치 상태":"agentInstallStatus","SSH 키 배포":"agentSshKeys","Workspace 설정":"agentWorkspace","원격 명령":"agentCommands","런타임 구성":"runtimeConfig","로그/이벤트":"runtimeLogs","장비 제어":"runtimeDeviceControl","관리자 관리":"adminManagement","사용자/세션":"userSessions",라이센스:"licenses"},je="http://localhost:4500/api",kg="http://localhost:3000",Dg="ssh://git@localhost:2222",Rg={활성:"green","실행 중":"green",게시됨:"green",카나리:"blue",예약됨:"blue",점검:"amber",주의:"amber",드레이닝:"amber",준비중:"amber",배포됨:"green",초안:"neutral",대기:"neutral",만료:"neutral",종료:"neutral","세션 없음":"neutral",비활성:"neutral","지원 종료":"red",잠김:"red",구성완료:"green",검토필요:"amber",완료:"green",성공:"green",실패:"red",취소:"neutral"};function Ve(u){return Rg[u]??"neutral"}function Tf(u){return{dev:"개발",stage:"검수",prod:"운영"}[u]??u}const Bf="studio_admin_selected_app_id";function Ti(){try{return window.localStorage.getItem(Bf)||""}catch{return""}}function pt(u){if(u)try{window.localStorage.setItem(Bf,u)}catch{}}function gl(u,x=""){var d;if(x&&u.some(M=>M.id===x))return x;const r=Ti();return r&&u.some(M=>M.id===r)?r:((d=u[0])==null?void 0:d.id)||""}function Ug({activeView:u,menuSearch:x,onViewChange:r}){const[d,M]=b.useState({}),_=x.trim().toLowerCase(),K=_?zf.map(Z=>{const z=Z.label.toLowerCase().includes(_)?Z.items:Z.items.flatMap(Y=>{const U=Y.label.toLowerCase().includes(_);if("children"in Y&&Y.children){const T=Y.children.filter(P=>P.label.toLowerCase().includes(_));return U?[Y]:T.length?[{...Y,children:T}]:[]}return U?[Y]:[]});return{...Z,items:z}}).filter(Z=>Z.items.length>0):zf;return l.jsxs("aside",{className:"fixed inset-y-0 left-0 hidden w-72 flex-col border-r border-border bg-sidebar px-3 py-4 lg:flex",children:[l.jsx("div",{className:"mb-8 flex shrink-0 justify-center px-4 py-3",children:l.jsx("img",{className:"h-5 w-auto object-contain",src:"/assets/brand/header.webp",alt:"Autonomy Studio"})}),l.jsxs("nav",{className:"scrollbar-stable min-h-0 flex-1 space-y-5 overflow-y-auto pr-2",children:[K.map(Z=>l.jsxs("div",{children:[l.jsx("p",{className:"mb-2 px-2 text-xs font-medium text-muted-foreground",children:Z.label}),l.jsx("div",{className:"space-y-1",children:Z.items.map(O=>{const z="children"in O&&O.children,Y=!!_||d[O.label],U=z?O.children.some(T=>ts[T.label]===u):u===ts[O.label];return l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:()=>{if(z){M(P=>({...P,[O.label]:!P[O.label]}));return}const T=ts[O.label];T&&r(T)},className:Pe("flex h-9 w-full items-center gap-2 rounded-md px-2 text-sm text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-white",U&&"font-semibold text-white"),children:[l.jsx(O.icon,{className:Pe("size-4",U&&"text-white")}),l.jsx("span",{className:"min-w-0 flex-1 text-left",children:O.label}),z?Y?l.jsx(zi,{className:Pe("size-3.5 text-muted-foreground",U&&"text-white")}):l.jsx(kf,{className:Pe("size-3.5 text-muted-foreground",U&&"text-white")}):null]}),z&&Y?l.jsx("div",{className:"mt-1 space-y-1 pl-6",children:O.children.map(T=>{const P=u===ts[T.label];return l.jsxs("button",{type:"button",onClick:()=>{const J=ts[T.label];J&&r(J)},className:Pe("flex h-8 w-full items-center gap-2 rounded-md px-2 text-left text-xs font-bold text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-white",P&&"text-white"),children:[l.jsx("span",{className:Pe("h-3 w-1 rounded-full",P?"bg-white":"bg-transparent")}),l.jsx("span",{children:T.label})]},T.label)})}):null]},O.label)})})]},Z.label)),K.length===0?l.jsx("div",{className:"px-2 py-6 text-center text-xs text-muted-foreground",children:"검색된 메뉴가 없습니다."}):null]})]})}function He({eyebrow:u,title:x,description:r,actions:d}){return l.jsxs("div",{className:"mb-6 flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:u}),l.jsx("h1",{className:"mt-1 text-2xl font-semibold tracking-tight md:text-3xl",children:x}),l.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-muted-foreground",children:r})]}),d?l.jsx("div",{className:"flex flex-wrap gap-2",children:d}):null]})}function Ft({open:u,label:x="데이터를 불러오는 중입니다."}){return u?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/45 px-4 backdrop-blur-[2px]",role:"status","aria-live":"polite",children:l.jsxs("div",{className:"flex min-h-44 w-full max-w-sm flex-col items-center justify-center rounded-lg border border-border bg-card px-8 py-8 shadow-xl",children:[l.jsx("div",{className:"size-11 animate-spin rounded-full border-[3px] border-muted border-t-primary"}),l.jsx("p",{className:"mt-5 text-center text-sm font-semibold leading-6 text-foreground",children:x})]})}):null}function It(u,x=800){const[r,d]=b.useState(u),M=b.useRef(u?Date.now():null);return b.useEffect(()=>{if(u){M.current=Date.now(),d(!0);return}if(!r)return;const _=M.current?Date.now()-M.current:x,K=Math.max(x-_,0),Z=window.setTimeout(()=>{M.current=null,d(!1)},K);return()=>window.clearTimeout(Z)},[u,x,r]),r}function Hg({menuSearch:u,onMenuSearchChange:x}){return l.jsxs("header",{className:"sticky top-0 z-20 flex h-16 items-center justify-between border-b border-border bg-background/90 px-4 backdrop-blur-xl md:px-6",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[l.jsx(V,{variant:"outline",className:"lg:hidden",children:l.jsx(or,{className:"size-4"})}),l.jsxs("div",{className:"relative hidden w-80 md:block",children:[l.jsx(ns,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),l.jsx("input",{className:"h-9 w-full rounded-md border border-input bg-background pl-9 pr-3 text-sm outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-ring",placeholder:"메뉴 검색",value:u,onChange:r=>x(r.target.value)})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(V,{variant:"ghost",className:"size-9 px-0",children:l.jsx(Up,{className:"size-4"})}),l.jsx(V,{variant:"ghost",className:"size-9 px-0",children:l.jsx(Of,{className:"size-4"})}),l.jsxs(V,{variant:"outline",className:"gap-2",children:[l.jsx("span",{className:"flex size-6 items-center justify-center rounded bg-muted text-xs font-semibold",children:"AD"}),l.jsx("span",{className:"hidden md:inline",children:"관리자"}),l.jsx(zi,{className:"size-4 text-muted-foreground"})]})]})]})}function qg({onLogin:u}){const[x,r]=b.useState("admin@futuredrive.net"),[d,M]=b.useState("qwer1234"),[_,K]=b.useState(!1),[Z,O]=b.useState(!1),[z,Y]=b.useState(!1),U=b.useRef(null),T=Array.from({length:d.length}),P=J=>{J.preventDefault(),!(!x.trim()||!d.trim())&&(K(!0),O(!1),fetch(`${je}/auth/admin/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.trim(),password:d})}).then(ie=>{if(!ie.ok)throw new Error("Admin login failed");return ie.json()}).then(ie=>{localStorage.setItem("studio-admin-token",ie.token),localStorage.setItem("studio-admin",JSON.stringify(ie.admin)),K(!1),u()}).catch(()=>{K(!1),O(!0)}))};return l.jsx("div",{className:"min-h-screen bg-background px-4 text-foreground",children:l.jsx("div",{className:"mx-auto flex min-h-screen w-full max-w-md items-center justify-center py-10",children:l.jsxs("div",{className:"w-full rounded-lg border border-border bg-card/95 shadow-2xl",children:[l.jsxs("div",{className:"border-b border-border px-7 py-6",children:[l.jsx("div",{className:"flex justify-center",children:l.jsx("img",{className:"h-6 w-auto object-contain",src:"/assets/brand/header.webp",alt:"Autonomy Studio"})}),l.jsxs("div",{className:"mt-7 text-center",children:[l.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"관리자 로그인"}),l.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"계정 정보를 입력해 주세요."})]})]}),l.jsxs("form",{className:"space-y-4 px-7 py-6",onSubmit:P,children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"이메일"}),l.jsx("input",{type:"email",className:"login-field mt-2 h-10 w-full rounded-md border border-input bg-[#111827] px-3 text-sm text-white outline-none placeholder:text-white/35 focus:ring-2 focus:ring-ring",style:{color:"#ffffff",WebkitTextFillColor:"#ffffff",backgroundColor:"#111827"},value:x,onChange:J=>r(J.target.value)})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"비밀번호"}),l.jsxs("div",{className:"relative mt-2 h-10 w-full overflow-hidden rounded-md border border-input bg-[#111827] focus-within:ring-2 focus-within:ring-ring",onClick:()=>{var J;return(J=U.current)==null?void 0:J.focus()},children:[l.jsx("input",{ref:U,id:"password",name:"admin-login-passcode",type:"text",autoComplete:"off",spellCheck:!1,className:"absolute inset-0 z-0 h-full w-full border-0 bg-transparent px-3 text-sm opacity-0 outline-none",value:d,onFocus:()=>Y(!0),onBlur:()=>Y(!1),onChange:J=>M(J.target.value)}),l.jsxs("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center gap-1.5 px-3","aria-hidden":"true",children:[T.map((J,ie)=>l.jsx("span",{className:"block size-2 rounded-full",style:{backgroundColor:"#ffffff"}},ie)),z?l.jsx("span",{className:"ml-0.5 h-5 w-px animate-pulse bg-white"}):null]})]})]}),Z?l.jsx("p",{className:"text-center text-xs text-rose-300",children:"이메일 또는 비밀번호를 확인해 주세요."}):null,l.jsx("button",{type:"submit",className:"mt-3 h-10 w-full rounded-md text-sm font-bold transition-colors disabled:pointer-events-none disabled:opacity-45",style:{backgroundColor:"#2fbda0",color:"#ffffff",WebkitTextFillColor:"#ffffff"},disabled:!x.trim()||!d.trim()||_,children:l.jsx("span",{style:{color:"#ffffff",WebkitTextFillColor:"#ffffff"},children:_?"확인 중":"로그인"})})]})]})})})}function Lg(){return l.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:Sg.map(u=>l.jsxs(xe,{className:"p-5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:u.label}),l.jsx(Se,{tone:u.delta.startsWith("-")?"red":"green",children:u.delta})]}),l.jsx("div",{className:"mt-4 text-3xl font-semibold tracking-tight",children:u.value}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:u.hint})]},u.label))})}function Bg(){return l.jsxs(xe,{className:"xl:col-span-3",children:[l.jsx(Ge,{title:"런처 버전 관리",description:"스튜디오 메인 런처의 최신 버전, 최소 지원 버전, 배포 파일 상태를 관리합니다.",action:l.jsxs(V,{variant:"outline",children:[l.jsx(dr,{className:"size-4"}),"배포 정책"]})}),l.jsxs("div",{className:"grid gap-4 p-5 lg:grid-cols-[1fr_280px]",children:[l.jsx("div",{className:"space-y-4",children:Ag.map(u=>l.jsxs("div",{className:"rounded-md border border-border bg-muted/20 p-4",children:[l.jsx("div",{className:"flex items-center justify-between gap-4",children:l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"font-medium",children:u.name}),l.jsx(Se,{tone:Ve(u.status),children:u.status})]}),l.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["최신 ",u.latestVersion," · 최소 지원 ",u.minimumSupportedVersion]})]})}),l.jsxs("div",{className:"mt-4 grid gap-3 text-sm md:grid-cols-2",children:[l.jsxs("div",{className:"rounded-md bg-background px-3 py-2",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"배포 파일"}),l.jsx("p",{className:"mt-1 truncate font-medium",children:u.artifact})]}),l.jsxs("div",{className:"rounded-md bg-background px-3 py-2",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"다운로드 URL"}),l.jsx("p",{className:"mt-1 truncate font-medium text-muted-foreground",children:u.downloadUrl})]})]}),l.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:u.releaseNotes})]},u.appKey))}),l.jsxs("div",{className:"rounded-md border border-border bg-background p-4",children:[l.jsx("p",{className:"text-sm font-medium",children:"운영 알림"}),l.jsx("div",{className:"mt-4 space-y-3",children:Mg.map(u=>l.jsxs("div",{className:"flex gap-3 rounded-md bg-muted/30 p-3",children:[l.jsx(u.icon,{className:"mt-0.5 size-4 text-muted-foreground"}),l.jsx("p",{className:"text-sm leading-5",children:u.label})]},u.label))})]})]})]})}function Gg({onMore:u}){const[x,r]=b.useState([]),[d,M]=b.useState(!0);return b.useEffect(()=>{Gf().then(_=>{r(_.slice(0,5)),M(!1)}).catch(()=>{r([]),M(!1)})},[]),l.jsxs(xe,{children:[l.jsx(Ge,{title:"사용자/세션",description:"실시간 접근 상태와 세션 제어 항목입니다.",action:l.jsx(V,{variant:"outline",className:"h-8 px-3 text-[13px]",onClick:u,children:"더보기"})}),l.jsxs("div",{className:"divide-y divide-border",children:[d?l.jsxs("div",{className:"flex items-center justify-center gap-3 px-5 py-8 text-sm text-muted-foreground",children:[l.jsx("div",{className:"size-5 animate-spin rounded-full border-2 border-muted border-t-primary"}),l.jsx("span",{children:"불러오는 중"})]}):x.length===0?l.jsx("div",{className:"px-5 py-6 text-center text-sm text-muted-foreground",children:"표시할 사용자 세션이 없습니다."}):null,!d&&x.map(_=>l.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 py-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"truncate text-sm font-medium",children:_.user}),l.jsx(Se,{tone:Ve(_.state),children:_.state})]}),l.jsxs("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[_.email," · ",_.role]})]}),l.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Wt(_.lastSeen)})]},_.id))]})]})}function Yg(){return l.jsxs(xe,{children:[l.jsx(Ge,{title:"앱 관리",description:"런처 앱별 활성화, 로컬 실행 경로, 릴리즈, 워크로드, 시크릿, 환경변수를 관리합니다.",action:l.jsxs(V,{children:[l.jsx(yt,{className:"size-4"}),"앱 등록"]})}),l.jsx("div",{className:"max-h-[444px] overflow-auto",children:l.jsxs("table",{className:"w-full min-w-[980px] text-left text-sm",children:[l.jsx("thead",{className:"border-b border-border text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-5 py-3 font-medium",children:"앱"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"상태"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"릴리즈"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"저장소/경로"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"워크로드"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"시크릿"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"사용량"}),l.jsx("th",{className:"px-5 py-3 font-medium"})]})}),l.jsx("tbody",{className:"divide-y divide-border",children:tr.map(u=>l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsxs("td",{className:"px-5 py-4",children:[l.jsx("p",{className:"font-medium",children:u.name}),l.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[u.key," · ",u.version]})]}),l.jsx("td",{className:"px-5 py-4",children:l.jsx(Se,{tone:Ve(u.status),children:u.status})}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:u.release}),l.jsx("td",{className:"px-5 py-4",children:l.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[u.gitea,l.jsx(rr,{className:"size-3"})]})}),l.jsx("td",{className:"px-5 py-4",children:u.containers}),l.jsx("td",{className:"px-5 py-4",children:u.secrets}),l.jsx("td",{className:"px-5 py-4",children:l.jsxs("div",{className:"w-32 space-y-2",children:[l.jsx(wi,{value:u.cpu,tone:u.cpu>70?"amber":"primary"}),l.jsx(wi,{value:u.memory,tone:u.memory>75?"red":"green"})]})}),l.jsx("td",{className:"px-5 py-4 text-right",children:l.jsx(V,{variant:"ghost",className:"size-8 px-0",children:l.jsx(sa,{className:"size-4"})})})]},u.key))})]})})]})}function Vg(){return l.jsxs(xe,{children:[l.jsx(Ge,{title:"런타임 상태",description:"워크로드 상태, 이미지 버전, 리소스 사용량을 확인합니다."}),l.jsx("div",{className:"max-h-[360px] divide-y divide-border overflow-y-auto",children:Eg.map(u=>l.jsxs("div",{className:"px-5 py-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"truncate text-sm font-medium",children:u.workload}),l.jsx(Se,{tone:Ve(u.status),children:u.status})]}),l.jsxs("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[u.app," · ",u.node]})]}),l.jsx(_i,{className:"size-4 shrink-0 text-muted-foreground"})]}),l.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"mb-1 flex justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"CPU"}),l.jsxs("span",{children:[u.cpu,"%"]})]}),l.jsx(wi,{value:u.cpu,tone:u.cpu>80?"red":u.cpu>65?"amber":"primary"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"mb-1 flex justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"메모리"}),l.jsxs("span",{children:[u.memory,"%"]})]}),l.jsx(wi,{value:u.memory,tone:u.memory>80?"red":u.memory>65?"amber":"green"})]})]})]},u.pod))})]})}function Xg(){return l.jsxs(xe,{children:[l.jsx(Ge,{title:"공지사항",description:"런처 공지와 앱별 공지사항을 관리합니다.",action:l.jsxs(V,{variant:"outline",children:[l.jsx(yt,{className:"size-4"}),"공지 작성"]})}),l.jsx("div",{className:"max-h-[360px] divide-y divide-border overflow-y-auto",children:ar.map(u=>l.jsxs("div",{className:"flex items-center justify-between gap-3 px-5 py-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Se,{tone:u.scope==="런처"?"violet":"blue",children:u.scope}),l.jsx(Se,{tone:Ve(u.status),children:u.status})]}),l.jsx("p",{className:"mt-2 truncate text-sm font-medium",children:u.title}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:u.audience})]}),l.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:u.date})]},u.title))})]})}function Qg(){const{toast:u}=Ea(),[x,r]=b.useState([]),[d,M]=b.useState([]),[_,K]=b.useState(!0),Z=It(_),[O,z]=b.useState(!1),[Y,U]=b.useState(!1),[T,P]=b.useState(""),[J,ie]=b.useState("release"),[G,ee]=b.useState(""),[ae,$]=b.useState("idle"),[fe,oe]=b.useState(!1),[le,W]=b.useState("idle"),[te,pe]=b.useState({version:"",minimumVersion:"",artifact:"",downloadUrl:"",releaseNotes:"",repository:"",branch:"release",commitSha:""}),k=x[0],he=()=>{K(!0),ry().then(f=>{r(f),z(!1),K(!1)}).catch(()=>{r([]),z(!0),K(!1)})};b.useEffect(()=>{let f=!0;return he(),lr().then(v=>{if(!v.ok)throw new Error("Gitea repositories request failed");return v.json()}).then(v=>{f&&M(v.repos??[])}).catch(()=>{f&&M([])}),()=>{f=!1}},[]);const Ne=()=>{var f;k&&(P(k.repository??((f=d[0])==null?void 0:f.fullName)??""),ie(k.branch??"release"),ee(k.commitSha??""),$("idle"),U(!0))},De=()=>{!k||!T.trim()||($("saving"),fetch(`${je}/launcher/versions/${k.id}/source`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({repository:T.trim(),branch:J.trim()||void 0,commitSha:G.trim()||void 0})}).then(f=>{if(!f.ok)throw new Error("Launcher source link failed");return f.json()}).then(()=>{U(!1),$("idle"),he()}).catch(()=>$("error")))},L=()=>{var f;pe({version:"",minimumVersion:(k==null?void 0:k.minimumVersion)??"",artifact:"",downloadUrl:"",releaseNotes:"",repository:(k==null?void 0:k.repository)??((f=d[0])==null?void 0:f.fullName)??"",branch:(k==null?void 0:k.branch)??"release",commitSha:""}),W("idle"),oe(!0)},ue=()=>{!te.version.trim()||!te.artifact.trim()||!te.downloadUrl.trim()||(W("saving"),fetch(`${je}/launcher/versions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:te.version.trim(),minimumVersion:te.minimumVersion.trim()||void 0,artifact:te.artifact.trim(),downloadUrl:te.downloadUrl.trim(),releaseNotes:te.releaseNotes.trim()||void 0,repository:te.repository||void 0,branch:te.branch||void 0,commitSha:te.commitSha.trim()||void 0})}).then(f=>{if(!f.ok)throw new Error("Launcher release create failed");return f.json()}).then(()=>{oe(!1),W("idle"),he()}).catch(()=>W("error")))};return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"런처 운영",title:"버전 관리",description:"스튜디오 메인 런처의 최신 버전, 최소 지원 버전, 배포 파일 상태만 관리합니다.",actions:l.jsxs(l.Fragment,{children:[l.jsxs(V,{variant:"outline",className:"h-8 px-3 text-[13px]",onClick:Ne,disabled:!k,children:[l.jsx(dr,{className:"size-4"}),"소스 연결"]}),l.jsxs(V,{className:"h-8 px-3 text-[13px]",onClick:L,children:[l.jsx(yt,{className:"size-4"}),"런처 릴리즈 등록"]})]})}),O?l.jsx("div",{className:"mb-4 rounded-md border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:"런처 버전 데이터를 불러오지 못했습니다."}):null,!_&&!k?l.jsx(xe,{className:"px-5 py-8 text-center text-sm text-muted-foreground",children:"등록된 런처 버전이 없습니다."}):null,k?l.jsxs("div",{className:"grid gap-4 xl:grid-cols-[1.4fr_1fr]",children:[l.jsxs(xe,{children:[l.jsx(Ge,{title:"메인 런처 배포 상태",description:"앱 실행의 진입점인 런처 자체 버전과 배포 파일 상태입니다."}),l.jsxs("div",{className:"p-5",children:[l.jsx("div",{className:"flex flex-col gap-4 rounded-md border border-border bg-muted/20 p-4 md:flex-row md:items-center md:justify-between",children:l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"text-base font-semibold",children:"Autonomy Studio Launcher"}),l.jsx(Se,{tone:k.isActive?"green":"neutral",children:k.isActive?"활성":"비활성"})]}),l.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["최신 ",k.version," · 최소 지원 ",k.minimumVersion||"-"]})]})}),l.jsxs("div",{className:"mt-4 grid gap-3",children:[l.jsxs("div",{className:"rounded-md border border-border bg-background p-4",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"배포 파일"}),l.jsx("p",{className:"mt-2 truncate text-sm font-semibold",children:k.artifact})]}),l.jsxs("div",{className:"rounded-md border border-border bg-background p-4",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"다운로드 URL"}),l.jsx("p",{className:"mt-2 truncate text-sm font-semibold text-muted-foreground",children:k.downloadUrl})]})]}),l.jsxs("div",{className:"mt-4 rounded-md border border-border bg-background p-4",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"소스 연결"}),l.jsx(V,{variant:"ghost",className:"h-7 px-2 text-xs",onClick:Ne,children:"변경"})]}),k.repository?l.jsxs("div",{className:"mt-3 grid gap-3 text-sm md:grid-cols-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"Repository"}),l.jsx("p",{className:"mt-1 truncate font-semibold",children:k.repository})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"Branch"}),l.jsx("p",{className:"mt-1 truncate font-semibold",children:k.branch||"-"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"Commit"}),l.jsx("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:k.commitSha||"-"})]}),l.jsxs("div",{className:"md:col-span-3",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"Clone URL"}),l.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[l.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:Mi(k.repository)}),l.jsx("button",{type:"button",title:"HTTP clone URL 복사",className:"inline-flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",onClick:()=>cr(Mi(k.repository),()=>u({type:"success",message:"복사되었습니다."}),()=>u({type:"error",message:"복사에 실패했습니다."})),children:l.jsx(er,{className:"size-3.5"})})]})]})]}):l.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"연결된 Gitea 저장소가 없습니다."})]}),l.jsxs("div",{className:"mt-4 rounded-md border border-border bg-background p-4",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"릴리즈 노트"}),l.jsx("p",{className:"mt-2 text-sm leading-6",children:k.releaseNotes||"-"})]})]})]}),l.jsxs(xe,{children:[l.jsx(Ge,{title:"업데이트 기준",description:"런처 버전 판정에 필요한 최소 기준입니다."}),l.jsx("div",{className:"grid gap-3 p-5",children:[["최신 버전",k.version],["최소 런처 버전",k.minimumVersion||"-"]].map(([f,v])=>l.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border bg-muted/20 px-4 py-3",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:f}),l.jsx("span",{className:"text-right text-sm font-semibold",children:v})]},f))})]})]}):null,Y&&k?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-lg rounded-lg border border-border bg-card shadow-xl",children:[l.jsx("div",{className:"border-b border-border px-5 py-4",children:l.jsx("h2",{className:"text-sm font-semibold",children:"런처 소스 연결"})}),l.jsxs("div",{className:"space-y-4 px-5 py-5",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Repository"}),l.jsxs("select",{value:T,onChange:f=>P(f.target.value),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary",children:[d.length===0?l.jsx("option",{value:"",children:"platform 저장소 없음"}):null,d.map(f=>l.jsx("option",{value:f.fullName,children:f.fullName},f.id))]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Branch"}),l.jsxs("select",{value:J,onChange:f=>ie(f.target.value),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary",children:[l.jsx("option",{value:"release",children:"release"}),l.jsx("option",{value:"develop",children:"develop"}),l.jsx("option",{value:"main",children:"main"})]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Commit SHA"}),l.jsx("input",{value:G,onChange:f=>ee(f.target.value),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary"})]}),ae==="error"?l.jsx("p",{className:"text-xs text-rose-300",children:"런처 소스 연결 저장에 실패했습니다."}):null]}),l.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-5 py-4",children:[l.jsx(V,{variant:"ghost",onClick:()=>U(!1),children:"취소"}),l.jsx(V,{onClick:De,disabled:!T||ae==="saving",children:ae==="saving"?"저장 중":"저장"})]})]})}):null,fe?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-2xl rounded-lg border border-border bg-card shadow-xl",children:[l.jsx("div",{className:"border-b border-border px-5 py-4",children:l.jsx("h2",{className:"text-sm font-semibold",children:"런처 릴리즈 등록"})}),l.jsxs("div",{className:"grid max-h-[72vh] gap-4 overflow-y-auto px-5 py-5 md:grid-cols-2",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"버전"}),l.jsx("input",{value:te.version,onChange:f=>pe(v=>({...v,version:f.target.value})),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"최소 런처 버전"}),l.jsx("input",{value:te.minimumVersion,onChange:f=>pe(v=>({...v,minimumVersion:f.target.value})),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary"})]}),l.jsxs("label",{className:"block md:col-span-2",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"배포 파일"}),l.jsx("input",{value:te.artifact,onChange:f=>pe(v=>({...v,artifact:f.target.value})),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary"})]}),l.jsxs("label",{className:"block md:col-span-2",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"다운로드 URL"}),l.jsx("input",{value:te.downloadUrl,onChange:f=>pe(v=>({...v,downloadUrl:f.target.value})),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Repository"}),l.jsxs("select",{value:te.repository,onChange:f=>pe(v=>({...v,repository:f.target.value})),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary",children:[l.jsx("option",{value:"",children:"미연결"}),d.map(f=>l.jsx("option",{value:f.fullName,children:f.fullName},f.id))]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Branch"}),l.jsxs("select",{value:te.branch,onChange:f=>pe(v=>({...v,branch:f.target.value})),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary",children:[l.jsx("option",{value:"release",children:"release"}),l.jsx("option",{value:"develop",children:"develop"}),l.jsx("option",{value:"main",children:"main"})]})]}),l.jsxs("label",{className:"block md:col-span-2",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Commit SHA"}),l.jsx("input",{value:te.commitSha,onChange:f=>pe(v=>({...v,commitSha:f.target.value})),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary"})]}),l.jsxs("label",{className:"block md:col-span-2",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"릴리즈 노트"}),l.jsx("textarea",{value:te.releaseNotes,onChange:f=>pe(v=>({...v,releaseNotes:f.target.value})),className:"mt-2 min-h-24 w-full rounded-md border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"})]}),le==="error"?l.jsx("p",{className:"md:col-span-2 text-xs text-rose-300",children:"런처 릴리즈 등록에 실패했습니다. 버전 중복과 필수값을 확인하세요."}):null]}),l.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-5 py-4",children:[l.jsx(V,{variant:"ghost",onClick:()=>oe(!1),children:"취소"}),l.jsx(V,{onClick:ue,disabled:!te.version.trim()||!te.artifact.trim()||!te.downloadUrl.trim()||le==="saving",children:le==="saving"?"등록 중":"등록"})]})]})}):null,l.jsx(Ft,{open:Z})]})}function Zg(){var W,te,pe;const[u,x]=b.useState([]),[r,d]=b.useState(!0),M=It(r),[_,K]=b.useState(""),[Z,O]=b.useState(!1),[z,Y]=b.useState(""),[U,T]=b.useState(""),[P,J]=b.useState(""),[ie,G]=b.useState(""),[ee,ae]=b.useState("idle"),$=u.find(k=>k.id===_)??u[0],fe=((W=$==null?void 0:$.components)==null?void 0:W.length)??0,oe=((te=$==null?void 0:$.components)==null?void 0:te.filter(k=>k.repository).length)??0;b.useEffect(()=>{d(!0),za().then(k=>{x(k),K(he=>{const Ne=gl(k,he);return pt(Ne),Ne}),d(!1)}).catch(()=>{x([]),d(!1)})},[]);const le=()=>{!z.trim()||!U.trim()||(ae("saving"),fetch(`${je}/apps`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:z,name:U,namespace:P||void 0,description:ie||void 0})}).then(k=>{if(!k.ok)throw new Error("App create failed");return k.json()}).then(()=>za()).then(k=>{x(k),Y(""),T(""),J(""),G(""),ae("idle"),O(!1)}).catch(()=>ae("error")))};return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"앱 운영",title:"앱 관리",description:"런처에 등록할 앱을 제품 단위로 관리하고, 앱을 구성하는 fe, be, adm-fe, db, 워크로드를 하나의 묶음으로 운영합니다.",actions:l.jsxs(l.Fragment,{children:[l.jsxs(V,{variant:"outline",className:"h-8 px-3 text-[13px]",children:[l.jsx(dr,{className:"size-4"}),"배포 템플릿"]}),l.jsxs(V,{className:"h-8 px-3 text-[13px]",onClick:()=>O(!0),children:[l.jsx(yt,{className:"size-4"}),"앱 등록"]})]})}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"등록된 앱 그룹",description:"앱 그룹을 먼저 등록한 뒤 구성요소와 Gitea 저장소를 연결합니다."}),l.jsx("div",{className:"max-h-[320px] overflow-x-auto overflow-y-auto",children:l.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[l.jsx("thead",{className:"sticky top-0 z-10 border-b border-border bg-card text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-5 py-3 font-medium",children:"Key"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"앱 이름"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Namespace"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"구성요소"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"상태"})]})}),l.jsx("tbody",{className:"divide-y divide-border",children:!r&&u.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:5,className:"px-5 py-6 text-center text-muted-foreground",children:"등록된 앱 그룹이 없습니다."})}):u.map(k=>{var he;return l.jsxs("tr",{className:Pe("cursor-pointer transition-colors hover:bg-muted/20",($==null?void 0:$.id)===k.id&&"bg-primary/20 shadow-[inset_4px_0_0_var(--color-primary)] hover:bg-primary/25"),onClick:()=>{pt(k.id),K(k.id)},children:[l.jsx("td",{className:"px-5 py-4 font-semibold",children:k.key}),l.jsx("td",{className:"px-5 py-4",children:k.name}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:k.namespace||"-"}),l.jsx("td",{className:"px-5 py-4",children:((he=k.components)==null?void 0:he.length)??0}),l.jsx("td",{className:"px-5 py-4",children:l.jsx(Se,{tone:k.status==="ACTIVE"?"green":"neutral",children:k.status})})]},k.id)})})]})})]}),l.jsxs(xe,{className:"p-5",children:[l.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-semibold",children:"앱 선택"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"관리할 앱 그룹을 선택합니다."})]}),l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[l.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground outline-none focus:ring-2 focus:ring-ring sm:w-64",value:($==null?void 0:$.id)??"",onChange:k=>{pt(k.target.value),K(k.target.value)},children:[!r&&u.length===0?l.jsx("option",{value:"",children:"등록된 앱 없음"}):null,u.map(k=>l.jsx("option",{value:k.id,children:k.name},k.id))]}),$?l.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[l.jsx("span",{className:"rounded-md bg-muted px-2 py-1",children:$.namespace||"-"}),l.jsxs("span",{className:"rounded-md bg-muted px-2 py-1",children:["구성요소 ",((pe=$.components)==null?void 0:pe.length)??0]}),l.jsx(Se,{tone:Ve($.status),children:$.status})]}):null]})]}),!r&&u.length===0?l.jsx("div",{className:"mt-4 rounded-md border border-dashed border-border bg-muted/20 px-4 py-5 text-center text-sm text-muted-foreground",children:"등록된 앱을 선택해주세요."}):null]}),$?l.jsxs("div",{className:"min-w-0 space-y-4",children:[l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:`${$.name} 구성 요약`,description:"런처 다운로드 대상과 함께 배포되는 서버/관리자/DB 구성입니다.",action:l.jsxs(V,{variant:"outline",children:[l.jsx(sa,{className:"size-4"}),"설정"]})}),l.jsx("div",{className:"grid gap-4 p-5 md:grid-cols-4",children:[["Namespace",$.namespace],["연결 소스",`${oe}개`],["구성요소",`${fe}개`],["상태",$.status]].map(([k,he])=>l.jsxs("div",{className:"rounded-md border border-border bg-muted/20 p-4",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:k}),l.jsx("p",{className:"mt-2 truncate text-sm font-semibold",children:he})]},k))}),l.jsx("div",{className:"border-t border-border px-5 py-4",children:l.jsxs("div",{className:"grid gap-3 text-sm md:grid-cols-2",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"Key"}),l.jsx("p",{className:"mt-1 font-semibold",children:$.key})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"설명"}),l.jsx("p",{className:"mt-1 truncate font-semibold text-muted-foreground",children:$.description||"-"})]})]})})]}),l.jsxs(xe,{children:[l.jsx(Ge,{title:"앱 구성요소",description:"런처가 다운로드할 클라이언트 산출물과 함께 운영할 워크로드입니다."}),l.jsx("div",{className:"max-h-[430px] overflow-x-auto overflow-y-auto",children:l.jsxs("table",{className:"w-full min-w-[1180px] text-left text-sm",children:[l.jsx("thead",{className:"border-b border-border text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-5 py-3 font-medium",children:"구성요소"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"역할"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"유형"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"워크로드"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"이미지/산출물"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Replicas"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"소스"})]})}),l.jsxs("tbody",{className:"divide-y divide-border",children:[!r&&($.components??[]).map(k=>l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsx("td",{className:"px-5 py-4 font-medium",children:l.jsxs("span",{className:"inline-flex items-center gap-2",children:[l.jsx("span",{className:Pe("size-2 rounded-full",k.repository?"bg-emerald-400":"bg-muted-foreground")}),k.name]})}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:k.buildTarget||"-"}),l.jsx("td",{className:"px-5 py-4",children:k.type}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:"-"}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:k.repository||"미연결"}),l.jsx("td",{className:"px-5 py-4",children:k.branch||"-"}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:k.repository||"미연결"})]},k.name)),!r&&($.components??[]).length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:7,className:"px-5 py-6 text-center text-muted-foreground",children:"등록된 구성요소가 없습니다. 소스 관리에서 구성요소를 추가하세요."})}):null]})]})})]})]}):null]}),Z?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",children:l.jsxs("div",{className:"w-full max-w-lg rounded-lg border border-border bg-card shadow-xl",children:[l.jsx("div",{className:"border-b border-border px-5 py-4",children:l.jsx("h2",{className:"text-sm font-semibold",children:"앱 그룹 등록"})}),l.jsxs("div",{className:"space-y-4 px-5 py-5",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"앱 Key"}),l.jsx("input",{value:z,onChange:k=>Y(k.target.value),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"앱 이름"}),l.jsx("input",{value:U,onChange:k=>T(k.target.value),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Namespace"}),l.jsx("input",{value:P,onChange:k=>J(k.target.value),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"설명"}),l.jsx("textarea",{value:ie,onChange:k=>G(k.target.value),className:"mt-2 min-h-20 w-full rounded-md border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"})]}),ee==="error"?l.jsx("p",{className:"text-xs text-rose-300",children:"앱 등록에 실패했습니다. 중복 Key 또는 백엔드 상태를 확인하세요."}):null]}),l.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-5 py-4",children:[l.jsx(V,{variant:"ghost",onClick:()=>O(!1),children:"취소"}),l.jsx(V,{onClick:le,disabled:!z.trim()||!U.trim()||ee==="saving",children:ee==="saving"?"등록 중":"등록"})]})]})}):null,l.jsx(Ft,{open:M})]})}function Kg(){const{toast:u}=Ea(),[x,r]=b.useState([]),[d,M]=b.useState([]),[_,K]=b.useState(!0),Z=It(_),[O,z]=b.useState(""),[Y,U]=b.useState(""),[T,P]=b.useState(!1),[J,ie]=b.useState(""),[G,ee]=b.useState("dev"),[ae,$]=b.useState(""),[fe,oe]=b.useState("idle"),[le,W]=b.useState(""),[te,pe]=b.useState(""),[k,he]=b.useState(""),[Ne,De]=b.useState(!1),[L,ue]=b.useState("idle"),[f,v]=b.useState(""),[Q,F]=b.useState(""),[re,m]=b.useState(""),[N,j]=b.useState(null),X=()=>{K(!0),Promise.all([za(),Ny()]).then(([B,ge])=>{var cs,ln,nn;const Me=gl(B,O),dt=ge.filter(Pt=>Pt.appId===Me),ia=Y&&dt.some(Pt=>Pt.id===Y)?Y:((cs=dt[0])==null?void 0:cs.id)||"",Xe=B.find(Pt=>Pt.id===Me);r(B),M(ge),z(Me),pt(Me),U(ia),W(((nn=(ln=Xe==null?void 0:Xe.components)==null?void 0:ln[0])==null?void 0:nn.id)||""),K(!1)}).catch(()=>{r([]),M([]),K(!1),u({type:"error",title:"런타임 구성 조회 실패",message:"앱 또는 런타임 프로필을 불러오지 못했습니다."})})};b.useEffect(()=>{X()},[]),b.useEffect(()=>{var Me;const B=x.find(dt=>dt.id===O),ge=(B==null?void 0:B.components)??[];ge.some(dt=>dt.id===le)||W(((Me=ge[0])==null?void 0:Me.id)||"")},[x,O,le]);const I=x.find(B=>B.id===O),p=d.filter(B=>B.appId===O),q=p.find(B=>B.id===Y)??p[0],w=(q==null?void 0:q.variables)??[],ne=(I==null?void 0:I.components)??[],Je=w.filter(B=>!B.isSecret).length,We=w.filter(B=>B.isSecret).length,at=B=>{var dt,ia;const ge=x.find(Xe=>Xe.id===B),Me=d.find(Xe=>Xe.appId===B);pt(B),z(B),U((Me==null?void 0:Me.id)||""),W(((ia=(dt=ge==null?void 0:ge.components)==null?void 0:dt[0])==null?void 0:ia.id)||""),$((ge==null?void 0:ge.namespace)||(ge==null?void 0:ge.key)||"")},Ia=()=>{I&&(ie(""),ee("dev"),$(I.namespace||I.key||""),oe("idle"),P(!0))},Ut=()=>{!I||!J.trim()||!G.trim()||!ae.trim()||(oe("saving"),Sy({appId:I.id,name:J.trim(),environment:G.trim(),namespace:ae.trim()}).then(({profile:B})=>{M(ge=>[B,...ge]),U(B.id),P(!1),oe("idle"),u({type:"success",title:"프로필 생성",message:`${B.name} 프로필이 생성되었습니다.`})}).catch(B=>{oe("idle"),u({type:"error",title:"프로필 생성 실패",message:B.message})}))},$e=()=>{!q||!le||!te.trim()||!k.trim()||(ue("saving"),Ay(q.id,{componentId:le,key:te.trim(),value:k,isSecret:Ne}).then(({variable:B})=>{M(ge=>ge.map(Me=>Me.id===q.id?{...Me,variables:[...Me.variables??[],B]}:Me)),pe(""),he(""),De(!1),ue("idle"),u({type:"success",title:"설정값 추가",message:`${B.key} 항목이 추가되었습니다.`})}).catch(B=>{ue("idle"),u({type:"error",title:"설정값 추가 실패",message:B.message})}))},an=B=>{q&&(v(B.id),zy(q.id,B.id).then(()=>{M(ge=>ge.map(Me=>Me.id===q.id?{...Me,variables:(Me.variables??[]).filter(dt=>dt.id!==B.id)}:Me)),v(""),u({type:"success",title:"설정값 삭제",message:`${B.key} 항목이 삭제되었습니다.`})}).catch(ge=>{v(""),u({type:"error",title:"설정값 삭제 실패",message:ge.message})}))},ki=B=>{F(B.id),yy(B.namespace).then(({namespace:ge,created:Me,logs:dt})=>{F(""),j({title:`Namespace · ${ge}`,logs:dt||`[namespace] ${ge} exists`}),u({type:"success",title:"Namespace 생성/확인",message:Me?`${ge} namespace를 생성했습니다.`:`${ge} namespace가 이미 있습니다.`})}).catch(ge=>{F(""),u({type:"error",title:"Namespace 생성/확인 실패",message:ge.message})})},is=B=>{m(B.id),Ey(B.id).then(({logs:ge})=>{var Me;m(""),j({title:`${((Me=B.app)==null?void 0:Me.name)??(I==null?void 0:I.name)??"-"} · ${B.name}`,logs:ge}),u({type:"success",title:"런타임 구성 적용",message:`${B.name} 프로필을 적용했습니다.`})}).catch(ge=>{m(""),u({type:"error",title:"런타임 구성 적용 실패",message:ge.message})})};return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"플랫폼 런타임",title:"런타임 구성",description:"앱 구성요소별 환경변수와 시크릿을 프로필로 묶어 배포 환경에 적용합니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",onClick:Ia,disabled:!I,children:[l.jsx(yt,{className:"size-4"}),"프로필 생성"]})}),l.jsxs("div",{className:"space-y-4",children:[l.jsx(xe,{className:"p-5",children:l.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-semibold",children:"앱 선택"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"설정값을 관리할 앱 그룹을 선택합니다."})]}),l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[l.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground outline-none focus:ring-2 focus:ring-ring sm:w-72",value:O,onChange:B=>at(B.target.value),children:[x.map(B=>l.jsx("option",{value:B.id,children:B.name},B.id)),x.length===0?l.jsx("option",{value:"",children:"등록된 앱 없음"}):null]}),I?l.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[l.jsx("span",{className:"rounded-md bg-muted px-2 py-1",children:I.namespace||"-"}),l.jsxs("span",{className:"rounded-md bg-muted px-2 py-1",children:["구성요소 ",ne.length]}),l.jsxs("span",{className:"rounded-md bg-muted px-2 py-1",children:["프로필 ",p.length]})]}):null]})]})}),!_&&!I?l.jsx(xe,{className:"flex min-h-72 items-center justify-center p-8 text-center text-sm text-muted-foreground",children:"앱 관리에서 앱 그룹과 구성요소를 먼저 등록하세요."}):null,I?l.jsxs("div",{className:"min-w-0 space-y-4",children:[l.jsx("div",{className:"grid gap-4 md:grid-cols-4",children:[["Namespace",I.namespace||"-"],["구성요소",`${ne.length}개`],["환경변수",`${Je}개`],["시크릿",`${We}개`]].map(([B,ge])=>l.jsxs(xe,{className:"p-5",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:B}),l.jsx("p",{className:"mt-3 truncate text-2xl font-semibold",children:ge})]},B))}),l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"런타임 프로필",description:"개발, 검수, 운영처럼 배포 환경별로 적용할 설정 묶음입니다.",action:l.jsxs("span",{className:"text-xs font-semibold text-muted-foreground",children:["총 ",p.length,"개"]})}),l.jsxs("div",{className:"max-h-72 space-y-2 overflow-y-auto p-4",children:[p.length===0?l.jsx("div",{className:"flex min-h-36 items-center justify-center rounded-md border border-border bg-background text-center text-sm text-muted-foreground",children:"생성된 런타임 프로필이 없습니다."}):null,p.map(B=>{const ge=B.variables??[],Me=ge.filter(Xe=>!Xe.isSecret).length,dt=ge.filter(Xe=>Xe.isSecret).length,ia=(q==null?void 0:q.id)===B.id;return l.jsxs("div",{className:Pe("flex flex-col gap-3 rounded-lg border px-4 py-3 transition-colors lg:flex-row lg:items-center lg:justify-between",ia?"border-primary bg-primary/10":"border-border bg-muted/10 hover:bg-muted/20"),children:[l.jsxs("button",{type:"button",className:"min-w-0 text-left",onClick:()=>U(B.id),children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:Pe("size-2 rounded-full",ia?"bg-primary":"bg-muted-foreground")}),l.jsx("span",{className:"text-sm font-semibold",children:B.name}),l.jsx(Se,{tone:"blue",children:Tf(B.environment)}),l.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:B.namespace})]}),l.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[l.jsxs("span",{children:["환경변수 ",l.jsx("b",{className:"font-semibold text-foreground",children:Me})]}),l.jsxs("span",{children:["시크릿 ",l.jsx("b",{className:"font-semibold text-foreground",children:dt})]}),l.jsxs("span",{children:["수정 ",l.jsx("b",{className:"font-semibold text-foreground",children:Wt(B.updatedAt)})]})]})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[l.jsxs(V,{variant:"outline",className:"h-8 px-3 text-[13px]",onClick:()=>ki(B),disabled:Q===B.id,children:[l.jsx(ns,{className:"size-4"}),Q===B.id?"확인 중":"Namespace 생성/확인"]}),l.jsxs(V,{variant:"outline",className:"h-8 px-3 text-[13px]",onClick:()=>is(B),disabled:(B.variables??[]).length===0||re===B.id,children:[l.jsx(ls,{className:"size-4"}),re===B.id?"적용 중":"적용"]})]})]},B.id)})]})]}),q?l.jsxs("div",{className:"grid min-w-0 gap-4 xl:grid-cols-[minmax(0,1fr)_420px]",children:[l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"설정값",description:"구성요소별로 ConfigMap 또는 Secret에 반영될 항목입니다.",action:l.jsxs("span",{className:"text-xs font-semibold text-muted-foreground",children:["총 ",w.length,"개"]})}),l.jsx("div",{className:"max-h-[560px] overflow-x-auto overflow-y-auto",children:l.jsxs("table",{className:"w-full min-w-[880px] text-left text-sm",children:[l.jsx("thead",{className:"sticky top-0 z-10 border-b border-border bg-card text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"w-12 px-5 py-3 font-medium",children:"구분"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"구성요소"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Key"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Value"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"등록일"}),l.jsx("th",{className:"px-5 py-3 text-right font-medium",children:"관리"})]})}),l.jsxs("tbody",{className:"divide-y divide-border",children:[w.map(B=>{var ge;return l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsx("td",{className:"px-5 py-4",children:l.jsx("span",{className:Pe("block size-2.5 rounded-full",B.isSecret?"bg-amber-400":"bg-emerald-400")})}),l.jsx("td",{className:"px-5 py-4 font-semibold",children:((ge=B.component)==null?void 0:ge.name)??"-"}),l.jsx("td",{className:"px-5 py-4 font-mono text-xs",children:B.key}),l.jsx("td",{className:"max-w-[320px] px-5 py-4 font-mono text-xs text-muted-foreground",children:l.jsx("span",{className:"block truncate",children:B.isSecret?"********":B.value})}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:Wt(B.createdAt)}),l.jsx("td",{className:"px-5 py-4",children:l.jsx("div",{className:"flex justify-end",children:l.jsx(V,{variant:"ghost",className:"size-8 px-0 text-rose-300 hover:text-rose-200",title:"삭제","aria-label":"삭제",onClick:()=>an(B),disabled:f===B.id,children:l.jsx(mr,{className:"size-4"})})})})]},B.id)}),w.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:6,className:"px-5 py-12 text-center text-muted-foreground",children:"등록된 설정값이 없습니다."})}):null]})]})})]}),l.jsxs(xe,{className:"p-5",children:[l.jsx("p",{className:"text-sm font-semibold",children:"설정값 추가"}),l.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:"선택한 프로필에 구성요소별 환경변수 또는 시크릿을 추가합니다."}),l.jsxs("div",{className:"mt-5 space-y-4",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"프로필"}),l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-muted px-3 text-sm text-muted-foreground outline-none",value:`${q.name} / ${Tf(q.environment)}`,readOnly:!0})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"구성요소"}),l.jsxs("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:le,onChange:B=>W(B.target.value),children:[ne.map(B=>l.jsx("option",{value:B.id,children:B.name},B.id)),ne.length===0?l.jsx("option",{value:"",children:"구성요소 없음"}):null]})]}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-[1fr_auto]",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Key"}),l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-ring",value:te,onChange:B=>pe(B.target.value),placeholder:"DATABASE_URL"})]}),l.jsxs("label",{className:"flex items-end gap-2 pb-2 text-xs font-medium text-muted-foreground",children:[l.jsx("input",{type:"checkbox",className:"size-4 accent-primary",checked:Ne,onChange:B=>De(B.target.checked)}),"Secret"]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Value"}),l.jsx("input",{type:Ne?"password":"text",autoComplete:"off",className:"secure-field mt-2 h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-sm text-foreground outline-none placeholder:text-white/35 focus:ring-2 focus:ring-ring",value:k,onChange:B=>he(B.target.value),placeholder:"값 입력"})]}),l.jsxs(V,{className:"h-9 w-full text-[13px]",onClick:$e,disabled:!le||!te.trim()||!k.trim()||L==="saving",children:[l.jsx(yt,{className:"size-4"}),L==="saving"?"추가 중":"추가"]})]})]})]}):l.jsx(xe,{className:"flex min-h-72 items-center justify-center p-8 text-center text-sm text-muted-foreground",children:"런타임 프로필을 생성하면 설정값을 추가할 수 있습니다."})]}):null]}),T?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-xl overflow-hidden rounded-lg border border-border bg-card shadow-xl",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-border px-5 py-4",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"런타임 프로필 생성"}),l.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[(I==null?void 0:I.name)??"-","에 적용할 환경별 설정 묶음을 생성합니다."]})]}),l.jsx(V,{variant:"ghost",onClick:()=>P(!1),children:"닫기"})]}),l.jsxs("div",{className:"grid gap-4 px-5 py-5 sm:grid-cols-2",children:[l.jsxs("label",{className:"block sm:col-span-2",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"프로필명"}),l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-ring",value:J,onChange:B=>ie(B.target.value),placeholder:"예: 개발 기본"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"환경"}),l.jsxs("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:G,onChange:B=>ee(B.target.value),children:[l.jsx("option",{value:"dev",children:"개발"}),l.jsx("option",{value:"stage",children:"검수"}),l.jsx("option",{value:"prod",children:"운영"})]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Namespace"}),l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-ring",value:ae,onChange:B=>$(B.target.value),placeholder:"예: lms"})]})]}),l.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-5 py-4",children:[l.jsx(V,{variant:"ghost",onClick:()=>P(!1),children:"취소"}),l.jsx(V,{onClick:Ut,disabled:!J.trim()||!G.trim()||!ae.trim()||fe==="saving",children:fe==="saving"?"생성 중":"생성"})]})]})}):null,N?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-4xl overflow-hidden rounded-lg border border-border bg-card shadow-xl",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-border px-5 py-4",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"적용 로그"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:N.title})]}),l.jsx(V,{variant:"ghost",onClick:()=>j(null),children:"닫기"})]}),l.jsx("div",{className:"max-h-[70vh] overflow-auto bg-background p-5 font-mono text-xs leading-6 text-muted-foreground",children:N.logs.split(` `).filter(Boolean).map(B=>l.jsx("p",{children:B},B))})]})}):null,l.jsx(Ft,{open:Z})]})}function Jg(){const u=tr.filter(r=>r.launcherLinked).sort((r,d)=>(r.launcherOrder??999)-(d.launcherOrder??999)),x=tr.filter(r=>!r.launcherLinked);return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"런처 운영",title:"앱 연결",description:"앱 구성에 등록된 제품 앱 중 런처 홈에 노출하고 실행할 앱을 연결합니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",children:[l.jsx(yt,{className:"size-4"}),"앱 연결"]})}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"연결된 앱",description:"런처 홈에 표시할 앱과 노출 순서를 관리합니다."}),l.jsx("div",{className:"max-h-[520px] overflow-x-auto overflow-y-auto",children:l.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[l.jsx("thead",{className:"sticky top-0 z-10 border-b border-border bg-card text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"w-28 px-5 py-3 font-medium",children:"노출순서"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"앱"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"릴리즈"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"실행 경로"}),l.jsx("th",{className:"px-5 py-3 text-right font-medium",children:"관리"})]})}),l.jsx("tbody",{className:"divide-y divide-border",children:u.map(r=>l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsx("td",{className:"px-5 py-4 font-semibold",children:r.launcherOrder??"-"}),l.jsx("td",{className:"px-5 py-4 font-semibold",children:r.name}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:r.release}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:r.launchUrl}),l.jsx("td",{className:"px-5 py-4",children:l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(V,{variant:"outline",className:"size-8 px-0","aria-label":`${r.name} 위로 이동`,children:l.jsx(zi,{className:"size-4 rotate-180"})}),l.jsx(V,{variant:"outline",className:"size-8 px-0","aria-label":`${r.name} 아래로 이동`,children:l.jsx(zi,{className:"size-4"})}),l.jsx(V,{variant:"outline",className:"h-8 px-3 text-[13px]",children:"해제"})]})})]},r.key))})]})})]}),l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"미연결 앱",description:"등록은 되었지만 런처에는 보이지 않는 앱입니다."}),l.jsx("div",{className:"max-h-[520px] divide-y divide-border overflow-y-auto",children:x.map(r=>l.jsxs("div",{className:"flex items-center justify-between gap-4 px-5 py-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate text-sm font-semibold",children:r.name}),l.jsxs("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[r.key," · ",r.release]})]}),l.jsx(V,{className:"h-8 px-3 text-[13px]",children:"연결"})]},r.key))})]})]})]})}function $g(){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"플랫폼 게이트웨이",title:"연결 상태",description:"Headscale, Agent, 저장소, 런타임 명령 버스의 연결 상태를 확인합니다."}),l.jsx("div",{className:"grid gap-4 xl:grid-cols-2",children:Tg.map(u=>l.jsxs(xe,{className:"p-5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsx("p",{className:"truncate text-sm font-semibold",children:u.name}),l.jsx(Se,{tone:Ve(u.status),children:u.status})]}),l.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:u.role}),l.jsx("p",{className:"mt-4 truncate text-sm font-medium",children:u.endpoint}),l.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["마지막 동기화 ",u.lastSync]})]},u.name))})]})}function Wg(){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"플랫폼 게이트웨이",title:"Agent 관리",description:"플랫폼 게이트웨이가 수집한 Agent 등록 및 상태 정보를 관리합니다."}),l.jsx(ss,{title:"Agent 목록",description:"등록된 운영 장비 Agent입니다."})]})}function Fg(){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"플랫폼 게이트웨이",title:"장비 동기화",description:"계정, 장비, 워크스페이스 정보를 인증 서버와 Agent 상태 기준으로 동기화합니다."}),l.jsx("div",{className:"grid gap-4 xl:grid-cols-3",children:[["계정/장비 매핑","Auth Backend -> Gateway","활성"],["워크스페이스 경로","Agent -> Gateway","활성"],["원격 실행 상태","Runtime -> Gateway","주의"]].map(([u,x,r])=>l.jsxs(xe,{className:"p-5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsx("p",{className:"text-sm font-semibold",children:u}),l.jsx(Se,{tone:Ve(r),children:r})]}),l.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:x})]},u))})]})}function ss({title:u,description:x}){return l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:u,description:x}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full min-w-[920px] text-left text-sm",children:[l.jsx("thead",{className:"border-b border-border text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-5 py-3 font-medium",children:"장비"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"계정"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Workspace"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"SSH 키"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Last Seen"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"상태"})]})}),l.jsx("tbody",{className:"divide-y divide-border",children:qf.map(r=>l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsx("td",{className:"px-5 py-4 font-medium",children:r.name}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:r.account}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:r.workspace}),l.jsx("td",{className:"px-5 py-4",children:r.sshKey}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:r.lastSeen}),l.jsx("td",{className:"px-5 py-4",children:l.jsx(Se,{tone:Ve(r.status),children:r.status})})]},r.name))})]})})]})}function Ig(){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"Agent",title:"장비 등록",description:"플랫폼 장비와 계정 정보를 등록하고 Agent 연결을 준비합니다."}),l.jsx(ss,{title:"등록 장비",description:"Agent 설치 대상 장비입니다."})]})}function Pg(){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"Agent",title:"설치 상태",description:"Agent 설치, heartbeat, 상태 보고 현황을 확인합니다."}),l.jsx(ss,{title:"설치 상태",description:"장비별 Agent 상태입니다."})]})}function ey(){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"Agent",title:"SSH 키 배포",description:"Agent가 장비에 배포한 SSH 키와 배포 상태를 관리합니다."}),l.jsx(ss,{title:"SSH 키 상태",description:"장비별 SSH 키 배포 상태입니다."})]})}function ty(){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"Agent",title:"Workspace 설정",description:"원격 실행과 저장소 연동에 사용할 장비별 워크스페이스 루트를 관리합니다."}),l.jsx(ss,{title:"Workspace",description:"장비별 작업 디렉터리 설정입니다."})]})}function ay(){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"Agent",title:"원격 명령",description:"Agent를 통해 장비에 전달된 원격 명령과 실행 결과를 관리합니다."}),l.jsxs(xe,{children:[l.jsx(Ge,{title:"명령 이력",description:"최근 원격 명령 요청입니다."}),l.jsx("div",{className:"divide-y divide-border",children:Cg.map(u=>l.jsxs("div",{className:"flex items-center justify-between gap-4 px-5 py-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-semibold",children:u.command}),l.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[u.target," · ",u.requestedBy," · ",u.time]})]}),l.jsx(Se,{tone:Ve(u.status),children:u.status})]},`${u.target}-${u.command}`))})]})]})}function ly(){const u=ar.map((d,M)=>({...d,no:ar.length-M})),x=[{key:"no",header:"No.",className:"w-20 px-5 py-3 font-medium",cell:d=>l.jsx("span",{className:"font-semibold",children:d.no})},{key:"title",header:"공지",className:"w-[320px] px-5 py-3 font-medium",cell:d=>l.jsx("span",{className:"font-semibold",children:d.title})},{key:"scope",header:"대상 앱",cell:d=>l.jsx(Se,{tone:d.scope==="런처"?"violet":"blue",children:d.scope})},{key:"audience",header:"대상 사용자",cell:d=>l.jsx("span",{className:"text-muted-foreground",children:d.audience})},{key:"status",header:"상태",cell:d=>l.jsx(Se,{tone:Ve(d.status),children:d.status})},{key:"date",header:"노출일",cell:d=>l.jsx("span",{className:"text-muted-foreground",children:d.date})},{key:"actions",header:"",className:"w-20 px-5 py-3 font-medium",cell:()=>l.jsx("div",{className:"text-right",children:l.jsx(V,{variant:"ghost",className:"size-8 px-0",children:l.jsx(sa,{className:"size-4"})})})}],r=[{key:"scope",label:"대상 앱",options:[...new Set(u.map(d=>d.scope))].map(d=>({label:d,value:d})),getValue:d=>d.scope},{key:"status",label:"상태",options:[...new Set(u.map(d=>d.status))].map(d=>({label:d,value:d})),getValue:d=>d.status}];return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"운영",title:"공지사항",description:"로그인 화면, 런처 홈, 앱별 영역에 노출할 공지사항을 관리합니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",children:[l.jsx(yt,{className:"size-4"}),"공지 작성"]})}),l.jsx(Oi,{title:"목록",rows:u,columns:x,filters:r,searchPlaceholder:"공지 제목, 대상 사용자 검색",getSearchText:d=>`${d.title} ${d.scope} ${d.audience} ${d.status}`,getRowKey:d=>`${d.scope}-${d.title}-${d.date}`,pageSize:6,minWidth:980})]})}function ny(){var F,re;const{toast:u}=Ea(),[x,r]=b.useState([]),[d,M]=b.useState(!0),_=It(d),[K,Z]=b.useState(!1),[O,z]=b.useState(!1),[Y,U]=b.useState({admin:null,temporaryPassword:""}),[T,P]=b.useState({admin:null,label:"",giteaUsername:"",publicKey:""}),[J,ie]=b.useState({email:"",name:"",role:"OPERATOR",temporaryPassword:""}),[G,ee]=b.useState("idle"),[ae,$]=b.useState("idle"),[fe,oe]=b.useState("idle"),[le,W]=b.useState(""),te=()=>{M(!0),wy().then(m=>{r(m),Z(!1),M(!1)}).catch(()=>{r([]),Z(!0),M(!1)})};b.useEffect(()=>{te()},[]);const pe=()=>{ee("saving"),fetch(`${je}/admins`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}).then(m=>{if(!m.ok)throw new Error("Admin create failed");return m.json()}).then(()=>{ee("idle"),z(!1),ie({email:"",name:"",role:"OPERATOR",temporaryPassword:""}),te()}).catch(()=>ee("error"))},k=(m,N)=>{fetch(`${je}/admins/${m.id}/status`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:N})}).then(j=>{if(!j.ok)throw new Error("Admin status update failed");te()}).catch(()=>Z(!0))},he=(m,N)=>{fetch(`${je}/admins/${m.id}/role`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:N})}).then(j=>{if(!j.ok)throw new Error("Admin role update failed");te()}).catch(()=>Z(!0))},Ne=()=>{Y.admin&&($("saving"),fetch(`${je}/admins/${Y.admin.id}/password`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({temporaryPassword:Y.temporaryPassword})}).then(m=>{if(!m.ok)throw new Error("Admin password reset failed");$("idle"),U({admin:null,temporaryPassword:""}),te()}).catch(()=>$("error")))},De=m=>{const N=m.email.split("@")[0]||"admin",j=Math.random().toString(36).slice(2,8);P({admin:m,label:`${N}-${j}-key`,giteaUsername:"",publicKey:""}),oe("idle"),W("")},L=()=>{!T.admin||!T.publicKey.trim()||(oe("saving"),fetch(`${je}/admins/${T.admin.id}/ssh-keys`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:T.label.trim()||void 0,giteaUsername:T.giteaUsername.trim()||void 0,publicKey:T.publicKey.trim()})}).then(async m=>{if(!m.ok){const N=await m.json().catch(()=>null),j=Array.isArray(N==null?void 0:N.message)?N.message.join(", "):N==null?void 0:N.message;throw new Error(j||"SSH 키 등록에 실패했습니다.")}return m.json()}).then(()=>{oe("idle"),W(""),P({admin:null,label:"",giteaUsername:"",publicKey:""}),u({type:"success",title:"SSH 키 등록 완료",message:"관리자 SSH 키가 등록되었습니다."}),te()}).catch(m=>{W(m.message),oe("error"),u({type:"error",title:"SSH 키 등록 실패",message:m.message})}))},ue=(m,N)=>{fetch(`${je}/admins/${m.id}/ssh-keys/${N}`,{method:"DELETE"}).then(j=>{if(!j.ok)throw new Error("Admin SSH key delete failed");P({admin:null,label:"",giteaUsername:"",publicKey:""}),u({type:"success",title:"SSH 키 삭제 완료",message:"관리자 SSH 키가 삭제되었습니다."}),te()}).catch(()=>{oe("error"),u({type:"error",title:"SSH 키 삭제 실패",message:"SSH 키 삭제 요청이 실패했습니다."})})},f=x.map((m,N)=>({...m,no:x.length-N,state:m.isActive?"활성":"비활성"})),v=[{key:"no",header:"No.",className:"w-20 px-5 py-3 font-medium",cell:m=>l.jsx("span",{className:"font-semibold",children:m.no})},{key:"name",header:"관리자",className:"w-[260px] px-5 py-3 font-medium",cell:m=>l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold",children:m.name}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:m.email})]})},{key:"role",header:"권한",cell:m=>l.jsxs("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-xs font-semibold outline-none focus:ring-2 focus:ring-ring",value:m.role,onChange:N=>he(m,N.target.value),children:[l.jsx("option",{value:"OWNER",children:"OWNER"}),l.jsx("option",{value:"ADMIN",children:"ADMIN"}),l.jsx("option",{value:"OPERATOR",children:"OPERATOR"}),l.jsx("option",{value:"VIEWER",children:"VIEWER"})]})},{key:"session",header:"최근 세션",cell:m=>{var X;const N=(X=m.sessions)==null?void 0:X[0],j=N?N.revokedAt?"종료":"활성":"세션 없음";return l.jsx(Se,{tone:Ve(j),children:j})}},{key:"sshKeys",header:"SSH 키",cell:m=>{var j,X;const N=(j=m.sshKeys)==null?void 0:j[0];return N?l.jsxs("div",{children:[l.jsxs(Se,{tone:"green",children:[((X=m.sshKeys)==null?void 0:X.length)??0,"개"]}),l.jsx("p",{className:"mt-1 max-w-44 truncate font-mono text-xs text-muted-foreground",children:N.fingerprint})]}):l.jsx(Se,{tone:"neutral",children:"미등록"})}},{key:"lastLoginAt",header:"마지막 로그인",cell:m=>l.jsx("span",{className:"text-muted-foreground",children:Wt(m.lastLoginAt)})},{key:"state",header:"상태",cell:m=>l.jsx(Se,{tone:Ve(m.state),children:m.state})},{key:"actions",header:"",className:"w-32 px-5 py-3 text-right font-medium",cell:m=>l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(V,{variant:"outline",className:"size-8 px-0",title:"SSH 키 등록","aria-label":"SSH 키 등록",onClick:()=>De(m),children:l.jsx(Zp,{className:"size-4"})}),l.jsx(V,{variant:"outline",className:"size-8 px-0",title:m.isActive?"비활성화":"활성화","aria-label":m.isActive?"비활성화":"활성화",onClick:()=>k(m,!m.isActive),children:m.isActive?l.jsx(Uf,{className:"size-4"}):l.jsx(Ai,{className:"size-4"})}),l.jsx(V,{variant:"outline",className:"size-8 px-0",title:"비밀번호 초기화","aria-label":"비밀번호 초기화",onClick:()=>U({admin:m,temporaryPassword:""}),children:l.jsx(Rf,{className:"size-4"})})]})}],Q=[{key:"role",label:"권한",options:[...new Set(f.map(m=>m.role))].map(m=>({label:m,value:m})),getValue:m=>m.role},{key:"state",label:"상태",options:[...new Set(f.map(m=>m.state))].map(m=>({label:m,value:m})),getValue:m=>m.state}];return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"운영",title:"관리자 관리",description:"스튜디오 어드민 콘솔에 접근할 운영자 계정과 권한을 관리합니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",onClick:()=>z(!0),children:[l.jsx(yt,{className:"size-4"}),"관리자 등록"]})}),K?l.jsx("div",{className:"mb-4 rounded-md border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:"관리자 데이터를 불러오지 못했습니다."}):null,l.jsx(Oi,{title:"목록",rows:f,columns:v,filters:Q,searchPlaceholder:"관리자명, 이메일, 권한 검색",getSearchText:m=>`${m.name} ${m.email} ${m.role} ${m.state}`,getRowKey:m=>m.id,pageSize:6,minWidth:1180,loading:d}),l.jsx(Ft,{open:_}),O?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-lg rounded-lg border border-border bg-card p-5 shadow-xl",children:[l.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[l.jsx("h2",{className:"text-sm font-semibold",children:"관리자 등록"}),l.jsx(V,{variant:"ghost",className:"h-8 px-3 text-[13px]",onClick:()=>z(!1),children:"닫기"})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("label",{className:"block text-xs font-medium text-muted-foreground",children:["이메일",l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:J.email,onChange:m=>ie(N=>({...N,email:m.target.value}))})]}),l.jsxs("label",{className:"block text-xs font-medium text-muted-foreground",children:["이름",l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:J.name,onChange:m=>ie(N=>({...N,name:m.target.value}))})]}),l.jsxs("label",{className:"block text-xs font-medium text-muted-foreground",children:["권한",l.jsxs("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:J.role,onChange:m=>ie(N=>({...N,role:m.target.value})),children:[l.jsx("option",{value:"OWNER",children:"OWNER"}),l.jsx("option",{value:"ADMIN",children:"ADMIN"}),l.jsx("option",{value:"OPERATOR",children:"OPERATOR"}),l.jsx("option",{value:"VIEWER",children:"VIEWER"})]})]}),l.jsxs("label",{className:"block text-xs font-medium text-muted-foreground",children:["임시 비밀번호",l.jsx("input",{type:"password",className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:J.temporaryPassword,onChange:m=>ie(N=>({...N,temporaryPassword:m.target.value}))})]}),G==="error"?l.jsx("p",{className:"text-xs text-rose-300",children:"관리자 등록에 실패했습니다. 이메일 중복과 비밀번호 길이를 확인하세요."}):null]}),l.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[l.jsx(V,{variant:"outline",onClick:()=>z(!1),children:"취소"}),l.jsx(V,{onClick:pe,disabled:!J.email.trim()||!J.name.trim()||J.temporaryPassword.length<8||G==="saving",children:G==="saving"?"등록 중":"등록"})]})]})}):null,Y.admin?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-md rounded-lg border border-border bg-card p-5 shadow-xl",children:[l.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[l.jsx("h2",{className:"text-sm font-semibold",children:"비밀번호 초기화"}),l.jsx(V,{variant:"ghost",className:"h-8 px-3 text-[13px]",onClick:()=>U({admin:null,temporaryPassword:""}),children:"닫기"})]}),l.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:Y.admin.email}),l.jsxs("label",{className:"block text-xs font-medium text-muted-foreground",children:["임시 비밀번호",l.jsx("input",{type:"password",className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:Y.temporaryPassword,onChange:m=>U(N=>({...N,temporaryPassword:m.target.value}))})]}),ae==="error"?l.jsx("p",{className:"mt-3 text-xs text-rose-300",children:"비밀번호 초기화에 실패했습니다. 8자 이상으로 입력하세요."}):null,l.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[l.jsx(V,{variant:"outline",onClick:()=>U({admin:null,temporaryPassword:""}),children:"취소"}),l.jsx(V,{onClick:Ne,disabled:Y.temporaryPassword.length<8||ae==="saving",children:ae==="saving"?"저장 중":"저장"})]})]})}):null,T.admin?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-2xl rounded-lg border border-border bg-card p-5 shadow-xl",children:[l.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"Gitea SSH 키 등록"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:T.admin.email})]}),l.jsx(V,{variant:"ghost",className:"h-8 px-3 text-[13px]",onClick:()=>P({admin:null,label:"",giteaUsername:"",publicKey:""}),children:"닫기"})]}),l.jsxs("div",{className:"space-y-4",children:[(((F=T.admin.sshKeys)==null?void 0:F.length)??0)>0?l.jsxs("div",{className:"rounded-md border border-border bg-muted/20",children:[l.jsx("div",{className:"border-b border-border px-4 py-3 text-xs font-medium text-muted-foreground",children:"등록된 SSH 키"}),l.jsx("div",{className:"max-h-40 divide-y divide-border overflow-y-auto",children:(re=T.admin.sshKeys)==null?void 0:re.map(m=>l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate text-sm font-semibold",children:m.label||m.keyType}),l.jsxs("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:[m.fingerprint,m.giteaUsername?` · ${m.giteaUsername}`:""]})]}),l.jsx(V,{variant:"outline",className:"size-8 px-0",title:"SSH 키 삭제","aria-label":"SSH 키 삭제",onClick:()=>ue(T.admin,m.id),children:l.jsx(mr,{className:"size-4"})})]},m.id))})]}):null,l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsxs("label",{className:"block text-xs font-medium text-muted-foreground",children:["키 이름",l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:T.label,onChange:m=>P(N=>({...N,label:m.target.value}))})]}),l.jsxs("label",{className:"block text-xs font-medium text-muted-foreground",children:["Gitea 사용자명",l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:T.giteaUsername,onChange:m=>P(N=>({...N,giteaUsername:m.target.value}))})]})]}),l.jsxs("label",{className:"block text-xs font-medium text-muted-foreground",children:["SSH 공개키",l.jsx("textarea",{className:"mt-2 min-h-28 w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-xs text-foreground outline-none focus:ring-2 focus:ring-ring",value:T.publicKey,onChange:m=>P(N=>({...N,publicKey:m.target.value}))})]}),fe==="error"?l.jsx("p",{className:"text-xs text-rose-300",children:le||"SSH 키 등록에 실패했습니다. 공개키 형식, 중복 여부, Gitea 사용자명을 확인하세요."}):null]}),l.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[l.jsx(V,{variant:"outline",onClick:()=>P({admin:null,label:"",giteaUsername:"",publicKey:""}),children:"취소"}),l.jsx(V,{onClick:L,disabled:!T.publicKey.trim()||fe==="saving",children:fe==="saving"?"등록 중":"등록"})]})]})}):null]})}function sy(){const[u,x]=b.useState([]),[r,d]=b.useState(!0),M=It(r),[_,K]=b.useState(!1),Z=()=>{d(!0),Gf().then(T=>{x(T),K(!1),d(!1)}).catch(()=>{x([]),K(!0),d(!1)})};b.useEffect(()=>{Z()},[]);const O=T=>{fetch(`${je}/users/${T}/lock`,{method:"PATCH"}).then(P=>{if(!P.ok)throw new Error("User lock failed");Z()}).catch(()=>K(!0))},z=T=>{T&&fetch(`${je}/users/sessions/${T}`,{method:"DELETE"}).then(P=>{if(!P.ok)throw new Error("Session terminate failed");Z()}).catch(()=>K(!0))},Y=[{key:"no",header:"No.",className:"w-20 px-5 py-3 font-medium",cell:T=>l.jsx("span",{className:"font-semibold",children:T.no})},{key:"user",header:"사용자",className:"w-[220px] px-5 py-3 font-medium",cell:T=>l.jsx("span",{className:"font-semibold",children:T.user})},{key:"role",header:"권한",cell:T=>l.jsx("span",{className:"text-muted-foreground",children:T.role})},{key:"session",header:"세션",cell:T=>l.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:T.session})},{key:"expiresAt",header:"만료",cell:T=>l.jsx("span",{className:"text-muted-foreground",children:Wt(T.expiresAt)})},{key:"lastSeen",header:"Last Seen",cell:T=>l.jsx("span",{className:"text-muted-foreground",children:Wt(T.lastSeen)})},{key:"state",header:"상태",cell:T=>l.jsx(Se,{tone:Ve(T.state),children:T.state})},{key:"actions",header:"",className:"w-52 px-5 py-3 text-right font-medium",cell:T=>l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(V,{variant:"outline",className:"size-8 px-0",title:"잠금","aria-label":"잠금",onClick:()=>O(T.userId),children:l.jsx(Uf,{className:"size-4"})}),l.jsx(V,{variant:"outline",className:"size-8 px-0",title:"세션 종료","aria-label":"세션 종료",disabled:!T.sessionId||T.state==="종료"||T.state==="만료",onClick:()=>z(T.sessionId),children:l.jsx(eg,{className:"size-4"})}),l.jsx(V,{variant:"ghost",className:"size-8 px-0",children:l.jsx(sa,{className:"size-4"})})]})}],U=[{key:"state",label:"상태",options:[...new Set(u.map(T=>T.state))].map(T=>({label:T,value:T})),getValue:T=>T.state}];return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"운영",title:"사용자/세션",description:"접속 중인 사용자와 세션 상태를 확인하고 필요한 제어 작업을 실행합니다."}),_?l.jsx("div",{className:"mb-4 rounded-md border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:"사용자/세션 데이터를 불러오지 못했습니다."}):null,l.jsx(Oi,{title:"목록",rows:u,columns:Y,filters:U,searchPlaceholder:"사용자, 이메일, 권한, 세션 검색",getSearchText:T=>`${T.user} ${T.email} ${T.role} ${T.session} ${T.state}`,getRowKey:T=>T.id,pageSize:6,minWidth:1180,loading:r}),l.jsx(Ft,{open:M})]})}function iy(){const u=[{key:"user",header:"사용자",className:"w-[260px] px-5 py-3 font-medium",cell:r=>l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold",children:r.user}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:r.name})]})},{key:"code",header:"Code",cell:r=>l.jsx("span",{className:"font-semibold",children:r.code})},{key:"licenseName",header:"라이선스명",cell:r=>l.jsx("span",{className:"text-muted-foreground",children:r.licenseName})},{key:"startsAt",header:"시작일",cell:r=>l.jsx("span",{className:"text-muted-foreground",children:r.startsAt})},{key:"expiresAt",header:"만료일",cell:r=>l.jsx("span",{className:"text-muted-foreground",children:r.expiresAt})},{key:"assignedBy",header:"부여자",cell:r=>l.jsx("span",{className:"text-muted-foreground",children:r.assignedBy})},{key:"status",header:"상태",cell:r=>l.jsx(Se,{tone:Ve(r.status),children:r.status})},{key:"actions",header:"",className:"w-28 px-5 py-3 text-right font-medium",cell:()=>l.jsx("div",{className:"text-right",children:l.jsx(V,{variant:"ghost",className:"size-8 px-0",children:l.jsx(sa,{className:"size-4"})})})}],x=[{key:"code",label:"Code",options:Ef.map(r=>({label:r.code,value:r.code})),getValue:r=>r.code},{key:"status",label:"상태",options:[...new Set(wf.map(r=>r.status))].map(r=>({label:r,value:r})),getValue:r=>r.status}];return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"운영",title:"라이센스",description:"공통 인증 DB의 licenses, user_licenses 기준으로 라이센스 플랜과 사용자 부여 이력을 관리합니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",children:[l.jsx(yt,{className:"size-4"}),"라이센스 부여"]})}),l.jsx("div",{className:"grid gap-4 xl:grid-cols-3",children:Ef.map(r=>l.jsxs(xe,{className:"p-5",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-semibold",children:r.code}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:r.name})]}),l.jsx(Se,{tone:Ve(r.status),children:r.status})]}),l.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:r.description}),l.jsxs("div",{className:"mt-5 grid grid-cols-3 gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"부여"}),l.jsx("p",{className:"mt-1 text-xl font-semibold",children:r.assigned})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"활성"}),l.jsx("p",{className:"mt-1 text-xl font-semibold",children:r.activeUsers})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"만료임박"}),l.jsx("p",{className:"mt-1 text-xl font-semibold",children:r.expiringSoon})]})]}),l.jsxs("p",{className:"mt-4 text-xs text-muted-foreground",children:["기본 기간 ",r.defaultDurationDays,"일"]})]},r.code))}),l.jsx("div",{className:"mt-4",children:l.jsx(Oi,{title:"부여 이력",rows:wf,columns:u,filters:x,searchPlaceholder:"사용자, 라이선스, 부여자 검색",getSearchText:r=>`${r.user} ${r.name} ${r.code} ${r.licenseName} ${r.assignedBy} ${r.status}`,getRowKey:r=>`${r.user}-${r.code}-${r.startsAt}`,pageSize:6,minWidth:1120})})]})}function cy(){const[u,x]=b.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"런처 운영",title:"공통 설정",description:"런처가 atnmy-stdo-auth, 플랫폼 Gitea, 플랫폼 게이트웨이, 테일스케일 상태 조회와 연결되는 정보를 관리합니다.",actions:l.jsxs(l.Fragment,{children:[l.jsxs(V,{variant:"outline",className:"h-8 px-3 text-[13px]",onClick:()=>x(!0),children:[l.jsx(rr,{className:"size-4"}),"공통 인증 API 보기"]}),l.jsxs(V,{className:"h-8 px-3 text-[13px]",children:[l.jsx(yt,{className:"size-4"}),"설정 추가"]})]})}),l.jsx("div",{className:"grid gap-4 md:grid-cols-4",children:[["설정 항목",`${es.length}개`],["Endpoint",`${es.filter(r=>r.type==="endpoint").length}개`],["Database",`${es.filter(r=>r.type==="database").length}개`],["활성 상태",`${es.filter(r=>r.status==="활성").length}개`]].map(([r,d])=>l.jsxs(xe,{className:"p-5",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:r}),l.jsx("p",{className:"mt-3 text-2xl font-semibold",children:d})]},r))}),l.jsx("div",{className:"mt-4",children:l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"런처 연결 설정",description:"세부 운영 설정이 아니라 런처가 공통 인프라에 접근하기 위한 연결 정보입니다."}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full min-w-[1120px] text-left text-sm",children:[l.jsx("thead",{className:"border-b border-border text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"w-[280px] px-5 py-3 font-medium",children:"설정"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Key"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Type"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Value"}),l.jsx("th",{className:"px-5 py-3 font-medium"})]})}),l.jsx("tbody",{className:"divide-y divide-border",children:es.map(r=>l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsx("td",{className:"px-5 py-4",children:l.jsxs("p",{className:"inline-flex items-center gap-2 font-medium",children:[l.jsx("span",{className:Pe("size-2 rounded-full",r.status==="활성"?"bg-emerald-400":r.status==="주의"?"bg-amber-400":"bg-muted-foreground")}),r.name]})}),l.jsx("td",{className:"px-5 py-4 font-medium",children:r.key}),l.jsx("td",{className:"px-5 py-4",children:r.type}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:r.value}),l.jsx("td",{className:"px-5 py-4 text-right",children:l.jsx(V,{variant:"ghost",className:"size-8 px-0",children:l.jsx(sa,{className:"size-4"})})})]},r.key))})]})})]})}),u?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/35 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-5xl overflow-hidden rounded-lg border border-border bg-card shadow-2xl",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-border px-5 py-4",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-base font-semibold",children:"공통 인증 API"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"atnmy-stdo-auth에서 제공하는 런처 및 앱 연동 엔드포인트입니다."})]}),l.jsx(V,{variant:"ghost",className:"h-8 px-3 text-[13px]",onClick:()=>x(!1),children:"닫기"})]}),l.jsx("div",{className:"max-h-[70vh] overflow-x-auto overflow-y-auto",children:l.jsxs("table",{className:"w-full min-w-[980px] text-left text-sm",children:[l.jsx("thead",{className:"sticky top-0 z-10 border-b border-border bg-card text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-5 py-3 font-medium",children:"그룹"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Method"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Path"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"용도"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"권한"})]})}),l.jsx("tbody",{className:"divide-y divide-border",children:zg.map(r=>l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsx("td",{className:"px-5 py-4",children:r.group}),l.jsx("td",{className:"px-5 py-4 font-semibold",children:r.method}),l.jsx("td",{className:"px-5 py-4 font-medium",children:r.path}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:r.purpose}),l.jsx("td",{className:"px-5 py-4",children:l.jsx(Se,{tone:r.auth==="없음"?"neutral":r.auth==="ADMIN"?"amber":"blue",children:r.auth})})]},`${r.method}-${r.path}`))})]})})]})}):null]})}function uy(){const{toast:u}=Ea(),[x,r]=b.useState([]),[d,M]=b.useState([]),[_,K]=b.useState([]),[Z,O]=b.useState(!0),[z,Y]=b.useState("loading"),U=It(z==="loading"||Z),[T,P]=b.useState(!1),[J,ie]=b.useState(!1),[G,ee]=b.useState(""),[ae,$]=b.useState(""),[fe,oe]=b.useState("CONTAINER"),[le,W]=b.useState(""),[te,pe]=b.useState("develop"),[k,he]=b.useState("idle"),[Ne,De]=b.useState(""),[L,ue]=b.useState(""),[f,v]=b.useState(!0),[Q,F]=b.useState(!0),[re,m]=b.useState(!0),[N,j]=b.useState("idle");b.useEffect(()=>{let w=!0;return za().then(ne=>{w&&(M(ne),ee(Je=>{const We=gl(ne,Je);return pt(We),We}))}).catch(()=>M([])),O(!0),nr().then(ne=>{w&&(K(ne),O(!1))}).catch(()=>{w&&(K([]),O(!1))}),lr().then(ne=>{if(!w)return null;if(!ne.ok)throw new Error("Gitea repositories request failed");return ne.json()}).then(ne=>{!w||!ne||(r(ne.repos??[]),Y("ready"))}).catch(()=>{w&&Y("error")}),()=>{w=!1}},[]);const X=()=>{Y("loading"),lr().then(w=>{if(!w.ok)throw new Error("Gitea repositories request failed");return w.json()}).then(w=>{r(w.repos??[]),Y("ready")}).catch(()=>Y("error"))},I=()=>{Ne.trim()&&(j("saving"),fetch(`${je}/gitea/orgs/platform/repos`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:Ne.trim(),description:L.trim()||void 0,private:f,autoInit:!0,createDevelopBranch:Q,createReleaseBranch:re})}).then(w=>{if(!w.ok)throw new Error("Gitea repository create failed");return w.json()}).then(()=>{De(""),ue(""),v(!0),F(!0),m(!0),j("idle"),P(!1),X()}).catch(()=>j("error")))},p=()=>{za().then(M).catch(()=>M([])),O(!0),nr().then(w=>{K(w),O(!1)}).catch(()=>{K([]),O(!1)})},q=()=>{!G||!ae.trim()||(he("saving"),fetch(`${je}/apps/${G}/components`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ae.trim(),type:fe,repository:le||void 0,branch:te||void 0,buildTarget:Ci(fe)})}).then(w=>{if(!w.ok)throw new Error("Component create failed");return w.json()}).then(()=>{$(""),oe("CONTAINER"),W(""),pe("develop"),he("idle"),ie(!1),p()}).catch(()=>he("error")))};return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"어플리케이션",title:"소스 관리",description:"플랫폼 Gitea에 등록된 앱별 저장소, 브랜치, 커밋, 빌드 대상을 관리합니다.",actions:l.jsxs(l.Fragment,{children:[l.jsxs(V,{variant:"outline",className:"h-8 px-3 text-[13px]",onClick:()=>ie(!0),children:[l.jsx(yt,{className:"size-4"}),"구성요소 추가"]}),l.jsxs(V,{className:"h-8 px-3 text-[13px]",onClick:()=>P(!0),children:[l.jsx(yt,{className:"size-4"}),"저장소 생성"]})]})}),l.jsxs(xe,{className:"mb-4 min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"Gitea 저장소",description:"platform 조직에 등록된 앱/런처 소스를 앱 구성요소의 Repository로 연결합니다."}),l.jsx("div",{className:"max-h-[300px] overflow-x-auto overflow-y-auto",children:l.jsxs("table",{className:"w-full min-w-[900px] text-left text-sm",children:[l.jsx("thead",{className:"sticky top-0 z-10 border-b border-border bg-card text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-5 py-3 font-medium",children:"Repository"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Owner"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"기본 브랜치"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"언어"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Clone URL"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"상태"})]})}),l.jsx("tbody",{className:"divide-y divide-border",children:z==="error"?l.jsx("tr",{children:l.jsx("td",{className:"px-5 py-6 text-center text-muted-foreground",colSpan:6,children:"백엔드 연결 후 Gitea 저장소가 표시됩니다."})}):z!=="loading"&&x.length===0?l.jsx("tr",{children:l.jsx("td",{className:"px-5 py-6 text-center text-muted-foreground",colSpan:6,children:"platform 조직에 등록된 저장소가 없습니다."})}):x.map(w=>l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsxs("td",{className:"px-5 py-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-semibold",children:w.fullName}),l.jsx("a",{href:w.htmlUrl,target:"_blank",rel:"noreferrer",className:"text-muted-foreground hover:text-foreground",children:l.jsx(rr,{className:"size-3.5"})})]}),w.description?l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:w.description}):null]}),l.jsx("td",{className:"px-5 py-4",children:w.owner}),l.jsx("td",{className:"px-5 py-4",children:w.defaultBranch}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:w.language||"-"}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:w.cloneUrl}),l.jsx("td",{className:"px-5 py-4",children:l.jsx(Se,{tone:w.private?"amber":"blue",children:w.private?"Private":"Public"})})]},w.id))})]})})]}),l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"Gitea 소스 연결",description:"앱 구성요소별 저장소와 빌드 대상을 확인합니다."}),l.jsx("div",{className:"max-h-[620px] overflow-x-auto overflow-y-auto",children:l.jsxs("table",{className:"w-full min-w-[1120px] text-left text-sm",children:[l.jsx("thead",{className:"sticky top-0 z-10 border-b border-border bg-card text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-5 py-3 font-medium",children:"앱"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"구성요소"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Repository"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"기본 브랜치"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Commit"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"유형"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"빌드 대상"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Clone URL"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"상태"})]})}),l.jsx("tbody",{className:"divide-y divide-border",children:!Z&&_.length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:9,className:"px-5 py-6 text-center text-muted-foreground",children:"등록된 앱 구성요소가 없습니다."})}):!Z&&_.map(w=>{var ne;return l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsx("td",{className:"px-5 py-4 font-semibold",children:((ne=w.app)==null?void 0:ne.name)??"-"}),l.jsx("td",{className:"px-5 py-4",children:w.name}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:w.repository||"미연결"}),l.jsx("td",{className:"px-5 py-4",children:w.branch||"-"}),l.jsx("td",{className:"px-5 py-4 font-medium",children:"-"}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:w.type}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:w.buildTarget||"-"}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:w.repository?l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"font-mono text-xs",children:Mi(w.repository)}),l.jsx("button",{type:"button",title:"HTTP clone URL 복사",className:"inline-flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",onClick:()=>cr(Mi(w.repository),()=>u({type:"success",message:"복사되었습니다."}),()=>u({type:"error",message:"복사에 실패했습니다."})),children:l.jsx(er,{className:"size-3.5"})})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"font-mono text-xs",children:Mf(w.repository)}),l.jsx("button",{type:"button",title:"SSH clone URL 복사",className:"inline-flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",onClick:()=>cr(Mf(w.repository),()=>u({type:"success",message:"복사되었습니다."}),()=>u({type:"error",message:"복사에 실패했습니다."})),children:l.jsx(er,{className:"size-3.5"})})]})]}):"-"}),l.jsx("td",{className:"px-5 py-4",children:l.jsx(Se,{tone:w.repository?"green":"neutral",children:w.repository?"연결됨":"미연결"})})]},w.id)})})]})})]}),J?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",children:l.jsxs("div",{className:"w-full max-w-lg rounded-lg border border-border bg-card shadow-xl",children:[l.jsx("div",{className:"border-b border-border px-5 py-4",children:l.jsx("h2",{className:"text-sm font-semibold",children:"앱 구성요소 추가"})}),l.jsxs("div",{className:"space-y-4 px-5 py-5",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"앱 그룹"}),l.jsxs("select",{value:G,onChange:w=>{pt(w.target.value),ee(w.target.value)},className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary",children:[d.length===0?l.jsx("option",{value:"",children:"등록된 앱 없음"}):null,d.map(w=>l.jsx("option",{value:w.id,children:w.name},w.id))]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"구성요소명"}),l.jsx("input",{value:ae,onChange:w=>$(w.target.value),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"유형"}),l.jsxs("select",{value:fe,onChange:w=>oe(w.target.value),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary",children:[l.jsx("option",{value:"ELECTRON",children:"ELECTRON"}),l.jsx("option",{value:"CONTAINER",children:"CONTAINER"}),l.jsx("option",{value:"STATIC_WEB",children:"STATIC_WEB"}),l.jsx("option",{value:"DATABASE",children:"DATABASE"}),l.jsx("option",{value:"MIGRATION",children:"MIGRATION"})]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Repository"}),l.jsxs("select",{value:le,onChange:w=>W(w.target.value),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary",children:[l.jsx("option",{value:"",children:"미연결"}),x.map(w=>l.jsx("option",{value:w.fullName,children:w.fullName},w.id))]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"기본 브랜치"}),l.jsxs("select",{value:te,onChange:w=>pe(w.target.value),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary",children:[l.jsx("option",{value:"develop",children:"develop"}),l.jsx("option",{value:"release",children:"release"}),l.jsx("option",{value:"main",children:"main"})]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"빌드 대상"}),l.jsx("input",{value:Ci(fe),readOnly:!0,className:"mt-2 h-9 w-full rounded-md border border-border bg-muted/40 px-3 text-sm text-muted-foreground outline-none"})]}),k==="error"?l.jsx("p",{className:"text-xs text-rose-300",children:"구성요소 저장에 실패했습니다."}):null]}),l.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-5 py-4",children:[l.jsx(V,{variant:"ghost",onClick:()=>ie(!1),children:"취소"}),l.jsx(V,{onClick:q,disabled:!G||!ae.trim()||k==="saving",children:k==="saving"?"저장 중":"저장"})]})]})}):null,T?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",children:l.jsxs("div",{className:"w-full max-w-lg rounded-lg border border-border bg-card shadow-xl",children:[l.jsx("div",{className:"border-b border-border px-5 py-4",children:l.jsx("h2",{className:"text-sm font-semibold",children:"platform 저장소 생성"})}),l.jsxs("div",{className:"space-y-4 px-5 py-5",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"저장소명"}),l.jsx("input",{value:Ne,onChange:w=>De(w.target.value),className:"mt-2 h-9 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus:border-primary"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"설명"}),l.jsx("textarea",{value:L,onChange:w=>ue(w.target.value),className:"mt-2 min-h-20 w-full rounded-md border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary"})]}),l.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[l.jsx("input",{type:"checkbox",checked:f,onChange:w=>v(w.target.checked),className:"size-4 accent-primary"}),"Private 저장소로 생성"]}),l.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[l.jsx("input",{type:"checkbox",checked:Q,onChange:w=>F(w.target.checked),className:"size-4 accent-primary"}),"develop 브랜치 자동 생성"]}),l.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[l.jsx("input",{type:"checkbox",checked:re,onChange:w=>m(w.target.checked),className:"size-4 accent-primary"}),"release 브랜치 자동 생성"]}),N==="error"?l.jsx("p",{className:"text-xs text-rose-300",children:"저장소 생성에 실패했습니다. GITEA_ADMIN_TOKEN 권한과 중복 저장소명을 확인하세요."}):null]}),l.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-5 py-4",children:[l.jsx(V,{variant:"ghost",onClick:()=>P(!1),children:"취소"}),l.jsx(V,{onClick:I,disabled:!Ne.trim()||N==="saving",children:N==="saving"?"생성 중":"생성"})]})]})}):null,l.jsx(Ft,{open:U})]})}function lr(){return fetch(`${je}/gitea/repos?owner=platform&limit=8`)}function ry(){return fetch(`${je}/launcher/versions`).then(u=>{if(!u.ok)throw new Error("Launcher versions request failed");return u.json()})}function za(){return fetch(`${je}/apps`).then(u=>{if(!u.ok)throw new Error("Apps request failed");return u.json()})}function nr(){return fetch(`${je}/apps/sources`).then(u=>{if(!u.ok)throw new Error("App sources request failed");return u.json()})}function sr(){return fetch(`${je}/apps/builds`).then(u=>{if(!u.ok)throw new Error("Build jobs request failed");return u.json()})}function Cf(u){return fetch(`${je}/apps/builds`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}).then(async x=>{if(!x.ok){const r=await x.json().catch(()=>null),d=Array.isArray(r==null?void 0:r.message)?r.message.join(", "):r==null?void 0:r.message;throw new Error(d||"Build job request failed")}return x.json()})}function dy(u){return fetch(`${je}/apps/builds/${u}/cancel`,{method:"PATCH"}).then(async x=>{if(!x.ok){const r=await x.json().catch(()=>null),d=Array.isArray(r==null?void 0:r.message)?r.message.join(", "):r==null?void 0:r.message;throw new Error(d||"Build job cancel failed")}return x.json()})}function oy(u){return fetch(`${je}/apps/builds/${u}`,{method:"DELETE"}).then(async x=>{if(!x.ok){const r=await x.json().catch(()=>null),d=Array.isArray(r==null?void 0:r.message)?r.message.join(", "):r==null?void 0:r.message;throw new Error(d||"Build job delete failed")}return x.json()})}function fr(){return fetch(`${je}/apps/releases`).then(u=>{if(!u.ok)throw new Error("App releases request failed");return u.json()})}function my(u){return fetch(`${je}/apps/releases`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}).then(async x=>{if(!x.ok){const r=await x.json().catch(()=>null),d=Array.isArray(r==null?void 0:r.message)?r.message.join(", "):r==null?void 0:r.message;throw new Error(d||"App release request failed")}return x.json()})}function fy(){return fetch(`${je}/apps/deployments`).then(u=>{if(!u.ok)throw new Error("Deployment jobs request failed");return u.json()})}function xy(u){return fetch(`${je}/apps/deployments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}).then(async x=>{if(!x.ok){const r=await x.json().catch(()=>null),d=Array.isArray(r==null?void 0:r.message)?r.message.join(", "):r==null?void 0:r.message;throw new Error(d||"Deployment job request failed")}return x.json()})}function hy(){return fetch(`${je}/apps/migrations`).then(u=>{if(!u.ok)throw new Error("Migration jobs request failed");return u.json()})}function py(u){return fetch(`${je}/apps/migrations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}).then(async x=>{if(!x.ok){const r=await x.json().catch(()=>null),d=Array.isArray(r==null?void 0:r.message)?r.message.join(", "):r==null?void 0:r.message;throw new Error(d||"Migration job request failed")}return x.json()})}function gy(u){return fetch(`${je}/apps/runtime-namespaces/${encodeURIComponent(u)}`).then(async x=>{if(!x.ok){const r=await x.json().catch(()=>null),d=Array.isArray(r==null?void 0:r.message)?r.message.join(", "):r==null?void 0:r.message;throw new Error(d||"Namespace check failed")}return x.json()})}function yy(u){return fetch(`${je}/apps/runtime-namespaces`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({namespace:u})}).then(async x=>{if(!x.ok){const r=await x.json().catch(()=>null),d=Array.isArray(r==null?void 0:r.message)?r.message.join(", "):r==null?void 0:r.message;throw new Error(d||"Namespace ensure failed")}return x.json()})}function by(u,x){return fetch(`${je}/apps/runtime-deployments/${encodeURIComponent(u)}/${encodeURIComponent(x)}/restart`,{method:"PATCH"}).then(async r=>{if(!r.ok){const d=await r.json().catch(()=>null),M=Array.isArray(d==null?void 0:d.message)?d.message.join(", "):d==null?void 0:d.message;throw new Error(M||"Deployment restart failed")}return r.json()})}function vy(u,x,r,d){return fetch(`${je}/runtime/workloads/${encodeURIComponent(u)}/${encodeURIComponent(x)}/${encodeURIComponent(r)}/scale`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({replicas:d})}).then(async M=>{if(!M.ok){const _=await M.json().catch(()=>null),K=Array.isArray(_==null?void 0:_.message)?_.message.join(", "):_==null?void 0:_.message;throw new Error(K||"Workload scale failed")}return M.json()})}function jy(u){return fetch(`${je}/apps/runtime-namespaces/${encodeURIComponent(u)}/resources`).then(async x=>{if(!x.ok){const r=await x.json().catch(()=>null),d=Array.isArray(r==null?void 0:r.message)?r.message.join(", "):r==null?void 0:r.message;throw new Error(d||"Runtime resources request failed")}return x.json()})}function Ny(u){return fetch(`${je}/apps/runtime-profiles`).then(r=>{if(!r.ok)throw new Error("Runtime profiles request failed");return r.json()})}function Sy(u){return fetch(`${je}/apps/runtime-profiles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}).then(async x=>{if(!x.ok){const r=await x.json().catch(()=>null),d=Array.isArray(r==null?void 0:r.message)?r.message.join(", "):r==null?void 0:r.message;throw new Error(d||"Runtime profile request failed")}return x.json()})}function Ay(u,x){return fetch(`${je}/apps/runtime-profiles/${u}/variables`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)}).then(async r=>{if(!r.ok){const d=await r.json().catch(()=>null),M=Array.isArray(d==null?void 0:d.message)?d.message.join(", "):d==null?void 0:d.message;throw new Error(M||"Runtime variable request failed")}return r.json()})}function zy(u,x){return fetch(`${je}/apps/runtime-profiles/${u}/variables/${x}`,{method:"DELETE"}).then(async r=>{if(!r.ok){const d=await r.json().catch(()=>null),M=Array.isArray(d==null?void 0:d.message)?d.message.join(", "):d==null?void 0:d.message;throw new Error(M||"Runtime variable delete failed")}return r.json()})}function Ey(u){return fetch(`${je}/apps/runtime-profiles/${u}/apply`,{method:"PATCH"}).then(async x=>{if(!x.ok){const r=await x.json().catch(()=>null),d=Array.isArray(r==null?void 0:r.message)?r.message.join(", "):r==null?void 0:r.message;throw new Error(d||"Runtime profile apply failed")}return x.json()})}function Gf(){return fetch(`${je}/users/sessions`).then(u=>{if(!u.ok)throw new Error("User sessions request failed");return u.json()}).then(u=>u.sessions??[])}function wy(){return fetch(`${je}/admins`).then(u=>{if(!u.ok)throw new Error("Admins request failed");return u.json()}).then(u=>Array.isArray(u)?u:u.admins??[])}function Ci(u){return{ELECTRON:"AppImage",CONTAINER:"container-image",STATIC_WEB:"web-image",DATABASE:"database",MIGRATION:"prisma/migrations"}[u]??"container-image"}function Wt(u){if(!u)return"-";const x=new Date(u);return Number.isNaN(x.getTime())?"-":new Intl.DateTimeFormat("ko-KR",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(x)}function Ty(u,x,r){if(r==="PENDING")return"대기 중";if(r==="RUNNING")return"진행 중";if(!u||!x)return"-";const d=new Date(u).getTime(),M=new Date(x).getTime();if(Number.isNaN(d)||Number.isNaN(M)||MM)&&x.set(r.componentId,r)}return[...x.values()].map(r=>r.id)}function Mi(u){return`${kg.replace(/\/$/,"")}/${u}.git`}function Mf(u){return`${Dg.replace(/\/$/,"")}/${u}.git`}function cr(u,x,r){if(!navigator.clipboard){r==null||r();return}navigator.clipboard.writeText(u).then(x).catch(()=>r==null?void 0:r())}function Cy(u,x,r){const d=r.trim()?r.trim().slice(0,7):x;return u.type==="ELECTRON"?`${u.name}-${d}.AppImage`:u.type==="DATABASE"||u.type==="MIGRATION"?`${u.name}:${x}:migration-check`:`registry.local/${u.name}:${d}`}function My(u){return[`[00:00] build job initialized: ${u.component}`,`[00:01] repository: ${u.repository}`,`[00:02] checkout branch: ${u.branch}`,`[00:03] checkout commit: ${u.commit}`,"[00:08] install dependencies",`[00:25] run build target: ${u.target}`,`[01:10] package artifact: ${u.artifact}`,`[01:20] status: ${u.status}`]}function _y(){const{toast:u}=Ea(),[x,r]=b.useState([]),[d,M]=b.useState([]),[_,K]=b.useState([]),[Z,O]=b.useState(!0),z=It(Z),[Y,U]=b.useState("idle"),[T,P]=b.useState(""),[J,ie]=b.useState(""),[G,ee]=b.useState({}),[ae,$]=b.useState(""),[fe,oe]=b.useState(""),[le,W]=b.useState("release"),[te,pe]=b.useState(""),[k,he]=b.useState(null);b.useEffect(()=>{let p=!0;return O(!0),Promise.all([za(),nr(),sr()]).then(([q,w,ne])=>{if(!p)return;r(q),M(w),K(ne);const Je=gl(q,ae);pt(Je),$(Je);const We=w.find(at=>at.appId===Je)??w[0];oe(at=>at||(We==null?void 0:We.id)||""),W((We==null?void 0:We.branch)||"release"),O(!1)}).catch(()=>{p&&(r([]),M([]),K([]),O(!1))}),()=>{p=!1}},[]),b.useEffect(()=>{const p=window.setInterval(()=>{sr().then(K).catch(()=>{})},3e3);return()=>window.clearInterval(p)},[]);const Ne=x.find(p=>p.id===ae),De=d.filter(p=>p.appId===ae),L=d.find(p=>p.id===fe)??De[0],ue=(L==null?void 0:L.buildTarget)||(L?Ci(L.type):"-"),f=L?Cy(L,le,te):"-",v=(p,q)=>{const w=p.component,ne=w==null?void 0:w.app;return{id:p.id,componentId:p.componentId,no:q,app:(ne==null?void 0:ne.name)??"-",component:(w==null?void 0:w.name)??"-",repository:(w==null?void 0:w.repository)||"-",branch:p.branch,commit:p.commitSha||"-",target:(w==null?void 0:w.buildTarget)||(w?Ci(w.type):"-"),artifact:p.artifact||"-",image:p.image||"-",requestedBy:"admin",startedAt:Wt(p.startedAt||p.createdAt),endedAt:Wt(p.finishedAt),duration:Ty(p.startedAt,p.finishedAt,p.status),status:na(p.status),rawStatus:p.status,logs:p.logs||""}},Q=_.map((p,q)=>v(p,_.length-q));b.useEffect(()=>{if(!k)return;const p=_.findIndex(w=>w.id===k.id),q=_[p];q&&he(v(q,_.length-p))},[_,k==null?void 0:k.id]),b.useEffect(()=>{if(!ae)return;const p=d.find(q=>q.appId===ae);oe((p==null?void 0:p.id)||""),W((p==null?void 0:p.branch)||"release")},[d,ae]);const F=()=>{!Ne||!L||(U("saving"),Cf({componentId:L.id,branch:le,commitSha:te.trim()||void 0}).then(({buildJob:p})=>{K(q=>[p,...q]),he(v(p,_.length+1)),U("idle"),u({type:"success",title:"빌드 작업 생성",message:"빌드 작업이 등록되었습니다."})}).catch(p=>{U("idle"),u({type:"error",title:"빌드 작업 실패",message:p.message})}))},re=p=>{U("saving"),Cf({componentId:p.componentId,branch:p.branch,commitSha:p.commit==="-"?void 0:p.commit}).then(({buildJob:q})=>{K(w=>[q,...w]),he(v(q,_.length+1)),U("idle"),u({type:"success",title:"빌드 재실행",message:"빌드 작업이 다시 등록되었습니다."})}).catch(q=>{U("idle"),u({type:"error",title:"빌드 재실행 실패",message:q.message})})},m=p=>{ee(q=>({...q,[p.id]:"canceling"})),dy(p.id).then(({buildJob:q})=>{K(w=>w.map(ne=>ne.id===q.id?q:ne)),ee(w=>({...w,[p.id]:void 0})),u({type:"success",title:"빌드 중지",message:"빌드 작업을 중지했습니다."})}).catch(q=>{ee(w=>({...w,[p.id]:void 0})),u({type:"error",title:"빌드 중지 실패",message:q.message})})},N=p=>{ee(q=>({...q,[p.id]:"deleting"})),oy(p.id).then(()=>{K(q=>q.filter(w=>w.id!==p.id)),he(q=>(q==null?void 0:q.id)===p.id?null:q),ee(q=>({...q,[p.id]:void 0})),u({type:"success",title:"빌드 작업 삭제",message:"빌드 작업을 삭제했습니다."})}).catch(q=>{ee(w=>({...w,[p.id]:void 0})),u({type:"error",title:"빌드 작업 삭제 실패",message:q.message})})},j=T.trim().toLowerCase(),X=Q.filter(p=>{const q=j?`${p.app} ${p.component} ${p.repository} ${p.branch} ${p.target} ${p.artifact} ${p.image} ${p.status}`.toLowerCase().includes(j):!0,w=J?p.status===J:!0;return q&&w}),I=[...new Set(Q.map(p=>p.status))];return[...new Set(Q.map(p=>p.app))].map(p=>({label:p,value:p})),[...new Set(Q.map(p=>p.status))].map(p=>({label:p,value:p})),l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"어플리케이션",title:"빌드 관리",description:"Gitea 소스에서 컨테이너 이미지와 런처 다운로드용 클라이언트 산출물을 만드는 작업을 관리합니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",onClick:F,disabled:!(L!=null&&L.repository)||Z||Y==="saving",children:[l.jsx(ls,{className:"size-4"}),Y==="saving"?"등록 중":"빌드 실행"]})}),l.jsxs(xe,{className:"mb-4",children:[l.jsx(Ge,{title:"빌드 요청",description:"앱 그룹, 구성요소, 브랜치, 커밋 기준으로 빌드 작업을 생성합니다."}),l.jsxs("div",{className:"grid gap-4 p-5 xl:grid-cols-[1.2fr_1fr]",children:[l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"앱 그룹"}),l.jsxs("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:ae,onChange:p=>{pt(p.target.value),$(p.target.value)},children:[x.length===0?l.jsx("option",{value:"",children:"등록된 앱 없음"}):null,x.map(p=>l.jsx("option",{value:p.id,children:p.name},p.id))]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"구성요소"}),l.jsxs("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:(L==null?void 0:L.id)??"",onChange:p=>{const q=d.find(w=>w.id===p.target.value);oe(p.target.value),W((q==null?void 0:q.branch)||"release")},children:[De.length===0?l.jsx("option",{value:"",children:"구성요소 없음"}):null,De.map(p=>l.jsx("option",{value:p.id,children:p.name},p.id))]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Branch"}),l.jsxs("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:le,onChange:p=>W(p.target.value),children:[l.jsx("option",{value:"develop",children:"develop"}),l.jsx("option",{value:"release",children:"release"}),l.jsx("option",{value:"main",children:"main"})]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Commit SHA"}),l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:te,onChange:p=>pe(p.target.value)})]})]}),l.jsxs("div",{className:"grid gap-3 rounded-md border border-border bg-muted/20 p-4 text-sm",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsx("span",{className:"text-muted-foreground",children:"Repository"}),l.jsx("span",{className:"truncate font-semibold",children:(L==null?void 0:L.repository)||"미연결"})]}),l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsx("span",{className:"text-muted-foreground",children:"빌드 대상"}),l.jsx("span",{className:"truncate font-semibold",children:ue})]}),l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsx("span",{className:"text-muted-foreground",children:"예상 결과물"}),l.jsx("span",{className:"truncate font-semibold",children:f})]}),l.jsxs(V,{className:"mt-1 h-8 px-3 text-[13px]",onClick:F,disabled:!(L!=null&&L.repository)||Z||Y==="saving",children:[l.jsx(ls,{className:"size-4"}),Y==="saving"?"등록 중":"빌드 실행"]})]})]})]}),l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsxs("div",{className:"flex flex-col gap-3 border-b border-border px-5 py-4 lg:flex-row lg:items-center lg:justify-between",children:[l.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"빌드 작업 목록"}),l.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[l.jsxs("div",{className:"relative w-full sm:w-80",children:[l.jsx(ns,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),l.jsx("input",{className:"h-9 w-full rounded-md border border-input bg-background pl-9 pr-3 text-sm outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-ring",placeholder:"앱, 구성요소, 저장소 검색",value:T,onChange:p=>P(p.target.value)})]}),l.jsxs("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground outline-none focus:ring-2 focus:ring-ring",value:J,onChange:p=>ie(p.target.value),children:[l.jsx("option",{value:"",children:"전체 상태"}),I.map(p=>l.jsx("option",{value:p,children:p},p))]})]})]}),l.jsx("div",{className:"max-h-[620px] space-y-3 overflow-y-auto p-4",children:X.length===0?l.jsx("div",{className:"flex min-h-40 items-center justify-center text-sm text-muted-foreground",children:"표시할 빌드 작업이 없습니다."}):X.map(p=>{const q=p.image!=="-"?p.image:p.artifact,w=p.rawStatus==="PENDING"||p.rawStatus==="RUNNING",ne=p.rawStatus!=="RUNNING",Je=G[p.id];return l.jsxs("div",{className:"rounded-lg border border-border bg-muted/10 px-4 py-3 transition-colors hover:bg-muted/20",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["No. ",p.no]}),l.jsx(Se,{tone:Ve(p.status),children:p.status}),l.jsx("span",{className:"truncate text-sm font-semibold",children:p.app}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"/"}),l.jsx("span",{className:"truncate text-sm font-semibold",children:p.component})]}),l.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[l.jsxs("span",{className:"truncate",children:["Repository ",l.jsx("b",{className:"font-semibold text-foreground",children:p.repository})]}),l.jsxs("span",{children:["Branch ",l.jsx("b",{className:"font-semibold text-foreground",children:p.branch})]}),l.jsxs("span",{className:"truncate",children:["Commit ",l.jsx("b",{className:"font-mono font-semibold text-foreground",children:p.commit})]}),l.jsxs("span",{children:["대상 ",l.jsx("b",{className:"font-semibold text-foreground",children:p.target})]})]})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[l.jsx(V,{variant:"outline",className:"size-8 px-0",title:"로그 보기","aria-label":"로그 보기",onClick:()=>he(p),children:l.jsx(sa,{className:"size-4"})}),l.jsx(V,{variant:"outline",className:"size-8 px-0",title:"빌드 중지","aria-label":"빌드 중지",onClick:()=>m(p),disabled:!w||Je==="canceling",children:l.jsx(Hf,{className:"size-3.5"})}),l.jsx(V,{variant:"outline",className:"size-8 px-0",title:"재실행","aria-label":"재실행",onClick:()=>re(p),disabled:Y==="saving",children:l.jsx(Ei,{className:"size-4"})}),l.jsx(V,{variant:"outline",className:"size-8 px-0",title:ne?"삭제":"실행 중인 작업은 먼저 중지","aria-label":"삭제",onClick:()=>N(p),disabled:!ne||Je==="deleting",children:l.jsx(mr,{className:"size-4"})})]})]}),l.jsxs("div",{className:"mt-3 grid gap-2 rounded-md border border-border bg-background/70 px-3 py-2 text-xs md:grid-cols-[minmax(0,1fr)_280px_120px]",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("span",{className:"text-muted-foreground",children:"결과물"}),l.jsx("p",{className:"mt-1 truncate font-mono text-[12px] text-foreground",children:q})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"시작 / 종료"}),l.jsxs("p",{className:"mt-1 text-foreground",children:[p.startedAt," / ",p.endedAt]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"소요시간"}),l.jsx("p",{className:"mt-1 text-foreground",children:p.duration})]})]})]},p.id)})})]}),k?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-4xl overflow-hidden rounded-lg border border-border bg-card shadow-xl",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-border px-5 py-4",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"빌드 로그"}),l.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[k.app," · ",k.component," · ",k.branch]})]}),l.jsx(V,{variant:"ghost",onClick:()=>he(null),children:"닫기"})]}),l.jsx("div",{className:"max-h-[70vh] overflow-auto bg-background p-5 font-mono text-xs leading-6 text-muted-foreground",children:(k.logs?k.logs.split(` `):My(k)).map(p=>l.jsx("p",{children:p},p))})]})}):null,l.jsx(Ft,{open:z})]})}function Oy(){const{toast:u}=Ea(),[x,r]=b.useState([]),[d,M]=b.useState([]),[_,K]=b.useState([]),[Z,O]=b.useState(!0),z=It(Z),[Y,U]=b.useState(!1),[T,P]=b.useState(""),[J,ie]=b.useState(""),[G,ee]=b.useState("release"),[ae,$]=b.useState([]),[fe,oe]=b.useState("idle"),le=()=>{O(!0),Promise.all([za(),sr(),fr()]).then(([L,ue,f])=>{r(L),M(ue),K(f),P(Q=>{const F=gl(L,Q);return pt(F),F});const v=ue.find(Q=>Q.status==="SUCCEEDED");ee(Q=>Q||(v==null?void 0:v.branch)||"release"),O(!1)}).catch(()=>{r([]),M([]),K([]),O(!1)})};b.useEffect(()=>{le()},[]);const W=x.find(L=>L.id===T),te=d.filter(L=>{var ue;return L.status==="SUCCEEDED"&&((ue=L.component)==null?void 0:ue.appId)===T}),pe=te.filter(L=>L.branch===G),k=[...new Set(te.map(L=>L.branch))],he=()=>{const L=gl(x,T),ue=d.find(Q=>{var F;return Q.status==="SUCCEEDED"&&((F=Q.component)==null?void 0:F.appId)===L}),f=(ue==null?void 0:ue.branch)||G||"release";pt(L),P(L),ee(f);const v=d.filter(Q=>{var F;return Q.status==="SUCCEEDED"&&((F=Q.component)==null?void 0:F.appId)===L&&Q.branch===f});$(Pu(v)),ie(""),oe("idle"),U(!0)},Ne=L=>{$(ue=>ue.includes(L)?ue.filter(f=>f!==L):[...ue,L])},De=()=>{!T||!J.trim()||ae.length===0||(oe("saving"),my({appId:T,version:J.trim(),branch:G,buildJobIds:ae}).then(({release:L})=>{K(ue=>[L,...ue]),U(!1),oe("idle"),u({type:"success",title:"릴리즈 생성",message:`${L.version} 릴리즈가 생성되었습니다.`})}).catch(L=>{oe("idle"),u({type:"error",title:"릴리즈 생성 실패",message:L.message})}))};return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"어플리케이션",title:"릴리즈 관리",description:"브랜치, 커밋, 빌드 산출물을 묶어 환경별로 배포 가능한 릴리즈를 생성합니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",onClick:he,children:[l.jsx(yt,{className:"size-4"}),"릴리즈 생성"]})}),l.jsxs("div",{className:"grid gap-4 xl:grid-cols-[1fr_360px]",children:[l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"릴리즈 목록",description:"성공한 빌드 결과를 버전 단위로 묶은 배포 후보입니다."}),l.jsxs("div",{className:"max-h-[620px] space-y-3 overflow-y-auto p-4",children:[!Z&&_.length===0?l.jsx("div",{className:"flex min-h-40 items-center justify-center text-sm text-muted-foreground",children:"생성된 릴리즈가 없습니다."}):null,!Z&&_.map(L=>{var v,Q,F;const ue=ir(L),f=((Q=(v=L.imageTags)==null?void 0:v.buildJobs)==null?void 0:Q.length)??0;return l.jsxs("div",{className:"rounded-lg border border-border bg-muted/10 px-4 py-3",children:[l.jsx("div",{className:"flex items-start justify-between gap-4",children:l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(Se,{tone:Ve(na(L.status)),children:na(L.status)}),l.jsx("span",{className:"truncate text-sm font-semibold",children:((F=L.app)==null?void 0:F.name)??"-"}),l.jsx("span",{className:"text-lg font-semibold",children:L.version})]}),l.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[l.jsxs("span",{children:["Branch ",l.jsx("b",{className:"font-semibold text-foreground",children:L.branch})]}),l.jsxs("span",{children:["Commit ",l.jsx("b",{className:"font-mono font-semibold text-foreground",children:L.commitSha||"multiple"})]}),l.jsxs("span",{children:["Build ",l.jsxs("b",{className:"font-semibold text-foreground",children:[f,"개"]})]}),l.jsxs("span",{children:["생성 ",l.jsx("b",{className:"font-semibold text-foreground",children:Wt(L.createdAt)})]})]})]})}),l.jsxs("div",{className:"mt-3 rounded-md border border-border bg-background/70 px-3 py-2",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"산출물"}),l.jsx("p",{className:"mt-1 truncate font-mono text-xs text-foreground",children:ue})]})]},L.id)})]})]}),l.jsxs(xe,{className:"p-5",children:[l.jsx("p",{className:"text-sm font-semibold",children:"릴리즈 후보"}),l.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:"성공한 빌드 작업 중 릴리즈에 포함 가능한 항목입니다."}),l.jsx("div",{className:"mt-4 space-y-3",children:x.map(L=>{const ue=d.filter(f=>{var v;return f.status==="SUCCEEDED"&&((v=f.component)==null?void 0:v.appId)===L.id}).length;return l.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border bg-background px-3 py-2 text-sm",children:[l.jsx("span",{className:"font-semibold",children:L.name}),l.jsxs(Se,{tone:ue?"green":"neutral",children:[ue,"개"]})]},L.id)})})]})]}),Y?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-3xl overflow-hidden rounded-lg border border-border bg-card shadow-xl",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-border px-5 py-4",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"릴리즈 생성"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"성공한 빌드 결과를 선택해 앱 릴리즈 버전을 생성합니다."})]}),l.jsx(V,{variant:"ghost",onClick:()=>U(!1),children:"닫기"})]}),l.jsxs("div",{className:"grid gap-4 px-5 py-5 md:grid-cols-3",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"앱"}),l.jsx("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:T,onChange:L=>{var Q;const ue=L.target.value,f=((Q=d.find(F=>{var re;return F.status==="SUCCEEDED"&&((re=F.component)==null?void 0:re.appId)===ue}))==null?void 0:Q.branch)||"release",v=d.filter(F=>{var re;return F.status==="SUCCEEDED"&&((re=F.component)==null?void 0:re.appId)===ue&&F.branch===f});pt(ue),P(ue),ee(f),$(Pu(v))},children:x.map(L=>l.jsx("option",{value:L.id,children:L.name},L.id))})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"버전"}),l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:J,onChange:L=>ie(L.target.value),placeholder:"예: 1.0.0"})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Branch"}),l.jsx("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:G,onChange:L=>{const ue=L.target.value,f=d.filter(v=>{var Q;return v.status==="SUCCEEDED"&&((Q=v.component)==null?void 0:Q.appId)===T&&v.branch===ue});ee(ue),$(Pu(f))},children:(k.length?k:["develop","release","main"]).map(L=>l.jsx("option",{value:L,children:L},L))})]})]}),l.jsxs("div",{className:"border-t border-border px-5 py-4",children:[l.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"포함할 빌드"}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:[ae.length,"개 선택"]})]}),l.jsx("div",{className:"max-h-72 space-y-2 overflow-y-auto",children:pe.length===0?l.jsxs("div",{className:"flex min-h-28 items-center justify-center rounded-md border border-border bg-background text-sm text-muted-foreground",children:[(W==null?void 0:W.name)??"선택한 앱","의 성공한 ",G," 빌드가 없습니다."]}):pe.map(L=>{var v;const ue=((v=L.component)==null?void 0:v.name)??"-",f=L.image||L.artifact||"-";return l.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-md border border-border bg-background px-3 py-3 hover:bg-muted/20",children:[l.jsx("input",{type:"checkbox",className:"mt-1 size-4 accent-primary",checked:ae.includes(L.id),onChange:()=>Ne(L.id)}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[l.jsx("span",{className:"font-semibold",children:ue}),l.jsx(Se,{tone:"green",children:"성공"}),l.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:L.commitSha||"-"})]}),l.jsx("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:f})]})]},L.id)})})]}),l.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-5 py-4",children:[l.jsx(V,{variant:"ghost",onClick:()=>U(!1),children:"취소"}),l.jsx(V,{onClick:De,disabled:!J.trim()||ae.length===0||fe==="saving",children:fe==="saving"?"생성 중":"생성"})]})]})}):null,l.jsx(Ft,{open:z})]})}function ky(){var De,L,ue;const{toast:u}=Ea(),[x,r]=b.useState([]),[d,M]=b.useState([]),[_,K]=b.useState(!0),Z=It(_),[O,z]=b.useState(!1),[Y,U]=b.useState(""),[T,P]=b.useState("dev"),[J,ie]=b.useState(""),[G,ee]=b.useState("idle"),[ae,$]=b.useState(null),[fe,oe]=b.useState(""),[le,W]=b.useState(null),te=()=>{K(!0),Promise.all([fr(),fy()]).then(([f,v])=>{r(f),M(v);const Q=Ti(),F=f.find(re=>re.appId===Q)??f[0];U(re=>re||(F==null?void 0:F.id)||""),ie(re=>{var m;return re||((m=F==null?void 0:F.app)==null?void 0:m.namespace)||""}),F!=null&&F.appId&&pt(F.appId),K(!1)}).catch(()=>{r([]),M([]),K(!1)})};b.useEffect(()=>{te()},[]);const pe=x.find(f=>f.id===Y),k=()=>{var Q;const f=Ti(),v=pe??x.find(F=>F.appId===f)??x[0];U((v==null?void 0:v.id)||""),ie(((Q=v==null?void 0:v.app)==null?void 0:Q.namespace)||""),v!=null&&v.appId&&pt(v.appId),P("dev"),ee("idle"),z(!0)},he=()=>{!Y||!T.trim()||!J.trim()||(ee("saving"),gy(J.trim()).then(({exists:f,namespace:v})=>{if(!f)throw new Error(`${v} namespace가 없습니다. 런타임 구성에서 Namespace 생성/확인을 먼저 실행하세요.`);return xy({releaseId:Y,environment:T.trim(),namespace:v})}).then(({deploymentJob:f})=>{var v;M(Q=>[f,...Q]),$(f),z(!1),ee("idle"),u({type:na(f.status)==="성공"?"success":"error",title:"배포 실행",message:`${((v=f.app)==null?void 0:v.name)??"앱"} 배포 작업이 종료되었습니다.`})}).catch(f=>{ee("idle"),u({type:"error",title:"배포 실패",message:f.message})}))},Ne=(f,v)=>{const Q=`${f.id}-${v}`;oe(Q),by(f.namespace,v).then(({deploymentName:F,logs:re})=>{oe(""),W({title:`${f.namespace} · ${F}`,logs:re}),u({type:"success",title:"재시작 완료",message:`${F} Deployment를 재시작했습니다.`})}).catch(F=>{oe(""),u({type:"error",title:"재시작 실패",message:F.message})})};return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"어플리케이션",title:"배포 관리",description:"생성된 릴리즈를 개발, 검수, 운영 환경에 배포하고 재배포와 롤백을 관리합니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",onClick:k,disabled:x.length===0,children:[l.jsx(yt,{className:"size-4"}),"배포 실행"]})}),l.jsxs("div",{className:"grid gap-4 xl:grid-cols-[1fr_360px]",children:[l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"배포 작업",description:"릴리즈별 배포 실행 결과와 rollout 로그를 확인합니다."}),l.jsxs("div",{className:"max-h-[620px] space-y-3 overflow-y-auto p-4",children:[!_&&d.length===0?l.jsx("div",{className:"flex min-h-40 items-center justify-center text-sm text-muted-foreground",children:"배포 작업이 없습니다."}):null,!_&&d.map((f,v)=>{var Q,F,re,m,N,j;return l.jsxs("div",{className:"rounded-lg border border-border bg-muted/10 px-4 py-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["No. ",d.length-v]}),l.jsx(Se,{tone:Ve(na(f.status)),children:na(f.status)}),l.jsx("span",{className:"text-sm font-semibold",children:((Q=f.app)==null?void 0:Q.name)??"-"}),l.jsx("span",{className:"text-sm font-semibold",children:((F=f.release)==null?void 0:F.version)??"-"})]}),l.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[l.jsxs("span",{children:["환경 ",l.jsx("b",{className:"font-semibold text-foreground",children:f.environment})]}),l.jsxs("span",{children:["Namespace ",l.jsx("b",{className:"font-semibold text-foreground",children:f.namespace})]}),l.jsxs("span",{children:["요청자 ",l.jsx("b",{className:"font-semibold text-foreground",children:f.requestedBy||"-"})]}),l.jsxs("span",{children:["시작 ",l.jsx("b",{className:"font-semibold text-foreground",children:Wt(f.startedAt||f.createdAt)})]})]})]}),l.jsx(V,{variant:"outline",className:"size-8 px-0",title:"로그 보기","aria-label":"로그 보기",onClick:()=>$(f),children:l.jsx(sa,{className:"size-4"})})]}),l.jsxs("div",{className:"mt-3 rounded-md border border-border bg-background/70 px-3 py-2",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"이미지"}),l.jsxs("div",{className:"mt-2 space-y-2",children:[Object.entries(((m=(re=f.release)==null?void 0:re.imageTags)==null?void 0:m.images)??{}).length===0?l.jsx("p",{className:"truncate font-mono text-xs text-foreground",children:f.release?ir(f.release):"-"}):null,Object.entries(((j=(N=f.release)==null?void 0:N.imageTags)==null?void 0:j.images)??{}).map(([X,I])=>{const p=`${f.id}-${X}`;return l.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border bg-card px-3 py-2",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-semibold",children:X}),l.jsx("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:I})]}),l.jsx(V,{variant:"outline",className:"size-8 px-0",title:"Deployment 재시작","aria-label":`${X} Deployment 재시작`,onClick:()=>Ne(f,X),disabled:fe===p,children:l.jsx(Ei,{className:Pe("size-4",fe===p&&"animate-spin")})})]},X)})]})]})]},f.id)})]})]}),l.jsxs(xe,{className:"p-5",children:[l.jsx("p",{className:"text-sm font-semibold",children:"배포 가능 릴리즈"}),l.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:"성공 상태의 릴리즈만 배포 대상으로 사용할 수 있습니다."}),l.jsxs("div",{className:"mt-4 space-y-3",children:[x.length===0?l.jsx("div",{className:"rounded-md border border-border bg-background px-3 py-8 text-center text-sm text-muted-foreground",children:"배포할 릴리즈가 없습니다."}):null,x.map(f=>{var v;return l.jsxs("div",{className:"rounded-md border border-border bg-background px-3 py-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsx("span",{className:"font-semibold",children:((v=f.app)==null?void 0:v.name)??"-"}),l.jsx(Se,{tone:Ve(na(f.status)),children:f.version})]}),l.jsx("p",{className:"mt-2 truncate font-mono text-xs text-muted-foreground",children:ir(f)})]},f.id)})]})]})]}),O?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-2xl overflow-hidden rounded-lg border border-border bg-card shadow-xl",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-border px-5 py-4",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"배포 실행"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Deployment가 없으면 최초 생성하고, 있으면 릴리즈 이미지를 반영합니다."})]}),l.jsx(V,{variant:"ghost",onClick:()=>z(!1),children:"닫기"})]}),l.jsxs("div",{className:"grid gap-4 px-5 py-5 md:grid-cols-3",children:[l.jsxs("label",{className:"block md:col-span-3",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"릴리즈"}),l.jsx("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:Y,onChange:f=>{var Q;const v=x.find(F=>F.id===f.target.value);U(f.target.value),ie(((Q=v==null?void 0:v.app)==null?void 0:Q.namespace)||J),v!=null&&v.appId&&pt(v.appId)},children:x.map(f=>{var v;return l.jsxs("option",{value:f.id,children:[((v=f.app)==null?void 0:v.name)??"-"," ",f.version]},f.id)})})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"환경"}),l.jsxs("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:T,onChange:f=>P(f.target.value),children:[l.jsx("option",{value:"dev",children:"dev"}),l.jsx("option",{value:"stage",children:"stage"}),l.jsx("option",{value:"prod",children:"prod"})]})]}),l.jsxs("label",{className:"block md:col-span-2",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Namespace"}),l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:J,onChange:f=>ie(f.target.value)})]})]}),l.jsx("div",{className:"border-t border-border px-5 py-3",children:l.jsx("p",{className:"text-xs leading-5 text-amber-300",children:"Namespace가 없으면 배포를 실행하지 않습니다. 런타임 구성에서 Namespace 생성/확인을 먼저 실행하세요."})}),l.jsxs("div",{className:"border-t border-border px-5 py-4",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"반영 이미지"}),l.jsx("div",{className:"mt-3 space-y-2",children:Object.entries(((De=pe==null?void 0:pe.imageTags)==null?void 0:De.images)??{}).map(([f,v])=>l.jsxs("div",{className:"rounded-md border border-border bg-background px-3 py-2",children:[l.jsx("p",{className:"text-sm font-semibold",children:f}),l.jsx("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:v})]},f))})]}),l.jsxs("div",{className:"flex justify-end gap-2 border-t border-border px-5 py-4",children:[l.jsx(V,{variant:"ghost",onClick:()=>z(!1),children:"취소"}),l.jsx(V,{onClick:he,disabled:!Y||!J.trim()||G==="saving",children:G==="saving"?"배포 중":"배포 실행"})]})]})}):null,ae?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-4xl overflow-hidden rounded-lg border border-border bg-card shadow-xl",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-border px-5 py-4",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"배포 로그"}),l.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[((L=ae.app)==null?void 0:L.name)??"-"," · ",((ue=ae.release)==null?void 0:ue.version)??"-"," · ",ae.namespace]})]}),l.jsx(V,{variant:"ghost",onClick:()=>$(null),children:"닫기"})]}),l.jsx("div",{className:"max-h-[70vh] overflow-auto bg-background p-5 font-mono text-xs leading-6 text-muted-foreground",children:(ae.logs||"").split(` `).filter(Boolean).map(f=>l.jsx("p",{children:f},f))})]})}):null,le?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-4xl overflow-hidden rounded-lg border border-border bg-card shadow-xl",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-border px-5 py-4",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"재시작 로그"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:le.title})]}),l.jsx(V,{variant:"ghost",onClick:()=>W(null),children:"닫기"})]}),l.jsx("div",{className:"max-h-[70vh] overflow-auto bg-background p-5 font-mono text-xs leading-6 text-muted-foreground",children:le.logs.split(` `).filter(Boolean).map(f=>l.jsx("p",{children:f},f))})]})}):null,l.jsx(Ft,{open:Z})]})}function Dy(){var F,re,m,N;const{toast:u}=Ea(),[x,r]=b.useState([]),[d,M]=b.useState([]),[_,K]=b.useState([]),[Z,O]=b.useState(!0),z=It(Z),[Y,U]=b.useState(""),[T,P]=b.useState(""),[J,ie]=b.useState(""),[G,ee]=b.useState(""),[ae,$]=b.useState(""),[fe,oe]=b.useState("npx prisma migrate deploy --schema=prisma/schema.prisma"),[le,W]=b.useState("lms-be-secret"),[te,pe]=b.useState("idle"),[k,he]=b.useState(null),Ne=()=>{O(!0),Promise.all([za(),fr(),hy()]).then(([j,X,I])=>{var at,Ia,Ut;const p=gl(j,Y),q=j.find($e=>$e.id===p),ne=X.filter($e=>$e.appId===p)[0]??X[0],Je=(at=q==null?void 0:q.components)==null?void 0:at.find($e=>$e.type==="MIGRATION"),We=Object.keys(((Ia=ne==null?void 0:ne.imageTags)==null?void 0:Ia.images)??{}).find($e=>$e.endsWith("-be"))??Object.keys(((Ut=ne==null?void 0:ne.imageTags)==null?void 0:Ut.images)??{})[0]??"";r(j),M(X),K(I),U(p),P($e=>$e||(ne==null?void 0:ne.id)||""),ie($e=>$e||(Je==null?void 0:Je.id)||""),ee($e=>$e||We),$($e=>$e||(q==null?void 0:q.namespace)||""),W($e=>$e||`${We||"lms-be"}-secret`),pt(p),O(!1)}).catch(j=>{O(!1),u({type:"error",title:"마이그레이션 조회 실패",message:j.message})})};b.useEffect(()=>{Ne()},[]);const De=x.find(j=>j.id===Y),L=((F=De==null?void 0:De.components)==null?void 0:F.filter(j=>j.type==="MIGRATION"))??[],ue=d.filter(j=>j.appId===Y),f=d.find(j=>j.id===T),v=Object.entries(((re=f==null?void 0:f.imageTags)==null?void 0:re.images)??{}),Q=()=>{!T||!J||!G||!ae.trim()||!fe.trim()||!le.trim()||(pe("saving"),py({releaseId:T,migrationComponentId:J,imageComponentName:G,namespace:ae.trim(),command:fe.trim(),envSecretName:le.trim()}).then(({migrationJob:j})=>{K(X=>[j,...X]),he(j),pe("idle"),u({type:na(j.status)==="성공"?"success":"error",title:"마이그레이션 실행",message:`${j.name} 작업이 종료되었습니다.`})}).catch(j=>{pe("idle"),u({type:"error",title:"마이그레이션 실패",message:j.message})}))};return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"어플리케이션",title:"마이그레이션",description:"논리 마이그레이션 구성요소를 선택하고 릴리즈 이미지를 Kubernetes Job으로 실행합니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",onClick:Q,disabled:te==="saving"||!T||!J||!G,children:[l.jsx(ls,{className:"size-4"}),te==="saving"?"실행 중":"마이그레이션 실행"]})}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs(xe,{className:"p-5",children:[l.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"앱"}),l.jsx("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:Y,onChange:j=>{var ne,Je,We;const X=j.target.value,I=x.find(at=>at.id===X),p=d.find(at=>at.appId===X),q=(ne=I==null?void 0:I.components)==null?void 0:ne.find(at=>at.type==="MIGRATION"),w=Object.keys(((Je=p==null?void 0:p.imageTags)==null?void 0:Je.images)??{}).find(at=>at.endsWith("-be"))??Object.keys(((We=p==null?void 0:p.imageTags)==null?void 0:We.images)??{})[0]??"";pt(X),U(X),P((p==null?void 0:p.id)||""),ie((q==null?void 0:q.id)||""),ee(w),$((I==null?void 0:I.namespace)||""),W(`${w||"lms-be"}-secret`)},children:x.map(j=>l.jsx("option",{value:j.id,children:j.name},j.id))})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"릴리즈"}),l.jsx("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:T,onChange:j=>{var p,q;const X=d.find(w=>w.id===j.target.value),I=Object.keys(((p=X==null?void 0:X.imageTags)==null?void 0:p.images)??{}).find(w=>w.endsWith("-be"))??Object.keys(((q=X==null?void 0:X.imageTags)==null?void 0:q.images)??{})[0]??"";P(j.target.value),ee(I),W(`${I||"lms-be"}-secret`)},children:ue.map(j=>l.jsx("option",{value:j.id,children:j.version},j.id))})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"마이그레이션 구성요소"}),l.jsxs("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:J,onChange:j=>ie(j.target.value),children:[L.map(j=>l.jsx("option",{value:j.id,children:j.name},j.id)),L.length===0?l.jsx("option",{value:"",children:"MIGRATION 구성요소 없음"}):null]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"실행 이미지"}),l.jsxs("select",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:G,onChange:j=>{ee(j.target.value),W(`${j.target.value}-secret`)},children:[v.map(([j])=>l.jsx("option",{value:j,children:j},j)),v.length===0?l.jsx("option",{value:"",children:"이미지 없음"}):null]})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Namespace"}),l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:ae,onChange:j=>$(j.target.value)})]}),l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"envFrom Secret"}),l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:le,onChange:j=>W(j.target.value)})]}),l.jsxs("label",{className:"block lg:col-span-3",children:[l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"명령"}),l.jsx("input",{className:"mt-2 h-9 w-full rounded-md border border-input bg-background px-3 font-mono text-sm text-foreground outline-none focus:ring-2 focus:ring-ring",value:fe,onChange:j=>oe(j.target.value)})]})]}),l.jsxs("div",{className:"mt-4 rounded-md border border-border bg-background/70 px-3 py-2",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"선택 이미지"}),l.jsx("p",{className:"mt-1 truncate font-mono text-xs text-foreground",children:((N=(m=f==null?void 0:f.imageTags)==null?void 0:m.images)==null?void 0:N[G])??"-"})]})]}),l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"마이그레이션 작업",description:"Kubernetes Job 실행 이력과 로그입니다."}),l.jsxs("div",{className:"max-h-[620px] space-y-3 overflow-y-auto p-4",children:[!Z&&_.length===0?l.jsx("div",{className:"flex min-h-40 items-center justify-center text-sm text-muted-foreground",children:"마이그레이션 작업이 없습니다."}):null,!Z&&_.map((j,X)=>{var I,p,q,w,ne;return l.jsxs("div",{className:"rounded-lg border border-border bg-muted/10 px-4 py-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["No. ",_.length-X]}),l.jsx(Se,{tone:Ve(na(j.status)),children:na(j.status)}),l.jsx("span",{className:"text-sm font-semibold",children:((I=j.request)==null?void 0:I.appName)??"-"}),l.jsx("span",{className:"text-sm font-semibold",children:((p=j.request)==null?void 0:p.migrationComponentName)??j.name})]}),l.jsxs("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[l.jsxs("span",{children:["릴리즈 ",l.jsx("b",{className:"font-semibold text-foreground",children:((q=j.request)==null?void 0:q.releaseVersion)??"-"})]}),l.jsxs("span",{children:["Namespace ",l.jsx("b",{className:"font-semibold text-foreground",children:j.namespace})]}),l.jsxs("span",{children:["이미지 ",l.jsx("b",{className:"font-semibold text-foreground",children:((w=j.request)==null?void 0:w.imageComponentName)??"-"})]}),l.jsxs("span",{children:["시작 ",l.jsx("b",{className:"font-semibold text-foreground",children:Wt(j.startedAt||j.createdAt)})]})]})]}),l.jsx(V,{variant:"outline",className:"size-8 px-0",title:"로그 보기","aria-label":"로그 보기",onClick:()=>he(j),children:l.jsx(sa,{className:"size-4"})})]}),l.jsxs("div",{className:"mt-3 rounded-md border border-border bg-background/70 px-3 py-2",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"명령"}),l.jsx("p",{className:"mt-1 truncate font-mono text-xs text-foreground",children:((ne=j.request)==null?void 0:ne.command)??"-"})]})]},j.id)})]})]})]}),k?l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/55 px-4 backdrop-blur-[2px]",role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:"w-full max-w-4xl overflow-hidden rounded-lg border border-border bg-card shadow-xl",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-border px-5 py-4",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"마이그레이션 로그"}),l.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[k.name," · ",k.namespace]})]}),l.jsx(V,{variant:"ghost",onClick:()=>he(null),children:"닫기"})]}),l.jsx("div",{className:"max-h-[70vh] overflow-auto bg-background p-5 font-mono text-xs leading-6 text-muted-foreground",children:(k.logs||"").split(` `).filter(Boolean).map(j=>l.jsx("p",{children:j},j))})]})}):null,l.jsx(Ft,{open:z})]})}function Ry(){const{toast:u}=Ea(),[x,r]=b.useState([]),[d,M]=b.useState(""),[_,K]=b.useState(null),[Z,O]=b.useState(!0),[z,Y]=b.useState(""),U=It(Z),T=(G=d)=>{if(!G.trim()){O(!1),K(null);return}O(!0),jy(G.trim()).then(ee=>{K(ee),O(!1)}).catch(ee=>{O(!1),u({type:"error",title:"런타임 상태 조회 실패",message:ee.message})})};b.useEffect(()=>{O(!0),za().then(G=>{const ee=G.map(oe=>oe.namespace).filter(Boolean),ae=Ti(),$=G.find(oe=>oe.id===ae),fe=($==null?void 0:$.namespace)||ee[0]||"stdo-lms";r(G),M(fe),T(fe)}).catch(G=>{O(!1),u({type:"error",title:"앱 목록 조회 실패",message:G.message})})},[]);const P=[...new Set(x.map(G=>G.namespace).filter(Boolean))],J=_==null?void 0:_.summary,ie=(G,ee)=>{const ae=G.kind==="Deployment"?"deployment":G.kind==="StatefulSet"?"statefulset":"";if(!ae)return;const $=`${G.kind}-${G.name}`;Y($),vy(d,ae,G.name,ee).then(()=>{u({type:"success",title:ee===0?"워크로드 중지":"워크로드 시작",message:`${G.name} ${ee===0?"중지 요청을 보냈습니다.":"시작 요청을 보냈습니다."}`}),T()}).catch(fe=>{u({type:"error",title:ee===0?"중지 실패":"시작 실패",message:fe.message})}).finally(()=>Y(""))};return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"플랫폼 런타임",title:"로그/이벤트",description:"Namespace 기준으로 Pod, Deployment, StatefulSet, Service, PVC 상태를 확인합니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",onClick:()=>T(),disabled:!d.trim()||Z,children:[l.jsx(Ei,{className:Pe("size-4",Z&&"animate-spin")}),"새로고침"]})}),l.jsxs("div",{className:"space-y-4",children:[l.jsx(xe,{className:"p-5",children:l.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-semibold",children:"Namespace"}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"`kubectl get all -n namespace`에 해당하는 리소스 상태입니다."})]}),l.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[l.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none focus:ring-2 focus:ring-ring sm:w-64",value:d,onChange:G=>{M(G.target.value),T(G.target.value)},children:[P.map(G=>l.jsx("option",{value:G,children:G},G)),!P.includes(d)&&d?l.jsx("option",{value:d,children:d}):null]}),l.jsx("input",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-ring sm:w-64",value:d,onChange:G=>M(G.target.value),onKeyDown:G=>{G.key==="Enter"&&T()},placeholder:"namespace 입력"})]})]})}),l.jsx("div",{className:"grid gap-4 md:grid-cols-5",children:[["Pod",(J==null?void 0:J.pods)??0],["Deployment",(J==null?void 0:J.deployments)??0],["StatefulSet",(J==null?void 0:J.statefulSets)??0],["Service",(J==null?void 0:J.services)??0],["PVC",(J==null?void 0:J.persistentVolumeClaims)??0]].map(([G,ee])=>l.jsxs(xe,{className:"p-5",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:G}),l.jsx("p",{className:"mt-3 text-2xl font-semibold",children:ee})]},G))}),l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"리소스 상태",description:(_==null?void 0:_.exists)===!1?"Namespace가 없습니다.":"현재 namespace의 주요 리소스 목록입니다.",action:l.jsxs("span",{className:"text-xs font-semibold text-muted-foreground",children:["총 ",(_==null?void 0:_.resources.length)??0,"개"]})}),l.jsx("div",{className:"max-h-[640px] overflow-x-auto overflow-y-auto",children:l.jsxs("table",{className:"w-full min-w-[1080px] text-left text-sm",children:[l.jsx("thead",{className:"sticky top-0 z-10 border-b border-border bg-card text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"w-12 px-5 py-3 font-medium",children:"상태"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Kind"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Name"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Ready"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Restarts"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Age"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Detail"}),l.jsx("th",{className:"w-24 px-5 py-3 text-right font-medium",children:"작업"})]})}),l.jsxs("tbody",{className:"divide-y divide-border",children:[!Z&&((_==null?void 0:_.resources)??[]).length===0?l.jsx("tr",{children:l.jsx("td",{colSpan:8,className:"px-5 py-12 text-center text-muted-foreground",children:"표시할 리소스가 없습니다."})}):null,!Z&&((_==null?void 0:_.resources)??[]).map(G=>{const ee=G.kind==="Deployment"||G.kind==="StatefulSet",ae=ee&&G.ready.endsWith("/0"),$=`${G.kind}-${G.name}`,fe=z===$;return l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsx("td",{className:"px-5 py-4",children:l.jsx("span",{className:Pe("block size-2.5 rounded-full",ae?"bg-muted-foreground":["Running","Bound","ClusterIP","LoadBalancer"].includes(G.status)?"bg-emerald-400":["Pending","ContainerCreating"].includes(G.status)?"bg-amber-400":G.status==="Error"||G.status==="CrashLoopBackOff"?"bg-rose-400":"bg-muted-foreground")})}),l.jsx("td",{className:"px-5 py-4 font-semibold",children:G.kind}),l.jsx("td",{className:"px-5 py-4 font-mono text-xs",children:G.name}),l.jsx("td",{className:"px-5 py-4",children:G.ready}),l.jsx("td",{className:"px-5 py-4",children:G.restarts??"-"}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:G.age}),l.jsx("td",{className:"max-w-[420px] px-5 py-4",children:l.jsx("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:G.detail||"-"})}),l.jsx("td",{className:"px-5 py-4",children:l.jsx("div",{className:"flex justify-end",children:ee?l.jsx(V,{variant:ae?"default":"outline",className:"h-8 w-8 p-0",onClick:()=>ie(G,ae?1:0),disabled:fe,title:ae?"시작":"중지","aria-label":`${G.name} ${ae?"시작":"중지"}`,children:fe?l.jsx(Ei,{className:"size-4 animate-spin"}):ae?l.jsx(ls,{className:"size-4"}):l.jsx(Hf,{className:"size-4"})}):l.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})})})]},`${G.kind}-${G.name}`)})]})]})})]})]}),l.jsx(Ft,{open:U})]})}function Uy(){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"플랫폼 런타임",title:"장비 제어",description:"운영 장비의 런타임 시작, 중지, 재시작, 상태 조회 명령을 관리합니다."}),l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"장비 목록",description:"Agent가 연결된 장비를 목록으로 확인하고 필요한 제어 명령을 실행합니다.",action:l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(V,{variant:"outline",className:"h-8 px-3 text-[13px]",children:[l.jsx(or,{className:"size-4"}),"상태 필터"]}),l.jsxs(V,{className:"h-8 px-3 text-[13px]",children:[l.jsx(_i,{className:"size-4"}),"상태 갱신"]})]})}),l.jsx("div",{className:"border-b border-border px-5 pb-4",children:l.jsxs("div",{className:"relative max-w-md",children:[l.jsx(ns,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),l.jsx("input",{className:"h-9 w-full rounded-md border border-input bg-background pl-9 pr-3 text-sm outline-none placeholder:text-muted-foreground focus:ring-2 focus:ring-ring",placeholder:"장비명, 계정, 워크스페이스 검색"})]})}),l.jsx("div",{className:"max-h-[620px] overflow-x-auto overflow-y-auto",children:l.jsxs("table",{className:"w-full min-w-[1040px] text-left text-sm",children:[l.jsx("thead",{className:"sticky top-0 z-10 border-b border-border bg-card text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-5 py-3 font-medium",children:"장비"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"계정"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Workspace"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"SSH 키"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Last Seen"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"상태"}),l.jsx("th",{className:"px-5 py-3 text-right font-medium",children:"명령"})]})}),l.jsx("tbody",{className:"divide-y divide-border",children:qf.map(u=>l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsx("td",{className:"px-5 py-4 font-medium",children:u.name}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:u.account}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:u.workspace}),l.jsx("td",{className:"px-5 py-4",children:u.sshKey}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:u.lastSeen}),l.jsx("td",{className:"px-5 py-4",children:l.jsx(Se,{tone:Ve(u.status),children:u.status})}),l.jsx("td",{className:"px-5 py-4",children:l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(V,{variant:"outline",className:"h-8 px-3 text-[13px]",children:"시작"}),l.jsx(V,{variant:"outline",className:"h-8 px-3 text-[13px]",children:"중지"}),l.jsx(V,{variant:"outline",className:"h-8 px-3 text-[13px]",children:"재시작"}),l.jsx(V,{variant:"ghost",className:"size-8 px-0",children:l.jsx(sa,{className:"size-4"})})]})})]},u.name))})]})})]})]})}function Hy(){const u=as.filter(r=>r.status==="활성").length,x=as.filter(r=>r.routes!=="-").length;return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"테일스케일",title:"노드 현황",description:"플랫폼 게이트웨이가 수집한 tailnet 노드, 클러스터 라우트, 원격 실행 노드 연결 상태입니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",children:[l.jsx(_i,{className:"size-4"}),"상태 갱신"]})}),l.jsx("div",{className:"grid gap-4 md:grid-cols-3",children:[["등록 노드",`${as.length}대`,"게이트웨이 수집 기준"],["온라인",`${u}대`,"최근 접속 정상"],["Subnet Router",`${x}대`,"클러스터 CIDR 광고"]].map(([r,d,M])=>l.jsxs(xe,{className:"p-5",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:r}),l.jsx("p",{className:"mt-3 text-2xl font-semibold",children:d}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:M})]},r))}),l.jsx("div",{className:"mt-4",children:l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"노드 현황",description:"세부 설정은 Tailscale/플랫폼 게이트웨이에서 관리하고, 여기서는 운영 상태를 확인합니다."}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full min-w-[900px] text-left text-sm",children:[l.jsx("thead",{className:"border-b border-border text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-5 py-3 font-medium",children:"노드"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"IP"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"역할"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"사용자"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Routes"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Last Seen"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"상태"})]})}),l.jsx("tbody",{className:"divide-y divide-border",children:as.map(r=>l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsx("td",{className:"px-5 py-4 font-medium",children:r.name}),l.jsx("td",{className:"px-5 py-4",children:r.ip}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:r.role}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:r.user}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:r.routes}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:r.lastSeen}),l.jsx("td",{className:"px-5 py-4",children:l.jsx(Se,{tone:Ve(r.status),children:r.status})})]},r.name))})]})})]})})]})}function qy(){const u=as.filter(x=>x.routes!=="-");return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"테일스케일",title:"라우트",description:"플랫폼 게이트웨이와 런처가 접근해야 하는 네트워크 경로 광고 상태입니다."}),l.jsxs(xe,{children:[l.jsx(Ge,{title:"라우트 광고",description:"승인된 subnet route와 노드 상태입니다."}),l.jsx("div",{className:"divide-y divide-border",children:u.map(x=>l.jsxs("div",{className:"flex items-center justify-between gap-4 px-5 py-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate text-sm font-semibold",children:x.routes}),l.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[x.name," · ",x.ip]})]}),l.jsx(Se,{tone:Ve(x.status),children:x.status})]},x.name))})]})]})}function Ly(){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"테일스케일",title:"ACL",description:"사용자 그룹과 장비 태그 기준의 tailnet 접근 정책을 관리합니다."}),l.jsx("div",{className:"grid gap-4 xl:grid-cols-3",children:[["강사 장비 접근","group:instructors -> tag:teaching-device","활성"],["학생 워크스페이스","group:students -> tag:assigned-workspace","활성"],["운영자 전체 접근","group:ops -> tag:platform-admin","활성"]].map(([u,x,r])=>l.jsxs(xe,{className:"p-5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsx("p",{className:"text-sm font-semibold",children:u}),l.jsx(Se,{tone:Ve(r),children:r})]}),l.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:x})]},u))})]})}function By(){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"테일스케일",title:"연결 진단",description:"Tailnet, subnet route, 플랫폼 게이트웨이 연동 상태를 진단합니다.",actions:l.jsxs(V,{className:"h-8 px-3 text-[13px]",children:[l.jsx(_i,{className:"size-4"}),"진단 실행"]})}),l.jsxs(xe,{className:"min-w-0 overflow-hidden",children:[l.jsx(Ge,{title:"진단 항목",description:"런처에는 연결 정보만 제공하고, 실제 세부 설정은 여기에서 관리합니다."}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full min-w-[880px] text-left text-sm",children:[l.jsx("thead",{className:"border-b border-border text-xs text-muted-foreground",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-5 py-3 font-medium",children:"항목"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Key"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"Value"}),l.jsx("th",{className:"px-5 py-3 font-medium",children:"상태"})]})}),l.jsx("tbody",{className:"divide-y divide-border",children:wg.map(u=>l.jsxs("tr",{className:"hover:bg-muted/20",children:[l.jsxs("td",{className:"px-5 py-4",children:[l.jsx("p",{className:"font-medium",children:u.name}),l.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:u.description})]}),l.jsx("td",{className:"px-5 py-4 font-medium",children:u.key}),l.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:u.value}),l.jsx("td",{className:"px-5 py-4",children:l.jsx(Se,{tone:Ve(u.status),children:u.status})})]},u.key))})]})})]})]})}function Gy({onUserSessionsOpen:u}){return l.jsxs(l.Fragment,{children:[l.jsx(He,{eyebrow:"플랫폼 운영",title:"대시보드",description:"런처 버전, 앱 활성화, 사용자, 세션, 라이센스, 릴리즈, 시크릿, 런타임, 공지사항을 한 콘솔에서 관리합니다.",actions:l.jsxs(l.Fragment,{children:[l.jsxs(V,{variant:"outline",className:"h-8 px-3 text-[13px]",children:[l.jsx(or,{className:"size-4"}),"필터"]}),l.jsxs(V,{className:"h-8 px-3 text-[13px]",children:[l.jsx(yt,{className:"size-4"}),"새 릴리즈"]})]})}),l.jsx(Lg,{}),l.jsxs("div",{className:"mt-4 grid gap-4 xl:grid-cols-4",children:[l.jsx(Bg,{}),l.jsx(Gg,{onMore:u})]}),l.jsx("div",{className:"mt-4",children:l.jsx(Yg,{})}),l.jsxs("div",{className:"mt-4 grid gap-4 xl:grid-cols-2",children:[l.jsx(Vg,{}),l.jsx(Xg,{})]})]})}const __studioViewToPath={dashboard:"/dashboard",launcherVersions:"/launcher/versions",launcherCommonSettings:"/launcher/common-settings",launcherApps:"/launcher/apps",appManagement:"/applications/apps",appSources:"/applications/sources",appBuilds:"/applications/builds",appReleases:"/applications/releases",appDeployments:"/applications/deployments",appMigrations:"/applications/migrations",runtimeConfig:"/runtime/config",runtimeLogs:"/runtime/logs",runtimeDeviceControl:"/runtime/devices",tailscaleStatus:"/tailscale/status",tailscaleRoutes:"/tailscale/routes",tailscaleAcl:"/tailscale/acl",tailscaleDiagnostics:"/tailscale/diagnostics",agentRegistration:"/agents/registration",agentInstallStatus:"/agents/install-status",agentSshKeys:"/agents/ssh-keys",agentWorkspace:"/agents/workspace",agentCommands:"/agents/commands",gatewayStatus:"/gateway/status",gatewayAgents:"/gateway/agents",gatewayDevices:"/gateway/devices",adminManagement:"/operations/admins",userSessions:"/operations/users",licenses:"/operations/licenses",notices:"/operations/notices"},__studioPathToView=Object.fromEntries(Object.entries(__studioViewToPath).map(([u,x])=>[x,u]));function __studioViewFromPath(){const u=window.location.pathname;return __studioPathToView[u]??"dashboard"}function __studioPushView(u){const x=__studioViewToPath[u]??"/dashboard";window.location.pathname!==x&&window.history.pushState({view:u},"",x)}function Yy(){const[u,__studioSetView]=b.useState(__studioViewFromPath()),[r,d]=b.useState(""),[M,_]=b.useState(()=>!!localStorage.getItem("studio-admin-token")),x=K=>{__studioSetView(K),__studioPushView(K)};b.useEffect(()=>{const K=()=>__studioSetView(__studioViewFromPath());return window.addEventListener("popstate",K),()=>window.removeEventListener("popstate",K)},[]);const K=()=>{switch(u){case"launcherVersions":return l.jsx(Qg,{});case"launcherApps":return l.jsx(Jg,{});case"launcherCommonSettings":return l.jsx(cy,{});case"notices":return l.jsx(ly,{});case"adminManagement":return l.jsx(ny,{});case"userSessions":return l.jsx(sy,{});case"licenses":return l.jsx(iy,{});case"appManagement":return l.jsx(Zg,{});case"appSources":return l.jsx(uy,{});case"appBuilds":return l.jsx(_y,{});case"appReleases":return l.jsx(Oy,{});case"appDeployments":return l.jsx(ky,{});case"appMigrations":return l.jsx(Dy,{});case"gatewayStatus":return l.jsx($g,{});case"gatewayAgents":return l.jsx(Wg,{});case"gatewayDevices":return l.jsx(Fg,{});case"tailscaleStatus":return l.jsx(Hy,{});case"tailscaleRoutes":return l.jsx(qy,{});case"tailscaleAcl":return l.jsx(Ly,{});case"tailscaleDiagnostics":return l.jsx(By,{});case"agentRegistration":return l.jsx(Ig,{});case"agentInstallStatus":return l.jsx(Pg,{});case"agentSshKeys":return l.jsx(ey,{});case"agentWorkspace":return l.jsx(ty,{});case"agentCommands":return l.jsx(ay,{});case"runtimeConfig":return l.jsx(Kg,{});case"runtimeLogs":return l.jsx(Ry,{});case"runtimeDeviceControl":return l.jsx(Uy,{});default:return l.jsx(Gy,{onUserSessionsOpen:()=>x("userSessions")})}};return M?l.jsx("div",{className:"min-h-screen overflow-hidden bg-background text-foreground",children:l.jsxs("div",{className:"min-h-screen lg:pl-72",children:[l.jsx(Ug,{activeView:u,menuSearch:r,onViewChange:x}),l.jsxs("div",{className:"flex h-screen min-w-0 flex-col",children:[l.jsx(Hg,{menuSearch:r,onMenuSearchChange:d}),l.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto",children:l.jsx("div",{className:"mx-auto w-full max-w-[1600px] px-4 pb-16 pt-6 md:px-6 md:pb-20",children:K()})})]})]})}):l.jsx(qg,{onLogin:()=>_(!0)})}pp.createRoot(document.getElementById("root")).render(l.jsx(b.StrictMode,{children:l.jsx(Og,{children:l.jsx(Yy,{})})}));