import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{ft as t}from"./vendor-primevue-DGevbYGF.js";import"./vendor-firebase-yTFzdAQf.js";import{F as n,I as r,O as i,R as a,Ut as o,_t as s,et as c,j as l,kt as u}from"./vendor-vue-core-BdhYaYlO.js";import"./vendor-other-D9HJWI2D.js";import"./useFeatureFlags-DLStzqlx.js";import"./api-C1WIrB4Z.js";import"./vendor-markdown-th9BvURy.js";import"./colorUtil-DJbZtU1U.js";import{n as d}from"./vendor-i18n-JubCsGQ_.js";import"./i18n-DKtnmyh4.js";import"./vendor-reka-ui-CSo89nDv.js";import{t as f}from"./Button-DHxPjNdi.js";import{ti as p,wi as m}from"./dialogService-CwVeD8j9.js";import"./extensionStore-By6c6sCD.js";import"./userStore-ChcnLOkA.js";import"./useErrorHandling-CWU_3R6Y.js";import"./useExternalLink-DZBh_BZs.js";import"./vendor-tiptap-BZHcjrm1.js";import"./markdownRendererUtil-J4WlXR5e.js";import"./Popover-_oREh-V5.js";var h={class:`flex w-full max-w-[360px] flex-col rounded-2xl border border-border-default bg-base-background`},g={class:`flex h-12 items-center justify-between border-b border-border-default px-4`},_={class:`m-0 text-sm font-normal text-base-foreground`},v=[`aria-label`],y={class:`px-4 py-4`},b={class:`m-0 text-sm text-muted-foreground`},x={class:`flex items-center justify-end gap-4 px-4 py-4`},S=a({__name:`DeleteWorkspaceDialogContent`,props:{workspaceId:{},workspaceName:{}},setup(e){let{t:a}=d(),S=t(),C=m(),w=p(),T=u(!1);function onCancel(){C.closeDialog({key:`delete-workspace`})}async function onDelete(){T.value=!0;try{await w.deleteWorkspace(e.workspaceId),C.closeDialog({key:`delete-workspace`}),window.location.reload()}catch(e){console.error(`[DeleteWorkspaceDialog] Failed to delete workspace:`,e),S.add({severity:`error`,summary:a(`workspacePanel.toast.failedToDeleteWorkspace`),detail:e instanceof Error?e.message:a(`g.unknownError`),life:5e3})}finally{T.value=!1}}return(e,t)=>(c(),l(`div`,h,[i(`div`,g,[i(`h2`,_,o(e.$t(`workspacePanel.deleteDialog.title`)),1),i(`button`,{class:`cursor-pointer rounded border-none bg-transparent p-0 text-muted-foreground transition-colors hover:text-base-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-secondary-foreground`,"aria-label":e.$t(`g.close`),onClick:onCancel},t[0]||=[i(`i`,{class:`pi pi-times size-4`},null,-1)],8,v)]),i(`div`,y,[i(`p`,b,o(e.workspaceName?e.$t(`workspacePanel.deleteDialog.messageWithName`,{name:e.workspaceName}):e.$t(`workspacePanel.deleteDialog.message`)),1)]),i(`div`,x,[r(f,{variant:`muted-textonly`,onClick:onCancel},{default:s(()=>[n(o(e.$t(`g.cancel`)),1)]),_:1}),r(f,{variant:`destructive`,size:`lg`,loading:T.value,onClick:onDelete},{default:s(()=>[n(o(e.$t(`g.delete`)),1)]),_:1},8,[`loading`])])]))}});export{S as default};
//# sourceMappingURL=DeleteWorkspaceDialogContent-CTu1067N.js.map