PageSourceSearch

https://zop.dev/zopnight/app/assets/ResourceGroupsPage-EUSw0FGv.js

js zop.dev collected 2026-10-03 19:47:30 UTC 21,365 bytes, 1 lines download raw bytes

1import{u as Ne,r as n,f as Ce,j as e}from"./react-vendor-xjz46aeH.js";import{m as xe,j as F,B as y,E as Se,D as ce,F as _,N as de,M as ke,U as ue,P as H,k as S}from"./index-DB-GErVi.js";import{E as Ee}from"./ExecutionPlanPreview-CmHOE78J.js";import{C as Pe}from"./CardGridSkeleton-3iHR7401.js";import{T as Ae}from"./TableSkeleton-C9Pu8LvF.js";import{E as De}from"./ErrorState-DlvwccLP.js";import{P as Re}from"./PageHeader-BdDybfPf.js";import{S as Le}from"./SearchInput-COn497_X.js";import{C as Ge}from"./ConfirmDialog-DH3ybaP-.js";import{P as _e}from"./Pagination-CrLnsmAm.js";import{a as Me,b as Ie}from"./useGroups-CnQVitgV.js";import{a as Be}from"./useBudgets-CyUPUhEC.js";import{u as Ue,a as Oe,b as ze}from"./useGroupMutations-BUzwT5Kq.js";import{b as $e}from"./useBulkResourceActions-CwCGommZ.js";import{c as Te}from"./TypeToConfirmInput-PzKwsIrP.js";import{C as me}from"./CurrencyValue-CxMJfgrF.js";import{u as We}from"./usePaginationParams-DbdleRB1.js";import{u as Ve}from"./useDebouncedValue-BGg0Nx9L.js";import{u as Ze}from"./useSchedules-CuIxbL-Q.js";import{S as qe}from"./SearchableSelect-DyTTeEMu.js";import{i as Fe}from"./formDirty-BcOfVH4k.js";import"./tanstack-vendor-CK-H18W-.js";import"./sentry-vendor-B7Zxq--p.js";import"./CostInfoBanner-DabANHFh.js";import"./actionFailure-B9bV-6re.js";import"./useCopyToClipboard-D3JgiyXp.js";import"./index-DctxNkkm.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r.SENTRY_RELEASE={id:"53c0c37b9d0458a05694e8ed0430da9c4ec6eaca"};var p=new r.Error().stack;p&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[p]="4641ce64-ec7e-4a2d-be26-7a1e58946b8c",r._sentryDebugIdIdentifier="sentry-dbid-4641ce64-ec7e-4a2d-be26-7a1e58946b8c")}catch{}})();const He=[{value:"cards",label:"Cards",icon:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e.jsx("rect",{x:"1.5",y:"1.5",width:"5.5",height:"5.5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("rect",{x:"9",y:"1.5",width:"5.5",height:"5.5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("rect",{x:"1.5",y:"9",width:"5.5",height:"5.5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("rect",{x:"9",y:"9",width:"5.5",height:"5.5",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})},{value:"list",label:"List",icon:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M2 4h12M2 8h12M2 12h12",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})})}];function R({active:r,direction:p}){return r?e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"inline ml-1 text-primary-500",children:p==="asc"?e.jsx("path",{d:"M12 19V5M5 12l7-7 7 7"}):e.jsx("path",{d:"M12 5v14M5 12l7 7 7-7"})}):e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"inline ml-1 text-text-muted opacity-40",children:e.jsx("path",{d:"M12 5v14M5 12l7 7 7-7"})})}function Ye({groups:r,onNavigate:p,onEdit:v,onDelete:w,canEdit:u,canDelete:f,fmtRelativeDate:g,groupScheduleMap:h}){const[o,N]=n.useState(null),[m,j]=n.useState("asc"),i=s=>{o===s?j(a=>a==="asc"?"desc":"asc"):(N(s),j("asc"))},b=n.useMemo(()=>o?[...r].sort((s,a)=>{let l=0;return o==="name"?l=(s.name??"").localeCompare(a.name??""):o==="attached"?l=(s.members?.length??0)-(a.members?.length??0):o==="schedule"?l=(h[s.id]??"").localeCompare(h[a.id]??""):o==="created"?l=new Date(s.createdAt??0)-new Date(a.createdAt??0):o==="updated"&&(l=new Date(s.updatedAt??0)-new Date(a.updatedAt??0)),m==="asc"?l:-l}):r,[r,o,m,h]);return e.jsx("div",{className:"overflow-x-auto rounded-xl shadow-card",children:e.jsxs("table",{className:"w-full",children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:"24%"}}),e.jsx("col",{style:{width:"16%"}}),e.jsx("col",{style:{width:"16%"}}),e.jsx("col",{style:{width:"16%"}}),e.jsx("col",{style:{width:"16%"}}),e.jsx("col",{style:{width:"12%"}})]}),e.jsx("thead",{children:e.jsxs("tr",{className:"bg-surface-secondary",children:[e.jsxs("th",{className:"text-left px-5 py-3 text-xs font-semibold text-text-muted cursor-pointer select-none",onClick:()=>i("name"),children:["Name ",e.jsx(R,{active:o==="name",direction:m})]}),e.jsxs("th",{className:"text-left px-5 py-3 text-xs font-semibold text-text-muted cursor-pointer select-none",onClick:()=>i("attached"),children:["Resources ",e.jsx(R,{active:o==="attached",direction:m})]}),e.jsxs("th",{className:"text-left px-5 py-3 text-xs font-semibold text-text-muted cursor-pointer select-none",onClick:()=>i("schedule"),children:["Schedule ",e.jsx(R,{active:o==="schedule",direction:m})]}),e.jsxs("th",{className:"text-left px-5 py-3 text-xs font-semibold text-text-muted cursor-pointer select-none",onClick:()=>
1i("created"),children:["Created At ",e.jsx(R,{active:o==="created",direction:m})]}),e.jsxs("th",{className:"text-left px-5 py-3 text-xs font-semibold text-text-muted cursor-pointer select-none",onClick:()=>i("updated"),children:["Updated At ",e.jsx(R,{active:o==="updated",direction:m})]}),e.jsx("th",{className:"text-right px-5 py-3 text-xs font-semibold text-text-muted",children:"Actions"})]})}),e.jsx("tbody",{className:"bg-surface divide-y divide-border",children:b.map(s=>{const a=s.members?.length??0,l=!!h[s.id];return e.jsxs("tr",{onClick:()=>p(s),className:"hover:bg-surface-tertiary transition-colors duration-fast cursor-pointer",children:[e.jsxs("td",{className:"px-5 py-3 text-sm text-text-primary max-w-[280px]",children:[e.jsx(S,{content:s.name,placement:"top",children:e.jsx("span",{className:"block font-medium truncate",children:s.name})}),s.description&&e.jsx(S,{content:s.description,placement:"top",children:e.jsx("span",{className:"block text-xs text-text-muted truncate",children:s.description})})]}),e.jsx("td",{className:"px-5 py-3 text-sm text-text-secondary",children:a===0?"—":`${a} resource${a===1?"":"s"}`}),e.jsx("td",{className:"px-5 py-3 text-sm max-w-[180px]",children:l?e.jsx(S,{content:h[s.id],placement:"top",children:e.jsx("span",{className:"block text-text-primary truncate",children:h[s.id]})}):e.jsx("span",{className:"text-text-muted",children:"—"})}),e.jsx("td",{className:"px-5 py-3 text-sm text-text-muted whitespace-nowrap",children:s.createdAt?g(s.createdAt):"—"}),e.jsx("td",{className:"px-5 py-3 text-sm text-text-muted whitespace-nowrap",children:s.updatedAt?g(s.updatedAt):"—"}),e.jsx("td",{className:"px-5 py-3 text-right whitespace-nowrap",onClick:C=>C.stopPropagation(),children:e.jsxs("div",{className:"inline-flex items-center gap-1",children:[e.jsx(S,{content:u?"Edit":"You don't have permission.",wrapDisabled:!u,children:e.jsx("button",{type:"button",disabled:!u,onClick:()=>u&&v(s),"aria-label":"Edit group",className:`p-1.5 rounded-md transition-colors ${u?"text-text-muted hover:text-primary-600 hover:bg-surface-tertiary":"text-text-muted/40 cursor-not-allowed"}`,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.8,stroke:"currentColor",className:"h-4 w-4",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"})})})}),e.jsx(S,{content:f?"Delete":"You don't have permission.",wrapDisabled:!f,children:e.jsx("button",{type:"button",disabled:!f,onClick:()=>f&&w(s),"aria-label":"Delete group",className:`p-1.5 rounded-md transition-colors ${f?"text-text-muted hover:text-danger-500 hover:bg-surface-tertiary":"text-text-muted/40 cursor-not-allowed"}`,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.8,stroke:"currentColor",className:"h-4 w-4",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})})})]})})]},s.id)})})]})})}const Je=e.jsx("svg",{className:"w-4 h-4 text-warning-500",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),Ke=e.jsx("svg",{className:"w-4 h-4 text-danger-500",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.16
17 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})});function Qe({group:r,onClick:p,onEdit:v,onDelete:w,onStartAll:u,onStopAll:f,canEdit:g,canRemove:h,budget:o}){const{fmtCurrency:N,fmtRelativeDate:m}=xe(),[j,i]=n.useState(!1),b=n.useRef(null);n.useEffect(()=>{if(!j)return;const a=l=>{b.current&&!b.current.contains(l.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[j]);const s=r.members?.length??0;return e.jsxs("div",{className:"border rounded-xl bg-surface shadow-card transition-all duration-normal cursor-pointer hover:shadow-card-hover border-border-strong border-t-2 border-t-primary-600 relative flex flex-col",onClick:()=>p(r),children:[e.jsxs("div",{className:"p-4 flex-1",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("h3",{className:"font-medium text-text-primary truncate",children:r.name})}),e.jsxs("div",{ref:b,className:"relative",children:[e.jsx("button",{onClick:a=>{a.stopPropagation(),i(l=>!l)},className:"p-1 rounded-md hover:bg-surface-elevated transition-colors duration-fast text-text-muted hover:text-text-primary",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z"})})}),j&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 w-32 bg-surface border border-border-strong rounded-lg shadow-lg z-10 py-1",children:[g&&e.jsx("button",{onClick:a=>{a.stopPropagation(),i(!1),u(r)},className:"w-full text-left px-3 py-1.5 text-sm text-text-primary hover:bg-surface-elevated transition-colors duration-fast",children:"Start All"}),g&&e.jsx("button",{onClick:a=>{a.stopPropagation(),i(!1),f(r)},className:"w-full text-left px-3 py-1.5 text-sm text-text-primary hover:bg-surface-elevated transition-colors duration-fast",children:"Stop All"}),g&&e.jsx("button",{onClick:a=>{a.stopPropagation(),i(!1),v(r)},className:"w-full text-left px-3 py-1.5 text-sm text-text-primary hover:bg-surface-elevated transition-colors duration-fast",children:"Edit"}),h&&e.jsx("button",{onClick:a=>{a.stopPropagation(),i(!1),w(r)},className:"w-full text-left px-3 py-1.5 text-sm text-danger-500 hover:bg-surface-elevated transition-colors duration-fast",children:"Delete"})]})]})]}),r.description&&e.jsx(S,{content:r.description,onlyOnOverflow:!0,children:e.jsx("p",{className:"text-sm text-text-secondary mt-1 line-clamp-2",children:r.description})}),s>0&&e.jsx("div",{className:"flex items-center gap-1.5 mt-3",children:e.jsxs("div",{className:"flex -space-x-1",children:[Array.from({length:Math.min(s,5)}).map((a,l)=>e.jsx("div",{className:"w-5 h-5 rounded-full bg-primary-100 border-2 border-surface flex items-center justify-center",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-3 h-3 text-primary-600",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 14.25h13.5m-13.5 0a3 3 0 0 1-3-3m3 3a3 3 0 1 0 0 6h13.5a3 3 0 0 0 0-6m-16.5-3a3 3 0 0 1 3-3h13.5a3 3 0 0 1 3 3m-19.5 0a4.5 4.5 0 0 1 .9-2.7L5.737 5.1a3.375 3.375 0 0 1 2.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 0 1 .9 2.7m0 0a3 3 0 0 1-3 3m0 3h.008v.008h-.008v-.008Zm0-6h.008v.008h-.008v-.008Zm-3 6h.008v.008h-.008v-.008Zm0-6h.008v.008h-.008v-.008Z"})})},`${r.id}-member-${l}`)),s>5&&e.jsx("div",{className:"h-5 min-w-5 px-1 rounded-full bg-surface-tertiary border-2 border-surface flex items-center justify-center",children:e.jsxs("span",{className:"text-[9px] font-semibold text-text-muted leading-none",children:["+",s-5]})})]})})]}),e.jsxs("div",{className:"border-t border-border px-4 py-2.5 flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium bg-primary-50 text-primary-700",children:[s," ",s===1?"RESOURCE":"RESOURCES"]}),o&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs",children:[o.status==="red"&&Ke,o.status==="yellow"&&Je,e.
1jsxs("span",{className:`font-medium ${o.status==="red"?"text-danger-500":o.status==="yellow"?"text-warning-500":"text-text-muted"}`,children:[e.jsx(me,{usd:o.currentSpendUsd??0,compact:!0})," /"," ",e.jsx(me,{usd:o.monthlyBudgetUsd,compact:!0})]})]}),r.updatedAt&&e.jsxs("span",{className:"text-xs text-text-muted",children:["Updated ",m(r.updatedAt)]})]})]})}function kt(){const r=Ne(),{fmtRelativeDate:p}=xe(),{page:v,pageSize:w,setPage:u,setPageSize:f}=We({defaultPageSize:12}),[g,h]=n.useState(""),o=Ve(g,300),[N,m]=n.useState(()=>{try{return localStorage.getItem("zn_groups_view")||"cards"}catch{return"cards"}}),j=t=>{m(t);try{localStorage.setItem("zn_groups_view",t)}catch{}},{data:i,isLoading:b,isError:s,error:a,refetch:l}=Me({page:v,limit:w,search:o}),C=Array.isArray(i)?i:i?.items??[],pe=Array.isArray(i)?!1:i?.hasMore??!1,{data:he=0}=Ie({search:o}),{data:M=[]}=Be(),fe=n.useMemo(()=>{const t={},c=Array.isArray(M)?M:[];for(const x of c)x.resourceGroupId&&(t[x.resourceGroupId]=x);return t},[M]),{data:Y=[]}=Ze(),[L,ge]=n.useState(""),k=n.useMemo(()=>{const t={};for(const c of Y)for(const x of c.groups??[])(x.groupId||x.id)&&(t[x.groupId||x.id]=c.name);return t},[Y]),je=n.useMemo(()=>{const t=new Set(Object.values(k));return[{value:"__none__",label:"No Schedule"},...Array.from(t).sort().map(c=>({value:c,label:c}))]},[k]),I=n.useMemo(()=>{if(!L)return C;const t=L.split(",").filter(Boolean);if(t.length===0)return C;const c=t.includes("__none__"),x=new Set(t.filter(q=>q!=="__none__"));return C.filter(q=>{const le=k[q.id];return!!(c&&!le||x.size>0&&x.has(le))})},[C,L,k]),B=Ue(),J=Oe(),U=ze(),O=$e(),z=F(H.RESOURCE_GROUP_CREATE),K=F(H.RESOURCE_GROUP_UPDATE),Q=F(H.RESOURCE_GROUP_DELETE),[ve,E]=n.useState(!1),[$,X]=Ce();n.useEffect(()=>{if($.get("new")!=="1")return;z&&E(!0);const t=new URLSearchParams($);t.delete("new"),X(t,{replace:!0})},[$,z,X]);const[T,W]=n.useState(null),[d,P]=n.useState(null),[V,ee]=n.useState(""),[te,se]=n.useState(""),[A,D]=n.useState(null),[G,re]=n.useState(""),[Z,ae]=n.useState(""),be=t=>{t.preventDefault(),B.mutate({name:V,description:te},{onSuccess:()=>{E(!1),ee(""),se("")}})},oe=n.useCallback(t=>{D(t),re(t.name),ae(t.description??"")},[]),ne=!!A&&Fe({name:A.name,description:A.description??""},{name:G,description:Z}),ye=t=>{if(t.preventDefault(),ne){D(null);return}U.mutate({id:A.id,name:G,description:Z},{onSuccess:()=>D(null)})},ie=n.useCallback(t=>{W(t)},[]),we=Te(T);return e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx(Re,{title:"Resource Groups",action:z&&e.jsx(y,{onClick:()=>E(!0),children:"+ Create Group"})}),e.jsxs("div",{className:"mb-4 flex flex-wrap items-center gap-x-3 gap-y-2 bg-surface-secondary rounded-lg px-3 py-2.5 border border-border",children:[e.jsx(Le,{placeholder:"Search groups...",value:g,onChange:t=>{h(t),u(1)},size:"sm",className:"w-full sm:max-w-xs"}),e.jsx("span",{className:"hidden sm:block w-px h-5 bg-border-strong"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-medium text-text-muted shrink-0",children:"Schedule"}),e.jsx(qe,{options:je,value:L,onChange:t=>{ge(t.target.value),u(1)},placeholder:"All Schedules",size:"sm",className:"w-44",multi:!0})]}),e.jsx("div",{className:"ml-auto inline-flex items-stretch rounded-lg border border-border-strong overflow-hidden",children:He.map(t=>e.jsx("button",{type:"button",onClick:()=>j(t.value),"aria-label":`${t.label} view`,title:`${t.label} view`,className:`flex items-center px-2.5 py-1.5 transition-all duration-fast ${N===t.value?"bg-text-primary text-text-inverse":"bg-surface-secondary text-text-secondary hover:text-text-primary hover:bg-surface-tertiary"}`,children:t.icon},t.value))})]}),b?N==="list"?e.jsx(Ae,{cols:5}):e.jsx(Pe,{count:6}):s?e.jsx(De,{title:"Failed to load resource groups",error:a,onRetry:l,resource:"resource groups"}):I.length===0?e.jsx(Se,{message:o?`No groups matching "${o}".`:"No resource groups yet."}):e.jsxs("div",{className:"flex-1 flex flex-col",children:[N==="list"?e.jsx(Ye,{groups:I,onNavigate:t=>r(`/resource-groups/${t.id}`),onEdit:oe,onDelete:ie,canEdit:K,canDelete:Q,fmtRelativeDate:p,groupScheduleMap:k}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:I.map(t=>e.jsx(Qe,{group:t,onClick:c=>r(`/resource-groups/${c.id}`),onEdit:oe,onDelete:ie,onStartAll:c=>P({group:c,type:"start"}),onStopAll:c=>P({group:c,type:"stop"}),canEdit:K,canRemove:Q,budget:fe[t.id]},t.id))}),e.jsx("div",{className:"mt-auto",children:e.jsx(_e,{page:v,hasMore:pe,total:he,label:"groups",onPageChange:u,pageSize:w,onPageSizeChange:f,pageSizeOptions:[12,24,48]}
1)})]}),e.jsx(ce,{open:ve,onClose:()=>E(!1),title:"Create Resource Group",footer:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(y,{type:"submit",form:"create-group-form",disabled:B.isPending||!V.trim(),children:B.isPending?"Creating...":"Create"}),e.jsx(y,{variant:"secondary",onClick:()=>E(!1),children:"Cancel"})]}),children:e.jsxs("form",{id:"create-group-form",onSubmit:be,className:"space-y-6",children:[e.jsx(_,{label:"Name",required:!0,children:e.jsx(de,{type:"text",placeholder:"Group name",value:V,onChange:t=>ee(t.target.value),required:!0})}),e.jsx(_,{label:"Description",children:e.jsx("textarea",{placeholder:"Description (optional)",value:te,onChange:t=>se(t.target.value),rows:5,className:"w-full px-3 py-2 bg-surface-tertiary border border-border-strong rounded-lg text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary-600/30 focus:border-primary-600/40 transition-all duration-fast resize-none"})})]})}),e.jsx(ce,{open:!!A,onClose:()=>D(null),title:"Edit Resource Group",footer:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(y,{type:"submit",form:"edit-group-form",disabled:U.isPending||!G.trim()||ne,children:U.isPending?"Updating...":"Update"}),e.jsx(y,{variant:"secondary",onClick:()=>D(null),children:"Cancel"})]}),children:e.jsxs("form",{id:"edit-group-form",onSubmit:ye,className:"space-y-6",children:[e.jsx(_,{label:"Name",required:!0,children:e.jsx(de,{type:"text",placeholder:"Group name",value:G,onChange:t=>re(t.target.value),required:!0})}),e.jsx(_,{label:"Description",children:e.jsx("textarea",{placeholder:"Description (optional)",value:Z,onChange:t=>ae(t.target.value),rows:5,className:"w-full px-3 py-2 bg-surface-tertiary border border-border-strong rounded-lg text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary-600/30 focus:border-primary-600/40 transition-all duration-fast resize-none"})})]})}),e.jsxs(ke,{open:!!d,onClose:()=>P(null),title:`${d?.type==="start"?"Start":"Stop"} All Resources`,widthClass:ue()?"max-w-2xl":void 0,children:[e.jsxs("p",{className:"text-sm text-text-secondary mb-4",children:["Are you sure you want to ",d?.type," all resources in"," ",e.jsx("strong",{children:d?.group?.name}),"?"]}),ue()&&d&&e.jsx("div",{className:"mb-4",children:e.jsx(Ee,{groupId:d.group?.id,action:d.type})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(y,{variant:d?.type==="stop"?"delete":"primary",disabled:O.isPending,onClick:()=>{O.mutate({type:d.type,groupId:d.group.id,groupName:d.group.name},{onSuccess:()=>P(null)})},children:O.isPending?`${d?.type==="start"?"Starting":"Stopping"}...`:`${d?.type==="start"?"Start":"Stop"} All`}),e.jsx(y,{variant:"secondary",onClick:()=>P(null),children:"Cancel"})]})]}),e.jsx(Ge,{open:!!T,onClose:()=>W(null),onConfirm:()=>{J.mutate(T.id,{onSuccess:()=>W(null)})},title:"Delete Group",message:"This action cannot be undone.",confirmLabel:"Delete",loadingLabel:"Deleting...",variant:"delete",isLoading:J.isPending,typeToConfirm:we,requireTypeToConfirm:!0})]})}export{kt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.