diff options
Diffstat (limited to 'client/legacy/index.4a50ca1a.js')
-rw-r--r-- | client/legacy/index.4a50ca1a.js | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/client/legacy/index.4a50ca1a.js b/client/legacy/index.4a50ca1a.js deleted file mode 100644 index 6668333..0000000 --- a/client/legacy/index.4a50ca1a.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t,a as n,b as e,c as a,i as r,s as c,d as o,e as i,S as s,f as u,g as l,h as f,j as d,k as h,l as v,m as p,n as m,w as g,o as _,t as y,p as w,q as b,r as $,u as E,v as k,x as D,y as I,z as O,A as R,B as P,C as j,D as V,E as x,F as B,G as T,H as M,I as S,J as C,K as N,L as q,M as H,N as A,O as z,P as J}from"./client.26d4afad.js";function K(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function F(t){var n,e,a,r,c,o,i,s,g;return{c:function(){n=u("div"),e=u("div"),a=u("div"),r=u("div"),c=u("div"),o=u("div"),i=u("div"),s=u("div"),g=u("div"),this.h()},l:function(t){n=l(t,"DIV",{class:!0});var u=f(n);e=l(u,"DIV",{class:!0}),f(e).forEach(d),a=l(u,"DIV",{class:!0}),f(a).forEach(d),r=l(u,"DIV",{class:!0}),f(r).forEach(d),c=l(u,"DIV",{class:!0}),f(c).forEach(d),o=l(u,"DIV",{class:!0}),f(o).forEach(d),i=l(u,"DIV",{class:!0}),f(i).forEach(d),s=l(u,"DIV",{class:!0}),f(s).forEach(d),g=l(u,"DIV",{class:!0}),f(g).forEach(d),u.forEach(d),this.h()},h:function(){h(e,"class","svelte-7k6qu0"),h(a,"class","svelte-7k6qu0"),h(r,"class","svelte-7k6qu0"),h(c,"class","svelte-7k6qu0"),h(o,"class","svelte-7k6qu0"),h(i,"class","svelte-7k6qu0"),h(s,"class","svelte-7k6qu0"),h(g,"class","svelte-7k6qu0"),h(n,"class","lds-roller svelte-7k6qu0")},m:function(t,u){v(t,n,u),p(n,e),p(n,a),p(n,r),p(n,c),p(n,o),p(n,i),p(n,s),p(n,g)},p:m,i:m,o:m,d:function(t){t&&d(n)}}}var L=function(n){t(u,s);var e=K(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,null,F,c,{}),n}return i(u)}();const U={updated:!1,updating:!0},Z=g(Object.assign(Object.assign({},U),{available:!1,longitude:null,latitude:null,city:null})),G=g(Object.assign(Object.assign({},U),{available:!1})),Q=g(Object.assign({},U));function W(t,n=!1){let e=n?{}:{updated:new Date};t.update((t=>Object.assign(Object.assign(Object.assign({},t),e),{updating:n})))}function X(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function Y(t){var n,e,a,r,c=t[0].city+"";return{c:function(){n=u("i"),e=_(),a=u("h1"),r=y(c),this.h()},l:function(t){n=l(t,"I",{class:!0}),f(n).forEach(d),e=w(t),a=l(t,"H1",{class:!0});var o=f(a);r=b(o,c),o.forEach(d),this.h()},h:function(){h(n,"class","symbol fas fa-map-marker-alt svelte-9kdo4s"),h(a,"class","svelte-9kdo4s")},m:function(t,c){v(t,n,c),v(t,e,c),v(t,a,c),p(a,r)},p:function(t,n){1&n&&c!==(c=t[0].city+"")&&$(r,c)},d:function(t){t&&d(n),t&&d(e),t&&d(a)}}}function tt(t){var n,e;function a(t,e){return 6&e&&(n=null),null==n&&(n=!!(Math.abs(t[1].updated-t[2].updated)>6e5)),n?et:nt}var r=a(t,-1),c=r(t);return{c:function(){c.c(),e=E()},l:function(t){c.l(t),e=E()},m:function(t,n){c.m(t,n),v(t,e,n)},p:function(t,n){r===(r=a(t,n))&&c?c.p(t,n):(c.d(1),(c=r(t))&&(c.c(),c.m(e.parentNode,e)))},d:function(t){c.d(t),t&&d(e)}}}function nt(t){var n,e,a=t[1].updated.toLocaleString("no-NO",{dateStyle:"medium",timeStyle:"short"})+"";return{c:function(){n=u("p"),e=y(a)},l:function(t){n=l(t,"P",{});var r=f(n);e=b(r,a),r.forEach(d)},m:function(t,a){v(t,n,a),p(n,e)},p:function(t,n){2&n&&a!==(a=t[1].updated.toLocaleString("no-NO",{dateStyle:"medium",timeStyle:"short"})+"")&&$(e,a)},d:function(t){t&&d(n)}}}function et(t){var n,e;return{c:function(){n=u("p"),e=y("There is more than 10 minutes difference between data updates")},l:function(t){n=l(t,"P",{});var a=f(n);e=b(a,"There is more than 10 minutes difference between data updates"),a.forEach(d)},m:function(t,a){v(t,n,a),p(n,e)},p:m,d:function(t){t&&d(n)}}}function at(t){var n,e,a,r,c,o,i,s,g,E,k,D,I=t[2].now.kp+"",O=t[2].now.kp_max+"",R=t[2].now.kp_min+"";return{c:function(){n=u("h2"),e=y("KP "),a=y(I),r=_(),c=u("p"),o=u("span"),i=y("↑ KP "),s=y(O),g=_(),E=u("span"),k=y("↓ KP "),D=y(R),this.h()},l:function(t){n=l(t,"H2",{class:!0});var u=f(n);e=b(u,"KP "),a=b(u,I),u.forEach(d),r=w(t),c=l(t,"P",{});var h=f(c);o=l(h,"SPAN",{classname:!0});var v=f(o);i=b(v,"↑ KP "),s=b(v,O),v.forEach(d),g=w(h),E=l(h,"SPAN",{classname:!0});var p=f(E);k=b(p,"↓ KP "),D=b(p,R),p.forEach(d),h.forEach(d),this.h()},h:function(){h(n,"class","svelte-9kdo4s"),h(o,"classname","pr-2"),h(E,"classname","pl-2")},m:function(t,u){v(t,n,u),p(n,e),p(n,a),v(t,r,u),v(t,c,u),p(c,o),p(o,i),p(o,s),p(c,g),p(c,E),p(E,k),p(E,D)},p:function(t,n){4&n&&I!==(I=t[2].now.kp+"")&&$(a,I),4&n&&O!==(O=t[2].now.kp_max+"")&&$(s,O),4&n&&R!==(R=t[2].now.kp_min+"")&&$(D,R)},i:m,o:m,d:function(t){t&&d(n),t&&d(r),t&&d(c)}}}function rt(t){var n,e;return n=new L({}),{c:function(){j(n.$$.fragment)},l:function(t){V(n.$$.fragment,t)},m:function(t,a){x(n,t,a),e=!0},p:m,i:function(t){e||(R(n.$$.fragment,t),e=!0)},o:function(t){I(n.$$.fragment,t),e=!1},d:function(t){B(n,t)}}}function ct(t){var n,e,a,r,c,o,i,s,m,g,k,D,I,O,R,P=t[2].now.bz+"",j=t[2].now.bt+"",V=t[1].available&&ot(t);return{c:function(){n=u("div"),e=u("p"),a=y("BZ"),r=_(),c=u("p"),o=y(P),i=_(),s=u("div"),m=u("p"),g=y("BT"),k=_(),D=u("p"),I=y(j),O=_(),V&&V.c(),R=E(),this.h()},l:function(t){n=l(t,"DIV",{});var u=f(n);e=l(u,"P",{class:!0});var h=f(e);a=b(h,"BZ"),h.forEach(d),r=w(u),c=l(u,"P",{class:!0});var v=f(c);o=b(v,P),v.forEach(d),u.forEach(d),i=w(t),s=l(t,"DIV",{});var p=f(s);m=l(p,"P",{class:!0});var _=f(m);g=b(_,"BT"),_.forEach(d),k=w(p),D=l(p,"P",{class:!0});var y=f(D);I=b(y,j),y.forEach(d),p.forEach(d),O=w(t),V&&V.l(t),R=E(),this.h()},h:function(){h(e,"class","svelte-9kdo4s"),h(c,"class","svelte-9kdo4s"),h(m,"class","svelte-9kdo4s"),h(D,"class","svelte-9kdo4s")},m:function(t,u){v(t,n,u),p(n,e),p(e,a),p(n,r),p(n,c),p(c,o),v(t,i,u),v(t,s,u),p(s,m),p(m,g),p(s,k),p(s,D),p(D,I),v(t,O,u),V&&V.m(t,u),v(t,R,u)},p:function(t,n){4&n&&P!==(P=t[2].now.bz+"")&&$(o,P),4&n&&j!==(j=t[2].now.bt+"")&&$(I,j),t[1].available?V?V.p(t,n):((V=ot(t)).c(),V.m(R.parentNode,R)):V&&(V.d(1),V=null)},d:function(t){t&&d(n),t&&d(i),t&&d(s),t&&d(O),V&&V.d(t),t&&d(R)}}}function ot(t){var n,e,a,r,c,o,i,s,m,g,E,k,D,I,O,R=t[1].now.temp+"",P=t[1].now.clouds+"";return{c:function(){n=u("div"),e=u("p"),a=y("Temp"),r=_(),c=u("p"),o=y(R),i=y("°C"),s=_(),m=u("div"),g=u("p"),E=y("Clouds"),k=_(),D=u("p"),I=y(P),O=y("%"),this.h()},l:function(t){n=l(t,"DIV",{});var u=f(n);e=l(u,"P",{class:!0});var h=f(e);a=b(h,"Temp"),h.forEach(d),r=w(u),c=l(u,"P",{class:!0});var v=f(c);o=b(v,R),i=b(v,"°C"),v.forEach(d),u.forEach(d),s=w(t),m=l(t,"DIV",{});var p=f(m);g=l(p,"P",{class:!0});var _=f(g);E=b(_,"Clouds"),_.forEach(d),k=w(p),D=l(p,"P",{class:!0});var y=f(D);I=b(y,P),O=b(y,"%"),y.forEach(d),p.forEach(d),this.h()},h:function(){h(e,"class","svelte-9kdo4s"),h(c,"class","svelte-9kdo4s"),h(g,"class","svelte-9kdo4s"),h(D,"class","svelte-9kdo4s")},m:function(t,u){v(t,n,u),p(n,e),p(e,a),p(n,r),p(n,c),p(c,o),p(c,i),v(t,s,u),v(t,m,u),p(m,g),p(g,E),p(m,k),p(m,D),p(D,I),p(D,O)},p:function(t,n){2&n&&R!==(R=t[1].now.temp+"")&&$(o,R),2&n&&P!==(P=t[1].now.clouds+"")&&$(I,P)},d:function(t){t&&d(n),t&&d(s),t&&d(m)}}}function it(t){var n,e,a,r,c,o,i,s,m,g,y,b,$=!t[0].updating&&t[0].available&&!t[1].updating&&!t[2].updating&&Y(t),E=!t[1].updating&&!t[2].updating&&tt(t),P=[rt,at],j=[];function V(t,n){return t[2].updating||t[1].updating?0:1}s=V(t),m=j[s]=P[s](t);var x=!t[2].updating&&!t[1].updating&&ct(t);return{c:function(){n=u("div"),e=u("div"),a=u("div"),$&&$.c(),r=_(),c=u("div"),E&&E.c(),o=_(),i=u("div"),m.c(),g=_(),y=u("div"),x&&x.c(),this.h()},l:function(t){n=l(t,"DIV",{class:!0});var s=f(n);e=l(s,"DIV",{class:!0});var u=f(e);a=l(u,"DIV",{class:!0});var h=f(a);$&&$.l(h),h.forEach(d),r=w(u),c=l(u,"DIV",{class:!0});var v=f(c);E&&E.l(v),v.forEach(d),o=w(u),i=l(u,"DIV",{class:!0});var p=f(i);m.l(p),p.forEach(d),g=w(u),y=l(u,"DIV",{class:!0});var _=f(y);x&&x.l(_),_.forEach(d),u.forEach(d),s.forEach(d),this.h()},h:function(){h(a,"class","weatherCurrent-data-location svelte-9kdo4s"),h(c,"class","weatherCurrent-data-date"),h(i,"class","weatherCurrent-data-kp svelte-9kdo4s"),h(y,"class","current-details svelte-9kdo4s"),h(e,"class","weatherCurrent-data svelte-9kdo4s"),h(n,"class","weatherCurrent-wrapper svelte-9kdo4s")},m:function(t,u){v(t,n,u),p(n,e),p(e,a),$&&$.m(a,null),p(e,r),p(e,c),E&&E.m(c,null),p(e,o),p(e,i),j[s].m(i,null),p(e,g),p(e,y),x&&x.m(y,null),b=!0},p:function(t,n){var e=k(n,1)[0];t[0].updating||!t[0].available||t[1].updating||t[2].updating?$&&($.d(1),$=null):$?$.p(t,e):(($=Y(t)).c(),$.m(a,null)),t[1].updating||t[2].updating?E&&(E.d(1),E=null):E?E.p(t,e):((E=tt(t)).c(),E.m(c,null));var r=s;(s=V(t))===r?j[s].p(t,e):(D(),I(j[r],1,1,(function(){j[r]=null})),O(),(m=j[s])?m.p(t,e):(m=j[s]=P[s](t)).c(),R(m,1),m.m(i,null)),t[2].updating||t[1].updating?x&&(x.d(1),x=null):x?x.p(t,e):((x=ct(t)).c(),x.m(y,null))},i:function(t){b||(R(m),b=!0)},o:function(t){I(m),b=!1},d:function(t){t&&d(n),$&&$.d(),E&&E.d(),j[s].d(),x&&x.d()}}}function st(t,n,e){var a,r,c;return P(t,Z,(function(t){return e(0,a=t)})),P(t,G,(function(t){return e(1,r=t)})),P(t,Q,(function(t){return e(2,c=t)})),[a,r,c]}!async function(){if("undefined"==typeof window)return;let t;W(Z,!0);try{t=await async function(){return new Promise(((t,n)=>{"undefined"!=typeof navigator?navigator.geolocation.getCurrentPosition((n=>{t({longitude:n.coords.longitude,latitude:n.coords.latitude})}),(t=>{n(t)})):n(Error())}))}()}catch(t){return console.log(t),Z.update((t=>Object.assign(Object.assign({},t),{available:!1,city:null,longitude:null,latitude:null}))),void W(Z,!1)}let n=await fetch(`https://geocode.xyz/${t.latitude},${t.longitude}?geoit=json`),e=await n.json();Z.update((n=>Object.assign(Object.assign(Object.assign({},n),{available:!0,city:e.city}),t))),W(Z,!1)}(),Z.subscribe((async function(t=null){if("undefined"==typeof window)return;if(null===t)return;if(t.updating)return;if(!t.available)return G.update((t=>Object.assign(Object.assign({},t),{available:!1}))),void W(G,!1);W(G,!0);let n=await fetch(`https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=${t.latitude}&lon=${t.longitude}`),e=await n.json(),a={clouds:null,temp:null};try{a.clouds=e.properties.timeseries[0].data.instant.details.cloud_area_fraction,a.temp=e.properties.timeseries[0].data.instant.details.air_temperature,e.properties.timeseries=e.properties.timeseries.map((t=>Object.assign(Object.assign({},t),{time:new Date(t.time)})))}catch(t){}G.update((t=>Object.assign(Object.assign({},t),{yr_data_raw:e,now:a,available:!0}))),W(G,!1)})),async function(){if("undefined"==typeof window)return;W(Q,!0);let t=await async function(){let 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}},n=await fetch("https://services.swpc.noaa.gov/products/summary/solar-wind-mag-field.json");t.usnoaa_data_raw.solar_wind_mag_field=await n.json(),t.usnoaa_data_raw.solar_wind_mag_field.TimeStamp=new Date(t.usnoaa_data_raw.solar_wind_mag_field.TimeStamp+" UTC"),t.now.bz=t.usnoaa_data_raw.solar_wind_mag_field.Bz,t.now.bt=t.usnoaa_data_raw.solar_wind_mag_field.Bt,n=await fetch("https://services.swpc.noaa.gov/json/geospace/geospace_pred_est_kp_1_hour.json"),t.usnoaa_data_raw.geospace_pred_est_kp_1_hour=(await n.json()).map((t=>Object.assign(Object.assign({},t),{model_prediction_time:new Date(t.model_prediction_time)}))),n=await fetch("https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json"),t.usnoaa_data_raw.noaa_planetary_k_index_forecast=await n.json(),t.usnoaa_data_raw.noaa_planetary_k_index_forecast.shift();let e=new Date,a=new Date(0,0,0),r=1e3,c=0;return t.usnoaa_data_raw.noaa_planetary_k_index_forecast.forEach(((n,o)=>{n[1]>c&&(c=n[1]),n[1]<r&&(r=n[1]);let i=new Date(n[0]+" UTC");Math.abs(i.getTime()-e.getTime())<Math.abs(a.getTime()-e.getTime())&&(a=i,t.now.kp=n[1]),t.usnoaa_data_raw.noaa_planetary_k_index_forecast[o]={time:i,kp:n[1],observed:n[2]}})),t.now.kp_min=r.toString(),t.now.kp_max=c.toString(),console.log(t),t}();Q.update((n=>Object.assign(Object.assign({},n),t))),W(Q,!1)}();var ut=function(n){t(u,s);var e=X(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,st,it,c,{}),n}return i(u)}();function lt(t,n,e,a,r,c,o){try{var i=t[c](o),s=i.value}catch(t){return void e(t)}i.done?n(s):Promise.resolve(s).then(a,r)}function ft(t){return function(){var n=this,e=arguments;return new Promise((function(a,r){var c=t.apply(n,e);function o(t){lt(c,a,r,o,i,"next",t)}function i(t){lt(c,a,r,o,i,"throw",t)}o(void 0)}))}}function dt(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function ht(t){var n,e,a=t[1].default,r=T(a,t,t[0],null);return{c:function(){n=u("div"),r&&r.c(),this.h()},l:function(t){n=l(t,"DIV",{class:!0});var e=f(n);r&&r.l(e),e.forEach(d),this.h()},h:function(){h(n,"class","chip svelte-6dfxfp")},m:function(t,a){v(t,n,a),r&&r.m(n,null),e=!0},p:function(t,n){var c=k(n,1)[0];r&&r.p&&(!e||1&c)&&M(r,a,t,t[0],e?C(a,t[0],c,null):S(t[0]),null)},i:function(t){e||(R(r,t),e=!0)},o:function(t){I(r,t),e=!1},d:function(t){t&&d(n),r&&r.d(t)}}}function vt(t,n,e){var a=n.$$slots,r=void 0===a?{}:a,c=n.$$scope;return t.$$set=function(t){"$$scope"in t&&e(0,c=t.$$scope)},[c,r]}var pt=function(n){t(u,s);var e=dt(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,vt,ht,c,{}),n}return i(u)}();function mt(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function gt(t){var n,e,a,r,c,o,i,s,g,$,E,D,I=t[5]&&function(t){var n,e,a,r,c,o,i,s,g,$,E,k,D=Math.round(t[3])+"",I=Math.round(t[4])+"";return{c:function(){n=u("div"),e=u("p"),a=u("i"),r=_(),c=y(D),o=y("°C"),i=_(),s=u("p"),g=u("i"),$=_(),E=y(I),k=y("%"),this.h()},l:function(t){n=l(t,"DIV",{class:!0});var u=f(n);e=l(u,"P",{class:!0});var h=f(e);a=l(h,"I",{class:!0}),f(a).forEach(d),r=w(h),c=b(h,D),o=b(h,"°C"),h.forEach(d),i=w(u),s=l(u,"P",{class:!0});var v=f(s);g=l(v,"I",{class:!0}),f(g).forEach(d),$=w(v),E=b(v,I),k=b(v,"%"),v.forEach(d),u.forEach(d),this.h()},h:function(){h(a,"class","fas fa-thermometer-half svelte-ghmp86"),h(e,"class","svelte-ghmp86"),h(g,"class","fas fa-cloud svelte-ghmp86"),h(s,"class","svelte-ghmp86"),h(n,"class","svelte-ghmp86")},m:function(t,u){v(t,n,u),p(n,e),p(e,a),p(e,r),p(e,c),p(e,o),p(n,i),p(n,s),p(s,g),p(s,$),p(s,E),p(s,k)},p:m,d:function(t){t&&d(n)}}}(t);return{c:function(){n=u("div"),e=u("div"),a=u("h3"),r=y(t[2]),c=_(),o=u("p"),i=y(t[1]),s=_(),g=u("div"),$=u("h2"),E=y(t[0]),D=_(),I&&I.c(),this.h()},l:function(u){n=l(u,"DIV",{class:!0});var h=f(n);e=l(h,"DIV",{class:!0});var v=f(e);a=l(v,"H3",{class:!0});var p=f(a);r=b(p,t[2]),p.forEach(d),c=w(v),o=l(v,"P",{class:!0});var m=f(o);i=b(m,t[1]),m.forEach(d),v.forEach(d),s=w(h),g=l(h,"DIV",{class:!0});var _=f(g);$=l(_,"H2",{class:!0});var y=f($);E=b(y,t[0]),y.forEach(d),D=w(_),I&&I.l(_),_.forEach(d),h.forEach(d),this.h()},h:function(){h(a,"class","svelte-ghmp86"),h(o,"class","svelte-ghmp86"),h(e,"class","svelte-ghmp86"),h($,"class","svelte-ghmp86"),h(g,"class","data svelte-ghmp86"),h(n,"class","prediction-details svelte-ghmp86")},m:function(t,u){v(t,n,u),p(n,e),p(e,a),p(a,r),p(e,c),p(e,o),p(o,i),p(n,s),p(n,g),p(g,$),p($,E),p(g,D),I&&I.m(g,null)},p:function(t,n){var e=k(n,1)[0];t[5]&&I.p(t,e)},i:m,o:m,d:function(t){t&&d(n),I&&I.d()}}}function _t(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,e=t,a=0;a<n-t.length;a++)e="0"+e;return e}function yt(t,n,e){var a=n.prediction,r=a.kp,c=a.time.getDate()+". "+["January","February","March","April","May","June","July","August","September","October","November","December"][a.time.getMonth()],o=_t(a.time.getHours().toString())+":"+_t(a.time.getMinutes().toString()),i=a.temp,s=a.clouds,u=a.hasNOMETData;return t.$$set=function(t){"prediction"in t&&e(6,a=t.prediction)},[r,c,o,i,s,u,a]}var wt=function(n){t(u,s);var e=mt(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,yt,gt,c,{prediction:6}),n}return i(u)}();function bt(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function $t(t,n,e){var a=t.slice();return a[5]=n[e],a[7]=e,a}function Et(t){var n,e;return n=new wt({props:{prediction:t[5]}}),{c:function(){j(n.$$.fragment)},l:function(t){V(n.$$.fragment,t)},m:function(t,a){x(n,t,a),e=!0},p:function(t,e){var a={};1&e&&(a.prediction=t[5]),n.$set(a)},i:function(t){e||(R(n.$$.fragment,t),e=!0)},o:function(t){I(n.$$.fragment,t),e=!1},d:function(t){B(n,t)}}}function kt(t){for(var n,e,a=t[0],r=[],c=0;c<a.length;c+=1)r[c]=Et($t(t,a,c));var o=function(t){return I(r[t],1,1,(function(){r[t]=null}))};return{c:function(){n=u("div");for(var t=0;t<r.length;t+=1)r[t].c();this.h()},l:function(t){n=l(t,"DIV",{class:!0});for(var e=f(n),a=0;a<r.length;a+=1)r[a].l(e);e.forEach(d),this.h()},h:function(){h(n,"class","prediction-table svelte-dqc8qx")},m:function(t,a){v(t,n,a);for(var c=0;c<r.length;c+=1)r[c].m(n,null);e=!0},p:function(t,e){var c=k(e,1)[0];if(1&c){var i;for(a=t[0],i=0;i<a.length;i+=1){var s=$t(t,a,i);r[i]?(r[i].p(s,c),R(r[i],1)):(r[i]=Et(s),r[i].c(),R(r[i],1),r[i].m(n,null))}for(D(),i=a.length;i<r.length;i+=1)o(i);O()}},i:function(t){if(!e){for(var n=0;n<a.length;n+=1)R(r[n]);e=!0}},o:function(t){r=r.filter(Boolean);for(var n=0;n<r.length;n+=1)I(r[n]);e=!1},d:function(t){t&&d(n),N(r,t)}}}function Dt(t,n,e){var a,r,c;function o(){return i.apply(this,arguments)}function i(){return(i=ft(q.mark((function t(){var n;return q.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.updating&&!a.updating){t.next=3;break}return e(0,c=null),t.abrupt("return");case 3:n=r.usnoaa_data_raw.geospace_pred_est_kp_1_hour.filter((function(t){return t.model_prediction_time>=new Date})),e(0,c=n.map((function(t){return{time:t.model_prediction_time,kp:Math.round(t.k),temp:null,clouds:null,hasNOMETData:a.available}}))),a.available&&c.forEach((function(t,n){var r,o,i=new Date(0,0,0);a.yr_data_raw.properties.timeseries.forEach((function(n,e){var a=new Date(n.time);Math.abs(a.getTime()-t.time.getTime())<Math.abs(i.getTime()-t.time.getTime())&&(i=a,r=n.data.instant.details.air_temperature,o=n.data.instant.details.cloud_area_fraction)})),e(0,c[n]=Object.assign(Object.assign({},c[n]),{temp:r,clouds:o}),c)}));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return P(t,G,(function(t){return e(1,a=t)})),P(t,Q,(function(t){return e(2,r=t)})),Q.subscribe(o),G.subscribe(o),[c]}var It=function(n){t(u,s);var e=bt(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,Dt,kt,c,{}),n}return i(u)}();function Ot(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function Rt(t){var n,e,a;return e=new pt({props:{$$slots:{default:[Pt]},$$scope:{ctx:t}}}),{c:function(){n=u("div"),j(e.$$.fragment),this.h()},l:function(t){n=l(t,"DIV",{class:!0});var a=f(n);V(e.$$.fragment,a),a.forEach(d),this.h()},h:function(){h(n,"class","svelte-ghmp86")},m:function(t,r){v(t,n,r),x(e,n,null),a=!0},p:function(t,n){var a={};257&n&&(a.$$scope={dirty:n,ctx:t}),e.$set(a)},i:function(t){a||(R(e.$$.fragment,t),a=!0)},o:function(t){I(e.$$.fragment,t),a=!1},d:function(t){t&&d(n),B(e)}}}function Pt(t){var n,e=t[0].observed+"";return{c:function(){n=y(e)},l:function(t){n=b(t,e)},m:function(t,e){v(t,n,e)},p:function(t,a){1&a&&e!==(e=t[0].observed+"")&&$(n,e)},d:function(t){t&&d(n)}}}function jt(t){var n,e,a,r,c,o,i,s,g,$,E,P,j,V,x="predicted"!=t[0].observed&&Rt(t),B=t[6]&&function(t){var n,e,a,r,c,o,i,s,g,$,E,k,D=Math.round(t[4])+"",I=Math.round(t[5])+"";return{c:function(){n=u("div"),e=u("p"),a=u("i"),r=_(),c=y(D),o=y("°C"),i=_(),s=u("p"),g=u("i"),$=_(),E=y(I),k=y("%"),this.h()},l:function(t){n=l(t,"DIV",{class:!0});var u=f(n);e=l(u,"P",{class:!0});var h=f(e);a=l(h,"I",{class:!0}),f(a).forEach(d),r=w(h),c=b(h,D),o=b(h,"°C"),h.forEach(d),i=w(u),s=l(u,"P",{class:!0});var v=f(s);g=l(v,"I",{class:!0}),f(g).forEach(d),$=w(v),E=b(v,I),k=b(v,"%"),v.forEach(d),u.forEach(d),this.h()},h:function(){h(a,"class","fas fa-thermometer-half svelte-ghmp86"),h(e,"class","svelte-ghmp86"),h(g,"class","fas fa-cloud svelte-ghmp86"),h(s,"class","svelte-ghmp86"),h(n,"class","svelte-ghmp86")},m:function(t,u){v(t,n,u),p(n,e),p(e,a),p(e,r),p(e,c),p(e,o),p(n,i),p(n,s),p(s,g),p(s,$),p(s,E),p(s,k)},p:m,d:function(t){t&&d(n)}}}(t);return{c:function(){n=u("div"),e=u("div"),a=u("h3"),r=y(t[3]),c=_(),o=u("p"),i=y(t[2]),s=_(),x&&x.c(),g=_(),$=u("div"),E=u("h2"),P=y(t[1]),j=_(),B&&B.c(),this.h()},l:function(u){n=l(u,"DIV",{class:!0});var h=f(n);e=l(h,"DIV",{class:!0});var v=f(e);a=l(v,"H3",{class:!0});var p=f(a);r=b(p,t[3]),p.forEach(d),c=w(v),o=l(v,"P",{class:!0});var m=f(o);i=b(m,t[2]),m.forEach(d),v.forEach(d),s=w(h),x&&x.l(h),g=w(h),$=l(h,"DIV",{class:!0});var _=f($);E=l(_,"H2",{class:!0});var y=f(E);P=b(y,t[1]),y.forEach(d),j=w(_),B&&B.l(_),_.forEach(d),h.forEach(d),this.h()},h:function(){h(a,"class","svelte-ghmp86"),h(o,"class","svelte-ghmp86"),h(e,"class","svelte-ghmp86"),h(E,"class","svelte-ghmp86"),h($,"class","data svelte-ghmp86"),h(n,"class","prediction-details svelte-ghmp86")},m:function(t,u){v(t,n,u),p(n,e),p(e,a),p(a,r),p(e,c),p(e,o),p(o,i),p(n,s),x&&x.m(n,null),p(n,g),p(n,$),p($,E),p(E,P),p($,j),B&&B.m($,null),V=!0},p:function(t,e){var a=k(e,1)[0];"predicted"!=t[0].observed?x?(x.p(t,a),1&a&&R(x,1)):((x=Rt(t)).c(),R(x,1),x.m(n,g)):x&&(D(),I(x,1,1,(function(){x=null})),O()),t[6]&&B.p(t,a)},i:function(t){V||(R(x),V=!0)},o:function(t){I(x),V=!1},d:function(t){t&&d(n),x&&x.d(),B&&B.d()}}}function Vt(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,e=t,a=0;a<n-t.length;a++)e="0"+e;return e}function xt(t,n,e){var a=n.prediction,r=a.kp,c=a.time.getDate()+". "+["January","February","March","April","May","June","July","August","September","October","November","December"][a.time.getMonth()],o=Vt(a.time.getHours().toString())+":"+Vt(a.time.getMinutes().toString()),i=a.temp,s=a.clouds,u=a.hasNOMETData;return t.$$set=function(t){"prediction"in t&&e(0,a=t.prediction)},[a,r,c,o,i,s,u]}var Bt=function(n){t(u,s);var e=Ot(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,xt,jt,c,{prediction:0}),n}return i(u)}();function Tt(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function Mt(t,n,e){var a=t.slice();return a[5]=n[e],a[7]=e,a}function St(t){var n,e;return n=new Bt({props:{prediction:t[5]}}),{c:function(){j(n.$$.fragment)},l:function(t){V(n.$$.fragment,t)},m:function(t,a){x(n,t,a),e=!0},p:function(t,e){var a={};1&e&&(a.prediction=t[5]),n.$set(a)},i:function(t){e||(R(n.$$.fragment,t),e=!0)},o:function(t){I(n.$$.fragment,t),e=!1},d:function(t){B(n,t)}}}function Ct(t){for(var n,e,a=t[0],r=[],c=0;c<a.length;c+=1)r[c]=St(Mt(t,a,c));var o=function(t){return I(r[t],1,1,(function(){r[t]=null}))};return{c:function(){n=u("div");for(var t=0;t<r.length;t+=1)r[t].c();this.h()},l:function(t){n=l(t,"DIV",{class:!0});for(var e=f(n),a=0;a<r.length;a+=1)r[a].l(e);e.forEach(d),this.h()},h:function(){h(n,"class","prediction-table svelte-dqc8qx")},m:function(t,a){v(t,n,a);for(var c=0;c<r.length;c+=1)r[c].m(n,null);e=!0},p:function(t,e){var c=k(e,1)[0];if(1&c){var i;for(a=t[0],i=0;i<a.length;i+=1){var s=Mt(t,a,i);r[i]?(r[i].p(s,c),R(r[i],1)):(r[i]=St(s),r[i].c(),R(r[i],1),r[i].m(n,null))}for(D(),i=a.length;i<r.length;i+=1)o(i);O()}},i:function(t){if(!e){for(var n=0;n<a.length;n+=1)R(r[n]);e=!0}},o:function(t){r=r.filter(Boolean);for(var n=0;n<r.length;n+=1)I(r[n]);e=!1},d:function(t){t&&d(n),N(r,t)}}}function Nt(t,n,e){var a,r,c;function o(){return i.apply(this,arguments)}function i(){return(i=ft(q.mark((function t(){var n;return q.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.updating&&!a.updating){t.next=3;break}return e(0,c=null),t.abrupt("return");case 3:n=r.usnoaa_data_raw.noaa_planetary_k_index_forecast.filter((function(t){return"observed"!==t.observed})),e(0,c=n.map((function(t){return{time:t.time,kp:t.kp,observed:t.observed,temp:null,clouds:null,hasNOMETData:a.available}}))),a.available&&c.forEach((function(t,n){var r,o,i=new Date(0,0,0);a.yr_data_raw.properties.timeseries.forEach((function(n,e){var a=new Date(n.time);Math.abs(a.getTime()-t.time.getTime())<Math.abs(i.getTime()-t.time.getTime())&&(i=a,r=n.data.instant.details.air_temperature,o=n.data.instant.details.cloud_area_fraction)})),e(0,c[n]=Object.assign(Object.assign({},c[n]),{temp:r,clouds:o}),c)}));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return P(t,G,(function(t){return e(1,a=t)})),P(t,Q,(function(t){return e(2,r=t)})),Q.subscribe(o),G.subscribe(o),[c]}var qt=function(n){t(u,s);var e=Tt(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,Nt,Ct,c,{}),n}return i(u)}();function Ht(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function At(t){var n,e,a,r,c;return{c:function(){n=u("div"),e=u("i"),a=_(),r=u("p"),c=y("No prediction data"),this.h()},l:function(t){n=l(t,"DIV",{class:!0});var o=f(n);e=l(o,"I",{class:!0}),f(e).forEach(d),a=w(o),r=l(o,"P",{});var i=f(r);c=b(i,"No prediction data"),i.forEach(d),o.forEach(d),this.h()},h:function(){h(e,"class","fas fa-7x fa-exclamation-triangle"),h(n,"class","no-data svelte-6c4yca")},m:function(t,o){v(t,n,o),p(n,e),p(n,a),p(n,r),p(r,c)},p:m,i:m,o:m,d:function(t){t&&d(n)}}}function zt(t){var n,e,a,r,c,o,i,s,m,g,$,k,P,T,M,S,C=t[0];return C&&(k=new C({})),{c:function(){n=u("div"),e=u("h2"),a=y("Forecast"),r=_(),c=u("div"),o=u("div"),i=y("hour"),s=_(),m=u("div"),g=y("3 day"),$=_(),k&&j(k.$$.fragment),P=E(),this.h()},l:function(t){n=l(t,"DIV",{class:!0});var u=f(n);e=l(u,"H2",{class:!0});var h=f(e);a=b(h,"Forecast"),h.forEach(d),r=w(u),c=l(u,"DIV",{class:!0});var v=f(c);o=l(v,"DIV",{class:!0});var p=f(o);i=b(p,"hour"),p.forEach(d),s=w(v),m=l(v,"DIV",{class:!0});var _=f(m);g=b(_,"3 day"),_.forEach(d),v.forEach(d),u.forEach(d),$=w(t),k&&V(k.$$.fragment,t),P=E(),this.h()},h:function(){h(e,"class","svelte-6c4yca"),h(o,"class","svelte-6c4yca"),H(o,"selected",t[0]==It),h(m,"class","svelte-6c4yca"),H(m,"selected",t[0]==qt),h(c,"class","version-picker svelte-6c4yca"),h(n,"class","header svelte-6c4yca")},m:function(u,l){v(u,n,l),p(n,e),p(e,a),p(n,r),p(n,c),p(c,o),p(o,i),p(c,s),p(c,m),p(m,g),v(u,$,l),k&&x(k,u,l),v(u,P,l),T=!0,M||(S=[A(o,"click",t[3]),A(m,"click",t[4])],M=!0)},p:function(t,n){if(1&n&&H(o,"selected",t[0]==It),1&n&&H(m,"selected",t[0]==qt),C!==(C=t[0])){if(k){D();var e=k;I(e.$$.fragment,1,0,(function(){B(e,1)})),O()}C?(k=new C({}),j(k.$$.fragment),R(k.$$.fragment,1),x(k,P.parentNode,P)):k=null}},i:function(t){T||(k&&R(k.$$.fragment,t),T=!0)},o:function(t){k&&I(k.$$.fragment,t),T=!1},d:function(t){t&&d(n),t&&d($),t&&d(P),k&&B(k,t),M=!1,z(S)}}}function Jt(t){var n,e,a,r,c=[zt,At],o=[];function i(t,n){return t[1].updating||t[2].updating?1:0}return e=i(t),a=o[e]=c[e](t),{c:function(){n=u("div"),a.c(),this.h()},l:function(t){n=l(t,"DIV",{class:!0});var e=f(n);a.l(e),e.forEach(d),this.h()},h:function(){h(n,"class","drawer svelte-6c4yca")},m:function(t,a){v(t,n,a),o[e].m(n,null),r=!0},p:function(t,r){var s=k(r,1)[0],u=e;(e=i(t))===u?o[e].p(t,s):(D(),I(o[u],1,1,(function(){o[u]=null})),O(),(a=o[e])?a.p(t,s):(a=o[e]=c[e](t)).c(),R(a,1),a.m(n,null))},i:function(t){r||(R(a),r=!0)},o:function(t){I(a),r=!1},d:function(t){t&&d(n),o[e].d()}}}function Kt(t,n,e){var a,r;P(t,G,(function(t){return e(1,a=t)})),P(t,Q,(function(t){return e(2,r=t)}));var c=qt;return[c,a,r,function(){return e(0,c=It)},function(){return e(0,c=qt)}]}var Ft=function(n){t(u,s);var e=Ht(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,Kt,Jt,c,{}),n}return i(u)}();function Lt(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function Ut(t){var n,e,a,r,c,o;return a=new ut({}),c=new Ft({}),{c:function(){n=_(),e=u("div"),j(a.$$.fragment),r=_(),j(c.$$.fragment),this.h()},l:function(t){J('[data-svelte="svelte-1q3846k"]',document.head).forEach(d),n=w(t),e=l(t,"DIV",{class:!0});var o=f(e);V(a.$$.fragment,o),r=w(o),V(c.$$.fragment,o),o.forEach(d),this.h()},h:function(){document.title="Aurora data",h(e,"class","homescreen svelte-pf4p6y")},m:function(t,i){v(t,n,i),v(t,e,i),x(a,e,null),p(e,r),x(c,e,null),o=!0},p:m,i:function(t){o||(R(a.$$.fragment,t),R(c.$$.fragment,t),o=!0)},o:function(t){I(a.$$.fragment,t),I(c.$$.fragment,t),o=!1},d:function(t){t&&d(n),t&&d(e),B(a),B(c)}}}var Zt=function(n){t(u,s);var e=Lt(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,null,Ut,c,{}),n}return i(u)}();export{Zt as default}; |