PageSourceSearch

https://vidgap.com/_next/static/chunks/6802.39c2ee37cb50fb38.js

js vidgap.com collected 2026-10-08 23:43:21 UTC 155,698 bytes, 8 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6802],{2892:(e,t,n)=>{"use strict";n.d(t,{TD:()=>r,YG:()=>s,Yb:()=>l,fV:()=>a,pn:()=>o});var i=n(8263);function o(e){var t;return/-slide-\d+-offline$/.test(e)&&(t=e,!/-slide-\d+(?:[-_])live-offline$/.test(t))}function a(e){if(!o(e))return null;let t=e.match(/^(.+-slide)-\d+-offline$/);return t?t[1]:null}function r(e){let t=e.match(/-slide-(\d+)(?:(?:[-_])live)?-offline$/);return t?parseInt(t[1],10):0}function l(e){let t=new Map;for(let n of e){if(!o(n.id))continue;let e=r(n.id);t.has(e)||t.set(e,n)}return[...t.entries()].sort(([e],[t])=>e-t).map(([,e])=>e)}async function s(e){return"video"===e.type?new Promise((t,n)=>{let i=document.createElement("video"),o=URL.createObjectURL(e.blob);i.src=o,i.muted=!0,i.playsInline=!0,i.onloadedmetadata=()=>{i.currentTime=0},i.onseeked=()=>{let e=document.createElement("canvas");e.width=i.videoWidth,e.height=i.videoHeight;let a=e.getContext("2d");a?(a.drawImage(i,0,0,e.width,e.height),t(e.toDataURL("image/png"))):n(Error("Could not get canvas context.")),URL.revokeObjectURL(o)},i.onerror=()=>{URL.revokeObjectURL(o),n(Error("Error loading video for thumbnail generation."))}}):(0,i.e)(e.blob,e.inputUrl)}},4190:e=>{e.exports={collectionPreview:"PreviewCollection_collectionPreview__61PIf"}},4555:e=>{e.exports={subtitleStripInContent:"SubtitlePreviewer_subtitleStripInContent__2Fm_x",previewerContentHead:"SubtitlePreviewer_previewerContentHead__Ul4fl",subtitlePreviewStrip:"SubtitlePreviewer_subtitlePreviewStrip__bdSzo",light:"SubtitlePreviewer_light__TG_HS",dark:"SubtitlePreviewer_dark__DW_lR",subtitlePreviewList:"SubtitlePreviewer_subtitlePreviewList__JywWk",notFoundText:"SubtitlePreviewer_notFoundText__2h1QG",subtitleItem:"SubtitlePreviewer_subtitleItem__iIuex",time:"SubtitlePreviewer_time__w_Fv5",text:"SubtitlePreviewer_text__OCO6j",controlsTopInner:"SubtitlePreviewer_controlsTopInner__yDuQv",formatDownloadWrap:"SubtitlePreviewer_formatDownloadWrap__FOOgi",copyButtonWrap:"SubtitlePreviewer_copyButtonWrap__WvcRB"}},7646:e=>{e.exports={picker:"PlaylistPickerCard_picker__rcooL",emptyStage:"PlaylistPickerCard_emptyStage__8ktyi",playlistIcon:"PlaylistPickerCard_playlistIcon__R8tgC",dark:"PlaylistPickerCard_dark__Y53s4",light:"PlaylistPickerCard_light__oBR7J",traySlot:"PlaylistPickerCard_traySlot__2vYnV"}},8263:(e,t,n)=>{"use strict";async function i(e,t){let i,o,a=e;if(i=e.type?.toLowerCase()??"",o=t?.toLowerCase()??"","image/heic"===i||"image/heif"===i||o.includes(".heic")||o.includes(".heif"))try{let t=(await n.e(2e3).then(n.t.bind(n,15079,23))).default;a=await t({blob:e,toType:"image/jpeg",quality:1})}catch{a=e}return URL.createObjectURL(a)}n.d(t,{e:()=>i})},11602:(e,t,n)=>{"use strict";n.d(t,{Co:()=>i,Ek:()=>o,a0:()=>a,zd:()=>r});let i="on_tracks";function o(e,t){if(!e)return"";if(e.subtitle===i&&e.tracks?.length){let n=t?e.tracks.find(e=>e.langCode===t):e.tracks[0];return n?.subtitle?.trim()??""}return e.subtitle?.trim()??""}function a(e){return!!e&&(e.subtitle===i?(e.tracks??[]).some(e=>e.subtitle?.trim()):!!e.subtitle?.trim())}function r(e){if(e&&e.subtitle===i&&e.tracks?.length)return e.tracks[0].langCode}},12750:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(95155);n(12115);var o=n(44921);let a=()=>(0,i.jsx)(o.A,{showMid:!1})},12979:e=>{e.exports={shareContainerV3:"ShareComponentV3_shareContainerV3__ObNIJ",dark:"ShareComponentV3_dark__7Bb6L",light:"ShareComponentV3_light___jmws",title:"ShareComponentV3_title__I7r0S",left:"ShareComponentV3_left__mYtfQ",right:"ShareComponentV3_right__MfSDO",mid:"ShareComponentV3_mid__0ohl9",button:"ShareComponentV3_button__vfWmQ",qrCodeModal:"ShareComponentV3_qrCodeModal__LIygr",qrCodeContainer:"ShareComponentV3_qrCodeContainer__T_24g",urlContainer:"ShareComponentV3_urlContainer__KjPB0",urlText:"ShareComponentV3_urlText__AHZoq",urlCopyBtn:"ShareComponentV3_urlCopyBtn__BNCfX"}},17585:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});let i=(e,t={watermark:!1,hd:!1,token:"",index:0})=>{let{watermark:n,hd:i,token:o,index:a}=t;return`https://io1.vidgap.com/api/download/content/video/buffer?id=${e}&idx=${a}&wm=${n?"1":"0"}&hd=${i?"1":"0"}&token=${o}`}},18707:e=>{e.exports={tray:"HighlightTray_tray__a1e1J",list:"HighlightTray_list__Oghe4",dark:"HighlightTray_dark__vWd4V",light:"HighlightTray_light__Nehjm",item:"HighlightTray_item__oGyiE",button:"HighlightTray_button__b1xnp",ring:"HighlightTray_ring__F_OJc",cover:"HighlightTray_cover__kkmUm",title:"HighlightTray_title__98MmL",count:"HighlightTray_count__uUq5M"}},20980:e=>{e.exports={highlightPreview:"PreviewHighlight_highlightPreview__O7abf"}}
1,21329:(e,t,n)=>{"use strict";function i(e){if(!e||"string"!=typeof e)return"icon";let t=e.replace(/[\uFFFD]/g,"").replace(/[\u0000-\u001F]/g,"").replace(/[\u007F-\u009F]/g,"").replace(/[\u{1F600}-\u{1F64F}]/gu,"").replace(/[\u{1F300}-\u{1F5FF}]/gu,"").replace(/[\u{1F680}-\u{1F6FF}]/gu,"").replace(/[\u{1F1E0}-\u{1F1FF}]/gu,"").replace(/[\u{1F700}-\u{1F77F}]/gu,"").replace(/[\u{1F780}-\u{1F7FF}]/gu,"").replace(/[\u{1F800}-\u{1F8FF}]/gu,"").replace(/[\u{1F900}-\u{1F9FF}]/gu,"").replace(/[\u{1FA00}-\u{1FA6F}]/gu,"").replace(/[\u{1FA70}-\u{1FAFF}]/gu,"").replace(/[\u{2600}-\u{26FF}]/gu,"").replace(/[\u{2700}-\u{27BF}]/gu,"").replace(/[\u{2B50}-\u{2B55}]/gu,"").replace(/[\u{FE0E}\u{FE0F}]/gu,"").replace(/[\u{200D}]/gu,"").replace(/[\u{20E3}]/gu,"").replace(/[\u{E000}-\u{F8FF}]/gu,"").replace(/[★☆♠♣♥♦♪♫☎☏☺☻☼♀♂]/g,"").replace(/[←↑→↓↔↕⇐⇑⇒⇓⇔⇕]/g,"").replace(/[■□▲△▼▽◆◇○●◎◉]/g,"").replace(/[©®™℗℠]/g,"").replace(/[€£¥₹₽$¢]/g,"").replace(/[°±×÷√∞≈≠≤≥]/g,"").replace(/[…–—''""„‚‛]/g,"").replace(/\.{3,}$/g,"").replace(/\s*\.{3,}\s*/g," ").replace(/\s+/g," ").trim();return""===t?"icon":t}function o(e){if(!e)return"";if(e.length<=45)return e;let t=i(e).slice(0,45),n=0;for(let e of t)" "===e&&n++;return e.slice(0,45+n)+"..."}function a(e){return i(e)}function r(e){return i(e).replace(/[^a-zA-Z0-9\-_\s]/g,"_").replace(/\s+/g,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,"").slice(0,60)||"vidgap"}function l(e){if(!e)return"";let t=e.match(/#\S+/g);return t?t.join(" "):""}function s(e){if(!e)return"";let t=e.match(/@\S+/g);return t?t.join(" "):""}function d(e){return i(e)}function c(e){return e?i(e).replace(/#\S+/g,"").replace(/@\S+/g,"").replace(/\s+/g," ").trim():""}n.d(t,{Z4:()=>c,Ft:()=>l,PB:()=>s,MV:()=>d,iO:()=>r,Qg:()=>a,tR:()=>o})},23116:(e,t,n)=>{"use strict";n.d(t,{A:()=>S});var i=n(95155),o=n(12115),a=n(21338),r=n(75917),l=n.n(r),s=n(247),d=n(72575),c=n(33856),u=n(69730),p=n.n(u),_=n(27898),m=n(65149),h=n(17585),g=n(64666),w=n(34519),f=n(6442),v=n(3701),x=n(95555),b=n(92843),C=n(28105);let y=e=>(0,i.jsx)(D,{...e});y.displayName="VideoProgressBarAmplified";let S=y,k=e=>{let t=(0,i.jsxs)("div",{className:l().progress_bar_info_slideshow_to_video_v2,children:[(0,i.jsx)("span",{className:l().progress_bar_info_slideshow_to_video_v2_percentage,children:e.dlHDinitiationDetails.eta}),(0,i.jsx)("div",{className:l().progress_bar_info_slideshow_to_video_v2_text_ctn,children:(0,i.jsx)("span",{className:l().progress_bar_info_slideshow_to_video_v2_text,children:e.dlHDinitiationDetails.text})})]});return(0,i.jsxs)("div",{className:p()(l().progress_bar,{[l().dark]:e.isDark}),children:[e.percentage>0?(0,i.jsx)("div",{className:p()(l().progress_bar_fill,{[l().dark]:e.isDark}),style:{width:`${e.percentage}%`}}):(0,i.jsx)(_.A,{isDark:e.isDark}),(0,i.jsx)("span",{className:p()(l().progress_bar_info,{[l().dark]:e.isDark,[l().centered]:!0}),children:e.percentage>0?`${e.percentage.toFixed(2)}%`:t})]})},T=e=>{o.useEffect(()=>{(0,C.gg)("VideoProgressBarAmplified - using optimized stream socket")},[]);let t=e._id+"-offline",{socket:n,isConnected:r}=(0,f.Ll)();(0,x.md)(b.B);let{sizeCtx:u,loadedCtx:y,initTimeCtx:S,currentTimeCtx:k,setSizeHandlerCtx:T,setLoadedHandlerCtx:D,setInitHandlerCtx:P,setCurrentHandlerCtx:I,progressResetCtx:j,downloadStatusHandlerCtx:N,onDownloadIdHandlerCtx:L,downloadIdQueueCtx:V,downloadIdQueueHandlerCtx:A,downloadedListHandlerCtx:O,showInstallCardHandlerCtx:B,downloadedListCtx:E,videoDataCtx:U,userHighlightDataCtx:F,activeHighlightIdCtx:R,highlightContentDataCtx:$,userPlaylistDataCtx:M,activePlaylistIdCtx:G,playlistContentDataCtx:W,amplifiedDownloadDataCtx:H,progressBarUIOnlyCtx:q}=o.useContext(s.Ay),z="https://vidgap.com",[Z,K]=o.useState(null),[X,Y]=o.useState(!0);new AbortController;let J=o.useRef(null),Q=o.useRef(!1),ee=o.useRef(!1);o.useEffect(()=>{if(!q&&v.co&&e._id.includes("-hd")&&H&&H.hdUrl){O(e._id),N("DOWNLOADED"),A(),window.open(H?.hdUrl,"_blank");return}},[q,H]),o.useEffect(()=>{let t;if(!e._id.includes("-hd")||q||v.co)return;if((0,C.gg)("⚡ download-hd useEffect triggered:",{_id:e._id,socketAvailable:!!n,socketConnected:n?.connected,isConnectedState:r}),!n)return void(0,C.SZ)("❌ Socket not available! This should not happen with synchronous init");if(Q.current)return;let i=(0,w.getCookie)("download_token");if(!i)return void(0,C.gg)("download_token not found");let o=e._id.match(/(\d{19})/gi);if(!o)return;let a=o[0];J.current||(J.current=(0,g.l)());let l=J.current;if(e._id.includes("-live")){let n=e._id.match(/slide-(\d+)/);t=parseInt(n?n[1]:"1")}if(e._id.includes("-story")){let n=e._id.match(/story-(\d+)/);t=parseInt(n?n[1]:"1")}let s=(0,h.K)(a,{hd:!0,token:i,watermark:!1,index:t}),d=`${s}&sessionId=${l}&debugurlid=${e._id}`,c=t=>{ee.current=!0;let n=document.createElement("a");n.href=d,n.download=e.filename||`video_${a}.mp4`,n.style.display="none",document.body.appendChild(n),n.click(),setTimeout(()=>{document.body.contains(n)&&document.body.removeChild(n)},100)},u=t=>
1{e.setDlHDinitiationDetails({eta:t.eta||"",text:e.waitingText||v.Sy})},p=t=>{e.setDlHDinitiationDetails({eta:t.eta||"",text:e.downloadingText||v.Sy})},_=t=>{e.setDlHDinitiationDetails({eta:t.eta||"",text:v.xL}),setTimeout(()=>{(0,C.gg)("✅ download-hd marking as DOWNLOADED"),N("DOWNLOADED"),O(e._id),A()},1e3)},m=t=>{t&&t.videoURL&&(window.open(t.videoURL,"_blank"),N("DOWNLOADED"),O(e._id),A())};return Q.current=!0,n.on("authenticate",c),n.on("on-waiting",u),n.on("buffer-update",p),n.on("stream-start",_),n.on("buffer-error",m),r?((0,C.gg)("✅ download-hd socket already connected, authenticating with UUID:",l),n.emit("authenticate",l),ee.current=!0):n.connect(),()=>{n.off("authenticate",c),n.off("on-waiting",u),n.off("buffer-update",p),n.off("stream-start",_),n.off("buffer-error",m),n.connected&&n.disconnect(),Q.current=!1,ee.current=!1,J.current=null}},[n,e._id,q]),o.useEffect(()=>{e._id.includes("-hd")&&n&&Q.current&&!q&&r&&!ee.current&&J.current&&(n.emit("authenticate",J.current),ee.current=!0)},[r,e._id,n,q]),o.useEffect(()=>{if(!e._id.includes("-hd")&&!q&&e._id!==v.hu){let n=a.A.CancelToken.source();return K(n),P(new Date().getTime()),(async e=>await (0,d.HC)(e))(t).then(t=>{if(t){let n=t.blob,i=URL.createObjectURL(n),o=document.createElement("a");o.href=i,o.download=e.filename,o.click(),O(e._id),A()}else{if(!((0,m.WI)(e.url)||H))return;{let t=e._id.includes("hd")?"hd":e._id.includes("-non_wm")?"non_wm":"wm",i={non_wm:H?.nonWmUrl||e.url,wm:H?.wmUrl||e.url,hd:e.url}[t];a.A.get(i,{onDownloadProgress:function(e){I(new Date().getTime()),D(e.loaded),e.total&&e.total>0&&e.total!==u&&T(e.total)},method:"GET",responseType:"blob",cancelToken:n.token,headers:{"content-type":{video:"video/mp4",audio:"audio/mpeg",image:"image/png",profile:"image/png"}[e.dataType]}}).then(async t=>{if(fetch(`${z}/api/video/success`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:"string"==typeof t.request?.responseURL&&t.request.responseURL||i})}),setTimeout(()=>{N("DOWNLOADED")},1e3),e._id.includes("-offline")||e.offline_id){let n=e.offline_id??e._id,{title:i,username:o}=(0,c.nK)(n,{videoDataCtx:U,userHighlightDataCtx:F,activeHighlightIdCtx:R,highlightContentDataCtx:$,userPlaylistDataCtx:M,activePlaylistIdCtx:G,playlistContentDataCtx:W});await (0,d.e_)({blob:t.data,id:n,title:i,username:o,date:new Date,expiry:new Date(Date.now()+12096e5),type:e.dataType,inputUrl:e.inputUrl,duration:U?.duration}),e.offline_id?O(e.offline_id):O(e._id),A()}if(!e._id.includes("-offline")&&!e.offline_id){let n=URL.createObjectURL(t.data),i=document.createElement("a");i.href=n,i.download=e.filename,i.click(),O(e._id),A()}}).catch(e=>{"ERR_NETWORK"===e.code&&fetch(`${z}/api/video/failure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:"string"==typeof e.request?.responseURL&&e.request.responseURL||i})}),a.A.isCancel(e)?(N("CANCEL"),(0,C.SZ)("message: "+e.message)):((0,C.SZ)("DOWNLOAD-ERROR: ",e),N("FAILED"))})}}}),function(){j()}}},[q]),o.useEffect(()=>{e._id.includes("-hd")||q||e._id===v.hu&&1==V.length&&(A(),N("DOWNLOADED"),O(e._id))},[V,q]);let[et,en]=o.useState(e.initialPercentage);return o.useEffect(()=>{if(e._id.includes("-hd")||q)return;let t=Math.floor(y/u*(100-e.initialPercentage));t>0&&en(t+e.initialPercentage)},[V,y,u,q]),(0,i.jsxs)("div",{className:p()(l().progress_bar,{[l().dark]:e.isDark}),children:[et>0?(0,i.jsx)("div",{className:p()(l().progress_bar_fill,{[l().dark]:e.isDark}),style:{width:`${et}%`}}):(0,i.jsx)(_.A,{isDark:e.isDark}),(0,i.jsx)("span",{className:p()(l().progress_bar_info,{[l().dark]:e.isDark,[l().centered]:!e.withSpeed}),children:et>0?`${et.toFixed(2)}% ${e.withSpeed?` | ${Math.floor(y/(k-S))} KB/s`:""}`:e.downloadingText})]})},D=e=>{let{amplifiedDownloadDataCtx:t,amplificationProgressCtx:n}=o.useContext(s.Ay),[a,r]=o.useState({text:e.downloadingText||"Establishing Connection",eta:""});return t?(0,i.jsx)(T,{...e,initialPercentage:n,dlHDinitiationDetails:a,setDlHDinitiationDetails:r}):(0,i.jsx)(k,{percentage:n,isDark:e.isDark,dlHDinitiationDetails:a})}},24867:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var i=n(12115);let o=(e,t)=>
1{let[n,o]=(0,i.useState)("loading"),a=(0,i.useRef)(null),r="string"==typeof e?e:e.adUnitPath,l="string"!=typeof e&&"function"==typeof e.onRewardGranted?e.onRewardGranted:t;(0,i.useEffect)(()=>{if(!r)return;window.googletag||(window.googletag={cmd:[]});let{googletag:e}=window;return e.cmd.push(()=>{try{e.pubads().disableInitialLoad(),e.pubads().addEventListener("rewardedSlotReady",e=>{o("ready")}),e.pubads().addEventListener("slotRenderEnded",e=>{e.isEmpty&&o("no-fill")}),e.pubads().addEventListener("rewardedSlotGranted",e=>{l&&l()}),e.pubads().addEventListener("rewardedSlotClosed",t=>{o("loading"),a.current&&e.pubads().refresh([a.current])}),e.pubads().enableSingleRequest(),e.enableServices();let t=e.defineOutOfPageSlot(r,e.enums.OutOfPageFormat.REWARDED);t&&(t.addService(e.pubads()),a.current=t,e.display(t),e.pubads().refresh([t]))}catch(e){}}),()=>{a.current&&window.googletag?.cmd.push(()=>{window.googletag?.destroySlots([a.current]),a.current=null})}},[r,l]);let s=(0,i.useCallback)(()=>{"ready"===n&&a.current&&window.googletag.cmd.push(()=>{try{let e=a.current;e?.makeRewardedVisible&&e.makeRewardedVisible()}catch(e){}})},[n]);return{adStatus:n,showAd:s}}},27898:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var i=n(95155),o=n(31942),a=n.n(o);n(12115);var r=n(69730),l=n.n(r);let s=e=>(0,i.jsx)("div",{className:l()(a().skeletonBar,{[a().light]:!e.isDark})});s.displayName="SkeletonBar";let d=s},28137:(e,t,n)=>{"use strict";n.d(t,{LB:()=>s,S:()=>l,qu:()=>d,uU:()=>r});var i=n(3701),o=n(59034),a=n(57504);function r(e){let t=encodeURIComponent(e),n=`https://web.facebook.com/sharer/sharer.php?u=${t}&src=sdkpreparse`;return{whatsapp:`https://wa.me/?text=${t}`,facebook:n,twitter:`https://twitter.com/intent/tweet?text=${t}`,telegram:`https://t.me/share/url?url=${t}&text=`,messenger:`fb-messenger://share/?link=${t}&app_id=566090842322237`}}function l(e,t){navigator.clipboard.writeText(e.includes("https://vidgap.com")?e:`https://vidgap.com${e}`),t("COPIED")}function s(e,t){let n="";if((0,o.n)(e)){let o="all"==i.eq[t]?"":`/${i.eq[t]}`;n=`https://vidgap.com${o}/download/${e}`}else(0,a.B)(e)&&(n=`https://vidgap.com/profile/download/${e}`);return n}function d(e,t){let n=s(e,t);console.log("generatedShareurl",n),navigator.clipboard.writeText(n)}},30003:(e,t,n)=>{"use strict";n.d(t,{FL:()=>a,NC:()=>o,VV:()=>r});var i=n(15455);let o=(0,i.eU)({}),a=(0,i.eU)(e=>{let t=Object.entries(e(o));return t.length>0&&t.every(([,e])=>e)}),r=(0,i.eU)(0)},30832:(e,t,n)=>{"use strict";n.d(t,{a:()=>o});var i=n(9339);let o=(0,i.createServerReference)("606e62ae886e1fb9fa8b47e7c831f396ac8adb9c7f",i.callServer,void 0,i.findSourceMapURL,"ensureVideoAccessCookie")},31413:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var i=n(95155),o=n(12115),a=n(69730),r=n.n(a),l=n(133),s=n(33942),d=n.n(s);let c=(e,t)=>r()(e,d().skeleton,d().shimmer,d().pulse,{[d().dark]:"dark"===t,[d().light]:"light"===t}),u=({showMid:e})=>{let{themeCtx:t}=o.useContext(l.A);return(0,i.jsxs)("div",{className:d().container,children:[(0,i.jsx)("div",{className:d().floatingThumbnailContainer,children:(0,i.jsx)("div",{className:c(d().thumbnailSkeleton,t)})}),(0,i.jsx)("div",{className:d().previewer,children:(0,i.jsxs)("div",{className:d().previewer_screen,children:[(0,i.jsx)("div",{className:c(d().screenSkeleton,t)}),(0,i.jsxs)("div",{className:d().info,children:[(0,i.jsx)("div",{className:c(d().titleSkeleton,t)}),(0,i.jsxs)("div",{className:d().infoBottom,children:[(0,i.jsxs)("div",{className:d().profile,children:[(0,i.jsx)("div",{className:c(d().profilePicSkeleton,t)}),(0,i.jsx)("div",{className:c(d().usernameSkeleton,t)})]}),(0,i.jsx)("div",{className:c(d().timePostedSkeleton,t)})]})]}),(0,i.jsxs)("div",{className:r()(d().previewer_controls,{[d().dark]:"dark"===t,[d().light]:"light"===t}),children:[(0,i.jsxs)("div",{className:d().previewerControlsGroup,children:[(0,i.jsxs)("div",{className:d().previewerControlsTop,children:[(0,i.jsx)("div",{className:d().previewerControlsTopLeft,children:(0,i.jsx)("div",{className:c(d().buttonSkeletonLeft,t)})}),(0,i.jsx)("div",{className:d().previewerControlsTopRight,children:(0,i.jsx)("div",{className:c(d().buttonSkeletonRight,t)})})]}),e&&(0,i.jsx)("div",{className:d().previewerControlsMid,children:(0,i.jsx)("div",{className:c(d().buttonSkeletonMid,t)})}),(0,i.jsx)("div",{className:d().previewerControlsBottom,children:(0,i.jsxs)("div",{className:d().postDownloadSkeleton,children:[(0,i.jsx)("div",{className:c(d().postDownloadButtonSkeleton,t)}),(0,i.jsx)("div",{className:c(d().postDownloadButtonSkeleton,t)}),(0,i.jsx)("div",{className:c(d().postDownloadButtonSkeleton,t)})]})})]}),(0,i.jsxs)("div",{className:d().shareSkeleton,children:[(0,i.jsx)("div",{className:d().shareButtonSkeleton,children:(0,i.jsx)("div",{className:c(d().shareButtonBar,t)})}),(0,i.jsx)("div",{className:d().shareButtonSkeleton,children:(0,i.jsx)("div",{className:c(d().shareButtonBar,t)})}),(0,i.jsx)("div",{className:d().shareButtonSkeleton,children:(0,i.jsx)("div",{className:c(d().shareButtonBar,t)})})]})]})]})})]})}},31942:e=>{e.exports={skeletonBar:"SkeletonBar_skeletonBar__Hu9vT",skeleton:"SkeletonBar_skeleton__HfLN6",light:"SkeletonBar_light__rsKb_"}},33856:(e,t,n)=>{"use strict";n.d(t,{B5:()=>s,FQ:()=>w,KN:()=>p,RP:()=>v,T7:()=>_,VU:()=>m,aq:()=>c,nK:()=>x,sK:()=>g,v$:()=>r,yP:()=>f,z2:()=>l});var i=n(21329),o=n(2892),a=n(93220);function r(e,t){let n=(0,i.iO)(e.replace(/^@/,"")||"unknown");return`${n}-highlight-${t}`}function l(e){return!!e.startsWith("highlight-")||e.includes("-highlight-")}function s(e){return/(?:^|-)highlight-.+-\d+-offline$/.test(e)}function d(e,t){let n=(0,i.iO)(e.replace(/^@/,"")||"unknown"),o=(0,i.iO)(t)||"highlight";return`${n}-highlight-${o}`}function c(e){var t;let n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)&&w(e);if(!s(n.id))return n.title;if(!(!n.title||"Untitled"===n.title||"highlight"===n.title))return i?n.title.replace(/-\d+$/,""):n.title;let o=m(n.id),a=o?u(o):null,r=d(n.username,a||"highlight");return i?r:(t=h(n.id),`${r}-${t}`)}function u(e){let t="-highlight-",n=e.indexOf(t);return n>=0?e.slice(n+t.length):e.startsWith("highlight-")?e.slice(10):null}function p(e){let t=m(e);return t?u(t):null}function _(e,t){return l(e)?`${e}-${(t??0)+1}-offline`:`${e}-offline`}function m(e){return s(e)?e.replace(/-\d+-offline$/,""):null}function h(e){let t=e.match(/-(\d+)-offline$/);return t?parseInt(t[1],10):0}function g(e){let t=new Map;for(let n of e){if(!s(n.id))continue;let e=h(n.id);t.has(e)||t.set(e,n)}return[...t.entries()].sort(([e],[t])=>e-t).map(([,e])=>e)}function w(e){return e.length>0&&s(e[0].id)}function f(e){return 0===e.length?e:s(e[0].id)?g([...e].sort((e,t)=>
1h(e.id)-h(t.id))):(0,a.tN)(e[0].id)?(0,a.S0)([...e].sort((e,t)=>(0,a.oD)(e.id)-(0,a.oD)(t.id))):(0,o.Yb)([...e].sort((e,t)=>(0,o.TD)(e.id)-(0,o.TD)(t.id)))}function v(e){return s(e[0].id)?m(e[0].id)??e[0].id:(0,a.tN)(e[0].id)?(0,a.Td)(e[0].id)??e[0].id:(0,o.fV)(e[0].id)??e[0].id}function x(e,t){var n;let i;if((0,a.tN)(e))return(0,a.Dh)(e,{videoDataCtx:t.videoDataCtx,userPlaylistDataCtx:t.userPlaylistDataCtx??null,activePlaylistIdCtx:t.activePlaylistIdCtx??null,playlistContentDataCtx:t.playlistContentDataCtx});if(!s(e))return{title:t.videoDataCtx?.title??"Untitled",username:t.videoDataCtx?.username??"Unknown"};let o=m(e),r=h(e),l=t.activeHighlightIdCtx??(o?u(o):null),c=l?t.userHighlightDataCtx?.highlights.find(e=>e.contentId===l):void 0,p=l?t.highlightContentDataCtx?.[l]:void 0,_=c?.title||p?.title||t.videoDataCtx?.title||"",g=t.userHighlightDataCtx?.username||p?.username||t.videoDataCtx?.username||(o&&(i=o.indexOf("-highlight-"))>=0?o.slice(0,i):"unknown");return{title:(n=d(g,_||"highlight"),`${n}-${r}`),username:g}}},33942:e=>{e.exports={container:"ImagePreviewCardSkeleton_container__dtWtg",previewer:"ImagePreviewCardSkeleton_previewer__4WJNs",previewer_screen:"ImagePreviewCardSkeleton_previewer_screen__NrY_4",floatingThumbnailContainer:"ImagePreviewCardSkeleton_floatingThumbnailContainer__CqStl",info:"ImagePreviewCardSkeleton_info__bdrPr",infoBottom:"ImagePreviewCardSkeleton_infoBottom__TWbB9",profile:"ImagePreviewCardSkeleton_profile__sJZOK",titleSkeleton:"ImagePreviewCardSkeleton_titleSkeleton__aYysN",profilePicSkeleton:"ImagePreviewCardSkeleton_profilePicSkeleton__04ncz",usernameSkeleton:"ImagePreviewCardSkeleton_usernameSkeleton__KTwIZ",timePostedSkeleton:"ImagePreviewCardSkeleton_timePostedSkeleton__FOPuK",previewer_controls:"ImagePreviewCardSkeleton_previewer_controls__etISu",dark:"ImagePreviewCardSkeleton_dark__NLzjx",light:"ImagePreviewCardSkeleton_light__DjDGy",previewerControlsGroup:"ImagePreviewCardSkeleton_previewerControlsGroup__NOdtw",previewerControlsTop:"ImagePreviewCardSkeleton_previewerControlsTop__lJS5d",previewerControlsMid:"ImagePreviewCardSkeleton_previewerControlsMid__vwUTr",previewerControlsTopLeft:"ImagePreviewCardSkeleton_previewerControlsTopLeft__vtwFR",previewerControlsTopRight:"ImagePreviewCardSkeleton_previewerControlsTopRight__yRacv",previewerControlsBottom:"ImagePreviewCardSkeleton_previewerControlsBottom__QvjYo",postDownloadSkeleton:"ImagePreviewCardSkeleton_postDownloadSkeleton__8WWSV",postDownloadButtonSkeleton:"ImagePreviewCardSkeleton_postDownloadButtonSkeleton__UVG11",shareSkeleton:"ImagePreviewCardSkeleton_shareSkeleton__4jiU9",shareButtonSkeleton:"ImagePreviewCardSkeleton_shareButtonSkeleton__dCXbW",shareButtonBar:"ImagePreviewCardSkeleton_shareButtonBar__qULfX",buttonSkeletonLeft:"ImagePreviewCardSkeleton_buttonSkeletonLeft__0F1TX",buttonSkeletonRight:"ImagePreviewCardSkeleton_buttonSkeletonRight__w2467",buttonSkeletonMid:"ImagePreviewCardSkeleton_buttonSkeletonMid__y4Bcf",screenSkeleton:"ImagePreviewCardSkeleton_screenSkeleton__zgKlX",thumbnailSkeleton:"ImagePreviewCardSkeleton_thumbnailSkeleton__aZ6tI",skeleton:"ImagePreviewCardSkeleton_skeleton__mp3YD",shimmer:"ImagePreviewCardSkeleton_shimmer__fjiRq",pulse:"ImagePreviewCardSkeleton_pulse__4hZvW"}},35718:e=>{e.exports={container:"VDPV4_container__rch_T",previewer:"VDPV4_previewer__t1pic",dark:"VDPV4_dark__Zrq2a",light:"VDPV4_light__j89sF",scrollAnchor:"VDPV4_scrollAnchor__8sGpq",previewerContent:"VDPV4_previewerContent__1q0oI",previewerContentNormalPadding:"VDPV4_previewerContentNormalPadding__oV3wI",previewerContent_information:"VDPV4_previewerContent_information__WxkGq",previewerContent_information_title:"VDPV4_previewerContent_information_title__FOYWY",skeleton:"VDPV4_skeleton__4GuJf",previewerContent_information_bottom:"VDPV4_previewerContent_information_bottom__VcfAo",previewerContent_information_profile:"VDPV4_previewerContent_information_profile__IJq9U",previewerContent_information_profile_image:"VDPV4_previewerContent_information_profile_image__fYbYm",previewerContent_information_profile_name:"VDPV4_previewerContent_information_profile_name__njS61",previewerContent_information_timePosted:"VDPV4_previewerContent_information_timePosted__YXlFB",previewerContent_figure:"VDPV4_previewerContent_figure__t8PpQ",previewerContent_figure_image:"VDPV4_previewerContent_figure_image__KpSp8",previewerContent_figure_imageFallback:"VDPV4_previewerContent_figure_imageFallback__ORDaE",previewerContent_figure_imageFallbackIcon:"VDPV4_previewerContent_figure_imageFallbackIcon__Ma_Em",viewButton:"VDPV4_viewButton__Y0qi0",previewer_screen:"VDPV4_previewer_screen__i4kau",vignette:"VDPV4_vignette__ZCcaL",info:"VDPV4_info__c3fJ6",profile:"VDPV4_profile__IZH29",profilePic:"VDPV4_profilePic__xqlhR",username:"VDPV4_username__NwvgI",title:"VDPV4_title__S5_vx",image_count:"VDPV4_image_count__Wmfw8",viewsCount:"VDPV4_viewsCount__vsc9L",image_list:"VDPV4_image_list__LbOUn",image_item:"VDPV4_image_item__pNQuf",image:"VDPV4_image__gzHSS",indicator_ctn:"VDPV4_indicator_ctn__FqzJI",previewer_controls:"VDPV4_previewer_controls__m7Ugu",previewerControlsGroup:"VDPV4_previewerControlsGroup__VRgbJ",previewerControlsBottomSeparator:"VDPV4_previewerControlsBottomSeparator__oYYOI",previewerControlsTop:"VDPV4_previewerControlsTop__OZ7mi",previewerControlsMid:"VDPV4_previewerControlsMid__ApctX",previewerControlsTopLeft:"
1VDPV4_previewerControlsTopLeft__X273o",previewerControlsTopRight:"VDPV4_previewerControlsTopRight__OaHw_",previewerControlsBottom:"VDPV4_previewerControlsBottom__KXpZK",top:"VDPV4_top__rZcy3",mid:"VDPV4_mid__NyKGs",mid_left:"VDPV4_mid_left__E8paO",mid_right:"VDPV4_mid_right__xWcKo",bottom:"VDPV4_bottom__Flo78",progressDetails:"VDPV4_progressDetails__oLZ_A",progressDetails_text:"VDPV4_progressDetails_text__a_Ztk",relative:"VDPV4_relative__3iBzc",shimmer:"VDPV4_shimmer__h1ueN",button:"VDPV4_button__M082_",pulse:"VDPV4_pulse__C92NK",floatingReviewButtonPortalContainer:"VDPV4_floatingReviewButtonPortalContainer__XmIA0"}},36225:e=>{e.exports={captionStripInContent:"CaptionPreviewer_captionStripInContent__SlUhE",previewerContentHead:"CaptionPreviewer_previewerContentHead__CCxkh",captionPreviewStrip:"CaptionPreviewer_captionPreviewStrip__HENJv",light:"CaptionPreviewer_light__Kuqnu",dark:"CaptionPreviewer_dark__tGUYA",captionPreviewList:"CaptionPreviewer_captionPreviewList__qxOwP",notFoundText:"CaptionPreviewer_notFoundText__asrLE",captionItem:"CaptionPreviewer_captionItem__vZx7s",text:"CaptionPreviewer_text__f4cs6",copyButtonWrap:"CaptionPreviewer_copyButtonWrap__yLJS5",controlsTopInner:"CaptionPreviewer_controlsTopInner__fXu4h",formatDownloadWrap:"CaptionPreviewer_formatDownloadWrap__GVoz1"}},37229:(e,t,n)=>{"use strict";n.d(t,{A:()=>P});var i=n(95155),o=n(12115),a=n(21338),r=n(75917),l=n.n(r),s=n(247),d=n(72575),c=n(33856),u=n(3701),p=n(69730),_=n.n(p),m=n(27898),h=n(17585),g=n(64666),w=n(34519),f=n(6442),v=n(95555),x=n(92843),b=n(28105),C=n(73321),y=n(30832),S=n(28632),k=n(29988),T=n(14185);let D=e=>{o.useEffect(()=>{(0,b.gg)("VideoProgressBar - using optimized stream socket")},[]);let t=e._id+"-offline",n=(0,C.usePathname)()||"/",r=n.includes("/dl-audio-music"),{socket:p,isConnected:D}=(0,f.Ll)(),{socket:P,isConnected:I}=(0,f.FO)({url:"https://cnvt.vidgap.com",autoConnect:!1}),j=(0,v.md)(x.B),N=(0,v.md)(T.Ec),{sizeCtx:L,loadedCtx:V,initTimeCtx:A,currentTimeCtx:O,setSizeHandlerCtx:B,setLoadedHandlerCtx:E,setInitHandlerCtx:U,setCurrentHandlerCtx:F,progressResetCtx:R,downloadStatusHandlerCtx:$,onDownloadIdHandlerCtx:M,downloadIdQueueCtx:G,downloadIdQueueHandlerCtx:W,downloadedListHandlerCtx:H,showInstallCardHandlerCtx:q,downloadedListCtx:z,videoDataCtx:Z,progressBarUIOnlyCtx:K,systemLocaleCtx:X,userHighlightDataCtx:Y,activeHighlightIdCtx:J,highlightContentDataCtx:Q,userPlaylistDataCtx:ee,activePlaylistIdCtx:et,playlistContentDataCtx:en}=o.useContext(s.Ay),ei="https://vidgap.com",[eo,ea]=o.useState(null),[er,el]=o.useState(!0),[es,ed]=o.useState({text:e.downloadingText||"Establishing Connection",eta:""}),ec=o.useMemo(()=>{let t=e.contentId;if(t){if(J&&Q[J]?.contents?.some(e=>String(e.contentId)===String(t)))return J;if(et&&en[et]?.contents?.some(e=>String(e.contentId)===String(t)))return et;if(Z?.data_type==="story"&&Z.contentId&&Z.contents?.some(e=>String(e.contentId)===String(t)))return Z.contentId}},[e.contentId,J,Q,et,en,Z?.contentId,Z?.contents,Z?.data_type]);new AbortController;let eu=o.useRef(null),ep=o.useRef(!1),e_=o.useRef(!1),em=o.useRef(null),[eh,eg]=o.useState(null),[ew,ef]=o.useState(""),[ev,ex]=o.use
1State(0),[eb,eC]=o.useState(!0);o.useEffect(()=>{if(!K&&u.co&&e._id.includes("-hd")&&Z&&Z.clientVideoURL?.hd){H(e._id),$("DOWNLOADED"),W(),window.open(Z.clientVideoURL.hd,"_blank");return}},[K,Z]),o.useEffect(()=>{let t;if(!e._id.includes("-hd")||K||u.co)return;if(!p)return void(0,b.SZ)("❌ Socket not available! This should not happen with synchronous init");let n=(0,w.getCookie)("download_token");if(!n)return void(0,b.gg)("download_token not found");let i=e._id.match(/(\d{19})/gi);if(!i)return;let o=i[0];eu.current||(eu.current=(0,g.l)());let a=eu.current;if(e._id.includes("-live")){let n=e._id.match(/slide-(\d+)/);t=parseInt(n?n[1]:"1")}if(e._id.includes("-story")){let n=e._id.match(/story-(\d+)/);t=parseInt(n?n[1]:"1")}let r=e._id.includes("-hd-procedure"),l=(0,h.K)(o,{hd:!r,token:n,watermark:!1,index:t}),s=`${l}&sessionId=${a}&debugurlid=${e._id}`,d=t=>{e_.current=!0;let n=document.createElement("a");n.href=s,n.download=e.filename||`video_${o}.mp4`,n.style.display="none",document.body.appendChild(n),n.click(),setTimeout(()=>{document.body.contains(n)&&document.body.removeChild(n)},100)},c=t=>{let n=Z?.clientVideoURL?.hd??Z?.clientVideoURL?.nonwm;n?(window.open(n,"_blank"),$("DOWNLOADED"),H(e._id),W()):t&&t.videoURL&&(window.open(t.videoURL,"_blank"),$("DOWNLOADED"),H(e._id),W())},_=t=>{ed({eta:t.eta||"",text:e.waitingText||u.Sy})},m=t=>{ed({eta:t.eta||"",text:e.downloadingText||u.Sy})},f=t=>{(0,b.gg)("download-hd stream start: ",t),ed({eta:t.eta||"",text:u.xL}),setTimeout(()=>{$("DOWNLOADED"),H(e._id.replace("-procedure","")),W()},1e3)};if(!ep.current)return ep.current=!0,p.on("authenticate",d),p.on("on-waiting",_),p.on("buffer-update",m),p.on("stream-start",f),p.on("buffer-error",c),D?(p.emit("authenticate",a),e_.current=!0):p.connect(),()=>{p.off("authenticate",d),p.off("on-waiting",_),p.off("buffer-update",m),p.off("stream-start",f),p.off("buffer-error",c),p.connected&&p.disconnect(),ep.current=!1,e_.current=!1,eu.current=null}},[p,e._id,K]),o.useEffect(()=>{e._id.includes("-hd")&&p&&ep.current&&!K&&!u.co&&D&&!e_.current&&eu.current&&(p.emit("authenticate",eu.current),e_.current=!0)},[D,e._id,p,K]),o.useEffect(()=>{if(!e.isConvert||!e.contentId||K||!r)return;let t=`${e._id}-${Date.now()}`;U(new Date().getTime()),fetch("https://cnvt.vidgap.com/api/pool/mp3",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t,videoUrl:e.url,contentId:e.contentId,convertOptions:{bitrate:"192k"}})}).then(e=>e.json()).then(e=>{e.success?eg(t):((0,b.SZ)("MP3 pool registration failed:",e.error),$("FAILED"))}).catch(e=>{(0,b.SZ)("MP3 pool registration error:",e),$("FAILED")})},[e.isConvert,e._id,e.url,e.contentId,K,r]),o.useEffect(()=>{if(!e.isConvert||!eh||!P||K||!r)return;if(!(I||P.connected))return void P.connect();if(em.current===eh)return;em.current=eh;let t=e=>{ef(`Waiting in queue (position ${e.position??"?"})`)},n=e=>{"number"==typeof e.percent&&ex(e.percent),ef({starting:"Starting...",downloading_video:"Downloading video...",converting_audio:"Converting to MP3...",preparing_download:"Preparing download..."}[e.stage??""]??e.stage??""),eC(!1)},i=t=>{ex(100),eC(!1),ef("Complete! Downloading...");let n=document.createElement("a");n.href=t.downloadUrl??"",n.download=t.filename||e.filename,document.body.appendChild(n),n.click(),document.body.removeChild(n),setTimeout(()=>{$("DOWNLOADED")},1e3),H(e._id),W(),P.connected&&P.disconnect()},o=e=>{(0,b.SZ)("MP3 socket error:",e.error),$("FAILED"),P.connected&&P.disconnect()};return P.emit("authenticate",eh),P.on("video-to-mp3-waiting",t),P.on("video-to-mp3-progress",n),P.on("video-to-mp3-ready",i),P.on("video-to-mp3-error",o),()=>{P.off("video-to-mp3-waiting",t),P.off("video-to-mp3-progress",n),P.off("video-to-mp3-ready",i),P.off("video-to-mp3-error",o)}},[P,eh,I,e.isConvert,K,r]),o.useEffect(()=>{if(!e._id.includes("-hd")&&!K&&e._id!==u.hu){let i=a.A.CancelToken.source();return(ea(i),e.isConvert)?void 0:(U(new Date().getTime()),(async e=>await (0,d.HC)(e))(t).then(t=>{if(t){let n=t.blob,i=URL.createObjectURL(n),o=document.createElement("a");o.href=i,o.download=e.filename,o.click(),H(e._id),W()}else{let t=e.url.includes("/api/video/redirect"),o=async n=>{if(t&&e.contentId){let t=await (0,y.a)(e.contentId,ec);t.success||(0,b.KE)("Failed to ensure video access cookie:",t.error)}try{return await a.A.get(e.url,{onDownloadProgress:function(e){let t=new Date().getTime();F(t),E(e.loaded),e.total&&e.total>0&&e.total!==L&&B(e.total)},method:"GET",responseType:"blob",cancelToken:i.token,headers:{"content-type":e.filename.includes(".mp3")?"audio/mpeg":"video/mp4"}})}catch(r){if(a.A.isCancel(r))throw r;let i=r.response?.status;if(n>0&&(425===i||t&&e.contentId&&(403===i||429===i))){if(ex(0),eC(!0),E(0),B(1),F(1),U(new Date().getTime()),429===i){let e=r.response?.headers?.["retry-after"],t=e?parseInt(String(e),10):2,n=(Number.isFinite(t)?t:2)*1e3;await new Promise(e=>setTimeout(e,n))}else 425===i&&await new Promise(e=>setTimeout(e,500));return t&&e.contentId&&await (0,y.a)(e.contentId,ec),o(n-1)}throw r}};o(1).then(async t=>{if(fetch(`${ei}/api/video/success`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:"string"==typeof t.request?.responseURL&&t.request.responseURL||e.url})}),setTimeout(()=>{$("DOWNLOADED")},1e3),e._id.includes("-offline")){(0,b.gg)("video progress bar store content blob props offline_id: ",e.offline_id);let n=e.offline_id??e._id,{title:i,username:o}=(0,c.nK)(n,{videoDataCtx:Z,userHighlightDataCtx:Y,activeHighlightIdCtx:J,highlightContentDataCtx:Q,userPlaylistDataCtx:ee,activePlaylistIdCtx:et,playlistContentDataCtx:en});await (0,d.e_)({blob:t.data,id:n,title:i,username:o,date:new Date,expiry:new Date(Date.now()+12096e5),type:e.dataType,inputUrl:e.inputUrl,duration:Z?.duration}),fetch(`${ei}/api/download/offline`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input_url:e.inputUrl,content_type:e.dataType})}),e.offline_id?H(e.offline_id):H(e._id),W()}if(!e._id.includes("-offline")){let n=URL.createObjectURL(t.data),i=document.createElement("a");i.href=n,i.download=e.filename.replace(".mp3",""),i.click(),H(e._id),W()}}).catch(i=>{if("ERR_NETWORK"===i.code&&fetch(`${ei}/api/video/failure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:"string"==typeof i.request?.responseURL&&i.request.responseURL||e.url})}),a.A.isCancel(i))$("CANCEL"),(0,b.SZ)("message: "+i.message);else{let o=i.response?.status;if(429===o?(0,b.KE)("DOWNLOAD-RATE-LIMITED (429): ",i):425===o?(0,b.KE)("DOWNLOAD-TOO-EARLY (425): ",i):403===o?(0,b.KE)("DOWNLOAD-UNAUTHORIZED (403): ",i):(0,b.SZ)("DOWNLOAD-ERROR: ",i),t&&403===o){let t=(0,k.pb)()||e.inputUrl||"",i=(0,S.Vk)({platform:N??(0,T.lL)(n),tabIndex:j??0,locale:X});if((0,S.OB)(t,i))return}if(e.url&&(403===o||"ERR_NETWORK"===i.code)){let n=()=>{let t=document.createElement("a");t.href=e.url,t.target="_blank",t.rel="noopener noreferrer",t.referrerPolicy="no-referrer",document.body.appendChild(t),t.click(),document.body.removeChild(t)};t&&e.contentId?(0,y.a)(e.contentId,ec).finally(n):n(),$("DOWNLOADED"),H(e._id),W();return}$("FAILED")}})}}),function(){R()})}},[K]),o.useEffect(()=>
1{e._id===u.hu&&1==G.length&&(W(),$("DOWNLOADED"),H(e._id))},[G]),o.useEffect(()=>{if(e.isConvert||e._id.includes("-hd")||K)return;let t=L>0?Math.floor(V/L*100):0;ex(t>0?t:0)},[G,V,L,e.isConvert,e._id,K]);let ey=(0==ev||null==ev)&&(0,i.jsxs)("div",{className:l().progress_bar_info_slideshow_to_video_v2,children:[(0,i.jsx)("span",{className:l().progress_bar_info_slideshow_to_video_v2_percentage,children:e.isConvert?"":es.eta}),(0,i.jsx)("div",{className:l().progress_bar_info_slideshow_to_video_v2_text_ctn,children:(0,i.jsx)("span",{className:l().progress_bar_info_slideshow_to_video_v2_text,children:e.isConvert?ew||e.downloadingText||"Converting...":es.text})})]}),eS=e.isConvert?ev>0&&!eb?`${ev.toFixed(2)}%`:ey:ev>0?`${ev.toFixed(2)}% ${e.withSpeed?` | ${Math.floor(V/(O-A))} KB/s`:""}`:ey;return(0,i.jsxs)("div",{className:_()(l().progress_bar,{[l().dark]:e.isDark}),children:[ev>0?(0,i.jsx)("div",{className:_()(l().progress_bar_fill,{[l().dark]:e.isDark}),style:{width:`${ev}%`}}):(0,i.jsx)(m.A,{isDark:e.isDark}),(0,i.jsx)("span",{className:_()(l().progress_bar_info,{[l().dark]:e.isDark,[l().centered]:!e.withSpeed}),children:eS})]})};D.displayName="ProgressBar";let P=D},39425:(e,t,n)=>{"use strict";n.d(t,{A:()=>k});var i=n(95155),o=n(12115),a=n(12979),r=n.n(a),l=n(97307),s=n(73321),d=n(89549),c=n(12505),u=n(48409),p=n(98314),_=n(28137),m=n(247),h=n(69730),g=n.n(h),w=n(57094),f=n(36959),v=n(3701),x=n(133),b=n(68586),C=n(95555),y=n(92843);let S=({contentVLink:e,tabIndexCtx:t,s:n})=>(0,i.jsx)("div",{className:n.qrCodeContainer,children:(0,i.jsx)(d.Ay,{value:e,size:128,style:{height:"auto",maxWidth:"100%",width:"100%"},viewBox:"0 0 128 128",fgColor:"#000000",bgColor:"#ffffff"})}),k=({copyTxt:e=v.HK,shareTxt:t=v.i4,contentVLink:n,source:a="share"})=>{(0,s.usePathname)();let d=(0,C.md)(y.B),{toastHandlerCtx:h}=o.useContext(m.Ay),{themeCtx:k}=o.useContext(x.A),[T,D]=o.useState(!0),[P,I]=o.useState(null),[j,N]=o.useState(""),L=o.useRef(null),V=async e=>{if(P)return void I(null);if(L.current){let t=L.current.getBoundingClientRect(),i=e.pageY;console.log({top:i,left:t.x,parentHeight:t.height});let o=await (0,b.G)(n,a);o&&o.shareLink?N(o.shareLink):N(n),I({top:i+t.height,left:t.left,parentHeight:t.height,parentWidth:t.width})}},A=async()=>{try{let e=await (0,b.G)(n,a),t=e?.shareLink||(0,_.LB)(n,0);if(navigator.share)try{await navigator.share({title:document.title,url:t})}catch(e){console.log("Error sharing:",e)}else(0,_.S)(t,h)}catch(t){console.error("Error generating vgshare:",t);let e=(0,_.LB)(n,0);if(navigator.share)try{await navigator.share({title:document.title,url:e})}catch(e){console.log("Error sharing:",e)}else(0,_.S)(e,h)}},O=async()=>{console.log("copy contentVLink",n);try{let e=await (0,b.G)(n,a);e&&e.shareLink?navigator.clipboard.writeText(e.shareLink):(0,_.qu)(n,d),h("COPIED")}catch(e){console.error("Error generating vgshare:",e),(0,_.qu)(n,d),h("COPIED")}};return(0,i.jsxs)("div",{className:g()(r().shareContainerV3,{[r().dark]:"dark"===k,[r().light]:"light"===k}),children:[(0,i.jsxs)("div",{className:r().left,children:[P&&j&&(0,i.jsx)(u.default,{portalElementId:"modal-portal",children:(0,i.jsxs)("div",{style:{top:P.top,left:P.left,width:1.5*P.parentWidth},className:g()(r().qrCodeModal,{[r().dark]:"dark"===k,[r().light]:"light"===k}),onClick:O,children:[(0,i.jsx)(S,{contentVLink:j,tabIndexCtx:d,s:r()}),(0,i.jsxs)("div",{className:r().urlContainer,children:[(0,i.jsx)("span",{className:r().urlText,children:j}),(0,i.jsx)("div",{className:r().urlCopyBtn,children:(0,i.jsx)(f.r6e,{className:r().urlCopyIcon})})]})]})}),P&&(0,i.jsx)(p.A,{show:!0,close:()=>I(null),opacity:1e-4}),(0,i.jsxs)("button",{className:r().button,onClick:V,ref:L,children:[(0,i.jsx)(l.aGf,{className:r().icon}),(0,i.jsx)("span",{className:r().text,children:"QR Code"})]})]}),(0,i.jsx)("div",{className:r().mid,children:(0,i.jsxs)("button",{className:r().button,onClick:O,children:[(0,i.jsx)(w.ukW,{className:r().icon}),(0,i.jsx)("span",{className:r().text,children:e})]})}),(0,i.jsx)("div",{className:r().right,children:(0,i.jsxs)("button",{className:r().button,onClick:A,children:[(0,i.jsx)(c.Zzu,{className:r().icon}),(0,i.jsx)("span",{className:r().text,children:t})]})})]})}},42793:e=>{e.exports={container:"IMGPV3_container__krQmT",skeletonOverlay:"IMGPV3_skeletonOverlay__GObAK",previewLayer:"IMGPV3_previewLayer__CiFgA",hidden:"IMGPV3_hidden__dLUEp",previewer:"IMGPV3_previewer__3RN7E",scrollAnchor:"IMGPV3_scrollAnchor__Ec6iR",previewer_screen:"IMGPV3_previewer_screen__gUqFQ",vignette:"IMGPV3_vignette__PU9jb",floatingThumbnailContainer:"IMGPV3_floatingThumbnailContainer__0bDMS",viewMode:"IMGPV3_viewMode__KCEvB",floatingThumbnail:"IMGPV3_floatingThumbnail__OZNhL",floatingThumbnailIconContainer:"IMGPV3_floatingThumbnailIconContainer__djlJx",info:"IMGPV3_info__u44_O",infoBottom:"IMGPV3_infoBottom__Se_rZ",timePosted:"IMGPV3_timePosted__KLoz7",profile:"IMGPV3_profile__pl8LK",profilePic:"IMGPV3_profilePic__lOyc0",username:"IMGPV3_username__8rhMQ",title:"IMGPV3_title__LgX8u",image_count:"IMGPV3_image_count__fgjxz",viewsCount:"IMGPV3_viewsCount__euxpG",light:"IMGPV3_light__k871Z",dark:"IMGPV3_dark__7dMab",image_list:"IMGPV3_image_list__ml_8w",image_item:"IMGPV3_image_item__TnLcz",image:"IMGPV3_image__5rhwy",indicator_ctn:"IMGPV3_indicator_ctn__a5oTZ",previewer_controls:"IMGPV3_previewer_controls__tCyA8",previewerControlsGroup:"IMGPV3_previewerControlsGroup__vTALY",previewerControlsBottomSeparator:"IMGPV3_previewerControlsBottomSeparator__A0h59",previewerControlsTop:"IMGPV3_previewerControlsTop__3Wuoq",previewerControlsMid:"IMGPV3_previewerControlsMid__scDDo",previewerControlsTopLeft:"IMGPV3_previewerControlsTopLeft__5SmFC",previewerControlsTopRight:"IMGPV3_previewerControlsTopRight__cEuFx",previewerControlsBottom:"IMGPV3_previewerControlsBottom__UfUn0",top:"IMGPV3_top__eGAuj",mid:"IMGPV3_mid__Pwfa_",mid_left:"IMGPV3_mid_left__mfc5M",mid_right:"IMGPV3_mid_right__Tpe4y",bottom:"IMGPV3_bottom__xD8yo",progressDetail
1s:"IMGPV3_progressDetails__5F0ZC",progressDetails_text:"IMGPV3_progressDetails_text__9QBzt",skeleton:"IMGPV3_skeleton__vYNSQ",relative:"IMGPV3_relative__36Ydg",shimmer:"IMGPV3_shimmer__ix7cW",previewerContent_information:"IMGPV3_previewerContent_information__b_ENc",previewerContent_figure:"IMGPV3_previewerContent_figure__ojkAO",button:"IMGPV3_button__m9oUZ",pulse:"IMGPV3_pulse__UP2Op",floatingReviewButtonPortalContainer:"IMGPV3_floatingReviewButtonPortalContainer__jbF1M",previewerContent_information_title:"IMGPV3_previewerContent_information_title__RXbUT",previewerContent:"IMGPV3_previewerContent__C2aIS",previewerContent_information_bottom:"IMGPV3_previewerContent_information_bottom__PUEs2",previewerContent_information_profile:"IMGPV3_previewerContent_information_profile__7D0e5",previewerContent_information_profile_image:"IMGPV3_previewerContent_information_profile_image__stuj2",previewerContent_information_profile_name:"IMGPV3_previewerContent_information_profile_name__qX54S",previewerContent_information_timePosted:"IMGPV3_previewerContent_information_timePosted__AJYJO",previewerContent_figure_image:"IMGPV3_previewerContent_figure_image__DZk5Z"}},45426:(e,t,n)=>{"use strict";n.d(t,{JD:()=>o,s$:()=>a});var i=n(21329);function o(e,t){let n=(0,i.iO)(e.replace(/^@/,"")||"unknown");return`${n}-collection-${t}`}function a(e){let t,n,i=function(e){return/(?:^|-)collection-.+-\d+-offline$/.test(e)?e.replace(/-\d+-offline$/,""):null}(e);return i?(t="-collection-",(n=i.indexOf(t))>=0?i.slice(n+t.length):i.startsWith("collection-")?i.slice(11):null):null}},46368:e=>{e.exports={picker:"HighlightPickerCard_picker__Kh2j0",emptyStage:"HighlightPickerCard_emptyStage__9HGHO",highlightIcon:"HighlightPickerCard_highlightIcon__cUjq4",dark:"HighlightPickerCard_dark__7wLdH",light:"HighlightPickerCard_light__lSNWs",traySlot:"HighlightPickerCard_traySlot__DAbfL"}},49179:e=>{e.exports={tray:"CollectionTray_tray__0tSp5",list:"CollectionTray_list__34n3S",dark:"CollectionTray_dark__P5Mkf",light:"CollectionTray_light__fvLak",item:"CollectionTray_item__MRr_p",button:"CollectionTray_button__vC6Ho",ring:"CollectionTray_ring__Fn5kU",cover:"CollectionTray_cover__8On5s",coverIconWrap:"CollectionTray_coverIconWrap__KAduJ",coverIcon:"CollectionTray_coverIcon__JynkO",title:"CollectionTray_title__cOhbH",count:"CollectionTray_count__83kNX",iconCover:"CollectionTray_iconCover__TK0ZI"}},52215:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});var i=n(6801);function o(e,t,n="en-US"){if(!e)return"";let a=Math.floor((Date.now()-e)/6e4),r=Math.floor(a/60),l=Math.floor(r/24),s=t.minute_ago||"minute ago",d=t.hour_ago||"hour ago",c=t.day_ago||"day ago",u=t.minute_plural||"minutes ago",p=t.hour_plural||"hours ago",_=t.day_plural||"days ago";if(a<60)return a<=1?`1 ${s}`:`${a} ${u}`;if(r<24)return 1===r?`1 ${d}`:`${r} ${p}`;if(l<7)return 1===l?`1 ${c}`:`${l} ${_}`;let m=new Date(e),h=i.gQ.find(e=>e[3]===n)?.[1]||"en-US";return m.toLocaleDateString(h,{year:"numeric",month:"long",day:"numeric"})}},54349:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var i=n(95155),o=n(69730),a=n.n(o),r=n(12115),l=n(13267),s=n(97991),d=n(133);let c=e=>{let{styles:t,isLoaded:o}=(0,s.Xk)(()=>Promise.all([n.e(8196),n.e(3979)]).then(n.t.bind(n,93979,23))),{themeCtx:c}=r.useContext(d.A);return o?(0,i.jsx)("button",{className:a()(t.button,{[t.dark]:"dark"===c,[t.light]:"light"===c}),onClick:e.showReviewBarHandler,children:(0,i.jsx)(l.aTw,{className:t.icon})}):null}},56636:e=>{e.exports={optItemDisabled:"SubtitleSplitButton_optItemDisabled__plE4Y",optionBtnDisabled:"SubtitleSplitButton_optionBtnDisabled__LwS_9",optionDivider:"SubtitleSplitButton_optionDivider__9P5Xf",buttonMainWithTrailing:"SubtitleSplitButton_buttonMainWithTrailing___kVOk",buttonMainWithLangPicker:"SubtitleSplitButton_buttonMainWithLangPicker__Zjq3z",trailingControlsGroup:"SubtitleSplitButton_trailingControlsGroup__mBUfZ",trailingGlassBtn:"SubtitleSplitButton_trailingGlassBtn__tb9fU",trailingGlassBtnDark:"SubtitleSplitButton_trailingGlassBtnDark__6s_Sg",trailingTimerBtn:"SubtitleSplitButton_trailingTimerBtn__m2LO0",trailingTimerBtnItem:"SubtitleSplitButton_trailingTimerBtnItem__3hxcX",trailingTimerIcon:"SubtitleSplitButton_trailingTimerIcon__SuEWS",languageCtrlBtn:"SubtitleSplitButton_languageCtrlBtn__Oj6Qz",languageCtrlBtnDisabled:"SubtitleSplitButton_languageCtrlBtnDisabled__Ko0xs",languageCtrlIcon:"SubtitleSplitButton_languageCtrlIcon__9gcx5",languageCtrlC
1ode:"SubtitleSplitButton_languageCtrlCode__Scs5R",languagePickerModal:"SubtitleSplitButton_languagePickerModal__A7ol1",languagePickerModalDark:"SubtitleSplitButton_languagePickerModalDark__IUG1p",languagePickerList:"SubtitleSplitButton_languagePickerList__x7xux",languagePickerOption:"SubtitleSplitButton_languagePickerOption__Wi0Nq",languagePickerOptionDark:"SubtitleSplitButton_languagePickerOptionDark__njg3T",languagePickerOptionActive:"SubtitleSplitButton_languagePickerOptionActive__1nIMJ",languageFlagIcon:"SubtitleSplitButton_languageFlagIcon__iRXJX",languageFlagIconLight:"SubtitleSplitButton_languageFlagIconLight__K60Um",languageModalLabel:"SubtitleSplitButton_languageModalLabel__FW8ZF",mainContentCentered:"SubtitleSplitButton_mainContentCentered__9A8qS",align_left:"SubtitleSplitButton_align_left__sgKNC",centeredTextCtn:"SubtitleSplitButton_centeredTextCtn__DkLax",centeredTextLine:"SubtitleSplitButton_centeredTextLine__XEs_R",trailingCtrlActive:"SubtitleSplitButton_trailingCtrlActive__RD27b",trailingCtrlDisabled:"SubtitleSplitButton_trailingCtrlDisabled__OV6aR"}},56799:(e,t,n)=>{"use strict";n.d(t,{Ie:()=>r,OM:()=>a,fY:()=>o});let i=/^(\d{1,2}:\d{2}(?::\d{2})?(?:[.,]\d{1,3})?)\s+-->\s+(\d{1,2}:\d{2}(?::\d{2})?(?:[.,]\d{1,3})?)/;function o(e){return e.replace(/\./g,",")}function a(e){return e.replace(/,/g,".")}function r(e){if(!e?.trim())return[];let t=e.replace(/\r\n/g,"\n").replace(/^\uFEFF/,"").trim().split(/\n\n+/),n=0,o=[];for(let e of t){var a;if(!e.trim())continue;let t=e.split("\n");if(a=t[0]?.trim()??"",/^WEBVTT/i.test(a)||/^NOTE(?:$|\s)/i.test(a)||/^STYLE$/i.test(a)||/^REGION$/i.test(a))continue;let r=t.findIndex(e=>i.test(e.trim()));if(-1===r)continue;let l=t[r].trim().match(i);if(!l)continue;let s=l[1],d=l[2],c=t.slice(r+1).join(" ").trim();c&&(n+=1,o.push({index:n,timestampLine:`${s} --> ${d}`,shortStartTime:s.replace(/[.,]\d+$/,"").replace(/^00:/,""),text:c}))}return o}},64666:(e,t,n)=>{"use strict";function i(){try{let e=window.crypto;if(e?.randomUUID&&"function"==typeof e.randomUUID)return e.randomUUID();if(e?.getRandomValues){let t=e.getRandomValues(new Uint8Array(16));t[6]=15&t[6]|64,t[8]=63&t[8]|128;let n=[...t].map(e=>e.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20,32)}`}}catch{}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}n.d(t,{l:()=>i})},65149:(e,t,n)=>{"use strict";function i(e,t="tiktok",n=0){return n>1e8||!(!e||e.includes("/api/video/redirect"))&&!o(e,[],t)}function o(e,t=[],n="tiktok"){if("tiktok"===n){let n=["//v9e","//v3e","//v53e","//api.tiktokv","//api16","v16-webapp-prime","//v45","v19-webapp-prime","v45-coin","//v15m","//v31","//v58","//v77","//v9",...t];return e.length>0&&(!n.some(t=>e.includes(t))||["//v16m","//v19"].some(t=>e.includes(t)))}return"douyin"!==n||e.length>0&&!["//v5-dy-ov","//v11-o","v9-v2-mps-cdn"].some(t=>e.includes(t))}n.d(t,{IO:()=>i,WI:()=>o})},65286:e=>{e.exports={playlistPreview:"PreviewPlaylist_playlistPreview___YFwC"}},66175:(e,t,n)=>{"use strict";async function i(){return new Promise((e,t)=>{let n=indexedDB.open("historyDatabase",1);n.onupgradeneeded=e=>{let t=n.result;t.objectStoreNames.contains("histories")||t.createObjectStore("histories",{keyPath:"id"})},n.onsuccess=()=>{e(n.result)},n.onerror=()=>{t(`Error opening database: ${n.error}`)}})}async function o(e){await r(e.id);let t=await i();return new Promise((n,i)=>{let o=t.transaction("histories","readwrite").objectStore("histories").put(e);o.onsuccess=()=>{n()},o.onerror=()=>{i(o.error)}})}async function a(){try{let e=await i();return new Promise((t,n)=>{let i=e.transaction("histories","readwrite").objectStore("histories"),o=i.getAll();o.onsuccess=()=>{let e=o.result.sort((e,t)=>t.date.getTime()-e.date.getTime()),n=Date.now(),a=e.map(e=>e.expiry.getTime()<n?(i.delete(e.id),null):e);t(a.filter(e=>null!==e))},o.onerror=()=>{n(o.error)}})}catch(e){throw e}}async function r(e){let t=await i();return new Promise((n,i)=>{let o=t.transaction("histories","readwrite"),a=o.objectStore("histories").delete(e);a.onsuccess=()=>{n()},a.onerror=()=>{i(a.error)},o.oncomplete=()=>t.close(),o.onerror=()=>i(o.error)})}n.d(t,{dh:()=>r,fs:()=>o,jv:()=>a})},68586:(e,t,n)=>{"use strict";n.d(t,{G:()=>o});var i=n(9339);let o=(0,i.createServerReference)("60b80c5aaf31749a855a742375ba9c64ddb9ca5e76",i.c
1allServer,void 0,i.findSourceMapURL,"generateVgShareAction")},72575:(e,t,n)=>{"use strict";n.d(t,{C7:()=>d,G2:()=>l,HC:()=>_,Ww:()=>c,YX:()=>s,e_:()=>p,sq:()=>u});var i=n(33856),o=n(93220),a=n(2892);async function r(){return new Promise((e,t)=>{let n=indexedDB.open("offlineContentDatabase",1);n.onupgradeneeded=e=>{let t=n.result;t.objectStoreNames.contains("contents")||t.createObjectStore("contents",{keyPath:"id"})},n.onsuccess=()=>{e(n.result)},n.onerror=()=>{t(`Error opening database: ${n.error}`)}})}async function l(e){let t=await r(),n=(await u()).filter(t=>{if(!(0,a.pn)(t.id))return!1;let n=(0,a.fV)(t.id);if(!n)return!1;let i=e.replace(/-offline$/,"");return n===e||n===i||n.startsWith(i)}).map(e=>e.id);return new Promise((e,i)=>{let o=t.transaction("contents","readwrite"),a=o.objectStore("contents");n.forEach(e=>{e&&a.delete(e)}),o.oncomplete=()=>t.close(),o.onerror=()=>i(o.error)})}async function s(e){let t=await r(),n=(await u()).filter(t=>{if(!(0,i.B5)(t.id))return!1;let n=(0,i.VU)(t.id);if(!n)return!1;let o=e.replace(/-offline$/,"");return n===e||n===o||n.startsWith(o)||e.startsWith(n)}).map(e=>e.id);return new Promise((e,i)=>{let o=t.transaction("contents","readwrite"),a=o.objectStore("contents");n.forEach(e=>{e&&a.delete(e)}),o.oncomplete=()=>t.close(),o.onerror=()=>i(o.error)})}async function d(e){let t=await r(),n=(await u()).filter(t=>{if(!(0,o.tN)(t.id))return!1;let n=(0,o.Td)(t.id);if(!n)return!1;let i=e.replace(/-offline$/,"");return n===e||n===i||n.startsWith(i)||e.startsWith(n)}).map(e=>e.id);return new Promise((e,i)=>{let o=t.transaction("contents","readwrite"),a=o.objectStore("contents");n.forEach(e=>{e&&a.delete(e)}),o.oncomplete=()=>t.close(),o.onerror=()=>i(o.error)})}async function c(e){let t=await r();return new Promise((n,i)=>{let o=t.transaction("contents","readwrite"),a=o.objectStore("contents").delete(e);a.onsuccess=()=>{n()},a.onerror=()=>{i(a.error)},o.oncomplete=()=>t.close(),o.onerror=()=>i(o.error)})}async function u(){try{let e=await r(),t=Date.now();return new Promise((n,i)=>{let o=e.transaction("contents","readwrite").objectStore("contents"),a=o.getAll();a.onsuccess=()=>{let e=a.result.sort((e,t)=>t.date.getTime()-e.date.getTime()).map(e=>e.expiry.getTime()<t?(o.delete(e.id),null):e);n(e.filter(e=>null!==e))},a.onerror=()=>{i(a.error)}})}catch(e){throw e}}async function p(e){let t=await r();return new Promise((n,i)=>{let o=t.transaction("contents","readwrite").objectStore("contents").put(e);o.onsuccess=()=>{n()},o.onerror=()=>{i(o.error)}})}async function _(e){let t=await r();return new Promise((n,i)=>{let o=t.transaction("contents","readonly").objectStore("contents").get(e);o.onsuccess=()=>{let e=o.result;e?n(e):n(null),o.onerror=()=>{i(o.error)}}})}},75917:e=>{e.exports={progress_bar:"ProgressBar_progress_bar__h6Nit",dark:"ProgressBar_dark___AWd_",progress_bar_fill:"ProgressBar_progress_bar_fill__AwlBn",progress_bar_info:"ProgressBar_progress_bar_info__F_Y8y",centered:"ProgressBar_centered__jTYRz"}},79005:e=>{e.exports={container:"PostDownloadControl_container__ettY4",btn:"PostDownloadControl_btn__N8jSz",dark:"PostDownloadControl_dark__q6BhM",light:"PostDownloadControl_light__vmdW4",btnTxt:"PostDownloadControl_btnTxt__nsdT_",icon:"PostDownloadControl_icon__oa17G",confirmCard:"PostDownloadControl_confirmCard__dZXxG",confirmClose:"PostDownloadControl_confirmClose__7kgTF",confirmContentWrapper:"PostDownloadControl_confirmContentWrapper__zFzgH",confirmContent:"PostDownloadControl_confirmContent__qmkBy",confirmDesc:"PostDownloadControl_confirmDesc__pCTTq",confirmTitle:"PostDownloadControl_confirmTitle__Z7yD_",confirmSubtitle:"PostDownloadControl_confirmSubtitle__6u6Ez",confirmBtnGroup:"PostDownloadControl_confirmBtnGroup__CXuq_",confirmBtn:"PostDownloadControl_confirmBtn__5ZEKF",cancelBtn:"PostDownloadControl_cancelBtn___d2Yb",proceedBtn:"PostDownloadControl_proceedBtn__4oZgD"}},80090:(e,t,n)=>{"use strict";n.d(t,{wl:()=>U,Ay:()=>$});var i=n(95155),o=n(12115),a=n(98169),r=n.n(a),l=n(247),s=n(69730),d=n.n(s),c=n(74473),u=n(37229),p=n(48409),_=n(98314),m=n(34519),h=n(42021),g=n(29356),w=n(12505),f=n(29988),v=n(65149);let x=e=>(e/1e3/1e3).toFixed(2)+" MB";var b=n(98500),C=n.n(b),y=n(23116),S=n(3701),k=n(73321),T=n(95555),D=n(30003),P=n(24867),I=n(28105),j=n(75917),N=n.n(j),L=n(27898),V=n(14185);let A=e=>!!e?.isConvert||e?.texts?.tag==="music-audio",O=({isDark:e,downloadingText:t})=>(0,i.jsxs)("div",{className:d()(N().progress_bar,{[N().dark]:e}),children:[(0,i.jsx)(L.A,{isDark:!!e}),(0,i.jsx)("span",{className:d()(N().progress_bar_info,{[N().dark]:e,[N().centered]:!0}),children:t||"Downloading..."})]}),B=e=>{let t=(0,k.usePathname)()||"/",n=(0,T.md)(V.Ec),a=(0,V.lL)(t),s=(0,V.o5)(n??a),{downloadedListCtx:u,downloadedListHandlerCtx:v,downloadStatusHandlerCtx:b,downloadIdQueueHandlerCtx:y,downloadIdQueueCtx:S,systemLocaleCtx:D,progressBarUIOnl
1yHandlerCtx:j,addDownloadIdHandlerCtx:N,onRetryCtx:L,isOnRetryHDCtx:A}=o.useContext(l.Ay),[O,B]=o.useState(null),[E,F]=o.useState(null),[R,$]=o.useState(null),{adStatus:M,showAd:G}=(0,P.e)("/23321251588/VG-hd-rewarded",()=>{q()}),W=o.useRef(null);o.useEffect(()=>{let e=()=>{F({height:window.innerHeight,width:window.innerWidth})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),o.useEffect(()=>{let e=()=>{B(null)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]);let H=()=>{B(null)},q=()=>{let t=e.options[e.selectedOptIndex];if((0,f.Xz)(t?.featureLabel),e.options[e.selectedOptIndex]._id,e.selectedOptIndex,!Y&&A){v(e.options[e.selectedOptIndex]._id),b("DOWNLOADED");return}if("video"==e.dataType&&(e.options[e.selectedOptIndex].tag?.includes("hd")||e.options[e.selectedOptIndex]._id.includes("-hd"))){Y||j(!0),y(),N(e.options[e.selectedOptIndex]._id),b("DOWNLOADING");return}e.options[e.selectedOptIndex]&&(e.options[e.selectedOptIndex].downloadClickHandler(),H())},z=u.includes(e.options[e.selectedOptIndex]._id),Z=e.options[e.selectedOptIndex].texts.sub_download&&"-"!==e.options[e.selectedOptIndex].texts.sub_download?e.options[e.selectedOptIndex].texts.sub_download:"",K=S.length>0,X="en"===D?"":`/${D}`,Y=t.includes("/download-hd")||t.includes("/dl-hd"),J=t.includes("/dl"),Q="no-fill"===M,ee="ready"===M,et=e.options[e.selectedOptIndex]._id.includes("-story"),en=e.options[e.selectedOptIndex]._id.includes("-hd"),ei=et&&en?`${s}/dl-hd-story${X}`:`${s}/dl-hd${X}`;return o.useEffect(()=>{(0,I.gg)("rewarded ads adStatus: ",M)},[M]),(0,i.jsxs)("div",{className:r().button_ctn_v3,children:[(0,i.jsxs)("div",{ref:W,className:d()(r().button_v3,{[r().btn_1]:1===e.level,[r().btn_2]:2===e.level,[r().btn_3]:3===e.level,[r().dark]:e.isDark,[r().btn_downloaded]:u.includes(e.options[e.selectedOptIndex]._id)}),style:e.style,children:[K||z||ee&&!Q?(0,i.jsxs)("button",{disabled:K||z,className:d()(r().button_main,r().faded,{[r().align_left]:"left"===e.options[e.selectedOptIndex].align,[r().align_center]:"center"===e.options[e.selectedOptIndex].align,[r().align_right]:"right"===e.options[e.selectedOptIndex].align}),onClick:()=>{ee&&!Q&&G()},children:[" ",(0,i.jsx)(w.$TP,{className:r().icon_arrow}),(0,i.jsx)("div",{className:d()(r().divider,{[r().dark]:e.isDark})}),(0,i.jsx)(U,{isDark:e.isDark,icon:e.options[e.selectedOptIndex].icon,level:e.level}),(0,i.jsxs)("div",{className:r().text_ctn,children:[(0,i.jsx)("span",{className:d()(r().text,{[r().sm]:Z}),children:z?e.options[e.selectedOptIndex].texts.downloaded:e.options[e.selectedOptIndex].texts.download}),Z&&(0,i.jsxs)("span",{className:r().sub_text,children:[Z," ",e.options[e.selectedOptIndex].sizeMB?` - ${x(e.options[e.selectedOptIndex].sizeMB)}`:""]})]})]}):(0,i.jsxs)(C(),{href:Y?e.options[e.selectedOptIndex].url:ei,prefetch:!1,className:d()(r().button_main,{[r().align_left]:"left"===e.options[e.selectedOptIndex].align,[r().align_center]:"center"===e.options[e.selectedOptIndex].align,[r().align_right]:"right"===e.options[e.selectedOptIndex].align}),onClick:q,children:[(0,i.jsx)(w.$TP,{className:r().icon_arrow}),(0,i.jsx)("div",{className:d()(r().divider,{[r().dark]:e.isDark})}),(0,i.jsx)(U,{isDark:e.isDark,icon:e.options[e.selectedOptIndex].icon,level:e.level}),(0,i.jsxs)("div",{className:r().text_ctn,children:[(0,i.jsx)("span",{className:d()(r().text,{[r().sm]:Z}),children:z?e.options[e.selectedOptIndex].texts.downloaded:e.options[e.selectedOptIndex].texts.download}),Z&&(0,i.jsxs)("span",{className:r().sub_text,children:[Z," ",e.options[e.selectedOptIndex].sizeMB?` - ${x(e.options[e.selectedOptIndex].sizeMB)}`:""]})]})]}),e.options[e.selectedOptIndex]&&e.options[e.selectedOptIndex].settingClickHandler&&(0,i.jsx)("div",{className:r().button_ctrl,children:(0,i.jsx)("div",{className:r().button_ctrl_item,onClick:()=>e.options[e.selectedOptIndex].settingClickHandler?.(),children:(0,i.jsx)(c.hgV,{className:d()(r().setting_icon,{[r().dark]:e.isDark})})})})]}),e.options.length>1&&!J&&(0,i.jsx)("button",{onClick:()=>{let t=W.current?.getBoundingClientRect();if(!t)return;$(t);let n=t.height,i=t.width,o=n*(e.options?.length||0),a=o+80-(E?E.height-t.y:0)>0?-(o+10):n+10;t&&!O?B({x:t.x+i,y:t.y+a,itemHeight:n}):B(null)},className:d()(r().button_dropdown,{[r().dark]:e.isDark}),children:O?(0,i.jsx)(g.PXF,{className:d()(r().dropdown_icon)}):(0,i.jsx)(h.v5n,{className:d()(r().dropdown_icon)})}),!!O&&R&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.default,{portalElementId:"modal-portal",children:(0,i.jsx)("div",{style:{to
1p:O.y,left:O.x,width:R.width},className:d()(r().opt_window,{[r().window_1]:1===e.level,[r().window_2]:2===e.level,[r().window_3]:3===e.level,[r().dark]:e.isDark}),children:(0,i.jsx)("ul",{className:d()(r().opt_ls),children:e.options.map((t,n)=>(0,i.jsx)("li",{className:d()(r().opt_item,{[r().dark]:e.isDark}),children:(0,i.jsxs)("button",{className:r().button_main,type:"button",onClick:()=>{e.setSelectedOpt(n),H(),(0,m.setCookie)(e.preferenceCookieName,n.toString(),{expires:new Date(Date.now()+863999136e5)})},children:[(0,i.jsx)(U,{isDark:e.isDark,icon:t.icon,level:e.level}),(0,i.jsx)("div",{className:d()(r().divider,{[r().isDark]:e.isDark})}),(0,i.jsxs)("div",{className:r().text_ctn,children:[(0,i.jsx)("span",{className:d()(r().text,{[r().sm]:t.texts.sub_download}),children:t.texts.download}),t.texts.sub_download&&(0,i.jsx)("span",{className:r().sub_text,children:t.texts.sub_download})]})]})},t._id+n))})})}),(0,i.jsx)(_.A,{show:!!O,close:H,opacity:.001})]})]})},E=e=>{let t=(0,k.usePathname)()||"/",n=(0,T.md)(V.Ec),a=(0,V.lL)(t),s=(0,V.o5)(n??a),{downloadedListCtx:u,downloadedListHandlerCtx:b,downloadStatusHandlerCtx:y,downloadIdQueueHandlerCtx:D,downloadIdQueueCtx:P,systemLocaleCtx:I,progressBarUIOnlyHandlerCtx:j,addDownloadIdHandlerCtx:N}=o.useContext(l.Ay),[L,O]=o.useState(null),[B,E]=o.useState(null),[R,$]=o.useState(null),M=t.includes("/dl"),G=t.includes("/dl-audio-music"),W=o.useRef(null);o.useEffect(()=>{let e=()=>{E({height:window.innerHeight,width:window.innerWidth})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),o.useEffect(()=>{let e=()=>{O(null)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]);let H=()=>{O(null)},q=()=>{if(!e.options[e.selectedOptIndex])return;let t=e.options[e.selectedOptIndex];if((0,f.Xz)(t.featureLabel),A(t)&&!G){j(!0),N(t._id),y("DOWNLOADING");return}if("video"==e.dataType&&t.tag?.includes("hd")&&!e.hdUnavailable){window.open(e.options[e.selectedOptIndex].url,"_blank"),b(e.options[e.selectedOptIndex]._id),D(),y("DOWNLOADING");return}"video"!==e.dataType||t._id.includes("-hd-procedure")||(0,v.WI)(e.options[e.selectedOptIndex].url)||e._id.includes("-hd")||e.handleAmplificationDownload?.(e.options[e.selectedOptIndex].contentId),e.options[e.selectedOptIndex].downloadClickHandler(),H()},z=u.includes(e.options[e.selectedOptIndex]._id),Z=e.options[e.selectedOptIndex].texts.sub_download&&"-"!==e.options[e.selectedOptIndex].texts.sub_download?e.options[e.selectedOptIndex].texts.sub_download:"",K=P.length>0,[X,Y]=o.useState(5);o.useEffect(()=>{"preparing"===e.status&&e.remainingTime?Y(Math.max(0,Math.min(5,Math.floor(Math.max(0,e.remainingTime)/F*5)))):Y(5)},[e.remainingTime,e.status]);let J=e.options[e.selectedOptIndex],Q=A(J),ee="en"===I?"":`/${I}`,et=d()(r().button_main,{[r().align_left]:J?.align==="left",[r().align_center]:J?.align==="center",[r().align_right]:J?.align==="right"}),en=(0,i.jsxs)(i.Fragment,{children:["preparing"!==e.status&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(w.$TP,{className:r().icon_arrow}),(0,i.jsx)("div",{className:d()(r().divider,{[r().dark]:e.isDark})}),(0,i.jsx)(U,{isDark:e.isDark,icon:J.icon,level:e.level})]}),(0,i.jsxs)("div",{className:r().text_ctn,children:[(0,i.jsx)("span",{className:d()(r().text,{[r().sm]:Z}),children:z?J.texts.downloaded:"preparing"===e.status?`${(J.texts.preparing_hd||S.Ou).replace("#",Math.floor((e.remainingTime??0)/1e3).toString())}${X>0?` ${".".repeat(X)}`:""}`:J.texts.download}),Z&&"preparing"!==e.status&&(0,i.jsxs)("span",{className:r().sub_text,children:[Z," ",J.sizeMB?` - ${x(J.sizeMB)}`:""]})]})]});return(0,i.jsxs)("div",{className:r().button_ctn_v3,children:[(0,i.jsxs)("div",{ref:W,className:d()(r().button_v3,{[r().disabled]:"preparing"===e.status,[r().btn_1]:1===e.level,[r().btn_2]:2===e.level,[r().btn_3]:3===e.level,[r().dark]:e.isDark,[r().btn_downloaded]:u.includes(e.options[e.selectedOptIndex]._id)}),style:e.style,children:[Q&&!G?(0,i.jsx)(C(),{href:`${s}/dl-audio-music${ee}`,prefetch:!1,className:et,onClick:q,children:en}):(0,i.jsx)("button",{className:et,disabled:z||K||"preparing"===e.status,type:"button",onClick:q,children:en}),J&&J.settingClickHandler&&(0,i.jsx)("div",{className:r().button_ctrl,children:(0,i.jsx)("div",{className:r().button_ctrl_item,onClick:()=>e.options[e.selectedOptIndex].settingClickHandler?.(),children:(0,i.jsx)(c.hgV,{className:d()(r().setting_icon,{[r().dark]:e.isDark})})})})]}),e.options.length>1&&!M&&(0,i.jsx)("button",{onClick:()=>{let t=W.current?.getBoundingClientRect();if(!t)return;$(t);let n=t.height,i=t.width,o=n*(e.options?.length||0),a=o+80-(B?B.height-t.y:0)>0?-(o+10):n+10;t&&!L?O({x:t.x+i,y:t.y+a,itemHeight:n}):O(null)},className:d()(r().button_dropdown,{[r().dark]:e.isDark}),children:L?(0,i.jsx)(g.PXF,{className:d()(r().dropdown_icon)}):(0,i.jsx)(h.v5n,{className:d()(r().dropdown_icon)})}),!!L&&R&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.default,{portalElementId:"modal-portal",children:(0,i.jsx)("div",{style:{to
1p:L.y,left:L.x,width:R.width},className:d()(r().opt_window,{[r().window_1]:1===e.level,[r().window_2]:2===e.level,[r().window_3]:3===e.level,[r().dark]:e.isDark}),children:(0,i.jsx)("ul",{className:d()(r().opt_ls),children:e.options.map((t,n)=>(0,i.jsx)("li",{className:d()(r().opt_item,{[r().dark]:e.isDark}),children:(0,i.jsxs)("button",{className:r().button_main,type:"button",onClick:()=>{e.setSelectedOpt(n),H(),(0,m.setCookie)(e.preferenceCookieName,n.toString(),{expires:new Date(Date.now()+863999136e5)})},children:[(0,i.jsx)(U,{isDark:e.isDark,icon:t.icon,level:e.level}),(0,i.jsx)("div",{className:d()(r().divider,{[r().isDark]:e.isDark})}),(0,i.jsxs)("div",{className:r().text_ctn,children:[(0,i.jsx)("span",{className:d()(r().text,{[r().sm]:t.texts.sub_download}),children:t.texts.download}),t.texts.sub_download&&(0,i.jsx)("span",{className:r().sub_text,children:t.texts.sub_download})]})]})},t._id+n))})})}),(0,i.jsx)(_.A,{show:!!L,close:H,opacity:.001})]})]})},U=e=>(0,i.jsx)("div",{className:d()(r().icon_ctn,{[r().dark]:e.isDark},r().no_bg),children:(0,i.jsx)(e.icon,{className:r().icon})}),F=0,R=e=>{let t=(0,k.usePathname)()||"/",{onDownloadIdCtx:n,downloadIdQueueCtx:a,downloadedListCtx:r,isOnRetryHDCtx:s,progressBarUIOnlyCtx:d}=o.useContext(l.Ay),[c,p]=o.useState(0),[_,h]=(0,T.fp)(D.VV),g=1===e.level,w=g?_:c,f=g?h:p,[x,b]=o.useState(0),C=o.useRef(null),S=o.useRef(0),P=o.useRef(0),I=o.useRef(!1);o.useEffect(()=>{let t=(0,m.getCookie)(e.preferenceCookieName);if(t){let n=parseInt(t,10);Number.isNaN(n)||f(Math.min(Math.max(0,n),e.options.length-1))}},[e.level,e.options.length,e.preferenceCookieName]),o.useEffect(()=>{let t=e.options[w||0],n=t?._id;if(!t||!n?.includes("-hd")){I.current=!1,P.current=0,b(0);return}I.current=!1,P.current=0,b(0);let i=()=>{I.current||(S.current=Date.now()-P.current,C.current=setInterval(()=>{let e=Date.now()-S.current;b(e),e>=F&&(C.current&&(clearInterval(C.current),C.current=null),I.current=!0,b(F))},100))},o=()=>{document.hidden?C.current&&(clearInterval(C.current),C.current=null,P.current=Date.now()-S.current):!I.current&&P.current<F&&i()};return document.addEventListener("visibilitychange",o),document.hidden||i(),()=>{C.current&&clearInterval(C.current),document.removeEventListener("visibilitychange",o)}},[w,e.options[w||0]?._id]);let j=e.options[w]??e.options[0],N=j?._id.includes("-hd")&&x<F?"preparing":"ready",L=j._id&&j._id.includes("-hd")&&a[0]?.includes("-hd-procedure"),V=L?a[0]:j._id;if(j&&a[0]===j._id||L){let n=t.includes("/dl-audio-music");return d&&A(j)&&!n?(0,i.jsx)(O,{isDark:e.isDark,downloadingText:j.texts.downloading}):!j._id.includes("-hd-procedure")&&(j.tag?.includes("video")&&!(0,v.WI)(j.url)||"video"===e.dataType&&e._id.includes("-hd")&&e.hdUnavailable&&!L)?(0,i.jsx)(y.A,{...e,url:j.url,_id:j._id,filename:j.filename,withSpeed:j.withSpeed,downloadText:j.texts.download,downloadingText:j.texts.downloading,downloadedText:j.texts.downloaded,waitingText:j.texts.waiting}):(0,i.jsx)(u.A,{...e,url:j.url,_id:V,filename:j.filename,withSpeed:j.withSpeed,isConvert:j.isConvert,contentId:e.contentId,downloadText:j.texts.download,downloadingText:j.texts.downloading,downloadedText:j.texts.downloaded,featureLabel:j.featureLabel})}return j&&(j?.tag?.includes("hd")||j?._id.includes("-hd"))&&"ready"===N?(0,i.jsx)(B,{...e,selectedOptIndex:w,setSelectedOpt:f,_id:j._id,status:N}):j?(0,i.jsx)(E,{...e,selectedOptIndex:w,setSelectedOpt:f,_id:j._id,status:N,remainingTime:F-x}):null},$=e=>{let{onDownloadIdCtx:t}=o.useContext(l.Ay);return(0,i.jsxs)("div",{className:r().screen,children:[(0,i.jsx)("div",{className:d()(r().btn_ctn,{[r().ondownload]:t}),children:(0,i.jsx)(R,{...e})}),(0,i.jsx)("div",{className:r().ctrl_ctn,children:(0,i.jsx)("button",{className:r().btn_cancel,children:(0,i.jsx)(c.Tfw,{className:r().icon})})})]})}},80835:e=>{e.exports={tray:"PlaylistTray_tray__NlXzU",list:"PlaylistTray_list__leSbo",dark:"PlaylistTray_dark__LlAdz",light:"PlaylistTray_light__5gDc_",item:"PlaylistTray_item__eXLUh",button:"PlaylistTray_button__NOVGm",ring:"PlaylistTray_ring__hPFze",cover:"PlaylistTray_cover__0bUSS",coverIconWrap:"PlaylistTray_coverIconWrap__NxW5L",coverIcon:"PlaylistTray_coverIcon__ZnMTf",title:"PlaylistTray_title__YjCHj",count:"PlaylistTray_count__38atk",iconCover:"PlaylistTray_iconCover__iTBli"}}
1,84939:(e,t,n)=>{"use strict";n.d(t,{A:()=>b});var i=n(95155),o=n(12115),a=n(79005),r=n.n(a),l=n(69730),s=n.n(l),d=n(247),c=n(3701),u=n(42021),p=n(133),_=n(73321),m=n(29988),h=n(98314),g=n(74473),w=n(48409),f=n(95555),v=n(14185),x=n(82605);let b=e=>{let t=(0,_.usePathname)()||"/",n="https://vidgap.com".replace(/\/$/,""),a=(0,f.md)(v.Ec),l=(0,f.Xr)(x.N),b=(0,v.lL)(t),C=(0,v.o5)(a??b),y=(0,_.useSearchParams)(),{tabBeforeDownloadCtx:S,systemLocaleCtx:k,downloadIdQueueCtx:T}=o.useContext(d.Ay),{themeCtx:D}=o.useContext(p.A),P="en"==k?"":`/${k}`,I=t.includes("/dl"),j=T.length>0&&I,[N,L]=o.useState(!1),[V,A]=o.useState(null),O=[`${n}${C}${P}`,`${n}${C}/video${P}`,`${n}${C}/audio${P}`,`${n}${C}/slideshow${P}`,`${n}${C}/story${P}`,`${n}${C}/thumbnail${P}`,`${n}${C}/profile${P}`,`${n}${C}/subtitle${P}`,`${n}${C}/caption${P}`,`${n}${C}/highlight${P}`,`${n}${C}/playlist${P}`,`${n}${C}/collection${P}`][S??0],B=()=>{L(!1),A(null)},E=()=>{Object.fromEntries(y?.entries()??[]),e.handleAgain(),(0,m.R6)()},U=()=>{l(e=>e+1),e.handleRedownload()};return(0,i.jsxs)("div",{className:r().container,children:[(0,i.jsxs)("a",{href:O,className:s()(r().againBtn,r().btn,{[r().dark]:"dark"===D,[r().light]:"light"===D}),type:"button",onClick:e=>{if(j){e.preventDefault(),A("back"),L(!0);return}E()},children:[(0,i.jsx)(u.oWm,{className:r().icon}),(0,i.jsx)("span",{className:r().btnTxt,children:e.againTxt||c.nI})]}),!I&&"FOUND"!==e.findStatus&&"INVALID"!==e.findStatus&&"SEARCHING"!==e.findStatus&&(0,i.jsxs)("button",{className:s()(r().redownloadBtn,r().btn,{[r().dark]:"dark"===D,[r().light]:"light"===D}),type:"button",onClick:()=>{if(j){A("retry"),L(!0);return}U()},children:[(0,i.jsx)(u.QpL,{className:r().icon}),(0,i.jsx)("span",{className:r().btnTxt,children:e.redownloadTxt||c.zX})]}),(0,i.jsxs)("button",{className:s()(r().viewBtn,r().btn,{[r().dark]:"dark"===D,[r().light]:"light"===D}),type:"button",disabled:!0,children:[(0,i.jsx)(u.j6T,{className:r().icon}),(0,i.jsx)("span",{className:r().btnTxt,children:e.viewTxt||c.fT})]}),N&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(w.default,{portalElementId:"backdrop-portal",children:(0,i.jsx)(h.A,{show:!0,close:B,opacity:.35,blur:4,zIndex:0x5f5e0fe})}),(0,i.jsx)(w.default,{portalElementId:"modal-portal",children:(0,i.jsxs)("div",{className:s()(r().confirmCard,{[r().dark]:"dark"===D,[r().light]:"light"===D}),children:[(0,i.jsx)(g.Tfw,{className:r().confirmClose,onClick:B}),(0,i.jsxs)("div",{className:r().confirmContentWrapper,children:[(0,i.jsx)("div",{className:r().confirmContent,children:(0,i.jsxs)("div",{className:r().confirmDesc,children:[(0,i.jsx)("p",{className:r().confirmTitle,children:"Download in progress"}),(0,i.jsx)("p",{className:r().confirmSubtitle,children:"back"===V?"Are you sure you want to go back? Your current download may be interrupted.":"Are you sure you want to retry? Your current download may be interrupted."})]})}),(0,i.jsxs)("div",{className:r().confirmBtnGroup,children:[(0,i.jsx)("button",{className:s()(r().confirmBtn,r().cancelBtn,{[r().dark]:"dark"===D,[r().light]:"light"===D}),type:"button",onClick:B,children:"Cancel"}),(0,i.jsx)("button",{className:s()(r().confirmBtn,r().proceedBtn,{[r().dark]:"dark"===D,[r().light]:"light"===D}),type:"button",onClick:()=>{L(!1),"back"===V?(E(),window.location.replace(O)):"retry"===V&&U(),A(null)},children:"Proceed"})]})]})]})})]})]})}},91994:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(95155);n(12115);var o=n(31413);let a=()=>(0,i.jsx)(o.A,{showMid:!1})},92548:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(95155);n(12115);var o=n(31413);let a=()=>(0,i.jsx)(o.A,{showMid:!0})},93220:(e,t,n)=>{"use strict";n.d(t,{Dh:()=>m,EU:()=>d,S0:()=>p,Td:()=>c,VI:()=>o,oD:()=>u,rf:()=>_,tN:()=>a,y2:()=>l});var i=n(21329);function o(e,t){let n=(0,i.iO)(e.replace(/^@/,"")||"unknown");return`${n}-playlist-${t}`}function a(e){return/(?:^|-)playlist-.+-\d+-offline$/.test(e)}function r(e,t){let n=(0,i.iO)(e.replace(/^@/,"")||"unknown"),o=(0,i.iO)(t)||"playlist";return`${n}-playlist-${o}`}function l(e){var t;let n=Array.isArray(e)?e[0]:e,i=Array.isArray(e)&&_(e);if(!a(n.id))return n.title;if(!(!n.title||"Untitled"===n.title||"playlist"===n.title))return i?n.title.replace(/-\d+$/,""):n.title;let o=c(n.id),l=o?s(o):null,d=r(n.username,l||"playlist");return i?d:(t=u(n.id),`${d}-${t}`)}function s(e){let t="-playlist-",n=e.indexOf(t);return n>=0?e.slice(n+t.length):e.startsWith("playlist-")?e.slice(9):null}function d(e){let t=c(e);return t?s(t):null}function c(e){return a(e)?e.replace(/-\d+-offline$/,""):null}function u(e){let t=e.match(/-(\d+)-offline$/);return t?parseInt(t[1],10):0}function p(e){let t=new Map;for(let n of e){if(!a(n.id))continue;let e=u(n.id);t.has(e)||t.set(e,n)}return[...t.entries()].sort(([e],[t])=>e-t).map(([,e])=>e)}function _(e){return e.length>0&&a(e[0].id)}function m(e,t){var n;let i;if(!a(e))return{title:t.videoDataCtx?.title??"Untitled",username:t.videoDataCtx?.username??"Unknown"};let o=c(e),l=u(e),d=t.activePlaylistIdCtx??(o?s(o):null),p=d?t.userPlaylistDataCtx?.playlists.find(e=>e.contentId===d):void 0,_=d?t.playlistContentDataCtx?.[d]:void 0,m=p?.title||_?.t
1itle||t.videoDataCtx?.title||"",h=t.userPlaylistDataCtx?.username||_?.username||t.videoDataCtx?.username||(o&&(i=o.indexOf("-playlist-"))>=0?o.slice(0,i):"unknown");return{title:(n=r(h,m||"playlist"),`${n}-${l}`),username:h}}},96694:e=>{e.exports={picker:"CollectionPickerCard_picker__9ORcx",emptyStage:"CollectionPickerCard_emptyStage__HywNm",collectionIcon:"CollectionPickerCard_collectionIcon__GlsCp",dark:"CollectionPickerCard_dark__Y6iER",light:"CollectionPickerCard_light__rzVZ_",traySlot:"CollectionPickerCard_traySlot__11dHD"}},96802:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>tv});var i=n(95155),o=n(12115),a=n(247),r=n(37206);let l=(e,t)=>({video:["all","video","story","audio","thumbnail","profile"],slideshow:["all","slideshow","audio","thumbnail","profile","story"],audio:["all","audio","thumbnail","profile"],profile:["all","profile"],story:["story","audio","profile"],subtitle:["all","subtitle","thumbnail","profile"],highlight:["highlight"],playlist:["playlist"],collection:["collection"]})[e]?.some(e=>e==t)??!1;var s=n(34519),d=n(10307),c=n(73321),u=n(91994),p=n(29988),_=n(95555),m=n(92843),h=n(86585),g=n(6442),w=n(49678),f=n(8531),v=n(65133),x=n(29763),b=n(68097),C=n(3701),y=n(13958),S=n(36134),k=n(57504),T=n(11602),D=n(4555),P=n.n(D),I=n(35718),j=n.n(I),N=n(69730),L=n.n(N),V=n(133),A=n(48409),O=n(55724),B=n(84939),E=n(39425),U=n(52215),F=n(21338),R=n(22202),$=n.n(R);let M=()=>{let{themeCtx:e}=o.useContext(V.A);return(0,i.jsx)("div",{className:L()($().previewer,{[$().dark]:"dark"===e,[$().light]:"light"===e}),children:(0,i.jsxs)("div",{className:L()($().previewerContent,{[$().dark]:"dark"===e,[$().light]:"light"===e}),children:[(0,i.jsxs)("div",{className:$().previewerContent_information,children:[(0,i.jsx)("div",{className:L()($().previewerContent_information_title,$().skeleton,$().shimmer,$().pulse,{[$().dark]:"dark"===e,[$().light]:"light"===e})}),(0,i.jsx)("div",{className:L()($().previewerContent_information_title,$().skeleton,$().shimmer,$().pulse,{[$().dark]:"dark"===e,[$().light]:"light"===e})}),(0,i.jsx)("div",{className:$().previewerContent_information_bottom,children:(0,i.jsxs)("div",{className:$().previewerContent_information_profile,children:[(0,i.jsx)("div",{className:L()($().previewerContent_information_profile_image,$().skeleton,$().shimmer,$().pulse,{[$().dark]:"dark"===e,[$().light]:"light"===e})}),(0,i.jsx)("div",{className:L()($().previewerContent_information_profile_name,$().skeleton,$().shimmer,$().pulse,{[$().dark]:"dark"===e,[$().light]:"light"===e})}),(0,i.jsx)("div",{className:L()($().previewerContent_information_timePosted,$().skeleton,$().shimmer,$().pulse,{[$().dark]:"dark"===e,[$().light]:"light"===e})})]})})]}),(0,i.jsx)("div",{className:$().previewerContent_figure,children:(0,i.jsx)("div",{className:L()($().previewerContent_figure_image,$().skeleton,$().shimmer,$().pulse,{[$().dark]:"dark"===e,[$().light]:"light"===e})})})]})})};var G=n(28105),W=n(42021),H=n(29356),q=n(98169),z=n.n(q),Z=n(56636),K=n.n(Z),X=n(80090),Y=n(98314);let J=({level:e,isDark:t,options:n,selectedIndex:a,onSelectOption:r,onMainClick:l,disabled:s,trailingControl:d,languagePicker:c,className:u})=>{let[p,_]=o.useState(null),[m,h]=o.useState(null),[g,w]=o.useState(null),f=o.useRef(null),v=n[a],x=s||!v||v.disabled,b=(n,o)=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(X.wl,{isDark:t,icon:n.actionIcon,level:e}),(0,i.jsx)("div",{className:L()(z().divider,K().optionDivider,{[z().dark]:t})}),(0,i.jsx)(X.wl,{isDark:t,icon:n.formatIcon,level:e}),(0,i.jsxs)("div",{className:L()(z().text_ctn,{}),children:[(0,i.jsxs)("span",{className:L()(z().text,{}),children:[n.mainText,n.formatSuffix&&` | ${n.formatSuffix}`]}),n.subText&&(0,i.jsxs)("span",{className:L()(z().sub_text,z().align_left),children:["(",n.subText,")"]})]})]});o.useEffect(()=>{let e=()=>{h({height:window.innerHeight,width:window.innerWidth})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),o.useEffect(()=>{let e=()=>_(null);return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]);let C=()=>_(null),y=!!d||!!c;return v?(0,i.jsxs)("div",{className:L()(z().button_ctn_v3,u),children:[(0,i.jsxs)("div",{ref:f,className:L()(z().button_v3,{[z().disabled]:x,[z().btn_1]:1===e,[z().btn_3]:3===e,[z().dark]:t}),children:[(0,i.jsx)("button",{type:"button",className:L()(z().button_main,z().al
1ign_center,{[K().buttonMainWithTrailing]:y&&!c,[K().buttonMainWithLangPicker]:!!c}),disabled:x,onClick:l,children:(0,i.jsx)("div",{className:K().mainContentCentered,children:b(v,y)})}),(c||d)&&(0,i.jsxs)("div",{className:K().trailingControlsGroup,children:[c,d&&(0,i.jsx)("div",{className:L()(K().trailingTimerBtn,K().trailingGlassBtn,{[K().trailingGlassBtnDark]:t,[K().trailingCtrlActive]:d.active,[K().trailingCtrlDisabled]:d.disabled||s}),children:(0,i.jsx)("div",{role:"button",tabIndex:d.disabled||s?-1:0,"aria-label":d.ariaLabel,"aria-pressed":d.active,className:K().trailingTimerBtnItem,onClick:e=>{e.stopPropagation(),d.disabled||s||d.onClick()},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),d.disabled||s||d.onClick())},children:(0,i.jsx)(d.icon,{className:K().trailingTimerIcon})})})]})]}),n.length>1&&(0,i.jsx)("button",{type:"button",onClick:()=>{let e=f.current?.getBoundingClientRect();if(!e)return;w(e);let t=e.height,i=e.width,o=t*n.length,a=o+80-(m?m.height-e.y:0)>0?-(o+10):t+10;e&&!p?_({x:e.x+i,y:e.y+a,itemHeight:t}):_(null)},disabled:s,className:L()(z().button_dropdown,{[z().dark]:t}),children:p?(0,i.jsx)(H.PXF,{className:z().dropdown_icon}):(0,i.jsx)(W.v5n,{className:z().dropdown_icon})}),p&&g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(A.default,{portalElementId:"modal-portal",children:(0,i.jsx)("div",{style:{top:p.y,left:p.x,width:g.width},className:L()(z().opt_window,{[z().window_1]:1===e,[z().window_3]:3===e,[z().dark]:t}),children:(0,i.jsx)("ul",{className:z().opt_ls,children:n.map((e,o)=>(0,i.jsx)("li",{className:L()(z().opt_item,{[z().dark]:t,[K().optItemDisabled]:e.disabled}),children:(0,i.jsx)("button",{type:"button",className:L()(z().button_main,{[K().optionBtnDisabled]:e.disabled}),disabled:e.disabled,onClick:()=>{!n[o]?.disabled&&(r(o),C())},children:b(e)})},e.id))})})}),(0,i.jsx)(Y.A,{show:!!p,close:C,opacity:.001})]})]}):null};var Q=n(12505),ee=n(13267);let et=["srt","txt","vtt"],en=({isDark:e,showTimestamp:t,disabled:n,onDownloadSRT:a,onDownloadTXT:r,onDownloadVTT:l,className:s})=>{let[d,c]=o.useState(0);o.useEffect(()=>{t||1===d||c(1)},[t,d]);let u=[{id:"srt",mainText:"Download Subtitle",formatSuffix:"SRT",actionIcon:Q.$TP,formatIcon:ee.c4t,disabled:!t},{id:"txt",mainText:"Download Subtitle",formatSuffix:"TXT",actionIcon:Q.$TP,formatIcon:ee.c4t,subText:t?"Timestamp":"No Timestamp",disabled:!1},{id:"vtt",mainText:"Download Subtitle",formatSuffix:"VTT",actionIcon:Q.$TP,formatIcon:ee.c4t,disabled:!t}];return(0,i.jsx)(J,{level:1,isDark:e,options:u,selectedIndex:d,onSelectOption:c,onMainClick:()=>{let e=et[d];"srt"===e?a():"txt"===e?r():l()},disabled:n,className:s})};var ei=n(99925),eo=n(74473),ea=n(67564),er=n(38323),el=n(31614),es=n(6801);let ed={"ara-SA":"ar","bul-BG":"bg","ben-BD":"bn","ceb-PH":"ceb","ces-CZ":"cs","dan-DK":"da","deu-DE":"de","ell-GR":"el","eng-US":"en","spa-ES":"es","est-EE":"et","fin-FI":"fi","fil-PH":"fil","fra-FR":"fr","fra-CA":"fr","heb-IL":"he","hin-IN":"hi","hrv-HR":"hr","hun-HU":"hu","ind-ID":"id","ita-IT":"it","jpn-JP":"ja","jav-ID":"jv","khm-KH":"km","kor-KR":"ko","lit-LT":"lt","lav-LV":"lv","msa-MY":"ms","mya-MM":"mm","nob-NO":"no","nld-NL":"nl","pol-PL":"pl","por-PT":"pt","ron-RO":"ro","rus-RU":"ru","slk-SK":"sk","swe-SE":"se","tha-TH":"th","tur-TR":"tr","ukr-UA":"uk","urd-PK":"ur","uzb-UZ":"uz","vie-VN":"vi","cmn-Hans-CN":"zh","cmn-Hant-CN":"zh-Hant","kaz-KZ":"kz","isl-IS":"is","gle-IE":"ga","cat-ES":"ca","alb-AL":"sq","slv-SI":"sl","swa-SW":"sw","aze-AZ":"az"};function ec(e){let t=e.trim(),n=ed[t]??ed[t.toLowerCase()];if(n)return n;let i=es.gQ.find(e=>e[0].toLowerCase()===t.toLowerCase());if(i)return i[0];let o=es.gQ.find(e=>e[1].toLowerCase()===t.toLowerCase());return o?o[0]:t}let eu=({isDark:e,disabled:t,tracks:n,selectedLangCode:a,onSelectLangCode:r})=>{let l=o.useRef(null),[s,d]=o.useState(null),c=()=>d(null);return o.useEffect(()=>{let e=()=>d(null);return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0)},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("button",{ref:l,type:"button",className:L()(K().languageCtrlBtn,K().trailingGlassBtn,{[K().trailingGlassBtnDark]:e,[K().languageCtrlBtnDisabled]:t}),onClick:e=>{if(e.stopPropagation(),t)return;let n=l.current?.getBoundingClientRect();if(n){if(s)return void d(null);d({x:n.right,y:n.bottom+4,width:Math.max(n.width,120)})}},disabled:t,"aria-label":"Select subtitle language",children:[(0,i.jsx)(er.Ded,{className:K().languageCtrlIcon}
1),(0,i.jsx)("span",{className:K().languageCtrlCode,children:ec(a).toUpperCase()})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(A.default,{portalElementId:"modal-portal",children:(0,i.jsx)("div",{className:L()(K().languagePickerModal,{[K().languagePickerModalDark]:e}),style:{top:s.y,left:s.x,minWidth:s.width,transform:"translateX(-100%)"},children:(0,i.jsx)("ul",{className:K().languagePickerList,children:n.map(t=>{var n;let o;return(0,i.jsx)("li",{children:(0,i.jsx)("button",{type:"button",className:L()(K().languagePickerOption,{[K().languagePickerOptionDark]:e,[K().languagePickerOptionActive]:t.langCode===a}),onClick:()=>{r(t.langCode),c()},children:(o=ec(n=t.langCode),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(el.A,{loading:"lazy",countryCode:function(e){switch(e.toLocaleLowerCase()){case"en":return"US";case"zh":case"zh-hant":return"CN";case"ca":return"ES-CT";case"jv":return"ID";case"ceb":return"PH";default:return e}}(o),svg:!0,className:L()(K().languageFlagIcon,{[K().languageFlagIconLight]:!e}),alt:"flag"}),(0,i.jsx)("span",{className:K().languageModalLabel,children:function(e){let t=ec(e),n=es.gQ.find(e=>e[0]===t);if(!n){let e=t.split("-")[0];n=es.gQ.find(t=>t[0]===e)}return n?.[2]??e}(n)})]}))})},t.langCode)})})})}),(0,i.jsx)(Y.A,{show:!!s,close:c,opacity:.001})]})]})},ep=({isDark:e,subtitleDisabled:t,captionDisabled:n,hashtagsDisabled:a,mentionsDisabled:r,showTimestamp:l,onToggleTimestamp:s,onCopySubtitle:d,onCopyCaption:c,onCopyHashtags:u,onCopyMentions:p,showLanguagePicker:_,tracks:m,selectedLangCode:h,onSelectLangCode:g,className:w,defaultSelectedIndex:f=0,isCaption:v=!1})=>{let[x,b]=o.useState(f),C=[!v?{id:"copy-subtitle",mainText:"Copy Subtitle to clipboard",actionIcon:eo.xwQ,formatIcon:ee.c4t,subText:l?"Timestamp":"No Timestamp",disabled:t}:void 0,v?{id:"copy-caption",mainText:"Copy Caption to clipboard",actionIcon:eo.xwQ,formatIcon:ea.qdk,disabled:n}:void 0,v?{id:"copy-hashtags",mainText:"Copy Hashtags to Clipboard",actionIcon:eo.xwQ,formatIcon:ea.BDA,disabled:a}:void 0,v?{id:"copy-mentions",mainText:"Copy Mentions to Clipboard",actionIcon:eo.xwQ,formatIcon:ea.WB4,disabled:r}:void 0].filter(Boolean),y=C[x]?.id==="copy-subtitle",S=y&&_&&m?.length&&h&&g?(0,i.jsx)(eu,{isDark:e,disabled:t,tracks:m,selectedLangCode:h,onSelectLangCode:g}):void 0,k=y?{onClick:s,active:l,disabled:t,icon:ei.Gyv,ariaLabel:"Toggle timestamp"}:void 0;return(0,i.jsx)(J,{level:3,isDark:e,options:C,selectedIndex:x,onSelectOption:b,onMainClick:()=>(e=>{switch(e){case"copy-subtitle":d();break;case"copy-caption":c();break;case"copy-hashtags":u();break;case"copy-mentions":p()}})(C[x]?.id??""),languagePicker:S,trailingControl:k,className:w})};var e_=n(54349),em=n(21329),eh=n(48817),eg=n(56799);function ew(e,t){let n=(0,em.Qg)(e).replace(/[^a-z0-9]/gi,"_").slice(0,20).toLowerCase();return`vidgap-${n}-subtitles.${t}`}let ef=({blocks:e,showTimestamp:t,isNotFound:n,isDark:o,isLight:a})=>{let r={[P().dark]:o,[P().light]:a};return(0,i.jsx)("div",{className:L()(P().subtitlePreviewStrip,r),"aria-live":"polite",children:n?(0,i.jsx)("p",{className:L()(P().notFoundText,r),children:"Transcription not found"}):(0,i.jsx)("ul",{className:P().subtitlePreviewList,children:e.map(e=>(0,i.jsxs)("li",{className:P().subtitleItem,children:[t&&(0,i.jsx)("span",{className:L()(P().time,r),children:e.shortStartTime}),(0,i.jsx)("span",{className:P().text,children:e.text})]},e.index))})})},ev=({subtitleData:e,isNotFound:t,isFetchingSubtitle:n,title:r,username:l,profilePic:s,thumbnail:d,toastLang:u,timePosted:p,contentId:_,copyTxt:m,shareTxt:h,friendlyTimeTexts:g,handleAgain:w,handleRedownload:f,globalPreviewer:v})=>{let x=(0,c.usePathname)()||"/",b=x.split("/"),y=b[b.length-1]||"en",{toastHandlerCtx:S,toastCtx:k,showReviewBarHandlerCtx:D,showReviewBarCtx:I}=o.useContext(a.Ay),N=(0,V.j)(),R="dark"===N,$="light"===N,W={[j().dark]:R,[j().light]:$};P().dark,P().light;let H=(0,eh.c)(l),q=(0,eh.c)(h)||C.i4,z=(0,eh.c)(m)||C.HK,Z=(0,eh.c)(v?.navigation_texts?.back_text),K=(0,eh.c)(v?.navigation_texts?.retry_text),X=(0,eh.c)(v?.navigation_texts?.view_text),[Y,J]=o.useState(null),[Q,ee]=o.useState(null),[et,ei]=o.useState(!0),[eo,ea]=o.use
1State(!0);async function er(){if(!s)return void ee("");try{let e=await F.A.get(s,{responseType:"blob"}),t=URL.createObjectURL(e.data);ee(t)}catch(e){(0,G.SZ)("Error loading profile: ",e),ee(s)}}async function el(){if(!d)return void J("");try{let e=await F.A.get(d,{responseType:"blob"}),t=URL.createObjectURL(e.data);J(t)}catch(e){(0,G.SZ)("Error loading thumbnail:",e),J(d)}}o.useEffect(()=>{er(),el()},[]),o.useEffect(()=>{let e=null!==Y;null!==Q&&e&&ei(!1)},[Q,Y]),o.useEffect(()=>{if(!x.includes("/dl-hd")){let e=setTimeout(()=>{ea(!1)},2e3);return()=>clearTimeout(e)}ea(!1)},[x]);let es=n||et||eo;function ed(e,t,n){let i=new Blob([e],{type:n}),o=URL.createObjectURL(i),a=document.createElement("a");a.href=o,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o),S("DOWNLOADED")}let[ec,eu]=o.useState(!0),[ev,ex]=o.useState(void 0);o.useEffect(()=>{ex((0,T.zd)(e))},[e]);let eb=o.useMemo(()=>(0,T.Ek)(e,ev),[e,ev]),eC=o.useMemo(()=>eb?(0,eg.Ie)(eb):[],[eb]),ey=t||!(0,T.a0)(e)||0===eC.length,eS=!ey&&e?.subtitle===T.Co&&(e.tracks?.length??0)>0,ek=e=>e?eC.map(e=>`${e.shortStartTime} ${e.text}`).join("\n"):eC.map(e=>e.text).join("\n");o.useEffect(()=>{switch(k){case"DOWNLOADED":(0,O.oR)((0,eh.c)(u.download?.success),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"success",delay:1e3});break;case"COPIED":(0,O.oR)((0,eh.c)(u.urlcopied),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"info"});break;case"CANCELLED":(0,O.oR)((0,eh.c)(u.download?.cancel),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"info"});break;case"DOWNLOAD-SUSPENDED":(0,O.oR)((0,eh.c)(u.searchinterrupt?.ondownload),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"error"});break;case"SEARCH-SUSPENDED":(0,O.oR)((0,eh.c)(u.searchinterrupt?.onsearch),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"error"});break;case"MESSAGE-SENT":(0,O.oR)((0,eh.c)(u.message?.sent),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"success"});break;case"MESSAGE-NOT-SENT":(0,O.oR)((0,eh.c)(u.message?.not_sent),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"error"});break;case"INVALID-MESSAGE":(0,O.oR)((0,eh.c)(u.message?.invalid_message),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"error"})}},[k,u]);let eT=!!(0,em.Ft)(r),eD=!!(0,em.PB)(r),eP=!!r;return(0,i.jsxs)("div",{className:j().container,children:[!I&&!es&&(0,i.jsx)("div",{className:j().floatingReviewButtonPortalContainer,children:(0,i.jsx)(e_.A,{showReviewBarHandler:()=>D(!0)})}),(0,i.jsx)(A.default,{portalElementId:"toast-portal",children:(0,i.jsx)(O.ToastContainer,{position:"top-right",autoClose:3e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0,theme:"light"})}),es?(0,i.jsx)(M,{}):(0,i.jsxs)("div",{className:L()(j().previewer,W),style:{opacity:+!es},children:[(0,i.jsxs)("div",{className:L()(j().previewerContent,P().previewerContentHead,W),children:[(0,i.jsxs)("div",{className:j().previewerContent_information,children:[(0,i.jsx)("div",{className:L()(P().subtitleStripInContent,W),children:(0,i.jsx)(ef,{blocks:eC.slice(0,3),showTimestamp:ec,isNotFound:ey,isDark:R,isLight:$})}),(0,i.jsxs)("div",{className:j().previewerContent_information_bottom,children:[(0,i.jsxs)("div",{className:j().previewerContent_information_profile,children:[s&&Q&&(0,i.jsx)("img",{src:Q,alt:"profile",className:j().previewerContent_information_profile_image}),(0,i.jsx)("p",{className:j().previewerContent_information_profile_name,children:H})]}),null!=p&&(0,i.jsx)("div",{className:j().previewerContent_information_timePosted,children:(0,U.F)(p,g??{},y)})]})]}),d&&Y&&(0,i.jsx)("div",{className:j().previewerContent_figure,children:(0,i.jsx)("img",{src:Y,alt:"thumbnail",className:L()(j().previewerContent_figure_image,W)})})]}),(0,i.jsxs)("div",{className:L()(j().previewer_controls,W),children:[(0,i.jsxs)("div",{className:j().previewerControlsGroup,children:[(0,i.jsx)("div",{className:j().previewerControlsTop,children:(0,i.jsx)("div",{className:P().controlsTopInner,children:(0,i.jsx)(en,{isDark:R,showTimestamp:ec,disabled:ey,onDownloadSRT:()=>{!ey&&ec&&ed(eC.map(e=>`${e.index}
2${(0,eg.fY)(e.timestampLine)}
3${e.text}
4`).join("\n"),ew(r,"srt"),"text/plain")},onDownloadTXT:()=>{ey||ed(ek(ec),ew(r,"txt"),"text/plain")},onDownloadVTT:()=>{if(!ey&&ec){let e;ed((e=eC.map(e=>`${(0,eg.OM)(e.timestampLine)}
5${e.text}
6`).join("\n"),`WEBVTT
7
8${e}`),ew(r,"vtt"),"text/vtt")}},className:P().formatDownloadWrap})})}),(0,i.jsx)("div",{className:j().previewerControlsMid,children:(0,i.jsx)(ep,{isDark:R,subtitleDisabled:ey,captionDisabled:!eP,hashtagsDisabled:!eT,mentionsDisabled:!eD,showTimestamp:ec,onToggleTimestamp:()=>eu(e=>!e),onCopySubtitle:()=>{ey||(navigator.clipboard.writeText(ek(ec)),S("COPIED"))},onCopyCaption:()=>{navigator.clipboard.writeText((0,em.MV)(r)),S("COPIED")},onCopyHashtags:()=>{navigator.clipboard.writeText((0,em.Ft)(r)),S("COPIED")},onCopyMentions:()=>{navigator.clipboard.writeText((0,em.PB)(r)),S("COPIED")},showLanguagePicker:eS,tracks:e?.tracks,selectedLangCode:ev,onSelectLangCode:ex,className:P().copyButtonWrap})}),(0,i.jsx)("div",{className:j().previewerControlsBottom,children:(0,i.jsx)(B.A,{findStatus:"FOUND",contentId:_??"",handleAgain:w,handleRedownload:f,againTxt:Z,redownloadTxt:K,viewTxt:X})})]}),_&&(0,i.jsx)(E.A,{copyTxt:z,shareTxt:q,contentVLink:_})]})]})]})};var ex=n(36225),eb=n.n(ex),eC=n(15455);let ey=["full-caption","text","hashtags","mentions"],eS=(0,eC.eU)(0),ek=({isDark:e,fullCaptionDisabled:t,textDisabled:n,hashtagsDisabled:o,mentionsDisabled:a,onCopyFullCaption:r,onCopyText:l,onCopyHashtags:s,onCopyMentions:d,className:c})=>{let u=(0,_.md)(eS),p=[{id:"full-caption",mainText:"Copy Full Caption to clipboard",actionIcon:eo.xwQ,formatIcon:ea.qdk,disabled:t},{id:"text",mainText:"Copy Text to clipboard",actionIcon:eo.xwQ,formatIcon:ea.r$1,disabled:n},{id:"hashtags",mainText:"Copy Hashtags to Clipboard",actionIcon:eo.xwQ,formatIcon:ea.BDA,disabled:o},{id:"mentions",mainText:"Copy Mentions to Clipboard",actionIcon:eo.xwQ,formatIcon:ea.WB4,disabled:a}],m=p[u]??p[0];return(0,i.jsx)(J,{level:3,isDark:e,options:[m],selectedIndex:0,onSelectOption:()=>{},onMainClick:()=>(e=>{switch(e){case"full-caption":r();break;case"text":l();break;case"hashtags":s();break;case"mentions":d()}})(m.id),disabled:m.disabled,className:c})};function eT(e){return ey[e]??"full-caption"}function eD(e,t){switch(t){case"full-caption":return(0,em.MV)(e);case"text":return(0,em.Z4)(e);case"hashtags":return(0,em.Ft)(e);case"mentions":return(0,em.PB)(e)}}let eP=({isDark:e,title:t,fullCaptionDisabled:n,textDisabled:o,hashtagsDisabled:a,mentionsDisabled:r,onDownload:l,className:s})=>
8{let[d,c]=(0,_.fp)(eS),u=[{id:"full-caption",mainText:"Download Full Caption",formatSuffix:"TXT",actionIcon:Q.$TP,formatIcon:ea.qdk,disabled:n},{id:"text",mainText:"Download Text",formatSuffix:"TXT",actionIcon:Q.$TP,formatIcon:ea.r$1,disabled:o},{id:"hashtags",mainText:"Download Hashtags",formatSuffix:"TXT",actionIcon:Q.$TP,formatIcon:ea.BDA,disabled:a},{id:"mentions",mainText:"Download Mentions",formatSuffix:"TXT",actionIcon:Q.$TP,formatIcon:ea.WB4,disabled:r}],p=u[d],m=!!p?.disabled;return(0,i.jsx)(J,{level:1,isDark:e,options:u,selectedIndex:d,onSelectOption:c,onMainClick:()=>{let e;if(m)return;let n=eT(d);!function(e,t,n="text/plain"){let i=new Blob([e],{type:n}),o=URL.createObjectURL(i),a=document.createElement("a");a.href=o,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}(eD(t,n),(e=(0,em.iO)(t),`vidgap-${e}-${n}.txt`),"text/plain"),l?.()},disabled:m,className:s})},eI=({text:e,isEmpty:t,isDark:n,isLight:o})=>{let a={[eb().dark]:n,[eb().light]:o};return(0,i.jsx)("div",{className:L()(eb().captionPreviewStrip,a),"aria-live":"polite",children:t?(0,i.jsx)("p",{className:L()(eb().notFoundText,a),children:"Caption not found"}):(0,i.jsx)("ul",{className:eb().captionPreviewList,children:(0,i.jsx)("li",{className:eb().captionItem,children:(0,i.jsx)("span",{className:eb().text,children:e})})})})};var ej=n(15079),eN=n.n(ej);let eL=({title:e,username:t,profilePic:n,thumbnail:r,toastLang:l,timePosted:s,contentId:d,copyTxt:u,shareTxt:p,friendlyTimeTexts:m,handleAgain:h,handleRedownload:g,globalPreviewer:w})=>{let f=(0,c.usePathname)()||"/",v=f.split("/"),x=v[v.length-1]||"en",{toastHandlerCtx:b,toastCtx:y,showReviewBarHandlerCtx:S,showReviewBarCtx:k}=o.useContext(a.Ay),[,T]=(0,_.fp)(eS),D=(0,_.md)(eS),P=(0,V.j)(),I="dark"===P,N="light"===P,R={[j().dark]:I,[j().light]:N},$=(0,eh.c)(e),W=(0,eh.c)(t),H=(0,eh.c)(p)||C.i4,q=(0,eh.c)(u)||C.HK,z=(0,eh.c)(w?.navigation_texts?.back_text)||C.nI,Z=(0,eh.c)(w?.navigation_texts?.retry_text)||C.zX,K=(0,eh.c)(w?.navigation_texts?.view_text)||C.fT,X=o.useMemo(()=>eD($,eT(D)),[$,D]),[Y,J]=o.useState(null),[Q,ee]=o.useState(null),[et,en]=o.useState(!0),[ei,eo]=o.use
8State(!0);async function ea(){if(!n)return void ee("");try{let e=await er(n);ee(e??n)}catch(e){(0,G.SZ)("Error loading profile: ",e),ee(n)}}let er=async e=>{try{let t=(await F.A.get(e,{responseType:"blob"})).data;return("image/heic"===t.type||"image/heif"===t.type||e.toLowerCase().includes(".heic"))&&(t=await eN()({blob:t,toType:"image/jpeg",quality:1})),URL.createObjectURL(t)}catch(e){return(0,G.SZ)("Error loading thumbnail:",e),null}};async function el(){if(!r)return void J("");try{let e=await er(r);J(e??r)}catch(e){(0,G.SZ)("Error loading thumbnail:",e),J(r)}}o.useEffect(()=>{ea(),el()},[]),o.useEffect(()=>{let e=null!==Y;null!==Q&&e&&en(!1)},[Q,Y]),o.useEffect(()=>{if(!f.includes("/dl-hd")){let e=setTimeout(()=>{eo(!1)},2e3);return()=>clearTimeout(e)}eo(!1)},[f]);let es=et||ei;o.useEffect(()=>()=>T(0),[T]),o.useEffect(()=>{switch(y){case"COPIED":(0,O.oR)((0,eh.c)(l.urlcopied),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"info"});break;case"DOWNLOADED":(0,O.oR)((0,eh.c)(l.download?.success),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"success"});break;case"DOWNLOAD-SUSPENDED":(0,O.oR)((0,eh.c)(l.searchinterrupt?.ondownload),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"error"});break;case"SEARCH-SUSPENDED":(0,O.oR)((0,eh.c)(l.searchinterrupt?.onsearch),{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"error"})}},[y,l]);let ed=!!(0,em.Ft)($),ec=!!(0,em.PB)($),eu=!!$,ep=!!(0,em.Z4)($);return(0,i.jsxs)("div",{className:j().container,children:[!k&&!es&&(0,i.jsx)("div",{className:j().floatingReviewButtonPortalContainer,children:(0,i.jsx)(e_.A,{showReviewBarHandler:()=>S(!0)})}),(0,i.jsx)(A.default,{portalElementId:"toast-portal",children:(0,i.jsx)(O.ToastContainer,{position:"top-right",autoClose:3e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0,theme:"light"})}),es?(0,i.jsx)(M,{}):(0,i.jsxs)("div",{className:L()(j().previewer,R),style:{opacity:+!es},children:[(0,i.jsxs)("div",{className:L()(j().previewerContent,eb().previewerContentHead,R),children:[(0,i.jsxs)("div",{className:j().previewerContent_information,children:[(0,i.jsx)("div",{className:L()(eb().captionStripInContent,R),children:(0,i.jsx)(eI,{text:X,isEmpty:!eu,isDark:I,isLight:N})}),(0,i.jsxs)("div",{className:j().previewerContent_information_bottom,children:[(0,i.jsxs)("div",{className:j().previewerContent_information_profile,children:[n&&Q&&(0,i.jsx)("img",{src:Q,alt:"profile",className:j().previewerContent_information_profile_image}),(0,i.jsx)("p",{className:j().previewerContent_information_profile_name,children:W})]}),null!=s&&(0,i.jsx)("div",{className:j().previewerContent_information_timePosted,children:(0,U.F)(s,m??{},x)})]})]}),r&&Y&&(0,i.jsx)("div",{className:L()(j().previewerContent_figure,eb().contentFigure),children:(0,i.jsx)("img",{src:Y,alt:"thumbnail",className:L()(j().previewerContent_figure_image,R)})})]}),(0,i.jsxs)("div",{className:L()(j().previewer_controls,R),children:[(0,i.jsxs)("div",{className:j().previewerControlsGroup,children:[(0,i.jsx)("div",{className:j().previewerControlsTop,children:(0,i.jsx)("div",{className:eb().controlsTopInner,children:(0,i.jsx)(eP,{isDark:I,title:$,fullCaptionDisabled:!eu,textDisabled:!ep,hashtagsDisabled:!ed,mentionsDisabled:!ec,onDownload:()=>b("DOWNLOADED"),className:eb().formatDownloadWrap})})}),(0,i.jsx)("div",{className:j().previewerControlsMid,children:(0,i.jsx)(ek,{isDark:I,fullCaptionDisabled:!eu,textDisabled:!ep,hashtagsDisabled:!ed,mentionsDisabled:!ec,onCopyFullCaption:()=>{navigator.clipboard.writeText((0,em.MV)($)),b("COPIED")},onCopyText:()=>{navigator.clipboard.writeText((0,em.Z4)($)),b("COPIED")},onCopyHashtags:()=>{navigator.clipboard.writeText((0,em.Ft)($)),b("COPIED")},onCopyMentions:()=>{navigator.clipboard.writeText((0,em.PB)($)),b("COPIED")},className:eb().copyButtonWrap})}),(0,i.jsx)("div",{className:j().previewerControlsBottom,children:(0,i.jsx)(B.A,{contentId:d??"",findStatus:"FOUND",handleAgain:h,handleRedownload:g,againTxt:z,redownloadTxt:Z,viewTxt:K})})]}),d&&(0,i.jsx)(E.A,{copyTxt:q,shareTxt:H,contentVLink:d})]})]})]})};var eV=n(9339);let eA=(0,eV.createServerReference)("4072ddce3dbe202bf0775765ba1abc48b3d14d9a96",eV.callServer,void 0,eV.findSourceMapURL,"findSubtitleActionsQueue");var eO=n(72064),eB=n(12750),eE=n(92548),eU=n(60064),eF=n(66175),eR=n(33856),e$=n(18707),eM=n.n(e$);let eG=e=>{let{activeHighlightIdCtx:t}=o.useContext(a.Ay),{themeCtx:n}=o.useContext(V.A),r="dark"===(0,V.j)()||"dark"===n;return(0,i.jsx)("div",{className:L()(eM().tray,{[eM().dark]:r,[eM().light]:!r}),children:(0,i.jsx)("ul",{className:eM().list,role:"list",children:e.data.highlights.map(n=>{let o=t===n.contentId;return(0,i.jsx)("li",{className:eM().item,children:(0,i.jsxs)("button",{type:"button",className:L()(eM().button,{[eM().active]:o}),onClick:()=>e.onSelect(n.contentId),"aria-pressed":o,"aria-label":n.title||n.contentId,children:[(0,i.jsx)("span",{className:eM().ring,children:(0,i.jsx)("img",{src:n.thumbnail,alt:"",className:eM().cover})}),(0,i.jsx)("span",{className:eM().title,children:n.title||n.contentId}),n.videoCount>0&&(0,i.jsx)("span",{className:eM().count,children:`${n.videoCount} Stories`})]})},n.contentId)})})})};eG.displayName="HighlightTray";var eW=n(42793),eH=n.n(eW),eq=n(46368),ez=n.n(eq);let eZ=e=>{let{themeCtx:t}=o.useContext(V.A),{toastCtx:n}
8=o.useContext(a.Ay),r="dark"===(0,V.j)()||"dark"===t;e.data.username,o.useEffect(()=>{"COPIED"===n&&(0,O.oR)(e.toastLang.urlcopied,{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"info"})},[n,e.toastLang.urlcopied]);let l=e.globalPreviewer&&e.globalPreviewer.highlight_title?e.globalPreviewer.highlight_title.replace("{n}",e.data.highlights.length.toString()):C.Gs.replace("{n}",e.data.highlights.length.toString());return(0,i.jsxs)("div",{className:eH().container,children:[(0,i.jsxs)("div",{className:L()(eH().previewer,ez().picker),children:[(0,i.jsx)("div",{className:L()(eH().previewer_screen,ez().emptyStage,{[eH().dark]:r,[eH().light]:!r}),children:(0,i.jsxs)("div",{className:eH().info,children:[(0,i.jsx)("span",{className:eH().title,children:l}),(0,i.jsx)("div",{className:eH().infoBottom,children:(0,i.jsxs)("div",{className:eH().profile,children:[(0,i.jsx)(eo.Nt4,{className:L()(ez().highlightIcon,{[ez().dark]:r,[ez().light]:!r}),"aria-hidden":!0}),(0,i.jsxs)("span",{className:eH().username,children:["@",e.data.username]})]})})]})}),(0,i.jsx)("div",{className:L()(eH().previewer_controls,ez().traySlot,{[eH().dark]:r,[eH().light]:!r}),children:(0,i.jsxs)("div",{className:eH().previewerControlsGroup,children:[(0,i.jsx)(eG,{data:e.data,onSelect:e.onSelect}),(0,i.jsx)("div",{className:eH().previewerControlsBottom,children:(0,i.jsx)(B.A,{findStatus:e.findStatus,contentId:e.data.username,handleAgain:e.handleAgain,handleRedownload:e.handleRedownload,hideViewBtn:!0,againTxt:e.againTxt,redownloadTxt:e.redownloadTxt,viewTxt:e.viewTxt})})]})})]}),(0,i.jsx)(A.default,{portalElementId:"toast-portal",children:(0,i.jsx)(O.ToastContainer,{position:"top-right",autoClose:3e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0,theme:"light"})})]})};eZ.displayName="HighlightPickerCard";var eK=n(20980),eX=n.n(eK);let eY=(0,r.default)(()=>Promise.all([n.e(4941),n.e(8598),n.e(2064),n.e(6862),n.e(378),n.e(1697),n.e(9832)]).then(n.bind(n,79832)),{loadableGenerated:{webpack:()=>[79832]},ssr:!1,loading:()=>null}),eJ=e=>{let{userHighlightDataCtx:t,highlightContentDataCtx:n,activeHighlightIdCtx:r}=o.useContext(a.Ay),l=r?n[r]:void 0,s=t?.highlights.find(e=>String(e.contentId)===String(r)),d=Number(s?.videoCount)||0,c=!!l&&"FOUND"===e.findStatus&&(l.contents?.length??0)>0,u=l?.username??t?.username??"";return(o.useEffect(()=>{if(!c||!l||!r)return;let e=!1,t=s?.thumbnail||l.thumbnail||"";if(t)return(async()=>{try{let n=await F.A.get(t,{responseType:"blob"});if(e)return;await (0,eF.fs)({id:r,inputUrl:u?`@${u}`:l.inputUrl||"",title:s?.title||r,date:new Date,expiry:new Date(Date.now()+6048e5),blobThumbnail:n.data,contentId:r,data_type:"highlight",highlightId:r})}catch(e){console.error("Failed to store highlight history:",e)}})(),()=>{e=!0}},[c,r]),c&&l&&r)?(0,i.jsx)("div",{className:eX().highlightPreview,children:(0,i.jsx)(eY,{findStatus:e.findStatus,profilePic:l.profilePic??"",thumbnail:s?.thumbnail||l.thumbnail||"",title:s?.title||r,username:u,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:(l.contents??[]).map(e=>e.thumbnail),contentKey:(0,eR.v$)(u,r),inputUrl:l.inputUrl||t?.inputUrl||(u?`@${u}`:""),previewerDicts:e.previewerDicts,toastLang:e.toastLang,contentId:r,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:t=>e.handleFindVideo(t),handleAgain:e.downloadAgain,handleRedownload:()=>e.handleFindVideo(l.inputUrl||t?.inputUrl||(u?`@${u}`:"")),globalPreviewer:e.globalPreviewer,contents:l.contents??[],timePosted:l.timePosted,onHighlightLoadMore:e.onHighlightLoadMore,highlightTotalCount:d})}):t?(0,i.jsx)("div",{className:eX().highlightPreview,children:(0,i.jsx)(eZ,{data:t,onSelect:t=>e.onSelectHighlight?.(t),findStatus:e.findStatus,handleAgain:e.downloadAgain,handleRedownload:()=>e.handleFindVideo(t.inputUrl||`@${t.username}`),againTxt:e.globalPreviewer?.navigation_texts.back_text,redownloadTxt:e.globalPreviewer?.navigation_texts.retry_text,viewTxt:e.globalPreviewer?.navigation_texts.view_text,shareTxt:e.postDownload.share,copyTxt:e.postDownload.share,toastLang:e.toastLang,globalPreviewer:e.globalPreviewer})}):(0,i.jsx)(i.Fragment,{})};eJ.displayName="PreviewHighlight";var eQ=n(93220),e0=n(80835),e1=n.n(e0);let e3=e=>{let{activePlaylistIdCtx:t}=o.useContext(a.Ay),{themeCtx:n}=o.useContext(V.A),r="dark"===(0,V.j)()||"dark"===n;return(0,i.jsx)("div",{className:L()(e1().tray,{[e1().dark]:r,[e1().light]:!r}),children:(0,i.jsx)("ul",{className:e1().list,role:"list",children:e.data.playlists.map(n=>{let o=t===n.contentId;return(0,i.jsx)("li",{className:e1().item,children:(0,i.jsxs)("button",{type:"button",className:L()(e1().button,{[e1().active]:o}),onClick:()=>e.onSelect(n.contentId),"aria-pressed":o,"aria-label":n.title||n.contentId,children:[(0,i.jsx)("span",{className:e1().ring,children:(0,i.jsx)("span",{className:e1().coverIconWrap,children:(0,i.jsx)(eo.MPv,{className:e1().coverIcon,"aria-hidden":!0})})}),(0,i.jsx)("span",{className:e1().title,children:n.title||n.contentId}),n.videoCount>0&&(0,i.jsx)("span",{className:e1().count,children:`${n.videoCount} Videos`})]})},n.contentId)})})})};e3.displayName="PlaylistTray";var e2=n(7646),e5=n.n(e2);let e4=e=>{let{themeCtx:t}=o.useContext(V.A),{toastCtx:n}
8=o.useContext(a.Ay),r="dark"===(0,V.j)()||"dark"===t;o.useEffect(()=>{"COPIED"===n&&(0,O.oR)(e.toastLang.urlcopied,{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"info"})},[n,e.toastLang.urlcopied]);let l=e.globalPreviewer?.playlist_title?e.globalPreviewer.playlist_title.replace("{n}",e.data.playlists.length.toString()):C.yW.replace("{n}",e.data.playlists.length.toString());return(0,i.jsxs)("div",{className:eH().container,children:[(0,i.jsxs)("div",{className:L()(eH().previewer,e5().picker),children:[(0,i.jsx)("div",{className:L()(eH().previewer_screen,e5().emptyStage,{[eH().dark]:r,[eH().light]:!r}),children:(0,i.jsxs)("div",{className:eH().info,children:[(0,i.jsx)("span",{className:eH().title,children:l}),(0,i.jsx)("div",{className:eH().infoBottom,children:(0,i.jsxs)("div",{className:eH().profile,children:[(0,i.jsx)(eo.MPv,{className:L()(e5().playlistIcon,{[e5().dark]:r,[e5().light]:!r}),"aria-hidden":!0}),(0,i.jsxs)("span",{className:eH().username,children:["@",e.data.username]})]})})]})}),(0,i.jsx)("div",{className:L()(eH().previewer_controls,e5().traySlot,{[eH().dark]:r,[eH().light]:!r}),children:(0,i.jsxs)("div",{className:eH().previewerControlsGroup,children:[(0,i.jsx)(e3,{data:e.data,onSelect:e.onSelect}),(0,i.jsx)("div",{className:eH().previewerControlsBottom,children:(0,i.jsx)(B.A,{findStatus:e.findStatus,contentId:e.data.username,handleAgain:e.handleAgain,handleRedownload:e.handleRedownload,hideViewBtn:!0,againTxt:e.againTxt,redownloadTxt:e.redownloadTxt,viewTxt:e.viewTxt})})]})})]}),(0,i.jsx)(A.default,{portalElementId:"toast-portal",children:(0,i.jsx)(O.ToastContainer,{position:"top-right",autoClose:3e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0,theme:"light"})})]})};e4.displayName="PlaylistPickerCard";var e9=n(65286),e6=n.n(e9);let e8=(0,r.default)(()=>Promise.all([n.e(4941),n.e(8598),n.e(2064),n.e(6862),n.e(378),n.e(1697),n.e(9614)]).then(n.bind(n,69614)),{loadableGenerated:{webpack:()=>[69614]},ssr:!1,loading:()=>null}),e7=e=>{let{userPlaylistDataCtx:t,playlistContentDataCtx:n,activePlaylistIdCtx:r}=o.useContext(a.Ay),l=r?n[r]:void 0,s=t?.playlists.find(e=>String(e.contentId)===String(r)),d=Number(s?.videoCount)||0,c=!!l&&"FOUND"===e.findStatus&&(l.contents?.length??0)>0,u=l?.username??t?.username??"";return(o.useEffect(()=>{if(!c||!l||!r)return;let e=!1,t=s?.thumbnail||l.thumbnail||"";if(t)return(async()=>{try{let n=await F.A.get(t,{responseType:"blob"});if(e)return;await (0,eF.fs)({id:r,inputUrl:u?`@${u}`:l.inputUrl||"",title:s?.title||r,date:new Date,expiry:new Date(Date.now()+6048e5),blobThumbnail:n.data,contentId:r,data_type:"playlist",playlistId:r})}catch(e){console.error("Failed to store playlist history:",e)}})(),()=>{e=!0}},[c,r]),c&&l&&r)?(0,i.jsx)("div",{className:e6().playlistPreview,children:(0,i.jsx)(e8,{findStatus:e.findStatus,profilePic:l.profilePic??"",thumbnail:s?.thumbnail||l.thumbnail||"",title:s?.title||r,username:u,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:(l.contents??[]).map(e=>e.thumbnail),contentKey:(0,eQ.VI)(u,r),inputUrl:l.inputUrl||t?.inputUrl||(u?`@${u}`:""),previewerDicts:e.previewerDicts,toastLang:e.toastLang,contentId:r,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:t=>e.handleFindVideo(t),handleAgain:e.downloadAgain,handleRedownload:()=>e.handleFindVideo(l.inputUrl||t?.inputUrl||(u?`@${u}`:"")),globalPreviewer:e.globalPreviewer,contents:l.contents??[],timePosted:l.timePosted,onPlaylistLoadMore:e.onPlaylistLoadMore,playlistTotalCount:d})}):t?(0,i.jsx)("div",{className:e6().playlistPreview,children:(0,i.jsx)(e4,{data:t,onSelect:t=>e.onSelectPlaylist?.(t),findStatus:e.findStatus,handleAgain:e.downloadAgain,handleRedownload:()=>e.handleFindVideo(t.inputUrl||`@${t.username}`),againTxt:e.globalPreviewer?.navigation_texts.back_text,redownloadTxt:e.globalPreviewer?.navigation_texts.retry_text,viewTxt:e.globalPreviewer?.navigation_texts.view_text,shareTxt:e.postDownload.share,copyTxt:e.postDownload.share,toastLang:e.toastLang,globalPreviewer:e.globalPreviewer})}):(0,i.jsx)(i.Fragment,{})};e7.displayName="PreviewPlaylist";var te=n(45426),tt=n(36959),tn=n(49179),ti=n.n(tn);let to=e=>{let{activeCollectionIdCtx:t}=o.useContext(a.Ay),{themeCtx:n}=o.useContext(V.A),r="dark"===(0,V.j)()||"dark"===n;return(0,i.jsx)("div",{className:L()(ti().tray,{[ti().dark]:r,[ti().light]:!r}),children:(0,i.jsx)("ul",{className:ti().list,role:"list",children:e.data.collections.map(n=>{let o=t===n.contentId;return(0,i.jsx)("li",{className:ti().item,children:(0,i.jsxs)("button",{type:"button",className:L()(ti().button,{[ti().active]:o}),onClick:()=>e.onSelect(n.contentId),"aria-pressed":o,"aria-label":n.title||n.contentId,children:[(0,i.jsx)("span",{className:ti().ring,children:(0,i.jsx)("span",{className:ti().coverIconWrap,children:(0,i.jsx)(tt.Abq,{className:ti().coverIcon,"aria-hidden":!0})})}),(0,i.jsx)("span",{className:ti().title,children:n.title||n.contentId}),n.videoCount>0&&(0,i.jsx)("span",{className:ti().count,children:`${n.videoCount} Videos`})]})},n.contentId)})})})};to.displayName="CollectionTray";var ta=n(96694),tr=n.n(ta);let tl=e=>{let{themeCtx:t}=o.useContext(V.A),{toastCtx:n}
8=o.useContext(a.Ay),r="dark"===(0,V.j)()||"dark"===t;o.useEffect(()=>{"COPIED"===n&&(0,O.oR)(e.toastLang.urlcopied,{position:"top-right",autoClose:3e3,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",type:"info"})},[n,e.toastLang.urlcopied]);let l=e.globalPreviewer?.collection_title?e.globalPreviewer.collection_title.replace("{n}",e.data.collections.length.toString()):C.UO.replace("{n}",e.data.collections.length.toString());return(0,i.jsxs)("div",{className:eH().container,children:[(0,i.jsxs)("div",{className:L()(eH().previewer,tr().picker),children:[(0,i.jsx)("div",{className:L()(eH().previewer_screen,tr().emptyStage,{[eH().dark]:r,[eH().light]:!r}),children:(0,i.jsxs)("div",{className:eH().info,children:[(0,i.jsx)("span",{className:eH().title,children:l}),(0,i.jsx)("div",{className:eH().infoBottom,children:(0,i.jsxs)("div",{className:eH().profile,children:[(0,i.jsx)(tt.Abq,{className:L()(tr().collectionIcon,{[tr().dark]:r,[tr().light]:!r}),"aria-hidden":!0}),(0,i.jsxs)("span",{className:eH().username,children:["@",e.data.username]})]})})]})}),(0,i.jsx)("div",{className:L()(eH().previewer_controls,tr().traySlot,{[eH().dark]:r,[eH().light]:!r}),children:(0,i.jsxs)("div",{className:eH().previewerControlsGroup,children:[(0,i.jsx)(to,{data:e.data,onSelect:e.onSelect}),(0,i.jsx)("div",{className:eH().previewerControlsBottom,children:(0,i.jsx)(B.A,{findStatus:e.findStatus,contentId:e.data.username,handleAgain:e.handleAgain,handleRedownload:e.handleRedownload,hideViewBtn:!0,againTxt:e.againTxt,redownloadTxt:e.redownloadTxt,viewTxt:e.viewTxt})})]})})]}),(0,i.jsx)(A.default,{portalElementId:"toast-portal",children:(0,i.jsx)(O.ToastContainer,{position:"top-right",autoClose:3e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0,theme:"light"})})]})};tl.displayName="CollectionPickerCard";var ts=n(4190),td=n.n(ts);let tc=(0,r.default)(()=>Promise.all([n.e(4941),n.e(8598),n.e(2064),n.e(6862),n.e(378),n.e(1697),n.e(6966)]).then(n.bind(n,76966)),{loadableGenerated:{webpack:()=>[76966]},ssr:!1,loading:()=>null}),tu=e=>{let{userCollectionDataCtx:t,collectionContentDataCtx:n,activeCollectionIdCtx:r}=o.useContext(a.Ay),l=r?n[r]:void 0,s=t?.collections.find(e=>String(e.contentId)===String(r)),d=Number(s?.videoCount)||0,c=!!l&&"FOUND"===e.findStatus&&(l.contents?.length??0)>0,u=l?.username??t?.username??"";return(o.useEffect(()=>{if(!c||!l||!r)return;let e=!1,t=s?.thumbnail||l.thumbnail||"";if(t)return(async()=>{try{let n=await F.A.get(t,{responseType:"blob"});if(e)return;await (0,eF.fs)({id:r,inputUrl:u?`@${u}`:l.inputUrl||"",title:s?.title||r,date:new Date,expiry:new Date(Date.now()+6048e5),blobThumbnail:n.data,contentId:r,data_type:"collection",collectionId:r})}catch(e){console.error("Failed to store collection history:",e)}})(),()=>{e=!0}},[c,r]),c&&l&&r)?(0,i.jsx)("div",{className:td().collectionPreview,children:(0,i.jsx)(tc,{findStatus:e.findStatus,profilePic:l.profilePic??"",thumbnail:s?.thumbnail||l.thumbnail||"",title:s?.title||r,username:u,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:(l.contents??[]).map(e=>e.thumbnail),contentKey:(0,te.JD)(u,r),inputUrl:l.inputUrl||t?.inputUrl||(u?`@${u}`:""),previewerDicts:e.previewerDicts,toastLang:e.toastLang,contentId:r,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:t=>e.handleFindVideo(t),handleAgain:e.downloadAgain,handleRedownload:()=>e.handleFindVideo(l.inputUrl||t?.inputUrl||(u?`@${u}`:"")),globalPreviewer:e.globalPreviewer,contents:l.contents??[],timePosted:l.timePosted,onCollectionLoadMore:e.onCollectionLoadMore,collectionTotalCount:d})}):t?(0,i.jsx)("div",{className:td().collectionPreview,children:(0,i.jsx)(tl,{data:t,onSelect:t=>e.onSelectCollection?.(t),findStatus:e.findStatus,handleAgain:e.downloadAgain,handleRedownload:()=>e.handleFindVideo(t.inputUrl||`@${t.username}`),againTxt:e.globalPreviewer?.navigation_texts.back_text,redownloadTxt:e.globalPreviewer?.navigation_texts.retry_text,viewTxt:e.globalPreviewer?.navigation_texts.view_text,shareTxt:e.postDownload.share,copyTxt:e.postDownload.share,toastLang:e.toastLang,globalPreviewer:e.globalPreviewer})}):(0,i.jsx)(i.Fragment,{})};tu.displayName="PreviewCollection";let tp=(0,r.default)(()=>Promise.all([n.e(4941),n.e(8598),n.e(2064),n.e(6862),n.e(378),n.e(1697),n.e(5159)]).then(n.bind(n,45159)),{loadableGenerated:{webpack:()=>[45159]},ssr:!1,loading:()=>(0,i.jsx)(u.A,{})}),t_=(0,r.default)(()=>Promise.all([n.e(4941),n.e(7864),n.e(2536)]).then(n.bind(n,85942)),{loadableGenerated:{webpack:()=>[85942]},ssr:!1,loading:()=>null}),tm=(0,r.default)(()=>Promise.all([n.e(4941),n.e(8598),n.e(2064),n.e(6862),n.e(378),n.e(7864),n.e(8746)]).then(n.bind(n,68746)),{loadableGenerated:{webpack:()=>[68746]},ssr:!1,loading:()=>null}),th=(0,r.default)(()=>Promise.all([n.e(4941),n.e(8598),n.e(2064),n.e(6862),n.e(6848),n.e(1621)]).then(n.bind(n,41621)),{loadableGenerated:{webpack:()=>[41621]},ssr:!1,loading:()=>null}),tg=(0,r.default)(()=>Promise.all([n.e(4941),n.e(8598),n.e(2064),n.e(6862),n.e(6848),n.e(7292)]).then(n.bind(n,97292)),{loadableGenerated:{webpack:()=>[97292]},ssr:!1,loading:()=>null}),tw=(0,r.default)(()=>Promise.all([n.e(4941),n.e(8598),n.e(2064),n.e(6862),n.e(378),n.e(1697),n.e(9222)]).then(n.bind(n,59222)),{loadableGenerated:{webpack:()=>[59222]}
8,ssr:!1}),tf=e=>{(0,c.useRouter)();let t=(0,c.usePathname)()||"/",n=(0,_.md)(m.B),r=(0,_.Xr)(m.B),D=(0,_.md)(h.S),{showReviewBarHandlerCtx:P,showReplyBtnHandlerCtx:I,addSessionUsedFeatureCtx:j,videoDataCtx:N,videoDataHandlerCtx:L,subtitleDataCtx:V,subtitleDataHandlerCtx:A,downloadStatusHandlerCtx:O,setAmplificationProgressCtx:B,progressBarUIOnlyHandlerCtx:E,sessionIdHandlerCtx:U,userHighlightDataCtx:F,highlightContentDataCtx:R,highlightContentDataHandlerCtx:$,activeHighlightIdCtx:M,userPlaylistDataCtx:W,playlistContentDataCtx:H,playlistContentDataHandlerCtx:q,activePlaylistIdCtx:z,userCollectionDataCtx:Z,collectionContentDataCtx:K,collectionContentDataHandlerCtx:X,activeCollectionIdCtx:Y}=o.useContext(a.Ay),{socket:J}=(0,g.FO)({url:"https://socket.vidgap.com",autoConnect:!1}),Q=o.useRef(null),[ee,et]=o.useState("idle"),en=o.useRef(null),[ei,eo]=o.useState("idle"),ea=o.useRef(null);o.useEffect(()=>{J&&(Q.current=J)},[J]),o.useEffect(()=>{N&&!t.includes("/download-hd")&&!t.includes("/dl-hd")&&!t.includes("/dl-slideshow")&&!t.includes("/dl-audio-music")&&(0,y.j)(N.data_type,N.inputUrl,C.eq[n??e.tab])&&e.handleFindStatus("FOUND")},[]);let er=async()=>{if(!(t.includes("/download-hd")||t.includes("/dl-hd")||t.includes("/dl-slideshow")||t.includes("/dl-audio-music")))try{if(N?.data_type==="profile"&&N.username){let e=(0,b.u)(N.username);await (0,f.z)(e),await (0,v.L)(e)}else N?.contentId&&(N.data_type,await (0,f.z)(N.contentId),await (0,v.L)(N.contentId))}catch(e){(0,G.SZ)("Failed to update download/session tokens:",e)}};o.useEffect(()=>{er()},[N?.contentId,N?.username,N?.data_type]),o.useEffect(()=>{(t.includes("/download-hd")||t.includes("/dl-hd")||t.includes("/dl-slideshow")||t.includes("/dl-audio-music"))&&E(!1)},[]);let el=o.useCallback(async(e,t)=>{if(!e)return O("FAILED"),{status:"no-session-id",initiateRetry:!1};let n=J||Q.current;return n?(n.connected&&(n.removeAllListeners(),n.disconnect(),await new Promise(e=>setTimeout(e,100))),new Promise(t=>{let i=()=>{n.removeAllListeners("authenticate"),n.removeAllListeners("retrieve-data"),n.removeAllListeners("error"),n.removeAllListeners("queue-limit-exceeded"),clearTimeout(a),clearInterval(o)};n.connect(),U(e);let o=setInterval(()=>{let e=Math.floor(2*Math.random())+1;B(t=>t>=30?t:t+e)},1e3),a=setTimeout(()=>{i(),n.disconnect(),O("FAILED"),t({status:"socket-timeout",initiateRetry:!1})},C.ne);n.emit("authenticate",e),n.once("authenticate",e=>{"success"===e.status||(i(),n.disconnect(),t({status:"auth-failed",initiateRetry:!1}))}),n.once("retrieve-data",e=>{i(),n.disconnect(),t({status:"found",initiateRetry:!1}),n.once("error",e=>{(0,G.gg)("socket error: ",e),O("FAILED"),i(),n.disconnect(),t({status:"socket-error",initiateRetry:!1}),n.once("queue-limit-exceeded",e=>{(0,G.gg)("queue-limit-exceeded: ",e),O("FAILED"),i(),n.disconnect(),t({status:"queue-limit-exceeded",initiateRetry:!1})}),n.once("connect_error",e=>{(0,G.gg)("connect_error: ",e),i(),n.disconnect(),t({status:"connect-error",initiateRetry:!1})})})})})):(O("FAILED"),{status:"socket-not-ready",initiateRetry:!1})},[J,Q,O,B,U]),es=o.useCallback(e=>{A(e),et((0,T.a0)(e)?"found":"not-found")},[A]),ed=o.useCallback(async e=>{let t=J||Q.current;return e&&t?(t.connected&&(t.removeAllListeners(),t.disconnect(),await new Promise(e=>setTimeout(e,100))),new Promise(n=>{let i=()=>{t.removeAllListeners("authenticate"),t.removeAllListeners("retrieve-data"),t.removeAllListeners("error"),t.removeAllListeners("queue-limit-exceeded"),t.removeAllListeners("connect_error"),clearTimeout(o)};t.connect(),U(e);let o=setTimeout(()=>{i(),t.disconnect(),n({status:"socket-timeout"})},C.DQ);t.emit("authenticate",e),t.once("authenticate",e=>{"success"!==e.status&&(i(),t.disconnect(),n({status:"auth-failed"}))}),t.once("retrieve-data",e=>{i(),t.disconnect();try{let t=JSON.parse(e),i=t?.data;if(i?.subtitleData){es(i.subtitleData),n({status:"found"});return}if(i?.subtitle!==void 0){es({video_id:i.video_id??i.contentId??"",subtitle:i.subtitle??"",tracks:i.tracks}),n({status:"found"});return}n({status:"not-found"})}catch(e){(0,G.SZ)("connectQueueSocketSubtitle parse error:",e),n({status:"error"})}}),t.once("error",()=>{i(),t.disconnect(),n({status:"socket-error"})}),t.once("queue-limit-exceeded",()=>{i(),t.disconnect(),n({status:"queue-limit-exceeded"})}),t.once("connect_error",()=>{i(),t.disconnect(),n({status:"connect-error"})})})):{status:"socket-not-ready"}},[J,U,es]),ec=o.useCallback(async(e,t)=>{en.current=e,et("loading");let n=window.matchMedia("(display-mode: standalone)").matches?"PWA":"Web";try{let i=await eA({vLink:t,agent:n,contentId:e});if(i.rateLimited||i.blocked)return void es({video_id:e,subtitle:""});if(i.subtitleData)return void es(i.subtitleData);if(i.sessionId){let t=0;for(;!J&&!Q.current&&t<5e3;)await new Promise(e=>setTimeout(e,100)),t+=100;let n=await ed(i.sessionId);"found"!==n.status&&es({video_id:e,subtitle:""});return}es({video_id:e,subtitle:""})}catch(t){(0,G.SZ)("fetchSubtitleLazy error:",t),es({video_id:e,subtitle:""})}},[J,ed,es]),eu=o.useCallback(e=>{if(e?.data_type==="profile"&&e.username){L(e),eo("found");return}eo("not-found")},[L]),ep=o.useCallback(async e=>{let t=J||Q.current;return e&&t?(t.connected&&(t.removeAllListeners(),t.disconnect(),await new Promise(e=>setTimeout(e,100))),new Promise(n=>{let i=()=>{t.removeAllListeners("authenticate"),t.removeAllListeners("retrieve-data"),t.removeAllListeners("error"),t.removeAllListeners("queue-limit-exceeded"),t.removeAllListeners("connect_error"),clearTimeout(o)};t.connect(),U(e);let o=setTimeout(()=>{i(),t.disconnect(),n({status:"socket-timeout"})},C.ne);t.emit("authenticate",e),t.once("authenticate",e=>{"success"!==e.status&&(i(),t.disconnect(),n({status:"auth-failed"}))}),t.once("retrieve-data",e=>{i(),t.disconnect();try{let t=JSON.parse(e),i=t?.data;if(i?.data_type==="profile"&&i.username){eu(i),n({status:"found"});return}n({status:"not-found"})}catch(e){(0,G.SZ)("connectQueueSocketProfile parse error:",e),n({status:"error"})}}),t.once("error",()=>{i(),t.disconnect(),n({status:"socket-error"})}),t.once("queue-limit-exceeded",()=>{i(),t.disconnect(),n({status:"queue-limit-exceeded"})}),t.once("connect_error",()=>{i(),t.disconnect(),n({status:"connect-error"})})})):{status:"socket-not-ready"}},[J,U,eu]),e_=o.useCallback(async e=>{ea.current=e,eo("loading");let t=window.matchMedia("(display-mode: standalone)").matches?"PWA":"Web",n=e.replace(/^@/,""),i=(0,S.b)(n)||`@${n}`;try{let e=await (0,x.t)({vLink:i,agent:t,tab:"profile"});if(e?.rateLimited||e?.blocked)return void eu(null);if(e?.data_type==="profile"&&e.username)return void eu(e);if(e?.sessionId){let t=0;for(;!J&&!Q.current&&t<5e3;)await new Promise(e=>setTimeout(e,100)),t+=100;let n=await ep(e.sessionId);"found"!==n.status&&eu(null);return}eu(null)}catch(e){(0,G.SZ)("fetchProfileLazy error:",e),eu(null)}},[J,ep,eu]);o.useEffect(()=>{et("idle"),en.current=null},[N?.contentId]),o.useEffect(()=>{eo("idle"),ea.current=null},[F?.username,W?.username]),o.useEffect(()=>{7===n&&"FOUND"===e.findStatus&&N?.contentId&&!V&&"idle"===ee&&en.current!==N.contentId&&ec(N.contentId,D)},[n,e.findStatus,N,V,ee,D,ec]),o.useEffect(()=>{let t=F?.username||W?.username||Z?.username,i=!!t&&N?.data_type!=="profile"&&(!N||"highlight"===N.data_type||"playlist"===N.data_type||"collection"===N.data_type);6===n&&"FOUND"===e.findStatus&&i&&"idle"===ei&&ea.current!==t&&e_(t)},[n,e.findStatus,F?.username,W?.username,Z?.username,N,ei,e_]);let em=async(e,t)=>{let n=0;for((0,G.gg)("Waiting for socket to be initialized...");!J&&!Q.current&&n<5e3;)await new Promise(e=>setTimeout(e,100)),n+=100;if(!(J||Q.current)){console.error("Socket not initialized after waiting "+n+"ms, aborting HD amplification"),O("FAILED");return}(0,G.gg)("Socket is ready, proceeding with HD amplification");let i=(0,w.f)(e),o=window.matchMedia("(display-mode: standalone)").matches?"PWA":"Web",a=await (0,x.t)({vLink:i,agent:o,tab:t,amplifiedHD:!0});if(a&&a.sessionId){let e=await el(a.sessionId,0);if((0,G.gg)("connectQueueSocketAmplificationHDResult: ",e),e&&"found"===e.status)return;return void O("FAILED")}},eh=async(e,t)=>{let n=0;for((0,G.gg)("Waiting for socket (amplification)...");!J&&!Q.current&&n<5e3;)await new Promise(e=>setTimeout(e,100)),n+=100;if(!(J||Q.current)){console.error("Socket not initialized after waiting "+n+"ms, aborting amplification"),O("FAILED");return}(0,G.gg)("Socket is ready, proceeding with amplification");let i=(0,w.f)(e),o=window.matchMedia("(display-mode: standalone)").matches?"PWA":"Web",a=await (0,x.t)({vLink:i,agent:o,tab:t,amplified:!0});if(a&&a.sessionId){let e=await el(a.sessionId,0);if(e&&"found"===e.status)return;return void O("FAILED")}},[eg,ew]=o.useState(!1),ef=o.useCallback(async e=>{let t=J||Q.current;return e&&t?(t.connected&&(t.removeAllListeners(),t.disconnect(),await new Promise(e=>setTimeout(e,100))),new Promise(n=>{let i=()=>{t.removeAllListeners("authenticate"),t.removeAllListeners("retrieve-data"),t.removeAllListeners("error"),t.removeAllListeners("queue-limit-exceeded"),t.removeAllListeners("connect_error"),clearTimeout(o)};t.connect(),U(e);let o=setTimeout(()=>{i(),t.disconnect(),n({status:"socket-timeout"})},C.ne);t.emit("authenticate",e),t.once("authenticate",e=>{"success"!==e.status&&(i(),t.disconnect(),n({status:"auth-failed"}))}),t.once("retrieve-data",e=>{i(),t.disconnect();try{let t=JSON.parse(e),i=t?.data;
8if(i?.data_type==="highlight"&&Array.isArray(i.contents)&&i.contents.length>0)return void n({status:"found",data:i});n({status:"not-found"})}catch(e){(0,G.SZ)("highlight load more parse error:",e),n({status:"error"})}}),t.once("error",()=>{i(),t.disconnect(),n({status:"socket-error"})}),t.once("queue-limit-exceeded",()=>{i(),t.disconnect(),n({status:"queue-limit-exceeded"})}),t.once("connect_error",()=>{i(),t.disconnect(),n({status:"connect-error"})})})):{status:"socket-not-ready"}},[J,Q,U]),ex=o.useCallback(async()=>{if(!M)return;let t=R[M],n=t?.contents?.length??0;if(n<=0)return;let i=n-1;sessionStorage.setItem("hdHighlightIndex",(n+1).toString()),ew(!0),e.handleFindStatus("SEARCHING");let o=window.matchMedia("(display-mode: standalone)").matches?"PWA":"Web",a=()=>{sessionStorage.setItem("hdHighlightIndex",(i+1).toString()),ew(!1),e.handleFindStatus("FOUND")};try{let i=0;for(;!J&&!Q.current&&i<5e3;)await new Promise(e=>setTimeout(e,100)),i+=100;let r=await (0,x.t)({vLink:M,agent:o,tab:"highlight",amplified:!0,highlightCursor:n});if(!r?.sessionId)return void a();let l=await ef(r.sessionId);if("found"!==l.status||!l.data)return void a();let s=function(e,t){if(!e?.contents?.length)return t;let n=new Set(e.contents.map(e=>e.contentId).filter(e=>!!e)),i=(t.contents??[]).filter(e=>{let t=e.contentId;return!(!t||n.has(t))&&(n.add(t),!0)}),o=[...e.contents,...i];return{...e,...t,contents:o,videoCount:o.length,data_type:"highlight"}}(t,l.data);$(e=>({...e,[M]:s})),M&&await (0,v.L)(M),sessionStorage.setItem("hdHighlightIndex",(n+1).toString()),ew(!1),e.handleFindStatus("FOUND")}catch(e){(0,G.SZ)("handleHighlightLoadMore failed:",e),a()}},[M,R,$,J,Q,ef,e]),[eb,eC]=o.useState(!1),[ey,eS]=o.useState(!1),[ek,eT]=o.useState(!1),eD=o.useCallback(async e=>{let t=J||Q.current;return e&&t?(t.connected&&(t.removeAllListeners(),t.disconnect(),await new Promise(e=>setTimeout(e,100))),new Promise(n=>{let i=()=>{t.removeAllListeners("authenticate"),t.removeAllListeners("retrieve-data"),t.removeAllListeners("error"),t.removeAllListeners("queue-limit-exceeded"),t.removeAllListeners("connect_error"),clearTimeout(o)};t.connect(),U(e);let o=setTimeout(()=>{i(),t.disconnect(),n({status:"socket-timeout"})},C.ne);t.emit("authenticate",e),t.once("authenticate",e=>{"success"!==e.status&&(i(),t.disconnect(),n({status:"auth-failed"}))}),t.once("retrieve-data",e=>{i(),t.disconnect();try{let t=JSON.parse(e),i=t?.data;
8if(i?.data_type==="playlist"&&Array.isArray(i.contents)&&i.contents.length>0)return void n({status:"found",data:i});n({status:"not-found"})}catch(e){(0,G.SZ)("playlist load more parse error:",e),n({status:"error"})}}),t.once("error",()=>{i(),t.disconnect(),n({status:"socket-error"})}),t.once("queue-limit-exceeded",()=>{i(),t.disconnect(),n({status:"queue-limit-exceeded"})}),t.once("connect_error",()=>{i(),t.disconnect(),n({status:"connect-error"})})})):{status:"socket-not-ready"}},[J,Q,U]),eP=o.useCallback(async()=>{if(!z)return;let t=H[z],n=t?.contents?.length??0;if(n<=0)return;let i=n-1;sessionStorage.setItem("hdPlaylistIndex",(n+1).toString()),eS(!0),e.handleFindStatus("SEARCHING");let o=window.matchMedia("(display-mode: standalone)").matches?"PWA":"Web",a=()=>{sessionStorage.setItem("hdPlaylistIndex",(i+1).toString()),eS(!1),e.handleFindStatus("FOUND")};try{let i=0;for(;!J&&!Q.current&&i<5e3;)await new Promise(e=>setTimeout(e,100)),i+=100;let r=await (0,x.t)({vLink:z,agent:o,tab:"playlist",amplified:!0,highlightCursor:n});if(!r?.sessionId)return void a();let l=await eD(r.sessionId);if("found"!==l.status||!l.data)return void a();let s=function(e,t){if(!e?.contents?.length)return t;let n=new Set(e.contents.map(e=>e.contentId).filter(e=>!!e)),i=(t.contents??[]).filter(e=>{let t=e.contentId;return!(!t||n.has(t))&&(n.add(t),!0)}),o=[...e.contents,...i];return{...e,...t,contents:o,videoCount:o.length,data_type:"playlist"}}(t,l.data);q(e=>({...e,[z]:s})),z&&await (0,v.L)(z),sessionStorage.setItem("hdPlaylistIndex",(n+1).toString()),eS(!1),e.handleFindStatus("FOUND")}catch(e){(0,G.SZ)("handlePlaylistLoadMore failed:",e),a()}},[z,H,q,J,Q,eD,e]),eI=o.useCallback(async e=>{let t=J||Q.current;return e&&t?(t.connected&&(t.removeAllListeners(),t.disconnect(),await new Promise(e=>setTimeout(e,100))),new Promise(n=>{let i=()=>{t.removeAllListeners("authenticate"),t.removeAllListeners("retrieve-data"),t.removeAllListeners("error"),t.removeAllListeners("queue-limit-exceeded"),t.removeAllListeners("connect_error"),clearTimeout(o)};t.connect(),U(e);let o=setTimeout(()=>{i(),t.disconnect(),n({status:"socket-timeout"})},C.ne);t.emit("authenticate",e),t.once("authenticate",e=>{"success"!==e.status&&(i(),t.disconnect(),n({status:"auth-failed"}))}),t.once("retrieve-data",e=>{i(),t.disconnect();try{let t=JSON.parse(e),i=t?.data;
8if(i?.data_type==="collection"&&Array.isArray(i.contents)&&i.contents.length>0)return void n({status:"found",data:i});n({status:"not-found"})}catch(e){(0,G.SZ)("collection load more parse error:",e),n({status:"error"})}}),t.once("error",()=>{i(),t.disconnect(),n({status:"socket-error"})}),t.once("queue-limit-exceeded",()=>{i(),t.disconnect(),n({status:"queue-limit-exceeded"})}),t.once("connect_error",()=>{i(),t.disconnect(),n({status:"connect-error"})})})):{status:"socket-not-ready"}},[J,Q,U]),ej=o.useCallback(async e=>{let t=J||Q.current;return e&&t?(t.connected&&(t.removeAllListeners(),t.disconnect(),await new Promise(e=>setTimeout(e,100))),new Promise(n=>{let i=()=>{t.removeAllListeners("authenticate"),t.removeAllListeners("retrieve-data"),t.removeAllListeners("error"),t.removeAllListeners("queue-limit-exceeded"),t.removeAllListeners("connect_error"),clearTimeout(o)};t.connect(),U(e);let o=setTimeout(()=>{i(),t.disconnect(),n({status:"socket-timeout"})},C.ne);t.emit("authenticate",e),t.once("authenticate",e=>{"success"!==e.status&&(i(),t.disconnect(),n({status:"auth-failed"}))}),t.once("retrieve-data",e=>{i(),t.disconnect();try{let t=JSON.parse(e),i=t?.data;
8if(i?.data_type==="story"&&Array.isArray(i.contents)&&i.contents.length>0)return void n({status:"found",data:i});n({status:"not-found"})}catch(e){(0,G.SZ)("story load more parse error:",e),n({status:"error"})}}),t.once("error",()=>{i(),t.disconnect(),n({status:"socket-error"})}),t.once("queue-limit-exceeded",()=>{i(),t.disconnect(),n({status:"queue-limit-exceeded"})}),t.once("connect_error",()=>{i(),t.disconnect(),n({status:"connect-error"})})})):{status:"socket-not-ready"}},[J,Q,U]),eN=o.useCallback(async()=>{if(!N||"story"!==N.data_type||!N.hasMore)return;let t=N.contents?.length??0;if(t<=0)return;let n=t-1;sessionStorage.setItem("hdStoryIndex",(t+1).toString()),eT(!0),e.handleFindStatus("SEARCHING");let i=window.matchMedia("(display-mode: standalone)").matches?"PWA":"Web",o=function(e,t){if((0,k.B)(e))return e;let n=(e||"").trim();return!n||/^https?:\/\//i.test(n)||/tiktok\.com/i.test(n)?t?`@${t.replace(/^@/,"")}`:e:n.startsWith("@")?n:`@${n.replace(/^@/,"")}`}(N.inputUrl,N.username??e.username),a=()=>{sessionStorage.setItem("hdStoryIndex",(n+1).toString()),eT(!1),e.handleFindStatus("FOUND")};try{let n=0;for(;!J&&!Q.current&&n<5e3;)await new Promise(e=>setTimeout(e,100)),n+=100;let r=await (0,x.t)({vLink:o,agent:i,tab:"story",amplified:!0});if(!r?.sessionId)return void a();let l=await ej(r.sessionId);if("found"!==l.status||!l.data)return void a();let s=function(e,t){if(!e?.contents?.length)return{...t,data_type:"story"};let n=new Set(e.contents.map(e=>e.contentId).filter(e=>!!e)),i=(t.contents??[]).filter(e=>{let t=e.contentId;return!(!t||n.has(t))&&(n.add(t),!0)}),o=[...e.contents,...i],a=[...e.cursors??[]];for(let e of t.cursors??[])e&&a[a.length-1]!==e&&a.push(e);let r="boolean"==typeof t.hasMore?t.hasMore:e.hasMore;return 0===i.length&&(r=!1),{...e,...t,contentId:e.contentId??t.contentId,inputUrl:e.inputUrl??t.inputUrl,contents:o,cursors:a,videoCount:o.length,data_type:"story",..."boolean"==typeof r?{hasMore:r}:{}}}(N,l.data);L(s),N.contentId&&await (0,v.L)(N.contentId),sessionStorage.setItem("hdStoryIndex",(t+1).toString()),eT(!1),e.handleFindStatus("FOUND")}catch(e){(0,G.SZ)("handleStoryLoadMore failed:",e),a()}},[N,L,J,Q,ej,e]),eV=o.useCallback(async()=>{if(!Y)return;let t=K[Y],n=t?.contents?.length??0;if(n<=0)return;let i=n-1;sessionStorage.setItem("hdCollectionIndex",(n+1).toString()),eC(!0),e.handleFindStatus("SEARCHING");let o=window.matchMedia("(display-mode: standalone)").matches?"PWA":"Web",a=()=>{sessionStorage.setItem("hdCollectionIndex",(i+1).toString()),eC(!1),e.handleFindStatus("FOUND")};try{let i=0;for(;!J&&!Q.current&&i<5e3;)await new Promise(e=>setTimeout(e,100)),i+=100;let r=await (0,x.t)({vLink:Y,agent:o,tab:"collection",amplified:!0,highlightCursor:n});if(!r?.sessionId)return void a();let l=await eI(r.sessionId);if("found"!==l.status||!l.data)return void a();let s=function(e,t){let n=t.contents?.length??0;if(!e?.contents?.length){let e="boolean"==typeof t.hasMore?t.hasMore:void 0;return(0===n||n<30)&&(e=!1),{...t,..."boolean"==typeof e?{hasMore:e}:{}}}let i=new Set(e.contents.map(e=>e.contentId).filter(e=>!!e)),o=(t.contents??[]).filter(e=>{let t=e.contentId;return!(!t||i.has(t))&&(i.add(t),!0)}),a=[...e.contents,...o],r="boolean"==typeof t.hasMore?t.hasMore:e.hasMore;return(0===o.length||n<30)&&(r=!1),{...e,...t,contents:a,videoCount:a.length,data_type:"collection",..."boolean"==typeof r?{hasMore:r}:{}}}(t,l.data);X(e=>({...e,[Y]:s})),Y&&await (0,v.L)(Y),sessionStorage.setItem("hdCollectionIndex",(n+1).toString()),eC(!1),e.handleFindStatus("FOUND")}catch(e){(0,G.SZ)("handleCollectionLoadMore failed:",e),a()}},[Y,K,X,J,Q,eI,e]),eF=(e,t=!1)=>{((0,G.gg)("handleAmplificationDownload url: ",e),(0,G.gg)("handleAmplificationDownload hd: ",t),t)?em(e??D,"all"):eh(e??D,"all")},eR=async()=>{let t=window.matchMedia("(display-mode: standalone)").matches?"PWA":"Web";"NOT-FOUND"===e.findStatus&&D&&e.processChains&&e.processChains.length>0&&!N?await fetch("/api/discord-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:D,api:"-",content:e.dataType,message:e.title,status:"FAILED",time:new Date,agent:t,reqId:"-",operations:e.processChains??[],tab:C.eq[n??e.tab]})}).finally(()=>{(0,s.deleteCookie)("prc")}):"FOUND"===e.findStatus&&e.inputUrl&&e.processChains&&e.processChains.length>0&&await fetch("/api/discord-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e.inputUrl,api:e.api,content:e.dataType,message:e.title,status:"SUCCESS",time:new Date,agent:t,reqId:e.contentId,operations:e.processChains,tab:C.eq[n??e.tab]})}).finally(()=>{(0,s.deleteCookie)("prc")})};o.useEffect(()=>{eR().then(()=>{}).catch(e=>{})},[e.dataType,e.findStatus]),o.useEffect(()=>{if("FOUND"===e.findStatus||"NOT-FOUND"===e.findStatus){let e=`${(0,d.k)()}-${Date.now().toString()}-${(0,d.k)()}`,t=(0,s.getCookie)("feedback-agent")?.toString();t?(localStorage.setItem("feedback-agent",t),(0,s.deleteCookie)("feedback-agent")):localStorage.setItem("feedback-agent",e)}(()=>
8{if("FOUND"===e.findStatus||"NOT-FOUND"===e.findStatus){let e=localStorage.getItem("last-score"),t=e?parseInt(e):0,n=localStorage.getItem("hsf"),i=(0,s.getCookie)("last-score"),o=t||i,a=(0,s.hasCookie)("hsf")||!!n;if(n&&(0,s.deleteCookie)("hsf"),e&&(0,s.deleteCookie)("last-score"),o&&o>=4||a)return}})()},[e.findStatus]),o.useEffect(()=>{j(C.eq[n??e.tab])},[n]),o.useEffect(()=>{if("FOUND"===e.findStatus&&e.inputUrl){(0,G.gg)("setting link inp cache storage: ",e.inputUrl);let t=e.inputUrl.replaceAll("username",e.username);(0,p.lj)(t)}},[e.inputUrl]),o.useEffect(()=>{(0,G.gg)("is show subtitle: ","FOUND"===e.findStatus&&7===n&&null!==V),(0,G.gg)("subtitleData: ",V),(0,G.gg)("tabIndexCtx: ",n),(0,G.gg)("findStatus: ",e.findStatus)},[e.findStatus,V,n]);let e$={0:(0,i.jsx)(eO.A,{}),1:(0,i.jsx)(eO.A,{}),2:(0,i.jsx)(eB.A,{}),3:(0,i.jsx)(eE.A,{}),4:(0,i.jsx)(u.A,{}),5:(0,i.jsx)(u.A,{}),6:(0,i.jsx)(eE.A,{}),7:(0,i.jsx)(eO.A,{}),8:(0,i.jsx)(eO.A,{})},eM=!!(M&&R[M])&&(R[M]?.contents?.length??0)>0,eG=9===n||"highlight"===e.dataType,eW=!!(z&&H[z])&&(H[z]?.contents?.length??0)>0,eH=10===n||"playlist"===e.dataType,eq=!!(Y&&K[Y])&&(K[Y]?.contents?.length??0)>0,ez=11===n||"collection"===e.dataType;return eG&&(F||eM)&&("FOUND"===e.findStatus||"SEARCHING"===e.findStatus)&&!eg?(0,i.jsx)(eJ,{findStatus:e.findStatus,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadingText:e.downloadingText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,postDownload:e.postDownload,previewerDicts:e.previewerDicts,toastLang:e.toastLang,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,globalPreviewer:e.globalPreviewer,onSelectHighlight:e.handleFindHighlightContents,onHighlightLoadMore:ex}):eH&&(W||eW)&&("FOUND"===e.findStatus||"SEARCHING"===e.findStatus)&&!ey?(0,i.jsx)(e7,{findStatus:e.findStatus,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadingText:e.downloadingText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,postDownload:e.postDownload,previewerDicts:e.previewerDicts,toastLang:e.toastLang,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,globalPreviewer:e.globalPreviewer,onSelectPlaylist:e.handleFindPlaylistContents,onPlaylistLoadMore:eP}):ez&&(Z||eq)&&("FOUND"===e.findStatus||"SEARCHING"===e.findStatus)&&!eb?(0,i.jsx)(tu,{findStatus:e.findStatus,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadingText:e.downloadingText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,postDownload:e.postDownload,previewerDicts:e.previewerDicts,toastLang:e.toastLang,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,globalPreviewer:e.globalPreviewer,onSelectCollection:e.handleFindCollectionContents,onCollectionLoadMore:eV}):(0,i.jsx)(eU.A,{children:(()=>{if("SEARCHING"===e.findStatus)return e$[n??e.tab]||(0,i.jsx)(eO.A,{});if(8===n&&("FOUND"===e.findStatus||"NOT-FOUND"===e.findStatus))return(0,i.jsx)(eL,{title:e.title,username:e.username,profilePic:e.profilePic,thumbnail:e.thumbnail,toastLang:e.toastLang,timePosted:e.timePosted,contentId:e.contentId,copyTxt:e.postDownload.share,shareTxt:e.postDownload.share,friendlyTimeTexts:e.friendlyTimeTexts,handleAgain:e.downloadAgain,handleRedownload:()=>{e.handleFindVideo(e.inputUrl)},globalPreviewer:e.globalPreviewer});if(7===n&&("FOUND"===e.findStatus||"NOT-FOUND"===e.findStatus))return(0,i.jsx)(ev,{videoId:V?.video_id,username:e.username||V?.video_id||"",title:e.title||V?.video_id||"",profilePic:e.profilePic,subtitleData:V??void 0,isFetchingSubtitle:"loading"===ee,isNotFound:!(0,T.a0)(V??void 0)&&("not-found"===ee||"NOT-FOUND"===e.findStatus&&"loading"!==ee),toastLang:e.toastLang,thumbnail:e.thumbnail,timePosted:e.timePosted,contentId:e.contentId,copyTxt:e.postDownload.share,shareTxt:e.postDownload.share,friendlyTimeTexts:e.friendlyTimeTexts,handleAgain:e.downloadAgain,handleRedownload:()=>{e.handleFindVideo(e.inputUrl)},globalPreviewer:e.globalPreviewer});if("FOUND"===e.findStatus&&"video"===e.dataType&&3==n&&r(0),t.includes("/dl-slideshow"))return(0,i.jsx)(tw,{findStatus:e.findStatus,profilePic:e.profilePic,thumbnail:e.thumbnail,title:e.title,username:e.username,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:e.urls[3],contentKey:e.contentId+"-slide",inputUrl:e.inputUrl,previewerDicts:e.previewerDicts,musicUrl:e.musicURL,toastLang:e.toastLang,contentId:e.contentId,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,handleAgain:e.downloadAgain,handleRedownload:()=>{e.handleFindVideo(e.inputUrl)},globalPreviewer:e.globalPreviewer,timePosted:e.timePosted,live_images:e.live_images});if("FOUND"===e.findStatus&&0===n&&e.inputUrl)if("video"===e.dataType)return(0,i.jsx)(t_,{findStatus:e.findStatus,infSize:e.infSize,duration:e.duration,views:e.views,profilePic:e.profilePic,thumbnail:e.thumbnail,title:e.title,username:e.username,timePosted:e.timePosted,downloadAgain:e.downloadAgain,wmSize:e.wmSize,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:e.urls[0],contentKey:e.contentId+"-video",inputUrl:e.inputUrl,previewerDicts:e.previewerDicts,toastLang:e.toastLang,contentId:e.contentId,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,globalPreviewer:e.globalPreviewer,hdInfSize:e.hdInfSize,handleAmplificationDownload:eF});else if("slideshow"===e.dataType)return(0,i.jsx)(tw,{findStatus:e.findStatus,profilePic:e.profilePic,thumbnail:e.thumbnail,title:e.title,username:e.username,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:e.urls[3],contentKey:e.contentId+"-slide",inputUrl:e.inputUrl,previewerDicts:e.previewerDicts,musicUrl:e.musicURL,toastLang:e.toastLang,contentId:e.contentId,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,handleAgain:e.downloadAgain,handleRedownload:()=>{e.handleFindVideo(e.inputUrl)},globalPreviewer:e.globalPreviewer,timePosted:e.timePosted,live_images:e.live_images});else if("audio"===e.dataType)return(0,i.jsx)(tm,{findStatus:e.findStatus,duration:e.musicDuration,views:e.views,videoCount:e.videoCount,profilePic:e.profilePic,thumbnail:e.thumbnailOrigin,title:e.title,username:e.username,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURL:e.urls[2],contentKey:e.contentId+"-music",inputUrl:e.inputUrl,previewerDicts:e.previewerDicts,toastLang:e.toastLang,contentId:e.contentId,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,globalPreviewer:e.globalPreviewer,timePosted:e.timePosted});else if("profile"===e.dataType)return(0,i.jsx)(th,{findStatus:e.findStatus,profilePic:e.profilePic,thumbnail:e.thumbnail,title:e.title,username:e.username,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:[e.profilePic],contentKey:`@${e.username}-profile`,inputUrl:e.inputUrl,previewerDicts:e.previewerDicts,toastLang:e.toastLang,contentId:`@${e.username}`,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,globalPreviewer:e.globalPreviewer,dataType:e.dataType,timePosted:e.timePosted});else return null;if("FOUND"===e.findStatus&&1===n&&l(e.dataType,"video")&&e.inputUrl)return(0,i.jsx)(t_,{findStatus:e.findStatus,infSize:e.infSize,duration:e.duration,views:e.views,profilePic:e.profilePic,thumbnail:e.thumbnail,title:e.title,username:e.username,timePosted:e.timePosted,downloadAgain:e.downloadAgain,wmSize:e.wmSize,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:e.urls[n],contentKey:e.contentId+"-video",inputUrl:e.inputUrl,previewerDicts:e.previewerDicts,toastLang:e.toastLang,contentId:e.contentId,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,globalPreviewer:e.globalPreviewer,hdInfSize:e.hdInfSize,handleAmplificationDownload:eF});if("FOUND"===e.findStatus&&2===n&&l(e.dataType,"audio")&&e.inputUrl)return(0,i.jsx)(tm,{findStatus:e.findStatus,duration:e.musicDuration,views:e.views,profilePic:e.profilePic,thumbnail:e.thumbnail,title:e.title,username:e.username,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURL:e.urls[2],contentKey:e.contentId+"-music",inputUrl:e.inputUrl,videoCount:e.videoCount,previewerDicts:e.previewerDicts,toastLang:e.toastLang,contentId:e.contentId,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,globalPreviewer:e.globalPreviewer,contents:e.contents,timePosted:e.timePosted});if("FOUND"===e.findStatus&&5===n&&l(e.dataType,"thumbnail")&&e.inputUrl)return(0,i.jsx)(tg,{findStatus:e.findStatus,profilePic:e.profilePic,thumbnail:e.thumbnail,title:e.title,username:e.username,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:e.urls[n],contentKey:e.contentId+"-thumb",inputUrl:e.inputUrl,previewerDicts:e.previewerDicts,toastLang:e.toastLang,contentId:e.contentId,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,globalPreviewer:e.globalPreviewer,timePosted:e.timePosted});if("FOUND"===e.findStatus&&6===n&&(l(e.dataType,"profile")||F?.username||W?.username)&&(e.inputUrl||F?.username||W?.username)){let t=N?.username||F?.username||W?.username||e.username;return(F?.username||W?.username)&&N?.data_type!=="profile"&&("idle"===ei||"loading"===ei)?(0,i.jsx)(u.A,{}):(0,i.jsx)(th,{findStatus:e.findStatus,profilePic:e.profilePic,thumbnail:e.thumbnail,title:e.title,username:t,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:[e.profilePic],contentKey:`@${t}-profile`,inputUrl:e.inputUrl||(t?`@${t.replace(/^@/,"")}`:""),previewerDicts:e.previewerDicts,toastLang:e.toastLang,contentId:`@${t}`,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,globalPreviewer:e.globalPreviewer,dataType:e.dataType,timePosted:e.timePosted})}else if("FOUND"===e.findStatus&&3===n&&l(e.dataType,"slideshow")&&e.inputUrl)return(0,i.jsx)(tw,{findStatus:e.findStatus,profilePic:e.profilePic,thumbnail:e.thumbnail,title:e.title,username:e.username,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:e.urls[n],contentKey:e.contentId+"-slide",inputUrl:e.inputUrl,previewerDicts:e.previewerDicts,musicUrl:e.musicURL,toastLang:e.toastLang,contentId:e.contentId,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,handleAgain:e.downloadAgain,handleRedownload:()=>{e.handleFindVideo(e.inputUrl)},globalPreviewer:e.globalPreviewer,timePosted:e.timePosted,live_images:e.live_images});else if(!("FOUND"===e.findStatus&&4===n&&l(e.dataType,"story"))||!e.inputUrl||ek)return(0,i.jsx)(i.Fragment,{});else return((0,G.gg)("story dataType: ",e.dataType),"video"===e.dataType||"story"===e.dataType)?(0,i.jsx)(tp,{findStatus:e.findStatus,infSize:e.infSize,duration:e.duration,views:e.views,profilePic:e.profilePic,thumbnail:e.thumbnail,title:e.title,username:e.username,downloadAgain:e.downloadAgain,wmSize:e.wmSize,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:e.urls[n],contentKey:e.contentId+"-story",inputUrl:e.inputUrl,previewerDicts:e.previewerDicts,toastLang:e.toastLang,contentId:e.contentId,dataType:e.dataType,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,globalPreviewer:e.globalPreviewer,contents:e.contents,handleAmplificationDownload:eF,timePosted:e.timePosted,storyHasMore:N?.hasMore,onStoryLoadMore:eN}):"slideshow"===e.dataType?(0,i.jsx)(tw,{findStatus:e.findStatus,profilePic:e.profilePic,thumbnail:e.thumbnail,title:e.title,username:e.username,downloadAgain:e.downloadAgain,downloadText:e.downloadText,downloadedText:e.downloadedText,downloadfailedText:e.downloadfailedText,downloadingText:e.downloadingText,postDownload:e.postDownload,downloadURLS:e.urls[3],contentKey:e.contentId+"-slide",inputUrl:e.inputUrl,previewerDicts:e.previewerDicts,musicUrl:e.musicURL,toastLang:e.toastLang,contentId:e.contentId,friendlyTimeTexts:e.friendlyTimeTexts,handleFindVideo:e.handleFindVideo,handleAgain:e.downloadAgain,handleRedownload:()=>{e.handleFindVideo(e.inputUrl)},globalPreviewer:e.globalPreviewer,timePosted:e.timePosted,live_images:e.live_images}):null})()})};tf.displayName="Previewer";let tv=tf},98169:e=>{e.exports={screen:"VideoDownloadButtonV2_screen__3JfZB",btn_ctn:"VideoDownloadButtonV2_btn_ctn__LhPCH",ondownload:"VideoDownloadButtonV2_ondownload__lP9Rj",ctrl_ctn:"VideoDownloadButtonV2_ctrl_ctn__yEKfx",btn_cancel:"VideoDownloadButtonV2_btn_cancel__ID77N",button_ctn_v3:"VideoDownloadButtonV2_button_ctn_v3__KhZBK",button_v3:"VideoDownloadButtonV2_button_v3__eDrNW",disabled:"VideoDownloadButtonV2_disabled__0VKkE",button_main:"VideoDownloadButtonV2_button_main__KFUVU",faded:"VideoDownloadButtonV2_faded__JxglV",align_left:"VideoDownloadButtonV2_align_left__5NpZE",align_center:"VideoDownloadButtonV2_align_center__INgkE",align_right:"VideoDownloadButtonV2_align_right__fPe8o",text_ctn:"VideoDownloadButtonV2_text_ctn__Zbc1E",text:"VideoDownloadButtonV2_text___iEkd",sm:"VideoDownloadButtonV2_sm__kFcK0",sub_text:"VideoDownloadButtonV2_sub_text__s__vu",sub_text_icon_ctn:"VideoDownloadButtonV2_sub_text_icon_ctn__1W5qG",sub_text_icon:"VideoDownloadButtonV2_sub_text_icon__5eljc",divider:"VideoDownloadButtonV2_divider__nRHRf",dark:"VideoDownloadButtonV2_dark__3pXfx",button_ctrl:"VideoDownloadButtonV2_button_ctrl__Djzz_",button_ctrl_item:"VideoDownloadButtonV2_button_ctrl_item__wVdG
8V",button_dropdown:"VideoDownloadButtonV2_button_dropdown__NkYci",icon:"VideoDownloadButtonV2_icon__UnZD7",dropdown_icon:"VideoDownloadButtonV2_dropdown_icon__TOYgW",open:"VideoDownloadButtonV2_open__43nnt",button:"VideoDownloadButtonV2_button__ZdvjK",icon_ctn:"VideoDownloadButtonV2_icon_ctn__UdVQx",no_bg:"VideoDownloadButtonV2_no_bg__MZsml",btn_1:"VideoDownloadButtonV2_btn_1__a_4Za",opt_window:"VideoDownloadButtonV2_opt_window__5FWo_",window_1:"VideoDownloadButtonV2_window_1__U8M1T",btn_2:"VideoDownloadButtonV2_btn_2__BNFRm",window_2:"VideoDownloadButtonV2_window_2__Syk7g",btn_3:"VideoDownloadButtonV2_btn_3__X3Txr",window_3:"VideoDownloadButtonV2_window_3__zCPAx",split_btn_ctn:"VideoDownloadButtonV2_split_btn_ctn__5s9k0",split_btn_main:"VideoDownloadButtonV2_split_btn_main__6AqU9",split_btn_opt:"VideoDownloadButtonV2_split_btn_opt__sgZex",opt_ls:"VideoDownloadButtonV2_opt_ls__VNtyx",opt_item:"VideoDownloadButtonV2_opt_item__02hcn",btn_downloaded:"VideoDownloadButtonV2_btn_downloaded__2iMQg",setting_icon:"VideoDownloadButtonV2_setting_icon__69hgT"}}}]);

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.