import{j as e,r as l,b as h}from"./app-vYFZLebK.js";import{I as b}from"./InputError-Cj3POQLM.js";import{I as w}from"./InputLabel-B7-VnScM.js";import{M as j}from"./Modal-B9XYN9Pr.js";import{T as v}from"./TextInput-BXnk3iOU.js";import"./transition-6I0c9VKA.js";function d({className:o="",disabled:s,children:t,...r}){return e.jsx("button",{...r,className:`inline-flex items-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-xs font-semibold uppercase tracking-widest text-white transition duration-150 ease-in-out hover:bg-red-500 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 active:bg-red-700 ${s&&"opacity-25"} `+o,disabled:s,children:t})}function N({type:o="button",className:s="",disabled:t,children:r,...a}){return e.jsx("button",{...a,type:o,className:`inline-flex items-center rounded-md border border-[var(--border)] bg-[var(--bg-elevated)] px-4 py-2 text-xs font-semibold uppercase tracking-widest text-[var(--text-main)] shadow-sm transition duration-150 ease-in-out hover:bg-opacity-80 focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:ring-offset-2 disabled:opacity-25 ${t&&"opacity-25"} `+s,disabled:t,children:r})}function S({className:o=""}){const[s,t]=l.useState(!1),r=l.useRef(),{data:a,setData:u,delete:m,processing:p,reset:c,errors:x,clearErrors:f}=h({password:""}),g=()=>{t(!0)},y=i=>{i.preventDefault(),m(route("profile.destroy"),{preserveScroll:!0,onSuccess:()=>n(),onError:()=>r.current.focus(),onFinish:()=>c()})},n=()=>{t(!1),f(),c()};return e.jsxs("section",{className:`space-y-6 ${o}`,children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-lg font-black uppercase tracking-widest text-[var(--text-main)]",children:"Terminate_Node"}),e.jsx("p",{className:"mt-1 text-xs font-bold uppercase tracking-widest text-[var(--text-muted)]",children:"Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain."})]}),e.jsx(d,{onClick:g,children:"Terminate_Account"}),e.jsx(j,{show:s,onClose:n,children:e.jsxs("form",{onSubmit:y,className:"p-6",children:[e.jsx("h2",{className:"text-lg font-medium text-[var(--text-main)]",children:"Are you sure you want to delete your account?"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--text-muted)]",children:"Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account."}),e.jsxs("div",{className:"mt-6",children:[e.jsx(w,{htmlFor:"password",value:"Password",className:"sr-only"}),e.jsx(v,{id:"password",type:"password",name:"password",ref:r,value:a.password,onChange:i=>u("password",i.target.value),className:"mt-1 block w-3/4 bg-[var(--bg-elevated)]",isFocused:!0,placeholder:"Password"}),e.jsx(b,{message:x.password,className:"mt-2"})]}),e.jsxs("div",{className:"mt-6 flex justify-end",children:[e.jsx(N,{onClick:n,children:"Cancel"}),e.jsx(d,{className:"ms-3",disabled:p,children:"Delete Account"})]})]})})]})}export{S as default};
