PageSourceSearch

https://static.alugha.com/assets/WatchlistMenu-index-B8cKkmnC.js

js alugha.com collected 2026-10-02 11:20:34 UTC 25,506 bytes, 62 lines download raw bytes

1import{d as T,j as c,aj as O,H as w,iK as Z,en as ee,ja as te,jb as ie,iL as ne,z as I,jc as ae,o as se,a4 as oe,p as de,s as re,aD as ce,Y as le,q as ue,u as he,r as P,b6 as fe,ac as z,aG as me,aI as pe,dO as ve,aM as ge,g6 as A,t as q,jd as $,ex as ke,cV as be,$ as Se,c as we}from"./index-B-8CDiEL.js";import{m as g}from"./ProducerWatchlists-intl-BAbWsVbB.js";import{_ as L,m as k,a as Pe,P as Ce}from"./ProducerPodcast-CCWzPrYF.js";import{_ as G}from"./ProducerWatchlist-CskToD9v.js";import{_ as U}from"./ProducerVideos-C_2asFOA.js";import{_ as Me}from"./addVideoToWatchlist-DtyQtQlQ.js";import{u as xe,D as ye}from"./InfoBar-index-DialLV9J.js";import{a as We}from"./VideoInfoCollaborationsQuery-DqtP5P2c.js";import{T as De}from"./Comment-index-B66Zstld.js";const Te=`#import "./ProducerWatchlist.graphql"
2#import "./ProducerVideos.graphql"
3
4fragment ProducerDataWatchlistVideos on User {
5  id
6  name
7  watchlists {
8    id
9    ...ProducerWatchlist
10    videos {
11      id
12      ...ProducerVideos
13    }
14  }
15}
16`,v={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ProducerDataWatchlistVideos"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"watchlists"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerWatchlist"},directives:[]},{kind:"Field",name:{kind:"Name",value:"videos"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerVideos"},directives:[]}]}}]}}]}}],loc:{start:0,end:276,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Te}}},Q=s=>{const n={};return s.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};v.definitions=Q(v.definitions.concat(G.definitions));v.definitions=Q(v.definitions.concat(U.definitions));const Ne=(s,n)=>{const a=(e,t)=>{if(e.kind==="FragmentSpread")t.add(e.name.value);else if(e.kind==="VariableDefinition"){const i=e.type;i.kind==="NamedType"&&t.add(i.name.value)}return e&&"selectionSet"in e&&e.selectionSet&&e.selectionSet.selections.forEach(i=>{a(i,t)}),e&&"variableDefinitions"in e&&e.variableDefinitions&&e.variableDefinitions.forEach(i=>{a(i,t)}),e&&"definitions"in e&&e.definitions&&e.definitions.forEach(i=>{a(i,t)}),t},o=e=>{const t={};return e.definitions.forEach(function(i){"name"in i&&i.name&&(t[i.name.value]=a(i,new Set))}),t},d=(e,t)=>{for(let i=0;i<e.definitions.length;i++){const u=e.definitions[i];if(u&&"name"in u&&u.name&&u.name.value==t)return u}},h=o(s),l=Object.assign({},s,{definitions:[d(s,n)]}),m=h[n]||new Set,f=new Set;let r=new Set;for(m.forEach(e=>{r.add(e)});r.size>0;){const e=r;r=new Set,e.forEach(t=>{f.has(t)||(f.add(t),(h[t]||new Set).forEach(u=>{r.add(u)}))})}return f.forEach(e=>{const t=d(s,e);t&&l.definitions.push(t)}),l};Ne(v,"ProducerDataWatchlistVideos");const Ve=`#import "../fragments/ProducerWatchlist.graphql"
17
18mutation createWatchlist($data: CreateWatchlistInput!) {
19  createWatchlist(data: $data) {
20    id
21    ...ProducerWatchlist
22  }
23}
24`,W={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createWatchlist"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateWatchlistInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createWatchlist"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerWatchlist"},directives:[]}]}}]}}],loc:{start:0,end:216,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Ve}}},Ee=s=>{const n={};
24return s.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};W.definitions=Ee(W.definitions.concat(G.definitions));const Re=(s,n)=>{const a=(e,t)=>{if(e.kind==="FragmentSpread")t.add(e.name.value);else if(e.kind==="VariableDefinition"){const i=e.type;i.kind==="NamedType"&&t.add(i.name.value)}return e&&"selectionSet"in e&&e.selectionSet&&e.selectionSet.selections.forEach(i=>{a(i,t)}),e&&"variableDefinitions"in e&&e.variableDefinitions&&e.variableDefinitions.forEach(i=>{a(i,t)}),e&&"definitions"in e&&e.definitions&&e.definitions.forEach(i=>{a(i,t)}),t},o=e=>{const t={};return e.definitions.forEach(function(i){"name"in i&&i.name&&(t[i.name.value]=a(i,new Set))}),t},d=(e,t)=>{for(let i=0;i<e.definitions.length;i++){const u=e.definitions[i];if(u&&"name"in u&&u.name&&u.name.value==t)return u}},h=o(s),l=Object.assign({},s,{definitions:[d(s,n)]}),m=h[n]||new Set,f=new Set;let r=new Set;for(m.forEach(e=>{r.add(e)});r.size>0;){const e=r;r=new Set,e.forEach(t=>{f.has(t)||(f.add(t),(h[t]||new Set).forEach(u=>{r.add(u)}))})}return f.forEach(e=>{const t=d(s,e);t&&l.definitions.push(t)}),l};Re(W,"createWatchlist");const je=s=>n=>{const{preferredLanguages:a}=n,[o]=T(W),d=(h,l)=>o({variables:{data:h},update:(m,f)=>{if(!f.data)return;let r=m.readFragment({id:`User:${l}`,fragmentName:"ProducerDataWatchlistVideos",fragment:v,variables:{preferredLanguages:a}});if(!r)return;const e={...f.data.createWatchlist,videos:[],__typename:"Watchlist"};r=O(r,{watchlists:t=>t?[...t,e]:[e]}),r&&m.writeFragment({id:`User:${l}`,fragmentName:"ProducerDataWatchlistVideos",fragment:v,data:r})}});return c.jsx(s,{...n,createWatchlist:d})},Le=`#import "../fragments/ProducerPodcast.graphql"
25
26mutation createPodcast(
27  $data: CreatePodcastInput!
28  $preferredLanguages: [String!]!
29) {
30  createPodcast(data: $data) {
31    id
32    ...ProducerPodcast
33  }
34}
35`,D={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createPodcast"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreatePodcastInput"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createPodcast"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerPodcast"},directives:[]}]}}]}}],loc:{start:0,end:244,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Le}}},_e=s=>{const n={};return s.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};D.definitions=_e(D.definitions.concat(L.definitions));const Fe=(s,n)=>{const a=(e,t)=>{if(e.kind==="FragmentSpread")t.add(e.name.value);else if(e.kind==="VariableDefinition"){const i=e.type;i.kind==="NamedType"&&t.add(i.name.value)}return e&&"selectionSet"in e&&e.selectionSet&&e.selectionSet.selections.forEach(i=>{a(i,t)}),e&&"variableDefinitions"in e&&e.variableDefinitions&&e.variableDefinitions.forEach(i=>{a(i,t)}),e&&"definitions"in e&&e.definitions&&e.definitions.forEach(i=>{a(i,t)}),t},o=e=>{const t={};return e.definitions.forEach(function(i){"name"in i&&i.name&&(t[i.name.value]=a(i,new Set))}),t},d=(e,t)=>{for(let i=0;i<e.definitions.length;i++){const u=e.definitions[i];if(u&&"name"in u&&u.name&&u.name.value==t)return u}},h=o(s),l=Object.assign({},s,{definitions:[d(s,n)]}),m=h[n]||new Set,f=new Set;let r=new Set;for(m.forEach(e=>{r.add(e)});r.size>0;){const e=r;r=new Set,e.forEach(t=>{f.has(t)||(f.add(t),(h[t]||new Set).forEach(u=>{r.add(u)}))})}
35return f.forEach(e=>{const t=d(s,e);t&&l.definitions.push(t)}),l};Fe(D,"createPodcast");const Ae=`#import "./ProducerPodcast.graphql"
36
37fragment ProducerDataPodcastsWithoutVideos on User {
38  id
39  name
40  podcasts(limit: 0, offset: 0) {
41    id
42    ...ProducerPodcast
43  }
44}
45`,C={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"ProducerDataPodcastsWithoutVideos"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"podcasts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"0"}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"IntValue",value:"0"}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerPodcast"},directives:[]}]}}]}}],loc:{start:0,end:210,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Ae}}},qe=s=>{const n={};return s.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};C.definitions=qe(C.definitions.concat(L.definitions));const $e=(s,n)=>{const a=(e,t)=>{if(e.kind==="FragmentSpread")t.add(e.name.value);else if(e.kind==="VariableDefinition"){const i=e.type;i.kind==="NamedType"&&t.add(i.name.value)}return e&&"selectionSet"in e&&e.selectionSet&&e.selectionSet.selections.forEach(i=>{a(i,t)}),e&&"variableDefinitions"in e&&e.variableDefinitions&&e.variableDefinitions.forEach(i=>{a(i,t)}),e&&"definitions"in e&&e.definitions&&e.definitions.forEach(i=>{a(i,t)}),t},o=e=>{const t={};return e.definitions.forEach(function(i){"name"in i&&i.name&&(t[i.name.value]=a(i,new Set))}),t},d=(e,t)=>{for(let i=0;i<e.definitions.length;i++){const u=e.definitions[i];if(u&&"name"in u&&u.name&&u.name.value==t)return u}},h=o(s),l=Object.assign({},s,{definitions:[d(s,n)]}),m=h[n]||new Set,f=new Set;let r=new Set;for(m.forEach(e=>{r.add(e)});r.size>0;){const e=r;r=new Set,e.forEach(t=>{f.has(t)||(f.add(t),(h[t]||new Set).forEach(u=>{r.add(u)}))})}return f.forEach(e=>{const t=d(s,e);t&&l.definitions.push(t)}),l};$e(C,"ProducerDataPodcastsWithoutVideos");const Oe=s=>n=>{const{preferredLanguages:a}=n,[o]=T(D),d=(h,l)=>o({variables:{data:h,preferredLanguages:a},update:(m,f)=>{if(!f.data)return;let r=m.readFragment({id:`User:${l}`,fragmentName:"ProducerDataPodcastsWithoutVideos",fragment:C,variables:{preferredLanguages:a}});if(!r)return;const e={...f.data.createPodcast,episodes:[],__typename:"Podcast"};r=O(r,{podcasts:t=>t?[...t,e]:[e]}),r&&m.writeFragment({id:`User:${l}`,fragmentName:"ProducerDataPodcastsWithoutVideos",fragment:C,data:r})}});return c.jsx(s,{...n,createPodcast:d})},Ie=s=>n=>{const{preferredLanguages:a}=n,[o]=T(Me),d=(h,l)=>o({variables:{watchlistId:h,videoId:l,preferredLanguages:a}});return c.jsx(s,{...n,addVideoToWatchlist:d})},ze=`#import "../fragments/ProducerPodcast.graphql"
46#import "../fragments/ProducerVideos.graphql"
47
48mutation addEpisodeToPodcast(
49  $podcastId: ID!
50  $videoId: ID!
51  $preferredLanguages: [String!]!
52) {
53  addEpisodeToPodcast(podcastId: $podcastId, videoId: $videoId) {
54    id
55    ...ProducerPodcast
56    episodes {
57      id
58      ...ProducerVideos
59    }
60  }
61}
62`,S={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"addEpisodeToPodcast"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"podcastId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"videoId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"preferredLanguages"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"addEpisodeToPodcast"},arguments:[{kind:"Argument",name:{kind:"Name",value:"podcastId"},value:{kind:"Variable",name:{kind:"Name",value:"podcastId"}}},{kind:"Argument",name:{kind:"Name",value:"videoId"},value:{kind:"Variable",name:{kind:"Name",value:"videoId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerPodcast"},directives:[]},{kind:"Field",name:{kind:"Name",value:"episodes"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"ProducerVideos"},directives:[]}]}}]}}]}}],loc:{start:0,end:390,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:ze}}},B=s=>{const n={};
62return s.filter(function(a){if(a.kind!=="FragmentDefinition")return!0;const o=a.name.value;return n[o]?!1:(n[o]=!0,!0)})};S.definitions=B(S.definitions.concat(L.definitions));S.definitions=B(S.definitions.concat(U.definitions));const Ge=(s,n)=>{const a=(e,t)=>{if(e.kind==="FragmentSpread")t.add(e.name.value);else if(e.kind==="VariableDefinition"){const i=e.type;i.kind==="NamedType"&&t.add(i.name.value)}return e&&"selectionSet"in e&&e.selectionSet&&e.selectionSet.selections.forEach(i=>{a(i,t)}),e&&"variableDefinitions"in e&&e.variableDefinitions&&e.variableDefinitions.forEach(i=>{a(i,t)}),e&&"definitions"in e&&e.definitions&&e.definitions.forEach(i=>{a(i,t)}),t},o=e=>{const t={};return e.definitions.forEach(function(i){"name"in i&&i.name&&(t[i.name.value]=a(i,new Set))}),t},d=(e,t)=>{for(let i=0;i<e.definitions.length;i++){const u=e.definitions[i];if(u&&"name"in u&&u.name&&u.name.value==t)return u}},h=o(s),l=Object.assign({},s,{definitions:[d(s,n)]}),m=h[n]||new Set,f=new Set;let r=new Set;for(m.forEach(e=>{r.add(e)});r.size>0;){const e=r;r=new Set,e.forEach(t=>{f.has(t)||(f.add(t),(h[t]||new Set).forEach(u=>{r.add(u)}))})}return f.forEach(e=>{const t=d(s,e);t&&l.definitions.push(t)}),l};Ge(S,"addEpisodeToPodcast");const Ue=s=>n=>{const{preferredLanguages:a}=n,[o]=T(S),d=(h,l)=>o({variables:{podcastId:h,videoId:l,preferredLanguages:a}});return c.jsx(s,{...n,addVideoToPodcast:d})},V=w(Z).withConfig({componentId:"sc-d215f17e-0"})(["top:100%;",";text-transform:none;z-index:3;text-align:start;max-height:12.5rem;min-width:12rem;max-width:13rem;position:relative;"],ee("-0.5rem")),M=w(te).withConfig({componentId:"sc-d215f17e-1"})(["padding:0.5rem;background:transparent;cursor:pointer;:hover{background-color:",";}"],({theme:s})=>s.colors.accentSecondary),E=w(ne).withConfig({componentId:"sc-d215f17e-2"})(["padding:0;",""],s=>s.scroll&&I(["max-height:120px;overflow:auto;::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{border-radius:4px;}::-webkit-scrollbar-thumb{background:rgba(64,76,88,1);border-radius:4px;}::-webkit-scrollbar-thumb:hover{background:rgba(64,76,88,0.5);}"])),x=w(ie).withConfig({componentId:"sc-d215f17e-3"})(["padding:0;margin:0;"]),y=w.button.withConfig({componentId:"sc-d215f17e-4"})(["pointer-events:auto;padding-inline-start:0;line-height:0;z-index:1;background-color:transparent;border:none;color:",";font-size:1rem;:hover{color:",";cursor:pointer;}:focus{outline:none;}"],({theme:s})=>s.colors.textWhite,({theme:s})=>s.colors.accentPrimary),b=w(ae).withConfig({componentId:"sc-d215f17e-5"})(["text-align:start;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;justify-content:space-between;padding:0.5rem 2rem;padding-inline-end:0.5rem;",";"],s=>s.disabled&&I(["pointer-events:none;background-color:",";color:",";"],({theme:n})=>n.colors.accentSecondary,({theme:n})=>n.colors.textDisabled)),R=se({activeCollaborations:{id:"app.WatchlistMenu.activeCollaborations",defaultMessage:"active collaborations"},activeCollaborationsWarning:{id:"app.WatchlistMenu.activeCollaborationsWarning",defaultMessage:'The video "{videoTitle}" could not be deleted as it still has active collaborations.'},reviewButton:{id:"app.WatchlistMenu.reviewButton",defaultMessage:"review"}}),Qe=({videoId:s,title:n,showModal:a,toggleMenu:o,setShowDeleteVideoModal:d,updateDeleteVideo:h})=>{const l=oe(),{mutation:m,loading:f}=xe(h),{formatMessage:r}=de(),{graphqlError:e}=re(),t=ce(),i=le(),u=ue(),{data:N}=he(We,{variables:{videoId:s}}),K=P.useCallback(()=>{if(!f){d?.(!1);const p=new MouseEvent("");o?.(p)}},[f,d,o]),Y=P.useCallback(async()=>{if(!f)try{if((await m(s)).data?.deleteVideo){const X=document.createEvent("MouseEvent");o?.(X),d?.(!1)}}catch(p){l.current&&e(p)}},[m,e,l,f,d,o,s]),F=P.useCallback(async()=>{await t(r(R.activeCollaborations),c.jsx(c.Fragment,{children:c.jsx(De,{children:r(R.activeCollaborationsWarning,{videoTitle:`${n}`})})}),r(R.reviewButton))&&i.push(`${u.toDubbrVideoInfo(s)}`)},[i,u,r,t,n,s]),J=P.useCallback(()=>{N?.dubbrVideo?.collaborations.length!==0&&N?.dubbrVideo?.collaborations.find(p=>p.state===fe.Active)?F():d?.(!0)},[d,N,F]);return c.jsxs(c.Fragment,{children:[c.jsx(ye,{showModal:a,title:n,closeDeleteModal:K,handleDeleteVideo:Y,mutationLoading:f}),c.jsx(b,{onClick:J,children:r(z.delete)})]})};var H=(function(s){return s[s.Private=0]="Private",s[s.Public=1]="Public",s[s.Unl
62isted=2]="Unlisted",s})(H||{});const _=class _ extends P.PureComponent{constructor(){super(...arguments),this.state={showAddToWatchlistSubMenu:!1,showDeleteVideoModal:!1,windowWidth:0,windowHeight:0,watchlistsLoading:[],podcastLoading:[],createMutationLoading:!1},this.updateWindowDimensions=()=>{this.setState({windowWidth:window.innerWidth,windowHeight:window.innerHeight})},this.setAddWatchlistMenuRef=n=>{this.addWatchlistMenuRef=n},this.setAddPodcastMenuRef=n=>{this.addPodcastMenuRef=n},this.setCardMenuRef=n=>{this.cardMenuRef=n},this.handleOpenAddToWatchlistSubMenu=()=>{this.setState({showAddToWatchlistSubMenu:!0},()=>{this.props.onResize?.()})},this.handleOpenAddToPodcastSubMenu=()=>{this.setState({showAddToPodcastSubMenu:!0},()=>{this.props.onResize?.()})},this.handleCloseAddToWatchlistSubMenu=()=>{this.setState({showAddToWatchlistSubMenu:!1})},this.handleCloseAddToPodcastSubMenu=()=>{this.setState({showAddToPodcastSubMenu:!1})},this.handleClickOutside=n=>{n.stopPropagation(),!this.cardMenuRef?.contains(n.target)&&!this.props.toggleButtonRef?.current?.contains(n.target)&&!this.state.showWatchlistCreator&&!this.state.showPodcastCreator&&!this.state.showDeleteVideoModal&&this.props?.toggleMenu?.(n)},this.handleAddVideoToWatchlist=async(n,a)=>{try{this.setState(l=>({watchlistsLoading:[...l.watchlistsLoading,n]}));const o=this.props.track.title,d=await this.props.addVideoToWatchlist(n,a),h=d&&d.data&&d.data.addVideoToWatchlist||!1;this._isMounted&&h&&this.context.success(this.props.intl.formatMessage(g.notificationVideoToWatchlistSuccess,{title:o}))}catch(o){if(!this._isMounted)return;this.context.graphqlError(o)}finally{this._isMounted&&(this.setState(o=>({watchlistsLoading:o.watchlistsLoading.filter(d=>d!==n)})),this.props.toggleMenu?.())}},this.handleAddVideoToPodcast=async(n,a)=>{try{this.setState(l=>({podcastLoading:[...l.podcastLoading,n]}));const o=this.props.track.title,d=await this.props.addVideoToPodcast(n,a),h=d&&d.data&&d.data.addEpisodeToPodcast||!1;this._isMounted&&h&&this.context.success(this.props.intl.formatMessage(k.notificationVideoToPodcastSuccess,{title:o}))}catch(o){if(!this._isMounted)return;this.context.graphqlError(o)}finally{this._isMounted&&(this.setState(o=>({podcastLoading:o.podcastLoading.filter(d=>d!==n)})),this.props.toggleMenu?.())}},this.handleOpenCreator=()=>{this.setState({showWatchlistCreator:!0})},this.handleCloseCreator=()=>{this.setState({showWatchlistCreator:!1})},this.handleOpenPodcastCreator=()=>{this.setState({showPodcastCreator:!0})},this.handleClosePodcastCreator=()=>{this.setState({showPodcastCreator:!1})},this.handleShowDeleteVideoModal=n=>{this._isMounted&&this.setState({showDeleteVideoModal:n})},this.handleCreateWatchlist=async(n,a,o)=>{const{owner:d,video:h,track:l}=this.props;this.setState({createMutationLoading:!0});try{if(d&&n&&a&&a.length>=1&&o){const m=await this.props.createWatchlist({title:n,categories:Object.values(a).map(r=>r.id),state:o},d.id),f=m&&m.data&&m.data.createWatchlist||!1;this._isMounted&&f&&(this.handleAddVideoToWatchlist(f.id,h.id),this.handleCloseCreator(),this.context.success(this.props.intl.formatMessage(g.notificationCreateWatchlistAddVideoSuccess,{titleWatchlist:n,titleVideo:l?.title||""})))}}catch{if(!this._isMounted)return;this.context.error(this.props.intl.formatMessage(g.notificationCreateWatchlistAddVideoError))}finally{this.setState({createMutationLoading:!1})}},this.handleCreatePodcast=async(n,a,o)=>{const{owner:d,video:h,track:l}=this.props;try{if(d&&n&&a&&a.length>=1&&o){const m=await this.props.createPodcast({podcastMeta:n,categories:a,state:o},d.id),f=m&&m.data&&m.data.createPodcast||!1;return this._isMounted&&f&&(this.handleAddVideoToPodcast(f.id,h.id),this.handleCloseCreator(),this.context.success(this.props.intl.formatMessage(k.notificationCreatePodcastAddVideoSuccess,{titlePodcast:"titlePodcast",titleVideo:l?.title||""}))),m}}catch{if(!this._isMounted)return;this.context.error(this.props.intl.formatMessage(k.notificationCreatePodcastAddVideoError))}},this.addToWatchlistSubMenu=()=>{const{watchlists:n,video:a,intl:o}=this.props,d=a.id,h=a.state;return c.jsxs(V,{ref:this.setAddWatchlistMenuRef,children:[c.jsxs(M,{onClick:this.handleCloseAddToWatchlistSubMenu,children:[c.jsx(y,{children:c.jsx(A,{})}),o.formatMessage(g.cardMenuAddToWatchlist)]}),c.jsx(x,{}),c.jsx(E,{scroll:n!=null&&n.length>3,children:n?.map(l=>{const m=this.state.watchlistsLoading.includes(l.id);return c.jsx(b,{onClick:()=>this.handleAddVideoToWatchlist(l.id,d),disabled:m||h===0&&l.state!==H[h
62],children:m?c.jsx(q,{size:"1.5rem"}):l.title},l.id)})}),c.jsx(x,{}),c.jsxs(M,{onClick:this.handleOpenCreator,children:[c.jsx(y,{children:c.jsx($,{})}),o.formatMessage(g.cardMenuCreateNewWatchlist)]})]})},this.addToPodcastSubMenu=()=>{const{podcasts:n,video:a,intl:o}=this.props,d=a.id;return c.jsxs(V,{ref:this.setAddPodcastMenuRef,children:[c.jsxs(M,{onClick:this.handleCloseAddToPodcastSubMenu,children:[c.jsx(y,{children:c.jsx(A,{})}),o.formatMessage(k.cardMenuAddToPodcast)]}),c.jsx(x,{}),c.jsx(E,{scroll:n!=null&&n.length>3,children:n?.map(h=>{const l=this.state.podcastLoading.includes(h?.id||"");return c.jsx(b,{onClick:()=>this.handleAddVideoToPodcast(h?.id||"",d),disabled:l,children:l?c.jsx(q,{size:"1.5rem"}):h?.podcastSelectedMeta.title},h?.id)})}),c.jsx(x,{}),c.jsxs(M,{onClick:this.handleOpenPodcastCreator,children:[c.jsx(y,{children:c.jsx($,{})}),o.formatMessage(k.cardMenuCreateNewPodcast)]})]})}}componentDidMount(){this._isMounted=!0,document.addEventListener("mousedown",this.handleClickOutside),window.addEventListener("resize",this.updateWindowDimensions),this.updateWindowDimensions()}componentWillUnmount(){this._isMounted=!1,document.removeEventListener("mousedown",this.handleClickOutside),window.removeEventListener("resize",this.updateWindowDimensions)}render(){const{intl:n,linker:a,owner:o,video:d}=this.props;return c.jsxs("div",{ref:this.setCardMenuRef,children:[!this.state.showAddToWatchlistSubMenu&&!this.state.showAddToPodcastSubMenu?c.jsx(V,{children:c.jsxs(E,{children:[c.jsx(b,{onClick:this.handleOpenAddToWatchlistSubMenu,children:n.formatMessage(g.cardMenuAddToWatchlist)}),o?.id==d.owner.id&&c.jsxs(c.Fragment,{children:[c.jsx(be,{feature:Se.PodcastSupport,children:c.jsx(b,{onClick:this.handleOpenAddToPodcastSubMenu,children:n.formatMessage(k.cardMenuAddToPodcast)})}),c.jsx(b,{as:we,to:a.toDubbrVideoInfo(d.id),children:n.formatMessage(z.edit)}),c.jsx(Qe,{videoId:this.props.video.id,title:this.props.track?.title||"",showModal:this.state.showDeleteVideoModal,setShowDeleteVideoModal:this.handleShowDeleteVideoModal,toggleMenu:this.props.toggleMenu,updateDeleteVideo:this.props.updateDeleteVideo})]})]})}):this.state.showAddToWatchlistSubMenu?this.addToWatchlistSubMenu():this.addToPodcastSubMenu(),this.state.showWatchlistCreator&&c.jsx(Pe,{isMobile:this.state.windowWidth<=425,onClose:this.handleCloseCreator,onSave:this.handleCreateWatchlist,isLoading:this.state.createMutationLoading}),this.state.showPodcastCreator&&c.jsx(Ce,{isMobile:this.state.windowWidth<=425,onClose:this.handleClosePodcastCreator,onSave:this.handleCreatePodcast})]})}};_.contextType=ke;let j=_;const Be=me(ge,ve,pe,Ie,Ue,je,Oe),He=Be(j),at=Object.freeze(Object.defineProperty({__proto__:null,default:He},Symbol.toStringTag,{value:"Module"}));export{He as W,W as _,C as a,D as b,v as c,at as i,R as m};

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.