import{j as i}from"./vendor-react-wBh_31cN.js";import{C as p,a as l,b as d,c as u}from"./card-DISTA6Ay.js";import{a7 as g,a4 as s,aT as c,aQ as h,$ as C,aq as f,G as R,g as j,r as x}from"./index-BKr2rJhV.js";import{R as v}from"./RoleChainingTable-gr9BUBFB.js";import{N as y}from"./NoData-jkjqmCYT.js";import{E as T}from"./Error404-B4n3go6x.js";import{u as A}from"./index-DIGQ-MZU.js";import{u as L,c as N}from"./vendor-router-D1GqFWiT.js";import"./vendor-redux-CJZrIb6x.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-icons-BUUmD6ht.js";import"./vendor-radix-BRyWS4bQ.js";import"./vendor-grid-CeFlDWv4.js";import"./table-CQMBoaty.js";import"./icon-button-FETOk6q1.js";import"./input-H6_qmzms.js";import"./label-Dnebucx5.js";import"./combobox-CcK1PxyF.js";import"./input-group-Z3Qmt3PL.js";import"./textarea-Co48BFy3.js";import"./vendor-recharts-DmJlpLaF.js";import"./tooltip-Da8-EbK8.js";import"./confirmation-dialog-DFt7ZgUQ.js";import"./useCopyToClipboard-3DFwhniW.js";import"./useNotifier-BCEAoFCf.js";import"./notifications-x-pTFTQl.js";import"./toast-3g7Fh-a0.js";import"./useProjectOptions-C17r5Psb.js";import"./project-eQY1xQe-.js";import"./index-DQr7YlUK.js";import"./Error-ehOSFm_s.js";import"./useLastProject-CDGr1y3w.js";import"./useSortedProjects-B0vFqd_s.js";import"./index-BeaoFlb1.js";import"./apply-BmJxqxKH.js";import"./concat-AxOj0lUI.js";import"./sortBy-DS9fyPwj.js";import"./juxt-BvCFisbd.js";import"./converge-BDz-h6lA.js";import"./includes-D04d5Ytc.js";const I=g.injectEndpoints({endpoints:a=>({getRoleChainingList:a.query({query:({id:t})=>({url:`/project/${t}/cloud/role-mappings?sort_by=ID`}),providesTags:h.providesList(s.IAMRoleChainingTags.RoleChainingList),transformResponse:t=>t.count>0?t.items:[]}),updateRoleChainingDefault:a.mutation({query:({projectId:t,id:o,defaultRole:e})=>{const r=c.stringify({defaultRole:e});return{url:`/project/${t}/cloud/role-mappings/${o}?${r}`,method:"put"}},invalidatesTags:(t,o)=>[{type:s.IAMRoleChainingTags.RoleChainingAdminList},{type:s.IAMRoleChainingTags.RoleChainingList}]})})}),{useGetRoleChainingListQuery:M,useUpdateRoleChainingDefaultMutation:hi}=I,Ci=()=>{const a=L(),{id:t}=N(),{data:o,isLoading:e}=A(),{data:r=[],isLoading:n}=M({id:+t}),{isAdmin:m}=C();return n||e?i.jsx(f,{}):o!=null&&o.enabled?i.jsxs(p,{className:"max-h-[calc(100vh-215px)] overflow-hidden",children:[i.jsx(l,{children:i.jsx(d,{children:"IAM Role Chaining"})}),i.jsxs(u,{className:"overflow-auto",children:[i.jsx("div",{className:"mb-7 flex flex-row",children:m&&i.jsx(R,{variant:"outline",size:"sm",onClick:()=>{a(j(x.settings.iamRoleChaining.list))},children:"edit cloud role ->"})}),r&&r.length>0?i.jsx(v,{roleChaining:r,isEditable:!1}):i.jsx("div",{className:"my-10",children:i.jsx(y,{mainText:"No IAM Role Chaining found"})})]})]}):i.jsx(T,{})};export{Ci as default};
