import{j as i,ak as l}from"./vendor-mui-core-CKKG_1TN.js";import{u as x,r as w}from"./vendor-react-CTtPmzVP.js";import{b as g}from"./vendor-hooks-DQAdyHrE.js";import{I as v}from"./invitation-CnuNtRnn.js";import{K as u}from"./landing-page-B5QvkHHO.js";import{V as I,ah as k}from"./vendor-ux-DjXlxcvL.js";import{u as S,o as E,b as T,e as j,c as P,H as R}from"./index-BEfIUbZC.js";import{g as W}from"./get-safe-url-DxqVk96E.js";import{c as b}from"./passport-C_PAxd9K.js";import"./vendor-utils-CUs2ebe7.js";import"./index-C96Fw4Lj.js";import"./use-passport-id-B-b-_oYF.js";import"./session-Cin9Rizr.js";import"./sdk-CMvNWVGa.js";import"./wrap-locale-CFhaO2KZ.js";import"./index-BoLm67SH.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./create-passport-svg-DeDfPZeD.js";function J(n){const c=x(),{searchParams:s}=new URL(window.location.href),{api:m,session:p}=S(),{t:d}=I(),r=s.get("inviteId"),a=s.get("redirect"),f=w.useCallback(async()=>{const{data:t}=await E.get("invitation",{params:{inviteId:r}});return t},[r]),h=g(async(t,o=e=>e)=>{t&&(T(o(t.sessionToken)),j(o(t.refreshToken)),t.visitorId&&k(o(t.visitorId))),await p.refresh(),setTimeout(()=>{if(a){const e=decodeURIComponent(a);e.startsWith(P.WELLKNOWN_SERVICE_PATH_PREFIX)?c(e,{replace:!0}):window.location.href=W(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return i.jsxs(u,{did:window.blocklet?.appPid,children:[i.jsx(R,{children:i.jsxs("title",{children:[d("pageTitle.invite")," | ",window.blocklet?.appName]})}),i.jsx(l,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:i.jsx(v,{...n,getDataFn:f,checkFn:m.get,createPassportSvg:t=>b({...t}),onLoginSuccess:h,inService:!0})})]})}export{J as default};
