1import{u as v,a as y,m as w,r as o,j as e,H as i,C as k,t,n as u,M as E,L as A,b as c,s as d,F as D}from"./index-6puVifSu.js";import{N as p}from"./Navbar-jkL9nfIr.js";import{a as T,T as f}from"./triangle-alert-D6lw6nBi.js";import"./sparkles-FzR1CUif.js";import"./log-out-CPd7ktNk.js";function B(){v();const{user:x}=y(),{logout:b}=w(),[n,j]=o.useState(""),[l,r]=o.useState(!1),[g,N]=o.useState(!1),m=async()=>{if(n!=="DELETE"){c.error("Type DELETE to confirm");return}r(!0);const{data:{session:s}}=await d.auth.getSession();if(!s){c.error("Session expired â please sign in again"),r(!1);return}const{error:a}=await d.functions.invoke("delete-account",{headers:{Authorization:`Bearer ${s.access_token}`}});if(a){let h=a.message;if(a instanceof D)try{h=await a.context.text()}catch{}c.error("Could not delete account: "+h),r(!1);return}await d.auth.signOut(),b(),N(!0)};return g?e.jsxs("div",{className:"min-h-screen bg-warm-white flex items-center justify-center p-6",children:[e.jsxs(i,{children:[e.jsx("title",{children:"Account Deleted â Washboat"}),e.jsx("meta",{name:"robots",content:"noindex"})]}),e.jsxs("div",{className:"max-w-md w-full text-center",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-green-50 border border-green-100 flex items-center justify-center mx-auto mb-6",children:e.jsx(k,{className:"w-8 h-8 text-green-500"})}),e.jsx("h1",{className:"font-serif text-2xl font-semibold text-charcoal mb-3",children:"Account deleted"}),e.jsx("p",{className:"text-stone-500 text-sm leading-relaxed mb-8",children:"Your account, profile, artwork, and all associated data have been permanently removed from Washboat."}),e.jsx(t,{to:"/",className:"inline-flex items-center gap-2 px-6 py-3 bg-charcoal text-white font-medium rounded-xl hover:bg-stone-800 transition-colors text-sm",children:"Back to homepage"})]})]}):x?e.jsxs("div",{className:"min-h-screen bg-warm-white",children:[e.jsxs(i,{children:[e.jsx("title",{children:"Delete Account â Washboat"}),e.jsx("meta",{name:"robots",content:"noindex"})]}),e.jsx(p,{}),e.jsx("div",{className:"pt-16",children:e.jsxs("div",{className:"max-w-lg mx-auto px-6 py-16",children:[e.jsxs(t,{to:"/account",className:"inline-flex items-center gap-1.5 text-xs text-stone-400 hover:text-charcoal transition-colors mb-10",children:[e.jsx(u,{className:"w-3.5 h-3.5"})," Back to account"]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("p",{className:"text-red-400 text-xs font-medium tracking-[0.2em] uppercase mb-3",children:"Danger zone"}),e.jsx("h1",{className:"font-serif text-3xl font-semibold text-charcoal mb-3",children:"Delete your account"}),e.jsxs("p",{className:"text-stone-500 text-sm leading-relaxed",children:["Signed in as ",e.jsx("span",{className:"font-medium text-charcoal",children:x.email})]})]}),e.jsxs("div",{className:"bg-white border border-stone-200 rounded-2xl p-6 space-y-5",children:[e.jsxs("div",{className:"flex items-start gap-3 bg-red-50 border border-red-100 rounded-xl px-4 py-4",children:[e.jsx(T,{className:"w-4 h-4 text-red-500 flex-shrink-0 mt-0.5"}),e.jsxs("p",{className:"text-xs text-red-700 leading-relaxed",children:["This permanently deletes your account, all uploaded artwork, your artist profile, match history, and all associated data. ",e.jsx("strong",{children:"This cannot be undone."})]})]}),e.jsxs("div",{className:"bg-stone-50 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-semibold text-charcoal mb-2.5",children:"The following will be permanently removed:"}),e.jsx("ul",{className:"space-y-1.5",children:["Artist profile, bio, and career information","All uploaded artwork and images","Match history and venue statuses","Saved competitions and open calls","Writing voice and account preferences"].map(s=>e.jsxs("li",{className:"flex items-start gap-2 text-xs text-stone-500",children:[e.jsx(f,{className:"w-3 h-3 text-stone-400 flex-shrink-0 mt-0.5"}),s]},s))})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs font-medium text-stone-500 mb-1.5",children:["Type ",e.jsx("span",{className:"font-mono font-bold text-charcoal",children:"DELETE"})," to confirm"]}),e.jsx("input",{type:"text",value:n,onChange:s=>j(s.target.value),onKeyDown:s=>s.key==="Enter"&&m(),placeholder:"DELETE",className:"w-full text-base border border-stone-200 rounded-lg px-3.5 py-2.5 focus:outline-none focus:ring-2 focus:ring-red-200 focus:border-red-300 text-charcoal font-mono tracking-widest"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:m,disabled:l||n!=="DELETE",className:"flex items-center gap-2 px-5 py-2.5 bg-red-600 text-white text-sm font-semibold rounded-xl hover:bg-red-700 disabled:opacity-40 transition-colors",children:[l?e.jsx(A,{className:"w-4 h-4 animate-spin"}):e.jsx(f,{className:"w-4 h-4"}),l?"Deletingâ¦":"Permanently delete my account"]}),e.jsx(t,{to:"/account",className:"text-sm text-stone-400 hover:text-charcoal transition-colors",children:"Cancel"})]})]})]})})]}):e.jsxs("div",{className:"min-h-screen bg-warm-white",children:[e.jsxs(i,{children:[e.jsx("title",{children:"Delete Account â Washboat"}
1),e.jsx("meta",{name:"description",content:"Request deletion of your Washboat account and all associated data."})]}),e.jsx(p,{}),e.jsx("div",{className:"pt-16",children:e.jsxs("div",{className:"max-w-lg mx-auto px-6 py-16",children:[e.jsxs(t,{to:"/",className:"inline-flex items-center gap-1.5 text-xs text-stone-400 hover:text-charcoal transition-colors mb-10",children:[e.jsx(u,{className:"w-3.5 h-3.5"})," Back to homepage"]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("p",{className:"text-gold text-xs font-medium tracking-[0.2em] uppercase mb-3",children:"Account"}),e.jsx("h1",{className:"font-serif text-3xl font-semibold text-charcoal mb-3",children:"Delete your account"}),e.jsx("p",{className:"text-stone-500 text-sm leading-relaxed",children:"You can request the deletion of your Washboat account and all associated data at any time."})]}),e.jsxs("div",{className:"bg-white border border-stone-200 rounded-2xl divide-y divide-stone-100",children:[e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-charcoal flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx("span",{className:"text-white text-xs font-bold",children:"1"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-charcoal mb-1",children:"Sign in and delete instantly"}),e.jsx("p",{className:"text-xs text-stone-500 leading-relaxed mb-4",children:"If you have access to your account, sign in to delete everything immediately â no waiting required."}),e.jsx(t,{to:"/login",className:"inline-flex items-center gap-2 px-4 py-2.5 bg-charcoal text-white text-xs font-semibold rounded-xl hover:bg-stone-800 transition-colors",children:"Sign in to delete"})]})]})}),e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-stone-100 flex items-center justify-center flex-shrink-0 mt-0.5",children:e.jsx("span",{className:"text-stone-600 text-xs font-bold",children:"2"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-charcoal mb-1",children:"Request deletion by email"}),e.jsx("p",{className:"text-xs text-stone-500 leading-relaxed mb-4",children:"Can't access your account? Send us an email from the address registered with Washboat and we'll process your deletion request within 30 days."}),e.jsxs("a",{href:"mailto:[email protected]?subject=Account%20deletion%20request&body=Please%20delete%20my%20Washboat%20account%20and%20all%20associated%20data.%0A%0AEmail%20address%3A%20",className:"inline-flex items-center gap-2 px-4 py-2.5 border border-stone-200 text-charcoal text-xs font-semibold rounded-xl hover:bg-stone-50 hover:border-stone-300 transition-colors",children:[e.jsx(E,{className:"w-3.5 h-3.5"})," Email deletion request"]})]})]})})]}),e.jsxs("div",{className:"mt-8 bg-stone-50 border border-stone-100 rounded-2xl p-6",children:[e.jsx("h3",{className:"text-xs font-semibold text-charcoal mb-3 uppercase tracking-wide",children:"What gets deleted"}),e.jsx("ul",{className:"space-y-2",children:["Your account and login credentials","Your artist profile and biography","All uploaded artwork and images","Match history and venue statuses","Saved competitions and open calls","Writing voice and preferences"].map(s=>e.jsxs("li",{className:"flex items-start gap-2 text-xs text-stone-500",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-stone-400 flex-shrink-0 mt-1.5"}),s]},s))}),e.jsx("p",{className:"text-xs text-stone-400 mt-4 leading-relaxed",children:"Deletion is permanent and cannot be undone."})]})]})})]})}export{B as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.