1import{q as ee,X as se,Y as te,r as h,j as e,L as T,h as re,S as I,B as O,i as $,O as ae,J as oe,E as le,R,Z as ne,$ as ie,a0 as de,a1 as ce,a2 as me,K as xe,a3 as he,s as A,a4 as pe}from"./index-BvsqCpEz.js";import{R as ue}from"./ReplayPlayer-CImKQLks.js";import{g as ge,m as fe,H as be,p as _e}from"./replay-urls-uoaS0p7w.js";import{A as ye}from"./arrow-left-DasGo8Zs.js";import{U as W,M as je}from"./user-DLmK3dAG.js";import{F as we}from"./facebook-D-E6vCXF.js";import{C as H}from"./calendar-days-BHUEDn62.js";import{C as Ne}from"./chevron-left-DdeOtDWg.js";import{C as ke}from"./chevron-right-CPI6eVSm.js";import"./dropdown-menu-DO9fT12w.js";import"./index-5yHiP4fM.js";import"./check-B97Uezjq.js";import"./pause-BSClxgvH.js";import"./download-0HDG1NIG.js";import"./list-ordered-BY2yW7CF.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ve=ee("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]),Se=({plans:g})=>{const f=h.useRef(null),b=m=>{const d=f.current;d&&d.scrollBy({left:m*Math.max(280,d.clientWidth*.7),behavior:"smooth"})};return e.jsxs("section",{className:"mb-12",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsxs("h2",{className:"font-display text-2xl font-bold text-foreground flex items-center gap-2",children:[e.jsx(H,{className:"h-6 w-6 text-primary"})," Looking ahead"]}),e.jsxs("div",{className:"ml-auto hidden sm:flex gap-1",children:[e.jsx("button",{type:"button",onClick:()=>b(-1),className:"h-9 w-9 rounded-full border border-border bg-card hover:bg-muted flex items-center justify-center transition-colors","aria-label":"Scroll left",children:e.jsx(Ne,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>b(1),className:"h-9 w-9 rounded-full border border-border bg-card hover:bg-muted flex items-center justify-center transition-colors","aria-label":"Scroll right",children:e.jsx(ke,{className:"h-4 w-4"})})]})]}),e.jsx("div",{ref:f,className:"flex gap-4 overflow-x-auto pb-3 -mx-1 px-1 snap-x snap-mandatory scroll-smooth",style:{scrollbarWidth:"thin"},children:g.map(m=>{var s;const d=new Date(m.air_date+"T00:00:00");return e.jsxs("article",{className:"snap-start flex-shrink-0 w-[280px] sm:w-[320px] bg-card border border-border rounded-2xl p-5 hover:border-primary/40 transition-colors",children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-3",children:[e.jsx("span",{className:"font-display text-3xl font-bold text-primary leading-none",children:d.toLocaleDateString("en-AU",{day:"numeric"})}),e.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:d.toLocaleDateString("en-AU",{month:"short"})}),e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80 ml-auto",children:d.toLocaleDateString("en-AU",{weekday:"short"})})]}),(s=m.blurb)!=null&&s.trim()?e.jsx("p",{className:"text-sm text-foreground/85 leading-relaxed whitespace-pre-line line-clamp-6",children:m.blurb}):e.jsx("p",{className:"text-xs text-muted-foreground/70 italic",children:"Details coming soon."})]},m.id)})})]})},Ie=()=>{var U,z;const{slug:g}=se(),f=te(),b=f.state??{},m=b.from??"/program-guide",d=b.fromLabel??"Back to Program Guide",[s,G]=h.useState(null),[B,V]=h.useState([]),[C,Y]=h.useState([]),[o,Z]=h.useState(null),[M,J]=h.useState([]),[K,q]=h.useState(!0);if(h.useEffect(()=>{(async()=>{var x;if(!g){q(!1);return}const{data:r,error:n}=await A.from("shows").select("*").eq("slug",g).eq("archived",!1).single();if(n&&console.error("Failed to load show",n),r){const c={...r,description:r.description??"",image_url:r.image_url,day_of_week:r.day_of_week??"",start_time:r.start_time??"",end_time:r.end_time??"",replay_enabled:r.replay_enabled??!1,replay_hourly_split:r.replay_hourly_split??!1,vacant:r.vacant??!1,presenters:Array.isArray(r.presenters)?r.presenters:[],social_links:r.social_links??{},email:((x=r.email)==null?void 0:x.trim())||r.name.toLowerCase().replace(/[^a-z0-9]/g,"")+"@southernfm.com.au",coming_up:r.coming_up??"",show_planner_enabled:r.show_planner_enabled??!1,presenter_bios_enabled:r.presenter_bios_enabled??!1,about_enabled:r.about_enabled??!1,posts_enabled:r.posts_enabled??!1,looking_ahead_enabled:r.looking_ahead_enabled??!1,schedule_type:r.schedule_type??"weekly"};G(c),pe(c.id);const{data:u,error:P}=await A.from("posts").select("id, title, excerpt, content, slug, created_at, category, post_type, is_featured, featured_image, featured_image_position, featured_image_zoom, audio_url, audio_tracks").eq("show_id",c.id).eq("published",!0).eq("private",!1).eq("archived",!1).neq("post_type","community-news").order("created_at",{ascending:!1}).limit(10);P&&console.error("Failed to load show posts",P),V(u??[]);const{data:_,error:y}=await A.from("sponsors").select("id, name, logo_url, website_url").eq("show_id",c.id).eq("is_active",!0).order("display_order",{ascending:!0});y&&console.error("Failed to load show sponsors",y),Y(_??[]);const j=a=>new Intl.DateTimeFormat("en-CA",{timeZone:"Australia/Melbourne",year:"numeric",month:"2-digit",day:"2-digit"}).format(a),w=j(new Date),v=c.schedule_type==="monthly"?32:c.schedule_type==="fortnightly"?15:8,S=j(new Date(Date.now()-v*24*3600*1e3)),{data:L,error:N}=await A.rpc("get_public_episode_plans",{_show_id:c.id});N&&console.error("Failed to load episode plans",N);const i=L??[],p=a=>({id:a.id,air_date:a.air_date,blurb:a.blurb??"",tracklist:Array.isArray(a.tracklist)?a.tracklist:[],chapters:Array.isArray(a.chapters)?a.chapters:[],entry_type:a.entry_type}),k=i.filter(a=>a.entry_type==="aired"&&a.air_date>=S&&a.air_date<=w).sort((a,F)=>a.air_date<F.air_date?1:-1)[0],Q=i.filter(a=>a.entry_type==="looking_ahead"&&a.air_date>w).sort((a,F)=>a.air_date<F.air_date?-1:1).slice(0,12);Z(k?p(k):null),J(Q.map(p))}q(!1)})()},[g]),K)return e.jsx(T,{children:e.jsx("div",{className:"flex items-center justify-center py-24",children:e.jsx(re,{className:"h-6 w-6 animate-spin text-muted-foreground"})})});if(!s)return e.jsxs(T,{children:[e.jsx(I,{title:"Show Not Found - 88.3 Southern FM",description:"This show may have been archived or doesn't exist.",path:f.pathname,noindex:!0}),e.jsxs("div",{className:"page-content w-full py-24 text-center",children:[e.jsx("h1",{className:"font-display text-3xl font-bold mb-4 text-foreground",children:"Show Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"This show may have been archived or doesn't exist."}),e.jsx(O,{asChild:!0,children:e.jsx($,{to:"/program-guide",children:"Back to Program Guide"})})]})]});const D=ge(s),E=(o==null?void 0:o.chapters)??[],X=s.replay_hourly_split?fe(D,E):E,l=s.social_links||{};return e.jsxs(T,{children:[e.jsx(I,{title:`${s.name} - 88.3 Southern FM`,description:(s.description||"").replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,155)||`${s.name} on 88.3 Southern FM.`,path:`/show/${s.slug}`,image:s.image_url??void 0}),e.jsxs("div",{className:"pb-10",children:[(()=>{var y,j,w,v,S,L,N;const t=((y=s.social_links)==null?void 0:y.hero_color)??be,r=_e(t),n=r?"text-white":"text-foreground",x=r?"text-white/75":"text-foreground
6/70",c=r?"hover:text-white":"hover:text-foreground",u=r?"bg-white/10 hover:bg-white/20 text-white":"bg-foreground/10 hover:bg-foreground/20 text-foreground",_=(((j=s.social_links)==null?void 0:j.hero_image_position)??{}).align==="bottom"?"bottom":"middle";return e.jsxs("section",{className:"relative overflow-hidden",style:{backgroundColor:t},children:[s.image_url&&e.jsx("div",{"aria-hidden":!0,className:`hidden md:flex absolute top-0 bottom-0 right-0 w-1/2 pointer-events-none justify-center ${_==="bottom"?"items-end":"items-center p-8"}`,children:e.jsx("img",{src:s.image_url,alt:"",loading:"lazy",className:`block max-h-full max-w-full object-contain ${_==="bottom"?"object-bottom":"object-center"}`,style:_==="bottom"?{verticalAlign:"bottom"}:void 0})}),e.jsxs("div",{className:`relative page-content w-full pt-8 ${s.image_url?"":"pb-8"} md:py-10 md:min-h-[220px] ${s.image_url?"md:grid md:grid-cols-2 md:gap-8 md:items-center":""}`,children:[e.jsxs("div",{className:s.image_url?"md:pr-4":"",children:[e.jsxs($,{to:m,className:`inline-flex items-center gap-1 ${x} ${c} text-sm mb-4 transition-colors`,children:[e.jsx(ye,{className:"h-4 w-4"})," ",d]}),e.jsx("h1",{className:`font-display text-3xl md:text-5xl font-bold ${n} mb-2`,children:s.name}),e.jsxs("div",{className:`flex flex-wrap gap-4 ${x} text-sm mt-3`,children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ae,{className:"h-4 w-4"})," ",s.day_of_week," · ",s.start_time," â ",s.end_time]}),s.presenters.length>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(W,{className:"h-4 w-4"})," ",s.presenters.map(i=>i.name).join(", ")]})]}),(s.email||((w=l.facebook)==null?void 0:w.trim())||((v=l.instagram)==null?void 0:v.trim())||l.custom&&l.custom.length>0)&&e.jsxs("div",{className:"flex flex-wrap gap-3 mt-4",children:[s.email&&s.email.trim()&&e.jsxs("a",{href:`mailto:${s.email}`,className:`inline-flex items-center gap-1.5 text-xs ${u} px-3 py-1.5 rounded-full transition-colors`,children:[e.jsx(oe,{className:"h-3.5 w-3.5"})," ",s.email]}),((S=l.facebook)==null?void 0:S.trim())&&e.jsxs("a",{href:l.facebook.trim().startsWith("http")?l.facebook.trim():`https://${l.facebook.trim()}`,target:"_blank",rel:"noopener noreferrer",className:`inline-flex items-center gap-1.5 text-xs ${u} px-3 py-1.5 rounded-full transition-colors`,children:[e.jsx(we,{className:"h-3.5 w-3.5"})," Facebook"]}),((L=l.instagram)==null?void 0:L.trim())&&e.jsxs("a",{href:l.instagram.trim().startsWith("http")?l.instagram.trim():`https://instagram.com/${l.instagram.trim().replace("@","")}`,target:"_blank",rel:"noopener noreferrer",className:`inline-flex items-center gap-1.5 text-xs ${u} px-3 py-1.5 rounded-full transition-colors`,children:[e.jsx(ve,{className:"h-3.5 w-3.5"})," Instagram"]}),(N=l.custom)==null?void 0:N.filter(i=>{var p,k;return((p=i.label)==null?void 0:p.trim())&&((k=i.url)==null?void 0:k.trim())}).map((i,p)=>e.jsxs("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:`inline-flex items-center gap-1.5 text-xs ${u} px-3 py-1.5 rounded-full transition-colors`,children:[e.jsx(le,{className:"h-3.5 w-3.5"})," ",i.label]},p))]})]}),s.image_url&&e.jsx("div",{className:"md:hidden mt-6 mb-6 flex justify-start",children:e.jsx("img",{src:s.image_url,alt:"",className:"block max-h-48 w-auto max-w-full object-contain",loading:"lazy"})})]})]})})(),e.jsxs("section",{className:"page-content w-full py-10 space-y-10 md:space-y-8",children:[(s.description||s.presenter_bios_enabled&&s.presenters.length>0)&&e.jsxs("section",{className:"md:bg-card md:border md:border-border md:rounded-3xl md:p-8 md:shadow-sm space-y-8",children:[s.description&&e.jsxs("div",{children:[e.jsxs("h2",{className:"font-display text-xl font-bold text-foreground mb-3 flex items-center gap-2",children:[e.jsx(R,{className:"h-5 w-5 text-primary"})," About This Show"]}),e.jsx("p",{className:"text-muted-foreground leading-relaxed whitespace-pre-line",children:s.description})]}),s.presenter_bios_enabled&&s.presenters.length>0&&e.jsxs("div",{children:[e.jsxs("h2",{className:"font-display text-xl font-bold text-foreground mb-4 flex items-center gap-2",children:[e.jsx(W,{className:"h-5 w-5 text-primary"})," Presenters"]}
6),e.jsx("div",{className:`grid grid-cols-1 gap-4 ${s.presenters.length===1?"md:grid-cols-1":"md:grid-cols-2"}`,children:s.presenters.map((t,r)=>{var n;return e.jsxs("article",{className:"bg-background/60 md:bg-background/60 rounded-2xl border border-border/60 p-5 flex gap-4",children:[t.photo_url&&e.jsx("img",{src:t.photo_url,alt:t.name,className:"h-20 w-20 rounded-full object-cover flex-shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"font-display font-bold text-foreground",children:t.name}),(n=t.bio)!=null&&n.trim()?e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mt-1.5 whitespace-pre-line",children:t.bio}):e.jsx("p",{className:"text-xs text-muted-foreground/60 italic mt-1.5",children:"Bio coming soon."})]})]},r)})})]})]}),(s.replay_enabled||s.show_planner_enabled&&o)&&e.jsxs("section",{className:"md:bg-card md:border md:border-border md:rounded-3xl md:p-8 md:shadow-sm",children:[e.jsxs("header",{className:"mb-2 flex flex-wrap items-baseline gap-x-4 gap-y-1",children:[e.jsxs("h2",{className:"font-display text-xl font-bold text-foreground flex items-center gap-2",children:[e.jsx(R,{className:"h-5 w-5 text-primary"}),s.replay_enabled?"Catch up on the latest episode":"The latest episode"]}),s.show_planner_enabled&&o&&e.jsxs("span",{className:"text-sm text-muted-foreground inline-flex items-center gap-1.5",children:[e.jsx(H,{className:"h-4 w-4"}),new Date(o.air_date+"T00:00:00").toLocaleDateString("en-AU",{weekday:"long",day:"numeric",month:"long",year:"numeric"})]})]}),s.replay_enabled&&e.jsxs("p",{className:"text-sm text-muted-foreground mb-5",children:["Available for ",s.schedule_type==="monthly"?"1 month":s.schedule_type==="fortnightly"?"2 weeks":"7 days"," after broadcast."]}),s.show_planner_enabled&&((U=o==null?void 0:o.blurb)==null?void 0:U.trim())&&e.jsx("p",{className:"text-foreground/85 leading-relaxed whitespace-pre-line mb-5 max-w-3xl",children:o.blurb}),s.replay_enabled&&e.jsx("div",{className:"mb-3",children:e.jsx(ue,{sources:D.map(t=>t.url),showId:s.id,chapters:X,downloads:D.map(t=>({url:t.url,label:t.label,range:t.range}))})}),s.show_planner_enabled&&(((z=o==null?void 0:o.tracklist)==null?void 0:z.length)??0)>0&&e.jsxs("div",{className:"mt-8 max-w-3xl",children:[e.jsxs("h3",{className:"font-display font-bold text-foreground mb-3 flex items-center gap-2",children:[e.jsx(je,{className:"h-4 w-4 text-primary"})," Tracklist"]}),e.jsx("ol",{className:"bg-background/60 border border-border/60 rounded-2xl divide-y divide-border/60 overflow-hidden",children:o.tracklist.map((t,r)=>e.jsxs("li",{className:"flex gap-3 text-sm px-4 py-2.5",children:[e.jsxs("span",{className:"text-muted-foreground tabular-nums w-6 text-right",children:[r+1,"."]}),e.jsx("span",{className:"font-semibold text-foreground",children:t.artist}),t.title&&e.jsxs("span",{className:"text-muted-foreground",children:["- ",t.title]})]},r))})]})]}),s.looking_ahead_enabled&&s.show_planner_enabled&&M.length>0&&e.jsx("section",{className:"md:bg-card md:border md:border-border md:rounded-3xl md:p-8 md:shadow-sm",children:e.jsx(Se,{plans:M})}),C.length>0&&e.jsxs("section",{className:"md:bg-card md:border md:border-border md:rounded-3xl md:p-8 md:shadow-sm",children:[e.jsx("h2",{className:"font-display text-xl font-bold text-foreground mb-2",children:(C.length===1,"Proudly Sponsored By")}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"This show is brought to you with the support of:"}),e.jsx("div",{className:"flex flex-wrap gap-6 items-center",children:C.map(t=>{const r=t.logo_url?e.jsx("img",{src:t.logo_url,alt:t.name,className:"max-h-20 max-w-[180px] object-contain"}):e.jsx("span",{className:"font-display font-bold text-foreground",children:t.name});return t.website_url?e.jsx("a",{href:t.website_url,target:"_blank",rel:"noopener noreferrer",onClick:()=>ne(t.id),className:"bg-background/60 border border-border/60 rounded-2xl p-5 hover:border-primary/30 transition-colors flex items-center justify-center min-h-[100px] min-w-[180px]",title:t.name,children:r},t.id):e.jsx("div",{className:"bg-background/60 border border-border/60 rounded-2xl p-5 flex items-center justify-center min-h-[100px] min-w-[180px]",children:r},t.id)})})]}),B.length>0&&e.jsxs("section",{className:"md:bg-card md:border md:border-border md:rounded-3xl md:p-8 md:shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6 flex-wrap gap-3",children:[e.jsx("h2",{className:"font-display text-xl font-bold text-foreground",children:"Recent Posts"}),e.jsx($,{to:`/posts?shows=${s.id}`,children:e.jsx(O,{variant:"outline",size:"sm",children:"View All Posts"})})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 ga
6p-4",children:B.map(t=>{const r=ie(t.audio_tracks,t.audio_url).length>0,n=de(t.featured_image,s,t.id);return e.jsxs($,{to:`/post/${t.slug}`,state:{from:`/show/${s.slug}`,fromLabel:`Back to ${s.name}`},className:"bg-background/60 rounded-2xl border border-border/60 hover:border-primary/30 transition-colors block overflow-hidden",children:[n.kind==="image"?e.jsx("div",{className:"h-32 overflow-hidden",children:e.jsx("img",{src:n.src,alt:"",className:"w-full h-full object-cover",style:t.featured_image?ce(t.featured_image_position,t.featured_image_zoom):void 0})}):e.jsx("div",{className:"h-32 flex items-center justify-center",style:{background:n.background},children:e.jsx(R,{className:"h-10 w-10 text-white/40"})}),e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[t.is_featured&&e.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-wider px-2 py-0.5 rounded-full bg-amber-100 text-amber-700 flex items-center gap-0.5",children:[e.jsx(me,{className:"h-3 w-3"}),"Featured"]}),r&&e.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-wider px-2 py-0.5 rounded-full bg-secondary/10 text-secondary inline-flex items-center gap-0.5",children:[e.jsx(xe,{className:"h-3 w-3"}),"Podcast"]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(t.created_at).toLocaleDateString("en-AU",{year:"numeric",month:"long",day:"numeric"})})]}),e.jsx("h3",{className:"font-semibold text-foreground mb-1",children:t.title}),(()=>{const x=he(t.excerpt,t.content,180);return x&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3",children:x})})()]})]},t.id)})})]})]})]})]})};export{Ie 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.