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