1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([["52471"],{6424:function(e,t,n){n.d(t,{hC:function(){return D},Dk:function(){return U},UD:function(){return L}});var r=n(79066),i=n(5377),o=n(45996),u=n(72516),a=n(42646),s=n(56904),d=n(38306),l=n(32878),c=n(57007),_=n(17505),f=n(51794),h=n(78790),v=function(e){var t,n={"cmn-Hans-CN":"zh-CN","eng-US":"en-US","jpn-JP":"jp-JP","kor-KR":"ko-KR","cmn-Hans-CN|eng-US":"en-US","rus-RU":"ru-RU","fra-FR":"fr-FR","por-PT":"pt-PT","spa-ES":"es-ES","afr-ZA":"en-ZA","ben-BD":"bn-BD","ces-CZ":"cs-CZ","dan-DK":"da-DK","nld-NL":"nl-NL","fin-FI":"fi-FI","deu-DE":"de-DE","ell-GR":"el-GR","hun-HU":"hu-HU","ind-ID":"id-ID","gle-IE":"en-IE","ita-IT":"it-IT","nor-NO":"no-NO","pol-PL":"pl-PL","swe-SE":"sv-SE","tha-TH":"th-TH","tur-TR":"tr-TR","ara-SA":"ar-SA","fra-CA":"fr-CA","cmn-Hant-CN":"zh-TW","heb-IL":"he-IL","jva-ID":"id-ID","ron-RO":"ro-RO","hin-IN":"hi-IN","ben-IN":"bn-BD","slk-SK":"sk-SK"};return null!=(t=null==n?void 0:n[e])?t:"en-US"},p=n(85460),g=n(48859),m=n(47149),w=n(69597),E=n(21987),I=n(35144),b=n(72140),y=n(72702),S=n(38622),C=n(59952),T=n(4676),x=n(32540),k=(0,n(10625).p)("videoDetailAtom@tiktok/webapp-desktop",{currentIndex:0,itemListKey:d.Lz.Video,subtitleContent:[],ifShowSubtitle:!1,subtitleStruct:null,seekType:l.RW.None,playMode:g.ey.VideoDetail,isScrollGuideVisible:!1,isYmlRightPanelVisible:!0});k.debugLabel="videoDetailAtom";var V=(0,T.i)(k,function(e,t){return{setCurrentIndex:function(e){t(k,function(t){return(0,o._)((0,i._)({},t),{currentIndex:e})})},setSubtitleContent:function(e){t(k,function(t){return(0,o._)((0,i._)({},t),{subtitleContent:e})})},setIfShowSubtitle:function(e){t(k,function(t){return(0,o._)((0,i._)({},t),{ifShowSubtitle:e})})},setSubtitleStruct:function(e){var n=N(e);n&&t(k,function(e){return(0,o._)((0,i._)({},e),{subtitleStruct:n})})},setSeekType:function(e){t(k,function(t){return(0,o._)((0,i._)({},t),{seekType:e})})},setIsScrollGuideVisible:function(e){t(k,function(t){return(0,o._)((0,i._)({},t),{isScrollGuideVisible:e})})},setIsYmlRightPanelVisible:function(e){t(k,function(t){return(0,o._)((0,i._)({},t),{isYmlRightPanelVisible:e})})},handleSelectVideo:function(n){return(0,r._)(function(){var r,a,s,l,_,f,h,v,p,g;return(0,u.__generator)(this,function(u){switch(u.label){case 0:return r=n.newIndex,a=n.isAIGCDesc,_=null!=(l=(void 0===(s=e(b.Hx).browserList)?[]:s)[r])?l:"",f=e(y.Pu)[_],h=(0,b.OU)(),v=(0,y.ud)(),p=(0,o._)((0,i._)({},f),{author:{nickname:null==f?void 0:f.nickname,uniqueId:null==f?void 0:f.author,id:null==f?void 0:f.authorId,secUid:null==f?void 0:f.authorSecId,avatarThumb:null==f?void 0:f.avatarThumb}}),h.resetRelatedList(),this.setSubtitleContent([]),v.updateItem({id:_,hasTranscript:!1}),(0,S.Tj)(e,t,b.Hx,d.Lz.Video,{statusCode:c.s.Ok,itemList:[p],hasMore:!0}),this._updateVideoIndex({newIndex:0,newId:_,enterMethod:a?m.c.VideoCoverClickAIGCDesc:m.c.VideoCoverClick,backendSourceEventTracking:null!=(g=null==f?void 0:f.backendSourceEventTracking)?g:""}),[4,h.getRelatedList({itemId:_,secUid:null==f?void 0:f.authorSecId})];case 1:return u.sent(),[2]}})}).call(this)},handleSwitchVideo:function(t){return(0,r._)(function(){var n,r,i,o,a,s,d,l,c,_,f,h,v,p;return(0,u.__generator)(this,function(u){switch(u.label){case 0:if(u.trys.push([0,3,,4]),E.l.getInstance(w.AU).reportVideoInteractStart({startTime:Date.now(),situation:w.uT.VideoDatailSelect}),r=t.newIndex,o=void 0===(i=t.enterMethod)?m.c.VideoDetailPage:i,s=void 0===(a=t.playStatusUpdate)||a,d=e(k).currentIndex,_=!(null==(c=void 0===(l=e(b.Hx).browserList)?[]:l)?void 0:c.length)||r<0||r===d||r>=c.length,h=null!=(f=c[r])?f:"",v=null==(n=e(y.Pu)[h])?void 0:n.authorSecId,p=(null==c?void 0:c.length)-r<6,_?console.warn("cannot switch to next video for some reasons"):this._updateVideoIndex({newIndex:r,newId:h,enterMethod:o,playStatusUpdate:s}),this.setSubtitleContent([]),!(p&&h))return[3,2];return[4,(0,b.OU)().getRelatedList({itemId:h,secUid:v})];case 1:u.sent(),u.label=2;case 2:return[3,4];case 3:return u.sent(),[3,4];case 4:return[2]}})}).call(this)},handleErrorRefresh:function(){return(0,r._)(function(){var n,r,i,o,a,s,l,h,v,p,g,w,E,C,T,V;return(0,u.__generator)(this,function(u){switch(u.label){case 0:return u.trys.push([0,5,,6]),o=(i=(0,I.x)()).abTestVersion,a=i.language,s=e(k).currentIndex,h=(void 0===(l=e(b.Hx).browserList)?[]:l)[s],v=null==(n=e(y.Pu)[h])?void 0:n.authorSecId,p=(0,_.oc)(),[4,(0,x.d1)({aid:f.xE,itemId:h,language:a,clientABVersions:(null==o?void 0:o.versionName)?null==o||null==(r=o.versionName)?void 0:r.split(","):[],video_encoding:p})];case 1:if(E=(w=null!=(g=u.sent())?g:{statusCode:c.s.UnknownError}).statusCode,C=w.itemInfo,T=(0,b.OU)(),E!==c.s.Ok)return[3,2];return V=null==C?void 0:C.itemStruct,T.resetRelatedList(),(0,S.Tj)(e,t,b.Hx,d.Lz.Video,{statusCode:c.s.Ok,itemList:[V],hasMore:!0}),this.setCurrentIndex(0),this._updateVideoIndex({newIndex:0,newId:h,enterMethod:m.c.VideoErrorAutoReload}),[3,4];case 2:return[4,T.getRelatedList({itemId:h,secUid:v})];case 3:u.sent(),u.label=4;case 4:return[3,6];case 5:return u.sent(),[3,6];case 6:return[2]}})}).call(this)},handleFirstVideo:function(n){try{var r,u=n.enterMethod,a=void 0===u?m.c.VideoDetailPage:u,s=n.playMode,d=void 0===s?g.ey.VideoDetail:s,l=e(b.Hx).browserList,c=void 0===l?[]:l,_=!(null==c?void 0:c.length)||0>c.length-1,f=null!=(r=c[0])?r:"";t(k,function(e){return(0,o._)((0,i._)({},e),{playMode:d})}),_?console.warn("cannot switch to first video for some reasons"):this._updateVideoIndex({newIndex:0,newId:f,enterMethod:a})}catch(e){}},handleRefreshWithId:function(n){return(0,r._)(function(){var r,i,o,a,s,l,h,v,p,g,w,E,C;return(0,u.__generator)(this,function(u){switch(u.label){case 0:return u.trys.push([0,5,,6]),o=(i=(0,I.x)()).abTestVersion,a=i.language,s=n.itemId,l=null==(r=e(y.Pu)[s])?void 0:r.authorSecId,h=(0,_.oc)(),[4,(0,x.d1)({aid:f.xE,itemId:s,language:a,clientABVersions:(null==o?void 0:o.versionName)?o.versionName.split(","):[],video_encoding:h})];case 1:if(g=(p=null!=(v=u.sent())?v:{statusCode:c.s.UnknownError}).statusCode,w=p.itemInfo,E=(0,b.OU)(),g!==c.s.Ok)return[3,2];return C=null==w?void 0:w.itemStruct,E.resetRelatedList(),(0,S.Tj)(e,t,b.Hx,d.Lz.Video,{statusCode:c.s.Ok,itemList:[C],hasMore:!0}),this.setCurrentIndex(0),this._updateVideoIndex({newIndex:0,newId:s,enterMethod:m.c.CreatorCard}),[3,4];case 2:return[4,E.getRelatedList({itemId:s,secUid:l})];case 3:u.sent(),u.label=4;case 4:return[3,6];case 5:return u.sent(),[3,6];case 6:return[2]}})}).call(this)},downloadTranscript:function(t){return(0,r._)(function(){var n,i,o,d,l;return(0,u.__generator)(this,function(c){switch(c.label){case 0:var _;return n=e(k).currentIndex,d=null!=(o=(void 0===(i=e(b.Hx).browserList)?[]:i)[n])?o:"",[4,(_=t,(0,r._)(function(){var e,t,n,i;return(0,u.__generator)(this,function(o){switch(o.label){case 0:if(e=N(_.subtitleInfos),t=Math.floor(new Date().getTime()/1e3),!e||!e.url||Number(null!=(n=null==e?void 0:e.expire)?n:0)<=t)return[2,[]];o.label=1;case 1:var d;return o.trys.push([1,3,,4]),[4,(d=e.url,(0,r._)(function(){return(0,u.__generator)(this,function(e){return[2,a.h.get(d,{baseUrlType:s.Z4.FixedWww})]})})())];case 2:return[2,(i=o.sent())?(0,p.ag)(i).cues:[]];case 3:return o.sent(),[2,[]];case 4:return[2]}})})())];case 1:return l=c.sent(),this.setSubtitleContent(l),(0,y.ud)().updateItem({id:d,hasTranscript:l.length>0}),[2]}})}).call(this)},_updateVideoIndex:function(n){var r=n.newIndex,u=n.newId,a=n.enterMethod,s=n.backendSourceEventTracking,d=n.playStatusUpdate,l=e(k).playMode,c=e(h.az).isMiniPlayerShowing;c&&l!==g.ey.OneColumn&&(0,h.uZ)().updateVideoIndex({newId:u,newIndex:r});var _={currentVideo:{index:r,id:u,mode:c?g.ey.MiniPlayer:l},playProgress:0,teaParams:{isVideoDetail:!0,enterMethod:a,backendSourceEventTracking:s}};(void 0===d||d)&&(0,C.LM)().updateVideo(_),t(k,function(e){return(0,o._)((0,i._)({},e),{currentIndex:r})})}}}),D=V.useAtomService,L=V.useServiceDispatchers,U=V.useServiceState;function N(e){var t=null==e?void 0:e.find(function(e){return("1"===e.Version||"3"===e.Version)&&e.Format===p._D.WebVTT});if((null==t?void 0:t.Url)&&(null==t?void 0:t.LanguageCodeName))return{url:t.Url,language:v(t.LanguageCodeName),expire:t.UrlExpire}}V.getStaticApi},29781:function(e,t,n){n.d(t,{Hs:function(){return p},MA:function(){return h},Q4:function(){return w},Zd:function(){return g},mx:function(){return f},n5:function(){return m},yy:function(){return v}});var r=n(40099),i=n(11854),o=n(19960),u=n(48859),a=n(50173),s=n(35379),d=n(72702),l=n(43264),c=n(31926),_=n(16859),f=function(e){return void 0!==(null==e?void 0:e.imagePost)},h=function(e){var t,n,r=f(e);return{aweme_type:150*!!r,pic_cnt:r?null==e||null==(n=e.imagePost)||null==(t=n.images)?void 0:t.length:void 0}},v=function(e,t){var n,u,a=(0,c.k)(e),l=(0,s.nW)(function(e){var t;return e.users[null!=(t=null==a?void 0:a.author)?t:""]},i.bN),f=null!=(n=null==a?void 0:a.video)?n:{},h=f.width,v=f.height,p=f.duration,g=f.ratio,m=(0,d.F3)(),w=(0,r.useMemo)(function(){return Object.keys(m)},[m]),E=(0,_.bE)(w,t),I=null!=a?a:{},b=I.createTime,y=I.authorStats,S=(void 0===y?{}:y).followerCount,C=void 0===S?0:S,T=I.stats,x=void 0===T?{}:T,k=x.diggCount,V=x.playCount,D=void 0===V?0:V,L=x.shareCount,U=x.commentCount,N=x.collectCount;return{video_freshness:(0,o.QR)(Number(void 0===b?0:b)),video_duration:void 0===p?0:p,video_like_history:void 0===k?0:k,video_vv_history:D,video_share_history:void 0===L?0:L,video_comment_history:void 0===U?0:U,video_favorite_history:Number(void 0===N?0:N),video_resolution:(0,o.sG)(void 0===g?"":g),video_is_portrait:+((void 0===v?0:v)>(void 0===h?0:h)),video_100k_vv:+(D>=1e5),video_creator_bluev:null!=(u=null==l?void 0:l.verified)&&u?1:0,video_creator_1k_follower:+(C>=1e3),video_creator_10k_follower:+(C>=1e4),video_creator_100k_follower:+(C>=1e5),video_next_info:JSON.stringify(E)}},p=function(e){var t,n=(0,c.k)(e),r=null!=(t=null==n?void 0:n.video)?t:{};return{video_width:r.width,video_height:r.height,video_duration:r.duration}},g=function(e){var t,n=e.id,r=e.play_mode,i=void 0===r?u.Tk.OneColumn:r,o=(null!=(t=(0,l.W)(function(){return["wid"]},[]))?t:{}).wid,s=(0,c.k)(n),d=null==s?void 0:s.ad_info;if(d){var _=(0,a.n5)({ad_info:d,play_mode:i});return _.ad_extra_data={user_session:o},_}},m=function(e,t){var n;if(t)return null!=(n=null==e?void 0:e.isPinnedItem)&&n},w=function(e){var t;return!!(null==e||null==(t=e.AnchorTypes)?void 0:t.some(function(e){return"33"===e.toString()}))&&!e.video.playAddr}},85460:function(e,t,n){n.d(t,{ag:function(){return g},_D:function(){return i},IB:function(){return w}});var r,i,o=n(48748),u=n(95170),a=n(7120),s=n(112),d=function(e){function t(){return(0,u._)(this,t),(0,o._)(this,t,arguments)}return(0,a._)(t,e),t}((0,s._)(Error)),l=function(e){function t(){return(0,u._)(this,t),(0,o._)(this,t,arguments)}return(0,a._)(t,e),t}((0,s._)(Error)),c=function(e){function t(){return(0,u._)(this,t),(0,o._)(this,t,arguments)}return(0,a._)(t,e),t}((0,s._)(Error)),_=function(e){function t(){return(0,u._)(this,t),(0,o._)(this,t,arguments)}return(0,a._)(t,e),t}((0,s._)(Error)),f=function(e){function t(){return(0,u._)(this,t),(0,o._)(this,t,arguments)}return(0,a._)(t,e),t}((0,s._)(Error)),h=function(e){function t(){return(0,u._)(this,t),(0,o._)(this,t,arguments)}return(0,a._)(t,e),t}((0,s._)(Error)),v=function(e){function t(){return(0,u._)(this,t),(0,o._)(this,t,arguments)}return(0,a._)(t,e),t}((0,s._)(Error)),p=/([0-9]{1,2})?:?([0-9]{2}):([0-9]{2}\.[0-9]{2,3})/;(r=i||(i={})).WebVTT="webvtt",r.CreatorCaption="creator_caption";var g=function(e,t){if(!e||"string"!=typeof e)return{cues:[]};t||(t={});var n,r,i,o,u=t.meta,a=void 0!==u&&u,s=t.strict,g=void 0===s||s,w=(e=(e=(e=e.trim()).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).split("\n\n"),E=w.shift();if(!(null==E?void 0:E.startsWith("WEBVTT")))throw new d('Must start with "WEBVTT"');var I=E.split("\n"),b=I[0].replace("WEBVTT","");if(b.length>0&&" "!==b[0]&&" "!==b[0])throw new l("Header comment must start with space or tab");if(0===w.length&&1===I.length)return{valid:!0,strict:g,cues:[],errors:[]};if(!a&&I.length>1&&""!==I[1])throw new c("Missing blank line after signature");var y=(n=w,r=g,i=[],{cues:n.map(function(e,t){try{return function(e,t,n){var r,i,o=0,u=.01,a="",s=e.split("\n").filter(Boolean);if(s.length>0&&s[0].trim().startsWith("NOTE"))return null;if(1===s.length&&!s[0].includes("--\x3e"))throw new _("Cue identifier cannot be standalone (cue #".concat(t,")"));if(s.length>1&&!(s[0].includes("--\x3e")||s[1].includes("--\x3e")))throw new f("Cue identifier needs to be followed by timestamp (cue #".concat(t,")"));var d=s[0].split(" --\x3e ");if(2!==d.length||!function(e){return p.test(e)}(d[0])||!function(e){return p.test(e)}(d[1]))throw new h("Invalid cue timestamp (cue #".concat(t,")"));var l=(i=(r=d[0].split(".")[0]).split(":"),"00"!==i[0]?r:"".concat(i[1],":").concat(i[2]));if(o=m(d[0]),u=m(d[1]),n){if(o>u)throw new v("Start timestamp greater than end (cue #".concat(t,")"));if(u<=o)throw new v("End must be greater than start (cue #".concat(t,")"))}if(!n&&u<o)throw new v("End must be greater or equal to start when not strict (cue #".concat(t,")"));return s.shift(),!!(a=s.join("\n"))&&{start:o,end:u,text:a,startStr:l}}(e,t,r)}catch(e){return i.push(e),null}}).filter(Boolean),errors:i}),S=y.cues,C=y.errors;if(g&&C.length>0)throw C[0];var T=a?(o={},I.slice(1).forEach(function(e){var t=e.indexOf(":"),n=e.slice(0,t).trim(),r=e.slice(t+1).trim();o[n]=r}),Object.keys(o).length>0?o:null):null,x={valid:0===C.length,strict:g,cues:S,errors:C,meta:{}};return a&&T&&(x.meta=T),x};function m(e){var t=e.match(p),n=60*parseFloat(t[1]||"0")*60;return n+=60*parseFloat(t[2]),Number((n+=parseFloat(t[3])).toFixed(6))}var w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.WebVTT,n=null==e?void 0:e.find(function(e){var n,r=Math.floor(new Date().getTime()/1e3);return("1"===e.Version||"3"===e.Version)&&Number(null!=(n=null==e?void 0:e.UrlExpire)?n:0)>r&&e.Format===t});return null==n?void 0:n.Url}},95533:function(e,t,n){n.d(t,{q:function(){return l}});var r=n(5377),i=n(45996),o=n(77226),u=n(67503),a=n(60724),s=n(47149),d=n(71443),l={handleEnterTagDetail:function(e){o.f.sendEvent("enter_tag_detail",e)},handleEnterMusicDetail:function(e){o.f.sendEvent("enter_music_detail",e)},handleDiscoveryPage:function(e){o.f.sendEvent("enter_discovery_page",e)},handleEnterTopic:function(e){o.f.sendEvent("enter_topics_page",e)},handleEnterTrending:function(e){o.f.sendEvent("enter_homepage_hot",e)},handleEnterUser:function(e){o.f.sendEvent("enter_personal_detail",e),void 0!==e.group_id?(0,u.J2)(a.DK,e.group_id):(0,u.X)(a.DK)},handleEnterProfile:function(e){o.f.sendEvent("enter_personal_homepage",e)},handleEnterVideo:function(e){o.f.sendEvent("enter_video_detail",e)},handleEnterQuestion:function(e){o.f.sendEvent("enter_qa_detail_page",e)},handleEnterSet:function(e){o.f.sendEvent("enter_setting_page",e)},handleEnterFollowing:function(e){o.f.sendEvent("enter_homepage_follow",e)},handleEnterSuicidePrevention:function(e){o.f.sendEvent("tns_show_ssh_tips_support_page",e)},handleEnterLive:function(e){o.f.sendEvent("enter_live_detail",e)},handleEnterBusiness:function(){o.f.sendEvent("enter_business_suite")},handleEnterLiveDiscover:function(e){o.f.event("enter_live_discover",(0,i._)((0,r._)({},e),{click_type:e.click_type?e.click_type:"enter_live"}))},handleEnterKeyboardShortcut:function(){o.f.sendEvent("enter_keyboard_setting")},handleEnterMessage:function(e){o.f.sendEvent("enter_homepage_message",(0,r._)({enter_method:s.c.ClickButton},e))},handleEnterMusicPlaylist:function(e){o.f.sendEvent("enter_live_discover",e)},handleEnterQADetailPage:function(e){o.f.sendEvent("enter_qa_detail_page",e)},handleEnterPoi:function(e){var t=e.enter_method,n=e.play_mode,r=e.author_id,i=e.group_id,u=e.id,a=e.type,s=e.cityCode,l=e.countryCode,c=e.typeCode,_=e.isClaimed,f=e.ttTypeCode,h=e.ttTypeNameMedium,v=e.ttTypeNameSuper,p=e.ttTypeNameTiny;o.f.sendEvent("enter_poi_detail",{enter_method:t,play_mode:n,author_id:r,group_id:i,poi_id:u,poi_detail_type:d.Af[null!=a?a:0],is_claimed:+!!_,poi_city:s,poi_region_code:l,tt_poi_backend_type:"".concat(v,",").concat(h,",").concat(p,"|").concat(f),poi_type_code:c})},handleEnterExplore:function(e){var t=e.enter_method;o.f.sendEvent("enter_explore_page",{enter_method:t})},handleEnterFriends:function(e){var t=e.enter_method;o.f.sendEvent("enter_friends_page",{enter_method:t})}}}}]); |