"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4794],{4794:function(e,l,t){t.d(l,{Z:function(){return eb}});var i=t(85893),a=t(67294),o=t(2185),n=t(8702),s=t(11542),d=t(76166),r=t(92875),u=t(44823),c=t(31837),v=t(43205),m=t(29313),h=t(45595),g=t(64878),x=t(86361),p=t(2870),j=t(44699),N=t(42136);let f=h.default.INTEGRATION_NAMES_DB.devto,I=e=>{var l,t,n,r,I,b,y,S;let{data:T,username:w,userid:A,isPrimaryUser:R}=e,D=(0,o.I0)(),{integrationData:M}=(0,o.v9)(e=>e.SecondaryUserData),{deleteError:_,handleDeleteIntegration:Z}=(0,x.Z)(f),C=h.default.INTEGRATION_SHARING_INFO[f],[O,k]=(0,a.useState)(!1),[L,E]=(0,a.useState)(h.CARD_COUNT.MIN_LIMIT),[U,P]=(0,a.useState)(),[B,G]=(0,a.useState)(),F=async()=>{if(A)try{P(!0);let e=await c.vJ.getDevto(A),l={posts:(0,N.R0)(e.data.data.posts,"publishedAt")};D(p.OV.updateIntegrationData({devto:{userid:A,...l,user:w}}))}catch(i){var e,l,t;G((null==i?void 0:null===(e=i.response)||void 0===e?void 0:null===(l=e.data)||void 0===l?void 0:null===(t=l.error)||void 0===t?void 0:t.message)||v.Z.GLOBAL.wrong),D(p.OV.updateIntegrationData({devto:{userid:A,user:w}}))}finally{P(!1)}},H=async()=>{P(!0),await Z(),_&&G(_),P(!1)};return(0,a.useEffect)(()=>{var e,l;return(null==M?void 0:null===(e=M.devto)||void 0===e?void 0:e.userid)&&A===(null==M?void 0:null===(l=M.devto)||void 0===l?void 0:l.userid)||F(),()=>{P(),G(),k(!1),E(4)}},[A]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:C.name,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(g.Z.Logo,{integrationURL:"https://dev.to/".concat(w),dbname:C.dbname,type:C.name}),(0,i.jsxs)("div",{className:"flex items-center",children:[U&&(0,i.jsx)(j.Z,{}),!U&&T.me&&(0,i.jsx)(g.Z.DeleteIntegration,{setShowRemove:()=>k(!0)})]})]}),B&&R&&(0,i.jsx)(u.y,{className:"mt-1",children:B}),!U&&(null===(l=M.devto)||void 0===l?void 0:null===(t=l.posts)||void 0===t?void 0:t.length)===0&&(0,i.jsx)(m.Z.NoData,{text:"".concat(T.firstName," hasn't published any articles yet.")}),!U&&(null==M?void 0:null===(n=M.devto)||void 0===n?void 0:null===(r=n.posts)||void 0===r?void 0:r.length)>0&&(0,i.jsx)("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:null==M?void 0:null===(I=M.devto)||void 0===I?void 0:null===(b=I.posts)||void 0===b?void 0:b.map((e,l)=>l<L?(0,i.jsx)(g.Z.CardWrapper,{primaryUser:T.me,integrationName:f,username:T.profileHandle,href:null==e?void 0:e.url,className:"flex flex-col justify-between h-full",padding:"",children:(0,i.jsx)(g.Z.CardContent,{title:null==e?void 0:e.title,image:null==e?void 0:e.coverImage})},"".concat(e.title,"-devto-article")):null)}),!U&&(null==M?void 0:null===(y=M.devto)||void 0===y?void 0:null===(S=y.posts)||void 0===S?void 0:S.length)>h.CARD_COUNT.MIN_LIMIT&&(0,i.jsx)(s.ZP.ShowMoreLargeBtn,{onClick:()=>(0,N.Q$)(L,E),showMore:L!==h.CARD_COUNT.MAX_LIMIT})]}),O&&(0,i.jsx)(d.Z,{showModal:O,setShowModal:k,deleteText:"Are you sure you want to remove this section from portfolio?",confirm:()=>H()})]})},b=h.default.INTEGRATION_NAMES_DB.dribbble,y=e=>{var l,t,n,r,f,I,y,S;let{data:T,username:w,userid:A,isPrimaryUser:R}=e,D=(0,o.I0)(),{integrationData:M}=(0,o.v9)(e=>e.SecondaryUserData),{deleteError:_,handleDeleteIntegration:Z}=(0,x.Z)(b),C=h.default.INTEGRATION_SHARING_INFO[b],[O,k]=(0,a.useState)(),[L,E]=(0,a.useState)(),[U,P]=(0,a.useState)(!1),[B,G]=(0,a.useState)(h.CARD_COUNT.MIN_LIMIT),F=async()=>{var e,l,t,i;if(A)try{E(!0);let l=await c.vJ.getDribbble(A);D(p.OV.updateIntegrationData({dribbble:{userid:A,data:null==l?void 0:null===(e=l.data)||void 0===e?void 0:e.data,user:w}}))}catch(e){k((null==e?void 0:null===(l=e.response)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:null===(i=t.error)||void 0===i?void 0:i.message)||v.Z.GLOBAL.wrong),p.OV.updateIntegrationData({dribbble:{userid:A,user:w}})}finally{E(!1)}},H=async()=>{E(!0),await Z(),_&&k(_),E(!1)};return(0,a.useEffect)(()=>{var e,l;return(null==M?void 0:null===(e=M.dribbble)||void 0===e?void 0:e.userid)&&A===(null==M?void 0:null===(l=M.dribbble)||void 0===l?void 0:l.userid)||F(),()=>{E(),k(),P(!1),G(h.CARD_COUNT.MIN_LIMIT)}},[A]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:C.name,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(g.Z.Logo,{dbname:C.dbname,type:C.name,isAuthenticated:!0,integrationURL:"https://dribbble.com/".concat(w)}),(0,i.jsxs)("div",{className:"flex items-center",children:[L&&(0,i.jsx)(j.Z,{}),!L&&T.me&&(0,i.jsx)(g.Z.DeleteIntegration,{setShowRemove:()=>P(!0)})]})]}),O&&R&&(0,i.jsx)(u.y,{className:"mt-1",children:O}),!L&&(null===(l=M.dribbble)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:t.length)===0&&(0,i.jsx)(m.Z.NoData,{text:"".concat(T.firstName," hasn't added any shots yet.")}),!L&&(null==M?void 0:null===(n=M.dribbble)||void 0===n?void 0:null===(r=n.data)||void 0===r?void 0:r.length)>0&&(0,i.jsx)("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:null==M?void 0:null===(f=M.dribbble)||void 0===f?void 0:null===(I=f.data)||void 0===I?void 0:I.map((e,l)=>l<B?(0,i.jsx)(g.Z.CardWrapper,{primaryUser:T.me,integrationName:b,username:T.profileHandle,href:e.htmlUrl,className:"flex flex-col h-full w-full outline-none",padding:"",children:(0,i.jsx)(g.Z.CardContent,{image:null==e?void 0:e.imageUrl,title:null==e?void 0:e.title,integrationName:C.name})},"".concat(e.title,"-dribbble")):null)}),!L&&(null==M?void 0:null===(y=M.dribbble)||void 0===y?void 0:null===(S=y.data)||void 0===S?void 0:S.length)>h.CARD_COUNT.MIN_LIMIT&&(0,i.jsx)(s.ZP.ShowMoreLargeBtn,{onClick:()=>(0,N.Q$)(B,G),showMore:B!==h.CARD_COUNT.MAX_LIMIT})]}),U&&(0,i.jsx)(d.Z,{showModal:U,setShowModal:P,deleteText:"Are you sure you want to remove this section from portfolio?",confirm:()=>H()})]})};var S=t(39540),T=t(88872),w=t(55164);let A=h.default.INTEGRATION_NAMES_DB.gumroad,R=e=>{var l,t,n,r,f,I,b,y,S,T,R,D;let{data:M,createShareWork:_,username:Z,userid:C,isLoggedIn:O,isPrimaryUser:k}=e,L=(0,o.I0)(),{integrationData:E}=(0,o.v9)(e=>e.SecondaryUserData),{deleteError:U,handleDeleteIntegration:P}=(0,x.Z)(A),B=h.default.INTEGRATION_SHARING_INFO[A],[G,F]=(0,a.useState)(!1),[H,W]=(0,a.useState)(h.CARD_COUNT.MIN_LIMIT),[V,z]=(0,a.useState)(),[J,Y]=(0,a.useState)(),Q=async()=>{var e,l,t,i;if(C)try{z(!0);let l=await c.vJ.getGumroad(C);L(p.OV.updateIntegrationData({gumroad:{userid:C,data:null==l?void 0:null===(e=l.data)||void 0===e?void 0:e.data,user:Z}}))}catch(e){Y((null==e?void 0:null===(l=e.response)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:null===(i=t.error)||void 0===i?void 0:i.message)||v.Z.GLOBAL.wrong),L(p.OV.updateIntegrationData({gumroad:{userid:C,user:Z}}))}finally{z(!1)}},$=async()=>{z(!0),await P(),U&&Y(U),z(!1)},X=e=>{let l=(0,N._x)(null==e?void 0:e.description),t={link:null==e?void 0:e.url,title:null==e?void 0:e.name,image:null==e?void 0:e.image,description:l};k||(t.originalPoster=M.id),_(t)};return(0,a.useEffect)(()=>{var e,l;return(null==E?void 0:null===(e=E.gumroad)||void 0===e?void 0:e.userid)&&C===(null==E?void 0:null===(l=E.gumroad)||void 0===l?void 0:l.userid)||Q(),()=>{z(),Y(),F(!1),W(h.CARD_COUNT.MIN_LIMIT)}},[C]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:B.name,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(g.Z.Logo,{type:B.name,dbname:B.dbname,isAuthenticated:!0,IntegrationURL:"https://".concat(Z,".gumroad.com")}),(0,i.jsxs)("div",{className:"flex items-center",children:[V&&(0,i.jsx)(j.Z,{}),!V&&M.me&&(0,i.jsx)(g.Z.DeleteIntegration,{setShowRemove:()=>F(!0)})]})]}),J&&k&&(0,i.jsx)(u.y,{className:"mt-1",children:J}),!V&&(null===(l=E.gumroad)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:null===(n=t.products)||void 0===n?void 0:n.length)===0&&(0,i.jsx)(m.Z.NoData,{text:"".concat(M.firstName," hasn't added any product yet.")}),!V&&(null==E?void 0:null===(r=E.gumroad)||void 0===r?void 0:null===(f=r.data)||void 0===f?void 0:null===(I=f.products)||void 0===I?void 0:I.length)>0&&(0,i.jsx)("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:null==E?void 0:null===(b=E.gumroad)||void 0===b?void 0:null===(y=b.data)||void 0===y?void 0:null===(S=y.products)||void 0===S?void 0:S.map((e,l)=>l<H?(0,i.jsxs)(g.Z.CardWrapper,{integrationName:A,primaryUser:M.me,username:M.profileHandle,href:e.url,children:[(0,i.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,i.jsxs)("div",{className:"flex-1 mr-1",children:[(0,i.jsx)("h4",{className:"text-gray-gray9 text-sm font-semibold paragraph-clamp",children:null==e?void 0:e.name}),(null==e?void 0:e.price)&&(0,i.jsx)(w.Z.Gray,{children:null==e?void 0:e.price})]}),(null==e?void 0:e.image)&&(0,i.jsx)("img",{src:null==e?void 0:e.image,alt:"",className:"flex-1 w-full max-w-[150px] h-20 overflow-hidden object-cover rounded-md border border-primaryBorder"})]}),(0,i.jsx)(g.Z.CardFooter,{publishedAt:null,article:e,isLoggedIn:O,handleShare:()=>X(e)})]},"".concat(e.name,"-gumroad-product")):null)}),!V&&(null==E?void 0:null===(T=E.gumroad)||void 0===T?void 0:null===(R=T.data)||void 0===R?void 0:null===(D=R.products)||void 0===D?void 0:D.length)>h.CARD_COUNT.MIN_LIMIT&&(0,i.jsx)(s.ZP.ShowMoreLargeBtn,{onClick:()=>(0,N.Q$)(H,W),showMore:H!==h.CARD_COUNT.MAX_LIMIT})]}),G&&(0,i.jsx)(d.Z,{showModal:G,setShowModal:F,deleteText:"Are you sure you want to remove this section from portfolio?",confirm:()=>$()})]})},D=h.default.INTEGRATION_NAMES_DB.hashnode,M=h.default.INTEGRATION_NAMES_DB.medium,_=e=>{var l,t,n,r,f,I,b,y;let{data:S,username:T,userid:w,isPrimaryUser:A}=e,R=(0,o.I0)(),{integrationData:D}=(0,o.v9)(e=>e.SecondaryUserData),{deleteError:_,handleDeleteIntegration:Z}=(0,x.Z)(M),C=h.default.INTEGRATION_SHARING_INFO[M],[O,k]=(0,a.useState)(!1),[L,E]=(0,a.useState)(4),[U,P]=(0,a.useState)(),[B,G]=(0,a.useState)(),F=async()=>{if(w)try{P(!0);let e=await c.vJ.getMedium(w),l=(0,N.R0)(e.data.data,"publicationDate");R(p.OV.updateIntegrationData({medium:{userid:w,data:l,user:T}}))}catch(i){var e,l,t;G((null==i?void 0:null===(e=i.response)||void 0===e?void 0:null===(l=e.data)||void 0===l?void 0:null===(t=l.error)||void 0===t?void 0:t.message)||v.Z.GLOBAL.wrong),R(p.OV.updateIntegrationData({medium:{userid:w,user:T}}))}finally{P(!1)}},H=async()=>{P(!0),await Z(),_&&G(_),P(!1)};return(0,a.useEffect)(()=>{var e,l;return(null==D?void 0:null===(e=D.medium)||void 0===e?void 0:e.userid)&&w===(null==D?void 0:null===(l=D.medium)||void 0===l?void 0:l.userid)||F(),()=>{P(),G(),k(!1),E(4)}},[w]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:C.name,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(g.Z.Logo,{dbname:C.dbname,type:C.name,integrationURL:"https://medium.com/@".concat(T)}),(0,i.jsxs)("div",{className:"flex items-center",children:[U&&(0,i.jsx)(j.Z,{}),!U&&S.me&&(0,i.jsx)(g.Z.DeleteIntegration,{setShowRemove:()=>k(!0)})]})]}),B&&A&&(0,i.jsx)(u.y,{className:"mt-4",children:B}),!U&&((null===(l=D.medium)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:t.length)===0||B)&&(0,i.jsx)(m.Z.NoData,{text:"".concat(S.firstName," hasn't published any articles yet.")}),!U&&(null==D?void 0:null===(n=D.medium)||void 0===n?void 0:null===(r=n.data)||void 0===r?void 0:r.length)>0&&(0,i.jsx)("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:null==D?void 0:null===(f=D.medium)||void 0===f?void 0:null===(I=f.data)||void 0===I?void 0:I.map((e,l)=>l<L?(0,i.jsx)(g.Z.CardWrapper,{primaryUser:S.me,integrationName:M,username:S.profileHandle,href:e.link,className:"flex flex-col justify-between h-full",padding:"",children:(0,i.jsx)(g.Z.CardContent,{title:null==e?void 0:e.title,image:null==e?void 0:e.imageLink})},"".concat(e.title,"-medium-article")):null)}),(null==D?void 0:null===(b=D.medium)||void 0===b?void 0:null===(y=b.data)||void 0===y?void 0:y.length)>4&&(0,i.jsx)(s.ZP.ShowMoreLargeBtn,{onClick:()=>(0,N.Q$)(L,E),showMore:8!==L})]}),O&&(0,i.jsx)(d.Z,{showModal:O,setShowModal:k,deleteText:"Are you sure you want to remove this section from portfolio?",confirm:()=>H()})]})};var Z=t(25675),C=t.n(Z),O=t(11163),k=t(23489),L=t(3927),E=t(50704),U=t(53283),P=t(55303);let B=h.default.INTEGRATION_NAMES_DB.projects,G=e=>{let{project:l,isLoggedIn:t,primaryUserData:a}=e,o=(0,O.useRouter)();return(0,i.jsxs)("div",{className:"w-full flex items-center justify-between pt-2",children:[(0,i.jsxs)("div",{className:"flex items-center relative","data-tip":!0,"data-effect":"solid","data-for":"project-collaborators",children:[(0,i.jsx)(L.Z.ClubbedProfiles,{profiles:[].concat(null==l?void 0:l.creator,null==l?void 0:l.collaborators).map(e=>(null==e?void 0:e.profilePicture)||h.CDNImage.emptyUserDP),profileNames:[].concat(null==l?void 0:l.creator,null==l?void 0:l.collaborators).map(e=>(null==e?void 0:e.firstName)&&(null==e?void 0:e.lastName)?"".concat(e.firstName," ").concat(e.lastName):"")}),(0,i.jsx)(E.Z,{id:"project-collaborators",text:"Collaborators"})]}),(0,i.jsx)("span",{className:"flex items-center",children:t&&(null==a?void 0:a.id)&&N.ZP.doIHaveProjectEditAccess({myId:a.id,projectDetails:l})&&(0,i.jsx)(s.ZP.CarbonLineButton,{small:!0,circular:!0,className:"text-light focus:border-green-light",tabIndex:"0",onClick:e=>{e.preventDefault(),o.push(h.APP_PATHS.addProject(null==l?void 0:l.id))},children:(0,i.jsx)(P.ZP.Pencil,{size:16})})})]})},F=h.default.INTEGRATION_NAMES_DB.substack,H=e=>{var l,t,n,r,f,I,b,y,S,T,w,A,R;let{data:D,username:M,userid:_,isPrimaryUser:Z}=e,C=(0,o.I0)(),{integrationData:O}=(0,o.v9)(e=>e.SecondaryUserData),{deleteError:k,handleDeleteIntegration:L}=(0,x.Z)(F),E=h.default.INTEGRATION_SHARING_INFO[F],[U,P]=(0,a.useState)(!1),[B,G]=(0,a.useState)(h.CARD_COUNT.MIN_LIMIT),[H,V]=(0,a.useState)(),[z,J]=(0,a.useState)(),Y=async()=>{var e,l,t,i,a,o,n;if(_)try{V(!0);let a=await c.vJ.getSubstack(_),o=(0,N.R0)(null==a?void 0:null===(e=a.data)||void 0===e?void 0:null===(l=e.data)||void 0===l?void 0:l.posts,"publicationDate"),n={substackNewsletter:null==a?void 0:null===(t=a.data)||void 0===t?void 0:null===(i=t.data)||void 0===i?void 0:i.substackNewsletter,posts:o};C(p.OV.updateIntegrationData({substack:{userid:_,...n,user:M}}))}catch(e){J((null==e?void 0:null===(a=e.response)||void 0===a?void 0:null===(o=a.data)||void 0===o?void 0:null===(n=o.error)||void 0===n?void 0:n.message)||v.Z.GLOBAL.wrong),C(p.OV.updateIntegrationData({substack:{userid:_,user:M}}))}finally{V(!1)}},Q=async()=>{V(!0),await L(),k&&J(k),V(!1)};return(0,a.useEffect)(()=>{var e,l;return(null==O?void 0:null===(e=O.substack)||void 0===e?void 0:e.userid)&&_===(null==O?void 0:null===(l=O.substack)||void 0===l?void 0:l.userid)||Y(),()=>{V(),J(),P(!1),G(4)}},[_]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:E.name,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)("div",{className:"group",children:(0,i.jsx)(g.Z.Logo,{dbname:E.dbname,type:(null==O?void 0:null===(l=O.substack)||void 0===l?void 0:null===(t=l.substackNewsletter)||void 0===t?void 0:t.title)||E.name,integrationURL:"https://".concat(M,".substack.com"),customLogo:(0,i.jsx)(W,{substackNewsletter:null==O?void 0:null===(n=O.substack)||void 0===n?void 0:n.substackNewsletter})})}),(0,i.jsxs)("div",{className:"flex items-center",children:[H&&(0,i.jsx)(j.Z,{}),(0,i.jsxs)("div",{className:"flex items-center",children:[!H&&!D.me&&(null==O?void 0:null===(r=O.substack)||void 0===r?void 0:r.posts)&&(0,i.jsx)(g.Z.Subscribe,{subscribeLink:"https://".concat(M,".substack.com/subscribe"),onClick:()=>c.TV.integrationSectionClickTracker({primaryUser:D.me,dbname:E.dbname,username:D.profileHandle})}),D.me&&(0,i.jsx)(g.Z.DeleteIntegration,{setShowRemove:()=>P(!0)})]})]})]}),z&&Z&&(0,i.jsx)(u.y,{className:"mt-1",children:z}),!H&&((null===(f=O.substack)||void 0===f?void 0:null===(I=f.posts)||void 0===I?void 0:I.length)===0||!(null===(b=O.substack)||void 0===b?void 0:b.posts))&&(0,i.jsx)(m.Z.NoData,{text:"".concat(D.firstName," hasn't published any articles yet.")}),!H&&(null==O?void 0:null===(y=O.substack)||void 0===y?void 0:null===(S=y.posts)||void 0===S?void 0:S.length)>0&&(0,i.jsx)("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:null==O?void 0:null===(T=O.substack)||void 0===T?void 0:null===(w=T.posts)||void 0===w?void 0:w.map((e,l)=>l<B?(0,i.jsx)(g.Z.CardWrapper,{integrationName:F,primaryUser:D.me,username:D.profileHandle,href:e.link,padding:"",children:(0,i.jsx)(g.Z.CardContent,{image:null==e?void 0:e.imageLink,title:null==e?void 0:e.title})},"".concat(e.title,"-substack-article")):null)}),!H&&(null==O?void 0:null===(A=O.substack)||void 0===A?void 0:null===(R=A.posts)||void 0===R?void 0:R.length)>h.CARD_COUNT.MIN_LIMIT&&(0,i.jsx)(s.ZP.ShowMoreLargeBtn,{onClick:()=>(0,N.Q$)(B,G),showMore:B!==h.CARD_COUNT.MAX_LIMIT})]}),U&&(0,i.jsx)(d.Z,{showModal:U,setShowModal:P,deleteText:"Are you sure you want to remove this section from portfolio?",confirm:()=>Q()})]})},W=e=>{let{substackNewsletter:l=null}=e;return l?(0,i.jsx)("div",{children:(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)(C(),{src:l.imageUrl,width:40,height:40,className:"rounded-full group-hover:shadow-focus transition-all",alt:"".concat(null==l?void 0:l.title," logo")}),(0,i.jsx)("span",{className:"absolute bottom-0 right-0 w-4 h-4 bg-white border-2 border-white ary flex items-center justify-center rounded-full shadow",children:(0,i.jsx)(k.Z.SubstackSmall,{size:8})})]})}):(0,i.jsx)(k.Z.SubstackSmall,{size:32})};var V=t(22814);let z=h.default.INTEGRATION_NAMES_DB.youtube,J=e=>{var l,t,n,r,f,I,b,y,S,T,w,A;let{data:R,createShareWork:D,username:M,userid:_,isLoggedIn:Z,isPrimaryUser:C}=e,O=(0,o.I0)(),{integrationData:k}=(0,o.v9)(e=>e.SecondaryUserData),{deleteError:L,handleDeleteIntegration:E}=(0,x.Z)(z),U=h.default.INTEGRATION_SHARING_INFO[z],[P,B]=(0,a.useState)(!1),[G,F]=(0,a.useState)(h.CARD_COUNT.MIN_LIMIT),[H,W]=(0,a.useState)(),[J,Y]=(0,a.useState)(),Q=async()=>{var e,l,t,i,a;if(_)try{W(!0);let t=await c.vJ.getYouTube(_),i=null==t?void 0:null===(e=t.data)||void 0===e?void 0:null===(l=e.data)||void 0===l?void 0:l.youtubeData;O(p.OV.updateIntegrationData({youtube:{userid:_,user:M,...i}}))}catch(e){Y((null==e?void 0:null===(t=e.response)||void 0===t?void 0:null===(i=t.data)||void 0===i?void 0:null===(a=i.error)||void 0===a?void 0:a.message)||v.Z.GLOBAL.wrong),O(p.OV.updateIntegrationData({youtube:{userid:_,user:M}}))}finally{W(!1)}},$=async()=>{W(!0),await E(),L&&Y(L),W(!1)},X=e=>{let l={link:null==e?void 0:e.link,title:null==e?void 0:e.title,description:(null==e?void 0:e.description)||"",image:null==e?void 0:e.imageLink,publicationDate:e.publicationDate};C||(l.originalPoster=R.id),D(l)};return(0,a.useEffect)(()=>{var e,l;return(null==k?void 0:null===(e=k.youtube)||void 0===e?void 0:e.userid)&&_===(null==k?void 0:null===(l=k.youtube)||void 0===l?void 0:l.userid)||Q(),()=>{W(),Y(),B(!1),F(4)}},[_]),J&&!(C||(null==R?void 0:R.me))?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:U.name,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(g.Z.Logo,{dbname:U.dbname,type:(null==k?void 0:null===(l=k.youtube)||void 0===l?void 0:l.author)||U.name,integrationURL:null==k?void 0:null===(t=k.youtube)||void 0===t?void 0:t.channelLink}),(0,i.jsxs)("div",{className:"flex items-center",children:[H&&(0,i.jsx)(j.Z,{}),!H&&!R.me&&(null==k?void 0:null===(n=k.youtube)||void 0===n?void 0:n.userid)&&(0,i.jsx)(g.Z.Subscribe,{subscribeLink:(null==k?void 0:null===(r=k.youtube)||void 0===r?void 0:r.channelLink)?"".concat(null===(f=k.youtube)||void 0===f?void 0:f.channelLink,"?sub_confirmation=1"):"",onClick:()=>c.TV.integrationSectionClickTracker({primaryUser:R.me,integrationName:U.dbname,username:R.profileHandle})}),R.me&&(0,i.jsx)(g.Z.DeleteIntegration,{setShowRemove:()=>B(!0)})]})]}),J&&C&&(0,i.jsx)(u.Z.ErrorText,{className:"mt-1",children:J}),!H&&((null===(I=k.youtube)||void 0===I?void 0:null===(b=I.videos)||void 0===b?void 0:b.length)===0||!(null===(y=k.youtube)||void 0===y?void 0:y.videos))&&(0,i.jsx)(m.Z.NoData,{text:"".concat(R.firstName," hasn't added any video yet.")}),(0,i.jsx)("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:null==k?void 0:null===(S=k.youtube)||void 0===S?void 0:null===(T=S.videos)||void 0===T?void 0:T.map((e,l)=>{if(l<G){let l={...e},t=V.Z.getYoutubeEmbedLink(l.link);if(!(null==t?void 0:t.videoId))return null;let a=V.Z.youTubeEmbedPlaceholder({videoId:t.videoId});return l.imageLink=V.Z.getYoutubeVideoThumbnail(t.videoId),(0,i.jsx)(g.Z.CardWrapper,{integrationName:z,primaryUser:R.me,username:R.profileHandle,className:"h-full",children:(0,i.jsxs)("div",{className:"flex flex-col h-full",children:[(0,i.jsx)("div",{children:(0,i.jsx)("div",{className:"w-full flex-1 h-40",children:(0,i.jsx)("iframe",{src:null==l?void 0:l.link,title:null==l?void 0:l.title,width:"100%",height:"100%",allowFullScreen:!0,srcDoc:a})})}),(0,i.jsxs)("div",{className:"p-4 h-full flex flex-col justify-between",children:[(0,i.jsx)("h4",{className:"text-gray-gray9 text-sm font-semibold mb-2 paragraph-clamp",children:null==l?void 0:l.title}),(0,i.jsx)(g.Z.CardFooter,{publishedAt:(null==l?void 0:l.publicationDate)||"",article:l,handleShare:()=>X(l),isLoggedIn:Z})]})]})},l.link)}return null})}),!H&&(null==k?void 0:null===(w=k.youtube)||void 0===w?void 0:null===(A=w.videos)||void 0===A?void 0:A.length)>h.CARD_COUNT.MIN_LIMIT&&(0,i.jsx)(s.ZP.ShowMoreLargeBtn,{onClick:()=>(0,N.Q$)(G,F),showMore:G!==h.CARD_COUNT.MAX_LIMIT})]}),P&&(0,i.jsx)(d.Z,{showModal:P,setShowModal:B,deleteText:"Are you sure you want to remove this section from portfolio?",confirm:()=>$()})]})},Y=h.default.INTEGRATION_NAMES_DB.productHunt,Q=e=>{var l,t,n,r,f,I,b,y,S,T,w,A;let{data:R,username:D,userid:M,isPrimaryUser:_}=e,Z=(0,o.I0)(),{integrationData:C}=(0,o.v9)(e=>e.SecondaryUserData),{deleteError:O,handleDeleteIntegration:k}=(0,x.Z)(Y),L=h.default.INTEGRATION_SHARING_INFO[Y],[E,U]=(0,a.useState)(!1),[P,B]=(0,a.useState)(h.CARD_COUNT.MIN_LIMIT),[G,F]=(0,a.useState)(),[H,W]=(0,a.useState)(),V=async()=>{if(M)try{F(!0);let e=await c.vJ.getProductHunt(M);Z(p.OV.updateIntegrationData({productHunt:{userid:M,data:null==e?void 0:e.data.data,user:D}}))}catch(i){var e,l,t;W((null==i?void 0:null===(e=i.response)||void 0===e?void 0:null===(l=e.data)||void 0===l?void 0:null===(t=l.error)||void 0===t?void 0:t.message)||v.Z.GLOBAL.wrong),Z(p.OV.updateIntegrationData({productHunt:{userid:M,user:D}}))}finally{F(!1)}},z=async()=>{F(!0),await k(),O&&W(O),F(!1)};return(0,a.useEffect)(()=>{var e,l;return(null==C?void 0:null===(e=C.productHunt)||void 0===e?void 0:e.userid)&&M===(null==C?void 0:null===(l=C.productHunt)||void 0===l?void 0:l.userid)||V(),()=>{F(),W(),U(!1),B(h.CARD_COUNT.MIN_LIMIT)}},[M]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:L.name,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(g.Z.Logo,{dbname:L.dbname,type:"Product Hunt",isAuthenticated:!0,integrationURL:"https://www.producthunt.com/@".concat(D)}),(0,i.jsxs)("div",{className:"flex items-center",children:[G&&(0,i.jsx)(j.Z,{}),!G&&R.me&&(0,i.jsx)(g.Z.DeleteIntegration,{setShowRemove:()=>U(!0)})]})]}),H&&_&&(0,i.jsx)(u.y,{className:"mt-1",children:H}),!G&&(null==C?void 0:null===(l=C.productHunt)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:null===(n=t.products)||void 0===n?void 0:n.length)===0&&(0,i.jsx)(m.Z.NoData,{text:"".concat(null==R?void 0:R.firstName," hasn't added any product yet.")}),!G&&(null==C?void 0:null===(r=C.productHunt)||void 0===r?void 0:null===(f=r.data)||void 0===f?void 0:null===(I=f.products)||void 0===I?void 0:I.length)>0&&(0,i.jsx)("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:null==C?void 0:null===(b=C.productHunt)||void 0===b?void 0:null===(y=b.data)||void 0===y?void 0:null===(S=y.products)||void 0===S?void 0:S.map((e,l)=>l<P?(0,i.jsx)(g.Z.CardWrapper,{integrationName:Y,primaryUser:R.me,username:R.profileHandle,href:(0,N.zs)(e.url,{addRef:!0}),className:"flex flex-col h-full w-full outline-none",padding:"",children:(0,i.jsx)("article",{className:"p-2",children:(0,i.jsxs)("div",{className:"flex items-center justify-start",children:[(0,i.jsx)("img",{src:(null==e?void 0:e.thumbnail)||h.CDNImage.emptyPortfolio,alt:null==e?void 0:e.name,className:"h-16 w-16 rounded bg-cover bg-center"}),(0,i.jsxs)("div",{className:"pl-2 flex flex-col w-full",children:[(0,i.jsx)(u.Z.SemiBoldText,{sm:!0,className:"paragraph-clamp1",children:null==e?void 0:e.name}),(0,i.jsx)("p",{className:"text-xs text-light mb-2 w-full paragraph-clamp1",children:null==e?void 0:e.tagline}),(0,i.jsxs)("div",{className:"w-fit h-5 flex items-center",children:[(0,i.jsx)("span",{className:"text-orange",children:"▲"}),(0,i.jsx)("span",{className:"ml-1 text-xxs",children:null==e?void 0:e.votes})]})]})]})})},"".concat(null==e?void 0:e.name,"-").concat(null==e?void 0:e.id)):null)}),!G&&(null==C?void 0:null===(T=C.productHunt)||void 0===T?void 0:null===(w=T.data)||void 0===w?void 0:null===(A=w.products)||void 0===A?void 0:A.length)>h.CARD_COUNT.MIN_LIMIT&&(0,i.jsx)(s.ZP.ShowMoreLargeBtn,{onClick:()=>(0,N.Q$)(P,B),showMore:P!==h.CARD_COUNT.MAX_LIMIT})]}),E&&(0,i.jsx)(d.Z,{showModal:E,setShowModal:U,deleteText:"Are you sure you want to remove this section from portfolio?",confirm:()=>z()})]})},$=h.default.INTEGRATION_NAMES_DB.rss,X=e=>{var l,t,n,r,f,I,b,y;let{data:S,username:T,userid:w,isPrimaryUser:A}=e,R=(0,o.I0)(),{integrationData:D}=(0,o.v9)(e=>e.SecondaryUserData),{deleteError:M,handleDeleteIntegration:_}=(0,x.Z)($),Z=h.default.INTEGRATION_SHARING_INFO[$],[C,O]=(0,a.useState)(!1),[k,L]=(0,a.useState)(h.CARD_COUNT.MIN_LIMIT),[E,U]=(0,a.useState)(),[P,B]=(0,a.useState)(),G=async()=>{if(w)try{U(!0);let e=await c.vJ.getRSS(w),l=(0,N.R0)(e.data.data,"publicationDate");R(p.OV.updateIntegrationData({rss:{userid:w,data:l,user:T}}))}catch(i){var e,l,t;B((null==i?void 0:null===(e=i.response)||void 0===e?void 0:null===(l=e.data)||void 0===l?void 0:null===(t=l.error)||void 0===t?void 0:t.message)||v.Z.GLOBAL.wrong),R(p.OV.updateIntegrationData({rss:{userid:w,user:T}}))}finally{U(!1)}},F=async()=>{U(!0),await _(),M&&B(M),U(!1)};return(0,a.useEffect)(()=>{var e,l;return(null==D?void 0:null===(e=D.rss)||void 0===e?void 0:e.userid)&&w===(null==D?void 0:null===(l=D.rss)||void 0===l?void 0:l.userid)||G(),()=>{U(),B(),O(!1),L(4)}},[w]),P&&!(A||(null==S?void 0:S.me))?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:Z.name,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(g.Z.Logo,{dbname:Z.dbname,type:Z.name,integrationURL:(null==T?void 0:T.includes("rss"))?T.replace("rss",""):T}),(0,i.jsxs)("div",{className:"flex items-center",children:[E&&(0,i.jsx)(j.Z,{}),!E&&S.me&&(0,i.jsx)(g.Z.DeleteIntegration,{setShowRemove:()=>O(!0)})]})]}),P&&A&&(0,i.jsx)(u.y,{className:"mt-4",children:P}),!E&&(null===(l=D.rss)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:t.length)===0&&(0,i.jsx)(m.Z.NoData,{text:"".concat(S.firstName," hasn't published any articles yet.")}),!E&&(null==D?void 0:null===(n=D.rss)||void 0===n?void 0:null===(r=n.data)||void 0===r?void 0:r.length)>0&&(0,i.jsx)("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:null==D?void 0:null===(f=D.rss)||void 0===f?void 0:null===(I=f.data)||void 0===I?void 0:I.map((e,l)=>l<k?(0,i.jsx)(g.Z.CardWrapper,{integrationName:$,username:S.profileHandle,primaryUser:S.me,href:e.link,className:"h-full flex flex-col justify-between",padding:"",children:(0,i.jsx)(g.Z.CardContent,{image:null==e?void 0:e.imageLink,title:null==e?void 0:e.title})},"".concat(e.title,"-rss-article")):null)}),(null==D?void 0:null===(b=D.rss)||void 0===b?void 0:null===(y=b.data)||void 0===y?void 0:y.length)>h.CARD_COUNT.MIN_LIMIT&&(0,i.jsx)(s.ZP.ShowMoreLargeBtn,{onClick:()=>(0,N.Q$)(k,L),showMore:k!==h.CARD_COUNT.MAX_LIMIT})]}),C&&(0,i.jsx)(d.Z,{showModal:C,setShowModal:O,deleteText:"Are you sure you want to remove this section from portfolio?",confirm:()=>F()})]})};var K=t(29009),q=t(98687),ee=t(3023),el=t(75358),et=t(14195),ei=t(26050),ea=t(8081),eo=t(56880),en=t(88417);let es=h.default.INTEGRATION_NAMES_DB.codeforces,ed=e=>{var l,t,n,s,r,p,N,f,I;let{data:b,username:y,userid:S,isPrimaryUser:T}=e,{integrationData:w}=(0,o.v9)(e=>e.SecondaryUserData),{deleteError:A,handleDeleteIntegration:R}=(0,x.Z)(es),D=h.default.INTEGRATION_SHARING_INFO[es],[M,_]=(0,a.useState)(),[Z,C]=(0,a.useState)(!1),[O,k]=(0,a.useState)(),[L,E]=(0,a.useState)(),U=async()=>{if(S)try{k(!0);let e=await c.vJ.getCodeForcesRatings(S);_(e.data.data)}catch(i){var e,l,t;E((null==i?void 0:null===(e=i.response)||void 0===e?void 0:null===(l=e.data)||void 0===l?void 0:null===(t=l.error)||void 0===t?void 0:t.message)||v.Z.GLOBAL.wrong)}finally{k(!1)}},P=async()=>{k(!0),await R(),A&&E(A),k(!1)};return(0,a.useEffect)(()=>{var e,l;return(null==w?void 0:null===(e=w.codeforces)||void 0===e?void 0:e.userid)&&S===(null==w?void 0:null===(l=w.codeforces)||void 0===l?void 0:l.userid)||U(),()=>{k(),E(),C(!1)}},[S]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:D.name,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(g.Z.Logo,{integrationURL:"https://codeforces.com/profile/".concat(y),dbname:D.dbname,type:(null==M?void 0:null===(l=M.profile)||void 0===l?void 0:l.handle)||D.name}),(0,i.jsxs)("div",{className:"flex items-center",children:[O&&(0,i.jsx)(j.Z,{}),!O&&b.me&&(0,i.jsx)(g.Z.DeleteIntegration,{setShowRemove:()=>C(!0)})]})]}),(null==M?void 0:null===(t=M.profile)||void 0===t?void 0:t.handle)&&(null==M?void 0:null===(n=M.profile)||void 0===n?void 0:n.rating)?(0,i.jsx)("div",{className:"my-6",children:(0,i.jsxs)(u.Z.NormalText,{xs:!0,children:["Latest Contest Rating:"," ",(0,i.jsx)("span",{className:"font-semibold",children:null==M?void 0:null===(s=M.profile)||void 0===s?void 0:s.rating})," ","(max."," ",(0,i.jsxs)("span",{className:"font-semibold",children:[null==M?void 0:null===(r=M.profile)||void 0===r?void 0:r.maxRank,", ",null==M?void 0:null===(p=M.profile)||void 0===p?void 0:p.maxRating]}),")"]})}):null,L&&T&&(0,i.jsx)(u.y,{className:"mt-1",children:L}),!O&&(null==M?void 0:null===(N=M.ratings)||void 0===N?void 0:N.length)===0&&(0,i.jsx)(m.Z.NoData,{text:"Could not fetch ratings data from CodeForces"}),!O&&(null==M?void 0:null===(f=M.ratings)||void 0===f?void 0:f.length)>0&&(0,i.jsx)("div",{className:"flex mt-6 -ml-10",children:(0,i.jsx)(er,{ratingsData:null==M?void 0:M.ratings,maxRating:null==M?void 0:null===(I=M.profile)||void 0===I?void 0:I.maxRating})})]}),Z&&(0,i.jsx)(d.Z,{showModal:Z,setShowModal:C,deleteText:"Are you sure you want to remove this section from portfolio?",confirm:()=>P()})]})},er=e=>{let{ratingsData:l,maxRating:t}=e,a=[{minRating:0,maxRating:1199,color:"#C1C1C1"},{minRating:1200,maxRating:1399,color:"#75FF5C"},{minRating:1400,maxRating:1599,color:"#6FD8AC"},{minRating:1600,maxRating:1899,color:"#9898FF"},{minRating:1900,maxRating:2099,color:"#F76DFF"},{minRating:2100,maxRating:2299,color:"#FCC072"},{minRating:2300,maxRating:2399,color:"#FBAC3D"},{minRating:2400,maxRating:2599,color:"#F75E63"},{minRating:2600,maxRating:2999,color:"#F61426"},{minRating:3e3,maxRating:4e3,color:"#940000"}],o=4e3;a.forEach((e,l)=>{t>=e.minRating&&t<=e.maxRating&&t<2400&&(o=a[l+2].maxRating)});let n=l.map(e=>({...e,parsedDate:(0,en.Z)(new Date(1e3*e.ratingUpdateTimeSeconds),"MMM yyyy")}));return(0,i.jsx)(K.h,{width:"100%",height:236,children:(0,i.jsxs)(q.w,{data:n,margin:{top:20,right:30,left:20,bottom:5},children:[(0,i.jsx)(ee.K,{dataKey:"parsedDate",interval:"equidistantPreserveStart"}),(0,i.jsx)(el.B,{domain:[800,o],ticks:a.map(e=>o>e.minRating?e.minRating:null).filter(e=>e)}),(0,i.jsx)(et.q,{stroke:"none"}),(0,i.jsx)(ei.u,{content:(0,i.jsx)(eu,{}),wrapperStyle:{outline:"none"}}),a.map(e=>(0,i.jsx)(ea.z,{y1:e.minRating,y2:e.maxRating,fill:e.color,fillOpacity:.7,stroke:"#F6F8FA",strokeWidth:.25,ifOverflow:"hidden"},e.color)),(0,i.jsx)(eo.x,{type:"monotone",dataKey:"newRating",stroke:"#edc23f",strokeWidth:2.5,dot:{r:3,fill:"white"}})]})})},eu=e=>{let{active:l,payload:t}=e;return l&&t&&t.length?(0,i.jsxs)("div",{className:"bg-white border border-gray-gray3 shadow-xl p-4 rounded-xl text-xs",children:[(0,i.jsx)("p",{className:"label",children:"= ".concat(t[0].payload.newRating," +(").concat(t[0].payload.newRating-t[0].payload.oldRating,")")}),(0,i.jsx)("p",{className:"font-semibold",children:t[0].payload.contestName}),(0,i.jsx)("p",{className:"font-semibold",children:"Rank: ".concat(t[0].payload.rank)}),(0,i.jsx)("p",{className:"font-semibold",children:"Date: ".concat((0,en.Z)(new Date(1e3*t[0].payload.ratingUpdateTimeSeconds),"dd/MM/yyyy"))})]}):null};var ec=t(84093),ev=t.n(ec),em=t(79538),eh=t(94826);let eg=h.default.INTEGRATION_NAMES_DB.adplist,ex=e=>"https://adplist.org/mentors/".concat(e,"?utm_source=peerlist&ref=peerlist"),ep=e=>{var l,t,n,r,N,f,I,b,y,S;let{data:T,username:w,userId:A,isPrimayUser:R}=e,D=h.default.INTEGRATION_SHARING_INFO[eg],M=(0,o.I0)(),{integrationData:_}=(0,o.v9)(e=>e.SecondaryUserData),{deleteError:Z,handleDeleteIntegration:C}=(0,x.Z)(eg),[O,k]=(0,a.useState)(!1),[L,E]=(0,a.useState)(!1),[U,B]=(0,a.useState)(!1),G=async()=>{E(!0),await C(),Z&&B(Z),E(!1)},F=async()=>{var e,l,t,i;if(A)try{E(!0);let l=await c.vJ.getADPList(A);M(p.OV.updateIntegrationData({adplist:{userId:A,...null==l?void 0:null===(e=l.data)||void 0===e?void 0:e.data,user:w}}))}catch(e){B((null==e?void 0:null===(l=e.response)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:null===(i=t.error)||void 0===i?void 0:i.message)||v.Z.GLOBAL.wrong),M(p.OV.updateIntegrationData({hashnode:{userId:A,user:w}}))}finally{E(!1)}};return(0,a.useEffect)(()=>{var e,l;return(null==_?void 0:null===(e=_.adplist)||void 0===e?void 0:e.userId)&&(null==_?void 0:null===(l=_.adplist)||void 0===l?void 0:l.userId)===A||F(),()=>{E(!1),B(),k(!1)}},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:D.name,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,i.jsx)(g.Z.Logo,{integrationURL:ex(w),dbname:D.dbname,type:D.name}),(0,i.jsxs)("div",{className:"flex items-center gap-x-2",children:[L&&(0,i.jsx)(j.Z,{}),!L&&w?(0,i.jsxs)(s.ZP.CarbonButton,{as:"a",small:!0,target:"_blank",rel:"noopener noreferrer",href:ex(w),onClick:()=>em.Z.capture(eh.Z.ADPLIST_BOOK_SESSION),className:"group",children:["Book Session"," ",(0,i.jsx)("span",{className:"rotate-45 -mr-1 group-hover:-translate-y-0.5 group-hover:translate-x-0.5 transition-all ease-in-out",children:(0,i.jsx)(P.ZP.ArrowUp,{})})]}):null,!L&&T.me&&(0,i.jsx)(g.Z.DeleteIntegration,{setShowRemove:()=>k(!0)})]})]}),U&&R?(0,i.jsx)(u.Z.ErrorText,{className:"mt-1",children:U}):null,L||(null==_?void 0:_.adplist)?null:(0,i.jsx)(m.Z.NoData,{text:"Could not fetch ADPList profile."}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"flex items-center  flex-wrap gap-6 mb-6",children:[(null==_?void 0:null===(l=_.adplist)||void 0===l?void 0:l.meetingsMinutes)?(0,i.jsx)(ej,{title:"".concat(null==_?void 0:null===(t=_.adplist)||void 0===t?void 0:t.meetingsMinutes," mins"),subTitle:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"hidden sm:inline",children:"Total"})," Mentoring Time"]}),icon:(0,i.jsx)(P.ZP.Rocket,{color:ev().blue.dark}),iconBgColor:"bg-blue-lighter"}):null,(null==_?void 0:null===(n=_.adplist)||void 0===n?void 0:n.meetingsCompleted)?(0,i.jsx)(ej,{title:"".concat(null==_?void 0:null===(r=_.adplist)||void 0===r?void 0:r.meetingsCompleted),subTitle:"Sessions Completed",iconBgColor:"bg-red-light",icon:(0,i.jsx)(P.ZP.Sparks,{color:ev().red.DEFAULT})}):null,(null==_?void 0:null===(N=_.adplist)||void 0===N?void 0:N.averageAttendance)?(0,i.jsx)(ej,{title:"".concat(null==_?void 0:null===(f=_.adplist)||void 0===f?void 0:f.averageAttendance,"%"),subTitle:"Avg Attendence",iconBgColor:"bg-orange-light",icon:(0,i.jsx)(P.ZP.Calendar,{color:ev().orange.DEFAULT})}):null]}),(null==_?void 0:null===(I=_.adplist)||void 0===I?void 0:null===(b=I.mostDiscussedTopics)||void 0===b?void 0:b.length)>0?(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"mb-4",children:(0,i.jsx)(u.Z.NormalText,{xs:!0,textColor:"text-gray-gray7",children:"Topics discussed during sessions"})}),(0,i.jsx)("div",{className:"flex items-center flex-wrap gap-2",children:null==_?void 0:null===(y=_.adplist)||void 0===y?void 0:null===(S=y.mostDiscussedTopics)||void 0===S?void 0:S.map((e,l)=>{let t=e.length>=33?"".concat(e.slice(0,30),"..."):e;return(0,i.jsx)("div",{className:"border rounded-lg px-2 py-1 bg-white border-primaryBorder cursor-default",children:(0,i.jsx)(u.Z.NormalText,{xs:!0,textColor:"text-primary",children:t})},"".concat(e,"-").concat(l+2))})})]}):null]})]}),O&&(0,i.jsx)(d.Z,{showModal:O,setShowModal:k,deleteText:"Are you sure you want to remove this section from portfolio?",confirm:()=>G()})]})},ej=e=>{let{icon:l,title:t,subTitle:a,iconBgColor:o=""}=e;return(0,i.jsxs)("div",{className:"flex items-center gap-x-2 flex-1",children:[(0,i.jsx)("div",{className:"flex items-center justify-center w-10 h-10 rounded-2xl ".concat(o),children:l}),(0,i.jsxs)("div",{children:[(0,i.jsx)(u.Z.SemiBoldText,{sm:!0,children:t}),(0,i.jsx)(u.Z.NormalText,{xs:!0,textColor:"text-gray-gray7",children:a})]})]})},eN={Devto:I,Dribbble:y,EmptySections:S.Z,Github:T.Z,Gumroad:R,Hashnode:function(e){var l,t,n,r,f,I,b,y,S,T,w;let{data:A,username:R,userid:M,isPrimaryUser:_}=e,Z=(0,o.I0)(),{integrationData:C}=(0,o.v9)(e=>e.SecondaryUserData),{deleteError:O,handleDeleteIntegration:k}=(0,x.Z)(D),L=h.default.INTEGRATION_SHARING_INFO[D],[E,U]=(0,a.useState)(!1),[P,B]=(0,a.useState)(h.CARD_COUNT.MIN_LIMIT),[G,F]=(0,a.useState)(),[H,W]=(0,a.useState)(),V=async()=>{var e,l,t,i,a,o,n,s;if(M)try{F(!0);let o=await c.vJ.getHashnode(M),n=(null==o?void 0:null===(e=o.data)||void 0===e?void 0:null===(l=e.data)||void 0===l?void 0:null===(t=l.posts)||void 0===t?void 0:t.map(e=>{var l;return{...e,coverImage:null==e?void 0:null===(l=e.coverImage)||void 0===l?void 0:l.url,timestamp:(null==e?void 0:e.updatedAt)||(null==e?void 0:e.publishedAt)}}))||[],s={posts:(0,N.R0)(n,"timestamp"),blogUrl:(null==o?void 0:null===(i=o.data)||void 0===i?void 0:null===(a=i.data)||void 0===a?void 0:a.blogUrl)||"www.hashnode.com"};Z(p.OV.updateIntegrationData({hashnode:{userid:M,...s,user:R}}))}catch(e){W((null==e?void 0:null===(o=e.response)||void 0===o?void 0:null===(n=o.data)||void 0===n?void 0:null===(s=n.error)||void 0===s?void 0:s.message)||v.Z.GLOBAL.wrong),Z(p.OV.updateIntegrationData({hashnode:{userid:M,user:R}}))}finally{F(!1)}},z=async()=>{F(!0),await k(),O&&W(O),F(!1)},J=null==C?void 0:null===(l=C.hashnode)||void 0===l?void 0:l.blogUrl;return(0,a.useEffect)(()=>{var e,l;return(null==C?void 0:null===(e=C.hashnode)||void 0===e?void 0:e.userid)&&M===(null==C?void 0:null===(l=C.hashnode)||void 0===l?void 0:l.userid)||V(),()=>{F(),W(),U(!1),B(4)}},[M]),(null===(t=C.hashnode)||void 0===t?void 0:null===(n=t.posts)||void 0===n?void 0:n.length)||_||(null==A?void 0:A.me)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:L.name,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(g.Z.Logo,{type:L.name,dbname:L.dbname,integrationURL:J}),(0,i.jsxs)("div",{className:"flex items-center",children:[G&&(0,i.jsx)(j.Z,{}),!G&&A.me&&(0,i.jsx)(g.Z.DeleteIntegration,{setShowRemove:()=>U(!0)})]})]}),H&&_&&(0,i.jsx)(u.y,{className:"mt-1",children:H}),!G&&(null===(r=C.hashnode)||void 0===r?void 0:null===(f=r.posts)||void 0===f?void 0:f.length)===0&&(0,i.jsx)(m.Z.NoData,{text:"".concat(A.firstName," hasn't published any articles yet.")}),!G&&(null===(I=C.hashnode)||void 0===I?void 0:null===(b=I.posts)||void 0===b?void 0:b.length)>0&&(0,i.jsx)("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:null===(y=C.hashnode)||void 0===y?void 0:null===(S=y.posts)||void 0===S?void 0:S.map((e,l)=>l<P?(0,i.jsx)(g.Z.CardWrapper,{primaryUser:A.me,integrationName:D,username:null==A?void 0:A.profileHandle,href:null==e?void 0:e.url,className:"flex flex-col justify-between h-full",padding:"",children:(0,i.jsx)(g.Z.CardContent,{title:null==e?void 0:e.title,image:null==e?void 0:e.coverImage})},"".concat(e.title,"-hashnode-article")):null)}),!G&&(null===(T=C.hashnode)||void 0===T?void 0:null===(w=T.hashnode)||void 0===w?void 0:w.length)>h.CARD_COUNT.MIN_LIMIT&&(0,i.jsx)(s.ZP.ShowMoreLargeBtn,{onClick:()=>(0,N.Q$)(P,B),showMore:P!==h.CARD_COUNT.MAX_LIMIT})]}),E&&(0,i.jsx)(d.Z,{showModal:E,setShowModal:U,deleteText:"Are you sure you want to remove this section from portfolio?",confirm:()=>z()})]}):null},Medium:_,Projects:function(e){let{data:l,createShareWork:t,projectData:n,isLoggedIn:d,openInNewTab:c=!1}=e,v=(0,O.useRouter)(),{primaryUserData:m}=(0,o.v9)(e=>e.PrimaryUserData),[x,p]=(0,a.useState)(h.CARD_COUNT.MIN_LIMIT),[j,f]=(0,a.useState)(!1),I=e=>{let l=N.ZP.generateProjectShareData(e);t(l)},b=N.ZP.getProjectsOrder(l.projectsOrder,n),y=(e,t)=>m&&(null==m?void 0:m.id)&&(null==l?void 0:l.id)&&!(null==m?void 0:m.published)&&N.ZP.doIHaveProjectEditAccess({myId:m.id,projectDetails:e})?h.APP_PATHS.addProject(null==e?void 0:e.id):h.APP_PATHS.getURL({path:null==e?void 0:e.projectURL,absolute:(null==l?void 0:l.isCustomDomain)||t});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{id:B,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(k.Z.ProjectsLogo,{}),(0,i.jsx)(u.Z.SemiBoldText,{className:"ml-2",children:"My Projects"})]}),l.me&&(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(s.ZP.CarbonLineButton,{circular:!0,small:!0,className:"mr-4 focus:border-green-light",onClick:()=>f(!0),children:(0,i.jsx)(P.ew,{size:18})}),(0,i.jsxs)(s.ZP.CarbonButton,{small:!0,onClick:()=>v.push(h.APP_PATHS.addProject()),"aria-label":"Add more project",className:"flex items-center focus:border-green-light",children:[(0,i.jsx)(P.ZP.Plus,{size:16,className:"mr-1"}),"New Project"]})]})]}),(0,i.jsxs)("div",{className:"mt-6",children:[(0,i.jsx)("div",{className:"grid md:grid-cols-2 gap-4 mt-6",children:b&&b.map((e,t)=>{if(t<x){var a;let t="#".concat((null==e?void 0:e.rankMonthly)||(null==e?void 0:e.rankWeekly)," Project of the ").concat((null==e?void 0:e.rankWeekly)?"week":"month"," -  ").concat(N.ZP.getProjectFeaturedOnMonthYear(null==e?void 0:e.featuredOn));return(0,i.jsxs)(g.Z.CardWrapper,{integrationName:B,primaryUser:l.me,username:l.profileHandle,href:y(e,c),className:"relative flex flex-col justify-between h-full",padding:"",openInNewTab:c,noFollowLink:!1,children:[((null==e?void 0:e.rankWeekly)||(null==e?void 0:e.rankMonthly))&&(null==e?void 0:e.featuredOn)&&(0,i.jsxs)("div",{className:"absolute top-0 right-2 z-[5]","data-tip":!0,"data-effect":"solid","data-for":"potm",children:[(0,i.jsx)(C(),{src:N.ZP.getProjectMedal({rankWeekly:null==e?void 0:e.rankWeekly,rankMonthly:null==e?void 0:e.rankMonthly}),unoptimized:!0,width:52,height:100,className:"drop-shadow-[0px_4px_16px_rgba(33,33,33,0.15)]",alt:t}),(0,i.jsx)(E.Z,{id:"potm",text:t})]}),(null==e?void 0:e.featuredOn)&&!((null==e?void 0:e.rankMonthly)||(null==e?void 0:e.rankWeekly))&&(0,i.jsx)("div",{className:"absolute z-[5] top-0 right-0",children:(0,i.jsx)(U.Z.NominationBadge,{featuredOn:null==e?void 0:e.featuredOn})}),(null==e?void 0:e.hackathonInfo)&&!(null==e?void 0:e.featuredOn)&&(0,i.jsx)("div",{className:"absolute z-[5] top-0 right-0",children:(0,i.jsx)(U.Z.NominationBadge,{featuredOn:null==e?void 0:e.featuredOn,hackathon:null==e?void 0:null===(a=e.hackathonInfo)||void 0===a?void 0:a.slug})}),(0,i.jsx)(g.Z.CardContent,{image:(null==e?void 0:e.images)?"".concat(e.images[0]):"",title:null==e?void 0:e.title,children:(0,i.jsx)(G,{project:e,isLoggedIn:d,primaryUserData:m,handleShareOnScroll:I})})]},"".concat(e.id,"-project"))}return null})}),n&&n.length>h.CARD_COUNT.MIN_LIMIT&&(0,i.jsx)(s.ZP.ShowMoreLargeBtn,{onClick:()=>(0,N.Fg)(n,x,p,h.CARD_COUNT.MIN_LIMIT),moreText:"Show All",showMore:(null==n?void 0:n.length)>x})]})]}),j&&(0,i.jsx)(r.Z.ManageProjects,{showModal:j,setShowModal:f})]})},Substack:H,YouTube:J,ProductHunt:Q,RSS:X,CodeForces:ed,ADPList:ep};var ef=t(29949);let eI=e=>{let{children:l}=e;return(0,i.jsx)("div",{className:"mb-20",children:l})};var eb=function(e){var l,t;let{data:u,openProjectInNewTab:c=!1}=e,v=(0,o.I0)(),m=N.ZP.isUserLoggedIn(),{primaryUserData:g}=(0,o.v9)(e=>e.PrimaryUserData),{youtubeError:x}=(0,o.v9)(e=>e.CommonAppData),[p,j]=(0,a.useState)(!1),[f,I]=(0,a.useState)(),[b,y]=(0,a.useState)(!1),S=e=>{j(!0),I(e),g.published||v(n.YR.toggleShowPublishProfileModal("Publish profile \uD83D\uDE80"))};(0,a.useEffect)(()=>()=>{j(!1),I(),y(!1)},[JSON.stringify(u)]);let T=u.me&&Object.keys(g).length>0?g:u,w=T.integrations?Object.keys(T.integrations).length:0;w=(null==T?void 0:null===(l=T.projects)||void 0===l?void 0:l.length)>0?w+1:w;let A=w>0||(null==T?void 0:null===(t=T.projects)||void 0===t?void 0:t.length)>0?function(e){let l={};if(null==e?void 0:e.integrationsOrder){let t=Object.keys(e.integrations);e.projects&&(null==e?void 0:e.projects.length)>0&&t.push("projects");let i=e.integrationsOrder.map(e=>e.name),a=t.filter(e=>!i.find(l=>e===l)),o=[...i,...a];o.forEach(t=>{if(t===h.default.INTEGRATION_NAMES_DB.projects){l[t]=!0;return}e.integrations[t]&&(l[t]=e.integrations[t])})}else l=e.integrations,e.projects&&(null==e?void 0:e.projects.length)>0&&(l={...l,[h.default.INTEGRATION_NAMES_DB.projects]:!0});return l}(T):{},R=u.me&&w>1,D=Object.keys(h.default.INTEGRATION_NAMES_DB).filter(e=>{var l;return(e!==h.default.INTEGRATION_NAMES_DB.projects||T.projects&&(null==T?void 0:null===(l=T.projects)||void 0===l?void 0:l.length)!==0)&&(A[e]||e===h.default.INTEGRATION_NAMES_DB.projects)?null:e}),M=(null==g?void 0:g.id)===u.id;return(0,i.jsxs)("div",{children:[u.me&&(0,i.jsx)(eN.EmptySections,{userId:u.id,emptyIntegrations:D,data:T}),R&&(0,i.jsx)("div",{className:"mb-8 flex justify-end",children:(0,i.jsxs)(s.oS,{small:!0,onClick:()=>y(!0),className:"focus:border-green-light",children:[(0,i.jsx)(P.ZP.Reorder,{className:"mr-1",size:16}),"Reorder Work"]})}),(0,i.jsx)("div",{className:"".concat(u.me?"mt-8":"mt-0"),children:Object.keys(A).map(e=>{var l,t,a,o;switch(e){case h.default.INTEGRATION_NAMES_DB.github:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.Github,{username:T.integrations.github.username,userid:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"".concat(e,"-section"));case h.default.INTEGRATION_NAMES_DB.medium:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.Medium,{username:T.integrations.medium.username,userid:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"".concat(e,"-section"));case h.default.INTEGRATION_NAMES_DB.dribbble:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.Dribbble,{username:T.integrations.dribbble.username,userid:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"".concat(e,"-section"));case h.default.INTEGRATION_NAMES_DB.codeforces:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.CodeForces,{username:T.integrations.codeforces.username,userid:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"".concat(e,"-section"));case h.default.INTEGRATION_NAMES_DB.hashnode:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.Hashnode,{username:T.integrations.hashnode.username,userid:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"".concat(e,"-section"));case h.default.INTEGRATION_NAMES_DB.devto:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.Devto,{username:T.integrations.devto.username,userid:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"".concat(e,"-section"));case h.default.INTEGRATION_NAMES_DB.substack:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.Substack,{username:T.integrations.substack.username,userid:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"".concat(e,"-section"));case h.default.INTEGRATION_NAMES_DB.youtube:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.YouTube,{username:T.integrations.youtube.username,userid:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"".concat(e,"-section"));case h.default.INTEGRATION_NAMES_DB.gumroad:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.Gumroad,{username:T.integrations.gumroad.username,userid:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"".concat(e,"-section"));case h.default.INTEGRATION_NAMES_DB.productHunt:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.ProductHunt,{username:T.integrations.productHunt.username,userid:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"".concat(e,"-section"));case h.default.INTEGRATION_NAMES_DB.rss:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.RSS,{username:T.integrations.rss.username,userid:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"".concat(e,"-section"));case h.default.INTEGRATION_NAMES_DB.projects:return(0,i.jsx)("div",{children:(null==u?void 0:null===(l=u.projects)||void 0===l?void 0:l.length)>0&&(0,i.jsx)(eI,{children:(0,i.jsx)(eN.Projects,{username:T.username,userid:T.id,data:T,createShareWork:S,projectData:null==T?void 0:T.projects,isLoggedIn:m,openInNewTab:c})})},"projects-section");case h.default.INTEGRATION_NAMES_DB.adplist:return(0,i.jsx)(eI,{children:(0,i.jsx)(eN.ADPList,{username:(null==T?void 0:null===(t=T.integrations)||void 0===t?void 0:null===(a=t.adplist)||void 0===a?void 0:a.username)||(null==T?void 0:null===(o=T.integrations)||void 0===o?void 0:o.adplist),userId:null==u?void 0:u.id,data:T,createShareWork:S,isLoggedIn:m,isPrimaryUser:M})},"adplist-section")}return null})}),p&&g.published&&(0,i.jsx)(ef.Z.CreatePostWithContext,{showModal:p,setShowModal:j,shareData:f,fromShareModal:!0}),b&&(0,i.jsx)(r.Z.ReorderSections,{setReorder:y,integrations:A}),x&&(0,i.jsx)(d.n,{showModal:x,infoText:"Cannot integrate YouTube, either channel or videos are not available.",setShowModal:()=>v(n.YR.toggleYoutubError(!1)),onBtnClick:()=>v(n.YR.toggleYoutubError(!1))})]})}}}]);