PageSourceSearch

https://cocreataz.co.za/static/js/6508.90e754a4.chunk.js

js cocreataz.co.za collected 2026-10-07 23:21:53 UTC 13,812 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkonline||=[]).push([[6508],{6508(e,s,t){t.r(s),t.d(s,{default:()=>h});var a=t(9950),i=t(28429),r=t(72139),n=t(27782),l=t(44414);const o=e=>{let{stationId:s,stationSlug:t}=e;const[i,n]=(0,a.useState)([]),[o,c]=(0,a.useState)(!0),[d,h]=(0,a.useState)(null),[m,u]=(0,a.useState)(new Date),[g,x]=(0,a.useState)("day"),v=(0,r.d4)(e=>e.theme&&e.theme.currentTheme?e.theme.currentTheme:localStorage.getItem("theme")||"light"),[p]=(0,a.useState)(()=>function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7;const t=[];for(let a=0;a<s;a++){const s=new Date(e);s.setDate(e.getDate()+a),t.push(s)}return t}(new Date,7));(0,a.useEffect)(()=>{j()},[s,m]);const j=async()=>{try{c(!0),h(null);m.toISOString().split("T")[0];const e=[{id:1,program_name:"Morning Drive",description:"Start your day with the best music and entertainment",start_time:"06:00",end_time:"10:00",host:"Alex Johnson",category:"Music",is_live:!0,image:"https://via.placeholder.com/80x80"},{id:2,program_name:"Coffee Talk",description:"Relaxing conversation and smooth jazz",start_time:"10:00",end_time:"12:00",host:"Sarah Williams",category:"Talk",is_live:!1,image:"https://via.placeholder.com/80x80"},{id:3,program_name:"Lunch Hour Hits",description:"Top 40 hits to energize your afternoon",start_time:"12:00",end_time:"14:00",host:"Mike Chen",category:"Music",is_live:!1,image:"https://via.placeholder.com/80x80"},{id:4,program_name:"Afternoon Drive",description:"The perfect soundtrack for your commute home",start_time:"14:00",end_time:"18:00",host:"Emma Davis",category:"Music",is_live:!1,image:"https://via.placeholder.com/80x80"},{id:5,program_name:"Evening Vibes",description:"Chill out with smooth evening tunes",start_time:"18:00",end_time:"22:00",host:"Ryan Martinez",category:"Music",is_live:!1,image:"https://via.placeholder.com/80x80"},{id:6,program_name:"Late Night Jazz",description:"Smooth jazz for late night listeners",start_time:"22:00",end_time:"02:00",host:"Lisa Thompson",category:"Jazz",is_live:!1,image:"https://via.placeholder.com/80x80"}];setTimeout(()=>{n(e),c(!1)},1e3)}catch(e){h("Failed to load program guide"),c(!1)}},N=()=>{const e=(new Date).toTimeString().slice(0,5);return i.find(s=>{const t=s.start_time,a=s.end_time;return a<t?e>=t||e<a:e>=t&&e<a})},k=e=>{const[s,t]=e.split(":"),a=new Date;return a.setHours(parseInt(s),parseInt(t)),a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},b=e=>{const s=N();return s&&s.id===e.id};return o?(0,l.jsxs)("div",{className:"epg-container",children:[(0,l.jsx)("div",{className:"epg-header",children:(0,l.jsx)("h3",{children:"Program Guide"})}),(0,l.jsx)("div",{className:"epg-loading",children:Array.from({length:6}).map((e,s)=>(0,l.jsxs)("div",{className:"epg-program-skeleton",children:[(0,l.jsx)("div",{className:"skeleton-image"}),(0,l.jsxs)("div",{className:"skeleton-content",children:[(0,l.jsx)("div",{className:"skeleton-title"}),(0,l.jsx)("div",{className:"skeleton-description"}),(0,l.jsx)("div",{className:"skeleton-time"})]})]},s))})]}):d?(0,l.jsxs)("div",{className:"epg-container",children:[(0,l.jsx)("div",{className:"epg-header",children:(0,l.jsx)("h3",{children:"Program Guide"})}),(0,l.jsxs)("div",{className:"epg-error",children:[(0,l.jsx)("p",{children:d}),(0,l.jsx)("button",{onClick:j,className:"retry-button",children:"Try Again"})]})]}):(0,l.jsxs)("div",{className:"epg-container "+("dark"===v?"dark-theme":""),children:[(0,l.jsxs)("div",{className:"epg-header",children:[(0,l.jsx)("h3",{children:"Program Guide"}),(0,l.jsx)("div",{className:"epg-date-nav",children:p.map((e,s)=>{const t=e.toDateString()===m.toDateString(),a=e.toDateString()===(new Date).toDateString();return(0,l.jsxs)("button",{className:`date-nav-button ${t?"selected":""} ${a?"today":""}`,onClick:()=>u(e),children:[(0,l.jsx)("span",{className:"date-day",children:e.getDate()}),(0,l.jsx)("span",{className:"date-weekday",children:e.toLocaleDateString("en-US",{weekday:"short"})})]},s)})})]}),N()&&(0,l.jsxs)("div",{className:"current-program-highlight",children:[(0,l.jsxs)("div",{className:"live-indicator",children:[(0,l.jsx)("span",{className:"live-dot"}),"NOW PLAYING"]}),(0,l.jsxs)("div",{className:"current-program-info",children:[(0,l.jsx)("h4",{children:N().program_name}),(0,l.jsx)("p",{children:N().description}),(0,l.jsxs)("span",{className:"program-host",children:["with ",N().host]})]})]}),(0,l.jsxs)("div",{className:"epg-schedule",children:[(0,l.jsx)("div",{className:"schedule-date-header",children:(0,l.jsxs)("h4",{children:["Schedule for ",(y=m,y.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}))]})}),(0,l.jsx)("div",{className:"program-list",children:i.map(e=>(0,l.jsxs)("div",{className:"epg-program "+(b(e)?"current-program":""),children:[(0,l.jsxs)("div",{className:"program-time",children:[(0,l.jsx)("span",{className:"start-time",children:k(e.start_time)}),(0,l.jsx)("span",{className:"time-separator",children:"-"}),(0,l.jsx)("span",{className:"end-time",children:k(e.end_time)})]}),(0,l.jsxs)("div",{className:"program-image",children:[(0,l.jsx)("img",{src:e.image,alt:e.program_name,onError:e=>{e.target.src="https://via.placeholder.com/80x80?text=Program"}}),b(e)&&(0,l.jsx)("div",{className:"live-overlay",children:(0,l.jsx)("span",{className:"live-text",children:"LIVE"})})]}),(0,l.jsxs)("div",{className:"program-details",children:[(0,l.jsx)("h5",{className:"program-title",children:e.program_name}),(0,l.jsx)("p",{className:"program-description",children:e.description}),(0,l.jsxs)("div",{className:"program-meta",children:[(0,l.jsxs)("span",{className:"program-host",children:["Host: ",e.host]}),(0,l.jsx)("span",{className:"program-category",children:e.category})]})]}),b(e)&&(0,l.jsx)("div",{className:"current-indicator",children:(0,l.jsx)("div",{className:"pulse-dot"})})]},e.id))})]})]});var y};var c=t(81758),d=(t(25307),t(90813));const h=()=>{const{stationslug:e}=(0,i.g)(),s=(0,i.Zp)(),t=(0,r.wA)(),h=(0,r.d4)(e=>{if(e.auth&&e.auth.user)return e.auth.user;const s=(0,c.Gq)("user_id");return s?{id:s}:null}),m=(0,r.d4)(e=>e.theme&&e.theme.currentTheme?e.theme.currentTheme:localStorage.getItem("theme")||"light"),[u,g]=(0,a.useState)(null),[x,v]=(0,a.useState)(!0),[p,j]=(0,a.useState)(null),[N,k]=(0,a.useState)(!1),[b,y]=(0,a.useState)(!1),{currentPlaying:_,currentAudio:S,actionType:f}=(0,r.d4)(e=>{var s,t,a;return{currentPlaying:(null===(s=e.get_current_Reducers)||void 0===s?void 0:s.currentPlaying)||!1,currentAudio:(null===(t=e.get_current_Reducers)||void 0===t?void 0:t.currentAudio)||null,actionType:(null===(a=e.get_current_Reducers)||void 0===a?void 0:a.actionType)||null}}),w=_&&S&&"RADIO"===S.source_type&&"STATION"===f&&S.station_data&&S.station_data.id===(null===u||void 0===u?void 0:u.id),[L,C]=(0,a.useState)("overview");(0,a.useEffect)(()=>
1{e&&!b&&T()},[e]);const T=async()=>{if(!b)try{v(!0),j(null),y(!0);const s=await n.mk.getStationDetails(e);s.success&&s.data?(g(s.data),k(s.data.is_liked||!1)):j("Station not found")}catch(s){j("Failed to load station details"),console.error("Station details error:",s)}finally{v(!1)}},D=()=>{var e;return(0,l.jsxs)("div",{className:"station-info-content",children:[(0,l.jsxs)("div",{className:"station-stats",children:[(0,l.jsxs)("div",{className:"stat-item",children:[(0,l.jsx)("span",{className:"stat-label",children:"Listeners"}),(0,l.jsx)("span",{className:"stat-value",children:(null===(e=u.listener_count)||void 0===e?void 0:e.toLocaleString())||"0"})]}),(0,l.jsxs)("div",{className:"stat-item",children:[(0,l.jsx)("span",{className:"stat-label",children:"Genre"}),(0,l.jsx)("span",{className:"stat-value",children:u.category||"Music"})]}),(0,l.jsxs)("div",{className:"stat-item",children:[(0,l.jsx)("span",{className:"stat-label",children:"Language"}),(0,l.jsx)("span",{className:"stat-value",children:u.language||"English"})]}),(0,l.jsxs)("div",{className:"stat-item",children:[(0,l.jsx)("span",{className:"stat-label",children:"Location"}),(0,l.jsx)("span",{className:"stat-value",children:u.location||"Global"})]})]}),(0,l.jsxs)("div",{className:"station-description",children:[(0,l.jsxs)("h4",{children:["About ",u.title]}),(0,l.jsx)("p",{children:u.description||"No description available."}),u.website_url&&(0,l.jsx)("div",{className:"station-links",children:(0,l.jsx)("a",{href:u.website_url,target:"_blank",rel:"noopener noreferrer",className:"station-website-link",children:"Visit Website"})})]})]})};return x?(0,l.jsx)("div",{className:"radio-station-detail "+("dark"===m?"dark-theme":""),children:(0,l.jsx)("div",{className:"station-detail-loading",children:(0,l.jsxs)("div",{className:"station-header-skeleton",children:[(0,l.jsx)("div",{className:"skeleton-image large"}),(0,l.jsxs)("div",{className:"skeleton-content",children:[(0,l.jsx)("div",{className:"skeleton-title large"}),(0,l.jsx)("div",{className:"skeleton-description"}),(0,l.jsx)("div",{className:"skeleton-buttons"})]})]})})}):p||!u?(0,l.jsx)("div",{className:"radio-station-detail "+("dark"===m?"dark-theme":""),children:(0,l.jsx)("div",{className:"station-detail-error",children:(0,l.jsxs)("div",{className:"error-content",children:[(0,l.jsx)("h2",{children:"Station Not Found"}),(0,l.jsx)("p",{children:p||"The requested radio station could not be found."}),(0,l.jsxs)("div",{className:"error-actions",children:[(0,l.jsx)("button",{onClick:()=>s("/music/radio"),className:"back-to-stations-btn",children:"Back to Radio Stations"}),(0,l.jsx)("button",{onClick:T,className:"retry-btn",children:"Try Again"})]})]})})}):(0,l.jsxs)("div",{className:"radio-station-detail "+("dark"===m?"dark-theme":""),children:[(0,l.jsxs)("div",{className:"station-detail-header",children:[(0,l.jsxs)("button",{className:"back-button",onClick:()=>s("/music/radio"),children:[(0,l.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,l.jsx)("path",{d:"M19 12H5M12 19L5 12L12 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),"Back to Stations"]}),(0,l.jsxs)("div",{className:"station-header-content",children:[(0,l.jsxs)("div",{className:"station-image-container",children:[(0,l.jsx)("img",{src:u.image,alt:u.title,className:"station-detail-image",onError:e=>{e.target.src="https://via.placeholder.com/200x200?text=Radio+Station"}}),u.is_live&&(0,l.jsxs)("div",{className:"live-badge",children:[(0,l.jsx)("span",{className:"live-dot"}),"LIVE"]})]}),(0,l.jsxs)("div",{className:"station-header-info",children:[(0,l.jsx)("h1",{className:"station-title",children:u.title}),(0,l.jsx)("p",{className:"station-subtitle",children:u.description}),(0,l.jsxs)("div",{className:"station-actions",children:[(0,l.jsx)("button",{className:"play-button "+(w?"playing":""),onClick:()=>{if(u)if(w)t((0,d.AQ)());else{const e="ppv"===u.access||"paid"===u.access,a=(0,c.Gq)("user_id"),i=parseInt((0,c.Gq)("role"),10);if(e&&!a)return void s("/login");if(e&&a){if(!(1===i||2===i))return void s("/plan")}t((0,d.ms)(u)),h&&n.mk.recordActivity(u.id,"play")}},children:w?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[(0,l.jsx)("rect",{x:"6",y:"4",width:"4",height:"16",fill:"currentColor"}),(0,l.jsx)("rect",{x:"14",y:"4",width:"4",height:"16",fill:"currentColor"})]}),"Pause"]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,l.jsx)("polygon",{points:"5,3 19,12 5,21",fill:"currentColor"})}
1),"Play Live"]})}),(0,l.jsxs)("button",{className:"like-button "+(N?"liked":""),onClick:async()=>{if(u&&h)try{(await n.mk.toggleLike(u.id,!N)).success&&k(!N)}catch(p){console.error("Failed to toggle like:",p)}},disabled:!h,children:[(0,l.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,l.jsx)("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:N?"currentColor":"none"})}),N?"Liked":"Like"]}),(0,l.jsxs)("button",{className:"share-button",onClick:async()=>{if(!u)return;const e={title:u.title,text:`Listen to ${u.title} - ${u.description}`,url:window.location.href};try{navigator.share?await navigator.share(e):(await navigator.clipboard.writeText(e.url),alert("Station link copied to clipboard!"))}catch(p){console.error("Error sharing:",p)}},children:[(0,l.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[(0,l.jsx)("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("polyline",{points:"16,6 12,2 8,6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),"Share"]})]})]})]})]}),(0,l.jsxs)("div",{className:"station-detail-tabs",children:[(0,l.jsx)("button",{className:"tab-button "+("overview"===L?"active":""),onClick:()=>C("overview"),children:"Overview"}),(0,l.jsx)("button",{className:"tab-button "+("schedule"===L?"active":""),onClick:()=>C("schedule"),children:"Schedule"}),(0,l.jsx)("button",{className:"tab-button "+("about"===L?"active":""),onClick:()=>C("about"),children:"About"})]}),(0,l.jsxs)("div",{className:"station-detail-content",children:["overview"===L&&(0,l.jsxs)("div",{className:"overview-tab",children:[D(),(0,l.jsx)("div",{className:"current-program-section",children:(0,l.jsx)(o,{stationId:u.id,stationSlug:u.slug})})]}),"schedule"===L&&(0,l.jsx)("div",{className:"schedule-tab",children:(0,l.jsx)(o,{stationId:u.id,stationSlug:u.slug})}),"about"===L&&(0,l.jsx)("div",{className:"about-tab",children:D()})]})]})}},25307(){}}]);

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.