1import{fp as w,fN as b,fI as C,fJ as H,eF as i,e7 as e,cp as I,D as c,aI as t,ax as A,aK as E}from"./index-BQzkjQJq.js";import{d as F,a as O}from"./account-deletion.functions-9bpVSULW.js";const l="HESABIMI SİL";function z(){const{user:m,loading:y,signOut:d}=w(),f=b(F),k=b(O),j=C({queryKey:["account-deletion-available"],queryFn:()=>k(),staleTime:6e4,retry:!1}),g=H(),[n,v]=i.useState(""),[a,u]=i.useState(!1),[x,p]=i.useState(""),[r,N]=i.useState(null),S=async o=>{if(o.preventDefault(),!(a||n!==l)){u(!0),p("");try{const s=await f({data:{confirmation:l}});N(s),await d(),g.clear();for(const h of Object.keys(localStorage))/^(itibar.*(draft|poll|vote|follow|onboarding)|post_login_redirect|native-auth-pending)/i.test(h)&&localStorage.removeItem(h)}catch(s){p(s instanceof Error?s.message:"İÅlem tamamlanamadı. Lütfen tekrar dene.")}finally{u(!1)}}};return e.jsx("main",{className:"container-page py-10",children:e.jsxs("section",{className:"mx-auto max-w-xl space-y-5 rounded-3xl border border-border bg-card p-6 sm:p-8",children:[e.jsx(I,{className:"h-8 w-8 text-muted-foreground","aria-hidden":!0}),e.jsx("h1",{className:"text-2xl font-bold",children:"Hesabını sil"}),r?e.jsxs("div",{role:"status",className:"space-y-4",children:[e.jsx("p",{children:r.status==="completed"?"Hesabın ve hesabına baÄlı verilerin silindi.":"Silme talebin alındı ve hesabın kullanıma kapatıldı. Kalan verilerin silinmesi için iÅlem yöneticinin takip ekranına aktarıldı."}),e.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:["İÅlem numarası: ",r.id]}),e.jsx(c,{asChild:!0,children:e.jsx(t,{to:"/",children:"AkıÅa dön"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:"Bu iÅlem kalıcıdır. Profilin, paylaÅtıÄın anketler ve görseller, taslakların, yorumların, hesabına baÄlı oyların, takip ve yeniden paylaÅım kayıtların silinir. Oturumların kapatılır."}),e.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:"Hesabınla iliÅkilendirilemeyen anonim ziyaretçi toplamları ve diÄer kullanıcıların baÄımsız içerikleri korunur. Kurumsal hesap sahibiysen önce sahipliÄi devretmelisin."}),j.data?y?e.jsx("p",{role:"status",children:"Hesabın yükleniyorâ¦"}):m?e.jsxs("form",{onSubmit:S,className:"space-y-4",children:[e.jsxs("p",{className:"break-all text-sm font-medium",children:["İÅlem yapılacak hesap: ",m.email]}),e.jsxs("label",{htmlFor:"delete-confirm",className:"block text-sm",children:["Onaylamak için ",e.jsx("strong",{children:l})," yaz."]}),e.jsx(A,{id:"delete-confirm",autoComplete:"off",value:n,onChange:o=>v(o.target.value),disabled:a}),x&&e.jsxs("div",{role:"alert",className:"space-y-2 text-sm text-destructive",children:[e.jsx("p",{children:x}),e.jsx("button",{type:"button",className:"underline",onClick:async()=>{await d(),window.location.assign("/itibar-giris?redirect=%2Fhesap-sil")},children:"Yeniden giriÅ yap"})]}),e.jsxs(c,{variant:"destructive",type:"submit",disabled:a||n!==l,children:[a&&e.jsx(E,{className:"h-4 w-4 animate-spin"})," ",a?"Hesabın siliniyorâ¦":"Hesabımı kalıcı olarak sil"]})]}):e.jsx(c,{asChild:!0,children:e.jsx(t,{to:"/itibar-giris",search:{redirect:"/hesap-sil"},children:"Hesabını silmek için giriÅ yap"})}):e.jsxs("p",{className:"text-sm",children:["Hesap silme ekranı henüz etkin deÄil. Veri silme talebini ",e.jsx(t,{to:"/iletisim",className:"text-primary underline",children:"iletiÅim bölümünden"})," iletebilirsin."]}),e.jsx(t,{to:"/",className:"inline-flex min-h-11 items-center text-sm text-primary",children:"AkıÅa dön"})]})]})})}export{z as component};
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.