1import P from"./CTy_XoWH.js";import{K as v,aH as K,a1 as O,W as J,o as d,c as u,q as s,a as e,h as G,F as H,w as A,a9 as Q,af as Z,B as c,n as S,j as ee,a4 as te,t as Y,v as $,e as C,f as B,O as W}from"./zFQdoL8e.js";const ae={class:"radar-sequencer"},se={key:0,class:"error"},oe={key:1,class:"sequencer-container"},ne=["src","alt"],re={class:"sequencer-header"},le={class:"time-display"},ie="/idokep",ce="/idokep/radar/radar.js",F=1,N=5,de={__name:"IdokepRadar",setup(q){const h=v(1.3),g=v([]),a=v(0),b=v(!1),T=v(!0),I=v(null);let k=null;const y=v(null),f=v(!1),p=v({x:-20,y:0}),w={x:0,y:0};let o=null,l=1;function D(t){return t.touches&&t.touches.length>0?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}}function x(t){if(t.type==="mousedown"&&t.preventDefault(),t.touches&&t.touches.length===2){f.value=!1,o=X(t),l=h.value;return}f.value=!0;const r=D(t);w.x=r.x-p.value.x,w.y=r.y-p.value.y}function n(t){if(!y.value)return;if(t.touches&&t.touches.length===2){const _=X(t);if(_&&o){const M=_/o;h.value=Math.max(F,Math.min(N,l*M)),j()}return}if(!f.value)return;const r=D(t);let i=r.x-w.x,m=r.y-w.y;L(i,m)}function z(t){f.value=!1,(!t.touches||t.touches.length===0)&&(o=null)}function R(t,r){const i=new RegExp(`var\\s+${r}\\s*=\\s*\\[([\\s\\S]*?)]\\s*;`),m=t.match(i);return m?m[1].split(",").map(_=>_.trim().replace(/['"`]/g,"")).filter(_=>_!==""):[]}function E(t){t.preventDefault();const r=.1,i=t.deltaY<0?1:-1;h.value=Math.max(F,Math.min(N,h.value+i*r)),j()}function j(){L(p.value.x,p.value.y)}function L(t,r){if(!y.value)return;const i=y.value.clientWidth,m=y.value.clientHeight,_=Math.max(0,(i*h.value-i)/2),M=Math.max(0,(m*h.value-m)/2);p.value={x:Math.max(-_,Math.min(_,t)),y:Math.max(-M,Math.min(M,r))}}function X(t){if(!t.touches||t.touches.length<2)return null;const r=t.touches[0].clientX-t.touches[1].clientX,i=t.touches[0].clientY-t.touches[1].clientY;return Math.sqrt(r*r+i*i)}K(async()=>{try{const t=await $fetch(ce,{parseResponse:_=>_}),r=R(t,"radarfile"),i=R(t,"radartime"),m=r.map((_,M)=>({image:`${ie}${_}`,time:i[M]||""})).reverse();g.value=m,a.value=m.length-1,U()}catch(t){console.error(t),I.value=t}finally{T.value=!1}});function U(){b.value||(b.value=!0,k=O(()=>{a.value>=g.value.length-1?a.value=0:a.value++},500))}function V(){b.value=!1,k&&(clearInterval(k),k=null)}return J(()=>{V()}),(t,r)=>(d(),u("div",ae,[s(I)||!s(T)&&s(g).length===0?(d(),u("div",se,[...r[0]||(r[0]=[e("div",{class:"radar-mock"},[e("div",{class:"radar-pulse"}),e("i",{class:"mdi mdi-map-marker-radius"}),e("span",null,"Nem sikerült a radarkép betöltése")],-1)])])):(d(),u("div",oe,[e("div",{ref_key:"containerRef",ref:y,class:S(["image-container",{"is-dragging":s(f)}]),onMousedown:x,onMousemove:n,onMouseup:z,onMouseleave:z,onTouchstart:x,onTouchmove:n,onTouchend:z,onWheel:E},[e("div",{class:"zoom-wrapper",style:G({transform:`scale(${s(h)}) translate(${s(p).x/s(h)}px, ${s(p).y/s(h)}px)`})},[r[1]||(r[1]=e("div",{class:"radar-background"},null,-1)),(d(!0),u(H,null,A(s(g),(i,m)=>Q((d(),u("img",{key:i.image,src:i.image,alt:"Radar frame "+i.time,class:"radar-image"},null,8,ne)),[[Z,m===s(a)]])),128))],4),e("div",re,[e("span",le,"IdÅ: "+c(s(g)[s(a)]?.time),1)])],34)]))]))}},ue={key:0,class:"article__block__header"},_e={class:"weather-widget"},me={class:"cl-weather__main-grid"},he={class:"cl-weather__card cl-weather__card--today",style:{"grid-area":"a"}},pe={class:"cl-weather__card__header"},fe={key:0,class:"cl-weather__card__container"},ve={class:"cl-weather__card__main-temp"},ge={class:"cl-weather__info"},ye={class:"cl-weather__info"},we={key:1,class:"cl-weather__card__container"},xe={class:"cl-weather__card cl-weather__card--forecast",style:{"grid-area":"b"}},ke={class:"forecast-section"},De={class:"horizontal-scroll"},Me={class:"cl-weather__hourly__title"},Se={key:0,class:"cl-weather__error"},be={class:"forecast-section"},Te={class:"horizontal-scroll days-scroll"},$e={class:"cl-weather__daily__title"},Ie={class:"cl-weather__daily__summary"},Ce={class:"temp-range"},We={class:"cl-weather__daily__temp--min"},ze={class:"cl-weather__daily__temp--max"},He={key:0,class:"cl-weather__error"},Ae={class:"cl-weather__card extended-card map-card",style:{"grid-area":"c"}},Le={__name:"IdokepWidget",setup(q){const h=ee(),g=te(),{weatherData:a,componentSetup:b}=Y(g),{isTelexApp:T}=Y(h),I=$(()=>a.value!==null&&typeof a.value=="object"&&b.value?.showWeather==="1"),k=$(()=>(a.value?console.log("IdokepWidget: weatherData loaded",{hasForecast:!!a.value.forecast,nextHoursLength:a.value.forecast?.next_hours?.length,firstHourTemp:a.value.forecast?.next_hours?.[0]?.temp}):console.log("IdokepWidget: weatherData is null"),a.value?.forecast?.next_hours?.[0]?.temp??a.value?.max??"--")),y=$(()=>{const o=new Date,l=a.value?.forecast?.next_days?.[0]?.time;if(l){const D=new Date(l*1e3),x=new Date;x.setHours(0,0,0,0);const n=new Date(x);n.setDate(n.getDate()+1),D.getTime()>=n.getTime()&&o.setDate(o.getDate()+1)}return o.toLocaleDateString("hu-HU",{month:"long",day:"numeric",weekday:"long"})}),f=o=>o&&{"010":"mdi-weather-sunny","021":"mdi-weather-partly-cloudy","022":"mdi-weather-partly-cloudy",110:"mdi-weather-cloudy",310:"mdi-weather-night",321:"mdi-weather-night-partly-cloudy",510:"mdi-weather-rainy",610:"mdi-weather-snowy",710:"mdi-weather-lightning-rainy"}[o]||"mdi-weather-cloudy",p=$(()=>a.value?.forecast?.next_hours?a.value.forecast.next_hours.slice(0,7).map(o=>({time:new Date(o.time*1e3).toLocaleTimeString("hu-HU",{hour:"2-digit",minute:"2-digit"}),icon:f(o.sky),temp:o.temp})):[]),w=$(()=>a.value?.forecast?.next_days?a.value.forecast.next_days.slice(1,5).map(o=>({name:new Date(o.time*1e3).toLocaleDateString("hu-HU",{weekday:"long"}),icon:f(o.sky),phrase:o.sky_title,min:o.temp_min,max:o.temp_max})):[]);return(o,l)=>{const D=P,x=de;return I.value?(d(),u("div",{key:0,id:"idojaras",class:S([{"article__block--weather--app":s(T)},"article__block article__block--t article__block--weather"])},[s(T)?C("",!0):(d(),u("div",ue,[...l[0]||(l[0]=[e("div",{class:"article__block__title"},[e("span",null," IdÅjárás ")],-1)])])),B(D,{slug:"idokep"}),e("div",_e,[e("div",me,[e("div",he,[e("div",pe,[l[1]||(l[1]=e("i",{class:"mdi mdi-map-marker-outline"},null,-1)),W(" "+c(s(a)?.city||"Budapest")+" â "+c(y.value),1)]),s(a)?(d(),u("div",fe,[e("div",ve,[e("i",{class:S(["weather-icon mdi",f(s(a)?.icon)])},null,2),W(" "+c(k.value)+" °C â "+c(s(a)?.description),1)]),e("div",ge,[e("span",null,"Minimum: "+c(s(a)?.min)+"° â ",1),e("span",null," Maximum: "+c(s(a)?.max)+"° ",1)]),e("div",ye,c(s(a)?.forecast?.today?.title)+". "+c(s(a)?.text?.["36ora"]),1)])):(d(),u("div",we,[...l[2]||(l[2]=[e("span",{class:"cl-weather__error"}," Adatok betöltése ",-1)])]))]),e("div",xe,[e("div",ke,[l[3]||(l[3]=e("span",{class:"cl-weather__card__header"},[e("i",{class:"mdi mdi-clock-outline"}),W(" Rövid távú elÅrejelzés")],-1)),e("div",De,[(d(!0),u(H,null,A(p.value,n=>(d(),u("div",{key:n.time,class:"forecast-pill hour-pill"},[e("div",Me,c(n.time),1),e("i",{class:S(["mdi",n.icon])},null,2),e("span",{class:S(["cl-weather__hourly__temp",{"cl-weather__hourly__temp--night":n.time>="08:00"&&n.time<="20:00","cl-weather__hourly__temp--day":n.time<"08:00"||n.time>"20:00"}])},c(n.temp)+"° ",3)]))),128))]),p.value.length===0?(d(),u("span",Se," Adatok betöltése ")):C("",!0)]),e("div",be,[l[4]||(l[4]=e("div",{class:"cl-weather__card__header"},[e("i",{class:"mdi mdi-calendar-month-outline"}),W(" Középtávú elÅrejelzés")],-1)),e("div",Te,[(d(!0),u(H,null,A(w.value,
1n=>(d(),u("div",{key:n.name,class:"forecast-pill day-pill"},[e("span",$e,c(n.name),1),e("i",{class:S(["mdi",n.icon])},null,2),e("span",Ie,c(n.phrase),1),e("div",Ce,[e("span",We,c(n.min)+"°",1),e("span",ze,c(n.max)+"°",1)])]))),128))]),w.value.length===0?(d(),u("div",He," Adatok betöltése ")):C("",!0)])]),e("div",Ae,[l[5]||(l[5]=e("div",{class:"cl-weather__card__header"},[e("i",{class:"mdi mdi-radar"}),e("span",null," Csapadékradar ")],-1)),B(x)])])])],2)):C("",!0)}}};export{Le as _};
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.