"use strict";exports.id=3842,exports.ids=[3842],exports.modules={83842:(e,a,t)=>{t.d(a,{f:()=>b});var s=t(60080),l=t(9885),d=t(94163),o=t(5705),n=t(71910),i=t(23161),r=t(68384);let c=n.fC;n.xz;let m=n.h_,f=l.forwardRef(({className:e,...a},t)=>s.jsx(n.aV,{className:(0,i.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a,ref:t}));f.displayName=n.aV.displayName;let x=l.forwardRef(({className:e,...a},t)=>(0,s.jsxs)(m,{children:[s.jsx(f,{}),s.jsx(n.VY,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a})]}));x.displayName=n.VY.displayName;let p=({className:e,...a})=>s.jsx("div",{className:(0,i.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...a});p.displayName="AlertDialogHeader";let u=({className:e,...a})=>s.jsx("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});u.displayName="AlertDialogFooter";let j=l.forwardRef(({className:e,...a},t)=>s.jsx(n.Dx,{ref:t,className:(0,i.cn)("text-lg font-semibold",e),...a}));j.displayName=n.Dx.displayName;let N=l.forwardRef(({className:e,...a},t)=>s.jsx(n.dk,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",e),...a}));N.displayName=n.dk.displayName;let h=l.forwardRef(({className:e,...a},t)=>s.jsx(n.aU,{ref:t,className:(0,i.cn)((0,r.d)(),e),...a}));h.displayName=n.aU.displayName;let y=l.forwardRef(({className:e,...a},t)=>s.jsx(n.$j,{ref:t,className:(0,i.cn)((0,r.d)({variant:"outline"}),"mt-2 sm:mt-0",e),...a}));y.displayName=n.$j.displayName;var g=t(49424),v=t(33478);function b({isOpen:e,onClose:a,onConfirm:t,title:n="Are you sure?",description:i="This action cannot be undone. This will permanently delete the item.",itemName:m,loading:f=!1}){let[h,b]=(0,l.useState)(""),[w,E]=(0,l.useState)(!1);(0,l.useEffect)(()=>{e&&(b(""),E(!1))},[e]);let D=async()=>{if("DELETE"===h){E(!0);try{await t()}catch(e){console.error(e)}finally{E(!1)}}};return s.jsx(c,{open:e,onOpenChange:e=>!e&&!w&&a(),children:(0,s.jsxs)(x,{children:[(0,s.jsxs)(p,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-destructive",children:[s.jsx(d.Z,{className:"h-5 w-5"}),s.jsx(j,{children:n})]}),(0,s.jsxs)(N,{children:[i,m&&(0,s.jsxs)("span",{className:"block mt-2 font-medium text-foreground",children:['You are about to delete: "',m,'"']})]})]}),(0,s.jsxs)("div",{className:"py-4 space-y-3",children:[(0,s.jsxs)(v._,{htmlFor:"confirm-delete",children:["Type ",s.jsx("span",{className:"font-bold text-destructive",children:"DELETE"})," to confirm"]}),s.jsx(g.I,{id:"confirm-delete",value:h,onChange:e=>b(e.target.value),placeholder:"DELETE",className:"font-mono",autoComplete:"off"})]}),(0,s.jsxs)(u,{children:[s.jsx(y,{disabled:w,onClick:a,children:"Cancel"}),s.jsx(r.z,{variant:"destructive",disabled:"DELETE"!==h||w||f,onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:w||f?(0,s.jsxs)(s.Fragment,{children:[s.jsx(o.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):"Delete"})]})]})})}}};