\n \n \n `))).join(""))}async function tabChannelByGroup(e,t,n,a,o){try{if(getOk){let e=(await axios.get(`${apiStb}getChannelByGroup/${t}?ts=${Date.now()}`,{timeout:7e3})).data;e.forEach((e=>{e.icon=e.stb_icon&&e.stb_icon.startsWith("/")?urlStb+e.stb_icon:e.stb_icon})),renderChannelList(e,t,a,o)}else{let n="",i=(await axios.post(`${apiLayananUrl}api/getChannelIdAktifByNoHp`,{no_hp:n},{timeout:7e3})).data.data.map((e=>e.channel_id)),r=new Set(i),l=(await axios.get(`/api/getChannelByGroup/${e}/${t}`,{timeout:7e3})).data;l.forEach((e=>{e.aktif=r.has(e.channel_id)})),renderChannelList(l,t,a,o)}if(getOk){let e=await channelHide();for(const t of e)$(`#ch-${t.channel_id}`).hide()}var i=localStorage.getItem("channel-custom-"+a);let n=JSON.parse(i),r=[];for(const e of r)2!==n?.[e]&&$(`#ch-${e}`).hide();for(const e in n){const t=n[e],a=$(`#ch-${e}`);1===t&&a.hide()}}catch(e){Swal.fire("",e.message?e.message:e,"error")}}function tabChannelByCustomApi(){$("#tabCategory").html(""),$("#jessibucaPlay").addClass("sembunyi"),$("#myVideo").removeClass("sembunyi");let e=apiStb+"vod/getGroups";apiCustom&&(e=`${apiCustom}vod/getVodGroups`);let t={};apiCustom&&(t={custom_id:custom_id}),$.ajax({url:e,method:"POST",data:t,success:function(e){const t=e?.map((e=>{const t=e.group_name.replaceAll(" ","-");return`\n
\n `}));$("#tabCategory").html(t);let n=e.map((e=>getVods(e.group_name)));Promise.allSettled(n).then((()=>{keynapCard("vod")})),$("#tabCategory").append('')},error:function(e){}})}function getVods(e){const t=e.replaceAll(" ","-");let n=apiStb+"vod/getGroupVideos/"+e;apiCustom&&(n=`${apiCustom}vod/getVods`);let a={};return apiCustom&&(a={custom_id:custom_id,group_name:e}),$.ajax({url:n,method:"POST",data:a,success:function(e){e&&$("#group-icon-"+t).html(e?.map(((e,n)=>`\n \n
\n

\n
\n
\n `)))},error:function(e){Swal.fire("",e,"warning")}})}async function getLocationServer(e){let t=null;try{let n=new URL(e);n.pathname="/locate/"+n.pathname.split("/").pop(),n=n.toString();let a=await axios.head(n,{timeout:3e3});200==a.status?t="":204==a.status?t="Gedung Cyber":404==a.status&&(t="Local")}catch(e){404==e?.response?.status?t="Local":console.error(e)}return t}$((async function(){genOk(),mediaBaseUrl=await getMediaBaseUrl(),locationServer=await getLocationServer(playUrl),"Gedung Cyber"==locationServer?($("#wifi_icon").removeClass("sembunyi"),$("#wifi").removeClass("sembunyi")):""==locationServer?($("#satelit_icon").removeClass("sembunyi"),$("#satellite").removeClass("sembunyi")):($("#cdn_logo").removeClass("sembunyi"),$("#satellite").removeClass("sembunyi"),$("#location_cdn").text(locationServer)),innerWidth