1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,855366,e=>{"use strict";var t=e.i(182549),n=e.i(328122),r=e.i(471361),a=e.i(707652),l=e.i(690141),s=e.i(318339);function i({children:e}){return(0,t.jsxs)("main",{className:"relative min-h-screen overflow-x-hidden overflow-y-auto bg-[#fdfdfc]",children:[(0,t.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",children:(0,t.jsx)("div",{className:"rexy-aurora absolute left-1/2 top-1/2 size-[1000px] max-w-none -translate-x-1/2 -translate-y-1/2 rounded-full"})}),(0,t.jsx)(l.m.header,{initial:{opacity:0,y:26,filter:"blur(8px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},transition:{duration:.6,delay:.05,ease:[.22,1,.36,1]},className:"absolute left-6 top-6 z-10",children:(0,t.jsx)(s.NavLogo,{})}),(0,t.jsx)("div",{className:"relative flex min-h-screen flex-col items-center justify-center px-8 py-10 sm:py-12",children:e})]})}var o=e.i(353908),c=e.i(317525),d=e.i(299627),u=e.i(559419),f=e.i(511927),p=e.i(571326),m=e.i(356578),x=e.i(778721);async function h(e){if(x.MOCK_FLAGS.ONBOARDING_ARCHETYPE_TITLE_LIST.enabled)return f.TITLE_LIST;let t=await e.v1.listProofTitles({by:"onboarding"});return t.data?.obj?.list??[]}function y(){let{trex_client:e}=(0,c.useRexyApiContext)(),{authReady:t}=(0,d.useRexyAuthContext)(),n=(0,o.useQuery)({queryKey:(0,p.generateUniqueQueryKey)("onboarding","archetype-catalog"),queryFn:()=>h(e)});return n.error&&(0,m.sendError)(n.error,{scope:"archetype_catalog"}),{titles:n.data??[],isLoading:n.isLoading||!t,isError:n.isError}}var g=e.i(414651),b=e.i(462173);e.i(597055);var v=e.i(819906),w=e.i(16245);e.i(304079);var j=e.i(14121),N=e.i(719823),k=e.i(637234);let _="onb_mint_passport";async function I(e){try{let t=await e.v1.getPassportInfo();return t.data?.obj??null}catch{return null}}async function E(e){let t=0;for(;t<10;){let n=await I(e);if(n&&void 0!==n.passportChainId&&null!==n.passportChainId&&n.contractAddress&&""!==n.contractAddress.trim()&&n.handleName&&""!==n.handleName.trim())return n;(t+=1)<10&&await new Promise(e=>setTimeout(e,1e3))}return null}async function C(t,n){let{trexClient:r,wallet:a,account:l}=t,s=n??(()=>{}),i=await r.v1.sign("mint"),o=i.data?.obj;if(!i.data?.success||!o?.signature||void 0===o.validityStartTimestamp||void 0===o.validityEndTimestamp)return s("sign_failed",{error_code:i.data?.code??"sign_unsuccessful"}),{status:"sign_failed",passportInfo:null};await a.switchChain(k.thirdweb_trexChain);let{PassportSDK:c}=await e.A(978614),d=new c({chain:k.thirdweb_trexChain,registryAddress:"0xbbB216C52f5B9095391f463AdC438d65a8aC2242",client:(0,k.getThirdwebClient)(),account:l});if((await d.checkWalletHasPassport(l.address)).hasPassport)return s("already_has_passport"),{status:"already_has_passport",passportInfo:await I(r)};let u=d.createPassport({to:l.address,validityStartTimestamp:BigInt(o.validityStartTimestamp),validityEndTimestamp:BigInt(o.validityEndTimestamp)},o.signature,{sendTransaction:!0,account:l}),f=new Promise((e,t)=>{setTimeout(()=>t(Error("mint_timeout")),2e4)});try{await Promise.race([u,f])}catch(e){if(e instanceof Error&&"mint_timeout"===e.message)return s("timeout"),{status:"timeout",passportInfo:null};throw e}let p=await E(r);return p?(s("success"),{status:"success",passportInfo:p}):(s("poll_failed",{retry_count:10}),{status:"poll_failed",passportInfo:null})}function A(e){let t=e instanceof Error?e.message:"unknown";return(0,j.logGAEvent)(_,{result:!1,mint_status:"error",error_message:t}),(0,m.sendError)(e,{scope:"mint_passport"}),{status:"error",passportInfo:null}}var S=e.i(21917),P=e.i(272144),T=e.i(789866),R=e.i(79718);async function L(e,t){let n=await e.v1.getProof(t),r=(n.data?.obj?.fieldStatuses??[]).filter(e=>"QUALIFIED"===e.status&&null!=e.verifiedTime).map(e=>e.verifiedTime);return 0===r.length?{sealedAt:new Date}:{sealedAt:new Date(Math.min(...r))}}var G=e.i(708289),O=e.i(415803);e.i(909789);var z=e.i(558401),D=e.i(763153),M=e.i(277337),F=e.i(138093),B=e.i(34682),q=e.i(876211);let U=(0,G.default)(()=>e.A(129355),{loadableGenerated:{modules:[191693]},ssr:!1}),K={needInstall:"Add to Chrome, it's free",installed:"Check for Rexy",verifying:"Checkingâ¦"},$=e=>({initial:{opacity:0,y:26,filter:"blur(8px)"}
1,animate:{opacity:1,y:0,filter:"blur(0px)"},transition:{duration:.6,delay:e,ease:[.22,1,.36,1]}});function W({onDetected:e,onSkip:r}){let[a]=(0,n.useState)(()=>(0,B.getRexyEnv)()),s=(0,B.isDesktopChrome)(a),[i,o]=(0,n.useState)("needInstall"),[c,d]=(0,n.useState)(!1),{checkExtensionInstalled:u}=(0,F.useExtensionDetect)();(0,n.useEffect)(()=>{(0,j.logGAEvent)("onb_install_view",{device:a})},[a]);let f=e=>{(0,j.logGAEvent)("onb_install_skip",{device:a,cta:e}),r()},p=async()=>{if(!s)return void f("continue_without");if("needInstall"===i){window.open(M.CHROME_STORE_URL,"_blank"),(0,j.logGAEvent)("onb_install_cta_tap"),o("installed");return}if("installed"===i){if(d(!1),o("verifying"),await u(3e3)){(0,j.logGAEvent)("onb_install_check_tap",{result:"found"}),(0,j.logGAEvent)("onb_install_done"),e();return}(0,j.logGAEvent)("onb_install_check_tap",{result:"not_found"}),o("installed"),d(!0)}},m=s?"Add Rexy to reveal your worth":"Rexy works in desktop Chrome",x=s?"As a Chrome extension, Rexy finds the facts with highest potential about you, and seals as a proof. Your data always stays on your device, and you choose who gets access for offers.":"Open rexy.so in desktop Chrome to add it.",h=s?K[i]:"Continue without Rexy";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(O.Button,{variant:"secondary",size:"sm","data-testid":"rexy-onb-install-skip",onClick:()=>
1f("skip"),className:"fixed right-6 top-6 z-10 border-foreground/20 font-medium text-content-primary",children:"Skip"}),(0,t.jsxs)("section",{className:"flex w-full max-w-[680px] flex-col items-center gap-14 text-center",children:[(0,t.jsxs)(l.m.div,{...$(.15),className:"flex w-full flex-col items-center justify-center gap-1 text-center [word-break:break-word]",children:[(0,t.jsx)("h1",{className:"font-headline text-headline-regular-2xl text-content-primary",children:m}),(0,t.jsx)("p",{className:"font-dm text-body-l text-content-primary",children:x})]}),(0,t.jsx)("div",{"aria-hidden":"true",className:"w-[322px] max-w-full overflow-clip rounded-[14px] aspect-[440/226]",children:(0,t.jsx)(U,{animationData:q.default,loop:!0,autoplay:!0})}),(0,t.jsxs)(l.m.div,{...$(.55),className:"flex w-[400px] max-w-full flex-col items-center gap-3",children:[(0,t.jsx)(O.Button,{"data-testid":"rexy-onb-install-cta",loading:s&&"verifying"===i,onClick:p,className:"w-full font-dm",children:h}),s&&(0,t.jsxs)("p",{className:"w-full text-center font-dm text-body-s text-content-secondary [word-break:break-word]",children:['Proofs are just "yes/no" facts you can flex about to get offers.',(0,t.jsx)("br",{}),"No underlying data leaves your device."]})]}),s&&c&&(0,t.jsxs)(D.Toast,{testId:"rexy-onb-install-alert",role:"alert",duration:3e3,position:"top-right",onClose:()=>d(!1),className:"flex max-w-[360px] items-center gap-2 rounded-[12px] border border-surface-white-overlay-10 bg-[#fffffd] p-4 text-left shadow-[0px_0px_32px_0px_rgba(0,0,0,0.08)]",children:[(0,t.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-brand-bg-overlay-10 text-brand-content-primary",children:(0,t.jsx)(z.AlertsIcon,{className:"size-5"})}),(0,t.jsx)("p",{className:"text-body-medium-m flex-1 font-dm text-content-primary",children:"Rexy isn't in your browser yet. Install it and turn it on, then check again."})]})]})]})}var Q=e.i(585462),H=e.i(64828),Y=e.i(850071),V=e.i(615072),X=e.i(831311),Z=e.i(905439),J=e.i(336928),ee=e.i(937462),et=e.i(645102),en=e.i(581962),er=e.i(668304),ea=e.i(384672),el=e.i(838231);async function es(){return(0,el.getLastAuthProvider)(ea.webLocalStorage)}var ei=e.i(686279),eo=e.i(194570),ec=e.i(759386);let ed="We couldn't finish that sign-in. Try again, or pick another way in.",eu=new Set(["20016","20013"]);function ef(e){if("object"!=typeof e||null===e)return{code:"",message:"Unknown error"};let t=e.error?.code??e.data?.error?.code??e.code,n=e.error?.message??e.data?.error?.message??e.message;return{code:null==t?"":String(t),message:n?.trim()||"Unknown error"}}function ep(e){return!x.MOCK_FLAGS.ONBOARDING_LOGIN_IS_NEW_USER.enabled&&!!e}async function em(e,t,n,r){let a=await e.v1.challenge({address:n}),l=a.data.obj?.text??"",s=await r(l),i=await e.v1.authLogin({walletAddress:n,signature:s,socialPlatform:t}),o=i.data?.obj,c=o?.accessToken,d=o?.refreshToken;if(!c||!d)throw Error("auth_login_missing_tokens");return{accessToken:c,refreshToken:d,channel:t,isNewUser:ep(o?.isNewUser)}}let ex=[[{provider:"apple",label:"Apple",Icon:H.AppleIcon},{provider:"x",label:"X",Icon:Y.XLogoIcon},{provider:"telegram",label:"Telegram",Icon:V.TelegramAltIcon}],[{provider:"facebook",label:"Facebook",Icon:X.FacebookSquareIcon},{provider:"line",label:"Line",Icon:Z.LineIcon},{provider:"discord",label:"Discord",Icon:J.DiscordIcon}]],eh=e=>({initial:{opacity:0,y:26,filter:"blur(8px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},transition:{duration:.6,delay:e,ease:[.22,1,.36,1]}});function ey({testId:e,loading:n,disabled:r,onClick:a,Icon:l,label:s}){let i=r||n;return(0,t.jsx)("button",{type:"button","data-testid":e,disabled:i,"aria-disabled":i||void 0,"aria-busy":n||void 0,onClick:a,className:(0,en.cn)("flex min-h-0 min-w-px flex-1 flex-col items-center justify-center gap-2 rounded-xl border-[1px] px-0 py-3","font-dm text-body-m font-normal leading-5 text-content-primary transition-colors duration-150","outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[#ec6656]/50","disabled:cursor-not-allowed",n?"border-[#eff2f5] bg-white":(0,en.cn)("border-[rgba(23,22,18,0.05)] bg-[#faf9f4]","enabled:hover:border-brand-border-solid enabled:hover:bg-brand-bg-overlay-5 enabled:hover:text-brand-content-primary","disabled:opacity-40")),children:n?(0,t.jsx)("span",{role:"status","aria-label":"loading",className:"grid size-6 shrink-0 place-items-center",children:(0,t.jsx)(et.LoadingSpinnerIcon,{className:"size-6"})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"grid shrink-0 place-items-center [&>svg]:size-6",children:(0,t.jsx)(l,{})}),(0,t.jsx)("span",{className:"shrink-0",children:s})]})})}function eg({onAuthenticated:e}){let{authReady:r,isAuthenticated:a,initializeTokens:s}
1=(0,d.useRexyAuthContext)(),[i,o]=(0,n.useState)(null),[u,f]=(0,n.useState)(!1),[p,x]=(0,n.useState)(ed),{activeWallet:h}=(0,er.useRexyWalletContext)(),y=(0,Q.useActiveWalletConnectionStatus)(),g=(0,n.useRef)(!1),b=(0,n.useRef)(!1),{login:v,completeLogin:w}=function(e={}){let{onSuccess:t,onFailure:r}=e,{trex_client:a,setTokens:l}=(0,c.useRexyApiContext)(),{connect:s,error:i}=(0,ei.useConnect)(),[o,u]=(0,n.useState)(!1),f=(0,n.useRef)(null),p=(0,n.useRef)(null),x=(0,n.useCallback)(async e=>{u(!0),f.current=e,window.localStorage.setItem("loginStrategy",e);try{await s(async()=>{let t=(0,eo.inAppWallet)({metadata:k.IN_APP_WALLET_METADATA,executionMode:k.IN_APP_WALLET_EXECUTION_MODE});return await t.connect({strategy:e,client:(0,k.getThirdwebClient)(),chain:k.thirdweb_trexChain}),t})}catch(n){let t=n instanceof Error?n.message:"connect_failed";throw(0,j.logGAEvent)("onb_login_fail",{channel:e,reason:t}),(0,m.sendError)(n,{scope:"login",channel:e}),r?.(e,ed),u(!1),f.current=null,n}},[s,r]);return(0,n.useEffect)(()=>{if(!i||i===p.current)return;p.current=i;let e=f.current;if(!e)return;let t=i instanceof Error?i.message:"connect_failed";(0,j.logGAEvent)("onb_login_fail",{channel:e,reason:t}),(0,m.sendError)(i,{scope:"login",channel:e}),r?.(e,ed),u(!1),f.current=null},[i,r]),{loading:o,login:x,completeLogin:(0,n.useCallback)(async e=>{let n,{address:s,signMessage:i}=e;u(!0),f.current=null;{let e=window.localStorage.getItem(d.REXY_LOGIN_DATA_KEY);if(e)try{let n=JSON.parse(e);if(n.accessToken&&n.refreshToken){l(n.accessToken,n.refreshToken);let e=window.localStorage.getItem("loginStrategy")||"google";u(!1);let r={accessToken:n.accessToken,refreshToken:n.refreshToken,channel:e,isNewUser:ep()};return t?.(r),r}}catch{}}try{n=await es()??window.localStorage.getItem("loginStrategy")??"google"}catch{n="google"}try{let e=await em(a,n,s,i);return l(e.accessToken,e.refreshToken),window.localStorage.setItem(d.REXY_LOGIN_DATA_KEY,JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken})),(0,ec.setCookie)("access_token",e.accessToken,{path:"/"}),(0,ec.setCookie)("refresh_token",e.refreshToken,{path:"/"}),(0,j.logGAEvent)("onb_login_success",{is_new:e.isNewUser,channel:e.channel}),t?.(e),e}catch(a){let{code:e}=ef(a),t=a instanceof Error?a.message:e||"login_failed";return(0,j.logGAEvent)("onb_login_fail",{channel:n,reason:t}),(0,m.sendError)(a,{scope:"login",channel:n}),r?.(n,function(e){let{code:t,message:n}=ef(e);if(eu.has(t))return`Please login via your rexy signed up account ã${0===n.length?n:n.charAt(0).toUpperCase()+n.slice(1)}ã`;return ed}(a)),null}finally{u(!1)}},[r,t,l,a])}}({onSuccess:(0,n.useCallback)(t=>{o(null),s(),e(t.channel,t.isNewUser)},[s,e]),onFailure:(0,n.useCallback)((e,t)=>{o(null),f(!0),x(t||ed)},[])});(0,n.useEffect)(()=>{r&&!a&&(0,j.logGAEvent)("onb_login_view")},[r,a]);let N=(0,n.useCallback)(async()=>{if(g.current)return;let e=h?.getAccount();if(e){g.current=!0;try{await w({address:e.address,signMessage:t=>e.signMessage({message:t})})}finally{g.current=!1}}},[h,w]);(0,n.useEffect)(()=>{if("connected"!==y){b.current=!1;return}b.current||(b.current=!0,N())},[y,N]);let _=async e=>{if(!i){f(!1),o(e),(0,j.logGAEvent)("onb_login_tap",{channel:e});try{await v(e)}catch{return}await N()}};return!r||a?null:(0,t.jsxs)("section",{className:"flex w-full max-w-[581px] flex-col items-start gap-14",children:[(0,t.jsxs)(l.m.div,{...eh(.15),className:"flex w-full flex-col items-center justify-center gap-1 text-center [word-break:break-word]",children:[(0,t.jsx)("h1",{className:"font-headline text-headline-regular-2xl text-content-primary",children:"Save your first proof"}),(0,t.jsx)("p",{className:"font-dm text-body-l text-content-primary",children:"Set up an account to hold all your future proofs together."})]}),(0,t.jsxs)(l.m.div,{...eh(.35),className:"flex w-full shrink-0 flex-col items-center justify-center gap-6 overflow-clip rounded-xl bg-surface-neutral-primary p-8",children:[(0,t.jsx)(O.Button,{"data-testid":"rexy-onb-login-google",loading:"google"===i,disabled:null!==i&&"google"!==i,onClick:()=>_("google"),leftIcon:(0,t.jsx)(ee.GoogleIcon,{}),className:"w-full gap-2 px-0 py-3 font-dm text-body-m font-normal leading-5 text-content-inverse-primary",children:"Continue with Google"}),(0,t.jsxs)("div",{className:"flex w-full shrink-0 items-center justify-center gap-6",children:[(0,t.jsx)("span",{className:"h-px min-w-px flex-1 bg-line-white-transparent-10"}),(0,t.jsx)("p",{className:"shrink-0 whitespace-nowrap font-dm text-body-m text-content-tertiary",children:"or continue with"}),(0,t.jsx)("span",{className:"h-px min-w-px flex-1 bg-line-white-transparent-10"})]}),(0,t.jsx)("div",{className:"flex w-full shrink-0 flex-col items-start gap-3",children:ex.map((e,n)=>(0,t.jsx)("div",{className:"flex w-full shrink-0 items-stretch gap-3",children:e.map(({provider:e,label:n,Icon:r})=>(0,t.jsx)(ey,{testId:`rexy-onb-login-${e}`,loading:i===e,disabled:null!==i&&i!==e,onClick:()=>_(e),Icon:r,label:n},e))},n))})]}),u&&(0,t.jsxs)(D.Toast,{testId:"rexy-onb-login-alert",role:"alert",duration:3e3,position:"top-right",onClose:()=>f(!1),className:"flex max-w-[360px] items-center gap-2 rounded-[12px] border border-surface-white-overlay-10 bg-[#fffffd] p-4 shadow-[0px_0px_32px_0px_rgba(0,0,0,0.08)]",children:[(0,t.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-brand-bg-overlay-10 text-brand-content-primary",children:(0,t.jsx)(z.AlertsIcon,{className:"size-5"})}),(0,t.jsx)("p",{className:"text-body-medium-m flex-1 font-dm text-content-primary",children:p})]})]})}let eb="h-[46px] w-[3px] bg-brand-content-primary",ev=(0,en.cn)("pointer-events-none absolute left-[-12.5px] top-[-12.5px] h-[194px] w-[126px]","bg-gradient-to-r from-white from-[18.868%] to-white/0"),ew=(0,n.forwardRef)(function({value:e,onCh
1ange:r,placeholder:a,maxLength:l,ariaLabel:s,testIdPrefix:i,showError:o,errorMessage:c,invalid:d,disabled:u,textClassName:f="font-headline text-[56px] font-semibold leading-[62px]",placeholderClassName:p="font-headline text-[36px] font-semibold leading-[44px] text-content-quaternary"},m){let[x,h]=(0,n.useState)(!1),[y,g]=(0,n.useState)(!1),[b,v]=(0,n.useState)(0),w=(0,n.useRef)(null),j=(0,n.useRef)(null),N=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=()=>{let e=w.current;if(!e)return;let t=e.scrollWidth>e.clientWidth+1;g(t),t&&(e.scrollLeft=e.scrollWidth)};return e(),window.addEventListener("resize",e),document.fonts?.ready.then(e),()=>window.removeEventListener("resize",e)},[e,x]);let k=()=>{let e=w.current;e&&!u&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length),v(e.value.length))};(0,n.useImperativeHandle)(m,()=>({focus:k})),(0,n.useLayoutEffect)(()=>{let t=w.current;if(!t||null==N.current)return;let n=Math.min(N.current,e.length);document.activeElement===t&&t.setSelectionRange(n,n),v(n);let r=requestAnimationFrame(()=>{N.current=null});return()=>cancelAnimationFrame(r)},[e]);let _=Math.min(b,e.length),I=_>=e.length,E=d??o;return(0,t.jsxs)("div",{className:"flex w-full flex-col items-center gap-3",children:[(0,t.jsxs)("label",{onClick:e=>{e.target!==w.current&&k()},className:"relative flex w-full cursor-text items-center justify-center overflow-hidden rounded-xl bg-surface-neutral-primary px-8 py-[53px]",children:[!x&&!e&&(0,t.jsx)("span",{"aria-hidden":"true","data-testid":`${i}-placeholder`,className:(0,en.cn)("pointer-events-none absolute inset-0 flex items-center justify-center whitespace-nowrap",p),children:a}),(0,t.jsxs)("div",{className:(0,en.cn)("flex max-w-full shrink-0 items-center",e?"gap-2":"gap-0"),children:[(0,t.jsxs)("span",{ref:j,className:(0,en.cn)("relative block min-w-0 overflow-hidden",y&&"-ml-8"),children:[(0,t.jsxs)("span",{"aria-hidden":"true",className:(0,en.cn)("block whitespace-pre",!y&&"px-px",f),children:[(0,t.jsx)("span",{className:"invisible",children:e?e.slice(0,_):"â"}),x&&!I&&(0,t.jsx)("span",{className:(0,en.cn)(eb,"rexy-caret-blink -mr-[3px] inline-block align-middle")}),(0,t.jsx)("span",{className:"invisible",children:e.slice(_)})]}),(0,t.jsx)("input",{ref:w,"data-testid":`${i}-input`,type:"text",value:e,onChange:e=>{N.current=e.target.selectionStart??e.target.value.length,r(e.target.value),v(N.current)},onSelect:()=>{let e=w.current;if(!e)return;let t=e.selectionStart??e.value.length;if(null!=N.current&&0===t&&N.current>0){e.setSelectionRange(N.current,N.current),v(N.current),N.current=null;return}N.current=null,v(t)},onFocus:()=>h(!0),onBlur:()=>h(!1),maxLength:l,disabled:u,autoComplete:"off",autoCapitalize:"off",spellCheck:!1,"aria-label":s,"aria-invalid":E,className:(0,en.cn)("absolute inset-0 w-full min-w-0 bg-transparent text-center","text-content-primary caret-transparent outline-none disabled:cursor-not-allowed",!y&&"px-px",f),onScroll:e=>{j.current&&(j.current.scrollLeft=e.currentTarget.scrollLeft)}})]}),(0,t.jsx)("span",{"aria-hidden":"true",className:(0,en.cn)(eb,"shrink-0",x&&I?"rexy-caret-blink":"opacity-0")})]}),y&&(0,t.jsx)("span",{"aria-hidden":"true","data-testid":`${i}-overflow-mask`,className:ev}),o&&(0,t.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-xl ring-2 ring-inset ring-brand-content-primary"})]}),o&&c&&(0,t.jsxs)("p",{role:"alert","data-testid":`${i}-error`,className:"flex shrink-0 items-center gap-1 font-dm text-body-m text-brand-content-primary",children:[(0,t.jsx)(z.AlertsIcon,{className:"size-4 shrink-0"}),c]})]})});ew.displayName="BigTextInputCard";let ej="Invalid Referral Code",eN=/^[a-zA-Z0-9]*$/;async function ek(e,t){let n=await e.v1.bindInvite({inviteCode:t});if(n.data?.success===!1)throw Error(n.data?.message??ej)}let e_=e=>({initial:{opacity:0,y:26,filter:"blur(8px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},transition:{duration:.6,delay:e,ease:[.22,1,.36,1]}});function eI({initialInviteCode:e,onDone:r}){let{value:a,setValue:s,error:i,submitting:o,canSubmit:d,bind:u}=function(e={}){let{onBound:t,initialCode:r}=e,{trex_client:a}
1=(0,c.useRexyApiContext)(),[l,s]=(0,n.useState)(r??""),[i,o]=(0,n.useState)(null),d=(0,v.useMutation)({mutationKey:["bindReferralCode"],mutationFn:e=>ek(a,e),onSuccess:(e,n)=>{o(null),(0,j.logGAEvent)("onb_referral_submit",{result:!0}),t?.(n)},onError:e=>{(0,m.sendError)(e,{scope:"referral"}),o(ej),(0,j.logGAEvent)("onb_referral_submit",{result:!1})}}),u=(0,n.useCallback)(e=>{s(e),o(eN.test(e)?null:ej)},[]),f=(0,n.useCallback)(async()=>{if(!l||!eN.test(l))return null;try{return await d.mutateAsync(l),l}catch{return null}},[d,l]),p=d.isPending,x=l.trim().length>0&&eN.test(l)&&!p;return{value:l,setValue:u,error:i,submitting:p,canSubmit:x,bind:f}}({onBound:r,initialCode:e}),f=(0,n.useRef)(null),[p,x]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{(0,j.logGAEvent)("onb_referral_view")},[]),(0,t.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),d&&await u()},className:"flex w-full max-w-[700px] flex-col items-center justify-center gap-14",children:[(0,t.jsxs)(l.m.div,{...e_(.15),className:"flex w-full flex-col items-center justify-center gap-1 text-center",children:[(0,t.jsx)("h1",{className:"whitespace-nowrap font-headline text-headline-regular-2xl text-content-primary",children:"Did a friend send you to Rexy?"}),(0,t.jsx)("p",{className:"font-dm text-body-l text-content-primary [word-break:break-word]",children:"Type your friend's code to unlock shared rewards after your first proof."})]}),(0,t.jsx)(l.m.div,{...e_(.35),onAnimationComplete:()=>{f.current?.focus(),x(!0)},className:"w-[521px] max-w-full",children:(0,t.jsx)(ew,{ref:f,value:a,onChange:s,placeholder:p?"Enter referral code":"",ariaLabel:"referral code",testIdPrefix:"rexy-onb-referral",showError:!!i,errorMessage:i??void 0,disabled:o})}),(0,t.jsxs)(l.m.div,{...e_(.55),className:"flex w-[400px] max-w-full flex-col items-center gap-4",children:[(0,t.jsx)(O.Button,{type:"submit","data-testid":"rexy-onb-referral-submit",loading:o,disabled:!d,className:"w-full",children:"Continue"}),(0,t.jsx)(O.Button,{variant:"ghost","data-testid":"rexy-onb-referral-skip",onClick:()=>{(0,j.logGAEvent)("onb_referral_skip"),r()},className:"min-h-0 px-0 py-0 font-normal text-content-secondary no-underline hover:no-underline hover:text-content-secondary",children:"I donât have a referral code"})]})]})}let eE=/^[A-Za-z0-9_]+$/,eC="Please use 6-20 letters, numbers, and underscores only.";async function eA(e,t){let n=await e.v1.setHandleName({handleName:t}),r=n.data?.code;if(r&&"0"!==r){if("00022"===r||"00023"===r)throw Object.assign(Error(`@${t} is taken. Try another one.`),{code:r});throw Object.assign(Error(n.data?.message??r),{code:r})}}var eS=e.i(826324);let eP=e=>({initial:{opacity:0,y:26,filter:"blur(8px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},transition:{duration:.6,delay:e,ease:[.22,1,.36,1]}});function eT({source:e,onClaimed:r}){let{value:a,setValue:s,status:i,error:o,submitting:d,canSubmit:u,claim:f}=function(e={}){let{onClaimed:t}=e,{trex_client:r}
1=(0,c.useRexyApiContext)(),[a,l]=(0,n.useState)(""),[s,i]=(0,n.useState)("idle"),[o,d]=(0,n.useState)(null),u=(0,v.useMutation)({mutationKey:["claimHandle"],mutationFn:e=>eA(r,e),onSuccess:(e,n)=>{i("valid"),d(null),(0,j.logGAEvent)("onb_handle_set",{handle:n}),t?.(n)},onError:e=>{let t=e.code;(0,m.sendError)(e,{scope:"handle",code:t});let n="00022"===t||"00023"===t?"taken":"invalid";i(n),d({type:"taken"===n?"taken":"network",code:t,message:e instanceof Error?e.message:String(e)})}}),f=(0,n.useCallback)(e=>{if(l(e),!e){i("idle"),d(null);return}if(!eE.test(e)){i("invalid"),d({type:"format",message:eC});return}i("valid"),d(null)},[]),p=(0,n.useCallback)(async()=>{if(!eE.test(a)||a.length<6||a.length>20)return i("invalid"),d({type:"format",message:eC}),null;try{return await u.mutateAsync(a),a}catch{return null}},[u,a]),x=u.isPending,h=a.length>0&&"invalid"!==s&&!x;return{value:a,setValue:f,status:s,error:o,submitting:x,canSubmit:h,claim:p}}({onClaimed:r}),[p,x]=(0,n.useState)(!1),h=(0,n.useRef)(null),[y,g]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(0,j.logGAEvent)("onb_handle_view",e?{source:e}:void 0)},[e]);let b=!!o&&(p||a.length>0&&!/^[A-Za-z0-9_]*$/.test(a));return(0,t.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),u&&(x(!0),await f())},className:"flex w-full max-w-[700px] flex-col items-center justify-center gap-14",children:[(0,t.jsxs)(l.m.div,{...eP(.15),className:"flex w-full flex-col items-center justify-center gap-1 text-center",children:[(0,t.jsx)("h1",{className:"whitespace-nowrap font-headline text-headline-regular-2xl text-content-primary",children:"What should Rexy call you?"}),(0,t.jsx)("p",{className:"font-dm text-body-l text-content-primary [word-break:break-word]",children:"Type your username, it will be the signature behind every proof Rexy seals for you."})]}),(0,t.jsx)(l.m.div,{...eP(.35),onAnimationComplete:()=>{h.current?.focus(),g(!0)},className:"w-full",children:(0,t.jsx)(ew,{ref:h,value:a,onChange:e=>{x(!1),s(e)},placeholder:y?"Enter handle name":"",ariaLabel:"handle",testIdPrefix:"rexy-onb-handle",showError:b,errorMessage:b?o?.message:void 0,invalid:"invalid"===i||"taken"===i})}),(0,t.jsx)(l.m.div,{...eP(.55),children:(0,t.jsx)(O.Button,{type:"submit","data-testid":"rexy-onb-handle-submit",...(0,eS.buildTrackerProps)({params:{trigger:"onb_handle_submit"}}),loading:d,disabled:!u,className:"w-[400px] max-w-full",children:"Continue"})})]})}var eR=e.i(546405),eL=e.i(143782),eG=e.i(55315),eO=e.i(426426);let ez=`${(0,eO.getOssPublicUrl)()}/public/static/regis/title`,eD=e=>({initial:{opacity:0,y:26,filter:"blur(8px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},transition:{duration:.6,delay:e,ease:[.22,1,.36,1]}}),eM=[-367,-182,0,182,367],eF=[.3,.5,1,.5,.3],eB=[.9,.9,1,.9,.9],eq=[.22,1,.36,1],eU={x:{duration:.6,ease:eq},scale:{duration:.6,ease:eq},opacity:{duration:.5,ease:eq}},eK={duration:0},e$={opacity:{duration:.45,ease:eq,delay:.08},scale:{duration:.5,ease:eq}},eW={opacity:{duration:.4}};function eQ(e,t,n){let r=Math.floor(n/2);return((e-t+r)%n+n)%n-r}function eH({onConfirm:e}){let{titles:r,isLoading:a}=y(),[s,i]=(0,n.useState)("");(0,n.useEffect)(()=>{(0,j.logGAEvent)("onb_identity_view")},[]);let o=s||(r[0]?.titleId??""),c=r.length,d=Math.max(0,r.findIndex(e=>e.titleId===o)),[u,f]=(0,n.useState)(d);(0,n.useEffect)(()=>{f(d)},[d]);let p=(0,n.useCallback)(e=>{0===c||i(r[((d+e)%c+c)%c].titleId??"")},[d,r,c]);return((0,n.useEffect)(()=>{if(c<=1)return;let e=window.setInterval(()=>p(1),3e3);return()=>window.clearInterval(e)},[d,p,c]),a)?(0,t.jsxs)("section",{className:"flex w-[1000px] max-w-full flex-col items-center gap-4 overflow-clip",children:[(0,t.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-1 text-center [word-break:break-word]",children:[(0,t.jsxs)("h1",{className:"font-headline text-headline-regular-2xl text-content-primary",children:[(0,t.jsx)("span",{className:"block",children:"What describes you best?"}),(0,t.jsx)("span",{className:"block",children:"Prove it."})]}),(0,t.jsx)("p",{className:"font-dm text-body-l text-content-primary",children:"Pick a card, Rexy will help you find one true fact about yourself and stamp it PROVEN."})]}
1),(0,t.jsxs)("div",{className:"flex h-[360px] items-center justify-center gap-[52px]",children:[(0,t.jsx)("div",{className:"h-[160px] w-[120px] animate-pulse rounded-2xl bg-surface-black-overlay-5 opacity-50"}),(0,t.jsx)("div",{className:"h-[232px] w-[176px] animate-pulse rounded-2xl bg-surface-black-overlay-5"}),(0,t.jsx)("div",{className:"h-[160px] w-[120px] animate-pulse rounded-2xl bg-surface-black-overlay-5 opacity-50"})]}),(0,t.jsx)("div",{className:"h-12 w-[400px] animate-pulse rounded-xl bg-surface-black-overlay-5"})]}):(0,t.jsxs)("section",{className:"flex w-[1000px] max-w-full flex-col items-center gap-4",children:[(0,t.jsxs)(l.m.div,{...eD(.15),className:"flex w-full flex-col items-center justify-center gap-1 text-center [word-break:break-word]",children:[(0,t.jsxs)("h1",{className:"font-headline text-headline-regular-2xl text-content-primary",children:[(0,t.jsx)("span",{className:"block",children:"What describes you best?"}),(0,t.jsx)("span",{className:"block",children:"Prove it."})]}),(0,t.jsx)("p",{className:"font-dm text-body-l text-content-primary",children:"Pick a card, Rexy will help you find one true fact about yourself and stamp it PROVEN."})]}),(0,t.jsx)(l.m.div,{...eD(.35),children:(0,t.jsxs)("div",{className:"group relative h-[360px] w-[1000px] max-w-full",children:[(0,t.jsx)("div",{className:"absolute inset-0 overflow-clip",children:r.map((e,n)=>{let r=eQ(n,d,c),a=r+2,s=a>=0&&a<eM.length,o=0===r,f=Math.abs(r-eQ(n,u,c))>1;return(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",style:{zIndex:10-Math.abs(r)},children:(0,t.jsxs)(l.m.button,{type:"button","data-testid":`rexy-onb-identity-card-${e.titleId}`,"aria-pressed":o,"aria-hidden":!s,tabIndex:s?0:-1,onClick:()=>i(e.titleId??""),initial:!1,animate:{x:s?eM[a]:eM[r<0?0:eM.length-1],scale:s?eB[a]:eB[r<0?0:eB.length-1],opacity:s?eF[a]:0},transition:f?eK:eU,className:(0,en.cn)("relative grid h-[232px] w-[176px] place-items-center rounded-xl outline-none","focus-visible:ring-2 focus-visible:ring-[#ec6656]/50 focus-visible:ring-offset-2",s?"pointer-events-auto":"pointer-events-none"),children:[(0,t.jsxs)(l.m.span,{initial:!1,animate:{opacity:+!!o,scale:o?1:.92},transition:e$,className:(0,en.cn)("absolute inset-0 flex h-[232px] w-[176px] flex-col items-center justify-end overflow-clip rounded-xl pt-3",o?"pointer-events-auto":"pointer-events-none"),children:[e.titleId&&(0,t.jsx)(eR.default,{alt:e.titleName??"",src:`${ez}/${e.titleId}.png`,width:216,height:270,unoptimized:!0,className:"pointer-events-none absolute left-[-20px] top-[-32px] h-[270px] w-[216px] max-w-none object-cover"}),(0,t.jsx)("span",{className:"relative flex w-full items-center justify-center bg-gradient-to-b from-black/0 to-black py-3",children:(0,t.jsx)("span",{className:"min-w-px flex-1 text-center font-dm text-body-medium-l text-white",children:e.titleName})})]}),(0,t.jsxs)(l.m.span,{initial:!1,animate:{opacity:+!o},transition:eW,className:(0,en.cn)("absolute left-1/2 top-1/2 flex h-[160px] w-[120px] -translate-x-1/2 -translate-y-1/2 flex-col items-center justify-center gap-2 rounded-xl py-[22px]",o?"pointer-events-none":"pointer-events-auto"),children:[e.titleId&&(0,t.jsx)(eR.default,{alt:e.titleName??"",src:`${ez}/default/${e.titleId}.png`,width:32,height:32,unoptimized:!0,className:"size-8"}),(0,t.jsx)("span",{className:"whitespace-nowrap font-dm text-body-m text-content-tertiary [word-break:break-word]",children:e.titleName})]})]})},e.titleId)})}),(0,t.jsx)("button",{type:"button","data-testid":"rexy-onb-identity-prev","aria-label":"Previous archetype",onClick:()=>p(-1),className:(0,en.cn)("absolute -left-[136px] top-1/2 z-20 grid size-14 -translate-y-1/2 place-items-center rounded-full","bg-surface-white-overlay-100 text-content-primary opacity-0 transition-opacity duration-200","group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none","focus-visible:ring-2 focus-visible:ring-[#ec6656]/50"),children:(0,t.jsx)(eL.ChevronLeftIcon,{className:"size-8"})}),(0,t.jsx)("button",{type:"button","data-testid":"rexy-onb-identity-next","aria-label":"Next archetype",onClick:()=>p(1),className:(0,en.cn)("absolute -right-[136px] top-1/2 z-20 grid size-14 -translate-y-1/2 place-items-center rounded-full","bg-surface-white-overlay-100 text-content-primary opacity-0 transition-opacity duration-200","group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none","focus-visible:ring-2 focus-visible:ring-[#ec6656]/50"),children:(0,t.jsx)(eG.ChevronRightIcon,{className:"size-8"})})]})}),(0,t.jsx)(l.m.div,{...eD(.55),className:"flex w-full flex-col items-center",children:(0,t.jsx)(O.Button,{"data-testid":"rexy-onb-identity-confirm",onClick:()=>{(0,j.logGAEvent)("onb_identity_confirm",{archetype:o}),e(o)},className:"w-[400px] max-w-full font-dm",children:"That's me. Prove it."})})]})}var eY=e.i(631400),eV=e.i(86895),eX=e.i(30100);async function eZ(e,t){if(x.MOCK_FLAGS.ONBOARDING_TITLE_PLATFORMS_FIELDS.enabled)return(0,u.getMockTitlePlatforms)(t);let n=await e.v1.listProofFields({by:"title",value:t});return n.data?.obj?.list??[]}var eJ=e.i(825919),e0=e.i(62263);let e1="trex2c-rex-install-reload-once";var e2=e.i(330438);async function e6(e){let t=await e.v1.skipOnboarding(),n=t?.data;if(n?.success!==!0&&n?.code!=="0000")throw Error(n?.message??"skipOnboarding: request failed")}async function e5(e,t){let n=await e.v1.getPassportInfo(),r=n.data?.obj;r&&(0,p.savePassportInfo)(r),await Promise.all([t.invalidateQueries({queryKey:(0,p.generateUniqueQueryKey)("portal","passport-info")}),t.invalidateQueries({queryKey:(0,p.generateUniqueQueryKey)("landing","onboarding-status")})])}let e3=new Set(["x","discord","telegram"]),e4="$ ???",e8=e=>({initial:{opacity:0,y:26,filter:"blur(8px)"}
1,animate:{opacity:1,y:0,filter:"blur(0px)"},transition:{duration:.6,delay:e,ease:[.22,1,.36,1]}});function e7({platform:e,selected:n,testId:r,onSelect:a}){let l=e.platformId??"",s=e.platformName??"";return(0,t.jsxs)("button",{type:"button","data-testid":r,"data-selected":n?"true":void 0,"aria-pressed":n,...(0,eS.buildTrackerProps)({params:{trigger:"onb_prove_platform_pick",platform:l}}),onClick:()=>a(l),className:(0,en.cn)("group flex min-w-px items-center justify-between gap-2 overflow-clip rounded-[14px] bg-surface-neutral-primary p-[13px] text-left","transition-colors duration-150 outline-none","focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[#ec6656]/50","hover:border-brand-border-solid hover:[background-image:linear-gradient(0deg,#ec66560d,#ec66560d)]",n?"border border-brand-border-solid":"border border-transparent"),children:[(0,t.jsxs)("span",{className:"flex shrink-0 flex-col items-start justify-center gap-1",children:[(0,t.jsx)(eY.PlatformIcon,{platformDomain:e.platformIcon,label:s}),(0,t.jsx)("span",{className:"font-dm text-[16px] font-semibold leading-[24px] whitespace-nowrap text-[#17150f]",children:s})]}),(0,t.jsx)("span",{className:"relative block size-6 shrink-0 overflow-clip",children:n?(0,t.jsx)("span",{className:"absolute inset-[8.33%] block",children:(0,t.jsx)(eV.SuccessCheckIcon,{className:"block size-full text-brand-content-primary"})}):(0,t.jsx)(eX.SuccessCircleIcon,{className:"block size-full text-content-primary"})})]})}function e9({archetypeId:e,loginChannel:r,onBack:a,onSeal:s,onSkip:i}){let{fields:u,isLoading:f}=function(e){let{trex_client:t}=(0,c.useRexyApiContext)(),{authReady:n}=(0,d.useRexyAuthContext)(),r=(0,o.useQuery)({queryKey:(0,p.generateUniqueQueryKey)("onboarding","title-platforms",e),queryFn:()=>eZ(t,e),enabled:!!e});return r.error&&(0,m.sendError)(r.error,{scope:"title_platforms"}),{fields:r.data??[],isLoading:r.isLoading||!n,isError:r.isError}}(e),[x,h]=(0,n.useState)(null),[y,g]=(0,n.useState)(!1),[b,N]=(0,n.useState)(!1),[k,_]=(0,n.use
1State)(e4),{skip:I,isPending:E}=function(){let{trex_client:e}=(0,c.useRexyApiContext)(),t=(0,w.useQueryClient)(),n=(0,v.useMutation)({mutationKey:["skipOnboarding"],mutationFn:()=>e6(e),onSuccess:async()=>{await e5(e,t)},onError:e=>(0,m.sendError)(e,{scope:"onboarding",reason:"skip_onboarding_failed"})});return{skip:()=>n.mutateAsync(),isPending:n.isPending}}(),[C,A]=(0,n.useState)(null),[S,P]=(0,n.useState)(!1),T=u.filter(e=>!(r&&e3.has(e.platformId??"")&&e.platformId===r)),R=T.find(e=>e.platformId===x)??null,L=function(e){let{installed:t,checking:r,env:a}=(0,eJ.useExtensionPresence)(),[l,s]=(0,n.useState)("idle"),i=(0,n.useRef)(!1),o=(0,B.isDesktopChrome)(a)&&!t,c=(0,n.useCallback)(()=>{(0,e0.removeSessionItem)(e1)},[]),d=(0,n.useCallback)(()=>(0,e0.reloadOnce)(e1,e.reloadPage),[e.reloadPage]);return(0,n.useEffect)(()=>{t&&!i.current&&"idle"!==l&&((0,j.logGAEvent)("onb_addrex_done",{from:e.from}),s("idle")),t&&c(),i.current=t},[c,t,e.from,l]),(0,n.useEffect)(()=>{if(!(0,B.isDesktopChrome)(a)||"awaiting_return"!==l)return;let e=()=>{"visible"===document.visibilityState&&d()},t=()=>{d()};return document.addEventListener("visibilitychange",e),window.addEventListener("focus",t),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",t)}},[a,l,d]),{showInstallCta:o,phase:l,label:o?"Seal my proof on Chrome":"",openStore:(0,n.useCallback)(()=>!!window.open(M.CHROME_STORE_URL,"_blank")&&((0,j.logGAEvent)("onb_addrex_tap",{device:a,from:e.from,...e.platformId?{platform:e.platformId}:{}}),c(),s("awaiting_return"),!0),[c,a,e.from,e.platformId]),installed:t,env:a,checking:r}}({from:"onboarding_verify",platformId:R?.platformId??void 0}),G=!(0,B.isDesktopChrome)(L.env);(0,n.useEffect)(()=>{(0,j.logGAEvent)("onb_prove_view",{archetype:e,device:L.env,has_extension:L.installed})},[e,L.env,L.installed]);let D=R?.platformPrice??null;(0,n.useEffect)(()=>{if(!D)return void _(e4);let e=0,t=0,n=r=>{let a;t||(t=r);let l=Math.min((r-t)/850,1);_((a=1-(1-l)**3,D.replace(/\d+/g,e=>String(Math.round(Number(e)*a))))),l<1&&(e=requestAnimationFrame(n))};return e=requestAnimationFrame(n),()=>cancelAnimationFrame(e)},[D]);let F=async()=>{if(R){(0,j.logGAEvent)("onb_verify_start",{platform:R.platformId,method:R.providerChannel,cta:y?"retry":"seal"}),g(!1),N(!0);try{await s({platformId:R.platformId??"",platformName:R.platformName??"",platformIcon:R.platformIcon,platformPrice:R.platformPrice,providerChannel:R.providerChannel,providerId:R.providerId,providerType:(0,e2.getFieldProviderType)(R),fieldId:R.id,providerExt:R.providerExt},()=>N(!1))}catch{g(!0)}finally{N(!1)}}},q=async()=>{if(R){if(L.showInstallCta){P(!1),L.openStore()||P(!0);return}await F()}},U=L.showInstallCta?L.label:y?"Try again":"Seal my proof,-20s",K=b||L.showInstallCta&&L.checking,$=async()=>{if(!E){A(null),(0,j.logGAEvent)("onb_verify_skip",{archetype:e,device:L.env,has_extension:L.installed});try{await I(),i()}catch{A("Couldn't skip. Check your connection and try again.")}}};return f?(0,t.jsxs)("section",{className:"flex w-full max-w-[760px] flex-col items-center gap-14",children:[(0,t.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-1 text-center [word-break:break-word]",children:[(0,t.jsx)("p",{className:"font-headline text-[56px] font-semibold leading-[62px] text-content-quaternary tabular-nums",children:"$ ???"}),(0,t.jsx)("p",{className:"font-dm text-body-l text-content-primary",children:"Let's start with the most frequently used app and seal the proof."})]}),(0,t.jsx)("div",{className:"grid w-[570px] max-w-full grid-cols-3 gap-3",children:Array.from({length:6}).map((e,n)=>(0,t.jsx)("div",{className:"h-[72px] animate-pulse rounded-[14px] bg-surface-black-overlay-5"},n))}),(0,t.jsx)("div",{className:"h-12 w-[420px] max-w-full animate-pulse rounded-xl bg-surface-black-overlay-5"})]}):0===T.length?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"fixed right-6 top-6 z-10 flex max-w-[220px] flex-col items-end gap-2",children:[(0,t.jsx)(O.Button,{variant:"secondary",size:"sm","data-testid":"rexy-onb-prove-skip",disabled:E,onClick:$,className:"border-foreground
1/20 font-medium text-content-primary",children:"Skip"}),C?(0,t.jsx)("p",{role:"alert","data-testid":"rexy-onb-prove-skip-error",className:"text-right font-dm text-body-medium-m text-content-primary",children:C}):null]}),(0,t.jsxs)("section",{className:"flex w-full max-w-[760px] flex-col items-center gap-14",children:[(0,t.jsxs)(l.m.div,{...e8(.15),className:"flex w-full flex-col items-center justify-center gap-1 text-center [word-break:break-word]",children:[(0,t.jsx)("p",{className:(0,en.cn)("font-headline text-[56px] font-semibold leading-[62px] tabular-nums",k===e4?"text-content-quaternary":"text-content-primary"),children:k}),(0,t.jsx)("p",{className:"font-dm text-body-l text-content-primary",children:"Let's start with the most frequently used app and seal the proof."})]}),(0,t.jsx)(l.m.div,{...e8(.35),className:(0,en.cn)("grid w-[570px] max-w-full gap-3",function(e){switch(e){case 1:return"grid-cols-[182px] justify-center";case 2:case 4:return"grid-cols-[182px_182px] justify-center";default:return"grid-cols-3"}}(T.length)),children:T.map(e=>(0,t.jsx)(e7,{platform:e,selected:x===e.platformId,testId:`rexy-onb-prove-platform-${e.platformId}`,onSelect:e=>{g(!1),h(t=>t===e?null:e)}},e.platformId))}),!G&&(0,t.jsxs)(l.m.div,{...e8(.55),className:"flex w-full flex-col items-center gap-4",children:[(0,t.jsx)(O.Button,{"data-testid":"rexy-onb-prove-seal",disabled:!R||K,loading:K,onClick:q,className:"w-[420px] max-w-full font-dm",children:U}),(0,t.jsx)(O.Button,{variant:"ghost","data-testid":"rexy-onb-prove-back",onClick:()=>{(0,j.logGAEvent)("onb_prove_back"),a()},className:"min-h-0 px-0 py-0 font-normal no-underline text-content-tertiary hover:no-underline",children:"Back to identity"})]}),G&&(0,t.jsx)(l.m.div,{...e8(.65),className:"flex w-full justify-center",children:(0,t.jsxs)("p",{"data-testid":"rexy-onb-prove-chrome-hint",className:"flex w-full max-w-[363px] items-center text-left font-dm text-body-medium-m text-content-primary",children:[(0,t.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg text-brand-content-primary",children:(0,t.jsx)(z.AlertsIcon,{className:"size-5"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 leading-5",children:[(0,t.jsx)("a",{href:"https://rexy.so",target:"_blank",rel:"noopener noreferrer",className:"underline decoration-solid underline-offset-2",children:"rexy.so"})," in desktop Chrome to seal the proof."]})]})}),S&&(0,t.jsx)("p",{"data-testid":"rexy-onb-prove-popup-blocked-alert",role:"alert",className:"w-full max-w-[420px] text-center font-dm text-body-medium-m text-content-primary",children:"Your browser blocked the new tab. Allow pop-ups for Rexy, then try again."})]})]})}var te=e.i(774481);function tt({archetypeName:e,platformPrice:n,platformDomain:r,platformLabel:a,sealedAt:l}){return(0,t.jsxs)("div",{"data-testid":"rexy-onb-result-proof-card",className:"relative flex w-[400px] max-w-full flex-col items-start gap-8 overflow-clip rounded-xl bg-surface-neutral-primary px-6 pt-10 pb-6",children:[(0,t.jsx)(te.RexyLogoMark,{className:"pointer-events-none absolute top-[-52px] left-[150px] h-[162px] w-[243px] text-brand-bg-overlay-10"}),(0,t.jsxs)("div",{className:"relative flex w-full flex-col justify-center gap-2 font-headline font-semibold",children:[(0,t.jsx)("p",{className:"text-headline-regular-s text-content-secondary",children:e}),(0,t.jsx)("p",{className:"text-display-xs text-brand-content-primary",children:n})]}),(0,t.jsxs)("div",{className:"relative flex w-full flex-col gap-4",children:[(0,t.jsx)("div",{"aria-hidden":"true",className:"h-px w-full bg-line-white-transparent-10"}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between font-dm text-[12px] leading-4 [word-break:break-word]",children:[(0,t.jsxs)("span",{className:"flex min-w-px flex-1 items-center gap-2",children:[(0,t.jsx)(eY.PlatformIcon,{platformDomain:r,label:a,className:"size-6 rounded-[4px]"}),(0,t.jsx)("span",{className:"whitespace-nowrap text-content-secondary",children:`Verified via ${a}`})]}),(0,t.jsx)("span",{className:"whitespace-nowrap text-content-quaternary",children:l.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]})]})]})}let tn=e=>({initial:{opacity:0,y:26,filter:"blur(8px)"}
1,animate:{opacity:1,y:0,filter:"blur(0px)"},transition:{duration:.6,delay:e,ease:[.22,1,.36,1]}});function tr({archetypeName:e,platformPrice:r,platformDomain:a,platformLabel:s,sealedAt:i,onSeeOffers:o,onProveAnother:c}){return(0,n.useEffect)(()=>{(0,j.logGAEvent)("onb_result_view")},[]),(0,t.jsxs)("section",{className:"flex flex-col items-center gap-14 overflow-clip",children:[(0,t.jsxs)(l.m.h1,{...tn(.15),className:"text-center font-headline text-headline-regular-2xl text-content-primary [word-break:break-word]",children:[(0,t.jsx)("span",{className:"block",children:"You were worth it all along."}),(0,t.jsx)("span",{className:"block",children:"Now it shows"})]}),(0,t.jsx)(l.m.div,{...tn(.35),children:(0,t.jsx)(tt,{archetypeName:e,platformPrice:r,platformDomain:a,platformLabel:s,sealedAt:i})}),(0,t.jsxs)(l.m.div,{...tn(.55),className:"flex flex-col items-center gap-4",children:[(0,t.jsx)(O.Button,{"data-testid":"rexy-onb-result-see-offers",onClick:()=>{(0,j.logGAEvent)("onb_result_see_offers"),o()},className:"w-[420px] max-w-full font-dm",children:"See the offers waiting for you"}),(0,t.jsx)(O.Button,{variant:"ghost","data-testid":"rexy-onb-result-prove-another",onClick:()=>{(0,j.logGAEvent)("onb_result_prove_another"),c()},className:"min-h-0 px-0 py-0 font-normal no-underline text-content-tertiary hover:no-underline",children:"Prove another"})]})]})}let ta="trex2c-onb-archetype",tl="trex2c-onb-resume-prove";function ts(e){try{return window.sessionStorage.getItem(e)}catch{return null}}function ti(e,t){try{null===t?window.sessionStorage.removeItem(e):window.sessionStorage.setItem(e,t)}catch{}}function to(){return(0,t.jsx)(n.Suspense,{fallback:(0,t.jsx)(i,{children:null}),children:(0,t.jsx)(tc,{})})}function tc(){let e=(0,r.useRouter)(),l=(0,r.useSearchParams)().get("redirect"),s=new URLSearchParams(l?.split("?")[1]??""),o=(s.get("inviteCode")??s.get("invitecode"))?.trim()||void 0,{titles:d}=y(),u=(0,g.useEntryGate)(l),{zkTLSProof:f}=(0,S.useZkTLSProof)(),{authorize:x}=(0,P.useOAuthProof)(),{passportInfo:h}
1=(0,R.usePassportInfo)(),{getSealedProofDetail:k}=function(){let{trex_client:e}=(0,c.useRexyApiContext)(),t=(0,v.useMutation)({mutationKey:["sealedProofDetail"],mutationFn:t=>L(e,t),onError:e=>(0,m.sendError)(e,{scope:"proof_summary"})});return{getSealedProofDetail:e=>t.mutateAsync(e),isPending:t.isPending}}(),{mint:I}=function(e={}){let{onFinished:t}=e,{trex_client:r}=(0,c.useRexyApiContext)(),a=(0,N.useActiveWallet)(),l=a?.getAccount(),s=(0,w.useQueryClient)(),i=(0,v.useMutation)({mutationKey:["mintPassport"],mutationFn:async()=>{if(!a||!l)return(0,j.logGAEvent)(_,{result:!1,mint_status:"error",error_code:"no_wallet"}),(0,m.sendError)(Error("mint_passport_no_wallet"),{scope:"mint_passport"}),{status:"error",passportInfo:null};try{let e=await C({trexClient:r,wallet:a,account:l},e=>{(0,j.logGAEvent)(_,{result:"success"===e||"already_has_passport"===e,mint_status:e})});return e.passportInfo&&((0,p.savePassportInfo)(e.passportInfo),await s.invalidateQueries({queryKey:(0,p.generateUniqueQueryKey)("portal","passport-info")})),e}catch(e){return A(e)}},onSettled:e=>{e&&t?.(e)}}),o=(0,n.useCallback)(async()=>{(0,j.logGAEvent)(_,{result:!0,mint_status:"start"});try{return await i.mutateAsync()}catch(e){return A(e)}},[i]);return{minting:i.isPending,mint:o}}(),[E,G]=(0,n.useState)(null),[O,z]=(0,n.useState)(()=>ts(ta)??""),[D,M]=(0,n.useState)(null),[F,B]=(0,n.useState)(null),[q,U]=(0,n.useState)(null),[K,$]=(0,n.useState)(null),Q=E??u.step;(0,n.useEffect)(()=>{null===E&&"identity"===Q&&O&&"1"===ts(tl)&&G("prove")},[O,E,Q]);let H=(0,n.useCallback)((e,t)=>{if(M(e),t){G("referral"),ti(tl,null);return}u.refresh()},[u.refresh]),Y=d.find(e=>e.titleId===O)?.titleName??"";return(0,t.jsxs)(i,{children:["install"===Q&&(0,t.jsx)(W,{onDetected:()=>u.refresh(),onSkip:()=>{(0,g.markInstallSkipped)(),u.refresh()}}),"login"===Q&&(0,t.jsx)(eg,{onAuthenticated:H}),"referral"===Q&&(0,t.jsx)(eI,{initialInviteCode:o,onDone:()=>{G(null),ti(tl,null),u.setStep("handle")}}),"handle"===Q&&(0,t.jsx)(eT,{onClaimed:()=>{I(),u.setStep("identity")}}),"identity"===Q&&(0,t.jsx)(eH,{onConfirm:e=>{ti(ta,e),ti(tl,"1"),z(e),G("prove")}}),"prove"===Q&&(0,t.jsx)(e9,{archetypeId:O,loginChannel:D,onBack:()=>{ti(tl,null),G(null)},onSeal:async(e,t)=>{if(e.providerChannel===a.PROVIDER_CHANNEL.zktls)await f({platformId:e.platformId,providerType:e.providerType??"",providerId:e.providerId,onInvoked:t});else if(e.providerChannel===a.PROVIDER_CHANNEL.oauth){t?.();let n=await x(e.platformId,{id:e.fieldId,providerId:e.providerId,providerChannel:e.providerChannel,providerExt:e.providerExt},h?.passportId??null);if(n.deferred||$({platformName:e.platformName,outcome:n}),!n.settled)throw Error("oauth_not_settled")}else t?.();B(e);try{let t=await k(e.platformId);U(t.sealedAt)}catch{U(new Date)}finally{ti(tl,null),G("result")}},onSkip:()=>{ti(ta,null),ti(tl,null),(0,b.enterPortal)(e,l)}}),"result"===Q&&F&&q&&(0,t.jsx)(tr,{archetypeName:Y,platformPrice:F.platformPrice,platformDomain:F.platformIcon,platformLabel:F.platformName,sealedAt:q,onSeeOffers:()=>{ti(tl,null),(0,b.enterPortal)(e,l)},onProveAnother:()=>{ti(tl,null),G(null)}}),K&&!K.outcome.deferred&&(0,t.jsx)(T.OAuthProofToastView,{platformName:K.platformName,exchange:K.outcome.exchange,pollSettled:K.outcome.settled,onClose:()=>$(null),testId:"rexy-onboarding-oauth-toast"})]})}e.s(["default",()=>to],855366)}]);
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.