1var ve=Object.defineProperty,ge=Object.defineProperties;var Ne=Object.getOwnPropertyDescriptors;var te=Object.getOwnPropertySymbols;var xe=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable;var ne=(o,s,l)=>s in o?ve(o,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):o[s]=l,p=(o,s)=>{for(var l in s||(s={}))xe.call(s,l)&&ne(o,l,s[l]);if(te)for(var l of te(s))Ce.call(s,l)&&ne(o,l,s[l]);return o},Y=(o,s)=>ge(o,Ne(s));import{a as n,_ as e,b as N}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-B177jzqY.js";import{u as Ee,R as Re}from"./useAccountRecoveryRequest-DYt6jsne.js";import{I as L}from"./input-Chbnfqnc.js";import{ca as q,n as Ae}from"./index-B9O2cfno.js";import{c as De}from"./countries-DN7txrzE.js";import{C as we}from"./ChevronLeftIcon-CTb8n7sC.js";import{I as ke}from"./InfoIcon-BU6GTbRV.js";import{V as B}from"./ViewTitle-DJBm7y23.js";import{b as ae,A as J,F as H,T as b,c as re,d as _e}from"./AuthForm-CR8C_1hj.js";import{d as Pe}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare___mf_0_unleash_mf_1_proxy_mf_2_client_mf_2_react__loadShare__.js-BdtqsXmB.js";import{a as D,e as Te,b as Me}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js-ClGO9exV.js";import{d as Se}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_router_mf_2_dom__loadShare__.js-CK4j7iSY.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js_commonjs-proxy-D_fXcg40.js";import"./index-CwMG8eoe.js";import"./useControlled-DMkbsAxB.js";import"./useRegisterFieldControl-8-icw_H_.js";import"./virtualExposes-_ivNhQLP.js";import"./remoteEntry-uboCqDRT.js";import"./preload-helper-s0Msbe4-.js";import"./index-DM2295YJ.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_fD68H2V.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js_commonjs-proxy-BYnSnx8j.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js-ckyQG2Wp.js";import"./GradientOutlineButton-CQz8rFt9.js";const ie={email:"",firstName:"",lastName:"",username:"",birthDate:"",country:"US",zipCode:"",recoveryEmail:"",confirmRecoveryEmail:""},Fe=/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/,le=o=>Fe.test(o);function Ue(o){return typeof o=="object"&&o!==null&&"status"in o}function Ie(){const{loading:o,submitRecoveryRequest:s}=Ee(),l=Pe("automatedAccountRecoveryEnabled"),y=Se(),[t,r]=D("email"),[h,x]=D(1),[i,C]=D(ie),[w,c]=D({}),[W,T]=D(null),[E,m]=D(null),[M,k]=D(!1),_=Te(null),S=a=>{m(a)},j=()=>{m(null)},F=()=>{m(null),c({general:"reCAPTCHA verification failed. Please try again."})};Me(()=>{l||(window.location.href=q.appUrl.supportArticle)},[l]);const Z=a=>{r(a),c({}),k(!1)},$=a=>{const u=p({},i),d=a.target.name;u[d]=a.target.value,C(u);const f=p({},w);if(delete f[d],delete f.general,c(f),d==="recoveryEmail"||d==="confirmRecoveryEmail"){const v=Y(p({},i),{[d]:a.target.value}),A=V=>V.trim().toLowerCase(),U=v.recoveryEmail&&v.confirmRecoveryEmail,I=A(v.recoveryEmail)===A(v.confirmRecoveryEmail),O=A(v.email)===A(v.recoveryEmail);k(!!(t==="email"&&U&&I&&O))}},g=a=>{const u=p({},i);u.country=a||"",C(u);const d=p({},w);delete d.country,delete d.general,c(d)},G=a=>{const u=a.replace(/\D/g,"").replace(/^(\d{2})(\d)/,"$1/$2").slice(0,5),d=p({},i);d.birthDate=u,C(d);const f=p({},w);delete f.birthDate,delete f.general,c(f)},P=()=>{const a={};return t==="email"?i.email?le(i.email)||(a.email="Please enter a valid email address"):a.email="Email is required":t==="name"?(i.firstName||(a.firstName="First name is required"),i.lastName||(a.lastName="Last name is required")):t==="username"&&(i.username||(a.username="Username is required")),Object.keys(a).length>0?(c(a),!1):!0},R=()=>{const a={};if(!i.birthDate)a.birthDate="Date of birth is required";else if(!/^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/.test(i.birthDate))a.birthDate="Please enter a valid date in MM/DD format";else{const[d,f]=i.birthDate.split("/").map(Number);d<1||d>12?a.birthDate="Please enter a valid month (01-12)":f<1||f>31?a.birthDate="Please enter a valid day (01-31)":f>[31,29,31,30,31,30,31,31,30,31,30,31][d-1]&&(a.birthDate="Please enter a valid date")}return i.country||(a.country="Country is required"),i.zipCode||(a.zipCode="Zip code is required"),Object.keys(a).length>0?(c(a),!1):!0},ce=()=>{const a={};
1return i.recoveryEmail?le(i.recoveryEmail)||(a.recoveryEmail="Please enter a valid email address"):a.recoveryEmail="Contact email is required",i.confirmRecoveryEmail?i.recoveryEmail.trim().toLowerCase()!==i.confirmRecoveryEmail.trim().toLowerCase()&&(a.confirmRecoveryEmail="Emails do not match"):a.confirmRecoveryEmail="Please confirm your email",Object.keys(a).length>0?(c(a),!1):!0},me=()=>{h===1?P()&&x(2):h===2&&R()&&x(3)},de=()=>{h===2?(x(1),c({})):h===3&&(x(2),c({}))},ue=()=>{var a;T(null),x(1),C(ie),c({}),m(null),(a=_.current)==null||a.reset()},he=()=>{C(a=>Y(p({},a),{recoveryEmail:"",confirmRecoveryEmail:""})),k(!1)},fe=()=>{y("/auth/forgot-password",{state:{email:i.recoveryEmail.trim()}})},pe=async a=>{if(a.preventDefault(),!!ce()){if(t==="email"&&i.email.trim().toLowerCase()===i.recoveryEmail.trim().toLowerCase()){k(!0);return}if(!E){c({general:"Please complete the reCAPTCHA verification."});return}try{const[u,d]=i.birthDate.split("/"),f=parseInt(u,10),v=parseInt(d,10);if(Number.isNaN(f)||Number.isNaN(v)){c({general:"Invalid date format. Please enter date as MM/DD."});return}const A=i.email.trim(),U=i.username.trim(),I=i.firstName.trim(),O=i.lastName.trim(),V=!!(I&&O),ye=p(p(p({birthDateMonth:f,birthDateDay:v,zipCode:i.zipCode,country:i.country,recoveryEmail:i.recoveryEmail},A?{email:A}:{}),U?{username:U}:{}),V?{firstName:I,lastName:O}:{}),z=await s(ye,E);(z.status==="MATCH_FOUND"||z.status==="PENDING_SUPPORT"||z.status==="NO_MATCH")&&T(z.status)}catch(u){Ue(u)?u.status===409?c({general:"A duplicate recovery request was detected. Please wait a few minutes before trying again."}):u.status===429?c({general:"Rate limit exceeded. Please try again tomorrow."}):u.status===400?c({general:u.message||"Validation error. Please check your information and try again."}):c({general:u.message||"An error occurred. Please try again."}):c({general:"An unexpected error occurred. Please try again."})}}},be=t==="email"&&!i.email||t==="name"&&(!i.firstName||!i.lastName)||t==="username"&&!i.username;return{automatedAccountRecoveryEnabled:l,loading:o,recoveryMethod:t,currentStep:h,fields:i,errors:w,responseStatus:W,showEmailMatchWarning:M,recaptchaRef:_,continueDisabled:be,submitDisabled:o||!E||t==="email"&&M,handleRecaptchaChange:S,handleRecaptchaExpire:j,handleRecaptchaError:F,handleMethodChange:Z,handleChange:$,handleCountryChange:g,handleBirthDateChange:G,handleNext:me,handleBack:de,handleSubmit:pe,resetWizard:ue,clearRecoveryEmails:he,resetPassword:fe}}const K="Let's find your Photobucket account";function Q({children:o}){return n("div",{className:"bg-brand-100 text-foreground border-brand-500 rounded-12 flex gap-12 border-l-4 px-16 py-12 text-sm",children:[e(ke,{size:"base",className:"text-brand-600 mt-2 shrink-0"}),e("span",{children:o})]})}function X({active:o,onClick:s,children:l}){return o?e(_e,{onClick:s,"aria-expanded":!0,children:l}):e("button",{type:"button",onClick:s,"aria-expanded":!1,className:"font-text bg-brand-100 text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 hover:bg-brand-200 flex h-56 w-full items-center justify-center rounded-full text-base font-semibold outline-none transition-colors lg:h-48",children:l})}function oe({onClick:o}){return n("button",{type:"button",onClick:o,className:"text-brand-600 focus-visible:ring-3 focus-visible:ring-ring/50 flex items-center gap-4 self-start rounded-4 text-sm font-semibold outline-none hover:underline",children:[e(we,{size:"small"}),"back"]})}function ee(){return e(ae,{"data-test":"return-to-login",to:"/auth/login",className:"text-center text-base",children:"Back to Sign In"})}function se({step:o}){const s=o/3*100;return e("div",{className:"bg-brand-100 h-8 w-full rounded-full",children:e("div",{className:"bg-brand-500 h-8 rounded-full",style:{width:"".concat(s,"%")}})})}function Oe({value:o,error:s,onChange:l}){return n("div",{className:"flex w-full flex-col gap-4",children:[e(re,{htmlFor:"country",children:"Country *"}),n("select",{id:"country",name:"country",value:o,onChange:y=>l(y.target.value),"aria-invalid":!!s||void 0,"aria-describedby":s?"country-error":void 0,className:Ae("h-48 w-full rounded-12 border bg-background px-12 text-base outline-none focus-visible:ring-3 focus-visible:ring-ring/50",s?"border-destructive":"border-border"),children:[e("option",{value:"",disabled:!0,children:"Select a country"}),De.map(y=>e("option",{value:y.value,children:y.label},y.value))]}),s&&e("p",{id:"country-error",role:"alert","aria-live":"polite",className:"text-destructive text-sm",children:s})]})}function ma(){const{automatedAccountRecoveryEnabled:o,loading:s,recoveryMethod:l,currentStep:y,fields:t,errors:r,responseStatus:h,showEmailMatchWarning:x,recaptchaRef:i,continueDisabled:C,submitDisabled:w,handleRecaptchaChange:c,handleRecaptchaExpire:W,handleRecaptchaError:T,handleMethodChange:E,handleChange:m,handleCountryChange:M,handleBirthDateChange:k,handleNext:_,handleBack:S,handleSubmit:j,resetWizard:F,clearRecoveryEmails:Z,resetPassword:$}=Ie();if(!o)return null;if(h==="MATCH_FOUND"||h==="PENDING_SUPPORT"||h==="NO_MATCH"){const g={MATCH_FOUND:"ð We found your account!",PENDING_SUPPORT:"We're looking into this",NO_MATCH:"We couldn't find an account with that information."}[h];return n("div",{className:"flex flex-col gap-16 text-center",children:[e(B,{title:"Account Recovery"}),e("h1",{className:"font-display text-foreground text-4xl font-bold",children:g}),h==="MATCH_FOUND"&&n("p",{className:"text-muted-foreground text-base",children:["We've sent a verification link to ",e("strong",{children:t.recoveryEmail}),".",e("br",{}),e("br",{}),"Click the link in that email to update your email address and regain access to your account."]}),h==="PENDING_SUPPORT"&&n("p",{className:"text-muted-foreground text-base",children:["Our system couldn't find an exact match, so we've passed your request to our support team.",e("br",{}),e("br",{}),"They'll take a closer look and contact you at ",e("strong",{children:t.recoveryEmail})," within 24 hours."]}),h==="NO_MATCH"&&n("div",{className:"text-muted-foreground text-left text-base",children:["This can happen if the details entered don't match what was used when the account was created.",e("br",{}),e("br",{}),e("strong",{children:"Try these tips:"}),n("ul",{className:"mt-12 list-disc pl-20",children:[e("li",{children:"Make sure you're entering the same name, date of birth, country, and ZIP c
1ode you used when you originally created your account. This helps us find older accounts more accurately."}),e("li",{children:"Check your inbox for old emails from Photobucket. If you've ever shared a direct link to a photo from your account or posted one on a blog or forum, that link might include your username."})]}),e("br",{}),e("strong",{children:"Still need help?"}),e("br",{}),"You can contact our support team through this"," ",e(ae,{href:q.appUrl.recoveryForm,target:"_blank",rel:"noopener noreferrer",children:"link"}),"."]}),(h==="MATCH_FOUND"||h==="NO_MATCH")&&e("p",{className:"text-muted-foreground text-sm",children:h==="MATCH_FOUND"?n(N,{children:["Didn't receive it? Check your spam folder or"," ",e("button",{type:"button",onClick:F,className:"text-brand-600 font-semibold hover:underline",children:"request a new link"}),"."]}):e("button",{type:"button",onClick:F,className:"text-brand-600 font-semibold hover:underline",children:"Try again with different details"})})]})}if(y===1){const g="To help us find your old account, please enter the information you used when you originally created it.",G="To help us find your old account, please enter the name you used when you originally created it.",P=R=>R!==l?null:n(N,{children:[n(Q,{children:[e("strong",{children:"Reminder:"})," ",R==="name"?G:g]}),r.general&&e(H,{variant:"error",children:r.general}),R==="email"&&e(b,{label:"Email Address",id:"email",name:"email",value:t.email,onChange:m,error:r.email,placeholder:"[email protected]",autoFocus:!0}),R==="name"&&n(N,{children:[e(b,{label:"First Name",id:"firstName",name:"firstName",value:t.firstName,onChange:m,error:r.firstName,autoFocus:!0}),e(b,{label:"Last Name *",id:"lastName",name:"lastName",value:t.lastName,onChange:m,error:r.lastName})]}),R==="username"&&e(b,{label:"Username",id:"username",name:"username",value:t.username,onChange:m,error:r.username,autoFocus:!0})]});return n("div",{className:"flex flex-col gap-16",children:[e(B,{title:"Account Recovery"}),n("div",{className:"flex flex-col gap-4",children:[e("h1",{className:"font-display text-foreground text-4xl font-bold",children:K}),e("p",{className:"text-muted-foreground text-base",children:"What's your email address, name, or username?"})]}),n("div",{className:"flex flex-col gap-16",children:[e(X,{active:l==="email",onClick:()=>E("email"),children:"Email Address"}),P("email"),e(X,{active:l==="name",onClick:()=>E("name"),children:"Name"}),P("name"),e(X,{active:l==="username",onClick:()=>E("username"),children:"Username"}),P("username")]}),e(J,{type:"button",onClick:_,disabled:C,children:"Continue"}),e(ee,{})]})}return y===2?n("div",{className:"flex flex-col gap-16",children:[e(B,{title:"Account Recovery"}),e(oe,{onClick:S}),n("div",{className:"flex flex-col gap-4",children:[e("h1",{className:"font-display text-foreground text-4xl font-bold",children:K}),e("p",{className:"text-muted-foreground text-base",children:"Additional information will help us find your account"})]}),e(se,{step:2}),n(Q,{children:[e("strong",{children:"Reminder:"})," To help us find your old account, please enter the information you used when you originally created it."]}),n("p",{className:"text-muted-foreground text-base font-medium",children:[l==="email"&&t.email&&n(N,{children:["Email Address: ",e("strong",{children:t.email})]}),l==="name"&&(t.firstName||t.lastName)&&n(N,{children:["Name: ",e("strong",{children:[t.firstName,t.lastName].filter(Boolean).join(" ")})]}),l==="username"&&t.username&&n(N,{children:["Username: ",e("strong",{children:t.username})]})]}),n("form",{className:"flex flex-col gap-24",onSubmit:g=>{g.preventDefault(),_()},children:[r.general&&e(H,{variant:"error",children:r.general}),n("div",{className:"flex flex-col gap-12",children:[l==="email"&&n(N,{children:[e(b,{label:"Username",id:"username",name:"username",value:t.username,onChange:m,error:r.username,placeholder:"Username"}),n("div",{className:"flex w-full flex-col gap-4",children:[e(re,{htmlFor:"firstName",children:"Name"}),e(L,{id:"firstName",name:"firstName",value:t.firstName,onChange:m,placeholder:"First name","aria-label":"First name",className:"h-48 rounded-12 text-base","aria-invalid":!!r.firstName||void 0,"aria-describedby":r.firstName||r.lastName?"name-error":void 0}),e(L,{id:"lastName",name:"lastName",value:t.lastName,onChange:m,placeholder:"Last name","aria-label":"Last name",className:"h-48 rounded-12 text-base","aria-invalid":!!r.lastName||void 0,"aria-describedby":r.firstName||r.lastName?"name-error":void 0}),(r.firstName||r.lastName)&&e("p",{id:"name-error",role:"alert","aria-live":"polite",className:"text-destructive text-sm",children:r.firstName||r.lastName})]})]}),l==="name"&&n(N,{children:[e(b,{label:"Email Address",id:"email",name:"email",type:"email",value:t.email,onChange:m,error:r.email,placeholder:"[email protected]"}),e(b,{label:"Username",id:"username",name:"username",value:t.username,onChange:m,error:r.username,placeholder:"Username"})]}),l==="username"&&n(N,{children:[e(b,{label:"Email Address",id:"email",name:"email",type:"email",value:t.email,onChange:m,error:r.email,placeholder:"[email protected]"}),n("div",{className:"flex w-full flex-col gap-4",children:[e(re,{htmlFor:"firstName",children:"Name"}),e(L,{id:"firstName",name:"firstName",value:t.firstName,onChange:m,placeholder:"First name","aria-label":"First name",className:"h-48 rounded-12 text-base","aria-invalid":!!r.firstName||void 0,"aria-describedby":r.firstName||r.lastName?"name-error":void 0}),e(L,{id:"lastName",name:"lastName",value:t.lastName,onChange:m,placeholder:"Last name","aria-label":"Last name",className:"h-48 rounded-12 text-base","aria-invalid":!!r.lastName||void 0,"aria-describedby":r.firstName||r.lastName?"name-error":void 0}),(r.firstName||r.lastName)&&e("p",{id:"name-error",role:"alert","aria-live":"polite",className:"text-destructive text-sm",children:r.firstName||r.lastName})]})]}),e(b,{label:"Date of Birth (Month/Day) *",id:"birthDate",name:"birthDate",value:t.birthDate,onChange:g=>k(g.target.value),error:r.birthDate,placeholder:"MM/DD",maxLength:5}),e(Oe,{value:t.country,error:r.country,onChange:M}
1),e(b,{label:"Zip Code *",id:"zipCode",name:"zipCode",value:t.zipCode,onChange:m,error:r.zipCode,placeholder:"00000"})]}),e(J,{type:"submit",children:"Continue"})]}),e(ee,{})]}):n("div",{className:"flex flex-col gap-16",children:[e(B,{title:"Account Recovery"}),e(oe,{onClick:S}),n("div",{className:"flex flex-col gap-4",children:[e("h1",{className:"font-display text-foreground text-4xl font-bold",children:K}),e("p",{className:"text-muted-foreground text-base",children:"Where can we reach you?"})]}),e(se,{step:3}),e(Q,{children:"We'll send your account recovery information to this email address."}),n("form",{className:"flex flex-col gap-24",onSubmit:j,children:[r.general&&e(H,{variant:"error",children:r.general}),n("div",{className:"flex flex-col gap-12",children:[e(b,{label:"Contact Email",id:"recoveryEmail",name:"recoveryEmail",type:"email",value:t.recoveryEmail,onChange:m,error:r.recoveryEmail,placeholder:"[email protected]"}),e(b,{label:"Confirm Email",id:"confirmRecoveryEmail",name:"confirmRecoveryEmail",type:"email",value:t.confirmRecoveryEmail,onChange:m,error:r.confirmRecoveryEmail,placeholder:"[email protected]"})]}),l==="email"&&x&&n(H,{variant:"info",children:[e("p",{className:"mb-8",children:"You entered the same email for both your account and recovery contact. If you still have access to this email, try resetting your password instead."}),n("div",{className:"flex gap-8",children:[e("button",{type:"button",onClick:$,className:"bg-brand-600 rounded-full px-16 py-4 text-sm font-semibold text-white hover:opacity-90",children:"Reset my password"}),e("button",{type:"button",onClick:Z,className:"border-border text-foreground rounded-full border px-16 py-4 text-sm font-semibold hover:bg-muted",children:"Use a different email"})]})]}),n("div",{className:"flex flex-col items-center gap-8",children:[e(Re,{ref:i,sitekey:q.captcha.recaptchaV2.key,onChange:c,onExpired:W,onErrored:T}),n("p",{className:"text-muted-foreground text-center text-sm",children:["Having trouble with verification?"," ",e(ae,{href:q.appUrl.supportArticle,target:"_blank",rel:"noopener noreferrer",className:"font-normal",children:"Contact our support team"})]})]}),e(J,{type:"submit",disabled:w,children:s?"Submitting...":"Submit"})]}),e(ee,{})]})}export{ma 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.