1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a113ad-2185-7b90-a7ce-9aa0909bf231")}catch(e){}}();import{_ as se}from"./nKpamrpF.js";import{_ as oe}from"./DZ8YD5Je.js";import{_ as ie}from"./B29DcXCM.js";import{_ as re,m as ae}from"./D0-fhOG0.js";import{_ as le}from"./DxhB5cgG.js";import{_ as ue}from"./5NHPX2Pa.js";import{e as ee,r as f,J as de,aD as _e,l as q,j as g,o as r,w as L,a as u,ae as ve,p as te,c as l,t as w,m as s,F as M,C as z,d as T,q as K,ac as Q,U as ce,V as me,h as fe,I as G,k as pe,b as B,n as X,W as ge}from"./ibGci3AF.js";import{F as ye}from"./BFV0bgW0.js";import{u as xe}from"./4n6WOHLz.js";import{u as we}from"./JRvLd8C_.js";import"./DlAUqK2U.js";import"./DJmEJD1D.js";import"./DqSILht2.js";import"./DVxx5mW9.js";import"./C5S46NFB.js";import"./CCvNsHkH.js";import"./D8mcE-YH.js";const he={class:"max-h-[85vh] w-full max-w-lg overflow-y-auto rounded-lg bg-white p-6 shadow-lg",role:"dialog","aria-modal":"true","aria-labelledby":"signers-modal-title"},be={class:"mb-4 flex items-start justify-between"},ke={key:0,class:"text-sm text-gray-500"},Se={key:0,class:"py-8 text-center text-sm text-gray-500"},Ie={key:1,class:"py-8 text-center text-sm text-red-700"},$e={key:2,class:"divide-y divide-gray-100"},Pe={class:"flex items-start justify-between gap-3"},Ce={class:"min-w-0"},De={class:"font-semibold"},Ne={key:0,class:"truncate text-sm text-gray-500"},Re={key:1,class:"mt-1 text-sm text-pine"},Ve={key:2,class:"mt-1 text-sm text-[#B93A22]"},Me={key:0,class:"text-gray-500"},Oe={key:0,class:"shrink-0 text-right"},Be=["disabled","onClick"],Ee={key:1,class:"mt-1 text-xs text-red-700"},Fe={key:0,class:"mt-2"},Le=["onClick"],Te={key:0,class:"mt-2 space-y-1"},qe={key:0,class:"py-8 text-center text-sm text-gray-500"},Z=300,ze=!1,je=ee({__name:"SignersModal",props:{show:{type:Boolean},investmentId:{},investorProfileId:{},investmentName:{}},emits:["close"],setup(J,{emit:h}){const p=J,$=h,P=f(!0),c=f(!1),y=f([]),d=f(new Set),m=f({}),C=f({}),D=f({}),x=f(Date.now());let N=null,R=0;const E=f(null),j=()=>E.value,A={sent:"Sent",delivered:"Delivered",bounced:"Bounced",dropped:"Not delivered",deferred:"Delayed",open:"Opened",click:"Opened",unknown:"Sent"};function U(){y.value=[],m.value={},C.value={},D.value={},d.value=new Set}async function H(){const t=++R;U(),P.value=!0,c.value=!1;try{const o=await Q.getInvestmentSignatories(p.investmentId,p.investorProfileId);if(t!==R)return;y.value=o,W()}catch{if(t!==R)return;c.value=!0}finally{t===R&&(P.value=!1)}}function W(){const t=Date.now();for(const o of y.value){if(o.date_signed)continue;const n=o.resend_cooldown_seconds;n>0&&(m.value[o.id_investment_investor_profile_signatory]=t+n*1e3)}O()}function F(t){const o=m.value[t];return o?Math.max(0,Math.ceil((o-x.value)/1e3)):0}function O(){N||!p.show||(N=ce(()=>{x.value=Date.now();for(const t of Object.keys(m.value))m.value[t]<=x.value&&delete m.value[t]},1e3))}function e(){N&&(clearInterval(N),N=null)}async function i(t){var n,v;const o=t.id_investment_investor_profile_signatory;C.value[o]=!0,delete D.value[o];try{await Q.resendSignatureEmail(p.investmentId,p.investorProfileId,o),t.last_email_sent_at=new Date().toISOString(),t.email_history=[{sent_at:t.last_email_sent_at,status:"sent"},...t.email_history],x.value=Date.now(),m.value[o]=x.value+Z*1e3,O()}catch(_){const I=_.response;if((I==null?void 0:I.status)===429){const ne=((n=I.data)==null?void 0:n.detail)??"",Y=Number((v=ne.match(/\d+/))==null?void 0:v[0]);x.value=Date.now(),m.value[o]=x.value+(Number.isFinite(Y)?Y:Z)*1e3,O()}else D.value[o]="Failed to send. Please try again."}finally{C.value[o]=!1}}function k(t){d.value.has(t)?d.value.delete(t):d.value.add(t),d.value=new Set(d.value)}function a(t){return[t.first_name,t.last_name].filter(Boolean).join(" ")||t.email||"Signer"}function b(t){return t?new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):""}function V(t){if(!t)return"";const o=Math.floor((x.value-new Date(t).getTime())/1e3);if(o<60)return"just now";const n=Math.floor(o/60);if(n<60)return`${n}m ago`;const v=Math.floor(n/60);return v<24?`${v}h ago`:`${Math.floor(v/24)}d ago`}function S(t){const o=Math.floor(t/60),n=t%60;return`${o}
1:${String(n).padStart(2,"0")}`}return de(()=>[p.show,p.investmentId],([t])=>{t?(x.value=Date.now(),H(),O()):(R++,e())}),_e(e),(t,o)=>t.show?(r(),q(s(ye),{key:0,active:t.show,"initial-focus":j},{default:L(()=>[u("div",{class:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-40 p-4",onClick:o[1]||(o[1]=te(n=>$("close"),["self"])),onKeydown:o[2]||(o[2]=ve(n=>$("close"),["esc"]))},[u("div",he,[u("div",be,[u("div",null,[o[3]||(o[3]=u("h2",{id:"signers-modal-title",class:"text-lg font-bold"},"Signers",-1)),t.investmentName?(r(),l("p",ke,w(t.investmentName),1)):g("",!0)]),u("button",{ref_key:"closeButton",ref:E,type:"button",class:"text-2xl leading-none text-gray-400 hover:text-gray-600","aria-label":"Close",onClick:o[0]||(o[0]=n=>$("close"))}," à ",512)]),s(P)?(r(),l("div",Se," Loading signers... ")):s(c)?(r(),l("div",Ie," Failed to load signers. Please try again. ")):(r(),l("div",$e,[(r(!0),l(M,null,z(s(y),n=>(r(),l("div",{key:n.id_investment_investor_profile_signatory,class:"py-4"},[u("div",Pe,[u("div",Ce,[u("div",De,w(a(n)),1),n.email?(r(),l("div",Ne,w(n.email),1)):g("",!0),n.date_signed?(r(),l("div",Re," â Signed "+w(b(n.date_signed)),1)):(r(),l("div",Ve,[o[4]||(o[4]=T(" Awaiting signature ")),n.last_email_sent_at?(r(),l("span",Me," · email sent "+w(V(n.last_email_sent_at)),1)):g("",!0)]))]),n.date_signed?g("",!0):(r(),l("div",Oe,[n.email?(r(),l("button",{key:0,type:"button",class:"rounded bg-pine px-3 py-1.5 text-xs font-semibold text-white disabled:cursor-not-allowed disabled:bg-gray-300",disabled:s(C)[n.id_investment_investor_profile_signatory]||F(n.id_investment_investor_profile_signatory)>0,onClick:v=>i(n)},[s(C)[n.id_investment_investor_profile_signatory]?(r(),l(M,{key:0},[T(" Sending... ")],64)):F(n.id_investment_investor_profile_signatory)>0?(r(),l(M,{key:1},[T(" Resend in "+w(S(F(n.id_investment_investor_profile_signatory))),1)],64)):(r(),l(M,{key:2},[T("Resend Email")],64))],8,Be)):g("",!0),s(D)[n.id_investment_investor_profile_signatory]?(r(),l("div",Ee,w(s(D)[n.id_investment_investor_profile_signatory]),1)):g("",!0)]))]),ze&&n.email_history.length?(r(),l("div",Fe,[u("button",{type:"button",class:"text-xs font-semibold text-pine underline",onClick:v=>k(n.id_investment_investor_profile_signatory)},w(s(d).has(n.id_investment_investor_profile_signatory)?"Hide send history":`Send history (${n.email_history.length})`),9,Le),s(d).has(n.id_investment_investor_profile_signatory)?(r(),l("ul",Te,[(r(!0),l(M,null,z(n.email_history,(v,_)=>(r(),l("li",{key:_,class:"flex justify-between text-xs text-gray-600"},[u("span",null,w(b(v.sent_at)),1),u("span",{class:K({"text-red-700":v.status==="bounced"||v.status==="dropped"})},w(A[v.status]??v.status),3)]))),128))])):g("",!0)])):g("",!0)]))),128)),s(y).length?g("",!0):(r(),l("div",qe," No signers found for this investment. "))]))])],32)]),_:1},8,["active"])):g("",!0)}}),Ae={id:"performanceStats2",class:"w-full md:pt-10"},Ue={class:"flex flex-col gap-5 lg:flex-row"},He={class:"flex flex-row gap-5"},We=["value"],Ge=["value"],Ke={class:"mb-4 mt-1 inline-flex",role:"group"},Je={key:0},Ye={className:"w-full flex items-center"},Qe=["src"],Xe={key:0},Ze={key:2},et={class:"w-full md:pt-4"},yt=ee({__name:"index",setup(J){const h=xe(),p=f(!0),$=f(!1),P=f(null),c=f(null),y=we(),d=f("investments"),m=f({show:!1,investmentId:"",investorProfileId:"",investmentName:""}),C=["Investor","Investment","Commitment","Funded","Unrealized Returns","Realized Returns","Status","Action"],D={not_started:"Signature Required",pending_signature:"Signature Required",pending_transfer:"Signature Required",pending_wire:"Pending Wire",completed:"Completed"};me(()=>{y.selectedProfileId="",y.selectedProfile=null}),fe(async()=>{await y.fetchProfiles(),await h.fetchInvestments(),await h.fetchPerformanceStats(),p.value=!1});const x=e=>e.investor_investment_status==="not_started"||e.investor_investment_status==="pending_signature"||e.investor_investment_status==="pending_transfer"?`/investments/${e.url_slug}/invest/${e.investor_profile_id}`:`/portfolio/${e.url_slug}/${e.investor_profile_id}`;async function N(e){p.value=!0,c.value=null,await y.selectProfile(e.target.value).then(await h.fetchInvestments(c.value)).then(await h.fetchPerformanceStats(c.value)).finally(()=>{p.value=!1})}async function R(e){p.value=!0,c.value=e.target.value==="All Investments"?null:e.target.value,await h.fetchPerformanceStats(c.value).finally(()=>{p.value=!1})}function E(e){m.value={show:!0,investmentId:e.id,investorProfileId:e.investor_profile_id,investmentName:e.name}}function j(e,i=!1){return ae(e,a=>{let b;if(a.investor_investment_status==="not_started"||a.investor_investment_status==="pending_signature"||a.investor_investment_status==="pending_transfer")$.value=!0,a.investor_investment_status==="pending_signature"?b={value:"View Signers",onClick:()=>E(a),type:"resend_email_button"}:b={value:"complete investment",href:x(a),type:"link"};else if(a.wire_due&&a.investor_investment_status!=="void")$.value=!0,b={value:a.id,investorProfileId:a.investor_profile_id,type:"wire_instructions"};else{if(i)return;b={value:"-",type:"string"}}let V;a.total_realized_returns?V={value:a.total_realized_returns,type:"usd"}:V={value:"Pending",type:"string"};let S;return a.total_unrealized_returns?S={value:a.total_unrealized_returns,type:"usd"}:a.investor_investment_status==="closed"?S={value:"-",type:"string"}:S={value:"Pending",type:"string"},[{value:a.investor_name,type:"string"},{value:a.name,href:x(a),type:"link"},{value:a.your_investment,type:"usd"},{value:a.amount_funded,type:"usd"},S,V,{value:A(a),class:U(a),badgeTextColor:H(a),type:"badge",...a.investor_investment_status==="pending_signature"&&{onClick:()=>E(a)}},b]}).filter(function(a){return a!==void 0})}const A=e=>{if(e.investor_investment_status==="void")return"VOID";if(e.investor_investment_status==="closed")return"CLOSED";if(e.investor_investment_status.includes("funded_"))return e.wire_due?"PENDING WIRE":e.investor_investment_status.split("_")[1]+"% FUNDED";if(e.investor_investment_status==="pending_signature"){const i=e.remaining_signatures>1?"s":"";return`${e.remaining_signatures} signature${i} required`}else return D[e.investor_investment_status]},U=e=>e.investor_investment_status==="closed"||e.investor_investment_status==="void"?"bg-fog-600":e.investor_investment_status==="completed"?"bg-pine":e.investor_investment_status.includes("funded_")&&!e.wire_due?"bg-golde
1n-hour":"bg-[#B93A22]",H=e=>e.investor_investment_status==="void"||e.investor_investment_status==="closed"?"":"text-white",W=G(()=>j(F.value,d.value==="actionRequired")),F=G(()=>c.value?h.investments.filter(e=>e.id===c.value):h.investments),O=G(()=>Object.values(h.investments.reduce((i,k)=>({...i,[k.id]:k}),{})));return(e,i)=>{var v;const k=pe("Field"),a=se,b=oe,V=ie,S=re,t=le,o=ue,n=je;return r(),l("div",Ae,[i[12]||(i[12]=u("div",{class:"mb-7 text-center font-fjalla-one text-3xl md:text-left"}," Portfolio ",-1)),u("div",null,[u("div",Ue,[u("div",He,[((v=s(y).profiles)==null?void 0:v.length)>0?(r(),q(k,{key:0,modelValue:s(P),"onUpdate:modelValue":i[1]||(i[1]=_=>X(P)?P.value=_:null),name:"investorProfile"},{default:L(()=>[u("select",{id:"investorProfile",class:"max-w-xs pr-10 truncate",name:"investor_profile_id",onChange:i[0]||(i[0]=_=>N(_))},[i[8]||(i[8]=u("option",{selected:"selected"},"All Profiles",-1)),(r(!0),l(M,null,z(s(y).profiles,(_,I)=>(r(),l("option",{key:I,value:_.id},w(_.name),9,We))),128))],32)]),_:1},8,["modelValue"])):g("",!0),B(k,{modelValue:s(c),"onUpdate:modelValue":i[3]||(i[3]=_=>X(c)?c.value=_:null),name:"investorProfile"},{default:L(()=>[u("select",{id:"investmentOption",class:"min-w-[200px] max-w-xs pr-10 truncate",name:"investment_id",onChange:i[2]||(i[2]=_=>R(_))},[i[9]||(i[9]=u("option",{selected:"selected"},"All Investments",-1)),(r(!0),l(M,null,z(s(O),(_,I)=>(r(),l("option",{key:I,value:_.id},w(_.name),9,Ge))),128))],32)]),_:1},8,["modelValue"])]),u("div",Ke,[u("button",{type:"button",class:K(["rounded-l-lg border border-gray-200 px-4 py-2 text-sm font-medium",{"bg-white":s(d)!=="investments","bg-pine":s(d)=="investments","text-white":s(d)=="investments","text-gray-900":s(d)!="investments"}]),onClick:i[4]||(i[4]=_=>d.value="investments")}," Investments ",2),u("button",{type:"button",class:K(["rounded-r-md border border-gray-200 px-4 py-2 text-sm font-medium",{"bg-white":s(d)!="performance","bg-pine":s(d)=="performance","text-white":s(d)=="performance","text-gray-900":s(d)!="performance"}]),onClick:i[5]||(i[5]=_=>d.value="performance")}," Performance ",2)])]),s(d)==="investments"?(r(),l("div",Je,[s($)?(r(),q(b,{key:0,class:"mt-7",type:"golden-hour-badge-l"},{default:L(()=>[u("div",Ye,[u("img",{class:"left mr-3",src:s(ge).info},null,8,Qe),u("div",null,[i[11]||(i[11]=u("b",null," One or more investments require additional action â",-1)),B(a,{class:"font-bold text-pine underline hover:cursor-pointer",onClick:i[6]||(i[6]=te(_=>d.value="actionRequired",["prevent"]))},{default:L(()=>i[10]||(i[10]=[T(" Click here to review ")])),_:1})])])]),_:1})):g("",!0)])):g("",!0)]),u("div",null,[s(p)?(r(),l("div",Xe,[B(V)])):s(d)==="investments"?(r(),q(S,{key:1,"row-data":s(W),"column-headers":C},null,8,["row-data"])):(r(),l("div",Ze,[u("div",et,[B(t,{"selected-investment":s(c)&&s(c).value!==null},null,8,["selected-investment"]),B(o,{class:"mt-4"})])]))]),B(n,{show:s(m).show,"investment-id":s(m).investmentId,"investor-profile-id":s(m).investorProfileId,"investment-name":s(m).investmentName,onClose:i[7]||(i[7]=_=>s(m).show=!1)},null,8,["show","investment-id","investor-profile-id","investment-name"])])}}});export{yt as default}; 2 3//# chunkId=01a113ad-2185-7b90-a7ce-9aa0909bf231
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.