summaryrefslogtreecommitdiff
path: root/client/legacy/index.77d07c99.js
blob: ac649f26e1fa00a85413c18c5aa6cd1f4ceaaccc (plain) (blame)
1
import{_ as t,a as n,b as a,c as e,i as r,s as c,d as o,S as i,e as s,f as u,t as f,g as l,h,j as v,k as p,l as d,m,n as g,o as E,p as y,q as w,r as D,u as P,v as $,w as x,x as b,y as I,z as R,A as V,B as C,C as N,D as T,E as k,F as M}from"./client.aaaa1a17.js";function j(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(e){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return a(this,r)}}function S(t){var n,a,e,r,c,o,i,P,$,x,b,I,R,V,C,N,T,k,M,j,S,A,H,J,K,B,O,F,q,z,Z,G,L,Q,U,W,X,Y,tt,nt,at,et,rt,ct,ot,it,st,ut,ft;return{c:function(){n=s("div"),a=s("div"),e=s("div"),r=s("i"),c=u(),o=s("h1"),i=f(_),P=u(),$=s("div"),x=s("p"),b=f(t[0]),I=u(),R=s("div"),V=s("h2"),C=f("KP "),N=f(t[1]),T=u(),k=s("p"),M=s("span"),j=f("↑ KP "),S=f(t[3]),A=u(),H=s("span"),J=f("↓ KP "),K=f(t[2]),B=u(),O=s("div"),F=s("div"),q=s("p"),z=f("BZ"),Z=u(),G=s("p"),L=f(t[4]),Q=u(),U=s("div"),W=s("p"),X=f("Temp"),Y=u(),tt=s("p"),nt=f(t[6]),at=f("°C"),et=u(),rt=s("div"),ct=s("p"),ot=f("Clouds"),it=u(),st=s("p"),ut=f(t[5]),ft=f("%"),this.h()},l:function(s){n=l(s,"DIV",{class:!0});var u=h(n);a=l(u,"DIV",{class:!0});var f=h(a);e=l(f,"DIV",{class:!0});var m=h(e);r=l(m,"I",{class:!0}),h(r).forEach(v),c=p(m),o=l(m,"H1",{class:!0});var g=h(o);i=d(g,_),g.forEach(v),m.forEach(v),P=p(f),$=l(f,"DIV",{class:!0});var E=h($);x=l(E,"P",{});var y=h(x);b=d(y,t[0]),y.forEach(v),E.forEach(v),I=p(f),R=l(f,"DIV",{class:!0});var w=h(R);V=l(w,"H2",{class:!0});var D=h(V);C=d(D,"KP "),N=d(D,t[1]),D.forEach(v),T=p(w),k=l(w,"P",{});var lt=h(k);M=l(lt,"SPAN",{className:!0});var ht=h(M);j=d(ht,"↑ KP "),S=d(ht,t[3]),ht.forEach(v),A=p(lt),H=l(lt,"SPAN",{className:!0});var vt=h(H);J=d(vt,"↓ KP "),K=d(vt,t[2]),vt.forEach(v),lt.forEach(v),w.forEach(v),B=p(f),O=l(f,"DIV",{class:!0});var pt=h(O);F=l(pt,"DIV",{});var dt=h(F);q=l(dt,"P",{class:!0});var mt=h(q);z=d(mt,"BZ"),mt.forEach(v),Z=p(dt),G=l(dt,"P",{class:!0});var gt=h(G);L=d(gt,t[4]),gt.forEach(v),dt.forEach(v),Q=p(pt),U=l(pt,"DIV",{});var Et=h(U);W=l(Et,"P",{class:!0});var yt=h(W);X=d(yt,"Temp"),yt.forEach(v),Y=p(Et),tt=l(Et,"P",{class:!0});var wt=h(tt);nt=d(wt,t[6]),at=d(wt,"°C"),wt.forEach(v),Et.forEach(v),et=p(pt),rt=l(pt,"DIV",{});var Dt=h(rt);ct=l(Dt,"P",{class:!0});var Pt=h(ct);ot=d(Pt,"Clouds"),Pt.forEach(v),it=p(Dt),st=l(Dt,"P",{class:!0});var $t=h(st);ut=d($t,t[5]),ft=d($t,"%"),$t.forEach(v),Dt.forEach(v),pt.forEach(v),f.forEach(v),u.forEach(v),this.h()},h:function(){m(r,"class","symbol fas fa-map-marker-alt svelte-1oi7i0p"),m(o,"class","svelte-1oi7i0p"),m(e,"class","weatherCurrent-data-location svelte-1oi7i0p"),m($,"class","weatherCurrent-data-date"),m(V,"class","svelte-1oi7i0p"),m(M,"classname","pr-2"),m(H,"classname","pl-2"),m(R,"class","weatherCurrent-data-kp svelte-1oi7i0p"),m(q,"class","svelte-1oi7i0p"),m(G,"class","svelte-1oi7i0p"),m(W,"class","svelte-1oi7i0p"),m(tt,"class","svelte-1oi7i0p"),m(ct,"class","svelte-1oi7i0p"),m(st,"class","svelte-1oi7i0p"),m(O,"class","current-details svelte-1oi7i0p"),m(a,"class","weatherCurrent-data svelte-1oi7i0p"),m(n,"class","weatherCurrent-wrapper svelte-1oi7i0p")},m:function(t,s){g(t,n,s),E(n,a),E(a,e),E(e,r),E(e,c),E(e,o),E(o,i),E(a,P),E(a,$),E($,x),E(x,b),E(a,I),E(a,R),E(R,V),E(V,C),E(V,N),E(R,T),E(R,k),E(k,M),E(M,j),E(M,S),E(k,A),E(k,H),E(H,J),E(H,K),E(a,B),E(a,O),E(O,F),E(F,q),E(q,z),E(F,Z),E(F,G),E(G,L),E(O,Q),E(O,U),E(U,W),E(W,X),E(U,Y),E(U,tt),E(tt,nt),E(tt,at),E(O,et),E(O,rt),E(rt,ct),E(ct,ot),E(rt,it),E(rt,st),E(st,ut),E(st,ft)},p:function(t,n){var a=y(n,1)[0];1&a&&w(b,t[0]),2&a&&w(N,t[1]),8&a&&w(S,t[3]),4&a&&w(K,t[2]),16&a&&w(L,t[4]),64&a&&w(nt,t[6]),32&a&&w(ut,t[5])},i:D,o:D,d:function(t){t&&v(n)}}}var _="The earth";function A(t,n,a){var e,r,c=this&&this.__awaiter||function(t,n,a,e){return new(a||(a=Promise))((function(r,c){function o(t){try{s(e.next(t))}catch(t){c(t)}}function i(t){try{s(e.throw(t))}catch(t){c(t)}}function s(t){var n;t.done?r(t.value):(n=t.value,n instanceof a?n:new a((function(t){t(n)}))).then(o,i)}s((e=e.apply(t,n||[])).next())}))},o=["January","February","March","April","May","June","July","August","September","October","November","December"],i="-",s="-",u="-",f="-",l="-",h="-",v="-";function p(t){e=t.coords.longitude,r=t.coords.latitude,function(t,n){c(this,void 0,void 0,$.mark((function e(){var r;return $.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=".concat(n,"&lon=").concat(t)).then((function(t){return t.json()}));case 2:r=e.sent,a(5,h=r.properties.timeseries[0].data.instant.details.cloud_area_fraction),a(6,v=r.properties.timeseries[0].data.instant.details.air_temperature);case 5:case"end":return e.stop()}}),e)})))}(e,r)}function d(t){m()}function m(){e=28.283333,r=-15.416667}return P((function(){!function(){c(this,void 0,void 0,$.mark((function t(){var n,e,r,c,h;return $.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=a,t.next=3,fetch("https://services.swpc.noaa.gov/products/summary/solar-wind-mag-field.json").then((function(t){return t.json()}));case 3:return t.t1=l=t.sent.Bz,(0,t.t0)(4,t.t1),t.next=7,fetch("https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json").then((function(t){return t.json()}));case 7:(n=t.sent).shift(),e=new Date,r=new Date(0,0,0),c=1e3,h=0,n.forEach((function(t,n){t[1]>h&&(h=t[1]),t[1]<c&&(c=t[1]);var o=new Date(t[0]);Math.abs(o.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())&&(r=o,a(1,s=t[1]))})),a(2,u=c.toString()),a(3,f=h.toString()),a(0,i=r.getDay()+". "+o[r.getMonth()]+" "+r.getHours()+":"+r.getMinutes());case 17:case"end":return t.stop()}}),t)})))}(),navigator.geolocation?navigator.geolocation.getCurrentPosition(p,d):m()})),[i,s,u,f,l,h,v]}var H=function(n){t(s,i);var a=j(s);function s(t){var n;return e(this,s),n=a.call(this),r(o(n),t,A,S,c,{}),n}return s}();function J(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(e){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return a(this,r)}}function K(t){var n,a,e,r,c,o,i,w,P,$,x,b,I=t[5]&&function(t){var n,a,e,r,c,o,i,y,w,P,$,x;return{c:function(){n=s("div"),a=s("p"),e=s("i"),r=u(),c=f(t[3]),o=f("°C"),i=u(),y=s("p"),w=s("i"),P=u(),$=f(t[4]),x=f("%"),this.h()},l:function(s){n=l(s,"DIV",{});var u=h(n);a=l(u,"P",{});var f=h(a);e=l(f,"I",{class:!0}),h(e).forEach(v),r=p(f),c=d(f,t[3]),o=d(f,"°C"),f.forEach(v),i=p(u),y=l(u,"P",{});var m=h(y);w=l(m,"I",{class:!0}),h(w).forEach(v),P=p(m),$=d(m,t[4]),x=d(m,"%"),m.forEach(v),u.forEach(v),this.h()},h:function(){m(e,"class","fas fa-thermometer-half"),m(w,"class","fas fa-cloud")},m:function(t,s){g(t,n,s),E(n,a),E(a,e),E(a,r),E(a,c),E(a,o),E(n,i),E(n,y),E(y,w),E(y,P),E(y,$),E(y,x)},p:D,d:function(t){t&&v(n)}}}(t);return{c:function(){n=s("div"),a=s("div"),e=s("h3"),r=f(t[2]),c=u(),o=s("p"),i=f(t[1]),w=u(),P=s("div"),$=s("h2"),x=f(t[0]),b=u(),I&&I.c(),this.h()},l:function(s){n=l(s,"DIV",{class:!0});var u=h(n);a=l(u,"DIV",{});var f=h(a);e=l(f,"H3",{class:!0});var m=h(e);r=d(m,t[2]),m.forEach(v),c=p(f),o=l(f,"P",{});var g=h(o);i=d(g,t[1]),g.forEach(v),f.forEach(v),w=p(u),P=l(u,"DIV",{class:!0});var E=h(P);$=l(E,"H2",{class:!0});var y=h($);x=d(y,t[0]),y.forEach(v),b=p(E),I&&I.l(E),E.forEach(v),u.forEach(v),this.h()},h:function(){m(e,"class","svelte-u548p6"),m($,"class","svelte-u548p6"),m(P,"class","data svelte-u548p6"),m(n,"class","prediction-details svelte-u548p6")},m:function(t,s){g(t,n,s),E(n,a),E(a,e),E(e,r),E(a,c),E(a,o),E(o,i),E(n,w),E(n,P),E(P,$),E($,x),E(P,b),I&&I.m(P,null)},p:function(t,n){var a=y(n,1)[0];t[5]&&I.p(t,a)},i:D,o:D,d:function(t){t&&v(n),I&&I.d()}}}function B(t,n,a){var e=n.prediction,r=e.kp,c=e.time.split(" "),o=Number(c[0].split("-")[2])+". "+["January","February","March","April","May","June","July","August","September","October","November","December"][Number(c[0].split("-")[1])],i=c[1].substring(0,5),s=e.temp,u=e.clouds,f=e.hasNOMETData;return t.$$set=function(t){"prediction"in t&&a(6,e=t.prediction)},[r,o,i,s,u,f,e]}var O=function(n){t(s,i);var a=J(s);function s(t){var n;return e(this,s),n=a.call(this),r(o(n),t,B,K,c,{prediction:6}),n}return s}();function F(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(e){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return a(this,r)}}function q(t,n,a){var e=t.slice();return e[13]=n[a],e[15]=a,e}function z(t){var n,a,e,r,c;return{c:function(){n=s("div"),a=s("i"),e=u(),r=s("p"),c=f("No prediction data"),this.h()},l:function(t){n=l(t,"DIV",{class:!0});var o=h(n);a=l(o,"I",{class:!0}),h(a).forEach(v),e=p(o),r=l(o,"P",{});var i=h(r);c=d(i,"No prediction data"),i.forEach(v),o.forEach(v),this.h()},h:function(){m(a,"class","fas fa-7x fa-exclamation-triangle"),m(n,"class","no-data svelte-1romtap")},m:function(t,o){g(t,n,o),E(n,a),E(n,e),E(n,r),E(r,c)},p:D,i:D,o:D,d:function(t){t&&v(n)}}}function Z(t){for(var n,a,e,r,c,o,i=t[0],y=[],w=0;w<i.length;w+=1)y[w]=G(q(t,i,w));var D=function(t){return b(y[t],1,1,(function(){y[t]=null}))};return{c:function(){n=s("div"),a=s("h2"),e=f("Predicted"),r=u(),c=s("div");for(var t=0;t<y.length;t+=1)y[t].c();this.h()},l:function(t){n=l(t,"DIV",{className:!0});var o=h(n);a=l(o,"H2",{class:!0});var i=h(a);e=d(i,"Predicted"),i.forEach(v),o.forEach(v),r=p(t),c=l(t,"DIV",{class:!0});for(var s=h(c),u=0;u<y.length;u+=1)y[u].l(s);s.forEach(v),this.h()},h:function(){m(a,"class","svelte-1romtap"),m(n,"classname","flex flex-row justify-between items-top"),m(c,"class","prediction-table svelte-1romtap")},m:function(t,i){g(t,n,i),E(n,a),E(a,e),g(t,r,i),g(t,c,i);for(var s=0;s<y.length;s+=1)y[s].m(c,null);o=!0},p:function(t,n){if(1&n){var a;for(i=t[0],a=0;a<i.length;a+=1){var e=q(t,i,a);y[a]?(y[a].p(e,n),R(y[a],1)):(y[a]=G(e),y[a].c(),R(y[a],1),y[a].m(c,null))}for(x(),a=i.length;a<y.length;a+=1)D(a);I()}},i:function(t){if(!o){for(var n=0;n<i.length;n+=1)R(y[n]);o=!0}},o:function(t){y=y.filter(Boolean);for(var n=0;n<y.length;n+=1)b(y[n]);o=!1},d:function(t){t&&v(n),t&&v(r),t&&v(c),k(y,t)}}}function G(t){var n,a;return n=new O({props:{prediction:t[13]}}),{c:function(){V(n.$$.fragment)},l:function(t){C(n.$$.fragment,t)},m:function(t,e){N(n,t,e),a=!0},p:function(t,a){var e={};1&a&&(e.prediction=t[13]),n.$set(e)},i:function(t){a||(R(n.$$.fragment,t),a=!0)},o:function(t){b(n.$$.fragment,t),a=!1},d:function(t){T(n,t)}}}function L(t){var n,a,e,r,c=[Z,z],o=[];function i(t,n){return t[0]?0:1}return a=i(t),e=o[a]=c[a](t),{c:function(){n=s("div"),e.c(),this.h()},l:function(t){n=l(t,"DIV",{class:!0});var a=h(n);e.l(a),a.forEach(v),this.h()},h:function(){m(n,"class","predicted-weather svelte-1romtap")},m:function(t,e){g(t,n,e),o[a].m(n,null),r=!0},p:function(t,r){var s=y(r,1)[0],u=a;(a=i(t))===u?o[a].p(t,s):(x(),b(o[u],1,1,(function(){o[u]=null})),I(),(e=o[a])||(e=o[a]=c[a](t)).c(),R(e,1),e.m(n,null))},i:function(t){r||(R(e),r=!0)},o:function(t){b(e),r=!1},d:function(t){t&&v(n),o[a].d()}}}function Q(t,n,a){var e,r,c,o=this&&this.__awaiter||function(t,n,a,e){return new(a||(a=Promise))((function(r,c){function o(t){try{s(e.next(t))}catch(t){c(t)}}function i(t){try{s(e.throw(t))}catch(t){c(t)}}function s(t){var n;t.done?r(t.value):(n=t.value,n instanceof a?n:new a((function(t){t(n)}))).then(o,i)}s((e=e.apply(t,n||[])).next())}))},i=!1;function s(t,n){return o(this,void 0,void 0,$.mark((function e(){var r,o,s;return $.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i){e.next=4;break}return e.next=3,fetch("https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=".concat(n,"&lon=").concat(t)).then((function(t){return t.json()}));case 3:r=e.sent;case 4:return e.next=6,fetch("https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json").then((function(t){return t.json()}));case 6:(o=e.sent).shift(),s=[],o.forEach((function(t,n){if("observed"!=t[2]){var a,e,c=new Date(t[0]),o=new Date(0,0,0);i&&r.properties.timeseries.forEach((function(t,n){var r=new Date(t.time);Math.abs(r.getTime()-c.getTime())<Math.abs(o.getTime()-c.getTime())&&(o=r,a=t.data.instant.details.air_temperature,e=t.data.instant.details.cloud_area_fraction)})),s.push({time:t[0],kp:t[1],temp:a,clouds:e,hasNOMETData:i})}})),a(0,c=s);case 11:case"end":return e.stop()}}),e)})))}function u(t){e=t.coords.longitude,r=t.coords.latitude,s(e,r)}function f(t){i=!1,l()}function l(){e=28.283333,r=-15.416667,s(0,0)}return P((function(){navigator.geolocation?(i=!0,navigator.geolocation.getCurrentPosition(u,f)):(i=!1,l())})),[c]}var U=function(n){t(s,i);var a=F(s);function s(t){var n;return e(this,s),n=a.call(this),r(o(n),t,Q,L,c,{}),n}return s}();function W(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(e){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return a(this,r)}}function X(t){var n,a,e,r,c,o;return e=new H({}),c=new U({}),{c:function(){n=u(),a=s("div"),V(e.$$.fragment),r=u(),V(c.$$.fragment),this.h()},l:function(t){M('[data-svelte="svelte-1q3846k"]',document.head).forEach(v),n=p(t),a=l(t,"DIV",{class:!0});var o=h(a);C(e.$$.fragment,o),r=p(o),C(c.$$.fragment,o),o.forEach(v),this.h()},h:function(){document.title="Aurora data",m(a,"class","homescreen svelte-pf4p6y")},m:function(t,i){g(t,n,i),g(t,a,i),N(e,a,null),E(a,r),N(c,a,null),o=!0},p:D,i:function(t){o||(R(e.$$.fragment,t),R(c.$$.fragment,t),o=!0)},o:function(t){b(e.$$.fragment,t),b(c.$$.fragment,t),o=!1},d:function(t){t&&v(n),t&&v(a),T(e),T(c)}}}var Y=function(n){t(s,i);var a=W(s);function s(t){var n;return e(this,s),n=a.call(this),r(o(n),t,null,X,c,{}),n}return s}();export default Y;