"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[6964],{67293:(L,E,s)=>{s.d(E,{GU:()=>c,YO:()=>P,qm:()=>d});var n=s(74848),i=s(22803),x=s(96540),t=s(29675),g=s(11817),r=s(77455),p=s(50363);const d=({children:o,enterAnimation:e=!0})=>{const u=(0,t.of)(P);return(0,n.jsx)("div",{className:(0,i.cx)(u.loginInnerBox,e&&u.enterAnimation),children:o})},c=({children:o,branding:e,isChangingPassword:u})=>{const a=(0,t.of)(P),[M,h]=(0,x.useState)(!1),O=e?.loginSubtitle??r.M.GetLoginSubTitle(),m=e?.loginTitle??r.M.LoginTitle,_=e?.loginBoxBackground||r.M.LoginBoxBackground(),D=e?.loginLogo,j=e?.hideEdition??r.M.HideEdition;return(0,x.useEffect)(()=>h(!0),[]),(0,n.jsxs)(r.M.LoginBackground,{className:(0,i.cx)(a.container,M&&a.loginAnim,e?.loginBackground),children:[(0,n.jsx)("div",{className:a.loginMain,children:(0,n.jsxs)("div",{className:(0,i.cx)(a.loginContent,_,"login-content-box"),children:[(0,n.jsxs)("div",{className:a.loginLogoWrapper,children:[(0,n.jsx)(r.M.LoginLogo,{className:a.loginLogo,logo:D}),(0,n.jsx)("div",{className:a.titleWrapper,children:u?(0,n.jsx)("h1",{className:a.mainTitle,children:(0,n.jsx)(g.x6,{i18nKey:"login.layout.update-password",children:"Update your password"})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h1",{className:a.mainTitle,children:m}),O&&(0,n.jsx)("h3",{className:a.subTitle,children:O})]})})]}),(0,n.jsx)("div",{className:a.loginOuterBox,children:o})]})}),e?.hideFooter?(0,n.jsx)(n.Fragment,{}):(0,n.jsx)(p.wi,{hideEdition:j,customLinks:e?.footerLinks})]})},f=(0,i.keyframes)`
from{
  opacity: 0;
  transform: translate(-60px, 0px);
}

to{
  opacity: 1;
  transform: translate(0px, 0px);
}`,P=o=>({loginMain:(0,i.css)({flexGrow:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minWidth:"100%"}),container:(0,i.css)({minHeight:"100%",backgroundPosition:"center",backgroundRepeat:"no-repeat",flex:1,minWidth:"100%",marginLeft:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),loginAnim:(0,i.css)({"&:before":{opacity:1},".login-content-box":{opacity:1}}),submitButton:(0,i.css)({justifyContent:"center",width:"100%"}),loginLogo:(0,i.css)({width:"100%",maxWidth:60,marginBottom:o.spacing(2),[o.breakpoints.up("sm")]:{maxWidth:100}}),loginLogoWrapper:(0,i.css)({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",padding:o.spacing(3)}),titleWrapper:(0,i.css)({textAlign:"center"}),mainTitle:(0,i.css)({fontSize:22,[o.breakpoints.up("sm")]:{fontSize:32}}),subTitle:(0,i.css)({fontSize:o.typography.size.md,color:o.colors.text.secondary}),loginContent:(0,i.css)({maxWidth:478,width:"calc(100% - 2rem)",display:"flex",alignItems:"stretch",flexDirection:"column",position:"relative",justifyContent:"flex-start",zIndex:1,minHeight:320,borderRadius:o.shape.radius.default,padding:o.spacing(2,0),opacity:0,[o.transitions.handleMotion("no-preference","reduce")]:{transition:"opacity 0.5s ease-in-out"},[o.breakpoints.up("sm")]:{minHeight:o.spacing(40),justifyContent:"center"}}),loginOuterBox:(0,i.css)({display:"flex",overflowY:"hidden",alignItems:"center",justifyContent:"center"}),loginInnerBox:(0,i.css)({padding:o.spacing(0,2,2,2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,maxWidth:415,width:"100%",transform:"translate(0px, 0px)",[o.transitions.handleMotion("no-preference")]:{transition:"0.25s ease"}}),enterAnimation:(0,i.css)({[o.transitions.handleMotion("no-preference")]:{animation:`${f} ease-out 0.2s`}})})},34191:(L,E,s)=>{s.d(E,{s:()=>r});var n=s(74848),i=s(96540),x=s(58779),t=s(34128),g=s(99764);const r=(0,i.forwardRef)((p,d)=>{const[c,f]=(0,i.useState)(!1);return(0,n.jsx)(t.p,{...p,type:c?"text":"password","data-testid":x.Tp.pages.Login.password,ref:d,suffix:(0,n.jsx)(g.K,{name:c?"eye-slash":"eye","aria-controls":p.id,role:"switch","aria-checked":c,onClick:()=>{f(!c)},tooltip:c?"Hide password":"Show password"})})});r.displayName="PasswordField"},26964:(L,E,s)=>{s.r(E),s.d(E,{SignupPage:()=>u,default:()=>a});var n=s(74848),i=s(49785),x=s(28082),t=s(86489),g=s(34128),r=s(48583),p=s(54594),d=s(88023),c=s(17687),f=s(11817),P=s(4148),o=s(67293),e=s(34191);const u=({queryParams:M})=>{const h=(0,c._2)(),{handleSubmit:O,formState:{errors:m},register:_,getValues:D}=(0,i.mN)({defaultValues:{email:M.email,code:M.code}}),j=async l=>{l.name===""&&delete l.name,delete l.confirm,(await(0,x.AI)().post("/api/user/signup/step2",{email:l.email,code:l.code,username:l.email,orgName:l.orgName,password:l.password,name:l.name}).catch(y=>{const B=y.data?.message||y;h.warning(B)})).code==="redirect-to-select-org"&&window.location.assign((0,d.zj)().appSubUrl+"/profile/select-org?signup=1"),window.location.assign((0,d.zj)().appSubUrl+"/")};return(0,n.jsx)(o.GU,{children:(0,n.jsx)(o.qm,{children:(0,n.jsxs)("form",{onSubmit:O(j),style:{width:"100%"},children:[(0,n.jsx)(t.D,{label:"Your name",children:(0,n.jsx)(g.p,{id:"user-name",..._("name"),placeholder:"(optional)"})}),(0,n.jsx)(t.D,{label:"Email",invalid:!!m.email,error:m.email?.message,children:(0,n.jsx)(g.p,{id:"email",..._("email",{required:"Email is required",pattern:{value:P.pL,message:"Email is invalid"}}),type:"email",placeholder:"Email"})}),!(0,d.zj)().autoAssignOrg&&(0,n.jsx)(t.D,{label:"Org. name",children:(0,n.jsx)(g.p,{id:"org-name",..._("orgName"),placeholder:"Org. name"})}),(0,d.zj)().verifyEmailEnabled&&(0,n.jsx)(t.D,{label:"Email verification code (sent to your email)",children:(0,n.jsx)(g.p,{id:"verification-code",..._("code"),placeholder:"Code"})}),(0,n.jsx)(t.D,{label:"Password",invalid:!!m.password,error:m?.password?.message,children:(0,n.jsx)(e.s,{id:"new-password",autoFocus:!0,autoComplete:"new-password",..._("password",{required:"Password is required"})})}),(0,n.jsx)(t.D,{label:"Confirm password",invalid:!!m.confirm,error:m?.confirm?.message,children:(0,n.jsx)(e.s,{id:"confirm-new-password",autoComplete:"new-password",..._("confirm",{required:"Confirmed password is required",validate:l=>l===D().password||"Passwords must match!"})})}),(0,n.jsxs)(r.B,{children:[(0,n.jsx)(p.$n,{type:"submit",children:(0,n.jsx)(f.x6,{i18nKey:"sign-up.submit-button",children:"Submit"})}),(0,n.jsx)(p.z9,{fill:"text",href:(0,d.zj)().appSubUrl+"/login",children:(0,n.jsx)(f.x6,{i18nKey:"sign-up.back-button",children:"Back to login"})})]})]})})})},a=u}}]);

//# sourceMappingURL=6964.f8c05d0b2e143dd3dd29.js.map