"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[8433],{58433:(e,a,i)=>{i.r(a),i.d(a,{SignupPage:()=>h,default:()=>j});i(76687);var s,r=i(5205),l=i(56481),n=i(45550),o=i(9120),d=i(7053),t=i(55312),c=i(72e3),m=i(94843),u=i(46142),g=i(9355),p=i(22729),w=i(52010);const h=e=>{const a=(0,m.iG)(),i={email:e.queryParams.email,code:e.queryParams.code};return(0,w.jsx)(g.dd,{children:(0,w.jsx)(g.$s,{children:(0,w.jsx)(l.l,{defaultValues:i,onSubmit:async e=>{""===e.name&&delete e.name,delete e.confirm;"redirect-to-select-org"===(await(0,r.i)().post("/api/user/signup/step2",{email:e.email,code:e.code,username:e.email,orgName:e.orgName,password:e.password,name:e.name}).catch((e=>{var i;const s=(null===(i=e.data)||void 0===i?void 0:i.message)||e;a.warning(s)}))).code&&window.location.assign((0,c.iE)().appSubUrl+"/profile/select-org?signup=1"),window.location.assign((0,c.iE)().appSubUrl+"/")},children:e=>{var a,i,r;let{errors:l,register:m,getValues:g}=e;return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(n.g,{label:"Your name",children:(0,w.jsx)(o.I,Object.assign({id:"user-name"},m("name"),{placeholder:"(optional)"}))}),(0,w.jsx)(n.g,{label:"Email",invalid:!!l.email,error:null===(a=l.email)||void 0===a?void 0:a.message,children:(0,w.jsx)(o.I,Object.assign({id:"email"},m("email",{required:"Email is required",pattern:{value:u.Yb,message:"Email is invalid"}}),{type:"email",placeholder:"Email"}))}),!(0,c.iE)().autoAssignOrg&&(0,w.jsx)(n.g,{label:"Org. name",children:(0,w.jsx)(o.I,Object.assign({id:"org-name"},m("orgName"),{placeholder:"Org. name"}))}),(0,c.iE)().verifyEmailEnabled&&(0,w.jsx)(n.g,{label:"Email verification code (sent to your email)",children:(0,w.jsx)(o.I,Object.assign({id:"verification-code"},m("code"),{placeholder:"Code"}))}),(0,w.jsx)(n.g,{label:"Password",invalid:!!l.password,error:null==l||null===(i=l.password)||void 0===i?void 0:i.message,children:(0,w.jsx)(p.Z,Object.assign({id:"new-password",autoFocus:!0,autoComplete:"new-password"},m("password",{required:"Password is required"})))}),(0,w.jsx)(n.g,{label:"Confirm password",invalid:!!l.confirm,error:null==l||null===(r=l.confirm)||void 0===r?void 0:r.message,children:(0,w.jsx)(p.Z,Object.assign({id:"confirm-new-password",autoComplete:"new-password"},m("confirm",{required:"Confirmed password is required",validate:e=>e===g().password||"Passwords must match!"})))}),(0,w.jsxs)(d.Lh,{children:[s||(s=(0,w.jsx)(t.zx,{type:"submit",children:"Submit"})),(0,w.jsx)(t.Qj,{fill:"text",href:(0,c.iE)().appSubUrl+"/login",children:"Back to login"})]})]})}})})})},j=h},46142:(e,a,i)=>{i.d(a,{Yb:()=>r,d5:()=>l});var s=i(67273);const r=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;const l=()=>function(){var e;const a=null===(e=s.v.licenseInfo)||void 0===e?void 0:e.trialExpiry;return!!(a&&a>0)}()&&s.v.featureToggles.featureHighlights}}]);
//# sourceMappingURL=8433.43ff7e2e375fbb22f28a.js.map