1import{c as f,A as j,b as y,r as d,_ as w,j as e}from"./index-BYNP3g4A.js";import{B as N}from"./BackHeader-KqHBHDda.js";import{T as P}from"./TrendingCard-BFw041lc.js";import{C as _}from"./CardSkeleton-D8W6wBtj.js";const T=f((a,g)=>({providerId:null,media:"movie",items:[],page:1,totalPages:1,loading:!1,scrollPosition:0,setScrollPosition:l=>a({scrollPosition:l}),resetProvider:()=>a({providerId:null,items:[],page:1,totalPages:1,media:"movie"}),fetchProvider:async({providerId:l,media:s="movie",page:o=1})=>{const{loading:i}=g();if(!i){a({loading:!0});try{const{data:r}=await j.get("/tmdb/discover",{params:{media:s,with_watch_providers:l,watch_region:"IN",sort_by:"popularity.desc",page:o}});a(x=>({providerId:l,media:s,page:r.page,totalPages:r.total_pages,items:o===1?r.results:[...x.items,...r.results]}))}catch(r){console.error("Provider discover failed:",r.message)}finally{a({loading:!1})}}}})),S=()=>{const{id:a}=y(),[g,l]=d.useState([]);d.useEffect(()=>{w(()=>import("./watchProviders-D5l_Z2Xh.js"),[]).then(t=>{l(t.default)})},[]);const s=g.find(t=>String(t.id)===a),o=d.useRef(null),{items:i,page:r,totalPages:x,loading:m,fetchProvider:h,resetProvider:p,providerId:v,scrollPosition:u,setScrollPosition:b,media:n}=T();return d.useEffect(()=>{if(v==a){setTimeout(()=>{window.scrollTo({top:u,behavior:"instant"})},0);return}window.scrollTo({top:0,behavior:"instant"}),p(),h({providerId:a,page:1,media:"movie"})},[a]),d.useEffect(()=>{if(!o.current||m)return;const t=new IntersectionObserver(([c])=>{c.isIntersecting&&r<x&&h({providerId:a,page:r+1,media:n})},{rootMargin:"400px"});return t.observe(o.current),()=>t.disconnect()},[r,x,m,n]),d.useEffect(()=>{document.title=s?`Cinewish â ${s.name}`:"Cinewish â Provider"},[s]),e.jsxs("div",{className:"bg-gray-950 min-h-screen text-white",onClickCapture:()=>b(window.scrollY),children:[e.jsx(N,{title:"Provider"}),e.jsxs("section",{className:"relative overflow-hidden",children:[e.jsx("div",{className:`absolute inset-0 bg-gradient-to-br ${(s==null?void 0:s.gradient)||"from-gray-900 to-black"} opacity-60`}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(20,184,166,0.08),transparent_55%)]"}),e.jsxs("div",{className:"relative max-w-8xl mx-auto px-4 sm:px-6 py-8 sm:py-10 md:py-12",children:[(s==null?void 0:s.image)&&e.jsx("div",{className:"mb-4 sm:mb-6 flex justify-center md:justify-start",children:e.jsx("div",{className:"bg-white/10 md:backdrop-blur-sm p-3 sm:p-4 rounded-xl border border-white/15",children:e.jsx("img",{src:s.image,alt:s.name,className:"h-12 sm:h-14 md:h-16 w-auto object-contain drop-shadow-xl"})})}),e.jsxs("div",{className:"text-center md:text-left",children:[e.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-2 bg-gradient-to-r from-white to-gray-300 bg-clip-text text-transparent",children:(s==null?void 0:s.name)||"Provider"}),e.jsxs("div",{className:"flex flex-wrap gap-2 sm:gap-3 justify-center md:justify-start text-[11px] sm:text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-white/10 md:backdrop-blur-sm px-3 py-1.5 rounded-full",children:[e.jsx("span",{className:"material-symbols-outlined text-teal-400",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",children:e.jsx("path",{d:"M21 3H3c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.11-.9-2-2-2zm0 14H3V5h18v12zm-5-6l-7 4V7z"})})}),e.jsx("span",{className:"text-gray-300",children:"Streaming Provider"})]}),(s==null?void 0:s.origin_country)&&e.jsxs("div",{className:"flex items-center gap-2 bg-white/10 md:backdrop-blur-sm px-3 py-1.5 rounded-full",children:[e.jsx("span",{className:"material-symbols-outlined text-teal-400",children:"globe"}),e.jsx("span",{className:"text-gray-300",children:s.origin_country})]})]})]})]}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-12 sm:h-16 bg-gradient-to-t from-gray-950 to-transparent"})]}),e.jsxs("section",{className:"max-w-8xl mx-auto px-3 sm:px-5 py-6 sm:py-8",children:[e.jsx("div",{className:"flex flex-col gap-4 mb-6 sm:mb-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-white mb-1 truncate",children:n==="movie"?"Movies":"TV Shows"}),e.jsx("p",{className:"text-gray-400 text-xs sm:text-sm",children:i.length>0&&`${i.length} ${i.length===1?"item":"items"} loaded`})]}),e.jsx("div",{className:"relative inline-flex bg-gray-900/50 md:backdrop-blur-sm rounded-lg p-0.5 border border-gray-800",children:["movie","tv"].map(t=>e.jsx("button",{onClick:()=>{p(),h({providerId:a,page:1,media:t})},className:`px-3 md:px-5 py-1.5 rounded-md text-xs font-medium transition-all duration-200 ${n===t?"bg-teal-500 text-white":"text-gray-400 hover:text-white"}`,children:t==="movie"?"Movies":"TV"},t))})]})}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 gap-3 sm:gap-4 md:gap-6",children:[i.map((t,c)=>e.jsx(P,{...t},`${t.id}-${c}`)),m&&Array.from({length:10}).map((t,c)=>e.jsx(_,{},c))]}),!m&&i.length===0&&e.jsxs("div",{className:"text-center py-12 sm:py-20",children:[e.jsx("div",{className:"text-5xl sm:text-6xl mb-3 sm:mb-4",children:"ðº"}),e.jsxs("h3",{className:"text-lg sm:text-xl font-semibold text-gray-400 mb-2 px-4",children:["No ",n==="movie"?"movies":"TV shows"," found"]}
1),e.jsxs("p",{className:"text-sm sm:text-base text-gray-500 px-4",children:["This provider doesn't have any"," ",n==="movie"?"movies":"TV shows"," available yet."]})]}),e.jsx("div",{ref:o,className:"h-16 sm:h-20 flex justify-center items-center mt-6 sm:mt-8",children:m&&r>1&&e.jsxs("div",{className:"flex items-center gap-2 text-teal-400",children:[e.jsx("div",{className:"w-2 h-2 bg-teal-400 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),e.jsx("div",{className:"w-2 h-2 bg-teal-400 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),e.jsx("div",{className:"w-2 h-2 bg-teal-400 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})})]})]})};export{S as default};
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.