1import{r as l,j as o,C as K,a as X}from"./playbook-BN4J3fpY.js";import{l as ee,A as te,p as re,g as ie,H as oe,S as f}from"./TimelineItem-Ch73P0Dj.js";import{P as ae,A as ne,a as se,D as le}from"./ProfileTimelineSkeleton-DRYPnsMh.js";import{P as me}from"./PageTitle-FYR7CltF.js";import{u as pe}from"./useURLParams-CByhGSg-.js";import{u as de,T as ue,a as ce}from"./useAthleteTimelineRenderer-y2XIb3Hw.js";import{m as fe}from"./makeAthleteProfileShareService-Df_kzS5W.js";import{m as he}from"./FlagContentModalDisplay-B49fiHdy.js";import{e as ge}from"./enumHelper-CGwk6luc.js";import{f as Pe}from"./dateUtils-DoT-fxLW.js";import{D as Ie,E as Te}from"./AppUpdateMonitor-B2IzIKp2.js";import{V as xe}from"./videoAnalytics-B_LwpSWc.js";import{P as Se,k as De,l as Ae,C as D}from"./app-public-BA_F7Vjg.js";import{u as Ve}from"./urlBuilder-BNSuALzq.js";import{G as ye,u as Ce}from"./profileApi-gchEaBez.js";import{u as Le}from"./useLogAthleteProfileVideoPlay-BbIPtdfM.js";import{u as Ee,F as Ue}from"./FlagContentModal-Cg2mDDkf.js";import{u as we}from"./urlBuilder-C12iqEc2.js";import{V as Ne}from"./VideoPlayer-De4YenSk.js";import{a as ke}from"./useCanonical-CRpNl4GZ.js";import{c as A}from"./crossAppUrlBuilder-BT3tzNU3.js";import{u as je}from"./useInfiniteQuery-tpv-l1C2.js";import"./natsAnalyticsUtils-Bgd5M8wI.js";import"./masquerading-D9-8TY9S.js";import"./AthleteHeadshot-CWlmTPNV.js";import"./imageSrcManager--1PQR1yA.js";import"./UserHeadshot-CWnda1UA.js";import"./ShareControl-t4gjz8ku.js";import"./CopyLink-CJUXvqkn.js";import"./clipboard-BEioycmS.js";import"./Responsive-Nvfc9IHK.js";import"./useAnalytics-DYuWOM9q.js";import"./googleAnalytics-bhy8KSQr.js";import"./TwitterMajor-CLsdpYfn.js";import"./LinkIcon-DouA-2ux.js";import"./SkeletonHeadshot-DxyKrdRW.js";import"./dataTypes-ByzyanJy.js";import"./ContextMenu-nyLmAy5D.js";import"./DropdownMenu-Bi-ejoUS.js";import"./TeamDetailsDisplay-DPtI4Yb-.js";import"./TeamLogo-i1qrlTUP.js";import"./PrimeBadgeIcon-BTXfpHmw.js";import"./EyeOffIcon-CI18Wxsq.js";import"./CommitmentMajor-BcSQrTLu.js";import"./IDIcon-D1My9lri.js";import"./PortalAnnouncementMajor-BgbwWSYJ.js";import"./LinkedinMajor-DuUR9cIi.js";import"./useMutation-DuY8mxW5.js";import"./utils-B3Wd421l.js";import"./api-BMqwOw8W.js";import"./profilePrivacyPreferencesApi-BSuqSwIf.js";import"./useQuery-DQVsgF3X.js";import"./useBaseQuery-cvMOEPrV.js";import"./UnconfiguredVideoPlayer-CvuTuugF.js";import"./VideoProgress-DIklw8N1.js";import"./PlayIconDesign-DLXpgdi0.js";import"./VideoDuration-DtpJzqzF.js";import"./formatter-C_B5LTc2.js";import"./videoApi-94mSpQPR.js";import"./makeCrossAppUrlBuilder-DDEx1jwX.js";const ve=10,Be=({params:{username:r,sportEnum:e},options:a}={})=>je([`${Se.profileTimeline}_fetchTimeline`,{username:`${r}`,sportEnum:`${e}`}],({pageParam:n=1})=>ye({username:r,sport:e,page:n,pageSize:ve}),{...a,getNextPageParam:n=>{const s=n?.Timeline;if(!(!s||s.Page>=s.TotalPageCount))return s.Page+1}}),be=r=>r?.pages?r.pages.reduce((e,a)=>{const n=a?.Timeline?.Results||[];return[...e,...n]},[]):[],Re=r=>!r||r.length===0?null:r.reduce((e,a)=>a.PostedDateUtc?e?new Date(a.PostedDateUtc)>new Date(e)?a.PostedDateUtc:e:a.PostedDateUtc:e,null),$e=({totalCount:r,lastUpdatedDateUtc:e})=>{const n=`${r} ${r===1?"post":"posts"}`;if(!e)return n;const s=new Date(e);return Number.isNaN(s.getTime())?n:`${n} · Updated ${Pe(e,{format:"short",excludeYear:!0})}`},Wt=()=>{ke();const{path:{id:r,sportEnum:e}}=pe(),a=we(),n=De(),s=Ve(),V=Ae(),{data:h,isLoading:y,isFetchingNextPage:C,fetchNextPage:L,hasNextPage:E}=Be({params:{username:r,sportEnum:e},options:{useErrorBoundary:!0}}),m=h?.pages?.[0],i=m?.Athlete,U=m?.ViewerContext,p=be(h),w=m?.Timeline?.TotalResultCount??p.length,{data:g,isLoading:N}=Ee({params:{athleteProfileId:i?.ProfileId},options:{enabled:!!i?.ProfileId,useErrorBoundary:!0}}),[k,P]=l.useState(null),[I,j]=l.useState(null),[T]=l.useState(()=>Ie()),x=l.useRef(!1);l.useEffect(()=>{i&&!x.current&&(ee({pageViewId:T,page:te.timeline,profileId:i.ProfileId,isAnonymous:!0,isRecruiter:!1,isMobile:!!Te()}),x.current=!0)},[i,T]);const d=g?{mapper:re,data:g,isAuthenticated:!1}:void 0,{mutate:v}=Le(),{mutate:B}=Ce(),b=t=>v({profileId:t.ProfileId,sportEnum:e,videoGuid:t.Guid}),R=({video:t})=>o.jsx(Ne,{video:t,showTitle:!1,interactionContext:xe.AthleteProfile,autoplay:!1,onInitialPlay:b,onPlay:()=>j(t.VideoId),pauseVideo:I!==null&&I!==t.VideoId}),$=A.publicSignUpPage({searchParams:{returnUrl:a.profileDetail({pathParams:{id:r,sportEnum:e}}).href}}).wiredLinkProps,H=()=>A.publicSignInPage({searchParams:{returnUrl:`${window.location.pathname}${window.location.search}`}}).go(),G=t=>o.jsx(ce,{item:t,viewerContext:U,onReportVideo:c=>P(c.Video)}),F=({video:t})=>{if(!i)return null;const c=he({athleteDisplayName:i.DisplayName,sportEnum:e,videoDetailsPath:a.profileVideosDetail({pathParams:{id:r,sportEnum:e,videoId:t.VideoId}}).href});return o.jsx(ue,{heading:`Share ${i.FirstName}'s Video`,shareService:c})},{renderItem:M}
1=de({athlete:i,sportEnum:e,profileUrlBuilder:a,commitmentsUrlBuilder:n,organizationUrlBuilder:s,transferPortalUrlBuilder:V,renderVideoPlayer:R,renderVideoShareButton:F,renderItemMenu:G,onLinkClick:t=>B({profileId:i.ProfileId,sportEnum:e,linkGuid:t.Link.Guid}),showCommitmentTeamDetails:!0,noBottomBorder:!0,configContext:d,videoSignUpLinkProps:$});if(y||!i||N||!d)return o.jsx(D,{children:o.jsx(ae,{})});const _=Re(p),O=ge.toSportEnum(e).LabelNoGender,u=ie(d).getConfig(oe),W=u.headshot!==f,z=u.heightWeight===f,Q=u.hometown===f,Y=a.profileDetail({pathParams:{id:i.Username,sportEnum:e}}).wiredLinkProps,Z=a.profileDetail({pathParams:{id:i.Username,sportEnum:e}}).href,q=fe({athleteDisplayName:i.DisplayName,sportEnum:e,profileDetailPath:Z,viewerContext:null}),S=p.map(t=>({id:t.TimelineItemId,rendering:M(t)})).filter(t=>!!t.rendering),J=E?o.jsx(X,{onClick:()=>L(),disabled:C,children:"Load More"}):null;return o.jsxs(o.Fragment,{children:[o.jsx(me,{title:`${i.DisplayName}'s ${O} Timeline | FieldLevel`}),o.jsx(D,{children:o.jsx(ne,{headerRendering:o.jsx(le,{athlete:i,profileLinkProps:Y,isHeadshotAnonymous:W,showHeightWeight:z,showHometown:Q}),pageHeading:"Timeline",subheading:$e({totalCount:w,lastUpdatedDateUtc:_}),shareService:q,renderContent:S.length===0?o.jsx(K,{children:o.jsx("div",{className:"p-4 text-muted",children:"No timeline posts yet."})}):o.jsx(se,{items:S,loadMoreRendering:J})})}),k&&o.jsx(Ue,{isOpen:!0,onDismiss:()=>P(null),onSignIn:H})]})};export{Wt as default}; 2//# sourceMappingURL=ProfileTimeline-D7oVdLF7.js.map
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.