"use strict";(()=>{var e={};e.id=2160,e.ids=[2160],e.modules={20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},22202:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>h,patchFetch:()=>g,requestAsyncStorage:()=>p,routeModule:()=>c,serverHooks:()=>m,staticGenerationAsyncStorage:()=>d});var s={};r.r(s),r.d(s,{GET:()=>l,dynamic:()=>u});var a=r(49303),n=r(88716),o=r(60670),i=r(87070);let u="force-dynamic";async function l(e){let t=e.nextUrl.searchParams.get("url"),r=e.nextUrl.searchParams.get("referer");if(!t)return new i.NextResponse("Missing URL",{status:400});let s="https://dramawave.dramabos.my.id/";r?s=r:t.includes("crazymaplestudios.com")?s="https://reelshort.dramabos.my.id/":t.includes("vividshort.com")&&(s="https://www.vividshort.com/");let a={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",Referer:s},n=e.headers.get("range");n&&(a.Range=n);try{let e=await fetch(t,{headers:a,cache:"no-store"}),r=e.headers.get("content-type"),o=e.headers.get("content-length"),u=e.headers.get("content-range");if((r&&(r.includes("mpegurl")||r.includes("m3u8"))||t.toLowerCase().includes(".m3u8")||t.toLowerCase().includes(".m3u"))&&!n){let r=await e.text(),a=t.substring(0,t.lastIndexOf("/")+1),n=e=>{if(e.startsWith("http"))return e;if(e.startsWith("/"))try{let r=new URL(t).origin;return`${r}${e}`}catch(t){return e}return a+e},o=e=>{let t=`/api/stream?url=${encodeURIComponent(e)}`;return s&&(t+=`&referer=${encodeURIComponent(s)}`),t},u=r.replace(/^(?!#)(.+)$/gm,e=>{let t=e.trim();return t?o(n(t)):e});return u=u.replace(/URI="([^"]+)"/g,(e,t)=>`URI="${o(n(t))}"`),new i.NextResponse(u,{headers:{"Content-Type":"application/vnd.apple.mpegurl","Access-Control-Allow-Origin":"*","Cache-Control":"no-cache"}})}let l=new Headers;return l.set("Access-Control-Allow-Origin","*"),l.set("Cache-Control","public, max-age=3600"),r&&l.set("Content-Type",r),o&&l.set("Content-Length",o),u&&l.set("Content-Range",u),new i.NextResponse(e.body,{status:e.status,statusText:e.statusText,headers:l})}catch(e){return console.error("Proxy Stream Error:",e),new i.NextResponse(`Proxy Error: ${e.message}`,{status:500})}}let c=new a.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/stream/route",pathname:"/api/stream",filename:"route",bundlePath:"app/api/stream/route"},resolvedPagePath:"C:\\Users\\MSI\\Downloads\\film\\app\\api\\stream\\route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:p,staticGenerationAsyncStorage:d,serverHooks:m}=c,h="/api/stream/route";function g(){return(0,o.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:d})}}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[8948,5972],()=>r(22202));module.exports=s})();