1import{C as R,K as S,E as y}from"./CM_Wyx7H.js";import{m as E}from"./Dz0wZwKg.js";import{z as b}from"./B3s3tHEp.js";async function D(o){const{$repositories:c}=y();return new Promise((p,m)=>{c.searchRepository.getSearch(o).then(a=>{p(a)}).catch(a=>{m(a)})})}async function N(o){const{$repositories:c,$dayjs:p}=y();return new Promise(async(m,a)=>{try{const[i,u,w,_]=await Promise.all([c.searchRepository.getSearchByQuery(o),c.matchRepository.searchTeams(o).catch(()=>[]),E().catch(()=>[]),b(o,1,R.newsCountSearch).catch(()=>[])]),t=[],l={},d={};i&&i.epgs&&i.epgs.forEach(s=>{Object.values(s).map(n=>{n.map(e=>{const h=p(e.event_date).format("DD/MM/YYYY");e&&e.event_type.toLowerCase()==="direto"&&(l[h]||(l[h]=[]),l[h].push(e)),d[h]||(d[h]=[]),d[h].push(e)})})});const g=[];let r=[];i.vods&&i.vods.forEach(s=>{for(var n in s)s[n]&&s[n].forEach(e=>{r.push({internal_id:0,id:String(e.id),likes:0,comment_count:0,plays_count:e.plays_count,user_likes:!1,content_type:"",headline:e.event_name,slug:e.event_slug,summary:e.event_summary,event:e.event_sport_slug,event_id:e.event_sport_id,date:e.event_date,type:e.event_type,channel:e.event_channel,channel_id:e.event_channel_id,game_id:0,order:0,image:e.event_thumbnail_url,duration:e.duration/1e3,id_epg:e.id_epg,video_url:"",tags:e.tags})})}),r&&r.length>0&&(r=r.sort((s,n)=>s&&n&&s.date&&n.date&&s.date>n.date?-1:1),g.push({name:"all",value:"all",content:r,playlist:{content:r,display_name:"",id:"",image:"",name:"",position:0,slug:""}})),_&&_.length>0&&t.push({id:t.length,name:"NotÃcias",value:"NotÃcias",news:_}),Object.keys(l).length>0&&t.push({id:t.length,name:"Diretos",value:"Diretos",epgs:l}),Object.keys(d).length>0&&t.push({id:t.length,name:"Todos",value:"Todos",epgs:d}),S("Vods",g),g&&g.length>0&&t.push({id:t.length,name:"VÃdeos",value:"VÃdeos",vods:g}),u&&u.length>0&&t.push({id:t.length,name:"Equipas",value:"Equipas",teams:u});const C=o.toLowerCase(),f=w.filter(s=>{var n;return(n=s.name)==null?void 0:n.toLowerCase().includes(C)});f.length>0&&t.push({id:t.length,name:"Competições",value:"Competições",competitions:f}),m(t)}catch(i){a(i)}})}async function T(o){const{$repositories:c}=y();return new Promise(async(p,m)=>{try{const a=await c.searchRepository.getSearchByQueryPrint(o);p(a)}catch(a){m(a)}})}export{T as a,N as g,D as u};
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.