import{t as o,u as f,p as h,q as I,s as x,d as w,m as d,l,j as e,P as y,I as j,T as a,v as c,B as R,i as S}from"./main-BiT4j4N5.js";import{I as q}from"./check-CIMr5P0F.js";import{V as v,a as r}from"./VisualListItem-BkHZYn9E.js";import{B as u}from"./ButtonLink-MFNyI4rM.js";import"./_commonjsHelpers-DaWZu8wl.js";/* empty css               */const k=l(`
  query CurrentViewer {
    viewer {
      __typename
      ... on Node {
        id
      }
    }
  }
`),C=I({queryKey:["currentViewer"],queryFn:({signal:n})=>d({query:k,signal:n})}),E=l(`
  mutation AllowCrossSigningReset($userId: ID!) {
    allowUserCrossSigningReset(input: { userId: $userId }) {
      user {
        id
      }
    }
  }
`);function b(){const{deepLink:n}=o.useSearch(),g=o.useNavigate(),{t:s}=f(),{data:{viewer:i}}=h(C);if(i.__typename!=="User")throw x();const _=i.id,t=w({mutationFn:async p=>d({query:E,variables:{userId:p}}),onSuccess:()=>{setTimeout(()=>{window.onAuthDone?window.onAuthDone():window.opener?.postMessage&&window.opener.postMessage("authDone","*")}),g({to:"/reset-cross-signing/success",replace:!0})}}),m=async()=>{t.mutate(_)};return e.jsxs(e.Fragment,{children:[e.jsx(y,{Icon:j,title:s("frontend.reset_cross_signing.heading"),invalid:!0}),e.jsx(a,{className:"text-center text-secondary",size:"md",children:s("frontend.reset_cross_signing.description")}),e.jsxs(v,{children:[e.jsx(r,{Icon:q,success:!0,children:s("frontend.reset_cross_signing.effect_list.positive_1")}),e.jsx(r,{Icon:c,children:s("frontend.reset_cross_signing.effect_list.neutral_1")}),e.jsx(r,{Icon:c,children:s("frontend.reset_cross_signing.effect_list.neutral_2")})]}),e.jsx(a,{className:"text-center",size:"md",weight:"semibold",children:s("frontend.reset_cross_signing.warning")}),e.jsxs(R,{kind:"primary",destructive:!0,disabled:t.isPending,onClick:m,children:[!!t.isPending&&e.jsx(S,{inline:!0}),s("frontend.reset_cross_signing.finish_reset")]}),n?e.jsx(u,{to:"/reset-cross-signing/cancelled",kind:"tertiary",replace:!0,children:s("action.cancel")}):e.jsx(u,{to:"/",kind:"tertiary",children:s("action.back")})]})}export{b as component};
//# sourceMappingURL=reset-cross-signing.index-qcCtXoRL.js.map
