@bpinhosilva/agent-orchestrator 1.1.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +7 -0
- package/dist/cli/commands/run.command.js +20 -1
- package/dist/cli/commands/setup.command.js +13 -0
- package/dist/cli/constants.js +2 -1
- package/dist/cli/env.js +2 -0
- package/dist/cli/preload.js +12 -0
- package/dist/cli/process-manager.js +33 -29
- package/dist/cli/setup/index.js +24 -0
- package/dist/cli/setup/validators.js +14 -0
- package/dist/config/env.validation.js +6 -0
- package/dist/config/runtime-logger.js +214 -0
- package/dist/main.js +8 -0
- package/dist/ui/assets/{AgentFleet-BarfEwcK.js → AgentFleet-B8p5vbKK.js} +1 -1
- package/dist/ui/assets/{AttachmentItem-Cerhbyya.js → AttachmentItem-C_uUACPz.js} +1 -1
- package/dist/ui/assets/{ConfirmDialog-y3vTcqFR.js → ConfirmDialog-BltdtevE.js} +1 -1
- package/dist/ui/assets/{CreateRecurrentTaskModal-BgfnJ1n8.js → CreateRecurrentTaskModal-CGSdgNAf.js} +1 -1
- package/dist/ui/assets/{CreateTaskModal-BH9lOLYT.js → CreateTaskModal-XNvIWKz3.js} +1 -1
- package/dist/ui/assets/{ExecLogModal-ShacCOOV.js → ExecLogModal-BYTGF04P.js} +1 -1
- package/dist/ui/assets/{MarkdownField--1gpyapw.js → MarkdownField-DR6tHsei.js} +1 -1
- package/dist/ui/assets/{Profile-qnuRN5Qv.js → Profile-ByioVLM8.js} +1 -1
- package/dist/ui/assets/{ProjectDetail-ZYQG9yn2.js → ProjectDetail-dwZDzb0m.js} +1 -1
- package/dist/ui/assets/{Providers-DR7srJHq.js → Providers-JAClEFt0.js} +1 -1
- package/dist/ui/assets/{Scheduler-Bs3DC0re.js → Scheduler-C1HQNxQ6.js} +2 -2
- package/dist/ui/assets/{Settings-C3ad44vP.js → Settings-Cjn2xdo1.js} +1 -1
- package/dist/ui/assets/{TaskDetail-D-f_Ao2a.js → TaskDetail-Blphf9tw.js} +1 -1
- package/dist/ui/assets/{TaskExecutions-BeodRIz1.js → TaskExecutions-ydR4KPCY.js} +3 -3
- package/dist/ui/assets/{TaskManager-BA2Y31ut.js → TaskManager-DrFbuAwN.js} +3 -3
- package/dist/ui/assets/{UserDetail-BvWm-U4y.js → UserDetail-mWjJPTzO.js} +1 -1
- package/dist/ui/assets/{Users-CQNcXLyV.js → Users-FaX0thJx.js} +1 -1
- package/dist/ui/assets/{activity-CmAajKmR.js → activity-B_2QSywM.js} +1 -1
- package/dist/ui/assets/{agents-b8btewki.js → agents-YQJ7JNfI.js} +1 -1
- package/dist/ui/assets/{auth-dROenHXk.js → auth-Lh2N3iYN.js} +1 -1
- package/dist/ui/assets/{bot-QVmnxPf4.js → bot-DadO9w3D.js} +1 -1
- package/dist/ui/assets/{box-Bw_pyYzU.js → box-CFDcDxHv.js} +1 -1
- package/dist/ui/assets/{brain-C6vlLcg3.js → brain-DWTpby6b.js} +1 -1
- package/dist/ui/assets/{briefcase-DtHlat45.js → briefcase-mFWNV6w9.js} +1 -1
- package/dist/ui/assets/check-BiORptL3.js +1 -0
- package/dist/ui/assets/chevron-down-BUOg3vvd.js +1 -0
- package/dist/ui/assets/chevron-left-B0NmQyxK.js +1 -0
- package/dist/ui/assets/chevron-right-Bm_d1KKk.js +1 -0
- package/dist/ui/assets/{circle-alert-pUx6yhcF.js → circle-alert-sCcf7ANF.js} +1 -1
- package/dist/ui/assets/circle-check-Jz8IOE4h.js +1 -0
- package/dist/ui/assets/client-B553SX3l.js +9 -0
- package/dist/ui/assets/clock-CSNFJjo4.js +1 -0
- package/dist/ui/assets/{cpu-8Sbc9Dk0.js → cpu-C2_GFeSH.js} +1 -1
- package/dist/ui/assets/{database-D6O4hvbm.js → database-zXW48-_N.js} +1 -1
- package/dist/ui/assets/{download-DHcd5oLD.js → download-DZdOdijy.js} +1 -1
- package/dist/ui/assets/{eye-Cc-vy4Zu.js → eye-CjrFwZG_.js} +1 -1
- package/dist/ui/assets/{file-text-DWBSXx5l.js → file-text-CX_Yqfjf.js} +1 -1
- package/dist/ui/assets/{index-BvUv9Lzq.js → index-IcLlFUZs.js} +3 -3
- package/dist/ui/assets/{info-1jA6X-_e.js → info-DGHChFI6.js} +1 -1
- package/dist/ui/assets/{layers-BcHXXg-4.js → layers-CVf8_Byb.js} +1 -1
- package/dist/ui/assets/loader-circle-CB6PQwdc.js +1 -0
- package/dist/ui/assets/{panels-top-left-Vk8FzAxf.js → panels-top-left-Cp169WzB.js} +1 -1
- package/dist/ui/assets/{paperclip-DWJjaP8B.js → paperclip-5Y367YTj.js} +1 -1
- package/dist/ui/assets/plus-CkteVqhM.js +1 -0
- package/dist/ui/assets/{projects-CUOthD8N.js → projects-DoalTI7c.js} +1 -1
- package/dist/ui/assets/{providers-CNrSTcdc.js → providers-AawjMy3x.js} +1 -1
- package/dist/ui/assets/{recurrent-tasks-CKT47N2l.js → recurrent-tasks-7thk45mk.js} +1 -1
- package/dist/ui/assets/{refresh-cw-DQW6jR7M.js → refresh-cw-BgDsJOC_.js} +1 -1
- package/dist/ui/assets/{rocket-CMSwBl_C.js → rocket-B9Iexkcw.js} +1 -1
- package/dist/ui/assets/{save-DycJmlX0.js → save-Cmqi1IkN.js} +1 -1
- package/dist/ui/assets/{send-BZjwSrJW.js → send-iK1X7WSe.js} +1 -1
- package/dist/ui/assets/{server-CJE2K1Vt.js → server-BBmM-vrg.js} +1 -1
- package/dist/ui/assets/{settings-at7JqFrc.js → settings-BpKLGxm8.js} +1 -1
- package/dist/ui/assets/{shield-alert-CP5GVXxa.js → shield-alert-Do_Sg9SX.js} +1 -1
- package/dist/ui/assets/{shield-check-Cr4SHjdR.js → shield-check-YKs9kUNq.js} +1 -1
- package/dist/ui/assets/{sparkles-v57Nc-z-.js → sparkles-krUpxie4.js} +1 -1
- package/dist/ui/assets/{taskFormSchemas-dl1t1OyX.js → taskFormSchemas-B6YlRxrx.js} +1 -1
- package/dist/ui/assets/{tasks-DEUQCNoH.js → tasks-DHsBE-ea.js} +1 -1
- package/dist/ui/assets/{terminal-a6AV2mPO.js → terminal-B6iyNuAm.js} +1 -1
- package/dist/ui/assets/{trash-2-DJpTXgEP.js → trash-2-CphQfk35.js} +1 -1
- package/dist/ui/assets/{trending-up-DlrXEXE6.js → trending-up-ClGbkbN9.js} +1 -1
- package/dist/ui/assets/user-Brcjlps5.js +1 -0
- package/dist/ui/assets/{user-plus-nDkwsBT1.js → user-plus-0Y0M1GKi.js} +1 -1
- package/dist/ui/assets/{users-C6WiDiuN.js → users-BcnlUG5N.js} +1 -1
- package/dist/ui/assets/{users-Ef6Sh2iR.js → users-tdyaGZbx.js} +1 -1
- package/dist/ui/assets/x-CCZGYGDC.js +1 -0
- package/dist/ui/assets/{zap-BmhZqgvm.js → zap-BDAytXMX.js} +1 -1
- package/dist/ui/index.html +17 -17
- package/package.json +1 -1
- package/dist/ui/assets/check-DTei8Qlg.js +0 -1
- package/dist/ui/assets/chevron-down-LTeQHW9O.js +0 -1
- package/dist/ui/assets/chevron-left-CJc_eQid.js +0 -1
- package/dist/ui/assets/chevron-right-G5-HRo_C.js +0 -1
- package/dist/ui/assets/circle-check-B9kyRki5.js +0 -1
- package/dist/ui/assets/client-BGOBXkO8.js +0 -9
- package/dist/ui/assets/clock-BY4rrypg.js +0 -1
- package/dist/ui/assets/loader-circle-Cl6yIkPK.js +0 -1
- package/dist/ui/assets/plus-Dx6G8SOZ.js +0 -1
- package/dist/ui/assets/user--KOoEB9m.js +0 -1
- package/dist/ui/assets/x-wDy15QMx.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CfaHPvi0.js";import{n}from"./vendor-react-BmVaKUwY.js";import{r}from"./vendor-markdown-DoJbQ1of.js";import{i}from"./client-BGOBXkO8.js";import{t as a}from"./box-Bw_pyYzU.js";import{t as o}from"./check-DTei8Qlg.js";import{t as s}from"./chevron-down-LTeQHW9O.js";import{t as c}from"./circle-check-B9kyRki5.js";import{n as l,t as u}from"./user-plus-nDkwsBT1.js";import{t as d}from"./eye-Cc-vy4Zu.js";import{n as f,t as ee}from"./users-C6WiDiuN.js";import{n as te,t as p}from"./auth-dROenHXk.js";import{t as ne}from"./rocket-CMSwBl_C.js";import{t as re}from"./save-DycJmlX0.js";import{t as ie}from"./shield-check-Cr4SHjdR.js";import{t as ae}from"./user--KOoEB9m.js";import{t as m}from"./x-wDy15QMx.js";import{t as oe}from"./useProject-DhK9Ze6F.js";import{n as se}from"./AuthContextInstance-DiFo9Qb2.js";import{n as ce,t as le}from"./projects-CUOthD8N.js";import{i as ue,n as h,r as g,t as de}from"./UserAvatar-Z5W8S1dG.js";var _=i(`circle-plus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),fe=i(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),v=e(t(),1),y=r(),pe=({isOpen:e,selectedAvatar:t,currentAvatar:n,isSaving:r,onSelect:i,onClose:a,onConfirm:s})=>((0,v.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&!r&&a()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,r,a]),e?(0,y.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 py-8 backdrop-blur-sm`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0`,"aria-hidden":`true`,onClick:()=>{r||a()}}),(0,y.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`avatar-picker-title`,className:`relative w-full max-w-2xl rounded-3xl border border-outline-variant/20 bg-surface p-6 shadow-[0_28px_80px_rgba(0,0,0,0.45)]`,children:[(0,y.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`p`,{className:`mb-2 text-[11px] font-bold uppercase tracking-[0.3em] text-primary/80`,children:`Avatar presets`}),(0,y.jsx)(`h2`,{id:`avatar-picker-title`,className:`font-headline text-2xl font-bold text-on-surface`,children:`Choose your avatar`}),(0,y.jsx)(`p`,{className:`mt-2 text-sm text-on-surface-variant`,children:`Pick one of the built-in presets. Your choice updates everywhere your profile picture is shown.`})]}),(0,y.jsx)(`button`,{type:`button`,onClick:a,disabled:r,"aria-label":`Close avatar picker`,className:`rounded-full border border-outline-variant/20 p-2 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface disabled:cursor-not-allowed disabled:opacity-50`,children:(0,y.jsx)(m,{size:18})})]}),(0,y.jsx)(`div`,{className:`grid grid-cols-2 gap-4 sm:grid-cols-4`,children:h.map(e=>{let r=e.key===t,a=e.key===n;return(0,y.jsxs)(`button`,{type:`button`,onClick:()=>i(e.key),className:`group relative rounded-2xl border p-3 text-left transition-all ${r?`border-primary bg-primary/10 shadow-[0_0_0_1px_rgba(173,198,255,0.25)]`:`border-outline-variant/20 bg-surface-container-low hover:border-primary/40 hover:bg-surface-container-high`}`,children:[(0,y.jsx)(`div`,{className:`overflow-hidden rounded-2xl bg-surface-container-high`,children:(0,y.jsx)(`img`,{src:e.src,alt:e.label,className:`aspect-square w-full object-cover`})}),(0,y.jsxs)(`div`,{className:`mt-3 flex items-center justify-between`,children:[(0,y.jsx)(`span`,{className:`text-sm font-semibold text-on-surface`,children:e.label}),r?(0,y.jsx)(`span`,{className:`inline-flex h-6 w-6 items-center justify-center rounded-full bg-primary text-on-primary`,children:(0,y.jsx)(o,{size:14})}):null]}),(0,y.jsx)(`p`,{className:`mt-1 text-xs text-on-surface-variant`,children:a?`Current avatar`:`Available preset`})]},e.key)})}),(0,y.jsxs)(`div`,{className:`mt-6 flex justify-end gap-3`,children:[(0,y.jsx)(`button`,{type:`button`,onClick:a,disabled:r,className:`rounded-lg border border-outline-variant/20 px-5 py-2.5 text-sm font-bold text-on-surface-variant transition-colors hover:bg-surface-container-high disabled:cursor-not-allowed disabled:opacity-50`,children:`Cancel`}),(0,y.jsxs)(`button`,{type:`button`,onClick:()=>void s(),disabled:r||t===n,className:`flex items-center gap-2 rounded-lg bg-primary px-5 py-2.5 text-sm font-bold text-on-primary transition-all hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-60`,children:[r?(0,y.jsx)(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-on-primary/30 border-t-on-primary`}):null,`Save avatar`]})]})]})]}):null);function b({label:e,id:t,type:n=`text`,value:r,onChange:i,placeholder:a,disabled:o=!1,className:s=``,suffix:c,autoComplete:l,error:u}){return(0,y.jsxs)(`div`,{className:`flex flex-col gap-2 ${s}`,children:[(0,y.jsx)(`label`,{htmlFor:t,className:`text-[10px] font-bold text-on-surface-variant uppercase tracking-[0.15em]`,children:e}),(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(`input`,{id:t,type:n,value:r,autoComplete:l,onChange:e=>i(e.target.value),placeholder:a,disabled:o,className:`w-full bg-surface-container-lowest rounded-lg px-4 py-3 text-sm text-on-surface border focus:outline-none focus:ring-2 transition-all disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-on-surface-variant/40 ${u?`border-error/60 focus:ring-error/40`:`border-outline-variant/20 focus:ring-primary/40`}`}),c&&(0,y.jsx)(`div`,{className:`absolute right-3 top-1/2 -translate-y-1/2`,children:c})]}),u&&(0,y.jsx)(`p`,{className:`text-[11px] text-error mt-0.5`,children:u})]})}function me({label:e,id:t,value:n,onChange:r,placeholder:i,error:a}){let[o,s]=(0,v.useState)(!1);return(0,y.jsx)(b,{label:e,id:t,type:o?`text`:`password`,value:n,onChange:r,autoComplete:`new-password`,placeholder:i??`••••••••`,error:a,suffix:(0,y.jsx)(`button`,{type:`button`,onClick:()=>s(e=>!e),className:`text-on-surface-variant hover:text-primary transition-colors`,"aria-label":o?`Hide password`:`Show password`,children:o?(0,y.jsx)(l,{size:16}):(0,y.jsx)(d,{size:16})})})}function he({projectId:e,title:t,description:r,status:i,icon:a,iconColor:o}){return(0,y.jsxs)(n,{to:`/projects/${e}`,className:`bg-surface-container-low p-5 rounded-xl border border-outline-variant/10 hover:bg-surface-container-high transition-colors cursor-pointer ${i===`archived`?`opacity-70`:``}`,children:[(0,y.jsxs)(`div`,{className:`flex justify-between items-start mb-4`,children:[(0,y.jsx)(`div`,{className:`p-2 rounded-lg ${o}`,children:a}),(0,y.jsx)(`span`,{className:`text-[10px] px-2 py-0.5 rounded uppercase font-bold tracking-tight ${i===`active`?`bg-secondary/10 text-secondary border border-secondary/20`:`bg-surface-container-highest text-on-surface-variant`}`,children:i.replace(`_`,` `)})]}),(0,y.jsx)(`h3`,{className:`font-headline font-bold text-on-surface text-sm`,children:t}),(0,y.jsx)(`p`,{className:`text-xs text-on-surface-variant mt-1 leading-relaxed`,children:r})]})}var x=()=>{let{user:e,refreshUser:t}=se(),{projects:n,refreshProjects:r}=oe(),i=e?.role===`admin`,o=n.some(e=>e.status===le.ACTIVE),l=i&&!o,d=i?`Only one active project is allowed at a time. Move the active project out of active status before creating a new one.`:`Only admins can create projects.`,[h,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(`user`),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(``),[M,N]=(0,v.useState)({}),[P,F]=(0,v.useState)({}),[ge,_e]=(0,v.useState)(!1),[ve,ye]=(0,v.useState)(!1),[be,I]=(0,v.useState)(!1),[L,R]=(0,v.useState)(``),[xe,z]=(0,v.useState)(!1),[B,V]=(0,v.useState)(``),[H,U]=(0,v.useState)(!1),[Se,W]=(0,v.useState)(!1),[Ce,G]=(0,v.useState)(!1),[we,K]=(0,v.useState)(!1),[q,J]=(0,v.useState)(``),[Y,Te]=(0,v.useState)(!1),[Ee,X]=(0,v.useState)(g),De=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Oe=()=>{let e={};return h.trim()?h.length>100&&(e.name=`Maximum 100 characters.`):e.name=`First name is required.`,S.trim()?S.length>100&&(e.lastName=`Maximum 100 characters.`):e.lastName=`Last name is required.`,w.trim()?De.test(w)?w.length>255&&(e.email=`Maximum 255 characters.`):e.email=`Must be a valid email address.`:e.email=`Email is required.`,e},ke=()=>{let e={};return O?O.length<8?e.newPwd=`Minimum 8 characters.`:O.length>72&&(e.newPwd=`Maximum 72 characters.`):e.newPwd=`New password is required.`,A?O!==A&&(e.confirmPwd=`Passwords do not match.`):e.confirmPwd=`Please confirm the new password.`,e},Z=e=>ue(e)?e:g;(0,v.useEffect)(()=>{e&&(x(e.name??``),C(e.lastName??``),T(e.email??``),D(e.role??`user`),X(Z(e.avatar)))},[e]);let Ae=async()=>{let n=Oe();if(Object.keys(n).length>0){N(n);return}N({}),_e(!0),R(``),I(!1);try{let n={};h!==(e?.name??``)&&(n.name=h),S!==(e?.lastName??``)&&(n.lastName=S),w!==(e?.email??``)&&(n.email=w);let r=[];Object.keys(n).length>0&&r.push(p.updateProfile(n)),i&&e?.id&&E!==e?.role&&r.push(ee.updateRole(e.id,E)),r.length>0&&(await Promise.all(r),await t()),I(!0),setTimeout(()=>I(!1),3e3)}catch(e){R(e instanceof Error?e.message:`Failed to save changes`)}finally{_e(!1)}},je=async()=>{let e=ke();if(Object.keys(e).length>0){F(e);return}F({}),V(``),z(!1),ye(!0);try{await p.updateProfile({newPassword:O}),k(``),j(``),z(!0),setTimeout(()=>z(!1),4e3)}catch(e){V(e instanceof Error?e.message:`Failed to update password`)}finally{ye(!1)}},Me=async()=>{if(!(!q||!e?.id)){Te(!0);try{await ce.addMember(q,e.id),await r(),G(!1),J(``)}catch{}finally{Te(!1)}}},Ne=async()=>{R(``),I(!1),U(!0);try{await p.updateProfile({avatar:Ee}),await t(),K(!1),I(!0),setTimeout(()=>I(!1),3e3)}catch(e){R(e instanceof Error?e.message:`Failed to update avatar`)}finally{U(!1)}},Q=e?`${e.name??``} ${e.lastName??``}`.trim():`Agent`,$=e?.role??`user`,Pe=$.charAt(0).toUpperCase()+$.slice(1);return(0,y.jsxs)(`div`,{className:`min-h-full pb-16`,children:[(0,y.jsxs)(`header`,{className:`mb-10 flex flex-col sm:flex-row items-center sm:items-end gap-6`,children:[(0,y.jsxs)(`div`,{className:`relative group flex-shrink-0`,children:[(0,y.jsx)(`div`,{className:`absolute -inset-1 bg-gradient-to-tr from-primary to-tertiary rounded-full blur opacity-20 group-hover:opacity-40 transition duration-700`}),(0,y.jsx)(de,{name:Q,avatar:e?.avatar,avatarUrl:e?.avatarUrl,alt:Q,className:`relative h-28 w-28 overflow-hidden rounded-full ring-4 ring-surface sm:h-32 sm:w-32`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>{X(Z(e?.avatar)),K(!0)},title:`Change avatar`,className:`absolute bottom-1 right-1 bg-primary text-on-primary p-1.5 rounded-full shadow-lg hover:scale-110 active:scale-95 transition-transform`,children:(0,y.jsx)(fe,{size:14})})]}),(0,y.jsxs)(`div`,{className:`text-center sm:text-left flex-1`,children:[(0,y.jsx)(`h1`,{className:`font-headline text-3xl sm:text-4xl font-extrabold text-on-surface tracking-tight`,children:Q}),(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 mt-1 justify-center sm:justify-start`,children:[(0,y.jsx)(`span`,{className:`bg-secondary/10 text-secondary border border-secondary/20 px-3 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-widest shadow-[0_0_12px_rgba(78,222,163,0.1)]`,children:Pe}),(0,y.jsx)(`span`,{className:`text-on-surface-variant text-sm font-body`,children:e?.email})]})]}),(0,y.jsxs)(`div`,{className:`flex gap-3 sm:ml-auto flex-shrink-0`,children:[(0,y.jsx)(`button`,{id:`profile-cancel-btn`,onClick:()=>{x(e?.name??``),C(e?.lastName??``),T(e?.email??``),D(e?.role??`user`),R(``),N({})},className:`px-5 py-2 rounded-lg font-bold text-on-surface-variant hover:bg-surface-container-high border border-outline-variant/20 transition-colors text-sm`,children:(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,y.jsx)(m,{size:15}),` Cancel`]})}),(0,y.jsxs)(`button`,{id:`profile-save-btn`,onClick:Ae,disabled:ge,className:`px-6 py-2 rounded-lg font-bold bg-primary text-on-primary hover:brightness-110 active:scale-95 transition-all shadow-[0_8px_24px_rgba(173,198,255,0.15)] text-sm disabled:opacity-60 flex items-center gap-1.5`,children:[ge?(0,y.jsx)(`span`,{className:`w-4 h-4 border-2 border-on-primary/30 border-t-on-primary rounded-full animate-spin`}):(0,y.jsx)(re,{size:15}),`Save Changes`]})]})]}),be&&(0,y.jsxs)(`div`,{className:`mb-6 px-4 py-3 rounded-lg bg-secondary/10 border border-secondary/30 text-secondary text-sm font-medium flex items-center gap-2`,children:[(0,y.jsx)(c,{size:16}),` Profile updated successfully.`]}),L&&(0,y.jsx)(`div`,{className:`mb-6 px-4 py-3 rounded-lg bg-error/10 border border-error/30 text-error text-sm font-medium`,children:L}),(0,y.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-6`,children:[(0,y.jsxs)(`div`,{className:`lg:col-span-8 flex flex-col gap-6`,children:[(0,y.jsxs)(`section`,{className:`glass-panel ghost-border p-7 rounded-2xl shadow-[0_24px_48px_rgba(173,198,255,0.05)]`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3 mb-7`,children:[(0,y.jsx)(`div`,{className:`p-2 rounded-lg bg-primary/10 text-primary`,children:(0,y.jsx)(ae,{size:18})}),(0,y.jsx)(`h2`,{className:`font-headline text-base font-bold text-on-surface`,children:`Personal Information`})]}),(0,y.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-5`,children:[(0,y.jsx)(b,{label:`First Name`,id:`profile-first-name`,value:h,onChange:x,placeholder:`Your first name`,error:M.name}),(0,y.jsx)(b,{label:`Last Name`,id:`profile-last-name`,value:S,onChange:C,placeholder:`Your last name`,error:M.lastName}),(0,y.jsx)(b,{label:`Email Address`,id:`profile-email`,type:`email`,value:w,onChange:T,placeholder:`your@email.com`,className:`sm:col-span-2`,error:M.email})]})]}),(0,y.jsxs)(`section`,{className:`glass-panel ghost-border p-7 rounded-2xl shadow-[0_24px_48px_rgba(173,198,255,0.05)]`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3 mb-7`,children:[(0,y.jsx)(`div`,{className:`p-2 rounded-lg bg-secondary/10 text-secondary`,children:(0,y.jsx)(ie,{size:18})}),(0,y.jsx)(`h2`,{className:`font-headline text-base font-bold text-on-surface`,children:`Role & Clearance`})]}),(0,y.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center gap-5`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3 flex-1`,children:[(0,y.jsx)(`span`,{className:`bg-secondary/10 text-secondary border border-secondary/20 px-4 py-1.5 rounded-full text-xs font-bold uppercase tracking-widest shadow-[0_0_15px_rgba(78,222,163,0.1)] flex-shrink-0`,children:Pe}),(0,y.jsx)(`p`,{className:`text-xs text-on-surface-variant leading-relaxed`,children:$===`admin`?`Full orchestration privileges across all projects.`:`Standard access for task execution and project participation.`})]}),i&&(0,y.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:w-48 flex-shrink-0`,children:[(0,y.jsx)(`label`,{htmlFor:`profile-role-select`,className:`text-[10px] font-bold text-on-surface-variant uppercase tracking-[0.15em]`,children:`Update Role`}),(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsxs)(`select`,{id:`profile-role-select`,value:E,onChange:e=>D(e.target.value),className:`w-full bg-surface-container-lowest rounded-lg px-4 py-2.5 text-sm text-on-surface border border-outline-variant/20 focus:outline-none focus:ring-2 focus:ring-primary/40 transition-all appearance-none cursor-pointer`,children:[(0,y.jsx)(`option`,{value:`admin`,children:`Admin`}),(0,y.jsx)(`option`,{value:`user`,children:`Member`})]}),(0,y.jsx)(s,{size:14,className:`absolute right-3 top-1/2 -translate-y-1/2 text-on-surface-variant pointer-events-none`})]})]})]})]}),(0,y.jsxs)(`section`,{className:`glass-panel ghost-border p-7 rounded-2xl shadow-[0_24px_48px_rgba(173,198,255,0.05)]`,children:[(0,y.jsxs)(`div`,{className:`flex justify-between items-center mb-7`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(`div`,{className:`p-2 rounded-lg bg-tertiary/10 text-tertiary`,children:(0,y.jsx)(f,{size:18})}),(0,y.jsx)(`h2`,{className:`font-headline text-base font-bold text-on-surface`,children:`Project Assignments`})]}),i&&(0,y.jsxs)(`button`,{onClick:()=>l&&W(!0),disabled:!l,title:l?void 0:d,className:`text-xs font-bold text-primary flex items-center gap-1 hover:underline disabled:opacity-50 disabled:no-underline disabled:cursor-not-allowed`,children:[(0,y.jsx)(_,{size:14}),` Create Project`]})]}),i&&o&&(0,y.jsx)(`p`,{className:`mb-5 text-xs text-on-surface-variant`,children:d}),i&&n.length>0&&(0,y.jsx)(`div`,{className:`mb-5`,children:Ce?(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsxs)(`div`,{className:`relative flex-1`,children:[(0,y.jsxs)(`select`,{id:`profile-assign-project-select`,value:q,onChange:e=>J(e.target.value),className:`w-full bg-surface-container-lowest rounded-lg px-4 py-2.5 text-sm text-on-surface border border-outline-variant/20 focus:outline-none focus:ring-2 focus:ring-primary/40 appearance-none`,children:[(0,y.jsx)(`option`,{value:``,children:`Select a project…`}),n.map(e=>(0,y.jsx)(`option`,{value:e.id,children:e.title},e.id))]}),(0,y.jsx)(s,{size:14,className:`absolute right-3 top-1/2 -translate-y-1/2 text-on-surface-variant pointer-events-none`})]}),(0,y.jsx)(`button`,{onClick:Me,disabled:!q||Y,className:`px-4 py-2.5 rounded-lg text-sm font-bold bg-primary text-on-primary disabled:opacity-50 hover:brightness-110 transition-all`,children:Y?`…`:`Assign`}),(0,y.jsx)(`button`,{onClick:()=>{G(!1),J(``)},className:`p-2.5 rounded-lg text-on-surface-variant hover:bg-surface-container-high transition-colors`,children:(0,y.jsx)(m,{size:14})})]}):(0,y.jsxs)(`button`,{onClick:()=>G(!0),className:`text-xs font-bold text-on-surface-variant flex items-center gap-1.5 hover:text-primary transition-colors`,children:[(0,y.jsx)(u,{size:14}),` Assign to Project`]})}),n&&n.length>0?(0,y.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[n.slice(0,4).map((e,t)=>(0,y.jsx)(he,{projectId:e.id,title:e.title,description:e.description??`No description provided.`,status:e.status,icon:t===0?(0,y.jsx)(ne,{size:18}):t===1?(0,y.jsx)(f,{size:18}):(0,y.jsx)(a,{size:18}),iconColor:t===0?`bg-primary/10 text-primary`:t===1?`bg-tertiary/10 text-tertiary`:`bg-on-surface-variant/10 text-on-surface-variant`},e.id)),i&&l&&(0,y.jsxs)(`div`,{onClick:()=>W(!0),role:`button`,tabIndex:0,onKeyDown:e=>e.key===`Enter`&&W(!0),className:`bg-surface-container-low p-5 rounded-xl border-2 border-dashed border-outline-variant/20 flex flex-col items-center justify-center gap-2 hover:border-primary/40 transition-all cursor-pointer min-h-[140px]`,children:[(0,y.jsx)(_,{size:24,className:`text-primary/40`}),(0,y.jsx)(`span`,{className:`text-xs font-bold text-on-surface-variant uppercase tracking-wide`,children:`New Project`})]})]}):(0,y.jsxs)(`div`,{onClick:l?()=>W(!0):void 0,role:l?`button`:void 0,tabIndex:l?0:void 0,onKeyDown:l?e=>e.key===`Enter`&&W(!0):void 0,className:`bg-surface-container-low p-5 rounded-xl border-2 border-dashed border-outline-variant/20 flex flex-col items-center justify-center gap-2 hover:border-primary/40 transition-all min-h-[140px] ${l?`cursor-pointer`:`cursor-default opacity-60`}`,children:[(0,y.jsx)(_,{size:24,className:`text-primary/40`}),(0,y.jsx)(`span`,{className:`text-xs font-bold text-on-surface-variant uppercase tracking-wide`,children:l?`Create First Project`:i?`Active Project Exists`:`No Projects Assigned`})]})]})]}),(0,y.jsx)(`div`,{className:`lg:col-span-4 flex flex-col gap-6`,children:(0,y.jsxs)(`section`,{className:`glass-panel ghost-border p-7 rounded-2xl shadow-[0_24px_48px_rgba(173,198,255,0.05)]`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3 mb-7`,children:[(0,y.jsx)(`div`,{className:`p-2 rounded-lg bg-tertiary/10 text-tertiary`,children:(0,y.jsx)(ie,{size:18})}),(0,y.jsx)(`h2`,{className:`font-headline text-base font-bold text-on-surface`,children:`Security`})]}),xe&&(0,y.jsxs)(`div`,{className:`mb-5 px-3 py-2.5 rounded-lg bg-secondary/10 border border-secondary/30 text-secondary text-xs font-medium flex items-center gap-2`,children:[(0,y.jsx)(c,{size:14}),` Password updated successfully.`]}),B&&(0,y.jsx)(`div`,{className:`mb-5 px-3 py-2.5 rounded-lg bg-error/10 border border-error/30 text-error text-xs`,children:B}),(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsx)(me,{label:`New Password`,id:`profile-new-pwd`,value:O,onChange:k,placeholder:`Min. 8 characters`,error:P.newPwd}),(0,y.jsx)(me,{label:`Confirm New Password`,id:`profile-confirm-pwd`,value:A,onChange:j,placeholder:`Repeat new password`,error:P.confirmPwd}),(0,y.jsxs)(`button`,{id:`profile-update-creds-btn`,onClick:je,disabled:ve,className:`w-full py-2.5 rounded-lg text-sm font-bold bg-tertiary/10 text-tertiary border border-tertiary/20 hover:bg-tertiary hover:text-on-tertiary transition-all disabled:opacity-60 flex items-center justify-center gap-2`,children:[ve?(0,y.jsx)(`span`,{className:`w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin`}):null,`Update Credentials`]})]})]})})]}),(0,y.jsx)(te,{isOpen:Se,onClose:()=>W(!1),onCreated:async()=>{await r(),W(!1)},canCreate:l,blockedReason:d}),(0,y.jsx)(pe,{isOpen:we,selectedAvatar:Ee,currentAvatar:Z(e?.avatar),isSaving:H,onSelect:X,onClose:()=>{H||(K(!1),X(Z(e?.avatar)))},onConfirm:Ne})]})};export{x as default};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CfaHPvi0.js";import{n}from"./vendor-react-BmVaKUwY.js";import{r}from"./vendor-markdown-DoJbQ1of.js";import{i}from"./client-B553SX3l.js";import{t as a}from"./box-CFDcDxHv.js";import{t as o}from"./check-BiORptL3.js";import{t as s}from"./chevron-down-BUOg3vvd.js";import{t as c}from"./circle-check-Jz8IOE4h.js";import{n as l,t as u}from"./user-plus-0Y0M1GKi.js";import{t as d}from"./eye-CjrFwZG_.js";import{n as f,t as ee}from"./users-BcnlUG5N.js";import{n as te,t as p}from"./auth-Lh2N3iYN.js";import{t as ne}from"./rocket-B9Iexkcw.js";import{t as re}from"./save-Cmqi1IkN.js";import{t as ie}from"./shield-check-YKs9kUNq.js";import{t as ae}from"./user-Brcjlps5.js";import{t as m}from"./x-CCZGYGDC.js";import{t as oe}from"./useProject-DhK9Ze6F.js";import{n as se}from"./AuthContextInstance-DiFo9Qb2.js";import{n as ce,t as le}from"./projects-DoalTI7c.js";import{i as ue,n as h,r as g,t as de}from"./UserAvatar-Z5W8S1dG.js";var _=i(`circle-plus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),fe=i(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),v=e(t(),1),y=r(),pe=({isOpen:e,selectedAvatar:t,currentAvatar:n,isSaving:r,onSelect:i,onClose:a,onConfirm:s})=>((0,v.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&!r&&a()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,r,a]),e?(0,y.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 py-8 backdrop-blur-sm`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0`,"aria-hidden":`true`,onClick:()=>{r||a()}}),(0,y.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`avatar-picker-title`,className:`relative w-full max-w-2xl rounded-3xl border border-outline-variant/20 bg-surface p-6 shadow-[0_28px_80px_rgba(0,0,0,0.45)]`,children:[(0,y.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`p`,{className:`mb-2 text-[11px] font-bold uppercase tracking-[0.3em] text-primary/80`,children:`Avatar presets`}),(0,y.jsx)(`h2`,{id:`avatar-picker-title`,className:`font-headline text-2xl font-bold text-on-surface`,children:`Choose your avatar`}),(0,y.jsx)(`p`,{className:`mt-2 text-sm text-on-surface-variant`,children:`Pick one of the built-in presets. Your choice updates everywhere your profile picture is shown.`})]}),(0,y.jsx)(`button`,{type:`button`,onClick:a,disabled:r,"aria-label":`Close avatar picker`,className:`rounded-full border border-outline-variant/20 p-2 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface disabled:cursor-not-allowed disabled:opacity-50`,children:(0,y.jsx)(m,{size:18})})]}),(0,y.jsx)(`div`,{className:`grid grid-cols-2 gap-4 sm:grid-cols-4`,children:h.map(e=>{let r=e.key===t,a=e.key===n;return(0,y.jsxs)(`button`,{type:`button`,onClick:()=>i(e.key),className:`group relative rounded-2xl border p-3 text-left transition-all ${r?`border-primary bg-primary/10 shadow-[0_0_0_1px_rgba(173,198,255,0.25)]`:`border-outline-variant/20 bg-surface-container-low hover:border-primary/40 hover:bg-surface-container-high`}`,children:[(0,y.jsx)(`div`,{className:`overflow-hidden rounded-2xl bg-surface-container-high`,children:(0,y.jsx)(`img`,{src:e.src,alt:e.label,className:`aspect-square w-full object-cover`})}),(0,y.jsxs)(`div`,{className:`mt-3 flex items-center justify-between`,children:[(0,y.jsx)(`span`,{className:`text-sm font-semibold text-on-surface`,children:e.label}),r?(0,y.jsx)(`span`,{className:`inline-flex h-6 w-6 items-center justify-center rounded-full bg-primary text-on-primary`,children:(0,y.jsx)(o,{size:14})}):null]}),(0,y.jsx)(`p`,{className:`mt-1 text-xs text-on-surface-variant`,children:a?`Current avatar`:`Available preset`})]},e.key)})}),(0,y.jsxs)(`div`,{className:`mt-6 flex justify-end gap-3`,children:[(0,y.jsx)(`button`,{type:`button`,onClick:a,disabled:r,className:`rounded-lg border border-outline-variant/20 px-5 py-2.5 text-sm font-bold text-on-surface-variant transition-colors hover:bg-surface-container-high disabled:cursor-not-allowed disabled:opacity-50`,children:`Cancel`}),(0,y.jsxs)(`button`,{type:`button`,onClick:()=>void s(),disabled:r||t===n,className:`flex items-center gap-2 rounded-lg bg-primary px-5 py-2.5 text-sm font-bold text-on-primary transition-all hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-60`,children:[r?(0,y.jsx)(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-on-primary/30 border-t-on-primary`}):null,`Save avatar`]})]})]})]}):null);function b({label:e,id:t,type:n=`text`,value:r,onChange:i,placeholder:a,disabled:o=!1,className:s=``,suffix:c,autoComplete:l,error:u}){return(0,y.jsxs)(`div`,{className:`flex flex-col gap-2 ${s}`,children:[(0,y.jsx)(`label`,{htmlFor:t,className:`text-[10px] font-bold text-on-surface-variant uppercase tracking-[0.15em]`,children:e}),(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(`input`,{id:t,type:n,value:r,autoComplete:l,onChange:e=>i(e.target.value),placeholder:a,disabled:o,className:`w-full bg-surface-container-lowest rounded-lg px-4 py-3 text-sm text-on-surface border focus:outline-none focus:ring-2 transition-all disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-on-surface-variant/40 ${u?`border-error/60 focus:ring-error/40`:`border-outline-variant/20 focus:ring-primary/40`}`}),c&&(0,y.jsx)(`div`,{className:`absolute right-3 top-1/2 -translate-y-1/2`,children:c})]}),u&&(0,y.jsx)(`p`,{className:`text-[11px] text-error mt-0.5`,children:u})]})}function me({label:e,id:t,value:n,onChange:r,placeholder:i,error:a}){let[o,s]=(0,v.useState)(!1);return(0,y.jsx)(b,{label:e,id:t,type:o?`text`:`password`,value:n,onChange:r,autoComplete:`new-password`,placeholder:i??`••••••••`,error:a,suffix:(0,y.jsx)(`button`,{type:`button`,onClick:()=>s(e=>!e),className:`text-on-surface-variant hover:text-primary transition-colors`,"aria-label":o?`Hide password`:`Show password`,children:o?(0,y.jsx)(l,{size:16}):(0,y.jsx)(d,{size:16})})})}function he({projectId:e,title:t,description:r,status:i,icon:a,iconColor:o}){return(0,y.jsxs)(n,{to:`/projects/${e}`,className:`bg-surface-container-low p-5 rounded-xl border border-outline-variant/10 hover:bg-surface-container-high transition-colors cursor-pointer ${i===`archived`?`opacity-70`:``}`,children:[(0,y.jsxs)(`div`,{className:`flex justify-between items-start mb-4`,children:[(0,y.jsx)(`div`,{className:`p-2 rounded-lg ${o}`,children:a}),(0,y.jsx)(`span`,{className:`text-[10px] px-2 py-0.5 rounded uppercase font-bold tracking-tight ${i===`active`?`bg-secondary/10 text-secondary border border-secondary/20`:`bg-surface-container-highest text-on-surface-variant`}`,children:i.replace(`_`,` `)})]}),(0,y.jsx)(`h3`,{className:`font-headline font-bold text-on-surface text-sm`,children:t}),(0,y.jsx)(`p`,{className:`text-xs text-on-surface-variant mt-1 leading-relaxed`,children:r})]})}var x=()=>{let{user:e,refreshUser:t}=se(),{projects:n,refreshProjects:r}=oe(),i=e?.role===`admin`,o=n.some(e=>e.status===le.ACTIVE),l=i&&!o,d=i?`Only one active project is allowed at a time. Move the active project out of active status before creating a new one.`:`Only admins can create projects.`,[h,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(`user`),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(``),[M,N]=(0,v.useState)({}),[P,F]=(0,v.useState)({}),[ge,_e]=(0,v.useState)(!1),[ve,ye]=(0,v.useState)(!1),[be,I]=(0,v.useState)(!1),[L,R]=(0,v.useState)(``),[xe,z]=(0,v.useState)(!1),[B,V]=(0,v.useState)(``),[H,U]=(0,v.useState)(!1),[Se,W]=(0,v.useState)(!1),[Ce,G]=(0,v.useState)(!1),[we,K]=(0,v.useState)(!1),[q,J]=(0,v.useState)(``),[Y,Te]=(0,v.useState)(!1),[Ee,X]=(0,v.useState)(g),De=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Oe=()=>{let e={};return h.trim()?h.length>100&&(e.name=`Maximum 100 characters.`):e.name=`First name is required.`,S.trim()?S.length>100&&(e.lastName=`Maximum 100 characters.`):e.lastName=`Last name is required.`,w.trim()?De.test(w)?w.length>255&&(e.email=`Maximum 255 characters.`):e.email=`Must be a valid email address.`:e.email=`Email is required.`,e},ke=()=>{let e={};return O?O.length<8?e.newPwd=`Minimum 8 characters.`:O.length>72&&(e.newPwd=`Maximum 72 characters.`):e.newPwd=`New password is required.`,A?O!==A&&(e.confirmPwd=`Passwords do not match.`):e.confirmPwd=`Please confirm the new password.`,e},Z=e=>ue(e)?e:g;(0,v.useEffect)(()=>{e&&(x(e.name??``),C(e.lastName??``),T(e.email??``),D(e.role??`user`),X(Z(e.avatar)))},[e]);let Ae=async()=>{let n=Oe();if(Object.keys(n).length>0){N(n);return}N({}),_e(!0),R(``),I(!1);try{let n={};h!==(e?.name??``)&&(n.name=h),S!==(e?.lastName??``)&&(n.lastName=S),w!==(e?.email??``)&&(n.email=w);let r=[];Object.keys(n).length>0&&r.push(p.updateProfile(n)),i&&e?.id&&E!==e?.role&&r.push(ee.updateRole(e.id,E)),r.length>0&&(await Promise.all(r),await t()),I(!0),setTimeout(()=>I(!1),3e3)}catch(e){R(e instanceof Error?e.message:`Failed to save changes`)}finally{_e(!1)}},je=async()=>{let e=ke();if(Object.keys(e).length>0){F(e);return}F({}),V(``),z(!1),ye(!0);try{await p.updateProfile({newPassword:O}),k(``),j(``),z(!0),setTimeout(()=>z(!1),4e3)}catch(e){V(e instanceof Error?e.message:`Failed to update password`)}finally{ye(!1)}},Me=async()=>{if(!(!q||!e?.id)){Te(!0);try{await ce.addMember(q,e.id),await r(),G(!1),J(``)}catch{}finally{Te(!1)}}},Ne=async()=>{R(``),I(!1),U(!0);try{await p.updateProfile({avatar:Ee}),await t(),K(!1),I(!0),setTimeout(()=>I(!1),3e3)}catch(e){R(e instanceof Error?e.message:`Failed to update avatar`)}finally{U(!1)}},Q=e?`${e.name??``} ${e.lastName??``}`.trim():`Agent`,$=e?.role??`user`,Pe=$.charAt(0).toUpperCase()+$.slice(1);return(0,y.jsxs)(`div`,{className:`min-h-full pb-16`,children:[(0,y.jsxs)(`header`,{className:`mb-10 flex flex-col sm:flex-row items-center sm:items-end gap-6`,children:[(0,y.jsxs)(`div`,{className:`relative group flex-shrink-0`,children:[(0,y.jsx)(`div`,{className:`absolute -inset-1 bg-gradient-to-tr from-primary to-tertiary rounded-full blur opacity-20 group-hover:opacity-40 transition duration-700`}),(0,y.jsx)(de,{name:Q,avatar:e?.avatar,avatarUrl:e?.avatarUrl,alt:Q,className:`relative h-28 w-28 overflow-hidden rounded-full ring-4 ring-surface sm:h-32 sm:w-32`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>{X(Z(e?.avatar)),K(!0)},title:`Change avatar`,className:`absolute bottom-1 right-1 bg-primary text-on-primary p-1.5 rounded-full shadow-lg hover:scale-110 active:scale-95 transition-transform`,children:(0,y.jsx)(fe,{size:14})})]}),(0,y.jsxs)(`div`,{className:`text-center sm:text-left flex-1`,children:[(0,y.jsx)(`h1`,{className:`font-headline text-3xl sm:text-4xl font-extrabold text-on-surface tracking-tight`,children:Q}),(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 mt-1 justify-center sm:justify-start`,children:[(0,y.jsx)(`span`,{className:`bg-secondary/10 text-secondary border border-secondary/20 px-3 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-widest shadow-[0_0_12px_rgba(78,222,163,0.1)]`,children:Pe}),(0,y.jsx)(`span`,{className:`text-on-surface-variant text-sm font-body`,children:e?.email})]})]}),(0,y.jsxs)(`div`,{className:`flex gap-3 sm:ml-auto flex-shrink-0`,children:[(0,y.jsx)(`button`,{id:`profile-cancel-btn`,onClick:()=>{x(e?.name??``),C(e?.lastName??``),T(e?.email??``),D(e?.role??`user`),R(``),N({})},className:`px-5 py-2 rounded-lg font-bold text-on-surface-variant hover:bg-surface-container-high border border-outline-variant/20 transition-colors text-sm`,children:(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,y.jsx)(m,{size:15}),` Cancel`]})}),(0,y.jsxs)(`button`,{id:`profile-save-btn`,onClick:Ae,disabled:ge,className:`px-6 py-2 rounded-lg font-bold bg-primary text-on-primary hover:brightness-110 active:scale-95 transition-all shadow-[0_8px_24px_rgba(173,198,255,0.15)] text-sm disabled:opacity-60 flex items-center gap-1.5`,children:[ge?(0,y.jsx)(`span`,{className:`w-4 h-4 border-2 border-on-primary/30 border-t-on-primary rounded-full animate-spin`}):(0,y.jsx)(re,{size:15}),`Save Changes`]})]})]}),be&&(0,y.jsxs)(`div`,{className:`mb-6 px-4 py-3 rounded-lg bg-secondary/10 border border-secondary/30 text-secondary text-sm font-medium flex items-center gap-2`,children:[(0,y.jsx)(c,{size:16}),` Profile updated successfully.`]}),L&&(0,y.jsx)(`div`,{className:`mb-6 px-4 py-3 rounded-lg bg-error/10 border border-error/30 text-error text-sm font-medium`,children:L}),(0,y.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-6`,children:[(0,y.jsxs)(`div`,{className:`lg:col-span-8 flex flex-col gap-6`,children:[(0,y.jsxs)(`section`,{className:`glass-panel ghost-border p-7 rounded-2xl shadow-[0_24px_48px_rgba(173,198,255,0.05)]`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3 mb-7`,children:[(0,y.jsx)(`div`,{className:`p-2 rounded-lg bg-primary/10 text-primary`,children:(0,y.jsx)(ae,{size:18})}),(0,y.jsx)(`h2`,{className:`font-headline text-base font-bold text-on-surface`,children:`Personal Information`})]}),(0,y.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-5`,children:[(0,y.jsx)(b,{label:`First Name`,id:`profile-first-name`,value:h,onChange:x,placeholder:`Your first name`,error:M.name}),(0,y.jsx)(b,{label:`Last Name`,id:`profile-last-name`,value:S,onChange:C,placeholder:`Your last name`,error:M.lastName}),(0,y.jsx)(b,{label:`Email Address`,id:`profile-email`,type:`email`,value:w,onChange:T,placeholder:`your@email.com`,className:`sm:col-span-2`,error:M.email})]})]}),(0,y.jsxs)(`section`,{className:`glass-panel ghost-border p-7 rounded-2xl shadow-[0_24px_48px_rgba(173,198,255,0.05)]`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3 mb-7`,children:[(0,y.jsx)(`div`,{className:`p-2 rounded-lg bg-secondary/10 text-secondary`,children:(0,y.jsx)(ie,{size:18})}),(0,y.jsx)(`h2`,{className:`font-headline text-base font-bold text-on-surface`,children:`Role & Clearance`})]}),(0,y.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center gap-5`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3 flex-1`,children:[(0,y.jsx)(`span`,{className:`bg-secondary/10 text-secondary border border-secondary/20 px-4 py-1.5 rounded-full text-xs font-bold uppercase tracking-widest shadow-[0_0_15px_rgba(78,222,163,0.1)] flex-shrink-0`,children:Pe}),(0,y.jsx)(`p`,{className:`text-xs text-on-surface-variant leading-relaxed`,children:$===`admin`?`Full orchestration privileges across all projects.`:`Standard access for task execution and project participation.`})]}),i&&(0,y.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:w-48 flex-shrink-0`,children:[(0,y.jsx)(`label`,{htmlFor:`profile-role-select`,className:`text-[10px] font-bold text-on-surface-variant uppercase tracking-[0.15em]`,children:`Update Role`}),(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsxs)(`select`,{id:`profile-role-select`,value:E,onChange:e=>D(e.target.value),className:`w-full bg-surface-container-lowest rounded-lg px-4 py-2.5 text-sm text-on-surface border border-outline-variant/20 focus:outline-none focus:ring-2 focus:ring-primary/40 transition-all appearance-none cursor-pointer`,children:[(0,y.jsx)(`option`,{value:`admin`,children:`Admin`}),(0,y.jsx)(`option`,{value:`user`,children:`Member`})]}),(0,y.jsx)(s,{size:14,className:`absolute right-3 top-1/2 -translate-y-1/2 text-on-surface-variant pointer-events-none`})]})]})]})]}),(0,y.jsxs)(`section`,{className:`glass-panel ghost-border p-7 rounded-2xl shadow-[0_24px_48px_rgba(173,198,255,0.05)]`,children:[(0,y.jsxs)(`div`,{className:`flex justify-between items-center mb-7`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(`div`,{className:`p-2 rounded-lg bg-tertiary/10 text-tertiary`,children:(0,y.jsx)(f,{size:18})}),(0,y.jsx)(`h2`,{className:`font-headline text-base font-bold text-on-surface`,children:`Project Assignments`})]}),i&&(0,y.jsxs)(`button`,{onClick:()=>l&&W(!0),disabled:!l,title:l?void 0:d,className:`text-xs font-bold text-primary flex items-center gap-1 hover:underline disabled:opacity-50 disabled:no-underline disabled:cursor-not-allowed`,children:[(0,y.jsx)(_,{size:14}),` Create Project`]})]}),i&&o&&(0,y.jsx)(`p`,{className:`mb-5 text-xs text-on-surface-variant`,children:d}),i&&n.length>0&&(0,y.jsx)(`div`,{className:`mb-5`,children:Ce?(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsxs)(`div`,{className:`relative flex-1`,children:[(0,y.jsxs)(`select`,{id:`profile-assign-project-select`,value:q,onChange:e=>J(e.target.value),className:`w-full bg-surface-container-lowest rounded-lg px-4 py-2.5 text-sm text-on-surface border border-outline-variant/20 focus:outline-none focus:ring-2 focus:ring-primary/40 appearance-none`,children:[(0,y.jsx)(`option`,{value:``,children:`Select a project…`}),n.map(e=>(0,y.jsx)(`option`,{value:e.id,children:e.title},e.id))]}),(0,y.jsx)(s,{size:14,className:`absolute right-3 top-1/2 -translate-y-1/2 text-on-surface-variant pointer-events-none`})]}),(0,y.jsx)(`button`,{onClick:Me,disabled:!q||Y,className:`px-4 py-2.5 rounded-lg text-sm font-bold bg-primary text-on-primary disabled:opacity-50 hover:brightness-110 transition-all`,children:Y?`…`:`Assign`}),(0,y.jsx)(`button`,{onClick:()=>{G(!1),J(``)},className:`p-2.5 rounded-lg text-on-surface-variant hover:bg-surface-container-high transition-colors`,children:(0,y.jsx)(m,{size:14})})]}):(0,y.jsxs)(`button`,{onClick:()=>G(!0),className:`text-xs font-bold text-on-surface-variant flex items-center gap-1.5 hover:text-primary transition-colors`,children:[(0,y.jsx)(u,{size:14}),` Assign to Project`]})}),n&&n.length>0?(0,y.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[n.slice(0,4).map((e,t)=>(0,y.jsx)(he,{projectId:e.id,title:e.title,description:e.description??`No description provided.`,status:e.status,icon:t===0?(0,y.jsx)(ne,{size:18}):t===1?(0,y.jsx)(f,{size:18}):(0,y.jsx)(a,{size:18}),iconColor:t===0?`bg-primary/10 text-primary`:t===1?`bg-tertiary/10 text-tertiary`:`bg-on-surface-variant/10 text-on-surface-variant`},e.id)),i&&l&&(0,y.jsxs)(`div`,{onClick:()=>W(!0),role:`button`,tabIndex:0,onKeyDown:e=>e.key===`Enter`&&W(!0),className:`bg-surface-container-low p-5 rounded-xl border-2 border-dashed border-outline-variant/20 flex flex-col items-center justify-center gap-2 hover:border-primary/40 transition-all cursor-pointer min-h-[140px]`,children:[(0,y.jsx)(_,{size:24,className:`text-primary/40`}),(0,y.jsx)(`span`,{className:`text-xs font-bold text-on-surface-variant uppercase tracking-wide`,children:`New Project`})]})]}):(0,y.jsxs)(`div`,{onClick:l?()=>W(!0):void 0,role:l?`button`:void 0,tabIndex:l?0:void 0,onKeyDown:l?e=>e.key===`Enter`&&W(!0):void 0,className:`bg-surface-container-low p-5 rounded-xl border-2 border-dashed border-outline-variant/20 flex flex-col items-center justify-center gap-2 hover:border-primary/40 transition-all min-h-[140px] ${l?`cursor-pointer`:`cursor-default opacity-60`}`,children:[(0,y.jsx)(_,{size:24,className:`text-primary/40`}),(0,y.jsx)(`span`,{className:`text-xs font-bold text-on-surface-variant uppercase tracking-wide`,children:l?`Create First Project`:i?`Active Project Exists`:`No Projects Assigned`})]})]})]}),(0,y.jsx)(`div`,{className:`lg:col-span-4 flex flex-col gap-6`,children:(0,y.jsxs)(`section`,{className:`glass-panel ghost-border p-7 rounded-2xl shadow-[0_24px_48px_rgba(173,198,255,0.05)]`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3 mb-7`,children:[(0,y.jsx)(`div`,{className:`p-2 rounded-lg bg-tertiary/10 text-tertiary`,children:(0,y.jsx)(ie,{size:18})}),(0,y.jsx)(`h2`,{className:`font-headline text-base font-bold text-on-surface`,children:`Security`})]}),xe&&(0,y.jsxs)(`div`,{className:`mb-5 px-3 py-2.5 rounded-lg bg-secondary/10 border border-secondary/30 text-secondary text-xs font-medium flex items-center gap-2`,children:[(0,y.jsx)(c,{size:14}),` Password updated successfully.`]}),B&&(0,y.jsx)(`div`,{className:`mb-5 px-3 py-2.5 rounded-lg bg-error/10 border border-error/30 text-error text-xs`,children:B}),(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsx)(me,{label:`New Password`,id:`profile-new-pwd`,value:O,onChange:k,placeholder:`Min. 8 characters`,error:P.newPwd}),(0,y.jsx)(me,{label:`Confirm New Password`,id:`profile-confirm-pwd`,value:A,onChange:j,placeholder:`Repeat new password`,error:P.confirmPwd}),(0,y.jsxs)(`button`,{id:`profile-update-creds-btn`,onClick:je,disabled:ve,className:`w-full py-2.5 rounded-lg text-sm font-bold bg-tertiary/10 text-tertiary border border-tertiary/20 hover:bg-tertiary hover:text-on-tertiary transition-all disabled:opacity-60 flex items-center justify-center gap-2`,children:[ve?(0,y.jsx)(`span`,{className:`w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin`}):null,`Update Credentials`]})]})]})})]}),(0,y.jsx)(te,{isOpen:Se,onClose:()=>W(!1),onCreated:async()=>{await r(),W(!1)},canCreate:l,blockedReason:d}),(0,y.jsx)(pe,{isOpen:we,selectedAvatar:Ee,currentAvatar:Z(e?.avatar),isSaving:H,onSelect:X,onClose:()=>{H||(K(!1),X(Z(e?.avatar)))},onConfirm:Ne})]})};export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CfaHPvi0.js";import{c as n,s as r}from"./vendor-react-BmVaKUwY.js";import{r as i}from"./vendor-markdown-DoJbQ1of.js";import{i as a}from"./client-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CfaHPvi0.js";import{c as n,s as r}from"./vendor-react-BmVaKUwY.js";import{r as i}from"./vendor-markdown-DoJbQ1of.js";import{i as a}from"./client-B553SX3l.js";import{t as o}from"./briefcase-mFWNV6w9.js";import{t as s}from"./chevron-down-BUOg3vvd.js";import{t as c}from"./MarkdownField-DR6tHsei.js";import{t as l}from"./layers-CVf8_Byb.js";import{t as u}from"./save-Cmqi1IkN.js";import{t as d}from"./shield-check-YKs9kUNq.js";import{t as f}from"./sparkles-krUpxie4.js";import{t as p}from"./trash-2-CphQfk35.js";import{t as m}from"./user-Brcjlps5.js";import{t as h}from"./useProject-DhK9Ze6F.js";import{n as g,t as _}from"./projects-DoalTI7c.js";import{n as v}from"./agents-YQJ7JNfI.js";import{t as y}from"./useNotification-DQayTSUL.js";var b=a(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),x=e(t(),1),S=i(),C=()=>{let{projectId:e}=n(),t=r(),{notifySuccess:i,notifyApiError:a}=y(),{projects:C,refreshProjects:w}=h(),[T,E]=(0,x.useState)(null),[D,O]=(0,x.useState)([]),[k,A]=(0,x.useState)(!0),[j,M]=(0,x.useState)(!1),N=C.some(t=>t.status===_.ACTIVE&&t.id!==e),[P,F]=(0,x.useState)(``),[I,L]=(0,x.useState)(``),[R,z]=(0,x.useState)(_.PLANNING),[B,V]=(0,x.useState)(``),H=(0,x.useCallback)(async()=>{try{A(!0);let[t,n]=await Promise.all([g.findOne(e),v.findAll()]),r=t.data;E(r),O(n.data),F(r.title),L(r.description||``),z(r.status||_.PLANNING),V(r.ownerAgent?.id||``)}catch(e){a(e,`Fetch Error`)}finally{A(!1)}},[e,a]);return(0,x.useEffect)(()=>{e&&H()},[e,H]),k?(0,S.jsx)(`div`,{className:`flex items-center justify-center h-full min-h-[50vh]`,children:(0,S.jsx)(`div`,{className:`w-8 h-8 rounded-full border-4 border border-outline-variant/30 border-t-primary animate-spin`})}):T?(0,S.jsxs)(`div`,{className:`space-y-10 animate-in fade-in slide-in-from-bottom-4 duration-700`,children:[(0,S.jsxs)(`div`,{className:`flex flex-col md:flex-row justify-between items-start md:items-center gap-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-5`,children:[(0,S.jsx)(`button`,{onClick:()=>t(`/`),className:`w-12 h-12 rounded-2xl bg-surface-container-high border border-outline-variant/10 flex items-center justify-center text-on-surface-variant hover:text-white hover:bg-surface-container-highest transition-all group`,children:(0,S.jsx)(b,{size:20,className:`group-hover:-translate-x-1 transition-transform`})}),(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,S.jsx)(`div`,{className:`w-6 h-6 rounded-lg bg-secondary/20 flex items-center justify-center text-secondary`,children:(0,S.jsx)(o,{size:12})}),(0,S.jsx)(`span`,{className:`text-[10px] font-black uppercase tracking-[0.3em] text-on-surface-variant`,children:`Project Console`})]}),(0,S.jsx)(`h1`,{className:`text-3xl font-black font-headline text-white tracking-tight -mt-1`,children:T.title})]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3 w-full md:w-auto`,children:[(0,S.jsxs)(`button`,{className:`flex-1 md:flex-initial px-6 py-3 rounded-2xl bg-surface-container-high text-on-article-variant font-bold text-sm flex items-center justify-center gap-2 hover:bg-error/10 hover:text-error transition-all ring-1 ring-outline-variant/10 border-none`,children:[(0,S.jsx)(p,{size:18}),`Delete Project`]}),(0,S.jsxs)(`button`,{onClick:async()=>{if(e)try{M(!0),await g.update(e,{title:P,description:I||void 0,status:R,ownerAgentId:B||null}),await w(),i(`Project Updated`,`Project settings have been updated`)}catch(e){a(e,`Sync Error`)}finally{M(!1)}},disabled:j,className:`flex-1 md:flex-initial px-8 py-3 rounded-2xl bg-primary text-surface font-black text-sm flex items-center justify-center gap-2 hover:scale-[1.02] active:scale-[0.98] transition-all shadow-lg shadow-primary/20 disabled:grayscale disabled:opacity-50`,children:[j?(0,S.jsx)(`div`,{className:`w-5 h-5 border-2 border-surface/30 border-t-surface rounded-full animate-spin`}):(0,S.jsx)(u,{size:18}),`Synchronize Parameters`]})]})]}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-8`,children:[(0,S.jsx)(`div`,{className:`lg:col-span-2 space-y-8`,children:(0,S.jsxs)(`section`,{className:`bg-surface-container-low rounded-3xl border border-outline-variant/10 overflow-hidden shadow-2xl`,children:[(0,S.jsxs)(`div`,{className:`px-8 py-6 border-b border-outline-variant/5 flex items-center gap-3`,children:[(0,S.jsx)(l,{size:18,className:`text-primary`}),(0,S.jsx)(`h3`,{className:`text-sm font-black uppercase tracking-widest text-on-surface`,children:`Project Settings`})]}),(0,S.jsxs)(`div`,{className:`p-8 space-y-8`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 ml-1 italic`,children:`Identification Tag`}),(0,S.jsx)(`div`,{className:`bg-surface-container-highest/30 rounded-2xl p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 focus-within:bg-surface-container-highest/50 transition-all`,children:(0,S.jsx)(`input`,{type:`text`,value:P,onChange:e=>F(e.target.value),className:`w-full bg-transparent border-none text-base text-on-surface h-14 px-5 focus:outline-none font-bold`})})]}),(0,S.jsx)(`div`,{className:`space-y-2`,children:(0,S.jsx)(c,{label:`Operational Directives`,value:I,onChange:L,height:`h-64`,maxLength:5e3,placeholder:`Enter strategic goals, scope, and specific node instructions...`})})]})]})}),(0,S.jsxs)(`div`,{className:`space-y-8`,children:[(0,S.jsxs)(`section`,{className:`bg-surface-container-low rounded-3xl border border-outline-variant/10 p-8 space-y-6 shadow-2xl`,children:[(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsxs)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,S.jsx)(d,{size:14,className:`text-secondary`}),`Operational Protocol`]}),(0,S.jsx)(`div`,{className:`grid grid-cols-1 gap-2`,children:Object.values(_).map(e=>(0,S.jsx)(`button`,{onClick:()=>z(e),disabled:e===_.ACTIVE&&N&&R!==_.ACTIVE,className:`px-4 py-3 rounded-xl border text-[11px] font-black uppercase tracking-widest transition-all text-left ${R===e?`bg-secondary/10 border-secondary text-secondary shadow-lg shadow-secondary/5`:`bg-surface-container-high/30 border-outline-variant/5 text-on-surface-variant/60 hover:bg-surface-container-high/60 disabled:opacity-50 disabled:cursor-not-allowed`}`,children:(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e.replace(`_`,` `),R===e&&(0,S.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-secondary animate-pulse`})]})},e))}),N&&R!==_.ACTIVE&&(0,S.jsx)(`p`,{className:`text-[11px] text-on-surface-variant/70`,children:`Another project is already active. Move it out of active status before activating this one.`})]}),(0,S.jsxs)(`div`,{className:`pt-6 border-t border-outline-variant/5 space-y-4`,children:[(0,S.jsxs)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,S.jsx)(m,{size:14,className:`text-primary`}),`Designated Project Lead`]}),(0,S.jsxs)(`div`,{className:`bg-surface-container-high/30 rounded-2xl p-0.5 ring-1 ring-outline-variant/10 transition-all relative`,children:[(0,S.jsxs)(`select`,{value:B,onChange:e=>V(e.target.value),className:`w-full bg-transparent border-none text-[11px] font-bold text-on-surface h-12 px-5 focus:outline-none appearance-none cursor-pointer`,children:[(0,S.jsx)(`option`,{value:``,className:`bg-surface-container-low text-on-surface uppercase`,children:`Unassigned Protocol Lead`}),D.map(e=>(0,S.jsx)(`option`,{value:e.id,className:`bg-surface-container-low text-on-surface font-bold uppercase tracking-tight`,children:e.name},e.id))]}),(0,S.jsx)(`div`,{className:`absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none text-on-surface-variant/60`,children:(0,S.jsx)(s,{size:14})})]}),(0,S.jsx)(`p`,{className:`px-1 text-[11px] text-on-surface-variant/70 italic leading-relaxed`,children:`*The Project Lead will oversee autonomous reasoning and token allocation for this project.`})]})]}),(0,S.jsxs)(`div`,{className:`px-8 py-10 rounded-3xl bg-surface-container-low/30 border border-dashed border-outline-variant/10 flex flex-col items-center justify-center text-center`,children:[(0,S.jsx)(`div`,{className:`w-12 h-12 rounded-full bg-surface-container-high flex items-center justify-center text-on-surface-variant/20 mb-4 animate-pulse`,children:(0,S.jsx)(f,{size:24})}),(0,S.jsx)(`p`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 max-w-[180px]`,children:`Statistical insight logs will be synchronized here`})]})]})]})]}):(0,S.jsxs)(`div`,{className:`p-8 text-center bg-surface-container-low rounded-3xl border border-outline-variant/10 max-w-lg mx-auto mt-20`,children:[(0,S.jsx)(`h2`,{className:`text-xl font-black text-white mb-4`,children:`Project Not Found`}),(0,S.jsx)(`button`,{onClick:()=>t(`/`),className:`bg-primary text-surface px-6 py-2 rounded-lg font-bold hover:scale-105 transition-all`,children:`Return to Hub`})]})};export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CfaHPvi0.js";import{i as n,n as r,t as i}from"./vendor-query-xpDrc4rM.js";import{r as a}from"./vendor-markdown-DoJbQ1of.js";import{i as o}from"./client-BGOBXkO8.js";import{t as s}from"./box-Bw_pyYzU.js";import{t as c}from"./chevron-right-G5-HRo_C.js";import{t as l}from"./clock-BY4rrypg.js";import{t as u}from"./cpu-8Sbc9Dk0.js";import{t as d}from"./database-D6O4hvbm.js";import{n as f,r as p,t as m}from"./providers-CNrSTcdc.js";import{t as h}from"./info-1jA6X-_e.js";import{t as g}from"./plus-Dx6G8SOZ.js";import{t as _}from"./rocket-CMSwBl_C.js";import{t as v}from"./server-CJE2K1Vt.js";import{t as y}from"./trash-2-DJpTXgEP.js";import{t as b}from"./ConfirmDialog-y3vTcqFR.js";import{t as x}from"./x-wDy15QMx.js";import{t as S}from"./zap-BmhZqgvm.js";import{n as C,t as w}from"./vendor-motion-CMGWJcqR.js";import{t as T}from"./useNotification-DQayTSUL.js";import{t as E}from"./cn-CWOQtFh4.js";var D=o(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),O=o(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),k=e(t(),1),A={all:[`providers`],models:e=>[`providers`,e,`models`]},j=()=>r({queryKey:A.all,queryFn:async()=>(await m.findAll()).data}),M=e=>r({queryKey:e?A.models(e):[`providers`,`unselected`,`models`],queryFn:async()=>{if(!e)return[];let t=await m.findModels(e);return Array.isArray(t.data)?t.data:[]},enabled:!!e}),N=e=>{let t=n(),{notifyApiError:r}=T();return i({mutationFn:async({providerName:e,models:t})=>{let n=(await m.create({name:e.trim()})).data,r=t.map(e=>e.trim()).filter(Boolean);return r.length>0&&await Promise.all(r.map(e=>f.create({name:e,providerId:n.id}))),n},onSuccess:async n=>{await Promise.all([t.invalidateQueries({queryKey:A.all}),t.invalidateQueries({queryKey:A.models(n.id)})]),e?.onSuccess?.(n)},onError:e=>{r(e,`Registration Failed`)}})},P=e=>{let t=n(),{notifyApiError:r}=T();return i({mutationFn:async({providerId:e,models:t})=>{let n=t.map(e=>e.trim()).filter(Boolean);await Promise.all(n.map(t=>f.create({name:t,providerId:e})))},onSuccess:async(n,r)=>{await t.invalidateQueries({queryKey:A.models(r.providerId)}),e?.onSuccess?.()},onError:e=>{r(e,`Registration Failed`)}})},F=e=>{let t=n(),{notifySuccess:r,notifyApiError:a}=T();return i({mutationFn:e=>f.delete(e),onSuccess:async()=>{await t.invalidateQueries({queryKey:A.models(e)}),r(`Model Removed`,`The model has been successfully deleted from the registry.`)},onError:e=>{a(e,`Cannot Delete Model`)}})},I=a(),L=({isOpen:e,onClose:t,onCreated:n,providerId:r,providerName:i})=>{let[a,o]=(0,k.useState)([``]),s=P({onSuccess:()=>{n(),o([``]),t()}});(0,k.useEffect)(()=>{let n=e=>{e.key===`Escape`&&!s.isPending&&t()};return e&&window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[s.isPending,e,t]);let c=(0,k.useMemo)(()=>a.some(e=>e.trim().length>0),[a]),l=a.length>1,d=()=>o(e=>[...e,``]),f=(e,t)=>{o(n=>{let r=[...n];return r[e]=t,r})},p=e=>{l&&o(t=>t.filter((t,n)=>n!==e))},m=()=>{s.isPending||t()};return(0,I.jsx)(C,{children:e&&(0,I.jsxs)(`div`,{className:`fixed inset-0 z-[70] flex items-center justify-center p-4 text-white`,children:[(0,I.jsx)(w.button,{type:`button`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:m,disabled:s.isPending,"aria-label":`Close create model modal`,className:`absolute inset-0 bg-background/80 backdrop-blur-md disabled:cursor-not-allowed`}),(0,I.jsxs)(w.div,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`create-model-title`,initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:`relative w-full max-w-lg bg-surface-container-low/90 backdrop-blur-2xl rounded-2xl shadow-[0_0_50px_-12px_rgba(78,222,163,0.1)] overflow-hidden border border-outline-variant/20`,children:[(0,I.jsxs)(`div`,{className:`px-8 pt-8 pb-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center`,children:(0,I.jsx)(u,{size:18,className:`text-primary`})}),(0,I.jsx)(`h2`,{id:`create-model-title`,className:`text-xl font-headline font-bold text-on-surface tracking-tight`,children:`Expand Provider Fleets`})]}),(0,I.jsx)(`button`,{type:`button`,onClick:m,disabled:s.isPending,"aria-label":`Close create model modal`,title:`Close`,className:`p-2 rounded-full hover:bg-white/5 transition-colors text-on-surface-variant/40 hover:text-white disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,I.jsx)(x,{size:18})})]}),(0,I.jsxs)(`p`,{className:`text-xs text-on-surface-variant font-medium opacity-60`,children:[`Registering new registry variants for `,(0,I.jsx)(`span`,{className:`text-primary font-bold`,children:i})]})]}),(0,I.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),!(!r||!c)&&await s.mutateAsync({providerId:r,models:a})},children:[(0,I.jsxs)(`div`,{className:`px-8 py-4 space-y-6`,children:[(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`label`,{className:`block text-[10px] font-black text-primary tracking-[0.2em] uppercase`,children:`Model Identifiers`}),(0,I.jsx)(`span`,{className:`text-[10px] text-on-surface-variant/40 italic font-medium`,children:`Batch register endpoints`})]}),(0,I.jsx)(`div`,{className:`space-y-3 max-h-[300px] overflow-y-auto pr-2 scrollbar-none custom-scrollbar`,children:a.map((e,t)=>(0,I.jsxs)(w.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:`flex gap-2 group`,children:[(0,I.jsx)(`div`,{className:`relative flex-1 bg-surface-container-lowest/50 rounded-xl p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all`,children:(0,I.jsx)(`input`,{autoFocus:t===a.length-1,type:`text`,value:e,onChange:e=>f(t,e.target.value),placeholder:`e.g., gpt-4o-2024-05-13`,disabled:s.isPending,className:`w-full bg-transparent border-none rounded-lg px-4 py-3 text-sm focus:outline-none text-white placeholder:text-on-surface-variant/20 disabled:opacity-60`,"aria-label":`Model identifier ${t+1}`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>p(t),disabled:!l||s.isPending,"aria-label":`Remove model identifier ${t+1}`,title:l?`Remove model identifier`:`At least one model input is kept visible`,className:E(`w-12 h-12 flex items-center justify-center transition-colors bg-surface-container-highest/10 rounded-xl`,l?`text-on-surface-variant/20 hover:text-error hover:bg-error/10`:`text-on-surface-variant/10 cursor-not-allowed opacity-50`,s.isPending&&`cursor-not-allowed opacity-50`),children:(0,I.jsx)(y,{size:18})})]},`${e}-${t}`))}),(0,I.jsxs)(`button`,{type:`button`,onClick:d,disabled:s.isPending,className:`w-full py-4 border-2 border-dashed border-primary/20 rounded-xl flex items-center justify-center gap-3 text-on-surface-variant/40 hover:border-primary/40 hover:text-primary transition-all group font-bold text-[10px] uppercase tracking-widest bg-primary/5 hover:bg-primary/10 disabled:opacity-50 disabled:cursor-not-allowed`,"aria-label":`Add model identifier`,children:[(0,I.jsx)(g,{size:16,className:`group-hover:scale-110 transition-transform`}),`Register New Target variant`]})]}),(0,I.jsxs)(`div`,{className:`bg-primary/5 p-5 rounded-2xl flex gap-4 border border-primary/5 transition-all group relative overflow-hidden`,children:[(0,I.jsx)(`div`,{className:`absolute top-0 right-0 w-24 h-24 bg-primary/5 blur-2xl rounded-full -mr-10 -mt-10 pointer-events-none`}),(0,I.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center shrink-0`,children:(0,I.jsx)(S,{size:18,className:`text-primary`})}),(0,I.jsxs)(`p`,{className:`text-[11px] text-on-surface-variant/80 leading-relaxed font-medium`,children:[`Batch models registered here will be synchronized with the`,` `,(0,I.jsx)(`span`,{className:`text-primary font-bold`,children:`Orchestrator Registry`}),` for global accessibility.`]})]})]}),(0,I.jsxs)(`div`,{className:`px-8 py-8 flex items-center justify-end gap-6 bg-gradient-to-t from-surface-container-lowest/50 to-transparent`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:m,disabled:s.isPending,className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/40 hover:text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,children:`Cancel`}),(0,I.jsx)(`button`,{type:`submit`,disabled:s.isPending||!c||!r,className:`bg-primary px-8 py-3.5 rounded-xl text-on-primary text-[10px] font-black uppercase tracking-[0.2em] shadow-lg shadow-primary/20 hover:scale-[1.05] active:scale-95 transition-all disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed flex items-center gap-2`,children:s.isPending?(0,I.jsx)(`span`,{className:`w-4 h-4 border-2 border-on-primary/30 border-t-on-primary rounded-full animate-spin`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(g,{size:16}),`Append Provider Fleets`]})})]})]}),(0,I.jsx)(`div`,{className:`absolute -bottom-16 -right-16 w-48 h-48 bg-primary/10 blur-[60px] rounded-full pointer-events-none`}),(0,I.jsx)(`div`,{className:`absolute top-0 right-0 w-32 h-1 bg-gradient-to-l from-secondary/40 to-transparent`})]})]})})},R=({isOpen:e,onClose:t,onCreated:n})=>{let{notifyError:r}=T(),[i,a]=(0,k.useState)(``),[o,c]=(0,k.useState)([``]),l=N({onSuccess:e=>{n?.(e.id),a(``),c([``]),t()}});(0,k.useEffect)(()=>{let n=e=>{e.key===`Escape`&&!l.isPending&&t()};return e&&window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,l.isPending]);let u=o.length>1,d=i.trim().length>0,f=(0,k.useMemo)(()=>o.filter(e=>e.trim().length>0).length,[o]),p=()=>c(e=>[...e,``]),m=(e,t)=>{c(n=>{let r=[...n];return r[e]=t,r})},v=e=>{u&&c(t=>t.filter((t,n)=>n!==e))},b=()=>{l.isPending||t()};return(0,I.jsx)(C,{children:e&&(0,I.jsxs)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center p-4`,children:[(0,I.jsx)(w.button,{type:`button`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:b,disabled:l.isPending,"aria-label":`Close register provider modal`,className:`absolute inset-0 bg-background/80 backdrop-blur-md disabled:cursor-not-allowed`}),(0,I.jsxs)(w.div,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`register-provider-title`,initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:`relative w-full max-w-lg bg-surface-container-low/90 backdrop-blur-2xl rounded-2xl shadow-[0_0_50px_-12px_rgba(173,198,255,0.2)] overflow-hidden border border-outline-variant/20`,children:[(0,I.jsxs)(`div`,{className:`px-8 pt-8 pb-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center`,children:(0,I.jsx)(s,{size:18,className:`text-primary`})}),(0,I.jsx)(`h2`,{id:`register-provider-title`,className:`text-xl font-headline font-bold text-on-surface tracking-tight`,children:`Register Provider`})]}),(0,I.jsx)(`button`,{type:`button`,onClick:b,disabled:l.isPending,"aria-label":`Close register provider modal`,title:`Close`,className:`p-2 rounded-full hover:bg-white/5 transition-colors text-on-surface-variant/40 hover:text-white disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,I.jsx)(x,{size:18})})]}),(0,I.jsx)(`p`,{className:`text-xs text-on-surface-variant font-medium opacity-60`,children:`Onboard a new computational gateway to your agentic ecosystem.`})]}),(0,I.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!d){r(`Validation Error`,`Please enter a provider name`);return}await l.mutateAsync({providerName:i,models:o})},children:[(0,I.jsxs)(`div`,{className:`px-8 py-4 space-y-6`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`label`,{className:`block text-[10px] font-black text-primary tracking-[0.2em] uppercase`,htmlFor:`provider-name-input`,children:`Provider Name`}),(0,I.jsx)(`div`,{className:`bg-surface-container-lowest/50 rounded-xl p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all`,children:(0,I.jsx)(`input`,{id:`provider-name-input`,type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g., OpenAI`,disabled:l.isPending,className:`w-full bg-transparent border-none rounded-lg px-4 py-3 text-sm focus:outline-none text-white placeholder:text-on-surface-variant/20 disabled:opacity-60`})})]}),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`label`,{className:`block text-[10px] font-black text-primary tracking-[0.2em] uppercase`,children:`Model Variants`}),(0,I.jsx)(`span`,{className:`text-[10px] text-on-surface-variant/40 italic font-medium`,children:f>0?`${f} pending`:`Define available endpoints`})]}),(0,I.jsx)(`div`,{className:`space-y-3 max-h-[200px] overflow-y-auto pr-2 scrollbar-hide`,children:o.map((e,t)=>(0,I.jsxs)(w.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:`flex gap-2 group`,children:[(0,I.jsx)(`div`,{className:`relative flex-1 bg-surface-container-lowest/50 rounded-xl p-0.5 ring-1 ring-outline-variant/5 focus-within:ring-secondary/40 transition-all`,children:(0,I.jsx)(`input`,{type:`text`,value:e,onChange:e=>m(t,e.target.value),placeholder:`gpt-4o`,disabled:l.isPending,className:`w-full bg-transparent border-none rounded-lg px-4 py-2.5 text-xs text-white focus:outline-none placeholder:text-on-surface-variant/20 disabled:opacity-60`,"aria-label":`Model variant ${t+1}`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>v(t),disabled:!u||l.isPending,"aria-label":`Remove model variant ${t+1}`,title:u?`Remove model variant`:`At least one model input is kept visible`,className:E(`w-10 h-10 flex items-center justify-center transition-colors bg-surface-container-highest/10 rounded-xl`,u?`text-on-surface-variant/20 hover:text-error hover:bg-error/10`:`text-on-surface-variant/10 cursor-not-allowed opacity-50`,l.isPending&&`cursor-not-allowed opacity-50`),children:(0,I.jsx)(y,{size:16})})]},`${e}-${t}`))}),(0,I.jsxs)(`button`,{type:`button`,onClick:p,disabled:l.isPending,className:`w-full py-3 border-2 border-dashed border-outline-variant/10 rounded-xl flex items-center justify-center gap-2 text-on-surface-variant/40 hover:border-primary/40 hover:text-primary transition-all group font-bold text-[10px] uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed`,"aria-label":`Add model variant`,children:[(0,I.jsx)(g,{size:14,className:`group-hover:scale-110 transition-transform`}),`Add model variant`]})]}),(0,I.jsxs)(`div`,{className:`bg-tertiary-container/10 p-5 rounded-2xl flex gap-4 border border-tertiary/5 relative overflow-hidden group`,children:[(0,I.jsx)(`div`,{className:`absolute top-0 right-0 w-24 h-24 bg-tertiary/5 blur-2xl rounded-full -mr-10 -mt-10`}),(0,I.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-tertiary/10 flex items-center justify-center shrink-0`,children:(0,I.jsx)(h,{size:18,className:`text-tertiary`})}),(0,I.jsxs)(`p`,{className:`text-[11px] text-on-surface-variant/80 leading-relaxed font-medium`,children:[`Once registered, these models will be available in the`,` `,(0,I.jsx)(`span`,{className:`text-tertiary font-bold`,children:`Orchestration Canvas`}),` for node deployment and agent personality mapping.`]})]})]}),(0,I.jsxs)(`div`,{className:`px-8 py-8 flex items-center justify-end gap-6 bg-gradient-to-t from-surface-container-lowest/50 to-transparent`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:b,disabled:l.isPending,className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/40 hover:text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,children:`Cancel`}),(0,I.jsx)(`button`,{type:`submit`,disabled:l.isPending||!d,className:`bg-primary px-8 py-3 rounded-xl text-on-primary text-[10px] font-black uppercase tracking-[0.2em] shadow-lg shadow-primary/20 hover:scale-[1.05] active:scale-95 transition-all disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed flex items-center gap-2`,children:l.isPending?(0,I.jsx)(`span`,{className:`w-3 h-3 border-2 border-on-primary/30 border-t-on-primary rounded-full animate-spin`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(_,{size:14}),`Register Provider`]})})]})]}),(0,I.jsx)(`div`,{className:`absolute -bottom-16 -left-16 w-48 h-48 bg-primary/10 blur-[60px] rounded-full pointer-events-none`}),(0,I.jsx)(`div`,{className:`absolute top-0 right-0 w-32 h-1 bg-gradient-to-l from-secondary/40 to-transparent`})]})]})})},z=({model:e,onDelete:t})=>{let[n,r]=(0,k.useState)(!1),i=(0,k.useRef)(null);return(0,k.useEffect)(()=>{let e=e=>{i.current&&!i.current.contains(e.target)&&r(!1)};return n&&document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]),(0,I.jsxs)(`div`,{ref:i,className:`relative inline-block`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-label":`Actions for model ${e.name}`,title:`Actions for model ${e.name}`,className:`text-on-surface-variant/40 hover:text-white transition-colors p-1 rounded`,children:(0,I.jsx)(p,{size:14})}),n&&(0,I.jsx)(`div`,{className:`absolute right-0 bottom-full mb-1 z-50 w-36 bg-surface-container-high rounded-xl shadow-2xl ring-1 ring-outline-variant/10 overflow-hidden animate-in fade-in zoom-in-95 duration-150`,children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>{r(!1),t(e)},className:`w-full px-4 py-3 text-left text-xs font-bold text-error hover:bg-error/10 transition-colors flex items-center gap-2`,"aria-label":`Remove model ${e.name}`,children:[(0,I.jsx)(y,{size:12}),`Remove`]})})]})},B=({provider:e,models:t,isLoadingModels:n,isRefreshing:r,onRefresh:i,onOpenCreateModel:a,onDeleteModel:o})=>e?(0,I.jsxs)(`div`,{className:`bg-surface-container-low rounded-3xl overflow-hidden ring-1 ring-outline-variant/10 shadow-2xl animate-in fade-in zoom-in-95 duration-500`,children:[(0,I.jsxs)(`div`,{className:`p-10 relative overflow-hidden`,children:[(0,I.jsx)(`div`,{className:`absolute top-0 right-0 w-[500px] h-full bg-gradient-to-l from-primary/5 to-transparent pointer-events-none`}),(0,I.jsxs)(`div`,{className:`flex flex-col md:flex-row items-start justify-between gap-8 relative z-10`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,I.jsx)(`div`,{className:`w-20 h-20 bg-surface rounded-2xl flex items-center justify-center ring-1 ring-primary/20 shadow-inner group transition-all duration-500 hover:ring-primary/40`,children:(0,I.jsx)(D,{size:40,className:`text-primary group-hover:scale-110 transition-transform`})}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`h2`,{className:`text-3xl font-headline font-black text-white tracking-tight`,children:e.name}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsx)(`span`,{className:`px-2.5 py-0.5 bg-secondary/10 text-secondary text-[9px] font-black uppercase tracking-widest rounded ring-1 ring-secondary/20 font-headline`,children:`Primary`})})]}),(0,I.jsx)(`p`,{className:`text-on-surface-variant/60 text-sm mt-2`,children:e.description||`Infrastructure gateway for agentic cognition & reasoning.`})]})]}),(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:i,disabled:r,"aria-label":`Refresh ${e.name} data`,title:`Refresh ${e.name} data`,className:`p-2.5 rounded-xl bg-surface-container-high text-on-surface-variant hover:text-white hover:bg-surface-container-highest transition-all ring-1 ring-outline-variant/10 disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,I.jsx)(O,{size:18,className:E(r&&`animate-spin`)})}),(0,I.jsx)(`button`,{type:`button`,disabled:!0,"aria-label":`More provider actions unavailable`,title:`More provider actions unavailable`,className:`p-2.5 rounded-xl bg-surface-container-high text-on-surface-variant/40 transition-all ring-1 ring-outline-variant/10 disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,I.jsx)(p,{size:18})})]})]})]}),(0,I.jsxs)(`div`,{className:`p-10 border-t border-outline-variant/5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-8`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`h3`,{className:`font-headline font-black text-lg text-white`,children:`Registered Models`}),(0,I.jsxs)(`span`,{className:`px-2 py-0.5 rounded bg-surface-container-high text-[10px] font-bold text-on-surface-variant`,children:[t.length,` Models`]})]}),(0,I.jsxs)(`button`,{type:`button`,onClick:a,disabled:!e.id,className:`text-[10px] font-black uppercase tracking-widest text-primary hover:text-primary/70 transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed`,"aria-label":`Register models for ${e.name}`,children:[(0,I.jsx)(`div`,{className:`w-5 h-5 rounded-full bg-primary/10 flex items-center justify-center`,children:(0,I.jsx)(g,{size:12})}),`Register New Model`]})]}),(0,I.jsx)(`div`,{className:`rounded-2xl border border-outline-variant/5 overflow-visible`,children:(0,I.jsxs)(`table`,{className:`w-full text-left text-xs border-collapse`,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{className:`bg-surface-container-high/30 text-on-surface-variant/40 font-black uppercase tracking-[0.2em]`,children:[(0,I.jsx)(`th`,{className:`py-5 px-6`,children:`Model ID`}),(0,I.jsx)(`th`,{className:`py-5 px-6 text-right`,children:`Status`}),(0,I.jsx)(`th`,{className:`py-5 px-6 w-12 text-center`,children:`Action`})]})}),(0,I.jsx)(`tbody`,{className:`divide-y divide-outline-variant/5`,children:n?(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{colSpan:3,className:`py-20 text-center`,children:(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center space-y-4 opacity-40`,children:[(0,I.jsx)(`div`,{className:`w-8 h-8 border-2 border-primary/20 border-t-primary rounded-full animate-spin`}),(0,I.jsx)(`p`,{className:`text-[10px] uppercase font-black tracking-widest text-primary animate-pulse`,children:`Hydrating Model Registry...`})]})})}):t.length>0?t.map(e=>(0,I.jsxs)(`tr`,{className:`group hover:bg-primary/5 transition-all`,children:[(0,I.jsx)(`td`,{className:`py-5 px-6 font-mono text-on-surface font-medium`,children:e.name}),(0,I.jsx)(`td`,{className:`py-5 px-6 text-right`,children:(0,I.jsx)(`span`,{className:`inline-flex items-center px-2 py-1 rounded font-black text-[8px] uppercase tracking-widest bg-secondary/10 text-secondary`,children:`Active`})}),(0,I.jsx)(`td`,{className:`py-5 px-6 text-center`,children:(0,I.jsx)(z,{model:e,onDelete:o})})]},e.id)):(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{colSpan:3,className:`py-12 text-center text-on-surface-variant/20 italic font-medium`,children:`No models registered for this provider gate.`})})})]})})]}),(0,I.jsxs)(`div`,{className:`ui-helper-text p-8 border-t border-outline-variant/5 bg-surface-container-lowest/20 flex items-center gap-3`,children:[(0,I.jsx)(l,{size:14,className:`text-tertiary`}),`Model registry updates propagate automatically after provider and model changes.`]})]}):(0,I.jsxs)(`div`,{className:`h-[600px] bg-surface-container-low/50 rounded-3xl border border-dashed border-outline-variant/10 flex flex-col items-center justify-center text-on-surface-variant gap-4 opacity-40`,children:[(0,I.jsx)(`div`,{className:`w-20 h-20 rounded-2xl bg-surface-container flex items-center justify-center shadow-inner`,children:(0,I.jsx)(D,{size:40,className:`text-primary/50`})}),(0,I.jsxs)(`div`,{className:`text-center`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-headline font-black text-white uppercase tracking-widest mb-1`,children:`Infrastructure Hub`}),(0,I.jsx)(`p`,{className:`text-[10px] font-medium opacity-60`,children:`Select a provider on the left to view active node details.`})]})]}),V=({providers:e,selectedProviderId:t,selectedProviderModelCount:n,isLoading:r,onSelect:i})=>r&&e.length===0?(0,I.jsx)(`div`,{className:`space-y-3`,"aria-live":`polite`,children:Array.from({length:3}).map((e,t)=>(0,I.jsx)(`div`,{className:`h-28 rounded-2xl border border-outline-variant/10 bg-surface-container-low animate-pulse`},t))}):e.length===0?(0,I.jsxs)(`div`,{className:`p-8 border-2 border-dashed border-outline-variant/10 rounded-2xl flex flex-col items-center justify-center text-center opacity-40`,children:[(0,I.jsx)(v,{size:24,className:`mb-4`}),(0,I.jsxs)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest leading-relaxed`,children:[`No providers registered yet.`,(0,I.jsx)(`br`,{}),`Establish logical gateways in the infrastructure hub.`]})]}):(0,I.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>{let r=t===e.id,a=r?`${n} Models Active`:`Select to inspect`;return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:E(`w-full p-5 rounded-2xl border text-left transition-all duration-300 group`,r?`bg-surface-container-high border-secondary/20 shadow-lg shadow-secondary/5 ring-1 ring-secondary/10 text-white`:`bg-surface-container-low border-transparent hover:bg-surface-container-high/50 text-on-surface-variant`),"aria-pressed":r,"aria-label":`Select provider ${e.name}`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,I.jsx)(`div`,{className:E(`w-10 h-10 rounded-xl bg-surface-container-highest flex items-center justify-center transition-colors`,r?`text-primary`:`text-on-surface-variant`),children:(0,I.jsx)(d,{size:20})}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:E(`font-bold text-sm block transition-colors`,r?`text-white`:`group-hover:text-white`),children:e.name}),(0,I.jsx)(`span`,{className:`text-[9px] font-bold text-on-surface-variant/40 uppercase tracking-widest leading-none mt-1 block`,children:a})]})]}),(0,I.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-secondary animate-pulse shadow-[0_0_10px_rgba(78,222,163,0.5)]`})]}),(0,I.jsx)(`div`,{className:`flex justify-start`,children:(0,I.jsx)(`span`,{className:`text-[9px] font-black uppercase tracking-widest text-secondary`,children:`Healthy`})})]},e.id)})}),H=()=>{let[e,t]=(0,k.useState)(!1),[n,r]=(0,k.useState)(!1),[i,a]=(0,k.useState)(null),[o,s]=(0,k.useState)(null),{data:c=[],isPending:l,isFetching:u,refetch:d}=j(),f=c.find(e=>e.id===i)?.id??c[0]?.id??null,p=M(f),m=(0,k.useMemo)(()=>c.find(e=>e.id===f)??null,[c,f]),{mutate:h,isPending:g}=F(f??``),_=(0,k.useCallback)(async()=>{await Promise.all([d(),f?p.refetch():Promise.resolve(void 0)])},[p,d,f]);return{providers:c,selectedProvider:m,selectedProviderId:f,setSelectedProviderId:a,models:p.data??[],isLoadingProviders:l,isFetchingProviders:u,isLoadingModels:p.isPending||p.isFetching,isRegisterProviderModalOpen:e,setIsRegisterProviderModalOpen:t,isCreateModelModalOpen:n,setIsCreateModelModalOpen:r,refreshProviders:_,modelPendingDelete:o,setModelPendingDelete:s,deleteModel:h,isDeletingModel:g}},U=()=>{let{providers:e,selectedProvider:t,selectedProviderId:n,setSelectedProviderId:r,models:i,isLoadingProviders:a,isFetchingProviders:o,isLoadingModels:s,isRegisterProviderModalOpen:l,setIsRegisterProviderModalOpen:u,isCreateModelModalOpen:d,setIsCreateModelModalOpen:f,refreshProviders:p,modelPendingDelete:m,setModelPendingDelete:h,deleteModel:_,isDeletingModel:y}=H();return(0,I.jsxs)(`div`,{className:`space-y-10 animate-in fade-in slide-in-from-bottom-4 duration-700`,children:[(0,I.jsx)(`header`,{children:(0,I.jsxs)(`div`,{className:`flex flex-col md:flex-row md:items-end justify-between gap-6`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`nav`,{className:`flex items-center gap-2 mb-2 text-[10px] uppercase tracking-widest text-primary font-bold`,children:[(0,I.jsx)(`span`,{className:`opacity-60`,children:`Infrastructure`}),(0,I.jsx)(c,{size:12,className:`opacity-40`}),(0,I.jsx)(`span`,{children:`Model Providers`})]}),(0,I.jsx)(`h1`,{className:`text-4xl font-extrabold font-headline tracking-tighter text-white`,children:`Provider Core`}),(0,I.jsx)(`p`,{className:`text-on-surface-variant text-sm mt-1`,children:`Manage global LLM integrations and endpoint health.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>{p()},disabled:o,className:`px-5 py-2.5 bg-surface-container-high text-on-surface rounded-lg text-xs font-bold uppercase tracking-widest hover:bg-surface-container-highest transition-all ring-1 ring-outline-variant/10 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed`,"aria-label":`Refresh provider status`,children:[(0,I.jsx)(O,{size:14,className:E(o&&`animate-spin`)}),o?`Refreshing...`:`Refresh Status`]}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>u(!0),className:`px-6 py-2.5 bg-primary text-on-primary rounded-lg text-xs font-bold uppercase tracking-widest shadow-lg shadow-primary/20 hover:scale-[1.02] active:scale-[0.98] transition-all flex items-center gap-2`,"aria-label":`Open register provider modal`,children:[(0,I.jsx)(g,{size:16}),`Register Provider`]})]})]})}),(0,I.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-8`,children:[(0,I.jsxs)(`div`,{className:`lg:col-span-4 space-y-5`,children:[(0,I.jsxs)(`h2`,{className:`text-[10px] font-black uppercase tracking-[0.3em] text-on-surface-variant/40 flex items-center gap-3`,children:[(0,I.jsx)(v,{size:14,className:`text-primary`}),` Active Providers`]}),(0,I.jsx)(V,{providers:e,selectedProviderId:n,selectedProviderModelCount:n===t?.id?i.length:0,isLoading:a,onSelect:r})]}),(0,I.jsx)(`div`,{className:`lg:col-span-8 space-y-8`,children:(0,I.jsx)(B,{provider:t,models:i,isLoadingModels:s,isRefreshing:o,onRefresh:()=>{p()},onOpenCreateModel:()=>f(!0),onDeleteModel:h})})]}),(0,I.jsx)(R,{isOpen:l,onClose:()=>u(!1),onCreated:e=>{r(e),u(!1)}}),(0,I.jsx)(L,{isOpen:d,onClose:()=>f(!1),onCreated:()=>f(!1),providerId:t?.id??``,providerName:t?.name??``}),(0,I.jsx)(b,{isOpen:m!==null,onClose:()=>h(null),onConfirm:()=>{m&&_(m.id,{onSettled:()=>h(null)})},title:`Remove Model`,message:`Are you sure you want to remove "${m?.name??``}"? This action cannot be undone.`,confirmText:`Remove`,cancelText:`Cancel`,variant:`danger`,loading:y})]})};export{U as default};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CfaHPvi0.js";import{i as n,n as r,t as i}from"./vendor-query-xpDrc4rM.js";import{r as a}from"./vendor-markdown-DoJbQ1of.js";import{i as o}from"./client-B553SX3l.js";import{t as s}from"./box-CFDcDxHv.js";import{t as c}from"./chevron-right-Bm_d1KKk.js";import{t as l}from"./clock-CSNFJjo4.js";import{t as u}from"./cpu-C2_GFeSH.js";import{t as d}from"./database-zXW48-_N.js";import{n as f,r as p,t as m}from"./providers-AawjMy3x.js";import{t as h}from"./info-DGHChFI6.js";import{t as g}from"./plus-CkteVqhM.js";import{t as _}from"./rocket-B9Iexkcw.js";import{t as v}from"./server-BBmM-vrg.js";import{t as y}from"./trash-2-CphQfk35.js";import{t as b}from"./ConfirmDialog-BltdtevE.js";import{t as x}from"./x-CCZGYGDC.js";import{t as S}from"./zap-BDAytXMX.js";import{n as C,t as w}from"./vendor-motion-CMGWJcqR.js";import{t as T}from"./useNotification-DQayTSUL.js";import{t as E}from"./cn-CWOQtFh4.js";var D=o(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),O=o(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),k=e(t(),1),A={all:[`providers`],models:e=>[`providers`,e,`models`]},j=()=>r({queryKey:A.all,queryFn:async()=>(await m.findAll()).data}),M=e=>r({queryKey:e?A.models(e):[`providers`,`unselected`,`models`],queryFn:async()=>{if(!e)return[];let t=await m.findModels(e);return Array.isArray(t.data)?t.data:[]},enabled:!!e}),N=e=>{let t=n(),{notifyApiError:r}=T();return i({mutationFn:async({providerName:e,models:t})=>{let n=(await m.create({name:e.trim()})).data,r=t.map(e=>e.trim()).filter(Boolean);return r.length>0&&await Promise.all(r.map(e=>f.create({name:e,providerId:n.id}))),n},onSuccess:async n=>{await Promise.all([t.invalidateQueries({queryKey:A.all}),t.invalidateQueries({queryKey:A.models(n.id)})]),e?.onSuccess?.(n)},onError:e=>{r(e,`Registration Failed`)}})},P=e=>{let t=n(),{notifyApiError:r}=T();return i({mutationFn:async({providerId:e,models:t})=>{let n=t.map(e=>e.trim()).filter(Boolean);await Promise.all(n.map(t=>f.create({name:t,providerId:e})))},onSuccess:async(n,r)=>{await t.invalidateQueries({queryKey:A.models(r.providerId)}),e?.onSuccess?.()},onError:e=>{r(e,`Registration Failed`)}})},F=e=>{let t=n(),{notifySuccess:r,notifyApiError:a}=T();return i({mutationFn:e=>f.delete(e),onSuccess:async()=>{await t.invalidateQueries({queryKey:A.models(e)}),r(`Model Removed`,`The model has been successfully deleted from the registry.`)},onError:e=>{a(e,`Cannot Delete Model`)}})},I=a(),L=({isOpen:e,onClose:t,onCreated:n,providerId:r,providerName:i})=>{let[a,o]=(0,k.useState)([``]),s=P({onSuccess:()=>{n(),o([``]),t()}});(0,k.useEffect)(()=>{let n=e=>{e.key===`Escape`&&!s.isPending&&t()};return e&&window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[s.isPending,e,t]);let c=(0,k.useMemo)(()=>a.some(e=>e.trim().length>0),[a]),l=a.length>1,d=()=>o(e=>[...e,``]),f=(e,t)=>{o(n=>{let r=[...n];return r[e]=t,r})},p=e=>{l&&o(t=>t.filter((t,n)=>n!==e))},m=()=>{s.isPending||t()};return(0,I.jsx)(C,{children:e&&(0,I.jsxs)(`div`,{className:`fixed inset-0 z-[70] flex items-center justify-center p-4 text-white`,children:[(0,I.jsx)(w.button,{type:`button`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:m,disabled:s.isPending,"aria-label":`Close create model modal`,className:`absolute inset-0 bg-background/80 backdrop-blur-md disabled:cursor-not-allowed`}),(0,I.jsxs)(w.div,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`create-model-title`,initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:`relative w-full max-w-lg bg-surface-container-low/90 backdrop-blur-2xl rounded-2xl shadow-[0_0_50px_-12px_rgba(78,222,163,0.1)] overflow-hidden border border-outline-variant/20`,children:[(0,I.jsxs)(`div`,{className:`px-8 pt-8 pb-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center`,children:(0,I.jsx)(u,{size:18,className:`text-primary`})}),(0,I.jsx)(`h2`,{id:`create-model-title`,className:`text-xl font-headline font-bold text-on-surface tracking-tight`,children:`Expand Provider Fleets`})]}),(0,I.jsx)(`button`,{type:`button`,onClick:m,disabled:s.isPending,"aria-label":`Close create model modal`,title:`Close`,className:`p-2 rounded-full hover:bg-white/5 transition-colors text-on-surface-variant/40 hover:text-white disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,I.jsx)(x,{size:18})})]}),(0,I.jsxs)(`p`,{className:`text-xs text-on-surface-variant font-medium opacity-60`,children:[`Registering new registry variants for `,(0,I.jsx)(`span`,{className:`text-primary font-bold`,children:i})]})]}),(0,I.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),!(!r||!c)&&await s.mutateAsync({providerId:r,models:a})},children:[(0,I.jsxs)(`div`,{className:`px-8 py-4 space-y-6`,children:[(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`label`,{className:`block text-[10px] font-black text-primary tracking-[0.2em] uppercase`,children:`Model Identifiers`}),(0,I.jsx)(`span`,{className:`text-[10px] text-on-surface-variant/40 italic font-medium`,children:`Batch register endpoints`})]}),(0,I.jsx)(`div`,{className:`space-y-3 max-h-[300px] overflow-y-auto pr-2 scrollbar-none custom-scrollbar`,children:a.map((e,t)=>(0,I.jsxs)(w.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:`flex gap-2 group`,children:[(0,I.jsx)(`div`,{className:`relative flex-1 bg-surface-container-lowest/50 rounded-xl p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all`,children:(0,I.jsx)(`input`,{autoFocus:t===a.length-1,type:`text`,value:e,onChange:e=>f(t,e.target.value),placeholder:`e.g., gpt-4o-2024-05-13`,disabled:s.isPending,className:`w-full bg-transparent border-none rounded-lg px-4 py-3 text-sm focus:outline-none text-white placeholder:text-on-surface-variant/20 disabled:opacity-60`,"aria-label":`Model identifier ${t+1}`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>p(t),disabled:!l||s.isPending,"aria-label":`Remove model identifier ${t+1}`,title:l?`Remove model identifier`:`At least one model input is kept visible`,className:E(`w-12 h-12 flex items-center justify-center transition-colors bg-surface-container-highest/10 rounded-xl`,l?`text-on-surface-variant/20 hover:text-error hover:bg-error/10`:`text-on-surface-variant/10 cursor-not-allowed opacity-50`,s.isPending&&`cursor-not-allowed opacity-50`),children:(0,I.jsx)(y,{size:18})})]},`${e}-${t}`))}),(0,I.jsxs)(`button`,{type:`button`,onClick:d,disabled:s.isPending,className:`w-full py-4 border-2 border-dashed border-primary/20 rounded-xl flex items-center justify-center gap-3 text-on-surface-variant/40 hover:border-primary/40 hover:text-primary transition-all group font-bold text-[10px] uppercase tracking-widest bg-primary/5 hover:bg-primary/10 disabled:opacity-50 disabled:cursor-not-allowed`,"aria-label":`Add model identifier`,children:[(0,I.jsx)(g,{size:16,className:`group-hover:scale-110 transition-transform`}),`Register New Target variant`]})]}),(0,I.jsxs)(`div`,{className:`bg-primary/5 p-5 rounded-2xl flex gap-4 border border-primary/5 transition-all group relative overflow-hidden`,children:[(0,I.jsx)(`div`,{className:`absolute top-0 right-0 w-24 h-24 bg-primary/5 blur-2xl rounded-full -mr-10 -mt-10 pointer-events-none`}),(0,I.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center shrink-0`,children:(0,I.jsx)(S,{size:18,className:`text-primary`})}),(0,I.jsxs)(`p`,{className:`text-[11px] text-on-surface-variant/80 leading-relaxed font-medium`,children:[`Batch models registered here will be synchronized with the`,` `,(0,I.jsx)(`span`,{className:`text-primary font-bold`,children:`Orchestrator Registry`}),` for global accessibility.`]})]})]}),(0,I.jsxs)(`div`,{className:`px-8 py-8 flex items-center justify-end gap-6 bg-gradient-to-t from-surface-container-lowest/50 to-transparent`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:m,disabled:s.isPending,className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/40 hover:text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,children:`Cancel`}),(0,I.jsx)(`button`,{type:`submit`,disabled:s.isPending||!c||!r,className:`bg-primary px-8 py-3.5 rounded-xl text-on-primary text-[10px] font-black uppercase tracking-[0.2em] shadow-lg shadow-primary/20 hover:scale-[1.05] active:scale-95 transition-all disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed flex items-center gap-2`,children:s.isPending?(0,I.jsx)(`span`,{className:`w-4 h-4 border-2 border-on-primary/30 border-t-on-primary rounded-full animate-spin`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(g,{size:16}),`Append Provider Fleets`]})})]})]}),(0,I.jsx)(`div`,{className:`absolute -bottom-16 -right-16 w-48 h-48 bg-primary/10 blur-[60px] rounded-full pointer-events-none`}),(0,I.jsx)(`div`,{className:`absolute top-0 right-0 w-32 h-1 bg-gradient-to-l from-secondary/40 to-transparent`})]})]})})},R=({isOpen:e,onClose:t,onCreated:n})=>{let{notifyError:r}=T(),[i,a]=(0,k.useState)(``),[o,c]=(0,k.useState)([``]),l=N({onSuccess:e=>{n?.(e.id),a(``),c([``]),t()}});(0,k.useEffect)(()=>{let n=e=>{e.key===`Escape`&&!l.isPending&&t()};return e&&window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,l.isPending]);let u=o.length>1,d=i.trim().length>0,f=(0,k.useMemo)(()=>o.filter(e=>e.trim().length>0).length,[o]),p=()=>c(e=>[...e,``]),m=(e,t)=>{c(n=>{let r=[...n];return r[e]=t,r})},v=e=>{u&&c(t=>t.filter((t,n)=>n!==e))},b=()=>{l.isPending||t()};return(0,I.jsx)(C,{children:e&&(0,I.jsxs)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center p-4`,children:[(0,I.jsx)(w.button,{type:`button`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:b,disabled:l.isPending,"aria-label":`Close register provider modal`,className:`absolute inset-0 bg-background/80 backdrop-blur-md disabled:cursor-not-allowed`}),(0,I.jsxs)(w.div,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`register-provider-title`,initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:`relative w-full max-w-lg bg-surface-container-low/90 backdrop-blur-2xl rounded-2xl shadow-[0_0_50px_-12px_rgba(173,198,255,0.2)] overflow-hidden border border-outline-variant/20`,children:[(0,I.jsxs)(`div`,{className:`px-8 pt-8 pb-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center`,children:(0,I.jsx)(s,{size:18,className:`text-primary`})}),(0,I.jsx)(`h2`,{id:`register-provider-title`,className:`text-xl font-headline font-bold text-on-surface tracking-tight`,children:`Register Provider`})]}),(0,I.jsx)(`button`,{type:`button`,onClick:b,disabled:l.isPending,"aria-label":`Close register provider modal`,title:`Close`,className:`p-2 rounded-full hover:bg-white/5 transition-colors text-on-surface-variant/40 hover:text-white disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,I.jsx)(x,{size:18})})]}),(0,I.jsx)(`p`,{className:`text-xs text-on-surface-variant font-medium opacity-60`,children:`Onboard a new computational gateway to your agentic ecosystem.`})]}),(0,I.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!d){r(`Validation Error`,`Please enter a provider name`);return}await l.mutateAsync({providerName:i,models:o})},children:[(0,I.jsxs)(`div`,{className:`px-8 py-4 space-y-6`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`label`,{className:`block text-[10px] font-black text-primary tracking-[0.2em] uppercase`,htmlFor:`provider-name-input`,children:`Provider Name`}),(0,I.jsx)(`div`,{className:`bg-surface-container-lowest/50 rounded-xl p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all`,children:(0,I.jsx)(`input`,{id:`provider-name-input`,type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g., OpenAI`,disabled:l.isPending,className:`w-full bg-transparent border-none rounded-lg px-4 py-3 text-sm focus:outline-none text-white placeholder:text-on-surface-variant/20 disabled:opacity-60`})})]}),(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`label`,{className:`block text-[10px] font-black text-primary tracking-[0.2em] uppercase`,children:`Model Variants`}),(0,I.jsx)(`span`,{className:`text-[10px] text-on-surface-variant/40 italic font-medium`,children:f>0?`${f} pending`:`Define available endpoints`})]}),(0,I.jsx)(`div`,{className:`space-y-3 max-h-[200px] overflow-y-auto pr-2 scrollbar-hide`,children:o.map((e,t)=>(0,I.jsxs)(w.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:`flex gap-2 group`,children:[(0,I.jsx)(`div`,{className:`relative flex-1 bg-surface-container-lowest/50 rounded-xl p-0.5 ring-1 ring-outline-variant/5 focus-within:ring-secondary/40 transition-all`,children:(0,I.jsx)(`input`,{type:`text`,value:e,onChange:e=>m(t,e.target.value),placeholder:`gpt-4o`,disabled:l.isPending,className:`w-full bg-transparent border-none rounded-lg px-4 py-2.5 text-xs text-white focus:outline-none placeholder:text-on-surface-variant/20 disabled:opacity-60`,"aria-label":`Model variant ${t+1}`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>v(t),disabled:!u||l.isPending,"aria-label":`Remove model variant ${t+1}`,title:u?`Remove model variant`:`At least one model input is kept visible`,className:E(`w-10 h-10 flex items-center justify-center transition-colors bg-surface-container-highest/10 rounded-xl`,u?`text-on-surface-variant/20 hover:text-error hover:bg-error/10`:`text-on-surface-variant/10 cursor-not-allowed opacity-50`,l.isPending&&`cursor-not-allowed opacity-50`),children:(0,I.jsx)(y,{size:16})})]},`${e}-${t}`))}),(0,I.jsxs)(`button`,{type:`button`,onClick:p,disabled:l.isPending,className:`w-full py-3 border-2 border-dashed border-outline-variant/10 rounded-xl flex items-center justify-center gap-2 text-on-surface-variant/40 hover:border-primary/40 hover:text-primary transition-all group font-bold text-[10px] uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed`,"aria-label":`Add model variant`,children:[(0,I.jsx)(g,{size:14,className:`group-hover:scale-110 transition-transform`}),`Add model variant`]})]}),(0,I.jsxs)(`div`,{className:`bg-tertiary-container/10 p-5 rounded-2xl flex gap-4 border border-tertiary/5 relative overflow-hidden group`,children:[(0,I.jsx)(`div`,{className:`absolute top-0 right-0 w-24 h-24 bg-tertiary/5 blur-2xl rounded-full -mr-10 -mt-10`}),(0,I.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-tertiary/10 flex items-center justify-center shrink-0`,children:(0,I.jsx)(h,{size:18,className:`text-tertiary`})}),(0,I.jsxs)(`p`,{className:`text-[11px] text-on-surface-variant/80 leading-relaxed font-medium`,children:[`Once registered, these models will be available in the`,` `,(0,I.jsx)(`span`,{className:`text-tertiary font-bold`,children:`Orchestration Canvas`}),` for node deployment and agent personality mapping.`]})]})]}),(0,I.jsxs)(`div`,{className:`px-8 py-8 flex items-center justify-end gap-6 bg-gradient-to-t from-surface-container-lowest/50 to-transparent`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:b,disabled:l.isPending,className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/40 hover:text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,children:`Cancel`}),(0,I.jsx)(`button`,{type:`submit`,disabled:l.isPending||!d,className:`bg-primary px-8 py-3 rounded-xl text-on-primary text-[10px] font-black uppercase tracking-[0.2em] shadow-lg shadow-primary/20 hover:scale-[1.05] active:scale-95 transition-all disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed flex items-center gap-2`,children:l.isPending?(0,I.jsx)(`span`,{className:`w-3 h-3 border-2 border-on-primary/30 border-t-on-primary rounded-full animate-spin`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(_,{size:14}),`Register Provider`]})})]})]}),(0,I.jsx)(`div`,{className:`absolute -bottom-16 -left-16 w-48 h-48 bg-primary/10 blur-[60px] rounded-full pointer-events-none`}),(0,I.jsx)(`div`,{className:`absolute top-0 right-0 w-32 h-1 bg-gradient-to-l from-secondary/40 to-transparent`})]})]})})},z=({model:e,onDelete:t})=>{let[n,r]=(0,k.useState)(!1),i=(0,k.useRef)(null);return(0,k.useEffect)(()=>{let e=e=>{i.current&&!i.current.contains(e.target)&&r(!1)};return n&&document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]),(0,I.jsxs)(`div`,{ref:i,className:`relative inline-block`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-label":`Actions for model ${e.name}`,title:`Actions for model ${e.name}`,className:`text-on-surface-variant/40 hover:text-white transition-colors p-1 rounded`,children:(0,I.jsx)(p,{size:14})}),n&&(0,I.jsx)(`div`,{className:`absolute right-0 bottom-full mb-1 z-50 w-36 bg-surface-container-high rounded-xl shadow-2xl ring-1 ring-outline-variant/10 overflow-hidden animate-in fade-in zoom-in-95 duration-150`,children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>{r(!1),t(e)},className:`w-full px-4 py-3 text-left text-xs font-bold text-error hover:bg-error/10 transition-colors flex items-center gap-2`,"aria-label":`Remove model ${e.name}`,children:[(0,I.jsx)(y,{size:12}),`Remove`]})})]})},B=({provider:e,models:t,isLoadingModels:n,isRefreshing:r,onRefresh:i,onOpenCreateModel:a,onDeleteModel:o})=>e?(0,I.jsxs)(`div`,{className:`bg-surface-container-low rounded-3xl overflow-hidden ring-1 ring-outline-variant/10 shadow-2xl animate-in fade-in zoom-in-95 duration-500`,children:[(0,I.jsxs)(`div`,{className:`p-10 relative overflow-hidden`,children:[(0,I.jsx)(`div`,{className:`absolute top-0 right-0 w-[500px] h-full bg-gradient-to-l from-primary/5 to-transparent pointer-events-none`}),(0,I.jsxs)(`div`,{className:`flex flex-col md:flex-row items-start justify-between gap-8 relative z-10`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,I.jsx)(`div`,{className:`w-20 h-20 bg-surface rounded-2xl flex items-center justify-center ring-1 ring-primary/20 shadow-inner group transition-all duration-500 hover:ring-primary/40`,children:(0,I.jsx)(D,{size:40,className:`text-primary group-hover:scale-110 transition-transform`})}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`h2`,{className:`text-3xl font-headline font-black text-white tracking-tight`,children:e.name}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsx)(`span`,{className:`px-2.5 py-0.5 bg-secondary/10 text-secondary text-[9px] font-black uppercase tracking-widest rounded ring-1 ring-secondary/20 font-headline`,children:`Primary`})})]}),(0,I.jsx)(`p`,{className:`text-on-surface-variant/60 text-sm mt-2`,children:e.description||`Infrastructure gateway for agentic cognition & reasoning.`})]})]}),(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:i,disabled:r,"aria-label":`Refresh ${e.name} data`,title:`Refresh ${e.name} data`,className:`p-2.5 rounded-xl bg-surface-container-high text-on-surface-variant hover:text-white hover:bg-surface-container-highest transition-all ring-1 ring-outline-variant/10 disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,I.jsx)(O,{size:18,className:E(r&&`animate-spin`)})}),(0,I.jsx)(`button`,{type:`button`,disabled:!0,"aria-label":`More provider actions unavailable`,title:`More provider actions unavailable`,className:`p-2.5 rounded-xl bg-surface-container-high text-on-surface-variant/40 transition-all ring-1 ring-outline-variant/10 disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,I.jsx)(p,{size:18})})]})]})]}),(0,I.jsxs)(`div`,{className:`p-10 border-t border-outline-variant/5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-8`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`h3`,{className:`font-headline font-black text-lg text-white`,children:`Registered Models`}),(0,I.jsxs)(`span`,{className:`px-2 py-0.5 rounded bg-surface-container-high text-[10px] font-bold text-on-surface-variant`,children:[t.length,` Models`]})]}),(0,I.jsxs)(`button`,{type:`button`,onClick:a,disabled:!e.id,className:`text-[10px] font-black uppercase tracking-widest text-primary hover:text-primary/70 transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed`,"aria-label":`Register models for ${e.name}`,children:[(0,I.jsx)(`div`,{className:`w-5 h-5 rounded-full bg-primary/10 flex items-center justify-center`,children:(0,I.jsx)(g,{size:12})}),`Register New Model`]})]}),(0,I.jsx)(`div`,{className:`rounded-2xl border border-outline-variant/5 overflow-visible`,children:(0,I.jsxs)(`table`,{className:`w-full text-left text-xs border-collapse`,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{className:`bg-surface-container-high/30 text-on-surface-variant/40 font-black uppercase tracking-[0.2em]`,children:[(0,I.jsx)(`th`,{className:`py-5 px-6`,children:`Model ID`}),(0,I.jsx)(`th`,{className:`py-5 px-6 text-right`,children:`Status`}),(0,I.jsx)(`th`,{className:`py-5 px-6 w-12 text-center`,children:`Action`})]})}),(0,I.jsx)(`tbody`,{className:`divide-y divide-outline-variant/5`,children:n?(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{colSpan:3,className:`py-20 text-center`,children:(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center space-y-4 opacity-40`,children:[(0,I.jsx)(`div`,{className:`w-8 h-8 border-2 border-primary/20 border-t-primary rounded-full animate-spin`}),(0,I.jsx)(`p`,{className:`text-[10px] uppercase font-black tracking-widest text-primary animate-pulse`,children:`Hydrating Model Registry...`})]})})}):t.length>0?t.map(e=>(0,I.jsxs)(`tr`,{className:`group hover:bg-primary/5 transition-all`,children:[(0,I.jsx)(`td`,{className:`py-5 px-6 font-mono text-on-surface font-medium`,children:e.name}),(0,I.jsx)(`td`,{className:`py-5 px-6 text-right`,children:(0,I.jsx)(`span`,{className:`inline-flex items-center px-2 py-1 rounded font-black text-[8px] uppercase tracking-widest bg-secondary/10 text-secondary`,children:`Active`})}),(0,I.jsx)(`td`,{className:`py-5 px-6 text-center`,children:(0,I.jsx)(z,{model:e,onDelete:o})})]},e.id)):(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{colSpan:3,className:`py-12 text-center text-on-surface-variant/20 italic font-medium`,children:`No models registered for this provider gate.`})})})]})})]}),(0,I.jsxs)(`div`,{className:`ui-helper-text p-8 border-t border-outline-variant/5 bg-surface-container-lowest/20 flex items-center gap-3`,children:[(0,I.jsx)(l,{size:14,className:`text-tertiary`}),`Model registry updates propagate automatically after provider and model changes.`]})]}):(0,I.jsxs)(`div`,{className:`h-[600px] bg-surface-container-low/50 rounded-3xl border border-dashed border-outline-variant/10 flex flex-col items-center justify-center text-on-surface-variant gap-4 opacity-40`,children:[(0,I.jsx)(`div`,{className:`w-20 h-20 rounded-2xl bg-surface-container flex items-center justify-center shadow-inner`,children:(0,I.jsx)(D,{size:40,className:`text-primary/50`})}),(0,I.jsxs)(`div`,{className:`text-center`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-headline font-black text-white uppercase tracking-widest mb-1`,children:`Infrastructure Hub`}),(0,I.jsx)(`p`,{className:`text-[10px] font-medium opacity-60`,children:`Select a provider on the left to view active node details.`})]})]}),V=({providers:e,selectedProviderId:t,selectedProviderModelCount:n,isLoading:r,onSelect:i})=>r&&e.length===0?(0,I.jsx)(`div`,{className:`space-y-3`,"aria-live":`polite`,children:Array.from({length:3}).map((e,t)=>(0,I.jsx)(`div`,{className:`h-28 rounded-2xl border border-outline-variant/10 bg-surface-container-low animate-pulse`},t))}):e.length===0?(0,I.jsxs)(`div`,{className:`p-8 border-2 border-dashed border-outline-variant/10 rounded-2xl flex flex-col items-center justify-center text-center opacity-40`,children:[(0,I.jsx)(v,{size:24,className:`mb-4`}),(0,I.jsxs)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest leading-relaxed`,children:[`No providers registered yet.`,(0,I.jsx)(`br`,{}),`Establish logical gateways in the infrastructure hub.`]})]}):(0,I.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>{let r=t===e.id,a=r?`${n} Models Active`:`Select to inspect`;return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:E(`w-full p-5 rounded-2xl border text-left transition-all duration-300 group`,r?`bg-surface-container-high border-secondary/20 shadow-lg shadow-secondary/5 ring-1 ring-secondary/10 text-white`:`bg-surface-container-low border-transparent hover:bg-surface-container-high/50 text-on-surface-variant`),"aria-pressed":r,"aria-label":`Select provider ${e.name}`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,I.jsx)(`div`,{className:E(`w-10 h-10 rounded-xl bg-surface-container-highest flex items-center justify-center transition-colors`,r?`text-primary`:`text-on-surface-variant`),children:(0,I.jsx)(d,{size:20})}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:E(`font-bold text-sm block transition-colors`,r?`text-white`:`group-hover:text-white`),children:e.name}),(0,I.jsx)(`span`,{className:`text-[9px] font-bold text-on-surface-variant/40 uppercase tracking-widest leading-none mt-1 block`,children:a})]})]}),(0,I.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-secondary animate-pulse shadow-[0_0_10px_rgba(78,222,163,0.5)]`})]}),(0,I.jsx)(`div`,{className:`flex justify-start`,children:(0,I.jsx)(`span`,{className:`text-[9px] font-black uppercase tracking-widest text-secondary`,children:`Healthy`})})]},e.id)})}),H=()=>{let[e,t]=(0,k.useState)(!1),[n,r]=(0,k.useState)(!1),[i,a]=(0,k.useState)(null),[o,s]=(0,k.useState)(null),{data:c=[],isPending:l,isFetching:u,refetch:d}=j(),f=c.find(e=>e.id===i)?.id??c[0]?.id??null,p=M(f),m=(0,k.useMemo)(()=>c.find(e=>e.id===f)??null,[c,f]),{mutate:h,isPending:g}=F(f??``),_=(0,k.useCallback)(async()=>{await Promise.all([d(),f?p.refetch():Promise.resolve(void 0)])},[p,d,f]);return{providers:c,selectedProvider:m,selectedProviderId:f,setSelectedProviderId:a,models:p.data??[],isLoadingProviders:l,isFetchingProviders:u,isLoadingModels:p.isPending||p.isFetching,isRegisterProviderModalOpen:e,setIsRegisterProviderModalOpen:t,isCreateModelModalOpen:n,setIsCreateModelModalOpen:r,refreshProviders:_,modelPendingDelete:o,setModelPendingDelete:s,deleteModel:h,isDeletingModel:g}},U=()=>{let{providers:e,selectedProvider:t,selectedProviderId:n,setSelectedProviderId:r,models:i,isLoadingProviders:a,isFetchingProviders:o,isLoadingModels:s,isRegisterProviderModalOpen:l,setIsRegisterProviderModalOpen:u,isCreateModelModalOpen:d,setIsCreateModelModalOpen:f,refreshProviders:p,modelPendingDelete:m,setModelPendingDelete:h,deleteModel:_,isDeletingModel:y}=H();return(0,I.jsxs)(`div`,{className:`space-y-10 animate-in fade-in slide-in-from-bottom-4 duration-700`,children:[(0,I.jsx)(`header`,{children:(0,I.jsxs)(`div`,{className:`flex flex-col md:flex-row md:items-end justify-between gap-6`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`nav`,{className:`flex items-center gap-2 mb-2 text-[10px] uppercase tracking-widest text-primary font-bold`,children:[(0,I.jsx)(`span`,{className:`opacity-60`,children:`Infrastructure`}),(0,I.jsx)(c,{size:12,className:`opacity-40`}),(0,I.jsx)(`span`,{children:`Model Providers`})]}),(0,I.jsx)(`h1`,{className:`text-4xl font-extrabold font-headline tracking-tighter text-white`,children:`Provider Core`}),(0,I.jsx)(`p`,{className:`text-on-surface-variant text-sm mt-1`,children:`Manage global LLM integrations and endpoint health.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>{p()},disabled:o,className:`px-5 py-2.5 bg-surface-container-high text-on-surface rounded-lg text-xs font-bold uppercase tracking-widest hover:bg-surface-container-highest transition-all ring-1 ring-outline-variant/10 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed`,"aria-label":`Refresh provider status`,children:[(0,I.jsx)(O,{size:14,className:E(o&&`animate-spin`)}),o?`Refreshing...`:`Refresh Status`]}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>u(!0),className:`px-6 py-2.5 bg-primary text-on-primary rounded-lg text-xs font-bold uppercase tracking-widest shadow-lg shadow-primary/20 hover:scale-[1.02] active:scale-[0.98] transition-all flex items-center gap-2`,"aria-label":`Open register provider modal`,children:[(0,I.jsx)(g,{size:16}),`Register Provider`]})]})]})}),(0,I.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-8`,children:[(0,I.jsxs)(`div`,{className:`lg:col-span-4 space-y-5`,children:[(0,I.jsxs)(`h2`,{className:`text-[10px] font-black uppercase tracking-[0.3em] text-on-surface-variant/40 flex items-center gap-3`,children:[(0,I.jsx)(v,{size:14,className:`text-primary`}),` Active Providers`]}),(0,I.jsx)(V,{providers:e,selectedProviderId:n,selectedProviderModelCount:n===t?.id?i.length:0,isLoading:a,onSelect:r})]}),(0,I.jsx)(`div`,{className:`lg:col-span-8 space-y-8`,children:(0,I.jsx)(B,{provider:t,models:i,isLoadingModels:s,isRefreshing:o,onRefresh:()=>{p()},onOpenCreateModel:()=>f(!0),onDeleteModel:h})})]}),(0,I.jsx)(R,{isOpen:l,onClose:()=>u(!1),onCreated:e=>{r(e),u(!1)}}),(0,I.jsx)(L,{isOpen:d,onClose:()=>f(!1),onCreated:()=>f(!1),providerId:t?.id??``,providerName:t?.name??``}),(0,I.jsx)(b,{isOpen:m!==null,onClose:()=>h(null),onConfirm:()=>{m&&_(m.id,{onSettled:()=>h(null)})},title:`Remove Model`,message:`Are you sure you want to remove "${m?.name??``}"? This action cannot be undone.`,confirmText:`Remove`,cancelText:`Cancel`,variant:`danger`,loading:y})]})};export{U as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CreateRecurrentTaskModal-
|
|
2
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CfaHPvi0.js";import{l as n,s as r}from"./vendor-react-BmVaKUwY.js";import{i,n as a,t as o}from"./vendor-query-xpDrc4rM.js";import{r as s}from"./vendor-markdown-DoJbQ1of.js";import{i as c}from"./client-BGOBXkO8.js";import{t as l}from"./activity-CmAajKmR.js";import{t as u}from"./bot-QVmnxPf4.js";import{t as d}from"./database-D6O4hvbm.js";import{t as f}from"./panels-top-left-Vk8FzAxf.js";import{i as p,n as m,r as h,t as g}from"./trending-up-DlrXEXE6.js";import{t as _}from"./plus-Dx6G8SOZ.js";import{t as v}from"./refresh-cw-DQW6jR7M.js";import{t as y}from"./sparkles-v57Nc-z-.js";import{t as b}from"./trash-2-DJpTXgEP.js";import{t as x}from"./ConfirmDialog-y3vTcqFR.js";import{t as S}from"./useProject-DhK9Ze6F.js";import{t as C}from"./vendor-motion-CMGWJcqR.js";import{t as w}from"./useNotification-DQayTSUL.js";import{n as T,r as E}from"./recurrent-tasks-CKT47N2l.js";import{t as D}from"./usePersistentFlag-R3_SXL_2.js";var O=c(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),k=e(t(),1),A=s(),j=(0,k.lazy)(()=>n(()=>import(`./CreateRecurrentTaskModal-BgfnJ1n8.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]))),M=()=>{let{activeProject:e,loading:t}=S(),{notifySuccess:n,notifyApiError:s}=w(),c=r(),M=i(),[N,P]=(0,k.useState)(!1),[F,I]=D(`scheduler_show_insight`,!0),[L,R]=(0,k.useState)(void 0),[z,B]=(0,k.useState)(null),V=()=>{I(!1)},H=[`recurrent-tasks`,e?.id],{data:U=[],isLoading:W}=a({queryKey:H,queryFn:async()=>{let t=await E.findAll(e.id);return Array.isArray(t.data)?t.data:[]},enabled:!!e?.id}),G=o({mutationFn:t=>E.delete(e.id,t.id),onSuccess:(e,t)=>{n(`Protocol Terminated`,`The task "${t.title}" has been removed from the fleet.`),B(null),M.invalidateQueries({queryKey:H})},onError:e=>s(e,`Error deleting task`)}),K=o({mutationFn:t=>{let n=t.status===T.ACTIVE?T.PAUSED:T.ACTIVE;return E.update(e.id,t.id,{status:n}).then(()=>n)},onSuccess:(e,t)=>{n(`Protocol ${e===T.ACTIVE?`Resumed`:`Paused`}`,`Operation "${t.title}" has been ${e===T.ACTIVE?`re-activated`:`suspended`}.`),M.invalidateQueries({queryKey:H})},onError:e=>s(e,`Failed to update protocol status`)}),q=()=>{R(void 0),P(!0)},J=e=>{R(e),P(!0)},Y=e=>{K.isPending||K.mutate(e)},X=U.length>0?(U.length-U.filter(e=>e.status===T.ERROR).length)/U.length*100:100,Z=[{label:`Active Schedules`,value:U.filter(e=>e.status===T.ACTIVE).length.toString(),change:`+12%`,icon:g,color:`text-secondary`,bg:`bg-secondary/10`},{label:`Success Rate`,value:`${X.toFixed(1)}%`,trend:X,icon:l,color:`text-primary`},{label:`Paused Agents`,value:U.filter(e=>e.status===T.PAUSED).length.toString(),subtext:`Awaiting manual audit`,icon:p,color:`text-on-surface-variant`},{label:`Critical Errors`,value:U.filter(e=>e.status===T.ERROR).length.toString(),subtext:`System integrity: nominal`,icon:O,color:`text-error`,bg:`bg-error/10`}];return t?(0,A.jsx)(`div`,{className:`w-full h-[60vh] flex items-center justify-center`,children:(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,A.jsx)(`div`,{className:`w-16 h-16 border-4 border-primary border-t-transparent rounded-full animate-spin`}),(0,A.jsx)(`p`,{className:`text-on-surface-variant text-sm font-black uppercase tracking-[0.3em] animate-pulse`,children:`Initializing Temporal Grid`})]})}):e?(0,A.jsxs)(`div`,{className:`space-y-10 animate-in fade-in duration-700`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col md:flex-row justify-between items-start md:items-end gap-6`,children:[(0,A.jsxs)(C.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.5},children:[(0,A.jsx)(`h2`,{className:`text-4xl font-headline font-extrabold text-white tracking-tight mb-2`,children:`Temporal Orchestration`}),(0,A.jsx)(`p`,{className:`text-on-surface-variant font-body max-w-md`,children:`Manage autonomous agent lifecycle schedules and recurrent operational flows.`})]}),(0,A.jsxs)(C.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:q,className:`px-6 py-3.5 bg-primary text-on-primary rounded-xl font-black text-xs uppercase tracking-widest flex items-center gap-2 shadow-lg shadow-primary/20 transition-all border border-primary-container/20 group hover:shadow-primary/40`,children:[(0,A.jsx)(_,{size:18,className:`group-hover:rotate-90 transition-transform duration-300`}),`New Scheduled Task`]})]}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6`,children:Z.map((e,t)=>(0,A.jsxs)(C.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:t*.1},className:`bg-surface-container-low p-6 rounded-2xl border border-outline-variant/10 shadow-xl group hover:border-primary/20 transition-colors`,children:[(0,A.jsx)(`p`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 mb-1`,children:e.label}),(0,A.jsx)(`h3`,{className:`text-3xl font-headline font-black ${e.color}`,children:e.value}),e.change&&(0,A.jsxs)(`div`,{className:`mt-4 flex items-center text-[10px] font-black uppercase tracking-wider ${e.color} ${e.bg} px-2.5 py-1 rounded-full w-fit`,children:[(0,A.jsx)(e.icon,{size:12,className:`mr-1.5`}),e.change,` vs last month`]}),e.trend!==void 0&&(0,A.jsx)(`div`,{className:`mt-4 w-full bg-surface-container-highest h-1.5 rounded-full overflow-hidden`,children:(0,A.jsx)(C.div,{initial:{width:0},animate:{width:`${e.trend}%`},transition:{duration:1,delay:.5},className:`bg-primary h-full shadow-[0_0_12px_rgba(173,198,255,0.6)]`})}),e.subtext&&(0,A.jsx)(`p`,{className:`mt-4 text-[11px] text-on-surface-variant/50 font-medium italic`,children:e.subtext})]},t))}),(0,A.jsxs)(C.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:`bg-surface-container-low rounded-2xl overflow-hidden border border-outline-variant/10 shadow-2xl`,children:[(0,A.jsxs)(`div`,{className:`px-8 py-5 flex flex-col md:flex-row justify-between items-center gap-4 bg-surface-container-high/30 border-b border-outline-variant/10`,children:[(0,A.jsx)(`h4`,{className:`font-headline font-bold text-lg text-white`,children:`Recurrent Protocols`}),(0,A.jsxs)(`div`,{className:`flex gap-6`,children:[(0,A.jsxs)(`span`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-secondary shadow-[0_0_8px_rgba(78,222,163,0.4)]`}),` Active`]}),(0,A.jsxs)(`span`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-on-surface-variant/40`}),` Paused`]}),(0,A.jsxs)(`span`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-error shadow-[0_0_8px_rgba(255,180,171,0.4)]`}),` Error`]})]})]}),(0,A.jsx)(`div`,{className:`divide-y divide-outline-variant/10`,children:W?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-20 space-y-4`,children:[(0,A.jsx)(v,{className:`text-primary animate-spin`,size:40}),(0,A.jsx)(`p`,{className:`text-on-surface-variant font-mono text-xs uppercase tracking-widest animate-pulse`,children:`Synchronizing Fleet States...`})]}):U.length===0?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-20 space-y-6 text-center`,children:[(0,A.jsx)(`div`,{className:`w-16 h-16 rounded-full bg-surface-container-highest flex items-center justify-center text-on-surface-variant`,children:(0,A.jsx)(d,{size:32})}),(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(`h5`,{className:`text-xl font-headline font-bold text-white`,children:`No active protocols detected`}),(0,A.jsx)(`p`,{className:`text-on-surface-variant max-w-sm font-body`,children:`Deployment requested: Initiating autonomous routines requires manual configuration.`})]}),(0,A.jsx)(`button`,{onClick:q,className:`px-4 py-2 border border-primary/30 text-primary rounded-lg text-[10px] font-black uppercase tracking-widest hover:bg-primary/5 transition-colors`,children:`Initiate First Sequence`})]}):U.map(e=>(0,A.jsx)(`div`,{className:`px-8 py-6 hover:bg-surface-container-high/20 transition-all group`,children:(0,A.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[auto_1fr_160px_160px_160px_220px] items-center gap-10`,children:[(0,A.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-surface-container-highest flex items-center justify-center border border-outline-variant/20 group-hover:border-primary/30 transition-colors shadow-inner`,children:(0,A.jsx)(l,{className:e.status===T.ERROR?`text-error`:`text-primary`,size:24})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h5`,{className:`text-xl font-headline font-black text-white mb-2 group-hover:text-primary transition-colors tracking-tight cursor-pointer`,onClick:()=>c(`/scheduler/tasks/${e.id}/executions`),children:e.title}),(0,A.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,A.jsxs)(`span`,{className:`flex items-center gap-1.5 bg-surface-container-highest px-3 py-1.5 rounded-lg text-[10px] font-black uppercase tracking-widest text-on-surface-variant border border-outline-variant/10 shadow-sm`,children:[(0,A.jsx)(u,{size:12}),e.assignee?.name||`Unassigned`]})})]}),(0,A.jsxs)(`div`,{className:`hidden lg:block`,children:[(0,A.jsx)(`p`,{className:`text-[9px] font-black uppercase tracking-[0.2em] text-on-surface-variant/40 mb-2`,children:`Cycle Pattern`}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,A.jsx)(`p`,{className:`font-mono text-xs text-tertiary font-bold tracking-widest`,children:e.cronExpression}),(0,A.jsx)(`p`,{className:`text-[10px] text-on-surface-variant/60 font-medium uppercase tracking-tighter italic`,children:`Recurrent Loop`})]})]}),(0,A.jsxs)(`div`,{className:`hidden lg:block`,children:[(0,A.jsx)(`p`,{className:`text-[9px] font-black uppercase tracking-[0.2em] text-on-surface-variant/40 mb-2`,children:`Last Execution`}),(0,A.jsx)(`p`,{className:`text-sm font-bold tracking-tight text-white/90`,children:e.lastRun?new Date(e.lastRun).toLocaleString():(0,A.jsx)(`span`,{className:`text-on-surface-variant/40 italic`,children:`Never executed`})})]}),(0,A.jsxs)(`div`,{className:`hidden lg:block`,children:[(0,A.jsx)(`p`,{className:`text-[9px] font-black uppercase tracking-[0.2em] text-on-surface-variant/40 mb-2`,children:`Deployed`}),(0,A.jsx)(`p`,{className:`text-sm font-bold text-on-surface tracking-tight`,children:new Date(e.createdAt).toLocaleDateString()})]}),(0,A.jsxs)(`div`,{className:`flex items-center justify-end relative h-full`,children:[(0,A.jsx)(`div`,{className:`flex items-center gap-4 group-hover:opacity-0 transition-opacity`,children:(0,A.jsx)(`span`,{className:`px-4 py-1.5 rounded-full text-[10px] font-black uppercase tracking-widest border transition-all ${e.status===T.ACTIVE?`bg-secondary/10 text-secondary border-secondary/20 shadow-[0_0_15px_rgba(78,222,163,0.1)]`:e.status===T.PAUSED?`bg-surface-container-highest text-on-surface-variant/60 border-outline-variant/20`:`bg-error/10 text-error border-error/20 shadow-[0_0_15px_rgba(255,180,171,0.1)]`}`,children:e.status})}),(0,A.jsxs)(`div`,{className:`absolute right-0 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-all translate-x-2 group-hover:translate-x-0`,children:[(0,A.jsx)(`button`,{className:`p-3 transition-colors disabled:opacity-40 ${e.status===T.ACTIVE?`text-secondary hover:text-secondary/80`:`text-on-surface-variant hover:text-secondary`}`,title:e.status===T.ACTIVE?`Pause Protocol`:`Resume Protocol`,disabled:K.isPending,onClick:()=>Y(e),children:e.status===T.ACTIVE?(0,A.jsx)(p,{size:20}):(0,A.jsx)(h,{size:20})}),(0,A.jsx)(`button`,{className:`p-3 text-on-surface-variant hover:text-primary transition-colors`,title:`Edit`,onClick:()=>J(e),children:(0,A.jsx)(m,{size:20})}),(0,A.jsx)(`button`,{className:`p-3 text-on-surface-variant hover:text-error transition-colors`,title:`Delete`,onClick:()=>B(e),children:(0,A.jsx)(b,{size:20})})]})]})]})},e.id))})]}),F&&(0,A.jsxs)(C.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{delay:.6},className:`p-8 rounded-3xl bg-gradient-to-br from-tertiary/10 via-surface-container-low to-surface-container-low border border-tertiary/20 relative overflow-hidden group`,children:[(0,A.jsxs)(`div`,{className:`relative z-10 flex flex-col md:flex-row gap-8 items-start md:items-center`,children:[(0,A.jsx)(`div`,{className:`w-16 h-16 bg-tertiary/10 rounded-2xl border border-tertiary/20 flex items-center justify-center text-tertiary shadow-xl group-hover:scale-110 transition-transform duration-500`,children:(0,A.jsx)(y,{size:32})}),(0,A.jsxs)(`div`,{className:`flex-1 space-y-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h4`,{className:`text-xl font-headline font-black text-tertiary mb-2 uppercase tracking-tight`,children:`Orchestrator Intelligence Insight`}),(0,A.jsx)(`p`,{className:`text-on-surface-variant leading-relaxed max-w-4xl font-body italic text-base`,children:`"To maximize efficiency, schedule tasks with non-overlapping times."`})]}),(0,A.jsx)(`div`,{className:`flex gap-4`,children:(0,A.jsx)(`button`,{onClick:V,className:`px-6 py-2.5 border border-tertiary/30 text-tertiary rounded-xl font-black text-xs uppercase tracking-widest hover:bg-tertiary/5 transition-colors`,children:`Dismiss`})})]})]}),(0,A.jsx)(`div`,{className:`absolute -right-20 -bottom-20 w-80 h-80 bg-tertiary/5 blur-[100px] rounded-full group-hover:bg-tertiary/10 transition-colors duration-1000`})]}),(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(j,{projectId:e.id,isOpen:N,onClose:()=>P(!1),onSuccess:()=>{P(!1),M.invalidateQueries({queryKey:H})},initialData:L})}),(0,A.jsx)(x,{isOpen:!!z,onClose:()=>!G.isPending&&B(null),onConfirm:()=>z&&G.mutate(z),title:`Delete Recurrent Protocol?`,message:`Are you sure you want to delete the recurrent protocol "${z?.title}"? This action cannot be undone.`,confirmText:`Delete Protocol`,variant:`danger`,loading:G.isPending})]}):(0,A.jsx)(`div`,{className:`w-full h-[60vh] flex items-center justify-center`,children:(0,A.jsxs)(`div`,{className:`text-center space-y-6 max-w-md`,children:[(0,A.jsx)(`div`,{className:`w-20 h-20 bg-surface-container-highest rounded-3xl flex items-center justify-center text-on-surface-variant/20 mx-auto border border-outline-variant/10 shadow-xl`,children:(0,A.jsx)(f,{size:40})}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`h2`,{className:`text-2xl font-black font-headline text-white tracking-tight`,children:`No Active Projects Found`}),(0,A.jsx)(`p`,{className:`text-on-surface-variant text-sm leading-relaxed`,children:`Temporal orchestration requires an active project. Create or select a project from the sidebar to manage recurrent tasks.`})]})]})})};export{M as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CreateRecurrentTaskModal-CGSdgNAf.js","assets/vendor-query-xpDrc4rM.js","assets/rolldown-runtime-COnpUsM8.js","assets/vendor-dnd-CfaHPvi0.js","assets/vendor-markdown-DoJbQ1of.js","assets/vendor-forms-DHyqHeyd.js","assets/client-B553SX3l.js","assets/vendor-motion-CMGWJcqR.js","assets/bot-DadO9w3D.js","assets/brain-DWTpby6b.js","assets/chevron-down-BUOg3vvd.js","assets/circle-alert-sCcf7ANF.js","assets/clock-CSNFJjo4.js","assets/MarkdownField-DR6tHsei.js","assets/eye-CjrFwZG_.js","assets/sparkles-krUpxie4.js","assets/cpu-C2_GFeSH.js","assets/rocket-B9Iexkcw.js","assets/x-CCZGYGDC.js","assets/agents-YQJ7JNfI.js","assets/recurrent-tasks-7thk45mk.js","assets/tasks-DHsBE-ea.js","assets/useNotification-DQayTSUL.js","assets/taskFormSchemas-B6YlRxrx.js","assets/agentEmojis-BQA0jC3z.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CfaHPvi0.js";import{l as n,s as r}from"./vendor-react-BmVaKUwY.js";import{i,n as a,t as o}from"./vendor-query-xpDrc4rM.js";import{r as s}from"./vendor-markdown-DoJbQ1of.js";import{i as c}from"./client-B553SX3l.js";import{t as l}from"./activity-B_2QSywM.js";import{t as u}from"./bot-DadO9w3D.js";import{t as d}from"./database-zXW48-_N.js";import{t as f}from"./panels-top-left-Cp169WzB.js";import{i as p,n as m,r as h,t as g}from"./trending-up-ClGbkbN9.js";import{t as _}from"./plus-CkteVqhM.js";import{t as v}from"./refresh-cw-BgDsJOC_.js";import{t as y}from"./sparkles-krUpxie4.js";import{t as b}from"./trash-2-CphQfk35.js";import{t as x}from"./ConfirmDialog-BltdtevE.js";import{t as S}from"./useProject-DhK9Ze6F.js";import{t as C}from"./vendor-motion-CMGWJcqR.js";import{t as w}from"./useNotification-DQayTSUL.js";import{n as T,r as E}from"./recurrent-tasks-7thk45mk.js";import{t as D}from"./usePersistentFlag-R3_SXL_2.js";var O=c(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),k=e(t(),1),A=s(),j=(0,k.lazy)(()=>n(()=>import(`./CreateRecurrentTaskModal-CGSdgNAf.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]))),M=()=>{let{activeProject:e,loading:t}=S(),{notifySuccess:n,notifyApiError:s}=w(),c=r(),M=i(),[N,P]=(0,k.useState)(!1),[F,I]=D(`scheduler_show_insight`,!0),[L,R]=(0,k.useState)(void 0),[z,B]=(0,k.useState)(null),V=()=>{I(!1)},H=[`recurrent-tasks`,e?.id],{data:U=[],isLoading:W}=a({queryKey:H,queryFn:async()=>{let t=await E.findAll(e.id);return Array.isArray(t.data)?t.data:[]},enabled:!!e?.id}),G=o({mutationFn:t=>E.delete(e.id,t.id),onSuccess:(e,t)=>{n(`Protocol Terminated`,`The task "${t.title}" has been removed from the fleet.`),B(null),M.invalidateQueries({queryKey:H})},onError:e=>s(e,`Error deleting task`)}),K=o({mutationFn:t=>{let n=t.status===T.ACTIVE?T.PAUSED:T.ACTIVE;return E.update(e.id,t.id,{status:n}).then(()=>n)},onSuccess:(e,t)=>{n(`Protocol ${e===T.ACTIVE?`Resumed`:`Paused`}`,`Operation "${t.title}" has been ${e===T.ACTIVE?`re-activated`:`suspended`}.`),M.invalidateQueries({queryKey:H})},onError:e=>s(e,`Failed to update protocol status`)}),q=()=>{R(void 0),P(!0)},J=e=>{R(e),P(!0)},Y=e=>{K.isPending||K.mutate(e)},X=U.length>0?(U.length-U.filter(e=>e.status===T.ERROR).length)/U.length*100:100,Z=[{label:`Active Schedules`,value:U.filter(e=>e.status===T.ACTIVE).length.toString(),change:`+12%`,icon:g,color:`text-secondary`,bg:`bg-secondary/10`},{label:`Success Rate`,value:`${X.toFixed(1)}%`,trend:X,icon:l,color:`text-primary`},{label:`Paused Agents`,value:U.filter(e=>e.status===T.PAUSED).length.toString(),subtext:`Awaiting manual audit`,icon:p,color:`text-on-surface-variant`},{label:`Critical Errors`,value:U.filter(e=>e.status===T.ERROR).length.toString(),subtext:`System integrity: nominal`,icon:O,color:`text-error`,bg:`bg-error/10`}];return t?(0,A.jsx)(`div`,{className:`w-full h-[60vh] flex items-center justify-center`,children:(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,A.jsx)(`div`,{className:`w-16 h-16 border-4 border-primary border-t-transparent rounded-full animate-spin`}),(0,A.jsx)(`p`,{className:`text-on-surface-variant text-sm font-black uppercase tracking-[0.3em] animate-pulse`,children:`Initializing Temporal Grid`})]})}):e?(0,A.jsxs)(`div`,{className:`space-y-10 animate-in fade-in duration-700`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col md:flex-row justify-between items-start md:items-end gap-6`,children:[(0,A.jsxs)(C.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.5},children:[(0,A.jsx)(`h2`,{className:`text-4xl font-headline font-extrabold text-white tracking-tight mb-2`,children:`Temporal Orchestration`}),(0,A.jsx)(`p`,{className:`text-on-surface-variant font-body max-w-md`,children:`Manage autonomous agent lifecycle schedules and recurrent operational flows.`})]}),(0,A.jsxs)(C.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:q,className:`px-6 py-3.5 bg-primary text-on-primary rounded-xl font-black text-xs uppercase tracking-widest flex items-center gap-2 shadow-lg shadow-primary/20 transition-all border border-primary-container/20 group hover:shadow-primary/40`,children:[(0,A.jsx)(_,{size:18,className:`group-hover:rotate-90 transition-transform duration-300`}),`New Scheduled Task`]})]}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6`,children:Z.map((e,t)=>(0,A.jsxs)(C.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:t*.1},className:`bg-surface-container-low p-6 rounded-2xl border border-outline-variant/10 shadow-xl group hover:border-primary/20 transition-colors`,children:[(0,A.jsx)(`p`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 mb-1`,children:e.label}),(0,A.jsx)(`h3`,{className:`text-3xl font-headline font-black ${e.color}`,children:e.value}),e.change&&(0,A.jsxs)(`div`,{className:`mt-4 flex items-center text-[10px] font-black uppercase tracking-wider ${e.color} ${e.bg} px-2.5 py-1 rounded-full w-fit`,children:[(0,A.jsx)(e.icon,{size:12,className:`mr-1.5`}),e.change,` vs last month`]}),e.trend!==void 0&&(0,A.jsx)(`div`,{className:`mt-4 w-full bg-surface-container-highest h-1.5 rounded-full overflow-hidden`,children:(0,A.jsx)(C.div,{initial:{width:0},animate:{width:`${e.trend}%`},transition:{duration:1,delay:.5},className:`bg-primary h-full shadow-[0_0_12px_rgba(173,198,255,0.6)]`})}),e.subtext&&(0,A.jsx)(`p`,{className:`mt-4 text-[11px] text-on-surface-variant/50 font-medium italic`,children:e.subtext})]},t))}),(0,A.jsxs)(C.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},className:`bg-surface-container-low rounded-2xl overflow-hidden border border-outline-variant/10 shadow-2xl`,children:[(0,A.jsxs)(`div`,{className:`px-8 py-5 flex flex-col md:flex-row justify-between items-center gap-4 bg-surface-container-high/30 border-b border-outline-variant/10`,children:[(0,A.jsx)(`h4`,{className:`font-headline font-bold text-lg text-white`,children:`Recurrent Protocols`}),(0,A.jsxs)(`div`,{className:`flex gap-6`,children:[(0,A.jsxs)(`span`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-secondary shadow-[0_0_8px_rgba(78,222,163,0.4)]`}),` Active`]}),(0,A.jsxs)(`span`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-on-surface-variant/40`}),` Paused`]}),(0,A.jsxs)(`span`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-error shadow-[0_0_8px_rgba(255,180,171,0.4)]`}),` Error`]})]})]}),(0,A.jsx)(`div`,{className:`divide-y divide-outline-variant/10`,children:W?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-20 space-y-4`,children:[(0,A.jsx)(v,{className:`text-primary animate-spin`,size:40}),(0,A.jsx)(`p`,{className:`text-on-surface-variant font-mono text-xs uppercase tracking-widest animate-pulse`,children:`Synchronizing Fleet States...`})]}):U.length===0?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-20 space-y-6 text-center`,children:[(0,A.jsx)(`div`,{className:`w-16 h-16 rounded-full bg-surface-container-highest flex items-center justify-center text-on-surface-variant`,children:(0,A.jsx)(d,{size:32})}),(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(`h5`,{className:`text-xl font-headline font-bold text-white`,children:`No active protocols detected`}),(0,A.jsx)(`p`,{className:`text-on-surface-variant max-w-sm font-body`,children:`Deployment requested: Initiating autonomous routines requires manual configuration.`})]}),(0,A.jsx)(`button`,{onClick:q,className:`px-4 py-2 border border-primary/30 text-primary rounded-lg text-[10px] font-black uppercase tracking-widest hover:bg-primary/5 transition-colors`,children:`Initiate First Sequence`})]}):U.map(e=>(0,A.jsx)(`div`,{className:`px-8 py-6 hover:bg-surface-container-high/20 transition-all group`,children:(0,A.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[auto_1fr_160px_160px_160px_220px] items-center gap-10`,children:[(0,A.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-surface-container-highest flex items-center justify-center border border-outline-variant/20 group-hover:border-primary/30 transition-colors shadow-inner`,children:(0,A.jsx)(l,{className:e.status===T.ERROR?`text-error`:`text-primary`,size:24})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h5`,{className:`text-xl font-headline font-black text-white mb-2 group-hover:text-primary transition-colors tracking-tight cursor-pointer`,onClick:()=>c(`/scheduler/tasks/${e.id}/executions`),children:e.title}),(0,A.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,A.jsxs)(`span`,{className:`flex items-center gap-1.5 bg-surface-container-highest px-3 py-1.5 rounded-lg text-[10px] font-black uppercase tracking-widest text-on-surface-variant border border-outline-variant/10 shadow-sm`,children:[(0,A.jsx)(u,{size:12}),e.assignee?.name||`Unassigned`]})})]}),(0,A.jsxs)(`div`,{className:`hidden lg:block`,children:[(0,A.jsx)(`p`,{className:`text-[9px] font-black uppercase tracking-[0.2em] text-on-surface-variant/40 mb-2`,children:`Cycle Pattern`}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,A.jsx)(`p`,{className:`font-mono text-xs text-tertiary font-bold tracking-widest`,children:e.cronExpression}),(0,A.jsx)(`p`,{className:`text-[10px] text-on-surface-variant/60 font-medium uppercase tracking-tighter italic`,children:`Recurrent Loop`})]})]}),(0,A.jsxs)(`div`,{className:`hidden lg:block`,children:[(0,A.jsx)(`p`,{className:`text-[9px] font-black uppercase tracking-[0.2em] text-on-surface-variant/40 mb-2`,children:`Last Execution`}),(0,A.jsx)(`p`,{className:`text-sm font-bold tracking-tight text-white/90`,children:e.lastRun?new Date(e.lastRun).toLocaleString():(0,A.jsx)(`span`,{className:`text-on-surface-variant/40 italic`,children:`Never executed`})})]}),(0,A.jsxs)(`div`,{className:`hidden lg:block`,children:[(0,A.jsx)(`p`,{className:`text-[9px] font-black uppercase tracking-[0.2em] text-on-surface-variant/40 mb-2`,children:`Deployed`}),(0,A.jsx)(`p`,{className:`text-sm font-bold text-on-surface tracking-tight`,children:new Date(e.createdAt).toLocaleDateString()})]}),(0,A.jsxs)(`div`,{className:`flex items-center justify-end relative h-full`,children:[(0,A.jsx)(`div`,{className:`flex items-center gap-4 group-hover:opacity-0 transition-opacity`,children:(0,A.jsx)(`span`,{className:`px-4 py-1.5 rounded-full text-[10px] font-black uppercase tracking-widest border transition-all ${e.status===T.ACTIVE?`bg-secondary/10 text-secondary border-secondary/20 shadow-[0_0_15px_rgba(78,222,163,0.1)]`:e.status===T.PAUSED?`bg-surface-container-highest text-on-surface-variant/60 border-outline-variant/20`:`bg-error/10 text-error border-error/20 shadow-[0_0_15px_rgba(255,180,171,0.1)]`}`,children:e.status})}),(0,A.jsxs)(`div`,{className:`absolute right-0 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-all translate-x-2 group-hover:translate-x-0`,children:[(0,A.jsx)(`button`,{className:`p-3 transition-colors disabled:opacity-40 ${e.status===T.ACTIVE?`text-secondary hover:text-secondary/80`:`text-on-surface-variant hover:text-secondary`}`,title:e.status===T.ACTIVE?`Pause Protocol`:`Resume Protocol`,disabled:K.isPending,onClick:()=>Y(e),children:e.status===T.ACTIVE?(0,A.jsx)(p,{size:20}):(0,A.jsx)(h,{size:20})}),(0,A.jsx)(`button`,{className:`p-3 text-on-surface-variant hover:text-primary transition-colors`,title:`Edit`,onClick:()=>J(e),children:(0,A.jsx)(m,{size:20})}),(0,A.jsx)(`button`,{className:`p-3 text-on-surface-variant hover:text-error transition-colors`,title:`Delete`,onClick:()=>B(e),children:(0,A.jsx)(b,{size:20})})]})]})]})},e.id))})]}),F&&(0,A.jsxs)(C.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{delay:.6},className:`p-8 rounded-3xl bg-gradient-to-br from-tertiary/10 via-surface-container-low to-surface-container-low border border-tertiary/20 relative overflow-hidden group`,children:[(0,A.jsxs)(`div`,{className:`relative z-10 flex flex-col md:flex-row gap-8 items-start md:items-center`,children:[(0,A.jsx)(`div`,{className:`w-16 h-16 bg-tertiary/10 rounded-2xl border border-tertiary/20 flex items-center justify-center text-tertiary shadow-xl group-hover:scale-110 transition-transform duration-500`,children:(0,A.jsx)(y,{size:32})}),(0,A.jsxs)(`div`,{className:`flex-1 space-y-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h4`,{className:`text-xl font-headline font-black text-tertiary mb-2 uppercase tracking-tight`,children:`Orchestrator Intelligence Insight`}),(0,A.jsx)(`p`,{className:`text-on-surface-variant leading-relaxed max-w-4xl font-body italic text-base`,children:`"To maximize efficiency, schedule tasks with non-overlapping times."`})]}),(0,A.jsx)(`div`,{className:`flex gap-4`,children:(0,A.jsx)(`button`,{onClick:V,className:`px-6 py-2.5 border border-tertiary/30 text-tertiary rounded-xl font-black text-xs uppercase tracking-widest hover:bg-tertiary/5 transition-colors`,children:`Dismiss`})})]})]}),(0,A.jsx)(`div`,{className:`absolute -right-20 -bottom-20 w-80 h-80 bg-tertiary/5 blur-[100px] rounded-full group-hover:bg-tertiary/10 transition-colors duration-1000`})]}),(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(j,{projectId:e.id,isOpen:N,onClose:()=>P(!1),onSuccess:()=>{P(!1),M.invalidateQueries({queryKey:H})},initialData:L})}),(0,A.jsx)(x,{isOpen:!!z,onClose:()=>!G.isPending&&B(null),onConfirm:()=>z&&G.mutate(z),title:`Delete Recurrent Protocol?`,message:`Are you sure you want to delete the recurrent protocol "${z?.title}"? This action cannot be undone.`,confirmText:`Delete Protocol`,variant:`danger`,loading:G.isPending})]}):(0,A.jsx)(`div`,{className:`w-full h-[60vh] flex items-center justify-center`,children:(0,A.jsxs)(`div`,{className:`text-center space-y-6 max-w-md`,children:[(0,A.jsx)(`div`,{className:`w-20 h-20 bg-surface-container-highest rounded-3xl flex items-center justify-center text-on-surface-variant/20 mx-auto border border-outline-variant/10 shadow-xl`,children:(0,A.jsx)(f,{size:40})}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`h2`,{className:`text-2xl font-black font-headline text-white tracking-tight`,children:`No Active Projects Found`}),(0,A.jsx)(`p`,{className:`text-on-surface-variant text-sm leading-relaxed`,children:`Temporal orchestration requires an active project. Create or select a project from the sidebar to manage recurrent tasks.`})]})]})})};export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CfaHPvi0.js";import{r as n}from"./vendor-markdown-DoJbQ1of.js";import{t as r}from"./client-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CfaHPvi0.js";import{r as n}from"./vendor-markdown-DoJbQ1of.js";import{t as r}from"./client-B553SX3l.js";import{t as i}from"./activity-B_2QSywM.js";import{n as a,t as o}from"./terminal-B6iyNuAm.js";import{t as s}from"./cpu-C2_GFeSH.js";import{t as c}from"./refresh-cw-BgDsJOC_.js";import{t as l}from"./save-Cmqi1IkN.js";import{t as u}from"./useNotification-DQayTSUL.js";var d=e(t(),1),f=async()=>{let{data:e}=await r.get(`/system-settings`);return e},p=async e=>{let{data:t}=await r.patch(`/system-settings`,e);return t},m=n(),h=()=>{let[e,t]=(0,d.useState)(null),[n,r]=(0,d.useState)(!0),[h,g]=(0,d.useState)(!1),{notifySuccess:_,notifyApiError:v,notifyInfo:y}=u();(0,d.useEffect)(()=>{(async()=>{try{t(await f())}catch(e){v(e,`Failed to load settings`)}finally{r(!1)}})()},[v]);let b=async()=>{if(e){g(!0);try{await p(e),_(`Settings committed`,`Configuration synchronized with central orchestrator.`)}catch(e){v(e,`Commit failed`)}finally{g(!1)}}},x=(0,d.useMemo)(()=>{if(!e)return{};let t={},n=e.data.taskScheduler,r=e.data.recurrentTasksScheduler;return(!n.pollIntervalInMs||n.pollIntervalInMs<1e4)&&(t[`ts.poll`]=`Minimum 10 000 ms`),(!n.maxTaskPerExecution||n.maxTaskPerExecution<1||n.maxTaskPerExecution>15)&&(t[`ts.max`]=`Must be between 1 and 15`),(!r.pollIntervalInMs||r.pollIntervalInMs<15e3)&&(t[`rs.poll`]=`Minimum 15 000 ms`),(!r.executionTimeout||r.executionTimeout<6e4)&&(t[`rs.timeout`]=`Minimum 60 000 ms`),(!r.maxActiveTasks||r.maxActiveTasks<1||r.maxActiveTasks>5)&&(t[`rs.max`]=`Must be between 1 and 5`),t},[e]),S=Object.keys(x).length>0,C=async()=>{r(!0);try{t(await f()),y(`Changes aborted`,`Configuration reloaded from the last known state.`)}catch{}finally{r(!1)}},w=(n,r)=>{e&&t({...e,data:{...e.data,taskScheduler:{...e.data.taskScheduler,[n]:r}}})},T=(n,r)=>{e&&t({...e,data:{...e.data,recurrentTasksScheduler:{...e.data.recurrentTasksScheduler,[n]:r}}})};return n?(0,m.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,m.jsx)(`div`,{className:`w-8 h-8 rounded-full border-4 border-outline-variant/30 border-t-primary animate-spin`})}):e?(0,m.jsxs)(`div`,{className:`flex flex-col h-full font-mono text-on-surface`,children:[(0,m.jsxs)(`div`,{className:`flex justify-between items-center mb-10 border-b border-outline-variant/10 pb-6`,children:[(0,m.jsxs)(`div`,{className:`border-l-2 border-primary/40 pl-6`,children:[(0,m.jsx)(`h2`,{className:`text-2xl font-bold text-on-surface mb-1`,children:`Developer Configuration Terminal`}),(0,m.jsxs)(`p`,{className:`text-on-surface-variant text-sm flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full bg-secondary animate-pulse`}),`Direct access to system scheduling and processing parameters.`]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,m.jsxs)(`button`,{onClick:C,className:`text-on-surface-variant text-[11px] hover:text-on-surface transition-colors px-3 py-1 flex items-center gap-2`,children:[(0,m.jsx)(a,{size:14}),` ABORT_CHANGES`]}),(0,m.jsxs)(`button`,{onClick:b,disabled:h||S,className:`bg-primary/10 border border-primary/40 text-primary text-[11px] font-bold px-4 py-1 hover:bg-primary/20 transition-all flex items-center gap-2 disabled:opacity-40 disabled:cursor-not-allowed`,children:[h?(0,m.jsx)(i,{size:14,className:`animate-spin`}):(0,m.jsx)(l,{size:14}),`COMMIT --PUSH`]})]})]}),(0,m.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-4 gap-8 flex-1 overflow-y-auto pr-2 custom-scrollbar pb-24`,children:[(0,m.jsx)(`aside`,{className:`lg:col-span-1 border-r border-outline-variant/10 pr-4 hidden lg:flex flex-col gap-1`,children:(0,m.jsxs)(`nav`,{className:`space-y-0.5`,children:[(0,m.jsxs)(`button`,{className:`w-full flex items-center gap-2 py-1.5 px-3 bg-primary/5 text-primary border-r-2 border-primary text-left`,children:[(0,m.jsx)(o,{size:14}),(0,m.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-tight`,children:`Scheduler`})]}),(0,m.jsxs)(`button`,{className:`w-full flex items-center gap-2 py-1.5 px-3 text-on-surface-variant hover:text-on-surface hover:bg-surface-container transition-all text-left`,children:[(0,m.jsx)(c,{size:14}),(0,m.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-tight`,children:`Recurrent`})]})]})}),(0,m.jsxs)(`div`,{className:`lg:col-span-3 space-y-12`,children:[(0,m.jsxs)(`section`,{children:[(0,m.jsxs)(`div`,{className:`font-mono text-xs font-bold text-primary mb-4 border-b border-outline-variant/20 pb-1 flex items-center gap-2 uppercase tracking-wider`,children:[(0,m.jsx)(s,{size:14}),` 01. TASK_SCHEDULER_CONFIG`]}),(0,m.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-6 bg-surface-container-low/30 p-6 border border-outline-variant/10`,children:[(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsxs)(`label`,{className:`block font-mono text-[11px] text-on-surface-variant/80 uppercase tracking-wider mb-1`,children:[`Poll Interval (ms) `,(0,m.jsx)(`span`,{className:`text-outline normal-case`,children:`min 10 000`})]}),(0,m.jsx)(`input`,{type:`number`,min:1e4,value:e.data.taskScheduler.pollIntervalInMs,onChange:e=>w(`pollIntervalInMs`,parseInt(e.target.value)),className:`w-full bg-surface-container-lowest border px-3 py-1.5 text-secondary font-mono text-sm focus:ring-0 outline-none transition-colors ${x[`ts.poll`]?`border-error`:`border-outline-variant/30 focus:border-primary`}`}),x[`ts.poll`]&&(0,m.jsx)(`p`,{className:`text-error text-[10px] mt-1`,children:x[`ts.poll`]})]}),(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsxs)(`label`,{className:`block font-mono text-[11px] text-on-surface-variant/80 uppercase tracking-wider mb-1`,children:[`Max Tasks Per Execution `,(0,m.jsx)(`span`,{className:`text-outline normal-case`,children:`1 – 15`})]}),(0,m.jsx)(`input`,{type:`number`,min:1,max:15,value:e.data.taskScheduler.maxTaskPerExecution,onChange:e=>w(`maxTaskPerExecution`,parseInt(e.target.value)),className:`w-full bg-surface-container-lowest border px-3 py-1.5 text-secondary font-mono text-sm focus:ring-0 outline-none transition-colors ${x[`ts.max`]?`border-error`:`border-outline-variant/30 focus:border-primary`}`}),x[`ts.max`]&&(0,m.jsx)(`p`,{className:`text-error text-[10px] mt-1`,children:x[`ts.max`]})]})]})]}),(0,m.jsxs)(`section`,{children:[(0,m.jsxs)(`div`,{className:`font-mono text-xs font-bold text-primary mb-4 border-b border-outline-variant/20 pb-1 flex items-center gap-2 uppercase tracking-wider`,children:[(0,m.jsx)(c,{size:14}),` 02. RECURRENT_TASKS_SCHEDULER_CONFIG`]}),(0,m.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-6 bg-surface-container-low/30 p-6 border border-outline-variant/10`,children:[(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsxs)(`label`,{className:`block font-mono text-[11px] text-on-surface-variant/80 uppercase tracking-wider mb-1`,children:[`Poll Interval (ms) `,(0,m.jsx)(`span`,{className:`text-outline normal-case`,children:`min 15 000`})]}),(0,m.jsx)(`input`,{type:`number`,min:15e3,value:e.data.recurrentTasksScheduler.pollIntervalInMs,onChange:e=>T(`pollIntervalInMs`,parseInt(e.target.value)),className:`w-full bg-surface-container-lowest border px-3 py-1.5 text-secondary font-mono text-sm focus:ring-0 outline-none transition-colors ${x[`rs.poll`]?`border-error`:`border-outline-variant/30 focus:border-primary`}`}),x[`rs.poll`]&&(0,m.jsx)(`p`,{className:`text-error text-[10px] mt-1`,children:x[`rs.poll`]})]}),(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsxs)(`label`,{className:`block font-mono text-[11px] text-on-surface-variant/80 uppercase tracking-wider mb-1`,children:[`Execution Timeout (ms) `,(0,m.jsx)(`span`,{className:`text-outline normal-case`,children:`min 60 000`})]}),(0,m.jsx)(`input`,{type:`number`,min:6e4,value:e.data.recurrentTasksScheduler.executionTimeout,onChange:e=>T(`executionTimeout`,parseInt(e.target.value)),className:`w-full bg-surface-container-lowest border px-3 py-1.5 text-secondary font-mono text-sm focus:ring-0 outline-none transition-colors ${x[`rs.timeout`]?`border-error`:`border-outline-variant/30 focus:border-primary`}`}),x[`rs.timeout`]&&(0,m.jsx)(`p`,{className:`text-error text-[10px] mt-1`,children:x[`rs.timeout`]})]}),(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsxs)(`label`,{className:`block font-mono text-[11px] text-on-surface-variant/80 uppercase tracking-wider mb-1`,children:[`Max Active Tasks `,(0,m.jsx)(`span`,{className:`text-outline normal-case`,children:`1 – 5`})]}),(0,m.jsx)(`input`,{type:`number`,min:1,max:5,value:e.data.recurrentTasksScheduler.maxActiveTasks,onChange:e=>T(`maxActiveTasks`,parseInt(e.target.value)),className:`w-full bg-surface-container-lowest border border-outline-variant/30 px-3 py-1.5 text-secondary font-mono text-sm focus:border-primary focus:ring-0 outline-none transition-colors`})]})]})]})]})]})]}):null};export{h as default};
|