1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2743,1078],{46267:function(t,e,n){"use strict";n.r(e);var a=n(47568),c=n(29815),r=n(97582),o=n(85893),s=n(67294),i=n(2481),h=n(89414),l=n.n(h),u=n(55733),d=n(37638),m=n(46868),f=n(11163),g=n(17680),_=n(71052),b=n(30409),v=n(98702),p=n(27429),x=n(56757),j=n(62057),C=n(16626),I=n(94136),N=function(t){var e=t.channel,n=function(){var t,e=null===(t=G.current)||void 0===t?void 0:t.parentElement;e&&(e.scrollTop=e.scrollHeight)},h=(0,s.useRef)(),N=(0,s.useState)(!0),y=N[0],w=N[1],R=(0,j.useAuthStore)((function(t){return t.authenticated})),k=(0,f.useRouter)(),S=(0,s.useState)([]),D=S[0],V=S[1],E=(0,s.useState)({}),A=E[0],F=E[1],L=(0,s.useState)({}),T=L[0],O=L[1],Z=(0,s.useState)(1),z=Z[0],J=Z[1],q=(0,s.useState)(!1),H=q[0],W=q[1],M=(0,s.useState)(!1),U=M[0],P=M[1],Q=(0,s.useRef)(),G=(0,s.useRef)(null),K=(0,x.useMainStore)((function(t){return t.setError})),Y=(0,j.useAuthStore)((function(t){return t})),B=Y.userId,X=Y.userName,$=Y.mobileNo,tt=(0,C.useFirebaseStore)((function(t){return t})),et=tt.db,nt=tt.setDb,at=(0,s.useCallback)((function(t){if(et){var n;(0,_.Tt)(e.VideoEntityId,z);var a=t;(null===(n=D[0])||void 0===n?void 0:n.ChatRoomId)==a?P(!0):P(!1),J(a),(0,_.J0)(e.VideoEntityId,a,(function(t){F(null!==t&&void 0!==t?t:{})}))}}),[et]),ct=(0,s.useCallback)((function(t){if(Array.isArray(t))V(t),at(t[t.length-1].ChatRoomId);else{var n=(0,c.Z)(D),a=D.filter((function(e){return e.ChatRoomId===t.ChatRoomId}));if(a.length)at(t.ChatRoomId);else{n.push(t),V(n),at(t.ChatRoomId);var r=X,o={message:"".concat(X," Joined"),channelID:e.VideoEntityId,roomID:t.ChatRoomId,type:2,date:Date.now(),id:Number(B),senderName:r};(0,_.VW)(o)}}}),[et,D]),rt=(0,s.useCallback)((0,a.Z)((function(){var t;return(0,r.__generator)(this,(function(n){switch(n.label){case 0:return[4,(0,m.v_)(u.JX,{UserId:B,MobileNo:$,Version:"V1",Language:"en",Platform:I.hx,ChannelId:e.VideoEntityId})];case 1:return 1==(t=n.sent()).data.Response.responseCode&&t.data.ChatRooms&&(V(t.data.ChatRooms[0].Rooms),at(t.data.ChatRooms[0].Rooms[0].ChatRoomId),P(!0)),[2]}}))})),[et]),ot=(0,s.useMemo)((function(){return Array.isArray(T)&&T.length?T.map((function(t){return{pattern:new RegExp(t.trim(),"g"),replacement:"*".repeat(t.trim().length)}})):[]}),[T]);function st(){return it.apply(this,arguments)}function it(){return(it=(0,a.Z)((function(){var t,n,a;return(0,r.__generator)(this,(function(c){switch(c.label){case 0:return navigator.share?(t=D.find((function(t){return t.ChatRoomId==z})),n="".concat(d.V.getCookies("userProfileName")," is inviting you to stream ").concat(e.VideoName," and join the room ").concat(t.RoomName," on Tapmad! Click the link below to join:\nLink: ").concat(window.location.href,"\nRoom ID: ").concat(t.ChatLink,"\nIt\u2019s going to be intense, don\u2019t miss it. Subscribe to Tapmad or Login to join now!"),a={title:e.VideoName,text:n},[4,navigator.share(a).catch((function(t){return(0,p.vK)("Error sharing",t)}))]):[3,2];case 1:return c.sent(),[3,3];case 2:alert("Device can not share"),c.label=3;case 3:return[2]}}
1))}))).apply(this,arguments)}(0,s.useEffect)((function(){et&&rt()}),[et]);var ht=Object.keys(A).length>0;return(0,s.useEffect)((function(){et&&(0,_.ik)((function(t){var e=t[Object.keys(t)[0]].words.replace(/[\r\n]/gm,"").split("|");O(e)})),n()}),[ht]),(0,s.useEffect)((function(){if(h.current){var t=h.current;t.oninput=function(){requestAnimationFrame((function(){t.style.height="",t.style.height=t.scrollHeight+"px"}))}}}),[e]),(0,s.useEffect)((function(){et||nt()}),[]),(0,s.useLayoutEffect)((function(){if((null===Q||void 0===Q?void 0:Q.current)&&document.querySelectorAll(".chattb").length>1){var t=0;Q.current.classList.add(l().scrollActive),document.querySelectorAll(".chattb").forEach((function(e,n){t+=e.getBoundingClientRect().width,0!==n&&(t+=10)})),Q.current.style.width=t+"px"}}),[D,y]),y?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:l().chatbx,children:[(0,o.jsxs)("div",{className:l().chathd,children:[(0,o.jsx)("div",{className:l().chathdscroller,children:(0,o.jsxs)("div",{className:l().chathdrow,ref:Q,children:[D&&(null===D||void 0===D?void 0:D.length)?D.map((function(t,n){return(0,o.jsxs)("div",{className:"chattb ".concat(l().chattb," ").concat(z==t.ChatRoomId?l().active:""),role:"button",tabIndex:0,onClick:function(){return at(t.ChatRoomId)},children:[t.RoomName,0!==n?(0,o.jsx)("span",{role:"button",onClick:function(){return function(t){var n={success:(0,a.Z)((function(){var n,a,c,o;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:return n={Version:"V1",Language:"en",Platform:I.hx,UserId:B,MobileNo:$,ChatLink:t.ChatLink},[4,(0,_.zJ)(n)];case 1:return 1==(a=r.sent()).Response.responseCode?(h.current.value="",c=D.filter((function(e){return e.ChatRoomId!=t.ChatRoomId})),o={message:"".concat(X," left"),channelID:e.VideoEntityId,roomID:t.ChatRoomId,type:2,date:Date.now(),id:Number(B),senderName:X},(0,_.VW)(o)):K({icon:"error",title:a.Response.message}),V(c),at(c[c.length-1].ChatRoomId),[2]}}))}))};K((0,v.u7)(n))}(t)},children:(0,o.jsx)(i.Z,{className:l().chattc,icon:"close"})}):(0,o.jsx)(o.Fragment,{})]},t.ChatRoomId)})):(0,o.jsx)(o.Fragment,{}),(0,o.jsx)("div",{className:"chattb ".concat(l().chattb," ").concat(l().chatac),role:"button",tabIndex:0,onClick:function(){R?W(!0):k.push("/sign-up")},children:(0,o.jsx)(i.Z,{icon:"plus",className:l().addchat})})]})}),(0,o.jsx)("span",{className:l().hidect,role:"button",tabIndex:0,onClick:function(){return w(!1)},children:"Hide Chat"})]}),(0,o.jsx)("div",{className:l().chatmvw,children:(0,o.jsxs)("div",{className:l().chatmgs,children:[A&&Object.keys(A).map((function(t){return A[t].type>0?(0,o.jsxs)("blockquote",{className:"".concat(l().chatmg," ").concat(A[t].id==B?"flex-row-reverse":""),children:[(0,o.jsx)("div",{className:l().chatim,children:(0,o.jsx)("img",{src:g.DY,alt:"Chat Image",width:34,height:34,decoding:"async",loading:"lazy"})}),(0,o.jsxs)("div",{className:l().chattx,children:[(0,o.jsxs)("time",{className:l().chattm,children:[(e=A[t].date,new Date(e).toLocaleDateString("en-US",{weekday:"long"})+" "+function(t){var e=t.getHours(),n=t.getMinutes(),a=e>=12?"pm":"am";return(e=(e%=12)||12)+":"+(n=n<10?"0"+n:n)+" "+a}(new Date(e)))," ",(0,o.jsx)("strong",{children:A[t].senderName})]}),(0,o.jsx)("span",{className:l().chatmt,children:A[t].message})]})]},t):(0,o.jsx)(s.Fragment,{},t);var e})),(0,o.jsx)("div",{ref:G,className:"lastDiv"})]})}),(0,o.jsxs)("div",{className:l().chatwb,children:[(0,o.jsx)("textarea",{className:l().chatwt,ref:h,placeholder:"Write a comment"}),U?(0,o.jsx)(o.Fragment,{}):(0,o.jsx)("span",{className:"".concat(l().chatsb," ").concat(l().chatsbShare),onClick:st,role:"button",tabIndex:0,children:(0,o.jsx)(i.Z,{icon:"share",size:"1.3rem",color:"var(--green-400)"})}),(0,o.jsx)("span",{className:l().chatsb,onClick:function(t){if(t.preventDefault(),R){var a={message:h.current.value,channelID:e.VideoEntityId,roomID:z};if(ot.forEach((function(t){var e=t.pattern,n=t.replacement;a.message=a.message.replace(e,n)})),""==a.message.trim())h.current.style.border="1px solid red",setTimeout((function(){h.current.style.border="0px"}),2e3);else{if(a.message.trim().length>99)return K(v.ZE);(0,_.VW)(a),h.current.value="",setTimeout((function(){n()}),100)}}else k.push("/sign-up")},role:"button",tabIndex:0,children:(0,o.jsx)(i.Z,{icon:"send",size:"1.6rem",color:"var(--green-400)"})})]})]}),H?(0,o.jsx)(b.default,{channelId:e.VideoEntityId,mergeRoom:function(t){return ct(t)},onShare:st,display:H,setDisplay:W}):(0,o.jsx)(o.Fragment,{})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"mb-2 flex flex-wrap justify-end border-b border-zinc-800",children:(0,o.jsx)("span",{className:"text-green-400 py-2",role:"button",tabIndex:0,onClick:function(){return w(!0)},children:"Show Chat"})}),(0,o.jsx)("div",{className:"text-center",children:"Chat has been minimized"})]})};e.default=(0,s.memo)(N)},17680:function(t,e,n){"use strict";n.d(e,{CS:function(){return c},DY:function(){return r},Ff:function(){return s},UF:function(){return o},dw:function(){return a}});var a="https://d34080pnh6e62j.cloudfront.net/images/VideoOnDemandThumb/1621859275Samsung-smarttv-logo-white.png",c="https://d34080pnh6e62j.cloudfront.net/images/VideoOnDemandThumb/1621859428tm-logo-clr.png",r="/icons/psl/profile.svg",o="https://d34080pnh6e62j.cloudfront.net/images/VideoOnDemandThumb/1762838904close.svg",s="https://d34080pnh6e62j.cloudfront.net/images/VideoOnDemandThumb/1732524758live.gif"},89414:function(t){t.exports={chatbx:"chat_chatbx__AxJfQ",chathd:"chat_chathd__PO6Cn",chattb:"chat_chattb__IKxf4",active:"chat_active__T2_A0",chattc:"chat_chattc__ksJ91",chatac:"chat_chatac__Oxuty",addc
1hat:"chat_addchat___IUqb",hidect:"chat_hidect__zHCNZ",chatmvw:"chat_chatmvw__kiy_G",chatmgs:"chat_chatmgs__bhS5d",chatmg:"chat_chatmg__WO_pJ",chatim:"chat_chatim__vHA88",chattx:"chat_chattx__WrbA7",chattm:"chat_chattm___qQue",chatwb:"chat_chatwb__S3F9H",chateb:"chat_chateb__bJh3V",chatsb:"chat_chatsb__Lp_fF",chatsbShare:"chat_chatsbShare__GmyL8",chatwt:"chat_chatwt__m8wQ3",chathdscroller:"chat_chathdscroller__y3qco",chathdrow:"chat_chathdrow__v0nNR",scrollActive:"chat_scrollActive__QGbz7"}}}]);
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.