PageSourceSearch

https://common.fund/_next/static/chunks/pages/profile-07a39ffdda1caa8e.js

js common.fund collected 2026-10-08 10:16:01 UTC 8,754 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[277],{56896:function(e,a,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile",function(){return l(60692)}])},60692:function(e,a,l){"use strict";l.r(a),l.d(a,{default:function(){return C}});var s=l(85893),i=l(14713),t=l(67294),n=l(72132),r=l(25675),c=l.n(r),o=l(11163),d=l(50319),m=l(85467),u=l(4890),h=l(27340),x=l(13745),p=l(25273),f=l(95779),v=l(74612),b=l(51189),y=l(76896),g=l(37119),j=l(23310),N=()=>{var e,a,l,i,r,N;let w=(0,o.useRouter)(),{user:C,setUser:k,updateHubspot:_}=(0,h.SE)(),{supraAccount:z,isSupraConnected:S}=(0,x.U)(),[Z,E]=(0,t.useState)(!1),[T,P]=(0,t.useState)(!1),[A,K]=(0,t.useState)(!1),[Y,L]=(0,t.useState)(!1),[H,q]=(0,t.useState)("not_submitted"),F=(0,t.useRef)(!1),[O]=(0,d.D)(p.AX),R=(0,t.useCallback)(async()=>{if(!(null==C?void 0:C.email)){n.Am.error("Please log in to verify KYC");return}L(!0);try{var e;let a=await fetch("/api/kyc/init-verification",{method:"POST",headers:{"Content-Type":"application/json"}});if(!a.ok){let e=await a.json();throw Error(e.message||"Failed to initialize KYC")}let l=await fetch("/api/kyc/generate-token",{method:"POST",headers:{"Content-Type":"application/json"}});if(!l.ok){let e=await l.json();throw Error(e.message||"Failed to generate token")}let s=await l.json();if(!s.success||!(null===(e=s.data)||void 0===e?void 0:e.url))throw Error("Invalid response from token generation service");window.location.href=s.data.url}catch(a){console.error("KYC verification error:",a);let e=a instanceof Error?a.message:"Failed to start KYC verification";n.Am.error(e)}finally{L(!1)}},[null==C?void 0:C.email]),D=(0,t.useCallback)(async()=>{if((null==C?void 0:C.email)&&!F.current){F.current=!0,L(!0);try{let e=await fetch("/api/kyc/status",{method:"GET",headers:{"Content-Type":"application/json"}}),a=await e.json();if(!e.ok||!a.success)throw Error((null==a?void 0:a.message)||"Failed to fetch KYC status");K(a.status),q(a.KYCStatus)}catch(e){console.error("Error checking KYC status:",{error:e,email:C.email,time:new Date().toISOString()}),K(!1)}finally{L(!1)}}},[null==C?void 0:C.email]);(0,t.useEffect)(()=>{D()},[D]);let U=(0,t.useMemo)(()=>g.z.find(e=>e.alpha3===(null==C?void 0:C.country)),[C]),V=(0,m.TA)({enableReinitialize:!0,initialValues:{email:null!==(l=null==C?void 0:C.email)&&void 0!==l?l:"",countryCode:null!==(i=null==C?void 0:null===(e=C.phoneNumber)||void 0===e?void 0:e.split(" ")[0])&&void 0!==i?i:"+1",phoneNumber:null!==(r=null==C?void 0:null===(a=C.phoneNumber)||void 0===a?void 0:a.split(" ")[1])&&void 0!==r?r:"",telegramHandle:null!==(N=null==C?void 0:C.telegramHandle)&&void 0!==N?N:"",isProfileChange:!1},validationSchema:(0,v.k)(C),onSubmit:async e=>{P(!0),C&&(e.phoneNumber=e.phoneNumber.replace(/[^0-9]/g,""),await I(e)),P(!1)}}),I=async e=>{let{countryCode:a,isProfileChange:l,...s}=e,i="".concat(a," ").concat(s.phoneNumber);await O({variables:{updateUserData:{...s,phoneNumber:i}},onCompleted(e){let{updateUser:a}=e;k({...C,...a}),_(null==C?void 0:C.email,{mobilephone:i}),P(!1),E(!1)},onError(e){n.Am.error(null==e?void 0:e.message),P(!1)}})};return(0,s.jsx)("div",{className:"px-2",children:(0,s.jsxs)(b.Zb,{className:"p-0 sm:p-8 lg:!p-16 space-y-10 lg:space-y-16 mx-auto !text-left !text-dark mt-0",spaceClass:"px-0 py-8 sm:p-8 md:p-12 shadow-none sm:drop-shadow-1",children:[(0,s.jsx)(y.Z,{variant:"h2",className:"tracking-wide sm:text-center text-left",children:"Profile"}),(0,s.jsxs)(m.Hy,{value:V,children:[(0,s.jsxs)("div",{className:"flex flex-col lg:flex-row md:space-y-10 lg:space-y-0 lg:space-x-20 lg:items-start",children:[(0,s.jsx)("div",{className:"relative w-28 lg:w-32 aspect-square object-contain hidden md:block",children:(0,s.jsx)(c(),{src:"/images/user_img.png",alt:"User Profile",className:"rounded-full",layout:"fill",loading:"lazy",quality:100})}),(0,s.jsx)("div",{className:"md:w-[80%] [&>*]:text-left",children:(0,s.jsxs)("div",{className:"divide-y divide-solid divide-gray-300 [&>div]:py-2 md:py-0 md:divide-y-0 [&>div]:space-x-2",children:[z&&(0,s.jsxs)("div",{className:"sm:flex items-center space-y-2 sm:space-y-0 sm:[&_>*]:w-[35%]",children:[(0,s.jsx)(y.Z,{variant:"bodyLarge",className:"font-bold capitalize",children:"Wallet address"}),(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)(y.Z,{className:"mr-1",children:(0,u.zN)(z)}),(0,s.jsx)(c(),{src:"/images/clipboard.svg",alt:"Clipboard",width:20,height:20,className:"cursor-pointer",onClick:()=>(0,f.zp)(z)})]})]}),(null==C?void 0:C.firstName)&&(0,s.jsxs)("div",{className:"flex items-center [&_>*]:w-[35%]",children:[(0,s.jsx)(y.Z,{variant:"bodyLarge",className:"font-bold capitalize",children:"First name"}),(0,s.jsx)(y.Z,{children:C.firstName})]}),(null==C?void 0:C.lastName)&&(0,s.jsxs)("div",{className:"flex items-center [&_>*]:w-[35%]",children:[(0,s.jsx)(y.Z,{variant:"bodyLarge",className:"font-bold capitalize ",children:"Last name"}),(0,s.jsx)(y.Z,{children:C.lastName})]}),(null==C?void 0:C.email)&&(0,s.jsxs)("div",{className:"flex items-center [&_>*]:w-[35%]",children:[(0,s.jsx)(y.Z,{variant:"bodyLarge",className:"font-bold capitalize ",children:"Email address"}),(0,s.jsx)(y.Z,{children:C.email})]}),U&&(0,s.jsxs)("div",{className:"flex items-center [&_>*]:w-[35%]",children:[(0,s.jsx)(y.Z,{variant:"bodyLarge",className:"font-bold capitalize ",children:"Country"}),(0,s.jsx)(y.Z,{children:(null==U?void 0:U.flag)+" "+(null==U?void 0:U.name)})]}),Z&&S?(0,s.jsx)(b.Lz,{label:"Telegram Handle",labelClass:"w-full font-bold md:text-lg sm:text-base text-sm capitalize py-2 md:py-0",name:"telegramHandle",placeholder:(null==C?void 0:C.ref)?"":"Optional",prefix:"@",type:"text"}):(0,s.jsx)(s.Fragment,{children:(null==C?void 0:C.telegramHandle)&&(0,s.jsxs)("div",{className:"flex items-center [&_>*]:w-[35%]",children:[(0,s.jsx)(y.Z,{variant:"bodyLarge",className:"font-bold capitalize ",children:"Telegram Handle"}),(0,s.jsx)(y.Z,{children:C.telegramHandle})]})}),(0,s.jsxs)("div",{className:"flex items-center [&_>*]:w-[35%]",children:[(0,s.jsx)(y.Z,{variant:"bodyLarge",className:"font-bold capitalize",children:"KYC Status"}),(0,s.jsx)("div",{className:"flex flex-col space-y-2 w-full",children:(0,s.jsx)("div",{className:"flex items-center space-x-2",children:Y?(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 animate-pulse"}):A?(0,s.jsxs)("div",{className:"flex items-center text-green-500",children:[(0,s.jsx)("span",{className:"w-3 h-3 rounded-full bg-green-500 mr-1"}),(0,s.jsx)("span",{children:"Verified"})]}):(0,s.jsx)(b.uA,{size:"xs",buttonStyle:"primary",className:"w-fit text-xs py-0.5 px-2 h-7",onClick:R,disabled:A||Y||"review"===H,children:"failed"===H?"Retry KYC":"review"===H?"KYC In Review":"Verify KYC"})})})]}),Z&&S?(0,s.jsx)(b.z2,{label:"Number",labelClass:"w-full font-bold md:text-lg sm:text-base text-sm capitalize"}):(0,s.jsx)(s.Fragment,{children:(null==C?void 0:C.phoneNumber)&&(0,s.jsxs)("div",{className:"flex items-center [&_>*]:w-[35%]",children:[(0,s.jsx)(y.Z,{variant:"bodyLarge",className:"font-bold capitalize ",children:"Number"}),(0,s.jsx)(y.Z,{children:C.phoneNumber})]})})]})})]}),Z&&S?(0,s.jsxs)("div",{className:"flex justify-center space-x-5 max-w-sm mx-auto",children:[(0,s.jsx)(b.uA,{size:"lg",className:"w-full font-extrabold",buttonStyle:"outline",onClick:()=>E(!1),children:"Cancel"}),(0,s.jsx)(b.uA,{size:"lg",className:"w-full font-extrabold whitespace-nowrap",buttonStyle:"primary",disabled:!(V.isValid&&V.dirty)||T,onClick:()=>V.handleSubmit(),children:"Save Details"})]}):(0,s.jsxs)("div",{className:"flex justify-center space-x-5 max-w-sm mx-auto",children:[(0,s.jsx)(b.uA,{size:"lg",className:"w-full font-extrabold",buttonStyle:"outline",onClick:()=>w.push("".concat(j.a.Projects,"/","dexlyn")),children:"Back"}),S&&(0,s.jsx)(b.uA,{size:"lg",className:"w-full font-extrabold whitespace-nowrap",buttonStyle:"outline",onClick:()=>E(!0),children:"Edit Profile"})]})]})]})})},w=()=>(0,s.jsx)("div",{className:"sm:space-y-10 space-y-6",children:(0,s.jsx)(N,{})}),C=(0,i.tl)(()=>(0,s.jsx)(w,{}))},74612:function(e,a,l){"use strict";l.d(a,{g:function(){return i},k:function(){return t}});var s=l(74231);let i=e=>s.Z_().test("telegram-required","Telegram handle is required.",a=>!!a||!(null==e?void 0:e.ref)).min(5,"Telegram handle must be at least 5 characters.").max(32,"Telegram handle must be at most 32 characters.").matches(/^\w+$/,"Telegram handle contains invali
1d characters."),t=e=>s.Ry().shape({countryCode:s.Z_().required("Please select country code."),phoneNumber:s.Z_().required("Phone number is required.").matches(/^(?=.*?[1-9])[0-9()\.\-\s\+]+$/,"Phone number contains invalid characters."),telegramHandle:i(e)})}},function(e){e.O(0,[7487,4231,2888,9774,179],function(){return e(e.s=56896)}),_N_E=e.O()}]);

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.