import{i as w,d as p,T as h,c as g,w as o,o as v,g as r,t as a,u as e,a as u,b as l,V as k,n as x}from"./app-WJL2kJBE.js";import{_ as D}from"./ActionSection-0k724LuI.js";import{_ as C}from"./DialogModal-B87MAZJT.js";import{_}from"./DangerButton-BS8d3PUv.js";import{_ as V}from"./Input-C4-VG2dv.js";import{_ as b}from"./InputError-idDGfizs.js";import{_ as $}from"./SecondaryButton-DT9RUAGX.js";import"./SectionTitle-DsJypKOL.js";import"./Modal-B9NNWAdE.js";const A={class:"max-w-xl text-sm text-gray-600"},U={class:"mt-5"},B={class:"mt-4"},j={__name:"DeleteUserForm",setup(I){const{t:s}=w({}),n=p(!1),c=p(null),t=h({password:""}),f=()=>{n.value=!0,setTimeout(()=>c.value.focus(),250)},d=()=>{t.delete(route("current-user.destroy"),{preserveScroll:!0,onSuccess:()=>i(),onError:()=>c.value.focus(),onFinish:()=>t.reset()})},i=()=>{n.value=!1,t.reset()};return(N,m)=>(v(),g(D,null,{title:o(()=>[r(a(e(s)("Delete Account")),1)]),description:o(()=>[r(a(e(s)("Permanently delete your account.")),1)]),content:o(()=>[u("div",A,a(e(s)(" 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),u("div",U,[l(_,{onClick:f},{default:o(()=>[r(a(e(s)("Delete Account")),1)]),_:1})]),l(C,{show:n.value,onClose:i},{title:o(()=>[r(a(e(s)("Delete Account")),1)]),content:o(()=>[r(a(e(s)("Are you sure you want to delete your account? 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),u("div",B,[l(V,{ref_key:"passwordInput",ref:c,modelValue:e(t).password,"onUpdate:modelValue":m[0]||(m[0]=y=>e(t).password=y),type:"password",class:"mt-1 block w-3/4",placeholder:"Password",onKeyup:k(d,["enter"])},null,8,["modelValue"]),l(b,{message:e(t).errors.password,class:"mt-2"},null,8,["message"])])]),footer:o(()=>[l($,{onClick:i},{default:o(()=>[r(a(e(s)("Cancel")),1)]),_:1}),l(_,{class:x(["ml-3",{"opacity-25":e(t).processing}]),disabled:e(t).processing,onClick:d},{default:o(()=>[r(a(e(s)("Delete Account")),1)]),_:1},8,["class","disabled"])]),_:1},8,["show"])]),_:1}))}};export{j as default};
