(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8787,8985],{11913:(e,t,r)=>{"use strict";r.d(t,{mq:()=>l,U:()=>i});var a=r(12115);let s=a.useLayoutEffect,n={base:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},l=e=>"(min-width: ".concat(n[e],"px)");function i(e){let{defaultValue:t=!1,initializeWithValue:r=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e=>window.matchMedia(e).matches,[l,i]=(0,a.useState)(()=>r?n(e):t);function c(){i(n(e))}return(s(()=>{let t=window.matchMedia(e);return c(),t.addListener?t.addListener(c):t.addEventListener("change",c),()=>{t.removeListener?t.removeListener(c):t.removeEventListener("change",c)}},[e]),!function(){let[e,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{t(!0)},[]),e}())?t:l}},19619:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FadeInContent:()=>n});var a=r(95155);r(12115);var s=r(5242);function n(e){let{children:t,classCSS:r,duration:n,delay:l,index:i,scale:c}=e;return l&&void 0!==i?(0,a.jsx)(s.P.div,{whileHover:{scale:c},whileTap:{scale:c?c-.03:.95},initial:{opacity:0},animate:{opacity:1,transition:{duration:.5,delay:i/5}},className:r||"",children:t}):(0,a.jsx)(s.P.main,{initial:{opacity:0},animate:{opacity:1},transition:{duration:n||.5},className:r||"",children:t})}},49183:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>f});var a=r(95155),s=r(19619),n=r(12115),l=r(54353),i=r(78787),c=r(79017),o=r(62292),d=r(55028);let u=(0,d.default)(()=>Promise.all([r.e(6766),r.e(1061),r.e(3607)]).then(r.bind(r,45934)),{loadableGenerated:{webpack:()=>[45934]},ssr:!1,loading:()=>(0,a.jsx)(o.A,{})}),p=(0,d.default)(()=>Promise.all([r.e(6874),r.e(4989)]).then(r.bind(r,4989)),{loadableGenerated:{webpack:()=>[4989]},ssr:!1,loading:()=>(0,a.jsx)(o.A,{})});function f(){let e=(0,n.useRef)(null),t=(0,c.W)(e,{once:!0,margin:"0px 0px -100px 0px"}),r=(0,n.useRef)(null),d=(0,c.W)(r,{once:!0,margin:"0px 0px -100px 0px"}),f=(0,n.useRef)(null),x=(0,c.W)(f,{once:!0,margin:"0px 0px -100px 0px"}),h=(0,n.useRef)(null),j=(0,c.W)(h,{once:!0,margin:"0px 0px -100px 0px"}),{data:y,isLoading:v}=(0,l.F)({type:"sports",enabled:!0}),{data:g,isLoading:b}=(0,l.F)({category:"live",popular:!0,enabled:!0}),{data:w,isLoading:N}=(0,l.F)({type:"matches",sport:"football",popular:!0,enabled:!0}),{data:A,isLoading:L}=(0,l.F)({type:"matches",sport:"basketball",popular:!0,enabled:t}),{data:k,isLoading:E}=(0,l.F)({type:"matches",sport:"cricket",popular:!0,enabled:d}),{data:F,isLoading:S}=(0,l.F)({type:"matches",sport:"fight",popular:!0,enabled:x}),{data:C,isLoading:P}=(0,l.F)({type:"matches",sport:"motor-sports",popular:!0,enabled:j});return(0,a.jsxs)(s.FadeInContent,{duration:.5,classCSS:"space-y-8",children:[(0,a.jsx)(m,{title:"Categories",children:v?(0,a.jsx)(o.A,{className:"justify-center"}):y&&(0,a.jsx)(i.Carousel,{itemsClassName:"gap-4",children:y.map(e=>(0,a.jsx)(p,{category:e},e.id))})}),(0,a.jsx)(m,{title:"Popular Live",children:b?(0,a.jsx)(o.A,{className:"justify-center"}):g&&(0,a.jsx)("div",{className:"flex flex-wrap items-center justify-center gap-6 py-10",children:g.map(e=>(0,a.jsx)(u,{data:e},e.id))})}),(0,a.jsx)(m,{title:"Popular Football",children:N?(0,a.jsx)(o.A,{className:"justify-center"}):w&&(0,a.jsx)("div",{className:"flex flex-wrap items-center justify-center gap-6 py-10",children:w.map(e=>(0,a.jsx)(u,{data:e},e.id))})}),(0,a.jsx)(m,{ref:e,title:"Popular BasketBall",children:L?(0,a.jsx)(o.A,{className:"justify-center"}):A&&(0,a.jsx)("div",{className:"flex flex-wrap items-center justify-center gap-6 py-10",children:A.map(e=>(0,a.jsx)(u,{data:e},e.id))})}),(0,a.jsx)(m,{ref:r,title:"Popular Cricket",children:E?(0,a.jsx)(o.A,{className:"justify-center"}):k&&(0,a.jsx)("div",{className:"flex flex-wrap items-center justify-center gap-6 py-10",children:k.map(e=>(0,a.jsx)(u,{data:e},e.id))})}),(0,a.jsx)(m,{ref:f,title:"Popular Fight",children:S?(0,a.jsx)(o.A,{className:"justify-center"}):F&&(0,a.jsx)("div",{className:"flex flex-wrap items-center justify-center gap-6 py-10",children:F.map(e=>(0,a.jsx)(u,{data:e},e.id))})}),(0,a.jsx)(m,{ref:h,title:"Popular Motor Sport",children:P?(0,a.jsx)(o.A,{className:"justify-center"}):C&&(0,a.jsx)("div",{className:"flex flex-wrap items-center justify-center gap-6 py-10",children:C.map(e=>(0,a.jsx)(u,{data:e},e.id))})})]})}let m=n.forwardRef((e,t)=>{let{children:r,title:s}=e;return(0,a.jsxs)("div",{ref:t,className:"space-y-4",children:[(0,a.jsx)("h2",{className:"text-center text-xl font-bold uppercase text-primary md:text-3xl",children:s}),r]})});m.displayName="SportSection"},54353:(e,t,r)=>{"use strict";r.d(t,{F:()=>n});var a=r(95838),s=r(12115);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t="matches",enabled:r,staleTime:n=36e5,...l}=e,i=(0,s.useMemo)(()=>{if("sports"===t)return"sports";let{sport:e,category:r="all",popular:a=!1}=l;return e?"matches/".concat(e).concat(a?"/popular":""):"matches/".concat(r).concat(a?"/popular":"")},[t,l]),c=(0,s.useMemo)(()=>{if("sports"===t)return["sports"];let{sport:e,category:r,popular:a}=l;return["matches",{sport:e,category:r,popular:a}]},[t,l]);return(0,a.I)({queryKey:c,queryFn:async()=>{let e="".concat("https://streamed.su/api","/").concat(i);try{let r=await fetch(e);if(!r.ok)throw Error("Failed to fetch data: ".concat(r.statusText));let a=await r.json();if("sports"===t){if(!(Array.isArray(a)&&a.every(e=>"id"in e&&"name"in e&&2===Object.keys(e).length)))throw Error("Invalid sports data format")}return a}catch(e){throw console.error("Error fetching ".concat(t,":"),e),e}},enabled:r})}},59434:(e,t,r)=>{"use strict";r.d(t,{cn:()=>n});var a=r(52596),s=r(39688);function n(){for(var e=arguments.length,t=Array(e),r=0;r{"use strict";r.d(t,{A:()=>n});var a=r(95155),s=r(59434);let n=e=>{let{count:t,className:r}=e;return(0,a.jsx)("div",{className:(0,s.cn)("flex items-center gap-4",r),children:[...Array(null!=t?t:3)].map((e,t)=>(0,a.jsx)("div",{className:"skeleton h-32 w-60"},"wew-skele-".concat(t)))})}},78787:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Carousel:()=>o});var a=r(95155),s=r(12115),n=r(11913),l=r(52596),i=r(59434),c=r(65189);let o=e=>{let{children:t,showControls:r=!0,className:o="",itemsClassName:d=""}=e,u=(0,s.useRef)(null),[p,f]=(0,s.useState)(0),[m,x]=(0,s.useState)(!0);(0,n.U)((0,n.mq)("md"));let h=()=>{u.current&&x(p===u.current.scrollWidth-u.current.offsetWidth)};return(0,s.useEffect)(()=>{h()},[p,u.current]),(0,s.useEffect)(()=>{u.current&&(u.current.scrollLeft=0,f(0)),h()},[t]),(0,a.jsx)("div",{className:(0,i.cn)("relative",o),children:(0,a.jsxs)("div",{className:"relative flex items-center",children:[(0,a.jsx)("div",{className:(0,l.A)("absolute inset-y-0 left-0 z-10 flex min-w-10 items-center bg-gradient-to-l from-transparent to-base-300",p?"":"hidden"),children:(0,a.jsx)("button",{type:"button",title:"Rolar para a esquerda",className:"h-full opacity-50 hover:opacity-100",disabled:!p,onClick:()=>{u.current&&(u.current.scrollLeft-=u.current.offsetWidth)},children:(0,a.jsx)(c.SnO,{size:25})})}),(0,a.jsx)("div",{className:"no-scrollbar flex flex-col overflow-hidden overflow-x-auto scroll-smooth",onScroll:e=>{f(Math.ceil(e.target.scrollLeft))},ref:u,children:(0,a.jsx)("div",{className:(0,i.cn)("flex w-max gap-8 p-1",d),children:t})}),(0,a.jsx)("div",{className:(0,l.A)("absolute inset-y-0 right-0 z-10 flex min-w-10 items-center bg-gradient-to-r from-transparent to-base-300 sm:pr-2",m?"hidden":""),children:(0,a.jsx)("button",{type:"button",title:"Rolar para a direita",className:"h-full opacity-50 hover:opacity-100",disabled:m,onClick:()=>{u.current&&(u.current.scrollLeft+=u.current.offsetWidth)},children:(0,a.jsx)(c.dH8,{size:25})})})]})})}},79017:(e,t,r)=>{"use strict";r.d(t,{W:()=>l});var a=r(12115),s=r(80793);let n={some:0,all:1};function l(e,{root:t,margin:r,amount:i,once:c=!1,initial:o=!1}={}){let[d,u]=(0,a.useState)(o);return(0,a.useEffect)(()=>{if(!e.current||c&&d)return;let a={root:t&&t.current||void 0,margin:r,amount:i};return function(e,t,{root:r,margin:a,amount:l="some"}={}){let i=(0,s.K)(e),c=new WeakMap,o=new IntersectionObserver(e=>{e.forEach(e=>{let r=c.get(e.target);if(!!r!==e.isIntersecting){if(e.isIntersecting){let r=t(e.target,e);"function"==typeof r?c.set(e.target,r):o.unobserve(e.target)}else"function"==typeof r&&(r(e),c.delete(e.target))}})},{root:r,rootMargin:a,threshold:"number"==typeof l?l:n[l]});return i.forEach(e=>o.observe(e)),()=>o.disconnect()}(e.current,()=>(u(!0),c?void 0:()=>u(!1)),a)},[t,e,r,c,i]),d}},79747:(e,t,r)=>{Promise.resolve().then(r.bind(r,49183))},80793:(e,t,r)=>{"use strict";function a(e,t,r){var a;if(e instanceof EventTarget)return[e];if("string"==typeof e){let s=document;t&&(s=t.current);let n=null!==(a=null==r?void 0:r[e])&&void 0!==a?a:s.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}r.d(t,{K:()=>a})},95838:(e,t,r)=>{"use strict";r.d(t,{I:()=>n});var a=r(76347),s=r(42248);function n(e,t){return(0,s.t)(e,a.$,t)}}},e=>{var t=t=>e(e.s=t);e.O(0,[5891,5242,4277,6967,4258,5557,8441,1684,7358],()=>t(79747)),_N_E=e.O()}]);