1var V=Object.defineProperty;var T=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var A=(i,t,o)=>t in i?V(i,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[t]=o,f=(i,t)=>{for(var o in t||(t={}))$.call(t,o)&&A(i,o,t[o]);if(T)for(var o of T(t))G.call(t,o)&&A(i,o,t[o]);return i};import{a as l,_ as e}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-B177jzqY.js";import{cn as M,cv as Z,iZ as J,c$ as K,j as c,bU as I,bT as Q,j6 as X}from"./index-B9O2cfno.js";import{g as Y,h as ee}from"./index.esm-CuP3mDAg.js";import{a as h}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js-ClGO9exV.js";import{l as L}from"./logger-YHhloPCO.js";import{P as re}from"./PasswordVisibilityAdornment-DqSgn8Hl.js";import{S as U,a as E}from"./StyledTextField-Bs6qQcIH.js";import{A as te}from"./AuthFormFirebase-DCounZ6e.js";import{S as oe}from"./StyledFormAlert-CuxIc--d.js";import{S as ae}from"./StyledFormButton-DeHQ3VmN.js";import{S as se}from"./StyledFormDivider-DMPDnPdK.js";import{S as ie}from"./StyledFormHeader-CzekTayY.js";import{S as ne}from"./StyledFormHelperTypography-DwQFppRn.js";import{S as le,a as de}from"./StyledFormLegalDisclaimerTypography-DfaZ1jZq.js";import{S as ce}from"./StyledFormSubheader-DS8KbvW1.js";import{L as W}from"./Link-jPbx2fgb.js";import{A as me}from"./ArrowBack-DonIluNH.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js_commonjs-proxy-D_fXcg40.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___mf_0_unleash_mf_1_proxy_mf_2_client_mf_2_react__loadShare__.js-BdtqsXmB.js";import"./_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_mf_2_dom__loadShare__.js-ckyQG2Wp.js";import"./Select-BBMTu6sl.js";import"./isMuiElement-ByswdNQJ.js";import"./List-C5bK9afY.js";import"./TextField-Cxuy6esU.js";import"./Divider-Ds-LqyRJ.js";import"./dividerClasses-cApOefCC.js";function Me(){var k,x,C,F;const i=M(),t=Y(Z()),[o,u]=h(!1),[y,B]=h({}),[d,m]=h({}),[g,_]=h(!1),{mutation:w,results:D}=J(),{LogoSvg:b}=K((x=(k=c().currentUser)==null?void 0:k.providerId)!=null?x:"")||{},p=o||D.loading,q=()=>_(!g),S=s=>{const r=f({},y),a=s.target.name;r[a]=s.target.value,B(r);const n=f({},d);delete n[a],delete n.general,m(n)},z=async s=>{var r;try{s==null||s.preventDefault();const{username:a,password:n}=y;if(!a){m({username:"Username is required"});return}if(!n){m({password:"Password is required"});return}u(!0);const N=ee(t,"firebaseAuth"),{data:R}=await N({identifier:a,password:n}),{error:P,firebaseToken:j}=R;if(P)throw P;const v=new URL(window.location.href);v.searchParams.set("returnUrl","/u/".concat((r=c().currentUser)==null?void 0:r.uid,"/s/dashboard?tab=link-account")),window.history.pushState(null,"",v.toString());const O=await(await X(c(),j)).user.getIdToken();await w({variables:{token:O}})}catch(a){const n=a;u(!1),L.error({error:n}),m({general:n.message||"Failed to sign in. Likely invalid username/password."})}},H=async s=>{try{s==null||s.preventDefault();const r=c().currentUser;u(!0);const a=await(r==null?void 0:r.getIdToken());if(!a||!r)throw new Error("Unable to user/fetch token");await w({variables:{token:a}})}catch(r){const a=r;u(!1),L.error({err:r}),m({general:a.message||"Failed to sign in. Likely invalid username/password."})}};return l("div",{children:[l(te,{onSubmit:z,children:[e(ie,{children:"Welcome!"}),l(ce,{children:["We didn't find an existing account matching the email:",e("br",{}),e("strong",{children:(C=c().currentUser)==null?void 0:C.email}),".",e("br",{}),e("br",{}),"If you have an existing account, please sign in below and you will be directed to link your accounts in settings."]}),e(oe,{title:"Error logging in",body:d.general}),e(U,{sx:{mt:"18px"},htmlFor:"username",children:"Email/Username"}),e(E,{autoFocus:!0,id:"username","data-test":"username",disabled:p,error:!!d.username,fullWidth:!0,helperText:d.username,name:"username",margin:"dense",onChange:S,placeholder:"Enter a username",required:!0,type:"text",InputLabelProps:{shrink:!0},inputProps:{autoCapitalize:"off"}}),e(U,{htmlFor:"password",children:"Password"}),e(E,{id:"password","data-test":"password",disabled:p,error:!!d.password,fullWidth:!0,helperText:d.password,name:"password","data-sr-redact":!0,margin:"dense",onChange:S,required:!0,type:g?"text":"password",InputLabelProps:{shrink:!0},InputProps:{endAdornment:e(re,{showPassword:g,handleClickShowPassword:q})},placeholder:""}),e(ae,{type:"submit","data-test":"submit",color:"primary",fullWidth:!0,variant:"contained",disabled:p,children:"Sign In"}),e(le,{style:{fontWeight:400},"data-test":"forgot-password-button",to:"/auth/forgot-password/",children:"Forgot Password?"}),e(se,{variant:"fullWidth",orientation:"horizontal",flexItem:!0,children:"OR CREATE A NEW ACCOUNT"}),e(I,{disabled:p,fullWidth:!0,variant:"outlined",sx:{marginBottom:"32px"},onClick:H,children:l("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[b&&e(b,{width:32,height:32}),l(Q,{textAlign:"left",sx:{marginLeft:"6px"},children:[e("strong",{children:"Create a new Photobucket account for:"}),e("br",{}),(F=c().currentUser)==null?void 0:F.email]})]})}),l(ne,{children:["If you already have a Photobucket account using another email,"," ",e("strong",{style:{color:i.palette.customError[500]},children:"don't create a new account"}),". Instead, sign in above."]}),l(de,{sx:{fontSize:"16px"},children:["This site is protected by reCAPTCHA and the Google"," ",e(W,{style:{color:"#1C47CB"},href:"https://policies.google.com/privacy",underline:"always","data-test":"google-privacy",children:"Privacy Policy"})," ","and"," ",e(W,{style:{color:"#1C47CB"},href:"https://policies.google.com/terms",underline:"always","data-test":"google-terms-of-service",children:"Terms of Service"})," ","apply."]})]}),e("div",{style:{marginTop:"6px",display:"flex",alignContent:"flex-start"},children:e(I,{variant:"text",startIcon:e(me,{}),onClick:()=>{window.location.href="/auth/login/"},children:"Back"})})]})}export{Me 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.