const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./C04YEa1S.js","./F4mCmN5V.js","./entry.DWOfX-bB.css","./aNasIbik.js"])))=>i.map(i=>d[i]); import{g as j,q as st,W as It,b as F,V as x,R as rt,o as E,d as $,a as f,u as I,E as Y,O as B,t as U,Q as Et,i as b,w as p,a7 as Ot,m as At,a3 as Rt,_ as $t,r as Lt,k as Nt,c as Pt,H as Dt}from"./F4mCmN5V.js";import{c as qt,t as O,m as Ft,u as Bt}from"./CQX2x_cu.js";import{_ as Ut}from"./DBS8gsng.js";import{a as Ht,u as Zt}from"./CklmMKNQ.js";import{u as Gt,a as jt}from"./aNasIbik.js";import{_ as Wt}from"./CNlSxae1.js";function Kt(e,s,l){return qt(e,+O(e)+s)}function lt(e,s,l){return Kt(e,s*Ft)}function zt(e){return s=>{const c=(e?Math[e]:Math.trunc)(s);return c===0?0:c}}function Vt(e,s){return+O(e)-+O(s)}function ct(e,s,l){const c=Vt(e,s)/1e3;return zt(l?.roundingMethod)(c)}function it(e,s){return O(e,s?.in).getMinutes()}function Xt(e,s,l){const c=O(e,l?.in);return c.setMilliseconds(s),c}function Z(e,s,l){const c=O(e,l?.in);return c.setMinutes(s),c}function Yt(e,s,l){const c=O(e,l?.in);return c.setSeconds(s),c}function Qt(e,s,l){return lt(e,-1)}const Jt={class:"absolute inset-0"},te=["src"],T=60,X=8,q=15,ee=20,ne=.7,oe=.5,ae=.09,se=640,re=.6,le=.3,ce=.5,ie=.02,at=256,ue=j({__name:"CountdownClock",setup(e){const s=[8,18,28,38,48,58],l={shadowCircle:"#3b258c",gradientYellow:"#ffcc01",white:"#ffffff"},{countdownReady:c}=Bt(),u=Y(),d=Y();let t=null,S=null;const m=new Set;return st(async()=>{if(console.log("[CountdownClock] onMounted start"),!u.value)return;const{Application:g,Assets:_,Sprite:h,Texture:L,Container:N,Text:ft,TextStyle:_t,TextureSource:Q}=await It(async()=>{const{Application:a,Assets:n,Sprite:o,Texture:r,Container:i,Text:A,TextStyle:P,TextureSource:M}=await import("./C04YEa1S.js");return{Application:a,Assets:n,Sprite:o,Texture:r,Container:i,Text:A,TextStyle:P,TextureSource:M}},__vite__mapDeps([0,1,2,3]),import.meta.url);console.log("[CountdownClock] pixi.js imported"),Q.defaultOptions.scaleMode="linear",Q.defaultOptions.autoGenerateMipmaps=!0;function W(a){const n=L.from(a);return m.add(n),n}function pt(a){const n=document.createElement("canvas");n.width=a,n.height=a;const o=n.getContext("2d"),r=a/2,i=o.createConicGradient(-Math.PI/2,r,r);return i.addColorStop(0,l.shadowCircle),i.addColorStop(.5,l.shadowCircle),i.addColorStop(.5,"transparent"),i.addColorStop(1,"transparent"),o.fillStyle=i,o.beginPath(),o.arc(r,r,r,0,Math.PI*2),o.fill(),W(n)}function gt(a){const n=document.createElement("canvas");n.width=a,n.height=a;const o=n.getContext("2d"),r=a/2,i=o.createConicGradient(-Math.PI/2,r,r);return i.addColorStop(0,l.gradientYellow),i.addColorStop(X/T,"transparent"),i.addColorStop(1,"transparent"),o.fillStyle=i,o.beginPath(),o.arc(r,r,r,0,Math.PI*2),o.fill(),W(n)}function ht(a){const n=document.createElement("canvas");n.width=a,n.height=a;const o=n.getContext("2d"),r=a/2;return o.fillStyle="#ffffff",o.beginPath(),o.moveTo(r,r),o.arc(r,r,r,-Math.PI/2,Math.PI/2,!0),o.closePath(),o.fill(),W(n)}t=new g,await t.init({resizeTo:u.value,backgroundAlpha:0}),console.log("[CountdownClock] app.init() complete"),u.value.appendChild(t.canvas),_.resolver.hasKey("clock")||_.add([{alias:"clock",src:F("/images/clock.png")},{alias:"globe",src:F("/images/globe.png")},{alias:"needle",src:F("/images/needle.png")}]),console.log("[CountdownClock] loading assets...");const{clock:wt,globe:Ct,needle:vt}=await _.load(["clock","globe","needle"]);console.log("[CountdownClock] assets loaded");const k=h.from(wt);k.anchor.set(.5),k.alpha=oe,t.stage.addChild(k);const C=h.from(Ct);C.anchor.set(.5);const v=h.from(vt);v.anchor.set(.5);const H=s.map(a=>{const n=new N;t.stage.addChild(n);const o=new h;o.anchor.set(.5),n.addChild(o);const r=new h;return r.anchor.set(.5),t.stage.addChild(r),n.mask=r,{minute:a,container:n,sprite:o,maskSprite:r}}),xt=new _t({fontFamily:"Times New Roman, Georgia, serif",fontSize:18,fill:l.white,fontWeight:"bold"}),J=s.map(a=>{const n=new ft({text:String(a),style:xt});return n.anchor.set(.5),n.alpha=0,t.stage.addChild(n),{minute:a,minuteText:n}});t.stage.addChild(C),t.stage.addChild(v);const w=new h;w.anchor.set(.5),w.alpha=ce,t.stage.addChild(w);const K=at;w.texture=pt(K);const Tt=gt(K),bt=ht(K);H.forEach(({minute:a,sprite:n,maskSprite:o})=>{n.texture=Tt,n.rotation=a/T*Math.PI*2,o.texture=bt,o.rotation=a/T*Math.PI*2-ie});const tt=()=>{if(!t||!u.value)return;t.resize();const a=u.value.clientWidth,n=u.value.clientHeight,o=a/2,r=n/2,i=window.innerWidth>=se?n*le:a*re,A=i/2,M=Math.hypot(a,n)/at;w.x=o,w.y=r,w.scale.set(M);const D=Math.round(i*ae);H.forEach(({minute:ot,container:R,sprite:y,maskSprite:V})=>{y.destroyed||(R.x=o,R.y=r,y.x=0,y.y=0,y.scale.set(M),V.x=o,V.y=r,V.scale.set(M))}),J.forEach(({minute:ot,minuteText:R})=>{const y=-Math.PI/2+ot/T*Math.PI*2;R.style.fontSize=D,R.x=o+A*Math.cos(y),R.y=r+A*Math.sin(y)});const z=i/k.texture.width;k.scale.set(z),k.x=o,k.y=r;const nt=i*ne,Mt=nt/C.texture.width;C.scale.set(Mt),C.x=o,C.y=r;const yt=nt/v.texture.height;v.scale.set(yt),v.x=o,v.y=r},et=new ResizeObserver(tt);requestAnimationFrame(()=>tt()),console.log("[CountdownClock] setting countdownReady = true"),c.value=!0,et.observe(u.value),S=()=>{x.killTweensOf(w),x.killTweensOf(v),x.killTweensOf(C),H.forEach(({sprite:a,maskSprite:n})=>{x.killTweensOf(a),x.killTweensOf(n)}),et.disconnect(),_.unload(["clock","globe","needle"]),t&&(t.destroy(!0,{children:!0,texture:!1}),t=null),m.forEach(a=>{a.destroy(!0)}),m.clear()};const St=ee/T*q;x.to([w,v],{rotation:Math.PI*2,duration:q,ease:"none",repeat:-1}),x.to(C,{rotation:-Math.PI*2,duration:q,ease:"none",repeat:-1});const kt=X/T*q;H.forEach(({minute:a,sprite:n,maskSprite:o,container:r})=>{const i=a/T*q,A=(a+X)/T*Math.PI*2,P=J.find(z=>z.minute===a);if(!P)return;const{minuteText:M}=P,D=x.timeline({delay:i,onComplete:()=>{n.destroy(),r.mask=null,o.destroy()}});D.to(o,{rotation:A,duration:kt,ease:"none"},0),D.to(n,{alpha:0,duration:St,ease:"none"},0),D.to(M,{alpha:1,duration:.3,ease:"none"},.1)})}),rt(()=>{S?.()}),(g,_)=>(E(),$("div",Jt,[f("video",{ref_key:"videoEl",ref:d,class:"absolute inset-0 w-full h-full object-cover",src:("assetUrl"in g?g.assetUrl:I(F))("/video/clouds.mp4"),autoplay:"",loop:"",muted:"",playsinline:""},null,8,te),f("div",{ref_key:"container",ref:u,class:"absolute inset-0"},null,512)]))}}),de=Object.assign(ue,{__name:"CountdownClock"}),me={class:"flex flex-col justify-end min-h-[3.25em] text-center"},fe={class:"leading-loose max-w-[30ch] mx-auto"},_e=j({__name:"FallbackCounter",setup(e){const{locationName:s}=Ht();return(l,c)=>(E(),$("div",me,[f("p",fe,[B(U(I(s)),1),c[0]||(c[0]=f("br",null,null,-1)),B(" "+U(l.$t("screens.localForecast")),1)])]))}}),pe=Object.assign(_e,{__name:"FallbackCounter"}),ut=[8,18,28,38,48,58];function G(e){return Xt(Yt(e,0),0)}function dt(){const e=new Date,s=it(e),l=[...ut].reverse().find(c=>cc>s);return G(l!==void 0?Z(e,l):Z(lt(e,1),8))}function ge(){return ct(new Date,dt())}function he(){return ct(mt(),new Date)}function we(){const{language:e}=Zt();function s(l){const c=Math.floor(l/60),u=l%60,d=new Intl.NumberFormat(e.value,{style:"unit",unit:"minute"}).format(c),t=new Intl.NumberFormat(e.value,{style:"unit",unit:"second"}).format(u);return new Intl.ListFormat(e.value,{style:"long",type:"conjunction"}).format([d,t])}return{getLastEight:dt,getNextEight:mt,getElapsedSeconds:ge,getSecondsRemaining:he,formatCountdown:s}}const Ce={class:"flex flex-col justify-start min-h-[3.25em] text-center"},ve={class:"text-balance line-clamp-2 leading-loose max-w-[28ch] mx-auto"},xe=j({__name:"CountdownText",emits:["complete"],setup(e,{emit:s}){const l=s,c=Gt(),{getSecondsRemaining:u,formatCountdown:d}=we(),t=Y(u()),S=At(()=>d(t.value));let m=null;function g(){m&&clearInterval(m),t.value=u(),m=Rt(()=>{t.value=u(),t.valuec.isLive.value,_=>{_||g()}),st(()=>{g()}),rt(()=>{m&&clearInterval(m)}),(_,h)=>{const L=Ot;return E(),$("div",Ce,[f("p",ve,[b(L,null,{fallback:p(()=>[B(U(_.$t("countdown.fallback")),1)]),default:p(()=>[B(U(_.$t("countdown.begins",{countdown:I(S)}))+" ",1)]),_:1})])])}}}),Te=Object.assign(xe,{__name:"CountdownText"}),be={},Se={class:"font-martian-mono uppercase border border-white px-[1.5em] py-[0.75em] rounded-xl whitespace-nowrap cursor-pointer"};function ke(e,s){return E(),$("button",Se,[Lt(e.$slots,"default")])}const Me=Object.assign($t(be,[["render",ke]]),{__name:"Button"}),ye=["src","alt"],Ie={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960"},Ee={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960"},Oe={class:"font-medium font-stretch-semi-expanded gap-2 grid grid-flow-col text-[0.75em] uppercase"},Ae=j({__name:"Countdown",props:{locationName:{}},emits:["complete","skip"],setup(e,{emit:s}){const l=s,c=Nt("settings"),u=jt();return(d,t)=>{const S=de,m=Ut,g=pe,_=Te,h=Me,L=Wt;return E(),Pt(L,{class:"z-10 bg-twc-blue"},{background:p(()=>[b(S)]),header:p(()=>[b(m,{type:"button","aria-label":d.$t("aria.info"),onClick:t[0]||(t[0]=N=>("navigateTo"in d?d.navigateTo:I(Dt))("https://www.weather.com",{external:!0}))},{default:p(()=>[...t[4]||(t[4]=[f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960"},[f("path",{d:"M256-227.69 227.69-256l224-224-224-224L256-732.31l224 224 224-224L732.31-704l-224 224 224 224L704-227.69l-224-224-224 224Z"})],-1)])]),_:1},8,["aria-label"]),f("img",{src:("assetUrl"in d?d.assetUrl:I(F))("/images/the-weather-channel.png"),alt:d.$t("brand.weatherChannel"),class:"h-[3em] drop-shadow-[0.2em_0.2em_0_black] rtl:drop-shadow-[-0.2em_0.2em_0_black]"},null,8,ye),b(m,{type:"button","aria-label":d.$t("aria.toggleAudio"),onClick:I(u).toggle},{default:p(()=>[I(u).enabled.value?(E(),$("svg",Ee,[...t[6]||(t[6]=[f("path",{d:"M560-131v-82q90-26 145-100t55-168q0-94-55-168T560-749v-82q124 28 202 125.5T840-481q0 127-78 224.5T560-131ZM120-360v-240h160l200-200v640L280-360H120Zm440 40v-322q47 22 73.5 66t26.5 96q0 51-26.5 94.5T560-320Z"},null,-1)])])):(E(),$("svg",Ie,[...t[5]||(t[5]=[f("path",{d:"m616-320-56-56 104-104-104-104 56-56 104 104 104-104 56 56-104 104 104 104-56 56-104-104-104 104Zm-496-40v-240h160l200-200v640L280-360H120Z"},null,-1)])]))]),_:1},8,["aria-label","onClick"])]),article:p(()=>[b(g),t[7]||(t[7]=f("div",{class:"w-[60%] md:w-auto md:h-[30%] aspect-square rounded-full"},null,-1)),b(_,{onComplete:t[1]||(t[1]=N=>l("complete"))})]),footer:p(()=>[b(h,{onClick:t[2]||(t[2]=N=>d.$emit("skip"))},{default:p(()=>[...t[8]||(t[8]=[B("Start RetroCast",-1)])]),_:1}),f("div",Oe,[f("span",null,U(e.locationName),1),b(m,{type:"button","aria-label":d.$t("countdown.changeLocation"),onClick:t[3]||(t[3]=N=>c.value=!0)},{default:p(()=>[...t[9]||(t[9]=[f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960"},[f("path",{d:"M370-80l-16-128q-13-5-24.5-12T307-235l-119 50L84-369l103-78q-1-7-1-13v-40q0-6 1-13L84-591l104-184 119 50q11-8 23-15t24-12l16-128h208l16 128q13 5 24.5 12t22.5 15l119-50 104 184-103 78q1 7 1 13v40q0 6-1 13l103 78-104 184-119-50q-11 8-23 15t-24 12L578-80H370Zm109-230q63 0 106.5-43.5T629-460q0-63-43.5-106.5T479-610q-63 0-106.5 43.5T329-460q0 63 43.5 106.5T479-310Z"})],-1)])]),_:1},8,["aria-label"])])]),_:1})}}}),qe=Object.assign(Ae,{__name:"Countdown"});export{qe as _,Me as a,we as u};