1import{j as e,H as j,C as k,A as W,n as H,U as b,d as R,fl as N,aG as D,dO as O,aH as q,ib as B,aM as E,aI as Q,r as G,dW as J,$ as K,aN as X,aV as Y,eo as I,jP as F,v as Z,c as ee,ju as te,er as se,u as ie,ic as oe}from"./index-B-8CDiEL.js";import{r as x}from"./InfoBar-index-DialLV9J.js";import{B as V}from"./Badge-index-BwHdlqvF.js";import{D as ae}from"./DiscountBanner-index-B4B-HrfX.js";import{T as ne,a as g,b as S,S as re,C as f}from"./TabBar-index-s3zZKFIK.js";import{_ as de,a as le,V as ce,m as w,W as he,b as me,c as pe,L as ue,d as ge,e as we}from"./VideoPage-intl-DheF0UcD.js";import{A as fe}from"./AdWrappedPlayer-B0uXkPxp.js";import{a as ke}from"./VideoPageQuery-DhRteSV-.js";import{d as ve}from"./displayLoadingState-CYB3sHr1.js";import{d as xe}from"./displayNotFoundState-D2sz2G3d.js";import{w as be}from"./withQuery-p4SDLB0U.js";import{j as je}from"./connect-BJograE-.js";import{w as Ce}from"./Whitelist-XgnsjVpT.js";import{w as Te}from"./withUpdateUserFollowingMutation-DkStJK8P.js";import{p as Se}from"./parseTimeToSeconds-CVThKkQc.js";import"./IconWarning-CJZdmaH8.js";import"./FormLabel-index-DGVYL3SH.js";import"./ProducerWatchlists-styled-DgXXsHZ1.js";import"./IconLock-Cid9l6sy.js";import"./TextArea-index-bubeXjOX.js";import"./SmartTime-index-D7lZYwc0.js";import"./IconLaunch-BDJls3lp.js";import"./DiscountBanner-styled-BsNxmtkJ.js";import"./animated-CnTe94PF.js";import"./ProducerWatchlist-CskToD9v.js";import"./utils-CReuLPNg.js";import"./ProducerBanner-intl-C_T6urTd.js";import"./ScheduledPlanDowngrades-Dk8nWpdc.js";import"./PlanSelect-C3XXQbzy.js";import"./Tags-styled-6kVNkujE.js";import"./CategorySelection-styled-CVB9xwvK.js";import"./Tag-index-DuZlojVC.js";import"./CheckBox-LHAdxNvk.js";import"./EditUserModal-styled-CL7nzzCg.js";import"./SubscriptionUser-BdGpNzRB.js";import"./PayForm-intl-DcjQF4Q7.js";import"./UserSettingsModalUserWithScheduledPlanDowngrades-CwxWHcUB.js";import"./EditUserModal-intl-K93dgLnE.js";import"./molecules-intl-BRZmFHeQ.js";import"./Licenses-intl-DSq18NNp.js";import"./useAsyncFn-CCSs61Q9.js";import"./Error-BjakEj1u.js";import"./locales-CLfoX5fO.js";import"./molecules-intl-DY7dCEho.js";import"./ArticleCardContent-BVliUN3a.js";import"./NotFoundPage-index-C-Zcqz0v.js";import"./StarsBackground-DtxHn8AW.js";import"./starsBackground-C-35Oakf.js";import"./loadable-DdNr4yeD.js";import"./LoadingCircle-BR4quEBf.js";import"./PublisherDropzone-intl-CFITanVw.js";const Le=s=>{const i=[];return s.t&&(typeof s.t=="string"?i.push(s.t):Array.isArray(s.t)&&i.push(...s.t.filter(n=>typeof n=="string"))),i},Me=j.div.withConfig({componentId:"sc-7c8ffda9-0"})(["position:relative;overflow:hidden;background-size:cover;background-position:center;background-repeat:no-repeat;@media (min-width:53rem){",";",";padding-top:2rem;}@media (min-width:78rem){padding-top:3rem;}@media (min-width:120rem) and (min-height:60rem){padding-top:5rem;}"],s=>s.background?`background-image: url("${s.background}")`:"",s=>s.backgroundColor?`background-color: ${s.backgroundColor}`:""),ye=(s,i)=>i?.background&&i?.background.href||s?.background&&s?.background.href,Ae=16/9,P=16/9,$=6/5,Ie=({video:s,track:i,watchlistId:n,onTrackChange:o,onVideoControllerChange:t,timestamp:l,persistAudioSettings:d,sub:a,viewerId:h,videoOnLoop:r,onAdStateChange:C,requestedLang:T})=>{let m=Ae;return s?.asset?.width&&s?.asset?.height&&(m=s.asset.width/s.asset.height),m>P&&(m=P),m<$&&(m=$),e.jsx(Me,{background:s&&ye(s,i),backgroundColor:i?.backgroundColor??null,children:e.jsx(k,{noPadding:!0,children:e.jsx(W,{showOverflow:!0,ratio:m,children:e.jsx(fe,{autoPlay:!0,videoLang:T||i?.langCode,video:s,watchlistId:n,onTrackChange:o,onVideoControllerChange:t,timestamp:l,persistAudioSettings:d,sub:a,viewerId:h,videoLoop:r,onAdStateChange:C})})})})},Fe=j(k).withConfig({componentId:"sc-7f20bc87-0"})(["padding-top:2rem;text-align:center;"]),Ve=j.p.withConfig({componentId:"sc-7f20bc87-1"})(["line-height:1.5;font-size:",";"],({theme:s})=>s.fontSizes.big),Pe=({staticContext:s})=>(s&&(s.statusCode=404),null),$e=()=>e.jsxs(Fe,{children:[e.jsx(H,{render:Pe}),e.jsx("h1",{children:"404 No Playable Tracks Found"}),e.jsx(Ve,{children:e.jsx(b,{id:"app.TrackNotFound.message",defaultMessage:"The requested video exists, but the producer has chosen not to make any tracks playable. If this video was shared to you by the producer, ask them to send you a link that includes access to the desired hidden tracks."})})]}),Re=s=>i=>{const{data:{video:n}}=i,[o]=R(le),t=(l,d)=>{const{id:a}=n,h=d?n.likes+1:n.likes-1,r=!!d;return o({variables:{videoId:l,like:d},optimisticResponse:{updateOrCreateVideoLike:{__typename:"Video",id:a,viewerHasLiked:r,likes:h},removeVideoLike:{__typename:"Video",id:a,viewerHasLiked:r,likes:h}}})};return e.jsx(s,{...i,updateLike:t})},De=s=>i=>{const[n]=R(de),o=(t,l,d,a)=>n({variables:{input:{acceptPrivacyPolicy:t,videoId:l,trackId:d,reason:a}}});return e.jsx(s,{...i,reportVideo:o})},Ue=j(N).withConfig({componentId:"sc-4a7ff2a3-0"})(["margin-inline-end:4px;font-size:1rem;"]),L="description",_e=[L,"transcript"],y=class y extends G.Component{constructor(){super(...arguments),this.state={track:null,videoController:null,animateLiked:!1,animateFollowing:!1,showSaveMenu:!1,isAdPlaying:!1},this.setTrack=i=>{if(!i)return;const n=this.props.video.tracks.find(o=>o.id===i.id);if(!n)throw new Error(`Unknown track ${i.id}`);if(this.setState({track:n}),navigator.mediaSession){const{video:o}=this.props,t=n.thumbnail||o?.thumbnail;
1navigator.mediaSession.metadata=new MediaMetadata({title:n.title,artist:o?.owner?.name,artwork:t?[{sizes:"1280x720",src:t.href}]:void 0})}},this.setVideoController=i=>{this.setState({videoController:i})},this.toggleLike=()=>{if(!this.props.viewerIsAuthenticated){x();return}const{updateLike:i,video:{id:n,viewerHasLiked:o}}=this.props;i(n,!o),this.setState({animateLiked:!0})},this.toggleSaveMenu=()=>{if(!this.props.viewerIsAuthenticated){x();return}this.setState(i=>({showSaveMenu:!i.showSaveMenu}))},this.openSaveMenu=()=>{if(!this.props.viewerIsAuthenticated){x();return}this.setState({showSaveMenu:!0})},this.toggleFollowing=()=>{if(!this.props.viewerIsAuthenticated){x();return}this.props.updateFollowing(),this.setState({animateFollowing:!0})},this.seekTo=i=>{this.state.videoController&&(this.state.videoController.setCurrentTime(i),window.scrollTo(0,0))}}componentDidMount(){this.ensureScrollPosition()}componentDidUpdate(i){this.props.video?.id!==i.video?.id&&(this.setState({track:null,animateLiked:!1,animateFollowing:!1}),this.ensureScrollPosition())}ensureScrollPosition(){this.props.history.action==="PUSH"&&window.scrollTo(0,0)}linkToTab(i){const{video:n,location:o}=this.props,t=o.search,l=i===L?"":`/${i}`;return`/videos/${n?.id}${l}${t}`}render(){const{linker:i,match:n,viewerIsAuthenticated:o,video:t,reportVideo:l,viewer:d,query:a,location:h,intl:r}=this.props,C=Array.isArray(a.time)?a.time[0]:a.time,T=Se(C),m=a?.sub instanceof Array?a?.sub[0]:a?.sub,c=this.state.track||t?.track,p=n.params.tabId||L,v=a.watchlist instanceof Array?a.watchlist[0]:a.watchlist,U=new URLSearchParams(h.search).get("loop")==="1",_=v?!1:U,z=t?.state===2,A=this.context.isFeatureEnabled(K.PublishContent);return e.jsxs("div",{children:[e.jsx(ae,{}),(!_e.includes(p)||z)&&e.jsx(X,{children:e.jsx("meta",{name:"robots",content:"noindex,follow"})}),t&&c&&e.jsx(ce,{video:t,track:c,watchlistId:v}),e.jsx(Ie,{video:t,track:c,watchlistId:v,onTrackChange:this.setTrack,onVideoControllerChange:this.setVideoController,timestamp:T,persistAudioSettings:!0,sub:m,viewerId:d?.id,videoOnLoop:_,onAdStateChange:u=>this.setState({isAdPlaying:u}),requestedLang:a?.lang instanceof Array?a?.lang[0]:a?.lang}),t&&e.jsxs(ne,{children:[e.jsx(g,{to:this.linkToTab("description"),isActive:p==="description",children:r.formatMessage(w.description)}),e.jsx(g,{to:this.linkToTab("transcript"),isActive:p==="transcript",children:r.formatMessage(w.transcript)}),!t.hideComments&&e.jsx(g,{to:this.linkToTab("comments"),isActive:p==="comments",children:r.formatMessage(w.comments)}),!t.hideInsights&&e.jsx(g,{to:this.linkToTab("insights"),isActive:p==="insights",children:r.formatMessage(w.insights)}),e.jsxs(g,{to:this.linkToTab("share"),isActive:p==="share",children:[!A&&t.viewerIsOwner&&e.jsx(Ue,{}),e.jsx("span",{children:r.formatMessage(w.share)})]}),e.jsx(Y,{}),t.viewerCanEdit&&e.jsx(g,{to:i.toDubbrVideoInfo(t.id),children:r.formatMessage(w.edit)}),e.jsxs(S,{isAction:!0,isActive:t.viewerHasLiked,animate:this.state.animateLiked,onClick:this.toggleLike,children:[e.jsx(b,{id:"app.VideoPage.like",defaultMessage:`{liked, select, 2 true {Liked} 3 other {Like} 4 }`,values:{liked:t.viewerHasLiked}}),e.jsx(V,{children:e.jsx(I,{value:t.likes,format:"short"})})]}),!t.viewerIsOwner&&e.jsxs(S,{isAction:!0,isActive:t.owner.viewerIsFollowing,animate:this.state.animateFollowing,onClick:this.toggleFollowing,children:[e.jsx(b,{id:"app.VideoPage.subscribe",defaultMessage:`{subscribed, select, 5 true {Subscribed} 6 other {Subscribe} 7 }`,values:{subscribed:t?.owner?.viewerIsFollowing}}),e.jsx(V,{children:e.jsx(I,{value:t?.owner?.followerCount,format:"short"})})]}),d&&c&&e.jsxs(S,{isAction:!0,onClick:this.openSaveMenu,children:[e.jsx(b,{id:"app.VideoPage.SaveWatchlist",defaultMessage:"Save"}),this.state.showSaveMenu&&e.jsx(he,{toggleMenu:this.toggleSaveMenu,video:t,track:c})]})]}),t&&c&&e.jsxs(re,{value:p,children:[e.jsx(f,{when:"description",children:e.jsx(me,{viewerIsAuthenticated:o,video:t,track:c,reportVideo:l,onSeek:this.seekTo})}),e.jsx(f,{when:"transcript",children:e.jsx(k,{children:e.jsx(pe,{track:c,isAdPlaying:!!this.state.isAdPlaying})})}),e.jsx(f,{when:"comments",skip:!!t.hideComments,children:e.jsx(k,{children:e.jsx(ue,{threadId:t.id,defaultCommentLangCode:c.langCode,onSeek:this.seekTo})})}),e.jsx(f,{when:"insights",skip:!!t.hideInsights,children:e.jsx(ge,{entr
7ies:t.tracks,type:"video"})}),e.jsx(f,{when:"share",children:e.jsx(k,{children:!A&&t.viewerIsOwner?e.jsxs(e.Fragment,{children:[e.jsx("p",{children:r.formatMessage(F.header)}),e.jsx(Z,{variant:"outlined",as:ee,to:i.toCheckout(te.Free),style:{margin:"0"},children:r.formatMessage(F.buttonText)})]}):e.jsx(we,{target:t,languages:t.tracks.filter(u=>u.asset!==null),watchlistId:v,audioDescriptionLanguages:t.tracks.filter(u=>!!u.audioDescriptionAsset?.representations.length),closedCaptionsLanguages:t.tracks.filter(u=>!!u.closedCaptionsAsset?.closedCaptionsTextRepresentations.length)})})})]})]})}};y.contextType=J;let M=y;const ze=s=>i=>{const{match:n,query:o,preferredLanguages:t}=i,l=n.params.videoId,d=Le(o);let a=t;o.lang?a=typeof o.lang=="string"?[o.lang]:o.lang:o.vlang&&(a=typeof o.vlang=="string"?[o.vlang]:o.vlang);const{data:h,loading:r}=ie(ke,{variables:{videoId:l,videoLanguage:a,preferredLanguages:t,showUnlistedTracks:d}});return e.jsx(s,{...i,data:{...h,loading:r}})},We=D(se(s=>({updateFollowingMutationData:{userId:s?.video?.owner?.id,followerCount:s?.video?.owner?.followerCount,viewerIsFollowing:s?.video?.owner?.viewerIsFollowing}})),Te),He=D(je,Q,E,be,ze,ve,xe(s=>!s.data.video&&!s.query.watchlist),Ce,B(s=>!s.data.video?.track&&!s.query?.watchlist,oe($e)),Re,De,q("data"),We,O),zt=He(M);export{zt as default};
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.