From 84ff999c4c5f3a62a23a3da25b837f6a9bc0c505 Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Tue, 9 Apr 2024 21:57:44 +0200 Subject: [PATCH] Fixed missing config tile --- lib/SvelteUi/app/dist/index.js | 2 +- lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index e19ac3a0..b7f5d50f 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 o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function Xe(){}function Pl(t,e){for(const l in e)t[l]=e[l];return t}function Lf(t){return t()}function ps(){return Object.create(null)}function zt(t){t.forEach(Lf)}function ji(t){return typeof t=="function"}function Nt(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ei;function ai(t,e){return ei||(ei=document.createElement("a")),ei.href=e,t===ei.href}function Pu(t){return Object.keys(t).length===0}function Hi(t,...e){if(t==null)return Xe;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function un(t){let e;return Hi(t,l=>e=l)(),e}function Dl(t,e,l){t.$$.on_destroy.push(Hi(e,l))}function yi(t,e,l,n){if(t){const i=Of(t,e,l,n);return t[0](i)}}function Of(t,e,l,n){return t[1]&&n?Pl(l.ctx.slice(),t[1](n(e))):l.ctx}function zi(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 o=[],a=Math.max(e.dirty.length,i.length);for(let c=0;c32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function _n(t){return function(e){return e.preventDefault(),t.call(this,e)}}function r(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}const qu=["width","height"];function rn(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&&qu.indexOf(n)===-1?t[n]=e[n]:r(t,n,e[n])}function st(t){return t===""?null:+t}function Du(t){return Array.from(t.childNodes)}function D(t,e){e=""+e,t.data!==e&&(t.data=e)}function Lu(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Ou(t,e,l){~Au.indexOf(l)?Lu(t,e):D(t,e)}function Ee(t,e){t.value=e==null?"":e}function Gn(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=()=>{o=ve(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),A(n)}}function Ru(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function ds(t,e){return new t(e)}let Yn;function Vn(t){Yn=t}function Zn(){if(!Yn)throw new Error("Function called outside component initialization");return Yn}function If(t){Zn().$$.on_mount.push(t)}function Fu(t){Zn().$$.on_destroy.push(t)}function Uu(){const t=Zn();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=Ru(e,l,{cancelable:n});return i.slice().forEach(a=>{a.call(t,o)}),!o.defaultPrevented}return!0}}function Kn(t,e){return Zn().$$.context.set(t,e),e}function Kl(t){return Zn().$$.context.get(t)}const on=[],ri=[];let an=[];const vs=[],Rf=Promise.resolve();let Mi=!1;function Ff(){Mi||(Mi=!0,Rf.then(Uf))}function Bu(){return Ff(),Rf}function Gt(t){an.push(t)}const di=new Set;let nn=0;function Uf(){if(nn!==0)return;const t=Yn;do{try{for(;nnt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),an=e}const si=new Set;let Xl;function gt(){Xl={r:0,c:[],p:Xl}}function kt(){Xl.r||zt(Xl.c),Xl=Xl.p}function $(t,e){t&&t.i&&(si.delete(t),t.i(e))}function fe(t,e,l,n){if(t&&t.o){if(si.has(t))return;si.add(t),Xl.c.push(()=>{si.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function Bf(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const a=t[o],c=e[o];if(c){for(const _ in a)_ in c||(n[_]=1);for(const _ in c)i[_]||(l[_]=c[_],i[_]=1);t[o]=c}else for(const _ in a)i[_]=1}for(const a in n)a in l||(l[a]=void 0);return l}function hs(t){return typeof t=="object"&&t!==null?t:{}}function Re(t){t&&t.c()}function De(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||Gt(()=>{const a=t.$$.on_mount.map(Lf).filter(ji);t.$$.on_destroy?t.$$.on_destroy.push(...a):zt(a),t.$$.on_mount=[]}),o.forEach(Gt)}function Le(t,e){const l=t.$$;l.fragment!==null&&(Hu(l.after_update),zt(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function yu(t,e){t.$$.dirty[0]===-1&&(on.push(t),Ff(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const h=d.length?d[0]:v;return u.ctx&&i(u.ctx[p],u.ctx[p]=h)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](h),f&&yu(t,p)),v}):[],u.update(),f=!0,zt(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const p=Du(e.target);u.fragment&&u.fragment.l(p),p.forEach(A)}else u.fragment&&u.fragment.c();e.intro&&$(t.$$.fragment),De(t,e.target,e.anchor,e.customElement),Uf()}Vn(_)}class Dt{$destroy(){Le(this,1),this.$destroy=Xe}$on(e,l){if(!ji(l))return Xe;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&&!Pu(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const bs=t=>typeof t>"u",jf=t=>typeof t=="function",Hf=t=>typeof t=="number";function zu(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function yf(){let t=0;return()=>t++}function Wu(){return Math.random().toString(36).substring(2)}const Yl=typeof window>"u";function zf(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const Wf=(t,e)=>t?{}:{style:e},Si=t=>({"aria-hidden":"true",...Wf(t,"display:none;")}),sn=[];function Gf(t,e){return{subscribe:xt(t,e).subscribe}}function xt(t,e=Xe){let l;const n=new Set;function i(c){if(Nt(t,c)&&(t=c,l)){const _=!sn.length;for(const u of n)u[1](),sn.push(u,t);if(_){for(let u=0;u{n.delete(u),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:a}}function Gu(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return Gf(l,a=>{let c=!1;const _=[];let u=0,f=Xe;const p=()=>{if(u)return;f();const d=e(n?_[0]:_,a);o?a(d):f=ji(d)?d:Xe},v=i.map((d,h)=>Hi(d,g=>{_[h]=g,u&=~(1<{u|=1<`@@svnav-ctx__${t}`,Ci=Jn("LOCATION"),cn=Jn("ROUTER"),Vf=Jn("ROUTE"),Vu=Jn("ROUTE_PARAMS"),Ku=Jn("FOCUS_ELEM"),Kf=/^:(.+)/,yn=(t,e,l)=>t.substr(e,l),Ni=(t,e)=>yn(t,0,e.length)===e,Yu=t=>t==="",Qu=t=>Kf.test(t),Yf=t=>t[0]==="*",Xu=t=>t.replace(/\*.*$/,""),Qf=t=>t.replace(/(^\/+|\/+$)/g,"");function Ol(t,e=!1){const l=Qf(t).split("/");return e?l.filter(Boolean):l}const vi=(t,e)=>t+(e?`?${e}`:""),Ki=t=>`/${Qf(t)}`;function $n(...t){const e=n=>Ol(n,!0).join("/"),l=t.map(e).join("/");return Ki(l)}const Yi=1,pi=2,tn=3,Zu=4,Xf=5,Ju=6,Zf=7,$u=8,xu=9,Jf=10,$f=11,er={[Yi]:"Link",[pi]:"Route",[tn]:"Router",[Zu]:"useFocus",[Xf]:"useLocation",[Ju]:"useMatch",[Zf]:"useNavigate",[$u]:"useParams",[xu]:"useResolvable",[Jf]:"useResolve",[$f]:"navigate"},Qi=t=>er[t];function tr(t,e){let l;return t===pi?l=e.path?`path="${e.path}"`:"default":t===Yi?l=`to="${e.to}"`:t===tn&&(l=`basepath="${e.basepath||""}"`),`<${Qi(t)} ${l||""} />`}function lr(t,e,l,n){const i=l&&tr(n||t,l),o=i?` Occurred in: ${i}`:"",a=Qi(t),c=jf(e)?e(a):e;return`<${a}> ${c}${o}`}const xf=t=>(...e)=>t(lr(...e)),eu=xf(t=>{throw new Error(t)}),ci=xf(console.warn),gs=4,nr=3,ir=2,sr=1,or=1;function ar(t,e){const l=t.default?0:Ol(t.fullPath).reduce((n,i)=>{let o=n;return o+=gs,Yu(i)?o+=or:Qu(i)?o+=ir:Yf(i)?o-=gs+sr:o+=nr,o},0);return{route:t,score:l,index:e}}function fr(t){return t.map(ar).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function tu(t,e){let l,n;const[i]=e.split("?"),o=Ol(i),a=o[0]==="",c=fr(t);for(let _=0,u=c.length;_({...f,params:v,uri:T});if(f.default){n=d(e);continue}const h=Ol(f.fullPath),g=Math.max(o.length,h.length);let k=0;for(;k{u===".."?_.pop():u!=="."&&_.push(u)}),vi(`/${_.join("/")}`,n)}function ks(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,a=Ol(e,!0),c=Ol(l,!0);for(;a.length;)a[0]!==c[0]&&eu(tn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),a.shift(),c.shift();return{pathname:$n(...c),hash:n,search:i,state:o}}const ws=t=>t.length===1?"":t,Xi=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?ws(yn(t,l)):"",a=i?yn(t,0,l):t,c=n?ws(yn(a,e)):"";return{pathname:(n?yn(a,0,e):a)||"/",search:c,hash:o}},rr=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function cr(t,e,l){return $n(l,ur(t,e))}function _r(t,e){const l=Ki(Xu(t)),n=Ol(l,!0),i=Ol(e,!0).slice(0,n.length),o=lu({fullPath:l},$n(...i));return o&&o.uri}const hi="POP",mr="PUSH",pr="REPLACE";function bi(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function dr(t){let e=[],l=bi(t),n=hi;const i=(o=e)=>o.forEach(a=>a({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const a=()=>{l=bi(t),n=hi,i([o])};i([o]);const c=zf(t,"popstate",a);return()=>{c(),e=e.filter(_=>_!==o)}},navigate(o,a){const{state:c={},replace:_=!1}=a||{};if(n=_?pr:mr,Hf(o))a&&ci($f,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=hi,t.history.go(o);else{const u={...c,_key:Wu()};try{t.history[_?"replaceState":"pushState"](u,"",o)}catch{t.location[_?"replace":"assign"](o)}}l=bi(t),i()}}}function gi(t,e){return{...Xi(e),state:t}}function vr(t="/"){let e=0,l=[gi(null,t)];return{get entries(){return l},get location(){return l[e]},addEventListener(){},removeEventListener(){},history:{get state(){return l[e].state},pushState(n,i,o){e++,l=l.slice(0,e),l.push(gi(n,o))},replaceState(n,i,o){l[e]=gi(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const hr=!!(!Yl&&window.document&&window.document.createElement),br=!Yl&&window.location.origin==="null",nu=dr(hr&&!br?window:vr()),{navigate:en}=nu;let Il=null,iu=!0;function gr(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nIl.level||t.level===Il.level&&gr(t.routerId,Il.routerId))&&(Il=t)}function wr(){Il=null}function Mr(){iu=!1}function Ms(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=zf(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function Sr(t,e){return Number(t.dataset.svnavRouteEnd)===e}function Cr(t){return/^H[1-6]$/i.test(t.tagName)}function Ss(t,e=document){return e.querySelector(t)}function Nr(t){let l=Ss(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!Sr(l,t);){if(Cr(l))return l;const n=Ss("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function Tr(t){Promise.resolve(un(t.focusElement)).then(e=>{const l=e||Nr(t.id);l||ci(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,pi),!Ms(l)&&Ms(document.documentElement)})}const Er=(t,e,l)=>(n,i)=>Bu().then(()=>{if(!Il||iu){Mr();return}if(n&&Tr(Il.route),t.announcements&&i){const{path:o,fullPath:a,meta:c,params:_,uri:u}=Il.route,f=t.createAnnouncement({path:o,fullPath:a,meta:c,params:_,uri:u},un(l));Promise.resolve(f).then(p=>{e.set(p)})}wr()}),Pr="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 Ar(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},Wf(t[6],Pr)],i={};for(let o=0;o`Navigated to ${Z.uri}`,announcements:!0,...h},T=f,O=Ki(f),E=Kl(Ci),I=Kl(cn),N=!E,B=Dr(),S=d&&!(I&&!I.manageFocus),j=xt("");Dl(t,j,Z=>l(0,c=Z));const z=I?I.disableInlineStyles:g,V=xt([]);Dl(t,V,Z=>l(20,a=Z));const F=xt(null);Dl(t,F,Z=>l(18,i=Z));let R=!1;const G=N?0:I.level+1,H=N?xt((()=>ks(Yl?Xi(p):v.location,O))()):E;Dl(t,H,Z=>l(17,n=Z));const W=xt(n);Dl(t,W,Z=>l(19,o=Z));const K=Er(k,j,H),Q=Z=>X=>X.filter(oe=>oe.id!==Z);function J(Z){if(Yl){if(R)return;const X=lu(Z,n.pathname);if(X)return R=!0,X}else V.update(X=>{const oe=Q(Z.id)(X);return oe.push(Z),oe})}function ae(Z){V.update(Q(Z))}return!N&&f!==Cs&&ci(tn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:f}),N&&(If(()=>v.listen(X=>{const oe=ks(X.location,O);W.set(n),H.set(oe)})),Kn(Ci,H)),Kn(cn,{activeRoute:F,registerRoute:J,unregisterRoute:ae,manageFocus:S,level:G,id:B,history:N?v:I.history,basepath:N?O:I.basepath,disableInlineStyles:z}),t.$$set=Z=>{"basepath"in Z&&l(11,f=Z.basepath),"url"in Z&&l(12,p=Z.url),"history"in Z&&l(13,v=Z.history),"primary"in Z&&l(14,d=Z.primary),"a11y"in Z&&l(15,h=Z.a11y),"disableInlineStyles"in Z&&l(16,g=Z.disableInlineStyles),"$$scope"in Z&&l(21,u=Z.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&f!==T&&ci(tn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const Z=tu(a,n.pathname);F.set(Z)}if(t.$$.dirty[0]&655360&&N){const Z=!!n.hash,X=!Z&&S,oe=!Z||n.pathname!==o.pathname;K(X,oe)}t.$$.dirty[0]&262144&&S&&i&&i.primary&&kr({level:G,routerId:B,route:i})},[c,k,N,B,S,j,z,V,F,H,W,f,p,v,d,h,g,n,i,o,a,u,_]}class Or extends Dt{constructor(e){super(),qt(this,e,Lr,qr,Nt,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const su=Or;function xn(t,e,l=cn,n=tn){Kl(l)||eu(t,o=>`You cannot use ${o} outside of a ${Qi(n)}.`,e)}const Ir=t=>{const{subscribe:e}=Kl(t);return{subscribe:e}};function ou(){return xn(Xf),Ir(Ci)}function au(){const{history:t}=Kl(cn);return t}function fu(){const t=Kl(Vf);return t?Gu(t,e=>e.base):xt("/")}function uu(){xn(Jf);const t=fu(),{basepath:e}=Kl(cn);return n=>cr(n,un(t),e)}function Rr(){xn(Zf);const t=uu(),{navigate:e}=au();return(n,i)=>{const o=Hf(n)?n:t(n);return e(o,i)}}const Fr=t=>({params:t&16,location:t&8}),Ns=t=>({params:Yl?un(t[10]):t[4],location:t[3],navigate:t[11]});function Ts(t){let e,l;return e=new su({props:{primary:t[1],$$slots:{default:[jr]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Ur(t){let e;const l=t[18].default,n=yi(l,t,t[19],Ns);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&Wi(n,l,i,i[19],e?zi(l,i[19],o,Fr):Gi(i[19]),Ns)},i(i){e||($(n,i),e=!0)},o(i){fe(n,i),e=!1},d(i){n&&n.d(i)}}}function Br(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Yl?un(t[10]):t[4],t[12]];var o=t[0];function a(c){let _={};for(let u=0;u{Le(f,1)}),kt()}o?(e=ds(o,a()),Re(e.$$.fragment),$(e.$$.fragment,1),De(e,l.parentNode,l)):e=null}else o&&e.$set(u)},i(c){n||(e&&$(e.$$.fragment,c),n=!0)},o(c){e&&fe(e.$$.fragment,c),n=!1},d(c){c&&A(l),e&&Le(e,c)}}}function jr(t){let e,l,n,i;const o=[Br,Ur],a=[];function c(_,u){return _[0]!==null?0:1}return e=c(t),l=a[e]=o[e](t),{c(){l.c(),n=Qt()},m(_,u){a[e].m(_,u),q(_,n,u),i=!0},p(_,u){let f=e;e=c(_),e===f?a[e].p(_,u):(gt(),fe(a[f],1,1,()=>{a[f]=null}),kt(),l=a[e],l?l.p(_,u):(l=a[e]=o[e](_),l.c()),$(l,1),l.m(n.parentNode,n))},i(_){i||($(l),i=!0)},o(_){fe(l),i=!1},d(_){a[e].d(_),_&&A(n)}}}function Hr(t){let e,l,n,i,o,a=[Si(t[7]),{"data-svnav-route-start":t[5]}],c={};for(let p=0;p{_=null}),kt())},i(p){o||($(_),o=!0)},o(p){fe(_),o=!1},d(p){p&&A(e),p&&A(l),_&&_.d(p),p&&A(n),p&&A(i)}}}const yr=yf();function zr(t,e,l){let n;const i=["path","component","meta","primary"];let o=ui(e,i),a,c,_,u,{$$slots:f={},$$scope:p}=e,{path:v=""}=e,{component:d=null}=e,{meta:h={}}=e,{primary:g=!0}=e;xn(pi,e);const k=yr(),{registerRoute:T,unregisterRoute:O,activeRoute:E,disableInlineStyles:I}=Kl(cn);Dl(t,E,R=>l(16,a=R));const N=fu();Dl(t,N,R=>l(17,_=R));const B=ou();Dl(t,B,R=>l(3,c=R));const S=xt(null);let j;const z=xt(),V=xt({});Dl(t,V,R=>l(4,u=R)),Kn(Vf,z),Kn(Vu,V),Kn(Ku,S);const F=Rr();return Yl||Fu(()=>O(k)),t.$$set=R=>{l(24,e=Pl(Pl({},e),fi(R))),l(12,o=ui(e,i)),"path"in R&&l(13,v=R.path),"component"in R&&l(0,d=R.component),"meta"in R&&l(14,h=R.meta),"primary"in R&&l(1,g=R.primary),"$$scope"in R&&l(19,p=R.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const R=v==="",G=$n(_,v),U={id:k,path:v,meta:h,default:R,fullPath:R?"":G,base:R?_:_r(G,c.pathname),primary:g,focusElement:S};z.set(U),l(15,j=T(U))}if(t.$$.dirty&98304&&l(2,n=!!(j||a&&a.id===k)),t.$$.dirty&98308&&n){const{params:R}=j||a;V.set(R)}},e=fi(e),[d,g,n,c,u,k,E,I,N,B,V,F,o,v,h,j,a,_,f,p]}class Wr extends Dt{constructor(e){super(),qt(this,e,zr,Hr,Nt,{path:13,component:0,meta:14,primary:1})}}const ql=Wr;function Gr(t){let e,l,n,i;const o=t[13].default,a=yi(o,t,t[12],null);let c=[{href:t[0]},t[2],t[1]],_={};for(let u=0;ul(11,p=S));const E=Uu(),I=uu(),{navigate:N}=au();function B(S){E("click",S),zu(S)&&(S.preventDefault(),N(n,{state:k,replace:a||g}))}return t.$$set=S=>{l(19,e=Pl(Pl({},e),fi(S))),l(18,f=ui(e,u)),"to"in S&&l(5,h=S.to),"replace"in S&&l(6,g=S.replace),"state"in S&&l(7,k=S.state),"getProps"in S&&l(8,T=S.getProps),"$$scope"in S&&l(12,d=S.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=I(h,p)),t.$$.dirty&2049&&l(10,i=Ni(p.pathname,n)),t.$$.dirty&2049&&l(9,o=n===p.pathname),t.$$.dirty&2049&&(a=Xi(n)===rr(p)),t.$$.dirty&512&&l(2,c=o?{"aria-current":"page"}:{}),l(1,_=(()=>{if(jf(T)){const S=T({location:p,href:n,isPartiallyCurrent:i,isCurrent:o});return{...f,...S}}return f})())},e=fi(e),[n,_,c,O,B,h,g,k,T,o,i,p,d,v]}class Kr extends Dt{constructor(e){super(),qt(this,e,Vr,Gr,Nt,{to:5,replace:6,state:7,getProps:8})}}const Ml=Kr;function Vl(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function Yr(t,e){return t>218&&t<242?"#23ac05":t>212&&t<248?"#b1d900":t>208&&t<252?"#a3b200":"#b20000"}function Zi(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 Qn(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 Rt(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function xe(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 fn(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Vt(t,e){return t==1||t==2&&e}function kl(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function Yt(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<1?2:t<10?1:0),t.toFixed(e))}function Ll(t,e){return t.setTime(t.getTime()+e*36e5),t}function Es(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function Ps(t){return t=="EOE"?"https://transparency.entsoe.eu/-E":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}let li=0;function Xn(t,e){var l="";li++;var n=function(){setTimeout(Xn,1e3,t,e)};if(t.net.ip&&li%3==0){if(!t.net.ip){n();return}l="http://"+t.net.ip}else t.hostname&&li%3==1?l="http://"+t.hostname:t.hostname&&li%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(o){window.location.href=l||"/"}),i.open("GET",l+"/is-alive",!0),i.send()}function Jt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function As(t){return t.startsWith("esp32")?"esp32":t}function ml(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 oi={},Ti=[];async function Qr(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),o=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),o}let ki;async function ru(){if(Ti.length){let t=Ti.shift();delete oi[t.resource];try{let e=await Qr(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]()}}ki&&clearTimeout(ki),ki=setTimeout(ru,100)}ru();async function Al(t,e={}){let l;return oi[t]?l=oi[t]:(l={resource:t,options:e,callbacks:[]},oi[t]=l,Ti.push(l)),new Promise(i=>l.callbacks.push(i))}let El={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}};const dl=xt(El);async function Ji(){El=await(await Al("sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),dl.set(El)}function Xr(t){dl.update(e=>(e.trying=t,e))}let ni=0,qs=-127,Ds=null,Zr={};const cu=Gf(Zr,t=>{let e,l;async function n(){Al("data.json").then(i=>i.json()).then(i=>{t(i),qs!=i.t&&(qs=i.t,setTimeout(vu,2e3)),Ds==null&&i.pe&&i.p!=null&&(Ds=i.p,mu()),El.upgrading?window.location.reload():(!El||!El.chip||El.booting||ni>1&&!fn(El.board))&&(Ji(),Zl&&clearTimeout(Zl),Zl=setTimeout(xi,2e3),Jl&&clearTimeout(Jl),Jl=setTimeout(es,3e3));let o=5e3;if(fn(El.board)&&i.v>2.5){let a=3.3-Math.min(3.3,i.v);a>0&&(o=Math.max(a,.1)*10*5e3)}o>5e3&&console.log("Next in "+o+"ms"),e&&clearTimeout(e),e=setTimeout(n,o),ni=0}).catch(i=>{ni++,ni>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(n,15e3),l||(l=setTimeout(Xn,5e3,El,Xr))):e=setTimeout(n,fn(El.board)?1e4:5e3)})}return n(),function(){clearTimeout(e)}});let Ei={},zn;const $i=xt(Ei);async function _u(){let t=!1;if($i.update(e=>{for(var l=0;l<36;l++){if(e[Rt(l)]==null){t=l<12;break}e[Rt(l)]=e[Rt(l+1)]}return e}),t)mu();else{let e=new Date;zn=setTimeout(_u,(60-e.getMinutes())*6e4)}}async function mu(){zn&&(clearTimeout(zn),zn=0),Ei=await(await Al("energyprice.json")).json(),$i.set(Ei);let e=new Date;zn=setTimeout(_u,(60-e.getMinutes())*6e4)}let Pi={},Zl;async function xi(){Zl&&(clearTimeout(Zl),Zl=0),Pi=await(await Al("dayplot.json")).json(),pu.set(Pi);let e=new Date;Zl=setTimeout(xi,(60-e.getMinutes())*6e4+20)}const pu=xt(Pi,t=>(xi(),function(){}));let Ai={},Jl;async function es(){Jl&&(clearTimeout(Jl),Jl=0),Ai=await(await Al("monthplot.json")).json(),du.set(Ai);let e=new Date;Jl=setTimeout(es,(24-e.getHours())*36e5+40)}const du=xt(Ai,t=>(es(),function(){}));let qi={};async function vu(){qi=await(await Al("temperature.json")).json(),hu.set(qi)}const hu=xt(qi,t=>(vu(),function(){}));let Di={},ii;async function bu(){ii&&(clearTimeout(ii),ii=0),Di=await(await Al("tariff.json")).json(),gu.set(Di);let e=new Date;ii=setTimeout(bu,(60-e.getMinutes())*6e4+30)}const gu=xt(Di,t=>function(){});let Li=[];const ts=xt(Li);async function Jr(){Li=await(await Al("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),ts.set(Li)}let Ql=0,$r={data:[]};async function Oi(){let e=await(await Al(Ql<0?"realtime.json":"realtime.json?offset="+Ql)).json();Ii.update(l=>{for(let n=0;n=0&&(Ql+=e.size,Qlo&&(c=p):g==i+1&&(_=p);else if(h==n+1)if(u){let T=u.tag_name.substring(1).split(".");parseInt(T[0]);let O=parseInt(T[1]);parseInt(T[2]),g==O&&(u=p)}else u=p}return _||u||c||!1}else return e[0]}function Ls(t){var _,u;let e=((u=(_=t[1].header)==null?void 0:_.uptime)!=null?u:"Up")+"",l,n,i;function o(f,p){return f[2]>1?o1:f[2]>0?s1:f[3]>1?i1:f[3]>0?n1:f[4]>1?l1:f[4]>0?t1:e1}let a=o(t),c=a(t);return{c(){l=M(e),n=b(),c.c(),i=Qt()},m(f,p){q(f,l,p),q(f,n,p),c.m(f,p),q(f,i,p)},p(f,p){var v,d;p&2&&e!==(e=((d=(v=f[1].header)==null?void 0:v.uptime)!=null?d:"Up")+"")&&D(l,e),a===(a=o(f))&&c?c.p(f,p):(c.d(1),c=a(f),c&&(c.c(),c.m(i.parentNode,i)))},d(f){f&&A(l),f&&A(n),c.d(f),f&&A(i)}}}function e1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.seconds)!=null?a:"s")+"",i;return{c(){e=M(t[0]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&1&&D(e,c[0]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.seconds)!=null?f:"s")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function t1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.minute)!=null?a:"m")+"",i;return{c(){e=M(t[4]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&16&&D(e,c[4]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.minute)!=null?f:"m")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function l1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.minutes)!=null?a:"m")+"",i;return{c(){e=M(t[4]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&16&&D(e,c[4]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.minutes)!=null?f:"m")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function n1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.hour)!=null?a:"h")+"",i;return{c(){e=M(t[3]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&8&&D(e,c[3]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.hour)!=null?f:"h")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function i1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.hours)!=null?a:"h")+"",i;return{c(){e=M(t[3]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&8&&D(e,c[3]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.hours)!=null?f:"h")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function s1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.day)!=null?a:"d")+"",i;return{c(){e=M(t[2]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&4&&D(e,c[2]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.day)!=null?f:"d")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function o1(t){var o,a;let e,l,n=((a=(o=t[1].common)==null?void 0:o.days)!=null?a:"d")+"",i;return{c(){e=M(t[2]),l=b(),i=M(n)},m(c,_){q(c,e,_),q(c,l,_),q(c,i,_)},p(c,_){var u,f;_&4&&D(e,c[2]),_&2&&n!==(n=((f=(u=c[1].common)==null?void 0:u.days)!=null?f:"d")+"")&&D(i,n)},d(c){c&&A(e),c&&A(l),c&&A(i)}}}function a1(t){let e,l=t[0]&&Ls(t);return{c(){l&&l.c(),e=Qt()},m(n,i){l&&l.m(n,i),q(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Ls(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Xe,o:Xe,d(n){l&&l.d(n),n&&A(e)}}}function f1(t,e,l){let{epoch:n}=e,i={};vl.subscribe(_=>{l(1,i=_)});let o=0,a=0,c=0;return t.$$set=_=>{"epoch"in _&&l(0,n=_.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(2,o=Math.floor(n/86400)),l(3,a=Math.floor(n/3600)),l(4,c=Math.floor(n/60)))},[n,i,o,a,c]}class u1 extends Dt{constructor(e){super(),qt(this,e,f1,a1,Nt,{epoch:0})}}function r1(t){let e,l,n;return{c(){e=m("span"),l=M(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){q(i,e,o),s(e,l)},p(i,[o]){o&4&&D(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:Xe,o:Xe,d(i){i&&A(e)}}}function c1(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=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,o=a.text)},[n,i,o]}class $l extends Dt{constructor(e){super(),qt(this,e,c1,r1,Nt,{color:0,title:1,text:2})}}function _1(t){let e,l=`${Rt(t[0].getDate())}.${Rt(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Rt(t[0].getHours())}:${Rt(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=M(l),r(e,"class",t[1])},m(i,o){q(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Rt(i[0].getDate())}.${Rt(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Rt(i[0].getHours())}:${Rt(i[0].getMinutes())}`)&&D(n,l),o&2&&r(e,"class",i[1])},d(i){i&&A(e)}}}function m1(t){var n;let e=`${Rt(t[0].getDate())}. ${t[2].months?(n=t[2].months)==null?void 0:n[t[0].getMonth()]:Rt(t[0].getMonth())} ${Rt(t[0].getHours())}:${Rt(t[0].getMinutes())}`,l;return{c(){l=M(e)},m(i,o){q(i,l,o)},p(i,o){var a;o&5&&e!==(e=`${Rt(i[0].getDate())}. ${i[2].months?(a=i[2].months)==null?void 0:a[i[0].getMonth()]:Rt(i[0].getMonth())} ${Rt(i[0].getHours())}:${Rt(i[0].getMinutes())}`)&&D(l,e)},d(i){i&&A(l)}}}function p1(t){let e;function l(o,a){return o[3]?m1:_1}let n=l(t),i=n(t);return{c(){i.c(),e=Qt()},m(o,a){i.m(o,a),q(o,e,a)},p(o,[a]){n===(n=l(o))&&i?i.p(o,a):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:Xe,o:Xe,d(o){i.d(o),o&&A(e)}}}function d1(t,e,l){let n={};vl.subscribe(_=>{l(2,n=_)});let{timestamp:i}=e,{fullTimeColor:o}=e,{offset:a}=e,c;return t.$$set=_=>{"timestamp"in _&&l(0,i=_.timestamp),"fullTimeColor"in _&&l(1,o=_.fullTimeColor),"offset"in _&&l(4,a=_.offset)},t.$$.update=()=>{t.$$.dirty&17&&(l(3,c=Math.abs(new Date().getTime()-i.getTime())<3e5),isNaN(a)||Ll(i,a-(24+i.getHours()-i.getUTCHours())%24))},[i,o,n,c,a]}class Su extends Dt{constructor(e){super(),qt(this,e,d1,p1,Nt,{timestamp:0,fullTimeColor:1,offset:4})}}function v1(t){let e,l,n;return{c(){e=Ft("svg"),l=Ft("path"),n=Ft("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(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"),r(n,"stroke-linecap","round"),r(n,"stroke-linejoin","round"),r(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(i,o){q(i,e,o),s(e,l),s(e,n)},p:Xe,i:Xe,o:Xe,d(i){i&&A(e)}}}class h1 extends Dt{constructor(e){super(),qt(this,e,null,v1,Nt,{})}}function b1(t){let e,l;return{c(){e=Ft("svg"),l=Ft("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(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"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){q(n,e,i),s(e,l)},p:Xe,i:Xe,o:Xe,d(n){n&&A(e)}}}class g1 extends Dt{constructor(e){super(),qt(this,e,null,b1,Nt,{})}}function k1(t){let e,l;return{c(){e=Ft("svg"),l=Ft("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(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"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){q(n,e,i),s(e,l)},p:Xe,i:Xe,o:Xe,d(n){n&&A(e)}}}class w1 extends Dt{constructor(e){super(),qt(this,e,null,k1,Nt,{})}}function M1(t){let e,l,n=t[2].version+"",i;return{c(){e=M("AMS reader "),l=m("span"),i=M(n)},m(o,a){q(o,e,a),q(o,l,a),s(l,i)},p(o,a){a&4&&n!==(n=o[2].version+"")&&D(i,n)},d(o){o&&A(e),o&&A(l)}}}function Os(t){let e,l=(t[1].t>-50?t[1].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=M(l),i=M("\xB0C"),r(e,"class","flex-none my-auto")},m(o,a){q(o,e,a),s(e,n),s(e,i)},p(o,a){a&2&&l!==(l=(o[1].t>-50?o[1].t.toFixed(1):"-")+"")&&D(n,l)},d(o){o&&A(e)}}}function Is(t){var i,o,a,c,_;let e,l=((o=(i=t[4].header)==null?void 0:i.han)!=null?o:"HAN")+": "+((_=(c=(a=t[4].errors)==null?void 0:a.han)==null?void 0:c[t[1].he])!=null?_:t[1].he),n;return{c(){e=m("div"),n=M(l),r(e,"class","bd-red")},m(u,f){q(u,e,f),s(e,n)},p(u,f){var p,v,d,h,g;f&18&&l!==(l=((v=(p=u[4].header)==null?void 0:p.han)!=null?v:"HAN")+": "+((g=(h=(d=u[4].errors)==null?void 0:d.han)==null?void 0:h[u[1].he])!=null?g:u[1].he))&&D(n,l)},d(u){u&&A(e)}}}function Rs(t){var i,o,a,c,_;let e,l=((o=(i=t[4].header)==null?void 0:i.mqtt)!=null?o:"MQTT")+": "+((_=(c=(a=t[4].errors)==null?void 0:a.mqtt)==null?void 0:c[t[1].me])!=null?_:t[1].me),n;return{c(){e=m("div"),n=M(l),r(e,"class","bd-red")},m(u,f){q(u,e,f),s(e,n)},p(u,f){var p,v,d,h,g;f&18&&l!==(l=((v=(p=u[4].header)==null?void 0:p.mqtt)!=null?v:"MQTT")+": "+((g=(h=(d=u[4].errors)==null?void 0:d.mqtt)==null?void 0:h[u[1].me])!=null?g:u[1].me))&&D(n,l)},d(u){u&&A(e)}}}function Fs(t){var i,o,a,c,_;let e,l=((o=(i=t[4].header)==null?void 0:i.price)!=null?o:"PS")+": "+((_=(c=(a=t[4].errors)==null?void 0:a.price)==null?void 0:c[t[1].ee])!=null?_:t[1].ee),n;return{c(){e=m("div"),n=M(l),r(e,"class","bd-red")},m(u,f){q(u,e,f),s(e,n)},p(u,f){var p,v,d,h,g;f&18&&l!==(l=((v=(p=u[4].header)==null?void 0:p.price)!=null?v:"PS")+": "+((g=(h=(d=u[4].errors)==null?void 0:d.price)==null?void 0:h[u[1].ee])!=null?g:u[1].ee))&&D(n,l)},d(u){u&&A(e)}}}function Us(t){let e,l,n,i,o,a,c,_;return l=new Ml({props:{to:"/configuration",$$slots:{default:[S1]},$$scope:{ctx:t}}}),a=new Ml({props:{to:"/status",$$slots:{default:[C1]},$$scope:{ctx:t}}}),{c(){var u,f,p,v;e=m("div"),Re(l.$$.fragment),i=b(),o=m("div"),Re(a.$$.fragment),r(e,"class","flex-none px-1 mt-1"),r(e,"title",n=(f=(u=t[4].header)==null?void 0:u.config)!=null?f:""),r(o,"class","flex-none px-1 mt-1"),r(o,"title",c=(v=(p=t[4].header)==null?void 0:p.status)!=null?v:"")},m(u,f){q(u,e,f),De(l,e,null),q(u,i,f),q(u,o,f),De(a,o,null),_=!0},p(u,f){var d,h,g,k;const p={};f&64&&(p.$$scope={dirty:f,ctx:u}),l.$set(p),(!_||f&16&&n!==(n=(h=(d=u[4].header)==null?void 0:d.config)!=null?h:""))&&r(e,"title",n);const v={};f&64&&(v.$$scope={dirty:f,ctx:u}),a.$set(v),(!_||f&16&&c!==(c=(k=(g=u[4].header)==null?void 0:g.status)!=null?k:""))&&r(o,"title",c)},i(u){_||($(l.$$.fragment,u),$(a.$$.fragment,u),_=!0)},o(u){fe(l.$$.fragment,u),fe(a.$$.fragment,u),_=!1},d(u){u&&A(e),Le(l),u&&A(i),u&&A(o),Le(a)}}}function S1(t){let e,l;return e=new h1({}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function C1(t){let e,l;return e=new g1({}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Bs(t){let e,l;function n(a,c){return a[2].security==0||a[1].a?T1:N1}let i=n(t),o=i(t);return{c(){var a,c;e=m("div"),o.c(),r(e,"class","flex-none mr-3 text-yellow-500"),r(e,"title",l=((c=(a=t[4].header)==null?void 0:a.new_version)!=null?c:"New version")+": "+t[3].tag_name)},m(a,c){q(a,e,c),o.m(e,null)},p(a,c){var _,u;i===(i=n(a))&&o?o.p(a,c):(o.d(1),o=i(a),o&&(o.c(),o.m(e,null))),c&24&&l!==(l=((u=(_=a[4].header)==null?void 0:_.new_version)!=null?u:"New version")+": "+a[3].tag_name)&&r(e,"title",l)},d(a){a&&A(e),o.d()}}}function N1(t){var c,_;let e,l=((_=(c=t[4].header)==null?void 0:c.new_version)!=null?_:"New version")+"",n,i,o=t[3].tag_name+"",a;return{c(){e=m("span"),n=M(l),i=M(": "),a=M(o)},m(u,f){q(u,e,f),s(e,n),s(e,i),s(e,a)},p(u,f){var p,v;f&16&&l!==(l=((v=(p=u[4].header)==null?void 0:p.new_version)!=null?v:"New version")+"")&&D(n,l),f&8&&o!==(o=u[3].tag_name+"")&&D(a,o)},d(u){u&&A(e)}}}function T1(t){var f,p;let e,l,n=((p=(f=t[4].header)==null?void 0:f.new_version)!=null?p:"New version")+"",i,o,a=t[3].tag_name+"",c,_,u;return{c(){e=m("button"),l=m("span"),i=M(n),o=M(": "),c=M(a),r(l,"class","mt-1"),r(e,"class","flex")},m(v,d){q(v,e,d),s(e,l),s(l,i),s(l,o),s(l,c),_||(u=ve(e,"click",t[5]),_=!0)},p(v,d){var h,g;d&16&&n!==(n=((g=(h=v[4].header)==null?void 0:h.new_version)!=null?g:"New version")+"")&&D(i,n),d&8&&a!==(a=v[3].tag_name+"")&&D(c,a)},d(v){v&&A(e),_=!1,u()}}}function E1(t){var ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe;let e,l,n,i,o,a,c,_,u,f,p,v=((le=(ee=t[4].header)==null?void 0:ee.mem)!=null?le:"Free")+"",d,h,g=(t[1].m?(t[1].m/1e3).toFixed(1):"-")+"",k,T,O,E,I,N,B,S,j,z,V,F,R,G,U,H,W,K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke;i=new Ml({props:{to:"/",$$slots:{default:[M1]},$$scope:{ctx:t}}}),_=new u1({props:{epoch:t[1].u}});let pe=t[1].t>-50&&Os(t);I=new $l({props:{title:(_e=(se=t[4].header)==null?void 0:se.esp)!=null?_e:"ESP",text:t[2].booting?(Se=(Te=t[4].header)==null?void 0:Te.booting)!=null?Se:"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:Vl(t[2].booting?2:t[1].em)}}),B=new $l({props:{title:(ge=(we=t[4].header)==null?void 0:we.han)!=null?ge:"HAN",text:(je=(he=t[4].header)==null?void 0:he.han)!=null?je:"HAN",color:Vl(t[2].booting?9:t[1].hm)}}),j=new $l({props:{title:(We=(Ue=t[4].header)==null?void 0:Ue.wifi)!=null?We:"WiFi",text:t[1].r?t[1].r.toFixed(0)+"dBm":(Je=(Ze=t[4].header)==null?void 0:Ze.wifi)!=null?Je:"WiFi",color:Vl(t[2].booting?9:t[1].wm)}}),V=new $l({props:{title:(et=(Ye=t[4].header)==null?void 0:Ye.mqtt)!=null?et:"MQTT",text:(Oe=(He=t[4].header)==null?void 0:He.mqtt)!=null?Oe:"MQTT",color:Vl(t[2].booting?9:t[1].mm)}});let C=(t[1].he<0||t[1].he>0)&&Is(t),w=t[1].me<0&&Rs(t),P=(t[1].ee>0||t[1].ee<0)&&Fs(t);X=new Su({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&&Us(t);me=new w1({});let y=t[2].fwconsent===1&&t[3]&&Bs(t);return{c(){var ce,Pe;e=m("nav"),l=m("div"),n=m("div"),Re(i.$$.fragment),o=b(),a=m("div"),c=m("div"),Re(_.$$.fragment),u=b(),pe&&pe.c(),f=b(),p=m("div"),d=M(v),h=M(": "),k=M(g),T=M("kb"),O=b(),E=m("div"),Re(I.$$.fragment),N=b(),Re(B.$$.fragment),S=b(),Re(j.$$.fragment),z=b(),Re(V.$$.fragment),F=b(),C&&C.c(),R=b(),w&&w.c(),G=b(),P&&P.c(),U=b(),H=m("div"),W=m("div"),K=m("a"),Q=m("img"),ae=b(),Z=m("div"),Re(X.$$.fragment),oe=b(),L&&L.c(),ne=b(),ie=m("div"),re=m("a"),Re(me.$$.fragment),x=b(),y&&y.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(c,"class","flex-none my-auto"),r(p,"class","flex-none my-auto"),r(a,"class","flex-none my-auto p-2 flex space-x-4"),r(E,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(Q,"class","logo"),ai(Q.src,J=(t[0]+"/logo.svg").replace("//","/"))||r(Q,"src",J),r(Q,"alt","GitHub repo"),r(K,"class","float-right"),r(K,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(K,"target","_blank"),r(K,"rel","noreferrer"),r(K,"aria-label","GitHub"),r(W,"class","flex-none"),r(Z,"class","flex-none my-auto px-2"),r(re,"href",kl("")),r(re,"target","_blank"),r(re,"rel","noreferrer"),r(ie,"class","flex-none px-1 mt-1"),r(ie,"title",Y=(Pe=(ce=t[4].header)==null?void 0:ce.doc)!=null?Pe:""),r(H,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),r(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),r(e,"class","hdr")},m(ce,Pe){q(ce,e,Pe),s(e,l),s(l,n),De(i,n,null),s(l,o),s(l,a),s(a,c),De(_,c,null),s(a,u),pe&&pe.m(a,null),s(a,f),s(a,p),s(p,d),s(p,h),s(p,k),s(p,T),s(l,O),s(l,E),De(I,E,null),s(E,N),De(B,E,null),s(E,S),De(j,E,null),s(E,z),De(V,E,null),s(l,F),C&&C.m(l,null),s(l,R),w&&w.m(l,null),s(l,G),P&&P.m(l,null),s(l,U),s(l,H),s(H,W),s(W,K),s(K,Q),s(H,ae),s(H,Z),De(X,Z,null),s(H,oe),L&&L.m(H,null),s(H,ne),s(H,ie),s(ie,re),De(me,re,null),s(H,x),y&&y.m(H,null),ke=!0},p(ce,[Pe]){var vt,Mt,dt,te,be,Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut;const $e={};Pe&68&&($e.$$scope={dirty:Pe,ctx:ce}),i.$set($e);const Qe={};Pe&2&&(Qe.epoch=ce[1].u),_.$set(Qe),ce[1].t>-50?pe?pe.p(ce,Pe):(pe=Os(ce),pe.c(),pe.m(a,f)):pe&&(pe.d(1),pe=null),(!ke||Pe&16)&&v!==(v=((Mt=(vt=ce[4].header)==null?void 0:vt.mem)!=null?Mt:"Free")+"")&&D(d,v),(!ke||Pe&2)&&g!==(g=(ce[1].m?(ce[1].m/1e3).toFixed(1):"-")+"")&&D(k,g);const mt={};Pe&16&&(mt.title=(te=(dt=ce[4].header)==null?void 0:dt.esp)!=null?te:"ESP"),Pe&22&&(mt.text=ce[2].booting?(Tt=(be=ce[4].header)==null?void 0:be.booting)!=null?Tt:"Booting":ce[1].v>2?ce[1].v.toFixed(2)+"V":(qe=(Ce=ce[4].header)==null?void 0:Ce.esp)!=null?qe:"ESP"),Pe&6&&(mt.color=Vl(ce[2].booting?2:ce[1].em)),I.$set(mt);const ye={};Pe&16&&(ye.title=(at=(pt=ce[4].header)==null?void 0:pt.han)!=null?at:"HAN"),Pe&16&&(ye.text=(ut=(ft=ce[4].header)==null?void 0:ft.han)!=null?ut:"HAN"),Pe&6&&(ye.color=Vl(ce[2].booting?9:ce[1].hm)),B.$set(ye);const Ge={};Pe&16&&(Ge.title=(Ot=(Et=ce[4].header)==null?void 0:Et.wifi)!=null?Ot:"WiFi"),Pe&18&&(Ge.text=ce[1].r?ce[1].r.toFixed(0)+"dBm":(Pt=(St=ce[4].header)==null?void 0:St.wifi)!=null?Pt:"WiFi"),Pe&6&&(Ge.color=Vl(ce[2].booting?9:ce[1].wm)),j.$set(Ge);const ze={};Pe&16&&(ze.title=(yt=(It=ce[4].header)==null?void 0:It.mqtt)!=null?yt:"MQTT"),Pe&16&&(ze.text=(ht=(Ct=ce[4].header)==null?void 0:Ct.mqtt)!=null?ht:"MQTT"),Pe&6&&(ze.color=Vl(ce[2].booting?9:ce[1].mm)),V.$set(ze),ce[1].he<0||ce[1].he>0?C?C.p(ce,Pe):(C=Is(ce),C.c(),C.m(l,R)):C&&(C.d(1),C=null),ce[1].me<0?w?w.p(ce,Pe):(w=Rs(ce),w.c(),w.m(l,G)):w&&(w.d(1),w=null),ce[1].ee>0||ce[1].ee<0?P?P.p(ce,Pe):(P=Fs(ce),P.c(),P.m(l,U)):P&&(P.d(1),P=null),(!ke||Pe&1&&!ai(Q.src,J=(ce[0]+"/logo.svg").replace("//","/")))&&r(Q,"src",J);const tt={};Pe&2&&(tt.timestamp=ce[1].c?new Date(ce[1].c*1e3):new Date(0)),Pe&4&&(tt.offset=ce[2].clock_offset),X.$set(tt),ce[2].vndcfg&&ce[2].usrcfg?L?(L.p(ce,Pe),Pe&4&&$(L,1)):(L=Us(ce),L.c(),$(L,1),L.m(H,ne)):L&&(gt(),fe(L,1,1,()=>{L=null}),kt()),(!ke||Pe&16&&Y!==(Y=(Ut=(Lt=ce[4].header)==null?void 0:Lt.doc)!=null?Ut:""))&&r(ie,"title",Y),ce[2].fwconsent===1&&ce[3]?y?y.p(ce,Pe):(y=Bs(ce),y.c(),y.m(H,null)):y&&(y.d(1),y=null)},i(ce){ke||($(i.$$.fragment,ce),$(_.$$.fragment,ce),$(I.$$.fragment,ce),$(B.$$.fragment,ce),$(j.$$.fragment,ce),$(V.$$.fragment,ce),$(X.$$.fragment,ce),$(L),$(me.$$.fragment,ce),ke=!0)},o(ce){fe(i.$$.fragment,ce),fe(_.$$.fragment,ce),fe(I.$$.fragment,ce),fe(B.$$.fragment,ce),fe(j.$$.fragment,ce),fe(V.$$.fragment,ce),fe(X.$$.fragment,ce),fe(L),fe(me.$$.fragment,ce),ke=!1},d(ce){ce&&A(e),Le(i),Le(_),pe&&pe.d(),Le(I),Le(B),Le(j),Le(V),C&&C.d(),w&&w.d(),P&&P.d(),Le(X),L&&L.d(),Le(me),y&&y.d()}}}function P1(t,e,l){let{basepath:n="/"}=e,{data:i={}}=e,o={},a={};function c(){var u,f;confirm(((f=(u=_.header)==null?void 0:u.upgrade)!=null?f:"Upgrade to {0}?").replace("{0}",a.tag_name))&&(!fn(o.board)||confirm(mi(xe(o.chip,o.board))))&&(dl.update(p=>(p.upgrading=!0,p)),wu(a.tag_name))}dl.subscribe(u=>{l(2,o=u),u.fwconsent===1&&Jr()}),ts.subscribe(u=>{l(3,a=Mu(o.version,u))});let _={};return vl.subscribe(u=>{l(4,_=u)}),t.$$set=u=>{"basepath"in u&&l(0,n=u.basepath),"data"in u&&l(1,i=u.data)},[n,i,o,a,_,c]}class A1 extends Dt{constructor(e){super(),qt(this,e,P1,E1,Nt,{basepath:0,data:1})}}function q1(t){let e,l,n,i;return{c(){e=Ft("svg"),l=Ft("path"),n=Ft("path"),r(l,"d",wi(150,150,115,210,510)),r(l,"stroke","rgba(128, 128, 128, 0.15)"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=wi(150,150,115,210,210+300*t[0]/100)),r(n,"stroke",t[1]),r(n,"fill","none"),r(n,"stroke-width","55"),r(e,"viewBox","0 0 300 300"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"height","100%")},m(o,a){q(o,e,a),s(e,l),s(e,n)},p(o,[a]){a&1&&i!==(i=wi(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),a&2&&r(n,"stroke",o[1])},i:Xe,o:Xe,d(o){o&&A(e)}}}function js(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 wi(t,e,l,n,i){var o=js(t,e,l,i),a=js(t,e,l,n),c=i-n<=180?"0":"1",_=["M",o.x,o.y,"A",l,l,0,c,0,a.x,a.y].join(" ");return _}function D1(t,e,l){let{pct:n=0}=e,{color:i="red"}=e;return t.$$set=o=>{"pct"in o&&l(0,n=o.pct),"color"in o&&l(1,i=o.color)},[n,i]}class L1 extends Dt{constructor(e){super(),qt(this,e,D1,q1,Nt,{pct:0,color:1})}}function Hs(t){let e,l,n,i,o,a,c,_;return{c(){e=m("br"),l=b(),n=m("span"),i=M(t[1]),o=b(),a=m("span"),c=M(t[2]),_=M("/kWh"),r(n,"class","pl-sub"),r(a,"class","pl-snt")},m(u,f){q(u,e,f),q(u,l,f),q(u,n,f),s(n,i),q(u,o,f),q(u,a,f),s(a,c),s(a,_)},p(u,f){f&2&&D(i,u[1]),f&4&&D(c,u[2])},d(u){u&&A(e),u&&A(l),u&&A(n),u&&A(o),u&&A(a)}}}function O1(t){let e,l,n,i,o,a,c,_,u,f,p=t[4][0]+"",v,d,h,g=t[4][1]+"",k,T,O;l=new L1({props:{pct:t[5],color:t[3](t[5],document.documentElement.classList.contains("dark"))}});let E=t[1]&&Hs(t);return{c(){e=m("div"),Re(l.$$.fragment),n=b(),i=m("span"),o=m("span"),a=M(t[0]),c=b(),_=m("br"),u=b(),f=m("span"),v=M(p),d=b(),h=m("span"),k=M(g),T=b(),E&&E.c(),r(o,"class","pl-lab"),r(f,"class","pl-val"),r(h,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(I,N){q(I,e,N),De(l,e,null),s(e,n),s(e,i),s(i,o),s(o,a),s(i,c),s(i,_),s(i,u),s(i,f),s(f,v),s(i,d),s(i,h),s(h,k),s(i,T),E&&E.m(i,null),O=!0},p(I,[N]){const B={};N&32&&(B.pct=I[5]),N&40&&(B.color=I[3](I[5],document.documentElement.classList.contains("dark"))),l.$set(B),(!O||N&1)&&D(a,I[0]),(!O||N&16)&&p!==(p=I[4][0]+"")&&D(v,p),(!O||N&16)&&g!==(g=I[4][1]+"")&&D(k,g),I[1]?E?E.p(I,N):(E=Hs(I),E.c(),E.m(i,null)):E&&(E.d(1),E=null)},i(I){O||($(l.$$.fragment,I),O=!0)},o(I){fe(l.$$.fragment,I),O=!1},d(I){I&&A(e),Le(l),E&&E.d()}}}function I1(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:a}=e,{sub:c=""}=e,{subunit:_=""}=e,{colorFn:u}=e,f,p=0;return t.$$set=v=>{"val"in v&&l(6,n=v.val),"max"in v&&l(7,i=v.max),"unit"in v&&l(8,o=v.unit),"label"in v&&l(0,a=v.label),"sub"in v&&l(1,c=v.sub),"subunit"in v&&l(2,_=v.subunit),"colorFn"in v&&l(3,u=v.colorFn)},t.$$.update=()=>{t.$$.dirty&448&&(l(4,f=ml(n,o)),l(5,p=Math.min(n,i)/i*100))},[a,c,_,u,f,p,n,i,o]}class Cu extends Dt{constructor(e){super(),qt(this,e,I1,O1,Nt,{val:6,max:7,unit:8,label:0,sub:1,subunit:2,colorFn:3})}}function ys(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function zs(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Ws(t,e,l){const n=t.slice();return n[15]=e[l],n}function Gs(t){let e,l,n,i,o,a,c=t[0].title&&Vs(t),_=t[0].y.ticks,u=[];for(let h=0;h<_.length;h+=1)u[h]=Ys(Ws(t,_,h));let f=t[0].x.ticks,p=[];for(let h=0;ht[9].call(e))},m(o,a){q(o,e,a),s(e,n),i=Vi(e,t[9].bind(e))},p(o,a){a&1&&l!==(l=o[0].title+"")&&D(n,l)},d(o){o&&A(e),i()}}}function Ks(t){let e,l,n,i=t[15].label+"",o,a,c,_;return{c(){e=Ft("g"),l=Ft("line"),n=Ft("text"),o=M(i),r(l,"x2","100%"),r(n,"y","-4"),r(n,"x",a=t[15].align=="right"?"85%":""),r(e,"class",c="tick tick-"+t[15].value+" tick-"+t[15].color),r(e,"transform",_="translate(0, "+t[7](t[15].value)+")")},m(u,f){q(u,e,f),s(e,l),s(e,n),s(n,o)},p(u,f){f&1&&i!==(i=u[15].label+"")&&D(o,i),f&1&&a!==(a=u[15].align=="right"?"85%":"")&&r(n,"x",a),f&1&&c!==(c="tick tick-"+u[15].value+" tick-"+u[15].color)&&r(e,"class",c),f&129&&_!==(_="translate(0, "+u[7](u[15].value)+")")&&r(e,"transform",_)},d(u){u&&A(e)}}}function Ys(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Ks(t);return{c(){n&&n.c(),l=Qt()},m(i,o){n&&n.m(i,o),q(i,l,o)},p(i,o){o&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,o):(n=Ks(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&A(l)}}}function Qs(t){let e,l,n=(t[3]>20||t[13]%2==0)&&Xs(t);return{c(){e=Ft("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,o){q(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=Xs(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&A(e),n&&n.d()}}}function Xs(t){let e,l=t[11].label+"",n,i;return{c(){e=Ft("text"),n=M(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,a){q(o,e,a),s(e,n)},p(o,a){a&1&&l!==(l=o[11].label+"")&&D(n,l),a&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&A(e)}}}function Zs(t){let e=!isNaN(t[6](t[13])),l,n=e&&Qs(t);return{c(){n&&n.c(),l=Qt()},m(i,o){n&&n.m(i,o),q(i,l,o)},p(i,o){o&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,o):(n=Qs(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&A(l)}}}function Js(t){let e,l,n=t[11].value!==void 0&&$s(t),i=t[11].value2>1e-4&&to(t);return{c(){e=Ft("g"),n&&n.c(),l=Ft("g"),i&&i.c()},m(o,a){q(o,e,a),n&&n.m(e,null),q(o,l,a),i&&i.m(l,null)},p(o,a){o[11].value!==void 0?n?n.p(o,a):(n=$s(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,a):(i=to(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&A(e),n&&n.d(),o&&A(l),i&&i.d()}}}function $s(t){let e,l,n,i,o,a,c,_=t[3]>15&&xs(t);return{c(){e=Ft("rect"),_&&_.c(),c=Qt(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](t[11].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),r(e,"fill",a=t[11].color)},m(u,f){q(u,e,f),_&&_.m(u,f),q(u,c,f)},p(u,f){f&64&&l!==(l=u[6](u[13])+2)&&r(e,"x",l),f&129&&n!==(n=u[7](u[11].value))&&r(e,"y",n),f&8&&i!==(i=u[3]-4)&&r(e,"width",i),f&129&&o!==(o=u[7](u[0].y.min)-u[7](Math.min(u[0].y.min,0)+u[11].value))&&r(e,"height",o),f&1&&a!==(a=u[11].color)&&r(e,"fill",a),u[3]>15?_?_.p(u,f):(_=xs(u),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null)},d(u){u&&A(e),_&&_.d(u),u&&A(c)}}}function xs(t){let e,l=t[11].label+"",n,i,o,a,c,_,u=t[11].title&&eo(t);return{c(){e=Ft("text"),n=M(l),u&&u.c(),_=Qt(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[7](0)-t[8]&&!t[0].dark?t[11].color:"white"),r(e,"transform",c="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]f[7](0)-f[8]&&!f[0].dark?f[11].color:"white")&&r(e,"fill",a),p&457&&c!==(c="translate("+(f[6](f[13])+f[3]/2)+" "+(f[7](f[11].value)>f[7](0)-f[8]?f[7](f[11].value)-f[8]:f[7](f[11].value)+10)+") rotate("+(f[11].labelAngle?f[11].labelAngle:f[3]15&&lo(t);return{c(){e=Ft("rect"),_&&_.c(),c=Qt(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),r(e,"fill",a=t[11].color2?t[11].color2:t[11].color)},m(u,f){q(u,e,f),_&&_.m(u,f),q(u,c,f)},p(u,f){f&64&&l!==(l=u[6](u[13])+2)&&r(e,"x",l),f&128&&n!==(n=u[7](0))&&r(e,"y",n),f&8&&i!==(i=u[3]-4)&&r(e,"width",i),f&129&&o!==(o=u[7](u[0].y.min)-u[7](u[0].y.min+u[11].value2))&&r(e,"height",o),f&1&&a!==(a=u[11].color2?u[11].color2:u[11].color)&&r(e,"fill",a),u[3]>15?_?_.p(u,f):(_=lo(u),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null)},d(u){u&&A(e),_&&_.d(u),u&&A(c)}}}function lo(t){let e,l=t[11].label2+"",n,i,o,a,c,_=t[11].title2&&no(t);return{c(){e=Ft("text"),n=M(l),_&&_.c(),c=Qt(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[7](-t[11].value2)t[10].call(e))},m(i,o){q(i,e,o),n&&n.m(e,null),l=Vi(e,t[10].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=Gs(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:Xe,o:Xe,d(i){i&&A(e),n&&n.d(),l()}}}let xl=30;function F1(t,e,l){let{config:n}=e,i,o,a,c,_,u,f,p=0;function v(){p=this.clientHeight,l(5,p)}function d(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=h=>{"config"in h&&l(0,n=h.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,u=o-p);let h=i-(n.padding.left+n.padding.right);l(3,a=h/n.points.length),l(8,f=an.y.max?T=n.padding.bottom:ku||T<0?0:T})}},[n,i,o,a,u,p,c,_,f,v,d]}class ln extends Dt{constructor(e){super(),qt(this,e,F1,R1,Nt,{config:0})}}function U1(t){let e,l;return e=new ln({props:{config:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function B1(t,e,l){let{title:n}=e,{u1:i}=e,{u2:o}=e,{u3:a}=e,{ds:c}=e,_={};function u(f){return{label:Yt(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:Yr(f||0,document.documentElement.classList.contains("dark"))}}return t.$$set=f=>{"title"in f&&l(1,n=f.title),"u1"in f&&l(2,i=f.u1),"u2"in f&&l(3,o=f.u2),"u3"in f&&l(4,a=f.u3),"ds"in f&&l(5,c=f.ds)},t.$$.update=()=>{if(t.$$.dirty&62){let f=[],p=[];i>0&&(f.push({label:c===1?"L1-L2":"L1"}),p.push(u(i))),o>0&&(f.push({label:c===1?"L1-L3":"L2"}),p.push(u(o))),a>0&&(f.push({label:c===1?"L2-L3":"L3"}),p.push(u(a))),l(0,_={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:f},points:p})}},[_,n,i,o,a,c]}class j1 extends Dt{constructor(e){super(),qt(this,e,B1,U1,Nt,{title:1,u1:2,u2:3,u3:4,ds:5})}}function H1(t){var L,y,ee,le,se,_e,Te,Se,de,Ne;let e,l,n=((y=(L=t[0].reactive)==null?void 0:L.title)!=null?y:"Reactive")+"",i,o,a,c,_=((le=(ee=t[0].reactive)==null?void 0:ee.instant_in)!=null?le:"Instant in")+"",u,f,p,v=t[1][0]+"",d,h,g=t[1][1]+"",k,T,O,E=((_e=(se=t[0].reactive)==null?void 0:se.instant_out)!=null?_e:"Instant out")+"",I,N,B,S=t[2][0]+"",j,z,V=t[2][1]+"",F,R,G,U,H=((Se=(Te=t[0].reactive)==null?void 0:Te.total_in)!=null?Se:"Total in")+"",W,K,Q,J=t[3][0]+"",ae,Z,X=t[3][1]+"",oe,ne,ie,re=((Ne=(de=t[0].reactive)==null?void 0:de.total_out)!=null?Ne:"Total out")+"",me,Y,x,ke=t[4][0]+"",pe,C,w=t[4][1]+"",P;return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("div"),c=m("div"),u=M(_),f=b(),p=m("div"),d=M(v),h=b(),k=M(g),T=b(),O=m("div"),I=M(E),N=b(),B=m("div"),j=M(S),z=b(),F=M(V),R=b(),G=m("div"),U=m("div"),W=M(H),K=b(),Q=m("div"),ae=M(J),Z=b(),oe=M(X),ne=b(),ie=m("div"),me=M(re),Y=b(),x=m("div"),pe=M(ke),C=b(),P=M(w),r(p,"class","text-right"),r(B,"class","text-right"),r(a,"class","grid grid-cols-2 mt-4"),r(Q,"class","text-right"),r(x,"class","text-right"),r(G,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(we,ge){q(we,e,ge),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(c,u),s(a,f),s(a,p),s(p,d),s(p,h),s(p,k),s(a,T),s(a,O),s(O,I),s(a,N),s(a,B),s(B,j),s(B,z),s(B,F),s(e,R),s(e,G),s(G,U),s(U,W),s(G,K),s(G,Q),s(Q,ae),s(Q,Z),s(Q,oe),s(G,ne),s(G,ie),s(ie,me),s(G,Y),s(G,x),s(x,pe),s(x,C),s(x,P)},p(we,[ge]){var he,je,Ue,We,Ze,Je,Ye,et,He,Oe;ge&1&&n!==(n=((je=(he=we[0].reactive)==null?void 0:he.title)!=null?je:"Reactive")+"")&&D(i,n),ge&1&&_!==(_=((We=(Ue=we[0].reactive)==null?void 0:Ue.instant_in)!=null?We:"Instant in")+"")&&D(u,_),ge&2&&v!==(v=we[1][0]+"")&&D(d,v),ge&2&&g!==(g=we[1][1]+"")&&D(k,g),ge&1&&E!==(E=((Je=(Ze=we[0].reactive)==null?void 0:Ze.instant_out)!=null?Je:"Instant out")+"")&&D(I,E),ge&4&&S!==(S=we[2][0]+"")&&D(j,S),ge&4&&V!==(V=we[2][1]+"")&&D(F,V),ge&1&&H!==(H=((et=(Ye=we[0].reactive)==null?void 0:Ye.total_in)!=null?et:"Total in")+"")&&D(W,H),ge&8&&J!==(J=we[3][0]+"")&&D(ae,J),ge&8&&X!==(X=we[3][1]+"")&&D(oe,X),ge&1&&re!==(re=((Oe=(He=we[0].reactive)==null?void 0:He.total_out)!=null?Oe:"Total out")+"")&&D(me,re),ge&16&&ke!==(ke=we[4][0]+"")&&D(pe,ke),ge&16&&w!==(w=we[4][1]+"")&&D(P,w)},i:Xe,o:Xe,d(we){we&&A(e)}}}function y1(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:a}=e,c={};vl.subscribe(v=>{l(0,c=v)});let _,u,f,p;return t.$$set=v=>{"importInstant"in v&&l(5,n=v.importInstant),"exportInstant"in v&&l(6,i=v.exportInstant),"importTotal"in v&&l(7,o=v.importTotal),"exportTotal"in v&&l(8,a=v.exportTotal)},t.$$.update=()=>{t.$$.dirty&480&&(l(1,_=ml(n,"VAr")),l(2,u=ml(i,"VAr")),l(3,f=ml(o*1e3,"VArh")),l(4,p=ml(a*1e3,"VArh")))},[c,_,u,f,p,n,i,o,a]}class z1 extends Dt{constructor(e){super(),qt(this,e,y1,H1,Nt,{importInstant:5,exportInstant:6,importTotal:7,exportTotal:8})}}function so(t){let e;function l(o,a){return o[3]?G1:W1}let n=l(t),i=n(t);return{c(){i.c(),e=Qt()},m(o,a){i.m(o,a),q(o,e,a)},p(o,a){n===(n=l(o))&&i?i.p(o,a):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&A(e)}}}function W1(t){var y,ee,le,se,_e,Te,Se,de,Ne,we;let e,l=((ee=(y=t[5].realtime)==null?void 0:y.consumption)!=null?ee:"Consumption")+"",n,i,o,a,c=Jt((se=(le=t[5].common)==null?void 0:le.hour)!=null?se:"Hour")+"",_,u,f,p=t[6][0]+"",v,d,h=t[6][1]+"",g,k,T,O=Jt((Te=(_e=t[5].common)==null?void 0:_e.day)!=null?Te:"Day")+"",E,I,N,B=t[7][0]+"",S,j,z=t[7][1]+"",V,F,R,G=Jt((de=(Se=t[5].common)==null?void 0:Se.month)!=null?de:"Month")+"",U,H,W,K=t[8][0]+"",Q,J,ae=t[8][1]+"",Z,X,oe,ne=((we=(Ne=t[5].realtime)==null?void 0:Ne.last_month)!=null?we:"Last month")+"",ie,re,me,Y=t[9][0]+"",x,ke,pe=t[9][1]+"",C,w,P,L=t[4]&&oo(t);return{c(){e=m("strong"),n=M(l),i=b(),o=m("div"),a=m("div"),_=M(c),u=b(),f=m("div"),v=M(p),d=b(),g=M(h),k=b(),T=m("div"),E=M(O),I=b(),N=m("div"),S=M(B),j=b(),V=M(z),F=b(),R=m("div"),U=M(G),H=b(),W=m("div"),Q=M(K),J=b(),Z=M(ae),X=b(),oe=m("div"),ie=M(ne),re=b(),me=m("div"),x=M(Y),ke=b(),C=M(pe),w=b(),L&&L.c(),P=Qt(),r(f,"class","text-right"),r(N,"class","text-right"),r(W,"class","text-right"),r(me,"class","text-right"),r(o,"class","grid grid-cols-2 mb-3")},m(ge,he){q(ge,e,he),s(e,n),q(ge,i,he),q(ge,o,he),s(o,a),s(a,_),s(o,u),s(o,f),s(f,v),s(f,d),s(f,g),s(o,k),s(o,T),s(T,E),s(o,I),s(o,N),s(N,S),s(N,j),s(N,V),s(o,F),s(o,R),s(R,U),s(o,H),s(o,W),s(W,Q),s(W,J),s(W,Z),s(o,X),s(o,oe),s(oe,ie),s(o,re),s(o,me),s(me,x),s(me,ke),s(me,C),q(ge,w,he),L&&L.m(ge,he),q(ge,P,he)},p(ge,he){var je,Ue,We,Ze,Je,Ye,et,He,Oe,ce;he&32&&l!==(l=((Ue=(je=ge[5].realtime)==null?void 0:je.consumption)!=null?Ue:"Consumption")+"")&&D(n,l),he&32&&c!==(c=Jt((Ze=(We=ge[5].common)==null?void 0:We.hour)!=null?Ze:"Hour")+"")&&D(_,c),he&64&&p!==(p=ge[6][0]+"")&&D(v,p),he&64&&h!==(h=ge[6][1]+"")&&D(g,h),he&32&&O!==(O=Jt((Ye=(Je=ge[5].common)==null?void 0:Je.day)!=null?Ye:"Day")+"")&&D(E,O),he&128&&B!==(B=ge[7][0]+"")&&D(S,B),he&128&&z!==(z=ge[7][1]+"")&&D(V,z),he&32&&G!==(G=Jt((He=(et=ge[5].common)==null?void 0:et.month)!=null?He:"Month")+"")&&D(U,G),he&256&&K!==(K=ge[8][0]+"")&&D(Q,K),he&256&&ae!==(ae=ge[8][1]+"")&&D(Z,ae),he&32&&ne!==(ne=((ce=(Oe=ge[5].realtime)==null?void 0:Oe.last_month)!=null?ce:"Last month")+"")&&D(ie,ne),he&512&&Y!==(Y=ge[9][0]+"")&&D(x,Y),he&512&&pe!==(pe=ge[9][1]+"")&&D(C,pe),ge[4]?L?L.p(ge,he):(L=oo(ge),L.c(),L.m(P.parentNode,P)):L&&(L.d(1),L=null)},d(ge){ge&&A(e),ge&&A(i),ge&&A(o),ge&&A(w),L&&L.d(ge),ge&&A(P)}}}function G1(t){var At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl,hl,bl,gl;let e,l=((Xt=(At=t[5].common)==null?void 0:At.import)!=null?Xt:"Import")+"",n,i,o,a,c=Jt((el=(Zt=t[5].common)==null?void 0:Zt.hour)!=null?el:"Hour")+"",_,u,f,p=t[6][0]+"",v,d,h=t[6][1]+"",g,k,T,O,E=Jt((ll=(tl=t[5].common)==null?void 0:tl.day)!=null?ll:"Day")+"",I,N,B,S=t[7][0]+"",j,z,V=t[7][1]+"",F,R,G,U,H=Jt((il=(nl=t[5].common)==null?void 0:nl.month)!=null?il:"Month")+"",W,K,Q,J=t[8][0]+"",ae,Z,X=t[8][1]+"",oe,ne,ie,re,me=((ol=(sl=t[5].realtime)==null?void 0:sl.last_mo)!=null?ol:"Last mo.")+"",Y,x,ke,pe=t[9][0]+"",C,w,P=t[9][1]+"",L,y,ee,le,se,_e=((fl=(al=t[5].common)==null?void 0:al.export)!=null?fl:"Export")+"",Te,Se,de,Ne,we=Jt((Ie=(ul=t[5].common)==null?void 0:ul.hour)!=null?Ie:"Hour")+"",ge,he,je,Ue=t[10][0]+"",We,Ze,Je=t[10][1]+"",Ye,et,He,Oe,ce=Jt((rl=(jt=t[5].common)==null?void 0:jt.day)!=null?rl:"Day")+"",Pe,$e,Qe,mt=t[11][0]+"",ye,Ge,ze=t[11][1]+"",tt,vt,Mt,dt,te=Jt((hl=(cl=t[5].common)==null?void 0:cl.month)!=null?hl:"Month")+"",be,Tt,Ce,qe=t[12][0]+"",pt,at,ft=t[12][1]+"",ut,Et,Ot,St,Pt=((gl=(bl=t[5].realtime)==null?void 0:bl.last_mo)!=null?gl:"Last mo.")+"",It,yt,Ct,ht=t[13][0]+"",Lt,Ut,Wt=t[13][1]+"",Ve,Ke,Bt,nt=t[4]&&ao(t),bt=t[4]&&fo(t),wt=t[4]&&uo(t),ue=t[4]&&ro(t),Me=t[4]&&co(t),Ae=t[4]&&_o(t),it=t[4]&&mo(t),rt=t[4]&&po(t);return{c(){e=m("strong"),n=M(l),i=b(),o=m("div"),a=m("div"),_=M(c),u=b(),f=m("div"),v=M(p),d=b(),g=M(h),k=b(),nt&&nt.c(),T=b(),O=m("div"),I=M(E),N=b(),B=m("div"),j=M(S),z=b(),F=M(V),R=b(),bt&&bt.c(),G=b(),U=m("div"),W=M(H),K=b(),Q=m("div"),ae=M(J),Z=b(),oe=M(X),ne=b(),wt&&wt.c(),ie=b(),re=m("div"),Y=M(me),x=b(),ke=m("div"),C=M(pe),w=b(),L=M(P),y=b(),ue&&ue.c(),le=b(),se=m("strong"),Te=M(_e),Se=b(),de=m("div"),Ne=m("div"),ge=M(we),he=b(),je=m("div"),We=M(Ue),Ze=b(),Ye=M(Je),et=b(),Me&&Me.c(),He=b(),Oe=m("div"),Pe=M(ce),$e=b(),Qe=m("div"),ye=M(mt),Ge=b(),tt=M(ze),vt=b(),Ae&&Ae.c(),Mt=b(),dt=m("div"),be=M(te),Tt=b(),Ce=m("div"),pt=M(qe),at=b(),ut=M(ft),Et=b(),it&&it.c(),Ot=b(),St=m("div"),It=M(Pt),yt=b(),Ct=m("div"),Lt=M(ht),Ut=b(),Ve=M(Wt),Ke=b(),rt&&rt.c(),r(f,"class","text-right"),r(B,"class","text-right"),r(Q,"class","text-right"),r(ke,"class","text-right"),r(o,"class",ee="grid grid-cols-"+t[14]+" mb-3"),r(je,"class","text-right"),r(Qe,"class","text-right"),r(Ce,"class","text-right"),r(Ct,"class","text-right"),r(de,"class",Bt="grid grid-cols-"+t[14])},m(Fe,ct){q(Fe,e,ct),s(e,n),q(Fe,i,ct),q(Fe,o,ct),s(o,a),s(a,_),s(o,u),s(o,f),s(f,v),s(f,d),s(f,g),s(o,k),nt&&nt.m(o,null),s(o,T),s(o,O),s(O,I),s(o,N),s(o,B),s(B,j),s(B,z),s(B,F),s(o,R),bt&&bt.m(o,null),s(o,G),s(o,U),s(U,W),s(o,K),s(o,Q),s(Q,ae),s(Q,Z),s(Q,oe),s(o,ne),wt&&wt.m(o,null),s(o,ie),s(o,re),s(re,Y),s(o,x),s(o,ke),s(ke,C),s(ke,w),s(ke,L),s(o,y),ue&&ue.m(o,null),q(Fe,le,ct),q(Fe,se,ct),s(se,Te),q(Fe,Se,ct),q(Fe,de,ct),s(de,Ne),s(Ne,ge),s(de,he),s(de,je),s(je,We),s(je,Ze),s(je,Ye),s(de,et),Me&&Me.m(de,null),s(de,He),s(de,Oe),s(Oe,Pe),s(de,$e),s(de,Qe),s(Qe,ye),s(Qe,Ge),s(Qe,tt),s(de,vt),Ae&&Ae.m(de,null),s(de,Mt),s(de,dt),s(dt,be),s(de,Tt),s(de,Ce),s(Ce,pt),s(Ce,at),s(Ce,ut),s(de,Et),it&&it.m(de,null),s(de,Ot),s(de,St),s(St,It),s(de,yt),s(de,Ct),s(Ct,Lt),s(Ct,Ut),s(Ct,Ve),s(de,Ke),rt&&rt.m(de,null)},p(Fe,ct){var Be,_t,Sl,Cl,Nl,Tl,Rl,Fl,Ul,Bl,jl,Hl,yl,zl,Wl,lt,Ht,_l,wl,Gl;ct&32&&l!==(l=((_t=(Be=Fe[5].common)==null?void 0:Be.import)!=null?_t:"Import")+"")&&D(n,l),ct&32&&c!==(c=Jt((Cl=(Sl=Fe[5].common)==null?void 0:Sl.hour)!=null?Cl:"Hour")+"")&&D(_,c),ct&64&&p!==(p=Fe[6][0]+"")&&D(v,p),ct&64&&h!==(h=Fe[6][1]+"")&&D(g,h),Fe[4]?nt?nt.p(Fe,ct):(nt=ao(Fe),nt.c(),nt.m(o,T)):nt&&(nt.d(1),nt=null),ct&32&&E!==(E=Jt((Tl=(Nl=Fe[5].common)==null?void 0:Nl.day)!=null?Tl:"Day")+"")&&D(I,E),ct&128&&S!==(S=Fe[7][0]+"")&&D(j,S),ct&128&&V!==(V=Fe[7][1]+"")&&D(F,V),Fe[4]?bt?bt.p(Fe,ct):(bt=fo(Fe),bt.c(),bt.m(o,G)):bt&&(bt.d(1),bt=null),ct&32&&H!==(H=Jt((Fl=(Rl=Fe[5].common)==null?void 0:Rl.month)!=null?Fl:"Month")+"")&&D(W,H),ct&256&&J!==(J=Fe[8][0]+"")&&D(ae,J),ct&256&&X!==(X=Fe[8][1]+"")&&D(oe,X),Fe[4]?wt?wt.p(Fe,ct):(wt=uo(Fe),wt.c(),wt.m(o,ie)):wt&&(wt.d(1),wt=null),ct&32&&me!==(me=((Bl=(Ul=Fe[5].realtime)==null?void 0:Ul.last_mo)!=null?Bl:"Last mo.")+"")&&D(Y,me),ct&512&&pe!==(pe=Fe[9][0]+"")&&D(C,pe),ct&512&&P!==(P=Fe[9][1]+"")&&D(L,P),Fe[4]?ue?ue.p(Fe,ct):(ue=ro(Fe),ue.c(),ue.m(o,null)):ue&&(ue.d(1),ue=null),ct&16384&&ee!==(ee="grid grid-cols-"+Fe[14]+" mb-3")&&r(o,"class",ee),ct&32&&_e!==(_e=((Hl=(jl=Fe[5].common)==null?void 0:jl.export)!=null?Hl:"Export")+"")&&D(Te,_e),ct&32&&we!==(we=Jt((zl=(yl=Fe[5].common)==null?void 0:yl.hour)!=null?zl:"Hour")+"")&&D(ge,we),ct&1024&&Ue!==(Ue=Fe[10][0]+"")&&D(We,Ue),ct&1024&&Je!==(Je=Fe[10][1]+"")&&D(Ye,Je),Fe[4]?Me?Me.p(Fe,ct):(Me=co(Fe),Me.c(),Me.m(de,He)):Me&&(Me.d(1),Me=null),ct&32&&ce!==(ce=Jt((lt=(Wl=Fe[5].common)==null?void 0:Wl.day)!=null?lt:"Day")+"")&&D(Pe,ce),ct&2048&&mt!==(mt=Fe[11][0]+"")&&D(ye,mt),ct&2048&&ze!==(ze=Fe[11][1]+"")&&D(tt,ze),Fe[4]?Ae?Ae.p(Fe,ct):(Ae=_o(Fe),Ae.c(),Ae.m(de,Mt)):Ae&&(Ae.d(1),Ae=null),ct&32&&te!==(te=Jt((_l=(Ht=Fe[5].common)==null?void 0:Ht.month)!=null?_l:"Month")+"")&&D(be,te),ct&4096&&qe!==(qe=Fe[12][0]+"")&&D(pt,qe),ct&4096&&ft!==(ft=Fe[12][1]+"")&&D(ut,ft),Fe[4]?it?it.p(Fe,ct):(it=mo(Fe),it.c(),it.m(de,Ot)):it&&(it.d(1),it=null),ct&32&&Pt!==(Pt=((Gl=(wl=Fe[5].realtime)==null?void 0:wl.last_mo)!=null?Gl:"Last mo.")+"")&&D(It,Pt),ct&8192&&ht!==(ht=Fe[13][0]+"")&&D(Lt,ht),ct&8192&&Wt!==(Wt=Fe[13][1]+"")&&D(Ve,Wt),Fe[4]?rt?rt.p(Fe,ct):(rt=po(Fe),rt.c(),rt.m(de,null)):rt&&(rt.d(1),rt=null),ct&16384&&Bt!==(Bt="grid grid-cols-"+Fe[14])&&r(de,"class",Bt)},d(Fe){Fe&&A(e),Fe&&A(i),Fe&&A(o),nt&&nt.d(),bt&&bt.d(),wt&&wt.d(),ue&&ue.d(),Fe&&A(le),Fe&&A(se),Fe&&A(Se),Fe&&A(de),Me&&Me.d(),Ae&&Ae.d(),it&&it.d(),rt&&rt.d()}}}function oo(t){var x,ke,pe,C,w,P,L,y,ee,le;let e,l=((ke=(x=t[5].realtime)==null?void 0:x.cost)!=null?ke:"Cost")+"",n,i,o,a,c=Jt((C=(pe=t[5].common)==null?void 0:pe.hour)!=null?C:"Hour")+"",_,u,f,p=Yt(t[1].h.c,2)+"",v,d,h,g,k,T=Jt((P=(w=t[5].common)==null?void 0:w.day)!=null?P:"Day")+"",O,E,I,N=Yt(t[1].d.c,1)+"",B,S,j,z,V,F=Jt((y=(L=t[5].common)==null?void 0:L.month)!=null?y:"Month")+"",R,G,U,H=Yt(t[1].m.c)+"",W,K,Q,J,ae,Z=((le=(ee=t[5].realtime)==null?void 0:ee.last_month)!=null?le:"Last month")+"",X,oe,ne,ie=Yt(t[0].last_month.c)+"",re,me,Y;return{c(){e=m("strong"),n=M(l),i=b(),o=m("div"),a=m("div"),_=M(c),u=b(),f=m("div"),v=M(p),d=b(),h=M(t[2]),g=b(),k=m("div"),O=M(T),E=b(),I=m("div"),B=M(N),S=b(),j=M(t[2]),z=b(),V=m("div"),R=M(F),G=b(),U=m("div"),W=M(H),K=b(),Q=M(t[2]),J=b(),ae=m("div"),X=M(Z),oe=b(),ne=m("div"),re=M(ie),me=b(),Y=M(t[2]),r(f,"class","text-right"),r(I,"class","text-right"),r(U,"class","text-right"),r(ne,"class","text-right"),r(o,"class","grid grid-cols-2")},m(se,_e){q(se,e,_e),s(e,n),q(se,i,_e),q(se,o,_e),s(o,a),s(a,_),s(o,u),s(o,f),s(f,v),s(f,d),s(f,h),s(o,g),s(o,k),s(k,O),s(o,E),s(o,I),s(I,B),s(I,S),s(I,j),s(o,z),s(o,V),s(V,R),s(o,G),s(o,U),s(U,W),s(U,K),s(U,Q),s(o,J),s(o,ae),s(ae,X),s(o,oe),s(o,ne),s(ne,re),s(ne,me),s(ne,Y)},p(se,_e){var Te,Se,de,Ne,we,ge,he,je,Ue,We;_e&32&&l!==(l=((Se=(Te=se[5].realtime)==null?void 0:Te.cost)!=null?Se:"Cost")+"")&&D(n,l),_e&32&&c!==(c=Jt((Ne=(de=se[5].common)==null?void 0:de.hour)!=null?Ne:"Hour")+"")&&D(_,c),_e&2&&p!==(p=Yt(se[1].h.c,2)+"")&&D(v,p),_e&4&&D(h,se[2]),_e&32&&T!==(T=Jt((ge=(we=se[5].common)==null?void 0:we.day)!=null?ge:"Day")+"")&&D(O,T),_e&2&&N!==(N=Yt(se[1].d.c,1)+"")&&D(B,N),_e&4&&D(j,se[2]),_e&32&&F!==(F=Jt((je=(he=se[5].common)==null?void 0:he.month)!=null?je:"Month")+"")&&D(R,F),_e&2&&H!==(H=Yt(se[1].m.c)+"")&&D(W,H),_e&4&&D(Q,se[2]),_e&32&&Z!==(Z=((We=(Ue=se[5].realtime)==null?void 0:Ue.last_month)!=null?We:"Last month")+"")&&D(X,Z),_e&1&&ie!==(ie=Yt(se[0].last_month.c)+"")&&D(re,ie),_e&4&&D(Y,se[2])},d(se){se&&A(e),se&&A(i),se&&A(o)}}}function ao(t){let e,l=Yt(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].h.c,2)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function fo(t){let e,l=Yt(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].d.c,1)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function uo(t){let e,l=Yt(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].m.c)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function ro(t){let e,l=Yt(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&1&&l!==(l=Yt(a[0].last_month.c)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function co(t){let e,l=Yt(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].h.i,2)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function _o(t){let e,l=Yt(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].d.i,1)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function mo(t){let e,l=Yt(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&2&&l!==(l=Yt(a[1].m.i)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function po(t){let e,l=Yt(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=M(l),i=b(),o=M(t[2]),r(e,"class","text-right")},m(a,c){q(a,e,c),s(e,n),s(e,i),s(e,o)},p(a,c){c&1&&l!==(l=Yt(a[0].last_month.i)+"")&&D(n,l),c&4&&D(o,a[2])},d(a){a&&A(e)}}}function V1(t){var f,p;let e,l,n=((p=(f=t[5].realtime)==null?void 0:f.title)!=null?p:"Real time calculations")+"",i,o,a,c,_,u=t[1]&&so(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("br"),c=m("br"),_=b(),u&&u.c(),r(e,"class","mx-2 text-sm")},m(v,d){q(v,e,d),s(e,l),s(l,i),s(e,o),s(e,a),s(e,c),s(e,_),u&&u.m(e,null)},p(v,[d]){var h,g;d&32&&n!==(n=((g=(h=v[5].realtime)==null?void 0:h.title)!=null?g:"Real time calculations")+"")&&D(i,n),v[1]?u?u.p(v,d):(u=so(v),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i:Xe,o:Xe,d(v){v&&A(e),u&&u.d()}}}function K1(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:a}=e,c={};vl.subscribe(O=>{l(5,c=O)});let _,u,f,p,v,d,h,g,k=!1,T=3;return t.$$set=O=>{"sysinfo"in O&&l(0,n=O.sysinfo),"data"in O&&l(1,i=O.data),"currency"in O&&l(2,o=O.currency),"hasExport"in O&&l(3,a=O.hasExport)},t.$$.update=()=>{var O,E,I,N,B,S,j,z;t.$$.dirty&19&&(l(4,k=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,T=k?3:2),l(6,_=ml(((O=i==null?void 0:i.h)==null?void 0:O.u)*1e3,"Wh")),l(7,u=ml(((E=i==null?void 0:i.d)==null?void 0:E.u)*1e3,"Wh")),l(8,f=ml(((I=i==null?void 0:i.m)==null?void 0:I.u)*1e3,"Wh")),l(9,p=ml(((N=n==null?void 0:n.last_month)==null?void 0:N.c)*1e3,"Wh")),l(10,v=ml(((B=i==null?void 0:i.h)==null?void 0:B.p)*1e3,"Wh")),l(11,d=ml(((S=i==null?void 0:i.d)==null?void 0:S.p)*1e3,"Wh")),l(12,h=ml(((j=i==null?void 0:i.m)==null?void 0:j.p)*1e3,"Wh")),l(13,g=ml(((z=n==null?void 0:n.last_month)==null?void 0:z.p)*1e3,"Wh")))},[n,i,o,a,k,c,_,u,f,p,v,d,h,g,T]}class Y1 extends Dt{constructor(e){super(),qt(this,e,K1,V1,Nt,{sysinfo:0,data:1,currency:2,hasExport:3})}}function Q1(t){let e,l,n=Es(t[0].source)+"",i,o,a,c,_;return c=new ln({props:{config:t[1]}}),{c(){e=m("a"),l=M("Provided by: "),i=M(n),a=b(),Re(c.$$.fragment),r(e,"href",o=Ps(t[0].source)),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(u,f){q(u,e,f),s(e,l),s(e,i),q(u,a,f),De(c,u,f),_=!0},p(u,[f]){(!_||f&1)&&n!==(n=Es(u[0].source)+"")&&D(i,n),(!_||f&1&&o!==(o=Ps(u[0].source)))&&r(e,"href",o);const p={};f&2&&(p.config=u[1]),c.$set(p)},i(u){_||($(c.$$.fragment,u),_=!0)},o(u){fe(c.$$.fragment,u),_=!1},d(u){u&&A(e),u&&A(a),Le(c,u)}}}function X1(t,e,l){let{title:n}=e,{json:i}=e,{sysinfo:o}=e,a={},c,_,u=document.documentElement.classList.contains("dark");return t.$$set=f=>{"title"in f&&l(2,n=f.title),"json"in f&&l(0,i=f.json),"sysinfo"in f&&l(3,o=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&61){let f=i.currency,p=new Date().getUTCHours(),v=0,d=0,h=0,g=[],k=[],T=[];l(5,_=l(4,c=0));let O=new Date;for(Ll(O,o.clock_offset-(24+O.getHours()-O.getUTCHours())%24),v=p;v<24&&(d=i[Rt(h++)],d!=null);v++)k.push({label:Rt(O.getHours())}),T.push(d*100),l(5,_=Math.min(_,d*100)),l(4,c=Math.max(c,d*100)),Ll(O,1);for(v=0;v<24&&(d=i[Rt(h++)],d!=null);v++)k.push({label:Rt(O.getHours())}),T.push(d*100),l(5,_=Math.min(_,d*100)),l(4,c=Math.max(c,d*100)),Ll(O,1);if(_>-100&&c<100){switch(f){case"NOK":case"DKK":f="\xF8re";break;case"SEK":f="\xF6re";break;case"EUR":f="cent";break;case"CHF":f="rp.";break;default:f=f+"/100"}for(l(5,_*=100),l(4,c*=100),v=0;v=0?S.toFixed(j):"",title:S>=0?S.toFixed(2)+" "+f:"",value:d>=0?Math.abs(d):0,label2:S<0?S.toFixed(j):"",title2:S<0?S.toFixed(2)+" "+f:"",value2:d<0?Math.abs(d):0,color:u?"#5c2da5":"#7c3aed"})}let I=Math.max(c,Math.abs(_));if(_<0){l(5,_=Math.min(I/4*-1,_));let S=Math.ceil(Math.abs(_)/I*4),j=_/S;for(v=1;v{"title"in f&&l(1,n=f.title),"json"in f&&l(2,i=f.json),"sysinfo"in f&&l(3,o=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let f=0,p=[],v=[],d=[];l(5,_=l(4,c=0));let h=Ll(new Date,-24),g=new Date().getUTCHours();for(Ll(h,o.clock_offset-(24+h.getHours()-h.getUTCHours())%24),f=g;f<24;f++){let E=i["i"+Rt(f)],I=i["e"+Rt(f)];E===void 0&&(E=0),I===void 0&&(I=0),v.push({label:Rt(h.getHours())}),d.push({label:E.toFixed(1),title:E.toFixed(2)+" kWh",value:E*10,label2:I.toFixed(1),title2:I.toFixed(2)+" kWh",value2:I*10,color:u?"#5c2da5":"#7c3aed",color2:u?"#27728e":"#37829e"}),l(5,_=Math.max(_,I*10)),l(4,c=Math.max(c,E*10)),Ll(h,1)}for(f=0;f{"title"in f&&l(1,n=f.title),"json"in f&&l(2,i=f.json),"sysinfo"in f&&l(3,o=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let f=0,p=[],v=[],d=[];l(5,_=l(4,c=0));let h=new Date,g=new Date;for(Ll(h,o.clock_offset-(24+h.getHours()-h.getUTCHours())%24),Ll(g,o.clock_offset-(24+g.getHours()-g.getUTCHours())%24),g.setDate(0),f=h.getDate();f<=g.getDate();f++){let E=i["i"+Rt(f)],I=i["e"+Rt(f)];E===void 0&&(E=0),I===void 0&&(I=0),v.push({label:Rt(f)}),d.push({label:E.toFixed(E<10?1:0),title:E.toFixed(2)+" kWh",value:E,label2:I.toFixed(I<10?1:0),title2:I.toFixed(2)+" kWh",value2:I,color:u?"#5c2da5":"#7c3aed",color2:u?"#27728e":"#37829e"}),l(5,_=Math.max(_,I)),l(4,c=Math.max(c,E))}for(f=1;f{"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,f=0,p=[],v=[],d=[];i.s&&i.s.forEach((k,T)=>{var O=k.n?k.n:k.a;f=k.v,f==-127&&(f=0),v.push({label:O.slice(-4)}),d.push({label:f.toFixed(1),value:f,color:o?"#5c2da5":"#7c3aed"}),l(4,_=Math.min(_,f)),l(3,c=Math.max(c,f))}),l(3,c=Math.ceil(c)),l(4,_=Math.floor(_));let h=c;_<0&&(h+=Math.abs(_));let g=h/4;for(u=0;u<5;u++)f=_+g*u,p.push({value:f,label:f.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:_,max:c,ticks:p},x:{ticks:v},points:d})}},[a,n,i,c,_]}class s0 extends Dt{constructor(e){super(),qt(this,e,i0,n0,Nt,{title:1,json:2})}}function o0(t){let e,l;return e=new ln({props:{config:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}let a0=0;function f0(t,e,l){let n={};vl.subscribe(u=>{l(2,n=u)});let{title:i}=e,o=document.documentElement.classList.contains("dark"),a={},c=0,_;return gu.subscribe(u=>{l(4,_=u)}),bu(),t.$$set=u=>{"title"in u&&l(1,i=u.title)},t.$$.update=()=>{var u;if(t.$$.dirty&30){let f=0,p=[],v=[],d=[];if(p.push({value:0,label:0}),_&&_.p)for(f=0;f<_.p.length;f++){let h=_.p[f];d.push({label:h.v.toFixed(2),value:h.v,color:o?"#5c2da5":"#7c3aed"}),v.push({label:h.d>0?Rt(h.d)+"."+((u=n.months)==null?void 0:u[new Date().getMonth()]):"-"}),l(3,c=Math.max(c,h.v))}if(_&&_.t){for(f=0;f<_.t.length;f++){let h=_.t[f];if(h>=c)break;p.push({value:h,label:h})}p.push({label:_.m.toFixed(1),align:"right",color:"green",value:_.m})}_&&_.c&&(p.push({label:_.c.toFixed(0),color:"orange",value:_.c}),l(3,c=Math.max(c,_.c))),l(3,c=Math.ceil(c)),l(0,a={title:i,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:35,bottom:20,left:35},y:{min:a0,max:c,ticks:p},x:{ticks:v},points:d})}},[a,i,n,c,_]}class u0 extends Dt{constructor(e){super(),qt(this,e,f0,o0,Nt,{title:1})}}function vo(t,e,l){const n=t.slice();return n[24]=e[l],n[26]=l,n}function ho(t,e,l){const n=t.slice();return n[27]=e[l],n}function r0(t){let e,l,n;return{c(){e=m("strong"),l=M(t[0]),n=M(" not available"),r(e,"class","text-sm")},m(i,o){q(i,e,o),s(e,l),s(e,n)},p(i,o){o&1&&D(l,i[0])},d(i){i&&A(e)}}}function c0(t){let e,l,n,i,o,a,c,_=t[8]&&bo(t);return{c(){e=m("strong"),l=M(t[0]),n=M(" ("),i=M(t[12]),o=M(")"),a=b(),_&&_.c(),c=Qt(),r(e,"class","text-sm")},m(u,f){q(u,e,f),s(e,l),s(e,n),s(e,i),s(e,o),q(u,a,f),_&&_.m(u,f),q(u,c,f)},p(u,f){f&1&&D(l,u[0]),f&4096&&D(i,u[12]),u[8]?_?_.p(u,f):(_=bo(u),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null)},d(u){u&&A(e),u&&A(a),_&&_.d(u),u&&A(c)}}}function bo(t){let e,l,n,i,o,a=t[8],c=[];for(let f=0;ft[17].call(e))},m(a,c){q(a,e,c),o.m(e,null),l=Vi(e,t[17].bind(e))},p(a,[c]){i===(i=n(a))&&o?o.p(a,c):(o.d(1),o=i(a),o&&(o.c(),o.m(e,null)))},i:Xe,o:Xe,d(a){a&&A(e),o.d(),l()}}}function m0(t,e,l){let{title:n}=e,i=document.documentElement.classList.contains("dark"),o=0,a=0,c=0,_=0,u=!1,f=null;Ii.subscribe(F=>{l(16,f=F)});let p=!1;function v(){_==60||c>o||c-o>300?(Oi(),_=0):Ii.update(F=>{if(F.lastUpdate)for(;o>F.lastUpdate;)F.data.unshift(a),F.data=F.data.slice(0,F.size),F.lastUpdate+=10,_++;else F.lastUpdate=o;return F})}cu.subscribe(F=>{if(a=F.i-F.e,o=F.u,!u){Oi(),u=!0,c=o;return}!xr()||v()});let d,h,g,k,T,O,E,I=function(F,R,G){return Math.ceil(T-(F-R)/(G-R)*T)-25},N=function(F){return 30+Math.ceil(F/f.size*(O-35))},B,S,j,z;function V(){g=this.clientWidth,k=this.clientHeight,l(3,g),l(4,k)}return t.$$set=F=>{"title"in F&&l(0,n=F.title)},t.$$.update=()=>{if(t.$$.dirty&67582)if(l(5,T=parseInt(k)-50),l(6,O=g-35),l(10,j=O/f.size),l(2,h=0),l(1,d=0),f.data&&T>10&&O>100&&j>.1){l(11,p=!0);for(let G in f.data){let U=f.data[G];isNaN(U)&&(U=0),l(1,d=Math.max(Math.ceil(U/1e3)*1e3,d)),l(2,h=Math.min(Math.floor(U/1e3)*1e3,h))}let F=d-h;l(12,z=d>2500?"kW":"W"),l(8,B=[]);for(let G=h;G2500?(G/1e3).toFixed(1):G}),!(B.length>6));G+=F/5);l(9,S=[]);for(let G=0;G12));G+=Math.round(f.size/Math.round(O/120)));let R=f.size;l(7,E=N(f.size)+","+I(0,h,d)+" "+N(1)+","+I(0,h,d));for(let G in f.data){if(R<0)break;let U=f.data[G];isNaN(U)&&(U=0),l(7,E=N(R--)+","+I(U,h,d)+" "+E)}}else l(11,p=!1)},[n,d,h,g,k,T,O,E,B,S,j,p,z,i,I,N,f,V]}class p0 extends Dt{constructor(e){super(),qt(this,e,m0,_0,Nt,{title:0})}}function d0(t){let e,l;return e=new ln({props:{config:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function v0(t,e,l){let{title:n}=e,{unit:i=""}=e,{l1:o=!1}=e,{l2:a=!1}=e,{l2x:c=!1}=e,{l3:_=!1}=e,{l1i:u=0}=e,{l2i:f=0}=e,{l3i:p=0}=e,{l1e:v=0}=e,{l2e:d=0}=e,{l3e:h=0}=e,{maxImport:g=0}=e,{maxExport:k=0}=e,{importColorFn:T}=e,{exportColorFn:O}=e,E={};function I(N,B){return{label:Yt(N>900?N/1e3:N)+(N>900?"k":"")+i,title:N.toFixed(2)+" "+i,value:isNaN(N)?0:N,color:T(N?N/g*100:0,document.documentElement.classList.contains("dark")),label2:Yt(B>900?B/1e3:B)+(B>900?"k":"")+i,title2:B.toFixed(2)+" "+i,value2:isNaN(B)?0:B,color2:O(B?B/k*100:0)}}return t.$$set=N=>{"title"in N&&l(1,n=N.title),"unit"in N&&l(2,i=N.unit),"l1"in N&&l(3,o=N.l1),"l2"in N&&l(4,a=N.l2),"l2x"in N&&l(5,c=N.l2x),"l3"in N&&l(6,_=N.l3),"l1i"in N&&l(7,u=N.l1i),"l2i"in N&&l(8,f=N.l2i),"l3i"in N&&l(9,p=N.l3i),"l1e"in N&&l(10,v=N.l1e),"l2e"in N&&l(11,d=N.l2e),"l3e"in N&&l(12,h=N.l3e),"maxImport"in N&&l(13,g=N.maxImport),"maxExport"in N&&l(14,k=N.maxExport),"importColorFn"in N&&l(15,T=N.importColorFn),"exportColorFn"in N&&l(16,O=N.exportColorFn)},t.$$.update=()=>{if(t.$$.dirty&32762){let N=[],B=[];o&&(N.push({label:"L1"}),B.push(I(u,v))),a&&(c?(N.push({label:"L2"}),B.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(N.push({label:"L2"}),B.push(I(f,d)))),_&&(N.push({label:"L3"}),B.push(I(p,h)));let S=[];k&&(S.push({value:-k,label:"-100%"}),S.push({value:-k/4*3,label:"-75%"}),S.push({value:-k/2,label:"-50%"}),S.push({value:-k/4,label:"-25%"})),S.push({value:0,label:"0%"}),g&&(S.push({value:g/4,label:"25%"}),S.push({value:g/2,label:"50%"}),S.push({value:g/4*3,label:"75%"}),S.push({value:g,label:"100%"})),l(0,E={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:15,bottom:20,left:35},y:{min:-k,max:g,ticks:S},x:{ticks:N},points:B})}},[E,n,i,o,a,c,_,u,f,p,v,d,h,g,k,T,O]}class ls extends Dt{constructor(e){super(),qt(this,e,v0,d0,Nt,{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 So(t){var T,O;let e,l,n,i,o,a,c=(t[0].mt?_i(t[0].mt):"-")+"",_,u,f,p=t[7][0]+"",v,d,h=t[7][1]+"",g,k;return i=new Cu({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:(O=(T=t[6].common)==null?void 0:T.import)!=null?O:"Import",sub:t[0].p,subunit:t[0].pc,colorFn:Zi}}),{c(){e=m("div"),l=m("div"),n=m("div"),Re(i.$$.fragment),o=b(),a=m("div"),_=M(c),u=b(),f=m("div"),v=M(p),d=b(),g=M(h),r(n,"class","col-span-2"),r(f,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m(E,I){q(E,e,I),s(e,l),s(l,n),De(i,n,null),s(l,o),s(l,a),s(a,_),s(l,u),s(l,f),s(f,v),s(f,d),s(f,g),k=!0},p(E,I){var B,S;const N={};I&1&&(N.val=E[0].i?E[0].i:0),I&1&&(N.max=E[0].im?E[0].im:15e3),I&64&&(N.label=(S=(B=E[6].common)==null?void 0:B.import)!=null?S:"Import"),I&1&&(N.sub=E[0].p),I&1&&(N.subunit=E[0].pc),i.$set(N),(!k||I&1)&&c!==(c=(E[0].mt?_i(E[0].mt):"-")+"")&&D(_,c),(!k||I&128)&&p!==(p=E[7][0]+"")&&D(v,p),(!k||I&128)&&h!==(h=E[7][1]+"")&&D(g,h)},i(E){k||($(i.$$.fragment,E),k=!0)},o(E){fe(i.$$.fragment,E),k=!1},d(E){E&&A(e),Le(i)}}}function Co(t){var g,k;let e,l,n,i,o,a,c,_,u=t[8][0]+"",f,p,v=t[8][1]+"",d,h;return i=new Cu({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:(k=(g=t[6].common)==null?void 0:g.export)!=null?k:"Export",colorFn:Qn}}),{c(){e=m("div"),l=m("div"),n=m("div"),Re(i.$$.fragment),o=b(),a=m("div"),c=b(),_=m("div"),f=M(u),p=b(),d=M(v),r(n,"class","col-span-2"),r(_,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m(T,O){q(T,e,O),s(e,l),s(l,n),De(i,n,null),s(l,o),s(l,a),s(l,c),s(l,_),s(_,f),s(_,p),s(_,d),h=!0},p(T,O){var I,N;const E={};O&1&&(E.val=T[0].e?T[0].e:0),O&1&&(E.max=T[0].om?T[0].om*1e3:1e4),O&64&&(E.label=(N=(I=T[6].common)==null?void 0:I.export)!=null?N:"Export"),i.$set(E),(!h||O&256)&&u!==(u=T[8][0]+"")&&D(f,u),(!h||O&256)&&v!==(v=T[8][1]+"")&&D(d,v)},i(T){h||($(i.$$.fragment,T),h=!0)},o(T){fe(i.$$.fragment,T),h=!1},d(T){T&&A(e),Le(i)}}}function No(t){let e,l,n=t[0].l1&&To(t);return{c(){e=m("div"),n&&n.c(),r(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=To(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),fe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){fe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function To(t){var n,i;let e,l;return e=new j1({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(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var _,u;const c={};a&64&&(c.title=(u=(_=o[6].common)==null?void 0:_.voltage)!=null?u:"Volt"),a&1&&(c.u1=o[0].l1.u),a&1&&(c.u2=o[0].l2.u),a&1&&(c.u3=o[0].l3.u),a&1&&(c.ds=o[0].ds),e.$set(c)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){fe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Eo(t){let e,l,n=t[0].l1&&Po(t);return{c(){e=m("div"),n&&n.c(),r(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=Po(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),fe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){fe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function Po(t){var n,i;let e,l;return e=new ls({props:{title:(i=(n=t[6].common)==null?void 0:n.amperage)!=null?i:"Amp",unit:"A",importColorFn:Zi,exportColorFn:Qn,maxImport:t[0].mf,maxExport:t[0].om?t[9]?t[0].om/.4/Math.sqrt(3):t[0].om/.23:0,l1:t[0].l1&&t[0].l1.u>100,l2:t[0].l2&&t[0].l2.u>100,l3:t[0].l3&&t[0].l3.u>100,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(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var _,u;const c={};a&64&&(c.title=(u=(_=o[6].common)==null?void 0:_.amperage)!=null?u:"Amp"),a&1&&(c.maxImport=o[0].mf),a&513&&(c.maxExport=o[0].om?o[9]?o[0].om/.4/Math.sqrt(3):o[0].om/.23:0),a&1&&(c.l1=o[0].l1&&o[0].l1.u>100),a&1&&(c.l2=o[0].l2&&o[0].l2.u>100),a&1&&(c.l3=o[0].l3&&o[0].l3.u>100),a&1&&(c.l2x=o[0].l2.e),a&1&&(c.l1i=Math.max(o[0].l1.i,0)),a&1&&(c.l2i=Math.max(o[0].l2.i,0)),a&1&&(c.l3i=Math.max(o[0].l3.i,0)),a&1&&(c.l1e=Math.max(o[0].l1.i*-1,0)),a&1&&(c.l2e=Math.max(o[0].l2.i*-1,0)),a&1&&(c.l3e=Math.max(o[0].l3.i*-1,0)),e.$set(c)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){fe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Ao(t){let e,l,n=t[0].l1&&qo(t);return{c(){e=m("div"),n&&n.c(),r(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=qo(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),fe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){fe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function qo(t){var n,i;let e,l;return e=new ls({props:{title:(i=(n=t[6].dashboard)==null?void 0:n.phase)!=null?i:"Phase",unit:"W",importColorFn:Zi,exportColorFn:Qn,maxImport:(t[0].mf?t[0].mf:32)*230,maxExport:t[0].om?t[9]?t[0].om*1e3/Math.sqrt(3):t[0].om*1e3:0,l1:t[0].l1&&t[0].l1.u>100,l2:t[0].l2&&t[0].l2.u>100,l3:t[0].l3&&t[0].l3.u>100,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(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var _,u;const c={};a&64&&(c.title=(u=(_=o[6].dashboard)==null?void 0:_.phase)!=null?u:"Phase"),a&1&&(c.maxImport=(o[0].mf?o[0].mf:32)*230),a&513&&(c.maxExport=o[0].om?o[9]?o[0].om*1e3/Math.sqrt(3):o[0].om*1e3:0),a&1&&(c.l1=o[0].l1&&o[0].l1.u>100),a&1&&(c.l2=o[0].l2&&o[0].l2.u>100),a&1&&(c.l3=o[0].l3&&o[0].l3.u>100),a&1&&(c.l1i=o[0].l1.p),a&1&&(c.l2i=o[0].l2.p),a&1&&(c.l3i=o[0].l3.p),a&1&&(c.l1e=o[0].l1.q),a&1&&(c.l2e=o[0].l2.q),a&1&&(c.l3e=o[0].l3.q),e.$set(c)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){fe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Do(t){let e,l,n=t[0].l1&&Lo(t);return{c(){e=m("div"),n&&n.c(),r(e,"class","cnt")},m(i,o){q(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&$(n,1)):(n=Lo(i),n.c(),$(n,1),n.m(e,null)):n&&(gt(),fe(n,1,1,()=>{n=null}),kt())},i(i){l||($(n),l=!0)},o(i){fe(n),l=!1},d(i){i&&A(e),n&&n.d()}}}function Lo(t){var n,i;let e,l;return e=new ls({props:{title:(i=(n=t[6].dashboard)==null?void 0:n.pf)!=null?i:"Pf",importColorFn:Qn,exportColorFn:Qn,maxImport:1,l1:t[0].l1&&t[0].l1.u>100,l2:t[0].l2&&t[0].l2.u>100,l3:t[0].l3&&t[0].l3.u>100,l1i:t[0].l1.f,l2i:t[0].l2.f,l3i:t[0].l3.f}}),{c(){Re(e.$$.fragment)},m(o,a){De(e,o,a),l=!0},p(o,a){var _,u;const c={};a&64&&(c.title=(u=(_=o[6].dashboard)==null?void 0:_.pf)!=null?u:"Pf"),a&1&&(c.l1=o[0].l1&&o[0].l1.u>100),a&1&&(c.l2=o[0].l2&&o[0].l2.u>100),a&1&&(c.l3=o[0].l3&&o[0].l3.u>100),a&1&&(c.l1i=o[0].l1.f),a&1&&(c.l2i=o[0].l2.f),a&1&&(c.l3i=o[0].l3.f),e.$set(c)},i(o){l||($(e.$$.fragment,o),l=!0)},o(o){fe(e.$$.fragment,o),l=!1},d(o){Le(e,o)}}}function Oo(t){let e,l,n;return l=new z1({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt")},m(i,o){q(i,e,o),De(l,e,null),n=!0},p(i,o){const a={};o&1&&(a.importInstant=i[0].ri),o&1&&(a.exportInstant=i[0].re),o&1&&(a.importTotal=i[0].ric),o&1&&(a.exportTotal=i[0].rec),l.$set(a)},i(i){n||($(l.$$.fragment,i),n=!0)},o(i){fe(l.$$.fragment,i),n=!1},d(i){i&&A(e),Le(l)}}}function Io(t){let e,l,n;return l=new Y1({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt")},m(i,o){q(i,e,o),De(l,e,null),n=!0},p(i,o){const a={};o&2&&(a.sysinfo=i[1]),o&1&&(a.data=i[0].ea),o&1&&(a.currency=i[0].pc),o&1&&(a.hasExport=i[0].om>0||i[0].e>0),l.$set(a)},i(i){n||($(l.$$.fragment,i),n=!0)},o(i){fe(l.$$.fragment,i),n=!1},d(i){i&&A(e),Le(l)}}}function Ro(t){var i,o;let e,l,n;return l=new u0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.tariffpeak)!=null?o:"Tariff peaks"}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt h-64")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.tariffpeak)!=null?f:"Tariff peaks"),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Fo(t){var i,o;let e,l,n;return l=new p0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.realtime)!=null?o:"Real time"}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt gwf")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.realtime)!=null?f:"Real time"),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Uo(t){var i,o;let e,l,n;return l=new Z1({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.price)!=null?o:"Price",json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt gwf")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.price)!=null?f:"Price"),c&4&&(_.json=a[2]),c&2&&(_.sysinfo=a[1]),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Bo(t){var i,o;let e,l,n;return l=new x1({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.day)!=null?o:"24 hours",json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt gwf")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.day)!=null?f:"24 hours"),c&8&&(_.json=a[3]),c&2&&(_.sysinfo=a[1]),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function jo(t){var i,o;let e,l,n;return l=new l0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.month)!=null?o:"{0} days",json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt gwf")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.month)!=null?f:"{0} days"),c&16&&(_.json=a[4]),c&2&&(_.sysinfo=a[1]),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function Ho(t){var i,o;let e,l,n;return l=new s0({props:{title:(o=(i=t[6].dashboard)==null?void 0:i.temperature)!=null?o:"Temperature",json:t[5]}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","cnt gwf")},m(a,c){q(a,e,c),De(l,e,null),n=!0},p(a,c){var u,f;const _={};c&64&&(_.title=(f=(u=a[6].dashboard)==null?void 0:u.temperature)!=null?f:"Temperature"),c&32&&(_.json=a[5]),l.$set(_)},i(a){n||($(l.$$.fragment,a),n=!0)},o(a){fe(l.$$.fragment,a),n=!1},d(a){a&&A(e),Le(l)}}}function h0(t){let e,l=Vt(t[1].ui.i,t[0].i),n,i=Vt(t[1].ui.e,t[0].om||t[0].e>0),o,a=Vt(t[1].ui.v,t[0].l1&&(t[0].l1.u>100||t[0].l2.u>100||t[0].l3.u>100)),c,_=Vt(t[1].ui.a,t[0].l1&&(t[0].l1.i>.01||t[0].l2.i>.01||t[0].l3.i>.01)),u,f=Vt(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)),p,v=Vt(t[1].ui.f,t[0].l1&&(t[0].l1.f>.01||t[0].l2.f>.01||t[0].l3.f>.01)),d,h=Vt(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),g,k=Vt(t[1].ui.c,t[0].ea),T,O=Vt(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("NO")||t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),E,I=Vt(t[1].ui.l,t[0].hm==1),N,B=Vt(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),S,j=Vt(t[1].ui.d,t[3]),z,V=Vt(t[1].ui.m,t[4]),F,R=Vt(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),G,U=l&&So(t),H=i&&Co(t),W=a&&No(t),K=_&&Eo(t),Q=f&&Ao(t),J=v&&Do(t),ae=h&&Oo(t),Z=k&&Io(t),X=O&&Ro(t),oe=I&&Fo(t),ne=B&&Uo(t),ie=j&&Bo(t),re=V&&jo(t),me=R&&Ho(t);return{c(){e=m("div"),U&&U.c(),n=b(),H&&H.c(),o=b(),W&&W.c(),c=b(),K&&K.c(),u=b(),Q&&Q.c(),p=b(),J&&J.c(),d=b(),ae&&ae.c(),g=b(),Z&&Z.c(),T=b(),X&&X.c(),E=b(),oe&&oe.c(),N=b(),ne&&ne.c(),S=b(),ie&&ie.c(),z=b(),re&&re.c(),F=b(),me&&me.c(),r(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(Y,x){q(Y,e,x),U&&U.m(e,null),s(e,n),H&&H.m(e,null),s(e,o),W&&W.m(e,null),s(e,c),K&&K.m(e,null),s(e,u),Q&&Q.m(e,null),s(e,p),J&&J.m(e,null),s(e,d),ae&&ae.m(e,null),s(e,g),Z&&Z.m(e,null),s(e,T),X&&X.m(e,null),s(e,E),oe&&oe.m(e,null),s(e,N),ne&&ne.m(e,null),s(e,S),ie&&ie.m(e,null),s(e,z),re&&re.m(e,null),s(e,F),me&&me.m(e,null),G=!0},p(Y,[x]){x&3&&(l=Vt(Y[1].ui.i,Y[0].i)),l?U?(U.p(Y,x),x&3&&$(U,1)):(U=So(Y),U.c(),$(U,1),U.m(e,n)):U&&(gt(),fe(U,1,1,()=>{U=null}),kt()),x&3&&(i=Vt(Y[1].ui.e,Y[0].om||Y[0].e>0)),i?H?(H.p(Y,x),x&3&&$(H,1)):(H=Co(Y),H.c(),$(H,1),H.m(e,o)):H&&(gt(),fe(H,1,1,()=>{H=null}),kt()),x&3&&(a=Vt(Y[1].ui.v,Y[0].l1&&(Y[0].l1.u>100||Y[0].l2.u>100||Y[0].l3.u>100))),a?W?(W.p(Y,x),x&3&&$(W,1)):(W=No(Y),W.c(),$(W,1),W.m(e,c)):W&&(gt(),fe(W,1,1,()=>{W=null}),kt()),x&3&&(_=Vt(Y[1].ui.a,Y[0].l1&&(Y[0].l1.i>.01||Y[0].l2.i>.01||Y[0].l3.i>.01))),_?K?(K.p(Y,x),x&3&&$(K,1)):(K=Eo(Y),K.c(),$(K,1),K.m(e,u)):K&&(gt(),fe(K,1,1,()=>{K=null}),kt()),x&3&&(f=Vt(Y[1].ui.h,Y[0].l1&&(Y[0].l1.p>.01||Y[0].l2.p>.01||Y[0].l3.p>.01||Y[0].l1.q>.01||Y[0].l2.q>.01||Y[0].l3.q>.01))),f?Q?(Q.p(Y,x),x&3&&$(Q,1)):(Q=Ao(Y),Q.c(),$(Q,1),Q.m(e,p)):Q&&(gt(),fe(Q,1,1,()=>{Q=null}),kt()),x&3&&(v=Vt(Y[1].ui.f,Y[0].l1&&(Y[0].l1.f>.01||Y[0].l2.f>.01||Y[0].l3.f>.01))),v?J?(J.p(Y,x),x&3&&$(J,1)):(J=Do(Y),J.c(),$(J,1),J.m(e,d)):J&&(gt(),fe(J,1,1,()=>{J=null}),kt()),x&3&&(h=Vt(Y[1].ui.r,Y[0].ri>0||Y[0].re>0||Y[0].ric>0||Y[0].rec>0)),h?ae?(ae.p(Y,x),x&3&&$(ae,1)):(ae=Oo(Y),ae.c(),$(ae,1),ae.m(e,g)):ae&&(gt(),fe(ae,1,1,()=>{ae=null}),kt()),x&3&&(k=Vt(Y[1].ui.c,Y[0].ea)),k?Z?(Z.p(Y,x),x&3&&$(Z,1)):(Z=Io(Y),Z.c(),$(Z,1),Z.m(e,T)):Z&&(gt(),fe(Z,1,1,()=>{Z=null}),kt()),x&3&&(O=Vt(Y[1].ui.t,Y[0].pr&&(Y[0].pr.startsWith("NO")||Y[0].pr.startsWith("10YNO")||Y[0].pr.startsWith("10Y1001A1001A4")))),O?X?(X.p(Y,x),x&3&&$(X,1)):(X=Ro(Y),X.c(),$(X,1),X.m(e,E)):X&&(gt(),fe(X,1,1,()=>{X=null}),kt()),x&3&&(I=Vt(Y[1].ui.l,Y[0].hm==1)),I?oe?(oe.p(Y,x),x&3&&$(oe,1)):(oe=Fo(Y),oe.c(),$(oe,1),oe.m(e,N)):oe&&(gt(),fe(oe,1,1,()=>{oe=null}),kt()),x&3&&(B=Vt(Y[1].ui.p,Y[0].pe&&!Number.isNaN(Y[0].p))),B?ne?(ne.p(Y,x),x&3&&$(ne,1)):(ne=Uo(Y),ne.c(),$(ne,1),ne.m(e,S)):ne&&(gt(),fe(ne,1,1,()=>{ne=null}),kt()),x&10&&(j=Vt(Y[1].ui.d,Y[3])),j?ie?(ie.p(Y,x),x&10&&$(ie,1)):(ie=Bo(Y),ie.c(),$(ie,1),ie.m(e,z)):ie&&(gt(),fe(ie,1,1,()=>{ie=null}),kt()),x&18&&(V=Vt(Y[1].ui.m,Y[4])),V?re?(re.p(Y,x),x&18&&$(re,1)):(re=jo(Y),re.c(),$(re,1),re.m(e,F)):re&&(gt(),fe(re,1,1,()=>{re=null}),kt()),x&35&&(R=Vt(Y[1].ui.s,Y[0].t&&Y[0].t!=-127&&Y[5].c>1)),R?me?(me.p(Y,x),x&35&&$(me,1)):(me=Ho(Y),me.c(),$(me,1),me.m(e,null)):me&&(gt(),fe(me,1,1,()=>{me=null}),kt())},i(Y){G||($(U),$(H),$(W),$(K),$(Q),$(J),$(ae),$(Z),$(X),$(oe),$(ne),$(ie),$(re),$(me),G=!0)},o(Y){fe(U),fe(H),fe(W),fe(K),fe(Q),fe(J),fe(ae),fe(Z),fe(X),fe(oe),fe(ne),fe(ie),fe(re),fe(me),G=!1},d(Y){Y&&A(e),U&&U.d(),H&&H.d(),W&&W.d(),K&&K.d(),Q&&Q.d(),J&&J.d(),ae&&ae.d(),Z&&Z.d(),X&&X.d(),oe&&oe.d(),ne&&ne.d(),ie&&ie.d(),re&&re.d(),me&&me.d()}}}function b0(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},a={},c={},_={};$i.subscribe(d=>{l(2,o=d)}),pu.subscribe(d=>{l(3,a=d)}),du.subscribe(d=>{l(4,c=d)}),hu.subscribe(d=>{l(5,_=d)});let u={};vl.subscribe(d=>{l(6,u=d)});let f,p,v;return t.$$set=d=>{"data"in d&&l(0,n=d.data),"sysinfo"in d&&l(1,i=d.sysinfo)},t.$$.update=()=>{var d,h,g;t.$$.dirty&1&&(l(7,f=ml((n==null?void 0:n.ic)*1e3,"Wh")),l(8,p=ml((n==null?void 0:n.ec)*1e3,"Wh")),l(9,v=((d=n==null?void 0:n.l1)==null?void 0:d.u)>100&&((h=n==null?void 0:n.l2)==null?void 0:h.u)>100&&((g=n==null?void 0:n.l3)==null?void 0:g.u)>100))},[n,i,o,a,c,_,u,f,p,v]}class g0 extends Dt{constructor(e){super(),qt(this,e,b0,h0,Nt,{data:0,sysinfo:1})}}let Fi={};const Wn=xt(Fi);async function k0(){Fi=await(await fetch("configuration.json")).json(),Wn.set(Fi)}let Ui={};const Nu=xt(Ui);async function w0(){Ui=await(await fetch("priceconfig.json")).json(),Nu.set(Ui)}function yo(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function M0(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function S0(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function zo(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function Wo(t){let e,l,n;return{c(){e=m("option"),e.textContent="UART1",l=b(),n=m("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){q(i,e,o),q(i,l,o),q(i,n,o)},d(i){i&&A(e),i&&A(l),i&&A(n)}}}function Go(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function Vo(t){let e,l,n;return{c(){e=m("option"),l=M("GPIO"),n=M(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){q(i,e,o),s(e,l),s(e,n)},d(i){i&&A(e)}}}function Ko(t){let e,l=t[4]>1&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!((t[0]=="esp32s2"||t[0]=="esp32s3")&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Vo(t);return{c(){l&&l.c(),e=Qt()},m(n,i){l&&l.m(n,i),q(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!((n[0]=="esp32s2"||n[0]=="esp32s3")&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Vo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&A(e)}}}function C0(t){let e,l,n,i,o;function a(h,g){return h[0]=="esp32c3"?S0:M0}let c=a(t),_=c(t),u=t[0]=="esp8266"&&zo(),f=(t[0]=="esp32"||t[0]=="esp32solo")&&Wo(),p=(t[0]=="esp32s2"||t[0]=="esp32s3")&&Go(),v={length:t[1]+1},d=[];for(let h=0;h{"chip"in o&&l(0,n=o.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 Bi extends Dt{constructor(e){super(),qt(this,e,N0,C0,Nt,{chip:0})}}function Yo(t){let e,l,n=t[1]&&Qo(t);return{c(){e=m("div"),l=m("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-80 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){q(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Qo(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&A(e),n&&n.d()}}}function Qo(t){let e,l;return{c(){e=m("div"),l=M(t[1]),r(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){q(n,e,i),s(e,l)},p(n,i){i&2&&D(l,n[1])},d(n){n&&A(e)}}}function T0(t){let e,l=t[0]&&Yo(t);return{c(){l&&l.c(),e=Qt()},m(n,i){l&&l.m(n,i),q(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Yo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Xe,o:Xe,d(n){l&&l.d(n),n&&A(e)}}}function E0(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class pl extends Dt{constructor(e){super(),qt(this,e,E0,T0,Nt,{active:0,message:1})}}function Xo(t,e,l){const n=t.slice();return n[1]=e[l],n}function Zo(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=M("Europe/"),i=M(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,a){q(o,e,a),s(e,l),s(e,i)},p:Xe,d(o){o&&A(e)}}}function P0(t){let e,l,n,i=t[0],o=[];for(let a=0;a>1&1,L=0;L0;w--)L[w]=L[w]?L[w-1]^N.EXPONENT[j._modN(N.LOG[L[w]]+C)]:L[w-1];L[0]=N.EXPONENT[j._modN(N.LOG[L[0]]+C)]}for(C=0;C<=P;C++)L[C]=N.LOG[L[C]]},_checkBadness:function(){var C,w,P,L,y,ee=0,le=this._badness,se=this.buffer,_e=this.width;for(y=0;y<_e-1;y++)for(L=0;L<_e-1;L++)(se[L+_e*y]&&se[L+1+_e*y]&&se[L+_e*(y+1)]&&se[L+1+_e*(y+1)]||!(se[L+_e*y]||se[L+1+_e*y]||se[L+_e*(y+1)]||se[L+1+_e*(y+1)]))&&(ee+=j.N2);var Te=0;for(y=0;y<_e;y++){for(P=0,le[0]=0,C=0,L=0;L<_e;L++)w=se[L+_e*y],C===w?le[P]++:le[++P]=1,C=w,Te+=C?1:-1;ee+=this._getBadness(P)}Te<0&&(Te=-Te);var Se=0,de=Te;for(de+=de<<2,de<<=1;de>_e*_e;)de-=_e*_e,Se++;for(ee+=Se*j.N4,L=0;L<_e;L++){for(P=0,le[0]=0,C=0,y=0;y<_e;y++)w=se[L+_e*y],C===w?le[P]++:le[++P]=1,C=w;ee+=this._getBadness(P)}return ee},_convertBitStream:function(C){var w,P,L=this._ecc,y=this._version;for(P=0;P=le-2&&(C=le-2,y>9&&C--);var se=C;if(y>9){for(ee[se+2]=0,ee[se+3]=0;se--;)w=ee[se],ee[se+3]|=255&w<<4,ee[se+2]=w>>4;ee[2]|=255&C<<4,ee[1]=C>>4,ee[0]=64|C>>12}else{for(ee[se+1]=0,ee[se+2]=0;se--;)w=ee[se],ee[se+2]|=255&w<<4,ee[se+1]=w>>4;ee[1]|=255&C<<4,ee[0]=64|C>>4}for(se=C+3-(y<10);se=5&&(P+=j.N1+L[w]-5);for(w=3;wC||L[w-3]*3>=L[w]*4||L[w+3]*3>=L[w]*4)&&(P+=j.N3);return P},_finish:function(){this._stringBuffer=this.buffer.slice();var C,w,P=0,L=3e4;for(w=0;w<8&&(this._applyMask(w),C=this._checkBadness(),C>=1)L&1&&(y[ee-1-w+ee*8]=1,w<6?y[8+ee*w]=1:y[8+ee*(w+1)]=1);for(w=0;w<7;w++,L>>=1)L&1&&(y[8+ee*(ee-7+w)]=1,w?y[6-w+ee*8]=1:y[7+ee*8]=1)},_interleaveBlocks:function(){var C,w,P=this._dataBlock,L=this._ecc,y=this._eccBlock,ee=0,le=this._calculateMaxLength(),se=this._neccBlock1,_e=this._neccBlock2,Te=this._stringBuffer;for(C=0;C1)for(C=T.BLOCK[L],P=y-7;;){for(w=y-7;w>C-3&&(this._addAlignment(w,P),!(w6)for(C=S.BLOCK[ee-7],w=17,P=0;P<6;P++)for(L=0;L<3;L++,w--)1&(w>11?ee>>w-12:C>>w)?(y[5-P+le*(2-L+le-11)]=1,y[2-L+le-11+le*(5-P)]=1):(this._setMask(5-P,2-L+le-11),this._setMask(2-L+le-11,5-P))},_isMasked:function(C,w){var P=j._getMaskBit(C,w);return this._mask[P]===1},_pack:function(){var C,w,P,L=1,y=1,ee=this.width,le=ee-1,se=ee-1,_e=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(w=0;w<_e;w++)for(C=this._stringBuffer[w],P=0;P<8;P++,C<<=1){128&C&&(this.buffer[le+ee*se]=1);do y?le--:(le++,L?se!==0?se--:(le-=2,L=!L,le===6&&(le--,se=9)):se!==ee-1?se++:(le-=2,L=!L,le===6&&(le--,se-=8))),y=!y;while(this._isMasked(le,se))}},_reverseMask:function(){var C,w,P=this.width;for(C=0;C<9;C++)this._setMask(C,8);for(C=0;C<8;C++)this._setMask(C+P-8,8),this._setMask(8,C);for(w=0;w<7;w++)this._setMask(8,w+P-7)},_setMask:function(C,w){var P=j._getMaskBit(C,w);this._mask[P]=1},_syncMask:function(){var C,w,P=this.width;for(w=0;ww&&(P=C,C=w,w=P),P=w,P+=w*w,P>>=1,P+=C,P},_modN:function(C){for(;C>=255;)C-=255,C=(C>>8)+(C&255);return C},N1:3,N2:3,N3:40,N4:10}),z=j,V=d.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var C=this.element;C.width=C.height=this.qrious.size}}),F=V,R=p.extend(function(C,w,P,L){this.name=C,this.modifiable=Boolean(w),this.defaultValue=P,this._valueTransformer=L},{transform:function(C){var w=this._valueTransformer;return typeof w=="function"?w(C,this):C}}),G=R,U=p.extend(null,{abs:function(C){return C!=null?Math.abs(C):null},hasOwn:function(C,w){return Object.prototype.hasOwnProperty.call(C,w)},noop:function(){},toUpperCase:function(C){return C!=null?C.toUpperCase():null}}),H=U,W=p.extend(function(C){this.options={},C.forEach(function(w){this.options[w.name]=w},this)},{exists:function(C){return this.options[C]!=null},get:function(C,w){return W._get(this.options[C],w)},getAll:function(C){var w,P=this.options,L={};for(w in P)H.hasOwn(P,w)&&(L[w]=W._get(P[w],C));return L},init:function(C,w,P){typeof P!="function"&&(P=H.noop);var L,y;for(L in this.options)H.hasOwn(this.options,L)&&(y=this.options[L],W._set(y,y.defaultValue,w),W._createAccessor(y,w,P));this._setAll(C,w,!0)},set:function(C,w,P){return this._set(C,w,P)},setAll:function(C,w){return this._setAll(C,w)},_set:function(C,w,P,L){var y=this.options[C];if(!y)throw new Error("Invalid option: "+C);if(!y.modifiable&&!L)throw new Error("Option cannot be modified: "+C);return W._set(y,w,P)},_setAll:function(C,w,P){if(!C)return!1;var L,y=!1;for(L in C)H.hasOwn(C,L)&&this._set(L,C[L],w,P)&&(y=!0);return y}},{_createAccessor:function(C,w,P){var L={get:function(){return W._get(C,w)}};C.modifiable&&(L.set=function(y){W._set(C,y,w)&&P(y,C)}),Object.defineProperty(w,C.name,L)},_get:function(C,w){return w["_"+C.name]},_set:function(C,w,P){var L="_"+C.name,y=P[L],ee=C.transform(w!=null?w:C.defaultValue);return P[L]=ee,ee!==y}}),K=W,Q=p.extend(function(){this._services={}},{getService:function(C){var w=this._services[C];if(!w)throw new Error("Service is not being managed with name: "+C);return w},setService:function(C,w){if(this._services[C])throw new Error("Service is already managed with name: "+C);w&&(this._services[C]=w)}}),J=Q,ae=new K([new G("background",!0,"white"),new G("backgroundAlpha",!0,1,H.abs),new G("element"),new G("foreground",!0,"black"),new G("foregroundAlpha",!0,1,H.abs),new G("level",!0,"L",H.toUpperCase),new G("mime",!0,"image/png"),new G("padding",!0,null,H.abs),new G("size",!0,100,H.abs),new G("value",!0,"")]),Z=new J,X=p.extend(function(C){ae.init(C,this,this.update.bind(this));var w=ae.get("element",this),P=Z.getService("element"),L=w&&P.isCanvas(w)?w:P.createCanvas(),y=w&&P.isImage(w)?w:P.createImage();this._canvasRenderer=new g(this,L,!0),this._imageRenderer=new F(this,y,y===w),this.update()},{get:function(){return ae.getAll(this)},set:function(C){ae.setAll(C,this)&&this.update()},toDataURL:function(C){return this.canvas.toDataURL(C||this.mime)},update:function(){var C=new z({level:this.level,value:this.value});this._canvasRenderer.render(C),this._imageRenderer.render(C)}},{use:function(C){Z.setService(C.getName(),C)}});Object.defineProperties(X.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var oe=X,ne=oe,ie=p.extend({getName:function(){}}),re=ie,me=re.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(C){},isImage:function(C){}}),Y=me,x=Y.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(C){return C instanceof HTMLCanvasElement},isImage:function(C){return C instanceof HTMLImageElement}}),ke=x;ne.use(new ke);var pe=ne;return pe})})(Eu);const O0=Eu.exports;function I0(t){let e,l;return{c(){e=m("img"),ai(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){q(n,e,i)},p(n,[i]){i&4&&!ai(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:Xe,o:Xe,d(n){n&&A(e)}}}function R0(t,e,l){const n=new O0;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:a="#000"}=e,{size:c="200"}=e,{value:_=""}=e,{padding:u=0}=e,{className:f="qrcode"}=e,p="";function v(){n.set({background:o,foreground:a,level:i,padding:u,size:c,value:_}),l(2,p=n.toDataURL("image/jpeg"))}return If(()=>{v()}),t.$$set=d=>{"errorCorrection"in d&&l(3,i=d.errorCorrection),"background"in d&&l(4,o=d.background),"color"in d&&l(5,a=d.color),"size"in d&&l(6,c=d.size),"value"in d&&l(0,_=d.value),"padding"in d&&l(7,u=d.padding),"className"in d&&l(1,f=d.className)},t.$$.update=()=>{t.$$.dirty&1&&_&&v()},[_,f,p,i,o,a,c,u]}class F0 extends Dt{constructor(e){super(),qt(this,e,R0,I0,Nt,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function Jo(t,e,l){const n=t.slice();return n[108]=e[l],n}function $o(t,e,l){const n=t.slice();return n[111]=e[l],n[112]=e,n[113]=l,n}function xo(t,e,l){const n=t.slice();return n[114]=e[l],n[115]=e,n[116]=l,n}function U0(t,e,l){const n=t.slice();return n[117]=e[l],n}function B0(t,e,l){const n=t.slice();return n[120]=e[l],n}function ea(t){var At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl,hl,bl,gl,Fe,ct,Be,_t,Sl,Cl,Nl,Tl,Rl,Fl,Ul,Bl,jl,Hl,yl,zl,Wl;let e,l,n=((Zt=(Xt=(At=t[2].conf)==null?void 0:At.general)==null?void 0:Xt.title)!=null?Zt:"General")+"",i,o,a,c,_,u,f,p,v,d,h=((ll=(tl=(el=t[2].conf)==null?void 0:el.general)==null?void 0:tl.hostname)!=null?ll:"Hostname")+"",g,k,T,O,E,I,N=((sl=(il=(nl=t[2].conf)==null?void 0:nl.general)==null?void 0:il.timezone)!=null?sl:"Time zone")+"",B,S,j,z,V,F,R,G,U,H,W,K=((fl=(al=(ol=t[2].conf)==null?void 0:ol.price)==null?void 0:al.region)!=null?fl:"Price region")+"",Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke,pe,C,w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze=((jt=(Ie=(ul=t[2].conf)==null?void 0:ul.price)==null?void 0:Ie.currency)!=null?jt:"Currency")+"",Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze=((hl=(cl=(rl=t[2].conf)==null?void 0:rl.price)==null?void 0:cl.enabled)!=null?hl:"Enabled")+"",tt,vt,Mt,dt,te=((ct=(Fe=(gl=(bl=t[2].conf)==null?void 0:bl.general)==null?void 0:gl.security)==null?void 0:Fe.title)!=null?ct:"Security")+"",be,Tt,Ce,qe,pt,at=((Cl=(Sl=(_t=(Be=t[2].conf)==null?void 0:Be.general)==null?void 0:_t.security)==null?void 0:Sl.none)!=null?Cl:"None")+"",ft,ut,Et=((Fl=(Rl=(Tl=(Nl=t[2].conf)==null?void 0:Nl.general)==null?void 0:Tl.security)==null?void 0:Rl.conf)!=null?Fl:"Conf")+"",Ot,St,Pt=((Hl=(jl=(Bl=(Ul=t[2].conf)==null?void 0:Ul.general)==null?void 0:Bl.security)==null?void 0:jl.all)!=null?Hl:"All")+"",It,yt,Ct,ht,Lt=((Wl=(zl=(yl=t[2].conf)==null?void 0:yl.general)==null?void 0:zl.context)!=null?Wl:"Context")+"",Ut,Wt,Ve,Ke,Bt,nt,bt,wt;V=new q0({});let ue=!t[5].p.t&&ta(),Me=["NOK","SEK","DKK","EUR","CHF"],Ae=[];for(let lt=0;lt<5;lt+=1)Ae[lt]=j0(B0(t,Me,lt));Pe=new Ml({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[H0]},$$scope:{ctx:t}}});let it=t[5].p.e&&t[0].chip!="esp8266"&&la(t),rt=t[5].g.s>0&&na(t);return{c(){var lt,Ht,_l;e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),v=m("div"),d=m("div"),g=M(h),k=m("br"),T=b(),O=m("input"),E=b(),I=m("div"),B=M(N),S=m("br"),j=b(),z=m("select"),Re(V.$$.fragment),F=b(),R=m("input"),G=b(),U=m("div"),H=m("div"),W=m("div"),Q=M(K),J=m("br"),ae=b(),Z=m("select"),X=m("optgroup"),ue&&ue.c(),oe=m("option"),oe.textContent="NO1",ne=m("option"),ne.textContent="NO2",ie=m("option"),ie.textContent="NO3",re=m("option"),re.textContent="NO4",me=m("option"),me.textContent="NO5",Y=m("optgroup"),x=m("option"),x.textContent="SE1",ke=m("option"),ke.textContent="SE2",pe=m("option"),pe.textContent="SE3",C=m("option"),C.textContent="SE4",w=m("optgroup"),P=m("option"),P.textContent="DK1",L=m("option"),L.textContent="DK2",y=m("option"),y.textContent="Austria",ee=m("option"),ee.textContent="Belgium",le=m("option"),le.textContent="Czech Republic",se=m("option"),se.textContent="Estonia",_e=m("option"),_e.textContent="Finland",Te=m("option"),Te.textContent="France",Se=m("option"),Se.textContent="Germany",de=m("option"),de.textContent="Great Britain",Ne=m("option"),Ne.textContent="Latvia",we=m("option"),we.textContent="Lithuania",ge=m("option"),ge.textContent="Netherland",he=m("option"),he.textContent="Poland",je=m("option"),je.textContent="Switzerland",Ue=b(),We=m("div"),Je=M(Ze),Ye=m("br"),et=b(),He=m("select");for(let wl=0;wl<5;wl+=1)Ae[wl].c();Oe=b(),ce=m("div"),Re(Pe.$$.fragment),$e=b(),Qe=m("div"),mt=m("label"),ye=m("input"),Ge=b(),tt=M(ze),vt=b(),it&&it.c(),Mt=b(),dt=m("div"),be=M(te),Tt=m("br"),Ce=b(),qe=m("select"),pt=m("option"),ft=M(at),ut=m("option"),Ot=M(Et),St=m("option"),It=M(Pt),yt=b(),rt&&rt.c(),Ct=b(),ht=m("div"),Ut=M(Lt),Wt=m("br"),Ve=b(),Ke=m("input"),r(l,"class","text-sm"),r(a,"href",kl("General-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","g"),u.value="true",r(O,"name","gh"),r(O,"type","text"),r(O,"class","in-f w-full"),r(O,"pattern","[A-Za-z0-9-]+"),r(z,"name","gt"),r(z,"class","in-l w-full"),t[5].g.t===void 0&&Gt(()=>t[21].call(z)),r(v,"class","flex"),r(p,"class","my-1"),r(R,"type","hidden"),r(R,"name","p"),R.value="true",oe.__value="10YNO-1--------2",oe.value=oe.__value,ne.__value="10YNO-2--------T",ne.value=ne.__value,ie.__value="10YNO-3--------J",ie.value=ie.__value,re.__value="10YNO-4--------9",re.value=re.__value,me.__value="10Y1001A1001A48H",me.value=me.__value,r(X,"label","Norway"),x.__value="10Y1001A1001A44P",x.value=x.__value,ke.__value="10Y1001A1001A45N",ke.value=ke.__value,pe.__value="10Y1001A1001A46L",pe.value=pe.__value,C.__value="10Y1001A1001A47J",C.value=C.__value,r(Y,"label","Sweden"),P.__value="10YDK-1--------W",P.value=P.__value,L.__value="10YDK-2--------M",L.value=L.__value,r(w,"label","Denmark"),y.__value="10YAT-APG------L",y.value=y.__value,ee.__value="10YBE----------2",ee.value=ee.__value,le.__value="10YCZ-CEPS-----N",le.value=le.__value,se.__value="10Y1001A1001A39I",se.value=se.__value,_e.__value="10YFI-1--------U",_e.value=_e.__value,Te.__value="10YFR-RTE------C",Te.value=Te.__value,Se.__value="10Y1001A1001A83F",Se.value=Se.__value,de.__value="10YGB----------A",de.value=de.__value,Ne.__value="10YLV-1001A00074",Ne.value=Ne.__value,we.__value="10YLT-1001A0008Q",we.value=we.__value,ge.__value="10YNL----------L",ge.value=ge.__value,he.__value="10YPL-AREA-----S",he.value=he.__value,je.__value="10YCH-SWISSGRIDZ",je.value=je.__value,r(Z,"name","pr"),r(Z,"class","in-f w-full"),t[5].p.r===void 0&&Gt(()=>t[22].call(Z)),r(W,"class","w-full"),r(He,"name","pc"),r(He,"class","in-l"),t[5].p.c===void 0&&Gt(()=>t[23].call(He)),r(H,"class","flex"),r(U,"class","my-1"),r(ce,"class","my-1"),r(ye,"type","checkbox"),r(ye,"name","pe"),ye.__value="true",ye.value=ye.__value,r(ye,"class","rounded mb-1"),r(Qe,"class","my-1"),pt.__value=0,pt.value=pt.__value,ut.__value=1,ut.value=ut.__value,St.__value=2,St.value=St.__value,r(qe,"name","gs"),r(qe,"class","in-s"),t[5].g.s===void 0&&Gt(()=>t[26].call(qe)),r(dt,"class","my-1"),r(Ke,"name","gc"),r(Ke,"type","text"),r(Ke,"pattern","[A-Za-z0-9]+"),r(Ke,"placeholder",Bt=(_l=(Ht=(lt=t[2].conf)==null?void 0:lt.general)==null?void 0:Ht.context_placeholder)!=null?_l:"/"),r(Ke,"class","in-s"),r(Ke,"maxlength","36"),r(ht,"class","my-1"),r(e,"class","cnt")},m(lt,Ht){q(lt,e,Ht),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,v),s(v,d),s(d,g),s(d,k),s(d,T),s(d,O),Ee(O,t[5].g.h),s(v,E),s(v,I),s(I,B),s(I,S),s(I,j),s(I,z),De(V,z,null),ot(z,t[5].g.t,!0),s(e,F),s(e,R),s(e,G),s(e,U),s(U,H),s(H,W),s(W,Q),s(W,J),s(W,ae),s(W,Z),s(Z,X),ue&&ue.m(X,null),s(X,oe),s(X,ne),s(X,ie),s(X,re),s(X,me),s(Z,Y),s(Y,x),s(Y,ke),s(Y,pe),s(Y,C),s(Z,w),s(w,P),s(w,L),s(Z,y),s(Z,ee),s(Z,le),s(Z,se),s(Z,_e),s(Z,Te),s(Z,Se),s(Z,de),s(Z,Ne),s(Z,we),s(Z,ge),s(Z,he),s(Z,je),ot(Z,t[5].p.r,!0),s(H,Ue),s(H,We),s(We,Je),s(We,Ye),s(We,et),s(We,He);for(let _l=0;_l<5;_l+=1)Ae[_l]&&Ae[_l].m(He,null);ot(He,t[5].p.c,!0),s(e,Oe),s(e,ce),De(Pe,ce,null),s(e,$e),s(e,Qe),s(Qe,mt),s(mt,ye),ye.checked=t[5].p.e,s(mt,Ge),s(mt,tt),s(Qe,vt),it&&it.m(Qe,null),s(e,Mt),s(e,dt),s(dt,be),s(dt,Tt),s(dt,Ce),s(dt,qe),s(qe,pt),s(pt,ft),s(qe,ut),s(ut,Ot),s(qe,St),s(St,It),ot(qe,t[5].g.s,!0),s(e,yt),rt&&rt.m(e,null),s(e,Ct),s(e,ht),s(ht,Ut),s(ht,Wt),s(ht,Ve),s(ht,Ke),Ee(Ke,t[5].g.c),nt=!0,bt||(wt=[ve(O,"input",t[20]),ve(z,"change",t[21]),ve(Z,"change",t[22]),ve(He,"change",t[23]),ve(ye,"change",t[24]),ve(qe,"change",t[26]),ve(Ke,"input",t[29])],bt=!0)},p(lt,Ht){var wl,Gl,mn,pn,dn,vn,hn,bn,gn,kn,wn,Mn,Sn,Cn,Nn,Tn,En,Pn,An,qn,Dn,Ln,On,In,Rn,Fn,Un,Bn,jn,Hn,is,ss,os,as,fs,us,rs,cs,_s,ms;(!nt||Ht[0]&4)&&n!==(n=((mn=(Gl=(wl=lt[2].conf)==null?void 0:wl.general)==null?void 0:Gl.title)!=null?mn:"General")+"")&&D(i,n),(!nt||Ht[0]&4)&&h!==(h=((vn=(dn=(pn=lt[2].conf)==null?void 0:pn.general)==null?void 0:dn.hostname)!=null?vn:"Hostname")+"")&&D(g,h),Ht[0]&32&&O.value!==lt[5].g.h&&Ee(O,lt[5].g.h),(!nt||Ht[0]&4)&&N!==(N=((gn=(bn=(hn=lt[2].conf)==null?void 0:hn.general)==null?void 0:bn.timezone)!=null?gn:"Time zone")+"")&&D(B,N),Ht[0]&32&&ot(z,lt[5].g.t),(!nt||Ht[0]&4)&&K!==(K=((Mn=(wn=(kn=lt[2].conf)==null?void 0:kn.price)==null?void 0:wn.region)!=null?Mn:"Price region")+"")&&D(Q,K),lt[5].p.t?ue&&(ue.d(1),ue=null):ue||(ue=ta(),ue.c(),ue.m(X,oe)),Ht[0]&32&&ot(Z,lt[5].p.r),(!nt||Ht[0]&4)&&Ze!==(Ze=((Nn=(Cn=(Sn=lt[2].conf)==null?void 0:Sn.price)==null?void 0:Cn.currency)!=null?Nn:"Currency")+"")&&D(Je,Ze),Ht[0]&32&&ot(He,lt[5].p.c);const _l={};Ht[0]&4|Ht[3]&1073741824&&(_l.$$scope={dirty:Ht,ctx:lt}),Pe.$set(_l),Ht[0]&32&&(ye.checked=lt[5].p.e),(!nt||Ht[0]&4)&&ze!==(ze=((Pn=(En=(Tn=lt[2].conf)==null?void 0:Tn.price)==null?void 0:En.enabled)!=null?Pn:"Enabled")+"")&&D(tt,ze),lt[5].p.e&<[0].chip!="esp8266"?it?it.p(lt,Ht):(it=la(lt),it.c(),it.m(Qe,null)):it&&(it.d(1),it=null),(!nt||Ht[0]&4)&&te!==(te=((Ln=(Dn=(qn=(An=lt[2].conf)==null?void 0:An.general)==null?void 0:qn.security)==null?void 0:Dn.title)!=null?Ln:"Security")+"")&&D(be,te),(!nt||Ht[0]&4)&&at!==(at=((Fn=(Rn=(In=(On=lt[2].conf)==null?void 0:On.general)==null?void 0:In.security)==null?void 0:Rn.none)!=null?Fn:"None")+"")&&D(ft,at),(!nt||Ht[0]&4)&&Et!==(Et=((Hn=(jn=(Bn=(Un=lt[2].conf)==null?void 0:Un.general)==null?void 0:Bn.security)==null?void 0:jn.conf)!=null?Hn:"Conf")+"")&&D(Ot,Et),(!nt||Ht[0]&4)&&Pt!==(Pt=((as=(os=(ss=(is=lt[2].conf)==null?void 0:is.general)==null?void 0:ss.security)==null?void 0:os.all)!=null?as:"All")+"")&&D(It,Pt),Ht[0]&32&&ot(qe,lt[5].g.s),lt[5].g.s>0?rt?rt.p(lt,Ht):(rt=na(lt),rt.c(),rt.m(e,Ct)):rt&&(rt.d(1),rt=null),(!nt||Ht[0]&4)&&Lt!==(Lt=((rs=(us=(fs=lt[2].conf)==null?void 0:fs.general)==null?void 0:us.context)!=null?rs:"Context")+"")&&D(Ut,Lt),(!nt||Ht[0]&4&&Bt!==(Bt=(ms=(_s=(cs=lt[2].conf)==null?void 0:cs.general)==null?void 0:_s.context_placeholder)!=null?ms:"/"))&&r(Ke,"placeholder",Bt),Ht[0]&32&&Ke.value!==lt[5].g.c&&Ee(Ke,lt[5].g.c)},i(lt){nt||($(V.$$.fragment,lt),$(Pe.$$.fragment,lt),nt=!0)},o(lt){fe(V.$$.fragment,lt),fe(Pe.$$.fragment,lt),nt=!1},d(lt){lt&&A(e),Le(V),ue&&ue.d(),$t(Ae,lt),Le(Pe),it&&it.d(),rt&&rt.d(),bt=!1,zt(wt)}}}function ta(t){let e,l,n,i,o;return{c(){e=m("option"),e.textContent="NO1 with support",l=m("option"),l.textContent="NO2 with support",n=m("option"),n.textContent="NO3 with support",i=m("option"),i.textContent="NO4 with support",o=m("option"),o.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,o.__value="NO5S",o.value=o.__value},m(a,c){q(a,e,c),q(a,l,c),q(a,n,c),q(a,i,c),q(a,o,c)},d(a){a&&A(e),a&&A(l),a&&A(n),a&&A(i),a&&A(o)}}}function j0(t){let e,l;return{c(){e=m("option"),l=M(t[120]),e.__value=t[120],e.value=e.__value},m(n,i){q(n,e,i),s(e,l)},p:Xe,d(n){n&&A(e)}}}function H0(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.price)==null?void 0:i.conf)!=null?o:"Configure")+"",l;return{c(){l=M(e)},m(a,c){q(a,l,c)},p(a,c){var _,u,f;c[0]&4&&e!==(e=((f=(u=(_=a[2].conf)==null?void 0:_.price)==null?void 0:u.conf)!=null?f:"Configure")+"")&&D(l,e)},d(a){a&&A(l)}}}function la(t){let e,l,n,i,o;return{c(){var a,c,_;e=m("br"),l=m("input"),r(l,"name","pt"),r(l,"type","text"),r(l,"class","in-s"),r(l,"placeholder",n=(_=(c=(a=t[2].conf)==null?void 0:a.price)==null?void 0:c.api_key_placeholder)!=null?_:"")},m(a,c){q(a,e,c),q(a,l,c),Ee(l,t[5].p.t),i||(o=ve(l,"input",t[25]),i=!0)},p(a,c){var _,u,f;c[0]&4&&n!==(n=(f=(u=(_=a[2].conf)==null?void 0:_.price)==null?void 0:u.api_key_placeholder)!=null?f:"")&&r(l,"placeholder",n),c[0]&32&&l.value!==a[5].p.t&&Ee(l,a[5].p.t)},d(a){a&&A(e),a&&A(l),i=!1,o()}}}function na(t){var k,T,O,E,I,N,B,S;let e,l=((E=(O=(T=(k=t[2].conf)==null?void 0:k.general)==null?void 0:T.security)==null?void 0:O.username)!=null?E:"Username")+"",n,i,o,a,c,_,u=((S=(B=(N=(I=t[2].conf)==null?void 0:I.general)==null?void 0:N.security)==null?void 0:B.password)!=null?S:"Password")+"",f,p,v,d,h,g;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),c=b(),_=m("div"),f=M(u),p=m("br"),v=b(),d=m("input"),r(a,"name","gu"),r(a,"type","text"),r(a,"class","in-s"),r(a,"maxlength","36"),r(e,"class","my-1"),r(d,"name","gp"),r(d,"type","password"),r(d,"class","in-s"),r(d,"maxlength","36"),r(_,"class","my-1")},m(j,z){q(j,e,z),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].g.u),q(j,c,z),q(j,_,z),s(_,f),s(_,p),s(_,v),s(_,d),Ee(d,t[5].g.p),h||(g=[ve(a,"input",t[27]),ve(d,"input",t[28])],h=!0)},p(j,z){var V,F,R,G,U,H,W,K;z[0]&4&&l!==(l=((G=(R=(F=(V=j[2].conf)==null?void 0:V.general)==null?void 0:F.security)==null?void 0:R.username)!=null?G:"Username")+"")&&D(n,l),z[0]&32&&a.value!==j[5].g.u&&Ee(a,j[5].g.u),z[0]&4&&u!==(u=((K=(W=(H=(U=j[2].conf)==null?void 0:U.general)==null?void 0:H.security)==null?void 0:W.password)!=null?K:"Password")+"")&&D(f,u),z[0]&32&&d.value!==j[5].g.p&&Ee(d,j[5].g.p)},d(j){j&&A(e),j&&A(c),j&&A(_),h=!1,zt(g)}}}function ia(t){var vt,Mt,dt,te,be,Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt,ue;let e,l,n=((dt=(Mt=(vt=t[2].conf)==null?void 0:vt.meter)==null?void 0:Mt.title)!=null?dt:"Meter")+"",i,o,a,c,_,u,f,p,v,d,h=((Ce=(Tt=(be=(te=t[2].conf)==null?void 0:te.meter)==null?void 0:be.comm)==null?void 0:Tt.title)!=null?Ce:"Communication")+"",g,k,T,O,E,I=((ft=(at=(pt=(qe=t[2].conf)==null?void 0:qe.meter)==null?void 0:pt.comm)==null?void 0:at.passive)!=null?ft:"Passive")+"",N,B,S=((St=(Ot=(Et=(ut=t[2].conf)==null?void 0:ut.meter)==null?void 0:Et.comm)==null?void 0:Ot.pulse)!=null?St:"Pulse")+"",j,z,V,F,R=((It=(Pt=t[2].common)==null?void 0:Pt.voltage)!=null?It:"Voltage")+"",G,U,H,W,K,Q,J,ae,Z,X=((ht=(Ct=(yt=t[2].conf)==null?void 0:yt.meter)==null?void 0:Ct.fuse)!=null?ht:"Main fuse")+"",oe,ne,ie,re,me,Y,x,ke,pe,C=((Wt=(Ut=(Lt=t[2].conf)==null?void 0:Lt.meter)==null?void 0:Ut.prod)!=null?Wt:"Production")+"",w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he=((Bt=(Ke=(Ve=t[2].conf)==null?void 0:Ve.meter)==null?void 0:Ke.encrypted)!=null?Bt:"Encrypted")+"",je,Ue,We,Ze,Je,Ye,et,He=((ue=(wt=(bt=(nt=t[2].conf)==null?void 0:nt.meter)==null?void 0:bt.multipliers)==null?void 0:wt.title)!=null?ue:"Multipliers")+"",Oe,ce,Pe,$e;function Qe(Me,Ae){return Me[5].m.a===2?z0:y0}let mt=Qe(t),ye=mt(t),Ge=t[5].m.e.e&&sa(t),ze=t[5].m.e.e&&oa(t),tt=t[5].m.m.e&&aa(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("input"),v=b(),d=m("div"),g=M(h),k=m("br"),T=b(),O=m("select"),E=m("option"),N=M(I),B=m("option"),j=M(S),z=b(),ye.c(),V=b(),F=m("div"),G=M(R),U=m("br"),H=b(),W=m("select"),K=m("option"),K.textContent="400V (TN)",Q=m("option"),Q.textContent="230V (IT/TT)",J=b(),ae=m("div"),Z=m("div"),oe=M(X),ne=m("br"),ie=b(),re=m("label"),me=m("input"),Y=b(),x=m("span"),x.textContent="A",ke=b(),pe=m("div"),w=M(C),P=m("br"),L=b(),y=m("label"),ee=m("input"),le=b(),se=m("span"),se.textContent="kWp",_e=b(),Te=m("div"),Se=b(),de=m("div"),Ne=m("label"),we=m("input"),ge=b(),je=M(he),Ue=b(),Ge&&Ge.c(),We=b(),ze&&ze.c(),Ze=b(),Je=m("label"),Ye=m("input"),et=b(),Oe=M(He),ce=b(),tt&&tt.c(),r(l,"class","text-sm"),r(a,"href",kl("Meter-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","m"),u.value="true",r(p,"type","hidden"),r(p,"name","mo"),p.value="1",E.__value=0,E.value=E.__value,B.__value=2,B.value=B.__value,r(O,"name","ma"),r(O,"class","in-s"),t[5].m.a===void 0&&Gt(()=>t[30].call(O)),r(d,"class","my-1"),K.__value=2,K.value=K.__value,Q.__value=1,Q.value=Q.__value,r(W,"name","md"),r(W,"class","in-s"),t[5].m.d===void 0&&Gt(()=>t[36].call(W)),r(F,"class","my-1"),r(me,"name","mf"),r(me,"type","number"),r(me,"min","5"),r(me,"max","65535"),r(me,"class","in-f tr w-full"),r(x,"class","in-post"),r(re,"class","flex"),r(Z,"class","mx-1"),r(ee,"name","mr"),r(ee,"type","number"),r(ee,"min","0"),r(ee,"max","65535"),r(ee,"class","in-f tr w-full"),r(se,"class","in-post"),r(y,"class","flex"),r(pe,"class","mx-1"),r(ae,"class","my-1 flex"),r(Te,"class","my-1"),r(we,"type","checkbox"),r(we,"name","me"),we.__value="true",we.value=we.__value,r(we,"class","rounded mb-1"),r(de,"class","my-1"),r(Ye,"type","checkbox"),r(Ye,"name","mm"),Ye.__value="true",Ye.value=Ye.__value,r(Ye,"class","rounded mb-1"),r(e,"class","cnt")},m(Me,Ae){q(Me,e,Ae),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(e,v),s(e,d),s(d,g),s(d,k),s(d,T),s(d,O),s(O,E),s(E,N),s(O,B),s(B,j),ot(O,t[5].m.a,!0),s(e,z),ye.m(e,null),s(e,V),s(e,F),s(F,G),s(F,U),s(F,H),s(F,W),s(W,K),s(W,Q),ot(W,t[5].m.d,!0),s(e,J),s(e,ae),s(ae,Z),s(Z,oe),s(Z,ne),s(Z,ie),s(Z,re),s(re,me),Ee(me,t[5].m.f),s(re,Y),s(re,x),s(ae,ke),s(ae,pe),s(pe,w),s(pe,P),s(pe,L),s(pe,y),s(y,ee),Ee(ee,t[5].m.r),s(y,le),s(y,se),s(e,_e),s(e,Te),s(e,Se),s(e,de),s(de,Ne),s(Ne,we),we.checked=t[5].m.e.e,s(Ne,ge),s(Ne,je),s(de,Ue),Ge&&Ge.m(de,null),s(e,We),ze&&ze.m(e,null),s(e,Ze),s(e,Je),s(Je,Ye),Ye.checked=t[5].m.m.e,s(Je,et),s(Je,Oe),s(e,ce),tt&&tt.m(e,null),Pe||($e=[ve(O,"change",t[30]),ve(W,"change",t[36]),ve(me,"input",t[37]),ve(ee,"input",t[38]),ve(we,"change",t[39]),ve(Ye,"change",t[42])],Pe=!0)},p(Me,Ae){var it,rt,At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl,hl,bl,gl,Fe,ct,Be,_t,Sl,Cl,Nl,Tl;Ae[0]&4&&n!==(n=((At=(rt=(it=Me[2].conf)==null?void 0:it.meter)==null?void 0:rt.title)!=null?At:"Meter")+"")&&D(i,n),Ae[0]&4&&h!==(h=((tl=(el=(Zt=(Xt=Me[2].conf)==null?void 0:Xt.meter)==null?void 0:Zt.comm)==null?void 0:el.title)!=null?tl:"Communication")+"")&&D(g,h),Ae[0]&4&&I!==(I=((sl=(il=(nl=(ll=Me[2].conf)==null?void 0:ll.meter)==null?void 0:nl.comm)==null?void 0:il.passive)!=null?sl:"Passive")+"")&&D(N,I),Ae[0]&4&&S!==(S=((ul=(fl=(al=(ol=Me[2].conf)==null?void 0:ol.meter)==null?void 0:al.comm)==null?void 0:fl.pulse)!=null?ul:"Pulse")+"")&&D(j,S),Ae[0]&32&&ot(O,Me[5].m.a),mt===(mt=Qe(Me))&&ye?ye.p(Me,Ae):(ye.d(1),ye=mt(Me),ye&&(ye.c(),ye.m(e,V))),Ae[0]&4&&R!==(R=((jt=(Ie=Me[2].common)==null?void 0:Ie.voltage)!=null?jt:"Voltage")+"")&&D(G,R),Ae[0]&32&&ot(W,Me[5].m.d),Ae[0]&4&&X!==(X=((hl=(cl=(rl=Me[2].conf)==null?void 0:rl.meter)==null?void 0:cl.fuse)!=null?hl:"Main fuse")+"")&&D(oe,X),Ae[0]&32&&st(me.value)!==Me[5].m.f&&Ee(me,Me[5].m.f),Ae[0]&4&&C!==(C=((Fe=(gl=(bl=Me[2].conf)==null?void 0:bl.meter)==null?void 0:gl.prod)!=null?Fe:"Production")+"")&&D(w,C),Ae[0]&32&&st(ee.value)!==Me[5].m.r&&Ee(ee,Me[5].m.r),Ae[0]&32&&(we.checked=Me[5].m.e.e),Ae[0]&4&&he!==(he=((_t=(Be=(ct=Me[2].conf)==null?void 0:ct.meter)==null?void 0:Be.encrypted)!=null?_t:"Encrypted")+"")&&D(je,he),Me[5].m.e.e?Ge?Ge.p(Me,Ae):(Ge=sa(Me),Ge.c(),Ge.m(de,null)):Ge&&(Ge.d(1),Ge=null),Me[5].m.e.e?ze?ze.p(Me,Ae):(ze=oa(Me),ze.c(),ze.m(e,Ze)):ze&&(ze.d(1),ze=null),Ae[0]&32&&(Ye.checked=Me[5].m.m.e),Ae[0]&4&&He!==(He=((Tl=(Nl=(Cl=(Sl=Me[2].conf)==null?void 0:Sl.meter)==null?void 0:Cl.multipliers)==null?void 0:Nl.title)!=null?Tl:"Multipliers")+"")&&D(Oe,He),Me[5].m.m.e?tt?tt.p(Me,Ae):(tt=aa(Me),tt.c(),tt.m(e,null)):tt&&(tt.d(1),tt=null)},d(Me){Me&&A(e),ye.d(),Ge&&Ge.d(),ze&&ze.d(),tt&&tt.d(),Pe=!1,zt($e)}}}function y0(t){var oe,ne,ie,re,me,Y,x,ke,pe;let e,l,n=((ie=(ne=(oe=t[2].conf)==null?void 0:oe.meter)==null?void 0:ne.buffer)!=null?ie:"Buffer size")+"",i,o,a,c=((Y=(me=(re=t[2].conf)==null?void 0:re.meter)==null?void 0:me.serial)!=null?Y:"Serial conf.")+"",_,u,f,p,v,d=((pe=(ke=(x=t[2].conf)==null?void 0:x.meter)==null?void 0:ke.inverted)!=null?pe:"inverted")+"",h,g,k,T,O,E,I,N,B,S,j,z,V,F,R,G,U,H,W,K,Q,J,ae,Z=[3,12,24,48,96,192,384,576,1152],X=[];for(let C=0;C<9;C+=1)X[C]=W0(U0(t,Z,C));return{c(){e=m("div"),l=m("span"),i=M(n),o=b(),a=m("span"),_=M(c),u=b(),f=m("label"),p=m("input"),v=b(),h=M(d),g=b(),k=m("div"),T=m("select"),O=m("option"),E=M("Autodetect");for(let C=0;C<9;C+=1)X[C].c();N=b(),B=m("select"),S=m("option"),j=M("-"),V=m("option"),V.textContent="7N1",F=m("option"),F.textContent="8N1",R=m("option"),R.textContent="8N2",G=m("option"),G.textContent="7E1",U=m("option"),U.textContent="8E1",W=b(),K=m("input"),r(l,"class","float-right"),r(p,"name","mi"),p.__value="true",p.value=p.__value,r(p,"type","checkbox"),r(p,"class","rounded mb-1"),r(f,"class","mt-2 ml-3 whitespace-nowrap"),O.__value=0,O.value=O.__value,O.disabled=I=t[5].m.b!=0,r(T,"name","mb"),r(T,"class","in-f tr w-1/2"),t[5].m.b===void 0&&Gt(()=>t[33].call(T)),S.__value=0,S.value=S.__value,S.disabled=z=t[5].m.b!=0,V.__value=2,V.value=V.__value,F.__value=3,F.value=F.__value,R.__value=7,R.value=R.__value,G.__value=10,G.value=G.__value,U.__value=11,U.value=U.__value,r(B,"name","mp"),r(B,"class","in-m"),B.disabled=H=t[5].m.b==0,t[5].m.p===void 0&&Gt(()=>t[34].call(B)),r(K,"name","ms"),r(K,"type","number"),r(K,"min",64),r(K,"max",Q=t[0].chip=="esp8266"?t[5].i.h.p==3||t[5].i.h.p==113?512:256:4096),r(K,"step",64),r(K,"class","in-l tr w-1/2"),r(k,"class","flex w-full"),r(e,"class","my-1")},m(C,w){q(C,e,w),s(e,l),s(l,i),s(e,o),s(e,a),s(a,_),s(e,u),s(e,f),s(f,p),p.checked=t[5].m.i,s(f,v),s(f,h),s(e,g),s(e,k),s(k,T),s(T,O),s(O,E);for(let P=0;P<9;P+=1)X[P]&&X[P].m(T,null);ot(T,t[5].m.b,!0),s(k,N),s(k,B),s(B,S),s(S,j),s(B,V),s(B,F),s(B,R),s(B,G),s(B,U),ot(B,t[5].m.p,!0),s(k,W),s(k,K),Ee(K,t[5].m.s),J||(ae=[ve(p,"change",t[32]),ve(T,"change",t[33]),ve(B,"change",t[34]),ve(K,"input",t[35])],J=!0)},p(C,w){var P,L,y,ee,le,se,_e,Te,Se;w[0]&4&&n!==(n=((y=(L=(P=C[2].conf)==null?void 0:P.meter)==null?void 0:L.buffer)!=null?y:"Buffer size")+"")&&D(i,n),w[0]&4&&c!==(c=((se=(le=(ee=C[2].conf)==null?void 0:ee.meter)==null?void 0:le.serial)!=null?se:"Serial conf.")+"")&&D(_,c),w[0]&32&&(p.checked=C[5].m.i),w[0]&4&&d!==(d=((Se=(Te=(_e=C[2].conf)==null?void 0:_e.meter)==null?void 0:Te.inverted)!=null?Se:"inverted")+"")&&D(h,d),w[0]&32&&I!==(I=C[5].m.b!=0)&&(O.disabled=I),w[0]&32&&ot(T,C[5].m.b),w[0]&32&&z!==(z=C[5].m.b!=0)&&(S.disabled=z),w[0]&32&&H!==(H=C[5].m.b==0)&&(B.disabled=H),w[0]&32&&ot(B,C[5].m.p),w[0]&33&&Q!==(Q=C[0].chip=="esp8266"?C[5].i.h.p==3||C[5].i.h.p==113?512:256:4096)&&r(K,"max",Q),w[0]&32&&st(K.value)!==C[5].m.s&&Ee(K,C[5].m.s)},d(C){C&&A(e),$t(X,C),J=!1,zt(ae)}}}function z0(t){var u,f,p;let e,l,n=((p=(f=(u=t[2].conf)==null?void 0:u.meter)==null?void 0:f.pulses)!=null?p:"Pulses per kWh")+"",i,o,a,c,_;return{c(){e=m("div"),l=m("span"),i=M(n),o=b(),a=m("input"),r(a,"name","mb"),r(a,"class","in-s tr"),r(a,"type","number"),r(a,"min",1),r(a,"max",3600),r(e,"class","my-1")},m(v,d){q(v,e,d),s(e,l),s(l,i),s(e,o),s(e,a),Ee(a,t[5].m.b),c||(_=ve(a,"input",t[31]),c=!0)},p(v,d){var h,g,k;d[0]&4&&n!==(n=((k=(g=(h=v[2].conf)==null?void 0:h.meter)==null?void 0:g.pulses)!=null?k:"Pulses per kWh")+"")&&D(i,n),d[0]&32&&st(a.value)!==v[5].m.b&&Ee(a,v[5].m.b)},d(v){v&&A(e),c=!1,_()}}}function W0(t){let e,l=t[117]*100+"",n;return{c(){e=m("option"),n=M(l),e.__value=t[117]*100,e.value=e.__value},m(i,o){q(i,e,o),s(e,n)},p:Xe,d(i){i&&A(e)}}}function sa(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,a){q(o,e,a),q(o,l,a),Ee(l,t[5].m.e.k),n||(i=ve(l,"input",t[40]),n=!0)},p(o,a){a[0]&32&&l.value!==o[5].m.e.k&&Ee(l,o[5].m.e.k)},d(o){o&&A(e),o&&A(l),n=!1,i()}}}function oa(t){var u,f,p;let e,l=((p=(f=(u=t[2].conf)==null?void 0:u.meter)==null?void 0:f.authkey)!=null?p:"Authentication key")+"",n,i,o,a,c,_;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),r(a,"name","mea"),r(a,"type","text"),r(a,"class","in-s"),r(e,"class","my-1")},m(v,d){q(v,e,d),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].m.e.a),c||(_=ve(a,"input",t[41]),c=!0)},p(v,d){var h,g,k;d[0]&4&&l!==(l=((k=(g=(h=v[2].conf)==null?void 0:h.meter)==null?void 0:g.authkey)!=null?k:"Authentication key")+"")&&D(n,l),d[0]&32&&a.value!==v[5].m.e.a&&Ee(a,v[5].m.e.a)},d(v){v&&A(e),c=!1,_()}}}function aa(t){var H,W,K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke;let e,l,n=((Q=(K=(W=(H=t[2].conf)==null?void 0:H.meter)==null?void 0:W.multipliers)==null?void 0:K.watt)!=null?Q:"Watt")+"",i,o,a,c,_,u,f=((X=(Z=(ae=(J=t[2].conf)==null?void 0:J.meter)==null?void 0:ae.multipliers)==null?void 0:Z.volt)!=null?X:"Volt")+"",p,v,d,h,g,k,T=((re=(ie=(ne=(oe=t[2].conf)==null?void 0:oe.meter)==null?void 0:ne.multipliers)==null?void 0:ie.amp)!=null?re:"Amp")+"",O,E,I,N,B,S,j=((ke=(x=(Y=(me=t[2].conf)==null?void 0:me.meter)==null?void 0:Y.multipliers)==null?void 0:x.kwh)!=null?ke:"kWh")+"",z,V,F,R,G,U;return{c(){e=m("div"),l=m("div"),i=M(n),o=m("br"),a=b(),c=m("input"),_=b(),u=m("div"),p=M(f),v=m("br"),d=b(),h=m("input"),g=b(),k=m("div"),O=M(T),E=m("br"),I=b(),N=m("input"),B=b(),S=m("div"),z=M(j),V=m("br"),F=b(),R=m("input"),r(c,"name","mmw"),r(c,"type","number"),r(c,"min","0.00"),r(c,"max","1000"),r(c,"step","0.001"),r(c,"class","in-f tr w-full"),r(l,"class","w-1/4"),r(h,"name","mmv"),r(h,"type","number"),r(h,"min","0.00"),r(h,"max","1000"),r(h,"step","0.001"),r(h,"class","in-m tr w-full"),r(u,"class","w-1/4"),r(N,"name","mma"),r(N,"type","number"),r(N,"min","0.00"),r(N,"max","1000"),r(N,"step","0.001"),r(N,"class","in-m tr w-full"),r(k,"class","w-1/4"),r(R,"name","mmc"),r(R,"type","number"),r(R,"min","0.00"),r(R,"max","1000"),r(R,"step","0.001"),r(R,"class","in-l tr w-full"),r(S,"class","w-1/4"),r(e,"class","flex my-1")},m(pe,C){q(pe,e,C),s(e,l),s(l,i),s(l,o),s(l,a),s(l,c),Ee(c,t[5].m.m.w),s(e,_),s(e,u),s(u,p),s(u,v),s(u,d),s(u,h),Ee(h,t[5].m.m.v),s(e,g),s(e,k),s(k,O),s(k,E),s(k,I),s(k,N),Ee(N,t[5].m.m.a),s(e,B),s(e,S),s(S,z),s(S,V),s(S,F),s(S,R),Ee(R,t[5].m.m.c),G||(U=[ve(c,"input",t[43]),ve(h,"input",t[44]),ve(N,"input",t[45]),ve(R,"input",t[46])],G=!0)},p(pe,C){var w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je;C[0]&4&&n!==(n=((y=(L=(P=(w=pe[2].conf)==null?void 0:w.meter)==null?void 0:P.multipliers)==null?void 0:L.watt)!=null?y:"Watt")+"")&&D(i,n),C[0]&32&&st(c.value)!==pe[5].m.m.w&&Ee(c,pe[5].m.m.w),C[0]&4&&f!==(f=((_e=(se=(le=(ee=pe[2].conf)==null?void 0:ee.meter)==null?void 0:le.multipliers)==null?void 0:se.volt)!=null?_e:"Volt")+"")&&D(p,f),C[0]&32&&st(h.value)!==pe[5].m.m.v&&Ee(h,pe[5].m.m.v),C[0]&4&&T!==(T=((Ne=(de=(Se=(Te=pe[2].conf)==null?void 0:Te.meter)==null?void 0:Se.multipliers)==null?void 0:de.amp)!=null?Ne:"Amp")+"")&&D(O,T),C[0]&32&&st(N.value)!==pe[5].m.m.a&&Ee(N,pe[5].m.m.a),C[0]&4&&j!==(j=((je=(he=(ge=(we=pe[2].conf)==null?void 0:we.meter)==null?void 0:ge.multipliers)==null?void 0:he.kwh)!=null?je:"kWh")+"")&&D(z,j),C[0]&32&&st(R.value)!==pe[5].m.m.c&&Ee(R,pe[5].m.m.c)},d(pe){pe&&A(e),G=!1,zt(U)}}}function fa(t){var j,z,V,F,R,G,U,H,W;let e,l,n=((V=(z=(j=t[2].conf)==null?void 0:j.connection)==null?void 0:z.title)!=null?V:"Connection")+"",i,o,a,c,_,u,f,p,v,d,h=((G=(R=(F=t[2].conf)==null?void 0:F.connection)==null?void 0:R.wifi)!=null?G:"WiFi")+"",g,k,T=((W=(H=(U=t[2].conf)==null?void 0:U.connection)==null?void 0:H.ap)!=null?W:"AP")+"",O,E,I,N,B=t[0].if&&t[0].if.eth&&ua(t),S=(t[5].n.c==1||t[5].n.c==2)&&ra(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),v=m("select"),d=m("option"),g=M(h),k=m("option"),O=M(T),B&&B.c(),E=b(),S&&S.c(),r(l,"class","text-sm"),r(a,"href",kl("WiFi-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","w"),u.value="true",d.__value=1,d.value=d.__value,k.__value=2,k.value=k.__value,r(v,"name","nc"),r(v,"class","in-s"),t[5].n.c===void 0&&Gt(()=>t[47].call(v)),r(p,"class","my-1"),r(e,"class","cnt")},m(K,Q){q(K,e,Q),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,v),s(v,d),s(d,g),s(v,k),s(k,O),B&&B.m(v,null),ot(v,t[5].n.c,!0),s(e,E),S&&S.m(e,null),I||(N=ve(v,"change",t[47]),I=!0)},p(K,Q){var J,ae,Z,X,oe,ne,ie,re,me;Q[0]&4&&n!==(n=((Z=(ae=(J=K[2].conf)==null?void 0:J.connection)==null?void 0:ae.title)!=null?Z:"Connection")+"")&&D(i,n),Q[0]&4&&h!==(h=((ne=(oe=(X=K[2].conf)==null?void 0:X.connection)==null?void 0:oe.wifi)!=null?ne:"WiFi")+"")&&D(g,h),Q[0]&4&&T!==(T=((me=(re=(ie=K[2].conf)==null?void 0:ie.connection)==null?void 0:re.ap)!=null?me:"AP")+"")&&D(O,T),K[0].if&&K[0].if.eth?B?B.p(K,Q):(B=ua(K),B.c(),B.m(v,null)):B&&(B.d(1),B=null),Q[0]&32&&ot(v,K[5].n.c),K[5].n.c==1||K[5].n.c==2?S?S.p(K,Q):(S=ra(K),S.c(),S.m(e,null)):S&&(S.d(1),S=null)},d(K){K&&A(e),B&&B.d(),S&&S.d(),I=!1,N()}}}function ua(t){var i,o,a;let e,l=((a=(o=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:o.eth)!=null?a:"Ethernet")+"",n;return{c(){e=m("option"),n=M(l),e.__value=3,e.value=e.__value},m(c,_){q(c,e,_),s(e,n)},p(c,_){var u,f,p;_[0]&4&&l!==(l=((p=(f=(u=c[2].conf)==null?void 0:u.connection)==null?void 0:f.eth)!=null?p:"Ethernet")+"")&&D(n,l)},d(c){c&&A(e)}}}function ra(t){var ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt;let e,l=((se=(le=(ee=t[2].conf)==null?void 0:ee.connection)==null?void 0:le.ssid)!=null?se:"SSID")+"",n,i,o,a,c,_,u=((Se=(Te=(_e=t[2].conf)==null?void 0:_e.connection)==null?void 0:Te.psk)!=null?Se:"Password")+"",f,p,v,d,h,g,k,T=((ge=(we=(Ne=(de=t[2].conf)==null?void 0:de.connection)==null?void 0:Ne.ps)==null?void 0:we.title)!=null?ge:"Power saving")+"",O,E,I,N,B,S=((We=(Ue=(je=(he=t[2].conf)==null?void 0:he.connection)==null?void 0:je.ps)==null?void 0:Ue.default)!=null?We:"Default")+"",j,z,V=((et=(Ye=(Je=(Ze=t[2].conf)==null?void 0:Ze.connection)==null?void 0:Je.ps)==null?void 0:Ye.off)!=null?et:"Off")+"",F,R,G=((Pe=(ce=(Oe=(He=t[2].conf)==null?void 0:He.connection)==null?void 0:Oe.ps)==null?void 0:ce.min)!=null?Pe:"Min")+"",U,H,W=((ye=(mt=(Qe=($e=t[2].conf)==null?void 0:$e.connection)==null?void 0:Qe.ps)==null?void 0:mt.max)!=null?ye:"Max")+"",K,Q,J,ae=((tt=(ze=(Ge=t[2].conf)==null?void 0:Ge.connection)==null?void 0:ze.pwr)!=null?tt:"Power")+"",Z,X,oe,ne,ie,re,me,Y,x,ke,pe,C,w=((dt=(Mt=(vt=t[2].conf)==null?void 0:vt.connection)==null?void 0:Mt.tick_11b)!=null?dt:"802.11b")+"",P,L,y;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),c=b(),_=m("div"),f=M(u),p=m("br"),v=b(),d=m("input"),h=b(),g=m("div"),k=m("div"),O=M(T),E=m("br"),I=b(),N=m("select"),B=m("option"),j=M(S),z=m("option"),F=M(V),R=m("option"),U=M(G),H=m("option"),K=M(W),Q=b(),J=m("div"),Z=M(ae),X=m("br"),oe=b(),ne=m("div"),ie=m("input"),re=b(),me=m("span"),me.textContent="dBm",Y=b(),x=m("div"),ke=m("label"),pe=m("input"),C=b(),P=M(w),r(a,"name","ws"),r(a,"type","text"),r(a,"class","in-s"),r(e,"class","my-1"),r(d,"name","wp"),r(d,"type","password"),r(d,"class","in-s"),r(_,"class","my-1"),B.__value=255,B.value=B.__value,z.__value=0,z.value=z.__value,R.__value=1,R.value=R.__value,H.__value=2,H.value=H.__value,r(N,"name","wz"),r(N,"class","in-s"),t[5].w.z===void 0&&Gt(()=>t[50].call(N)),r(k,"class","w-1/2"),r(ie,"name","ww"),r(ie,"type","number"),r(ie,"min","0"),r(ie,"max","20.5"),r(ie,"step","0.5"),r(ie,"class","in-f tr w-full"),r(me,"class","in-post"),r(ne,"class","flex"),r(J,"class","ml-2 w-1/2"),r(g,"class","my-1 flex"),r(pe,"type","checkbox"),r(pe,"name","wb"),pe.__value="true",pe.value=pe.__value,r(pe,"class","rounded mb-1"),r(x,"class","my-3")},m(te,be){q(te,e,be),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].w.s),q(te,c,be),q(te,_,be),s(_,f),s(_,p),s(_,v),s(_,d),Ee(d,t[5].w.p),q(te,h,be),q(te,g,be),s(g,k),s(k,O),s(k,E),s(k,I),s(k,N),s(N,B),s(B,j),s(N,z),s(z,F),s(N,R),s(R,U),s(N,H),s(H,K),ot(N,t[5].w.z,!0),s(g,Q),s(g,J),s(J,Z),s(J,X),s(J,oe),s(J,ne),s(ne,ie),Ee(ie,t[5].w.w),s(ne,re),s(ne,me),q(te,Y,be),q(te,x,be),s(x,ke),s(ke,pe),pe.checked=t[5].w.b,s(ke,C),s(ke,P),L||(y=[ve(a,"input",t[48]),ve(d,"input",t[49]),ve(N,"change",t[50]),ve(ie,"input",t[51]),ve(pe,"change",t[52])],L=!0)},p(te,be){var Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt,ue,Me,Ae,it,rt,At,Xt,Zt;be[0]&4&&l!==(l=((qe=(Ce=(Tt=te[2].conf)==null?void 0:Tt.connection)==null?void 0:Ce.ssid)!=null?qe:"SSID")+"")&&D(n,l),be[0]&32&&a.value!==te[5].w.s&&Ee(a,te[5].w.s),be[0]&4&&u!==(u=((ft=(at=(pt=te[2].conf)==null?void 0:pt.connection)==null?void 0:at.psk)!=null?ft:"Password")+"")&&D(f,u),be[0]&32&&d.value!==te[5].w.p&&Ee(d,te[5].w.p),be[0]&4&&T!==(T=((St=(Ot=(Et=(ut=te[2].conf)==null?void 0:ut.connection)==null?void 0:Et.ps)==null?void 0:Ot.title)!=null?St:"Power saving")+"")&&D(O,T),be[0]&4&&S!==(S=((Ct=(yt=(It=(Pt=te[2].conf)==null?void 0:Pt.connection)==null?void 0:It.ps)==null?void 0:yt.default)!=null?Ct:"Default")+"")&&D(j,S),be[0]&4&&V!==(V=((Wt=(Ut=(Lt=(ht=te[2].conf)==null?void 0:ht.connection)==null?void 0:Lt.ps)==null?void 0:Ut.off)!=null?Wt:"Off")+"")&&D(F,V),be[0]&4&&G!==(G=((nt=(Bt=(Ke=(Ve=te[2].conf)==null?void 0:Ve.connection)==null?void 0:Ke.ps)==null?void 0:Bt.min)!=null?nt:"Min")+"")&&D(U,G),be[0]&4&&W!==(W=((Me=(ue=(wt=(bt=te[2].conf)==null?void 0:bt.connection)==null?void 0:wt.ps)==null?void 0:ue.max)!=null?Me:"Max")+"")&&D(K,W),be[0]&32&&ot(N,te[5].w.z),be[0]&4&&ae!==(ae=((rt=(it=(Ae=te[2].conf)==null?void 0:Ae.connection)==null?void 0:it.pwr)!=null?rt:"Power")+"")&&D(Z,ae),be[0]&32&&st(ie.value)!==te[5].w.w&&Ee(ie,te[5].w.w),be[0]&32&&(pe.checked=te[5].w.b),be[0]&4&&w!==(w=((Zt=(Xt=(At=te[2].conf)==null?void 0:At.connection)==null?void 0:Xt.tick_11b)!=null?Zt:"802.11b")+"")&&D(P,w)},d(te){te&&A(e),te&&A(c),te&&A(_),te&&A(h),te&&A(g),te&&A(Y),te&&A(x),L=!1,zt(y)}}}function ca(t){var je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt;let e,l,n=((We=(Ue=(je=t[2].conf)==null?void 0:je.network)==null?void 0:Ue.title)!=null?We:"Network")+"",i,o,a,c,_,u,f=((Ye=(Je=(Ze=t[2].conf)==null?void 0:Ze.network)==null?void 0:Je.ip)!=null?Ye:"IP")+"",p,v,d,h,g,k,T=((Oe=(He=(et=t[2].conf)==null?void 0:et.network)==null?void 0:He.dhcp)!=null?Oe:"DHCP")+"",O,E,I=(($e=(Pe=(ce=t[2].conf)==null?void 0:ce.network)==null?void 0:Pe.static)!=null?$e:"Static")+"",N,B,S,j,z,V,F,R,G,U,H,W,K,Q,J,ae,Z,X,oe,ne,ie,re=((ye=(mt=(Qe=t[2].conf)==null?void 0:Qe.network)==null?void 0:mt.tick_mdns)!=null?ye:"mDNS")+"",me,Y,x,ke,pe,C=((tt=(ze=(Ge=t[2].conf)==null?void 0:Ge.network)==null?void 0:ze.ntp)!=null?tt:"NTP")+"",w,P,L,y,ee,le=((dt=(Mt=(vt=t[2].conf)==null?void 0:vt.network)==null?void 0:Mt.tick_ntp_dhcp)!=null?dt:"from DHCP")+"",se,_e,Te,Se,de,Ne,we,ge;R=new Tu({});let he=t[5].n.m=="static"&&_a(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("div"),p=M(f),v=m("br"),d=b(),h=m("div"),g=m("select"),k=m("option"),O=M(T),E=m("option"),N=M(I),B=b(),S=m("input"),V=b(),F=m("select"),Re(R.$$.fragment),H=b(),he&&he.c(),W=b(),K=m("div"),Q=m("label"),J=m("input"),ae=M(" IPv6"),Z=b(),X=m("div"),oe=m("label"),ne=m("input"),ie=b(),me=M(re),Y=b(),x=m("input"),ke=b(),pe=m("div"),w=M(C),P=b(),L=m("label"),y=m("input"),ee=b(),se=M(le),_e=m("br"),Te=b(),Se=m("div"),de=m("input"),r(l,"class","text-sm"),r(a,"href",kl("Network-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),k.__value="dhcp",k.value=k.__value,E.__value="static",E.value=E.__value,r(g,"name","nm"),r(g,"class","in-f"),t[5].n.m===void 0&&Gt(()=>t[53].call(g)),r(S,"name","ni"),r(S,"type","text"),r(S,"class","in-m w-full"),S.disabled=j=t[5].n.m=="dhcp",S.required=z=t[5].n.m=="static",r(F,"name","ns"),r(F,"class","in-l"),F.disabled=G=t[5].n.m=="dhcp",F.required=U=t[5].n.m=="static",t[5].n.s===void 0&&Gt(()=>t[55].call(F)),r(h,"class","flex"),r(u,"class","my-1"),r(J,"name","nx"),J.__value="true",J.value=J.__value,r(J,"type","checkbox"),r(J,"class","rounded mb-1"),r(K,"class","my-1"),r(ne,"name","nd"),ne.__value="true",ne.value=ne.__value,r(ne,"type","checkbox"),r(ne,"class","rounded mb-1"),r(X,"class","my-1"),r(x,"type","hidden"),r(x,"name","ntp"),x.value="true",r(y,"name","ntpd"),y.__value="true",y.value=y.__value,r(y,"type","checkbox"),r(y,"class","rounded mb-1"),r(L,"class","ml-4"),r(de,"name","ntph"),r(de,"type","text"),r(de,"class","in-s"),r(Se,"class","flex"),r(pe,"class","my-1"),r(e,"class","cnt")},m(te,be){q(te,e,be),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(u,p),s(u,v),s(u,d),s(u,h),s(h,g),s(g,k),s(k,O),s(g,E),s(E,N),ot(g,t[5].n.m,!0),s(h,B),s(h,S),Ee(S,t[5].n.i),s(h,V),s(h,F),De(R,F,null),ot(F,t[5].n.s,!0),s(e,H),he&&he.m(e,null),s(e,W),s(e,K),s(K,Q),s(Q,J),J.checked=t[5].n.x,s(Q,ae),s(e,Z),s(e,X),s(X,oe),s(oe,ne),ne.checked=t[5].n.d,s(oe,ie),s(oe,me),s(e,Y),s(e,x),s(e,ke),s(e,pe),s(pe,w),s(pe,P),s(pe,L),s(L,y),y.checked=t[5].n.h,s(L,ee),s(L,se),s(pe,_e),s(pe,Te),s(pe,Se),s(Se,de),Ee(de,t[5].n.n1),Ne=!0,we||(ge=[ve(g,"change",t[53]),ve(S,"input",t[54]),ve(F,"change",t[55]),ve(J,"change",t[59]),ve(ne,"change",t[60]),ve(y,"change",t[61]),ve(de,"input",t[62])],we=!0)},p(te,be){var Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt;(!Ne||be[0]&4)&&n!==(n=((qe=(Ce=(Tt=te[2].conf)==null?void 0:Tt.network)==null?void 0:Ce.title)!=null?qe:"Network")+"")&&D(i,n),(!Ne||be[0]&4)&&f!==(f=((ft=(at=(pt=te[2].conf)==null?void 0:pt.network)==null?void 0:at.ip)!=null?ft:"IP")+"")&&D(p,f),(!Ne||be[0]&4)&&T!==(T=((Ot=(Et=(ut=te[2].conf)==null?void 0:ut.network)==null?void 0:Et.dhcp)!=null?Ot:"DHCP")+"")&&D(O,T),(!Ne||be[0]&4)&&I!==(I=((It=(Pt=(St=te[2].conf)==null?void 0:St.network)==null?void 0:Pt.static)!=null?It:"Static")+"")&&D(N,I),be[0]&32&&ot(g,te[5].n.m),(!Ne||be[0]&32&&j!==(j=te[5].n.m=="dhcp"))&&(S.disabled=j),(!Ne||be[0]&32&&z!==(z=te[5].n.m=="static"))&&(S.required=z),be[0]&32&&S.value!==te[5].n.i&&Ee(S,te[5].n.i),(!Ne||be[0]&32&&G!==(G=te[5].n.m=="dhcp"))&&(F.disabled=G),(!Ne||be[0]&32&&U!==(U=te[5].n.m=="static"))&&(F.required=U),be[0]&32&&ot(F,te[5].n.s),te[5].n.m=="static"?he?he.p(te,be):(he=_a(te),he.c(),he.m(e,W)):he&&(he.d(1),he=null),be[0]&32&&(J.checked=te[5].n.x),be[0]&32&&(ne.checked=te[5].n.d),(!Ne||be[0]&4)&&re!==(re=((ht=(Ct=(yt=te[2].conf)==null?void 0:yt.network)==null?void 0:Ct.tick_mdns)!=null?ht:"mDNS")+"")&&D(me,re),(!Ne||be[0]&4)&&C!==(C=((Wt=(Ut=(Lt=te[2].conf)==null?void 0:Lt.network)==null?void 0:Ut.ntp)!=null?Wt:"NTP")+"")&&D(w,C),be[0]&32&&(y.checked=te[5].n.h),(!Ne||be[0]&4)&&le!==(le=((Bt=(Ke=(Ve=te[2].conf)==null?void 0:Ve.network)==null?void 0:Ke.tick_ntp_dhcp)!=null?Bt:"from DHCP")+"")&&D(se,le),be[0]&32&&de.value!==te[5].n.n1&&Ee(de,te[5].n.n1)},i(te){Ne||($(R.$$.fragment,te),Ne=!0)},o(te){fe(R.$$.fragment,te),Ne=!1},d(te){te&&A(e),Le(R),he&&he.d(),we=!1,zt(ge)}}}function _a(t){var E,I,N,B,S,j;let e,l=((N=(I=(E=t[2].conf)==null?void 0:E.network)==null?void 0:I.gw)!=null?N:"Gateway")+"",n,i,o,a,c,_,u=((j=(S=(B=t[2].conf)==null?void 0:B.network)==null?void 0:S.dns)!=null?j:"DNS")+"",f,p,v,d,h,g,k,T,O;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),c=b(),_=m("div"),f=M(u),p=m("br"),v=b(),d=m("div"),h=m("input"),g=b(),k=m("input"),r(a,"name","ng"),r(a,"type","text"),r(a,"class","in-s"),r(e,"class","my-1"),r(h,"name","nd1"),r(h,"type","text"),r(h,"class","in-f w-full"),r(k,"name","nd2"),r(k,"type","text"),r(k,"class","in-l w-full"),r(d,"class","flex"),r(_,"class","my-1")},m(z,V){q(z,e,V),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].n.g),q(z,c,V),q(z,_,V),s(_,f),s(_,p),s(_,v),s(_,d),s(d,h),Ee(h,t[5].n.d1),s(d,g),s(d,k),Ee(k,t[5].n.d2),T||(O=[ve(a,"input",t[56]),ve(h,"input",t[57]),ve(k,"input",t[58])],T=!0)},p(z,V){var F,R,G,U,H,W;V[0]&4&&l!==(l=((G=(R=(F=z[2].conf)==null?void 0:F.network)==null?void 0:R.gw)!=null?G:"Gateway")+"")&&D(n,l),V[0]&32&&a.value!==z[5].n.g&&Ee(a,z[5].n.g),V[0]&4&&u!==(u=((W=(H=(U=z[2].conf)==null?void 0:U.network)==null?void 0:H.dns)!=null?W:"DNS")+"")&&D(f,u),V[0]&32&&h.value!==z[5].n.d1&&Ee(h,z[5].n.d1),V[0]&32&&k.value!==z[5].n.d2&&Ee(k,z[5].n.d2)},d(z){z&&A(e),z&&A(c),z&&A(_),T=!1,zt(O)}}}function ma(t){var Qe,mt,ye,Ge,ze,tt,vt,Mt,dt,te,be,Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt;let e,l,n=((ye=(mt=(Qe=t[2].conf)==null?void 0:Qe.mqtt)==null?void 0:mt.title)!=null?ye:"MQTT")+"",i,o,a,c,_,u,f,p,v=((tt=(ze=(Ge=t[2].conf)==null?void 0:Ge.mqtt)==null?void 0:ze.server)!=null?tt:"Server")+"",d,h,g,k,T,O,E,I,N,B,S,j,z=((dt=(Mt=(vt=t[2].conf)==null?void 0:vt.mqtt)==null?void 0:Mt.user)!=null?dt:"Username")+"",V,F,R,G,U,H,W=((Tt=(be=(te=t[2].conf)==null?void 0:te.mqtt)==null?void 0:be.pass)!=null?Tt:"Password")+"",K,Q,J,ae,Z,X,oe,ne=((pt=(qe=(Ce=t[2].conf)==null?void 0:Ce.mqtt)==null?void 0:qe.id)!=null?pt:"Client ID")+"",ie,re,me,Y,x,ke,pe=((ut=(ft=(at=t[2].conf)==null?void 0:at.mqtt)==null?void 0:ft.payload)!=null?ut:"Payload")+"",C,w,P,L,y,ee,le,se=((Pt=(St=(Ot=(Et=t[2].conf)==null?void 0:Et.mqtt)==null?void 0:Ot.domoticz)==null?void 0:St.title)!=null?Pt:"Domoticz")+"",_e,Te,Se=((ht=(Ct=(yt=(It=t[2].conf)==null?void 0:It.mqtt)==null?void 0:yt.ha)==null?void 0:Ct.title)!=null?ht:"Home-Assistant")+"",de,Ne,we,ge,he,je,Ue,We=((Wt=(Ut=(Lt=t[2].conf)==null?void 0:Lt.mqtt)==null?void 0:Ut.publish)!=null?Wt:"Publish topic")+"",Ze,Je,Ye,et,He,Oe,ce,Pe=t[0].chip!="esp8266"&&pa(t),$e=t[5].q.s.e&&da(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),d=M(v),h=b(),Pe&&Pe.c(),g=b(),k=m("br"),T=b(),O=m("div"),E=m("input"),I=b(),N=m("input"),B=b(),$e&&$e.c(),S=b(),j=m("div"),V=M(z),F=m("br"),R=b(),G=m("input"),U=b(),H=m("div"),K=M(W),Q=m("br"),J=b(),ae=m("input"),Z=b(),X=m("div"),oe=m("div"),ie=M(ne),re=m("br"),me=b(),Y=m("input"),x=b(),ke=m("div"),C=M(pe),w=m("br"),P=b(),L=m("select"),y=m("option"),y.textContent="Raw (minimal)",ee=m("option"),ee.textContent="Raw (full)",le=m("option"),_e=M(se),Te=m("option"),de=M(Se),Ne=m("option"),Ne.textContent="JSON (classic)",we=m("option"),we.textContent="JSON (multi topic)",ge=m("option"),ge.textContent="JSON (flat)",he=m("option"),he.textContent="HEX dump",je=b(),Ue=m("div"),Ze=M(We),Je=m("br"),Ye=b(),et=m("input"),r(l,"class","text-sm"),r(a,"href",kl("MQTT-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","q"),u.value="true",r(E,"name","qh"),r(E,"type","text"),r(E,"class","in-f w-2/3"),r(N,"name","qp"),r(N,"type","number"),r(N,"min","1024"),r(N,"max","65535"),r(N,"class","in-l tr w-1/3"),r(O,"class","flex"),r(p,"class","my-1"),r(G,"name","qu"),r(G,"type","text"),r(G,"class","in-s"),r(j,"class","my-1"),r(ae,"name","qa"),r(ae,"type","password"),r(ae,"class","in-s"),r(H,"class","my-1"),r(Y,"name","qc"),r(Y,"type","text"),r(Y,"class","in-f w-full"),y.__value=1,y.value=y.__value,ee.__value=2,ee.value=ee.__value,le.__value=3,le.value=le.__value,Te.__value=4,Te.value=Te.__value,Ne.__value=0,Ne.value=Ne.__value,we.__value=5,we.value=we.__value,ge.__value=6,ge.value=ge.__value,he.__value=255,he.value=he.__value,r(L,"name","qm"),r(L,"class","in-l"),t[5].q.m===void 0&&Gt(()=>t[69].call(L)),r(X,"class","my-1 flex"),r(et,"name","qb"),r(et,"type","text"),r(et,"class","in-s"),r(Ue,"class","my-1"),r(e,"class","cnt")},m(Ve,Ke){q(Ve,e,Ke),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,d),s(p,h),Pe&&Pe.m(p,null),s(p,g),s(p,k),s(p,T),s(p,O),s(O,E),Ee(E,t[5].q.h),s(O,I),s(O,N),Ee(N,t[5].q.p),s(e,B),$e&&$e.m(e,null),s(e,S),s(e,j),s(j,V),s(j,F),s(j,R),s(j,G),Ee(G,t[5].q.u),s(e,U),s(e,H),s(H,K),s(H,Q),s(H,J),s(H,ae),Ee(ae,t[5].q.a),s(e,Z),s(e,X),s(X,oe),s(oe,ie),s(oe,re),s(oe,me),s(oe,Y),Ee(Y,t[5].q.c),s(X,x),s(X,ke),s(ke,C),s(ke,w),s(ke,P),s(ke,L),s(L,y),s(L,ee),s(L,le),s(le,_e),s(L,Te),s(Te,de),s(L,Ne),s(L,we),s(L,ge),s(L,he),ot(L,t[5].q.m,!0),s(e,je),s(e,Ue),s(Ue,Ze),s(Ue,Je),s(Ue,Ye),s(Ue,et),Ee(et,t[5].q.b),He=!0,Oe||(ce=[ve(E,"input",t[64]),ve(N,"input",t[65]),ve(G,"input",t[66]),ve(ae,"input",t[67]),ve(Y,"input",t[68]),ve(L,"change",t[69]),ve(et,"input",t[70])],Oe=!0)},p(Ve,Ke){var Bt,nt,bt,wt,ue,Me,Ae,it,rt,At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl,hl,bl,gl;(!He||Ke[0]&4)&&n!==(n=((bt=(nt=(Bt=Ve[2].conf)==null?void 0:Bt.mqtt)==null?void 0:nt.title)!=null?bt:"MQTT")+"")&&D(i,n),(!He||Ke[0]&4)&&v!==(v=((Me=(ue=(wt=Ve[2].conf)==null?void 0:wt.mqtt)==null?void 0:ue.server)!=null?Me:"Server")+"")&&D(d,v),Ve[0].chip!="esp8266"?Pe?Pe.p(Ve,Ke):(Pe=pa(Ve),Pe.c(),Pe.m(p,g)):Pe&&(Pe.d(1),Pe=null),Ke[0]&32&&E.value!==Ve[5].q.h&&Ee(E,Ve[5].q.h),Ke[0]&32&&st(N.value)!==Ve[5].q.p&&Ee(N,Ve[5].q.p),Ve[5].q.s.e?$e?($e.p(Ve,Ke),Ke[0]&32&&$($e,1)):($e=da(Ve),$e.c(),$($e,1),$e.m(e,S)):$e&&(gt(),fe($e,1,1,()=>{$e=null}),kt()),(!He||Ke[0]&4)&&z!==(z=((rt=(it=(Ae=Ve[2].conf)==null?void 0:Ae.mqtt)==null?void 0:it.user)!=null?rt:"Username")+"")&&D(V,z),Ke[0]&32&&G.value!==Ve[5].q.u&&Ee(G,Ve[5].q.u),(!He||Ke[0]&4)&&W!==(W=((Zt=(Xt=(At=Ve[2].conf)==null?void 0:At.mqtt)==null?void 0:Xt.pass)!=null?Zt:"Password")+"")&&D(K,W),Ke[0]&32&&ae.value!==Ve[5].q.a&&Ee(ae,Ve[5].q.a),(!He||Ke[0]&4)&&ne!==(ne=((ll=(tl=(el=Ve[2].conf)==null?void 0:el.mqtt)==null?void 0:tl.id)!=null?ll:"Client ID")+"")&&D(ie,ne),Ke[0]&32&&Y.value!==Ve[5].q.c&&Ee(Y,Ve[5].q.c),(!He||Ke[0]&4)&&pe!==(pe=((sl=(il=(nl=Ve[2].conf)==null?void 0:nl.mqtt)==null?void 0:il.payload)!=null?sl:"Payload")+"")&&D(C,pe),(!He||Ke[0]&4)&&se!==(se=((ul=(fl=(al=(ol=Ve[2].conf)==null?void 0:ol.mqtt)==null?void 0:al.domoticz)==null?void 0:fl.title)!=null?ul:"Domoticz")+"")&&D(_e,se),(!He||Ke[0]&4)&&Se!==(Se=((cl=(rl=(jt=(Ie=Ve[2].conf)==null?void 0:Ie.mqtt)==null?void 0:jt.ha)==null?void 0:rl.title)!=null?cl:"Home-Assistant")+"")&&D(de,Se),Ke[0]&32&&ot(L,Ve[5].q.m),(!He||Ke[0]&4)&&We!==(We=((gl=(bl=(hl=Ve[2].conf)==null?void 0:hl.mqtt)==null?void 0:bl.publish)!=null?gl:"Publish topic")+"")&&D(Ze,We),Ke[0]&32&&et.value!==Ve[5].q.b&&Ee(et,Ve[5].q.b)},i(Ve){He||($($e),He=!0)},o(Ve){fe($e),He=!1},d(Ve){Ve&&A(e),Pe&&Pe.d(),$e&&$e.d(),Oe=!1,zt(ce)}}}function pa(t){let e,l,n,i,o;return{c(){e=m("label"),l=m("input"),n=M(" SSL"),r(l,"type","checkbox"),r(l,"name","qs"),l.__value="true",l.value=l.__value,r(l,"class","rounded mb-1"),r(e,"class","float-right mr-3")},m(a,c){q(a,e,c),s(e,l),l.checked=t[5].q.s.e,s(e,n),i||(o=[ve(l,"change",t[63]),ve(l,"change",t[17])],i=!0)},p(a,c){c[0]&32&&(l.checked=a[5].q.s.e)},d(a){a&&A(e),i=!1,zt(o)}}}function da(t){let e,l,n,i,o,a,c,_,u,f,p,v,d;const h=[V0,G0],g=[];function k(S,j){return S[5].q.s.c?0:1}n=k(t),i=g[n]=h[n](t);const T=[X0,Q0],O=[];function E(S,j){return S[5].q.s.r?0:1}c=E(t),_=O[c]=T[c](t);const I=[x0,$0],N=[];function B(S,j){return S[5].q.s.k?0:1}return p=B(t),v=N[p]=I[p](t),{c(){e=m("div"),l=m("span"),i.c(),o=b(),a=m("span"),_.c(),u=b(),f=m("span"),v.c(),r(l,"class","flex pr-2"),r(a,"class","flex pr-2"),r(f,"class","flex pr-2"),r(e,"class","my-1 flex")},m(S,j){q(S,e,j),s(e,l),g[n].m(l,null),s(e,o),s(e,a),O[c].m(a,null),s(e,u),s(e,f),N[p].m(f,null),d=!0},p(S,j){let z=n;n=k(S),n===z?g[n].p(S,j):(gt(),fe(g[z],1,1,()=>{g[z]=null}),kt(),i=g[n],i?i.p(S,j):(i=g[n]=h[n](S),i.c()),$(i,1),i.m(l,null));let V=c;c=E(S),c===V?O[c].p(S,j):(gt(),fe(O[V],1,1,()=>{O[V]=null}),kt(),_=O[c],_?_.p(S,j):(_=O[c]=T[c](S),_.c()),$(_,1),_.m(a,null));let F=p;p=B(S),p===F?N[p].p(S,j):(gt(),fe(N[F],1,1,()=>{N[F]=null}),kt(),v=N[p],v?v.p(S,j):(v=N[p]=I[p](S),v.c()),$(v,1),v.m(f,null))},i(S){d||($(i),$(_),$(v),d=!0)},o(S){fe(i),fe(_),fe(v),d=!1},d(S){S&&A(e),g[n].d(),O[c].d(),N[p].d()}}}function G0(t){let e,l;return e=new Ml({props:{to:"/mqtt-ca",$$slots:{default:[K0]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[3]&1073741824&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function V0(t){let e,l,n,i,o,a,c;return l=new Ml({props:{to:"/mqtt-ca",$$slots:{default:[Y0]},$$scope:{ctx:t}}}),{c(){e=m("span"),Re(l.$$.fragment),n=b(),i=m("span"),i.textContent="\u{1F5D1}",r(e,"class","bd-on"),r(i,"class","bd-off")},m(_,u){q(_,e,u),De(l,e,null),q(_,n,u),q(_,i,u),o=!0,a||(c=[ve(i,"click",t[14]),ve(i,"keypress",t[14])],a=!0)},p(_,u){const f={};u[0]&4|u[3]&1073741824&&(f.$$scope={dirty:u,ctx:_}),l.$set(f)},i(_){o||($(l.$$.fragment,_),o=!0)},o(_){fe(l.$$.fragment,_),o=!1},d(_){_&&A(e),Le(l),_&&A(n),_&&A(i),a=!1,zt(c)}}}function K0(t){var n,i,o,a,c,_;let e,l;return e=new $l({props:{color:"blue",text:(o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_ca_upload)!=null?o:"Upload CA",title:(_=(c=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:c.title_ca)!=null?_:""}}),{c(){Re(e.$$.fragment)},m(u,f){De(e,u,f),l=!0},p(u,f){var v,d,h,g,k,T;const p={};f[0]&4&&(p.text=(h=(d=(v=u[2].conf)==null?void 0:v.mqtt)==null?void 0:d.btn_ca_upload)!=null?h:"Upload CA"),f[0]&4&&(p.title=(T=(k=(g=u[2].conf)==null?void 0:g.mqtt)==null?void 0:k.title_ca)!=null?T:""),e.$set(p)},i(u){l||($(e.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),l=!1},d(u){Le(e,u)}}}function Y0(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.ca_ok)!=null?o:"CA OK")+"",l;return{c(){l=M(e)},m(a,c){q(a,l,c)},p(a,c){var _,u,f;c[0]&4&&e!==(e=((f=(u=(_=a[2].conf)==null?void 0:_.mqtt)==null?void 0:u.ca_ok)!=null?f:"CA OK")+"")&&D(l,e)},d(a){a&&A(l)}}}function Q0(t){let e,l;return e=new Ml({props:{to:"/mqtt-cert",$$slots:{default:[Z0]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[3]&1073741824&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function X0(t){let e,l,n,i,o,a,c;return l=new Ml({props:{to:"/mqtt-cert",$$slots:{default:[J0]},$$scope:{ctx:t}}}),{c(){e=m("span"),Re(l.$$.fragment),n=b(),i=m("span"),i.textContent="\u{1F5D1}",r(e,"class","bd-on"),r(i,"class","bd-off")},m(_,u){q(_,e,u),De(l,e,null),q(_,n,u),q(_,i,u),o=!0,a||(c=[ve(i,"click",t[15]),ve(i,"keypress",t[15])],a=!0)},p(_,u){const f={};u[0]&4|u[3]&1073741824&&(f.$$scope={dirty:u,ctx:_}),l.$set(f)},i(_){o||($(l.$$.fragment,_),o=!0)},o(_){fe(l.$$.fragment,_),o=!1},d(_){_&&A(e),Le(l),_&&A(n),_&&A(i),a=!1,zt(c)}}}function Z0(t){var n,i,o,a,c,_;let e,l;return e=new $l({props:{color:"blue",text:(o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_crt_upload)!=null?o:"Upload cert",title:(_=(c=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:c.title_crt)!=null?_:""}}),{c(){Re(e.$$.fragment)},m(u,f){De(e,u,f),l=!0},p(u,f){var v,d,h,g,k,T;const p={};f[0]&4&&(p.text=(h=(d=(v=u[2].conf)==null?void 0:v.mqtt)==null?void 0:d.btn_crt_upload)!=null?h:"Upload cert"),f[0]&4&&(p.title=(T=(k=(g=u[2].conf)==null?void 0:g.mqtt)==null?void 0:k.title_crt)!=null?T:""),e.$set(p)},i(u){l||($(e.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),l=!1},d(u){Le(e,u)}}}function J0(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.crt_ok)!=null?o:"Cert OK")+"",l;return{c(){l=M(e)},m(a,c){q(a,l,c)},p(a,c){var _,u,f;c[0]&4&&e!==(e=((f=(u=(_=a[2].conf)==null?void 0:_.mqtt)==null?void 0:u.crt_ok)!=null?f:"Cert OK")+"")&&D(l,e)},d(a){a&&A(l)}}}function $0(t){let e,l;return e=new Ml({props:{to:"/mqtt-key",$$slots:{default:[ec]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[3]&1073741824&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function x0(t){let e,l,n,i,o,a,c;return l=new Ml({props:{to:"/mqtt-key",$$slots:{default:[tc]},$$scope:{ctx:t}}}),{c(){e=m("span"),Re(l.$$.fragment),n=b(),i=m("span"),i.textContent="\u{1F5D1}",r(e,"class","bd-on"),r(i,"class","bd-off")},m(_,u){q(_,e,u),De(l,e,null),q(_,n,u),q(_,i,u),o=!0,a||(c=[ve(i,"click",t[16]),ve(i,"keypress",t[16])],a=!0)},p(_,u){const f={};u[0]&4|u[3]&1073741824&&(f.$$scope={dirty:u,ctx:_}),l.$set(f)},i(_){o||($(l.$$.fragment,_),o=!0)},o(_){fe(l.$$.fragment,_),o=!1},d(_){_&&A(e),Le(l),_&&A(n),_&&A(i),a=!1,zt(c)}}}function ec(t){var n,i,o,a,c,_;let e,l;return e=new $l({props:{color:"blue",text:(o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_key_upload)!=null?o:"Upload key",title:(_=(c=(a=t[2].conf)==null?void 0:a.mqtt)==null?void 0:c.title_key)!=null?_:""}}),{c(){Re(e.$$.fragment)},m(u,f){De(e,u,f),l=!0},p(u,f){var v,d,h,g,k,T;const p={};f[0]&4&&(p.text=(h=(d=(v=u[2].conf)==null?void 0:v.mqtt)==null?void 0:d.btn_key_upload)!=null?h:"Upload key"),f[0]&4&&(p.title=(T=(k=(g=u[2].conf)==null?void 0:g.mqtt)==null?void 0:k.title_key)!=null?T:""),e.$set(p)},i(u){l||($(e.$$.fragment,u),l=!0)},o(u){fe(e.$$.fragment,u),l=!1},d(u){Le(e,u)}}}function tc(t){var n,i,o;let e=((o=(i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.key_ok)!=null?o:"Key OK")+"",l;return{c(){l=M(e)},m(a,c){q(a,l,c)},p(a,c){var _,u,f;c[0]&4&&e!==(e=((f=(u=(_=a[2].conf)==null?void 0:_.mqtt)==null?void 0:u.key_ok)!=null?f:"Key OK")+"")&&D(l,e)},d(a){a&&A(l)}}}function va(t){var X,oe,ne,ie,re,me,Y,x,ke,pe,C,w,P,L,y,ee;let e,l,n=((ie=(ne=(oe=(X=t[2].conf)==null?void 0:X.mqtt)==null?void 0:oe.domoticz)==null?void 0:ne.title)!=null?ie:"Domoticz")+"",i,o,a,c,_,u,f,p,v,d=((x=(Y=(me=(re=t[2].conf)==null?void 0:re.mqtt)==null?void 0:me.domoticz)==null?void 0:Y.eidx)!=null?x:"Electricity IDX")+"",h,g,k,T,O,E,I=((w=(C=(pe=(ke=t[2].conf)==null?void 0:ke.mqtt)==null?void 0:pe.domoticz)==null?void 0:C.cidx)!=null?w:"Current IDX")+"",N,B,S,j,z,V,F=((ee=(y=(L=(P=t[2].conf)==null?void 0:P.mqtt)==null?void 0:L.domoticz)==null?void 0:y.vidx)!=null?ee:"Voltage IDX")+"",R,G,U,H,W,K,Q,J,ae,Z;return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),v=m("div"),h=M(d),g=m("br"),k=b(),T=m("input"),O=b(),E=m("div"),N=M(I),B=m("br"),S=b(),j=m("input"),z=b(),V=m("div"),R=M(F),G=M(`: L1, L2 & L3 - `),U=m("div"),H=m("input"),W=b(),K=m("input"),Q=b(),J=m("input"),r(l,"class","text-sm"),r(a,"href",kl("MQTT-configuration#domoticz")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","o"),u.value="true",r(T,"name","oe"),r(T,"type","text"),r(T,"class","in-f tr w-full"),r(v,"class","w-1/2"),r(j,"name","oc"),r(j,"type","text"),r(j,"class","in-l tr w-full"),r(E,"class","w-1/2"),r(p,"class","my-1 flex"),r(H,"name","ou1"),r(H,"type","text"),r(H,"class","in-f tr w-1/3"),r(K,"name","ou2"),r(K,"type","text"),r(K,"class","in-m tr w-1/3"),r(J,"name","ou3"),r(J,"type","text"),r(J,"class","in-l tr w-1/3"),r(U,"class","flex"),r(V,"class","my-1"),r(e,"class","cnt")},m(le,se){q(le,e,se),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,v),s(v,h),s(v,g),s(v,k),s(v,T),Ee(T,t[5].o.e),s(p,O),s(p,E),s(E,N),s(E,B),s(E,S),s(E,j),Ee(j,t[5].o.c),s(e,z),s(e,V),s(V,R),s(V,G),s(V,U),s(U,H),Ee(H,t[5].o.u1),s(U,W),s(U,K),Ee(K,t[5].o.u2),s(U,Q),s(U,J),Ee(J,t[5].o.u3),ae||(Z=[ve(T,"input",t[71]),ve(j,"input",t[72]),ve(H,"input",t[73]),ve(K,"input",t[74]),ve(J,"input",t[75])],ae=!0)},p(le,se){var _e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He;se[0]&4&&n!==(n=((de=(Se=(Te=(_e=le[2].conf)==null?void 0:_e.mqtt)==null?void 0:Te.domoticz)==null?void 0:Se.title)!=null?de:"Domoticz")+"")&&D(i,n),se[0]&4&&d!==(d=((he=(ge=(we=(Ne=le[2].conf)==null?void 0:Ne.mqtt)==null?void 0:we.domoticz)==null?void 0:ge.eidx)!=null?he:"Electricity IDX")+"")&&D(h,d),se[0]&32&&T.value!==le[5].o.e&&Ee(T,le[5].o.e),se[0]&4&&I!==(I=((Ze=(We=(Ue=(je=le[2].conf)==null?void 0:je.mqtt)==null?void 0:Ue.domoticz)==null?void 0:We.cidx)!=null?Ze:"Current IDX")+"")&&D(N,I),se[0]&32&&j.value!==le[5].o.c&&Ee(j,le[5].o.c),se[0]&4&&F!==(F=((He=(et=(Ye=(Je=le[2].conf)==null?void 0:Je.mqtt)==null?void 0:Ye.domoticz)==null?void 0:et.vidx)!=null?He:"Voltage IDX")+"")&&D(R,F),se[0]&32&&H.value!==le[5].o.u1&&Ee(H,le[5].o.u1),se[0]&32&&K.value!==le[5].o.u2&&Ee(K,le[5].o.u2),se[0]&32&&J.value!==le[5].o.u3&&Ee(J,le[5].o.u3)},d(le){le&&A(e),ae=!1,zt(Z)}}}function ha(t){var Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke,pe,C,w;let e,l,n=((Z=(ae=(J=(Q=t[2].conf)==null?void 0:Q.mqtt)==null?void 0:J.ha)==null?void 0:ae.title)!=null?Z:"Home-Assistant")+"",i,o,a,c,_,u,f,p,v=((ie=(ne=(oe=(X=t[2].conf)==null?void 0:X.mqtt)==null?void 0:oe.ha)==null?void 0:ne.discovery)!=null?ie:"Discovery topic prefix")+"",d,h,g,k,T,O,E=((x=(Y=(me=(re=t[2].conf)==null?void 0:re.mqtt)==null?void 0:me.ha)==null?void 0:Y.hostname)!=null?x:"Hostname for URL")+"",I,N,B,S,j,z,V,F=((w=(C=(pe=(ke=t[2].conf)==null?void 0:ke.mqtt)==null?void 0:pe.ha)==null?void 0:C.tag)!=null?w:"Name tag")+"",R,G,U,H,W,K;return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),d=M(v),h=m("br"),g=b(),k=m("input"),T=b(),O=m("div"),I=M(E),N=m("br"),B=b(),S=m("input"),z=b(),V=m("div"),R=M(F),G=m("br"),U=b(),H=m("input"),r(l,"class","text-sm"),r(a,"href",kl("MQTT-configuration#home-assistant")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","h"),u.value="true",r(k,"name","ht"),r(k,"type","text"),r(k,"class","in-s"),r(k,"placeholder","homeassistant"),r(p,"class","my-1"),r(S,"name","hh"),r(S,"type","text"),r(S,"class","in-s"),r(S,"placeholder",j=t[5].g.h+".local"),r(O,"class","my-1"),r(H,"name","hn"),r(H,"type","text"),r(H,"class","in-s"),r(V,"class","my-1"),r(e,"class","cnt")},m(P,L){q(P,e,L),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,d),s(p,h),s(p,g),s(p,k),Ee(k,t[5].h.t),s(e,T),s(e,O),s(O,I),s(O,N),s(O,B),s(O,S),Ee(S,t[5].h.h),s(e,z),s(e,V),s(V,R),s(V,G),s(V,U),s(V,H),Ee(H,t[5].h.n),W||(K=[ve(k,"input",t[76]),ve(S,"input",t[77]),ve(H,"input",t[78])],W=!0)},p(P,L){var y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze;L[0]&4&&n!==(n=((se=(le=(ee=(y=P[2].conf)==null?void 0:y.mqtt)==null?void 0:ee.ha)==null?void 0:le.title)!=null?se:"Home-Assistant")+"")&&D(i,n),L[0]&4&&v!==(v=((de=(Se=(Te=(_e=P[2].conf)==null?void 0:_e.mqtt)==null?void 0:Te.ha)==null?void 0:Se.discovery)!=null?de:"Discovery topic prefix")+"")&&D(d,v),L[0]&32&&k.value!==P[5].h.t&&Ee(k,P[5].h.t),L[0]&4&&E!==(E=((he=(ge=(we=(Ne=P[2].conf)==null?void 0:Ne.mqtt)==null?void 0:we.ha)==null?void 0:ge.hostname)!=null?he:"Hostname for URL")+"")&&D(I,E),L[0]&32&&j!==(j=P[5].g.h+".local")&&r(S,"placeholder",j),L[0]&32&&S.value!==P[5].h.h&&Ee(S,P[5].h.h),L[0]&4&&F!==(F=((Ze=(We=(Ue=(je=P[2].conf)==null?void 0:je.mqtt)==null?void 0:Ue.ha)==null?void 0:We.tag)!=null?Ze:"Name tag")+"")&&D(R,F),L[0]&32&&H.value!==P[5].h.n&&Ee(H,P[5].h.n)},d(P){P&&A(e),W=!1,zt(K)}}}function ba(t){var G,U,H,W,K,Q,J,ae,Z;let e,l,n=((H=(U=(G=t[2].conf)==null?void 0:G.cloud)==null?void 0:U.title)!=null?H:"Cloud connections")+"",i,o,a,c,_,u,f,p,v,d,h,g=((Q=(K=(W=t[2].conf)==null?void 0:W.cloud)==null?void 0:K.ams)!=null?Q:"AMS reader cloud")+"",k,T,O,E,I,N,B=((Z=(ae=(J=t[2].conf)==null?void 0:J.cloud)==null?void 0:ae.es)!=null?Z:"Energy Speedometer")+"",S,j,z,V,F,R=t[5].c.es&&ga(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),v=m("label"),d=m("input"),h=b(),k=M(g),T=b(),O=m("div"),E=m("label"),I=m("input"),N=b(),S=M(B),j=b(),R&&R.c(),r(l,"class","text-sm"),r(a,"href",kl("Cloud")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","c"),u.value="true",r(d,"type","checkbox"),r(d,"name","ce"),d.__value="true",d.value=d.__value,r(d,"class","rounded mb-1"),r(p,"class","my-1"),r(I,"type","checkbox"),r(I,"class","rounded mb-1"),r(I,"name","ces"),I.__value="true",I.value=I.__value,r(O,"class","my-1"),r(e,"class","cnt")},m(X,oe){q(X,e,oe),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,v),s(v,d),d.checked=t[5].c.e,s(v,h),s(v,k),s(e,T),s(e,O),s(O,E),s(E,I),I.checked=t[5].c.es,s(E,N),s(E,S),s(O,j),R&&R.m(O,null),z=!0,V||(F=[ve(d,"change",t[79]),ve(I,"change",t[80])],V=!0)},p(X,oe){var ne,ie,re,me,Y,x,ke,pe,C;(!z||oe[0]&4)&&n!==(n=((re=(ie=(ne=X[2].conf)==null?void 0:ne.cloud)==null?void 0:ie.title)!=null?re:"Cloud connections")+"")&&D(i,n),oe[0]&32&&(d.checked=X[5].c.e),(!z||oe[0]&4)&&g!==(g=((x=(Y=(me=X[2].conf)==null?void 0:me.cloud)==null?void 0:Y.ams)!=null?x:"AMS reader cloud")+"")&&D(k,g),oe[0]&32&&(I.checked=X[5].c.es),(!z||oe[0]&4)&&B!==(B=((C=(pe=(ke=X[2].conf)==null?void 0:ke.cloud)==null?void 0:pe.es)!=null?C:"Energy Speedometer")+"")&&D(S,B),X[5].c.es?R?(R.p(X,oe),oe[0]&32&&$(R,1)):(R=ga(X),R.c(),$(R,1),R.m(O,null)):R&&(gt(),fe(R,1,1,()=>{R=null}),kt())},i(X){z||($(R),z=!0)},o(X){fe(R),z=!1},d(X){X&&A(e),R&&R.d(),V=!1,zt(F)}}}function ga(t){let e,l,n=t[0].mac+"",i,o,a,c,_=(t[0].meter.id?t[0].meter.id:"missing, required")+"",u,f,p,v,d=t[0].mac&&t[0].meter.id&&ka(t);return{c(){e=m("div"),l=M("MAC: "),i=M(n),o=b(),a=m("div"),c=M("Meter ID: "),u=M(_),f=b(),d&&d.c(),p=Qt(),r(e,"class","pl-5"),r(a,"class","pl-5")},m(h,g){q(h,e,g),s(e,l),s(e,i),q(h,o,g),q(h,a,g),s(a,c),s(a,u),q(h,f,g),d&&d.m(h,g),q(h,p,g),v=!0},p(h,g){(!v||g[0]&1)&&n!==(n=h[0].mac+"")&&D(i,n),(!v||g[0]&1)&&_!==(_=(h[0].meter.id?h[0].meter.id:"missing, required")+"")&&D(u,_),h[0].mac&&h[0].meter.id?d?(d.p(h,g),g[0]&1&&$(d,1)):(d=ka(h),d.c(),$(d,1),d.m(p.parentNode,p)):d&&(gt(),fe(d,1,1,()=>{d=null}),kt())},i(h){v||($(d),v=!0)},o(h){fe(d),v=!1},d(h){h&&A(e),h&&A(o),h&&A(a),h&&A(f),d&&d.d(h),h&&A(p)}}}function ka(t){let e,l,n;return l=new F0({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","pl-2")},m(i,o){q(i,e,o),De(l,e,null),n=!0},p(i,o){const a={};o[0]&1&&(a.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(a)},i(i){n||($(l.$$.fragment,i),n=!0)},o(i){fe(l.$$.fragment,i),n=!1},d(i){i&&A(e),Le(l)}}}function wa(t){var F,R,G,U,H,W,K,Q;let e,l,n=((G=(R=(F=t[2].conf)==null?void 0:F.thresholds)==null?void 0:R.title)!=null?G:"Thresholds")+"",i,o,a,c,_,u,f,p,v,d,h,g=((W=(H=(U=t[2].conf)==null?void 0:U.thresholds)==null?void 0:H.avg)!=null?W:"Average of")+"",k,T,O,E,I,N=((Q=(K=t[2].common)==null?void 0:K.hours)!=null?Q:"hours")+"",B,S,j,z={length:9},V=[];for(let J=0;Jt[84].call(T)),r(d,"class","w-1/2"),r(p,"class","flex flex-wrap"),r(e,"class","cnt")},m(U,H){q(U,e,H),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p);for(let W=0;W20&&Ea(t),d=((I=(E=(O=t[5])==null?void 0:O.i)==null?void 0:E.d)==null?void 0:I.d)>0&&qa(t),h=t[0].chip=="esp8266"&&Da(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),v&&v.c(),u=b(),d&&d.c(),f=b(),h&&h.c(),r(l,"class","text-sm"),r(a,"href",kl("GPIO-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),r(e,"class","cnt")},m(N,B){q(N,e,B),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),v&&v.m(e,null),s(e,u),d&&d.m(e,null),s(e,f),h&&h.m(e,null),p=!0},p(N,B){var S,j,z,V,F,R;(!p||B[0]&4)&&n!==(n=((z=(j=(S=N[2].conf)==null?void 0:S.hw)==null?void 0:j.title)!=null?z:"Hardware")+"")&&D(i,n),N[0].board>20?v?(v.p(N,B),B[0]&1&&$(v,1)):(v=Ea(N),v.c(),$(v,1),v.m(e,u)):v&&(gt(),fe(v,1,1,()=>{v=null}),kt()),((R=(F=(V=N[5])==null?void 0:V.i)==null?void 0:F.d)==null?void 0:R.d)>0?d?d.p(N,B):(d=qa(N),d.c(),d.m(e,f)):d&&(d.d(1),d=null),N[0].chip=="esp8266"?h?h.p(N,B):(h=Da(N),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(N){p||($(v),p=!0)},o(N){fe(v),p=!1},d(N){N&&A(e),v&&v.d(),d&&d.d(),h&&h.d()}}}function Ea(t){var Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt,ue,Me,Ae,it,rt,At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl,hl,bl,gl,Fe,ct;let e,l,n,i,o=((Pt=(St=(Ot=(Et=t[2].conf)==null?void 0:Et.hw)==null?void 0:Ot.han)==null?void 0:St.rx)!=null?Pt:"HAN RX")+"",a,c,_,u,f,p,v,d=((ht=(Ct=(yt=(It=t[2].conf)==null?void 0:It.hw)==null?void 0:yt.han)==null?void 0:Ct.tx)!=null?ht:"HAN TX")+"",h,g,k,T,O,E,I,N,B,S,j=((Ve=(Wt=(Ut=(Lt=t[2].conf)==null?void 0:Lt.hw)==null?void 0:Ut.han)==null?void 0:Wt.pullup)!=null?Ve:"pullup")+"",z,V,F,R,G=((nt=(Bt=(Ke=t[2].conf)==null?void 0:Ke.hw)==null?void 0:Bt.ap_btn)!=null?nt:"AP button")+"",U,H,W,K,Q,J,ae=((Me=(ue=(wt=(bt=t[2].conf)==null?void 0:bt.hw)==null?void 0:wt.led)==null?void 0:ue.title)!=null?Me:"LED")+"",Z,X,oe,ne,ie,re,me,Y,x,ke,pe=((At=(rt=(it=(Ae=t[2].conf)==null?void 0:Ae.hw)==null?void 0:it.led)==null?void 0:rt.inverted)!=null?At:"inverted")+"",C,w,P,L=((tl=(el=(Zt=(Xt=t[2].conf)==null?void 0:Xt.hw)==null?void 0:Zt.led)==null?void 0:el.rgb)!=null?tl:"RGB")+"",y,ee,le,se,_e=((sl=(il=(nl=(ll=t[2].conf)==null?void 0:ll.hw)==null?void 0:nl.led)==null?void 0:il.inverted)!=null?sl:"inverted")+"",Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye=((ul=(fl=(al=(ol=t[2].conf)==null?void 0:ol.hw)==null?void 0:al.led)==null?void 0:fl.disable)!=null?ul:"LED dis. GPIO")+"",et,He,Oe,ce,Pe,$e=((rl=(jt=(Ie=t[2].conf)==null?void 0:Ie.hw)==null?void 0:jt.temp)!=null?rl:"Temperature")+"",Qe,mt,ye,Ge,ze,tt,vt=((bl=(hl=(cl=t[2].conf)==null?void 0:cl.hw)==null?void 0:hl.temp_analog)!=null?bl:"Analog temp")+"",Mt,dt,te,be,Tt,Ce,qe,pt,at;f=new Bi({props:{chip:t[0].chip}}),O=new Bi({props:{chip:t[0].chip}});let ft=t[0].chip!="esp8266"&&Pa(t),ut=((ct=(Fe=(gl=t[5])==null?void 0:gl.i)==null?void 0:Fe.v)==null?void 0:ct.p)>0&&Aa(t);return{c(){e=m("input"),l=b(),n=m("div"),i=m("div"),a=M(o),c=m("br"),_=b(),u=m("select"),Re(f.$$.fragment),p=b(),v=m("div"),h=M(d),g=m("br"),k=b(),T=m("select"),Re(O.$$.fragment),E=b(),I=m("div"),N=m("label"),B=m("input"),S=b(),z=M(j),V=b(),F=m("div"),R=m("div"),U=M(G),H=m("br"),W=b(),K=m("input"),Q=b(),J=m("div"),Z=M(ae),X=m("br"),oe=b(),ne=m("div"),ie=m("input"),re=b(),me=m("div"),Y=m("label"),x=m("input"),ke=b(),C=M(pe),w=b(),P=m("div"),y=M(L),ee=m("label"),le=m("input"),se=b(),Te=M(_e),Se=m("br"),de=b(),Ne=m("div"),we=m("input"),ge=b(),he=m("input"),je=b(),Ue=m("input"),We=b(),Ze=m("div"),Je=m("div"),et=M(Ye),He=b(),Oe=m("input"),ce=b(),Pe=m("div"),Qe=M($e),mt=m("br"),ye=b(),Ge=m("input"),ze=b(),tt=m("div"),Mt=M(vt),dt=m("br"),te=b(),be=m("input"),Tt=b(),ft&&ft.c(),Ce=b(),ut&&ut.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(u,"name","ihp"),r(u,"class","in-f w-full"),t[5].i.h.p===void 0&&Gt(()=>t[85].call(u)),r(i,"class","w-1/3"),r(T,"name","iht"),r(T,"class","in-l w-full"),t[5].i.h.t===void 0&&Gt(()=>t[86].call(T)),r(v,"class","w-1/3"),r(B,"name","ihu"),B.__value="true",B.value=B.__value,r(B,"type","checkbox"),r(B,"class","rounded mb-1"),r(N,"class","ml-2"),r(I,"class","w-1/3"),r(n,"class","flex flex-wrap"),r(K,"name","ia"),r(K,"type","number"),r(K,"min","0"),r(K,"max",t[9]),r(K,"class","in-f tr w-full"),r(R,"class","w-1/3"),r(ie,"name","ilp"),r(ie,"type","number"),r(ie,"min","0"),r(ie,"max",t[9]),r(ie,"class","in-l tr w-full"),r(ne,"class","flex"),r(J,"class","w-1/3"),r(x,"name","ili"),x.__value="true",x.value=x.__value,r(x,"type","checkbox"),r(x,"class","rounded mb-1"),r(Y,"class","ml-4"),r(me,"class","w-1/3"),r(le,"name","iri"),le.__value="true",le.value=le.__value,r(le,"type","checkbox"),r(le,"class","rounded mb-1"),r(ee,"class","ml-4"),r(we,"name","irr"),r(we,"type","number"),r(we,"min","0"),r(we,"max",t[9]),r(we,"class","in-f tr w-1/3"),r(he,"name","irg"),r(he,"type","number"),r(he,"min","0"),r(he,"max",t[9]),r(he,"class","in-m tr w-1/3"),r(Ue,"name","irb"),r(Ue,"type","number"),r(Ue,"min","0"),r(Ue,"max",t[9]),r(Ue,"class","in-l tr w-1/3"),r(Ne,"class","flex"),r(P,"class","w-full"),r(Oe,"name","idd"),r(Oe,"type","number"),r(Oe,"min","0"),r(Oe,"max",t[9]),r(Oe,"class","in-s tr"),r(Je,"class","my-1 pr-1 w-1/3"),r(Ze,"class","w-full"),r(Ge,"name","itd"),r(Ge,"type","number"),r(Ge,"min","0"),r(Ge,"max",t[9]),r(Ge,"class","in-f tr w-full"),r(Pe,"class","my-1 w-1/3"),r(be,"name","ita"),r(be,"type","number"),r(be,"min","0"),r(be,"max",t[9]),r(be,"class","in-l tr w-full"),r(tt,"class","my-1 pr-1 w-1/3"),r(F,"class","flex flex-wrap")},m(Be,_t){q(Be,e,_t),q(Be,l,_t),q(Be,n,_t),s(n,i),s(i,a),s(i,c),s(i,_),s(i,u),De(f,u,null),ot(u,t[5].i.h.p,!0),s(n,p),s(n,v),s(v,h),s(v,g),s(v,k),s(v,T),De(O,T,null),ot(T,t[5].i.h.t,!0),s(n,E),s(n,I),s(I,N),s(N,B),B.checked=t[5].i.h.u,s(N,S),s(N,z),q(Be,V,_t),q(Be,F,_t),s(F,R),s(R,U),s(R,H),s(R,W),s(R,K),Ee(K,t[5].i.a),s(F,Q),s(F,J),s(J,Z),s(J,X),s(J,oe),s(J,ne),s(ne,ie),Ee(ie,t[5].i.l.p),s(F,re),s(F,me),s(me,Y),s(Y,x),x.checked=t[5].i.l.i,s(Y,ke),s(Y,C),s(F,w),s(F,P),s(P,y),s(P,ee),s(ee,le),le.checked=t[5].i.r.i,s(ee,se),s(ee,Te),s(P,Se),s(P,de),s(P,Ne),s(Ne,we),Ee(we,t[5].i.r.r),s(Ne,ge),s(Ne,he),Ee(he,t[5].i.r.g),s(Ne,je),s(Ne,Ue),Ee(Ue,t[5].i.r.b),s(F,We),s(F,Ze),s(Ze,Je),s(Je,et),s(Je,He),s(Je,Oe),Ee(Oe,t[5].i.d.d),s(F,ce),s(F,Pe),s(Pe,Qe),s(Pe,mt),s(Pe,ye),s(Pe,Ge),Ee(Ge,t[5].i.t.d),s(F,ze),s(F,tt),s(tt,Mt),s(tt,dt),s(tt,te),s(tt,be),Ee(be,t[5].i.t.a),s(F,Tt),ft&&ft.m(F,null),s(F,Ce),ut&&ut.m(F,null),qe=!0,pt||(at=[ve(u,"change",t[85]),ve(T,"change",t[86]),ve(B,"change",t[87]),ve(K,"input",t[88]),ve(ie,"input",t[89]),ve(x,"change",t[90]),ve(le,"change",t[91]),ve(we,"input",t[92]),ve(he,"input",t[93]),ve(Ue,"input",t[94]),ve(Oe,"input",t[95]),ve(Ge,"input",t[96]),ve(be,"input",t[97])],pt=!0)},p(Be,_t){var Nl,Tl,Rl,Fl,Ul,Bl,jl,Hl,yl,zl,Wl,lt,Ht,_l,wl,Gl,mn,pn,dn,vn,hn,bn,gn,kn,wn,Mn,Sn,Cn,Nn,Tn,En,Pn,An,qn,Dn,Ln,On,In,Rn,Fn,Un,Bn,jn,Hn;(!qe||_t[0]&4)&&o!==(o=((Fl=(Rl=(Tl=(Nl=Be[2].conf)==null?void 0:Nl.hw)==null?void 0:Tl.han)==null?void 0:Rl.rx)!=null?Fl:"HAN RX")+"")&&D(a,o);const Sl={};_t[0]&1&&(Sl.chip=Be[0].chip),f.$set(Sl),_t[0]&32&&ot(u,Be[5].i.h.p),(!qe||_t[0]&4)&&d!==(d=((Hl=(jl=(Bl=(Ul=Be[2].conf)==null?void 0:Ul.hw)==null?void 0:Bl.han)==null?void 0:jl.tx)!=null?Hl:"HAN TX")+"")&&D(h,d);const Cl={};_t[0]&1&&(Cl.chip=Be[0].chip),O.$set(Cl),_t[0]&32&&ot(T,Be[5].i.h.t),_t[0]&32&&(B.checked=Be[5].i.h.u),(!qe||_t[0]&4)&&j!==(j=((lt=(Wl=(zl=(yl=Be[2].conf)==null?void 0:yl.hw)==null?void 0:zl.han)==null?void 0:Wl.pullup)!=null?lt:"pullup")+"")&&D(z,j),(!qe||_t[0]&4)&&G!==(G=((wl=(_l=(Ht=Be[2].conf)==null?void 0:Ht.hw)==null?void 0:_l.ap_btn)!=null?wl:"AP button")+"")&&D(U,G),(!qe||_t[0]&512)&&r(K,"max",Be[9]),_t[0]&32&&st(K.value)!==Be[5].i.a&&Ee(K,Be[5].i.a),(!qe||_t[0]&4)&&ae!==(ae=((dn=(pn=(mn=(Gl=Be[2].conf)==null?void 0:Gl.hw)==null?void 0:mn.led)==null?void 0:pn.title)!=null?dn:"LED")+"")&&D(Z,ae),(!qe||_t[0]&512)&&r(ie,"max",Be[9]),_t[0]&32&&st(ie.value)!==Be[5].i.l.p&&Ee(ie,Be[5].i.l.p),_t[0]&32&&(x.checked=Be[5].i.l.i),(!qe||_t[0]&4)&&pe!==(pe=((gn=(bn=(hn=(vn=Be[2].conf)==null?void 0:vn.hw)==null?void 0:hn.led)==null?void 0:bn.inverted)!=null?gn:"inverted")+"")&&D(C,pe),(!qe||_t[0]&4)&&L!==(L=((Sn=(Mn=(wn=(kn=Be[2].conf)==null?void 0:kn.hw)==null?void 0:wn.led)==null?void 0:Mn.rgb)!=null?Sn:"RGB")+"")&&D(y,L),_t[0]&32&&(le.checked=Be[5].i.r.i),(!qe||_t[0]&4)&&_e!==(_e=((En=(Tn=(Nn=(Cn=Be[2].conf)==null?void 0:Cn.hw)==null?void 0:Nn.led)==null?void 0:Tn.inverted)!=null?En:"inverted")+"")&&D(Te,_e),(!qe||_t[0]&512)&&r(we,"max",Be[9]),_t[0]&32&&st(we.value)!==Be[5].i.r.r&&Ee(we,Be[5].i.r.r),(!qe||_t[0]&512)&&r(he,"max",Be[9]),_t[0]&32&&st(he.value)!==Be[5].i.r.g&&Ee(he,Be[5].i.r.g),(!qe||_t[0]&512)&&r(Ue,"max",Be[9]),_t[0]&32&&st(Ue.value)!==Be[5].i.r.b&&Ee(Ue,Be[5].i.r.b),(!qe||_t[0]&4)&&Ye!==(Ye=((Dn=(qn=(An=(Pn=Be[2].conf)==null?void 0:Pn.hw)==null?void 0:An.led)==null?void 0:qn.disable)!=null?Dn:"LED dis. GPIO")+"")&&D(et,Ye),(!qe||_t[0]&512)&&r(Oe,"max",Be[9]),_t[0]&32&&st(Oe.value)!==Be[5].i.d.d&&Ee(Oe,Be[5].i.d.d),(!qe||_t[0]&4)&&$e!==($e=((In=(On=(Ln=Be[2].conf)==null?void 0:Ln.hw)==null?void 0:On.temp)!=null?In:"Temperature")+"")&&D(Qe,$e),(!qe||_t[0]&512)&&r(Ge,"max",Be[9]),_t[0]&32&&st(Ge.value)!==Be[5].i.t.d&&Ee(Ge,Be[5].i.t.d),(!qe||_t[0]&4)&&vt!==(vt=((Un=(Fn=(Rn=Be[2].conf)==null?void 0:Rn.hw)==null?void 0:Fn.temp_analog)!=null?Un:"Analog temp")+"")&&D(Mt,vt),(!qe||_t[0]&512)&&r(be,"max",Be[9]),_t[0]&32&&st(be.value)!==Be[5].i.t.a&&Ee(be,Be[5].i.t.a),Be[0].chip!="esp8266"?ft?ft.p(Be,_t):(ft=Pa(Be),ft.c(),ft.m(F,Ce)):ft&&(ft.d(1),ft=null),((Hn=(jn=(Bn=Be[5])==null?void 0:Bn.i)==null?void 0:jn.v)==null?void 0:Hn.p)>0?ut?ut.p(Be,_t):(ut=Aa(Be),ut.c(),ut.m(F,null)):ut&&(ut.d(1),ut=null)},i(Be){qe||($(f.$$.fragment,Be),$(O.$$.fragment,Be),qe=!0)},o(Be){fe(f.$$.fragment,Be),fe(O.$$.fragment,Be),qe=!1},d(Be){Be&&A(e),Be&&A(l),Be&&A(n),Le(f),Le(O),Be&&A(V),Be&&A(F),ft&&ft.d(),ut&&ut.d(),pt=!1,zt(at)}}}function Pa(t){var u,f,p,v;let e,l=((v=(p=(f=(u=t[2].conf)==null?void 0:u.hw)==null?void 0:f.vcc)==null?void 0:p.title)!=null?v:"Vcc")+"",n,i,o,a,c,_;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),r(a,"name","ivp"),r(a,"type","number"),r(a,"min","0"),r(a,"max",t[9]),r(a,"class","in-s tr w-full"),r(e,"class","my-1 pl-1 w-1/3")},m(d,h){q(d,e,h),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].i.v.p),c||(_=ve(a,"input",t[98]),c=!0)},p(d,h){var g,k,T,O;h[0]&4&&l!==(l=((O=(T=(k=(g=d[2].conf)==null?void 0:g.hw)==null?void 0:k.vcc)==null?void 0:T.title)!=null?O:"Vcc")+"")&&D(n,l),h[0]&512&&r(a,"max",d[9]),h[0]&32&&st(a.value)!==d[5].i.v.p&&Ee(a,d[5].i.v.p)},d(d){d&&A(e),c=!1,_()}}}function Aa(t){var h,g,k,T;let e,l=((T=(k=(g=(h=t[2].conf)==null?void 0:h.hw)==null?void 0:g.vcc)==null?void 0:k.divider)!=null?T:"Voltage divider")+"",n,i,o,a,c,_,u,f,p,v,d;return{c(){var O,E,I,N,B,S,j,z;e=m("div"),n=M(l),i=m("br"),o=b(),a=m("div"),c=m("input"),u=b(),f=m("input"),r(c,"name","ivdv"),r(c,"type","number"),r(c,"min","0"),r(c,"max","65535"),r(c,"class","in-f tr w-full"),r(c,"placeholder",_=(N=(I=(E=(O=t[2].conf)==null?void 0:O.hw)==null?void 0:E.vcc)==null?void 0:I.div_vcc)!=null?N:"VCC"),r(f,"name","ivdg"),r(f,"type","number"),r(f,"min","0"),r(f,"max","65535"),r(f,"class","in-l tr w-full"),r(f,"placeholder",p=(z=(j=(S=(B=t[2].conf)==null?void 0:B.hw)==null?void 0:S.vcc)==null?void 0:j.div_gnd)!=null?z:"GND"),r(a,"class","flex"),r(e,"class","my-1")},m(O,E){q(O,e,E),s(e,n),s(e,i),s(e,o),s(e,a),s(a,c),Ee(c,t[5].i.v.d.v),s(a,u),s(a,f),Ee(f,t[5].i.v.d.g),v||(d=[ve(c,"input",t[99]),ve(f,"input",t[100])],v=!0)},p(O,E){var I,N,B,S,j,z,V,F,R,G,U,H;E[0]&4&&l!==(l=((S=(B=(N=(I=O[2].conf)==null?void 0:I.hw)==null?void 0:N.vcc)==null?void 0:B.divider)!=null?S:"Voltage divider")+"")&&D(n,l),E[0]&4&&_!==(_=(F=(V=(z=(j=O[2].conf)==null?void 0:j.hw)==null?void 0:z.vcc)==null?void 0:V.div_vcc)!=null?F:"VCC")&&r(c,"placeholder",_),E[0]&32&&st(c.value)!==O[5].i.v.d.v&&Ee(c,O[5].i.v.d.v),E[0]&4&&p!==(p=(H=(U=(G=(R=O[2].conf)==null?void 0:R.hw)==null?void 0:G.vcc)==null?void 0:U.div_gnd)!=null?H:"GND")&&r(f,"placeholder",p),E[0]&32&&st(f.value)!==O[5].i.v.d.g&&Ee(f,O[5].i.v.d.g)},d(O){O&&A(e),v=!1,zt(d)}}}function qa(t){var h,g,k,T,O,E,I,N,B,S,j,z,V,F,R;let e,l=((O=(T=(k=(g=(h=t[2].conf)==null?void 0:h.hw)==null?void 0:g.led)==null?void 0:k.behaviour)==null?void 0:T.title)!=null?O:"LED behaviour")+"",n,i,o,a,c=((S=(B=(N=(I=(E=t[2].conf)==null?void 0:E.hw)==null?void 0:I.led)==null?void 0:N.behaviour)==null?void 0:B.enabled)!=null?S:"Enabled")+"",_,u,f=((R=(F=(V=(z=(j=t[2].conf)==null?void 0:j.hw)==null?void 0:z.led)==null?void 0:V.behaviour)==null?void 0:F.disabled)!=null?R:"Disabled")+"",p,v,d;return{c(){e=m("div"),n=M(l),i=b(),o=m("select"),a=m("option"),_=M(c),u=m("option"),p=M(f),a.__value=0,a.value=a.__value,u.__value=1,u.value=u.__value,r(o,"name","idb"),r(o,"class","in-s"),t[5].i.d.b===void 0&&Gt(()=>t[101].call(o)),r(e,"class","my-1 w-full")},m(G,U){q(G,e,U),s(e,n),s(e,i),s(e,o),s(o,a),s(a,_),s(o,u),s(u,p),ot(o,t[5].i.d.b,!0),v||(d=ve(o,"change",t[101]),v=!0)},p(G,U){var H,W,K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x;U[0]&4&&l!==(l=((J=(Q=(K=(W=(H=G[2].conf)==null?void 0:H.hw)==null?void 0:W.led)==null?void 0:K.behaviour)==null?void 0:Q.title)!=null?J:"LED behaviour")+"")&&D(n,l),U[0]&4&&c!==(c=((ne=(oe=(X=(Z=(ae=G[2].conf)==null?void 0:ae.hw)==null?void 0:Z.led)==null?void 0:X.behaviour)==null?void 0:oe.enabled)!=null?ne:"Enabled")+"")&&D(_,c),U[0]&4&&f!==(f=((x=(Y=(me=(re=(ie=G[2].conf)==null?void 0:ie.hw)==null?void 0:re.led)==null?void 0:me.behaviour)==null?void 0:Y.disabled)!=null?x:"Disabled")+"")&&D(p,f),U[0]&32&&ot(o,G[5].i.d.b)},d(G){G&&A(e),v=!1,d()}}}function Da(t){var N,B,S,j,z,V,F,R;let e,l,n,i,o=((j=(S=(B=(N=t[2].conf)==null?void 0:N.hw)==null?void 0:B.vcc)==null?void 0:S.offset)!=null?j:"Vcc offset")+"",a,c,_,u,f,p,v=((R=(F=(V=(z=t[2].conf)==null?void 0:z.hw)==null?void 0:V.vcc)==null?void 0:F.multiplier)!=null?R:"Multiplier")+"",d,h,g,k,T,O,E,I=(t[0].board==2||t[0].board==100)&&La(t);return{c(){e=m("input"),l=b(),n=m("div"),i=m("div"),a=M(o),c=m("br"),_=b(),u=m("input"),f=b(),p=m("div"),d=M(v),h=m("br"),g=b(),k=m("input"),T=b(),I&&I.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(u,"name","ivo"),r(u,"type","number"),r(u,"min","0.0"),r(u,"max","3.5"),r(u,"step","0.01"),r(u,"class","in-f tr w-full"),r(i,"class","w-1/3"),r(k,"name","ivm"),r(k,"type","number"),r(k,"min","0.1"),r(k,"max","10"),r(k,"step","0.01"),r(k,"class","in-l tr w-full"),r(p,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(G,U){q(G,e,U),q(G,l,U),q(G,n,U),s(n,i),s(i,a),s(i,c),s(i,_),s(i,u),Ee(u,t[5].i.v.o),s(n,f),s(n,p),s(p,d),s(p,h),s(p,g),s(p,k),Ee(k,t[5].i.v.m),s(n,T),I&&I.m(n,null),O||(E=[ve(u,"input",t[102]),ve(k,"input",t[103])],O=!0)},p(G,U){var H,W,K,Q,J,ae,Z,X;U[0]&4&&o!==(o=((Q=(K=(W=(H=G[2].conf)==null?void 0:H.hw)==null?void 0:W.vcc)==null?void 0:K.offset)!=null?Q:"Vcc offset")+"")&&D(a,o),U[0]&32&&st(u.value)!==G[5].i.v.o&&Ee(u,G[5].i.v.o),U[0]&4&&v!==(v=((X=(Z=(ae=(J=G[2].conf)==null?void 0:J.hw)==null?void 0:ae.vcc)==null?void 0:Z.multiplier)!=null?X:"Multiplier")+"")&&D(d,v),U[0]&32&&st(k.value)!==G[5].i.v.m&&Ee(k,G[5].i.v.m),G[0].board==2||G[0].board==100?I?I.p(G,U):(I=La(G),I.c(),I.m(n,null)):I&&(I.d(1),I=null)},d(G){G&&A(e),G&&A(l),G&&A(n),I&&I.d(),O=!1,zt(E)}}}function La(t){var u,f,p,v;let e,l=((v=(p=(f=(u=t[2].conf)==null?void 0:u.hw)==null?void 0:f.vcc)==null?void 0:p.boot)!=null?v:"Boot limit")+"",n,i,o,a,c,_;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),r(a,"name","ivb"),r(a,"type","number"),r(a,"min","2.5"),r(a,"max","3.5"),r(a,"step","0.1"),r(a,"class","in-s tr w-full"),r(e,"class","w-1/3 pl-1")},m(d,h){q(d,e,h),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].i.v.b),c||(_=ve(a,"input",t[104]),c=!0)},p(d,h){var g,k,T,O;h[0]&4&&l!==(l=((O=(T=(k=(g=d[2].conf)==null?void 0:g.hw)==null?void 0:k.vcc)==null?void 0:T.boot)!=null?O:"Boot limit")+"")&&D(n,l),h[0]&32&&st(a.value)!==d[5].i.v.b&&Ee(a,d[5].i.v.b)},d(d){d&&A(e),c=!1,_()}}}function Oa(t){var I,N,B,S,j,z,V,F;let e,l,n=((B=(N=(I=t[2].conf)==null?void 0:I.debug)==null?void 0:N.title)!=null?B:"Debugging")+"",i,o,a,c,_,u,f,p,v,d,h=((z=(j=(S=t[2].conf)==null?void 0:S.debug)==null?void 0:j.enable)!=null?z:"Enable debugging")+"",g,k,T,O,E=((F=(V=t[5])==null?void 0:V.d)==null?void 0:F.s)&&Ia(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),a.textContent="\u24D8",c=b(),_=m("input"),u=b(),f=m("div"),p=m("label"),v=m("input"),d=b(),g=M(h),k=b(),E&&E.c(),r(l,"class","text-sm"),r(a,"href","https://amsleser.no/blog/post/24-telnet-debug"),r(a,"target","_blank"),r(a,"class","float-right"),r(_,"type","hidden"),r(_,"name","d"),_.value="true",r(v,"type","checkbox"),r(v,"name","ds"),v.__value="true",v.value=v.__value,r(v,"class","rounded mb-1"),r(f,"class","mt-3"),r(e,"class","cnt")},m(R,G){q(R,e,G),s(e,l),s(l,i),s(e,o),s(e,a),s(e,c),s(e,_),s(e,u),s(e,f),s(f,p),s(p,v),v.checked=t[5].d.s,s(p,d),s(p,g),s(e,k),E&&E.m(e,null),T||(O=ve(v,"change",t[105]),T=!0)},p(R,G){var U,H,W,K,Q,J,ae,Z;G[0]&4&&n!==(n=((W=(H=(U=R[2].conf)==null?void 0:U.debug)==null?void 0:H.title)!=null?W:"Debugging")+"")&&D(i,n),G[0]&32&&(v.checked=R[5].d.s),G[0]&4&&h!==(h=((J=(Q=(K=R[2].conf)==null?void 0:K.debug)==null?void 0:Q.enable)!=null?J:"Enable debugging")+"")&&D(g,h),(Z=(ae=R[5])==null?void 0:ae.d)!=null&&Z.s?E?E.p(R,G):(E=Ia(R),E.c(),E.m(e,null)):E&&(E.d(1),E=null)},d(R){R&&A(e),E&&E.d(),T=!1,O()}}}function Ia(t){var B,S,j,z,V,F;let e,l=((j=(S=(B=t[2].conf)==null?void 0:B.debug)==null?void 0:S.danger)!=null?j:"Disable when done")+"",n,i,o,a,c,_,u=((F=(V=(z=t[2].conf)==null?void 0:z.debug)==null?void 0:V.telnet)!=null?F:"Enable telnet")+"",f,p,v,d,h,g,k,T,O,E,I,N=t[5].d.t&&Ra(t);return{c(){e=m("div"),n=M(l),i=b(),o=m("div"),a=m("label"),c=m("input"),_=b(),f=M(u),p=b(),N&&N.c(),v=b(),d=m("div"),h=m("select"),g=m("option"),g.textContent="Verbose",k=m("option"),k.textContent="Debug",T=m("option"),T.textContent="Info",O=m("option"),O.textContent="Warning",r(e,"class","bd-red"),r(c,"type","checkbox"),r(c,"name","dt"),c.__value="true",c.value=c.__value,r(c,"class","rounded mb-1"),r(o,"class","my-1"),g.__value=1,g.value=g.__value,k.__value=2,k.value=k.__value,T.__value=3,T.value=T.__value,O.__value=4,O.value=O.__value,r(h,"name","dl"),r(h,"class","in-s"),t[5].d.l===void 0&&Gt(()=>t[107].call(h)),r(d,"class","my-1")},m(R,G){q(R,e,G),s(e,n),q(R,i,G),q(R,o,G),s(o,a),s(a,c),c.checked=t[5].d.t,s(a,_),s(a,f),q(R,p,G),N&&N.m(R,G),q(R,v,G),q(R,d,G),s(d,h),s(h,g),s(h,k),s(h,T),s(h,O),ot(h,t[5].d.l,!0),E||(I=[ve(c,"change",t[106]),ve(h,"change",t[107])],E=!0)},p(R,G){var U,H,W,K,Q,J;G[0]&4&&l!==(l=((W=(H=(U=R[2].conf)==null?void 0:U.debug)==null?void 0:H.danger)!=null?W:"Disable when done")+"")&&D(n,l),G[0]&32&&(c.checked=R[5].d.t),G[0]&4&&u!==(u=((J=(Q=(K=R[2].conf)==null?void 0:K.debug)==null?void 0:Q.telnet)!=null?J:"Enable telnet")+"")&&D(f,u),R[5].d.t?N?N.p(R,G):(N=Ra(R),N.c(),N.m(v.parentNode,v)):N&&(N.d(1),N=null),G[0]&32&&ot(h,R[5].d.l)},d(R){R&&A(e),R&&A(i),R&&A(o),R&&A(p),N&&N.d(R),R&&A(v),R&&A(d),E=!1,zt(I)}}}function Ra(t){var i,o,a;let e,l=((a=(o=(i=t[2].conf)==null?void 0:i.debug)==null?void 0:o.telnet_danger)!=null?a:"Disable when done")+"",n;return{c(){e=m("div"),n=M(l),r(e,"class","bd-red")},m(c,_){q(c,e,_),s(e,n)},p(c,_){var u,f,p;_[0]&4&&l!==(l=((p=(f=(u=c[2].conf)==null?void 0:u.debug)==null?void 0:f.telnet_danger)!=null?p:"Disable when done")+"")&&D(n,l)},d(c){c&&A(e)}}}function Fa(t){var v,d,h,g;let e,l,n=((d=(v=t[2].conf)==null?void 0:v.btn_reset)!=null?d:"Factory reset")+"",i,o,a,c,_=((g=(h=t[2].btn)==null?void 0:h.reboot)!=null?g:"Reboot")+"",u,f,p;return{c(){e=m("div"),l=m("button"),i=M(n),o=b(),a=m("div"),c=m("button"),u=M(_),r(l,"type","button"),r(l,"class","btn-red"),r(c,"type","button"),r(c,"class","btn-yellow"),r(a,"class","text-center")},m(k,T){q(k,e,T),s(e,l),s(l,i),q(k,o,T),q(k,a,T),s(a,c),s(c,u),f||(p=[ve(l,"click",t[11]),ve(c,"click",t[13])],f=!0)},p(k,T){var O,E,I,N;T[0]&4&&n!==(n=((E=(O=k[2].conf)==null?void 0:O.btn_reset)!=null?E:"Factory reset")+"")&&D(i,n),T[0]&4&&_!==(_=((N=(I=k[2].btn)==null?void 0:I.reboot)!=null?N:"Reboot")+"")&&D(u,_)},d(k){k&&A(e),k&&A(o),k&&A(a),f=!1,zt(p)}}}function Ua(t){var o,a;let e,l,n=((a=(o=t[2].btn)==null?void 0:o.save)!=null?a:"Save")+"",i;return{c(){e=m("div"),l=m("button"),i=M(n),r(l,"type","submit"),r(l,"class","btn-pri"),r(e,"class","text-right")},m(c,_){q(c,e,_),s(e,l),s(l,i)},p(c,_){var u,f;_[0]&4&&n!==(n=((f=(u=c[2].btn)==null?void 0:u.save)!=null?f:"Save")+"")&&D(i,n)},d(c){c&&A(e)}}}function lc(t){var me,Y,x,ke,pe,C,w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt;let e,l,n,i,o,a,c,_,u,f,p=((x=(Y=(me=t[5])==null?void 0:me.p)==null?void 0:Y.r)==null?void 0:x.startsWith("NO"))||((C=(pe=(ke=t[5])==null?void 0:ke.p)==null?void 0:pe.r)==null?void 0:C.startsWith("10YNO"))||((L=(P=(w=t[5])==null?void 0:w.p)==null?void 0:P.r)==null?void 0:L.startsWith("10Y1001A1001A4")),v,d,h,g,k,T,O,E,I,N,B,S,j,z,V,F,R,G=((y=t[5])==null?void 0:y.g)&&ea(t),U=((ee=t[5])==null?void 0:ee.m)&&ia(t),H=((le=t[5])==null?void 0:le.w)&&fa(t),W=((se=t[5])==null?void 0:se.n)&&ca(t),K=((_e=t[5])==null?void 0:_e.q)&&ma(t),Q=((Se=(Te=t[5])==null?void 0:Te.q)==null?void 0:Se.m)==3&&va(t),J=((Ne=(de=t[5])==null?void 0:de.q)==null?void 0:Ne.m)==4&&ha(t),ae=((ge=(we=t[5])==null?void 0:we.c)==null?void 0:ge.es)!=null&&ba(t),Z=p&&wa(t),X=((he=t[5])==null?void 0:he.y)&&Sa(t),oe=((Ue=(je=t[5])==null?void 0:je.i)==null?void 0:Ue.h)&&(((We=t[0])==null?void 0:We.board)>20||((Ze=t[0])==null?void 0:Ze.chip)=="esp8266"||((et=(Ye=(Je=t[5])==null?void 0:Je.i)==null?void 0:Ye.d)==null?void 0:et.d)>0)&&Ta(t),ne=((He=t[5])==null?void 0:He.d)&&Oa(t),ie=((Oe=t[1])==null?void 0:Oe.a)&&Fa(t),re=t[5]&&Ua(t);return E=new pl({props:{active:t[3],message:($e=(Pe=(ce=t[2].conf)==null?void 0:ce.mask)==null?void 0:Pe.loading)!=null?$e:"Loading"}}),N=new pl({props:{active:t[4],message:(ye=(mt=(Qe=t[2].conf)==null?void 0:Qe.mask)==null?void 0:mt.saving)!=null?ye:"Saving"}}),S=new pl({props:{active:t[7],message:(tt=(ze=(Ge=t[2].conf)==null?void 0:Ge.mask)==null?void 0:ze.reset)!=null?tt:"Factory reset"}}),z=new pl({props:{active:t[8],message:(dt=(Mt=(vt=t[2].conf)==null?void 0:vt.mask)==null?void 0:Mt.reset_done)!=null?dt:"Done"}}),{c(){e=m("form"),l=m("div"),G&&G.c(),n=b(),U&&U.c(),i=b(),H&&H.c(),o=b(),W&&W.c(),a=b(),K&&K.c(),c=b(),Q&&Q.c(),_=b(),J&&J.c(),u=b(),ae&&ae.c(),f=b(),Z&&Z.c(),v=b(),X&&X.c(),d=b(),oe&&oe.c(),h=b(),ne&&ne.c(),g=b(),k=m("div"),ie&&ie.c(),T=b(),re&&re.c(),O=b(),Re(E.$$.fragment),I=b(),Re(N.$$.fragment),B=b(),Re(S.$$.fragment),j=b(),Re(z.$$.fragment),r(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),r(k,"class","grid grid-cols-3 mt-3"),r(e,"autocomplete","off")},m(te,be){q(te,e,be),s(e,l),G&&G.m(l,null),s(l,n),U&&U.m(l,null),s(l,i),H&&H.m(l,null),s(l,o),W&&W.m(l,null),s(l,a),K&&K.m(l,null),s(l,c),Q&&Q.m(l,null),s(l,_),J&&J.m(l,null),s(l,u),ae&&ae.m(l,null),s(l,f),Z&&Z.m(l,null),s(l,v),X&&X.m(l,null),s(l,d),oe&&oe.m(l,null),s(l,h),ne&&ne.m(l,null),s(e,g),s(e,k),ie&&ie.m(k,null),s(k,T),re&&re.m(k,null),q(te,O,be),De(E,te,be),q(te,I,be),De(N,te,be),q(te,B,be),De(S,te,be),q(te,j,be),De(z,te,be),V=!0,F||(R=ve(e,"submit",_n(t[12])),F=!0)},p(te,be){var at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt,ue,Me,Ae,it,rt,At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl;(at=te[5])!=null&&at.g?G?(G.p(te,be),be[0]&32&&$(G,1)):(G=ea(te),G.c(),$(G,1),G.m(l,n)):G&&(gt(),fe(G,1,1,()=>{G=null}),kt()),(ft=te[5])!=null&&ft.m?U?U.p(te,be):(U=ia(te),U.c(),U.m(l,i)):U&&(U.d(1),U=null),(ut=te[5])!=null&&ut.w?H?H.p(te,be):(H=fa(te),H.c(),H.m(l,o)):H&&(H.d(1),H=null),(Et=te[5])!=null&&Et.n?W?(W.p(te,be),be[0]&32&&$(W,1)):(W=ca(te),W.c(),$(W,1),W.m(l,a)):W&&(gt(),fe(W,1,1,()=>{W=null}),kt()),(Ot=te[5])!=null&&Ot.q?K?(K.p(te,be),be[0]&32&&$(K,1)):(K=ma(te),K.c(),$(K,1),K.m(l,c)):K&&(gt(),fe(K,1,1,()=>{K=null}),kt()),((Pt=(St=te[5])==null?void 0:St.q)==null?void 0:Pt.m)==3?Q?Q.p(te,be):(Q=va(te),Q.c(),Q.m(l,_)):Q&&(Q.d(1),Q=null),((yt=(It=te[5])==null?void 0:It.q)==null?void 0:yt.m)==4?J?J.p(te,be):(J=ha(te),J.c(),J.m(l,u)):J&&(J.d(1),J=null),((ht=(Ct=te[5])==null?void 0:Ct.c)==null?void 0:ht.es)!=null?ae?(ae.p(te,be),be[0]&32&&$(ae,1)):(ae=ba(te),ae.c(),$(ae,1),ae.m(l,f)):ae&&(gt(),fe(ae,1,1,()=>{ae=null}),kt()),be[0]&32&&(p=((Wt=(Ut=(Lt=te[5])==null?void 0:Lt.p)==null?void 0:Ut.r)==null?void 0:Wt.startsWith("NO"))||((Bt=(Ke=(Ve=te[5])==null?void 0:Ve.p)==null?void 0:Ke.r)==null?void 0:Bt.startsWith("10YNO"))||((wt=(bt=(nt=te[5])==null?void 0:nt.p)==null?void 0:bt.r)==null?void 0:wt.startsWith("10Y1001A1001A4"))),p?Z?Z.p(te,be):(Z=wa(te),Z.c(),Z.m(l,v)):Z&&(Z.d(1),Z=null),(ue=te[5])!=null&&ue.y?X?X.p(te,be):(X=Sa(te),X.c(),X.m(l,d)):X&&(X.d(1),X=null),((Ae=(Me=te[5])==null?void 0:Me.i)==null?void 0:Ae.h)&&(((it=te[0])==null?void 0:it.board)>20||((rt=te[0])==null?void 0:rt.chip)=="esp8266"||((Zt=(Xt=(At=te[5])==null?void 0:At.i)==null?void 0:Xt.d)==null?void 0:Zt.d)>0)?oe?(oe.p(te,be),be[0]&33&&$(oe,1)):(oe=Ta(te),oe.c(),$(oe,1),oe.m(l,h)):oe&&(gt(),fe(oe,1,1,()=>{oe=null}),kt()),(el=te[5])!=null&&el.d?ne?ne.p(te,be):(ne=Oa(te),ne.c(),ne.m(l,null)):ne&&(ne.d(1),ne=null),(tl=te[1])!=null&&tl.a?ie?ie.p(te,be):(ie=Fa(te),ie.c(),ie.m(k,T)):ie&&(ie.d(1),ie=null),te[5]?re?re.p(te,be):(re=Ua(te),re.c(),re.m(k,null)):re&&(re.d(1),re=null);const Tt={};be[0]&8&&(Tt.active=te[3]),be[0]&4&&(Tt.message=(il=(nl=(ll=te[2].conf)==null?void 0:ll.mask)==null?void 0:nl.loading)!=null?il:"Loading"),E.$set(Tt);const Ce={};be[0]&16&&(Ce.active=te[4]),be[0]&4&&(Ce.message=(al=(ol=(sl=te[2].conf)==null?void 0:sl.mask)==null?void 0:ol.saving)!=null?al:"Saving"),N.$set(Ce);const qe={};be[0]&128&&(qe.active=te[7]),be[0]&4&&(qe.message=(Ie=(ul=(fl=te[2].conf)==null?void 0:fl.mask)==null?void 0:ul.reset)!=null?Ie:"Factory reset"),S.$set(qe);const pt={};be[0]&256&&(pt.active=te[8]),be[0]&4&&(pt.message=(cl=(rl=(jt=te[2].conf)==null?void 0:jt.mask)==null?void 0:rl.reset_done)!=null?cl:"Done"),z.$set(pt)},i(te){V||($(G),$(W),$(K),$(ae),$(oe),$(E.$$.fragment,te),$(N.$$.fragment,te),$(S.$$.fragment,te),$(z.$$.fragment,te),V=!0)},o(te){fe(G),fe(W),fe(K),fe(ae),fe(oe),fe(E.$$.fragment,te),fe(N.$$.fragment,te),fe(S.$$.fragment,te),fe(z.$$.fragment,te),V=!1},d(te){te&&A(e),G&&G.d(),U&&U.d(),H&&H.d(),W&&W.d(),K&&K.d(),Q&&Q.d(),J&&J.d(),ae&&ae.d(),Z&&Z.d(),X&&X.d(),oe&&oe.d(),ne&&ne.d(),ie&&ie.d(),re&&re.d(),te&&A(O),Le(E,te),te&&A(I),Le(N,te),te&&A(B),Le(S,te),te&&A(j),Le(z,te),F=!1,R()}}}async function nc(){await(await fetch("reboot",{method:"POST"})).json()}function ic(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,{data:o}=e,a={};vl.subscribe(ue=>{l(2,a=ue)});let c=[{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"}],_=!0,u=!1,f,p=[];Wn.subscribe(ue=>{var Me,Ae,it;ue.version&&(l(5,f=ue),l(3,_=!1),l(6,p=[{code:"en",name:"English"}]),((Me=f==null?void 0:f.u)==null?void 0:Me.lang)&&f.u.lang!="en"&&p.push({code:f.u.lang,name:(it=(Ae=a.language)==null?void 0:Ae.name)!=null?it:"Unknown"}),p.push({code:"hub",name:"Load from server"}))}),k0();let v=!1,d=!1;async function h(){if(confirm("Factory reset?")){l(7,v=!0);const ue=new URLSearchParams;ue.append("perform","true");let Ae=await(await fetch("reset",{method:"POST",body:ue})).json();l(7,v=!1),l(8,d=Ae.success)}}async function g(ue){l(4,u=!0);const Me=new FormData(ue.target),Ae=new URLSearchParams;for(let At of Me){const[Xt,Zt]=At;Ae.append(Xt,Zt)}let rt=await(await fetch("save",{method:"POST",body:Ae})).json();dl.update(At=>(At.hostname=Me.get("gh"),At.usrcfg=rt.success,At.booting=rt.reboot,Me.get("nm")=="static"&&(At.net.ip=Me.get("ni"),At.net.mask=Me.get("nu"),At.net.gw=Me.get("ng"),At.net.dns1=Me.get("nd")),At.ui=f.u,At)),l(4,u=!1),en(n)}const k=function(){confirm("Reboot?")&&(dl.update(ue=>(ue.booting=!0,ue)),nc())};async function T(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),Wn.update(Me=>(Me.q.s.c=!1,Me)))}async function O(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),Wn.update(Me=>(Me.q.s.r=!1,Me)))}async function E(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),Wn.update(Me=>(Me.q.s.k=!1,Me)))}const I=function(){f.q.s.e?f.q.p==1883&&l(5,f.q.p=8883,f):f.q.p==8883&&l(5,f.q.p=1883,f)};async function N(){if(f.u.lang=="hub"){const ue=await Al("http://hub.amsleser.no/hub/language/list.json");l(6,p=await ue.json()),l(5,f.u.lang=a.language.code,f)}}let B=44;function S(){f.g.h=this.value,l(5,f)}function j(){f.g.t=Kt(this),l(5,f)}function z(){f.p.r=Kt(this),l(5,f)}function V(){f.p.c=Kt(this),l(5,f)}function F(){f.p.e=this.checked,l(5,f)}function R(){f.p.t=this.value,l(5,f)}function G(){f.g.s=Kt(this),l(5,f)}function U(){f.g.u=this.value,l(5,f)}function H(){f.g.p=this.value,l(5,f)}function W(){f.g.c=this.value,l(5,f)}function K(){f.m.a=Kt(this),l(5,f)}function Q(){f.m.b=st(this.value),l(5,f)}function J(){f.m.i=this.checked,l(5,f)}function ae(){f.m.b=Kt(this),l(5,f)}function Z(){f.m.p=Kt(this),l(5,f)}function X(){f.m.s=st(this.value),l(5,f)}function oe(){f.m.d=Kt(this),l(5,f)}function ne(){f.m.f=st(this.value),l(5,f)}function ie(){f.m.r=st(this.value),l(5,f)}function re(){f.m.e.e=this.checked,l(5,f)}function me(){f.m.e.k=this.value,l(5,f)}function Y(){f.m.e.a=this.value,l(5,f)}function x(){f.m.m.e=this.checked,l(5,f)}function ke(){f.m.m.w=st(this.value),l(5,f)}function pe(){f.m.m.v=st(this.value),l(5,f)}function C(){f.m.m.a=st(this.value),l(5,f)}function w(){f.m.m.c=st(this.value),l(5,f)}function P(){f.n.c=Kt(this),l(5,f)}function L(){f.w.s=this.value,l(5,f)}function y(){f.w.p=this.value,l(5,f)}function ee(){f.w.z=Kt(this),l(5,f)}function le(){f.w.w=st(this.value),l(5,f)}function se(){f.w.b=this.checked,l(5,f)}function _e(){f.n.m=Kt(this),l(5,f)}function Te(){f.n.i=this.value,l(5,f)}function Se(){f.n.s=Kt(this),l(5,f)}function de(){f.n.g=this.value,l(5,f)}function Ne(){f.n.d1=this.value,l(5,f)}function we(){f.n.d2=this.value,l(5,f)}function ge(){f.n.x=this.checked,l(5,f)}function he(){f.n.d=this.checked,l(5,f)}function je(){f.n.h=this.checked,l(5,f)}function Ue(){f.n.n1=this.value,l(5,f)}function We(){f.q.s.e=this.checked,l(5,f)}function Ze(){f.q.h=this.value,l(5,f)}function Je(){f.q.p=st(this.value),l(5,f)}function Ye(){f.q.u=this.value,l(5,f)}function et(){f.q.a=this.value,l(5,f)}function He(){f.q.c=this.value,l(5,f)}function Oe(){f.q.m=Kt(this),l(5,f)}function ce(){f.q.b=this.value,l(5,f)}function Pe(){f.o.e=this.value,l(5,f)}function $e(){f.o.c=this.value,l(5,f)}function Qe(){f.o.u1=this.value,l(5,f)}function mt(){f.o.u2=this.value,l(5,f)}function ye(){f.o.u3=this.value,l(5,f)}function Ge(){f.h.t=this.value,l(5,f)}function ze(){f.h.h=this.value,l(5,f)}function tt(){f.h.n=this.value,l(5,f)}function vt(){f.c.e=this.checked,l(5,f)}function Mt(){f.c.es=this.checked,l(5,f)}function dt(ue){f.t.t[ue]=st(this.value),l(5,f)}function te(){f.t.h=st(this.value),l(5,f)}function be(ue){f.u[ue.key]=Kt(this),l(5,f)}function Tt(){f.u.lang=Kt(this),l(5,f)}function Ce(){f.i.h.p=Kt(this),l(5,f)}function qe(){f.i.h.t=Kt(this),l(5,f)}function pt(){f.i.h.u=this.checked,l(5,f)}function at(){f.i.a=st(this.value),l(5,f)}function ft(){f.i.l.p=st(this.value),l(5,f)}function ut(){f.i.l.i=this.checked,l(5,f)}function Et(){f.i.r.i=this.checked,l(5,f)}function Ot(){f.i.r.r=st(this.value),l(5,f)}function St(){f.i.r.g=st(this.value),l(5,f)}function Pt(){f.i.r.b=st(this.value),l(5,f)}function It(){f.i.d.d=st(this.value),l(5,f)}function yt(){f.i.t.d=st(this.value),l(5,f)}function Ct(){f.i.t.a=st(this.value),l(5,f)}function ht(){f.i.v.p=st(this.value),l(5,f)}function Lt(){f.i.v.d.v=st(this.value),l(5,f)}function Ut(){f.i.v.d.g=st(this.value),l(5,f)}function Wt(){f.i.d.b=Kt(this),l(5,f)}function Ve(){f.i.v.o=st(this.value),l(5,f)}function Ke(){f.i.v.m=st(this.value),l(5,f)}function Bt(){f.i.v.b=st(this.value),l(5,f)}function nt(){f.d.s=this.checked,l(5,f)}function bt(){f.d.t=this.checked,l(5,f)}function wt(){f.d.l=Kt(this),l(5,f)}return t.$$set=ue=>{"basepath"in ue&&l(19,n=ue.basepath),"sysinfo"in ue&&l(0,i=ue.sysinfo),"data"in ue&&l(1,o=ue.data)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(9,B=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39)},[i,o,a,_,u,f,p,v,d,B,c,h,g,k,T,O,E,I,N,n,S,j,z,V,F,R,G,U,H,W,K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke,pe,C,w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt,te,be,Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt]}class sc extends Dt{constructor(e){super(),qt(this,e,ic,lc,Nt,{basepath:19,sysinfo:0,data:1},null,[-1,-1,-1,-1])}}function Ba(t,e,l){const n=t.slice();return n[22]=e[l],n}function ja(t){let e,l=t[1].cpu+"",n,i;return{c(){e=M("("),n=M(l),i=M("MHz)")},m(o,a){q(o,e,a),q(o,n,a),q(o,i,a)},p(o,a){a&2&&l!==(l=o[1].cpu+"")&&D(n,l)},d(o){o&&A(e),o&&A(n),o&&A(i)}}}function oc(t){let e=xe(t[1].chip,t[1].board)+"",l;return{c(){l=M(e)},m(n,i){q(n,l,i)},p(n,i){i&2&&e!==(e=xe(n[1].chip,n[1].board)+"")&&D(l,e)},d(n){n&&A(l)}}}function Ha(t){var W,K,Q,J,ae,Z,X,oe,ne,ie,re,me;let e,l=((Q=(K=(W=t[3].status)==null?void 0:W.device)==null?void 0:K.apmac)!=null?Q:"AP MAC")+"",n,i,o=t[1].apmac+"",a,c,_,u=((Z=(ae=(J=t[3].status)==null?void 0:J.device)==null?void 0:ae.last_boot)!=null?Z:"Last boot")+"",f,p,v,d,h,g,k=((ne=(oe=(X=t[3].status)==null?void 0:X.device)==null?void 0:oe.reason)!=null?ne:"Reason")+"",T,O,E=((me=(re=(ie=t[3][As(t[1].chip)])==null?void 0:ie.reason)==null?void 0:re[t[1].boot_reason])!=null?me:t[1].boot_reason)+"",I,N,B=t[1].boot_reason+"",S,j,z=t[1].ex_cause+"",V,F,R;const G=[fc,ac],U=[];function H(Y,x){return Y[0].u>0?0:1}return v=H(t),d=U[v]=G[v](t),{c(){e=m("div"),n=M(l),i=M(": "),a=M(o),c=b(),_=m("div"),f=M(u),p=M(`: + `),U=m("div"),H=m("input"),W=b(),K=m("input"),Q=b(),J=m("input"),r(l,"class","text-sm"),r(a,"href",kl("MQTT-configuration#domoticz")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","o"),u.value="true",r(T,"name","oe"),r(T,"type","text"),r(T,"class","in-f tr w-full"),r(v,"class","w-1/2"),r(j,"name","oc"),r(j,"type","text"),r(j,"class","in-l tr w-full"),r(E,"class","w-1/2"),r(p,"class","my-1 flex"),r(H,"name","ou1"),r(H,"type","text"),r(H,"class","in-f tr w-1/3"),r(K,"name","ou2"),r(K,"type","text"),r(K,"class","in-m tr w-1/3"),r(J,"name","ou3"),r(J,"type","text"),r(J,"class","in-l tr w-1/3"),r(U,"class","flex"),r(V,"class","my-1"),r(e,"class","cnt")},m(le,se){q(le,e,se),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,v),s(v,h),s(v,g),s(v,k),s(v,T),Ee(T,t[5].o.e),s(p,O),s(p,E),s(E,N),s(E,B),s(E,S),s(E,j),Ee(j,t[5].o.c),s(e,z),s(e,V),s(V,R),s(V,G),s(V,U),s(U,H),Ee(H,t[5].o.u1),s(U,W),s(U,K),Ee(K,t[5].o.u2),s(U,Q),s(U,J),Ee(J,t[5].o.u3),ae||(Z=[ve(T,"input",t[71]),ve(j,"input",t[72]),ve(H,"input",t[73]),ve(K,"input",t[74]),ve(J,"input",t[75])],ae=!0)},p(le,se){var _e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He;se[0]&4&&n!==(n=((de=(Se=(Te=(_e=le[2].conf)==null?void 0:_e.mqtt)==null?void 0:Te.domoticz)==null?void 0:Se.title)!=null?de:"Domoticz")+"")&&D(i,n),se[0]&4&&d!==(d=((he=(ge=(we=(Ne=le[2].conf)==null?void 0:Ne.mqtt)==null?void 0:we.domoticz)==null?void 0:ge.eidx)!=null?he:"Electricity IDX")+"")&&D(h,d),se[0]&32&&T.value!==le[5].o.e&&Ee(T,le[5].o.e),se[0]&4&&I!==(I=((Ze=(We=(Ue=(je=le[2].conf)==null?void 0:je.mqtt)==null?void 0:Ue.domoticz)==null?void 0:We.cidx)!=null?Ze:"Current IDX")+"")&&D(N,I),se[0]&32&&j.value!==le[5].o.c&&Ee(j,le[5].o.c),se[0]&4&&F!==(F=((He=(et=(Ye=(Je=le[2].conf)==null?void 0:Je.mqtt)==null?void 0:Ye.domoticz)==null?void 0:et.vidx)!=null?He:"Voltage IDX")+"")&&D(R,F),se[0]&32&&H.value!==le[5].o.u1&&Ee(H,le[5].o.u1),se[0]&32&&K.value!==le[5].o.u2&&Ee(K,le[5].o.u2),se[0]&32&&J.value!==le[5].o.u3&&Ee(J,le[5].o.u3)},d(le){le&&A(e),ae=!1,zt(Z)}}}function ha(t){var Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke,pe,C,w;let e,l,n=((Z=(ae=(J=(Q=t[2].conf)==null?void 0:Q.mqtt)==null?void 0:J.ha)==null?void 0:ae.title)!=null?Z:"Home-Assistant")+"",i,o,a,c,_,u,f,p,v=((ie=(ne=(oe=(X=t[2].conf)==null?void 0:X.mqtt)==null?void 0:oe.ha)==null?void 0:ne.discovery)!=null?ie:"Discovery topic prefix")+"",d,h,g,k,T,O,E=((x=(Y=(me=(re=t[2].conf)==null?void 0:re.mqtt)==null?void 0:me.ha)==null?void 0:Y.hostname)!=null?x:"Hostname for URL")+"",I,N,B,S,j,z,V,F=((w=(C=(pe=(ke=t[2].conf)==null?void 0:ke.mqtt)==null?void 0:pe.ha)==null?void 0:C.tag)!=null?w:"Name tag")+"",R,G,U,H,W,K;return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),d=M(v),h=m("br"),g=b(),k=m("input"),T=b(),O=m("div"),I=M(E),N=m("br"),B=b(),S=m("input"),z=b(),V=m("div"),R=M(F),G=m("br"),U=b(),H=m("input"),r(l,"class","text-sm"),r(a,"href",kl("MQTT-configuration#home-assistant")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","h"),u.value="true",r(k,"name","ht"),r(k,"type","text"),r(k,"class","in-s"),r(k,"placeholder","homeassistant"),r(p,"class","my-1"),r(S,"name","hh"),r(S,"type","text"),r(S,"class","in-s"),r(S,"placeholder",j=t[5].g.h+".local"),r(O,"class","my-1"),r(H,"name","hn"),r(H,"type","text"),r(H,"class","in-s"),r(V,"class","my-1"),r(e,"class","cnt")},m(P,L){q(P,e,L),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,d),s(p,h),s(p,g),s(p,k),Ee(k,t[5].h.t),s(e,T),s(e,O),s(O,I),s(O,N),s(O,B),s(O,S),Ee(S,t[5].h.h),s(e,z),s(e,V),s(V,R),s(V,G),s(V,U),s(V,H),Ee(H,t[5].h.n),W||(K=[ve(k,"input",t[76]),ve(S,"input",t[77]),ve(H,"input",t[78])],W=!0)},p(P,L){var y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze;L[0]&4&&n!==(n=((se=(le=(ee=(y=P[2].conf)==null?void 0:y.mqtt)==null?void 0:ee.ha)==null?void 0:le.title)!=null?se:"Home-Assistant")+"")&&D(i,n),L[0]&4&&v!==(v=((de=(Se=(Te=(_e=P[2].conf)==null?void 0:_e.mqtt)==null?void 0:Te.ha)==null?void 0:Se.discovery)!=null?de:"Discovery topic prefix")+"")&&D(d,v),L[0]&32&&k.value!==P[5].h.t&&Ee(k,P[5].h.t),L[0]&4&&E!==(E=((he=(ge=(we=(Ne=P[2].conf)==null?void 0:Ne.mqtt)==null?void 0:we.ha)==null?void 0:ge.hostname)!=null?he:"Hostname for URL")+"")&&D(I,E),L[0]&32&&j!==(j=P[5].g.h+".local")&&r(S,"placeholder",j),L[0]&32&&S.value!==P[5].h.h&&Ee(S,P[5].h.h),L[0]&4&&F!==(F=((Ze=(We=(Ue=(je=P[2].conf)==null?void 0:je.mqtt)==null?void 0:Ue.ha)==null?void 0:We.tag)!=null?Ze:"Name tag")+"")&&D(R,F),L[0]&32&&H.value!==P[5].h.n&&Ee(H,P[5].h.n)},d(P){P&&A(e),W=!1,zt(K)}}}function ba(t){var G,U,H,W,K,Q,J,ae,Z;let e,l,n=((H=(U=(G=t[2].conf)==null?void 0:G.cloud)==null?void 0:U.title)!=null?H:"Cloud connections")+"",i,o,a,c,_,u,f,p,v,d,h,g=((Q=(K=(W=t[2].conf)==null?void 0:W.cloud)==null?void 0:K.ams)!=null?Q:"AMS reader cloud")+"",k,T,O,E,I,N,B=((Z=(ae=(J=t[2].conf)==null?void 0:J.cloud)==null?void 0:ae.es)!=null?Z:"Energy Speedometer")+"",S,j,z,V,F,R=t[5].c.es&&ga(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),u=m("input"),f=b(),p=m("div"),v=m("label"),d=m("input"),h=b(),k=M(g),T=b(),O=m("div"),E=m("label"),I=m("input"),N=b(),S=M(B),j=b(),R&&R.c(),r(l,"class","text-sm"),r(a,"href",kl("Cloud")),r(a,"target","_blank"),r(a,"class","float-right"),r(u,"type","hidden"),r(u,"name","c"),u.value="true",r(d,"type","checkbox"),r(d,"name","ce"),d.__value="true",d.value=d.__value,r(d,"class","rounded mb-1"),r(p,"class","my-1"),r(I,"type","checkbox"),r(I,"class","rounded mb-1"),r(I,"name","ces"),I.__value="true",I.value=I.__value,r(O,"class","my-1"),r(e,"class","cnt")},m(X,oe){q(X,e,oe),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p),s(p,v),s(v,d),d.checked=t[5].c.e,s(v,h),s(v,k),s(e,T),s(e,O),s(O,E),s(E,I),I.checked=t[5].c.es,s(E,N),s(E,S),s(O,j),R&&R.m(O,null),z=!0,V||(F=[ve(d,"change",t[79]),ve(I,"change",t[80])],V=!0)},p(X,oe){var ne,ie,re,me,Y,x,ke,pe,C;(!z||oe[0]&4)&&n!==(n=((re=(ie=(ne=X[2].conf)==null?void 0:ne.cloud)==null?void 0:ie.title)!=null?re:"Cloud connections")+"")&&D(i,n),oe[0]&32&&(d.checked=X[5].c.e),(!z||oe[0]&4)&&g!==(g=((x=(Y=(me=X[2].conf)==null?void 0:me.cloud)==null?void 0:Y.ams)!=null?x:"AMS reader cloud")+"")&&D(k,g),oe[0]&32&&(I.checked=X[5].c.es),(!z||oe[0]&4)&&B!==(B=((C=(pe=(ke=X[2].conf)==null?void 0:ke.cloud)==null?void 0:pe.es)!=null?C:"Energy Speedometer")+"")&&D(S,B),X[5].c.es?R?(R.p(X,oe),oe[0]&32&&$(R,1)):(R=ga(X),R.c(),$(R,1),R.m(O,null)):R&&(gt(),fe(R,1,1,()=>{R=null}),kt())},i(X){z||($(R),z=!0)},o(X){fe(R),z=!1},d(X){X&&A(e),R&&R.d(),V=!1,zt(F)}}}function ga(t){let e,l,n=t[0].mac+"",i,o,a,c,_=(t[0].meter.id?t[0].meter.id:"missing, required")+"",u,f,p,v,d=t[0].mac&&t[0].meter.id&&ka(t);return{c(){e=m("div"),l=M("MAC: "),i=M(n),o=b(),a=m("div"),c=M("Meter ID: "),u=M(_),f=b(),d&&d.c(),p=Qt(),r(e,"class","pl-5"),r(a,"class","pl-5")},m(h,g){q(h,e,g),s(e,l),s(e,i),q(h,o,g),q(h,a,g),s(a,c),s(a,u),q(h,f,g),d&&d.m(h,g),q(h,p,g),v=!0},p(h,g){(!v||g[0]&1)&&n!==(n=h[0].mac+"")&&D(i,n),(!v||g[0]&1)&&_!==(_=(h[0].meter.id?h[0].meter.id:"missing, required")+"")&&D(u,_),h[0].mac&&h[0].meter.id?d?(d.p(h,g),g[0]&1&&$(d,1)):(d=ka(h),d.c(),$(d,1),d.m(p.parentNode,p)):d&&(gt(),fe(d,1,1,()=>{d=null}),kt())},i(h){v||($(d),v=!0)},o(h){fe(d),v=!1},d(h){h&&A(e),h&&A(o),h&&A(a),h&&A(f),d&&d.d(h),h&&A(p)}}}function ka(t){let e,l,n;return l=new F0({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=m("div"),Re(l.$$.fragment),r(e,"class","pl-2")},m(i,o){q(i,e,o),De(l,e,null),n=!0},p(i,o){const a={};o[0]&1&&(a.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(a)},i(i){n||($(l.$$.fragment,i),n=!0)},o(i){fe(l.$$.fragment,i),n=!1},d(i){i&&A(e),Le(l)}}}function wa(t){var F,R,G,U,H,W,K,Q;let e,l,n=((G=(R=(F=t[2].conf)==null?void 0:F.thresholds)==null?void 0:R.title)!=null?G:"Thresholds")+"",i,o,a,c,_,u,f,p,v,d,h,g=((W=(H=(U=t[2].conf)==null?void 0:U.thresholds)==null?void 0:H.avg)!=null?W:"Average of")+"",k,T,O,E,I,N=((Q=(K=t[2].common)==null?void 0:K.hours)!=null?Q:"hours")+"",B,S,j,z={length:9},V=[];for(let J=0;Jt[84].call(T)),r(d,"class","w-1/2"),r(p,"class","flex flex-wrap"),r(e,"class","cnt")},m(U,H){q(U,e,H),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),s(e,u),s(e,f),s(e,p);for(let W=0;W20&&Ea(t),d=((I=(E=(O=t[5])==null?void 0:O.i)==null?void 0:E.d)==null?void 0:I.d)>0&&qa(t),h=t[0].chip=="esp8266"&&Da(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),c=M("\u24D8"),_=b(),v&&v.c(),u=b(),d&&d.c(),f=b(),h&&h.c(),r(l,"class","text-sm"),r(a,"href",kl("GPIO-configuration")),r(a,"target","_blank"),r(a,"class","float-right"),r(e,"class","cnt")},m(N,B){q(N,e,B),s(e,l),s(l,i),s(e,o),s(e,a),s(a,c),s(e,_),v&&v.m(e,null),s(e,u),d&&d.m(e,null),s(e,f),h&&h.m(e,null),p=!0},p(N,B){var S,j,z,V,F,R;(!p||B[0]&4)&&n!==(n=((z=(j=(S=N[2].conf)==null?void 0:S.hw)==null?void 0:j.title)!=null?z:"Hardware")+"")&&D(i,n),N[0].board>20?v?(v.p(N,B),B[0]&1&&$(v,1)):(v=Ea(N),v.c(),$(v,1),v.m(e,u)):v&&(gt(),fe(v,1,1,()=>{v=null}),kt()),((R=(F=(V=N[5])==null?void 0:V.i)==null?void 0:F.d)==null?void 0:R.d)>0?d?d.p(N,B):(d=qa(N),d.c(),d.m(e,f)):d&&(d.d(1),d=null),N[0].chip=="esp8266"?h?h.p(N,B):(h=Da(N),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(N){p||($(v),p=!0)},o(N){fe(v),p=!1},d(N){N&&A(e),v&&v.d(),d&&d.d(),h&&h.d()}}}function Ea(t){var Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt,ue,Me,Ae,it,rt,At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl,hl,bl,gl,Fe,ct;let e,l,n,i,o=((Pt=(St=(Ot=(Et=t[2].conf)==null?void 0:Et.hw)==null?void 0:Ot.han)==null?void 0:St.rx)!=null?Pt:"HAN RX")+"",a,c,_,u,f,p,v,d=((ht=(Ct=(yt=(It=t[2].conf)==null?void 0:It.hw)==null?void 0:yt.han)==null?void 0:Ct.tx)!=null?ht:"HAN TX")+"",h,g,k,T,O,E,I,N,B,S,j=((Ve=(Wt=(Ut=(Lt=t[2].conf)==null?void 0:Lt.hw)==null?void 0:Ut.han)==null?void 0:Wt.pullup)!=null?Ve:"pullup")+"",z,V,F,R,G=((nt=(Bt=(Ke=t[2].conf)==null?void 0:Ke.hw)==null?void 0:Bt.ap_btn)!=null?nt:"AP button")+"",U,H,W,K,Q,J,ae=((Me=(ue=(wt=(bt=t[2].conf)==null?void 0:bt.hw)==null?void 0:wt.led)==null?void 0:ue.title)!=null?Me:"LED")+"",Z,X,oe,ne,ie,re,me,Y,x,ke,pe=((At=(rt=(it=(Ae=t[2].conf)==null?void 0:Ae.hw)==null?void 0:it.led)==null?void 0:rt.inverted)!=null?At:"inverted")+"",C,w,P,L=((tl=(el=(Zt=(Xt=t[2].conf)==null?void 0:Xt.hw)==null?void 0:Zt.led)==null?void 0:el.rgb)!=null?tl:"RGB")+"",y,ee,le,se,_e=((sl=(il=(nl=(ll=t[2].conf)==null?void 0:ll.hw)==null?void 0:nl.led)==null?void 0:il.inverted)!=null?sl:"inverted")+"",Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye=((ul=(fl=(al=(ol=t[2].conf)==null?void 0:ol.hw)==null?void 0:al.led)==null?void 0:fl.disable)!=null?ul:"LED dis. GPIO")+"",et,He,Oe,ce,Pe,$e=((rl=(jt=(Ie=t[2].conf)==null?void 0:Ie.hw)==null?void 0:jt.temp)!=null?rl:"Temperature")+"",Qe,mt,ye,Ge,ze,tt,vt=((bl=(hl=(cl=t[2].conf)==null?void 0:cl.hw)==null?void 0:hl.temp_analog)!=null?bl:"Analog temp")+"",Mt,dt,te,be,Tt,Ce,qe,pt,at;f=new Bi({props:{chip:t[0].chip}}),O=new Bi({props:{chip:t[0].chip}});let ft=t[0].chip!="esp8266"&&Pa(t),ut=((ct=(Fe=(gl=t[5])==null?void 0:gl.i)==null?void 0:Fe.v)==null?void 0:ct.p)>0&&Aa(t);return{c(){e=m("input"),l=b(),n=m("div"),i=m("div"),a=M(o),c=m("br"),_=b(),u=m("select"),Re(f.$$.fragment),p=b(),v=m("div"),h=M(d),g=m("br"),k=b(),T=m("select"),Re(O.$$.fragment),E=b(),I=m("div"),N=m("label"),B=m("input"),S=b(),z=M(j),V=b(),F=m("div"),R=m("div"),U=M(G),H=m("br"),W=b(),K=m("input"),Q=b(),J=m("div"),Z=M(ae),X=m("br"),oe=b(),ne=m("div"),ie=m("input"),re=b(),me=m("div"),Y=m("label"),x=m("input"),ke=b(),C=M(pe),w=b(),P=m("div"),y=M(L),ee=m("label"),le=m("input"),se=b(),Te=M(_e),Se=m("br"),de=b(),Ne=m("div"),we=m("input"),ge=b(),he=m("input"),je=b(),Ue=m("input"),We=b(),Ze=m("div"),Je=m("div"),et=M(Ye),He=b(),Oe=m("input"),ce=b(),Pe=m("div"),Qe=M($e),mt=m("br"),ye=b(),Ge=m("input"),ze=b(),tt=m("div"),Mt=M(vt),dt=m("br"),te=b(),be=m("input"),Tt=b(),ft&&ft.c(),Ce=b(),ut&&ut.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(u,"name","ihp"),r(u,"class","in-f w-full"),t[5].i.h.p===void 0&&Gt(()=>t[85].call(u)),r(i,"class","w-1/3"),r(T,"name","iht"),r(T,"class","in-l w-full"),t[5].i.h.t===void 0&&Gt(()=>t[86].call(T)),r(v,"class","w-1/3"),r(B,"name","ihu"),B.__value="true",B.value=B.__value,r(B,"type","checkbox"),r(B,"class","rounded mb-1"),r(N,"class","ml-2"),r(I,"class","w-1/3"),r(n,"class","flex flex-wrap"),r(K,"name","ia"),r(K,"type","number"),r(K,"min","0"),r(K,"max",t[9]),r(K,"class","in-f tr w-full"),r(R,"class","w-1/3"),r(ie,"name","ilp"),r(ie,"type","number"),r(ie,"min","0"),r(ie,"max",t[9]),r(ie,"class","in-l tr w-full"),r(ne,"class","flex"),r(J,"class","w-1/3"),r(x,"name","ili"),x.__value="true",x.value=x.__value,r(x,"type","checkbox"),r(x,"class","rounded mb-1"),r(Y,"class","ml-4"),r(me,"class","w-1/3"),r(le,"name","iri"),le.__value="true",le.value=le.__value,r(le,"type","checkbox"),r(le,"class","rounded mb-1"),r(ee,"class","ml-4"),r(we,"name","irr"),r(we,"type","number"),r(we,"min","0"),r(we,"max",t[9]),r(we,"class","in-f tr w-1/3"),r(he,"name","irg"),r(he,"type","number"),r(he,"min","0"),r(he,"max",t[9]),r(he,"class","in-m tr w-1/3"),r(Ue,"name","irb"),r(Ue,"type","number"),r(Ue,"min","0"),r(Ue,"max",t[9]),r(Ue,"class","in-l tr w-1/3"),r(Ne,"class","flex"),r(P,"class","w-full"),r(Oe,"name","idd"),r(Oe,"type","number"),r(Oe,"min","0"),r(Oe,"max",t[9]),r(Oe,"class","in-s tr"),r(Je,"class","my-1 pr-1 w-1/3"),r(Ze,"class","w-full"),r(Ge,"name","itd"),r(Ge,"type","number"),r(Ge,"min","0"),r(Ge,"max",t[9]),r(Ge,"class","in-f tr w-full"),r(Pe,"class","my-1 w-1/3"),r(be,"name","ita"),r(be,"type","number"),r(be,"min","0"),r(be,"max",t[9]),r(be,"class","in-l tr w-full"),r(tt,"class","my-1 pr-1 w-1/3"),r(F,"class","flex flex-wrap")},m(Be,_t){q(Be,e,_t),q(Be,l,_t),q(Be,n,_t),s(n,i),s(i,a),s(i,c),s(i,_),s(i,u),De(f,u,null),ot(u,t[5].i.h.p,!0),s(n,p),s(n,v),s(v,h),s(v,g),s(v,k),s(v,T),De(O,T,null),ot(T,t[5].i.h.t,!0),s(n,E),s(n,I),s(I,N),s(N,B),B.checked=t[5].i.h.u,s(N,S),s(N,z),q(Be,V,_t),q(Be,F,_t),s(F,R),s(R,U),s(R,H),s(R,W),s(R,K),Ee(K,t[5].i.a),s(F,Q),s(F,J),s(J,Z),s(J,X),s(J,oe),s(J,ne),s(ne,ie),Ee(ie,t[5].i.l.p),s(F,re),s(F,me),s(me,Y),s(Y,x),x.checked=t[5].i.l.i,s(Y,ke),s(Y,C),s(F,w),s(F,P),s(P,y),s(P,ee),s(ee,le),le.checked=t[5].i.r.i,s(ee,se),s(ee,Te),s(P,Se),s(P,de),s(P,Ne),s(Ne,we),Ee(we,t[5].i.r.r),s(Ne,ge),s(Ne,he),Ee(he,t[5].i.r.g),s(Ne,je),s(Ne,Ue),Ee(Ue,t[5].i.r.b),s(F,We),s(F,Ze),s(Ze,Je),s(Je,et),s(Je,He),s(Je,Oe),Ee(Oe,t[5].i.d.d),s(F,ce),s(F,Pe),s(Pe,Qe),s(Pe,mt),s(Pe,ye),s(Pe,Ge),Ee(Ge,t[5].i.t.d),s(F,ze),s(F,tt),s(tt,Mt),s(tt,dt),s(tt,te),s(tt,be),Ee(be,t[5].i.t.a),s(F,Tt),ft&&ft.m(F,null),s(F,Ce),ut&&ut.m(F,null),qe=!0,pt||(at=[ve(u,"change",t[85]),ve(T,"change",t[86]),ve(B,"change",t[87]),ve(K,"input",t[88]),ve(ie,"input",t[89]),ve(x,"change",t[90]),ve(le,"change",t[91]),ve(we,"input",t[92]),ve(he,"input",t[93]),ve(Ue,"input",t[94]),ve(Oe,"input",t[95]),ve(Ge,"input",t[96]),ve(be,"input",t[97])],pt=!0)},p(Be,_t){var Nl,Tl,Rl,Fl,Ul,Bl,jl,Hl,yl,zl,Wl,lt,Ht,_l,wl,Gl,mn,pn,dn,vn,hn,bn,gn,kn,wn,Mn,Sn,Cn,Nn,Tn,En,Pn,An,qn,Dn,Ln,On,In,Rn,Fn,Un,Bn,jn,Hn;(!qe||_t[0]&4)&&o!==(o=((Fl=(Rl=(Tl=(Nl=Be[2].conf)==null?void 0:Nl.hw)==null?void 0:Tl.han)==null?void 0:Rl.rx)!=null?Fl:"HAN RX")+"")&&D(a,o);const Sl={};_t[0]&1&&(Sl.chip=Be[0].chip),f.$set(Sl),_t[0]&32&&ot(u,Be[5].i.h.p),(!qe||_t[0]&4)&&d!==(d=((Hl=(jl=(Bl=(Ul=Be[2].conf)==null?void 0:Ul.hw)==null?void 0:Bl.han)==null?void 0:jl.tx)!=null?Hl:"HAN TX")+"")&&D(h,d);const Cl={};_t[0]&1&&(Cl.chip=Be[0].chip),O.$set(Cl),_t[0]&32&&ot(T,Be[5].i.h.t),_t[0]&32&&(B.checked=Be[5].i.h.u),(!qe||_t[0]&4)&&j!==(j=((lt=(Wl=(zl=(yl=Be[2].conf)==null?void 0:yl.hw)==null?void 0:zl.han)==null?void 0:Wl.pullup)!=null?lt:"pullup")+"")&&D(z,j),(!qe||_t[0]&4)&&G!==(G=((wl=(_l=(Ht=Be[2].conf)==null?void 0:Ht.hw)==null?void 0:_l.ap_btn)!=null?wl:"AP button")+"")&&D(U,G),(!qe||_t[0]&512)&&r(K,"max",Be[9]),_t[0]&32&&st(K.value)!==Be[5].i.a&&Ee(K,Be[5].i.a),(!qe||_t[0]&4)&&ae!==(ae=((dn=(pn=(mn=(Gl=Be[2].conf)==null?void 0:Gl.hw)==null?void 0:mn.led)==null?void 0:pn.title)!=null?dn:"LED")+"")&&D(Z,ae),(!qe||_t[0]&512)&&r(ie,"max",Be[9]),_t[0]&32&&st(ie.value)!==Be[5].i.l.p&&Ee(ie,Be[5].i.l.p),_t[0]&32&&(x.checked=Be[5].i.l.i),(!qe||_t[0]&4)&&pe!==(pe=((gn=(bn=(hn=(vn=Be[2].conf)==null?void 0:vn.hw)==null?void 0:hn.led)==null?void 0:bn.inverted)!=null?gn:"inverted")+"")&&D(C,pe),(!qe||_t[0]&4)&&L!==(L=((Sn=(Mn=(wn=(kn=Be[2].conf)==null?void 0:kn.hw)==null?void 0:wn.led)==null?void 0:Mn.rgb)!=null?Sn:"RGB")+"")&&D(y,L),_t[0]&32&&(le.checked=Be[5].i.r.i),(!qe||_t[0]&4)&&_e!==(_e=((En=(Tn=(Nn=(Cn=Be[2].conf)==null?void 0:Cn.hw)==null?void 0:Nn.led)==null?void 0:Tn.inverted)!=null?En:"inverted")+"")&&D(Te,_e),(!qe||_t[0]&512)&&r(we,"max",Be[9]),_t[0]&32&&st(we.value)!==Be[5].i.r.r&&Ee(we,Be[5].i.r.r),(!qe||_t[0]&512)&&r(he,"max",Be[9]),_t[0]&32&&st(he.value)!==Be[5].i.r.g&&Ee(he,Be[5].i.r.g),(!qe||_t[0]&512)&&r(Ue,"max",Be[9]),_t[0]&32&&st(Ue.value)!==Be[5].i.r.b&&Ee(Ue,Be[5].i.r.b),(!qe||_t[0]&4)&&Ye!==(Ye=((Dn=(qn=(An=(Pn=Be[2].conf)==null?void 0:Pn.hw)==null?void 0:An.led)==null?void 0:qn.disable)!=null?Dn:"LED dis. GPIO")+"")&&D(et,Ye),(!qe||_t[0]&512)&&r(Oe,"max",Be[9]),_t[0]&32&&st(Oe.value)!==Be[5].i.d.d&&Ee(Oe,Be[5].i.d.d),(!qe||_t[0]&4)&&$e!==($e=((In=(On=(Ln=Be[2].conf)==null?void 0:Ln.hw)==null?void 0:On.temp)!=null?In:"Temperature")+"")&&D(Qe,$e),(!qe||_t[0]&512)&&r(Ge,"max",Be[9]),_t[0]&32&&st(Ge.value)!==Be[5].i.t.d&&Ee(Ge,Be[5].i.t.d),(!qe||_t[0]&4)&&vt!==(vt=((Un=(Fn=(Rn=Be[2].conf)==null?void 0:Rn.hw)==null?void 0:Fn.temp_analog)!=null?Un:"Analog temp")+"")&&D(Mt,vt),(!qe||_t[0]&512)&&r(be,"max",Be[9]),_t[0]&32&&st(be.value)!==Be[5].i.t.a&&Ee(be,Be[5].i.t.a),Be[0].chip!="esp8266"?ft?ft.p(Be,_t):(ft=Pa(Be),ft.c(),ft.m(F,Ce)):ft&&(ft.d(1),ft=null),((Hn=(jn=(Bn=Be[5])==null?void 0:Bn.i)==null?void 0:jn.v)==null?void 0:Hn.p)>0?ut?ut.p(Be,_t):(ut=Aa(Be),ut.c(),ut.m(F,null)):ut&&(ut.d(1),ut=null)},i(Be){qe||($(f.$$.fragment,Be),$(O.$$.fragment,Be),qe=!0)},o(Be){fe(f.$$.fragment,Be),fe(O.$$.fragment,Be),qe=!1},d(Be){Be&&A(e),Be&&A(l),Be&&A(n),Le(f),Le(O),Be&&A(V),Be&&A(F),ft&&ft.d(),ut&&ut.d(),pt=!1,zt(at)}}}function Pa(t){var u,f,p,v;let e,l=((v=(p=(f=(u=t[2].conf)==null?void 0:u.hw)==null?void 0:f.vcc)==null?void 0:p.title)!=null?v:"Vcc")+"",n,i,o,a,c,_;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),r(a,"name","ivp"),r(a,"type","number"),r(a,"min","0"),r(a,"max",t[9]),r(a,"class","in-s tr w-full"),r(e,"class","my-1 pl-1 w-1/3")},m(d,h){q(d,e,h),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].i.v.p),c||(_=ve(a,"input",t[98]),c=!0)},p(d,h){var g,k,T,O;h[0]&4&&l!==(l=((O=(T=(k=(g=d[2].conf)==null?void 0:g.hw)==null?void 0:k.vcc)==null?void 0:T.title)!=null?O:"Vcc")+"")&&D(n,l),h[0]&512&&r(a,"max",d[9]),h[0]&32&&st(a.value)!==d[5].i.v.p&&Ee(a,d[5].i.v.p)},d(d){d&&A(e),c=!1,_()}}}function Aa(t){var h,g,k,T;let e,l=((T=(k=(g=(h=t[2].conf)==null?void 0:h.hw)==null?void 0:g.vcc)==null?void 0:k.divider)!=null?T:"Voltage divider")+"",n,i,o,a,c,_,u,f,p,v,d;return{c(){var O,E,I,N,B,S,j,z;e=m("div"),n=M(l),i=m("br"),o=b(),a=m("div"),c=m("input"),u=b(),f=m("input"),r(c,"name","ivdv"),r(c,"type","number"),r(c,"min","0"),r(c,"max","65535"),r(c,"class","in-f tr w-full"),r(c,"placeholder",_=(N=(I=(E=(O=t[2].conf)==null?void 0:O.hw)==null?void 0:E.vcc)==null?void 0:I.div_vcc)!=null?N:"VCC"),r(f,"name","ivdg"),r(f,"type","number"),r(f,"min","0"),r(f,"max","65535"),r(f,"class","in-l tr w-full"),r(f,"placeholder",p=(z=(j=(S=(B=t[2].conf)==null?void 0:B.hw)==null?void 0:S.vcc)==null?void 0:j.div_gnd)!=null?z:"GND"),r(a,"class","flex"),r(e,"class","my-1")},m(O,E){q(O,e,E),s(e,n),s(e,i),s(e,o),s(e,a),s(a,c),Ee(c,t[5].i.v.d.v),s(a,u),s(a,f),Ee(f,t[5].i.v.d.g),v||(d=[ve(c,"input",t[99]),ve(f,"input",t[100])],v=!0)},p(O,E){var I,N,B,S,j,z,V,F,R,G,U,H;E[0]&4&&l!==(l=((S=(B=(N=(I=O[2].conf)==null?void 0:I.hw)==null?void 0:N.vcc)==null?void 0:B.divider)!=null?S:"Voltage divider")+"")&&D(n,l),E[0]&4&&_!==(_=(F=(V=(z=(j=O[2].conf)==null?void 0:j.hw)==null?void 0:z.vcc)==null?void 0:V.div_vcc)!=null?F:"VCC")&&r(c,"placeholder",_),E[0]&32&&st(c.value)!==O[5].i.v.d.v&&Ee(c,O[5].i.v.d.v),E[0]&4&&p!==(p=(H=(U=(G=(R=O[2].conf)==null?void 0:R.hw)==null?void 0:G.vcc)==null?void 0:U.div_gnd)!=null?H:"GND")&&r(f,"placeholder",p),E[0]&32&&st(f.value)!==O[5].i.v.d.g&&Ee(f,O[5].i.v.d.g)},d(O){O&&A(e),v=!1,zt(d)}}}function qa(t){var h,g,k,T,O,E,I,N,B,S,j,z,V,F,R;let e,l=((O=(T=(k=(g=(h=t[2].conf)==null?void 0:h.hw)==null?void 0:g.led)==null?void 0:k.behaviour)==null?void 0:T.title)!=null?O:"LED behaviour")+"",n,i,o,a,c=((S=(B=(N=(I=(E=t[2].conf)==null?void 0:E.hw)==null?void 0:I.led)==null?void 0:N.behaviour)==null?void 0:B.enabled)!=null?S:"Enabled")+"",_,u,f=((R=(F=(V=(z=(j=t[2].conf)==null?void 0:j.hw)==null?void 0:z.led)==null?void 0:V.behaviour)==null?void 0:F.disabled)!=null?R:"Disabled")+"",p,v,d;return{c(){e=m("div"),n=M(l),i=b(),o=m("select"),a=m("option"),_=M(c),u=m("option"),p=M(f),a.__value=0,a.value=a.__value,u.__value=1,u.value=u.__value,r(o,"name","idb"),r(o,"class","in-s"),t[5].i.d.b===void 0&&Gt(()=>t[101].call(o)),r(e,"class","my-1 w-full")},m(G,U){q(G,e,U),s(e,n),s(e,i),s(e,o),s(o,a),s(a,_),s(o,u),s(u,p),ot(o,t[5].i.d.b,!0),v||(d=ve(o,"change",t[101]),v=!0)},p(G,U){var H,W,K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x;U[0]&4&&l!==(l=((J=(Q=(K=(W=(H=G[2].conf)==null?void 0:H.hw)==null?void 0:W.led)==null?void 0:K.behaviour)==null?void 0:Q.title)!=null?J:"LED behaviour")+"")&&D(n,l),U[0]&4&&c!==(c=((ne=(oe=(X=(Z=(ae=G[2].conf)==null?void 0:ae.hw)==null?void 0:Z.led)==null?void 0:X.behaviour)==null?void 0:oe.enabled)!=null?ne:"Enabled")+"")&&D(_,c),U[0]&4&&f!==(f=((x=(Y=(me=(re=(ie=G[2].conf)==null?void 0:ie.hw)==null?void 0:re.led)==null?void 0:me.behaviour)==null?void 0:Y.disabled)!=null?x:"Disabled")+"")&&D(p,f),U[0]&32&&ot(o,G[5].i.d.b)},d(G){G&&A(e),v=!1,d()}}}function Da(t){var N,B,S,j,z,V,F,R;let e,l,n,i,o=((j=(S=(B=(N=t[2].conf)==null?void 0:N.hw)==null?void 0:B.vcc)==null?void 0:S.offset)!=null?j:"Vcc offset")+"",a,c,_,u,f,p,v=((R=(F=(V=(z=t[2].conf)==null?void 0:z.hw)==null?void 0:V.vcc)==null?void 0:F.multiplier)!=null?R:"Multiplier")+"",d,h,g,k,T,O,E,I=(t[0].board==2||t[0].board==100)&&La(t);return{c(){e=m("input"),l=b(),n=m("div"),i=m("div"),a=M(o),c=m("br"),_=b(),u=m("input"),f=b(),p=m("div"),d=M(v),h=m("br"),g=b(),k=m("input"),T=b(),I&&I.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(u,"name","ivo"),r(u,"type","number"),r(u,"min","0.0"),r(u,"max","3.5"),r(u,"step","0.01"),r(u,"class","in-f tr w-full"),r(i,"class","w-1/3"),r(k,"name","ivm"),r(k,"type","number"),r(k,"min","0.1"),r(k,"max","10"),r(k,"step","0.01"),r(k,"class","in-l tr w-full"),r(p,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(G,U){q(G,e,U),q(G,l,U),q(G,n,U),s(n,i),s(i,a),s(i,c),s(i,_),s(i,u),Ee(u,t[5].i.v.o),s(n,f),s(n,p),s(p,d),s(p,h),s(p,g),s(p,k),Ee(k,t[5].i.v.m),s(n,T),I&&I.m(n,null),O||(E=[ve(u,"input",t[102]),ve(k,"input",t[103])],O=!0)},p(G,U){var H,W,K,Q,J,ae,Z,X;U[0]&4&&o!==(o=((Q=(K=(W=(H=G[2].conf)==null?void 0:H.hw)==null?void 0:W.vcc)==null?void 0:K.offset)!=null?Q:"Vcc offset")+"")&&D(a,o),U[0]&32&&st(u.value)!==G[5].i.v.o&&Ee(u,G[5].i.v.o),U[0]&4&&v!==(v=((X=(Z=(ae=(J=G[2].conf)==null?void 0:J.hw)==null?void 0:ae.vcc)==null?void 0:Z.multiplier)!=null?X:"Multiplier")+"")&&D(d,v),U[0]&32&&st(k.value)!==G[5].i.v.m&&Ee(k,G[5].i.v.m),G[0].board==2||G[0].board==100?I?I.p(G,U):(I=La(G),I.c(),I.m(n,null)):I&&(I.d(1),I=null)},d(G){G&&A(e),G&&A(l),G&&A(n),I&&I.d(),O=!1,zt(E)}}}function La(t){var u,f,p,v;let e,l=((v=(p=(f=(u=t[2].conf)==null?void 0:u.hw)==null?void 0:f.vcc)==null?void 0:p.boot)!=null?v:"Boot limit")+"",n,i,o,a,c,_;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),r(a,"name","ivb"),r(a,"type","number"),r(a,"min","2.5"),r(a,"max","3.5"),r(a,"step","0.1"),r(a,"class","in-s tr w-full"),r(e,"class","w-1/3 pl-1")},m(d,h){q(d,e,h),s(e,n),s(e,i),s(e,o),s(e,a),Ee(a,t[5].i.v.b),c||(_=ve(a,"input",t[104]),c=!0)},p(d,h){var g,k,T,O;h[0]&4&&l!==(l=((O=(T=(k=(g=d[2].conf)==null?void 0:g.hw)==null?void 0:k.vcc)==null?void 0:T.boot)!=null?O:"Boot limit")+"")&&D(n,l),h[0]&32&&st(a.value)!==d[5].i.v.b&&Ee(a,d[5].i.v.b)},d(d){d&&A(e),c=!1,_()}}}function Oa(t){var I,N,B,S,j,z,V,F;let e,l,n=((B=(N=(I=t[2].conf)==null?void 0:I.debug)==null?void 0:N.title)!=null?B:"Debugging")+"",i,o,a,c,_,u,f,p,v,d,h=((z=(j=(S=t[2].conf)==null?void 0:S.debug)==null?void 0:j.enable)!=null?z:"Enable debugging")+"",g,k,T,O,E=((F=(V=t[5])==null?void 0:V.d)==null?void 0:F.s)&&Ia(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("a"),a.textContent="\u24D8",c=b(),_=m("input"),u=b(),f=m("div"),p=m("label"),v=m("input"),d=b(),g=M(h),k=b(),E&&E.c(),r(l,"class","text-sm"),r(a,"href","https://amsleser.no/blog/post/24-telnet-debug"),r(a,"target","_blank"),r(a,"class","float-right"),r(_,"type","hidden"),r(_,"name","d"),_.value="true",r(v,"type","checkbox"),r(v,"name","ds"),v.__value="true",v.value=v.__value,r(v,"class","rounded mb-1"),r(f,"class","mt-3"),r(e,"class","cnt")},m(R,G){q(R,e,G),s(e,l),s(l,i),s(e,o),s(e,a),s(e,c),s(e,_),s(e,u),s(e,f),s(f,p),s(p,v),v.checked=t[5].d.s,s(p,d),s(p,g),s(e,k),E&&E.m(e,null),T||(O=ve(v,"change",t[105]),T=!0)},p(R,G){var U,H,W,K,Q,J,ae,Z;G[0]&4&&n!==(n=((W=(H=(U=R[2].conf)==null?void 0:U.debug)==null?void 0:H.title)!=null?W:"Debugging")+"")&&D(i,n),G[0]&32&&(v.checked=R[5].d.s),G[0]&4&&h!==(h=((J=(Q=(K=R[2].conf)==null?void 0:K.debug)==null?void 0:Q.enable)!=null?J:"Enable debugging")+"")&&D(g,h),(Z=(ae=R[5])==null?void 0:ae.d)!=null&&Z.s?E?E.p(R,G):(E=Ia(R),E.c(),E.m(e,null)):E&&(E.d(1),E=null)},d(R){R&&A(e),E&&E.d(),T=!1,O()}}}function Ia(t){var B,S,j,z,V,F;let e,l=((j=(S=(B=t[2].conf)==null?void 0:B.debug)==null?void 0:S.danger)!=null?j:"Disable when done")+"",n,i,o,a,c,_,u=((F=(V=(z=t[2].conf)==null?void 0:z.debug)==null?void 0:V.telnet)!=null?F:"Enable telnet")+"",f,p,v,d,h,g,k,T,O,E,I,N=t[5].d.t&&Ra(t);return{c(){e=m("div"),n=M(l),i=b(),o=m("div"),a=m("label"),c=m("input"),_=b(),f=M(u),p=b(),N&&N.c(),v=b(),d=m("div"),h=m("select"),g=m("option"),g.textContent="Verbose",k=m("option"),k.textContent="Debug",T=m("option"),T.textContent="Info",O=m("option"),O.textContent="Warning",r(e,"class","bd-red"),r(c,"type","checkbox"),r(c,"name","dt"),c.__value="true",c.value=c.__value,r(c,"class","rounded mb-1"),r(o,"class","my-1"),g.__value=1,g.value=g.__value,k.__value=2,k.value=k.__value,T.__value=3,T.value=T.__value,O.__value=4,O.value=O.__value,r(h,"name","dl"),r(h,"class","in-s"),t[5].d.l===void 0&&Gt(()=>t[107].call(h)),r(d,"class","my-1")},m(R,G){q(R,e,G),s(e,n),q(R,i,G),q(R,o,G),s(o,a),s(a,c),c.checked=t[5].d.t,s(a,_),s(a,f),q(R,p,G),N&&N.m(R,G),q(R,v,G),q(R,d,G),s(d,h),s(h,g),s(h,k),s(h,T),s(h,O),ot(h,t[5].d.l,!0),E||(I=[ve(c,"change",t[106]),ve(h,"change",t[107])],E=!0)},p(R,G){var U,H,W,K,Q,J;G[0]&4&&l!==(l=((W=(H=(U=R[2].conf)==null?void 0:U.debug)==null?void 0:H.danger)!=null?W:"Disable when done")+"")&&D(n,l),G[0]&32&&(c.checked=R[5].d.t),G[0]&4&&u!==(u=((J=(Q=(K=R[2].conf)==null?void 0:K.debug)==null?void 0:Q.telnet)!=null?J:"Enable telnet")+"")&&D(f,u),R[5].d.t?N?N.p(R,G):(N=Ra(R),N.c(),N.m(v.parentNode,v)):N&&(N.d(1),N=null),G[0]&32&&ot(h,R[5].d.l)},d(R){R&&A(e),R&&A(i),R&&A(o),R&&A(p),N&&N.d(R),R&&A(v),R&&A(d),E=!1,zt(I)}}}function Ra(t){var i,o,a;let e,l=((a=(o=(i=t[2].conf)==null?void 0:i.debug)==null?void 0:o.telnet_danger)!=null?a:"Disable when done")+"",n;return{c(){e=m("div"),n=M(l),r(e,"class","bd-red")},m(c,_){q(c,e,_),s(e,n)},p(c,_){var u,f,p;_[0]&4&&l!==(l=((p=(f=(u=c[2].conf)==null?void 0:u.debug)==null?void 0:f.telnet_danger)!=null?p:"Disable when done")+"")&&D(n,l)},d(c){c&&A(e)}}}function Fa(t){var v,d,h,g;let e,l,n=((d=(v=t[2].conf)==null?void 0:v.btn_reset)!=null?d:"Factory reset")+"",i,o,a,c,_=((g=(h=t[2].btn)==null?void 0:h.reboot)!=null?g:"Reboot")+"",u,f,p;return{c(){e=m("div"),l=m("button"),i=M(n),o=b(),a=m("div"),c=m("button"),u=M(_),r(l,"type","button"),r(l,"class","btn-red"),r(c,"type","button"),r(c,"class","btn-yellow"),r(a,"class","text-center")},m(k,T){q(k,e,T),s(e,l),s(l,i),q(k,o,T),q(k,a,T),s(a,c),s(c,u),f||(p=[ve(l,"click",t[11]),ve(c,"click",t[13])],f=!0)},p(k,T){var O,E,I,N;T[0]&4&&n!==(n=((E=(O=k[2].conf)==null?void 0:O.btn_reset)!=null?E:"Factory reset")+"")&&D(i,n),T[0]&4&&_!==(_=((N=(I=k[2].btn)==null?void 0:I.reboot)!=null?N:"Reboot")+"")&&D(u,_)},d(k){k&&A(e),k&&A(o),k&&A(a),f=!1,zt(p)}}}function Ua(t){var o,a;let e,l,n=((a=(o=t[2].btn)==null?void 0:o.save)!=null?a:"Save")+"",i;return{c(){e=m("div"),l=m("button"),i=M(n),r(l,"type","submit"),r(l,"class","btn-pri"),r(e,"class","text-right")},m(c,_){q(c,e,_),s(e,l),s(l,i)},p(c,_){var u,f;_[0]&4&&n!==(n=((f=(u=c[2].btn)==null?void 0:u.save)!=null?f:"Save")+"")&&D(i,n)},d(c){c&&A(e)}}}function lc(t){var me,Y,x,ke,pe,C,w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt;let e,l,n,i,o,a,c,_,u,f,p=((x=(Y=(me=t[5])==null?void 0:me.p)==null?void 0:Y.r)==null?void 0:x.startsWith("NO"))||((C=(pe=(ke=t[5])==null?void 0:ke.p)==null?void 0:pe.r)==null?void 0:C.startsWith("10YNO"))||((L=(P=(w=t[5])==null?void 0:w.p)==null?void 0:P.r)==null?void 0:L.startsWith("10Y1001A1001A4")),v,d,h,g,k,T,O,E,I,N,B,S,j,z,V,F,R,G=((y=t[5])==null?void 0:y.g)&&ea(t),U=((ee=t[5])==null?void 0:ee.m)&&ia(t),H=((le=t[5])==null?void 0:le.w)&&fa(t),W=((se=t[5])==null?void 0:se.n)&&ca(t),K=((_e=t[5])==null?void 0:_e.q)&&ma(t),Q=((Se=(Te=t[5])==null?void 0:Te.q)==null?void 0:Se.m)==3&&va(t),J=((Ne=(de=t[5])==null?void 0:de.q)==null?void 0:Ne.m)==4&&ha(t),ae=((ge=(we=t[5])==null?void 0:we.c)==null?void 0:ge.es)!=null&&ba(t),Z=p&&wa(t),X=((he=t[5])==null?void 0:he.u)&&Sa(t),oe=((Ue=(je=t[5])==null?void 0:je.i)==null?void 0:Ue.h)&&(((We=t[0])==null?void 0:We.board)>20||((Ze=t[0])==null?void 0:Ze.chip)=="esp8266"||((et=(Ye=(Je=t[5])==null?void 0:Je.i)==null?void 0:Ye.d)==null?void 0:et.d)>0)&&Ta(t),ne=((He=t[5])==null?void 0:He.d)&&Oa(t),ie=((Oe=t[1])==null?void 0:Oe.a)&&Fa(t),re=t[5]&&Ua(t);return E=new pl({props:{active:t[3],message:($e=(Pe=(ce=t[2].conf)==null?void 0:ce.mask)==null?void 0:Pe.loading)!=null?$e:"Loading"}}),N=new pl({props:{active:t[4],message:(ye=(mt=(Qe=t[2].conf)==null?void 0:Qe.mask)==null?void 0:mt.saving)!=null?ye:"Saving"}}),S=new pl({props:{active:t[7],message:(tt=(ze=(Ge=t[2].conf)==null?void 0:Ge.mask)==null?void 0:ze.reset)!=null?tt:"Factory reset"}}),z=new pl({props:{active:t[8],message:(dt=(Mt=(vt=t[2].conf)==null?void 0:vt.mask)==null?void 0:Mt.reset_done)!=null?dt:"Done"}}),{c(){e=m("form"),l=m("div"),G&&G.c(),n=b(),U&&U.c(),i=b(),H&&H.c(),o=b(),W&&W.c(),a=b(),K&&K.c(),c=b(),Q&&Q.c(),_=b(),J&&J.c(),u=b(),ae&&ae.c(),f=b(),Z&&Z.c(),v=b(),X&&X.c(),d=b(),oe&&oe.c(),h=b(),ne&&ne.c(),g=b(),k=m("div"),ie&&ie.c(),T=b(),re&&re.c(),O=b(),Re(E.$$.fragment),I=b(),Re(N.$$.fragment),B=b(),Re(S.$$.fragment),j=b(),Re(z.$$.fragment),r(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),r(k,"class","grid grid-cols-3 mt-3"),r(e,"autocomplete","off")},m(te,be){q(te,e,be),s(e,l),G&&G.m(l,null),s(l,n),U&&U.m(l,null),s(l,i),H&&H.m(l,null),s(l,o),W&&W.m(l,null),s(l,a),K&&K.m(l,null),s(l,c),Q&&Q.m(l,null),s(l,_),J&&J.m(l,null),s(l,u),ae&&ae.m(l,null),s(l,f),Z&&Z.m(l,null),s(l,v),X&&X.m(l,null),s(l,d),oe&&oe.m(l,null),s(l,h),ne&&ne.m(l,null),s(e,g),s(e,k),ie&&ie.m(k,null),s(k,T),re&&re.m(k,null),q(te,O,be),De(E,te,be),q(te,I,be),De(N,te,be),q(te,B,be),De(S,te,be),q(te,j,be),De(z,te,be),V=!0,F||(R=ve(e,"submit",_n(t[12])),F=!0)},p(te,be){var at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt,ue,Me,Ae,it,rt,At,Xt,Zt,el,tl,ll,nl,il,sl,ol,al,fl,ul,Ie,jt,rl,cl;(at=te[5])!=null&&at.g?G?(G.p(te,be),be[0]&32&&$(G,1)):(G=ea(te),G.c(),$(G,1),G.m(l,n)):G&&(gt(),fe(G,1,1,()=>{G=null}),kt()),(ft=te[5])!=null&&ft.m?U?U.p(te,be):(U=ia(te),U.c(),U.m(l,i)):U&&(U.d(1),U=null),(ut=te[5])!=null&&ut.w?H?H.p(te,be):(H=fa(te),H.c(),H.m(l,o)):H&&(H.d(1),H=null),(Et=te[5])!=null&&Et.n?W?(W.p(te,be),be[0]&32&&$(W,1)):(W=ca(te),W.c(),$(W,1),W.m(l,a)):W&&(gt(),fe(W,1,1,()=>{W=null}),kt()),(Ot=te[5])!=null&&Ot.q?K?(K.p(te,be),be[0]&32&&$(K,1)):(K=ma(te),K.c(),$(K,1),K.m(l,c)):K&&(gt(),fe(K,1,1,()=>{K=null}),kt()),((Pt=(St=te[5])==null?void 0:St.q)==null?void 0:Pt.m)==3?Q?Q.p(te,be):(Q=va(te),Q.c(),Q.m(l,_)):Q&&(Q.d(1),Q=null),((yt=(It=te[5])==null?void 0:It.q)==null?void 0:yt.m)==4?J?J.p(te,be):(J=ha(te),J.c(),J.m(l,u)):J&&(J.d(1),J=null),((ht=(Ct=te[5])==null?void 0:Ct.c)==null?void 0:ht.es)!=null?ae?(ae.p(te,be),be[0]&32&&$(ae,1)):(ae=ba(te),ae.c(),$(ae,1),ae.m(l,f)):ae&&(gt(),fe(ae,1,1,()=>{ae=null}),kt()),be[0]&32&&(p=((Wt=(Ut=(Lt=te[5])==null?void 0:Lt.p)==null?void 0:Ut.r)==null?void 0:Wt.startsWith("NO"))||((Bt=(Ke=(Ve=te[5])==null?void 0:Ve.p)==null?void 0:Ke.r)==null?void 0:Bt.startsWith("10YNO"))||((wt=(bt=(nt=te[5])==null?void 0:nt.p)==null?void 0:bt.r)==null?void 0:wt.startsWith("10Y1001A1001A4"))),p?Z?Z.p(te,be):(Z=wa(te),Z.c(),Z.m(l,v)):Z&&(Z.d(1),Z=null),(ue=te[5])!=null&&ue.u?X?X.p(te,be):(X=Sa(te),X.c(),X.m(l,d)):X&&(X.d(1),X=null),((Ae=(Me=te[5])==null?void 0:Me.i)==null?void 0:Ae.h)&&(((it=te[0])==null?void 0:it.board)>20||((rt=te[0])==null?void 0:rt.chip)=="esp8266"||((Zt=(Xt=(At=te[5])==null?void 0:At.i)==null?void 0:Xt.d)==null?void 0:Zt.d)>0)?oe?(oe.p(te,be),be[0]&33&&$(oe,1)):(oe=Ta(te),oe.c(),$(oe,1),oe.m(l,h)):oe&&(gt(),fe(oe,1,1,()=>{oe=null}),kt()),(el=te[5])!=null&&el.d?ne?ne.p(te,be):(ne=Oa(te),ne.c(),ne.m(l,null)):ne&&(ne.d(1),ne=null),(tl=te[1])!=null&&tl.a?ie?ie.p(te,be):(ie=Fa(te),ie.c(),ie.m(k,T)):ie&&(ie.d(1),ie=null),te[5]?re?re.p(te,be):(re=Ua(te),re.c(),re.m(k,null)):re&&(re.d(1),re=null);const Tt={};be[0]&8&&(Tt.active=te[3]),be[0]&4&&(Tt.message=(il=(nl=(ll=te[2].conf)==null?void 0:ll.mask)==null?void 0:nl.loading)!=null?il:"Loading"),E.$set(Tt);const Ce={};be[0]&16&&(Ce.active=te[4]),be[0]&4&&(Ce.message=(al=(ol=(sl=te[2].conf)==null?void 0:sl.mask)==null?void 0:ol.saving)!=null?al:"Saving"),N.$set(Ce);const qe={};be[0]&128&&(qe.active=te[7]),be[0]&4&&(qe.message=(Ie=(ul=(fl=te[2].conf)==null?void 0:fl.mask)==null?void 0:ul.reset)!=null?Ie:"Factory reset"),S.$set(qe);const pt={};be[0]&256&&(pt.active=te[8]),be[0]&4&&(pt.message=(cl=(rl=(jt=te[2].conf)==null?void 0:jt.mask)==null?void 0:rl.reset_done)!=null?cl:"Done"),z.$set(pt)},i(te){V||($(G),$(W),$(K),$(ae),$(oe),$(E.$$.fragment,te),$(N.$$.fragment,te),$(S.$$.fragment,te),$(z.$$.fragment,te),V=!0)},o(te){fe(G),fe(W),fe(K),fe(ae),fe(oe),fe(E.$$.fragment,te),fe(N.$$.fragment,te),fe(S.$$.fragment,te),fe(z.$$.fragment,te),V=!1},d(te){te&&A(e),G&&G.d(),U&&U.d(),H&&H.d(),W&&W.d(),K&&K.d(),Q&&Q.d(),J&&J.d(),ae&&ae.d(),Z&&Z.d(),X&&X.d(),oe&&oe.d(),ne&&ne.d(),ie&&ie.d(),re&&re.d(),te&&A(O),Le(E,te),te&&A(I),Le(N,te),te&&A(B),Le(S,te),te&&A(j),Le(z,te),F=!1,R()}}}async function nc(){await(await fetch("reboot",{method:"POST"})).json()}function ic(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,{data:o}=e,a={};vl.subscribe(ue=>{l(2,a=ue)});let c=[{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"}],_=!0,u=!1,f,p=[];Wn.subscribe(ue=>{var Me,Ae,it;ue.version&&(l(5,f=ue),l(3,_=!1),l(6,p=[{code:"en",name:"English"}]),((Me=f==null?void 0:f.u)==null?void 0:Me.lang)&&f.u.lang!="en"&&p.push({code:f.u.lang,name:(it=(Ae=a.language)==null?void 0:Ae.name)!=null?it:"Unknown"}),p.push({code:"hub",name:"Load from server"}))}),k0();let v=!1,d=!1;async function h(){if(confirm("Factory reset?")){l(7,v=!0);const ue=new URLSearchParams;ue.append("perform","true");let Ae=await(await fetch("reset",{method:"POST",body:ue})).json();l(7,v=!1),l(8,d=Ae.success)}}async function g(ue){l(4,u=!0);const Me=new FormData(ue.target),Ae=new URLSearchParams;for(let At of Me){const[Xt,Zt]=At;Ae.append(Xt,Zt)}let rt=await(await fetch("save",{method:"POST",body:Ae})).json();dl.update(At=>(At.hostname=Me.get("gh"),At.usrcfg=rt.success,At.booting=rt.reboot,Me.get("nm")=="static"&&(At.net.ip=Me.get("ni"),At.net.mask=Me.get("nu"),At.net.gw=Me.get("ng"),At.net.dns1=Me.get("nd")),At.ui=f.u,At)),l(4,u=!1),en(n)}const k=function(){confirm("Reboot?")&&(dl.update(ue=>(ue.booting=!0,ue)),nc())};async function T(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),Wn.update(Me=>(Me.q.s.c=!1,Me)))}async function O(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),Wn.update(Me=>(Me.q.s.r=!1,Me)))}async function E(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),Wn.update(Me=>(Me.q.s.k=!1,Me)))}const I=function(){f.q.s.e?f.q.p==1883&&l(5,f.q.p=8883,f):f.q.p==8883&&l(5,f.q.p=1883,f)};async function N(){if(f.u.lang=="hub"){const ue=await Al("http://hub.amsleser.no/hub/language/list.json");l(6,p=await ue.json()),l(5,f.u.lang=a.language.code,f)}}let B=44;function S(){f.g.h=this.value,l(5,f)}function j(){f.g.t=Kt(this),l(5,f)}function z(){f.p.r=Kt(this),l(5,f)}function V(){f.p.c=Kt(this),l(5,f)}function F(){f.p.e=this.checked,l(5,f)}function R(){f.p.t=this.value,l(5,f)}function G(){f.g.s=Kt(this),l(5,f)}function U(){f.g.u=this.value,l(5,f)}function H(){f.g.p=this.value,l(5,f)}function W(){f.g.c=this.value,l(5,f)}function K(){f.m.a=Kt(this),l(5,f)}function Q(){f.m.b=st(this.value),l(5,f)}function J(){f.m.i=this.checked,l(5,f)}function ae(){f.m.b=Kt(this),l(5,f)}function Z(){f.m.p=Kt(this),l(5,f)}function X(){f.m.s=st(this.value),l(5,f)}function oe(){f.m.d=Kt(this),l(5,f)}function ne(){f.m.f=st(this.value),l(5,f)}function ie(){f.m.r=st(this.value),l(5,f)}function re(){f.m.e.e=this.checked,l(5,f)}function me(){f.m.e.k=this.value,l(5,f)}function Y(){f.m.e.a=this.value,l(5,f)}function x(){f.m.m.e=this.checked,l(5,f)}function ke(){f.m.m.w=st(this.value),l(5,f)}function pe(){f.m.m.v=st(this.value),l(5,f)}function C(){f.m.m.a=st(this.value),l(5,f)}function w(){f.m.m.c=st(this.value),l(5,f)}function P(){f.n.c=Kt(this),l(5,f)}function L(){f.w.s=this.value,l(5,f)}function y(){f.w.p=this.value,l(5,f)}function ee(){f.w.z=Kt(this),l(5,f)}function le(){f.w.w=st(this.value),l(5,f)}function se(){f.w.b=this.checked,l(5,f)}function _e(){f.n.m=Kt(this),l(5,f)}function Te(){f.n.i=this.value,l(5,f)}function Se(){f.n.s=Kt(this),l(5,f)}function de(){f.n.g=this.value,l(5,f)}function Ne(){f.n.d1=this.value,l(5,f)}function we(){f.n.d2=this.value,l(5,f)}function ge(){f.n.x=this.checked,l(5,f)}function he(){f.n.d=this.checked,l(5,f)}function je(){f.n.h=this.checked,l(5,f)}function Ue(){f.n.n1=this.value,l(5,f)}function We(){f.q.s.e=this.checked,l(5,f)}function Ze(){f.q.h=this.value,l(5,f)}function Je(){f.q.p=st(this.value),l(5,f)}function Ye(){f.q.u=this.value,l(5,f)}function et(){f.q.a=this.value,l(5,f)}function He(){f.q.c=this.value,l(5,f)}function Oe(){f.q.m=Kt(this),l(5,f)}function ce(){f.q.b=this.value,l(5,f)}function Pe(){f.o.e=this.value,l(5,f)}function $e(){f.o.c=this.value,l(5,f)}function Qe(){f.o.u1=this.value,l(5,f)}function mt(){f.o.u2=this.value,l(5,f)}function ye(){f.o.u3=this.value,l(5,f)}function Ge(){f.h.t=this.value,l(5,f)}function ze(){f.h.h=this.value,l(5,f)}function tt(){f.h.n=this.value,l(5,f)}function vt(){f.c.e=this.checked,l(5,f)}function Mt(){f.c.es=this.checked,l(5,f)}function dt(ue){f.t.t[ue]=st(this.value),l(5,f)}function te(){f.t.h=st(this.value),l(5,f)}function be(ue){f.u[ue.key]=Kt(this),l(5,f)}function Tt(){f.u.lang=Kt(this),l(5,f)}function Ce(){f.i.h.p=Kt(this),l(5,f)}function qe(){f.i.h.t=Kt(this),l(5,f)}function pt(){f.i.h.u=this.checked,l(5,f)}function at(){f.i.a=st(this.value),l(5,f)}function ft(){f.i.l.p=st(this.value),l(5,f)}function ut(){f.i.l.i=this.checked,l(5,f)}function Et(){f.i.r.i=this.checked,l(5,f)}function Ot(){f.i.r.r=st(this.value),l(5,f)}function St(){f.i.r.g=st(this.value),l(5,f)}function Pt(){f.i.r.b=st(this.value),l(5,f)}function It(){f.i.d.d=st(this.value),l(5,f)}function yt(){f.i.t.d=st(this.value),l(5,f)}function Ct(){f.i.t.a=st(this.value),l(5,f)}function ht(){f.i.v.p=st(this.value),l(5,f)}function Lt(){f.i.v.d.v=st(this.value),l(5,f)}function Ut(){f.i.v.d.g=st(this.value),l(5,f)}function Wt(){f.i.d.b=Kt(this),l(5,f)}function Ve(){f.i.v.o=st(this.value),l(5,f)}function Ke(){f.i.v.m=st(this.value),l(5,f)}function Bt(){f.i.v.b=st(this.value),l(5,f)}function nt(){f.d.s=this.checked,l(5,f)}function bt(){f.d.t=this.checked,l(5,f)}function wt(){f.d.l=Kt(this),l(5,f)}return t.$$set=ue=>{"basepath"in ue&&l(19,n=ue.basepath),"sysinfo"in ue&&l(0,i=ue.sysinfo),"data"in ue&&l(1,o=ue.data)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(9,B=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39)},[i,o,a,_,u,f,p,v,d,B,c,h,g,k,T,O,E,I,N,n,S,j,z,V,F,R,G,U,H,W,K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y,x,ke,pe,C,w,P,L,y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe,$e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt,te,be,Tt,Ce,qe,pt,at,ft,ut,Et,Ot,St,Pt,It,yt,Ct,ht,Lt,Ut,Wt,Ve,Ke,Bt,nt,bt,wt]}class sc extends Dt{constructor(e){super(),qt(this,e,ic,lc,Nt,{basepath:19,sysinfo:0,data:1},null,[-1,-1,-1,-1])}}function Ba(t,e,l){const n=t.slice();return n[22]=e[l],n}function ja(t){let e,l=t[1].cpu+"",n,i;return{c(){e=M("("),n=M(l),i=M("MHz)")},m(o,a){q(o,e,a),q(o,n,a),q(o,i,a)},p(o,a){a&2&&l!==(l=o[1].cpu+"")&&D(n,l)},d(o){o&&A(e),o&&A(n),o&&A(i)}}}function oc(t){let e=xe(t[1].chip,t[1].board)+"",l;return{c(){l=M(e)},m(n,i){q(n,l,i)},p(n,i){i&2&&e!==(e=xe(n[1].chip,n[1].board)+"")&&D(l,e)},d(n){n&&A(l)}}}function Ha(t){var W,K,Q,J,ae,Z,X,oe,ne,ie,re,me;let e,l=((Q=(K=(W=t[3].status)==null?void 0:W.device)==null?void 0:K.apmac)!=null?Q:"AP MAC")+"",n,i,o=t[1].apmac+"",a,c,_,u=((Z=(ae=(J=t[3].status)==null?void 0:J.device)==null?void 0:ae.last_boot)!=null?Z:"Last boot")+"",f,p,v,d,h,g,k=((ne=(oe=(X=t[3].status)==null?void 0:X.device)==null?void 0:oe.reason)!=null?ne:"Reason")+"",T,O,E=((me=(re=(ie=t[3][As(t[1].chip)])==null?void 0:ie.reason)==null?void 0:re[t[1].boot_reason])!=null?me:t[1].boot_reason)+"",I,N,B=t[1].boot_reason+"",S,j,z=t[1].ex_cause+"",V,F,R;const G=[fc,ac],U=[];function H(Y,x){return Y[0].u>0?0:1}return v=H(t),d=U[v]=G[v](t),{c(){e=m("div"),n=M(l),i=M(": "),a=M(o),c=b(),_=m("div"),f=M(u),p=M(`: `),d.c(),h=b(),g=m("div"),T=M(k),O=M(": "),I=M(E),N=M(" ("),S=M(B),j=M("/"),V=M(z),F=M(")"),r(e,"class","my-2"),r(_,"class","my-2"),r(g,"class","my-2")},m(Y,x){q(Y,e,x),s(e,n),s(e,i),s(e,a),q(Y,c,x),q(Y,_,x),s(_,f),s(_,p),U[v].m(_,null),q(Y,h,x),q(Y,g,x),s(g,T),s(g,O),s(g,I),s(g,N),s(g,S),s(g,j),s(g,V),s(g,F),R=!0},p(Y,x){var pe,C,w,P,L,y,ee,le,se,_e,Te,Se;(!R||x&8)&&l!==(l=((w=(C=(pe=Y[3].status)==null?void 0:pe.device)==null?void 0:C.apmac)!=null?w:"AP MAC")+"")&&D(n,l),(!R||x&2)&&o!==(o=Y[1].apmac+"")&&D(a,o),(!R||x&8)&&u!==(u=((y=(L=(P=Y[3].status)==null?void 0:P.device)==null?void 0:L.last_boot)!=null?y:"Last boot")+"")&&D(f,u);let ke=v;v=H(Y),v===ke?U[v].p(Y,x):(gt(),fe(U[ke],1,1,()=>{U[ke]=null}),kt(),d=U[v],d?d.p(Y,x):(d=U[v]=G[v](Y),d.c()),$(d,1),d.m(_,null)),(!R||x&8)&&k!==(k=((se=(le=(ee=Y[3].status)==null?void 0:ee.device)==null?void 0:le.reason)!=null?se:"Reason")+"")&&D(T,k),(!R||x&10)&&E!==(E=((Se=(Te=(_e=Y[3][As(Y[1].chip)])==null?void 0:_e.reason)==null?void 0:Te[Y[1].boot_reason])!=null?Se:Y[1].boot_reason)+"")&&D(I,E),(!R||x&2)&&B!==(B=Y[1].boot_reason+"")&&D(S,B),(!R||x&2)&&z!==(z=Y[1].ex_cause+"")&&D(V,z)},i(Y){R||($(d),R=!0)},o(Y){fe(d),R=!1},d(Y){Y&&A(e),Y&&A(c),Y&&A(_),U[v].d(),Y&&A(h),Y&&A(g)}}}function ac(t){let e;return{c(){e=M("-")},m(l,n){q(l,e,n)},p:Xe,i:Xe,o:Xe,d(l){l&&A(e)}}}function fc(t){let e,l;return e=new Su({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function ya(t){var f,p;let e,l,n,i,o=((p=(f=t[3].btn)==null?void 0:f.reboot)!=null?p:"Reboot")+"",a,c,_,u;return l=new Ml({props:{to:"/consent",$$slots:{default:[uc]},$$scope:{ctx:t}}}),{c(){e=m("div"),Re(l.$$.fragment),n=b(),i=m("button"),a=M(o),r(i,"class","btn-yellow-sm float-right"),r(e,"class","my-2")},m(v,d){q(v,e,d),De(l,e,null),s(e,n),s(e,i),s(i,a),c=!0,_||(u=ve(i,"click",t[12]),_=!0)},p(v,d){var g,k;const h={};d&33554440&&(h.$$scope={dirty:d,ctx:v}),l.$set(h),(!c||d&8)&&o!==(o=((k=(g=v[3].btn)==null?void 0:g.reboot)!=null?k:"Reboot")+"")&&D(a,o)},i(v){c||($(l.$$.fragment,v),c=!0)},o(v){fe(l.$$.fragment,v),c=!1},d(v){v&&A(e),Le(l),_=!1,u()}}}function uc(t){var i,o,a;let e,l=((a=(o=(i=t[3].status)==null?void 0:i.device)==null?void 0:o.btn_consents)!=null?a:"Consents")+"",n;return{c(){e=m("span"),n=M(l),r(e,"class","btn-pri-sm")},m(c,_){q(c,e,_),s(e,n)},p(c,_){var u,f,p;_&8&&l!==(l=((p=(f=(u=c[3].status)==null?void 0:u.device)==null?void 0:f.btn_consents)!=null?p:"Consents")+"")&&D(n,l)},d(c){c&&A(e)}}}function za(t){var V,F,R,G,U,H,W,K,Q,J,ae,Z;let e,l,n=((R=(F=(V=t[3].status)==null?void 0:V.meter)==null?void 0:F.title)!=null?R:"Meter")+"",i,o,a,c=((H=(U=(G=t[3].status)==null?void 0:G.meter)==null?void 0:U.manufacturer)!=null?H:"Manufacturer")+"",_,u,f=_i(t[1].meter.mfg)+"",p,v,d,h=((Q=(K=(W=t[3].status)==null?void 0:W.meter)==null?void 0:K.model)!=null?Q:"Model")+"",g,k,T=(t[1].meter.model?t[1].meter.model:"unknown")+"",O,E,I,N=((Z=(ae=(J=t[3].status)==null?void 0:J.meter)==null?void 0:ae.id)!=null?Z:"ID")+"",B,S,j=(t[1].meter.id?t[1].meter.id:"unknown")+"",z;return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("div"),_=M(c),u=M(": "),p=M(f),v=b(),d=m("div"),g=M(h),k=M(": "),O=M(T),E=b(),I=m("div"),B=M(N),S=M(": "),z=M(j),r(l,"class","text-sm"),r(a,"class","my-2"),r(d,"class","my-2"),r(I,"class","my-2"),r(e,"class","cnt")},m(X,oe){q(X,e,oe),s(e,l),s(l,i),s(e,o),s(e,a),s(a,_),s(a,u),s(a,p),s(e,v),s(e,d),s(d,g),s(d,k),s(d,O),s(e,E),s(e,I),s(I,B),s(I,S),s(I,z)},p(X,oe){var ne,ie,re,me,Y,x,ke,pe,C,w,P,L;oe&8&&n!==(n=((re=(ie=(ne=X[3].status)==null?void 0:ne.meter)==null?void 0:ie.title)!=null?re:"Meter")+"")&&D(i,n),oe&8&&c!==(c=((x=(Y=(me=X[3].status)==null?void 0:me.meter)==null?void 0:Y.manufacturer)!=null?x:"Manufacturer")+"")&&D(_,c),oe&2&&f!==(f=_i(X[1].meter.mfg)+"")&&D(p,f),oe&8&&h!==(h=((C=(pe=(ke=X[3].status)==null?void 0:ke.meter)==null?void 0:pe.model)!=null?C:"Model")+"")&&D(g,h),oe&2&&T!==(T=(X[1].meter.model?X[1].meter.model:"unknown")+"")&&D(O,T),oe&8&&N!==(N=((L=(P=(w=X[3].status)==null?void 0:w.meter)==null?void 0:P.id)!=null?L:"ID")+"")&&D(B,N),oe&2&&j!==(j=(X[1].meter.id?X[1].meter.id:"unknown")+"")&&D(z,j)},d(X){X&&A(e)}}}function Wa(t){var K,Q,J,ae,Z,X,oe,ne,ie,re,me,Y;let e,l,n=((J=(Q=(K=t[3].status)==null?void 0:K.network)==null?void 0:Q.title)!=null?J:"Network")+"",i,o,a,c=((X=(Z=(ae=t[3].conf)==null?void 0:ae.network)==null?void 0:Z.ip)!=null?X:"IP")+"",_,u,f=t[1].net.ip+"",p,v,d,h=((ie=(ne=(oe=t[3].conf)==null?void 0:oe.network)==null?void 0:ne.mask)!=null?ie:"Mask")+"",g,k,T=t[1].net.mask+"",O,E,I,N=((Y=(me=(re=t[3].conf)==null?void 0:re.network)==null?void 0:me.gw)!=null?Y:"Gateway")+"",B,S,j=t[1].net.gw+"",z,V,F,R,G,U=t[1].net.dns1&&Ga(t),H=t[1].net.dns2&&Va(t),W=t[1].net.ipv6&&Ka(t);return{c(){e=m("div"),l=m("strong"),i=M(n),o=b(),a=m("div"),_=M(c),u=M(": "),p=M(f),v=b(),d=m("div"),g=M(h),k=M(": "),O=M(T),E=b(),I=m("div"),B=M(N),S=M(": "),z=M(j),V=b(),F=m("div"),U&&U.c(),R=b(),H&&H.c(),G=b(),W&&W.c(),r(l,"class","text-sm"),r(a,"class","my-2"),r(d,"class","my-2"),r(I,"class","my-2"),r(F,"class","my-2"),r(e,"class","cnt")},m(x,ke){q(x,e,ke),s(e,l),s(l,i),s(e,o),s(e,a),s(a,_),s(a,u),s(a,p),s(e,v),s(e,d),s(d,g),s(d,k),s(d,O),s(e,E),s(e,I),s(I,B),s(I,S),s(I,z),s(e,V),s(e,F),U&&U.m(F,null),s(F,R),H&&H.m(F,null),s(e,G),W&&W.m(e,null)},p(x,ke){var pe,C,w,P,L,y,ee,le,se,_e,Te,Se;ke&8&&n!==(n=((w=(C=(pe=x[3].status)==null?void 0:pe.network)==null?void 0:C.title)!=null?w:"Network")+"")&&D(i,n),ke&8&&c!==(c=((y=(L=(P=x[3].conf)==null?void 0:P.network)==null?void 0:L.ip)!=null?y:"IP")+"")&&D(_,c),ke&2&&f!==(f=x[1].net.ip+"")&&D(p,f),ke&8&&h!==(h=((se=(le=(ee=x[3].conf)==null?void 0:ee.network)==null?void 0:le.mask)!=null?se:"Mask")+"")&&D(g,h),ke&2&&T!==(T=x[1].net.mask+"")&&D(O,T),ke&8&&N!==(N=((Se=(Te=(_e=x[3].conf)==null?void 0:_e.network)==null?void 0:Te.gw)!=null?Se:"Gateway")+"")&&D(B,N),ke&2&&j!==(j=x[1].net.gw+"")&&D(z,j),x[1].net.dns1?U?U.p(x,ke):(U=Ga(x),U.c(),U.m(F,R)):U&&(U.d(1),U=null),x[1].net.dns2?H?H.p(x,ke):(H=Va(x),H.c(),H.m(F,null)):H&&(H.d(1),H=null),x[1].net.ipv6?W?W.p(x,ke):(W=Ka(x),W.c(),W.m(e,null)):W&&(W.d(1),W=null)},d(x){x&&A(e),U&&U.d(),H&&H.d(),W&&W.d()}}}function Ga(t){var a,c,_;let e=((_=(c=(a=t[3].conf)==null?void 0:a.network)==null?void 0:c.dns)!=null?_:"DNS")+"",l,n,i=t[1].net.dns1+"",o;return{c(){l=M(e),n=M(": "),o=M(i)},m(u,f){q(u,l,f),q(u,n,f),q(u,o,f)},p(u,f){var p,v,d;f&8&&e!==(e=((d=(v=(p=u[3].conf)==null?void 0:p.network)==null?void 0:v.dns)!=null?d:"DNS")+"")&&D(l,e),f&2&&i!==(i=u[1].net.dns1+"")&&D(o,i)},d(u){u&&A(l),u&&A(n),u&&A(o)}}}function Va(t){var a,c,_;let e=((_=(c=(a=t[3].conf)==null?void 0:a.network)==null?void 0:c.dns)!=null?_:"DNS")+"",l,n,i=t[1].net.dns2+"",o;return{c(){l=M(e),n=M(": "),o=M(i)},m(u,f){q(u,l,f),q(u,n,f),q(u,o,f)},p(u,f){var p,v,d;f&8&&e!==(e=((d=(v=(p=u[3].conf)==null?void 0:p.network)==null?void 0:v.dns)!=null?d:"DNS")+"")&&D(l,e),f&2&&i!==(i=u[1].net.dns2+"")&&D(o,i)},d(u){u&&A(l),u&&A(n),u&&A(o)}}}function Ka(t){let e,l,n=t[1].net.ipv6+"",i,o,a,c,_=t[1].net.dns1v6&&Ya(t),u=t[1].net.dns2v6&&Qa(t);return{c(){e=m("div"),l=M("IPv6: "),i=M(n),o=b(),a=m("div"),_&&_.c(),c=b(),u&&u.c(),r(e,"class","my-2"),r(a,"class","my-2")},m(f,p){q(f,e,p),s(e,l),s(e,i),q(f,o,p),q(f,a,p),_&&_.m(a,null),s(a,c),u&&u.m(a,null)},p(f,p){p&2&&n!==(n=f[1].net.ipv6+"")&&D(i,n),f[1].net.dns1v6?_?_.p(f,p):(_=Ya(f),_.c(),_.m(a,c)):_&&(_.d(1),_=null),f[1].net.dns2v6?u?u.p(f,p):(u=Qa(f),u.c(),u.m(a,null)):u&&(u.d(1),u=null)},d(f){f&&A(e),f&&A(o),f&&A(a),_&&_.d(),u&&u.d()}}}function Ya(t){let e,l=t[1].net.dns1v6+"",n;return{c(){e=M("DNSv6: "),n=M(l)},m(i,o){q(i,e,o),q(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns1v6+"")&&D(n,l)},d(i){i&&A(e),i&&A(n)}}}function Qa(t){let e,l=t[1].net.dns2v6+"",n;return{c(){e=M("DNSv6: "),n=M(l)},m(i,o){q(i,e,o),q(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2v6+"")&&D(n,l)},d(i){i&&A(e),i&&A(n)}}}function Xa(t){var _,u,f,p,v,d;let e,l,n=((f=(u=(_=t[3].status)==null?void 0:_.firmware)==null?void 0:u.failed)!=null?f:"Upgrade from {0} to {1} failed").replace("{0}",t[1].upgrade.f).replace("{1}",t[1].upgrade.t)+"",i,o,a=((d=(v=(p=t[3].errors)==null?void 0:p.http)==null?void 0:v[t[1].upgrade.e])!=null?d:t[1].upgrade.e)+"",c;return{c(){e=m("div"),l=m("div"),i=M(n),o=b(),c=M(a),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(h,g){q(h,e,g),s(e,l),s(l,i),s(l,o),s(l,c)},p(h,g){var k,T,O,E,I,N;g&10&&n!==(n=((O=(T=(k=h[3].status)==null?void 0:k.firmware)==null?void 0:T.failed)!=null?O:"Upgrade from {0} to {1} failed").replace("{0}",h[1].upgrade.f).replace("{1}",h[1].upgrade.t)+"")&&D(i,n),g&10&&a!==(a=((N=(I=(E=h[3].errors)==null?void 0:E.http)==null?void 0:I[h[1].upgrade.e])!=null?N:h[1].upgrade.e)+"")&&D(c,a)},d(h){h&&A(e)}}}function Za(t){var h,g,k;let e,l=((k=(g=(h=t[3].status)==null?void 0:h.firmware)==null?void 0:g.latest)!=null?k:"Latest")+"",n,i,o,a=t[4].tag_name+"",c,_,u,f,p,v=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[4]&&t[4].tag_name!=t[1].version&&Ja(t),d=t[1].fwconsent===2&&$a(t);return{c(){e=m("div"),n=M(l),i=M(`: `),o=m("a"),c=M(a),u=b(),v&&v.c(),f=b(),d&&d.c(),p=Qt(),r(o,"href",_=t[4].html_url),r(o,"class","ml-2 text-blue-600 hover:text-blue-800"),r(o,"target","_blank"),r(o,"rel","noreferrer"),r(e,"class","my-2 flex")},m(T,O){q(T,e,O),s(e,n),s(e,i),s(e,o),s(o,c),s(e,u),v&&v.m(e,null),q(T,f,O),d&&d.m(T,O),q(T,p,O)},p(T,O){var E,I,N;O&8&&l!==(l=((N=(I=(E=T[3].status)==null?void 0:E.firmware)==null?void 0:I.latest)!=null?N:"Latest")+"")&&D(n,l),O&16&&a!==(a=T[4].tag_name+"")&&D(c,a),O&16&&_!==(_=T[4].html_url)&&r(o,"href",_),(T[1].security==0||T[0].a)&&T[1].fwconsent===1&&T[4]&&T[4].tag_name!=T[1].version?v?v.p(T,O):(v=Ja(T),v.c(),v.m(e,null)):v&&(v.d(1),v=null),T[1].fwconsent===2?d?d.p(T,O):(d=$a(T),d.c(),d.m(p.parentNode,p)):d&&(d.d(1),d=null)},d(T){T&&A(e),v&&v.d(),T&&A(f),d&&d.d(T),T&&A(p)}}}function Ja(t){let e,l,n,i,o;return{c(){var a,c,_;e=m("div"),l=m("button"),l.textContent="\u21D3",r(e,"class","flex-none ml-2 text-green-500"),r(e,"title",n=(_=(c=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:c.install)!=null?_:"Install")},m(a,c){q(a,e,c),s(e,l),i||(o=ve(l,"click",t[11]),i=!0)},p(a,c){var _,u,f;c&8&&n!==(n=(f=(u=(_=a[3].status)==null?void 0:_.firmware)==null?void 0:u.install)!=null?f:"Install")&&r(e,"title",n)},d(a){a&&A(e),i=!1,o()}}}function $a(t){var o,a,c;let e,l,n=((c=(a=(o=t[3].status)==null?void 0:o.firmware)==null?void 0:a.no_one_click)!=null?c:"One-click upgrade disabled")+"",i;return{c(){e=m("div"),l=m("div"),i=M(n),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(_,u){q(_,e,u),s(e,l),s(l,i)},p(_,u){var f,p,v;u&8&&n!==(n=((v=(p=(f=_[3].status)==null?void 0:f.firmware)==null?void 0:p.no_one_click)!=null?v:"One-click upgrade disabled")+"")&&D(i,n)},d(_){_&&A(e)}}}function xa(t){let e,l=mi(xe(t[1].chip,t[1].board))+"",n;return{c(){e=m("div"),n=M(l),r(e,"class","bd-red")},m(i,o){q(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=mi(xe(i[1].chip,i[1].board))+"")&&D(n,l)},d(i){i&&A(e)}}}function ef(t){let e,l,n,i,o,a;function c(f,p){return f[6].length==0?cc:rc}let _=c(t),u=_(t);return{c(){e=m("div"),l=m("form"),n=m("input"),i=b(),u.c(),Gn(n,"display","none"),r(n,"name","file"),r(n,"type","file"),r(n,"accept",".bin"),r(l,"action","/firmware"),r(l,"enctype","multipart/form-data"),r(l,"method","post"),r(l,"autocomplete","off"),r(e,"class","my-2 flex")},m(f,p){q(f,e,p),s(e,l),s(l,n),t[14](n),s(l,i),u.m(l,null),o||(a=[ve(n,"change",t[15]),ve(l,"submit",t[17])],o=!0)},p(f,p){_===(_=c(f))&&u?u.p(f,p):(u.d(1),u=_(f),u&&(u.c(),u.m(l,null)))},d(f){f&&A(e),t[14](null),u.d(),o=!1,zt(a)}}}function rc(t){var c,_;let e=t[6][0].name+"",l,n,i,o=((_=(c=t[3].btn)==null?void 0:c.upload)!=null?_:"Upload")+"",a;return{c(){l=M(e),n=b(),i=m("button"),a=M(o),r(i,"type","submit"),r(i,"class","btn-pri-sm float-right ml-2")},m(u,f){q(u,l,f),q(u,n,f),q(u,i,f),s(i,a)},p(u,f){var p,v;f&64&&e!==(e=u[6][0].name+"")&&D(l,e),f&8&&o!==(o=((v=(p=u[3].btn)==null?void 0:p.upload)!=null?v:"Upload")+"")&&D(a,o)},d(u){u&&A(l),u&&A(n),u&&A(i)}}}function cc(t){var a,c,_;let e,l=((_=(c=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:c.btn_select_file)!=null?_:"Select file")+"",n,i,o;return{c(){e=m("button"),n=M(l),r(e,"type","button"),r(e,"class","btn-pri-sm float-right")},m(u,f){q(u,e,f),s(e,n),i||(o=ve(e,"click",t[16]),i=!0)},p(u,f){var p,v,d;f&8&&l!==(l=((d=(v=(p=u[3].status)==null?void 0:p.firmware)==null?void 0:v.btn_select_file)!=null?d:"Select file")+"")&&D(n,l)},d(u){u&&A(e),i=!1,o()}}}function tf(t){var H,W,K,Q,J,ae,Z,X,oe;let e,l,n=((K=(W=(H=t[3].status)==null?void 0:H.backup)==null?void 0:W.title)!=null?K:"Backup")+"",i,o,a,c,_,u,f,p,v=((ae=(J=(Q=t[3].status)==null?void 0:Q.backup)==null?void 0:J.secrets)!=null?ae:"Include secrets")+"",d,h,g,k=((oe=(X=(Z=t[3].status)==null?void 0:Z.backup)==null?void 0:X.secrets_desc)!=null?oe:"")+"",T,O,E,I,N,B,S,j,z=t[10],V=[];for(let ne=0;ne{se=null}),kt()),(Wt=Ce[0])!=null&&Wt.a?_e?(_e.p(Ce,qe),qe&1&&$(_e,1)):(_e=ya(Ce),_e.c(),$(_e,1),_e.m(l,null)):_e&&(gt(),fe(_e,1,1,()=>{_e=null}),kt()),Ce[1].meter?Te?Te.p(Ce,qe):(Te=za(Ce),Te.c(),Te.m(e,U)):Te&&(Te.d(1),Te=null),Ce[1].net?Se?Se.p(Ce,qe):(Se=Wa(Ce),Se.c(),Se.m(e,H)):Se&&(Se.d(1),Se=null),(!ee||qe&8)&&Q!==(Q=((Bt=(Ke=(Ve=Ce[3].status)==null?void 0:Ve.firmware)==null?void 0:Ke.title)!=null?Bt:"Firmware")+"")&&D(J,Q),(!ee||qe&8)&&X!==(X=((wt=(bt=(nt=Ce[3].status)==null?void 0:nt.firmware)==null?void 0:bt.installed)!=null?wt:"Installed")+"")&&D(oe,X),(!ee||qe&2)&&ie!==(ie=Ce[1].version+"")&&D(re,ie),Ce[1].upgrade.t&&Ce[1].upgrade.t!=Ce[1].version?de?de.p(Ce,qe):(de=Xa(Ce),de.c(),de.m(W,Y)):de&&(de.d(1),de=null),Ce[4]?Ne?Ne.p(Ce,qe):(Ne=Za(Ce),Ne.c(),Ne.m(W,x)):Ne&&(Ne.d(1),Ne=null),qe&3&&(ke=(Ce[1].security==0||Ce[0].a)&&fn(Ce[1].board)),ke?we?we.p(Ce,qe):(we=xa(Ce),we.c(),we.m(W,pe)):we&&(we.d(1),we=null),Ce[1].security==0||Ce[0].a?ge?ge.p(Ce,qe):(ge=ef(Ce),ge.c(),ge.m(W,null)):ge&&(ge.d(1),ge=null),Ce[1].security==0||Ce[0].a?he?he.p(Ce,qe):(he=tf(Ce),he.c(),he.m(e,null)):he&&(he.d(1),he=null);const at={};qe&128&&(at.active=Ce[7]),qe&8&&(at.message=(Ae=(Me=(ue=Ce[3].status)==null?void 0:ue.mask)==null?void 0:Me.firmware)!=null?Ae:"Uploading"),P.$set(at);const ft={};qe&512&&(ft.active=Ce[9]),qe&8&&(ft.message=(At=(rt=(it=Ce[3].status)==null?void 0:it.mask)==null?void 0:rt.config)!=null?At:"Uploading"),y.$set(ft)},i(Ce){ee||($(E.$$.fragment,Ce),$(se),$(_e),$(P.$$.fragment,Ce),$(y.$$.fragment,Ce),ee=!0)},o(Ce){fe(E.$$.fragment,Ce),fe(se),fe(_e),fe(P.$$.fragment,Ce),fe(y.$$.fragment,Ce),ee=!1},d(Ce){Ce&&A(e),le&&le.d(),Le(E),se&&se.d(),_e&&_e.d(),Te&&Te.d(),Se&&Se.d(),de&&de.d(),Ne&&Ne.d(),we&&we.d(),ge&&ge.d(),he&&he.d(),Ce&&A(w),Le(P,Ce),Ce&&A(L),Le(y,Ce)}}}async function dc(){await(await fetch("reboot",{method:"POST"})).json()}function vc(t,e,l){let{data:n}=e,{sysinfo:i}=e,o=[{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={};vl.subscribe(z=>{l(3,a=z)});let c={};ts.subscribe(z=>{l(4,c=Mu(i.version,z)),c||l(4,c=z[0])});function _(){var z,V;confirm(((V=(z=a.header)==null?void 0:z.upgrade)!=null?V:"Upgrade to {0}?").replace("{0}",c.tag_name))&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(mi(xe(i.chip,i.board))))&&(dl.update(F=>(F.upgrading=!0,F)),wu(c.tag_name))}const u=function(){var z,V;confirm((V=(z=a.device)==null?void 0:z.reboot_confirm)!=null?V:"Reboot?")&&(dl.update(F=>(F.booting=!0,F)),dc())};let f,p=[],v=!1,d,h=[],g=!1;Ji();let k={hostname:"",ip:""};function T(z){l(9,g=!0);const V=new FormData;V.append("file",h[0]),fetch("/configfile",{method:"POST",body:V}).then(F=>F.json()).then(F=>{dl.update(R=>(k&&k.hostname&&(R.hostname=k.hostname),R.booting=F.reboot,k&&k.ip&&(R.net.ip=k.ip),setTimeout(Xn,5e3,i),R))}).catch(F=>{console.error("Error:",F),setTimeout(Xn,5e3,i)})}function O(z){ri[z?"unshift":"push"](()=>{f=z,l(5,f)})}function E(){p=this.files,l(6,p)}const I=()=>{f.click()},N=()=>l(7,v=!0);function B(z){ri[z?"unshift":"push"](()=>{d=z,l(8,d)})}function S(){h=this.files,l(2,h)}const j=()=>{d.click()};return t.$$set=z=>{"data"in z&&l(0,n=z.data),"sysinfo"in z&&l(1,i=z.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&4&&h.length==1){let z=h[0],V=new FileReader,F=R=>{let G=R.target.result.split(` `);for(let U in G){let H=G[U];H.startsWith("hostname ")?k.hostname=H.split(" ")[1]:H.startsWith("ip ")&&(k.ip=H.split(" ")[1])}};V.onload=F,V.readAsText(z)}},[n,i,h,a,c,f,p,v,d,g,o,_,u,T,O,E,I,N,B,S,j]}class hc extends Dt{constructor(e){super(),qt(this,e,vc,pc,Nt,{data:0,sysinfo:1})}}function sf(t){let e,l,n=xe(t[0],7)+"",i,o,a=xe(t[0],5)+"",c,_,u=xe(t[0],4)+"",f,p,v=xe(t[0],3)+"",d,h,g,k,T=xe(t[0],2)+"",O,E,I=xe(t[0],1)+"",N,B,S=xe(t[0],0)+"",j,z,V,F,R=xe(t[0],101)+"",G,U,H=xe(t[0],100)+"",W;return{c(){e=m("optgroup"),l=m("option"),i=M(n),o=m("option"),c=M(a),_=m("option"),f=M(u),p=m("option"),d=M(v),h=b(),g=m("optgroup"),k=m("option"),O=M(T),E=m("option"),N=M(I),B=m("option"),j=M(S),z=b(),V=m("optgroup"),F=m("option"),G=M(R),U=m("option"),W=M(H),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,_.__value=4,_.value=_.__value,p.__value=3,p.value=p.__value,r(e,"label","amsleser.no"),k.__value=2,k.value=k.__value,E.__value=1,E.value=E.__value,B.__value=0,B.value=B.__value,r(g,"label","Custom hardware"),F.__value=101,F.value=F.__value,U.__value=100,U.value=U.__value,r(V,"label","Generic hardware")},m(K,Q){q(K,e,Q),s(e,l),s(l,i),s(e,o),s(o,c),s(e,_),s(_,f),s(e,p),s(p,d),q(K,h,Q),q(K,g,Q),s(g,k),s(k,O),s(g,E),s(E,N),s(g,B),s(B,j),q(K,z,Q),q(K,V,Q),s(V,F),s(F,G),s(V,U),s(U,W)},p(K,Q){Q&1&&n!==(n=xe(K[0],7)+"")&&D(i,n),Q&1&&a!==(a=xe(K[0],5)+"")&&D(c,a),Q&1&&u!==(u=xe(K[0],4)+"")&&D(f,u),Q&1&&v!==(v=xe(K[0],3)+"")&&D(d,v),Q&1&&T!==(T=xe(K[0],2)+"")&&D(O,T),Q&1&&I!==(I=xe(K[0],1)+"")&&D(N,I),Q&1&&S!==(S=xe(K[0],0)+"")&&D(j,S),Q&1&&R!==(R=xe(K[0],101)+"")&&D(G,R),Q&1&&H!==(H=xe(K[0],100)+"")&&D(W,H)},d(K){K&&A(e),K&&A(h),K&&A(g),K&&A(z),K&&A(V)}}}function of(t){let e,l,n=xe(t[0],201)+"",i,o,a=xe(t[0],202)+"",c,_,u=xe(t[0],203)+"",f,p,v=xe(t[0],241)+"",d,h,g=xe(t[0],242)+"",k,T,O=xe(t[0],243)+"",E,I,N=xe(t[0],200)+"",B;return{c(){e=m("optgroup"),l=m("option"),i=M(n),o=m("option"),c=M(a),_=m("option"),f=M(u),p=m("option"),d=M(v),h=m("option"),k=M(g),T=m("option"),E=M(O),I=m("option"),B=M(N),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,_.__value=203,_.value=_.__value,p.__value=241,p.value=p.__value,h.__value=242,h.value=h.__value,T.__value=243,T.value=T.__value,I.__value=200,I.value=I.__value,r(e,"label","Generic hardware")},m(S,j){q(S,e,j),s(e,l),s(l,i),s(e,o),s(o,c),s(e,_),s(_,f),s(e,p),s(p,d),s(e,h),s(h,k),s(e,T),s(T,E),s(e,I),s(I,B)},p(S,j){j&1&&n!==(n=xe(S[0],201)+"")&&D(i,n),j&1&&a!==(a=xe(S[0],202)+"")&&D(c,a),j&1&&u!==(u=xe(S[0],203)+"")&&D(f,u),j&1&&v!==(v=xe(S[0],241)+"")&&D(d,v),j&1&&g!==(g=xe(S[0],242)+"")&&D(k,g),j&1&&O!==(O=xe(S[0],243)+"")&&D(E,O),j&1&&N!==(N=xe(S[0],200)+"")&&D(B,N)},d(S){S&&A(e)}}}function af(t){let e,l,n=xe(t[0],7)+"",i,o,a=xe(t[0],6)+"",c,_,u=xe(t[0],5)+"",f,p,v,d,h=xe(t[0],51)+"",g,k,T=xe(t[0],50)+"",O;return{c(){e=m("optgroup"),l=m("option"),i=M(n),o=m("option"),c=M(a),_=m("option"),f=M(u),p=b(),v=m("optgroup"),d=m("option"),g=M(h),k=m("option"),O=M(T),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,_.__value=5,_.value=_.__value,r(e,"label","amsleser.no"),d.__value=51,d.value=d.__value,k.__value=50,k.value=k.__value,r(v,"label","Generic hardware")},m(E,I){q(E,e,I),s(e,l),s(l,i),s(e,o),s(o,c),s(e,_),s(_,f),q(E,p,I),q(E,v,I),s(v,d),s(d,g),s(v,k),s(k,O)},p(E,I){I&1&&n!==(n=xe(E[0],7)+"")&&D(i,n),I&1&&a!==(a=xe(E[0],6)+"")&&D(c,a),I&1&&u!==(u=xe(E[0],5)+"")&&D(f,u),I&1&&h!==(h=xe(E[0],51)+"")&&D(g,h),I&1&&T!==(T=xe(E[0],50)+"")&&D(O,T)},d(E){E&&A(e),E&&A(p),E&&A(v)}}}function ff(t){let e,l,n=xe(t[0],8)+"",i,o,a,c,_=xe(t[0],71)+"",u,f,p=xe(t[0],70)+"",v;return{c(){e=m("optgroup"),l=m("option"),i=M(n),o=b(),a=m("optgroup"),c=m("option"),u=M(_),f=m("option"),v=M(p),l.__value=8,l.value=l.__value,r(e,"label","Custom hardware"),c.__value=71,c.value=c.__value,f.__value=70,f.value=f.__value,r(a,"label","Generic hardware")},m(d,h){q(d,e,h),s(e,l),s(l,i),q(d,o,h),q(d,a,h),s(a,c),s(c,u),s(a,f),s(f,v)},p(d,h){h&1&&n!==(n=xe(d[0],8)+"")&&D(i,n),h&1&&_!==(_=xe(d[0],71)+"")&&D(u,_),h&1&&p!==(p=xe(d[0],70)+"")&&D(v,p)},d(d){d&&A(e),d&&A(o),d&&A(a)}}}function uf(t){let e,l,n=xe(t[0],200)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=M(n),l.__value=200,l.value=l.__value,r(e,"label","Generic hardware")},m(o,a){q(o,e,a),s(e,l),s(l,i)},p(o,a){a&1&&n!==(n=xe(o[0],200)+"")&&D(i,n)},d(o){o&&A(e)}}}function rf(t){let e,l,n=xe(t[0],80)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=M(n),l.__value=80,l.value=l.__value,r(e,"label","Generic hardware")},m(o,a){q(o,e,a),s(e,l),s(l,i)},p(o,a){a&1&&n!==(n=xe(o[0],80)+"")&&D(i,n)},d(o){o&&A(e)}}}function bc(t){let e,l,n,i,o,a,c,_,u=t[0]=="esp8266"&&sf(t),f=t[0]=="esp32"&&of(t),p=t[0]=="esp32s2"&&af(t),v=t[0]=="esp32c3"&&ff(t),d=t[0]=="esp32solo"&&uf(t),h=t[0]=="esp32s3"&&rf(t);return{c(){e=m("option"),l=b(),u&&u.c(),n=b(),f&&f.c(),i=b(),p&&p.c(),o=b(),v&&v.c(),a=b(),d&&d.c(),c=b(),h&&h.c(),_=Qt(),e.__value=-1,e.value=e.__value},m(g,k){q(g,e,k),q(g,l,k),u&&u.m(g,k),q(g,n,k),f&&f.m(g,k),q(g,i,k),p&&p.m(g,k),q(g,o,k),v&&v.m(g,k),q(g,a,k),d&&d.m(g,k),q(g,c,k),h&&h.m(g,k),q(g,_,k)},p(g,[k]){g[0]=="esp8266"?u?u.p(g,k):(u=sf(g),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null),g[0]=="esp32"?f?f.p(g,k):(f=of(g),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null),g[0]=="esp32s2"?p?p.p(g,k):(p=af(g),p.c(),p.m(o.parentNode,o)):p&&(p.d(1),p=null),g[0]=="esp32c3"?v?v.p(g,k):(v=ff(g),v.c(),v.m(a.parentNode,a)):v&&(v.d(1),v=null),g[0]=="esp32solo"?d?d.p(g,k):(d=uf(g),d.c(),d.m(c.parentNode,c)):d&&(d.d(1),d=null),g[0]=="esp32s3"?h?h.p(g,k):(h=rf(g),h.c(),h.m(_.parentNode,_)):h&&(h.d(1),h=null)},i:Xe,o:Xe,d(g){g&&A(e),g&&A(l),u&&u.d(g),g&&A(n),f&&f.d(g),g&&A(i),p&&p.d(g),g&&A(o),v&&v.d(g),g&&A(a),d&&d.d(g),g&&A(c),h&&h.d(g),g&&A(_)}}}function gc(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class kc extends Dt{constructor(e){super(),qt(this,e,gc,bc,Nt,{chip:0})}}function cf(t){let e;return{c(){e=m("div"),e.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",r(e,"class","bd-red")},m(l,n){q(l,e,n)},d(l){l&&A(e)}}}function _f(t){let e,l,n,i,o,a,c;return a=new Bi({props:{chip:t[0].chip}}),{c(){e=m("div"),l=M("HAN GPIO"),n=m("br"),i=b(),o=m("select"),Re(a.$$.fragment),r(o,"name","vh"),r(o,"class","in-s"),r(e,"class","my-3")},m(_,u){q(_,e,u),s(e,l),s(e,n),s(e,i),s(e,o),De(a,o,null),c=!0},p(_,u){const f={};u&1&&(f.chip=_[0].chip),a.$set(f)},i(_){c||($(a.$$.fragment,_),c=!0)},o(_){fe(a.$$.fragment,_),c=!1},d(_){_&&A(e),Le(a)}}}function wc(t){let e,l,n,i,o,a,c,_,u,f,p,v,d,h,g,k,T,O,E,I,N,B,S,j,z,V,F,R,G,U=t[0].usrcfg&&cf();h=new kc({props:{chip:t[0].chip}});let H=t[0].board&&t[0].board>20&&_f(t);return V=new pl({props:{active:t[1],message:"Saving"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=b(),a=m("strong"),a.textContent="Initial configuration",c=b(),U&&U.c(),_=b(),u=m("div"),f=M("Board type"),p=m("br"),v=b(),d=m("select"),Re(h.$$.fragment),g=b(),H&&H.c(),k=b(),T=m("div"),O=m("label"),E=m("input"),I=M(" Clear all other configuration"),N=b(),B=m("div"),B.innerHTML='',S=b(),j=m("span"),j.textContent="\xA0",z=b(),Re(V.$$.fragment),r(i,"type","hidden"),r(i,"name","v"),i.value="true",r(a,"class","text-sm"),r(d,"name","vb"),r(d,"class","in-s"),t[0].board===void 0&&Gt(()=>t[5].call(d)),r(u,"class","my-3"),r(E,"type","checkbox"),r(E,"name","vr"),E.__value="true",E.value=E.__value,r(E,"class","rounded mb-1"),r(T,"class","my-3"),r(B,"class","my-3"),r(j,"class","clear-both"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(W,K){q(W,e,K),s(e,l),s(l,n),s(n,i),s(n,o),s(n,a),s(n,c),U&&U.m(n,null),s(n,_),s(n,u),s(u,f),s(u,p),s(u,v),s(u,d),De(h,d,null),ot(d,t[0].board,!0),s(n,g),H&&H.m(n,null),s(n,k),s(n,T),s(T,O),s(O,E),E.checked=t[2],s(O,I),s(n,N),s(n,B),s(n,S),s(n,j),q(W,z,K),De(V,W,K),F=!0,R||(G=[ve(d,"change",t[5]),ve(E,"change",t[6]),ve(n,"submit",_n(t[3]))],R=!0)},p(W,[K]){W[0].usrcfg?U||(U=cf(),U.c(),U.m(n,_)):U&&(U.d(1),U=null);const Q={};K&1&&(Q.chip=W[0].chip),h.$set(Q),K&1&&ot(d,W[0].board),W[0].board&&W[0].board>20?H?(H.p(W,K),K&1&&$(H,1)):(H=_f(W),H.c(),$(H,1),H.m(n,k)):H&&(gt(),fe(H,1,1,()=>{H=null}),kt()),K&4&&(E.checked=W[2]);const J={};K&2&&(J.active=W[1]),V.$set(J)},i(W){F||($(h.$$.fragment,W),$(H),$(V.$$.fragment,W),F=!0)},o(W){fe(h.$$.fragment,W),fe(H),fe(V.$$.fragment,W),F=!1},d(W){W&&A(e),U&&U.d(),Le(h),H&&H.d(),W&&A(z),Le(V,W),R=!1,zt(G)}}}function Mc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,o=!1;async function a(f){l(1,o=!0);const p=new FormData(f.target),v=new URLSearchParams;for(let g of p){const[k,T]=g;v.append(k,T)}let h=await(await fetch("save",{method:"POST",body:v})).json();l(1,o=!1),dl.update(g=>(g.vndcfg=h.success,g.booting=h.reboot,g.if.eth=g.boardType>240&&g.boardType<250,g)),en(n+(i.usrcfg?"/":"/setup"))}let c=!1;dl.subscribe(f=>{l(0,i=f),f.fwconsent===1&&l(2,c=!i.usrcfg)});function _(){i.board=Kt(this),l(0,i)}function u(){c=this.checked,l(2,c)}return t.$$set=f=>{"basepath"in f&&l(4,n=f.basepath),"sysinfo"in f&&l(0,i=f.sysinfo)},[i,o,c,a,n,_,u]}class Sc extends Dt{constructor(e){super(),qt(this,e,Mc,wc,Nt,{basepath:4,sysinfo:0})}}function mf(t){var i,o,a;let e,l=((a=(o=(i=t[1].conf)==null?void 0:i.connection)==null?void 0:o.eth)!=null?a:"Ethernet")+"",n;return{c(){e=m("option"),n=M(l),e.__value=3,e.value=e.__value},m(c,_){q(c,e,_),s(e,n)},p(c,_){var u,f,p;_&2&&l!==(l=((p=(f=(u=c[1].conf)==null?void 0:u.connection)==null?void 0:f.eth)!=null?p:"Ethernet")+"")&&D(n,l)},d(c){c&&A(e)}}}function pf(t){var k,T,O,E,I,N;let e,l=((O=(T=(k=t[1].conf)==null?void 0:k.connection)==null?void 0:T.ssid)!=null?O:"SSID")+"",n,i,o,a,c,_,u,f=((N=(I=(E=t[1].conf)==null?void 0:E.connection)==null?void 0:I.psk)!=null?N:"Password")+"",p,v,d,h,g;return{c(){e=m("div"),n=M(l),i=m("br"),o=b(),a=m("input"),_=b(),u=m("div"),p=M(f),v=m("br"),d=b(),h=m("input"),r(a,"name","ss"),r(a,"type","text"),r(a,"class","in-s"),a.required=c=t[3]==1||t[3]==2,r(e,"class","my-3"),r(h,"name","sp"),r(h,"type","password"),r(h,"class","in-s"),r(h,"autocomplete","off"),h.required=g=t[3]==2,r(u,"class","my-3")},m(B,S){q(B,e,S),s(e,n),s(e,i),s(e,o),s(e,a),q(B,_,S),q(B,u,S),s(u,p),s(u,v),s(u,d),s(u,h)},p(B,S){var j,z,V,F,R,G;S&2&&l!==(l=((V=(z=(j=B[1].conf)==null?void 0:j.connection)==null?void 0:z.ssid)!=null?V:"SSID")+"")&&D(n,l),S&8&&c!==(c=B[3]==1||B[3]==2)&&(a.required=c),S&2&&f!==(f=((G=(R=(F=B[1].conf)==null?void 0:F.connection)==null?void 0:R.psk)!=null?G:"Password")+"")&&D(p,f),S&8&&g!==(g=B[3]==2)&&(h.required=g)},d(B){B&&A(e),B&&A(_),B&&A(u)}}}function df(t){let e,l,n,i,o,a,c,_;return c=new Tu({}),{c(){e=m("br"),l=b(),n=m("div"),i=m("input"),o=b(),a=m("select"),Re(c.$$.fragment),r(i,"name","si"),r(i,"type","text"),r(i,"class","in-f w-full"),i.required=t[2],r(a,"name","su"),r(a,"class","in-l"),a.required=t[2],r(n,"class","flex")},m(u,f){q(u,e,f),q(u,l,f),q(u,n,f),s(n,i),s(n,o),s(n,a),De(c,a,null),_=!0},p(u,f){(!_||f&4)&&(i.required=u[2]),(!_||f&4)&&(a.required=u[2])},i(u){_||($(c.$$.fragment,u),_=!0)},o(u){fe(c.$$.fragment,u),_=!1},d(u){u&&A(e),u&&A(l),u&&A(n),Le(c)}}}function vf(t){var g,k,T,O,E,I;let e,l,n=((T=(k=(g=t[1].conf)==null?void 0:g.network)==null?void 0:k.gw)!=null?T:"Gateway")+"",i,o,a,c,_,u,f=((I=(E=(O=t[1].conf)==null?void 0:O.network)==null?void 0:E.dns)!=null?I:"DNS")+"",p,v,d,h;return{c(){e=m("div"),l=m("div"),i=M(n),o=m("br"),a=b(),c=m("input"),_=b(),u=m("div"),p=M(f),v=m("br"),d=b(),h=m("input"),r(c,"name","sg"),r(c,"type","text"),r(c,"class","in-f w-full"),r(h,"name","sd"),r(h,"type","text"),r(h,"class","in-l w-full"),r(e,"class","my-3 flex")},m(N,B){q(N,e,B),s(e,l),s(l,i),s(l,o),s(l,a),s(l,c),s(e,_),s(e,u),s(u,p),s(u,v),s(u,d),s(u,h)},p(N,B){var S,j,z,V,F,R;B&2&&n!==(n=((z=(j=(S=N[1].conf)==null?void 0:S.network)==null?void 0:j.gw)!=null?z:"Gateway")+"")&&D(i,n),B&2&&f!==(f=((R=(F=(V=N[1].conf)==null?void 0:V.network)==null?void 0:F.dns)!=null?R:"DNS")+"")&&D(p,f)},d(N){N&&A(e)}}}function Cc(t){var y,ee,le,se,_e,Te,Se,de,Ne,we,ge,he,je,Ue,We,Ze,Je,Ye,et,He;let e,l,n,i,o,a,c=((ee=(y=t[1].setup)==null?void 0:y.title)!=null?ee:"Setup")+"",_,u,f,p=((_e=(se=(le=t[1].conf)==null?void 0:le.connection)==null?void 0:se.title)!=null?_e:"Connection")+"",v,d,h,g,k,T=((de=(Se=(Te=t[1].conf)==null?void 0:Te.connection)==null?void 0:Se.wifi)!=null?de:"Connect to WiFi")+"",O,E,I=((ge=(we=(Ne=t[1].conf)==null?void 0:Ne.connection)==null?void 0:we.ap)!=null?ge:"Standalone access point")+"",N,B,S,j,z=((Ue=(je=(he=t[1].conf)==null?void 0:he.general)==null?void 0:je.hostname)!=null?Ue:"Hostname")+"",V,F,R,G,U,H,W,K,Q=((Ze=(We=t[1].setup)==null?void 0:We.static)!=null?Ze:"Static IP")+"",J,ae,Z,X,oe,ne,ie=((Ye=(Je=t[1].btn)==null?void 0:Je.save)!=null?Ye:"Save")+"",re,me,Y,x,ke,pe,C=t[0].if&&t[0].if.eth&&mf(t),w=(t[3]==1||t[3]==2)&&pf(t),P=t[2]&&df(t),L=t[2]&&vf(t);return Y=new pl({props:{active:t[4],message:(He=(et=t[1].setup)==null?void 0:et.mask)!=null?He:"Saving"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=b(),a=m("strong"),_=M(c),u=b(),f=m("div"),v=M(p),d=m("br"),h=b(),g=m("select"),k=m("option"),O=M(T),E=m("option"),N=M(I),C&&C.c(),B=b(),w&&w.c(),S=b(),j=m("div"),V=M(z),F=b(),R=m("input"),G=b(),U=m("div"),H=m("label"),W=m("input"),K=b(),J=M(Q),ae=b(),P&&P.c(),Z=b(),L&&L.c(),X=b(),oe=m("div"),ne=m("button"),re=M(ie),me=b(),Re(Y.$$.fragment),r(i,"type","hidden"),r(i,"name","s"),i.value="true",r(a,"class","text-sm"),k.__value=1,k.value=k.__value,E.__value=2,E.value=E.__value,r(g,"name","sc"),r(g,"class","in-s"),t[3]===void 0&&Gt(()=>t[6].call(g)),r(f,"class","my-3"),r(R,"name","sh"),r(R,"type","text"),r(R,"class","in-s"),r(R,"maxlength","32"),r(R,"pattern","[a-z0-9_-]+"),r(R,"placeholder","Optional, ex.: ams-reader"),r(R,"autocomplete","off"),r(W,"type","checkbox"),r(W,"name","sm"),W.__value="static",W.value=W.__value,r(W,"class","rounded mb-1"),r(U,"class","my-3"),r(ne,"type","submit"),r(ne,"class","btn-pri"),r(oe,"class","my-3"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Oe,ce){q(Oe,e,ce),s(e,l),s(l,n),s(n,i),s(n,o),s(n,a),s(a,_),s(n,u),s(n,f),s(f,v),s(f,d),s(f,h),s(f,g),s(g,k),s(k,O),s(g,E),s(E,N),C&&C.m(g,null),ot(g,t[3],!0),s(n,B),w&&w.m(n,null),s(n,S),s(n,j),s(j,V),s(j,F),s(j,R),Ee(R,t[0].hostname),s(n,G),s(n,U),s(U,H),s(H,W),W.checked=t[2],s(H,K),s(H,J),s(U,ae),P&&P.m(U,null),s(n,Z),L&&L.m(n,null),s(n,X),s(n,oe),s(oe,ne),s(ne,re),q(Oe,me,ce),De(Y,Oe,ce),x=!0,ke||(pe=[ve(g,"change",t[6]),ve(R,"input",t[7]),ve(W,"change",t[8]),ve(n,"submit",_n(t[5]))],ke=!0)},p(Oe,[ce]){var $e,Qe,mt,ye,Ge,ze,tt,vt,Mt,dt,te,be,Tt,Ce,qe,pt,at,ft,ut,Et;(!x||ce&2)&&c!==(c=((Qe=($e=Oe[1].setup)==null?void 0:$e.title)!=null?Qe:"Setup")+"")&&D(_,c),(!x||ce&2)&&p!==(p=((Ge=(ye=(mt=Oe[1].conf)==null?void 0:mt.connection)==null?void 0:ye.title)!=null?Ge:"Connection")+"")&&D(v,p),(!x||ce&2)&&T!==(T=((vt=(tt=(ze=Oe[1].conf)==null?void 0:ze.connection)==null?void 0:tt.wifi)!=null?vt:"Connect to WiFi")+"")&&D(O,T),(!x||ce&2)&&I!==(I=((te=(dt=(Mt=Oe[1].conf)==null?void 0:Mt.connection)==null?void 0:dt.ap)!=null?te:"Standalone access point")+"")&&D(N,I),Oe[0].if&&Oe[0].if.eth?C?C.p(Oe,ce):(C=mf(Oe),C.c(),C.m(g,null)):C&&(C.d(1),C=null),ce&8&&ot(g,Oe[3]),Oe[3]==1||Oe[3]==2?w?w.p(Oe,ce):(w=pf(Oe),w.c(),w.m(n,S)):w&&(w.d(1),w=null),(!x||ce&2)&&z!==(z=((Ce=(Tt=(be=Oe[1].conf)==null?void 0:be.general)==null?void 0:Tt.hostname)!=null?Ce:"Hostname")+"")&&D(V,z),ce&1&&R.value!==Oe[0].hostname&&Ee(R,Oe[0].hostname),ce&4&&(W.checked=Oe[2]),(!x||ce&2)&&Q!==(Q=((pt=(qe=Oe[1].setup)==null?void 0:qe.static)!=null?pt:"Static IP")+"")&&D(J,Q),Oe[2]?P?(P.p(Oe,ce),ce&4&&$(P,1)):(P=df(Oe),P.c(),$(P,1),P.m(U,null)):P&&(gt(),fe(P,1,1,()=>{P=null}),kt()),Oe[2]?L?L.p(Oe,ce):(L=vf(Oe),L.c(),L.m(n,X)):L&&(L.d(1),L=null),(!x||ce&2)&&ie!==(ie=((ft=(at=Oe[1].btn)==null?void 0:at.save)!=null?ft:"Save")+"")&&D(re,ie);const Pe={};ce&16&&(Pe.active=Oe[4]),ce&2&&(Pe.message=(Et=(ut=Oe[1].setup)==null?void 0:ut.mask)!=null?Et:"Saving"),Y.$set(Pe)},i(Oe){x||($(P),$(Y.$$.fragment,Oe),x=!0)},o(Oe){fe(P),fe(Y.$$.fragment,Oe),x=!1},d(Oe){Oe&&A(e),C&&C.d(),w&&w.d(),P&&P.d(),L&&L.d(),Oe&&A(me),Le(Y,Oe),ke=!1,zt(pe)}}}function Nc(t,e,l){let n={};vl.subscribe(d=>{l(1,n=d)});let{sysinfo:i={}}=e,o=!1,a=1,c=!1;function _(d){dl.update(h=>(h.trying=d,h))}async function u(d){l(4,c=!0);const h=new FormData(d.target),g=new URLSearchParams;for(let O of h){const[E,I]=O;g.append(E,I)}let T=await(await fetch("save",{method:"POST",body:g})).json();l(4,c=!1),dl.update(O=>(O.hostname=h.get("sh"),O.usrcfg=T.success,O.booting=T.reboot,o&&(O.net.ip=h.get("si"),O.net.mask=h.get("su"),O.net.gw=h.get("sg"),O.net.dns1=h.get("sd")),T.reboot&&setTimeout(Xn,5e3,i,_),O))}function f(){a=Kt(this),l(3,a)}function p(){i.hostname=this.value,l(0,i)}function v(){o=this.checked,l(2,o)}return t.$$set=d=>{"sysinfo"in d&&l(0,i=d.sysinfo)},[i,n,o,a,c,u,f,p,v]}class Tc extends Dt{constructor(e){super(),qt(this,e,Nc,Cc,Nt,{sysinfo:0})}}function Ec(t){var V,F,R,G,U,H,W,K;let e,l,n,i=((F=(V=t[2].upload)==null?void 0:V.title)!=null?F:"Upload")+"",o,a,c,_,u,f=((G=(R=t[2].upload)==null?void 0:R.desc)!=null?G:"")+"",p,v,d,h,g,k,T,O,E=((H=(U=t[2].btn)==null?void 0:U.upload)!=null?H:"Upload")+"",I,N,B,S,j,z;return B=new pl({props:{active:t[3],message:(K=(W=t[2].upload)==null?void 0:W.mask)!=null?K:"Uploading"}}),{c(){e=m("div"),l=m("div"),n=m("strong"),o=M(i),a=b(),c=M(t[1]),_=b(),u=m("p"),p=M(f),v=b(),d=m("form"),h=m("input"),g=b(),k=m("div"),T=m("button"),O=m("p"),I=M(E),N=b(),Re(B.$$.fragment),r(u,"class","mb-4"),r(h,"name","file"),r(h,"type","file"),r(O,"class","mb-4"),r(T,"type","submit"),r(T,"class","btn-pri"),r(k,"class","w-full text-right mt-4"),r(d,"action",t[0]),r(d,"enctype","multipart/form-data"),r(d,"method","post"),r(d,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(Q,J){q(Q,e,J),s(e,l),s(l,n),s(n,o),s(n,a),s(n,c),s(l,_),s(l,u),s(u,p),s(l,v),s(l,d),s(d,h),s(d,g),s(d,k),s(k,T),s(T,O),s(O,I),q(Q,N,J),De(B,Q,J),S=!0,j||(z=ve(d,"submit",t[4]),j=!0)},p(Q,[J]){var Z,X,oe,ne,ie,re,me,Y;(!S||J&4)&&i!==(i=((X=(Z=Q[2].upload)==null?void 0:Z.title)!=null?X:"Upload")+"")&&D(o,i),(!S||J&2)&&D(c,Q[1]),(!S||J&4)&&f!==(f=((ne=(oe=Q[2].upload)==null?void 0:oe.desc)!=null?ne:"")+"")&&D(p,f),(!S||J&4)&&E!==(E=((re=(ie=Q[2].btn)==null?void 0:ie.upload)!=null?re:"Upload")+"")&&D(I,E),(!S||J&1)&&r(d,"action",Q[0]);const ae={};J&8&&(ae.active=Q[3]),J&4&&(ae.message=(Y=(me=Q[2].upload)==null?void 0:me.mask)!=null?Y:"Uploading"),B.$set(ae)},i(Q){S||($(B.$$.fragment,Q),S=!0)},o(Q){fe(B.$$.fragment,Q),S=!1},d(Q){Q&&A(e),Q&&A(N),Le(B,Q),j=!1,z()}}}function Pc(t,e,l){let{action:n}=e,{title:i}=e,o={};vl.subscribe(_=>{l(2,o=_)});let a=!1;const c=()=>l(3,a=!0);return t.$$set=_=>{"action"in _&&l(0,n=_.action),"title"in _&&l(1,i=_.title)},[n,i,o,a,c]}class ns extends Dt{constructor(e){super(),qt(this,e,Pc,Ec,Nt,{action:0,title:1})}}function Ac(t){var Y,x,ke,pe,C,w,P,L,y,ee,le,se,_e,Te;let e,l,n,i,o=((x=(Y=t[1].consent)==null?void 0:Y.title)!=null?x:"Consents")+"",a,c,_,u,f,p=((pe=(ke=t[1].consent)==null?void 0:ke.one_click)!=null?pe:"One-click")+"",v,d,h,g,k=((w=(C=t[1].consent)==null?void 0:C.read_more)!=null?w:"Read more")+"",T,O,E,I,N,B,S,j=((L=(P=t[1].consent)==null?void 0:P.yes)!=null?L:"Yes")+"",z,V,F,R,G,U,H=((ee=(y=t[1].consent)==null?void 0:y.no)!=null?ee:"No")+"",W,K,Q,J,ae,Z=((se=(le=t[1].btn)==null?void 0:le.save)!=null?se:"Save")+"",X,oe,ne,ie,re,me;return ne=new pl({props:{active:t[2],message:(Te=(_e=t[1].consent)==null?void 0:_e.mask_saving)!=null?Te:"Saving"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("div"),a=M(o),c=b(),_=m("hr"),u=b(),f=m("div"),v=M(p),d=m("br"),h=b(),g=m("a"),T=M(k),O=m("br"),E=b(),I=m("label"),N=m("input"),S=b(),z=M(j),V=b(),F=m("label"),R=m("input"),U=b(),W=M(H),K=m("br"),Q=b(),J=m("div"),ae=m("button"),X=M(Z),oe=b(),Re(ne.$$.fragment),r(g,"href",kl("Data-collection-on-one-click-firmware-upgrade")),r(g,"target","_blank"),r(g,"class","text-blue-600 hover:text-blue-800"),r(N,"type","radio"),r(N,"name","sf"),N.value=1,N.checked=B=t[0].fwconsent===1,r(N,"class","rounded m-2"),N.required=!0,r(R,"type","radio"),r(R,"name","sf"),R.value=2,R.checked=G=t[0].fwconsent===2,r(R,"class","rounded m-2"),R.required=!0,r(f,"class","my-3"),r(ae,"type","submit"),r(ae,"class","btn-pri"),r(J,"class","my-3"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(Se,de){q(Se,e,de),s(e,l),s(l,n),s(n,i),s(i,a),s(n,c),s(n,_),s(n,u),s(n,f),s(f,v),s(f,d),s(f,h),s(f,g),s(g,T),s(f,O),s(f,E),s(f,I),s(I,N),s(I,S),s(I,z),s(f,V),s(f,F),s(F,R),s(F,U),s(F,W),s(f,K),s(n,Q),s(n,J),s(J,ae),s(ae,X),q(Se,oe,de),De(ne,Se,de),ie=!0,re||(me=ve(n,"submit",_n(t[3])),re=!0)},p(Se,[de]){var we,ge,he,je,Ue,We,Ze,Je,Ye,et,He,Oe,ce,Pe;(!ie||de&2)&&o!==(o=((ge=(we=Se[1].consent)==null?void 0:we.title)!=null?ge:"Consents")+"")&&D(a,o),(!ie||de&2)&&p!==(p=((je=(he=Se[1].consent)==null?void 0:he.one_click)!=null?je:"One-click")+"")&&D(v,p),(!ie||de&2)&&k!==(k=((We=(Ue=Se[1].consent)==null?void 0:Ue.read_more)!=null?We:"Read more")+"")&&D(T,k),(!ie||de&1&&B!==(B=Se[0].fwconsent===1))&&(N.checked=B),(!ie||de&2)&&j!==(j=((Je=(Ze=Se[1].consent)==null?void 0:Ze.yes)!=null?Je:"Yes")+"")&&D(z,j),(!ie||de&1&&G!==(G=Se[0].fwconsent===2))&&(R.checked=G),(!ie||de&2)&&H!==(H=((et=(Ye=Se[1].consent)==null?void 0:Ye.no)!=null?et:"No")+"")&&D(W,H),(!ie||de&2)&&Z!==(Z=((Oe=(He=Se[1].btn)==null?void 0:He.save)!=null?Oe:"Save")+"")&&D(X,Z);const Ne={};de&4&&(Ne.active=Se[2]),de&2&&(Ne.message=(Pe=(ce=Se[1].consent)==null?void 0:ce.mask_saving)!=null?Pe:"Saving"),ne.$set(Ne)},i(Se){ie||($(ne.$$.fragment,Se),ie=!0)},o(Se){fe(ne.$$.fragment,Se),ie=!1},d(Se){Se&&A(e),Se&&A(oe),Le(ne,Se),re=!1,me()}}}function qc(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,o={};vl.subscribe(_=>{l(1,o=_)});let a=!1;async function c(_){l(2,a=!0);const u=new FormData(_.target),f=new URLSearchParams;for(let d of u){const[h,g]=d;f.append(h,g)}let v=await(await fetch("save",{method:"POST",body:f})).json();l(2,a=!1),dl.update(d=>(d.fwconsent=u.sf===!0?1:u.sf===!1?2:0,d.booting=v.reboot,d)),en(n)}return t.$$set=_=>{"basepath"in _&&l(4,n=_.basepath),"sysinfo"in _&&l(0,i=_.sysinfo)},[i,o,a,c,n]}class Dc extends Dt{constructor(e){super(),qt(this,e,qc,Ac,Nt,{basepath:4,sysinfo:0})}}function hf(t,e,l){const n=t.slice();return n[24]=e[l],n[25]=e,n[26]=l,n}function bf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Lc(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function gf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Oc(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function kf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function wf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Mf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Sf(t,e,l){const n=t.slice();return n[27]=e[l],n[29]=l,n}function Cf(t){let e,l=t[1].o,n=[];for(let i=0;i{l(0,i=F)});let o=["mo","tu","we","th","fr","sa","su"],a={},c=!0,_=!1;Nu.subscribe(F=>{F.o&&(l(1,a=F),l(2,c=!1))}),w0();async function u(F){l(3,_=!0);const R=new URLSearchParams;R.append("r","true"),R.append("rc",a.o.length),a.o.forEach(function(U,H){R.append("rt"+H,U.t),R.append("rn"+H,U.n),R.append("rd"+H,U.d),R.append("ra"+H,U.a),R.append("rh"+H,U.h),R.append("rv"+H,U.v),R.append("rsm"+H,U.s.m),R.append("rsd"+H,U.s.d),R.append("rem"+H,U.e.m),R.append("red"+H,U.e.d)}),await(await fetch("save",{method:"POST",body:R})).json(),l(3,_=!1),en(n+"configuration")}let f=function(F,R){return F.includes(R)?F=F.filter(function(G){return G!==R}):F.push(R),F},p=function(){let F=a.o;F.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=F,a)},v=function(F){let R=a.o;R.splice(F,1),l(1,a.o=R,a)};function d(F,R){F[R].n=this.value,l(1,a)}function h(F,R){F[R].d=Kt(this),l(1,a)}function g(F,R){F[R].t=Kt(this),l(1,a)}function k(F,R){F[R].v=st(this.value),l(1,a)}const T=(F,R,G,U)=>l(1,G[U].a=f(F.a,R),a),O=(F,R,G,U)=>l(1,G[U].h=f(F.h,R),a),E=(F,R,G,U)=>l(1,G[U].h=f(F.h,R+8),a),I=(F,R,G,U)=>l(1,G[U].h=f(F.h,R+16),a);function N(F,R){F[R].s.m=Kt(this),l(1,a)}function B(F,R){F[R].s.d=Kt(this),l(1,a)}function S(F,R){F[R].e.m=Kt(this),l(1,a)}function j(F,R){F[R].e.d=Kt(this),l(1,a)}const z=F=>v(F),V=F=>v(F);return t.$$set=F=>{"basepath"in F&&l(9,n=F.basepath)},[i,a,c,_,o,u,f,p,v,n,d,h,g,k,T,O,E,I,N,B,S,j,z,V]}class Bc extends Dt{constructor(e){super(),qt(this,e,Uc,Fc,Nt,{basepath:9},null,[-1,-1])}}function jc(t){let e,l;return e=new g0({props:{data:t[2],sysinfo:t[1]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&4&&(o.data=n[2]),i&2&&(o.sysinfo=n[1]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Hc(t){let e,l;return e=new sc({props:{sysinfo:t[1],basepath:t[0],data:t[2]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),i&4&&(o.data=n[2]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function yc(t){let e,l;return e=new Bc({props:{basepath:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function zc(t){let e,l;return e=new hc({props:{sysinfo:t[1],data:t[2]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&4&&(o.data=n[2]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Wc(t){let e,l;return e=new ns({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Xe,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Gc(t){let e,l;return e=new ns({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Xe,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Vc(t){let e,l;return e=new ns({props:{title:"private key",action:"/mqtt-key"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Xe,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Kc(t){let e,l;return e=new Dc({props:{sysinfo:t[1],basepath:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Yc(t){let e,l;return e=new Tc({props:{sysinfo:t[1]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Qc(t){let e,l;return e=new Sc({props:{sysinfo:t[1],basepath:t[0]}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function Xc(t){let e,l,n,i,o,a,c,_,u,f,p,v,d,h,g,k,T,O,E,I,N,B;return e=new A1({props:{data:t[2],basepath:t[0]}}),n=new ql({props:{path:"/",$$slots:{default:[jc]},$$scope:{ctx:t}}}),o=new ql({props:{path:"/configuration",$$slots:{default:[Hc]},$$scope:{ctx:t}}}),c=new ql({props:{path:"/priceconfig",$$slots:{default:[yc]},$$scope:{ctx:t}}}),u=new ql({props:{path:"/status",$$slots:{default:[zc]},$$scope:{ctx:t}}}),p=new ql({props:{path:"/mqtt-ca",$$slots:{default:[Wc]},$$scope:{ctx:t}}}),d=new ql({props:{path:"/mqtt-cert",$$slots:{default:[Gc]},$$scope:{ctx:t}}}),g=new ql({props:{path:"/mqtt-key",$$slots:{default:[Vc]},$$scope:{ctx:t}}}),T=new ql({props:{path:"/consent",$$slots:{default:[Kc]},$$scope:{ctx:t}}}),E=new ql({props:{path:"/setup",$$slots:{default:[Yc]},$$scope:{ctx:t}}}),N=new ql({props:{path:"/vendor",$$slots:{default:[Qc]},$$scope:{ctx:t}}}),{c(){Re(e.$$.fragment),l=b(),Re(n.$$.fragment),i=b(),Re(o.$$.fragment),a=b(),Re(c.$$.fragment),_=b(),Re(u.$$.fragment),f=b(),Re(p.$$.fragment),v=b(),Re(d.$$.fragment),h=b(),Re(g.$$.fragment),k=b(),Re(T.$$.fragment),O=b(),Re(E.$$.fragment),I=b(),Re(N.$$.fragment)},m(S,j){De(e,S,j),q(S,l,j),De(n,S,j),q(S,i,j),De(o,S,j),q(S,a,j),De(c,S,j),q(S,_,j),De(u,S,j),q(S,f,j),De(p,S,j),q(S,v,j),De(d,S,j),q(S,h,j),De(g,S,j),q(S,k,j),De(T,S,j),q(S,O,j),De(E,S,j),q(S,I,j),De(N,S,j),B=!0},p(S,j){const z={};j&4&&(z.data=S[2]),j&1&&(z.basepath=S[0]),e.$set(z);const V={};j&22&&(V.$$scope={dirty:j,ctx:S}),n.$set(V);const F={};j&23&&(F.$$scope={dirty:j,ctx:S}),o.$set(F);const R={};j&17&&(R.$$scope={dirty:j,ctx:S}),c.$set(R);const G={};j&22&&(G.$$scope={dirty:j,ctx:S}),u.$set(G);const U={};j&16&&(U.$$scope={dirty:j,ctx:S}),p.$set(U);const H={};j&16&&(H.$$scope={dirty:j,ctx:S}),d.$set(H);const W={};j&16&&(W.$$scope={dirty:j,ctx:S}),g.$set(W);const K={};j&19&&(K.$$scope={dirty:j,ctx:S}),T.$set(K);const Q={};j&18&&(Q.$$scope={dirty:j,ctx:S}),E.$set(Q);const J={};j&19&&(J.$$scope={dirty:j,ctx:S}),N.$set(J)},i(S){B||($(e.$$.fragment,S),$(n.$$.fragment,S),$(o.$$.fragment,S),$(c.$$.fragment,S),$(u.$$.fragment,S),$(p.$$.fragment,S),$(d.$$.fragment,S),$(g.$$.fragment,S),$(T.$$.fragment,S),$(E.$$.fragment,S),$(N.$$.fragment,S),B=!0)},o(S){fe(e.$$.fragment,S),fe(n.$$.fragment,S),fe(o.$$.fragment,S),fe(c.$$.fragment,S),fe(u.$$.fragment,S),fe(p.$$.fragment,S),fe(d.$$.fragment,S),fe(g.$$.fragment,S),fe(T.$$.fragment,S),fe(E.$$.fragment,S),fe(N.$$.fragment,S),B=!1},d(S){Le(e,S),S&&A(l),Le(n,S),S&&A(i),Le(o,S),S&&A(a),Le(c,S),S&&A(_),Le(u,S),S&&A(f),Le(p,S),S&&A(v),Le(d,S),S&&A(h),Le(g,S),S&&A(k),Le(T,S),S&&A(O),Le(E,S),S&&A(I),Le(N,S)}}}function Zc(t){let e,l,n,i;const o=[xc,$c],a=[];function c(_,u){return _[1].trying?0:1}return e=c(t),l=a[e]=o[e](t),{c(){l.c(),n=Qt()},m(_,u){a[e].m(_,u),q(_,n,u),i=!0},p(_,u){let f=e;e=c(_),e===f?a[e].p(_,u):(gt(),fe(a[f],1,1,()=>{a[f]=null}),kt(),l=a[e],l?l.p(_,u):(l=a[e]=o[e](_),l.c()),$(l,1),l.m(n.parentNode,n))},i(_){i||($(l),i=!0)},o(_){fe(l),i=!1},d(_){a[e].d(_),_&&A(n)}}}function Jc(t){let e,l;return e=new pl({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Xe,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function $c(t){let e,l;return e=new pl({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p:Xe,i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function xc(t){let e,l;return e=new pl({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[1].trying}}),{c(){Re(e.$$.fragment)},m(n,i){De(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.message="Device is booting, please wait. Trying to reach it on "+n[1].trying),e.$set(o)},i(n){l||($(e.$$.fragment,n),l=!0)},o(n){fe(e.$$.fragment,n),l=!1},d(n){Le(e,n)}}}function e_(t){let e,l,n,i,o,a;l=new su({props:{basepath:t[0],$$slots:{default:[Xc]},$$scope:{ctx:t}}});const c=[Jc,Zc],_=[];function u(f,p){return f[1].upgrading?0:f[1].booting?1:-1}return~(i=u(t))&&(o=_[i]=c[i](t)),{c(){e=m("div"),Re(l.$$.fragment),n=b(),o&&o.c(),r(e,"class","container mx-auto m-3")},m(f,p){q(f,e,p),De(l,e,null),s(e,n),~i&&_[i].m(e,null),a=!0},p(f,[p]){const v={};p&1&&(v.basepath=f[0]),p&23&&(v.$$scope={dirty:p,ctx:f}),l.$set(v);let d=i;i=u(f),i===d?~i&&_[i].p(f,p):(o&&(gt(),fe(_[d],1,1,()=>{_[d]=null}),kt()),~i?(o=_[i],o?o.p(f,p):(o=_[i]=c[i](f),o.c()),$(o,1),o.m(e,null)):o=null)},i(f){a||($(l.$$.fragment,f),$(o),a=!0)},o(f){fe(l.$$.fragment,f),fe(o),a=!1},d(f){f&&A(e),Le(l),~i&&_[i].d()}}}function t_(t,e,l){let n=document.getElementsByTagName("base")[0].getAttribute("href");n||(n="/");let i={};vl.subscribe(c=>{i=c});let o={};dl.subscribe(c=>{var _;l(1,o=c),o.vndcfg===!1?en(n+"vendor"):o.usrcfg===!1?en(n+"setup"):o.fwconsent===0&&en(n+"consent"),o.ui.k===1?document.documentElement.classList.add("dark"):o.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"),o.ui.lang&&o.ui.lang!=((_=i==null?void 0:i.language)==null?void 0:_.code)&&ku(o.ui.lang)}),Ji();let a={};return cu.subscribe(c=>{l(2,a=c)}),[n,o,a]}class l_ extends Dt{constructor(e){super(),qt(this,e,t_,e_,Nt,{})}}new l_({target:document.getElementById("app")}); diff --git a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte index 565ced5c..5c70d7ff 100644 --- a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte +++ b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte @@ -684,7 +684,7 @@ {/if} - {#if configuration?.y} + {#if configuration?.u}
{translations.conf?.ui?.title ?? "User interface"}