1import{i as e}from"./rolldown-runtime-jxEyR9vv.js";import{i as t,r as n,t as a}from"./react-vendor-CkV2jqmj.js";import{u as c}from"./publicCreditOnlyContent-B_B6kJJ9.js";import{i as o}from"./localeRouting-Dz21QpCy.js";import{Ot as i,Pt as l,X as s,z as r}from"./ui-vendor-DA2SHRZx.js";import{k as d}from"./main-DWbkpOGW.js";import{H as u,I as _,R as g}from"./AppContext-BLosOwCf.js";import{n as h}from"./NotificationSystem-D-2fuADm.js";import{t as m}from"./AccountDeletion-DqAb6e-e.js";var p=e(t()),j=e(n()),y=a(),x=({flow:e})=>{const{t:t}=m();if("undefined"==typeof document)return null;const n="signing_out"===e?t("account_delete_gate_signing_out","Deletion scheduled â signing you outâ¦"):t("account_delete_gate_submitting","Scheduling account deletionâ¦");return(0,j.createPortal)((0,y.jsx)("div",{className:"account-deletion-progress",role:"status","aria-live":"polite","aria-busy":"true","data-account-deletion-dialog":"",children:(0,y.jsxs)("div",{className:"account-deletion-progress-card",children:[(0,y.jsx)(l,{size:22,className:"account-deletion-spin","aria-hidden":"true"}),(0,y.jsx)("p",{children:n})]})}),document.body)},f=({user:e,status:t})=>{const{logout:n,cancelScheduledAccountDeletion:a}=d(),{showSuccess:j}=h(),{t:x,formatText:f,language:b}=m(),[k,N]=(0,p.useState)(""),[v,w]=(0,p.useState)(""),S=(0,p.useRef)(!1),C=(0,p.useRef)(null);(0,p.useEffect)(()=>{C.current?.focus({preventScroll:!0})},[]),(0,p.useEffect)(()=>{S.current||(S.current=!0,u())},[]);const P="purging"===t,z=c(b).localeTag,Y=g(e?.accountDeletion?.scheduledForMs,z)||"â",D=o("/metadata?auth=login",b),R=o("/privacy",b),A=String(e?.email||"").trim();return(0,y.jsx)("main",{className:"account-deletion-lock","aria-labelledby":"account-deletion-lock-title",children:(0,y.jsxs)("section",{className:"account-deletion-lock-card",children:[(0,y.jsx)("span",{className:"account-deletion-icon","aria-hidden":"true",children:(0,y.jsx)(r,{size:20})}),(0,y.jsx)("h1",{id:"account-deletion-lock-title",ref:C,tabIndex:-1,children:P?x("account_delete_gate_purging_title","Deletion in progress"):x("account_delete_gate_title","Your account is scheduled for deletion")}),(0,y.jsx)("p",{children:P?x("account_delete_gate_purging_body","Your account and data are being deleted. This can no longer be cancelled."):f(x("account_delete_gate_body","It will be permanently deleted on {date}. Until then, your account is locked."),{date:Y})}),A&&(0,y.jsx)("p",{className:"account-deletion-lock-account",children:f(x("account_delete_gate_signed_in_as","Signed in as {email}"),{email:A})}),!P&&(0,y.jsxs)("div",{children:[(0,y.jsx)("h2",{children:x("account_delete_gate_restores_title","Cancelling the deletion restores:")}),(0,y.jsxs)("ul",{children:[(0,y.jsx)("li",{children:x("account_delete_gate_restores_account","Your account and sign-in")}),(0,y.jsx)("li",{children:x("account_delete_gate_restores_data","Your files, history and settings")}),(0,y.jsx)("li",{children:x("account_delete_gate_restores_credits","Your purchased credits")})]})]}),!P&&(0,y.jsx)("p",{children:x("account_delete_gate_not_restored","A subscription that was cancelled when you requested deletion is not restored. You can subscribe again at any time.")}),(0,y.jsx)("div",{"aria-live":"polite",children:v&&(0,y.jsx)("p",{className:"account-deletion-error",role:"alert",children:v})}),(0,y.jsxs)("div",{className:"account-deletion-lock-actions",children:[!P&&(0,y.jsxs)("button",{type:"button",className:"account-deletion-button primary",onClick:async()=>{if(!k){N("cancel"),w("");try{await a({reauthNotice:{message:x("account_delete_gate_reauth","Please sign in again to cancel the deletion."),actionLabel:x("account_delete_gate_sign_in","Sign in"),actionHref:D}}),j(x("account_delete_gate_restored","Your account has been restored."),6e3)}catch(e){const t=String(e?.code||"");"reauth_required"!==t&&w((e=>"deletion_not_cancelable"===e?x("account_delete_gate_not_cancelable","Deletion has already started and can no longer be cancelled."):"network"===e?x("account_delete_error_network","Connection problem. Check your internet connection and try again."):"rate_limited"===e?x("account_delete_rate_limited","Too many requests. Please wait a few minutes and try again."):f(x("account_delete_gate_cancel_failed","We couldnât cancel the deletion. Please try again or c
1ontact {email}."),{email:_}))(t))}finally{N("")}}},disabled:Boolean(k),"aria-busy":"cancel"===k,children:["cancel"===k?(0,y.jsx)(l,{size:16,className:"account-deletion-spin","aria-hidden":"true"}):(0,y.jsx)(s,{size:16,"aria-hidden":"true"}),"cancel"===k?x("account_delete_gate_canceling","Restoring your accountâ¦"):x("account_delete_gate_cancel_button","Cancel deletion and restore my account")]}),(0,y.jsxs)("button",{type:"button",className:"account-deletion-button secondary",onClick:async()=>{if(!k){N("sign_out"),w("");try{await n()}catch{w(x("account_delete_error_generic","Something went wrong. Please try again.")),N("")}}},disabled:Boolean(k),"aria-busy":"sign_out"===k,children:["sign_out"===k?(0,y.jsx)(l,{size:16,className:"account-deletion-spin","aria-hidden":"true"}):(0,y.jsx)(i,{size:16,"aria-hidden":"true"}),x("account_delete_gate_sign_out","Sign out")]})]}),(0,y.jsxs)("p",{className:"account-deletion-lock-links",children:[(0,y.jsx)("a",{href:`mailto:${_}`,children:x("account_delete_gate_support_link","Contact support")}),(0,y.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,y.jsx)("a",{href:R,children:x("account_delete_gate_privacy_link","Privacy Policy")})]})]})})};export{f as AccountDeletionLockScreen,x as AccountDeletionProgressOverlay}; 2//# sourceMappingURL=AccountDeletionLockScreen-D0cGwAoI.js.map
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.