import{a as P}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-E43N735O.js";import{a as C}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-JVKNTGXC.js";import{$ as L,g as T}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-4WGLXVPZ.js";import{a as k}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-J44IZTW2.js";import{d as y}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-GFXNKJ5U.js";import{a as s}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-FWBXOOCE.js";import{l as E}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-YAHMRLQ4.js";import{a as o}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-34QOOIQ4.js";import{a as b,o as a,t as v,w as N,x as h}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-C4I3W2OX.js";import{a as A}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-LL6AKNEK.js";import{a as B}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-LQ2PFFE3.js";import{d as g}from"https://cdn.shopify.com/oxygen-v2/26437/10785/22343/1653408/build/_shared/chunk-H7QMOPDN.js";var l=g(B());var e=g(A()),c={login:"/account/login",register:"/account/register"},I=()=>{let n=N(),[i,m]=v(),[d,O]=(0,l.useState)(null),[u,x]=(0,l.useState)(null),[S,R]=(0,l.useState)(""),w=b(),r=w.pathname.includes(c.login),p=w.pathname.includes(c.register),_=i.data.storeDomain.includes("australia"),j=m.data.rechargeIsOn,{Form:D,state:f}=h(),F=t=>{let{value:M}=t.target;R(M)};return(0,e.jsxs)("div",{className:o("content-wrapper flex-col"),children:[(0,e.jsxs)("div",{className:"mb-8 flex w-full max-w-[840px] flex-col justify-between gap-8 pt-8 md:mb-16 md:pt-24 lg:flex-row lg:gap-0",children:[(0,e.jsx)(s.H3,{className:" text-center !text-[32px] font-[700] md:!text-[48px]",children:"Medshop Account"}),r&&_&&(0,e.jsxs)(a,{to:"/account/b2b/login",className:"flex h-12 items-center justify-center gap-2.5 rounded-lg border-2 border-ORANGE_ONE px-5 py-3 lg:justify-between",children:[(0,e.jsx)(T,{width:20,src:L.user,className:"filter--image_orange h-5 w-5"}),(0,e.jsx)("div",{className:"inline-block font-inter text-md font-[600]",children:"B2B login"})]})]}),(0,e.jsx)("div",{className:"mb-16 flex w-full max-w-[840px] justify-center md:mb-24",children:(0,e.jsxs)(D,{method:"post",noValidate:!0,className:"flex w-full flex-col gap-6 md:gap-8",children:[(0,e.jsxs)("div",{className:"flex w-full justify-between border-b border-GREY_SEVEN md:justify-start md:gap-5",children:[(0,e.jsx)(a,{to:c.login,className:o("flex w-1/2 md:w-auto",r?"border-b-2 border-ORANGE_ONE":""),children:(0,e.jsx)(s.H4,{className:o("flex w-full justify-center pb-4 font-[700]",r?" text-ORANGE_ONE ":""),children:"Sign in"})}),(0,e.jsx)(a,{className:o("flex w-1/2 md:w-auto",p?"border-b-2 border-ORANGE_ONE":""),to:c.register,children:(0,e.jsx)(s.H4,{className:o("flex w-full justify-center pb-4 font-[700]",p?" text-ORANGE_ONE ":""),children:"Create account"})})]}),n?.formError&&(0,e.jsx)("div",{className:"mb-6 flex items-center justify-center rounded-sm border border-red p-4 text-sm text-red",children:(0,e.jsx)("p",{children:n.formError})}),(0,e.jsxs)("div",{className:"mt-1 flex w-full flex-col gap-6 md:mt-0 md:gap-8",children:[(0,e.jsxs)("div",{className:"relative flex w-full flex-col",children:[(0,e.jsx)(y.TextInput,{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,value:S,placeholder:"Email address *","aria-label":"Email address",className:o(d?"border-red":""),onChange:F,onBlur:t=>{O(t.currentTarget.value.length&&!t.currentTarget.validity.valid?"Invalid email address":null)}}),(0,e.jsx)(s.P3,{className:"absolute bottom-[-18px] text-sm text-red",children:d})]}),(0,e.jsxs)("div",{className:"relative flex w-full flex-col",children:[(0,e.jsx)(y.TextInput,{id:"password",name:"password",type:"password",autoComplete:"current-password","aria-label":"Password",minLength:8,required:!0,placeholder:"Password *",className:o(u?"border-red":""),onBlur:t=>{t.currentTarget.validity.valid||!t.currentTarget.value.length?x(null):x(t.currentTarget.validity.valueMissing?"Please enter a password":"Passwords must be at least 8 characters")}}),(0,e.jsx)(s.P3,{className:"absolute bottom-[-18px] text-sm text-red",children:u})]})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center gap-7 md:flex-row md:gap-8",children:[(0,e.jsxs)(k.Primary,{type:"submit",className:"h-12 rounded-lg px-[22px] md:!w-auto",disabled:!!(u||d||f!=="idle"),children:[r&&(f!=="idle"?"Signing in...":"Sign In"),p&&(f!=="idle"?"Registration...":"Create account")]}),r&&(0,e.jsx)("div",{className:"flex justify-between",children:(0,e.jsx)("p",{className:"text-sm",children:(0,e.jsx)(a,{className:"inline-block align-baseline font-inter text-md font-[600] text-BLACK underline",to:"/account/recover",children:"Forgot password?"})})}),r&&j&&(0,e.jsx)("div",{className:"flex justify-between",children:(0,e.jsx)("p",{className:"text-sm",children:(0,e.jsx)(a,{className:"inline-block align-baseline font-inter text-md font-[600] underline",to:"/account/login/subscriptions",children:"Manage Subscriptions"})})})]})]})}),(0,e.jsx)(C,{})]})};var Q=({data:n})=>{let i="https://cdn.shopify.com/s/files/1/0012/8440/7394/files/placegolder.svg?v=1701691776",m=E({title:P("Account Login",n?.storeDomain)},{description:"Access your Medshop account to manage orders, view history, and update information securely."});return[{property:"og:image",content:i},{property:"twitter:image",content:i},...m]},X={isPublic:!0};var Z=I;export{Q as a,X as b,Z as c};