1import{O as l,V as E,T as C,U as N,M as x,ao as O,D as V,a5 as R,bG as B,X as K,z as n,I as g,Z as q,b8 as X,b9 as Q,bs as Z,bO as ee,$ as W,at as te,P as ne,Q as ie,R as re,bL as oe}from"./index-CDp3i4jH.js";import{e as H,as as D,ao as ae,bh as I,b0 as se,g as v,a as Y,bi as le,bj as ce,a0 as ue,C as de,f as me,ba as fe,A as pe,bk as he}from"./Routing-CeCKMLmz.js";import{D as ge}from"./DemoSkipButton-CFj6B9NY.js";import{a as A}from"./apiService-CMs8UziQ.js";import{B as ye}from"./index-DCxvOZY2.js";import{s as be}from"./authSession-C9srQm5Z.js";import"./userProfileFirestore-BfWNso1J.js";const M=x("PlaidFlags"),P={enablePlaid:!0,showPlaidForMen:!0,isPlaidRequired:!1,requireVerificationForPlaid:!1,showCryptoVerification:!1,showPlaidAssets:!1};function xe(e){return{enablePlaid:e.enablePlaid!==!1,showPlaidForMen:e.showPlaidForMen!==!1,isPlaidRequired:e.requirePlaid===!0,requireVerificationForPlaid:e.requireVerificationForPlaid===!0,showCryptoVerification:e.showCryptoVerification===!0,showPlaidAssets:e.showPlaidAssets===!0}}function ve(e){const[t,i]=l.useState(P),[r,a]=l.useState(!0);return l.useEffect(()=>{const o=async()=>{try{const u=await C(N(E,"settings","featureFlags"));if(u.exists()){const d=xe(u.data());i(d)}else i(P)}catch(c){M.error("fetch_feature_flags_failed",{error:c}),i(P)}finally{a(!1)}},s=async()=>{if(e)try{await C(N(E,"users",e))}catch(c){M.error("check_consent_status_failed",{error:c})}};o(),s()},[e]),{flags:t,loadingFeatureFlags:r}}const we=x("PlaidVisibility");function Se(e,t){return((e==null?void 0:e.gender)||(t==null?void 0:t.gender)||"").toLowerCase()}function je(e,t){return Se(e,t)==="male"}function G(e){return!!(e!=null&&e.identityVerified||e!=null&&e.veriffId)}function $(e,t,i){return!e.enablePlaid||!e.showPlaidForMen||!je(t,i)?!1:!e.requireVerificationForPlaid||G(t)}function ke(e,t,i){const r=(t==null?void 0:t.requiresIncomeVerification)===!0;return $(e,t,i)&&(r||e.isPlaidRequired)&&G(t)}function Pe(e,t,i){return!e&&!t&&!!i}const Ee={incomeVerified:!1,incomeVerificationSkipped:!0,incomeVerificationAutoSkipped:!0,incomeVerificationSkippedAt:O(),onboardingStep:6};async function Ce(e){await H(e,Ee)}function Ne({flags:e,userData:t,user:i,uid:r,loadingFeatureFlags:a,isUserDataLoading:o,navigateToMatchmaker:s}){const c=l.useRef(!1),u=l.useCallback(()=>$(e,t,i),[e,t,i]),d=l.useCallback(()=>ke(e,t,i),[e,t,i]);return l.useEffect(()=>{Pe(a,o,r)&&(u()||c.current||(c.current=!0,Ce(r).then(()=>s()).catch(m=>we.error("auto_skip_failed",{error:m}))))},[a,o,r,u,s]),{shouldShowPlaid:u,isPlaidRequiredForUser:d}}const Re=x("PlaidInit"),Ae=1800*1e3,S=new Map;function Fe(e,t){const i=S.get(e.uid);if((i==null?void 0:i.expiresAt)>Date.now())return i.promise;const r=A.createPlaidLinkToken({uid:e.uid,phoneNumber:e.phoneNumber,is_mobile_app:t}).then(o=>{if(!(o!=null&&o.link_token))throw new Error("Failed to create link token");return o}),a={promise:r,expiresAt:Date.now()+Ae};return S.set(e.uid,a),r.catch(()=>{S.get(e.uid)===a&&S.delete(e.uid)}),r}function _e(){const e=V(),t=e.currentUser,i=t==null?void 0:t.uid,r=t==null?void 0:t.phoneNumber,a=R.isNativePlatform(),[o,s]=l.useState(!1),[c,u]=l.useState(null),[d,m]=l.useState(null),[f,b]=l.useState(!1),p=l.useRef(!0),h=l.useRef(!1);l.useEffect(()=>{const y=e.onAuthStateChanged(k=>{!f&&k&&b(!0)});return()=>y()},[]);const w=l.useCallback(async()=>{if(!(!i||h.current)){h.current=!0,s(!0);try{const y=await Fe({uid:i,phoneNumber:r},a);y.hosted_link_url&&m(y.hosted_link_url)}catch(y){h.current=!1,Re.error("initialization_failed",{error:y}),p.current&&u("Failed to initialize Plaid. Please try again.")}finally{p.current&&s(!1)}}},[i,r,a]);return{firebaseUser:t,isNative:a,loading:o,setLoading:s,error:c,setError:u,hostedLinkUrl:d,authReady:f,mounted:p,initializationAttempted:h,initializePlaid:w}}async function ze(e){if(R.isNativePlatform()){window.location.href=e;return}await ye.open({url:e,presentationStyle:"fullscreen",toolbarColor:"#000000",windowName:"_self"})}const j=x("PlaidLink"),T=[1e3,1500,2500,5e3,1e4,15e3],Ie=new Set(["eligible","ineligible","manual_review","insufficient_evidence"]),Me={MANUAL_REVIEW:"manual_review",INSUFFICIENT_EVIDENCE:"insufficient_evidence"};function Te(e){const t=e.split("?")[1];return t?new URLSearchParams(t).get("public_token"):null}function F(){const e=new URLSearchParams(window.location.search);return{oauthStateId:e.get("oauth_state_id"),publicToken:e.get("public_token")}}function Le(){return!R.isNativePlatform()&&/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)}function U(e){e!=null&&e.remove&&e.remove()}async function Oe(e,t){return A.exchangePlaidToken({uid:e,publicToken:t})}function _(e){return e?e.incomeVerificationData:null}function Ve(e){const t=_(e);return e&&((e==null?void 0:e.incomeVerified)===!0||t&&t.meetsRequirement===!0)?"eligible":null}function Be(e){var i;const t=(i=_(e))==null?void 0:i.automatedDecision;return Me[t]||null}function qe(e){const t=Ve(e);if(t)return t;const i=Be(e);if(i)return i;const r=_(e);return r&&r.meetsRequirement===!1?"ineligible":"pending"}async function We(e){const t=await C(N(E,"users",e)),i=K(t),r=qe(i);return j.info("check_employment_decision",{status:r}),r}const He={"oauth-error":"OAuth redirection received. Re-initialization is temporarily disabled.","missing-params":"No OAuth state ID or public token found. Please try again."};function De(e,t){return e?"exchange":t?"oauth-error":"missing-params"}function Ye(e,t){return e&&!!t}function Ge(e,t){return e&&!!t}function $e(e){return Le()&&!!e}function Ue(e,t,i){return e&&!!t&&!i}function Je(e){return!!(e.oauthStateId||e.publicToken)}function Ke(e,t,i,r){return l.useCallback(async a=>{const o=await Oe(e,a);if(!o.success)return r("Employment verification could not be completed. Please try again.");const s=o.employmentVerificationStatus;if(!Ie.has(s)){i();return}return t(s)},[e,t,i,r])}function Xe({exchangeAndVerify:e,setLoading:t,setError:i,mounted:r}){return l.useCallback(async()=>{t(!0);const{publicToken:a,oauthStateId:o}=F(),s=De(a,o),c=s==="exchange"?()=>e(a):()=>i(He[s]);await Promise.resolve(c()).catch(()=>i("Failed to update verification status.")).finally(()=>{r.current&&t(!1)})},[e,t,i,r])}function Qe(e,t,i){const[r,a]=l.useState(!1),o=l.useRef(0),s=l.useRef(null),c=l.useRef(!1);return l.useEffect(()=>()=>{o.current+=1,c.current=!1,clearTimeout(s.current)},[]),{reviewing:r,poll:l.useCallback(()=>
1{if(!e||c.current)return;const u=++o.current;let d=0;c.current=!0,i(null),a(!0);const m=async()=>{try{const f=await We(e);if(u!==o.current)return;if(f!=="pending"){c.current=!1,a(!1),await t(f);return}}catch{if(u!==o.current)return}if(d>=T.length){c.current=!1,i("Your information is taking longer than usual to review. You can safely close the app and return later.");return}s.current=setTimeout(m,T[d]),d+=1};m()},[e,t,i])}}function Ze({exchangeAndVerify:e,setLoading:t,setError:i,uid:r,pollEmploymentDecision:a,verificationStartedRef:o}){const s=l.useCallback(async c=>{c&&(t(!0),await e(c).catch(()=>i("Failed to complete verification. Please try again.")).finally(()=>t(!1)))},[e,t,i]);return l.useCallback(({url:c})=>{if(!c.includes("plaid"))return;j.info("deep_link_received",{url:c,uid:!!r}),o.current=!0;const u=Te(c);u?s(u):r&&(j.info("deep_link_will_check_employment_decision"),a())},[s,r,a,o])}function et(e,t,i,r){l.useEffect(()=>{if(!Ye(e,t))return;const a=B.addListener("appStateChange",({isActive:o})=>{j.info("app_state_change",{isActive:o}),o&&r.current&&i()});return()=>U(a)},[e,t,i,r])}function tt({authReady:e,uid:t,setDeepLinkUrl:i,setShowOpenInApp:r,setLoading:a}){l.useEffect(()=>{if(!Ge(e,t))return;const{publicToken:o}=F();$e(o)&&(i(`matchmaker://plaid?public_token=${o}`),r(!0),a(!1))},[e,t,i,r,a])}function nt(e,t){return Je(e)?"redirect":t.current?"none":"initialize"}const it={redirect:e=>e(),initialize:(e,t)=>t(),none:()=>{}};function rt({init:e,handleRedirect:t,handleDeepLink:i,showOpenInApp:r}){const{authReady:a,firebaseUser:o,isNative:s,mounted:c,initializationAttempted:u,initializePlaid:d}=e;l.useEffect(()=>{if(c.current=!0,!Ue(a,o==null?void 0:o.uid,r))return;const m=nt(F(),u);it[m](t,d);const f=s?B.addListener("appUrlOpen",i):null;return()=>{c.current=!1,U(f)}},[a,o==null?void 0:o.uid,d,t,i,s,r,u,c])}function ot(e,t,i){return l.useCallback(async r=>{if(!r)return t("Employment verification is not available at this time.");if(!e)return t("Please wait for Plaid to initialize.");i.current=!0,await ze(e).catch(()=>t("Failed to open Plaid. Please try again."))},[e,t,i])}function at({navigateForDecision:e}){const t=_e(),{firebaseUser:i,loading:r,error:a,setError:o,setLoading:s,hostedLinkUrl:c,mounted:u}=t,[d,m]=l.useState(!1),[f,b]=l.useState(null),p=l.useRef(!1),h=Qe(i==null?void 0:i.uid,e,o),w=Ke(i==null?void 0:i.uid,e,h.poll,o),y=Xe({exchangeAndVerify:w,setLoading:s,setError:o,mounted:u}),k=Ze({exchangeAndVerify:w,setLoading:s,setError:o,uid:i==null?void 0:i.uid,pollEmploymentDecision:h.poll,verificationStartedRef:p});et(t.isNative,i==null?void 0:i.uid,h.poll,p),tt({authReady:t.authReady,uid:i==null?void 0:i.uid,setDeepLinkUrl:b,setShowOpenInApp:m,setLoading:s}),rt({init:t,handleRedirect:y,handleDeepLink:k,showOpenInApp:d});const J=ot(c,o,p);return{loading:r,reviewing:h.reviewing,error:a,setError:o,hostedLinkUrl:c,showOpenInApp:d,deepLinkUrl:f,handlePlaidOpen:J,firebaseUser:i}}const st=x("PlaidSkip");function lt({uid:e,isPlaidRequiredForUser:t,setError:i,setToastMessage:r,setShowToast:a,navigateToMatchmaker:o}){const[s,c]=l.useState(!1),u=l.useCallback(async()=>{if(t()){i("Employment verification is required for verified members to continue.");return}try{c(!0),await H(e,{incomeVerified:!1,incomeVerificationSkipped:!0,incomeVerificationSkippedAt:O(),onboardingStep:6}),r("Employment verification skipped"),a(!0),setTimeout(o,500)}catch(d){st.captureError("skip_verification_failed",d),i("Failed to skip verification. Please try again.")}finally{c(!1)}},[e,t,i,r,a,o]);return{skipLoading:s,handleSkip:u}}const z={background:"var(--brand-surface-dk, #1A1A1A)",border:"0.5px solid var(--brand-accent-border, rgba(201, 169, 110, 0.15))",borderRadius:"var(--brand-radius-card, 2px)",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.4)"},ct={background:"linear-gradient(135deg, rgba(201, 169, 110, 0.2), rgba(201, 169, 110, 0.1))",border:"1px solid rgba(201, 169, 110, 0.3)",borderRadius:"var(--brand-radius-card, 2px)"},ut={background:"rgba(201, 169, 110, 0.1)",borderRadius:"var(--brand-radius-card, 2px)"};function L({icon:e,text:t}){return n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 flex items-center justify-center",style:ut,children:n.jsx(g,{icon:e,style:{fontSize:"0.875rem",color:"var(--brand-accent, #C9A96E)"}})}),n.jsx("p",{style:{color:"var(--brand-warm-muted, #8A8478)",fontSize:"0.875rem",fontFamily:"var(--brand-font-body, inherit)",margin:0},children:t})]})}function dt({onClick:e,disabled:t,loading:i,label:r,icon:a}){return n.jsx("div",{className:"p-5 mb-4",style:{...z,boxShadow:"none"},children:n.jsx(v,{fullWidth:!0,size:"lg",onClick:e,disabled:t,loading:i,children:n.jsxs("span",{className:"flex items-center justify-center gap-2",children:[r,n.jsx(g,{icon:a,style:{fontSize:"1.1rem"}})]})})})}function mt({isPlaidRequired:e}){return n.jsxs("div",{className:"p-5 mb-6",style:z,children:[n.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[n.jsx("div",{className:"w-10 h-10 flex items-center justify-center flex-shrink-0",style:ct,children:n.jsx(g,{icon:I,style:{fontSize:"1.25rem",color:"var(--brand-accent, #C9A96E)"}})}),n.jsx("div",{children:n.jsx("p",{style:{color:"var(--brand-warm-text, #E8E4DC)",fontSize:"0.875rem",lineHeight:1.6,fontFamily:"var(--brand-font-body, inherit)",margin:0},children:e?"Matchmaker requires employment verification to determine eligibility for membership.":"Matchmaker uses Plaid to confirm qualifying employment deposits for membership."})})]}),n.jsxs("div",{className:"space-y-3 mb-4",children:[n.jsx(L,{icon:se,text:"Bank-level security & encryption"}),n.jsx(L,{icon:I,text:"No pay stubs or employer paperwork required"})]}),n.jsx("div",{className:"p-3",style:{background:"rgba(201, 169, 110, 0.05)",borderRadius:"var(--brand-radius-card, 2px)"},children:n.jsxs("p",{style:{color:"var(--brand-warm-muted, #8A8478)",fontSize:"0.75rem",lineHeight:1.6,fontFamily:"var(--brand-font-body, inherit)",margin:0},children:["This is ",n.jsx("span",{style:{color:"var(--brand-warm-text, #E8E4DC)",fontWeight:500},children:"not"})," a credit check and will not affect your credit score. We only verify your employment status."]})})]})}function ft(){return n.jsxs("div",{className:"p-5 mb-4 text-center",style:z,role:"status","aria-live":"polite",children:[n.jsx("div",{className:"animate-spin",style:{width:32,height:32,margin:"0 auto 1rem",border:"2px s
1olid rgba(201, 169, 110, 0.2)",borderTopColor:"var(--brand-accent, #C9A96E)",borderRadius:"50%"}}),n.jsx("p",{style:{color:"var(--brand-warm-text, #E8E4DC)",fontWeight:600,margin:"0 0 0.5rem",fontFamily:"var(--brand-font-body, inherit)"},children:"Waiting for verification confirmation"}),n.jsx("p",{style:{color:"var(--brand-warm-muted, #8A8478)",fontSize:"0.875rem",lineHeight:1.6,margin:0,fontFamily:"var(--brand-font-body, inherit)"},children:"Your information was submitted successfully. Weâre waiting for our verification system to send back the result. This usually takes a few moments, and youâll continue automatically as soon as it arrives."})]})}function pt({isPlaidRequired:e,shouldShowPlaid:t,handlePlaidOpen:i,hostedLinkUrl:r,loading:a,reviewing:o,error:s}){return n.jsxs(n.Fragment,{children:[o?null:n.jsx(mt,{isPlaidRequired:e}),s&&n.jsx("div",{className:"p-4 mb-4 text-center",style:{background:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",borderRadius:"var(--brand-radius-card, 2px)"},children:n.jsx("p",{style:{color:"#f87171",fontSize:"0.875rem",margin:0,fontFamily:"var(--brand-font-body, inherit)"},children:s})}),o?n.jsx(ft,{}):null,t&&!o&&n.jsx(dt,{onClick:i,disabled:!r||a,loading:a,label:"Connect with Plaid",icon:D}),n.jsxs("div",{className:"flex items-center justify-center gap-2 mb-6",children:[n.jsx(g,{icon:ae,style:{fontSize:"0.875rem",color:"#10b981"}}),n.jsx("span",{style:{color:"var(--brand-warm-muted, #8A8478)",fontSize:"0.75rem",fontFamily:"var(--brand-font-body, inherit)"},children:"Powered by Plaid ⢠256-bit encryption"})]})]})}const ht={background:"rgba(201, 169, 110, 0.05)",border:"1px solid rgba(201, 169, 110, 0.2)",borderRadius:"var(--brand-radius-card, 2px)"},gt={width:"100%",color:"var(--brand-warm-text, #E8E4DC)",background:"rgba(10, 10, 10, 0.55)",border:"1px solid rgba(201, 169, 110, 0.35)",borderRadius:"var(--brand-radius-card, 2px)",fontSize:"0.9rem",padding:"0.8rem"},yt=8*1024*1024,bt=new Set(["application/pdf","image/jpeg","image/png"]);function xt(e){return e?bt.has(e.type)?e.size>yt?"The document must be 8 MB or smaller.":"":"Upload a PDF, JPG, or PNG document.":""}function vt(){return n.jsxs("div",{className:"flex items-start gap-3",role:"status",children:[n.jsx(g,{icon:Y,style:{color:"#10b981",fontSize:"1.35rem",marginTop:2}}),n.jsxs("div",{children:[n.jsx("p",{style:{color:"var(--brand-warm-text, #E8E4DC)",margin:"0 0 0.35rem",fontWeight:600},children:"Review requested"}),n.jsx("p",{style:{color:"var(--brand-warm-muted, #8A8478)",margin:0,fontSize:"0.875rem",lineHeight:1.6},children:"Jessica received your request and will follow up with you personally using the contact details on your account."})]})]})}function wt(e,t){const[i,r]=l.useState(!1),[a,o]=l.useState(!1),[s,c]=l.useState(""),u=l.useCallback(async d=>{d.preventDefault(),r(!0),c("");try{const m=new FormData;m.append("netWorth",t),e&&m.append("document",e);const f=await A.requestEmploymentManualReview(m);if(!(f!=null&&f.success))throw new Error("Request failed");o(!0)}catch{c("We could not send your request. Please try again.")}finally{r(!1)}},[e,t]);return{error:s,handleSubmit:u,submitted:a,submitting:i}}function St(){return n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(g,{icon:le,style:{color:"var(--brand-accent, #C9A96E)",fontSize:"1.25rem",marginTop:2}}),n.jsxs("div",{children:[n.jsx("p",{id:"manual-review-title",style:{color:"var(--brand-warm-text, #E8E4DC)",margin:"0 0 0.4rem",fontWeight:600},children:"Prefer a manual review?"}),n.jsx("p",{style:{color:"var(--brand-warm-muted, #8A8478)",margin:0,fontSize:"0.875rem",lineHeight:1.65},children:"We know not everyone has a traditional 9â5 or income that fits neatly into automated verification. Share your estimated net worth and Jessica will personally review your application. You can also include supporting documentation."})]})]})}function jt({netWorth:e,setNetWorth:t}){return n.jsxs("div",{style:{marginBottom:"1rem"},children:[n.jsx("label",{htmlFor:"employment-review-net-worth",style:{display:"block",color:"var(--brand-warm-text, #E8E4DC)",fontSize:"0.8rem",marginBottom:"0.5rem"},children:"Estimated net worth"}),n.jsx("input",{id:"employment-review-net-worth",name:"netWorth",type:"number",min:"0",max:"1000000000000000",step:"1000",value:e,onCh
1ange:i=>t(i.target.value),placeholder:"e.g. 500000",required:!0,inputMode:"numeric",style:gt})]})}function kt({setDocument:e}){const[t,i]=l.useState(""),r=a=>{var c;const o=(c=a.target.files)==null?void 0:c[0],s=xt(o);if(s){e(null),i(s),a.target.value="";return}e(o||null),i("")};return n.jsxs(n.Fragment,{children:[n.jsx("label",{htmlFor:"employment-review-document",style:{display:"block",color:"var(--brand-warm-text, #E8E4DC)",fontSize:"0.8rem",marginBottom:"0.5rem"},children:"Supporting documentation (optional)"}),n.jsxs("div",{className:"p-4",style:{border:"1px solid rgba(201, 169, 110, 0.35)",borderRadius:"var(--brand-radius-card, 2px)",background:"rgba(10, 10, 10, 0.55)"},children:[n.jsx(g,{icon:ce,style:{color:"var(--brand-accent, #C9A96E)",fontSize:"1.1rem",marginRight:"0.5rem"}}),n.jsx("input",{id:"employment-review-document",name:"document",type:"file",accept:"application/pdf,image/jpeg,image/png",onChange:r,"aria-describedby":"employment-review-document-help employment-review-document-error employment-review-error",style:{color:"var(--brand-warm-muted, #8A8478)",fontSize:"0.8rem",maxWidth:"calc(100% - 2rem)"}})]}),n.jsx("p",{id:"employment-review-document-help",style:{color:"var(--brand-warm-muted, #8A8478)",fontSize:"0.72rem",lineHeight:1.5,margin:"0.55rem 0 1rem"},children:"PDF, JPG, or PNG up to 8 MB. You can submit the request without a document."}),t?n.jsx("p",{id:"employment-review-document-error",role:"alert",style:{color:"#f87171",fontSize:"0.8rem",margin:"0 0 0.8rem"},children:t}):null]})}function Pt({error:e,handleSubmit:t,netWorth:i,setDocument:r,setNetWorth:a,submitting:o}){return n.jsxs("form",{onSubmit:t,style:{marginTop:"1.25rem"},children:[n.jsx(jt,{netWorth:i,setNetWorth:a}),n.jsx(kt,{setDocument:r}),e?n.jsx("p",{id:"employment-review-error",role:"alert",style:{color:"#f87171",fontSize:"0.8rem",margin:"0 0 0.8rem"},children:e}):null,n.jsx(v,{type:"submit",variant:"secondary",fullWidth:!0,loading:o,disabled:o,children:"Send to Jessica for Review"})]})}function Et({document:e,isOpen:t,netWorth:i,setDocument:r,setIsOpen:a,setNetWorth:o}){const s=wt(e,i);return s.submitted?n.jsx(vt,{}):n.jsxs(n.Fragment,{children:[n.jsx(St,{}),t?n.jsx(Pt,{...s,netWorth:i,setDocument:r,setNetWorth:o}):n.jsx(v,{variant:"secondary",fullWidth:!0,onClick:()=>a(!0),style:{marginTop:"1rem"},children:"Request Manual Review"})]})}function Ct(){const[e,t]=l.useState(!1),[i,r]=l.useState(null),[a,o]=l.useState("");return n.jsx("section",{className:"p-5 mb-6",style:ht,"aria-labelledby":"manual-review-title",children:n.jsx(Et,{document:i,isOpen:e,netWorth:a,setDocument:r,setIsOpen:t,setNetWorth:o})})}const Nt="data:image/svg+xml,%3csvg%20width='126'%20height='48'%20viewBox='0%200%20126%2048'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e%20Plaid%20logo%20%3c/title%3e%3cdefs%3e%3cpath%20id='a'%20d='M0%2047.473h126V0H0z'%3e%3c/path%3e%3c/defs%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M66.248%2016.268c-1.057-.889-2.861-1.333-5.413-1.333h-5.756v17.788h4.304v-5.575h1.928c2.34%200%204.056-.515%205.148-1.546%201.23-1.155%201.849-2.693%201.849-4.613%200-1.991-.687-3.565-2.06-4.721m-5.044%206.855h-1.821V18.96h1.636c1.99%200%202.985.698%202.985%202.094%200%201.378-.934%202.068-2.8%202.068M75.673%2014.934h-4.488v17.788h9.69v-4.026h-5.202zM89.668%2014.934l-7.05%2017.788h4.832l.924-2.586H94.5l.845%202.586h4.886l-7-17.788h-3.563zm-.053%2011.601l1.849-6.08%201.82%206.08h-3.67z'%20fill='%23fff'%3e%3c/path%3e%3cmask%20id='b'%20fill='%23fff'%3e%3cuse%20href='%23a'%3e%3c/use%3e%3c/mask%3e%3cpath%20fill='%23fff'%20mask='url(%23b)'%20d='M102.473%2032.722h4.489V14.934h-4.489zM124.39%2018.268a7.376%207.376%200%200%200-2.14-2.053c-1.355-.854-3.204-1.28-5.545-1.28h-5.914v17.787h6.918c2.5%200%204.506-.817%206.02-2.453%201.514-1.635%202.27-3.805%202.27-6.508%200-2.15-.537-3.981-1.61-5.493m-7.182%2010.427h-1.927v-9.734h1.954c1.373%200%202.428.43%203.168%201.287.74.857%201.11%202.073%201.11%203.647%200%203.2-1.435%204.8-4.305%204.8M18.637%200L4.09%203.81.081%2018.439l5.014%205.148L0%2028.65l3.773%2014.693%2014.484%204.047%205.096-5.064%205.014%205.147%2014.547-3.81%204.008-14.63-5.013-5.146%205.095-5.063L43.231%204.13%2028.745.083l-5.094%205.063L18.637%200zM9.71%206.624l7.663-2.008%203.351%203.44-4.887%204.856L9.71%206.624zm16.822%201.478l3.405-3.383%207.63%202.132-6.227%206.187-4.808-4.936zM4.672%2017.238l2.111-7.705%206.125%206.288-4.886%204.856-3.35-3.44zm29.547-1.243l6.227-6.189%201.986%207.74-3.404%203.384-4.809-4.935zm-15.502-.127l4.887-4.856%204.807%204.936-4.886%204.856-4.808-4.936zm-7.814%207.76
15l4.886-4.856%204.81%204.936-4.888%204.856-4.808-4.936zm15.503.127l4.886-4.856L36.1%2023.84l-4.887%204.856-4.807-4.936zM4.57%2029.927l3.406-3.385%204.807%204.937-6.225%206.186-1.988-7.738zm14.021%201.598l4.887-4.856%204.808%204.936-4.886%204.856-4.809-4.936zm15.502.128l4.887-4.856%203.351%203.439-2.11%207.705-6.128-6.288zm-24.656%208.97l6.226-6.189%204.81%204.936-3.406%203.385-7.63-2.133zm16.843-1.206l4.886-4.856%206.126%206.289-7.662%202.007-3.35-3.44z'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",Rt={filter:"drop-shadow(0 4px 12px rgba(255, 255, 255, 0.1))"};function At(){return n.jsx("img",{src:Nt,alt:"Plaid",className:"h-12",style:Rt})}function Ft({reviewing:e=!1}){return n.jsxs("div",{className:"flex flex-col items-center mb-6",children:[n.jsx("div",{className:"mb-4",children:n.jsx(At,{})}),n.jsx(ue,{children:"Professional Community"}),n.jsx(de,{as:"h1",size:"md",style:{marginBottom:"0.25rem"},children:e?"Verification in progress":"Employment Verification"}),n.jsx(me,{size:"sm",style:{textAlign:"center"},children:e?"Your employment information was submitted successfully":"Confirm your employment through secure deposit verification"})]})}const _t=x("PlaidActionButtons");function zt({onClick:e,loading:t}){return n.jsx(v,{fullWidth:!0,size:"md",variant:"secondary",onClick:e,disabled:t,loading:t,children:"Skip for Now"})}function It({onError:e,router:t}){const i=async()=>{try{await be(),t.push("/join","root","replace")}catch(r){_t.error("Error logging out",{error:r}),e("Failed to log out. Please try again.")}};return n.jsxs(v,{fullWidth:!0,size:"md",variant:"link",onClick:i,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.5rem",color:"var(--brand-warm-muted, #8A8478)"},children:[n.jsx(g,{icon:fe,style:{fontSize:"1rem"}}),"Sign Out"]})}function Mt({showSkip:e,skipLoading:t,handleSkip:i,setError:r,router:a}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[e&&n.jsx(zt,{onClick:i,loading:t}),n.jsx(It,{onError:r,router:a})]})}const Tt={background:"linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1))",border:"2px solid rgba(212, 175, 55, 0.3)"};function Lt(){return n.jsxs(q,{id:"plaid-component",children:[n.jsx(X,{className:"ion-no-border",style:{"--background":"transparent"},children:n.jsx(Q,{style:{"--background":"transparent"},children:n.jsx(Z,{slot:"start",children:n.jsx(ee,{defaultHref:"/identity",routerDirection:"back",style:{color:"#D4AF37"}})})})}),n.jsx(W,{style:{"--background":"var(--brand-bg, #000000)"},children:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full bg-brand-bg",children:[n.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mb-4",style:Tt,children:n.jsx(te,{name:"crescent",style:{color:"#D4AF37"}})}),n.jsx("p",{className:"text-gray-400 text-sm",children:"Loading..."})]})})]})}const Ot={background:"radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 50%)"},Vt={background:"linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1))",border:"2px solid rgba(16, 185, 129, 0.4)"},Bt={background:"linear-gradient(135deg, #D4AF37, #F4E4BC)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},qt={background:"linear-gradient(135deg, #D4AF37, #B8860B)",color:"#fff",boxShadow:"0 4px 20px rgba(212, 175, 55, 0.4)"};function Wt({deepLinkUrl:e}){const t=()=>{e&&(window.location.href=e)};return n.jsx(q,{id:"plaid-component",children:n.jsx(W,{style:{"--background":"var(--brand-bg, #000000)"},children:n.jsxs("div",{className:"min-h-full bg-brand-bg relative overflow-hidden flex flex-col items-center justify-center px-6",children:[n.jsx("div",{className:"absolute inset-0 pointer-events-none",style:Ot}),n.jsxs("div",{className:"relative z-10 text-center",children:[n.jsx("div",{className:"w-20 h-20 rounded-full flex items-center justify-center mx-auto mb-6",style:Vt,children:n.jsx(g,{icon:Y,className:"text-green-400 text-4xl"})}),n.jsx("h1",{className:"text-xl font-bold mb-2",style:Bt,children:"Verification Complete!"}),n.jsx("p",{className:"text-gray-400 text-sm mb-8",children:"Tap the button below to return to the Matchmaker app and continue."}),n.jsx("button",{onClick:t,className:"w-full py-4 rounded-xl font-bold text-sm tracking-wide transition-all duration-200",style:qt,children:n.jsxs("span",{className:"flex items-center justify-center gap-2",children:["Open in Matchmaker App",n.jsx(g,{icon:D,className:"text-lg"})]})})]})]})})})}function Ht(){const[e,t]=l.useState(!1),[i,r]=l.useState(""),a=l.useCallback(o=>{r(o),t(!0)},[]);return{show:e,setShow:t,message:i,display:a}}function Dt({setError:e,shouldShowPlaid:t,isPlaidRequiredForUser:i,plaidLink:r,skip:a,router:o}){const s=i();return n.jsx("div",{style:{padding:"0 1.25rem 2rem",maxWidth:560,margin:"0 auto"},children:n.jsxs("div",{children:[n.jsx(Ft,{reviewing:r.reviewing}),n.jsx(pt,{isPlaidRequired:s,shouldShowPlaid:t(),handlePlaidOpen:()=>r.handlePlaidOpen(t()),hostedLinkUrl:r.hostedLinkUrl,loading:r.loading,reviewing:r.reviewing,error:r.error}),r.reviewing?null:n.jsx(Ct,{}),r.reviewing?null:n.jsx(Mt,{showSkip:!s,skipLoading:a.skipLoading,handleSkip:a.handleSkip,setError:e,router:o})]})})}function Yt(e,t,i){var s;const r=he(e),a=(s=e==null?void 0:e.incomeVerificationData)==null?void 0:s.automatedDecision,o=a==="MANUAL_REVIEW"||a==="INSUFFICIENT_EVIDENCE";l.useEffect(()=>{r&&!o&&i()},[i,o,r]),l.useEffect(()=>{(e==null?void 0:e.incomeVerified)===!0&&t()},[t,e==null?void 0:e.incomeVerified])}function Gt(e,t,i){const r=l.useCallback(()=>e.push("/matchmaker","forward","replace"),[e]),a=l.useCallback(()=>e.push("/waitlist","forward","replace"),[e]),o=l.useCallback(async s=>{await i(),s==="eligible"?r():a()},[r,a,i]);return Yt(t,r,a),{navigateForDecision:o,navigateToMatchmaker:r}}function en(){const e=V().currentUser,t=ne(),{userData:i,isUserDataLoading:r,refreshUserData:a}=ie(),o=re(),s=Ht(),{navigateForDecision:c,navigateToMatchmaker:u}=Gt(o,i,a),{flags:d,loadingFeatureFlags:m}=ve(e==null?void 0:e.uid),{shouldShowPlaid:f,isPlaidRequiredForUser:b}=Ne({flags:d,userData:i,user:t,uid:e==null?void 0:e.uid,loadingFeatureFlags:m,isUserDataLoading:r,navigateToMatchmaker:u}),p=at({navigateForDecision:c}),h=lt({uid:e==null?void 0:e.uid,isPlaidRequiredForUser:b,setError:p.setError,setToastMessage:s.display,setShowToast:()=>{},navigateToMatchmaker:u});return e!=null&&e.uid?p.showOpenInApp?n.jsx(Wt,{deepLinkUrl:p.deepLinkUrl}):n.jsx("div",{id:"plaid-component",children:n.jsxs(pe,{children:[n.jsx(Dt,{setError:p.setError,shouldShowPlaid:f,isPlaidRequiredForUser:b,plaidLink:p,skip:h,router:o}),n.jsx(oe,{isOpen:s.show,onDidDismiss:()=>s.setShow(!1),message:s.message,duration:2e3,position:"bottom"}),n.jsx(ge,{currentStep:2,nextStep:3,nextRoute:"/onboarding-photos"})]})}):n.jsx(Lt,{})}export{en as default};
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.