1"use strict";(self.webpackChunkquestui=self.webpackChunkquestui||[]).push([[179],{76179:(t,e,n)=>{n.r(e),n.d(e,{default:()=>w});var s=n(96652),a=n(54332),i=n(65066),o=n(9950),r=n(98362),c=n(75522),l=n(3364),u=n(6820),d=n(37837),m=n(8093),h=n(30668),p=n(89175),x=n(51778),g=n(79999),A=n(31341),j=n(11552),f=n(2069);const b=()=>{const{authMachineActions:t}=(0,j.A)(),{addSnack:e}=(0,A.A)(),{isPending:n,isPaused:s,mutateAsync:a}=(0,x.n)({mutationKey:["startImpersonation"],mutationFn:t=>{const{targetAccountId:e}=t;return(0,g.$h)(f.A.startImpersonationAsync(e))},onSuccess:()=>{window.location.reload()},onError:n=>{"InvalidResponse"!==n.code&&"CookieError"!==n.code||t.onLogout(),e("An error occured when impersonating the user")}});return{startImpersonation:async t=>await a({targetAccountId:t}),isLoading:n&&!s}};var v=n(44414);const I=()=>{const{t:t}=(0,r.B)(),{targetAccountId:e}=(0,s.g)(),{startImpersonation:n,isLoading:a}=b(),[i,x]=(0,o.useState)(e||""),[g,A]=(0,o.useState)(!!e);return(0,v.jsxs)("div",{className:"flex justify-center items-center flex-col top-0 left-0 w-full h-screen min-h-full",children:[a&&(0,v.jsx)(m.A,{centerAlign:!0}),(0,v.jsxs)(c.P,{id:"impersonationLoginSection",children:[(0,v.jsx)("p",{className:"text-center text-2xl mt-4 mb-4",children:t("auth.impersonation_login_title")}),(0,v.jsx)(d.A,{marginBottom:"var(--spacing-4)",children:(0,v.jsx)("p",{className:"text-center",children:t("auth.impersonation_login_message")})}),(0,v.jsx)(d.A,{marginBottom:"var(--spacing-4)",children:(0,v.jsx)(l.A,{id:"impersonationAccountId",label:t("auth.impersonation_account_id_label"),onChange:t=>{const e=t.target.value;x(e),A((t=>{if(!(0,p.bf)(t))return!1;const e=parseInt(t,10);return(0,h.F5)(e)})(e))},value:i,type:"number",isRedesign:!0,helperText:!g&&(0,p.bf)(i)?t("auth.impersonation_invalid_account_id"):void 0,error:!g&&(0,p.bf)(i)})}),(0,v.jsx)("div",{className:"mt-8 mb-3",children:(0,v.jsx)(u.A,{id:"buttonImpersonate",onClick:async()=>{if(g){const t=parseInt(i,10);await n(t)}},disabled:!g,value:t("auth.impersonate_button")})})]})]})};var _=n(33614);const w=t=>{let{accountDetails:e}=t;return(0,v.jsxs)(s.BV,{children:[(0,v.jsx)(s.qh,{path:i.OZ.impersonationLogin,element:(0,v.jsx)(a.A,{children:(0,v.jsx)(I,{})})}),(0,v.jsx)(s.qh,{path:"*",element:(0,v.jsx)(_.default,{accountDetails:e})})]})}}}]);
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.