"use strict";(self.webpackChunk_as_client=self.webpackChunk_as_client||[]).push([[564],{8564:(e,a,n)=>{n.r(a),n.d(a,{default:()=>h});var t=n(8168),r=n(4041),o=n(6391),l=n(5353),i=n(3614),s=n(5772),d=n(306),m=n(6319),u=n(730),c=n(5765),p=n(1411),g=n(9594);const h=()=>{const{isLoading:e,mfaChallenge:a,onSubmit:n,onCancel:h}=function(){const e=(0,o.W6)(),[a,{isLoading:n}]=(0,s.mg)(),t=(0,g.jL)(),l=(0,g.GV)(d.oq),h=(0,g.GV)(d.lu),b=(0,r.useCallback)((async e=>{let a="Wrong answer";if((0,m.W)(e)){const{data:n}=e;(0,u.Z)(n)&&(a=n.reason)}c.o.error(a),t((0,p.wF)(void 0))}),[t]),f=(0,r.useCallback)((async n=>{try{const r={response:n,challenge_context:l?.challenge_context,username:h},o=await a(r).unwrap();t((0,p.Wj)(o)),e.replace(i.f.downloads)}catch(e){b(e)}}),[l,h,e,a,t,b]),x=(0,r.useCallback)((()=>e.replace(i.f.login)),[e]);return{isLoading:n,mfaChallenge:l,onSubmit:f,onCancel:x}}();return a?r.createElement(l.Q,(0,t.A)({disabled:e,onSubmit:n,onCancel:h},a)):r.createElement(o.rd,{to:i.f.login})}},5772:(e,a,n)=>{n.d(a,{BB:()=>s,I8:()=>i,Ir:()=>u,Km:()=>p,SV:()=>m,eR:()=>c,mg:()=>d});var t=n(323),r=n(6270),o=n(5167);const l=n(2644).U.injectEndpoints({endpoints:e=>({loginWithEmailAndPassword:e.mutation({query:e=>({url:t.M.login,method:"POST",body:e}),transformResponse:e=>(0,o.d)(e)}),loginWithSaml:e.mutation({query:e=>({url:t.M.samlAssertion,method:"POST",body:e}),transformResponse:e=>(0,o.d)(e)}),vpnSamlAuth:e.mutation({query:e=>({url:t.M.vpnSamlAuth,method:"POST",body:e})}),getIdpUrl:e.query({query:e=>({url:t.M.getIdpUrl,params:{relay_state:e}})}),submitMfaChallenge:e.mutation({query:e=>({url:t.M.mfaChallenge,method:"POST",body:e}),transformResponse:e=>(0,o.d)(e)}),changePassword:e.mutation({query:({newPassword:e,token:a,userName:n})=>({url:t.M.passwordChange,method:"POST",body:{username:n,new_password:e},headers:{[r.j]:a}})}),enrollInMfa:e.mutation({query:({token:e,authToken:a})=>({url:t.M.mfaEnroll,method:"POST",body:{token:e},headers:{[r.j]:a}}),transformResponse:e=>(0,o.d)(e)})})}),{useLoginWithEmailAndPasswordMutation:i,useLoginWithSamlMutation:s,useSubmitMfaChallengeMutation:d,useChangePasswordMutation:m,useEnrollInMfaMutation:u,useLazyGetIdpUrlQuery:c,useVpnSamlAuthMutation:p}=l},7894:(e,a,n)=>{n.d(a,{Z:()=>m});var t=n(4041),r=n(8081),o=n(9192),l=n(3580),i=n(738);const s=(0,r.AH)(["margin-right:auto;margin-left:auto;"]),d=r.Ay.div([""," max-width:",";padding:var(--spacing-md,32px) var(--spacing-xs,16px);background:#fff;border:1px solid ",";border-radius:1rem;"," ",""],(0,o.A)("centered")`
       ${s}
    `,(({maxWidth:e})=>(e=>{if(void 0!==e)return"number"==typeof e?`${e}px`:e})(e)),l.A.neutralBorder,i.Ay.moreThen(i.nm.SM)`
        padding: var(--spacing-md, 32px);
        ${(0,o.A)("withShadow")`
            box-shadow: 0px 1px 3px rgba(16, 24, 40, 0.1), 0px 1px 2px rgba(16, 24, 40, 0.06);
        `}
    `,i.Ay.moreThen(i.nm.MD)`
        padding: var(--spacing-md, 32px) var(--spacing-lg, 48px);
    `),m=e=>{const{children:a,...n}=e;return t.createElement(d,n,a)}},5353:(e,a,n)=>{n.d(a,{Q:()=>b});var t=n(9690),r=n(4041),o=n(8255),l=n(3578),i=n(7973),s=n(7894),d=n(9078),m=n(8081),u=n(5506);const c=m.Ay.div(["max-width:456px;margin:auto;text-align:center;"]),p=m.Ay.div(["margin-bottom:var(--spacing-md,32px);text-align:left;"]),g=(0,m.Ay)(u.A)(["margin-bottom:2rem;"]),h=e=>{const{echo:a,...n}=e;return r.createElement(o.A,(0,t.A)({},n,{type:a?"text":"password"}))},b=e=>{const{challenge:a,echo:n,disabled:t,error:o,onCancel:m,onSubmit:u}=e,[b,f]=(0,r.useState)(""),x=Boolean(o);return r.createElement(c,null,r.createElement(s.Z,null,r.createElement(d.H1,{mb:"var(--spacing-xxxs, 4px)"},"MFA"),r.createElement(l.A,{mb:"var(--spacing-md, 32px)",variant:"textMd",inline:!1},"Please answer your security question"),r.createElement("form",{id:"mfa-challenge-form",name:"mfa-challenge-form",onSubmit:e=>{e.preventDefault(),u(b)}},r.createElement(p,null,r.createElement(h,{id:"answer",name:"answer",value:b,echo:n,fullWidth:!0,disabled:t,"aria-disabled":t,autoComplete:"new-password",onChange:f,"data-testid":"answer",error:x,title:a,description:o})),r.createElement(g,{fullWidth:!0},r.createElement(i.A,{variant:"primary",type:"submit",disabled:t||!b,"aria-disabled":!(!t&&b)||void 0,"data-testid":"submit-mfa-challenge","aria-label":"Confirm",fullWidth:!0},"Confirm"),r.createElement(i.A,{variant:"ghost",type:"button",disabled:t,"aria-disabled":!!t||void 0,onClick:m,"data-testid":"cancel-mfa-challenge","aria-label":"Cancel",fullWidth:!0},"Cancel")))))}},9078:(e,a,n)=>{n.d(a,{H1:()=>m});var t=n(9690),r=n(4041),o=n(3580),l=n(8081),i=n(3578),s=n(738);const d=(0,l.Ay)(i.A)(["margin-top:0;margin-bottom:var(--spacing-md,32);letter-spacing:-0.64px;",""],s.Ay.lessThen(s.nm.MD-1)`
        margin-bottom: var(--spacing-sm, 24);
        font-size: 24px;
        line-height: 32px;
        letter-spacing: -0.48px;
    `),m=e=>r.createElement(d,(0,t.A)({color:o.A.neutralTextTitle,inline:!1,variant:"displayLg",center:!0,weight:"semiBold"},e))}}]);