import{r as h,e as j,j as e,as as f}from"./vendor-laZsiqLO.js";import{B as t}from"./button-B8f8jW4H.js";import{I as g}from"./input-CT5MkJwj.js";import{L as _}from"./label-BDbCc0wv.js";import{D as w,a as v,b as y,c as D,d as N,e as b,f as C,g as F}from"./dialog-Cad__boe.js";import{u as T}from"./useTranslation-BW0o-tkY.js";import"./utils-RgT4yCq8.js";function R({className:c=""}){const{t:s}=T(),a=h.useRef(),{data:i,setData:l,delete:d,processing:u,reset:o,errors:n,clearErrors:m}=j({password:""}),p=r=>{r.preventDefault(),d(route("settings.destroy"),{preserveScroll:!0,onError:()=>a.current.focus(),onFinish:()=>o()})},x=r=>{r||(m(),o())};return e.jsx("section",{className:c,children:e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-red-700 dark:text-red-400",children:s("_delete_account","Delete Account")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s("_delete_account_desc","Once deleted, your account is gone forever. Please be certain.")})]}),e.jsxs(w,{onOpenChange:x,children:[e.jsx(v,{asChild:!0,children:e.jsx(t,{variant:"destructive",children:s("_delete_account","Delete Account")})}),e.jsxs(y,{className:"sm:max-w-md",children:[e.jsxs(D,{children:[e.jsxs(N,{className:"flex items-center gap-2 text-destructive",children:[e.jsx(f,{className:"h-5 w-5"}),s("_are_you_sure","Are you sure?")]}),e.jsx(b,{children:s("_delete_account_warning","This action cannot be undone. This will permanently delete your account and remove your data from our servers.")})]}),e.jsxs("form",{onSubmit:p,className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{htmlFor:"password",children:s("_confirm_password","Confirm Password")}),e.jsx(g,{id:"password",type:"password",name:"password",ref:a,value:i.password,onChange:r=>l("password",r.target.value),placeholder:s("_enter_password","Enter your password"),autoFocus:!0}),n.password&&e.jsx("p",{className:"text-sm text-destructive",children:n.password})]}),e.jsxs(C,{children:[e.jsx(F,{asChild:!0,children:e.jsx(t,{type:"button",variant:"secondary",children:s("_cancel","Cancel")})}),e.jsx(t,{type:"submit",variant:"destructive",disabled:u,children:s("_delete_account","Delete Account")})]})]})]})]})]})})})}export{R as default};
