diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index 75437a3a..8b6e8214 100644 --- a/lib/SvelteUi/app/dist/index.js +++ b/lib/SvelteUi/app/dist/index.js @@ -1,7 +1,7 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function l(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=l(i);fetch(i.href,s)}})();function Ze(){}function yl(t,e){for(const l in e)t[l]=e[l];return t}function Wf(t){return t()}function bs(){return Object.create(null)}function Ht(t){t.forEach(Wf)}function zi(t){return typeof t=="function"}function Dt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ti;function fi(t,e){return ti||(ti=document.createElement("a")),ti.href=e,t===ti.href}function ju(t){return Object.keys(t).length===0}function Wi(t,...e){if(t==null)return Ze;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function cn(t){let e;return Wi(t,l=>e=l)(),e}function Hl(t,e,l){t.$$.on_destroy.push(Wi(e,l))}function Gi(t,e,l,n){if(t){const i=Gf(t,e,l,n);return t[0](i)}}function Gf(t,e,l,n){return t[1]&&n?yl(l.ctx.slice(),t[1](n(e))):l.ctx}function Vi(t,e,l,n){if(t[2]&&n){const i=t[2](n(l));if(e.dirty===void 0)return i;if(typeof i=="object"){const s=[],a=Math.max(e.dirty.length,i.length);for(let r=0;r32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function ln(t){return function(e){return e.preventDefault(),t.call(this,e)}}function c(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}const Hu=["width","height"];function mn(t,e){const l=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:l[n]&&l[n].set&&Hu.indexOf(n)===-1?t[n]=e[n]:c(t,n,e[n])}function $e(t){return t===""?null:+t}function zu(t){return Array.from(t.childNodes)}function A(t,e){e=""+e,t.data!==e&&(t.data=e)}function Wu(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Gu(t,e,l){~yu.indexOf(l)?Wu(t,e):A(t,e)}function Me(t,e){t.value=e==null?"":e}function Vn(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function ot(t,e,l){for(let n=0;n{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{s=me(n.contentWindow,"resize",e),e()}),o(t,n),()=>{(i||s&&n.contentWindow)&&s(),P(n)}}function Ku(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function gs(t,e){return new t(e)}let Qn;function Kn(t){Qn=t}function Jn(){if(!Qn)throw new Error("Function called outside component initialization");return Qn}function Vf(t){Jn().$$.on_mount.push(t)}function Yu(t){Jn().$$.on_destroy.push(t)}function Qu(){const t=Jn();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const s=Ku(e,l,{cancelable:n});return i.slice().forEach(a=>{a.call(t,s)}),!s.defaultPrevented}return!0}}function Yn(t,e){return Jn().$$.context.set(t,e),e}function Xl(t){return Jn().$$.context.get(t)}const an=[],ci=[];let un=[];const ks=[],Kf=Promise.resolve();let Mi=!1;function Yf(){Mi||(Mi=!0,Kf.then(Qf))}function Xu(){return Yf(),Kf}function Wt(t){un.push(t)}const vi=new Set;let sn=0;function Qf(){if(sn!==0)return;const t=Qn;do{try{for(;snt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),un=e}const oi=new Set;let $l;function bt(){$l={r:0,c:[],p:$l}}function gt(){$l.r||Ht($l.c),$l=$l.p}function J(t,e){t&&t.i&&(oi.delete(t),t.i(e))}function ie(t,e,l,n){if(t&&t.o){if(oi.has(t))return;oi.add(t),$l.c.push(()=>{oi.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function Xf(t,e){const l={},n={},i={$$scope:1};let s=t.length;for(;s--;){const a=t[s],r=e[s];if(r){for(const f in a)f in r||(n[f]=1);for(const f in r)i[f]||(l[f]=r[f],i[f]=1);t[s]=r}else for(const f in a)i[f]=1}for(const a in n)a in l||(l[a]=void 0);return l}function ws(t){return typeof t=="object"&&t!==null?t:{}}function Oe(t){t&&t.c()}function Le(t,e,l,n){const{fragment:i,after_update:s}=t.$$;i&&i.m(e,l),n||Wt(()=>{const a=t.$$.on_mount.map(Wf).filter(zi);t.$$.on_destroy?t.$$.on_destroy.push(...a):Ht(a),t.$$.on_mount=[]}),s.forEach(Wt)}function Ie(t,e){const l=t.$$;l.fragment!==null&&(Ju(l.after_update),Ht(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function $u(t,e){t.$$.dirty[0]===-1&&(an.push(t),Yf(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const b=v.length?v[0]:d;return u.ctx&&i(u.ctx[_],u.ctx[_]=b)&&(!u.skip_bound&&u.bound[_]&&u.bound[_](b),m&&$u(t,_)),d}):[],u.update(),m=!0,Ht(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const _=zu(e.target);u.fragment&&u.fragment.l(_),_.forEach(P)}else u.fragment&&u.fragment.c();e.intro&&J(t.$$.fragment),Le(t,e.target,e.anchor,e.customElement),Qf()}Kn(f)}class It{$destroy(){Ie(this,1),this.$destroy=Ze}$on(e,l){if(!zi(l))return Ze;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(l),()=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!ju(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Cs=t=>typeof t>"u",Zf=t=>typeof t=="function",Jf=t=>typeof t=="number";function xu(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function $f(){let t=0;return()=>t++}function er(){return Math.random().toString(36).substring(2)}const Zl=typeof window>"u";function xf(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const eu=(t,e)=>t?{}:{style:e},Ni=t=>({"aria-hidden":"true",...eu(t,"display:none;")}),on=[];function tu(t,e){return{subscribe:nl(t,e).subscribe}}function nl(t,e=Ze){let l;const n=new Set;function i(r){if(Dt(t,r)&&(t=r,l)){const f=!on.length;for(const u of n)u[1](),on.push(u,t);if(f){for(let u=0;u{n.delete(u),n.size===0&&l&&(l(),l=null)}}return{set:i,update:s,subscribe:a}}function tr(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,s=e.length<2;return tu(l,a=>{let r=!1;const f=[];let u=0,m=Ze;const _=()=>{if(u)return;m();const v=e(n?f[0]:f,a);s?a(v):m=zi(v)?v:Ze},d=i.map((v,b)=>Wi(v,h=>{f[b]=h,u&=~(1<{u|=1<`@@svnav-ctx__${t}`,Ti=$n("LOCATION"),_n=$n("ROUTER"),lu=$n("ROUTE"),lr=$n("ROUTE_PARAMS"),nr=$n("FOCUS_ELEM"),nu=/^:(.+)/,zn=(t,e,l)=>t.substr(e,l),Pi=(t,e)=>zn(t,0,e.length)===e,ir=t=>t==="",sr=t=>nu.test(t),iu=t=>t[0]==="*",or=t=>t.replace(/\*.*$/,""),su=t=>t.replace(/(^\/+|\/+$)/g,"");function Wl(t,e=!1){const l=su(t).split("/");return e?l.filter(Boolean):l}const hi=(t,e)=>t+(e?`?${e}`:""),Xi=t=>`/${su(t)}`;function xn(...t){const e=n=>Wl(n,!0).join("/"),l=t.map(e).join("/");return Xi(l)}const Zi=1,di=2,tn=3,ar=4,ou=5,fr=6,au=7,ur=8,rr=9,fu=10,uu=11,cr={[Zi]:"Link",[di]:"Route",[tn]:"Router",[ar]:"useFocus",[ou]:"useLocation",[fr]:"useMatch",[au]:"useNavigate",[ur]:"useParams",[rr]:"useResolvable",[fu]:"useResolve",[uu]:"navigate"},Ji=t=>cr[t];function mr(t,e){let l;return t===di?l=e.path?`path="${e.path}"`:"default":t===Zi?l=`to="${e.to}"`:t===tn&&(l=`basepath="${e.basepath||""}"`),`<${Ji(t)} ${l||""} />`}function _r(t,e,l,n){const i=l&&mr(n||t,l),s=i?` +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function l(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerpolicy&&(s.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?s.credentials="include":i.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=l(i);fetch(i.href,s)}})();function Ze(){}function yl(t,e){for(const l in e)t[l]=e[l];return t}function Wf(t){return t()}function bs(){return Object.create(null)}function Ht(t){t.forEach(Wf)}function zi(t){return typeof t=="function"}function Dt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ti;function fi(t,e){return ti||(ti=document.createElement("a")),ti.href=e,t===ti.href}function ju(t){return Object.keys(t).length===0}function Wi(t,...e){if(t==null)return Ze;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function cn(t){let e;return Wi(t,l=>e=l)(),e}function Hl(t,e,l){t.$$.on_destroy.push(Wi(e,l))}function Gi(t,e,l,n){if(t){const i=Gf(t,e,l,n);return t[0](i)}}function Gf(t,e,l,n){return t[1]&&n?yl(l.ctx.slice(),t[1](n(e))):l.ctx}function Vi(t,e,l,n){if(t[2]&&n){const i=t[2](n(l));if(e.dirty===void 0)return i;if(typeof i=="object"){const s=[],a=Math.max(e.dirty.length,i.length);for(let r=0;r32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function ln(t){return function(e){return e.preventDefault(),t.call(this,e)}}function c(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}const Hu=["width","height"];function mn(t,e){const l=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:l[n]&&l[n].set&&Hu.indexOf(n)===-1?t[n]=e[n]:c(t,n,e[n])}function $e(t){return t===""?null:+t}function zu(t){return Array.from(t.childNodes)}function q(t,e){e=""+e,t.data!==e&&(t.data=e)}function Wu(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Gu(t,e,l){~yu.indexOf(l)?Wu(t,e):q(t,e)}function Me(t,e){t.value=e==null?"":e}function Vn(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function ot(t,e,l){for(let n=0;n{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{s=me(n.contentWindow,"resize",e),e()}),o(t,n),()=>{(i||s&&n.contentWindow)&&s(),P(n)}}function Ku(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function gs(t,e){return new t(e)}let Qn;function Kn(t){Qn=t}function Jn(){if(!Qn)throw new Error("Function called outside component initialization");return Qn}function Vf(t){Jn().$$.on_mount.push(t)}function Yu(t){Jn().$$.on_destroy.push(t)}function Qu(){const t=Jn();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const s=Ku(e,l,{cancelable:n});return i.slice().forEach(a=>{a.call(t,s)}),!s.defaultPrevented}return!0}}function Yn(t,e){return Jn().$$.context.set(t,e),e}function Xl(t){return Jn().$$.context.get(t)}const an=[],ci=[];let un=[];const ks=[],Kf=Promise.resolve();let Mi=!1;function Yf(){Mi||(Mi=!0,Kf.then(Qf))}function Xu(){return Yf(),Kf}function Wt(t){un.push(t)}const vi=new Set;let sn=0;function Qf(){if(sn!==0)return;const t=Qn;do{try{for(;snt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),un=e}const oi=new Set;let $l;function bt(){$l={r:0,c:[],p:$l}}function gt(){$l.r||Ht($l.c),$l=$l.p}function J(t,e){t&&t.i&&(oi.delete(t),t.i(e))}function ie(t,e,l,n){if(t&&t.o){if(oi.has(t))return;oi.add(t),$l.c.push(()=>{oi.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function Xf(t,e){const l={},n={},i={$$scope:1};let s=t.length;for(;s--;){const a=t[s],r=e[s];if(r){for(const f in a)f in r||(n[f]=1);for(const f in r)i[f]||(l[f]=r[f],i[f]=1);t[s]=r}else for(const f in a)i[f]=1}for(const a in n)a in l||(l[a]=void 0);return l}function ws(t){return typeof t=="object"&&t!==null?t:{}}function Oe(t){t&&t.c()}function Le(t,e,l,n){const{fragment:i,after_update:s}=t.$$;i&&i.m(e,l),n||Wt(()=>{const a=t.$$.on_mount.map(Wf).filter(zi);t.$$.on_destroy?t.$$.on_destroy.push(...a):Ht(a),t.$$.on_mount=[]}),s.forEach(Wt)}function Ie(t,e){const l=t.$$;l.fragment!==null&&(Ju(l.after_update),Ht(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function $u(t,e){t.$$.dirty[0]===-1&&(an.push(t),Yf(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const b=v.length?v[0]:d;return u.ctx&&i(u.ctx[_],u.ctx[_]=b)&&(!u.skip_bound&&u.bound[_]&&u.bound[_](b),m&&$u(t,_)),d}):[],u.update(),m=!0,Ht(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const _=zu(e.target);u.fragment&&u.fragment.l(_),_.forEach(P)}else u.fragment&&u.fragment.c();e.intro&&J(t.$$.fragment),Le(t,e.target,e.anchor,e.customElement),Qf()}Kn(f)}class It{$destroy(){Ie(this,1),this.$destroy=Ze}$on(e,l){if(!zi(l))return Ze;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(l),()=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!ju(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Cs=t=>typeof t>"u",Zf=t=>typeof t=="function",Jf=t=>typeof t=="number";function xu(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function $f(){let t=0;return()=>t++}function er(){return Math.random().toString(36).substring(2)}const Zl=typeof window>"u";function xf(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const eu=(t,e)=>t?{}:{style:e},Ni=t=>({"aria-hidden":"true",...eu(t,"display:none;")}),on=[];function tu(t,e){return{subscribe:nl(t,e).subscribe}}function nl(t,e=Ze){let l;const n=new Set;function i(r){if(Dt(t,r)&&(t=r,l)){const f=!on.length;for(const u of n)u[1](),on.push(u,t);if(f){for(let u=0;u{n.delete(u),n.size===0&&l&&(l(),l=null)}}return{set:i,update:s,subscribe:a}}function tr(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,s=e.length<2;return tu(l,a=>{let r=!1;const f=[];let u=0,m=Ze;const _=()=>{if(u)return;m();const v=e(n?f[0]:f,a);s?a(v):m=zi(v)?v:Ze},d=i.map((v,b)=>Wi(v,h=>{f[b]=h,u&=~(1<{u|=1<`@@svnav-ctx__${t}`,Ti=$n("LOCATION"),_n=$n("ROUTER"),lu=$n("ROUTE"),lr=$n("ROUTE_PARAMS"),nr=$n("FOCUS_ELEM"),nu=/^:(.+)/,zn=(t,e,l)=>t.substr(e,l),Pi=(t,e)=>zn(t,0,e.length)===e,ir=t=>t==="",sr=t=>nu.test(t),iu=t=>t[0]==="*",or=t=>t.replace(/\*.*$/,""),su=t=>t.replace(/(^\/+|\/+$)/g,"");function zl(t,e=!1){const l=su(t).split("/");return e?l.filter(Boolean):l}const hi=(t,e)=>t+(e?`?${e}`:""),Xi=t=>`/${su(t)}`;function xn(...t){const e=n=>zl(n,!0).join("/"),l=t.map(e).join("/");return Xi(l)}const Zi=1,di=2,tn=3,ar=4,ou=5,fr=6,au=7,ur=8,rr=9,fu=10,uu=11,cr={[Zi]:"Link",[di]:"Route",[tn]:"Router",[ar]:"useFocus",[ou]:"useLocation",[fr]:"useMatch",[au]:"useNavigate",[ur]:"useParams",[rr]:"useResolvable",[fu]:"useResolve",[uu]:"navigate"},Ji=t=>cr[t];function mr(t,e){let l;return t===di?l=e.path?`path="${e.path}"`:"default":t===Zi?l=`to="${e.to}"`:t===tn&&(l=`basepath="${e.basepath||""}"`),`<${Ji(t)} ${l||""} />`}function _r(t,e,l,n){const i=l&&mr(n||t,l),s=i?` -Occurred in: ${i}`:"",a=Ji(t),r=Zf(e)?e(a):e;return`<${a}> ${r}${s}`}const ru=t=>(...e)=>t(_r(...e)),cu=ru(t=>{throw new Error(t)}),mi=ru(console.warn),Ss=4,pr=3,dr=2,vr=1,hr=1;function br(t,e){const l=t.default?0:Wl(t.fullPath).reduce((n,i)=>{let s=n;return s+=Ss,ir(i)?s+=hr:sr(i)?s+=dr:iu(i)?s-=Ss+vr:s+=pr,s},0);return{route:t,score:l,index:e}}function gr(t){return t.map(br).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function mu(t,e){let l,n;const[i]=e.split("?"),s=Wl(i),a=s[0]==="",r=gr(t);for(let f=0,u=r.length;f({...m,params:d,uri:k});if(m.default){n=v(e);continue}const b=Wl(m.fullPath),h=Math.max(s.length,b.length);let C=0;for(;C{u===".."?f.pop():u!=="."&&f.push(u)}),hi(`/${f.join("/")}`,n)}function Ms(t,e){const{pathname:l,hash:n="",search:i="",state:s}=t,a=Wl(e,!0),r=Wl(l,!0);for(;a.length;)a[0]!==r[0]&&cu(tn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),a.shift(),r.shift();return{pathname:xn(...r),hash:n,search:i,state:s}}const Ns=t=>t.length===1?"":t,$i=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,s=i?Ns(zn(t,l)):"",a=i?zn(t,0,l):t,r=n?Ns(zn(a,e)):"";return{pathname:(n?zn(a,0,e):a)||"/",search:r,hash:s}},wr=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function Cr(t,e,l){return xn(l,kr(t,e))}function Sr(t,e){const l=Xi(or(t)),n=Wl(l,!0),i=Wl(e,!0).slice(0,n.length),s=_u({fullPath:l},xn(...i));return s&&s.uri}const bi="POP",Mr="PUSH",Nr="REPLACE";function gi(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function Tr(t){let e=[],l=gi(t),n=bi;const i=(s=e)=>s.forEach(a=>a({location:l,action:n}));return{get location(){return l},listen(s){e.push(s);const a=()=>{l=gi(t),n=bi,i([s])};i([s]);const r=xf(t,"popstate",a);return()=>{r(),e=e.filter(f=>f!==s)}},navigate(s,a){const{state:r={},replace:f=!1}=a||{};if(n=f?Nr:Mr,Jf(s))a&&mi(uu,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=bi,t.history.go(s);else{const u={...r,_key:er()};try{t.history[f?"replaceState":"pushState"](u,"",s)}catch{t.location[f?"replace":"assign"](s)}}l=gi(t),i()}}}function ki(t,e){return{...$i(e),state:t}}function Pr(t="/"){let e=0,l=[ki(null,t)];return{get entries(){return l},get location(){return l[e]},addEventListener(){},removeEventListener(){},history:{get state(){return l[e].state},pushState(n,i,s){e++,l=l.slice(0,e),l.push(ki(n,s))},replaceState(n,i,s){l[e]=ki(n,s)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const Er=!!(!Zl&&window.document&&window.document.createElement),Dr=!Zl&&window.location.origin==="null",pu=Tr(Er&&!Dr?window:Pr()),{navigate:Ql}=pu;let Gl=null,du=!0;function qr(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nGl.level||t.level===Gl.level&&qr(t.routerId,Gl.routerId))&&(Gl=t)}function Lr(){Gl=null}function Ir(){du=!1}function Ts(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=xf(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function Or(t,e){return Number(t.dataset.svnavRouteEnd)===e}function Rr(t){return/^H[1-6]$/i.test(t.tagName)}function Ps(t,e=document){return e.querySelector(t)}function Fr(t){let l=Ps(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!Or(l,t);){if(Rr(l))return l;const n=Ps("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function Br(t){Promise.resolve(cn(t.focusElement)).then(e=>{const l=e||Fr(t.id);l||mi(tn,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,di),!Ts(l)&&Ts(document.documentElement)})}const Ur=(t,e,l)=>(n,i)=>Xu().then(()=>{if(!Gl||du){Ir();return}if(n&&Br(Gl.route),t.announcements&&i){const{path:s,fullPath:a,meta:r,params:f,uri:u}=Gl.route,m=t.createAnnouncement({path:s,fullPath:a,meta:r,params:f,uri:u},cn(l));Promise.resolve(m).then(_=>{e.set(_)})}Lr()}),jr="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function yr(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},eu(t[6],jr)],i={};for(let s=0;s`Navigated to ${X.uri}`,announcements:!0,...b},k=m,T=Xi(m),q=Xl(Ti),O=Xl(_n),M=!q,U=zr(),I=v&&!(O&&!O.manageFocus),z=nl("");Hl(t,z,X=>l(0,r=X));const y=O?O.disableInlineStyles:h,V=nl([]);Hl(t,V,X=>l(20,a=X));const R=nl(null);Hl(t,R,X=>l(18,i=X));let F=!1;const Y=M?0:O.level+1,W=M?nl((()=>Ms(Zl?$i(_):d.location,T))()):q;Hl(t,W,X=>l(17,n=X));const K=nl(n);Hl(t,K,X=>l(19,s=X));const B=Ur(C,z,W),H=X=>$=>$.filter(ae=>ae.id!==X);function Z(X){if(Zl){if(F)return;const $=_u(X,n.pathname);if($)return F=!0,$}else V.update($=>{const ae=H(X.id)($);return ae.push(X),ae})}function ne(X){V.update(H(X))}return!M&&m!==Es&&mi(tn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:m}),M&&(Vf(()=>d.listen($=>{const ae=Ms($.location,T);K.set(n),W.set(ae)})),Yn(Ti,W)),Yn(_n,{activeRoute:R,registerRoute:Z,unregisterRoute:ne,manageFocus:I,level:Y,id:U,history:M?d:O.history,basepath:M?T:O.basepath,disableInlineStyles:y}),t.$$set=X=>{"basepath"in X&&l(11,m=X.basepath),"url"in X&&l(12,_=X.url),"history"in X&&l(13,d=X.history),"primary"in X&&l(14,v=X.primary),"a11y"in X&&l(15,b=X.a11y),"disableInlineStyles"in X&&l(16,h=X.disableInlineStyles),"$$scope"in X&&l(21,u=X.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&m!==k&&mi(tn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const X=mu(a,n.pathname);R.set(X)}if(t.$$.dirty[0]&655360&&M){const X=!!n.hash,$=!X&&I,ae=!X||n.pathname!==s.pathname;B($,ae)}t.$$.dirty[0]&262144&&I&&i&&i.primary&&Ar({level:Y,routerId:U,route:i})},[r,C,M,U,I,z,y,V,R,W,K,m,_,d,v,b,h,n,i,s,a,u,f]}class Gr extends It{constructor(e){super(),Lt(this,e,Wr,Hr,Dt,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const vu=Gr;function ei(t,e,l=_n,n=tn){Xl(l)||cu(t,s=>`You cannot use ${s} outside of a ${Ji(n)}.`,e)}const Vr=t=>{const{subscribe:e}=Xl(t);return{subscribe:e}};function hu(){return ei(ou),Vr(Ti)}function bu(){const{history:t}=Xl(_n);return t}function gu(){const t=Xl(lu);return t?tr(t,e=>e.base):nl("/")}function ku(){ei(fu);const t=gu(),{basepath:e}=Xl(_n);return n=>Cr(n,cn(t),e)}function Kr(){ei(au);const t=ku(),{navigate:e}=bu();return(n,i)=>{const s=Jf(n)?n:t(n);return e(s,i)}}const Yr=t=>({params:t&16,location:t&8}),Ds=t=>({params:Zl?cn(t[10]):t[4],location:t[3],navigate:t[11]});function qs(t){let e,l;return e=new vu({props:{primary:t[1],$$slots:{default:[Zr]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&2&&(s.primary=n[1]),i&528409&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function Qr(t){let e;const l=t[18].default,n=Gi(l,t,t[19],Ds);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&524312)&&Ki(n,l,i,i[19],e?Vi(l,i[19],s,Yr):Yi(i[19]),Ds)},i(i){e||(J(n,i),e=!0)},o(i){ie(n,i),e=!1},d(i){n&&n.d(i)}}}function Xr(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Zl?cn(t[10]):t[4],t[12]];var s=t[0];function a(r){let f={};for(let u=0;u{Ie(m,1)}),gt()}s?(e=gs(s,a()),Oe(e.$$.fragment),J(e.$$.fragment,1),Le(e,l.parentNode,l)):e=null}else s&&e.$set(u)},i(r){n||(e&&J(e.$$.fragment,r),n=!0)},o(r){e&&ie(e.$$.fragment,r),n=!1},d(r){r&&P(l),e&&Ie(e,r)}}}function Zr(t){let e,l,n,i;const s=[Xr,Qr],a=[];function r(f,u){return f[0]!==null?0:1}return e=r(t),l=a[e]=s[e](t),{c(){l.c(),n=$t()},m(f,u){a[e].m(f,u),E(f,n,u),i=!0},p(f,u){let m=e;e=r(f),e===m?a[e].p(f,u):(bt(),ie(a[m],1,1,()=>{a[m]=null}),gt(),l=a[e],l?l.p(f,u):(l=a[e]=s[e](f),l.c()),J(l,1),l.m(n.parentNode,n))},i(f){i||(J(l),i=!0)},o(f){ie(l),i=!1},d(f){a[e].d(f),f&&P(n)}}}function Jr(t){let e,l,n,i,s,a=[Ni(t[7]),{"data-svnav-route-start":t[5]}],r={};for(let _=0;_{f=null}),gt())},i(_){s||(J(f),s=!0)},o(_){ie(f),s=!1},d(_){_&&P(e),_&&P(l),f&&f.d(_),_&&P(n),_&&P(i)}}}const $r=$f();function xr(t,e,l){let n;const i=["path","component","meta","primary"];let s=ri(e,i),a,r,f,u,{$$slots:m={},$$scope:_}=e,{path:d=""}=e,{component:v=null}=e,{meta:b={}}=e,{primary:h=!0}=e;ei(di,e);const C=$r(),{registerRoute:k,unregisterRoute:T,activeRoute:q,disableInlineStyles:O}=Xl(_n);Hl(t,q,F=>l(16,a=F));const M=gu();Hl(t,M,F=>l(17,f=F));const U=hu();Hl(t,U,F=>l(3,r=F));const I=nl(null);let z;const y=nl(),V=nl({});Hl(t,V,F=>l(4,u=F)),Yn(lu,y),Yn(lr,V),Yn(nr,I);const R=Kr();return Zl||Yu(()=>T(C)),t.$$set=F=>{l(24,e=yl(yl({},e),ui(F))),l(12,s=ri(e,i)),"path"in F&&l(13,d=F.path),"component"in F&&l(0,v=F.component),"meta"in F&&l(14,b=F.meta),"primary"in F&&l(1,h=F.primary),"$$scope"in F&&l(19,_=F.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const F=d==="",Y=xn(f,d),j={id:C,path:d,meta:b,default:F,fullPath:F?"":Y,base:F?f:Sr(Y,r.pathname),primary:h,focusElement:I};y.set(j),l(15,z=k(j))}if(t.$$.dirty&98304&&l(2,n=!!(z||a&&a.id===C)),t.$$.dirty&98308&&n){const{params:F}=z||a;V.set(F)}},e=ui(e),[v,h,n,r,u,C,q,O,M,U,V,R,s,d,b,z,a,f,m,_]}class e1 extends It{constructor(e){super(),Lt(this,e,xr,Jr,Dt,{path:13,component:0,meta:14,primary:1})}}const Ll=e1;function t1(t){let e,l,n,i;const s=t[13].default,a=Gi(s,t,t[12],null);let r=[{href:t[0]},t[2],t[1]],f={};for(let u=0;ul(11,_=I));const q=Qu(),O=ku(),{navigate:M}=bu();function U(I){q("click",I),xu(I)&&(I.preventDefault(),M(n,{state:C,replace:a||h}))}return t.$$set=I=>{l(19,e=yl(yl({},e),ui(I))),l(18,m=ri(e,u)),"to"in I&&l(5,b=I.to),"replace"in I&&l(6,h=I.replace),"state"in I&&l(7,C=I.state),"getProps"in I&&l(8,k=I.getProps),"$$scope"in I&&l(12,v=I.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=O(b,_)),t.$$.dirty&2049&&l(10,i=Pi(_.pathname,n)),t.$$.dirty&2049&&l(9,s=n===_.pathname),t.$$.dirty&2049&&(a=$i(n)===wr(_)),t.$$.dirty&512&&l(2,r=s?{"aria-current":"page"}:{}),l(1,f=(()=>{if(Zf(k)){const I=k({location:_,href:n,isPartiallyCurrent:i,isCurrent:s});return{...m,...I}}return m})())},e=ui(e),[n,f,r,T,U,b,h,C,k,s,i,_,v,d]}class n1 extends It{constructor(e){super(),Lt(this,e,l1,t1,Dt,{to:5,replace:6,state:7,getProps:8})}}const Al=n1;function Yl(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function i1(t,e){return t>218&&t<242?"#23ac05":t>212&&t<248?"#b1d900":t>208&&t<252?"#a3b200":"#b20000"}function xi(t,e){let l;return t>90?l="#b20000":t>85?l="#b19601":t>80?l="#a3b200":t>75?l="#569f12":l="#23ac05",l}function Xn(t){return t>75?"#23ac05":t>50?"#77d900":t>25?"#94d900":"#569f12"}function _i(t){switch(t){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return"Unknown"}}function Tt(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function lt(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1";case 80:return"Generic ESP32-S3"}return"Unknown"}function rn(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Zt(t,e){return t==1||t==2&&e}function ql(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function Xt(t,e){return t==null||isNaN(t)?"-":(isNaN(e)&&(e=t<1?2:t<10?1:0),t.toFixed(e))}function zl(t,e){return t.setTime(t.getTime()+e*36e5),t}function s1(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function o1(t){return t=="EOE"?"https://transparency.entsoe.eu/":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}let ni=0;function Zn(t,e){var l="";ni++;var n=function(){setTimeout(Zn,1e3,t,e)};if(t.net.ip&&ni%3==0){if(!t.net.ip){n();return}l="http://"+t.net.ip}else t.hostname&&ni%3==1?l="http://"+t.hostname:t.hostname&&ni%3==2?l="http://"+t.hostname+".local":l="";console&&console.log("Trying url "+l),e&&e(l);var i=new XMLHttpRequest;i.timeout=5e3,i.addEventListener("abort",n),i.addEventListener("error",n),i.addEventListener("timeout",n),i.addEventListener("load",function(s){window.location.href=l||"/"}),i.open("GET",l+"/is-alive",!0),i.send()}function tl(t){return t.charAt(0).toUpperCase()+t.slice(1)}function As(t){return t.startsWith("esp32")?"esp32":t}function gl(t,e){let l=[t,e];return typeof t>"u"?(l[0]="-",l[1]=e):t>=1e9?(l[0]=(t/1e6).toFixed(t>1e10?0:1),l[1]="M"+e):t>1e4?(l[0]=(t/1e3).toFixed(t>1e6?0:t>1e5?1:2),l[1]="k"+e):(l[0]=t.toFixed(0),l[1]=e),l}let ai={},Ei=[];async function a1(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),s=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),s}let wi;async function wu(){if(Ei.length){let t=Ei.shift();delete ai[t.resource];try{let e=await a1(t.resource,t.options);for(let l in t.callbacks)t.callbacks[l](e.clone())}catch(e){console.error("Error calling "+t.resource,e);for(let l in t.callbacks)t.callbacks[l]()}}wi&&clearTimeout(wi),wi=setTimeout(wu,100)}wu();async function Il(t,e={}){let l;return ai[t]?l=ai[t]:(l={resource:t,options:e,callbacks:[]},ai[t]=l,Ei.push(l)),new Promise(i=>l.callbacks.push(i))}let jl={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null,if:{eth:!1}};async function es(){jl=await(await Il("sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),kl.set(jl)}const kl=nl(jl,t=>(es(),function(){}));function f1(t){kl.update(e=>(e.trying=t,e))}let ii=0,Ls=-127,Is=null,u1={};const r1=tu(u1,t=>{let e,l;async function n(){Il("data.json").then(i=>i.json()).then(i=>{t(i),Ls!=i.t&&(Ls=i.t,setTimeout(c1,2e3)),Is==null&&i.pe&&i.p!=null&&(Is=i.p,Su()),jl.upgrading?window.location.reload():(!jl||!jl.chip||jl.booting||ii>1&&!rn(jl.board))&&(es(),Vl&&clearTimeout(Vl),Vl=setTimeout(Ai,2e3),Kl&&clearTimeout(Kl),Kl=setTimeout(Ii,3e3)),Vl||(Vl=Ai()),Kl||(Kl=Ii());let s=5e3;if(rn(jl.board)&&i.v>2.5){let a=3.3-Math.min(3.3,i.v);a>0&&(s=Math.max(a,.1)*10*5e3)}s>5e3&&console.log("Next in "+s+"ms"),e&&clearTimeout(e),e=setTimeout(n,s),ii=0}).catch(i=>{ii++,ii>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(n,15e3),l||(l=setTimeout(Zn,5e3,jl,f1))):e=setTimeout(n,rn(jl.board)?1e4:5e3)})}return n(),function(){clearTimeout(e)}});let Di={},Wn;const ts=nl(Di);async function Cu(){let t=!1;if(ts.update(e=>{for(var l=0;l<36;l++){if(e[Tt(l)]==null){t=l<12;break}e[Tt(l)]=e[Tt(l+1)]}return e}),t)Su();else{let e=new Date;Wn=setTimeout(Cu,(60-e.getMinutes())*6e4)}}async function Su(){Wn&&(clearTimeout(Wn),Wn=0),Di=await(await Il("energyprice.json")).json(),ts.set(Di);let e=new Date;Wn=setTimeout(Cu,(60-e.getMinutes())*6e4)}let qi={},Vl;async function Ai(){Vl&&(clearTimeout(Vl),Vl=0),qi=await(await Il("dayplot.json")).json(),Mu.set(qi);let e=new Date;Vl=setTimeout(Ai,(60-e.getMinutes())*6e4+20)}const Mu=nl(qi,t=>function(){});let Li={},Kl;async function Ii(){Kl&&(clearTimeout(Kl),Kl=0),Li=await(await Il("monthplot.json")).json(),Nu.set(Li);let e=new Date;Kl=setTimeout(Ii,(24-e.getHours())*36e5+40)}const Nu=nl(Li,t=>function(){});let Oi={};async function c1(){Oi=await(await Il("temperature.json")).json(),Tu.set(Oi)}const Tu=nl(Oi,t=>function(){});let Ri={},si;async function Pu(){si&&(clearTimeout(si),si=0),Ri=await(await Il("tariff.json")).json(),Eu.set(Ri);let e=new Date;si=setTimeout(Pu,(60-e.getMinutes())*6e4+30)}const Eu=nl(Ri,t=>function(){});let Fi=[];const ls=nl(Fi);async function m1(){Fi=await(await Il("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),ls.set(Fi)}let Bi=!1;const Ol=nl(Bi);async function Du(t){Bi=await(await Il("translations.json"+(t?"?lang="+t:""))).json(),Ol.set(Bi)}Du();function pi(t){return"WARNING: "+t+" must be connected to an external power supply during firmware upgrade. Failure to do so may cause power-down during upload resulting in non-functioning unit."}async function qu(t){await(await fetch("upgrade?expected_version="+t,{method:"POST"})).json()}function Au(t,e){if(!(!e||e.message))if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(t)){let l=t.substring(1).split("."),n=parseInt(l[0]),i=parseInt(l[1]),s=parseInt(l[2]),a=[...e];a.reverse();let r,f,u;for(let m=0;ms&&(r=_):h==i+1&&(f=_);else if(b==n+1)if(u){let k=u.tag_name.substring(1).split(".");parseInt(k[0]);let T=parseInt(k[1]);parseInt(k[2]),h==T&&(u=_)}else u=_}return f||u||r||!1}else return e[0]}function Os(t){var f,u;let e=((u=(f=t[1].header)==null?void 0:f.uptime)!=null?u:"Up")+"",l,n,i;function s(m,_){return m[2]>1?g1:m[2]>0?b1:m[3]>1?h1:m[3]>0?v1:m[4]>1?d1:m[4]>0?p1:_1}let a=s(t),r=a(t);return{c(){l=S(e),n=g(),r.c(),i=$t()},m(m,_){E(m,l,_),E(m,n,_),r.m(m,_),E(m,i,_)},p(m,_){var d,v;_&2&&e!==(e=((v=(d=m[1].header)==null?void 0:d.uptime)!=null?v:"Up")+"")&&A(l,e),a===(a=s(m))&&r?r.p(m,_):(r.d(1),r=a(m),r&&(r.c(),r.m(i.parentNode,i)))},d(m){m&&P(l),m&&P(n),r.d(m),m&&P(i)}}}function _1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.seconds)!=null?a:"s")+"",i;return{c(){e=S(t[0]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&1&&A(e,r[0]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.seconds)!=null?m:"s")+"")&&A(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function p1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.minute)!=null?a:"m")+"",i;return{c(){e=S(t[4]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&16&&A(e,r[4]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.minute)!=null?m:"m")+"")&&A(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function d1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.minutes)!=null?a:"m")+"",i;return{c(){e=S(t[4]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&16&&A(e,r[4]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.minutes)!=null?m:"m")+"")&&A(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function v1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.hour)!=null?a:"h")+"",i;return{c(){e=S(t[3]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&8&&A(e,r[3]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.hour)!=null?m:"h")+"")&&A(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function h1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.hours)!=null?a:"h")+"",i;return{c(){e=S(t[3]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&8&&A(e,r[3]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.hours)!=null?m:"h")+"")&&A(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function b1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.day)!=null?a:"d")+"",i;return{c(){e=S(t[2]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&4&&A(e,r[2]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.day)!=null?m:"d")+"")&&A(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function g1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.days)!=null?a:"d")+"",i;return{c(){e=S(t[2]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&4&&A(e,r[2]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.days)!=null?m:"d")+"")&&A(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function k1(t){let e,l=t[0]&&Os(t);return{c(){l&&l.c(),e=$t()},m(n,i){l&&l.m(n,i),E(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Os(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Ze,o:Ze,d(n){l&&l.d(n),n&&P(e)}}}function w1(t,e,l){let{epoch:n}=e,i={};Ol.subscribe(f=>{l(1,i=f)});let s=0,a=0,r=0;return t.$$set=f=>{"epoch"in f&&l(0,n=f.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(2,s=Math.floor(n/86400)),l(3,a=Math.floor(n/3600)),l(4,r=Math.floor(n/60)))},[n,i,s,a,r]}class C1 extends It{constructor(e){super(),Lt(this,e,w1,k1,Dt,{epoch:0})}}function S1(t){let e,l,n;return{c(){e=p("span"),l=S(t[2]),c(e,"title",t[1]),c(e,"class",n="bd-"+t[0])},m(i,s){E(i,e,s),o(e,l)},p(i,[s]){s&4&&A(l,i[2]),s&2&&c(e,"title",i[1]),s&1&&n!==(n="bd-"+i[0])&&c(e,"class",n)},i:Ze,o:Ze,d(i){i&&P(e)}}}function M1(t,e,l){let{color:n}=e,{title:i}=e,{text:s}=e;return t.$$set=a=>{"color"in a&&l(0,n=a.color),"title"in a&&l(1,i=a.title),"text"in a&&l(2,s=a.text)},[n,i,s]}class xl extends It{constructor(e){super(),Lt(this,e,M1,S1,Dt,{color:0,title:1,text:2})}}function N1(t){let e,l=`${Tt(t[0].getDate())}.${Tt(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Tt(t[0].getHours())}:${Tt(t[0].getMinutes())}`,n;return{c(){e=p("span"),n=S(l),c(e,"class",t[1])},m(i,s){E(i,e,s),o(e,n)},p(i,s){s&1&&l!==(l=`${Tt(i[0].getDate())}.${Tt(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Tt(i[0].getHours())}:${Tt(i[0].getMinutes())}`)&&A(n,l),s&2&&c(e,"class",i[1])},d(i){i&&P(e)}}}function T1(t){var n;let e=`${Tt(t[0].getDate())}. ${t[2].months?(n=t[2].months)==null?void 0:n[t[0].getMonth()]:Tt(t[0].getMonth()+1)} ${Tt(t[0].getHours())}:${Tt(t[0].getMinutes())}`,l;return{c(){l=S(e)},m(i,s){E(i,l,s)},p(i,s){var a;s&5&&e!==(e=`${Tt(i[0].getDate())}. ${i[2].months?(a=i[2].months)==null?void 0:a[i[0].getMonth()]:Tt(i[0].getMonth()+1)} ${Tt(i[0].getHours())}:${Tt(i[0].getMinutes())}`)&&A(l,e)},d(i){i&&P(l)}}}function P1(t){let e;function l(s,a){return s[3]?T1:N1}let n=l(t),i=n(t);return{c(){i.c(),e=$t()},m(s,a){i.m(s,a),E(s,e,a)},p(s,[a]){n===(n=l(s))&&i?i.p(s,a):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},i:Ze,o:Ze,d(s){i.d(s),s&&P(e)}}}function E1(t,e,l){let n={};Ol.subscribe(f=>{l(2,n=f)});let{timestamp:i}=e,{fullTimeColor:s}=e,{offset:a}=e,r;return t.$$set=f=>{"timestamp"in f&&l(0,i=f.timestamp),"fullTimeColor"in f&&l(1,s=f.fullTimeColor),"offset"in f&&l(4,a=f.offset)},t.$$.update=()=>{t.$$.dirty&17&&(l(3,r=Math.abs(new Date().getTime()-i.getTime())<3e5),isNaN(a)||zl(i,a-(24+i.getHours()-i.getUTCHours())%24))},[i,s,n,r,a]}class Lu extends It{constructor(e){super(),Lt(this,e,E1,P1,Dt,{timestamp:0,fullTimeColor:1,offset:4})}}function D1(t){let e,l,n;return{c(){e=jt("svg"),l=jt("path"),n=jt("path"),c(l,"stroke-linecap","round"),c(l,"stroke-linejoin","round"),c(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),c(n,"stroke-linecap","round"),c(n,"stroke-linejoin","round"),c(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"fill","none"),c(e,"viewBox","0 0 24 24"),c(e,"stroke-width","1.5"),c(e,"stroke","currentColor"),c(e,"class","w-6 h-6")},m(i,s){E(i,e,s),o(e,l),o(e,n)},p:Ze,i:Ze,o:Ze,d(i){i&&P(e)}}}class q1 extends It{constructor(e){super(),Lt(this,e,null,D1,Dt,{})}}function A1(t){let e,l;return{c(){e=jt("svg"),l=jt("path"),c(l,"stroke-linecap","round"),c(l,"stroke-linejoin","round"),c(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"fill","none"),c(e,"viewBox","0 0 24 24"),c(e,"stroke-width","1.5"),c(e,"stroke","currentColor"),c(e,"class","w-6 h-6")},m(n,i){E(n,e,i),o(e,l)},p:Ze,i:Ze,o:Ze,d(n){n&&P(e)}}}class L1 extends It{constructor(e){super(),Lt(this,e,null,A1,Dt,{})}}function I1(t){let e,l;return{c(){e=jt("svg"),l=jt("path"),c(l,"stroke-linecap","round"),c(l,"stroke-linejoin","round"),c(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"fill","none"),c(e,"viewBox","0 0 24 24"),c(e,"stroke-width","1.5"),c(e,"stroke","currentColor"),c(e,"class","w-6 h-6")},m(n,i){E(n,e,i),o(e,l)},p:Ze,i:Ze,o:Ze,d(n){n&&P(e)}}}class O1 extends It{constructor(e){super(),Lt(this,e,null,I1,Dt,{})}}function R1(t){let e,l,n=t[2].version+"",i;return{c(){e=S("AMS reader "),l=p("span"),i=S(n)},m(s,a){E(s,e,a),E(s,l,a),o(l,i)},p(s,a){a&4&&n!==(n=s[2].version+"")&&A(i,n)},d(s){s&&P(e),s&&P(l)}}}function Rs(t){let e,l=(t[1].t>-50?t[1].t.toFixed(1):"-")+"",n,i;return{c(){e=p("div"),n=S(l),i=S("\xB0C"),c(e,"class","flex-none my-auto")},m(s,a){E(s,e,a),o(e,n),o(e,i)},p(s,a){a&2&&l!==(l=(s[1].t>-50?s[1].t.toFixed(1):"-")+"")&&A(n,l)},d(s){s&&P(e)}}}function Fs(t){var i,s,a,r,f;let e,l=((s=(i=t[4].header)==null?void 0:i.han)!=null?s:"HAN")+": "+((f=(r=(a=t[4].errors)==null?void 0:a.han)==null?void 0:r[t[1].he])!=null?f:t[1].he),n;return{c(){e=p("div"),n=S(l),c(e,"class","bd-red")},m(u,m){E(u,e,m),o(e,n)},p(u,m){var _,d,v,b,h;m&18&&l!==(l=((d=(_=u[4].header)==null?void 0:_.han)!=null?d:"HAN")+": "+((h=(b=(v=u[4].errors)==null?void 0:v.han)==null?void 0:b[u[1].he])!=null?h:u[1].he))&&A(n,l)},d(u){u&&P(e)}}}function Bs(t){var i,s,a,r,f;let e,l=((s=(i=t[4].header)==null?void 0:i.mqtt)!=null?s:"MQTT")+": "+((f=(r=(a=t[4].errors)==null?void 0:a.mqtt)==null?void 0:r[t[1].me])!=null?f:t[1].me),n;return{c(){e=p("div"),n=S(l),c(e,"class","bd-red")},m(u,m){E(u,e,m),o(e,n)},p(u,m){var _,d,v,b,h;m&18&&l!==(l=((d=(_=u[4].header)==null?void 0:_.mqtt)!=null?d:"MQTT")+": "+((h=(b=(v=u[4].errors)==null?void 0:v.mqtt)==null?void 0:b[u[1].me])!=null?h:u[1].me))&&A(n,l)},d(u){u&&P(e)}}}function Us(t){var i,s,a,r,f;let e,l=((s=(i=t[4].header)==null?void 0:i.price)!=null?s:"PS")+": "+((f=(r=(a=t[4].errors)==null?void 0:a.price)==null?void 0:r[t[1].ee])!=null?f:t[1].ee),n;return{c(){e=p("div"),n=S(l),c(e,"class","bd-red")},m(u,m){E(u,e,m),o(e,n)},p(u,m){var _,d,v,b,h;m&18&&l!==(l=((d=(_=u[4].header)==null?void 0:_.price)!=null?d:"PS")+": "+((h=(b=(v=u[4].errors)==null?void 0:v.price)==null?void 0:b[u[1].ee])!=null?h:u[1].ee))&&A(n,l)},d(u){u&&P(e)}}}function js(t){let e,l,n,i,s,a,r,f;return l=new Al({props:{to:"/configuration",$$slots:{default:[F1]},$$scope:{ctx:t}}}),a=new Al({props:{to:"/status",$$slots:{default:[B1]},$$scope:{ctx:t}}}),{c(){var u,m,_,d;e=p("div"),Oe(l.$$.fragment),i=g(),s=p("div"),Oe(a.$$.fragment),c(e,"class","flex-none px-1 mt-1"),c(e,"title",n=(m=(u=t[4].header)==null?void 0:u.config)!=null?m:""),c(s,"class","flex-none px-1 mt-1"),c(s,"title",r=(d=(_=t[4].header)==null?void 0:_.status)!=null?d:"")},m(u,m){E(u,e,m),Le(l,e,null),E(u,i,m),E(u,s,m),Le(a,s,null),f=!0},p(u,m){var v,b,h,C;const _={};m&64&&(_.$$scope={dirty:m,ctx:u}),l.$set(_),(!f||m&16&&n!==(n=(b=(v=u[4].header)==null?void 0:v.config)!=null?b:""))&&c(e,"title",n);const d={};m&64&&(d.$$scope={dirty:m,ctx:u}),a.$set(d),(!f||m&16&&r!==(r=(C=(h=u[4].header)==null?void 0:h.status)!=null?C:""))&&c(s,"title",r)},i(u){f||(J(l.$$.fragment,u),J(a.$$.fragment,u),f=!0)},o(u){ie(l.$$.fragment,u),ie(a.$$.fragment,u),f=!1},d(u){u&&P(e),Ie(l),u&&P(i),u&&P(s),Ie(a)}}}function F1(t){let e,l;return e=new q1({}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function B1(t){let e,l;return e=new L1({}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function ys(t){let e,l;function n(a,r){return a[2].security==0||a[1].a?j1:U1}let i=n(t),s=i(t);return{c(){var a,r;e=p("div"),s.c(),c(e,"class","flex-none mr-3 text-yellow-500"),c(e,"title",l=((r=(a=t[4].header)==null?void 0:a.new_version)!=null?r:"New version")+": "+t[3].tag_name)},m(a,r){E(a,e,r),s.m(e,null)},p(a,r){var f,u;i===(i=n(a))&&s?s.p(a,r):(s.d(1),s=i(a),s&&(s.c(),s.m(e,null))),r&24&&l!==(l=((u=(f=a[4].header)==null?void 0:f.new_version)!=null?u:"New version")+": "+a[3].tag_name)&&c(e,"title",l)},d(a){a&&P(e),s.d()}}}function U1(t){var r,f;let e,l=((f=(r=t[4].header)==null?void 0:r.new_version)!=null?f:"New version")+"",n,i,s=t[3].tag_name+"",a;return{c(){e=p("span"),n=S(l),i=S(": "),a=S(s)},m(u,m){E(u,e,m),o(e,n),o(e,i),o(e,a)},p(u,m){var _,d;m&16&&l!==(l=((d=(_=u[4].header)==null?void 0:_.new_version)!=null?d:"New version")+"")&&A(n,l),m&8&&s!==(s=u[3].tag_name+"")&&A(a,s)},d(u){u&&P(e)}}}function j1(t){var m,_;let e,l,n=((_=(m=t[4].header)==null?void 0:m.new_version)!=null?_:"New version")+"",i,s,a=t[3].tag_name+"",r,f,u;return{c(){e=p("button"),l=p("span"),i=S(n),s=S(": "),r=S(a),c(l,"class","mt-1"),c(e,"class","flex")},m(d,v){E(d,e,v),o(e,l),o(l,i),o(l,s),o(l,r),f||(u=me(e,"click",t[5]),f=!0)},p(d,v){var b,h;v&16&&n!==(n=((h=(b=d[4].header)==null?void 0:b.new_version)!=null?h:"New version")+"")&&A(i,n),v&8&&a!==(a=d[3].tag_name+"")&&A(r,a)},d(d){d&&P(e),f=!1,u()}}}function y1(t){var te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t,Ee;let e,l,n,i,s,a,r,f,u,m,_,d=((ee=(te=t[4].header)==null?void 0:te.mem)!=null?ee:"Free")+"",v,b,h=(t[1].m?(t[1].m/1e3).toFixed(1):"-")+"",C,k,T,q,O,M,U,I,z,y,V,R,F,Y,j,W,K,B,H,Z,ne,X,$,ae,le,se,fe,re,Q,x,ge;i=new Al({props:{to:"/",$$slots:{default:[R1]},$$scope:{ctx:t}}}),f=new C1({props:{epoch:t[1].u}});let pe=t[1].t>-50&&Rs(t);O=new xl({props:{title:(ce=(oe=t[4].header)==null?void 0:oe.esp)!=null?ce:"ESP",text:t[2].booting?(Ce=(Pe=t[4].header)==null?void 0:Pe.booting)!=null?Ce:"Booting":t[1].v>2?t[1].v.toFixed(2)+"V":(Ne=(de=t[4].header)==null?void 0:de.esp)!=null?Ne:"ESP",color:Yl(t[2].booting?2:t[1].em)}}),U=new xl({props:{title:(ve=(Te=t[4].header)==null?void 0:Te.han)!=null?ve:"HAN",text:(He=(be=t[4].header)==null?void 0:be.han)!=null?He:"HAN",color:Yl(t[2].booting?9:t[1].hm)}}),z=new xl({props:{title:(Ve=(ye=t[4].header)==null?void 0:ye.wifi)!=null?Ve:"WiFi",text:t[1].r?t[1].r.toFixed(0)+"dBm":(Je=(xe=t[4].header)==null?void 0:xe.wifi)!=null?Je:"WiFi",color:Yl(t[2].booting?9:t[1].wm)}}),V=new xl({props:{title:(We=(it=t[4].header)==null?void 0:it.mqtt)!=null?We:"MQTT",text:(Ee=(_t=t[4].header)==null?void 0:_t.mqtt)!=null?Ee:"MQTT",color:Yl(t[2].booting?9:t[1].mm)}});let N=(t[1].he<0||t[1].he>0)&&Fs(t),w=t[1].me<0&&Bs(t),D=(t[1].ee>0||t[1].ee<0)&&Us(t);$=new Lu({props:{timestamp:t[1].c?new Date(t[1].c*1e3):new Date(0),offset:t[2].clock_offset,fullTimeColor:"text-red-500"}});let L=t[2].vndcfg&&t[2].usrcfg&&js(t);re=new O1({});let G=t[2].fwconsent===1&&t[3]&&ys(t);return{c(){var _e,Ue;e=p("nav"),l=p("div"),n=p("div"),Oe(i.$$.fragment),s=g(),a=p("div"),r=p("div"),Oe(f.$$.fragment),u=g(),pe&&pe.c(),m=g(),_=p("div"),v=S(d),b=S(": "),C=S(h),k=S("kb"),T=g(),q=p("div"),Oe(O.$$.fragment),M=g(),Oe(U.$$.fragment),I=g(),Oe(z.$$.fragment),y=g(),Oe(V.$$.fragment),R=g(),N&&N.c(),F=g(),w&&w.c(),Y=g(),D&&D.c(),j=g(),W=p("div"),K=p("div"),B=p("a"),H=p("img"),ne=g(),X=p("div"),Oe($.$$.fragment),ae=g(),L&&L.c(),le=g(),se=p("div"),fe=p("a"),Oe(re.$$.fragment),x=g(),G&&G.c(),c(n,"class","flex text-lg text-gray-100 p-2"),c(r,"class","flex-none my-auto"),c(_,"class","flex-none my-auto"),c(a,"class","flex-none my-auto p-2 flex space-x-4"),c(q,"class","flex-auto flex-wrap my-auto justify-center p-2"),c(H,"class","logo"),fi(H.src,Z=(t[0]+"/logo.svg").replace("//","/"))||c(H,"src",Z),c(H,"alt","GitHub repo"),c(B,"class","float-right"),c(B,"href","https://github.com/UtilitechAS/amsreader-firmware"),c(B,"target","_blank"),c(B,"rel","noreferrer"),c(B,"aria-label","GitHub"),c(K,"class","flex-none"),c(X,"class","flex-none my-auto px-2"),c(fe,"href",ql("")),c(fe,"target","_blank"),c(fe,"rel","noreferrer"),c(se,"class","flex-none px-1 mt-1"),c(se,"title",Q=(Ue=(_e=t[4].header)==null?void 0:_e.doc)!=null?Ue:""),c(W,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),c(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),c(e,"class","hdr")},m(_e,Ue){E(_e,e,Ue),o(e,l),o(l,n),Le(i,n,null),o(l,s),o(l,a),o(a,r),Le(f,r,null),o(a,u),pe&&pe.m(a,null),o(a,m),o(a,_),o(_,v),o(_,b),o(_,C),o(_,k),o(l,T),o(l,q),Le(O,q,null),o(q,M),Le(U,q,null),o(q,I),Le(z,q,null),o(q,y),Le(V,q,null),o(l,R),N&&N.m(l,null),o(l,F),w&&w.m(l,null),o(l,Y),D&&D.m(l,null),o(l,j),o(l,W),o(W,K),o(K,B),o(B,H),o(W,ne),o(W,X),Le($,X,null),o(W,ae),L&&L.m(W,null),o(W,le),o(W,se),o(se,fe),Le(re,fe,null),o(W,x),G&&G.m(W,null),ge=!0},p(_e,[Ue]){var Xe,Qe,ut,we,Ae,ke,ue,De,rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt;const kt={};Ue&68&&(kt.$$scope={dirty:Ue,ctx:_e}),i.$set(kt);const wt={};Ue&2&&(wt.epoch=_e[1].u),f.$set(wt),_e[1].t>-50?pe?pe.p(_e,Ue):(pe=Rs(_e),pe.c(),pe.m(a,m)):pe&&(pe.d(1),pe=null),(!ge||Ue&16)&&d!==(d=((Qe=(Xe=_e[4].header)==null?void 0:Xe.mem)!=null?Qe:"Free")+"")&&A(v,d),(!ge||Ue&2)&&h!==(h=(_e[1].m?(_e[1].m/1e3).toFixed(1):"-")+"")&&A(C,h);const nt={};Ue&16&&(nt.title=(we=(ut=_e[4].header)==null?void 0:ut.esp)!=null?we:"ESP"),Ue&22&&(nt.text=_e[2].booting?(ke=(Ae=_e[4].header)==null?void 0:Ae.booting)!=null?ke:"Booting":_e[1].v>2?_e[1].v.toFixed(2)+"V":(De=(ue=_e[4].header)==null?void 0:ue.esp)!=null?De:"ESP"),Ue&6&&(nt.color=Yl(_e[2].booting?2:_e[1].em)),O.$set(nt);const vt={};Ue&16&&(vt.title=(st=(rt=_e[4].header)==null?void 0:rt.han)!=null?st:"HAN"),Ue&16&&(vt.text=(pt=(at=_e[4].header)==null?void 0:at.han)!=null?pt:"HAN"),Ue&6&&(vt.color=Yl(_e[2].booting?9:_e[1].hm)),U.$set(vt);const ze={};Ue&16&&(ze.title=(Rt=(ht=_e[4].header)==null?void 0:ht.wifi)!=null?Rt:"WiFi"),Ue&18&&(ze.text=_e[1].r?_e[1].r.toFixed(0)+"dBm":(ct=(Pt=_e[4].header)==null?void 0:Pt.wifi)!=null?ct:"WiFi"),Ue&6&&(ze.color=Yl(_e[2].booting?9:_e[1].wm)),z.$set(ze);const Ke={};Ue&16&&(Ke.title=(zt=(Ft=_e[4].header)==null?void 0:Ft.mqtt)!=null?zt:"MQTT"),Ue&16&&(Ke.text=(Ut=(Bt=_e[4].header)==null?void 0:Bt.mqtt)!=null?Ut:"MQTT"),Ue&6&&(Ke.color=Yl(_e[2].booting?9:_e[1].mm)),V.$set(Ke),_e[1].he<0||_e[1].he>0?N?N.p(_e,Ue):(N=Fs(_e),N.c(),N.m(l,F)):N&&(N.d(1),N=null),_e[1].me<0?w?w.p(_e,Ue):(w=Bs(_e),w.c(),w.m(l,Y)):w&&(w.d(1),w=null),_e[1].ee>0||_e[1].ee<0?D?D.p(_e,Ue):(D=Us(_e),D.c(),D.m(l,j)):D&&(D.d(1),D=null),(!ge||Ue&1&&!fi(H.src,Z=(_e[0]+"/logo.svg").replace("//","/")))&&c(H,"src",Z);const Ye={};Ue&2&&(Ye.timestamp=_e[1].c?new Date(_e[1].c*1e3):new Date(0)),Ue&4&&(Ye.offset=_e[2].clock_offset),$.$set(Ye),_e[2].vndcfg&&_e[2].usrcfg?L?(L.p(_e,Ue),Ue&4&&J(L,1)):(L=js(_e),L.c(),J(L,1),L.m(W,le)):L&&(bt(),ie(L,1,1,()=>{L=null}),gt()),(!ge||Ue&16&&Q!==(Q=(yt=(qt=_e[4].header)==null?void 0:qt.doc)!=null?yt:""))&&c(se,"title",Q),_e[2].fwconsent===1&&_e[3]?G?G.p(_e,Ue):(G=ys(_e),G.c(),G.m(W,null)):G&&(G.d(1),G=null)},i(_e){ge||(J(i.$$.fragment,_e),J(f.$$.fragment,_e),J(O.$$.fragment,_e),J(U.$$.fragment,_e),J(z.$$.fragment,_e),J(V.$$.fragment,_e),J($.$$.fragment,_e),J(L),J(re.$$.fragment,_e),ge=!0)},o(_e){ie(i.$$.fragment,_e),ie(f.$$.fragment,_e),ie(O.$$.fragment,_e),ie(U.$$.fragment,_e),ie(z.$$.fragment,_e),ie(V.$$.fragment,_e),ie($.$$.fragment,_e),ie(L),ie(re.$$.fragment,_e),ge=!1},d(_e){_e&&P(e),Ie(i),Ie(f),pe&&pe.d(),Ie(O),Ie(U),Ie(z),Ie(V),N&&N.d(),w&&w.d(),D&&D.d(),Ie($),L&&L.d(),Ie(re),G&&G.d()}}}function H1(t,e,l){let{basepath:n="/"}=e,{data:i={}}=e,s={},a={};function r(){var u,m;confirm(((m=(u=f.header)==null?void 0:u.upgrade)!=null?m:"Upgrade to {0}?").replace("{0}",a.tag_name))&&(!rn(s.board)||confirm(pi(lt(s.chip,s.board))))&&(kl.update(_=>(_.upgrading=!0,_)),qu(a.tag_name))}kl.subscribe(u=>{l(2,s=u),u.fwconsent===1&&m1()}),ls.subscribe(u=>{l(3,a=Au(s.version,u))});let f={};return Ol.subscribe(u=>{l(4,f=u)}),t.$$set=u=>{"basepath"in u&&l(0,n=u.basepath),"data"in u&&l(1,i=u.data)},[n,i,s,a,f,r]}class z1 extends It{constructor(e){super(),Lt(this,e,H1,y1,Dt,{basepath:0,data:1})}}function W1(t){let e,l,n,i;return{c(){e=jt("svg"),l=jt("path"),n=jt("path"),c(l,"d",Ci(150,150,115,210,510)),c(l,"stroke","rgba(128, 128, 128, 0.15)"),c(l,"fill","none"),c(l,"stroke-width","55"),c(n,"d",i=Ci(150,150,115,210,210+300*t[0]/100)),c(n,"stroke",t[1]),c(n,"fill","none"),c(n,"stroke-width","55"),c(e,"viewBox","0 0 300 300"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"height","100%")},m(s,a){E(s,e,a),o(e,l),o(e,n)},p(s,[a]){a&1&&i!==(i=Ci(150,150,115,210,210+300*s[0]/100))&&c(n,"d",i),a&2&&c(n,"stroke",s[1])},i:Ze,o:Ze,d(s){s&&P(e)}}}function Hs(t,e,l,n){var i=(n-90)*Math.PI/180;return{x:t+l*Math.cos(i),y:e+l*Math.sin(i)}}function Ci(t,e,l,n,i){var s=Hs(t,e,l,i),a=Hs(t,e,l,n),r=i-n<=180?"0":"1",f=["M",s.x,s.y,"A",l,l,0,r,0,a.x,a.y].join(" ");return f}function G1(t,e,l){let{pct:n=0}=e,{color:i="red"}=e;return t.$$set=s=>{"pct"in s&&l(0,n=s.pct),"color"in s&&l(1,i=s.color)},[n,i]}class V1 extends It{constructor(e){super(),Lt(this,e,G1,W1,Dt,{pct:0,color:1})}}function zs(t){let e,l,n,i,s,a,r,f;return{c(){e=p("br"),l=g(),n=p("span"),i=S(t[1]),s=g(),a=p("span"),r=S(t[2]),f=S("/kWh"),c(n,"class","pl-sub"),c(a,"class","pl-snt")},m(u,m){E(u,e,m),E(u,l,m),E(u,n,m),o(n,i),E(u,s,m),E(u,a,m),o(a,r),o(a,f)},p(u,m){m&2&&A(i,u[1]),m&4&&A(r,u[2])},d(u){u&&P(e),u&&P(l),u&&P(n),u&&P(s),u&&P(a)}}}function K1(t){let e,l,n,i,s,a,r,f,u,m,_=t[4][0]+"",d,v,b,h=t[4][1]+"",C,k,T;l=new V1({props:{pct:t[5],color:t[3](t[5],document.documentElement.classList.contains("dark"))}});let q=t[1]&&zs(t);return{c(){e=p("div"),Oe(l.$$.fragment),n=g(),i=p("span"),s=p("span"),a=S(t[0]),r=g(),f=p("br"),u=g(),m=p("span"),d=S(_),v=g(),b=p("span"),C=S(h),k=g(),q&&q.c(),c(s,"class","pl-lab"),c(m,"class","pl-val"),c(b,"class","pl-unt"),c(i,"class","pl-ov"),c(e,"class","pl-root")},m(O,M){E(O,e,M),Le(l,e,null),o(e,n),o(e,i),o(i,s),o(s,a),o(i,r),o(i,f),o(i,u),o(i,m),o(m,d),o(i,v),o(i,b),o(b,C),o(i,k),q&&q.m(i,null),T=!0},p(O,[M]){const U={};M&32&&(U.pct=O[5]),M&40&&(U.color=O[3](O[5],document.documentElement.classList.contains("dark"))),l.$set(U),(!T||M&1)&&A(a,O[0]),(!T||M&16)&&_!==(_=O[4][0]+"")&&A(d,_),(!T||M&16)&&h!==(h=O[4][1]+"")&&A(C,h),O[1]?q?q.p(O,M):(q=zs(O),q.c(),q.m(i,null)):q&&(q.d(1),q=null)},i(O){T||(J(l.$$.fragment,O),T=!0)},o(O){ie(l.$$.fragment,O),T=!1},d(O){O&&P(e),Ie(l),q&&q.d()}}}function Y1(t,e,l){let{val:n}=e,{max:i}=e,{unit:s}=e,{label:a}=e,{sub:r=""}=e,{subunit:f=""}=e,{colorFn:u}=e,m,_=0;return t.$$set=d=>{"val"in d&&l(6,n=d.val),"max"in d&&l(7,i=d.max),"unit"in d&&l(8,s=d.unit),"label"in d&&l(0,a=d.label),"sub"in d&&l(1,r=d.sub),"subunit"in d&&l(2,f=d.subunit),"colorFn"in d&&l(3,u=d.colorFn)},t.$$.update=()=>{t.$$.dirty&448&&(l(4,m=gl(n,s)),l(5,_=Math.min(n,i)/i*100))},[a,r,f,u,m,_,n,i,s]}class Iu extends It{constructor(e){super(),Lt(this,e,Y1,K1,Dt,{val:6,max:7,unit:8,label:0,sub:1,subunit:2,colorFn:3})}}function Ws(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Gs(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Vs(t,e,l){const n=t.slice();return n[15]=e[l],n}function Ks(t){let e,l,n,i,s,a,r,f=(t[0].title||t[0].link)&&Ys(t),u=t[0].y.ticks,m=[];for(let h=0;h{f=null}),gt()),C&129){u=h[0].y.ticks;let k;for(k=0;k{s=null}),gt())},i(a){n||(J(s),n=!0)},o(a){ie(s),n=!1},d(a){a&&P(e),i&&i.d(),s&&s.d()}}}function Qs(t){let e,l=t[0].title+"",n,i;return{c(){e=p("div"),n=S(l),c(e,"class","text-sm font-bold"),Wt(()=>t[9].call(e))},m(s,a){E(s,e,a),o(e,n),i=Qi(e,t[9].bind(e))},p(s,a){a&1&&l!==(l=s[0].title+"")&&A(n,l)},d(s){s&&P(e),i()}}}function Xs(t){let e,l,n,i;const s=[X1,Q1],a=[];function r(f,u){return f[0].link.route?0:1}return l=r(t),n=a[l]=s[l](t),{c(){e=p("div"),n.c(),c(e,"class","text-xs text-right")},m(f,u){E(f,e,u),a[l].m(e,null),i=!0},p(f,u){let m=l;l=r(f),l===m?a[l].p(f,u):(bt(),ie(a[m],1,1,()=>{a[m]=null}),gt(),n=a[l],n?n.p(f,u):(n=a[l]=s[l](f),n.c()),J(n,1),n.m(e,null))},i(f){i||(J(n),i=!0)},o(f){ie(n),i=!1},d(f){f&&P(e),a[l].d()}}}function Q1(t){let e,l=t[0].link.text+"",n,i,s;return{c(){e=p("a"),n=S(l),c(e,"href",i=t[0].link.url),c(e,"target",s=t[0].link.target)},m(a,r){E(a,e,r),o(e,n)},p(a,r){r&1&&l!==(l=a[0].link.text+"")&&A(n,l),r&1&&i!==(i=a[0].link.url)&&c(e,"href",i),r&1&&s!==(s=a[0].link.target)&&c(e,"target",s)},i:Ze,o:Ze,d(a){a&&P(e)}}}function X1(t){let e,l;return e=new Al({props:{to:t[0].link.url,$$slots:{default:[Z1]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.to=n[0].link.url),i&262145&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function Z1(t){let e=t[0].link.text+"",l;return{c(){l=S(e)},m(n,i){E(n,l,i)},p(n,i){i&1&&e!==(e=n[0].link.text+"")&&A(l,e)},d(n){n&&P(l)}}}function Zs(t){let e,l,n,i=t[15].label+"",s,a,r,f;return{c(){e=jt("g"),l=jt("line"),n=jt("text"),s=S(i),c(l,"x2","100%"),c(n,"y","-4"),c(n,"x",a=t[15].align=="right"?"85%":""),c(e,"class",r="tick tick-"+t[15].value+" tick-"+t[15].color),c(e,"transform",f="translate(0, "+t[7](t[15].value)+")")},m(u,m){E(u,e,m),o(e,l),o(e,n),o(n,s)},p(u,m){m&1&&i!==(i=u[15].label+"")&&A(s,i),m&1&&a!==(a=u[15].align=="right"?"85%":"")&&c(n,"x",a),m&1&&r!==(r="tick tick-"+u[15].value+" tick-"+u[15].color)&&c(e,"class",r),m&129&&f!==(f="translate(0, "+u[7](u[15].value)+")")&&c(e,"transform",f)},d(u){u&&P(e)}}}function Js(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Zs(t);return{c(){n&&n.c(),l=$t()},m(i,s){n&&n.m(i,s),E(i,l,s)},p(i,s){s&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,s):(n=Zs(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&P(l)}}}function $s(t){let e,l,n=(t[3]>20||t[13]%2==0)&&xs(t);return{c(){e=jt("g"),n&&n.c(),c(e,"class","tick"),c(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,s){E(i,e,s),n&&n.m(e,null)},p(i,s){i[3]>20||i[13]%2==0?n?n.p(i,s):(n=xs(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),s&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&c(e,"transform",l)},d(i){i&&P(e),n&&n.d()}}}function xs(t){let e,l=t[11].label+"",n,i;return{c(){e=jt("text"),n=S(l),c(e,"x",i=t[3]/2),c(e,"y","-4")},m(s,a){E(s,e,a),o(e,n)},p(s,a){a&1&&l!==(l=s[11].label+"")&&A(n,l),a&8&&i!==(i=s[3]/2)&&c(e,"x",i)},d(s){s&&P(e)}}}function eo(t){let e=!isNaN(t[6](t[13])),l,n=e&&$s(t);return{c(){n&&n.c(),l=$t()},m(i,s){n&&n.m(i,s),E(i,l,s)},p(i,s){s&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,s):(n=$s(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&P(l)}}}function to(t){let e,l,n=t[11].value!==void 0&&lo(t),i=t[11].value2>1e-4&&so(t);return{c(){e=jt("g"),n&&n.c(),l=jt("g"),i&&i.c()},m(s,a){E(s,e,a),n&&n.m(e,null),E(s,l,a),i&&i.m(l,null)},p(s,a){s[11].value!==void 0?n?n.p(s,a):(n=lo(s),n.c(),n.m(e,null)):n&&(n.d(1),n=null),s[11].value2>1e-4?i?i.p(s,a):(i=so(s),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(s){s&&P(e),n&&n.d(),s&&P(l),i&&i.d()}}}function lo(t){let e,l,n,i,s,a,r,f=t[3]>15&&no(t);return{c(){e=jt("rect"),f&&f.c(),r=$t(),c(e,"x",l=t[6](t[13])+2),c(e,"y",n=t[7](t[11].value)),c(e,"width",i=t[3]-4),c(e,"height",s=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),c(e,"fill",a=t[11].color)},m(u,m){E(u,e,m),f&&f.m(u,m),E(u,r,m)},p(u,m){m&64&&l!==(l=u[6](u[13])+2)&&c(e,"x",l),m&129&&n!==(n=u[7](u[11].value))&&c(e,"y",n),m&8&&i!==(i=u[3]-4)&&c(e,"width",i),m&129&&s!==(s=u[7](u[0].y.min)-u[7](Math.min(u[0].y.min,0)+u[11].value))&&c(e,"height",s),m&1&&a!==(a=u[11].color)&&c(e,"fill",a),u[3]>15?f?f.p(u,m):(f=no(u),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(u){u&&P(e),f&&f.d(u),u&&P(r)}}}function no(t){let e,l=t[11].label+"",n,i,s,a,r,f,u=t[11].title&&io(t);return{c(){e=jt("text"),n=S(l),u&&u.c(),f=$t(),c(e,"width",i=t[3]-4),c(e,"dominant-baseline","middle"),c(e,"text-anchor",s=t[3]t[7](0)-t[8]&&!t[0].dark?t[11].color:"white"),c(e,"transform",r="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[11].labelAngle?t[11].labelAngle:t[3]m[7](0)-m[8]&&!m[0].dark?m[11].color:"white")&&c(e,"fill",a),_&457&&r!==(r="translate("+(m[6](m[13])+m[3]/2)+" "+(m[7](m[11].value)>m[7](0)-m[8]?m[7](m[11].value)-m[8]:m[7](m[11].value)+10)+") rotate("+(m[11].labelAngle?m[11].labelAngle:m[3]15&&oo(t);return{c(){e=jt("rect"),f&&f.c(),r=$t(),c(e,"x",l=t[6](t[13])+2),c(e,"y",n=t[7](0)),c(e,"width",i=t[3]-4),c(e,"height",s=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),c(e,"fill",a=t[11].color2?t[11].color2:t[11].color)},m(u,m){E(u,e,m),f&&f.m(u,m),E(u,r,m)},p(u,m){m&64&&l!==(l=u[6](u[13])+2)&&c(e,"x",l),m&128&&n!==(n=u[7](0))&&c(e,"y",n),m&8&&i!==(i=u[3]-4)&&c(e,"width",i),m&129&&s!==(s=u[7](u[0].y.min)-u[7](u[0].y.min+u[11].value2))&&c(e,"height",s),m&1&&a!==(a=u[11].color2?u[11].color2:u[11].color)&&c(e,"fill",a),u[3]>15?f?f.p(u,m):(f=oo(u),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(u){u&&P(e),f&&f.d(u),u&&P(r)}}}function oo(t){let e,l=t[11].label2+"",n,i,s,a,r,f=t[11].title2&&ao(t);return{c(){e=jt("text"),n=S(l),f&&f.c(),r=$t(),c(e,"width",i=t[3]-4),c(e,"dominant-baseline","middle"),c(e,"text-anchor","middle"),c(e,"fill",s=t[7](-t[11].value2)t[10].call(e))},m(s,a){E(s,e,a),i&&i.m(e,null),l=Qi(e,t[10].bind(e)),n=!0},p(s,[a]){s[0].x.ticks&&s[0].points&&s[4]?i?(i.p(s,a),a&17&&J(i,1)):(i=Ks(s),i.c(),J(i,1),i.m(e,null)):i&&(bt(),ie(i,1,1,()=>{i=null}),gt())},i(s){n||(J(i),n=!0)},o(s){ie(i),n=!1},d(s){s&&P(e),i&&i.d(),l()}}}let en=30;function $1(t,e,l){let{config:n}=e,i,s,a,r,f,u,m,_=0;function d(){_=this.clientHeight,l(5,_)}function v(){i=this.clientWidth,s=this.clientHeight,l(1,i),l(2,s)}return t.$$set=b=>{"config"in b&&l(0,n=b.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,u=s-_);let b=i-(n.padding.left+n.padding.right);l(3,a=b/n.points.length),l(8,m=an.y.max?k=n.padding.bottom:Cu||k<0?0:k})}},[n,i,s,a,u,_,r,f,m,d,v]}class nn extends It{constructor(e){super(),Lt(this,e,$1,J1,Dt,{config:0})}}function x1(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function e0(t,e,l){let{title:n}=e,{u1:i}=e,{u2:s}=e,{u3:a}=e,{ds:r}=e,f={};function u(m){return{label:Xt(m)+"V",title:m.toFixed(1)+" V",value:isNaN(m)?0:m,color:i1(m||0,document.documentElement.classList.contains("dark"))}}return t.$$set=m=>{"title"in m&&l(1,n=m.title),"u1"in m&&l(2,i=m.u1),"u2"in m&&l(3,s=m.u2),"u3"in m&&l(4,a=m.u3),"ds"in m&&l(5,r=m.ds)},t.$$.update=()=>{if(t.$$.dirty&62){let m=[],_=[];i>0&&(m.push({label:r===1?"L1-L2":"L1"}),_.push(u(i))),s>0&&(m.push({label:r===1?"L1-L3":"L2"}),_.push(u(s))),a>0&&(m.push({label:r===1?"L2-L3":"L3"}),_.push(u(a))),l(0,f={title:n,padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:m},points:_})}},[f,n,i,s,a,r]}class t0 extends It{constructor(e){super(),Lt(this,e,e0,x1,Dt,{title:1,u1:2,u2:3,u3:4,ds:5})}}function l0(t){var L,G,te,ee,oe,ce,Pe,Ce,de,Ne;let e,l,n=((G=(L=t[0].reactive)==null?void 0:L.title)!=null?G:"Reactive")+"",i,s,a,r,f=((ee=(te=t[0].reactive)==null?void 0:te.instant_in)!=null?ee:"Instant in")+"",u,m,_,d=t[1][0]+"",v,b,h=t[1][1]+"",C,k,T,q=((ce=(oe=t[0].reactive)==null?void 0:oe.instant_out)!=null?ce:"Instant out")+"",O,M,U,I=t[2][0]+"",z,y,V=t[2][1]+"",R,F,Y,j,W=((Ce=(Pe=t[0].reactive)==null?void 0:Pe.total_in)!=null?Ce:"Total in")+"",K,B,H,Z=t[3][0]+"",ne,X,$=t[3][1]+"",ae,le,se,fe=((Ne=(de=t[0].reactive)==null?void 0:de.total_out)!=null?Ne:"Total out")+"",re,Q,x,ge=t[4][0]+"",pe,N,w=t[4][1]+"",D;return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("div"),r=p("div"),u=S(f),m=g(),_=p("div"),v=S(d),b=g(),C=S(h),k=g(),T=p("div"),O=S(q),M=g(),U=p("div"),z=S(I),y=g(),R=S(V),F=g(),Y=p("div"),j=p("div"),K=S(W),B=g(),H=p("div"),ne=S(Z),X=g(),ae=S($),le=g(),se=p("div"),re=S(fe),Q=g(),x=p("div"),pe=S(ge),N=g(),D=S(w),c(_,"class","text-right"),c(U,"class","text-right"),c(a,"class","grid grid-cols-2 mt-4"),c(H,"class","text-right"),c(x,"class","text-right"),c(Y,"class","grid grid-cols-2 mt-4"),c(e,"class","mx-2 text-sm")},m(Te,ve){E(Te,e,ve),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(r,u),o(a,m),o(a,_),o(_,v),o(_,b),o(_,C),o(a,k),o(a,T),o(T,O),o(a,M),o(a,U),o(U,z),o(U,y),o(U,R),o(e,F),o(e,Y),o(Y,j),o(j,K),o(Y,B),o(Y,H),o(H,ne),o(H,X),o(H,ae),o(Y,le),o(Y,se),o(se,re),o(Y,Q),o(Y,x),o(x,pe),o(x,N),o(x,D)},p(Te,[ve]){var be,He,ye,Ve,xe,Je,it,We,_t,Ee;ve&1&&n!==(n=((He=(be=Te[0].reactive)==null?void 0:be.title)!=null?He:"Reactive")+"")&&A(i,n),ve&1&&f!==(f=((Ve=(ye=Te[0].reactive)==null?void 0:ye.instant_in)!=null?Ve:"Instant in")+"")&&A(u,f),ve&2&&d!==(d=Te[1][0]+"")&&A(v,d),ve&2&&h!==(h=Te[1][1]+"")&&A(C,h),ve&1&&q!==(q=((Je=(xe=Te[0].reactive)==null?void 0:xe.instant_out)!=null?Je:"Instant out")+"")&&A(O,q),ve&4&&I!==(I=Te[2][0]+"")&&A(z,I),ve&4&&V!==(V=Te[2][1]+"")&&A(R,V),ve&1&&W!==(W=((We=(it=Te[0].reactive)==null?void 0:it.total_in)!=null?We:"Total in")+"")&&A(K,W),ve&8&&Z!==(Z=Te[3][0]+"")&&A(ne,Z),ve&8&&$!==($=Te[3][1]+"")&&A(ae,$),ve&1&&fe!==(fe=((Ee=(_t=Te[0].reactive)==null?void 0:_t.total_out)!=null?Ee:"Total out")+"")&&A(re,fe),ve&16&&ge!==(ge=Te[4][0]+"")&&A(pe,ge),ve&16&&w!==(w=Te[4][1]+"")&&A(D,w)},i:Ze,o:Ze,d(Te){Te&&P(e)}}}function n0(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:s}=e,{exportTotal:a}=e,{translations:r={}}=e,f,u,m,_;return t.$$set=d=>{"importInstant"in d&&l(5,n=d.importInstant),"exportInstant"in d&&l(6,i=d.exportInstant),"importTotal"in d&&l(7,s=d.importTotal),"exportTotal"in d&&l(8,a=d.exportTotal),"translations"in d&&l(0,r=d.translations)},t.$$.update=()=>{t.$$.dirty&480&&(l(1,f=gl(n,"VAr")),l(2,u=gl(i,"VAr")),l(3,m=gl(s*1e3,"VArh")),l(4,_=gl(a*1e3,"VArh")))},[r,f,u,m,_,n,i,s,a]}class i0 extends It{constructor(e){super(),Lt(this,e,n0,l0,Dt,{importInstant:5,exportInstant:6,importTotal:7,exportTotal:8,translations:0})}}function uo(t){let e;function l(s,a){return s[3]?o0:s0}let n=l(t),i=n(t);return{c(){i.c(),e=$t()},m(s,a){i.m(s,a),E(s,e,a)},p(s,a){n===(n=l(s))&&i?i.p(s,a):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},d(s){i.d(s),s&&P(e)}}}function s0(t){var G,te,ee,oe,ce,Pe,Ce,de,Ne,Te;let e,l=((te=(G=t[4].realtime)==null?void 0:G.consumption)!=null?te:"Consumption")+"",n,i,s,a,r=tl((oe=(ee=t[4].common)==null?void 0:ee.hour)!=null?oe:"Hour")+"",f,u,m,_=t[6][0]+"",d,v,b=t[6][1]+"",h,C,k,T=tl((Pe=(ce=t[4].common)==null?void 0:ce.day)!=null?Pe:"Day")+"",q,O,M,U=t[7][0]+"",I,z,y=t[7][1]+"",V,R,F,Y=tl((de=(Ce=t[4].common)==null?void 0:Ce.month)!=null?de:"Month")+"",j,W,K,B=t[8][0]+"",H,Z,ne=t[8][1]+"",X,$,ae,le=((Te=(Ne=t[4].realtime)==null?void 0:Ne.last_month)!=null?Te:"Last month")+"",se,fe,re,Q=t[9][0]+"",x,ge,pe=t[9][1]+"",N,w,D,L=t[5]&&ro(t);return{c(){e=p("strong"),n=S(l),i=g(),s=p("div"),a=p("div"),f=S(r),u=g(),m=p("div"),d=S(_),v=g(),h=S(b),C=g(),k=p("div"),q=S(T),O=g(),M=p("div"),I=S(U),z=g(),V=S(y),R=g(),F=p("div"),j=S(Y),W=g(),K=p("div"),H=S(B),Z=g(),X=S(ne),$=g(),ae=p("div"),se=S(le),fe=g(),re=p("div"),x=S(Q),ge=g(),N=S(pe),w=g(),L&&L.c(),D=$t(),c(m,"class","text-right"),c(M,"class","text-right"),c(K,"class","text-right"),c(re,"class","text-right"),c(s,"class","grid grid-cols-2 mb-3")},m(ve,be){E(ve,e,be),o(e,n),E(ve,i,be),E(ve,s,be),o(s,a),o(a,f),o(s,u),o(s,m),o(m,d),o(m,v),o(m,h),o(s,C),o(s,k),o(k,q),o(s,O),o(s,M),o(M,I),o(M,z),o(M,V),o(s,R),o(s,F),o(F,j),o(s,W),o(s,K),o(K,H),o(K,Z),o(K,X),o(s,$),o(s,ae),o(ae,se),o(s,fe),o(s,re),o(re,x),o(re,ge),o(re,N),E(ve,w,be),L&&L.m(ve,be),E(ve,D,be)},p(ve,be){var He,ye,Ve,xe,Je,it,We,_t,Ee,_e;be&16&&l!==(l=((ye=(He=ve[4].realtime)==null?void 0:He.consumption)!=null?ye:"Consumption")+"")&&A(n,l),be&16&&r!==(r=tl((xe=(Ve=ve[4].common)==null?void 0:Ve.hour)!=null?xe:"Hour")+"")&&A(f,r),be&64&&_!==(_=ve[6][0]+"")&&A(d,_),be&64&&b!==(b=ve[6][1]+"")&&A(h,b),be&16&&T!==(T=tl((it=(Je=ve[4].common)==null?void 0:Je.day)!=null?it:"Day")+"")&&A(q,T),be&128&&U!==(U=ve[7][0]+"")&&A(I,U),be&128&&y!==(y=ve[7][1]+"")&&A(V,y),be&16&&Y!==(Y=tl((_t=(We=ve[4].common)==null?void 0:We.month)!=null?_t:"Month")+"")&&A(j,Y),be&256&&B!==(B=ve[8][0]+"")&&A(H,B),be&256&&ne!==(ne=ve[8][1]+"")&&A(X,ne),be&16&&le!==(le=((_e=(Ee=ve[4].realtime)==null?void 0:Ee.last_month)!=null?_e:"Last month")+"")&&A(se,le),be&512&&Q!==(Q=ve[9][0]+"")&&A(x,Q),be&512&&pe!==(pe=ve[9][1]+"")&&A(N,pe),ve[5]?L?L.p(ve,be):(L=ro(ve),L.c(),L.m(D.parentNode,D)):L&&(L.d(1),L=null)},d(ve){ve&&P(e),ve&&P(i),ve&&P(s),ve&&P(w),L&&L.d(ve),ve&&P(D)}}}function o0(t){var qe,Ge,Qt,el,xt,Se,Re,Fe,il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl;let e,l=((Ge=(qe=t[4].common)==null?void 0:qe.import)!=null?Ge:"Import")+"",n,i,s,a,r=tl((el=(Qt=t[4].common)==null?void 0:Qt.hour)!=null?el:"Hour")+"",f,u,m,_=t[6][0]+"",d,v,b=t[6][1]+"",h,C,k,T,q=tl((Se=(xt=t[4].common)==null?void 0:xt.day)!=null?Se:"Day")+"",O,M,U,I=t[7][0]+"",z,y,V=t[7][1]+"",R,F,Y,j,W=tl((Fe=(Re=t[4].common)==null?void 0:Re.month)!=null?Fe:"Month")+"",K,B,H,Z=t[8][0]+"",ne,X,$=t[8][1]+"",ae,le,se,fe,re=((sl=(il=t[4].realtime)==null?void 0:il.last_mo)!=null?sl:"Last mo.")+"",Q,x,ge,pe=t[9][0]+"",N,w,D=t[9][1]+"",L,G,te,ee,oe,ce=((al=(ol=t[4].common)==null?void 0:ol.export)!=null?al:"Export")+"",Pe,Ce,de,Ne,Te=tl((ul=(fl=t[4].common)==null?void 0:fl.hour)!=null?ul:"Hour")+"",ve,be,He,ye=t[10][0]+"",Ve,xe,Je=t[10][1]+"",it,We,_t,Ee,_e=tl((cl=(rl=t[4].common)==null?void 0:rl.day)!=null?cl:"Day")+"",Ue,kt,wt,nt=t[11][0]+"",vt,ze,Ke=t[11][1]+"",Ye,Xe,Qe,ut,we=tl((_l=(ml=t[4].common)==null?void 0:ml.month)!=null?_l:"Month")+"",Ae,ke,ue,De=t[12][0]+"",rt,st,at=t[12][1]+"",pt,ht,Rt,Pt,ct=((dl=(pl=t[4].realtime)==null?void 0:pl.last_mo)!=null?dl:"Last mo.")+"",Ft,zt,Bt,Ut=t[13][0]+"",qt,yt,Gt=t[13][1]+"",Vt,Yt,Ct,Mt=t[5]&&co(t),ft=t[5]&&mo(t),Nt=t[5]&&_o(t),Et=t[5]&&po(t),dt=t[5]&&vo(t),At=t[5]&&ho(t),St=t[5]&&bo(t),mt=t[5]&&go(t);return{c(){e=p("strong"),n=S(l),i=g(),s=p("div"),a=p("div"),f=S(r),u=g(),m=p("div"),d=S(_),v=g(),h=S(b),C=g(),Mt&&Mt.c(),k=g(),T=p("div"),O=S(q),M=g(),U=p("div"),z=S(I),y=g(),R=S(V),F=g(),ft&&ft.c(),Y=g(),j=p("div"),K=S(W),B=g(),H=p("div"),ne=S(Z),X=g(),ae=S($),le=g(),Nt&&Nt.c(),se=g(),fe=p("div"),Q=S(re),x=g(),ge=p("div"),N=S(pe),w=g(),L=S(D),G=g(),Et&&Et.c(),ee=g(),oe=p("strong"),Pe=S(ce),Ce=g(),de=p("div"),Ne=p("div"),ve=S(Te),be=g(),He=p("div"),Ve=S(ye),xe=g(),it=S(Je),We=g(),dt&&dt.c(),_t=g(),Ee=p("div"),Ue=S(_e),kt=g(),wt=p("div"),vt=S(nt),ze=g(),Ye=S(Ke),Xe=g(),At&&At.c(),Qe=g(),ut=p("div"),Ae=S(we),ke=g(),ue=p("div"),rt=S(De),st=g(),pt=S(at),ht=g(),St&&St.c(),Rt=g(),Pt=p("div"),Ft=S(ct),zt=g(),Bt=p("div"),qt=S(Ut),yt=g(),Vt=S(Gt),Yt=g(),mt&&mt.c(),c(m,"class","text-right"),c(U,"class","text-right"),c(H,"class","text-right"),c(ge,"class","text-right"),c(s,"class",te="grid grid-cols-"+t[14]+" mb-3"),c(He,"class","text-right"),c(wt,"class","text-right"),c(ue,"class","text-right"),c(Bt,"class","text-right"),c(de,"class",Ct="grid grid-cols-"+t[14])},m(Be,et){E(Be,e,et),o(e,n),E(Be,i,et),E(Be,s,et),o(s,a),o(a,f),o(s,u),o(s,m),o(m,d),o(m,v),o(m,h),o(s,C),Mt&&Mt.m(s,null),o(s,k),o(s,T),o(T,O),o(s,M),o(s,U),o(U,z),o(U,y),o(U,R),o(s,F),ft&&ft.m(s,null),o(s,Y),o(s,j),o(j,K),o(s,B),o(s,H),o(H,ne),o(H,X),o(H,ae),o(s,le),Nt&&Nt.m(s,null),o(s,se),o(s,fe),o(fe,Q),o(s,x),o(s,ge),o(ge,N),o(ge,w),o(ge,L),o(s,G),Et&&Et.m(s,null),E(Be,ee,et),E(Be,oe,et),o(oe,Pe),E(Be,Ce,et),E(Be,de,et),o(de,Ne),o(Ne,ve),o(de,be),o(de,He),o(He,Ve),o(He,xe),o(He,it),o(de,We),dt&&dt.m(de,null),o(de,_t),o(de,Ee),o(Ee,Ue),o(de,kt),o(de,wt),o(wt,vt),o(wt,ze),o(wt,Ye),o(de,Xe),At&&At.m(de,null),o(de,Qe),o(de,ut),o(ut,Ae),o(de,ke),o(de,ue),o(ue,rt),o(ue,st),o(ue,pt),o(de,ht),St&&St.m(de,null),o(de,Rt),o(de,Pt),o(Pt,Ft),o(de,zt),o(de,Bt),o(Bt,qt),o(Bt,yt),o(Bt,Vt),o(de,Yt),mt&&mt.m(de,null)},p(Be,et){var je,he,Kt,wl,Cl,Sl,Ml,Nl,Tl,Pl,El,Dl,Rl,Fl,Bl,Ul,tt,Ot,vl,bl;et&16&&l!==(l=((he=(je=Be[4].common)==null?void 0:je.import)!=null?he:"Import")+"")&&A(n,l),et&16&&r!==(r=tl((wl=(Kt=Be[4].common)==null?void 0:Kt.hour)!=null?wl:"Hour")+"")&&A(f,r),et&64&&_!==(_=Be[6][0]+"")&&A(d,_),et&64&&b!==(b=Be[6][1]+"")&&A(h,b),Be[5]?Mt?Mt.p(Be,et):(Mt=co(Be),Mt.c(),Mt.m(s,k)):Mt&&(Mt.d(1),Mt=null),et&16&&q!==(q=tl((Sl=(Cl=Be[4].common)==null?void 0:Cl.day)!=null?Sl:"Day")+"")&&A(O,q),et&128&&I!==(I=Be[7][0]+"")&&A(z,I),et&128&&V!==(V=Be[7][1]+"")&&A(R,V),Be[5]?ft?ft.p(Be,et):(ft=mo(Be),ft.c(),ft.m(s,Y)):ft&&(ft.d(1),ft=null),et&16&&W!==(W=tl((Nl=(Ml=Be[4].common)==null?void 0:Ml.month)!=null?Nl:"Month")+"")&&A(K,W),et&256&&Z!==(Z=Be[8][0]+"")&&A(ne,Z),et&256&&$!==($=Be[8][1]+"")&&A(ae,$),Be[5]?Nt?Nt.p(Be,et):(Nt=_o(Be),Nt.c(),Nt.m(s,se)):Nt&&(Nt.d(1),Nt=null),et&16&&re!==(re=((Pl=(Tl=Be[4].realtime)==null?void 0:Tl.last_mo)!=null?Pl:"Last mo.")+"")&&A(Q,re),et&512&&pe!==(pe=Be[9][0]+"")&&A(N,pe),et&512&&D!==(D=Be[9][1]+"")&&A(L,D),Be[5]?Et?Et.p(Be,et):(Et=po(Be),Et.c(),Et.m(s,null)):Et&&(Et.d(1),Et=null),et&16384&&te!==(te="grid grid-cols-"+Be[14]+" mb-3")&&c(s,"class",te),et&16&&ce!==(ce=((Dl=(El=Be[4].common)==null?void 0:El.export)!=null?Dl:"Export")+"")&&A(Pe,ce),et&16&&Te!==(Te=tl((Fl=(Rl=Be[4].common)==null?void 0:Rl.hour)!=null?Fl:"Hour")+"")&&A(ve,Te),et&1024&&ye!==(ye=Be[10][0]+"")&&A(Ve,ye),et&1024&&Je!==(Je=Be[10][1]+"")&&A(it,Je),Be[5]?dt?dt.p(Be,et):(dt=vo(Be),dt.c(),dt.m(de,_t)):dt&&(dt.d(1),dt=null),et&16&&_e!==(_e=tl((Ul=(Bl=Be[4].common)==null?void 0:Bl.day)!=null?Ul:"Day")+"")&&A(Ue,_e),et&2048&&nt!==(nt=Be[11][0]+"")&&A(vt,nt),et&2048&&Ke!==(Ke=Be[11][1]+"")&&A(Ye,Ke),Be[5]?At?At.p(Be,et):(At=ho(Be),At.c(),At.m(de,Qe)):At&&(At.d(1),At=null),et&16&&we!==(we=tl((Ot=(tt=Be[4].common)==null?void 0:tt.month)!=null?Ot:"Month")+"")&&A(Ae,we),et&4096&&De!==(De=Be[12][0]+"")&&A(rt,De),et&4096&&at!==(at=Be[12][1]+"")&&A(pt,at),Be[5]?St?St.p(Be,et):(St=bo(Be),St.c(),St.m(de,Rt)):St&&(St.d(1),St=null),et&16&&ct!==(ct=((bl=(vl=Be[4].realtime)==null?void 0:vl.last_mo)!=null?bl:"Last mo.")+"")&&A(Ft,ct),et&8192&&Ut!==(Ut=Be[13][0]+"")&&A(qt,Ut),et&8192&&Gt!==(Gt=Be[13][1]+"")&&A(Vt,Gt),Be[5]?mt?mt.p(Be,et):(mt=go(Be),mt.c(),mt.m(de,null)):mt&&(mt.d(1),mt=null),et&16384&&Ct!==(Ct="grid grid-cols-"+Be[14])&&c(de,"class",Ct)},d(Be){Be&&P(e),Be&&P(i),Be&&P(s),Mt&&Mt.d(),ft&&ft.d(),Nt&&Nt.d(),Et&&Et.d(),Be&&P(ee),Be&&P(oe),Be&&P(Ce),Be&&P(de),dt&&dt.d(),At&&At.d(),St&&St.d(),mt&&mt.d()}}}function ro(t){var x,ge,pe,N,w,D,L,G,te,ee;let e,l=((ge=(x=t[4].realtime)==null?void 0:x.cost)!=null?ge:"Cost")+"",n,i,s,a,r=tl((N=(pe=t[4].common)==null?void 0:pe.hour)!=null?N:"Hour")+"",f,u,m,_=Xt(t[1].h.c,2)+"",d,v,b,h,C,k=tl((D=(w=t[4].common)==null?void 0:w.day)!=null?D:"Day")+"",T,q,O,M=Xt(t[1].d.c,1)+"",U,I,z,y,V,R=tl((G=(L=t[4].common)==null?void 0:L.month)!=null?G:"Month")+"",F,Y,j,W=Xt(t[1].m.c)+"",K,B,H,Z,ne,X=((ee=(te=t[4].realtime)==null?void 0:te.last_month)!=null?ee:"Last month")+"",$,ae,le,se=Xt(t[0].last_month.c)+"",fe,re,Q;return{c(){e=p("strong"),n=S(l),i=g(),s=p("div"),a=p("div"),f=S(r),u=g(),m=p("div"),d=S(_),v=g(),b=S(t[2]),h=g(),C=p("div"),T=S(k),q=g(),O=p("div"),U=S(M),I=g(),z=S(t[2]),y=g(),V=p("div"),F=S(R),Y=g(),j=p("div"),K=S(W),B=g(),H=S(t[2]),Z=g(),ne=p("div"),$=S(X),ae=g(),le=p("div"),fe=S(se),re=g(),Q=S(t[2]),c(m,"class","text-right"),c(O,"class","text-right"),c(j,"class","text-right"),c(le,"class","text-right"),c(s,"class","grid grid-cols-2")},m(oe,ce){E(oe,e,ce),o(e,n),E(oe,i,ce),E(oe,s,ce),o(s,a),o(a,f),o(s,u),o(s,m),o(m,d),o(m,v),o(m,b),o(s,h),o(s,C),o(C,T),o(s,q),o(s,O),o(O,U),o(O,I),o(O,z),o(s,y),o(s,V),o(V,F),o(s,Y),o(s,j),o(j,K),o(j,B),o(j,H),o(s,Z),o(s,ne),o(ne,$),o(s,ae),o(s,le),o(le,fe),o(le,re),o(le,Q)},p(oe,ce){var Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve;ce&16&&l!==(l=((Ce=(Pe=oe[4].realtime)==null?void 0:Pe.cost)!=null?Ce:"Cost")+"")&&A(n,l),ce&16&&r!==(r=tl((Ne=(de=oe[4].common)==null?void 0:de.hour)!=null?Ne:"Hour")+"")&&A(f,r),ce&2&&_!==(_=Xt(oe[1].h.c,2)+"")&&A(d,_),ce&4&&A(b,oe[2]),ce&16&&k!==(k=tl((ve=(Te=oe[4].common)==null?void 0:Te.day)!=null?ve:"Day")+"")&&A(T,k),ce&2&&M!==(M=Xt(oe[1].d.c,1)+"")&&A(U,M),ce&4&&A(z,oe[2]),ce&16&&R!==(R=tl((He=(be=oe[4].common)==null?void 0:be.month)!=null?He:"Month")+"")&&A(F,R),ce&2&&W!==(W=Xt(oe[1].m.c)+"")&&A(K,W),ce&4&&A(H,oe[2]),ce&16&&X!==(X=((Ve=(ye=oe[4].realtime)==null?void 0:ye.last_month)!=null?Ve:"Last month")+"")&&A($,X),ce&1&&se!==(se=Xt(oe[0].last_month.c)+"")&&A(fe,se),ce&4&&A(Q,oe[2])},d(oe){oe&&P(e),oe&&P(i),oe&&P(s)}}}function co(t){let e,l=Xt(t[1].h.c,2)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].h.c,2)+"")&&A(n,l),r&4&&A(s,a[2])},d(a){a&&P(e)}}}function mo(t){let e,l=Xt(t[1].d.c,1)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].d.c,1)+"")&&A(n,l),r&4&&A(s,a[2])},d(a){a&&P(e)}}}function _o(t){let e,l=Xt(t[1].m.c)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].m.c)+"")&&A(n,l),r&4&&A(s,a[2])},d(a){a&&P(e)}}}function po(t){let e,l=Xt(t[0].last_month.c)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&1&&l!==(l=Xt(a[0].last_month.c)+"")&&A(n,l),r&4&&A(s,a[2])},d(a){a&&P(e)}}}function vo(t){let e,l=Xt(t[1].h.i,2)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].h.i,2)+"")&&A(n,l),r&4&&A(s,a[2])},d(a){a&&P(e)}}}function ho(t){let e,l=Xt(t[1].d.i,1)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].d.i,1)+"")&&A(n,l),r&4&&A(s,a[2])},d(a){a&&P(e)}}}function bo(t){let e,l=Xt(t[1].m.i)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].m.i)+"")&&A(n,l),r&4&&A(s,a[2])},d(a){a&&P(e)}}}function go(t){let e,l=Xt(t[0].last_month.i)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&1&&l!==(l=Xt(a[0].last_month.i)+"")&&A(n,l),r&4&&A(s,a[2])},d(a){a&&P(e)}}}function a0(t){var m,_;let e,l,n=((_=(m=t[4].realtime)==null?void 0:m.title)!=null?_:"Real time calculations")+"",i,s,a,r,f,u=t[1]&&uo(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("br"),r=p("br"),f=g(),u&&u.c(),c(e,"class","mx-2 text-sm")},m(d,v){E(d,e,v),o(e,l),o(l,i),o(e,s),o(e,a),o(e,r),o(e,f),u&&u.m(e,null)},p(d,[v]){var b,h;v&16&&n!==(n=((h=(b=d[4].realtime)==null?void 0:b.title)!=null?h:"Real time calculations")+"")&&A(i,n),d[1]?u?u.p(d,v):(u=uo(d),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i:Ze,o:Ze,d(d){d&&P(e),u&&u.d()}}}function f0(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:s}=e,{hasExport:a}=e,{translations:r={}}=e,f,u,m,_,d,v,b,h,C=!1,k=3;return t.$$set=T=>{"sysinfo"in T&&l(0,n=T.sysinfo),"data"in T&&l(1,i=T.data),"currency"in T&&l(2,s=T.currency),"hasExport"in T&&l(3,a=T.hasExport),"translations"in T&&l(4,r=T.translations)},t.$$.update=()=>{var T,q,O,M,U,I,z,y;t.$$.dirty&35&&(l(5,C=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(14,k=C?3:2),l(6,f=gl(((T=i==null?void 0:i.h)==null?void 0:T.u)*1e3,"Wh")),l(7,u=gl(((q=i==null?void 0:i.d)==null?void 0:q.u)*1e3,"Wh")),l(8,m=gl(((O=i==null?void 0:i.m)==null?void 0:O.u)*1e3,"Wh")),l(9,_=gl(((M=n==null?void 0:n.last_month)==null?void 0:M.u)*1e3,"Wh")),l(10,d=gl(((U=i==null?void 0:i.h)==null?void 0:U.p)*1e3,"Wh")),l(11,v=gl(((I=i==null?void 0:i.d)==null?void 0:I.p)*1e3,"Wh")),l(12,b=gl(((z=i==null?void 0:i.m)==null?void 0:z.p)*1e3,"Wh")),l(13,h=gl(((y=n==null?void 0:n.last_month)==null?void 0:y.p)*1e3,"Wh")))},[n,i,s,a,r,C,f,u,m,_,d,v,b,h,k]}class u0 extends It{constructor(e){super(),Lt(this,e,f0,a0,Dt,{sysinfo:0,data:1,currency:2,hasExport:3,translations:4})}}function r0(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function c0(t,e,l){let{title:n}=e,{json:i}=e,{sysinfo:s}=e,a={},r,f,u=document.documentElement.classList.contains("dark");return t.$$set=m=>{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,s=m.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let m=i.currency,_=new Date().getUTCHours(),d=0,v=0,b=0,h=[],C=[],k=[];l(5,f=l(4,r=0));let T=new Date;for(zl(T,s.clock_offset-(24+T.getHours()-T.getUTCHours())%24),d=_;d<24&&(v=i[Tt(b++)],v!=null);d++)C.push({label:Tt(T.getHours())}),k.push(v*100),l(5,f=Math.min(f,v*100)),l(4,r=Math.max(r,v*100)),zl(T,1);for(d=0;d<24&&(v=i[Tt(b++)],v!=null);d++)C.push({label:Tt(T.getHours())}),k.push(v*100),l(5,f=Math.min(f,v*100)),l(4,r=Math.max(r,v*100)),zl(T,1);if(f>-100&&r<100){switch(m){case"NOK":case"DKK":m="\xF8re";break;case"SEK":m="\xF6re";break;case"EUR":m="cent";break;case"CHF":m="rp.";break;default:m=m+"/100"}for(l(5,f*=100),l(4,r*=100),d=0;d=0?I.toFixed(z):"",title:I>=0?I.toFixed(2)+" "+m:"",value:v>=0?Math.abs(v):0,label2:I<0?I.toFixed(z):"",title2:I<0?I.toFixed(2)+" "+m:"",value2:v<0?Math.abs(v):0,color:u?"#5c2da5":"#7c3aed"})}let O=Math.max(r,Math.abs(f));if(f<0){l(5,f=Math.min(O/4*-1,f));let I=Math.ceil(Math.abs(f)/O*4),z=f/I;for(d=1;d{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,s=m.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let m=0,_=[],d=[],v=[];l(5,f=l(4,r=0));let b=zl(new Date,-24),h=new Date().getUTCHours();for(zl(b,s.clock_offset-(24+b.getHours()-b.getUTCHours())%24),m=h;m<24;m++){let q=i["i"+Tt(m)],O=i["e"+Tt(m)];q===void 0&&(q=0),O===void 0&&(O=0),d.push({label:Tt(b.getHours())}),v.push({label:q.toFixed(1),title:q.toFixed(2)+" kWh",value:q*10,label2:O.toFixed(1),title2:O.toFixed(2)+" kWh",value2:O*10,color:u?"#5c2da5":"#7c3aed",color2:u?"#27728e":"#37829e"}),l(5,f=Math.max(f,O*10)),l(4,r=Math.max(r,q*10)),zl(b,1)}for(m=0;m{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,s=m.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let m=0,_=[],d=[],v=[];l(5,f=l(4,r=0));let b=new Date,h=new Date,C=s.clock_offset-(24+b.getHours()-b.getUTCHours())%24;for(zl(b,-C),zl(h,-C),h.setDate(0),m=b.getDate();m<=h.getDate();m++){let O=i["i"+Tt(m)],M=i["e"+Tt(m)];O===void 0&&(O=0),M===void 0&&(M=0),d.push({label:Tt(m)}),v.push({label:O.toFixed(O<10?1:0),title:O.toFixed(2)+" kWh",value:O,label2:M.toFixed(M<10?1:0),title2:M.toFixed(2)+" kWh",value2:M,color:u?"#5c2da5":"#7c3aed",color2:u?"#27728e":"#37829e"}),l(5,f=Math.max(f,M)),l(4,r=Math.max(r,O))}for(m=1;m{"title"in u&&l(1,n=u.title),"json"in u&&l(2,i=u.json)},t.$$.update=()=>{if(t.$$.dirty&30){let u=0,m=0,_=[],d=[],v=[];i.s&&i.s.forEach((C,k)=>{var T=C.n?C.n:C.a;m=C.v,m==-127&&(m=0),d.push({label:T.slice(-4)}),v.push({label:m.toFixed(1),value:m,color:s?"#5c2da5":"#7c3aed"}),l(4,f=Math.min(f,m)),l(3,r=Math.max(r,m))}),l(3,r=Math.ceil(r)),l(4,f=Math.floor(f));let b=r;f<0&&(b+=Math.abs(f));let h=b/4;for(u=0;u<5;u++)m=f+h*u,_.push({value:m,label:m.toFixed(1)});l(0,a={title:n+" (\xB0C)",dark:document.documentElement.classList.contains("dark"),height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:f,max:r,ticks:_},x:{ticks:d},points:v})}},[a,n,i,r,f]}class w0 extends It{constructor(e){super(),Lt(this,e,k0,g0,Dt,{title:1,json:2})}}function C0(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}let S0=0;function M0(t,e,l){let{title:n}=e,{translations:i={}}=e,s=document.documentElement.classList.contains("dark"),a={},r=0,{tariffData:f}=e;return t.$$set=u=>{"title"in u&&l(1,n=u.title),"translations"in u&&l(2,i=u.translations),"tariffData"in u&&l(3,f=u.tariffData)},t.$$.update=()=>{var u;if(t.$$.dirty&30){let m=0,_=[],d=[],v=[];if(_.push({value:0,label:0}),f&&f.p)for(m=0;m0?Tt(b.d)+"."+(i.months?(u=i.months)==null?void 0:u[new Date().getMonth()]:Tt(new Date().getMonth()+1)):"-"}),l(4,r=Math.max(r,b.v))}if(f&&f.t){for(m=0;m=r)break;_.push({value:b,label:b})}_.push({label:f.m.toFixed(1),align:"right",color:"green",value:f.m})}f&&f.c&&(_.push({label:f.c.toFixed(0),color:"orange",value:f.c}),l(4,r=Math.max(r,f.c))),l(4,r=Math.ceil(r)),l(0,a={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:35,bottom:20,left:35},y:{min:S0,max:r,ticks:_},x:{ticks:d},points:v})}},[a,n,i,f,r]}class N0 extends It{constructor(e){super(),Lt(this,e,M0,C0,Dt,{title:1,translations:2,tariffData:3})}}let Jl=0,T0={data:[]};async function ns(){let e=await(await Il(Jl<0?"realtime.json":"realtime.json?offset="+Jl)).json();is.update(l=>{for(let n=0;n=0&&(Jl+=e.size,Jlfn||Ui-fn>300?(ns(),Si=0):is.update(t=>{if(t.lastUpdate)for(;fn>t.lastUpdate;)t.data.unshift(Ou),t.data=t.data.slice(0,t.size),t.lastUpdate+=10,Si++;else t.lastUpdate=fn;return t})}function D0(t){if(Ou=t.i-t.e,fn=t.u,!ko){ns(),ko=!0,Ui=fn;return}!P0()||E0()}function wo(t,e,l){const n=t.slice();return n[18]=e[l],n[20]=l,n}function Co(t,e,l){const n=t.slice();return n[21]=e[l],n}function q0(t){let e,l,n;return{c(){e=p("strong"),l=S(t[0]),n=S(" not available"),c(e,"class","text-sm")},m(i,s){E(i,e,s),o(e,l),o(e,n)},p(i,s){s&1&&A(l,i[0])},d(i){i&&P(e)}}}function A0(t){let e,l,n,i,s,a,r,f=t[8]&&So(t);return{c(){e=p("strong"),l=S(t[0]),n=S(" ("),i=S(t[12]),s=S(")"),a=g(),f&&f.c(),r=$t(),c(e,"class","text-sm")},m(u,m){E(u,e,m),o(e,l),o(e,n),o(e,i),o(e,s),E(u,a,m),f&&f.m(u,m),E(u,r,m)},p(u,m){m&1&&A(l,u[0]),m&4096&&A(i,u[12]),u[8]?f?f.p(u,m):(f=So(u),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(u){u&&P(e),u&&P(a),f&&f.d(u),u&&P(r)}}}function So(t){let e,l,n,i,s,a=t[8],r=[];for(let m=0;mt[17].call(e))},m(a,r){E(a,e,r),s.m(e,null),l=Qi(e,t[17].bind(e))},p(a,[r]){i===(i=n(a))&&s?s.p(a,r):(s.d(1),s=i(a),s&&(s.c(),s.m(e,null)))},i:Ze,o:Ze,d(a){a&&P(e),s.d(),l()}}}function I0(t,e,l){let{title:n}=e,i=document.documentElement.classList.contains("dark"),s=null;is.subscribe(M=>{l(16,s=M)});let a=!1,r,f,u,m,_,d,v,b=function(M,U,I){return Math.ceil(_-(M-U)/(I-U)*_)-25},h=function(M){return 30+Math.ceil(M/s.size*(d-35))},C,k,T,q;function O(){u=this.clientWidth,m=this.clientHeight,l(3,u),l(4,m)}return t.$$set=M=>{"title"in M&&l(0,n=M.title)},t.$$.update=()=>{if(t.$$.dirty&67582)if(l(5,_=parseInt(m)-50),l(6,d=u-35),l(10,T=d/s.size),l(2,f=0),l(1,r=0),s.data&&_>10&&d>100&&T>.1){l(11,a=!0);for(let I in s.data){let z=s.data[I];isNaN(z)&&(z=0),l(1,r=Math.max(Math.ceil(z/1e3)*1e3,r)),l(2,f=Math.min(Math.floor(z/1e3)*1e3,f))}let M=r-f;l(12,q=r>2500?"kW":"W"),l(8,C=[]);for(let I=f;I2500?(I/1e3).toFixed(1):I}),!(C.length>6));I+=M/5);l(9,k=[]);for(let I=0;I12));I+=Math.round(s.size/Math.round(d/120)));let U=s.size;l(7,v=h(s.size)+","+b(0,f,r)+" "+h(1)+","+b(0,f,r));for(let I in s.data){if(U<0)break;let z=s.data[I];isNaN(z)&&(z=0),l(7,v=h(U--)+","+b(z,f,r)+" "+v)}}else l(11,a=!1)},[n,r,f,u,m,_,d,v,C,k,T,a,q,i,b,h,s,O]}class O0 extends It{constructor(e){super(),Lt(this,e,I0,L0,Dt,{title:0})}}function R0(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function F0(t,e,l){let{title:n}=e,{unit:i=""}=e,{l1:s=!1}=e,{l2:a=!1}=e,{l2x:r=!1}=e,{l3:f=!1}=e,{l1i:u=0}=e,{l2i:m=0}=e,{l3i:_=0}=e,{l1e:d=0}=e,{l2e:v=0}=e,{l3e:b=0}=e,{maxImport:h=0}=e,{maxExport:C=0}=e,{importColorFn:k}=e,{exportColorFn:T}=e,q={};function O(M,U){return{label:Xt(M>900?M/1e3:M)+(M>900?"k":"")+i,title:M.toFixed(2)+" "+i,value:isNaN(M)?0:M,color:k(M?M/h*100:0,document.documentElement.classList.contains("dark")),label2:Xt(U>900?U/1e3:U)+(U>900?"k":"")+i,title2:U.toFixed(2)+" "+i,value2:isNaN(U)?0:U,color2:T(U?U/C*100:0)}}return t.$$set=M=>{"title"in M&&l(1,n=M.title),"unit"in M&&l(2,i=M.unit),"l1"in M&&l(3,s=M.l1),"l2"in M&&l(4,a=M.l2),"l2x"in M&&l(5,r=M.l2x),"l3"in M&&l(6,f=M.l3),"l1i"in M&&l(7,u=M.l1i),"l2i"in M&&l(8,m=M.l2i),"l3i"in M&&l(9,_=M.l3i),"l1e"in M&&l(10,d=M.l1e),"l2e"in M&&l(11,v=M.l2e),"l3e"in M&&l(12,b=M.l3e),"maxImport"in M&&l(13,h=M.maxImport),"maxExport"in M&&l(14,C=M.maxExport),"importColorFn"in M&&l(15,k=M.importColorFn),"exportColorFn"in M&&l(16,T=M.exportColorFn)},t.$$.update=()=>{if(t.$$.dirty&32762){let M=[],U=[];s&&(M.push({label:"L1"}),U.push(O(u,d))),a&&(r?(M.push({label:"L2"}),U.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(M.push({label:"L2"}),U.push(O(m,v)))),f&&(M.push({label:"L3"}),U.push(O(_,b)));let I=[];if(C){let z=C>h?4:C*4/h;I.push({value:-C,label:"-100%"}),z>=4&&I.push({value:-C/4*3,label:"-75%"}),z>=2&&I.push({value:-C/2,label:"-50%"}),z>=4&&I.push({value:-C/4,label:"-25%"})}if(I.push({value:0,label:"0%"}),h){let z=h>C?4:h*4/C;I.push({value:h/4,label:"25%"}),z>=4&&I.push({value:h/2,label:"50%"}),z>=2&&I.push({value:h/4*3,label:"75%"}),z>=4&&I.push({value:h,label:"100%"})}l(0,q={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:15,bottom:20,left:35},y:{min:-C,max:h,ticks:I},x:{ticks:M},points:U})}},[q,n,i,s,a,r,f,u,m,_,d,v,b,h,C,k,T]}class ss extends It{constructor(e){super(),Lt(this,e,F0,R0,Dt,{title:1,unit:2,l1:3,l2:4,l2x:5,l3:6,l1i:7,l2i:8,l3i:9,l1e:10,l2e:11,l3e:12,maxImport:13,maxExport:14,importColorFn:15,exportColorFn:16})}}function Eo(t){var k,T;let e,l,n,i,s,a,r=(t[0].mt?_i(t[0].mt):"-")+"",f,u,m,_=t[11][0]+"",d,v,b=t[11][1]+"",h,C;return i=new Iu({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:(T=(k=t[6].common)==null?void 0:k.import)!=null?T:"Import",sub:Xt(t[0].p,2),subunit:t[0].pc,colorFn:xi}}),{c(){e=p("div"),l=p("div"),n=p("div"),Oe(i.$$.fragment),s=g(),a=p("div"),f=S(r),u=g(),m=p("div"),d=S(_),v=g(),h=S(b),c(n,"class","col-span-2"),c(m,"class","text-right"),c(l,"class","grid grid-cols-2"),c(e,"class","cnt")},m(q,O){E(q,e,O),o(e,l),o(l,n),Le(i,n,null),o(l,s),o(l,a),o(a,f),o(l,u),o(l,m),o(m,d),o(m,v),o(m,h),C=!0},p(q,O){var U,I;const M={};O&1&&(M.val=q[0].i?q[0].i:0),O&1&&(M.max=q[0].im?q[0].im:15e3),O&64&&(M.label=(I=(U=q[6].common)==null?void 0:U.import)!=null?I:"Import"),O&1&&(M.sub=Xt(q[0].p,2)),O&1&&(M.subunit=q[0].pc),i.$set(M),(!C||O&1)&&r!==(r=(q[0].mt?_i(q[0].mt):"-")+"")&&A(f,r),(!C||O&2048)&&_!==(_=q[11][0]+"")&&A(d,_),(!C||O&2048)&&b!==(b=q[11][1]+"")&&A(h,b)},i(q){C||(J(i.$$.fragment,q),C=!0)},o(q){ie(i.$$.fragment,q),C=!1},d(q){q&&P(e),Ie(i)}}}function Do(t){var h,C;let e,l,n,i,s,a,r,f,u=t[12][0]+"",m,_,d=t[12][1]+"",v,b;return i=new Iu({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:(C=(h=t[6].common)==null?void 0:h.export)!=null?C:"Export",sub:Xt(t[0].px,2),subunit:t[0].pc,colorFn:Xn}}),{c(){e=p("div"),l=p("div"),n=p("div"),Oe(i.$$.fragment),s=g(),a=p("div"),r=g(),f=p("div"),m=S(u),_=g(),v=S(d),c(n,"class","col-span-2"),c(f,"class","text-right"),c(l,"class","grid grid-cols-2"),c(e,"class","cnt")},m(k,T){E(k,e,T),o(e,l),o(l,n),Le(i,n,null),o(l,s),o(l,a),o(l,r),o(l,f),o(f,m),o(f,_),o(f,v),b=!0},p(k,T){var O,M;const q={};T&1&&(q.val=k[0].e?k[0].e:0),T&1&&(q.max=k[0].om?k[0].om*1e3:1e4),T&64&&(q.label=(M=(O=k[6].common)==null?void 0:O.export)!=null?M:"Export"),T&1&&(q.sub=Xt(k[0].px,2)),T&1&&(q.subunit=k[0].pc),i.$set(q),(!b||T&4096)&&u!==(u=k[12][0]+"")&&A(m,u),(!b||T&4096)&&d!==(d=k[12][1]+"")&&A(v,d)},i(k){b||(J(i.$$.fragment,k),b=!0)},o(k){ie(i.$$.fragment,k),b=!1},d(k){k&&P(e),Ie(i)}}}function qo(t){let e,l,n=t[0].l1&&Ao(t);return{c(){e=p("div"),n&&n.c(),c(e,"class","cnt")},m(i,s){E(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&J(n,1)):(n=Ao(i),n.c(),J(n,1),n.m(e,null)):n&&(bt(),ie(n,1,1,()=>{n=null}),gt())},i(i){l||(J(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Ao(t){var n,i;let e,l;return e=new t0({props:{title:(i=(n=t[6].common)==null?void 0:n.voltage)!=null?i:"Volt",u1:t[0].l1.u,u2:t[0].l2.u,u3:t[0].l3.u,ds:t[0].ds}}),{c(){Oe(e.$$.fragment)},m(s,a){Le(e,s,a),l=!0},p(s,a){var f,u;const r={};a&64&&(r.title=(u=(f=s[6].common)==null?void 0:f.voltage)!=null?u:"Volt"),a&1&&(r.u1=s[0].l1.u),a&1&&(r.u2=s[0].l2.u),a&1&&(r.u3=s[0].l3.u),a&1&&(r.ds=s[0].ds),e.$set(r)},i(s){l||(J(e.$$.fragment,s),l=!0)},o(s){ie(e.$$.fragment,s),l=!1},d(s){Ie(e,s)}}}function Lo(t){let e,l,n=t[0].l1&&Io(t);return{c(){e=p("div"),n&&n.c(),c(e,"class","cnt")},m(i,s){E(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&J(n,1)):(n=Io(i),n.c(),J(n,1),n.m(e,null)):n&&(bt(),ie(n,1,1,()=>{n=null}),gt())},i(i){l||(J(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Io(t){var n,i;let e,l;return e=new ss({props:{title:(i=(n=t[6].common)==null?void 0:n.amperage)!=null?i:"Amp",unit:"A",importColorFn:xi,exportColorFn:Xn,maxImport:t[0].mf,maxExport:t[0].om?t[13]?t[0].om/.4/Math.sqrt(3):t[0].om/.23:0,l1:t[8],l2:t[9],l3:t[10],l2x:t[0].l2.e,l1i:Math.max(t[0].l1.i,0),l2i:Math.max(t[0].l2.i,0),l3i:Math.max(t[0].l3.i,0),l1e:Math.max(t[0].l1.i*-1,0),l2e:Math.max(t[0].l2.i*-1,0),l3e:Math.max(t[0].l3.i*-1,0)}}),{c(){Oe(e.$$.fragment)},m(s,a){Le(e,s,a),l=!0},p(s,a){var f,u;const r={};a&64&&(r.title=(u=(f=s[6].common)==null?void 0:f.amperage)!=null?u:"Amp"),a&1&&(r.maxImport=s[0].mf),a&8193&&(r.maxExport=s[0].om?s[13]?s[0].om/.4/Math.sqrt(3):s[0].om/.23:0),a&256&&(r.l1=s[8]),a&512&&(r.l2=s[9]),a&1024&&(r.l3=s[10]),a&1&&(r.l2x=s[0].l2.e),a&1&&(r.l1i=Math.max(s[0].l1.i,0)),a&1&&(r.l2i=Math.max(s[0].l2.i,0)),a&1&&(r.l3i=Math.max(s[0].l3.i,0)),a&1&&(r.l1e=Math.max(s[0].l1.i*-1,0)),a&1&&(r.l2e=Math.max(s[0].l2.i*-1,0)),a&1&&(r.l3e=Math.max(s[0].l3.i*-1,0)),e.$set(r)},i(s){l||(J(e.$$.fragment,s),l=!0)},o(s){ie(e.$$.fragment,s),l=!1},d(s){Ie(e,s)}}}function Oo(t){let e,l,n=t[0].l1&&Ro(t);return{c(){e=p("div"),n&&n.c(),c(e,"class","cnt")},m(i,s){E(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&J(n,1)):(n=Ro(i),n.c(),J(n,1),n.m(e,null)):n&&(bt(),ie(n,1,1,()=>{n=null}),gt())},i(i){l||(J(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Ro(t){var n,i;let e,l;return e=new ss({props:{title:(i=(n=t[6].dashboard)==null?void 0:n.phase)!=null?i:"Phase",unit:"W",importColorFn:xi,exportColorFn:Xn,maxImport:(t[0].mf?t[0].mf:32)*230,maxExport:t[0].om?t[13]?t[0].om*1e3/Math.sqrt(3):t[0].om*1e3:0,l1:t[8],l2:t[9],l3:t[10],l1i:t[0].l1.p,l2i:t[0].l2.p,l3i:t[0].l3.p,l1e:t[0].l1.q,l2e:t[0].l2.q,l3e:t[0].l3.q}}),{c(){Oe(e.$$.fragment)},m(s,a){Le(e,s,a),l=!0},p(s,a){var f,u;const r={};a&64&&(r.title=(u=(f=s[6].dashboard)==null?void 0:f.phase)!=null?u:"Phase"),a&1&&(r.maxImport=(s[0].mf?s[0].mf:32)*230),a&8193&&(r.maxExport=s[0].om?s[13]?s[0].om*1e3/Math.sqrt(3):s[0].om*1e3:0),a&256&&(r.l1=s[8]),a&512&&(r.l2=s[9]),a&1024&&(r.l3=s[10]),a&1&&(r.l1i=s[0].l1.p),a&1&&(r.l2i=s[0].l2.p),a&1&&(r.l3i=s[0].l3.p),a&1&&(r.l1e=s[0].l1.q),a&1&&(r.l2e=s[0].l2.q),a&1&&(r.l3e=s[0].l3.q),e.$set(r)},i(s){l||(J(e.$$.fragment,s),l=!0)},o(s){ie(e.$$.fragment,s),l=!1},d(s){Ie(e,s)}}}function Fo(t){let e,l,n=t[0].l1&&Bo(t);return{c(){e=p("div"),n&&n.c(),c(e,"class","cnt")},m(i,s){E(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&J(n,1)):(n=Bo(i),n.c(),J(n,1),n.m(e,null)):n&&(bt(),ie(n,1,1,()=>{n=null}),gt())},i(i){l||(J(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Bo(t){var n,i;let e,l;return e=new ss({props:{title:(i=(n=t[6].dashboard)==null?void 0:n.pf)!=null?i:"Pf",importColorFn:Xn,exportColorFn:Xn,maxImport:1,l1:t[8],l2:t[9],l3:t[10],l1i:t[0].l1.f,l2i:t[0].l2.f,l3i:t[0].l3.f}}),{c(){Oe(e.$$.fragment)},m(s,a){Le(e,s,a),l=!0},p(s,a){var f,u;const r={};a&64&&(r.title=(u=(f=s[6].dashboard)==null?void 0:f.pf)!=null?u:"Pf"),a&256&&(r.l1=s[8]),a&512&&(r.l2=s[9]),a&1024&&(r.l3=s[10]),a&1&&(r.l1i=s[0].l1.f),a&1&&(r.l2i=s[0].l2.f),a&1&&(r.l3i=s[0].l3.f),e.$set(r)},i(s){l||(J(e.$$.fragment,s),l=!0)},o(s){ie(e.$$.fragment,s),l=!1},d(s){Ie(e,s)}}}function Uo(t){let e,l,n;return l=new i0({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec,translations:t[6]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt")},m(i,s){E(i,e,s),Le(l,e,null),n=!0},p(i,s){const a={};s&1&&(a.importInstant=i[0].ri),s&1&&(a.exportInstant=i[0].re),s&1&&(a.importTotal=i[0].ric),s&1&&(a.exportTotal=i[0].rec),s&64&&(a.translations=i[6]),l.$set(a)},i(i){n||(J(l.$$.fragment,i),n=!0)},o(i){ie(l.$$.fragment,i),n=!1},d(i){i&&P(e),Ie(l)}}}function jo(t){let e,l,n;return l=new u0({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0,translations:t[6]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt")},m(i,s){E(i,e,s),Le(l,e,null),n=!0},p(i,s){const a={};s&2&&(a.sysinfo=i[1]),s&1&&(a.data=i[0].ea),s&1&&(a.currency=i[0].pc),s&1&&(a.hasExport=i[0].om>0||i[0].e>0),s&64&&(a.translations=i[6]),l.$set(a)},i(i){n||(J(l.$$.fragment,i),n=!0)},o(i){ie(l.$$.fragment,i),n=!1},d(i){i&&P(e),Ie(l)}}}function yo(t){var i,s;let e,l,n;return l=new N0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.tariffpeak)!=null?s:"Tariff peaks",tariffData:t[7],translations:t[6]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt h-64")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.tariffpeak)!=null?m:"Tariff peaks"),r&128&&(f.tariffData=a[7]),r&64&&(f.translations=a[6]),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function Ho(t){var i,s;let e,l,n;return l=new O0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.realtime)!=null?s:"Real time"}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt gwf")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.realtime)!=null?m:"Real time"),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function zo(t){var i,s;let e,l,n;return l=new m0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.price)!=null?s:"Price",json:t[2],sysinfo:t[1]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt gwf")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.price)!=null?m:"Price"),r&4&&(f.json=a[2]),r&2&&(f.sysinfo=a[1]),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function Wo(t){var i,s;let e,l,n;return l=new d0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.day)!=null?s:"24 hours",json:t[3],sysinfo:t[1]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt gwf")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.day)!=null?m:"24 hours"),r&8&&(f.json=a[3]),r&2&&(f.sysinfo=a[1]),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function Go(t){var i,s;let e,l,n;return l=new b0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.month)!=null?s:"{0} days",json:t[4],sysinfo:t[1]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt gwf")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.month)!=null?m:"{0} days"),r&16&&(f.json=a[4]),r&2&&(f.sysinfo=a[1]),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function Vo(t){var i,s;let e,l,n;return l=new w0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.temperature)!=null?s:"Temperature",json:t[5]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt gwf")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.temperature)!=null?m:"Temperature"),r&32&&(f.json=a[5]),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function B0(t){let e,l=Zt(t[1].ui.i,t[0].i),n,i=Zt(t[1].ui.e,t[0].om||t[0].e>0),s,a=Zt(t[1].ui.v,t[0].l1&&(t[0].l1.u>100||t[0].l2.u>100||t[0].l3.u>100)),r,f=Zt(t[1].ui.a,t[0].l1&&(t[0].l1.i>.01||t[0].l2.i>.01||t[0].l3.i>.01)),u,m=Zt(t[1].ui.h,t[0].l1&&(t[0].l1.p>.01||t[0].l2.p>.01||t[0].l3.p>.01||t[0].l1.q>.01||t[0].l2.q>.01||t[0].l3.q>.01)),_,d=Zt(t[1].ui.f,t[0].l1&&(t[0].l1.f>.01||t[0].l2.f>.01||t[0].l3.f>.01)),v,b=Zt(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),h,C=Zt(t[1].ui.c,t[0].ea),k,T=Zt(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("NO")||t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),q,O=Zt(t[1].ui.l,t[0].hm==1),M,U=Zt(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),I,z=Zt(t[1].ui.d,t[3]),y,V=Zt(t[1].ui.m,t[4]),R,F=Zt(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),Y,j=l&&Eo(t),W=i&&Do(t),K=a&&qo(t),B=f&&Lo(t),H=m&&Oo(t),Z=d&&Fo(t),ne=b&&Uo(t),X=C&&jo(t),$=T&&yo(t),ae=O&&Ho(t),le=U&&zo(t),se=z&&Wo(t),fe=V&&Go(t),re=F&&Vo(t);return{c(){e=p("div"),j&&j.c(),n=g(),W&&W.c(),s=g(),K&&K.c(),r=g(),B&&B.c(),u=g(),H&&H.c(),_=g(),Z&&Z.c(),v=g(),ne&&ne.c(),h=g(),X&&X.c(),k=g(),$&&$.c(),q=g(),ae&&ae.c(),M=g(),le&&le.c(),I=g(),se&&se.c(),y=g(),fe&&fe.c(),R=g(),re&&re.c(),c(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(Q,x){E(Q,e,x),j&&j.m(e,null),o(e,n),W&&W.m(e,null),o(e,s),K&&K.m(e,null),o(e,r),B&&B.m(e,null),o(e,u),H&&H.m(e,null),o(e,_),Z&&Z.m(e,null),o(e,v),ne&&ne.m(e,null),o(e,h),X&&X.m(e,null),o(e,k),$&&$.m(e,null),o(e,q),ae&&ae.m(e,null),o(e,M),le&&le.m(e,null),o(e,I),se&&se.m(e,null),o(e,y),fe&&fe.m(e,null),o(e,R),re&&re.m(e,null),Y=!0},p(Q,[x]){x&3&&(l=Zt(Q[1].ui.i,Q[0].i)),l?j?(j.p(Q,x),x&3&&J(j,1)):(j=Eo(Q),j.c(),J(j,1),j.m(e,n)):j&&(bt(),ie(j,1,1,()=>{j=null}),gt()),x&3&&(i=Zt(Q[1].ui.e,Q[0].om||Q[0].e>0)),i?W?(W.p(Q,x),x&3&&J(W,1)):(W=Do(Q),W.c(),J(W,1),W.m(e,s)):W&&(bt(),ie(W,1,1,()=>{W=null}),gt()),x&3&&(a=Zt(Q[1].ui.v,Q[0].l1&&(Q[0].l1.u>100||Q[0].l2.u>100||Q[0].l3.u>100))),a?K?(K.p(Q,x),x&3&&J(K,1)):(K=qo(Q),K.c(),J(K,1),K.m(e,r)):K&&(bt(),ie(K,1,1,()=>{K=null}),gt()),x&3&&(f=Zt(Q[1].ui.a,Q[0].l1&&(Q[0].l1.i>.01||Q[0].l2.i>.01||Q[0].l3.i>.01))),f?B?(B.p(Q,x),x&3&&J(B,1)):(B=Lo(Q),B.c(),J(B,1),B.m(e,u)):B&&(bt(),ie(B,1,1,()=>{B=null}),gt()),x&3&&(m=Zt(Q[1].ui.h,Q[0].l1&&(Q[0].l1.p>.01||Q[0].l2.p>.01||Q[0].l3.p>.01||Q[0].l1.q>.01||Q[0].l2.q>.01||Q[0].l3.q>.01))),m?H?(H.p(Q,x),x&3&&J(H,1)):(H=Oo(Q),H.c(),J(H,1),H.m(e,_)):H&&(bt(),ie(H,1,1,()=>{H=null}),gt()),x&3&&(d=Zt(Q[1].ui.f,Q[0].l1&&(Q[0].l1.f>.01||Q[0].l2.f>.01||Q[0].l3.f>.01))),d?Z?(Z.p(Q,x),x&3&&J(Z,1)):(Z=Fo(Q),Z.c(),J(Z,1),Z.m(e,v)):Z&&(bt(),ie(Z,1,1,()=>{Z=null}),gt()),x&3&&(b=Zt(Q[1].ui.r,Q[0].ri>0||Q[0].re>0||Q[0].ric>0||Q[0].rec>0)),b?ne?(ne.p(Q,x),x&3&&J(ne,1)):(ne=Uo(Q),ne.c(),J(ne,1),ne.m(e,h)):ne&&(bt(),ie(ne,1,1,()=>{ne=null}),gt()),x&3&&(C=Zt(Q[1].ui.c,Q[0].ea)),C?X?(X.p(Q,x),x&3&&J(X,1)):(X=jo(Q),X.c(),J(X,1),X.m(e,k)):X&&(bt(),ie(X,1,1,()=>{X=null}),gt()),x&3&&(T=Zt(Q[1].ui.t,Q[0].pr&&(Q[0].pr.startsWith("NO")||Q[0].pr.startsWith("10YNO")||Q[0].pr.startsWith("10Y1001A1001A4")))),T?$?($.p(Q,x),x&3&&J($,1)):($=yo(Q),$.c(),J($,1),$.m(e,q)):$&&(bt(),ie($,1,1,()=>{$=null}),gt()),x&3&&(O=Zt(Q[1].ui.l,Q[0].hm==1)),O?ae?(ae.p(Q,x),x&3&&J(ae,1)):(ae=Ho(Q),ae.c(),J(ae,1),ae.m(e,M)):ae&&(bt(),ie(ae,1,1,()=>{ae=null}),gt()),x&3&&(U=Zt(Q[1].ui.p,Q[0].pe&&!Number.isNaN(Q[0].p))),U?le?(le.p(Q,x),x&3&&J(le,1)):(le=zo(Q),le.c(),J(le,1),le.m(e,I)):le&&(bt(),ie(le,1,1,()=>{le=null}),gt()),x&10&&(z=Zt(Q[1].ui.d,Q[3])),z?se?(se.p(Q,x),x&10&&J(se,1)):(se=Wo(Q),se.c(),J(se,1),se.m(e,y)):se&&(bt(),ie(se,1,1,()=>{se=null}),gt()),x&18&&(V=Zt(Q[1].ui.m,Q[4])),V?fe?(fe.p(Q,x),x&18&&J(fe,1)):(fe=Go(Q),fe.c(),J(fe,1),fe.m(e,R)):fe&&(bt(),ie(fe,1,1,()=>{fe=null}),gt()),x&35&&(F=Zt(Q[1].ui.s,Q[0].t&&Q[0].t!=-127&&Q[5].c>1)),F?re?(re.p(Q,x),x&35&&J(re,1)):(re=Vo(Q),re.c(),J(re,1),re.m(e,null)):re&&(bt(),ie(re,1,1,()=>{re=null}),gt())},i(Q){Y||(J(j),J(W),J(K),J(B),J(H),J(Z),J(ne),J(X),J($),J(ae),J(le),J(se),J(fe),J(re),Y=!0)},o(Q){ie(j),ie(W),ie(K),ie(B),ie(H),ie(Z),ie(ne),ie(X),ie($),ie(ae),ie(le),ie(se),ie(fe),ie(re),Y=!1},d(Q){Q&&P(e),j&&j.d(),W&&W.d(),K&&K.d(),B&&B.d(),H&&H.d(),Z&&Z.d(),ne&&ne.d(),X&&X.d(),$&&$.d(),ae&&ae.d(),le&&le.d(),se&&se.d(),fe&&fe.d(),re&&re.d()}}}function U0(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,{prices:s={}}=e,{dayPlot:a={}}=e,{monthPlot:r={}}=e,{temperatures:f={}}=e,{translations:u={}}=e,{tariffData:m={}}=e,_,d,v,b,h,C;return t.$$set=k=>{"data"in k&&l(0,n=k.data),"sysinfo"in k&&l(1,i=k.sysinfo),"prices"in k&&l(2,s=k.prices),"dayPlot"in k&&l(3,a=k.dayPlot),"monthPlot"in k&&l(4,r=k.monthPlot),"temperatures"in k&&l(5,f=k.temperatures),"translations"in k&&l(6,u=k.translations),"tariffData"in k&&l(7,m=k.tariffData)},t.$$.update=()=>{var k,T,q,O,M,U,I,z,y,V,R,F,Y,j,W;t.$$.dirty&1793&&(l(11,_=gl((n==null?void 0:n.ic)*1e3,"Wh")),l(12,d=gl((n==null?void 0:n.ec)*1e3,"Wh")),((k=n==null?void 0:n.l1)==null?void 0:k.u)==0&&((T=n==null?void 0:n.l2)==null?void 0:T.u)==0&&((q=n==null?void 0:n.l3)==null?void 0:q.u)==0?l(8,b=l(9,h=l(10,C=l(13,v=!0)))):(l(8,b=((O=n==null?void 0:n.l1)==null?void 0:O.u)>0||((M=n==null?void 0:n.l1)==null?void 0:M.i)>0||((U=n==null?void 0:n.l1)==null?void 0:U.p)>0||((I=n==null?void 0:n.l1)==null?void 0:I.q)>0),l(9,h=((z=n==null?void 0:n.l2)==null?void 0:z.u)>0||((y=n==null?void 0:n.l2)==null?void 0:y.i)>0||((V=n==null?void 0:n.l2)==null?void 0:V.p)>0||((R=n==null?void 0:n.l2)==null?void 0:R.q)>0),l(10,C=((F=n==null?void 0:n.l3)==null?void 0:F.u)>0||((Y=n==null?void 0:n.l3)==null?void 0:Y.i)>0||((j=n==null?void 0:n.l3)==null?void 0:j.p)>0||((W=n==null?void 0:n.l3)==null?void 0:W.q)>0),l(13,v=b&&h&&C)))},[n,i,s,a,r,f,u,m,b,h,C,_,d,v]}class j0 extends It{constructor(e){super(),Lt(this,e,U0,B0,Dt,{data:0,sysinfo:1,prices:2,dayPlot:3,monthPlot:4,temperatures:5,translations:6,tariffData:7})}}let ji={};const Gn=nl(ji);async function y0(){ji=await(await fetch("configuration.json")).json(),Gn.set(ji)}let yi={};const Ru=nl(yi);async function H0(){yi=await(await fetch("priceconfig.json")).json(),Ru.set(yi)}function Ko(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Yo(t){let e,l,n;return{c(){e=p("option"),e.textContent="UART0",l=g(),n=p("option"),n.textContent="UART2",e.__value=3,e.value=e.__value,n.__value=113,n.value=n.__value},m(i,s){E(i,e,s),E(i,l,s),E(i,n,s)},d(i){i&&P(e),i&&P(l),i&&P(n)}}}function Qo(t){let e,l,n;return{c(){e=p("option"),l=S("GPIO"),n=S(t[4]),e.__value=t[4],e.value=e.__value},m(i,s){E(i,e,s),o(e,l),o(e,n)},d(i){i&&P(e)}}}function Xo(t){let e,l=t[4]>1&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Qo(t);return{c(){l&&l.c(),e=$t()},m(n,i){l&&l.m(n,i),E(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Qo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&P(e)}}}function z0(t){let e,l,n,i,s=t[0]=="esp8266"&&Yo(),a={length:t[1]+1},r=[];for(let f=0;f{"chip"in s&&l(0,n=s.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=19);break}},[n,i]}class Hi extends It{constructor(e){super(),Lt(this,e,W0,z0,Dt,{chip:0})}}function Zo(t){let e,l,n=t[1]&&Jo(t);return{c(){e=p("div"),l=p("div"),n&&n.c(),c(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-80 flex items-center justify-center"),c(e,"class","z-50"),c(e,"aria-modal","true")},m(i,s){E(i,e,s),o(e,l),n&&n.m(l,null)},p(i,s){i[1]?n?n.p(i,s):(n=Jo(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&P(e),n&&n.d()}}}function Jo(t){let e,l;return{c(){e=p("div"),l=S(t[1]),c(e,"class","bg-white dark:bg-gray-600 m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 dark:text-white w-96")},m(n,i){E(n,e,i),o(e,l)},p(n,i){i&2&&A(l,n[1])},d(n){n&&P(e)}}}function G0(t){let e,l=t[0]&&Zo(t);return{c(){l&&l.c(),e=$t()},m(n,i){l&&l.m(n,i),E(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Zo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Ze,o:Ze,d(n){l&&l.d(n),n&&P(e)}}}function V0(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=s=>{"active"in s&&l(0,n=s.active),"message"in s&&l(1,i=s.message)},[n,i]}class hl extends It{constructor(e){super(),Lt(this,e,V0,G0,Dt,{active:0,message:1})}}function $o(t,e,l){const n=t.slice();return n[1]=e[l],n}function xo(t){let e,l,n=t[1]+"",i;return{c(){e=p("option"),l=S("Europe/"),i=S(n),e.__value="Europe/"+t[1],e.value=e.__value},m(s,a){E(s,e,a),o(e,l),o(e,i)},p:Ze,d(s){s&&P(e)}}}function K0(t){let e,l,n,i=t[0],s=[];for(let a=0;a>1&1,L=0;L0;w--)L[w]=L[w]?L[w-1]^M.EXPONENT[z._modN(M.LOG[L[w]]+N)]:L[w-1];L[0]=M.EXPONENT[z._modN(M.LOG[L[0]]+N)]}for(N=0;N<=D;N++)L[N]=M.LOG[L[N]]},_checkBadness:function(){var N,w,D,L,G,te=0,ee=this._badness,oe=this.buffer,ce=this.width;for(G=0;Gce*ce;)de-=ce*ce,Ce++;for(te+=Ce*z.N4,L=0;L=ee-2&&(N=ee-2,G>9&&N--);var oe=N;if(G>9){for(te[oe+2]=0,te[oe+3]=0;oe--;)w=te[oe],te[oe+3]|=255&w<<4,te[oe+2]=w>>4;te[2]|=255&N<<4,te[1]=N>>4,te[0]=64|N>>12}else{for(te[oe+1]=0,te[oe+2]=0;oe--;)w=te[oe],te[oe+2]|=255&w<<4,te[oe+1]=w>>4;te[1]|=255&N<<4,te[0]=64|N>>4}for(oe=N+3-(G<10);oe=5&&(D+=z.N1+L[w]-5);for(w=3;wN||L[w-3]*3>=L[w]*4||L[w+3]*3>=L[w]*4)&&(D+=z.N3);return D},_finish:function(){this._stringBuffer=this.buffer.slice();var N,w,D=0,L=3e4;for(w=0;w<8&&(this._applyMask(w),N=this._checkBadness(),N>=1)L&1&&(G[te-1-w+te*8]=1,w<6?G[8+te*w]=1:G[8+te*(w+1)]=1);for(w=0;w<7;w++,L>>=1)L&1&&(G[8+te*(te-7+w)]=1,w?G[6-w+te*8]=1:G[7+te*8]=1)},_interleaveBlocks:function(){var N,w,D=this._dataBlock,L=this._ecc,G=this._eccBlock,te=0,ee=this._calculateMaxLength(),oe=this._neccBlock1,ce=this._neccBlock2,Pe=this._stringBuffer;for(N=0;N1)for(N=k.BLOCK[L],D=G-7;;){for(w=G-7;w>N-3&&(this._addAlignment(w,D),!(w6)for(N=I.BLOCK[te-7],w=17,D=0;D<6;D++)for(L=0;L<3;L++,w--)1&(w>11?te>>w-12:N>>w)?(G[5-D+ee*(2-L+ee-11)]=1,G[2-L+ee-11+ee*(5-D)]=1):(this._setMask(5-D,2-L+ee-11),this._setMask(2-L+ee-11,5-D))},_isMasked:function(N,w){var D=z._getMaskBit(N,w);return this._mask[D]===1},_pack:function(){var N,w,D,L=1,G=1,te=this.width,ee=te-1,oe=te-1,ce=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(w=0;ww&&(D=N,N=w,w=D),D=w,D+=w*w,D>>=1,D+=N,D},_modN:function(N){for(;N>=255;)N-=255,N=(N>>8)+(N&255);return N},N1:3,N2:3,N3:40,N4:10}),y=z,V=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var N=this.element;N.width=N.height=this.qrious.size}}),R=V,F=_.extend(function(N,w,D,L){this.name=N,this.modifiable=Boolean(w),this.defaultValue=D,this._valueTransformer=L},{transform:function(N){var w=this._valueTransformer;return typeof w=="function"?w(N,this):N}}),Y=F,j=_.extend(null,{abs:function(N){return N!=null?Math.abs(N):null},hasOwn:function(N,w){return Object.prototype.hasOwnProperty.call(N,w)},noop:function(){},toUpperCase:function(N){return N!=null?N.toUpperCase():null}}),W=j,K=_.extend(function(N){this.options={},N.forEach(function(w){this.options[w.name]=w},this)},{exists:function(N){return this.options[N]!=null},get:function(N,w){return K._get(this.options[N],w)},getAll:function(N){var w,D=this.options,L={};for(w in D)W.hasOwn(D,w)&&(L[w]=K._get(D[w],N));return L},init:function(N,w,D){typeof D!="function"&&(D=W.noop);var L,G;for(L in this.options)W.hasOwn(this.options,L)&&(G=this.options[L],K._set(G,G.defaultValue,w),K._createAccessor(G,w,D));this._setAll(N,w,!0)},set:function(N,w,D){return this._set(N,w,D)},setAll:function(N,w){return this._setAll(N,w)},_set:function(N,w,D,L){var G=this.options[N];if(!G)throw new Error("Invalid option: "+N);if(!G.modifiable&&!L)throw new Error("Option cannot be modified: "+N);return K._set(G,w,D)},_setAll:function(N,w,D){if(!N)return!1;var L,G=!1;for(L in N)W.hasOwn(N,L)&&this._set(L,N[L],w,D)&&(G=!0);return G}},{_createAccessor:function(N,w,D){var L={get:function(){return K._get(N,w)}};N.modifiable&&(L.set=function(G){K._set(N,G,w)&&D(G,N)}),Object.defineProperty(w,N.name,L)},_get:function(N,w){return w["_"+N.name]},_set:function(N,w,D){var L="_"+N.name,G=D[L],te=N.transform(w!=null?w:N.defaultValue);return D[L]=te,te!==G}}),B=K,H=_.extend(function(){this._services={}},{getService:function(N){var w=this._services[N];if(!w)throw new Error("Service is not being managed with name: "+N);return w},setService:function(N,w){if(this._services[N])throw new Error("Service is already managed with name: "+N);w&&(this._services[N]=w)}}),Z=H,ne=new B([new Y("background",!0,"white"),new Y("backgroundAlpha",!0,1,W.abs),new Y("element"),new Y("foreground",!0,"black"),new Y("foregroundAlpha",!0,1,W.abs),new Y("level",!0,"L",W.toUpperCase),new Y("mime",!0,"image/png"),new Y("padding",!0,null,W.abs),new Y("size",!0,100,W.abs),new Y("value",!0,"")]),X=new Z,$=_.extend(function(N){ne.init(N,this,this.update.bind(this));var w=ne.get("element",this),D=X.getService("element"),L=w&&D.isCanvas(w)?w:D.createCanvas(),G=w&&D.isImage(w)?w:D.createImage();this._canvasRenderer=new h(this,L,!0),this._imageRenderer=new R(this,G,G===w),this.update()},{get:function(){return ne.getAll(this)},set:function(N){ne.setAll(N,this)&&this.update()},toDataURL:function(N){return this.canvas.toDataURL(N||this.mime)},update:function(){var N=new y({level:this.level,value:this.value});this._canvasRenderer.render(N),this._imageRenderer.render(N)}},{use:function(N){X.setService(N.getName(),N)}});Object.defineProperties($.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var ae=$,le=ae,se=_.extend({getName:function(){}}),fe=se,re=fe.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(N){},isImage:function(N){}}),Q=re,x=Q.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(N){return N instanceof HTMLCanvasElement},isImage:function(N){return N instanceof HTMLImageElement}}),ge=x;le.use(new ge);var pe=le;return pe})})(Bu);const J0=Bu.exports;function $0(t){let e,l;return{c(){e=p("img"),fi(e.src,l=t[2])||c(e,"src",l),c(e,"alt",t[0]),c(e,"class",t[1])},m(n,i){E(n,e,i)},p(n,[i]){i&4&&!fi(e.src,l=n[2])&&c(e,"src",l),i&1&&c(e,"alt",n[0]),i&2&&c(e,"class",n[1])},i:Ze,o:Ze,d(n){n&&P(e)}}}function x0(t,e,l){const n=new J0;let{errorCorrection:i="L"}=e,{background:s="#fff"}=e,{color:a="#000"}=e,{size:r="200"}=e,{value:f=""}=e,{padding:u=0}=e,{className:m="qrcode"}=e,_="";function d(){n.set({background:s,foreground:a,level:i,padding:u,size:r,value:f}),l(2,_=n.toDataURL("image/jpeg"))}return Vf(()=>{d()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,s=v.background),"color"in v&&l(5,a=v.color),"size"in v&&l(6,r=v.size),"value"in v&&l(0,f=v.value),"padding"in v&&l(7,u=v.padding),"className"in v&&l(1,m=v.className)},t.$$.update=()=>{t.$$.dirty&1&&f&&d()},[f,m,_,i,s,a,r,u]}class ec extends It{constructor(e){super(),Lt(this,e,x0,$0,Dt,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function ea(t,e,l){const n=t.slice();return n[113]=e[l],n}function ta(t,e,l){const n=t.slice();return n[116]=e[l],n[117]=e,n[118]=l,n}function la(t,e,l){const n=t.slice();return n[119]=e[l],n[120]=e,n[121]=l,n}function tc(t,e,l){const n=t.slice();return n[122]=e[l],n}function lc(t,e,l){const n=t.slice();return n[125]=e[l],n}function na(t){var Ge,Qt,el,xt,Se,Re,Fe,il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl,Be,et,je,he,Kt,wl,Cl,Sl,Ml,Nl,Tl,Pl,El,Dl,Rl,Fl,Bl,Ul;let e,l,n=((el=(Qt=(Ge=t[2].conf)==null?void 0:Ge.general)==null?void 0:Qt.title)!=null?el:"General")+"",i,s,a,r,f,u,m,_,d,v,b=((Re=(Se=(xt=t[2].conf)==null?void 0:xt.general)==null?void 0:Se.hostname)!=null?Re:"Hostname")+"",h,C,k,T,q,O,M=((sl=(il=(Fe=t[2].conf)==null?void 0:Fe.general)==null?void 0:il.timezone)!=null?sl:"Time zone")+"",U,I,z,y,V,R,F,Y,j,W,K,B=((fl=(al=(ol=t[2].conf)==null?void 0:ol.price)==null?void 0:al.region)!=null?fl:"Price region")+"",H,Z,ne,X,$,ae,le,se,fe,re,Q,x,ge,pe,N,w,D,L,G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je=((cl=(rl=(ul=t[2].conf)==null?void 0:ul.price)==null?void 0:rl.currency)!=null?cl:"Currency")+"",it,We,_t,Ee,_e,Ue,kt,wt,nt,vt,ze,Ke,Ye=((pl=(_l=(ml=t[2].conf)==null?void 0:ml.price)==null?void 0:_l.enabled)!=null?pl:"Enabled")+"",Xe,Qe,ut,we,Ae=((je=(et=(Be=(dl=t[2].conf)==null?void 0:dl.general)==null?void 0:Be.security)==null?void 0:et.title)!=null?je:"Security")+"",ke,ue,De,rt,st,at=((Cl=(wl=(Kt=(he=t[2].conf)==null?void 0:he.general)==null?void 0:Kt.security)==null?void 0:wl.none)!=null?Cl:"None")+"",pt,ht,Rt=((Tl=(Nl=(Ml=(Sl=t[2].conf)==null?void 0:Sl.general)==null?void 0:Ml.security)==null?void 0:Nl.conf)!=null?Tl:"Conf")+"",Pt,ct,Ft=((Rl=(Dl=(El=(Pl=t[2].conf)==null?void 0:Pl.general)==null?void 0:El.security)==null?void 0:Dl.all)!=null?Rl:"All")+"",zt,Bt,Ut,qt,yt=((Ul=(Bl=(Fl=t[2].conf)==null?void 0:Fl.general)==null?void 0:Bl.context)!=null?Ul:"Context")+"",Gt,Vt,Yt,Ct,Mt,ft,Nt,Et;V=new Q0({});let dt=!t[6].p.t&&ia(),At=["NOK","SEK","DKK","EUR","CHF"],St=[];for(let tt=0;tt<5;tt+=1)St[tt]=nc(lc(t,At,tt));kt=new Al({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[ic]},$$scope:{ctx:t}}});let mt=t[6].p.e&&t[0].chip!="esp8266"&&sa(t),qe=t[6].g.s>0&&oa(t);return{c(){var tt,Ot,vl;e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),d=p("div"),v=p("div"),h=S(b),C=p("br"),k=g(),T=p("input"),q=g(),O=p("div"),U=S(M),I=p("br"),z=g(),y=p("select"),Oe(V.$$.fragment),R=g(),F=p("input"),Y=g(),j=p("div"),W=p("div"),K=p("div"),H=S(B),Z=p("br"),ne=g(),X=p("select"),$=p("optgroup"),dt&&dt.c(),ae=p("option"),ae.textContent="NO1",le=p("option"),le.textContent="NO2",se=p("option"),se.textContent="NO3",fe=p("option"),fe.textContent="NO4",re=p("option"),re.textContent="NO5",Q=p("optgroup"),x=p("option"),x.textContent="SE1",ge=p("option"),ge.textContent="SE2",pe=p("option"),pe.textContent="SE3",N=p("option"),N.textContent="SE4",w=p("optgroup"),D=p("option"),D.textContent="DK1",L=p("option"),L.textContent="DK2",G=p("option"),G.textContent="Austria",te=p("option"),te.textContent="Belgium",ee=p("option"),ee.textContent="Czech Republic",oe=p("option"),oe.textContent="Estonia",ce=p("option"),ce.textContent="Finland",Pe=p("option"),Pe.textContent="France",Ce=p("option"),Ce.textContent="Germany",de=p("option"),de.textContent="Great Britain",Ne=p("option"),Ne.textContent="Latvia",Te=p("option"),Te.textContent="Lithuania",ve=p("option"),ve.textContent="Netherland",be=p("option"),be.textContent="Poland",He=p("option"),He.textContent="Slovenia",ye=p("option"),ye.textContent="Switzerland",Ve=g(),xe=p("div"),it=S(Je),We=p("br"),_t=g(),Ee=p("select");for(let bl=0;bl<5;bl+=1)St[bl].c();_e=g(),Ue=p("div"),Oe(kt.$$.fragment),wt=g(),nt=p("div"),vt=p("label"),ze=p("input"),Ke=g(),Xe=S(Ye),Qe=g(),mt&&mt.c(),ut=g(),we=p("div"),ke=S(Ae),ue=p("br"),De=g(),rt=p("select"),st=p("option"),pt=S(at),ht=p("option"),Pt=S(Rt),ct=p("option"),zt=S(Ft),Bt=g(),qe&&qe.c(),Ut=g(),qt=p("div"),Gt=S(yt),Vt=p("br"),Yt=g(),Ct=p("input"),c(l,"class","text-sm"),c(a,"href",ql("General-configuration")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","g"),u.value="true",c(T,"name","gh"),c(T,"type","text"),c(T,"class","in-f w-full"),c(T,"pattern","[A-Za-z0-9-]+"),c(y,"name","gt"),c(y,"class","in-l w-full"),t[6].g.t===void 0&&Wt(()=>t[23].call(y)),c(d,"class","flex"),c(_,"class","my-1"),c(F,"type","hidden"),c(F,"name","p"),F.value="true",ae.__value="10YNO-1--------2",ae.value=ae.__value,le.__value="10YNO-2--------T",le.value=le.__value,se.__value="10YNO-3--------J",se.value=se.__value,fe.__value="10YNO-4--------9",fe.value=fe.__value,re.__value="10Y1001A1001A48H",re.value=re.__value,c($,"label","Norway"),x.__value="10Y1001A1001A44P",x.value=x.__value,ge.__value="10Y1001A1001A45N",ge.value=ge.__value,pe.__value="10Y1001A1001A46L",pe.value=pe.__value,N.__value="10Y1001A1001A47J",N.value=N.__value,c(Q,"label","Sweden"),D.__value="10YDK-1--------W",D.value=D.__value,L.__value="10YDK-2--------M",L.value=L.__value,c(w,"label","Denmark"),G.__value="10YAT-APG------L",G.value=G.__value,te.__value="10YBE----------2",te.value=te.__value,ee.__value="10YCZ-CEPS-----N",ee.value=ee.__value,oe.__value="10Y1001A1001A39I",oe.value=oe.__value,ce.__value="10YFI-1--------U",ce.value=ce.__value,Pe.__value="10YFR-RTE------C",Pe.value=Pe.__value,Ce.__value="10Y1001A1001A83F",Ce.value=Ce.__value,de.__value="10YGB----------A",de.value=de.__value,Ne.__value="10YLV-1001A00074",Ne.value=Ne.__value,Te.__value="10YLT-1001A0008Q",Te.value=Te.__value,ve.__value="10YNL----------L",ve.value=ve.__value,be.__value="10YPL-AREA-----S",be.value=be.__value,He.__value="10YSI-ELES-----O",He.value=He.__value,ye.__value="10YCH-SWISSGRIDZ",ye.value=ye.__value,c(X,"name","pr"),c(X,"class","in-f w-full"),t[6].p.r===void 0&&Wt(()=>t[24].call(X)),c(K,"class","w-full"),c(Ee,"name","pc"),c(Ee,"class","in-l"),t[6].p.c===void 0&&Wt(()=>t[25].call(Ee)),c(W,"class","flex"),c(j,"class","my-1"),c(Ue,"class","my-1"),c(ze,"type","checkbox"),c(ze,"name","pe"),ze.__value="true",ze.value=ze.__value,c(ze,"class","rounded mb-1"),c(nt,"class","my-1"),st.__value=0,st.value=st.__value,ht.__value=1,ht.value=ht.__value,ct.__value=2,ct.value=ct.__value,c(rt,"name","gs"),c(rt,"class","in-s"),t[6].g.s===void 0&&Wt(()=>t[28].call(rt)),c(we,"class","my-1"),c(Ct,"name","gc"),c(Ct,"type","text"),c(Ct,"pattern","[A-Za-z0-9]+"),c(Ct,"placeholder",Mt=(vl=(Ot=(tt=t[2].conf)==null?void 0:tt.general)==null?void 0:Ot.context_placeholder)!=null?vl:"/"),c(Ct,"class","in-s"),c(Ct,"maxlength","36"),c(qt,"class","my-1"),c(e,"class","cnt")},m(tt,Ot){E(tt,e,Ot),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,d),o(d,v),o(v,h),o(v,C),o(v,k),o(v,T),Me(T,t[6].g.h),o(d,q),o(d,O),o(O,U),o(O,I),o(O,z),o(O,y),Le(V,y,null),ot(y,t[6].g.t,!0),o(e,R),o(e,F),o(e,Y),o(e,j),o(j,W),o(W,K),o(K,H),o(K,Z),o(K,ne),o(K,X),o(X,$),dt&&dt.m($,null),o($,ae),o($,le),o($,se),o($,fe),o($,re),o(X,Q),o(Q,x),o(Q,ge),o(Q,pe),o(Q,N),o(X,w),o(w,D),o(w,L),o(X,G),o(X,te),o(X,ee),o(X,oe),o(X,ce),o(X,Pe),o(X,Ce),o(X,de),o(X,Ne),o(X,Te),o(X,ve),o(X,be),o(X,He),o(X,ye),ot(X,t[6].p.r,!0),o(W,Ve),o(W,xe),o(xe,it),o(xe,We),o(xe,_t),o(xe,Ee);for(let vl=0;vl<5;vl+=1)St[vl]&&St[vl].m(Ee,null);ot(Ee,t[6].p.c,!0),o(e,_e),o(e,Ue),Le(kt,Ue,null),o(e,wt),o(e,nt),o(nt,vt),o(vt,ze),ze.checked=t[6].p.e,o(vt,Ke),o(vt,Xe),o(nt,Qe),mt&&mt.m(nt,null),o(e,ut),o(e,we),o(we,ke),o(we,ue),o(we,De),o(we,rt),o(rt,st),o(st,pt),o(rt,ht),o(ht,Pt),o(rt,ct),o(ct,zt),ot(rt,t[6].g.s,!0),o(e,Bt),qe&&qe.m(e,null),o(e,Ut),o(e,qt),o(qt,Gt),o(qt,Vt),o(qt,Yt),o(qt,Ct),Me(Ct,t[6].g.c),ft=!0,Nt||(Et=[me(T,"input",t[22]),me(y,"change",t[23]),me(X,"change",t[24]),me(Ee,"change",t[25]),me(ze,"change",t[26]),me(rt,"change",t[28]),me(Ct,"input",t[31])],Nt=!0)},p(tt,Ot){var bl,pn,dn,vn,hn,bn,gn,kn,wn,Cn,Sn,Mn,Nn,Tn,Pn,En,Dn,qn,An,Ln,In,On,Rn,Fn,Bn,Un,jn,yn,Hn,as,fs,us,rs,cs,ms,_s,ps,ds,vs,hs;(!ft||Ot[0]&4)&&n!==(n=((dn=(pn=(bl=tt[2].conf)==null?void 0:bl.general)==null?void 0:pn.title)!=null?dn:"General")+"")&&A(i,n),(!ft||Ot[0]&4)&&b!==(b=((bn=(hn=(vn=tt[2].conf)==null?void 0:vn.general)==null?void 0:hn.hostname)!=null?bn:"Hostname")+"")&&A(h,b),Ot[0]&64&&T.value!==tt[6].g.h&&Me(T,tt[6].g.h),(!ft||Ot[0]&4)&&M!==(M=((wn=(kn=(gn=tt[2].conf)==null?void 0:gn.general)==null?void 0:kn.timezone)!=null?wn:"Time zone")+"")&&A(U,M),Ot[0]&64&&ot(y,tt[6].g.t),(!ft||Ot[0]&4)&&B!==(B=((Mn=(Sn=(Cn=tt[2].conf)==null?void 0:Cn.price)==null?void 0:Sn.region)!=null?Mn:"Price region")+"")&&A(H,B),tt[6].p.t?dt&&(dt.d(1),dt=null):dt||(dt=ia(),dt.c(),dt.m($,ae)),Ot[0]&64&&ot(X,tt[6].p.r),(!ft||Ot[0]&4)&&Je!==(Je=((Pn=(Tn=(Nn=tt[2].conf)==null?void 0:Nn.price)==null?void 0:Tn.currency)!=null?Pn:"Currency")+"")&&A(it,Je),Ot[0]&64&&ot(Ee,tt[6].p.c);const vl={};Ot[0]&4|Ot[4]&16&&(vl.$$scope={dirty:Ot,ctx:tt}),kt.$set(vl),Ot[0]&64&&(ze.checked=tt[6].p.e),(!ft||Ot[0]&4)&&Ye!==(Ye=((qn=(Dn=(En=tt[2].conf)==null?void 0:En.price)==null?void 0:Dn.enabled)!=null?qn:"Enabled")+"")&&A(Xe,Ye),tt[6].p.e&&tt[0].chip!="esp8266"?mt?mt.p(tt,Ot):(mt=sa(tt),mt.c(),mt.m(nt,null)):mt&&(mt.d(1),mt=null),(!ft||Ot[0]&4)&&Ae!==(Ae=((On=(In=(Ln=(An=tt[2].conf)==null?void 0:An.general)==null?void 0:Ln.security)==null?void 0:In.title)!=null?On:"Security")+"")&&A(ke,Ae),(!ft||Ot[0]&4)&&at!==(at=((Un=(Bn=(Fn=(Rn=tt[2].conf)==null?void 0:Rn.general)==null?void 0:Fn.security)==null?void 0:Bn.none)!=null?Un:"None")+"")&&A(pt,at),(!ft||Ot[0]&4)&&Rt!==(Rt=((as=(Hn=(yn=(jn=tt[2].conf)==null?void 0:jn.general)==null?void 0:yn.security)==null?void 0:Hn.conf)!=null?as:"Conf")+"")&&A(Pt,Rt),(!ft||Ot[0]&4)&&Ft!==(Ft=((cs=(rs=(us=(fs=tt[2].conf)==null?void 0:fs.general)==null?void 0:us.security)==null?void 0:rs.all)!=null?cs:"All")+"")&&A(zt,Ft),Ot[0]&64&&ot(rt,tt[6].g.s),tt[6].g.s>0?qe?qe.p(tt,Ot):(qe=oa(tt),qe.c(),qe.m(e,Ut)):qe&&(qe.d(1),qe=null),(!ft||Ot[0]&4)&&yt!==(yt=((ps=(_s=(ms=tt[2].conf)==null?void 0:ms.general)==null?void 0:_s.context)!=null?ps:"Context")+"")&&A(Gt,yt),(!ft||Ot[0]&4&&Mt!==(Mt=(hs=(vs=(ds=tt[2].conf)==null?void 0:ds.general)==null?void 0:vs.context_placeholder)!=null?hs:"/"))&&c(Ct,"placeholder",Mt),Ot[0]&64&&Ct.value!==tt[6].g.c&&Me(Ct,tt[6].g.c)},i(tt){ft||(J(V.$$.fragment,tt),J(kt.$$.fragment,tt),ft=!0)},o(tt){ie(V.$$.fragment,tt),ie(kt.$$.fragment,tt),ft=!1},d(tt){tt&&P(e),Ie(V),dt&&dt.d(),ll(St,tt),Ie(kt),mt&&mt.d(),qe&&qe.d(),Nt=!1,Ht(Et)}}}function ia(t){let e,l,n,i,s;return{c(){e=p("option"),e.textContent="NO1 with support",l=p("option"),l.textContent="NO2 with support",n=p("option"),n.textContent="NO3 with support",i=p("option"),i.textContent="NO4 with support",s=p("option"),s.textContent="NO5 with support",e.__value="NO1S",e.value=e.__value,l.__value="NO2S",l.value=l.__value,n.__value="NO3S",n.value=n.__value,i.__value="NO4S",i.value=i.__value,s.__value="NO5S",s.value=s.__value},m(a,r){E(a,e,r),E(a,l,r),E(a,n,r),E(a,i,r),E(a,s,r)},d(a){a&&P(e),a&&P(l),a&&P(n),a&&P(i),a&&P(s)}}}function nc(t){let e,l;return{c(){e=p("option"),l=S(t[125]),e.__value=t[125],e.value=e.__value},m(n,i){E(n,e,i),o(e,l)},p:Ze,d(n){n&&P(e)}}}function ic(t){var n,i,s;let e=((s=(i=(n=t[2].conf)==null?void 0:n.price)==null?void 0:i.conf)!=null?s:"Configure")+"",l;return{c(){l=S(e)},m(a,r){E(a,l,r)},p(a,r){var f,u,m;r[0]&4&&e!==(e=((m=(u=(f=a[2].conf)==null?void 0:f.price)==null?void 0:u.conf)!=null?m:"Configure")+"")&&A(l,e)},d(a){a&&P(l)}}}function sa(t){let e,l,n,i,s;return{c(){var a,r,f;e=p("br"),l=p("input"),c(l,"name","pt"),c(l,"type","text"),c(l,"class","in-s"),c(l,"placeholder",n=(f=(r=(a=t[2].conf)==null?void 0:a.price)==null?void 0:r.api_key_placeholder)!=null?f:"")},m(a,r){E(a,e,r),E(a,l,r),Me(l,t[6].p.t),i||(s=me(l,"input",t[27]),i=!0)},p(a,r){var f,u,m;r[0]&4&&n!==(n=(m=(u=(f=a[2].conf)==null?void 0:f.price)==null?void 0:u.api_key_placeholder)!=null?m:"")&&c(l,"placeholder",n),r[0]&64&&l.value!==a[6].p.t&&Me(l,a[6].p.t)},d(a){a&&P(e),a&&P(l),i=!1,s()}}}function oa(t){var C,k,T,q,O,M,U,I;let e,l=((q=(T=(k=(C=t[2].conf)==null?void 0:C.general)==null?void 0:k.security)==null?void 0:T.username)!=null?q:"Username")+"",n,i,s,a,r,f,u=((I=(U=(M=(O=t[2].conf)==null?void 0:O.general)==null?void 0:M.security)==null?void 0:U.password)!=null?I:"Password")+"",m,_,d,v,b,h;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),r=g(),f=p("div"),m=S(u),_=p("br"),d=g(),v=p("input"),c(a,"name","gu"),c(a,"type","text"),c(a,"class","in-s"),c(a,"maxlength","36"),c(e,"class","my-1"),c(v,"name","gp"),c(v,"type","password"),c(v,"class","in-s"),c(v,"maxlength","36"),c(f,"class","my-1")},m(z,y){E(z,e,y),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].g.u),E(z,r,y),E(z,f,y),o(f,m),o(f,_),o(f,d),o(f,v),Me(v,t[6].g.p),b||(h=[me(a,"input",t[29]),me(v,"input",t[30])],b=!0)},p(z,y){var V,R,F,Y,j,W,K,B;y[0]&4&&l!==(l=((Y=(F=(R=(V=z[2].conf)==null?void 0:V.general)==null?void 0:R.security)==null?void 0:F.username)!=null?Y:"Username")+"")&&A(n,l),y[0]&64&&a.value!==z[6].g.u&&Me(a,z[6].g.u),y[0]&4&&u!==(u=((B=(K=(W=(j=z[2].conf)==null?void 0:j.general)==null?void 0:W.security)==null?void 0:K.password)!=null?B:"Password")+"")&&A(m,u),y[0]&64&&v.value!==z[6].g.p&&Me(v,z[6].g.p)},d(z){z&&P(e),z&&P(r),z&&P(f),b=!1,Ht(h)}}}function aa(t){var ut,we,Ae,ke,ue,De,rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt;let e,l,n=((Ae=(we=(ut=t[2].conf)==null?void 0:ut.meter)==null?void 0:we.title)!=null?Ae:"Meter")+"",i,s,a,r,f,u,m,_,d,v,b=((rt=(De=(ue=(ke=t[2].conf)==null?void 0:ke.meter)==null?void 0:ue.comm)==null?void 0:De.title)!=null?rt:"Communication")+"",h,C,k,T,q,O=((ht=(pt=(at=(st=t[2].conf)==null?void 0:st.meter)==null?void 0:at.comm)==null?void 0:pt.passive)!=null?ht:"Passive")+"",M,U,I=((Ft=(ct=(Pt=(Rt=t[2].conf)==null?void 0:Rt.meter)==null?void 0:Pt.comm)==null?void 0:ct.pulse)!=null?Ft:"Pulse")+"",z,y=(Bt=(zt=t[0])==null?void 0:zt.features)==null?void 0:Bt.includes("kmp"),V,R,F,Y=((qt=(Ut=t[2].common)==null?void 0:Ut.voltage)!=null?qt:"Voltage")+"",j,W,K,B,H,Z,ne,X,$,ae=((Vt=(Gt=(yt=t[2].conf)==null?void 0:yt.meter)==null?void 0:Gt.fuse)!=null?Vt:"Main fuse")+"",le,se,fe,re,Q,x,ge,pe,N,w=((Mt=(Ct=(Yt=t[2].conf)==null?void 0:Yt.meter)==null?void 0:Ct.prod)!=null?Mt:"Production")+"",D,L,G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He=((Et=(Nt=(ft=t[2].conf)==null?void 0:ft.meter)==null?void 0:Nt.encrypted)!=null?Et:"Encrypted")+"",ye,Ve,xe,Je,it,We,_t,Ee=((mt=(St=(At=(dt=t[2].conf)==null?void 0:dt.meter)==null?void 0:At.multipliers)==null?void 0:St.title)!=null?mt:"Multipliers")+"",_e,Ue,kt,wt,nt=y&&fa();function vt(qe,Ge){return qe[6].m.a===2?oc:sc}let ze=vt(t),Ke=ze(t),Ye=t[6].m.e.e&&ua(t),Xe=t[6].m.e.e&&ra(t),Qe=t[6].m.m.e&&ca(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("input"),d=g(),v=p("div"),h=S(b),C=p("br"),k=g(),T=p("select"),q=p("option"),M=S(O),U=p("option"),z=S(I),nt&&nt.c(),V=g(),Ke.c(),R=g(),F=p("div"),j=S(Y),W=p("br"),K=g(),B=p("select"),H=p("option"),H.textContent="400V (TN)",Z=p("option"),Z.textContent="230V (IT/TT)",ne=g(),X=p("div"),$=p("div"),le=S(ae),se=p("br"),fe=g(),re=p("label"),Q=p("input"),x=g(),ge=p("span"),ge.textContent="A",pe=g(),N=p("div"),D=S(w),L=p("br"),G=g(),te=p("label"),ee=p("input"),oe=g(),ce=p("span"),ce.textContent="kWp",Pe=g(),Ce=p("div"),de=g(),Ne=p("div"),Te=p("label"),ve=p("input"),be=g(),ye=S(He),Ve=g(),Ye&&Ye.c(),xe=g(),Xe&&Xe.c(),Je=g(),it=p("label"),We=p("input"),_t=g(),_e=S(Ee),Ue=g(),Qe&&Qe.c(),c(l,"class","text-sm"),c(a,"href",ql("Meter-configuration")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","m"),u.value="true",c(_,"type","hidden"),c(_,"name","mo"),_.value="1",q.__value=0,q.value=q.__value,U.__value=2,U.value=U.__value,c(T,"name","ma"),c(T,"class","in-s"),t[6].m.a===void 0&&Wt(()=>t[32].call(T)),c(v,"class","my-1"),H.__value=2,H.value=H.__value,Z.__value=1,Z.value=Z.__value,c(B,"name","md"),c(B,"class","in-s"),t[6].m.d===void 0&&Wt(()=>t[38].call(B)),c(F,"class","my-1"),c(Q,"name","mf"),c(Q,"type","number"),c(Q,"min","5"),c(Q,"max","65535"),c(Q,"class","in-f tr w-full"),c(ge,"class","in-post"),c(re,"class","flex"),c($,"class","mx-1"),c(ee,"name","mr"),c(ee,"type","number"),c(ee,"min","0"),c(ee,"max","65535"),c(ee,"class","in-f tr w-full"),c(ce,"class","in-post"),c(te,"class","flex"),c(N,"class","mx-1"),c(X,"class","my-1 flex"),c(Ce,"class","my-1"),c(ve,"type","checkbox"),c(ve,"name","me"),ve.__value="true",ve.value=ve.__value,c(ve,"class","rounded mb-1"),c(Ne,"class","my-1"),c(We,"type","checkbox"),c(We,"name","mm"),We.__value="true",We.value=We.__value,c(We,"class","rounded mb-1"),c(e,"class","cnt")},m(qe,Ge){E(qe,e,Ge),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(e,d),o(e,v),o(v,h),o(v,C),o(v,k),o(v,T),o(T,q),o(q,M),o(T,U),o(U,z),nt&&nt.m(T,null),ot(T,t[6].m.a,!0),o(e,V),Ke.m(e,null),o(e,R),o(e,F),o(F,j),o(F,W),o(F,K),o(F,B),o(B,H),o(B,Z),ot(B,t[6].m.d,!0),o(e,ne),o(e,X),o(X,$),o($,le),o($,se),o($,fe),o($,re),o(re,Q),Me(Q,t[6].m.f),o(re,x),o(re,ge),o(X,pe),o(X,N),o(N,D),o(N,L),o(N,G),o(N,te),o(te,ee),Me(ee,t[6].m.r),o(te,oe),o(te,ce),o(e,Pe),o(e,Ce),o(e,de),o(e,Ne),o(Ne,Te),o(Te,ve),ve.checked=t[6].m.e.e,o(Te,be),o(Te,ye),o(Ne,Ve),Ye&&Ye.m(Ne,null),o(e,xe),Xe&&Xe.m(e,null),o(e,Je),o(e,it),o(it,We),We.checked=t[6].m.m.e,o(it,_t),o(it,_e),o(e,Ue),Qe&&Qe.m(e,null),kt||(wt=[me(T,"change",t[32]),me(B,"change",t[38]),me(Q,"input",t[39]),me(ee,"input",t[40]),me(ve,"change",t[41]),me(We,"change",t[44])],kt=!0)},p(qe,Ge){var Qt,el,xt,Se,Re,Fe,il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl,Be,et,je,he,Kt,wl,Cl,Sl,Ml,Nl,Tl,Pl,El,Dl;Ge[0]&4&&n!==(n=((xt=(el=(Qt=qe[2].conf)==null?void 0:Qt.meter)==null?void 0:el.title)!=null?xt:"Meter")+"")&&A(i,n),Ge[0]&4&&b!==(b=((il=(Fe=(Re=(Se=qe[2].conf)==null?void 0:Se.meter)==null?void 0:Re.comm)==null?void 0:Fe.title)!=null?il:"Communication")+"")&&A(h,b),Ge[0]&4&&O!==(O=((fl=(al=(ol=(sl=qe[2].conf)==null?void 0:sl.meter)==null?void 0:ol.comm)==null?void 0:al.passive)!=null?fl:"Passive")+"")&&A(M,O),Ge[0]&4&&I!==(I=((ml=(cl=(rl=(ul=qe[2].conf)==null?void 0:ul.meter)==null?void 0:rl.comm)==null?void 0:cl.pulse)!=null?ml:"Pulse")+"")&&A(z,I),Ge[0]&1&&(y=(pl=(_l=qe[0])==null?void 0:_l.features)==null?void 0:pl.includes("kmp")),y?nt||(nt=fa(),nt.c(),nt.m(T,null)):nt&&(nt.d(1),nt=null),Ge[0]&64&&ot(T,qe[6].m.a),ze===(ze=vt(qe))&&Ke?Ke.p(qe,Ge):(Ke.d(1),Ke=ze(qe),Ke&&(Ke.c(),Ke.m(e,R))),Ge[0]&4&&Y!==(Y=((Be=(dl=qe[2].common)==null?void 0:dl.voltage)!=null?Be:"Voltage")+"")&&A(j,Y),Ge[0]&64&&ot(B,qe[6].m.d),Ge[0]&4&&ae!==(ae=((he=(je=(et=qe[2].conf)==null?void 0:et.meter)==null?void 0:je.fuse)!=null?he:"Main fuse")+"")&&A(le,ae),Ge[0]&64&&$e(Q.value)!==qe[6].m.f&&Me(Q,qe[6].m.f),Ge[0]&4&&w!==(w=((Cl=(wl=(Kt=qe[2].conf)==null?void 0:Kt.meter)==null?void 0:wl.prod)!=null?Cl:"Production")+"")&&A(D,w),Ge[0]&64&&$e(ee.value)!==qe[6].m.r&&Me(ee,qe[6].m.r),Ge[0]&64&&(ve.checked=qe[6].m.e.e),Ge[0]&4&&He!==(He=((Nl=(Ml=(Sl=qe[2].conf)==null?void 0:Sl.meter)==null?void 0:Ml.encrypted)!=null?Nl:"Encrypted")+"")&&A(ye,He),qe[6].m.e.e?Ye?Ye.p(qe,Ge):(Ye=ua(qe),Ye.c(),Ye.m(Ne,null)):Ye&&(Ye.d(1),Ye=null),qe[6].m.e.e?Xe?Xe.p(qe,Ge):(Xe=ra(qe),Xe.c(),Xe.m(e,Je)):Xe&&(Xe.d(1),Xe=null),Ge[0]&64&&(We.checked=qe[6].m.m.e),Ge[0]&4&&Ee!==(Ee=((Dl=(El=(Pl=(Tl=qe[2].conf)==null?void 0:Tl.meter)==null?void 0:Pl.multipliers)==null?void 0:El.title)!=null?Dl:"Multipliers")+"")&&A(_e,Ee),qe[6].m.m.e?Qe?Qe.p(qe,Ge):(Qe=ca(qe),Qe.c(),Qe.m(e,null)):Qe&&(Qe.d(1),Qe=null)},d(qe){qe&&P(e),nt&&nt.d(),Ke.d(),Ye&&Ye.d(),Xe&&Xe.d(),Qe&&Qe.d(),kt=!1,Ht(wt)}}}function fa(t){let e;return{c(){e=p("option"),e.textContent="KMP",e.__value=9,e.value=e.__value},m(l,n){E(l,e,n)},d(l){l&&P(e)}}}function sc(t){var ae,le,se,fe,re,Q,x,ge,pe;let e,l,n=((se=(le=(ae=t[2].conf)==null?void 0:ae.meter)==null?void 0:le.buffer)!=null?se:"Buffer size")+"",i,s,a,r=((Q=(re=(fe=t[2].conf)==null?void 0:fe.meter)==null?void 0:re.serial)!=null?Q:"Serial conf.")+"",f,u,m,_,d,v=((pe=(ge=(x=t[2].conf)==null?void 0:x.meter)==null?void 0:ge.inverted)!=null?pe:"inverted")+"",b,h,C,k,T,q,O,M,U,I,z,y,V,R,F,Y,j,W,K,B,H,Z,ne,X=[3,12,24,48,96,192,384,576,1152],$=[];for(let N=0;N<9;N+=1)$[N]=ac(tc(t,X,N));return{c(){e=p("div"),l=p("span"),i=S(n),s=g(),a=p("span"),f=S(r),u=g(),m=p("label"),_=p("input"),d=g(),b=S(v),h=g(),C=p("div"),k=p("select"),T=p("option"),q=S("Autodetect");for(let N=0;N<9;N+=1)$[N].c();M=g(),U=p("select"),I=p("option"),z=S("-"),V=p("option"),V.textContent="7N1",R=p("option"),R.textContent="8N1",F=p("option"),F.textContent="8N2",Y=p("option"),Y.textContent="7E1",j=p("option"),j.textContent="8E1",K=g(),B=p("input"),c(l,"class","float-right"),c(_,"name","mi"),_.__value="true",_.value=_.__value,c(_,"type","checkbox"),c(_,"class","rounded mb-1"),c(m,"class","mt-2 ml-3 whitespace-nowrap"),T.__value=0,T.value=T.__value,T.disabled=O=t[6].m.b!=0,c(k,"name","mb"),c(k,"class","in-f tr w-1/2"),t[6].m.b===void 0&&Wt(()=>t[35].call(k)),I.__value=0,I.value=I.__value,I.disabled=y=t[6].m.b!=0,V.__value=2,V.value=V.__value,R.__value=3,R.value=R.__value,F.__value=7,F.value=F.__value,Y.__value=10,Y.value=Y.__value,j.__value=11,j.value=j.__value,c(U,"name","mp"),c(U,"class","in-m"),U.disabled=W=t[6].m.b==0,t[6].m.p===void 0&&Wt(()=>t[36].call(U)),c(B,"name","ms"),c(B,"type","number"),c(B,"min",64),c(B,"max",H=t[0].chip=="esp8266"?t[6].i.h.p==3||t[6].i.h.p==113?512:256:4096),c(B,"step",64),c(B,"class","in-l tr w-1/2"),c(C,"class","flex w-full"),c(e,"class","my-1")},m(N,w){E(N,e,w),o(e,l),o(l,i),o(e,s),o(e,a),o(a,f),o(e,u),o(e,m),o(m,_),_.checked=t[6].m.i,o(m,d),o(m,b),o(e,h),o(e,C),o(C,k),o(k,T),o(T,q);for(let D=0;D<9;D+=1)$[D]&&$[D].m(k,null);ot(k,t[6].m.b,!0),o(C,M),o(C,U),o(U,I),o(I,z),o(U,V),o(U,R),o(U,F),o(U,Y),o(U,j),ot(U,t[6].m.p,!0),o(C,K),o(C,B),Me(B,t[6].m.s),Z||(ne=[me(_,"change",t[34]),me(k,"change",t[35]),me(U,"change",t[36]),me(B,"input",t[37])],Z=!0)},p(N,w){var D,L,G,te,ee,oe,ce,Pe,Ce;w[0]&4&&n!==(n=((G=(L=(D=N[2].conf)==null?void 0:D.meter)==null?void 0:L.buffer)!=null?G:"Buffer size")+"")&&A(i,n),w[0]&4&&r!==(r=((oe=(ee=(te=N[2].conf)==null?void 0:te.meter)==null?void 0:ee.serial)!=null?oe:"Serial conf.")+"")&&A(f,r),w[0]&64&&(_.checked=N[6].m.i),w[0]&4&&v!==(v=((Ce=(Pe=(ce=N[2].conf)==null?void 0:ce.meter)==null?void 0:Pe.inverted)!=null?Ce:"inverted")+"")&&A(b,v),w[0]&64&&O!==(O=N[6].m.b!=0)&&(T.disabled=O),w[0]&64&&ot(k,N[6].m.b),w[0]&64&&y!==(y=N[6].m.b!=0)&&(I.disabled=y),w[0]&64&&W!==(W=N[6].m.b==0)&&(U.disabled=W),w[0]&64&&ot(U,N[6].m.p),w[0]&65&&H!==(H=N[0].chip=="esp8266"?N[6].i.h.p==3||N[6].i.h.p==113?512:256:4096)&&c(B,"max",H),w[0]&64&&$e(B.value)!==N[6].m.s&&Me(B,N[6].m.s)},d(N){N&&P(e),ll($,N),Z=!1,Ht(ne)}}}function oc(t){var u,m,_;let e,l,n=((_=(m=(u=t[2].conf)==null?void 0:u.meter)==null?void 0:m.pulses)!=null?_:"Pulses per kWh")+"",i,s,a,r,f;return{c(){e=p("div"),l=p("span"),i=S(n),s=g(),a=p("input"),c(a,"name","mb"),c(a,"class","in-s tr"),c(a,"type","number"),c(a,"min",1),c(a,"max",3600),c(e,"class","my-1")},m(d,v){E(d,e,v),o(e,l),o(l,i),o(e,s),o(e,a),Me(a,t[6].m.b),r||(f=me(a,"input",t[33]),r=!0)},p(d,v){var b,h,C;v[0]&4&&n!==(n=((C=(h=(b=d[2].conf)==null?void 0:b.meter)==null?void 0:h.pulses)!=null?C:"Pulses per kWh")+"")&&A(i,n),v[0]&64&&$e(a.value)!==d[6].m.b&&Me(a,d[6].m.b)},d(d){d&&P(e),r=!1,f()}}}function ac(t){let e,l=t[122]*100+"",n;return{c(){e=p("option"),n=S(l),e.__value=t[122]*100,e.value=e.__value},m(i,s){E(i,e,s),o(e,n)},p:Ze,d(i){i&&P(e)}}}function ua(t){let e,l,n,i;return{c(){e=p("br"),l=p("input"),c(l,"name","mek"),c(l,"type","text"),c(l,"class","in-s")},m(s,a){E(s,e,a),E(s,l,a),Me(l,t[6].m.e.k),n||(i=me(l,"input",t[42]),n=!0)},p(s,a){a[0]&64&&l.value!==s[6].m.e.k&&Me(l,s[6].m.e.k)},d(s){s&&P(e),s&&P(l),n=!1,i()}}}function ra(t){var u,m,_;let e,l=((_=(m=(u=t[2].conf)==null?void 0:u.meter)==null?void 0:m.authkey)!=null?_:"Authentication key")+"",n,i,s,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),c(a,"name","mea"),c(a,"type","text"),c(a,"class","in-s"),c(e,"class","my-1")},m(d,v){E(d,e,v),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].m.e.a),r||(f=me(a,"input",t[43]),r=!0)},p(d,v){var b,h,C;v[0]&4&&l!==(l=((C=(h=(b=d[2].conf)==null?void 0:b.meter)==null?void 0:h.authkey)!=null?C:"Authentication key")+"")&&A(n,l),v[0]&64&&a.value!==d[6].m.e.a&&Me(a,d[6].m.e.a)},d(d){d&&P(e),r=!1,f()}}}function ca(t){var W,K,B,H,Z,ne,X,$,ae,le,se,fe,re,Q,x,ge;let e,l,n=((H=(B=(K=(W=t[2].conf)==null?void 0:W.meter)==null?void 0:K.multipliers)==null?void 0:B.watt)!=null?H:"Watt")+"",i,s,a,r,f,u,m=(($=(X=(ne=(Z=t[2].conf)==null?void 0:Z.meter)==null?void 0:ne.multipliers)==null?void 0:X.volt)!=null?$:"Volt")+"",_,d,v,b,h,C,k=((fe=(se=(le=(ae=t[2].conf)==null?void 0:ae.meter)==null?void 0:le.multipliers)==null?void 0:se.amp)!=null?fe:"Amp")+"",T,q,O,M,U,I,z=((ge=(x=(Q=(re=t[2].conf)==null?void 0:re.meter)==null?void 0:Q.multipliers)==null?void 0:x.kwh)!=null?ge:"kWh")+"",y,V,R,F,Y,j;return{c(){e=p("div"),l=p("div"),i=S(n),s=p("br"),a=g(),r=p("input"),f=g(),u=p("div"),_=S(m),d=p("br"),v=g(),b=p("input"),h=g(),C=p("div"),T=S(k),q=p("br"),O=g(),M=p("input"),U=g(),I=p("div"),y=S(z),V=p("br"),R=g(),F=p("input"),c(r,"name","mmw"),c(r,"type","number"),c(r,"min","0.00"),c(r,"max","1000"),c(r,"step","0.001"),c(r,"class","in-f tr w-full"),c(l,"class","w-1/4"),c(b,"name","mmv"),c(b,"type","number"),c(b,"min","0.00"),c(b,"max","1000"),c(b,"step","0.001"),c(b,"class","in-m tr w-full"),c(u,"class","w-1/4"),c(M,"name","mma"),c(M,"type","number"),c(M,"min","0.00"),c(M,"max","1000"),c(M,"step","0.001"),c(M,"class","in-m tr w-full"),c(C,"class","w-1/4"),c(F,"name","mmc"),c(F,"type","number"),c(F,"min","0.00"),c(F,"max","1000"),c(F,"step","0.001"),c(F,"class","in-l tr w-full"),c(I,"class","w-1/4"),c(e,"class","flex my-1")},m(pe,N){E(pe,e,N),o(e,l),o(l,i),o(l,s),o(l,a),o(l,r),Me(r,t[6].m.m.w),o(e,f),o(e,u),o(u,_),o(u,d),o(u,v),o(u,b),Me(b,t[6].m.m.v),o(e,h),o(e,C),o(C,T),o(C,q),o(C,O),o(C,M),Me(M,t[6].m.m.a),o(e,U),o(e,I),o(I,y),o(I,V),o(I,R),o(I,F),Me(F,t[6].m.m.c),Y||(j=[me(r,"input",t[45]),me(b,"input",t[46]),me(M,"input",t[47]),me(F,"input",t[48])],Y=!0)},p(pe,N){var w,D,L,G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He;N[0]&4&&n!==(n=((G=(L=(D=(w=pe[2].conf)==null?void 0:w.meter)==null?void 0:D.multipliers)==null?void 0:L.watt)!=null?G:"Watt")+"")&&A(i,n),N[0]&64&&$e(r.value)!==pe[6].m.m.w&&Me(r,pe[6].m.m.w),N[0]&4&&m!==(m=((ce=(oe=(ee=(te=pe[2].conf)==null?void 0:te.meter)==null?void 0:ee.multipliers)==null?void 0:oe.volt)!=null?ce:"Volt")+"")&&A(_,m),N[0]&64&&$e(b.value)!==pe[6].m.m.v&&Me(b,pe[6].m.m.v),N[0]&4&&k!==(k=((Ne=(de=(Ce=(Pe=pe[2].conf)==null?void 0:Pe.meter)==null?void 0:Ce.multipliers)==null?void 0:de.amp)!=null?Ne:"Amp")+"")&&A(T,k),N[0]&64&&$e(M.value)!==pe[6].m.m.a&&Me(M,pe[6].m.m.a),N[0]&4&&z!==(z=((He=(be=(ve=(Te=pe[2].conf)==null?void 0:Te.meter)==null?void 0:ve.multipliers)==null?void 0:be.kwh)!=null?He:"kWh")+"")&&A(y,z),N[0]&64&&$e(F.value)!==pe[6].m.m.c&&Me(F,pe[6].m.m.c)},d(pe){pe&&P(e),Y=!1,Ht(j)}}}function ma(t){var z,y,V,R,F,Y,j,W,K;let e,l,n=((V=(y=(z=t[2].conf)==null?void 0:z.connection)==null?void 0:y.title)!=null?V:"Connection")+"",i,s,a,r,f,u,m,_,d,v,b=((Y=(F=(R=t[2].conf)==null?void 0:R.connection)==null?void 0:F.wifi)!=null?Y:"WiFi")+"",h,C,k=((K=(W=(j=t[2].conf)==null?void 0:j.connection)==null?void 0:W.ap)!=null?K:"AP")+"",T,q,O,M,U=t[0].if&&t[0].if.eth&&_a(t),I=(t[6].n.c==1||t[6].n.c==2)&&pa(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),d=p("select"),v=p("option"),h=S(b),C=p("option"),T=S(k),U&&U.c(),q=g(),I&&I.c(),c(l,"class","text-sm"),c(a,"href",ql("Network-connection")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","w"),u.value="true",v.__value=1,v.value=v.__value,C.__value=2,C.value=C.__value,c(d,"name","nc"),c(d,"class","in-s"),t[6].n.c===void 0&&Wt(()=>t[49].call(d)),c(_,"class","my-1"),c(e,"class","cnt")},m(B,H){E(B,e,H),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,d),o(d,v),o(v,h),o(d,C),o(C,T),U&&U.m(d,null),ot(d,t[6].n.c,!0),o(e,q),I&&I.m(e,null),O||(M=me(d,"change",t[49]),O=!0)},p(B,H){var Z,ne,X,$,ae,le,se,fe,re;H[0]&4&&n!==(n=((X=(ne=(Z=B[2].conf)==null?void 0:Z.connection)==null?void 0:ne.title)!=null?X:"Connection")+"")&&A(i,n),H[0]&4&&b!==(b=((le=(ae=($=B[2].conf)==null?void 0:$.connection)==null?void 0:ae.wifi)!=null?le:"WiFi")+"")&&A(h,b),H[0]&4&&k!==(k=((re=(fe=(se=B[2].conf)==null?void 0:se.connection)==null?void 0:fe.ap)!=null?re:"AP")+"")&&A(T,k),B[0].if&&B[0].if.eth?U?U.p(B,H):(U=_a(B),U.c(),U.m(d,null)):U&&(U.d(1),U=null),H[0]&64&&ot(d,B[6].n.c),B[6].n.c==1||B[6].n.c==2?I?I.p(B,H):(I=pa(B),I.c(),I.m(e,null)):I&&(I.d(1),I=null)},d(B){B&&P(e),U&&U.d(),I&&I.d(),O=!1,M()}}}function _a(t){var i,s,a;let e,l=((a=(s=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:s.eth)!=null?a:"Ethernet")+"",n;return{c(){e=p("option"),n=S(l),e.__value=3,e.value=e.__value},m(r,f){E(r,e,f),o(e,n)},p(r,f){var u,m,_;f[0]&4&&l!==(l=((_=(m=(u=r[2].conf)==null?void 0:u.connection)==null?void 0:m.eth)!=null?_:"Ethernet")+"")&&A(n,l)},d(r){r&&P(e)}}}function pa(t){var te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t,Ee,_e,Ue,kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut;let e,l=((oe=(ee=(te=t[2].conf)==null?void 0:te.connection)==null?void 0:ee.ssid)!=null?oe:"SSID")+"",n,i,s,a,r,f,u=((Ce=(Pe=(ce=t[2].conf)==null?void 0:ce.connection)==null?void 0:Pe.psk)!=null?Ce:"Password")+"",m,_,d,v,b,h,C,k=((ve=(Te=(Ne=(de=t[2].conf)==null?void 0:de.connection)==null?void 0:Ne.ps)==null?void 0:Te.title)!=null?ve:"Power saving")+"",T,q,O,M,U,I=((Ve=(ye=(He=(be=t[2].conf)==null?void 0:be.connection)==null?void 0:He.ps)==null?void 0:ye.default)!=null?Ve:"Default")+"",z,y,V=((We=(it=(Je=(xe=t[2].conf)==null?void 0:xe.connection)==null?void 0:Je.ps)==null?void 0:it.off)!=null?We:"Off")+"",R,F,Y=((Ue=(_e=(Ee=(_t=t[2].conf)==null?void 0:_t.connection)==null?void 0:Ee.ps)==null?void 0:_e.min)!=null?Ue:"Min")+"",j,W,K=((vt=(nt=(wt=(kt=t[2].conf)==null?void 0:kt.connection)==null?void 0:wt.ps)==null?void 0:nt.max)!=null?vt:"Max")+"",B,H,Z,ne=((Ye=(Ke=(ze=t[2].conf)==null?void 0:ze.connection)==null?void 0:Ke.pwr)!=null?Ye:"Power")+"",X,$,ae,le,se,fe,re,Q,x,ge,pe,N,w=((ut=(Qe=(Xe=t[2].conf)==null?void 0:Xe.connection)==null?void 0:Qe.tick_11b)!=null?ut:"802.11b")+"",D,L,G;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),r=g(),f=p("div"),m=S(u),_=p("br"),d=g(),v=p("input"),b=g(),h=p("div"),C=p("div"),T=S(k),q=p("br"),O=g(),M=p("select"),U=p("option"),z=S(I),y=p("option"),R=S(V),F=p("option"),j=S(Y),W=p("option"),B=S(K),H=g(),Z=p("div"),X=S(ne),$=p("br"),ae=g(),le=p("div"),se=p("input"),fe=g(),re=p("span"),re.textContent="dBm",Q=g(),x=p("div"),ge=p("label"),pe=p("input"),N=g(),D=S(w),c(a,"name","ws"),c(a,"type","text"),c(a,"class","in-s"),c(e,"class","my-1"),c(v,"name","wp"),c(v,"type","password"),c(v,"class","in-s"),c(f,"class","my-1"),U.__value=255,U.value=U.__value,y.__value=0,y.value=y.__value,F.__value=1,F.value=F.__value,W.__value=2,W.value=W.__value,c(M,"name","wz"),c(M,"class","in-s"),t[6].w.z===void 0&&Wt(()=>t[52].call(M)),c(C,"class","w-1/2"),c(se,"name","ww"),c(se,"type","number"),c(se,"min","0"),c(se,"max","20.5"),c(se,"step","0.5"),c(se,"class","in-f tr w-full"),c(re,"class","in-post"),c(le,"class","flex"),c(Z,"class","ml-2 w-1/2"),c(h,"class","my-1 flex"),c(pe,"type","checkbox"),c(pe,"name","wb"),pe.__value="true",pe.value=pe.__value,c(pe,"class","rounded mb-1"),c(x,"class","my-3")},m(we,Ae){E(we,e,Ae),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].w.s),E(we,r,Ae),E(we,f,Ae),o(f,m),o(f,_),o(f,d),o(f,v),Me(v,t[6].w.p),E(we,b,Ae),E(we,h,Ae),o(h,C),o(C,T),o(C,q),o(C,O),o(C,M),o(M,U),o(U,z),o(M,y),o(y,R),o(M,F),o(F,j),o(M,W),o(W,B),ot(M,t[6].w.z,!0),o(h,H),o(h,Z),o(Z,X),o(Z,$),o(Z,ae),o(Z,le),o(le,se),Me(se,t[6].w.w),o(le,fe),o(le,re),E(we,Q,Ae),E(we,x,Ae),o(x,ge),o(ge,pe),pe.checked=t[6].w.b,o(ge,N),o(ge,D),L||(G=[me(a,"input",t[50]),me(v,"input",t[51]),me(M,"change",t[52]),me(se,"input",t[53]),me(pe,"change",t[54])],L=!0)},p(we,Ae){var ke,ue,De,rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt,qe,Ge,Qt;Ae[0]&4&&l!==(l=((De=(ue=(ke=we[2].conf)==null?void 0:ke.connection)==null?void 0:ue.ssid)!=null?De:"SSID")+"")&&A(n,l),Ae[0]&64&&a.value!==we[6].w.s&&Me(a,we[6].w.s),Ae[0]&4&&u!==(u=((at=(st=(rt=we[2].conf)==null?void 0:rt.connection)==null?void 0:st.psk)!=null?at:"Password")+"")&&A(m,u),Ae[0]&64&&v.value!==we[6].w.p&&Me(v,we[6].w.p),Ae[0]&4&&k!==(k=((Pt=(Rt=(ht=(pt=we[2].conf)==null?void 0:pt.connection)==null?void 0:ht.ps)==null?void 0:Rt.title)!=null?Pt:"Power saving")+"")&&A(T,k),Ae[0]&4&&I!==(I=((Bt=(zt=(Ft=(ct=we[2].conf)==null?void 0:ct.connection)==null?void 0:Ft.ps)==null?void 0:zt.default)!=null?Bt:"Default")+"")&&A(z,I),Ae[0]&4&&V!==(V=((Gt=(yt=(qt=(Ut=we[2].conf)==null?void 0:Ut.connection)==null?void 0:qt.ps)==null?void 0:yt.off)!=null?Gt:"Off")+"")&&A(R,V),Ae[0]&4&&Y!==(Y=((Mt=(Ct=(Yt=(Vt=we[2].conf)==null?void 0:Vt.connection)==null?void 0:Yt.ps)==null?void 0:Ct.min)!=null?Mt:"Min")+"")&&A(j,Y),Ae[0]&4&&K!==(K=((dt=(Et=(Nt=(ft=we[2].conf)==null?void 0:ft.connection)==null?void 0:Nt.ps)==null?void 0:Et.max)!=null?dt:"Max")+"")&&A(B,K),Ae[0]&64&&ot(M,we[6].w.z),Ae[0]&4&&ne!==(ne=((mt=(St=(At=we[2].conf)==null?void 0:At.connection)==null?void 0:St.pwr)!=null?mt:"Power")+"")&&A(X,ne),Ae[0]&64&&$e(se.value)!==we[6].w.w&&Me(se,we[6].w.w),Ae[0]&64&&(pe.checked=we[6].w.b),Ae[0]&4&&w!==(w=((Qt=(Ge=(qe=we[2].conf)==null?void 0:qe.connection)==null?void 0:Ge.tick_11b)!=null?Qt:"802.11b")+"")&&A(D,w)},d(we){we&&P(e),we&&P(r),we&&P(f),we&&P(b),we&&P(h),we&&P(Q),we&&P(x),L=!1,Ht(G)}}}function da(t){var He,ye,Ve,xe,Je,it,We,_t,Ee,_e,Ue,kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut;let e,l,n=((Ve=(ye=(He=t[2].conf)==null?void 0:He.network)==null?void 0:ye.title)!=null?Ve:"Network")+"",i,s,a,r,f,u,m=((it=(Je=(xe=t[2].conf)==null?void 0:xe.network)==null?void 0:Je.ip)!=null?it:"IP")+"",_,d,v,b,h,C,k=((Ee=(_t=(We=t[2].conf)==null?void 0:We.network)==null?void 0:_t.dhcp)!=null?Ee:"DHCP")+"",T,q,O=((kt=(Ue=(_e=t[2].conf)==null?void 0:_e.network)==null?void 0:Ue.static)!=null?kt:"Static")+"",M,U,I,z,y,V,R,F,Y,j,W,K,B,H,Z,ne,X,$,ae,le,se,fe=((vt=(nt=(wt=t[2].conf)==null?void 0:wt.network)==null?void 0:nt.tick_mdns)!=null?vt:"mDNS")+"",re,Q,x,ge,pe,N=((Ye=(Ke=(ze=t[2].conf)==null?void 0:ze.network)==null?void 0:Ke.ntp)!=null?Ye:"NTP")+"",w,D,L,G,te,ee=((ut=(Qe=(Xe=t[2].conf)==null?void 0:Xe.network)==null?void 0:Qe.tick_ntp_dhcp)!=null?ut:"from DHCP")+"",oe,ce,Pe,Ce,de,Ne,Te,ve;F=new Fu({});let be=t[6].n.m=="static"&&va(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("div"),_=S(m),d=p("br"),v=g(),b=p("div"),h=p("select"),C=p("option"),T=S(k),q=p("option"),M=S(O),U=g(),I=p("input"),V=g(),R=p("select"),Oe(F.$$.fragment),W=g(),be&&be.c(),K=g(),B=p("div"),H=p("label"),Z=p("input"),ne=S(" IPv6"),X=g(),$=p("div"),ae=p("label"),le=p("input"),se=g(),re=S(fe),Q=g(),x=p("input"),ge=g(),pe=p("div"),w=S(N),D=g(),L=p("label"),G=p("input"),te=g(),oe=S(ee),ce=p("br"),Pe=g(),Ce=p("div"),de=p("input"),c(l,"class","text-sm"),c(a,"href",ql("Network-configuration")),c(a,"target","_blank"),c(a,"class","float-right"),C.__value="dhcp",C.value=C.__value,q.__value="static",q.value=q.__value,c(h,"name","nm"),c(h,"class","in-f"),t[6].n.m===void 0&&Wt(()=>t[55].call(h)),c(I,"name","ni"),c(I,"type","text"),c(I,"class","in-m w-full"),I.disabled=z=t[6].n.m=="dhcp",I.required=y=t[6].n.m=="static",c(R,"name","ns"),c(R,"class","in-l"),R.disabled=Y=t[6].n.m=="dhcp",R.required=j=t[6].n.m=="static",t[6].n.s===void 0&&Wt(()=>t[57].call(R)),c(b,"class","flex"),c(u,"class","my-1"),c(Z,"name","nx"),Z.__value="true",Z.value=Z.__value,c(Z,"type","checkbox"),c(Z,"class","rounded mb-1"),c(B,"class","my-1"),c(le,"name","nd"),le.__value="true",le.value=le.__value,c(le,"type","checkbox"),c(le,"class","rounded mb-1"),c($,"class","my-1"),c(x,"type","hidden"),c(x,"name","ntp"),x.value="true",c(G,"name","ntpd"),G.__value="true",G.value=G.__value,c(G,"type","checkbox"),c(G,"class","rounded mb-1"),c(L,"class","ml-4"),c(de,"name","ntph"),c(de,"type","text"),c(de,"class","in-s"),c(Ce,"class","flex"),c(pe,"class","my-1"),c(e,"class","cnt")},m(we,Ae){E(we,e,Ae),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(u,_),o(u,d),o(u,v),o(u,b),o(b,h),o(h,C),o(C,T),o(h,q),o(q,M),ot(h,t[6].n.m,!0),o(b,U),o(b,I),Me(I,t[6].n.i),o(b,V),o(b,R),Le(F,R,null),ot(R,t[6].n.s,!0),o(e,W),be&&be.m(e,null),o(e,K),o(e,B),o(B,H),o(H,Z),Z.checked=t[6].n.x,o(H,ne),o(e,X),o(e,$),o($,ae),o(ae,le),le.checked=t[6].n.d,o(ae,se),o(ae,re),o(e,Q),o(e,x),o(e,ge),o(e,pe),o(pe,w),o(pe,D),o(pe,L),o(L,G),G.checked=t[6].n.h,o(L,te),o(L,oe),o(pe,ce),o(pe,Pe),o(pe,Ce),o(Ce,de),Me(de,t[6].n.n1),Ne=!0,Te||(ve=[me(h,"change",t[55]),me(I,"input",t[56]),me(R,"change",t[57]),me(Z,"change",t[61]),me(le,"change",t[62]),me(G,"change",t[63]),me(de,"input",t[64])],Te=!0)},p(we,Ae){var ke,ue,De,rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct;(!Ne||Ae[0]&4)&&n!==(n=((De=(ue=(ke=we[2].conf)==null?void 0:ke.network)==null?void 0:ue.title)!=null?De:"Network")+"")&&A(i,n),(!Ne||Ae[0]&4)&&m!==(m=((at=(st=(rt=we[2].conf)==null?void 0:rt.network)==null?void 0:st.ip)!=null?at:"IP")+"")&&A(_,m),(!Ne||Ae[0]&4)&&k!==(k=((Rt=(ht=(pt=we[2].conf)==null?void 0:pt.network)==null?void 0:ht.dhcp)!=null?Rt:"DHCP")+"")&&A(T,k),(!Ne||Ae[0]&4)&&O!==(O=((Ft=(ct=(Pt=we[2].conf)==null?void 0:Pt.network)==null?void 0:ct.static)!=null?Ft:"Static")+"")&&A(M,O),Ae[0]&64&&ot(h,we[6].n.m),(!Ne||Ae[0]&64&&z!==(z=we[6].n.m=="dhcp"))&&(I.disabled=z),(!Ne||Ae[0]&64&&y!==(y=we[6].n.m=="static"))&&(I.required=y),Ae[0]&64&&I.value!==we[6].n.i&&Me(I,we[6].n.i),(!Ne||Ae[0]&64&&Y!==(Y=we[6].n.m=="dhcp"))&&(R.disabled=Y),(!Ne||Ae[0]&64&&j!==(j=we[6].n.m=="static"))&&(R.required=j),Ae[0]&64&&ot(R,we[6].n.s),we[6].n.m=="static"?be?be.p(we,Ae):(be=va(we),be.c(),be.m(e,K)):be&&(be.d(1),be=null),Ae[0]&64&&(Z.checked=we[6].n.x),Ae[0]&64&&(le.checked=we[6].n.d),(!Ne||Ae[0]&4)&&fe!==(fe=((Ut=(Bt=(zt=we[2].conf)==null?void 0:zt.network)==null?void 0:Bt.tick_mdns)!=null?Ut:"mDNS")+"")&&A(re,fe),(!Ne||Ae[0]&4)&&N!==(N=((Gt=(yt=(qt=we[2].conf)==null?void 0:qt.network)==null?void 0:yt.ntp)!=null?Gt:"NTP")+"")&&A(w,N),Ae[0]&64&&(G.checked=we[6].n.h),(!Ne||Ae[0]&4)&&ee!==(ee=((Ct=(Yt=(Vt=we[2].conf)==null?void 0:Vt.network)==null?void 0:Yt.tick_ntp_dhcp)!=null?Ct:"from DHCP")+"")&&A(oe,ee),Ae[0]&64&&de.value!==we[6].n.n1&&Me(de,we[6].n.n1)},i(we){Ne||(J(F.$$.fragment,we),Ne=!0)},o(we){ie(F.$$.fragment,we),Ne=!1},d(we){we&&P(e),Ie(F),be&&be.d(),Te=!1,Ht(ve)}}}function va(t){var q,O,M,U,I,z;let e,l=((M=(O=(q=t[2].conf)==null?void 0:q.network)==null?void 0:O.gw)!=null?M:"Gateway")+"",n,i,s,a,r,f,u=((z=(I=(U=t[2].conf)==null?void 0:U.network)==null?void 0:I.dns)!=null?z:"DNS")+"",m,_,d,v,b,h,C,k,T;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),r=g(),f=p("div"),m=S(u),_=p("br"),d=g(),v=p("div"),b=p("input"),h=g(),C=p("input"),c(a,"name","ng"),c(a,"type","text"),c(a,"class","in-s"),c(e,"class","my-1"),c(b,"name","nd1"),c(b,"type","text"),c(b,"class","in-f w-full"),c(C,"name","nd2"),c(C,"type","text"),c(C,"class","in-l w-full"),c(v,"class","flex"),c(f,"class","my-1")},m(y,V){E(y,e,V),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].n.g),E(y,r,V),E(y,f,V),o(f,m),o(f,_),o(f,d),o(f,v),o(v,b),Me(b,t[6].n.d1),o(v,h),o(v,C),Me(C,t[6].n.d2),k||(T=[me(a,"input",t[58]),me(b,"input",t[59]),me(C,"input",t[60])],k=!0)},p(y,V){var R,F,Y,j,W,K;V[0]&4&&l!==(l=((Y=(F=(R=y[2].conf)==null?void 0:R.network)==null?void 0:F.gw)!=null?Y:"Gateway")+"")&&A(n,l),V[0]&64&&a.value!==y[6].n.g&&Me(a,y[6].n.g),V[0]&4&&u!==(u=((K=(W=(j=y[2].conf)==null?void 0:j.network)==null?void 0:W.dns)!=null?K:"DNS")+"")&&A(m,u),V[0]&64&&b.value!==y[6].n.d1&&Me(b,y[6].n.d1),V[0]&64&&C.value!==y[6].n.d2&&Me(C,y[6].n.d2)},d(y){y&&P(e),y&&P(r),y&&P(f),k=!1,Ht(T)}}}function ha(t){var rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt,qe,Ge,Qt,el,xt,Se;let e,l,n=((at=(st=(rt=t[2].conf)==null?void 0:rt.mqtt)==null?void 0:st.title)!=null?at:"MQTT")+"",i,s,a,r,f,u,m,_,d=((Rt=(ht=(pt=t[2].conf)==null?void 0:pt.mqtt)==null?void 0:ht.server)!=null?Rt:"Server")+"",v,b,h,C,k,T,q,O,M,U,I,z,y=((Ft=(ct=(Pt=t[2].conf)==null?void 0:Pt.mqtt)==null?void 0:ct.user)!=null?Ft:"Username")+"",V,R,F,Y,j,W,K=((Ut=(Bt=(zt=t[2].conf)==null?void 0:zt.mqtt)==null?void 0:Bt.pass)!=null?Ut:"Password")+"",B,H,Z,ne,X,$,ae,le=((Gt=(yt=(qt=t[2].conf)==null?void 0:qt.mqtt)==null?void 0:yt.id)!=null?Gt:"Client ID")+"",se,fe,re,Q,x,ge,pe=((Ct=(Yt=(Vt=t[2].conf)==null?void 0:Vt.mqtt)==null?void 0:Yt.payload)!=null?Ct:"Payload")+"",N,w,D,L,G,te,ee,oe=((Et=(Nt=(ft=(Mt=t[2].conf)==null?void 0:Mt.mqtt)==null?void 0:ft.domoticz)==null?void 0:Nt.title)!=null?Et:"Domoticz")+"",ce,Pe,Ce=((mt=(St=(At=(dt=t[2].conf)==null?void 0:dt.mqtt)==null?void 0:At.ha)==null?void 0:St.title)!=null?mt:"Home-Assistant")+"",de,Ne,Te,ve,be,He,ye,Ve=((Qt=(Ge=(qe=t[2].conf)==null?void 0:qe.mqtt)==null?void 0:Ge.publish)!=null?Qt:"Publish topic")+"",xe,Je,it,We,_t,Ee,_e=((Se=(xt=(el=t[2].conf)==null?void 0:el.mqtt)==null?void 0:xt.update)!=null?Se:"Update method")+"",Ue,kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut,we,Ae,ke,ue=t[0].chip!="esp8266"&&ba(t),De=t[6].q.s.e&&ga(t);return{c(){var Re,Fe;e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),v=S(d),b=g(),ue&&ue.c(),h=g(),C=p("br"),k=g(),T=p("div"),q=p("input"),O=g(),M=p("input"),U=g(),De&&De.c(),I=g(),z=p("div"),V=S(y),R=p("br"),F=g(),Y=p("input"),j=g(),W=p("div"),B=S(K),H=p("br"),Z=g(),ne=p("input"),X=g(),$=p("div"),ae=p("div"),se=S(le),fe=p("br"),re=g(),Q=p("input"),x=g(),ge=p("div"),N=S(pe),w=p("br"),D=g(),L=p("select"),G=p("option"),G.textContent="Raw (minimal)",te=p("option"),te.textContent="Raw (full)",ee=p("option"),ce=S(oe),Pe=p("option"),de=S(Ce),Ne=p("option"),Ne.textContent="JSON (classic)",Te=p("option"),Te.textContent="JSON (multi topic)",ve=p("option"),ve.textContent="JSON (flat)",be=p("option"),be.textContent="HEX dump",He=g(),ye=p("div"),xe=S(Ve),Je=p("br"),it=g(),We=p("input"),_t=g(),Ee=p("div"),Ue=S(_e),kt=g(),wt=p("span"),wt.textContent="Interval",nt=g(),vt=p("div"),ze=p("select"),Ke=p("option"),Ke.textContent="Real time",Ye=p("option"),Ye.textContent="Interval",Xe=g(),Qe=p("input"),c(l,"class","text-sm"),c(a,"href",ql("MQTT-configuration")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","q"),u.value="true",c(q,"name","qh"),c(q,"type","text"),c(q,"class","in-f w-2/3"),c(M,"name","qp"),c(M,"type","number"),c(M,"min","1024"),c(M,"max","65535"),c(M,"class","in-l tr w-1/3"),c(T,"class","flex"),c(_,"class","my-1"),c(Y,"name","qu"),c(Y,"type","text"),c(Y,"class","in-s"),c(z,"class","my-1"),c(ne,"name","qa"),c(ne,"type","password"),c(ne,"class","in-s"),c(W,"class","my-1"),c(Q,"name","qc"),c(Q,"type","text"),c(Q,"class","in-f w-full"),G.__value=1,G.value=G.__value,te.__value=2,te.value=te.__value,ee.__value=3,ee.value=ee.__value,Pe.__value=4,Pe.value=Pe.__value,Ne.__value=0,Ne.value=Ne.__value,Te.__value=5,Te.value=Te.__value,ve.__value=6,ve.value=ve.__value,be.__value=255,be.value=be.__value,c(L,"name","qm"),c(L,"class","in-l"),t[6].q.m===void 0&&Wt(()=>t[71].call(L)),c($,"class","my-1 flex"),c(We,"name","qb"),c(We,"type","text"),c(We,"class","in-s"),c(ye,"class","my-1"),c(wt,"class","float-right"),Ke.__value=0,Ke.value=Ke.__value,Ye.__value=1,Ye.value=Ye.__value,c(ze,"name","qt"),c(ze,"class","in-f w-1/2"),t[6].q.t===void 0&&Wt(()=>t[73].call(ze)),c(Qe,"name","qd"),c(Qe,"type","number"),c(Qe,"min","1"),c(Qe,"max","3600"),c(Qe,"class","in-l tr w-1/2"),Qe.disabled=ut=((Fe=(Re=t[6])==null?void 0:Re.q)==null?void 0:Fe.t)!=1,c(vt,"class","flex"),c(Ee,"class","my-1"),c(e,"class","cnt")},m(Re,Fe){E(Re,e,Fe),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,v),o(_,b),ue&&ue.m(_,null),o(_,h),o(_,C),o(_,k),o(_,T),o(T,q),Me(q,t[6].q.h),o(T,O),o(T,M),Me(M,t[6].q.p),o(e,U),De&&De.m(e,null),o(e,I),o(e,z),o(z,V),o(z,R),o(z,F),o(z,Y),Me(Y,t[6].q.u),o(e,j),o(e,W),o(W,B),o(W,H),o(W,Z),o(W,ne),Me(ne,t[6].q.a),o(e,X),o(e,$),o($,ae),o(ae,se),o(ae,fe),o(ae,re),o(ae,Q),Me(Q,t[6].q.c),o($,x),o($,ge),o(ge,N),o(ge,w),o(ge,D),o(ge,L),o(L,G),o(L,te),o(L,ee),o(ee,ce),o(L,Pe),o(Pe,de),o(L,Ne),o(L,Te),o(L,ve),o(L,be),ot(L,t[6].q.m,!0),o(e,He),o(e,ye),o(ye,xe),o(ye,Je),o(ye,it),o(ye,We),Me(We,t[6].q.b),o(e,_t),o(e,Ee),o(Ee,Ue),o(Ee,kt),o(Ee,wt),o(Ee,nt),o(Ee,vt),o(vt,ze),o(ze,Ke),o(ze,Ye),ot(ze,t[6].q.t,!0),o(vt,Xe),o(vt,Qe),Me(Qe,t[6].q.d),we=!0,Ae||(ke=[me(q,"input",t[66]),me(M,"input",t[67]),me(Y,"input",t[68]),me(ne,"input",t[69]),me(Q,"input",t[70]),me(L,"change",t[71]),me(We,"input",t[72]),me(ze,"change",t[73]),me(Qe,"input",t[74])],Ae=!0)},p(Re,Fe){var il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl,Be,et,je,he,Kt,wl,Cl,Sl,Ml,Nl,Tl,Pl,El,Dl,Rl,Fl,Bl,Ul,tt,Ot,vl,bl;(!we||Fe[0]&4)&&n!==(n=((ol=(sl=(il=Re[2].conf)==null?void 0:il.mqtt)==null?void 0:sl.title)!=null?ol:"MQTT")+"")&&A(i,n),(!we||Fe[0]&4)&&d!==(d=((ul=(fl=(al=Re[2].conf)==null?void 0:al.mqtt)==null?void 0:fl.server)!=null?ul:"Server")+"")&&A(v,d),Re[0].chip!="esp8266"?ue?ue.p(Re,Fe):(ue=ba(Re),ue.c(),ue.m(_,h)):ue&&(ue.d(1),ue=null),Fe[0]&64&&q.value!==Re[6].q.h&&Me(q,Re[6].q.h),Fe[0]&64&&$e(M.value)!==Re[6].q.p&&Me(M,Re[6].q.p),Re[6].q.s.e?De?(De.p(Re,Fe),Fe[0]&64&&J(De,1)):(De=ga(Re),De.c(),J(De,1),De.m(e,I)):De&&(bt(),ie(De,1,1,()=>{De=null}),gt()),(!we||Fe[0]&4)&&y!==(y=((ml=(cl=(rl=Re[2].conf)==null?void 0:rl.mqtt)==null?void 0:cl.user)!=null?ml:"Username")+"")&&A(V,y),Fe[0]&64&&Y.value!==Re[6].q.u&&Me(Y,Re[6].q.u),(!we||Fe[0]&4)&&K!==(K=((dl=(pl=(_l=Re[2].conf)==null?void 0:_l.mqtt)==null?void 0:pl.pass)!=null?dl:"Password")+"")&&A(B,K),Fe[0]&64&&ne.value!==Re[6].q.a&&Me(ne,Re[6].q.a),(!we||Fe[0]&4)&&le!==(le=((je=(et=(Be=Re[2].conf)==null?void 0:Be.mqtt)==null?void 0:et.id)!=null?je:"Client ID")+"")&&A(se,le),Fe[0]&64&&Q.value!==Re[6].q.c&&Me(Q,Re[6].q.c),(!we||Fe[0]&4)&&pe!==(pe=((wl=(Kt=(he=Re[2].conf)==null?void 0:he.mqtt)==null?void 0:Kt.payload)!=null?wl:"Payload")+"")&&A(N,pe),(!we||Fe[0]&4)&&oe!==(oe=((Nl=(Ml=(Sl=(Cl=Re[2].conf)==null?void 0:Cl.mqtt)==null?void 0:Sl.domoticz)==null?void 0:Ml.title)!=null?Nl:"Domoticz")+"")&&A(ce,oe),(!we||Fe[0]&4)&&Ce!==(Ce=((Dl=(El=(Pl=(Tl=Re[2].conf)==null?void 0:Tl.mqtt)==null?void 0:Pl.ha)==null?void 0:El.title)!=null?Dl:"Home-Assistant")+"")&&A(de,Ce),Fe[0]&64&&ot(L,Re[6].q.m),(!we||Fe[0]&4)&&Ve!==(Ve=((Bl=(Fl=(Rl=Re[2].conf)==null?void 0:Rl.mqtt)==null?void 0:Fl.publish)!=null?Bl:"Publish topic")+"")&&A(xe,Ve),Fe[0]&64&&We.value!==Re[6].q.b&&Me(We,Re[6].q.b),(!we||Fe[0]&4)&&_e!==(_e=((Ot=(tt=(Ul=Re[2].conf)==null?void 0:Ul.mqtt)==null?void 0:tt.update)!=null?Ot:"Update method")+"")&&A(Ue,_e),Fe[0]&64&&ot(ze,Re[6].q.t),(!we||Fe[0]&64&&ut!==(ut=((bl=(vl=Re[6])==null?void 0:vl.q)==null?void 0:bl.t)!=1))&&(Qe.disabled=ut),Fe[0]&64&&$e(Qe.value)!==Re[6].q.d&&Me(Qe,Re[6].q.d)},i(Re){we||(J(De),we=!0)},o(Re){ie(De),we=!1},d(Re){Re&&P(e),ue&&ue.d(),De&&De.d(),Ae=!1,Ht(ke)}}}function ba(t){let e,l,n,i,s;return{c(){e=p("label"),l=p("input"),n=S(" SSL"),c(l,"type","checkbox"),c(l,"name","qs"),l.__value="true",l.value=l.__value,c(l,"class","rounded mb-1"),c(e,"class","float-right mr-3")},m(a,r){E(a,e,r),o(e,l),l.checked=t[6].q.s.e,o(e,n),i||(s=[me(l,"change",t[65]),me(l,"change",t[18])],i=!0)},p(a,r){r[0]&64&&(l.checked=a[6].q.s.e)},d(a){a&&P(e),i=!1,Ht(s)}}}function ga(t){let e,l,n,i,s,a,r,f,u,m,_,d,v;const b=[uc,fc],h=[];function C(I,z){return I[6].q.s.c?0:1}n=C(t),i=h[n]=b[n](t);const k=[_c,mc],T=[];function q(I,z){return I[6].q.s.r?0:1}r=q(t),f=T[r]=k[r](t);const O=[hc,vc],M=[];function U(I,z){return I[6].q.s.k?0:1}return _=U(t),d=M[_]=O[_](t),{c(){e=p("div"),l=p("span"),i.c(),s=g(),a=p("span"),f.c(),u=g(),m=p("span"),d.c(),c(l,"class","flex pr-2"),c(a,"class","flex pr-2"),c(m,"class","flex pr-2"),c(e,"class","my-1 flex")},m(I,z){E(I,e,z),o(e,l),h[n].m(l,null),o(e,s),o(e,a),T[r].m(a,null),o(e,u),o(e,m),M[_].m(m,null),v=!0},p(I,z){let y=n;n=C(I),n===y?h[n].p(I,z):(bt(),ie(h[y],1,1,()=>{h[y]=null}),gt(),i=h[n],i?i.p(I,z):(i=h[n]=b[n](I),i.c()),J(i,1),i.m(l,null));let V=r;r=q(I),r===V?T[r].p(I,z):(bt(),ie(T[V],1,1,()=>{T[V]=null}),gt(),f=T[r],f?f.p(I,z):(f=T[r]=k[r](I),f.c()),J(f,1),f.m(a,null));let R=_;_=U(I),_===R?M[_].p(I,z):(bt(),ie(M[R],1,1,()=>{M[R]=null}),gt(),d=M[_],d?d.p(I,z):(d=M[_]=O[_](I),d.c()),J(d,1),d.m(m,null))},i(I){v||(J(i),J(f),J(d),v=!0)},o(I){ie(i),ie(f),ie(d),v=!1},d(I){I&&P(e),h[n].d(),T[r].d(),M[_].d()}}}function fc(t){let e,l;return e=new Al({props:{to:"/mqtt-ca",$$slots:{default:[rc]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i[0]&4|i[4]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function uc(t){let e,l,n,i,s,a,r;return l=new Al({props:{to:"/mqtt-ca",$$slots:{default:[cc]},$$scope:{ctx:t}}}),{c(){e=p("span"),Oe(l.$$.fragment),n=g(),i=p("span"),i.textContent="\u{1F5D1}",c(e,"class","bd-on"),c(i,"class","bd-off")},m(f,u){E(f,e,u),Le(l,e,null),E(f,n,u),E(f,i,u),s=!0,a||(r=[me(i,"click",t[15]),me(i,"keypress",t[15])],a=!0)},p(f,u){const m={};u[0]&4|u[4]&16&&(m.$$scope={dirty:u,ctx:f}),l.$set(m)},i(f){s||(J(l.$$.fragment,f),s=!0)},o(f){ie(l.$$.fragment,f),s=!1},d(f){f&&P(e),Ie(l),f&&P(n),f&&P(i),a=!1,Ht(r)}}}function rc(t){var n,i,s,a,r,f;let e,l;return e=new xl({props:{color:"blue",text:(s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_ca_upload)!=null?s:"Upload CA",title:(f=(r=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:r.title_ca)!=null?f:""}}),{c(){Oe(e.$$.fragment)},m(u,m){Le(e,u,m),l=!0},p(u,m){var d,v,b,h,C,k;const _={};m[0]&4&&(_.text=(b=(v=(d=u[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_ca_upload)!=null?b:"Upload CA"),m[0]&4&&(_.title=(k=(C=(h=u[2].conf)==null?void 0:h.mqtt)==null?void 0:C.title_ca)!=null?k:""),e.$set(_)},i(u){l||(J(e.$$.fragment,u),l=!0)},o(u){ie(e.$$.fragment,u),l=!1},d(u){Ie(e,u)}}}function cc(t){var n,i,s;let e=((s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.ca_ok)!=null?s:"CA OK")+"",l;return{c(){l=S(e)},m(a,r){E(a,l,r)},p(a,r){var f,u,m;r[0]&4&&e!==(e=((m=(u=(f=a[2].conf)==null?void 0:f.mqtt)==null?void 0:u.ca_ok)!=null?m:"CA OK")+"")&&A(l,e)},d(a){a&&P(l)}}}function mc(t){let e,l;return e=new Al({props:{to:"/mqtt-cert",$$slots:{default:[pc]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i[0]&4|i[4]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function _c(t){let e,l,n,i,s,a,r;return l=new Al({props:{to:"/mqtt-cert",$$slots:{default:[dc]},$$scope:{ctx:t}}}),{c(){e=p("span"),Oe(l.$$.fragment),n=g(),i=p("span"),i.textContent="\u{1F5D1}",c(e,"class","bd-on"),c(i,"class","bd-off")},m(f,u){E(f,e,u),Le(l,e,null),E(f,n,u),E(f,i,u),s=!0,a||(r=[me(i,"click",t[16]),me(i,"keypress",t[16])],a=!0)},p(f,u){const m={};u[0]&4|u[4]&16&&(m.$$scope={dirty:u,ctx:f}),l.$set(m)},i(f){s||(J(l.$$.fragment,f),s=!0)},o(f){ie(l.$$.fragment,f),s=!1},d(f){f&&P(e),Ie(l),f&&P(n),f&&P(i),a=!1,Ht(r)}}}function pc(t){var n,i,s,a,r,f;let e,l;return e=new xl({props:{color:"blue",text:(s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_crt_upload)!=null?s:"Upload cert",title:(f=(r=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:r.title_crt)!=null?f:""}}),{c(){Oe(e.$$.fragment)},m(u,m){Le(e,u,m),l=!0},p(u,m){var d,v,b,h,C,k;const _={};m[0]&4&&(_.text=(b=(v=(d=u[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_crt_upload)!=null?b:"Upload cert"),m[0]&4&&(_.title=(k=(C=(h=u[2].conf)==null?void 0:h.mqtt)==null?void 0:C.title_crt)!=null?k:""),e.$set(_)},i(u){l||(J(e.$$.fragment,u),l=!0)},o(u){ie(e.$$.fragment,u),l=!1},d(u){Ie(e,u)}}}function dc(t){var n,i,s;let e=((s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.crt_ok)!=null?s:"Cert OK")+"",l;return{c(){l=S(e)},m(a,r){E(a,l,r)},p(a,r){var f,u,m;r[0]&4&&e!==(e=((m=(u=(f=a[2].conf)==null?void 0:f.mqtt)==null?void 0:u.crt_ok)!=null?m:"Cert OK")+"")&&A(l,e)},d(a){a&&P(l)}}}function vc(t){let e,l;return e=new Al({props:{to:"/mqtt-key",$$slots:{default:[bc]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i[0]&4|i[4]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function hc(t){let e,l,n,i,s,a,r;return l=new Al({props:{to:"/mqtt-key",$$slots:{default:[gc]},$$scope:{ctx:t}}}),{c(){e=p("span"),Oe(l.$$.fragment),n=g(),i=p("span"),i.textContent="\u{1F5D1}",c(e,"class","bd-on"),c(i,"class","bd-off")},m(f,u){E(f,e,u),Le(l,e,null),E(f,n,u),E(f,i,u),s=!0,a||(r=[me(i,"click",t[17]),me(i,"keypress",t[17])],a=!0)},p(f,u){const m={};u[0]&4|u[4]&16&&(m.$$scope={dirty:u,ctx:f}),l.$set(m)},i(f){s||(J(l.$$.fragment,f),s=!0)},o(f){ie(l.$$.fragment,f),s=!1},d(f){f&&P(e),Ie(l),f&&P(n),f&&P(i),a=!1,Ht(r)}}}function bc(t){var n,i,s,a,r,f;let e,l;return e=new xl({props:{color:"blue",text:(s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_key_upload)!=null?s:"Upload key",title:(f=(r=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:r.title_key)!=null?f:""}}),{c(){Oe(e.$$.fragment)},m(u,m){Le(e,u,m),l=!0},p(u,m){var d,v,b,h,C,k;const _={};m[0]&4&&(_.text=(b=(v=(d=u[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_key_upload)!=null?b:"Upload key"),m[0]&4&&(_.title=(k=(C=(h=u[2].conf)==null?void 0:h.mqtt)==null?void 0:C.title_key)!=null?k:""),e.$set(_)},i(u){l||(J(e.$$.fragment,u),l=!0)},o(u){ie(e.$$.fragment,u),l=!1},d(u){Ie(e,u)}}}function gc(t){var n,i,s;let e=((s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.key_ok)!=null?s:"Key OK")+"",l;return{c(){l=S(e)},m(a,r){E(a,l,r)},p(a,r){var f,u,m;r[0]&4&&e!==(e=((m=(u=(f=a[2].conf)==null?void 0:f.mqtt)==null?void 0:u.key_ok)!=null?m:"Key OK")+"")&&A(l,e)},d(a){a&&P(l)}}}function ka(t){var $,ae,le,se,fe,re,Q,x,ge,pe,N,w,D,L,G,te;let e,l,n=((se=(le=(ae=($=t[2].conf)==null?void 0:$.mqtt)==null?void 0:ae.domoticz)==null?void 0:le.title)!=null?se:"Domoticz")+"",i,s,a,r,f,u,m,_,d,v=((x=(Q=(re=(fe=t[2].conf)==null?void 0:fe.mqtt)==null?void 0:re.domoticz)==null?void 0:Q.eidx)!=null?x:"Electricity IDX")+"",b,h,C,k,T,q,O=((w=(N=(pe=(ge=t[2].conf)==null?void 0:ge.mqtt)==null?void 0:pe.domoticz)==null?void 0:N.cidx)!=null?w:"Current IDX")+"",M,U,I,z,y,V,R=((te=(G=(L=(D=t[2].conf)==null?void 0:D.mqtt)==null?void 0:L.domoticz)==null?void 0:G.vidx)!=null?te:"Voltage IDX")+"",F,Y,j,W,K,B,H,Z,ne,X;return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),d=p("div"),b=S(v),h=p("br"),C=g(),k=p("input"),T=g(),q=p("div"),M=S(O),U=p("br"),I=g(),z=p("input"),y=g(),V=p("div"),F=S(R),Y=S(`: L1, L2 & L3 - `),j=p("div"),W=p("input"),K=g(),B=p("input"),H=g(),Z=p("input"),c(l,"class","text-sm"),c(a,"href",ql("MQTT-configuration#domoticz")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","o"),u.value="true",c(k,"name","oe"),c(k,"type","text"),c(k,"class","in-f tr w-full"),c(d,"class","w-1/2"),c(z,"name","oc"),c(z,"type","text"),c(z,"class","in-l tr w-full"),c(q,"class","w-1/2"),c(_,"class","my-1 flex"),c(W,"name","ou1"),c(W,"type","text"),c(W,"class","in-f tr w-1/3"),c(B,"name","ou2"),c(B,"type","text"),c(B,"class","in-m tr w-1/3"),c(Z,"name","ou3"),c(Z,"type","text"),c(Z,"class","in-l tr w-1/3"),c(j,"class","flex"),c(V,"class","my-1"),c(e,"class","cnt")},m(ee,oe){E(ee,e,oe),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,d),o(d,b),o(d,h),o(d,C),o(d,k),Me(k,t[6].o.e),o(_,T),o(_,q),o(q,M),o(q,U),o(q,I),o(q,z),Me(z,t[6].o.c),o(e,y),o(e,V),o(V,F),o(V,Y),o(V,j),o(j,W),Me(W,t[6].o.u1),o(j,K),o(j,B),Me(B,t[6].o.u2),o(j,H),o(j,Z),Me(Z,t[6].o.u3),ne||(X=[me(k,"input",t[75]),me(z,"input",t[76]),me(W,"input",t[77]),me(B,"input",t[78]),me(Z,"input",t[79])],ne=!0)},p(ee,oe){var ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t;oe[0]&4&&n!==(n=((de=(Ce=(Pe=(ce=ee[2].conf)==null?void 0:ce.mqtt)==null?void 0:Pe.domoticz)==null?void 0:Ce.title)!=null?de:"Domoticz")+"")&&A(i,n),oe[0]&4&&v!==(v=((be=(ve=(Te=(Ne=ee[2].conf)==null?void 0:Ne.mqtt)==null?void 0:Te.domoticz)==null?void 0:ve.eidx)!=null?be:"Electricity IDX")+"")&&A(b,v),oe[0]&64&&k.value!==ee[6].o.e&&Me(k,ee[6].o.e),oe[0]&4&&O!==(O=((xe=(Ve=(ye=(He=ee[2].conf)==null?void 0:He.mqtt)==null?void 0:ye.domoticz)==null?void 0:Ve.cidx)!=null?xe:"Current IDX")+"")&&A(M,O),oe[0]&64&&z.value!==ee[6].o.c&&Me(z,ee[6].o.c),oe[0]&4&&R!==(R=((_t=(We=(it=(Je=ee[2].conf)==null?void 0:Je.mqtt)==null?void 0:it.domoticz)==null?void 0:We.vidx)!=null?_t:"Voltage IDX")+"")&&A(F,R),oe[0]&64&&W.value!==ee[6].o.u1&&Me(W,ee[6].o.u1),oe[0]&64&&B.value!==ee[6].o.u2&&Me(B,ee[6].o.u2),oe[0]&64&&Z.value!==ee[6].o.u3&&Me(Z,ee[6].o.u3)},d(ee){ee&&P(e),ne=!1,Ht(X)}}}function wa(t){var H,Z,ne,X,$,ae,le,se,fe,re,Q,x,ge,pe,N,w;let e,l,n=((X=(ne=(Z=(H=t[2].conf)==null?void 0:H.mqtt)==null?void 0:Z.ha)==null?void 0:ne.title)!=null?X:"Home-Assistant")+"",i,s,a,r,f,u,m,_,d=((se=(le=(ae=($=t[2].conf)==null?void 0:$.mqtt)==null?void 0:ae.ha)==null?void 0:le.discovery)!=null?se:"Discovery topic prefix")+"",v,b,h,C,k,T,q=((x=(Q=(re=(fe=t[2].conf)==null?void 0:fe.mqtt)==null?void 0:re.ha)==null?void 0:Q.hostname)!=null?x:"Hostname for URL")+"",O,M,U,I,z,y,V,R=((w=(N=(pe=(ge=t[2].conf)==null?void 0:ge.mqtt)==null?void 0:pe.ha)==null?void 0:N.tag)!=null?w:"Name tag")+"",F,Y,j,W,K,B;return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),v=S(d),b=p("br"),h=g(),C=p("input"),k=g(),T=p("div"),O=S(q),M=p("br"),U=g(),I=p("input"),y=g(),V=p("div"),F=S(R),Y=p("br"),j=g(),W=p("input"),c(l,"class","text-sm"),c(a,"href",ql("MQTT-configuration#home-assistant")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","h"),u.value="true",c(C,"name","ht"),c(C,"type","text"),c(C,"class","in-s"),c(C,"placeholder","homeassistant"),c(_,"class","my-1"),c(I,"name","hh"),c(I,"type","text"),c(I,"class","in-s"),c(I,"placeholder",z=t[6].g.h+".local"),c(T,"class","my-1"),c(W,"name","hn"),c(W,"type","text"),c(W,"class","in-s"),c(V,"class","my-1"),c(e,"class","cnt")},m(D,L){E(D,e,L),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,v),o(_,b),o(_,h),o(_,C),Me(C,t[6].h.t),o(e,k),o(e,T),o(T,O),o(T,M),o(T,U),o(T,I),Me(I,t[6].h.h),o(e,y),o(e,V),o(V,F),o(V,Y),o(V,j),o(V,W),Me(W,t[6].h.n),K||(B=[me(C,"input",t[80]),me(I,"input",t[81]),me(W,"input",t[82])],K=!0)},p(D,L){var G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe;L[0]&4&&n!==(n=((oe=(ee=(te=(G=D[2].conf)==null?void 0:G.mqtt)==null?void 0:te.ha)==null?void 0:ee.title)!=null?oe:"Home-Assistant")+"")&&A(i,n),L[0]&4&&d!==(d=((de=(Ce=(Pe=(ce=D[2].conf)==null?void 0:ce.mqtt)==null?void 0:Pe.ha)==null?void 0:Ce.discovery)!=null?de:"Discovery topic prefix")+"")&&A(v,d),L[0]&64&&C.value!==D[6].h.t&&Me(C,D[6].h.t),L[0]&4&&q!==(q=((be=(ve=(Te=(Ne=D[2].conf)==null?void 0:Ne.mqtt)==null?void 0:Te.ha)==null?void 0:ve.hostname)!=null?be:"Hostname for URL")+"")&&A(O,q),L[0]&64&&z!==(z=D[6].g.h+".local")&&c(I,"placeholder",z),L[0]&64&&I.value!==D[6].h.h&&Me(I,D[6].h.h),L[0]&4&&R!==(R=((xe=(Ve=(ye=(He=D[2].conf)==null?void 0:He.mqtt)==null?void 0:ye.ha)==null?void 0:Ve.tag)!=null?xe:"Name tag")+"")&&A(F,R),L[0]&64&&W.value!==D[6].h.n&&Me(W,D[6].h.n)},d(D){D&&P(e),K=!1,Ht(B)}}}function Ca(t){var W,K,B,H,Z,ne,X,$,ae,le,se;let e,l,n=((B=(K=(W=t[2].conf)==null?void 0:W.cloud)==null?void 0:K.title)!=null?B:"Cloud connections")+"",i,s,a,r,f,u,m,_,d,v,b,h=((ne=(Z=(H=t[2].conf)==null?void 0:H.cloud)==null?void 0:Z.ams)!=null?ne:"AMS reader cloud")+"",C,k,T,q,O,M,U,I=((ae=($=(X=t[2].conf)==null?void 0:X.cloud)==null?void 0:$.es)!=null?ae:"Energy Speedometer")+"",z,y,V,R,F,Y=t[5]&&Sa(t),j=((se=(le=t[6])==null?void 0:le.c)==null?void 0:se.es)&&Ma(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),d=p("label"),v=p("input"),b=g(),C=S(h),k=g(),Y&&Y.c(),T=g(),q=p("div"),O=p("label"),M=p("input"),U=g(),z=S(I),y=g(),j&&j.c(),c(l,"class","text-sm"),c(a,"href",ql("Cloud")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","c"),u.value="true",c(v,"type","checkbox"),c(v,"name","ce"),v.__value="true",v.value=v.__value,c(v,"class","rounded mb-1"),c(_,"class","my-1"),c(M,"type","checkbox"),c(M,"class","rounded mb-1"),c(M,"name","ces"),M.__value="true",M.value=M.__value,c(q,"class","my-1"),c(e,"class","cnt")},m(fe,re){E(fe,e,re),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,d),o(d,v),v.checked=t[6].c.e,o(d,b),o(d,C),o(_,k),Y&&Y.m(_,null),o(e,T),o(e,q),o(q,O),o(O,M),M.checked=t[6].c.es,o(O,U),o(O,z),o(q,y),j&&j.m(q,null),V=!0,R||(F=[me(v,"change",t[83]),me(M,"change",t[84])],R=!0)},p(fe,re){var Q,x,ge,pe,N,w,D,L,G,te,ee;(!V||re[0]&4)&&n!==(n=((ge=(x=(Q=fe[2].conf)==null?void 0:Q.cloud)==null?void 0:x.title)!=null?ge:"Cloud connections")+"")&&A(i,n),re[0]&64&&(v.checked=fe[6].c.e),(!V||re[0]&4)&&h!==(h=((w=(N=(pe=fe[2].conf)==null?void 0:pe.cloud)==null?void 0:N.ams)!=null?w:"AMS reader cloud")+"")&&A(C,h),fe[5]?Y?Y.p(fe,re):(Y=Sa(fe),Y.c(),Y.m(_,null)):Y&&(Y.d(1),Y=null),re[0]&64&&(M.checked=fe[6].c.es),(!V||re[0]&4)&&I!==(I=((G=(L=(D=fe[2].conf)==null?void 0:D.cloud)==null?void 0:L.es)!=null?G:"Energy Speedometer")+"")&&A(z,I),(ee=(te=fe[6])==null?void 0:te.c)!=null&&ee.es?j?(j.p(fe,re),re[0]&64&&J(j,1)):(j=Ma(fe),j.c(),J(j,1),j.m(q,null)):j&&(bt(),ie(j,1,1,()=>{j=null}),gt())},i(fe){V||(J(j),V=!0)},o(fe){ie(j),V=!1},d(fe){fe&&P(e),Y&&Y.d(),j&&j.d(),R=!1,Ht(F)}}}function Sa(t){let e,l,n;return{c(){e=p("button"),e.textContent="Connect to my cloud account",c(e,"type","button"),c(e,"class","text-blue-500 ml-6")},m(i,s){E(i,e,s),l||(n=me(e,"click",t[20]),l=!0)},p:Ze,d(i){i&&P(e),l=!1,n()}}}function Ma(t){let e,l,n=t[0].mac+"",i,s,a,r,f=(t[0].meter.id?t[0].meter.id:"missing, required")+"",u,m,_,d,v=t[0].mac&&t[0].meter.id&&Na(t);return{c(){e=p("div"),l=S("MAC: "),i=S(n),s=g(),a=p("div"),r=S("Meter ID: "),u=S(f),m=g(),v&&v.c(),_=$t(),c(e,"class","pl-5"),c(a,"class","pl-5")},m(b,h){E(b,e,h),o(e,l),o(e,i),E(b,s,h),E(b,a,h),o(a,r),o(a,u),E(b,m,h),v&&v.m(b,h),E(b,_,h),d=!0},p(b,h){(!d||h[0]&1)&&n!==(n=b[0].mac+"")&&A(i,n),(!d||h[0]&1)&&f!==(f=(b[0].meter.id?b[0].meter.id:"missing, required")+"")&&A(u,f),b[0].mac&&b[0].meter.id?v?(v.p(b,h),h[0]&1&&J(v,1)):(v=Na(b),v.c(),J(v,1),v.m(_.parentNode,_)):v&&(bt(),ie(v,1,1,()=>{v=null}),gt())},i(b){d||(J(v),d=!0)},o(b){ie(v),d=!1},d(b){b&&P(e),b&&P(s),b&&P(a),b&&P(m),v&&v.d(b),b&&P(_)}}}function Na(t){let e,l,n;return l=new ec({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","pl-2")},m(i,s){E(i,e,s),Le(l,e,null),n=!0},p(i,s){const a={};s[0]&1&&(a.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(a)},i(i){n||(J(l.$$.fragment,i),n=!0)},o(i){ie(l.$$.fragment,i),n=!1},d(i){i&&P(e),Ie(l)}}}function Ta(t){var R,F,Y,j,W,K,B,H;let e,l,n=((Y=(F=(R=t[2].conf)==null?void 0:R.thresholds)==null?void 0:F.title)!=null?Y:"Thresholds")+"",i,s,a,r,f,u,m,_,d,v,b,h=((K=(W=(j=t[2].conf)==null?void 0:j.thresholds)==null?void 0:W.avg)!=null?K:"Average of")+"",C,k,T,q,O,M=((H=(B=t[2].common)==null?void 0:B.hours)!=null?H:"hours")+"",U,I,z,y={length:9},V=[];for(let Z=0;Zt[88].call(k)),c(v,"class","w-1/2"),c(_,"class","flex flex-wrap"),c(e,"class","cnt")},m(j,W){E(j,e,W),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_);for(let K=0;K20&&La(t),v=((O=(q=(T=t[6])==null?void 0:T.i)==null?void 0:q.d)==null?void 0:O.d)>0&&Ra(t),b=t[0].chip=="esp8266"&&Fa(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),d&&d.c(),u=g(),v&&v.c(),m=g(),b&&b.c(),c(l,"class","text-sm"),c(a,"href",ql("GPIO-configuration")),c(a,"target","_blank"),c(a,"class","float-right"),c(e,"class","cnt")},m(M,U){E(M,e,U),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),d&&d.m(e,null),o(e,u),v&&v.m(e,null),o(e,m),b&&b.m(e,null),_=!0},p(M,U){var I,z,y,V,R,F;(!_||U[0]&4)&&n!==(n=((y=(z=(I=M[2].conf)==null?void 0:I.hw)==null?void 0:z.title)!=null?y:"Hardware")+"")&&A(i,n),M[0].board>20?d?(d.p(M,U),U[0]&1&&J(d,1)):(d=La(M),d.c(),J(d,1),d.m(e,u)):d&&(bt(),ie(d,1,1,()=>{d=null}),gt()),((F=(R=(V=M[6])==null?void 0:V.i)==null?void 0:R.d)==null?void 0:F.d)>0?v?v.p(M,U):(v=Ra(M),v.c(),v.m(e,m)):v&&(v.d(1),v=null),M[0].chip=="esp8266"?b?b.p(M,U):(b=Fa(M),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(M){_||(J(d),_=!0)},o(M){ie(d),_=!1},d(M){M&&P(e),d&&d.d(),v&&v.d(),b&&b.d()}}}function La(t){var ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt,qe,Ge,Qt,el,xt,Se,Re,Fe,il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl,Be,et;let e,l,n,i,s=((ct=(Pt=(Rt=(ht=t[2].conf)==null?void 0:ht.hw)==null?void 0:Rt.han)==null?void 0:Pt.rx)!=null?ct:"HAN RX")+"",a,r,f,u,m,_,d,v=((Ut=(Bt=(zt=(Ft=t[2].conf)==null?void 0:Ft.hw)==null?void 0:zt.han)==null?void 0:Bt.tx)!=null?Ut:"HAN TX")+"",b,h,C,k,T,q,O,M,U,I,z=((Vt=(Gt=(yt=(qt=t[2].conf)==null?void 0:qt.hw)==null?void 0:yt.han)==null?void 0:Gt.pullup)!=null?Vt:"pullup")+"",y,V,R,F,Y=((Mt=(Ct=(Yt=t[2].conf)==null?void 0:Yt.hw)==null?void 0:Ct.ap_btn)!=null?Mt:"AP button")+"",j,W,K,B,H,Z,ne=((dt=(Et=(Nt=(ft=t[2].conf)==null?void 0:ft.hw)==null?void 0:Nt.led)==null?void 0:Et.title)!=null?dt:"LED")+"",X,$,ae,le,se,fe,re,Q,x,ge,pe=((qe=(mt=(St=(At=t[2].conf)==null?void 0:At.hw)==null?void 0:St.led)==null?void 0:mt.inverted)!=null?qe:"inverted")+"",N,w,D,L=((xt=(el=(Qt=(Ge=t[2].conf)==null?void 0:Ge.hw)==null?void 0:Qt.led)==null?void 0:el.rgb)!=null?xt:"RGB")+"",G,te,ee,oe,ce=((il=(Fe=(Re=(Se=t[2].conf)==null?void 0:Se.hw)==null?void 0:Re.led)==null?void 0:Fe.inverted)!=null?il:"inverted")+"",Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it=((fl=(al=(ol=(sl=t[2].conf)==null?void 0:sl.hw)==null?void 0:ol.led)==null?void 0:al.disable)!=null?fl:"LED dis. GPIO")+"",We,_t,Ee,_e,Ue,kt=((cl=(rl=(ul=t[2].conf)==null?void 0:ul.hw)==null?void 0:rl.temp)!=null?cl:"Temperature")+"",wt,nt,vt,ze,Ke,Ye,Xe=((pl=(_l=(ml=t[2].conf)==null?void 0:ml.hw)==null?void 0:_l.temp_analog)!=null?pl:"Analog temp")+"",Qe,ut,we,Ae,ke,ue,De,rt,st;m=new Hi({props:{chip:t[0].chip}}),T=new Hi({props:{chip:t[0].chip}});let at=t[0].chip!="esp8266"&&Ia(t),pt=((et=(Be=(dl=t[6])==null?void 0:dl.i)==null?void 0:Be.v)==null?void 0:et.p)>0&&Oa(t);return{c(){e=p("input"),l=g(),n=p("div"),i=p("div"),a=S(s),r=p("br"),f=g(),u=p("select"),Oe(m.$$.fragment),_=g(),d=p("div"),b=S(v),h=p("br"),C=g(),k=p("select"),Oe(T.$$.fragment),q=g(),O=p("div"),M=p("label"),U=p("input"),I=g(),y=S(z),V=g(),R=p("div"),F=p("div"),j=S(Y),W=p("br"),K=g(),B=p("input"),H=g(),Z=p("div"),X=S(ne),$=p("br"),ae=g(),le=p("div"),se=p("input"),fe=g(),re=p("div"),Q=p("label"),x=p("input"),ge=g(),N=S(pe),w=g(),D=p("div"),G=S(L),te=p("label"),ee=p("input"),oe=g(),Pe=S(ce),Ce=p("br"),de=g(),Ne=p("div"),Te=p("input"),ve=g(),be=p("input"),He=g(),ye=p("input"),Ve=g(),xe=p("div"),Je=p("div"),We=S(it),_t=g(),Ee=p("input"),_e=g(),Ue=p("div"),wt=S(kt),nt=p("br"),vt=g(),ze=p("input"),Ke=g(),Ye=p("div"),Qe=S(Xe),ut=p("br"),we=g(),Ae=p("input"),ke=g(),at&&at.c(),ue=g(),pt&&pt.c(),c(e,"type","hidden"),c(e,"name","i"),e.value="true",c(u,"name","ihp"),c(u,"class","in-f w-full"),t[6].i.h.p===void 0&&Wt(()=>t[89].call(u)),c(i,"class","w-1/3"),c(k,"name","iht"),c(k,"class","in-l w-full"),t[6].i.h.t===void 0&&Wt(()=>t[90].call(k)),c(d,"class","w-1/3"),c(U,"name","ihu"),U.__value="true",U.value=U.__value,c(U,"type","checkbox"),c(U,"class","rounded mb-1"),c(M,"class","ml-2"),c(O,"class","w-1/3"),c(n,"class","flex flex-wrap"),c(B,"name","ia"),c(B,"type","number"),c(B,"min","0"),c(B,"max",t[10]),c(B,"class","in-f tr w-full"),c(F,"class","w-1/3"),c(se,"name","ilp"),c(se,"type","number"),c(se,"min","0"),c(se,"max",t[10]),c(se,"class","in-l tr w-full"),c(le,"class","flex"),c(Z,"class","w-1/3"),c(x,"name","ili"),x.__value="true",x.value=x.__value,c(x,"type","checkbox"),c(x,"class","rounded mb-1"),c(Q,"class","ml-4"),c(re,"class","w-1/3"),c(ee,"name","iri"),ee.__value="true",ee.value=ee.__value,c(ee,"type","checkbox"),c(ee,"class","rounded mb-1"),c(te,"class","ml-4"),c(Te,"name","irr"),c(Te,"type","number"),c(Te,"min","0"),c(Te,"max",t[10]),c(Te,"class","in-f tr w-1/3"),c(be,"name","irg"),c(be,"type","number"),c(be,"min","0"),c(be,"max",t[10]),c(be,"class","in-m tr w-1/3"),c(ye,"name","irb"),c(ye,"type","number"),c(ye,"min","0"),c(ye,"max",t[10]),c(ye,"class","in-l tr w-1/3"),c(Ne,"class","flex"),c(D,"class","w-full"),c(Ee,"name","idd"),c(Ee,"type","number"),c(Ee,"min","0"),c(Ee,"max",t[10]),c(Ee,"class","in-s tr"),c(Je,"class","my-1 pr-1 w-1/3"),c(xe,"class","w-full"),c(ze,"name","itd"),c(ze,"type","number"),c(ze,"min","0"),c(ze,"max",t[10]),c(ze,"class","in-f tr w-full"),c(Ue,"class","my-1 w-1/3"),c(Ae,"name","ita"),c(Ae,"type","number"),c(Ae,"min","0"),c(Ae,"max",t[10]),c(Ae,"class","in-l tr w-full"),c(Ye,"class","my-1 pr-1 w-1/3"),c(R,"class","flex flex-wrap")},m(je,he){E(je,e,he),E(je,l,he),E(je,n,he),o(n,i),o(i,a),o(i,r),o(i,f),o(i,u),Le(m,u,null),ot(u,t[6].i.h.p,!0),o(n,_),o(n,d),o(d,b),o(d,h),o(d,C),o(d,k),Le(T,k,null),ot(k,t[6].i.h.t,!0),o(n,q),o(n,O),o(O,M),o(M,U),U.checked=t[6].i.h.u,o(M,I),o(M,y),E(je,V,he),E(je,R,he),o(R,F),o(F,j),o(F,W),o(F,K),o(F,B),Me(B,t[6].i.a),o(R,H),o(R,Z),o(Z,X),o(Z,$),o(Z,ae),o(Z,le),o(le,se),Me(se,t[6].i.l.p),o(R,fe),o(R,re),o(re,Q),o(Q,x),x.checked=t[6].i.l.i,o(Q,ge),o(Q,N),o(R,w),o(R,D),o(D,G),o(D,te),o(te,ee),ee.checked=t[6].i.r.i,o(te,oe),o(te,Pe),o(D,Ce),o(D,de),o(D,Ne),o(Ne,Te),Me(Te,t[6].i.r.r),o(Ne,ve),o(Ne,be),Me(be,t[6].i.r.g),o(Ne,He),o(Ne,ye),Me(ye,t[6].i.r.b),o(R,Ve),o(R,xe),o(xe,Je),o(Je,We),o(Je,_t),o(Je,Ee),Me(Ee,t[6].i.d.d),o(R,_e),o(R,Ue),o(Ue,wt),o(Ue,nt),o(Ue,vt),o(Ue,ze),Me(ze,t[6].i.t.d),o(R,Ke),o(R,Ye),o(Ye,Qe),o(Ye,ut),o(Ye,we),o(Ye,Ae),Me(Ae,t[6].i.t.a),o(R,ke),at&&at.m(R,null),o(R,ue),pt&&pt.m(R,null),De=!0,rt||(st=[me(u,"change",t[89]),me(k,"change",t[90]),me(U,"change",t[91]),me(B,"input",t[92]),me(se,"input",t[93]),me(x,"change",t[94]),me(ee,"change",t[95]),me(Te,"input",t[96]),me(be,"input",t[97]),me(ye,"input",t[98]),me(Ee,"input",t[99]),me(ze,"input",t[100]),me(Ae,"input",t[101])],rt=!0)},p(je,he){var Cl,Sl,Ml,Nl,Tl,Pl,El,Dl,Rl,Fl,Bl,Ul,tt,Ot,vl,bl,pn,dn,vn,hn,bn,gn,kn,wn,Cn,Sn,Mn,Nn,Tn,Pn,En,Dn,qn,An,Ln,In,On,Rn,Fn,Bn,Un,jn,yn,Hn;(!De||he[0]&4)&&s!==(s=((Nl=(Ml=(Sl=(Cl=je[2].conf)==null?void 0:Cl.hw)==null?void 0:Sl.han)==null?void 0:Ml.rx)!=null?Nl:"HAN RX")+"")&&A(a,s);const Kt={};he[0]&1&&(Kt.chip=je[0].chip),m.$set(Kt),he[0]&64&&ot(u,je[6].i.h.p),(!De||he[0]&4)&&v!==(v=((Dl=(El=(Pl=(Tl=je[2].conf)==null?void 0:Tl.hw)==null?void 0:Pl.han)==null?void 0:El.tx)!=null?Dl:"HAN TX")+"")&&A(b,v);const wl={};he[0]&1&&(wl.chip=je[0].chip),T.$set(wl),he[0]&64&&ot(k,je[6].i.h.t),he[0]&64&&(U.checked=je[6].i.h.u),(!De||he[0]&4)&&z!==(z=((Ul=(Bl=(Fl=(Rl=je[2].conf)==null?void 0:Rl.hw)==null?void 0:Fl.han)==null?void 0:Bl.pullup)!=null?Ul:"pullup")+"")&&A(y,z),(!De||he[0]&4)&&Y!==(Y=((vl=(Ot=(tt=je[2].conf)==null?void 0:tt.hw)==null?void 0:Ot.ap_btn)!=null?vl:"AP button")+"")&&A(j,Y),(!De||he[0]&1024)&&c(B,"max",je[10]),he[0]&64&&$e(B.value)!==je[6].i.a&&Me(B,je[6].i.a),(!De||he[0]&4)&&ne!==(ne=((vn=(dn=(pn=(bl=je[2].conf)==null?void 0:bl.hw)==null?void 0:pn.led)==null?void 0:dn.title)!=null?vn:"LED")+"")&&A(X,ne),(!De||he[0]&1024)&&c(se,"max",je[10]),he[0]&64&&$e(se.value)!==je[6].i.l.p&&Me(se,je[6].i.l.p),he[0]&64&&(x.checked=je[6].i.l.i),(!De||he[0]&4)&&pe!==(pe=((kn=(gn=(bn=(hn=je[2].conf)==null?void 0:hn.hw)==null?void 0:bn.led)==null?void 0:gn.inverted)!=null?kn:"inverted")+"")&&A(N,pe),(!De||he[0]&4)&&L!==(L=((Mn=(Sn=(Cn=(wn=je[2].conf)==null?void 0:wn.hw)==null?void 0:Cn.led)==null?void 0:Sn.rgb)!=null?Mn:"RGB")+"")&&A(G,L),he[0]&64&&(ee.checked=je[6].i.r.i),(!De||he[0]&4)&&ce!==(ce=((En=(Pn=(Tn=(Nn=je[2].conf)==null?void 0:Nn.hw)==null?void 0:Tn.led)==null?void 0:Pn.inverted)!=null?En:"inverted")+"")&&A(Pe,ce),(!De||he[0]&1024)&&c(Te,"max",je[10]),he[0]&64&&$e(Te.value)!==je[6].i.r.r&&Me(Te,je[6].i.r.r),(!De||he[0]&1024)&&c(be,"max",je[10]),he[0]&64&&$e(be.value)!==je[6].i.r.g&&Me(be,je[6].i.r.g),(!De||he[0]&1024)&&c(ye,"max",je[10]),he[0]&64&&$e(ye.value)!==je[6].i.r.b&&Me(ye,je[6].i.r.b),(!De||he[0]&4)&&it!==(it=((Ln=(An=(qn=(Dn=je[2].conf)==null?void 0:Dn.hw)==null?void 0:qn.led)==null?void 0:An.disable)!=null?Ln:"LED dis. GPIO")+"")&&A(We,it),(!De||he[0]&1024)&&c(Ee,"max",je[10]),he[0]&64&&$e(Ee.value)!==je[6].i.d.d&&Me(Ee,je[6].i.d.d),(!De||he[0]&4)&&kt!==(kt=((Rn=(On=(In=je[2].conf)==null?void 0:In.hw)==null?void 0:On.temp)!=null?Rn:"Temperature")+"")&&A(wt,kt),(!De||he[0]&1024)&&c(ze,"max",je[10]),he[0]&64&&$e(ze.value)!==je[6].i.t.d&&Me(ze,je[6].i.t.d),(!De||he[0]&4)&&Xe!==(Xe=((Un=(Bn=(Fn=je[2].conf)==null?void 0:Fn.hw)==null?void 0:Bn.temp_analog)!=null?Un:"Analog temp")+"")&&A(Qe,Xe),(!De||he[0]&1024)&&c(Ae,"max",je[10]),he[0]&64&&$e(Ae.value)!==je[6].i.t.a&&Me(Ae,je[6].i.t.a),je[0].chip!="esp8266"?at?at.p(je,he):(at=Ia(je),at.c(),at.m(R,ue)):at&&(at.d(1),at=null),((Hn=(yn=(jn=je[6])==null?void 0:jn.i)==null?void 0:yn.v)==null?void 0:Hn.p)>0?pt?pt.p(je,he):(pt=Oa(je),pt.c(),pt.m(R,null)):pt&&(pt.d(1),pt=null)},i(je){De||(J(m.$$.fragment,je),J(T.$$.fragment,je),De=!0)},o(je){ie(m.$$.fragment,je),ie(T.$$.fragment,je),De=!1},d(je){je&&P(e),je&&P(l),je&&P(n),Ie(m),Ie(T),je&&P(V),je&&P(R),at&&at.d(),pt&&pt.d(),rt=!1,Ht(st)}}}function Ia(t){var u,m,_,d;let e,l=((d=(_=(m=(u=t[2].conf)==null?void 0:u.hw)==null?void 0:m.vcc)==null?void 0:_.title)!=null?d:"Vcc")+"",n,i,s,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),c(a,"name","ivp"),c(a,"type","number"),c(a,"min","0"),c(a,"max",t[10]),c(a,"class","in-s tr w-full"),c(e,"class","my-1 pl-1 w-1/3")},m(v,b){E(v,e,b),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].i.v.p),r||(f=me(a,"input",t[102]),r=!0)},p(v,b){var h,C,k,T;b[0]&4&&l!==(l=((T=(k=(C=(h=v[2].conf)==null?void 0:h.hw)==null?void 0:C.vcc)==null?void 0:k.title)!=null?T:"Vcc")+"")&&A(n,l),b[0]&1024&&c(a,"max",v[10]),b[0]&64&&$e(a.value)!==v[6].i.v.p&&Me(a,v[6].i.v.p)},d(v){v&&P(e),r=!1,f()}}}function Oa(t){var b,h,C,k;let e,l=((k=(C=(h=(b=t[2].conf)==null?void 0:b.hw)==null?void 0:h.vcc)==null?void 0:C.divider)!=null?k:"Voltage divider")+"",n,i,s,a,r,f,u,m,_,d,v;return{c(){var T,q,O,M,U,I,z,y;e=p("div"),n=S(l),i=p("br"),s=g(),a=p("div"),r=p("input"),u=g(),m=p("input"),c(r,"name","ivdv"),c(r,"type","number"),c(r,"min","0"),c(r,"max","65535"),c(r,"class","in-f tr w-full"),c(r,"placeholder",f=(M=(O=(q=(T=t[2].conf)==null?void 0:T.hw)==null?void 0:q.vcc)==null?void 0:O.div_vcc)!=null?M:"VCC"),c(m,"name","ivdg"),c(m,"type","number"),c(m,"min","0"),c(m,"max","65535"),c(m,"class","in-l tr w-full"),c(m,"placeholder",_=(y=(z=(I=(U=t[2].conf)==null?void 0:U.hw)==null?void 0:I.vcc)==null?void 0:z.div_gnd)!=null?y:"GND"),c(a,"class","flex"),c(e,"class","my-1")},m(T,q){E(T,e,q),o(e,n),o(e,i),o(e,s),o(e,a),o(a,r),Me(r,t[6].i.v.d.v),o(a,u),o(a,m),Me(m,t[6].i.v.d.g),d||(v=[me(r,"input",t[103]),me(m,"input",t[104])],d=!0)},p(T,q){var O,M,U,I,z,y,V,R,F,Y,j,W;q[0]&4&&l!==(l=((I=(U=(M=(O=T[2].conf)==null?void 0:O.hw)==null?void 0:M.vcc)==null?void 0:U.divider)!=null?I:"Voltage divider")+"")&&A(n,l),q[0]&4&&f!==(f=(R=(V=(y=(z=T[2].conf)==null?void 0:z.hw)==null?void 0:y.vcc)==null?void 0:V.div_vcc)!=null?R:"VCC")&&c(r,"placeholder",f),q[0]&64&&$e(r.value)!==T[6].i.v.d.v&&Me(r,T[6].i.v.d.v),q[0]&4&&_!==(_=(W=(j=(Y=(F=T[2].conf)==null?void 0:F.hw)==null?void 0:Y.vcc)==null?void 0:j.div_gnd)!=null?W:"GND")&&c(m,"placeholder",_),q[0]&64&&$e(m.value)!==T[6].i.v.d.g&&Me(m,T[6].i.v.d.g)},d(T){T&&P(e),d=!1,Ht(v)}}}function Ra(t){var b,h,C,k,T,q,O,M,U,I,z,y,V,R,F;let e,l=((T=(k=(C=(h=(b=t[2].conf)==null?void 0:b.hw)==null?void 0:h.led)==null?void 0:C.behaviour)==null?void 0:k.title)!=null?T:"LED behaviour")+"",n,i,s,a,r=((I=(U=(M=(O=(q=t[2].conf)==null?void 0:q.hw)==null?void 0:O.led)==null?void 0:M.behaviour)==null?void 0:U.enabled)!=null?I:"Enabled")+"",f,u,m=((F=(R=(V=(y=(z=t[2].conf)==null?void 0:z.hw)==null?void 0:y.led)==null?void 0:V.behaviour)==null?void 0:R.disabled)!=null?F:"Disabled")+"",_,d,v;return{c(){e=p("div"),n=S(l),i=g(),s=p("select"),a=p("option"),f=S(r),u=p("option"),_=S(m),a.__value=0,a.value=a.__value,u.__value=1,u.value=u.__value,c(s,"name","idb"),c(s,"class","in-s"),t[6].i.d.b===void 0&&Wt(()=>t[105].call(s)),c(e,"class","my-1 w-full")},m(Y,j){E(Y,e,j),o(e,n),o(e,i),o(e,s),o(s,a),o(a,f),o(s,u),o(u,_),ot(s,t[6].i.d.b,!0),d||(v=me(s,"change",t[105]),d=!0)},p(Y,j){var W,K,B,H,Z,ne,X,$,ae,le,se,fe,re,Q,x;j[0]&4&&l!==(l=((Z=(H=(B=(K=(W=Y[2].conf)==null?void 0:W.hw)==null?void 0:K.led)==null?void 0:B.behaviour)==null?void 0:H.title)!=null?Z:"LED behaviour")+"")&&A(n,l),j[0]&4&&r!==(r=((le=(ae=($=(X=(ne=Y[2].conf)==null?void 0:ne.hw)==null?void 0:X.led)==null?void 0:$.behaviour)==null?void 0:ae.enabled)!=null?le:"Enabled")+"")&&A(f,r),j[0]&4&&m!==(m=((x=(Q=(re=(fe=(se=Y[2].conf)==null?void 0:se.hw)==null?void 0:fe.led)==null?void 0:re.behaviour)==null?void 0:Q.disabled)!=null?x:"Disabled")+"")&&A(_,m),j[0]&64&&ot(s,Y[6].i.d.b)},d(Y){Y&&P(e),d=!1,v()}}}function Fa(t){var M,U,I,z,y,V,R,F;let e,l,n,i,s=((z=(I=(U=(M=t[2].conf)==null?void 0:M.hw)==null?void 0:U.vcc)==null?void 0:I.offset)!=null?z:"Vcc offset")+"",a,r,f,u,m,_,d=((F=(R=(V=(y=t[2].conf)==null?void 0:y.hw)==null?void 0:V.vcc)==null?void 0:R.multiplier)!=null?F:"Multiplier")+"",v,b,h,C,k,T,q,O=(t[0].board==2||t[0].board==100)&&Ba(t);return{c(){e=p("input"),l=g(),n=p("div"),i=p("div"),a=S(s),r=p("br"),f=g(),u=p("input"),m=g(),_=p("div"),v=S(d),b=p("br"),h=g(),C=p("input"),k=g(),O&&O.c(),c(e,"type","hidden"),c(e,"name","iv"),e.value="true",c(u,"name","ivo"),c(u,"type","number"),c(u,"min","0.0"),c(u,"max","3.5"),c(u,"step","0.01"),c(u,"class","in-f tr w-full"),c(i,"class","w-1/3"),c(C,"name","ivm"),c(C,"type","number"),c(C,"min","0.1"),c(C,"max","10"),c(C,"step","0.01"),c(C,"class","in-l tr w-full"),c(_,"class","w-1/3 pr-1"),c(n,"class","my-1 flex flex-wrap")},m(Y,j){E(Y,e,j),E(Y,l,j),E(Y,n,j),o(n,i),o(i,a),o(i,r),o(i,f),o(i,u),Me(u,t[6].i.v.o),o(n,m),o(n,_),o(_,v),o(_,b),o(_,h),o(_,C),Me(C,t[6].i.v.m),o(n,k),O&&O.m(n,null),T||(q=[me(u,"input",t[106]),me(C,"input",t[107])],T=!0)},p(Y,j){var W,K,B,H,Z,ne,X,$;j[0]&4&&s!==(s=((H=(B=(K=(W=Y[2].conf)==null?void 0:W.hw)==null?void 0:K.vcc)==null?void 0:B.offset)!=null?H:"Vcc offset")+"")&&A(a,s),j[0]&64&&$e(u.value)!==Y[6].i.v.o&&Me(u,Y[6].i.v.o),j[0]&4&&d!==(d=(($=(X=(ne=(Z=Y[2].conf)==null?void 0:Z.hw)==null?void 0:ne.vcc)==null?void 0:X.multiplier)!=null?$:"Multiplier")+"")&&A(v,d),j[0]&64&&$e(C.value)!==Y[6].i.v.m&&Me(C,Y[6].i.v.m),Y[0].board==2||Y[0].board==100?O?O.p(Y,j):(O=Ba(Y),O.c(),O.m(n,null)):O&&(O.d(1),O=null)},d(Y){Y&&P(e),Y&&P(l),Y&&P(n),O&&O.d(),T=!1,Ht(q)}}}function Ba(t){var u,m,_,d;let e,l=((d=(_=(m=(u=t[2].conf)==null?void 0:u.hw)==null?void 0:m.vcc)==null?void 0:_.boot)!=null?d:"Boot limit")+"",n,i,s,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),c(a,"name","ivb"),c(a,"type","number"),c(a,"min","2.5"),c(a,"max","3.5"),c(a,"step","0.1"),c(a,"class","in-s tr w-full"),c(e,"class","w-1/3 pl-1")},m(v,b){E(v,e,b),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].i.v.b),r||(f=me(a,"input",t[108]),r=!0)},p(v,b){var h,C,k,T;b[0]&4&&l!==(l=((T=(k=(C=(h=v[2].conf)==null?void 0:h.hw)==null?void 0:C.vcc)==null?void 0:k.boot)!=null?T:"Boot limit")+"")&&A(n,l),b[0]&64&&$e(a.value)!==v[6].i.v.b&&Me(a,v[6].i.v.b)},d(v){v&&P(e),r=!1,f()}}}function Ua(t){var O,M,U,I,z,y,V,R;let e,l,n=((U=(M=(O=t[2].conf)==null?void 0:O.debug)==null?void 0:M.title)!=null?U:"Debugging")+"",i,s,a,r,f,u,m,_,d,v,b=((y=(z=(I=t[2].conf)==null?void 0:I.debug)==null?void 0:z.enable)!=null?y:"Enable debugging")+"",h,C,k,T,q=((R=(V=t[6])==null?void 0:V.d)==null?void 0:R.s)&&ja(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),a.textContent="\u24D8",r=g(),f=p("input"),u=g(),m=p("div"),_=p("label"),d=p("input"),v=g(),h=S(b),C=g(),q&&q.c(),c(l,"class","text-sm"),c(a,"href","https://amsleser.no/blog/post/24-telnet-debug"),c(a,"target","_blank"),c(a,"class","float-right"),c(f,"type","hidden"),c(f,"name","d"),f.value="true",c(d,"type","checkbox"),c(d,"name","ds"),d.__value="true",d.value=d.__value,c(d,"class","rounded mb-1"),c(m,"class","mt-3"),c(e,"class","cnt")},m(F,Y){E(F,e,Y),o(e,l),o(l,i),o(e,s),o(e,a),o(e,r),o(e,f),o(e,u),o(e,m),o(m,_),o(_,d),d.checked=t[6].d.s,o(_,v),o(_,h),o(e,C),q&&q.m(e,null),k||(T=me(d,"change",t[109]),k=!0)},p(F,Y){var j,W,K,B,H,Z,ne,X;Y[0]&4&&n!==(n=((K=(W=(j=F[2].conf)==null?void 0:j.debug)==null?void 0:W.title)!=null?K:"Debugging")+"")&&A(i,n),Y[0]&64&&(d.checked=F[6].d.s),Y[0]&4&&b!==(b=((Z=(H=(B=F[2].conf)==null?void 0:B.debug)==null?void 0:H.enable)!=null?Z:"Enable debugging")+"")&&A(h,b),(X=(ne=F[6])==null?void 0:ne.d)!=null&&X.s?q?q.p(F,Y):(q=ja(F),q.c(),q.m(e,null)):q&&(q.d(1),q=null)},d(F){F&&P(e),q&&q.d(),k=!1,T()}}}function ja(t){var U,I,z,y,V,R;let e,l=((z=(I=(U=t[2].conf)==null?void 0:U.debug)==null?void 0:I.danger)!=null?z:"Disable when done")+"",n,i,s,a,r,f,u=((R=(V=(y=t[2].conf)==null?void 0:y.debug)==null?void 0:V.telnet)!=null?R:"Enable telnet")+"",m,_,d,v,b,h,C,k,T,q,O,M=t[6].d.t&&ya(t);return{c(){e=p("div"),n=S(l),i=g(),s=p("div"),a=p("label"),r=p("input"),f=g(),m=S(u),_=g(),M&&M.c(),d=g(),v=p("div"),b=p("select"),h=p("option"),h.textContent="Verbose",C=p("option"),C.textContent="Debug",k=p("option"),k.textContent="Info",T=p("option"),T.textContent="Warning",c(e,"class","bd-red"),c(r,"type","checkbox"),c(r,"name","dt"),r.__value="true",r.value=r.__value,c(r,"class","rounded mb-1"),c(s,"class","my-1"),h.__value=1,h.value=h.__value,C.__value=2,C.value=C.__value,k.__value=3,k.value=k.__value,T.__value=4,T.value=T.__value,c(b,"name","dl"),c(b,"class","in-s"),t[6].d.l===void 0&&Wt(()=>t[111].call(b)),c(v,"class","my-1")},m(F,Y){E(F,e,Y),o(e,n),E(F,i,Y),E(F,s,Y),o(s,a),o(a,r),r.checked=t[6].d.t,o(a,f),o(a,m),E(F,_,Y),M&&M.m(F,Y),E(F,d,Y),E(F,v,Y),o(v,b),o(b,h),o(b,C),o(b,k),o(b,T),ot(b,t[6].d.l,!0),q||(O=[me(r,"change",t[110]),me(b,"change",t[111])],q=!0)},p(F,Y){var j,W,K,B,H,Z;Y[0]&4&&l!==(l=((K=(W=(j=F[2].conf)==null?void 0:j.debug)==null?void 0:W.danger)!=null?K:"Disable when done")+"")&&A(n,l),Y[0]&64&&(r.checked=F[6].d.t),Y[0]&4&&u!==(u=((Z=(H=(B=F[2].conf)==null?void 0:B.debug)==null?void 0:H.telnet)!=null?Z:"Enable telnet")+"")&&A(m,u),F[6].d.t?M?M.p(F,Y):(M=ya(F),M.c(),M.m(d.parentNode,d)):M&&(M.d(1),M=null),Y[0]&64&&ot(b,F[6].d.l)},d(F){F&&P(e),F&&P(i),F&&P(s),F&&P(_),M&&M.d(F),F&&P(d),F&&P(v),q=!1,Ht(O)}}}function ya(t){var i,s,a;let e,l=((a=(s=(i=t[2].conf)==null?void 0:i.debug)==null?void 0:s.telnet_danger)!=null?a:"Disable when done")+"",n;return{c(){e=p("div"),n=S(l),c(e,"class","bd-red")},m(r,f){E(r,e,f),o(e,n)},p(r,f){var u,m,_;f[0]&4&&l!==(l=((_=(m=(u=r[2].conf)==null?void 0:u.debug)==null?void 0:m.telnet_danger)!=null?_:"Disable when done")+"")&&A(n,l)},d(r){r&&P(e)}}}function Ha(t){var d,v,b,h;let e,l,n=((v=(d=t[2].conf)==null?void 0:d.btn_reset)!=null?v:"Factory reset")+"",i,s,a,r,f=((h=(b=t[2].btn)==null?void 0:b.reboot)!=null?h:"Reboot")+"",u,m,_;return{c(){e=p("div"),l=p("button"),i=S(n),s=g(),a=p("div"),r=p("button"),u=S(f),c(l,"type","button"),c(l,"class","btn-red"),c(r,"type","button"),c(r,"class","btn-yellow"),c(a,"class","text-center")},m(C,k){E(C,e,k),o(e,l),o(l,i),E(C,s,k),E(C,a,k),o(a,r),o(r,u),m||(_=[me(l,"click",t[12]),me(r,"click",t[14])],m=!0)},p(C,k){var T,q,O,M;k[0]&4&&n!==(n=((q=(T=C[2].conf)==null?void 0:T.btn_reset)!=null?q:"Factory reset")+"")&&A(i,n),k[0]&4&&f!==(f=((M=(O=C[2].btn)==null?void 0:O.reboot)!=null?M:"Reboot")+"")&&A(u,f)},d(C){C&&P(e),C&&P(s),C&&P(a),m=!1,Ht(_)}}}function za(t){var s,a;let e,l,n=((a=(s=t[2].btn)==null?void 0:s.save)!=null?a:"Save")+"",i;return{c(){e=p("div"),l=p("button"),i=S(n),c(l,"type","submit"),c(l,"class","btn-pri"),c(e,"class","text-right")},m(r,f){E(r,e,f),o(e,l),o(l,i)},p(r,f){var u,m;f[0]&4&&n!==(n=((m=(u=r[2].btn)==null?void 0:u.save)!=null?m:"Save")+"")&&A(i,n)},d(r){r&&P(e)}}}function kc(t){var Q,x,ge,pe,N,w,D,L,G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t,Ee,_e,Ue,kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut,we,Ae;let e,l,n,i,s,a,r,f,u,m,_=((ge=(x=(Q=t[6])==null?void 0:Q.p)==null?void 0:x.r)==null?void 0:ge.startsWith("NO"))||((w=(N=(pe=t[6])==null?void 0:pe.p)==null?void 0:N.r)==null?void 0:w.startsWith("10YNO"))||((G=(L=(D=t[6])==null?void 0:D.p)==null?void 0:L.r)==null?void 0:G.startsWith("10Y1001A1001A4")),d,v,b,h=((te=t[6])==null?void 0:te.d)&&((oe=(ee=t[0])==null?void 0:ee.features)==null?void 0:oe.includes("rdebug")),C,k,T,q,O,M,U,I,z,y,V,R,F,Y,j=((ce=t[6])==null?void 0:ce.g)&&na(t),W=((Pe=t[6])==null?void 0:Pe.m)&&aa(t),K=((Ce=t[6])==null?void 0:Ce.w)&&ma(t),B=((de=t[6])==null?void 0:de.n)&&da(t),H=((Ne=t[6])==null?void 0:Ne.q)&&ha(t),Z=((ve=(Te=t[6])==null?void 0:Te.q)==null?void 0:ve.m)==3&&ka(t),ne=((He=(be=t[6])==null?void 0:be.q)==null?void 0:He.m)==4&&wa(t),X=((ye=t[6])==null?void 0:ye.c)&&Ca(t),$=_&&Ta(t),ae=((Ve=t[6])==null?void 0:Ve.u)&&Ea(t),le=((Je=(xe=t[6])==null?void 0:xe.i)==null?void 0:Je.h)&&(((it=t[0])==null?void 0:it.board)>20||((We=t[0])==null?void 0:We.chip)=="esp8266"||((_e=(Ee=(_t=t[6])==null?void 0:_t.i)==null?void 0:Ee.d)==null?void 0:_e.d)>0)&&Aa(t),se=h&&Ua(t),fe=((Ue=t[1])==null?void 0:Ue.a)&&Ha(t),re=t[6]&&za(t);return O=new hl({props:{active:t[3],message:(nt=(wt=(kt=t[2].conf)==null?void 0:kt.mask)==null?void 0:wt.loading)!=null?nt:"Loading"}}),U=new hl({props:{active:t[4],message:(Ke=(ze=(vt=t[2].conf)==null?void 0:vt.mask)==null?void 0:ze.saving)!=null?Ke:"Saving"}}),z=new hl({props:{active:t[8],message:(Qe=(Xe=(Ye=t[2].conf)==null?void 0:Ye.mask)==null?void 0:Xe.reset)!=null?Qe:"Factory reset"}}),V=new hl({props:{active:t[9],message:(Ae=(we=(ut=t[2].conf)==null?void 0:ut.mask)==null?void 0:we.reset_done)!=null?Ae:"Done"}}),{c(){e=p("form"),l=p("div"),j&&j.c(),n=g(),W&&W.c(),i=g(),K&&K.c(),s=g(),B&&B.c(),a=g(),H&&H.c(),r=g(),Z&&Z.c(),f=g(),ne&&ne.c(),u=g(),X&&X.c(),m=g(),$&&$.c(),d=g(),ae&&ae.c(),v=g(),le&&le.c(),b=g(),se&&se.c(),C=g(),k=p("div"),fe&&fe.c(),T=g(),re&&re.c(),q=g(),Oe(O.$$.fragment),M=g(),Oe(U.$$.fragment),I=g(),Oe(z.$$.fragment),y=g(),Oe(V.$$.fragment),c(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),c(k,"class","grid grid-cols-3 mt-3"),c(e,"autocomplete","off")},m(ke,ue){E(ke,e,ue),o(e,l),j&&j.m(l,null),o(l,n),W&&W.m(l,null),o(l,i),K&&K.m(l,null),o(l,s),B&&B.m(l,null),o(l,a),H&&H.m(l,null),o(l,r),Z&&Z.m(l,null),o(l,f),ne&&ne.m(l,null),o(l,u),X&&X.m(l,null),o(l,m),$&&$.m(l,null),o(l,d),ae&&ae.m(l,null),o(l,v),le&&le.m(l,null),o(l,b),se&&se.m(l,null),o(e,C),o(e,k),fe&&fe.m(k,null),o(k,T),re&&re.m(k,null),E(ke,q,ue),Le(O,ke,ue),E(ke,M,ue),Le(U,ke,ue),E(ke,I,ue),Le(z,ke,ue),E(ke,y,ue),Le(V,ke,ue),R=!0,F||(Y=me(e,"submit",ln(t[13])),F=!0)},p(ke,ue){var pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt,qe,Ge,Qt,el,xt,Se,Re,Fe,il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl;(pt=ke[6])!=null&&pt.g?j?(j.p(ke,ue),ue[0]&64&&J(j,1)):(j=na(ke),j.c(),J(j,1),j.m(l,n)):j&&(bt(),ie(j,1,1,()=>{j=null}),gt()),(ht=ke[6])!=null&&ht.m?W?W.p(ke,ue):(W=aa(ke),W.c(),W.m(l,i)):W&&(W.d(1),W=null),(Rt=ke[6])!=null&&Rt.w?K?K.p(ke,ue):(K=ma(ke),K.c(),K.m(l,s)):K&&(K.d(1),K=null),(Pt=ke[6])!=null&&Pt.n?B?(B.p(ke,ue),ue[0]&64&&J(B,1)):(B=da(ke),B.c(),J(B,1),B.m(l,a)):B&&(bt(),ie(B,1,1,()=>{B=null}),gt()),(ct=ke[6])!=null&&ct.q?H?(H.p(ke,ue),ue[0]&64&&J(H,1)):(H=ha(ke),H.c(),J(H,1),H.m(l,r)):H&&(bt(),ie(H,1,1,()=>{H=null}),gt()),((zt=(Ft=ke[6])==null?void 0:Ft.q)==null?void 0:zt.m)==3?Z?Z.p(ke,ue):(Z=ka(ke),Z.c(),Z.m(l,f)):Z&&(Z.d(1),Z=null),((Ut=(Bt=ke[6])==null?void 0:Bt.q)==null?void 0:Ut.m)==4?ne?ne.p(ke,ue):(ne=wa(ke),ne.c(),ne.m(l,u)):ne&&(ne.d(1),ne=null),(qt=ke[6])!=null&&qt.c?X?(X.p(ke,ue),ue[0]&64&&J(X,1)):(X=Ca(ke),X.c(),J(X,1),X.m(l,m)):X&&(bt(),ie(X,1,1,()=>{X=null}),gt()),ue[0]&64&&(_=((Vt=(Gt=(yt=ke[6])==null?void 0:yt.p)==null?void 0:Gt.r)==null?void 0:Vt.startsWith("NO"))||((Mt=(Ct=(Yt=ke[6])==null?void 0:Yt.p)==null?void 0:Ct.r)==null?void 0:Mt.startsWith("10YNO"))||((Et=(Nt=(ft=ke[6])==null?void 0:ft.p)==null?void 0:Nt.r)==null?void 0:Et.startsWith("10Y1001A1001A4"))),_?$?$.p(ke,ue):($=Ta(ke),$.c(),$.m(l,d)):$&&($.d(1),$=null),(dt=ke[6])!=null&&dt.u?ae?ae.p(ke,ue):(ae=Ea(ke),ae.c(),ae.m(l,v)):ae&&(ae.d(1),ae=null),((St=(At=ke[6])==null?void 0:At.i)==null?void 0:St.h)&&(((mt=ke[0])==null?void 0:mt.board)>20||((qe=ke[0])==null?void 0:qe.chip)=="esp8266"||((el=(Qt=(Ge=ke[6])==null?void 0:Ge.i)==null?void 0:Qt.d)==null?void 0:el.d)>0)?le?(le.p(ke,ue),ue[0]&65&&J(le,1)):(le=Aa(ke),le.c(),J(le,1),le.m(l,b)):le&&(bt(),ie(le,1,1,()=>{le=null}),gt()),ue[0]&65&&(h=((xt=ke[6])==null?void 0:xt.d)&&((Re=(Se=ke[0])==null?void 0:Se.features)==null?void 0:Re.includes("rdebug"))),h?se?se.p(ke,ue):(se=Ua(ke),se.c(),se.m(l,null)):se&&(se.d(1),se=null),(Fe=ke[1])!=null&&Fe.a?fe?fe.p(ke,ue):(fe=Ha(ke),fe.c(),fe.m(k,T)):fe&&(fe.d(1),fe=null),ke[6]?re?re.p(ke,ue):(re=za(ke),re.c(),re.m(k,null)):re&&(re.d(1),re=null);const De={};ue[0]&8&&(De.active=ke[3]),ue[0]&4&&(De.message=(ol=(sl=(il=ke[2].conf)==null?void 0:il.mask)==null?void 0:sl.loading)!=null?ol:"Loading"),O.$set(De);const rt={};ue[0]&16&&(rt.active=ke[4]),ue[0]&4&&(rt.message=(ul=(fl=(al=ke[2].conf)==null?void 0:al.mask)==null?void 0:fl.saving)!=null?ul:"Saving"),U.$set(rt);const st={};ue[0]&256&&(st.active=ke[8]),ue[0]&4&&(st.message=(ml=(cl=(rl=ke[2].conf)==null?void 0:rl.mask)==null?void 0:cl.reset)!=null?ml:"Factory reset"),z.$set(st);const at={};ue[0]&512&&(at.active=ke[9]),ue[0]&4&&(at.message=(dl=(pl=(_l=ke[2].conf)==null?void 0:_l.mask)==null?void 0:pl.reset_done)!=null?dl:"Done"),V.$set(at)},i(ke){R||(J(j),J(B),J(H),J(X),J(le),J(O.$$.fragment,ke),J(U.$$.fragment,ke),J(z.$$.fragment,ke),J(V.$$.fragment,ke),R=!0)},o(ke){ie(j),ie(B),ie(H),ie(X),ie(le),ie(O.$$.fragment,ke),ie(U.$$.fragment,ke),ie(z.$$.fragment,ke),ie(V.$$.fragment,ke),R=!1},d(ke){ke&&P(e),j&&j.d(),W&&W.d(),K&&K.d(),B&&B.d(),H&&H.d(),Z&&Z.d(),ne&&ne.d(),X&&X.d(),$&&$.d(),ae&&ae.d(),le&&le.d(),se&&se.d(),fe&&fe.d(),re&&re.d(),ke&&P(q),Ie(O,ke),ke&&P(M),Ie(U,ke),ke&&P(I),Ie(z,ke),ke&&P(y),Ie(V,ke),F=!1,Y()}}}async function wc(){await(await fetch("reboot",{method:"POST"})).json()}function Cc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,{data:s}=e,a={};Ol.subscribe(qe=>{l(2,a=qe)});let r=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Per phase",key:"h"},{name:"Power factor",key:"f"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Realtime plot",key:"l"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"},{name:"Dark mode",key:"k"}],f=!0,u=!1,m=!1,_,d=[];Gn.subscribe(qe=>{var Ge,Qt,el,xt;qe.version&&(l(5,m=(Ge=qe==null?void 0:qe.c)==null?void 0:Ge.e),l(6,_=qe),l(3,f=!1),l(7,d=[{code:"en",name:"English"}]),((Qt=_==null?void 0:_.u)==null?void 0:Qt.lang)&&_.u.lang!="en"&&d.push({code:_.u.lang,name:(xt=(el=a.language)==null?void 0:el.name)!=null?xt:"Unknown"}),d.push({code:"hub",name:"Load from server"}))}),y0();let v=!1,b=!1;async function h(){if(confirm("Factory reset?")){l(8,v=!0);const qe=new URLSearchParams;qe.append("perform","true");let Qt=await(await fetch("reset",{method:"POST",body:qe})).json();l(8,v=!1),l(9,b=Qt.success)}}async function C(qe){l(4,u=!0);const Ge=new FormData(qe.target),Qt=new URLSearchParams;for(let Se of Ge){const[Re,Fe]=Se;Qt.append(Re,Fe)}let xt=await(await fetch("save",{method:"POST",body:Qt})).json();kl.update(Se=>(Se.hostname=Ge.get("gh"),Se.usrcfg=xt.success,Se.booting=xt.reboot,Ge.get("nm")=="static"&&(Se.net.ip=Ge.get("ni"),Se.net.mask=Ge.get("nu"),Se.net.gw=Ge.get("ng"),Se.net.dns1=Ge.get("nd")),Se.ui=_.u,Se)),l(4,u=!1),Ql(n)}const k=function(){confirm("Reboot?")&&(kl.update(qe=>(qe.booting=!0,qe)),wc())};async function T(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),Gn.update(Ge=>(Ge.q.s.c=!1,Ge)))}async function q(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),Gn.update(Ge=>(Ge.q.s.r=!1,Ge)))}async function O(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),Gn.update(Ge=>(Ge.q.s.k=!1,Ge)))}const M=function(){_.q.s.e?_.q.p==1883&&l(6,_.q.p=8883,_):_.q.p==8883&&l(6,_.q.p=1883,_)};async function U(){if(_.u.lang=="hub"){const qe=await Il("http://hub.amsleser.no/hub/language/list.json");l(7,d=await qe.json()),l(6,_.u.lang=a.language.code,_)}}let I=44;async function z(){const qe=await Il("cloudkey.json");if(qe.status==200){let Ge=await qe.json();window.open("https://www.amsleser.cloud/device/"+Ge.seed)}else alert("Not able to bind to cloud")}const y=window||global;y.bindToCloud=function(){console.log("BIND CALLED")};function V(){_.g.h=this.value,l(6,_)}function R(){_.g.t=Jt(this),l(6,_)}function F(){_.p.r=Jt(this),l(6,_)}function Y(){_.p.c=Jt(this),l(6,_)}function j(){_.p.e=this.checked,l(6,_)}function W(){_.p.t=this.value,l(6,_)}function K(){_.g.s=Jt(this),l(6,_)}function B(){_.g.u=this.value,l(6,_)}function H(){_.g.p=this.value,l(6,_)}function Z(){_.g.c=this.value,l(6,_)}function ne(){_.m.a=Jt(this),l(6,_)}function X(){_.m.b=$e(this.value),l(6,_)}function $(){_.m.i=this.checked,l(6,_)}function ae(){_.m.b=Jt(this),l(6,_)}function le(){_.m.p=Jt(this),l(6,_)}function se(){_.m.s=$e(this.value),l(6,_)}function fe(){_.m.d=Jt(this),l(6,_)}function re(){_.m.f=$e(this.value),l(6,_)}function Q(){_.m.r=$e(this.value),l(6,_)}function x(){_.m.e.e=this.checked,l(6,_)}function ge(){_.m.e.k=this.value,l(6,_)}function pe(){_.m.e.a=this.value,l(6,_)}function N(){_.m.m.e=this.checked,l(6,_)}function w(){_.m.m.w=$e(this.value),l(6,_)}function D(){_.m.m.v=$e(this.value),l(6,_)}function L(){_.m.m.a=$e(this.value),l(6,_)}function G(){_.m.m.c=$e(this.value),l(6,_)}function te(){_.n.c=Jt(this),l(6,_)}function ee(){_.w.s=this.value,l(6,_)}function oe(){_.w.p=this.value,l(6,_)}function ce(){_.w.z=Jt(this),l(6,_)}function Pe(){_.w.w=$e(this.value),l(6,_)}function Ce(){_.w.b=this.checked,l(6,_)}function de(){_.n.m=Jt(this),l(6,_)}function Ne(){_.n.i=this.value,l(6,_)}function Te(){_.n.s=Jt(this),l(6,_)}function ve(){_.n.g=this.value,l(6,_)}function be(){_.n.d1=this.value,l(6,_)}function He(){_.n.d2=this.value,l(6,_)}function ye(){_.n.x=this.checked,l(6,_)}function Ve(){_.n.d=this.checked,l(6,_)}function xe(){_.n.h=this.checked,l(6,_)}function Je(){_.n.n1=this.value,l(6,_)}function it(){_.q.s.e=this.checked,l(6,_)}function We(){_.q.h=this.value,l(6,_)}function _t(){_.q.p=$e(this.value),l(6,_)}function Ee(){_.q.u=this.value,l(6,_)}function _e(){_.q.a=this.value,l(6,_)}function Ue(){_.q.c=this.value,l(6,_)}function kt(){_.q.m=Jt(this),l(6,_)}function wt(){_.q.b=this.value,l(6,_)}function nt(){_.q.t=Jt(this),l(6,_)}function vt(){_.q.d=$e(this.value),l(6,_)}function ze(){_.o.e=this.value,l(6,_)}function Ke(){_.o.c=this.value,l(6,_)}function Ye(){_.o.u1=this.value,l(6,_)}function Xe(){_.o.u2=this.value,l(6,_)}function Qe(){_.o.u3=this.value,l(6,_)}function ut(){_.h.t=this.value,l(6,_)}function we(){_.h.h=this.value,l(6,_)}function Ae(){_.h.n=this.value,l(6,_)}function ke(){_.c.e=this.checked,l(6,_)}function ue(){_.c.es=this.checked,l(6,_)}function De(qe){_.t.t[qe]=$e(this.value),l(6,_)}function rt(){_.t.h=$e(this.value),l(6,_)}function st(qe){_.u[qe.key]=Jt(this),l(6,_)}function at(){_.u.lang=Jt(this),l(6,_)}function pt(){_.i.h.p=Jt(this),l(6,_)}function ht(){_.i.h.t=Jt(this),l(6,_)}function Rt(){_.i.h.u=this.checked,l(6,_)}function Pt(){_.i.a=$e(this.value),l(6,_)}function ct(){_.i.l.p=$e(this.value),l(6,_)}function Ft(){_.i.l.i=this.checked,l(6,_)}function zt(){_.i.r.i=this.checked,l(6,_)}function Bt(){_.i.r.r=$e(this.value),l(6,_)}function Ut(){_.i.r.g=$e(this.value),l(6,_)}function qt(){_.i.r.b=$e(this.value),l(6,_)}function yt(){_.i.d.d=$e(this.value),l(6,_)}function Gt(){_.i.t.d=$e(this.value),l(6,_)}function Vt(){_.i.t.a=$e(this.value),l(6,_)}function Yt(){_.i.v.p=$e(this.value),l(6,_)}function Ct(){_.i.v.d.v=$e(this.value),l(6,_)}function Mt(){_.i.v.d.g=$e(this.value),l(6,_)}function ft(){_.i.d.b=Jt(this),l(6,_)}function Nt(){_.i.v.o=$e(this.value),l(6,_)}function Et(){_.i.v.m=$e(this.value),l(6,_)}function dt(){_.i.v.b=$e(this.value),l(6,_)}function At(){_.d.s=this.checked,l(6,_)}function St(){_.d.t=this.checked,l(6,_)}function mt(){_.d.l=Jt(this),l(6,_)}return t.$$set=qe=>{"basepath"in qe&&l(21,n=qe.basepath),"sysinfo"in qe&&l(0,i=qe.sysinfo),"data"in qe&&l(1,s=qe.data)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(10,I=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39)},[i,s,a,f,u,m,_,d,v,b,I,r,h,C,k,T,q,O,M,U,z,n,V,R,F,Y,j,W,K,B,H,Z,ne,X,$,ae,le,se,fe,re,Q,x,ge,pe,N,w,D,L,G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t,Ee,_e,Ue,kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut,we,Ae,ke,ue,De,rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt]}class Sc extends It{constructor(e){super(),Lt(this,e,Cc,kc,Dt,{basepath:21,sysinfo:0,data:1},null,[-1,-1,-1,-1,-1])}}function Wa(t,e,l){const n=t.slice();return n[22]=e[l],n}function Ga(t){let e,l=t[1].cpu+"",n,i;return{c(){e=S("("),n=S(l),i=S("MHz)")},m(s,a){E(s,e,a),E(s,n,a),E(s,i,a)},p(s,a){a&2&&l!==(l=s[1].cpu+"")&&A(n,l)},d(s){s&&P(e),s&&P(n),s&&P(i)}}}function Mc(t){let e=lt(t[1].chip,t[1].board)+"",l;return{c(){l=S(e)},m(n,i){E(n,l,i)},p(n,i){i&2&&e!==(e=lt(n[1].chip,n[1].board)+"")&&A(l,e)},d(n){n&&P(l)}}}function Va(t){var K,B,H,Z,ne,X,$,ae,le,se,fe,re;let e,l=((H=(B=(K=t[3].status)==null?void 0:K.device)==null?void 0:B.apmac)!=null?H:"AP MAC")+"",n,i,s=t[1].apmac+"",a,r,f,u=((X=(ne=(Z=t[3].status)==null?void 0:Z.device)==null?void 0:ne.last_boot)!=null?X:"Last boot")+"",m,_,d,v,b,h,C=((le=(ae=($=t[3].status)==null?void 0:$.device)==null?void 0:ae.reason)!=null?le:"Reason")+"",k,T,q=((re=(fe=(se=t[3][As(t[1].chip)])==null?void 0:se.reason)==null?void 0:fe[t[1].boot_reason])!=null?re:t[1].boot_reason)+"",O,M,U=t[1].boot_reason+"",I,z,y=t[1].ex_cause+"",V,R,F;const Y=[Tc,Nc],j=[];function W(Q,x){return Q[0].u>0?0:1}return d=W(t),v=j[d]=Y[d](t),{c(){e=p("div"),n=S(l),i=S(": "),a=S(s),r=g(),f=p("div"),m=S(u),_=S(`: - `),v.c(),b=g(),h=p("div"),k=S(C),T=S(": "),O=S(q),M=S(" ("),I=S(U),z=S("/"),V=S(y),R=S(")"),c(e,"class","my-2"),c(f,"class","my-2"),c(h,"class","my-2")},m(Q,x){E(Q,e,x),o(e,n),o(e,i),o(e,a),E(Q,r,x),E(Q,f,x),o(f,m),o(f,_),j[d].m(f,null),E(Q,b,x),E(Q,h,x),o(h,k),o(h,T),o(h,O),o(h,M),o(h,I),o(h,z),o(h,V),o(h,R),F=!0},p(Q,x){var pe,N,w,D,L,G,te,ee,oe,ce,Pe,Ce;(!F||x&8)&&l!==(l=((w=(N=(pe=Q[3].status)==null?void 0:pe.device)==null?void 0:N.apmac)!=null?w:"AP MAC")+"")&&A(n,l),(!F||x&2)&&s!==(s=Q[1].apmac+"")&&A(a,s),(!F||x&8)&&u!==(u=((G=(L=(D=Q[3].status)==null?void 0:D.device)==null?void 0:L.last_boot)!=null?G:"Last boot")+"")&&A(m,u);let ge=d;d=W(Q),d===ge?j[d].p(Q,x):(bt(),ie(j[ge],1,1,()=>{j[ge]=null}),gt(),v=j[d],v?v.p(Q,x):(v=j[d]=Y[d](Q),v.c()),J(v,1),v.m(f,null)),(!F||x&8)&&C!==(C=((oe=(ee=(te=Q[3].status)==null?void 0:te.device)==null?void 0:ee.reason)!=null?oe:"Reason")+"")&&A(k,C),(!F||x&10)&&q!==(q=((Ce=(Pe=(ce=Q[3][As(Q[1].chip)])==null?void 0:ce.reason)==null?void 0:Pe[Q[1].boot_reason])!=null?Ce:Q[1].boot_reason)+"")&&A(O,q),(!F||x&2)&&U!==(U=Q[1].boot_reason+"")&&A(I,U),(!F||x&2)&&y!==(y=Q[1].ex_cause+"")&&A(V,y)},i(Q){F||(J(v),F=!0)},o(Q){ie(v),F=!1},d(Q){Q&&P(e),Q&&P(r),Q&&P(f),j[d].d(),Q&&P(b),Q&&P(h)}}}function Nc(t){let e;return{c(){e=S("-")},m(l,n){E(l,e,n)},p:Ze,i:Ze,o:Ze,d(l){l&&P(e)}}}function Tc(t){let e,l;return e=new Lu({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function Ka(t){var m,_;let e,l,n,i,s=((_=(m=t[3].btn)==null?void 0:m.reboot)!=null?_:"Reboot")+"",a,r,f,u;return l=new Al({props:{to:"/consent",$$slots:{default:[Pc]},$$scope:{ctx:t}}}),{c(){e=p("div"),Oe(l.$$.fragment),n=g(),i=p("button"),a=S(s),c(i,"class","btn-yellow-sm float-right"),c(e,"class","my-2")},m(d,v){E(d,e,v),Le(l,e,null),o(e,n),o(e,i),o(i,a),r=!0,f||(u=me(i,"click",t[12]),f=!0)},p(d,v){var h,C;const b={};v&33554440&&(b.$$scope={dirty:v,ctx:d}),l.$set(b),(!r||v&8)&&s!==(s=((C=(h=d[3].btn)==null?void 0:h.reboot)!=null?C:"Reboot")+"")&&A(a,s)},i(d){r||(J(l.$$.fragment,d),r=!0)},o(d){ie(l.$$.fragment,d),r=!1},d(d){d&&P(e),Ie(l),f=!1,u()}}}function Pc(t){var i,s,a;let e,l=((a=(s=(i=t[3].status)==null?void 0:i.device)==null?void 0:s.btn_consents)!=null?a:"Consents")+"",n;return{c(){e=p("span"),n=S(l),c(e,"class","btn-pri-sm")},m(r,f){E(r,e,f),o(e,n)},p(r,f){var u,m,_;f&8&&l!==(l=((_=(m=(u=r[3].status)==null?void 0:u.device)==null?void 0:m.btn_consents)!=null?_:"Consents")+"")&&A(n,l)},d(r){r&&P(e)}}}function Ya(t){var V,R,F,Y,j,W,K,B,H,Z,ne,X;let e,l,n=((F=(R=(V=t[3].status)==null?void 0:V.meter)==null?void 0:R.title)!=null?F:"Meter")+"",i,s,a,r=((W=(j=(Y=t[3].status)==null?void 0:Y.meter)==null?void 0:j.manufacturer)!=null?W:"Manufacturer")+"",f,u,m=_i(t[1].meter.mfg)+"",_,d,v,b=((H=(B=(K=t[3].status)==null?void 0:K.meter)==null?void 0:B.model)!=null?H:"Model")+"",h,C,k=(t[1].meter.model?t[1].meter.model:"unknown")+"",T,q,O,M=((X=(ne=(Z=t[3].status)==null?void 0:Z.meter)==null?void 0:ne.id)!=null?X:"ID")+"",U,I,z=(t[1].meter.id?t[1].meter.id:"unknown")+"",y;return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("div"),f=S(r),u=S(": "),_=S(m),d=g(),v=p("div"),h=S(b),C=S(": "),T=S(k),q=g(),O=p("div"),U=S(M),I=S(": "),y=S(z),c(l,"class","text-sm"),c(a,"class","my-2"),c(v,"class","my-2"),c(O,"class","my-2"),c(e,"class","cnt")},m($,ae){E($,e,ae),o(e,l),o(l,i),o(e,s),o(e,a),o(a,f),o(a,u),o(a,_),o(e,d),o(e,v),o(v,h),o(v,C),o(v,T),o(e,q),o(e,O),o(O,U),o(O,I),o(O,y)},p($,ae){var le,se,fe,re,Q,x,ge,pe,N,w,D,L;ae&8&&n!==(n=((fe=(se=(le=$[3].status)==null?void 0:le.meter)==null?void 0:se.title)!=null?fe:"Meter")+"")&&A(i,n),ae&8&&r!==(r=((x=(Q=(re=$[3].status)==null?void 0:re.meter)==null?void 0:Q.manufacturer)!=null?x:"Manufacturer")+"")&&A(f,r),ae&2&&m!==(m=_i($[1].meter.mfg)+"")&&A(_,m),ae&8&&b!==(b=((N=(pe=(ge=$[3].status)==null?void 0:ge.meter)==null?void 0:pe.model)!=null?N:"Model")+"")&&A(h,b),ae&2&&k!==(k=($[1].meter.model?$[1].meter.model:"unknown")+"")&&A(T,k),ae&8&&M!==(M=((L=(D=(w=$[3].status)==null?void 0:w.meter)==null?void 0:D.id)!=null?L:"ID")+"")&&A(U,M),ae&2&&z!==(z=($[1].meter.id?$[1].meter.id:"unknown")+"")&&A(y,z)},d($){$&&P(e)}}}function Qa(t){var B,H,Z,ne,X,$,ae,le,se,fe,re,Q;let e,l,n=((Z=(H=(B=t[3].status)==null?void 0:B.network)==null?void 0:H.title)!=null?Z:"Network")+"",i,s,a,r=(($=(X=(ne=t[3].conf)==null?void 0:ne.network)==null?void 0:X.ip)!=null?$:"IP")+"",f,u,m=t[1].net.ip+"",_,d,v,b=((se=(le=(ae=t[3].conf)==null?void 0:ae.network)==null?void 0:le.mask)!=null?se:"Mask")+"",h,C,k=t[1].net.mask+"",T,q,O,M=((Q=(re=(fe=t[3].conf)==null?void 0:fe.network)==null?void 0:re.gw)!=null?Q:"Gateway")+"",U,I,z=t[1].net.gw+"",y,V,R,F,Y,j=t[1].net.dns1&&Xa(t),W=t[1].net.dns2&&Za(t),K=t[1].net.ipv6&&Ja(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("div"),f=S(r),u=S(": "),_=S(m),d=g(),v=p("div"),h=S(b),C=S(": "),T=S(k),q=g(),O=p("div"),U=S(M),I=S(": "),y=S(z),V=g(),R=p("div"),j&&j.c(),F=g(),W&&W.c(),Y=g(),K&&K.c(),c(l,"class","text-sm"),c(a,"class","my-2"),c(v,"class","my-2"),c(O,"class","my-2"),c(R,"class","my-2"),c(e,"class","cnt")},m(x,ge){E(x,e,ge),o(e,l),o(l,i),o(e,s),o(e,a),o(a,f),o(a,u),o(a,_),o(e,d),o(e,v),o(v,h),o(v,C),o(v,T),o(e,q),o(e,O),o(O,U),o(O,I),o(O,y),o(e,V),o(e,R),j&&j.m(R,null),o(R,F),W&&W.m(R,null),o(e,Y),K&&K.m(e,null)},p(x,ge){var pe,N,w,D,L,G,te,ee,oe,ce,Pe,Ce;ge&8&&n!==(n=((w=(N=(pe=x[3].status)==null?void 0:pe.network)==null?void 0:N.title)!=null?w:"Network")+"")&&A(i,n),ge&8&&r!==(r=((G=(L=(D=x[3].conf)==null?void 0:D.network)==null?void 0:L.ip)!=null?G:"IP")+"")&&A(f,r),ge&2&&m!==(m=x[1].net.ip+"")&&A(_,m),ge&8&&b!==(b=((oe=(ee=(te=x[3].conf)==null?void 0:te.network)==null?void 0:ee.mask)!=null?oe:"Mask")+"")&&A(h,b),ge&2&&k!==(k=x[1].net.mask+"")&&A(T,k),ge&8&&M!==(M=((Ce=(Pe=(ce=x[3].conf)==null?void 0:ce.network)==null?void 0:Pe.gw)!=null?Ce:"Gateway")+"")&&A(U,M),ge&2&&z!==(z=x[1].net.gw+"")&&A(y,z),x[1].net.dns1?j?j.p(x,ge):(j=Xa(x),j.c(),j.m(R,F)):j&&(j.d(1),j=null),x[1].net.dns2?W?W.p(x,ge):(W=Za(x),W.c(),W.m(R,null)):W&&(W.d(1),W=null),x[1].net.ipv6?K?K.p(x,ge):(K=Ja(x),K.c(),K.m(e,null)):K&&(K.d(1),K=null)},d(x){x&&P(e),j&&j.d(),W&&W.d(),K&&K.d()}}}function Xa(t){var a,r,f;let e=((f=(r=(a=t[3].conf)==null?void 0:a.network)==null?void 0:r.dns)!=null?f:"DNS")+"",l,n,i=t[1].net.dns1+"",s;return{c(){l=S(e),n=S(": "),s=S(i)},m(u,m){E(u,l,m),E(u,n,m),E(u,s,m)},p(u,m){var _,d,v;m&8&&e!==(e=((v=(d=(_=u[3].conf)==null?void 0:_.network)==null?void 0:d.dns)!=null?v:"DNS")+"")&&A(l,e),m&2&&i!==(i=u[1].net.dns1+"")&&A(s,i)},d(u){u&&P(l),u&&P(n),u&&P(s)}}}function Za(t){var a,r,f;let e=((f=(r=(a=t[3].conf)==null?void 0:a.network)==null?void 0:r.dns)!=null?f:"DNS")+"",l,n,i=t[1].net.dns2+"",s;return{c(){l=S(e),n=S(": "),s=S(i)},m(u,m){E(u,l,m),E(u,n,m),E(u,s,m)},p(u,m){var _,d,v;m&8&&e!==(e=((v=(d=(_=u[3].conf)==null?void 0:_.network)==null?void 0:d.dns)!=null?v:"DNS")+"")&&A(l,e),m&2&&i!==(i=u[1].net.dns2+"")&&A(s,i)},d(u){u&&P(l),u&&P(n),u&&P(s)}}}function Ja(t){let e,l,n=t[1].net.ipv6+"",i,s,a,r,f=t[1].net.dns1v6&&$a(t),u=t[1].net.dns2v6&&xa(t);return{c(){e=p("div"),l=S("IPv6: "),i=S(n),s=g(),a=p("div"),f&&f.c(),r=g(),u&&u.c(),c(e,"class","my-2"),c(a,"class","my-2")},m(m,_){E(m,e,_),o(e,l),o(e,i),E(m,s,_),E(m,a,_),f&&f.m(a,null),o(a,r),u&&u.m(a,null)},p(m,_){_&2&&n!==(n=m[1].net.ipv6+"")&&A(i,n),m[1].net.dns1v6?f?f.p(m,_):(f=$a(m),f.c(),f.m(a,r)):f&&(f.d(1),f=null),m[1].net.dns2v6?u?u.p(m,_):(u=xa(m),u.c(),u.m(a,null)):u&&(u.d(1),u=null)},d(m){m&&P(e),m&&P(s),m&&P(a),f&&f.d(),u&&u.d()}}}function $a(t){let e,l=t[1].net.dns1v6+"",n;return{c(){e=S("DNSv6: "),n=S(l)},m(i,s){E(i,e,s),E(i,n,s)},p(i,s){s&2&&l!==(l=i[1].net.dns1v6+"")&&A(n,l)},d(i){i&&P(e),i&&P(n)}}}function xa(t){let e,l=t[1].net.dns2v6+"",n;return{c(){e=S("DNSv6: "),n=S(l)},m(i,s){E(i,e,s),E(i,n,s)},p(i,s){s&2&&l!==(l=i[1].net.dns2v6+"")&&A(n,l)},d(i){i&&P(e),i&&P(n)}}}function ef(t){var f,u,m,_,d,v;let e,l,n=((m=(u=(f=t[3].status)==null?void 0:f.firmware)==null?void 0:u.failed)!=null?m:"Upgrade from {0} to {1} failed").replace("{0}",t[1].upgrade.f).replace("{1}",t[1].upgrade.t)+"",i,s,a=((v=(d=(_=t[3].errors)==null?void 0:_.http)==null?void 0:d[t[1].upgrade.e])!=null?v:t[1].upgrade.e)+"",r;return{c(){e=p("div"),l=p("div"),i=S(n),s=g(),r=S(a),c(l,"class","bd-yellow"),c(e,"class","my-2")},m(b,h){E(b,e,h),o(e,l),o(l,i),o(l,s),o(l,r)},p(b,h){var C,k,T,q,O,M;h&10&&n!==(n=((T=(k=(C=b[3].status)==null?void 0:C.firmware)==null?void 0:k.failed)!=null?T:"Upgrade from {0} to {1} failed").replace("{0}",b[1].upgrade.f).replace("{1}",b[1].upgrade.t)+"")&&A(i,n),h&10&&a!==(a=((M=(O=(q=b[3].errors)==null?void 0:q.http)==null?void 0:O[b[1].upgrade.e])!=null?M:b[1].upgrade.e)+"")&&A(r,a)},d(b){b&&P(e)}}}function tf(t){var b,h,C;let e,l=((C=(h=(b=t[3].status)==null?void 0:b.firmware)==null?void 0:h.latest)!=null?C:"Latest")+"",n,i,s,a=t[4].tag_name+"",r,f,u,m,_,d=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[4]&&t[4].tag_name!=t[1].version&&lf(t),v=t[1].fwconsent===2&&nf(t);return{c(){e=p("div"),n=S(l),i=S(`: - `),s=p("a"),r=S(a),u=g(),d&&d.c(),m=g(),v&&v.c(),_=$t(),c(s,"href",f=t[4].html_url),c(s,"class","ml-2 text-blue-600 hover:text-blue-800"),c(s,"target","_blank"),c(s,"rel","noreferrer"),c(e,"class","my-2 flex")},m(k,T){E(k,e,T),o(e,n),o(e,i),o(e,s),o(s,r),o(e,u),d&&d.m(e,null),E(k,m,T),v&&v.m(k,T),E(k,_,T)},p(k,T){var q,O,M;T&8&&l!==(l=((M=(O=(q=k[3].status)==null?void 0:q.firmware)==null?void 0:O.latest)!=null?M:"Latest")+"")&&A(n,l),T&16&&a!==(a=k[4].tag_name+"")&&A(r,a),T&16&&f!==(f=k[4].html_url)&&c(s,"href",f),(k[1].security==0||k[0].a)&&k[1].fwconsent===1&&k[4]&&k[4].tag_name!=k[1].version?d?d.p(k,T):(d=lf(k),d.c(),d.m(e,null)):d&&(d.d(1),d=null),k[1].fwconsent===2?v?v.p(k,T):(v=nf(k),v.c(),v.m(_.parentNode,_)):v&&(v.d(1),v=null)},d(k){k&&P(e),d&&d.d(),k&&P(m),v&&v.d(k),k&&P(_)}}}function lf(t){let e,l,n,i,s;return{c(){var a,r,f;e=p("div"),l=p("button"),l.textContent="\u21D3",c(e,"class","flex-none ml-2 text-green-500"),c(e,"title",n=(f=(r=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:r.install)!=null?f:"Install")},m(a,r){E(a,e,r),o(e,l),i||(s=me(l,"click",t[11]),i=!0)},p(a,r){var f,u,m;r&8&&n!==(n=(m=(u=(f=a[3].status)==null?void 0:f.firmware)==null?void 0:u.install)!=null?m:"Install")&&c(e,"title",n)},d(a){a&&P(e),i=!1,s()}}}function nf(t){var s,a,r;let e,l,n=((r=(a=(s=t[3].status)==null?void 0:s.firmware)==null?void 0:a.no_one_click)!=null?r:"One-click upgrade disabled")+"",i;return{c(){e=p("div"),l=p("div"),i=S(n),c(l,"class","bd-yellow"),c(e,"class","my-2")},m(f,u){E(f,e,u),o(e,l),o(l,i)},p(f,u){var m,_,d;u&8&&n!==(n=((d=(_=(m=f[3].status)==null?void 0:m.firmware)==null?void 0:_.no_one_click)!=null?d:"One-click upgrade disabled")+"")&&A(i,n)},d(f){f&&P(e)}}}function sf(t){let e,l=pi(lt(t[1].chip,t[1].board))+"",n;return{c(){e=p("div"),n=S(l),c(e,"class","bd-red")},m(i,s){E(i,e,s),o(e,n)},p(i,s){s&2&&l!==(l=pi(lt(i[1].chip,i[1].board))+"")&&A(n,l)},d(i){i&&P(e)}}}function of(t){let e,l,n,i,s,a;function r(m,_){return m[6].length==0?Dc:Ec}let f=r(t),u=f(t);return{c(){e=p("div"),l=p("form"),n=p("input"),i=g(),u.c(),Vn(n,"display","none"),c(n,"name","file"),c(n,"type","file"),c(n,"accept",".bin"),c(l,"action","/firmware"),c(l,"enctype","multipart/form-data"),c(l,"method","post"),c(l,"autocomplete","off"),c(e,"class","my-2 flex")},m(m,_){E(m,e,_),o(e,l),o(l,n),t[14](n),o(l,i),u.m(l,null),s||(a=[me(n,"change",t[15]),me(l,"submit",t[17])],s=!0)},p(m,_){f===(f=r(m))&&u?u.p(m,_):(u.d(1),u=f(m),u&&(u.c(),u.m(l,null)))},d(m){m&&P(e),t[14](null),u.d(),s=!1,Ht(a)}}}function Ec(t){var r,f;let e=t[6][0].name+"",l,n,i,s=((f=(r=t[3].btn)==null?void 0:r.upload)!=null?f:"Upload")+"",a;return{c(){l=S(e),n=g(),i=p("button"),a=S(s),c(i,"type","submit"),c(i,"class","btn-pri-sm float-right ml-2")},m(u,m){E(u,l,m),E(u,n,m),E(u,i,m),o(i,a)},p(u,m){var _,d;m&64&&e!==(e=u[6][0].name+"")&&A(l,e),m&8&&s!==(s=((d=(_=u[3].btn)==null?void 0:_.upload)!=null?d:"Upload")+"")&&A(a,s)},d(u){u&&P(l),u&&P(n),u&&P(i)}}}function Dc(t){var a,r,f;let e,l=((f=(r=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:r.btn_select_file)!=null?f:"Select file")+"",n,i,s;return{c(){e=p("button"),n=S(l),c(e,"type","button"),c(e,"class","btn-pri-sm float-right")},m(u,m){E(u,e,m),o(e,n),i||(s=me(e,"click",t[16]),i=!0)},p(u,m){var _,d,v;m&8&&l!==(l=((v=(d=(_=u[3].status)==null?void 0:_.firmware)==null?void 0:d.btn_select_file)!=null?v:"Select file")+"")&&A(n,l)},d(u){u&&P(e),i=!1,s()}}}function af(t){var W,K,B,H,Z,ne,X,$,ae;let e,l,n=((B=(K=(W=t[3].status)==null?void 0:W.backup)==null?void 0:K.title)!=null?B:"Backup")+"",i,s,a,r,f,u,m,_,d=((ne=(Z=(H=t[3].status)==null?void 0:H.backup)==null?void 0:Z.secrets)!=null?ne:"Include secrets")+"",v,b,h,C=((ae=($=(X=t[3].status)==null?void 0:X.backup)==null?void 0:$.secrets_desc)!=null?ae:"")+"",k,T,q,O,M,U,I,z,y=t[10],V=[];for(let le=0;le{oe=null}),gt()),(Gt=ue[0])!=null&&Gt.a?ce?(ce.p(ue,De),De&1&&J(ce,1)):(ce=Ka(ue),ce.c(),J(ce,1),ce.m(l,null)):ce&&(bt(),ie(ce,1,1,()=>{ce=null}),gt()),ue[1].meter?Pe?Pe.p(ue,De):(Pe=Ya(ue),Pe.c(),Pe.m(e,j)):Pe&&(Pe.d(1),Pe=null),ue[1].net?Ce?Ce.p(ue,De):(Ce=Qa(ue),Ce.c(),Ce.m(e,W)):Ce&&(Ce.d(1),Ce=null),(!te||De&8)&&H!==(H=((Ct=(Yt=(Vt=ue[3].status)==null?void 0:Vt.firmware)==null?void 0:Yt.title)!=null?Ct:"Firmware")+"")&&A(Z,H),(!te||De&8)&&$!==($=((Nt=(ft=(Mt=ue[3].status)==null?void 0:Mt.firmware)==null?void 0:ft.installed)!=null?Nt:"Installed")+"")&&A(ae,$),(!te||De&2)&&se!==(se=ue[1].version+"")&&A(fe,se),ue[1].upgrade.t&&ue[1].upgrade.t!=ue[1].version?de?de.p(ue,De):(de=ef(ue),de.c(),de.m(K,Q)):de&&(de.d(1),de=null),ue[4]?Ne?Ne.p(ue,De):(Ne=tf(ue),Ne.c(),Ne.m(K,x)):Ne&&(Ne.d(1),Ne=null),De&3&&(ge=(ue[1].security==0||ue[0].a)&&rn(ue[1].board)),ge?Te?Te.p(ue,De):(Te=sf(ue),Te.c(),Te.m(K,pe)):Te&&(Te.d(1),Te=null),ue[1].security==0||ue[0].a?ve?ve.p(ue,De):(ve=of(ue),ve.c(),ve.m(K,null)):ve&&(ve.d(1),ve=null),ue[1].security==0||ue[0].a?be?be.p(ue,De):(be=af(ue),be.c(),be.m(e,null)):be&&(be.d(1),be=null);const st={};De&128&&(st.active=ue[7]),De&8&&(st.message=(At=(dt=(Et=ue[3].status)==null?void 0:Et.mask)==null?void 0:dt.firmware)!=null?At:"Uploading"),D.$set(st);const at={};De&512&&(at.active=ue[9]),De&8&&(at.message=(qe=(mt=(St=ue[3].status)==null?void 0:St.mask)==null?void 0:mt.config)!=null?qe:"Uploading"),G.$set(at)},i(ue){te||(J(q.$$.fragment,ue),J(oe),J(ce),J(D.$$.fragment,ue),J(G.$$.fragment,ue),te=!0)},o(ue){ie(q.$$.fragment,ue),ie(oe),ie(ce),ie(D.$$.fragment,ue),ie(G.$$.fragment,ue),te=!1},d(ue){ue&&P(e),ee&&ee.d(),Ie(q),oe&&oe.d(),ce&&ce.d(),Pe&&Pe.d(),Ce&&Ce.d(),de&&de.d(),Ne&&Ne.d(),Te&&Te.d(),ve&&ve.d(),be&&be.d(),ue&&P(w),Ie(D,ue),ue&&P(L),Ie(G,ue)}}}async function Ic(){await(await fetch("reboot",{method:"POST"})).json()}function Oc(t,e,l){let{data:n}=e,{sysinfo:i}=e,s=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price",key:"is"}],a={};Ol.subscribe(y=>{l(3,a=y)});let r={};ls.subscribe(y=>{l(4,r=Au(i.version,y)),r||l(4,r=y[0])});function f(){var y,V;confirm(((V=(y=a.header)==null?void 0:y.upgrade)!=null?V:"Upgrade to {0}?").replace("{0}",r.tag_name))&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(pi(lt(i.chip,i.board))))&&(kl.update(R=>(R.upgrading=!0,R)),qu(r.tag_name))}const u=function(){var y,V;confirm((V=(y=a.device)==null?void 0:y.reboot_confirm)!=null?V:"Reboot?")&&(kl.update(R=>(R.booting=!0,R)),Ic())};let m,_=[],d=!1,v,b=[],h=!1;es();let C={hostname:"",ip:""};function k(y){l(9,h=!0);const V=new FormData;V.append("file",b[0]),fetch("/configfile",{method:"POST",body:V}).then(R=>R.json()).then(R=>{kl.update(F=>(C&&C.hostname&&(F.hostname=C.hostname),F.booting=R.reboot,C&&C.ip&&(F.net.ip=C.ip),setTimeout(Zn,5e3,i),F))}).catch(R=>{console.error("Error:",R),setTimeout(Zn,5e3,i)})}function T(y){ci[y?"unshift":"push"](()=>{m=y,l(5,m)})}function q(){_=this.files,l(6,_)}const O=()=>{m.click()},M=()=>l(7,d=!0);function U(y){ci[y?"unshift":"push"](()=>{v=y,l(8,v)})}function I(){b=this.files,l(2,b)}const z=()=>{v.click()};return t.$$set=y=>{"data"in y&&l(0,n=y.data),"sysinfo"in y&&l(1,i=y.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&4&&b.length==1){let y=b[0],V=new FileReader,R=F=>{let Y=F.target.result.split(` -`);for(let j in Y){let W=Y[j];W.startsWith("hostname ")?C.hostname=W.split(" ")[1]:W.startsWith("ip ")&&(C.ip=W.split(" ")[1])}};V.onload=R,V.readAsText(y)}},[n,i,b,a,r,m,_,d,v,h,s,f,u,k,T,q,O,M,U,I,z]}class Rc extends It{constructor(e){super(),Lt(this,e,Oc,Lc,Dt,{data:0,sysinfo:1})}}function rf(t){let e,l,n=lt(t[0],7)+"",i,s,a=lt(t[0],5)+"",r,f,u=lt(t[0],4)+"",m,_,d=lt(t[0],3)+"",v,b,h,C,k=lt(t[0],2)+"",T,q,O=lt(t[0],1)+"",M,U,I=lt(t[0],0)+"",z,y,V,R,F=lt(t[0],101)+"",Y,j,W=lt(t[0],100)+"",K;return{c(){e=p("optgroup"),l=p("option"),i=S(n),s=p("option"),r=S(a),f=p("option"),m=S(u),_=p("option"),v=S(d),b=g(),h=p("optgroup"),C=p("option"),T=S(k),q=p("option"),M=S(O),U=p("option"),z=S(I),y=g(),V=p("optgroup"),R=p("option"),Y=S(F),j=p("option"),K=S(W),l.__value=7,l.value=l.__value,s.__value=5,s.value=s.__value,f.__value=4,f.value=f.__value,_.__value=3,_.value=_.__value,c(e,"label","amsleser.no"),C.__value=2,C.value=C.__value,q.__value=1,q.value=q.__value,U.__value=0,U.value=U.__value,c(h,"label","Custom hardware"),R.__value=101,R.value=R.__value,j.__value=100,j.value=j.__value,c(V,"label","Generic hardware")},m(B,H){E(B,e,H),o(e,l),o(l,i),o(e,s),o(s,r),o(e,f),o(f,m),o(e,_),o(_,v),E(B,b,H),E(B,h,H),o(h,C),o(C,T),o(h,q),o(q,M),o(h,U),o(U,z),E(B,y,H),E(B,V,H),o(V,R),o(R,Y),o(V,j),o(j,K)},p(B,H){H&1&&n!==(n=lt(B[0],7)+"")&&A(i,n),H&1&&a!==(a=lt(B[0],5)+"")&&A(r,a),H&1&&u!==(u=lt(B[0],4)+"")&&A(m,u),H&1&&d!==(d=lt(B[0],3)+"")&&A(v,d),H&1&&k!==(k=lt(B[0],2)+"")&&A(T,k),H&1&&O!==(O=lt(B[0],1)+"")&&A(M,O),H&1&&I!==(I=lt(B[0],0)+"")&&A(z,I),H&1&&F!==(F=lt(B[0],101)+"")&&A(Y,F),H&1&&W!==(W=lt(B[0],100)+"")&&A(K,W)},d(B){B&&P(e),B&&P(b),B&&P(h),B&&P(y),B&&P(V)}}}function cf(t){let e,l,n=lt(t[0],201)+"",i,s,a=lt(t[0],202)+"",r,f,u=lt(t[0],203)+"",m,_,d=lt(t[0],241)+"",v,b,h=lt(t[0],242)+"",C,k,T=lt(t[0],243)+"",q,O,M=lt(t[0],200)+"",U;return{c(){e=p("optgroup"),l=p("option"),i=S(n),s=p("option"),r=S(a),f=p("option"),m=S(u),_=p("option"),v=S(d),b=p("option"),C=S(h),k=p("option"),q=S(T),O=p("option"),U=S(M),l.__value=201,l.value=l.__value,s.__value=202,s.value=s.__value,f.__value=203,f.value=f.__value,_.__value=241,_.value=_.__value,b.__value=242,b.value=b.__value,k.__value=243,k.value=k.__value,O.__value=200,O.value=O.__value,c(e,"label","Generic hardware")},m(I,z){E(I,e,z),o(e,l),o(l,i),o(e,s),o(s,r),o(e,f),o(f,m),o(e,_),o(_,v),o(e,b),o(b,C),o(e,k),o(k,q),o(e,O),o(O,U)},p(I,z){z&1&&n!==(n=lt(I[0],201)+"")&&A(i,n),z&1&&a!==(a=lt(I[0],202)+"")&&A(r,a),z&1&&u!==(u=lt(I[0],203)+"")&&A(m,u),z&1&&d!==(d=lt(I[0],241)+"")&&A(v,d),z&1&&h!==(h=lt(I[0],242)+"")&&A(C,h),z&1&&T!==(T=lt(I[0],243)+"")&&A(q,T),z&1&&M!==(M=lt(I[0],200)+"")&&A(U,M)},d(I){I&&P(e)}}}function mf(t){let e,l,n=lt(t[0],7)+"",i,s,a=lt(t[0],6)+"",r,f,u=lt(t[0],5)+"",m,_,d,v,b=lt(t[0],51)+"",h,C,k=lt(t[0],50)+"",T;return{c(){e=p("optgroup"),l=p("option"),i=S(n),s=p("option"),r=S(a),f=p("option"),m=S(u),_=g(),d=p("optgroup"),v=p("option"),h=S(b),C=p("option"),T=S(k),l.__value=7,l.value=l.__value,s.__value=6,s.value=s.__value,f.__value=5,f.value=f.__value,c(e,"label","amsleser.no"),v.__value=51,v.value=v.__value,C.__value=50,C.value=C.__value,c(d,"label","Generic hardware")},m(q,O){E(q,e,O),o(e,l),o(l,i),o(e,s),o(s,r),o(e,f),o(f,m),E(q,_,O),E(q,d,O),o(d,v),o(v,h),o(d,C),o(C,T)},p(q,O){O&1&&n!==(n=lt(q[0],7)+"")&&A(i,n),O&1&&a!==(a=lt(q[0],6)+"")&&A(r,a),O&1&&u!==(u=lt(q[0],5)+"")&&A(m,u),O&1&&b!==(b=lt(q[0],51)+"")&&A(h,b),O&1&&k!==(k=lt(q[0],50)+"")&&A(T,k)},d(q){q&&P(e),q&&P(_),q&&P(d)}}}function _f(t){let e,l,n=lt(t[0],8)+"",i,s,a,r,f=lt(t[0],71)+"",u,m,_=lt(t[0],70)+"",d;return{c(){e=p("optgroup"),l=p("option"),i=S(n),s=g(),a=p("optgroup"),r=p("option"),u=S(f),m=p("option"),d=S(_),l.__value=8,l.value=l.__value,c(e,"label","Custom hardware"),r.__value=71,r.value=r.__value,m.__value=70,m.value=m.__value,c(a,"label","Generic hardware")},m(v,b){E(v,e,b),o(e,l),o(l,i),E(v,s,b),E(v,a,b),o(a,r),o(r,u),o(a,m),o(m,d)},p(v,b){b&1&&n!==(n=lt(v[0],8)+"")&&A(i,n),b&1&&f!==(f=lt(v[0],71)+"")&&A(u,f),b&1&&_!==(_=lt(v[0],70)+"")&&A(d,_)},d(v){v&&P(e),v&&P(s),v&&P(a)}}}function pf(t){let e,l,n=lt(t[0],200)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=S(n),l.__value=200,l.value=l.__value,c(e,"label","Generic hardware")},m(s,a){E(s,e,a),o(e,l),o(l,i)},p(s,a){a&1&&n!==(n=lt(s[0],200)+"")&&A(i,n)},d(s){s&&P(e)}}}function df(t){let e,l,n=lt(t[0],80)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=S(n),l.__value=80,l.value=l.__value,c(e,"label","Generic hardware")},m(s,a){E(s,e,a),o(e,l),o(l,i)},p(s,a){a&1&&n!==(n=lt(s[0],80)+"")&&A(i,n)},d(s){s&&P(e)}}}function Fc(t){let e,l,n,i,s,a,r,f,u=t[0]=="esp8266"&&rf(t),m=t[0]=="esp32"&&cf(t),_=t[0]=="esp32s2"&&mf(t),d=t[0]=="esp32c3"&&_f(t),v=t[0]=="esp32solo"&&pf(t),b=t[0]=="esp32s3"&&df(t);return{c(){e=p("option"),l=g(),u&&u.c(),n=g(),m&&m.c(),i=g(),_&&_.c(),s=g(),d&&d.c(),a=g(),v&&v.c(),r=g(),b&&b.c(),f=$t(),e.__value=-1,e.value=e.__value},m(h,C){E(h,e,C),E(h,l,C),u&&u.m(h,C),E(h,n,C),m&&m.m(h,C),E(h,i,C),_&&_.m(h,C),E(h,s,C),d&&d.m(h,C),E(h,a,C),v&&v.m(h,C),E(h,r,C),b&&b.m(h,C),E(h,f,C)},p(h,[C]){h[0]=="esp8266"?u?u.p(h,C):(u=rf(h),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null),h[0]=="esp32"?m?m.p(h,C):(m=cf(h),m.c(),m.m(i.parentNode,i)):m&&(m.d(1),m=null),h[0]=="esp32s2"?_?_.p(h,C):(_=mf(h),_.c(),_.m(s.parentNode,s)):_&&(_.d(1),_=null),h[0]=="esp32c3"?d?d.p(h,C):(d=_f(h),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null),h[0]=="esp32solo"?v?v.p(h,C):(v=pf(h),v.c(),v.m(r.parentNode,r)):v&&(v.d(1),v=null),h[0]=="esp32s3"?b?b.p(h,C):(b=df(h),b.c(),b.m(f.parentNode,f)):b&&(b.d(1),b=null)},i:Ze,o:Ze,d(h){h&&P(e),h&&P(l),u&&u.d(h),h&&P(n),m&&m.d(h),h&&P(i),_&&_.d(h),h&&P(s),d&&d.d(h),h&&P(a),v&&v.d(h),h&&P(r),b&&b.d(h),h&&P(f)}}}function Bc(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Uc extends It{constructor(e){super(),Lt(this,e,Bc,Fc,Dt,{chip:0})}}function vf(t){let e;return{c(){e=p("div"),e.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",c(e,"class","bd-red")},m(l,n){E(l,e,n)},d(l){l&&P(e)}}}function hf(t){let e,l,n,i,s,a,r;return a=new Hi({props:{chip:t[0].chip}}),{c(){e=p("div"),l=S("HAN GPIO"),n=p("br"),i=g(),s=p("select"),Oe(a.$$.fragment),c(s,"name","vh"),c(s,"class","in-s"),c(e,"class","my-3")},m(f,u){E(f,e,u),o(e,l),o(e,n),o(e,i),o(e,s),Le(a,s,null),r=!0},p(f,u){const m={};u&1&&(m.chip=f[0].chip),a.$set(m)},i(f){r||(J(a.$$.fragment,f),r=!0)},o(f){ie(a.$$.fragment,f),r=!1},d(f){f&&P(e),Ie(a)}}}function jc(t){let e,l,n,i,s,a,r,f,u,m,_,d,v,b,h,C,k,T,q,O,M,U,I,z,y,V,R,F,Y,j=t[0].usrcfg&&vf();b=new Uc({props:{chip:t[0].chip}});let W=t[0].board&&t[0].board>20&&hf(t);return V=new hl({props:{active:t[1],message:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("input"),s=g(),a=p("strong"),a.textContent="Initial configuration",r=g(),j&&j.c(),f=g(),u=p("div"),m=S("Board type"),_=p("br"),d=g(),v=p("select"),Oe(b.$$.fragment),h=g(),W&&W.c(),C=g(),k=p("div"),T=p("label"),q=p("input"),O=S(" Clear all other configuration"),M=g(),U=p("div"),U.innerHTML='',I=g(),z=p("span"),z.textContent="\xA0",y=g(),Oe(V.$$.fragment),c(i,"type","hidden"),c(i,"name","v"),i.value="true",c(a,"class","text-sm"),c(v,"name","vb"),c(v,"class","in-s"),t[0].board===void 0&&Wt(()=>t[5].call(v)),c(u,"class","my-3"),c(q,"type","checkbox"),c(q,"name","vr"),q.__value="true",q.value=q.__value,c(q,"class","rounded mb-1"),c(k,"class","my-3"),c(U,"class","my-3"),c(z,"class","clear-both"),c(n,"autocomplete","off"),c(l,"class","cnt"),c(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(K,B){E(K,e,B),o(e,l),o(l,n),o(n,i),o(n,s),o(n,a),o(n,r),j&&j.m(n,null),o(n,f),o(n,u),o(u,m),o(u,_),o(u,d),o(u,v),Le(b,v,null),ot(v,t[0].board,!0),o(n,h),W&&W.m(n,null),o(n,C),o(n,k),o(k,T),o(T,q),q.checked=t[2],o(T,O),o(n,M),o(n,U),o(n,I),o(n,z),E(K,y,B),Le(V,K,B),R=!0,F||(Y=[me(v,"change",t[5]),me(q,"change",t[6]),me(n,"submit",ln(t[3]))],F=!0)},p(K,[B]){K[0].usrcfg?j||(j=vf(),j.c(),j.m(n,f)):j&&(j.d(1),j=null);const H={};B&1&&(H.chip=K[0].chip),b.$set(H),B&1&&ot(v,K[0].board),K[0].board&&K[0].board>20?W?(W.p(K,B),B&1&&J(W,1)):(W=hf(K),W.c(),J(W,1),W.m(n,C)):W&&(bt(),ie(W,1,1,()=>{W=null}),gt()),B&4&&(q.checked=K[2]);const Z={};B&2&&(Z.active=K[1]),V.$set(Z)},i(K){R||(J(b.$$.fragment,K),J(W),J(V.$$.fragment,K),R=!0)},o(K){ie(b.$$.fragment,K),ie(W),ie(V.$$.fragment,K),R=!1},d(K){K&&P(e),j&&j.d(),Ie(b),W&&W.d(),K&&P(y),Ie(V,K),F=!1,Ht(Y)}}}function yc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,s=!1;async function a(m){l(1,s=!0);const _=new FormData(m.target),d=new URLSearchParams;for(let h of _){const[C,k]=h;d.append(C,k)}let b=await(await fetch("save",{method:"POST",body:d})).json();l(1,s=!1),kl.update(h=>(h.vndcfg=b.success,h.booting=b.reboot,h.if.eth=h.boardType>240&&h.boardType<250,h)),Ql(n+(i.usrcfg?"/":"/setup"))}let r=!1;kl.subscribe(m=>{l(0,i=m),m.fwconsent===1&&l(2,r=!i.usrcfg)});function f(){i.board=Jt(this),l(0,i)}function u(){r=this.checked,l(2,r)}return t.$$set=m=>{"basepath"in m&&l(4,n=m.basepath),"sysinfo"in m&&l(0,i=m.sysinfo)},[i,s,r,a,n,f,u]}class Hc extends It{constructor(e){super(),Lt(this,e,yc,jc,Dt,{basepath:4,sysinfo:0})}}function bf(t){var i,s,a;let e,l=((a=(s=(i=t[1].conf)==null?void 0:i.connection)==null?void 0:s.eth)!=null?a:"Ethernet")+"",n;return{c(){e=p("option"),n=S(l),e.__value=3,e.value=e.__value},m(r,f){E(r,e,f),o(e,n)},p(r,f){var u,m,_;f&2&&l!==(l=((_=(m=(u=r[1].conf)==null?void 0:u.connection)==null?void 0:m.eth)!=null?_:"Ethernet")+"")&&A(n,l)},d(r){r&&P(e)}}}function gf(t){var C,k,T,q,O,M;let e,l=((T=(k=(C=t[1].conf)==null?void 0:C.connection)==null?void 0:k.ssid)!=null?T:"SSID")+"",n,i,s,a,r,f,u,m=((M=(O=(q=t[1].conf)==null?void 0:q.connection)==null?void 0:O.psk)!=null?M:"Password")+"",_,d,v,b,h;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),f=g(),u=p("div"),_=S(m),d=p("br"),v=g(),b=p("input"),c(a,"name","ss"),c(a,"type","text"),c(a,"class","in-s"),a.required=r=t[3]==1||t[3]==2,c(e,"class","my-3"),c(b,"name","sp"),c(b,"type","password"),c(b,"class","in-s"),c(b,"autocomplete","off"),b.required=h=t[3]==2,c(u,"class","my-3")},m(U,I){E(U,e,I),o(e,n),o(e,i),o(e,s),o(e,a),E(U,f,I),E(U,u,I),o(u,_),o(u,d),o(u,v),o(u,b)},p(U,I){var z,y,V,R,F,Y;I&2&&l!==(l=((V=(y=(z=U[1].conf)==null?void 0:z.connection)==null?void 0:y.ssid)!=null?V:"SSID")+"")&&A(n,l),I&8&&r!==(r=U[3]==1||U[3]==2)&&(a.required=r),I&2&&m!==(m=((Y=(F=(R=U[1].conf)==null?void 0:R.connection)==null?void 0:F.psk)!=null?Y:"Password")+"")&&A(_,m),I&8&&h!==(h=U[3]==2)&&(b.required=h)},d(U){U&&P(e),U&&P(f),U&&P(u)}}}function kf(t){let e,l,n,i,s,a,r,f;return r=new Fu({}),{c(){e=p("br"),l=g(),n=p("div"),i=p("input"),s=g(),a=p("select"),Oe(r.$$.fragment),c(i,"name","si"),c(i,"type","text"),c(i,"class","in-f w-full"),i.required=t[2],c(a,"name","su"),c(a,"class","in-l"),a.required=t[2],c(n,"class","flex")},m(u,m){E(u,e,m),E(u,l,m),E(u,n,m),o(n,i),o(n,s),o(n,a),Le(r,a,null),f=!0},p(u,m){(!f||m&4)&&(i.required=u[2]),(!f||m&4)&&(a.required=u[2])},i(u){f||(J(r.$$.fragment,u),f=!0)},o(u){ie(r.$$.fragment,u),f=!1},d(u){u&&P(e),u&&P(l),u&&P(n),Ie(r)}}}function wf(t){var h,C,k,T,q,O;let e,l,n=((k=(C=(h=t[1].conf)==null?void 0:h.network)==null?void 0:C.gw)!=null?k:"Gateway")+"",i,s,a,r,f,u,m=((O=(q=(T=t[1].conf)==null?void 0:T.network)==null?void 0:q.dns)!=null?O:"DNS")+"",_,d,v,b;return{c(){e=p("div"),l=p("div"),i=S(n),s=p("br"),a=g(),r=p("input"),f=g(),u=p("div"),_=S(m),d=p("br"),v=g(),b=p("input"),c(r,"name","sg"),c(r,"type","text"),c(r,"class","in-f w-full"),c(b,"name","sd"),c(b,"type","text"),c(b,"class","in-l w-full"),c(e,"class","my-3 flex")},m(M,U){E(M,e,U),o(e,l),o(l,i),o(l,s),o(l,a),o(l,r),o(e,f),o(e,u),o(u,_),o(u,d),o(u,v),o(u,b)},p(M,U){var I,z,y,V,R,F;U&2&&n!==(n=((y=(z=(I=M[1].conf)==null?void 0:I.network)==null?void 0:z.gw)!=null?y:"Gateway")+"")&&A(i,n),U&2&&m!==(m=((F=(R=(V=M[1].conf)==null?void 0:V.network)==null?void 0:R.dns)!=null?F:"DNS")+"")&&A(_,m)},d(M){M&&P(e)}}}function zc(t){var G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t;let e,l,n,i,s,a,r=((te=(G=t[1].setup)==null?void 0:G.title)!=null?te:"Setup")+"",f,u,m,_=((ce=(oe=(ee=t[1].conf)==null?void 0:ee.connection)==null?void 0:oe.title)!=null?ce:"Connection")+"",d,v,b,h,C,k=((de=(Ce=(Pe=t[1].conf)==null?void 0:Pe.connection)==null?void 0:Ce.wifi)!=null?de:"Connect to WiFi")+"",T,q,O=((ve=(Te=(Ne=t[1].conf)==null?void 0:Ne.connection)==null?void 0:Te.ap)!=null?ve:"Standalone access point")+"",M,U,I,z,y=((ye=(He=(be=t[1].conf)==null?void 0:be.general)==null?void 0:He.hostname)!=null?ye:"Hostname")+"",V,R,F,Y,j,W,K,B,H=((xe=(Ve=t[1].setup)==null?void 0:Ve.static)!=null?xe:"Static IP")+"",Z,ne,X,$,ae,le,se=((it=(Je=t[1].btn)==null?void 0:Je.save)!=null?it:"Save")+"",fe,re,Q,x,ge,pe,N=t[0].if&&t[0].if.eth&&bf(t),w=(t[3]==1||t[3]==2)&&gf(t),D=t[2]&&kf(t),L=t[2]&&wf(t);return Q=new hl({props:{active:t[4],message:(_t=(We=t[1].setup)==null?void 0:We.mask)!=null?_t:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("input"),s=g(),a=p("strong"),f=S(r),u=g(),m=p("div"),d=S(_),v=p("br"),b=g(),h=p("select"),C=p("option"),T=S(k),q=p("option"),M=S(O),N&&N.c(),U=g(),w&&w.c(),I=g(),z=p("div"),V=S(y),R=g(),F=p("input"),Y=g(),j=p("div"),W=p("label"),K=p("input"),B=g(),Z=S(H),ne=g(),D&&D.c(),X=g(),L&&L.c(),$=g(),ae=p("div"),le=p("button"),fe=S(se),re=g(),Oe(Q.$$.fragment),c(i,"type","hidden"),c(i,"name","s"),i.value="true",c(a,"class","text-sm"),C.__value=1,C.value=C.__value,q.__value=2,q.value=q.__value,c(h,"name","sc"),c(h,"class","in-s"),t[3]===void 0&&Wt(()=>t[6].call(h)),c(m,"class","my-3"),c(F,"name","sh"),c(F,"type","text"),c(F,"class","in-s"),c(F,"maxlength","32"),c(F,"pattern","[a-z0-9_-]+"),c(F,"placeholder","Optional, ex.: ams-reader"),c(F,"autocomplete","off"),c(K,"type","checkbox"),c(K,"name","sm"),K.__value="static",K.value=K.__value,c(K,"class","rounded mb-1"),c(j,"class","my-3"),c(le,"type","submit"),c(le,"class","btn-pri"),c(ae,"class","my-3"),c(l,"class","cnt"),c(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Ee,_e){E(Ee,e,_e),o(e,l),o(l,n),o(n,i),o(n,s),o(n,a),o(a,f),o(n,u),o(n,m),o(m,d),o(m,v),o(m,b),o(m,h),o(h,C),o(C,T),o(h,q),o(q,M),N&&N.m(h,null),ot(h,t[3],!0),o(n,U),w&&w.m(n,null),o(n,I),o(n,z),o(z,V),o(z,R),o(z,F),Me(F,t[0].hostname),o(n,Y),o(n,j),o(j,W),o(W,K),K.checked=t[2],o(W,B),o(W,Z),o(j,ne),D&&D.m(j,null),o(n,X),L&&L.m(n,null),o(n,$),o(n,ae),o(ae,le),o(le,fe),E(Ee,re,_e),Le(Q,Ee,_e),x=!0,ge||(pe=[me(h,"change",t[6]),me(F,"input",t[7]),me(K,"change",t[8]),me(n,"submit",ln(t[5]))],ge=!0)},p(Ee,[_e]){var kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut,we,Ae,ke,ue,De,rt,st,at,pt,ht;(!x||_e&2)&&r!==(r=((wt=(kt=Ee[1].setup)==null?void 0:kt.title)!=null?wt:"Setup")+"")&&A(f,r),(!x||_e&2)&&_!==(_=((ze=(vt=(nt=Ee[1].conf)==null?void 0:nt.connection)==null?void 0:vt.title)!=null?ze:"Connection")+"")&&A(d,_),(!x||_e&2)&&k!==(k=((Xe=(Ye=(Ke=Ee[1].conf)==null?void 0:Ke.connection)==null?void 0:Ye.wifi)!=null?Xe:"Connect to WiFi")+"")&&A(T,k),(!x||_e&2)&&O!==(O=((we=(ut=(Qe=Ee[1].conf)==null?void 0:Qe.connection)==null?void 0:ut.ap)!=null?we:"Standalone access point")+"")&&A(M,O),Ee[0].if&&Ee[0].if.eth?N?N.p(Ee,_e):(N=bf(Ee),N.c(),N.m(h,null)):N&&(N.d(1),N=null),_e&8&&ot(h,Ee[3]),Ee[3]==1||Ee[3]==2?w?w.p(Ee,_e):(w=gf(Ee),w.c(),w.m(n,I)):w&&(w.d(1),w=null),(!x||_e&2)&&y!==(y=((ue=(ke=(Ae=Ee[1].conf)==null?void 0:Ae.general)==null?void 0:ke.hostname)!=null?ue:"Hostname")+"")&&A(V,y),_e&1&&F.value!==Ee[0].hostname&&Me(F,Ee[0].hostname),_e&4&&(K.checked=Ee[2]),(!x||_e&2)&&H!==(H=((rt=(De=Ee[1].setup)==null?void 0:De.static)!=null?rt:"Static IP")+"")&&A(Z,H),Ee[2]?D?(D.p(Ee,_e),_e&4&&J(D,1)):(D=kf(Ee),D.c(),J(D,1),D.m(j,null)):D&&(bt(),ie(D,1,1,()=>{D=null}),gt()),Ee[2]?L?L.p(Ee,_e):(L=wf(Ee),L.c(),L.m(n,$)):L&&(L.d(1),L=null),(!x||_e&2)&&se!==(se=((at=(st=Ee[1].btn)==null?void 0:st.save)!=null?at:"Save")+"")&&A(fe,se);const Ue={};_e&16&&(Ue.active=Ee[4]),_e&2&&(Ue.message=(ht=(pt=Ee[1].setup)==null?void 0:pt.mask)!=null?ht:"Saving"),Q.$set(Ue)},i(Ee){x||(J(D),J(Q.$$.fragment,Ee),x=!0)},o(Ee){ie(D),ie(Q.$$.fragment,Ee),x=!1},d(Ee){Ee&&P(e),N&&N.d(),w&&w.d(),D&&D.d(),L&&L.d(),Ee&&P(re),Ie(Q,Ee),ge=!1,Ht(pe)}}}function Wc(t,e,l){let n={};Ol.subscribe(v=>{l(1,n=v)});let{sysinfo:i={}}=e,s=!1,a=1,r=!1;function f(v){kl.update(b=>(b.trying=v,b))}async function u(v){l(4,r=!0);const b=new FormData(v.target),h=new URLSearchParams;for(let T of b){const[q,O]=T;h.append(q,O)}let k=await(await fetch("save",{method:"POST",body:h})).json();l(4,r=!1),kl.update(T=>(T.hostname=b.get("sh"),T.usrcfg=k.success,T.booting=k.reboot,s&&(T.net.ip=b.get("si"),T.net.mask=b.get("su"),T.net.gw=b.get("sg"),T.net.dns1=b.get("sd")),k.reboot&&setTimeout(Zn,5e3,i,f),T))}function m(){a=Jt(this),l(3,a)}function _(){i.hostname=this.value,l(0,i)}function d(){s=this.checked,l(2,s)}return t.$$set=v=>{"sysinfo"in v&&l(0,i=v.sysinfo)},[i,n,s,a,r,u,m,_,d]}class Gc extends It{constructor(e){super(),Lt(this,e,Wc,zc,Dt,{sysinfo:0})}}function Vc(t){var V,R,F,Y,j,W,K,B;let e,l,n,i=((R=(V=t[2].upload)==null?void 0:V.title)!=null?R:"Upload")+"",s,a,r,f,u,m=((Y=(F=t[2].upload)==null?void 0:F.desc)!=null?Y:"")+"",_,d,v,b,h,C,k,T,q=((W=(j=t[2].btn)==null?void 0:j.upload)!=null?W:"Upload")+"",O,M,U,I,z,y;return U=new hl({props:{active:t[3],message:(B=(K=t[2].upload)==null?void 0:K.mask)!=null?B:"Uploading"}}),{c(){e=p("div"),l=p("div"),n=p("strong"),s=S(i),a=g(),r=S(t[1]),f=g(),u=p("p"),_=S(m),d=g(),v=p("form"),b=p("input"),h=g(),C=p("div"),k=p("button"),T=p("p"),O=S(q),M=g(),Oe(U.$$.fragment),c(u,"class","mb-4"),c(b,"name","file"),c(b,"type","file"),c(T,"class","mb-4"),c(k,"type","submit"),c(k,"class","btn-pri"),c(C,"class","w-full text-right mt-4"),c(v,"action",t[0]),c(v,"enctype","multipart/form-data"),c(v,"method","post"),c(v,"autocomplete","off"),c(l,"class","cnt"),c(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(H,Z){E(H,e,Z),o(e,l),o(l,n),o(n,s),o(n,a),o(n,r),o(l,f),o(l,u),o(u,_),o(l,d),o(l,v),o(v,b),o(v,h),o(v,C),o(C,k),o(k,T),o(T,O),E(H,M,Z),Le(U,H,Z),I=!0,z||(y=me(v,"submit",t[4]),z=!0)},p(H,[Z]){var X,$,ae,le,se,fe,re,Q;(!I||Z&4)&&i!==(i=(($=(X=H[2].upload)==null?void 0:X.title)!=null?$:"Upload")+"")&&A(s,i),(!I||Z&2)&&A(r,H[1]),(!I||Z&4)&&m!==(m=((le=(ae=H[2].upload)==null?void 0:ae.desc)!=null?le:"")+"")&&A(_,m),(!I||Z&4)&&q!==(q=((fe=(se=H[2].btn)==null?void 0:se.upload)!=null?fe:"Upload")+"")&&A(O,q),(!I||Z&1)&&c(v,"action",H[0]);const ne={};Z&8&&(ne.active=H[3]),Z&4&&(ne.message=(Q=(re=H[2].upload)==null?void 0:re.mask)!=null?Q:"Uploading"),U.$set(ne)},i(H){I||(J(U.$$.fragment,H),I=!0)},o(H){ie(U.$$.fragment,H),I=!1},d(H){H&&P(e),H&&P(M),Ie(U,H),z=!1,y()}}}function Kc(t,e,l){let{action:n}=e,{title:i}=e,s={};Ol.subscribe(f=>{l(2,s=f)});let a=!1;const r=()=>l(3,a=!0);return t.$$set=f=>{"action"in f&&l(0,n=f.action),"title"in f&&l(1,i=f.title)},[n,i,s,a,r]}class os extends It{constructor(e){super(),Lt(this,e,Kc,Vc,Dt,{action:0,title:1})}}function Yc(t){var Q,x,ge,pe,N,w,D,L,G,te,ee,oe,ce,Pe;let e,l,n,i,s=((x=(Q=t[1].consent)==null?void 0:Q.title)!=null?x:"Consents")+"",a,r,f,u,m,_=((pe=(ge=t[1].consent)==null?void 0:ge.one_click)!=null?pe:"One-click")+"",d,v,b,h,C=((w=(N=t[1].consent)==null?void 0:N.read_more)!=null?w:"Read more")+"",k,T,q,O,M,U,I,z=((L=(D=t[1].consent)==null?void 0:D.yes)!=null?L:"Yes")+"",y,V,R,F,Y,j,W=((te=(G=t[1].consent)==null?void 0:G.no)!=null?te:"No")+"",K,B,H,Z,ne,X=((oe=(ee=t[1].btn)==null?void 0:ee.save)!=null?oe:"Save")+"",$,ae,le,se,fe,re;return le=new hl({props:{active:t[2],message:(Pe=(ce=t[1].consent)==null?void 0:ce.mask_saving)!=null?Pe:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("div"),a=S(s),r=g(),f=p("hr"),u=g(),m=p("div"),d=S(_),v=p("br"),b=g(),h=p("a"),k=S(C),T=p("br"),q=g(),O=p("label"),M=p("input"),I=g(),y=S(z),V=g(),R=p("label"),F=p("input"),j=g(),K=S(W),B=p("br"),H=g(),Z=p("div"),ne=p("button"),$=S(X),ae=g(),Oe(le.$$.fragment),c(h,"href",ql("Data-collection-on-one-click-firmware-upgrade")),c(h,"target","_blank"),c(h,"class","text-blue-600 hover:text-blue-800"),c(M,"type","radio"),c(M,"name","sf"),M.value=1,M.checked=U=t[0].fwconsent===1,c(M,"class","rounded m-2"),M.required=!0,c(F,"type","radio"),c(F,"name","sf"),F.value=2,F.checked=Y=t[0].fwconsent===2,c(F,"class","rounded m-2"),F.required=!0,c(m,"class","my-3"),c(ne,"type","submit"),c(ne,"class","btn-pri"),c(Z,"class","my-3"),c(n,"autocomplete","off"),c(l,"class","cnt"),c(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(Ce,de){E(Ce,e,de),o(e,l),o(l,n),o(n,i),o(i,a),o(n,r),o(n,f),o(n,u),o(n,m),o(m,d),o(m,v),o(m,b),o(m,h),o(h,k),o(m,T),o(m,q),o(m,O),o(O,M),o(O,I),o(O,y),o(m,V),o(m,R),o(R,F),o(R,j),o(R,K),o(m,B),o(n,H),o(n,Z),o(Z,ne),o(ne,$),E(Ce,ae,de),Le(le,Ce,de),se=!0,fe||(re=me(n,"submit",ln(t[3])),fe=!0)},p(Ce,[de]){var Te,ve,be,He,ye,Ve,xe,Je,it,We,_t,Ee,_e,Ue;(!se||de&2)&&s!==(s=((ve=(Te=Ce[1].consent)==null?void 0:Te.title)!=null?ve:"Consents")+"")&&A(a,s),(!se||de&2)&&_!==(_=((He=(be=Ce[1].consent)==null?void 0:be.one_click)!=null?He:"One-click")+"")&&A(d,_),(!se||de&2)&&C!==(C=((Ve=(ye=Ce[1].consent)==null?void 0:ye.read_more)!=null?Ve:"Read more")+"")&&A(k,C),(!se||de&1&&U!==(U=Ce[0].fwconsent===1))&&(M.checked=U),(!se||de&2)&&z!==(z=((Je=(xe=Ce[1].consent)==null?void 0:xe.yes)!=null?Je:"Yes")+"")&&A(y,z),(!se||de&1&&Y!==(Y=Ce[0].fwconsent===2))&&(F.checked=Y),(!se||de&2)&&W!==(W=((We=(it=Ce[1].consent)==null?void 0:it.no)!=null?We:"No")+"")&&A(K,W),(!se||de&2)&&X!==(X=((Ee=(_t=Ce[1].btn)==null?void 0:_t.save)!=null?Ee:"Save")+"")&&A($,X);const Ne={};de&4&&(Ne.active=Ce[2]),de&2&&(Ne.message=(Ue=(_e=Ce[1].consent)==null?void 0:_e.mask_saving)!=null?Ue:"Saving"),le.$set(Ne)},i(Ce){se||(J(le.$$.fragment,Ce),se=!0)},o(Ce){ie(le.$$.fragment,Ce),se=!1},d(Ce){Ce&&P(e),Ce&&P(ae),Ie(le,Ce),fe=!1,re()}}}function Qc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,s={};Ol.subscribe(f=>{l(1,s=f)});let a=!1;async function r(f){l(2,a=!0);const u=new FormData(f.target),m=new URLSearchParams;for(let v of u){const[b,h]=v;m.append(b,h)}let d=await(await fetch("save",{method:"POST",body:m})).json();l(2,a=!1),kl.update(v=>(v.fwconsent=u.sf===!0?1:u.sf===!1?2:0,v.booting=d.reboot,v)),Ql(n)}return t.$$set=f=>{"basepath"in f&&l(4,n=f.basepath),"sysinfo"in f&&l(0,i=f.sysinfo)},[i,s,a,r,n]}class Xc extends It{constructor(e){super(),Lt(this,e,Qc,Yc,Dt,{basepath:4,sysinfo:0})}}function Cf(t,e,l){const n=t.slice();return n[30]=e[l],n[31]=e,n[32]=l,n}function Sf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Zc(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Mf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Jc(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Nf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Tf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Pf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Ef(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Df(t){let e,l=t[1].o,n=[];for(let i=0;i0?"text-green-600":"text-gray-300"),c(Ve,"class",Je=t[32]{l(0,i=B)});let s=["mo","tu","we","th","fr","sa","su"],a={},r=!0,f=!1;Ru.subscribe(B=>{B.o&&(l(1,a=B),l(2,r=!1))}),H0();async function u(B){l(3,f=!0);const H=new URLSearchParams;H.append("r","true"),H.append("rc",a.o.length),a.o.forEach(function(ne,X){H.append("rt"+X,ne.t),H.append("rn"+X,ne.n),H.append("rd"+X,ne.d),H.append("ra"+X,ne.a),H.append("rh"+X,ne.h),H.append("rv"+X,ne.v),H.append("rsm"+X,ne.s.m),H.append("rsd"+X,ne.s.d),H.append("rem"+X,ne.e.m),H.append("red"+X,ne.e.d)}),await(await fetch("save",{method:"POST",body:H})).json(),l(3,f=!1),Ql(n+"configuration")}let m=function(B,H){return B.includes(H)?B=B.filter(function(Z){return Z!==H}):B.push(H),B},_=function(){let B=a.o;B.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.001,s:{m:0,d:0},e:{m:0,d:0}}),l(1,a.o=B,a)},d=function(B){let H=a.o;H.splice(B,1),l(1,a.o=H,a)},v=function(B){if(B<=0)return;let H=a.o;var Z=H[B];H[B]=H[B-1],H[B-1]=Z,l(1,a.o=H,a)},b=function(B){let H=a.o;if(!(B>=H.length-1)){var Z=H[B];H[B]=H[B+1],H[B+1]=Z,l(1,a.o=H,a)}};function h(B,H){B[H].n=this.value,l(1,a)}function C(B,H){B[H].d=Jt(this),l(1,a)}function k(B,H){B[H].t=Jt(this),l(1,a)}function T(B,H){B[H].v=$e(this.value),l(1,a)}const q=(B,H,Z,ne)=>l(1,Z[ne].a=m(B.a,H),a),O=(B,H,Z,ne)=>l(1,Z[ne].h=m(B.h,H),a),M=(B,H,Z,ne)=>l(1,Z[ne].h=m(B.h,H+8),a),U=(B,H,Z,ne)=>l(1,Z[ne].h=m(B.h,H+16),a);function I(B,H){B[H].s.d=Jt(this),l(1,a)}function z(B,H){B[H].s.m=Jt(this),l(1,a)}function y(B,H){B[H].e.d=Jt(this),l(1,a)}function V(B,H){B[H].e.m=Jt(this),l(1,a)}const R=B=>v(B),F=B=>v(B),Y=B=>b(B),j=B=>b(B),W=B=>d(B),K=B=>d(B);return t.$$set=B=>{"basepath"in B&&l(11,n=B.basepath)},[i,a,r,f,s,u,m,_,d,v,b,n,h,C,k,T,q,O,M,U,I,z,y,V,R,F,Y,j,W,K]}class lm extends It{constructor(e){super(),Lt(this,e,tm,em,Dt,{basepath:11},null,[-1,-1])}}function Bf(t,e,l){const n=t.slice();return n[13]=e[l],n[14]=e,n[15]=l,n}function Uf(t,e,l){const n=t.slice();return n[13]=e[l],n[16]=e,n[17]=l,n}function jf(t){let e,l,n,i=t[1],s=[];for(let a=0;a{l(3,r=C)});let f=!1,u,m;async function _(){if(confirm("Clear all data?"))for(let C in i)(C.startsWith("i")||C.startsWith("e"))&&l(0,i[C]=0,i)}let d=!1;async function v(C){l(5,d=!0);const k=new FormData(C.target),T=new URLSearchParams;for(let O of k){const[M,U]=O;T.append(M,U)}await(await fetch(s,{method:"POST",body:T})).json(),l(5,d=!1),Ql(a)}function b(C){i[C.key]=$e(this.value),l(0,i)}function h(C){i[C.key]=$e(this.value),l(0,i)}return t.$$set=C=>{"prefix"in C&&l(8,n=C.prefix),"data"in C&&l(0,i=C.data),"url"in C&&l(9,s=C.url),"basepath"in C&&l(10,a=C.basepath)},t.$$.update=()=>{if(t.$$.dirty&263){l(1,u=[]),l(2,m=[]);for(let C in i){let k=[];C.startsWith("i")?k=u:C.startsWith("e")&&(k=m,i[C]&&l(4,f=!0)),k.push({key:C,name:n+" "+C.substring(1),value:i[C]})}}},[i,u,m,r,f,d,_,v,n,s,a,b,h]}class Uu extends It{constructor(e){super(),Lt(this,e,im,nm,Dt,{prefix:8,data:0,url:9,basepath:10})}}function sm(t){let e,l;return e=new j0({props:{data:t[7],sysinfo:t[6],prices:t[1],dayPlot:t[2],monthPlot:t[3],temperatures:t[4],translations:t[5],tariffData:t[8]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.data=n[7]),i&64&&(s.sysinfo=n[6]),i&2&&(s.prices=n[1]),i&4&&(s.dayPlot=n[2]),i&8&&(s.monthPlot=n[3]),i&16&&(s.temperatures=n[4]),i&32&&(s.translations=n[5]),i&256&&(s.tariffData=n[8]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function om(t){let e,l;return e=new Sc({props:{sysinfo:t[6],basepath:t[0],data:t[7]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.sysinfo=n[6]),i&1&&(s.basepath=n[0]),i&128&&(s.data=n[7]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function am(t){let e,l;return e=new lm({props:{basepath:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function fm(t){let e,l;return e=new Rc({props:{sysinfo:t[6],data:t[7]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.sysinfo=n[6]),i&128&&(s.data=n[7]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function um(t){let e,l;return e=new os({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p:Ze,i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function rm(t){let e,l;return e=new os({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p:Ze,i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function cm(t){let e,l;return e=new os({props:{title:"private key",action:"/mqtt-key"}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p:Ze,i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function mm(t){let e,l;return e=new Xc({props:{sysinfo:t[6],basepath:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.sysinfo=n[6]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function _m(t){let e,l;return e=new Gc({props:{sysinfo:t[6]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.sysinfo=n[6]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function pm(t){let e,l;return e=new Hc({props:{sysinfo:t[6],basepath:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.sysinfo=n[6]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function dm(t){let e,l;return e=new Uu({props:{prefix:"UTC Hour",data:t[2],url:"/dayplot",basepath:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&4&&(s.data=n[2]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function vm(t){let e,l;return e=new Uu({props:{prefix:"Day",data:t[3],url:"/monthplot",basepath:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&8&&(s.data=n[3]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function hm(t){let e,l,n,i,s,a,r,f,u,m,_,d,v,b,h,C,k,T,q,O,M,U,I,z,y,V;return e=new z1({props:{data:t[7],basepath:t[0]}}),n=new Ll({props:{path:"/",$$slots:{default:[sm]},$$scope:{ctx:t}}}),s=new Ll({props:{path:"/configuration",$$slots:{default:[om]},$$scope:{ctx:t}}}),r=new Ll({props:{path:"/priceconfig",$$slots:{default:[am]},$$scope:{ctx:t}}}),u=new Ll({props:{path:"/status",$$slots:{default:[fm]},$$scope:{ctx:t}}}),_=new Ll({props:{path:"/mqtt-ca",$$slots:{default:[um]},$$scope:{ctx:t}}}),v=new Ll({props:{path:"/mqtt-cert",$$slots:{default:[rm]},$$scope:{ctx:t}}}),h=new Ll({props:{path:"/mqtt-key",$$slots:{default:[cm]},$$scope:{ctx:t}}}),k=new Ll({props:{path:"/consent",$$slots:{default:[mm]},$$scope:{ctx:t}}}),q=new Ll({props:{path:"/setup",$$slots:{default:[_m]},$$scope:{ctx:t}}}),M=new Ll({props:{path:"/vendor",$$slots:{default:[pm]},$$scope:{ctx:t}}}),I=new Ll({props:{path:"/edit-day",$$slots:{default:[dm]},$$scope:{ctx:t}}}),y=new Ll({props:{path:"/edit-month",$$slots:{default:[vm]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment),l=g(),Oe(n.$$.fragment),i=g(),Oe(s.$$.fragment),a=g(),Oe(r.$$.fragment),f=g(),Oe(u.$$.fragment),m=g(),Oe(_.$$.fragment),d=g(),Oe(v.$$.fragment),b=g(),Oe(h.$$.fragment),C=g(),Oe(k.$$.fragment),T=g(),Oe(q.$$.fragment),O=g(),Oe(M.$$.fragment),U=g(),Oe(I.$$.fragment),z=g(),Oe(y.$$.fragment)},m(R,F){Le(e,R,F),E(R,l,F),Le(n,R,F),E(R,i,F),Le(s,R,F),E(R,a,F),Le(r,R,F),E(R,f,F),Le(u,R,F),E(R,m,F),Le(_,R,F),E(R,d,F),Le(v,R,F),E(R,b,F),Le(h,R,F),E(R,C,F),Le(k,R,F),E(R,T,F),Le(q,R,F),E(R,O,F),Le(M,R,F),E(R,U,F),Le(I,R,F),E(R,z,F),Le(y,R,F),V=!0},p(R,F){const Y={};F&128&&(Y.data=R[7]),F&1&&(Y.basepath=R[0]),e.$set(Y);const j={};F&1022&&(j.$$scope={dirty:F,ctx:R}),n.$set(j);const W={};F&705&&(W.$$scope={dirty:F,ctx:R}),s.$set(W);const K={};F&513&&(K.$$scope={dirty:F,ctx:R}),r.$set(K);const B={};F&704&&(B.$$scope={dirty:F,ctx:R}),u.$set(B);const H={};F&512&&(H.$$scope={dirty:F,ctx:R}),_.$set(H);const Z={};F&512&&(Z.$$scope={dirty:F,ctx:R}),v.$set(Z);const ne={};F&512&&(ne.$$scope={dirty:F,ctx:R}),h.$set(ne);const X={};F&577&&(X.$$scope={dirty:F,ctx:R}),k.$set(X);const $={};F&576&&($.$$scope={dirty:F,ctx:R}),q.$set($);const ae={};F&577&&(ae.$$scope={dirty:F,ctx:R}),M.$set(ae);const le={};F&517&&(le.$$scope={dirty:F,ctx:R}),I.$set(le);const se={};F&521&&(se.$$scope={dirty:F,ctx:R}),y.$set(se)},i(R){V||(J(e.$$.fragment,R),J(n.$$.fragment,R),J(s.$$.fragment,R),J(r.$$.fragment,R),J(u.$$.fragment,R),J(_.$$.fragment,R),J(v.$$.fragment,R),J(h.$$.fragment,R),J(k.$$.fragment,R),J(q.$$.fragment,R),J(M.$$.fragment,R),J(I.$$.fragment,R),J(y.$$.fragment,R),V=!0)},o(R){ie(e.$$.fragment,R),ie(n.$$.fragment,R),ie(s.$$.fragment,R),ie(r.$$.fragment,R),ie(u.$$.fragment,R),ie(_.$$.fragment,R),ie(v.$$.fragment,R),ie(h.$$.fragment,R),ie(k.$$.fragment,R),ie(q.$$.fragment,R),ie(M.$$.fragment,R),ie(I.$$.fragment,R),ie(y.$$.fragment,R),V=!1},d(R){Ie(e,R),R&&P(l),Ie(n,R),R&&P(i),Ie(s,R),R&&P(a),Ie(r,R),R&&P(f),Ie(u,R),R&&P(m),Ie(_,R),R&&P(d),Ie(v,R),R&&P(b),Ie(h,R),R&&P(C),Ie(k,R),R&&P(T),Ie(q,R),R&&P(O),Ie(M,R),R&&P(U),Ie(I,R),R&&P(z),Ie(y,R)}}}function bm(t){let e,l,n,i;const s=[wm,km],a=[];function r(f,u){return f[6].trying?0:1}return e=r(t),l=a[e]=s[e](t),{c(){l.c(),n=$t()},m(f,u){a[e].m(f,u),E(f,n,u),i=!0},p(f,u){let m=e;e=r(f),e===m?a[e].p(f,u):(bt(),ie(a[m],1,1,()=>{a[m]=null}),gt(),l=a[e],l?l.p(f,u):(l=a[e]=s[e](f),l.c()),J(l,1),l.m(n.parentNode,n))},i(f){i||(J(l),i=!0)},o(f){ie(l),i=!1},d(f){a[e].d(f),f&&P(n)}}}function gm(t){let e,l;return e=new hl({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p:Ze,i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function km(t){let e,l;return e=new hl({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p:Ze,i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function wm(t){let e,l;return e=new hl({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[6].trying}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.message="Device is booting, please wait. Trying to reach it on "+n[6].trying),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function Cm(t){let e,l,n,i,s,a;l=new vu({props:{basepath:t[0],$$slots:{default:[hm]},$$scope:{ctx:t}}});const r=[gm,bm],f=[];function u(m,_){return m[6].upgrading?0:m[6].booting?1:-1}return~(i=u(t))&&(s=f[i]=r[i](t)),{c(){e=p("div"),Oe(l.$$.fragment),n=g(),s&&s.c(),c(e,"class","container mx-auto m-3")},m(m,_){E(m,e,_),Le(l,e,null),o(e,n),~i&&f[i].m(e,null),a=!0},p(m,[_]){const d={};_&1&&(d.basepath=m[0]),_&1023&&(d.$$scope={dirty:_,ctx:m}),l.$set(d);let v=i;i=u(m),i===v?~i&&f[i].p(m,_):(s&&(bt(),ie(f[v],1,1,()=>{f[v]=null}),gt()),~i?(s=f[i],s?s.p(m,_):(s=f[i]=r[i](m),s.c()),J(s,1),s.m(e,null)):s=null)},i(m){a||(J(l.$$.fragment,m),J(s),a=!0)},o(m){ie(l.$$.fragment,m),ie(s),a=!1},d(m){m&&P(e),Ie(l),~i&&f[i].d()}}}function Sm(t,e,l){let n=document.getElementsByTagName("base")[0].getAttribute("href");n||(n="/");let i;ts.subscribe(d=>{l(1,i=d)});let s;Mu.subscribe(d=>{l(2,s=d)});let a;Nu.subscribe(d=>{l(3,a=d)});let r;Tu.subscribe(d=>{l(4,r=d)});let f={};Ol.subscribe(d=>{l(5,f=d)});let u={};kl.subscribe(d=>{var v;l(6,u=d),u.vndcfg===!1?Ql(n+"vendor"):u.usrcfg===!1?Ql(n+"setup"):u.fwconsent===0&&Ql(n+"consent"),u.ui.k===1?document.documentElement.classList.add("dark"):u.ui.k===0?document.documentElement.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),u.ui.lang&&u.ui.lang!=((v=f==null?void 0:f.language)==null?void 0:v.code)&&Du(u.ui.lang)});let m={};r1.subscribe(d=>{l(7,m=d),D0(d)});let _={};return Eu.subscribe(d=>{l(8,_=d)}),Pu(),[n,i,s,a,r,f,u,m,_]}class Mm extends It{constructor(e){super(),Lt(this,e,Sm,Cm,Dt,{})}}new Mm({target:document.getElementById("app")}); +Occurred in: ${i}`:"",a=Ji(t),r=Zf(e)?e(a):e;return`<${a}> ${r}${s}`}const ru=t=>(...e)=>t(_r(...e)),cu=ru(t=>{throw new Error(t)}),mi=ru(console.warn),Ss=4,pr=3,dr=2,vr=1,hr=1;function br(t,e){const l=t.default?0:zl(t.fullPath).reduce((n,i)=>{let s=n;return s+=Ss,ir(i)?s+=hr:sr(i)?s+=dr:iu(i)?s-=Ss+vr:s+=pr,s},0);return{route:t,score:l,index:e}}function gr(t){return t.map(br).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function mu(t,e){let l,n;const[i]=e.split("?"),s=zl(i),a=s[0]==="",r=gr(t);for(let f=0,u=r.length;f({...m,params:d,uri:k});if(m.default){n=v(e);continue}const b=zl(m.fullPath),h=Math.max(s.length,b.length);let M=0;for(;M{u===".."?f.pop():u!=="."&&f.push(u)}),hi(`/${f.join("/")}`,n)}function Ms(t,e){const{pathname:l,hash:n="",search:i="",state:s}=t,a=zl(e,!0),r=zl(l,!0);for(;a.length;)a[0]!==r[0]&&cu(tn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),a.shift(),r.shift();return{pathname:xn(...r),hash:n,search:i,state:s}}const Ns=t=>t.length===1?"":t,$i=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,s=i?Ns(zn(t,l)):"",a=i?zn(t,0,l):t,r=n?Ns(zn(a,e)):"";return{pathname:(n?zn(a,0,e):a)||"/",search:r,hash:s}},wr=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function Cr(t,e,l){return xn(l,kr(t,e))}function Sr(t,e){const l=Xi(or(t)),n=zl(l,!0),i=zl(e,!0).slice(0,n.length),s=_u({fullPath:l},xn(...i));return s&&s.uri}const bi="POP",Mr="PUSH",Nr="REPLACE";function gi(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function Tr(t){let e=[],l=gi(t),n=bi;const i=(s=e)=>s.forEach(a=>a({location:l,action:n}));return{get location(){return l},listen(s){e.push(s);const a=()=>{l=gi(t),n=bi,i([s])};i([s]);const r=xf(t,"popstate",a);return()=>{r(),e=e.filter(f=>f!==s)}},navigate(s,a){const{state:r={},replace:f=!1}=a||{};if(n=f?Nr:Mr,Jf(s))a&&mi(uu,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=bi,t.history.go(s);else{const u={...r,_key:er()};try{t.history[f?"replaceState":"pushState"](u,"",s)}catch{t.location[f?"replace":"assign"](s)}}l=gi(t),i()}}}function ki(t,e){return{...$i(e),state:t}}function Pr(t="/"){let e=0,l=[ki(null,t)];return{get entries(){return l},get location(){return l[e]},addEventListener(){},removeEventListener(){},history:{get state(){return l[e].state},pushState(n,i,s){e++,l=l.slice(0,e),l.push(ki(n,s))},replaceState(n,i,s){l[e]=ki(n,s)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const Er=!!(!Zl&&window.document&&window.document.createElement),Dr=!Zl&&window.location.origin==="null",pu=Tr(Er&&!Dr?window:Pr()),{navigate:Ql}=pu;let Wl=null,du=!0;function qr(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nWl.level||t.level===Wl.level&&qr(t.routerId,Wl.routerId))&&(Wl=t)}function Lr(){Wl=null}function Ir(){du=!1}function Ts(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=xf(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function Or(t,e){return Number(t.dataset.svnavRouteEnd)===e}function Rr(t){return/^H[1-6]$/i.test(t.tagName)}function Ps(t,e=document){return e.querySelector(t)}function Fr(t){let l=Ps(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!Or(l,t);){if(Rr(l))return l;const n=Ps("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function Br(t){Promise.resolve(cn(t.focusElement)).then(e=>{const l=e||Fr(t.id);l||mi(tn,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,di),!Ts(l)&&Ts(document.documentElement)})}const Ur=(t,e,l)=>(n,i)=>Xu().then(()=>{if(!Wl||du){Ir();return}if(n&&Br(Wl.route),t.announcements&&i){const{path:s,fullPath:a,meta:r,params:f,uri:u}=Wl.route,m=t.createAnnouncement({path:s,fullPath:a,meta:r,params:f,uri:u},cn(l));Promise.resolve(m).then(_=>{e.set(_)})}Lr()}),jr="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function yr(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},eu(t[6],jr)],i={};for(let s=0;s`Navigated to ${X.uri}`,announcements:!0,...b},k=m,T=Xi(m),I=Xl(Ti),O=Xl(_n),C=!I,B=zr(),L=v&&!(O&&!O.manageFocus),z=nl("");Hl(t,z,X=>l(0,r=X));const y=O?O.disableInlineStyles:h,V=nl([]);Hl(t,V,X=>l(20,a=X));const R=nl(null);Hl(t,R,X=>l(18,i=X));let F=!1;const Y=C?0:O.level+1,W=C?nl((()=>Ms(Zl?$i(_):d.location,T))()):I;Hl(t,W,X=>l(17,n=X));const K=nl(n);Hl(t,K,X=>l(19,s=X));const U=Ur(M,z,W),H=X=>$=>$.filter(ae=>ae.id!==X);function Z(X){if(Zl){if(F)return;const $=_u(X,n.pathname);if($)return F=!0,$}else V.update($=>{const ae=H(X.id)($);return ae.push(X),ae})}function ne(X){V.update(H(X))}return!C&&m!==Es&&mi(tn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:m}),C&&(Vf(()=>d.listen($=>{const ae=Ms($.location,T);K.set(n),W.set(ae)})),Yn(Ti,W)),Yn(_n,{activeRoute:R,registerRoute:Z,unregisterRoute:ne,manageFocus:L,level:Y,id:B,history:C?d:O.history,basepath:C?T:O.basepath,disableInlineStyles:y}),t.$$set=X=>{"basepath"in X&&l(11,m=X.basepath),"url"in X&&l(12,_=X.url),"history"in X&&l(13,d=X.history),"primary"in X&&l(14,v=X.primary),"a11y"in X&&l(15,b=X.a11y),"disableInlineStyles"in X&&l(16,h=X.disableInlineStyles),"$$scope"in X&&l(21,u=X.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&m!==k&&mi(tn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const X=mu(a,n.pathname);R.set(X)}if(t.$$.dirty[0]&655360&&C){const X=!!n.hash,$=!X&&L,ae=!X||n.pathname!==s.pathname;U($,ae)}t.$$.dirty[0]&262144&&L&&i&&i.primary&&Ar({level:Y,routerId:B,route:i})},[r,M,C,B,L,z,y,V,R,W,K,m,_,d,v,b,h,n,i,s,a,u,f]}class Gr extends It{constructor(e){super(),Lt(this,e,Wr,Hr,Dt,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const vu=Gr;function ei(t,e,l=_n,n=tn){Xl(l)||cu(t,s=>`You cannot use ${s} outside of a ${Ji(n)}.`,e)}const Vr=t=>{const{subscribe:e}=Xl(t);return{subscribe:e}};function hu(){return ei(ou),Vr(Ti)}function bu(){const{history:t}=Xl(_n);return t}function gu(){const t=Xl(lu);return t?tr(t,e=>e.base):nl("/")}function ku(){ei(fu);const t=gu(),{basepath:e}=Xl(_n);return n=>Cr(n,cn(t),e)}function Kr(){ei(au);const t=ku(),{navigate:e}=bu();return(n,i)=>{const s=Jf(n)?n:t(n);return e(s,i)}}const Yr=t=>({params:t&16,location:t&8}),Ds=t=>({params:Zl?cn(t[10]):t[4],location:t[3],navigate:t[11]});function qs(t){let e,l;return e=new vu({props:{primary:t[1],$$slots:{default:[Zr]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&2&&(s.primary=n[1]),i&528409&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function Qr(t){let e;const l=t[18].default,n=Gi(l,t,t[19],Ds);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&524312)&&Ki(n,l,i,i[19],e?Vi(l,i[19],s,Yr):Yi(i[19]),Ds)},i(i){e||(J(n,i),e=!0)},o(i){ie(n,i),e=!1},d(i){n&&n.d(i)}}}function Xr(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Zl?cn(t[10]):t[4],t[12]];var s=t[0];function a(r){let f={};for(let u=0;u{Ie(m,1)}),gt()}s?(e=gs(s,a()),Oe(e.$$.fragment),J(e.$$.fragment,1),Le(e,l.parentNode,l)):e=null}else s&&e.$set(u)},i(r){n||(e&&J(e.$$.fragment,r),n=!0)},o(r){e&&ie(e.$$.fragment,r),n=!1},d(r){r&&P(l),e&&Ie(e,r)}}}function Zr(t){let e,l,n,i;const s=[Xr,Qr],a=[];function r(f,u){return f[0]!==null?0:1}return e=r(t),l=a[e]=s[e](t),{c(){l.c(),n=$t()},m(f,u){a[e].m(f,u),E(f,n,u),i=!0},p(f,u){let m=e;e=r(f),e===m?a[e].p(f,u):(bt(),ie(a[m],1,1,()=>{a[m]=null}),gt(),l=a[e],l?l.p(f,u):(l=a[e]=s[e](f),l.c()),J(l,1),l.m(n.parentNode,n))},i(f){i||(J(l),i=!0)},o(f){ie(l),i=!1},d(f){a[e].d(f),f&&P(n)}}}function Jr(t){let e,l,n,i,s,a=[Ni(t[7]),{"data-svnav-route-start":t[5]}],r={};for(let _=0;_{f=null}),gt())},i(_){s||(J(f),s=!0)},o(_){ie(f),s=!1},d(_){_&&P(e),_&&P(l),f&&f.d(_),_&&P(n),_&&P(i)}}}const $r=$f();function xr(t,e,l){let n;const i=["path","component","meta","primary"];let s=ri(e,i),a,r,f,u,{$$slots:m={},$$scope:_}=e,{path:d=""}=e,{component:v=null}=e,{meta:b={}}=e,{primary:h=!0}=e;ei(di,e);const M=$r(),{registerRoute:k,unregisterRoute:T,activeRoute:I,disableInlineStyles:O}=Xl(_n);Hl(t,I,F=>l(16,a=F));const C=gu();Hl(t,C,F=>l(17,f=F));const B=hu();Hl(t,B,F=>l(3,r=F));const L=nl(null);let z;const y=nl(),V=nl({});Hl(t,V,F=>l(4,u=F)),Yn(lu,y),Yn(lr,V),Yn(nr,L);const R=Kr();return Zl||Yu(()=>T(M)),t.$$set=F=>{l(24,e=yl(yl({},e),ui(F))),l(12,s=ri(e,i)),"path"in F&&l(13,d=F.path),"component"in F&&l(0,v=F.component),"meta"in F&&l(14,b=F.meta),"primary"in F&&l(1,h=F.primary),"$$scope"in F&&l(19,_=F.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const F=d==="",Y=xn(f,d),j={id:M,path:d,meta:b,default:F,fullPath:F?"":Y,base:F?f:Sr(Y,r.pathname),primary:h,focusElement:L};y.set(j),l(15,z=k(j))}if(t.$$.dirty&98304&&l(2,n=!!(z||a&&a.id===M)),t.$$.dirty&98308&&n){const{params:F}=z||a;V.set(F)}},e=ui(e),[v,h,n,r,u,M,I,O,C,B,V,R,s,d,b,z,a,f,m,_]}class e1 extends It{constructor(e){super(),Lt(this,e,xr,Jr,Dt,{path:13,component:0,meta:14,primary:1})}}const Ll=e1;function t1(t){let e,l,n,i;const s=t[13].default,a=Gi(s,t,t[12],null);let r=[{href:t[0]},t[2],t[1]],f={};for(let u=0;ul(11,_=L));const I=Qu(),O=ku(),{navigate:C}=bu();function B(L){I("click",L),xu(L)&&(L.preventDefault(),C(n,{state:M,replace:a||h}))}return t.$$set=L=>{l(19,e=yl(yl({},e),ui(L))),l(18,m=ri(e,u)),"to"in L&&l(5,b=L.to),"replace"in L&&l(6,h=L.replace),"state"in L&&l(7,M=L.state),"getProps"in L&&l(8,k=L.getProps),"$$scope"in L&&l(12,v=L.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=O(b,_)),t.$$.dirty&2049&&l(10,i=Pi(_.pathname,n)),t.$$.dirty&2049&&l(9,s=n===_.pathname),t.$$.dirty&2049&&(a=$i(n)===wr(_)),t.$$.dirty&512&&l(2,r=s?{"aria-current":"page"}:{}),l(1,f=(()=>{if(Zf(k)){const L=k({location:_,href:n,isPartiallyCurrent:i,isCurrent:s});return{...m,...L}}return m})())},e=ui(e),[n,f,r,T,B,b,h,M,k,s,i,_,v,d]}class n1 extends It{constructor(e){super(),Lt(this,e,l1,t1,Dt,{to:5,replace:6,state:7,getProps:8})}}const Al=n1;function Yl(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function i1(t,e){return t>218&&t<242?"#23ac05":t>212&&t<248?"#b1d900":t>208&&t<252?"#a3b200":"#b20000"}function xi(t,e){let l;return t>90?l="#b20000":t>85?l="#b19601":t>80?l="#a3b200":t>75?l="#569f12":l="#23ac05",l}function Xn(t){return t>75?"#23ac05":t>50?"#77d900":t>25?"#94d900":"#569f12"}function _i(t){switch(t){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return"Unknown"}}function Tt(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function lt(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1";case 80:return"Generic ESP32-S3"}return"Unknown"}function rn(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Zt(t,e){return t==1||t==2&&e}function ql(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function Xt(t,e){return t==null||isNaN(t)?"-":(isNaN(e)&&(e=t<1?2:t<10?1:0),t.toFixed(e))}function Kl(t,e){return t.setTime(t.getTime()+e*36e5),t}function s1(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function o1(t){return t=="EOE"?"https://transparency.entsoe.eu/":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}let ni=0;function Zn(t,e){var l="";ni++;var n=function(){setTimeout(Zn,1e3,t,e)};if(t.net.ip&&ni%3==0){if(!t.net.ip){n();return}l="http://"+t.net.ip}else t.hostname&&ni%3==1?l="http://"+t.hostname:t.hostname&&ni%3==2?l="http://"+t.hostname+".local":l="";console&&console.log("Trying url "+l),e&&e(l);var i=new XMLHttpRequest;i.timeout=5e3,i.addEventListener("abort",n),i.addEventListener("error",n),i.addEventListener("timeout",n),i.addEventListener("load",function(s){window.location.href=l||"/"}),i.open("GET",l+"/is-alive",!0),i.send()}function tl(t){return t.charAt(0).toUpperCase()+t.slice(1)}function As(t){return t.startsWith("esp32")?"esp32":t}function gl(t,e){let l=[t,e];return typeof t>"u"?(l[0]="-",l[1]=e):t>=1e9?(l[0]=(t/1e6).toFixed(t>1e10?0:1),l[1]="M"+e):t>1e4?(l[0]=(t/1e3).toFixed(t>1e6?0:t>1e5?1:2),l[1]="k"+e):(l[0]=t.toFixed(0),l[1]=e),l}let ai={},Ei=[];async function a1(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),s=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),s}let wi;async function wu(){if(Ei.length){let t=Ei.shift();delete ai[t.resource];try{let e=await a1(t.resource,t.options);for(let l in t.callbacks)t.callbacks[l](e.clone())}catch(e){console.error("Error calling "+t.resource,e);for(let l in t.callbacks)t.callbacks[l]()}}wi&&clearTimeout(wi),wi=setTimeout(wu,100)}wu();async function Il(t,e={}){let l;return ai[t]?l=ai[t]:(l={resource:t,options:e,callbacks:[]},ai[t]=l,Ei.push(l)),new Promise(i=>l.callbacks.push(i))}let jl={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null,if:{eth:!1}};async function es(){jl=await(await Il("sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),kl.set(jl)}const kl=nl(jl,t=>(es(),function(){}));function f1(t){kl.update(e=>(e.trying=t,e))}let ii=0,Ls=-127,Is=null,u1={};const r1=tu(u1,t=>{let e,l;async function n(){Il("data.json").then(i=>i.json()).then(i=>{t(i),Ls!=i.t&&(Ls=i.t,setTimeout(c1,2e3)),Is==null&&i.pe&&i.p!=null&&(Is=i.p,Su()),jl.upgrading?window.location.reload():(!jl||!jl.chip||jl.booting||ii>1&&!rn(jl.board))&&(es(),Gl&&clearTimeout(Gl),Gl=setTimeout(Ai,2e3),Vl&&clearTimeout(Vl),Vl=setTimeout(Ii,3e3)),Gl||(Gl=Ai()),Vl||(Vl=Ii());let s=5e3;if(rn(jl.board)&&i.v>2.5){let a=3.3-Math.min(3.3,i.v);a>0&&(s=Math.max(a,.1)*10*5e3)}s>5e3&&console.log("Next in "+s+"ms"),e&&clearTimeout(e),e=setTimeout(n,s),ii=0}).catch(i=>{ii++,ii>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(n,15e3),l||(l=setTimeout(Zn,5e3,jl,f1))):e=setTimeout(n,rn(jl.board)?1e4:5e3)})}return n(),function(){clearTimeout(e)}});let Di={},Wn;const ts=nl(Di);async function Cu(){let t=!1;if(ts.update(e=>{for(var l=0;l<36;l++){if(e[Tt(l)]==null){t=l<12;break}e[Tt(l)]=e[Tt(l+1)]}return e}),t)Su();else{let e=new Date;Wn=setTimeout(Cu,(60-e.getMinutes())*6e4)}}async function Su(){Wn&&(clearTimeout(Wn),Wn=0),Di=await(await Il("energyprice.json")).json(),ts.set(Di);let e=new Date;Wn=setTimeout(Cu,(60-e.getMinutes())*6e4)}let qi={},Gl;async function Ai(){Gl&&(clearTimeout(Gl),Gl=0),qi=await(await Il("dayplot.json")).json(),Mu.set(qi);let e=new Date;Gl=setTimeout(Ai,(60-e.getMinutes())*6e4+20)}const Mu=nl(qi,t=>function(){});let Li={},Vl;async function Ii(){Vl&&(clearTimeout(Vl),Vl=0),Li=await(await Il("monthplot.json")).json(),Nu.set(Li);let e=new Date;Vl=setTimeout(Ii,(24-e.getHours())*36e5+40)}const Nu=nl(Li,t=>function(){});let Oi={};async function c1(){Oi=await(await Il("temperature.json")).json(),Tu.set(Oi)}const Tu=nl(Oi,t=>function(){});let Ri={},si;async function Pu(){si&&(clearTimeout(si),si=0),Ri=await(await Il("tariff.json")).json(),Eu.set(Ri);let e=new Date;si=setTimeout(Pu,(60-e.getMinutes())*6e4+30)}const Eu=nl(Ri,t=>function(){});let Fi=[];const ls=nl(Fi);async function m1(){Fi=await(await Il("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),ls.set(Fi)}let Bi=!1;const Ol=nl(Bi);async function Du(t){Bi=await(await Il("translations.json"+(t?"?lang="+t:""))).json(),Ol.set(Bi)}Du();function pi(t){return"WARNING: "+t+" must be connected to an external power supply during firmware upgrade. Failure to do so may cause power-down during upload resulting in non-functioning unit."}async function qu(t){await(await fetch("upgrade?expected_version="+t,{method:"POST"})).json()}function Au(t,e){if(!(!e||e.message))if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(t)){let l=t.substring(1).split("."),n=parseInt(l[0]),i=parseInt(l[1]),s=parseInt(l[2]),a=[...e];a.reverse();let r,f,u;for(let m=0;ms&&(r=_):h==i+1&&(f=_);else if(b==n+1)if(u){let k=u.tag_name.substring(1).split(".");parseInt(k[0]);let T=parseInt(k[1]);parseInt(k[2]),h==T&&(u=_)}else u=_}return f||u||r||!1}else return e[0]}function Os(t){var f,u;let e=((u=(f=t[1].header)==null?void 0:f.uptime)!=null?u:"Up")+"",l,n,i;function s(m,_){return m[2]>1?g1:m[2]>0?b1:m[3]>1?h1:m[3]>0?v1:m[4]>1?d1:m[4]>0?p1:_1}let a=s(t),r=a(t);return{c(){l=S(e),n=g(),r.c(),i=$t()},m(m,_){E(m,l,_),E(m,n,_),r.m(m,_),E(m,i,_)},p(m,_){var d,v;_&2&&e!==(e=((v=(d=m[1].header)==null?void 0:d.uptime)!=null?v:"Up")+"")&&q(l,e),a===(a=s(m))&&r?r.p(m,_):(r.d(1),r=a(m),r&&(r.c(),r.m(i.parentNode,i)))},d(m){m&&P(l),m&&P(n),r.d(m),m&&P(i)}}}function _1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.seconds)!=null?a:"s")+"",i;return{c(){e=S(t[0]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&1&&q(e,r[0]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.seconds)!=null?m:"s")+"")&&q(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function p1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.minute)!=null?a:"m")+"",i;return{c(){e=S(t[4]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&16&&q(e,r[4]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.minute)!=null?m:"m")+"")&&q(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function d1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.minutes)!=null?a:"m")+"",i;return{c(){e=S(t[4]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&16&&q(e,r[4]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.minutes)!=null?m:"m")+"")&&q(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function v1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.hour)!=null?a:"h")+"",i;return{c(){e=S(t[3]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&8&&q(e,r[3]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.hour)!=null?m:"h")+"")&&q(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function h1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.hours)!=null?a:"h")+"",i;return{c(){e=S(t[3]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&8&&q(e,r[3]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.hours)!=null?m:"h")+"")&&q(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function b1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.day)!=null?a:"d")+"",i;return{c(){e=S(t[2]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&4&&q(e,r[2]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.day)!=null?m:"d")+"")&&q(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function g1(t){var s,a;let e,l,n=((a=(s=t[1].common)==null?void 0:s.days)!=null?a:"d")+"",i;return{c(){e=S(t[2]),l=g(),i=S(n)},m(r,f){E(r,e,f),E(r,l,f),E(r,i,f)},p(r,f){var u,m;f&4&&q(e,r[2]),f&2&&n!==(n=((m=(u=r[1].common)==null?void 0:u.days)!=null?m:"d")+"")&&q(i,n)},d(r){r&&P(e),r&&P(l),r&&P(i)}}}function k1(t){let e,l=t[0]&&Os(t);return{c(){l&&l.c(),e=$t()},m(n,i){l&&l.m(n,i),E(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Os(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Ze,o:Ze,d(n){l&&l.d(n),n&&P(e)}}}function w1(t,e,l){let{epoch:n}=e,i={};Ol.subscribe(f=>{l(1,i=f)});let s=0,a=0,r=0;return t.$$set=f=>{"epoch"in f&&l(0,n=f.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(2,s=Math.floor(n/86400)),l(3,a=Math.floor(n/3600)),l(4,r=Math.floor(n/60)))},[n,i,s,a,r]}class C1 extends It{constructor(e){super(),Lt(this,e,w1,k1,Dt,{epoch:0})}}function S1(t){let e,l,n;return{c(){e=p("span"),l=S(t[2]),c(e,"title",t[1]),c(e,"class",n="bd-"+t[0])},m(i,s){E(i,e,s),o(e,l)},p(i,[s]){s&4&&q(l,i[2]),s&2&&c(e,"title",i[1]),s&1&&n!==(n="bd-"+i[0])&&c(e,"class",n)},i:Ze,o:Ze,d(i){i&&P(e)}}}function M1(t,e,l){let{color:n}=e,{title:i}=e,{text:s}=e;return t.$$set=a=>{"color"in a&&l(0,n=a.color),"title"in a&&l(1,i=a.title),"text"in a&&l(2,s=a.text)},[n,i,s]}class xl extends It{constructor(e){super(),Lt(this,e,M1,S1,Dt,{color:0,title:1,text:2})}}function N1(t){let e,l=`${Tt(t[0].getDate())}.${Tt(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Tt(t[0].getHours())}:${Tt(t[0].getMinutes())}`,n;return{c(){e=p("span"),n=S(l),c(e,"class",t[1])},m(i,s){E(i,e,s),o(e,n)},p(i,s){s&1&&l!==(l=`${Tt(i[0].getDate())}.${Tt(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Tt(i[0].getHours())}:${Tt(i[0].getMinutes())}`)&&q(n,l),s&2&&c(e,"class",i[1])},d(i){i&&P(e)}}}function T1(t){var n;let e=`${Tt(t[0].getDate())}. ${t[2].months?(n=t[2].months)==null?void 0:n[t[0].getMonth()]:Tt(t[0].getMonth()+1)} ${Tt(t[0].getHours())}:${Tt(t[0].getMinutes())}`,l;return{c(){l=S(e)},m(i,s){E(i,l,s)},p(i,s){var a;s&5&&e!==(e=`${Tt(i[0].getDate())}. ${i[2].months?(a=i[2].months)==null?void 0:a[i[0].getMonth()]:Tt(i[0].getMonth()+1)} ${Tt(i[0].getHours())}:${Tt(i[0].getMinutes())}`)&&q(l,e)},d(i){i&&P(l)}}}function P1(t){let e;function l(s,a){return s[3]?T1:N1}let n=l(t),i=n(t);return{c(){i.c(),e=$t()},m(s,a){i.m(s,a),E(s,e,a)},p(s,[a]){n===(n=l(s))&&i?i.p(s,a):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},i:Ze,o:Ze,d(s){i.d(s),s&&P(e)}}}function E1(t,e,l){let n={};Ol.subscribe(f=>{l(2,n=f)});let{timestamp:i}=e,{fullTimeColor:s}=e,{offset:a}=e,r;return t.$$set=f=>{"timestamp"in f&&l(0,i=f.timestamp),"fullTimeColor"in f&&l(1,s=f.fullTimeColor),"offset"in f&&l(4,a=f.offset)},t.$$.update=()=>{t.$$.dirty&17&&(l(3,r=Math.abs(new Date().getTime()-i.getTime())<3e5),isNaN(a)||Kl(i,a-(24+i.getHours()-i.getUTCHours())%24))},[i,s,n,r,a]}class Lu extends It{constructor(e){super(),Lt(this,e,E1,P1,Dt,{timestamp:0,fullTimeColor:1,offset:4})}}function D1(t){let e,l,n;return{c(){e=jt("svg"),l=jt("path"),n=jt("path"),c(l,"stroke-linecap","round"),c(l,"stroke-linejoin","round"),c(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),c(n,"stroke-linecap","round"),c(n,"stroke-linejoin","round"),c(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"fill","none"),c(e,"viewBox","0 0 24 24"),c(e,"stroke-width","1.5"),c(e,"stroke","currentColor"),c(e,"class","w-6 h-6")},m(i,s){E(i,e,s),o(e,l),o(e,n)},p:Ze,i:Ze,o:Ze,d(i){i&&P(e)}}}class q1 extends It{constructor(e){super(),Lt(this,e,null,D1,Dt,{})}}function A1(t){let e,l;return{c(){e=jt("svg"),l=jt("path"),c(l,"stroke-linecap","round"),c(l,"stroke-linejoin","round"),c(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"fill","none"),c(e,"viewBox","0 0 24 24"),c(e,"stroke-width","1.5"),c(e,"stroke","currentColor"),c(e,"class","w-6 h-6")},m(n,i){E(n,e,i),o(e,l)},p:Ze,i:Ze,o:Ze,d(n){n&&P(e)}}}class L1 extends It{constructor(e){super(),Lt(this,e,null,A1,Dt,{})}}function I1(t){let e,l;return{c(){e=jt("svg"),l=jt("path"),c(l,"stroke-linecap","round"),c(l,"stroke-linejoin","round"),c(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"fill","none"),c(e,"viewBox","0 0 24 24"),c(e,"stroke-width","1.5"),c(e,"stroke","currentColor"),c(e,"class","w-6 h-6")},m(n,i){E(n,e,i),o(e,l)},p:Ze,i:Ze,o:Ze,d(n){n&&P(e)}}}class O1 extends It{constructor(e){super(),Lt(this,e,null,I1,Dt,{})}}function R1(t){let e,l,n=t[2].version+"",i;return{c(){e=S("AMS reader "),l=p("span"),i=S(n)},m(s,a){E(s,e,a),E(s,l,a),o(l,i)},p(s,a){a&4&&n!==(n=s[2].version+"")&&q(i,n)},d(s){s&&P(e),s&&P(l)}}}function Rs(t){let e,l=(t[1].t>-50?t[1].t.toFixed(1):"-")+"",n,i;return{c(){e=p("div"),n=S(l),i=S("\xB0C"),c(e,"class","flex-none my-auto")},m(s,a){E(s,e,a),o(e,n),o(e,i)},p(s,a){a&2&&l!==(l=(s[1].t>-50?s[1].t.toFixed(1):"-")+"")&&q(n,l)},d(s){s&&P(e)}}}function Fs(t){var i,s,a,r,f;let e,l=((s=(i=t[4].header)==null?void 0:i.han)!=null?s:"HAN")+": "+((f=(r=(a=t[4].errors)==null?void 0:a.han)==null?void 0:r[t[1].he])!=null?f:t[1].he),n;return{c(){e=p("div"),n=S(l),c(e,"class","bd-red")},m(u,m){E(u,e,m),o(e,n)},p(u,m){var _,d,v,b,h;m&18&&l!==(l=((d=(_=u[4].header)==null?void 0:_.han)!=null?d:"HAN")+": "+((h=(b=(v=u[4].errors)==null?void 0:v.han)==null?void 0:b[u[1].he])!=null?h:u[1].he))&&q(n,l)},d(u){u&&P(e)}}}function Bs(t){var i,s,a,r,f;let e,l=((s=(i=t[4].header)==null?void 0:i.mqtt)!=null?s:"MQTT")+": "+((f=(r=(a=t[4].errors)==null?void 0:a.mqtt)==null?void 0:r[t[1].me])!=null?f:t[1].me),n;return{c(){e=p("div"),n=S(l),c(e,"class","bd-red")},m(u,m){E(u,e,m),o(e,n)},p(u,m){var _,d,v,b,h;m&18&&l!==(l=((d=(_=u[4].header)==null?void 0:_.mqtt)!=null?d:"MQTT")+": "+((h=(b=(v=u[4].errors)==null?void 0:v.mqtt)==null?void 0:b[u[1].me])!=null?h:u[1].me))&&q(n,l)},d(u){u&&P(e)}}}function Us(t){var i,s,a,r,f;let e,l=((s=(i=t[4].header)==null?void 0:i.price)!=null?s:"PS")+": "+((f=(r=(a=t[4].errors)==null?void 0:a.price)==null?void 0:r[t[1].ee])!=null?f:t[1].ee),n;return{c(){e=p("div"),n=S(l),c(e,"class","bd-red")},m(u,m){E(u,e,m),o(e,n)},p(u,m){var _,d,v,b,h;m&18&&l!==(l=((d=(_=u[4].header)==null?void 0:_.price)!=null?d:"PS")+": "+((h=(b=(v=u[4].errors)==null?void 0:v.price)==null?void 0:b[u[1].ee])!=null?h:u[1].ee))&&q(n,l)},d(u){u&&P(e)}}}function js(t){let e,l,n,i,s,a,r,f;return l=new Al({props:{to:"/configuration",$$slots:{default:[F1]},$$scope:{ctx:t}}}),a=new Al({props:{to:"/status",$$slots:{default:[B1]},$$scope:{ctx:t}}}),{c(){var u,m,_,d;e=p("div"),Oe(l.$$.fragment),i=g(),s=p("div"),Oe(a.$$.fragment),c(e,"class","flex-none px-1 mt-1"),c(e,"title",n=(m=(u=t[4].header)==null?void 0:u.config)!=null?m:""),c(s,"class","flex-none px-1 mt-1"),c(s,"title",r=(d=(_=t[4].header)==null?void 0:_.status)!=null?d:"")},m(u,m){E(u,e,m),Le(l,e,null),E(u,i,m),E(u,s,m),Le(a,s,null),f=!0},p(u,m){var v,b,h,M;const _={};m&64&&(_.$$scope={dirty:m,ctx:u}),l.$set(_),(!f||m&16&&n!==(n=(b=(v=u[4].header)==null?void 0:v.config)!=null?b:""))&&c(e,"title",n);const d={};m&64&&(d.$$scope={dirty:m,ctx:u}),a.$set(d),(!f||m&16&&r!==(r=(M=(h=u[4].header)==null?void 0:h.status)!=null?M:""))&&c(s,"title",r)},i(u){f||(J(l.$$.fragment,u),J(a.$$.fragment,u),f=!0)},o(u){ie(l.$$.fragment,u),ie(a.$$.fragment,u),f=!1},d(u){u&&P(e),Ie(l),u&&P(i),u&&P(s),Ie(a)}}}function F1(t){let e,l;return e=new q1({}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function B1(t){let e,l;return e=new L1({}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function ys(t){let e,l;function n(a,r){return a[2].security==0||a[1].a?j1:U1}let i=n(t),s=i(t);return{c(){var a,r;e=p("div"),s.c(),c(e,"class","flex-none mr-3 text-yellow-500"),c(e,"title",l=((r=(a=t[4].header)==null?void 0:a.new_version)!=null?r:"New version")+": "+t[3].tag_name)},m(a,r){E(a,e,r),s.m(e,null)},p(a,r){var f,u;i===(i=n(a))&&s?s.p(a,r):(s.d(1),s=i(a),s&&(s.c(),s.m(e,null))),r&24&&l!==(l=((u=(f=a[4].header)==null?void 0:f.new_version)!=null?u:"New version")+": "+a[3].tag_name)&&c(e,"title",l)},d(a){a&&P(e),s.d()}}}function U1(t){var r,f;let e,l=((f=(r=t[4].header)==null?void 0:r.new_version)!=null?f:"New version")+"",n,i,s=t[3].tag_name+"",a;return{c(){e=p("span"),n=S(l),i=S(": "),a=S(s)},m(u,m){E(u,e,m),o(e,n),o(e,i),o(e,a)},p(u,m){var _,d;m&16&&l!==(l=((d=(_=u[4].header)==null?void 0:_.new_version)!=null?d:"New version")+"")&&q(n,l),m&8&&s!==(s=u[3].tag_name+"")&&q(a,s)},d(u){u&&P(e)}}}function j1(t){var m,_;let e,l,n=((_=(m=t[4].header)==null?void 0:m.new_version)!=null?_:"New version")+"",i,s,a=t[3].tag_name+"",r,f,u;return{c(){e=p("button"),l=p("span"),i=S(n),s=S(": "),r=S(a),c(l,"class","mt-1"),c(e,"class","flex")},m(d,v){E(d,e,v),o(e,l),o(l,i),o(l,s),o(l,r),f||(u=me(e,"click",t[5]),f=!0)},p(d,v){var b,h;v&16&&n!==(n=((h=(b=d[4].header)==null?void 0:b.new_version)!=null?h:"New version")+"")&&q(i,n),v&8&&a!==(a=d[3].tag_name+"")&&q(r,a)},d(d){d&&P(e),f=!1,u()}}}function y1(t){var te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t,Ee;let e,l,n,i,s,a,r,f,u,m,_,d=((ee=(te=t[4].header)==null?void 0:te.mem)!=null?ee:"Free")+"",v,b,h=(t[1].m?(t[1].m/1e3).toFixed(1):"-")+"",M,k,T,I,O,C,B,L,z,y,V,R,F,Y,j,W,K,U,H,Z,ne,X,$,ae,le,se,fe,re,Q,x,ge;i=new Al({props:{to:"/",$$slots:{default:[R1]},$$scope:{ctx:t}}}),f=new C1({props:{epoch:t[1].u}});let pe=t[1].t>-50&&Rs(t);O=new xl({props:{title:(ce=(oe=t[4].header)==null?void 0:oe.esp)!=null?ce:"ESP",text:t[2].booting?(Ce=(Pe=t[4].header)==null?void 0:Pe.booting)!=null?Ce:"Booting":t[1].v>2?t[1].v.toFixed(2)+"V":(Ne=(de=t[4].header)==null?void 0:de.esp)!=null?Ne:"ESP",color:Yl(t[2].booting?2:t[1].em)}}),B=new xl({props:{title:(ve=(Te=t[4].header)==null?void 0:Te.han)!=null?ve:"HAN",text:(He=(be=t[4].header)==null?void 0:be.han)!=null?He:"HAN",color:Yl(t[2].booting?9:t[1].hm)}}),z=new xl({props:{title:(Ve=(ye=t[4].header)==null?void 0:ye.wifi)!=null?Ve:"WiFi",text:t[1].r?t[1].r.toFixed(0)+"dBm":(Je=(xe=t[4].header)==null?void 0:xe.wifi)!=null?Je:"WiFi",color:Yl(t[2].booting?9:t[1].wm)}}),V=new xl({props:{title:(We=(it=t[4].header)==null?void 0:it.mqtt)!=null?We:"MQTT",text:(Ee=(_t=t[4].header)==null?void 0:_t.mqtt)!=null?Ee:"MQTT",color:Yl(t[2].booting?9:t[1].mm)}});let N=(t[1].he<0||t[1].he>0)&&Fs(t),w=t[1].me<0&&Bs(t),D=(t[1].ee>0||t[1].ee<0)&&Us(t);$=new Lu({props:{timestamp:t[1].c?new Date(t[1].c*1e3):new Date(0),offset:t[2].clock_offset,fullTimeColor:"text-red-500"}});let A=t[2].vndcfg&&t[2].usrcfg&&js(t);re=new O1({});let G=t[2].fwconsent===1&&t[3]&&ys(t);return{c(){var _e,Ue;e=p("nav"),l=p("div"),n=p("div"),Oe(i.$$.fragment),s=g(),a=p("div"),r=p("div"),Oe(f.$$.fragment),u=g(),pe&&pe.c(),m=g(),_=p("div"),v=S(d),b=S(": "),M=S(h),k=S("kb"),T=g(),I=p("div"),Oe(O.$$.fragment),C=g(),Oe(B.$$.fragment),L=g(),Oe(z.$$.fragment),y=g(),Oe(V.$$.fragment),R=g(),N&&N.c(),F=g(),w&&w.c(),Y=g(),D&&D.c(),j=g(),W=p("div"),K=p("div"),U=p("a"),H=p("img"),ne=g(),X=p("div"),Oe($.$$.fragment),ae=g(),A&&A.c(),le=g(),se=p("div"),fe=p("a"),Oe(re.$$.fragment),x=g(),G&&G.c(),c(n,"class","flex text-lg text-gray-100 p-2"),c(r,"class","flex-none my-auto"),c(_,"class","flex-none my-auto"),c(a,"class","flex-none my-auto p-2 flex space-x-4"),c(I,"class","flex-auto flex-wrap my-auto justify-center p-2"),c(H,"class","logo"),fi(H.src,Z=(t[0]+"/logo.svg").replace("//","/"))||c(H,"src",Z),c(H,"alt","GitHub repo"),c(U,"class","float-right"),c(U,"href","https://github.com/UtilitechAS/amsreader-firmware"),c(U,"target","_blank"),c(U,"rel","noreferrer"),c(U,"aria-label","GitHub"),c(K,"class","flex-none"),c(X,"class","flex-none my-auto px-2"),c(fe,"href",ql("")),c(fe,"target","_blank"),c(fe,"rel","noreferrer"),c(se,"class","flex-none px-1 mt-1"),c(se,"title",Q=(Ue=(_e=t[4].header)==null?void 0:_e.doc)!=null?Ue:""),c(W,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),c(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),c(e,"class","hdr")},m(_e,Ue){E(_e,e,Ue),o(e,l),o(l,n),Le(i,n,null),o(l,s),o(l,a),o(a,r),Le(f,r,null),o(a,u),pe&&pe.m(a,null),o(a,m),o(a,_),o(_,v),o(_,b),o(_,M),o(_,k),o(l,T),o(l,I),Le(O,I,null),o(I,C),Le(B,I,null),o(I,L),Le(z,I,null),o(I,y),Le(V,I,null),o(l,R),N&&N.m(l,null),o(l,F),w&&w.m(l,null),o(l,Y),D&&D.m(l,null),o(l,j),o(l,W),o(W,K),o(K,U),o(U,H),o(W,ne),o(W,X),Le($,X,null),o(W,ae),A&&A.m(W,null),o(W,le),o(W,se),o(se,fe),Le(re,fe,null),o(W,x),G&&G.m(W,null),ge=!0},p(_e,[Ue]){var Xe,Qe,ut,we,Ae,ke,ue,De,rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt;const kt={};Ue&68&&(kt.$$scope={dirty:Ue,ctx:_e}),i.$set(kt);const wt={};Ue&2&&(wt.epoch=_e[1].u),f.$set(wt),_e[1].t>-50?pe?pe.p(_e,Ue):(pe=Rs(_e),pe.c(),pe.m(a,m)):pe&&(pe.d(1),pe=null),(!ge||Ue&16)&&d!==(d=((Qe=(Xe=_e[4].header)==null?void 0:Xe.mem)!=null?Qe:"Free")+"")&&q(v,d),(!ge||Ue&2)&&h!==(h=(_e[1].m?(_e[1].m/1e3).toFixed(1):"-")+"")&&q(M,h);const nt={};Ue&16&&(nt.title=(we=(ut=_e[4].header)==null?void 0:ut.esp)!=null?we:"ESP"),Ue&22&&(nt.text=_e[2].booting?(ke=(Ae=_e[4].header)==null?void 0:Ae.booting)!=null?ke:"Booting":_e[1].v>2?_e[1].v.toFixed(2)+"V":(De=(ue=_e[4].header)==null?void 0:ue.esp)!=null?De:"ESP"),Ue&6&&(nt.color=Yl(_e[2].booting?2:_e[1].em)),O.$set(nt);const vt={};Ue&16&&(vt.title=(st=(rt=_e[4].header)==null?void 0:rt.han)!=null?st:"HAN"),Ue&16&&(vt.text=(pt=(at=_e[4].header)==null?void 0:at.han)!=null?pt:"HAN"),Ue&6&&(vt.color=Yl(_e[2].booting?9:_e[1].hm)),B.$set(vt);const ze={};Ue&16&&(ze.title=(Rt=(ht=_e[4].header)==null?void 0:ht.wifi)!=null?Rt:"WiFi"),Ue&18&&(ze.text=_e[1].r?_e[1].r.toFixed(0)+"dBm":(ct=(Pt=_e[4].header)==null?void 0:Pt.wifi)!=null?ct:"WiFi"),Ue&6&&(ze.color=Yl(_e[2].booting?9:_e[1].wm)),z.$set(ze);const Ke={};Ue&16&&(Ke.title=(zt=(Ft=_e[4].header)==null?void 0:Ft.mqtt)!=null?zt:"MQTT"),Ue&16&&(Ke.text=(Ut=(Bt=_e[4].header)==null?void 0:Bt.mqtt)!=null?Ut:"MQTT"),Ue&6&&(Ke.color=Yl(_e[2].booting?9:_e[1].mm)),V.$set(Ke),_e[1].he<0||_e[1].he>0?N?N.p(_e,Ue):(N=Fs(_e),N.c(),N.m(l,F)):N&&(N.d(1),N=null),_e[1].me<0?w?w.p(_e,Ue):(w=Bs(_e),w.c(),w.m(l,Y)):w&&(w.d(1),w=null),_e[1].ee>0||_e[1].ee<0?D?D.p(_e,Ue):(D=Us(_e),D.c(),D.m(l,j)):D&&(D.d(1),D=null),(!ge||Ue&1&&!fi(H.src,Z=(_e[0]+"/logo.svg").replace("//","/")))&&c(H,"src",Z);const Ye={};Ue&2&&(Ye.timestamp=_e[1].c?new Date(_e[1].c*1e3):new Date(0)),Ue&4&&(Ye.offset=_e[2].clock_offset),$.$set(Ye),_e[2].vndcfg&&_e[2].usrcfg?A?(A.p(_e,Ue),Ue&4&&J(A,1)):(A=js(_e),A.c(),J(A,1),A.m(W,le)):A&&(bt(),ie(A,1,1,()=>{A=null}),gt()),(!ge||Ue&16&&Q!==(Q=(yt=(qt=_e[4].header)==null?void 0:qt.doc)!=null?yt:""))&&c(se,"title",Q),_e[2].fwconsent===1&&_e[3]?G?G.p(_e,Ue):(G=ys(_e),G.c(),G.m(W,null)):G&&(G.d(1),G=null)},i(_e){ge||(J(i.$$.fragment,_e),J(f.$$.fragment,_e),J(O.$$.fragment,_e),J(B.$$.fragment,_e),J(z.$$.fragment,_e),J(V.$$.fragment,_e),J($.$$.fragment,_e),J(A),J(re.$$.fragment,_e),ge=!0)},o(_e){ie(i.$$.fragment,_e),ie(f.$$.fragment,_e),ie(O.$$.fragment,_e),ie(B.$$.fragment,_e),ie(z.$$.fragment,_e),ie(V.$$.fragment,_e),ie($.$$.fragment,_e),ie(A),ie(re.$$.fragment,_e),ge=!1},d(_e){_e&&P(e),Ie(i),Ie(f),pe&&pe.d(),Ie(O),Ie(B),Ie(z),Ie(V),N&&N.d(),w&&w.d(),D&&D.d(),Ie($),A&&A.d(),Ie(re),G&&G.d()}}}function H1(t,e,l){let{basepath:n="/"}=e,{data:i={}}=e,s={},a={};function r(){var u,m;confirm(((m=(u=f.header)==null?void 0:u.upgrade)!=null?m:"Upgrade to {0}?").replace("{0}",a.tag_name))&&(!rn(s.board)||confirm(pi(lt(s.chip,s.board))))&&(kl.update(_=>(_.upgrading=!0,_)),qu(a.tag_name))}kl.subscribe(u=>{l(2,s=u),u.fwconsent===1&&m1()}),ls.subscribe(u=>{l(3,a=Au(s.version,u))});let f={};return Ol.subscribe(u=>{l(4,f=u)}),t.$$set=u=>{"basepath"in u&&l(0,n=u.basepath),"data"in u&&l(1,i=u.data)},[n,i,s,a,f,r]}class z1 extends It{constructor(e){super(),Lt(this,e,H1,y1,Dt,{basepath:0,data:1})}}function W1(t){let e,l,n,i;return{c(){e=jt("svg"),l=jt("path"),n=jt("path"),c(l,"d",Ci(150,150,115,210,510)),c(l,"stroke","rgba(128, 128, 128, 0.15)"),c(l,"fill","none"),c(l,"stroke-width","55"),c(n,"d",i=Ci(150,150,115,210,210+300*t[0]/100)),c(n,"stroke",t[1]),c(n,"fill","none"),c(n,"stroke-width","55"),c(e,"viewBox","0 0 300 300"),c(e,"xmlns","http://www.w3.org/2000/svg"),c(e,"height","100%")},m(s,a){E(s,e,a),o(e,l),o(e,n)},p(s,[a]){a&1&&i!==(i=Ci(150,150,115,210,210+300*s[0]/100))&&c(n,"d",i),a&2&&c(n,"stroke",s[1])},i:Ze,o:Ze,d(s){s&&P(e)}}}function Hs(t,e,l,n){var i=(n-90)*Math.PI/180;return{x:t+l*Math.cos(i),y:e+l*Math.sin(i)}}function Ci(t,e,l,n,i){var s=Hs(t,e,l,i),a=Hs(t,e,l,n),r=i-n<=180?"0":"1",f=["M",s.x,s.y,"A",l,l,0,r,0,a.x,a.y].join(" ");return f}function G1(t,e,l){let{pct:n=0}=e,{color:i="red"}=e;return t.$$set=s=>{"pct"in s&&l(0,n=s.pct),"color"in s&&l(1,i=s.color)},[n,i]}class V1 extends It{constructor(e){super(),Lt(this,e,G1,W1,Dt,{pct:0,color:1})}}function zs(t){let e,l,n,i,s,a,r,f;return{c(){e=p("br"),l=g(),n=p("span"),i=S(t[1]),s=g(),a=p("span"),r=S(t[2]),f=S("/kWh"),c(n,"class","pl-sub"),c(a,"class","pl-snt")},m(u,m){E(u,e,m),E(u,l,m),E(u,n,m),o(n,i),E(u,s,m),E(u,a,m),o(a,r),o(a,f)},p(u,m){m&2&&q(i,u[1]),m&4&&q(r,u[2])},d(u){u&&P(e),u&&P(l),u&&P(n),u&&P(s),u&&P(a)}}}function K1(t){let e,l,n,i,s,a,r,f,u,m,_=t[4][0]+"",d,v,b,h=t[4][1]+"",M,k,T;l=new V1({props:{pct:t[5],color:t[3](t[5],document.documentElement.classList.contains("dark"))}});let I=t[1]&&zs(t);return{c(){e=p("div"),Oe(l.$$.fragment),n=g(),i=p("span"),s=p("span"),a=S(t[0]),r=g(),f=p("br"),u=g(),m=p("span"),d=S(_),v=g(),b=p("span"),M=S(h),k=g(),I&&I.c(),c(s,"class","pl-lab"),c(m,"class","pl-val"),c(b,"class","pl-unt"),c(i,"class","pl-ov"),c(e,"class","pl-root")},m(O,C){E(O,e,C),Le(l,e,null),o(e,n),o(e,i),o(i,s),o(s,a),o(i,r),o(i,f),o(i,u),o(i,m),o(m,d),o(i,v),o(i,b),o(b,M),o(i,k),I&&I.m(i,null),T=!0},p(O,[C]){const B={};C&32&&(B.pct=O[5]),C&40&&(B.color=O[3](O[5],document.documentElement.classList.contains("dark"))),l.$set(B),(!T||C&1)&&q(a,O[0]),(!T||C&16)&&_!==(_=O[4][0]+"")&&q(d,_),(!T||C&16)&&h!==(h=O[4][1]+"")&&q(M,h),O[1]?I?I.p(O,C):(I=zs(O),I.c(),I.m(i,null)):I&&(I.d(1),I=null)},i(O){T||(J(l.$$.fragment,O),T=!0)},o(O){ie(l.$$.fragment,O),T=!1},d(O){O&&P(e),Ie(l),I&&I.d()}}}function Y1(t,e,l){let{val:n}=e,{max:i}=e,{unit:s}=e,{label:a}=e,{sub:r=""}=e,{subunit:f=""}=e,{colorFn:u}=e,m,_=0;return t.$$set=d=>{"val"in d&&l(6,n=d.val),"max"in d&&l(7,i=d.max),"unit"in d&&l(8,s=d.unit),"label"in d&&l(0,a=d.label),"sub"in d&&l(1,r=d.sub),"subunit"in d&&l(2,f=d.subunit),"colorFn"in d&&l(3,u=d.colorFn)},t.$$.update=()=>{t.$$.dirty&448&&(l(4,m=gl(n,s)),l(5,_=Math.min(n,i)/i*100))},[a,r,f,u,m,_,n,i,s]}class Iu extends It{constructor(e){super(),Lt(this,e,Y1,K1,Dt,{val:6,max:7,unit:8,label:0,sub:1,subunit:2,colorFn:3})}}function Ws(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Gs(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Vs(t,e,l){const n=t.slice();return n[15]=e[l],n}function Ks(t){let e,l,n,i,s,a,r,f=(t[0].title||t[0].link)&&Ys(t),u=t[0].y.ticks,m=[];for(let h=0;h{f=null}),gt()),M&129){u=h[0].y.ticks;let k;for(k=0;k{s=null}),gt())},i(a){n||(J(s),n=!0)},o(a){ie(s),n=!1},d(a){a&&P(e),i&&i.d(),s&&s.d()}}}function Qs(t){let e,l=t[0].title+"",n,i;return{c(){e=p("div"),n=S(l),c(e,"class","text-sm font-bold"),Wt(()=>t[9].call(e))},m(s,a){E(s,e,a),o(e,n),i=Qi(e,t[9].bind(e))},p(s,a){a&1&&l!==(l=s[0].title+"")&&q(n,l)},d(s){s&&P(e),i()}}}function Xs(t){let e,l,n,i;const s=[X1,Q1],a=[];function r(f,u){return f[0].link.route?0:1}return l=r(t),n=a[l]=s[l](t),{c(){e=p("div"),n.c(),c(e,"class","text-xs text-right")},m(f,u){E(f,e,u),a[l].m(e,null),i=!0},p(f,u){let m=l;l=r(f),l===m?a[l].p(f,u):(bt(),ie(a[m],1,1,()=>{a[m]=null}),gt(),n=a[l],n?n.p(f,u):(n=a[l]=s[l](f),n.c()),J(n,1),n.m(e,null))},i(f){i||(J(n),i=!0)},o(f){ie(n),i=!1},d(f){f&&P(e),a[l].d()}}}function Q1(t){let e,l=t[0].link.text+"",n,i,s;return{c(){e=p("a"),n=S(l),c(e,"href",i=t[0].link.url),c(e,"target",s=t[0].link.target)},m(a,r){E(a,e,r),o(e,n)},p(a,r){r&1&&l!==(l=a[0].link.text+"")&&q(n,l),r&1&&i!==(i=a[0].link.url)&&c(e,"href",i),r&1&&s!==(s=a[0].link.target)&&c(e,"target",s)},i:Ze,o:Ze,d(a){a&&P(e)}}}function X1(t){let e,l;return e=new Al({props:{to:t[0].link.url,$$slots:{default:[Z1]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.to=n[0].link.url),i&262145&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function Z1(t){let e=t[0].link.text+"",l;return{c(){l=S(e)},m(n,i){E(n,l,i)},p(n,i){i&1&&e!==(e=n[0].link.text+"")&&q(l,e)},d(n){n&&P(l)}}}function Zs(t){let e,l,n,i=t[15].label+"",s,a,r,f;return{c(){e=jt("g"),l=jt("line"),n=jt("text"),s=S(i),c(l,"x2","100%"),c(n,"y","-4"),c(n,"x",a=t[15].align=="right"?"85%":""),c(e,"class",r="tick tick-"+t[15].value+" tick-"+t[15].color),c(e,"transform",f="translate(0, "+t[7](t[15].value)+")")},m(u,m){E(u,e,m),o(e,l),o(e,n),o(n,s)},p(u,m){m&1&&i!==(i=u[15].label+"")&&q(s,i),m&1&&a!==(a=u[15].align=="right"?"85%":"")&&c(n,"x",a),m&1&&r!==(r="tick tick-"+u[15].value+" tick-"+u[15].color)&&c(e,"class",r),m&129&&f!==(f="translate(0, "+u[7](u[15].value)+")")&&c(e,"transform",f)},d(u){u&&P(e)}}}function Js(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Zs(t);return{c(){n&&n.c(),l=$t()},m(i,s){n&&n.m(i,s),E(i,l,s)},p(i,s){s&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,s):(n=Zs(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&P(l)}}}function $s(t){let e,l,n=(t[3]>20||t[13]%2==0)&&xs(t);return{c(){e=jt("g"),n&&n.c(),c(e,"class","tick"),c(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,s){E(i,e,s),n&&n.m(e,null)},p(i,s){i[3]>20||i[13]%2==0?n?n.p(i,s):(n=xs(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),s&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&c(e,"transform",l)},d(i){i&&P(e),n&&n.d()}}}function xs(t){let e,l=t[11].label+"",n,i;return{c(){e=jt("text"),n=S(l),c(e,"x",i=t[3]/2),c(e,"y","-4")},m(s,a){E(s,e,a),o(e,n)},p(s,a){a&1&&l!==(l=s[11].label+"")&&q(n,l),a&8&&i!==(i=s[3]/2)&&c(e,"x",i)},d(s){s&&P(e)}}}function eo(t){let e=!isNaN(t[6](t[13])),l,n=e&&$s(t);return{c(){n&&n.c(),l=$t()},m(i,s){n&&n.m(i,s),E(i,l,s)},p(i,s){s&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,s):(n=$s(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&P(l)}}}function to(t){let e,l,n=t[11].value!==void 0&&lo(t),i=t[11].value2>1e-4&&so(t);return{c(){e=jt("g"),n&&n.c(),l=jt("g"),i&&i.c()},m(s,a){E(s,e,a),n&&n.m(e,null),E(s,l,a),i&&i.m(l,null)},p(s,a){s[11].value!==void 0?n?n.p(s,a):(n=lo(s),n.c(),n.m(e,null)):n&&(n.d(1),n=null),s[11].value2>1e-4?i?i.p(s,a):(i=so(s),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(s){s&&P(e),n&&n.d(),s&&P(l),i&&i.d()}}}function lo(t){let e,l,n,i,s,a,r,f=t[3]>15&&no(t);return{c(){e=jt("rect"),f&&f.c(),r=$t(),c(e,"x",l=t[6](t[13])+2),c(e,"y",n=t[7](t[11].value)),c(e,"width",i=t[3]-4),c(e,"height",s=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),c(e,"fill",a=t[11].color)},m(u,m){E(u,e,m),f&&f.m(u,m),E(u,r,m)},p(u,m){m&64&&l!==(l=u[6](u[13])+2)&&c(e,"x",l),m&129&&n!==(n=u[7](u[11].value))&&c(e,"y",n),m&8&&i!==(i=u[3]-4)&&c(e,"width",i),m&129&&s!==(s=u[7](u[0].y.min)-u[7](Math.min(u[0].y.min,0)+u[11].value))&&c(e,"height",s),m&1&&a!==(a=u[11].color)&&c(e,"fill",a),u[3]>15?f?f.p(u,m):(f=no(u),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(u){u&&P(e),f&&f.d(u),u&&P(r)}}}function no(t){let e,l=t[11].label+"",n,i,s,a,r,f,u=t[11].title&&io(t);return{c(){e=jt("text"),n=S(l),u&&u.c(),f=$t(),c(e,"width",i=t[3]-4),c(e,"dominant-baseline","middle"),c(e,"text-anchor",s=t[3]t[7](0)-t[8]&&!t[0].dark?t[11].color:"white"),c(e,"transform",r="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[11].labelAngle?t[11].labelAngle:t[3]m[7](0)-m[8]&&!m[0].dark?m[11].color:"white")&&c(e,"fill",a),_&457&&r!==(r="translate("+(m[6](m[13])+m[3]/2)+" "+(m[7](m[11].value)>m[7](0)-m[8]?m[7](m[11].value)-m[8]:m[7](m[11].value)+10)+") rotate("+(m[11].labelAngle?m[11].labelAngle:m[3]15&&oo(t);return{c(){e=jt("rect"),f&&f.c(),r=$t(),c(e,"x",l=t[6](t[13])+2),c(e,"y",n=t[7](0)),c(e,"width",i=t[3]-4),c(e,"height",s=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),c(e,"fill",a=t[11].color2?t[11].color2:t[11].color)},m(u,m){E(u,e,m),f&&f.m(u,m),E(u,r,m)},p(u,m){m&64&&l!==(l=u[6](u[13])+2)&&c(e,"x",l),m&128&&n!==(n=u[7](0))&&c(e,"y",n),m&8&&i!==(i=u[3]-4)&&c(e,"width",i),m&129&&s!==(s=u[7](u[0].y.min)-u[7](u[0].y.min+u[11].value2))&&c(e,"height",s),m&1&&a!==(a=u[11].color2?u[11].color2:u[11].color)&&c(e,"fill",a),u[3]>15?f?f.p(u,m):(f=oo(u),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(u){u&&P(e),f&&f.d(u),u&&P(r)}}}function oo(t){let e,l=t[11].label2+"",n,i,s,a,r,f=t[11].title2&&ao(t);return{c(){e=jt("text"),n=S(l),f&&f.c(),r=$t(),c(e,"width",i=t[3]-4),c(e,"dominant-baseline","middle"),c(e,"text-anchor","middle"),c(e,"fill",s=t[7](-t[11].value2)t[10].call(e))},m(s,a){E(s,e,a),i&&i.m(e,null),l=Qi(e,t[10].bind(e)),n=!0},p(s,[a]){s[0].x.ticks&&s[0].points&&s[4]?i?(i.p(s,a),a&17&&J(i,1)):(i=Ks(s),i.c(),J(i,1),i.m(e,null)):i&&(bt(),ie(i,1,1,()=>{i=null}),gt())},i(s){n||(J(i),n=!0)},o(s){ie(i),n=!1},d(s){s&&P(e),i&&i.d(),l()}}}let en=30;function $1(t,e,l){let{config:n}=e,i,s,a,r,f,u,m,_=0;function d(){_=this.clientHeight,l(5,_)}function v(){i=this.clientWidth,s=this.clientHeight,l(1,i),l(2,s)}return t.$$set=b=>{"config"in b&&l(0,n=b.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,u=s-_);let b=i-(n.padding.left+n.padding.right);l(3,a=b/n.points.length),l(8,m=an.y.max?k=n.padding.bottom:Mu||k<0?0:k})}},[n,i,s,a,u,_,r,f,m,d,v]}class nn extends It{constructor(e){super(),Lt(this,e,$1,J1,Dt,{config:0})}}function x1(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function e0(t,e,l){let{title:n}=e,{u1:i}=e,{u2:s}=e,{u3:a}=e,{ds:r}=e,f={};function u(m){return{label:Xt(m)+"V",title:m.toFixed(1)+" V",value:isNaN(m)?0:m,color:i1(m||0,document.documentElement.classList.contains("dark"))}}return t.$$set=m=>{"title"in m&&l(1,n=m.title),"u1"in m&&l(2,i=m.u1),"u2"in m&&l(3,s=m.u2),"u3"in m&&l(4,a=m.u3),"ds"in m&&l(5,r=m.ds)},t.$$.update=()=>{if(t.$$.dirty&62){let m=[],_=[];i>0&&(m.push({label:r===1?"L1-L2":"L1"}),_.push(u(i))),s>0&&(m.push({label:r===1?"L1-L3":"L2"}),_.push(u(s))),a>0&&(m.push({label:r===1?"L2-L3":"L3"}),_.push(u(a))),l(0,f={title:n,padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:m},points:_})}},[f,n,i,s,a,r]}class t0 extends It{constructor(e){super(),Lt(this,e,e0,x1,Dt,{title:1,u1:2,u2:3,u3:4,ds:5})}}function l0(t){var A,G,te,ee,oe,ce,Pe,Ce,de,Ne;let e,l,n=((G=(A=t[0].reactive)==null?void 0:A.title)!=null?G:"Reactive")+"",i,s,a,r,f=((ee=(te=t[0].reactive)==null?void 0:te.instant_in)!=null?ee:"Instant in")+"",u,m,_,d=t[1][0]+"",v,b,h=t[1][1]+"",M,k,T,I=((ce=(oe=t[0].reactive)==null?void 0:oe.instant_out)!=null?ce:"Instant out")+"",O,C,B,L=t[2][0]+"",z,y,V=t[2][1]+"",R,F,Y,j,W=((Ce=(Pe=t[0].reactive)==null?void 0:Pe.total_in)!=null?Ce:"Total in")+"",K,U,H,Z=t[3][0]+"",ne,X,$=t[3][1]+"",ae,le,se,fe=((Ne=(de=t[0].reactive)==null?void 0:de.total_out)!=null?Ne:"Total out")+"",re,Q,x,ge=t[4][0]+"",pe,N,w=t[4][1]+"",D;return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("div"),r=p("div"),u=S(f),m=g(),_=p("div"),v=S(d),b=g(),M=S(h),k=g(),T=p("div"),O=S(I),C=g(),B=p("div"),z=S(L),y=g(),R=S(V),F=g(),Y=p("div"),j=p("div"),K=S(W),U=g(),H=p("div"),ne=S(Z),X=g(),ae=S($),le=g(),se=p("div"),re=S(fe),Q=g(),x=p("div"),pe=S(ge),N=g(),D=S(w),c(_,"class","text-right"),c(B,"class","text-right"),c(a,"class","grid grid-cols-2 mt-4"),c(H,"class","text-right"),c(x,"class","text-right"),c(Y,"class","grid grid-cols-2 mt-4"),c(e,"class","mx-2 text-sm")},m(Te,ve){E(Te,e,ve),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(r,u),o(a,m),o(a,_),o(_,v),o(_,b),o(_,M),o(a,k),o(a,T),o(T,O),o(a,C),o(a,B),o(B,z),o(B,y),o(B,R),o(e,F),o(e,Y),o(Y,j),o(j,K),o(Y,U),o(Y,H),o(H,ne),o(H,X),o(H,ae),o(Y,le),o(Y,se),o(se,re),o(Y,Q),o(Y,x),o(x,pe),o(x,N),o(x,D)},p(Te,[ve]){var be,He,ye,Ve,xe,Je,it,We,_t,Ee;ve&1&&n!==(n=((He=(be=Te[0].reactive)==null?void 0:be.title)!=null?He:"Reactive")+"")&&q(i,n),ve&1&&f!==(f=((Ve=(ye=Te[0].reactive)==null?void 0:ye.instant_in)!=null?Ve:"Instant in")+"")&&q(u,f),ve&2&&d!==(d=Te[1][0]+"")&&q(v,d),ve&2&&h!==(h=Te[1][1]+"")&&q(M,h),ve&1&&I!==(I=((Je=(xe=Te[0].reactive)==null?void 0:xe.instant_out)!=null?Je:"Instant out")+"")&&q(O,I),ve&4&&L!==(L=Te[2][0]+"")&&q(z,L),ve&4&&V!==(V=Te[2][1]+"")&&q(R,V),ve&1&&W!==(W=((We=(it=Te[0].reactive)==null?void 0:it.total_in)!=null?We:"Total in")+"")&&q(K,W),ve&8&&Z!==(Z=Te[3][0]+"")&&q(ne,Z),ve&8&&$!==($=Te[3][1]+"")&&q(ae,$),ve&1&&fe!==(fe=((Ee=(_t=Te[0].reactive)==null?void 0:_t.total_out)!=null?Ee:"Total out")+"")&&q(re,fe),ve&16&&ge!==(ge=Te[4][0]+"")&&q(pe,ge),ve&16&&w!==(w=Te[4][1]+"")&&q(D,w)},i:Ze,o:Ze,d(Te){Te&&P(e)}}}function n0(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:s}=e,{exportTotal:a}=e,{translations:r={}}=e,f,u,m,_;return t.$$set=d=>{"importInstant"in d&&l(5,n=d.importInstant),"exportInstant"in d&&l(6,i=d.exportInstant),"importTotal"in d&&l(7,s=d.importTotal),"exportTotal"in d&&l(8,a=d.exportTotal),"translations"in d&&l(0,r=d.translations)},t.$$.update=()=>{t.$$.dirty&480&&(l(1,f=gl(n,"VAr")),l(2,u=gl(i,"VAr")),l(3,m=gl(s*1e3,"VArh")),l(4,_=gl(a*1e3,"VArh")))},[r,f,u,m,_,n,i,s,a]}class i0 extends It{constructor(e){super(),Lt(this,e,n0,l0,Dt,{importInstant:5,exportInstant:6,importTotal:7,exportTotal:8,translations:0})}}function uo(t){let e;function l(s,a){return s[3]?o0:s0}let n=l(t),i=n(t);return{c(){i.c(),e=$t()},m(s,a){i.m(s,a),E(s,e,a)},p(s,a){n===(n=l(s))&&i?i.p(s,a):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},d(s){i.d(s),s&&P(e)}}}function s0(t){var G,te,ee,oe,ce,Pe,Ce,de,Ne,Te;let e,l=((te=(G=t[4].realtime)==null?void 0:G.consumption)!=null?te:"Consumption")+"",n,i,s,a,r=tl((oe=(ee=t[4].common)==null?void 0:ee.hour)!=null?oe:"Hour")+"",f,u,m,_=t[6][0]+"",d,v,b=t[6][1]+"",h,M,k,T=tl((Pe=(ce=t[4].common)==null?void 0:ce.day)!=null?Pe:"Day")+"",I,O,C,B=t[7][0]+"",L,z,y=t[7][1]+"",V,R,F,Y=tl((de=(Ce=t[4].common)==null?void 0:Ce.month)!=null?de:"Month")+"",j,W,K,U=t[8][0]+"",H,Z,ne=t[8][1]+"",X,$,ae,le=((Te=(Ne=t[4].realtime)==null?void 0:Ne.last_month)!=null?Te:"Last month")+"",se,fe,re,Q=t[9][0]+"",x,ge,pe=t[9][1]+"",N,w,D,A=t[5]&&ro(t);return{c(){e=p("strong"),n=S(l),i=g(),s=p("div"),a=p("div"),f=S(r),u=g(),m=p("div"),d=S(_),v=g(),h=S(b),M=g(),k=p("div"),I=S(T),O=g(),C=p("div"),L=S(B),z=g(),V=S(y),R=g(),F=p("div"),j=S(Y),W=g(),K=p("div"),H=S(U),Z=g(),X=S(ne),$=g(),ae=p("div"),se=S(le),fe=g(),re=p("div"),x=S(Q),ge=g(),N=S(pe),w=g(),A&&A.c(),D=$t(),c(m,"class","text-right"),c(C,"class","text-right"),c(K,"class","text-right"),c(re,"class","text-right"),c(s,"class","grid grid-cols-2 mb-3")},m(ve,be){E(ve,e,be),o(e,n),E(ve,i,be),E(ve,s,be),o(s,a),o(a,f),o(s,u),o(s,m),o(m,d),o(m,v),o(m,h),o(s,M),o(s,k),o(k,I),o(s,O),o(s,C),o(C,L),o(C,z),o(C,V),o(s,R),o(s,F),o(F,j),o(s,W),o(s,K),o(K,H),o(K,Z),o(K,X),o(s,$),o(s,ae),o(ae,se),o(s,fe),o(s,re),o(re,x),o(re,ge),o(re,N),E(ve,w,be),A&&A.m(ve,be),E(ve,D,be)},p(ve,be){var He,ye,Ve,xe,Je,it,We,_t,Ee,_e;be&16&&l!==(l=((ye=(He=ve[4].realtime)==null?void 0:He.consumption)!=null?ye:"Consumption")+"")&&q(n,l),be&16&&r!==(r=tl((xe=(Ve=ve[4].common)==null?void 0:Ve.hour)!=null?xe:"Hour")+"")&&q(f,r),be&64&&_!==(_=ve[6][0]+"")&&q(d,_),be&64&&b!==(b=ve[6][1]+"")&&q(h,b),be&16&&T!==(T=tl((it=(Je=ve[4].common)==null?void 0:Je.day)!=null?it:"Day")+"")&&q(I,T),be&128&&B!==(B=ve[7][0]+"")&&q(L,B),be&128&&y!==(y=ve[7][1]+"")&&q(V,y),be&16&&Y!==(Y=tl((_t=(We=ve[4].common)==null?void 0:We.month)!=null?_t:"Month")+"")&&q(j,Y),be&256&&U!==(U=ve[8][0]+"")&&q(H,U),be&256&&ne!==(ne=ve[8][1]+"")&&q(X,ne),be&16&&le!==(le=((_e=(Ee=ve[4].realtime)==null?void 0:Ee.last_month)!=null?_e:"Last month")+"")&&q(se,le),be&512&&Q!==(Q=ve[9][0]+"")&&q(x,Q),be&512&&pe!==(pe=ve[9][1]+"")&&q(N,pe),ve[5]?A?A.p(ve,be):(A=ro(ve),A.c(),A.m(D.parentNode,D)):A&&(A.d(1),A=null)},d(ve){ve&&P(e),ve&&P(i),ve&&P(s),ve&&P(w),A&&A.d(ve),ve&&P(D)}}}function o0(t){var qe,Ge,Qt,el,xt,Se,Re,Fe,il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl;let e,l=((Ge=(qe=t[4].common)==null?void 0:qe.import)!=null?Ge:"Import")+"",n,i,s,a,r=tl((el=(Qt=t[4].common)==null?void 0:Qt.hour)!=null?el:"Hour")+"",f,u,m,_=t[6][0]+"",d,v,b=t[6][1]+"",h,M,k,T,I=tl((Se=(xt=t[4].common)==null?void 0:xt.day)!=null?Se:"Day")+"",O,C,B,L=t[7][0]+"",z,y,V=t[7][1]+"",R,F,Y,j,W=tl((Fe=(Re=t[4].common)==null?void 0:Re.month)!=null?Fe:"Month")+"",K,U,H,Z=t[8][0]+"",ne,X,$=t[8][1]+"",ae,le,se,fe,re=((sl=(il=t[4].realtime)==null?void 0:il.last_mo)!=null?sl:"Last mo.")+"",Q,x,ge,pe=t[9][0]+"",N,w,D=t[9][1]+"",A,G,te,ee,oe,ce=((al=(ol=t[4].common)==null?void 0:ol.export)!=null?al:"Export")+"",Pe,Ce,de,Ne,Te=tl((ul=(fl=t[4].common)==null?void 0:fl.hour)!=null?ul:"Hour")+"",ve,be,He,ye=t[10][0]+"",Ve,xe,Je=t[10][1]+"",it,We,_t,Ee,_e=tl((cl=(rl=t[4].common)==null?void 0:rl.day)!=null?cl:"Day")+"",Ue,kt,wt,nt=t[11][0]+"",vt,ze,Ke=t[11][1]+"",Ye,Xe,Qe,ut,we=tl((_l=(ml=t[4].common)==null?void 0:ml.month)!=null?_l:"Month")+"",Ae,ke,ue,De=t[12][0]+"",rt,st,at=t[12][1]+"",pt,ht,Rt,Pt,ct=((dl=(pl=t[4].realtime)==null?void 0:pl.last_mo)!=null?dl:"Last mo.")+"",Ft,zt,Bt,Ut=t[13][0]+"",qt,yt,Gt=t[13][1]+"",Vt,Yt,Ct,Mt=t[5]&&co(t),ft=t[5]&&mo(t),Nt=t[5]&&_o(t),Et=t[5]&&po(t),dt=t[5]&&vo(t),At=t[5]&&ho(t),St=t[5]&&bo(t),mt=t[5]&&go(t);return{c(){e=p("strong"),n=S(l),i=g(),s=p("div"),a=p("div"),f=S(r),u=g(),m=p("div"),d=S(_),v=g(),h=S(b),M=g(),Mt&&Mt.c(),k=g(),T=p("div"),O=S(I),C=g(),B=p("div"),z=S(L),y=g(),R=S(V),F=g(),ft&&ft.c(),Y=g(),j=p("div"),K=S(W),U=g(),H=p("div"),ne=S(Z),X=g(),ae=S($),le=g(),Nt&&Nt.c(),se=g(),fe=p("div"),Q=S(re),x=g(),ge=p("div"),N=S(pe),w=g(),A=S(D),G=g(),Et&&Et.c(),ee=g(),oe=p("strong"),Pe=S(ce),Ce=g(),de=p("div"),Ne=p("div"),ve=S(Te),be=g(),He=p("div"),Ve=S(ye),xe=g(),it=S(Je),We=g(),dt&&dt.c(),_t=g(),Ee=p("div"),Ue=S(_e),kt=g(),wt=p("div"),vt=S(nt),ze=g(),Ye=S(Ke),Xe=g(),At&&At.c(),Qe=g(),ut=p("div"),Ae=S(we),ke=g(),ue=p("div"),rt=S(De),st=g(),pt=S(at),ht=g(),St&&St.c(),Rt=g(),Pt=p("div"),Ft=S(ct),zt=g(),Bt=p("div"),qt=S(Ut),yt=g(),Vt=S(Gt),Yt=g(),mt&&mt.c(),c(m,"class","text-right"),c(B,"class","text-right"),c(H,"class","text-right"),c(ge,"class","text-right"),c(s,"class",te="grid grid-cols-"+t[14]+" mb-3"),c(He,"class","text-right"),c(wt,"class","text-right"),c(ue,"class","text-right"),c(Bt,"class","text-right"),c(de,"class",Ct="grid grid-cols-"+t[14])},m(Be,et){E(Be,e,et),o(e,n),E(Be,i,et),E(Be,s,et),o(s,a),o(a,f),o(s,u),o(s,m),o(m,d),o(m,v),o(m,h),o(s,M),Mt&&Mt.m(s,null),o(s,k),o(s,T),o(T,O),o(s,C),o(s,B),o(B,z),o(B,y),o(B,R),o(s,F),ft&&ft.m(s,null),o(s,Y),o(s,j),o(j,K),o(s,U),o(s,H),o(H,ne),o(H,X),o(H,ae),o(s,le),Nt&&Nt.m(s,null),o(s,se),o(s,fe),o(fe,Q),o(s,x),o(s,ge),o(ge,N),o(ge,w),o(ge,A),o(s,G),Et&&Et.m(s,null),E(Be,ee,et),E(Be,oe,et),o(oe,Pe),E(Be,Ce,et),E(Be,de,et),o(de,Ne),o(Ne,ve),o(de,be),o(de,He),o(He,Ve),o(He,xe),o(He,it),o(de,We),dt&&dt.m(de,null),o(de,_t),o(de,Ee),o(Ee,Ue),o(de,kt),o(de,wt),o(wt,vt),o(wt,ze),o(wt,Ye),o(de,Xe),At&&At.m(de,null),o(de,Qe),o(de,ut),o(ut,Ae),o(de,ke),o(de,ue),o(ue,rt),o(ue,st),o(ue,pt),o(de,ht),St&&St.m(de,null),o(de,Rt),o(de,Pt),o(Pt,Ft),o(de,zt),o(de,Bt),o(Bt,qt),o(Bt,yt),o(Bt,Vt),o(de,Yt),mt&&mt.m(de,null)},p(Be,et){var je,he,Kt,wl,Cl,Sl,Ml,Nl,Tl,Pl,El,Dl,Rl,Fl,Bl,Ul,tt,Ot,vl,bl;et&16&&l!==(l=((he=(je=Be[4].common)==null?void 0:je.import)!=null?he:"Import")+"")&&q(n,l),et&16&&r!==(r=tl((wl=(Kt=Be[4].common)==null?void 0:Kt.hour)!=null?wl:"Hour")+"")&&q(f,r),et&64&&_!==(_=Be[6][0]+"")&&q(d,_),et&64&&b!==(b=Be[6][1]+"")&&q(h,b),Be[5]?Mt?Mt.p(Be,et):(Mt=co(Be),Mt.c(),Mt.m(s,k)):Mt&&(Mt.d(1),Mt=null),et&16&&I!==(I=tl((Sl=(Cl=Be[4].common)==null?void 0:Cl.day)!=null?Sl:"Day")+"")&&q(O,I),et&128&&L!==(L=Be[7][0]+"")&&q(z,L),et&128&&V!==(V=Be[7][1]+"")&&q(R,V),Be[5]?ft?ft.p(Be,et):(ft=mo(Be),ft.c(),ft.m(s,Y)):ft&&(ft.d(1),ft=null),et&16&&W!==(W=tl((Nl=(Ml=Be[4].common)==null?void 0:Ml.month)!=null?Nl:"Month")+"")&&q(K,W),et&256&&Z!==(Z=Be[8][0]+"")&&q(ne,Z),et&256&&$!==($=Be[8][1]+"")&&q(ae,$),Be[5]?Nt?Nt.p(Be,et):(Nt=_o(Be),Nt.c(),Nt.m(s,se)):Nt&&(Nt.d(1),Nt=null),et&16&&re!==(re=((Pl=(Tl=Be[4].realtime)==null?void 0:Tl.last_mo)!=null?Pl:"Last mo.")+"")&&q(Q,re),et&512&&pe!==(pe=Be[9][0]+"")&&q(N,pe),et&512&&D!==(D=Be[9][1]+"")&&q(A,D),Be[5]?Et?Et.p(Be,et):(Et=po(Be),Et.c(),Et.m(s,null)):Et&&(Et.d(1),Et=null),et&16384&&te!==(te="grid grid-cols-"+Be[14]+" mb-3")&&c(s,"class",te),et&16&&ce!==(ce=((Dl=(El=Be[4].common)==null?void 0:El.export)!=null?Dl:"Export")+"")&&q(Pe,ce),et&16&&Te!==(Te=tl((Fl=(Rl=Be[4].common)==null?void 0:Rl.hour)!=null?Fl:"Hour")+"")&&q(ve,Te),et&1024&&ye!==(ye=Be[10][0]+"")&&q(Ve,ye),et&1024&&Je!==(Je=Be[10][1]+"")&&q(it,Je),Be[5]?dt?dt.p(Be,et):(dt=vo(Be),dt.c(),dt.m(de,_t)):dt&&(dt.d(1),dt=null),et&16&&_e!==(_e=tl((Ul=(Bl=Be[4].common)==null?void 0:Bl.day)!=null?Ul:"Day")+"")&&q(Ue,_e),et&2048&&nt!==(nt=Be[11][0]+"")&&q(vt,nt),et&2048&&Ke!==(Ke=Be[11][1]+"")&&q(Ye,Ke),Be[5]?At?At.p(Be,et):(At=ho(Be),At.c(),At.m(de,Qe)):At&&(At.d(1),At=null),et&16&&we!==(we=tl((Ot=(tt=Be[4].common)==null?void 0:tt.month)!=null?Ot:"Month")+"")&&q(Ae,we),et&4096&&De!==(De=Be[12][0]+"")&&q(rt,De),et&4096&&at!==(at=Be[12][1]+"")&&q(pt,at),Be[5]?St?St.p(Be,et):(St=bo(Be),St.c(),St.m(de,Rt)):St&&(St.d(1),St=null),et&16&&ct!==(ct=((bl=(vl=Be[4].realtime)==null?void 0:vl.last_mo)!=null?bl:"Last mo.")+"")&&q(Ft,ct),et&8192&&Ut!==(Ut=Be[13][0]+"")&&q(qt,Ut),et&8192&&Gt!==(Gt=Be[13][1]+"")&&q(Vt,Gt),Be[5]?mt?mt.p(Be,et):(mt=go(Be),mt.c(),mt.m(de,null)):mt&&(mt.d(1),mt=null),et&16384&&Ct!==(Ct="grid grid-cols-"+Be[14])&&c(de,"class",Ct)},d(Be){Be&&P(e),Be&&P(i),Be&&P(s),Mt&&Mt.d(),ft&&ft.d(),Nt&&Nt.d(),Et&&Et.d(),Be&&P(ee),Be&&P(oe),Be&&P(Ce),Be&&P(de),dt&&dt.d(),At&&At.d(),St&&St.d(),mt&&mt.d()}}}function ro(t){var x,ge,pe,N,w,D,A,G,te,ee;let e,l=((ge=(x=t[4].realtime)==null?void 0:x.cost)!=null?ge:"Cost")+"",n,i,s,a,r=tl((N=(pe=t[4].common)==null?void 0:pe.hour)!=null?N:"Hour")+"",f,u,m,_=Xt(t[1].h.c,2)+"",d,v,b,h,M,k=tl((D=(w=t[4].common)==null?void 0:w.day)!=null?D:"Day")+"",T,I,O,C=Xt(t[1].d.c,1)+"",B,L,z,y,V,R=tl((G=(A=t[4].common)==null?void 0:A.month)!=null?G:"Month")+"",F,Y,j,W=Xt(t[1].m.c)+"",K,U,H,Z,ne,X=((ee=(te=t[4].realtime)==null?void 0:te.last_month)!=null?ee:"Last month")+"",$,ae,le,se=Xt(t[0].last_month.c)+"",fe,re,Q;return{c(){e=p("strong"),n=S(l),i=g(),s=p("div"),a=p("div"),f=S(r),u=g(),m=p("div"),d=S(_),v=g(),b=S(t[2]),h=g(),M=p("div"),T=S(k),I=g(),O=p("div"),B=S(C),L=g(),z=S(t[2]),y=g(),V=p("div"),F=S(R),Y=g(),j=p("div"),K=S(W),U=g(),H=S(t[2]),Z=g(),ne=p("div"),$=S(X),ae=g(),le=p("div"),fe=S(se),re=g(),Q=S(t[2]),c(m,"class","text-right"),c(O,"class","text-right"),c(j,"class","text-right"),c(le,"class","text-right"),c(s,"class","grid grid-cols-2")},m(oe,ce){E(oe,e,ce),o(e,n),E(oe,i,ce),E(oe,s,ce),o(s,a),o(a,f),o(s,u),o(s,m),o(m,d),o(m,v),o(m,b),o(s,h),o(s,M),o(M,T),o(s,I),o(s,O),o(O,B),o(O,L),o(O,z),o(s,y),o(s,V),o(V,F),o(s,Y),o(s,j),o(j,K),o(j,U),o(j,H),o(s,Z),o(s,ne),o(ne,$),o(s,ae),o(s,le),o(le,fe),o(le,re),o(le,Q)},p(oe,ce){var Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve;ce&16&&l!==(l=((Ce=(Pe=oe[4].realtime)==null?void 0:Pe.cost)!=null?Ce:"Cost")+"")&&q(n,l),ce&16&&r!==(r=tl((Ne=(de=oe[4].common)==null?void 0:de.hour)!=null?Ne:"Hour")+"")&&q(f,r),ce&2&&_!==(_=Xt(oe[1].h.c,2)+"")&&q(d,_),ce&4&&q(b,oe[2]),ce&16&&k!==(k=tl((ve=(Te=oe[4].common)==null?void 0:Te.day)!=null?ve:"Day")+"")&&q(T,k),ce&2&&C!==(C=Xt(oe[1].d.c,1)+"")&&q(B,C),ce&4&&q(z,oe[2]),ce&16&&R!==(R=tl((He=(be=oe[4].common)==null?void 0:be.month)!=null?He:"Month")+"")&&q(F,R),ce&2&&W!==(W=Xt(oe[1].m.c)+"")&&q(K,W),ce&4&&q(H,oe[2]),ce&16&&X!==(X=((Ve=(ye=oe[4].realtime)==null?void 0:ye.last_month)!=null?Ve:"Last month")+"")&&q($,X),ce&1&&se!==(se=Xt(oe[0].last_month.c)+"")&&q(fe,se),ce&4&&q(Q,oe[2])},d(oe){oe&&P(e),oe&&P(i),oe&&P(s)}}}function co(t){let e,l=Xt(t[1].h.c,2)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].h.c,2)+"")&&q(n,l),r&4&&q(s,a[2])},d(a){a&&P(e)}}}function mo(t){let e,l=Xt(t[1].d.c,1)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].d.c,1)+"")&&q(n,l),r&4&&q(s,a[2])},d(a){a&&P(e)}}}function _o(t){let e,l=Xt(t[1].m.c)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].m.c)+"")&&q(n,l),r&4&&q(s,a[2])},d(a){a&&P(e)}}}function po(t){let e,l=Xt(t[0].last_month.c)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&1&&l!==(l=Xt(a[0].last_month.c)+"")&&q(n,l),r&4&&q(s,a[2])},d(a){a&&P(e)}}}function vo(t){let e,l=Xt(t[1].h.i,2)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].h.i,2)+"")&&q(n,l),r&4&&q(s,a[2])},d(a){a&&P(e)}}}function ho(t){let e,l=Xt(t[1].d.i,1)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].d.i,1)+"")&&q(n,l),r&4&&q(s,a[2])},d(a){a&&P(e)}}}function bo(t){let e,l=Xt(t[1].m.i)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&2&&l!==(l=Xt(a[1].m.i)+"")&&q(n,l),r&4&&q(s,a[2])},d(a){a&&P(e)}}}function go(t){let e,l=Xt(t[0].last_month.i)+"",n,i,s;return{c(){e=p("div"),n=S(l),i=g(),s=S(t[2]),c(e,"class","text-right")},m(a,r){E(a,e,r),o(e,n),o(e,i),o(e,s)},p(a,r){r&1&&l!==(l=Xt(a[0].last_month.i)+"")&&q(n,l),r&4&&q(s,a[2])},d(a){a&&P(e)}}}function a0(t){var m,_;let e,l,n=((_=(m=t[4].realtime)==null?void 0:m.title)!=null?_:"Real time calculations")+"",i,s,a,r,f,u=t[1]&&uo(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("br"),r=p("br"),f=g(),u&&u.c(),c(e,"class","mx-2 text-sm")},m(d,v){E(d,e,v),o(e,l),o(l,i),o(e,s),o(e,a),o(e,r),o(e,f),u&&u.m(e,null)},p(d,[v]){var b,h;v&16&&n!==(n=((h=(b=d[4].realtime)==null?void 0:b.title)!=null?h:"Real time calculations")+"")&&q(i,n),d[1]?u?u.p(d,v):(u=uo(d),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i:Ze,o:Ze,d(d){d&&P(e),u&&u.d()}}}function f0(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:s}=e,{hasExport:a}=e,{translations:r={}}=e,f,u,m,_,d,v,b,h,M=!1,k=3;return t.$$set=T=>{"sysinfo"in T&&l(0,n=T.sysinfo),"data"in T&&l(1,i=T.data),"currency"in T&&l(2,s=T.currency),"hasExport"in T&&l(3,a=T.hasExport),"translations"in T&&l(4,r=T.translations)},t.$$.update=()=>{var T,I,O,C,B,L,z,y;t.$$.dirty&35&&(l(5,M=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(14,k=M?3:2),l(6,f=gl(((T=i==null?void 0:i.h)==null?void 0:T.u)*1e3,"Wh")),l(7,u=gl(((I=i==null?void 0:i.d)==null?void 0:I.u)*1e3,"Wh")),l(8,m=gl(((O=i==null?void 0:i.m)==null?void 0:O.u)*1e3,"Wh")),l(9,_=gl(((C=n==null?void 0:n.last_month)==null?void 0:C.u)*1e3,"Wh")),l(10,d=gl(((B=i==null?void 0:i.h)==null?void 0:B.p)*1e3,"Wh")),l(11,v=gl(((L=i==null?void 0:i.d)==null?void 0:L.p)*1e3,"Wh")),l(12,b=gl(((z=i==null?void 0:i.m)==null?void 0:z.p)*1e3,"Wh")),l(13,h=gl(((y=n==null?void 0:n.last_month)==null?void 0:y.p)*1e3,"Wh")))},[n,i,s,a,r,M,f,u,m,_,d,v,b,h,k]}class u0 extends It{constructor(e){super(),Lt(this,e,f0,a0,Dt,{sysinfo:0,data:1,currency:2,hasExport:3,translations:4})}}function r0(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function c0(t,e,l){let{title:n}=e,{json:i}=e,{sysinfo:s}=e,a={},r,f,u=document.documentElement.classList.contains("dark");return t.$$set=m=>{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,s=m.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let m=i.currency,_=new Date().getUTCHours(),d=0,v=0,b=0,h=[],M=[],k=[];l(5,f=l(4,r=0));let T=new Date;for(Kl(T,s.clock_offset-(24+T.getHours()-T.getUTCHours())%24),d=_;d<24&&(v=i[Tt(b++)],v!=null);d++)M.push({label:Tt(T.getHours())}),k.push(v*100),l(5,f=Math.min(f,v*100)),l(4,r=Math.max(r,v*100)),Kl(T,1);for(d=0;d<24&&(v=i[Tt(b++)],v!=null);d++)M.push({label:Tt(T.getHours())}),k.push(v*100),l(5,f=Math.min(f,v*100)),l(4,r=Math.max(r,v*100)),Kl(T,1);if(f>-100&&r<100){switch(m){case"NOK":case"DKK":m="\xF8re";break;case"SEK":m="\xF6re";break;case"EUR":m="cent";break;case"CHF":m="rp.";break;default:m=m+"/100"}for(l(5,f*=100),l(4,r*=100),d=0;d=0?L.toFixed(z):"",title:L>=0?L.toFixed(2)+" "+m:"",value:v>=0?Math.abs(v):0,label2:L<0?L.toFixed(z):"",title2:L<0?L.toFixed(2)+" "+m:"",value2:v<0?Math.abs(v):0,color:u?"#5c2da5":"#7c3aed"})}let O=Math.max(r,Math.abs(f));if(f<0){l(5,f=Math.min(O/4*-1,f));let L=Math.ceil(Math.abs(f)/O*4),z=f/L;for(d=1;d{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,s=m.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let m=0,_=[],d=[],v=[];l(5,f=l(4,r=0));let b=new Date,h=new Date;h.setDate(0),h.setHours(12);let M=(h.getHours()-h.getUTCHours())%24-s.clock_offset,k=b.getUTCHours();for(Kl(b,-M-24),m=k;m<24;m++){let C=i["i"+Tt(m)],B=i["e"+Tt(m)];C===void 0&&(C=0),B===void 0&&(B=0),d.push({label:Tt(b.getHours())}),v.push({label:C.toFixed(1),title:C.toFixed(2)+" kWh",value:C*10,label2:B.toFixed(1),title2:B.toFixed(2)+" kWh",value2:B*10,color:u?"#5c2da5":"#7c3aed",color2:u?"#27728e":"#37829e"}),l(5,f=Math.max(f,B*10)),l(4,r=Math.max(r,C*10)),Kl(b,1)}for(m=0;m{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,s=m.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let m=0,_=[],d=[],v=[];l(5,f=l(4,r=0));let b=new Date,h=new Date;h.setDate(0),h.setHours(12);let M=(h.getHours()-h.getUTCHours())%24-s.clock_offset;for(Kl(b,-M),Kl(h,-M),m=b.getDate();m<=h.getDate();m++){let O=i["i"+Tt(m)],C=i["e"+Tt(m)];O===void 0&&(O=0),C===void 0&&(C=0),d.push({label:Tt(m)}),v.push({label:O.toFixed(O<10?1:0),title:O.toFixed(2)+" kWh",value:O,label2:C.toFixed(C<10?1:0),title2:C.toFixed(2)+" kWh",value2:C,color:u?"#5c2da5":"#7c3aed",color2:u?"#27728e":"#37829e"}),l(5,f=Math.max(f,C)),l(4,r=Math.max(r,O))}for(m=1;m{"title"in u&&l(1,n=u.title),"json"in u&&l(2,i=u.json)},t.$$.update=()=>{if(t.$$.dirty&30){let u=0,m=0,_=[],d=[],v=[];i.s&&i.s.forEach((M,k)=>{var T=M.n?M.n:M.a;m=M.v,m==-127&&(m=0),d.push({label:T.slice(-4)}),v.push({label:m.toFixed(1),value:m,color:s?"#5c2da5":"#7c3aed"}),l(4,f=Math.min(f,m)),l(3,r=Math.max(r,m))}),l(3,r=Math.ceil(r)),l(4,f=Math.floor(f));let b=r;f<0&&(b+=Math.abs(f));let h=b/4;for(u=0;u<5;u++)m=f+h*u,_.push({value:m,label:m.toFixed(1)});l(0,a={title:n+" (\xB0C)",dark:document.documentElement.classList.contains("dark"),height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:f,max:r,ticks:_},x:{ticks:d},points:v})}},[a,n,i,r,f]}class w0 extends It{constructor(e){super(),Lt(this,e,k0,g0,Dt,{title:1,json:2})}}function C0(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}let S0=0;function M0(t,e,l){let{title:n}=e,{translations:i={}}=e,s=document.documentElement.classList.contains("dark"),a={},r=0,{tariffData:f}=e;return t.$$set=u=>{"title"in u&&l(1,n=u.title),"translations"in u&&l(2,i=u.translations),"tariffData"in u&&l(3,f=u.tariffData)},t.$$.update=()=>{var u;if(t.$$.dirty&30){let m=0,_=[],d=[],v=[];if(_.push({value:0,label:0}),f&&f.p)for(m=0;m0?Tt(b.d)+"."+(i.months?(u=i.months)==null?void 0:u[new Date().getMonth()]:Tt(new Date().getMonth()+1)):"-"}),l(4,r=Math.max(r,b.v))}if(f&&f.t){for(m=0;m=r)break;_.push({value:b,label:b})}_.push({label:f.m.toFixed(1),align:"right",color:"green",value:f.m})}f&&f.c&&(_.push({label:f.c.toFixed(0),color:"orange",value:f.c}),l(4,r=Math.max(r,f.c))),l(4,r=Math.ceil(r)),l(0,a={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:35,bottom:20,left:35},y:{min:S0,max:r,ticks:_},x:{ticks:d},points:v})}},[a,n,i,f,r]}class N0 extends It{constructor(e){super(),Lt(this,e,M0,C0,Dt,{title:1,translations:2,tariffData:3})}}let Jl=0,T0={data:[]};async function ns(){let e=await(await Il(Jl<0?"realtime.json":"realtime.json?offset="+Jl)).json();is.update(l=>{for(let n=0;n=0&&(Jl+=e.size,Jlfn||Ui-fn>300?(ns(),Si=0):is.update(t=>{if(t.lastUpdate)for(;fn>t.lastUpdate;)t.data.unshift(Ou),t.data=t.data.slice(0,t.size),t.lastUpdate+=10,Si++;else t.lastUpdate=fn;return t})}function D0(t){if(Ou=t.i-t.e,fn=t.u,!ko){ns(),ko=!0,Ui=fn;return}!P0()||E0()}function wo(t,e,l){const n=t.slice();return n[18]=e[l],n[20]=l,n}function Co(t,e,l){const n=t.slice();return n[21]=e[l],n}function q0(t){let e,l,n;return{c(){e=p("strong"),l=S(t[0]),n=S(" not available"),c(e,"class","text-sm")},m(i,s){E(i,e,s),o(e,l),o(e,n)},p(i,s){s&1&&q(l,i[0])},d(i){i&&P(e)}}}function A0(t){let e,l,n,i,s,a,r,f=t[8]&&So(t);return{c(){e=p("strong"),l=S(t[0]),n=S(" ("),i=S(t[12]),s=S(")"),a=g(),f&&f.c(),r=$t(),c(e,"class","text-sm")},m(u,m){E(u,e,m),o(e,l),o(e,n),o(e,i),o(e,s),E(u,a,m),f&&f.m(u,m),E(u,r,m)},p(u,m){m&1&&q(l,u[0]),m&4096&&q(i,u[12]),u[8]?f?f.p(u,m):(f=So(u),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(u){u&&P(e),u&&P(a),f&&f.d(u),u&&P(r)}}}function So(t){let e,l,n,i,s,a=t[8],r=[];for(let m=0;mt[17].call(e))},m(a,r){E(a,e,r),s.m(e,null),l=Qi(e,t[17].bind(e))},p(a,[r]){i===(i=n(a))&&s?s.p(a,r):(s.d(1),s=i(a),s&&(s.c(),s.m(e,null)))},i:Ze,o:Ze,d(a){a&&P(e),s.d(),l()}}}function I0(t,e,l){let{title:n}=e,i=document.documentElement.classList.contains("dark"),s=null;is.subscribe(C=>{l(16,s=C)});let a=!1,r,f,u,m,_,d,v,b=function(C,B,L){return Math.ceil(_-(C-B)/(L-B)*_)-25},h=function(C){return 30+Math.ceil(C/s.size*(d-35))},M,k,T,I;function O(){u=this.clientWidth,m=this.clientHeight,l(3,u),l(4,m)}return t.$$set=C=>{"title"in C&&l(0,n=C.title)},t.$$.update=()=>{if(t.$$.dirty&67582)if(l(5,_=parseInt(m)-50),l(6,d=u-35),l(10,T=d/s.size),l(2,f=0),l(1,r=0),s.data&&_>10&&d>100&&T>.1){l(11,a=!0);for(let L in s.data){let z=s.data[L];isNaN(z)&&(z=0),l(1,r=Math.max(Math.ceil(z/1e3)*1e3,r)),l(2,f=Math.min(Math.floor(z/1e3)*1e3,f))}let C=r-f;l(12,I=r>2500?"kW":"W"),l(8,M=[]);for(let L=f;L2500?(L/1e3).toFixed(1):L}),!(M.length>6));L+=C/5);l(9,k=[]);for(let L=0;L12));L+=Math.round(s.size/Math.round(d/120)));let B=s.size;l(7,v=h(s.size)+","+b(0,f,r)+" "+h(1)+","+b(0,f,r));for(let L in s.data){if(B<0)break;let z=s.data[L];isNaN(z)&&(z=0),l(7,v=h(B--)+","+b(z,f,r)+" "+v)}}else l(11,a=!1)},[n,r,f,u,m,_,d,v,M,k,T,a,I,i,b,h,s,O]}class O0 extends It{constructor(e){super(),Lt(this,e,I0,L0,Dt,{title:0})}}function R0(t){let e,l;return e=new nn({props:{config:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function F0(t,e,l){let{title:n}=e,{unit:i=""}=e,{l1:s=!1}=e,{l2:a=!1}=e,{l2x:r=!1}=e,{l3:f=!1}=e,{l1i:u=0}=e,{l2i:m=0}=e,{l3i:_=0}=e,{l1e:d=0}=e,{l2e:v=0}=e,{l3e:b=0}=e,{maxImport:h=0}=e,{maxExport:M=0}=e,{importColorFn:k}=e,{exportColorFn:T}=e,I={};function O(C,B){return{label:Xt(C>900?C/1e3:C)+(C>900?"k":"")+i,title:C.toFixed(2)+" "+i,value:isNaN(C)?0:C,color:k(C?C/h*100:0,document.documentElement.classList.contains("dark")),label2:Xt(B>900?B/1e3:B)+(B>900?"k":"")+i,title2:B.toFixed(2)+" "+i,value2:isNaN(B)?0:B,color2:T(B?B/M*100:0)}}return t.$$set=C=>{"title"in C&&l(1,n=C.title),"unit"in C&&l(2,i=C.unit),"l1"in C&&l(3,s=C.l1),"l2"in C&&l(4,a=C.l2),"l2x"in C&&l(5,r=C.l2x),"l3"in C&&l(6,f=C.l3),"l1i"in C&&l(7,u=C.l1i),"l2i"in C&&l(8,m=C.l2i),"l3i"in C&&l(9,_=C.l3i),"l1e"in C&&l(10,d=C.l1e),"l2e"in C&&l(11,v=C.l2e),"l3e"in C&&l(12,b=C.l3e),"maxImport"in C&&l(13,h=C.maxImport),"maxExport"in C&&l(14,M=C.maxExport),"importColorFn"in C&&l(15,k=C.importColorFn),"exportColorFn"in C&&l(16,T=C.exportColorFn)},t.$$.update=()=>{if(t.$$.dirty&32762){let C=[],B=[];s&&(C.push({label:"L1"}),B.push(O(u,d))),a&&(r?(C.push({label:"L2"}),B.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(C.push({label:"L2"}),B.push(O(m,v)))),f&&(C.push({label:"L3"}),B.push(O(_,b)));let L=[];if(M){let z=M>h?4:M*4/h;L.push({value:-M,label:"-100%"}),z>=4&&L.push({value:-M/4*3,label:"-75%"}),z>=2&&L.push({value:-M/2,label:"-50%"}),z>=4&&L.push({value:-M/4,label:"-25%"})}if(L.push({value:0,label:"0%"}),h){let z=h>M?4:h*4/M;L.push({value:h/4,label:"25%"}),z>=4&&L.push({value:h/2,label:"50%"}),z>=2&&L.push({value:h/4*3,label:"75%"}),z>=4&&L.push({value:h,label:"100%"})}l(0,I={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:15,bottom:20,left:35},y:{min:-M,max:h,ticks:L},x:{ticks:C},points:B})}},[I,n,i,s,a,r,f,u,m,_,d,v,b,h,M,k,T]}class ss extends It{constructor(e){super(),Lt(this,e,F0,R0,Dt,{title:1,unit:2,l1:3,l2:4,l2x:5,l3:6,l1i:7,l2i:8,l3i:9,l1e:10,l2e:11,l3e:12,maxImport:13,maxExport:14,importColorFn:15,exportColorFn:16})}}function Eo(t){var k,T;let e,l,n,i,s,a,r=(t[0].mt?_i(t[0].mt):"-")+"",f,u,m,_=t[11][0]+"",d,v,b=t[11][1]+"",h,M;return i=new Iu({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:(T=(k=t[6].common)==null?void 0:k.import)!=null?T:"Import",sub:Xt(t[0].p,2),subunit:t[0].pc,colorFn:xi}}),{c(){e=p("div"),l=p("div"),n=p("div"),Oe(i.$$.fragment),s=g(),a=p("div"),f=S(r),u=g(),m=p("div"),d=S(_),v=g(),h=S(b),c(n,"class","col-span-2"),c(m,"class","text-right"),c(l,"class","grid grid-cols-2"),c(e,"class","cnt")},m(I,O){E(I,e,O),o(e,l),o(l,n),Le(i,n,null),o(l,s),o(l,a),o(a,f),o(l,u),o(l,m),o(m,d),o(m,v),o(m,h),M=!0},p(I,O){var B,L;const C={};O&1&&(C.val=I[0].i?I[0].i:0),O&1&&(C.max=I[0].im?I[0].im:15e3),O&64&&(C.label=(L=(B=I[6].common)==null?void 0:B.import)!=null?L:"Import"),O&1&&(C.sub=Xt(I[0].p,2)),O&1&&(C.subunit=I[0].pc),i.$set(C),(!M||O&1)&&r!==(r=(I[0].mt?_i(I[0].mt):"-")+"")&&q(f,r),(!M||O&2048)&&_!==(_=I[11][0]+"")&&q(d,_),(!M||O&2048)&&b!==(b=I[11][1]+"")&&q(h,b)},i(I){M||(J(i.$$.fragment,I),M=!0)},o(I){ie(i.$$.fragment,I),M=!1},d(I){I&&P(e),Ie(i)}}}function Do(t){var h,M;let e,l,n,i,s,a,r,f,u=t[12][0]+"",m,_,d=t[12][1]+"",v,b;return i=new Iu({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:(M=(h=t[6].common)==null?void 0:h.export)!=null?M:"Export",sub:Xt(t[0].px,2),subunit:t[0].pc,colorFn:Xn}}),{c(){e=p("div"),l=p("div"),n=p("div"),Oe(i.$$.fragment),s=g(),a=p("div"),r=g(),f=p("div"),m=S(u),_=g(),v=S(d),c(n,"class","col-span-2"),c(f,"class","text-right"),c(l,"class","grid grid-cols-2"),c(e,"class","cnt")},m(k,T){E(k,e,T),o(e,l),o(l,n),Le(i,n,null),o(l,s),o(l,a),o(l,r),o(l,f),o(f,m),o(f,_),o(f,v),b=!0},p(k,T){var O,C;const I={};T&1&&(I.val=k[0].e?k[0].e:0),T&1&&(I.max=k[0].om?k[0].om*1e3:1e4),T&64&&(I.label=(C=(O=k[6].common)==null?void 0:O.export)!=null?C:"Export"),T&1&&(I.sub=Xt(k[0].px,2)),T&1&&(I.subunit=k[0].pc),i.$set(I),(!b||T&4096)&&u!==(u=k[12][0]+"")&&q(m,u),(!b||T&4096)&&d!==(d=k[12][1]+"")&&q(v,d)},i(k){b||(J(i.$$.fragment,k),b=!0)},o(k){ie(i.$$.fragment,k),b=!1},d(k){k&&P(e),Ie(i)}}}function qo(t){let e,l,n=t[0].l1&&Ao(t);return{c(){e=p("div"),n&&n.c(),c(e,"class","cnt")},m(i,s){E(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&J(n,1)):(n=Ao(i),n.c(),J(n,1),n.m(e,null)):n&&(bt(),ie(n,1,1,()=>{n=null}),gt())},i(i){l||(J(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Ao(t){var n,i;let e,l;return e=new t0({props:{title:(i=(n=t[6].common)==null?void 0:n.voltage)!=null?i:"Volt",u1:t[0].l1.u,u2:t[0].l2.u,u3:t[0].l3.u,ds:t[0].ds}}),{c(){Oe(e.$$.fragment)},m(s,a){Le(e,s,a),l=!0},p(s,a){var f,u;const r={};a&64&&(r.title=(u=(f=s[6].common)==null?void 0:f.voltage)!=null?u:"Volt"),a&1&&(r.u1=s[0].l1.u),a&1&&(r.u2=s[0].l2.u),a&1&&(r.u3=s[0].l3.u),a&1&&(r.ds=s[0].ds),e.$set(r)},i(s){l||(J(e.$$.fragment,s),l=!0)},o(s){ie(e.$$.fragment,s),l=!1},d(s){Ie(e,s)}}}function Lo(t){let e,l,n=t[0].l1&&Io(t);return{c(){e=p("div"),n&&n.c(),c(e,"class","cnt")},m(i,s){E(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&J(n,1)):(n=Io(i),n.c(),J(n,1),n.m(e,null)):n&&(bt(),ie(n,1,1,()=>{n=null}),gt())},i(i){l||(J(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Io(t){var n,i;let e,l;return e=new ss({props:{title:(i=(n=t[6].common)==null?void 0:n.amperage)!=null?i:"Amp",unit:"A",importColorFn:xi,exportColorFn:Xn,maxImport:t[0].mf,maxExport:t[0].om?t[13]?t[0].om/.4/Math.sqrt(3):t[0].om/.23:0,l1:t[8],l2:t[9],l3:t[10],l2x:t[0].l2.e,l1i:Math.max(t[0].l1.i,0),l2i:Math.max(t[0].l2.i,0),l3i:Math.max(t[0].l3.i,0),l1e:Math.max(t[0].l1.i*-1,0),l2e:Math.max(t[0].l2.i*-1,0),l3e:Math.max(t[0].l3.i*-1,0)}}),{c(){Oe(e.$$.fragment)},m(s,a){Le(e,s,a),l=!0},p(s,a){var f,u;const r={};a&64&&(r.title=(u=(f=s[6].common)==null?void 0:f.amperage)!=null?u:"Amp"),a&1&&(r.maxImport=s[0].mf),a&8193&&(r.maxExport=s[0].om?s[13]?s[0].om/.4/Math.sqrt(3):s[0].om/.23:0),a&256&&(r.l1=s[8]),a&512&&(r.l2=s[9]),a&1024&&(r.l3=s[10]),a&1&&(r.l2x=s[0].l2.e),a&1&&(r.l1i=Math.max(s[0].l1.i,0)),a&1&&(r.l2i=Math.max(s[0].l2.i,0)),a&1&&(r.l3i=Math.max(s[0].l3.i,0)),a&1&&(r.l1e=Math.max(s[0].l1.i*-1,0)),a&1&&(r.l2e=Math.max(s[0].l2.i*-1,0)),a&1&&(r.l3e=Math.max(s[0].l3.i*-1,0)),e.$set(r)},i(s){l||(J(e.$$.fragment,s),l=!0)},o(s){ie(e.$$.fragment,s),l=!1},d(s){Ie(e,s)}}}function Oo(t){let e,l,n=t[0].l1&&Ro(t);return{c(){e=p("div"),n&&n.c(),c(e,"class","cnt")},m(i,s){E(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&J(n,1)):(n=Ro(i),n.c(),J(n,1),n.m(e,null)):n&&(bt(),ie(n,1,1,()=>{n=null}),gt())},i(i){l||(J(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Ro(t){var n,i;let e,l;return e=new ss({props:{title:(i=(n=t[6].dashboard)==null?void 0:n.phase)!=null?i:"Phase",unit:"W",importColorFn:xi,exportColorFn:Xn,maxImport:(t[0].mf?t[0].mf:32)*230,maxExport:t[0].om?t[13]?t[0].om*1e3/Math.sqrt(3):t[0].om*1e3:0,l1:t[8],l2:t[9],l3:t[10],l1i:t[0].l1.p,l2i:t[0].l2.p,l3i:t[0].l3.p,l1e:t[0].l1.q,l2e:t[0].l2.q,l3e:t[0].l3.q}}),{c(){Oe(e.$$.fragment)},m(s,a){Le(e,s,a),l=!0},p(s,a){var f,u;const r={};a&64&&(r.title=(u=(f=s[6].dashboard)==null?void 0:f.phase)!=null?u:"Phase"),a&1&&(r.maxImport=(s[0].mf?s[0].mf:32)*230),a&8193&&(r.maxExport=s[0].om?s[13]?s[0].om*1e3/Math.sqrt(3):s[0].om*1e3:0),a&256&&(r.l1=s[8]),a&512&&(r.l2=s[9]),a&1024&&(r.l3=s[10]),a&1&&(r.l1i=s[0].l1.p),a&1&&(r.l2i=s[0].l2.p),a&1&&(r.l3i=s[0].l3.p),a&1&&(r.l1e=s[0].l1.q),a&1&&(r.l2e=s[0].l2.q),a&1&&(r.l3e=s[0].l3.q),e.$set(r)},i(s){l||(J(e.$$.fragment,s),l=!0)},o(s){ie(e.$$.fragment,s),l=!1},d(s){Ie(e,s)}}}function Fo(t){let e,l,n=t[0].l1&&Bo(t);return{c(){e=p("div"),n&&n.c(),c(e,"class","cnt")},m(i,s){E(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&J(n,1)):(n=Bo(i),n.c(),J(n,1),n.m(e,null)):n&&(bt(),ie(n,1,1,()=>{n=null}),gt())},i(i){l||(J(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Bo(t){var n,i;let e,l;return e=new ss({props:{title:(i=(n=t[6].dashboard)==null?void 0:n.pf)!=null?i:"Pf",importColorFn:Xn,exportColorFn:Xn,maxImport:1,l1:t[8],l2:t[9],l3:t[10],l1i:t[0].l1.f,l2i:t[0].l2.f,l3i:t[0].l3.f}}),{c(){Oe(e.$$.fragment)},m(s,a){Le(e,s,a),l=!0},p(s,a){var f,u;const r={};a&64&&(r.title=(u=(f=s[6].dashboard)==null?void 0:f.pf)!=null?u:"Pf"),a&256&&(r.l1=s[8]),a&512&&(r.l2=s[9]),a&1024&&(r.l3=s[10]),a&1&&(r.l1i=s[0].l1.f),a&1&&(r.l2i=s[0].l2.f),a&1&&(r.l3i=s[0].l3.f),e.$set(r)},i(s){l||(J(e.$$.fragment,s),l=!0)},o(s){ie(e.$$.fragment,s),l=!1},d(s){Ie(e,s)}}}function Uo(t){let e,l,n;return l=new i0({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec,translations:t[6]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt")},m(i,s){E(i,e,s),Le(l,e,null),n=!0},p(i,s){const a={};s&1&&(a.importInstant=i[0].ri),s&1&&(a.exportInstant=i[0].re),s&1&&(a.importTotal=i[0].ric),s&1&&(a.exportTotal=i[0].rec),s&64&&(a.translations=i[6]),l.$set(a)},i(i){n||(J(l.$$.fragment,i),n=!0)},o(i){ie(l.$$.fragment,i),n=!1},d(i){i&&P(e),Ie(l)}}}function jo(t){let e,l,n;return l=new u0({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0,translations:t[6]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt")},m(i,s){E(i,e,s),Le(l,e,null),n=!0},p(i,s){const a={};s&2&&(a.sysinfo=i[1]),s&1&&(a.data=i[0].ea),s&1&&(a.currency=i[0].pc),s&1&&(a.hasExport=i[0].om>0||i[0].e>0),s&64&&(a.translations=i[6]),l.$set(a)},i(i){n||(J(l.$$.fragment,i),n=!0)},o(i){ie(l.$$.fragment,i),n=!1},d(i){i&&P(e),Ie(l)}}}function yo(t){var i,s;let e,l,n;return l=new N0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.tariffpeak)!=null?s:"Tariff peaks",tariffData:t[7],translations:t[6]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt h-64")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.tariffpeak)!=null?m:"Tariff peaks"),r&128&&(f.tariffData=a[7]),r&64&&(f.translations=a[6]),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function Ho(t){var i,s;let e,l,n;return l=new O0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.realtime)!=null?s:"Real time"}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt gwf")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.realtime)!=null?m:"Real time"),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function zo(t){var i,s;let e,l,n;return l=new m0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.price)!=null?s:"Price",json:t[2],sysinfo:t[1]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt gwf")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.price)!=null?m:"Price"),r&4&&(f.json=a[2]),r&2&&(f.sysinfo=a[1]),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function Wo(t){var i,s;let e,l,n;return l=new d0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.day)!=null?s:"24 hours",json:t[3],sysinfo:t[1]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt gwf")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.day)!=null?m:"24 hours"),r&8&&(f.json=a[3]),r&2&&(f.sysinfo=a[1]),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function Go(t){var i,s;let e,l,n;return l=new b0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.month)!=null?s:"{0} days",json:t[4],sysinfo:t[1]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt gwf")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.month)!=null?m:"{0} days"),r&16&&(f.json=a[4]),r&2&&(f.sysinfo=a[1]),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function Vo(t){var i,s;let e,l,n;return l=new w0({props:{title:(s=(i=t[6].dashboard)==null?void 0:i.temperature)!=null?s:"Temperature",json:t[5]}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","cnt gwf")},m(a,r){E(a,e,r),Le(l,e,null),n=!0},p(a,r){var u,m;const f={};r&64&&(f.title=(m=(u=a[6].dashboard)==null?void 0:u.temperature)!=null?m:"Temperature"),r&32&&(f.json=a[5]),l.$set(f)},i(a){n||(J(l.$$.fragment,a),n=!0)},o(a){ie(l.$$.fragment,a),n=!1},d(a){a&&P(e),Ie(l)}}}function B0(t){let e,l=Zt(t[1].ui.i,t[0].i),n,i=Zt(t[1].ui.e,t[0].om||t[0].e>0),s,a=Zt(t[1].ui.v,t[0].l1&&(t[0].l1.u>100||t[0].l2.u>100||t[0].l3.u>100)),r,f=Zt(t[1].ui.a,t[0].l1&&(t[0].l1.i>.01||t[0].l2.i>.01||t[0].l3.i>.01)),u,m=Zt(t[1].ui.h,t[0].l1&&(t[0].l1.p>.01||t[0].l2.p>.01||t[0].l3.p>.01||t[0].l1.q>.01||t[0].l2.q>.01||t[0].l3.q>.01)),_,d=Zt(t[1].ui.f,t[0].l1&&(t[0].l1.f>.01||t[0].l2.f>.01||t[0].l3.f>.01)),v,b=Zt(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),h,M=Zt(t[1].ui.c,t[0].ea),k,T=Zt(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("NO")||t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),I,O=Zt(t[1].ui.l,t[0].hm==1),C,B=Zt(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),L,z=Zt(t[1].ui.d,t[3]),y,V=Zt(t[1].ui.m,t[4]),R,F=Zt(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),Y,j=l&&Eo(t),W=i&&Do(t),K=a&&qo(t),U=f&&Lo(t),H=m&&Oo(t),Z=d&&Fo(t),ne=b&&Uo(t),X=M&&jo(t),$=T&&yo(t),ae=O&&Ho(t),le=B&&zo(t),se=z&&Wo(t),fe=V&&Go(t),re=F&&Vo(t);return{c(){e=p("div"),j&&j.c(),n=g(),W&&W.c(),s=g(),K&&K.c(),r=g(),U&&U.c(),u=g(),H&&H.c(),_=g(),Z&&Z.c(),v=g(),ne&&ne.c(),h=g(),X&&X.c(),k=g(),$&&$.c(),I=g(),ae&&ae.c(),C=g(),le&&le.c(),L=g(),se&&se.c(),y=g(),fe&&fe.c(),R=g(),re&&re.c(),c(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(Q,x){E(Q,e,x),j&&j.m(e,null),o(e,n),W&&W.m(e,null),o(e,s),K&&K.m(e,null),o(e,r),U&&U.m(e,null),o(e,u),H&&H.m(e,null),o(e,_),Z&&Z.m(e,null),o(e,v),ne&&ne.m(e,null),o(e,h),X&&X.m(e,null),o(e,k),$&&$.m(e,null),o(e,I),ae&&ae.m(e,null),o(e,C),le&&le.m(e,null),o(e,L),se&&se.m(e,null),o(e,y),fe&&fe.m(e,null),o(e,R),re&&re.m(e,null),Y=!0},p(Q,[x]){x&3&&(l=Zt(Q[1].ui.i,Q[0].i)),l?j?(j.p(Q,x),x&3&&J(j,1)):(j=Eo(Q),j.c(),J(j,1),j.m(e,n)):j&&(bt(),ie(j,1,1,()=>{j=null}),gt()),x&3&&(i=Zt(Q[1].ui.e,Q[0].om||Q[0].e>0)),i?W?(W.p(Q,x),x&3&&J(W,1)):(W=Do(Q),W.c(),J(W,1),W.m(e,s)):W&&(bt(),ie(W,1,1,()=>{W=null}),gt()),x&3&&(a=Zt(Q[1].ui.v,Q[0].l1&&(Q[0].l1.u>100||Q[0].l2.u>100||Q[0].l3.u>100))),a?K?(K.p(Q,x),x&3&&J(K,1)):(K=qo(Q),K.c(),J(K,1),K.m(e,r)):K&&(bt(),ie(K,1,1,()=>{K=null}),gt()),x&3&&(f=Zt(Q[1].ui.a,Q[0].l1&&(Q[0].l1.i>.01||Q[0].l2.i>.01||Q[0].l3.i>.01))),f?U?(U.p(Q,x),x&3&&J(U,1)):(U=Lo(Q),U.c(),J(U,1),U.m(e,u)):U&&(bt(),ie(U,1,1,()=>{U=null}),gt()),x&3&&(m=Zt(Q[1].ui.h,Q[0].l1&&(Q[0].l1.p>.01||Q[0].l2.p>.01||Q[0].l3.p>.01||Q[0].l1.q>.01||Q[0].l2.q>.01||Q[0].l3.q>.01))),m?H?(H.p(Q,x),x&3&&J(H,1)):(H=Oo(Q),H.c(),J(H,1),H.m(e,_)):H&&(bt(),ie(H,1,1,()=>{H=null}),gt()),x&3&&(d=Zt(Q[1].ui.f,Q[0].l1&&(Q[0].l1.f>.01||Q[0].l2.f>.01||Q[0].l3.f>.01))),d?Z?(Z.p(Q,x),x&3&&J(Z,1)):(Z=Fo(Q),Z.c(),J(Z,1),Z.m(e,v)):Z&&(bt(),ie(Z,1,1,()=>{Z=null}),gt()),x&3&&(b=Zt(Q[1].ui.r,Q[0].ri>0||Q[0].re>0||Q[0].ric>0||Q[0].rec>0)),b?ne?(ne.p(Q,x),x&3&&J(ne,1)):(ne=Uo(Q),ne.c(),J(ne,1),ne.m(e,h)):ne&&(bt(),ie(ne,1,1,()=>{ne=null}),gt()),x&3&&(M=Zt(Q[1].ui.c,Q[0].ea)),M?X?(X.p(Q,x),x&3&&J(X,1)):(X=jo(Q),X.c(),J(X,1),X.m(e,k)):X&&(bt(),ie(X,1,1,()=>{X=null}),gt()),x&3&&(T=Zt(Q[1].ui.t,Q[0].pr&&(Q[0].pr.startsWith("NO")||Q[0].pr.startsWith("10YNO")||Q[0].pr.startsWith("10Y1001A1001A4")))),T?$?($.p(Q,x),x&3&&J($,1)):($=yo(Q),$.c(),J($,1),$.m(e,I)):$&&(bt(),ie($,1,1,()=>{$=null}),gt()),x&3&&(O=Zt(Q[1].ui.l,Q[0].hm==1)),O?ae?(ae.p(Q,x),x&3&&J(ae,1)):(ae=Ho(Q),ae.c(),J(ae,1),ae.m(e,C)):ae&&(bt(),ie(ae,1,1,()=>{ae=null}),gt()),x&3&&(B=Zt(Q[1].ui.p,Q[0].pe&&!Number.isNaN(Q[0].p))),B?le?(le.p(Q,x),x&3&&J(le,1)):(le=zo(Q),le.c(),J(le,1),le.m(e,L)):le&&(bt(),ie(le,1,1,()=>{le=null}),gt()),x&10&&(z=Zt(Q[1].ui.d,Q[3])),z?se?(se.p(Q,x),x&10&&J(se,1)):(se=Wo(Q),se.c(),J(se,1),se.m(e,y)):se&&(bt(),ie(se,1,1,()=>{se=null}),gt()),x&18&&(V=Zt(Q[1].ui.m,Q[4])),V?fe?(fe.p(Q,x),x&18&&J(fe,1)):(fe=Go(Q),fe.c(),J(fe,1),fe.m(e,R)):fe&&(bt(),ie(fe,1,1,()=>{fe=null}),gt()),x&35&&(F=Zt(Q[1].ui.s,Q[0].t&&Q[0].t!=-127&&Q[5].c>1)),F?re?(re.p(Q,x),x&35&&J(re,1)):(re=Vo(Q),re.c(),J(re,1),re.m(e,null)):re&&(bt(),ie(re,1,1,()=>{re=null}),gt())},i(Q){Y||(J(j),J(W),J(K),J(U),J(H),J(Z),J(ne),J(X),J($),J(ae),J(le),J(se),J(fe),J(re),Y=!0)},o(Q){ie(j),ie(W),ie(K),ie(U),ie(H),ie(Z),ie(ne),ie(X),ie($),ie(ae),ie(le),ie(se),ie(fe),ie(re),Y=!1},d(Q){Q&&P(e),j&&j.d(),W&&W.d(),K&&K.d(),U&&U.d(),H&&H.d(),Z&&Z.d(),ne&&ne.d(),X&&X.d(),$&&$.d(),ae&&ae.d(),le&&le.d(),se&&se.d(),fe&&fe.d(),re&&re.d()}}}function U0(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,{prices:s={}}=e,{dayPlot:a={}}=e,{monthPlot:r={}}=e,{temperatures:f={}}=e,{translations:u={}}=e,{tariffData:m={}}=e,_,d,v,b,h,M;return t.$$set=k=>{"data"in k&&l(0,n=k.data),"sysinfo"in k&&l(1,i=k.sysinfo),"prices"in k&&l(2,s=k.prices),"dayPlot"in k&&l(3,a=k.dayPlot),"monthPlot"in k&&l(4,r=k.monthPlot),"temperatures"in k&&l(5,f=k.temperatures),"translations"in k&&l(6,u=k.translations),"tariffData"in k&&l(7,m=k.tariffData)},t.$$.update=()=>{var k,T,I,O,C,B,L,z,y,V,R,F,Y,j,W;t.$$.dirty&1793&&(l(11,_=gl((n==null?void 0:n.ic)*1e3,"Wh")),l(12,d=gl((n==null?void 0:n.ec)*1e3,"Wh")),((k=n==null?void 0:n.l1)==null?void 0:k.u)==0&&((T=n==null?void 0:n.l2)==null?void 0:T.u)==0&&((I=n==null?void 0:n.l3)==null?void 0:I.u)==0?l(8,b=l(9,h=l(10,M=l(13,v=!0)))):(l(8,b=((O=n==null?void 0:n.l1)==null?void 0:O.u)>0||((C=n==null?void 0:n.l1)==null?void 0:C.i)>0||((B=n==null?void 0:n.l1)==null?void 0:B.p)>0||((L=n==null?void 0:n.l1)==null?void 0:L.q)>0),l(9,h=((z=n==null?void 0:n.l2)==null?void 0:z.u)>0||((y=n==null?void 0:n.l2)==null?void 0:y.i)>0||((V=n==null?void 0:n.l2)==null?void 0:V.p)>0||((R=n==null?void 0:n.l2)==null?void 0:R.q)>0),l(10,M=((F=n==null?void 0:n.l3)==null?void 0:F.u)>0||((Y=n==null?void 0:n.l3)==null?void 0:Y.i)>0||((j=n==null?void 0:n.l3)==null?void 0:j.p)>0||((W=n==null?void 0:n.l3)==null?void 0:W.q)>0),l(13,v=b&&h&&M)))},[n,i,s,a,r,f,u,m,b,h,M,_,d,v]}class j0 extends It{constructor(e){super(),Lt(this,e,U0,B0,Dt,{data:0,sysinfo:1,prices:2,dayPlot:3,monthPlot:4,temperatures:5,translations:6,tariffData:7})}}let ji={};const Gn=nl(ji);async function y0(){ji=await(await fetch("configuration.json")).json(),Gn.set(ji)}let yi={};const Ru=nl(yi);async function H0(){yi=await(await fetch("priceconfig.json")).json(),Ru.set(yi)}function Ko(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Yo(t){let e,l,n;return{c(){e=p("option"),e.textContent="UART0",l=g(),n=p("option"),n.textContent="UART2",e.__value=3,e.value=e.__value,n.__value=113,n.value=n.__value},m(i,s){E(i,e,s),E(i,l,s),E(i,n,s)},d(i){i&&P(e),i&&P(l),i&&P(n)}}}function Qo(t){let e,l,n;return{c(){e=p("option"),l=S("GPIO"),n=S(t[4]),e.__value=t[4],e.value=e.__value},m(i,s){E(i,e,s),o(e,l),o(e,n)},d(i){i&&P(e)}}}function Xo(t){let e,l=t[4]>1&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Qo(t);return{c(){l&&l.c(),e=$t()},m(n,i){l&&l.m(n,i),E(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Qo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&P(e)}}}function z0(t){let e,l,n,i,s=t[0]=="esp8266"&&Yo(),a={length:t[1]+1},r=[];for(let f=0;f{"chip"in s&&l(0,n=s.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=19);break}},[n,i]}class Hi extends It{constructor(e){super(),Lt(this,e,W0,z0,Dt,{chip:0})}}function Zo(t){let e,l,n=t[1]&&Jo(t);return{c(){e=p("div"),l=p("div"),n&&n.c(),c(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-80 flex items-center justify-center"),c(e,"class","z-50"),c(e,"aria-modal","true")},m(i,s){E(i,e,s),o(e,l),n&&n.m(l,null)},p(i,s){i[1]?n?n.p(i,s):(n=Jo(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&P(e),n&&n.d()}}}function Jo(t){let e,l;return{c(){e=p("div"),l=S(t[1]),c(e,"class","bg-white dark:bg-gray-600 m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 dark:text-white w-96")},m(n,i){E(n,e,i),o(e,l)},p(n,i){i&2&&q(l,n[1])},d(n){n&&P(e)}}}function G0(t){let e,l=t[0]&&Zo(t);return{c(){l&&l.c(),e=$t()},m(n,i){l&&l.m(n,i),E(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Zo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Ze,o:Ze,d(n){l&&l.d(n),n&&P(e)}}}function V0(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=s=>{"active"in s&&l(0,n=s.active),"message"in s&&l(1,i=s.message)},[n,i]}class hl extends It{constructor(e){super(),Lt(this,e,V0,G0,Dt,{active:0,message:1})}}function $o(t,e,l){const n=t.slice();return n[1]=e[l],n}function xo(t){let e,l,n=t[1]+"",i;return{c(){e=p("option"),l=S("Europe/"),i=S(n),e.__value="Europe/"+t[1],e.value=e.__value},m(s,a){E(s,e,a),o(e,l),o(e,i)},p:Ze,d(s){s&&P(e)}}}function K0(t){let e,l,n,i=t[0],s=[];for(let a=0;a>1&1,A=0;A0;w--)A[w]=A[w]?A[w-1]^C.EXPONENT[z._modN(C.LOG[A[w]]+N)]:A[w-1];A[0]=C.EXPONENT[z._modN(C.LOG[A[0]]+N)]}for(N=0;N<=D;N++)A[N]=C.LOG[A[N]]},_checkBadness:function(){var N,w,D,A,G,te=0,ee=this._badness,oe=this.buffer,ce=this.width;for(G=0;Gce*ce;)de-=ce*ce,Ce++;for(te+=Ce*z.N4,A=0;A=ee-2&&(N=ee-2,G>9&&N--);var oe=N;if(G>9){for(te[oe+2]=0,te[oe+3]=0;oe--;)w=te[oe],te[oe+3]|=255&w<<4,te[oe+2]=w>>4;te[2]|=255&N<<4,te[1]=N>>4,te[0]=64|N>>12}else{for(te[oe+1]=0,te[oe+2]=0;oe--;)w=te[oe],te[oe+2]|=255&w<<4,te[oe+1]=w>>4;te[1]|=255&N<<4,te[0]=64|N>>4}for(oe=N+3-(G<10);oe=5&&(D+=z.N1+A[w]-5);for(w=3;wN||A[w-3]*3>=A[w]*4||A[w+3]*3>=A[w]*4)&&(D+=z.N3);return D},_finish:function(){this._stringBuffer=this.buffer.slice();var N,w,D=0,A=3e4;for(w=0;w<8&&(this._applyMask(w),N=this._checkBadness(),N>=1)A&1&&(G[te-1-w+te*8]=1,w<6?G[8+te*w]=1:G[8+te*(w+1)]=1);for(w=0;w<7;w++,A>>=1)A&1&&(G[8+te*(te-7+w)]=1,w?G[6-w+te*8]=1:G[7+te*8]=1)},_interleaveBlocks:function(){var N,w,D=this._dataBlock,A=this._ecc,G=this._eccBlock,te=0,ee=this._calculateMaxLength(),oe=this._neccBlock1,ce=this._neccBlock2,Pe=this._stringBuffer;for(N=0;N1)for(N=k.BLOCK[A],D=G-7;;){for(w=G-7;w>N-3&&(this._addAlignment(w,D),!(w6)for(N=L.BLOCK[te-7],w=17,D=0;D<6;D++)for(A=0;A<3;A++,w--)1&(w>11?te>>w-12:N>>w)?(G[5-D+ee*(2-A+ee-11)]=1,G[2-A+ee-11+ee*(5-D)]=1):(this._setMask(5-D,2-A+ee-11),this._setMask(2-A+ee-11,5-D))},_isMasked:function(N,w){var D=z._getMaskBit(N,w);return this._mask[D]===1},_pack:function(){var N,w,D,A=1,G=1,te=this.width,ee=te-1,oe=te-1,ce=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(w=0;ww&&(D=N,N=w,w=D),D=w,D+=w*w,D>>=1,D+=N,D},_modN:function(N){for(;N>=255;)N-=255,N=(N>>8)+(N&255);return N},N1:3,N2:3,N3:40,N4:10}),y=z,V=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var N=this.element;N.width=N.height=this.qrious.size}}),R=V,F=_.extend(function(N,w,D,A){this.name=N,this.modifiable=Boolean(w),this.defaultValue=D,this._valueTransformer=A},{transform:function(N){var w=this._valueTransformer;return typeof w=="function"?w(N,this):N}}),Y=F,j=_.extend(null,{abs:function(N){return N!=null?Math.abs(N):null},hasOwn:function(N,w){return Object.prototype.hasOwnProperty.call(N,w)},noop:function(){},toUpperCase:function(N){return N!=null?N.toUpperCase():null}}),W=j,K=_.extend(function(N){this.options={},N.forEach(function(w){this.options[w.name]=w},this)},{exists:function(N){return this.options[N]!=null},get:function(N,w){return K._get(this.options[N],w)},getAll:function(N){var w,D=this.options,A={};for(w in D)W.hasOwn(D,w)&&(A[w]=K._get(D[w],N));return A},init:function(N,w,D){typeof D!="function"&&(D=W.noop);var A,G;for(A in this.options)W.hasOwn(this.options,A)&&(G=this.options[A],K._set(G,G.defaultValue,w),K._createAccessor(G,w,D));this._setAll(N,w,!0)},set:function(N,w,D){return this._set(N,w,D)},setAll:function(N,w){return this._setAll(N,w)},_set:function(N,w,D,A){var G=this.options[N];if(!G)throw new Error("Invalid option: "+N);if(!G.modifiable&&!A)throw new Error("Option cannot be modified: "+N);return K._set(G,w,D)},_setAll:function(N,w,D){if(!N)return!1;var A,G=!1;for(A in N)W.hasOwn(N,A)&&this._set(A,N[A],w,D)&&(G=!0);return G}},{_createAccessor:function(N,w,D){var A={get:function(){return K._get(N,w)}};N.modifiable&&(A.set=function(G){K._set(N,G,w)&&D(G,N)}),Object.defineProperty(w,N.name,A)},_get:function(N,w){return w["_"+N.name]},_set:function(N,w,D){var A="_"+N.name,G=D[A],te=N.transform(w!=null?w:N.defaultValue);return D[A]=te,te!==G}}),U=K,H=_.extend(function(){this._services={}},{getService:function(N){var w=this._services[N];if(!w)throw new Error("Service is not being managed with name: "+N);return w},setService:function(N,w){if(this._services[N])throw new Error("Service is already managed with name: "+N);w&&(this._services[N]=w)}}),Z=H,ne=new U([new Y("background",!0,"white"),new Y("backgroundAlpha",!0,1,W.abs),new Y("element"),new Y("foreground",!0,"black"),new Y("foregroundAlpha",!0,1,W.abs),new Y("level",!0,"L",W.toUpperCase),new Y("mime",!0,"image/png"),new Y("padding",!0,null,W.abs),new Y("size",!0,100,W.abs),new Y("value",!0,"")]),X=new Z,$=_.extend(function(N){ne.init(N,this,this.update.bind(this));var w=ne.get("element",this),D=X.getService("element"),A=w&&D.isCanvas(w)?w:D.createCanvas(),G=w&&D.isImage(w)?w:D.createImage();this._canvasRenderer=new h(this,A,!0),this._imageRenderer=new R(this,G,G===w),this.update()},{get:function(){return ne.getAll(this)},set:function(N){ne.setAll(N,this)&&this.update()},toDataURL:function(N){return this.canvas.toDataURL(N||this.mime)},update:function(){var N=new y({level:this.level,value:this.value});this._canvasRenderer.render(N),this._imageRenderer.render(N)}},{use:function(N){X.setService(N.getName(),N)}});Object.defineProperties($.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var ae=$,le=ae,se=_.extend({getName:function(){}}),fe=se,re=fe.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(N){},isImage:function(N){}}),Q=re,x=Q.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(N){return N instanceof HTMLCanvasElement},isImage:function(N){return N instanceof HTMLImageElement}}),ge=x;le.use(new ge);var pe=le;return pe})})(Bu);const J0=Bu.exports;function $0(t){let e,l;return{c(){e=p("img"),fi(e.src,l=t[2])||c(e,"src",l),c(e,"alt",t[0]),c(e,"class",t[1])},m(n,i){E(n,e,i)},p(n,[i]){i&4&&!fi(e.src,l=n[2])&&c(e,"src",l),i&1&&c(e,"alt",n[0]),i&2&&c(e,"class",n[1])},i:Ze,o:Ze,d(n){n&&P(e)}}}function x0(t,e,l){const n=new J0;let{errorCorrection:i="L"}=e,{background:s="#fff"}=e,{color:a="#000"}=e,{size:r="200"}=e,{value:f=""}=e,{padding:u=0}=e,{className:m="qrcode"}=e,_="";function d(){n.set({background:s,foreground:a,level:i,padding:u,size:r,value:f}),l(2,_=n.toDataURL("image/jpeg"))}return Vf(()=>{d()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,s=v.background),"color"in v&&l(5,a=v.color),"size"in v&&l(6,r=v.size),"value"in v&&l(0,f=v.value),"padding"in v&&l(7,u=v.padding),"className"in v&&l(1,m=v.className)},t.$$.update=()=>{t.$$.dirty&1&&f&&d()},[f,m,_,i,s,a,r,u]}class ec extends It{constructor(e){super(),Lt(this,e,x0,$0,Dt,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function ea(t,e,l){const n=t.slice();return n[113]=e[l],n}function ta(t,e,l){const n=t.slice();return n[116]=e[l],n[117]=e,n[118]=l,n}function la(t,e,l){const n=t.slice();return n[119]=e[l],n[120]=e,n[121]=l,n}function tc(t,e,l){const n=t.slice();return n[122]=e[l],n}function lc(t,e,l){const n=t.slice();return n[125]=e[l],n}function na(t){var Ge,Qt,el,xt,Se,Re,Fe,il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl,Be,et,je,he,Kt,wl,Cl,Sl,Ml,Nl,Tl,Pl,El,Dl,Rl,Fl,Bl,Ul;let e,l,n=((el=(Qt=(Ge=t[2].conf)==null?void 0:Ge.general)==null?void 0:Qt.title)!=null?el:"General")+"",i,s,a,r,f,u,m,_,d,v,b=((Re=(Se=(xt=t[2].conf)==null?void 0:xt.general)==null?void 0:Se.hostname)!=null?Re:"Hostname")+"",h,M,k,T,I,O,C=((sl=(il=(Fe=t[2].conf)==null?void 0:Fe.general)==null?void 0:il.timezone)!=null?sl:"Time zone")+"",B,L,z,y,V,R,F,Y,j,W,K,U=((fl=(al=(ol=t[2].conf)==null?void 0:ol.price)==null?void 0:al.region)!=null?fl:"Price region")+"",H,Z,ne,X,$,ae,le,se,fe,re,Q,x,ge,pe,N,w,D,A,G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je=((cl=(rl=(ul=t[2].conf)==null?void 0:ul.price)==null?void 0:rl.currency)!=null?cl:"Currency")+"",it,We,_t,Ee,_e,Ue,kt,wt,nt,vt,ze,Ke,Ye=((pl=(_l=(ml=t[2].conf)==null?void 0:ml.price)==null?void 0:_l.enabled)!=null?pl:"Enabled")+"",Xe,Qe,ut,we,Ae=((je=(et=(Be=(dl=t[2].conf)==null?void 0:dl.general)==null?void 0:Be.security)==null?void 0:et.title)!=null?je:"Security")+"",ke,ue,De,rt,st,at=((Cl=(wl=(Kt=(he=t[2].conf)==null?void 0:he.general)==null?void 0:Kt.security)==null?void 0:wl.none)!=null?Cl:"None")+"",pt,ht,Rt=((Tl=(Nl=(Ml=(Sl=t[2].conf)==null?void 0:Sl.general)==null?void 0:Ml.security)==null?void 0:Nl.conf)!=null?Tl:"Conf")+"",Pt,ct,Ft=((Rl=(Dl=(El=(Pl=t[2].conf)==null?void 0:Pl.general)==null?void 0:El.security)==null?void 0:Dl.all)!=null?Rl:"All")+"",zt,Bt,Ut,qt,yt=((Ul=(Bl=(Fl=t[2].conf)==null?void 0:Fl.general)==null?void 0:Bl.context)!=null?Ul:"Context")+"",Gt,Vt,Yt,Ct,Mt,ft,Nt,Et;V=new Q0({});let dt=!t[6].p.t&&ia(),At=["NOK","SEK","DKK","EUR","CHF"],St=[];for(let tt=0;tt<5;tt+=1)St[tt]=nc(lc(t,At,tt));kt=new Al({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[ic]},$$scope:{ctx:t}}});let mt=t[6].p.e&&t[0].chip!="esp8266"&&sa(t),qe=t[6].g.s>0&&oa(t);return{c(){var tt,Ot,vl;e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),d=p("div"),v=p("div"),h=S(b),M=p("br"),k=g(),T=p("input"),I=g(),O=p("div"),B=S(C),L=p("br"),z=g(),y=p("select"),Oe(V.$$.fragment),R=g(),F=p("input"),Y=g(),j=p("div"),W=p("div"),K=p("div"),H=S(U),Z=p("br"),ne=g(),X=p("select"),$=p("optgroup"),dt&&dt.c(),ae=p("option"),ae.textContent="NO1",le=p("option"),le.textContent="NO2",se=p("option"),se.textContent="NO3",fe=p("option"),fe.textContent="NO4",re=p("option"),re.textContent="NO5",Q=p("optgroup"),x=p("option"),x.textContent="SE1",ge=p("option"),ge.textContent="SE2",pe=p("option"),pe.textContent="SE3",N=p("option"),N.textContent="SE4",w=p("optgroup"),D=p("option"),D.textContent="DK1",A=p("option"),A.textContent="DK2",G=p("option"),G.textContent="Austria",te=p("option"),te.textContent="Belgium",ee=p("option"),ee.textContent="Czech Republic",oe=p("option"),oe.textContent="Estonia",ce=p("option"),ce.textContent="Finland",Pe=p("option"),Pe.textContent="France",Ce=p("option"),Ce.textContent="Germany",de=p("option"),de.textContent="Great Britain",Ne=p("option"),Ne.textContent="Latvia",Te=p("option"),Te.textContent="Lithuania",ve=p("option"),ve.textContent="Netherland",be=p("option"),be.textContent="Poland",He=p("option"),He.textContent="Slovenia",ye=p("option"),ye.textContent="Switzerland",Ve=g(),xe=p("div"),it=S(Je),We=p("br"),_t=g(),Ee=p("select");for(let bl=0;bl<5;bl+=1)St[bl].c();_e=g(),Ue=p("div"),Oe(kt.$$.fragment),wt=g(),nt=p("div"),vt=p("label"),ze=p("input"),Ke=g(),Xe=S(Ye),Qe=g(),mt&&mt.c(),ut=g(),we=p("div"),ke=S(Ae),ue=p("br"),De=g(),rt=p("select"),st=p("option"),pt=S(at),ht=p("option"),Pt=S(Rt),ct=p("option"),zt=S(Ft),Bt=g(),qe&&qe.c(),Ut=g(),qt=p("div"),Gt=S(yt),Vt=p("br"),Yt=g(),Ct=p("input"),c(l,"class","text-sm"),c(a,"href",ql("General-configuration")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","g"),u.value="true",c(T,"name","gh"),c(T,"type","text"),c(T,"class","in-f w-full"),c(T,"pattern","[A-Za-z0-9-]+"),c(y,"name","gt"),c(y,"class","in-l w-full"),t[6].g.t===void 0&&Wt(()=>t[23].call(y)),c(d,"class","flex"),c(_,"class","my-1"),c(F,"type","hidden"),c(F,"name","p"),F.value="true",ae.__value="10YNO-1--------2",ae.value=ae.__value,le.__value="10YNO-2--------T",le.value=le.__value,se.__value="10YNO-3--------J",se.value=se.__value,fe.__value="10YNO-4--------9",fe.value=fe.__value,re.__value="10Y1001A1001A48H",re.value=re.__value,c($,"label","Norway"),x.__value="10Y1001A1001A44P",x.value=x.__value,ge.__value="10Y1001A1001A45N",ge.value=ge.__value,pe.__value="10Y1001A1001A46L",pe.value=pe.__value,N.__value="10Y1001A1001A47J",N.value=N.__value,c(Q,"label","Sweden"),D.__value="10YDK-1--------W",D.value=D.__value,A.__value="10YDK-2--------M",A.value=A.__value,c(w,"label","Denmark"),G.__value="10YAT-APG------L",G.value=G.__value,te.__value="10YBE----------2",te.value=te.__value,ee.__value="10YCZ-CEPS-----N",ee.value=ee.__value,oe.__value="10Y1001A1001A39I",oe.value=oe.__value,ce.__value="10YFI-1--------U",ce.value=ce.__value,Pe.__value="10YFR-RTE------C",Pe.value=Pe.__value,Ce.__value="10Y1001A1001A83F",Ce.value=Ce.__value,de.__value="10YGB----------A",de.value=de.__value,Ne.__value="10YLV-1001A00074",Ne.value=Ne.__value,Te.__value="10YLT-1001A0008Q",Te.value=Te.__value,ve.__value="10YNL----------L",ve.value=ve.__value,be.__value="10YPL-AREA-----S",be.value=be.__value,He.__value="10YSI-ELES-----O",He.value=He.__value,ye.__value="10YCH-SWISSGRIDZ",ye.value=ye.__value,c(X,"name","pr"),c(X,"class","in-f w-full"),t[6].p.r===void 0&&Wt(()=>t[24].call(X)),c(K,"class","w-full"),c(Ee,"name","pc"),c(Ee,"class","in-l"),t[6].p.c===void 0&&Wt(()=>t[25].call(Ee)),c(W,"class","flex"),c(j,"class","my-1"),c(Ue,"class","my-1"),c(ze,"type","checkbox"),c(ze,"name","pe"),ze.__value="true",ze.value=ze.__value,c(ze,"class","rounded mb-1"),c(nt,"class","my-1"),st.__value=0,st.value=st.__value,ht.__value=1,ht.value=ht.__value,ct.__value=2,ct.value=ct.__value,c(rt,"name","gs"),c(rt,"class","in-s"),t[6].g.s===void 0&&Wt(()=>t[28].call(rt)),c(we,"class","my-1"),c(Ct,"name","gc"),c(Ct,"type","text"),c(Ct,"pattern","[A-Za-z0-9]+"),c(Ct,"placeholder",Mt=(vl=(Ot=(tt=t[2].conf)==null?void 0:tt.general)==null?void 0:Ot.context_placeholder)!=null?vl:"/"),c(Ct,"class","in-s"),c(Ct,"maxlength","36"),c(qt,"class","my-1"),c(e,"class","cnt")},m(tt,Ot){E(tt,e,Ot),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,d),o(d,v),o(v,h),o(v,M),o(v,k),o(v,T),Me(T,t[6].g.h),o(d,I),o(d,O),o(O,B),o(O,L),o(O,z),o(O,y),Le(V,y,null),ot(y,t[6].g.t,!0),o(e,R),o(e,F),o(e,Y),o(e,j),o(j,W),o(W,K),o(K,H),o(K,Z),o(K,ne),o(K,X),o(X,$),dt&&dt.m($,null),o($,ae),o($,le),o($,se),o($,fe),o($,re),o(X,Q),o(Q,x),o(Q,ge),o(Q,pe),o(Q,N),o(X,w),o(w,D),o(w,A),o(X,G),o(X,te),o(X,ee),o(X,oe),o(X,ce),o(X,Pe),o(X,Ce),o(X,de),o(X,Ne),o(X,Te),o(X,ve),o(X,be),o(X,He),o(X,ye),ot(X,t[6].p.r,!0),o(W,Ve),o(W,xe),o(xe,it),o(xe,We),o(xe,_t),o(xe,Ee);for(let vl=0;vl<5;vl+=1)St[vl]&&St[vl].m(Ee,null);ot(Ee,t[6].p.c,!0),o(e,_e),o(e,Ue),Le(kt,Ue,null),o(e,wt),o(e,nt),o(nt,vt),o(vt,ze),ze.checked=t[6].p.e,o(vt,Ke),o(vt,Xe),o(nt,Qe),mt&&mt.m(nt,null),o(e,ut),o(e,we),o(we,ke),o(we,ue),o(we,De),o(we,rt),o(rt,st),o(st,pt),o(rt,ht),o(ht,Pt),o(rt,ct),o(ct,zt),ot(rt,t[6].g.s,!0),o(e,Bt),qe&&qe.m(e,null),o(e,Ut),o(e,qt),o(qt,Gt),o(qt,Vt),o(qt,Yt),o(qt,Ct),Me(Ct,t[6].g.c),ft=!0,Nt||(Et=[me(T,"input",t[22]),me(y,"change",t[23]),me(X,"change",t[24]),me(Ee,"change",t[25]),me(ze,"change",t[26]),me(rt,"change",t[28]),me(Ct,"input",t[31])],Nt=!0)},p(tt,Ot){var bl,pn,dn,vn,hn,bn,gn,kn,wn,Cn,Sn,Mn,Nn,Tn,Pn,En,Dn,qn,An,Ln,In,On,Rn,Fn,Bn,Un,jn,yn,Hn,as,fs,us,rs,cs,ms,_s,ps,ds,vs,hs;(!ft||Ot[0]&4)&&n!==(n=((dn=(pn=(bl=tt[2].conf)==null?void 0:bl.general)==null?void 0:pn.title)!=null?dn:"General")+"")&&q(i,n),(!ft||Ot[0]&4)&&b!==(b=((bn=(hn=(vn=tt[2].conf)==null?void 0:vn.general)==null?void 0:hn.hostname)!=null?bn:"Hostname")+"")&&q(h,b),Ot[0]&64&&T.value!==tt[6].g.h&&Me(T,tt[6].g.h),(!ft||Ot[0]&4)&&C!==(C=((wn=(kn=(gn=tt[2].conf)==null?void 0:gn.general)==null?void 0:kn.timezone)!=null?wn:"Time zone")+"")&&q(B,C),Ot[0]&64&&ot(y,tt[6].g.t),(!ft||Ot[0]&4)&&U!==(U=((Mn=(Sn=(Cn=tt[2].conf)==null?void 0:Cn.price)==null?void 0:Sn.region)!=null?Mn:"Price region")+"")&&q(H,U),tt[6].p.t?dt&&(dt.d(1),dt=null):dt||(dt=ia(),dt.c(),dt.m($,ae)),Ot[0]&64&&ot(X,tt[6].p.r),(!ft||Ot[0]&4)&&Je!==(Je=((Pn=(Tn=(Nn=tt[2].conf)==null?void 0:Nn.price)==null?void 0:Tn.currency)!=null?Pn:"Currency")+"")&&q(it,Je),Ot[0]&64&&ot(Ee,tt[6].p.c);const vl={};Ot[0]&4|Ot[4]&16&&(vl.$$scope={dirty:Ot,ctx:tt}),kt.$set(vl),Ot[0]&64&&(ze.checked=tt[6].p.e),(!ft||Ot[0]&4)&&Ye!==(Ye=((qn=(Dn=(En=tt[2].conf)==null?void 0:En.price)==null?void 0:Dn.enabled)!=null?qn:"Enabled")+"")&&q(Xe,Ye),tt[6].p.e&&tt[0].chip!="esp8266"?mt?mt.p(tt,Ot):(mt=sa(tt),mt.c(),mt.m(nt,null)):mt&&(mt.d(1),mt=null),(!ft||Ot[0]&4)&&Ae!==(Ae=((On=(In=(Ln=(An=tt[2].conf)==null?void 0:An.general)==null?void 0:Ln.security)==null?void 0:In.title)!=null?On:"Security")+"")&&q(ke,Ae),(!ft||Ot[0]&4)&&at!==(at=((Un=(Bn=(Fn=(Rn=tt[2].conf)==null?void 0:Rn.general)==null?void 0:Fn.security)==null?void 0:Bn.none)!=null?Un:"None")+"")&&q(pt,at),(!ft||Ot[0]&4)&&Rt!==(Rt=((as=(Hn=(yn=(jn=tt[2].conf)==null?void 0:jn.general)==null?void 0:yn.security)==null?void 0:Hn.conf)!=null?as:"Conf")+"")&&q(Pt,Rt),(!ft||Ot[0]&4)&&Ft!==(Ft=((cs=(rs=(us=(fs=tt[2].conf)==null?void 0:fs.general)==null?void 0:us.security)==null?void 0:rs.all)!=null?cs:"All")+"")&&q(zt,Ft),Ot[0]&64&&ot(rt,tt[6].g.s),tt[6].g.s>0?qe?qe.p(tt,Ot):(qe=oa(tt),qe.c(),qe.m(e,Ut)):qe&&(qe.d(1),qe=null),(!ft||Ot[0]&4)&&yt!==(yt=((ps=(_s=(ms=tt[2].conf)==null?void 0:ms.general)==null?void 0:_s.context)!=null?ps:"Context")+"")&&q(Gt,yt),(!ft||Ot[0]&4&&Mt!==(Mt=(hs=(vs=(ds=tt[2].conf)==null?void 0:ds.general)==null?void 0:vs.context_placeholder)!=null?hs:"/"))&&c(Ct,"placeholder",Mt),Ot[0]&64&&Ct.value!==tt[6].g.c&&Me(Ct,tt[6].g.c)},i(tt){ft||(J(V.$$.fragment,tt),J(kt.$$.fragment,tt),ft=!0)},o(tt){ie(V.$$.fragment,tt),ie(kt.$$.fragment,tt),ft=!1},d(tt){tt&&P(e),Ie(V),dt&&dt.d(),ll(St,tt),Ie(kt),mt&&mt.d(),qe&&qe.d(),Nt=!1,Ht(Et)}}}function ia(t){let e,l,n,i,s;return{c(){e=p("option"),e.textContent="NO1 with support",l=p("option"),l.textContent="NO2 with support",n=p("option"),n.textContent="NO3 with support",i=p("option"),i.textContent="NO4 with support",s=p("option"),s.textContent="NO5 with support",e.__value="NO1S",e.value=e.__value,l.__value="NO2S",l.value=l.__value,n.__value="NO3S",n.value=n.__value,i.__value="NO4S",i.value=i.__value,s.__value="NO5S",s.value=s.__value},m(a,r){E(a,e,r),E(a,l,r),E(a,n,r),E(a,i,r),E(a,s,r)},d(a){a&&P(e),a&&P(l),a&&P(n),a&&P(i),a&&P(s)}}}function nc(t){let e,l;return{c(){e=p("option"),l=S(t[125]),e.__value=t[125],e.value=e.__value},m(n,i){E(n,e,i),o(e,l)},p:Ze,d(n){n&&P(e)}}}function ic(t){var n,i,s;let e=((s=(i=(n=t[2].conf)==null?void 0:n.price)==null?void 0:i.conf)!=null?s:"Configure")+"",l;return{c(){l=S(e)},m(a,r){E(a,l,r)},p(a,r){var f,u,m;r[0]&4&&e!==(e=((m=(u=(f=a[2].conf)==null?void 0:f.price)==null?void 0:u.conf)!=null?m:"Configure")+"")&&q(l,e)},d(a){a&&P(l)}}}function sa(t){let e,l,n,i,s;return{c(){var a,r,f;e=p("br"),l=p("input"),c(l,"name","pt"),c(l,"type","text"),c(l,"class","in-s"),c(l,"placeholder",n=(f=(r=(a=t[2].conf)==null?void 0:a.price)==null?void 0:r.api_key_placeholder)!=null?f:"")},m(a,r){E(a,e,r),E(a,l,r),Me(l,t[6].p.t),i||(s=me(l,"input",t[27]),i=!0)},p(a,r){var f,u,m;r[0]&4&&n!==(n=(m=(u=(f=a[2].conf)==null?void 0:f.price)==null?void 0:u.api_key_placeholder)!=null?m:"")&&c(l,"placeholder",n),r[0]&64&&l.value!==a[6].p.t&&Me(l,a[6].p.t)},d(a){a&&P(e),a&&P(l),i=!1,s()}}}function oa(t){var M,k,T,I,O,C,B,L;let e,l=((I=(T=(k=(M=t[2].conf)==null?void 0:M.general)==null?void 0:k.security)==null?void 0:T.username)!=null?I:"Username")+"",n,i,s,a,r,f,u=((L=(B=(C=(O=t[2].conf)==null?void 0:O.general)==null?void 0:C.security)==null?void 0:B.password)!=null?L:"Password")+"",m,_,d,v,b,h;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),r=g(),f=p("div"),m=S(u),_=p("br"),d=g(),v=p("input"),c(a,"name","gu"),c(a,"type","text"),c(a,"class","in-s"),c(a,"maxlength","36"),c(e,"class","my-1"),c(v,"name","gp"),c(v,"type","password"),c(v,"class","in-s"),c(v,"maxlength","36"),c(f,"class","my-1")},m(z,y){E(z,e,y),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].g.u),E(z,r,y),E(z,f,y),o(f,m),o(f,_),o(f,d),o(f,v),Me(v,t[6].g.p),b||(h=[me(a,"input",t[29]),me(v,"input",t[30])],b=!0)},p(z,y){var V,R,F,Y,j,W,K,U;y[0]&4&&l!==(l=((Y=(F=(R=(V=z[2].conf)==null?void 0:V.general)==null?void 0:R.security)==null?void 0:F.username)!=null?Y:"Username")+"")&&q(n,l),y[0]&64&&a.value!==z[6].g.u&&Me(a,z[6].g.u),y[0]&4&&u!==(u=((U=(K=(W=(j=z[2].conf)==null?void 0:j.general)==null?void 0:W.security)==null?void 0:K.password)!=null?U:"Password")+"")&&q(m,u),y[0]&64&&v.value!==z[6].g.p&&Me(v,z[6].g.p)},d(z){z&&P(e),z&&P(r),z&&P(f),b=!1,Ht(h)}}}function aa(t){var ut,we,Ae,ke,ue,De,rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt;let e,l,n=((Ae=(we=(ut=t[2].conf)==null?void 0:ut.meter)==null?void 0:we.title)!=null?Ae:"Meter")+"",i,s,a,r,f,u,m,_,d,v,b=((rt=(De=(ue=(ke=t[2].conf)==null?void 0:ke.meter)==null?void 0:ue.comm)==null?void 0:De.title)!=null?rt:"Communication")+"",h,M,k,T,I,O=((ht=(pt=(at=(st=t[2].conf)==null?void 0:st.meter)==null?void 0:at.comm)==null?void 0:pt.passive)!=null?ht:"Passive")+"",C,B,L=((Ft=(ct=(Pt=(Rt=t[2].conf)==null?void 0:Rt.meter)==null?void 0:Pt.comm)==null?void 0:ct.pulse)!=null?Ft:"Pulse")+"",z,y=(Bt=(zt=t[0])==null?void 0:zt.features)==null?void 0:Bt.includes("kmp"),V,R,F,Y=((qt=(Ut=t[2].common)==null?void 0:Ut.voltage)!=null?qt:"Voltage")+"",j,W,K,U,H,Z,ne,X,$,ae=((Vt=(Gt=(yt=t[2].conf)==null?void 0:yt.meter)==null?void 0:Gt.fuse)!=null?Vt:"Main fuse")+"",le,se,fe,re,Q,x,ge,pe,N,w=((Mt=(Ct=(Yt=t[2].conf)==null?void 0:Yt.meter)==null?void 0:Ct.prod)!=null?Mt:"Production")+"",D,A,G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He=((Et=(Nt=(ft=t[2].conf)==null?void 0:ft.meter)==null?void 0:Nt.encrypted)!=null?Et:"Encrypted")+"",ye,Ve,xe,Je,it,We,_t,Ee=((mt=(St=(At=(dt=t[2].conf)==null?void 0:dt.meter)==null?void 0:At.multipliers)==null?void 0:St.title)!=null?mt:"Multipliers")+"",_e,Ue,kt,wt,nt=y&&fa();function vt(qe,Ge){return qe[6].m.a===2?oc:sc}let ze=vt(t),Ke=ze(t),Ye=t[6].m.e.e&&ua(t),Xe=t[6].m.e.e&&ra(t),Qe=t[6].m.m.e&&ca(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("input"),d=g(),v=p("div"),h=S(b),M=p("br"),k=g(),T=p("select"),I=p("option"),C=S(O),B=p("option"),z=S(L),nt&&nt.c(),V=g(),Ke.c(),R=g(),F=p("div"),j=S(Y),W=p("br"),K=g(),U=p("select"),H=p("option"),H.textContent="400V (TN)",Z=p("option"),Z.textContent="230V (IT/TT)",ne=g(),X=p("div"),$=p("div"),le=S(ae),se=p("br"),fe=g(),re=p("label"),Q=p("input"),x=g(),ge=p("span"),ge.textContent="A",pe=g(),N=p("div"),D=S(w),A=p("br"),G=g(),te=p("label"),ee=p("input"),oe=g(),ce=p("span"),ce.textContent="kWp",Pe=g(),Ce=p("div"),de=g(),Ne=p("div"),Te=p("label"),ve=p("input"),be=g(),ye=S(He),Ve=g(),Ye&&Ye.c(),xe=g(),Xe&&Xe.c(),Je=g(),it=p("label"),We=p("input"),_t=g(),_e=S(Ee),Ue=g(),Qe&&Qe.c(),c(l,"class","text-sm"),c(a,"href",ql("Meter-configuration")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","m"),u.value="true",c(_,"type","hidden"),c(_,"name","mo"),_.value="1",I.__value=0,I.value=I.__value,B.__value=2,B.value=B.__value,c(T,"name","ma"),c(T,"class","in-s"),t[6].m.a===void 0&&Wt(()=>t[32].call(T)),c(v,"class","my-1"),H.__value=2,H.value=H.__value,Z.__value=1,Z.value=Z.__value,c(U,"name","md"),c(U,"class","in-s"),t[6].m.d===void 0&&Wt(()=>t[38].call(U)),c(F,"class","my-1"),c(Q,"name","mf"),c(Q,"type","number"),c(Q,"min","5"),c(Q,"max","65535"),c(Q,"class","in-f tr w-full"),c(ge,"class","in-post"),c(re,"class","flex"),c($,"class","mx-1"),c(ee,"name","mr"),c(ee,"type","number"),c(ee,"min","0"),c(ee,"max","65535"),c(ee,"class","in-f tr w-full"),c(ce,"class","in-post"),c(te,"class","flex"),c(N,"class","mx-1"),c(X,"class","my-1 flex"),c(Ce,"class","my-1"),c(ve,"type","checkbox"),c(ve,"name","me"),ve.__value="true",ve.value=ve.__value,c(ve,"class","rounded mb-1"),c(Ne,"class","my-1"),c(We,"type","checkbox"),c(We,"name","mm"),We.__value="true",We.value=We.__value,c(We,"class","rounded mb-1"),c(e,"class","cnt")},m(qe,Ge){E(qe,e,Ge),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(e,d),o(e,v),o(v,h),o(v,M),o(v,k),o(v,T),o(T,I),o(I,C),o(T,B),o(B,z),nt&&nt.m(T,null),ot(T,t[6].m.a,!0),o(e,V),Ke.m(e,null),o(e,R),o(e,F),o(F,j),o(F,W),o(F,K),o(F,U),o(U,H),o(U,Z),ot(U,t[6].m.d,!0),o(e,ne),o(e,X),o(X,$),o($,le),o($,se),o($,fe),o($,re),o(re,Q),Me(Q,t[6].m.f),o(re,x),o(re,ge),o(X,pe),o(X,N),o(N,D),o(N,A),o(N,G),o(N,te),o(te,ee),Me(ee,t[6].m.r),o(te,oe),o(te,ce),o(e,Pe),o(e,Ce),o(e,de),o(e,Ne),o(Ne,Te),o(Te,ve),ve.checked=t[6].m.e.e,o(Te,be),o(Te,ye),o(Ne,Ve),Ye&&Ye.m(Ne,null),o(e,xe),Xe&&Xe.m(e,null),o(e,Je),o(e,it),o(it,We),We.checked=t[6].m.m.e,o(it,_t),o(it,_e),o(e,Ue),Qe&&Qe.m(e,null),kt||(wt=[me(T,"change",t[32]),me(U,"change",t[38]),me(Q,"input",t[39]),me(ee,"input",t[40]),me(ve,"change",t[41]),me(We,"change",t[44])],kt=!0)},p(qe,Ge){var Qt,el,xt,Se,Re,Fe,il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl,Be,et,je,he,Kt,wl,Cl,Sl,Ml,Nl,Tl,Pl,El,Dl;Ge[0]&4&&n!==(n=((xt=(el=(Qt=qe[2].conf)==null?void 0:Qt.meter)==null?void 0:el.title)!=null?xt:"Meter")+"")&&q(i,n),Ge[0]&4&&b!==(b=((il=(Fe=(Re=(Se=qe[2].conf)==null?void 0:Se.meter)==null?void 0:Re.comm)==null?void 0:Fe.title)!=null?il:"Communication")+"")&&q(h,b),Ge[0]&4&&O!==(O=((fl=(al=(ol=(sl=qe[2].conf)==null?void 0:sl.meter)==null?void 0:ol.comm)==null?void 0:al.passive)!=null?fl:"Passive")+"")&&q(C,O),Ge[0]&4&&L!==(L=((ml=(cl=(rl=(ul=qe[2].conf)==null?void 0:ul.meter)==null?void 0:rl.comm)==null?void 0:cl.pulse)!=null?ml:"Pulse")+"")&&q(z,L),Ge[0]&1&&(y=(pl=(_l=qe[0])==null?void 0:_l.features)==null?void 0:pl.includes("kmp")),y?nt||(nt=fa(),nt.c(),nt.m(T,null)):nt&&(nt.d(1),nt=null),Ge[0]&64&&ot(T,qe[6].m.a),ze===(ze=vt(qe))&&Ke?Ke.p(qe,Ge):(Ke.d(1),Ke=ze(qe),Ke&&(Ke.c(),Ke.m(e,R))),Ge[0]&4&&Y!==(Y=((Be=(dl=qe[2].common)==null?void 0:dl.voltage)!=null?Be:"Voltage")+"")&&q(j,Y),Ge[0]&64&&ot(U,qe[6].m.d),Ge[0]&4&&ae!==(ae=((he=(je=(et=qe[2].conf)==null?void 0:et.meter)==null?void 0:je.fuse)!=null?he:"Main fuse")+"")&&q(le,ae),Ge[0]&64&&$e(Q.value)!==qe[6].m.f&&Me(Q,qe[6].m.f),Ge[0]&4&&w!==(w=((Cl=(wl=(Kt=qe[2].conf)==null?void 0:Kt.meter)==null?void 0:wl.prod)!=null?Cl:"Production")+"")&&q(D,w),Ge[0]&64&&$e(ee.value)!==qe[6].m.r&&Me(ee,qe[6].m.r),Ge[0]&64&&(ve.checked=qe[6].m.e.e),Ge[0]&4&&He!==(He=((Nl=(Ml=(Sl=qe[2].conf)==null?void 0:Sl.meter)==null?void 0:Ml.encrypted)!=null?Nl:"Encrypted")+"")&&q(ye,He),qe[6].m.e.e?Ye?Ye.p(qe,Ge):(Ye=ua(qe),Ye.c(),Ye.m(Ne,null)):Ye&&(Ye.d(1),Ye=null),qe[6].m.e.e?Xe?Xe.p(qe,Ge):(Xe=ra(qe),Xe.c(),Xe.m(e,Je)):Xe&&(Xe.d(1),Xe=null),Ge[0]&64&&(We.checked=qe[6].m.m.e),Ge[0]&4&&Ee!==(Ee=((Dl=(El=(Pl=(Tl=qe[2].conf)==null?void 0:Tl.meter)==null?void 0:Pl.multipliers)==null?void 0:El.title)!=null?Dl:"Multipliers")+"")&&q(_e,Ee),qe[6].m.m.e?Qe?Qe.p(qe,Ge):(Qe=ca(qe),Qe.c(),Qe.m(e,null)):Qe&&(Qe.d(1),Qe=null)},d(qe){qe&&P(e),nt&&nt.d(),Ke.d(),Ye&&Ye.d(),Xe&&Xe.d(),Qe&&Qe.d(),kt=!1,Ht(wt)}}}function fa(t){let e;return{c(){e=p("option"),e.textContent="KMP",e.__value=9,e.value=e.__value},m(l,n){E(l,e,n)},d(l){l&&P(e)}}}function sc(t){var ae,le,se,fe,re,Q,x,ge,pe;let e,l,n=((se=(le=(ae=t[2].conf)==null?void 0:ae.meter)==null?void 0:le.buffer)!=null?se:"Buffer size")+"",i,s,a,r=((Q=(re=(fe=t[2].conf)==null?void 0:fe.meter)==null?void 0:re.serial)!=null?Q:"Serial conf.")+"",f,u,m,_,d,v=((pe=(ge=(x=t[2].conf)==null?void 0:x.meter)==null?void 0:ge.inverted)!=null?pe:"inverted")+"",b,h,M,k,T,I,O,C,B,L,z,y,V,R,F,Y,j,W,K,U,H,Z,ne,X=[3,12,24,48,96,192,384,576,1152],$=[];for(let N=0;N<9;N+=1)$[N]=ac(tc(t,X,N));return{c(){e=p("div"),l=p("span"),i=S(n),s=g(),a=p("span"),f=S(r),u=g(),m=p("label"),_=p("input"),d=g(),b=S(v),h=g(),M=p("div"),k=p("select"),T=p("option"),I=S("Autodetect");for(let N=0;N<9;N+=1)$[N].c();C=g(),B=p("select"),L=p("option"),z=S("-"),V=p("option"),V.textContent="7N1",R=p("option"),R.textContent="8N1",F=p("option"),F.textContent="8N2",Y=p("option"),Y.textContent="7E1",j=p("option"),j.textContent="8E1",K=g(),U=p("input"),c(l,"class","float-right"),c(_,"name","mi"),_.__value="true",_.value=_.__value,c(_,"type","checkbox"),c(_,"class","rounded mb-1"),c(m,"class","mt-2 ml-3 whitespace-nowrap"),T.__value=0,T.value=T.__value,T.disabled=O=t[6].m.b!=0,c(k,"name","mb"),c(k,"class","in-f tr w-1/2"),t[6].m.b===void 0&&Wt(()=>t[35].call(k)),L.__value=0,L.value=L.__value,L.disabled=y=t[6].m.b!=0,V.__value=2,V.value=V.__value,R.__value=3,R.value=R.__value,F.__value=7,F.value=F.__value,Y.__value=10,Y.value=Y.__value,j.__value=11,j.value=j.__value,c(B,"name","mp"),c(B,"class","in-m"),B.disabled=W=t[6].m.b==0,t[6].m.p===void 0&&Wt(()=>t[36].call(B)),c(U,"name","ms"),c(U,"type","number"),c(U,"min",64),c(U,"max",H=t[0].chip=="esp8266"?t[6].i.h.p==3||t[6].i.h.p==113?512:256:4096),c(U,"step",64),c(U,"class","in-l tr w-1/2"),c(M,"class","flex w-full"),c(e,"class","my-1")},m(N,w){E(N,e,w),o(e,l),o(l,i),o(e,s),o(e,a),o(a,f),o(e,u),o(e,m),o(m,_),_.checked=t[6].m.i,o(m,d),o(m,b),o(e,h),o(e,M),o(M,k),o(k,T),o(T,I);for(let D=0;D<9;D+=1)$[D]&&$[D].m(k,null);ot(k,t[6].m.b,!0),o(M,C),o(M,B),o(B,L),o(L,z),o(B,V),o(B,R),o(B,F),o(B,Y),o(B,j),ot(B,t[6].m.p,!0),o(M,K),o(M,U),Me(U,t[6].m.s),Z||(ne=[me(_,"change",t[34]),me(k,"change",t[35]),me(B,"change",t[36]),me(U,"input",t[37])],Z=!0)},p(N,w){var D,A,G,te,ee,oe,ce,Pe,Ce;w[0]&4&&n!==(n=((G=(A=(D=N[2].conf)==null?void 0:D.meter)==null?void 0:A.buffer)!=null?G:"Buffer size")+"")&&q(i,n),w[0]&4&&r!==(r=((oe=(ee=(te=N[2].conf)==null?void 0:te.meter)==null?void 0:ee.serial)!=null?oe:"Serial conf.")+"")&&q(f,r),w[0]&64&&(_.checked=N[6].m.i),w[0]&4&&v!==(v=((Ce=(Pe=(ce=N[2].conf)==null?void 0:ce.meter)==null?void 0:Pe.inverted)!=null?Ce:"inverted")+"")&&q(b,v),w[0]&64&&O!==(O=N[6].m.b!=0)&&(T.disabled=O),w[0]&64&&ot(k,N[6].m.b),w[0]&64&&y!==(y=N[6].m.b!=0)&&(L.disabled=y),w[0]&64&&W!==(W=N[6].m.b==0)&&(B.disabled=W),w[0]&64&&ot(B,N[6].m.p),w[0]&65&&H!==(H=N[0].chip=="esp8266"?N[6].i.h.p==3||N[6].i.h.p==113?512:256:4096)&&c(U,"max",H),w[0]&64&&$e(U.value)!==N[6].m.s&&Me(U,N[6].m.s)},d(N){N&&P(e),ll($,N),Z=!1,Ht(ne)}}}function oc(t){var u,m,_;let e,l,n=((_=(m=(u=t[2].conf)==null?void 0:u.meter)==null?void 0:m.pulses)!=null?_:"Pulses per kWh")+"",i,s,a,r,f;return{c(){e=p("div"),l=p("span"),i=S(n),s=g(),a=p("input"),c(a,"name","mb"),c(a,"class","in-s tr"),c(a,"type","number"),c(a,"min",1),c(a,"max",3600),c(e,"class","my-1")},m(d,v){E(d,e,v),o(e,l),o(l,i),o(e,s),o(e,a),Me(a,t[6].m.b),r||(f=me(a,"input",t[33]),r=!0)},p(d,v){var b,h,M;v[0]&4&&n!==(n=((M=(h=(b=d[2].conf)==null?void 0:b.meter)==null?void 0:h.pulses)!=null?M:"Pulses per kWh")+"")&&q(i,n),v[0]&64&&$e(a.value)!==d[6].m.b&&Me(a,d[6].m.b)},d(d){d&&P(e),r=!1,f()}}}function ac(t){let e,l=t[122]*100+"",n;return{c(){e=p("option"),n=S(l),e.__value=t[122]*100,e.value=e.__value},m(i,s){E(i,e,s),o(e,n)},p:Ze,d(i){i&&P(e)}}}function ua(t){let e,l,n,i;return{c(){e=p("br"),l=p("input"),c(l,"name","mek"),c(l,"type","text"),c(l,"class","in-s")},m(s,a){E(s,e,a),E(s,l,a),Me(l,t[6].m.e.k),n||(i=me(l,"input",t[42]),n=!0)},p(s,a){a[0]&64&&l.value!==s[6].m.e.k&&Me(l,s[6].m.e.k)},d(s){s&&P(e),s&&P(l),n=!1,i()}}}function ra(t){var u,m,_;let e,l=((_=(m=(u=t[2].conf)==null?void 0:u.meter)==null?void 0:m.authkey)!=null?_:"Authentication key")+"",n,i,s,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),c(a,"name","mea"),c(a,"type","text"),c(a,"class","in-s"),c(e,"class","my-1")},m(d,v){E(d,e,v),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].m.e.a),r||(f=me(a,"input",t[43]),r=!0)},p(d,v){var b,h,M;v[0]&4&&l!==(l=((M=(h=(b=d[2].conf)==null?void 0:b.meter)==null?void 0:h.authkey)!=null?M:"Authentication key")+"")&&q(n,l),v[0]&64&&a.value!==d[6].m.e.a&&Me(a,d[6].m.e.a)},d(d){d&&P(e),r=!1,f()}}}function ca(t){var W,K,U,H,Z,ne,X,$,ae,le,se,fe,re,Q,x,ge;let e,l,n=((H=(U=(K=(W=t[2].conf)==null?void 0:W.meter)==null?void 0:K.multipliers)==null?void 0:U.watt)!=null?H:"Watt")+"",i,s,a,r,f,u,m=(($=(X=(ne=(Z=t[2].conf)==null?void 0:Z.meter)==null?void 0:ne.multipliers)==null?void 0:X.volt)!=null?$:"Volt")+"",_,d,v,b,h,M,k=((fe=(se=(le=(ae=t[2].conf)==null?void 0:ae.meter)==null?void 0:le.multipliers)==null?void 0:se.amp)!=null?fe:"Amp")+"",T,I,O,C,B,L,z=((ge=(x=(Q=(re=t[2].conf)==null?void 0:re.meter)==null?void 0:Q.multipliers)==null?void 0:x.kwh)!=null?ge:"kWh")+"",y,V,R,F,Y,j;return{c(){e=p("div"),l=p("div"),i=S(n),s=p("br"),a=g(),r=p("input"),f=g(),u=p("div"),_=S(m),d=p("br"),v=g(),b=p("input"),h=g(),M=p("div"),T=S(k),I=p("br"),O=g(),C=p("input"),B=g(),L=p("div"),y=S(z),V=p("br"),R=g(),F=p("input"),c(r,"name","mmw"),c(r,"type","number"),c(r,"min","0.00"),c(r,"max","1000"),c(r,"step","0.001"),c(r,"class","in-f tr w-full"),c(l,"class","w-1/4"),c(b,"name","mmv"),c(b,"type","number"),c(b,"min","0.00"),c(b,"max","1000"),c(b,"step","0.001"),c(b,"class","in-m tr w-full"),c(u,"class","w-1/4"),c(C,"name","mma"),c(C,"type","number"),c(C,"min","0.00"),c(C,"max","1000"),c(C,"step","0.001"),c(C,"class","in-m tr w-full"),c(M,"class","w-1/4"),c(F,"name","mmc"),c(F,"type","number"),c(F,"min","0.00"),c(F,"max","1000"),c(F,"step","0.001"),c(F,"class","in-l tr w-full"),c(L,"class","w-1/4"),c(e,"class","flex my-1")},m(pe,N){E(pe,e,N),o(e,l),o(l,i),o(l,s),o(l,a),o(l,r),Me(r,t[6].m.m.w),o(e,f),o(e,u),o(u,_),o(u,d),o(u,v),o(u,b),Me(b,t[6].m.m.v),o(e,h),o(e,M),o(M,T),o(M,I),o(M,O),o(M,C),Me(C,t[6].m.m.a),o(e,B),o(e,L),o(L,y),o(L,V),o(L,R),o(L,F),Me(F,t[6].m.m.c),Y||(j=[me(r,"input",t[45]),me(b,"input",t[46]),me(C,"input",t[47]),me(F,"input",t[48])],Y=!0)},p(pe,N){var w,D,A,G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He;N[0]&4&&n!==(n=((G=(A=(D=(w=pe[2].conf)==null?void 0:w.meter)==null?void 0:D.multipliers)==null?void 0:A.watt)!=null?G:"Watt")+"")&&q(i,n),N[0]&64&&$e(r.value)!==pe[6].m.m.w&&Me(r,pe[6].m.m.w),N[0]&4&&m!==(m=((ce=(oe=(ee=(te=pe[2].conf)==null?void 0:te.meter)==null?void 0:ee.multipliers)==null?void 0:oe.volt)!=null?ce:"Volt")+"")&&q(_,m),N[0]&64&&$e(b.value)!==pe[6].m.m.v&&Me(b,pe[6].m.m.v),N[0]&4&&k!==(k=((Ne=(de=(Ce=(Pe=pe[2].conf)==null?void 0:Pe.meter)==null?void 0:Ce.multipliers)==null?void 0:de.amp)!=null?Ne:"Amp")+"")&&q(T,k),N[0]&64&&$e(C.value)!==pe[6].m.m.a&&Me(C,pe[6].m.m.a),N[0]&4&&z!==(z=((He=(be=(ve=(Te=pe[2].conf)==null?void 0:Te.meter)==null?void 0:ve.multipliers)==null?void 0:be.kwh)!=null?He:"kWh")+"")&&q(y,z),N[0]&64&&$e(F.value)!==pe[6].m.m.c&&Me(F,pe[6].m.m.c)},d(pe){pe&&P(e),Y=!1,Ht(j)}}}function ma(t){var z,y,V,R,F,Y,j,W,K;let e,l,n=((V=(y=(z=t[2].conf)==null?void 0:z.connection)==null?void 0:y.title)!=null?V:"Connection")+"",i,s,a,r,f,u,m,_,d,v,b=((Y=(F=(R=t[2].conf)==null?void 0:R.connection)==null?void 0:F.wifi)!=null?Y:"WiFi")+"",h,M,k=((K=(W=(j=t[2].conf)==null?void 0:j.connection)==null?void 0:W.ap)!=null?K:"AP")+"",T,I,O,C,B=t[0].if&&t[0].if.eth&&_a(t),L=(t[6].n.c==1||t[6].n.c==2)&&pa(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),d=p("select"),v=p("option"),h=S(b),M=p("option"),T=S(k),B&&B.c(),I=g(),L&&L.c(),c(l,"class","text-sm"),c(a,"href",ql("Network-connection")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","w"),u.value="true",v.__value=1,v.value=v.__value,M.__value=2,M.value=M.__value,c(d,"name","nc"),c(d,"class","in-s"),t[6].n.c===void 0&&Wt(()=>t[49].call(d)),c(_,"class","my-1"),c(e,"class","cnt")},m(U,H){E(U,e,H),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,d),o(d,v),o(v,h),o(d,M),o(M,T),B&&B.m(d,null),ot(d,t[6].n.c,!0),o(e,I),L&&L.m(e,null),O||(C=me(d,"change",t[49]),O=!0)},p(U,H){var Z,ne,X,$,ae,le,se,fe,re;H[0]&4&&n!==(n=((X=(ne=(Z=U[2].conf)==null?void 0:Z.connection)==null?void 0:ne.title)!=null?X:"Connection")+"")&&q(i,n),H[0]&4&&b!==(b=((le=(ae=($=U[2].conf)==null?void 0:$.connection)==null?void 0:ae.wifi)!=null?le:"WiFi")+"")&&q(h,b),H[0]&4&&k!==(k=((re=(fe=(se=U[2].conf)==null?void 0:se.connection)==null?void 0:fe.ap)!=null?re:"AP")+"")&&q(T,k),U[0].if&&U[0].if.eth?B?B.p(U,H):(B=_a(U),B.c(),B.m(d,null)):B&&(B.d(1),B=null),H[0]&64&&ot(d,U[6].n.c),U[6].n.c==1||U[6].n.c==2?L?L.p(U,H):(L=pa(U),L.c(),L.m(e,null)):L&&(L.d(1),L=null)},d(U){U&&P(e),B&&B.d(),L&&L.d(),O=!1,C()}}}function _a(t){var i,s,a;let e,l=((a=(s=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:s.eth)!=null?a:"Ethernet")+"",n;return{c(){e=p("option"),n=S(l),e.__value=3,e.value=e.__value},m(r,f){E(r,e,f),o(e,n)},p(r,f){var u,m,_;f[0]&4&&l!==(l=((_=(m=(u=r[2].conf)==null?void 0:u.connection)==null?void 0:m.eth)!=null?_:"Ethernet")+"")&&q(n,l)},d(r){r&&P(e)}}}function pa(t){var te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t,Ee,_e,Ue,kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut;let e,l=((oe=(ee=(te=t[2].conf)==null?void 0:te.connection)==null?void 0:ee.ssid)!=null?oe:"SSID")+"",n,i,s,a,r,f,u=((Ce=(Pe=(ce=t[2].conf)==null?void 0:ce.connection)==null?void 0:Pe.psk)!=null?Ce:"Password")+"",m,_,d,v,b,h,M,k=((ve=(Te=(Ne=(de=t[2].conf)==null?void 0:de.connection)==null?void 0:Ne.ps)==null?void 0:Te.title)!=null?ve:"Power saving")+"",T,I,O,C,B,L=((Ve=(ye=(He=(be=t[2].conf)==null?void 0:be.connection)==null?void 0:He.ps)==null?void 0:ye.default)!=null?Ve:"Default")+"",z,y,V=((We=(it=(Je=(xe=t[2].conf)==null?void 0:xe.connection)==null?void 0:Je.ps)==null?void 0:it.off)!=null?We:"Off")+"",R,F,Y=((Ue=(_e=(Ee=(_t=t[2].conf)==null?void 0:_t.connection)==null?void 0:Ee.ps)==null?void 0:_e.min)!=null?Ue:"Min")+"",j,W,K=((vt=(nt=(wt=(kt=t[2].conf)==null?void 0:kt.connection)==null?void 0:wt.ps)==null?void 0:nt.max)!=null?vt:"Max")+"",U,H,Z,ne=((Ye=(Ke=(ze=t[2].conf)==null?void 0:ze.connection)==null?void 0:Ke.pwr)!=null?Ye:"Power")+"",X,$,ae,le,se,fe,re,Q,x,ge,pe,N,w=((ut=(Qe=(Xe=t[2].conf)==null?void 0:Xe.connection)==null?void 0:Qe.tick_11b)!=null?ut:"802.11b")+"",D,A,G;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),r=g(),f=p("div"),m=S(u),_=p("br"),d=g(),v=p("input"),b=g(),h=p("div"),M=p("div"),T=S(k),I=p("br"),O=g(),C=p("select"),B=p("option"),z=S(L),y=p("option"),R=S(V),F=p("option"),j=S(Y),W=p("option"),U=S(K),H=g(),Z=p("div"),X=S(ne),$=p("br"),ae=g(),le=p("div"),se=p("input"),fe=g(),re=p("span"),re.textContent="dBm",Q=g(),x=p("div"),ge=p("label"),pe=p("input"),N=g(),D=S(w),c(a,"name","ws"),c(a,"type","text"),c(a,"class","in-s"),c(e,"class","my-1"),c(v,"name","wp"),c(v,"type","password"),c(v,"class","in-s"),c(f,"class","my-1"),B.__value=255,B.value=B.__value,y.__value=0,y.value=y.__value,F.__value=1,F.value=F.__value,W.__value=2,W.value=W.__value,c(C,"name","wz"),c(C,"class","in-s"),t[6].w.z===void 0&&Wt(()=>t[52].call(C)),c(M,"class","w-1/2"),c(se,"name","ww"),c(se,"type","number"),c(se,"min","0"),c(se,"max","20.5"),c(se,"step","0.5"),c(se,"class","in-f tr w-full"),c(re,"class","in-post"),c(le,"class","flex"),c(Z,"class","ml-2 w-1/2"),c(h,"class","my-1 flex"),c(pe,"type","checkbox"),c(pe,"name","wb"),pe.__value="true",pe.value=pe.__value,c(pe,"class","rounded mb-1"),c(x,"class","my-3")},m(we,Ae){E(we,e,Ae),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].w.s),E(we,r,Ae),E(we,f,Ae),o(f,m),o(f,_),o(f,d),o(f,v),Me(v,t[6].w.p),E(we,b,Ae),E(we,h,Ae),o(h,M),o(M,T),o(M,I),o(M,O),o(M,C),o(C,B),o(B,z),o(C,y),o(y,R),o(C,F),o(F,j),o(C,W),o(W,U),ot(C,t[6].w.z,!0),o(h,H),o(h,Z),o(Z,X),o(Z,$),o(Z,ae),o(Z,le),o(le,se),Me(se,t[6].w.w),o(le,fe),o(le,re),E(we,Q,Ae),E(we,x,Ae),o(x,ge),o(ge,pe),pe.checked=t[6].w.b,o(ge,N),o(ge,D),A||(G=[me(a,"input",t[50]),me(v,"input",t[51]),me(C,"change",t[52]),me(se,"input",t[53]),me(pe,"change",t[54])],A=!0)},p(we,Ae){var ke,ue,De,rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt,qe,Ge,Qt;Ae[0]&4&&l!==(l=((De=(ue=(ke=we[2].conf)==null?void 0:ke.connection)==null?void 0:ue.ssid)!=null?De:"SSID")+"")&&q(n,l),Ae[0]&64&&a.value!==we[6].w.s&&Me(a,we[6].w.s),Ae[0]&4&&u!==(u=((at=(st=(rt=we[2].conf)==null?void 0:rt.connection)==null?void 0:st.psk)!=null?at:"Password")+"")&&q(m,u),Ae[0]&64&&v.value!==we[6].w.p&&Me(v,we[6].w.p),Ae[0]&4&&k!==(k=((Pt=(Rt=(ht=(pt=we[2].conf)==null?void 0:pt.connection)==null?void 0:ht.ps)==null?void 0:Rt.title)!=null?Pt:"Power saving")+"")&&q(T,k),Ae[0]&4&&L!==(L=((Bt=(zt=(Ft=(ct=we[2].conf)==null?void 0:ct.connection)==null?void 0:Ft.ps)==null?void 0:zt.default)!=null?Bt:"Default")+"")&&q(z,L),Ae[0]&4&&V!==(V=((Gt=(yt=(qt=(Ut=we[2].conf)==null?void 0:Ut.connection)==null?void 0:qt.ps)==null?void 0:yt.off)!=null?Gt:"Off")+"")&&q(R,V),Ae[0]&4&&Y!==(Y=((Mt=(Ct=(Yt=(Vt=we[2].conf)==null?void 0:Vt.connection)==null?void 0:Yt.ps)==null?void 0:Ct.min)!=null?Mt:"Min")+"")&&q(j,Y),Ae[0]&4&&K!==(K=((dt=(Et=(Nt=(ft=we[2].conf)==null?void 0:ft.connection)==null?void 0:Nt.ps)==null?void 0:Et.max)!=null?dt:"Max")+"")&&q(U,K),Ae[0]&64&&ot(C,we[6].w.z),Ae[0]&4&&ne!==(ne=((mt=(St=(At=we[2].conf)==null?void 0:At.connection)==null?void 0:St.pwr)!=null?mt:"Power")+"")&&q(X,ne),Ae[0]&64&&$e(se.value)!==we[6].w.w&&Me(se,we[6].w.w),Ae[0]&64&&(pe.checked=we[6].w.b),Ae[0]&4&&w!==(w=((Qt=(Ge=(qe=we[2].conf)==null?void 0:qe.connection)==null?void 0:Ge.tick_11b)!=null?Qt:"802.11b")+"")&&q(D,w)},d(we){we&&P(e),we&&P(r),we&&P(f),we&&P(b),we&&P(h),we&&P(Q),we&&P(x),A=!1,Ht(G)}}}function da(t){var He,ye,Ve,xe,Je,it,We,_t,Ee,_e,Ue,kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut;let e,l,n=((Ve=(ye=(He=t[2].conf)==null?void 0:He.network)==null?void 0:ye.title)!=null?Ve:"Network")+"",i,s,a,r,f,u,m=((it=(Je=(xe=t[2].conf)==null?void 0:xe.network)==null?void 0:Je.ip)!=null?it:"IP")+"",_,d,v,b,h,M,k=((Ee=(_t=(We=t[2].conf)==null?void 0:We.network)==null?void 0:_t.dhcp)!=null?Ee:"DHCP")+"",T,I,O=((kt=(Ue=(_e=t[2].conf)==null?void 0:_e.network)==null?void 0:Ue.static)!=null?kt:"Static")+"",C,B,L,z,y,V,R,F,Y,j,W,K,U,H,Z,ne,X,$,ae,le,se,fe=((vt=(nt=(wt=t[2].conf)==null?void 0:wt.network)==null?void 0:nt.tick_mdns)!=null?vt:"mDNS")+"",re,Q,x,ge,pe,N=((Ye=(Ke=(ze=t[2].conf)==null?void 0:ze.network)==null?void 0:Ke.ntp)!=null?Ye:"NTP")+"",w,D,A,G,te,ee=((ut=(Qe=(Xe=t[2].conf)==null?void 0:Xe.network)==null?void 0:Qe.tick_ntp_dhcp)!=null?ut:"from DHCP")+"",oe,ce,Pe,Ce,de,Ne,Te,ve;F=new Fu({});let be=t[6].n.m=="static"&&va(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("div"),_=S(m),d=p("br"),v=g(),b=p("div"),h=p("select"),M=p("option"),T=S(k),I=p("option"),C=S(O),B=g(),L=p("input"),V=g(),R=p("select"),Oe(F.$$.fragment),W=g(),be&&be.c(),K=g(),U=p("div"),H=p("label"),Z=p("input"),ne=S(" IPv6"),X=g(),$=p("div"),ae=p("label"),le=p("input"),se=g(),re=S(fe),Q=g(),x=p("input"),ge=g(),pe=p("div"),w=S(N),D=g(),A=p("label"),G=p("input"),te=g(),oe=S(ee),ce=p("br"),Pe=g(),Ce=p("div"),de=p("input"),c(l,"class","text-sm"),c(a,"href",ql("Network-configuration")),c(a,"target","_blank"),c(a,"class","float-right"),M.__value="dhcp",M.value=M.__value,I.__value="static",I.value=I.__value,c(h,"name","nm"),c(h,"class","in-f"),t[6].n.m===void 0&&Wt(()=>t[55].call(h)),c(L,"name","ni"),c(L,"type","text"),c(L,"class","in-m w-full"),L.disabled=z=t[6].n.m=="dhcp",L.required=y=t[6].n.m=="static",c(R,"name","ns"),c(R,"class","in-l"),R.disabled=Y=t[6].n.m=="dhcp",R.required=j=t[6].n.m=="static",t[6].n.s===void 0&&Wt(()=>t[57].call(R)),c(b,"class","flex"),c(u,"class","my-1"),c(Z,"name","nx"),Z.__value="true",Z.value=Z.__value,c(Z,"type","checkbox"),c(Z,"class","rounded mb-1"),c(U,"class","my-1"),c(le,"name","nd"),le.__value="true",le.value=le.__value,c(le,"type","checkbox"),c(le,"class","rounded mb-1"),c($,"class","my-1"),c(x,"type","hidden"),c(x,"name","ntp"),x.value="true",c(G,"name","ntpd"),G.__value="true",G.value=G.__value,c(G,"type","checkbox"),c(G,"class","rounded mb-1"),c(A,"class","ml-4"),c(de,"name","ntph"),c(de,"type","text"),c(de,"class","in-s"),c(Ce,"class","flex"),c(pe,"class","my-1"),c(e,"class","cnt")},m(we,Ae){E(we,e,Ae),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(u,_),o(u,d),o(u,v),o(u,b),o(b,h),o(h,M),o(M,T),o(h,I),o(I,C),ot(h,t[6].n.m,!0),o(b,B),o(b,L),Me(L,t[6].n.i),o(b,V),o(b,R),Le(F,R,null),ot(R,t[6].n.s,!0),o(e,W),be&&be.m(e,null),o(e,K),o(e,U),o(U,H),o(H,Z),Z.checked=t[6].n.x,o(H,ne),o(e,X),o(e,$),o($,ae),o(ae,le),le.checked=t[6].n.d,o(ae,se),o(ae,re),o(e,Q),o(e,x),o(e,ge),o(e,pe),o(pe,w),o(pe,D),o(pe,A),o(A,G),G.checked=t[6].n.h,o(A,te),o(A,oe),o(pe,ce),o(pe,Pe),o(pe,Ce),o(Ce,de),Me(de,t[6].n.n1),Ne=!0,Te||(ve=[me(h,"change",t[55]),me(L,"input",t[56]),me(R,"change",t[57]),me(Z,"change",t[61]),me(le,"change",t[62]),me(G,"change",t[63]),me(de,"input",t[64])],Te=!0)},p(we,Ae){var ke,ue,De,rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct;(!Ne||Ae[0]&4)&&n!==(n=((De=(ue=(ke=we[2].conf)==null?void 0:ke.network)==null?void 0:ue.title)!=null?De:"Network")+"")&&q(i,n),(!Ne||Ae[0]&4)&&m!==(m=((at=(st=(rt=we[2].conf)==null?void 0:rt.network)==null?void 0:st.ip)!=null?at:"IP")+"")&&q(_,m),(!Ne||Ae[0]&4)&&k!==(k=((Rt=(ht=(pt=we[2].conf)==null?void 0:pt.network)==null?void 0:ht.dhcp)!=null?Rt:"DHCP")+"")&&q(T,k),(!Ne||Ae[0]&4)&&O!==(O=((Ft=(ct=(Pt=we[2].conf)==null?void 0:Pt.network)==null?void 0:ct.static)!=null?Ft:"Static")+"")&&q(C,O),Ae[0]&64&&ot(h,we[6].n.m),(!Ne||Ae[0]&64&&z!==(z=we[6].n.m=="dhcp"))&&(L.disabled=z),(!Ne||Ae[0]&64&&y!==(y=we[6].n.m=="static"))&&(L.required=y),Ae[0]&64&&L.value!==we[6].n.i&&Me(L,we[6].n.i),(!Ne||Ae[0]&64&&Y!==(Y=we[6].n.m=="dhcp"))&&(R.disabled=Y),(!Ne||Ae[0]&64&&j!==(j=we[6].n.m=="static"))&&(R.required=j),Ae[0]&64&&ot(R,we[6].n.s),we[6].n.m=="static"?be?be.p(we,Ae):(be=va(we),be.c(),be.m(e,K)):be&&(be.d(1),be=null),Ae[0]&64&&(Z.checked=we[6].n.x),Ae[0]&64&&(le.checked=we[6].n.d),(!Ne||Ae[0]&4)&&fe!==(fe=((Ut=(Bt=(zt=we[2].conf)==null?void 0:zt.network)==null?void 0:Bt.tick_mdns)!=null?Ut:"mDNS")+"")&&q(re,fe),(!Ne||Ae[0]&4)&&N!==(N=((Gt=(yt=(qt=we[2].conf)==null?void 0:qt.network)==null?void 0:yt.ntp)!=null?Gt:"NTP")+"")&&q(w,N),Ae[0]&64&&(G.checked=we[6].n.h),(!Ne||Ae[0]&4)&&ee!==(ee=((Ct=(Yt=(Vt=we[2].conf)==null?void 0:Vt.network)==null?void 0:Yt.tick_ntp_dhcp)!=null?Ct:"from DHCP")+"")&&q(oe,ee),Ae[0]&64&&de.value!==we[6].n.n1&&Me(de,we[6].n.n1)},i(we){Ne||(J(F.$$.fragment,we),Ne=!0)},o(we){ie(F.$$.fragment,we),Ne=!1},d(we){we&&P(e),Ie(F),be&&be.d(),Te=!1,Ht(ve)}}}function va(t){var I,O,C,B,L,z;let e,l=((C=(O=(I=t[2].conf)==null?void 0:I.network)==null?void 0:O.gw)!=null?C:"Gateway")+"",n,i,s,a,r,f,u=((z=(L=(B=t[2].conf)==null?void 0:B.network)==null?void 0:L.dns)!=null?z:"DNS")+"",m,_,d,v,b,h,M,k,T;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),r=g(),f=p("div"),m=S(u),_=p("br"),d=g(),v=p("div"),b=p("input"),h=g(),M=p("input"),c(a,"name","ng"),c(a,"type","text"),c(a,"class","in-s"),c(e,"class","my-1"),c(b,"name","nd1"),c(b,"type","text"),c(b,"class","in-f w-full"),c(M,"name","nd2"),c(M,"type","text"),c(M,"class","in-l w-full"),c(v,"class","flex"),c(f,"class","my-1")},m(y,V){E(y,e,V),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].n.g),E(y,r,V),E(y,f,V),o(f,m),o(f,_),o(f,d),o(f,v),o(v,b),Me(b,t[6].n.d1),o(v,h),o(v,M),Me(M,t[6].n.d2),k||(T=[me(a,"input",t[58]),me(b,"input",t[59]),me(M,"input",t[60])],k=!0)},p(y,V){var R,F,Y,j,W,K;V[0]&4&&l!==(l=((Y=(F=(R=y[2].conf)==null?void 0:R.network)==null?void 0:F.gw)!=null?Y:"Gateway")+"")&&q(n,l),V[0]&64&&a.value!==y[6].n.g&&Me(a,y[6].n.g),V[0]&4&&u!==(u=((K=(W=(j=y[2].conf)==null?void 0:j.network)==null?void 0:W.dns)!=null?K:"DNS")+"")&&q(m,u),V[0]&64&&b.value!==y[6].n.d1&&Me(b,y[6].n.d1),V[0]&64&&M.value!==y[6].n.d2&&Me(M,y[6].n.d2)},d(y){y&&P(e),y&&P(r),y&&P(f),k=!1,Ht(T)}}}function ha(t){var rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt,qe,Ge,Qt,el,xt,Se;let e,l,n=((at=(st=(rt=t[2].conf)==null?void 0:rt.mqtt)==null?void 0:st.title)!=null?at:"MQTT")+"",i,s,a,r,f,u,m,_,d=((Rt=(ht=(pt=t[2].conf)==null?void 0:pt.mqtt)==null?void 0:ht.server)!=null?Rt:"Server")+"",v,b,h,M,k,T,I,O,C,B,L,z,y=((Ft=(ct=(Pt=t[2].conf)==null?void 0:Pt.mqtt)==null?void 0:ct.user)!=null?Ft:"Username")+"",V,R,F,Y,j,W,K=((Ut=(Bt=(zt=t[2].conf)==null?void 0:zt.mqtt)==null?void 0:Bt.pass)!=null?Ut:"Password")+"",U,H,Z,ne,X,$,ae,le=((Gt=(yt=(qt=t[2].conf)==null?void 0:qt.mqtt)==null?void 0:yt.id)!=null?Gt:"Client ID")+"",se,fe,re,Q,x,ge,pe=((Ct=(Yt=(Vt=t[2].conf)==null?void 0:Vt.mqtt)==null?void 0:Yt.payload)!=null?Ct:"Payload")+"",N,w,D,A,G,te,ee,oe=((Et=(Nt=(ft=(Mt=t[2].conf)==null?void 0:Mt.mqtt)==null?void 0:ft.domoticz)==null?void 0:Nt.title)!=null?Et:"Domoticz")+"",ce,Pe,Ce=((mt=(St=(At=(dt=t[2].conf)==null?void 0:dt.mqtt)==null?void 0:At.ha)==null?void 0:St.title)!=null?mt:"Home-Assistant")+"",de,Ne,Te,ve,be,He,ye,Ve=((Qt=(Ge=(qe=t[2].conf)==null?void 0:qe.mqtt)==null?void 0:Ge.publish)!=null?Qt:"Publish topic")+"",xe,Je,it,We,_t,Ee,_e=((Se=(xt=(el=t[2].conf)==null?void 0:el.mqtt)==null?void 0:xt.update)!=null?Se:"Update method")+"",Ue,kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut,we,Ae,ke,ue=t[0].chip!="esp8266"&&ba(t),De=t[6].q.s.e&&ga(t);return{c(){var Re,Fe;e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),v=S(d),b=g(),ue&&ue.c(),h=g(),M=p("br"),k=g(),T=p("div"),I=p("input"),O=g(),C=p("input"),B=g(),De&&De.c(),L=g(),z=p("div"),V=S(y),R=p("br"),F=g(),Y=p("input"),j=g(),W=p("div"),U=S(K),H=p("br"),Z=g(),ne=p("input"),X=g(),$=p("div"),ae=p("div"),se=S(le),fe=p("br"),re=g(),Q=p("input"),x=g(),ge=p("div"),N=S(pe),w=p("br"),D=g(),A=p("select"),G=p("option"),G.textContent="Raw (minimal)",te=p("option"),te.textContent="Raw (full)",ee=p("option"),ce=S(oe),Pe=p("option"),de=S(Ce),Ne=p("option"),Ne.textContent="JSON (classic)",Te=p("option"),Te.textContent="JSON (multi topic)",ve=p("option"),ve.textContent="JSON (flat)",be=p("option"),be.textContent="HEX dump",He=g(),ye=p("div"),xe=S(Ve),Je=p("br"),it=g(),We=p("input"),_t=g(),Ee=p("div"),Ue=S(_e),kt=g(),wt=p("span"),wt.textContent="Interval",nt=g(),vt=p("div"),ze=p("select"),Ke=p("option"),Ke.textContent="Real time",Ye=p("option"),Ye.textContent="Interval",Xe=g(),Qe=p("input"),c(l,"class","text-sm"),c(a,"href",ql("MQTT-configuration")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","q"),u.value="true",c(I,"name","qh"),c(I,"type","text"),c(I,"class","in-f w-2/3"),c(C,"name","qp"),c(C,"type","number"),c(C,"min","1024"),c(C,"max","65535"),c(C,"class","in-l tr w-1/3"),c(T,"class","flex"),c(_,"class","my-1"),c(Y,"name","qu"),c(Y,"type","text"),c(Y,"class","in-s"),c(z,"class","my-1"),c(ne,"name","qa"),c(ne,"type","password"),c(ne,"class","in-s"),c(W,"class","my-1"),c(Q,"name","qc"),c(Q,"type","text"),c(Q,"class","in-f w-full"),G.__value=1,G.value=G.__value,te.__value=2,te.value=te.__value,ee.__value=3,ee.value=ee.__value,Pe.__value=4,Pe.value=Pe.__value,Ne.__value=0,Ne.value=Ne.__value,Te.__value=5,Te.value=Te.__value,ve.__value=6,ve.value=ve.__value,be.__value=255,be.value=be.__value,c(A,"name","qm"),c(A,"class","in-l"),t[6].q.m===void 0&&Wt(()=>t[71].call(A)),c($,"class","my-1 flex"),c(We,"name","qb"),c(We,"type","text"),c(We,"class","in-s"),c(ye,"class","my-1"),c(wt,"class","float-right"),Ke.__value=0,Ke.value=Ke.__value,Ye.__value=1,Ye.value=Ye.__value,c(ze,"name","qt"),c(ze,"class","in-f w-1/2"),t[6].q.t===void 0&&Wt(()=>t[73].call(ze)),c(Qe,"name","qd"),c(Qe,"type","number"),c(Qe,"min","1"),c(Qe,"max","3600"),c(Qe,"class","in-l tr w-1/2"),Qe.disabled=ut=((Fe=(Re=t[6])==null?void 0:Re.q)==null?void 0:Fe.t)!=1,c(vt,"class","flex"),c(Ee,"class","my-1"),c(e,"class","cnt")},m(Re,Fe){E(Re,e,Fe),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,v),o(_,b),ue&&ue.m(_,null),o(_,h),o(_,M),o(_,k),o(_,T),o(T,I),Me(I,t[6].q.h),o(T,O),o(T,C),Me(C,t[6].q.p),o(e,B),De&&De.m(e,null),o(e,L),o(e,z),o(z,V),o(z,R),o(z,F),o(z,Y),Me(Y,t[6].q.u),o(e,j),o(e,W),o(W,U),o(W,H),o(W,Z),o(W,ne),Me(ne,t[6].q.a),o(e,X),o(e,$),o($,ae),o(ae,se),o(ae,fe),o(ae,re),o(ae,Q),Me(Q,t[6].q.c),o($,x),o($,ge),o(ge,N),o(ge,w),o(ge,D),o(ge,A),o(A,G),o(A,te),o(A,ee),o(ee,ce),o(A,Pe),o(Pe,de),o(A,Ne),o(A,Te),o(A,ve),o(A,be),ot(A,t[6].q.m,!0),o(e,He),o(e,ye),o(ye,xe),o(ye,Je),o(ye,it),o(ye,We),Me(We,t[6].q.b),o(e,_t),o(e,Ee),o(Ee,Ue),o(Ee,kt),o(Ee,wt),o(Ee,nt),o(Ee,vt),o(vt,ze),o(ze,Ke),o(ze,Ye),ot(ze,t[6].q.t,!0),o(vt,Xe),o(vt,Qe),Me(Qe,t[6].q.d),we=!0,Ae||(ke=[me(I,"input",t[66]),me(C,"input",t[67]),me(Y,"input",t[68]),me(ne,"input",t[69]),me(Q,"input",t[70]),me(A,"change",t[71]),me(We,"input",t[72]),me(ze,"change",t[73]),me(Qe,"input",t[74])],Ae=!0)},p(Re,Fe){var il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl,Be,et,je,he,Kt,wl,Cl,Sl,Ml,Nl,Tl,Pl,El,Dl,Rl,Fl,Bl,Ul,tt,Ot,vl,bl;(!we||Fe[0]&4)&&n!==(n=((ol=(sl=(il=Re[2].conf)==null?void 0:il.mqtt)==null?void 0:sl.title)!=null?ol:"MQTT")+"")&&q(i,n),(!we||Fe[0]&4)&&d!==(d=((ul=(fl=(al=Re[2].conf)==null?void 0:al.mqtt)==null?void 0:fl.server)!=null?ul:"Server")+"")&&q(v,d),Re[0].chip!="esp8266"?ue?ue.p(Re,Fe):(ue=ba(Re),ue.c(),ue.m(_,h)):ue&&(ue.d(1),ue=null),Fe[0]&64&&I.value!==Re[6].q.h&&Me(I,Re[6].q.h),Fe[0]&64&&$e(C.value)!==Re[6].q.p&&Me(C,Re[6].q.p),Re[6].q.s.e?De?(De.p(Re,Fe),Fe[0]&64&&J(De,1)):(De=ga(Re),De.c(),J(De,1),De.m(e,L)):De&&(bt(),ie(De,1,1,()=>{De=null}),gt()),(!we||Fe[0]&4)&&y!==(y=((ml=(cl=(rl=Re[2].conf)==null?void 0:rl.mqtt)==null?void 0:cl.user)!=null?ml:"Username")+"")&&q(V,y),Fe[0]&64&&Y.value!==Re[6].q.u&&Me(Y,Re[6].q.u),(!we||Fe[0]&4)&&K!==(K=((dl=(pl=(_l=Re[2].conf)==null?void 0:_l.mqtt)==null?void 0:pl.pass)!=null?dl:"Password")+"")&&q(U,K),Fe[0]&64&&ne.value!==Re[6].q.a&&Me(ne,Re[6].q.a),(!we||Fe[0]&4)&&le!==(le=((je=(et=(Be=Re[2].conf)==null?void 0:Be.mqtt)==null?void 0:et.id)!=null?je:"Client ID")+"")&&q(se,le),Fe[0]&64&&Q.value!==Re[6].q.c&&Me(Q,Re[6].q.c),(!we||Fe[0]&4)&&pe!==(pe=((wl=(Kt=(he=Re[2].conf)==null?void 0:he.mqtt)==null?void 0:Kt.payload)!=null?wl:"Payload")+"")&&q(N,pe),(!we||Fe[0]&4)&&oe!==(oe=((Nl=(Ml=(Sl=(Cl=Re[2].conf)==null?void 0:Cl.mqtt)==null?void 0:Sl.domoticz)==null?void 0:Ml.title)!=null?Nl:"Domoticz")+"")&&q(ce,oe),(!we||Fe[0]&4)&&Ce!==(Ce=((Dl=(El=(Pl=(Tl=Re[2].conf)==null?void 0:Tl.mqtt)==null?void 0:Pl.ha)==null?void 0:El.title)!=null?Dl:"Home-Assistant")+"")&&q(de,Ce),Fe[0]&64&&ot(A,Re[6].q.m),(!we||Fe[0]&4)&&Ve!==(Ve=((Bl=(Fl=(Rl=Re[2].conf)==null?void 0:Rl.mqtt)==null?void 0:Fl.publish)!=null?Bl:"Publish topic")+"")&&q(xe,Ve),Fe[0]&64&&We.value!==Re[6].q.b&&Me(We,Re[6].q.b),(!we||Fe[0]&4)&&_e!==(_e=((Ot=(tt=(Ul=Re[2].conf)==null?void 0:Ul.mqtt)==null?void 0:tt.update)!=null?Ot:"Update method")+"")&&q(Ue,_e),Fe[0]&64&&ot(ze,Re[6].q.t),(!we||Fe[0]&64&&ut!==(ut=((bl=(vl=Re[6])==null?void 0:vl.q)==null?void 0:bl.t)!=1))&&(Qe.disabled=ut),Fe[0]&64&&$e(Qe.value)!==Re[6].q.d&&Me(Qe,Re[6].q.d)},i(Re){we||(J(De),we=!0)},o(Re){ie(De),we=!1},d(Re){Re&&P(e),ue&&ue.d(),De&&De.d(),Ae=!1,Ht(ke)}}}function ba(t){let e,l,n,i,s;return{c(){e=p("label"),l=p("input"),n=S(" SSL"),c(l,"type","checkbox"),c(l,"name","qs"),l.__value="true",l.value=l.__value,c(l,"class","rounded mb-1"),c(e,"class","float-right mr-3")},m(a,r){E(a,e,r),o(e,l),l.checked=t[6].q.s.e,o(e,n),i||(s=[me(l,"change",t[65]),me(l,"change",t[18])],i=!0)},p(a,r){r[0]&64&&(l.checked=a[6].q.s.e)},d(a){a&&P(e),i=!1,Ht(s)}}}function ga(t){let e,l,n,i,s,a,r,f,u,m,_,d,v;const b=[uc,fc],h=[];function M(L,z){return L[6].q.s.c?0:1}n=M(t),i=h[n]=b[n](t);const k=[_c,mc],T=[];function I(L,z){return L[6].q.s.r?0:1}r=I(t),f=T[r]=k[r](t);const O=[hc,vc],C=[];function B(L,z){return L[6].q.s.k?0:1}return _=B(t),d=C[_]=O[_](t),{c(){e=p("div"),l=p("span"),i.c(),s=g(),a=p("span"),f.c(),u=g(),m=p("span"),d.c(),c(l,"class","flex pr-2"),c(a,"class","flex pr-2"),c(m,"class","flex pr-2"),c(e,"class","my-1 flex")},m(L,z){E(L,e,z),o(e,l),h[n].m(l,null),o(e,s),o(e,a),T[r].m(a,null),o(e,u),o(e,m),C[_].m(m,null),v=!0},p(L,z){let y=n;n=M(L),n===y?h[n].p(L,z):(bt(),ie(h[y],1,1,()=>{h[y]=null}),gt(),i=h[n],i?i.p(L,z):(i=h[n]=b[n](L),i.c()),J(i,1),i.m(l,null));let V=r;r=I(L),r===V?T[r].p(L,z):(bt(),ie(T[V],1,1,()=>{T[V]=null}),gt(),f=T[r],f?f.p(L,z):(f=T[r]=k[r](L),f.c()),J(f,1),f.m(a,null));let R=_;_=B(L),_===R?C[_].p(L,z):(bt(),ie(C[R],1,1,()=>{C[R]=null}),gt(),d=C[_],d?d.p(L,z):(d=C[_]=O[_](L),d.c()),J(d,1),d.m(m,null))},i(L){v||(J(i),J(f),J(d),v=!0)},o(L){ie(i),ie(f),ie(d),v=!1},d(L){L&&P(e),h[n].d(),T[r].d(),C[_].d()}}}function fc(t){let e,l;return e=new Al({props:{to:"/mqtt-ca",$$slots:{default:[rc]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i[0]&4|i[4]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function uc(t){let e,l,n,i,s,a,r;return l=new Al({props:{to:"/mqtt-ca",$$slots:{default:[cc]},$$scope:{ctx:t}}}),{c(){e=p("span"),Oe(l.$$.fragment),n=g(),i=p("span"),i.textContent="\u{1F5D1}",c(e,"class","bd-on"),c(i,"class","bd-off")},m(f,u){E(f,e,u),Le(l,e,null),E(f,n,u),E(f,i,u),s=!0,a||(r=[me(i,"click",t[15]),me(i,"keypress",t[15])],a=!0)},p(f,u){const m={};u[0]&4|u[4]&16&&(m.$$scope={dirty:u,ctx:f}),l.$set(m)},i(f){s||(J(l.$$.fragment,f),s=!0)},o(f){ie(l.$$.fragment,f),s=!1},d(f){f&&P(e),Ie(l),f&&P(n),f&&P(i),a=!1,Ht(r)}}}function rc(t){var n,i,s,a,r,f;let e,l;return e=new xl({props:{color:"blue",text:(s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_ca_upload)!=null?s:"Upload CA",title:(f=(r=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:r.title_ca)!=null?f:""}}),{c(){Oe(e.$$.fragment)},m(u,m){Le(e,u,m),l=!0},p(u,m){var d,v,b,h,M,k;const _={};m[0]&4&&(_.text=(b=(v=(d=u[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_ca_upload)!=null?b:"Upload CA"),m[0]&4&&(_.title=(k=(M=(h=u[2].conf)==null?void 0:h.mqtt)==null?void 0:M.title_ca)!=null?k:""),e.$set(_)},i(u){l||(J(e.$$.fragment,u),l=!0)},o(u){ie(e.$$.fragment,u),l=!1},d(u){Ie(e,u)}}}function cc(t){var n,i,s;let e=((s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.ca_ok)!=null?s:"CA OK")+"",l;return{c(){l=S(e)},m(a,r){E(a,l,r)},p(a,r){var f,u,m;r[0]&4&&e!==(e=((m=(u=(f=a[2].conf)==null?void 0:f.mqtt)==null?void 0:u.ca_ok)!=null?m:"CA OK")+"")&&q(l,e)},d(a){a&&P(l)}}}function mc(t){let e,l;return e=new Al({props:{to:"/mqtt-cert",$$slots:{default:[pc]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i[0]&4|i[4]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function _c(t){let e,l,n,i,s,a,r;return l=new Al({props:{to:"/mqtt-cert",$$slots:{default:[dc]},$$scope:{ctx:t}}}),{c(){e=p("span"),Oe(l.$$.fragment),n=g(),i=p("span"),i.textContent="\u{1F5D1}",c(e,"class","bd-on"),c(i,"class","bd-off")},m(f,u){E(f,e,u),Le(l,e,null),E(f,n,u),E(f,i,u),s=!0,a||(r=[me(i,"click",t[16]),me(i,"keypress",t[16])],a=!0)},p(f,u){const m={};u[0]&4|u[4]&16&&(m.$$scope={dirty:u,ctx:f}),l.$set(m)},i(f){s||(J(l.$$.fragment,f),s=!0)},o(f){ie(l.$$.fragment,f),s=!1},d(f){f&&P(e),Ie(l),f&&P(n),f&&P(i),a=!1,Ht(r)}}}function pc(t){var n,i,s,a,r,f;let e,l;return e=new xl({props:{color:"blue",text:(s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_crt_upload)!=null?s:"Upload cert",title:(f=(r=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:r.title_crt)!=null?f:""}}),{c(){Oe(e.$$.fragment)},m(u,m){Le(e,u,m),l=!0},p(u,m){var d,v,b,h,M,k;const _={};m[0]&4&&(_.text=(b=(v=(d=u[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_crt_upload)!=null?b:"Upload cert"),m[0]&4&&(_.title=(k=(M=(h=u[2].conf)==null?void 0:h.mqtt)==null?void 0:M.title_crt)!=null?k:""),e.$set(_)},i(u){l||(J(e.$$.fragment,u),l=!0)},o(u){ie(e.$$.fragment,u),l=!1},d(u){Ie(e,u)}}}function dc(t){var n,i,s;let e=((s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.crt_ok)!=null?s:"Cert OK")+"",l;return{c(){l=S(e)},m(a,r){E(a,l,r)},p(a,r){var f,u,m;r[0]&4&&e!==(e=((m=(u=(f=a[2].conf)==null?void 0:f.mqtt)==null?void 0:u.crt_ok)!=null?m:"Cert OK")+"")&&q(l,e)},d(a){a&&P(l)}}}function vc(t){let e,l;return e=new Al({props:{to:"/mqtt-key",$$slots:{default:[bc]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i[0]&4|i[4]&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function hc(t){let e,l,n,i,s,a,r;return l=new Al({props:{to:"/mqtt-key",$$slots:{default:[gc]},$$scope:{ctx:t}}}),{c(){e=p("span"),Oe(l.$$.fragment),n=g(),i=p("span"),i.textContent="\u{1F5D1}",c(e,"class","bd-on"),c(i,"class","bd-off")},m(f,u){E(f,e,u),Le(l,e,null),E(f,n,u),E(f,i,u),s=!0,a||(r=[me(i,"click",t[17]),me(i,"keypress",t[17])],a=!0)},p(f,u){const m={};u[0]&4|u[4]&16&&(m.$$scope={dirty:u,ctx:f}),l.$set(m)},i(f){s||(J(l.$$.fragment,f),s=!0)},o(f){ie(l.$$.fragment,f),s=!1},d(f){f&&P(e),Ie(l),f&&P(n),f&&P(i),a=!1,Ht(r)}}}function bc(t){var n,i,s,a,r,f;let e,l;return e=new xl({props:{color:"blue",text:(s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_key_upload)!=null?s:"Upload key",title:(f=(r=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:r.title_key)!=null?f:""}}),{c(){Oe(e.$$.fragment)},m(u,m){Le(e,u,m),l=!0},p(u,m){var d,v,b,h,M,k;const _={};m[0]&4&&(_.text=(b=(v=(d=u[2].conf)==null?void 0:d.mqtt)==null?void 0:v.btn_key_upload)!=null?b:"Upload key"),m[0]&4&&(_.title=(k=(M=(h=u[2].conf)==null?void 0:h.mqtt)==null?void 0:M.title_key)!=null?k:""),e.$set(_)},i(u){l||(J(e.$$.fragment,u),l=!0)},o(u){ie(e.$$.fragment,u),l=!1},d(u){Ie(e,u)}}}function gc(t){var n,i,s;let e=((s=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.key_ok)!=null?s:"Key OK")+"",l;return{c(){l=S(e)},m(a,r){E(a,l,r)},p(a,r){var f,u,m;r[0]&4&&e!==(e=((m=(u=(f=a[2].conf)==null?void 0:f.mqtt)==null?void 0:u.key_ok)!=null?m:"Key OK")+"")&&q(l,e)},d(a){a&&P(l)}}}function ka(t){var $,ae,le,se,fe,re,Q,x,ge,pe,N,w,D,A,G,te;let e,l,n=((se=(le=(ae=($=t[2].conf)==null?void 0:$.mqtt)==null?void 0:ae.domoticz)==null?void 0:le.title)!=null?se:"Domoticz")+"",i,s,a,r,f,u,m,_,d,v=((x=(Q=(re=(fe=t[2].conf)==null?void 0:fe.mqtt)==null?void 0:re.domoticz)==null?void 0:Q.eidx)!=null?x:"Electricity IDX")+"",b,h,M,k,T,I,O=((w=(N=(pe=(ge=t[2].conf)==null?void 0:ge.mqtt)==null?void 0:pe.domoticz)==null?void 0:N.cidx)!=null?w:"Current IDX")+"",C,B,L,z,y,V,R=((te=(G=(A=(D=t[2].conf)==null?void 0:D.mqtt)==null?void 0:A.domoticz)==null?void 0:G.vidx)!=null?te:"Voltage IDX")+"",F,Y,j,W,K,U,H,Z,ne,X;return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),d=p("div"),b=S(v),h=p("br"),M=g(),k=p("input"),T=g(),I=p("div"),C=S(O),B=p("br"),L=g(),z=p("input"),y=g(),V=p("div"),F=S(R),Y=S(`: L1, L2 & L3 + `),j=p("div"),W=p("input"),K=g(),U=p("input"),H=g(),Z=p("input"),c(l,"class","text-sm"),c(a,"href",ql("MQTT-configuration#domoticz")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","o"),u.value="true",c(k,"name","oe"),c(k,"type","text"),c(k,"class","in-f tr w-full"),c(d,"class","w-1/2"),c(z,"name","oc"),c(z,"type","text"),c(z,"class","in-l tr w-full"),c(I,"class","w-1/2"),c(_,"class","my-1 flex"),c(W,"name","ou1"),c(W,"type","text"),c(W,"class","in-f tr w-1/3"),c(U,"name","ou2"),c(U,"type","text"),c(U,"class","in-m tr w-1/3"),c(Z,"name","ou3"),c(Z,"type","text"),c(Z,"class","in-l tr w-1/3"),c(j,"class","flex"),c(V,"class","my-1"),c(e,"class","cnt")},m(ee,oe){E(ee,e,oe),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,d),o(d,b),o(d,h),o(d,M),o(d,k),Me(k,t[6].o.e),o(_,T),o(_,I),o(I,C),o(I,B),o(I,L),o(I,z),Me(z,t[6].o.c),o(e,y),o(e,V),o(V,F),o(V,Y),o(V,j),o(j,W),Me(W,t[6].o.u1),o(j,K),o(j,U),Me(U,t[6].o.u2),o(j,H),o(j,Z),Me(Z,t[6].o.u3),ne||(X=[me(k,"input",t[75]),me(z,"input",t[76]),me(W,"input",t[77]),me(U,"input",t[78]),me(Z,"input",t[79])],ne=!0)},p(ee,oe){var ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t;oe[0]&4&&n!==(n=((de=(Ce=(Pe=(ce=ee[2].conf)==null?void 0:ce.mqtt)==null?void 0:Pe.domoticz)==null?void 0:Ce.title)!=null?de:"Domoticz")+"")&&q(i,n),oe[0]&4&&v!==(v=((be=(ve=(Te=(Ne=ee[2].conf)==null?void 0:Ne.mqtt)==null?void 0:Te.domoticz)==null?void 0:ve.eidx)!=null?be:"Electricity IDX")+"")&&q(b,v),oe[0]&64&&k.value!==ee[6].o.e&&Me(k,ee[6].o.e),oe[0]&4&&O!==(O=((xe=(Ve=(ye=(He=ee[2].conf)==null?void 0:He.mqtt)==null?void 0:ye.domoticz)==null?void 0:Ve.cidx)!=null?xe:"Current IDX")+"")&&q(C,O),oe[0]&64&&z.value!==ee[6].o.c&&Me(z,ee[6].o.c),oe[0]&4&&R!==(R=((_t=(We=(it=(Je=ee[2].conf)==null?void 0:Je.mqtt)==null?void 0:it.domoticz)==null?void 0:We.vidx)!=null?_t:"Voltage IDX")+"")&&q(F,R),oe[0]&64&&W.value!==ee[6].o.u1&&Me(W,ee[6].o.u1),oe[0]&64&&U.value!==ee[6].o.u2&&Me(U,ee[6].o.u2),oe[0]&64&&Z.value!==ee[6].o.u3&&Me(Z,ee[6].o.u3)},d(ee){ee&&P(e),ne=!1,Ht(X)}}}function wa(t){var H,Z,ne,X,$,ae,le,se,fe,re,Q,x,ge,pe,N,w;let e,l,n=((X=(ne=(Z=(H=t[2].conf)==null?void 0:H.mqtt)==null?void 0:Z.ha)==null?void 0:ne.title)!=null?X:"Home-Assistant")+"",i,s,a,r,f,u,m,_,d=((se=(le=(ae=($=t[2].conf)==null?void 0:$.mqtt)==null?void 0:ae.ha)==null?void 0:le.discovery)!=null?se:"Discovery topic prefix")+"",v,b,h,M,k,T,I=((x=(Q=(re=(fe=t[2].conf)==null?void 0:fe.mqtt)==null?void 0:re.ha)==null?void 0:Q.hostname)!=null?x:"Hostname for URL")+"",O,C,B,L,z,y,V,R=((w=(N=(pe=(ge=t[2].conf)==null?void 0:ge.mqtt)==null?void 0:pe.ha)==null?void 0:N.tag)!=null?w:"Name tag")+"",F,Y,j,W,K,U;return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),v=S(d),b=p("br"),h=g(),M=p("input"),k=g(),T=p("div"),O=S(I),C=p("br"),B=g(),L=p("input"),y=g(),V=p("div"),F=S(R),Y=p("br"),j=g(),W=p("input"),c(l,"class","text-sm"),c(a,"href",ql("MQTT-configuration#home-assistant")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","h"),u.value="true",c(M,"name","ht"),c(M,"type","text"),c(M,"class","in-s"),c(M,"placeholder","homeassistant"),c(_,"class","my-1"),c(L,"name","hh"),c(L,"type","text"),c(L,"class","in-s"),c(L,"placeholder",z=t[6].g.h+".local"),c(T,"class","my-1"),c(W,"name","hn"),c(W,"type","text"),c(W,"class","in-s"),c(V,"class","my-1"),c(e,"class","cnt")},m(D,A){E(D,e,A),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,v),o(_,b),o(_,h),o(_,M),Me(M,t[6].h.t),o(e,k),o(e,T),o(T,O),o(T,C),o(T,B),o(T,L),Me(L,t[6].h.h),o(e,y),o(e,V),o(V,F),o(V,Y),o(V,j),o(V,W),Me(W,t[6].h.n),K||(U=[me(M,"input",t[80]),me(L,"input",t[81]),me(W,"input",t[82])],K=!0)},p(D,A){var G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe;A[0]&4&&n!==(n=((oe=(ee=(te=(G=D[2].conf)==null?void 0:G.mqtt)==null?void 0:te.ha)==null?void 0:ee.title)!=null?oe:"Home-Assistant")+"")&&q(i,n),A[0]&4&&d!==(d=((de=(Ce=(Pe=(ce=D[2].conf)==null?void 0:ce.mqtt)==null?void 0:Pe.ha)==null?void 0:Ce.discovery)!=null?de:"Discovery topic prefix")+"")&&q(v,d),A[0]&64&&M.value!==D[6].h.t&&Me(M,D[6].h.t),A[0]&4&&I!==(I=((be=(ve=(Te=(Ne=D[2].conf)==null?void 0:Ne.mqtt)==null?void 0:Te.ha)==null?void 0:ve.hostname)!=null?be:"Hostname for URL")+"")&&q(O,I),A[0]&64&&z!==(z=D[6].g.h+".local")&&c(L,"placeholder",z),A[0]&64&&L.value!==D[6].h.h&&Me(L,D[6].h.h),A[0]&4&&R!==(R=((xe=(Ve=(ye=(He=D[2].conf)==null?void 0:He.mqtt)==null?void 0:ye.ha)==null?void 0:Ve.tag)!=null?xe:"Name tag")+"")&&q(F,R),A[0]&64&&W.value!==D[6].h.n&&Me(W,D[6].h.n)},d(D){D&&P(e),K=!1,Ht(U)}}}function Ca(t){var W,K,U,H,Z,ne,X,$,ae,le,se;let e,l,n=((U=(K=(W=t[2].conf)==null?void 0:W.cloud)==null?void 0:K.title)!=null?U:"Cloud connections")+"",i,s,a,r,f,u,m,_,d,v,b,h=((ne=(Z=(H=t[2].conf)==null?void 0:H.cloud)==null?void 0:Z.ams)!=null?ne:"AMS reader cloud")+"",M,k,T,I,O,C,B,L=((ae=($=(X=t[2].conf)==null?void 0:X.cloud)==null?void 0:$.es)!=null?ae:"Energy Speedometer")+"",z,y,V,R,F,Y=t[5]&&Sa(t),j=((se=(le=t[6])==null?void 0:le.c)==null?void 0:se.es)&&Ma(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),u=p("input"),m=g(),_=p("div"),d=p("label"),v=p("input"),b=g(),M=S(h),k=g(),Y&&Y.c(),T=g(),I=p("div"),O=p("label"),C=p("input"),B=g(),z=S(L),y=g(),j&&j.c(),c(l,"class","text-sm"),c(a,"href",ql("Cloud")),c(a,"target","_blank"),c(a,"class","float-right"),c(u,"type","hidden"),c(u,"name","c"),u.value="true",c(v,"type","checkbox"),c(v,"name","ce"),v.__value="true",v.value=v.__value,c(v,"class","rounded mb-1"),c(_,"class","my-1"),c(C,"type","checkbox"),c(C,"class","rounded mb-1"),c(C,"name","ces"),C.__value="true",C.value=C.__value,c(I,"class","my-1"),c(e,"class","cnt")},m(fe,re){E(fe,e,re),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_),o(_,d),o(d,v),v.checked=t[6].c.e,o(d,b),o(d,M),o(_,k),Y&&Y.m(_,null),o(e,T),o(e,I),o(I,O),o(O,C),C.checked=t[6].c.es,o(O,B),o(O,z),o(I,y),j&&j.m(I,null),V=!0,R||(F=[me(v,"change",t[83]),me(C,"change",t[84])],R=!0)},p(fe,re){var Q,x,ge,pe,N,w,D,A,G,te,ee;(!V||re[0]&4)&&n!==(n=((ge=(x=(Q=fe[2].conf)==null?void 0:Q.cloud)==null?void 0:x.title)!=null?ge:"Cloud connections")+"")&&q(i,n),re[0]&64&&(v.checked=fe[6].c.e),(!V||re[0]&4)&&h!==(h=((w=(N=(pe=fe[2].conf)==null?void 0:pe.cloud)==null?void 0:N.ams)!=null?w:"AMS reader cloud")+"")&&q(M,h),fe[5]?Y?Y.p(fe,re):(Y=Sa(fe),Y.c(),Y.m(_,null)):Y&&(Y.d(1),Y=null),re[0]&64&&(C.checked=fe[6].c.es),(!V||re[0]&4)&&L!==(L=((G=(A=(D=fe[2].conf)==null?void 0:D.cloud)==null?void 0:A.es)!=null?G:"Energy Speedometer")+"")&&q(z,L),(ee=(te=fe[6])==null?void 0:te.c)!=null&&ee.es?j?(j.p(fe,re),re[0]&64&&J(j,1)):(j=Ma(fe),j.c(),J(j,1),j.m(I,null)):j&&(bt(),ie(j,1,1,()=>{j=null}),gt())},i(fe){V||(J(j),V=!0)},o(fe){ie(j),V=!1},d(fe){fe&&P(e),Y&&Y.d(),j&&j.d(),R=!1,Ht(F)}}}function Sa(t){let e,l,n;return{c(){e=p("button"),e.textContent="Connect to my cloud account",c(e,"type","button"),c(e,"class","text-blue-500 ml-6")},m(i,s){E(i,e,s),l||(n=me(e,"click",t[20]),l=!0)},p:Ze,d(i){i&&P(e),l=!1,n()}}}function Ma(t){let e,l,n=t[0].mac+"",i,s,a,r,f=(t[0].meter.id?t[0].meter.id:"missing, required")+"",u,m,_,d,v=t[0].mac&&t[0].meter.id&&Na(t);return{c(){e=p("div"),l=S("MAC: "),i=S(n),s=g(),a=p("div"),r=S("Meter ID: "),u=S(f),m=g(),v&&v.c(),_=$t(),c(e,"class","pl-5"),c(a,"class","pl-5")},m(b,h){E(b,e,h),o(e,l),o(e,i),E(b,s,h),E(b,a,h),o(a,r),o(a,u),E(b,m,h),v&&v.m(b,h),E(b,_,h),d=!0},p(b,h){(!d||h[0]&1)&&n!==(n=b[0].mac+"")&&q(i,n),(!d||h[0]&1)&&f!==(f=(b[0].meter.id?b[0].meter.id:"missing, required")+"")&&q(u,f),b[0].mac&&b[0].meter.id?v?(v.p(b,h),h[0]&1&&J(v,1)):(v=Na(b),v.c(),J(v,1),v.m(_.parentNode,_)):v&&(bt(),ie(v,1,1,()=>{v=null}),gt())},i(b){d||(J(v),d=!0)},o(b){ie(v),d=!1},d(b){b&&P(e),b&&P(s),b&&P(a),b&&P(m),v&&v.d(b),b&&P(_)}}}function Na(t){let e,l,n;return l=new ec({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=p("div"),Oe(l.$$.fragment),c(e,"class","pl-2")},m(i,s){E(i,e,s),Le(l,e,null),n=!0},p(i,s){const a={};s[0]&1&&(a.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(a)},i(i){n||(J(l.$$.fragment,i),n=!0)},o(i){ie(l.$$.fragment,i),n=!1},d(i){i&&P(e),Ie(l)}}}function Ta(t){var R,F,Y,j,W,K,U,H;let e,l,n=((Y=(F=(R=t[2].conf)==null?void 0:R.thresholds)==null?void 0:F.title)!=null?Y:"Thresholds")+"",i,s,a,r,f,u,m,_,d,v,b,h=((K=(W=(j=t[2].conf)==null?void 0:j.thresholds)==null?void 0:W.avg)!=null?K:"Average of")+"",M,k,T,I,O,C=((H=(U=t[2].common)==null?void 0:U.hours)!=null?H:"hours")+"",B,L,z,y={length:9},V=[];for(let Z=0;Zt[88].call(k)),c(v,"class","w-1/2"),c(_,"class","flex flex-wrap"),c(e,"class","cnt")},m(j,W){E(j,e,W),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),o(e,u),o(e,m),o(e,_);for(let K=0;K20&&La(t),v=((O=(I=(T=t[6])==null?void 0:T.i)==null?void 0:I.d)==null?void 0:O.d)>0&&Ra(t),b=t[0].chip=="esp8266"&&Fa(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),r=S("\u24D8"),f=g(),d&&d.c(),u=g(),v&&v.c(),m=g(),b&&b.c(),c(l,"class","text-sm"),c(a,"href",ql("GPIO-configuration")),c(a,"target","_blank"),c(a,"class","float-right"),c(e,"class","cnt")},m(C,B){E(C,e,B),o(e,l),o(l,i),o(e,s),o(e,a),o(a,r),o(e,f),d&&d.m(e,null),o(e,u),v&&v.m(e,null),o(e,m),b&&b.m(e,null),_=!0},p(C,B){var L,z,y,V,R,F;(!_||B[0]&4)&&n!==(n=((y=(z=(L=C[2].conf)==null?void 0:L.hw)==null?void 0:z.title)!=null?y:"Hardware")+"")&&q(i,n),C[0].board>20?d?(d.p(C,B),B[0]&1&&J(d,1)):(d=La(C),d.c(),J(d,1),d.m(e,u)):d&&(bt(),ie(d,1,1,()=>{d=null}),gt()),((F=(R=(V=C[6])==null?void 0:V.i)==null?void 0:R.d)==null?void 0:F.d)>0?v?v.p(C,B):(v=Ra(C),v.c(),v.m(e,m)):v&&(v.d(1),v=null),C[0].chip=="esp8266"?b?b.p(C,B):(b=Fa(C),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(C){_||(J(d),_=!0)},o(C){ie(d),_=!1},d(C){C&&P(e),d&&d.d(),v&&v.d(),b&&b.d()}}}function La(t){var ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt,qe,Ge,Qt,el,xt,Se,Re,Fe,il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl,Be,et;let e,l,n,i,s=((ct=(Pt=(Rt=(ht=t[2].conf)==null?void 0:ht.hw)==null?void 0:Rt.han)==null?void 0:Pt.rx)!=null?ct:"HAN RX")+"",a,r,f,u,m,_,d,v=((Ut=(Bt=(zt=(Ft=t[2].conf)==null?void 0:Ft.hw)==null?void 0:zt.han)==null?void 0:Bt.tx)!=null?Ut:"HAN TX")+"",b,h,M,k,T,I,O,C,B,L,z=((Vt=(Gt=(yt=(qt=t[2].conf)==null?void 0:qt.hw)==null?void 0:yt.han)==null?void 0:Gt.pullup)!=null?Vt:"pullup")+"",y,V,R,F,Y=((Mt=(Ct=(Yt=t[2].conf)==null?void 0:Yt.hw)==null?void 0:Ct.ap_btn)!=null?Mt:"AP button")+"",j,W,K,U,H,Z,ne=((dt=(Et=(Nt=(ft=t[2].conf)==null?void 0:ft.hw)==null?void 0:Nt.led)==null?void 0:Et.title)!=null?dt:"LED")+"",X,$,ae,le,se,fe,re,Q,x,ge,pe=((qe=(mt=(St=(At=t[2].conf)==null?void 0:At.hw)==null?void 0:St.led)==null?void 0:mt.inverted)!=null?qe:"inverted")+"",N,w,D,A=((xt=(el=(Qt=(Ge=t[2].conf)==null?void 0:Ge.hw)==null?void 0:Qt.led)==null?void 0:el.rgb)!=null?xt:"RGB")+"",G,te,ee,oe,ce=((il=(Fe=(Re=(Se=t[2].conf)==null?void 0:Se.hw)==null?void 0:Re.led)==null?void 0:Fe.inverted)!=null?il:"inverted")+"",Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it=((fl=(al=(ol=(sl=t[2].conf)==null?void 0:sl.hw)==null?void 0:ol.led)==null?void 0:al.disable)!=null?fl:"LED dis. GPIO")+"",We,_t,Ee,_e,Ue,kt=((cl=(rl=(ul=t[2].conf)==null?void 0:ul.hw)==null?void 0:rl.temp)!=null?cl:"Temperature")+"",wt,nt,vt,ze,Ke,Ye,Xe=((pl=(_l=(ml=t[2].conf)==null?void 0:ml.hw)==null?void 0:_l.temp_analog)!=null?pl:"Analog temp")+"",Qe,ut,we,Ae,ke,ue,De,rt,st;m=new Hi({props:{chip:t[0].chip}}),T=new Hi({props:{chip:t[0].chip}});let at=t[0].chip!="esp8266"&&Ia(t),pt=((et=(Be=(dl=t[6])==null?void 0:dl.i)==null?void 0:Be.v)==null?void 0:et.p)>0&&Oa(t);return{c(){e=p("input"),l=g(),n=p("div"),i=p("div"),a=S(s),r=p("br"),f=g(),u=p("select"),Oe(m.$$.fragment),_=g(),d=p("div"),b=S(v),h=p("br"),M=g(),k=p("select"),Oe(T.$$.fragment),I=g(),O=p("div"),C=p("label"),B=p("input"),L=g(),y=S(z),V=g(),R=p("div"),F=p("div"),j=S(Y),W=p("br"),K=g(),U=p("input"),H=g(),Z=p("div"),X=S(ne),$=p("br"),ae=g(),le=p("div"),se=p("input"),fe=g(),re=p("div"),Q=p("label"),x=p("input"),ge=g(),N=S(pe),w=g(),D=p("div"),G=S(A),te=p("label"),ee=p("input"),oe=g(),Pe=S(ce),Ce=p("br"),de=g(),Ne=p("div"),Te=p("input"),ve=g(),be=p("input"),He=g(),ye=p("input"),Ve=g(),xe=p("div"),Je=p("div"),We=S(it),_t=g(),Ee=p("input"),_e=g(),Ue=p("div"),wt=S(kt),nt=p("br"),vt=g(),ze=p("input"),Ke=g(),Ye=p("div"),Qe=S(Xe),ut=p("br"),we=g(),Ae=p("input"),ke=g(),at&&at.c(),ue=g(),pt&&pt.c(),c(e,"type","hidden"),c(e,"name","i"),e.value="true",c(u,"name","ihp"),c(u,"class","in-f w-full"),t[6].i.h.p===void 0&&Wt(()=>t[89].call(u)),c(i,"class","w-1/3"),c(k,"name","iht"),c(k,"class","in-l w-full"),t[6].i.h.t===void 0&&Wt(()=>t[90].call(k)),c(d,"class","w-1/3"),c(B,"name","ihu"),B.__value="true",B.value=B.__value,c(B,"type","checkbox"),c(B,"class","rounded mb-1"),c(C,"class","ml-2"),c(O,"class","w-1/3"),c(n,"class","flex flex-wrap"),c(U,"name","ia"),c(U,"type","number"),c(U,"min","0"),c(U,"max",t[10]),c(U,"class","in-f tr w-full"),c(F,"class","w-1/3"),c(se,"name","ilp"),c(se,"type","number"),c(se,"min","0"),c(se,"max",t[10]),c(se,"class","in-l tr w-full"),c(le,"class","flex"),c(Z,"class","w-1/3"),c(x,"name","ili"),x.__value="true",x.value=x.__value,c(x,"type","checkbox"),c(x,"class","rounded mb-1"),c(Q,"class","ml-4"),c(re,"class","w-1/3"),c(ee,"name","iri"),ee.__value="true",ee.value=ee.__value,c(ee,"type","checkbox"),c(ee,"class","rounded mb-1"),c(te,"class","ml-4"),c(Te,"name","irr"),c(Te,"type","number"),c(Te,"min","0"),c(Te,"max",t[10]),c(Te,"class","in-f tr w-1/3"),c(be,"name","irg"),c(be,"type","number"),c(be,"min","0"),c(be,"max",t[10]),c(be,"class","in-m tr w-1/3"),c(ye,"name","irb"),c(ye,"type","number"),c(ye,"min","0"),c(ye,"max",t[10]),c(ye,"class","in-l tr w-1/3"),c(Ne,"class","flex"),c(D,"class","w-full"),c(Ee,"name","idd"),c(Ee,"type","number"),c(Ee,"min","0"),c(Ee,"max",t[10]),c(Ee,"class","in-s tr"),c(Je,"class","my-1 pr-1 w-1/3"),c(xe,"class","w-full"),c(ze,"name","itd"),c(ze,"type","number"),c(ze,"min","0"),c(ze,"max",t[10]),c(ze,"class","in-f tr w-full"),c(Ue,"class","my-1 w-1/3"),c(Ae,"name","ita"),c(Ae,"type","number"),c(Ae,"min","0"),c(Ae,"max",t[10]),c(Ae,"class","in-l tr w-full"),c(Ye,"class","my-1 pr-1 w-1/3"),c(R,"class","flex flex-wrap")},m(je,he){E(je,e,he),E(je,l,he),E(je,n,he),o(n,i),o(i,a),o(i,r),o(i,f),o(i,u),Le(m,u,null),ot(u,t[6].i.h.p,!0),o(n,_),o(n,d),o(d,b),o(d,h),o(d,M),o(d,k),Le(T,k,null),ot(k,t[6].i.h.t,!0),o(n,I),o(n,O),o(O,C),o(C,B),B.checked=t[6].i.h.u,o(C,L),o(C,y),E(je,V,he),E(je,R,he),o(R,F),o(F,j),o(F,W),o(F,K),o(F,U),Me(U,t[6].i.a),o(R,H),o(R,Z),o(Z,X),o(Z,$),o(Z,ae),o(Z,le),o(le,se),Me(se,t[6].i.l.p),o(R,fe),o(R,re),o(re,Q),o(Q,x),x.checked=t[6].i.l.i,o(Q,ge),o(Q,N),o(R,w),o(R,D),o(D,G),o(D,te),o(te,ee),ee.checked=t[6].i.r.i,o(te,oe),o(te,Pe),o(D,Ce),o(D,de),o(D,Ne),o(Ne,Te),Me(Te,t[6].i.r.r),o(Ne,ve),o(Ne,be),Me(be,t[6].i.r.g),o(Ne,He),o(Ne,ye),Me(ye,t[6].i.r.b),o(R,Ve),o(R,xe),o(xe,Je),o(Je,We),o(Je,_t),o(Je,Ee),Me(Ee,t[6].i.d.d),o(R,_e),o(R,Ue),o(Ue,wt),o(Ue,nt),o(Ue,vt),o(Ue,ze),Me(ze,t[6].i.t.d),o(R,Ke),o(R,Ye),o(Ye,Qe),o(Ye,ut),o(Ye,we),o(Ye,Ae),Me(Ae,t[6].i.t.a),o(R,ke),at&&at.m(R,null),o(R,ue),pt&&pt.m(R,null),De=!0,rt||(st=[me(u,"change",t[89]),me(k,"change",t[90]),me(B,"change",t[91]),me(U,"input",t[92]),me(se,"input",t[93]),me(x,"change",t[94]),me(ee,"change",t[95]),me(Te,"input",t[96]),me(be,"input",t[97]),me(ye,"input",t[98]),me(Ee,"input",t[99]),me(ze,"input",t[100]),me(Ae,"input",t[101])],rt=!0)},p(je,he){var Cl,Sl,Ml,Nl,Tl,Pl,El,Dl,Rl,Fl,Bl,Ul,tt,Ot,vl,bl,pn,dn,vn,hn,bn,gn,kn,wn,Cn,Sn,Mn,Nn,Tn,Pn,En,Dn,qn,An,Ln,In,On,Rn,Fn,Bn,Un,jn,yn,Hn;(!De||he[0]&4)&&s!==(s=((Nl=(Ml=(Sl=(Cl=je[2].conf)==null?void 0:Cl.hw)==null?void 0:Sl.han)==null?void 0:Ml.rx)!=null?Nl:"HAN RX")+"")&&q(a,s);const Kt={};he[0]&1&&(Kt.chip=je[0].chip),m.$set(Kt),he[0]&64&&ot(u,je[6].i.h.p),(!De||he[0]&4)&&v!==(v=((Dl=(El=(Pl=(Tl=je[2].conf)==null?void 0:Tl.hw)==null?void 0:Pl.han)==null?void 0:El.tx)!=null?Dl:"HAN TX")+"")&&q(b,v);const wl={};he[0]&1&&(wl.chip=je[0].chip),T.$set(wl),he[0]&64&&ot(k,je[6].i.h.t),he[0]&64&&(B.checked=je[6].i.h.u),(!De||he[0]&4)&&z!==(z=((Ul=(Bl=(Fl=(Rl=je[2].conf)==null?void 0:Rl.hw)==null?void 0:Fl.han)==null?void 0:Bl.pullup)!=null?Ul:"pullup")+"")&&q(y,z),(!De||he[0]&4)&&Y!==(Y=((vl=(Ot=(tt=je[2].conf)==null?void 0:tt.hw)==null?void 0:Ot.ap_btn)!=null?vl:"AP button")+"")&&q(j,Y),(!De||he[0]&1024)&&c(U,"max",je[10]),he[0]&64&&$e(U.value)!==je[6].i.a&&Me(U,je[6].i.a),(!De||he[0]&4)&&ne!==(ne=((vn=(dn=(pn=(bl=je[2].conf)==null?void 0:bl.hw)==null?void 0:pn.led)==null?void 0:dn.title)!=null?vn:"LED")+"")&&q(X,ne),(!De||he[0]&1024)&&c(se,"max",je[10]),he[0]&64&&$e(se.value)!==je[6].i.l.p&&Me(se,je[6].i.l.p),he[0]&64&&(x.checked=je[6].i.l.i),(!De||he[0]&4)&&pe!==(pe=((kn=(gn=(bn=(hn=je[2].conf)==null?void 0:hn.hw)==null?void 0:bn.led)==null?void 0:gn.inverted)!=null?kn:"inverted")+"")&&q(N,pe),(!De||he[0]&4)&&A!==(A=((Mn=(Sn=(Cn=(wn=je[2].conf)==null?void 0:wn.hw)==null?void 0:Cn.led)==null?void 0:Sn.rgb)!=null?Mn:"RGB")+"")&&q(G,A),he[0]&64&&(ee.checked=je[6].i.r.i),(!De||he[0]&4)&&ce!==(ce=((En=(Pn=(Tn=(Nn=je[2].conf)==null?void 0:Nn.hw)==null?void 0:Tn.led)==null?void 0:Pn.inverted)!=null?En:"inverted")+"")&&q(Pe,ce),(!De||he[0]&1024)&&c(Te,"max",je[10]),he[0]&64&&$e(Te.value)!==je[6].i.r.r&&Me(Te,je[6].i.r.r),(!De||he[0]&1024)&&c(be,"max",je[10]),he[0]&64&&$e(be.value)!==je[6].i.r.g&&Me(be,je[6].i.r.g),(!De||he[0]&1024)&&c(ye,"max",je[10]),he[0]&64&&$e(ye.value)!==je[6].i.r.b&&Me(ye,je[6].i.r.b),(!De||he[0]&4)&&it!==(it=((Ln=(An=(qn=(Dn=je[2].conf)==null?void 0:Dn.hw)==null?void 0:qn.led)==null?void 0:An.disable)!=null?Ln:"LED dis. GPIO")+"")&&q(We,it),(!De||he[0]&1024)&&c(Ee,"max",je[10]),he[0]&64&&$e(Ee.value)!==je[6].i.d.d&&Me(Ee,je[6].i.d.d),(!De||he[0]&4)&&kt!==(kt=((Rn=(On=(In=je[2].conf)==null?void 0:In.hw)==null?void 0:On.temp)!=null?Rn:"Temperature")+"")&&q(wt,kt),(!De||he[0]&1024)&&c(ze,"max",je[10]),he[0]&64&&$e(ze.value)!==je[6].i.t.d&&Me(ze,je[6].i.t.d),(!De||he[0]&4)&&Xe!==(Xe=((Un=(Bn=(Fn=je[2].conf)==null?void 0:Fn.hw)==null?void 0:Bn.temp_analog)!=null?Un:"Analog temp")+"")&&q(Qe,Xe),(!De||he[0]&1024)&&c(Ae,"max",je[10]),he[0]&64&&$e(Ae.value)!==je[6].i.t.a&&Me(Ae,je[6].i.t.a),je[0].chip!="esp8266"?at?at.p(je,he):(at=Ia(je),at.c(),at.m(R,ue)):at&&(at.d(1),at=null),((Hn=(yn=(jn=je[6])==null?void 0:jn.i)==null?void 0:yn.v)==null?void 0:Hn.p)>0?pt?pt.p(je,he):(pt=Oa(je),pt.c(),pt.m(R,null)):pt&&(pt.d(1),pt=null)},i(je){De||(J(m.$$.fragment,je),J(T.$$.fragment,je),De=!0)},o(je){ie(m.$$.fragment,je),ie(T.$$.fragment,je),De=!1},d(je){je&&P(e),je&&P(l),je&&P(n),Ie(m),Ie(T),je&&P(V),je&&P(R),at&&at.d(),pt&&pt.d(),rt=!1,Ht(st)}}}function Ia(t){var u,m,_,d;let e,l=((d=(_=(m=(u=t[2].conf)==null?void 0:u.hw)==null?void 0:m.vcc)==null?void 0:_.title)!=null?d:"Vcc")+"",n,i,s,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),c(a,"name","ivp"),c(a,"type","number"),c(a,"min","0"),c(a,"max",t[10]),c(a,"class","in-s tr w-full"),c(e,"class","my-1 pl-1 w-1/3")},m(v,b){E(v,e,b),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].i.v.p),r||(f=me(a,"input",t[102]),r=!0)},p(v,b){var h,M,k,T;b[0]&4&&l!==(l=((T=(k=(M=(h=v[2].conf)==null?void 0:h.hw)==null?void 0:M.vcc)==null?void 0:k.title)!=null?T:"Vcc")+"")&&q(n,l),b[0]&1024&&c(a,"max",v[10]),b[0]&64&&$e(a.value)!==v[6].i.v.p&&Me(a,v[6].i.v.p)},d(v){v&&P(e),r=!1,f()}}}function Oa(t){var b,h,M,k;let e,l=((k=(M=(h=(b=t[2].conf)==null?void 0:b.hw)==null?void 0:h.vcc)==null?void 0:M.divider)!=null?k:"Voltage divider")+"",n,i,s,a,r,f,u,m,_,d,v;return{c(){var T,I,O,C,B,L,z,y;e=p("div"),n=S(l),i=p("br"),s=g(),a=p("div"),r=p("input"),u=g(),m=p("input"),c(r,"name","ivdv"),c(r,"type","number"),c(r,"min","0"),c(r,"max","65535"),c(r,"class","in-f tr w-full"),c(r,"placeholder",f=(C=(O=(I=(T=t[2].conf)==null?void 0:T.hw)==null?void 0:I.vcc)==null?void 0:O.div_vcc)!=null?C:"VCC"),c(m,"name","ivdg"),c(m,"type","number"),c(m,"min","0"),c(m,"max","65535"),c(m,"class","in-l tr w-full"),c(m,"placeholder",_=(y=(z=(L=(B=t[2].conf)==null?void 0:B.hw)==null?void 0:L.vcc)==null?void 0:z.div_gnd)!=null?y:"GND"),c(a,"class","flex"),c(e,"class","my-1")},m(T,I){E(T,e,I),o(e,n),o(e,i),o(e,s),o(e,a),o(a,r),Me(r,t[6].i.v.d.v),o(a,u),o(a,m),Me(m,t[6].i.v.d.g),d||(v=[me(r,"input",t[103]),me(m,"input",t[104])],d=!0)},p(T,I){var O,C,B,L,z,y,V,R,F,Y,j,W;I[0]&4&&l!==(l=((L=(B=(C=(O=T[2].conf)==null?void 0:O.hw)==null?void 0:C.vcc)==null?void 0:B.divider)!=null?L:"Voltage divider")+"")&&q(n,l),I[0]&4&&f!==(f=(R=(V=(y=(z=T[2].conf)==null?void 0:z.hw)==null?void 0:y.vcc)==null?void 0:V.div_vcc)!=null?R:"VCC")&&c(r,"placeholder",f),I[0]&64&&$e(r.value)!==T[6].i.v.d.v&&Me(r,T[6].i.v.d.v),I[0]&4&&_!==(_=(W=(j=(Y=(F=T[2].conf)==null?void 0:F.hw)==null?void 0:Y.vcc)==null?void 0:j.div_gnd)!=null?W:"GND")&&c(m,"placeholder",_),I[0]&64&&$e(m.value)!==T[6].i.v.d.g&&Me(m,T[6].i.v.d.g)},d(T){T&&P(e),d=!1,Ht(v)}}}function Ra(t){var b,h,M,k,T,I,O,C,B,L,z,y,V,R,F;let e,l=((T=(k=(M=(h=(b=t[2].conf)==null?void 0:b.hw)==null?void 0:h.led)==null?void 0:M.behaviour)==null?void 0:k.title)!=null?T:"LED behaviour")+"",n,i,s,a,r=((L=(B=(C=(O=(I=t[2].conf)==null?void 0:I.hw)==null?void 0:O.led)==null?void 0:C.behaviour)==null?void 0:B.enabled)!=null?L:"Enabled")+"",f,u,m=((F=(R=(V=(y=(z=t[2].conf)==null?void 0:z.hw)==null?void 0:y.led)==null?void 0:V.behaviour)==null?void 0:R.disabled)!=null?F:"Disabled")+"",_,d,v;return{c(){e=p("div"),n=S(l),i=g(),s=p("select"),a=p("option"),f=S(r),u=p("option"),_=S(m),a.__value=0,a.value=a.__value,u.__value=1,u.value=u.__value,c(s,"name","idb"),c(s,"class","in-s"),t[6].i.d.b===void 0&&Wt(()=>t[105].call(s)),c(e,"class","my-1 w-full")},m(Y,j){E(Y,e,j),o(e,n),o(e,i),o(e,s),o(s,a),o(a,f),o(s,u),o(u,_),ot(s,t[6].i.d.b,!0),d||(v=me(s,"change",t[105]),d=!0)},p(Y,j){var W,K,U,H,Z,ne,X,$,ae,le,se,fe,re,Q,x;j[0]&4&&l!==(l=((Z=(H=(U=(K=(W=Y[2].conf)==null?void 0:W.hw)==null?void 0:K.led)==null?void 0:U.behaviour)==null?void 0:H.title)!=null?Z:"LED behaviour")+"")&&q(n,l),j[0]&4&&r!==(r=((le=(ae=($=(X=(ne=Y[2].conf)==null?void 0:ne.hw)==null?void 0:X.led)==null?void 0:$.behaviour)==null?void 0:ae.enabled)!=null?le:"Enabled")+"")&&q(f,r),j[0]&4&&m!==(m=((x=(Q=(re=(fe=(se=Y[2].conf)==null?void 0:se.hw)==null?void 0:fe.led)==null?void 0:re.behaviour)==null?void 0:Q.disabled)!=null?x:"Disabled")+"")&&q(_,m),j[0]&64&&ot(s,Y[6].i.d.b)},d(Y){Y&&P(e),d=!1,v()}}}function Fa(t){var C,B,L,z,y,V,R,F;let e,l,n,i,s=((z=(L=(B=(C=t[2].conf)==null?void 0:C.hw)==null?void 0:B.vcc)==null?void 0:L.offset)!=null?z:"Vcc offset")+"",a,r,f,u,m,_,d=((F=(R=(V=(y=t[2].conf)==null?void 0:y.hw)==null?void 0:V.vcc)==null?void 0:R.multiplier)!=null?F:"Multiplier")+"",v,b,h,M,k,T,I,O=(t[0].board==2||t[0].board==100)&&Ba(t);return{c(){e=p("input"),l=g(),n=p("div"),i=p("div"),a=S(s),r=p("br"),f=g(),u=p("input"),m=g(),_=p("div"),v=S(d),b=p("br"),h=g(),M=p("input"),k=g(),O&&O.c(),c(e,"type","hidden"),c(e,"name","iv"),e.value="true",c(u,"name","ivo"),c(u,"type","number"),c(u,"min","0.0"),c(u,"max","3.5"),c(u,"step","0.01"),c(u,"class","in-f tr w-full"),c(i,"class","w-1/3"),c(M,"name","ivm"),c(M,"type","number"),c(M,"min","0.1"),c(M,"max","10"),c(M,"step","0.01"),c(M,"class","in-l tr w-full"),c(_,"class","w-1/3 pr-1"),c(n,"class","my-1 flex flex-wrap")},m(Y,j){E(Y,e,j),E(Y,l,j),E(Y,n,j),o(n,i),o(i,a),o(i,r),o(i,f),o(i,u),Me(u,t[6].i.v.o),o(n,m),o(n,_),o(_,v),o(_,b),o(_,h),o(_,M),Me(M,t[6].i.v.m),o(n,k),O&&O.m(n,null),T||(I=[me(u,"input",t[106]),me(M,"input",t[107])],T=!0)},p(Y,j){var W,K,U,H,Z,ne,X,$;j[0]&4&&s!==(s=((H=(U=(K=(W=Y[2].conf)==null?void 0:W.hw)==null?void 0:K.vcc)==null?void 0:U.offset)!=null?H:"Vcc offset")+"")&&q(a,s),j[0]&64&&$e(u.value)!==Y[6].i.v.o&&Me(u,Y[6].i.v.o),j[0]&4&&d!==(d=(($=(X=(ne=(Z=Y[2].conf)==null?void 0:Z.hw)==null?void 0:ne.vcc)==null?void 0:X.multiplier)!=null?$:"Multiplier")+"")&&q(v,d),j[0]&64&&$e(M.value)!==Y[6].i.v.m&&Me(M,Y[6].i.v.m),Y[0].board==2||Y[0].board==100?O?O.p(Y,j):(O=Ba(Y),O.c(),O.m(n,null)):O&&(O.d(1),O=null)},d(Y){Y&&P(e),Y&&P(l),Y&&P(n),O&&O.d(),T=!1,Ht(I)}}}function Ba(t){var u,m,_,d;let e,l=((d=(_=(m=(u=t[2].conf)==null?void 0:u.hw)==null?void 0:m.vcc)==null?void 0:_.boot)!=null?d:"Boot limit")+"",n,i,s,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),c(a,"name","ivb"),c(a,"type","number"),c(a,"min","2.5"),c(a,"max","3.5"),c(a,"step","0.1"),c(a,"class","in-s tr w-full"),c(e,"class","w-1/3 pl-1")},m(v,b){E(v,e,b),o(e,n),o(e,i),o(e,s),o(e,a),Me(a,t[6].i.v.b),r||(f=me(a,"input",t[108]),r=!0)},p(v,b){var h,M,k,T;b[0]&4&&l!==(l=((T=(k=(M=(h=v[2].conf)==null?void 0:h.hw)==null?void 0:M.vcc)==null?void 0:k.boot)!=null?T:"Boot limit")+"")&&q(n,l),b[0]&64&&$e(a.value)!==v[6].i.v.b&&Me(a,v[6].i.v.b)},d(v){v&&P(e),r=!1,f()}}}function Ua(t){var O,C,B,L,z,y,V,R;let e,l,n=((B=(C=(O=t[2].conf)==null?void 0:O.debug)==null?void 0:C.title)!=null?B:"Debugging")+"",i,s,a,r,f,u,m,_,d,v,b=((y=(z=(L=t[2].conf)==null?void 0:L.debug)==null?void 0:z.enable)!=null?y:"Enable debugging")+"",h,M,k,T,I=((R=(V=t[6])==null?void 0:V.d)==null?void 0:R.s)&&ja(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("a"),a.textContent="\u24D8",r=g(),f=p("input"),u=g(),m=p("div"),_=p("label"),d=p("input"),v=g(),h=S(b),M=g(),I&&I.c(),c(l,"class","text-sm"),c(a,"href","https://amsleser.no/blog/post/24-telnet-debug"),c(a,"target","_blank"),c(a,"class","float-right"),c(f,"type","hidden"),c(f,"name","d"),f.value="true",c(d,"type","checkbox"),c(d,"name","ds"),d.__value="true",d.value=d.__value,c(d,"class","rounded mb-1"),c(m,"class","mt-3"),c(e,"class","cnt")},m(F,Y){E(F,e,Y),o(e,l),o(l,i),o(e,s),o(e,a),o(e,r),o(e,f),o(e,u),o(e,m),o(m,_),o(_,d),d.checked=t[6].d.s,o(_,v),o(_,h),o(e,M),I&&I.m(e,null),k||(T=me(d,"change",t[109]),k=!0)},p(F,Y){var j,W,K,U,H,Z,ne,X;Y[0]&4&&n!==(n=((K=(W=(j=F[2].conf)==null?void 0:j.debug)==null?void 0:W.title)!=null?K:"Debugging")+"")&&q(i,n),Y[0]&64&&(d.checked=F[6].d.s),Y[0]&4&&b!==(b=((Z=(H=(U=F[2].conf)==null?void 0:U.debug)==null?void 0:H.enable)!=null?Z:"Enable debugging")+"")&&q(h,b),(X=(ne=F[6])==null?void 0:ne.d)!=null&&X.s?I?I.p(F,Y):(I=ja(F),I.c(),I.m(e,null)):I&&(I.d(1),I=null)},d(F){F&&P(e),I&&I.d(),k=!1,T()}}}function ja(t){var B,L,z,y,V,R;let e,l=((z=(L=(B=t[2].conf)==null?void 0:B.debug)==null?void 0:L.danger)!=null?z:"Disable when done")+"",n,i,s,a,r,f,u=((R=(V=(y=t[2].conf)==null?void 0:y.debug)==null?void 0:V.telnet)!=null?R:"Enable telnet")+"",m,_,d,v,b,h,M,k,T,I,O,C=t[6].d.t&&ya(t);return{c(){e=p("div"),n=S(l),i=g(),s=p("div"),a=p("label"),r=p("input"),f=g(),m=S(u),_=g(),C&&C.c(),d=g(),v=p("div"),b=p("select"),h=p("option"),h.textContent="Verbose",M=p("option"),M.textContent="Debug",k=p("option"),k.textContent="Info",T=p("option"),T.textContent="Warning",c(e,"class","bd-red"),c(r,"type","checkbox"),c(r,"name","dt"),r.__value="true",r.value=r.__value,c(r,"class","rounded mb-1"),c(s,"class","my-1"),h.__value=1,h.value=h.__value,M.__value=2,M.value=M.__value,k.__value=3,k.value=k.__value,T.__value=4,T.value=T.__value,c(b,"name","dl"),c(b,"class","in-s"),t[6].d.l===void 0&&Wt(()=>t[111].call(b)),c(v,"class","my-1")},m(F,Y){E(F,e,Y),o(e,n),E(F,i,Y),E(F,s,Y),o(s,a),o(a,r),r.checked=t[6].d.t,o(a,f),o(a,m),E(F,_,Y),C&&C.m(F,Y),E(F,d,Y),E(F,v,Y),o(v,b),o(b,h),o(b,M),o(b,k),o(b,T),ot(b,t[6].d.l,!0),I||(O=[me(r,"change",t[110]),me(b,"change",t[111])],I=!0)},p(F,Y){var j,W,K,U,H,Z;Y[0]&4&&l!==(l=((K=(W=(j=F[2].conf)==null?void 0:j.debug)==null?void 0:W.danger)!=null?K:"Disable when done")+"")&&q(n,l),Y[0]&64&&(r.checked=F[6].d.t),Y[0]&4&&u!==(u=((Z=(H=(U=F[2].conf)==null?void 0:U.debug)==null?void 0:H.telnet)!=null?Z:"Enable telnet")+"")&&q(m,u),F[6].d.t?C?C.p(F,Y):(C=ya(F),C.c(),C.m(d.parentNode,d)):C&&(C.d(1),C=null),Y[0]&64&&ot(b,F[6].d.l)},d(F){F&&P(e),F&&P(i),F&&P(s),F&&P(_),C&&C.d(F),F&&P(d),F&&P(v),I=!1,Ht(O)}}}function ya(t){var i,s,a;let e,l=((a=(s=(i=t[2].conf)==null?void 0:i.debug)==null?void 0:s.telnet_danger)!=null?a:"Disable when done")+"",n;return{c(){e=p("div"),n=S(l),c(e,"class","bd-red")},m(r,f){E(r,e,f),o(e,n)},p(r,f){var u,m,_;f[0]&4&&l!==(l=((_=(m=(u=r[2].conf)==null?void 0:u.debug)==null?void 0:m.telnet_danger)!=null?_:"Disable when done")+"")&&q(n,l)},d(r){r&&P(e)}}}function Ha(t){var d,v,b,h;let e,l,n=((v=(d=t[2].conf)==null?void 0:d.btn_reset)!=null?v:"Factory reset")+"",i,s,a,r,f=((h=(b=t[2].btn)==null?void 0:b.reboot)!=null?h:"Reboot")+"",u,m,_;return{c(){e=p("div"),l=p("button"),i=S(n),s=g(),a=p("div"),r=p("button"),u=S(f),c(l,"type","button"),c(l,"class","btn-red"),c(r,"type","button"),c(r,"class","btn-yellow"),c(a,"class","text-center")},m(M,k){E(M,e,k),o(e,l),o(l,i),E(M,s,k),E(M,a,k),o(a,r),o(r,u),m||(_=[me(l,"click",t[12]),me(r,"click",t[14])],m=!0)},p(M,k){var T,I,O,C;k[0]&4&&n!==(n=((I=(T=M[2].conf)==null?void 0:T.btn_reset)!=null?I:"Factory reset")+"")&&q(i,n),k[0]&4&&f!==(f=((C=(O=M[2].btn)==null?void 0:O.reboot)!=null?C:"Reboot")+"")&&q(u,f)},d(M){M&&P(e),M&&P(s),M&&P(a),m=!1,Ht(_)}}}function za(t){var s,a;let e,l,n=((a=(s=t[2].btn)==null?void 0:s.save)!=null?a:"Save")+"",i;return{c(){e=p("div"),l=p("button"),i=S(n),c(l,"type","submit"),c(l,"class","btn-pri"),c(e,"class","text-right")},m(r,f){E(r,e,f),o(e,l),o(l,i)},p(r,f){var u,m;f[0]&4&&n!==(n=((m=(u=r[2].btn)==null?void 0:u.save)!=null?m:"Save")+"")&&q(i,n)},d(r){r&&P(e)}}}function kc(t){var Q,x,ge,pe,N,w,D,A,G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t,Ee,_e,Ue,kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut,we,Ae;let e,l,n,i,s,a,r,f,u,m,_=((ge=(x=(Q=t[6])==null?void 0:Q.p)==null?void 0:x.r)==null?void 0:ge.startsWith("NO"))||((w=(N=(pe=t[6])==null?void 0:pe.p)==null?void 0:N.r)==null?void 0:w.startsWith("10YNO"))||((G=(A=(D=t[6])==null?void 0:D.p)==null?void 0:A.r)==null?void 0:G.startsWith("10Y1001A1001A4")),d,v,b,h=((te=t[6])==null?void 0:te.d)&&((oe=(ee=t[0])==null?void 0:ee.features)==null?void 0:oe.includes("rdebug")),M,k,T,I,O,C,B,L,z,y,V,R,F,Y,j=((ce=t[6])==null?void 0:ce.g)&&na(t),W=((Pe=t[6])==null?void 0:Pe.m)&&aa(t),K=((Ce=t[6])==null?void 0:Ce.w)&&ma(t),U=((de=t[6])==null?void 0:de.n)&&da(t),H=((Ne=t[6])==null?void 0:Ne.q)&&ha(t),Z=((ve=(Te=t[6])==null?void 0:Te.q)==null?void 0:ve.m)==3&&ka(t),ne=((He=(be=t[6])==null?void 0:be.q)==null?void 0:He.m)==4&&wa(t),X=((ye=t[6])==null?void 0:ye.c)&&Ca(t),$=_&&Ta(t),ae=((Ve=t[6])==null?void 0:Ve.u)&&Ea(t),le=((Je=(xe=t[6])==null?void 0:xe.i)==null?void 0:Je.h)&&(((it=t[0])==null?void 0:it.board)>20||((We=t[0])==null?void 0:We.chip)=="esp8266"||((_e=(Ee=(_t=t[6])==null?void 0:_t.i)==null?void 0:Ee.d)==null?void 0:_e.d)>0)&&Aa(t),se=h&&Ua(t),fe=((Ue=t[1])==null?void 0:Ue.a)&&Ha(t),re=t[6]&&za(t);return O=new hl({props:{active:t[3],message:(nt=(wt=(kt=t[2].conf)==null?void 0:kt.mask)==null?void 0:wt.loading)!=null?nt:"Loading"}}),B=new hl({props:{active:t[4],message:(Ke=(ze=(vt=t[2].conf)==null?void 0:vt.mask)==null?void 0:ze.saving)!=null?Ke:"Saving"}}),z=new hl({props:{active:t[8],message:(Qe=(Xe=(Ye=t[2].conf)==null?void 0:Ye.mask)==null?void 0:Xe.reset)!=null?Qe:"Factory reset"}}),V=new hl({props:{active:t[9],message:(Ae=(we=(ut=t[2].conf)==null?void 0:ut.mask)==null?void 0:we.reset_done)!=null?Ae:"Done"}}),{c(){e=p("form"),l=p("div"),j&&j.c(),n=g(),W&&W.c(),i=g(),K&&K.c(),s=g(),U&&U.c(),a=g(),H&&H.c(),r=g(),Z&&Z.c(),f=g(),ne&&ne.c(),u=g(),X&&X.c(),m=g(),$&&$.c(),d=g(),ae&&ae.c(),v=g(),le&&le.c(),b=g(),se&&se.c(),M=g(),k=p("div"),fe&&fe.c(),T=g(),re&&re.c(),I=g(),Oe(O.$$.fragment),C=g(),Oe(B.$$.fragment),L=g(),Oe(z.$$.fragment),y=g(),Oe(V.$$.fragment),c(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),c(k,"class","grid grid-cols-3 mt-3"),c(e,"autocomplete","off")},m(ke,ue){E(ke,e,ue),o(e,l),j&&j.m(l,null),o(l,n),W&&W.m(l,null),o(l,i),K&&K.m(l,null),o(l,s),U&&U.m(l,null),o(l,a),H&&H.m(l,null),o(l,r),Z&&Z.m(l,null),o(l,f),ne&&ne.m(l,null),o(l,u),X&&X.m(l,null),o(l,m),$&&$.m(l,null),o(l,d),ae&&ae.m(l,null),o(l,v),le&&le.m(l,null),o(l,b),se&&se.m(l,null),o(e,M),o(e,k),fe&&fe.m(k,null),o(k,T),re&&re.m(k,null),E(ke,I,ue),Le(O,ke,ue),E(ke,C,ue),Le(B,ke,ue),E(ke,L,ue),Le(z,ke,ue),E(ke,y,ue),Le(V,ke,ue),R=!0,F||(Y=me(e,"submit",ln(t[13])),F=!0)},p(ke,ue){var pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt,qe,Ge,Qt,el,xt,Se,Re,Fe,il,sl,ol,al,fl,ul,rl,cl,ml,_l,pl,dl;(pt=ke[6])!=null&&pt.g?j?(j.p(ke,ue),ue[0]&64&&J(j,1)):(j=na(ke),j.c(),J(j,1),j.m(l,n)):j&&(bt(),ie(j,1,1,()=>{j=null}),gt()),(ht=ke[6])!=null&&ht.m?W?W.p(ke,ue):(W=aa(ke),W.c(),W.m(l,i)):W&&(W.d(1),W=null),(Rt=ke[6])!=null&&Rt.w?K?K.p(ke,ue):(K=ma(ke),K.c(),K.m(l,s)):K&&(K.d(1),K=null),(Pt=ke[6])!=null&&Pt.n?U?(U.p(ke,ue),ue[0]&64&&J(U,1)):(U=da(ke),U.c(),J(U,1),U.m(l,a)):U&&(bt(),ie(U,1,1,()=>{U=null}),gt()),(ct=ke[6])!=null&&ct.q?H?(H.p(ke,ue),ue[0]&64&&J(H,1)):(H=ha(ke),H.c(),J(H,1),H.m(l,r)):H&&(bt(),ie(H,1,1,()=>{H=null}),gt()),((zt=(Ft=ke[6])==null?void 0:Ft.q)==null?void 0:zt.m)==3?Z?Z.p(ke,ue):(Z=ka(ke),Z.c(),Z.m(l,f)):Z&&(Z.d(1),Z=null),((Ut=(Bt=ke[6])==null?void 0:Bt.q)==null?void 0:Ut.m)==4?ne?ne.p(ke,ue):(ne=wa(ke),ne.c(),ne.m(l,u)):ne&&(ne.d(1),ne=null),(qt=ke[6])!=null&&qt.c?X?(X.p(ke,ue),ue[0]&64&&J(X,1)):(X=Ca(ke),X.c(),J(X,1),X.m(l,m)):X&&(bt(),ie(X,1,1,()=>{X=null}),gt()),ue[0]&64&&(_=((Vt=(Gt=(yt=ke[6])==null?void 0:yt.p)==null?void 0:Gt.r)==null?void 0:Vt.startsWith("NO"))||((Mt=(Ct=(Yt=ke[6])==null?void 0:Yt.p)==null?void 0:Ct.r)==null?void 0:Mt.startsWith("10YNO"))||((Et=(Nt=(ft=ke[6])==null?void 0:ft.p)==null?void 0:Nt.r)==null?void 0:Et.startsWith("10Y1001A1001A4"))),_?$?$.p(ke,ue):($=Ta(ke),$.c(),$.m(l,d)):$&&($.d(1),$=null),(dt=ke[6])!=null&&dt.u?ae?ae.p(ke,ue):(ae=Ea(ke),ae.c(),ae.m(l,v)):ae&&(ae.d(1),ae=null),((St=(At=ke[6])==null?void 0:At.i)==null?void 0:St.h)&&(((mt=ke[0])==null?void 0:mt.board)>20||((qe=ke[0])==null?void 0:qe.chip)=="esp8266"||((el=(Qt=(Ge=ke[6])==null?void 0:Ge.i)==null?void 0:Qt.d)==null?void 0:el.d)>0)?le?(le.p(ke,ue),ue[0]&65&&J(le,1)):(le=Aa(ke),le.c(),J(le,1),le.m(l,b)):le&&(bt(),ie(le,1,1,()=>{le=null}),gt()),ue[0]&65&&(h=((xt=ke[6])==null?void 0:xt.d)&&((Re=(Se=ke[0])==null?void 0:Se.features)==null?void 0:Re.includes("rdebug"))),h?se?se.p(ke,ue):(se=Ua(ke),se.c(),se.m(l,null)):se&&(se.d(1),se=null),(Fe=ke[1])!=null&&Fe.a?fe?fe.p(ke,ue):(fe=Ha(ke),fe.c(),fe.m(k,T)):fe&&(fe.d(1),fe=null),ke[6]?re?re.p(ke,ue):(re=za(ke),re.c(),re.m(k,null)):re&&(re.d(1),re=null);const De={};ue[0]&8&&(De.active=ke[3]),ue[0]&4&&(De.message=(ol=(sl=(il=ke[2].conf)==null?void 0:il.mask)==null?void 0:sl.loading)!=null?ol:"Loading"),O.$set(De);const rt={};ue[0]&16&&(rt.active=ke[4]),ue[0]&4&&(rt.message=(ul=(fl=(al=ke[2].conf)==null?void 0:al.mask)==null?void 0:fl.saving)!=null?ul:"Saving"),B.$set(rt);const st={};ue[0]&256&&(st.active=ke[8]),ue[0]&4&&(st.message=(ml=(cl=(rl=ke[2].conf)==null?void 0:rl.mask)==null?void 0:cl.reset)!=null?ml:"Factory reset"),z.$set(st);const at={};ue[0]&512&&(at.active=ke[9]),ue[0]&4&&(at.message=(dl=(pl=(_l=ke[2].conf)==null?void 0:_l.mask)==null?void 0:pl.reset_done)!=null?dl:"Done"),V.$set(at)},i(ke){R||(J(j),J(U),J(H),J(X),J(le),J(O.$$.fragment,ke),J(B.$$.fragment,ke),J(z.$$.fragment,ke),J(V.$$.fragment,ke),R=!0)},o(ke){ie(j),ie(U),ie(H),ie(X),ie(le),ie(O.$$.fragment,ke),ie(B.$$.fragment,ke),ie(z.$$.fragment,ke),ie(V.$$.fragment,ke),R=!1},d(ke){ke&&P(e),j&&j.d(),W&&W.d(),K&&K.d(),U&&U.d(),H&&H.d(),Z&&Z.d(),ne&&ne.d(),X&&X.d(),$&&$.d(),ae&&ae.d(),le&&le.d(),se&&se.d(),fe&&fe.d(),re&&re.d(),ke&&P(I),Ie(O,ke),ke&&P(C),Ie(B,ke),ke&&P(L),Ie(z,ke),ke&&P(y),Ie(V,ke),F=!1,Y()}}}async function wc(){await(await fetch("reboot",{method:"POST"})).json()}function Cc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,{data:s}=e,a={};Ol.subscribe(qe=>{l(2,a=qe)});let r=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Per phase",key:"h"},{name:"Power factor",key:"f"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Realtime plot",key:"l"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"},{name:"Dark mode",key:"k"}],f=!0,u=!1,m=!1,_,d=[];Gn.subscribe(qe=>{var Ge,Qt,el,xt;qe.version&&(l(5,m=(Ge=qe==null?void 0:qe.c)==null?void 0:Ge.e),l(6,_=qe),l(3,f=!1),l(7,d=[{code:"en",name:"English"}]),((Qt=_==null?void 0:_.u)==null?void 0:Qt.lang)&&_.u.lang!="en"&&d.push({code:_.u.lang,name:(xt=(el=a.language)==null?void 0:el.name)!=null?xt:"Unknown"}),d.push({code:"hub",name:"Load from server"}))}),y0();let v=!1,b=!1;async function h(){if(confirm("Factory reset?")){l(8,v=!0);const qe=new URLSearchParams;qe.append("perform","true");let Qt=await(await fetch("reset",{method:"POST",body:qe})).json();l(8,v=!1),l(9,b=Qt.success)}}async function M(qe){l(4,u=!0);const Ge=new FormData(qe.target),Qt=new URLSearchParams;for(let Se of Ge){const[Re,Fe]=Se;Qt.append(Re,Fe)}let xt=await(await fetch("save",{method:"POST",body:Qt})).json();kl.update(Se=>(Se.hostname=Ge.get("gh"),Se.usrcfg=xt.success,Se.booting=xt.reboot,Ge.get("nm")=="static"&&(Se.net.ip=Ge.get("ni"),Se.net.mask=Ge.get("nu"),Se.net.gw=Ge.get("ng"),Se.net.dns1=Ge.get("nd")),Se.ui=_.u,Se)),l(4,u=!1),Ql(n)}const k=function(){confirm("Reboot?")&&(kl.update(qe=>(qe.booting=!0,qe)),wc())};async function T(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),Gn.update(Ge=>(Ge.q.s.c=!1,Ge)))}async function I(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),Gn.update(Ge=>(Ge.q.s.r=!1,Ge)))}async function O(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),Gn.update(Ge=>(Ge.q.s.k=!1,Ge)))}const C=function(){_.q.s.e?_.q.p==1883&&l(6,_.q.p=8883,_):_.q.p==8883&&l(6,_.q.p=1883,_)};async function B(){if(_.u.lang=="hub"){const qe=await Il("http://hub.amsleser.no/hub/language/list.json");l(7,d=await qe.json()),l(6,_.u.lang=a.language.code,_)}}let L=44;async function z(){const qe=await Il("cloudkey.json");if(qe.status==200){let Ge=await qe.json();window.open("https://www.amsleser.cloud/device/"+Ge.seed)}else alert("Not able to bind to cloud")}const y=window||global;y.bindToCloud=function(){console.log("BIND CALLED")};function V(){_.g.h=this.value,l(6,_)}function R(){_.g.t=Jt(this),l(6,_)}function F(){_.p.r=Jt(this),l(6,_)}function Y(){_.p.c=Jt(this),l(6,_)}function j(){_.p.e=this.checked,l(6,_)}function W(){_.p.t=this.value,l(6,_)}function K(){_.g.s=Jt(this),l(6,_)}function U(){_.g.u=this.value,l(6,_)}function H(){_.g.p=this.value,l(6,_)}function Z(){_.g.c=this.value,l(6,_)}function ne(){_.m.a=Jt(this),l(6,_)}function X(){_.m.b=$e(this.value),l(6,_)}function $(){_.m.i=this.checked,l(6,_)}function ae(){_.m.b=Jt(this),l(6,_)}function le(){_.m.p=Jt(this),l(6,_)}function se(){_.m.s=$e(this.value),l(6,_)}function fe(){_.m.d=Jt(this),l(6,_)}function re(){_.m.f=$e(this.value),l(6,_)}function Q(){_.m.r=$e(this.value),l(6,_)}function x(){_.m.e.e=this.checked,l(6,_)}function ge(){_.m.e.k=this.value,l(6,_)}function pe(){_.m.e.a=this.value,l(6,_)}function N(){_.m.m.e=this.checked,l(6,_)}function w(){_.m.m.w=$e(this.value),l(6,_)}function D(){_.m.m.v=$e(this.value),l(6,_)}function A(){_.m.m.a=$e(this.value),l(6,_)}function G(){_.m.m.c=$e(this.value),l(6,_)}function te(){_.n.c=Jt(this),l(6,_)}function ee(){_.w.s=this.value,l(6,_)}function oe(){_.w.p=this.value,l(6,_)}function ce(){_.w.z=Jt(this),l(6,_)}function Pe(){_.w.w=$e(this.value),l(6,_)}function Ce(){_.w.b=this.checked,l(6,_)}function de(){_.n.m=Jt(this),l(6,_)}function Ne(){_.n.i=this.value,l(6,_)}function Te(){_.n.s=Jt(this),l(6,_)}function ve(){_.n.g=this.value,l(6,_)}function be(){_.n.d1=this.value,l(6,_)}function He(){_.n.d2=this.value,l(6,_)}function ye(){_.n.x=this.checked,l(6,_)}function Ve(){_.n.d=this.checked,l(6,_)}function xe(){_.n.h=this.checked,l(6,_)}function Je(){_.n.n1=this.value,l(6,_)}function it(){_.q.s.e=this.checked,l(6,_)}function We(){_.q.h=this.value,l(6,_)}function _t(){_.q.p=$e(this.value),l(6,_)}function Ee(){_.q.u=this.value,l(6,_)}function _e(){_.q.a=this.value,l(6,_)}function Ue(){_.q.c=this.value,l(6,_)}function kt(){_.q.m=Jt(this),l(6,_)}function wt(){_.q.b=this.value,l(6,_)}function nt(){_.q.t=Jt(this),l(6,_)}function vt(){_.q.d=$e(this.value),l(6,_)}function ze(){_.o.e=this.value,l(6,_)}function Ke(){_.o.c=this.value,l(6,_)}function Ye(){_.o.u1=this.value,l(6,_)}function Xe(){_.o.u2=this.value,l(6,_)}function Qe(){_.o.u3=this.value,l(6,_)}function ut(){_.h.t=this.value,l(6,_)}function we(){_.h.h=this.value,l(6,_)}function Ae(){_.h.n=this.value,l(6,_)}function ke(){_.c.e=this.checked,l(6,_)}function ue(){_.c.es=this.checked,l(6,_)}function De(qe){_.t.t[qe]=$e(this.value),l(6,_)}function rt(){_.t.h=$e(this.value),l(6,_)}function st(qe){_.u[qe.key]=Jt(this),l(6,_)}function at(){_.u.lang=Jt(this),l(6,_)}function pt(){_.i.h.p=Jt(this),l(6,_)}function ht(){_.i.h.t=Jt(this),l(6,_)}function Rt(){_.i.h.u=this.checked,l(6,_)}function Pt(){_.i.a=$e(this.value),l(6,_)}function ct(){_.i.l.p=$e(this.value),l(6,_)}function Ft(){_.i.l.i=this.checked,l(6,_)}function zt(){_.i.r.i=this.checked,l(6,_)}function Bt(){_.i.r.r=$e(this.value),l(6,_)}function Ut(){_.i.r.g=$e(this.value),l(6,_)}function qt(){_.i.r.b=$e(this.value),l(6,_)}function yt(){_.i.d.d=$e(this.value),l(6,_)}function Gt(){_.i.t.d=$e(this.value),l(6,_)}function Vt(){_.i.t.a=$e(this.value),l(6,_)}function Yt(){_.i.v.p=$e(this.value),l(6,_)}function Ct(){_.i.v.d.v=$e(this.value),l(6,_)}function Mt(){_.i.v.d.g=$e(this.value),l(6,_)}function ft(){_.i.d.b=Jt(this),l(6,_)}function Nt(){_.i.v.o=$e(this.value),l(6,_)}function Et(){_.i.v.m=$e(this.value),l(6,_)}function dt(){_.i.v.b=$e(this.value),l(6,_)}function At(){_.d.s=this.checked,l(6,_)}function St(){_.d.t=this.checked,l(6,_)}function mt(){_.d.l=Jt(this),l(6,_)}return t.$$set=qe=>{"basepath"in qe&&l(21,n=qe.basepath),"sysinfo"in qe&&l(0,i=qe.sysinfo),"data"in qe&&l(1,s=qe.data)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(10,L=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39)},[i,s,a,f,u,m,_,d,v,b,L,r,h,M,k,T,I,O,C,B,z,n,V,R,F,Y,j,W,K,U,H,Z,ne,X,$,ae,le,se,fe,re,Q,x,ge,pe,N,w,D,A,G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t,Ee,_e,Ue,kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut,we,Ae,ke,ue,De,rt,st,at,pt,ht,Rt,Pt,ct,Ft,zt,Bt,Ut,qt,yt,Gt,Vt,Yt,Ct,Mt,ft,Nt,Et,dt,At,St,mt]}class Sc extends It{constructor(e){super(),Lt(this,e,Cc,kc,Dt,{basepath:21,sysinfo:0,data:1},null,[-1,-1,-1,-1,-1])}}function Wa(t,e,l){const n=t.slice();return n[22]=e[l],n}function Ga(t){let e,l=t[1].cpu+"",n,i;return{c(){e=S("("),n=S(l),i=S("MHz)")},m(s,a){E(s,e,a),E(s,n,a),E(s,i,a)},p(s,a){a&2&&l!==(l=s[1].cpu+"")&&q(n,l)},d(s){s&&P(e),s&&P(n),s&&P(i)}}}function Mc(t){let e=lt(t[1].chip,t[1].board)+"",l;return{c(){l=S(e)},m(n,i){E(n,l,i)},p(n,i){i&2&&e!==(e=lt(n[1].chip,n[1].board)+"")&&q(l,e)},d(n){n&&P(l)}}}function Va(t){var K,U,H,Z,ne,X,$,ae,le,se,fe,re;let e,l=((H=(U=(K=t[3].status)==null?void 0:K.device)==null?void 0:U.apmac)!=null?H:"AP MAC")+"",n,i,s=t[1].apmac+"",a,r,f,u=((X=(ne=(Z=t[3].status)==null?void 0:Z.device)==null?void 0:ne.last_boot)!=null?X:"Last boot")+"",m,_,d,v,b,h,M=((le=(ae=($=t[3].status)==null?void 0:$.device)==null?void 0:ae.reason)!=null?le:"Reason")+"",k,T,I=((re=(fe=(se=t[3][As(t[1].chip)])==null?void 0:se.reason)==null?void 0:fe[t[1].boot_reason])!=null?re:t[1].boot_reason)+"",O,C,B=t[1].boot_reason+"",L,z,y=t[1].ex_cause+"",V,R,F;const Y=[Tc,Nc],j=[];function W(Q,x){return Q[0].u>0?0:1}return d=W(t),v=j[d]=Y[d](t),{c(){e=p("div"),n=S(l),i=S(": "),a=S(s),r=g(),f=p("div"),m=S(u),_=S(`: + `),v.c(),b=g(),h=p("div"),k=S(M),T=S(": "),O=S(I),C=S(" ("),L=S(B),z=S("/"),V=S(y),R=S(")"),c(e,"class","my-2"),c(f,"class","my-2"),c(h,"class","my-2")},m(Q,x){E(Q,e,x),o(e,n),o(e,i),o(e,a),E(Q,r,x),E(Q,f,x),o(f,m),o(f,_),j[d].m(f,null),E(Q,b,x),E(Q,h,x),o(h,k),o(h,T),o(h,O),o(h,C),o(h,L),o(h,z),o(h,V),o(h,R),F=!0},p(Q,x){var pe,N,w,D,A,G,te,ee,oe,ce,Pe,Ce;(!F||x&8)&&l!==(l=((w=(N=(pe=Q[3].status)==null?void 0:pe.device)==null?void 0:N.apmac)!=null?w:"AP MAC")+"")&&q(n,l),(!F||x&2)&&s!==(s=Q[1].apmac+"")&&q(a,s),(!F||x&8)&&u!==(u=((G=(A=(D=Q[3].status)==null?void 0:D.device)==null?void 0:A.last_boot)!=null?G:"Last boot")+"")&&q(m,u);let ge=d;d=W(Q),d===ge?j[d].p(Q,x):(bt(),ie(j[ge],1,1,()=>{j[ge]=null}),gt(),v=j[d],v?v.p(Q,x):(v=j[d]=Y[d](Q),v.c()),J(v,1),v.m(f,null)),(!F||x&8)&&M!==(M=((oe=(ee=(te=Q[3].status)==null?void 0:te.device)==null?void 0:ee.reason)!=null?oe:"Reason")+"")&&q(k,M),(!F||x&10)&&I!==(I=((Ce=(Pe=(ce=Q[3][As(Q[1].chip)])==null?void 0:ce.reason)==null?void 0:Pe[Q[1].boot_reason])!=null?Ce:Q[1].boot_reason)+"")&&q(O,I),(!F||x&2)&&B!==(B=Q[1].boot_reason+"")&&q(L,B),(!F||x&2)&&y!==(y=Q[1].ex_cause+"")&&q(V,y)},i(Q){F||(J(v),F=!0)},o(Q){ie(v),F=!1},d(Q){Q&&P(e),Q&&P(r),Q&&P(f),j[d].d(),Q&&P(b),Q&&P(h)}}}function Nc(t){let e;return{c(){e=S("-")},m(l,n){E(l,e,n)},p:Ze,i:Ze,o:Ze,d(l){l&&P(e)}}}function Tc(t){let e,l;return e=new Lu({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function Ka(t){var m,_;let e,l,n,i,s=((_=(m=t[3].btn)==null?void 0:m.reboot)!=null?_:"Reboot")+"",a,r,f,u;return l=new Al({props:{to:"/consent",$$slots:{default:[Pc]},$$scope:{ctx:t}}}),{c(){e=p("div"),Oe(l.$$.fragment),n=g(),i=p("button"),a=S(s),c(i,"class","btn-yellow-sm float-right"),c(e,"class","my-2")},m(d,v){E(d,e,v),Le(l,e,null),o(e,n),o(e,i),o(i,a),r=!0,f||(u=me(i,"click",t[12]),f=!0)},p(d,v){var h,M;const b={};v&33554440&&(b.$$scope={dirty:v,ctx:d}),l.$set(b),(!r||v&8)&&s!==(s=((M=(h=d[3].btn)==null?void 0:h.reboot)!=null?M:"Reboot")+"")&&q(a,s)},i(d){r||(J(l.$$.fragment,d),r=!0)},o(d){ie(l.$$.fragment,d),r=!1},d(d){d&&P(e),Ie(l),f=!1,u()}}}function Pc(t){var i,s,a;let e,l=((a=(s=(i=t[3].status)==null?void 0:i.device)==null?void 0:s.btn_consents)!=null?a:"Consents")+"",n;return{c(){e=p("span"),n=S(l),c(e,"class","btn-pri-sm")},m(r,f){E(r,e,f),o(e,n)},p(r,f){var u,m,_;f&8&&l!==(l=((_=(m=(u=r[3].status)==null?void 0:u.device)==null?void 0:m.btn_consents)!=null?_:"Consents")+"")&&q(n,l)},d(r){r&&P(e)}}}function Ya(t){var V,R,F,Y,j,W,K,U,H,Z,ne,X;let e,l,n=((F=(R=(V=t[3].status)==null?void 0:V.meter)==null?void 0:R.title)!=null?F:"Meter")+"",i,s,a,r=((W=(j=(Y=t[3].status)==null?void 0:Y.meter)==null?void 0:j.manufacturer)!=null?W:"Manufacturer")+"",f,u,m=_i(t[1].meter.mfg)+"",_,d,v,b=((H=(U=(K=t[3].status)==null?void 0:K.meter)==null?void 0:U.model)!=null?H:"Model")+"",h,M,k=(t[1].meter.model?t[1].meter.model:"unknown")+"",T,I,O,C=((X=(ne=(Z=t[3].status)==null?void 0:Z.meter)==null?void 0:ne.id)!=null?X:"ID")+"",B,L,z=(t[1].meter.id?t[1].meter.id:"unknown")+"",y;return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("div"),f=S(r),u=S(": "),_=S(m),d=g(),v=p("div"),h=S(b),M=S(": "),T=S(k),I=g(),O=p("div"),B=S(C),L=S(": "),y=S(z),c(l,"class","text-sm"),c(a,"class","my-2"),c(v,"class","my-2"),c(O,"class","my-2"),c(e,"class","cnt")},m($,ae){E($,e,ae),o(e,l),o(l,i),o(e,s),o(e,a),o(a,f),o(a,u),o(a,_),o(e,d),o(e,v),o(v,h),o(v,M),o(v,T),o(e,I),o(e,O),o(O,B),o(O,L),o(O,y)},p($,ae){var le,se,fe,re,Q,x,ge,pe,N,w,D,A;ae&8&&n!==(n=((fe=(se=(le=$[3].status)==null?void 0:le.meter)==null?void 0:se.title)!=null?fe:"Meter")+"")&&q(i,n),ae&8&&r!==(r=((x=(Q=(re=$[3].status)==null?void 0:re.meter)==null?void 0:Q.manufacturer)!=null?x:"Manufacturer")+"")&&q(f,r),ae&2&&m!==(m=_i($[1].meter.mfg)+"")&&q(_,m),ae&8&&b!==(b=((N=(pe=(ge=$[3].status)==null?void 0:ge.meter)==null?void 0:pe.model)!=null?N:"Model")+"")&&q(h,b),ae&2&&k!==(k=($[1].meter.model?$[1].meter.model:"unknown")+"")&&q(T,k),ae&8&&C!==(C=((A=(D=(w=$[3].status)==null?void 0:w.meter)==null?void 0:D.id)!=null?A:"ID")+"")&&q(B,C),ae&2&&z!==(z=($[1].meter.id?$[1].meter.id:"unknown")+"")&&q(y,z)},d($){$&&P(e)}}}function Qa(t){var U,H,Z,ne,X,$,ae,le,se,fe,re,Q;let e,l,n=((Z=(H=(U=t[3].status)==null?void 0:U.network)==null?void 0:H.title)!=null?Z:"Network")+"",i,s,a,r=(($=(X=(ne=t[3].conf)==null?void 0:ne.network)==null?void 0:X.ip)!=null?$:"IP")+"",f,u,m=t[1].net.ip+"",_,d,v,b=((se=(le=(ae=t[3].conf)==null?void 0:ae.network)==null?void 0:le.mask)!=null?se:"Mask")+"",h,M,k=t[1].net.mask+"",T,I,O,C=((Q=(re=(fe=t[3].conf)==null?void 0:fe.network)==null?void 0:re.gw)!=null?Q:"Gateway")+"",B,L,z=t[1].net.gw+"",y,V,R,F,Y,j=t[1].net.dns1&&Xa(t),W=t[1].net.dns2&&Za(t),K=t[1].net.ipv6&&Ja(t);return{c(){e=p("div"),l=p("strong"),i=S(n),s=g(),a=p("div"),f=S(r),u=S(": "),_=S(m),d=g(),v=p("div"),h=S(b),M=S(": "),T=S(k),I=g(),O=p("div"),B=S(C),L=S(": "),y=S(z),V=g(),R=p("div"),j&&j.c(),F=g(),W&&W.c(),Y=g(),K&&K.c(),c(l,"class","text-sm"),c(a,"class","my-2"),c(v,"class","my-2"),c(O,"class","my-2"),c(R,"class","my-2"),c(e,"class","cnt")},m(x,ge){E(x,e,ge),o(e,l),o(l,i),o(e,s),o(e,a),o(a,f),o(a,u),o(a,_),o(e,d),o(e,v),o(v,h),o(v,M),o(v,T),o(e,I),o(e,O),o(O,B),o(O,L),o(O,y),o(e,V),o(e,R),j&&j.m(R,null),o(R,F),W&&W.m(R,null),o(e,Y),K&&K.m(e,null)},p(x,ge){var pe,N,w,D,A,G,te,ee,oe,ce,Pe,Ce;ge&8&&n!==(n=((w=(N=(pe=x[3].status)==null?void 0:pe.network)==null?void 0:N.title)!=null?w:"Network")+"")&&q(i,n),ge&8&&r!==(r=((G=(A=(D=x[3].conf)==null?void 0:D.network)==null?void 0:A.ip)!=null?G:"IP")+"")&&q(f,r),ge&2&&m!==(m=x[1].net.ip+"")&&q(_,m),ge&8&&b!==(b=((oe=(ee=(te=x[3].conf)==null?void 0:te.network)==null?void 0:ee.mask)!=null?oe:"Mask")+"")&&q(h,b),ge&2&&k!==(k=x[1].net.mask+"")&&q(T,k),ge&8&&C!==(C=((Ce=(Pe=(ce=x[3].conf)==null?void 0:ce.network)==null?void 0:Pe.gw)!=null?Ce:"Gateway")+"")&&q(B,C),ge&2&&z!==(z=x[1].net.gw+"")&&q(y,z),x[1].net.dns1?j?j.p(x,ge):(j=Xa(x),j.c(),j.m(R,F)):j&&(j.d(1),j=null),x[1].net.dns2?W?W.p(x,ge):(W=Za(x),W.c(),W.m(R,null)):W&&(W.d(1),W=null),x[1].net.ipv6?K?K.p(x,ge):(K=Ja(x),K.c(),K.m(e,null)):K&&(K.d(1),K=null)},d(x){x&&P(e),j&&j.d(),W&&W.d(),K&&K.d()}}}function Xa(t){var a,r,f;let e=((f=(r=(a=t[3].conf)==null?void 0:a.network)==null?void 0:r.dns)!=null?f:"DNS")+"",l,n,i=t[1].net.dns1+"",s;return{c(){l=S(e),n=S(": "),s=S(i)},m(u,m){E(u,l,m),E(u,n,m),E(u,s,m)},p(u,m){var _,d,v;m&8&&e!==(e=((v=(d=(_=u[3].conf)==null?void 0:_.network)==null?void 0:d.dns)!=null?v:"DNS")+"")&&q(l,e),m&2&&i!==(i=u[1].net.dns1+"")&&q(s,i)},d(u){u&&P(l),u&&P(n),u&&P(s)}}}function Za(t){var a,r,f;let e=((f=(r=(a=t[3].conf)==null?void 0:a.network)==null?void 0:r.dns)!=null?f:"DNS")+"",l,n,i=t[1].net.dns2+"",s;return{c(){l=S(e),n=S(": "),s=S(i)},m(u,m){E(u,l,m),E(u,n,m),E(u,s,m)},p(u,m){var _,d,v;m&8&&e!==(e=((v=(d=(_=u[3].conf)==null?void 0:_.network)==null?void 0:d.dns)!=null?v:"DNS")+"")&&q(l,e),m&2&&i!==(i=u[1].net.dns2+"")&&q(s,i)},d(u){u&&P(l),u&&P(n),u&&P(s)}}}function Ja(t){let e,l,n=t[1].net.ipv6+"",i,s,a,r,f=t[1].net.dns1v6&&$a(t),u=t[1].net.dns2v6&&xa(t);return{c(){e=p("div"),l=S("IPv6: "),i=S(n),s=g(),a=p("div"),f&&f.c(),r=g(),u&&u.c(),c(e,"class","my-2"),c(a,"class","my-2")},m(m,_){E(m,e,_),o(e,l),o(e,i),E(m,s,_),E(m,a,_),f&&f.m(a,null),o(a,r),u&&u.m(a,null)},p(m,_){_&2&&n!==(n=m[1].net.ipv6+"")&&q(i,n),m[1].net.dns1v6?f?f.p(m,_):(f=$a(m),f.c(),f.m(a,r)):f&&(f.d(1),f=null),m[1].net.dns2v6?u?u.p(m,_):(u=xa(m),u.c(),u.m(a,null)):u&&(u.d(1),u=null)},d(m){m&&P(e),m&&P(s),m&&P(a),f&&f.d(),u&&u.d()}}}function $a(t){let e,l=t[1].net.dns1v6+"",n;return{c(){e=S("DNSv6: "),n=S(l)},m(i,s){E(i,e,s),E(i,n,s)},p(i,s){s&2&&l!==(l=i[1].net.dns1v6+"")&&q(n,l)},d(i){i&&P(e),i&&P(n)}}}function xa(t){let e,l=t[1].net.dns2v6+"",n;return{c(){e=S("DNSv6: "),n=S(l)},m(i,s){E(i,e,s),E(i,n,s)},p(i,s){s&2&&l!==(l=i[1].net.dns2v6+"")&&q(n,l)},d(i){i&&P(e),i&&P(n)}}}function ef(t){var f,u,m,_,d,v;let e,l,n=((m=(u=(f=t[3].status)==null?void 0:f.firmware)==null?void 0:u.failed)!=null?m:"Upgrade from {0} to {1} failed").replace("{0}",t[1].upgrade.f).replace("{1}",t[1].upgrade.t)+"",i,s,a=((v=(d=(_=t[3].errors)==null?void 0:_.http)==null?void 0:d[t[1].upgrade.e])!=null?v:t[1].upgrade.e)+"",r;return{c(){e=p("div"),l=p("div"),i=S(n),s=g(),r=S(a),c(l,"class","bd-yellow"),c(e,"class","my-2")},m(b,h){E(b,e,h),o(e,l),o(l,i),o(l,s),o(l,r)},p(b,h){var M,k,T,I,O,C;h&10&&n!==(n=((T=(k=(M=b[3].status)==null?void 0:M.firmware)==null?void 0:k.failed)!=null?T:"Upgrade from {0} to {1} failed").replace("{0}",b[1].upgrade.f).replace("{1}",b[1].upgrade.t)+"")&&q(i,n),h&10&&a!==(a=((C=(O=(I=b[3].errors)==null?void 0:I.http)==null?void 0:O[b[1].upgrade.e])!=null?C:b[1].upgrade.e)+"")&&q(r,a)},d(b){b&&P(e)}}}function tf(t){var b,h,M;let e,l=((M=(h=(b=t[3].status)==null?void 0:b.firmware)==null?void 0:h.latest)!=null?M:"Latest")+"",n,i,s,a=t[4].tag_name+"",r,f,u,m,_,d=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[4]&&t[4].tag_name!=t[1].version&&lf(t),v=t[1].fwconsent===2&&nf(t);return{c(){e=p("div"),n=S(l),i=S(`: + `),s=p("a"),r=S(a),u=g(),d&&d.c(),m=g(),v&&v.c(),_=$t(),c(s,"href",f=t[4].html_url),c(s,"class","ml-2 text-blue-600 hover:text-blue-800"),c(s,"target","_blank"),c(s,"rel","noreferrer"),c(e,"class","my-2 flex")},m(k,T){E(k,e,T),o(e,n),o(e,i),o(e,s),o(s,r),o(e,u),d&&d.m(e,null),E(k,m,T),v&&v.m(k,T),E(k,_,T)},p(k,T){var I,O,C;T&8&&l!==(l=((C=(O=(I=k[3].status)==null?void 0:I.firmware)==null?void 0:O.latest)!=null?C:"Latest")+"")&&q(n,l),T&16&&a!==(a=k[4].tag_name+"")&&q(r,a),T&16&&f!==(f=k[4].html_url)&&c(s,"href",f),(k[1].security==0||k[0].a)&&k[1].fwconsent===1&&k[4]&&k[4].tag_name!=k[1].version?d?d.p(k,T):(d=lf(k),d.c(),d.m(e,null)):d&&(d.d(1),d=null),k[1].fwconsent===2?v?v.p(k,T):(v=nf(k),v.c(),v.m(_.parentNode,_)):v&&(v.d(1),v=null)},d(k){k&&P(e),d&&d.d(),k&&P(m),v&&v.d(k),k&&P(_)}}}function lf(t){let e,l,n,i,s;return{c(){var a,r,f;e=p("div"),l=p("button"),l.textContent="\u21D3",c(e,"class","flex-none ml-2 text-green-500"),c(e,"title",n=(f=(r=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:r.install)!=null?f:"Install")},m(a,r){E(a,e,r),o(e,l),i||(s=me(l,"click",t[11]),i=!0)},p(a,r){var f,u,m;r&8&&n!==(n=(m=(u=(f=a[3].status)==null?void 0:f.firmware)==null?void 0:u.install)!=null?m:"Install")&&c(e,"title",n)},d(a){a&&P(e),i=!1,s()}}}function nf(t){var s,a,r;let e,l,n=((r=(a=(s=t[3].status)==null?void 0:s.firmware)==null?void 0:a.no_one_click)!=null?r:"One-click upgrade disabled")+"",i;return{c(){e=p("div"),l=p("div"),i=S(n),c(l,"class","bd-yellow"),c(e,"class","my-2")},m(f,u){E(f,e,u),o(e,l),o(l,i)},p(f,u){var m,_,d;u&8&&n!==(n=((d=(_=(m=f[3].status)==null?void 0:m.firmware)==null?void 0:_.no_one_click)!=null?d:"One-click upgrade disabled")+"")&&q(i,n)},d(f){f&&P(e)}}}function sf(t){let e,l=pi(lt(t[1].chip,t[1].board))+"",n;return{c(){e=p("div"),n=S(l),c(e,"class","bd-red")},m(i,s){E(i,e,s),o(e,n)},p(i,s){s&2&&l!==(l=pi(lt(i[1].chip,i[1].board))+"")&&q(n,l)},d(i){i&&P(e)}}}function of(t){let e,l,n,i,s,a;function r(m,_){return m[6].length==0?Dc:Ec}let f=r(t),u=f(t);return{c(){e=p("div"),l=p("form"),n=p("input"),i=g(),u.c(),Vn(n,"display","none"),c(n,"name","file"),c(n,"type","file"),c(n,"accept",".bin"),c(l,"action","/firmware"),c(l,"enctype","multipart/form-data"),c(l,"method","post"),c(l,"autocomplete","off"),c(e,"class","my-2 flex")},m(m,_){E(m,e,_),o(e,l),o(l,n),t[14](n),o(l,i),u.m(l,null),s||(a=[me(n,"change",t[15]),me(l,"submit",t[17])],s=!0)},p(m,_){f===(f=r(m))&&u?u.p(m,_):(u.d(1),u=f(m),u&&(u.c(),u.m(l,null)))},d(m){m&&P(e),t[14](null),u.d(),s=!1,Ht(a)}}}function Ec(t){var r,f;let e=t[6][0].name+"",l,n,i,s=((f=(r=t[3].btn)==null?void 0:r.upload)!=null?f:"Upload")+"",a;return{c(){l=S(e),n=g(),i=p("button"),a=S(s),c(i,"type","submit"),c(i,"class","btn-pri-sm float-right ml-2")},m(u,m){E(u,l,m),E(u,n,m),E(u,i,m),o(i,a)},p(u,m){var _,d;m&64&&e!==(e=u[6][0].name+"")&&q(l,e),m&8&&s!==(s=((d=(_=u[3].btn)==null?void 0:_.upload)!=null?d:"Upload")+"")&&q(a,s)},d(u){u&&P(l),u&&P(n),u&&P(i)}}}function Dc(t){var a,r,f;let e,l=((f=(r=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:r.btn_select_file)!=null?f:"Select file")+"",n,i,s;return{c(){e=p("button"),n=S(l),c(e,"type","button"),c(e,"class","btn-pri-sm float-right")},m(u,m){E(u,e,m),o(e,n),i||(s=me(e,"click",t[16]),i=!0)},p(u,m){var _,d,v;m&8&&l!==(l=((v=(d=(_=u[3].status)==null?void 0:_.firmware)==null?void 0:d.btn_select_file)!=null?v:"Select file")+"")&&q(n,l)},d(u){u&&P(e),i=!1,s()}}}function af(t){var W,K,U,H,Z,ne,X,$,ae;let e,l,n=((U=(K=(W=t[3].status)==null?void 0:W.backup)==null?void 0:K.title)!=null?U:"Backup")+"",i,s,a,r,f,u,m,_,d=((ne=(Z=(H=t[3].status)==null?void 0:H.backup)==null?void 0:Z.secrets)!=null?ne:"Include secrets")+"",v,b,h,M=((ae=($=(X=t[3].status)==null?void 0:X.backup)==null?void 0:$.secrets_desc)!=null?ae:"")+"",k,T,I,O,C,B,L,z,y=t[10],V=[];for(let le=0;le{oe=null}),gt()),(Gt=ue[0])!=null&&Gt.a?ce?(ce.p(ue,De),De&1&&J(ce,1)):(ce=Ka(ue),ce.c(),J(ce,1),ce.m(l,null)):ce&&(bt(),ie(ce,1,1,()=>{ce=null}),gt()),ue[1].meter?Pe?Pe.p(ue,De):(Pe=Ya(ue),Pe.c(),Pe.m(e,j)):Pe&&(Pe.d(1),Pe=null),ue[1].net?Ce?Ce.p(ue,De):(Ce=Qa(ue),Ce.c(),Ce.m(e,W)):Ce&&(Ce.d(1),Ce=null),(!te||De&8)&&H!==(H=((Ct=(Yt=(Vt=ue[3].status)==null?void 0:Vt.firmware)==null?void 0:Yt.title)!=null?Ct:"Firmware")+"")&&q(Z,H),(!te||De&8)&&$!==($=((Nt=(ft=(Mt=ue[3].status)==null?void 0:Mt.firmware)==null?void 0:ft.installed)!=null?Nt:"Installed")+"")&&q(ae,$),(!te||De&2)&&se!==(se=ue[1].version+"")&&q(fe,se),ue[1].upgrade.t&&ue[1].upgrade.t!=ue[1].version?de?de.p(ue,De):(de=ef(ue),de.c(),de.m(K,Q)):de&&(de.d(1),de=null),ue[4]?Ne?Ne.p(ue,De):(Ne=tf(ue),Ne.c(),Ne.m(K,x)):Ne&&(Ne.d(1),Ne=null),De&3&&(ge=(ue[1].security==0||ue[0].a)&&rn(ue[1].board)),ge?Te?Te.p(ue,De):(Te=sf(ue),Te.c(),Te.m(K,pe)):Te&&(Te.d(1),Te=null),ue[1].security==0||ue[0].a?ve?ve.p(ue,De):(ve=of(ue),ve.c(),ve.m(K,null)):ve&&(ve.d(1),ve=null),ue[1].security==0||ue[0].a?be?be.p(ue,De):(be=af(ue),be.c(),be.m(e,null)):be&&(be.d(1),be=null);const st={};De&128&&(st.active=ue[7]),De&8&&(st.message=(At=(dt=(Et=ue[3].status)==null?void 0:Et.mask)==null?void 0:dt.firmware)!=null?At:"Uploading"),D.$set(st);const at={};De&512&&(at.active=ue[9]),De&8&&(at.message=(qe=(mt=(St=ue[3].status)==null?void 0:St.mask)==null?void 0:mt.config)!=null?qe:"Uploading"),G.$set(at)},i(ue){te||(J(I.$$.fragment,ue),J(oe),J(ce),J(D.$$.fragment,ue),J(G.$$.fragment,ue),te=!0)},o(ue){ie(I.$$.fragment,ue),ie(oe),ie(ce),ie(D.$$.fragment,ue),ie(G.$$.fragment,ue),te=!1},d(ue){ue&&P(e),ee&&ee.d(),Ie(I),oe&&oe.d(),ce&&ce.d(),Pe&&Pe.d(),Ce&&Ce.d(),de&&de.d(),Ne&&Ne.d(),Te&&Te.d(),ve&&ve.d(),be&&be.d(),ue&&P(w),Ie(D,ue),ue&&P(A),Ie(G,ue)}}}async function Ic(){await(await fetch("reboot",{method:"POST"})).json()}function Oc(t,e,l){let{data:n}=e,{sysinfo:i}=e,s=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price",key:"is"}],a={};Ol.subscribe(y=>{l(3,a=y)});let r={};ls.subscribe(y=>{l(4,r=Au(i.version,y)),r||l(4,r=y[0])});function f(){var y,V;confirm(((V=(y=a.header)==null?void 0:y.upgrade)!=null?V:"Upgrade to {0}?").replace("{0}",r.tag_name))&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(pi(lt(i.chip,i.board))))&&(kl.update(R=>(R.upgrading=!0,R)),qu(r.tag_name))}const u=function(){var y,V;confirm((V=(y=a.device)==null?void 0:y.reboot_confirm)!=null?V:"Reboot?")&&(kl.update(R=>(R.booting=!0,R)),Ic())};let m,_=[],d=!1,v,b=[],h=!1;es();let M={hostname:"",ip:""};function k(y){l(9,h=!0);const V=new FormData;V.append("file",b[0]),fetch("/configfile",{method:"POST",body:V}).then(R=>R.json()).then(R=>{kl.update(F=>(M&&M.hostname&&(F.hostname=M.hostname),F.booting=R.reboot,M&&M.ip&&(F.net.ip=M.ip),setTimeout(Zn,5e3,i),F))}).catch(R=>{console.error("Error:",R),setTimeout(Zn,5e3,i)})}function T(y){ci[y?"unshift":"push"](()=>{m=y,l(5,m)})}function I(){_=this.files,l(6,_)}const O=()=>{m.click()},C=()=>l(7,d=!0);function B(y){ci[y?"unshift":"push"](()=>{v=y,l(8,v)})}function L(){b=this.files,l(2,b)}const z=()=>{v.click()};return t.$$set=y=>{"data"in y&&l(0,n=y.data),"sysinfo"in y&&l(1,i=y.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&4&&b.length==1){let y=b[0],V=new FileReader,R=F=>{let Y=F.target.result.split(` +`);for(let j in Y){let W=Y[j];W.startsWith("hostname ")?M.hostname=W.split(" ")[1]:W.startsWith("ip ")&&(M.ip=W.split(" ")[1])}};V.onload=R,V.readAsText(y)}},[n,i,b,a,r,m,_,d,v,h,s,f,u,k,T,I,O,C,B,L,z]}class Rc extends It{constructor(e){super(),Lt(this,e,Oc,Lc,Dt,{data:0,sysinfo:1})}}function rf(t){let e,l,n=lt(t[0],7)+"",i,s,a=lt(t[0],5)+"",r,f,u=lt(t[0],4)+"",m,_,d=lt(t[0],3)+"",v,b,h,M,k=lt(t[0],2)+"",T,I,O=lt(t[0],1)+"",C,B,L=lt(t[0],0)+"",z,y,V,R,F=lt(t[0],101)+"",Y,j,W=lt(t[0],100)+"",K;return{c(){e=p("optgroup"),l=p("option"),i=S(n),s=p("option"),r=S(a),f=p("option"),m=S(u),_=p("option"),v=S(d),b=g(),h=p("optgroup"),M=p("option"),T=S(k),I=p("option"),C=S(O),B=p("option"),z=S(L),y=g(),V=p("optgroup"),R=p("option"),Y=S(F),j=p("option"),K=S(W),l.__value=7,l.value=l.__value,s.__value=5,s.value=s.__value,f.__value=4,f.value=f.__value,_.__value=3,_.value=_.__value,c(e,"label","amsleser.no"),M.__value=2,M.value=M.__value,I.__value=1,I.value=I.__value,B.__value=0,B.value=B.__value,c(h,"label","Custom hardware"),R.__value=101,R.value=R.__value,j.__value=100,j.value=j.__value,c(V,"label","Generic hardware")},m(U,H){E(U,e,H),o(e,l),o(l,i),o(e,s),o(s,r),o(e,f),o(f,m),o(e,_),o(_,v),E(U,b,H),E(U,h,H),o(h,M),o(M,T),o(h,I),o(I,C),o(h,B),o(B,z),E(U,y,H),E(U,V,H),o(V,R),o(R,Y),o(V,j),o(j,K)},p(U,H){H&1&&n!==(n=lt(U[0],7)+"")&&q(i,n),H&1&&a!==(a=lt(U[0],5)+"")&&q(r,a),H&1&&u!==(u=lt(U[0],4)+"")&&q(m,u),H&1&&d!==(d=lt(U[0],3)+"")&&q(v,d),H&1&&k!==(k=lt(U[0],2)+"")&&q(T,k),H&1&&O!==(O=lt(U[0],1)+"")&&q(C,O),H&1&&L!==(L=lt(U[0],0)+"")&&q(z,L),H&1&&F!==(F=lt(U[0],101)+"")&&q(Y,F),H&1&&W!==(W=lt(U[0],100)+"")&&q(K,W)},d(U){U&&P(e),U&&P(b),U&&P(h),U&&P(y),U&&P(V)}}}function cf(t){let e,l,n=lt(t[0],201)+"",i,s,a=lt(t[0],202)+"",r,f,u=lt(t[0],203)+"",m,_,d=lt(t[0],241)+"",v,b,h=lt(t[0],242)+"",M,k,T=lt(t[0],243)+"",I,O,C=lt(t[0],200)+"",B;return{c(){e=p("optgroup"),l=p("option"),i=S(n),s=p("option"),r=S(a),f=p("option"),m=S(u),_=p("option"),v=S(d),b=p("option"),M=S(h),k=p("option"),I=S(T),O=p("option"),B=S(C),l.__value=201,l.value=l.__value,s.__value=202,s.value=s.__value,f.__value=203,f.value=f.__value,_.__value=241,_.value=_.__value,b.__value=242,b.value=b.__value,k.__value=243,k.value=k.__value,O.__value=200,O.value=O.__value,c(e,"label","Generic hardware")},m(L,z){E(L,e,z),o(e,l),o(l,i),o(e,s),o(s,r),o(e,f),o(f,m),o(e,_),o(_,v),o(e,b),o(b,M),o(e,k),o(k,I),o(e,O),o(O,B)},p(L,z){z&1&&n!==(n=lt(L[0],201)+"")&&q(i,n),z&1&&a!==(a=lt(L[0],202)+"")&&q(r,a),z&1&&u!==(u=lt(L[0],203)+"")&&q(m,u),z&1&&d!==(d=lt(L[0],241)+"")&&q(v,d),z&1&&h!==(h=lt(L[0],242)+"")&&q(M,h),z&1&&T!==(T=lt(L[0],243)+"")&&q(I,T),z&1&&C!==(C=lt(L[0],200)+"")&&q(B,C)},d(L){L&&P(e)}}}function mf(t){let e,l,n=lt(t[0],7)+"",i,s,a=lt(t[0],6)+"",r,f,u=lt(t[0],5)+"",m,_,d,v,b=lt(t[0],51)+"",h,M,k=lt(t[0],50)+"",T;return{c(){e=p("optgroup"),l=p("option"),i=S(n),s=p("option"),r=S(a),f=p("option"),m=S(u),_=g(),d=p("optgroup"),v=p("option"),h=S(b),M=p("option"),T=S(k),l.__value=7,l.value=l.__value,s.__value=6,s.value=s.__value,f.__value=5,f.value=f.__value,c(e,"label","amsleser.no"),v.__value=51,v.value=v.__value,M.__value=50,M.value=M.__value,c(d,"label","Generic hardware")},m(I,O){E(I,e,O),o(e,l),o(l,i),o(e,s),o(s,r),o(e,f),o(f,m),E(I,_,O),E(I,d,O),o(d,v),o(v,h),o(d,M),o(M,T)},p(I,O){O&1&&n!==(n=lt(I[0],7)+"")&&q(i,n),O&1&&a!==(a=lt(I[0],6)+"")&&q(r,a),O&1&&u!==(u=lt(I[0],5)+"")&&q(m,u),O&1&&b!==(b=lt(I[0],51)+"")&&q(h,b),O&1&&k!==(k=lt(I[0],50)+"")&&q(T,k)},d(I){I&&P(e),I&&P(_),I&&P(d)}}}function _f(t){let e,l,n=lt(t[0],8)+"",i,s,a,r,f=lt(t[0],71)+"",u,m,_=lt(t[0],70)+"",d;return{c(){e=p("optgroup"),l=p("option"),i=S(n),s=g(),a=p("optgroup"),r=p("option"),u=S(f),m=p("option"),d=S(_),l.__value=8,l.value=l.__value,c(e,"label","Custom hardware"),r.__value=71,r.value=r.__value,m.__value=70,m.value=m.__value,c(a,"label","Generic hardware")},m(v,b){E(v,e,b),o(e,l),o(l,i),E(v,s,b),E(v,a,b),o(a,r),o(r,u),o(a,m),o(m,d)},p(v,b){b&1&&n!==(n=lt(v[0],8)+"")&&q(i,n),b&1&&f!==(f=lt(v[0],71)+"")&&q(u,f),b&1&&_!==(_=lt(v[0],70)+"")&&q(d,_)},d(v){v&&P(e),v&&P(s),v&&P(a)}}}function pf(t){let e,l,n=lt(t[0],200)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=S(n),l.__value=200,l.value=l.__value,c(e,"label","Generic hardware")},m(s,a){E(s,e,a),o(e,l),o(l,i)},p(s,a){a&1&&n!==(n=lt(s[0],200)+"")&&q(i,n)},d(s){s&&P(e)}}}function df(t){let e,l,n=lt(t[0],80)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=S(n),l.__value=80,l.value=l.__value,c(e,"label","Generic hardware")},m(s,a){E(s,e,a),o(e,l),o(l,i)},p(s,a){a&1&&n!==(n=lt(s[0],80)+"")&&q(i,n)},d(s){s&&P(e)}}}function Fc(t){let e,l,n,i,s,a,r,f,u=t[0]=="esp8266"&&rf(t),m=t[0]=="esp32"&&cf(t),_=t[0]=="esp32s2"&&mf(t),d=t[0]=="esp32c3"&&_f(t),v=t[0]=="esp32solo"&&pf(t),b=t[0]=="esp32s3"&&df(t);return{c(){e=p("option"),l=g(),u&&u.c(),n=g(),m&&m.c(),i=g(),_&&_.c(),s=g(),d&&d.c(),a=g(),v&&v.c(),r=g(),b&&b.c(),f=$t(),e.__value=-1,e.value=e.__value},m(h,M){E(h,e,M),E(h,l,M),u&&u.m(h,M),E(h,n,M),m&&m.m(h,M),E(h,i,M),_&&_.m(h,M),E(h,s,M),d&&d.m(h,M),E(h,a,M),v&&v.m(h,M),E(h,r,M),b&&b.m(h,M),E(h,f,M)},p(h,[M]){h[0]=="esp8266"?u?u.p(h,M):(u=rf(h),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null),h[0]=="esp32"?m?m.p(h,M):(m=cf(h),m.c(),m.m(i.parentNode,i)):m&&(m.d(1),m=null),h[0]=="esp32s2"?_?_.p(h,M):(_=mf(h),_.c(),_.m(s.parentNode,s)):_&&(_.d(1),_=null),h[0]=="esp32c3"?d?d.p(h,M):(d=_f(h),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null),h[0]=="esp32solo"?v?v.p(h,M):(v=pf(h),v.c(),v.m(r.parentNode,r)):v&&(v.d(1),v=null),h[0]=="esp32s3"?b?b.p(h,M):(b=df(h),b.c(),b.m(f.parentNode,f)):b&&(b.d(1),b=null)},i:Ze,o:Ze,d(h){h&&P(e),h&&P(l),u&&u.d(h),h&&P(n),m&&m.d(h),h&&P(i),_&&_.d(h),h&&P(s),d&&d.d(h),h&&P(a),v&&v.d(h),h&&P(r),b&&b.d(h),h&&P(f)}}}function Bc(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Uc extends It{constructor(e){super(),Lt(this,e,Bc,Fc,Dt,{chip:0})}}function vf(t){let e;return{c(){e=p("div"),e.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",c(e,"class","bd-red")},m(l,n){E(l,e,n)},d(l){l&&P(e)}}}function hf(t){let e,l,n,i,s,a,r;return a=new Hi({props:{chip:t[0].chip}}),{c(){e=p("div"),l=S("HAN GPIO"),n=p("br"),i=g(),s=p("select"),Oe(a.$$.fragment),c(s,"name","vh"),c(s,"class","in-s"),c(e,"class","my-3")},m(f,u){E(f,e,u),o(e,l),o(e,n),o(e,i),o(e,s),Le(a,s,null),r=!0},p(f,u){const m={};u&1&&(m.chip=f[0].chip),a.$set(m)},i(f){r||(J(a.$$.fragment,f),r=!0)},o(f){ie(a.$$.fragment,f),r=!1},d(f){f&&P(e),Ie(a)}}}function jc(t){let e,l,n,i,s,a,r,f,u,m,_,d,v,b,h,M,k,T,I,O,C,B,L,z,y,V,R,F,Y,j=t[0].usrcfg&&vf();b=new Uc({props:{chip:t[0].chip}});let W=t[0].board&&t[0].board>20&&hf(t);return V=new hl({props:{active:t[1],message:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("input"),s=g(),a=p("strong"),a.textContent="Initial configuration",r=g(),j&&j.c(),f=g(),u=p("div"),m=S("Board type"),_=p("br"),d=g(),v=p("select"),Oe(b.$$.fragment),h=g(),W&&W.c(),M=g(),k=p("div"),T=p("label"),I=p("input"),O=S(" Clear all other configuration"),C=g(),B=p("div"),B.innerHTML='',L=g(),z=p("span"),z.textContent="\xA0",y=g(),Oe(V.$$.fragment),c(i,"type","hidden"),c(i,"name","v"),i.value="true",c(a,"class","text-sm"),c(v,"name","vb"),c(v,"class","in-s"),t[0].board===void 0&&Wt(()=>t[5].call(v)),c(u,"class","my-3"),c(I,"type","checkbox"),c(I,"name","vr"),I.__value="true",I.value=I.__value,c(I,"class","rounded mb-1"),c(k,"class","my-3"),c(B,"class","my-3"),c(z,"class","clear-both"),c(n,"autocomplete","off"),c(l,"class","cnt"),c(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(K,U){E(K,e,U),o(e,l),o(l,n),o(n,i),o(n,s),o(n,a),o(n,r),j&&j.m(n,null),o(n,f),o(n,u),o(u,m),o(u,_),o(u,d),o(u,v),Le(b,v,null),ot(v,t[0].board,!0),o(n,h),W&&W.m(n,null),o(n,M),o(n,k),o(k,T),o(T,I),I.checked=t[2],o(T,O),o(n,C),o(n,B),o(n,L),o(n,z),E(K,y,U),Le(V,K,U),R=!0,F||(Y=[me(v,"change",t[5]),me(I,"change",t[6]),me(n,"submit",ln(t[3]))],F=!0)},p(K,[U]){K[0].usrcfg?j||(j=vf(),j.c(),j.m(n,f)):j&&(j.d(1),j=null);const H={};U&1&&(H.chip=K[0].chip),b.$set(H),U&1&&ot(v,K[0].board),K[0].board&&K[0].board>20?W?(W.p(K,U),U&1&&J(W,1)):(W=hf(K),W.c(),J(W,1),W.m(n,M)):W&&(bt(),ie(W,1,1,()=>{W=null}),gt()),U&4&&(I.checked=K[2]);const Z={};U&2&&(Z.active=K[1]),V.$set(Z)},i(K){R||(J(b.$$.fragment,K),J(W),J(V.$$.fragment,K),R=!0)},o(K){ie(b.$$.fragment,K),ie(W),ie(V.$$.fragment,K),R=!1},d(K){K&&P(e),j&&j.d(),Ie(b),W&&W.d(),K&&P(y),Ie(V,K),F=!1,Ht(Y)}}}function yc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,s=!1;async function a(m){l(1,s=!0);const _=new FormData(m.target),d=new URLSearchParams;for(let h of _){const[M,k]=h;d.append(M,k)}let b=await(await fetch("save",{method:"POST",body:d})).json();l(1,s=!1),kl.update(h=>(h.vndcfg=b.success,h.booting=b.reboot,h.if.eth=h.boardType>240&&h.boardType<250,h)),Ql(n+(i.usrcfg?"/":"/setup"))}let r=!1;kl.subscribe(m=>{l(0,i=m),m.fwconsent===1&&l(2,r=!i.usrcfg)});function f(){i.board=Jt(this),l(0,i)}function u(){r=this.checked,l(2,r)}return t.$$set=m=>{"basepath"in m&&l(4,n=m.basepath),"sysinfo"in m&&l(0,i=m.sysinfo)},[i,s,r,a,n,f,u]}class Hc extends It{constructor(e){super(),Lt(this,e,yc,jc,Dt,{basepath:4,sysinfo:0})}}function bf(t){var i,s,a;let e,l=((a=(s=(i=t[1].conf)==null?void 0:i.connection)==null?void 0:s.eth)!=null?a:"Ethernet")+"",n;return{c(){e=p("option"),n=S(l),e.__value=3,e.value=e.__value},m(r,f){E(r,e,f),o(e,n)},p(r,f){var u,m,_;f&2&&l!==(l=((_=(m=(u=r[1].conf)==null?void 0:u.connection)==null?void 0:m.eth)!=null?_:"Ethernet")+"")&&q(n,l)},d(r){r&&P(e)}}}function gf(t){var M,k,T,I,O,C;let e,l=((T=(k=(M=t[1].conf)==null?void 0:M.connection)==null?void 0:k.ssid)!=null?T:"SSID")+"",n,i,s,a,r,f,u,m=((C=(O=(I=t[1].conf)==null?void 0:I.connection)==null?void 0:O.psk)!=null?C:"Password")+"",_,d,v,b,h;return{c(){e=p("div"),n=S(l),i=p("br"),s=g(),a=p("input"),f=g(),u=p("div"),_=S(m),d=p("br"),v=g(),b=p("input"),c(a,"name","ss"),c(a,"type","text"),c(a,"class","in-s"),a.required=r=t[3]==1||t[3]==2,c(e,"class","my-3"),c(b,"name","sp"),c(b,"type","password"),c(b,"class","in-s"),c(b,"autocomplete","off"),b.required=h=t[3]==2,c(u,"class","my-3")},m(B,L){E(B,e,L),o(e,n),o(e,i),o(e,s),o(e,a),E(B,f,L),E(B,u,L),o(u,_),o(u,d),o(u,v),o(u,b)},p(B,L){var z,y,V,R,F,Y;L&2&&l!==(l=((V=(y=(z=B[1].conf)==null?void 0:z.connection)==null?void 0:y.ssid)!=null?V:"SSID")+"")&&q(n,l),L&8&&r!==(r=B[3]==1||B[3]==2)&&(a.required=r),L&2&&m!==(m=((Y=(F=(R=B[1].conf)==null?void 0:R.connection)==null?void 0:F.psk)!=null?Y:"Password")+"")&&q(_,m),L&8&&h!==(h=B[3]==2)&&(b.required=h)},d(B){B&&P(e),B&&P(f),B&&P(u)}}}function kf(t){let e,l,n,i,s,a,r,f;return r=new Fu({}),{c(){e=p("br"),l=g(),n=p("div"),i=p("input"),s=g(),a=p("select"),Oe(r.$$.fragment),c(i,"name","si"),c(i,"type","text"),c(i,"class","in-f w-full"),i.required=t[2],c(a,"name","su"),c(a,"class","in-l"),a.required=t[2],c(n,"class","flex")},m(u,m){E(u,e,m),E(u,l,m),E(u,n,m),o(n,i),o(n,s),o(n,a),Le(r,a,null),f=!0},p(u,m){(!f||m&4)&&(i.required=u[2]),(!f||m&4)&&(a.required=u[2])},i(u){f||(J(r.$$.fragment,u),f=!0)},o(u){ie(r.$$.fragment,u),f=!1},d(u){u&&P(e),u&&P(l),u&&P(n),Ie(r)}}}function wf(t){var h,M,k,T,I,O;let e,l,n=((k=(M=(h=t[1].conf)==null?void 0:h.network)==null?void 0:M.gw)!=null?k:"Gateway")+"",i,s,a,r,f,u,m=((O=(I=(T=t[1].conf)==null?void 0:T.network)==null?void 0:I.dns)!=null?O:"DNS")+"",_,d,v,b;return{c(){e=p("div"),l=p("div"),i=S(n),s=p("br"),a=g(),r=p("input"),f=g(),u=p("div"),_=S(m),d=p("br"),v=g(),b=p("input"),c(r,"name","sg"),c(r,"type","text"),c(r,"class","in-f w-full"),c(b,"name","sd"),c(b,"type","text"),c(b,"class","in-l w-full"),c(e,"class","my-3 flex")},m(C,B){E(C,e,B),o(e,l),o(l,i),o(l,s),o(l,a),o(l,r),o(e,f),o(e,u),o(u,_),o(u,d),o(u,v),o(u,b)},p(C,B){var L,z,y,V,R,F;B&2&&n!==(n=((y=(z=(L=C[1].conf)==null?void 0:L.network)==null?void 0:z.gw)!=null?y:"Gateway")+"")&&q(i,n),B&2&&m!==(m=((F=(R=(V=C[1].conf)==null?void 0:V.network)==null?void 0:R.dns)!=null?F:"DNS")+"")&&q(_,m)},d(C){C&&P(e)}}}function zc(t){var G,te,ee,oe,ce,Pe,Ce,de,Ne,Te,ve,be,He,ye,Ve,xe,Je,it,We,_t;let e,l,n,i,s,a,r=((te=(G=t[1].setup)==null?void 0:G.title)!=null?te:"Setup")+"",f,u,m,_=((ce=(oe=(ee=t[1].conf)==null?void 0:ee.connection)==null?void 0:oe.title)!=null?ce:"Connection")+"",d,v,b,h,M,k=((de=(Ce=(Pe=t[1].conf)==null?void 0:Pe.connection)==null?void 0:Ce.wifi)!=null?de:"Connect to WiFi")+"",T,I,O=((ve=(Te=(Ne=t[1].conf)==null?void 0:Ne.connection)==null?void 0:Te.ap)!=null?ve:"Standalone access point")+"",C,B,L,z,y=((ye=(He=(be=t[1].conf)==null?void 0:be.general)==null?void 0:He.hostname)!=null?ye:"Hostname")+"",V,R,F,Y,j,W,K,U,H=((xe=(Ve=t[1].setup)==null?void 0:Ve.static)!=null?xe:"Static IP")+"",Z,ne,X,$,ae,le,se=((it=(Je=t[1].btn)==null?void 0:Je.save)!=null?it:"Save")+"",fe,re,Q,x,ge,pe,N=t[0].if&&t[0].if.eth&&bf(t),w=(t[3]==1||t[3]==2)&&gf(t),D=t[2]&&kf(t),A=t[2]&&wf(t);return Q=new hl({props:{active:t[4],message:(_t=(We=t[1].setup)==null?void 0:We.mask)!=null?_t:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("input"),s=g(),a=p("strong"),f=S(r),u=g(),m=p("div"),d=S(_),v=p("br"),b=g(),h=p("select"),M=p("option"),T=S(k),I=p("option"),C=S(O),N&&N.c(),B=g(),w&&w.c(),L=g(),z=p("div"),V=S(y),R=g(),F=p("input"),Y=g(),j=p("div"),W=p("label"),K=p("input"),U=g(),Z=S(H),ne=g(),D&&D.c(),X=g(),A&&A.c(),$=g(),ae=p("div"),le=p("button"),fe=S(se),re=g(),Oe(Q.$$.fragment),c(i,"type","hidden"),c(i,"name","s"),i.value="true",c(a,"class","text-sm"),M.__value=1,M.value=M.__value,I.__value=2,I.value=I.__value,c(h,"name","sc"),c(h,"class","in-s"),t[3]===void 0&&Wt(()=>t[6].call(h)),c(m,"class","my-3"),c(F,"name","sh"),c(F,"type","text"),c(F,"class","in-s"),c(F,"maxlength","32"),c(F,"pattern","[a-z0-9_-]+"),c(F,"placeholder","Optional, ex.: ams-reader"),c(F,"autocomplete","off"),c(K,"type","checkbox"),c(K,"name","sm"),K.__value="static",K.value=K.__value,c(K,"class","rounded mb-1"),c(j,"class","my-3"),c(le,"type","submit"),c(le,"class","btn-pri"),c(ae,"class","my-3"),c(l,"class","cnt"),c(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Ee,_e){E(Ee,e,_e),o(e,l),o(l,n),o(n,i),o(n,s),o(n,a),o(a,f),o(n,u),o(n,m),o(m,d),o(m,v),o(m,b),o(m,h),o(h,M),o(M,T),o(h,I),o(I,C),N&&N.m(h,null),ot(h,t[3],!0),o(n,B),w&&w.m(n,null),o(n,L),o(n,z),o(z,V),o(z,R),o(z,F),Me(F,t[0].hostname),o(n,Y),o(n,j),o(j,W),o(W,K),K.checked=t[2],o(W,U),o(W,Z),o(j,ne),D&&D.m(j,null),o(n,X),A&&A.m(n,null),o(n,$),o(n,ae),o(ae,le),o(le,fe),E(Ee,re,_e),Le(Q,Ee,_e),x=!0,ge||(pe=[me(h,"change",t[6]),me(F,"input",t[7]),me(K,"change",t[8]),me(n,"submit",ln(t[5]))],ge=!0)},p(Ee,[_e]){var kt,wt,nt,vt,ze,Ke,Ye,Xe,Qe,ut,we,Ae,ke,ue,De,rt,st,at,pt,ht;(!x||_e&2)&&r!==(r=((wt=(kt=Ee[1].setup)==null?void 0:kt.title)!=null?wt:"Setup")+"")&&q(f,r),(!x||_e&2)&&_!==(_=((ze=(vt=(nt=Ee[1].conf)==null?void 0:nt.connection)==null?void 0:vt.title)!=null?ze:"Connection")+"")&&q(d,_),(!x||_e&2)&&k!==(k=((Xe=(Ye=(Ke=Ee[1].conf)==null?void 0:Ke.connection)==null?void 0:Ye.wifi)!=null?Xe:"Connect to WiFi")+"")&&q(T,k),(!x||_e&2)&&O!==(O=((we=(ut=(Qe=Ee[1].conf)==null?void 0:Qe.connection)==null?void 0:ut.ap)!=null?we:"Standalone access point")+"")&&q(C,O),Ee[0].if&&Ee[0].if.eth?N?N.p(Ee,_e):(N=bf(Ee),N.c(),N.m(h,null)):N&&(N.d(1),N=null),_e&8&&ot(h,Ee[3]),Ee[3]==1||Ee[3]==2?w?w.p(Ee,_e):(w=gf(Ee),w.c(),w.m(n,L)):w&&(w.d(1),w=null),(!x||_e&2)&&y!==(y=((ue=(ke=(Ae=Ee[1].conf)==null?void 0:Ae.general)==null?void 0:ke.hostname)!=null?ue:"Hostname")+"")&&q(V,y),_e&1&&F.value!==Ee[0].hostname&&Me(F,Ee[0].hostname),_e&4&&(K.checked=Ee[2]),(!x||_e&2)&&H!==(H=((rt=(De=Ee[1].setup)==null?void 0:De.static)!=null?rt:"Static IP")+"")&&q(Z,H),Ee[2]?D?(D.p(Ee,_e),_e&4&&J(D,1)):(D=kf(Ee),D.c(),J(D,1),D.m(j,null)):D&&(bt(),ie(D,1,1,()=>{D=null}),gt()),Ee[2]?A?A.p(Ee,_e):(A=wf(Ee),A.c(),A.m(n,$)):A&&(A.d(1),A=null),(!x||_e&2)&&se!==(se=((at=(st=Ee[1].btn)==null?void 0:st.save)!=null?at:"Save")+"")&&q(fe,se);const Ue={};_e&16&&(Ue.active=Ee[4]),_e&2&&(Ue.message=(ht=(pt=Ee[1].setup)==null?void 0:pt.mask)!=null?ht:"Saving"),Q.$set(Ue)},i(Ee){x||(J(D),J(Q.$$.fragment,Ee),x=!0)},o(Ee){ie(D),ie(Q.$$.fragment,Ee),x=!1},d(Ee){Ee&&P(e),N&&N.d(),w&&w.d(),D&&D.d(),A&&A.d(),Ee&&P(re),Ie(Q,Ee),ge=!1,Ht(pe)}}}function Wc(t,e,l){let n={};Ol.subscribe(v=>{l(1,n=v)});let{sysinfo:i={}}=e,s=!1,a=1,r=!1;function f(v){kl.update(b=>(b.trying=v,b))}async function u(v){l(4,r=!0);const b=new FormData(v.target),h=new URLSearchParams;for(let T of b){const[I,O]=T;h.append(I,O)}let k=await(await fetch("save",{method:"POST",body:h})).json();l(4,r=!1),kl.update(T=>(T.hostname=b.get("sh"),T.usrcfg=k.success,T.booting=k.reboot,s&&(T.net.ip=b.get("si"),T.net.mask=b.get("su"),T.net.gw=b.get("sg"),T.net.dns1=b.get("sd")),k.reboot&&setTimeout(Zn,5e3,i,f),T))}function m(){a=Jt(this),l(3,a)}function _(){i.hostname=this.value,l(0,i)}function d(){s=this.checked,l(2,s)}return t.$$set=v=>{"sysinfo"in v&&l(0,i=v.sysinfo)},[i,n,s,a,r,u,m,_,d]}class Gc extends It{constructor(e){super(),Lt(this,e,Wc,zc,Dt,{sysinfo:0})}}function Vc(t){var V,R,F,Y,j,W,K,U;let e,l,n,i=((R=(V=t[2].upload)==null?void 0:V.title)!=null?R:"Upload")+"",s,a,r,f,u,m=((Y=(F=t[2].upload)==null?void 0:F.desc)!=null?Y:"")+"",_,d,v,b,h,M,k,T,I=((W=(j=t[2].btn)==null?void 0:j.upload)!=null?W:"Upload")+"",O,C,B,L,z,y;return B=new hl({props:{active:t[3],message:(U=(K=t[2].upload)==null?void 0:K.mask)!=null?U:"Uploading"}}),{c(){e=p("div"),l=p("div"),n=p("strong"),s=S(i),a=g(),r=S(t[1]),f=g(),u=p("p"),_=S(m),d=g(),v=p("form"),b=p("input"),h=g(),M=p("div"),k=p("button"),T=p("p"),O=S(I),C=g(),Oe(B.$$.fragment),c(u,"class","mb-4"),c(b,"name","file"),c(b,"type","file"),c(T,"class","mb-4"),c(k,"type","submit"),c(k,"class","btn-pri"),c(M,"class","w-full text-right mt-4"),c(v,"action",t[0]),c(v,"enctype","multipart/form-data"),c(v,"method","post"),c(v,"autocomplete","off"),c(l,"class","cnt"),c(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(H,Z){E(H,e,Z),o(e,l),o(l,n),o(n,s),o(n,a),o(n,r),o(l,f),o(l,u),o(u,_),o(l,d),o(l,v),o(v,b),o(v,h),o(v,M),o(M,k),o(k,T),o(T,O),E(H,C,Z),Le(B,H,Z),L=!0,z||(y=me(v,"submit",t[4]),z=!0)},p(H,[Z]){var X,$,ae,le,se,fe,re,Q;(!L||Z&4)&&i!==(i=(($=(X=H[2].upload)==null?void 0:X.title)!=null?$:"Upload")+"")&&q(s,i),(!L||Z&2)&&q(r,H[1]),(!L||Z&4)&&m!==(m=((le=(ae=H[2].upload)==null?void 0:ae.desc)!=null?le:"")+"")&&q(_,m),(!L||Z&4)&&I!==(I=((fe=(se=H[2].btn)==null?void 0:se.upload)!=null?fe:"Upload")+"")&&q(O,I),(!L||Z&1)&&c(v,"action",H[0]);const ne={};Z&8&&(ne.active=H[3]),Z&4&&(ne.message=(Q=(re=H[2].upload)==null?void 0:re.mask)!=null?Q:"Uploading"),B.$set(ne)},i(H){L||(J(B.$$.fragment,H),L=!0)},o(H){ie(B.$$.fragment,H),L=!1},d(H){H&&P(e),H&&P(C),Ie(B,H),z=!1,y()}}}function Kc(t,e,l){let{action:n}=e,{title:i}=e,s={};Ol.subscribe(f=>{l(2,s=f)});let a=!1;const r=()=>l(3,a=!0);return t.$$set=f=>{"action"in f&&l(0,n=f.action),"title"in f&&l(1,i=f.title)},[n,i,s,a,r]}class os extends It{constructor(e){super(),Lt(this,e,Kc,Vc,Dt,{action:0,title:1})}}function Yc(t){var Q,x,ge,pe,N,w,D,A,G,te,ee,oe,ce,Pe;let e,l,n,i,s=((x=(Q=t[1].consent)==null?void 0:Q.title)!=null?x:"Consents")+"",a,r,f,u,m,_=((pe=(ge=t[1].consent)==null?void 0:ge.one_click)!=null?pe:"One-click")+"",d,v,b,h,M=((w=(N=t[1].consent)==null?void 0:N.read_more)!=null?w:"Read more")+"",k,T,I,O,C,B,L,z=((A=(D=t[1].consent)==null?void 0:D.yes)!=null?A:"Yes")+"",y,V,R,F,Y,j,W=((te=(G=t[1].consent)==null?void 0:G.no)!=null?te:"No")+"",K,U,H,Z,ne,X=((oe=(ee=t[1].btn)==null?void 0:ee.save)!=null?oe:"Save")+"",$,ae,le,se,fe,re;return le=new hl({props:{active:t[2],message:(Pe=(ce=t[1].consent)==null?void 0:ce.mask_saving)!=null?Pe:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("div"),a=S(s),r=g(),f=p("hr"),u=g(),m=p("div"),d=S(_),v=p("br"),b=g(),h=p("a"),k=S(M),T=p("br"),I=g(),O=p("label"),C=p("input"),L=g(),y=S(z),V=g(),R=p("label"),F=p("input"),j=g(),K=S(W),U=p("br"),H=g(),Z=p("div"),ne=p("button"),$=S(X),ae=g(),Oe(le.$$.fragment),c(h,"href",ql("Data-collection-on-one-click-firmware-upgrade")),c(h,"target","_blank"),c(h,"class","text-blue-600 hover:text-blue-800"),c(C,"type","radio"),c(C,"name","sf"),C.value=1,C.checked=B=t[0].fwconsent===1,c(C,"class","rounded m-2"),C.required=!0,c(F,"type","radio"),c(F,"name","sf"),F.value=2,F.checked=Y=t[0].fwconsent===2,c(F,"class","rounded m-2"),F.required=!0,c(m,"class","my-3"),c(ne,"type","submit"),c(ne,"class","btn-pri"),c(Z,"class","my-3"),c(n,"autocomplete","off"),c(l,"class","cnt"),c(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(Ce,de){E(Ce,e,de),o(e,l),o(l,n),o(n,i),o(i,a),o(n,r),o(n,f),o(n,u),o(n,m),o(m,d),o(m,v),o(m,b),o(m,h),o(h,k),o(m,T),o(m,I),o(m,O),o(O,C),o(O,L),o(O,y),o(m,V),o(m,R),o(R,F),o(R,j),o(R,K),o(m,U),o(n,H),o(n,Z),o(Z,ne),o(ne,$),E(Ce,ae,de),Le(le,Ce,de),se=!0,fe||(re=me(n,"submit",ln(t[3])),fe=!0)},p(Ce,[de]){var Te,ve,be,He,ye,Ve,xe,Je,it,We,_t,Ee,_e,Ue;(!se||de&2)&&s!==(s=((ve=(Te=Ce[1].consent)==null?void 0:Te.title)!=null?ve:"Consents")+"")&&q(a,s),(!se||de&2)&&_!==(_=((He=(be=Ce[1].consent)==null?void 0:be.one_click)!=null?He:"One-click")+"")&&q(d,_),(!se||de&2)&&M!==(M=((Ve=(ye=Ce[1].consent)==null?void 0:ye.read_more)!=null?Ve:"Read more")+"")&&q(k,M),(!se||de&1&&B!==(B=Ce[0].fwconsent===1))&&(C.checked=B),(!se||de&2)&&z!==(z=((Je=(xe=Ce[1].consent)==null?void 0:xe.yes)!=null?Je:"Yes")+"")&&q(y,z),(!se||de&1&&Y!==(Y=Ce[0].fwconsent===2))&&(F.checked=Y),(!se||de&2)&&W!==(W=((We=(it=Ce[1].consent)==null?void 0:it.no)!=null?We:"No")+"")&&q(K,W),(!se||de&2)&&X!==(X=((Ee=(_t=Ce[1].btn)==null?void 0:_t.save)!=null?Ee:"Save")+"")&&q($,X);const Ne={};de&4&&(Ne.active=Ce[2]),de&2&&(Ne.message=(Ue=(_e=Ce[1].consent)==null?void 0:_e.mask_saving)!=null?Ue:"Saving"),le.$set(Ne)},i(Ce){se||(J(le.$$.fragment,Ce),se=!0)},o(Ce){ie(le.$$.fragment,Ce),se=!1},d(Ce){Ce&&P(e),Ce&&P(ae),Ie(le,Ce),fe=!1,re()}}}function Qc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,s={};Ol.subscribe(f=>{l(1,s=f)});let a=!1;async function r(f){l(2,a=!0);const u=new FormData(f.target),m=new URLSearchParams;for(let v of u){const[b,h]=v;m.append(b,h)}let d=await(await fetch("save",{method:"POST",body:m})).json();l(2,a=!1),kl.update(v=>(v.fwconsent=u.sf===!0?1:u.sf===!1?2:0,v.booting=d.reboot,v)),Ql(n)}return t.$$set=f=>{"basepath"in f&&l(4,n=f.basepath),"sysinfo"in f&&l(0,i=f.sysinfo)},[i,s,a,r,n]}class Xc extends It{constructor(e){super(),Lt(this,e,Qc,Yc,Dt,{basepath:4,sysinfo:0})}}function Cf(t,e,l){const n=t.slice();return n[30]=e[l],n[31]=e,n[32]=l,n}function Sf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Zc(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Mf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Jc(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Nf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Tf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Pf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Ef(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Df(t){let e,l=t[1].o,n=[];for(let i=0;i0?"text-green-600":"text-gray-300"),c(Ve,"class",Je=t[32]{l(0,i=U)});let s=["mo","tu","we","th","fr","sa","su"],a={},r=!0,f=!1;Ru.subscribe(U=>{U.o&&(l(1,a=U),l(2,r=!1))}),H0();async function u(U){l(3,f=!0);const H=new URLSearchParams;H.append("r","true"),H.append("rc",a.o.length),a.o.forEach(function(ne,X){H.append("rt"+X,ne.t),H.append("rn"+X,ne.n),H.append("rd"+X,ne.d),H.append("ra"+X,ne.a),H.append("rh"+X,ne.h),H.append("rv"+X,ne.v),H.append("rsm"+X,ne.s.m),H.append("rsd"+X,ne.s.d),H.append("rem"+X,ne.e.m),H.append("red"+X,ne.e.d)}),await(await fetch("save",{method:"POST",body:H})).json(),l(3,f=!1),Ql(n+"configuration")}let m=function(U,H){return U.includes(H)?U=U.filter(function(Z){return Z!==H}):U.push(H),U},_=function(){let U=a.o;U.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.001,s:{m:0,d:0},e:{m:0,d:0}}),l(1,a.o=U,a)},d=function(U){let H=a.o;H.splice(U,1),l(1,a.o=H,a)},v=function(U){if(U<=0)return;let H=a.o;var Z=H[U];H[U]=H[U-1],H[U-1]=Z,l(1,a.o=H,a)},b=function(U){let H=a.o;if(!(U>=H.length-1)){var Z=H[U];H[U]=H[U+1],H[U+1]=Z,l(1,a.o=H,a)}};function h(U,H){U[H].n=this.value,l(1,a)}function M(U,H){U[H].d=Jt(this),l(1,a)}function k(U,H){U[H].t=Jt(this),l(1,a)}function T(U,H){U[H].v=$e(this.value),l(1,a)}const I=(U,H,Z,ne)=>l(1,Z[ne].a=m(U.a,H),a),O=(U,H,Z,ne)=>l(1,Z[ne].h=m(U.h,H),a),C=(U,H,Z,ne)=>l(1,Z[ne].h=m(U.h,H+8),a),B=(U,H,Z,ne)=>l(1,Z[ne].h=m(U.h,H+16),a);function L(U,H){U[H].s.d=Jt(this),l(1,a)}function z(U,H){U[H].s.m=Jt(this),l(1,a)}function y(U,H){U[H].e.d=Jt(this),l(1,a)}function V(U,H){U[H].e.m=Jt(this),l(1,a)}const R=U=>v(U),F=U=>v(U),Y=U=>b(U),j=U=>b(U),W=U=>d(U),K=U=>d(U);return t.$$set=U=>{"basepath"in U&&l(11,n=U.basepath)},[i,a,r,f,s,u,m,_,d,v,b,n,h,M,k,T,I,O,C,B,L,z,y,V,R,F,Y,j,W,K]}class lm extends It{constructor(e){super(),Lt(this,e,tm,em,Dt,{basepath:11},null,[-1,-1])}}function Bf(t,e,l){const n=t.slice();return n[13]=e[l],n[14]=e,n[15]=l,n}function Uf(t,e,l){const n=t.slice();return n[13]=e[l],n[16]=e,n[17]=l,n}function jf(t){let e,l,n,i=t[1],s=[];for(let a=0;a{l(3,r=M)});let f=!1,u,m;async function _(){if(confirm("Clear all data?"))for(let M in i)(M.startsWith("i")||M.startsWith("e"))&&l(0,i[M]=0,i)}let d=!1;async function v(M){l(5,d=!0);const k=new FormData(M.target),T=new URLSearchParams;for(let O of k){const[C,B]=O;T.append(C,B)}await(await fetch(s,{method:"POST",body:T})).json(),l(5,d=!1),Ql(a)}function b(M){i[M.key]=$e(this.value),l(0,i)}function h(M){i[M.key]=$e(this.value),l(0,i)}return t.$$set=M=>{"prefix"in M&&l(8,n=M.prefix),"data"in M&&l(0,i=M.data),"url"in M&&l(9,s=M.url),"basepath"in M&&l(10,a=M.basepath)},t.$$.update=()=>{if(t.$$.dirty&263){l(1,u=[]),l(2,m=[]);for(let M in i){let k=[];M.startsWith("i")?k=u:M.startsWith("e")&&(k=m,i[M]&&l(4,f=!0)),k.push({key:M,name:n+" "+M.substring(1),value:i[M]})}}},[i,u,m,r,f,d,_,v,n,s,a,b,h]}class Uu extends It{constructor(e){super(),Lt(this,e,im,nm,Dt,{prefix:8,data:0,url:9,basepath:10})}}function sm(t){let e,l;return e=new j0({props:{data:t[7],sysinfo:t[6],prices:t[1],dayPlot:t[2],monthPlot:t[3],temperatures:t[4],translations:t[5],tariffData:t[8]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.data=n[7]),i&64&&(s.sysinfo=n[6]),i&2&&(s.prices=n[1]),i&4&&(s.dayPlot=n[2]),i&8&&(s.monthPlot=n[3]),i&16&&(s.temperatures=n[4]),i&32&&(s.translations=n[5]),i&256&&(s.tariffData=n[8]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function om(t){let e,l;return e=new Sc({props:{sysinfo:t[6],basepath:t[0],data:t[7]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.sysinfo=n[6]),i&1&&(s.basepath=n[0]),i&128&&(s.data=n[7]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function am(t){let e,l;return e=new lm({props:{basepath:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function fm(t){let e,l;return e=new Rc({props:{sysinfo:t[6],data:t[7]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.sysinfo=n[6]),i&128&&(s.data=n[7]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function um(t){let e,l;return e=new os({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p:Ze,i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function rm(t){let e,l;return e=new os({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p:Ze,i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function cm(t){let e,l;return e=new os({props:{title:"private key",action:"/mqtt-key"}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p:Ze,i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function mm(t){let e,l;return e=new Xc({props:{sysinfo:t[6],basepath:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.sysinfo=n[6]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function _m(t){let e,l;return e=new Gc({props:{sysinfo:t[6]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.sysinfo=n[6]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function pm(t){let e,l;return e=new Hc({props:{sysinfo:t[6],basepath:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.sysinfo=n[6]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function dm(t){let e,l;return e=new Uu({props:{prefix:"UTC Hour",data:t[2],url:"/dayplot",basepath:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&4&&(s.data=n[2]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function vm(t){let e,l;return e=new Uu({props:{prefix:"Day",data:t[3],url:"/monthplot",basepath:t[0]}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&8&&(s.data=n[3]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function hm(t){let e,l,n,i,s,a,r,f,u,m,_,d,v,b,h,M,k,T,I,O,C,B,L,z,y,V;return e=new z1({props:{data:t[7],basepath:t[0]}}),n=new Ll({props:{path:"/",$$slots:{default:[sm]},$$scope:{ctx:t}}}),s=new Ll({props:{path:"/configuration",$$slots:{default:[om]},$$scope:{ctx:t}}}),r=new Ll({props:{path:"/priceconfig",$$slots:{default:[am]},$$scope:{ctx:t}}}),u=new Ll({props:{path:"/status",$$slots:{default:[fm]},$$scope:{ctx:t}}}),_=new Ll({props:{path:"/mqtt-ca",$$slots:{default:[um]},$$scope:{ctx:t}}}),v=new Ll({props:{path:"/mqtt-cert",$$slots:{default:[rm]},$$scope:{ctx:t}}}),h=new Ll({props:{path:"/mqtt-key",$$slots:{default:[cm]},$$scope:{ctx:t}}}),k=new Ll({props:{path:"/consent",$$slots:{default:[mm]},$$scope:{ctx:t}}}),I=new Ll({props:{path:"/setup",$$slots:{default:[_m]},$$scope:{ctx:t}}}),C=new Ll({props:{path:"/vendor",$$slots:{default:[pm]},$$scope:{ctx:t}}}),L=new Ll({props:{path:"/edit-day",$$slots:{default:[dm]},$$scope:{ctx:t}}}),y=new Ll({props:{path:"/edit-month",$$slots:{default:[vm]},$$scope:{ctx:t}}}),{c(){Oe(e.$$.fragment),l=g(),Oe(n.$$.fragment),i=g(),Oe(s.$$.fragment),a=g(),Oe(r.$$.fragment),f=g(),Oe(u.$$.fragment),m=g(),Oe(_.$$.fragment),d=g(),Oe(v.$$.fragment),b=g(),Oe(h.$$.fragment),M=g(),Oe(k.$$.fragment),T=g(),Oe(I.$$.fragment),O=g(),Oe(C.$$.fragment),B=g(),Oe(L.$$.fragment),z=g(),Oe(y.$$.fragment)},m(R,F){Le(e,R,F),E(R,l,F),Le(n,R,F),E(R,i,F),Le(s,R,F),E(R,a,F),Le(r,R,F),E(R,f,F),Le(u,R,F),E(R,m,F),Le(_,R,F),E(R,d,F),Le(v,R,F),E(R,b,F),Le(h,R,F),E(R,M,F),Le(k,R,F),E(R,T,F),Le(I,R,F),E(R,O,F),Le(C,R,F),E(R,B,F),Le(L,R,F),E(R,z,F),Le(y,R,F),V=!0},p(R,F){const Y={};F&128&&(Y.data=R[7]),F&1&&(Y.basepath=R[0]),e.$set(Y);const j={};F&1022&&(j.$$scope={dirty:F,ctx:R}),n.$set(j);const W={};F&705&&(W.$$scope={dirty:F,ctx:R}),s.$set(W);const K={};F&513&&(K.$$scope={dirty:F,ctx:R}),r.$set(K);const U={};F&704&&(U.$$scope={dirty:F,ctx:R}),u.$set(U);const H={};F&512&&(H.$$scope={dirty:F,ctx:R}),_.$set(H);const Z={};F&512&&(Z.$$scope={dirty:F,ctx:R}),v.$set(Z);const ne={};F&512&&(ne.$$scope={dirty:F,ctx:R}),h.$set(ne);const X={};F&577&&(X.$$scope={dirty:F,ctx:R}),k.$set(X);const $={};F&576&&($.$$scope={dirty:F,ctx:R}),I.$set($);const ae={};F&577&&(ae.$$scope={dirty:F,ctx:R}),C.$set(ae);const le={};F&517&&(le.$$scope={dirty:F,ctx:R}),L.$set(le);const se={};F&521&&(se.$$scope={dirty:F,ctx:R}),y.$set(se)},i(R){V||(J(e.$$.fragment,R),J(n.$$.fragment,R),J(s.$$.fragment,R),J(r.$$.fragment,R),J(u.$$.fragment,R),J(_.$$.fragment,R),J(v.$$.fragment,R),J(h.$$.fragment,R),J(k.$$.fragment,R),J(I.$$.fragment,R),J(C.$$.fragment,R),J(L.$$.fragment,R),J(y.$$.fragment,R),V=!0)},o(R){ie(e.$$.fragment,R),ie(n.$$.fragment,R),ie(s.$$.fragment,R),ie(r.$$.fragment,R),ie(u.$$.fragment,R),ie(_.$$.fragment,R),ie(v.$$.fragment,R),ie(h.$$.fragment,R),ie(k.$$.fragment,R),ie(I.$$.fragment,R),ie(C.$$.fragment,R),ie(L.$$.fragment,R),ie(y.$$.fragment,R),V=!1},d(R){Ie(e,R),R&&P(l),Ie(n,R),R&&P(i),Ie(s,R),R&&P(a),Ie(r,R),R&&P(f),Ie(u,R),R&&P(m),Ie(_,R),R&&P(d),Ie(v,R),R&&P(b),Ie(h,R),R&&P(M),Ie(k,R),R&&P(T),Ie(I,R),R&&P(O),Ie(C,R),R&&P(B),Ie(L,R),R&&P(z),Ie(y,R)}}}function bm(t){let e,l,n,i;const s=[wm,km],a=[];function r(f,u){return f[6].trying?0:1}return e=r(t),l=a[e]=s[e](t),{c(){l.c(),n=$t()},m(f,u){a[e].m(f,u),E(f,n,u),i=!0},p(f,u){let m=e;e=r(f),e===m?a[e].p(f,u):(bt(),ie(a[m],1,1,()=>{a[m]=null}),gt(),l=a[e],l?l.p(f,u):(l=a[e]=s[e](f),l.c()),J(l,1),l.m(n.parentNode,n))},i(f){i||(J(l),i=!0)},o(f){ie(l),i=!1},d(f){a[e].d(f),f&&P(n)}}}function gm(t){let e,l;return e=new hl({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p:Ze,i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function km(t){let e,l;return e=new hl({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p:Ze,i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function wm(t){let e,l;return e=new hl({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[6].trying}}),{c(){Oe(e.$$.fragment)},m(n,i){Le(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.message="Device is booting, please wait. Trying to reach it on "+n[6].trying),e.$set(s)},i(n){l||(J(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Ie(e,n)}}}function Cm(t){let e,l,n,i,s,a;l=new vu({props:{basepath:t[0],$$slots:{default:[hm]},$$scope:{ctx:t}}});const r=[gm,bm],f=[];function u(m,_){return m[6].upgrading?0:m[6].booting?1:-1}return~(i=u(t))&&(s=f[i]=r[i](t)),{c(){e=p("div"),Oe(l.$$.fragment),n=g(),s&&s.c(),c(e,"class","container mx-auto m-3")},m(m,_){E(m,e,_),Le(l,e,null),o(e,n),~i&&f[i].m(e,null),a=!0},p(m,[_]){const d={};_&1&&(d.basepath=m[0]),_&1023&&(d.$$scope={dirty:_,ctx:m}),l.$set(d);let v=i;i=u(m),i===v?~i&&f[i].p(m,_):(s&&(bt(),ie(f[v],1,1,()=>{f[v]=null}),gt()),~i?(s=f[i],s?s.p(m,_):(s=f[i]=r[i](m),s.c()),J(s,1),s.m(e,null)):s=null)},i(m){a||(J(l.$$.fragment,m),J(s),a=!0)},o(m){ie(l.$$.fragment,m),ie(s),a=!1},d(m){m&&P(e),Ie(l),~i&&f[i].d()}}}function Sm(t,e,l){let n=document.getElementsByTagName("base")[0].getAttribute("href");n||(n="/");let i;ts.subscribe(d=>{l(1,i=d)});let s;Mu.subscribe(d=>{l(2,s=d)});let a;Nu.subscribe(d=>{l(3,a=d)});let r;Tu.subscribe(d=>{l(4,r=d)});let f={};Ol.subscribe(d=>{l(5,f=d)});let u={};kl.subscribe(d=>{var v;l(6,u=d),u.vndcfg===!1?Ql(n+"vendor"):u.usrcfg===!1?Ql(n+"setup"):u.fwconsent===0&&Ql(n+"consent"),u.ui.k===1?document.documentElement.classList.add("dark"):u.ui.k===0?document.documentElement.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),u.ui.lang&&u.ui.lang!=((v=f==null?void 0:f.language)==null?void 0:v.code)&&Du(u.ui.lang)});let m={};r1.subscribe(d=>{l(7,m=d),D0(d)});let _={};return Eu.subscribe(d=>{l(8,_=d)}),Pu(),[n,i,s,a,r,f,u,m,_]}class Mm extends It{constructor(e){super(),Lt(this,e,Sm,Cm,Dt,{})}}new Mm({target:document.getElementById("app")}); diff --git a/lib/SvelteUi/app/src/lib/DayPlot.svelte b/lib/SvelteUi/app/src/lib/DayPlot.svelte index 58efa252..c1acf4a6 100644 --- a/lib/SvelteUi/app/src/lib/DayPlot.svelte +++ b/lib/SvelteUi/app/src/lib/DayPlot.svelte @@ -18,9 +18,13 @@ let xTicks = []; let points = []; min = max = 0; - let cur = addHours(new Date(), -24); - let currentHour = new Date().getUTCHours(); - addHours(cur, sysinfo.clock_offset - ((24 + cur.getHours() - cur.getUTCHours())%24)); + let cur = new Date(); + let lm = new Date(); + lm.setDate(0); + lm.setHours(12); + let clock_adjust = ((lm.getHours() - lm.getUTCHours())%24) - sysinfo.clock_offset; + let currentHour = cur.getUTCHours(); + addHours(cur, -clock_adjust-24); for(i = currentHour; i<24; i++) { let imp = json["i"+zeropad(i)]; let exp = json["e"+zeropad(i)]; diff --git a/lib/SvelteUi/app/src/lib/MonthPlot.svelte b/lib/SvelteUi/app/src/lib/MonthPlot.svelte index f7c27609..0ec95f84 100644 --- a/lib/SvelteUi/app/src/lib/MonthPlot.svelte +++ b/lib/SvelteUi/app/src/lib/MonthPlot.svelte @@ -20,10 +20,12 @@ min = max = 0; let cur = new Date(); let lm = new Date(); - let clock_adjust = sysinfo.clock_offset - ((24 + cur.getHours() - cur.getUTCHours())%24); + lm.setDate(0); + lm.setHours(12); + + let clock_adjust = ((lm.getHours() - lm.getUTCHours())%24) - sysinfo.clock_offset; addHours(cur, -clock_adjust); addHours(lm, -clock_adjust); - lm.setDate(0); for(i = cur.getDate(); i<=lm.getDate(); i++) { let imp = json["i"+zeropad(i)];