1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3818],{49232:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(39763).Z)("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]])},70112:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(39763).Z)("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},29090:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(39763).Z)("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]])},47692:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(39763).Z)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},98728:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(39763).Z)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},82023:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(39763).Z)("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]])},92369:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(39763).Z)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},91804:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(39763).Z)("Wallet",[["path",{d:"M21 12V7H5a2 2 0 0 1 0-4h14v4",key:"195gfw"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h16v-5",key:"195n9w"}],["path",{d:"M18 12a2 2 0 0 0 0 4h4v-4Z",key:"vllfpd"}]])},11239:function(e,t,r){r.d(t,{Z:function(){return a}});let a=(0,r(39763).Z)("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]])},5637:function(e,t,r){r.d(t,{Z:function(){return T}});var a=r(57437),n=r(25160),s=r(2265),l=r(53417),i=r(68919),o=r(88997),c=r(88623),u=r(81706),d=r(33276),m=r(89227);function h(e){let{videoId:t,isPlaying:r,show:n,onToggleShow:l}=e,[i,o]=(0,s.useState)([]),[c,u]=(0,s.useState)([]),d=(0,s.useRef)(null),m=(0,s.useRef)(),h=(e,t)=>"IDR"===t?"Rp".concat(e.toLocaleString()):"".concat(t).concat(e);return(0,s.useEffect)(()=>{let e=async()=>{if(t)try{let e=await fetch("https://api.mivo.com/api/comments/video/".concat(t)),r=await e.json();r.success&&o(r.comments)}catch(e){console.error("Error fetching comments:",e)}};return r&&e(),()=>{m.current&&clearTimeout(m.current)}},[t,r]),(0,s.useEffect)(()=>{if(!r||!n||0===i.length)return;let e=()=>{u(e=>[i[Math.floor(Math.random()*i.length)]]),m.current=setTimeout(e,3e3*Math.random()+2e3)};return e(),()=>{m.current&&clearTimeout(m.current)}},[i,r,n]),(0,a.jsx)("div",{className:"absolute right-1 bottom-10 z-10 flex flex-col items-end",children:n&&(0,a.jsx)("div",{ref:d,className:"w-64 pointer-events-none flex flex-col justify-end",children:c.map(e=>{var t,r;return(0,a.jsxs)("div",{className:"bg-black/40 backdrop-blur-sm text-white rounded-lg p-2 mb-1 animate-fade-up",children:[(0,a.jsx)("div",{className:"text-[11px] text-white",children:e.amount?(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"font-semibold text-pink-400",children:e.nickname||(null===(t=e.userId)||void 0===t?void 0:t.username)||"Anonymous"})," kasih ",(0,a.jsx)("span",{className:"text-green-400",children:h(e.amount,e.currency||"IDR")})]}):(0,a.jsx)("span",{className:"font-semibold text-pink-400",children:e.nickname||(null===(r=e.userId)||void 0===r?void 0:r.username)||"Anonymous"})}),(0,a.jsx)("div",{className:"text-[11px] mt-0.5 text-white/90",children:e.content||(e.amount?"Terima kasih atas dukungannya!":"")})]},e._id+Math.random())})})})}var p=r(12298),f=r(72702),x=r(27648),g=r(61467),v=r(48805),y=r(40303),b=r(80074);function w(e){let{video:t,onDonate:r,isVisible:n=!1,user:w}
1=e,j=(0,s.useRef)(null),k=(0,s.useRef)(null),[N,S]=(0,s.useState)(!1),[E,R]=(0,s.useState)(!1),[T,Z]=(0,s.useState)("100vh"),M=(0,s.useRef)(),[L,C]=(0,s.useState)(!0),[P,A]=(0,s.useState)(!1),[I,D]=(0,s.useState)(!1),[O,_]=(0,s.useState)(!1),[U,z]=(0,s.useState)(null),[q,B]=(0,s.useState)(0),[F,H]=(0,s.useState)(!1),[V,W]=(0,s.useState)(!1),[Q,K]=(0,s.useState)(!1),{isMuted:G,toggleMute:J}=(0,b.c)();localStorage.getItem("userEmail"),localStorage.getItem("username");let X=()=>{let e=window.innerHeight;Z("".concat(e-56,"px"))};return(0,s.useEffect)(()=>{X()},[]),(0,s.useEffect)(()=>{X(),window.addEventListener("resize",X);let e=setTimeout(X,100);return()=>{window.removeEventListener("resize",X),clearTimeout(e)}},[]),(0,s.useEffect)(()=>{let e=j.current;if(!e||!t.playbackUrl)return;if(!n){k.current&&(k.current.destroy(),k.current=null),e.src="",e.load();return}let r=async()=>{try{e.currentTime=0,await e.play(),S(!0)}catch(e){}};if(y.ZP.isSupported()){if(!k.current){let a=new y.ZP({enableWorker:!0,lowLatencyMode:!0,maxBufferLength:15,maxMaxBufferLength:30,startLevel:-1,debug:!1,maxBufferSize:15e6,backBufferLength:0});k.current=a,a.loadSource(t.playbackUrl),a.attachMedia(e),a.on(y.ZP.Events.MANIFEST_PARSED,()=>{e.muted=G,r()}),a.on(y.ZP.Events.ERROR,(e,t)=>{if(t.fatal)switch(t.type){case y.ZP.ErrorTypes.NETWORK_ERROR:a.startLoad();break;case y.ZP.ErrorTypes.MEDIA_ERROR:a.recoverMediaError();break;default:k.current&&(k.current.destroy(),k.current=null)}})}}else e.canPlayType("application/vnd.apple.mpegurl")&&(e.src=t.playbackUrl,e.muted=G,r());return()=>{k.current&&(k.current.destroy(),k.current=null),e.src="",e.load()}},[n,t.playbackUrl]),(0,s.useEffect)(()=>{let e=j.current;e&&(e.muted=G)},[G]),(0,s.useEffect)(()=>{j.current&&(n?(N||(j.current.currentTime=0),j.current.play().catch(console.error),S(!0)):(j.current.pause(),j.current.currentTime=0,S(!1),R(!1)))},[n]),(0,s.useEffect)(()=>{let e=async()=>{if(null==t?void 0:t.id)try{let e=await fetch("https://api.mivo.com/api/comments/video/".concat(t.id)),r=await e.json();A(r.success&&r.comments.length>0)}catch(e){console.error("Error checking comments:",e),A(!1)}};n&&e()},[null==t?void 0:t.id,n]),(0,s.useEffect)(()=>()=>{j.current&&(j.current.pause(),j.current.currentTime=0),M.current&&clearTimeout(M.current)},[]),(0,a.jsxs)("div",{className:"relative bg-black w-full",style:{height:T},children:[(0,a.jsx)("video",{ref:j,className:"absolute inset-0 w-full h-full object-cover cursor-pointer",playsInline:!0,loop:!0,muted:G,preload:"auto",poster:t.thumbnail,onClick:()=>{let e=j.current;e&&(N?(e.pause(),S(!1)):(e.play().catch(console.error),S(!0),G&&J()),M.current&&clearTimeout(M.current),R(!0),M.current=setTimeout(()=>{R(!1)},800))},disableRemotePlayback:!0}),(0,a.jsx)("div",{className:"absolute bottom-0 left-0 right-0",children:(0,a.jsx)("div",{className:"bg-gradient-to-t from-black/80 via-black/50 to-transparent p-3",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center gap-3",children:[(0,a.jsx)("h1",{className:"text-base font-semibold text-white drop-shadow-lg flex-1 truncate",children:t.title}),(0,a.jsxs)("div",{className:"relative flex items-center gap-1.5 flex-shrink-0",children:[(0,a.jsx)("div",{className:"flexible right-0",children:(0,a.jsx)(h,{videoId:t.id,isPlaying:N&&n,show:L&&P,onToggleShow:()=>C(!L)})}),(0,a.jsx)(g.A,{onPress:()=>C(!L),className:"bg-gray-700/50 text-white backdrop-blur-sm hover:bg-gray-600/50 ".concat(L?"text-pink-400":"text-white"),isIconOnly:!0,size:"sm",children:(0,a.jsx)(l.Z,{className:"w-4 h-4"})}),(0,a.jsx)(g.A,{onPress:()=>{K(!0)},className:"bg-gray-700/50 text-white backdrop-blur-sm hover:bg-gray-600/50 px-3 h-8",startContent:(0,a.jsx)(i.Z,{className:"w-4 h-4"}),size:"sm",children:"Share"})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-4 mt-1",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)(x.default,{href:"/@".concat(t.creator.username),children:(0,a.jsx)("img",{src:t.creator.profilePicture||"https://picsum.photos/200",alt:t.creator.username,className:"w-8 h-8 rounded-full"})}),(0,a.jsx)(x.default,{href:"/@".concat(t.creator.username),children:(0,a.jsx)("span",{className:"text-white text-sm font-semibold",children:t.creator.username})})]}),(0,a.jsxs)("div",{className:"relative z-0",children:[(0,a.jsx)("div",{className:"h-2 bg-gray-700/50 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-gradient-to-r from-pink-500 to-purple-500 rounded-full transition-all duration-500",style:{width:"".concat(Math.min(100,t.currentDonation/t.donationTarget*100),"%")}})}),(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 text-sm",children:[(0,a.jsxs)("span",{className:"text-pink-500 font-semibold drop-shadow-lg",children:["Rp",t.currentDonation.toLocaleStr
1ing()]}),(0,a.jsx)("span",{className:"text-gray-300",children:"/"}),(0,a.jsxs)("span",{className:"text-gray-300",children:["Rp",t.donationTarget.toLocaleString()]})]}),t.goalAction&&t.goalAction.length>0&&(0,a.jsx)("div",{className:"absolute -top-8 right-0 flex items-center pointer-events-none",children:(0,a.jsxs)("div",{className:"bg-pink-500/80 backdrop-blur-sm text-xs px-3 py-1.5 rounded-lg leading-none relative shadow-lg",children:[(0,a.jsx)("p",{className:"text-white font-medium whitespace-nowrap overflow-hidden text-ellipsis max-w-[140px]",children:t.goalAction}),(0,a.jsx)("div",{className:"absolute -bottom-1 right-0 w-2 h-2 transform translate-y-1/2 rotate-45 bg-pink-500/80"})]})})]}),(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)("p",{className:"text-gray-400 text-xs whitespace-pre-wrap ".concat(F?"line-clamp-none":"line-clamp-2"," drop-shadow-lg"),children:t.description}),t.description&&t.description.length>100&&(0,a.jsx)("button",{onClick:()=>H(!F),className:"text-gray-500/60 text-xs font-medium hover:text-gray-400 mt-0.5",children:"Show more"})]})]}),(0,a.jsx)("div",{className:"w-1/4 max-w-[140px] min-w-[100px] aspect-square flex-shrink-0 mt-2",children:(0,a.jsx)(g.A,{onPress:()=>{D(!0),r&&r()},className:"bg-gradient-to-tr from-pink-500 via-purple-500 to-pink-500 text-white hover:opacity-90 shadow-lg hover:shadow-pink-500/50 transition-all duration-300 p-0 aspect-square text-lg font-semibold flex items-center justify-center w-full h-full ring-1 ring-pink-400/30 hover:ring-pink-400",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,a.jsx)(o.Z,{className:"w-6 h-6",fill:"white"}),(0,a.jsx)("span",{className:"text-lg font-bold",children:"Sawer"})]})})})]})]})})}),(0,a.jsx)("div",{className:"absolute top-4 right-4 p-2 bg-black/50 rounded-full cursor-pointer hover:bg-black/70 transition-colors",onClick:e=>{e.stopPropagation(),J()},children:G?(0,a.jsx)(c.Z,{className:"w-6 h-6 text-white"}):(0,a.jsx)(u.Z,{className:"w-6 h-6 text-white"})}),(0,a.jsx)("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 p-6 bg-black/30 rounded-full transition-all duration-300 ".concat(E?"opacity-100 scale-100":"opacity-0 scale-50"),children:N?(0,a.jsx)(d.Z,{className:"w-12 h-12 text-white/90"}):(0,a.jsx)(m.Z,{className:"w-12 h-12 text-white/90"})}),I&&(0,a.jsx)(p.Z,{isOpen:I,onClose:()=>D(!1),onSubmit:e=>{console.log("Received QRIS data:",e);let t={qrCode:e.qris_code,expiredDateTime:e.expired_datetime,referenceCode:e.qris_reference_code,amount:e.amount,clientReference:e.clientReference};console.log("Formatted QRIS data:",t),z(t),B(e.amount||0),D(!1),_(!0),"function"==typeof r&&r()},video:{uid:t.id,title:t.title,creator:t.creator.username},targetAmount:t.donationTarget,user:w}),O&&U&&(0,a.jsx)(f.Z,{isOpen:O,onClose:()=>_(!1),qrData:{qrCode:U.qrCode,expiredDateTime:U.expiredDateTime,amount:U.amount,clientReference:U.clientReference}}),(0,a.jsx)(v.Z,{isOpen:Q,onClose:()=>K(!1),title:t.title,creatorName:t.creator.username,videoUrl:"".concat(window.location.origin,"/video/").concat(t.id)})]})}let j=null,k=null;async function N(e,t){let r=new URLSearchParams({page:String(e),limit:String(t)}),a=await fetch("/api/videos/public?".concat(r.toString()));if(!a.ok)throw Error("Failed to fetch public videos");let n=await a.json(),s=Number.isFinite(Number(null==n?void 0:n.page))?Number(n.page):e,l=!!(null==n?void 0:n.hasMore),i=Array.isArray(null==n?void 0:n.videos)?n.videos:[];if(j&&1!==s){let e=new Set(j.videos.map(e=>e.id)),t=[...j.videos];for(let r of i)e.has(r.id)||t.push(r);j={videos:t,page:s,hasMore:l}}else j={videos:i,page:s,hasMore:l};return j}async function S(){return j||k||(k=N(1,5).finally(()=>{k=null}))}async function E(e){return N(e+1,5)}function R(){let[e,t]=(0,s.useState)(()=>{var e;return null!==(e=null==j?void 0:j.videos)&&void 0!==e?e:[]}),[r,n]=(0,s.useState)(()=>!j),[l,i]=(0,s.useState)(()=>{var e;return null!==(e=null==j?void 0:j.page)&&void 0!==e?e:0}),[o,c]=(0,s.useState)(()=>{var e;return null===(e=null==j?void 0:j.hasMore)||void 0===e||e}
1),[u,d]=(0,s.useState)(0),m=(0,s.useRef)(null),h=(0,s.useRef)(),p=(0,s.useRef)(!1),f=(0,s.useRef)(!1);(0,s.useEffect)(()=>{let e=!0;return j||n(!0),S().then(r=>{e&&(t(r.videos),i(r.page),c(r.hasMore),n(!1))}).catch(r=>{console.error("Error loading public feed:",r),e&&(t([]),c(!1),n(!1))}),()=>{e=!1}},[]);let x=(0,s.useCallback)(async()=>{if(!f.current&&o&&l){f.current=!0;try{let e=await E(l);t(e.videos),i(e.page),c(e.hasMore)}catch(e){console.error("Error loading more videos:",e)}finally{f.current=!1}}},[o,l]);(0,s.useEffect)(()=>{let t=m.current;if(!t)return;let r=()=>{h.current&&clearTimeout(h.current),p.current||(h.current=setTimeout(()=>{let r=Math.max(1,window.innerHeight-56),a=Math.min(Math.max(0,Math.round(t.scrollTop/r)),e.length-1);d(a),t.scrollTo({top:a*r,behavior:"smooth"})},50))};return t.addEventListener("scroll",r),()=>{t.removeEventListener("scroll",r),h.current&&clearTimeout(h.current)}},[e.length]),(0,s.useEffect)(()=>{o&&0!==e.length&&u>=e.length-2&&x()},[u,e.length,o,x]);let g=()=>{console.log("Donate clicked")};return r?(0,a.jsx)("div",{className:"flex min-h-[calc(100vh-56px)] items-center justify-center bg-black",children:(0,a.jsx)("div",{className:"text-white",children:"Loading..."})}):e.length?(0,a.jsx)("div",{ref:m,className:"h-screen overflow-y-auto",style:{scrollSnapType:"y mandatory",WebkitOverflowScrolling:"touch"},children:e.map((e,t)=>(0,a.jsx)("div",{className:"w-full",style:{height:"calc(100vh - 56px)",scrollSnapAlign:"start",scrollSnapStop:"always"},children:(0,a.jsx)(w,{video:e,onDonate:g,isVisible:t===u})},"".concat(e.id,"-").concat(t)))}):(0,a.jsx)("div",{className:"flex min-h-[calc(100vh-56px)] items-center justify-center bg-black",children:(0,a.jsx)("div",{className:"text-white",children:"No videos available"})})}function T(){return(0,a.jsxs)("main",{className:"min-h-screen bg-black",children:[(0,a.jsx)(R,{}),(0,a.jsx)(n.default,{})]})}},15121:function(e,t,r){r.d(t,{Z:function(){return w}});var a=r(57437),n=r(2265),s=r(88623),l=r(81706),i=r(33276),o=r(89227),c=r(88997),u=r(40303),d=r(80074),m=r(14507),h=r(12298),p=r(72702),f=r(48805),x=r(27648),g=r(53417),v=r(68919),y=r(61467),b=r(23182);function w(e){var t,r,w,j;let{video:k,onDonate:N,onShare:S,user:E,isVisible:R=!1}=e,T=(0,n.useRef)(null),Z=(0,n.useRef)(null),[M,L]=(0,n.useState)(!1),[C,P]=(0,n.useState)(!1),A=(0,n.useRef)(),[I,D]=(0,n.useState)(!0),[O,_]=(0,n.useState)(!1),[U,z]=(0,n.useState)(!1),[q,B]=(0,n.useState)(null),[F,H]=(0,n.useState)(0),[V,W]=(0,n.useState)(!1),[Q,K]=(0,n.useState)(!1),[G,J]=(0,n.useState)(!0),{isMuted:X,toggleMute:Y}=(0,d.c)(),$=async e=>{try{await e.play(),L(!1)}catch(t){if("NotAllowedError"===t.name){e.muted=!0;try{await e.play(),L(!1)}catch(e){console.error("Autoplay failed even with mute:",e),L(!0)}}else console.error("Video play error:",t),L(!0)}};(0,n.useEffect)(()=>{var e;let t=T.current,r=k.playbackUrl||(null===(e=k.playbackUrls)||void 0===e?void 0:e.hls);if(t&&r){if(Z.current&&(Z.current.stopLoad(),Z.current.destroy(),Z.current=null),u.ZP.isSupported()){let e=new u.ZP({enableWorker:!0,lowLatencyMode:!1,maxBufferLength:10,maxMaxBufferLength:25,startLevel:0,abrEwmaDefaultEstimate:5e5,manifestLoadingTimeOut:5e3,manifestLoadingMaxRetry:3,levelLoadingTimeOut:5e3,levelLoadingMaxRetry:3,fragLoadingTimeOut:5e3,fragLoadingMaxRetry:3,enableSoftwareAES:!1,testBandwidth:!1,autoStartLoad:R,startFragPrefetch:!0,progressive:!1,backBufferLength:20});Z.current=e,e.loadSource(r),e.attachMedia(t),e.on(u.ZP.Events.MANIFEST_PARSED,()=>{J(!1),R&&!M&&$(t)}),e.on(u.ZP.Events.ERROR,(t,r)=>{if(console.error("HLS error:",r),r.fatal)switch(r.type){case u.ZP.ErrorTypes.NETWORK_ERROR:e.startLoad();break;case u.ZP.ErrorTypes.MEDIA_ERROR:e.recoverMediaError();break;default:e.destroy(),Z.current=null}})}else t.canPlayType("application/vnd.apple.mpegurl")&&(t.src=r,R&&!M&&$(t));return()=>{Z.current&&(Z.current.stopLoad(),Z.current.destroy(),Z.current=null),t.removeAttribute("src"),t.load()}}},[k.id,R]),(0,n.useEffect)(()=>{let e=T.current;if(e)return R?(Z.current&&Z.current.startLoad(),M||$(e)):(e.pause(),Z.current&&Z.current.stopLoad(),L(!0)),()=>{!R&&(e.pause(),Z.current&&Z.current.stopLoad())}},[R]),(0,n.useEffect)(()=>{let e=T.current;e&&(e.muted=X)},[X]),(0,n.useEffect)(()=>{let e=T.current;if(!e||!R)return;let t=()=>{L(!1)},r=()=>{L(!0)};return e.addEventListener("play",t),e.addEventListener("pause",r),()=>{e.removeEventListener("play",t),e.removeEventListener("pause",r)}},[R]),(0,n.useEffect)(()=>{(async()=>
1{if(k.id)try{let e=await fetch("https://api.mivo.com/api/comments/video/".concat(k.id));(await e.json()).success&&_(!0)}catch(e){}})()},[k.id]);let ee=async()=>{if(null==q?void 0:q.referenceCode)try{let e=await fetch("/api/donations/status/".concat(q.referenceCode)),t=await e.json();"success"===t.status?(z(!1),alert("Payment successful! Thank you for your support.")):alert("Payment not yet completed. Please complete the payment or try again.")}catch(e){console.error("Error checking payment status:",e),alert("Failed to check payment status. Please try again.")}};return(0,a.jsxs)("div",{className:"relative w-full h-full group",children:[G&&(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-50 z-10",children:(0,a.jsx)("div",{className:"loading-spinner"})}),(0,a.jsx)("video",{ref:T,className:"w-full h-full object-cover cursor-pointer",playsInline:!0,loop:!0,autoPlay:!0,muted:X,preload:"auto",poster:k.thumbnail,onClick:()=>{let e=T.current;e&&R&&(e.paused?$(e):(e.pause(),L(!0)),P(!0),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{P(!1)},800))}}),(0,a.jsx)("div",{className:"absolute top-4 right-4 p-2 bg-black/50 rounded-full cursor-pointer hover:bg-black/70 transition-colors opacity-0 group-hover:opacity-100",onClick:e=>{e.stopPropagation(),Y()},children:X?(0,a.jsx)(s.Z,{className:"w-6 h-6 text-white"}):(0,a.jsx)(l.Z,{className:"w-6 h-6 text-white"})}),(0,a.jsx)("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 p-6 bg-black/30 rounded-full transition-all duration-300 ".concat(C?"opacity-100 scale-100":"opacity-0 scale-50"),children:M?(0,a.jsx)(i.Z,{className:"w-12 h-12 text-white/90"}):(0,a.jsx)(o.Z,{className:"w-12 h-12 text-white/90"})}),(0,a.jsxs)("div",{className:"absolute bottom-0 left-0 right-0",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black via-black/80 to-transparent pointer-events-none"}),(0,a.jsx)("div",{className:"relative top-1 right-0 z-50 flex justify-end pr-6",children:(0,a.jsx)(m.Z,{videoId:k.id,isPlaying:!M,show:I&&O,variant:"compact",maxComments:1})}),(0,a.jsx)("div",{className:"relative pt-2 px-6 pb-6 space-y-6",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start gap-4",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-white drop-shadow-lg flex-1",children:k.title}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(y.A,{onPress:()=>D(!I),className:"bg-gray-700/50 text-white backdrop-blur-sm hover:bg-gray-600/50 ".concat(I?"text-pink-400":"text-white"),isIconOnly:!0,children:(0,a.jsx)(g.Z,{className:"w-5 h-5"})}),(0,a.jsx)(y.A,{onPress:()=>{W(!0),S&&S()},className:"bg-gray-700/50 text-white backdrop-blur-sm hover:bg-gray-600/50 px-4",startContent:(0,a.jsx)(v.Z,{className:"w-5 h-5"}),children:"Share"})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-6",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"relative z-10 -mt-10 pt-8",style:{marginTop:"".concat((k.currentDonation||0)/("number"==typeof k.donationTarget?k.donationTarget:(null===(t=k.donationTarget)||void 0===t?void 0:t.amount)||0)>.7?"-3rem":"-2.5rem")},children:(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-8 transition-all duration-300",children:[(0,a.jsx)(x.default,{href:"/@".concat(k.creator.username),children:(0,a.jsx)("img",{src:k.creator.profilePicture||"https://picsum.photos/200",alt:k.creator.username,className:"w-12 h-12 rounded-full ring-2 ring-white/20 flex-shrink-0 hover:ring-pink-500 transition-all"})}),(0,a.jsx)("div",{className:"min-w-0 flex items-center",children:(0,a.jsx)("h3",{className:"text-white font-semibold drop-shadow-lg truncate",children:k.creator.username})})]})}),(0,a.jsxs)("div",{className:"relative z-0",children:[(0,a.jsx)("div",{className:"h-2 bg-gray-700/50 backdrop-blur-sm rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-gradient-to-r from-pink-500 to-purple-500 rounded-full transition-all duration-500",style:{width:"".concat(Math.min(100,(k.currentDonation||0)/("number"==typeof k.donationTarget?k.donationTarget:(null===(r=k.donationTarget)||void 0===r?void 0:r.amount)||0)*100),"%")}})}),k.goalAction&&k.goalAction.length>0&&(0,a.jsx)("div",{className:"absolute -top-8 -right-4 flex items-center pointer-events-none",children:(0,a.jsxs)("div",{className:"bg-pink-500/80 backdrop-blur-sm text-xs px-3 py-1.5 rounded-lg leading-none relative shadow-lg",children:[(0,a.jsx)("p",{className:"text-white font-medium whitespace-nowrap overflow-hidden text-ellipsis max-w-[200px]",children:k.goalAction}),(0,a.jsx)("div",{className:"absolute -bottom-1 right-4 w-2 h-2 transform translate-y-1/2 rotate-45 bg-pink-500/80"})]})}),(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-pink-500 font-semibold drop-shadow-lg",children:["Rp",(k.currentDonation||0).toLocaleStr
1ing()]}),(0,a.jsx)("span",{className:"text-gray-300",children:"/"}),(0,a.jsxs)("span",{className:"text-gray-300",children:["Rp",("number"==typeof k.donationTarget?k.donationTarget:(null===(w=k.donationTarget)||void 0===w?void 0:w.amount)||0).toLocaleString()]})]})]})]}),(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("button",{onClick:()=>{(0,b.B)({action:"click",category:"donation",label:"sawer_button",value:1}),K(!0)},className:"bg-gradient-to-tr from-pink-500 via-purple-500 to-pink-500 text-white hover:opacity-90 shadow-lg hover:shadow-pink-500/50 transition-all duration-300 rounded-xl text-lg font-semibold flex items-center justify-center ring-2 ring-pink-400/50 hover:ring-pink-400 hover:scale-105 w-[120px] h-[120px]",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,a.jsx)(c.Z,{className:"w-8 h-8",fill:"white"}),(0,a.jsx)("span",{className:"text-2xl font-bold",children:"Sawer"})]})})})]}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)("p",{className:"text-gray-400 text-sm whitespace-pre-wrap line-clamp-2 drop-shadow-lg",children:k.description})})]})})]}),(0,a.jsx)(h.Z,{isOpen:Q,onClose:()=>K(!1),onSubmit:e=>{console.log("Received QRIS data:",e),B({qrCode:e.qris_code,expiredDateTime:e.expired_datetime,referenceCode:e.qris_reference_code,amount:e.amount,clientReference:e.clientReference}),H(e.amount||0),z(!0),N&&N()},targetAmount:"number"==typeof k.donationTarget?k.donationTarget:(null===(j=k.donationTarget)||void 0===j?void 0:j.amount)||0,user:E,video:{uid:k.id,title:k.title,creator:k.creator.username}}),U&&q&&(0,a.jsx)(p.Z,{isOpen:U,onClose:()=>z(!1),qrData:{qrCode:q.qrCode,expiredDateTime:q.expiredDateTime,amount:F,clientReference:q.clientReference||q.referenceCode},onCheckStatus:ee}),(0,a.jsx)(f.Z,{isOpen:V,onClose:()=>W(!1),title:k.title,creatorName:k.creator.username,videoUrl:"".concat(window.location.origin,"/video/").concat(k.id)})]})}},80074:function(e,t,r){r.d(t,{S:function(){return l},c:function(){return i}});var a=r(57437),n=r(2265);let s=(0,n.createContext)(void 0);function l(e){let{children:t}=e,[r,l]=(0,n.useState)(!0);return(0,a.jsx)(s.Provider,{value:{isMuted:r,toggleMute:()=>{l(!r)}},children:t})}function i(){let e=(0,n.useContext)(s);if(void 0===e)throw Error("useSound must be used within a SoundProvider");return e}},34766:function(e,t,r){r.d(t,{z:function(){return a}});let a=(0,r(3011).U)(e=>({isMuted:!0,toggleMute:()=>e(e=>({isMuted:!e.isMuted}))}))},23182:function(e,t,r){r.d(t,{B:function(){return a}});let a=e=>{let{action:t,category:r,label:a,value:n}=e;void 0!==window.gtag&&window.gtag("event",t,{event_category:r,event_label:a,value:n})}},64131:function(e,t,r){function a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)e[a]=r[a]}return e}r.d(t,{Z:function(){return n}});var n=function e(t,r){function n(e,n,s){if("undefined"!=typeof document){"number"==typeof(s=a({},r,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var i in s)s[i]&&(l+="; "+i,!0!==s[i]&&(l+="="+s[i].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+l}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],a={},n=0;n<r.length;n++){var s=r[n].split("="),l=s.slice(1).join("=");try{var i=decodeURIComponent(s[0]);if(a[i]=t.read(l,i),e===i)break}catch(e){}}return e?a[e]:a}},remove:function(e,t){n(e,"",a({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,a({},this.attributes,t))},withConverter:function(t){return e(a({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})},3011:function(e,t,r){r.d(t,{U:function(){return o}});var a=r(2265);let n=e=>{let t;let r=new Set,a=(e,a)=>{let n="function"==typeof e?e(t):e;if(!Object.is(n,t)){let e=t;t=(null!=a?a:"object"!=typeof n||null===n)?n:Object.assign({},t,n),r.forEach(r=>r(t,e))}},n=()=>t,s={setState:a,getState:n,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(a,n,s);return s},s=e=>e?n(e):n,l=e=>e,i=e=>{let t=s(e),r=e=>(function(e,t=l){let r=a.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return a.useDebugValue(r),r})(t,e);return Object.assign(r,t),r},o=e=>e?i(e):i}}]);
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.