%PDF- %PDF-
Direktori : /home/opti/public_html/startup-life/assets/ |
Current File : /home/opti/public_html/startup-life/assets/index-ad014b09.js |
import{u as w,r as y,j as e,s as A,d as F,e as B}from"./index-5492fbe1.js";import{s as M}from"./styled-components.browser.esm-ee37ee23.js";import{G as R,T as _,B as D}from"./group-5be2c524.js";import{u as L,S as V}from"./generate-user-wallet.api-1bd518cb.js";import{C as l}from"./index-2c4b8b3c.js";import{u as I}from"./get-user-startups.api-9a316203.js";import{u as G}from"./get-user-fundraising-campaign.api-0a903753.js";import{B as s}from"./Box-263f925f.js";import{C as E}from"./Card-610286a8.js";import{G as j}from"./Grid-edacc4c9.js";import{u as z}from"./get-all-notifications-8280d5e9.js";import{h as U}from"./moment-a9aaa855.js";import{S}from"./Stack-05140c2d.js";import{u as W}from"./index-9f8785a2.js";import{u as O}from"./useQuery-0abbcf43.js";import{u as P}from"./get-all-startuplife-users.api-644aad92.js";import"./tslib.es6-ace8e431.js";import"./useSlotProps-b42d44e4.js";import"./useForkRef-ff55d5c8.js";import"./Paper-26f2abc8.js";import"./useTheme-0dfa0cbc.js";import"./isNativeReflectConstruct-061ae640.js";import"./setPrototypeOf-0bb37fbe.js";import"./assertThisInitialized-081f9914.js";const H=M.div` width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8.56rem; row-gap: 2rem; padding: 3.25rem 3.56rem; .WalletCard { position: relative; width: 100%; height: 13.3125rem; border-radius: 1.25rem; background: #BDBDBD33; box-shadow: 0px 6px 18px 0px rgba(196, 204, 221, 0.25); margin-bottom: 2.56rem; } .Ellipse { position: absolute; top: 0; right: 1.87rem; } .WalletWrap { padding: 1.31rem 2.69rem 1.56rem 1.81rem; } .exploreText { color: var(--tertiary, #6B809B); font-size: 1.25rem; font-style: normal; font-weight: 400; line-height: normal; margin-bottom: .5rem; } .StartupGrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: .56rem; row-gap: .94rem; } .StartupCard { width: 100%; min-height: 8rem; border-radius: .25rem; padding: 0 0.87rem; text-align: center; } .iconContain { margin-top: .44rem; width: 2.81rem; height: 2.81rem; background-color: #FFF; border-radius: 100%; display: flex; justify-content: center; align-items: center; margin-bottom: .37rem; } .StartupTitle { color: var(--dark-icon, #121212); font-size: 0.875rem; font-style: normal; font-weight: 600; line-height: 1.375rem; /* 157.143% */ letter-spacing: -0.03125rem; text-align: center; margin: 0; } .StartupSubtext { text-align: center; font-size: 0.6875rem; font-style: normal; font-weight: 500; line-height: 1rem; /* 145.455% */ letter-spacing: -0.03125rem; text-align: center; margin: 0; } .notificationHeader { color: var(--sub, #242424); font-size: 1.0625rem; font-style: normal; font-weight: 600; line-height: 1.25rem; /* 117.647% */ letter-spacing: -0.0425rem; } .notificationMark { color: var(--primary, #A8CF45); font-size: 0.8125rem; font-style: normal; font-weight: 500; line-height: 1.25rem; /* 153.846% */ letter-spacing: -0.0325rem; text-decoration-line: underline; } .notifyCard { padding:.88rem 1.44rem; display: flex; align-items: flex-start; gap: 1.37rem; } .unlocked { background: rgba(17, 30, 108, 0.02); } .LockContain { display: flex; justify-content: center; align-items: center; width: 2.56rem; height: 2.56rem; border-radius: 100%; background-color: #F2F2F2; } .notifyMsg { font-size: 0.75rem; font-style: normal; font-weight: 400; line-height: 171.5%; /* 1.28625rem */ letter-spacing: -0.00938rem; } .unlockMsg { color: #A8CF45; } .notifyExtra { color: var(--gray-2, #4F4F4F); font-size: 0.6875rem; font-style: normal; font-weight: 400; line-height: 1.25rem; /* 181.818% */ letter-spacing: -0.01375rem; } .ProfilePic { width: 2.56rem; height: 2.56rem; border-radius: 100%; } .msgCard { padding:.88rem 1.44rem; } .messages { font-size: 0.75rem; font-style: normal; font-weight: 400; line-height: 171.5%; /* 1.28625rem */ letter-spacing: -0.00938rem; } .unreadMsg { color: #A8CF45; } .WalletWrap { padding: 1.25rem 2.69rem 1.56rem 1.62rem; } .currencySelect { width: 3.4375rem; height: 1rem; flex-shrink: 0; font-family: Montserrat; border-radius: 0.25rem; border: 0.5px solid var(--Tertiary, #6B809B); background: #E8E8E8; margin-bottom: 1.13rem; font-size: .75rem; } .cardLabel { color: var(--Gray-1, #333); font-size: 0.8125rem; font-style: normal; font-family: Montserrat; font-weight: 500; line-height: 150%; /* 1.21875rem */ letter-spacing: -0.0625rem; margin: 0; } .cardAmount { color: var(--sub, #242424); font-size: 1.625rem; font-family: Montserrat; font-style: normal; font-weight: 600; line-height: 150%; /* 2.4375rem */ letter-spacing: -0.0625rem; margin: 0; } .walletAcct { color: var(--dark-icon, #121212); font-size: 0.9375rem; font-family: Montserrat; font-style: normal; font-weight: 700; line-height: normal; padding-top: .2rem; } #copyIcon { padding-top: 0; } .cardValue { color: var(--sub, #242424); font-family: Montserrat; font-size: 0.9375rem; font-style: normal; font-weight: 600; line-height: 150%; /* 1.40625rem */ letter-spacing: -0.0625rem; } @media (max-width: 640px) { grid-template-columns: repeat(1, minmax(0, 1fr)); } `,q="/assets/BuildStartup-7d6d2af3.svg",J="/assets/Funds-8be6b7c3.svg",Q="/assets/AI-7ab38152.svg",v="/assets/Dispute-7b7ba1af.svg",$="/assets/Job-8918152d.svg",K="/assets/Payment-26221d65.svg",Z="/assets/ServicesColor-70e248bb.svg",Y=[{title:"Build a Startup",icon:q,subText:"Create your startups or add an existing businesses",bgColor:"#EE2B2B26",link:"/create-startup"},{title:"Raise Funds",icon:J,subText:"Get funds for your business",bgColor:"#008A0026",link:"/raise-funds"},{title:"Job Board",icon:$,subText:"Get your dream jobs",bgColor:"#9747FF26",link:"/create-job"},{title:"Groups & Communities",icon:R,subText:"Meet others",bgColor:"#0A66C226",link:"/groups"},{title:"Services",icon:Z,subText:"Get a suitable service",bgColor:"#292D3226",link:"/services"},{title:"Payment",icon:K,subText:"Make wallet tranfers",bgColor:"#EE2B2B26",link:"/financials"},{title:"AI Business Advisor",icon:Q,subText:"",bgColor:"#6A086026"},{title:"Dispute Resolutions",icon:v,subText:"Settle Disputes",bgColor:"#4A8DD126",link:"/groups/dispute_resolution_group/get-started"},{title:"View Your Ads",icon:v,subText:"View Your Ads",bgColor:"#EE2B2B26",link:"/advert"},{title:"All Ads",icon:v,subText:"View All Ads",bgColor:"#292D3226",link:"/advert/all-adverts"},{title:"Teams",icon:_,subText:"View Teams",bgColor:"#4A8DD126",link:"/build-team"}],X=()=>{var x,o;const t=w(),c=JSON.parse(localStorage.getItem("user")),{data:a,isLoading:d,isError:p}=L(),{data:n}=I(),{data:i}=G();console.log(i);const m=y.useMemo(()=>(i==null?void 0:i.data.length)===0||i==null?void 0:i.data.map(u=>u.fundsRaised).reduce((u,k)=>u+k,0),[i]);return console.log(m),console.log(a),e.jsxs(s,{children:[e.jsxs("div",{className:"mb-[10px] text-[#6B809B] font-bold text-[1.2rem]",children:[e.jsxs("div",{children:["Hi ",c==null?void 0:c.firstName]}),e.jsx("div",{children:"Welcome back"})]}),e.jsxs(E,{className:"WalletCard",children:[e.jsx(s,{className:"Ellipse",children:e.jsx(V,{})}),e.jsxs(s,{className:"WalletWrap",children:[e.jsx("div",{className:"flex justify-between items-center"}),e.jsx("div",{children:e.jsx("a",{href:"/financials",className:"text-black text-[.9em] cursor-pointer",children:"view wallet"})}),e.jsxs(s,{children:[e.jsx(l,{appear:d,children:e.jsx("div",{children:"Loading wallet..."})}),e.jsx(l,{appear:p,children:e.jsx("div",{children:"ERR: INTERNET_CONNECTION_REFUSED"})}),e.jsx(l,{appear:!d&&!p&&a.statusCode===200,children:e.jsxs(j,{container:!0,sx:{mb:"1.4rem"},children:[e.jsxs(j,{item:!0,xs:8,children:[e.jsx("p",{className:"cardLabel",children:"Account Balance"}),e.jsxs("p",{className:"cardAmount",children:["₦ ",(x=a==null?void 0:a.data)==null?void 0:x.balance]})]}),e.jsxs(j,{item:4,children:[e.jsx("p",{className:"cardLabel",children:"Wallet Number"}),e.jsx(s,{sx:{display:"flex",gap:".88rem",pt:".5rem"},children:e.jsx("p",{className:"walletAcct",children:(o=a==null?void 0:a.data)==null?void 0:o.account_number})})]})]})}),e.jsxs(j,{container:!0,children:[e.jsxs(j,{item:!0,xs:8,children:[e.jsx("p",{className:"cardLabel",children:"Total Funds Raised"}),e.jsx(s,{children:e.jsxs("p",{className:"cardValue",children:["₦ ",m,".00"]})})]}),e.jsxs(j,{item:!0,xs:4,children:[e.jsx("p",{className:"cardLabel",children:"Startups Created"}),e.jsx("p",{className:"cardValue",children:n==null?void 0:n.length})]})]})]})]})]}),e.jsxs(s,{children:[e.jsx("p",{className:"exploreText",children:"Explore StartUp life"}),e.jsx(s,{className:"StartupGrid",children:Y.map((r,u)=>e.jsx(s,{className:"StartupCard",sx:{backgroundColor:r.bgColor,cursor:"pointer"},onClick:()=>(r==null?void 0:r.link)&&t(r==null?void 0:r.link),children:e.jsxs(s,{children:[e.jsx(s,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(s,{className:"iconContain",children:e.jsx("img",{src:r.icon,alt:"icon"})})}),e.jsx("p",{className:"StartupTitle",style:{color:r.bgColor.slice(0,-2)},children:r.title}),e.jsx("p",{className:"StartupSubtext",children:r.subText})]})},u))})]})]})},ee=t=>y.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},y.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.6023 6.4133V7.69108C16.0376 8.13909 17.0833 9.43841 17.0833 10.9903V15.1044C17.0833 17.0256 15.4905 18.5833 13.5269 18.5833H6.474C4.50947 18.5833 2.91667 17.0256 2.91667 15.1044V10.9903C2.91667 9.43841 3.96329 8.13909 5.39774 7.69108V6.4133C5.40621 3.92895 7.46389 1.91663 9.9873 1.91663C12.5446 1.91663 14.6023 3.92895 14.6023 6.4133ZM10.0042 3.36583C11.7232 3.36583 13.1204 4.73222 13.1204 6.4133V7.51138H6.87961V6.39673C6.88808 4.72394 8.28527 3.36583 10.0042 3.36583ZM10.7409 13.9624C10.7409 14.3682 10.4107 14.6911 9.99577 14.6911C9.58932 14.6911 9.25907 14.3682 9.25907 13.9624V12.124C9.25907 11.7265 9.58932 11.4035 9.99577 11.4035C10.4107 11.4035 10.7409 11.7265 10.7409 12.124V13.9624Z",fill:"#A8CF45"})),se=()=>{var p,n,i;const{data:t,isLoading:c,isError:a}=z(),d=w();return console.log(t),e.jsx(E,{sx:{width:"25.3125rem",borderRadius:"0.625rem",background:"#FFF",boxShadow:"0px 4px 30px 0px rgba(196, 204, 221, 0.28)"},children:e.jsxs(s,{sx:{padding:"1.11rem 0 2.11rem 0"},children:[e.jsx(s,{sx:{display:"flex",justifyContent:"space-between",pl:"1.5rem",pr:"1.94rem",mb:"2.9rem"},children:e.jsx("p",{className:"notificationHeader",children:"Notifications"})}),e.jsx(l,{appear:c,children:e.jsx("div",{className:"ml-[20px]",children:"Loading notifications..."})}),e.jsx(l,{appear:a,children:e.jsx("div",{className:"ml-[20px]",children:"Error: INTERNET_CONNECTION_REFUSED"})}),e.jsx(l,{appear:!c&&!a&&((p=t==null?void 0:t.data)==null?void 0:p.length)===0,children:e.jsx("div",{className:"ml-[20px]",children:"No notification..."})}),e.jsx(l,{appear:!c&&!a&&((n=t==null?void 0:t.data)==null?void 0:n.length)>0,children:e.jsx(S,{spacing:1,children:(i=t==null?void 0:t.data)==null?void 0:i.slice(0,5).map((m,x)=>e.jsxs("div",{onClick:()=>d("/notifications"),className:`notifyCard ${!m.lock&&"unlocked"}`,children:[e.jsx(s,{className:"LockContain",children:e.jsx(ee,{})}),e.jsxs(s,{children:[e.jsx("p",{className:"notifyMsg unlockMsg",children:m.title}),e.jsxs("p",{className:"notifyExtra",children:[U(m.createdAt).fromNow()," "]})]})]},x))})})]})})},re=A(D)(()=>({"& .MuiBadge-badge":{backgroundColor:"#A8CF45"}})),te=()=>{const{client:t,decoded:c}=W(),a=w(),{data:d}=P();async function p(){var o;try{const r={type:"messaging",members:{$in:[c.user_id]}},u=[{last_message_at:-1}],C=(await t.queryChannels(r,u,{watch:!0,state:!0})).filter(N=>N.id.includes("chat_with_profile_user"));if(C.length>0){const N=C==null?void 0:C.map(h=>h.state.messageSets[0].messages);let b=[];for(let h=0;h<N.length;h++){let g=N[h];for(let f=0;f<g.length;f++)g[f].user.id!==c.user_id&&(b=[...b,g[f]])}return b==null?void 0:b.map(h=>{var f;const g=(f=d==null?void 0:d.data)==null?void 0:f.filter(T=>T.id.toString()===h.user.id)[0];return{text:h.text,avatarUrl:g.avatarUrl,email:g.email,name:g.firstName+" "+g.lastName}})}return[]}catch(r){return console.log(r),(o=r.response)==null?void 0:o.data}}const{data:n,isPending:i,isLoading:m,isError:x}=O({queryFn:p,queryKey:["fetch_channel_dashboard_messages"],enabled:!!t&&!!c&&!!d});return console.log(n),e.jsx(E,{sx:{width:"25.3125rem",borderRadius:"0.625rem",background:"#FFF",boxShadow:"0px 4px 30px 0px rgba(196, 204, 221, 0.28)"},children:e.jsxs(s,{sx:{padding:"1.11rem 0 2.11rem 0"},children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",pl:"1.5rem",pr:"1.94rem",mb:"1.7rem"},children:[e.jsx("p",{className:"notificationHeader",children:"Messages"}),e.jsx("p",{className:"notificationMark cursor-pointer z-10",onClick:()=>a("/startup-messaging-channel"),children:"See all"})]}),e.jsx(l,{appear:m||i,children:e.jsx("p",{className:"messages pl-[1.5rem]",children:"Loading messages..."})}),e.jsx(l,{appear:x,children:e.jsx("p",{className:"messages pl-[1.5rem]",children:"ERR: INTERNET_CONNECTION_REFUSED"})}),e.jsx(l,{appear:!m&&!i&&!x&&n.length===0,children:e.jsx("p",{className:"messages pl-[1.5rem]",children:"No messages yet"})}),e.jsx(l,{appear:!m&&!i&&!x&&n.length>0,children:e.jsx(S,{spacing:1,children:n==null?void 0:n.map((o,r)=>e.jsx(s,{className:"msgCard",children:e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs(s,{sx:{display:"flex",gap:"1.37rem"},children:[e.jsx("img",{className:"ProfilePic",src:o.avatarUrl,alt:"pic"}),e.jsxs(s,{children:[e.jsx("p",{className:`messages ${o.unread&&"unreadMsg"}`,children:o.email}),e.jsx("p",{className:`messages ${o.unread&&"unreadMsg"}`,children:o.text})]})]}),o.unread&&e.jsx(re,{badgeContent:o.unread,color:"primary"})]})},r))})})]})})},ae=()=>e.jsxs(s,{children:[e.jsx(s,{sx:{mb:"2.38rem"},children:e.jsx(se,{})}),e.jsx(te,{})]}),ie=()=>F({mutationFn:async a=>{var d;try{return(await B.post("/assistant",a)).data}catch(p){return(d=p.response)==null?void 0:d.data}}}),Be=()=>{const[t,c]=y.useState(!1),[a,d]=y.useState(""),{mutateAsync:p,data:n,isLoading:i,isError:m}=ie(),x=o=>{o.key==="Enter"&&(console.log("yeah"),p({topic:a}).then(r=>{console.log(r)}).catch(r=>console.log(r)))};return e.jsxs(H,{children:[e.jsx(s,{children:e.jsx(X,{})}),e.jsx(s,{children:e.jsx(ae,{})}),e.jsxs(s,{sx:{position:"fixed",right:"20px",bottom:"20px",height:"500px",width:"350px",display:"flex",flexDirection:"column",alignItems:"end",justifyContent:"end",zIndex:"1"},children:[e.jsx(l,{appear:!!t,children:e.jsxs("div",{className:"search-display-box rounded-[10px] bg-[#A8CF45] p-[20px] h-[450px] w-full",children:[e.jsxs("div",{className:"h-[360px] flex flex-col gap-[20px]",children:[e.jsxs(l,{appear:!i&&!m&&n,children:[e.jsxs("div",{className:"display bg-[#fff] text-[#000] p-[10px] rounded-[10px]",children:[e.jsx("strong",{className:"uppercase text-[1.2rem]",children:"your question"}),": ",a]}),e.jsxs("div",{className:"display h-[250px] overflow-auto bg-[#fff] text-[#000] p-[10px] rounded-[10px]",children:[e.jsx("strong",{className:"text-[1.2rem]",children:"Julia"}),": ",n]})]}),e.jsx(l,{appear:m,children:e.jsx("div",{className:"display bg-[#fff] text-[#000] p-[10px] rounded-[10px]",children:"Error: INTERNET_CONNECTION_ERR"})}),e.jsx(l,{appear:i,children:e.jsx("div",{className:"display bg-[#fff] text-[#000] p-[10px] rounded-[10px]",children:"Loading..."})})]}),e.jsx("div",{className:"search",children:e.jsx("input",{type:"text",value:a,onChange:o=>d(o.target.value),onKeyDown:x,className:"outline-none w-full h-[50px] px-[10px] border border-[#A8CF45]"})})]})}),e.jsx("div",{onClick:()=>c(!t),className:"showBtn cursor-pointer bg-[#A8CF45] text-[1.3em] w-[50px] h-[50px] rounded-full text-white flex justify-center items-center",children:"Julia"})]})]})};export{Be as default};