summaryrefslogtreecommitdiff
path: root/client/index.c61d0cc0.js
blob: 4f94a8ee80664a50ac2d48f3e7eccf00d01a38cb (plain) (blame)
1
import{S as e,i as t,s as a,e as s,c as n,a as r,d as l,b as i,f as o,g as c,n as d,w as u,h as p,j as f,k as h,l as m,t as g,m as v,o as _,p as w,q as b,r as k,u as $,v as E,x as D,y,z as I,A as j,B as O,C as V,D as T,E as x,F as q,G as M,H as P,I as S,J as N,K as C}from"./client.bf228d93.js";function A(e){let t,a,u,p,f,h,m,g,v;return{c(){t=s("div"),a=s("div"),u=s("div"),p=s("div"),f=s("div"),h=s("div"),m=s("div"),g=s("div"),v=s("div"),this.h()},l(e){t=n(e,"DIV",{class:!0});var s=r(t);a=n(s,"DIV",{class:!0}),r(a).forEach(l),u=n(s,"DIV",{class:!0}),r(u).forEach(l),p=n(s,"DIV",{class:!0}),r(p).forEach(l),f=n(s,"DIV",{class:!0}),r(f).forEach(l),h=n(s,"DIV",{class:!0}),r(h).forEach(l),m=n(s,"DIV",{class:!0}),r(m).forEach(l),g=n(s,"DIV",{class:!0}),r(g).forEach(l),v=n(s,"DIV",{class:!0}),r(v).forEach(l),s.forEach(l),this.h()},h(){i(a,"class","svelte-7k6qu0"),i(u,"class","svelte-7k6qu0"),i(p,"class","svelte-7k6qu0"),i(f,"class","svelte-7k6qu0"),i(h,"class","svelte-7k6qu0"),i(m,"class","svelte-7k6qu0"),i(g,"class","svelte-7k6qu0"),i(v,"class","svelte-7k6qu0"),i(t,"class","lds-roller svelte-7k6qu0")},m(e,s){o(e,t,s),c(t,a),c(t,u),c(t,p),c(t,f),c(t,h),c(t,m),c(t,g),c(t,v)},p:d,i:d,o:d,d(e){e&&l(t)}}}class J extends e{constructor(e){super(),t(this,e,null,A,a,{})}}const B=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];function H(e){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e))return e;if(/^\d{4}\s[a-z,A-Z]+\s\d{2}$/.test(e)){let t=e.split(" ");return e=`${t[0]}-${function(e,t=2){let a=e.toString();for(;t-a.length>0;)a="0"+a;return a}(function(e){if("string"!=typeof e)throw new Error(`Cannot get month number of ${typeof e}...`);if(e.length<3)throw new Error(`Cannot get month number string "${e}" of length ${e.length}...`);e=e.substring(0,3).toLowerCase();let t=B.indexOf(e);if(-1===t)throw new Error(`Could not find the month ${e}.`);return t}(t[1]))}-${t[2]}T00:00:00Z`}return/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}/.test(e)?e.replace(" ","T")+"Z":/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{4}/.test(e)?e.replace(" ","T").split(".")[0]+"Z":(console.warn(e),e)}function K(e){return e=H(e),new Date(e)}const z=u("light");setInterval((function(){if("undefined"==typeof window)return;let e=window.matchMedia("(prefers-color-scheme:dark)").matches?"dark":"light";e!=p(z)&&z.set(e)}),1e3),z.subscribe((e=>{"undefined"!=typeof window&&("dark"==e?window.document.body.classList.add("dark"):window.document.body.classList.remove("dark"))}));const L={updated:new Date(0,0,0),updating:!0};let Z=X("navigator_location"),F=X("earth_weather"),G=X("space_weather");const R=u(Y("navigator_location")?function(e){return e.updated=new Date(e.updated),e}(Z):Object.assign(Object.assign({},L),{available:!1,longitude:null,latitude:null,city:null})),Q=u(Y("earth_weather")?function(e){let t=e;return t.updated=new Date(t.updated),t.yr_data_raw.properties.meta.updated_at=new Date(t.yr_data_raw.properties.meta.updated_at),t.yr_data_raw.properties.timeseries=t.yr_data_raw.properties.timeseries.map((e=>Object.assign(Object.assign({},e),{time:new Date(e.time)}))),t}(F):Object.assign(Object.assign({},L),{available:!1})),U=u(Y("space_weather")?function(e){let t=e;return t.updated=new Date(t.updated),t.usnoaa_data_raw.geospace_pred_est_kp_1_hour=t.usnoaa_data_raw.geospace_pred_est_kp_1_hour.map((e=>Object.assign(Object.assign({},e),{model_prediction_time:new Date(e.model_prediction_time)}))),t.usnoaa_data_raw.noaa_planetary_k_index_forecast=t.usnoaa_data_raw.noaa_planetary_k_index_forecast.map((e=>Object.assign(Object.assign({},e),{time:new Date(e.time)}))),t.usnoaa_data_raw.outlook_27_day=t.usnoaa_data_raw.outlook_27_day.map((e=>Object.assign(Object.assign({},e),{time:new Date(e.time)}))),t.usnoaa_data_raw.solar_wind_mag_field.TimeStamp=new Date(t.usnoaa_data_raw.solar_wind_mag_field.TimeStamp),t}(G):Object.assign({},L));function W(e,t){"undefined"!=typeof window&&localStorage.setItem(e,JSON.stringify(t))}function X(e){if("undefined"!=typeof window)return JSON.parse(localStorage.getItem(e))}function Y(e){return"undefined"!=typeof window&&localStorage.hasOwnProperty(e)}async function ee(){if("undefined"==typeof window)return;let e;ae(R,!0);try{e=await async function(){return new Promise(((e,t)=>{"undefined"!=typeof navigator?navigator.geolocation.getCurrentPosition((t=>{e({longitude:t.coords.longitude,latitude:t.coords.latitude})}),(e=>{t(e)})):t(Error())}))}()}catch(e){if(0==p(R).available)return;return console.log(e),R.update((e=>Object.assign(Object.assign({},e),{available:!1,city:null,longitude:null,latitude:null}))),void ae(R,!1)}if(p(R).available&&Date.now()-p(R).updated<3e5)return void ae(R,!1,!1);let t={city:void 0};try{let a=await fetch(`https://geocode.xyz/${e.latitude},${e.longitude}?geoit=json`);t=await a.json()}catch(e){console.log(e)}R.update((a=>Object.assign(Object.assign(Object.assign({},a),{available:!0,city:t.city}),e))),ae(R,!1)}async function te(){if("undefined"==typeof window)return;if(Date.now()-p(U).updated<3e5)return;let e;ae(U,!0);try{e=await async function(){let e,t={now:{bz:"-",bt:"-",kp:"-",kp_min:"-",kp_max:"-"},usnoaa_data_raw:{solar_wind_mag_field:!1,noaa_planetary_k_index_forecast:!1,geospace_pred_est_kp_1_hour:!1,outlook_27_day:!1}},a=await fetch("https://services.swpc.noaa.gov/products/summary/solar-wind-mag-field.json");e=await a.json(),e.TimeStamp=K(e.TimeStamp),t.usnoaa_data_raw.solar_wind_mag_field=e,t.now.bz=t.usnoaa_data_raw.solar_wind_mag_field.Bz,t.now.bt=t.usnoaa_data_raw.solar_wind_mag_field.Bt,a=await fetch("https://services.swpc.noaa.gov/json/geospace/geospace_pred_est_kp_1_hour.json"),e=await a.json(),e=e.map((e=>Object.assign(Object.assign({},e),{model_prediction_time:K(e.model_prediction_time)}))),t.usnoaa_data_raw.geospace_pred_est_kp_1_hour=e,a=await fetch("https://services.swpc.noaa.gov/text/27-day-outlook.txt"),e=await a.text(),e=[...e.matchAll(/^(?<time>\d{4}\s.{3}\s\d{2})\s+(?<flux107>\d+)\s+(?<aindex>\d+)\s+(?<kindex>\d+)$/gm)],e=e.map((e=>Object.assign(Object.assign({},e.groups),{time:K(e.groups.time)}))),t.usnoaa_data_raw.outlook_27_day=e,a=await fetch("https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json"),e=await a.json(),e.shift(),t.usnoaa_data_raw.noaa_planetary_k_index_forecast=e;let s=new Date,n=new Date(0,0,0),r=1e3,l=0;return t.usnoaa_data_raw.noaa_planetary_k_index_forecast.forEach(((e,a)=>{e[1]>l&&(l=e[1]),e[1]<r&&(r=e[1]);let i=K(e[0]);Math.abs(i.getTime()-s.getTime())<Math.abs(n.getTime()-s.getTime())&&(n=i,t.now.kp=e[1]),t.usnoaa_data_raw.noaa_planetary_k_index_forecast[a]={time:i,kp:e[1],observed:e[2]}})),t.now.kp_min=r.toString(),t.now.kp_max=l.toString(),console.log(t),t}()}catch(e){return console.error(e),void ae(U,!1,!1)}U.update((t=>Object.assign(Object.assign({},t),e))),ae(U,!1)}function ae(e,t=!1,a=!0){let s={};a&&!t&&(s={updated:new Date}),e.update((e=>Object.assign(Object.assign(Object.assign({},e),s),{updating:t})))}function se(e){let t,a,c;function d(e,t){return void 0!==e[2].city?re:ne}let u=d(e),p=u(e);return{c(){t=s("i"),a=f(),p.c(),c=h(),this.h()},l(e){t=n(e,"I",{class:!0}),r(t).forEach(l),a=m(e),p.l(e),c=h(),this.h()},h(){i(t,"class","symbol fas fa-map-marker-alt svelte-9kdo4s")},m(e,s){o(e,t,s),o(e,a,s),p.m(e,s),o(e,c,s)},p(e,t){u===(u=d(e))&&p?p.p(e,t):(p.d(1),p=u(e),p&&(p.c(),p.m(c.parentNode,c)))},d(e){e&&l(t),e&&l(a),p.d(e),e&&l(c)}}}function ne(e){let t,a,d,u,p,f,h=e[2].longitude+"",m=e[2].latitude+"";return{c(){t=s("h1"),a=g("long: "),d=g(h),u=s("br"),p=g("lat: "),f=g(m),this.h()},l(e){t=n(e,"H1",{class:!0});var s=r(t);a=v(s,"long: "),d=v(s,h),u=n(s,"BR",{}),p=v(s,"lat: "),f=v(s,m),s.forEach(l),this.h()},h(){i(t,"class","svelte-9kdo4s")},m(e,s){o(e,t,s),c(t,a),c(t,d),c(t,u),c(t,p),c(t,f)},p(e,t){4&t&&h!==(h=e[2].longitude+"")&&w(d,h),4&t&&m!==(m=e[2].latitude+"")&&w(f,m)},d(e){e&&l(t)}}}function re(e){let t,a,d=e[2].city+"";return{c(){t=s("h1"),a=g(d),this.h()},l(e){t=n(e,"H1",{class:!0});var s=r(t);a=v(s,d),s.forEach(l),this.h()},h(){i(t,"class","svelte-9kdo4s")},m(e,s){o(e,t,s),c(t,a)},p(e,t){4&t&&d!==(d=e[2].city+"")&&w(a,d)},d(e){e&&l(t)}}}function le(e){let t,a,s;function n(e,a){return 24&a&&(t=null),null==t&&(t=!!(Math.abs(e[3].updated-e[4].updated)>6e5)),t?oe:ie}let r=n(e,-1),i=r(e),c=e[1]>=3e5&&ce(e);return{c(){i.c(),a=f(),c&&c.c(),s=h()},l(e){i.l(e),a=m(e),c&&c.l(e),s=h()},m(e,t){i.m(e,t),o(e,a,t),c&&c.m(e,t),o(e,s,t)},p(e,t){r===(r=n(e,t))&&i?i.p(e,t):(i.d(1),i=r(e),i&&(i.c(),i.m(a.parentNode,a))),e[1]>=3e5?c?c.p(e,t):(c=ce(e),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null)},d(e){i.d(e),e&&l(a),c&&c.d(e),e&&l(s)}}}function ie(e){let t,a,i=e[0].toLocaleString("no-NO",{dateStyle:"medium",timeStyle:"short"})+"";return{c(){t=s("p"),a=g(i)},l(e){t=n(e,"P",{});var s=r(t);a=v(s,i),s.forEach(l)},m(e,s){o(e,t,s),c(t,a)},p(e,t){1&t&&i!==(i=e[0].toLocaleString("no-NO",{dateStyle:"medium",timeStyle:"short"})+"")&&w(a,i)},d(e){e&&l(t)}}}function oe(e){let t,a;return{c(){t=s("p"),a=g("There is more than 10 minutes difference between data updates")},l(e){t=n(e,"P",{});var s=r(t);a=v(s,"There is more than 10 minutes difference between data updates"),s.forEach(l)},m(e,s){o(e,t,s),c(t,a)},p:d,d(e){e&&l(t)}}}function ce(e){let t,a,d,u,p,f=Math.round(e[1]/60/1e3)+"";return{c(){t=s("span"),a=s("i"),d=g(" Data is "),u=g(f),p=g(" minutes old!"),this.h()},l(e){t=n(e,"SPAN",{style:!0});var s=r(t);a=n(s,"I",{class:!0}),r(a).forEach(l),d=v(s," Data is "),u=v(s,f),p=v(s," minutes old!"),s.forEach(l),this.h()},h(){i(a,"class","symbol fas fa-exclamation-circle"),_(t,"color","red")},m(e,s){o(e,t,s),c(t,a),c(t,d),c(t,u),c(t,p)},p(e,t){2&t&&f!==(f=Math.round(e[1]/60/1e3)+"")&&w(u,f)},d(e){e&&l(t)}}}function de(e){let t,a,u,p,h,_,b,k,$,E,D,y,I=e[4].now.kp+"",j=e[4].now.kp_max+"",O=e[4].now.kp_min+"";return{c(){t=s("h2"),a=g("KP "),u=g(I),p=f(),h=s("p"),_=s("span"),b=g("↑ KP "),k=g(j),$=f(),E=s("span"),D=g("↓ KP "),y=g(O),this.h()},l(e){t=n(e,"H2",{class:!0});var s=r(t);a=v(s,"KP "),u=v(s,I),s.forEach(l),p=m(e),h=n(e,"P",{});var i=r(h);_=n(i,"SPAN",{classname:!0});var o=r(_);b=v(o,"↑ KP "),k=v(o,j),o.forEach(l),$=m(i),E=n(i,"SPAN",{classname:!0});var c=r(E);D=v(c,"↓ KP "),y=v(c,O),c.forEach(l),i.forEach(l),this.h()},h(){i(t,"class","svelte-9kdo4s"),i(_,"classname","pr-2"),i(E,"classname","pl-2")},m(e,s){o(e,t,s),c(t,a),c(t,u),o(e,p,s),o(e,h,s),c(h,_),c(_,b),c(_,k),c(h,$),c(h,E),c(E,D),c(E,y)},p(e,t){16&t&&I!==(I=e[4].now.kp+"")&&w(u,I),16&t&&j!==(j=e[4].now.kp_max+"")&&w(k,j),16&t&&O!==(O=e[4].now.kp_min+"")&&w(y,O)},i:d,o:d,d(e){e&&l(t),e&&l(p),e&&l(h)}}}function ue(e){let t,a;return t=new J({}),{c(){y(t.$$.fragment)},l(e){I(t.$$.fragment,e)},m(e,s){j(t,e,s),a=!0},p:d,i(e){a||(E(t.$$.fragment,e),a=!0)},o(e){k(t.$$.fragment,e),a=!1},d(e){O(t,e)}}}function pe(e){let t,a,d,u,p,_,b,k,$,E,D,y,I,j,O,V=e[4].now.bz+"",T=e[4].now.bt+"",x=e[3].available&&fe(e);return{c(){t=s("div"),a=s("p"),d=g("BZ"),u=f(),p=s("p"),_=g(V),b=f(),k=s("div"),$=s("p"),E=g("BT"),D=f(),y=s("p"),I=g(T),j=f(),x&&x.c(),O=h(),this.h()},l(e){t=n(e,"DIV",{});var s=r(t);a=n(s,"P",{class:!0});var i=r(a);d=v(i,"BZ"),i.forEach(l),u=m(s),p=n(s,"P",{class:!0});var o=r(p);_=v(o,V),o.forEach(l),s.forEach(l),b=m(e),k=n(e,"DIV",{});var c=r(k);$=n(c,"P",{class:!0});var f=r($);E=v(f,"BT"),f.forEach(l),D=m(c),y=n(c,"P",{class:!0});var g=r(y);I=v(g,T),g.forEach(l),c.forEach(l),j=m(e),x&&x.l(e),O=h(),this.h()},h(){i(a,"class","svelte-9kdo4s"),i(p,"class","svelte-9kdo4s"),i($,"class","svelte-9kdo4s"),i(y,"class","svelte-9kdo4s")},m(e,s){o(e,t,s),c(t,a),c(a,d),c(t,u),c(t,p),c(p,_),o(e,b,s),o(e,k,s),c(k,$),c($,E),c(k,D),c(k,y),c(y,I),o(e,j,s),x&&x.m(e,s),o(e,O,s)},p(e,t){16&t&&V!==(V=e[4].now.bz+"")&&w(_,V),16&t&&T!==(T=e[4].now.bt+"")&&w(I,T),e[3].available?x?x.p(e,t):(x=fe(e),x.c(),x.m(O.parentNode,O)):x&&(x.d(1),x=null)},d(e){e&&l(t),e&&l(b),e&&l(k),e&&l(j),x&&x.d(e),e&&l(O)}}}function fe(e){let t,a,d,u,p,h,_,b,k,$,E,D,y,I,j,O=e[3].now.temp+"",V=e[3].now.clouds+"";return{c(){t=s("div"),a=s("p"),d=g("Temp"),u=f(),p=s("p"),h=g(O),_=g("°C"),b=f(),k=s("div"),$=s("p"),E=g("Clouds"),D=f(),y=s("p"),I=g(V),j=g("%"),this.h()},l(e){t=n(e,"DIV",{});var s=r(t);a=n(s,"P",{class:!0});var i=r(a);d=v(i,"Temp"),i.forEach(l),u=m(s),p=n(s,"P",{class:!0});var o=r(p);h=v(o,O),_=v(o,"°C"),o.forEach(l),s.forEach(l),b=m(e),k=n(e,"DIV",{});var c=r(k);$=n(c,"P",{class:!0});var f=r($);E=v(f,"Clouds"),f.forEach(l),D=m(c),y=n(c,"P",{class:!0});var g=r(y);I=v(g,V),j=v(g,"%"),g.forEach(l),c.forEach(l),this.h()},h(){i(a,"class","svelte-9kdo4s"),i(p,"class","svelte-9kdo4s"),i($,"class","svelte-9kdo4s"),i(y,"class","svelte-9kdo4s")},m(e,s){o(e,t,s),c(t,a),c(a,d),c(t,u),c(t,p),c(p,h),c(p,_),o(e,b,s),o(e,k,s),c(k,$),c($,E),c(k,D),c(k,y),c(y,I),c(y,j)},p(e,t){8&t&&O!==(O=e[3].now.temp+"")&&w(h,O),8&t&&V!==(V=e[3].now.clouds+"")&&w(I,V)},d(e){e&&l(t),e&&l(b),e&&l(k)}}}function he(e){let t,a,d,u,p,h,g,v,_,w,D,y,I=!e[2].updating&&e[2].available&&!e[3].updating&&!e[4].updating&&se(e),j=!e[3].updating&&!e[4].updating&&le(e);const O=[ue,de],V=[];function T(e,t){return e[4].updating||e[3].updating?0:1}v=T(e),_=V[v]=O[v](e);let x=!e[4].updating&&!e[3].updating&&pe(e);return{c(){t=s("div"),a=s("div"),d=s("div"),I&&I.c(),u=f(),p=s("div"),j&&j.c(),h=f(),g=s("div"),_.c(),w=f(),D=s("div"),x&&x.c(),this.h()},l(e){t=n(e,"DIV",{class:!0});var s=r(t);a=n(s,"DIV",{class:!0});var i=r(a);d=n(i,"DIV",{class:!0});var o=r(d);I&&I.l(o),o.forEach(l),u=m(i),p=n(i,"DIV",{class:!0});var c=r(p);j&&j.l(c),c.forEach(l),h=m(i),g=n(i,"DIV",{class:!0});var f=r(g);_.l(f),f.forEach(l),w=m(i),D=n(i,"DIV",{class:!0});var v=r(D);x&&x.l(v),v.forEach(l),i.forEach(l),s.forEach(l),this.h()},h(){i(d,"class","weatherCurrent-data-location svelte-9kdo4s"),i(p,"class","weatherCurrent-data-date"),i(g,"class","weatherCurrent-data-kp svelte-9kdo4s"),i(D,"class","current-details svelte-9kdo4s"),i(a,"class","weatherCurrent-data svelte-9kdo4s"),i(t,"class","weatherCurrent-wrapper svelte-9kdo4s")},m(e,s){o(e,t,s),c(t,a),c(a,d),I&&I.m(d,null),c(a,u),c(a,p),j&&j.m(p,null),c(a,h),c(a,g),V[v].m(g,null),c(a,w),c(a,D),x&&x.m(D,null),y=!0},p(e,[t]){e[2].updating||!e[2].available||e[3].updating||e[4].updating?I&&(I.d(1),I=null):I?I.p(e,t):(I=se(e),I.c(),I.m(d,null)),e[3].updating||e[4].updating?j&&(j.d(1),j=null):j?j.p(e,t):(j=le(e),j.c(),j.m(p,null));let a=v;v=T(e),v===a?V[v].p(e,t):(b(),k(V[a],1,1,(()=>{V[a]=null})),$(),_=V[v],_?_.p(e,t):(_=V[v]=O[v](e),_.c()),E(_,1),_.m(g,null)),e[4].updating||e[3].updating?x&&(x.d(1),x=null):x?x.p(e,t):(x=pe(e),x.c(),x.m(D,null))},i(e){y||(E(_),y=!0)},o(e){k(_),y=!1},d(e){e&&l(t),I&&I.d(),j&&j.d(),V[v].d(),x&&x.d()}}}function me(e,t,a){let s,n,r;D(e,R,(e=>a(2,s=e))),D(e,Q,(e=>a(3,n=e))),D(e,U,(e=>a(4,r=e)));let l=new Date(0,0,0),i=0;return setInterval((function(){let e=p(Q).updated,t=p(U).updated,s=new Date;s-t>s-e?(a(0,l=t),a(1,i=s-t)):(a(0,l=e),a(1,i=s-e))}),500),[l,i,s,n,r]}ee(),R.subscribe((async function(e=null){if("undefined"==typeof window)return;if(null===e)return;if(e.updating)return;if(!e.available)return Q.update((e=>Object.assign(Object.assign({},e),{available:!1}))),void ae(Q,!1);if(p(Q).available&&Date.now()-p(Q).updated<3e5)return;ae(Q,!0);let t=await fetch(`https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=${e.latitude}&lon=${e.longitude}`),a=await t.json(),s={clouds:null,temp:null};try{s.clouds=a.properties.timeseries[0].data.instant.details.cloud_area_fraction,s.temp=a.properties.timeseries[0].data.instant.details.air_temperature,a.properties.timeseries=a.properties.timeseries.map((e=>Object.assign(Object.assign({},e),{time:K(e.time)})))}catch(e){return console.error(e),void ae(Q,!1,!1)}Q.update((e=>Object.assign(Object.assign({},e),{yr_data_raw:a,now:s,available:!0}))),ae(Q,!1)})),te(),setInterval(ee,15e4),setInterval(te,15e4),R.subscribe((e=>W("navigator_location",e))),Q.subscribe((e=>W("earth_weather",e))),U.subscribe((e=>W("space_weather",e)));class ge extends e{constructor(e){super(),t(this,e,me,he,a,{})}}function ve(e){let t,a;const c=e[1].default,d=V(c,e,e[0],null);return{c(){t=s("div"),d&&d.c(),this.h()},l(e){t=n(e,"DIV",{class:!0});var a=r(t);d&&d.l(a),a.forEach(l),this.h()},h(){i(t,"class","chip svelte-1jb0ny7")},m(e,s){o(e,t,s),d&&d.m(t,null),a=!0},p(e,[t]){d&&d.p&&(!a||1&t)&&T(d,c,e,e[0],a?q(c,e[0],t,null):x(e[0]),null)},i(e){a||(E(d,e),a=!0)},o(e){k(d,e),a=!1},d(e){e&&l(t),d&&d.d(e)}}}function _e(e,t,a){let{$$slots:s={},$$scope:n}=t;return e.$$set=e=>{"$$scope"in e&&a(0,n=e.$$scope)},[n,s]}class we extends e{constructor(e){super(),t(this,e,_e,ve,a,{})}}function be(e){let t,a,u,p,h,b;return{c(){t=s("div"),a=s("div"),u=s("div"),p=f(),h=s("span"),b=g(e[1]),this.h()},l(s){t=n(s,"DIV",{class:!0,style:!0});var i=r(t);a=n(i,"DIV",{class:!0});var o=r(a);u=n(o,"DIV",{class:!0}),r(u).forEach(l),o.forEach(l),p=m(i),h=n(i,"SPAN",{class:!0});var c=r(h);b=v(c,e[1]),c.forEach(l),i.forEach(l),this.h()},h(){i(u,"class","bar svelte-1mo8cjf"),i(a,"class","bar-wrapper svelte-1mo8cjf"),i(h,"class","value svelte-1mo8cjf"),i(t,"class","wrapper svelte-1mo8cjf"),_(t,"--progress",100*e[0]+"%")},m(e,s){o(e,t,s),c(t,a),c(a,u),c(t,p),c(t,h),c(h,b)},p(e,[a]){2&a&&w(b,e[1]),1&a&&_(t,"--progress",100*e[0]+"%")},i:d,o:d,d(e){e&&l(t)}}}function ke(e,t,a){let{percentage:s}=t,{value:n}=t;return e.$$set=e=>{"percentage"in e&&a(0,s=e.percentage),"value"in e&&a(1,n=e.value)},[s,n]}class $e extends e{constructor(e){super(),t(this,e,ke,be,a,{percentage:0,value:1})}}function Ee(e){let t,a,u,p,h,_,w,b,$,D,V,T,x;D=new $e({props:{percentage:e[0]/9,value:e[0]}});let q=e[5]&&function(e){let t,a,u,p,h,_,w,b,k,$,E,D,y=Math.round(e[3])+"",I=Math.round(e[4])+"";return{c(){t=s("div"),a=s("p"),u=s("i"),p=f(),h=g(y),_=g("°C"),w=f(),b=s("p"),k=s("i"),$=f(),E=g(I),D=g("%"),this.h()},l(e){t=n(e,"DIV",{class:!0});var s=r(t);a=n(s,"P",{class:!0});var i=r(a);u=n(i,"I",{class:!0}),r(u).forEach(l),p=m(i),h=v(i,y),_=v(i,"°C"),i.forEach(l),w=m(s),b=n(s,"P",{class:!0});var o=r(b);k=n(o,"I",{class:!0}),r(k).forEach(l),$=m(o),E=v(o,I),D=v(o,"%"),o.forEach(l),s.forEach(l),this.h()},h(){i(u,"class","fas fa-thermometer-half svelte-m9qkku"),i(a,"class","svelte-m9qkku"),i(k,"class","fas fa-cloud svelte-m9qkku"),i(b,"class","svelte-m9qkku"),i(t,"class","svelte-m9qkku")},m(e,s){o(e,t,s),c(t,a),c(a,u),c(a,p),c(a,h),c(a,_),c(t,w),c(t,b),c(b,k),c(b,$),c(b,E),c(b,D)},p:d,d(e){e&&l(t)}}}(e);return{c(){t=s("div"),a=s("div"),u=s("h3"),p=g(e[2]),h=f(),_=s("p"),w=g(e[1]),b=f(),$=s("div"),y(D.$$.fragment),V=f(),T=s("div"),q&&q.c(),this.h()},l(s){t=n(s,"DIV",{class:!0});var i=r(t);a=n(i,"DIV",{class:!0});var o=r(a);u=n(o,"H3",{class:!0});var c=r(u);p=v(c,e[2]),c.forEach(l),h=m(o),_=n(o,"P",{class:!0});var d=r(_);w=v(d,e[1]),d.forEach(l),o.forEach(l),b=m(i),$=n(i,"DIV",{class:!0});var f=r($);I(D.$$.fragment,f),f.forEach(l),V=m(i),T=n(i,"DIV",{class:!0});var g=r(T);q&&q.l(g),g.forEach(l),i.forEach(l),this.h()},h(){i(u,"class","svelte-m9qkku"),i(_,"class","svelte-m9qkku"),i(a,"class","svelte-m9qkku"),i($,"class","KP svelte-m9qkku"),i(T,"class","data svelte-m9qkku"),i(t,"class","prediction-details svelte-m9qkku")},m(e,s){o(e,t,s),c(t,a),c(a,u),c(u,p),c(a,h),c(a,_),c(_,w),c(t,b),c(t,$),j(D,$,null),c(t,V),c(t,T),q&&q.m(T,null),x=!0},p(e,[t]){e[5]&&q.p(e,t)},i(e){x||(E(D.$$.fragment,e),x=!0)},o(e){k(D.$$.fragment,e),x=!1},d(e){e&&l(t),O(D),q&&q.d()}}}function De(e,t=2){let a=e;for(let s=0;s<t-e.length;s++)a="0"+a;return a}function ye(e,t,a){let{prediction:s}=t;let n=s.kp,r=s.time.getDate()+". "+["January","February","March","April","May","June","July","August","September","October","November","December"][s.time.getMonth()],l=De(s.time.getHours().toString())+":"+De(s.time.getMinutes().toString()),i=s.temp,o=s.clouds,c=s.hasNOMETData;return e.$$set=e=>{"prediction"in e&&a(6,s=e.prediction)},[n,r,l,i,o,c,s]}class Ie extends e{constructor(e){super(),t(this,e,ye,Ee,a,{prediction:6})}}function je(e,t,a){const s=e.slice();return s[5]=t[a],s[7]=a,s}function Oe(e){let t,a;return t=new Ie({props:{prediction:e[5]}}),{c(){y(t.$$.fragment)},l(e){I(t.$$.fragment,e)},m(e,s){j(t,e,s),a=!0},p(e,a){const s={};1&a&&(s.prediction=e[5]),t.$set(s)},i(e){a||(E(t.$$.fragment,e),a=!0)},o(e){k(t.$$.fragment,e),a=!1},d(e){O(t,e)}}}function Ve(e){let t,a,c=e[0],d=[];for(let t=0;t<c.length;t+=1)d[t]=Oe(je(e,c,t));const u=e=>k(d[e],1,1,(()=>{d[e]=null}));return{c(){t=s("div");for(let e=0;e<d.length;e+=1)d[e].c();this.h()},l(e){t=n(e,"DIV",{class:!0});var a=r(t);for(let e=0;e<d.length;e+=1)d[e].l(a);a.forEach(l),this.h()},h(){i(t,"class","prediction-table svelte-1uc0m3l")},m(e,s){o(e,t,s);for(let e=0;e<d.length;e+=1)d[e].m(t,null);a=!0},p(e,[a]){if(1&a){let s;for(c=e[0],s=0;s<c.length;s+=1){const n=je(e,c,s);d[s]?(d[s].p(n,a),E(d[s],1)):(d[s]=Oe(n),d[s].c(),E(d[s],1),d[s].m(t,null))}for(b(),s=c.length;s<d.length;s+=1)u(s);$()}},i(e){if(!a){for(let e=0;e<c.length;e+=1)E(d[e]);a=!0}},o(e){d=d.filter(Boolean);for(let e=0;e<d.length;e+=1)k(d[e]);a=!1},d(e){e&&l(t),M(d,e)}}}function Te(e,t,a){let s,n,r;async function l(){if(n.updating||s.updating)return void a(0,r=null);let e=n.usnoaa_data_raw.geospace_pred_est_kp_1_hour.filter((e=>e.model_prediction_time>=new Date));a(0,r=e.map((e=>({time:e.model_prediction_time,kp:Math.round(e.k),temp:null,clouds:null,hasNOMETData:s.available})))),s.available&&r.forEach(((e,t)=>{let n,l,i=new Date(0,0,0),o=!0;s.yr_data_raw.properties.timeseries.forEach(((t,a)=>{let s=new Date(t.time);if(Math.abs(s.getTime()-e.time.getTime())<Math.abs(i.getTime()-e.time.getTime())){if(Math.abs(s.getTime()-e.time.getTime())>18e6)return void(o=!1);i=s,n=t.data.instant.details.air_temperature,l=t.data.instant.details.cloud_area_fraction}})),a(0,r[t]=Object.assign(Object.assign({},r[t]),{temp:n,clouds:l,hasNOMETData:o}),r)}))}return D(e,Q,(e=>a(1,s=e))),D(e,U,(e=>a(2,n=e))),U.subscribe(l),Q.subscribe(l),[r]}class xe extends e{constructor(e){super(),t(this,e,Te,Ve,a,{})}}function qe(e){let t,a,c;return a=new we({props:{$$slots:{default:[Me]},$$scope:{ctx:e}}}),{c(){t=s("div"),y(a.$$.fragment),this.h()},l(e){t=n(e,"DIV",{class:!0});var s=r(t);I(a.$$.fragment,s),s.forEach(l),this.h()},h(){i(t,"class","svelte-m9qkku")},m(e,s){o(e,t,s),j(a,t,null),c=!0},p(e,t){const s={};257&t&&(s.$$scope={dirty:t,ctx:e}),a.$set(s)},i(e){c||(E(a.$$.fragment,e),c=!0)},o(e){k(a.$$.fragment,e),c=!1},d(e){e&&l(t),O(a)}}}function Me(e){let t,a=e[0].observed+"";return{c(){t=g(a)},l(e){t=v(e,a)},m(e,a){o(e,t,a)},p(e,s){1&s&&a!==(a=e[0].observed+"")&&w(t,a)},d(e){e&&l(t)}}}function Pe(e){let t,a,u,p,h,_,w,D,V,T,x,q,M,P,S="predicted"!=e[0].observed&&qe(e);x=new $e({props:{percentage:e[1]/9,value:e[1]}});let N=e[6]&&function(e){let t,a,u,p,h,_,w,b,k,$,E,D,y=Math.round(e[4])+"",I=Math.round(e[5])+"";return{c(){t=s("div"),a=s("p"),u=s("i"),p=f(),h=g(y),_=g("°C"),w=f(),b=s("p"),k=s("i"),$=f(),E=g(I),D=g("%"),this.h()},l(e){t=n(e,"DIV",{class:!0});var s=r(t);a=n(s,"P",{class:!0});var i=r(a);u=n(i,"I",{class:!0}),r(u).forEach(l),p=m(i),h=v(i,y),_=v(i,"°C"),i.forEach(l),w=m(s),b=n(s,"P",{class:!0});var o=r(b);k=n(o,"I",{class:!0}),r(k).forEach(l),$=m(o),E=v(o,I),D=v(o,"%"),o.forEach(l),s.forEach(l),this.h()},h(){i(u,"class","fas fa-thermometer-half svelte-m9qkku"),i(a,"class","svelte-m9qkku"),i(k,"class","fas fa-cloud svelte-m9qkku"),i(b,"class","svelte-m9qkku"),i(t,"class","svelte-m9qkku")},m(e,s){o(e,t,s),c(t,a),c(a,u),c(a,p),c(a,h),c(a,_),c(t,w),c(t,b),c(b,k),c(b,$),c(b,E),c(b,D)},p:d,d(e){e&&l(t)}}}(e);return{c(){t=s("div"),a=s("div"),u=s("h3"),p=g(e[3]),h=f(),_=s("p"),w=g(e[2]),D=f(),S&&S.c(),V=f(),T=s("div"),y(x.$$.fragment),q=f(),M=s("div"),N&&N.c(),this.h()},l(s){t=n(s,"DIV",{class:!0});var i=r(t);a=n(i,"DIV",{class:!0});var o=r(a);u=n(o,"H3",{class:!0});var c=r(u);p=v(c,e[3]),c.forEach(l),h=m(o),_=n(o,"P",{class:!0});var d=r(_);w=v(d,e[2]),d.forEach(l),o.forEach(l),D=m(i),S&&S.l(i),V=m(i),T=n(i,"DIV",{class:!0});var f=r(T);I(x.$$.fragment,f),f.forEach(l),q=m(i),M=n(i,"DIV",{class:!0});var g=r(M);N&&N.l(g),g.forEach(l),i.forEach(l),this.h()},h(){i(u,"class","svelte-m9qkku"),i(_,"class","svelte-m9qkku"),i(a,"class","svelte-m9qkku"),i(T,"class","KP svelte-m9qkku"),i(M,"class","data svelte-m9qkku"),i(t,"class","prediction-details svelte-m9qkku")},m(e,s){o(e,t,s),c(t,a),c(a,u),c(u,p),c(a,h),c(a,_),c(_,w),c(t,D),S&&S.m(t,null),c(t,V),c(t,T),j(x,T,null),c(t,q),c(t,M),N&&N.m(M,null),P=!0},p(e,[a]){"predicted"!=e[0].observed?S?(S.p(e,a),1&a&&E(S,1)):(S=qe(e),S.c(),E(S,1),S.m(t,V)):S&&(b(),k(S,1,1,(()=>{S=null})),$()),e[6]&&N.p(e,a)},i(e){P||(E(S),E(x.$$.fragment,e),P=!0)},o(e){k(S),k(x.$$.fragment,e),P=!1},d(e){e&&l(t),S&&S.d(),O(x),N&&N.d()}}}function Se(e,t=2){let a=e;for(let s=0;s<t-e.length;s++)a="0"+a;return a}function Ne(e,t,a){let{prediction:s}=t;let n=s.kp,r=s.time.getDate()+". "+["January","February","March","April","May","June","July","August","September","October","November","December"][s.time.getMonth()],l=Se(s.time.getHours().toString())+":"+Se(s.time.getMinutes().toString()),i=s.temp,o=s.clouds,c=s.hasNOMETData;return e.$$set=e=>{"prediction"in e&&a(0,s=e.prediction)},[s,n,r,l,i,o,c]}class Ce extends e{constructor(e){super(),t(this,e,Ne,Pe,a,{prediction:0})}}function Ae(e,t,a){const s=e.slice();return s[5]=t[a],s[7]=a,s}function Je(e){let t,a;return t=new Ce({props:{prediction:e[5]}}),{c(){y(t.$$.fragment)},l(e){I(t.$$.fragment,e)},m(e,s){j(t,e,s),a=!0},p(e,a){const s={};1&a&&(s.prediction=e[5]),t.$set(s)},i(e){a||(E(t.$$.fragment,e),a=!0)},o(e){k(t.$$.fragment,e),a=!1},d(e){O(t,e)}}}function Be(e){let t,a,c=e[0],d=[];for(let t=0;t<c.length;t+=1)d[t]=Je(Ae(e,c,t));const u=e=>k(d[e],1,1,(()=>{d[e]=null}));return{c(){t=s("div");for(let e=0;e<d.length;e+=1)d[e].c();this.h()},l(e){t=n(e,"DIV",{class:!0});var a=r(t);for(let e=0;e<d.length;e+=1)d[e].l(a);a.forEach(l),this.h()},h(){i(t,"class","prediction-table svelte-1uc0m3l")},m(e,s){o(e,t,s);for(let e=0;e<d.length;e+=1)d[e].m(t,null);a=!0},p(e,[a]){if(1&a){let s;for(c=e[0],s=0;s<c.length;s+=1){const n=Ae(e,c,s);d[s]?(d[s].p(n,a),E(d[s],1)):(d[s]=Je(n),d[s].c(),E(d[s],1),d[s].m(t,null))}for(b(),s=c.length;s<d.length;s+=1)u(s);$()}},i(e){if(!a){for(let e=0;e<c.length;e+=1)E(d[e]);a=!0}},o(e){d=d.filter(Boolean);for(let e=0;e<d.length;e+=1)k(d[e]);a=!1},d(e){e&&l(t),M(d,e)}}}function He(e,t,a){let s,n,r;async function l(){if(n.updating||s.updating)return void a(0,r=null);let e=n.usnoaa_data_raw.noaa_planetary_k_index_forecast.filter((e=>"observed"!==e.observed));a(0,r=e.map((e=>({time:e.time,kp:e.kp,observed:e.observed,temp:null,clouds:null,hasNOMETData:s.available})))),s.available&&r.forEach(((e,t)=>{let n,l,i=new Date(0,0,0);s.yr_data_raw.properties.timeseries.forEach(((t,a)=>{let s=new Date(t.time);Math.abs(s.getTime()-e.time.getTime())<Math.abs(i.getTime()-e.time.getTime())&&(i=s,n=t.data.instant.details.air_temperature,l=t.data.instant.details.cloud_area_fraction)})),a(0,r[t]=Object.assign(Object.assign({},r[t]),{temp:n,clouds:l}),r)}))}return D(e,Q,(e=>a(1,s=e))),D(e,U,(e=>a(2,n=e))),U.subscribe(l),Q.subscribe(l),[r]}class Ke extends e{constructor(e){super(),t(this,e,He,Be,a,{})}}function ze(e){let t,a,d,u,p,h,_,w,b,$;return _=new $e({props:{percentage:e[0]/9,value:e[0]}}),{c(){t=s("div"),a=s("div"),d=s("h3"),u=g(e[1]),p=f(),h=s("div"),y(_.$$.fragment),w=f(),b=s("div"),this.h()},l(s){t=n(s,"DIV",{class:!0});var i=r(t);a=n(i,"DIV",{class:!0});var o=r(a);d=n(o,"H3",{class:!0});var c=r(d);u=v(c,e[1]),c.forEach(l),o.forEach(l),p=m(i),h=n(i,"DIV",{class:!0});var f=r(h);I(_.$$.fragment,f),f.forEach(l),w=m(i),b=n(i,"DIV",{class:!0}),r(b).forEach(l),i.forEach(l),this.h()},h(){i(d,"class","svelte-m9qkku"),i(a,"class","svelte-m9qkku"),i(h,"class","KP svelte-m9qkku"),i(b,"class","data svelte-m9qkku"),i(t,"class","prediction-details svelte-m9qkku")},m(e,s){o(e,t,s),c(t,a),c(a,d),c(d,u),c(t,p),c(t,h),j(_,h,null),c(t,w),c(t,b),$=!0},p(e,[t]){},i(e){$||(E(_.$$.fragment,e),$=!0)},o(e){k(_.$$.fragment,e),$=!1},d(e){e&&l(t),O(_)}}}function Le(e,t=2){let a=e;for(let s=0;s<t-e.length;s++)a="0"+a;return a}function Ze(e,t,a){let{prediction:s}=t;let n=s.kp,r=s.time.getDate()+". "+["January","February","March","April","May","June","July","August","September","October","November","December"][s.time.getMonth()];Le(s.time.getHours().toString()),Le(s.time.getMinutes().toString());let l=s.temp,i=s.clouds;return e.$$set=e=>{"prediction"in e&&a(4,s=e.prediction)},[n,r,l,i,s]}class Fe extends e{constructor(e){super(),t(this,e,Ze,ze,a,{prediction:4})}}function Ge(e,t,a){const s=e.slice();return s[5]=t[a],s[7]=a,s}function Re(e){let t,a;return t=new Fe({props:{prediction:e[5]}}),{c(){y(t.$$.fragment)},l(e){I(t.$$.fragment,e)},m(e,s){j(t,e,s),a=!0},p(e,a){const s={};1&a&&(s.prediction=e[5]),t.$set(s)},i(e){a||(E(t.$$.fragment,e),a=!0)},o(e){k(t.$$.fragment,e),a=!1},d(e){O(t,e)}}}function Qe(e){let t,a,c=e[0],d=[];for(let t=0;t<c.length;t+=1)d[t]=Re(Ge(e,c,t));const u=e=>k(d[e],1,1,(()=>{d[e]=null}));return{c(){t=s("div");for(let e=0;e<d.length;e+=1)d[e].c();this.h()},l(e){t=n(e,"DIV",{class:!0});var a=r(t);for(let e=0;e<d.length;e+=1)d[e].l(a);a.forEach(l),this.h()},h(){i(t,"class","prediction-table svelte-1uc0m3l")},m(e,s){o(e,t,s);for(let e=0;e<d.length;e+=1)d[e].m(t,null);a=!0},p(e,[a]){if(1&a){let s;for(c=e[0],s=0;s<c.length;s+=1){const n=Ge(e,c,s);d[s]?(d[s].p(n,a),E(d[s],1)):(d[s]=Re(n),d[s].c(),E(d[s],1),d[s].m(t,null))}for(b(),s=c.length;s<d.length;s+=1)u(s);$()}},i(e){if(!a){for(let e=0;e<c.length;e+=1)E(d[e]);a=!0}},o(e){d=d.filter(Boolean);for(let e=0;e<d.length;e+=1)k(d[e]);a=!1},d(e){e&&l(t),M(d,e)}}}function Ue(e,t,a){let s,n,r;async function l(){if(n.updating||s.updating)return void a(0,r=null);let e=n.usnoaa_data_raw.outlook_27_day.filter((e=>e.time>=new Date));a(0,r=e.map((e=>({time:e.time,kp:e.kindex,temp:null,clouds:null,hasNOMETData:s.available})))),s.available&&r.forEach(((e,t)=>{let n,l,i=new Date(0,0,0),o=!0;s.yr_data_raw.properties.timeseries.forEach(((t,a)=>{let s=new Date(t.time);if(Math.abs(s.getTime()-e.time.getTime())<Math.abs(i.getTime()-e.time.getTime())){if(Math.abs(s.getTime()-e.time.getTime())>864e5)return void(o=!1);i=s,n=t.data.instant.details.air_temperature,l=t.data.instant.details.cloud_area_fraction}})),a(0,r[t]=Object.assign(Object.assign({},r[t]),{temp:n,clouds:l,hasNOMETData:o}),r)}))}return D(e,Q,(e=>a(1,s=e))),D(e,U,(e=>a(2,n=e))),U.subscribe(l),Q.subscribe(l),[r]}class We extends e{constructor(e){super(),t(this,e,Ue,Qe,a,{})}}function Xe(e){let t,a,u,p,h;return{c(){t=s("div"),a=s("i"),u=f(),p=s("p"),h=g("No prediction data"),this.h()},l(e){t=n(e,"DIV",{class:!0});var s=r(t);a=n(s,"I",{class:!0}),r(a).forEach(l),u=m(s),p=n(s,"P",{});var i=r(p);h=v(i,"No prediction data"),i.forEach(l),s.forEach(l),this.h()},h(){i(a,"class","fas fa-7x fa-exclamation-triangle"),i(t,"class","no-data svelte-11gsg4a")},m(e,s){o(e,t,s),c(t,a),c(t,u),c(t,p),c(p,h)},p:d,i:d,o:d,d(e){e&&l(t)}}}function Ye(e){let t,a,d,u,p,_,w,D,V,T,x,q,M,C,A,J,B,H,K;var z=e[0];return z&&(A=new z({})),{c(){t=s("div"),a=s("h2"),d=g("Forecast"),u=f(),p=s("div"),_=s("div"),w=g("hour"),D=f(),V=s("div"),T=g("3 day"),x=f(),q=s("div"),M=g("Longterm"),C=f(),A&&y(A.$$.fragment),J=h(),this.h()},l(e){t=n(e,"DIV",{class:!0});var s=r(t);a=n(s,"H2",{class:!0});var i=r(a);d=v(i,"Forecast"),i.forEach(l),u=m(s),p=n(s,"DIV",{class:!0});var o=r(p);_=n(o,"DIV",{class:!0});var c=r(_);w=v(c,"hour"),c.forEach(l),D=m(o),V=n(o,"DIV",{class:!0});var f=r(V);T=v(f,"3 day"),f.forEach(l),x=m(o),q=n(o,"DIV",{class:!0});var g=r(q);M=v(g,"Longterm"),g.forEach(l),o.forEach(l),s.forEach(l),C=m(e),A&&I(A.$$.fragment,e),J=h(),this.h()},h(){i(a,"class","svelte-11gsg4a"),i(_,"class","svelte-11gsg4a"),P(_,"selected",e[0]==xe),i(V,"class","svelte-11gsg4a"),P(V,"selected",e[0]==Ke),i(q,"class","svelte-11gsg4a"),P(q,"selected",e[0]==We),i(p,"class","version-picker svelte-11gsg4a"),i(t,"class","header svelte-11gsg4a")},m(s,n){o(s,t,n),c(t,a),c(a,d),c(t,u),c(t,p),c(p,_),c(_,w),c(p,D),c(p,V),c(V,T),c(p,x),c(p,q),c(q,M),o(s,C,n),A&&j(A,s,n),o(s,J,n),B=!0,H||(K=[S(_,"click",e[3]),S(V,"click",e[4]),S(q,"click",e[5])],H=!0)},p(e,t){if(1&t&&P(_,"selected",e[0]==xe),1&t&&P(V,"selected",e[0]==Ke),1&t&&P(q,"selected",e[0]==We),z!==(z=e[0])){if(A){b();const e=A;k(e.$$.fragment,1,0,(()=>{O(e,1)})),$()}z?(A=new z({}),y(A.$$.fragment),E(A.$$.fragment,1),j(A,J.parentNode,J)):A=null}},i(e){B||(A&&E(A.$$.fragment,e),B=!0)},o(e){A&&k(A.$$.fragment,e),B=!1},d(e){e&&l(t),e&&l(C),e&&l(J),A&&O(A,e),H=!1,N(K)}}}function et(e){let t,a,c,d;const u=[Ye,Xe],p=[];function f(e,t){return e[1].updating||e[2].updating?1:0}return a=f(e),c=p[a]=u[a](e),{c(){t=s("div"),c.c(),this.h()},l(e){t=n(e,"DIV",{class:!0});var a=r(t);c.l(a),a.forEach(l),this.h()},h(){i(t,"class","drawer svelte-11gsg4a")},m(e,s){o(e,t,s),p[a].m(t,null),d=!0},p(e,[s]){let n=a;a=f(e),a===n?p[a].p(e,s):(b(),k(p[n],1,1,(()=>{p[n]=null})),$(),c=p[a],c?c.p(e,s):(c=p[a]=u[a](e),c.c()),E(c,1),c.m(t,null))},i(e){d||(E(c),d=!0)},o(e){k(c),d=!1},d(e){e&&l(t),p[a].d()}}}function tt(e,t,a){let s,n;D(e,Q,(e=>a(1,s=e))),D(e,U,(e=>a(2,n=e)));let r=Ke;return[r,s,n,()=>a(0,r=xe),()=>a(0,r=Ke),()=>a(0,r=We)]}class at extends e{constructor(e){super(),t(this,e,tt,et,a,{})}}function st(e){let t,a,u,p,h,g;return u=new ge({}),h=new at({}),{c(){t=f(),a=s("div"),y(u.$$.fragment),p=f(),y(h.$$.fragment),this.h()},l(e){C('[data-svelte="svelte-1q3846k"]',document.head).forEach(l),t=m(e),a=n(e,"DIV",{class:!0});var s=r(a);I(u.$$.fragment,s),p=m(s),I(h.$$.fragment,s),s.forEach(l),this.h()},h(){document.title="Aurora data",i(a,"class","homescreen svelte-pf4p6y")},m(e,s){o(e,t,s),o(e,a,s),j(u,a,null),c(a,p),j(h,a,null),g=!0},p:d,i(e){g||(E(u.$$.fragment,e),E(h.$$.fragment,e),g=!0)},o(e){k(u.$$.fragment,e),k(h.$$.fragment,e),g=!1},d(e){e&&l(t),e&&l(a),O(u),O(h)}}}class nt extends e{constructor(e){super(),t(this,e,null,st,a,{})}}export{nt as default};