import{X as T,a5 as e,bs as Q,j as a,ad as f,ag as x,V as i,aK as D}from"./index-BLPf7Sv2.js";import{c as E}from"./translations-DLkuGKH9.js";import{Q as h}from"./QuickCommandPageComponent-DQ8L4n04.js";import"./group-dependencies-BgeQQUVP.js";import"./Card-DFtwQktq.js";import"./SimpleContentCard-wrVQJKJ3.js";import"./index-wJwwhEKX.js";import"./index-BacxzzK3.js";import"./ButtonLoading-C_pMAVqs.js";import"./VersionSelectorBox-C3N1pEqJ.js";import"./use-quick-command-permissions-B2MgwoXX.js";import"./use-verify-role-JQP7A3Dh.js";import"./index-BAxBj6P1.js";import"./index-BSN6SOsA.js";import"./index-DJ3d-9TM.js";import"./index-D0RvMFKy.js";import"./index-DbFmShiq.js";import"./copy-to-clipboard-Cbwjbe3Z.js";const z=({route:r,params:t})=>{const n=T("codeBuddyTranslations",E),o=t.quickCommandSlug||"",[s,d,m]=e.quickCommand.useStatefulQuery({slug:o}),[c,l]=e.deleteQuickCommand.useAllowed({slug:o}),[u,p]=e.deleteQuickCommand.useMutation(),g=async C=>{if(C){i.showToaster({type:"error",title:n.codeBuddyTranslations.dependenciesErrorTitle,message:n.codeBuddyTranslations.dependenciesErrorSubTitle});return}try{await u({slug:o}),e.allQuickCommandsV3.invalidate(),e.contentDependencies.invalidate(),r.$parent.$go()}catch(k){e.contentDependencies.invalidate();const y=D({error:k,prefix:n.codeBuddyTranslations.couldNotDeleteQuickCommand});i.showToaster({type:"error",message:y})}};return Q(s?.name),a.jsx(f,{children:a.jsx(x,{loading:d||l,error:m,children:a.jsx(h,{quickCommandSlug:o,tabIndex:t.tabIndex,route:r,id:t.id,onDelete:g,canDelete:c,isDeleting:p})})})};export{z as QuickCommandPage};