1import{a as be}from"/build/_shared/chunk-PM6ILAF3.js";import{a as we}from"/build/_shared/chunk-RKJDYHBD.js";import{a as Qe}from"/build/_shared/chunk-S5K65DFL.js";import"/build/_shared/chunk-T2YKGDOA.js";import{a as he}from"/build/_shared/chunk-KEZ2BJXF.js";import{a as ue}from"/build/_shared/chunk-HZUP3KCC.js";import{a as Je}from"/build/_shared/chunk-BIDICA45.js";import{b as de}from"/build/_shared/chunk-EDLWQGBH.js";import{a as ge}from"/build/_shared/chunk-ZDXAFWYJ.js";import{a as fe}from"/build/_shared/chunk-NB4ZCS2I.js";import{a as me}from"/build/_shared/chunk-ZQMOYU4H.js";import{b as le}from"/build/_shared/chunk-E4W4NR36.js";import"/build/_shared/chunk-TDMNQ5CT.js";import"/build/_shared/chunk-US3DNLVM.js";import{a as ce}from"/build/_shared/chunk-JVDEVG2I.js";import{a as ae}from"/build/_shared/chunk-42ITEOR7.js";import{a as F}from"/build/_shared/chunk-5KTLGSZR.js";import"/build/_shared/chunk-Y3BPLONU.js";import"/build/_shared/chunk-2VHJHPYT.js";import"/build/_shared/chunk-PE2RAMGK.js";import{a as U}from"/build/_shared/chunk-NUNS6FJ7.js";import{a as $}from"/build/_shared/chunk-I4DDJGKJ.js";import"/build/_shared/chunk-YNIM7QIU.js";import{a as re,b as ie}from"/build/_shared/chunk-RZLDKGLN.js";import{a as se}from"/build/_shared/chunk-POUH3CHJ.js";import{c as P}from"/build/_shared/chunk-CBDM7QYU.js";import"/build/_shared/chunk-JORURDHL.js";import"/build/_shared/chunk-FONEQPGK.js";import{a as te}from"/build/_shared/chunk-I5UT2UAU.js";import"/build/_shared/chunk-UXJUA2QE.js";import"/build/_shared/chunk-WIUTVNXB.js";import{a as Ye}from"/build/_shared/chunk-AND5KUBT.js";import{a as Xe}from"/build/_shared/chunk-M4KRBYOQ.js";import{a as pe}from"/build/_shared/chunk-Y2WIWXRO.js";import{a as y}from"/build/_shared/chunk-ZZB7OGT7.js";import{a as ne}from"/build/_shared/chunk-YKKU63IT.js";import{a as oe}from"/build/_shared/chunk-RKA7QBAZ.js";import"/build/_shared/chunk-DJYF5FUS.js";import{a as ee,b as A}from"/build/_shared/chunk-V53WT573.js";import{a as L}from"/build/_shared/chunk-YUUKFOQM.js";import"/build/_shared/chunk-SSOADWM3.js";import"/build/_shared/chunk-X7KDVMAY.js";import"/build/_shared/chunk-4IHN3LFR.js";import"/build/_shared/chunk-7OOGFDHZ.js";import"/build/_shared/chunk-DEVQKMWM.js";import{a as ze}from"/build/_shared/chunk-KPWQHS6G.js";import"/build/_shared/chunk-SF7SKMF7.js";import{g as Y,k as J,t as X,v as Q}from"/build/_shared/chunk-L4FEFM7G.js";import{a as k}from"/build/_shared/chunk-5OBEDPFR.js";import{a as H}from"/build/_shared/chunk-H6S7FWVP.js";import{b as qe,d as c}from"/build/_shared/chunk-T36URGAI.js";var Ne=qe((Pt,ve)=>{ve.exports={}});var tt=c(ze());var xe=c(H());var u=c(k()),Ce=({error:i,state:n,className:d,enabledSignInLinks:o,isUsingWishlist:t,csrf:m,generateNewCsrfTokenCheck:s,...r})=>{let[g,w]=(0,xe.useState)(""),p=t?"wishlist":"account",{translate:x,unsafeTranslate:_}=L();return(0,u.jsxs)("div",{className:d,"data-test-id":"login-form",children:[i&&(0,u.jsx)(P,{type:"error",message:_(i)}),(0,u.jsx)(he,{action:"/login",method:"post",className:"mx-auto max-w-screen-2xl",children:(0,u.jsxs)("fieldset",{disabled:n==="submitting",children:[(0,u.jsx)("input",{type:"hidden",name:"csrf",value:m}),(0,u.jsx)($,{className:"mb-5",labelClassName:"font-normal text-base",containerClassName:"gap-2",required:!0,name:"username",label:x("signIn.labelEmailAddress"),type:"email",value:g,onChange:M=>w(M.target.value),onFocus:s}),(0,u.jsx)($,{className:"mb-3",labelClassName:"font-normal text-base",containerClassName:"gap-2",required:!0,name:"password",label:x("signIn.labelPassword"),type:"password",onFocus:s}),(0,u.jsx)("div",{className:"flex flex-row pb-3",children:(0,u.jsx)(y,{className:"underline hover:no-underline",to:`/reset-password?email=${encodeURIComponent(g)}`,children:x("signIn.linkForgottenPassword")})}),o&&(0,u.jsx)("div",{className:"flex flex-row pb-2",children:(0,u.jsx)(y,{className:"underline hover:no-underline",to:`/sign-in-link?email=${encodeURIComponent(g)}&source=${p}`,children:x("signIn.emailSignInLink")})}),(0,u.jsx)(A,{"data-test-id":"login-button",variant:"primary",className:"mt-2 mx-auto block w-full h-[50px]",loading:n!=="idle",type:"submit",children:x("sign
1In.subtitle")})]})})]})};var l=c(H());var ot=c(Xe());var f=c(k()),ke=({accountBenefits:i,className:n=""})=>{var o;let{translate:d}=L();return i?(0,f.jsxs)("div",{className:`${n} w-full max-w-[500px] mx-auto`,children:[(0,f.jsx)("h1",{className:"font-semibold text-[24px] leading-[30px] mb-2 text-left",children:d("signIn.buttonCreateAccount")}),(0,f.jsx)("p",{className:"font-light text-[16px] leading-[20px] mb-4 text-left",children:i.title}),(0,f.jsx)("div",{className:"flex justify-center w-full",children:(0,f.jsx)("div",{className:"flex flex-row items-start space-x-4 rounded-s mx-auto w-full max-w-[500px]",children:(o=i.accountBenefitIconList)==null?void 0:o.filter(t=>{var m,s;return t&&((s=(m=t.accountBenefitIcon.data)==null?void 0:m.attributes)==null?void 0:s.url)}).map((t,m)=>{var s,r,g,w,p;return t=t,(0,f.jsxs)("div",{className:"flex flex-col items-center text-center w-[30%]",children:[(0,f.jsx)("div",{className:"h-[48px] w-[48px] flex items-center justify-center rounded-full shadow-md mb-2 overflow-hidden",children:(0,f.jsx)("img",{src:(r=(s=t.accountBenefitIcon.data)==null?void 0:s.attributes)==null?void 0:r.url,alt:(p=(w=(g=t.accountBenefitIcon.data)==null?void 0:g.attributes)==null?void 0:w.alternativeText)!=null?p:"",className:"max-w-[48px] max-h-[48px] object-contain"})}),(0,f.jsx)("h2",{className:"font-semibold text-sm leading-[17.5px] min-h-[24px]",children:t.accountBenefitIconListTitle}),(0,f.jsx)("p",{className:"font-light text-xs leading-[15px] min-h-[40px]",children:t.accountBenefitIconListSubTitle})]},m)})})})]}):null};var Le=c(H());function ye(){let i=(0,Le.useContext)(ue),n=F();if(!i||!globalThis.AwsWafIntegration)return{submit:n.submit,state:n.state,data:n.data};let{getATPToken:d,hasATPToken:o}=et();return{submit:(t,m)=>{if(o()){n.submit(t,m);return}d().then(s=>{if(!s){console.error("Failed to get ATP token");return}n.submit(t,m)}).catch(s=>console.error(s))},state:n.state,data:n.data}}var et=()=>{var d,o;let i=(d=globalThis.AwsWafIntegration)==null?void 0:d.getToken;if(!i)throw new R("getToken");let n=(o=globalThis.AwsWafIntegration)==null?void 0:o.hasToken;if(!n)throw new R("hasToken");return{getATPToken:async()=>{try{return(await i()).ok}catch(t){return console.error(t),!1}},hasATPToken:()=>n()}},R=class extends Error{constructor(n){super("WAF integration error. Unable to find function: "+n),this.name="WafIntegrationError"}};var nt=c(Je()),rt=c(Ye());var S=c(k()),N=({url:i,loading:n,name:d,className:o,icon:t})=>{let{translate:m}=L();return(0,S.jsx)(y,{to:i,disabled:n,children:(0,S.jsx)(A,{loading:n,type:"button",className:`w-full rounded px-5 h-[50px] border-grey-2 border hover:text-grey-4 ${o||""}`,children:(0,S.jsxs)("div",{className:"flex justify-center items-center gap-[9px] ",children:[(0,S.jsx)(te,{icon:t}),(0,S.jsx)("span",{className:"font-normal tracking-[-2%]",children:m("signIn.socialIdP",{name:d})})]})})})};var Se={width:19,height:18,paths:'<path fill-rule="evenodd" clip-rule="evenodd" d="M18.14 9.20456C18.14 8.56637 18.0827 7.95274 17.9764 7.36365H9.5V10.845H14.3436C14.135 11.97 13.5009 12.9232 12.5477 13.5614V15.8196H15.4564C17.1582 14.2527 18.14 11.9455 18.14 9.20456Z" fill="#4285F4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M9.5 18C11.93 18 13.9673 17.1941 15.4564 15.8196L12.5477 13.5614C11.7418 14.1014 10.7109 14.4205 9.5 14.4205C7.15591 14.4205 5.17182 12.8373 4.46409 10.71H1.45728V13.0418C2.93818 15.9832 5.98182 18 9.5 18Z" fill="#34A853"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.46409 10.71C4.28409 10.17 4.18182 9.59319 4.18182 9.00001C4.18182 8.40683 4.28409 7.83001 4.46409 7.29001V4.95819H1.45727C0.847727 6.17319 0.5 7.54774 0.5 9.00001C0.5 10.4523 0.847727 11.8268 1.45727 13.0418L4.46409 10.71Z" fill="#FBBC05"/><path fill-rule="evenodd" clip-rule="evenodd" d="M9.5 3.57955C10.8214 3.57955 12.0077 4.03364 12.9405 4.92545L15.5218 2.34409C13.9632 0.891818 11.9259 0 9.5 0C5.98182 0 2.93818 2.01682 1.45728 4.95818L4.46409 7.29C5.17182 5.16273 7.15591 3.57955 9.5 3.57955Z" fill="#EA4335"/>'};var Ae={width:21,height:22,paths:'<rect y="0.5" width="21" height="21" rx="5" fill="#FFA7D1"/><path d="M14.9093 4.5H12.1627C12.1627 6.75315 10.7804 8.77193 8.68008 10.2139L7.85429 10.7908V4.5H5V17.1176H7.85429V10.8628L12.5756 17.1176H16.0582
1L11.5164 11.1332C13.5809 9.63717 14.9272 7.31189 14.9093 4.5Z" fill="#0B051D"/></svg>'};var Ie={width:24,height:24,paths:'<g clip-path="url(#clip0_120_173)"><path d="M24 12C24 5.376 18.624 0 12 0C5.376 0 0 5.376 0 12C0 17.808 4.128 22.644 9.6 23.76V15.6H7.2V12H9.6V9C9.6 6.684 11.484 4.8 13.8 4.8H16.8V8.4H14.4C13.74 8.4 13.2 8.94 13.2 9.6V12H16.8V15.6H13.2V23.94C19.26 23.34 24 18.228 24 12Z" fill="#1877F2"/></g><defs><clipPath id="clip0_120_173"><rect width="24" height="24" fill="white"/></clipPath></defs>'};var Te={width:16,height:18,paths:'<g clip-path="url(#clip0_120_123)"><path d="M7.73999 3.94615C8.52002 3.94615 9.4978 3.42435 10.0801 2.72861C10.6074 2.09809 10.9919 1.21755 10.9919 0.336999C10.9919 0.217418 10.981 0.0978386 10.959 0C10.0911 0.0326128 9.04736 0.57616 8.42114 1.30451C7.92676 1.85893 7.47632 2.72861 7.47632 3.62003C7.47632 3.75048 7.49829 3.88093 7.50928 3.92441C7.56421 3.93528 7.6521 3.94615 7.73999 3.94615ZM4.99341 17.1C6.05908 17.1 6.53149 16.3934 7.86084 16.3934C9.21216 16.3934 9.50879 17.0783 10.6953 17.0783C11.8599 17.0783 12.6399 16.0129 13.376 14.9693C14.2 13.7735 14.5405 12.5994 14.5625 12.5451C14.4856 12.5233 12.2554 11.621 12.2554 9.08811C12.2554 6.89218 14.0132 5.90292 14.1121 5.82683C12.9475 4.17444 11.1787 4.13096 10.6953 4.13096C9.38794 4.13096 8.32227 4.91367 7.6521 4.91367C6.927 4.91367 5.97119 4.17444 4.8396 4.17444C2.68628 4.17444 0.5 5.93554 0.5 9.26205C0.5 11.3275 1.31299 13.5126 2.31274 14.9258C3.16968 16.1216 3.91675 17.1 4.99341 17.1Z" fill="#050708"/></g><defs><clipPath id="clip0_120_123"><rect width="15" height="18" fill="white" transform="translate(0.5)"/></clipPath></defs>'};var it=c(Qe());var Ee=c(Ne()),e=c(k());var st=({matches:i})=>[...pe(i),{title:"Login"}];var at=()=>!1;function Pe(){var q;let i=Y(),n=ye(),d=X(),o=Q(),t=n.data,{emailFromUrl:m,code:s,loginContent:r,fascia:g,isUsingWishlist:w,socialLoginUrls:p,external:x,csrf:_,csrfTimeStamp:M}=d,O=(0,l.useContext)(ae),Fe=(0,l.useContext)(re),{lastAddedToWishlist:D}=(0,l.useContext)(me),[Ue,B]=(0,l.useState)(!1),I=ne(),{translate:C}=L(),[Re]=J(),{enableRewards:_e,enableSignInLinks:Me,enableSignInWithKlarna:V,enableSignInWithApple:W,enableSignInWithMeta:K,enableSignInWithGoogle:Oe}=(0,l.useContext)(se),{sendLogin:De}=ce(),{sendSignUp:Be}=we(),G=(0,l.useRef)(!1),[We,He]=(0,l.useState)(_),T=F(),E=(0,l.useRef)(!1),{buildProductUrl:$e}=oe(),{checkoutUrl:Ve}=de();(0,l.useEffect)(()=>{var a;(a=T.data)!=null&&a.csrf&&(He(T.data.csrf),E.current=!1)},[T.data]);let Ke=()=>{if(E.current)return;Date.now()-M>6e4&&(E.current=!0,T.load("/login"))},j={};Re.forEach((a,b)=>{j[b]=decodeURIComponent(a)});let Z=Object.entries(j).map(([a,b])=>`${a}=${b}`).join("&"),Ge=Z?`?${Z}`:"";fe({pageCategory:"account",subCategory:"login"}),ge();let h=r==null?void 0:r.loginMessage;(0,l.useEffect)(()=>{s&&x&&(B(!0),n.submit({code:s,formType:"externalSignIn",provider:new URLSearchParams(window.location.search).get("provider")||""},{method:"post"}))},[s,x]),(0,l.useEffect)(()=>{if(s&&m){let a=new FormData;a.append("email",m),a.append("code",s),a.append("formType","signInLink"),B(!0),n.submit(a,{method:"post"})}},[s,m]);let je=a=>{if(!a)return I(w?D?`${$e(D.slug)}?colour=${D.colourSelected}`:"/wishlist":"/account");a==="/checkout"?window.location.href=Ve:I(decodeURIComponent(a))};if((0,l.useEffect)(()=>{var a;if(o&&"cart"in o&&((a=O.setCart)==null||a.call(O,o.cart)),o&&"user"in o||t!=null&&t.user){let b=o&&"user"in o?o.user:t.user;ie(b,g,Fe),o&&"method"in o&&De(b,o.method,"returning");let z=o&&"signUpMethod"in o?o.signUpMethod:t&&"signUpMethod"in t?t.signUpMethod:void 0;!G.current&&z&&(Be(z,{user:{email:b.email}}),G.current=!0),be(b.email).then(()=>{let Ze=new URL(window.location.href).searchParams.get("redirect");je(Ze)})}(o&&"error"in o||t&&"error"in t)&&(B(!1),E.current=!1,T.load("/login"))},[o,t]),Ue)return(0,e.jsx)("div",{className:"flex flex-col md:flex-row justify-center items-start gap-6 bg-bg-grey md:pt-12 md:pb-28 md:-mb-16 py-5",children:(0,e.jsxs)("div",{className:"md:w-1/3 w-full bg-site-background p-6 rounded-sm",children:[(0,e.jsx)(U,{as:"h1",className:"text-xl mb-4",children:C("signIn.signingIn")}),(0,e.jsx)(ee,{size:"large",containerClassName:"!relative"})]})});let v=i.state!=="idle"?i.state:n.state;return(0,e.jsxs)("div",{className:"flex flex-col md:flex-row justify-center items-start gap-6 bg-bg-grey md:pt-12 md:pb-28 md:-mb-16 py-5",children:[(0,e.jsxs)("div",{className:"md:w-1/3 w-full bg-site-background p-6 rounded-sm",children:[w&&(0,e.jsx)("div",{className:"mb-2",children:(0,e.jsx)(P,{message:C("signIn.addToWishlist"),type:"infoNew"})}),(0,e.jsx)(U,{as:"h1",className:"text-2xl mb-4 font-bold",children:C("signIn.subtitle")}),(0,e.jsx)(Ce,{error:o&&"error"in o?o.error:t==null?void 0:t.error,state:v,enabledSignInLinks:Me,isUsingWishlist:w,csrf:We,generateNewCsrfTokenCheck:Ke}),(r==null?void 0:r.useFamilyOfBrandsModal)&&h&&h.includes("family of brands")&&(0,e.jsxs)("div",{className:"pt-3",children:[(0,e.jsx)("span",{children:`${h.slice(0,h.indexOf("family"))}\xA0`}),(0,e.jsx)(y,{to:"/pages/informational/privacy#who-is-debenhams",target:"_blank",className:"underline",children:C("signIn.familyOfBrands")}),(0,e.jsx)("span",{children:`\xA0${h.slice(h.indexOf("family of brands")+17)}`})]}),h&&!(r!=null&&r.useFamilyOfBrandsModal)||h&&(r==null?void 0:r.useFamilyOfBrandsModal)&&!((q=r==null?void 0:r.loginMessage)!=null&&q.includes("family of brands"))&&(0,e.jsx)("div",{className:"pt-3",children:(0,e.jsx)(le,{markdown:h})}),(V||W||K||W)&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center my-4",children:[(0,e.jsx)("div",{className:"flex-grow border-t border-gray-300"}),(0,e.jsx)("span",{className:"mx-4 text-gray-500",children:C("signIn.textOr")}),(0,e.jsx)("div",{className:"flex-grow border-t border-gray-300"})]}),(0,e.jsxs)("div",{className:"flex gap-2 flex-col mb-2",children:[W&&(0,e.jsx)(N,{url:p.apple,loading:v!=="idle",name:"Apple",icon:Te}),Oe&&(0,e.jsx)(N,{url:p.google,loading:v!=="idle",name:"Google",icon:Se}),K&&(0,e.jsx)(N,{url:p.meta,loading:v!=="idle",name:"Facebook",icon:Ie}),V&&(0,e.jsx)(N,{url:p.klarna,loading:v!=="idle",name:"Klarna",icon:Ae})]})]})]}),(0,e.jsxs)("div",{className:"md:w-1/3 w-full bg-site-background p-6 rounded-sm",children:[_e?(0,e.jsx)(ke,{accountBenefits:r==null?void 0:r.accountBenefits}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(U,{as:"h1",className:"text-2xl mb-4 font-bold",children:C("signIn.newToFascia",{fasciaLabel:g.label})}),(0,e.jsx)("div",{className:"pb-5",children:C("signIn.textNew")})]}),(0,e.jsx)(A,{onClick:()=>{I(`/sign-up${Ge}`)},className:"w-full h-[50px] rounded",variant:"primary",dataTestId:"create-account-button",children:C("signIn.buttonCreateAccount")}
1)]})]})}export{Pe as default,st as meta,at as shouldRevalidate};
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.