PageSourceSearch

https://www.asturmet.com/_next/static/chunks/1519-45dd53e52536468e.js

js asturmet.com collected 2026-10-02 04:20:39 UTC 38,553 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1519],{8764:(e,t,a)=>{a.d(t,{C6:()=>b,d1:()=>x,eZ:()=>f,lS:()=>m,tL:()=>h,v7:()=>u,vm:()=>p,zt:()=>v});var r=a(62950);let i=/^\d{8}T\d{6}Z$/,n=/^\/v1\/radar\/aemet\/frames\/(\d{8}T\d{6}Z)\.png$/,s=/^[a-f0-9]{64}$/,o=new Set(["fresh","delayed","stale"]);function l(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function d(e){return"number"==typeof e&&Number.isFinite(e)}function c(e){return"string"==typeof e&&Number.isFinite(Date.parse(e))}function u(e){if(!l(e)||"string"!=typeof e.frameId||!i.test(e.frameId)||!c(e.observedAt)||!c(e.fetchedAt)||!c(e.publishedAt)||"string"!=typeof e.freshness||!o.has(e.freshness)||"AEMET radar composition"!==e.source||"compo"!==e.product||"Fuente: AEMET"!==e.attribution||!0!==e.provisional||"EPSG:4326"!==e.crs||!l(e.bounds)||!d(e.bounds.west)||!d(e.bounds.south)||!d(e.bounds.east)||!d(e.bounds.north)||e.bounds.west<-180||e.bounds.east>180||e.bounds.south<-90||e.bounds.north>90||e.bounds.west>=e.bounds.east||e.bounds.south>=e.bounds.north||!l(e.dimensions)||!Number.isInteger(e.dimensions.width)||!Number.isInteger(e.dimensions.height)||!d(e.dimensions.width)||!d(e.dimensions.height)||e.dimensions.width<1||e.dimensions.height<1||e.dimensions.width>1e4||e.dimensions.height>1e4||!l(e.legend)||!Array.isArray(e.legend.colors)||11!==e.legend.colors.length||!e.legend.colors.every(e=>"string"==typeof e&&e.length>0&&e.length<=32)||"string"!=typeof e.legend.highLabel||"string"!=typeof e.legend.label||"string"!=typeof e.legend.lowLabel||!l(e.image)||"string"!=typeof e.image.url||!n.test(e.image.url)||e.image.url!=="/v1/radar/aemet/frames/"+e.frameId+".png"||"image/png"!==e.image.mimeType||!Number.isInteger(e.image.bytes)||!d(e.image.bytes)||e.image.bytes<1||"string"!=typeof e.image.checksum||!s.test(e.image.checksum))throw Error("Invalid AEMET radar payload");return e}function m(){return new URL("/v1/radar/aemet/latest",(0,r.D8)()).toString()}function p(e){if(!n.test(e))throw Error("Invalid AEMET radar frame path");return new URL(e,(0,r.D8)()).toString()}function b(e){return"fresh"===e?"Actualizado":"delayed"===e?"Con retraso":"Antiguo"}function f(e){return"fresh"===e?"border-emerald-300 bg-emerald-50 text-emerald-800 dark:border-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-200":"delayed"===e?"border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-100":"border-rose-300 bg-rose-50 text-rose-900 dark:border-rose-800 dark:bg-rose-950/40 dark:text-rose-100"}function h(e){let t=new Date(e);return Number.isFinite(t.getTime())?new Intl.DateTimeFormat("es-ES",{timeZone:"Europe/Madrid",day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}).format(t):"Hora no disponible"}function g(e){return d(e.lat)&&e.lat>=40.5&&e.lat<=44.5&&d(e.lng)&&e.lng>=-10.5&&e.lng<=-1&&Number.isInteger(e.zoom)&&e.zoom>=7&&e.zoom<=11&&"string"==typeof e.locationName&&e.locationName.trim().length>=1&&e.locationName.trim().length<=120&&!/[\u0000-\u001f\u007f]/.test(e.locationName)}function x(e){if(!g(e))throw Error("Invalid local radar view");let t=new URLSearchParams;return t.set("layer","radar"),t.set("lat",String(e.lat)),t.set("lng",String(e.lng)),t.set("zoom",String(e.zoom)),t.set("location",e.locationName.trim()),"/mapas?"+t.toString()}function v(e){if("radar"!==e.layer||"string"!=typeof e.lat||"string"!=typeof e.lng||"string"!=typeof e.zoom||"string"!=typeof e.location||""===e.lat.trim()||""===e.lng.trim()||""===e.zoom.trim())return null;let t={lat:Number(e.lat),lng:Number(e.lng),zoom:Number(e.zoom),locationName:e.location.trim()};return g(t)?t:null}},17414:(e,t,a)=>{a.d(t,{AM:()=>s,Wv:()=>o,hl:()=>l});var r=a(95155);a(12115);var i=a(60339),n=a(40980);function s({...e}){return(0,r.jsx)(i.bL,{"data-slot":"popover",...e})}function o({...e}){return(0,r.jsx)(i.l9,{"data-slot":"popover-trigger",...e})}function l({className:e,align:t="center",sideOffset:a=4,...s}){return(0,r.jsx)(i.ZL,{children:(0,r.jsx)(i.UC,{"data-slot":"popover-content",align:t,sideOffset:a,className:(0,n.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...s})})}},35620:(e,t,a)=>{a.d(t,{R:()=>f});var r=a(95155),i=a(12115),n=a(66088),s=a(94514),o=a(33210),l=a(29483),d=a(17414),c=a(40980);let u="(max-width: 639px)";function m(e){let t=window.matchMedia(u);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}let p=()=>window.matchMedia(u).matches,b=()=>!1;function f({label:e,value:t,options:a,onValueChange:u,disabled:h}){let[g,x]=(0,i.useState)(!1),v=(0,i.useSyncExternalStore)(m,p,b),y=(0,i.useId)(),w=a.find(e=>e.value===t),j=(0,r.jsxs)("button",{type:"button",disabled:h,"aria-label":`${e}: ${w?.label??"Selecci\xf3n no disponible"}${w?.accessibleStatus?`. ${w.accessibleStatus}`:""}`,className:"flex min-h-11 w-full min-w-0 items-center gap-2.5 rounded-xl border border-slate-200 bg-white px-3 py-2 text-left text-sm font-semibold text-slate-900 shadow-lg transition-colors hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60",children:[w&&(0,r.jsx)("span",{"aria-hidden":"true",className:"flex shrink-0 items-center justify-center",children:w.icon}),(0,r.jsx)("span",{className:"min-w-0 flex-1 break-words leading-5",children:w?.label??"Selecci\xf3n no disponible"}),w?.count!==void 0&&(0,r.jsx)("span",{className:"shrink-0 text-xs tabular-nums text-slate-500",children:w.count}),(0,r.jsx)(n.A,{"aria-hidden":"true",className:(0,c.cn)("size-4 shrink-0 text-slate-500 transition-transform",g&&"rotate-180")})]}),N=(0,r.jsx)("div",{role:"group","aria-label":e,className:"min-h-0 overflow-y-auto overscroll-contain p-2",children:a.map(e=>(0,r.jsxs)("button",{type:"button","aria-pressed":e.value===t,disabled:e.disabled,"aria-label":`${e.label}${e.accessibleStatus?`. ${e.accessibleStatus}`:""}${void 0!==e.count?`. ${e.count} avisos`:""}`,onClick:()=>{u(e.value),x(!1)},className:(0,c.cn)("flex min-h-11 w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left text-sm text-slate-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary disabled:cursor-not-allowed disabled:opacity-50",e.value===t?"bg-blue-50 font-semibold ring-1 ring-inset ring-blue-200":"hover:bg-slate-50"),children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"flex size-8 shrink-0 items-center justify-center",children:e.icon}),(0,r.jsxs)("span",{className:"min-w-0 flex-1 break-words",children:[(0,r.jsx)("span",{className:"block",children:e.label}),e.accessibleStatus&&(0,r.jsx)("span",{className:"mt-0.5 block text-xs font-normal text-slate-600",children:e.accessibleStatus})]}),void 0!==e.count&&(0,r.jsx)("span",{"aria-hidden":"true",className:"text-xs tabular-nums text-slate-500",children:e.count}),(0,r.jsx)("span",{className:"flex size-4 shrink-0",children:e.value===t&&(0,r.jsx)(s.A,{"aria-hidden":"true",className:"size-4 text-primary"})})]},e.value))});return(0,r.jsx)("div",{className:"map-option-selector min-w-0",onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),children:v?(0,r.jsxs)(l.bL,{open:g,onOpenChange:x,children:[(0,r.jsx)(l.l9,{asChild:!0,children:j}),(0,r.jsxs)(l.ZL,{children:[(0,r.jsx)(l.hJ,{className:"fixed inset-0 z-[2000] bg-black/30"}),(0,r.jsxs)(l.UC,{"aria-describedby":void 0,className:"fixed inset-x-0 bottom-0 z-[2001] flex max-h-[80dvh] flex-col rounded-t-2xl border border-slate-200 bg-white pb-[max(0.5rem,env(safe-area-inset-bottom))] text-slate-900 shadow-xl",children:[(0,r.jsxs)("div",{className:"flex shrink-0 items-center justify-between border-b border-slate-100 px-4 py-2",children:[(0,r.jsx)(l.hE,{className:"font-semibold",children:e}),(0,r.jsx)(l.bm,{"aria-label":"Cerrar selector",className:"flex size-11 items-center justify-center rounded-lg hover:bg-slate-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",children:(0,r.jsx)(o.A,{"aria-hidden":"true",className:"size-5"})})]}),N]})]})]}):(0,r.jsxs)(d.AM,{open:g,onOpenChange:x,children:[(0,r.jsx)(d.Wv,{asChild:!0,children:j}),(0,r.jsxs)(d.hl,{side:"top",align:"start",sideOffset:8,collisionPadding:12,"aria-labelledby":y,className:"z-[2001] flex max-h-[min(32rem,var(--radix-popover-content-available-height))] w-80 max-w-[calc(100vw-1.5rem)] flex-col overflow-hidden rounded-xl border-slate-200 bg-white p-0 text-slate-900 shadow-xl",children:[(0,r.jsxs)("div",{className:"flex shrink-0 items-center justify-between border-b border-slate-100 px-4 py-1.5",children:[(0,r.jsx)("h2",{id:y,className:"text-sm font-semibold",children:e}),(0,r.jsx)("button",{type:"button","aria-label":"Cerrar selector",onClick:()=>x(!1),className:"flex size-11 items-center justify-center rounded-lg hover:bg-slate-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",children:(0,r.jsx)(o.A,{"aria-hidden":"true",className:"size-4"})})]}),N]})]})})}},45803:(e,t,a)=>{a.d(t,{d:()=>l});var r=a(3747),i=a(11286),n=a(50535);async function s(e,t,a=fetch){let i=await a((0,r.SI)(e),{headers:{Accept:"application/json"},signal:t});if(!i.ok)throw Error(`observation_map_${i.status}`);let n=(0,r.rE)(await i.json());if(n.region.id!==e)throw Error("observation_map_region_mismatch");return n}async function o(e,t,a=fetch){let r="cordillera"===e,i=r?"/observation-boundaries/cordillera.json":`/api/weather/regions/${encodeURIComponent(e)}/boundary`;try{let e=await a(i,{headers:{Accept:"application/geo+json, application/json"},signal:t});if(!e.ok)throw Error(`observation_boundary_${e.status}`);return(0,n.Hu)(await e.json())}catch(e){if(r||t.aborted)throw e;return null}}async function l(e,t,a=fetch){let[r,n,d]=await Promise.all([s(e,t,a),o(e,t,a),"cordillera"===e?s("asturias",t,a):Promise.resolve(null)]);return{data:d&&n?function(e,t,a){let r=new Map;for(let n of[...e.stations,...t.stations]){let{lng:e,lat:t}=n.station.coordinates;if(!(0,i.wt)([e,t],a))continue;let s=r.get(n.station.idema);(!s||Date.parse(n.observedAt)>Date.parse(s.observedAt)||Date.parse(n.observedAt)===Date.parse(s.observedAt)&&Date.parse(n.fetchedAt)>Date.parse(s.fetchedAt))&&r.set(n.station.idema,n)}return{...e,stations:[...r.values()],publishedAt:Date.parse(e.publishedAt)<=Date.parse(t.publishedAt)?e.publishedAt:t.publishedAt}}(r,d,n):r,boundary:n}}},81477:(e,t,a)=>{a.d(t,{Wu:()=>s,Zp:()=>n});var r=a(95155);a(12115);var i=a(40980);function n({className:e,...t}){return(0,r.jsx)("div",{"data-slot":"card",className:(0,i.cn)("bg-card/95 text-card-foreground flex flex-col gap-2 rounded-xl border shadow-sm",e),...t})}function s({className:e,...t}){return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,i.cn)("px-6",e),...t})}},89239:(e,t,a)=>{a.d(t,{$:()=>l});var r=a(95155);a(12115);var i=a(42442),n=a(18460),s=a(40980);let o=(0,n.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function l({className:e,variant:t="default",size:a="default",asChild:n=!1,...d}){let c=n?i.DX:"button";return(0,r.jsx)(c,{"data-slot":"button","data-variant":t,"data-size":a,className:(0,s.cn)(o({variant:t,size:a,className:e})),...d})}},91519:(e,t,a)=>{a.d(t,{SynopticMap:()=>G});var r=a(95155),i=a(56440),n=a(18281),s=a(58120),o=a(73321),l=a(12115),d=a(81477),c=a(89239),u=a(74526),m=a(20200),p=a(7484),b=a(98237),f=a(10647),h=a(62312),g=a(59320),x=a(56572),v=a(34152),y=a(20232),w=a(41641),j=a(62950),N=a(40980);let k=[{id:"temperature",label:"Temperatura",icon:u.A},{id:"precipitation",label:"Precipitaci\xf3n",icon:m.A},{id:"wind",label:"Viento",icon:p.A},{id:"tmax",label:"Temp. M\xe1xima",icon:b.A},{id:"tmin",label:"Temp. M\xednima",icon:f.A},{id:"precipitation_total",label:"Lluvia Acumulada",icon:h.A},{id:"wind_max",label:"Racha Viento",icon:g.A}],A=["temperature","precipitation","wind"];function E(){let e=(0,o.useSearchParams)(),[t,a]=(0,l.useState)("asturias"),[i,n]=(0,l.useState)(()=>{let t=e.get("layer");return t&&k.some(e=>e.id===t)?t:"temperature"});(0,l.useEffect)(()=>{let t=e.get("layer");t&&k.some(e=>e.id===t)&&n(t)},[e]);let[s,u]=(0,l.useState)([]),[p,b]=(0,l.useState)(!0),[f,h]=(0,l.useState)(0),[g,E]=(0,l.useState)(!1),[S,$]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e;return S&&s.length>0&&(e=setInterval(()=>{h(e=>0===e?s.length-1:e-1)},800)),()=>clearInterval(e)},[S,s]),(0,l.useEffect)(()=>{let e=!0;return(async()=>{b(!0),$(!1);let a="precipitation_total"===i?"precipitation":i,r=A.includes(i),n=`${t}_${a}_`,o=s[f],l=null;if(o){let e=o.match(/(T\d{2}|20\d{8}|20\d{6})/);e&&(l=e[1])}try{let a=await fetch((0,j.dv)(r?"hourly":"daily",n)),s=await a.json();if(e&&s.files&&Array.isArray(s.files)&&s.files.length>0){let e=0;if(l){let t=s.files.findIndex(e=>e.includes(l));-1!==t&&(e=t)}u(s.files),h(e),E(!1)}else u([]),console.warn("No maps found for",t,i)}catch(t){console.error("Failed to fetch map list:",t),e&&u([])}finally{e&&b(!1)}})(),()=>{e=!1}},[t,i]);let C=(0,l.useCallback)(e=>{let t=A.includes(i);return(0,j.jP)(t?"hourly":"daily",e)},[i]);return(0,r.jsxs)("div",{className:"w-full flex flex-col gap-6",children:[(0,r.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg text-primary",children:(0,r.jsx)(x.A,{className:"w-6 h-6"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-2xl font-bold tracking-tight",children:"Tiempo Actual"}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm hidden md:block",children:"Mapas meteorol\xf3gicos de alta resoluci\xf3n"})]})]}),(0,r.jsx)("div",{className:"flex bg-muted p-1 rounded-xl border border-border shadow-sm self-start md:self-auto",children:["asturias","
1spain"].map(e=>(0,r.jsx)("button",{onClick:()=>a(e),className:(0,N.cn)("px-4 py-1.5 text-sm font-medium rounded-lg transition-all cursor-pointer",t===e?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,r.jsxs)("div",{className:"flex flex-col md:flex-row gap-6",children:[(0,r.jsx)("div",{className:"flex md:flex-col gap-2 overflow-x-auto pb-2 md:pb-0 no-scrollbar md:w-48 shrink-0",children:k.map(e=>{let t=e.icon,a=i===e.id;return(0,r.jsxs)("button",{onClick:()=>n(e.id),className:(0,N.cn)("flex flex-col md:flex-row items-center gap-2 md:gap-3 p-3 rounded-xl transition-all border cursor-pointer",a?"bg-primary text-primary-foreground border-primary shadow-md":"bg-card/95 text-card-foreground border-border hover:bg-accent/50 hover:border-accent"),children:[(0,r.jsx)(t,{className:(0,N.cn)("w-6 h-6 md:w-5 md:h-5",a?"text-white":"text-muted-foreground")}),(0,r.jsx)("span",{className:(0,N.cn)("text-xs md:text-sm font-medium whitespace-nowrap",a?"text-white":""),children:e.label})]},e.id)})}),(0,r.jsx)(d.Zp,{className:"w-full relative bg-muted/20 border-border overflow-hidden flex flex-col group shadow-sm ring-1 ring-border/50",children:(0,r.jsxs)("div",{className:"flex flex-col w-full",children:[(0,r.jsxs)("div",{className:"relative w-full bg-black/5 dark:bg-black/20 overflow-hidden aspect-[4170/2378]",children:[p&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-card/95 backdrop-blur-sm z-10 transition-all duration-300",children:(0,r.jsx)("div",{className:"flex flex-col items-center gap-2",children:(0,r.jsx)("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"})})}),s.length>0&&!g?(0,r.jsx)("img",{src:C(s[f]),alt:`Mapa ${t} ${i}`,className:"absolute inset-0 w-full h-full object-cover",onLoad:()=>b(!1),onError:()=>{b(!1),E(!0)}}):p?null:(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[(0,r.jsx)(m.A,{className:"w-12 h-12 mb-2 opacity-20"}),(0,r.jsx)("p",{children:"No hay datos disponibles"})]})]}),(0,r.jsx)("div",{className:"w-full min-h-[4rem] relative",children:s.length>1&&(0,r.jsxs)("div",{className:"bg-background/80 backdrop-blur-md border-t border-border/50 p-3 flex flex-col gap-2 z-20 absolute inset-0 h-full justify-center",children:[(0,r.jsx)("div",{className:"relative h-1 w-full bg-secondary/50 rounded-full overflow-hidden cursor-pointer group/slider transition-all",onClick:e=>{let t=e.currentTarget.getBoundingClientRect(),a=Math.floor((e.clientX-t.left)/t.width*s.length),r=s.length-1-a;h(Math.max(0,Math.min(s.length-1,r)))},children:(0,r.jsx)("div",{className:"absolute top-0 bottom-0 left-0 bg-primary transition-all duration-150 ease-linear",style:{width:`${(s.length-1-f)/(s.length-1)*100}%`}})}),(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded-md hover:bg-muted hover:text-primary",onClick:()=>$(!S),children:S?(0,r.jsx)(v.A,{className:"w-3 h-3 fill-current"}):(0,r.jsx)(y.A,{className:"w-3 h-3 fill-current ml-0.5"})}),(0,r.jsx)("div",{className:"h-4 w-px bg-border/50 mx-1"}),(0,r.jsx)("div",{className:"font-mono text-xs font-semibold tracking-tight text-foreground",children:(e=>{let t=e.match(/T(\d{2})/);if(t)return`${t[1]}:00`;let a=e.match(/(\d{8})/);if(a){let e=a[1],t=e.substring(6,8),r=e.substring(4,6);return`${t}/${r}`}return"Prev"})(s[f])})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-muted-foreground hover:text-foreground",onClick:()=>{$(!1),h(e=>Math.min(s.length-1,e+1))},disabled:f===s.length-1,children:(0,r.jsx)(w.A,{className:"w-3 h-3"})}),(0,r.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-muted-foreground hover:text-foreground transform rotate-180",onClick:()=>{$(!1),h(e=>Math.max(0,e-1))},disabled:0===f,children:(0,r.jsx)(w.A,{className:"w-3 h-3"})})]})]})]})})]})})]})]})}var S=a(37206),$=a(20986),C=a(66669),z=a(50061),D=a(48144),M=a(33024),P=a(65246),R=a(35620);let T=[{id:"temperature",label:"Temperatura",icon:u.A},{id:"pressure",label:"Presi\xf3n",icon:C.A},{id:"humidity",label:"Humedad",icon:z.A},{id:"precipitation",label:"Precipitaci\xf3n",icon:m.A},{id:"gust",label:"Racha m\xe1xima",icon:p.A},{id:"windDirection",label:"Direcci\xf3n del viento",icon:D.A}];
1function I({state:e,onChange:t}){return(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,r.jsx)("div",{className:"min-w-0 flex-1",children:(0,r.jsx)(R.R,{label:"Dato meteorol\xf3gico mostrado",value:e.metric,options:T.map(({id:e,label:t,icon:a})=>({value:e,label:t,icon:(0,r.jsx)(a,{"aria-hidden":"true",className:"size-5 text-sky-700"})})),onValueChange:a=>t({...e,metric:a,localRadar:null})})}),"precipitation"===e.metric&&(0,r.jsx)("button",{type:"button","aria-pressed":!!e.rainToday,"aria-label":"Precipitaci\xf3n acumulada de hoy",onClick:()=>t({...e,rainToday:!e.rainToday}),className:(0,N.cn)("min-h-11 shrink-0 rounded-xl border px-4 text-sm font-semibold shadow-sm focus-visible:ring-2 focus-visible:ring-sky-600",e.rainToday?"border-primary bg-primary text-white":"border-slate-200 bg-white text-slate-900"),children:"Hoy"})]})}function _({state:e,onChange:t}){let a=a=>t({...e,...a,localRadar:null});return(0,r.jsxs)("div",{className:"flex shrink-0 flex-wrap gap-2",role:"group","aria-label":"Capas visibles",children:[(0,r.jsxs)("button",{type:"button","aria-pressed":e.stationsEnabled,onClick:()=>a({stationsEnabled:!e.stationsEnabled}),className:(0,N.cn)("inline-flex min-h-11 items-center gap-2 rounded-xl border px-3 text-sm font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e.stationsEnabled?"border-primary bg-primary text-primary-foreground":"bg-background"),children:[(0,r.jsx)(M.A,{className:"h-4 w-4","aria-hidden":"true"})," Estaciones"]}),(0,r.jsxs)("button",{type:"button","aria-pressed":e.radarEnabled,onClick:()=>a({radarEnabled:!e.radarEnabled}),className:(0,N.cn)("inline-flex min-h-11 items-center gap-2 rounded-xl border px-3 text-sm font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e.radarEnabled?"border-sky-600 bg-sky-600 text-white":"bg-background"),children:[(0,r.jsx)(P.A,{className:"h-4 w-4","aria-hidden":"true"})," Radar"]})]})}var L=a(89999),F=a(97617),U=a(94388);function Z(e=new Date){return new Intl.DateTimeFormat("en-CA",{timeZone:"Europe/Madrid",year:"numeric",month:"2-digit",day:"2-digit"}).format(e)}async function H(e,t,a=fetch,r=Z()){let i=await a((0,U.tZ)({region:e.region.id},"day",r),{signal:t,cache:"no-store",headers:{Accept:"application/json"}});if(!i.ok)throw Error("daily_rain_unavailable");let n=(0,U.f3)(await i.json());if(n.target.region!==e.region.id||"day"!==n.period.mode||n.period.value!==r||"observations"!==n.period.source)throw Error("daily_rain_mismatch");let s=new Map(n.rankings.rain.map(e=>[e.idema,e]));return{date:r,partial:e.stations.some(({station:e})=>{let t=s.get(e.idema);return!t||t.available<t.expected}),data:{...e,stations:e.stations.map(e=>({...e,metrics:{...e.metrics,precipitationMm:s.get(e.station.idema)?.value??null}}))}}}var O=a(45803),W=a(8764),B=a(50535);let V=(0,S.default)(()=>Promise.all([a.e(6648),a.e(1761),a.e(8500),a.e(4601),a.e(2935)]).then(a.bind(a,62935)),{loadableGenerated:{webpack:()=>[62935]},ssr:!1,loading:()=>(0,r.jsx)("div",{className:`${F.Pz} animate-pulse bg-muted`})});function X({state:e,onStateChange:t}){let{regions:a,loading:i}=(0,L.B)(),n=a.find(({id:t})=>t===e.region);return i?(0,r.jsx)("div",{className:`${F.Pz} animate-pulse rounded-2xl bg-muted`,"aria-label":"Cargando mapa"}):e.localRadar||(0,F.p8)(n)?(0,r.jsx)("div",{style:{"--observation-map-ratio":"galicia"===e.region?"1":"3 / 2"},children:(0,r.jsx)(q,{state:e,onStateChange:t},`${e.region}-${"precipitation"===e.metric&&!!e.rainToday}`)}):(0,r.jsxs)("div",{className:"rounded-2xl border bg-card p-6 text-sm text-muted-foreground",role:"status",children:["El mapa de observaciones no est\xe1 disponible para ",n?.label??"esta regi\xf3n",". Selecciona una comunidad desde la cabecera."]})}function q({state:e,onStateChange:t}){let[a,i]=(0,l.useState)(null),[n,s]=(0,l.useState)(null),[o,d]=(0,l.useState)(null),[c,u]=(0,l.useState)(!0),[m,p]=(0,l.useState)(!1),[b,f]=(0,l.useState)(0),h="precipitation"===e.metric&&!!e.rainToday,[g,x]=(0,l.useState)(null),[v,y]=(0,l.useState)(Z);(0,l.useEffect)(()=>{let e=setInterval(()=>y(Z()),6e4);return()=>clearInterval(e)},[]);let[w,j]=(0,l.useState)(null),[N,k]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let t=new AbortController;return(async()=>
1{if(await Promise.resolve(),!t.signal.aborted){u(!0),p(!1),i(null),s(null),d(null);try{let{data:a,boundary:r}=await (0,O.d)(e.region,t.signal);if(t.signal.aborted)return;let n={boundary:r,bounds:r?(0,B.DJ)(r):null},o=h?await H(a,t.signal,fetch,v):null;if(t.signal.aborted)return;i(o?.data??a),x(o?{date:o.date,partial:o.partial}:null),s(n.boundary),d(n.bounds)}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;p(!0)}finally{t.signal.aborted||u(!1)}}})(),()=>t.abort()},[b,e.region,h,v]),(0,l.useEffect)(()=>{if(!e.radarEnabled)return;let t=new AbortController;return(async()=>{if(await Promise.resolve(),!t.signal.aborted){j(null),k(!1);try{let e=await fetch((0,W.lS)(),{headers:{Accept:"application/json"},signal:t.signal});if(!e.ok)throw Error(`radar_${e.status}`);j((0,W.v7)(await e.json()))}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;j(null),k(!0)}}})(),()=>t.abort()},[e.radarEnabled]);let A=(0,l.useCallback)(()=>f(e=>e+1),[]),E=(0,F.i5)(e),S=a?.stations??[],C=(0,F.uu)({loading:c,observationsAvailable:null!==a&&!m,stationCount:S.length,stationsEnabled:e.stationsEnabled,radarVisible:e.radarEnabled&&null!==w});return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border bg-card shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b px-4 py-3 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{children:a?`${a.stations.length} estaciones \xb7 Datos provisionales`:"Observaciones AEMET"}),(0,r.jsx)("span",{children:e.radarEnabled&&w?`Radar ${(0,W.C6)(w.freshness).toLowerCase()}`:e.radarEnabled?"Radar no disponible":"Radar desactivado"})]}),"loading"===C?(0,r.jsx)("div",{className:`${F.Pz} animate-pulse bg-muted`,"aria-live":"polite",children:(0,r.jsx)("span",{className:"sr-only",children:"Cargando estaciones"})}):"error"===C?(0,r.jsxs)("div",{className:`${F.Pz} flex flex-col items-center justify-center gap-3 p-6 text-center`,"aria-live":"polite",children:[(0,r.jsx)("p",{className:"font-semibold",children:"No se pudieron cargar las estaciones de esta zona."}),(0,r.jsxs)("button",{type:"button",onClick:A,className:"inline-flex min-h-11 items-center gap-2 rounded-xl border px-4 text-sm font-semibold",children:[(0,r.jsx)($.A,{className:"h-4 w-4","aria-hidden":"true"})," Reintentar"]})]}):"empty"===C?(0,r.jsx)("p",{className:`${F.Pz} p-8 text-center text-sm text-muted-foreground`,children:"No hay estaciones publicadas dentro de esta zona."}):(0,r.jsx)(V,{controls:(0,r.jsx)("div",{className:"absolute bottom-4 left-4 z-[500] w-[calc(100%-2rem)] max-w-80",children:(0,r.jsx)(I,{state:e,onChange:t})}),boundary:n,boundaryBounds:o,localRadar:e.localRadar,rainToday:h,metric:e.metric,onRadarFrameError:()=>{j(null),k(!0)},radar:e.radarEnabled?w:null,regionId:e.region,returnPath:E,stations:S,stationsEnabled:e.stationsEnabled}),"map"!==C&&(0,r.jsx)("div",{className:"border-t p-4",children:(0,r.jsx)(I,{state:e,onChange:t})})]}),h&&(0,r.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:c?"Cargando acumulado de hoy…":m?"No se pudo cargar el acumulado de hoy. Puedes reintentar o desactivar Hoy.":`Acumulado desde las 00:00 (hora peninsular) \xb7 ${g?.date??v}${g?.partial?" \xb7 Cobertura incompleta: faltan horas en algunas estaciones.":""}`}),m&&"map"===C&&e.stationsEnabled&&(0,r.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300",role:"status",children:"Las estaciones no est\xe1n disponibles ahora; el radar sigue visible."}),e.radarEnabled&&N&&(0,r.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300",role:"status",children:e.stationsEnabled&&S.length>0?"El radar no est\xe1 disponible ahora; las estaciones siguen activas.":"El radar no est\xe1 disponible ahora."})]})}function G({stateMode:e}){let t=(0,o.usePathname)(),a=(0,o.useRouter)(),d=(0,o.useSearchParams)(),{scope:c,region:u,regions:m,loading:p,setScope:b}=(0,L.B)(),f=(0,l.useMemo)(()=>(0,F.Xi)(d),[d]),[h,g]=(0,l.useState)(()=>(0,F.Xi)(new URLSearchParams)),x="url"===e?f:h,v=(0,l.useMemo)(()=>({...x,region:c}),[x,c]),y=(0,l.useRef)(null),w=(0,l.useRef)(null);(0,l.useEffect)(()=>
1{if("url"!==e||"/mapas"!==t||p)return;let r=1===d.getAll("region").length?d.get("region"):null,i=y.current;if(null!==w.current&&w.current===r&&r!==c&&i?.scope===c)return;w.current=null;let n=null!==i&&i.scope!==c,s=null===i||i.queryRegion!==r;if(y.current={scope:c,queryRegion:r},!n&&s&&r!==c&&m.some(({id:e})=>e===r)){w.current=r,b(r);return}let o=(0,F.i5)({...v,localRadar:n?null:v.localRadar}),l=`${t}${d.size>0?`?${d.toString()}`:""}`;(0,F.xD)(t,l,o)&&a.replace(o,{scroll:!1})},[p,t,m,a,c,d,b,v,e]);let j=(0,l.useCallback)(t=>{"url"===e?a.replace((0,F.i5)(t),{scroll:!1}):g(t)},[a,e]);return(0,r.jsxs)(i.bL,{value:v.mode,onValueChange:e=>{("observations"===e||"prediction"===e)&&j({...v,mode:e,localRadar:null})},className:"w-full",children:[(0,r.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)(i.B8,{"aria-label":"Tipo de mapa meteorol\xf3gico",className:"grid w-full max-w-md grid-cols-2 rounded-xl border bg-muted p-1",children:[(0,r.jsxs)(i.l9,{value:"observations",className:(0,N.cn)("flex min-h-11 items-center justify-center gap-2 rounded-lg px-3 text-sm font-semibold transition-colors","data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm","data-[state=inactive]:text-muted-foreground data-[state=inactive]:hover:text-foreground"),children:[(0,r.jsx)(n.A,{className:"h-4 w-4","aria-hidden":"true"}),"Observaciones"]}),(0,r.jsxs)(i.l9,{value:"prediction",className:(0,N.cn)("flex min-h-11 items-center justify-center gap-2 rounded-lg px-3 text-sm font-semibold transition-colors","data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm","data-[state=inactive]:text-muted-foreground data-[state=inactive]:hover:text-foreground"),children:[(0,r.jsx)(s.A,{className:"h-4 w-4","aria-hidden":"true"}),"Predicci\xf3n"]})]}),"observations"===v.mode&&((0,F.p8)(u)||v.localRadar)&&(0,r.jsx)(_,{state:v,onChange:j})]}),(0,r.jsx)(i.UC,{value:"observations",children:(0,r.jsx)(X,{state:v,onStateChange:j})}),(0,r.jsx)(i.UC,{value:"prediction",children:(0,r.jsx)(E,{})})]})}},94388:(e,t,a)=>{a.d(t,{BD:()=>p,Lr:()=>m,RZ:()=>d,XS:()=>b,_q:()=>f,f3:()=>c,tZ:()=>u});var r=a(62950);let i=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}$/.test(e)&&Number.isFinite(Date.parse(e))&&new Date(e).toISOString().slice(0,10)===e,n=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}T/.test(e)&&Number.isFinite(Date.parse(e)),s=e=>Number.isSafeInteger(e)&&Number(e)>=0;function o(e){if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Invalid extremes response")}function l(e){if(!e)throw Error("Invalid extremes response")}function d(e){return o(e),l(i(e.from)&&i(e.to)&&(null===e.configuredTo||i(e.configuredTo))&&n(e.updatedAt)&&(null===e.latestStoredDate||i(e.latestStoredDate))),e}function c(e){o(e),o(e.period),o(e.coverage),o(e.target),o(e.rankings),l(["available","partial","not_downloaded","out_of_range"].includes(String(e.status))),l(n(e.generatedAt));let t=e.period;l(["hour","day","month","year"].includes(String(t.mode))&&"string"==typeof t.value&&"boolean"==typeof t.current&&s(t.expected)&&["climate","observations"].includes(String(t.source))),l("climate"===t.source?i(t.from)&&i(t.to):n(t.from)&&n(t.to)),l(1===Object.keys(e.target).length&&("string"==typeof e.target.idema?/^[A-Za-z0-9]{1,12}$/.test(e.target.idema):"string"==typeof e.target.region&&/^[a-z0-9-]{1,40}$/.test(e.target.region))),null!==e.availability&&d(e.availability);let a=e.coverage;for(let t of(l(["expected","available","stations","stationsWithData"].every(e=>s(a[e]))&&"boolean"==typeof a.complete&&(null===a.latest||i(a.latest)||n(a.latest))),["high","low","rain","gust"])){let a=e.rankings[t];l(Array.isArray(a)&&a.length<=1e3);let r=new Set;for(let e of a)o(e),l("string"==typeof e.idema&&/^[A-Za-z0-9]{1,12}$/.test(e.idema)&&!r.has(e.idema)),r.add(e.idema),l("string"==typeof e.name&&e.name.length<=300&&"number"==typeof e.value&&Number.isFinite(e.value)&&(i(e.at)||n(e.at))&&s(e.rank)&&Number(e.rank)>0&&s(e.available)&&s(e.expected)&&"boolean"==typeof e.trace)}return e}function u(e,t,a){let i=new URL(e.idema?`/v1/climate/aemet/stations/${encodeURIComponent(e.idema)}/extremes`:"/v1/climate/aemet/extremes",(0,r.D8)());return e.region&&i.searchParams.set("region",e.region),i.searchParams.set("mode",t),a&&i.searchParams.set("value",a),i.toString()}function m(e){let t=new URL(e.idema?`/v1/climate/aemet/stations/${encodeURIComponent(e.idema)}/availability`:"/v1/climate/aemet/availability",(0,r.D8)());return e.region&&t.searchParams.set("region",e.region),t.toString()}function p(e,t,a,r){return"hour"===e||"day"===e&&t===r||!!a&&("day"===e?i(t)&&t>=a.from&&t<=a.to:"month"===e?/^\d{4}-(0[1-9]|1[0-2])$/.test(t)&&t>=a.from.slice(0,7)&&t<=a.to.slice(0,7):/^\d{4}$/.test(t)&&t>=a.from.slice(0,4)&&t<=a.to.slice(0,4))}function b(e){return new Intl.DateTimeFormat("es-ES",{timeZone:"Europe/Madrid",day:"2-digit",month:"2-digit",year:"numeric",...e.includes("T")?{hour:"2-digit",minute:"2-digit"}:{}}).format(new Date(e.includes("T")?e:`${e}T12:00:00Z`))}function f(e,t){if(!e)return"Sin dato";if("rain"===t&&e.trace&&0===e.value)return"Ip \xb7 inapreciable";let a="gust"===t?3.6*e.value:e.value;return`${new Intl.NumberFormat("es-ES",{maximumFractionDigits:1}).format(a)} ${"gust"===t?"km/h":"rain"===t?"mm":"\xb0C"}`}},97617:(e,t,a)=>{a.d(t,{F:()=>o,Nv:()=>w,Nw:()=>y,Pz:()=>n,U9:()=>s,Xi:()=>h,f6:()=>j,hU:()=>N,i5:()=>g,m5:()=>l,p8:()=>i,uu:()=>d,xD:()=>x});var r=a(8764);function i(e){return e?.kind==="official-community"||e?.kind==="curated"&&("cordillera"===e.id||"cantabrico"===e.id)}let n="aspect-[var(--observation-map-ratio,3/2)] w-full sm:aspect-auto sm:h-[62vh] sm:min-h-[440px]";function s(e,t,a){let r=[],i={},n=!1;for(let s of[...e].sort((e,t)=>
1e.y-t.y||e.x-t.x||e.id.localeCompare(t.id))){let e={x:s.x,y:s.y,score:1/0};for(let i=-132;i<=132;i+=6)for(let n=-132;n<=132;n+=6){let o=s.x+n,l=s.y+i;if(o<22||o>t-22||l<22||l>a-22||o<64&&l<98)continue;let d=n*n+i*i;if(d>=e.score)continue;let c=1e6*!!r.some(e=>36>Math.abs(o-e.x)&&28>Math.abs(l-e.y))+d;c<e.score&&(e={x:o,y:l,score:c})}r.push(e),n||=e.score>=1e6,i[s.id]=[e.x-s.x,e.y-s.y]}if(!n)return i;let s=[];for(let e=22;e<=a-22;e+=28)for(let a=22;a<=t-22;a+=36)(a>=64||e>=98)&&s.push({x:a,y:e});if(s.length<e.length)return i;let o=e.flatMap(e=>s.map((t,a)=>({id:e.id,index:a,dx:t.x-e.x,dy:t.y-e.y,distance:(t.x-e.x)**2+(t.y-e.y)**2}))).sort((e,t)=>e.distance-t.distance||e.id.localeCompare(t.id)||e.index-t.index),l=new Set,d=new Set;for(let e of o)l.has(e.id)||d.has(e.index)||(l.add(e.id),d.add(e.index),i[e.id]=[e.dx,e.dy]);return i}function o(e,t){if(e>=640)return{minWidth:292,maxWidth:320,maxHeight:void 0};let a=Math.max(180,Math.min(292,e-72));return{minWidth:a,maxWidth:a,maxHeight:Math.max(100,t-70)}}function l(e){return e<640?[22,24]:[24,24]}function d({loading:e,observationsAvailable:t,stationCount:a,stationsEnabled:r,radarVisible:i}){return i||!r?"map":e?"loading":t?a>0?"map":"empty":"error"}let c=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,u={temperatura:"temperature",presion:"pressure",precipitacion:"precipitation",humedad:"humidity",racha:"gust","direccion-viento":"windDirection",viento:"windDirection"},m={temperature:"temperatura",pressure:"presion",precipitation:"precipitacion",humidity:"humedad",gust:"racha",windDirection:"direccion-viento"},p=new Set(["temperature","precipitation","wind","tmax","tmin","precipitation_total","wind_max"]),b=new Set(["layer","lat","lng","zoom","location"]);function f(e,t){let a=e.getAll(t);return 1===a.length?a[0]??null:null}function h(e){let t,a=(t=[...e.keys()]).length!==b.size||t.some(t=>!b.has(t)||1!==e.getAll(t).length)?null:(0,r.zt)({layer:f(e,"layer")??void 0,lat:f(e,"lat")??void 0,lng:f(e,"lng")??void 0,zoom:f(e,"zoom")??void 0,location:f(e,"location")??void 0});if(a)return{mode:"observations",region:"asturias",metric:"temperature",stationsEnabled:!0,radarEnabled:!0,localRadar:a,forecastLayer:null};let i="prediccion"===f(e,"modo")?"prediction":"observations",n=f(e,"region"),s=f(e,"metrica"),o=f(e,"layer");return{mode:i,region:n&&c.test(n)?n:"asturias",metric:s&&s in u?u[s]:"temperature",..."hoy"===f(e,"lluvia")?{rainToday:!0}:{},stationsEnabled:"0"!==f(e,"estaciones"),radarEnabled:"1"===f(e,"radar"),localRadar:null,forecastLayer:o&&p.has(o)?o:null}}function g(e){if(e.localRadar)return(0,r.d1)(e.localRadar);let t=new URLSearchParams;return t.set("modo","prediction"===e.mode?"prediccion":"observaciones"),"prediction"===e.mode?e.forecastLayer&&p.has(e.forecastLayer)&&t.set("layer",e.forecastLayer):(t.set("region",c.test(e.region)?e.region:"asturias"),t.set("metrica",m[e.metric]),e.rainToday&&t.set("lluvia","hoy"),e.stationsEnabled||t.set("estaciones","0"),e.radarEnabled&&t.set("radar","1")),`/mapas?${t.toString()}`}function x(e,t,a){return"/mapas"===e&&t!==a}function v(e,t){return new Intl.NumberFormat("es-ES",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e)}function y(e,t){let a=t.metrics;return"temperature"===e?null===a.temperatureC?"Sin dato":`${v(a.temperatureC,0)}\xb0`:"precipitation"===e?null===a.precipitationMm?"—":v(a.precipitationMm,1):"humidity"===e?null===a.relativeHumidityPct?"—":`${v(a.relativeHumidityPct,0)}%`:"pressure"===e?null===a.pressureHpa?"—":v(a.pressureHpa,0):"gust"===e?null===a.gustSpeedMs?"—":v(Math.round(3.6*a.gustSpeedMs),0):null===a.windDirectionDeg?"—":`${v(Math.round(a.windDirectionDeg),0)}\xb0`}function w(e,t){let a=y(e,t);return"—"===a||"Sin dato"===a?"Sin dato":"temperature"===e?`${a.slice(0,-1)} \xb0C`:"precipitation"===e?`${a} mm`:"pressure"===e?`${a} hPa`:"humidity"===e?a:"gust"===e?`${a} km/h`:`Direcci\xf3n ${a}`}function j(e){return"temperature"===e?"Temperatura":"pressure"===e?"Presi\xf3n":"humidity"===e?"Humedad":"precipitation"===e?"Precipitaci\xf3n":"gust"===e?"Racha m\xe1xima":"Direcci\xf3n del viento"}function N(e){return e.replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("'","&#39;").replaceAll("<","&lt;").replaceAll(">","&gt;")}}}]);

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.