"use strict";(()=>{var e={};e.id=3398,e.ids=[3398],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")},27790:e=>{e.exports=require("assert")},84770:e=>{e.exports=require("crypto")},17702:e=>{e.exports=require("events")},92048:e=>{e.exports=require("fs")},32615:e=>{e.exports=require("http")},32694:e=>{e.exports=require("http2")},35240:e=>{e.exports=require("https")},19801:e=>{e.exports=require("os")},55315:e=>{e.exports=require("path")},76162:e=>{e.exports=require("stream")},74175:e=>{e.exports=require("tty")},17360:e=>{e.exports=require("url")},21764:e=>{e.exports=require("util")},71568:e=>{e.exports=require("zlib")},612:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>v,patchFetch:()=>h,requestAsyncStorage:()=>l,routeModule:()=>c,serverHooks:()=>x,staticGenerationAsyncStorage:()=>m});var a={};t.r(a),t.d(a,{GET:()=>d,dynamic:()=>u});var o=t(49303),s=t(88716),i=t(60670),p=t(87070),n=t(59833);let u="force-dynamic";async function d(e){try{let{searchParams:r}=new URL(e.url),t=r.get("country")||"",a=parseInt(r.get("provider_id")||"0");if(!t||!a)return p.NextResponse.json({error:"Parameter country dan provider_id diperlukan"},{status:400});let o=await (0,n.vU)(t,a);return p.NextResponse.json({operators:o})}catch(e){return console.error("[OTP OPERATORS]",e),p.NextResponse.json({error:"Gagal memuat daftar operator"},{status:500})}}let c=new o.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/otp/operators/route",pathname:"/api/otp/operators",filename:"route",bundlePath:"app/api/otp/operators/route"},resolvedPagePath:"C:\\Users\\akmal\\OneDrive\\Documents\\AmaneNime Topup\\amanenime-topup\\app\\api\\otp\\operators\\route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:l,staticGenerationAsyncStorage:m,serverHooks:x}=c,v="/api/otp/operators/route";function h(){return(0,i.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:m})}},59833:(e,r,t)=>{t.d(r,{Ei:()=>d,Ip:()=>u,TL:()=>l,ox:()=>p,q2:()=>c,vU:()=>n});var a=t(63759);let o=process.env.RUMAHOTP_BASE_URL||"https://www.rumahotp.io/api",s=process.env.RUMAHOTP_API_KEY,i=a.Z.create({baseURL:o,headers:{"x-apikey":s,accept:"application/json"},timeout:15e3});async function p(e){let r=await i.get("/v2/countries",{params:{service_id:e}});return r.data?.data||r.data||[]}async function n(e,r){let t=await i.get("/v2/operators",{params:{country:e,provider_id:r}});return t.data?.data||t.data||[]}async function u(e,r,t){try{let a=await i.get("/v2/orders",{params:{number_id:e,provider_id:r,operator_id:t}});if(!a.data?.result&&!a.data?.id)throw Error(JSON.stringify(a.data));return a.data?.data||a.data}catch(e){if(e.response?.data)throw Error(JSON.stringify(e.response.data));throw e}}async function d(e){let r=await i.get("/v1/orders/get_status",{params:{order_id:e}});return r.data?.data||r.data}async function c(e,r){return(await i.get("/v1/orders/set_status",{params:{order_id:e,status:r}})).data}function l(e,r){return Math.ceil(e*(1+r/100))}}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),a=r.X(0,[8948,5972,3759],()=>t(612));module.exports=a})();