1import{d as oe,E as w,r as y,c as v,G as le,D as ie,f as n,i as a,l as m,b as _,_ as g,t as s,k as O,g as h,F as p,J as G,j as k,n as B,q as o,s as ue}from"./index-BDt9-qUU.js";import{u as ce}from"./useBackNav-B75oDn6q.js";import{u as de,W as E}from"./useWeather-gGkFioP0.js";import{d as he}from"./partnerLinks-CLwv6lmH.js";import"./_commonjsHelpers-CqkleIqs.js";import"./weatherService-B6MpL8UU.js";const ve={class:"page weather-page scrollable-view"},me={class:"page__head weather-head"},_e={class:"weather-head__l"},we=["aria-label"],ye={class:"eyebrow"},pe={class:"display weather-head__title"},be={key:0,class:"muted weather-head__elev"},fe={key:0,class:"weather-state"},ge={key:1,class:"weather-state weather-state--err"},ke={class:"muted"},qe={class:"card wbig weather-summary"},$e={class:"muted weather-summary__desc"},Ce={class:"weather-metrics"},Ne={class:"eyebrow"},De={class:"weather-metric__v"},Le={key:1,class:"advice sev-caution"},Me={key:2,class:"weather-block"},Se={class:"eyebrow weather-block__h"},Te={class:"hours"},Ie={key:0,class:"weather-precip"},Oe={class:"weather-block"},Be={class:"eyebrow weather-block__h"},Ee={class:"wsel"},He=["onClick"],Pe={class:"wsel__day"},Re={class:"muted wsel__min"},Ve={key:3,class:"weather-block"},We={class:"eyebrow weather-block__h"},ze={key:0,class:"weather-banner weather-banner--notrec"},Ae={key:1,class:"weather-banner"},Fe={class:"eyebrow weather-group__h"},Ge={class:"weather-equip"},Ke={class:"weather-eq__b"},je={class:"eyebrow"},Ue={class:"weather-eq__t"},xe={key:0,class:"muted weather-eq__s"},Je={key:1,class:"muted weather-eq__reason"},Ye={key:2,class:"muted weather-eq__conseq"},Qe={class:"weather-eq__r"},Xe={class:"badge"},Ze=["title"],et=["href"],tt={class:"deca-partner"},at={key:4,class:"muted weather-attr"},rt=oe({__name:"WeatherView",setup(st){const{t:i}=w.global,b=ie(),{goBack:H}=ce({name:"map"}),P={lat:42.6977,lon:23.3219};function K(e){return he({category:e.category,source:"weather",productUrl:e.product?.url})}const q=y(null),$=y(null),M=y(null),R=y(!1),S=y(null),j=v(()=>S.value?S.value:R.value?i("weather.myLocation"):i("weather.sofia")),{forecast:c,loading:U,error:x}=de(q,$),d=y(0);function T(e){if(e==null)return null;const t=Number(e);return Number.isFinite(t)?t:null}le(()=>{const e=T(b.query.lat),t=T(b.query.lon),r=typeof b.query.name=="string"?b.query.name:null,l=T(b.query.elevation);if(e!=null&&t!=null){q.value=e,$.value=t,S.value=r,M.value=l;return}q.value=P.lat,$.value=P.lon,navigator.geolocation&&navigator.geolocation.getCurrentPosition(({coords:f})=>{q.value=f.latitude,$.value=f.longitude,R.value=!0},()=>{},{timeout:5e3,maximumAge:6e5})});const V={good:"var(--good)",info:"var(--info)",caution:"var(--warn)",warning:"var(--bad)"},C=v(()=>c.value?d.value===0?c.value.advisory??null:c.value.days[d.value]?.advisory??null:null),W=v(()=>c.value?c.value.days[d.value]?.offHoursNote??null:null),z=v(()=>{const e=C.value?.severity;return e&&V[e]?V[e]:(d.value===0?c.value?.current.isDay:!0)?"var(--warn)":"var(--muted)"}),N=v(()=>{const e=c.value;if(!e)return{big:"",desc:"",code:3,isDay:!0};if(d.value===0)return{big:`${u(e.current.temperatureC)}°`,desc:e.current.description,code:e.current.weatherCode,isDay:e.current.isDay};const t=e.days[d.value];return t?{big:`${u(t.tempMaxC)}° / ${u(t.tempMinC)}°`,desc:ne(t.date),code:t.weatherCode,isDay:!0}:{big:"",desc:"",code:3,isDay:!0}}),J=v(()=>{const e=c.value;if(!e)return[];if(d.value===0){const r=e.current;return[{key:"wind",label:i("weather.wind"),value:`${u(r.windKmh)} ${i("weather.kmh")}`},{key:"gust",label:i("weather.gusts"),value:`${u(r.gustKmh)} ${i("weather.kmh")}`},{key:"feels",label:i("weather.feelsLike"),value:`${u(r.apparentTemperatureC)}°`},{key:"humid",label:i("weather.humidity"),value:`${u(r.relativeHumidity)}%`},{key:"uv",label:i("weather.uv"),value:`${u(r.uvIndex)}`},{key:"precip",label:i("weather.precip"),value:`${u(r.precipitationProbability)}%`}]}const t=e.days[d.value];return t?[{key:"wind",label:i("weather.wind"),value:`${u(t.windMaxKmh)} ${i("weather.kmh")}`},{key:"gust",label:i("weather.gusts"),value:`${u(t.gustMaxKmh)} ${i("weather.kmh")}`},{key:"uv",label:i("weather.uv"),value:`${u(t.uvIndexMax)}`},{key:"precip",label:i("weather.precip"),value:`${u(t.precipProbabilityMax
1)}%`}]:[]}),A=v(()=>{const e=c.value;return e?d.value===0?e.hourly??[]:e.days[d.value]?.hourly??[]:[]}),D=v(()=>c.value?.days[d.value]?.equipment??[]);function L(e){return(e.severity??"recommended").toLowerCase()}function Y(e){const t=L(e);return t==="not_recommended"?"not_recommended":t==="critical"?"critical":t==="warning"?"warning":t==="important"?"important":t==="optional"?"optional":"recommended"}const Q=v(()=>{const e={not_recommended:[],critical:[],warning:[],important:[],recommended:[],optional:[]};for(const t of D.value)e[Y(t)].push(t);return[{key:"not_recommended",label:i("weather.gearNotRecommended")},{key:"critical",label:i("weather.gearCritical")},{key:"warning",label:i("weather.gearWarning")},{key:"important",label:i("weather.gearImportant")},{key:"recommended",label:i("weather.gearRecommended")},{key:"optional",label:i("weather.gearOptional")}].map(t=>({key:t.key,label:t.label,items:e[t.key]})).filter(t=>t.items.length)}),X=v(()=>D.value.some(e=>L(e)==="critical")),Z=v(()=>D.value.some(e=>L(e)==="not_recommended"));function F(e){const t=(e.reasons??[]).filter(r=>r&&r.trim().length>0);return t.length?t.slice(0,3):e.reason&&e.reason.trim()?[e.reason]:[]}function ee(e){const t=L(e);return t==="not_recommended"?"weather-eq--notrec":t==="critical"?"weather-eq--critical":t==="warning"?"weather-eq--warning":t==="important"?"weather-eq--important":""}function u(e){return Math.round(e??0)}const I=()=>w.global.locale.value;function te(e){const t=`weather.equipStatus.${(e??"").toLowerCase()}`;return w.global.te(t)?w.global.t(t):e}function ae(e){const t=(e??"").toLowerCase(),r=`weather.equipCategory.${t}`;return w.global.te(r)?w.global.t(r):t.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}function re(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleTimeString(I(),{hour:"2-digit"})}function se(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(I(),{weekday:"short"})}function ne(e){const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(I(),{weekday:"long",day:"numeric",month:"short"})}return(e,t)=>(o(),n("div",ve,[a("div",me,[a("div",_e,[a("button",{class:"btn btn--icon weather-back","aria-label":e.$t("detail.back"),onClick:t[0]||(t[0]=(...r)=>m(H)&&m(H)(...r))},[_(g,{name:"left"})],8,we),a("div",null,[a("div",ye,s(e.$t("weather.fullTitle")),1),a("h1",pe,[O(s(j.value)+" ",1),M.value!=null?(o(),n("span",be," · "+s(u(M.value))+" m ",1)):h("",!0)])])])]),m(U)&&!m(c)?(o(),n("div",fe,[...t[1]||(t[1]=[a("span",{class:"weather-spinner"},null,-1)])])):m(x)||!m(c)?(o(),n("div",ge,[_(g,{name:"cloud"}),a("p",ke,s(e.$t("weather.error")),1)])):(o(),n(p,{key:2},[a("section",qe,[a("div",null,[a("div",{class:"wbig__t",style:G({color:z.value})},s(N.value.big),5),a("div",$e,s(N.value.desc),1)]),a("div",{class:"weather-summary__glyph",style:G({color:z.value})},[_(E,{code:N.value.code,"is-day":N.value.isDay,size:76,loop:""},null,8,["code","is-day"])],4)]),a("section",Ce,[(o(!0),n(p,null,k(J.value,r=>(o(),n("div",{key:r.key,class:"card weather-metric"},[a("span",Ne,s(r.label),1),a("b",De,s(r.value),1)]))),128))]),C.value?(o(),n("div",{key:0,class:B(["advice",`sev-${C.value.severity}`])},s(C.value.text),3)):h("",!0),W.value?(o(),n("div",Le,s(W.value),1)):h("",!0),A.value.length?(o(),n("section",Me,[a("h2",Se,s(e.$t("weather.hourly")),1),a("div",Te,[(o(!0),n(p,null,k(A.value,(r,l)=>(o(),n("div",{key:l,class:"hour"},[a("span",null,s(re(r.time)),1),_(E,{code:r.weatherCode,"is-day":r.isDay,size:26},null,8,["code","is-day"]),a("b",null,s(u(r.temperatureC))+"°",1),r.precipitationProbability>0?(o(),n("span",Ie,s(u(r.precipitationProbability))+"% ",1)):h("",!0)]))),128))])])):h("",!0),a("section",Oe,[a("h2",Be,s(e.$t("weather.sevenDay")),1),a("div",Ee,[(o(!0),n(p,null,k(m(c).days,(r,l)=>(o(),n("button",{key:r.date,class:B(["wsel__c",{"is-on":l===d.value}]),onClick:f=>d.value=l},[a("span",Pe,s(l===0?e.$t("weather.today"):se(r.date)),1),_(E,{code:r.weatherCode,"is-day":!0,size:26},null,8,["code"]),a("b",null,s(u(r.tempMaxC))+"°",1),a("span",Re,s(u(r.tempMinC))+"°",1)],10,He))),128))])]),D.value.length?(o(),n("section",Ve,[a("h2",We,s(e.$t("weather.equipment")),1),Z.value?(o(),n("div",ze,[_(g,{name:"alert"}),a("span",null,s(e.$t("weather.routeNotRecommended")),1)])):h("",!0),X.value?(o(),n("div",Ae,[_(g,{name:"alert"}),a("span",null,s(e.$t("weather.routeChangeBanner")),1)])):h("",!0),(o(!0),n(p,null,k(Q.value,r=>(o(),n("div",{key:r.key,class:"weather-group"},[a("h3",Fe,s(r.label),1),a("div",Ge,[(o(!0),n(p,null,k(r.items,(l,f)=>(o(),n("div",{key:f,class:B(["card weather-eq",ee(l)])},[a("div",Ke,[a("span",je,s(ae(l.category)),1),a("b",Ue,s(l.title),
11),l.subtitle?(o(),n("span",xe,s(l.subtitle),1)):h("",!0),F(l).length?(o(),n("span",Je,s(F(l).join(" · ")),1)):h("",!0),l.consequence?(o(),n("span",Ye,s(e.$t("weather.withoutIt"))+" "+s(l.consequence),1)):h("",!0)]),a("div",Qe,[a("span",Xe,s(te(l.status)),1),l.score!=null?(o(),n("span",{key:0,class:"weather-eq__score",title:e.$t("weather.score")},s(u(l.score)),9,Ze)):h("",!0),a("a",{class:"deca-link",href:K(l),target:"_blank",rel:"noopener noreferrer"},[_(g,{name:"external"}),O(" "+s(e.$t("equipment.seeInDecathlon")),1)],8,et)])],2))),128))])]))),128)),a("p",tt,[O(s(e.$t("equipment.partner"))+" ",1),t[2]||(t[2]=a("span",{class:"deca-partner__brand"},"DECATHLON",-1))])])):h("",!0),m(c).attribution?.weatherProvider?(o(),n("p",at,s(e.$t("weather.providedBy",{provider:m(c).attribution.weatherProvider})),1)):h("",!0)],64))]))}}),dt=ue(rt,[["__scopeId","data-v-2d114917"]]);export{dt 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.