1const __vite__fileDeps=["v11.1_Live/js/bootstrap.esm.CM5XnmO5.js","v11.1_Live/js/index.DQe_go6b.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); 2import{A as le,u as ie,g as ne,e as l,h as F,j as re,H as de,z as ce,k as me,o as n,c as m,a as o,l as C,q as S,m as f,p as z,v as U,t as H,x as ue,y as pe,F as ve,I as ye}from"./index.0asgyqvA.js";import{_ as he}from"./Breadcrumbs.4NbLsz_b.js";import{S as fe}from"./SkeletonLoader.dvqrKKUo.js";import{E as ge}from"./ErrorHandling.BxheY8y_.js";import{_ as be}from"./FCNavbarDefault.B7su0b1r.js";import{E as _e}from"./EpisodePlayer.BRfbWF3l.js";import{a as q,u as Ee,r as A}from"./metaUtils.ipqBNsLl.js";import"./_commonjsHelpers.BosuxZz1.js";const Pe={class:"container position-relative top-0"},Me={class:"row"},we={class:"col-12"},Ie={class:"card card-body shadow-blur mx-3 mx-md-4 mt-8"},Fe={class:"container"},Ce={class:"row mx-1 mt-3 mb-4"},Se={class:"col-12"},xe={id:"main",ref:"main"},Ne={key:1,class:"row mx-1 mt-3 mb-4"},Te={key:1,class:"col-12 episode-page"},ke={class:"episode-image-wrapper"},De=["src","alt"],Be=["innerHTML"],Ve={key:1,class:"programme-description my-custom-desc"},Le={key:0,class:"video-container"},$e={class:"modal fade",id:"videoModal",tabindex:"-1","aria-labelledby":"videoModalLabel","aria-hidden":"true"},ze={class:"modal-dialog modal-dialog-centered modal-lg"},Ue={class:"modal-content bg-dark"},He={class:"modal-header border-0"},qe={class:"modal-title text-white",id:"videoModalLabel"},Ae="https://ondemand.accessmedia.nz",Qe=le({__name:"Episode",setup(Oe){const t=ie(),x=ne(),y=l(()=>x.params.EID),c=F(!1),h=l(()=>t.selectedStation),u=l(()=>t.selectedProgramme),s=l(()=>t.selectedEpisode),N=l(()=>t.episodes??[]),g=l(()=>t.selectedEpisode.Programme??""),O=l(()=>t.selectedProgramme.Station??""),b=F(!1),p=F(null),_=l(()=>{const a=s.value?.SupplementaryFiles;return a?Array.isArray(a)?a:[a]:[]}),j=a=>{const e=Number(a);return isNaN(e)||e===0?"":e<1024?e+" B":e<1048576?(e/1024).toFixed(1)+" KB":(e/1048576).toFixed(1)+" MB"},R=l(()=>!!(h.value&&u.value&&s.value&&N.value?.length)),T=a=>{const e=t.selectedStation?.Folder;if(!e||!a?.MediaFile)return"";const i=`/StationFolder/${e}/`;return`${Ae}${i}${a.MediaFile}`.replace(/ /g,"%20")},k=a=>typeof a=="string"&&a.toLowerCase().endsWith(".mp4"),W=a=>{a&&(k(a?.MediaFile)?Z(a):V(a))},G=()=>{setTimeout(()=>{const a=document.getElementById("vid-player-section");a&&a.scrollIntoView({behavior:"smooth"})},300)},D=l(()=>!!s.value?.VideoFileUrl),X=l(()=>q(s.value?.VideoFileUrl||"")),J=l(()=>s.value?.MediaFile?s.value:{...s.value,PublishDate:"2000-01-01T00:00:00"}),B=l(()=>s.value?.HTMLDescription||null),K=a=>{const e=T(a);e&&(t.setCurrentEpisode({...a,url:e,type:k(a?.MediaFile)?"video/mp4":"audio/mp3"},!0),t.isPlaying=!0,t.showMainPlayer=!0,t.showFooterPlayer=!1,G())},V=a=>{const e=T(a);e&&(t.setFooterCurrentEpisode({...a,url:e,ProgrammeId:a.Programme,type:"audio/mp3"},!0),t.isPlaying=!0,t.showMainPlayer=!1,t.showFooterPlayer=!0)},Y=()=>{p.value&&K(p.value)},Q=()=>{p.value&&V(p.value)};let E=null;const L=async()=>(E||(E=(await ye(()=>import("./bootstrap.esm.CM5XnmO5.js"),__vite__mapDeps([0,1]))).Modal),E),Z=async a=>{p.value=a;const e=document.getElementById("playModal");if(!e)return;(await L()).getOrCreateInstance(e).show()};re(async()=>{t.showMainPlayer=!1,t.autoplay=!1;const a=document.getElementById("videoModal");a&&(a.addEventListener("show.bs.modal",()=>{const e=a.querySelector("video");e&&(e.src=X.value,e.play())}),a.addEventListener("hide.bs.modal",()=>{const e=a.querySelector("video");e&&(e.pause(),e.src="",e.load())}));try{c.value=!0,await $()}catch(e){console.error("Error fetching programme data:",e)}finally{c.value=!1}}),de(()=>{t.selectedEpisode={},t.episodes=[],t.selectedProgramme=null}),ce(()=>x.params.EID,async(a,e)=>{a!==e&&(t.showMainPlayer=!1,t.autoplay=!1,await $())});const ee=()=>{!D.value&&!_.value.length||setTimeout(()=>{const a=document.querySelector(".episode-page .default-footer");if(a){if(D.value&&!a.querySelector(".watch-video-btn")){const e=document.createElement("button");e.className="watch-video-btn",e.innerHTML='<i class="material-icons" style="font-size:16px;vertical-align:middle;">videocam</i> Watch Video',e.addEventListener("click",()=>{const i=document.getElementById("videoModal");i&&L().then(v=>v.getOrCreateInstance(i).show())}),a.appendChild(e)}if(_.value.length&&!document.querySelector(".episode-page .supplementary-files-section")){const e=document.querySelector(".episode-page .episode-item");if(e){const i=document.createElement("div");i.className="supplementary-files-section";const v=document.createElement("h4");v.textContent="Downloads",i.appendChild(v);const P=document.createElement("div");P.className="supplementary-row";const ae={PDF:"picture_as_pdf",DOC:"description",DOCX:"description",TXT:"article",JPG:"image",PNG:"image",MP3:"audio_file",MP4:"videocam"};_.value.forEach(r=>{const te=q(r.Url),oe=r.FileName||r.Title||"download",se=ae[r.ContentType?.toUpperCase()]||"attach_file",d=document.createElement("a");d.href=te,d.className="supplementary-item",d.target="_blank",d.rel="noopener noreferrer";const M=document.createElement("i");M.className="material-icons",M.textContent=se,d.appendChild(M);const w=document.createElement("span");if(w.className="supplementary-name",w.textContent=r.Title||r.FileName||oe,d.appendChild(w),r.FileSize){const I=document.createElement("span");I.className="supplementary-size",I.textContent=`(${j(r.FileSize)})`,d.appendChild(I)}P.appendChild(d)}),i.appendChild(P),e.appendChild(i)}}}},500)},$=async()=>{c.value=!0;try{y.value.length===36&&y.value!="00000000-0000-0000-0000-000000000000"?await t.fetchEpisodeById(y.value).then(async()=>
2{if(g.value)await t.fetchProgrammeById(g.value),await t.fetchStationById(O.value),await t.fetchProgrammeEpisodes(g.value);else{console.log("No programme ID");return}}):b.value=!0}catch(a){b.value=!0,console.error("Error fetching programme data:",a)}finally{c.value=!1}Ee({title:`${s.value.Title||"accessmedia.nz Programme Page"}`,description:`${s.value.Short_Description||""}`,image:A(s.value.EpisodeImageUrl)||`https://images.accessmedia.nz/StationFolder/${h?.value.Folder}/Images/${u?.value.Image}`}),ee()};return(a,e)=>{const i=me("EpisodeItem");return n(),m(ve,null,[o("div",Pe,[o("div",Me,[o("div",we,[C(be,{transparent:""})])])]),o("div",Ie,[o("div",Fe,[o("div",Ce,[o("div",Se,[o("a",xe,null,512),C(he,{routes:[{label:"Home",route:"/"},{label:"Programmes",route:"/programmes"},{label:"Episode Details",route:"/"}]})])]),b.value?(n(),S(ge,{key:0,type:"Episode"})):(n(),m("div",Ne,[c.value?(n(),S(fe,{key:0,rows:8,layout:"page"})):(n(),m("div",Te,[!c.value&&R.value?(n(),S(i,{key:y.value,station:h.value,programme:u.value,selectedEpisode:J.value,episodes:N.value,loading:c.value,routerSearch:"search",routerEpisode:"episode",routerProgramme:{name:"programme-page",params:{PID:u.value?.ID}},onPlayEpisode:W},{image:f(()=>[o("div",ke,[o("img",{src:z(A)(s.value?.EpisodeImageUrl)||`https://images.accessmedia.nz/StationFolder/${h.value?.Folder}/Images/${u.value?.Image}`.replace(/ /g,"%20"),alt:s.value?.Title,class:"episode-image"},null,8,De)])]),description:f(()=>[B.value?(n(),m("div",{key:0,class:"programme-description my-custom-desc",innerHTML:B.value},null,8,Be)):(n(),m("p",Ve,H(s.value?.Description||"No description available."),1))]),footer:f(()=>e[0]||(e[0]=[])),"video-player":f(()=>[z(t).showMainPlayer?(n(),m("div",Le,[C(_e,{class:"videoPlayer",audioOnlyMode:!1})])):U("",!0)]),_:1},8,["station","programme","selectedEpisode","episodes","loading","routerProgramme"])):U("",!0)]))]))])]),o("div",$e,[o("div",ze,[o("div",Ue,[o("div",He,[o("h5",qe,[e[1]||(e[1]=o("i",{class:"material-icons",style:{"vertical-align":"middle"}},"videocam",-1)),ue(" "+H(s.value?.Title),1)]),e[2]||(e[2]=o("button",{type:"button",class:"btn-close btn-close-white","data-bs-dismiss":"modal","aria-label":"Close",style:{opacity:"1",filter:"brightness(2)"}},null,-1))]),e[3]||(e[3]=o("div",{class:"modal-body p-0"},[o("video",{id:"supplementaryVideo",controls:"",style:{width:"100%","border-radius":"0 0 0.3rem 0.3rem","max-height":"500px"}})],-1))])])]),o("div",{class:"modal fade",id:"playModal",tabindex:"-1","aria-labelledby":"playModalLabel","aria-hidden":"true"},[o("div",{class:"modal-dialog modal-dialog-centered"},[o("div",{class:"modal-content"},[e[4]||(e[4]=pe('<div class="modal-header"><h5 class="modal-title" id="playModalLabel">Play Episode</h5><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body"><p class="mt-4"> This episode contains video.<br> You can choose to play the video <b>or</b> play the audio only.<br><b>Note:</b> Video will only play on this page. If you move away, video stops. Audio continues in the footer player. </p></div>',2)),o("div",{class:"modal-footer justify-content-between"},[o("button",{class:"btn btn-primary ms-0","data-bs-dismiss":"modal",onClick:Y},"Play video"),o("button",{class:"btn btn-dark me-0","data-bs-dismiss":"modal",onClick:Q},"Play audio")])])])])],64)}}});export{Qe as default};
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.