Files
tvapp2/dist/assets/EPGDetailScreen-CX4y1Ve9.js
2026-06-11 16:40:21 -04:00

2 lines
15 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{v as ee,D as V,B as W,r as v,o as e,y as H,u as a,f as _,N as n,g as te,p as x,X as p,_ as h,q as w,e as f,t as u,O as b,h as se,z as y,F as k,K as z,E as ne,i as L,Z as ae,R as oe,n as I,C as ie,J as U,H as o,c as K,j as le,d as j}from"./index-CQPQcDLN.js";import{_ as P}from"./Stat.vue_vue_type_script_setup_true_lang-BLQk8QX-.js";const re={class:"col",style:{height:"100%"}},de={class:"card",style:{display:"flex","align-items":"center",gap:"16px"}},ue={style:{flex:"1"}},ve={class:"row",style:{gap:"10px"}},pe={style:{margin:"0","font-size":"18px","font-weight":"600"}},ce={class:"src-url",style:{"margin-top":"4px"}},ge={key:0,class:"muted",style:{"font-size":"var(--fs-xs)","margin-top":"6px"}},me={class:"row",style:{gap:"18px"}},he={class:"card flush",style:{display:"flex","flex-direction":"column",flex:"1","min-height":"0"}},fe={class:"toolbar"},ye={class:"muted",style:{"font-size":"var(--fs-xs)"}},_e={class:"mono",style:{color:"var(--accent-hi)"}},xe={key:0,class:"epg",style:{flex:"1",overflow:"hidden"}},we={class:"epg-head"},ke={class:"epg-body"},be={class:"ch"},ze={style:{"min-width":"0"}},Se={class:"nm",style:{"white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"}},Ce={class:"num mono"},Me=["onClick","title"],Ee={class:"t"},Te={class:"sub"},$e={key:1,style:{"overflow-y":"auto",flex:"1"}},Le={class:"row",style:{gap:"10px","margin-bottom":"10px"}},Pe={style:{"font-weight":"600"}},De={class:"mono muted",style:{"font-size":"var(--fs-xs)"}},Ne={style:{display:"grid","grid-template-columns":"repeat(auto-fill, minmax(220px, 1fr))",gap:"8px"}},Ae=["onClick"],Re={class:"muted",style:{"font-size":"var(--fs-xs)","margin-top":"2px"}},Be={class:"stream-view-hd"},Ge={style:{"min-width":"0",flex:"1"}},Oe={class:"row",style:{gap:"8px"}},Fe={style:{"font-weight":"600","font-size":"15px","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"}},Ve={key:0,class:"live-pill"},We={class:"mono muted",style:{"font-size":"var(--fs-xs)","margin-top":"3px"}},He={class:"stream-view-body"},Ie={class:"player"},Ue={key:0,style:{position:"absolute",inset:"0",display:"grid","place-items":"center",color:"var(--text-2)","font-size":"13px"}},Ke={style:{"text-align":"center"}},je={class:"mono",style:{"font-size":"11px","margin-top":"6px"}},Xe={style:{"margin-top":"16px"}},qe={key:1,style:{position:"absolute",inset:"0",display:"grid","place-items":"center",color:"var(--text-2)","font-size":"13px"}},Je={style:{"text-align":"center"}},Qe={style:{"margin-top":"12px","font-weight":"600",color:"var(--text-1)","font-size":"15px"}},Ye={class:"mono",style:{"font-size":"11px","margin-top":"6px"}},Ze={style:{"margin-top":"16px"}},et={class:"label mono"},tt={class:"play"},st={class:"play-btn"},nt={class:"controls"},at={class:"mono",style:{"font-size":"11px"}},ot={class:"mono",style:{"font-size":"11px"}},it={style:{margin:"6px 0 8px","font-size":"22px","font-weight":"600","letter-spacing":"-0.015em"}},lt={class:"row",style:{gap:"6px"}},rt={key:0,class:"mono muted",style:{"font-size":"11px"}},dt={key:0,style:{"margin-top":"10px",height:"4px","border-radius":"999px",background:"var(--bg-3)",overflow:"hidden"}},ut={class:"card",style:{background:"var(--bg-2)",padding:"16px"}},vt={style:{"font-size":"var(--fs-sm)","line-height":"1.55",color:"var(--text-1)"}},pt={class:"card",style:{background:"var(--bg-2)",padding:"16px"}},ct={class:"kv-list"},gt={class:"v"},mt={class:"mono muted"},ht={class:"v"},ft={class:"v mono"},yt={class:"v mono"},_t={class:"v"},xt={class:"v mono"},wt={class:"v mono"},kt={key:1,style:{color:"var(--text-3)"}},bt={class:"v"},zt={class:"v"},St={class:"row",style:{gap:"8px"}},S=140,Et=ee({__name:"EPGDetailScreen",props:{id:{}},setup(X){const q=X,{tweaks:D}=oe(),g=I(()=>j.find(i=>i.id===q.id)||j[0]),N=ie.slice(0,12),r=U(0);function A(){const i=new Date;r.value=i.getHours()+i.getMinutes()/60}let C=null;V(()=>{A(),C=window.setInterval(A,6e4)}),W(()=>{C&&clearInterval(C)});const s=U(null);function R(i,t){s.value={channel:i,prog:t}}function M(){s.value=null}function c(i){const t=Math.floor(i),d=Math.round((i-t)*60);return String(t).padStart(2,"0")+":"+String(d).padStart(2,"0")}function E(i){const t=Math.floor(i),d=Math.round((i-t)*60);return t===0?`${d} min`:d===0?`${t} hr`:`${t} hr ${d} min`}function B(i){return i<1?Math.round(i*60)+" min":E(i)}const T=24*S,J=I(()=>"Today, "+new Date().toLocaleDateString(void 0,{weekday:"long",month:"short",day:"numeric"}));function G(i){i.key==="Escape"&&s.value&&M()}V(()=>window.addEventListener("keydown",G)),W(()=>window.removeEventListener("keydown",G));function m(i){return r.value>=i.start&&r.value<i.end?"live":r.value>=i.end?"past":"upcoming"}const Q={Live:"Live coverage with breaking updates, analysis and reports from correspondents on the ground.",News:"The latest national and international stories, plus business, sport, and a look at tomorrow's papers.",Documentary:"An in-depth feature on the world's most fascinating places, people, and events.",Lifestyle:"Fresh ideas for home, food, and travel — practical inspiration for everyday living.",Film:"A feature-length presentation. Cinematic storytelling with subtitles and audio description available.",Football:"Full match coverage with pre-match build-up, expert punditry, and post-match analysis.",Highlights:"The best moments and key plays condensed into a fast-paced roundup.",Comedy:"An evening of stand-up, sketches, and satire from familiar faces and rising stars.",Series:"The next instalment in our ongoing drama series. Contains scenes some viewers may find intense.",Music:"Back-to-back hits, exclusive sessions, and the latest releases from across the charts.",Kids:"Bright, friendly programming made just for younger viewers — learning through play.",Technology:"What's new in tech, gadgets, and software — reviews, deep-dives, and hands-on demos.",Discussion:"Panel conversation with guests dissecting the day's biggest stories.",Business:"Markets, deals, and the people moving them. Plus analysis from the trading floor.",Weather:"A full national outlook plus regional forecasts for the next 48 hours.","Game show":"Quick-fire rounds and big prizes — armchair contestants welcome.",Feature:"A standalone feature presentation tonight. Tune in for an unmissable story."};function O(i){return(K[i.id]||[]).filter(t=>t.end>=r.value-1).slice(0,6)}function F(i){return O(i).find(t=>r.value>=t.start&&r.value<t.end)}function Y(i){return K[i.id]||[]}return(i,t)=>(o(),v("div",re,[e("div",de,[e("div",{class:H(["src-ico",{builtin:g.value.builtin,"epg-builtin":g.value.builtin}]),style:{width:"52px",height:"52px","border-radius":"12px",color:"var(--good)"}},[a(_,{name:g.value.builtin?"tv":"epg",size:22},null,8,["name"])],2),e("div",ue,[e("div",ve,[e("h2",pe,n(g.value.name),1),a(te,{status:g.value.status,pulse:""},null,8,["status"]),g.value.builtin?(o(),x(h,{key:0,tone:"system"},{default:p(()=>[a(_,{name:"check",size:10}),t[1]||(t[1]=u("built-in",-1))]),_:1})):w("",!0),a(h,{tone:"cyan"},{default:p(()=>[u(n(g.value.interval),1)]),_:1})]),e("div",ce,n(g.value.url),1),g.value.builtin?(o(),v("div",ge," Ships with TVApp2 · guide data is preconfigured and auto-updated with the app. ")):w("",!0)]),e("div",me,[a(P,{label:"Channels",value:g.value.channels},null,8,["value"]),a(P,{label:"Programs",value:g.value.programs.toLocaleString()},null,8,["value"]),a(P,{label:"Synced",value:g.value.lastSync,small:""},null,8,["value"])]),g.value.builtin?w("",!0):(o(),x(f,{key:0,variant:"ghost",icon:"refresh"},{default:p(()=>[...t[2]||(t[2]=[u("Sync now",-1)])]),_:1}))]),e("div",he,[e("div",fe,[a(f,{variant:"ghost",size:"sm",icon:"chevron-l"}),a(h,{tone:"cyan"},{default:p(()=>[a(_,{name:"epg",size:11}),u(" "+n(J.value),1)]),_:1}),a(f,{variant:"ghost",size:"sm",icon:"chevron-r"}),a(le,{value:"",onChange:()=>{},placeholder:"Filter channels",width:220}),t[4]||(t[4]=e("span",{class:"spacer"},null,-1)),e("span",ye,[t[3]||(t[3]=u(" Now: ",-1)),e("span",_e,n(String(Math.floor(r.value)).padStart(2,"0"))+":"+n(String(Math.floor(r.value%1*60)).padStart(2,"0")),1)]),a(se,{value:b(D).epgMode,onChange:()=>{},options:[{value:"timeline",label:"Timeline",icon:"grid"},{value:"list",label:"List",icon:"list"}]},null,8,["value"])]),b(D).epgMode==="timeline"?(o(),v("div",xe,[e("div",we,[t[5]||(t[5]=e("div",{class:"head-l"},"Channel",-1)),e("div",{class:"head-r",style:y({width:T+"px"})},[(o(!0),v(k,null,z(b(ne).slice(0,24),d=>(o(),v("div",{key:d,class:"epg-time",style:y({width:S+"px"})},n(String(d).padStart(2,"0"))+":00 ",5))),128))],4)]),e("div",ke,[e("div",{style:y({width:200+T+"px"})},[(o(!0),v(k,null,z(b(N),d=>(o(),v("div",{key:d.id,class:"epg-row"},[e("div",be,[a(L,{ch:d},null,8,["ch"]),e("div",ze,[e("div",Se,n(d.tvg_name),1),e("div",Ce,"#"+n(d.channel),1)])]),e("div",{class:"epg-progs",style:y({width:T+"px"})},[(o(!0),v(k,null,z(Y(d),(l,$)=>(o(),v("div",{key:$,class:H(["epg-prog",{live:r.value>=l.start&&r.value<l.end}]),style:y({left:l.start*S+2+"px",width:(l.end-l.start)*S-4+"px"}),onClick:Z=>R(d,l),title:`${l.title} · ${c(l.start)}${c(l.end)}`},[e("div",Ee,n(l.title),1),e("div",Te,n(c(l.start))+""+n(c(l.end))+" · "+n(l.cat),1)],14,Me))),128)),e("div",{class:"now-line",style:y({left:r.value*S+"px"})},null,4)],4)]))),128))],4)])])):(o(),v("div",$e,[(o(!0),v(k,null,z(b(N),d=>(o(),v("div",{key:d.id,style:{"border-bottom":"1px solid var(--hairline)",padding:"14px var(--pad-card)"}},[e("div",Le,[a(L,{ch:d},null,8,["ch"]),e("div",null,[e("div",Pe,n(d.tvg_name),1),e("div",De,"#"+n(d.channel)+" · "+n(d.group),1)]),t[7]||(t[7]=e("span",{class:"spacer"},null,-1)),F(d)?(o(),x(h,{key:0,tone:"cyan"},{default:p(()=>[t[6]||(t[6]=e("span",{class:"dot good",style:{width:"6px",height:"6px"}},null,-1)),u("on now: "+n(F(d).title),1)]),_:2},1024)):w("",!0)]),e("div",Ne,[(o(!0),v(k,null,z(O(d),(l,$)=>(o(),v("div",{key:$,style:y({padding:"10px 12px",background:r.value>=l.start&&r.value<l.end?"var(--accent-soft)":"var(--bg-2)",border:"1px solid "+(r.value>=l.start&&r.value<l.end?"oklch(0.82 0.13 220 / 0.4)":"var(--hairline)"),borderRadius:"8px",cursor:"default"}),onClick:Z=>R(d,l)},[e("div",{class:"mono",style:y({fontSize:"var(--fs-xs)",color:r.value>=l.start&&r.value<l.end?"var(--accent-hi)":"var(--text-2)"})},n(c(l.start))+""+n(c(l.end)),5),e("div",{style:y({fontWeight:500,fontSize:"var(--fs-sm)",marginTop:"2px",color:r.value>=l.start&&r.value<l.end?"var(--accent-hi)":"var(--text-0)"})},n(l.title),5),e("div",Re,n(l.cat),1)],12,Ae))),128))])]))),128))]))]),s.value?(o(),v("div",{key:0,class:"stream-view-bg",onClick:M},[e("div",{class:"glass stream-view",onClick:t[0]||(t[0]=ae(()=>{},["stop"]))},[e("div",Be,[a(L,{ch:s.value.channel},null,8,["ch"]),e("div",Ge,[e("div",Oe,[e("span",Fe,n(s.value.channel.tvg_name),1),m(s.value.prog)==="live"?(o(),v("span",Ve,[...t[8]||(t[8]=[e("span",{class:"dot"},null,-1),u("LIVE",-1)])])):m(s.value.prog)==="upcoming"?(o(),x(h,{key:1,tone:"cyan"},{default:p(()=>[a(_,{name:"epg",size:11}),t[9]||(t[9]=u("upcoming",-1))]),_:1})):(o(),x(h,{key:2},{default:p(()=>[...t[10]||(t[10]=[u("aired",-1)])]),_:1}))]),e("div",We," #"+n(s.value.channel.channel)+" · "+n(s.value.channel.group)+" · "+n(s.value.channel.res),1)]),a(f,{variant:"ghost",size:"sm",icon:"x",onClick:M,title:"Close (Esc)"})]),e("div",He,[e("div",Ie,[m(s.value.prog)==="past"?(o(),v("div",Ue,[e("div",Ke,[a(_,{name:"epg",size:32}),t[12]||(t[12]=e("div",{style:{"margin-top":"12px","font-weight":"600",color:"var(--text-1)","font-size":"15px"}},"Programme has ended",-1)),e("div",je,"aired "+n(c(s.value.prog.start))+""+n(c(s.value.prog.end)),1),e("div",Xe,[a(f,{variant:"ghost",size:"sm",icon:"refresh"},{default:p(()=>[...t[11]||(t[11]=[u("Check on-demand",-1)])]),_:1})])])])):m(s.value.prog)==="upcoming"?(o(),v("div",qe,[e("div",Je,[a(_,{name:"epg",size:32}),e("div",Qe,"Starts at "+n(c(s.value.prog.start)),1),e("div",Ye,"in "+n(B(s.value.prog.start-r.value)),1),e("div",Ze,[a(f,{variant:"primary",size:"sm",icon:"add"},{default:p(()=>[...t[13]||(t[13]=[u("Set reminder",-1)])]),_:1})])])])):(o(),v(k,{key:2},[t[15]||(t[15]=e("div",{class:"stripes"},null,-1)),e("div",et,n(s.value.channel.res)+" · LIVE",1),e("div",tt,[e("div",st,[a(_,{name:"play",size:28})])]),e("div",nt,[a(_,{name:"pause",size:14}),e("span",at,n(c(r.value)),1),t[14]||(t[14]=e("div",{class:"track"},null,-1)),e("span",ot,n(c(s.value.prog.end)),1)])],64))]),e("div",null,[e("div",{class:"muted mono",style:y({fontSize:"10.5px",letterSpacing:"0.08em",textTransform:"uppercase",fontWeight:600,color:m(s.value.prog)==="live"?"var(--accent-hi)":"var(--text-2)"})},n(m(s.value.prog)==="live"?"ON NOW":m(s.value.prog)==="upcoming"?"UP NEXT":"EARLIER TODAY")+" · "+n(s.value.prog.cat),5),e("h2",it,n(s.value.prog.title),1),e("div",lt,[a(h,{tone:"cyan"},{default:p(()=>[a(_,{name:"epg",size:11}),u(n(c(s.value.prog.start))+""+n(c(s.value.prog.end)),1)]),_:1}),a(h,null,{default:p(()=>[u(n(E(s.value.prog.end-s.value.prog.start)),1)]),_:1}),a(h,null,{default:p(()=>[u(n(s.value.prog.cat),1)]),_:1}),t[16]||(t[16]=e("span",{class:"spacer"},null,-1)),m(s.value.prog)==="live"?(o(),v("span",rt,n(Math.round(Math.min(1,Math.max(0,(r.value-s.value.prog.start)/(s.value.prog.end-s.value.prog.start)))*100))+"% elapsed · "+n(B(s.value.prog.end-r.value))+" left ",1)):w("",!0)]),m(s.value.prog)==="live"?(o(),v("div",dt,[e("div",{style:y({height:"100%",width:Math.min(1,Math.max(0,(r.value-s.value.prog.start)/(s.value.prog.end-s.value.prog.start)))*100+"%",background:"var(--accent)",boxShadow:"0 0 12px var(--accent)"})},null,4)])):w("",!0)]),e("div",ut,[e("div",vt,n(Q[s.value.prog.cat]||"A scheduled programme on this channel."),1)]),e("div",pt,[t[28]||(t[28]=e("div",{style:{"font-size":"var(--fs-sm)","font-weight":"600","margin-bottom":"12px"}},"Programme details",-1)),e("div",ct,[t[19]||(t[19]=e("div",{class:"k"},"Channel",-1)),e("div",gt,[u(n(s.value.channel.tvg_name)+" ",1),e("span",mt,"· #"+n(s.value.channel.channel),1)]),t[20]||(t[20]=e("div",{class:"k"},"Group",-1)),e("div",ht,n(s.value.channel.group),1),t[21]||(t[21]=e("div",{class:"k"},"Time",-1)),e("div",ft,n(c(s.value.prog.start))+" "+n(c(s.value.prog.end)),1),t[22]||(t[22]=e("div",{class:"k"},"Duration",-1)),e("div",yt,n(E(s.value.prog.end-s.value.prog.start)),1),t[23]||(t[23]=e("div",{class:"k"},"Category",-1)),e("div",_t,n(s.value.prog.cat),1),t[24]||(t[24]=e("div",{class:"k"},"Resolution",-1)),e("div",xt,n(s.value.channel.res),1),t[25]||(t[25]=e("div",{class:"k"},"TVG-ID",-1)),e("div",wt,[s.value.channel.tvg_id?(o(),v(k,{key:0},[u(n(s.value.channel.tvg_id),1)],64)):(o(),v("span",kt,"—"))]),t[26]||(t[26]=e("div",{class:"k"},"Source",-1)),e("div",bt,[a(h,{tone:"cyan"},{default:p(()=>[u(n(s.value.channel.source),1)]),_:1})]),t[27]||(t[27]=e("div",{class:"k"},"EPG match",-1)),e("div",zt,[s.value.channel.epg==="matched"?(o(),x(h,{key:0,tone:"good"},{default:p(()=>[a(_,{name:"check",size:11}),t[17]||(t[17]=u("matched",-1))]),_:1})):(o(),x(h,{key:1,tone:"warn"},{default:p(()=>[...t[18]||(t[18]=[u("unmatched",-1)])]),_:1}))])])]),e("div",St,[m(s.value.prog)==="upcoming"?(o(),x(f,{key:0,variant:"primary",icon:"add"},{default:p(()=>[...t[29]||(t[29]=[u("Set reminder",-1)])]),_:1})):w("",!0),m(s.value.prog)==="live"?(o(),x(f,{key:1,variant:"primary",icon:"play"},{default:p(()=>[...t[30]||(t[30]=[u("Watch live",-1)])]),_:1})):w("",!0),m(s.value.prog)==="past"?(o(),x(f,{key:2,variant:"ghost",icon:"refresh"},{default:p(()=>[...t[31]||(t[31]=[u("Check catch-up",-1)])]),_:1})):w("",!0),a(f,{variant:"ghost",icon:"tv"},{default:p(()=>[...t[32]||(t[32]=[u("Open channel",-1)])]),_:1}),a(f,{variant:"ghost",icon:"epg"},{default:p(()=>[...t[33]||(t[33]=[u("Channel guide",-1)])]),_:1}),t[34]||(t[34]=e("span",{class:"spacer"},null,-1)),a(f,{variant:"ghost",icon:"more"})])])])])):w("",!0)]))}});export{Et as default};