"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),stream_exports={};__export(stream_exports,{getStream:()=>getStream});var getStream=__name(function(_0){return __async(this,arguments,function*({link:id,providerContext:providerContext}){var _a,_b,_c;try{const{axios:axios,getBaseUrl:getBaseUrl}=providerContext,streamLinks=[],subtitles=[],baseUrl=yield getBaseUrl("kissKh"),streamUrl="https://adorable-salamander-ecbb21.netlify.app/api/kisskh/video?id="+id,res=yield axios.get(streamUrl),stream=null==(_b=null==(_a=res.data)?void 0:_a.source)?void 0:_b.Video,subData=null==(_c=res.data)?void 0:_c.subtitles;return null==subData||subData.map(sub=>{var _a2;subtitles.push({title:null==sub?void 0:sub.label,language:null==sub?void 0:sub.land,type:(null==(_a2=null==sub?void 0:sub.src)?void 0:_a2.includes(".vtt"))?"text/vtt":"application/x-subrip",uri:null==sub?void 0:sub.src})}),streamLinks.push({server:"kissKh",link:stream,type:(null==stream?void 0:stream.includes(".mp4"))?"mp4":"m3u8",headers:{referer:baseUrl}}),streamLinks}catch(err){return console.error(err),[]}})},"getStream");exports.getStream=getStream;