import{B as e,C as t,D as n,E as r,F as i,H as a,L as o,N as s,P as c,S as l,T as u,U as d,X as f,Y as p,b as m,et as h,h as g,i as _,j as v,m as y,o as b,q as x,y as S}from"./app-hqrVTu70.js";import{t as C}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as w,t as T}from"./TextInput-BBFa5Jj5.js";import{t as E}from"./InputLabel-BxciKqvI.js";import{t as D}from"./SecondaryButton-qKc6sN0v.js";var O={},k={class:`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 dark:focus:ring-offset-gray-800`};function A(e,n){return i(),t(`button`,k,[o(e.$slots,`default`)])}var j=C(O,[[`render`,A]]),M={class:`fixed inset-0 z-50 overflow-y-auto px-4 py-6 sm:px-0`,"scroll-region":``},N=n({__name:`Modal`,props:{show:{type:Boolean,default:!1},maxWidth:{default:`2xl`},closeable:{type:Boolean,default:!0}},emits:[`close`],setup(n,{emit:u}){let p=n,h=u,g=x(),_=x(p.show);e(()=>p.show,()=>{p.show?(document.body.style.overflow=`hidden`,_.value=!0,g.value?.showModal()):(document.body.style.overflow=``,setTimeout(()=>{g.value?.close(),_.value=!1},200))});let v=()=>{p.closeable&&h(`close`)},C=e=>{e.key===`Escape`&&(e.preventDefault(),p.show&&v())};s(()=>document.addEventListener(`keydown`,C)),c(()=>{document.removeEventListener(`keydown`,C),document.body.style.overflow=``});let w=S(()=>({sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`})[p.maxWidth]);return(e,s)=>(i(),t(`dialog`,{class:`z-50 m-0 min-h-full min-w-full overflow-y-auto bg-transparent backdrop:bg-transparent`,ref_key:`dialog`,ref:g},[m(`div`,M,[r(b,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0`,"enter-to-class":`opacity-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100`,"leave-to-class":`opacity-0`},{default:a(()=>[d(m(`div`,{class:`fixed inset-0 transform transition-all`,onClick:v},[...s[0]||=[m(`div`,{class:`absolute inset-0 bg-gray-500 opacity-75 dark:bg-gray-900`},null,-1)]],512),[[y,n.show]])]),_:1}),r(b,{"enter-active-class":`ease-out duration-300`,"enter-from-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`,"enter-to-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-active-class":`ease-in duration-200`,"leave-from-class":`opacity-100 translate-y-0 sm:scale-100`,"leave-to-class":`opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95`},{default:a(()=>[d(m(`div`,{class:f([`mb-6 transform overflow-hidden rounded-lg bg-white shadow-xl transition-all sm:mx-auto sm:w-full dark:bg-gray-800`,w.value])},[_.value?o(e.$slots,`default`,{key:0}):l(``,!0)],2),[[y,n.show]])]),_:3})])],512))}}),P={class:`space-y-6`},F={class:`p-6`},I={class:`mt-6`},L={class:`mt-6 flex justify-end`},R=n({__name:`DeleteUserForm`,setup(e){let n=x(!1),o=x(null),s=_({password:``}),c=()=>{n.value=!0,v(()=>o.value?.focus())},l=()=>{s.delete(route(`profile.destroy`),{preserveScroll:!0,onSuccess:()=>d(),onError:()=>o.value?.focus(),onFinish:()=>{s.reset()}})},d=()=>{n.value=!1,s.clearErrors(),s.reset()};return(e,h)=>(i(),t(`section`,P,[h[6]||=m(`header`,null,[m(`h2`,{class:`text-lg font-medium text-gray-900 dark:text-gray-100`},` Delete Account `),m(`p`,{class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},` 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. `)],-1),r(j,{onClick:c},{default:a(()=>[...h[1]||=[u(`Delete Account`,-1)]]),_:1}),r(N,{show:n.value,onClose:d},{default:a(()=>[m(`div`,F,[h[4]||=m(`h2`,{class:`text-lg font-medium text-gray-900 dark:text-gray-100`},` Are you sure you want to delete your account? `,-1),h[5]||=m(`p`,{class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},` 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. `,-1),m(`div`,I,[r(E,{for:`password`,value:`Password`,class:`sr-only`}),r(T,{id:`password`,ref_key:`passwordInput`,ref:o,modelValue:p(s).password,"onUpdate:modelValue":h[0]||=e=>p(s).password=e,type:`password`,class:`mt-1 block w-3/4`,placeholder:`Password`,onKeyup:g(l,[`enter`])},null,8,[`modelValue`]),r(w,{message:p(s).errors.password,class:`mt-2`},null,8,[`message`])]),m(`div`,L,[r(D,{onClick:d},{default:a(()=>[...h[2]||=[u(` Cancel `,-1)]]),_:1}),r(j,{class:f([`ms-3`,{"opacity-25":p(s).processing}]),disabled:p(s).processing,onClick:l},{default:a(()=>[...h[3]||=[u(` Delete Account `,-1)]]),_:1},8,[`class`,`disabled`])])])]),_:1},8,[`show`])]))}}),z=h({default:()=>B}),B=R;export{z as n,B as t};