From 2051230cb3a1084c1b79dbc95c065490c7f10bc5 Mon Sep 17 00:00:00 2001 From: EivindH06 Date: Mon, 6 Oct 2025 09:50:50 +0200 Subject: [PATCH] Added automatic IP detection to setup --- lib/SvelteUi/app/dist/index.css | 2 +- lib/SvelteUi/app/dist/index.js | 12 +- lib/SvelteUi/app/src/lib/Helpers.js | 78 ++++++++---- lib/SvelteUi/app/src/lib/SetupPanel.svelte | 44 ++++++- lib/SvelteUi/include/AmsWebServer.h | 1 + lib/SvelteUi/src/AmsWebServer.cpp | 132 ++++++++++++++++++++- 6 files changed, 230 insertions(+), 39 deletions(-) diff --git a/lib/SvelteUi/app/dist/index.css b/lib/SvelteUi/app/dist/index.css index 22cf9989..149edf11 100644 --- a/lib/SvelteUi/app/dist/index.css +++ b/lib/SvelteUi/app/dist/index.css @@ -1 +1 @@ -*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.inset-0{top:0;right:0;bottom:0;left:0}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.clear-both{clear:both}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-3{margin:.75rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-auto{margin-bottom:auto;margin-top:auto}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-10{width:2.5rem}.w-2\/3{width:66.666667%}.w-40{width:10rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-7{width:1.75rem}.w-96{width:24rem}.w-full{width:100%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.25rem*var(--tw-space-y-reverse));margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.bg-neas-green{--tw-bg-opacity:1;background-color:rgb(13 58 45/var(--tw-bg-opacity,1))}.bg-neas-green-90{--tw-bg-opacity:1;background-color:rgb(27 72 58/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-opacity-50{--tw-bg-opacity:.5}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-\[0\.5rem\]{padding-top:.5rem}.text-center{text-align:center}.text-right{text-align:right}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.capitalize{text-transform:capitalize}.italic{font-style:italic}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.text-neas-gray{--tw-text-opacity:1;color:rgb(241 246 245/var(--tw-text-opacity,1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-yellow-300{--tw-text-opacity:1;color:rgb(253 224 71/var(--tw-text-opacity,1))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hdr{--tw-bg-opacity:1;background-color:rgb(124 58 237/var(--tw-bg-opacity,1));border-radius:.375rem;margin-left:.5rem;margin-right:.5rem;padding:.25rem}.hdr:is(.dark *){--tw-bg-opacity:1;background-color:rgb(76 29 149/var(--tw-bg-opacity,1))}.logo{height:2rem;width:3rem}.cnt{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));border-radius:.75rem;margin:.5rem;padding:.5rem}.cnt:is(.dark *){--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(27 72 58/var(--tw-bg-opacity,1));color:rgb(255 255 255/var(--tw-text-opacity,1))}.cnt{min-height:268px}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{--tw-border-opacity:1;align-items:center;border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-top-left-radius:.375rem;border-width:1px 0 1px 1px;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}.in-pre:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1))}.in-post{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity,1));border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-top-right-radius:.375rem;border-width:1px 1px 1px 0;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}.in-post:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1))}.in-txt{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1));height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));color:rgb(255 255 255/var(--tw-text-opacity,1));cursor:not-allowed}.in-txt:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1));border-width:1px;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-txt:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.in-txt:disabled:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.in-f{--tw-border-opacity:1;border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-top-left-radius:.375rem;height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));cursor:not-allowed}.in-f:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1));border-width:1px;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-f:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.in-f:disabled:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.in-f:default{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-f:disabled{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-f:default:is(.dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-m{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-left-width:0;height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));color:rgb(255 255 255/var(--tw-text-opacity,1));cursor:not-allowed}.in-m:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1));border-width:1px;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-m:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.in-m:disabled:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.in-l{--tw-border-opacity:1;border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-left-width:0;border-top-right-radius:.375rem;height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));color:rgb(255 255 255/var(--tw-text-opacity,1));cursor:not-allowed}.in-l:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1));border-width:1px;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-l:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.in-l:disabled:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.in-l:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity,1))}.in-l:is(.dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity,1))}.in-s{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-radius:.375rem;height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));color:rgb(255 255 255/var(--tw-text-opacity,1));cursor:not-allowed}.in-s:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1));border-width:1px}.in-s:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.in-s:disabled:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.in-s::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.in-s::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.in-s:is(.dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-er{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.in-er:is(.dark *){--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.tr{text-align:right}.bd-green{background-color:rgb(22 163 74/var(--tw-bg-opacity,1));color:rgb(220 252 231/var(--tw-text-opacity,1))}.bd-green,.bd-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-yellow{background-color:rgb(202 138 4/var(--tw-bg-opacity,1));color:rgb(254 249 195/var(--tw-text-opacity,1))}.bd-red{background-color:rgb(220 38 38/var(--tw-bg-opacity,1));color:rgb(254 226 226/var(--tw-text-opacity,1))}.bd-blue,.bd-red{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-blue{background-color:rgb(37 99 235/var(--tw-bg-opacity,1));color:rgb(219 234 254/var(--tw-text-opacity,1))}.bd-gray{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity,1));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-on{background-color:rgb(22 163 74/var(--tw-bg-opacity,1));color:rgb(220 252 231/var(--tw-text-opacity,1))}.bd-off,.bd-on{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.25rem;margin-top:auto;padding:.125rem .25rem}.bd-off{background-color:rgb(75 85 99/var(--tw-bg-opacity,1));color:rgb(243 244 246/var(--tw-text-opacity,1))}.btn-pri{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity,1));margin-right:.75rem;padding:.5rem 1rem}.btn-red{background-color:rgb(220 38 38/var(--tw-bg-opacity,1))}.btn-red,.btn-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity,1));margin-left:.5rem;padding:.5rem 1rem}.btn-yellow{background-color:rgb(202 138 4/var(--tw-bg-opacity,1))}.btn-pri-sm{background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.btn-pri-sm,.btn-yellow-sm{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity,1));font-size:.75rem;line-height:1rem;margin-right:.75rem;padding:.25rem .5rem}.btn-yellow-sm{background-color:rgb(202 138 4/var(--tw-bg-opacity,1))}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}.pl-unt:is(.dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}.pl-snt:is(.dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1));font-family:Helvetica,Arial;font-size:.85em;font-weight:200}.tick:is(.dark *){fill:#fff}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#666;text-anchor:start}.tick text:is(.dark *){fill:#fff}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#23ac05!important}.tick.tick-green text{fill:#23ac05!important}.tick.tick-orange line{stroke:#b19601!important}.tick.tick-orange text{fill:#b19601!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.dark\:bg-gray-600:is(.dark *){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.dark\:bg-neas-green:is(.dark *){--tw-bg-opacity:1;background-color:rgb(13 58 45/var(--tw-bg-opacity,1))}.dark\:bg-opacity-80:is(.dark *){--tw-bg-opacity:.8}.dark\:text-white:is(.dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width:1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}} +*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.inset-0{top:0;right:0;bottom:0;left:0}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.clear-both{clear:both}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-3{margin:.75rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-auto{margin-bottom:auto;margin-top:auto}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-10{width:2.5rem}.w-2\/3{width:66.666667%}.w-40{width:10rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-7{width:1.75rem}.w-96{width:24rem}.w-full{width:100%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.list-disc{list-style-type:disc}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.25rem*var(--tw-space-y-reverse));margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.bg-neas-green{--tw-bg-opacity:1;background-color:rgb(13 58 45/var(--tw-bg-opacity,1))}.bg-neas-green-90{--tw-bg-opacity:1;background-color:rgb(27 72 58/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-opacity-50{--tw-bg-opacity:.5}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-\[0\.5rem\]{padding-top:.5rem}.text-center{text-align:center}.text-right{text-align:right}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.capitalize{text-transform:capitalize}.italic{font-style:italic}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.text-neas-gray{--tw-text-opacity:1;color:rgb(241 246 245/var(--tw-text-opacity,1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-yellow-300{--tw-text-opacity:1;color:rgb(253 224 71/var(--tw-text-opacity,1))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hdr{--tw-bg-opacity:1;background-color:rgb(124 58 237/var(--tw-bg-opacity,1));border-radius:.375rem;margin-left:.5rem;margin-right:.5rem;padding:.25rem}.hdr:is(.dark *){--tw-bg-opacity:1;background-color:rgb(76 29 149/var(--tw-bg-opacity,1))}.logo{height:2rem;width:3rem}.cnt{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));border-radius:.75rem;margin:.5rem;padding:.5rem}.cnt:is(.dark *){--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(27 72 58/var(--tw-bg-opacity,1));color:rgb(255 255 255/var(--tw-text-opacity,1))}.cnt{min-height:268px}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{--tw-border-opacity:1;align-items:center;border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-top-left-radius:.375rem;border-width:1px 0 1px 1px;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}.in-pre:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1))}.in-post{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity,1));border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-top-right-radius:.375rem;border-width:1px 1px 1px 0;display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}.in-post:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1))}.in-txt{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1));height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));color:rgb(255 255 255/var(--tw-text-opacity,1));cursor:not-allowed}.in-txt:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1));border-width:1px;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-txt:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.in-txt:disabled:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.in-f{--tw-border-opacity:1;border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-top-left-radius:.375rem;height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));cursor:not-allowed}.in-f:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1));border-width:1px;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-f:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.in-f:disabled:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.in-f:default{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-f:disabled{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-f:default:is(.dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-m{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-left-width:0;height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));color:rgb(255 255 255/var(--tw-text-opacity,1));cursor:not-allowed}.in-m:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1));border-width:1px;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-m:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.in-m:disabled:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.in-l{--tw-border-opacity:1;border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-left-width:0;border-top-right-radius:.375rem;height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));color:rgb(255 255 255/var(--tw-text-opacity,1));cursor:not-allowed}.in-l:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1));border-width:1px;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-l:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.in-l:disabled:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.in-l:is(.dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity,1))}.in-l:is(.dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity,1))}.in-s{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1));border-radius:.375rem;height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));color:rgb(255 255 255/var(--tw-text-opacity,1));cursor:not-allowed}.in-s:is(.dark *){--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1));border-color:rgb(31 41 55/var(--tw-border-opacity,1));border-width:1px}.in-s:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.in-s:disabled:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.in-s::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.in-s::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.in-s:is(.dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.in-er{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.in-er:is(.dark *){--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.tr{text-align:right}.bd-green{background-color:rgb(22 163 74/var(--tw-bg-opacity,1));color:rgb(220 252 231/var(--tw-text-opacity,1))}.bd-green,.bd-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-yellow{background-color:rgb(202 138 4/var(--tw-bg-opacity,1));color:rgb(254 249 195/var(--tw-text-opacity,1))}.bd-red{background-color:rgb(220 38 38/var(--tw-bg-opacity,1));color:rgb(254 226 226/var(--tw-text-opacity,1))}.bd-blue,.bd-red{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-blue{background-color:rgb(37 99 235/var(--tw-bg-opacity,1));color:rgb(219 234 254/var(--tw-text-opacity,1))}.bd-gray{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity,1));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-on{background-color:rgb(22 163 74/var(--tw-bg-opacity,1));color:rgb(220 252 231/var(--tw-text-opacity,1))}.bd-off,.bd-on{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.25rem;margin-top:auto;padding:.125rem .25rem}.bd-off{background-color:rgb(75 85 99/var(--tw-bg-opacity,1));color:rgb(243 244 246/var(--tw-text-opacity,1))}.btn-pri{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity,1));margin-right:.75rem;padding:.5rem 1rem}.btn-red{background-color:rgb(220 38 38/var(--tw-bg-opacity,1))}.btn-red,.btn-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity,1));margin-left:.5rem;padding:.5rem 1rem}.btn-yellow{background-color:rgb(202 138 4/var(--tw-bg-opacity,1))}.btn-pri-sm{background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.btn-pri-sm,.btn-yellow-sm{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity,1));font-size:.75rem;line-height:1rem;margin-right:.75rem;padding:.25rem .5rem}.btn-yellow-sm{background-color:rgb(202 138 4/var(--tw-bg-opacity,1))}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}.pl-unt:is(.dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}.pl-snt:is(.dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity,1))}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1));font-family:Helvetica,Arial;font-size:.85em;font-weight:200}.tick:is(.dark *){fill:#fff}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#666;text-anchor:start}.tick text:is(.dark *){fill:#fff}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#23ac05!important}.tick.tick-green text{fill:#23ac05!important}.tick.tick-orange line{stroke:#b19601!important}.tick.tick-orange text{fill:#b19601!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.dark\:bg-gray-600:is(.dark *){--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.dark\:bg-neas-green:is(.dark *){--tw-bg-opacity:1;background-color:rgb(13 58 45/var(--tw-bg-opacity,1))}.dark\:bg-opacity-80:is(.dark *){--tw-bg-opacity:.8}.dark\:text-gray-300:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.dark\:text-white:is(.dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width:1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}} diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index 25a57571..f63573fb 100644 --- a/lib/SvelteUi/app/dist/index.js +++ b/lib/SvelteUi/app/dist/index.js @@ -1,7 +1,7 @@ -var Fu=Object.defineProperty;var Uu=(t,e,l)=>e in t?Fu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[e]=l;var mi=(t,e,l)=>(Uu(t,typeof e!="symbol"?e+"":e,l),l);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function l(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=l(i);fetch(i.href,s)}})();function Ve(){}function gl(t,e){for(const l in e)t[l]=e[l];return t}function Hf(t){return t()}function as(){return Object.create(null)}function Dt(t){t.forEach(Hf)}function ji(t){return typeof t=="function"}function Ct(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Zn;function Il(t,e){return t===e?!0:(Zn||(Zn=document.createElement("a")),Zn.href=e,t===Zn.href)}function Bu(t){return Object.keys(t).length===0}function zi(t,...e){if(t==null){for(const n of e)n(void 0);return Ve}const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function rn(t){let e;return zi(t,l=>e=l)(),e}function Pl(t,e,l){t.$$.on_destroy.push(zi(e,l))}function Hi(t,e,l,n){if(t){const i=Wf(t,e,l,n);return t[0](i)}}function Wf(t,e,l,n){return t[1]&&n?gl(l.ctx.slice(),t[1](n(e))):l.ctx}function Wi(t,e,l,n){if(t[2]&&n){const i=t[2](n(l));if(e.dirty===void 0)return i;if(typeof i=="object"){const s=[],o=Math.max(e.dirty.length,i.length);for(let r=0;r32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function _n(t){return function(e){return e.preventDefault(),t.call(this,e)}}function u(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}const ju=["width","height"];function kn(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&&ju.indexOf(n)===-1?t[n]=e[n]:u(t,n,e[n])}function zu(t){let e;return{p(...l){e=l,e.forEach(n=>t.push(n))},r(){e.forEach(l=>t.splice(t.indexOf(l),1))}}}function ye(t){return t===""?null:+t}function Hu(t){return Array.from(t.childNodes)}function q(t,e){e=""+e,t.data!==e&&(t.data=e)}function Wu(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Gu(t,e,l){~yu.indexOf(l)?Wu(t,e):q(t,e)}function V(t,e){t.value=e??""}function nn(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function Xe(t,e,l){for(let n=0;n{o.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{s=re(n.contentWindow,"resize",e),e()}),a(t,n),()=>{(i||s&&n.contentWindow)&&s(),N(n)}}function Ku(t,e,{bubbles:l=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:l,cancelable:n})}function fs(t,e){return new t(e)}let yn;function Fn(t){yn=t}function Kn(){if(!yn)throw new Error("Function called outside component initialization");return yn}function Gf(t){Kn().$$.on_mount.push(t)}function Yu(t){Kn().$$.on_destroy.push(t)}function Xu(){const t=Kn();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const s=Ku(e,l,{cancelable:n});return i.slice().forEach(o=>{o.call(t,s)}),!s.defaultPrevented}return!0}}function Un(t,e){return Kn().$$.context.set(t,e),e}function on(t){return Kn().$$.context.get(t)}const hn=[],fi=[];let gn=[];const us=[],Vf=Promise.resolve();let Ci=!1;function Kf(){Ci||(Ci=!0,Vf.then(Yf))}function Qu(){return Kf(),Vf}function qt(t){gn.push(t)}const pi=new Set;let pn=0;function Yf(){if(pn!==0)return;const t=yn;do{try{for(;pnt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),gn=e}const ni=new Set;let fn;function mt(){fn={r:0,c:[],p:fn}}function pt(){fn.r||Dt(fn.c),fn=fn.p}function Z(t,e){t&&t.i&&(ni.delete(t),t.i(e))}function ie(t,e,l,n){if(t&&t.o){if(ni.has(t))return;ni.add(t),fn.c.push(()=>{ni.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function it(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function $u(t,e){t.d(1),e.delete(t.key)}function xu(t,e,l,n,i,s,o,r,f,c,_,d){let m=t.length,v=s.length,h=m;const g={};for(;h--;)g[t[h].key]=h;const w=[],k=new Map,A=new Map,I=[];for(h=v;h--;){const E=d(i,s,h),F=l(E);let H=o.get(F);H?n&&I.push(()=>H.p(E,e)):(H=c(F,E),H.c()),k.set(F,w[h]=H),F in g&&A.set(F,Math.abs(h-g[F]))}const L=new Set,M=new Set;function O(E){Z(E,1),E.m(r,_),o.set(E.key,E),_=E.first,v--}for(;m&&v;){const E=w[v-1],F=t[m-1],H=E.key,j=F.key;E===F?(_=E.first,m--,v--):k.has(j)?!o.has(H)||L.has(H)?O(E):M.has(j)?m--:A.get(H)>A.get(j)?(M.add(H),O(E)):(L.add(j),m--):(f(F,o),m--)}for(;m--;){const E=t[m];k.has(E.key)||f(E,o)}for(;v;)O(w[v-1]);return Dt(I),w}function Si(t,e){const l={},n={},i={$$scope:1};let s=t.length;for(;s--;){const o=t[s],r=e[s];if(r){for(const f in o)f in r||(n[f]=1);for(const f in r)i[f]||(l[f]=r[f],i[f]=1);t[s]=r}else for(const f in o)i[f]=1}for(const o in n)o in l||(l[o]=void 0);return l}function $n(t){return typeof t=="object"&&t!==null?t:{}}function Ne(t){t&&t.c()}function Se(t,e,l){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,l),qt(()=>{const s=t.$$.on_mount.map(Hf).filter(ji);t.$$.on_destroy?t.$$.on_destroy.push(...s):Dt(s),t.$$.on_mount=[]}),i.forEach(qt)}function Me(t,e){const l=t.$$;l.fragment!==null&&(Ju(l.after_update),Dt(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function er(t,e){t.$$.dirty[0]===-1&&(hn.push(t),Kf(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const h=v.length?v[0]:m;return c.ctx&&i(c.ctx[d],c.ctx[d]=h)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](h),_&&er(t,d)),m}):[],c.update(),_=!0,Dt(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const d=Hu(e.target);c.fragment&&c.fragment.l(d),d.forEach(N)}else c.fragment&&c.fragment.c();e.intro&&Z(t.$$.fragment),Se(t,e.target,e.anchor),Yf()}Fn(f)}class Mt{constructor(){mi(this,"$$");mi(this,"$$set")}$destroy(){Me(this,1),this.$destroy=Ve}$on(e,l){if(!ji(l))return Ve;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&&!Bu(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const tr="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(tr);const rs=t=>typeof t>"u",Xf=t=>typeof t=="function",Qf=t=>typeof t=="number";function lr(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Zf(){let t=0;return()=>t++}function nr(){return Math.random().toString(36).substring(2)}const Al=typeof window>"u";function Jf(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const $f=(t,e)=>t?{}:{style:e},Mi=t=>({"aria-hidden":"true",...$f(t,"display:none;")}),dn=[];function xf(t,e){return{subscribe:al(t,e).subscribe}}function al(t,e=Ve){let l;const n=new Set;function i(r){if(Ct(t,r)&&(t=r,l)){const f=!dn.length;for(const c of n)c[1](),dn.push(c,t);if(f){for(let c=0;c{n.delete(c),n.size===0&&l&&(l(),l=null)}}return{set:i,update:s,subscribe:o}}function ir(t,e,l){const n=!Array.isArray(t),i=n?[t]:t;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return xf(l,(o,r)=>{let f=!1;const c=[];let _=0,d=Ve;const m=()=>{if(_)return;d();const h=e(n?c[0]:c,o,r);s?o(h):d=ji(h)?h:Ve},v=i.map((h,g)=>zi(h,w=>{c[g]=w,_&=~(1<{_|=1<`@@svnav-ctx__${t}`,Ni=Yn("LOCATION"),wn=Yn("ROUTER"),eu=Yn("ROUTE"),sr=Yn("ROUTE_PARAMS"),or=Yn("FOCUS_ELEM"),tu=/^:(.+)/,On=(t,e,l)=>t.substr(e,l),Pi=(t,e)=>On(t,0,e.length)===e,ar=t=>t==="",fr=t=>tu.test(t),lu=t=>t[0]==="*",ur=t=>t.replace(/\*.*$/,""),nu=t=>t.replace(/(^\/+|\/+$)/g,"");function Tl(t,e=!1){const l=nu(t).split("/");return e?l.filter(Boolean):l}const di=(t,e)=>t+(e?`?${e}`:""),Yi=t=>`/${nu(t)}`;function Xn(...t){const e=n=>Tl(n,!0).join("/"),l=t.map(e).join("/");return Yi(l)}const Xi=1,ci=2,cn=3,rr=4,iu=5,cr=6,su=7,_r=8,mr=9,ou=10,au=11,pr={[Xi]:"Link",[ci]:"Route",[cn]:"Router",[rr]:"useFocus",[iu]:"useLocation",[cr]:"useMatch",[su]:"useNavigate",[_r]:"useParams",[mr]:"useResolvable",[ou]:"useResolve",[au]:"navigate"},Qi=t=>pr[t];function dr(t,e){let l;return t===ci?l=e.path?`path="${e.path}"`:"default":t===Xi?l=`to="${e.to}"`:t===cn&&(l=`basepath="${e.basepath||""}"`),`<${Qi(t)} ${l||""} />`}function hr(t,e,l,n){const i=l&&dr(n||t,l),s=i?` +var yu=Object.defineProperty;var ju=(t,e,l)=>e in t?yu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[e]=l;var _i=(t,e,l)=>(ju(t,typeof e!="symbol"?e+"":e,l),l);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function l(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=l(i);fetch(i.href,s)}})();function Ve(){}function gl(t,e){for(const l in e)t[l]=e[l];return t}function Vf(t){return t()}function os(){return Object.create(null)}function Dt(t){t.forEach(Vf)}function yi(t){return typeof t=="function"}function Ct(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Zn;function Il(t,e){return t===e?!0:(Zn||(Zn=document.createElement("a")),Zn.href=e,t===Zn.href)}function zu(t){return Object.keys(t).length===0}function ji(t,...e){if(t==null){for(const n of e)n(void 0);return Ve}const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function nn(t){let e;return ji(t,l=>e=l)(),e}function Tl(t,e,l){t.$$.on_destroy.push(ji(e,l))}function zi(t,e,l,n){if(t){const i=Kf(t,e,l,n);return t[0](i)}}function Kf(t,e,l,n){return t[1]&&n?gl(l.ctx.slice(),t[1](n(e))):l.ctx}function Hi(t,e,l,n){if(t[2]&&n){const i=t[2](n(l));if(e.dirty===void 0)return i;if(typeof i=="object"){const s=[],o=Math.max(e.dirty.length,i.length);for(let r=0;r32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function mn(t){return function(e){return e.preventDefault(),t.call(this,e)}}function u(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}const Wu=["width","height"];function wn(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&&Wu.indexOf(n)===-1?t[n]=e[n]:u(t,n,e[n])}function Gu(t){let e;return{p(...l){e=l,e.forEach(n=>t.push(n))},r(){e.forEach(l=>t.splice(t.indexOf(l),1))}}}function ye(t){return t===""?null:+t}function Vu(t){return Array.from(t.childNodes)}function q(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ku(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function Yu(t,e,l){~Hu.indexOf(l)?Ku(t,e):q(t,e)}function V(t,e){t.value=e??""}function sn(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function Xe(t,e,l){for(let n=0;n{o.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{s=re(n.contentWindow,"resize",e),e()}),a(t,n),()=>{(i||s&&n.contentWindow)&&s(),M(n)}}function Qu(t,e,{bubbles:l=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:l,cancelable:n})}function as(t,e){return new t(e)}let jn;function Un(t){jn=t}function Kn(){if(!jn)throw new Error("Function called outside component initialization");return jn}function Yf(t){Kn().$$.on_mount.push(t)}function Zu(t){Kn().$$.on_destroy.push(t)}function Ju(){const t=Kn();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const s=Qu(e,l,{cancelable:n});return i.slice().forEach(o=>{o.call(t,s)}),!s.defaultPrevented}return!0}}function Bn(t,e){return Kn().$$.context.set(t,e),e}function an(t){return Kn().$$.context.get(t)}const vn=[],ai=[];let kn=[];const fs=[],Xf=Promise.resolve();let wi=!1;function Qf(){wi||(wi=!0,Xf.then(Zf))}function $u(){return Qf(),Xf}function qt(t){kn.push(t)}const mi=new Set;let dn=0;function Zf(){if(dn!==0)return;const t=jn;do{try{for(;dnt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),kn=e}const li=new Set;let un;function mt(){un={r:0,c:[],p:un}}function pt(){un.r||Dt(un.c),un=un.p}function Z(t,e){t&&t.i&&(li.delete(t),t.i(e))}function oe(t,e,l,n){if(t&&t.o){if(li.has(t))return;li.add(t),un.c.push(()=>{li.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function tt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function tr(t,e){t.d(1),e.delete(t.key)}function lr(t,e,l,n,i,s,o,r,f,c,_,d){let m=t.length,h=s.length,v=m;const b={};for(;v--;)b[t[v].key]=v;const w=[],k=new Map,A=new Map,L=[];for(v=h;v--;){const E=d(i,s,v),F=l(E);let H=o.get(F);H?n&&L.push(()=>H.p(E,e)):(H=c(F,E),H.c()),k.set(F,w[v]=H),F in b&&A.set(F,Math.abs(v-b[F]))}const O=new Set,N=new Set;function D(E){Z(E,1),E.m(r,_),o.set(E.key,E),_=E.first,h--}for(;m&&h;){const E=w[h-1],F=t[m-1],H=E.key,y=F.key;E===F?(_=E.first,m--,h--):k.has(y)?!o.has(H)||O.has(H)?D(E):N.has(y)?m--:A.get(H)>A.get(y)?(N.add(H),D(E)):(O.add(y),m--):(f(F,o),m--)}for(;m--;){const E=t[m];k.has(E.key)||f(E,o)}for(;h;)D(w[h-1]);return Dt(L),w}function Ci(t,e){const l={},n={},i={$$scope:1};let s=t.length;for(;s--;){const o=t[s],r=e[s];if(r){for(const f in o)f in r||(n[f]=1);for(const f in r)i[f]||(l[f]=r[f],i[f]=1);t[s]=r}else for(const f in o)i[f]=1}for(const o in n)o in l||(l[o]=void 0);return l}function $n(t){return typeof t=="object"&&t!==null?t:{}}function Ne(t){t&&t.c()}function Se(t,e,l){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,l),qt(()=>{const s=t.$$.on_mount.map(Vf).filter(yi);t.$$.on_destroy?t.$$.on_destroy.push(...s):Dt(s),t.$$.on_mount=[]}),i.forEach(qt)}function Me(t,e){const l=t.$$;l.fragment!==null&&(er(l.after_update),Dt(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function nr(t,e){t.$$.dirty[0]===-1&&(vn.push(t),Qf(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const v=h.length?h[0]:m;return c.ctx&&i(c.ctx[d],c.ctx[d]=v)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](v),_&&nr(t,d)),m}):[],c.update(),_=!0,Dt(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const d=Vu(e.target);c.fragment&&c.fragment.l(d),d.forEach(M)}else c.fragment&&c.fragment.c();e.intro&&Z(t.$$.fragment),Se(t,e.target,e.anchor),Zf()}Un(f)}class Mt{constructor(){_i(this,"$$");_i(this,"$$set")}$destroy(){Me(this,1),this.$destroy=Ve}$on(e,l){if(!yi(l))return Ve;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&&!zu(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const ir="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(ir);const us=t=>typeof t>"u",Jf=t=>typeof t=="function",$f=t=>typeof t=="number";function sr(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function xf(){let t=0;return()=>t++}function or(){return Math.random().toString(36).substring(2)}const Al=typeof window>"u";function eu(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const tu=(t,e)=>t?{}:{style:e},Si=t=>({"aria-hidden":"true",...tu(t,"display:none;")}),hn=[];function lu(t,e){return{subscribe:al(t,e).subscribe}}function al(t,e=Ve){let l;const n=new Set;function i(r){if(Ct(t,r)&&(t=r,l)){const f=!hn.length;for(const c of n)c[1](),hn.push(c,t);if(f){for(let c=0;c{n.delete(c),n.size===0&&l&&(l(),l=null)}}return{set:i,update:s,subscribe:o}}function ar(t,e,l){const n=!Array.isArray(t),i=n?[t]:t;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return lu(l,(o,r)=>{let f=!1;const c=[];let _=0,d=Ve;const m=()=>{if(_)return;d();const v=e(n?c[0]:c,o,r);s?o(v):d=yi(v)?v:Ve},h=i.map((v,b)=>ji(v,w=>{c[b]=w,_&=~(1<{_|=1<`@@svnav-ctx__${t}`,Mi=Yn("LOCATION"),Cn=Yn("ROUTER"),nu=Yn("ROUTE"),fr=Yn("ROUTE_PARAMS"),ur=Yn("FOCUS_ELEM"),iu=/^:(.+)/,In=(t,e,l)=>t.substr(e,l),Ni=(t,e)=>In(t,0,e.length)===e,rr=t=>t==="",cr=t=>iu.test(t),su=t=>t[0]==="*",_r=t=>t.replace(/\*.*$/,""),ou=t=>t.replace(/(^\/+|\/+$)/g,"");function Pl(t,e=!1){const l=ou(t).split("/");return e?l.filter(Boolean):l}const pi=(t,e)=>t+(e?`?${e}`:""),Ki=t=>`/${ou(t)}`;function Xn(...t){const e=n=>Pl(n,!0).join("/"),l=t.map(e).join("/");return Ki(l)}const Yi=1,ri=2,_n=3,mr=4,au=5,pr=6,fu=7,dr=8,hr=9,uu=10,ru=11,vr={[Yi]:"Link",[ri]:"Route",[_n]:"Router",[mr]:"useFocus",[au]:"useLocation",[pr]:"useMatch",[fu]:"useNavigate",[dr]:"useParams",[hr]:"useResolvable",[uu]:"useResolve",[ru]:"navigate"},Xi=t=>vr[t];function br(t,e){let l;return t===ri?l=e.path?`path="${e.path}"`:"default":t===Yi?l=`to="${e.to}"`:t===_n&&(l=`basepath="${e.basepath||""}"`),`<${Xi(t)} ${l||""} />`}function gr(t,e,l,n){const i=l&&br(n||t,l),s=i?` -Occurred in: ${i}`:"",o=Qi(t),r=Xf(e)?e(o):e;return`<${o}> ${r}${s}`}const fu=t=>(...e)=>t(hr(...e)),uu=fu(t=>{throw new Error(t)}),ui=fu(console.warn),cs=4,vr=3,br=2,gr=1,kr=1;function wr(t,e){const l=t.default?0:Tl(t.fullPath).reduce((n,i)=>{let s=n;return s+=cs,ar(i)?s+=kr:fr(i)?s+=br:lu(i)?s-=cs+gr:s+=vr,s},0);return{route:t,score:l,index:e}}function Cr(t){return t.map(wr).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function ru(t,e){let l,n;const[i]=e.split("?"),s=Tl(i),o=s[0]==="",r=Cr(t);for(let f=0,c=r.length;f({..._,params:m,uri:k});if(_.default){n=v(e);continue}const h=Tl(_.fullPath),g=Math.max(s.length,h.length);let w=0;for(;w{c===".."?f.pop():c!=="."&&f.push(c)}),di(`/${f.join("/")}`,n)}function _s(t,e){const{pathname:l,hash:n="",search:i="",state:s}=t,o=Tl(e,!0),r=Tl(l,!0);for(;o.length;)o[0]!==r[0]&&uu(cn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),o.shift(),r.shift();return{pathname:Xn(...r),hash:n,search:i,state:s}}const ms=t=>t.length===1?"":t,Zi=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,s=i?ms(On(t,l)):"",o=i?On(t,0,l):t,r=n?ms(On(o,e)):"";return{pathname:(n?On(o,0,e):o)||"/",search:r,hash:s}},Mr=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function Nr(t,e,l){return Xn(l,Sr(t,e))}function Pr(t,e){const l=Yi(ur(t)),n=Tl(l,!0),i=Tl(e,!0).slice(0,n.length),s=cu({fullPath:l},Xn(...i));return s&&s.uri}const hi="POP",Tr="PUSH",Er="REPLACE";function vi(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function qr(t){let e=[],l=vi(t),n=hi;const i=(s=e)=>s.forEach(o=>o({location:l,action:n}));return{get location(){return l},listen(s){e.push(s);const o=()=>{l=vi(t),n=hi,i([s])};i([s]);const r=Jf(t,"popstate",o);return()=>{r(),e=e.filter(f=>f!==s)}},navigate(s,o){const{state:r={},replace:f=!1}=o||{};if(n=f?Er:Tr,Qf(s))o&&ui(au,"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(s);else{const c={...r,_key:nr()};try{t.history[f?"replaceState":"pushState"](c,"",s)}catch{t.location[f?"replace":"assign"](s)}}l=vi(t),i()}}}function bi(t,e){return{...Zi(e),state:t}}function Dr(t="/"){let e=0,l=[bi(null,t)];return{get entries(){return l},get location(){return l[e]},addEventListener(){},removeEventListener(){},history:{get state(){return l[e].state},pushState(n,i,s){e++,l=l.slice(0,e),l.push(bi(n,s))},replaceState(n,i,s){l[e]=bi(n,s)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const Ar=!!(!Al&&window.document&&window.document.createElement),Lr=!Al&&window.location.origin==="null",_u=qr(Ar&&!Lr?window:Dr()),{navigate:sn}=_u;let El=null,mu=!0;function Or(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nEl.level||t.level===El.level&&Or(t.routerId,El.routerId))&&(El=t)}function Rr(){El=null}function Fr(){mu=!1}function ps(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=Jf(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function Ur(t,e){return Number(t.dataset.svnavRouteEnd)===e}function Br(t){return/^H[1-6]$/i.test(t.tagName)}function ds(t,e=document){return e.querySelector(t)}function yr(t){let l=ds(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!Ur(l,t);){if(Br(l))return l;const n=ds("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function jr(t){Promise.resolve(rn(t.focusElement)).then(e=>{const l=e||yr(t.id);l||ui(cn,`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,ci),!ps(l)&&ps(document.documentElement)})}const zr=(t,e,l)=>(n,i)=>Qu().then(()=>{if(!El||mu){Fr();return}if(n&&jr(El.route),t.announcements&&i){const{path:s,fullPath:o,meta:r,params:f,uri:c}=El.route,_=t.createAnnouncement({path:s,fullPath:o,meta:r,params:f,uri:c},rn(l));Promise.resolve(_).then(d=>{e.set(d)})}Rr()}),Hr="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 Wr(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},$f(t[6],Hr)],i={};for(let s=0;s`Navigated to ${z.uri}`,announcements:!0,...h},k=_,A=Yi(_),I=on(Ni),L=on(wn),M=!I,O=Vr(),E=v&&!(L&&!L.manageFocus),F=al("");Pl(t,F,z=>l(0,r=z));const H=L?L.disableInlineStyles:g,j=al([]);Pl(t,j,z=>l(20,o=z));const S=al(null);Pl(t,S,z=>l(18,i=z));let y=!1;const J=M?0:L.level+1,K=M?al((()=>_s(Al?Zi(d):m.location,A))()):I;Pl(t,K,z=>l(17,n=z));const X=al(n);Pl(t,X,z=>l(19,s=z));const U=zr(w,F,K),Y=z=>x=>x.filter(fe=>fe.id!==z);function le(z){if(Al){if(y)return;const x=cu(z,n.pathname);if(x)return y=!0,x}else j.update(x=>{const fe=Y(z.id)(x);return fe.push(z),fe})}function $(z){j.update(Y(z))}return!M&&_!==hs&&ui(cn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:_}),M&&(Gf(()=>m.listen(x=>{const fe=_s(x.location,A);X.set(n),K.set(fe)})),Un(Ni,K)),Un(wn,{activeRoute:S,registerRoute:le,unregisterRoute:$,manageFocus:E,level:J,id:O,history:M?m:L.history,basepath:M?A:L.basepath,disableInlineStyles:H}),t.$$set=z=>{"basepath"in z&&l(11,_=z.basepath),"url"in z&&l(12,d=z.url),"history"in z&&l(13,m=z.history),"primary"in z&&l(14,v=z.primary),"a11y"in z&&l(15,h=z.a11y),"disableInlineStyles"in z&&l(16,g=z.disableInlineStyles),"$$scope"in z&&l(21,c=z.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&_!==k&&ui(cn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const z=ru(o,n.pathname);S.set(z)}if(t.$$.dirty[0]&655360&&M){const z=!!n.hash,x=!z&&E,fe=!z||n.pathname!==s.pathname;U(x,fe)}t.$$.dirty[0]&262144&&E&&i&&i.primary&&Ir({level:J,routerId:O,route:i})},[r,w,M,O,E,F,H,j,S,K,X,_,d,m,v,h,g,n,i,s,o,c,f]}class Yr extends Mt{constructor(e){super(),St(this,e,Kr,Gr,Ct,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const pu=Yr;function Qn(t,e,l=wn,n=cn){on(l)||uu(t,s=>`You cannot use ${s} outside of a ${Qi(n)}.`,e)}const Xr=t=>{const{subscribe:e}=on(t);return{subscribe:e}};function du(){return Qn(iu),Xr(Ni)}function hu(){const{history:t}=on(wn);return t}function vu(){const t=on(eu);return t?ir(t,e=>e.base):al("/")}function bu(){Qn(ou);const t=vu(),{basepath:e}=on(wn);return n=>Nr(n,rn(t),e)}function Qr(){Qn(su);const t=bu(),{navigate:e}=hu();return(n,i)=>{const s=Qf(n)?n:t(n);return e(s,i)}}const Zr=t=>({params:t&16,location:t&8}),vs=t=>({params:Al?rn(t[10]):t[4],location:t[3],navigate:t[11]});function bs(t){let e,l;return e=new pu({props:{primary:t[1],$$slots:{default:[xr]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&2&&(s.primary=n[1]),i&528409&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function Jr(t){let e;const l=t[18].default,n=Hi(l,t,t[19],vs);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&524312)&&Gi(n,l,i,i[19],e?Wi(l,i[19],s,Zr):Vi(i[19]),vs)},i(i){e||(Z(n,i),e=!0)},o(i){ie(n,i),e=!1},d(i){n&&n.d(i)}}}function $r(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Al?rn(t[10]):t[4],t[12]];var s=t[0];function o(r,f){let c={};for(let _=0;_{Me(c,1)}),pt()}s?(e=fs(s,o(r,f)),Ne(e.$$.fragment),Z(e.$$.fragment,1),Se(e,l.parentNode,l)):e=null}else if(s){const c=f&7192?Si(i,[f&8&&{location:r[3]},f&2048&&{navigate:r[11]},f&1040&&$n(Al?rn(r[10]):r[4]),f&4096&&$n(r[12])]):{};e.$set(c)}},i(r){n||(e&&Z(e.$$.fragment,r),n=!0)},o(r){e&&ie(e.$$.fragment,r),n=!1},d(r){r&&N(l),e&&Me(e,r)}}}function xr(t){let e,l,n,i;const s=[$r,Jr],o=[];function r(f,c){return f[0]!==null?0:1}return e=r(t),l=o[e]=s[e](t),{c(){l.c(),n=yt()},m(f,c){o[e].m(f,c),P(f,n,c),i=!0},p(f,c){let _=e;e=r(f),e===_?o[e].p(f,c):(mt(),ie(o[_],1,1,()=>{o[_]=null}),pt(),l=o[e],l?l.p(f,c):(l=o[e]=s[e](f),l.c()),Z(l,1),l.m(n.parentNode,n))},i(f){i||(Z(l),i=!0)},o(f){ie(l),i=!1},d(f){f&&N(n),o[e].d(f)}}}function e1(t){let e,l,n,i,s,o=[Mi(t[7]),{"data-svnav-route-start":t[5]}],r={};for(let d=0;d{f=null}),pt())},i(d){s||(Z(f),s=!0)},o(d){ie(f),s=!1},d(d){d&&(N(e),N(l),N(n),N(i)),f&&f.d(d)}}}const t1=Zf();function l1(t,e,l){let n;const i=["path","component","meta","primary"];let s=ai(e,i),o,r,f,c,{$$slots:_={},$$scope:d}=e,{path:m=""}=e,{component:v=null}=e,{meta:h={}}=e,{primary:g=!0}=e;Qn(ci,e);const w=t1(),{registerRoute:k,unregisterRoute:A,activeRoute:I,disableInlineStyles:L}=on(wn);Pl(t,I,y=>l(16,o=y));const M=vu();Pl(t,M,y=>l(17,f=y));const O=du();Pl(t,O,y=>l(3,r=y));const E=al(null);let F;const H=al(),j=al({});Pl(t,j,y=>l(4,c=y)),Un(eu,H),Un(sr,j),Un(or,E);const S=Qr();return Al||Yu(()=>A(w)),t.$$set=y=>{l(24,e=gl(gl({},e),oi(y))),l(12,s=ai(e,i)),"path"in y&&l(13,m=y.path),"component"in y&&l(0,v=y.component),"meta"in y&&l(14,h=y.meta),"primary"in y&&l(1,g=y.primary),"$$scope"in y&&l(19,d=y.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const y=m==="",J=Xn(f,m),G={id:w,path:m,meta:h,default:y,fullPath:y?"":J,base:y?f:Pr(J,r.pathname),primary:g,focusElement:E};H.set(G),l(15,F=k(G))}if(t.$$.dirty&98304&&l(2,n=!!(F||o&&o.id===w)),t.$$.dirty&98308&&n){const{params:y}=F||o;j.set(y)}},e=oi(e),[v,g,n,r,c,w,I,L,M,O,j,S,s,m,h,F,o,f,_,d]}class n1 extends Mt{constructor(e){super(),St(this,e,l1,e1,Ct,{path:13,component:0,meta:14,primary:1})}}const bl=n1;function i1(t){let e,l,n,i;const s=t[13].default,o=Hi(s,t,t[12],null);let r=[{href:t[0]},t[2],t[1]],f={};for(let c=0;cl(11,d=E));const I=Xu(),L=bu(),{navigate:M}=hu();function O(E){I("click",E),lr(E)&&(E.preventDefault(),M(n,{state:w,replace:o||g}))}return t.$$set=E=>{l(19,e=gl(gl({},e),oi(E))),l(18,_=ai(e,c)),"to"in E&&l(5,h=E.to),"replace"in E&&l(6,g=E.replace),"state"in E&&l(7,w=E.state),"getProps"in E&&l(8,k=E.getProps),"$$scope"in E&&l(12,v=E.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=L(h,d)),t.$$.dirty&2049&&l(10,i=Pi(d.pathname,n)),t.$$.dirty&2049&&l(9,s=n===d.pathname),t.$$.dirty&2049&&(o=Zi(n)===Mr(d)),t.$$.dirty&512&&l(2,r=s?{"aria-current":"page"}:{}),l(1,f=(()=>{if(Xf(k)){const E=k({location:d,href:n,isPartiallyCurrent:i,isCurrent:s});return{..._,...E}}return _})())},e=oi(e),[n,f,r,A,O,h,g,w,k,s,i,d,v,m]}class o1 extends Mt{constructor(e){super(),St(this,e,s1,i1,Ct,{to:5,replace:6,state:7,getProps:8})}}const hl=o1;function xn(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function a1(t,e){return t>218&&t<242?"#23ac05":t>212&&t<248?"#b1d900":t>208&&t<252?"#a3b200":"#b20000"}function Ji(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 jn(t){return t>75?"#23ac05":t>50?"#77d900":t>25?"#94d900":"#569f12"}function ri(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 gt(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function Ye(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 245:return"wESP32";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"µHAN 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 Bn(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Wt(t,e){return t==1||t==2&&e}function vl(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function zt(t,e){return t==null||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 f1(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function u1(t){return t=="EOE"?"https://transparency.entsoe.eu/":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}let ei=0;function zn(t,e){var l="";ei++;var n=function(){setTimeout(zn,1e3,t,e)};if(t.net.ip&&ei%3==0){if(!t.net.ip){n();return}l="http://"+t.net.ip}else t.hostname&&ei%3==1?l="http://"+t.hostname:t.hostname&&ei%3==2?l="http://"+t.hostname+".local":l="";console&&console.log("Trying url "+l),e&&e(l);var i=new XMLHttpRequest;i.timeout=5e3,i.addEventListener("abort",n),i.addEventListener("error",n),i.addEventListener("timeout",n),i.addEventListener("load",function(s){window.location.href=l||"/"}),i.open("GET",l+"/is-alive",!0),i.send()}function Zt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function gs(t){return t.startsWith("esp32")?"esp32":t}function rl(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}function Hn(t,e){let l=[zt(t,2),e];if(typeof t>"u")l[0]="-",l[1]=e;else if(Math.abs(t*100)<100){switch(l[0]=zt(t*100,2),e){case"NOK":case"DKK":e="øre";break;case"SEK":e="öre";break;case"EUR":e="cent";break;case"CHF":e="rp.";break;default:e=e+"/100"}l[1]=e}return l}let ii="((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}",Ol="[\\x20-\\x7E]+",Wn="[\\x20-\\xFF]+",Gn="[A-Za-z0-9_\\-]+",gu="[0-9A-Fa-f]+",Ln="[0-9]+",si={},Ti=[];async function r1(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),s=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),s}let gi;async function ku(){if(Ti.length){let t=Ti.shift();delete si[t.resource];try{let e=await r1(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]()}}gi&&clearTimeout(gi),gi=setTimeout(ku,100)}ku();async function kl(t,e={}){let l;return si[t]?l=si[t]:(l={resource:t,options:e,callbacks:[]},si[t]=l,Ti.push(l)),new Promise(i=>l.callbacks.push(i))}let Nl={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null,if:{eth:!1}};async function _i(){Nl=await(await kl("sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),_l.set(Nl)}const _l=al(Nl,t=>(_i(),function(){}));function c1(t){_l.update(e=>(e.trying=t,e))}let ti=0,ks=-127,ws=null,_1={};const m1=xf(_1,t=>{let e,l;async function n(){kl("data.json").then(i=>i.json()).then(i=>{t(i),ks!=i.t&&(ks=i.t,setTimeout(p1,2e3)),ws==null&&i.pe&&i.p!=null&&(ws=i.p,Cu()),(!Nl||!Nl.chip||Nl.booting||ti>1&&!Bn(Nl.board))&&(_i(),ql&&clearTimeout(ql),ql=setTimeout(Di,2e3),Dl&&clearTimeout(Dl),Dl=setTimeout(Li,3e3)),i.u,ql||(ql=Di()),Dl||(Dl=Li());let s=5e3;if(Bn(Nl.board)&&i.v>2.5){let o=3.3-Math.min(3.3,i.v);o>0&&(s=Math.max(o,.1)*10*5e3)}s>5e3&&console.log("Next in "+s+"ms"),e&&clearTimeout(e),e=setTimeout(n,s),ti=0}).catch(i=>{ti++,ti>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(n,15e3),l||(l=setTimeout(zn,5e3,Nl,c1))):e=setTimeout(n,Bn(Nl.board)?1e4:5e3)})}return n(),function(){clearTimeout(e)}});let Ei={},In;const $i=al(Ei);async function wu(){let t=!1;$i.update(e=>{for(var l=0;l<36;l++){if(e[gt(l)]==null){t=l<12;break}e[gt(l)]=e[gt(l+1)]}return e}),t?Cu():In=setTimeout(wu,(60-new Date().getMinutes())*6e4)}async function Cu(){In&&(clearTimeout(In),In=0),Ei=await(await kl("energyprice.json")).json(),$i.set(Ei),In=setTimeout(wu,(60-new Date().getMinutes())*6e4)}let qi={},ql;async function Di(){ql&&(clearTimeout(ql),ql=0),qi=await(await kl("dayplot.json")).json(),Su.set(qi),ql=setTimeout(Di,(60-new Date().getMinutes())*6e4+20)}const Su=al(qi,t=>function(){});let Ai={},Dl;async function Li(){Dl&&(clearTimeout(Dl),Dl=0),Ai=await(await kl("monthplot.json")).json(),Mu.set(Ai),Dl=setTimeout(Li,(24-new Date().getHours())*36e5+40)}const Mu=al(Ai,t=>function(){});let Oi={};async function p1(){Oi=await(await kl("temperature.json")).json(),Nu.set(Oi)}const Nu=al(Oi,t=>function(){});let Ii={},li;async function Pu(){li&&(clearTimeout(li),li=0),Ii=await(await kl("tariff.json")).json(),Tu.set(Ii),li=setTimeout(Pu,(60-new Date().getMinutes())*6e4+30)}const Tu=al(Ii,t=>function(){});let vn={c:-1,n:[]};async function d1(){let e=await(await kl("wifiscan.json",{timeout:3e4})).json(),l=[];vn.c=0,vn.n=[];for(let n=0;n(d1(),function(){}));let Ri=!1;const wl=al(Ri);async function Eu(t){Ri=await(await kl("translations.json"+(t?"?lang="+t:""))).json(),wl.set(Ri)}Eu();const h1="/neas_logotype_white.svg",es="/wifi-low-light.svg",ts="/wifi-medium-light.svg",ls="/wifi-high-light.svg",Cn="/wifi-off-light.svg";function Cs(t){return"WARNING: "+t+" must be connected to an external power supply during firmware upgrade. Failure to do so may cause power-down during upload resulting in non-functioning unit."}async function qu(t){return await(await fetch("upgrade?expected_version="+t,{method:"POST"})).json()}function Ss(t){var f;let e=(((f=t[1].header)==null?void 0:f.uptime)??"Up")+"",l,n,i;function s(c,_){return c[2]>1?S1:c[2]>0?C1:c[3]>1?w1:c[3]>0?k1:c[4]>1?g1:c[4]>0?b1:v1}let o=s(t),r=o(t);return{c(){l=C(e),n=b(),r.c(),i=yt()},m(c,_){P(c,l,_),P(c,n,_),r.m(c,_),P(c,i,_)},p(c,_){var d;_&2&&e!==(e=(((d=c[1].header)==null?void 0:d.uptime)??"Up")+"")&&q(l,e),o===(o=s(c))&&r?r.p(c,_):(r.d(1),r=o(c),r&&(r.c(),r.m(i.parentNode,i)))},d(c){c&&(N(l),N(n),N(i)),r.d(c)}}}function v1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.seconds)??"s")+"",i;return{c(){e=C(t[0]),l=b(),i=C(n)},m(o,r){P(o,e,r),P(o,l,r),P(o,i,r)},p(o,r){var f;r&1&&q(e,o[0]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.seconds)??"s")+"")&&q(i,n)},d(o){o&&(N(e),N(l),N(i))}}}function b1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.minute)??"m")+"",i;return{c(){e=C(t[4]),l=b(),i=C(n)},m(o,r){P(o,e,r),P(o,l,r),P(o,i,r)},p(o,r){var f;r&16&&q(e,o[4]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.minute)??"m")+"")&&q(i,n)},d(o){o&&(N(e),N(l),N(i))}}}function g1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.minutes)??"m")+"",i;return{c(){e=C(t[4]),l=b(),i=C(n)},m(o,r){P(o,e,r),P(o,l,r),P(o,i,r)},p(o,r){var f;r&16&&q(e,o[4]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.minutes)??"m")+"")&&q(i,n)},d(o){o&&(N(e),N(l),N(i))}}}function k1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.hour)??"h")+"",i;return{c(){e=C(t[3]),l=b(),i=C(n)},m(o,r){P(o,e,r),P(o,l,r),P(o,i,r)},p(o,r){var f;r&8&&q(e,o[3]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.hour)??"h")+"")&&q(i,n)},d(o){o&&(N(e),N(l),N(i))}}}function w1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.hours)??"h")+"",i;return{c(){e=C(t[3]),l=b(),i=C(n)},m(o,r){P(o,e,r),P(o,l,r),P(o,i,r)},p(o,r){var f;r&8&&q(e,o[3]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.hours)??"h")+"")&&q(i,n)},d(o){o&&(N(e),N(l),N(i))}}}function C1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.day)??"d")+"",i;return{c(){e=C(t[2]),l=b(),i=C(n)},m(o,r){P(o,e,r),P(o,l,r),P(o,i,r)},p(o,r){var f;r&4&&q(e,o[2]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.day)??"d")+"")&&q(i,n)},d(o){o&&(N(e),N(l),N(i))}}}function S1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.days)??"d")+"",i;return{c(){e=C(t[2]),l=b(),i=C(n)},m(o,r){P(o,e,r),P(o,l,r),P(o,i,r)},p(o,r){var f;r&4&&q(e,o[2]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.days)??"d")+"")&&q(i,n)},d(o){o&&(N(e),N(l),N(i))}}}function M1(t){let e,l=t[0]&&Ss(t);return{c(){l&&l.c(),e=yt()},m(n,i){l&&l.m(n,i),P(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Ss(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Ve,o:Ve,d(n){n&&N(e),l&&l.d(n)}}}function N1(t,e,l){let{epoch:n}=e,i={};wl.subscribe(f=>{l(1,i=f)});let s=0,o=0,r=0;return t.$$set=f=>{"epoch"in f&&l(0,n=f.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(2,s=Math.floor(n/86400)),l(3,o=Math.floor(n/3600)),l(4,r=Math.floor(n/60)))},[n,i,s,o,r]}class P1 extends Mt{constructor(e){super(),St(this,e,N1,M1,Ct,{epoch:0})}}function T1(t){let e,l,n;return{c(){e=p("span"),l=C(t[2]),u(e,"title",t[1]),u(e,"class",n="bd-"+t[0])},m(i,s){P(i,e,s),a(e,l)},p(i,[s]){s&4&&q(l,i[2]),s&2&&u(e,"title",i[1]),s&1&&n!==(n="bd-"+i[0])&&u(e,"class",n)},i:Ve,o:Ve,d(i){i&&N(e)}}}function E1(t,e,l){let{color:n}=e,{title:i}=e,{text:s}=e;return t.$$set=o=>{"color"in o&&l(0,n=o.color),"title"in o&&l(1,i=o.title),"text"in o&&l(2,s=o.text)},[n,i,s]}class Vn extends Mt{constructor(e){super(),St(this,e,E1,T1,Ct,{color:0,title:1,text:2})}}function q1(t){let e,l=`${gt(t[0].getDate())}.${gt(t[0].getMonth()+1)}.${t[0].getFullYear()} ${gt(t[0].getHours())}:${gt(t[0].getMinutes())}`,n;return{c(){e=p("span"),n=C(l),u(e,"class",t[1])},m(i,s){P(i,e,s),a(e,n)},p(i,s){s&1&&l!==(l=`${gt(i[0].getDate())}.${gt(i[0].getMonth()+1)}.${i[0].getFullYear()} ${gt(i[0].getHours())}:${gt(i[0].getMinutes())}`)&&q(n,l),s&2&&u(e,"class",i[1])},d(i){i&&N(e)}}}function D1(t){var n;let e=`${gt(t[0].getDate())}. ${t[2].months?(n=t[2].months)==null?void 0:n[t[0].getMonth()]:gt(t[0].getMonth()+1)} ${gt(t[0].getHours())}:${gt(t[0].getMinutes())}`,l;return{c(){l=C(e)},m(i,s){P(i,l,s)},p(i,s){var o;s&5&&e!==(e=`${gt(i[0].getDate())}. ${i[2].months?(o=i[2].months)==null?void 0:o[i[0].getMonth()]:gt(i[0].getMonth()+1)} ${gt(i[0].getHours())}:${gt(i[0].getMinutes())}`)&&q(l,e)},d(i){i&&N(l)}}}function A1(t){let e;function l(s,o){return s[3]?D1:q1}let n=l(t),i=n(t);return{c(){i.c(),e=yt()},m(s,o){i.m(s,o),P(s,e,o)},p(s,[o]){n===(n=l(s))&&i?i.p(s,o):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},i:Ve,o:Ve,d(s){s&&N(e),i.d(s)}}}function L1(t,e,l){let n={};wl.subscribe(f=>{l(2,n=f)});let{timestamp:i}=e,{fullTimeColor:s}=e,{offset:o}=e,r;return t.$$set=f=>{"timestamp"in f&&l(0,i=f.timestamp),"fullTimeColor"in f&&l(1,s=f.fullTimeColor),"offset"in f&&l(4,o=f.offset)},t.$$.update=()=>{t.$$.dirty&17&&(l(3,r=Math.abs(new Date().getTime()-i.getTime())<3e5),isNaN(o)||Ll(i,o-(24+i.getHours()-i.getUTCHours())%24))},[i,s,n,r,o]}class Du extends Mt{constructor(e){super(),St(this,e,L1,A1,Ct,{timestamp:0,fullTimeColor:1,offset:4})}}function O1(t){let e,l,n;return{c(){e=It("svg"),l=It("path"),n=It("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(n,"stroke-linecap","round"),u(n,"stroke-linejoin","round"),u(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(i,s){P(i,e,s),a(e,l),a(e,n)},p:Ve,i:Ve,o:Ve,d(i){i&&N(e)}}}class I1 extends Mt{constructor(e){super(),St(this,e,null,O1,Ct,{})}}function R1(t){let e,l;return{c(){e=It("svg"),l=It("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){P(n,e,i),a(e,l)},p:Ve,i:Ve,o:Ve,d(n){n&&N(e)}}}class F1 extends Mt{constructor(e){super(),St(this,e,null,R1,Ct,{})}}function U1(t){let e,l;return{c(){e=p("img"),u(e,"class","p-1"),u(e,"alt","Neas logo"),Il(e.src,l=h1)||u(e,"src",l)},m(n,i){P(n,e,i)},p:Ve,d(n){n&&N(e)}}}function Ms(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=p("div"),n=C(l),i=C("°C"),u(e,"class","flex-none my-auto")},m(s,o){P(s,e,o),a(e,n),a(e,i)},p(s,o){o&1&&l!==(l=(s[0].t>-50?s[0].t.toFixed(1):"-")+"")&&q(n,l)},d(s){s&&N(e)}}}function Ns(t){var i,s,o;let e,l=(((i=t[5].header)==null?void 0:i.han)??"Strømmåler")+": "+(((o=(s=t[5].errors)==null?void 0:s.han)==null?void 0:o[t[0].he])??t[0].he),n;return{c(){e=p("div"),n=C(l),u(e,"class","bd-red")},m(r,f){P(r,e,f),a(e,n)},p(r,f){var c,_,d;f&33&&l!==(l=(((c=r[5].header)==null?void 0:c.han)??"Strømmåler")+": "+(((d=(_=r[5].errors)==null?void 0:_.han)==null?void 0:d[r[0].he])??r[0].he))&&q(n,l)},d(r){r&&N(e)}}}function Ps(t){var i,s,o;let e,l=(((i=t[5].header)==null?void 0:i.mqtt)??"Minside")+": "+(((o=(s=t[5].errors)==null?void 0:s.mqtt)==null?void 0:o[t[0].me])??t[0].me),n;return{c(){e=p("div"),n=C(l),u(e,"class","bd-red")},m(r,f){P(r,e,f),a(e,n)},p(r,f){var c,_,d;f&33&&l!==(l=(((c=r[5].header)==null?void 0:c.mqtt)??"Minside")+": "+(((d=(_=r[5].errors)==null?void 0:_.mqtt)==null?void 0:d[r[0].me])??r[0].me))&&q(n,l)},d(r){r&&N(e)}}}function Ts(t){var i,s,o;let e,l=(((i=t[5].header)==null?void 0:i.price)??"PS")+": "+(((o=(s=t[5].errors)==null?void 0:s.price)==null?void 0:o[t[0].ee])??t[0].ee),n;return{c(){e=p("div"),n=C(l),u(e,"class","bd-red")},m(r,f){P(r,e,f),a(e,n)},p(r,f){var c,_,d;f&33&&l!==(l=(((c=r[5].header)==null?void 0:c.price)??"PS")+": "+(((d=(_=r[5].errors)==null?void 0:_.price)==null?void 0:d[r[0].ee])??r[0].ee))&&q(n,l)},d(r){r&&N(e)}}}function Es(t){let e,l,n,i,s,o,r,f;return l=new hl({props:{to:"/configuration",$$slots:{default:[B1]},$$scope:{ctx:t}}}),o=new hl({props:{to:"/status",$$slots:{default:[y1]},$$scope:{ctx:t}}}),{c(){var c,_;e=p("div"),Ne(l.$$.fragment),i=b(),s=p("div"),Ne(o.$$.fragment),u(e,"class","flex-none px-1 mt-1 pt-[0.5rem]"),u(e,"title",n=((c=t[5].header)==null?void 0:c.config)??""),u(s,"class","flex-none px-1 mt-1 pt-[0.5rem]"),u(s,"title",r=((_=t[5].header)==null?void 0:_.status)??"")},m(c,_){P(c,e,_),Se(l,e,null),P(c,i,_),P(c,s,_),Se(o,s,null),f=!0},p(c,_){var v,h;const d={};_&256&&(d.$$scope={dirty:_,ctx:c}),l.$set(d),(!f||_&32&&n!==(n=((v=c[5].header)==null?void 0:v.config)??""))&&u(e,"title",n);const m={};_&256&&(m.$$scope={dirty:_,ctx:c}),o.$set(m),(!f||_&32&&r!==(r=((h=c[5].header)==null?void 0:h.status)??""))&&u(s,"title",r)},i(c){f||(Z(l.$$.fragment,c),Z(o.$$.fragment,c),f=!0)},o(c){ie(l.$$.fragment,c),ie(o.$$.fragment,c),f=!1},d(c){c&&(N(e),N(i),N(s)),Me(l),Me(o)}}}function B1(t){let e,l;return e=new I1({}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function y1(t){let e,l;return e=new F1({}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function j1(t){let e,l;function n(o,r){return o[1].security==0||o[0].a?W1:H1}let i=n(t),s=i(t);return{c(){var o;e=p("div"),s.c(),u(e,"class","flex-none mr-3 text-yellow-500"),u(e,"title",l=(((o=t[5].header)==null?void 0:o.new_version)??"New version")+": "+t[1].upgrade.n)},m(o,r){P(o,e,r),s.m(e,null)},p(o,r){var f;i===(i=n(o))&&s?s.p(o,r):(s.d(1),s=i(o),s&&(s.c(),s.m(e,null))),r&34&&l!==(l=(((f=o[5].header)==null?void 0:f.new_version)??"New version")+": "+o[1].upgrade.n)&&u(e,"title",l)},d(o){o&&N(e),s.d()}}}function z1(t){let e,l,n=t[1].upgrade.t+"",i,s,o=t[4].toFixed(1)+"",r,f;return{c(){e=p("div"),l=C("Upgrading to "),i=C(n),s=C(", "),r=C(o),f=C("%"),u(e,"class","flex-none mr-3 mt-1 text-yellow-300")},m(c,_){P(c,e,_),a(e,l),a(e,i),a(e,s),a(e,r),a(e,f)},p(c,_){_&2&&n!==(n=c[1].upgrade.t+"")&&q(i,n),_&16&&o!==(o=c[4].toFixed(1)+"")&&q(r,o)},d(c){c&&N(e)}}}function H1(t){var r;let e,l=(((r=t[5].header)==null?void 0:r.new_version)??"New version")+"",n,i,s=t[1].upgrade.n+"",o;return{c(){e=p("span"),n=C(l),i=C(": "),o=C(s)},m(f,c){P(f,e,c),a(e,n),a(e,i),a(e,o)},p(f,c){var _;c&32&&l!==(l=(((_=f[5].header)==null?void 0:_.new_version)??"New version")+"")&&q(n,l),c&2&&s!==(s=f[1].upgrade.n+"")&&q(o,s)},d(f){f&&N(e)}}}function W1(t){var _;let e,l,n=(((_=t[5].header)==null?void 0:_.new_version)??"New version")+"",i,s,o=t[1].upgrade.n+"",r,f,c;return{c(){e=p("button"),l=p("span"),i=C(n),s=C(": "),r=C(o),u(l,"class","mt-1"),u(e,"class","flex")},m(d,m){P(d,e,m),a(e,l),a(l,i),a(l,s),a(l,r),f||(c=re(e,"click",t[6]),f=!0)},p(d,m){var v;m&32&&n!==(n=(((v=d[5].header)==null?void 0:v.new_version)??"New version")+"")&&q(i,n),m&2&&o!==(o=d[1].upgrade.n+"")&&q(r,o)},d(d){d&&N(e),f=!1,c()}}}function G1(t){let e,l,n,i,s,o,r,f,c,_,d,m,v,h,g,w,k,A,I,L,M,O,E,F,H,j,S,y;i=new hl({props:{to:"/",class:"flex space-x-2",$$slots:{default:[U1]},$$scope:{ctx:t}}}),f=new P1({props:{epoch:t[0].u}});let J=t[0].t>-50&&Ms(t);m=new Vn({props:{title:"Strømmåler",text:"Strømmåler",color:xn(t[1].booting?9:t[0].hm)}}),h=new Vn({props:{title:"Minside",text:"Minside",color:xn(t[1].booting?9:t[0].mm)}});let G=(t[0].he<0||t[0].he>0)&&Ns(t),K=t[0].me<0&&Ps(t),X=(t[0].ee>0||t[0].ee<0)&&Ts(t);H=new Du({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let U=t[1].vndcfg&&t[1].usrcfg&&Es(t);function Y(z,x){if(z[1].upgrading)return z1;if(z[1].fwconsent===1&&z[1].upgrade.n)return j1}let le=Y(t),$=le&&le(t);return{c(){e=p("nav"),l=p("div"),n=p("div"),Ne(i.$$.fragment),s=b(),o=p("div"),r=p("div"),Ne(f.$$.fragment),c=b(),J&&J.c(),_=b(),d=p("div"),Ne(m.$$.fragment),v=b(),Ne(h.$$.fragment),g=b(),G&&G.c(),w=b(),K&&K.c(),k=b(),X&&X.c(),A=b(),I=p("div"),L=p("div"),M=p("img"),E=b(),F=p("div"),Ne(H.$$.fragment),j=b(),U&&U.c(),S=b(),$&&$.c(),u(n,"class","flex text-xl text-neas-gray p-2 flex-auto"),u(r,"class","flex-none my-auto"),u(o,"class","flex-none my-auto p-2 flex space-x-4"),u(d,"class","flex-auto flex-wrap my-auto justify-center p-2"),u(M,"class","h-10 w-10"),Il(M.src,O=t[2])||u(M,"src",O),u(M,"alt",t[3]),u(L,"class","flex-none flex text-xl text-neas-gray p-2 flex-auto"),u(F,"class","flex-none my-auto px-2"),u(I,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),u(l,"class","flex flex-wrap space-x-4 text-l text-neas-gray"),u(e,"class","bg-neas-green-90 rounded-md")},m(z,x){P(z,e,x),a(e,l),a(l,n),Se(i,n,null),a(l,s),a(l,o),a(o,r),Se(f,r,null),a(o,c),J&&J.m(o,null),a(l,_),a(l,d),Se(m,d,null),a(d,v),Se(h,d,null),a(l,g),G&&G.m(l,null),a(l,w),K&&K.m(l,null),a(l,k),X&&X.m(l,null),a(l,A),a(l,I),a(I,L),a(L,M),a(I,E),a(I,F),Se(H,F,null),a(I,j),U&&U.m(I,null),a(I,S),$&&$.m(I,null),y=!0},p(z,[x]){const fe={};x&256&&(fe.$$scope={dirty:x,ctx:z}),i.$set(fe);const ae={};x&1&&(ae.epoch=z[0].u),f.$set(ae),z[0].t>-50?J?J.p(z,x):(J=Ms(z),J.c(),J.m(o,null)):J&&(J.d(1),J=null);const se={};x&3&&(se.color=xn(z[1].booting?9:z[0].hm)),m.$set(se);const _e={};x&3&&(_e.color=xn(z[1].booting?9:z[0].mm)),h.$set(_e),z[0].he<0||z[0].he>0?G?G.p(z,x):(G=Ns(z),G.c(),G.m(l,w)):G&&(G.d(1),G=null),z[0].me<0?K?K.p(z,x):(K=Ps(z),K.c(),K.m(l,k)):K&&(K.d(1),K=null),z[0].ee>0||z[0].ee<0?X?X.p(z,x):(X=Ts(z),X.c(),X.m(l,A)):X&&(X.d(1),X=null),(!y||x&4&&!Il(M.src,O=z[2]))&&u(M,"src",O),(!y||x&8)&&u(M,"alt",z[3]);const oe={};x&1&&(oe.timestamp=z[0].c?new Date(z[0].c*1e3):new Date(0)),x&2&&(oe.offset=z[1].clock_offset),H.$set(oe),z[1].vndcfg&&z[1].usrcfg?U?(U.p(z,x),x&2&&Z(U,1)):(U=Es(z),U.c(),Z(U,1),U.m(I,S)):U&&(mt(),ie(U,1,1,()=>{U=null}),pt()),le===(le=Y(z))&&$?$.p(z,x):($&&$.d(1),$=le&&le(z),$&&($.c(),$.m(I,null)))},i(z){y||(Z(i.$$.fragment,z),Z(f.$$.fragment,z),Z(m.$$.fragment,z),Z(h.$$.fragment,z),Z(H.$$.fragment,z),Z(U),y=!0)},o(z){ie(i.$$.fragment,z),ie(f.$$.fragment,z),ie(m.$$.fragment,z),ie(h.$$.fragment,z),ie(H.$$.fragment,z),ie(U),y=!1},d(z){z&&N(e),Me(i),Me(f),J&&J.d(),Me(m),Me(h),G&&G.d(),K&&K.d(),X&&X.d(),Me(H),U&&U.d(),$&&$.d()}}}function V1(t,e,l){let n=Cn,i="Wi-Fi offline",{basepath:s="/"}=e,{data:o={}}=e,r={};function f(){var d;confirm((((d=_.header)==null?void 0:d.upgrade)??"Upgrade to {0}?").replace("{0}",r.upgrade.n))&&(qu(r.upgrade.n),_l.update(m=>(m.upgrade.t=r.upgrade.n,m.upgrade.p=0,m.upgrading=!0,m)))}let c;_l.subscribe(d=>{l(1,r=d)});let _={};return wl.subscribe(d=>{l(5,_=d)}),t.$$set=d=>{"basepath"in d&&l(7,s=d.basepath),"data"in d&&l(0,o=d.data)},t.$$.update=()=>{if(t.$$.dirty&2&&l(4,c=Math.max(0,r.upgrade.p)),t.$$.dirty&1){const d=o==null?void 0:o.r;typeof d=="number"&&(d>=-50?(l(2,n=ls),l(3,i=`Wi-Fi strong (${d} dBm)`)):d>=-60?(l(2,n=ts),l(3,i=`Wi-Fi medium (${d} dBm)`)):d>=-75?(l(2,n=es),l(3,i=`Wi-Fi weak (${d} dBm)`)):(l(2,n=Cn),l(3,i=`Wi-Fi very weak/offline (${d} dBm)`)))}},[o,r,n,i,c,_,f,s]}class K1 extends Mt{constructor(e){super(),St(this,e,V1,G1,Ct,{basepath:7,data:0})}}function Y1(t){let e,l,n,i;return{c(){e=It("svg"),l=It("path"),n=It("path"),u(l,"d",ki(150,150,115,210,510)),u(l,"stroke","rgba(128, 128, 128, 0.15)"),u(l,"fill","none"),u(l,"stroke-width","55"),u(n,"d",i=ki(150,150,115,210,210+300*t[0]/100)),u(n,"stroke",t[1]),u(n,"fill","none"),u(n,"stroke-width","55"),u(e,"viewBox","0 0 300 300"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"height","100%")},m(s,o){P(s,e,o),a(e,l),a(e,n)},p(s,[o]){o&1&&i!==(i=ki(150,150,115,210,210+300*s[0]/100))&&u(n,"d",i),o&2&&u(n,"stroke",s[1])},i:Ve,o:Ve,d(s){s&&N(e)}}}function qs(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 ki(t,e,l,n,i){var s=qs(t,e,l,i),o=qs(t,e,l,n),r=i-n<=180?"0":"1",f=["M",s.x,s.y,"A",l,l,0,r,0,o.x,o.y].join(" ");return f}function X1(t,e,l){let{pct:n=0}=e,{color:i="red"}=e;return t.$$set=s=>{"pct"in s&&l(0,n=s.pct),"color"in s&&l(1,i=s.color)},[n,i]}class Q1 extends Mt{constructor(e){super(),St(this,e,X1,Y1,Ct,{pct:0,color:1})}}function Ds(t){let e,l,n,i=t[1][0]+"",s,o,r,f=t[1][1]+"",c,_;return{c(){e=p("br"),l=b(),n=p("span"),s=C(i),o=b(),r=p("span"),c=C(f),_=C("/kWh"),u(n,"class","pl-sub"),u(r,"class","pl-snt")},m(d,m){P(d,e,m),P(d,l,m),P(d,n,m),a(n,s),P(d,o,m),P(d,r,m),a(r,c),a(r,_)},p(d,m){m&2&&i!==(i=d[1][0]+"")&&q(s,i),m&2&&f!==(f=d[1][1]+"")&&q(c,f)},d(d){d&&(N(e),N(l),N(n),N(o),N(r))}}}function Z1(t){let e,l,n,i,s,o,r,f,c,_,d=t[3][0]+"",m,v,h,g=t[3][1]+"",w,k,A;l=new Q1({props:{pct:t[4],color:t[2](t[4],document.documentElement.classList.contains("dark"))}});let I=t[1]&&Ds(t);return{c(){e=p("div"),Ne(l.$$.fragment),n=b(),i=p("span"),s=p("span"),o=C(t[0]),r=b(),f=p("br"),c=b(),_=p("span"),m=C(d),v=b(),h=p("span"),w=C(g),k=b(),I&&I.c(),u(s,"class","pl-lab"),u(_,"class","pl-val"),u(h,"class","pl-unt"),u(i,"class","pl-ov"),u(e,"class","pl-root")},m(L,M){P(L,e,M),Se(l,e,null),a(e,n),a(e,i),a(i,s),a(s,o),a(i,r),a(i,f),a(i,c),a(i,_),a(_,m),a(i,v),a(i,h),a(h,w),a(i,k),I&&I.m(i,null),A=!0},p(L,[M]){const O={};M&16&&(O.pct=L[4]),M&20&&(O.color=L[2](L[4],document.documentElement.classList.contains("dark"))),l.$set(O),(!A||M&1)&&q(o,L[0]),(!A||M&8)&&d!==(d=L[3][0]+"")&&q(m,d),(!A||M&8)&&g!==(g=L[3][1]+"")&&q(w,g),L[1]?I?I.p(L,M):(I=Ds(L),I.c(),I.m(i,null)):I&&(I.d(1),I=null)},i(L){A||(Z(l.$$.fragment,L),A=!0)},o(L){ie(l.$$.fragment,L),A=!1},d(L){L&&N(e),Me(l),I&&I.d()}}}function J1(t,e,l){let{val:n}=e,{max:i}=e,{unit:s}=e,{label:o}=e,{sub:r=["",""]}=e,{colorFn:f}=e,c,_=0;return t.$$set=d=>{"val"in d&&l(5,n=d.val),"max"in d&&l(6,i=d.max),"unit"in d&&l(7,s=d.unit),"label"in d&&l(0,o=d.label),"sub"in d&&l(1,r=d.sub),"colorFn"in d&&l(2,f=d.colorFn)},t.$$.update=()=>{t.$$.dirty&224&&(l(3,c=rl(n,s)),l(4,_=Math.min(n,i)/i*100))},[o,r,f,c,_,n,i,s]}class Au extends Mt{constructor(e){super(),St(this,e,J1,Z1,Ct,{val:5,max:6,unit:7,label:0,sub:1,colorFn:2})}}function As(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Ls(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Os(t,e,l){const n=t.slice();return n[15]=e[l],n}function Is(t){let e,l,n,i,s,o,r,f=(t[0].title||t[0].link)&&Rs(t),c=it(t[0].y.ticks),_=[];for(let g=0;g{f=null}),pt()),w&129){c=it(g[0].y.ticks);let k;for(k=0;k{s=null}),pt())},i(o){n||(Z(s),n=!0)},o(o){ie(s),n=!1},d(o){o&&N(e),i&&i.d(),s&&s.d()}}}function Fs(t){let e,l=t[0].title+"",n,i;return{c(){e=p("div"),n=C(l),u(e,"class","text-sm font-bold"),qt(()=>t[9].call(e))},m(s,o){P(s,e,o),a(e,n),i=Ki(e,t[9].bind(e))},p(s,o){o&1&&l!==(l=s[0].title+"")&&q(n,l)},d(s){s&&N(e),i()}}}function Us(t){let e,l,n,i;const s=[x1,$1],o=[];function r(f,c){return f[0].link.route?0:1}return l=r(t),n=o[l]=s[l](t),{c(){e=p("div"),n.c(),u(e,"class","text-xs text-right")},m(f,c){P(f,e,c),o[l].m(e,null),i=!0},p(f,c){let _=l;l=r(f),l===_?o[l].p(f,c):(mt(),ie(o[_],1,1,()=>{o[_]=null}),pt(),n=o[l],n?n.p(f,c):(n=o[l]=s[l](f),n.c()),Z(n,1),n.m(e,null))},i(f){i||(Z(n),i=!0)},o(f){ie(n),i=!1},d(f){f&&N(e),o[l].d()}}}function $1(t){let e,l=t[0].link.text+"",n,i,s;return{c(){e=p("a"),n=C(l),u(e,"href",i=t[0].link.url),u(e,"target",s=t[0].link.target)},m(o,r){P(o,e,r),a(e,n)},p(o,r){r&1&&l!==(l=o[0].link.text+"")&&q(n,l),r&1&&i!==(i=o[0].link.url)&&u(e,"href",i),r&1&&s!==(s=o[0].link.target)&&u(e,"target",s)},i:Ve,o:Ve,d(o){o&&N(e)}}}function x1(t){let e,l;return e=new hl({props:{to:t[0].link.url,$$slots:{default:[ec]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.to=n[0].link.url),i&262145&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function ec(t){let e=t[0].link.text+"",l;return{c(){l=C(e)},m(n,i){P(n,l,i)},p(n,i){i&1&&e!==(e=n[0].link.text+"")&&q(l,e)},d(n){n&&N(l)}}}function Bs(t){let e,l,n,i=t[15].label+"",s,o,r,f;return{c(){e=It("g"),l=It("line"),n=It("text"),s=C(i),u(l,"x2","100%"),u(n,"y","-4"),u(n,"x",o=t[15].align=="right"?"85%":""),u(e,"class",r="tick tick-"+t[15].value+" tick-"+t[15].color),u(e,"transform",f="translate(0, "+t[7](t[15].value)+")")},m(c,_){P(c,e,_),a(e,l),a(e,n),a(n,s)},p(c,_){_&1&&i!==(i=c[15].label+"")&&q(s,i),_&1&&o!==(o=c[15].align=="right"?"85%":"")&&u(n,"x",o),_&1&&r!==(r="tick tick-"+c[15].value+" tick-"+c[15].color)&&u(e,"class",r),_&129&&f!==(f="translate(0, "+c[7](c[15].value)+")")&&u(e,"transform",f)},d(c){c&&N(e)}}}function ys(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Bs(t);return{c(){n&&n.c(),l=yt()},m(i,s){n&&n.m(i,s),P(i,l,s)},p(i,s){s&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,s):(n=Bs(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){i&&N(l),n&&n.d(i)}}}function js(t){let e,l,n=(t[3]>20||t[13]%2==0)&&zs(t);return{c(){e=It("g"),n&&n.c(),u(e,"class","tick"),u(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,s){P(i,e,s),n&&n.m(e,null)},p(i,s){i[3]>20||i[13]%2==0?n?n.p(i,s):(n=zs(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),s&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&u(e,"transform",l)},d(i){i&&N(e),n&&n.d()}}}function zs(t){let e,l=t[11].label+"",n,i;return{c(){e=It("text"),n=C(l),u(e,"x",i=t[3]/2),u(e,"y","-4")},m(s,o){P(s,e,o),a(e,n)},p(s,o){o&1&&l!==(l=s[11].label+"")&&q(n,l),o&8&&i!==(i=s[3]/2)&&u(e,"x",i)},d(s){s&&N(e)}}}function Hs(t){let e=!isNaN(t[6](t[13])),l,n=e&&js(t);return{c(){n&&n.c(),l=yt()},m(i,s){n&&n.m(i,s),P(i,l,s)},p(i,s){s&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,s):(n=js(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){i&&N(l),n&&n.d(i)}}}function Ws(t){let e,l,n=t[11].value!==void 0&&Gs(t),i=t[11].value2>1e-4&&Ys(t);return{c(){e=It("g"),n&&n.c(),l=It("g"),i&&i.c()},m(s,o){P(s,e,o),n&&n.m(e,null),P(s,l,o),i&&i.m(l,null)},p(s,o){s[11].value!==void 0?n?n.p(s,o):(n=Gs(s),n.c(),n.m(e,null)):n&&(n.d(1),n=null),s[11].value2>1e-4?i?i.p(s,o):(i=Ys(s),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(s){s&&(N(e),N(l)),n&&n.d(),i&&i.d()}}}function Gs(t){let e,l,n,i,s,o,r,f=t[3]>15&&Vs(t);return{c(){e=It("rect"),f&&f.c(),r=yt(),u(e,"x",l=t[6](t[13])+2),u(e,"y",n=t[7](t[11].value)),u(e,"width",i=t[3]-4),u(e,"height",s=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),u(e,"fill",o=t[11].color)},m(c,_){P(c,e,_),f&&f.m(c,_),P(c,r,_)},p(c,_){_&64&&l!==(l=c[6](c[13])+2)&&u(e,"x",l),_&129&&n!==(n=c[7](c[11].value))&&u(e,"y",n),_&8&&i!==(i=c[3]-4)&&u(e,"width",i),_&129&&s!==(s=c[7](c[0].y.min)-c[7](Math.min(c[0].y.min,0)+c[11].value))&&u(e,"height",s),_&1&&o!==(o=c[11].color)&&u(e,"fill",o),c[3]>15?f?f.p(c,_):(f=Vs(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(N(e),N(r)),f&&f.d(c)}}}function Vs(t){let e,l=t[11].label+"",n,i,s,o,r,f,c=t[11].title&&Ks(t);return{c(){e=It("text"),n=C(l),c&&c.c(),f=yt(),u(e,"width",i=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor",s=t[3]t[7](0)-t[8]&&!t[0].dark?t[11].color:"white"),u(e,"transform",r="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[11].labelAngle?t[11].labelAngle:t[3]_[7](0)-_[8]&&!_[0].dark?_[11].color:"white")&&u(e,"fill",o),d&457&&r!==(r="translate("+(_[6](_[13])+_[3]/2)+" "+(_[7](_[11].value)>_[7](0)-_[8]?_[7](_[11].value)-_[8]:_[7](_[11].value)+10)+") rotate("+(_[11].labelAngle?_[11].labelAngle:_[3]15&&Xs(t);return{c(){e=It("rect"),f&&f.c(),r=yt(),u(e,"x",l=t[6](t[13])+2),u(e,"y",n=t[7](0)),u(e,"width",i=t[3]-4),u(e,"height",s=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),u(e,"fill",o=t[11].color2?t[11].color2:t[11].color)},m(c,_){P(c,e,_),f&&f.m(c,_),P(c,r,_)},p(c,_){_&64&&l!==(l=c[6](c[13])+2)&&u(e,"x",l),_&128&&n!==(n=c[7](0))&&u(e,"y",n),_&8&&i!==(i=c[3]-4)&&u(e,"width",i),_&129&&s!==(s=c[7](c[0].y.min)-c[7](c[0].y.min+c[11].value2))&&u(e,"height",s),_&1&&o!==(o=c[11].color2?c[11].color2:c[11].color)&&u(e,"fill",o),c[3]>15?f?f.p(c,_):(f=Xs(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(N(e),N(r)),f&&f.d(c)}}}function Xs(t){let e,l=t[11].label2+"",n,i,s,o,r,f=t[11].title2&&Qs(t);return{c(){e=It("text"),n=C(l),f&&f.c(),r=yt(),u(e,"width",i=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor","middle"),u(e,"fill",s=t[7](-t[11].value2)t[10].call(e))},m(s,o){P(s,e,o),i&&i.m(e,null),l=Ki(e,t[10].bind(e)),n=!0},p(s,[o]){s[0].x.ticks&&s[0].points&&s[4]?i?(i.p(s,o),o&17&&Z(i,1)):(i=Is(s),i.c(),Z(i,1),i.m(e,null)):i&&(mt(),ie(i,1,1,()=>{i=null}),pt())},i(s){n||(Z(i),n=!0)},o(s){ie(i),n=!1},d(s){s&&N(e),i&&i.d(),l()}}}let un=30;function lc(t,e,l){let{config:n}=e,i,s,o,r,f,c,_,d=0;function m(){d=this.clientHeight,l(5,d)}function v(){i=this.clientWidth,s=this.clientHeight,l(1,i),l(2,s)}return t.$$set=h=>{"config"in h&&l(0,n=h.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,c=s-d);let h=i-(n.padding.left+n.padding.right);l(3,o=h/n.points.length),l(8,_=on.y.max?k=n.padding.bottom:wc||k<0?0:k})}},[n,i,s,o,c,d,r,f,_,m,v]}class mn extends Mt{constructor(e){super(),St(this,e,lc,tc,Ct,{config:0})}}function nc(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function ic(t,e,l){let{title:n}=e,{u1:i}=e,{u2:s}=e,{u3:o}=e,{ds:r}=e,f={};function c(_){return{label:zt(_)+"V",title:_.toFixed(1)+" V",value:isNaN(_)?0:_,color:a1(_||0,document.documentElement.classList.contains("dark"))}}return t.$$set=_=>{"title"in _&&l(1,n=_.title),"u1"in _&&l(2,i=_.u1),"u2"in _&&l(3,s=_.u2),"u3"in _&&l(4,o=_.u3),"ds"in _&&l(5,r=_.ds)},t.$$.update=()=>{if(t.$$.dirty&62){let _=[],d=[];i>0&&(_.push({label:r===1?"L1-L2":"L1"}),d.push(c(i))),s>0&&(_.push({label:r===1?"L1-L3":"L2"}),d.push(c(s))),o>0&&(_.push({label:r===1?"L2-L3":"L3"}),d.push(c(o))),l(0,f={title:n,padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:_},points:d})}},[f,n,i,s,o,r]}class sc extends Mt{constructor(e){super(),St(this,e,ic,nc,Ct,{title:1,u1:2,u2:3,u3:4,ds:5})}}function oc(t){var D,W,te,ue,ce;let e,l,n=(((D=t[0].reactive)==null?void 0:D.title)??"Reactive")+"",i,s,o,r,f=(((W=t[0].reactive)==null?void 0:W.instant_in)??"Instant in")+"",c,_,d,m=t[1][0]+"",v,h,g=t[1][1]+"",w,k,A,I=(((te=t[0].reactive)==null?void 0:te.instant_out)??"Instant out")+"",L,M,O,E=t[2][0]+"",F,H,j=t[2][1]+"",S,y,J,G,K=(((ue=t[0].reactive)==null?void 0:ue.total_in)??"Total in")+"",X,U,Y,le=t[3][0]+"",$,z,x=t[3][1]+"",fe,ae,se,_e=(((ce=t[0].reactive)==null?void 0:ce.total_out)??"Total out")+"",oe,ee,ne,be=t[4][0]+"",we,R,T=t[4][1]+"",B;return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("div"),r=p("div"),c=C(f),_=b(),d=p("div"),v=C(m),h=b(),w=C(g),k=b(),A=p("div"),L=C(I),M=b(),O=p("div"),F=C(E),H=b(),S=C(j),y=b(),J=p("div"),G=p("div"),X=C(K),U=b(),Y=p("div"),$=C(le),z=b(),fe=C(x),ae=b(),se=p("div"),oe=C(_e),ee=b(),ne=p("div"),we=C(be),R=b(),B=C(T),u(d,"class","text-right"),u(O,"class","text-right"),u(o,"class","grid grid-cols-2 mt-4"),u(Y,"class","text-right"),u(ne,"class","text-right"),u(J,"class","grid grid-cols-2 mt-4"),u(e,"class","mx-2 text-sm")},m(me,pe){P(me,e,pe),a(e,l),a(l,i),a(e,s),a(e,o),a(o,r),a(r,c),a(o,_),a(o,d),a(d,v),a(d,h),a(d,w),a(o,k),a(o,A),a(A,L),a(o,M),a(o,O),a(O,F),a(O,H),a(O,S),a(e,y),a(e,J),a(J,G),a(G,X),a(J,U),a(J,Y),a(Y,$),a(Y,z),a(Y,fe),a(J,ae),a(J,se),a(se,oe),a(J,ee),a(J,ne),a(ne,we),a(ne,R),a(ne,B)},p(me,[pe]){var ke,ve,De,Ee,Le;pe&1&&n!==(n=(((ke=me[0].reactive)==null?void 0:ke.title)??"Reactive")+"")&&q(i,n),pe&1&&f!==(f=(((ve=me[0].reactive)==null?void 0:ve.instant_in)??"Instant in")+"")&&q(c,f),pe&2&&m!==(m=me[1][0]+"")&&q(v,m),pe&2&&g!==(g=me[1][1]+"")&&q(w,g),pe&1&&I!==(I=(((De=me[0].reactive)==null?void 0:De.instant_out)??"Instant out")+"")&&q(L,I),pe&4&&E!==(E=me[2][0]+"")&&q(F,E),pe&4&&j!==(j=me[2][1]+"")&&q(S,j),pe&1&&K!==(K=(((Ee=me[0].reactive)==null?void 0:Ee.total_in)??"Total in")+"")&&q(X,K),pe&8&&le!==(le=me[3][0]+"")&&q($,le),pe&8&&x!==(x=me[3][1]+"")&&q(fe,x),pe&1&&_e!==(_e=(((Le=me[0].reactive)==null?void 0:Le.total_out)??"Total out")+"")&&q(oe,_e),pe&16&&be!==(be=me[4][0]+"")&&q(we,be),pe&16&&T!==(T=me[4][1]+"")&&q(B,T)},i:Ve,o:Ve,d(me){me&&N(e)}}}function ac(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:s}=e,{exportTotal:o}=e,{translations:r={}}=e,f,c,_,d;return t.$$set=m=>{"importInstant"in m&&l(5,n=m.importInstant),"exportInstant"in m&&l(6,i=m.exportInstant),"importTotal"in m&&l(7,s=m.importTotal),"exportTotal"in m&&l(8,o=m.exportTotal),"translations"in m&&l(0,r=m.translations)},t.$$.update=()=>{t.$$.dirty&480&&(l(1,f=rl(n,"VAr")),l(2,c=rl(i,"VAr")),l(3,_=rl(s*1e3,"VArh")),l(4,d=rl(o*1e3,"VArh")))},[r,f,c,_,d,n,i,s,o]}class fc extends Mt{constructor(e){super(),St(this,e,ac,oc,Ct,{importInstant:5,exportInstant:6,importTotal:7,exportTotal:8,translations:0})}}function Js(t){let e;function l(s,o){return s[3]?rc:uc}let n=l(t),i=n(t);return{c(){i.c(),e=yt()},m(s,o){i.m(s,o),P(s,e,o)},p(s,o){n===(n=l(s))&&i?i.p(s,o):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},d(s){s&&N(e),i.d(s)}}}function uc(t){var W,te,ue,ce,me;let e,l=(((W=t[4].realtime)==null?void 0:W.consumption)??"Consumption")+"",n,i,s,o,r=Zt(((te=t[4].common)==null?void 0:te.hour)??"Hour")+"",f,c,_,d=t[6][0]+"",m,v,h=t[6][1]+"",g,w,k,A=Zt(((ue=t[4].common)==null?void 0:ue.day)??"Day")+"",I,L,M,O=t[7][0]+"",E,F,H=t[7][1]+"",j,S,y,J=Zt(((ce=t[4].common)==null?void 0:ce.month)??"Month")+"",G,K,X,U=t[8][0]+"",Y,le,$=t[8][1]+"",z,x,fe,ae=(((me=t[4].realtime)==null?void 0:me.last_month)??"Last month")+"",se,_e,oe,ee=t[9][0]+"",ne,be,we=t[9][1]+"",R,T,B,D=t[5]&&$s(t);return{c(){e=p("strong"),n=C(l),i=b(),s=p("div"),o=p("div"),f=C(r),c=b(),_=p("div"),m=C(d),v=b(),g=C(h),w=b(),k=p("div"),I=C(A),L=b(),M=p("div"),E=C(O),F=b(),j=C(H),S=b(),y=p("div"),G=C(J),K=b(),X=p("div"),Y=C(U),le=b(),z=C($),x=b(),fe=p("div"),se=C(ae),_e=b(),oe=p("div"),ne=C(ee),be=b(),R=C(we),T=b(),D&&D.c(),B=yt(),u(_,"class","text-right"),u(M,"class","text-right"),u(X,"class","text-right"),u(oe,"class","text-right"),u(s,"class","grid grid-cols-2 mb-3")},m(pe,ke){P(pe,e,ke),a(e,n),P(pe,i,ke),P(pe,s,ke),a(s,o),a(o,f),a(s,c),a(s,_),a(_,m),a(_,v),a(_,g),a(s,w),a(s,k),a(k,I),a(s,L),a(s,M),a(M,E),a(M,F),a(M,j),a(s,S),a(s,y),a(y,G),a(s,K),a(s,X),a(X,Y),a(X,le),a(X,z),a(s,x),a(s,fe),a(fe,se),a(s,_e),a(s,oe),a(oe,ne),a(oe,be),a(oe,R),P(pe,T,ke),D&&D.m(pe,ke),P(pe,B,ke)},p(pe,ke){var ve,De,Ee,Le,Oe;ke&16&&l!==(l=(((ve=pe[4].realtime)==null?void 0:ve.consumption)??"Consumption")+"")&&q(n,l),ke&16&&r!==(r=Zt(((De=pe[4].common)==null?void 0:De.hour)??"Hour")+"")&&q(f,r),ke&64&&d!==(d=pe[6][0]+"")&&q(m,d),ke&64&&h!==(h=pe[6][1]+"")&&q(g,h),ke&16&&A!==(A=Zt(((Ee=pe[4].common)==null?void 0:Ee.day)??"Day")+"")&&q(I,A),ke&128&&O!==(O=pe[7][0]+"")&&q(E,O),ke&128&&H!==(H=pe[7][1]+"")&&q(j,H),ke&16&&J!==(J=Zt(((Le=pe[4].common)==null?void 0:Le.month)??"Month")+"")&&q(G,J),ke&256&&U!==(U=pe[8][0]+"")&&q(Y,U),ke&256&&$!==($=pe[8][1]+"")&&q(z,$),ke&16&&ae!==(ae=(((Oe=pe[4].realtime)==null?void 0:Oe.last_month)??"Last month")+"")&&q(se,ae),ke&512&&ee!==(ee=pe[9][0]+"")&&q(ne,ee),ke&512&&we!==(we=pe[9][1]+"")&&q(R,we),pe[5]?D?D.p(pe,ke):(D=$s(pe),D.c(),D.m(B.parentNode,B)):D&&(D.d(1),D=null)},d(pe){pe&&(N(e),N(i),N(s),N(T),N(B)),D&&D.d(pe)}}}function rc(t){var et,ze,xt,el,tl,ll,nl,il,sl,ol;let e,l=(((et=t[4].common)==null?void 0:et.import)??"Import")+"",n,i,s,o,r=Zt(((ze=t[4].common)==null?void 0:ze.hour)??"Hour")+"",f,c,_,d=t[6][0]+"",m,v,h=t[6][1]+"",g,w,k,A,I=Zt(((xt=t[4].common)==null?void 0:xt.day)??"Day")+"",L,M,O,E=t[7][0]+"",F,H,j=t[7][1]+"",S,y,J,G,K=Zt(((el=t[4].common)==null?void 0:el.month)??"Month")+"",X,U,Y,le=t[8][0]+"",$,z,x=t[8][1]+"",fe,ae,se,_e,oe=(((tl=t[4].realtime)==null?void 0:tl.last_mo)??"Last mo.")+"",ee,ne,be,we=t[9][0]+"",R,T,B=t[9][1]+"",D,W,te,ue,ce,me=(((ll=t[4].common)==null?void 0:ll.export)??"Export")+"",pe,ke,ve,De,Ee=Zt(((nl=t[4].common)==null?void 0:nl.hour)??"Hour")+"",Le,Oe,rt,dt=t[10][0]+"",tt,Ze,Be=t[10][1]+"",at,Nt,bt,ft,st=Zt(((il=t[4].common)==null?void 0:il.day)??"Day")+"",ut,Rt,Ke,Ie=t[11][0]+"",je,$e,de=t[11][1]+"",qe,Ge,ge,Pe,nt=Zt(((sl=t[4].common)==null?void 0:sl.month)??"Month")+"",He,At,ht,Re=t[12][0]+"",kt,ct,vt=t[12][1]+"",xe,Lt,Gt,wt,_t=(((ol=t[4].realtime)==null?void 0:ol.last_mo)??"Last mo.")+"",Ht,Qt,Ut,Bt=t[13][0]+"",Yt,$t,Vt=t[13][1]+"",Ft,Fe,Je,Ue=t[5]&&xs(t),Tt=t[5]&&eo(t),Ot=t[5]&&to(t),Qe=t[5]&&lo(t),lt=t[5]&&no(t),Pt=t[5]&&io(t),ot=t[5]&&so(t),he=t[5]&&oo(t);return{c(){e=p("strong"),n=C(l),i=b(),s=p("div"),o=p("div"),f=C(r),c=b(),_=p("div"),m=C(d),v=b(),g=C(h),w=b(),Ue&&Ue.c(),k=b(),A=p("div"),L=C(I),M=b(),O=p("div"),F=C(E),H=b(),S=C(j),y=b(),Tt&&Tt.c(),J=b(),G=p("div"),X=C(K),U=b(),Y=p("div"),$=C(le),z=b(),fe=C(x),ae=b(),Ot&&Ot.c(),se=b(),_e=p("div"),ee=C(oe),ne=b(),be=p("div"),R=C(we),T=b(),D=C(B),W=b(),Qe&&Qe.c(),ue=b(),ce=p("strong"),pe=C(me),ke=b(),ve=p("div"),De=p("div"),Le=C(Ee),Oe=b(),rt=p("div"),tt=C(dt),Ze=b(),at=C(Be),Nt=b(),lt&<.c(),bt=b(),ft=p("div"),ut=C(st),Rt=b(),Ke=p("div"),je=C(Ie),$e=b(),qe=C(de),Ge=b(),Pt&&Pt.c(),ge=b(),Pe=p("div"),He=C(nt),At=b(),ht=p("div"),kt=C(Re),ct=b(),xe=C(vt),Lt=b(),ot&&ot.c(),Gt=b(),wt=p("div"),Ht=C(_t),Qt=b(),Ut=p("div"),Yt=C(Bt),$t=b(),Ft=C(Vt),Fe=b(),he&&he.c(),u(_,"class","text-right"),u(O,"class","text-right"),u(Y,"class","text-right"),u(be,"class","text-right"),u(s,"class",te="grid grid-cols-"+t[14]+" mb-3"),u(rt,"class","text-right"),u(Ke,"class","text-right"),u(ht,"class","text-right"),u(Ut,"class","text-right"),u(ve,"class",Je="grid grid-cols-"+t[14])},m(Ae,Q){P(Ae,e,Q),a(e,n),P(Ae,i,Q),P(Ae,s,Q),a(s,o),a(o,f),a(s,c),a(s,_),a(_,m),a(_,v),a(_,g),a(s,w),Ue&&Ue.m(s,null),a(s,k),a(s,A),a(A,L),a(s,M),a(s,O),a(O,F),a(O,H),a(O,S),a(s,y),Tt&&Tt.m(s,null),a(s,J),a(s,G),a(G,X),a(s,U),a(s,Y),a(Y,$),a(Y,z),a(Y,fe),a(s,ae),Ot&&Ot.m(s,null),a(s,se),a(s,_e),a(_e,ee),a(s,ne),a(s,be),a(be,R),a(be,T),a(be,D),a(s,W),Qe&&Qe.m(s,null),P(Ae,ue,Q),P(Ae,ce,Q),a(ce,pe),P(Ae,ke,Q),P(Ae,ve,Q),a(ve,De),a(De,Le),a(ve,Oe),a(ve,rt),a(rt,tt),a(rt,Ze),a(rt,at),a(ve,Nt),lt&<.m(ve,null),a(ve,bt),a(ve,ft),a(ft,ut),a(ve,Rt),a(ve,Ke),a(Ke,je),a(Ke,$e),a(Ke,qe),a(ve,Ge),Pt&&Pt.m(ve,null),a(ve,ge),a(ve,Pe),a(Pe,He),a(ve,At),a(ve,ht),a(ht,kt),a(ht,ct),a(ht,xe),a(ve,Lt),ot&&ot.m(ve,null),a(ve,Gt),a(ve,wt),a(wt,Ht),a(ve,Qt),a(ve,Ut),a(Ut,Yt),a(Ut,$t),a(Ut,Ft),a(ve,Fe),he&&he.m(ve,null)},p(Ae,Q){var Ce,Kt,fl,ml,Jt,pl,dl,Cl,Sl,Ml;Q&16&&l!==(l=(((Ce=Ae[4].common)==null?void 0:Ce.import)??"Import")+"")&&q(n,l),Q&16&&r!==(r=Zt(((Kt=Ae[4].common)==null?void 0:Kt.hour)??"Hour")+"")&&q(f,r),Q&64&&d!==(d=Ae[6][0]+"")&&q(m,d),Q&64&&h!==(h=Ae[6][1]+"")&&q(g,h),Ae[5]?Ue?Ue.p(Ae,Q):(Ue=xs(Ae),Ue.c(),Ue.m(s,k)):Ue&&(Ue.d(1),Ue=null),Q&16&&I!==(I=Zt(((fl=Ae[4].common)==null?void 0:fl.day)??"Day")+"")&&q(L,I),Q&128&&E!==(E=Ae[7][0]+"")&&q(F,E),Q&128&&j!==(j=Ae[7][1]+"")&&q(S,j),Ae[5]?Tt?Tt.p(Ae,Q):(Tt=eo(Ae),Tt.c(),Tt.m(s,J)):Tt&&(Tt.d(1),Tt=null),Q&16&&K!==(K=Zt(((ml=Ae[4].common)==null?void 0:ml.month)??"Month")+"")&&q(X,K),Q&256&&le!==(le=Ae[8][0]+"")&&q($,le),Q&256&&x!==(x=Ae[8][1]+"")&&q(fe,x),Ae[5]?Ot?Ot.p(Ae,Q):(Ot=to(Ae),Ot.c(),Ot.m(s,se)):Ot&&(Ot.d(1),Ot=null),Q&16&&oe!==(oe=(((Jt=Ae[4].realtime)==null?void 0:Jt.last_mo)??"Last mo.")+"")&&q(ee,oe),Q&512&&we!==(we=Ae[9][0]+"")&&q(R,we),Q&512&&B!==(B=Ae[9][1]+"")&&q(D,B),Ae[5]?Qe?Qe.p(Ae,Q):(Qe=lo(Ae),Qe.c(),Qe.m(s,null)):Qe&&(Qe.d(1),Qe=null),Q&16384&&te!==(te="grid grid-cols-"+Ae[14]+" mb-3")&&u(s,"class",te),Q&16&&me!==(me=(((pl=Ae[4].common)==null?void 0:pl.export)??"Export")+"")&&q(pe,me),Q&16&&Ee!==(Ee=Zt(((dl=Ae[4].common)==null?void 0:dl.hour)??"Hour")+"")&&q(Le,Ee),Q&1024&&dt!==(dt=Ae[10][0]+"")&&q(tt,dt),Q&1024&&Be!==(Be=Ae[10][1]+"")&&q(at,Be),Ae[5]?lt?lt.p(Ae,Q):(lt=no(Ae),lt.c(),lt.m(ve,bt)):lt&&(lt.d(1),lt=null),Q&16&&st!==(st=Zt(((Cl=Ae[4].common)==null?void 0:Cl.day)??"Day")+"")&&q(ut,st),Q&2048&&Ie!==(Ie=Ae[11][0]+"")&&q(je,Ie),Q&2048&&de!==(de=Ae[11][1]+"")&&q(qe,de),Ae[5]?Pt?Pt.p(Ae,Q):(Pt=io(Ae),Pt.c(),Pt.m(ve,ge)):Pt&&(Pt.d(1),Pt=null),Q&16&&nt!==(nt=Zt(((Sl=Ae[4].common)==null?void 0:Sl.month)??"Month")+"")&&q(He,nt),Q&4096&&Re!==(Re=Ae[12][0]+"")&&q(kt,Re),Q&4096&&vt!==(vt=Ae[12][1]+"")&&q(xe,vt),Ae[5]?ot?ot.p(Ae,Q):(ot=so(Ae),ot.c(),ot.m(ve,Gt)):ot&&(ot.d(1),ot=null),Q&16&&_t!==(_t=(((Ml=Ae[4].realtime)==null?void 0:Ml.last_mo)??"Last mo.")+"")&&q(Ht,_t),Q&8192&&Bt!==(Bt=Ae[13][0]+"")&&q(Yt,Bt),Q&8192&&Vt!==(Vt=Ae[13][1]+"")&&q(Ft,Vt),Ae[5]?he?he.p(Ae,Q):(he=oo(Ae),he.c(),he.m(ve,null)):he&&(he.d(1),he=null),Q&16384&&Je!==(Je="grid grid-cols-"+Ae[14])&&u(ve,"class",Je)},d(Ae){Ae&&(N(e),N(i),N(s),N(ue),N(ce),N(ke),N(ve)),Ue&&Ue.d(),Tt&&Tt.d(),Ot&&Ot.d(),Qe&&Qe.d(),lt&<.d(),Pt&&Pt.d(),ot&&ot.d(),he&&he.d()}}}function $s(t){var ne,be,we,R,T,B;let e,l=(((ne=t[4].realtime)==null?void 0:ne.cost)??"Cost")+"",n,i,s,o,r=Zt(((be=t[4].common)==null?void 0:be.hour)??"Hour")+"",f,c,_,d=zt(t[1].h.c,2)+"",m,v,h,g,w,k=Zt(((we=t[4].common)==null?void 0:we.day)??"Day")+"",A,I,L,M=zt(t[1].d.c,1)+"",O,E,F,H,j,S=Zt(((R=t[4].common)==null?void 0:R.month)??"Month")+"",y,J,G,K=zt(t[1].m.c)+"",X,U,Y,le,$,z=(((T=t[4].realtime)==null?void 0:T.last_month)??"Last month")+"",x,fe,ae,se=zt((B=t[0].last_month)==null?void 0:B.c)+"",_e,oe,ee;return{c(){e=p("strong"),n=C(l),i=b(),s=p("div"),o=p("div"),f=C(r),c=b(),_=p("div"),m=C(d),v=b(),h=C(t[2]),g=b(),w=p("div"),A=C(k),I=b(),L=p("div"),O=C(M),E=b(),F=C(t[2]),H=b(),j=p("div"),y=C(S),J=b(),G=p("div"),X=C(K),U=b(),Y=C(t[2]),le=b(),$=p("div"),x=C(z),fe=b(),ae=p("div"),_e=C(se),oe=b(),ee=C(t[2]),u(_,"class","text-right"),u(L,"class","text-right"),u(G,"class","text-right"),u(ae,"class","text-right"),u(s,"class","grid grid-cols-2")},m(D,W){P(D,e,W),a(e,n),P(D,i,W),P(D,s,W),a(s,o),a(o,f),a(s,c),a(s,_),a(_,m),a(_,v),a(_,h),a(s,g),a(s,w),a(w,A),a(s,I),a(s,L),a(L,O),a(L,E),a(L,F),a(s,H),a(s,j),a(j,y),a(s,J),a(s,G),a(G,X),a(G,U),a(G,Y),a(s,le),a(s,$),a($,x),a(s,fe),a(s,ae),a(ae,_e),a(ae,oe),a(ae,ee)},p(D,W){var te,ue,ce,me,pe,ke;W&16&&l!==(l=(((te=D[4].realtime)==null?void 0:te.cost)??"Cost")+"")&&q(n,l),W&16&&r!==(r=Zt(((ue=D[4].common)==null?void 0:ue.hour)??"Hour")+"")&&q(f,r),W&2&&d!==(d=zt(D[1].h.c,2)+"")&&q(m,d),W&4&&q(h,D[2]),W&16&&k!==(k=Zt(((ce=D[4].common)==null?void 0:ce.day)??"Day")+"")&&q(A,k),W&2&&M!==(M=zt(D[1].d.c,1)+"")&&q(O,M),W&4&&q(F,D[2]),W&16&&S!==(S=Zt(((me=D[4].common)==null?void 0:me.month)??"Month")+"")&&q(y,S),W&2&&K!==(K=zt(D[1].m.c)+"")&&q(X,K),W&4&&q(Y,D[2]),W&16&&z!==(z=(((pe=D[4].realtime)==null?void 0:pe.last_month)??"Last month")+"")&&q(x,z),W&1&&se!==(se=zt((ke=D[0].last_month)==null?void 0:ke.c)+"")&&q(_e,se),W&4&&q(ee,D[2])},d(D){D&&(N(e),N(i),N(s))}}}function xs(t){let e,l=zt(t[1].h.c,2)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=b(),s=C(t[2]),u(e,"class","text-right")},m(o,r){P(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].h.c,2)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&N(e)}}}function eo(t){let e,l=zt(t[1].d.c,1)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=b(),s=C(t[2]),u(e,"class","text-right")},m(o,r){P(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].d.c,1)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&N(e)}}}function to(t){let e,l=zt(t[1].m.c)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=b(),s=C(t[2]),u(e,"class","text-right")},m(o,r){P(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].m.c)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&N(e)}}}function lo(t){var o;let e,l=zt((o=t[0].last_month)==null?void 0:o.c)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=b(),s=C(t[2]),u(e,"class","text-right")},m(r,f){P(r,e,f),a(e,n),a(e,i),a(e,s)},p(r,f){var c;f&1&&l!==(l=zt((c=r[0].last_month)==null?void 0:c.c)+"")&&q(n,l),f&4&&q(s,r[2])},d(r){r&&N(e)}}}function no(t){let e,l=zt(t[1].h.i,2)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=b(),s=C(t[2]),u(e,"class","text-right")},m(o,r){P(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].h.i,2)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&N(e)}}}function io(t){let e,l=zt(t[1].d.i,1)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=b(),s=C(t[2]),u(e,"class","text-right")},m(o,r){P(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].d.i,1)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&N(e)}}}function so(t){let e,l=zt(t[1].m.i)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=b(),s=C(t[2]),u(e,"class","text-right")},m(o,r){P(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].m.i)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&N(e)}}}function oo(t){var o;let e,l=zt((o=t[0].last_month)==null?void 0:o.i)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=b(),s=C(t[2]),u(e,"class","text-right")},m(r,f){P(r,e,f),a(e,n),a(e,i),a(e,s)},p(r,f){var c;f&1&&l!==(l=zt((c=r[0].last_month)==null?void 0:c.i)+"")&&q(n,l),f&4&&q(s,r[2])},d(r){r&&N(e)}}}function cc(t){var _;let e,l,n=(((_=t[4].realtime)==null?void 0:_.title)??"Real time calculations")+"",i,s,o,r,f,c=t[1]&&Js(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("br"),r=p("br"),f=b(),c&&c.c(),u(e,"class","mx-2 text-sm neas-green")},m(d,m){P(d,e,m),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),c&&c.m(e,null)},p(d,[m]){var v;m&16&&n!==(n=(((v=d[4].realtime)==null?void 0:v.title)??"Real time calculations")+"")&&q(i,n),d[1]?c?c.p(d,m):(c=Js(d),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:Ve,o:Ve,d(d){d&&N(e),c&&c.d()}}}function _c(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:s}=e,{hasExport:o}=e,{translations:r={}}=e,f,c,_,d,m,v,h,g,w=!1,k=3;return t.$$set=A=>{"sysinfo"in A&&l(0,n=A.sysinfo),"data"in A&&l(1,i=A.data),"currency"in A&&l(2,s=A.currency),"hasExport"in A&&l(3,o=A.hasExport),"translations"in A&&l(4,r=A.translations)},t.$$.update=()=>{var A,I,L,M,O,E,F,H;t.$$.dirty&35&&(l(5,w=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(14,k=w?3:2),l(6,f=rl(((A=i==null?void 0:i.h)==null?void 0:A.u)*1e3,"Wh")),l(7,c=rl(((I=i==null?void 0:i.d)==null?void 0:I.u)*1e3,"Wh")),l(8,_=rl(((L=i==null?void 0:i.m)==null?void 0:L.u)*1e3,"Wh")),l(9,d=rl(((M=n==null?void 0:n.last_month)==null?void 0:M.u)*1e3,"Wh")),l(10,m=rl(((O=i==null?void 0:i.h)==null?void 0:O.p)*1e3,"Wh")),l(11,v=rl(((E=i==null?void 0:i.d)==null?void 0:E.p)*1e3,"Wh")),l(12,h=rl(((F=i==null?void 0:i.m)==null?void 0:F.p)*1e3,"Wh")),l(13,g=rl(((H=n==null?void 0:n.last_month)==null?void 0:H.p)*1e3,"Wh")))},[n,i,s,o,r,w,f,c,_,d,m,v,h,g,k]}class mc extends Mt{constructor(e){super(),St(this,e,_c,cc,Ct,{sysinfo:0,data:1,currency:2,hasExport:3,translations:4})}}function pc(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function dc(t,e,l){let{title:n}=e,{json:i}=e,{sysinfo:s}=e,o={},r,f,c=document.documentElement.classList.contains("dark");return t.$$set=_=>{"title"in _&&l(1,n=_.title),"json"in _&&l(2,i=_.json),"sysinfo"in _&&l(3,s=_.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let _=i.currency,d=new Date().getUTCHours(),m=0,v=0,h=0,g=[],w=[],k=[];l(5,f=l(4,r=0));let A=new Date;for(Ll(A,s.clock_offset-(24+A.getHours()-A.getUTCHours())%24),m=d;m<24&&(v=i[gt(h++)],v!=null);m++)w.push({label:gt(A.getHours())}),k.push(v*100),l(5,f=Math.min(f,v*100)),l(4,r=Math.max(r,v*100)),Ll(A,1);for(m=0;m<24&&(v=i[gt(h++)],v!=null);m++)w.push({label:gt(A.getHours())}),k.push(v*100),l(5,f=Math.min(f,v*100)),l(4,r=Math.max(r,v*100)),Ll(A,1);let I=Hn(Math.max(Math.abs(f)/100,Math.abs(r)/100),_);if(I&&I[1]&&I[1]!=_)for(_=I[1],l(5,f*=100),l(4,r*=100),m=0;m=0?F.toFixed(H):"",title:F>=0?F.toFixed(2)+" "+_:"",value:v>=0?Math.abs(v):0,label2:F<0?F.toFixed(H):"",title2:F<0?F.toFixed(2)+" "+_:"",value2:v<0?Math.abs(v):0,color:c?"#5c2da5":"#7c3aed"})}let M=Math.max(r,Math.abs(f));if(f<0){l(5,f=Math.min(M/4*-1,f));let F=Math.ceil(Math.abs(f)/M*4),H=f/F;for(m=1;m{"title"in _&&l(1,n=_.title),"json"in _&&l(2,i=_.json),"sysinfo"in _&&l(3,s=_.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let _=0,d=[],m=[],v=[];l(5,f=l(4,r=0));let h=new Date,g=new Date;g.setDate(0),g.setHours(12);let w=(g.getHours()-g.getUTCHours())%24-s.clock_offset,k=h.getUTCHours();for(Ll(h,-w-24),_=k;_<24;_++){let M=i["i"+gt(_)],O=i["e"+gt(_)];M===void 0&&(M=0),O===void 0&&(O=0),m.push({label:gt(h.getHours())}),v.push({label:M.toFixed(1),title:M.toFixed(2)+" kWh",value:M*10,label2:O.toFixed(1),title2:O.toFixed(2)+" kWh",value2:O*10,color:c?"#5c2da5":"#7c3aed",color2:c?"#27728e":"#37829e"}),l(5,f=Math.max(f,O*10)),l(4,r=Math.max(r,M*10)),Ll(h,1)}for(_=0;_{"title"in _&&l(1,n=_.title),"json"in _&&l(2,i=_.json),"sysinfo"in _&&l(3,s=_.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let _=0,d=[],m=[],v=[];l(5,f=l(4,r=0));let h=new Date,g=new Date;g.setDate(0),g.setHours(12);let w=(g.getHours()-g.getUTCHours())%24-s.clock_offset;for(Ll(h,-w),Ll(g,-w),_=h.getDate();_<=g.getDate();_++){let L=i["i"+gt(_)],M=i["e"+gt(_)];L===void 0&&(L=0),M===void 0&&(M=0),m.push({label:gt(_)}),v.push({label:L.toFixed(L<10?1:0),title:L.toFixed(2)+" kWh",value:L,label2:M.toFixed(M<10?1:0),title2:M.toFixed(2)+" kWh",value2:M,color:c?"#5c2da5":"#7c3aed",color2:c?"#27728e":"#37829e"}),l(5,f=Math.max(f,M)),l(4,r=Math.max(r,L))}for(_=1;_{"title"in c&&l(1,n=c.title),"json"in c&&l(2,i=c.json)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,_=0,d=[],m=[],v=[];i.s&&i.s.forEach((w,k)=>{var A=w.n?w.n:w.a;_=w.v,_==-127&&(_=0),m.push({label:A.slice(-4)}),v.push({label:_.toFixed(1),value:_,color:s?"#5c2da5":"#7c3aed"}),l(4,f=Math.min(f,_)),l(3,r=Math.max(r,_))}),l(3,r=Math.ceil(r)),l(4,f=Math.floor(f));let h=r;f<0&&(h+=Math.abs(f));let g=h/4;for(c=0;c<5;c++)_=f+g*c,d.push({value:_,label:_.toFixed(1)});l(0,o={title:n+" (°C)",dark:document.documentElement.classList.contains("dark"),height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:f,max:r,ticks:d},x:{ticks:m},points:v})}},[o,n,i,r,f]}class Nc extends Mt{constructor(e){super(),St(this,e,Mc,Sc,Ct,{title:1,json:2})}}function Pc(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}let Tc=0;function Ec(t,e,l){let{title:n}=e,{translations:i={}}=e,s=document.documentElement.classList.contains("dark"),o={},r=0,{tariffData:f}=e;return t.$$set=c=>{"title"in c&&l(1,n=c.title),"translations"in c&&l(2,i=c.translations),"tariffData"in c&&l(3,f=c.tariffData)},t.$$.update=()=>{var c;if(t.$$.dirty&30){let _=0,d=[],m=[],v=[];if(d.push({value:0,label:0}),f&&f.p)for(_=0;_0?gt(h.d)+"."+(i.months?(c=i.months)==null?void 0:c[new Date().getMonth()]:gt(new Date().getMonth()+1)):"-"}),l(4,r=Math.max(r,h.v))}if(f&&f.t){for(_=0;_=r)break;d.push({value:h,label:h})}d.push({label:f.m.toFixed(1),align:"right",color:"green",value:f.m})}f&&f.c&&(d.push({label:f.c.toFixed(0),color:"orange",value:f.c}),l(4,r=Math.max(r,f.c))),l(4,r=Math.ceil(r)),l(0,o={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:35,bottom:20,left:35},y:{min:Tc,max:r,ticks:d},x:{ticks:m},points:v})}},[o,n,i,f,r]}class qc extends Mt{constructor(e){super(),St(this,e,Ec,Pc,Ct,{title:1,translations:2,tariffData:3})}}let an=0,Dc={data:[]};async function ns(){let e=await(await kl(an<0?"realtime.json":"realtime.json?offset="+an)).json();is.update(l=>{for(let n=0;n=0&&(an+=e.size,anbn||Fi-bn>300?(ns(),wi=0):is.update(t=>{if(t.lastUpdate)for(;bn>t.lastUpdate;)t.data.unshift(Lu),t.data=t.data.slice(0,t.size),t.lastUpdate+=10,wi++;else t.lastUpdate=bn;return t})}function Oc(t){if(Lu=t.i-t.e,bn=t.u,!ao){ns(),ao=!0,Fi=bn;return}Ac()&&Lc()}function fo(t,e,l){const n=t.slice();return n[18]=e[l],n[20]=l,n}function uo(t,e,l){const n=t.slice();return n[21]=e[l],n}function Ic(t){let e,l,n;return{c(){e=p("strong"),l=C(t[0]),n=C(" not available"),u(e,"class","text-sm")},m(i,s){P(i,e,s),a(e,l),a(e,n)},p(i,s){s&1&&q(l,i[0])},d(i){i&&N(e)}}}function Rc(t){let e,l,n,i,s,o,r,f=t[8]&&ro(t);return{c(){e=p("strong"),l=C(t[0]),n=C(" ("),i=C(t[12]),s=C(")"),o=b(),f&&f.c(),r=yt(),u(e,"class","text-sm")},m(c,_){P(c,e,_),a(e,l),a(e,n),a(e,i),a(e,s),P(c,o,_),f&&f.m(c,_),P(c,r,_)},p(c,_){_&1&&q(l,c[0]),_&4096&&q(i,c[12]),c[8]?f?f.p(c,_):(f=ro(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(N(e),N(o),N(r)),f&&f.d(c)}}}function ro(t){let e,l,n,i,s,o=it(t[8]),r=[];for(let _=0;_t[17].call(e))},m(o,r){P(o,e,r),s.m(e,null),l=Ki(e,t[17].bind(e))},p(o,[r]){i===(i=n(o))&&s?s.p(o,r):(s.d(1),s=i(o),s&&(s.c(),s.m(e,null)))},i:Ve,o:Ve,d(o){o&&N(e),s.d(),l()}}}function Uc(t,e,l){let{title:n}=e,i=document.documentElement.classList.contains("dark"),s=null;is.subscribe(M=>{l(16,s=M)});let o=!1,r,f,c,_,d,m,v,h=function(M,O,E){return Math.ceil(d-(M-O)/(E-O)*d)-25},g=function(M){return 30+Math.ceil(M/s.size*(m-35))},w,k,A,I;function L(){c=this.clientWidth,_=this.clientHeight,l(3,c),l(4,_)}return t.$$set=M=>{"title"in M&&l(0,n=M.title)},t.$$.update=()=>{if(t.$$.dirty&67582)if(l(5,d=parseInt(_)-50),l(6,m=c-35),l(10,A=m/s.size),l(2,f=0),l(1,r=0),s.data&&d>10&&m>100&&A>.1){l(11,o=!0);for(let E in s.data){let F=s.data[E];isNaN(F)&&(F=0),l(1,r=Math.max(Math.ceil(F/1e3)*1e3,r)),l(2,f=Math.min(Math.floor(F/1e3)*1e3,f))}let M=r-f;l(12,I=r>2500?"kW":"W"),l(8,w=[]);for(let E=f;E2500?(E/1e3).toFixed(1):E}),!(w.length>6));E+=M/5);l(9,k=[]);for(let E=0;E12));E+=Math.round(s.size/Math.round(m/120)));let O=s.size;l(7,v=g(s.size)+","+h(0,f,r)+" "+g(1)+","+h(0,f,r));for(let E in s.data){if(O<0)break;let F=s.data[E];isNaN(F)&&(F=0),l(7,v=g(O--)+","+h(F,f,r)+" "+v)}}else l(11,o=!1)},[n,r,f,c,_,d,m,v,w,k,A,o,I,i,h,g,s,L]}class Bc extends Mt{constructor(e){super(),St(this,e,Uc,Fc,Ct,{title:0})}}function yc(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function jc(t,e,l){let{title:n}=e,{unit:i=""}=e,{l1:s=!1}=e,{l2:o=!1}=e,{l2x:r=!1}=e,{l3:f=!1}=e,{l1i:c=0}=e,{l2i:_=0}=e,{l3i:d=0}=e,{l1e:m=0}=e,{l2e:v=0}=e,{l3e:h=0}=e,{maxImport:g=0}=e,{maxExport:w=0}=e,{importColorFn:k}=e,{exportColorFn:A}=e,I={};function L(M,O){return{label:zt(M>900?M/1e3:M)+(M>900?"k":"")+i,title:M.toFixed(2)+" "+i,value:isNaN(M)?0:M,color:k(M?M/g*100:0,document.documentElement.classList.contains("dark")),label2:zt(O>900?O/1e3:O)+(O>900?"k":"")+i,title2:O.toFixed(2)+" "+i,value2:isNaN(O)?0:O,color2:A(O?O/w*100:0)}}return t.$$set=M=>{"title"in M&&l(1,n=M.title),"unit"in M&&l(2,i=M.unit),"l1"in M&&l(3,s=M.l1),"l2"in M&&l(4,o=M.l2),"l2x"in M&&l(5,r=M.l2x),"l3"in M&&l(6,f=M.l3),"l1i"in M&&l(7,c=M.l1i),"l2i"in M&&l(8,_=M.l2i),"l3i"in M&&l(9,d=M.l3i),"l1e"in M&&l(10,m=M.l1e),"l2e"in M&&l(11,v=M.l2e),"l3e"in M&&l(12,h=M.l3e),"maxImport"in M&&l(13,g=M.maxImport),"maxExport"in M&&l(14,w=M.maxExport),"importColorFn"in M&&l(15,k=M.importColorFn),"exportColorFn"in M&&l(16,A=M.exportColorFn)},t.$$.update=()=>{if(t.$$.dirty&32762){let M=[],O=[];s&&(M.push({label:"L1"}),O.push(L(c,m))),o&&(r?(M.push({label:"L2"}),O.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(M.push({label:"L2"}),O.push(L(_,v)))),f&&(M.push({label:"L3"}),O.push(L(d,h)));let E=[];if(w){let F=w>g?4:w*4/g;E.push({value:-w,label:"-100%"}),F>=4&&E.push({value:-w/4*3,label:"-75%"}),F>=2&&E.push({value:-w/2,label:"-50%"}),F>=4&&E.push({value:-w/4,label:"-25%"})}if(E.push({value:0,label:"0%"}),g){let F=g>w?4:g*4/w;E.push({value:g/4,label:"25%"}),F>=4&&E.push({value:g/2,label:"50%"}),F>=2&&E.push({value:g/4*3,label:"75%"}),F>=4&&E.push({value:g,label:"100%"})}l(0,I={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:15,bottom:20,left:35},y:{min:-w,max:g,ticks:E},x:{ticks:M},points:O})}},[I,n,i,s,o,r,f,c,_,d,m,v,h,g,w,k,A]}class ss extends Mt{constructor(e){super(),St(this,e,jc,yc,Ct,{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 ho(t){var k;let e,l,n,i,s,o,r=(t[0].mt?ri(t[0].mt):"-")+"",f,c,_,d=t[11][0]+"",m,v,h=t[11][1]+"",g,w;return i=new Au({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:((k=t[6].common)==null?void 0:k.import)??"Import",sub:Hn(t[0].p,t[0].pc),colorFn:Ji}}),{c(){e=p("div"),l=p("div"),n=p("div"),Ne(i.$$.fragment),s=b(),o=p("div"),f=C(r),c=b(),_=p("div"),m=C(d),v=b(),g=C(h),u(n,"class","col-span-2"),u(_,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(A,I){P(A,e,I),a(e,l),a(l,n),Se(i,n,null),a(l,s),a(l,o),a(o,f),a(l,c),a(l,_),a(_,m),a(_,v),a(_,g),w=!0},p(A,I){var M;const L={};I&1&&(L.val=A[0].i?A[0].i:0),I&1&&(L.max=A[0].im?A[0].im:15e3),I&64&&(L.label=((M=A[6].common)==null?void 0:M.import)??"Import"),I&1&&(L.sub=Hn(A[0].p,A[0].pc)),i.$set(L),(!w||I&1)&&r!==(r=(A[0].mt?ri(A[0].mt):"-")+"")&&q(f,r),(!w||I&2048)&&d!==(d=A[11][0]+"")&&q(m,d),(!w||I&2048)&&h!==(h=A[11][1]+"")&&q(g,h)},i(A){w||(Z(i.$$.fragment,A),w=!0)},o(A){ie(i.$$.fragment,A),w=!1},d(A){A&&N(e),Me(i)}}}function vo(t){var g;let e,l,n,i,s,o,r,f,c=t[12][0]+"",_,d,m=t[12][1]+"",v,h;return i=new Au({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:((g=t[6].common)==null?void 0:g.export)??"Export",sub:Hn(t[0].px,t[0].pc),colorFn:jn}}),{c(){e=p("div"),l=p("div"),n=p("div"),Ne(i.$$.fragment),s=b(),o=p("div"),r=b(),f=p("div"),_=C(c),d=b(),v=C(m),u(n,"class","col-span-2"),u(f,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(w,k){P(w,e,k),a(e,l),a(l,n),Se(i,n,null),a(l,s),a(l,o),a(l,r),a(l,f),a(f,_),a(f,d),a(f,v),h=!0},p(w,k){var I;const A={};k&1&&(A.val=w[0].e?w[0].e:0),k&1&&(A.max=w[0].om?w[0].om*1e3:1e4),k&64&&(A.label=((I=w[6].common)==null?void 0:I.export)??"Export"),k&1&&(A.sub=Hn(w[0].px,w[0].pc)),i.$set(A),(!h||k&4096)&&c!==(c=w[12][0]+"")&&q(_,c),(!h||k&4096)&&m!==(m=w[12][1]+"")&&q(v,m)},i(w){h||(Z(i.$$.fragment,w),h=!0)},o(w){ie(i.$$.fragment,w),h=!1},d(w){w&&N(e),Me(i)}}}function bo(t){let e,l,n=t[0].l1&&go(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,s){P(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&Z(n,1)):(n=go(i),n.c(),Z(n,1),n.m(e,null)):n&&(mt(),ie(n,1,1,()=>{n=null}),pt())},i(i){l||(Z(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&N(e),n&&n.d()}}}function go(t){var n;let e,l;return e=new sc({props:{title:((n=t[6].common)==null?void 0:n.voltage)??"Volt",u1:t[0].l1.u,u2:t[0].l2.u,u3:t[0].l3.u,ds:t[0].ds}}),{c(){Ne(e.$$.fragment)},m(i,s){Se(e,i,s),l=!0},p(i,s){var r;const o={};s&64&&(o.title=((r=i[6].common)==null?void 0:r.voltage)??"Volt"),s&1&&(o.u1=i[0].l1.u),s&1&&(o.u2=i[0].l2.u),s&1&&(o.u3=i[0].l3.u),s&1&&(o.ds=i[0].ds),e.$set(o)},i(i){l||(Z(e.$$.fragment,i),l=!0)},o(i){ie(e.$$.fragment,i),l=!1},d(i){Me(e,i)}}}function ko(t){let e,l,n=t[0].l1&&wo(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,s){P(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&Z(n,1)):(n=wo(i),n.c(),Z(n,1),n.m(e,null)):n&&(mt(),ie(n,1,1,()=>{n=null}),pt())},i(i){l||(Z(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&N(e),n&&n.d()}}}function wo(t){var n;let e,l;return e=new ss({props:{title:((n=t[6].common)==null?void 0:n.amperage)??"Amp",unit:"A",importColorFn:Ji,exportColorFn:jn,maxImport:t[0].mf,l1:t[8],l2:t[9],l3:t[10],l2x:t[0].l2.e,l1i:Math.max(Math.abs(t[0].l1.i),0),l2i:Math.max(Math.abs(t[0].l2.i),0),l3i:Math.max(Math.abs(t[0].l3.i),0)}}),{c(){Ne(e.$$.fragment)},m(i,s){Se(e,i,s),l=!0},p(i,s){var r;const o={};s&64&&(o.title=((r=i[6].common)==null?void 0:r.amperage)??"Amp"),s&1&&(o.maxImport=i[0].mf),s&256&&(o.l1=i[8]),s&512&&(o.l2=i[9]),s&1024&&(o.l3=i[10]),s&1&&(o.l2x=i[0].l2.e),s&1&&(o.l1i=Math.max(Math.abs(i[0].l1.i),0)),s&1&&(o.l2i=Math.max(Math.abs(i[0].l2.i),0)),s&1&&(o.l3i=Math.max(Math.abs(i[0].l3.i),0)),e.$set(o)},i(i){l||(Z(e.$$.fragment,i),l=!0)},o(i){ie(e.$$.fragment,i),l=!1},d(i){Me(e,i)}}}function Co(t){let e,l,n=t[0].l1&&So(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,s){P(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&Z(n,1)):(n=So(i),n.c(),Z(n,1),n.m(e,null)):n&&(mt(),ie(n,1,1,()=>{n=null}),pt())},i(i){l||(Z(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&N(e),n&&n.d()}}}function So(t){var n;let e,l;return e=new ss({props:{title:((n=t[6].dashboard)==null?void 0:n.phase)??"Phase",unit:"W",importColorFn:Ji,exportColorFn:jn,maxImport:(t[0].mf?t[0].mf:32)*230,maxExport:t[0].om?t[13]?t[0].om*1e3/Math.sqrt(3):t[0].om*1e3:0,l1:t[8],l2:t[9],l3:t[10],l1i:t[0].l1.p,l2i:t[0].l2.p,l3i:t[0].l3.p,l1e:t[0].l1.q,l2e:t[0].l2.q,l3e:t[0].l3.q}}),{c(){Ne(e.$$.fragment)},m(i,s){Se(e,i,s),l=!0},p(i,s){var r;const o={};s&64&&(o.title=((r=i[6].dashboard)==null?void 0:r.phase)??"Phase"),s&1&&(o.maxImport=(i[0].mf?i[0].mf:32)*230),s&8193&&(o.maxExport=i[0].om?i[13]?i[0].om*1e3/Math.sqrt(3):i[0].om*1e3:0),s&256&&(o.l1=i[8]),s&512&&(o.l2=i[9]),s&1024&&(o.l3=i[10]),s&1&&(o.l1i=i[0].l1.p),s&1&&(o.l2i=i[0].l2.p),s&1&&(o.l3i=i[0].l3.p),s&1&&(o.l1e=i[0].l1.q),s&1&&(o.l2e=i[0].l2.q),s&1&&(o.l3e=i[0].l3.q),e.$set(o)},i(i){l||(Z(e.$$.fragment,i),l=!0)},o(i){ie(e.$$.fragment,i),l=!1},d(i){Me(e,i)}}}function Mo(t){let e,l,n=t[0].l1&&No(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,s){P(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&Z(n,1)):(n=No(i),n.c(),Z(n,1),n.m(e,null)):n&&(mt(),ie(n,1,1,()=>{n=null}),pt())},i(i){l||(Z(n),l=!0)},o(i){ie(n),l=!1},d(i){i&&N(e),n&&n.d()}}}function No(t){var n;let e,l;return e=new ss({props:{title:((n=t[6].dashboard)==null?void 0:n.pf)??"Pf",importColorFn:jn,exportColorFn:jn,maxImport:1,l1:t[8],l2:t[9],l3:t[10],l1i:t[0].l1.f,l2i:t[0].l2.f,l3i:t[0].l3.f}}),{c(){Ne(e.$$.fragment)},m(i,s){Se(e,i,s),l=!0},p(i,s){var r;const o={};s&64&&(o.title=((r=i[6].dashboard)==null?void 0:r.pf)??"Pf"),s&256&&(o.l1=i[8]),s&512&&(o.l2=i[9]),s&1024&&(o.l3=i[10]),s&1&&(o.l1i=i[0].l1.f),s&1&&(o.l2i=i[0].l2.f),s&1&&(o.l3i=i[0].l3.f),e.$set(o)},i(i){l||(Z(e.$$.fragment,i),l=!0)},o(i){ie(e.$$.fragment,i),l=!1},d(i){Me(e,i)}}}function Po(t){let e,l,n;return l=new fc({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec,translations:t[6]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt")},m(i,s){P(i,e,s),Se(l,e,null),n=!0},p(i,s){const o={};s&1&&(o.importInstant=i[0].ri),s&1&&(o.exportInstant=i[0].re),s&1&&(o.importTotal=i[0].ric),s&1&&(o.exportTotal=i[0].rec),s&64&&(o.translations=i[6]),l.$set(o)},i(i){n||(Z(l.$$.fragment,i),n=!0)},o(i){ie(l.$$.fragment,i),n=!1},d(i){i&&N(e),Me(l)}}}function To(t){let e,l,n;return l=new mc({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0,translations:t[6]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt")},m(i,s){P(i,e,s),Se(l,e,null),n=!0},p(i,s){const o={};s&2&&(o.sysinfo=i[1]),s&1&&(o.data=i[0].ea),s&1&&(o.currency=i[0].pc),s&1&&(o.hasExport=i[0].om>0||i[0].e>0),s&64&&(o.translations=i[6]),l.$set(o)},i(i){n||(Z(l.$$.fragment,i),n=!0)},o(i){ie(l.$$.fragment,i),n=!1},d(i){i&&N(e),Me(l)}}}function Eo(t){var i;let e,l,n;return l=new qc({props:{title:((i=t[6].dashboard)==null?void 0:i.tariffpeak)??"Tariff peaks",tariffData:t[7],translations:t[6]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt h-64")},m(s,o){P(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.tariffpeak)??"Tariff peaks"),o&128&&(r.tariffData=s[7]),o&64&&(r.translations=s[6]),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){ie(l.$$.fragment,s),n=!1},d(s){s&&N(e),Me(l)}}}function qo(t){var i;let e,l,n;return l=new Bc({props:{title:((i=t[6].dashboard)==null?void 0:i.realtime)??"Real time"}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(s,o){P(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.realtime)??"Real time"),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){ie(l.$$.fragment,s),n=!1},d(s){s&&N(e),Me(l)}}}function Do(t){var i;let e,l,n;return l=new hc({props:{title:((i=t[6].dashboard)==null?void 0:i.price)??"Price",json:t[2],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(s,o){P(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.price)??"Price"),o&4&&(r.json=s[2]),o&2&&(r.sysinfo=s[1]),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){ie(l.$$.fragment,s),n=!1},d(s){s&&N(e),Me(l)}}}function Ao(t){var i;let e,l,n;return l=new gc({props:{title:((i=t[6].dashboard)==null?void 0:i.day)??"24 hours",json:t[3],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(s,o){P(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.day)??"24 hours"),o&8&&(r.json=s[3]),o&2&&(r.sysinfo=s[1]),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){ie(l.$$.fragment,s),n=!1},d(s){s&&N(e),Me(l)}}}function Lo(t){var i;let e,l,n;return l=new Cc({props:{title:((i=t[6].dashboard)==null?void 0:i.month)??"{0} days",json:t[4],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(s,o){P(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.month)??"{0} days"),o&16&&(r.json=s[4]),o&2&&(r.sysinfo=s[1]),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){ie(l.$$.fragment,s),n=!1},d(s){s&&N(e),Me(l)}}}function Oo(t){var i;let e,l,n;return l=new Nc({props:{title:((i=t[6].dashboard)==null?void 0:i.temperature)??"Temperature",json:t[5]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(s,o){P(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.temperature)??"Temperature"),o&32&&(r.json=s[5]),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){ie(l.$$.fragment,s),n=!1},d(s){s&&N(e),Me(l)}}}function zc(t){let e,l=Wt(t[1].ui.i,t[0].i),n,i=Wt(t[1].ui.e,t[0].om||t[0].e>0),s,o=Wt(t[1].ui.v,t[0].l1&&(t[0].l1.u>100||t[0].l2.u>100||t[0].l3.u>100)),r,f=Wt(t[1].ui.a,t[0].l1&&(t[0].l1.i>.01||t[0].l2.i>.01||t[0].l3.i>.01)),c,_=Wt(t[1].ui.h,t[0].l1&&(t[0].l1.p>.01||t[0].l2.p>.01||t[0].l3.p>.01||t[0].l1.q>.01||t[0].l2.q>.01||t[0].l3.q>.01)),d,m=Wt(t[1].ui.f,t[0].l1&&(t[0].l1.f>.01||t[0].l2.f>.01||t[0].l3.f>.01)),v,h=Wt(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),g,w=Wt(t[1].ui.c,t[0].ea),k,A=Wt(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("NO")||t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),I,L=Wt(t[1].ui.l,t[0].hm==1),M,O=Wt(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),E,F=Wt(t[1].ui.d,t[3]),H,j=Wt(t[1].ui.m,t[4]),S,y=Wt(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),J,G=l&&ho(t),K=i&&vo(t),X=o&&bo(t),U=f&&ko(t),Y=_&&Co(t),le=m&&Mo(t),$=h&&Po(t),z=w&&To(t),x=A&&Eo(t),fe=L&&qo(t),ae=O&&Do(t),se=F&&Ao(t),_e=j&&Lo(t),oe=y&&Oo(t);return{c(){e=p("div"),G&&G.c(),n=b(),K&&K.c(),s=b(),X&&X.c(),r=b(),U&&U.c(),c=b(),Y&&Y.c(),d=b(),le&&le.c(),v=b(),$&&$.c(),g=b(),z&&z.c(),k=b(),x&&x.c(),I=b(),fe&&fe.c(),M=b(),ae&&ae.c(),E=b(),se&&se.c(),H=b(),_e&&_e.c(),S=b(),oe&&oe.c(),u(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(ee,ne){P(ee,e,ne),G&&G.m(e,null),a(e,n),K&&K.m(e,null),a(e,s),X&&X.m(e,null),a(e,r),U&&U.m(e,null),a(e,c),Y&&Y.m(e,null),a(e,d),le&&le.m(e,null),a(e,v),$&&$.m(e,null),a(e,g),z&&z.m(e,null),a(e,k),x&&x.m(e,null),a(e,I),fe&&fe.m(e,null),a(e,M),ae&&ae.m(e,null),a(e,E),se&&se.m(e,null),a(e,H),_e&&_e.m(e,null),a(e,S),oe&&oe.m(e,null),J=!0},p(ee,[ne]){ne&3&&(l=Wt(ee[1].ui.i,ee[0].i)),l?G?(G.p(ee,ne),ne&3&&Z(G,1)):(G=ho(ee),G.c(),Z(G,1),G.m(e,n)):G&&(mt(),ie(G,1,1,()=>{G=null}),pt()),ne&3&&(i=Wt(ee[1].ui.e,ee[0].om||ee[0].e>0)),i?K?(K.p(ee,ne),ne&3&&Z(K,1)):(K=vo(ee),K.c(),Z(K,1),K.m(e,s)):K&&(mt(),ie(K,1,1,()=>{K=null}),pt()),ne&3&&(o=Wt(ee[1].ui.v,ee[0].l1&&(ee[0].l1.u>100||ee[0].l2.u>100||ee[0].l3.u>100))),o?X?(X.p(ee,ne),ne&3&&Z(X,1)):(X=bo(ee),X.c(),Z(X,1),X.m(e,r)):X&&(mt(),ie(X,1,1,()=>{X=null}),pt()),ne&3&&(f=Wt(ee[1].ui.a,ee[0].l1&&(ee[0].l1.i>.01||ee[0].l2.i>.01||ee[0].l3.i>.01))),f?U?(U.p(ee,ne),ne&3&&Z(U,1)):(U=ko(ee),U.c(),Z(U,1),U.m(e,c)):U&&(mt(),ie(U,1,1,()=>{U=null}),pt()),ne&3&&(_=Wt(ee[1].ui.h,ee[0].l1&&(ee[0].l1.p>.01||ee[0].l2.p>.01||ee[0].l3.p>.01||ee[0].l1.q>.01||ee[0].l2.q>.01||ee[0].l3.q>.01))),_?Y?(Y.p(ee,ne),ne&3&&Z(Y,1)):(Y=Co(ee),Y.c(),Z(Y,1),Y.m(e,d)):Y&&(mt(),ie(Y,1,1,()=>{Y=null}),pt()),ne&3&&(m=Wt(ee[1].ui.f,ee[0].l1&&(ee[0].l1.f>.01||ee[0].l2.f>.01||ee[0].l3.f>.01))),m?le?(le.p(ee,ne),ne&3&&Z(le,1)):(le=Mo(ee),le.c(),Z(le,1),le.m(e,v)):le&&(mt(),ie(le,1,1,()=>{le=null}),pt()),ne&3&&(h=Wt(ee[1].ui.r,ee[0].ri>0||ee[0].re>0||ee[0].ric>0||ee[0].rec>0)),h?$?($.p(ee,ne),ne&3&&Z($,1)):($=Po(ee),$.c(),Z($,1),$.m(e,g)):$&&(mt(),ie($,1,1,()=>{$=null}),pt()),ne&3&&(w=Wt(ee[1].ui.c,ee[0].ea)),w?z?(z.p(ee,ne),ne&3&&Z(z,1)):(z=To(ee),z.c(),Z(z,1),z.m(e,k)):z&&(mt(),ie(z,1,1,()=>{z=null}),pt()),ne&3&&(A=Wt(ee[1].ui.t,ee[0].pr&&(ee[0].pr.startsWith("NO")||ee[0].pr.startsWith("10YNO")||ee[0].pr.startsWith("10Y1001A1001A4")))),A?x?(x.p(ee,ne),ne&3&&Z(x,1)):(x=Eo(ee),x.c(),Z(x,1),x.m(e,I)):x&&(mt(),ie(x,1,1,()=>{x=null}),pt()),ne&3&&(L=Wt(ee[1].ui.l,ee[0].hm==1)),L?fe?(fe.p(ee,ne),ne&3&&Z(fe,1)):(fe=qo(ee),fe.c(),Z(fe,1),fe.m(e,M)):fe&&(mt(),ie(fe,1,1,()=>{fe=null}),pt()),ne&3&&(O=Wt(ee[1].ui.p,ee[0].pe&&!Number.isNaN(ee[0].p))),O?ae?(ae.p(ee,ne),ne&3&&Z(ae,1)):(ae=Do(ee),ae.c(),Z(ae,1),ae.m(e,E)):ae&&(mt(),ie(ae,1,1,()=>{ae=null}),pt()),ne&10&&(F=Wt(ee[1].ui.d,ee[3])),F?se?(se.p(ee,ne),ne&10&&Z(se,1)):(se=Ao(ee),se.c(),Z(se,1),se.m(e,H)):se&&(mt(),ie(se,1,1,()=>{se=null}),pt()),ne&18&&(j=Wt(ee[1].ui.m,ee[4])),j?_e?(_e.p(ee,ne),ne&18&&Z(_e,1)):(_e=Lo(ee),_e.c(),Z(_e,1),_e.m(e,S)):_e&&(mt(),ie(_e,1,1,()=>{_e=null}),pt()),ne&35&&(y=Wt(ee[1].ui.s,ee[0].t&&ee[0].t!=-127&&ee[5].c>1)),y?oe?(oe.p(ee,ne),ne&35&&Z(oe,1)):(oe=Oo(ee),oe.c(),Z(oe,1),oe.m(e,null)):oe&&(mt(),ie(oe,1,1,()=>{oe=null}),pt())},i(ee){J||(Z(G),Z(K),Z(X),Z(U),Z(Y),Z(le),Z($),Z(z),Z(x),Z(fe),Z(ae),Z(se),Z(_e),Z(oe),J=!0)},o(ee){ie(G),ie(K),ie(X),ie(U),ie(Y),ie(le),ie($),ie(z),ie(x),ie(fe),ie(ae),ie(se),ie(_e),ie(oe),J=!1},d(ee){ee&&N(e),G&&G.d(),K&&K.d(),X&&X.d(),U&&U.d(),Y&&Y.d(),le&&le.d(),$&&$.d(),z&&z.d(),x&&x.d(),fe&&fe.d(),ae&&ae.d(),se&&se.d(),_e&&_e.d(),oe&&oe.d()}}}function Hc(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,{prices:s={}}=e,{dayPlot:o={}}=e,{monthPlot:r={}}=e,{temperatures:f={}}=e,{translations:c={}}=e,{tariffData:_={}}=e,d,m,v,h,g,w;return t.$$set=k=>{"data"in k&&l(0,n=k.data),"sysinfo"in k&&l(1,i=k.sysinfo),"prices"in k&&l(2,s=k.prices),"dayPlot"in k&&l(3,o=k.dayPlot),"monthPlot"in k&&l(4,r=k.monthPlot),"temperatures"in k&&l(5,f=k.temperatures),"translations"in k&&l(6,c=k.translations),"tariffData"in k&&l(7,_=k.tariffData)},t.$$.update=()=>{var k,A,I,L,M,O,E,F,H,j,S,y,J,G,K;t.$$.dirty&1793&&(l(11,d=rl((n==null?void 0:n.ic)*1e3,"Wh")),l(12,m=rl((n==null?void 0:n.ec)*1e3,"Wh")),((k=n==null?void 0:n.l1)==null?void 0:k.u)==0&&((A=n==null?void 0:n.l2)==null?void 0:A.u)==0&&((I=n==null?void 0:n.l3)==null?void 0:I.u)==0?l(8,h=l(9,g=l(10,w=l(13,v=!0)))):(l(8,h=((L=n==null?void 0:n.l1)==null?void 0:L.u)>0||((M=n==null?void 0:n.l1)==null?void 0:M.i)>0||((O=n==null?void 0:n.l1)==null?void 0:O.p)>0||((E=n==null?void 0:n.l1)==null?void 0:E.q)>0),l(9,g=((F=n==null?void 0:n.l2)==null?void 0:F.u)>0||((H=n==null?void 0:n.l2)==null?void 0:H.i)>0||((j=n==null?void 0:n.l2)==null?void 0:j.p)>0||((S=n==null?void 0:n.l2)==null?void 0:S.q)>0),l(10,w=((y=n==null?void 0:n.l3)==null?void 0:y.u)>0||((J=n==null?void 0:n.l3)==null?void 0:J.i)>0||((G=n==null?void 0:n.l3)==null?void 0:G.p)>0||((K=n==null?void 0:n.l3)==null?void 0:K.q)>0),l(13,v=h&&g&&w)))},[n,i,s,o,r,f,c,_,h,g,w,d,m,v]}class Wc extends Mt{constructor(e){super(),St(this,e,Hc,zc,Ct,{data:0,sysinfo:1,prices:2,dayPlot:3,monthPlot:4,temperatures:5,translations:6,tariffData:7})}}let Ui={};const Rn=al(Ui);async function Gc(){Ui=await(await fetch("configuration.json")).json(),Rn.set(Ui)}let Bi={};const Ou=al(Bi);async function Vc(){Bi=await(await fetch("priceconfig.json")).json(),Ou.set(Bi)}function Io(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Ro(t){let e,l,n;return{c(){e=p("option"),e.textContent="UART0",l=b(),n=p("option"),n.textContent="UART2",e.__value=3,V(e,e.__value),n.__value=113,V(n,n.__value)},m(i,s){P(i,e,s),P(i,l,s),P(i,n,s)},d(i){i&&(N(e),N(l),N(n))}}}function Fo(t){let e;return{c(){e=p("option"),e.textContent=`GPIO${t[4]}`,e.__value=t[4],V(e,e.__value)},m(l,n){P(l,e,n)},d(l){l&&N(e)}}}function Uo(t){let e,l=t[4]>1&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Fo(t);return{c(){l&&l.c(),e=yt()},m(n,i){l&&l.m(n,i),P(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Fo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){n&&N(e),l&&l.d(n)}}}function Kc(t){let e,l,n,i,s=t[0]=="esp8266"&&Ro(),o=it({length:t[1]+1}),r=[];for(let f=0;f{"chip"in s&&l(0,n=s.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=21);break}},[n,i]}class yi extends Mt{constructor(e){super(),St(this,e,Yc,Kc,Ct,{chip:0})}}function Bo(t){let e,l,n=t[1]&&yo(t);return{c(){e=p("div"),l=p("div"),n&&n.c(),u(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-80 flex items-center justify-center"),u(e,"class","z-50"),u(e,"aria-modal","true")},m(i,s){P(i,e,s),a(e,l),n&&n.m(l,null)},p(i,s){i[1]?n?n.p(i,s):(n=yo(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&N(e),n&&n.d()}}}function yo(t){let e,l;return{c(){e=p("div"),l=C(t[1]),u(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){P(n,e,i),a(e,l)},p(n,i){i&2&&q(l,n[1])},d(n){n&&N(e)}}}function Xc(t){let e,l=t[0]&&Bo(t);return{c(){l&&l.c(),e=yt()},m(n,i){l&&l.m(n,i),P(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Bo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Ve,o:Ve,d(n){n&&N(e),l&&l.d(n)}}}function Qc(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=s=>{"active"in s&&l(0,n=s.active),"message"in s&&l(1,i=s.message)},[n,i]}class cl extends Mt{constructor(e){super(),St(this,e,Qc,Xc,Ct,{active:0,message:1})}}function jo(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=p("option"),l=C("Europe/"),i=C(n),e.__value="Europe/"+t[1],V(e,e.__value)},m(s,o){P(s,e,o),a(e,l),a(e,i)},p:Ve,d(s){s&&N(e)}}}function Zc(t){let e,l,n,i=it(t[0]),s=[];for(let o=0;o>1&1,D=0;D0;T--)D[T]=D[T]?D[T-1]^M.EXPONENT[F._modN(M.LOG[D[T]]+R)]:D[T-1];D[0]=M.EXPONENT[F._modN(M.LOG[D[0]]+R)]}for(R=0;R<=B;R++)D[R]=M.LOG[D[R]]},_checkBadness:function(){var R,T,B,D,W,te=0,ue=this._badness,ce=this.buffer,me=this.width;for(W=0;Wme*me;)ve-=me*me,ke++;for(te+=ke*F.N4,D=0;D=ue-2&&(R=ue-2,W>9&&R--);var ce=R;if(W>9){for(te[ce+2]=0,te[ce+3]=0;ce--;)T=te[ce],te[ce+3]|=255&T<<4,te[ce+2]=T>>4;te[2]|=255&R<<4,te[1]=R>>4,te[0]=64|R>>12}else{for(te[ce+1]=0,te[ce+2]=0;ce--;)T=te[ce],te[ce+2]|=255&T<<4,te[ce+1]=T>>4;te[1]|=255&R<<4,te[0]=64|R>>4}for(ce=R+3-(W<10);ce=5&&(B+=F.N1+D[T]-5);for(T=3;TR||D[T-3]*3>=D[T]*4||D[T+3]*3>=D[T]*4)&&(B+=F.N3);return B},_finish:function(){this._stringBuffer=this.buffer.slice();var R,T,B=0,D=3e4;for(T=0;T<8&&(this._applyMask(T),R=this._checkBadness(),R>=1)D&1&&(W[te-1-T+te*8]=1,T<6?W[8+te*T]=1:W[8+te*(T+1)]=1);for(T=0;T<7;T++,D>>=1)D&1&&(W[8+te*(te-7+T)]=1,T?W[6-T+te*8]=1:W[7+te*8]=1)},_interleaveBlocks:function(){var R,T,B=this._dataBlock,D=this._ecc,W=this._eccBlock,te=0,ue=this._calculateMaxLength(),ce=this._neccBlock1,me=this._neccBlock2,pe=this._stringBuffer;for(R=0;R1)for(R=k.BLOCK[D],B=W-7;;){for(T=W-7;T>R-3&&(this._addAlignment(T,B),!(T6)for(R=E.BLOCK[te-7],T=17,B=0;B<6;B++)for(D=0;D<3;D++,T--)1&(T>11?te>>T-12:R>>T)?(W[5-B+ue*(2-D+ue-11)]=1,W[2-D+ue-11+ue*(5-B)]=1):(this._setMask(5-B,2-D+ue-11),this._setMask(2-D+ue-11,5-B))},_isMasked:function(R,T){var B=F._getMaskBit(R,T);return this._mask[B]===1},_pack:function(){var R,T,B,D=1,W=1,te=this.width,ue=te-1,ce=te-1,me=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(T=0;TT&&(B=R,R=T,T=B),B=T,B+=T*T,B>>=1,B+=R,B},_modN:function(R){for(;R>=255;)R-=255,R=(R>>8)+(R&255);return R},N1:3,N2:3,N3:40,N4:10}),H=F,j=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var R=this.element;R.width=R.height=this.qrious.size}}),S=j,y=d.extend(function(R,T,B,D){this.name=R,this.modifiable=!!T,this.defaultValue=B,this._valueTransformer=D},{transform:function(R){var T=this._valueTransformer;return typeof T=="function"?T(R,this):R}}),J=y,G=d.extend(null,{abs:function(R){return R!=null?Math.abs(R):null},hasOwn:function(R,T){return Object.prototype.hasOwnProperty.call(R,T)},noop:function(){},toUpperCase:function(R){return R!=null?R.toUpperCase():null}}),K=G,X=d.extend(function(R){this.options={},R.forEach(function(T){this.options[T.name]=T},this)},{exists:function(R){return this.options[R]!=null},get:function(R,T){return X._get(this.options[R],T)},getAll:function(R){var T,B=this.options,D={};for(T in B)K.hasOwn(B,T)&&(D[T]=X._get(B[T],R));return D},init:function(R,T,B){typeof B!="function"&&(B=K.noop);var D,W;for(D in this.options)K.hasOwn(this.options,D)&&(W=this.options[D],X._set(W,W.defaultValue,T),X._createAccessor(W,T,B));this._setAll(R,T,!0)},set:function(R,T,B){return this._set(R,T,B)},setAll:function(R,T){return this._setAll(R,T)},_set:function(R,T,B,D){var W=this.options[R];if(!W)throw new Error("Invalid option: "+R);if(!W.modifiable&&!D)throw new Error("Option cannot be modified: "+R);return X._set(W,T,B)},_setAll:function(R,T,B){if(!R)return!1;var D,W=!1;for(D in R)K.hasOwn(R,D)&&this._set(D,R[D],T,B)&&(W=!0);return W}},{_createAccessor:function(R,T,B){var D={get:function(){return X._get(R,T)}};R.modifiable&&(D.set=function(W){X._set(R,W,T)&&B(W,R)}),Object.defineProperty(T,R.name,D)},_get:function(R,T){return T["_"+R.name]},_set:function(R,T,B){var D="_"+R.name,W=B[D],te=R.transform(T??R.defaultValue);return B[D]=te,te!==W}}),U=X,Y=d.extend(function(){this._services={}},{getService:function(R){var T=this._services[R];if(!T)throw new Error("Service is not being managed with name: "+R);return T},setService:function(R,T){if(this._services[R])throw new Error("Service is already managed with name: "+R);T&&(this._services[R]=T)}}),le=Y,$=new U([new J("background",!0,"white"),new J("backgroundAlpha",!0,1,K.abs),new J("element"),new J("foreground",!0,"black"),new J("foregroundAlpha",!0,1,K.abs),new J("level",!0,"L",K.toUpperCase),new J("mime",!0,"image/png"),new J("padding",!0,null,K.abs),new J("size",!0,100,K.abs),new J("value",!0,"")]),z=new le,x=d.extend(function(R){$.init(R,this,this.update.bind(this));var T=$.get("element",this),B=z.getService("element"),D=T&&B.isCanvas(T)?T:B.createCanvas(),W=T&&B.isImage(T)?T:B.createImage();this._canvasRenderer=new g(this,D,!0),this._imageRenderer=new S(this,W,W===T),this.update()},{get:function(){return $.getAll(this)},set:function(R){$.setAll(R,this)&&this.update()},toDataURL:function(R){return this.canvas.toDataURL(R||this.mime)},update:function(){var R=new H({level:this.level,value:this.value});this._canvasRenderer.render(R),this._imageRenderer.render(R)}},{use:function(R){z.setService(R.getName(),R)}});Object.defineProperties(x.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var fe=x,ae=fe,se=d.extend({getName:function(){}}),_e=se,oe=_e.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(R){},isImage:function(R){}}),ee=oe,ne=ee.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(R){return R instanceof HTMLCanvasElement},isImage:function(R){return R instanceof HTMLImageElement}}),be=ne;ae.use(new be);var we=ae;return we})})(Iu);var n0=Iu.exports;const i0=l0(n0);function s0(t){let e,l;return{c(){e=p("img"),Il(e.src,l=t[2])||u(e,"src",l),u(e,"alt",t[0]),u(e,"class",t[1])},m(n,i){P(n,e,i)},p(n,[i]){i&4&&!Il(e.src,l=n[2])&&u(e,"src",l),i&1&&u(e,"alt",n[0]),i&2&&u(e,"class",n[1])},i:Ve,o:Ve,d(n){n&&N(e)}}}function o0(t,e,l){let{errorCorrection:n="L"}=e,{background:i="#fff"}=e,{color:s="#000"}=e,{size:o="200"}=e,{value:r=""}=e,{padding:f=0}=e,{className:c="qrcode"}=e,_="",d;function m(){d.set({background:i,foreground:s,level:n,padding:f,size:o,value:r}),l(2,_=d.toDataURL("image/jpeg"))}function v(){return _}return Gf(()=>{l(9,d=new i0),r&&m()}),t.$$set=h=>{"errorCorrection"in h&&l(3,n=h.errorCorrection),"background"in h&&l(4,i=h.background),"color"in h&&l(5,s=h.color),"size"in h&&l(6,o=h.size),"value"in h&&l(0,r=h.value),"padding"in h&&l(7,f=h.padding),"className"in h&&l(1,c=h.className)},t.$$.update=()=>{t.$$.dirty&513&&r&&d&&m()},[r,c,_,n,i,s,o,f,v,d]}class a0 extends Mt{constructor(e){super(),St(this,e,o0,s0,Ct,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1,getImage:8})}get getImage(){return this.$$.ctx[8]}}function Ho(t,e,l){const n=t.slice();return n[126]=e[l],n}function Wo(t,e,l){const n=t.slice();return n[129]=e[l],n[130]=e,n[131]=l,n}function Go(t,e,l){const n=t.slice();return n[132]=e[l],n[133]=e,n[134]=l,n}function Vo(t,e,l){const n=t.slice();return n[135]=e[l],n[137]=l,n}function f0(t,e,l){const n=t.slice();return n[138]=e[l],n}function u0(t,e,l){const n=t.slice();return n[141]=e[l],n}function Ko(t){var et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae,Q,Ce,Kt,fl,ml,Jt,pl,dl,Cl,Sl,Ml,Rl,Fl,Ul,We;let e,l,n=(((ze=(et=t[3].conf)==null?void 0:et.general)==null?void 0:ze.title)??"General")+"",i,s,o,r,f,c,_,d,m,v=(((el=(xt=t[3].conf)==null?void 0:xt.general)==null?void 0:el.hostname)??"Hostname")+"",h,g,w,k,A,I,L=(((ll=(tl=t[3].conf)==null?void 0:tl.general)==null?void 0:ll.timezone)??"Time zone")+"",M,O,E,F,H,j,S,y,J,G,K,X=(((il=(nl=t[3].conf)==null?void 0:nl.price)==null?void 0:il.region)??"Price region")+"",U,Y,le,$,z,x,fe,ae,se,_e,oe,ee,ne,be,we,R,T,B,D,W,te,ue,ce,me,pe,ke,ve,De,Ee,Le,Oe,rt,dt,tt,Ze=(((ol=(sl=t[3].conf)==null?void 0:sl.price)==null?void 0:ol.currency)??"Currency")+"",Be,at,Nt,bt,ft,st,ut,Rt,Ke,Ie,je,$e,de=(((Q=(Ae=t[3].conf)==null?void 0:Ae.price)==null?void 0:Q.enabled)??"Enabled")+"",qe,Ge,ge,Pe,nt=(((fl=(Kt=(Ce=t[3].conf)==null?void 0:Ce.general)==null?void 0:Kt.security)==null?void 0:fl.title)??"Security")+"",He,At,ht,Re,kt,ct=(((pl=(Jt=(ml=t[3].conf)==null?void 0:ml.general)==null?void 0:Jt.security)==null?void 0:pl.none)??"None")+"",vt,xe,Lt=(((Sl=(Cl=(dl=t[3].conf)==null?void 0:dl.general)==null?void 0:Cl.security)==null?void 0:Sl.conf)??"Conf")+"",Gt,wt,_t=(((Fl=(Rl=(Ml=t[3].conf)==null?void 0:Ml.general)==null?void 0:Rl.security)==null?void 0:Fl.all)??"All")+"",Ht,Qt,Ut,Bt,Yt=(((We=(Ul=t[3].conf)==null?void 0:Ul.general)==null?void 0:We.context)??"Context")+"",$t,Vt,Ft,Fe,Je,Ue,Tt,Ot;H=new $c({});let Qe=!t[7].p.t&&Yo(),lt=it(["NOK","SEK","DKK","EUR","CHF"]),Pt=[];for(let Te=0;Te<5;Te+=1)Pt[Te]=r0(u0(t,lt,Te));ut=new hl({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[c0]},$$scope:{ctx:t}}});let ot=t[7].p.e&&t[0].chip!="esp8266"&&Xo(t),he=t[7].g.s>0&&Qo(t);return{c(){var Te,Et;e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("a"),o.textContent="ⓘ",r=b(),f=p("input"),c=b(),_=p("div"),d=p("div"),m=p("div"),h=C(v),g=p("br"),w=b(),k=p("input"),A=b(),I=p("div"),M=C(L),O=p("br"),E=b(),F=p("select"),Ne(H.$$.fragment),j=b(),S=p("input"),y=b(),J=p("div"),G=p("div"),K=p("div"),U=C(X),Y=p("br"),le=b(),$=p("select"),z=p("optgroup"),Qe&&Qe.c(),x=p("option"),x.textContent="NO1",fe=p("option"),fe.textContent="NO2",ae=p("option"),ae.textContent="NO3",se=p("option"),se.textContent="NO4",_e=p("option"),_e.textContent="NO5",oe=p("optgroup"),ee=p("option"),ee.textContent="SE1",ne=p("option"),ne.textContent="SE2",be=p("option"),be.textContent="SE3",we=p("option"),we.textContent="SE4",R=p("optgroup"),T=p("option"),T.textContent="DK1",B=p("option"),B.textContent="DK2",D=p("option"),D.textContent="Austria",W=p("option"),W.textContent="Belgium",te=p("option"),te.textContent="Czech Republic",ue=p("option"),ue.textContent="Estonia",ce=p("option"),ce.textContent="Finland",me=p("option"),me.textContent="France",pe=p("option"),pe.textContent="Germany",ke=p("option"),ke.textContent="Great Britain",ve=p("option"),ve.textContent="Latvia",De=p("option"),De.textContent="Lithuania",Ee=p("option"),Ee.textContent="Netherland",Le=p("option"),Le.textContent="Poland",Oe=p("option"),Oe.textContent="Slovenia",rt=p("option"),rt.textContent="Switzerland",dt=b(),tt=p("div"),Be=C(Ze),at=p("br"),Nt=b(),bt=p("select");for(let ul=0;ul<5;ul+=1)Pt[ul].c();ft=b(),st=p("div"),Ne(ut.$$.fragment),Rt=b(),Ke=p("div"),Ie=p("label"),je=p("input"),$e=b(),qe=C(de),Ge=b(),ot&&ot.c(),ge=b(),Pe=p("div"),He=C(nt),At=p("br"),ht=b(),Re=p("select"),kt=p("option"),vt=C(ct),xe=p("option"),Gt=C(Lt),wt=p("option"),Ht=C(_t),Qt=b(),he&&he.c(),Ut=b(),Bt=p("div"),$t=C(Yt),Vt=p("br"),Ft=b(),Fe=p("input"),u(l,"class","text-sm"),u(o,"href",vl("General-configuration")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","g"),f.value="true",u(k,"name","gh"),u(k,"type","text"),u(k,"class","in-f w-full"),u(k,"pattern",Gn),u(F,"name","gt"),u(F,"class","in-l w-full"),t[7].g.t===void 0&&qt(()=>t[26].call(F)),u(d,"class","flex"),u(_,"class","my-1"),u(S,"type","hidden"),u(S,"name","p"),S.value="true",x.__value="10YNO-1--------2",V(x,x.__value),fe.__value="10YNO-2--------T",V(fe,fe.__value),ae.__value="10YNO-3--------J",V(ae,ae.__value),se.__value="10YNO-4--------9",V(se,se.__value),_e.__value="10Y1001A1001A48H",V(_e,_e.__value),u(z,"label","Norway"),ee.__value="10Y1001A1001A44P",V(ee,ee.__value),ne.__value="10Y1001A1001A45N",V(ne,ne.__value),be.__value="10Y1001A1001A46L",V(be,be.__value),we.__value="10Y1001A1001A47J",V(we,we.__value),u(oe,"label","Sweden"),T.__value="10YDK-1--------W",V(T,T.__value),B.__value="10YDK-2--------M",V(B,B.__value),u(R,"label","Denmark"),D.__value="10YAT-APG------L",V(D,D.__value),W.__value="10YBE----------2",V(W,W.__value),te.__value="10YCZ-CEPS-----N",V(te,te.__value),ue.__value="10Y1001A1001A39I",V(ue,ue.__value),ce.__value="10YFI-1--------U",V(ce,ce.__value),me.__value="10YFR-RTE------C",V(me,me.__value),pe.__value="10Y1001A1001A83F",V(pe,pe.__value),ke.__value="10YGB----------A",V(ke,ke.__value),ve.__value="10YLV-1001A00074",V(ve,ve.__value),De.__value="10YLT-1001A0008Q",V(De,De.__value),Ee.__value="10YNL----------L",V(Ee,Ee.__value),Le.__value="10YPL-AREA-----S",V(Le,Le.__value),Oe.__value="10YSI-ELES-----O",V(Oe,Oe.__value),rt.__value="10YCH-SWISSGRIDZ",V(rt,rt.__value),u($,"name","pr"),u($,"class","in-f w-full"),t[7].p.r===void 0&&qt(()=>t[27].call($)),u(K,"class","w-full"),u(bt,"name","pc"),u(bt,"class","in-l"),t[7].p.c===void 0&&qt(()=>t[28].call(bt)),u(G,"class","flex"),u(J,"class","my-1"),u(st,"class","my-1"),u(je,"type","checkbox"),u(je,"name","pe"),je.__value="true",V(je,je.__value),u(je,"class","rounded mb-1"),u(Ke,"class","my-1"),kt.__value=0,V(kt,kt.__value),xe.__value=1,V(xe,xe.__value),wt.__value=2,V(wt,wt.__value),u(Re,"name","gs"),u(Re,"class","in-s"),t[7].g.s===void 0&&qt(()=>t[31].call(Re)),u(Pe,"class","my-1"),u(Fe,"name","gc"),u(Fe,"type","text"),u(Fe,"pattern",Gn),u(Fe,"placeholder",Je=((Et=(Te=t[3].conf)==null?void 0:Te.general)==null?void 0:Et.context_placeholder)??"/"),u(Fe,"class","in-s"),u(Fe,"maxlength","36"),u(Bt,"class","my-1"),u(e,"class","cnt")},m(Te,Et){P(Te,e,Et),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,d),a(d,m),a(m,h),a(m,g),a(m,w),a(m,k),V(k,t[7].g.h),a(d,A),a(d,I),a(I,M),a(I,O),a(I,E),a(I,F),Se(H,F,null),Xe(F,t[7].g.t,!0),a(e,j),a(e,S),a(e,y),a(e,J),a(J,G),a(G,K),a(K,U),a(K,Y),a(K,le),a(K,$),a($,z),Qe&&Qe.m(z,null),a(z,x),a(z,fe),a(z,ae),a(z,se),a(z,_e),a($,oe),a(oe,ee),a(oe,ne),a(oe,be),a(oe,we),a($,R),a(R,T),a(R,B),a($,D),a($,W),a($,te),a($,ue),a($,ce),a($,me),a($,pe),a($,ke),a($,ve),a($,De),a($,Ee),a($,Le),a($,Oe),a($,rt),Xe($,t[7].p.r,!0),a(G,dt),a(G,tt),a(tt,Be),a(tt,at),a(tt,Nt),a(tt,bt);for(let ul=0;ul<5;ul+=1)Pt[ul]&&Pt[ul].m(bt,null);Xe(bt,t[7].p.c,!0),a(e,ft),a(e,st),Se(ut,st,null),a(e,Rt),a(e,Ke),a(Ke,Ie),a(Ie,je),je.checked=t[7].p.e,a(Ie,$e),a(Ie,qe),a(Ke,Ge),ot&&ot.m(Ke,null),a(e,ge),a(e,Pe),a(Pe,He),a(Pe,At),a(Pe,ht),a(Pe,Re),a(Re,kt),a(kt,vt),a(Re,xe),a(xe,Gt),a(Re,wt),a(wt,Ht),Xe(Re,t[7].g.s,!0),a(e,Qt),he&&he.m(e,null),a(e,Ut),a(e,Bt),a(Bt,$t),a(Bt,Vt),a(Bt,Ft),a(Bt,Fe),V(Fe,t[7].g.c),Ue=!0,Tt||(Ot=[re(k,"input",t[25]),re(F,"change",t[26]),re($,"change",t[27]),re($,"change",t[22]),re(bt,"change",t[28]),re(je,"change",t[29]),re(Re,"change",t[31]),re(Fe,"input",t[34])],Tt=!0)},p(Te,Et){var Bl,yl,jl,zl,Hl,Wl,Gl,Vl,Kl,Yl,Xl,Ql,Zl,Jl,$l,xl,en,tn,ln,Sn,Mn,Nn,Pn,Tn,En,qn,Dn,An;(!Ue||Et[0]&8)&&n!==(n=(((yl=(Bl=Te[3].conf)==null?void 0:Bl.general)==null?void 0:yl.title)??"General")+"")&&q(i,n),(!Ue||Et[0]&8)&&v!==(v=(((zl=(jl=Te[3].conf)==null?void 0:jl.general)==null?void 0:zl.hostname)??"Hostname")+"")&&q(h,v),Et[0]&128&&k.value!==Te[7].g.h&&V(k,Te[7].g.h),(!Ue||Et[0]&8)&&L!==(L=(((Wl=(Hl=Te[3].conf)==null?void 0:Hl.general)==null?void 0:Wl.timezone)??"Time zone")+"")&&q(M,L),Et[0]&128&&Xe(F,Te[7].g.t),(!Ue||Et[0]&8)&&X!==(X=(((Vl=(Gl=Te[3].conf)==null?void 0:Gl.price)==null?void 0:Vl.region)??"Price region")+"")&&q(U,X),Te[7].p.t?Qe&&(Qe.d(1),Qe=null):Qe||(Qe=Yo(),Qe.c(),Qe.m(z,x)),Et[0]&128&&Xe($,Te[7].p.r),(!Ue||Et[0]&8)&&Ze!==(Ze=(((Yl=(Kl=Te[3].conf)==null?void 0:Kl.price)==null?void 0:Yl.currency)??"Currency")+"")&&q(Be,Ze),Et[0]&128&&Xe(bt,Te[7].p.c);const ul={};Et[0]&8|Et[4]&1048576&&(ul.$$scope={dirty:Et,ctx:Te}),ut.$set(ul),Et[0]&128&&(je.checked=Te[7].p.e),(!Ue||Et[0]&8)&&de!==(de=(((Ql=(Xl=Te[3].conf)==null?void 0:Xl.price)==null?void 0:Ql.enabled)??"Enabled")+"")&&q(qe,de),Te[7].p.e&&Te[0].chip!="esp8266"?ot?ot.p(Te,Et):(ot=Xo(Te),ot.c(),ot.m(Ke,null)):ot&&(ot.d(1),ot=null),(!Ue||Et[0]&8)&&nt!==(nt=((($l=(Jl=(Zl=Te[3].conf)==null?void 0:Zl.general)==null?void 0:Jl.security)==null?void 0:$l.title)??"Security")+"")&&q(He,nt),(!Ue||Et[0]&8)&&ct!==(ct=(((tn=(en=(xl=Te[3].conf)==null?void 0:xl.general)==null?void 0:en.security)==null?void 0:tn.none)??"None")+"")&&q(vt,ct),(!Ue||Et[0]&8)&&Lt!==(Lt=(((Mn=(Sn=(ln=Te[3].conf)==null?void 0:ln.general)==null?void 0:Sn.security)==null?void 0:Mn.conf)??"Conf")+"")&&q(Gt,Lt),(!Ue||Et[0]&8)&&_t!==(_t=(((Tn=(Pn=(Nn=Te[3].conf)==null?void 0:Nn.general)==null?void 0:Pn.security)==null?void 0:Tn.all)??"All")+"")&&q(Ht,_t),Et[0]&128&&Xe(Re,Te[7].g.s),Te[7].g.s>0?he?he.p(Te,Et):(he=Qo(Te),he.c(),he.m(e,Ut)):he&&(he.d(1),he=null),(!Ue||Et[0]&8)&&Yt!==(Yt=(((qn=(En=Te[3].conf)==null?void 0:En.general)==null?void 0:qn.context)??"Context")+"")&&q($t,Yt),(!Ue||Et[0]&8&&Je!==(Je=((An=(Dn=Te[3].conf)==null?void 0:Dn.general)==null?void 0:An.context_placeholder)??"/"))&&u(Fe,"placeholder",Je),Et[0]&128&&Fe.value!==Te[7].g.c&&V(Fe,Te[7].g.c)},i(Te){Ue||(Z(H.$$.fragment,Te),Z(ut.$$.fragment,Te),Ue=!0)},o(Te){ie(H.$$.fragment,Te),ie(ut.$$.fragment,Te),Ue=!1},d(Te){Te&&N(e),Me(H),Qe&&Qe.d(),Xt(Pt,Te),Me(ut),ot&&ot.d(),he&&he.d(),Tt=!1,Dt(Ot)}}}function Yo(t){let e,l,n,i,s;return{c(){e=p("option"),e.textContent="NO1 with support",l=p("option"),l.textContent="NO2 with support",n=p("option"),n.textContent="NO3 with support",i=p("option"),i.textContent="NO4 with support",s=p("option"),s.textContent="NO5 with support",e.__value="NO1S",V(e,e.__value),l.__value="NO2S",V(l,l.__value),n.__value="NO3S",V(n,n.__value),i.__value="NO4S",V(i,i.__value),s.__value="NO5S",V(s,s.__value)},m(o,r){P(o,e,r),P(o,l,r),P(o,n,r),P(o,i,r),P(o,s,r)},d(o){o&&(N(e),N(l),N(n),N(i),N(s))}}}function r0(t){let e;return{c(){e=p("option"),e.textContent=`${t[141]}`,e.__value=t[141],V(e,e.__value)},m(l,n){P(l,e,n)},p:Ve,d(l){l&&N(e)}}}function c0(t){var n,i;let e=(((i=(n=t[3].conf)==null?void 0:n.price)==null?void 0:i.conf)??"Configure")+"",l;return{c(){l=C(e)},m(s,o){P(s,l,o)},p(s,o){var r,f;o[0]&8&&e!==(e=(((f=(r=s[3].conf)==null?void 0:r.price)==null?void 0:f.conf)??"Configure")+"")&&q(l,e)},d(s){s&&N(l)}}}function Xo(t){let e,l,n,i,s;return{c(){var o,r;e=p("br"),l=p("input"),u(l,"name","pt"),u(l,"type","text"),u(l,"class","in-s"),u(l,"placeholder",n=((r=(o=t[3].conf)==null?void 0:o.price)==null?void 0:r.api_key_placeholder)??""),u(l,"pattern",Gn)},m(o,r){P(o,e,r),P(o,l,r),V(l,t[7].p.t),i||(s=re(l,"input",t[30]),i=!0)},p(o,r){var f,c;r[0]&8&&n!==(n=((c=(f=o[3].conf)==null?void 0:f.price)==null?void 0:c.api_key_placeholder)??"")&&u(l,"placeholder",n),r[0]&128&&l.value!==o[7].p.t&&V(l,o[7].p.t)},d(o){o&&(N(e),N(l)),i=!1,s()}}}function Qo(t){var w,k,A,I,L,M;let e,l=(((A=(k=(w=t[3].conf)==null?void 0:w.general)==null?void 0:k.security)==null?void 0:A.username)??"Username")+"",n,i,s,o,r,f,c=(((M=(L=(I=t[3].conf)==null?void 0:I.general)==null?void 0:L.security)==null?void 0:M.password)??"Password")+"",_,d,m,v,h,g;return{c(){e=p("div"),n=C(l),i=p("br"),s=b(),o=p("input"),r=b(),f=p("div"),_=C(c),d=p("br"),m=b(),v=p("input"),u(o,"name","gu"),u(o,"type","text"),u(o,"class","in-s"),u(o,"maxlength","36"),u(o,"pattern",Ol),u(e,"class","my-1"),u(v,"name","gp"),u(v,"type","password"),u(v,"class","in-s"),u(v,"maxlength","36"),u(v,"pattern",Ol),u(f,"class","my-1")},m(O,E){P(O,e,E),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].g.u),P(O,r,E),P(O,f,E),a(f,_),a(f,d),a(f,m),a(f,v),V(v,t[7].g.p),h||(g=[re(o,"input",t[32]),re(v,"input",t[33])],h=!0)},p(O,E){var F,H,j,S,y,J;E[0]&8&&l!==(l=(((j=(H=(F=O[3].conf)==null?void 0:F.general)==null?void 0:H.security)==null?void 0:j.username)??"Username")+"")&&q(n,l),E[0]&128&&o.value!==O[7].g.u&&V(o,O[7].g.u),E[0]&8&&c!==(c=(((J=(y=(S=O[3].conf)==null?void 0:S.general)==null?void 0:y.security)==null?void 0:J.password)??"Password")+"")&&q(_,c),E[0]&128&&v.value!==O[7].g.p&&V(v,O[7].g.p)},d(O){O&&(N(e),N(r),N(f)),h=!1,Dt(g)}}}function Zo(t){var ge,Pe,nt,He,At,ht,Re,kt,ct,vt,xe,Lt,Gt,wt,_t,Ht,Qt,Ut,Bt,Yt,$t,Vt,Ft;let e,l,n=(((Pe=(ge=t[3].conf)==null?void 0:ge.meter)==null?void 0:Pe.title)??"Meter")+"",i,s,o,r,f,c,_,d,m,v=(((At=(He=(nt=t[3].conf)==null?void 0:nt.meter)==null?void 0:He.comm)==null?void 0:At.title)??"Communication")+"",h,g,w,k,A,I=(((kt=(Re=(ht=t[3].conf)==null?void 0:ht.meter)==null?void 0:Re.comm)==null?void 0:kt.passive)??"Passive")+"",L,M,O=(((xe=(vt=(ct=t[3].conf)==null?void 0:ct.meter)==null?void 0:vt.comm)==null?void 0:xe.pulse)??"Pulse")+"",E,F=(Gt=(Lt=t[0])==null?void 0:Lt.features)==null?void 0:Gt.includes("kmp"),H,j,S,y=(((wt=t[3].common)==null?void 0:wt.voltage)??"Voltage")+"",J,G,K,X,U,Y,le,$,z,x=(((Ht=(_t=t[3].conf)==null?void 0:_t.meter)==null?void 0:Ht.fuse)??"Main fuse")+"",fe,ae,se,_e,oe,ee,ne,be,we,R=(((Ut=(Qt=t[3].conf)==null?void 0:Qt.meter)==null?void 0:Ut.prod)??"Production")+"",T,B,D,W,te,ue,ce,me,pe,ke,ve,De,Ee,Le,Oe=(((Yt=(Bt=t[3].conf)==null?void 0:Bt.meter)==null?void 0:Yt.encrypted)??"Encrypted")+"",rt,dt,tt,Ze,Be,at,Nt,bt=(((Ft=(Vt=($t=t[3].conf)==null?void 0:$t.meter)==null?void 0:Vt.multipliers)==null?void 0:Ft.title)??"Multipliers")+"",ft,st,ut,Rt,Ke=F&&Jo();function Ie(Fe,Je){return Fe[7].m.a===2?m0:_0}let je=Ie(t),$e=je(t),de=t[7].m.e.e&&$o(t),qe=t[7].m.e.e&&xo(t),Ge=t[7].m.m.e&&ea(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("a"),o.textContent="ⓘ",r=b(),f=p("input"),c=b(),_=p("input"),d=b(),m=p("div"),h=C(v),g=p("br"),w=b(),k=p("select"),A=p("option"),L=C(I),M=p("option"),E=C(O),Ke&&Ke.c(),H=b(),$e.c(),j=b(),S=p("div"),J=C(y),G=p("br"),K=b(),X=p("select"),U=p("option"),U.textContent="400V (TN)",Y=p("option"),Y.textContent="230V (IT/TT)",le=b(),$=p("div"),z=p("div"),fe=C(x),ae=p("br"),se=b(),_e=p("label"),oe=p("input"),ee=b(),ne=p("span"),ne.textContent="A",be=b(),we=p("div"),T=C(R),B=p("br"),D=b(),W=p("label"),te=p("input"),ue=b(),ce=p("span"),ce.textContent="kWp",me=b(),pe=p("div"),pe.innerHTML="",ke=b(),ve=p("div"),De=p("label"),Ee=p("input"),Le=b(),rt=C(Oe),dt=b(),de&&de.c(),tt=b(),qe&&qe.c(),Ze=b(),Be=p("label"),at=p("input"),Nt=b(),ft=C(bt),st=b(),Ge&&Ge.c(),u(l,"class","text-sm"),u(o,"href",vl("Meter-configuration")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","m"),f.value="true",u(_,"type","hidden"),u(_,"name","mo"),_.value="1",A.__value=0,V(A,A.__value),M.__value=2,V(M,M.__value),u(k,"name","ma"),u(k,"class","in-s"),t[7].m.a===void 0&&qt(()=>t[35].call(k)),u(m,"class","my-1"),U.__value=2,V(U,U.__value),Y.__value=1,V(Y,Y.__value),u(X,"name","md"),u(X,"class","in-s"),t[7].m.d===void 0&&qt(()=>t[41].call(X)),u(S,"class","my-1"),u(oe,"name","mf"),u(oe,"type","number"),u(oe,"min","5"),u(oe,"max","65535"),u(oe,"class","in-f tr w-full"),u(ne,"class","in-post"),u(_e,"class","flex"),u(z,"class","mx-1"),u(te,"name","mr"),u(te,"type","number"),u(te,"min","0"),u(te,"max","65535"),u(te,"class","in-f tr w-full"),u(ce,"class","in-post"),u(W,"class","flex"),u(we,"class","mx-1"),u($,"class","my-1 flex"),u(pe,"class","my-1"),u(Ee,"type","checkbox"),u(Ee,"name","me"),Ee.__value="true",V(Ee,Ee.__value),u(Ee,"class","rounded mb-1"),u(ve,"class","my-1"),u(at,"type","checkbox"),u(at,"name","mm"),at.__value="true",V(at,at.__value),u(at,"class","rounded mb-1"),u(e,"class","cnt")},m(Fe,Je){P(Fe,e,Je),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(e,d),a(e,m),a(m,h),a(m,g),a(m,w),a(m,k),a(k,A),a(A,L),a(k,M),a(M,E),Ke&&Ke.m(k,null),Xe(k,t[7].m.a,!0),a(e,H),$e.m(e,null),a(e,j),a(e,S),a(S,J),a(S,G),a(S,K),a(S,X),a(X,U),a(X,Y),Xe(X,t[7].m.d,!0),a(e,le),a(e,$),a($,z),a(z,fe),a(z,ae),a(z,se),a(z,_e),a(_e,oe),V(oe,t[7].m.f),a(_e,ee),a(_e,ne),a($,be),a($,we),a(we,T),a(we,B),a(we,D),a(we,W),a(W,te),V(te,t[7].m.r),a(W,ue),a(W,ce),a(e,me),a(e,pe),a(e,ke),a(e,ve),a(ve,De),a(De,Ee),Ee.checked=t[7].m.e.e,a(De,Le),a(De,rt),a(ve,dt),de&&de.m(ve,null),a(e,tt),qe&&qe.m(e,null),a(e,Ze),a(e,Be),a(Be,at),at.checked=t[7].m.m.e,a(Be,Nt),a(Be,ft),a(e,st),Ge&&Ge.m(e,null),ut||(Rt=[re(k,"change",t[35]),re(X,"change",t[41]),re(oe,"input",t[42]),re(te,"input",t[43]),re(Ee,"change",t[44]),re(at,"change",t[47])],ut=!0)},p(Fe,Je){var Ue,Tt,Ot,Qe,lt,Pt,ot,he,et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae,Q,Ce,Kt,fl;Je[0]&8&&n!==(n=(((Tt=(Ue=Fe[3].conf)==null?void 0:Ue.meter)==null?void 0:Tt.title)??"Meter")+"")&&q(i,n),Je[0]&8&&v!==(v=(((lt=(Qe=(Ot=Fe[3].conf)==null?void 0:Ot.meter)==null?void 0:Qe.comm)==null?void 0:lt.title)??"Communication")+"")&&q(h,v),Je[0]&8&&I!==(I=(((he=(ot=(Pt=Fe[3].conf)==null?void 0:Pt.meter)==null?void 0:ot.comm)==null?void 0:he.passive)??"Passive")+"")&&q(L,I),Je[0]&8&&O!==(O=(((xt=(ze=(et=Fe[3].conf)==null?void 0:et.meter)==null?void 0:ze.comm)==null?void 0:xt.pulse)??"Pulse")+"")&&q(E,O),Je[0]&1&&(F=(tl=(el=Fe[0])==null?void 0:el.features)==null?void 0:tl.includes("kmp")),F?Ke||(Ke=Jo(),Ke.c(),Ke.m(k,null)):Ke&&(Ke.d(1),Ke=null),Je[0]&128&&Xe(k,Fe[7].m.a),je===(je=Ie(Fe))&&$e?$e.p(Fe,Je):($e.d(1),$e=je(Fe),$e&&($e.c(),$e.m(e,j))),Je[0]&8&&y!==(y=(((ll=Fe[3].common)==null?void 0:ll.voltage)??"Voltage")+"")&&q(J,y),Je[0]&128&&Xe(X,Fe[7].m.d),Je[0]&8&&x!==(x=(((il=(nl=Fe[3].conf)==null?void 0:nl.meter)==null?void 0:il.fuse)??"Main fuse")+"")&&q(fe,x),Je[0]&128&&ye(oe.value)!==Fe[7].m.f&&V(oe,Fe[7].m.f),Je[0]&8&&R!==(R=(((ol=(sl=Fe[3].conf)==null?void 0:sl.meter)==null?void 0:ol.prod)??"Production")+"")&&q(T,R),Je[0]&128&&ye(te.value)!==Fe[7].m.r&&V(te,Fe[7].m.r),Je[0]&128&&(Ee.checked=Fe[7].m.e.e),Je[0]&8&&Oe!==(Oe=(((Q=(Ae=Fe[3].conf)==null?void 0:Ae.meter)==null?void 0:Q.encrypted)??"Encrypted")+"")&&q(rt,Oe),Fe[7].m.e.e?de?de.p(Fe,Je):(de=$o(Fe),de.c(),de.m(ve,null)):de&&(de.d(1),de=null),Fe[7].m.e.e?qe?qe.p(Fe,Je):(qe=xo(Fe),qe.c(),qe.m(e,Ze)):qe&&(qe.d(1),qe=null),Je[0]&128&&(at.checked=Fe[7].m.m.e),Je[0]&8&&bt!==(bt=(((fl=(Kt=(Ce=Fe[3].conf)==null?void 0:Ce.meter)==null?void 0:Kt.multipliers)==null?void 0:fl.title)??"Multipliers")+"")&&q(ft,bt),Fe[7].m.m.e?Ge?Ge.p(Fe,Je):(Ge=ea(Fe),Ge.c(),Ge.m(e,null)):Ge&&(Ge.d(1),Ge=null)},d(Fe){Fe&&N(e),Ke&&Ke.d(),$e.d(),de&&de.d(),qe&&qe.d(),Ge&&Ge.d(),ut=!1,Dt(Rt)}}}function Jo(t){let e;return{c(){e=p("option"),e.textContent="KMP",e.__value=9,V(e,e.__value)},m(l,n){P(l,e,n)},d(l){l&&N(e)}}}function _0(t){var fe,ae,se,_e,oe,ee;let e,l,n=(((ae=(fe=t[3].conf)==null?void 0:fe.meter)==null?void 0:ae.buffer)??"Buffer size")+"",i,s,o,r=(((_e=(se=t[3].conf)==null?void 0:se.meter)==null?void 0:_e.serial)??"Serial conf.")+"",f,c,_,d,m,v=(((ee=(oe=t[3].conf)==null?void 0:oe.meter)==null?void 0:ee.inverted)??"inverted")+"",h,g,w,k,A,I,L,M,O,E,F,H,j,S,y,J,G,K,X,U,Y,le,$,z=it([3,12,24,48,96,192,384,576,1152]),x=[];for(let ne=0;ne<9;ne+=1)x[ne]=p0(f0(t,z,ne));return{c(){e=p("div"),l=p("span"),i=C(n),s=b(),o=p("span"),f=C(r),c=b(),_=p("label"),d=p("input"),m=b(),h=C(v),g=b(),w=p("div"),k=p("select"),A=p("option"),I=C("Autodetect");for(let ne=0;ne<9;ne+=1)x[ne].c();M=b(),O=p("select"),E=p("option"),F=C("-"),j=p("option"),j.textContent="7N1",S=p("option"),S.textContent="8N1",y=p("option"),y.textContent="8N2",J=p("option"),J.textContent="7E1",G=p("option"),G.textContent="8E1",X=b(),U=p("input"),u(l,"class","float-right"),u(d,"name","mi"),d.__value="true",V(d,d.__value),u(d,"type","checkbox"),u(d,"class","rounded mb-1"),u(_,"class","mt-2 ml-3 whitespace-nowrap"),A.__value=0,V(A,A.__value),A.disabled=L=t[7].m.b!=0,u(k,"name","mb"),u(k,"class","in-f tr w-1/2"),t[7].m.b===void 0&&qt(()=>t[38].call(k)),E.__value=0,V(E,E.__value),E.disabled=H=t[7].m.b!=0,j.__value=2,V(j,j.__value),S.__value=3,V(S,S.__value),y.__value=7,V(y,y.__value),J.__value=10,V(J,J.__value),G.__value=11,V(G,G.__value),u(O,"name","mp"),u(O,"class","in-m"),O.disabled=K=t[7].m.b==0,t[7].m.p===void 0&&qt(()=>t[39].call(O)),u(U,"name","ms"),u(U,"type","number"),u(U,"min",64),u(U,"max",Y=t[0].chip=="esp8266"?t[7].i.h.p==3||t[7].i.h.p==113?512:256:4096),u(U,"step",64),u(U,"class","in-l tr w-1/2"),u(w,"class","flex w-full"),u(e,"class","my-1")},m(ne,be){P(ne,e,be),a(e,l),a(l,i),a(e,s),a(e,o),a(o,f),a(e,c),a(e,_),a(_,d),d.checked=t[7].m.i,a(_,m),a(_,h),a(e,g),a(e,w),a(w,k),a(k,A),a(A,I);for(let we=0;we<9;we+=1)x[we]&&x[we].m(k,null);Xe(k,t[7].m.b,!0),a(w,M),a(w,O),a(O,E),a(E,F),a(O,j),a(O,S),a(O,y),a(O,J),a(O,G),Xe(O,t[7].m.p,!0),a(w,X),a(w,U),V(U,t[7].m.s),le||($=[re(d,"change",t[37]),re(k,"change",t[38]),re(O,"change",t[39]),re(U,"input",t[40])],le=!0)},p(ne,be){var we,R,T,B,D,W;be[0]&8&&n!==(n=(((R=(we=ne[3].conf)==null?void 0:we.meter)==null?void 0:R.buffer)??"Buffer size")+"")&&q(i,n),be[0]&8&&r!==(r=(((B=(T=ne[3].conf)==null?void 0:T.meter)==null?void 0:B.serial)??"Serial conf.")+"")&&q(f,r),be[0]&128&&(d.checked=ne[7].m.i),be[0]&8&&v!==(v=(((W=(D=ne[3].conf)==null?void 0:D.meter)==null?void 0:W.inverted)??"inverted")+"")&&q(h,v),be[0]&128&&L!==(L=ne[7].m.b!=0)&&(A.disabled=L),be[0]&128&&Xe(k,ne[7].m.b),be[0]&128&&H!==(H=ne[7].m.b!=0)&&(E.disabled=H),be[0]&128&&K!==(K=ne[7].m.b==0)&&(O.disabled=K),be[0]&128&&Xe(O,ne[7].m.p),be[0]&129&&Y!==(Y=ne[0].chip=="esp8266"?ne[7].i.h.p==3||ne[7].i.h.p==113?512:256:4096)&&u(U,"max",Y),be[0]&128&&ye(U.value)!==ne[7].m.s&&V(U,ne[7].m.s)},d(ne){ne&&N(e),Xt(x,ne),le=!1,Dt($)}}}function m0(t){var c,_;let e,l,n=(((_=(c=t[3].conf)==null?void 0:c.meter)==null?void 0:_.pulses)??"Pulses per kWh")+"",i,s,o,r,f;return{c(){e=p("div"),l=p("span"),i=C(n),s=b(),o=p("input"),u(o,"name","mb"),u(o,"class","in-s tr"),u(o,"type","number"),u(o,"min",1),u(o,"max",3600),u(e,"class","my-1")},m(d,m){P(d,e,m),a(e,l),a(l,i),a(e,s),a(e,o),V(o,t[7].m.b),r||(f=re(o,"input",t[36]),r=!0)},p(d,m){var v,h;m[0]&8&&n!==(n=(((h=(v=d[3].conf)==null?void 0:v.meter)==null?void 0:h.pulses)??"Pulses per kWh")+"")&&q(i,n),m[0]&128&&ye(o.value)!==d[7].m.b&&V(o,d[7].m.b)},d(d){d&&N(e),r=!1,f()}}}function p0(t){let e;return{c(){e=p("option"),e.textContent=`${t[138]*100}`,e.__value=t[138]*100,V(e,e.__value)},m(l,n){P(l,e,n)},p:Ve,d(l){l&&N(e)}}}function $o(t){let e,l,n,i;return{c(){e=p("br"),l=p("input"),u(l,"name","mek"),u(l,"type","text"),u(l,"class","in-s"),u(l,"pattern",gu)},m(s,o){P(s,e,o),P(s,l,o),V(l,t[7].m.e.k),n||(i=re(l,"input",t[45]),n=!0)},p(s,o){o[0]&128&&l.value!==s[7].m.e.k&&V(l,s[7].m.e.k)},d(s){s&&(N(e),N(l)),n=!1,i()}}}function xo(t){var c,_;let e,l=(((_=(c=t[3].conf)==null?void 0:c.meter)==null?void 0:_.authkey)??"Authentication key")+"",n,i,s,o,r,f;return{c(){e=p("div"),n=C(l),i=p("br"),s=b(),o=p("input"),u(o,"name","mea"),u(o,"type","text"),u(o,"class","in-s"),u(o,"pattern",gu),u(e,"class","my-1")},m(d,m){P(d,e,m),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].m.e.a),r||(f=re(o,"input",t[46]),r=!0)},p(d,m){var v,h;m[0]&8&&l!==(l=(((h=(v=d[3].conf)==null?void 0:v.meter)==null?void 0:h.authkey)??"Authentication key")+"")&&q(n,l),m[0]&128&&o.value!==d[7].m.e.a&&V(o,d[7].m.e.a)},d(d){d&&N(e),r=!1,f()}}}function ea(t){var K,X,U,Y,le,$,z,x,fe,ae,se,_e;let e,l,n=(((U=(X=(K=t[3].conf)==null?void 0:K.meter)==null?void 0:X.multipliers)==null?void 0:U.watt)??"Watt")+"",i,s,o,r,f,c,_=((($=(le=(Y=t[3].conf)==null?void 0:Y.meter)==null?void 0:le.multipliers)==null?void 0:$.volt)??"Volt")+"",d,m,v,h,g,w,k=(((fe=(x=(z=t[3].conf)==null?void 0:z.meter)==null?void 0:x.multipliers)==null?void 0:fe.amp)??"Amp")+"",A,I,L,M,O,E,F=(((_e=(se=(ae=t[3].conf)==null?void 0:ae.meter)==null?void 0:se.multipliers)==null?void 0:_e.kwh)??"kWh")+"",H,j,S,y,J,G;return{c(){e=p("div"),l=p("div"),i=C(n),s=p("br"),o=b(),r=p("input"),f=b(),c=p("div"),d=C(_),m=p("br"),v=b(),h=p("input"),g=b(),w=p("div"),A=C(k),I=p("br"),L=b(),M=p("input"),O=b(),E=p("div"),H=C(F),j=p("br"),S=b(),y=p("input"),u(r,"name","mmw"),u(r,"type","number"),u(r,"min","0.00"),u(r,"max","1000"),u(r,"step","0.001"),u(r,"class","in-f tr w-full"),u(l,"class","w-1/4"),u(h,"name","mmv"),u(h,"type","number"),u(h,"min","0.00"),u(h,"max","1000"),u(h,"step","0.001"),u(h,"class","in-m tr w-full"),u(c,"class","w-1/4"),u(M,"name","mma"),u(M,"type","number"),u(M,"min","0.00"),u(M,"max","1000"),u(M,"step","0.001"),u(M,"class","in-m tr w-full"),u(w,"class","w-1/4"),u(y,"name","mmc"),u(y,"type","number"),u(y,"min","0.00"),u(y,"max","1000"),u(y,"step","0.001"),u(y,"class","in-l tr w-full"),u(E,"class","w-1/4"),u(e,"class","flex my-1")},m(oe,ee){P(oe,e,ee),a(e,l),a(l,i),a(l,s),a(l,o),a(l,r),V(r,t[7].m.m.w),a(e,f),a(e,c),a(c,d),a(c,m),a(c,v),a(c,h),V(h,t[7].m.m.v),a(e,g),a(e,w),a(w,A),a(w,I),a(w,L),a(w,M),V(M,t[7].m.m.a),a(e,O),a(e,E),a(E,H),a(E,j),a(E,S),a(E,y),V(y,t[7].m.m.c),J||(G=[re(r,"input",t[48]),re(h,"input",t[49]),re(M,"input",t[50]),re(y,"input",t[51])],J=!0)},p(oe,ee){var ne,be,we,R,T,B,D,W,te,ue,ce,me;ee[0]&8&&n!==(n=(((we=(be=(ne=oe[3].conf)==null?void 0:ne.meter)==null?void 0:be.multipliers)==null?void 0:we.watt)??"Watt")+"")&&q(i,n),ee[0]&128&&ye(r.value)!==oe[7].m.m.w&&V(r,oe[7].m.m.w),ee[0]&8&&_!==(_=(((B=(T=(R=oe[3].conf)==null?void 0:R.meter)==null?void 0:T.multipliers)==null?void 0:B.volt)??"Volt")+"")&&q(d,_),ee[0]&128&&ye(h.value)!==oe[7].m.m.v&&V(h,oe[7].m.m.v),ee[0]&8&&k!==(k=(((te=(W=(D=oe[3].conf)==null?void 0:D.meter)==null?void 0:W.multipliers)==null?void 0:te.amp)??"Amp")+"")&&q(A,k),ee[0]&128&&ye(M.value)!==oe[7].m.m.a&&V(M,oe[7].m.m.a),ee[0]&8&&F!==(F=(((me=(ce=(ue=oe[3].conf)==null?void 0:ue.meter)==null?void 0:ce.multipliers)==null?void 0:me.kwh)??"kWh")+"")&&q(H,F),ee[0]&128&&ye(y.value)!==oe[7].m.m.c&&V(y,oe[7].m.m.c)},d(oe){oe&&N(e),J=!1,Dt(G)}}}function ta(t){var H,j,S,y,J,G;let e,l,n=(((j=(H=t[3].conf)==null?void 0:H.connection)==null?void 0:j.title)??"Connection")+"",i,s,o,r,f,c,_,d,m,v=(((y=(S=t[3].conf)==null?void 0:S.connection)==null?void 0:y.wifi)??"WiFi")+"",h,g,w=(((G=(J=t[3].conf)==null?void 0:J.connection)==null?void 0:G.ap)??"AP")+"",k,A,I,L,M,O=t[0].if&&t[0].if.eth&&la(t),E=(t[7].n.c==1||t[7].n.c==2)&&na(t),F=(t[7].n.c==1||t[7].n.c==2)&&oa(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("a"),o.textContent="ⓘ",r=b(),f=p("input"),c=b(),_=p("div"),d=p("select"),m=p("option"),h=C(v),g=p("option"),k=C(w),O&&O.c(),A=b(),E&&E.c(),I=b(),F&&F.c(),u(l,"class","text-sm"),u(o,"href",vl("Network-connection")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","w"),f.value="true",m.__value=1,V(m,m.__value),g.__value=2,V(g,g.__value),u(d,"name","nc"),u(d,"class","in-s"),t[7].n.c===void 0&&qt(()=>t[52].call(d)),u(_,"class","my-1"),u(e,"class","cnt")},m(K,X){P(K,e,X),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,d),a(d,m),a(m,h),a(d,g),a(g,k),O&&O.m(d,null),Xe(d,t[7].n.c,!0),a(e,A),E&&E.m(e,null),a(e,I),F&&F.m(e,null),L||(M=re(d,"change",t[52]),L=!0)},p(K,X){var U,Y,le,$,z,x;X[0]&8&&n!==(n=(((Y=(U=K[3].conf)==null?void 0:U.connection)==null?void 0:Y.title)??"Connection")+"")&&q(i,n),X[0]&8&&v!==(v=((($=(le=K[3].conf)==null?void 0:le.connection)==null?void 0:$.wifi)??"WiFi")+"")&&q(h,v),X[0]&8&&w!==(w=(((x=(z=K[3].conf)==null?void 0:z.connection)==null?void 0:x.ap)??"AP")+"")&&q(k,w),K[0].if&&K[0].if.eth?O?O.p(K,X):(O=la(K),O.c(),O.m(d,null)):O&&(O.d(1),O=null),X[0]&128&&Xe(d,K[7].n.c),K[7].n.c==1||K[7].n.c==2?E?E.p(K,X):(E=na(K),E.c(),E.m(e,I)):E&&(E.d(1),E=null),K[7].n.c==1||K[7].n.c==2?F?F.p(K,X):(F=oa(K),F.c(),F.m(e,null)):F&&(F.d(1),F=null)},d(K){K&&N(e),O&&O.d(),E&&E.d(),F&&F.d(),L=!1,M()}}}function la(t){var i,s;let e,l=(((s=(i=t[3].conf)==null?void 0:i.connection)==null?void 0:s.eth)??"Ethernet")+"",n;return{c(){e=p("option"),n=C(l),e.__value=3,V(e,e.__value)},m(o,r){P(o,e,r),a(e,n)},p(o,r){var f,c;r[0]&8&&l!==(l=(((c=(f=o[3].conf)==null?void 0:f.connection)==null?void 0:c.eth)??"Ethernet")+"")&&q(n,l)},d(o){o&&N(e)}}}function na(t){var M,O,E,F,H;let e,l=(((O=(M=t[3].conf)==null?void 0:M.connection)==null?void 0:O.ssid)??"Nettverksnavn (SSID)")+"",n,i,s,o,r,f,c,_=(((F=(E=t[3].conf)==null?void 0:E.connection)==null?void 0:F.psk)??"Passord")+"",d,m,v,h,g,w,k=((H=t[9])==null?void 0:H.c)==-1&&ia();function A(j,S){var y,J,G;if((J=(y=j[9])==null?void 0:y.n)!=null&&J.length)return h0;if(((G=j[9])==null?void 0:G.c)!=-1)return d0}let I=A(t),L=I&&I(t);return{c(){e=p("div"),n=C(l),i=b(),s=p("br"),o=b(),k&&k.c(),r=b(),L&&L.c(),f=b(),c=p("div"),d=C(_),m=p("br"),v=b(),h=p("input"),u(e,"class","my-1"),u(h,"name","wp"),u(h,"type","password"),u(h,"class","in-s"),u(h,"pattern",Wn),u(c,"class","my-1")},m(j,S){P(j,e,S),a(e,n),a(e,i),a(e,s),a(e,o),k&&k.m(e,null),a(e,r),L&&L.m(e,null),P(j,f,S),P(j,c,S),a(c,d),a(c,m),a(c,v),a(c,h),V(h,t[7].w.p),g||(w=re(h,"input",t[55]),g=!0)},p(j,S){var y,J,G,K,X;S[0]&8&&l!==(l=(((J=(y=j[3].conf)==null?void 0:y.connection)==null?void 0:J.ssid)??"Nettverksnavn (SSID)")+"")&&q(n,l),((G=j[9])==null?void 0:G.c)==-1?k||(k=ia(),k.c(),k.m(e,r)):k&&(k.d(1),k=null),I===(I=A(j))&&L?L.p(j,S):(L&&L.d(1),L=I&&I(j),L&&(L.c(),L.m(e,null))),S[0]&8&&_!==(_=(((X=(K=j[3].conf)==null?void 0:K.connection)==null?void 0:X.psk)??"Passord")+"")&&q(d,_),S[0]&128&&h.value!==j[7].w.p&&V(h,j[7].w.p)},d(j){j&&(N(e),N(f),N(c)),k&&k.d(),L&&L.d(),g=!1,w()}}}function ia(t){let e;return{c(){e=p("div"),e.textContent="Søker etter Nettverk...",u(e,"class","text-sm italic")},m(l,n){P(l,e,n)},d(l){l&&N(e)}}}function d0(t){let e;return{c(){e=p("div"),e.textContent="Ingen nettverk funnet",u(e,"class","text-sm italic")},m(l,n){P(l,e,n)},p:Ve,d(l){l&&N(e)}}}function h0(t){let e,l=it(t[9].n),n=[];for(let i=0;it[57].call(h)),u(c,"class","w-1/2"),u(Y,"name","ww"),u(Y,"type","number"),u(Y,"min","0"),u(Y,"max","20.5"),u(Y,"step","0.5"),u(Y,"class","in-f tr w-full"),u($,"class","in-post"),u(U,"class","flex"),u(y,"class","ml-2 w-1/2"),u(f,"class","my-1 flex"),u(ae,"type","checkbox"),u(ae,"name","wb"),ae.__value="true",V(ae,ae.__value),u(ae,"class","rounded mb-1"),u(x,"class","my-3")},m(Ze,Be){P(Ze,e,Be),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].w.p),P(Ze,r,Be),P(Ze,f,Be),a(f,c),a(c,d),a(c,m),a(c,v),a(c,h),a(h,g),a(g,k),a(h,A),a(A,L),a(h,M),a(M,E),a(h,F),a(F,j),Xe(h,t[7].w.z,!0),a(f,S),a(f,y),a(y,G),a(y,K),a(y,X),a(y,U),a(U,Y),V(Y,t[7].w.w),a(U,le),a(U,$),P(Ze,z,Be),P(Ze,x,Be),a(x,fe),a(fe,ae),ae.checked=t[7].w.b,a(fe,se),a(fe,oe),ee||(ne=[re(o,"input",t[56]),re(h,"change",t[57]),re(Y,"input",t[58]),re(ae,"change",t[59])],ee=!0)},p(Ze,Be){var at,Nt,bt,ft,st,ut,Rt,Ke,Ie,je,$e,de,qe,Ge,ge,Pe,nt,He,At,ht,Re;Be[0]&8&&l!==(l=(((Nt=(at=Ze[3].conf)==null?void 0:at.connection)==null?void 0:Nt.psk)??"Password")+"")&&q(n,l),Be[0]&128&&o.value!==Ze[7].w.p&&V(o,Ze[7].w.p),Be[0]&8&&_!==(_=(((st=(ft=(bt=Ze[3].conf)==null?void 0:bt.connection)==null?void 0:ft.ps)==null?void 0:st.title)??"Power saving")+"")&&q(d,_),Be[0]&8&&w!==(w=(((Ke=(Rt=(ut=Ze[3].conf)==null?void 0:ut.connection)==null?void 0:Rt.ps)==null?void 0:Ke.default)??"Default")+"")&&q(k,w),Be[0]&8&&I!==(I=((($e=(je=(Ie=Ze[3].conf)==null?void 0:Ie.connection)==null?void 0:je.ps)==null?void 0:$e.off)??"Off")+"")&&q(L,I),Be[0]&8&&O!==(O=(((Ge=(qe=(de=Ze[3].conf)==null?void 0:de.connection)==null?void 0:qe.ps)==null?void 0:Ge.min)??"Min")+"")&&q(E,O),Be[0]&8&&H!==(H=(((nt=(Pe=(ge=Ze[3].conf)==null?void 0:ge.connection)==null?void 0:Pe.ps)==null?void 0:nt.max)??"Max")+"")&&q(j,H),Be[0]&128&&Xe(h,Ze[7].w.z),Be[0]&8&&J!==(J=(((At=(He=Ze[3].conf)==null?void 0:He.connection)==null?void 0:At.pwr)??"Power")+"")&&q(G,J),Be[0]&128&&ye(Y.value)!==Ze[7].w.w&&V(Y,Ze[7].w.w),Be[0]&128&&(ae.checked=Ze[7].w.b),Be[0]&8&&_e!==(_e=(((Re=(ht=Ze[3].conf)==null?void 0:ht.connection)==null?void 0:Re.tick_11b)??"802.11b")+"")&&q(oe,_e)},d(Ze){Ze&&(N(e),N(r),N(f),N(z),N(x)),ee=!1,Dt(ne)}}}function aa(t){var Oe,rt,dt,tt,Ze,Be,at,Nt,bt,ft,st,ut,Rt,Ke;let e,l,n=(((rt=(Oe=t[3].conf)==null?void 0:Oe.network)==null?void 0:rt.title)??"Network")+"",i,s,o,r,f,c=(((tt=(dt=t[3].conf)==null?void 0:dt.network)==null?void 0:tt.ip)??"IP")+"",_,d,m,v,h,g,w=(((Be=(Ze=t[3].conf)==null?void 0:Ze.network)==null?void 0:Be.dhcp)??"DHCP")+"",k,A,I=(((Nt=(at=t[3].conf)==null?void 0:at.network)==null?void 0:Nt.static)??"Static")+"",L,M,O,E,F,H,j,S,y,J,G,K,X,U,Y,le,$,z,x,fe,ae,se=(((ft=(bt=t[3].conf)==null?void 0:bt.network)==null?void 0:ft.tick_mdns)??"mDNS")+"",_e,oe,ee,ne,be,we=(((ut=(st=t[3].conf)==null?void 0:st.network)==null?void 0:ut.ntp)??"NTP")+"",R,T,B,D,W,te=(((Ke=(Rt=t[3].conf)==null?void 0:Rt.network)==null?void 0:Ke.tick_ntp_dhcp)??"from DHCP")+"",ue,ce,me,pe,ke,ve,De,Ee;S=new e0({});let Le=t[7].n.m=="static"&&fa(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("a"),o.textContent="ⓘ",r=b(),f=p("div"),_=C(c),d=p("br"),m=b(),v=p("div"),h=p("select"),g=p("option"),k=C(w),A=p("option"),L=C(I),M=b(),O=p("input"),H=b(),j=p("select"),Ne(S.$$.fragment),G=b(),Le&&Le.c(),K=b(),X=p("div"),U=p("label"),Y=p("input"),le=C(" IPv6"),$=b(),z=p("div"),x=p("label"),fe=p("input"),ae=b(),_e=C(se),oe=b(),ee=p("input"),ne=b(),be=p("div"),R=C(we),T=b(),B=p("label"),D=p("input"),W=b(),ue=C(te),ce=p("br"),me=b(),pe=p("div"),ke=p("input"),u(l,"class","text-sm"),u(o,"href",vl("Network-configuration")),u(o,"target","_blank"),u(o,"class","float-right"),g.__value="dhcp",V(g,g.__value),A.__value="static",V(A,A.__value),u(h,"name","nm"),u(h,"class","in-f"),t[7].n.m===void 0&&qt(()=>t[60].call(h)),u(O,"name","ni"),u(O,"type","text"),u(O,"class","in-m w-full"),O.disabled=E=t[7].n.m=="dhcp",O.required=F=t[7].n.m=="static",u(O,"pattern",ii),u(j,"name","ns"),u(j,"class","in-l"),j.disabled=y=t[7].n.m=="dhcp",j.required=J=t[7].n.m=="static",t[7].n.s===void 0&&qt(()=>t[62].call(j)),u(v,"class","flex"),u(f,"class","my-1"),u(Y,"name","nx"),Y.__value="true",V(Y,Y.__value),u(Y,"type","checkbox"),u(Y,"class","rounded mb-1"),u(X,"class","my-1"),u(fe,"name","nd"),fe.__value="true",V(fe,fe.__value),u(fe,"type","checkbox"),u(fe,"class","rounded mb-1"),u(z,"class","my-1"),u(ee,"type","hidden"),u(ee,"name","ntp"),ee.value="true",u(D,"name","ntpd"),D.__value="true",V(D,D.__value),u(D,"type","checkbox"),u(D,"class","rounded mb-1"),u(B,"class","ml-4"),u(ke,"name","ntph"),u(ke,"type","text"),u(ke,"class","in-s"),u(ke,"pattern",Ol),u(pe,"class","flex"),u(be,"class","my-1"),u(e,"class","cnt")},m(Ie,je){P(Ie,e,je),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(f,_),a(f,d),a(f,m),a(f,v),a(v,h),a(h,g),a(g,k),a(h,A),a(A,L),Xe(h,t[7].n.m,!0),a(v,M),a(v,O),V(O,t[7].n.i),a(v,H),a(v,j),Se(S,j,null),Xe(j,t[7].n.s,!0),a(e,G),Le&&Le.m(e,null),a(e,K),a(e,X),a(X,U),a(U,Y),Y.checked=t[7].n.x,a(U,le),a(e,$),a(e,z),a(z,x),a(x,fe),fe.checked=t[7].n.d,a(x,ae),a(x,_e),a(e,oe),a(e,ee),a(e,ne),a(e,be),a(be,R),a(be,T),a(be,B),a(B,D),D.checked=t[7].n.h,a(B,W),a(B,ue),a(be,ce),a(be,me),a(be,pe),a(pe,ke),V(ke,t[7].n.n1),ve=!0,De||(Ee=[re(h,"change",t[60]),re(O,"input",t[61]),re(j,"change",t[62]),re(Y,"change",t[66]),re(fe,"change",t[67]),re(D,"change",t[68]),re(ke,"input",t[69])],De=!0)},p(Ie,je){var $e,de,qe,Ge,ge,Pe,nt,He,At,ht,Re,kt,ct,vt;(!ve||je[0]&8)&&n!==(n=(((de=($e=Ie[3].conf)==null?void 0:$e.network)==null?void 0:de.title)??"Network")+"")&&q(i,n),(!ve||je[0]&8)&&c!==(c=(((Ge=(qe=Ie[3].conf)==null?void 0:qe.network)==null?void 0:Ge.ip)??"IP")+"")&&q(_,c),(!ve||je[0]&8)&&w!==(w=(((Pe=(ge=Ie[3].conf)==null?void 0:ge.network)==null?void 0:Pe.dhcp)??"DHCP")+"")&&q(k,w),(!ve||je[0]&8)&&I!==(I=(((He=(nt=Ie[3].conf)==null?void 0:nt.network)==null?void 0:He.static)??"Static")+"")&&q(L,I),je[0]&128&&Xe(h,Ie[7].n.m),(!ve||je[0]&128&&E!==(E=Ie[7].n.m=="dhcp"))&&(O.disabled=E),(!ve||je[0]&128&&F!==(F=Ie[7].n.m=="static"))&&(O.required=F),je[0]&128&&O.value!==Ie[7].n.i&&V(O,Ie[7].n.i),(!ve||je[0]&128&&y!==(y=Ie[7].n.m=="dhcp"))&&(j.disabled=y),(!ve||je[0]&128&&J!==(J=Ie[7].n.m=="static"))&&(j.required=J),je[0]&128&&Xe(j,Ie[7].n.s),Ie[7].n.m=="static"?Le?Le.p(Ie,je):(Le=fa(Ie),Le.c(),Le.m(e,K)):Le&&(Le.d(1),Le=null),je[0]&128&&(Y.checked=Ie[7].n.x),je[0]&128&&(fe.checked=Ie[7].n.d),(!ve||je[0]&8)&&se!==(se=(((ht=(At=Ie[3].conf)==null?void 0:At.network)==null?void 0:ht.tick_mdns)??"mDNS")+"")&&q(_e,se),(!ve||je[0]&8)&&we!==(we=(((kt=(Re=Ie[3].conf)==null?void 0:Re.network)==null?void 0:kt.ntp)??"NTP")+"")&&q(R,we),je[0]&128&&(D.checked=Ie[7].n.h),(!ve||je[0]&8)&&te!==(te=(((vt=(ct=Ie[3].conf)==null?void 0:ct.network)==null?void 0:vt.tick_ntp_dhcp)??"from DHCP")+"")&&q(ue,te),je[0]&128&&ke.value!==Ie[7].n.n1&&V(ke,Ie[7].n.n1)},i(Ie){ve||(Z(S.$$.fragment,Ie),ve=!0)},o(Ie){ie(S.$$.fragment,Ie),ve=!1},d(Ie){Ie&&N(e),Me(S),Le&&Le.d(),De=!1,Dt(Ee)}}}function fa(t){var I,L,M,O;let e,l=(((L=(I=t[3].conf)==null?void 0:I.network)==null?void 0:L.gw)??"Gateway")+"",n,i,s,o,r,f,c=(((O=(M=t[3].conf)==null?void 0:M.network)==null?void 0:O.dns)??"DNS")+"",_,d,m,v,h,g,w,k,A;return{c(){e=p("div"),n=C(l),i=p("br"),s=b(),o=p("input"),r=b(),f=p("div"),_=C(c),d=p("br"),m=b(),v=p("div"),h=p("input"),g=b(),w=p("input"),u(o,"name","ng"),u(o,"type","text"),u(o,"class","in-s"),u(o,"pattern",ii),u(e,"class","my-1"),u(h,"name","nd1"),u(h,"type","text"),u(h,"class","in-f w-full"),u(h,"pattern",ii),u(w,"name","nd2"),u(w,"type","text"),u(w,"class","in-l w-full"),u(w,"pattern",ii),u(v,"class","flex"),u(f,"class","my-1")},m(E,F){P(E,e,F),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].n.g),P(E,r,F),P(E,f,F),a(f,_),a(f,d),a(f,m),a(f,v),a(v,h),V(h,t[7].n.d1),a(v,g),a(v,w),V(w,t[7].n.d2),k||(A=[re(o,"input",t[63]),re(h,"input",t[64]),re(w,"input",t[65])],k=!0)},p(E,F){var H,j,S,y;F[0]&8&&l!==(l=(((j=(H=E[3].conf)==null?void 0:H.network)==null?void 0:j.gw)??"Gateway")+"")&&q(n,l),F[0]&128&&o.value!==E[7].n.g&&V(o,E[7].n.g),F[0]&8&&c!==(c=(((y=(S=E[3].conf)==null?void 0:S.network)==null?void 0:y.dns)??"DNS")+"")&&q(_,c),F[0]&128&&h.value!==E[7].n.d1&&V(h,E[7].n.d1),F[0]&128&&w.value!==E[7].n.d2&&V(w,E[7].n.d2)},d(E){E&&(N(e),N(r),N(f)),k=!1,Dt(A)}}}function ua(t){var Pt,ot,he,et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae,Q,Ce,Kt,fl,ml,Jt,pl,dl,Cl,Sl,Ml,Rl,Fl,Ul;let e,l,n=(((ot=(Pt=t[3].conf)==null?void 0:Pt.mqtt)==null?void 0:ot.title)??"MQTT")+"",i,s,o,r,f,c,_,d=(((et=(he=t[3].conf)==null?void 0:he.mqtt)==null?void 0:et.server)??"Server")+"",m,v,h,g,w,k,A,I,L,M,O,E,F=(((xt=(ze=t[3].conf)==null?void 0:ze.mqtt)==null?void 0:xt.user)??"Username")+"",H,j,S,y,J,G,K=(((tl=(el=t[3].conf)==null?void 0:el.mqtt)==null?void 0:tl.pass)??"Password")+"",X,U,Y,le,$,z,x,fe=(((nl=(ll=t[3].conf)==null?void 0:ll.mqtt)==null?void 0:nl.id)??"Client ID")+"",ae,se,_e,oe,ee,ne,be,we=(((sl=(il=t[3].conf)==null?void 0:il.mqtt)==null?void 0:sl.payload)??"Payload")+"",R,T,B,D,W,te,ue,ce,me,pe,ke,ve,De,Ee,Le=(((Ae=(ol=t[3].conf)==null?void 0:ol.mqtt)==null?void 0:Ae.publish)??"Publish topic")+"",Oe,rt,dt,tt,Ze,Be,at=(((Ce=(Q=t[3].conf)==null?void 0:Q.mqtt)==null?void 0:Ce.subscribe)??"Subscribe topic")+"",Nt,bt,ft,st,ut,Rt,Ke,Ie=(((fl=(Kt=t[3].conf)==null?void 0:Kt.mqtt)==null?void 0:fl.update)??"Update method")+"",je,$e,de,qe=(((Jt=(ml=t[3].conf)==null?void 0:ml.mqtt)==null?void 0:Jt.interval)??"Interval")+"",Ge,ge,Pe,nt,He,At=(((dl=(pl=t[3].conf)==null?void 0:pl.mqtt)==null?void 0:dl.realtime)??"Real time")+"",ht,Re,kt=(((Sl=(Cl=t[3].conf)==null?void 0:Cl.mqtt)==null?void 0:Sl.interval)??"Interval")+"",ct,vt,xe,Lt,Gt,wt,_t=(((Rl=(Ml=t[3].conf)==null?void 0:Ml.mqtt)==null?void 0:Rl.timeout)??"Timeout")+"",Ht,Qt,Ut,Bt=(((Ul=(Fl=t[3].conf)==null?void 0:Fl.mqtt)==null?void 0:Ul.keepalive)??"Keep-alive")+"",Yt,$t,Vt,Ft,Fe,Je,Ue,Tt,Ot,Qe=t[0].chip!="esp8266"&&ra(t),lt=t[7].q.s.e&&ca(t);return{c(){var We,Te;e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("a"),o.textContent="ⓘ",r=b(),f=p("input"),c=b(),_=p("div"),m=C(d),v=b(),Qe&&Qe.c(),h=b(),g=p("br"),w=b(),k=p("div"),A=p("input"),I=b(),L=p("input"),M=b(),lt&<.c(),O=b(),E=p("div"),H=C(F),j=p("br"),S=b(),y=p("input"),J=b(),G=p("div"),X=C(K),U=p("br"),Y=b(),le=p("input"),$=b(),z=p("div"),x=p("div"),ae=C(fe),se=p("br"),_e=b(),oe=p("input"),ne=b(),be=p("div"),R=C(we),T=p("br"),B=b(),D=p("select"),W=p("option"),W.textContent="Raw (minimal)",te=p("option"),te.textContent="Raw (full)",ue=p("option"),ue.textContent="Domoticz",ce=p("option"),ce.textContent="Home-Assistant",me=p("option"),me.textContent="JSON (classic)",pe=p("option"),pe.textContent="JSON (multi topic)",ke=p("option"),ke.textContent="JSON (flat)",ve=p("option"),ve.textContent="HEX dump",De=b(),Ee=p("div"),Oe=C(Le),rt=p("br"),dt=b(),tt=p("input"),Ze=b(),Be=p("div"),Nt=C(at),bt=p("br"),ft=b(),st=p("input"),Rt=b(),Ke=p("div"),je=C(Ie),$e=b(),de=p("span"),Ge=C(qe),ge=b(),Pe=p("div"),nt=p("select"),He=p("option"),ht=C(At),Re=p("option"),ct=C(kt),vt=b(),xe=p("input"),Gt=b(),wt=p("div"),Ht=C(_t),Qt=b(),Ut=p("span"),Yt=C(Bt),$t=b(),Vt=p("div"),Ft=p("input"),Fe=b(),Je=p("input"),u(l,"class","text-sm"),u(o,"href",vl("MQTT-configuration")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","q"),f.value="true",u(A,"name","qh"),u(A,"type","text"),u(A,"class","in-f w-2/3"),u(A,"pattern",Ol),u(L,"name","qp"),u(L,"type","number"),u(L,"min","1024"),u(L,"max","65535"),u(L,"class","in-l tr w-1/3"),u(k,"class","flex"),u(_,"class","my-1"),u(y,"name","qu"),u(y,"type","text"),u(y,"class","in-s"),u(y,"pattern",Wn),u(E,"class","my-1"),u(le,"name","qa"),u(le,"type","password"),u(le,"class","in-s"),u(le,"pattern",Wn),u(G,"class","my-1"),u(oe,"name","qc"),u(oe,"type","text"),u(oe,"class","in-f w-full"),oe.required=ee=t[7].q.h,u(oe,"pattern",Gn),W.__value=1,V(W,W.__value),te.__value=2,V(te,te.__value),ue.__value=3,V(ue,ue.__value),ce.__value=4,V(ce,ce.__value),me.__value=0,V(me,me.__value),pe.__value=5,V(pe,pe.__value),ke.__value=6,V(ke,ke.__value),ve.__value=255,V(ve,ve.__value),u(D,"name","qm"),u(D,"class","in-l"),t[7].q.m===void 0&&qt(()=>t[76].call(D)),u(z,"class","my-1 flex"),u(tt,"name","qb"),u(tt,"type","text"),u(tt,"class","in-s"),u(tt,"pattern",Ol),u(Ee,"class","my-1"),u(st,"name","qr"),u(st,"type","text"),u(st,"class","in-s"),u(st,"pattern",Ol),u(st,"placeholder",ut=t[7].q.b+"/command"),u(Be,"class","my-1"),u(de,"class","float-right"),He.__value=0,V(He,He.__value),Re.__value=1,V(Re,Re.__value),u(nt,"name","qt"),u(nt,"class","in-f w-1/2"),t[7].q.t===void 0&&qt(()=>t[79].call(nt)),u(xe,"name","qd"),u(xe,"type","number"),u(xe,"min","1"),u(xe,"max","3600"),u(xe,"class","in-l tr w-1/2"),xe.disabled=Lt=((Te=(We=t[7])==null?void 0:We.q)==null?void 0:Te.t)!=1,u(Pe,"class","flex"),u(Ke,"class","my-1"),u(Ut,"class","float-right"),u(Ft,"name","qi"),u(Ft,"type","number"),u(Ft,"min","500"),u(Ft,"max","10000"),u(Ft,"class","in-f tr w-1/2"),u(Je,"name","qk"),u(Je,"type","number"),u(Je,"min","5"),u(Je,"max","180"),u(Je,"class","in-l tr w-1/2"),u(Vt,"class","flex"),u(wt,"class","my-1"),u(e,"class","cnt")},m(We,Te){P(We,e,Te),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,m),a(_,v),Qe&&Qe.m(_,null),a(_,h),a(_,g),a(_,w),a(_,k),a(k,A),V(A,t[7].q.h),a(k,I),a(k,L),V(L,t[7].q.p),a(e,M),lt&<.m(e,null),a(e,O),a(e,E),a(E,H),a(E,j),a(E,S),a(E,y),V(y,t[7].q.u),a(e,J),a(e,G),a(G,X),a(G,U),a(G,Y),a(G,le),V(le,t[7].q.a),a(e,$),a(e,z),a(z,x),a(x,ae),a(x,se),a(x,_e),a(x,oe),V(oe,t[7].q.c),a(z,ne),a(z,be),a(be,R),a(be,T),a(be,B),a(be,D),a(D,W),a(D,te),a(D,ue),a(D,ce),a(D,me),a(D,pe),a(D,ke),a(D,ve),Xe(D,t[7].q.m,!0),a(e,De),a(e,Ee),a(Ee,Oe),a(Ee,rt),a(Ee,dt),a(Ee,tt),V(tt,t[7].q.b),a(e,Ze),a(e,Be),a(Be,Nt),a(Be,bt),a(Be,ft),a(Be,st),V(st,t[7].q.r),a(e,Rt),a(e,Ke),a(Ke,je),a(Ke,$e),a(Ke,de),a(de,Ge),a(Ke,ge),a(Ke,Pe),a(Pe,nt),a(nt,He),a(He,ht),a(nt,Re),a(Re,ct),Xe(nt,t[7].q.t,!0),a(Pe,vt),a(Pe,xe),V(xe,t[7].q.d),a(e,Gt),a(e,wt),a(wt,Ht),a(wt,Qt),a(wt,Ut),a(Ut,Yt),a(wt,$t),a(wt,Vt),a(Vt,Ft),V(Ft,t[7].q.i),a(Vt,Fe),a(Vt,Je),V(Je,t[7].q.k),Ue=!0,Tt||(Ot=[re(A,"input",t[71]),re(L,"input",t[72]),re(y,"input",t[73]),re(le,"input",t[74]),re(oe,"input",t[75]),re(D,"change",t[76]),re(tt,"input",t[77]),re(st,"input",t[78]),re(nt,"change",t[79]),re(xe,"input",t[80]),re(Ft,"input",t[81]),re(Je,"input",t[82])],Tt=!0)},p(We,Te){var Et,ul,Bl,yl,jl,zl,Hl,Wl,Gl,Vl,Kl,Yl,Xl,Ql,Zl,Jl,$l,xl,en,tn,ln,Sn,Mn,Nn,Pn,Tn,En,qn,Dn,An;(!Ue||Te[0]&8)&&n!==(n=(((ul=(Et=We[3].conf)==null?void 0:Et.mqtt)==null?void 0:ul.title)??"MQTT")+"")&&q(i,n),(!Ue||Te[0]&8)&&d!==(d=(((yl=(Bl=We[3].conf)==null?void 0:Bl.mqtt)==null?void 0:yl.server)??"Server")+"")&&q(m,d),We[0].chip!="esp8266"?Qe?Qe.p(We,Te):(Qe=ra(We),Qe.c(),Qe.m(_,h)):Qe&&(Qe.d(1),Qe=null),Te[0]&128&&A.value!==We[7].q.h&&V(A,We[7].q.h),Te[0]&128&&ye(L.value)!==We[7].q.p&&V(L,We[7].q.p),We[7].q.s.e?lt?(lt.p(We,Te),Te[0]&128&&Z(lt,1)):(lt=ca(We),lt.c(),Z(lt,1),lt.m(e,O)):lt&&(mt(),ie(lt,1,1,()=>{lt=null}),pt()),(!Ue||Te[0]&8)&&F!==(F=(((zl=(jl=We[3].conf)==null?void 0:jl.mqtt)==null?void 0:zl.user)??"Username")+"")&&q(H,F),Te[0]&128&&y.value!==We[7].q.u&&V(y,We[7].q.u),(!Ue||Te[0]&8)&&K!==(K=(((Wl=(Hl=We[3].conf)==null?void 0:Hl.mqtt)==null?void 0:Wl.pass)??"Password")+"")&&q(X,K),Te[0]&128&&le.value!==We[7].q.a&&V(le,We[7].q.a),(!Ue||Te[0]&8)&&fe!==(fe=(((Vl=(Gl=We[3].conf)==null?void 0:Gl.mqtt)==null?void 0:Vl.id)??"Client ID")+"")&&q(ae,fe),(!Ue||Te[0]&128&&ee!==(ee=We[7].q.h))&&(oe.required=ee),Te[0]&128&&oe.value!==We[7].q.c&&V(oe,We[7].q.c),(!Ue||Te[0]&8)&&we!==(we=(((Yl=(Kl=We[3].conf)==null?void 0:Kl.mqtt)==null?void 0:Yl.payload)??"Payload")+"")&&q(R,we),Te[0]&128&&Xe(D,We[7].q.m),(!Ue||Te[0]&8)&&Le!==(Le=(((Ql=(Xl=We[3].conf)==null?void 0:Xl.mqtt)==null?void 0:Ql.publish)??"Publish topic")+"")&&q(Oe,Le),Te[0]&128&&tt.value!==We[7].q.b&&V(tt,We[7].q.b),(!Ue||Te[0]&8)&&at!==(at=(((Jl=(Zl=We[3].conf)==null?void 0:Zl.mqtt)==null?void 0:Jl.subscribe)??"Subscribe topic")+"")&&q(Nt,at),(!Ue||Te[0]&128&&ut!==(ut=We[7].q.b+"/command"))&&u(st,"placeholder",ut),Te[0]&128&&st.value!==We[7].q.r&&V(st,We[7].q.r),(!Ue||Te[0]&8)&&Ie!==(Ie=(((xl=($l=We[3].conf)==null?void 0:$l.mqtt)==null?void 0:xl.update)??"Update method")+"")&&q(je,Ie),(!Ue||Te[0]&8)&&qe!==(qe=(((tn=(en=We[3].conf)==null?void 0:en.mqtt)==null?void 0:tn.interval)??"Interval")+"")&&q(Ge,qe),(!Ue||Te[0]&8)&&At!==(At=(((Sn=(ln=We[3].conf)==null?void 0:ln.mqtt)==null?void 0:Sn.realtime)??"Real time")+"")&&q(ht,At),(!Ue||Te[0]&8)&&kt!==(kt=(((Nn=(Mn=We[3].conf)==null?void 0:Mn.mqtt)==null?void 0:Nn.interval)??"Interval")+"")&&q(ct,kt),Te[0]&128&&Xe(nt,We[7].q.t),(!Ue||Te[0]&128&&Lt!==(Lt=((Tn=(Pn=We[7])==null?void 0:Pn.q)==null?void 0:Tn.t)!=1))&&(xe.disabled=Lt),Te[0]&128&&ye(xe.value)!==We[7].q.d&&V(xe,We[7].q.d),(!Ue||Te[0]&8)&&_t!==(_t=(((qn=(En=We[3].conf)==null?void 0:En.mqtt)==null?void 0:qn.timeout)??"Timeout")+"")&&q(Ht,_t),(!Ue||Te[0]&8)&&Bt!==(Bt=(((An=(Dn=We[3].conf)==null?void 0:Dn.mqtt)==null?void 0:An.keepalive)??"Keep-alive")+"")&&q(Yt,Bt),Te[0]&128&&ye(Ft.value)!==We[7].q.i&&V(Ft,We[7].q.i),Te[0]&128&&ye(Je.value)!==We[7].q.k&&V(Je,We[7].q.k)},i(We){Ue||(Z(lt),Ue=!0)},o(We){ie(lt),Ue=!1},d(We){We&&N(e),Qe&&Qe.d(),lt&<.d(),Tt=!1,Dt(Ot)}}}function ra(t){let e,l,n,i,s;return{c(){e=p("label"),l=p("input"),n=C(" SSL"),u(l,"type","checkbox"),u(l,"name","qs"),l.__value="true",V(l,l.__value),u(l,"class","rounded mb-1"),u(e,"class","float-right mr-3")},m(o,r){P(o,e,r),a(e,l),l.checked=t[7].q.s.e,a(e,n),i||(s=[re(l,"change",t[70]),re(l,"change",t[20])],i=!0)},p(o,r){r[0]&128&&(l.checked=o[7].q.s.e)},d(o){o&&N(e),i=!1,Dt(s)}}}function ca(t){let e,l,n,i,s,o,r,f,c,_,d,m,v;const h=[b0,v0],g=[];function w(E,F){return E[7].q.s.c?0:1}n=w(t),i=g[n]=h[n](t);const k=[C0,w0],A=[];function I(E,F){return E[7].q.s.r?0:1}r=I(t),f=A[r]=k[r](t);const L=[P0,N0],M=[];function O(E,F){return E[7].q.s.k?0:1}return d=O(t),m=M[d]=L[d](t),{c(){e=p("div"),l=p("span"),i.c(),s=b(),o=p("span"),f.c(),c=b(),_=p("span"),m.c(),u(l,"class","flex pr-2"),u(o,"class","flex pr-2"),u(_,"class","flex pr-2"),u(e,"class","my-1 flex")},m(E,F){P(E,e,F),a(e,l),g[n].m(l,null),a(e,s),a(e,o),A[r].m(o,null),a(e,c),a(e,_),M[d].m(_,null),v=!0},p(E,F){let H=n;n=w(E),n===H?g[n].p(E,F):(mt(),ie(g[H],1,1,()=>{g[H]=null}),pt(),i=g[n],i?i.p(E,F):(i=g[n]=h[n](E),i.c()),Z(i,1),i.m(l,null));let j=r;r=I(E),r===j?A[r].p(E,F):(mt(),ie(A[j],1,1,()=>{A[j]=null}),pt(),f=A[r],f?f.p(E,F):(f=A[r]=k[r](E),f.c()),Z(f,1),f.m(o,null));let S=d;d=O(E),d===S?M[d].p(E,F):(mt(),ie(M[S],1,1,()=>{M[S]=null}),pt(),m=M[d],m?m.p(E,F):(m=M[d]=L[d](E),m.c()),Z(m,1),m.m(_,null))},i(E){v||(Z(i),Z(f),Z(m),v=!0)},o(E){ie(i),ie(f),ie(m),v=!1},d(E){E&&N(e),g[n].d(),A[r].d(),M[d].d()}}}function v0(t){let e,l;return e=new hl({props:{to:"/mqtt-ca",$$slots:{default:[g0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i[0]&8|i[4]&1048576&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function b0(t){let e,l,n,i,s,o,r;return l=new hl({props:{to:"/mqtt-ca",$$slots:{default:[k0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=b(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){P(f,e,c),Se(l,e,null),P(f,n,c),P(f,i,c),s=!0,o||(r=[re(i,"click",t[17]),re(i,"keypress",t[17])],o=!0)},p(f,c){const _={};c[0]&8|c[4]&1048576&&(_.$$scope={dirty:c,ctx:f}),l.$set(_)},i(f){s||(Z(l.$$.fragment,f),s=!0)},o(f){ie(l.$$.fragment,f),s=!1},d(f){f&&(N(e),N(n),N(i)),Me(l),o=!1,Dt(r)}}}function g0(t){var n,i,s,o;let e,l;return e=new Vn({props:{color:"blue",text:((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_ca_upload)??"Upload CA",title:((o=(s=t[3].conf)==null?void 0:s.mqtt)==null?void 0:o.title_ca)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Se(e,r,f),l=!0},p(r,f){var _,d,m,v;const c={};f[0]&8&&(c.text=((d=(_=r[3].conf)==null?void 0:_.mqtt)==null?void 0:d.btn_ca_upload)??"Upload CA"),f[0]&8&&(c.title=((v=(m=r[3].conf)==null?void 0:m.mqtt)==null?void 0:v.title_ca)??""),e.$set(c)},i(r){l||(Z(e.$$.fragment,r),l=!0)},o(r){ie(e.$$.fragment,r),l=!1},d(r){Me(e,r)}}}function k0(t){var n,i;let e=(((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.ca_ok)??"CA OK")+"",l;return{c(){l=C(e)},m(s,o){P(s,l,o)},p(s,o){var r,f;o[0]&8&&e!==(e=(((f=(r=s[3].conf)==null?void 0:r.mqtt)==null?void 0:f.ca_ok)??"CA OK")+"")&&q(l,e)},d(s){s&&N(l)}}}function w0(t){let e,l;return e=new hl({props:{to:"/mqtt-cert",$$slots:{default:[S0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i[0]&8|i[4]&1048576&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function C0(t){let e,l,n,i,s,o,r;return l=new hl({props:{to:"/mqtt-cert",$$slots:{default:[M0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=b(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){P(f,e,c),Se(l,e,null),P(f,n,c),P(f,i,c),s=!0,o||(r=[re(i,"click",t[18]),re(i,"keypress",t[18])],o=!0)},p(f,c){const _={};c[0]&8|c[4]&1048576&&(_.$$scope={dirty:c,ctx:f}),l.$set(_)},i(f){s||(Z(l.$$.fragment,f),s=!0)},o(f){ie(l.$$.fragment,f),s=!1},d(f){f&&(N(e),N(n),N(i)),Me(l),o=!1,Dt(r)}}}function S0(t){var n,i,s,o;let e,l;return e=new Vn({props:{color:"blue",text:((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_crt_upload)??"Upload cert",title:((o=(s=t[3].conf)==null?void 0:s.mqtt)==null?void 0:o.title_crt)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Se(e,r,f),l=!0},p(r,f){var _,d,m,v;const c={};f[0]&8&&(c.text=((d=(_=r[3].conf)==null?void 0:_.mqtt)==null?void 0:d.btn_crt_upload)??"Upload cert"),f[0]&8&&(c.title=((v=(m=r[3].conf)==null?void 0:m.mqtt)==null?void 0:v.title_crt)??""),e.$set(c)},i(r){l||(Z(e.$$.fragment,r),l=!0)},o(r){ie(e.$$.fragment,r),l=!1},d(r){Me(e,r)}}}function M0(t){var n,i;let e=(((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.crt_ok)??"Cert OK")+"",l;return{c(){l=C(e)},m(s,o){P(s,l,o)},p(s,o){var r,f;o[0]&8&&e!==(e=(((f=(r=s[3].conf)==null?void 0:r.mqtt)==null?void 0:f.crt_ok)??"Cert OK")+"")&&q(l,e)},d(s){s&&N(l)}}}function N0(t){let e,l;return e=new hl({props:{to:"/mqtt-key",$$slots:{default:[T0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i[0]&8|i[4]&1048576&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function P0(t){let e,l,n,i,s,o,r;return l=new hl({props:{to:"/mqtt-key",$$slots:{default:[E0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=b(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){P(f,e,c),Se(l,e,null),P(f,n,c),P(f,i,c),s=!0,o||(r=[re(i,"click",t[19]),re(i,"keypress",t[19])],o=!0)},p(f,c){const _={};c[0]&8|c[4]&1048576&&(_.$$scope={dirty:c,ctx:f}),l.$set(_)},i(f){s||(Z(l.$$.fragment,f),s=!0)},o(f){ie(l.$$.fragment,f),s=!1},d(f){f&&(N(e),N(n),N(i)),Me(l),o=!1,Dt(r)}}}function T0(t){var n,i,s,o;let e,l;return e=new Vn({props:{color:"blue",text:((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_key_upload)??"Upload key",title:((o=(s=t[3].conf)==null?void 0:s.mqtt)==null?void 0:o.title_key)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Se(e,r,f),l=!0},p(r,f){var _,d,m,v;const c={};f[0]&8&&(c.text=((d=(_=r[3].conf)==null?void 0:_.mqtt)==null?void 0:d.btn_key_upload)??"Upload key"),f[0]&8&&(c.title=((v=(m=r[3].conf)==null?void 0:m.mqtt)==null?void 0:v.title_key)??""),e.$set(c)},i(r){l||(Z(e.$$.fragment,r),l=!0)},o(r){ie(e.$$.fragment,r),l=!1},d(r){Me(e,r)}}}function E0(t){var n,i;let e=(((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.key_ok)??"Key OK")+"",l;return{c(){l=C(e)},m(s,o){P(s,l,o)},p(s,o){var r,f;o[0]&8&&e!==(e=(((f=(r=s[3].conf)==null?void 0:r.mqtt)==null?void 0:f.key_ok)??"Key OK")+"")&&q(l,e)},d(s){s&&N(l)}}}function _a(t){var z,x,fe,ae,se,_e,oe,ee,ne,be,we,R;let e,l,n=(((fe=(x=(z=t[3].conf)==null?void 0:z.mqtt)==null?void 0:x.domoticz)==null?void 0:fe.title)??"Domoticz")+"",i,s,o,r,f,c,_,d,m=(((_e=(se=(ae=t[3].conf)==null?void 0:ae.mqtt)==null?void 0:se.domoticz)==null?void 0:_e.eidx)??"Electricity IDX")+"",v,h,g,w,k,A,I=(((ne=(ee=(oe=t[3].conf)==null?void 0:oe.mqtt)==null?void 0:ee.domoticz)==null?void 0:ne.cidx)??"Current IDX")+"",L,M,O,E,F,H,j=(((R=(we=(be=t[3].conf)==null?void 0:be.mqtt)==null?void 0:we.domoticz)==null?void 0:R.vidx)??"Voltage IDX")+"",S,y,J,G,K,X,U,Y,le,$;return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("a"),o.textContent="ⓘ",r=b(),f=p("input"),c=b(),_=p("div"),d=p("div"),v=C(m),h=p("br"),g=b(),w=p("input"),k=b(),A=p("div"),L=C(I),M=p("br"),O=b(),E=p("input"),F=b(),H=p("div"),S=C(j),y=C(`: L1, L2 & L3 - `),J=p("div"),G=p("input"),K=b(),X=p("input"),U=b(),Y=p("input"),u(l,"class","text-sm"),u(o,"href",vl("MQTT-configuration#domoticz")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","o"),f.value="true",u(w,"name","oe"),u(w,"type","text"),u(w,"class","in-f tr w-full"),u(w,"pattern",Ln),u(d,"class","w-1/2"),u(E,"name","oc"),u(E,"type","text"),u(E,"class","in-l tr w-full"),u(E,"pattern",Ln),u(A,"class","w-1/2"),u(_,"class","my-1 flex"),u(G,"name","ou1"),u(G,"type","text"),u(G,"class","in-f tr w-1/3"),u(G,"pattern",Ln),u(X,"name","ou2"),u(X,"type","text"),u(X,"class","in-m tr w-1/3"),u(X,"pattern",Ln),u(Y,"name","ou3"),u(Y,"type","text"),u(Y,"class","in-l tr w-1/3"),u(Y,"pattern",Ln),u(J,"class","flex"),u(H,"class","my-1"),u(e,"class","cnt")},m(T,B){P(T,e,B),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,d),a(d,v),a(d,h),a(d,g),a(d,w),V(w,t[7].o.e),a(_,k),a(_,A),a(A,L),a(A,M),a(A,O),a(A,E),V(E,t[7].o.c),a(e,F),a(e,H),a(H,S),a(H,y),a(H,J),a(J,G),V(G,t[7].o.u1),a(J,K),a(J,X),V(X,t[7].o.u2),a(J,U),a(J,Y),V(Y,t[7].o.u3),le||($=[re(w,"input",t[83]),re(E,"input",t[84]),re(G,"input",t[85]),re(X,"input",t[86]),re(Y,"input",t[87])],le=!0)},p(T,B){var D,W,te,ue,ce,me,pe,ke,ve,De,Ee,Le;B[0]&8&&n!==(n=(((te=(W=(D=T[3].conf)==null?void 0:D.mqtt)==null?void 0:W.domoticz)==null?void 0:te.title)??"Domoticz")+"")&&q(i,n),B[0]&8&&m!==(m=(((me=(ce=(ue=T[3].conf)==null?void 0:ue.mqtt)==null?void 0:ce.domoticz)==null?void 0:me.eidx)??"Electricity IDX")+"")&&q(v,m),B[0]&128&&w.value!==T[7].o.e&&V(w,T[7].o.e),B[0]&8&&I!==(I=(((ve=(ke=(pe=T[3].conf)==null?void 0:pe.mqtt)==null?void 0:ke.domoticz)==null?void 0:ve.cidx)??"Current IDX")+"")&&q(L,I),B[0]&128&&E.value!==T[7].o.c&&V(E,T[7].o.c),B[0]&8&&j!==(j=(((Le=(Ee=(De=T[3].conf)==null?void 0:De.mqtt)==null?void 0:Ee.domoticz)==null?void 0:Le.vidx)??"Voltage IDX")+"")&&q(S,j),B[0]&128&&G.value!==T[7].o.u1&&V(G,T[7].o.u1),B[0]&128&&X.value!==T[7].o.u2&&V(X,T[7].o.u2),B[0]&128&&Y.value!==T[7].o.u3&&V(Y,T[7].o.u3)},d(T){T&&N(e),le=!1,Dt($)}}}function ma(t){var U,Y,le,$,z,x,fe,ae,se,_e,oe,ee;let e,l,n=(((le=(Y=(U=t[3].conf)==null?void 0:U.mqtt)==null?void 0:Y.ha)==null?void 0:le.title)??"Home-Assistant")+"",i,s,o,r,f,c,_,d=(((x=(z=($=t[3].conf)==null?void 0:$.mqtt)==null?void 0:z.ha)==null?void 0:x.discovery)??"Discovery topic prefix")+"",m,v,h,g,w,k,A=(((se=(ae=(fe=t[3].conf)==null?void 0:fe.mqtt)==null?void 0:ae.ha)==null?void 0:se.hostname)??"Hostname for URL")+"",I,L,M,O,E,F,H,j=(((ee=(oe=(_e=t[3].conf)==null?void 0:_e.mqtt)==null?void 0:oe.ha)==null?void 0:ee.tag)??"Name tag")+"",S,y,J,G,K,X;return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("a"),o.textContent="ⓘ",r=b(),f=p("input"),c=b(),_=p("div"),m=C(d),v=p("br"),h=b(),g=p("input"),w=b(),k=p("div"),I=C(A),L=p("br"),M=b(),O=p("input"),F=b(),H=p("div"),S=C(j),y=p("br"),J=b(),G=p("input"),u(l,"class","text-sm"),u(o,"href",vl("MQTT-configuration#home-assistant")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","h"),f.value="true",u(g,"name","ht"),u(g,"type","text"),u(g,"class","in-s"),u(g,"placeholder","homeassistant"),u(g,"pattern",Ol),u(_,"class","my-1"),u(O,"name","hh"),u(O,"type","text"),u(O,"class","in-s"),u(O,"placeholder",E=t[7].g.h+".local"),u(O,"pattern",Ol),u(k,"class","my-1"),u(G,"name","hn"),u(G,"type","text"),u(G,"class","in-s"),u(G,"pattern",Ol),u(H,"class","my-1"),u(e,"class","cnt")},m(ne,be){P(ne,e,be),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,m),a(_,v),a(_,h),a(_,g),V(g,t[7].h.t),a(e,w),a(e,k),a(k,I),a(k,L),a(k,M),a(k,O),V(O,t[7].h.h),a(e,F),a(e,H),a(H,S),a(H,y),a(H,J),a(H,G),V(G,t[7].h.n),K||(X=[re(g,"input",t[88]),re(O,"input",t[89]),re(G,"input",t[90])],K=!0)},p(ne,be){var we,R,T,B,D,W,te,ue,ce,me,pe,ke;be[0]&8&&n!==(n=(((T=(R=(we=ne[3].conf)==null?void 0:we.mqtt)==null?void 0:R.ha)==null?void 0:T.title)??"Home-Assistant")+"")&&q(i,n),be[0]&8&&d!==(d=(((W=(D=(B=ne[3].conf)==null?void 0:B.mqtt)==null?void 0:D.ha)==null?void 0:W.discovery)??"Discovery topic prefix")+"")&&q(m,d),be[0]&128&&g.value!==ne[7].h.t&&V(g,ne[7].h.t),be[0]&8&&A!==(A=(((ce=(ue=(te=ne[3].conf)==null?void 0:te.mqtt)==null?void 0:ue.ha)==null?void 0:ce.hostname)??"Hostname for URL")+"")&&q(I,A),be[0]&128&&E!==(E=ne[7].g.h+".local")&&u(O,"placeholder",E),be[0]&128&&O.value!==ne[7].h.h&&V(O,ne[7].h.h),be[0]&8&&j!==(j=(((ke=(pe=(me=ne[3].conf)==null?void 0:me.mqtt)==null?void 0:pe.ha)==null?void 0:ke.tag)??"Name tag")+"")&&q(S,j),be[0]&128&&G.value!==ne[7].h.n&&V(G,ne[7].h.n)},d(ne){ne&&N(e),K=!1,Dt(X)}}}function pa(t){var S,y,J,G,K,X,U,Y,le,$;let e,l,n=(((y=(S=t[3].conf)==null?void 0:S.cloud)==null?void 0:y.title)??"Cloud connections")+"",i,s,o,r,f,c,_=(G=(J=t[0])==null?void 0:J.features)==null?void 0:G.includes("cloud"),d,m,v,h,g,w=(((X=(K=t[3].conf)==null?void 0:K.cloud)==null?void 0:X.es)??"Energy Speedometer")+"",k,A,I,L=(Y=(U=t[0])==null?void 0:U.features)==null?void 0:Y.includes("zc"),M,O,E,F=_&&da(t),H=(($=(le=t[7])==null?void 0:le.c)==null?void 0:$.es)&&ga(t),j=L&&wa(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("a"),o.textContent="ⓘ",r=b(),f=p("input"),c=b(),F&&F.c(),d=b(),m=p("div"),v=p("label"),h=p("input"),g=b(),k=C(w),A=b(),H&&H.c(),I=b(),j&&j.c(),u(l,"class","text-sm"),u(o,"href",vl("Cloud")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","c"),f.value="true",u(h,"type","checkbox"),u(h,"class","rounded mb-1"),u(h,"name","ces"),h.__value="true",V(h,h.__value),u(m,"class","my-1"),u(e,"class","cnt")},m(z,x){P(z,e,x),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),F&&F.m(e,null),a(e,d),a(e,m),a(m,v),a(v,h),h.checked=t[7].c.es,a(v,g),a(v,k),a(m,A),H&&H.m(m,null),a(e,I),j&&j.m(e,null),M=!0,O||(E=re(h,"change",t[93]),O=!0)},p(z,x){var fe,ae,se,_e,oe,ee,ne,be,we,R;(!M||x[0]&8)&&n!==(n=(((ae=(fe=z[3].conf)==null?void 0:fe.cloud)==null?void 0:ae.title)??"Cloud connections")+"")&&q(i,n),x[0]&1&&(_=(_e=(se=z[0])==null?void 0:se.features)==null?void 0:_e.includes("cloud")),_?F?F.p(z,x):(F=da(z),F.c(),F.m(e,d)):F&&(F.d(1),F=null),x[0]&128&&(h.checked=z[7].c.es),(!M||x[0]&8)&&w!==(w=(((ee=(oe=z[3].conf)==null?void 0:oe.cloud)==null?void 0:ee.es)??"Energy Speedometer")+"")&&q(k,w),(be=(ne=z[7])==null?void 0:ne.c)!=null&&be.es?H?(H.p(z,x),x[0]&128&&Z(H,1)):(H=ga(z),H.c(),Z(H,1),H.m(m,null)):H&&(mt(),ie(H,1,1,()=>{H=null}),pt()),x[0]&1&&(L=(R=(we=z[0])==null?void 0:we.features)==null?void 0:R.includes("zc")),L?j?j.p(z,x):(j=wa(z),j.c(),j.m(e,null)):j&&(j.d(1),j=null)},i(z){M||(Z(H),M=!0)},o(z){ie(H),M=!1},d(z){z&&N(e),F&&F.d(),H&&H.d(),j&&j.d(),O=!1,E()}}}function da(t){var d,m;let e,l,n,i,s=(((m=(d=t[3].conf)==null?void 0:d.cloud)==null?void 0:m.ams)??"AMS reader cloud")+"",o,r,f,c,_=t[7].c.e&&ha(t);return{c(){e=p("div"),l=p("label"),n=p("input"),i=b(),o=C(s),r=b(),_&&_.c(),u(n,"type","checkbox"),u(n,"name","ce"),n.__value="true",V(n,n.__value),u(n,"class","rounded mb-1"),u(e,"class","my-1")},m(v,h){P(v,e,h),a(e,l),a(l,n),n.checked=t[7].c.e,a(l,i),a(l,o),a(e,r),_&&_.m(e,null),f||(c=re(n,"change",t[91]),f=!0)},p(v,h){var g,w;h[0]&128&&(n.checked=v[7].c.e),h[0]&8&&s!==(s=(((w=(g=v[3].conf)==null?void 0:g.cloud)==null?void 0:w.ams)??"AMS reader cloud")+"")&&q(o,s),v[7].c.e?_?_.p(v,h):(_=ha(v),_.c(),_.m(e,null)):_&&(_.d(1),_=null)},d(v){v&&N(e),_&&_.d(),f=!1,c()}}}function ha(t){let e,l,n,i,s,o,r,f,c,_,d=t[7].c.p==0&&va(),m=t[6]&&ba(t);return{c(){e=p("div"),l=p("label"),l.textContent="Protocol",n=b(),i=p("select"),d&&d.c(),s=p("option"),s.textContent="TCP",o=p("option"),o.textContent="HTTP",r=b(),m&&m.c(),f=yt(),u(l,"for","cp"),s.__value=1,V(s,s.__value),o.__value=2,V(o,o.__value),u(i,"name","cp"),u(i,"class","in-s"),t[7].c.p===void 0&&qt(()=>t[92].call(i)),u(e,"class","ml-6")},m(v,h){P(v,e,h),a(e,l),a(e,n),a(e,i),d&&d.m(i,null),a(i,s),a(i,o),Xe(i,t[7].c.p,!0),P(v,r,h),m&&m.m(v,h),P(v,f,h),c||(_=re(i,"change",t[92]),c=!0)},p(v,h){v[7].c.p==0?d||(d=va(),d.c(),d.m(i,s)):d&&(d.d(1),d=null),h[0]&128&&Xe(i,v[7].c.p),v[6]?m?m.p(v,h):(m=ba(v),m.c(),m.m(f.parentNode,f)):m&&(m.d(1),m=null)},d(v){v&&(N(e),N(r),N(f)),d&&d.d(),m&&m.d(v),c=!1,_()}}}function va(t){let e;return{c(){e=p("option"),e.textContent="UDP",e.__value=0,V(e,e.__value),u(e,"title","No longer recommended")},m(l,n){P(l,e,n)},d(l){l&&N(e)}}}function ba(t){let e,l,n;return{c(){e=p("button"),e.textContent="Connect device to my cloud account",u(e,"type","button"),u(e,"class","text-blue-500 ml-6")},m(i,s){P(i,e,s),l||(n=re(e,"click",t[23]),l=!0)},p:Ve,d(i){i&&N(e),l=!1,n()}}}function ga(t){let e,l,n=t[0].mac+"",i,s,o,r,f=(t[0].meter.id?t[0].meter.id:"missing, required")+"",c,_,d,m,v=t[0].mac&&t[0].meter.id&&ka(t);return{c(){e=p("div"),l=C("MAC: "),i=C(n),s=b(),o=p("div"),r=C("Meter ID: "),c=C(f),_=b(),v&&v.c(),d=yt(),u(e,"class","pl-5"),u(o,"class","pl-5")},m(h,g){P(h,e,g),a(e,l),a(e,i),P(h,s,g),P(h,o,g),a(o,r),a(o,c),P(h,_,g),v&&v.m(h,g),P(h,d,g),m=!0},p(h,g){(!m||g[0]&1)&&n!==(n=h[0].mac+"")&&q(i,n),(!m||g[0]&1)&&f!==(f=(h[0].meter.id?h[0].meter.id:"missing, required")+"")&&q(c,f),h[0].mac&&h[0].meter.id?v?(v.p(h,g),g[0]&1&&Z(v,1)):(v=ka(h),v.c(),Z(v,1),v.m(d.parentNode,d)):v&&(mt(),ie(v,1,1,()=>{v=null}),pt())},i(h){m||(Z(v),m=!0)},o(h){ie(v),m=!1},d(h){h&&(N(e),N(s),N(o),N(_),N(d)),v&&v.d(h)}}}function ka(t){let e,l,n;return l=new a0({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","pl-2")},m(i,s){P(i,e,s),Se(l,e,null),n=!0},p(i,s){const o={};s[0]&1&&(o.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(o)},i(i){n||(Z(l.$$.fragment,i),n=!0)},o(i){ie(l.$$.fragment,i),n=!1},d(i){i&&N(e),Me(l)}}}function wa(t){let e,l,n,i,s,o,r,f,c=t[7].c.ze&&Ca(t);return{c(){e=p("div"),l=p("label"),n=p("input"),i=C(" ZmartCharge"),s=b(),c&&c.c(),o=yt(),u(n,"type","checkbox"),u(n,"name","cze"),n.__value="true",V(n,n.__value),u(n,"class","rounded mb-1"),u(e,"class","my-1")},m(_,d){P(_,e,d),a(e,l),a(l,n),n.checked=t[7].c.ze,a(l,i),P(_,s,d),c&&c.m(_,d),P(_,o,d),r||(f=re(n,"change",t[94]),r=!0)},p(_,d){d[0]&128&&(n.checked=_[7].c.ze),_[7].c.ze?c?c.p(_,d):(c=Ca(_),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null)},d(_){_&&(N(e),N(s),N(o)),c&&c.d(_),r=!1,f()}}}function Ca(t){let e,l,n,i;return{c(){e=p("div"),l=p("input"),u(l,"name","czt"),u(l,"type","text"),u(l,"class","in-s"),u(l,"placeholder","ZmartCharge token"),u(e,"class","my-1")},m(s,o){P(s,e,o),a(e,l),V(l,t[7].c.zt),n||(i=re(l,"input",t[95]),n=!0)},p(s,o){o[0]&128&&l.value!==s[7].c.zt&&V(l,s[7].c.zt)},d(s){s&&N(e),n=!1,i()}}}function Sa(t){var j,S,y,J,G;let e,l,n=(((S=(j=t[3].conf)==null?void 0:j.thresholds)==null?void 0:S.title)??"Thresholds")+"",i,s,o,r,f,c,_,d,m,v,h=(((J=(y=t[3].conf)==null?void 0:y.thresholds)==null?void 0:J.avg)??"Average of")+"",g,w,k,A,I,L=(((G=t[3].common)==null?void 0:G.hours)??"hours")+"",M,O,E,F=it({length:9}),H=[];for(let K=0;Kt[99].call(w)),u(m,"class","w-1/2"),u(_,"class","flex flex-wrap"),u(e,"class","cnt")},m(S,y){P(S,e,y),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_);for(let J=0;J20&&qa(t),m=((A=(k=(w=t[7])==null?void 0:w.i)==null?void 0:k.d)==null?void 0:A.d)>0&&La(t),v=t[0].chip=="esp8266"&&Oa(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("a"),o.textContent="ⓘ",r=b(),d&&d.c(),f=b(),m&&m.c(),c=b(),v&&v.c(),u(l,"class","text-sm"),u(o,"href",vl("GPIO-configuration")),u(o,"target","_blank"),u(o,"class","float-right"),u(e,"class","cnt")},m(I,L){P(I,e,L),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),d&&d.m(e,null),a(e,f),m&&m.m(e,null),a(e,c),v&&v.m(e,null),_=!0},p(I,L){var M,O,E,F,H;(!_||L[0]&8)&&n!==(n=(((O=(M=I[3].conf)==null?void 0:M.hw)==null?void 0:O.title)??"Hardware")+"")&&q(i,n),I[0].board>20?d?(d.p(I,L),L[0]&1&&Z(d,1)):(d=qa(I),d.c(),Z(d,1),d.m(e,f)):d&&(mt(),ie(d,1,1,()=>{d=null}),pt()),((H=(F=(E=I[7])==null?void 0:E.i)==null?void 0:F.d)==null?void 0:H.d)>0?m?m.p(I,L):(m=La(I),m.c(),m.m(e,c)):m&&(m.d(1),m=null),I[0].chip=="esp8266"?v?v.p(I,L):(v=Oa(I),v.c(),v.m(e,null)):v&&(v.d(1),v=null)},i(I){_||(Z(d),_=!0)},o(I){ie(d),_=!1},d(I){I&&N(e),d&&d.d(),m&&m.d(),v&&v.d()}}}function qa(t){var Lt,Gt,wt,_t,Ht,Qt,Ut,Bt,Yt,$t,Vt,Ft,Fe,Je,Ue,Tt,Ot,Qe,lt,Pt,ot,he,et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae;let e,l,n,i,s=(((wt=(Gt=(Lt=t[3].conf)==null?void 0:Lt.hw)==null?void 0:Gt.han)==null?void 0:wt.rx)??"HAN RX")+"",o,r,f,c,_,d,m,v=(((Qt=(Ht=(_t=t[3].conf)==null?void 0:_t.hw)==null?void 0:Ht.han)==null?void 0:Qt.tx)??"HAN TX")+"",h,g,w,k,A,I,L,M,O,E,F=(((Yt=(Bt=(Ut=t[3].conf)==null?void 0:Ut.hw)==null?void 0:Bt.han)==null?void 0:Yt.pullup)??"pullup")+"",H,j,S,y,J=(((Vt=($t=t[3].conf)==null?void 0:$t.hw)==null?void 0:Vt.ap_btn)??"AP button")+"",G,K,X,U,Y,le,$=(((Je=(Fe=(Ft=t[3].conf)==null?void 0:Ft.hw)==null?void 0:Fe.led)==null?void 0:Je.title)??"LED")+"",z,x,fe,ae,se,_e,oe,ee,ne,be,we=(((Ot=(Tt=(Ue=t[3].conf)==null?void 0:Ue.hw)==null?void 0:Tt.led)==null?void 0:Ot.inverted)??"inverted")+"",R,T,B,D=(((Pt=(lt=(Qe=t[3].conf)==null?void 0:Qe.hw)==null?void 0:lt.led)==null?void 0:Pt.rgb)??"RGB")+"",W,te,ue,ce,me=(((et=(he=(ot=t[3].conf)==null?void 0:ot.hw)==null?void 0:he.led)==null?void 0:et.inverted)??"inverted")+"",pe,ke,ve,De,Ee,Le,Oe,rt,dt,tt,Ze,Be,at=(((el=(xt=(ze=t[3].conf)==null?void 0:ze.hw)==null?void 0:xt.led)==null?void 0:el.disable)??"LED dis. GPIO")+"",Nt,bt,ft,st,ut,Rt=(((ll=(tl=t[3].conf)==null?void 0:tl.hw)==null?void 0:ll.temp)??"Temperature")+"",Ke,Ie,je,$e,de,qe,Ge=(((il=(nl=t[3].conf)==null?void 0:nl.hw)==null?void 0:il.temp_analog)??"Analog temp")+"",ge,Pe,nt,He,At,ht,Re,kt,ct;_=new yi({props:{chip:t[0].chip}}),A=new yi({props:{chip:t[0].chip}});let vt=t[0].chip!="esp8266"&&Da(t),xe=((Ae=(ol=(sl=t[7])==null?void 0:sl.i)==null?void 0:ol.v)==null?void 0:Ae.p)>0&&Aa(t);return{c(){e=p("input"),l=b(),n=p("div"),i=p("div"),o=C(s),r=p("br"),f=b(),c=p("select"),Ne(_.$$.fragment),d=b(),m=p("div"),h=C(v),g=p("br"),w=b(),k=p("select"),Ne(A.$$.fragment),I=b(),L=p("div"),M=p("label"),O=p("input"),E=b(),H=C(F),j=b(),S=p("div"),y=p("div"),G=C(J),K=p("br"),X=b(),U=p("input"),Y=b(),le=p("div"),z=C($),x=p("br"),fe=b(),ae=p("div"),se=p("input"),_e=b(),oe=p("div"),ee=p("label"),ne=p("input"),be=b(),R=C(we),T=b(),B=p("div"),W=C(D),te=p("label"),ue=p("input"),ce=b(),pe=C(me),ke=p("br"),ve=b(),De=p("div"),Ee=p("input"),Le=b(),Oe=p("input"),rt=b(),dt=p("input"),tt=b(),Ze=p("div"),Be=p("div"),Nt=C(at),bt=b(),ft=p("input"),st=b(),ut=p("div"),Ke=C(Rt),Ie=p("br"),je=b(),$e=p("input"),de=b(),qe=p("div"),ge=C(Ge),Pe=p("br"),nt=b(),He=p("input"),At=b(),vt&&vt.c(),ht=b(),xe&&xe.c(),u(e,"type","hidden"),u(e,"name","i"),e.value="true",u(c,"name","ihp"),u(c,"class","in-f w-full"),t[7].i.h.p===void 0&&qt(()=>t[100].call(c)),u(i,"class","w-1/3"),u(k,"name","iht"),u(k,"class","in-l w-full"),t[7].i.h.t===void 0&&qt(()=>t[101].call(k)),u(m,"class","w-1/3"),u(O,"name","ihu"),O.__value="true",V(O,O.__value),u(O,"type","checkbox"),u(O,"class","rounded mb-1"),u(M,"class","ml-2"),u(L,"class","w-1/3"),u(n,"class","flex flex-wrap"),u(U,"name","ia"),u(U,"type","number"),u(U,"min","0"),u(U,"max",t[12]),u(U,"class","in-f tr w-full"),u(y,"class","w-1/3"),u(se,"name","ilp"),u(se,"type","number"),u(se,"min","0"),u(se,"max",t[12]),u(se,"class","in-l tr w-full"),u(ae,"class","flex"),u(le,"class","w-1/3"),u(ne,"name","ili"),ne.__value="true",V(ne,ne.__value),u(ne,"type","checkbox"),u(ne,"class","rounded mb-1"),u(ee,"class","ml-4"),u(oe,"class","w-1/3"),u(ue,"name","iri"),ue.__value="true",V(ue,ue.__value),u(ue,"type","checkbox"),u(ue,"class","rounded mb-1"),u(te,"class","ml-4"),u(Ee,"name","irr"),u(Ee,"type","number"),u(Ee,"min","0"),u(Ee,"max",t[12]),u(Ee,"class","in-f tr w-1/3"),u(Oe,"name","irg"),u(Oe,"type","number"),u(Oe,"min","0"),u(Oe,"max",t[12]),u(Oe,"class","in-m tr w-1/3"),u(dt,"name","irb"),u(dt,"type","number"),u(dt,"min","0"),u(dt,"max",t[12]),u(dt,"class","in-l tr w-1/3"),u(De,"class","flex"),u(B,"class","w-full"),u(ft,"name","idd"),u(ft,"type","number"),u(ft,"min","0"),u(ft,"max",t[12]),u(ft,"class","in-s tr"),u(Be,"class","my-1 pr-1 w-1/3"),u(Ze,"class","w-full"),u($e,"name","itd"),u($e,"type","number"),u($e,"min","0"),u($e,"max",t[12]),u($e,"class","in-f tr w-full"),u(ut,"class","my-1 w-1/3"),u(He,"name","ita"),u(He,"type","number"),u(He,"min","0"),u(He,"max",t[12]),u(He,"class","in-l tr w-full"),u(qe,"class","my-1 pr-1 w-1/3"),u(S,"class","flex flex-wrap")},m(Q,Ce){P(Q,e,Ce),P(Q,l,Ce),P(Q,n,Ce),a(n,i),a(i,o),a(i,r),a(i,f),a(i,c),Se(_,c,null),Xe(c,t[7].i.h.p,!0),a(n,d),a(n,m),a(m,h),a(m,g),a(m,w),a(m,k),Se(A,k,null),Xe(k,t[7].i.h.t,!0),a(n,I),a(n,L),a(L,M),a(M,O),O.checked=t[7].i.h.u,a(M,E),a(M,H),P(Q,j,Ce),P(Q,S,Ce),a(S,y),a(y,G),a(y,K),a(y,X),a(y,U),V(U,t[7].i.a),a(S,Y),a(S,le),a(le,z),a(le,x),a(le,fe),a(le,ae),a(ae,se),V(se,t[7].i.l.p),a(S,_e),a(S,oe),a(oe,ee),a(ee,ne),ne.checked=t[7].i.l.i,a(ee,be),a(ee,R),a(S,T),a(S,B),a(B,W),a(B,te),a(te,ue),ue.checked=t[7].i.r.i,a(te,ce),a(te,pe),a(B,ke),a(B,ve),a(B,De),a(De,Ee),V(Ee,t[7].i.r.r),a(De,Le),a(De,Oe),V(Oe,t[7].i.r.g),a(De,rt),a(De,dt),V(dt,t[7].i.r.b),a(S,tt),a(S,Ze),a(Ze,Be),a(Be,Nt),a(Be,bt),a(Be,ft),V(ft,t[7].i.d.d),a(S,st),a(S,ut),a(ut,Ke),a(ut,Ie),a(ut,je),a(ut,$e),V($e,t[7].i.t.d),a(S,de),a(S,qe),a(qe,ge),a(qe,Pe),a(qe,nt),a(qe,He),V(He,t[7].i.t.a),a(S,At),vt&&vt.m(S,null),a(S,ht),xe&&xe.m(S,null),Re=!0,kt||(ct=[re(c,"change",t[100]),re(k,"change",t[101]),re(O,"change",t[102]),re(U,"input",t[103]),re(se,"input",t[104]),re(ne,"change",t[105]),re(ue,"change",t[106]),re(Ee,"input",t[107]),re(Oe,"input",t[108]),re(dt,"input",t[109]),re(ft,"input",t[110]),re($e,"input",t[111]),re(He,"input",t[112])],kt=!0)},p(Q,Ce){var ml,Jt,pl,dl,Cl,Sl,Ml,Rl,Fl,Ul,We,Te,Et,ul,Bl,yl,jl,zl,Hl,Wl,Gl,Vl,Kl,Yl,Xl,Ql,Zl,Jl,$l,xl,en,tn,ln;(!Re||Ce[0]&8)&&s!==(s=(((pl=(Jt=(ml=Q[3].conf)==null?void 0:ml.hw)==null?void 0:Jt.han)==null?void 0:pl.rx)??"HAN RX")+"")&&q(o,s);const Kt={};Ce[0]&1&&(Kt.chip=Q[0].chip),_.$set(Kt),Ce[0]&128&&Xe(c,Q[7].i.h.p),(!Re||Ce[0]&8)&&v!==(v=(((Sl=(Cl=(dl=Q[3].conf)==null?void 0:dl.hw)==null?void 0:Cl.han)==null?void 0:Sl.tx)??"HAN TX")+"")&&q(h,v);const fl={};Ce[0]&1&&(fl.chip=Q[0].chip),A.$set(fl),Ce[0]&128&&Xe(k,Q[7].i.h.t),Ce[0]&128&&(O.checked=Q[7].i.h.u),(!Re||Ce[0]&8)&&F!==(F=(((Fl=(Rl=(Ml=Q[3].conf)==null?void 0:Ml.hw)==null?void 0:Rl.han)==null?void 0:Fl.pullup)??"pullup")+"")&&q(H,F),(!Re||Ce[0]&8)&&J!==(J=(((We=(Ul=Q[3].conf)==null?void 0:Ul.hw)==null?void 0:We.ap_btn)??"AP button")+"")&&q(G,J),(!Re||Ce[0]&4096)&&u(U,"max",Q[12]),Ce[0]&128&&ye(U.value)!==Q[7].i.a&&V(U,Q[7].i.a),(!Re||Ce[0]&8)&&$!==($=(((ul=(Et=(Te=Q[3].conf)==null?void 0:Te.hw)==null?void 0:Et.led)==null?void 0:ul.title)??"LED")+"")&&q(z,$),(!Re||Ce[0]&4096)&&u(se,"max",Q[12]),Ce[0]&128&&ye(se.value)!==Q[7].i.l.p&&V(se,Q[7].i.l.p),Ce[0]&128&&(ne.checked=Q[7].i.l.i),(!Re||Ce[0]&8)&&we!==(we=(((jl=(yl=(Bl=Q[3].conf)==null?void 0:Bl.hw)==null?void 0:yl.led)==null?void 0:jl.inverted)??"inverted")+"")&&q(R,we),(!Re||Ce[0]&8)&&D!==(D=(((Wl=(Hl=(zl=Q[3].conf)==null?void 0:zl.hw)==null?void 0:Hl.led)==null?void 0:Wl.rgb)??"RGB")+"")&&q(W,D),Ce[0]&128&&(ue.checked=Q[7].i.r.i),(!Re||Ce[0]&8)&&me!==(me=(((Kl=(Vl=(Gl=Q[3].conf)==null?void 0:Gl.hw)==null?void 0:Vl.led)==null?void 0:Kl.inverted)??"inverted")+"")&&q(pe,me),(!Re||Ce[0]&4096)&&u(Ee,"max",Q[12]),Ce[0]&128&&ye(Ee.value)!==Q[7].i.r.r&&V(Ee,Q[7].i.r.r),(!Re||Ce[0]&4096)&&u(Oe,"max",Q[12]),Ce[0]&128&&ye(Oe.value)!==Q[7].i.r.g&&V(Oe,Q[7].i.r.g),(!Re||Ce[0]&4096)&&u(dt,"max",Q[12]),Ce[0]&128&&ye(dt.value)!==Q[7].i.r.b&&V(dt,Q[7].i.r.b),(!Re||Ce[0]&8)&&at!==(at=(((Ql=(Xl=(Yl=Q[3].conf)==null?void 0:Yl.hw)==null?void 0:Xl.led)==null?void 0:Ql.disable)??"LED dis. GPIO")+"")&&q(Nt,at),(!Re||Ce[0]&4096)&&u(ft,"max",Q[12]),Ce[0]&128&&ye(ft.value)!==Q[7].i.d.d&&V(ft,Q[7].i.d.d),(!Re||Ce[0]&8)&&Rt!==(Rt=(((Jl=(Zl=Q[3].conf)==null?void 0:Zl.hw)==null?void 0:Jl.temp)??"Temperature")+"")&&q(Ke,Rt),(!Re||Ce[0]&4096)&&u($e,"max",Q[12]),Ce[0]&128&&ye($e.value)!==Q[7].i.t.d&&V($e,Q[7].i.t.d),(!Re||Ce[0]&8)&&Ge!==(Ge=(((xl=($l=Q[3].conf)==null?void 0:$l.hw)==null?void 0:xl.temp_analog)??"Analog temp")+"")&&q(ge,Ge),(!Re||Ce[0]&4096)&&u(He,"max",Q[12]),Ce[0]&128&&ye(He.value)!==Q[7].i.t.a&&V(He,Q[7].i.t.a),Q[0].chip!="esp8266"?vt?vt.p(Q,Ce):(vt=Da(Q),vt.c(),vt.m(S,ht)):vt&&(vt.d(1),vt=null),((ln=(tn=(en=Q[7])==null?void 0:en.i)==null?void 0:tn.v)==null?void 0:ln.p)>0?xe?xe.p(Q,Ce):(xe=Aa(Q),xe.c(),xe.m(S,null)):xe&&(xe.d(1),xe=null)},i(Q){Re||(Z(_.$$.fragment,Q),Z(A.$$.fragment,Q),Re=!0)},o(Q){ie(_.$$.fragment,Q),ie(A.$$.fragment,Q),Re=!1},d(Q){Q&&(N(e),N(l),N(n),N(j),N(S)),Me(_),Me(A),vt&&vt.d(),xe&&xe.d(),kt=!1,Dt(ct)}}}function Da(t){var c,_,d;let e,l=(((d=(_=(c=t[3].conf)==null?void 0:c.hw)==null?void 0:_.vcc)==null?void 0:d.title)??"Vcc")+"",n,i,s,o,r,f;return{c(){e=p("div"),n=C(l),i=p("br"),s=b(),o=p("input"),u(o,"name","ivp"),u(o,"type","number"),u(o,"min","0"),u(o,"max",t[12]),u(o,"class","in-s tr w-full"),u(e,"class","my-1 pl-1 w-1/3")},m(m,v){P(m,e,v),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].i.v.p),r||(f=re(o,"input",t[113]),r=!0)},p(m,v){var h,g,w;v[0]&8&&l!==(l=(((w=(g=(h=m[3].conf)==null?void 0:h.hw)==null?void 0:g.vcc)==null?void 0:w.title)??"Vcc")+"")&&q(n,l),v[0]&4096&&u(o,"max",m[12]),v[0]&128&&ye(o.value)!==m[7].i.v.p&&V(o,m[7].i.v.p)},d(m){m&&N(e),r=!1,f()}}}function Aa(t){var h,g,w;let e,l=(((w=(g=(h=t[3].conf)==null?void 0:h.hw)==null?void 0:g.vcc)==null?void 0:w.divider)??"Voltage divider")+"",n,i,s,o,r,f,c,_,d,m,v;return{c(){var k,A,I,L,M,O;e=p("div"),n=C(l),i=p("br"),s=b(),o=p("div"),r=p("input"),c=b(),_=p("input"),u(r,"name","ivdv"),u(r,"type","number"),u(r,"min","0"),u(r,"max","65535"),u(r,"class","in-f tr w-full"),u(r,"placeholder",f=((I=(A=(k=t[3].conf)==null?void 0:k.hw)==null?void 0:A.vcc)==null?void 0:I.div_vcc)??"VCC"),u(_,"name","ivdg"),u(_,"type","number"),u(_,"min","0"),u(_,"max","65535"),u(_,"class","in-l tr w-full"),u(_,"placeholder",d=((O=(M=(L=t[3].conf)==null?void 0:L.hw)==null?void 0:M.vcc)==null?void 0:O.div_gnd)??"GND"),u(o,"class","flex"),u(e,"class","my-1")},m(k,A){P(k,e,A),a(e,n),a(e,i),a(e,s),a(e,o),a(o,r),V(r,t[7].i.v.d.v),a(o,c),a(o,_),V(_,t[7].i.v.d.g),m||(v=[re(r,"input",t[114]),re(_,"input",t[115])],m=!0)},p(k,A){var I,L,M,O,E,F,H,j,S;A[0]&8&&l!==(l=(((M=(L=(I=k[3].conf)==null?void 0:I.hw)==null?void 0:L.vcc)==null?void 0:M.divider)??"Voltage divider")+"")&&q(n,l),A[0]&8&&f!==(f=((F=(E=(O=k[3].conf)==null?void 0:O.hw)==null?void 0:E.vcc)==null?void 0:F.div_vcc)??"VCC")&&u(r,"placeholder",f),A[0]&128&&ye(r.value)!==k[7].i.v.d.v&&V(r,k[7].i.v.d.v),A[0]&8&&d!==(d=((S=(j=(H=k[3].conf)==null?void 0:H.hw)==null?void 0:j.vcc)==null?void 0:S.div_gnd)??"GND")&&u(_,"placeholder",d),A[0]&128&&ye(_.value)!==k[7].i.v.d.g&&V(_,k[7].i.v.d.g)},d(k){k&&N(e),m=!1,Dt(v)}}}function La(t){var h,g,w,k,A,I,L,M,O,E,F,H;let e,l=(((k=(w=(g=(h=t[3].conf)==null?void 0:h.hw)==null?void 0:g.led)==null?void 0:w.behaviour)==null?void 0:k.title)??"LED behaviour")+"",n,i,s,o,r=(((M=(L=(I=(A=t[3].conf)==null?void 0:A.hw)==null?void 0:I.led)==null?void 0:L.behaviour)==null?void 0:M.enabled)??"Enabled")+"",f,c,_=(((H=(F=(E=(O=t[3].conf)==null?void 0:O.hw)==null?void 0:E.led)==null?void 0:F.behaviour)==null?void 0:H.disabled)??"Disabled")+"",d,m,v;return{c(){e=p("div"),n=C(l),i=b(),s=p("select"),o=p("option"),f=C(r),c=p("option"),d=C(_),o.__value=0,V(o,o.__value),c.__value=1,V(c,c.__value),u(s,"name","idb"),u(s,"class","in-s"),t[7].i.d.b===void 0&&qt(()=>t[116].call(s)),u(e,"class","my-1 w-full")},m(j,S){P(j,e,S),a(e,n),a(e,i),a(e,s),a(s,o),a(o,f),a(s,c),a(c,d),Xe(s,t[7].i.d.b,!0),m||(v=re(s,"change",t[116]),m=!0)},p(j,S){var y,J,G,K,X,U,Y,le,$,z,x,fe;S[0]&8&&l!==(l=(((K=(G=(J=(y=j[3].conf)==null?void 0:y.hw)==null?void 0:J.led)==null?void 0:G.behaviour)==null?void 0:K.title)??"LED behaviour")+"")&&q(n,l),S[0]&8&&r!==(r=(((le=(Y=(U=(X=j[3].conf)==null?void 0:X.hw)==null?void 0:U.led)==null?void 0:Y.behaviour)==null?void 0:le.enabled)??"Enabled")+"")&&q(f,r),S[0]&8&&_!==(_=(((fe=(x=(z=($=j[3].conf)==null?void 0:$.hw)==null?void 0:z.led)==null?void 0:x.behaviour)==null?void 0:fe.disabled)??"Disabled")+"")&&q(d,_),S[0]&128&&Xe(s,j[7].i.d.b)},d(j){j&&N(e),m=!1,v()}}}function Oa(t){var M,O,E,F,H,j;let e,l,n,i,s=(((E=(O=(M=t[3].conf)==null?void 0:M.hw)==null?void 0:O.vcc)==null?void 0:E.offset)??"Vcc offset")+"",o,r,f,c,_,d,m=(((j=(H=(F=t[3].conf)==null?void 0:F.hw)==null?void 0:H.vcc)==null?void 0:j.multiplier)??"Multiplier")+"",v,h,g,w,k,A,I,L=(t[0].board==2||t[0].board==100)&&Ia(t);return{c(){e=p("input"),l=b(),n=p("div"),i=p("div"),o=C(s),r=p("br"),f=b(),c=p("input"),_=b(),d=p("div"),v=C(m),h=p("br"),g=b(),w=p("input"),k=b(),L&&L.c(),u(e,"type","hidden"),u(e,"name","iv"),e.value="true",u(c,"name","ivo"),u(c,"type","number"),u(c,"min","0.0"),u(c,"max","3.5"),u(c,"step","0.01"),u(c,"class","in-f tr w-full"),u(i,"class","w-1/3"),u(w,"name","ivm"),u(w,"type","number"),u(w,"min","0.1"),u(w,"max","10"),u(w,"step","0.01"),u(w,"class","in-l tr w-full"),u(d,"class","w-1/3 pr-1"),u(n,"class","my-1 flex flex-wrap")},m(S,y){P(S,e,y),P(S,l,y),P(S,n,y),a(n,i),a(i,o),a(i,r),a(i,f),a(i,c),V(c,t[7].i.v.o),a(n,_),a(n,d),a(d,v),a(d,h),a(d,g),a(d,w),V(w,t[7].i.v.m),a(n,k),L&&L.m(n,null),A||(I=[re(c,"input",t[117]),re(w,"input",t[118])],A=!0)},p(S,y){var J,G,K,X,U,Y;y[0]&8&&s!==(s=(((K=(G=(J=S[3].conf)==null?void 0:J.hw)==null?void 0:G.vcc)==null?void 0:K.offset)??"Vcc offset")+"")&&q(o,s),y[0]&128&&ye(c.value)!==S[7].i.v.o&&V(c,S[7].i.v.o),y[0]&8&&m!==(m=(((Y=(U=(X=S[3].conf)==null?void 0:X.hw)==null?void 0:U.vcc)==null?void 0:Y.multiplier)??"Multiplier")+"")&&q(v,m),y[0]&128&&ye(w.value)!==S[7].i.v.m&&V(w,S[7].i.v.m),S[0].board==2||S[0].board==100?L?L.p(S,y):(L=Ia(S),L.c(),L.m(n,null)):L&&(L.d(1),L=null)},d(S){S&&(N(e),N(l),N(n)),L&&L.d(),A=!1,Dt(I)}}}function Ia(t){var c,_,d;let e,l=(((d=(_=(c=t[3].conf)==null?void 0:c.hw)==null?void 0:_.vcc)==null?void 0:d.boot)??"Boot limit")+"",n,i,s,o,r,f;return{c(){e=p("div"),n=C(l),i=p("br"),s=b(),o=p("input"),u(o,"name","ivb"),u(o,"type","number"),u(o,"min","2.5"),u(o,"max","3.5"),u(o,"step","0.1"),u(o,"class","in-s tr w-full"),u(e,"class","w-1/3 pl-1")},m(m,v){P(m,e,v),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].i.v.b),r||(f=re(o,"input",t[119]),r=!0)},p(m,v){var h,g,w;v[0]&8&&l!==(l=(((w=(g=(h=m[3].conf)==null?void 0:h.hw)==null?void 0:g.vcc)==null?void 0:w.boot)??"Boot limit")+"")&&q(n,l),v[0]&128&&ye(o.value)!==m[7].i.v.b&&V(o,m[7].i.v.b)},d(m){m&&N(e),r=!1,f()}}}function Ra(t){var L,M,O,E,F,H;let e,l,n=(((M=(L=t[3].conf)==null?void 0:L.debug)==null?void 0:M.title)??"Debugging")+"",i,s,o,r,f,c,_,d,m,v,h=(((E=(O=t[3].conf)==null?void 0:O.debug)==null?void 0:E.enable)??"Enable debugging")+"",g,w,k,A,I=((H=(F=t[7])==null?void 0:F.d)==null?void 0:H.s)&&Fa(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("a"),o.textContent="ⓘ",r=b(),f=p("input"),c=b(),_=p("div"),d=p("label"),m=p("input"),v=b(),g=C(h),w=b(),I&&I.c(),u(l,"class","text-sm"),u(o,"href","https://amsleser.no/blog/post/24-telnet-debug"),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","d"),f.value="true",u(m,"type","checkbox"),u(m,"name","ds"),m.__value="true",V(m,m.__value),u(m,"class","rounded mb-1"),u(_,"class","mt-3"),u(e,"class","cnt")},m(j,S){P(j,e,S),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,d),a(d,m),m.checked=t[7].d.s,a(d,v),a(d,g),a(e,w),I&&I.m(e,null),k||(A=re(m,"change",t[120]),k=!0)},p(j,S){var y,J,G,K,X,U;S[0]&8&&n!==(n=(((J=(y=j[3].conf)==null?void 0:y.debug)==null?void 0:J.title)??"Debugging")+"")&&q(i,n),S[0]&128&&(m.checked=j[7].d.s),S[0]&8&&h!==(h=(((K=(G=j[3].conf)==null?void 0:G.debug)==null?void 0:K.enable)??"Enable debugging")+"")&&q(g,h),(U=(X=j[7])==null?void 0:X.d)!=null&&U.s?I?I.p(j,S):(I=Fa(j),I.c(),I.m(e,null)):I&&(I.d(1),I=null)},d(j){j&&N(e),I&&I.d(),k=!1,A()}}}function Fa(t){var O,E,F,H;let e,l=(((E=(O=t[3].conf)==null?void 0:O.debug)==null?void 0:E.danger)??"Disable when done")+"",n,i,s,o,r,f,c=(((H=(F=t[3].conf)==null?void 0:F.debug)==null?void 0:H.telnet)??"Enable telnet")+"",_,d,m,v,h,g,w,k,A,I,L,M=t[7].d.t&&Ua(t);return{c(){e=p("div"),n=C(l),i=b(),s=p("div"),o=p("label"),r=p("input"),f=b(),_=C(c),d=b(),M&&M.c(),m=b(),v=p("div"),h=p("select"),g=p("option"),g.textContent="Verbose",w=p("option"),w.textContent="Debug",k=p("option"),k.textContent="Info",A=p("option"),A.textContent="Warning",u(e,"class","bd-red"),u(r,"type","checkbox"),u(r,"name","dt"),r.__value="true",V(r,r.__value),u(r,"class","rounded mb-1"),u(s,"class","my-1"),g.__value=1,V(g,g.__value),w.__value=2,V(w,w.__value),k.__value=3,V(k,k.__value),A.__value=4,V(A,A.__value),u(h,"name","dl"),u(h,"class","in-s"),t[7].d.l===void 0&&qt(()=>t[122].call(h)),u(v,"class","my-1")},m(j,S){P(j,e,S),a(e,n),P(j,i,S),P(j,s,S),a(s,o),a(o,r),r.checked=t[7].d.t,a(o,f),a(o,_),P(j,d,S),M&&M.m(j,S),P(j,m,S),P(j,v,S),a(v,h),a(h,g),a(h,w),a(h,k),a(h,A),Xe(h,t[7].d.l,!0),I||(L=[re(r,"change",t[121]),re(h,"change",t[122])],I=!0)},p(j,S){var y,J,G,K;S[0]&8&&l!==(l=(((J=(y=j[3].conf)==null?void 0:y.debug)==null?void 0:J.danger)??"Disable when done")+"")&&q(n,l),S[0]&128&&(r.checked=j[7].d.t),S[0]&8&&c!==(c=(((K=(G=j[3].conf)==null?void 0:G.debug)==null?void 0:K.telnet)??"Enable telnet")+"")&&q(_,c),j[7].d.t?M?M.p(j,S):(M=Ua(j),M.c(),M.m(m.parentNode,m)):M&&(M.d(1),M=null),S[0]&128&&Xe(h,j[7].d.l)},d(j){j&&(N(e),N(i),N(s),N(d),N(m),N(v)),M&&M.d(j),I=!1,Dt(L)}}}function Ua(t){var i,s;let e,l=(((s=(i=t[3].conf)==null?void 0:i.debug)==null?void 0:s.telnet_danger)??"Disable when done")+"",n;return{c(){e=p("div"),n=C(l),u(e,"class","bd-red")},m(o,r){P(o,e,r),a(e,n)},p(o,r){var f,c;r[0]&8&&l!==(l=(((c=(f=o[3].conf)==null?void 0:f.debug)==null?void 0:c.telnet_danger)??"Disable when done")+"")&&q(n,l)},d(o){o&&N(e)}}}function Ba(t){var m,v;let e,l,n=(((m=t[3].conf)==null?void 0:m.btn_reset)??"Factory reset")+"",i,s,o,r,f=(((v=t[3].btn)==null?void 0:v.reboot)??"Reboot")+"",c,_,d;return{c(){e=p("div"),l=p("button"),i=C(n),s=b(),o=p("div"),r=p("button"),c=C(f),u(l,"type","button"),u(l,"class","btn-red"),u(r,"type","button"),u(r,"class","btn-yellow"),u(o,"class","text-center")},m(h,g){P(h,e,g),a(e,l),a(l,i),P(h,s,g),P(h,o,g),a(o,r),a(r,c),_||(d=[re(l,"click",t[14]),re(r,"click",t[16])],_=!0)},p(h,g){var w,k;g[0]&8&&n!==(n=(((w=h[3].conf)==null?void 0:w.btn_reset)??"Factory reset")+"")&&q(i,n),g[0]&8&&f!==(f=(((k=h[3].btn)==null?void 0:k.reboot)??"Reboot")+"")&&q(c,f)},d(h){h&&(N(e),N(s),N(o)),_=!1,Dt(d)}}}function ya(t){var s;let e,l,n=(((s=t[3].btn)==null?void 0:s.save)??"Save")+"",i;return{c(){e=p("div"),l=p("button"),i=C(n),u(l,"type","submit"),u(l,"class","btn-pri"),u(e,"class","text-right")},m(o,r){P(o,e,r),a(e,l),a(l,i)},p(o,r){var f;r[0]&8&&n!==(n=(((f=o[3].btn)==null?void 0:f.save)??"Save")+"")&&q(i,n)},d(o){o&&N(e)}}}function q0(t){var ee,ne,be,we,R,T,B,D,W,te,ue,ce,me,pe,ke,ve,De,Ee,Le,Oe,rt,dt,tt,Ze,Be,at,Nt,bt,ft,st,ut,Rt,Ke,Ie,je,$e,de,qe,Ge;let e,l,n,i,s,o,r,f,c,_,d=((be=(ne=(ee=t[7])==null?void 0:ee.p)==null?void 0:ne.r)==null?void 0:be.startsWith("NO"))||((T=(R=(we=t[7])==null?void 0:we.p)==null?void 0:R.r)==null?void 0:T.startsWith("10YNO"))||((W=(D=(B=t[7])==null?void 0:B.p)==null?void 0:D.r)==null?void 0:W.startsWith("10Y1001A1001A4")),m,v,h,g=((te=t[7])==null?void 0:te.d)&&((ce=(ue=t[0])==null?void 0:ue.features)==null?void 0:ce.includes("rdebug")),w,k,A,I,L,M,O,E,F,H,j,S,y,J,G=((me=t[7])==null?void 0:me.g)&&Ko(t),K=((pe=t[7])==null?void 0:pe.m)&&Zo(t),X=((ke=t[7])==null?void 0:ke.w)&&ta(t),U=((ve=t[7])==null?void 0:ve.n)&&aa(t),Y=((De=t[7])==null?void 0:De.q)&&ua(t),le=((Le=(Ee=t[7])==null?void 0:Ee.q)==null?void 0:Le.m)==3&&_a(t),$=((rt=(Oe=t[7])==null?void 0:Oe.q)==null?void 0:rt.m)==4&&ma(t),z=((dt=t[7])==null?void 0:dt.c)&&pa(t),x=d&&Sa(t),fe=((tt=t[7])==null?void 0:tt.u)&&Na(t),ae=((Be=(Ze=t[7])==null?void 0:Ze.i)==null?void 0:Be.h)&&(((at=t[0])==null?void 0:at.board)>20||((Nt=t[0])==null?void 0:Nt.chip)=="esp8266"||((st=(ft=(bt=t[7])==null?void 0:bt.i)==null?void 0:ft.d)==null?void 0:st.d)>0)&&Ea(t),se=g&&Ra(t),_e=((ut=t[1])==null?void 0:ut.a)&&Ba(t),oe=t[7]&&ya(t);return L=new cl({props:{active:t[4],message:((Ke=(Rt=t[3].conf)==null?void 0:Rt.mask)==null?void 0:Ke.loading)??"Loading"}}),O=new cl({props:{active:t[5],message:((je=(Ie=t[3].conf)==null?void 0:Ie.mask)==null?void 0:je.saving)??"Saving"}}),F=new cl({props:{active:t[10],message:((de=($e=t[3].conf)==null?void 0:$e.mask)==null?void 0:de.reset)??"Factory reset"}}),j=new cl({props:{active:t[11],message:((Ge=(qe=t[3].conf)==null?void 0:qe.mask)==null?void 0:Ge.reset_done)??"Done"}}),{c(){e=p("form"),l=p("div"),G&&G.c(),n=b(),K&&K.c(),i=b(),X&&X.c(),s=b(),U&&U.c(),o=b(),Y&&Y.c(),r=b(),le&&le.c(),f=b(),$&&$.c(),c=b(),z&&z.c(),_=b(),x&&x.c(),m=b(),fe&&fe.c(),v=b(),ae&&ae.c(),h=b(),se&&se.c(),w=b(),k=p("div"),_e&&_e.c(),A=b(),oe&&oe.c(),I=b(),Ne(L.$$.fragment),M=b(),Ne(O.$$.fragment),E=b(),Ne(F.$$.fragment),H=b(),Ne(j.$$.fragment),u(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),u(k,"class","grid grid-cols-3 mt-3"),u(e,"autocomplete","off")},m(ge,Pe){P(ge,e,Pe),a(e,l),G&&G.m(l,null),a(l,n),K&&K.m(l,null),a(l,i),X&&X.m(l,null),a(l,s),U&&U.m(l,null),a(l,o),Y&&Y.m(l,null),a(l,r),le&&le.m(l,null),a(l,f),$&&$.m(l,null),a(l,c),z&&z.m(l,null),a(l,_),x&&x.m(l,null),a(l,m),fe&&fe.m(l,null),a(l,v),ae&&ae.m(l,null),a(l,h),se&&se.m(l,null),a(e,w),a(e,k),_e&&_e.m(k,null),a(k,A),oe&&oe.m(k,null),P(ge,I,Pe),Se(L,ge,Pe),P(ge,M,Pe),Se(O,ge,Pe),P(ge,E,Pe),Se(F,ge,Pe),P(ge,H,Pe),Se(j,ge,Pe),S=!0,y||(J=re(e,"submit",_n(t[15])),y=!0)},p(ge,Pe){var Re,kt,ct,vt,xe,Lt,Gt,wt,_t,Ht,Qt,Ut,Bt,Yt,$t,Vt,Ft,Fe,Je,Ue,Tt,Ot,Qe,lt,Pt,ot,he,et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae,Q;(Re=ge[7])!=null&&Re.g?G?(G.p(ge,Pe),Pe[0]&128&&Z(G,1)):(G=Ko(ge),G.c(),Z(G,1),G.m(l,n)):G&&(mt(),ie(G,1,1,()=>{G=null}),pt()),(kt=ge[7])!=null&&kt.m?K?K.p(ge,Pe):(K=Zo(ge),K.c(),K.m(l,i)):K&&(K.d(1),K=null),(ct=ge[7])!=null&&ct.w?X?X.p(ge,Pe):(X=ta(ge),X.c(),X.m(l,s)):X&&(X.d(1),X=null),(vt=ge[7])!=null&&vt.n?U?(U.p(ge,Pe),Pe[0]&128&&Z(U,1)):(U=aa(ge),U.c(),Z(U,1),U.m(l,o)):U&&(mt(),ie(U,1,1,()=>{U=null}),pt()),(xe=ge[7])!=null&&xe.q?Y?(Y.p(ge,Pe),Pe[0]&128&&Z(Y,1)):(Y=ua(ge),Y.c(),Z(Y,1),Y.m(l,r)):Y&&(mt(),ie(Y,1,1,()=>{Y=null}),pt()),((Gt=(Lt=ge[7])==null?void 0:Lt.q)==null?void 0:Gt.m)==3?le?le.p(ge,Pe):(le=_a(ge),le.c(),le.m(l,f)):le&&(le.d(1),le=null),((_t=(wt=ge[7])==null?void 0:wt.q)==null?void 0:_t.m)==4?$?$.p(ge,Pe):($=ma(ge),$.c(),$.m(l,c)):$&&($.d(1),$=null),(Ht=ge[7])!=null&&Ht.c?z?(z.p(ge,Pe),Pe[0]&128&&Z(z,1)):(z=pa(ge),z.c(),Z(z,1),z.m(l,_)):z&&(mt(),ie(z,1,1,()=>{z=null}),pt()),Pe[0]&128&&(d=((Bt=(Ut=(Qt=ge[7])==null?void 0:Qt.p)==null?void 0:Ut.r)==null?void 0:Bt.startsWith("NO"))||((Vt=($t=(Yt=ge[7])==null?void 0:Yt.p)==null?void 0:$t.r)==null?void 0:Vt.startsWith("10YNO"))||((Je=(Fe=(Ft=ge[7])==null?void 0:Ft.p)==null?void 0:Fe.r)==null?void 0:Je.startsWith("10Y1001A1001A4"))),d?x?x.p(ge,Pe):(x=Sa(ge),x.c(),x.m(l,m)):x&&(x.d(1),x=null),(Ue=ge[7])!=null&&Ue.u?fe?fe.p(ge,Pe):(fe=Na(ge),fe.c(),fe.m(l,v)):fe&&(fe.d(1),fe=null),(Ot=(Tt=ge[7])==null?void 0:Tt.i)!=null&&Ot.h&&(((Qe=ge[0])==null?void 0:Qe.board)>20||((lt=ge[0])==null?void 0:lt.chip)=="esp8266"||((he=(ot=(Pt=ge[7])==null?void 0:Pt.i)==null?void 0:ot.d)==null?void 0:he.d)>0)?ae?(ae.p(ge,Pe),Pe[0]&129&&Z(ae,1)):(ae=Ea(ge),ae.c(),Z(ae,1),ae.m(l,h)):ae&&(mt(),ie(ae,1,1,()=>{ae=null}),pt()),Pe[0]&129&&(g=((et=ge[7])==null?void 0:et.d)&&((xt=(ze=ge[0])==null?void 0:ze.features)==null?void 0:xt.includes("rdebug"))),g?se?se.p(ge,Pe):(se=Ra(ge),se.c(),se.m(l,null)):se&&(se.d(1),se=null),(el=ge[1])!=null&&el.a?_e?_e.p(ge,Pe):(_e=Ba(ge),_e.c(),_e.m(k,A)):_e&&(_e.d(1),_e=null),ge[7]?oe?oe.p(ge,Pe):(oe=ya(ge),oe.c(),oe.m(k,null)):oe&&(oe.d(1),oe=null);const nt={};Pe[0]&16&&(nt.active=ge[4]),Pe[0]&8&&(nt.message=((ll=(tl=ge[3].conf)==null?void 0:tl.mask)==null?void 0:ll.loading)??"Loading"),L.$set(nt);const He={};Pe[0]&32&&(He.active=ge[5]),Pe[0]&8&&(He.message=((il=(nl=ge[3].conf)==null?void 0:nl.mask)==null?void 0:il.saving)??"Saving"),O.$set(He);const At={};Pe[0]&1024&&(At.active=ge[10]),Pe[0]&8&&(At.message=((ol=(sl=ge[3].conf)==null?void 0:sl.mask)==null?void 0:ol.reset)??"Factory reset"),F.$set(At);const ht={};Pe[0]&2048&&(ht.active=ge[11]),Pe[0]&8&&(ht.message=((Q=(Ae=ge[3].conf)==null?void 0:Ae.mask)==null?void 0:Q.reset_done)??"Done"),j.$set(ht)},i(ge){S||(Z(G),Z(U),Z(Y),Z(z),Z(ae),Z(L.$$.fragment,ge),Z(O.$$.fragment,ge),Z(F.$$.fragment,ge),Z(j.$$.fragment,ge),S=!0)},o(ge){ie(G),ie(U),ie(Y),ie(z),ie(ae),ie(L.$$.fragment,ge),ie(O.$$.fragment,ge),ie(F.$$.fragment,ge),ie(j.$$.fragment,ge),S=!1},d(ge){ge&&(N(e),N(I),N(M),N(E),N(H)),G&&G.d(),K&&K.d(),X&&X.d(),U&&U.d(),Y&&Y.d(),le&&le.d(),$&&$.d(),z&&z.d(),x&&x.d(),fe&&fe.d(),ae&&ae.d(),se&&se.d(),_e&&_e.d(),oe&&oe.d(),Me(L,ge),Me(O,ge),Me(F,ge),Me(j,ge),y=!1,J()}}}async function D0(){await(await fetch("reboot",{method:"POST"})).json()}function A0(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,{data:s}=e,o=Cn,r={};wl.subscribe(Q=>{l(3,r=Q)});let f=[{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"}],c=!0,_=!1,d=!1,m,v=[];Rn.subscribe(Q=>{var Ce,Kt,fl;Q.version&&(l(6,d=(Ce=Q==null?void 0:Q.c)==null?void 0:Ce.e),l(7,m=Q),l(4,c=!1),l(8,v=[{code:"en",name:"English"}]),(Kt=m==null?void 0:m.u)!=null&&Kt.lang&&m.u.lang!="en"&&v.push({code:m.u.lang,name:((fl=r.language)==null?void 0:fl.name)??"Unknown"}),v.push({code:"hub",name:"Load from server"}))}),Gc();let h={};xi.subscribe(Q=>{var Ce;for(let Kt=0;Kt(Jt.hostname=Ce.get("gh"),Jt.usrcfg=ml.success,Jt.booting=ml.reboot,Ce.get("nm")=="static"&&(Jt.net.ip=Ce.get("ni"),Jt.net.mask=Ce.get("nu"),Jt.net.gw=Ce.get("ng"),Jt.net.dns1=Ce.get("nd")),Jt.ui=m.u,Jt)),l(5,_=!1),sn(n)}const I=function(){confirm("Reboot?")&&(_l.update(Q=>(Q.booting=!0,Q)),D0())};async function L(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),Rn.update(Ce=>(Ce.q.s.c=!1,Ce)))}async function M(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),Rn.update(Ce=>(Ce.q.s.r=!1,Ce)))}async function O(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),Rn.update(Ce=>(Ce.q.s.k=!1,Ce)))}const E=function(){m.q.s.e?m.q.p==1883&&l(7,m.q.p=8883,m):m.q.p==8883&&l(7,m.q.p=1883,m)};async function F(){if(m.u.lang=="hub"){const Q=await kl("http://hub.amsleser.no/hub/language/list.json");l(8,v=await Q.json()),l(7,m.u.lang=r.language.code,m)}}async function H(){l(7,m.p.e=!0,m)}let j=44;async function S(){const Q=await kl("cloudkey.json");if(Q.status==200){let Ce=await Q.json();window.open("https://www.amsleser.cloud/device/"+Ce.seed)}else alert("Not able to bind to cloud")}const y=window||global;y.bindToCloud=function(){console.log("BIND CALLED")};const J=[[]];function G(){m.g.h=this.value,l(7,m)}function K(){m.g.t=jt(this),l(7,m)}function X(){m.p.r=jt(this),l(7,m)}function U(){m.p.c=jt(this),l(7,m)}function Y(){m.p.e=this.checked,l(7,m)}function le(){m.p.t=this.value,l(7,m)}function $(){m.g.s=jt(this),l(7,m)}function z(){m.g.u=this.value,l(7,m)}function x(){m.g.p=this.value,l(7,m)}function fe(){m.g.c=this.value,l(7,m)}function ae(){m.m.a=jt(this),l(7,m)}function se(){m.m.b=ye(this.value),l(7,m)}function _e(){m.m.i=this.checked,l(7,m)}function oe(){m.m.b=jt(this),l(7,m)}function ee(){m.m.p=jt(this),l(7,m)}function ne(){m.m.s=ye(this.value),l(7,m)}function be(){m.m.d=jt(this),l(7,m)}function we(){m.m.f=ye(this.value),l(7,m)}function R(){m.m.r=ye(this.value),l(7,m)}function T(){m.m.e.e=this.checked,l(7,m)}function B(){m.m.e.k=this.value,l(7,m)}function D(){m.m.e.a=this.value,l(7,m)}function W(){m.m.m.e=this.checked,l(7,m)}function te(){m.m.m.w=ye(this.value),l(7,m)}function ue(){m.m.m.v=ye(this.value),l(7,m)}function ce(){m.m.m.a=ye(this.value),l(7,m)}function me(){m.m.m.c=ye(this.value),l(7,m)}function pe(){m.n.c=jt(this),l(7,m)}function ke(){m.w.s=this.__value,l(7,m)}function ve(){m.w.p=this.value,l(7,m)}function De(){m.w.p=this.value,l(7,m)}function Ee(){m.w.z=jt(this),l(7,m)}function Le(){m.w.w=ye(this.value),l(7,m)}function Oe(){m.w.b=this.checked,l(7,m)}function rt(){m.n.m=jt(this),l(7,m)}function dt(){m.n.i=this.value,l(7,m)}function tt(){m.n.s=jt(this),l(7,m)}function Ze(){m.n.g=this.value,l(7,m)}function Be(){m.n.d1=this.value,l(7,m)}function at(){m.n.d2=this.value,l(7,m)}function Nt(){m.n.x=this.checked,l(7,m)}function bt(){m.n.d=this.checked,l(7,m)}function ft(){m.n.h=this.checked,l(7,m)}function st(){m.n.n1=this.value,l(7,m)}function ut(){m.q.s.e=this.checked,l(7,m)}function Rt(){m.q.h=this.value,l(7,m)}function Ke(){m.q.p=ye(this.value),l(7,m)}function Ie(){m.q.u=this.value,l(7,m)}function je(){m.q.a=this.value,l(7,m)}function $e(){m.q.c=this.value,l(7,m)}function de(){m.q.m=jt(this),l(7,m)}function qe(){m.q.b=this.value,l(7,m)}function Ge(){m.q.r=this.value,l(7,m)}function ge(){m.q.t=jt(this),l(7,m)}function Pe(){m.q.d=ye(this.value),l(7,m)}function nt(){m.q.i=ye(this.value),l(7,m)}function He(){m.q.k=ye(this.value),l(7,m)}function At(){m.o.e=this.value,l(7,m)}function ht(){m.o.c=this.value,l(7,m)}function Re(){m.o.u1=this.value,l(7,m)}function kt(){m.o.u2=this.value,l(7,m)}function ct(){m.o.u3=this.value,l(7,m)}function vt(){m.h.t=this.value,l(7,m)}function xe(){m.h.h=this.value,l(7,m)}function Lt(){m.h.n=this.value,l(7,m)}function Gt(){m.c.e=this.checked,l(7,m)}function wt(){m.c.p=jt(this),l(7,m)}function _t(){m.c.es=this.checked,l(7,m)}function Ht(){m.c.ze=this.checked,l(7,m)}function Qt(){m.c.zt=this.value,l(7,m)}function Ut(Q){m.t.t[Q]=ye(this.value),l(7,m)}function Bt(){m.t.h=ye(this.value),l(7,m)}function Yt(Q){m.u[Q.key]=jt(this),l(7,m)}function $t(){m.u.lang=jt(this),l(7,m)}function Vt(){m.i.h.p=jt(this),l(7,m)}function Ft(){m.i.h.t=jt(this),l(7,m)}function Fe(){m.i.h.u=this.checked,l(7,m)}function Je(){m.i.a=ye(this.value),l(7,m)}function Ue(){m.i.l.p=ye(this.value),l(7,m)}function Tt(){m.i.l.i=this.checked,l(7,m)}function Ot(){m.i.r.i=this.checked,l(7,m)}function Qe(){m.i.r.r=ye(this.value),l(7,m)}function lt(){m.i.r.g=ye(this.value),l(7,m)}function Pt(){m.i.r.b=ye(this.value),l(7,m)}function ot(){m.i.d.d=ye(this.value),l(7,m)}function he(){m.i.t.d=ye(this.value),l(7,m)}function et(){m.i.t.a=ye(this.value),l(7,m)}function ze(){m.i.v.p=ye(this.value),l(7,m)}function xt(){m.i.v.d.v=ye(this.value),l(7,m)}function el(){m.i.v.d.g=ye(this.value),l(7,m)}function tl(){m.i.d.b=jt(this),l(7,m)}function ll(){m.i.v.o=ye(this.value),l(7,m)}function nl(){m.i.v.m=ye(this.value),l(7,m)}function il(){m.i.v.b=ye(this.value),l(7,m)}function sl(){m.d.s=this.checked,l(7,m)}function ol(){m.d.t=this.checked,l(7,m)}function Ae(){m.d.l=jt(this),l(7,m)}return t.$$set=Q=>{"basepath"in Q&&l(24,n=Q.basepath),"sysinfo"in Q&&l(0,i=Q.sysinfo),"data"in Q&&l(1,s=Q.data)},t.$$.update=()=>{if(t.$$.dirty[0]&1&&l(12,j=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39),t.$$.dirty[0]&2){const Q=s==null?void 0:s.r;typeof Q=="number"&&(Q>=-50?l(2,o=ls):Q>=-60?l(2,o=ts):Q>=-75?l(2,o=es):l(2,o=Cn))}},[i,s,o,r,c,_,d,m,v,h,g,w,j,f,k,A,I,L,M,O,E,F,H,S,n,G,K,X,U,Y,le,$,z,x,fe,ae,se,_e,oe,ee,ne,be,we,R,T,B,D,W,te,ue,ce,me,pe,ke,J,ve,De,Ee,Le,Oe,rt,dt,tt,Ze,Be,at,Nt,bt,ft,st,ut,Rt,Ke,Ie,je,$e,de,qe,Ge,ge,Pe,nt,He,At,ht,Re,kt,ct,vt,xe,Lt,Gt,wt,_t,Ht,Qt,Ut,Bt,Yt,$t,Vt,Ft,Fe,Je,Ue,Tt,Ot,Qe,lt,Pt,ot,he,et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae]}class L0 extends Mt{constructor(e){super(),St(this,e,A0,q0,Ct,{basepath:24,sysinfo:0,data:1},null,[-1,-1,-1,-1,-1])}}function ja(t,e,l){const n=t.slice();return n[21]=e[l],n}function za(t){let e,l=t[1].cpu+"",n,i;return{c(){e=C("("),n=C(l),i=C("MHz)")},m(s,o){P(s,e,o),P(s,n,o),P(s,i,o)},p(s,o){o&2&&l!==(l=s[1].cpu+"")&&q(n,l)},d(s){s&&(N(e),N(n),N(i))}}}function O0(t){let e=Ye(t[1].chip,t[1].board)+"",l;return{c(){l=C(e)},m(n,i){P(n,l,i)},p(n,i){i&2&&e!==(e=Ye(n[1].chip,n[1].board)+"")&&q(l,e)},d(n){n&&N(l)}}}function Ha(t){var X,U,Y,le,$,z,x,fe;let e,l=(((U=(X=t[3].status)==null?void 0:X.device)==null?void 0:U.apmac)??"AP MAC")+"",n,i,s=t[1].apmac+"",o,r,f,c=(((le=(Y=t[3].status)==null?void 0:Y.device)==null?void 0:le.last_boot)??"Last boot")+"",_,d,m,v,h,g,w=(((z=($=t[3].status)==null?void 0:$.device)==null?void 0:z.reason)??"Reason")+"",k,A,I=(((fe=(x=t[3][gs(t[1].chip)])==null?void 0:x.reason)==null?void 0:fe[t[1].boot_reason])??t[1].boot_reason)+"",L,M,O=t[1].boot_reason+"",E,F,H=t[1].ex_cause+"",j,S,y;const J=[R0,I0],G=[];function K(ae,se){return ae[0].u>0?0:1}return m=K(t),v=G[m]=J[m](t),{c(){e=p("div"),n=C(l),i=C(": "),o=C(s),r=b(),f=p("div"),_=C(c),d=C(`: - `),v.c(),h=b(),g=p("div"),k=C(w),A=C(": "),L=C(I),M=C(" ("),E=C(O),F=C("/"),j=C(H),S=C(")"),u(e,"class","my-2"),u(f,"class","my-2"),u(g,"class","my-2")},m(ae,se){P(ae,e,se),a(e,n),a(e,i),a(e,o),P(ae,r,se),P(ae,f,se),a(f,_),a(f,d),G[m].m(f,null),P(ae,h,se),P(ae,g,se),a(g,k),a(g,A),a(g,L),a(g,M),a(g,E),a(g,F),a(g,j),a(g,S),y=!0},p(ae,se){var oe,ee,ne,be,we,R,T,B;(!y||se&8)&&l!==(l=(((ee=(oe=ae[3].status)==null?void 0:oe.device)==null?void 0:ee.apmac)??"AP MAC")+"")&&q(n,l),(!y||se&2)&&s!==(s=ae[1].apmac+"")&&q(o,s),(!y||se&8)&&c!==(c=(((be=(ne=ae[3].status)==null?void 0:ne.device)==null?void 0:be.last_boot)??"Last boot")+"")&&q(_,c);let _e=m;m=K(ae),m===_e?G[m].p(ae,se):(mt(),ie(G[_e],1,1,()=>{G[_e]=null}),pt(),v=G[m],v?v.p(ae,se):(v=G[m]=J[m](ae),v.c()),Z(v,1),v.m(f,null)),(!y||se&8)&&w!==(w=(((R=(we=ae[3].status)==null?void 0:we.device)==null?void 0:R.reason)??"Reason")+"")&&q(k,w),(!y||se&10)&&I!==(I=(((B=(T=ae[3][gs(ae[1].chip)])==null?void 0:T.reason)==null?void 0:B[ae[1].boot_reason])??ae[1].boot_reason)+"")&&q(L,I),(!y||se&2)&&O!==(O=ae[1].boot_reason+"")&&q(E,O),(!y||se&2)&&H!==(H=ae[1].ex_cause+"")&&q(j,H)},i(ae){y||(Z(v),y=!0)},o(ae){ie(v),y=!1},d(ae){ae&&(N(e),N(r),N(f),N(h),N(g)),G[m].d()}}}function I0(t){let e;return{c(){e=C("-")},m(l,n){P(l,e,n)},p:Ve,i:Ve,o:Ve,d(l){l&&N(e)}}}function R0(t){let e,l;return e=new Du({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:"",offset:t[1].clock_offset}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),i&2&&(s.offset=n[1].clock_offset),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function Wa(t){var _;let e,l,n,i,s=(((_=t[3].btn)==null?void 0:_.reboot)??"Reboot")+"",o,r,f,c;return l=new hl({props:{to:"/consent",$$slots:{default:[F0]},$$scope:{ctx:t}}}),{c(){e=p("div"),Ne(l.$$.fragment),n=b(),i=p("button"),o=C(s),u(i,"class","btn-yellow-sm float-right"),u(e,"class","my-2")},m(d,m){P(d,e,m),Se(l,e,null),a(e,n),a(e,i),a(i,o),r=!0,f||(c=re(i,"click",t[11]),f=!0)},p(d,m){var h;const v={};m&16777224&&(v.$$scope={dirty:m,ctx:d}),l.$set(v),(!r||m&8)&&s!==(s=(((h=d[3].btn)==null?void 0:h.reboot)??"Reboot")+"")&&q(o,s)},i(d){r||(Z(l.$$.fragment,d),r=!0)},o(d){ie(l.$$.fragment,d),r=!1},d(d){d&&N(e),Me(l),f=!1,c()}}}function F0(t){var i,s;let e,l=(((s=(i=t[3].status)==null?void 0:i.device)==null?void 0:s.btn_consents)??"Consents")+"",n;return{c(){e=p("span"),n=C(l),u(e,"class","btn-pri-sm")},m(o,r){P(o,e,r),a(e,n)},p(o,r){var f,c;r&8&&l!==(l=(((c=(f=o[3].status)==null?void 0:f.device)==null?void 0:c.btn_consents)??"Consents")+"")&&q(n,l)},d(o){o&&N(e)}}}function Ga(t){var j,S,y,J,G,K,X,U;let e,l,n=(((S=(j=t[3].status)==null?void 0:j.meter)==null?void 0:S.title)??"Meter")+"",i,s,o,r=(((J=(y=t[3].status)==null?void 0:y.meter)==null?void 0:J.manufacturer)??"Manufacturer")+"",f,c,_=ri(t[1].meter.mfg)+"",d,m,v,h=(((K=(G=t[3].status)==null?void 0:G.meter)==null?void 0:K.model)??"Model")+"",g,w,k=(t[1].meter.model?t[1].meter.model:"unknown")+"",A,I,L,M=(((U=(X=t[3].status)==null?void 0:X.meter)==null?void 0:U.id)??"ID")+"",O,E,F=(t[1].meter.id?t[1].meter.id:"unknown")+"",H;return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("div"),f=C(r),c=C(": "),d=C(_),m=b(),v=p("div"),g=C(h),w=C(": "),A=C(k),I=b(),L=p("div"),O=C(M),E=C(": "),H=C(F),u(l,"class","text-sm"),u(o,"class","my-2"),u(v,"class","my-2"),u(L,"class","my-2"),u(e,"class","cnt")},m(Y,le){P(Y,e,le),a(e,l),a(l,i),a(e,s),a(e,o),a(o,f),a(o,c),a(o,d),a(e,m),a(e,v),a(v,g),a(v,w),a(v,A),a(e,I),a(e,L),a(L,O),a(L,E),a(L,H)},p(Y,le){var $,z,x,fe,ae,se,_e,oe;le&8&&n!==(n=(((z=($=Y[3].status)==null?void 0:$.meter)==null?void 0:z.title)??"Meter")+"")&&q(i,n),le&8&&r!==(r=(((fe=(x=Y[3].status)==null?void 0:x.meter)==null?void 0:fe.manufacturer)??"Manufacturer")+"")&&q(f,r),le&2&&_!==(_=ri(Y[1].meter.mfg)+"")&&q(d,_),le&8&&h!==(h=(((se=(ae=Y[3].status)==null?void 0:ae.meter)==null?void 0:se.model)??"Model")+"")&&q(g,h),le&2&&k!==(k=(Y[1].meter.model?Y[1].meter.model:"unknown")+"")&&q(A,k),le&8&&M!==(M=(((oe=(_e=Y[3].status)==null?void 0:_e.meter)==null?void 0:oe.id)??"ID")+"")&&q(O,M),le&2&&F!==(F=(Y[1].meter.id?Y[1].meter.id:"unknown")+"")&&q(H,F)},d(Y){Y&&N(e)}}}function Va(t){var U,Y,le,$,z,x,fe,ae;let e,l,n=(((Y=(U=t[3].status)==null?void 0:U.network)==null?void 0:Y.title)??"Network")+"",i,s,o,r=((($=(le=t[3].conf)==null?void 0:le.network)==null?void 0:$.ip)??"IP")+"",f,c,_=t[1].net.ip+"",d,m,v,h=(((x=(z=t[3].conf)==null?void 0:z.network)==null?void 0:x.mask)??"Mask")+"",g,w,k=t[1].net.mask+"",A,I,L,M=(((ae=(fe=t[3].conf)==null?void 0:fe.network)==null?void 0:ae.gw)??"Gateway")+"",O,E,F=t[1].net.gw+"",H,j,S,y,J,G=t[1].net.dns1&&Ka(t),K=t[1].net.dns2&&Ya(t),X=t[1].net.ipv6&&Xa(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=b(),o=p("div"),f=C(r),c=C(": "),d=C(_),m=b(),v=p("div"),g=C(h),w=C(": "),A=C(k),I=b(),L=p("div"),O=C(M),E=C(": "),H=C(F),j=b(),S=p("div"),G&&G.c(),y=b(),K&&K.c(),J=b(),X&&X.c(),u(l,"class","text-sm"),u(o,"class","my-2"),u(v,"class","my-2"),u(L,"class","my-2"),u(S,"class","my-2"),u(e,"class","cnt")},m(se,_e){P(se,e,_e),a(e,l),a(l,i),a(e,s),a(e,o),a(o,f),a(o,c),a(o,d),a(e,m),a(e,v),a(v,g),a(v,w),a(v,A),a(e,I),a(e,L),a(L,O),a(L,E),a(L,H),a(e,j),a(e,S),G&&G.m(S,null),a(S,y),K&&K.m(S,null),a(e,J),X&&X.m(e,null)},p(se,_e){var oe,ee,ne,be,we,R,T,B;_e&8&&n!==(n=(((ee=(oe=se[3].status)==null?void 0:oe.network)==null?void 0:ee.title)??"Network")+"")&&q(i,n),_e&8&&r!==(r=(((be=(ne=se[3].conf)==null?void 0:ne.network)==null?void 0:be.ip)??"IP")+"")&&q(f,r),_e&2&&_!==(_=se[1].net.ip+"")&&q(d,_),_e&8&&h!==(h=(((R=(we=se[3].conf)==null?void 0:we.network)==null?void 0:R.mask)??"Mask")+"")&&q(g,h),_e&2&&k!==(k=se[1].net.mask+"")&&q(A,k),_e&8&&M!==(M=(((B=(T=se[3].conf)==null?void 0:T.network)==null?void 0:B.gw)??"Gateway")+"")&&q(O,M),_e&2&&F!==(F=se[1].net.gw+"")&&q(H,F),se[1].net.dns1?G?G.p(se,_e):(G=Ka(se),G.c(),G.m(S,y)):G&&(G.d(1),G=null),se[1].net.dns2?K?K.p(se,_e):(K=Ya(se),K.c(),K.m(S,null)):K&&(K.d(1),K=null),se[1].net.ipv6?X?X.p(se,_e):(X=Xa(se),X.c(),X.m(e,null)):X&&(X.d(1),X=null)},d(se){se&&N(e),G&&G.d(),K&&K.d(),X&&X.d()}}}function Ka(t){var o,r;let e=(((r=(o=t[3].conf)==null?void 0:o.network)==null?void 0:r.dns)??"DNS")+"",l,n,i=t[1].net.dns1+"",s;return{c(){l=C(e),n=C(": "),s=C(i)},m(f,c){P(f,l,c),P(f,n,c),P(f,s,c)},p(f,c){var _,d;c&8&&e!==(e=(((d=(_=f[3].conf)==null?void 0:_.network)==null?void 0:d.dns)??"DNS")+"")&&q(l,e),c&2&&i!==(i=f[1].net.dns1+"")&&q(s,i)},d(f){f&&(N(l),N(n),N(s))}}}function Ya(t){var o,r;let e=(((r=(o=t[3].conf)==null?void 0:o.network)==null?void 0:r.dns)??"DNS")+"",l,n,i=t[1].net.dns2+"",s;return{c(){l=C(e),n=C(": "),s=C(i)},m(f,c){P(f,l,c),P(f,n,c),P(f,s,c)},p(f,c){var _,d;c&8&&e!==(e=(((d=(_=f[3].conf)==null?void 0:_.network)==null?void 0:d.dns)??"DNS")+"")&&q(l,e),c&2&&i!==(i=f[1].net.dns2+"")&&q(s,i)},d(f){f&&(N(l),N(n),N(s))}}}function Xa(t){let e,l,n,i=t[1].net.ipv6.replace(/\b:?(?:0+:?){2,}/,"::")+"",s,o,r,f,c=t[1].net.dns1v6&&Qa(t),_=t[1].net.dns2v6&&Za(t);return{c(){e=p("div"),l=C("IPv6: "),n=p("span"),s=C(i),o=b(),r=p("div"),c&&c.c(),f=b(),_&&_.c(),nn(n,"font-size","14px"),u(e,"class","my-2"),u(r,"class","my-2")},m(d,m){P(d,e,m),a(e,l),a(e,n),a(n,s),P(d,o,m),P(d,r,m),c&&c.m(r,null),a(r,f),_&&_.m(r,null)},p(d,m){m&2&&i!==(i=d[1].net.ipv6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&q(s,i),d[1].net.dns1v6?c?c.p(d,m):(c=Qa(d),c.c(),c.m(r,f)):c&&(c.d(1),c=null),d[1].net.dns2v6?_?_.p(d,m):(_=Za(d),_.c(),_.m(r,null)):_&&(_.d(1),_=null)},d(d){d&&(N(e),N(o),N(r)),c&&c.d(),_&&_.d()}}}function Qa(t){let e,l,n=t[1].net.dns1v6.replace(/\b:?(?:0+:?){2,}/,"::")+"",i;return{c(){e=C("DNSv6: "),l=p("span"),i=C(n),nn(l,"font-size","14px")},m(s,o){P(s,e,o),P(s,l,o),a(l,i)},p(s,o){o&2&&n!==(n=s[1].net.dns1v6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&q(i,n)},d(s){s&&(N(e),N(l))}}}function Za(t){let e,l,n=t[1].net.dns2v6.replace(/\b:?(?:0+:?){2,}/,"::")+"",i;return{c(){e=C("DNSv6: "),l=p("span"),i=C(n),nn(l,"font-size","14px")},m(s,o){P(s,e,o),P(s,l,o),a(l,i)},p(s,o){o&2&&n!==(n=s[1].net.dns2v6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&q(i,n)},d(s){s&&(N(e),N(l))}}}function Ja(t){var f,c,_,d;let e,l,n=(((c=(f=t[3].status)==null?void 0:f.firmware)==null?void 0:c.failed)??"Upgrade from {0} to {1} failed").replace("{0}",t[1].upgrade.f).replace("{1}",t[1].upgrade.t)+"",i,s,o=(((d=(_=t[3].errors)==null?void 0:_.upgrade)==null?void 0:d[t[1].upgrade.e])??t[1].upgrade.e)+"",r;return{c(){e=p("div"),l=p("div"),i=C(n),s=b(),r=C(o),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(m,v){P(m,e,v),a(e,l),a(l,i),a(l,s),a(l,r)},p(m,v){var h,g,w,k;v&10&&n!==(n=(((g=(h=m[3].status)==null?void 0:h.firmware)==null?void 0:g.failed)??"Upgrade from {0} to {1} failed").replace("{0}",m[1].upgrade.f).replace("{1}",m[1].upgrade.t)+"")&&q(i,n),v&10&&o!==(o=(((k=(w=m[3].errors)==null?void 0:w.upgrade)==null?void 0:k[m[1].upgrade.e])??m[1].upgrade.e)+"")&&q(r,o)},d(m){m&&N(e)}}}function $a(t){var h,g;let e,l=(((g=(h=t[3].status)==null?void 0:h.firmware)==null?void 0:g.latest)??"Latest")+"",n,i,s,o=t[1].upgrade.n+"",r,f,c,_,d,m=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[1].upgrade.n&&t[1].upgrade.n!=t[1].version&&xa(t),v=t[1].fwconsent===2&&ef(t);return{c(){e=p("div"),n=C(l),i=C(`: - `),s=p("a"),r=C(o),c=b(),m&&m.c(),_=b(),v&&v.c(),d=yt(),u(s,"href",f="https://github.com/UtilitechAS/amsreader-firmware/releases/tag/"+t[1].upgrade.n),u(s,"class","ml-2 text-blue-600 hover:text-blue-800"),u(s,"target","_blank"),u(s,"rel","noreferrer"),u(e,"class","my-2 flex")},m(w,k){P(w,e,k),a(e,n),a(e,i),a(e,s),a(s,r),a(e,c),m&&m.m(e,null),P(w,_,k),v&&v.m(w,k),P(w,d,k)},p(w,k){var A,I;k&8&&l!==(l=(((I=(A=w[3].status)==null?void 0:A.firmware)==null?void 0:I.latest)??"Latest")+"")&&q(n,l),k&2&&o!==(o=w[1].upgrade.n+"")&&q(r,o),k&2&&f!==(f="https://github.com/UtilitechAS/amsreader-firmware/releases/tag/"+w[1].upgrade.n)&&u(s,"href",f),(w[1].security==0||w[0].a)&&w[1].fwconsent===1&&w[1].upgrade.n&&w[1].upgrade.n!=w[1].version?m?m.p(w,k):(m=xa(w),m.c(),m.m(e,null)):m&&(m.d(1),m=null),w[1].fwconsent===2?v?v.p(w,k):(v=ef(w),v.c(),v.m(d.parentNode,d)):v&&(v.d(1),v=null)},d(w){w&&(N(e),N(_),N(d)),m&&m.d(),v&&v.d(w)}}}function xa(t){let e,l,n,i,s;return{c(){var o,r;e=p("div"),l=p("button"),l.textContent="⇓",u(e,"class","flex-none ml-2 text-green-500"),u(e,"title",n=((r=(o=t[3].status)==null?void 0:o.firmware)==null?void 0:r.install)??"Install")},m(o,r){P(o,e,r),a(e,l),i||(s=re(l,"click",t[10]),i=!0)},p(o,r){var f,c;r&8&&n!==(n=((c=(f=o[3].status)==null?void 0:f.firmware)==null?void 0:c.install)??"Install")&&u(e,"title",n)},d(o){o&&N(e),i=!1,s()}}}function ef(t){var s,o;let e,l,n=(((o=(s=t[3].status)==null?void 0:s.firmware)==null?void 0:o.no_one_click)??"One-click upgrade disabled")+"",i;return{c(){e=p("div"),l=p("div"),i=C(n),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(r,f){P(r,e,f),a(e,l),a(l,i)},p(r,f){var c,_;f&8&&n!==(n=(((_=(c=r[3].status)==null?void 0:c.firmware)==null?void 0:_.no_one_click)??"One-click upgrade disabled")+"")&&q(i,n)},d(r){r&&N(e)}}}function tf(t){let e,l=Cs(Ye(t[1].chip,t[1].board))+"",n;return{c(){e=p("div"),n=C(l),u(e,"class","bd-red")},m(i,s){P(i,e,s),a(e,n)},p(i,s){s&2&&l!==(l=Cs(Ye(i[1].chip,i[1].board))+"")&&q(n,l)},d(i){i&&N(e)}}}function lf(t){let e,l,n,i,s,o;function r(_,d){return _[5].length==0?B0:U0}let f=r(t),c=f(t);return{c(){e=p("div"),l=p("form"),n=p("input"),i=b(),c.c(),nn(n,"display","none"),u(n,"name","file"),u(n,"type","file"),u(n,"accept",".bin"),u(l,"action","firmware"),u(l,"enctype","multipart/form-data"),u(l,"method","post"),u(l,"autocomplete","off"),u(e,"class","my-2 flex")},m(_,d){P(_,e,d),a(e,l),a(l,n),t[13](n),a(l,i),c.m(l,null),s||(o=[re(n,"change",t[14]),re(l,"submit",t[16])],s=!0)},p(_,d){f===(f=r(_))&&c?c.p(_,d):(c.d(1),c=f(_),c&&(c.c(),c.m(l,null)))},d(_){_&&N(e),t[13](null),c.d(),s=!1,Dt(o)}}}function U0(t){var r;let e=t[5][0].name+"",l,n,i,s=(((r=t[3].btn)==null?void 0:r.upload)??"Upload")+"",o;return{c(){l=C(e),n=b(),i=p("button"),o=C(s),u(i,"type","submit"),u(i,"class","btn-pri-sm float-right ml-2")},m(f,c){P(f,l,c),P(f,n,c),P(f,i,c),a(i,o)},p(f,c){var _;c&32&&e!==(e=f[5][0].name+"")&&q(l,e),c&8&&s!==(s=(((_=f[3].btn)==null?void 0:_.upload)??"Upload")+"")&&q(o,s)},d(f){f&&(N(l),N(n),N(i))}}}function B0(t){var o,r;let e,l=(((r=(o=t[3].status)==null?void 0:o.firmware)==null?void 0:r.btn_select_file)??"Select file")+"",n,i,s;return{c(){e=p("button"),n=C(l),u(e,"type","button"),u(e,"class","btn-pri-sm float-right")},m(f,c){P(f,e,c),a(e,n),i||(s=re(e,"click",t[15]),i=!0)},p(f,c){var _,d;c&8&&l!==(l=(((d=(_=f[3].status)==null?void 0:_.firmware)==null?void 0:d.btn_select_file)??"Select file")+"")&&q(n,l)},d(f){f&&N(e),i=!1,s()}}}function nf(t){var K,X,U,Y,le,$;let e,l,n=(((X=(K=t[3].status)==null?void 0:K.backup)==null?void 0:X.title)??"Backup")+"",i,s,o,r,f,c,_,d,m=(((Y=(U=t[3].status)==null?void 0:U.backup)==null?void 0:Y.secrets)??"Include secrets")+"",v,h,g,w=((($=(le=t[3].status)==null?void 0:le.backup)==null?void 0:$.secrets_desc)??"")+"",k,A,I,L,M,O,E,F,H=it(t[9]),j=[];for(let z=0;z{ce=null}),pt()),(vt=de[0])!=null&&vt.a?me?(me.p(de,qe),qe&1&&Z(me,1)):(me=Wa(de),me.c(),Z(me,1),me.m(l,null)):me&&(mt(),ie(me,1,1,()=>{me=null}),pt()),de[1].meter?pe?pe.p(de,qe):(pe=Ga(de),pe.c(),pe.m(e,G)):pe&&(pe.d(1),pe=null),de[1].net?ke?ke.p(de,qe):(ke=Va(de),ke.c(),ke.m(e,K)):ke&&(ke.d(1),ke=null),(!te||qe&8)&&Y!==(Y=(((Lt=(xe=de[3].status)==null?void 0:xe.firmware)==null?void 0:Lt.title)??"Firmware")+"")&&q(le,Y),(!te||qe&8)&&x!==(x=(((wt=(Gt=de[3].status)==null?void 0:Gt.firmware)==null?void 0:wt.installed)??"Installed")+"")&&q(fe,x),(!te||qe&2)&&se!==(se=de[1].version+"")&&q(_e,se),de[1].upgrade.t&&de[1].upgrade.t!=de[1].version&&de[1].upgrade.e!=0&&de[1].upgrade.e!=123?ve?ve.p(de,qe):(ve=Ja(de),ve.c(),ve.m(X,ee)):ve&&(ve.d(1),ve=null),de[1].upgrade.n?De?De.p(de,qe):(De=$a(de),De.c(),De.m(X,ne)):De&&(De.d(1),De=null),qe&3&&(be=(de[1].security==0||de[0].a)&&Bn(de[1].board)),be?Ee?Ee.p(de,qe):(Ee=tf(de),Ee.c(),Ee.m(X,we)):Ee&&(Ee.d(1),Ee=null),de[1].security==0||de[0].a?Le?Le.p(de,qe):(Le=lf(de),Le.c(),Le.m(X,null)):Le&&(Le.d(1),Le=null),de[1].security==0||de[0].a?Oe?Oe.p(de,qe):(Oe=nf(de),Oe.c(),Oe.m(e,null)):Oe&&(Oe.d(1),Oe=null);const ge={};qe&64&&(ge.active=de[6]),qe&8&&(ge.message=((Ht=(_t=de[3].status)==null?void 0:_t.mask)==null?void 0:Ht.firmware)??"Uploading"),B.$set(ge);const Pe={};qe&256&&(Pe.active=de[8]),qe&8&&(Pe.message=((Ut=(Qt=de[3].status)==null?void 0:Qt.mask)==null?void 0:Ut.config)??"Uploading"),W.$set(Pe)},i(de){te||(Z(I.$$.fragment,de),Z(ce),Z(me),Z(B.$$.fragment,de),Z(W.$$.fragment,de),te=!0)},o(de){ie(I.$$.fragment,de),ie(ce),ie(me),ie(B.$$.fragment,de),ie(W.$$.fragment,de),te=!1},d(de){de&&(N(e),N(T),N(D)),ue&&ue.d(),Me(I),ce&&ce.d(),me&&me.d(),pe&&pe.d(),ke&&ke.d(),ve&&ve.d(),De&&De.d(),Ee&&Ee.d(),Le&&Le.d(),Oe&&Oe.d(),Me(B,de),Me(W,de)}}}async function H0(){await(await fetch("reboot",{method:"POST"})).json()}function W0(t,e,l){let{data:n}=e,{sysinfo:i}=e,s=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price",key:"is"}],o={};wl.subscribe(F=>{l(3,o=F)});function r(){var F;confirm((((F=o.header)==null?void 0:F.upgrade)??"Upgrade to {0}?").replace("{0}",i.upgrade.n))&&(qu(i.upgrade.n),_l.update(H=>(H.upgrade.t=i.upgrade.n,H.upgrade.p=0,H.upgrading=!0,H)))}const f=function(){var F;confirm(((F=o.device)==null?void 0:F.reboot_confirm)??"Reboot?")&&(_l.update(H=>(H.booting=!0,H)),H0())};let c,_=[],d=!1,m,v=[],h=!1;_i();let g={hostname:"",ip:""};function w(F){l(8,h=!0);const H=new FormData;H.append("file",v[0]),fetch("configfile",{method:"POST",body:H}).then(j=>j.json()).then(j=>{_l.update(S=>(g&&g.hostname&&(S.hostname=g.hostname),S.booting=j.reboot,g&&g.ip&&(S.net.ip=g.ip),setTimeout(zn,5e3,i),S))}).catch(j=>{console.error("Error:",j),setTimeout(zn,5e3,i)})}function k(F){fi[F?"unshift":"push"](()=>{c=F,l(4,c)})}function A(){_=this.files,l(5,_)}const I=()=>{c.click()},L=()=>l(6,d=!0);function M(F){fi[F?"unshift":"push"](()=>{m=F,l(7,m)})}function O(){v=this.files,l(2,v)}const E=()=>{m.click()};return t.$$set=F=>{"data"in F&&l(0,n=F.data),"sysinfo"in F&&l(1,i=F.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&4&&v.length==1){let F=v[0],H=new FileReader,j=S=>{let y=S.target.result.split(` -`);for(let J in y){let G=y[J];G.startsWith("hostname ")?g.hostname=G.split(" ")[1]:G.startsWith("ip ")&&(g.ip=G.split(" ")[1])}};H.onload=j,H.readAsText(F)}},[n,i,v,o,c,_,d,m,h,s,r,f,w,k,A,I,L,M,O,E]}class G0 extends Mt{constructor(e){super(),St(this,e,W0,z0,Ct,{data:0,sysinfo:1})}}function af(t){let e,l,n=Ye(t[0],7)+"",i,s,o=Ye(t[0],5)+"",r,f,c=Ye(t[0],4)+"",_,d,m=Ye(t[0],3)+"",v,h,g,w,k=Ye(t[0],2)+"",A,I,L=Ye(t[0],1)+"",M,O,E=Ye(t[0],0)+"",F,H,j,S,y=Ye(t[0],101)+"",J,G,K=Ye(t[0],100)+"",X;return{c(){e=p("optgroup"),l=p("option"),i=C(n),s=p("option"),r=C(o),f=p("option"),_=C(c),d=p("option"),v=C(m),h=b(),g=p("optgroup"),w=p("option"),A=C(k),I=p("option"),M=C(L),O=p("option"),F=C(E),H=b(),j=p("optgroup"),S=p("option"),J=C(y),G=p("option"),X=C(K),l.__value=7,V(l,l.__value),s.__value=5,V(s,s.__value),f.__value=4,V(f,f.__value),d.__value=3,V(d,d.__value),u(e,"label","amsleser.no"),w.__value=2,V(w,w.__value),I.__value=1,V(I,I.__value),O.__value=0,V(O,O.__value),u(g,"label","Custom hardware"),S.__value=101,V(S,S.__value),G.__value=100,V(G,G.__value),u(j,"label","Generic hardware")},m(U,Y){P(U,e,Y),a(e,l),a(l,i),a(e,s),a(s,r),a(e,f),a(f,_),a(e,d),a(d,v),P(U,h,Y),P(U,g,Y),a(g,w),a(w,A),a(g,I),a(I,M),a(g,O),a(O,F),P(U,H,Y),P(U,j,Y),a(j,S),a(S,J),a(j,G),a(G,X)},p(U,Y){Y&1&&n!==(n=Ye(U[0],7)+"")&&q(i,n),Y&1&&o!==(o=Ye(U[0],5)+"")&&q(r,o),Y&1&&c!==(c=Ye(U[0],4)+"")&&q(_,c),Y&1&&m!==(m=Ye(U[0],3)+"")&&q(v,m),Y&1&&k!==(k=Ye(U[0],2)+"")&&q(A,k),Y&1&&L!==(L=Ye(U[0],1)+"")&&q(M,L),Y&1&&E!==(E=Ye(U[0],0)+"")&&q(F,E),Y&1&&y!==(y=Ye(U[0],101)+"")&&q(J,y),Y&1&&K!==(K=Ye(U[0],100)+"")&&q(X,K)},d(U){U&&(N(e),N(h),N(g),N(H),N(j))}}}function ff(t){let e,l,n=Ye(t[0],201)+"",i,s,o=Ye(t[0],202)+"",r,f,c=Ye(t[0],203)+"",_,d,m=Ye(t[0],241)+"",v,h,g=Ye(t[0],242)+"",w,k,A=Ye(t[0],243)+"",I,L,M=Ye(t[0],245)+"",O,E,F=Ye(t[0],200)+"",H;return{c(){e=p("optgroup"),l=p("option"),i=C(n),s=p("option"),r=C(o),f=p("option"),_=C(c),d=p("option"),v=C(m),h=p("option"),w=C(g),k=p("option"),I=C(A),L=p("option"),O=C(M),E=p("option"),H=C(F),l.__value=201,V(l,l.__value),s.__value=202,V(s,s.__value),f.__value=203,V(f,f.__value),d.__value=241,V(d,d.__value),h.__value=242,V(h,h.__value),k.__value=243,V(k,k.__value),L.__value=245,V(L,L.__value),E.__value=200,V(E,E.__value),u(e,"label","Generic hardware")},m(j,S){P(j,e,S),a(e,l),a(l,i),a(e,s),a(s,r),a(e,f),a(f,_),a(e,d),a(d,v),a(e,h),a(h,w),a(e,k),a(k,I),a(e,L),a(L,O),a(e,E),a(E,H)},p(j,S){S&1&&n!==(n=Ye(j[0],201)+"")&&q(i,n),S&1&&o!==(o=Ye(j[0],202)+"")&&q(r,o),S&1&&c!==(c=Ye(j[0],203)+"")&&q(_,c),S&1&&m!==(m=Ye(j[0],241)+"")&&q(v,m),S&1&&g!==(g=Ye(j[0],242)+"")&&q(w,g),S&1&&A!==(A=Ye(j[0],243)+"")&&q(I,A),S&1&&M!==(M=Ye(j[0],245)+"")&&q(O,M),S&1&&F!==(F=Ye(j[0],200)+"")&&q(H,F)},d(j){j&&N(e)}}}function uf(t){let e,l,n=Ye(t[0],7)+"",i,s,o=Ye(t[0],6)+"",r,f,c=Ye(t[0],5)+"",_,d,m,v,h=Ye(t[0],51)+"",g,w,k=Ye(t[0],50)+"",A;return{c(){e=p("optgroup"),l=p("option"),i=C(n),s=p("option"),r=C(o),f=p("option"),_=C(c),d=b(),m=p("optgroup"),v=p("option"),g=C(h),w=p("option"),A=C(k),l.__value=7,V(l,l.__value),s.__value=6,V(s,s.__value),f.__value=5,V(f,f.__value),u(e,"label","amsleser.no"),v.__value=51,V(v,v.__value),w.__value=50,V(w,w.__value),u(m,"label","Generic hardware")},m(I,L){P(I,e,L),a(e,l),a(l,i),a(e,s),a(s,r),a(e,f),a(f,_),P(I,d,L),P(I,m,L),a(m,v),a(v,g),a(m,w),a(w,A)},p(I,L){L&1&&n!==(n=Ye(I[0],7)+"")&&q(i,n),L&1&&o!==(o=Ye(I[0],6)+"")&&q(r,o),L&1&&c!==(c=Ye(I[0],5)+"")&&q(_,c),L&1&&h!==(h=Ye(I[0],51)+"")&&q(g,h),L&1&&k!==(k=Ye(I[0],50)+"")&&q(A,k)},d(I){I&&(N(e),N(d),N(m))}}}function rf(t){let e,l,n=Ye(t[0],8)+"",i,s,o,r,f=Ye(t[0],71)+"",c,_,d=Ye(t[0],70)+"",m;return{c(){e=p("optgroup"),l=p("option"),i=C(n),s=b(),o=p("optgroup"),r=p("option"),c=C(f),_=p("option"),m=C(d),l.__value=8,V(l,l.__value),u(e,"label","Custom hardware"),r.__value=71,V(r,r.__value),_.__value=70,V(_,_.__value),u(o,"label","Generic hardware")},m(v,h){P(v,e,h),a(e,l),a(l,i),P(v,s,h),P(v,o,h),a(o,r),a(r,c),a(o,_),a(_,m)},p(v,h){h&1&&n!==(n=Ye(v[0],8)+"")&&q(i,n),h&1&&f!==(f=Ye(v[0],71)+"")&&q(c,f),h&1&&d!==(d=Ye(v[0],70)+"")&&q(m,d)},d(v){v&&(N(e),N(s),N(o))}}}function cf(t){let e,l,n=Ye(t[0],200)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=C(n),l.__value=200,V(l,l.__value),u(e,"label","Generic hardware")},m(s,o){P(s,e,o),a(e,l),a(l,i)},p(s,o){o&1&&n!==(n=Ye(s[0],200)+"")&&q(i,n)},d(s){s&&N(e)}}}function _f(t){let e,l,n=Ye(t[0],80)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=C(n),l.__value=80,V(l,l.__value),u(e,"label","Generic hardware")},m(s,o){P(s,e,o),a(e,l),a(l,i)},p(s,o){o&1&&n!==(n=Ye(s[0],80)+"")&&q(i,n)},d(s){s&&N(e)}}}function V0(t){let e,l,n,i,s,o,r,f,c=t[0]=="esp8266"&&af(t),_=t[0]=="esp32"&&ff(t),d=t[0]=="esp32s2"&&uf(t),m=t[0]=="esp32c3"&&rf(t),v=t[0]=="esp32solo"&&cf(t),h=t[0]=="esp32s3"&&_f(t);return{c(){e=p("option"),l=b(),c&&c.c(),n=b(),_&&_.c(),i=b(),d&&d.c(),s=b(),m&&m.c(),o=b(),v&&v.c(),r=b(),h&&h.c(),f=yt(),e.__value=-1,V(e,e.__value)},m(g,w){P(g,e,w),P(g,l,w),c&&c.m(g,w),P(g,n,w),_&&_.m(g,w),P(g,i,w),d&&d.m(g,w),P(g,s,w),m&&m.m(g,w),P(g,o,w),v&&v.m(g,w),P(g,r,w),h&&h.m(g,w),P(g,f,w)},p(g,[w]){g[0]=="esp8266"?c?c.p(g,w):(c=af(g),c.c(),c.m(n.parentNode,n)):c&&(c.d(1),c=null),g[0]=="esp32"?_?_.p(g,w):(_=ff(g),_.c(),_.m(i.parentNode,i)):_&&(_.d(1),_=null),g[0]=="esp32s2"?d?d.p(g,w):(d=uf(g),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),g[0]=="esp32c3"?m?m.p(g,w):(m=rf(g),m.c(),m.m(o.parentNode,o)):m&&(m.d(1),m=null),g[0]=="esp32solo"?v?v.p(g,w):(v=cf(g),v.c(),v.m(r.parentNode,r)):v&&(v.d(1),v=null),g[0]=="esp32s3"?h?h.p(g,w):(h=_f(g),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},i:Ve,o:Ve,d(g){g&&(N(e),N(l),N(n),N(i),N(s),N(o),N(r),N(f)),c&&c.d(g),_&&_.d(g),d&&d.d(g),m&&m.d(g),v&&v.d(g),h&&h.d(g)}}}function K0(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Y0 extends Mt{constructor(e){super(),St(this,e,K0,V0,Ct,{chip:0})}}function mf(t){let e;return{c(){e=p("div"),e.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",u(e,"class","bd-red")},m(l,n){P(l,e,n)},d(l){l&&N(e)}}}function pf(t){let e,l,n,i,s,o,r;return o=new yi({props:{chip:t[0].chip}}),{c(){e=p("div"),l=C("HAN GPIO"),n=p("br"),i=b(),s=p("select"),Ne(o.$$.fragment),u(s,"name","vh"),u(s,"class","in-s"),u(e,"class","my-3")},m(f,c){P(f,e,c),a(e,l),a(e,n),a(e,i),a(e,s),Se(o,s,null),r=!0},p(f,c){const _={};c&1&&(_.chip=f[0].chip),o.$set(_)},i(f){r||(Z(o.$$.fragment,f),r=!0)},o(f){ie(o.$$.fragment,f),r=!1},d(f){f&&N(e),Me(o)}}}function X0(t){let e,l,n,i,s,o,r,f,c,_,d,m,v,h,g,w,k,A,I,L,M,O,E,F,H,j,S,y,J,G=t[0].usrcfg&&mf();h=new Y0({props:{chip:t[0].chip}});let K=t[0].board&&t[0].board>20&&pf(t);return j=new cl({props:{active:t[1],message:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("input"),s=b(),o=p("strong"),o.textContent="Initial configuration",r=b(),G&&G.c(),f=b(),c=p("div"),_=C("Board type"),d=p("br"),m=b(),v=p("select"),Ne(h.$$.fragment),g=b(),K&&K.c(),w=b(),k=p("div"),A=p("label"),I=p("input"),L=C(" Clear all other configuration"),M=b(),O=p("div"),O.innerHTML='',E=b(),F=p("span"),F.textContent=" ",H=b(),Ne(j.$$.fragment),u(i,"type","hidden"),u(i,"name","v"),i.value="true",u(o,"class","text-sm"),u(v,"name","vb"),u(v,"class","in-s"),t[0].board===void 0&&qt(()=>t[5].call(v)),u(c,"class","my-3"),u(I,"type","checkbox"),u(I,"name","vr"),I.__value="true",V(I,I.__value),u(I,"class","rounded mb-1"),u(k,"class","my-3"),u(O,"class","my-3"),u(F,"class","clear-both"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(X,U){P(X,e,U),a(e,l),a(l,n),a(n,i),a(n,s),a(n,o),a(n,r),G&&G.m(n,null),a(n,f),a(n,c),a(c,_),a(c,d),a(c,m),a(c,v),Se(h,v,null),Xe(v,t[0].board,!0),a(n,g),K&&K.m(n,null),a(n,w),a(n,k),a(k,A),a(A,I),I.checked=t[2],a(A,L),a(n,M),a(n,O),a(n,E),a(n,F),P(X,H,U),Se(j,X,U),S=!0,y||(J=[re(v,"change",t[5]),re(I,"change",t[6]),re(n,"submit",_n(t[3]))],y=!0)},p(X,[U]){X[0].usrcfg?G||(G=mf(),G.c(),G.m(n,f)):G&&(G.d(1),G=null);const Y={};U&1&&(Y.chip=X[0].chip),h.$set(Y),U&1&&Xe(v,X[0].board),X[0].board&&X[0].board>20?K?(K.p(X,U),U&1&&Z(K,1)):(K=pf(X),K.c(),Z(K,1),K.m(n,w)):K&&(mt(),ie(K,1,1,()=>{K=null}),pt()),U&4&&(I.checked=X[2]);const le={};U&2&&(le.active=X[1]),j.$set(le)},i(X){S||(Z(h.$$.fragment,X),Z(K),Z(j.$$.fragment,X),S=!0)},o(X){ie(h.$$.fragment,X),ie(K),ie(j.$$.fragment,X),S=!1},d(X){X&&(N(e),N(H)),G&&G.d(),Me(h),K&&K.d(),Me(j,X),y=!1,Dt(J)}}}function Q0(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,s=!1;async function o(_){l(1,s=!0);const d=new FormData(_.target),m=new URLSearchParams;for(let g of d){const[w,k]=g;m.append(w,k)}let h=await(await fetch("save",{method:"POST",body:m})).json();l(1,s=!1),_l.update(g=>(g.vndcfg=h.success,g.booting=h.reboot,g.if.eth=g.boardType>240&&g.boardType<250,g)),sn(n+(i.usrcfg?"":"setup"))}let r=!0;_l.subscribe(_=>{l(0,i=_),_.fwconsent===1&&l(2,r=!i.usrcfg)});function f(){i.board=jt(this),l(0,i)}function c(){r=this.checked,l(2,r)}return t.$$set=_=>{"basepath"in _&&l(4,n=_.basepath),"sysinfo"in _&&l(0,i=_.sysinfo)},[i,s,r,o,n,f,c]}class Z0 extends Mt{constructor(e){super(),St(this,e,Q0,X0,Ct,{basepath:4,sysinfo:0})}}function df(t,e,l){const n=t.slice();return n[12]=e[l],n}function hf(t){var i,s;let e,l=(((s=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:s.eth)??"Ethernet")+"",n;return{c(){e=p("option"),n=C(l),e.__value=3,V(e,e.__value)},m(o,r){P(o,e,r),a(e,n)},p(o,r){var f,c;r&4&&l!==(l=(((c=(f=o[2].conf)==null?void 0:f.connection)==null?void 0:c.eth)??"Ethernet")+"")&&q(n,l)},d(o){o&&N(e)}}}function vf(t){var A,I,L,M;let e,l=(((I=(A=t[2].conf)==null?void 0:A.connection)==null?void 0:I.ssid)??"SSID")+"",n,i,s,o,r,f,c=(((M=(L=t[2].conf)==null?void 0:L.connection)==null?void 0:M.psk)??"Password")+"",_,d,m,v,h;function g(O,E){return J0}let k=g()(t);return{c(){e=p("div"),n=C(l),i=b(),s=p("br"),o=b(),k.c(),r=b(),f=p("div"),_=C(c),d=p("br"),m=b(),v=p("input"),u(e,"class","my-3"),u(v,"name","sp"),u(v,"type","password"),u(v,"pattern",Wn),u(v,"class","in-s"),u(v,"autocomplete","off"),v.required=h=t[4]==2,u(f,"class","my-3")},m(O,E){P(O,e,E),a(e,n),a(e,i),a(e,s),a(e,o),k.m(e,null),P(O,r,E),P(O,f,E),a(f,_),a(f,d),a(f,m),a(f,v)},p(O,E){var F,H,j,S;E&4&&l!==(l=(((H=(F=O[2].conf)==null?void 0:F.connection)==null?void 0:H.ssid)??"SSID")+"")&&q(n,l),k.p(O,E),E&4&&c!==(c=(((S=(j=O[2].conf)==null?void 0:j.connection)==null?void 0:S.psk)??"Password")+"")&&q(_,c),E&16&&h!==(h=O[4]==2)&&(v.required=h)},d(O){O&&(N(e),N(r),N(f)),k.d()}}}function J0(t){var r;let e,l,n=((r=t[3])==null?void 0:r.c)==-1&&bf(t);function i(f,c){var _,d,m;if((d=(_=f[3])==null?void 0:_.n)!=null&&d.length)return x0;if(((m=f[3])==null?void 0:m.c)!=-1)return $0}let s=i(t),o=s&&s(t);return{c(){n&&n.c(),e=b(),o&&o.c(),l=yt()},m(f,c){n&&n.m(f,c),P(f,e,c),o&&o.m(f,c),P(f,l,c)},p(f,c){var _;((_=f[3])==null?void 0:_.c)==-1?n?n.p(f,c):(n=bf(f),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null),s===(s=i(f))&&o?o.p(f,c):(o&&o.d(1),o=s&&s(f),o&&(o.c(),o.m(l.parentNode,l)))},d(f){f&&(N(e),N(l)),n&&n.d(f),o&&o.d(f)}}}function bf(t){var i,s;let e,l=(((s=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:s.scanning)??"Scanning...")+"",n;return{c(){e=p("p"),n=C(l),u(e,"class","text-sm italic")},m(o,r){P(o,e,r),a(e,n)},p(o,r){var f,c;r&4&&l!==(l=(((c=(f=o[2].conf)==null?void 0:f.connection)==null?void 0:c.scanning)??"Scanning...")+"")&&q(n,l)},d(o){o&&N(e)}}}function $0(t){var i,s;let e,l=(((s=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:s.noNetworks)??"No networks found.")+"",n;return{c(){e=p("p"),n=C(l),u(e,"class","text-sm italic")},m(o,r){P(o,e,r),a(e,n)},p(o,r){var f,c;r&4&&l!==(l=(((c=(f=o[2].conf)==null?void 0:f.connection)==null?void 0:c.noNetworks)??"No networks found.")+"")&&q(n,l)},d(o){o&&N(e)}}}function x0(t){let e,l=[],n=new Map,i=it(t[3].n);const s=o=>o[12].s;for(let o=0;ot[8].call(g)),u(_,"class","my-3"),u(H,"name","sh"),u(H,"type","text"),u(H,"class","in-s"),u(H,"maxlength","32"),u(H,"pattern",Gn),u(H,"placeholder","Optional, ex.: ams-reader"),u(H,"autocomplete","off"),u(S,"class","my-3"),u(K,"type","submit"),u(K,"class","btn-pri"),u(G,"class","my-3"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(D,W){P(D,e,W),a(e,l),a(l,n),a(n,i),a(n,s),a(n,o),a(o,f),a(n,c),a(n,_),a(_,m),a(_,v),a(_,h),a(_,g),a(g,w),a(w,A),fe&&fe.m(g,null),Xe(g,t[4],!0),a(n,I),ae&&ae.m(n,null),a(n,L),a(n,M),a(M,E),a(M,F),a(M,H),V(H,t[0].hostname),a(n,j),a(n,S),a(n,y),a(n,J),a(n,G),a(G,K),a(K,U),P(D,Y,W),Se(le,D,W),$=!0,z||(x=[re(g,"change",t[8]),re(H,"input",t[9]),re(n,"submit",_n(t[6]))],z=!0)},p(D,[W]){var ue,ce,me,pe,ke,ve,De,Ee,Le;(!$||W&4)&&r!==(r=(((ue=D[2].setup)==null?void 0:ue.title)??"Setup")+"")&&q(f,r),(!$||W&4)&&d!==(d=(((me=(ce=D[2].conf)==null?void 0:ce.connection)==null?void 0:me.title)??"Connection")+"")&&q(m,d),(!$||W&4)&&k!==(k=(((ke=(pe=D[2].conf)==null?void 0:pe.connection)==null?void 0:ke.wifi)??"Connect to WiFi")+"")&&q(A,k),D[0].if&&D[0].if.eth?fe?fe.p(D,W):(fe=hf(D),fe.c(),fe.m(g,null)):fe&&(fe.d(1),fe=null),W&16&&Xe(g,D[4]),D[4]==1||D[4]==2?ae?ae.p(D,W):(ae=vf(D),ae.c(),ae.m(n,L)):ae&&(ae.d(1),ae=null),(!$||W&4)&&O!==(O=(((De=(ve=D[2].conf)==null?void 0:ve.general)==null?void 0:De.hostname)??"Hostname")+"")&&q(E,O),W&1&&H.value!==D[0].hostname&&V(H,D[0].hostname),(!$||W&4)&&X!==(X=(((Ee=D[2].btn)==null?void 0:Ee.save)??"Save")+"")&&q(U,X);const te={};W&32&&(te.active=D[5]),W&4&&(te.message=((Le=D[2].setup)==null?void 0:Le.mask)??"Lagrer"),le.$set(te)},i(D){$||(Z(se),Z(le.$$.fragment,D),$=!0)},o(D){ie(se),ie(le.$$.fragment,D),$=!1},d(D){D&&(N(e),N(Y)),fe&&fe.d(),ae&&ae.d(),Me(le,D),z=!1,Dt(x)}}}let t_=!1;function l_(t,e,l){let n=Cn,i={};wl.subscribe(h=>{l(2,i=h)});let s={};xi.subscribe(h=>{l(3,s=h)});let{sysinfo:o={}}=e,{data:r={}}=e,f=1,c=!1;function _(h){_l.update(g=>(g.trying=h,g))}async function d(h){l(5,c=!0);const g=new FormData(h.target),w=new URLSearchParams;for(let I of g){const[L,M]=I;w.append(L,M)}let A=await(await fetch("save",{method:"POST",body:w})).json();l(5,c=!1),_l.update(I=>(I.hostname=g.get("sh"),I.usrcfg=A.success,I.booting=A.reboot,A.reboot&&setTimeout(zn,5e3,o,_),I))}function m(){f=jt(this),l(4,f)}function v(){o.hostname=this.value,l(0,o)}return t.$$set=h=>{"sysinfo"in h&&l(0,o=h.sysinfo),"data"in h&&l(7,r=h.data)},t.$$.update=()=>{if(t.$$.dirty&128){const h=r==null?void 0:r.r;typeof h=="number"&&(h>=-50?l(1,n=ls):h>=-60?l(1,n=ts):h>=-75?l(1,n=es):l(1,n=Cn))}},[o,n,i,s,f,c,d,r,m,v]}class n_ extends Mt{constructor(e){super(),St(this,e,l_,e_,Ct,{sysinfo:0,data:7})}}function i_(t){var j,S,y,J;let e,l,n,i=(((j=t[2].upload)==null?void 0:j.title)??"Upload")+"",s,o,r,f,c,_=(((S=t[2].upload)==null?void 0:S.desc)??"")+"",d,m,v,h,g,w,k,A,I=(((y=t[2].btn)==null?void 0:y.upload)??"Upload")+"",L,M,O,E,F,H;return O=new cl({props:{active:t[3],message:((J=t[2].upload)==null?void 0:J.mask)??"Uploading"}}),{c(){e=p("div"),l=p("div"),n=p("strong"),s=C(i),o=b(),r=C(t[1]),f=b(),c=p("p"),d=C(_),m=b(),v=p("form"),h=p("input"),g=b(),w=p("div"),k=p("button"),A=p("p"),L=C(I),M=b(),Ne(O.$$.fragment),u(c,"class","mb-4"),u(h,"name","file"),u(h,"type","file"),u(A,"class","mb-4"),u(k,"type","submit"),u(k,"class","btn-pri"),u(w,"class","w-full text-right mt-4"),u(v,"action",t[0]),u(v,"enctype","multipart/form-data"),u(v,"method","post"),u(v,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(G,K){P(G,e,K),a(e,l),a(l,n),a(n,s),a(n,o),a(n,r),a(l,f),a(l,c),a(c,d),a(l,m),a(l,v),a(v,h),a(v,g),a(v,w),a(w,k),a(k,A),a(A,L),P(G,M,K),Se(O,G,K),E=!0,F||(H=re(v,"submit",t[4]),F=!0)},p(G,[K]){var U,Y,le,$;(!E||K&4)&&i!==(i=(((U=G[2].upload)==null?void 0:U.title)??"Upload")+"")&&q(s,i),(!E||K&2)&&q(r,G[1]),(!E||K&4)&&_!==(_=(((Y=G[2].upload)==null?void 0:Y.desc)??"")+"")&&q(d,_),(!E||K&4)&&I!==(I=(((le=G[2].btn)==null?void 0:le.upload)??"Upload")+"")&&q(L,I),(!E||K&1)&&u(v,"action",G[0]);const X={};K&8&&(X.active=G[3]),K&4&&(X.message=(($=G[2].upload)==null?void 0:$.mask)??"Uploading"),O.$set(X)},i(G){E||(Z(O.$$.fragment,G),E=!0)},o(G){ie(O.$$.fragment,G),E=!1},d(G){G&&(N(e),N(M)),Me(O,G),F=!1,H()}}}function s_(t,e,l){let{action:n}=e,{title:i}=e,s={};wl.subscribe(f=>{l(2,s=f)});let o=!1;const r=()=>l(3,o=!0);return t.$$set=f=>{"action"in f&&l(0,n=f.action),"title"in f&&l(1,i=f.title)},[n,i,s,o,r]}class os extends Mt{constructor(e){super(),St(this,e,s_,i_,Ct,{action:0,title:1})}}function o_(t){var ee,ne,be,we,R,T,B;let e,l,n,i,s=(((ee=t[1].consent)==null?void 0:ee.title)??"Consents")+"",o,r,f,c,_,d=(((ne=t[1].consent)==null?void 0:ne.one_click)??"One-click")+"",m,v,h,g,w=(((be=t[1].consent)==null?void 0:be.read_more)??"Read more")+"",k,A,I,L,M,O,E,F=(((we=t[1].consent)==null?void 0:we.yes)??"Yes")+"",H,j,S,y,J,G,K=(((R=t[1].consent)==null?void 0:R.no)??"No")+"",X,U,Y,le,$,z=(((T=t[1].btn)==null?void 0:T.save)??"Save")+"",x,fe,ae,se,_e,oe;return ae=new cl({props:{active:t[2],message:((B=t[1].consent)==null?void 0:B.mask_saving)??"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("div"),o=C(s),r=b(),f=p("hr"),c=b(),_=p("div"),m=C(d),v=p("br"),h=b(),g=p("a"),k=C(w),A=p("br"),I=b(),L=p("label"),M=p("input"),E=b(),H=C(F),j=b(),S=p("label"),y=p("input"),G=b(),X=C(K),U=p("br"),Y=b(),le=p("div"),$=p("button"),x=C(z),fe=b(),Ne(ae.$$.fragment),u(g,"href",vl("Data-collection-on-one-click-firmware-upgrade")),u(g,"target","_blank"),u(g,"class","text-blue-600 hover:text-blue-800"),u(M,"type","radio"),u(M,"name","sf"),M.value=1,M.checked=O=t[0].fwconsent===1,u(M,"class","rounded m-2"),M.required=!0,u(y,"type","radio"),u(y,"name","sf"),y.value=2,y.checked=J=t[0].fwconsent===2,u(y,"class","rounded m-2"),y.required=!0,u(_,"class","my-3"),u($,"type","submit"),u($,"class","btn-pri"),u(le,"class","my-3"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(D,W){P(D,e,W),a(e,l),a(l,n),a(n,i),a(i,o),a(n,r),a(n,f),a(n,c),a(n,_),a(_,m),a(_,v),a(_,h),a(_,g),a(g,k),a(_,A),a(_,I),a(_,L),a(L,M),a(L,E),a(L,H),a(_,j),a(_,S),a(S,y),a(S,G),a(S,X),a(_,U),a(n,Y),a(n,le),a(le,$),a($,x),P(D,fe,W),Se(ae,D,W),se=!0,_e||(oe=re(n,"submit",_n(t[3])),_e=!0)},p(D,[W]){var ue,ce,me,pe,ke,ve,De;(!se||W&2)&&s!==(s=(((ue=D[1].consent)==null?void 0:ue.title)??"Consents")+"")&&q(o,s),(!se||W&2)&&d!==(d=(((ce=D[1].consent)==null?void 0:ce.one_click)??"One-click")+"")&&q(m,d),(!se||W&2)&&w!==(w=(((me=D[1].consent)==null?void 0:me.read_more)??"Read more")+"")&&q(k,w),(!se||W&1&&O!==(O=D[0].fwconsent===1))&&(M.checked=O),(!se||W&2)&&F!==(F=(((pe=D[1].consent)==null?void 0:pe.yes)??"Yes")+"")&&q(H,F),(!se||W&1&&J!==(J=D[0].fwconsent===2))&&(y.checked=J),(!se||W&2)&&K!==(K=(((ke=D[1].consent)==null?void 0:ke.no)??"No")+"")&&q(X,K),(!se||W&2)&&z!==(z=(((ve=D[1].btn)==null?void 0:ve.save)??"Save")+"")&&q(x,z);const te={};W&4&&(te.active=D[2]),W&2&&(te.message=((De=D[1].consent)==null?void 0:De.mask_saving)??"Saving"),ae.$set(te)},i(D){se||(Z(ae.$$.fragment,D),se=!0)},o(D){ie(ae.$$.fragment,D),se=!1},d(D){D&&(N(e),N(fe)),Me(ae,D),_e=!1,oe()}}}function a_(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,s={};wl.subscribe(f=>{l(1,s=f)});let o=!1;async function r(f){l(2,o=!0);const c=new FormData(f.target),_=new URLSearchParams;for(let v of c){const[h,g]=v;_.append(h,g)}let m=await(await fetch("save",{method:"POST",body:_})).json();l(2,o=!1),_l.update(v=>(v.fwconsent=c.sf===!0?1:c.sf===!1?2:0,v.booting=m.reboot,v)),sn(n)}return t.$$set=f=>{"basepath"in f&&l(4,n=f.basepath),"sysinfo"in f&&l(0,i=f.sysinfo)},[i,s,o,r,n]}class f_ extends Mt{constructor(e){super(),St(this,e,a_,o_,Ct,{basepath:4,sysinfo:0})}}function kf(t,e,l){const n=t.slice();return n[30]=e[l],n[31]=e,n[32]=l,n}function wf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function u_(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Cf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function r_(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Sf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Mf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Nf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Pf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Tf(t){let e,l=it(t[1].o),n=[];for(let i=0;i0?"text-green-600":"text-gray-300"),u(tt,"class",Be=t[32]{l(0,i=U)});let s=["mo","tu","we","th","fr","sa","su"],o={},r=!0,f=!1;Ou.subscribe(U=>{U.o&&(l(1,o=U),l(2,r=!1))}),Vc();async function c(U){l(3,f=!0);const Y=new URLSearchParams;Y.append("r","true"),Y.append("rc",o.o.length),o.o.forEach(function($,z){Y.append("rt"+z,$.t),Y.append("rn"+z,$.n),Y.append("rd"+z,$.d),Y.append("ra"+z,$.a),Y.append("rh"+z,$.h),Y.append("rv"+z,$.v),Y.append("rsm"+z,$.s.m),Y.append("rsd"+z,$.s.d),Y.append("rem"+z,$.e.m),Y.append("red"+z,$.e.d)}),await(await fetch("save",{method:"POST",body:Y})).json(),l(3,f=!1),sn(n+"configuration")}let _=function(U,Y){return U.includes(Y)?U=U.filter(function(le){return le!==Y}):U.push(Y),U},d=function(){let U=o.o;U.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.001,s:{m:0,d:0},e:{m:0,d:0}}),l(1,o.o=U,o)},m=function(U){let Y=o.o;Y.splice(U,1),l(1,o.o=Y,o)},v=function(U){if(U<=0)return;let Y=o.o;var le=Y[U];Y[U]=Y[U-1],Y[U-1]=le,l(1,o.o=Y,o)},h=function(U){let Y=o.o;if(!(U>=Y.length-1)){var le=Y[U];Y[U]=Y[U+1],Y[U+1]=le,l(1,o.o=Y,o)}};function g(U,Y){U[Y].n=this.value,l(1,o)}function w(U,Y){U[Y].d=jt(this),l(1,o)}function k(U,Y){U[Y].t=jt(this),l(1,o)}function A(U,Y){U[Y].v=ye(this.value),l(1,o)}const I=(U,Y,le,$)=>l(1,le[$].a=_(U.a,Y),o),L=(U,Y,le,$)=>l(1,le[$].h=_(U.h,Y),o),M=(U,Y,le,$)=>l(1,le[$].h=_(U.h,Y+8),o),O=(U,Y,le,$)=>l(1,le[$].h=_(U.h,Y+16),o);function E(U,Y){U[Y].s.d=jt(this),l(1,o)}function F(U,Y){U[Y].s.m=jt(this),l(1,o)}function H(U,Y){U[Y].e.d=jt(this),l(1,o)}function j(U,Y){U[Y].e.m=jt(this),l(1,o)}const S=U=>v(U),y=U=>v(U),J=U=>h(U),G=U=>h(U),K=U=>m(U),X=U=>m(U);return t.$$set=U=>{"basepath"in U&&l(11,n=U.basepath)},[i,o,r,f,s,c,_,d,m,v,h,n,g,w,k,A,I,L,M,O,E,F,H,j,S,y,J,G,K,X]}class d_ extends Mt{constructor(e){super(),St(this,e,p_,m_,Ct,{basepath:11},null,[-1,-1])}}function Rf(t,e,l){const n=t.slice();return n[13]=e[l],n[14]=e,n[15]=l,n}function Ff(t,e,l){const n=t.slice();return n[13]=e[l],n[16]=e,n[17]=l,n}function Uf(t){let e,l,n,i=it(t[1]),s=[];for(let o=0;o{l(3,r=w)});let f=!1,c,_;async function d(){if(confirm("Clear all data?"))for(let w in i)(w.startsWith("i")||w.startsWith("e"))&&l(0,i[w]=0,i)}let m=!1;async function v(w){l(5,m=!0);const k=new FormData(w.target),A=new URLSearchParams;for(let L of k){const[M,O]=L;A.append(M,O)}await(await fetch(s,{method:"POST",body:A})).json(),l(5,m=!1),sn(o)}function h(w){i[w.key]=ye(this.value),l(0,i)}function g(w){i[w.key]=ye(this.value),l(0,i)}return t.$$set=w=>{"prefix"in w&&l(8,n=w.prefix),"data"in w&&l(0,i=w.data),"url"in w&&l(9,s=w.url),"basepath"in w&&l(10,o=w.basepath)},t.$$.update=()=>{if(t.$$.dirty&263){l(1,c=[]),l(2,_=[]);for(let w in i){let k=[];w.startsWith("i")?k=c:w.startsWith("e")&&(k=_,i[w]&&l(4,f=!0)),k.push({key:w,name:n+" "+w.substring(1),value:i[w]})}}},[i,c,_,r,f,m,d,v,n,s,o,h,g]}class Ru extends Mt{constructor(e){super(),St(this,e,v_,h_,Ct,{prefix:8,data:0,url:9,basepath:10})}}function b_(t){let e,l;return e=new Wc({props:{data:t[6],sysinfo:t[7],prices:t[1],dayPlot:t[2],monthPlot:t[3],temperatures:t[4],translations:t[5],tariffData:t[8]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.data=n[6]),i&128&&(s.sysinfo=n[7]),i&2&&(s.prices=n[1]),i&4&&(s.dayPlot=n[2]),i&8&&(s.monthPlot=n[3]),i&16&&(s.temperatures=n[4]),i&32&&(s.translations=n[5]),i&256&&(s.tariffData=n[8]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function g_(t){let e,l;return e=new L0({props:{sysinfo:t[7],basepath:t[0],data:t[6]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.sysinfo=n[7]),i&1&&(s.basepath=n[0]),i&64&&(s.data=n[6]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function k_(t){let e,l;return e=new d_({props:{basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function w_(t){let e,l;return e=new G0({props:{sysinfo:t[7],data:t[6]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.sysinfo=n[7]),i&64&&(s.data=n[6]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function C_(t){let e,l;return e=new os({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p:Ve,i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function S_(t){let e,l;return e=new os({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p:Ve,i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function M_(t){let e,l;return e=new os({props:{title:"private key",action:"/mqtt-key"}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p:Ve,i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function N_(t){let e,l;return e=new f_({props:{sysinfo:t[7],basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.sysinfo=n[7]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function P_(t){let e,l;return e=new n_({props:{sysinfo:t[7],data:t[6]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.sysinfo=n[7]),i&64&&(s.data=n[6]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function T_(t){let e,l;return e=new Z0({props:{sysinfo:t[7],basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.sysinfo=n[7]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function E_(t){let e,l;return e=new Ru({props:{prefix:"UTC Hour",data:t[2],url:"/dayplot",basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&4&&(s.data=n[2]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function q_(t){let e,l;return e=new Ru({props:{prefix:"Day",data:t[3],url:"/monthplot",basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&8&&(s.data=n[3]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function D_(t){let e,l,n,i,s,o,r,f,c,_,d,m,v,h,g,w,k,A,I,L,M,O,E,F,H,j;return e=new K1({props:{data:t[6],basepath:t[0]}}),n=new bl({props:{path:"/",$$slots:{default:[b_]},$$scope:{ctx:t}}}),s=new bl({props:{path:"/configuration",$$slots:{default:[g_]},$$scope:{ctx:t}}}),r=new bl({props:{path:"/priceconfig",$$slots:{default:[k_]},$$scope:{ctx:t}}}),c=new bl({props:{path:"/status",$$slots:{default:[w_]},$$scope:{ctx:t}}}),d=new bl({props:{path:"/mqtt-ca",$$slots:{default:[C_]},$$scope:{ctx:t}}}),v=new bl({props:{path:"/mqtt-cert",$$slots:{default:[S_]},$$scope:{ctx:t}}}),g=new bl({props:{path:"/mqtt-key",$$slots:{default:[M_]},$$scope:{ctx:t}}}),k=new bl({props:{path:"/consent",$$slots:{default:[N_]},$$scope:{ctx:t}}}),I=new bl({props:{path:"/setup",$$slots:{default:[P_]},$$scope:{ctx:t}}}),M=new bl({props:{path:"/vendor",$$slots:{default:[T_]},$$scope:{ctx:t}}}),E=new bl({props:{path:"/edit-day",$$slots:{default:[E_]},$$scope:{ctx:t}}}),H=new bl({props:{path:"/edit-month",$$slots:{default:[q_]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment),l=b(),Ne(n.$$.fragment),i=b(),Ne(s.$$.fragment),o=b(),Ne(r.$$.fragment),f=b(),Ne(c.$$.fragment),_=b(),Ne(d.$$.fragment),m=b(),Ne(v.$$.fragment),h=b(),Ne(g.$$.fragment),w=b(),Ne(k.$$.fragment),A=b(),Ne(I.$$.fragment),L=b(),Ne(M.$$.fragment),O=b(),Ne(E.$$.fragment),F=b(),Ne(H.$$.fragment)},m(S,y){Se(e,S,y),P(S,l,y),Se(n,S,y),P(S,i,y),Se(s,S,y),P(S,o,y),Se(r,S,y),P(S,f,y),Se(c,S,y),P(S,_,y),Se(d,S,y),P(S,m,y),Se(v,S,y),P(S,h,y),Se(g,S,y),P(S,w,y),Se(k,S,y),P(S,A,y),Se(I,S,y),P(S,L,y),Se(M,S,y),P(S,O,y),Se(E,S,y),P(S,F,y),Se(H,S,y),j=!0},p(S,y){const J={};y&64&&(J.data=S[6]),y&1&&(J.basepath=S[0]),e.$set(J);const G={};y&2558&&(G.$$scope={dirty:y,ctx:S}),n.$set(G);const K={};y&2241&&(K.$$scope={dirty:y,ctx:S}),s.$set(K);const X={};y&2049&&(X.$$scope={dirty:y,ctx:S}),r.$set(X);const U={};y&2240&&(U.$$scope={dirty:y,ctx:S}),c.$set(U);const Y={};y&2048&&(Y.$$scope={dirty:y,ctx:S}),d.$set(Y);const le={};y&2048&&(le.$$scope={dirty:y,ctx:S}),v.$set(le);const $={};y&2048&&($.$$scope={dirty:y,ctx:S}),g.$set($);const z={};y&2177&&(z.$$scope={dirty:y,ctx:S}),k.$set(z);const x={};y&2240&&(x.$$scope={dirty:y,ctx:S}),I.$set(x);const fe={};y&2177&&(fe.$$scope={dirty:y,ctx:S}),M.$set(fe);const ae={};y&2053&&(ae.$$scope={dirty:y,ctx:S}),E.$set(ae);const se={};y&2057&&(se.$$scope={dirty:y,ctx:S}),H.$set(se)},i(S){j||(Z(e.$$.fragment,S),Z(n.$$.fragment,S),Z(s.$$.fragment,S),Z(r.$$.fragment,S),Z(c.$$.fragment,S),Z(d.$$.fragment,S),Z(v.$$.fragment,S),Z(g.$$.fragment,S),Z(k.$$.fragment,S),Z(I.$$.fragment,S),Z(M.$$.fragment,S),Z(E.$$.fragment,S),Z(H.$$.fragment,S),j=!0)},o(S){ie(e.$$.fragment,S),ie(n.$$.fragment,S),ie(s.$$.fragment,S),ie(r.$$.fragment,S),ie(c.$$.fragment,S),ie(d.$$.fragment,S),ie(v.$$.fragment,S),ie(g.$$.fragment,S),ie(k.$$.fragment,S),ie(I.$$.fragment,S),ie(M.$$.fragment,S),ie(E.$$.fragment,S),ie(H.$$.fragment,S),j=!1},d(S){S&&(N(l),N(i),N(o),N(f),N(_),N(m),N(h),N(w),N(A),N(L),N(O),N(F)),Me(e,S),Me(n,S),Me(s,S),Me(r,S),Me(c,S),Me(d,S),Me(v,S),Me(g,S),Me(k,S),Me(I,S),Me(M,S),Me(E,S),Me(H,S)}}}function zf(t){let e,l,n,i;const s=[L_,A_],o=[];function r(f,c){return f[7].trying?0:1}return e=r(t),l=o[e]=s[e](t),{c(){l.c(),n=yt()},m(f,c){o[e].m(f,c),P(f,n,c),i=!0},p(f,c){let _=e;e=r(f),e===_?o[e].p(f,c):(mt(),ie(o[_],1,1,()=>{o[_]=null}),pt(),l=o[e],l?l.p(f,c):(l=o[e]=s[e](f),l.c()),Z(l,1),l.m(n.parentNode,n))},i(f){i||(Z(l),i=!0)},o(f){ie(l),i=!1},d(f){f&&N(n),o[e].d(f)}}}function A_(t){let e,l;return e=new cl({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p:Ve,i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function L_(t){let e,l;return e=new cl({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[7].trying}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.message="Device is booting, please wait. Trying to reach it on "+n[7].trying),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){ie(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function O_(t){let e,l,n,i;l=new pu({props:{basepath:t[0],$$slots:{default:[D_]},$$scope:{ctx:t}}});let s=t[7].booting&&zf(t);return{c(){e=p("div"),Ne(l.$$.fragment),n=b(),s&&s.c(),u(e,"class","container mx-auto m-3")},m(o,r){P(o,e,r),Se(l,e,null),a(e,n),s&&s.m(e,null),i=!0},p(o,[r]){const f={};r&1&&(f.basepath=o[0]),r&2559&&(f.$$scope={dirty:r,ctx:o}),l.$set(f),o[7].booting?s?(s.p(o,r),r&128&&Z(s,1)):(s=zf(o),s.c(),Z(s,1),s.m(e,null)):s&&(mt(),ie(s,1,1,()=>{s=null}),pt())},i(o){i||(Z(l.$$.fragment,o),Z(s),i=!0)},o(o){ie(l.$$.fragment,o),ie(s),i=!1},d(o){o&&N(e),Me(l),s&&s.d()}}}function I_(t,e,l){let n=document.getElementsByTagName("base")[0].getAttribute("href");n||(n="/");let i;$i.subscribe(h=>{l(1,i=h)});let s;Su.subscribe(h=>{l(2,s=h)});let o;Mu.subscribe(h=>{l(3,o=h)});let r;Nu.subscribe(h=>{l(4,r=h)});let f={};wl.subscribe(h=>{l(5,f=h)});let c,_={},d={},m;_l.subscribe(h=>{var g;l(7,d=h),d.vndcfg===!1?sn(n+"vendor"):d.usrcfg===!1?sn(n+"setup"):d.fwconsent===0&&sn(n+"consent"),d.ui.k===1?document.documentElement.classList.add("dark"):d.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"),d.ui.lang&&d.ui.lang!=((g=f==null?void 0:f.language)==null?void 0:g.code)&&Eu(d.ui.lang),d.version&&m&&d.version!=m&&window.location.reload(),m=d.version,c&&clearTimeout(c),c=setTimeout(_i,!_||!_.u||_.u<30||d!=null&&d.upgrading?1e4:3e5)}),m1.subscribe(h=>{l(6,_=h),Oc(h)});let v={};return Tu.subscribe(h=>{l(8,v=h)}),Pu(),[n,i,s,o,r,f,_,d,v]}class R_ extends Mt{constructor(e){super(),St(this,e,I_,O_,Ct,{})}}new R_({target:document.getElementById("app")}); +Occurred in: ${i}`:"",o=Xi(t),r=Jf(e)?e(o):e;return`<${o}> ${r}${s}`}const cu=t=>(...e)=>t(gr(...e)),_u=cu(t=>{throw new Error(t)}),fi=cu(console.warn),rs=4,kr=3,wr=2,Cr=1,Sr=1;function Mr(t,e){const l=t.default?0:Pl(t.fullPath).reduce((n,i)=>{let s=n;return s+=rs,rr(i)?s+=Sr:cr(i)?s+=wr:su(i)?s-=rs+Cr:s+=kr,s},0);return{route:t,score:l,index:e}}function Nr(t){return t.map(Mr).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function mu(t,e){let l,n;const[i]=e.split("?"),s=Pl(i),o=s[0]==="",r=Nr(t);for(let f=0,c=r.length;f({..._,params:m,uri:k});if(_.default){n=h(e);continue}const v=Pl(_.fullPath),b=Math.max(s.length,v.length);let w=0;for(;w{c===".."?f.pop():c!=="."&&f.push(c)}),pi(`/${f.join("/")}`,n)}function cs(t,e){const{pathname:l,hash:n="",search:i="",state:s}=t,o=Pl(e,!0),r=Pl(l,!0);for(;o.length;)o[0]!==r[0]&&_u(_n,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),o.shift(),r.shift();return{pathname:Xn(...r),hash:n,search:i,state:s}}const _s=t=>t.length===1?"":t,Qi=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,s=i?_s(In(t,l)):"",o=i?In(t,0,l):t,r=n?_s(In(o,e)):"";return{pathname:(n?In(o,0,e):o)||"/",search:r,hash:s}},Pr=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function Er(t,e,l){return Xn(l,Tr(t,e))}function qr(t,e){const l=Ki(_r(t)),n=Pl(l,!0),i=Pl(e,!0).slice(0,n.length),s=pu({fullPath:l},Xn(...i));return s&&s.uri}const di="POP",Dr="PUSH",Ar="REPLACE";function hi(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function Or(t){let e=[],l=hi(t),n=di;const i=(s=e)=>s.forEach(o=>o({location:l,action:n}));return{get location(){return l},listen(s){e.push(s);const o=()=>{l=hi(t),n=di,i([s])};i([s]);const r=eu(t,"popstate",o);return()=>{r(),e=e.filter(f=>f!==s)}},navigate(s,o){const{state:r={},replace:f=!1}=o||{};if(n=f?Ar:Dr,$f(s))o&&fi(ru,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=di,t.history.go(s);else{const c={...r,_key:or()};try{t.history[f?"replaceState":"pushState"](c,"",s)}catch{t.location[f?"replace":"assign"](s)}}l=hi(t),i()}}}function vi(t,e){return{...Qi(e),state:t}}function Lr(t="/"){let e=0,l=[vi(null,t)];return{get entries(){return l},get location(){return l[e]},addEventListener(){},removeEventListener(){},history:{get state(){return l[e].state},pushState(n,i,s){e++,l=l.slice(0,e),l.push(vi(n,s))},replaceState(n,i,s){l[e]=vi(n,s)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const Ir=!!(!Al&&window.document&&window.document.createElement),Rr=!Al&&window.location.origin==="null",du=Or(Ir&&!Rr?window:Lr()),{navigate:on}=du;let El=null,hu=!0;function Fr(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nEl.level||t.level===El.level&&Fr(t.routerId,El.routerId))&&(El=t)}function Br(){El=null}function yr(){hu=!1}function ms(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=eu(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function jr(t,e){return Number(t.dataset.svnavRouteEnd)===e}function zr(t){return/^H[1-6]$/i.test(t.tagName)}function ps(t,e=document){return e.querySelector(t)}function Hr(t){let l=ps(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!jr(l,t);){if(zr(l))return l;const n=ps("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function Wr(t){Promise.resolve(nn(t.focusElement)).then(e=>{const l=e||Hr(t.id);l||fi(_n,`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,ri),!ms(l)&&ms(document.documentElement)})}const Gr=(t,e,l)=>(n,i)=>$u().then(()=>{if(!El||hu){yr();return}if(n&&Wr(El.route),t.announcements&&i){const{path:s,fullPath:o,meta:r,params:f,uri:c}=El.route,_=t.createAnnouncement({path:s,fullPath:o,meta:r,params:f,uri:c},nn(l));Promise.resolve(_).then(d=>{e.set(d)})}Br()}),Vr="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 Kr(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},tu(t[6],Vr)],i={};for(let s=0;s`Navigated to ${z.uri}`,announcements:!0,...v},k=_,A=Ki(_),L=an(Mi),O=an(Cn),N=!L,D=Xr(),E=h&&!(O&&!O.manageFocus),F=al("");Tl(t,F,z=>l(0,r=z));const H=O?O.disableInlineStyles:b,y=al([]);Tl(t,y,z=>l(20,o=z));const S=al(null);Tl(t,S,z=>l(18,i=z));let j=!1;const $=N?0:O.level+1,W=N?al((()=>cs(Al?Qi(d):m.location,A))()):L;Tl(t,W,z=>l(17,n=z));const X=al(n);Tl(t,X,z=>l(19,s=z));const U=Gr(w,F,W),K=z=>ee=>ee.filter(ue=>ue.id!==z);function se(z){if(Al){if(j)return;const ee=pu(z,n.pathname);if(ee)return j=!0,ee}else y.update(ee=>{const ue=K(z.id)(ee);return ue.push(z),ue})}function x(z){y.update(K(z))}return!N&&_!==ds&&fi(_n,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:_}),N&&(Yf(()=>m.listen(ee=>{const ue=cs(ee.location,A);X.set(n),W.set(ue)})),Bn(Mi,W)),Bn(Cn,{activeRoute:S,registerRoute:se,unregisterRoute:x,manageFocus:E,level:$,id:D,history:N?m:O.history,basepath:N?A:O.basepath,disableInlineStyles:H}),t.$$set=z=>{"basepath"in z&&l(11,_=z.basepath),"url"in z&&l(12,d=z.url),"history"in z&&l(13,m=z.history),"primary"in z&&l(14,h=z.primary),"a11y"in z&&l(15,v=z.a11y),"disableInlineStyles"in z&&l(16,b=z.disableInlineStyles),"$$scope"in z&&l(21,c=z.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&_!==k&&fi(_n,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const z=mu(o,n.pathname);S.set(z)}if(t.$$.dirty[0]&655360&&N){const z=!!n.hash,ee=!z&&E,ue=!z||n.pathname!==s.pathname;U(ee,ue)}t.$$.dirty[0]&262144&&E&&i&&i.primary&&Ur({level:$,routerId:D,route:i})},[r,w,N,D,E,F,H,y,S,W,X,_,d,m,h,v,b,n,i,s,o,c,f]}class Zr extends Mt{constructor(e){super(),St(this,e,Qr,Yr,Ct,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const vu=Zr;function Qn(t,e,l=Cn,n=_n){an(l)||_u(t,s=>`You cannot use ${s} outside of a ${Xi(n)}.`,e)}const Jr=t=>{const{subscribe:e}=an(t);return{subscribe:e}};function bu(){return Qn(au),Jr(Mi)}function gu(){const{history:t}=an(Cn);return t}function ku(){const t=an(nu);return t?ar(t,e=>e.base):al("/")}function wu(){Qn(uu);const t=ku(),{basepath:e}=an(Cn);return n=>Er(n,nn(t),e)}function $r(){Qn(fu);const t=wu(),{navigate:e}=gu();return(n,i)=>{const s=$f(n)?n:t(n);return e(s,i)}}const xr=t=>({params:t&16,location:t&8}),hs=t=>({params:Al?nn(t[10]):t[4],location:t[3],navigate:t[11]});function vs(t){let e,l;return e=new vu({props:{primary:t[1],$$slots:{default:[l1]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&2&&(s.primary=n[1]),i&528409&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function e1(t){let e;const l=t[18].default,n=zi(l,t,t[19],hs);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&524312)&&Wi(n,l,i,i[19],e?Hi(l,i[19],s,xr):Gi(i[19]),hs)},i(i){e||(Z(n,i),e=!0)},o(i){oe(n,i),e=!1},d(i){n&&n.d(i)}}}function t1(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Al?nn(t[10]):t[4],t[12]];var s=t[0];function o(r,f){let c={};for(let _=0;_{Me(c,1)}),pt()}s?(e=as(s,o(r,f)),Ne(e.$$.fragment),Z(e.$$.fragment,1),Se(e,l.parentNode,l)):e=null}else if(s){const c=f&7192?Ci(i,[f&8&&{location:r[3]},f&2048&&{navigate:r[11]},f&1040&&$n(Al?nn(r[10]):r[4]),f&4096&&$n(r[12])]):{};e.$set(c)}},i(r){n||(e&&Z(e.$$.fragment,r),n=!0)},o(r){e&&oe(e.$$.fragment,r),n=!1},d(r){r&&M(l),e&&Me(e,r)}}}function l1(t){let e,l,n,i;const s=[t1,e1],o=[];function r(f,c){return f[0]!==null?0:1}return e=r(t),l=o[e]=s[e](t),{c(){l.c(),n=yt()},m(f,c){o[e].m(f,c),T(f,n,c),i=!0},p(f,c){let _=e;e=r(f),e===_?o[e].p(f,c):(mt(),oe(o[_],1,1,()=>{o[_]=null}),pt(),l=o[e],l?l.p(f,c):(l=o[e]=s[e](f),l.c()),Z(l,1),l.m(n.parentNode,n))},i(f){i||(Z(l),i=!0)},o(f){oe(l),i=!1},d(f){f&&M(n),o[e].d(f)}}}function n1(t){let e,l,n,i,s,o=[Si(t[7]),{"data-svnav-route-start":t[5]}],r={};for(let d=0;d{f=null}),pt())},i(d){s||(Z(f),s=!0)},o(d){oe(f),s=!1},d(d){d&&(M(e),M(l),M(n),M(i)),f&&f.d(d)}}}const i1=xf();function s1(t,e,l){let n;const i=["path","component","meta","primary"];let s=oi(e,i),o,r,f,c,{$$slots:_={},$$scope:d}=e,{path:m=""}=e,{component:h=null}=e,{meta:v={}}=e,{primary:b=!0}=e;Qn(ri,e);const w=i1(),{registerRoute:k,unregisterRoute:A,activeRoute:L,disableInlineStyles:O}=an(Cn);Tl(t,L,j=>l(16,o=j));const N=ku();Tl(t,N,j=>l(17,f=j));const D=bu();Tl(t,D,j=>l(3,r=j));const E=al(null);let F;const H=al(),y=al({});Tl(t,y,j=>l(4,c=j)),Bn(nu,H),Bn(fr,y),Bn(ur,E);const S=$r();return Al||Zu(()=>A(w)),t.$$set=j=>{l(24,e=gl(gl({},e),si(j))),l(12,s=oi(e,i)),"path"in j&&l(13,m=j.path),"component"in j&&l(0,h=j.component),"meta"in j&&l(14,v=j.meta),"primary"in j&&l(1,b=j.primary),"$$scope"in j&&l(19,d=j.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const j=m==="",$=Xn(f,m),G={id:w,path:m,meta:v,default:j,fullPath:j?"":$,base:j?f:qr($,r.pathname),primary:b,focusElement:E};H.set(G),l(15,F=k(G))}if(t.$$.dirty&98304&&l(2,n=!!(F||o&&o.id===w)),t.$$.dirty&98308&&n){const{params:j}=F||o;y.set(j)}},e=si(e),[h,b,n,r,c,w,L,O,N,D,y,S,s,m,v,F,o,f,_,d]}class o1 extends Mt{constructor(e){super(),St(this,e,s1,n1,Ct,{path:13,component:0,meta:14,primary:1})}}const bl=o1;function a1(t){let e,l,n,i;const s=t[13].default,o=zi(s,t,t[12],null);let r=[{href:t[0]},t[2],t[1]],f={};for(let c=0;cl(11,d=E));const L=Ju(),O=wu(),{navigate:N}=gu();function D(E){L("click",E),sr(E)&&(E.preventDefault(),N(n,{state:w,replace:o||b}))}return t.$$set=E=>{l(19,e=gl(gl({},e),si(E))),l(18,_=oi(e,c)),"to"in E&&l(5,v=E.to),"replace"in E&&l(6,b=E.replace),"state"in E&&l(7,w=E.state),"getProps"in E&&l(8,k=E.getProps),"$$scope"in E&&l(12,h=E.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=O(v,d)),t.$$.dirty&2049&&l(10,i=Ni(d.pathname,n)),t.$$.dirty&2049&&l(9,s=n===d.pathname),t.$$.dirty&2049&&(o=Qi(n)===Pr(d)),t.$$.dirty&512&&l(2,r=s?{"aria-current":"page"}:{}),l(1,f=(()=>{if(Jf(k)){const E=k({location:d,href:n,isPartiallyCurrent:i,isCurrent:s});return{..._,...E}}return _})())},e=si(e),[n,f,r,A,D,v,b,w,k,s,i,d,h,m]}class u1 extends Mt{constructor(e){super(),St(this,e,f1,a1,Ct,{to:5,replace:6,state:7,getProps:8})}}const hl=u1;function xn(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function r1(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 zn(t){return t>75?"#23ac05":t>50?"#77d900":t>25?"#94d900":"#569f12"}function ui(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 gt(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function Ye(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 245:return"wESP32";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"µHAN 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 yn(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Wt(t,e){return t==1||t==2&&e}function vl(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function zt(t,e){return t==null||isNaN(t)?"-":(isNaN(e)&&(e=t<1?2:t<10?1:0),t.toFixed(e))}function Ol(t,e){return t.setTime(t.getTime()+e*36e5),t}function c1(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function _1(t){return t=="EOE"?"https://transparency.entsoe.eu/":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}let bs=0;function cn(t,e){bs++;const l=m1(t);if(!l.length){e&&e(""),setTimeout(cn,1500,t,e);return}const n=l[(bs-1)%l.length];if(!n){setTimeout(cn,1e3,t,e);return}const i=p1(n);console&&console.log("Trying url "+i),e&&e(i);const s=function(){setTimeout(cn,1e3,t,e)},o=new XMLHttpRequest;o.timeout=5e3,o.addEventListener("abort",s),o.addEventListener("error",s),o.addEventListener("timeout",s),o.addEventListener("load",function(){window.location.href=i||"/"});const r=i.replace(/\/$/,"")+"/is-alive";o.open("GET",r,!0),o.send()}function m1(t={}){const e=Array.isArray(t.targets)?t.targets:[],l=[];t.net&&t.net.ip&&l.push(t.net.ip),t.hostname&&(l.push(t.hostname),t.hostname.indexOf(".")===-1&&t.hostname.indexOf(":")===-1&&l.push(`${t.hostname}.local`));const n=[...e,...l],i=[];for(const s of n){if(!s)continue;const o=s.toString().trim();o&&(i.includes(o)||i.push(o))}return i}function p1(t){if(!t)return"";const e=t.toString().trim();return e.startsWith("http://")||e.startsWith("https://")?e:`http://${e}`}function Zt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function gs(t){return t.startsWith("esp32")?"esp32":t}function cl(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}function Hn(t,e){let l=[zt(t,2),e];if(typeof t>"u")l[0]="-",l[1]=e;else if(Math.abs(t*100)<100){switch(l[0]=zt(t*100,2),e){case"NOK":case"DKK":e="øre";break;case"SEK":e="öre";break;case"EUR":e="cent";break;case"CHF":e="rp.";break;default:e=e+"/100"}l[1]=e}return l}let ni="((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}",Ll="[\\x20-\\x7E]+",Wn="[\\x20-\\xFF]+",Gn="[A-Za-z0-9_\\-]+",Cu="[0-9A-Fa-f]+",Ln="[0-9]+",ii={},Ti=[];async function d1(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),s=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),s}let bi;async function Su(){if(Ti.length){let t=Ti.shift();delete ii[t.resource];try{let e=await d1(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]()}}bi&&clearTimeout(bi),bi=setTimeout(Su,100)}Su();async function kl(t,e={}){let l;return ii[t]?l=ii[t]:(l={resource:t,options:e,callbacks:[]},ii[t]=l,Ti.push(l)),new Promise(i=>l.callbacks.push(i))}let Nl={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null,if:{eth:!1}};async function ci(){Nl=await(await kl("sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),rl.set(Nl)}const rl=al(Nl,t=>(ci(),function(){}));function h1(t){rl.update(e=>(e.trying=t,e))}let ei=0,ks=-127,ws=null,v1={};const b1=lu(v1,t=>{let e,l;async function n(){kl("data.json").then(i=>i.json()).then(i=>{t(i),ks!=i.t&&(ks=i.t,setTimeout(g1,2e3)),ws==null&&i.pe&&i.p!=null&&(ws=i.p,Nu()),(!Nl||!Nl.chip||Nl.booting||ei>1&&!yn(Nl.board))&&(ci(),ql&&clearTimeout(ql),ql=setTimeout(qi,2e3),Dl&&clearTimeout(Dl),Dl=setTimeout(Ai,3e3)),i.u,ql||(ql=qi()),Dl||(Dl=Ai());let s=5e3;if(yn(Nl.board)&&i.v>2.5){let o=3.3-Math.min(3.3,i.v);o>0&&(s=Math.max(o,.1)*10*5e3)}s>5e3&&console.log("Next in "+s+"ms"),e&&clearTimeout(e),e=setTimeout(n,s),ei=0}).catch(i=>{ei++,ei>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(n,15e3),l||(l=setTimeout(cn,5e3,Nl,h1))):e=setTimeout(n,yn(Nl.board)?1e4:5e3)})}return n(),function(){clearTimeout(e)}});let Pi={},Rn;const Ji=al(Pi);async function Mu(){let t=!1;Ji.update(e=>{for(var l=0;l<36;l++){if(e[gt(l)]==null){t=l<12;break}e[gt(l)]=e[gt(l+1)]}return e}),t?Nu():Rn=setTimeout(Mu,(60-new Date().getMinutes())*6e4)}async function Nu(){Rn&&(clearTimeout(Rn),Rn=0),Pi=await(await kl("energyprice.json")).json(),Ji.set(Pi),Rn=setTimeout(Mu,(60-new Date().getMinutes())*6e4)}let Ei={},ql;async function qi(){ql&&(clearTimeout(ql),ql=0),Ei=await(await kl("dayplot.json")).json(),Tu.set(Ei),ql=setTimeout(qi,(60-new Date().getMinutes())*6e4+20)}const Tu=al(Ei,t=>function(){});let Di={},Dl;async function Ai(){Dl&&(clearTimeout(Dl),Dl=0),Di=await(await kl("monthplot.json")).json(),Pu.set(Di),Dl=setTimeout(Ai,(24-new Date().getHours())*36e5+40)}const Pu=al(Di,t=>function(){});let Oi={};async function g1(){Oi=await(await kl("temperature.json")).json(),Eu.set(Oi)}const Eu=al(Oi,t=>function(){});let Li={},ti;async function qu(){ti&&(clearTimeout(ti),ti=0),Li=await(await kl("tariff.json")).json(),Du.set(Li),ti=setTimeout(qu,(60-new Date().getMinutes())*6e4+30)}const Du=al(Li,t=>function(){});let bn={c:-1,n:[]};async function k1(){let e=await(await kl("wifiscan.json",{timeout:3e4})).json(),l=[];bn.c=0,bn.n=[];for(let n=0;n(k1(),function(){}));let Ii=!1;const wl=al(Ii);async function Au(t){Ii=await(await kl("translations.json"+(t?"?lang="+t:""))).json(),wl.set(Ii)}Au();const w1="/neas_logotype_white.svg",xi="/wifi-low-light.svg",es="/wifi-medium-light.svg",ts="/wifi-high-light.svg",Sn="/wifi-off-light.svg";function Cs(t){return"WARNING: "+t+" must be connected to an external power supply during firmware upgrade. Failure to do so may cause power-down during upload resulting in non-functioning unit."}async function Ou(t){return await(await fetch("upgrade?expected_version="+t,{method:"POST"})).json()}function Ss(t){var f;let e=(((f=t[1].header)==null?void 0:f.uptime)??"Up")+"",l,n,i;function s(c,_){return c[2]>1?E1:c[2]>0?P1:c[3]>1?T1:c[3]>0?N1:c[4]>1?M1:c[4]>0?S1:C1}let o=s(t),r=o(t);return{c(){l=C(e),n=g(),r.c(),i=yt()},m(c,_){T(c,l,_),T(c,n,_),r.m(c,_),T(c,i,_)},p(c,_){var d;_&2&&e!==(e=(((d=c[1].header)==null?void 0:d.uptime)??"Up")+"")&&q(l,e),o===(o=s(c))&&r?r.p(c,_):(r.d(1),r=o(c),r&&(r.c(),r.m(i.parentNode,i)))},d(c){c&&(M(l),M(n),M(i)),r.d(c)}}}function C1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.seconds)??"s")+"",i;return{c(){e=C(t[0]),l=g(),i=C(n)},m(o,r){T(o,e,r),T(o,l,r),T(o,i,r)},p(o,r){var f;r&1&&q(e,o[0]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.seconds)??"s")+"")&&q(i,n)},d(o){o&&(M(e),M(l),M(i))}}}function S1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.minute)??"m")+"",i;return{c(){e=C(t[4]),l=g(),i=C(n)},m(o,r){T(o,e,r),T(o,l,r),T(o,i,r)},p(o,r){var f;r&16&&q(e,o[4]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.minute)??"m")+"")&&q(i,n)},d(o){o&&(M(e),M(l),M(i))}}}function M1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.minutes)??"m")+"",i;return{c(){e=C(t[4]),l=g(),i=C(n)},m(o,r){T(o,e,r),T(o,l,r),T(o,i,r)},p(o,r){var f;r&16&&q(e,o[4]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.minutes)??"m")+"")&&q(i,n)},d(o){o&&(M(e),M(l),M(i))}}}function N1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.hour)??"h")+"",i;return{c(){e=C(t[3]),l=g(),i=C(n)},m(o,r){T(o,e,r),T(o,l,r),T(o,i,r)},p(o,r){var f;r&8&&q(e,o[3]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.hour)??"h")+"")&&q(i,n)},d(o){o&&(M(e),M(l),M(i))}}}function T1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.hours)??"h")+"",i;return{c(){e=C(t[3]),l=g(),i=C(n)},m(o,r){T(o,e,r),T(o,l,r),T(o,i,r)},p(o,r){var f;r&8&&q(e,o[3]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.hours)??"h")+"")&&q(i,n)},d(o){o&&(M(e),M(l),M(i))}}}function P1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.day)??"d")+"",i;return{c(){e=C(t[2]),l=g(),i=C(n)},m(o,r){T(o,e,r),T(o,l,r),T(o,i,r)},p(o,r){var f;r&4&&q(e,o[2]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.day)??"d")+"")&&q(i,n)},d(o){o&&(M(e),M(l),M(i))}}}function E1(t){var s;let e,l,n=(((s=t[1].common)==null?void 0:s.days)??"d")+"",i;return{c(){e=C(t[2]),l=g(),i=C(n)},m(o,r){T(o,e,r),T(o,l,r),T(o,i,r)},p(o,r){var f;r&4&&q(e,o[2]),r&2&&n!==(n=(((f=o[1].common)==null?void 0:f.days)??"d")+"")&&q(i,n)},d(o){o&&(M(e),M(l),M(i))}}}function q1(t){let e,l=t[0]&&Ss(t);return{c(){l&&l.c(),e=yt()},m(n,i){l&&l.m(n,i),T(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Ss(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Ve,o:Ve,d(n){n&&M(e),l&&l.d(n)}}}function D1(t,e,l){let{epoch:n}=e,i={};wl.subscribe(f=>{l(1,i=f)});let s=0,o=0,r=0;return t.$$set=f=>{"epoch"in f&&l(0,n=f.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(2,s=Math.floor(n/86400)),l(3,o=Math.floor(n/3600)),l(4,r=Math.floor(n/60)))},[n,i,s,o,r]}class A1 extends Mt{constructor(e){super(),St(this,e,D1,q1,Ct,{epoch:0})}}function O1(t){let e,l,n;return{c(){e=p("span"),l=C(t[2]),u(e,"title",t[1]),u(e,"class",n="bd-"+t[0])},m(i,s){T(i,e,s),a(e,l)},p(i,[s]){s&4&&q(l,i[2]),s&2&&u(e,"title",i[1]),s&1&&n!==(n="bd-"+i[0])&&u(e,"class",n)},i:Ve,o:Ve,d(i){i&&M(e)}}}function L1(t,e,l){let{color:n}=e,{title:i}=e,{text:s}=e;return t.$$set=o=>{"color"in o&&l(0,n=o.color),"title"in o&&l(1,i=o.title),"text"in o&&l(2,s=o.text)},[n,i,s]}class Vn extends Mt{constructor(e){super(),St(this,e,L1,O1,Ct,{color:0,title:1,text:2})}}function I1(t){let e,l=`${gt(t[0].getDate())}.${gt(t[0].getMonth()+1)}.${t[0].getFullYear()} ${gt(t[0].getHours())}:${gt(t[0].getMinutes())}`,n;return{c(){e=p("span"),n=C(l),u(e,"class",t[1])},m(i,s){T(i,e,s),a(e,n)},p(i,s){s&1&&l!==(l=`${gt(i[0].getDate())}.${gt(i[0].getMonth()+1)}.${i[0].getFullYear()} ${gt(i[0].getHours())}:${gt(i[0].getMinutes())}`)&&q(n,l),s&2&&u(e,"class",i[1])},d(i){i&&M(e)}}}function R1(t){var n;let e=`${gt(t[0].getDate())}. ${t[2].months?(n=t[2].months)==null?void 0:n[t[0].getMonth()]:gt(t[0].getMonth()+1)} ${gt(t[0].getHours())}:${gt(t[0].getMinutes())}`,l;return{c(){l=C(e)},m(i,s){T(i,l,s)},p(i,s){var o;s&5&&e!==(e=`${gt(i[0].getDate())}. ${i[2].months?(o=i[2].months)==null?void 0:o[i[0].getMonth()]:gt(i[0].getMonth()+1)} ${gt(i[0].getHours())}:${gt(i[0].getMinutes())}`)&&q(l,e)},d(i){i&&M(l)}}}function F1(t){let e;function l(s,o){return s[3]?R1:I1}let n=l(t),i=n(t);return{c(){i.c(),e=yt()},m(s,o){i.m(s,o),T(s,e,o)},p(s,[o]){n===(n=l(s))&&i?i.p(s,o):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},i:Ve,o:Ve,d(s){s&&M(e),i.d(s)}}}function U1(t,e,l){let n={};wl.subscribe(f=>{l(2,n=f)});let{timestamp:i}=e,{fullTimeColor:s}=e,{offset:o}=e,r;return t.$$set=f=>{"timestamp"in f&&l(0,i=f.timestamp),"fullTimeColor"in f&&l(1,s=f.fullTimeColor),"offset"in f&&l(4,o=f.offset)},t.$$.update=()=>{t.$$.dirty&17&&(l(3,r=Math.abs(new Date().getTime()-i.getTime())<3e5),isNaN(o)||Ol(i,o-(24+i.getHours()-i.getUTCHours())%24))},[i,s,n,r,o]}class Lu extends Mt{constructor(e){super(),St(this,e,U1,F1,Ct,{timestamp:0,fullTimeColor:1,offset:4})}}function B1(t){let e,l,n;return{c(){e=It("svg"),l=It("path"),n=It("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(n,"stroke-linecap","round"),u(n,"stroke-linejoin","round"),u(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(i,s){T(i,e,s),a(e,l),a(e,n)},p:Ve,i:Ve,o:Ve,d(i){i&&M(e)}}}class y1 extends Mt{constructor(e){super(),St(this,e,null,B1,Ct,{})}}function j1(t){let e,l;return{c(){e=It("svg"),l=It("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(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"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"fill","none"),u(e,"viewBox","0 0 24 24"),u(e,"stroke-width","1.5"),u(e,"stroke","currentColor"),u(e,"class","w-6 h-6")},m(n,i){T(n,e,i),a(e,l)},p:Ve,i:Ve,o:Ve,d(n){n&&M(e)}}}class z1 extends Mt{constructor(e){super(),St(this,e,null,j1,Ct,{})}}function H1(t){let e,l;return{c(){e=p("img"),u(e,"class","p-1"),u(e,"alt","Neas logo"),Il(e.src,l=w1)||u(e,"src",l)},m(n,i){T(n,e,i)},p:Ve,d(n){n&&M(e)}}}function Ms(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=p("div"),n=C(l),i=C("°C"),u(e,"class","flex-none my-auto")},m(s,o){T(s,e,o),a(e,n),a(e,i)},p(s,o){o&1&&l!==(l=(s[0].t>-50?s[0].t.toFixed(1):"-")+"")&&q(n,l)},d(s){s&&M(e)}}}function Ns(t){var i,s,o;let e,l=(((i=t[5].header)==null?void 0:i.han)??"Strømmåler")+": "+(((o=(s=t[5].errors)==null?void 0:s.han)==null?void 0:o[t[0].he])??t[0].he),n;return{c(){e=p("div"),n=C(l),u(e,"class","bd-red")},m(r,f){T(r,e,f),a(e,n)},p(r,f){var c,_,d;f&33&&l!==(l=(((c=r[5].header)==null?void 0:c.han)??"Strømmåler")+": "+(((d=(_=r[5].errors)==null?void 0:_.han)==null?void 0:d[r[0].he])??r[0].he))&&q(n,l)},d(r){r&&M(e)}}}function Ts(t){var i,s,o;let e,l=(((i=t[5].header)==null?void 0:i.mqtt)??"Minside")+": "+(((o=(s=t[5].errors)==null?void 0:s.mqtt)==null?void 0:o[t[0].me])??t[0].me),n;return{c(){e=p("div"),n=C(l),u(e,"class","bd-red")},m(r,f){T(r,e,f),a(e,n)},p(r,f){var c,_,d;f&33&&l!==(l=(((c=r[5].header)==null?void 0:c.mqtt)??"Minside")+": "+(((d=(_=r[5].errors)==null?void 0:_.mqtt)==null?void 0:d[r[0].me])??r[0].me))&&q(n,l)},d(r){r&&M(e)}}}function Ps(t){var i,s,o;let e,l=(((i=t[5].header)==null?void 0:i.price)??"PS")+": "+(((o=(s=t[5].errors)==null?void 0:s.price)==null?void 0:o[t[0].ee])??t[0].ee),n;return{c(){e=p("div"),n=C(l),u(e,"class","bd-red")},m(r,f){T(r,e,f),a(e,n)},p(r,f){var c,_,d;f&33&&l!==(l=(((c=r[5].header)==null?void 0:c.price)??"PS")+": "+(((d=(_=r[5].errors)==null?void 0:_.price)==null?void 0:d[r[0].ee])??r[0].ee))&&q(n,l)},d(r){r&&M(e)}}}function Es(t){let e,l,n,i,s,o,r,f;return l=new hl({props:{to:"/configuration",$$slots:{default:[W1]},$$scope:{ctx:t}}}),o=new hl({props:{to:"/status",$$slots:{default:[G1]},$$scope:{ctx:t}}}),{c(){var c,_;e=p("div"),Ne(l.$$.fragment),i=g(),s=p("div"),Ne(o.$$.fragment),u(e,"class","flex-none px-1 mt-1 pt-[0.5rem]"),u(e,"title",n=((c=t[5].header)==null?void 0:c.config)??""),u(s,"class","flex-none px-1 mt-1 pt-[0.5rem]"),u(s,"title",r=((_=t[5].header)==null?void 0:_.status)??"")},m(c,_){T(c,e,_),Se(l,e,null),T(c,i,_),T(c,s,_),Se(o,s,null),f=!0},p(c,_){var h,v;const d={};_&256&&(d.$$scope={dirty:_,ctx:c}),l.$set(d),(!f||_&32&&n!==(n=((h=c[5].header)==null?void 0:h.config)??""))&&u(e,"title",n);const m={};_&256&&(m.$$scope={dirty:_,ctx:c}),o.$set(m),(!f||_&32&&r!==(r=((v=c[5].header)==null?void 0:v.status)??""))&&u(s,"title",r)},i(c){f||(Z(l.$$.fragment,c),Z(o.$$.fragment,c),f=!0)},o(c){oe(l.$$.fragment,c),oe(o.$$.fragment,c),f=!1},d(c){c&&(M(e),M(i),M(s)),Me(l),Me(o)}}}function W1(t){let e,l;return e=new y1({}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function G1(t){let e,l;return e=new z1({}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function V1(t){let e,l;function n(o,r){return o[1].security==0||o[0].a?X1:Y1}let i=n(t),s=i(t);return{c(){var o;e=p("div"),s.c(),u(e,"class","flex-none mr-3 text-yellow-500"),u(e,"title",l=(((o=t[5].header)==null?void 0:o.new_version)??"New version")+": "+t[1].upgrade.n)},m(o,r){T(o,e,r),s.m(e,null)},p(o,r){var f;i===(i=n(o))&&s?s.p(o,r):(s.d(1),s=i(o),s&&(s.c(),s.m(e,null))),r&34&&l!==(l=(((f=o[5].header)==null?void 0:f.new_version)??"New version")+": "+o[1].upgrade.n)&&u(e,"title",l)},d(o){o&&M(e),s.d()}}}function K1(t){let e,l,n=t[1].upgrade.t+"",i,s,o=t[4].toFixed(1)+"",r,f;return{c(){e=p("div"),l=C("Upgrading to "),i=C(n),s=C(", "),r=C(o),f=C("%"),u(e,"class","flex-none mr-3 mt-1 text-yellow-300")},m(c,_){T(c,e,_),a(e,l),a(e,i),a(e,s),a(e,r),a(e,f)},p(c,_){_&2&&n!==(n=c[1].upgrade.t+"")&&q(i,n),_&16&&o!==(o=c[4].toFixed(1)+"")&&q(r,o)},d(c){c&&M(e)}}}function Y1(t){var r;let e,l=(((r=t[5].header)==null?void 0:r.new_version)??"New version")+"",n,i,s=t[1].upgrade.n+"",o;return{c(){e=p("span"),n=C(l),i=C(": "),o=C(s)},m(f,c){T(f,e,c),a(e,n),a(e,i),a(e,o)},p(f,c){var _;c&32&&l!==(l=(((_=f[5].header)==null?void 0:_.new_version)??"New version")+"")&&q(n,l),c&2&&s!==(s=f[1].upgrade.n+"")&&q(o,s)},d(f){f&&M(e)}}}function X1(t){var _;let e,l,n=(((_=t[5].header)==null?void 0:_.new_version)??"New version")+"",i,s,o=t[1].upgrade.n+"",r,f,c;return{c(){e=p("button"),l=p("span"),i=C(n),s=C(": "),r=C(o),u(l,"class","mt-1"),u(e,"class","flex")},m(d,m){T(d,e,m),a(e,l),a(l,i),a(l,s),a(l,r),f||(c=re(e,"click",t[6]),f=!0)},p(d,m){var h;m&32&&n!==(n=(((h=d[5].header)==null?void 0:h.new_version)??"New version")+"")&&q(i,n),m&2&&o!==(o=d[1].upgrade.n+"")&&q(r,o)},d(d){d&&M(e),f=!1,c()}}}function Q1(t){let e,l,n,i,s,o,r,f,c,_,d,m,h,v,b,w,k,A,L,O,N,D,E,F,H,y,S,j;i=new hl({props:{to:"/",class:"flex space-x-2",$$slots:{default:[H1]},$$scope:{ctx:t}}}),f=new A1({props:{epoch:t[0].u}});let $=t[0].t>-50&&Ms(t);m=new Vn({props:{title:"Strømmåler",text:"Strømmåler",color:xn(t[1].booting?9:t[0].hm)}}),v=new Vn({props:{title:"Minside",text:"Minside",color:xn(t[1].booting?9:t[0].mm)}});let G=(t[0].he<0||t[0].he>0)&&Ns(t),W=t[0].me<0&&Ts(t),X=(t[0].ee>0||t[0].ee<0)&&Ps(t);H=new Lu({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let U=t[1].vndcfg&&t[1].usrcfg&&Es(t);function K(z,ee){if(z[1].upgrading)return K1;if(z[1].fwconsent===1&&z[1].upgrade.n)return V1}let se=K(t),x=se&&se(t);return{c(){e=p("nav"),l=p("div"),n=p("div"),Ne(i.$$.fragment),s=g(),o=p("div"),r=p("div"),Ne(f.$$.fragment),c=g(),$&&$.c(),_=g(),d=p("div"),Ne(m.$$.fragment),h=g(),Ne(v.$$.fragment),b=g(),G&&G.c(),w=g(),W&&W.c(),k=g(),X&&X.c(),A=g(),L=p("div"),O=p("div"),N=p("img"),E=g(),F=p("div"),Ne(H.$$.fragment),y=g(),U&&U.c(),S=g(),x&&x.c(),u(n,"class","flex text-xl text-neas-gray p-2 flex-auto"),u(r,"class","flex-none my-auto"),u(o,"class","flex-none my-auto p-2 flex space-x-4"),u(d,"class","flex-auto flex-wrap my-auto justify-center p-2"),u(N,"class","h-10 w-10"),Il(N.src,D=t[2])||u(N,"src",D),u(N,"alt",t[3]),u(O,"class","flex-none flex text-xl text-neas-gray p-2 flex-auto"),u(F,"class","flex-none my-auto px-2"),u(L,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),u(l,"class","flex flex-wrap space-x-4 text-l text-neas-gray"),u(e,"class","bg-neas-green-90 rounded-md")},m(z,ee){T(z,e,ee),a(e,l),a(l,n),Se(i,n,null),a(l,s),a(l,o),a(o,r),Se(f,r,null),a(o,c),$&&$.m(o,null),a(l,_),a(l,d),Se(m,d,null),a(d,h),Se(v,d,null),a(l,b),G&&G.m(l,null),a(l,w),W&&W.m(l,null),a(l,k),X&&X.m(l,null),a(l,A),a(l,L),a(L,O),a(O,N),a(L,E),a(L,F),Se(H,F,null),a(L,y),U&&U.m(L,null),a(L,S),x&&x.m(L,null),j=!0},p(z,[ee]){const ue={};ee&256&&(ue.$$scope={dirty:ee,ctx:z}),i.$set(ue);const ae={};ee&1&&(ae.epoch=z[0].u),f.$set(ae),z[0].t>-50?$?$.p(z,ee):($=Ms(z),$.c(),$.m(o,null)):$&&($.d(1),$=null);const le={};ee&3&&(le.color=xn(z[1].booting?9:z[0].hm)),m.$set(le);const _e={};ee&3&&(_e.color=xn(z[1].booting?9:z[0].mm)),v.$set(_e),z[0].he<0||z[0].he>0?G?G.p(z,ee):(G=Ns(z),G.c(),G.m(l,w)):G&&(G.d(1),G=null),z[0].me<0?W?W.p(z,ee):(W=Ts(z),W.c(),W.m(l,k)):W&&(W.d(1),W=null),z[0].ee>0||z[0].ee<0?X?X.p(z,ee):(X=Ps(z),X.c(),X.m(l,A)):X&&(X.d(1),X=null),(!j||ee&4&&!Il(N.src,D=z[2]))&&u(N,"src",D),(!j||ee&8)&&u(N,"alt",z[3]);const ne={};ee&1&&(ne.timestamp=z[0].c?new Date(z[0].c*1e3):new Date(0)),ee&2&&(ne.offset=z[1].clock_offset),H.$set(ne),z[1].vndcfg&&z[1].usrcfg?U?(U.p(z,ee),ee&2&&Z(U,1)):(U=Es(z),U.c(),Z(U,1),U.m(L,S)):U&&(mt(),oe(U,1,1,()=>{U=null}),pt()),se===(se=K(z))&&x?x.p(z,ee):(x&&x.d(1),x=se&&se(z),x&&(x.c(),x.m(L,null)))},i(z){j||(Z(i.$$.fragment,z),Z(f.$$.fragment,z),Z(m.$$.fragment,z),Z(v.$$.fragment,z),Z(H.$$.fragment,z),Z(U),j=!0)},o(z){oe(i.$$.fragment,z),oe(f.$$.fragment,z),oe(m.$$.fragment,z),oe(v.$$.fragment,z),oe(H.$$.fragment,z),oe(U),j=!1},d(z){z&&M(e),Me(i),Me(f),$&&$.d(),Me(m),Me(v),G&&G.d(),W&&W.d(),X&&X.d(),Me(H),U&&U.d(),x&&x.d()}}}function Z1(t,e,l){let n=Sn,i="Wi-Fi offline",{basepath:s="/"}=e,{data:o={}}=e,r={};function f(){var d;confirm((((d=_.header)==null?void 0:d.upgrade)??"Upgrade to {0}?").replace("{0}",r.upgrade.n))&&(Ou(r.upgrade.n),rl.update(m=>(m.upgrade.t=r.upgrade.n,m.upgrade.p=0,m.upgrading=!0,m)))}let c;rl.subscribe(d=>{l(1,r=d)});let _={};return wl.subscribe(d=>{l(5,_=d)}),t.$$set=d=>{"basepath"in d&&l(7,s=d.basepath),"data"in d&&l(0,o=d.data)},t.$$.update=()=>{if(t.$$.dirty&2&&l(4,c=Math.max(0,r.upgrade.p)),t.$$.dirty&1){const d=o==null?void 0:o.r;typeof d=="number"&&(d>=-50?(l(2,n=ts),l(3,i=`Wi-Fi strong (${d} dBm)`)):d>=-60?(l(2,n=es),l(3,i=`Wi-Fi medium (${d} dBm)`)):d>=-75?(l(2,n=xi),l(3,i=`Wi-Fi weak (${d} dBm)`)):(l(2,n=Sn),l(3,i=`Wi-Fi very weak/offline (${d} dBm)`)))}},[o,r,n,i,c,_,f,s]}class J1 extends Mt{constructor(e){super(),St(this,e,Z1,Q1,Ct,{basepath:7,data:0})}}function $1(t){let e,l,n,i;return{c(){e=It("svg"),l=It("path"),n=It("path"),u(l,"d",gi(150,150,115,210,510)),u(l,"stroke","rgba(128, 128, 128, 0.15)"),u(l,"fill","none"),u(l,"stroke-width","55"),u(n,"d",i=gi(150,150,115,210,210+300*t[0]/100)),u(n,"stroke",t[1]),u(n,"fill","none"),u(n,"stroke-width","55"),u(e,"viewBox","0 0 300 300"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"height","100%")},m(s,o){T(s,e,o),a(e,l),a(e,n)},p(s,[o]){o&1&&i!==(i=gi(150,150,115,210,210+300*s[0]/100))&&u(n,"d",i),o&2&&u(n,"stroke",s[1])},i:Ve,o:Ve,d(s){s&&M(e)}}}function qs(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 gi(t,e,l,n,i){var s=qs(t,e,l,i),o=qs(t,e,l,n),r=i-n<=180?"0":"1",f=["M",s.x,s.y,"A",l,l,0,r,0,o.x,o.y].join(" ");return f}function x1(t,e,l){let{pct:n=0}=e,{color:i="red"}=e;return t.$$set=s=>{"pct"in s&&l(0,n=s.pct),"color"in s&&l(1,i=s.color)},[n,i]}class ec extends Mt{constructor(e){super(),St(this,e,x1,$1,Ct,{pct:0,color:1})}}function Ds(t){let e,l,n,i=t[1][0]+"",s,o,r,f=t[1][1]+"",c,_;return{c(){e=p("br"),l=g(),n=p("span"),s=C(i),o=g(),r=p("span"),c=C(f),_=C("/kWh"),u(n,"class","pl-sub"),u(r,"class","pl-snt")},m(d,m){T(d,e,m),T(d,l,m),T(d,n,m),a(n,s),T(d,o,m),T(d,r,m),a(r,c),a(r,_)},p(d,m){m&2&&i!==(i=d[1][0]+"")&&q(s,i),m&2&&f!==(f=d[1][1]+"")&&q(c,f)},d(d){d&&(M(e),M(l),M(n),M(o),M(r))}}}function tc(t){let e,l,n,i,s,o,r,f,c,_,d=t[3][0]+"",m,h,v,b=t[3][1]+"",w,k,A;l=new ec({props:{pct:t[4],color:t[2](t[4],document.documentElement.classList.contains("dark"))}});let L=t[1]&&Ds(t);return{c(){e=p("div"),Ne(l.$$.fragment),n=g(),i=p("span"),s=p("span"),o=C(t[0]),r=g(),f=p("br"),c=g(),_=p("span"),m=C(d),h=g(),v=p("span"),w=C(b),k=g(),L&&L.c(),u(s,"class","pl-lab"),u(_,"class","pl-val"),u(v,"class","pl-unt"),u(i,"class","pl-ov"),u(e,"class","pl-root")},m(O,N){T(O,e,N),Se(l,e,null),a(e,n),a(e,i),a(i,s),a(s,o),a(i,r),a(i,f),a(i,c),a(i,_),a(_,m),a(i,h),a(i,v),a(v,w),a(i,k),L&&L.m(i,null),A=!0},p(O,[N]){const D={};N&16&&(D.pct=O[4]),N&20&&(D.color=O[2](O[4],document.documentElement.classList.contains("dark"))),l.$set(D),(!A||N&1)&&q(o,O[0]),(!A||N&8)&&d!==(d=O[3][0]+"")&&q(m,d),(!A||N&8)&&b!==(b=O[3][1]+"")&&q(w,b),O[1]?L?L.p(O,N):(L=Ds(O),L.c(),L.m(i,null)):L&&(L.d(1),L=null)},i(O){A||(Z(l.$$.fragment,O),A=!0)},o(O){oe(l.$$.fragment,O),A=!1},d(O){O&&M(e),Me(l),L&&L.d()}}}function lc(t,e,l){let{val:n}=e,{max:i}=e,{unit:s}=e,{label:o}=e,{sub:r=["",""]}=e,{colorFn:f}=e,c,_=0;return t.$$set=d=>{"val"in d&&l(5,n=d.val),"max"in d&&l(6,i=d.max),"unit"in d&&l(7,s=d.unit),"label"in d&&l(0,o=d.label),"sub"in d&&l(1,r=d.sub),"colorFn"in d&&l(2,f=d.colorFn)},t.$$.update=()=>{t.$$.dirty&224&&(l(3,c=cl(n,s)),l(4,_=Math.min(n,i)/i*100))},[o,r,f,c,_,n,i,s]}class Iu extends Mt{constructor(e){super(),St(this,e,lc,tc,Ct,{val:5,max:6,unit:7,label:0,sub:1,colorFn:2})}}function As(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Os(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Ls(t,e,l){const n=t.slice();return n[15]=e[l],n}function Is(t){let e,l,n,i,s,o,r,f=(t[0].title||t[0].link)&&Rs(t),c=tt(t[0].y.ticks),_=[];for(let b=0;b{f=null}),pt()),w&129){c=tt(b[0].y.ticks);let k;for(k=0;k{s=null}),pt())},i(o){n||(Z(s),n=!0)},o(o){oe(s),n=!1},d(o){o&&M(e),i&&i.d(),s&&s.d()}}}function Fs(t){let e,l=t[0].title+"",n,i;return{c(){e=p("div"),n=C(l),u(e,"class","text-sm font-bold"),qt(()=>t[9].call(e))},m(s,o){T(s,e,o),a(e,n),i=Vi(e,t[9].bind(e))},p(s,o){o&1&&l!==(l=s[0].title+"")&&q(n,l)},d(s){s&&M(e),i()}}}function Us(t){let e,l,n,i;const s=[ic,nc],o=[];function r(f,c){return f[0].link.route?0:1}return l=r(t),n=o[l]=s[l](t),{c(){e=p("div"),n.c(),u(e,"class","text-xs text-right")},m(f,c){T(f,e,c),o[l].m(e,null),i=!0},p(f,c){let _=l;l=r(f),l===_?o[l].p(f,c):(mt(),oe(o[_],1,1,()=>{o[_]=null}),pt(),n=o[l],n?n.p(f,c):(n=o[l]=s[l](f),n.c()),Z(n,1),n.m(e,null))},i(f){i||(Z(n),i=!0)},o(f){oe(n),i=!1},d(f){f&&M(e),o[l].d()}}}function nc(t){let e,l=t[0].link.text+"",n,i,s;return{c(){e=p("a"),n=C(l),u(e,"href",i=t[0].link.url),u(e,"target",s=t[0].link.target)},m(o,r){T(o,e,r),a(e,n)},p(o,r){r&1&&l!==(l=o[0].link.text+"")&&q(n,l),r&1&&i!==(i=o[0].link.url)&&u(e,"href",i),r&1&&s!==(s=o[0].link.target)&&u(e,"target",s)},i:Ve,o:Ve,d(o){o&&M(e)}}}function ic(t){let e,l;return e=new hl({props:{to:t[0].link.url,$$slots:{default:[sc]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.to=n[0].link.url),i&262145&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function sc(t){let e=t[0].link.text+"",l;return{c(){l=C(e)},m(n,i){T(n,l,i)},p(n,i){i&1&&e!==(e=n[0].link.text+"")&&q(l,e)},d(n){n&&M(l)}}}function Bs(t){let e,l,n,i=t[15].label+"",s,o,r,f;return{c(){e=It("g"),l=It("line"),n=It("text"),s=C(i),u(l,"x2","100%"),u(n,"y","-4"),u(n,"x",o=t[15].align=="right"?"85%":""),u(e,"class",r="tick tick-"+t[15].value+" tick-"+t[15].color),u(e,"transform",f="translate(0, "+t[7](t[15].value)+")")},m(c,_){T(c,e,_),a(e,l),a(e,n),a(n,s)},p(c,_){_&1&&i!==(i=c[15].label+"")&&q(s,i),_&1&&o!==(o=c[15].align=="right"?"85%":"")&&u(n,"x",o),_&1&&r!==(r="tick tick-"+c[15].value+" tick-"+c[15].color)&&u(e,"class",r),_&129&&f!==(f="translate(0, "+c[7](c[15].value)+")")&&u(e,"transform",f)},d(c){c&&M(e)}}}function ys(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Bs(t);return{c(){n&&n.c(),l=yt()},m(i,s){n&&n.m(i,s),T(i,l,s)},p(i,s){s&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,s):(n=Bs(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){i&&M(l),n&&n.d(i)}}}function js(t){let e,l,n=(t[3]>20||t[13]%2==0)&&zs(t);return{c(){e=It("g"),n&&n.c(),u(e,"class","tick"),u(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,s){T(i,e,s),n&&n.m(e,null)},p(i,s){i[3]>20||i[13]%2==0?n?n.p(i,s):(n=zs(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),s&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&u(e,"transform",l)},d(i){i&&M(e),n&&n.d()}}}function zs(t){let e,l=t[11].label+"",n,i;return{c(){e=It("text"),n=C(l),u(e,"x",i=t[3]/2),u(e,"y","-4")},m(s,o){T(s,e,o),a(e,n)},p(s,o){o&1&&l!==(l=s[11].label+"")&&q(n,l),o&8&&i!==(i=s[3]/2)&&u(e,"x",i)},d(s){s&&M(e)}}}function Hs(t){let e=!isNaN(t[6](t[13])),l,n=e&&js(t);return{c(){n&&n.c(),l=yt()},m(i,s){n&&n.m(i,s),T(i,l,s)},p(i,s){s&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,s):(n=js(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){i&&M(l),n&&n.d(i)}}}function Ws(t){let e,l,n=t[11].value!==void 0&&Gs(t),i=t[11].value2>1e-4&&Ys(t);return{c(){e=It("g"),n&&n.c(),l=It("g"),i&&i.c()},m(s,o){T(s,e,o),n&&n.m(e,null),T(s,l,o),i&&i.m(l,null)},p(s,o){s[11].value!==void 0?n?n.p(s,o):(n=Gs(s),n.c(),n.m(e,null)):n&&(n.d(1),n=null),s[11].value2>1e-4?i?i.p(s,o):(i=Ys(s),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(s){s&&(M(e),M(l)),n&&n.d(),i&&i.d()}}}function Gs(t){let e,l,n,i,s,o,r,f=t[3]>15&&Vs(t);return{c(){e=It("rect"),f&&f.c(),r=yt(),u(e,"x",l=t[6](t[13])+2),u(e,"y",n=t[7](t[11].value)),u(e,"width",i=t[3]-4),u(e,"height",s=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),u(e,"fill",o=t[11].color)},m(c,_){T(c,e,_),f&&f.m(c,_),T(c,r,_)},p(c,_){_&64&&l!==(l=c[6](c[13])+2)&&u(e,"x",l),_&129&&n!==(n=c[7](c[11].value))&&u(e,"y",n),_&8&&i!==(i=c[3]-4)&&u(e,"width",i),_&129&&s!==(s=c[7](c[0].y.min)-c[7](Math.min(c[0].y.min,0)+c[11].value))&&u(e,"height",s),_&1&&o!==(o=c[11].color)&&u(e,"fill",o),c[3]>15?f?f.p(c,_):(f=Vs(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(M(e),M(r)),f&&f.d(c)}}}function Vs(t){let e,l=t[11].label+"",n,i,s,o,r,f,c=t[11].title&&Ks(t);return{c(){e=It("text"),n=C(l),c&&c.c(),f=yt(),u(e,"width",i=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor",s=t[3]t[7](0)-t[8]&&!t[0].dark?t[11].color:"white"),u(e,"transform",r="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[11].labelAngle?t[11].labelAngle:t[3]_[7](0)-_[8]&&!_[0].dark?_[11].color:"white")&&u(e,"fill",o),d&457&&r!==(r="translate("+(_[6](_[13])+_[3]/2)+" "+(_[7](_[11].value)>_[7](0)-_[8]?_[7](_[11].value)-_[8]:_[7](_[11].value)+10)+") rotate("+(_[11].labelAngle?_[11].labelAngle:_[3]15&&Xs(t);return{c(){e=It("rect"),f&&f.c(),r=yt(),u(e,"x",l=t[6](t[13])+2),u(e,"y",n=t[7](0)),u(e,"width",i=t[3]-4),u(e,"height",s=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),u(e,"fill",o=t[11].color2?t[11].color2:t[11].color)},m(c,_){T(c,e,_),f&&f.m(c,_),T(c,r,_)},p(c,_){_&64&&l!==(l=c[6](c[13])+2)&&u(e,"x",l),_&128&&n!==(n=c[7](0))&&u(e,"y",n),_&8&&i!==(i=c[3]-4)&&u(e,"width",i),_&129&&s!==(s=c[7](c[0].y.min)-c[7](c[0].y.min+c[11].value2))&&u(e,"height",s),_&1&&o!==(o=c[11].color2?c[11].color2:c[11].color)&&u(e,"fill",o),c[3]>15?f?f.p(c,_):(f=Xs(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(M(e),M(r)),f&&f.d(c)}}}function Xs(t){let e,l=t[11].label2+"",n,i,s,o,r,f=t[11].title2&&Qs(t);return{c(){e=It("text"),n=C(l),f&&f.c(),r=yt(),u(e,"width",i=t[3]-4),u(e,"dominant-baseline","middle"),u(e,"text-anchor","middle"),u(e,"fill",s=t[7](-t[11].value2)t[10].call(e))},m(s,o){T(s,e,o),i&&i.m(e,null),l=Vi(e,t[10].bind(e)),n=!0},p(s,[o]){s[0].x.ticks&&s[0].points&&s[4]?i?(i.p(s,o),o&17&&Z(i,1)):(i=Is(s),i.c(),Z(i,1),i.m(e,null)):i&&(mt(),oe(i,1,1,()=>{i=null}),pt())},i(s){n||(Z(i),n=!0)},o(s){oe(i),n=!1},d(s){s&&M(e),i&&i.d(),l()}}}let rn=30;function ac(t,e,l){let{config:n}=e,i,s,o,r,f,c,_,d=0;function m(){d=this.clientHeight,l(5,d)}function h(){i=this.clientWidth,s=this.clientHeight,l(1,i),l(2,s)}return t.$$set=v=>{"config"in v&&l(0,n=v.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,c=s-d);let v=i-(n.padding.left+n.padding.right);l(3,o=v/n.points.length),l(8,_=on.y.max?k=n.padding.bottom:wc||k<0?0:k})}},[n,i,s,o,c,d,r,f,_,m,h]}class pn extends Mt{constructor(e){super(),St(this,e,ac,oc,Ct,{config:0})}}function fc(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function uc(t,e,l){let{title:n}=e,{u1:i}=e,{u2:s}=e,{u3:o}=e,{ds:r}=e,f={};function c(_){return{label:zt(_)+"V",title:_.toFixed(1)+" V",value:isNaN(_)?0:_,color:r1(_||0,document.documentElement.classList.contains("dark"))}}return t.$$set=_=>{"title"in _&&l(1,n=_.title),"u1"in _&&l(2,i=_.u1),"u2"in _&&l(3,s=_.u2),"u3"in _&&l(4,o=_.u3),"ds"in _&&l(5,r=_.ds)},t.$$.update=()=>{if(t.$$.dirty&62){let _=[],d=[];i>0&&(_.push({label:r===1?"L1-L2":"L1"}),d.push(c(i))),s>0&&(_.push({label:r===1?"L1-L3":"L2"}),d.push(c(s))),o>0&&(_.push({label:r===1?"L2-L3":"L3"}),d.push(c(o))),l(0,f={title:n,padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:_},points:d})}},[f,n,i,s,o,r]}class rc extends Mt{constructor(e){super(),St(this,e,uc,fc,Ct,{title:1,u1:2,u2:3,u3:4,ds:5})}}function cc(t){var R,Y,J,fe,ce;let e,l,n=(((R=t[0].reactive)==null?void 0:R.title)??"Reactive")+"",i,s,o,r,f=(((Y=t[0].reactive)==null?void 0:Y.instant_in)??"Instant in")+"",c,_,d,m=t[1][0]+"",h,v,b=t[1][1]+"",w,k,A,L=(((J=t[0].reactive)==null?void 0:J.instant_out)??"Instant out")+"",O,N,D,E=t[2][0]+"",F,H,y=t[2][1]+"",S,j,$,G,W=(((fe=t[0].reactive)==null?void 0:fe.total_in)??"Total in")+"",X,U,K,se=t[3][0]+"",x,z,ee=t[3][1]+"",ue,ae,le,_e=(((ce=t[0].reactive)==null?void 0:ce.total_out)??"Total out")+"",ne,te,ie,be=t[4][0]+"",we,I,P=t[4][1]+"",B;return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("div"),r=p("div"),c=C(f),_=g(),d=p("div"),h=C(m),v=g(),w=C(b),k=g(),A=p("div"),O=C(L),N=g(),D=p("div"),F=C(E),H=g(),S=C(y),j=g(),$=p("div"),G=p("div"),X=C(W),U=g(),K=p("div"),x=C(se),z=g(),ue=C(ee),ae=g(),le=p("div"),ne=C(_e),te=g(),ie=p("div"),we=C(be),I=g(),B=C(P),u(d,"class","text-right"),u(D,"class","text-right"),u(o,"class","grid grid-cols-2 mt-4"),u(K,"class","text-right"),u(ie,"class","text-right"),u($,"class","grid grid-cols-2 mt-4"),u(e,"class","mx-2 text-sm")},m(me,pe){T(me,e,pe),a(e,l),a(l,i),a(e,s),a(e,o),a(o,r),a(r,c),a(o,_),a(o,d),a(d,h),a(d,v),a(d,w),a(o,k),a(o,A),a(A,O),a(o,N),a(o,D),a(D,F),a(D,H),a(D,S),a(e,j),a(e,$),a($,G),a(G,X),a($,U),a($,K),a(K,x),a(K,z),a(K,ue),a($,ae),a($,le),a(le,ne),a($,te),a($,ie),a(ie,we),a(ie,I),a(ie,B)},p(me,[pe]){var ke,ve,De,Ee,Oe;pe&1&&n!==(n=(((ke=me[0].reactive)==null?void 0:ke.title)??"Reactive")+"")&&q(i,n),pe&1&&f!==(f=(((ve=me[0].reactive)==null?void 0:ve.instant_in)??"Instant in")+"")&&q(c,f),pe&2&&m!==(m=me[1][0]+"")&&q(h,m),pe&2&&b!==(b=me[1][1]+"")&&q(w,b),pe&1&&L!==(L=(((De=me[0].reactive)==null?void 0:De.instant_out)??"Instant out")+"")&&q(O,L),pe&4&&E!==(E=me[2][0]+"")&&q(F,E),pe&4&&y!==(y=me[2][1]+"")&&q(S,y),pe&1&&W!==(W=(((Ee=me[0].reactive)==null?void 0:Ee.total_in)??"Total in")+"")&&q(X,W),pe&8&&se!==(se=me[3][0]+"")&&q(x,se),pe&8&&ee!==(ee=me[3][1]+"")&&q(ue,ee),pe&1&&_e!==(_e=(((Oe=me[0].reactive)==null?void 0:Oe.total_out)??"Total out")+"")&&q(ne,_e),pe&16&&be!==(be=me[4][0]+"")&&q(we,be),pe&16&&P!==(P=me[4][1]+"")&&q(B,P)},i:Ve,o:Ve,d(me){me&&M(e)}}}function _c(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:s}=e,{exportTotal:o}=e,{translations:r={}}=e,f,c,_,d;return t.$$set=m=>{"importInstant"in m&&l(5,n=m.importInstant),"exportInstant"in m&&l(6,i=m.exportInstant),"importTotal"in m&&l(7,s=m.importTotal),"exportTotal"in m&&l(8,o=m.exportTotal),"translations"in m&&l(0,r=m.translations)},t.$$.update=()=>{t.$$.dirty&480&&(l(1,f=cl(n,"VAr")),l(2,c=cl(i,"VAr")),l(3,_=cl(s*1e3,"VArh")),l(4,d=cl(o*1e3,"VArh")))},[r,f,c,_,d,n,i,s,o]}class mc extends Mt{constructor(e){super(),St(this,e,_c,cc,Ct,{importInstant:5,exportInstant:6,importTotal:7,exportTotal:8,translations:0})}}function Js(t){let e;function l(s,o){return s[3]?dc:pc}let n=l(t),i=n(t);return{c(){i.c(),e=yt()},m(s,o){i.m(s,o),T(s,e,o)},p(s,o){n===(n=l(s))&&i?i.p(s,o):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},d(s){s&&M(e),i.d(s)}}}function pc(t){var Y,J,fe,ce,me;let e,l=(((Y=t[4].realtime)==null?void 0:Y.consumption)??"Consumption")+"",n,i,s,o,r=Zt(((J=t[4].common)==null?void 0:J.hour)??"Hour")+"",f,c,_,d=t[6][0]+"",m,h,v=t[6][1]+"",b,w,k,A=Zt(((fe=t[4].common)==null?void 0:fe.day)??"Day")+"",L,O,N,D=t[7][0]+"",E,F,H=t[7][1]+"",y,S,j,$=Zt(((ce=t[4].common)==null?void 0:ce.month)??"Month")+"",G,W,X,U=t[8][0]+"",K,se,x=t[8][1]+"",z,ee,ue,ae=(((me=t[4].realtime)==null?void 0:me.last_month)??"Last month")+"",le,_e,ne,te=t[9][0]+"",ie,be,we=t[9][1]+"",I,P,B,R=t[5]&&$s(t);return{c(){e=p("strong"),n=C(l),i=g(),s=p("div"),o=p("div"),f=C(r),c=g(),_=p("div"),m=C(d),h=g(),b=C(v),w=g(),k=p("div"),L=C(A),O=g(),N=p("div"),E=C(D),F=g(),y=C(H),S=g(),j=p("div"),G=C($),W=g(),X=p("div"),K=C(U),se=g(),z=C(x),ee=g(),ue=p("div"),le=C(ae),_e=g(),ne=p("div"),ie=C(te),be=g(),I=C(we),P=g(),R&&R.c(),B=yt(),u(_,"class","text-right"),u(N,"class","text-right"),u(X,"class","text-right"),u(ne,"class","text-right"),u(s,"class","grid grid-cols-2 mb-3")},m(pe,ke){T(pe,e,ke),a(e,n),T(pe,i,ke),T(pe,s,ke),a(s,o),a(o,f),a(s,c),a(s,_),a(_,m),a(_,h),a(_,b),a(s,w),a(s,k),a(k,L),a(s,O),a(s,N),a(N,E),a(N,F),a(N,y),a(s,S),a(s,j),a(j,G),a(s,W),a(s,X),a(X,K),a(X,se),a(X,z),a(s,ee),a(s,ue),a(ue,le),a(s,_e),a(s,ne),a(ne,ie),a(ne,be),a(ne,I),T(pe,P,ke),R&&R.m(pe,ke),T(pe,B,ke)},p(pe,ke){var ve,De,Ee,Oe,Le;ke&16&&l!==(l=(((ve=pe[4].realtime)==null?void 0:ve.consumption)??"Consumption")+"")&&q(n,l),ke&16&&r!==(r=Zt(((De=pe[4].common)==null?void 0:De.hour)??"Hour")+"")&&q(f,r),ke&64&&d!==(d=pe[6][0]+"")&&q(m,d),ke&64&&v!==(v=pe[6][1]+"")&&q(b,v),ke&16&&A!==(A=Zt(((Ee=pe[4].common)==null?void 0:Ee.day)??"Day")+"")&&q(L,A),ke&128&&D!==(D=pe[7][0]+"")&&q(E,D),ke&128&&H!==(H=pe[7][1]+"")&&q(y,H),ke&16&&$!==($=Zt(((Oe=pe[4].common)==null?void 0:Oe.month)??"Month")+"")&&q(G,$),ke&256&&U!==(U=pe[8][0]+"")&&q(K,U),ke&256&&x!==(x=pe[8][1]+"")&&q(z,x),ke&16&&ae!==(ae=(((Le=pe[4].realtime)==null?void 0:Le.last_month)??"Last month")+"")&&q(le,ae),ke&512&&te!==(te=pe[9][0]+"")&&q(ie,te),ke&512&&we!==(we=pe[9][1]+"")&&q(I,we),pe[5]?R?R.p(pe,ke):(R=$s(pe),R.c(),R.m(B.parentNode,B)):R&&(R.d(1),R=null)},d(pe){pe&&(M(e),M(i),M(s),M(P),M(B)),R&&R.d(pe)}}}function dc(t){var et,ze,xt,el,tl,ll,nl,il,sl,ol;let e,l=(((et=t[4].common)==null?void 0:et.import)??"Import")+"",n,i,s,o,r=Zt(((ze=t[4].common)==null?void 0:ze.hour)??"Hour")+"",f,c,_,d=t[6][0]+"",m,h,v=t[6][1]+"",b,w,k,A,L=Zt(((xt=t[4].common)==null?void 0:xt.day)??"Day")+"",O,N,D,E=t[7][0]+"",F,H,y=t[7][1]+"",S,j,$,G,W=Zt(((el=t[4].common)==null?void 0:el.month)??"Month")+"",X,U,K,se=t[8][0]+"",x,z,ee=t[8][1]+"",ue,ae,le,_e,ne=(((tl=t[4].realtime)==null?void 0:tl.last_mo)??"Last mo.")+"",te,ie,be,we=t[9][0]+"",I,P,B=t[9][1]+"",R,Y,J,fe,ce,me=(((ll=t[4].common)==null?void 0:ll.export)??"Export")+"",pe,ke,ve,De,Ee=Zt(((nl=t[4].common)==null?void 0:nl.hour)??"Hour")+"",Oe,Le,st,dt=t[10][0]+"",lt,Ze,Be=t[10][1]+"",ft,Nt,bt,ut,ot=Zt(((il=t[4].common)==null?void 0:il.day)??"Day")+"",rt,Rt,Ke,Ie=t[11][0]+"",je,$e,de=t[11][1]+"",qe,Ge,ge,Te,it=Zt(((sl=t[4].common)==null?void 0:sl.month)??"Month")+"",He,At,ht,Re=t[12][0]+"",kt,ct,vt=t[12][1]+"",xe,Ot,Gt,wt,_t=(((ol=t[4].realtime)==null?void 0:ol.last_mo)??"Last mo.")+"",Ht,Qt,Ut,Bt=t[13][0]+"",Xt,$t,Vt=t[13][1]+"",Ft,Fe,Je,Ue=t[5]&&xs(t),Pt=t[5]&&eo(t),Lt=t[5]&&to(t),Qe=t[5]&&lo(t),nt=t[5]&&no(t),Tt=t[5]&&io(t),at=t[5]&&so(t),he=t[5]&&oo(t);return{c(){e=p("strong"),n=C(l),i=g(),s=p("div"),o=p("div"),f=C(r),c=g(),_=p("div"),m=C(d),h=g(),b=C(v),w=g(),Ue&&Ue.c(),k=g(),A=p("div"),O=C(L),N=g(),D=p("div"),F=C(E),H=g(),S=C(y),j=g(),Pt&&Pt.c(),$=g(),G=p("div"),X=C(W),U=g(),K=p("div"),x=C(se),z=g(),ue=C(ee),ae=g(),Lt&&Lt.c(),le=g(),_e=p("div"),te=C(ne),ie=g(),be=p("div"),I=C(we),P=g(),R=C(B),Y=g(),Qe&&Qe.c(),fe=g(),ce=p("strong"),pe=C(me),ke=g(),ve=p("div"),De=p("div"),Oe=C(Ee),Le=g(),st=p("div"),lt=C(dt),Ze=g(),ft=C(Be),Nt=g(),nt&&nt.c(),bt=g(),ut=p("div"),rt=C(ot),Rt=g(),Ke=p("div"),je=C(Ie),$e=g(),qe=C(de),Ge=g(),Tt&&Tt.c(),ge=g(),Te=p("div"),He=C(it),At=g(),ht=p("div"),kt=C(Re),ct=g(),xe=C(vt),Ot=g(),at&&at.c(),Gt=g(),wt=p("div"),Ht=C(_t),Qt=g(),Ut=p("div"),Xt=C(Bt),$t=g(),Ft=C(Vt),Fe=g(),he&&he.c(),u(_,"class","text-right"),u(D,"class","text-right"),u(K,"class","text-right"),u(be,"class","text-right"),u(s,"class",J="grid grid-cols-"+t[14]+" mb-3"),u(st,"class","text-right"),u(Ke,"class","text-right"),u(ht,"class","text-right"),u(Ut,"class","text-right"),u(ve,"class",Je="grid grid-cols-"+t[14])},m(Ae,Q){T(Ae,e,Q),a(e,n),T(Ae,i,Q),T(Ae,s,Q),a(s,o),a(o,f),a(s,c),a(s,_),a(_,m),a(_,h),a(_,b),a(s,w),Ue&&Ue.m(s,null),a(s,k),a(s,A),a(A,O),a(s,N),a(s,D),a(D,F),a(D,H),a(D,S),a(s,j),Pt&&Pt.m(s,null),a(s,$),a(s,G),a(G,X),a(s,U),a(s,K),a(K,x),a(K,z),a(K,ue),a(s,ae),Lt&&Lt.m(s,null),a(s,le),a(s,_e),a(_e,te),a(s,ie),a(s,be),a(be,I),a(be,P),a(be,R),a(s,Y),Qe&&Qe.m(s,null),T(Ae,fe,Q),T(Ae,ce,Q),a(ce,pe),T(Ae,ke,Q),T(Ae,ve,Q),a(ve,De),a(De,Oe),a(ve,Le),a(ve,st),a(st,lt),a(st,Ze),a(st,ft),a(ve,Nt),nt&&nt.m(ve,null),a(ve,bt),a(ve,ut),a(ut,rt),a(ve,Rt),a(ve,Ke),a(Ke,je),a(Ke,$e),a(Ke,qe),a(ve,Ge),Tt&&Tt.m(ve,null),a(ve,ge),a(ve,Te),a(Te,He),a(ve,At),a(ve,ht),a(ht,kt),a(ht,ct),a(ht,xe),a(ve,Ot),at&&at.m(ve,null),a(ve,Gt),a(ve,wt),a(wt,Ht),a(ve,Qt),a(ve,Ut),a(Ut,Xt),a(Ut,$t),a(Ut,Ft),a(ve,Fe),he&&he.m(ve,null)},p(Ae,Q){var Ce,Kt,fl,ml,Jt,pl,dl,Cl,Sl,Ml;Q&16&&l!==(l=(((Ce=Ae[4].common)==null?void 0:Ce.import)??"Import")+"")&&q(n,l),Q&16&&r!==(r=Zt(((Kt=Ae[4].common)==null?void 0:Kt.hour)??"Hour")+"")&&q(f,r),Q&64&&d!==(d=Ae[6][0]+"")&&q(m,d),Q&64&&v!==(v=Ae[6][1]+"")&&q(b,v),Ae[5]?Ue?Ue.p(Ae,Q):(Ue=xs(Ae),Ue.c(),Ue.m(s,k)):Ue&&(Ue.d(1),Ue=null),Q&16&&L!==(L=Zt(((fl=Ae[4].common)==null?void 0:fl.day)??"Day")+"")&&q(O,L),Q&128&&E!==(E=Ae[7][0]+"")&&q(F,E),Q&128&&y!==(y=Ae[7][1]+"")&&q(S,y),Ae[5]?Pt?Pt.p(Ae,Q):(Pt=eo(Ae),Pt.c(),Pt.m(s,$)):Pt&&(Pt.d(1),Pt=null),Q&16&&W!==(W=Zt(((ml=Ae[4].common)==null?void 0:ml.month)??"Month")+"")&&q(X,W),Q&256&&se!==(se=Ae[8][0]+"")&&q(x,se),Q&256&&ee!==(ee=Ae[8][1]+"")&&q(ue,ee),Ae[5]?Lt?Lt.p(Ae,Q):(Lt=to(Ae),Lt.c(),Lt.m(s,le)):Lt&&(Lt.d(1),Lt=null),Q&16&&ne!==(ne=(((Jt=Ae[4].realtime)==null?void 0:Jt.last_mo)??"Last mo.")+"")&&q(te,ne),Q&512&&we!==(we=Ae[9][0]+"")&&q(I,we),Q&512&&B!==(B=Ae[9][1]+"")&&q(R,B),Ae[5]?Qe?Qe.p(Ae,Q):(Qe=lo(Ae),Qe.c(),Qe.m(s,null)):Qe&&(Qe.d(1),Qe=null),Q&16384&&J!==(J="grid grid-cols-"+Ae[14]+" mb-3")&&u(s,"class",J),Q&16&&me!==(me=(((pl=Ae[4].common)==null?void 0:pl.export)??"Export")+"")&&q(pe,me),Q&16&&Ee!==(Ee=Zt(((dl=Ae[4].common)==null?void 0:dl.hour)??"Hour")+"")&&q(Oe,Ee),Q&1024&&dt!==(dt=Ae[10][0]+"")&&q(lt,dt),Q&1024&&Be!==(Be=Ae[10][1]+"")&&q(ft,Be),Ae[5]?nt?nt.p(Ae,Q):(nt=no(Ae),nt.c(),nt.m(ve,bt)):nt&&(nt.d(1),nt=null),Q&16&&ot!==(ot=Zt(((Cl=Ae[4].common)==null?void 0:Cl.day)??"Day")+"")&&q(rt,ot),Q&2048&&Ie!==(Ie=Ae[11][0]+"")&&q(je,Ie),Q&2048&&de!==(de=Ae[11][1]+"")&&q(qe,de),Ae[5]?Tt?Tt.p(Ae,Q):(Tt=io(Ae),Tt.c(),Tt.m(ve,ge)):Tt&&(Tt.d(1),Tt=null),Q&16&&it!==(it=Zt(((Sl=Ae[4].common)==null?void 0:Sl.month)??"Month")+"")&&q(He,it),Q&4096&&Re!==(Re=Ae[12][0]+"")&&q(kt,Re),Q&4096&&vt!==(vt=Ae[12][1]+"")&&q(xe,vt),Ae[5]?at?at.p(Ae,Q):(at=so(Ae),at.c(),at.m(ve,Gt)):at&&(at.d(1),at=null),Q&16&&_t!==(_t=(((Ml=Ae[4].realtime)==null?void 0:Ml.last_mo)??"Last mo.")+"")&&q(Ht,_t),Q&8192&&Bt!==(Bt=Ae[13][0]+"")&&q(Xt,Bt),Q&8192&&Vt!==(Vt=Ae[13][1]+"")&&q(Ft,Vt),Ae[5]?he?he.p(Ae,Q):(he=oo(Ae),he.c(),he.m(ve,null)):he&&(he.d(1),he=null),Q&16384&&Je!==(Je="grid grid-cols-"+Ae[14])&&u(ve,"class",Je)},d(Ae){Ae&&(M(e),M(i),M(s),M(fe),M(ce),M(ke),M(ve)),Ue&&Ue.d(),Pt&&Pt.d(),Lt&&Lt.d(),Qe&&Qe.d(),nt&&nt.d(),Tt&&Tt.d(),at&&at.d(),he&&he.d()}}}function $s(t){var ie,be,we,I,P,B;let e,l=(((ie=t[4].realtime)==null?void 0:ie.cost)??"Cost")+"",n,i,s,o,r=Zt(((be=t[4].common)==null?void 0:be.hour)??"Hour")+"",f,c,_,d=zt(t[1].h.c,2)+"",m,h,v,b,w,k=Zt(((we=t[4].common)==null?void 0:we.day)??"Day")+"",A,L,O,N=zt(t[1].d.c,1)+"",D,E,F,H,y,S=Zt(((I=t[4].common)==null?void 0:I.month)??"Month")+"",j,$,G,W=zt(t[1].m.c)+"",X,U,K,se,x,z=(((P=t[4].realtime)==null?void 0:P.last_month)??"Last month")+"",ee,ue,ae,le=zt((B=t[0].last_month)==null?void 0:B.c)+"",_e,ne,te;return{c(){e=p("strong"),n=C(l),i=g(),s=p("div"),o=p("div"),f=C(r),c=g(),_=p("div"),m=C(d),h=g(),v=C(t[2]),b=g(),w=p("div"),A=C(k),L=g(),O=p("div"),D=C(N),E=g(),F=C(t[2]),H=g(),y=p("div"),j=C(S),$=g(),G=p("div"),X=C(W),U=g(),K=C(t[2]),se=g(),x=p("div"),ee=C(z),ue=g(),ae=p("div"),_e=C(le),ne=g(),te=C(t[2]),u(_,"class","text-right"),u(O,"class","text-right"),u(G,"class","text-right"),u(ae,"class","text-right"),u(s,"class","grid grid-cols-2")},m(R,Y){T(R,e,Y),a(e,n),T(R,i,Y),T(R,s,Y),a(s,o),a(o,f),a(s,c),a(s,_),a(_,m),a(_,h),a(_,v),a(s,b),a(s,w),a(w,A),a(s,L),a(s,O),a(O,D),a(O,E),a(O,F),a(s,H),a(s,y),a(y,j),a(s,$),a(s,G),a(G,X),a(G,U),a(G,K),a(s,se),a(s,x),a(x,ee),a(s,ue),a(s,ae),a(ae,_e),a(ae,ne),a(ae,te)},p(R,Y){var J,fe,ce,me,pe,ke;Y&16&&l!==(l=(((J=R[4].realtime)==null?void 0:J.cost)??"Cost")+"")&&q(n,l),Y&16&&r!==(r=Zt(((fe=R[4].common)==null?void 0:fe.hour)??"Hour")+"")&&q(f,r),Y&2&&d!==(d=zt(R[1].h.c,2)+"")&&q(m,d),Y&4&&q(v,R[2]),Y&16&&k!==(k=Zt(((ce=R[4].common)==null?void 0:ce.day)??"Day")+"")&&q(A,k),Y&2&&N!==(N=zt(R[1].d.c,1)+"")&&q(D,N),Y&4&&q(F,R[2]),Y&16&&S!==(S=Zt(((me=R[4].common)==null?void 0:me.month)??"Month")+"")&&q(j,S),Y&2&&W!==(W=zt(R[1].m.c)+"")&&q(X,W),Y&4&&q(K,R[2]),Y&16&&z!==(z=(((pe=R[4].realtime)==null?void 0:pe.last_month)??"Last month")+"")&&q(ee,z),Y&1&&le!==(le=zt((ke=R[0].last_month)==null?void 0:ke.c)+"")&&q(_e,le),Y&4&&q(te,R[2])},d(R){R&&(M(e),M(i),M(s))}}}function xs(t){let e,l=zt(t[1].h.c,2)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=g(),s=C(t[2]),u(e,"class","text-right")},m(o,r){T(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].h.c,2)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&M(e)}}}function eo(t){let e,l=zt(t[1].d.c,1)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=g(),s=C(t[2]),u(e,"class","text-right")},m(o,r){T(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].d.c,1)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&M(e)}}}function to(t){let e,l=zt(t[1].m.c)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=g(),s=C(t[2]),u(e,"class","text-right")},m(o,r){T(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].m.c)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&M(e)}}}function lo(t){var o;let e,l=zt((o=t[0].last_month)==null?void 0:o.c)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=g(),s=C(t[2]),u(e,"class","text-right")},m(r,f){T(r,e,f),a(e,n),a(e,i),a(e,s)},p(r,f){var c;f&1&&l!==(l=zt((c=r[0].last_month)==null?void 0:c.c)+"")&&q(n,l),f&4&&q(s,r[2])},d(r){r&&M(e)}}}function no(t){let e,l=zt(t[1].h.i,2)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=g(),s=C(t[2]),u(e,"class","text-right")},m(o,r){T(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].h.i,2)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&M(e)}}}function io(t){let e,l=zt(t[1].d.i,1)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=g(),s=C(t[2]),u(e,"class","text-right")},m(o,r){T(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].d.i,1)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&M(e)}}}function so(t){let e,l=zt(t[1].m.i)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=g(),s=C(t[2]),u(e,"class","text-right")},m(o,r){T(o,e,r),a(e,n),a(e,i),a(e,s)},p(o,r){r&2&&l!==(l=zt(o[1].m.i)+"")&&q(n,l),r&4&&q(s,o[2])},d(o){o&&M(e)}}}function oo(t){var o;let e,l=zt((o=t[0].last_month)==null?void 0:o.i)+"",n,i,s;return{c(){e=p("div"),n=C(l),i=g(),s=C(t[2]),u(e,"class","text-right")},m(r,f){T(r,e,f),a(e,n),a(e,i),a(e,s)},p(r,f){var c;f&1&&l!==(l=zt((c=r[0].last_month)==null?void 0:c.i)+"")&&q(n,l),f&4&&q(s,r[2])},d(r){r&&M(e)}}}function hc(t){var _;let e,l,n=(((_=t[4].realtime)==null?void 0:_.title)??"Real time calculations")+"",i,s,o,r,f,c=t[1]&&Js(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("br"),r=p("br"),f=g(),c&&c.c(),u(e,"class","mx-2 text-sm neas-green")},m(d,m){T(d,e,m),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),c&&c.m(e,null)},p(d,[m]){var h;m&16&&n!==(n=(((h=d[4].realtime)==null?void 0:h.title)??"Real time calculations")+"")&&q(i,n),d[1]?c?c.p(d,m):(c=Js(d),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:Ve,o:Ve,d(d){d&&M(e),c&&c.d()}}}function vc(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:s}=e,{hasExport:o}=e,{translations:r={}}=e,f,c,_,d,m,h,v,b,w=!1,k=3;return t.$$set=A=>{"sysinfo"in A&&l(0,n=A.sysinfo),"data"in A&&l(1,i=A.data),"currency"in A&&l(2,s=A.currency),"hasExport"in A&&l(3,o=A.hasExport),"translations"in A&&l(4,r=A.translations)},t.$$.update=()=>{var A,L,O,N,D,E,F,H;t.$$.dirty&35&&(l(5,w=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(14,k=w?3:2),l(6,f=cl(((A=i==null?void 0:i.h)==null?void 0:A.u)*1e3,"Wh")),l(7,c=cl(((L=i==null?void 0:i.d)==null?void 0:L.u)*1e3,"Wh")),l(8,_=cl(((O=i==null?void 0:i.m)==null?void 0:O.u)*1e3,"Wh")),l(9,d=cl(((N=n==null?void 0:n.last_month)==null?void 0:N.u)*1e3,"Wh")),l(10,m=cl(((D=i==null?void 0:i.h)==null?void 0:D.p)*1e3,"Wh")),l(11,h=cl(((E=i==null?void 0:i.d)==null?void 0:E.p)*1e3,"Wh")),l(12,v=cl(((F=i==null?void 0:i.m)==null?void 0:F.p)*1e3,"Wh")),l(13,b=cl(((H=n==null?void 0:n.last_month)==null?void 0:H.p)*1e3,"Wh")))},[n,i,s,o,r,w,f,c,_,d,m,h,v,b,k]}class bc extends Mt{constructor(e){super(),St(this,e,vc,hc,Ct,{sysinfo:0,data:1,currency:2,hasExport:3,translations:4})}}function gc(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function kc(t,e,l){let{title:n}=e,{json:i}=e,{sysinfo:s}=e,o={},r,f,c=document.documentElement.classList.contains("dark");return t.$$set=_=>{"title"in _&&l(1,n=_.title),"json"in _&&l(2,i=_.json),"sysinfo"in _&&l(3,s=_.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let _=i.currency,d=new Date().getUTCHours(),m=0,h=0,v=0,b=[],w=[],k=[];l(5,f=l(4,r=0));let A=new Date;for(Ol(A,s.clock_offset-(24+A.getHours()-A.getUTCHours())%24),m=d;m<24&&(h=i[gt(v++)],h!=null);m++)w.push({label:gt(A.getHours())}),k.push(h*100),l(5,f=Math.min(f,h*100)),l(4,r=Math.max(r,h*100)),Ol(A,1);for(m=0;m<24&&(h=i[gt(v++)],h!=null);m++)w.push({label:gt(A.getHours())}),k.push(h*100),l(5,f=Math.min(f,h*100)),l(4,r=Math.max(r,h*100)),Ol(A,1);let L=Hn(Math.max(Math.abs(f)/100,Math.abs(r)/100),_);if(L&&L[1]&&L[1]!=_)for(_=L[1],l(5,f*=100),l(4,r*=100),m=0;m=0?F.toFixed(H):"",title:F>=0?F.toFixed(2)+" "+_:"",value:h>=0?Math.abs(h):0,label2:F<0?F.toFixed(H):"",title2:F<0?F.toFixed(2)+" "+_:"",value2:h<0?Math.abs(h):0,color:c?"#5c2da5":"#7c3aed"})}let N=Math.max(r,Math.abs(f));if(f<0){l(5,f=Math.min(N/4*-1,f));let F=Math.ceil(Math.abs(f)/N*4),H=f/F;for(m=1;m{"title"in _&&l(1,n=_.title),"json"in _&&l(2,i=_.json),"sysinfo"in _&&l(3,s=_.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let _=0,d=[],m=[],h=[];l(5,f=l(4,r=0));let v=new Date,b=new Date;b.setDate(0),b.setHours(12);let w=(b.getHours()-b.getUTCHours())%24-s.clock_offset,k=v.getUTCHours();for(Ol(v,-w-24),_=k;_<24;_++){let N=i["i"+gt(_)],D=i["e"+gt(_)];N===void 0&&(N=0),D===void 0&&(D=0),m.push({label:gt(v.getHours())}),h.push({label:N.toFixed(1),title:N.toFixed(2)+" kWh",value:N*10,label2:D.toFixed(1),title2:D.toFixed(2)+" kWh",value2:D*10,color:c?"#5c2da5":"#7c3aed",color2:c?"#27728e":"#37829e"}),l(5,f=Math.max(f,D*10)),l(4,r=Math.max(r,N*10)),Ol(v,1)}for(_=0;_{"title"in _&&l(1,n=_.title),"json"in _&&l(2,i=_.json),"sysinfo"in _&&l(3,s=_.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let _=0,d=[],m=[],h=[];l(5,f=l(4,r=0));let v=new Date,b=new Date;b.setDate(0),b.setHours(12);let w=(b.getHours()-b.getUTCHours())%24-s.clock_offset;for(Ol(v,-w),Ol(b,-w),_=v.getDate();_<=b.getDate();_++){let O=i["i"+gt(_)],N=i["e"+gt(_)];O===void 0&&(O=0),N===void 0&&(N=0),m.push({label:gt(_)}),h.push({label:O.toFixed(O<10?1:0),title:O.toFixed(2)+" kWh",value:O,label2:N.toFixed(N<10?1:0),title2:N.toFixed(2)+" kWh",value2:N,color:c?"#5c2da5":"#7c3aed",color2:c?"#27728e":"#37829e"}),l(5,f=Math.max(f,N)),l(4,r=Math.max(r,O))}for(_=1;_{"title"in c&&l(1,n=c.title),"json"in c&&l(2,i=c.json)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,_=0,d=[],m=[],h=[];i.s&&i.s.forEach((w,k)=>{var A=w.n?w.n:w.a;_=w.v,_==-127&&(_=0),m.push({label:A.slice(-4)}),h.push({label:_.toFixed(1),value:_,color:s?"#5c2da5":"#7c3aed"}),l(4,f=Math.min(f,_)),l(3,r=Math.max(r,_))}),l(3,r=Math.ceil(r)),l(4,f=Math.floor(f));let v=r;f<0&&(v+=Math.abs(f));let b=v/4;for(c=0;c<5;c++)_=f+b*c,d.push({value:_,label:_.toFixed(1)});l(0,o={title:n+" (°C)",dark:document.documentElement.classList.contains("dark"),height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:f,max:r,ticks:d},x:{ticks:m},points:h})}},[o,n,i,r,f]}class Dc extends Mt{constructor(e){super(),St(this,e,qc,Ec,Ct,{title:1,json:2})}}function Ac(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}let Oc=0;function Lc(t,e,l){let{title:n}=e,{translations:i={}}=e,s=document.documentElement.classList.contains("dark"),o={},r=0,{tariffData:f}=e;return t.$$set=c=>{"title"in c&&l(1,n=c.title),"translations"in c&&l(2,i=c.translations),"tariffData"in c&&l(3,f=c.tariffData)},t.$$.update=()=>{var c;if(t.$$.dirty&30){let _=0,d=[],m=[],h=[];if(d.push({value:0,label:0}),f&&f.p)for(_=0;_0?gt(v.d)+"."+(i.months?(c=i.months)==null?void 0:c[new Date().getMonth()]:gt(new Date().getMonth()+1)):"-"}),l(4,r=Math.max(r,v.v))}if(f&&f.t){for(_=0;_=r)break;d.push({value:v,label:v})}d.push({label:f.m.toFixed(1),align:"right",color:"green",value:f.m})}f&&f.c&&(d.push({label:f.c.toFixed(0),color:"orange",value:f.c}),l(4,r=Math.max(r,f.c))),l(4,r=Math.ceil(r)),l(0,o={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:35,bottom:20,left:35},y:{min:Oc,max:r,ticks:d},x:{ticks:m},points:h})}},[o,n,i,f,r]}class Ic extends Mt{constructor(e){super(),St(this,e,Lc,Ac,Ct,{title:1,translations:2,tariffData:3})}}let fn=0,Rc={data:[]};async function ls(){let e=await(await kl(fn<0?"realtime.json":"realtime.json?offset="+fn)).json();ns.update(l=>{for(let n=0;n=0&&(fn+=e.size,fngn||Ri-gn>300?(ls(),ki=0):ns.update(t=>{if(t.lastUpdate)for(;gn>t.lastUpdate;)t.data.unshift(Ru),t.data=t.data.slice(0,t.size),t.lastUpdate+=10,ki++;else t.lastUpdate=gn;return t})}function Bc(t){if(Ru=t.i-t.e,gn=t.u,!ao){ls(),ao=!0,Ri=gn;return}Fc()&&Uc()}function fo(t,e,l){const n=t.slice();return n[18]=e[l],n[20]=l,n}function uo(t,e,l){const n=t.slice();return n[21]=e[l],n}function yc(t){let e,l,n;return{c(){e=p("strong"),l=C(t[0]),n=C(" not available"),u(e,"class","text-sm")},m(i,s){T(i,e,s),a(e,l),a(e,n)},p(i,s){s&1&&q(l,i[0])},d(i){i&&M(e)}}}function jc(t){let e,l,n,i,s,o,r,f=t[8]&&ro(t);return{c(){e=p("strong"),l=C(t[0]),n=C(" ("),i=C(t[12]),s=C(")"),o=g(),f&&f.c(),r=yt(),u(e,"class","text-sm")},m(c,_){T(c,e,_),a(e,l),a(e,n),a(e,i),a(e,s),T(c,o,_),f&&f.m(c,_),T(c,r,_)},p(c,_){_&1&&q(l,c[0]),_&4096&&q(i,c[12]),c[8]?f?f.p(c,_):(f=ro(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(M(e),M(o),M(r)),f&&f.d(c)}}}function ro(t){let e,l,n,i,s,o=tt(t[8]),r=[];for(let _=0;_t[17].call(e))},m(o,r){T(o,e,r),s.m(e,null),l=Vi(e,t[17].bind(e))},p(o,[r]){i===(i=n(o))&&s?s.p(o,r):(s.d(1),s=i(o),s&&(s.c(),s.m(e,null)))},i:Ve,o:Ve,d(o){o&&M(e),s.d(),l()}}}function Hc(t,e,l){let{title:n}=e,i=document.documentElement.classList.contains("dark"),s=null;ns.subscribe(N=>{l(16,s=N)});let o=!1,r,f,c,_,d,m,h,v=function(N,D,E){return Math.ceil(d-(N-D)/(E-D)*d)-25},b=function(N){return 30+Math.ceil(N/s.size*(m-35))},w,k,A,L;function O(){c=this.clientWidth,_=this.clientHeight,l(3,c),l(4,_)}return t.$$set=N=>{"title"in N&&l(0,n=N.title)},t.$$.update=()=>{if(t.$$.dirty&67582)if(l(5,d=parseInt(_)-50),l(6,m=c-35),l(10,A=m/s.size),l(2,f=0),l(1,r=0),s.data&&d>10&&m>100&&A>.1){l(11,o=!0);for(let E in s.data){let F=s.data[E];isNaN(F)&&(F=0),l(1,r=Math.max(Math.ceil(F/1e3)*1e3,r)),l(2,f=Math.min(Math.floor(F/1e3)*1e3,f))}let N=r-f;l(12,L=r>2500?"kW":"W"),l(8,w=[]);for(let E=f;E2500?(E/1e3).toFixed(1):E}),!(w.length>6));E+=N/5);l(9,k=[]);for(let E=0;E12));E+=Math.round(s.size/Math.round(m/120)));let D=s.size;l(7,h=b(s.size)+","+v(0,f,r)+" "+b(1)+","+v(0,f,r));for(let E in s.data){if(D<0)break;let F=s.data[E];isNaN(F)&&(F=0),l(7,h=b(D--)+","+v(F,f,r)+" "+h)}}else l(11,o=!1)},[n,r,f,c,_,d,m,h,w,k,A,o,L,i,v,b,s,O]}class Wc extends Mt{constructor(e){super(),St(this,e,Hc,zc,Ct,{title:0})}}function Gc(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,[i]){const s={};i&1&&(s.config=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function Vc(t,e,l){let{title:n}=e,{unit:i=""}=e,{l1:s=!1}=e,{l2:o=!1}=e,{l2x:r=!1}=e,{l3:f=!1}=e,{l1i:c=0}=e,{l2i:_=0}=e,{l3i:d=0}=e,{l1e:m=0}=e,{l2e:h=0}=e,{l3e:v=0}=e,{maxImport:b=0}=e,{maxExport:w=0}=e,{importColorFn:k}=e,{exportColorFn:A}=e,L={};function O(N,D){return{label:zt(N>900?N/1e3:N)+(N>900?"k":"")+i,title:N.toFixed(2)+" "+i,value:isNaN(N)?0:N,color:k(N?N/b*100:0,document.documentElement.classList.contains("dark")),label2:zt(D>900?D/1e3:D)+(D>900?"k":"")+i,title2:D.toFixed(2)+" "+i,value2:isNaN(D)?0:D,color2:A(D?D/w*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,s=N.l1),"l2"in N&&l(4,o=N.l2),"l2x"in N&&l(5,r=N.l2x),"l3"in N&&l(6,f=N.l3),"l1i"in N&&l(7,c=N.l1i),"l2i"in N&&l(8,_=N.l2i),"l3i"in N&&l(9,d=N.l3i),"l1e"in N&&l(10,m=N.l1e),"l2e"in N&&l(11,h=N.l2e),"l3e"in N&&l(12,v=N.l3e),"maxImport"in N&&l(13,b=N.maxImport),"maxExport"in N&&l(14,w=N.maxExport),"importColorFn"in N&&l(15,k=N.importColorFn),"exportColorFn"in N&&l(16,A=N.exportColorFn)},t.$$.update=()=>{if(t.$$.dirty&32762){let N=[],D=[];s&&(N.push({label:"L1"}),D.push(O(c,m))),o&&(r?(N.push({label:"L2"}),D.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(N.push({label:"L2"}),D.push(O(_,h)))),f&&(N.push({label:"L3"}),D.push(O(d,v)));let E=[];if(w){let F=w>b?4:w*4/b;E.push({value:-w,label:"-100%"}),F>=4&&E.push({value:-w/4*3,label:"-75%"}),F>=2&&E.push({value:-w/2,label:"-50%"}),F>=4&&E.push({value:-w/4,label:"-25%"})}if(E.push({value:0,label:"0%"}),b){let F=b>w?4:b*4/w;E.push({value:b/4,label:"25%"}),F>=4&&E.push({value:b/2,label:"50%"}),F>=2&&E.push({value:b/4*3,label:"75%"}),F>=4&&E.push({value:b,label:"100%"})}l(0,L={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:15,bottom:20,left:35},y:{min:-w,max:b,ticks:E},x:{ticks:N},points:D})}},[L,n,i,s,o,r,f,c,_,d,m,h,v,b,w,k,A]}class is extends Mt{constructor(e){super(),St(this,e,Vc,Gc,Ct,{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 ho(t){var k;let e,l,n,i,s,o,r=(t[0].mt?ui(t[0].mt):"-")+"",f,c,_,d=t[11][0]+"",m,h,v=t[11][1]+"",b,w;return i=new Iu({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:((k=t[6].common)==null?void 0:k.import)??"Import",sub:Hn(t[0].p,t[0].pc),colorFn:Zi}}),{c(){e=p("div"),l=p("div"),n=p("div"),Ne(i.$$.fragment),s=g(),o=p("div"),f=C(r),c=g(),_=p("div"),m=C(d),h=g(),b=C(v),u(n,"class","col-span-2"),u(_,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(A,L){T(A,e,L),a(e,l),a(l,n),Se(i,n,null),a(l,s),a(l,o),a(o,f),a(l,c),a(l,_),a(_,m),a(_,h),a(_,b),w=!0},p(A,L){var N;const O={};L&1&&(O.val=A[0].i?A[0].i:0),L&1&&(O.max=A[0].im?A[0].im:15e3),L&64&&(O.label=((N=A[6].common)==null?void 0:N.import)??"Import"),L&1&&(O.sub=Hn(A[0].p,A[0].pc)),i.$set(O),(!w||L&1)&&r!==(r=(A[0].mt?ui(A[0].mt):"-")+"")&&q(f,r),(!w||L&2048)&&d!==(d=A[11][0]+"")&&q(m,d),(!w||L&2048)&&v!==(v=A[11][1]+"")&&q(b,v)},i(A){w||(Z(i.$$.fragment,A),w=!0)},o(A){oe(i.$$.fragment,A),w=!1},d(A){A&&M(e),Me(i)}}}function vo(t){var b;let e,l,n,i,s,o,r,f,c=t[12][0]+"",_,d,m=t[12][1]+"",h,v;return i=new Iu({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:((b=t[6].common)==null?void 0:b.export)??"Export",sub:Hn(t[0].px,t[0].pc),colorFn:zn}}),{c(){e=p("div"),l=p("div"),n=p("div"),Ne(i.$$.fragment),s=g(),o=p("div"),r=g(),f=p("div"),_=C(c),d=g(),h=C(m),u(n,"class","col-span-2"),u(f,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(w,k){T(w,e,k),a(e,l),a(l,n),Se(i,n,null),a(l,s),a(l,o),a(l,r),a(l,f),a(f,_),a(f,d),a(f,h),v=!0},p(w,k){var L;const A={};k&1&&(A.val=w[0].e?w[0].e:0),k&1&&(A.max=w[0].om?w[0].om*1e3:1e4),k&64&&(A.label=((L=w[6].common)==null?void 0:L.export)??"Export"),k&1&&(A.sub=Hn(w[0].px,w[0].pc)),i.$set(A),(!v||k&4096)&&c!==(c=w[12][0]+"")&&q(_,c),(!v||k&4096)&&m!==(m=w[12][1]+"")&&q(h,m)},i(w){v||(Z(i.$$.fragment,w),v=!0)},o(w){oe(i.$$.fragment,w),v=!1},d(w){w&&M(e),Me(i)}}}function bo(t){let e,l,n=t[0].l1&&go(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,s){T(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&Z(n,1)):(n=go(i),n.c(),Z(n,1),n.m(e,null)):n&&(mt(),oe(n,1,1,()=>{n=null}),pt())},i(i){l||(Z(n),l=!0)},o(i){oe(n),l=!1},d(i){i&&M(e),n&&n.d()}}}function go(t){var n;let e,l;return e=new rc({props:{title:((n=t[6].common)==null?void 0:n.voltage)??"Volt",u1:t[0].l1.u,u2:t[0].l2.u,u3:t[0].l3.u,ds:t[0].ds}}),{c(){Ne(e.$$.fragment)},m(i,s){Se(e,i,s),l=!0},p(i,s){var r;const o={};s&64&&(o.title=((r=i[6].common)==null?void 0:r.voltage)??"Volt"),s&1&&(o.u1=i[0].l1.u),s&1&&(o.u2=i[0].l2.u),s&1&&(o.u3=i[0].l3.u),s&1&&(o.ds=i[0].ds),e.$set(o)},i(i){l||(Z(e.$$.fragment,i),l=!0)},o(i){oe(e.$$.fragment,i),l=!1},d(i){Me(e,i)}}}function ko(t){let e,l,n=t[0].l1&&wo(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,s){T(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&Z(n,1)):(n=wo(i),n.c(),Z(n,1),n.m(e,null)):n&&(mt(),oe(n,1,1,()=>{n=null}),pt())},i(i){l||(Z(n),l=!0)},o(i){oe(n),l=!1},d(i){i&&M(e),n&&n.d()}}}function wo(t){var n;let e,l;return e=new is({props:{title:((n=t[6].common)==null?void 0:n.amperage)??"Amp",unit:"A",importColorFn:Zi,exportColorFn:zn,maxImport:t[0].mf,l1:t[8],l2:t[9],l3:t[10],l2x:t[0].l2.e,l1i:Math.max(Math.abs(t[0].l1.i),0),l2i:Math.max(Math.abs(t[0].l2.i),0),l3i:Math.max(Math.abs(t[0].l3.i),0)}}),{c(){Ne(e.$$.fragment)},m(i,s){Se(e,i,s),l=!0},p(i,s){var r;const o={};s&64&&(o.title=((r=i[6].common)==null?void 0:r.amperage)??"Amp"),s&1&&(o.maxImport=i[0].mf),s&256&&(o.l1=i[8]),s&512&&(o.l2=i[9]),s&1024&&(o.l3=i[10]),s&1&&(o.l2x=i[0].l2.e),s&1&&(o.l1i=Math.max(Math.abs(i[0].l1.i),0)),s&1&&(o.l2i=Math.max(Math.abs(i[0].l2.i),0)),s&1&&(o.l3i=Math.max(Math.abs(i[0].l3.i),0)),e.$set(o)},i(i){l||(Z(e.$$.fragment,i),l=!0)},o(i){oe(e.$$.fragment,i),l=!1},d(i){Me(e,i)}}}function Co(t){let e,l,n=t[0].l1&&So(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,s){T(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&Z(n,1)):(n=So(i),n.c(),Z(n,1),n.m(e,null)):n&&(mt(),oe(n,1,1,()=>{n=null}),pt())},i(i){l||(Z(n),l=!0)},o(i){oe(n),l=!1},d(i){i&&M(e),n&&n.d()}}}function So(t){var n;let e,l;return e=new is({props:{title:((n=t[6].dashboard)==null?void 0:n.phase)??"Phase",unit:"W",importColorFn:Zi,exportColorFn:zn,maxImport:(t[0].mf?t[0].mf:32)*230,maxExport:t[0].om?t[13]?t[0].om*1e3/Math.sqrt(3):t[0].om*1e3:0,l1:t[8],l2:t[9],l3:t[10],l1i:t[0].l1.p,l2i:t[0].l2.p,l3i:t[0].l3.p,l1e:t[0].l1.q,l2e:t[0].l2.q,l3e:t[0].l3.q}}),{c(){Ne(e.$$.fragment)},m(i,s){Se(e,i,s),l=!0},p(i,s){var r;const o={};s&64&&(o.title=((r=i[6].dashboard)==null?void 0:r.phase)??"Phase"),s&1&&(o.maxImport=(i[0].mf?i[0].mf:32)*230),s&8193&&(o.maxExport=i[0].om?i[13]?i[0].om*1e3/Math.sqrt(3):i[0].om*1e3:0),s&256&&(o.l1=i[8]),s&512&&(o.l2=i[9]),s&1024&&(o.l3=i[10]),s&1&&(o.l1i=i[0].l1.p),s&1&&(o.l2i=i[0].l2.p),s&1&&(o.l3i=i[0].l3.p),s&1&&(o.l1e=i[0].l1.q),s&1&&(o.l2e=i[0].l2.q),s&1&&(o.l3e=i[0].l3.q),e.$set(o)},i(i){l||(Z(e.$$.fragment,i),l=!0)},o(i){oe(e.$$.fragment,i),l=!1},d(i){Me(e,i)}}}function Mo(t){let e,l,n=t[0].l1&&No(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,s){T(i,e,s),n&&n.m(e,null),l=!0},p(i,s){i[0].l1?n?(n.p(i,s),s&1&&Z(n,1)):(n=No(i),n.c(),Z(n,1),n.m(e,null)):n&&(mt(),oe(n,1,1,()=>{n=null}),pt())},i(i){l||(Z(n),l=!0)},o(i){oe(n),l=!1},d(i){i&&M(e),n&&n.d()}}}function No(t){var n;let e,l;return e=new is({props:{title:((n=t[6].dashboard)==null?void 0:n.pf)??"Pf",importColorFn:zn,exportColorFn:zn,maxImport:1,l1:t[8],l2:t[9],l3:t[10],l1i:t[0].l1.f,l2i:t[0].l2.f,l3i:t[0].l3.f}}),{c(){Ne(e.$$.fragment)},m(i,s){Se(e,i,s),l=!0},p(i,s){var r;const o={};s&64&&(o.title=((r=i[6].dashboard)==null?void 0:r.pf)??"Pf"),s&256&&(o.l1=i[8]),s&512&&(o.l2=i[9]),s&1024&&(o.l3=i[10]),s&1&&(o.l1i=i[0].l1.f),s&1&&(o.l2i=i[0].l2.f),s&1&&(o.l3i=i[0].l3.f),e.$set(o)},i(i){l||(Z(e.$$.fragment,i),l=!0)},o(i){oe(e.$$.fragment,i),l=!1},d(i){Me(e,i)}}}function To(t){let e,l,n;return l=new mc({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec,translations:t[6]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt")},m(i,s){T(i,e,s),Se(l,e,null),n=!0},p(i,s){const o={};s&1&&(o.importInstant=i[0].ri),s&1&&(o.exportInstant=i[0].re),s&1&&(o.importTotal=i[0].ric),s&1&&(o.exportTotal=i[0].rec),s&64&&(o.translations=i[6]),l.$set(o)},i(i){n||(Z(l.$$.fragment,i),n=!0)},o(i){oe(l.$$.fragment,i),n=!1},d(i){i&&M(e),Me(l)}}}function Po(t){let e,l,n;return l=new bc({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0,translations:t[6]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt")},m(i,s){T(i,e,s),Se(l,e,null),n=!0},p(i,s){const o={};s&2&&(o.sysinfo=i[1]),s&1&&(o.data=i[0].ea),s&1&&(o.currency=i[0].pc),s&1&&(o.hasExport=i[0].om>0||i[0].e>0),s&64&&(o.translations=i[6]),l.$set(o)},i(i){n||(Z(l.$$.fragment,i),n=!0)},o(i){oe(l.$$.fragment,i),n=!1},d(i){i&&M(e),Me(l)}}}function Eo(t){var i;let e,l,n;return l=new Ic({props:{title:((i=t[6].dashboard)==null?void 0:i.tariffpeak)??"Tariff peaks",tariffData:t[7],translations:t[6]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt h-64")},m(s,o){T(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.tariffpeak)??"Tariff peaks"),o&128&&(r.tariffData=s[7]),o&64&&(r.translations=s[6]),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){oe(l.$$.fragment,s),n=!1},d(s){s&&M(e),Me(l)}}}function qo(t){var i;let e,l,n;return l=new Wc({props:{title:((i=t[6].dashboard)==null?void 0:i.realtime)??"Real time"}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(s,o){T(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.realtime)??"Real time"),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){oe(l.$$.fragment,s),n=!1},d(s){s&&M(e),Me(l)}}}function Do(t){var i;let e,l,n;return l=new wc({props:{title:((i=t[6].dashboard)==null?void 0:i.price)??"Price",json:t[2],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(s,o){T(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.price)??"Price"),o&4&&(r.json=s[2]),o&2&&(r.sysinfo=s[1]),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){oe(l.$$.fragment,s),n=!1},d(s){s&&M(e),Me(l)}}}function Ao(t){var i;let e,l,n;return l=new Mc({props:{title:((i=t[6].dashboard)==null?void 0:i.day)??"24 hours",json:t[3],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(s,o){T(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.day)??"24 hours"),o&8&&(r.json=s[3]),o&2&&(r.sysinfo=s[1]),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){oe(l.$$.fragment,s),n=!1},d(s){s&&M(e),Me(l)}}}function Oo(t){var i;let e,l,n;return l=new Pc({props:{title:((i=t[6].dashboard)==null?void 0:i.month)??"{0} days",json:t[4],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(s,o){T(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.month)??"{0} days"),o&16&&(r.json=s[4]),o&2&&(r.sysinfo=s[1]),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){oe(l.$$.fragment,s),n=!1},d(s){s&&M(e),Me(l)}}}function Lo(t){var i;let e,l,n;return l=new Dc({props:{title:((i=t[6].dashboard)==null?void 0:i.temperature)??"Temperature",json:t[5]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(s,o){T(s,e,o),Se(l,e,null),n=!0},p(s,o){var f;const r={};o&64&&(r.title=((f=s[6].dashboard)==null?void 0:f.temperature)??"Temperature"),o&32&&(r.json=s[5]),l.$set(r)},i(s){n||(Z(l.$$.fragment,s),n=!0)},o(s){oe(l.$$.fragment,s),n=!1},d(s){s&&M(e),Me(l)}}}function Kc(t){let e,l=Wt(t[1].ui.i,t[0].i),n,i=Wt(t[1].ui.e,t[0].om||t[0].e>0),s,o=Wt(t[1].ui.v,t[0].l1&&(t[0].l1.u>100||t[0].l2.u>100||t[0].l3.u>100)),r,f=Wt(t[1].ui.a,t[0].l1&&(t[0].l1.i>.01||t[0].l2.i>.01||t[0].l3.i>.01)),c,_=Wt(t[1].ui.h,t[0].l1&&(t[0].l1.p>.01||t[0].l2.p>.01||t[0].l3.p>.01||t[0].l1.q>.01||t[0].l2.q>.01||t[0].l3.q>.01)),d,m=Wt(t[1].ui.f,t[0].l1&&(t[0].l1.f>.01||t[0].l2.f>.01||t[0].l3.f>.01)),h,v=Wt(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),b,w=Wt(t[1].ui.c,t[0].ea),k,A=Wt(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("NO")||t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),L,O=Wt(t[1].ui.l,t[0].hm==1),N,D=Wt(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),E,F=Wt(t[1].ui.d,t[3]),H,y=Wt(t[1].ui.m,t[4]),S,j=Wt(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),$,G=l&&ho(t),W=i&&vo(t),X=o&&bo(t),U=f&&ko(t),K=_&&Co(t),se=m&&Mo(t),x=v&&To(t),z=w&&Po(t),ee=A&&Eo(t),ue=O&&qo(t),ae=D&&Do(t),le=F&&Ao(t),_e=y&&Oo(t),ne=j&&Lo(t);return{c(){e=p("div"),G&&G.c(),n=g(),W&&W.c(),s=g(),X&&X.c(),r=g(),U&&U.c(),c=g(),K&&K.c(),d=g(),se&&se.c(),h=g(),x&&x.c(),b=g(),z&&z.c(),k=g(),ee&&ee.c(),L=g(),ue&&ue.c(),N=g(),ae&&ae.c(),E=g(),le&&le.c(),H=g(),_e&&_e.c(),S=g(),ne&&ne.c(),u(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(te,ie){T(te,e,ie),G&&G.m(e,null),a(e,n),W&&W.m(e,null),a(e,s),X&&X.m(e,null),a(e,r),U&&U.m(e,null),a(e,c),K&&K.m(e,null),a(e,d),se&&se.m(e,null),a(e,h),x&&x.m(e,null),a(e,b),z&&z.m(e,null),a(e,k),ee&&ee.m(e,null),a(e,L),ue&&ue.m(e,null),a(e,N),ae&&ae.m(e,null),a(e,E),le&&le.m(e,null),a(e,H),_e&&_e.m(e,null),a(e,S),ne&&ne.m(e,null),$=!0},p(te,[ie]){ie&3&&(l=Wt(te[1].ui.i,te[0].i)),l?G?(G.p(te,ie),ie&3&&Z(G,1)):(G=ho(te),G.c(),Z(G,1),G.m(e,n)):G&&(mt(),oe(G,1,1,()=>{G=null}),pt()),ie&3&&(i=Wt(te[1].ui.e,te[0].om||te[0].e>0)),i?W?(W.p(te,ie),ie&3&&Z(W,1)):(W=vo(te),W.c(),Z(W,1),W.m(e,s)):W&&(mt(),oe(W,1,1,()=>{W=null}),pt()),ie&3&&(o=Wt(te[1].ui.v,te[0].l1&&(te[0].l1.u>100||te[0].l2.u>100||te[0].l3.u>100))),o?X?(X.p(te,ie),ie&3&&Z(X,1)):(X=bo(te),X.c(),Z(X,1),X.m(e,r)):X&&(mt(),oe(X,1,1,()=>{X=null}),pt()),ie&3&&(f=Wt(te[1].ui.a,te[0].l1&&(te[0].l1.i>.01||te[0].l2.i>.01||te[0].l3.i>.01))),f?U?(U.p(te,ie),ie&3&&Z(U,1)):(U=ko(te),U.c(),Z(U,1),U.m(e,c)):U&&(mt(),oe(U,1,1,()=>{U=null}),pt()),ie&3&&(_=Wt(te[1].ui.h,te[0].l1&&(te[0].l1.p>.01||te[0].l2.p>.01||te[0].l3.p>.01||te[0].l1.q>.01||te[0].l2.q>.01||te[0].l3.q>.01))),_?K?(K.p(te,ie),ie&3&&Z(K,1)):(K=Co(te),K.c(),Z(K,1),K.m(e,d)):K&&(mt(),oe(K,1,1,()=>{K=null}),pt()),ie&3&&(m=Wt(te[1].ui.f,te[0].l1&&(te[0].l1.f>.01||te[0].l2.f>.01||te[0].l3.f>.01))),m?se?(se.p(te,ie),ie&3&&Z(se,1)):(se=Mo(te),se.c(),Z(se,1),se.m(e,h)):se&&(mt(),oe(se,1,1,()=>{se=null}),pt()),ie&3&&(v=Wt(te[1].ui.r,te[0].ri>0||te[0].re>0||te[0].ric>0||te[0].rec>0)),v?x?(x.p(te,ie),ie&3&&Z(x,1)):(x=To(te),x.c(),Z(x,1),x.m(e,b)):x&&(mt(),oe(x,1,1,()=>{x=null}),pt()),ie&3&&(w=Wt(te[1].ui.c,te[0].ea)),w?z?(z.p(te,ie),ie&3&&Z(z,1)):(z=Po(te),z.c(),Z(z,1),z.m(e,k)):z&&(mt(),oe(z,1,1,()=>{z=null}),pt()),ie&3&&(A=Wt(te[1].ui.t,te[0].pr&&(te[0].pr.startsWith("NO")||te[0].pr.startsWith("10YNO")||te[0].pr.startsWith("10Y1001A1001A4")))),A?ee?(ee.p(te,ie),ie&3&&Z(ee,1)):(ee=Eo(te),ee.c(),Z(ee,1),ee.m(e,L)):ee&&(mt(),oe(ee,1,1,()=>{ee=null}),pt()),ie&3&&(O=Wt(te[1].ui.l,te[0].hm==1)),O?ue?(ue.p(te,ie),ie&3&&Z(ue,1)):(ue=qo(te),ue.c(),Z(ue,1),ue.m(e,N)):ue&&(mt(),oe(ue,1,1,()=>{ue=null}),pt()),ie&3&&(D=Wt(te[1].ui.p,te[0].pe&&!Number.isNaN(te[0].p))),D?ae?(ae.p(te,ie),ie&3&&Z(ae,1)):(ae=Do(te),ae.c(),Z(ae,1),ae.m(e,E)):ae&&(mt(),oe(ae,1,1,()=>{ae=null}),pt()),ie&10&&(F=Wt(te[1].ui.d,te[3])),F?le?(le.p(te,ie),ie&10&&Z(le,1)):(le=Ao(te),le.c(),Z(le,1),le.m(e,H)):le&&(mt(),oe(le,1,1,()=>{le=null}),pt()),ie&18&&(y=Wt(te[1].ui.m,te[4])),y?_e?(_e.p(te,ie),ie&18&&Z(_e,1)):(_e=Oo(te),_e.c(),Z(_e,1),_e.m(e,S)):_e&&(mt(),oe(_e,1,1,()=>{_e=null}),pt()),ie&35&&(j=Wt(te[1].ui.s,te[0].t&&te[0].t!=-127&&te[5].c>1)),j?ne?(ne.p(te,ie),ie&35&&Z(ne,1)):(ne=Lo(te),ne.c(),Z(ne,1),ne.m(e,null)):ne&&(mt(),oe(ne,1,1,()=>{ne=null}),pt())},i(te){$||(Z(G),Z(W),Z(X),Z(U),Z(K),Z(se),Z(x),Z(z),Z(ee),Z(ue),Z(ae),Z(le),Z(_e),Z(ne),$=!0)},o(te){oe(G),oe(W),oe(X),oe(U),oe(K),oe(se),oe(x),oe(z),oe(ee),oe(ue),oe(ae),oe(le),oe(_e),oe(ne),$=!1},d(te){te&&M(e),G&&G.d(),W&&W.d(),X&&X.d(),U&&U.d(),K&&K.d(),se&&se.d(),x&&x.d(),z&&z.d(),ee&&ee.d(),ue&&ue.d(),ae&&ae.d(),le&&le.d(),_e&&_e.d(),ne&&ne.d()}}}function Yc(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,{prices:s={}}=e,{dayPlot:o={}}=e,{monthPlot:r={}}=e,{temperatures:f={}}=e,{translations:c={}}=e,{tariffData:_={}}=e,d,m,h,v,b,w;return t.$$set=k=>{"data"in k&&l(0,n=k.data),"sysinfo"in k&&l(1,i=k.sysinfo),"prices"in k&&l(2,s=k.prices),"dayPlot"in k&&l(3,o=k.dayPlot),"monthPlot"in k&&l(4,r=k.monthPlot),"temperatures"in k&&l(5,f=k.temperatures),"translations"in k&&l(6,c=k.translations),"tariffData"in k&&l(7,_=k.tariffData)},t.$$.update=()=>{var k,A,L,O,N,D,E,F,H,y,S,j,$,G,W;t.$$.dirty&1793&&(l(11,d=cl((n==null?void 0:n.ic)*1e3,"Wh")),l(12,m=cl((n==null?void 0:n.ec)*1e3,"Wh")),((k=n==null?void 0:n.l1)==null?void 0:k.u)==0&&((A=n==null?void 0:n.l2)==null?void 0:A.u)==0&&((L=n==null?void 0:n.l3)==null?void 0:L.u)==0?l(8,v=l(9,b=l(10,w=l(13,h=!0)))):(l(8,v=((O=n==null?void 0:n.l1)==null?void 0:O.u)>0||((N=n==null?void 0:n.l1)==null?void 0:N.i)>0||((D=n==null?void 0:n.l1)==null?void 0:D.p)>0||((E=n==null?void 0:n.l1)==null?void 0:E.q)>0),l(9,b=((F=n==null?void 0:n.l2)==null?void 0:F.u)>0||((H=n==null?void 0:n.l2)==null?void 0:H.i)>0||((y=n==null?void 0:n.l2)==null?void 0:y.p)>0||((S=n==null?void 0:n.l2)==null?void 0:S.q)>0),l(10,w=((j=n==null?void 0:n.l3)==null?void 0:j.u)>0||(($=n==null?void 0:n.l3)==null?void 0:$.i)>0||((G=n==null?void 0:n.l3)==null?void 0:G.p)>0||((W=n==null?void 0:n.l3)==null?void 0:W.q)>0),l(13,h=v&&b&&w)))},[n,i,s,o,r,f,c,_,v,b,w,d,m,h]}class Xc extends Mt{constructor(e){super(),St(this,e,Yc,Kc,Ct,{data:0,sysinfo:1,prices:2,dayPlot:3,monthPlot:4,temperatures:5,translations:6,tariffData:7})}}let Fi={};const Fn=al(Fi);async function Qc(){Fi=await(await fetch("configuration.json")).json(),Fn.set(Fi)}let Ui={};const Fu=al(Ui);async function Zc(){Ui=await(await fetch("priceconfig.json")).json(),Fu.set(Ui)}function Io(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Ro(t){let e,l,n;return{c(){e=p("option"),e.textContent="UART0",l=g(),n=p("option"),n.textContent="UART2",e.__value=3,V(e,e.__value),n.__value=113,V(n,n.__value)},m(i,s){T(i,e,s),T(i,l,s),T(i,n,s)},d(i){i&&(M(e),M(l),M(n))}}}function Fo(t){let e;return{c(){e=p("option"),e.textContent=`GPIO${t[4]}`,e.__value=t[4],V(e,e.__value)},m(l,n){T(l,e,n)},d(l){l&&M(e)}}}function Uo(t){let e,l=t[4]>1&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Fo(t);return{c(){l&&l.c(),e=yt()},m(n,i){l&&l.m(n,i),T(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Fo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){n&&M(e),l&&l.d(n)}}}function Jc(t){let e,l,n,i,s=t[0]=="esp8266"&&Ro(),o=tt({length:t[1]+1}),r=[];for(let f=0;f{"chip"in s&&l(0,n=s.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=21);break}},[n,i]}class Bi extends Mt{constructor(e){super(),St(this,e,$c,Jc,Ct,{chip:0})}}function Bo(t){let e,l,n=t[1]&&yo(t);return{c(){e=p("div"),l=p("div"),n&&n.c(),u(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-80 flex items-center justify-center"),u(e,"class","z-50"),u(e,"aria-modal","true")},m(i,s){T(i,e,s),a(e,l),n&&n.m(l,null)},p(i,s){i[1]?n?n.p(i,s):(n=yo(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&M(e),n&&n.d()}}}function yo(t){let e,l;return{c(){e=p("div"),l=C(t[1]),u(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){T(n,e,i),a(e,l)},p(n,i){i&2&&q(l,n[1])},d(n){n&&M(e)}}}function xc(t){let e,l=t[0]&&Bo(t);return{c(){l&&l.c(),e=yt()},m(n,i){l&&l.m(n,i),T(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Bo(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:Ve,o:Ve,d(n){n&&M(e),l&&l.d(n)}}}function e0(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=s=>{"active"in s&&l(0,n=s.active),"message"in s&&l(1,i=s.message)},[n,i]}class _l extends Mt{constructor(e){super(),St(this,e,e0,xc,Ct,{active:0,message:1})}}function jo(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=p("option"),l=C("Europe/"),i=C(n),e.__value="Europe/"+t[1],V(e,e.__value)},m(s,o){T(s,e,o),a(e,l),a(e,i)},p:Ve,d(s){s&&M(e)}}}function t0(t){let e,l,n,i=tt(t[0]),s=[];for(let o=0;o>1&1,R=0;R0;P--)R[P]=R[P]?R[P-1]^N.EXPONENT[F._modN(N.LOG[R[P]]+I)]:R[P-1];R[0]=N.EXPONENT[F._modN(N.LOG[R[0]]+I)]}for(I=0;I<=B;I++)R[I]=N.LOG[R[I]]},_checkBadness:function(){var I,P,B,R,Y,J=0,fe=this._badness,ce=this.buffer,me=this.width;for(Y=0;Yme*me;)ve-=me*me,ke++;for(J+=ke*F.N4,R=0;R=fe-2&&(I=fe-2,Y>9&&I--);var ce=I;if(Y>9){for(J[ce+2]=0,J[ce+3]=0;ce--;)P=J[ce],J[ce+3]|=255&P<<4,J[ce+2]=P>>4;J[2]|=255&I<<4,J[1]=I>>4,J[0]=64|I>>12}else{for(J[ce+1]=0,J[ce+2]=0;ce--;)P=J[ce],J[ce+2]|=255&P<<4,J[ce+1]=P>>4;J[1]|=255&I<<4,J[0]=64|I>>4}for(ce=I+3-(Y<10);ce=5&&(B+=F.N1+R[P]-5);for(P=3;PI||R[P-3]*3>=R[P]*4||R[P+3]*3>=R[P]*4)&&(B+=F.N3);return B},_finish:function(){this._stringBuffer=this.buffer.slice();var I,P,B=0,R=3e4;for(P=0;P<8&&(this._applyMask(P),I=this._checkBadness(),I>=1)R&1&&(Y[J-1-P+J*8]=1,P<6?Y[8+J*P]=1:Y[8+J*(P+1)]=1);for(P=0;P<7;P++,R>>=1)R&1&&(Y[8+J*(J-7+P)]=1,P?Y[6-P+J*8]=1:Y[7+J*8]=1)},_interleaveBlocks:function(){var I,P,B=this._dataBlock,R=this._ecc,Y=this._eccBlock,J=0,fe=this._calculateMaxLength(),ce=this._neccBlock1,me=this._neccBlock2,pe=this._stringBuffer;for(I=0;I1)for(I=k.BLOCK[R],B=Y-7;;){for(P=Y-7;P>I-3&&(this._addAlignment(P,B),!(P6)for(I=E.BLOCK[J-7],P=17,B=0;B<6;B++)for(R=0;R<3;R++,P--)1&(P>11?J>>P-12:I>>P)?(Y[5-B+fe*(2-R+fe-11)]=1,Y[2-R+fe-11+fe*(5-B)]=1):(this._setMask(5-B,2-R+fe-11),this._setMask(2-R+fe-11,5-B))},_isMasked:function(I,P){var B=F._getMaskBit(I,P);return this._mask[B]===1},_pack:function(){var I,P,B,R=1,Y=1,J=this.width,fe=J-1,ce=J-1,me=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(P=0;PP&&(B=I,I=P,P=B),B=P,B+=P*P,B>>=1,B+=I,B},_modN:function(I){for(;I>=255;)I-=255,I=(I>>8)+(I&255);return I},N1:3,N2:3,N3:40,N4:10}),H=F,y=h.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var I=this.element;I.width=I.height=this.qrious.size}}),S=y,j=d.extend(function(I,P,B,R){this.name=I,this.modifiable=!!P,this.defaultValue=B,this._valueTransformer=R},{transform:function(I){var P=this._valueTransformer;return typeof P=="function"?P(I,this):I}}),$=j,G=d.extend(null,{abs:function(I){return I!=null?Math.abs(I):null},hasOwn:function(I,P){return Object.prototype.hasOwnProperty.call(I,P)},noop:function(){},toUpperCase:function(I){return I!=null?I.toUpperCase():null}}),W=G,X=d.extend(function(I){this.options={},I.forEach(function(P){this.options[P.name]=P},this)},{exists:function(I){return this.options[I]!=null},get:function(I,P){return X._get(this.options[I],P)},getAll:function(I){var P,B=this.options,R={};for(P in B)W.hasOwn(B,P)&&(R[P]=X._get(B[P],I));return R},init:function(I,P,B){typeof B!="function"&&(B=W.noop);var R,Y;for(R in this.options)W.hasOwn(this.options,R)&&(Y=this.options[R],X._set(Y,Y.defaultValue,P),X._createAccessor(Y,P,B));this._setAll(I,P,!0)},set:function(I,P,B){return this._set(I,P,B)},setAll:function(I,P){return this._setAll(I,P)},_set:function(I,P,B,R){var Y=this.options[I];if(!Y)throw new Error("Invalid option: "+I);if(!Y.modifiable&&!R)throw new Error("Option cannot be modified: "+I);return X._set(Y,P,B)},_setAll:function(I,P,B){if(!I)return!1;var R,Y=!1;for(R in I)W.hasOwn(I,R)&&this._set(R,I[R],P,B)&&(Y=!0);return Y}},{_createAccessor:function(I,P,B){var R={get:function(){return X._get(I,P)}};I.modifiable&&(R.set=function(Y){X._set(I,Y,P)&&B(Y,I)}),Object.defineProperty(P,I.name,R)},_get:function(I,P){return P["_"+I.name]},_set:function(I,P,B){var R="_"+I.name,Y=B[R],J=I.transform(P??I.defaultValue);return B[R]=J,J!==Y}}),U=X,K=d.extend(function(){this._services={}},{getService:function(I){var P=this._services[I];if(!P)throw new Error("Service is not being managed with name: "+I);return P},setService:function(I,P){if(this._services[I])throw new Error("Service is already managed with name: "+I);P&&(this._services[I]=P)}}),se=K,x=new U([new $("background",!0,"white"),new $("backgroundAlpha",!0,1,W.abs),new $("element"),new $("foreground",!0,"black"),new $("foregroundAlpha",!0,1,W.abs),new $("level",!0,"L",W.toUpperCase),new $("mime",!0,"image/png"),new $("padding",!0,null,W.abs),new $("size",!0,100,W.abs),new $("value",!0,"")]),z=new se,ee=d.extend(function(I){x.init(I,this,this.update.bind(this));var P=x.get("element",this),B=z.getService("element"),R=P&&B.isCanvas(P)?P:B.createCanvas(),Y=P&&B.isImage(P)?P:B.createImage();this._canvasRenderer=new b(this,R,!0),this._imageRenderer=new S(this,Y,Y===P),this.update()},{get:function(){return x.getAll(this)},set:function(I){x.setAll(I,this)&&this.update()},toDataURL:function(I){return this.canvas.toDataURL(I||this.mime)},update:function(){var I=new H({level:this.level,value:this.value});this._canvasRenderer.render(I),this._imageRenderer.render(I)}},{use:function(I){z.setService(I.getName(),I)}});Object.defineProperties(ee.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var ue=ee,ae=ue,le=d.extend({getName:function(){}}),_e=le,ne=_e.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(I){},isImage:function(I){}}),te=ne,ie=te.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(I){return I instanceof HTMLCanvasElement},isImage:function(I){return I instanceof HTMLImageElement}}),be=ie;ae.use(new be);var we=ae;return we})})(Uu);var f0=Uu.exports;const u0=a0(f0);function r0(t){let e,l;return{c(){e=p("img"),Il(e.src,l=t[2])||u(e,"src",l),u(e,"alt",t[0]),u(e,"class",t[1])},m(n,i){T(n,e,i)},p(n,[i]){i&4&&!Il(e.src,l=n[2])&&u(e,"src",l),i&1&&u(e,"alt",n[0]),i&2&&u(e,"class",n[1])},i:Ve,o:Ve,d(n){n&&M(e)}}}function c0(t,e,l){let{errorCorrection:n="L"}=e,{background:i="#fff"}=e,{color:s="#000"}=e,{size:o="200"}=e,{value:r=""}=e,{padding:f=0}=e,{className:c="qrcode"}=e,_="",d;function m(){d.set({background:i,foreground:s,level:n,padding:f,size:o,value:r}),l(2,_=d.toDataURL("image/jpeg"))}function h(){return _}return Yf(()=>{l(9,d=new u0),r&&m()}),t.$$set=v=>{"errorCorrection"in v&&l(3,n=v.errorCorrection),"background"in v&&l(4,i=v.background),"color"in v&&l(5,s=v.color),"size"in v&&l(6,o=v.size),"value"in v&&l(0,r=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,c=v.className)},t.$$.update=()=>{t.$$.dirty&513&&r&&d&&m()},[r,c,_,n,i,s,o,f,h,d]}class _0 extends Mt{constructor(e){super(),St(this,e,c0,r0,Ct,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1,getImage:8})}get getImage(){return this.$$.ctx[8]}}function Ho(t,e,l){const n=t.slice();return n[126]=e[l],n}function Wo(t,e,l){const n=t.slice();return n[129]=e[l],n[130]=e,n[131]=l,n}function Go(t,e,l){const n=t.slice();return n[132]=e[l],n[133]=e,n[134]=l,n}function Vo(t,e,l){const n=t.slice();return n[135]=e[l],n[137]=l,n}function m0(t,e,l){const n=t.slice();return n[138]=e[l],n}function p0(t,e,l){const n=t.slice();return n[141]=e[l],n}function Ko(t){var et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae,Q,Ce,Kt,fl,ml,Jt,pl,dl,Cl,Sl,Ml,Rl,Fl,Ul,We;let e,l,n=(((ze=(et=t[3].conf)==null?void 0:et.general)==null?void 0:ze.title)??"General")+"",i,s,o,r,f,c,_,d,m,h=(((el=(xt=t[3].conf)==null?void 0:xt.general)==null?void 0:el.hostname)??"Hostname")+"",v,b,w,k,A,L,O=(((ll=(tl=t[3].conf)==null?void 0:tl.general)==null?void 0:ll.timezone)??"Time zone")+"",N,D,E,F,H,y,S,j,$,G,W,X=(((il=(nl=t[3].conf)==null?void 0:nl.price)==null?void 0:il.region)??"Price region")+"",U,K,se,x,z,ee,ue,ae,le,_e,ne,te,ie,be,we,I,P,B,R,Y,J,fe,ce,me,pe,ke,ve,De,Ee,Oe,Le,st,dt,lt,Ze=(((ol=(sl=t[3].conf)==null?void 0:sl.price)==null?void 0:ol.currency)??"Currency")+"",Be,ft,Nt,bt,ut,ot,rt,Rt,Ke,Ie,je,$e,de=(((Q=(Ae=t[3].conf)==null?void 0:Ae.price)==null?void 0:Q.enabled)??"Enabled")+"",qe,Ge,ge,Te,it=(((fl=(Kt=(Ce=t[3].conf)==null?void 0:Ce.general)==null?void 0:Kt.security)==null?void 0:fl.title)??"Security")+"",He,At,ht,Re,kt,ct=(((pl=(Jt=(ml=t[3].conf)==null?void 0:ml.general)==null?void 0:Jt.security)==null?void 0:pl.none)??"None")+"",vt,xe,Ot=(((Sl=(Cl=(dl=t[3].conf)==null?void 0:dl.general)==null?void 0:Cl.security)==null?void 0:Sl.conf)??"Conf")+"",Gt,wt,_t=(((Fl=(Rl=(Ml=t[3].conf)==null?void 0:Ml.general)==null?void 0:Rl.security)==null?void 0:Fl.all)??"All")+"",Ht,Qt,Ut,Bt,Xt=(((We=(Ul=t[3].conf)==null?void 0:Ul.general)==null?void 0:We.context)??"Context")+"",$t,Vt,Ft,Fe,Je,Ue,Pt,Lt;H=new n0({});let Qe=!t[7].p.t&&Yo(),nt=tt(["NOK","SEK","DKK","EUR","CHF"]),Tt=[];for(let Pe=0;Pe<5;Pe+=1)Tt[Pe]=d0(p0(t,nt,Pe));rt=new hl({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[h0]},$$scope:{ctx:t}}});let at=t[7].p.e&&t[0].chip!="esp8266"&&Xo(t),he=t[7].g.s>0&&Qo(t);return{c(){var Pe,Et;e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("a"),o.textContent="ⓘ",r=g(),f=p("input"),c=g(),_=p("div"),d=p("div"),m=p("div"),v=C(h),b=p("br"),w=g(),k=p("input"),A=g(),L=p("div"),N=C(O),D=p("br"),E=g(),F=p("select"),Ne(H.$$.fragment),y=g(),S=p("input"),j=g(),$=p("div"),G=p("div"),W=p("div"),U=C(X),K=p("br"),se=g(),x=p("select"),z=p("optgroup"),Qe&&Qe.c(),ee=p("option"),ee.textContent="NO1",ue=p("option"),ue.textContent="NO2",ae=p("option"),ae.textContent="NO3",le=p("option"),le.textContent="NO4",_e=p("option"),_e.textContent="NO5",ne=p("optgroup"),te=p("option"),te.textContent="SE1",ie=p("option"),ie.textContent="SE2",be=p("option"),be.textContent="SE3",we=p("option"),we.textContent="SE4",I=p("optgroup"),P=p("option"),P.textContent="DK1",B=p("option"),B.textContent="DK2",R=p("option"),R.textContent="Austria",Y=p("option"),Y.textContent="Belgium",J=p("option"),J.textContent="Czech Republic",fe=p("option"),fe.textContent="Estonia",ce=p("option"),ce.textContent="Finland",me=p("option"),me.textContent="France",pe=p("option"),pe.textContent="Germany",ke=p("option"),ke.textContent="Great Britain",ve=p("option"),ve.textContent="Latvia",De=p("option"),De.textContent="Lithuania",Ee=p("option"),Ee.textContent="Netherland",Oe=p("option"),Oe.textContent="Poland",Le=p("option"),Le.textContent="Slovenia",st=p("option"),st.textContent="Switzerland",dt=g(),lt=p("div"),Be=C(Ze),ft=p("br"),Nt=g(),bt=p("select");for(let ul=0;ul<5;ul+=1)Tt[ul].c();ut=g(),ot=p("div"),Ne(rt.$$.fragment),Rt=g(),Ke=p("div"),Ie=p("label"),je=p("input"),$e=g(),qe=C(de),Ge=g(),at&&at.c(),ge=g(),Te=p("div"),He=C(it),At=p("br"),ht=g(),Re=p("select"),kt=p("option"),vt=C(ct),xe=p("option"),Gt=C(Ot),wt=p("option"),Ht=C(_t),Qt=g(),he&&he.c(),Ut=g(),Bt=p("div"),$t=C(Xt),Vt=p("br"),Ft=g(),Fe=p("input"),u(l,"class","text-sm"),u(o,"href",vl("General-configuration")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","g"),f.value="true",u(k,"name","gh"),u(k,"type","text"),u(k,"class","in-f w-full"),u(k,"pattern",Gn),u(F,"name","gt"),u(F,"class","in-l w-full"),t[7].g.t===void 0&&qt(()=>t[26].call(F)),u(d,"class","flex"),u(_,"class","my-1"),u(S,"type","hidden"),u(S,"name","p"),S.value="true",ee.__value="10YNO-1--------2",V(ee,ee.__value),ue.__value="10YNO-2--------T",V(ue,ue.__value),ae.__value="10YNO-3--------J",V(ae,ae.__value),le.__value="10YNO-4--------9",V(le,le.__value),_e.__value="10Y1001A1001A48H",V(_e,_e.__value),u(z,"label","Norway"),te.__value="10Y1001A1001A44P",V(te,te.__value),ie.__value="10Y1001A1001A45N",V(ie,ie.__value),be.__value="10Y1001A1001A46L",V(be,be.__value),we.__value="10Y1001A1001A47J",V(we,we.__value),u(ne,"label","Sweden"),P.__value="10YDK-1--------W",V(P,P.__value),B.__value="10YDK-2--------M",V(B,B.__value),u(I,"label","Denmark"),R.__value="10YAT-APG------L",V(R,R.__value),Y.__value="10YBE----------2",V(Y,Y.__value),J.__value="10YCZ-CEPS-----N",V(J,J.__value),fe.__value="10Y1001A1001A39I",V(fe,fe.__value),ce.__value="10YFI-1--------U",V(ce,ce.__value),me.__value="10YFR-RTE------C",V(me,me.__value),pe.__value="10Y1001A1001A83F",V(pe,pe.__value),ke.__value="10YGB----------A",V(ke,ke.__value),ve.__value="10YLV-1001A00074",V(ve,ve.__value),De.__value="10YLT-1001A0008Q",V(De,De.__value),Ee.__value="10YNL----------L",V(Ee,Ee.__value),Oe.__value="10YPL-AREA-----S",V(Oe,Oe.__value),Le.__value="10YSI-ELES-----O",V(Le,Le.__value),st.__value="10YCH-SWISSGRIDZ",V(st,st.__value),u(x,"name","pr"),u(x,"class","in-f w-full"),t[7].p.r===void 0&&qt(()=>t[27].call(x)),u(W,"class","w-full"),u(bt,"name","pc"),u(bt,"class","in-l"),t[7].p.c===void 0&&qt(()=>t[28].call(bt)),u(G,"class","flex"),u($,"class","my-1"),u(ot,"class","my-1"),u(je,"type","checkbox"),u(je,"name","pe"),je.__value="true",V(je,je.__value),u(je,"class","rounded mb-1"),u(Ke,"class","my-1"),kt.__value=0,V(kt,kt.__value),xe.__value=1,V(xe,xe.__value),wt.__value=2,V(wt,wt.__value),u(Re,"name","gs"),u(Re,"class","in-s"),t[7].g.s===void 0&&qt(()=>t[31].call(Re)),u(Te,"class","my-1"),u(Fe,"name","gc"),u(Fe,"type","text"),u(Fe,"pattern",Gn),u(Fe,"placeholder",Je=((Et=(Pe=t[3].conf)==null?void 0:Pe.general)==null?void 0:Et.context_placeholder)??"/"),u(Fe,"class","in-s"),u(Fe,"maxlength","36"),u(Bt,"class","my-1"),u(e,"class","cnt")},m(Pe,Et){T(Pe,e,Et),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,d),a(d,m),a(m,v),a(m,b),a(m,w),a(m,k),V(k,t[7].g.h),a(d,A),a(d,L),a(L,N),a(L,D),a(L,E),a(L,F),Se(H,F,null),Xe(F,t[7].g.t,!0),a(e,y),a(e,S),a(e,j),a(e,$),a($,G),a(G,W),a(W,U),a(W,K),a(W,se),a(W,x),a(x,z),Qe&&Qe.m(z,null),a(z,ee),a(z,ue),a(z,ae),a(z,le),a(z,_e),a(x,ne),a(ne,te),a(ne,ie),a(ne,be),a(ne,we),a(x,I),a(I,P),a(I,B),a(x,R),a(x,Y),a(x,J),a(x,fe),a(x,ce),a(x,me),a(x,pe),a(x,ke),a(x,ve),a(x,De),a(x,Ee),a(x,Oe),a(x,Le),a(x,st),Xe(x,t[7].p.r,!0),a(G,dt),a(G,lt),a(lt,Be),a(lt,ft),a(lt,Nt),a(lt,bt);for(let ul=0;ul<5;ul+=1)Tt[ul]&&Tt[ul].m(bt,null);Xe(bt,t[7].p.c,!0),a(e,ut),a(e,ot),Se(rt,ot,null),a(e,Rt),a(e,Ke),a(Ke,Ie),a(Ie,je),je.checked=t[7].p.e,a(Ie,$e),a(Ie,qe),a(Ke,Ge),at&&at.m(Ke,null),a(e,ge),a(e,Te),a(Te,He),a(Te,At),a(Te,ht),a(Te,Re),a(Re,kt),a(kt,vt),a(Re,xe),a(xe,Gt),a(Re,wt),a(wt,Ht),Xe(Re,t[7].g.s,!0),a(e,Qt),he&&he.m(e,null),a(e,Ut),a(e,Bt),a(Bt,$t),a(Bt,Vt),a(Bt,Ft),a(Bt,Fe),V(Fe,t[7].g.c),Ue=!0,Pt||(Lt=[re(k,"input",t[25]),re(F,"change",t[26]),re(x,"change",t[27]),re(x,"change",t[22]),re(bt,"change",t[28]),re(je,"change",t[29]),re(Re,"change",t[31]),re(Fe,"input",t[34])],Pt=!0)},p(Pe,Et){var Bl,yl,jl,zl,Hl,Wl,Gl,Vl,Kl,Yl,Xl,Ql,Zl,Jl,$l,xl,en,tn,ln,Mn,Nn,Tn,Pn,En,qn,Dn,An,On;(!Ue||Et[0]&8)&&n!==(n=(((yl=(Bl=Pe[3].conf)==null?void 0:Bl.general)==null?void 0:yl.title)??"General")+"")&&q(i,n),(!Ue||Et[0]&8)&&h!==(h=(((zl=(jl=Pe[3].conf)==null?void 0:jl.general)==null?void 0:zl.hostname)??"Hostname")+"")&&q(v,h),Et[0]&128&&k.value!==Pe[7].g.h&&V(k,Pe[7].g.h),(!Ue||Et[0]&8)&&O!==(O=(((Wl=(Hl=Pe[3].conf)==null?void 0:Hl.general)==null?void 0:Wl.timezone)??"Time zone")+"")&&q(N,O),Et[0]&128&&Xe(F,Pe[7].g.t),(!Ue||Et[0]&8)&&X!==(X=(((Vl=(Gl=Pe[3].conf)==null?void 0:Gl.price)==null?void 0:Vl.region)??"Price region")+"")&&q(U,X),Pe[7].p.t?Qe&&(Qe.d(1),Qe=null):Qe||(Qe=Yo(),Qe.c(),Qe.m(z,ee)),Et[0]&128&&Xe(x,Pe[7].p.r),(!Ue||Et[0]&8)&&Ze!==(Ze=(((Yl=(Kl=Pe[3].conf)==null?void 0:Kl.price)==null?void 0:Yl.currency)??"Currency")+"")&&q(Be,Ze),Et[0]&128&&Xe(bt,Pe[7].p.c);const ul={};Et[0]&8|Et[4]&1048576&&(ul.$$scope={dirty:Et,ctx:Pe}),rt.$set(ul),Et[0]&128&&(je.checked=Pe[7].p.e),(!Ue||Et[0]&8)&&de!==(de=(((Ql=(Xl=Pe[3].conf)==null?void 0:Xl.price)==null?void 0:Ql.enabled)??"Enabled")+"")&&q(qe,de),Pe[7].p.e&&Pe[0].chip!="esp8266"?at?at.p(Pe,Et):(at=Xo(Pe),at.c(),at.m(Ke,null)):at&&(at.d(1),at=null),(!Ue||Et[0]&8)&&it!==(it=((($l=(Jl=(Zl=Pe[3].conf)==null?void 0:Zl.general)==null?void 0:Jl.security)==null?void 0:$l.title)??"Security")+"")&&q(He,it),(!Ue||Et[0]&8)&&ct!==(ct=(((tn=(en=(xl=Pe[3].conf)==null?void 0:xl.general)==null?void 0:en.security)==null?void 0:tn.none)??"None")+"")&&q(vt,ct),(!Ue||Et[0]&8)&&Ot!==(Ot=(((Nn=(Mn=(ln=Pe[3].conf)==null?void 0:ln.general)==null?void 0:Mn.security)==null?void 0:Nn.conf)??"Conf")+"")&&q(Gt,Ot),(!Ue||Et[0]&8)&&_t!==(_t=(((En=(Pn=(Tn=Pe[3].conf)==null?void 0:Tn.general)==null?void 0:Pn.security)==null?void 0:En.all)??"All")+"")&&q(Ht,_t),Et[0]&128&&Xe(Re,Pe[7].g.s),Pe[7].g.s>0?he?he.p(Pe,Et):(he=Qo(Pe),he.c(),he.m(e,Ut)):he&&(he.d(1),he=null),(!Ue||Et[0]&8)&&Xt!==(Xt=(((Dn=(qn=Pe[3].conf)==null?void 0:qn.general)==null?void 0:Dn.context)??"Context")+"")&&q($t,Xt),(!Ue||Et[0]&8&&Je!==(Je=((On=(An=Pe[3].conf)==null?void 0:An.general)==null?void 0:On.context_placeholder)??"/"))&&u(Fe,"placeholder",Je),Et[0]&128&&Fe.value!==Pe[7].g.c&&V(Fe,Pe[7].g.c)},i(Pe){Ue||(Z(H.$$.fragment,Pe),Z(rt.$$.fragment,Pe),Ue=!0)},o(Pe){oe(H.$$.fragment,Pe),oe(rt.$$.fragment,Pe),Ue=!1},d(Pe){Pe&&M(e),Me(H),Qe&&Qe.d(),Yt(Tt,Pe),Me(rt),at&&at.d(),he&&he.d(),Pt=!1,Dt(Lt)}}}function Yo(t){let e,l,n,i,s;return{c(){e=p("option"),e.textContent="NO1 with support",l=p("option"),l.textContent="NO2 with support",n=p("option"),n.textContent="NO3 with support",i=p("option"),i.textContent="NO4 with support",s=p("option"),s.textContent="NO5 with support",e.__value="NO1S",V(e,e.__value),l.__value="NO2S",V(l,l.__value),n.__value="NO3S",V(n,n.__value),i.__value="NO4S",V(i,i.__value),s.__value="NO5S",V(s,s.__value)},m(o,r){T(o,e,r),T(o,l,r),T(o,n,r),T(o,i,r),T(o,s,r)},d(o){o&&(M(e),M(l),M(n),M(i),M(s))}}}function d0(t){let e;return{c(){e=p("option"),e.textContent=`${t[141]}`,e.__value=t[141],V(e,e.__value)},m(l,n){T(l,e,n)},p:Ve,d(l){l&&M(e)}}}function h0(t){var n,i;let e=(((i=(n=t[3].conf)==null?void 0:n.price)==null?void 0:i.conf)??"Configure")+"",l;return{c(){l=C(e)},m(s,o){T(s,l,o)},p(s,o){var r,f;o[0]&8&&e!==(e=(((f=(r=s[3].conf)==null?void 0:r.price)==null?void 0:f.conf)??"Configure")+"")&&q(l,e)},d(s){s&&M(l)}}}function Xo(t){let e,l,n,i,s;return{c(){var o,r;e=p("br"),l=p("input"),u(l,"name","pt"),u(l,"type","text"),u(l,"class","in-s"),u(l,"placeholder",n=((r=(o=t[3].conf)==null?void 0:o.price)==null?void 0:r.api_key_placeholder)??""),u(l,"pattern",Gn)},m(o,r){T(o,e,r),T(o,l,r),V(l,t[7].p.t),i||(s=re(l,"input",t[30]),i=!0)},p(o,r){var f,c;r[0]&8&&n!==(n=((c=(f=o[3].conf)==null?void 0:f.price)==null?void 0:c.api_key_placeholder)??"")&&u(l,"placeholder",n),r[0]&128&&l.value!==o[7].p.t&&V(l,o[7].p.t)},d(o){o&&(M(e),M(l)),i=!1,s()}}}function Qo(t){var w,k,A,L,O,N;let e,l=(((A=(k=(w=t[3].conf)==null?void 0:w.general)==null?void 0:k.security)==null?void 0:A.username)??"Username")+"",n,i,s,o,r,f,c=(((N=(O=(L=t[3].conf)==null?void 0:L.general)==null?void 0:O.security)==null?void 0:N.password)??"Password")+"",_,d,m,h,v,b;return{c(){e=p("div"),n=C(l),i=p("br"),s=g(),o=p("input"),r=g(),f=p("div"),_=C(c),d=p("br"),m=g(),h=p("input"),u(o,"name","gu"),u(o,"type","text"),u(o,"class","in-s"),u(o,"maxlength","36"),u(o,"pattern",Ll),u(e,"class","my-1"),u(h,"name","gp"),u(h,"type","password"),u(h,"class","in-s"),u(h,"maxlength","36"),u(h,"pattern",Ll),u(f,"class","my-1")},m(D,E){T(D,e,E),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].g.u),T(D,r,E),T(D,f,E),a(f,_),a(f,d),a(f,m),a(f,h),V(h,t[7].g.p),v||(b=[re(o,"input",t[32]),re(h,"input",t[33])],v=!0)},p(D,E){var F,H,y,S,j,$;E[0]&8&&l!==(l=(((y=(H=(F=D[3].conf)==null?void 0:F.general)==null?void 0:H.security)==null?void 0:y.username)??"Username")+"")&&q(n,l),E[0]&128&&o.value!==D[7].g.u&&V(o,D[7].g.u),E[0]&8&&c!==(c=((($=(j=(S=D[3].conf)==null?void 0:S.general)==null?void 0:j.security)==null?void 0:$.password)??"Password")+"")&&q(_,c),E[0]&128&&h.value!==D[7].g.p&&V(h,D[7].g.p)},d(D){D&&(M(e),M(r),M(f)),v=!1,Dt(b)}}}function Zo(t){var ge,Te,it,He,At,ht,Re,kt,ct,vt,xe,Ot,Gt,wt,_t,Ht,Qt,Ut,Bt,Xt,$t,Vt,Ft;let e,l,n=(((Te=(ge=t[3].conf)==null?void 0:ge.meter)==null?void 0:Te.title)??"Meter")+"",i,s,o,r,f,c,_,d,m,h=(((At=(He=(it=t[3].conf)==null?void 0:it.meter)==null?void 0:He.comm)==null?void 0:At.title)??"Communication")+"",v,b,w,k,A,L=(((kt=(Re=(ht=t[3].conf)==null?void 0:ht.meter)==null?void 0:Re.comm)==null?void 0:kt.passive)??"Passive")+"",O,N,D=(((xe=(vt=(ct=t[3].conf)==null?void 0:ct.meter)==null?void 0:vt.comm)==null?void 0:xe.pulse)??"Pulse")+"",E,F=(Gt=(Ot=t[0])==null?void 0:Ot.features)==null?void 0:Gt.includes("kmp"),H,y,S,j=(((wt=t[3].common)==null?void 0:wt.voltage)??"Voltage")+"",$,G,W,X,U,K,se,x,z,ee=(((Ht=(_t=t[3].conf)==null?void 0:_t.meter)==null?void 0:Ht.fuse)??"Main fuse")+"",ue,ae,le,_e,ne,te,ie,be,we,I=(((Ut=(Qt=t[3].conf)==null?void 0:Qt.meter)==null?void 0:Ut.prod)??"Production")+"",P,B,R,Y,J,fe,ce,me,pe,ke,ve,De,Ee,Oe,Le=(((Xt=(Bt=t[3].conf)==null?void 0:Bt.meter)==null?void 0:Xt.encrypted)??"Encrypted")+"",st,dt,lt,Ze,Be,ft,Nt,bt=(((Ft=(Vt=($t=t[3].conf)==null?void 0:$t.meter)==null?void 0:Vt.multipliers)==null?void 0:Ft.title)??"Multipliers")+"",ut,ot,rt,Rt,Ke=F&&Jo();function Ie(Fe,Je){return Fe[7].m.a===2?b0:v0}let je=Ie(t),$e=je(t),de=t[7].m.e.e&&$o(t),qe=t[7].m.e.e&&xo(t),Ge=t[7].m.m.e&&ea(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("a"),o.textContent="ⓘ",r=g(),f=p("input"),c=g(),_=p("input"),d=g(),m=p("div"),v=C(h),b=p("br"),w=g(),k=p("select"),A=p("option"),O=C(L),N=p("option"),E=C(D),Ke&&Ke.c(),H=g(),$e.c(),y=g(),S=p("div"),$=C(j),G=p("br"),W=g(),X=p("select"),U=p("option"),U.textContent="400V (TN)",K=p("option"),K.textContent="230V (IT/TT)",se=g(),x=p("div"),z=p("div"),ue=C(ee),ae=p("br"),le=g(),_e=p("label"),ne=p("input"),te=g(),ie=p("span"),ie.textContent="A",be=g(),we=p("div"),P=C(I),B=p("br"),R=g(),Y=p("label"),J=p("input"),fe=g(),ce=p("span"),ce.textContent="kWp",me=g(),pe=p("div"),pe.innerHTML="",ke=g(),ve=p("div"),De=p("label"),Ee=p("input"),Oe=g(),st=C(Le),dt=g(),de&&de.c(),lt=g(),qe&&qe.c(),Ze=g(),Be=p("label"),ft=p("input"),Nt=g(),ut=C(bt),ot=g(),Ge&&Ge.c(),u(l,"class","text-sm"),u(o,"href",vl("Meter-configuration")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","m"),f.value="true",u(_,"type","hidden"),u(_,"name","mo"),_.value="1",A.__value=0,V(A,A.__value),N.__value=2,V(N,N.__value),u(k,"name","ma"),u(k,"class","in-s"),t[7].m.a===void 0&&qt(()=>t[35].call(k)),u(m,"class","my-1"),U.__value=2,V(U,U.__value),K.__value=1,V(K,K.__value),u(X,"name","md"),u(X,"class","in-s"),t[7].m.d===void 0&&qt(()=>t[41].call(X)),u(S,"class","my-1"),u(ne,"name","mf"),u(ne,"type","number"),u(ne,"min","5"),u(ne,"max","65535"),u(ne,"class","in-f tr w-full"),u(ie,"class","in-post"),u(_e,"class","flex"),u(z,"class","mx-1"),u(J,"name","mr"),u(J,"type","number"),u(J,"min","0"),u(J,"max","65535"),u(J,"class","in-f tr w-full"),u(ce,"class","in-post"),u(Y,"class","flex"),u(we,"class","mx-1"),u(x,"class","my-1 flex"),u(pe,"class","my-1"),u(Ee,"type","checkbox"),u(Ee,"name","me"),Ee.__value="true",V(Ee,Ee.__value),u(Ee,"class","rounded mb-1"),u(ve,"class","my-1"),u(ft,"type","checkbox"),u(ft,"name","mm"),ft.__value="true",V(ft,ft.__value),u(ft,"class","rounded mb-1"),u(e,"class","cnt")},m(Fe,Je){T(Fe,e,Je),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(e,d),a(e,m),a(m,v),a(m,b),a(m,w),a(m,k),a(k,A),a(A,O),a(k,N),a(N,E),Ke&&Ke.m(k,null),Xe(k,t[7].m.a,!0),a(e,H),$e.m(e,null),a(e,y),a(e,S),a(S,$),a(S,G),a(S,W),a(S,X),a(X,U),a(X,K),Xe(X,t[7].m.d,!0),a(e,se),a(e,x),a(x,z),a(z,ue),a(z,ae),a(z,le),a(z,_e),a(_e,ne),V(ne,t[7].m.f),a(_e,te),a(_e,ie),a(x,be),a(x,we),a(we,P),a(we,B),a(we,R),a(we,Y),a(Y,J),V(J,t[7].m.r),a(Y,fe),a(Y,ce),a(e,me),a(e,pe),a(e,ke),a(e,ve),a(ve,De),a(De,Ee),Ee.checked=t[7].m.e.e,a(De,Oe),a(De,st),a(ve,dt),de&&de.m(ve,null),a(e,lt),qe&&qe.m(e,null),a(e,Ze),a(e,Be),a(Be,ft),ft.checked=t[7].m.m.e,a(Be,Nt),a(Be,ut),a(e,ot),Ge&&Ge.m(e,null),rt||(Rt=[re(k,"change",t[35]),re(X,"change",t[41]),re(ne,"input",t[42]),re(J,"input",t[43]),re(Ee,"change",t[44]),re(ft,"change",t[47])],rt=!0)},p(Fe,Je){var Ue,Pt,Lt,Qe,nt,Tt,at,he,et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae,Q,Ce,Kt,fl;Je[0]&8&&n!==(n=(((Pt=(Ue=Fe[3].conf)==null?void 0:Ue.meter)==null?void 0:Pt.title)??"Meter")+"")&&q(i,n),Je[0]&8&&h!==(h=(((nt=(Qe=(Lt=Fe[3].conf)==null?void 0:Lt.meter)==null?void 0:Qe.comm)==null?void 0:nt.title)??"Communication")+"")&&q(v,h),Je[0]&8&&L!==(L=(((he=(at=(Tt=Fe[3].conf)==null?void 0:Tt.meter)==null?void 0:at.comm)==null?void 0:he.passive)??"Passive")+"")&&q(O,L),Je[0]&8&&D!==(D=(((xt=(ze=(et=Fe[3].conf)==null?void 0:et.meter)==null?void 0:ze.comm)==null?void 0:xt.pulse)??"Pulse")+"")&&q(E,D),Je[0]&1&&(F=(tl=(el=Fe[0])==null?void 0:el.features)==null?void 0:tl.includes("kmp")),F?Ke||(Ke=Jo(),Ke.c(),Ke.m(k,null)):Ke&&(Ke.d(1),Ke=null),Je[0]&128&&Xe(k,Fe[7].m.a),je===(je=Ie(Fe))&&$e?$e.p(Fe,Je):($e.d(1),$e=je(Fe),$e&&($e.c(),$e.m(e,y))),Je[0]&8&&j!==(j=(((ll=Fe[3].common)==null?void 0:ll.voltage)??"Voltage")+"")&&q($,j),Je[0]&128&&Xe(X,Fe[7].m.d),Je[0]&8&&ee!==(ee=(((il=(nl=Fe[3].conf)==null?void 0:nl.meter)==null?void 0:il.fuse)??"Main fuse")+"")&&q(ue,ee),Je[0]&128&&ye(ne.value)!==Fe[7].m.f&&V(ne,Fe[7].m.f),Je[0]&8&&I!==(I=(((ol=(sl=Fe[3].conf)==null?void 0:sl.meter)==null?void 0:ol.prod)??"Production")+"")&&q(P,I),Je[0]&128&&ye(J.value)!==Fe[7].m.r&&V(J,Fe[7].m.r),Je[0]&128&&(Ee.checked=Fe[7].m.e.e),Je[0]&8&&Le!==(Le=(((Q=(Ae=Fe[3].conf)==null?void 0:Ae.meter)==null?void 0:Q.encrypted)??"Encrypted")+"")&&q(st,Le),Fe[7].m.e.e?de?de.p(Fe,Je):(de=$o(Fe),de.c(),de.m(ve,null)):de&&(de.d(1),de=null),Fe[7].m.e.e?qe?qe.p(Fe,Je):(qe=xo(Fe),qe.c(),qe.m(e,Ze)):qe&&(qe.d(1),qe=null),Je[0]&128&&(ft.checked=Fe[7].m.m.e),Je[0]&8&&bt!==(bt=(((fl=(Kt=(Ce=Fe[3].conf)==null?void 0:Ce.meter)==null?void 0:Kt.multipliers)==null?void 0:fl.title)??"Multipliers")+"")&&q(ut,bt),Fe[7].m.m.e?Ge?Ge.p(Fe,Je):(Ge=ea(Fe),Ge.c(),Ge.m(e,null)):Ge&&(Ge.d(1),Ge=null)},d(Fe){Fe&&M(e),Ke&&Ke.d(),$e.d(),de&&de.d(),qe&&qe.d(),Ge&&Ge.d(),rt=!1,Dt(Rt)}}}function Jo(t){let e;return{c(){e=p("option"),e.textContent="KMP",e.__value=9,V(e,e.__value)},m(l,n){T(l,e,n)},d(l){l&&M(e)}}}function v0(t){var ue,ae,le,_e,ne,te;let e,l,n=(((ae=(ue=t[3].conf)==null?void 0:ue.meter)==null?void 0:ae.buffer)??"Buffer size")+"",i,s,o,r=(((_e=(le=t[3].conf)==null?void 0:le.meter)==null?void 0:_e.serial)??"Serial conf.")+"",f,c,_,d,m,h=(((te=(ne=t[3].conf)==null?void 0:ne.meter)==null?void 0:te.inverted)??"inverted")+"",v,b,w,k,A,L,O,N,D,E,F,H,y,S,j,$,G,W,X,U,K,se,x,z=tt([3,12,24,48,96,192,384,576,1152]),ee=[];for(let ie=0;ie<9;ie+=1)ee[ie]=g0(m0(t,z,ie));return{c(){e=p("div"),l=p("span"),i=C(n),s=g(),o=p("span"),f=C(r),c=g(),_=p("label"),d=p("input"),m=g(),v=C(h),b=g(),w=p("div"),k=p("select"),A=p("option"),L=C("Autodetect");for(let ie=0;ie<9;ie+=1)ee[ie].c();N=g(),D=p("select"),E=p("option"),F=C("-"),y=p("option"),y.textContent="7N1",S=p("option"),S.textContent="8N1",j=p("option"),j.textContent="8N2",$=p("option"),$.textContent="7E1",G=p("option"),G.textContent="8E1",X=g(),U=p("input"),u(l,"class","float-right"),u(d,"name","mi"),d.__value="true",V(d,d.__value),u(d,"type","checkbox"),u(d,"class","rounded mb-1"),u(_,"class","mt-2 ml-3 whitespace-nowrap"),A.__value=0,V(A,A.__value),A.disabled=O=t[7].m.b!=0,u(k,"name","mb"),u(k,"class","in-f tr w-1/2"),t[7].m.b===void 0&&qt(()=>t[38].call(k)),E.__value=0,V(E,E.__value),E.disabled=H=t[7].m.b!=0,y.__value=2,V(y,y.__value),S.__value=3,V(S,S.__value),j.__value=7,V(j,j.__value),$.__value=10,V($,$.__value),G.__value=11,V(G,G.__value),u(D,"name","mp"),u(D,"class","in-m"),D.disabled=W=t[7].m.b==0,t[7].m.p===void 0&&qt(()=>t[39].call(D)),u(U,"name","ms"),u(U,"type","number"),u(U,"min",64),u(U,"max",K=t[0].chip=="esp8266"?t[7].i.h.p==3||t[7].i.h.p==113?512:256:4096),u(U,"step",64),u(U,"class","in-l tr w-1/2"),u(w,"class","flex w-full"),u(e,"class","my-1")},m(ie,be){T(ie,e,be),a(e,l),a(l,i),a(e,s),a(e,o),a(o,f),a(e,c),a(e,_),a(_,d),d.checked=t[7].m.i,a(_,m),a(_,v),a(e,b),a(e,w),a(w,k),a(k,A),a(A,L);for(let we=0;we<9;we+=1)ee[we]&&ee[we].m(k,null);Xe(k,t[7].m.b,!0),a(w,N),a(w,D),a(D,E),a(E,F),a(D,y),a(D,S),a(D,j),a(D,$),a(D,G),Xe(D,t[7].m.p,!0),a(w,X),a(w,U),V(U,t[7].m.s),se||(x=[re(d,"change",t[37]),re(k,"change",t[38]),re(D,"change",t[39]),re(U,"input",t[40])],se=!0)},p(ie,be){var we,I,P,B,R,Y;be[0]&8&&n!==(n=(((I=(we=ie[3].conf)==null?void 0:we.meter)==null?void 0:I.buffer)??"Buffer size")+"")&&q(i,n),be[0]&8&&r!==(r=(((B=(P=ie[3].conf)==null?void 0:P.meter)==null?void 0:B.serial)??"Serial conf.")+"")&&q(f,r),be[0]&128&&(d.checked=ie[7].m.i),be[0]&8&&h!==(h=(((Y=(R=ie[3].conf)==null?void 0:R.meter)==null?void 0:Y.inverted)??"inverted")+"")&&q(v,h),be[0]&128&&O!==(O=ie[7].m.b!=0)&&(A.disabled=O),be[0]&128&&Xe(k,ie[7].m.b),be[0]&128&&H!==(H=ie[7].m.b!=0)&&(E.disabled=H),be[0]&128&&W!==(W=ie[7].m.b==0)&&(D.disabled=W),be[0]&128&&Xe(D,ie[7].m.p),be[0]&129&&K!==(K=ie[0].chip=="esp8266"?ie[7].i.h.p==3||ie[7].i.h.p==113?512:256:4096)&&u(U,"max",K),be[0]&128&&ye(U.value)!==ie[7].m.s&&V(U,ie[7].m.s)},d(ie){ie&&M(e),Yt(ee,ie),se=!1,Dt(x)}}}function b0(t){var c,_;let e,l,n=(((_=(c=t[3].conf)==null?void 0:c.meter)==null?void 0:_.pulses)??"Pulses per kWh")+"",i,s,o,r,f;return{c(){e=p("div"),l=p("span"),i=C(n),s=g(),o=p("input"),u(o,"name","mb"),u(o,"class","in-s tr"),u(o,"type","number"),u(o,"min",1),u(o,"max",3600),u(e,"class","my-1")},m(d,m){T(d,e,m),a(e,l),a(l,i),a(e,s),a(e,o),V(o,t[7].m.b),r||(f=re(o,"input",t[36]),r=!0)},p(d,m){var h,v;m[0]&8&&n!==(n=(((v=(h=d[3].conf)==null?void 0:h.meter)==null?void 0:v.pulses)??"Pulses per kWh")+"")&&q(i,n),m[0]&128&&ye(o.value)!==d[7].m.b&&V(o,d[7].m.b)},d(d){d&&M(e),r=!1,f()}}}function g0(t){let e;return{c(){e=p("option"),e.textContent=`${t[138]*100}`,e.__value=t[138]*100,V(e,e.__value)},m(l,n){T(l,e,n)},p:Ve,d(l){l&&M(e)}}}function $o(t){let e,l,n,i;return{c(){e=p("br"),l=p("input"),u(l,"name","mek"),u(l,"type","text"),u(l,"class","in-s"),u(l,"pattern",Cu)},m(s,o){T(s,e,o),T(s,l,o),V(l,t[7].m.e.k),n||(i=re(l,"input",t[45]),n=!0)},p(s,o){o[0]&128&&l.value!==s[7].m.e.k&&V(l,s[7].m.e.k)},d(s){s&&(M(e),M(l)),n=!1,i()}}}function xo(t){var c,_;let e,l=(((_=(c=t[3].conf)==null?void 0:c.meter)==null?void 0:_.authkey)??"Authentication key")+"",n,i,s,o,r,f;return{c(){e=p("div"),n=C(l),i=p("br"),s=g(),o=p("input"),u(o,"name","mea"),u(o,"type","text"),u(o,"class","in-s"),u(o,"pattern",Cu),u(e,"class","my-1")},m(d,m){T(d,e,m),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].m.e.a),r||(f=re(o,"input",t[46]),r=!0)},p(d,m){var h,v;m[0]&8&&l!==(l=(((v=(h=d[3].conf)==null?void 0:h.meter)==null?void 0:v.authkey)??"Authentication key")+"")&&q(n,l),m[0]&128&&o.value!==d[7].m.e.a&&V(o,d[7].m.e.a)},d(d){d&&M(e),r=!1,f()}}}function ea(t){var W,X,U,K,se,x,z,ee,ue,ae,le,_e;let e,l,n=(((U=(X=(W=t[3].conf)==null?void 0:W.meter)==null?void 0:X.multipliers)==null?void 0:U.watt)??"Watt")+"",i,s,o,r,f,c,_=(((x=(se=(K=t[3].conf)==null?void 0:K.meter)==null?void 0:se.multipliers)==null?void 0:x.volt)??"Volt")+"",d,m,h,v,b,w,k=(((ue=(ee=(z=t[3].conf)==null?void 0:z.meter)==null?void 0:ee.multipliers)==null?void 0:ue.amp)??"Amp")+"",A,L,O,N,D,E,F=(((_e=(le=(ae=t[3].conf)==null?void 0:ae.meter)==null?void 0:le.multipliers)==null?void 0:_e.kwh)??"kWh")+"",H,y,S,j,$,G;return{c(){e=p("div"),l=p("div"),i=C(n),s=p("br"),o=g(),r=p("input"),f=g(),c=p("div"),d=C(_),m=p("br"),h=g(),v=p("input"),b=g(),w=p("div"),A=C(k),L=p("br"),O=g(),N=p("input"),D=g(),E=p("div"),H=C(F),y=p("br"),S=g(),j=p("input"),u(r,"name","mmw"),u(r,"type","number"),u(r,"min","0.00"),u(r,"max","1000"),u(r,"step","0.001"),u(r,"class","in-f tr w-full"),u(l,"class","w-1/4"),u(v,"name","mmv"),u(v,"type","number"),u(v,"min","0.00"),u(v,"max","1000"),u(v,"step","0.001"),u(v,"class","in-m tr w-full"),u(c,"class","w-1/4"),u(N,"name","mma"),u(N,"type","number"),u(N,"min","0.00"),u(N,"max","1000"),u(N,"step","0.001"),u(N,"class","in-m tr w-full"),u(w,"class","w-1/4"),u(j,"name","mmc"),u(j,"type","number"),u(j,"min","0.00"),u(j,"max","1000"),u(j,"step","0.001"),u(j,"class","in-l tr w-full"),u(E,"class","w-1/4"),u(e,"class","flex my-1")},m(ne,te){T(ne,e,te),a(e,l),a(l,i),a(l,s),a(l,o),a(l,r),V(r,t[7].m.m.w),a(e,f),a(e,c),a(c,d),a(c,m),a(c,h),a(c,v),V(v,t[7].m.m.v),a(e,b),a(e,w),a(w,A),a(w,L),a(w,O),a(w,N),V(N,t[7].m.m.a),a(e,D),a(e,E),a(E,H),a(E,y),a(E,S),a(E,j),V(j,t[7].m.m.c),$||(G=[re(r,"input",t[48]),re(v,"input",t[49]),re(N,"input",t[50]),re(j,"input",t[51])],$=!0)},p(ne,te){var ie,be,we,I,P,B,R,Y,J,fe,ce,me;te[0]&8&&n!==(n=(((we=(be=(ie=ne[3].conf)==null?void 0:ie.meter)==null?void 0:be.multipliers)==null?void 0:we.watt)??"Watt")+"")&&q(i,n),te[0]&128&&ye(r.value)!==ne[7].m.m.w&&V(r,ne[7].m.m.w),te[0]&8&&_!==(_=(((B=(P=(I=ne[3].conf)==null?void 0:I.meter)==null?void 0:P.multipliers)==null?void 0:B.volt)??"Volt")+"")&&q(d,_),te[0]&128&&ye(v.value)!==ne[7].m.m.v&&V(v,ne[7].m.m.v),te[0]&8&&k!==(k=(((J=(Y=(R=ne[3].conf)==null?void 0:R.meter)==null?void 0:Y.multipliers)==null?void 0:J.amp)??"Amp")+"")&&q(A,k),te[0]&128&&ye(N.value)!==ne[7].m.m.a&&V(N,ne[7].m.m.a),te[0]&8&&F!==(F=(((me=(ce=(fe=ne[3].conf)==null?void 0:fe.meter)==null?void 0:ce.multipliers)==null?void 0:me.kwh)??"kWh")+"")&&q(H,F),te[0]&128&&ye(j.value)!==ne[7].m.m.c&&V(j,ne[7].m.m.c)},d(ne){ne&&M(e),$=!1,Dt(G)}}}function ta(t){var H,y,S,j,$,G;let e,l,n=(((y=(H=t[3].conf)==null?void 0:H.connection)==null?void 0:y.title)??"Connection")+"",i,s,o,r,f,c,_,d,m,h=(((j=(S=t[3].conf)==null?void 0:S.connection)==null?void 0:j.wifi)??"WiFi")+"",v,b,w=(((G=($=t[3].conf)==null?void 0:$.connection)==null?void 0:G.ap)??"AP")+"",k,A,L,O,N,D=t[0].if&&t[0].if.eth&&la(t),E=(t[7].n.c==1||t[7].n.c==2)&&na(t),F=(t[7].n.c==1||t[7].n.c==2)&&oa(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("a"),o.textContent="ⓘ",r=g(),f=p("input"),c=g(),_=p("div"),d=p("select"),m=p("option"),v=C(h),b=p("option"),k=C(w),D&&D.c(),A=g(),E&&E.c(),L=g(),F&&F.c(),u(l,"class","text-sm"),u(o,"href",vl("Network-connection")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","w"),f.value="true",m.__value=1,V(m,m.__value),b.__value=2,V(b,b.__value),u(d,"name","nc"),u(d,"class","in-s"),t[7].n.c===void 0&&qt(()=>t[52].call(d)),u(_,"class","my-1"),u(e,"class","cnt")},m(W,X){T(W,e,X),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,d),a(d,m),a(m,v),a(d,b),a(b,k),D&&D.m(d,null),Xe(d,t[7].n.c,!0),a(e,A),E&&E.m(e,null),a(e,L),F&&F.m(e,null),O||(N=re(d,"change",t[52]),O=!0)},p(W,X){var U,K,se,x,z,ee;X[0]&8&&n!==(n=(((K=(U=W[3].conf)==null?void 0:U.connection)==null?void 0:K.title)??"Connection")+"")&&q(i,n),X[0]&8&&h!==(h=(((x=(se=W[3].conf)==null?void 0:se.connection)==null?void 0:x.wifi)??"WiFi")+"")&&q(v,h),X[0]&8&&w!==(w=(((ee=(z=W[3].conf)==null?void 0:z.connection)==null?void 0:ee.ap)??"AP")+"")&&q(k,w),W[0].if&&W[0].if.eth?D?D.p(W,X):(D=la(W),D.c(),D.m(d,null)):D&&(D.d(1),D=null),X[0]&128&&Xe(d,W[7].n.c),W[7].n.c==1||W[7].n.c==2?E?E.p(W,X):(E=na(W),E.c(),E.m(e,L)):E&&(E.d(1),E=null),W[7].n.c==1||W[7].n.c==2?F?F.p(W,X):(F=oa(W),F.c(),F.m(e,null)):F&&(F.d(1),F=null)},d(W){W&&M(e),D&&D.d(),E&&E.d(),F&&F.d(),O=!1,N()}}}function la(t){var i,s;let e,l=(((s=(i=t[3].conf)==null?void 0:i.connection)==null?void 0:s.eth)??"Ethernet")+"",n;return{c(){e=p("option"),n=C(l),e.__value=3,V(e,e.__value)},m(o,r){T(o,e,r),a(e,n)},p(o,r){var f,c;r[0]&8&&l!==(l=(((c=(f=o[3].conf)==null?void 0:f.connection)==null?void 0:c.eth)??"Ethernet")+"")&&q(n,l)},d(o){o&&M(e)}}}function na(t){var N,D,E,F,H;let e,l=(((D=(N=t[3].conf)==null?void 0:N.connection)==null?void 0:D.ssid)??"Nettverksnavn (SSID)")+"",n,i,s,o,r,f,c,_=(((F=(E=t[3].conf)==null?void 0:E.connection)==null?void 0:F.psk)??"Passord")+"",d,m,h,v,b,w,k=((H=t[9])==null?void 0:H.c)==-1&&ia();function A(y,S){var j,$,G;if(($=(j=y[9])==null?void 0:j.n)!=null&&$.length)return w0;if(((G=y[9])==null?void 0:G.c)!=-1)return k0}let L=A(t),O=L&&L(t);return{c(){e=p("div"),n=C(l),i=g(),s=p("br"),o=g(),k&&k.c(),r=g(),O&&O.c(),f=g(),c=p("div"),d=C(_),m=p("br"),h=g(),v=p("input"),u(e,"class","my-1"),u(v,"name","wp"),u(v,"type","password"),u(v,"class","in-s"),u(v,"pattern",Wn),u(c,"class","my-1")},m(y,S){T(y,e,S),a(e,n),a(e,i),a(e,s),a(e,o),k&&k.m(e,null),a(e,r),O&&O.m(e,null),T(y,f,S),T(y,c,S),a(c,d),a(c,m),a(c,h),a(c,v),V(v,t[7].w.p),b||(w=re(v,"input",t[55]),b=!0)},p(y,S){var j,$,G,W,X;S[0]&8&&l!==(l=((($=(j=y[3].conf)==null?void 0:j.connection)==null?void 0:$.ssid)??"Nettverksnavn (SSID)")+"")&&q(n,l),((G=y[9])==null?void 0:G.c)==-1?k||(k=ia(),k.c(),k.m(e,r)):k&&(k.d(1),k=null),L===(L=A(y))&&O?O.p(y,S):(O&&O.d(1),O=L&&L(y),O&&(O.c(),O.m(e,null))),S[0]&8&&_!==(_=(((X=(W=y[3].conf)==null?void 0:W.connection)==null?void 0:X.psk)??"Passord")+"")&&q(d,_),S[0]&128&&v.value!==y[7].w.p&&V(v,y[7].w.p)},d(y){y&&(M(e),M(f),M(c)),k&&k.d(),O&&O.d(),b=!1,w()}}}function ia(t){let e;return{c(){e=p("div"),e.textContent="Søker etter Nettverk...",u(e,"class","text-sm italic")},m(l,n){T(l,e,n)},d(l){l&&M(e)}}}function k0(t){let e;return{c(){e=p("div"),e.textContent="Ingen nettverk funnet",u(e,"class","text-sm italic")},m(l,n){T(l,e,n)},p:Ve,d(l){l&&M(e)}}}function w0(t){let e,l=tt(t[9].n),n=[];for(let i=0;it[57].call(v)),u(c,"class","w-1/2"),u(K,"name","ww"),u(K,"type","number"),u(K,"min","0"),u(K,"max","20.5"),u(K,"step","0.5"),u(K,"class","in-f tr w-full"),u(x,"class","in-post"),u(U,"class","flex"),u(j,"class","ml-2 w-1/2"),u(f,"class","my-1 flex"),u(ae,"type","checkbox"),u(ae,"name","wb"),ae.__value="true",V(ae,ae.__value),u(ae,"class","rounded mb-1"),u(ee,"class","my-3")},m(Ze,Be){T(Ze,e,Be),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].w.p),T(Ze,r,Be),T(Ze,f,Be),a(f,c),a(c,d),a(c,m),a(c,h),a(c,v),a(v,b),a(b,k),a(v,A),a(A,O),a(v,N),a(N,E),a(v,F),a(F,y),Xe(v,t[7].w.z,!0),a(f,S),a(f,j),a(j,G),a(j,W),a(j,X),a(j,U),a(U,K),V(K,t[7].w.w),a(U,se),a(U,x),T(Ze,z,Be),T(Ze,ee,Be),a(ee,ue),a(ue,ae),ae.checked=t[7].w.b,a(ue,le),a(ue,ne),te||(ie=[re(o,"input",t[56]),re(v,"change",t[57]),re(K,"input",t[58]),re(ae,"change",t[59])],te=!0)},p(Ze,Be){var ft,Nt,bt,ut,ot,rt,Rt,Ke,Ie,je,$e,de,qe,Ge,ge,Te,it,He,At,ht,Re;Be[0]&8&&l!==(l=(((Nt=(ft=Ze[3].conf)==null?void 0:ft.connection)==null?void 0:Nt.psk)??"Password")+"")&&q(n,l),Be[0]&128&&o.value!==Ze[7].w.p&&V(o,Ze[7].w.p),Be[0]&8&&_!==(_=(((ot=(ut=(bt=Ze[3].conf)==null?void 0:bt.connection)==null?void 0:ut.ps)==null?void 0:ot.title)??"Power saving")+"")&&q(d,_),Be[0]&8&&w!==(w=(((Ke=(Rt=(rt=Ze[3].conf)==null?void 0:rt.connection)==null?void 0:Rt.ps)==null?void 0:Ke.default)??"Default")+"")&&q(k,w),Be[0]&8&&L!==(L=((($e=(je=(Ie=Ze[3].conf)==null?void 0:Ie.connection)==null?void 0:je.ps)==null?void 0:$e.off)??"Off")+"")&&q(O,L),Be[0]&8&&D!==(D=(((Ge=(qe=(de=Ze[3].conf)==null?void 0:de.connection)==null?void 0:qe.ps)==null?void 0:Ge.min)??"Min")+"")&&q(E,D),Be[0]&8&&H!==(H=(((it=(Te=(ge=Ze[3].conf)==null?void 0:ge.connection)==null?void 0:Te.ps)==null?void 0:it.max)??"Max")+"")&&q(y,H),Be[0]&128&&Xe(v,Ze[7].w.z),Be[0]&8&&$!==($=(((At=(He=Ze[3].conf)==null?void 0:He.connection)==null?void 0:At.pwr)??"Power")+"")&&q(G,$),Be[0]&128&&ye(K.value)!==Ze[7].w.w&&V(K,Ze[7].w.w),Be[0]&128&&(ae.checked=Ze[7].w.b),Be[0]&8&&_e!==(_e=(((Re=(ht=Ze[3].conf)==null?void 0:ht.connection)==null?void 0:Re.tick_11b)??"802.11b")+"")&&q(ne,_e)},d(Ze){Ze&&(M(e),M(r),M(f),M(z),M(ee)),te=!1,Dt(ie)}}}function aa(t){var Le,st,dt,lt,Ze,Be,ft,Nt,bt,ut,ot,rt,Rt,Ke;let e,l,n=(((st=(Le=t[3].conf)==null?void 0:Le.network)==null?void 0:st.title)??"Network")+"",i,s,o,r,f,c=(((lt=(dt=t[3].conf)==null?void 0:dt.network)==null?void 0:lt.ip)??"IP")+"",_,d,m,h,v,b,w=(((Be=(Ze=t[3].conf)==null?void 0:Ze.network)==null?void 0:Be.dhcp)??"DHCP")+"",k,A,L=(((Nt=(ft=t[3].conf)==null?void 0:ft.network)==null?void 0:Nt.static)??"Static")+"",O,N,D,E,F,H,y,S,j,$,G,W,X,U,K,se,x,z,ee,ue,ae,le=(((ut=(bt=t[3].conf)==null?void 0:bt.network)==null?void 0:ut.tick_mdns)??"mDNS")+"",_e,ne,te,ie,be,we=(((rt=(ot=t[3].conf)==null?void 0:ot.network)==null?void 0:rt.ntp)??"NTP")+"",I,P,B,R,Y,J=(((Ke=(Rt=t[3].conf)==null?void 0:Rt.network)==null?void 0:Ke.tick_ntp_dhcp)??"from DHCP")+"",fe,ce,me,pe,ke,ve,De,Ee;S=new s0({});let Oe=t[7].n.m=="static"&&fa(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("a"),o.textContent="ⓘ",r=g(),f=p("div"),_=C(c),d=p("br"),m=g(),h=p("div"),v=p("select"),b=p("option"),k=C(w),A=p("option"),O=C(L),N=g(),D=p("input"),H=g(),y=p("select"),Ne(S.$$.fragment),G=g(),Oe&&Oe.c(),W=g(),X=p("div"),U=p("label"),K=p("input"),se=C(" IPv6"),x=g(),z=p("div"),ee=p("label"),ue=p("input"),ae=g(),_e=C(le),ne=g(),te=p("input"),ie=g(),be=p("div"),I=C(we),P=g(),B=p("label"),R=p("input"),Y=g(),fe=C(J),ce=p("br"),me=g(),pe=p("div"),ke=p("input"),u(l,"class","text-sm"),u(o,"href",vl("Network-configuration")),u(o,"target","_blank"),u(o,"class","float-right"),b.__value="dhcp",V(b,b.__value),A.__value="static",V(A,A.__value),u(v,"name","nm"),u(v,"class","in-f"),t[7].n.m===void 0&&qt(()=>t[60].call(v)),u(D,"name","ni"),u(D,"type","text"),u(D,"class","in-m w-full"),D.disabled=E=t[7].n.m=="dhcp",D.required=F=t[7].n.m=="static",u(D,"pattern",ni),u(y,"name","ns"),u(y,"class","in-l"),y.disabled=j=t[7].n.m=="dhcp",y.required=$=t[7].n.m=="static",t[7].n.s===void 0&&qt(()=>t[62].call(y)),u(h,"class","flex"),u(f,"class","my-1"),u(K,"name","nx"),K.__value="true",V(K,K.__value),u(K,"type","checkbox"),u(K,"class","rounded mb-1"),u(X,"class","my-1"),u(ue,"name","nd"),ue.__value="true",V(ue,ue.__value),u(ue,"type","checkbox"),u(ue,"class","rounded mb-1"),u(z,"class","my-1"),u(te,"type","hidden"),u(te,"name","ntp"),te.value="true",u(R,"name","ntpd"),R.__value="true",V(R,R.__value),u(R,"type","checkbox"),u(R,"class","rounded mb-1"),u(B,"class","ml-4"),u(ke,"name","ntph"),u(ke,"type","text"),u(ke,"class","in-s"),u(ke,"pattern",Ll),u(pe,"class","flex"),u(be,"class","my-1"),u(e,"class","cnt")},m(Ie,je){T(Ie,e,je),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(f,_),a(f,d),a(f,m),a(f,h),a(h,v),a(v,b),a(b,k),a(v,A),a(A,O),Xe(v,t[7].n.m,!0),a(h,N),a(h,D),V(D,t[7].n.i),a(h,H),a(h,y),Se(S,y,null),Xe(y,t[7].n.s,!0),a(e,G),Oe&&Oe.m(e,null),a(e,W),a(e,X),a(X,U),a(U,K),K.checked=t[7].n.x,a(U,se),a(e,x),a(e,z),a(z,ee),a(ee,ue),ue.checked=t[7].n.d,a(ee,ae),a(ee,_e),a(e,ne),a(e,te),a(e,ie),a(e,be),a(be,I),a(be,P),a(be,B),a(B,R),R.checked=t[7].n.h,a(B,Y),a(B,fe),a(be,ce),a(be,me),a(be,pe),a(pe,ke),V(ke,t[7].n.n1),ve=!0,De||(Ee=[re(v,"change",t[60]),re(D,"input",t[61]),re(y,"change",t[62]),re(K,"change",t[66]),re(ue,"change",t[67]),re(R,"change",t[68]),re(ke,"input",t[69])],De=!0)},p(Ie,je){var $e,de,qe,Ge,ge,Te,it,He,At,ht,Re,kt,ct,vt;(!ve||je[0]&8)&&n!==(n=(((de=($e=Ie[3].conf)==null?void 0:$e.network)==null?void 0:de.title)??"Network")+"")&&q(i,n),(!ve||je[0]&8)&&c!==(c=(((Ge=(qe=Ie[3].conf)==null?void 0:qe.network)==null?void 0:Ge.ip)??"IP")+"")&&q(_,c),(!ve||je[0]&8)&&w!==(w=(((Te=(ge=Ie[3].conf)==null?void 0:ge.network)==null?void 0:Te.dhcp)??"DHCP")+"")&&q(k,w),(!ve||je[0]&8)&&L!==(L=(((He=(it=Ie[3].conf)==null?void 0:it.network)==null?void 0:He.static)??"Static")+"")&&q(O,L),je[0]&128&&Xe(v,Ie[7].n.m),(!ve||je[0]&128&&E!==(E=Ie[7].n.m=="dhcp"))&&(D.disabled=E),(!ve||je[0]&128&&F!==(F=Ie[7].n.m=="static"))&&(D.required=F),je[0]&128&&D.value!==Ie[7].n.i&&V(D,Ie[7].n.i),(!ve||je[0]&128&&j!==(j=Ie[7].n.m=="dhcp"))&&(y.disabled=j),(!ve||je[0]&128&&$!==($=Ie[7].n.m=="static"))&&(y.required=$),je[0]&128&&Xe(y,Ie[7].n.s),Ie[7].n.m=="static"?Oe?Oe.p(Ie,je):(Oe=fa(Ie),Oe.c(),Oe.m(e,W)):Oe&&(Oe.d(1),Oe=null),je[0]&128&&(K.checked=Ie[7].n.x),je[0]&128&&(ue.checked=Ie[7].n.d),(!ve||je[0]&8)&&le!==(le=(((ht=(At=Ie[3].conf)==null?void 0:At.network)==null?void 0:ht.tick_mdns)??"mDNS")+"")&&q(_e,le),(!ve||je[0]&8)&&we!==(we=(((kt=(Re=Ie[3].conf)==null?void 0:Re.network)==null?void 0:kt.ntp)??"NTP")+"")&&q(I,we),je[0]&128&&(R.checked=Ie[7].n.h),(!ve||je[0]&8)&&J!==(J=(((vt=(ct=Ie[3].conf)==null?void 0:ct.network)==null?void 0:vt.tick_ntp_dhcp)??"from DHCP")+"")&&q(fe,J),je[0]&128&&ke.value!==Ie[7].n.n1&&V(ke,Ie[7].n.n1)},i(Ie){ve||(Z(S.$$.fragment,Ie),ve=!0)},o(Ie){oe(S.$$.fragment,Ie),ve=!1},d(Ie){Ie&&M(e),Me(S),Oe&&Oe.d(),De=!1,Dt(Ee)}}}function fa(t){var L,O,N,D;let e,l=(((O=(L=t[3].conf)==null?void 0:L.network)==null?void 0:O.gw)??"Gateway")+"",n,i,s,o,r,f,c=(((D=(N=t[3].conf)==null?void 0:N.network)==null?void 0:D.dns)??"DNS")+"",_,d,m,h,v,b,w,k,A;return{c(){e=p("div"),n=C(l),i=p("br"),s=g(),o=p("input"),r=g(),f=p("div"),_=C(c),d=p("br"),m=g(),h=p("div"),v=p("input"),b=g(),w=p("input"),u(o,"name","ng"),u(o,"type","text"),u(o,"class","in-s"),u(o,"pattern",ni),u(e,"class","my-1"),u(v,"name","nd1"),u(v,"type","text"),u(v,"class","in-f w-full"),u(v,"pattern",ni),u(w,"name","nd2"),u(w,"type","text"),u(w,"class","in-l w-full"),u(w,"pattern",ni),u(h,"class","flex"),u(f,"class","my-1")},m(E,F){T(E,e,F),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].n.g),T(E,r,F),T(E,f,F),a(f,_),a(f,d),a(f,m),a(f,h),a(h,v),V(v,t[7].n.d1),a(h,b),a(h,w),V(w,t[7].n.d2),k||(A=[re(o,"input",t[63]),re(v,"input",t[64]),re(w,"input",t[65])],k=!0)},p(E,F){var H,y,S,j;F[0]&8&&l!==(l=(((y=(H=E[3].conf)==null?void 0:H.network)==null?void 0:y.gw)??"Gateway")+"")&&q(n,l),F[0]&128&&o.value!==E[7].n.g&&V(o,E[7].n.g),F[0]&8&&c!==(c=(((j=(S=E[3].conf)==null?void 0:S.network)==null?void 0:j.dns)??"DNS")+"")&&q(_,c),F[0]&128&&v.value!==E[7].n.d1&&V(v,E[7].n.d1),F[0]&128&&w.value!==E[7].n.d2&&V(w,E[7].n.d2)},d(E){E&&(M(e),M(r),M(f)),k=!1,Dt(A)}}}function ua(t){var Tt,at,he,et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae,Q,Ce,Kt,fl,ml,Jt,pl,dl,Cl,Sl,Ml,Rl,Fl,Ul;let e,l,n=(((at=(Tt=t[3].conf)==null?void 0:Tt.mqtt)==null?void 0:at.title)??"MQTT")+"",i,s,o,r,f,c,_,d=(((et=(he=t[3].conf)==null?void 0:he.mqtt)==null?void 0:et.server)??"Server")+"",m,h,v,b,w,k,A,L,O,N,D,E,F=(((xt=(ze=t[3].conf)==null?void 0:ze.mqtt)==null?void 0:xt.user)??"Username")+"",H,y,S,j,$,G,W=(((tl=(el=t[3].conf)==null?void 0:el.mqtt)==null?void 0:tl.pass)??"Password")+"",X,U,K,se,x,z,ee,ue=(((nl=(ll=t[3].conf)==null?void 0:ll.mqtt)==null?void 0:nl.id)??"Client ID")+"",ae,le,_e,ne,te,ie,be,we=(((sl=(il=t[3].conf)==null?void 0:il.mqtt)==null?void 0:sl.payload)??"Payload")+"",I,P,B,R,Y,J,fe,ce,me,pe,ke,ve,De,Ee,Oe=(((Ae=(ol=t[3].conf)==null?void 0:ol.mqtt)==null?void 0:Ae.publish)??"Publish topic")+"",Le,st,dt,lt,Ze,Be,ft=(((Ce=(Q=t[3].conf)==null?void 0:Q.mqtt)==null?void 0:Ce.subscribe)??"Subscribe topic")+"",Nt,bt,ut,ot,rt,Rt,Ke,Ie=(((fl=(Kt=t[3].conf)==null?void 0:Kt.mqtt)==null?void 0:fl.update)??"Update method")+"",je,$e,de,qe=(((Jt=(ml=t[3].conf)==null?void 0:ml.mqtt)==null?void 0:Jt.interval)??"Interval")+"",Ge,ge,Te,it,He,At=(((dl=(pl=t[3].conf)==null?void 0:pl.mqtt)==null?void 0:dl.realtime)??"Real time")+"",ht,Re,kt=(((Sl=(Cl=t[3].conf)==null?void 0:Cl.mqtt)==null?void 0:Sl.interval)??"Interval")+"",ct,vt,xe,Ot,Gt,wt,_t=(((Rl=(Ml=t[3].conf)==null?void 0:Ml.mqtt)==null?void 0:Rl.timeout)??"Timeout")+"",Ht,Qt,Ut,Bt=(((Ul=(Fl=t[3].conf)==null?void 0:Fl.mqtt)==null?void 0:Ul.keepalive)??"Keep-alive")+"",Xt,$t,Vt,Ft,Fe,Je,Ue,Pt,Lt,Qe=t[0].chip!="esp8266"&&ra(t),nt=t[7].q.s.e&&ca(t);return{c(){var We,Pe;e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("a"),o.textContent="ⓘ",r=g(),f=p("input"),c=g(),_=p("div"),m=C(d),h=g(),Qe&&Qe.c(),v=g(),b=p("br"),w=g(),k=p("div"),A=p("input"),L=g(),O=p("input"),N=g(),nt&&nt.c(),D=g(),E=p("div"),H=C(F),y=p("br"),S=g(),j=p("input"),$=g(),G=p("div"),X=C(W),U=p("br"),K=g(),se=p("input"),x=g(),z=p("div"),ee=p("div"),ae=C(ue),le=p("br"),_e=g(),ne=p("input"),ie=g(),be=p("div"),I=C(we),P=p("br"),B=g(),R=p("select"),Y=p("option"),Y.textContent="Raw (minimal)",J=p("option"),J.textContent="Raw (full)",fe=p("option"),fe.textContent="Domoticz",ce=p("option"),ce.textContent="Home-Assistant",me=p("option"),me.textContent="JSON (classic)",pe=p("option"),pe.textContent="JSON (multi topic)",ke=p("option"),ke.textContent="JSON (flat)",ve=p("option"),ve.textContent="HEX dump",De=g(),Ee=p("div"),Le=C(Oe),st=p("br"),dt=g(),lt=p("input"),Ze=g(),Be=p("div"),Nt=C(ft),bt=p("br"),ut=g(),ot=p("input"),Rt=g(),Ke=p("div"),je=C(Ie),$e=g(),de=p("span"),Ge=C(qe),ge=g(),Te=p("div"),it=p("select"),He=p("option"),ht=C(At),Re=p("option"),ct=C(kt),vt=g(),xe=p("input"),Gt=g(),wt=p("div"),Ht=C(_t),Qt=g(),Ut=p("span"),Xt=C(Bt),$t=g(),Vt=p("div"),Ft=p("input"),Fe=g(),Je=p("input"),u(l,"class","text-sm"),u(o,"href",vl("MQTT-configuration")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","q"),f.value="true",u(A,"name","qh"),u(A,"type","text"),u(A,"class","in-f w-2/3"),u(A,"pattern",Ll),u(O,"name","qp"),u(O,"type","number"),u(O,"min","1024"),u(O,"max","65535"),u(O,"class","in-l tr w-1/3"),u(k,"class","flex"),u(_,"class","my-1"),u(j,"name","qu"),u(j,"type","text"),u(j,"class","in-s"),u(j,"pattern",Wn),u(E,"class","my-1"),u(se,"name","qa"),u(se,"type","password"),u(se,"class","in-s"),u(se,"pattern",Wn),u(G,"class","my-1"),u(ne,"name","qc"),u(ne,"type","text"),u(ne,"class","in-f w-full"),ne.required=te=t[7].q.h,u(ne,"pattern",Gn),Y.__value=1,V(Y,Y.__value),J.__value=2,V(J,J.__value),fe.__value=3,V(fe,fe.__value),ce.__value=4,V(ce,ce.__value),me.__value=0,V(me,me.__value),pe.__value=5,V(pe,pe.__value),ke.__value=6,V(ke,ke.__value),ve.__value=255,V(ve,ve.__value),u(R,"name","qm"),u(R,"class","in-l"),t[7].q.m===void 0&&qt(()=>t[76].call(R)),u(z,"class","my-1 flex"),u(lt,"name","qb"),u(lt,"type","text"),u(lt,"class","in-s"),u(lt,"pattern",Ll),u(Ee,"class","my-1"),u(ot,"name","qr"),u(ot,"type","text"),u(ot,"class","in-s"),u(ot,"pattern",Ll),u(ot,"placeholder",rt=t[7].q.b+"/command"),u(Be,"class","my-1"),u(de,"class","float-right"),He.__value=0,V(He,He.__value),Re.__value=1,V(Re,Re.__value),u(it,"name","qt"),u(it,"class","in-f w-1/2"),t[7].q.t===void 0&&qt(()=>t[79].call(it)),u(xe,"name","qd"),u(xe,"type","number"),u(xe,"min","1"),u(xe,"max","3600"),u(xe,"class","in-l tr w-1/2"),xe.disabled=Ot=((Pe=(We=t[7])==null?void 0:We.q)==null?void 0:Pe.t)!=1,u(Te,"class","flex"),u(Ke,"class","my-1"),u(Ut,"class","float-right"),u(Ft,"name","qi"),u(Ft,"type","number"),u(Ft,"min","500"),u(Ft,"max","10000"),u(Ft,"class","in-f tr w-1/2"),u(Je,"name","qk"),u(Je,"type","number"),u(Je,"min","5"),u(Je,"max","180"),u(Je,"class","in-l tr w-1/2"),u(Vt,"class","flex"),u(wt,"class","my-1"),u(e,"class","cnt")},m(We,Pe){T(We,e,Pe),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,m),a(_,h),Qe&&Qe.m(_,null),a(_,v),a(_,b),a(_,w),a(_,k),a(k,A),V(A,t[7].q.h),a(k,L),a(k,O),V(O,t[7].q.p),a(e,N),nt&&nt.m(e,null),a(e,D),a(e,E),a(E,H),a(E,y),a(E,S),a(E,j),V(j,t[7].q.u),a(e,$),a(e,G),a(G,X),a(G,U),a(G,K),a(G,se),V(se,t[7].q.a),a(e,x),a(e,z),a(z,ee),a(ee,ae),a(ee,le),a(ee,_e),a(ee,ne),V(ne,t[7].q.c),a(z,ie),a(z,be),a(be,I),a(be,P),a(be,B),a(be,R),a(R,Y),a(R,J),a(R,fe),a(R,ce),a(R,me),a(R,pe),a(R,ke),a(R,ve),Xe(R,t[7].q.m,!0),a(e,De),a(e,Ee),a(Ee,Le),a(Ee,st),a(Ee,dt),a(Ee,lt),V(lt,t[7].q.b),a(e,Ze),a(e,Be),a(Be,Nt),a(Be,bt),a(Be,ut),a(Be,ot),V(ot,t[7].q.r),a(e,Rt),a(e,Ke),a(Ke,je),a(Ke,$e),a(Ke,de),a(de,Ge),a(Ke,ge),a(Ke,Te),a(Te,it),a(it,He),a(He,ht),a(it,Re),a(Re,ct),Xe(it,t[7].q.t,!0),a(Te,vt),a(Te,xe),V(xe,t[7].q.d),a(e,Gt),a(e,wt),a(wt,Ht),a(wt,Qt),a(wt,Ut),a(Ut,Xt),a(wt,$t),a(wt,Vt),a(Vt,Ft),V(Ft,t[7].q.i),a(Vt,Fe),a(Vt,Je),V(Je,t[7].q.k),Ue=!0,Pt||(Lt=[re(A,"input",t[71]),re(O,"input",t[72]),re(j,"input",t[73]),re(se,"input",t[74]),re(ne,"input",t[75]),re(R,"change",t[76]),re(lt,"input",t[77]),re(ot,"input",t[78]),re(it,"change",t[79]),re(xe,"input",t[80]),re(Ft,"input",t[81]),re(Je,"input",t[82])],Pt=!0)},p(We,Pe){var Et,ul,Bl,yl,jl,zl,Hl,Wl,Gl,Vl,Kl,Yl,Xl,Ql,Zl,Jl,$l,xl,en,tn,ln,Mn,Nn,Tn,Pn,En,qn,Dn,An,On;(!Ue||Pe[0]&8)&&n!==(n=(((ul=(Et=We[3].conf)==null?void 0:Et.mqtt)==null?void 0:ul.title)??"MQTT")+"")&&q(i,n),(!Ue||Pe[0]&8)&&d!==(d=(((yl=(Bl=We[3].conf)==null?void 0:Bl.mqtt)==null?void 0:yl.server)??"Server")+"")&&q(m,d),We[0].chip!="esp8266"?Qe?Qe.p(We,Pe):(Qe=ra(We),Qe.c(),Qe.m(_,v)):Qe&&(Qe.d(1),Qe=null),Pe[0]&128&&A.value!==We[7].q.h&&V(A,We[7].q.h),Pe[0]&128&&ye(O.value)!==We[7].q.p&&V(O,We[7].q.p),We[7].q.s.e?nt?(nt.p(We,Pe),Pe[0]&128&&Z(nt,1)):(nt=ca(We),nt.c(),Z(nt,1),nt.m(e,D)):nt&&(mt(),oe(nt,1,1,()=>{nt=null}),pt()),(!Ue||Pe[0]&8)&&F!==(F=(((zl=(jl=We[3].conf)==null?void 0:jl.mqtt)==null?void 0:zl.user)??"Username")+"")&&q(H,F),Pe[0]&128&&j.value!==We[7].q.u&&V(j,We[7].q.u),(!Ue||Pe[0]&8)&&W!==(W=(((Wl=(Hl=We[3].conf)==null?void 0:Hl.mqtt)==null?void 0:Wl.pass)??"Password")+"")&&q(X,W),Pe[0]&128&&se.value!==We[7].q.a&&V(se,We[7].q.a),(!Ue||Pe[0]&8)&&ue!==(ue=(((Vl=(Gl=We[3].conf)==null?void 0:Gl.mqtt)==null?void 0:Vl.id)??"Client ID")+"")&&q(ae,ue),(!Ue||Pe[0]&128&&te!==(te=We[7].q.h))&&(ne.required=te),Pe[0]&128&&ne.value!==We[7].q.c&&V(ne,We[7].q.c),(!Ue||Pe[0]&8)&&we!==(we=(((Yl=(Kl=We[3].conf)==null?void 0:Kl.mqtt)==null?void 0:Yl.payload)??"Payload")+"")&&q(I,we),Pe[0]&128&&Xe(R,We[7].q.m),(!Ue||Pe[0]&8)&&Oe!==(Oe=(((Ql=(Xl=We[3].conf)==null?void 0:Xl.mqtt)==null?void 0:Ql.publish)??"Publish topic")+"")&&q(Le,Oe),Pe[0]&128&<.value!==We[7].q.b&&V(lt,We[7].q.b),(!Ue||Pe[0]&8)&&ft!==(ft=(((Jl=(Zl=We[3].conf)==null?void 0:Zl.mqtt)==null?void 0:Jl.subscribe)??"Subscribe topic")+"")&&q(Nt,ft),(!Ue||Pe[0]&128&&rt!==(rt=We[7].q.b+"/command"))&&u(ot,"placeholder",rt),Pe[0]&128&&ot.value!==We[7].q.r&&V(ot,We[7].q.r),(!Ue||Pe[0]&8)&&Ie!==(Ie=(((xl=($l=We[3].conf)==null?void 0:$l.mqtt)==null?void 0:xl.update)??"Update method")+"")&&q(je,Ie),(!Ue||Pe[0]&8)&&qe!==(qe=(((tn=(en=We[3].conf)==null?void 0:en.mqtt)==null?void 0:tn.interval)??"Interval")+"")&&q(Ge,qe),(!Ue||Pe[0]&8)&&At!==(At=(((Mn=(ln=We[3].conf)==null?void 0:ln.mqtt)==null?void 0:Mn.realtime)??"Real time")+"")&&q(ht,At),(!Ue||Pe[0]&8)&&kt!==(kt=(((Tn=(Nn=We[3].conf)==null?void 0:Nn.mqtt)==null?void 0:Tn.interval)??"Interval")+"")&&q(ct,kt),Pe[0]&128&&Xe(it,We[7].q.t),(!Ue||Pe[0]&128&&Ot!==(Ot=((En=(Pn=We[7])==null?void 0:Pn.q)==null?void 0:En.t)!=1))&&(xe.disabled=Ot),Pe[0]&128&&ye(xe.value)!==We[7].q.d&&V(xe,We[7].q.d),(!Ue||Pe[0]&8)&&_t!==(_t=(((Dn=(qn=We[3].conf)==null?void 0:qn.mqtt)==null?void 0:Dn.timeout)??"Timeout")+"")&&q(Ht,_t),(!Ue||Pe[0]&8)&&Bt!==(Bt=(((On=(An=We[3].conf)==null?void 0:An.mqtt)==null?void 0:On.keepalive)??"Keep-alive")+"")&&q(Xt,Bt),Pe[0]&128&&ye(Ft.value)!==We[7].q.i&&V(Ft,We[7].q.i),Pe[0]&128&&ye(Je.value)!==We[7].q.k&&V(Je,We[7].q.k)},i(We){Ue||(Z(nt),Ue=!0)},o(We){oe(nt),Ue=!1},d(We){We&&M(e),Qe&&Qe.d(),nt&&nt.d(),Pt=!1,Dt(Lt)}}}function ra(t){let e,l,n,i,s;return{c(){e=p("label"),l=p("input"),n=C(" SSL"),u(l,"type","checkbox"),u(l,"name","qs"),l.__value="true",V(l,l.__value),u(l,"class","rounded mb-1"),u(e,"class","float-right mr-3")},m(o,r){T(o,e,r),a(e,l),l.checked=t[7].q.s.e,a(e,n),i||(s=[re(l,"change",t[70]),re(l,"change",t[20])],i=!0)},p(o,r){r[0]&128&&(l.checked=o[7].q.s.e)},d(o){o&&M(e),i=!1,Dt(s)}}}function ca(t){let e,l,n,i,s,o,r,f,c,_,d,m,h;const v=[S0,C0],b=[];function w(E,F){return E[7].q.s.c?0:1}n=w(t),i=b[n]=v[n](t);const k=[P0,T0],A=[];function L(E,F){return E[7].q.s.r?0:1}r=L(t),f=A[r]=k[r](t);const O=[A0,D0],N=[];function D(E,F){return E[7].q.s.k?0:1}return d=D(t),m=N[d]=O[d](t),{c(){e=p("div"),l=p("span"),i.c(),s=g(),o=p("span"),f.c(),c=g(),_=p("span"),m.c(),u(l,"class","flex pr-2"),u(o,"class","flex pr-2"),u(_,"class","flex pr-2"),u(e,"class","my-1 flex")},m(E,F){T(E,e,F),a(e,l),b[n].m(l,null),a(e,s),a(e,o),A[r].m(o,null),a(e,c),a(e,_),N[d].m(_,null),h=!0},p(E,F){let H=n;n=w(E),n===H?b[n].p(E,F):(mt(),oe(b[H],1,1,()=>{b[H]=null}),pt(),i=b[n],i?i.p(E,F):(i=b[n]=v[n](E),i.c()),Z(i,1),i.m(l,null));let y=r;r=L(E),r===y?A[r].p(E,F):(mt(),oe(A[y],1,1,()=>{A[y]=null}),pt(),f=A[r],f?f.p(E,F):(f=A[r]=k[r](E),f.c()),Z(f,1),f.m(o,null));let S=d;d=D(E),d===S?N[d].p(E,F):(mt(),oe(N[S],1,1,()=>{N[S]=null}),pt(),m=N[d],m?m.p(E,F):(m=N[d]=O[d](E),m.c()),Z(m,1),m.m(_,null))},i(E){h||(Z(i),Z(f),Z(m),h=!0)},o(E){oe(i),oe(f),oe(m),h=!1},d(E){E&&M(e),b[n].d(),A[r].d(),N[d].d()}}}function C0(t){let e,l;return e=new hl({props:{to:"/mqtt-ca",$$slots:{default:[M0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i[0]&8|i[4]&1048576&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function S0(t){let e,l,n,i,s,o,r;return l=new hl({props:{to:"/mqtt-ca",$$slots:{default:[N0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=g(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){T(f,e,c),Se(l,e,null),T(f,n,c),T(f,i,c),s=!0,o||(r=[re(i,"click",t[17]),re(i,"keypress",t[17])],o=!0)},p(f,c){const _={};c[0]&8|c[4]&1048576&&(_.$$scope={dirty:c,ctx:f}),l.$set(_)},i(f){s||(Z(l.$$.fragment,f),s=!0)},o(f){oe(l.$$.fragment,f),s=!1},d(f){f&&(M(e),M(n),M(i)),Me(l),o=!1,Dt(r)}}}function M0(t){var n,i,s,o;let e,l;return e=new Vn({props:{color:"blue",text:((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_ca_upload)??"Upload CA",title:((o=(s=t[3].conf)==null?void 0:s.mqtt)==null?void 0:o.title_ca)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Se(e,r,f),l=!0},p(r,f){var _,d,m,h;const c={};f[0]&8&&(c.text=((d=(_=r[3].conf)==null?void 0:_.mqtt)==null?void 0:d.btn_ca_upload)??"Upload CA"),f[0]&8&&(c.title=((h=(m=r[3].conf)==null?void 0:m.mqtt)==null?void 0:h.title_ca)??""),e.$set(c)},i(r){l||(Z(e.$$.fragment,r),l=!0)},o(r){oe(e.$$.fragment,r),l=!1},d(r){Me(e,r)}}}function N0(t){var n,i;let e=(((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.ca_ok)??"CA OK")+"",l;return{c(){l=C(e)},m(s,o){T(s,l,o)},p(s,o){var r,f;o[0]&8&&e!==(e=(((f=(r=s[3].conf)==null?void 0:r.mqtt)==null?void 0:f.ca_ok)??"CA OK")+"")&&q(l,e)},d(s){s&&M(l)}}}function T0(t){let e,l;return e=new hl({props:{to:"/mqtt-cert",$$slots:{default:[E0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i[0]&8|i[4]&1048576&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function P0(t){let e,l,n,i,s,o,r;return l=new hl({props:{to:"/mqtt-cert",$$slots:{default:[q0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=g(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){T(f,e,c),Se(l,e,null),T(f,n,c),T(f,i,c),s=!0,o||(r=[re(i,"click",t[18]),re(i,"keypress",t[18])],o=!0)},p(f,c){const _={};c[0]&8|c[4]&1048576&&(_.$$scope={dirty:c,ctx:f}),l.$set(_)},i(f){s||(Z(l.$$.fragment,f),s=!0)},o(f){oe(l.$$.fragment,f),s=!1},d(f){f&&(M(e),M(n),M(i)),Me(l),o=!1,Dt(r)}}}function E0(t){var n,i,s,o;let e,l;return e=new Vn({props:{color:"blue",text:((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_crt_upload)??"Upload cert",title:((o=(s=t[3].conf)==null?void 0:s.mqtt)==null?void 0:o.title_crt)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Se(e,r,f),l=!0},p(r,f){var _,d,m,h;const c={};f[0]&8&&(c.text=((d=(_=r[3].conf)==null?void 0:_.mqtt)==null?void 0:d.btn_crt_upload)??"Upload cert"),f[0]&8&&(c.title=((h=(m=r[3].conf)==null?void 0:m.mqtt)==null?void 0:h.title_crt)??""),e.$set(c)},i(r){l||(Z(e.$$.fragment,r),l=!0)},o(r){oe(e.$$.fragment,r),l=!1},d(r){Me(e,r)}}}function q0(t){var n,i;let e=(((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.crt_ok)??"Cert OK")+"",l;return{c(){l=C(e)},m(s,o){T(s,l,o)},p(s,o){var r,f;o[0]&8&&e!==(e=(((f=(r=s[3].conf)==null?void 0:r.mqtt)==null?void 0:f.crt_ok)??"Cert OK")+"")&&q(l,e)},d(s){s&&M(l)}}}function D0(t){let e,l;return e=new hl({props:{to:"/mqtt-key",$$slots:{default:[O0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i[0]&8|i[4]&1048576&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function A0(t){let e,l,n,i,s,o,r;return l=new hl({props:{to:"/mqtt-key",$$slots:{default:[L0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=g(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){T(f,e,c),Se(l,e,null),T(f,n,c),T(f,i,c),s=!0,o||(r=[re(i,"click",t[19]),re(i,"keypress",t[19])],o=!0)},p(f,c){const _={};c[0]&8|c[4]&1048576&&(_.$$scope={dirty:c,ctx:f}),l.$set(_)},i(f){s||(Z(l.$$.fragment,f),s=!0)},o(f){oe(l.$$.fragment,f),s=!1},d(f){f&&(M(e),M(n),M(i)),Me(l),o=!1,Dt(r)}}}function O0(t){var n,i,s,o;let e,l;return e=new Vn({props:{color:"blue",text:((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_key_upload)??"Upload key",title:((o=(s=t[3].conf)==null?void 0:s.mqtt)==null?void 0:o.title_key)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Se(e,r,f),l=!0},p(r,f){var _,d,m,h;const c={};f[0]&8&&(c.text=((d=(_=r[3].conf)==null?void 0:_.mqtt)==null?void 0:d.btn_key_upload)??"Upload key"),f[0]&8&&(c.title=((h=(m=r[3].conf)==null?void 0:m.mqtt)==null?void 0:h.title_key)??""),e.$set(c)},i(r){l||(Z(e.$$.fragment,r),l=!0)},o(r){oe(e.$$.fragment,r),l=!1},d(r){Me(e,r)}}}function L0(t){var n,i;let e=(((i=(n=t[3].conf)==null?void 0:n.mqtt)==null?void 0:i.key_ok)??"Key OK")+"",l;return{c(){l=C(e)},m(s,o){T(s,l,o)},p(s,o){var r,f;o[0]&8&&e!==(e=(((f=(r=s[3].conf)==null?void 0:r.mqtt)==null?void 0:f.key_ok)??"Key OK")+"")&&q(l,e)},d(s){s&&M(l)}}}function _a(t){var z,ee,ue,ae,le,_e,ne,te,ie,be,we,I;let e,l,n=(((ue=(ee=(z=t[3].conf)==null?void 0:z.mqtt)==null?void 0:ee.domoticz)==null?void 0:ue.title)??"Domoticz")+"",i,s,o,r,f,c,_,d,m=(((_e=(le=(ae=t[3].conf)==null?void 0:ae.mqtt)==null?void 0:le.domoticz)==null?void 0:_e.eidx)??"Electricity IDX")+"",h,v,b,w,k,A,L=(((ie=(te=(ne=t[3].conf)==null?void 0:ne.mqtt)==null?void 0:te.domoticz)==null?void 0:ie.cidx)??"Current IDX")+"",O,N,D,E,F,H,y=(((I=(we=(be=t[3].conf)==null?void 0:be.mqtt)==null?void 0:we.domoticz)==null?void 0:I.vidx)??"Voltage IDX")+"",S,j,$,G,W,X,U,K,se,x;return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("a"),o.textContent="ⓘ",r=g(),f=p("input"),c=g(),_=p("div"),d=p("div"),h=C(m),v=p("br"),b=g(),w=p("input"),k=g(),A=p("div"),O=C(L),N=p("br"),D=g(),E=p("input"),F=g(),H=p("div"),S=C(y),j=C(`: L1, L2 & L3 + `),$=p("div"),G=p("input"),W=g(),X=p("input"),U=g(),K=p("input"),u(l,"class","text-sm"),u(o,"href",vl("MQTT-configuration#domoticz")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","o"),f.value="true",u(w,"name","oe"),u(w,"type","text"),u(w,"class","in-f tr w-full"),u(w,"pattern",Ln),u(d,"class","w-1/2"),u(E,"name","oc"),u(E,"type","text"),u(E,"class","in-l tr w-full"),u(E,"pattern",Ln),u(A,"class","w-1/2"),u(_,"class","my-1 flex"),u(G,"name","ou1"),u(G,"type","text"),u(G,"class","in-f tr w-1/3"),u(G,"pattern",Ln),u(X,"name","ou2"),u(X,"type","text"),u(X,"class","in-m tr w-1/3"),u(X,"pattern",Ln),u(K,"name","ou3"),u(K,"type","text"),u(K,"class","in-l tr w-1/3"),u(K,"pattern",Ln),u($,"class","flex"),u(H,"class","my-1"),u(e,"class","cnt")},m(P,B){T(P,e,B),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,d),a(d,h),a(d,v),a(d,b),a(d,w),V(w,t[7].o.e),a(_,k),a(_,A),a(A,O),a(A,N),a(A,D),a(A,E),V(E,t[7].o.c),a(e,F),a(e,H),a(H,S),a(H,j),a(H,$),a($,G),V(G,t[7].o.u1),a($,W),a($,X),V(X,t[7].o.u2),a($,U),a($,K),V(K,t[7].o.u3),se||(x=[re(w,"input",t[83]),re(E,"input",t[84]),re(G,"input",t[85]),re(X,"input",t[86]),re(K,"input",t[87])],se=!0)},p(P,B){var R,Y,J,fe,ce,me,pe,ke,ve,De,Ee,Oe;B[0]&8&&n!==(n=(((J=(Y=(R=P[3].conf)==null?void 0:R.mqtt)==null?void 0:Y.domoticz)==null?void 0:J.title)??"Domoticz")+"")&&q(i,n),B[0]&8&&m!==(m=(((me=(ce=(fe=P[3].conf)==null?void 0:fe.mqtt)==null?void 0:ce.domoticz)==null?void 0:me.eidx)??"Electricity IDX")+"")&&q(h,m),B[0]&128&&w.value!==P[7].o.e&&V(w,P[7].o.e),B[0]&8&&L!==(L=(((ve=(ke=(pe=P[3].conf)==null?void 0:pe.mqtt)==null?void 0:ke.domoticz)==null?void 0:ve.cidx)??"Current IDX")+"")&&q(O,L),B[0]&128&&E.value!==P[7].o.c&&V(E,P[7].o.c),B[0]&8&&y!==(y=(((Oe=(Ee=(De=P[3].conf)==null?void 0:De.mqtt)==null?void 0:Ee.domoticz)==null?void 0:Oe.vidx)??"Voltage IDX")+"")&&q(S,y),B[0]&128&&G.value!==P[7].o.u1&&V(G,P[7].o.u1),B[0]&128&&X.value!==P[7].o.u2&&V(X,P[7].o.u2),B[0]&128&&K.value!==P[7].o.u3&&V(K,P[7].o.u3)},d(P){P&&M(e),se=!1,Dt(x)}}}function ma(t){var U,K,se,x,z,ee,ue,ae,le,_e,ne,te;let e,l,n=(((se=(K=(U=t[3].conf)==null?void 0:U.mqtt)==null?void 0:K.ha)==null?void 0:se.title)??"Home-Assistant")+"",i,s,o,r,f,c,_,d=(((ee=(z=(x=t[3].conf)==null?void 0:x.mqtt)==null?void 0:z.ha)==null?void 0:ee.discovery)??"Discovery topic prefix")+"",m,h,v,b,w,k,A=(((le=(ae=(ue=t[3].conf)==null?void 0:ue.mqtt)==null?void 0:ae.ha)==null?void 0:le.hostname)??"Hostname for URL")+"",L,O,N,D,E,F,H,y=(((te=(ne=(_e=t[3].conf)==null?void 0:_e.mqtt)==null?void 0:ne.ha)==null?void 0:te.tag)??"Name tag")+"",S,j,$,G,W,X;return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("a"),o.textContent="ⓘ",r=g(),f=p("input"),c=g(),_=p("div"),m=C(d),h=p("br"),v=g(),b=p("input"),w=g(),k=p("div"),L=C(A),O=p("br"),N=g(),D=p("input"),F=g(),H=p("div"),S=C(y),j=p("br"),$=g(),G=p("input"),u(l,"class","text-sm"),u(o,"href",vl("MQTT-configuration#home-assistant")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","h"),f.value="true",u(b,"name","ht"),u(b,"type","text"),u(b,"class","in-s"),u(b,"placeholder","homeassistant"),u(b,"pattern",Ll),u(_,"class","my-1"),u(D,"name","hh"),u(D,"type","text"),u(D,"class","in-s"),u(D,"placeholder",E=t[7].g.h+".local"),u(D,"pattern",Ll),u(k,"class","my-1"),u(G,"name","hn"),u(G,"type","text"),u(G,"class","in-s"),u(G,"pattern",Ll),u(H,"class","my-1"),u(e,"class","cnt")},m(ie,be){T(ie,e,be),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,m),a(_,h),a(_,v),a(_,b),V(b,t[7].h.t),a(e,w),a(e,k),a(k,L),a(k,O),a(k,N),a(k,D),V(D,t[7].h.h),a(e,F),a(e,H),a(H,S),a(H,j),a(H,$),a(H,G),V(G,t[7].h.n),W||(X=[re(b,"input",t[88]),re(D,"input",t[89]),re(G,"input",t[90])],W=!0)},p(ie,be){var we,I,P,B,R,Y,J,fe,ce,me,pe,ke;be[0]&8&&n!==(n=(((P=(I=(we=ie[3].conf)==null?void 0:we.mqtt)==null?void 0:I.ha)==null?void 0:P.title)??"Home-Assistant")+"")&&q(i,n),be[0]&8&&d!==(d=(((Y=(R=(B=ie[3].conf)==null?void 0:B.mqtt)==null?void 0:R.ha)==null?void 0:Y.discovery)??"Discovery topic prefix")+"")&&q(m,d),be[0]&128&&b.value!==ie[7].h.t&&V(b,ie[7].h.t),be[0]&8&&A!==(A=(((ce=(fe=(J=ie[3].conf)==null?void 0:J.mqtt)==null?void 0:fe.ha)==null?void 0:ce.hostname)??"Hostname for URL")+"")&&q(L,A),be[0]&128&&E!==(E=ie[7].g.h+".local")&&u(D,"placeholder",E),be[0]&128&&D.value!==ie[7].h.h&&V(D,ie[7].h.h),be[0]&8&&y!==(y=(((ke=(pe=(me=ie[3].conf)==null?void 0:me.mqtt)==null?void 0:pe.ha)==null?void 0:ke.tag)??"Name tag")+"")&&q(S,y),be[0]&128&&G.value!==ie[7].h.n&&V(G,ie[7].h.n)},d(ie){ie&&M(e),W=!1,Dt(X)}}}function pa(t){var S,j,$,G,W,X,U,K,se,x;let e,l,n=(((j=(S=t[3].conf)==null?void 0:S.cloud)==null?void 0:j.title)??"Cloud connections")+"",i,s,o,r,f,c,_=(G=($=t[0])==null?void 0:$.features)==null?void 0:G.includes("cloud"),d,m,h,v,b,w=(((X=(W=t[3].conf)==null?void 0:W.cloud)==null?void 0:X.es)??"Energy Speedometer")+"",k,A,L,O=(K=(U=t[0])==null?void 0:U.features)==null?void 0:K.includes("zc"),N,D,E,F=_&&da(t),H=((x=(se=t[7])==null?void 0:se.c)==null?void 0:x.es)&&ga(t),y=O&&wa(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("a"),o.textContent="ⓘ",r=g(),f=p("input"),c=g(),F&&F.c(),d=g(),m=p("div"),h=p("label"),v=p("input"),b=g(),k=C(w),A=g(),H&&H.c(),L=g(),y&&y.c(),u(l,"class","text-sm"),u(o,"href",vl("Cloud")),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","c"),f.value="true",u(v,"type","checkbox"),u(v,"class","rounded mb-1"),u(v,"name","ces"),v.__value="true",V(v,v.__value),u(m,"class","my-1"),u(e,"class","cnt")},m(z,ee){T(z,e,ee),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),F&&F.m(e,null),a(e,d),a(e,m),a(m,h),a(h,v),v.checked=t[7].c.es,a(h,b),a(h,k),a(m,A),H&&H.m(m,null),a(e,L),y&&y.m(e,null),N=!0,D||(E=re(v,"change",t[93]),D=!0)},p(z,ee){var ue,ae,le,_e,ne,te,ie,be,we,I;(!N||ee[0]&8)&&n!==(n=(((ae=(ue=z[3].conf)==null?void 0:ue.cloud)==null?void 0:ae.title)??"Cloud connections")+"")&&q(i,n),ee[0]&1&&(_=(_e=(le=z[0])==null?void 0:le.features)==null?void 0:_e.includes("cloud")),_?F?F.p(z,ee):(F=da(z),F.c(),F.m(e,d)):F&&(F.d(1),F=null),ee[0]&128&&(v.checked=z[7].c.es),(!N||ee[0]&8)&&w!==(w=(((te=(ne=z[3].conf)==null?void 0:ne.cloud)==null?void 0:te.es)??"Energy Speedometer")+"")&&q(k,w),(be=(ie=z[7])==null?void 0:ie.c)!=null&&be.es?H?(H.p(z,ee),ee[0]&128&&Z(H,1)):(H=ga(z),H.c(),Z(H,1),H.m(m,null)):H&&(mt(),oe(H,1,1,()=>{H=null}),pt()),ee[0]&1&&(O=(I=(we=z[0])==null?void 0:we.features)==null?void 0:I.includes("zc")),O?y?y.p(z,ee):(y=wa(z),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i(z){N||(Z(H),N=!0)},o(z){oe(H),N=!1},d(z){z&&M(e),F&&F.d(),H&&H.d(),y&&y.d(),D=!1,E()}}}function da(t){var d,m;let e,l,n,i,s=(((m=(d=t[3].conf)==null?void 0:d.cloud)==null?void 0:m.ams)??"AMS reader cloud")+"",o,r,f,c,_=t[7].c.e&&ha(t);return{c(){e=p("div"),l=p("label"),n=p("input"),i=g(),o=C(s),r=g(),_&&_.c(),u(n,"type","checkbox"),u(n,"name","ce"),n.__value="true",V(n,n.__value),u(n,"class","rounded mb-1"),u(e,"class","my-1")},m(h,v){T(h,e,v),a(e,l),a(l,n),n.checked=t[7].c.e,a(l,i),a(l,o),a(e,r),_&&_.m(e,null),f||(c=re(n,"change",t[91]),f=!0)},p(h,v){var b,w;v[0]&128&&(n.checked=h[7].c.e),v[0]&8&&s!==(s=(((w=(b=h[3].conf)==null?void 0:b.cloud)==null?void 0:w.ams)??"AMS reader cloud")+"")&&q(o,s),h[7].c.e?_?_.p(h,v):(_=ha(h),_.c(),_.m(e,null)):_&&(_.d(1),_=null)},d(h){h&&M(e),_&&_.d(),f=!1,c()}}}function ha(t){let e,l,n,i,s,o,r,f,c,_,d=t[7].c.p==0&&va(),m=t[6]&&ba(t);return{c(){e=p("div"),l=p("label"),l.textContent="Protocol",n=g(),i=p("select"),d&&d.c(),s=p("option"),s.textContent="TCP",o=p("option"),o.textContent="HTTP",r=g(),m&&m.c(),f=yt(),u(l,"for","cp"),s.__value=1,V(s,s.__value),o.__value=2,V(o,o.__value),u(i,"name","cp"),u(i,"class","in-s"),t[7].c.p===void 0&&qt(()=>t[92].call(i)),u(e,"class","ml-6")},m(h,v){T(h,e,v),a(e,l),a(e,n),a(e,i),d&&d.m(i,null),a(i,s),a(i,o),Xe(i,t[7].c.p,!0),T(h,r,v),m&&m.m(h,v),T(h,f,v),c||(_=re(i,"change",t[92]),c=!0)},p(h,v){h[7].c.p==0?d||(d=va(),d.c(),d.m(i,s)):d&&(d.d(1),d=null),v[0]&128&&Xe(i,h[7].c.p),h[6]?m?m.p(h,v):(m=ba(h),m.c(),m.m(f.parentNode,f)):m&&(m.d(1),m=null)},d(h){h&&(M(e),M(r),M(f)),d&&d.d(),m&&m.d(h),c=!1,_()}}}function va(t){let e;return{c(){e=p("option"),e.textContent="UDP",e.__value=0,V(e,e.__value),u(e,"title","No longer recommended")},m(l,n){T(l,e,n)},d(l){l&&M(e)}}}function ba(t){let e,l,n;return{c(){e=p("button"),e.textContent="Connect device to my cloud account",u(e,"type","button"),u(e,"class","text-blue-500 ml-6")},m(i,s){T(i,e,s),l||(n=re(e,"click",t[23]),l=!0)},p:Ve,d(i){i&&M(e),l=!1,n()}}}function ga(t){let e,l,n=t[0].mac+"",i,s,o,r,f=(t[0].meter.id?t[0].meter.id:"missing, required")+"",c,_,d,m,h=t[0].mac&&t[0].meter.id&&ka(t);return{c(){e=p("div"),l=C("MAC: "),i=C(n),s=g(),o=p("div"),r=C("Meter ID: "),c=C(f),_=g(),h&&h.c(),d=yt(),u(e,"class","pl-5"),u(o,"class","pl-5")},m(v,b){T(v,e,b),a(e,l),a(e,i),T(v,s,b),T(v,o,b),a(o,r),a(o,c),T(v,_,b),h&&h.m(v,b),T(v,d,b),m=!0},p(v,b){(!m||b[0]&1)&&n!==(n=v[0].mac+"")&&q(i,n),(!m||b[0]&1)&&f!==(f=(v[0].meter.id?v[0].meter.id:"missing, required")+"")&&q(c,f),v[0].mac&&v[0].meter.id?h?(h.p(v,b),b[0]&1&&Z(h,1)):(h=ka(v),h.c(),Z(h,1),h.m(d.parentNode,d)):h&&(mt(),oe(h,1,1,()=>{h=null}),pt())},i(v){m||(Z(h),m=!0)},o(v){oe(h),m=!1},d(v){v&&(M(e),M(s),M(o),M(_),M(d)),h&&h.d(v)}}}function ka(t){let e,l,n;return l=new _0({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","pl-2")},m(i,s){T(i,e,s),Se(l,e,null),n=!0},p(i,s){const o={};s[0]&1&&(o.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(o)},i(i){n||(Z(l.$$.fragment,i),n=!0)},o(i){oe(l.$$.fragment,i),n=!1},d(i){i&&M(e),Me(l)}}}function wa(t){let e,l,n,i,s,o,r,f,c=t[7].c.ze&&Ca(t);return{c(){e=p("div"),l=p("label"),n=p("input"),i=C(" ZmartCharge"),s=g(),c&&c.c(),o=yt(),u(n,"type","checkbox"),u(n,"name","cze"),n.__value="true",V(n,n.__value),u(n,"class","rounded mb-1"),u(e,"class","my-1")},m(_,d){T(_,e,d),a(e,l),a(l,n),n.checked=t[7].c.ze,a(l,i),T(_,s,d),c&&c.m(_,d),T(_,o,d),r||(f=re(n,"change",t[94]),r=!0)},p(_,d){d[0]&128&&(n.checked=_[7].c.ze),_[7].c.ze?c?c.p(_,d):(c=Ca(_),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null)},d(_){_&&(M(e),M(s),M(o)),c&&c.d(_),r=!1,f()}}}function Ca(t){let e,l,n,i;return{c(){e=p("div"),l=p("input"),u(l,"name","czt"),u(l,"type","text"),u(l,"class","in-s"),u(l,"placeholder","ZmartCharge token"),u(e,"class","my-1")},m(s,o){T(s,e,o),a(e,l),V(l,t[7].c.zt),n||(i=re(l,"input",t[95]),n=!0)},p(s,o){o[0]&128&&l.value!==s[7].c.zt&&V(l,s[7].c.zt)},d(s){s&&M(e),n=!1,i()}}}function Sa(t){var y,S,j,$,G;let e,l,n=(((S=(y=t[3].conf)==null?void 0:y.thresholds)==null?void 0:S.title)??"Thresholds")+"",i,s,o,r,f,c,_,d,m,h,v=((($=(j=t[3].conf)==null?void 0:j.thresholds)==null?void 0:$.avg)??"Average of")+"",b,w,k,A,L,O=(((G=t[3].common)==null?void 0:G.hours)??"hours")+"",N,D,E,F=tt({length:9}),H=[];for(let W=0;Wt[99].call(w)),u(m,"class","w-1/2"),u(_,"class","flex flex-wrap"),u(e,"class","cnt")},m(S,j){T(S,e,j),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_);for(let $=0;$20&&qa(t),m=((A=(k=(w=t[7])==null?void 0:w.i)==null?void 0:k.d)==null?void 0:A.d)>0&&Oa(t),h=t[0].chip=="esp8266"&&La(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("a"),o.textContent="ⓘ",r=g(),d&&d.c(),f=g(),m&&m.c(),c=g(),h&&h.c(),u(l,"class","text-sm"),u(o,"href",vl("GPIO-configuration")),u(o,"target","_blank"),u(o,"class","float-right"),u(e,"class","cnt")},m(L,O){T(L,e,O),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),d&&d.m(e,null),a(e,f),m&&m.m(e,null),a(e,c),h&&h.m(e,null),_=!0},p(L,O){var N,D,E,F,H;(!_||O[0]&8)&&n!==(n=(((D=(N=L[3].conf)==null?void 0:N.hw)==null?void 0:D.title)??"Hardware")+"")&&q(i,n),L[0].board>20?d?(d.p(L,O),O[0]&1&&Z(d,1)):(d=qa(L),d.c(),Z(d,1),d.m(e,f)):d&&(mt(),oe(d,1,1,()=>{d=null}),pt()),((H=(F=(E=L[7])==null?void 0:E.i)==null?void 0:F.d)==null?void 0:H.d)>0?m?m.p(L,O):(m=Oa(L),m.c(),m.m(e,c)):m&&(m.d(1),m=null),L[0].chip=="esp8266"?h?h.p(L,O):(h=La(L),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(L){_||(Z(d),_=!0)},o(L){oe(d),_=!1},d(L){L&&M(e),d&&d.d(),m&&m.d(),h&&h.d()}}}function qa(t){var Ot,Gt,wt,_t,Ht,Qt,Ut,Bt,Xt,$t,Vt,Ft,Fe,Je,Ue,Pt,Lt,Qe,nt,Tt,at,he,et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae;let e,l,n,i,s=(((wt=(Gt=(Ot=t[3].conf)==null?void 0:Ot.hw)==null?void 0:Gt.han)==null?void 0:wt.rx)??"HAN RX")+"",o,r,f,c,_,d,m,h=(((Qt=(Ht=(_t=t[3].conf)==null?void 0:_t.hw)==null?void 0:Ht.han)==null?void 0:Qt.tx)??"HAN TX")+"",v,b,w,k,A,L,O,N,D,E,F=(((Xt=(Bt=(Ut=t[3].conf)==null?void 0:Ut.hw)==null?void 0:Bt.han)==null?void 0:Xt.pullup)??"pullup")+"",H,y,S,j,$=(((Vt=($t=t[3].conf)==null?void 0:$t.hw)==null?void 0:Vt.ap_btn)??"AP button")+"",G,W,X,U,K,se,x=(((Je=(Fe=(Ft=t[3].conf)==null?void 0:Ft.hw)==null?void 0:Fe.led)==null?void 0:Je.title)??"LED")+"",z,ee,ue,ae,le,_e,ne,te,ie,be,we=(((Lt=(Pt=(Ue=t[3].conf)==null?void 0:Ue.hw)==null?void 0:Pt.led)==null?void 0:Lt.inverted)??"inverted")+"",I,P,B,R=(((Tt=(nt=(Qe=t[3].conf)==null?void 0:Qe.hw)==null?void 0:nt.led)==null?void 0:Tt.rgb)??"RGB")+"",Y,J,fe,ce,me=(((et=(he=(at=t[3].conf)==null?void 0:at.hw)==null?void 0:he.led)==null?void 0:et.inverted)??"inverted")+"",pe,ke,ve,De,Ee,Oe,Le,st,dt,lt,Ze,Be,ft=(((el=(xt=(ze=t[3].conf)==null?void 0:ze.hw)==null?void 0:xt.led)==null?void 0:el.disable)??"LED dis. GPIO")+"",Nt,bt,ut,ot,rt,Rt=(((ll=(tl=t[3].conf)==null?void 0:tl.hw)==null?void 0:ll.temp)??"Temperature")+"",Ke,Ie,je,$e,de,qe,Ge=(((il=(nl=t[3].conf)==null?void 0:nl.hw)==null?void 0:il.temp_analog)??"Analog temp")+"",ge,Te,it,He,At,ht,Re,kt,ct;_=new Bi({props:{chip:t[0].chip}}),A=new Bi({props:{chip:t[0].chip}});let vt=t[0].chip!="esp8266"&&Da(t),xe=((Ae=(ol=(sl=t[7])==null?void 0:sl.i)==null?void 0:ol.v)==null?void 0:Ae.p)>0&&Aa(t);return{c(){e=p("input"),l=g(),n=p("div"),i=p("div"),o=C(s),r=p("br"),f=g(),c=p("select"),Ne(_.$$.fragment),d=g(),m=p("div"),v=C(h),b=p("br"),w=g(),k=p("select"),Ne(A.$$.fragment),L=g(),O=p("div"),N=p("label"),D=p("input"),E=g(),H=C(F),y=g(),S=p("div"),j=p("div"),G=C($),W=p("br"),X=g(),U=p("input"),K=g(),se=p("div"),z=C(x),ee=p("br"),ue=g(),ae=p("div"),le=p("input"),_e=g(),ne=p("div"),te=p("label"),ie=p("input"),be=g(),I=C(we),P=g(),B=p("div"),Y=C(R),J=p("label"),fe=p("input"),ce=g(),pe=C(me),ke=p("br"),ve=g(),De=p("div"),Ee=p("input"),Oe=g(),Le=p("input"),st=g(),dt=p("input"),lt=g(),Ze=p("div"),Be=p("div"),Nt=C(ft),bt=g(),ut=p("input"),ot=g(),rt=p("div"),Ke=C(Rt),Ie=p("br"),je=g(),$e=p("input"),de=g(),qe=p("div"),ge=C(Ge),Te=p("br"),it=g(),He=p("input"),At=g(),vt&&vt.c(),ht=g(),xe&&xe.c(),u(e,"type","hidden"),u(e,"name","i"),e.value="true",u(c,"name","ihp"),u(c,"class","in-f w-full"),t[7].i.h.p===void 0&&qt(()=>t[100].call(c)),u(i,"class","w-1/3"),u(k,"name","iht"),u(k,"class","in-l w-full"),t[7].i.h.t===void 0&&qt(()=>t[101].call(k)),u(m,"class","w-1/3"),u(D,"name","ihu"),D.__value="true",V(D,D.__value),u(D,"type","checkbox"),u(D,"class","rounded mb-1"),u(N,"class","ml-2"),u(O,"class","w-1/3"),u(n,"class","flex flex-wrap"),u(U,"name","ia"),u(U,"type","number"),u(U,"min","0"),u(U,"max",t[12]),u(U,"class","in-f tr w-full"),u(j,"class","w-1/3"),u(le,"name","ilp"),u(le,"type","number"),u(le,"min","0"),u(le,"max",t[12]),u(le,"class","in-l tr w-full"),u(ae,"class","flex"),u(se,"class","w-1/3"),u(ie,"name","ili"),ie.__value="true",V(ie,ie.__value),u(ie,"type","checkbox"),u(ie,"class","rounded mb-1"),u(te,"class","ml-4"),u(ne,"class","w-1/3"),u(fe,"name","iri"),fe.__value="true",V(fe,fe.__value),u(fe,"type","checkbox"),u(fe,"class","rounded mb-1"),u(J,"class","ml-4"),u(Ee,"name","irr"),u(Ee,"type","number"),u(Ee,"min","0"),u(Ee,"max",t[12]),u(Ee,"class","in-f tr w-1/3"),u(Le,"name","irg"),u(Le,"type","number"),u(Le,"min","0"),u(Le,"max",t[12]),u(Le,"class","in-m tr w-1/3"),u(dt,"name","irb"),u(dt,"type","number"),u(dt,"min","0"),u(dt,"max",t[12]),u(dt,"class","in-l tr w-1/3"),u(De,"class","flex"),u(B,"class","w-full"),u(ut,"name","idd"),u(ut,"type","number"),u(ut,"min","0"),u(ut,"max",t[12]),u(ut,"class","in-s tr"),u(Be,"class","my-1 pr-1 w-1/3"),u(Ze,"class","w-full"),u($e,"name","itd"),u($e,"type","number"),u($e,"min","0"),u($e,"max",t[12]),u($e,"class","in-f tr w-full"),u(rt,"class","my-1 w-1/3"),u(He,"name","ita"),u(He,"type","number"),u(He,"min","0"),u(He,"max",t[12]),u(He,"class","in-l tr w-full"),u(qe,"class","my-1 pr-1 w-1/3"),u(S,"class","flex flex-wrap")},m(Q,Ce){T(Q,e,Ce),T(Q,l,Ce),T(Q,n,Ce),a(n,i),a(i,o),a(i,r),a(i,f),a(i,c),Se(_,c,null),Xe(c,t[7].i.h.p,!0),a(n,d),a(n,m),a(m,v),a(m,b),a(m,w),a(m,k),Se(A,k,null),Xe(k,t[7].i.h.t,!0),a(n,L),a(n,O),a(O,N),a(N,D),D.checked=t[7].i.h.u,a(N,E),a(N,H),T(Q,y,Ce),T(Q,S,Ce),a(S,j),a(j,G),a(j,W),a(j,X),a(j,U),V(U,t[7].i.a),a(S,K),a(S,se),a(se,z),a(se,ee),a(se,ue),a(se,ae),a(ae,le),V(le,t[7].i.l.p),a(S,_e),a(S,ne),a(ne,te),a(te,ie),ie.checked=t[7].i.l.i,a(te,be),a(te,I),a(S,P),a(S,B),a(B,Y),a(B,J),a(J,fe),fe.checked=t[7].i.r.i,a(J,ce),a(J,pe),a(B,ke),a(B,ve),a(B,De),a(De,Ee),V(Ee,t[7].i.r.r),a(De,Oe),a(De,Le),V(Le,t[7].i.r.g),a(De,st),a(De,dt),V(dt,t[7].i.r.b),a(S,lt),a(S,Ze),a(Ze,Be),a(Be,Nt),a(Be,bt),a(Be,ut),V(ut,t[7].i.d.d),a(S,ot),a(S,rt),a(rt,Ke),a(rt,Ie),a(rt,je),a(rt,$e),V($e,t[7].i.t.d),a(S,de),a(S,qe),a(qe,ge),a(qe,Te),a(qe,it),a(qe,He),V(He,t[7].i.t.a),a(S,At),vt&&vt.m(S,null),a(S,ht),xe&&xe.m(S,null),Re=!0,kt||(ct=[re(c,"change",t[100]),re(k,"change",t[101]),re(D,"change",t[102]),re(U,"input",t[103]),re(le,"input",t[104]),re(ie,"change",t[105]),re(fe,"change",t[106]),re(Ee,"input",t[107]),re(Le,"input",t[108]),re(dt,"input",t[109]),re(ut,"input",t[110]),re($e,"input",t[111]),re(He,"input",t[112])],kt=!0)},p(Q,Ce){var ml,Jt,pl,dl,Cl,Sl,Ml,Rl,Fl,Ul,We,Pe,Et,ul,Bl,yl,jl,zl,Hl,Wl,Gl,Vl,Kl,Yl,Xl,Ql,Zl,Jl,$l,xl,en,tn,ln;(!Re||Ce[0]&8)&&s!==(s=(((pl=(Jt=(ml=Q[3].conf)==null?void 0:ml.hw)==null?void 0:Jt.han)==null?void 0:pl.rx)??"HAN RX")+"")&&q(o,s);const Kt={};Ce[0]&1&&(Kt.chip=Q[0].chip),_.$set(Kt),Ce[0]&128&&Xe(c,Q[7].i.h.p),(!Re||Ce[0]&8)&&h!==(h=(((Sl=(Cl=(dl=Q[3].conf)==null?void 0:dl.hw)==null?void 0:Cl.han)==null?void 0:Sl.tx)??"HAN TX")+"")&&q(v,h);const fl={};Ce[0]&1&&(fl.chip=Q[0].chip),A.$set(fl),Ce[0]&128&&Xe(k,Q[7].i.h.t),Ce[0]&128&&(D.checked=Q[7].i.h.u),(!Re||Ce[0]&8)&&F!==(F=(((Fl=(Rl=(Ml=Q[3].conf)==null?void 0:Ml.hw)==null?void 0:Rl.han)==null?void 0:Fl.pullup)??"pullup")+"")&&q(H,F),(!Re||Ce[0]&8)&&$!==($=(((We=(Ul=Q[3].conf)==null?void 0:Ul.hw)==null?void 0:We.ap_btn)??"AP button")+"")&&q(G,$),(!Re||Ce[0]&4096)&&u(U,"max",Q[12]),Ce[0]&128&&ye(U.value)!==Q[7].i.a&&V(U,Q[7].i.a),(!Re||Ce[0]&8)&&x!==(x=(((ul=(Et=(Pe=Q[3].conf)==null?void 0:Pe.hw)==null?void 0:Et.led)==null?void 0:ul.title)??"LED")+"")&&q(z,x),(!Re||Ce[0]&4096)&&u(le,"max",Q[12]),Ce[0]&128&&ye(le.value)!==Q[7].i.l.p&&V(le,Q[7].i.l.p),Ce[0]&128&&(ie.checked=Q[7].i.l.i),(!Re||Ce[0]&8)&&we!==(we=(((jl=(yl=(Bl=Q[3].conf)==null?void 0:Bl.hw)==null?void 0:yl.led)==null?void 0:jl.inverted)??"inverted")+"")&&q(I,we),(!Re||Ce[0]&8)&&R!==(R=(((Wl=(Hl=(zl=Q[3].conf)==null?void 0:zl.hw)==null?void 0:Hl.led)==null?void 0:Wl.rgb)??"RGB")+"")&&q(Y,R),Ce[0]&128&&(fe.checked=Q[7].i.r.i),(!Re||Ce[0]&8)&&me!==(me=(((Kl=(Vl=(Gl=Q[3].conf)==null?void 0:Gl.hw)==null?void 0:Vl.led)==null?void 0:Kl.inverted)??"inverted")+"")&&q(pe,me),(!Re||Ce[0]&4096)&&u(Ee,"max",Q[12]),Ce[0]&128&&ye(Ee.value)!==Q[7].i.r.r&&V(Ee,Q[7].i.r.r),(!Re||Ce[0]&4096)&&u(Le,"max",Q[12]),Ce[0]&128&&ye(Le.value)!==Q[7].i.r.g&&V(Le,Q[7].i.r.g),(!Re||Ce[0]&4096)&&u(dt,"max",Q[12]),Ce[0]&128&&ye(dt.value)!==Q[7].i.r.b&&V(dt,Q[7].i.r.b),(!Re||Ce[0]&8)&&ft!==(ft=(((Ql=(Xl=(Yl=Q[3].conf)==null?void 0:Yl.hw)==null?void 0:Xl.led)==null?void 0:Ql.disable)??"LED dis. GPIO")+"")&&q(Nt,ft),(!Re||Ce[0]&4096)&&u(ut,"max",Q[12]),Ce[0]&128&&ye(ut.value)!==Q[7].i.d.d&&V(ut,Q[7].i.d.d),(!Re||Ce[0]&8)&&Rt!==(Rt=(((Jl=(Zl=Q[3].conf)==null?void 0:Zl.hw)==null?void 0:Jl.temp)??"Temperature")+"")&&q(Ke,Rt),(!Re||Ce[0]&4096)&&u($e,"max",Q[12]),Ce[0]&128&&ye($e.value)!==Q[7].i.t.d&&V($e,Q[7].i.t.d),(!Re||Ce[0]&8)&&Ge!==(Ge=(((xl=($l=Q[3].conf)==null?void 0:$l.hw)==null?void 0:xl.temp_analog)??"Analog temp")+"")&&q(ge,Ge),(!Re||Ce[0]&4096)&&u(He,"max",Q[12]),Ce[0]&128&&ye(He.value)!==Q[7].i.t.a&&V(He,Q[7].i.t.a),Q[0].chip!="esp8266"?vt?vt.p(Q,Ce):(vt=Da(Q),vt.c(),vt.m(S,ht)):vt&&(vt.d(1),vt=null),((ln=(tn=(en=Q[7])==null?void 0:en.i)==null?void 0:tn.v)==null?void 0:ln.p)>0?xe?xe.p(Q,Ce):(xe=Aa(Q),xe.c(),xe.m(S,null)):xe&&(xe.d(1),xe=null)},i(Q){Re||(Z(_.$$.fragment,Q),Z(A.$$.fragment,Q),Re=!0)},o(Q){oe(_.$$.fragment,Q),oe(A.$$.fragment,Q),Re=!1},d(Q){Q&&(M(e),M(l),M(n),M(y),M(S)),Me(_),Me(A),vt&&vt.d(),xe&&xe.d(),kt=!1,Dt(ct)}}}function Da(t){var c,_,d;let e,l=(((d=(_=(c=t[3].conf)==null?void 0:c.hw)==null?void 0:_.vcc)==null?void 0:d.title)??"Vcc")+"",n,i,s,o,r,f;return{c(){e=p("div"),n=C(l),i=p("br"),s=g(),o=p("input"),u(o,"name","ivp"),u(o,"type","number"),u(o,"min","0"),u(o,"max",t[12]),u(o,"class","in-s tr w-full"),u(e,"class","my-1 pl-1 w-1/3")},m(m,h){T(m,e,h),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].i.v.p),r||(f=re(o,"input",t[113]),r=!0)},p(m,h){var v,b,w;h[0]&8&&l!==(l=(((w=(b=(v=m[3].conf)==null?void 0:v.hw)==null?void 0:b.vcc)==null?void 0:w.title)??"Vcc")+"")&&q(n,l),h[0]&4096&&u(o,"max",m[12]),h[0]&128&&ye(o.value)!==m[7].i.v.p&&V(o,m[7].i.v.p)},d(m){m&&M(e),r=!1,f()}}}function Aa(t){var v,b,w;let e,l=(((w=(b=(v=t[3].conf)==null?void 0:v.hw)==null?void 0:b.vcc)==null?void 0:w.divider)??"Voltage divider")+"",n,i,s,o,r,f,c,_,d,m,h;return{c(){var k,A,L,O,N,D;e=p("div"),n=C(l),i=p("br"),s=g(),o=p("div"),r=p("input"),c=g(),_=p("input"),u(r,"name","ivdv"),u(r,"type","number"),u(r,"min","0"),u(r,"max","65535"),u(r,"class","in-f tr w-full"),u(r,"placeholder",f=((L=(A=(k=t[3].conf)==null?void 0:k.hw)==null?void 0:A.vcc)==null?void 0:L.div_vcc)??"VCC"),u(_,"name","ivdg"),u(_,"type","number"),u(_,"min","0"),u(_,"max","65535"),u(_,"class","in-l tr w-full"),u(_,"placeholder",d=((D=(N=(O=t[3].conf)==null?void 0:O.hw)==null?void 0:N.vcc)==null?void 0:D.div_gnd)??"GND"),u(o,"class","flex"),u(e,"class","my-1")},m(k,A){T(k,e,A),a(e,n),a(e,i),a(e,s),a(e,o),a(o,r),V(r,t[7].i.v.d.v),a(o,c),a(o,_),V(_,t[7].i.v.d.g),m||(h=[re(r,"input",t[114]),re(_,"input",t[115])],m=!0)},p(k,A){var L,O,N,D,E,F,H,y,S;A[0]&8&&l!==(l=(((N=(O=(L=k[3].conf)==null?void 0:L.hw)==null?void 0:O.vcc)==null?void 0:N.divider)??"Voltage divider")+"")&&q(n,l),A[0]&8&&f!==(f=((F=(E=(D=k[3].conf)==null?void 0:D.hw)==null?void 0:E.vcc)==null?void 0:F.div_vcc)??"VCC")&&u(r,"placeholder",f),A[0]&128&&ye(r.value)!==k[7].i.v.d.v&&V(r,k[7].i.v.d.v),A[0]&8&&d!==(d=((S=(y=(H=k[3].conf)==null?void 0:H.hw)==null?void 0:y.vcc)==null?void 0:S.div_gnd)??"GND")&&u(_,"placeholder",d),A[0]&128&&ye(_.value)!==k[7].i.v.d.g&&V(_,k[7].i.v.d.g)},d(k){k&&M(e),m=!1,Dt(h)}}}function Oa(t){var v,b,w,k,A,L,O,N,D,E,F,H;let e,l=(((k=(w=(b=(v=t[3].conf)==null?void 0:v.hw)==null?void 0:b.led)==null?void 0:w.behaviour)==null?void 0:k.title)??"LED behaviour")+"",n,i,s,o,r=(((N=(O=(L=(A=t[3].conf)==null?void 0:A.hw)==null?void 0:L.led)==null?void 0:O.behaviour)==null?void 0:N.enabled)??"Enabled")+"",f,c,_=(((H=(F=(E=(D=t[3].conf)==null?void 0:D.hw)==null?void 0:E.led)==null?void 0:F.behaviour)==null?void 0:H.disabled)??"Disabled")+"",d,m,h;return{c(){e=p("div"),n=C(l),i=g(),s=p("select"),o=p("option"),f=C(r),c=p("option"),d=C(_),o.__value=0,V(o,o.__value),c.__value=1,V(c,c.__value),u(s,"name","idb"),u(s,"class","in-s"),t[7].i.d.b===void 0&&qt(()=>t[116].call(s)),u(e,"class","my-1 w-full")},m(y,S){T(y,e,S),a(e,n),a(e,i),a(e,s),a(s,o),a(o,f),a(s,c),a(c,d),Xe(s,t[7].i.d.b,!0),m||(h=re(s,"change",t[116]),m=!0)},p(y,S){var j,$,G,W,X,U,K,se,x,z,ee,ue;S[0]&8&&l!==(l=(((W=(G=($=(j=y[3].conf)==null?void 0:j.hw)==null?void 0:$.led)==null?void 0:G.behaviour)==null?void 0:W.title)??"LED behaviour")+"")&&q(n,l),S[0]&8&&r!==(r=(((se=(K=(U=(X=y[3].conf)==null?void 0:X.hw)==null?void 0:U.led)==null?void 0:K.behaviour)==null?void 0:se.enabled)??"Enabled")+"")&&q(f,r),S[0]&8&&_!==(_=(((ue=(ee=(z=(x=y[3].conf)==null?void 0:x.hw)==null?void 0:z.led)==null?void 0:ee.behaviour)==null?void 0:ue.disabled)??"Disabled")+"")&&q(d,_),S[0]&128&&Xe(s,y[7].i.d.b)},d(y){y&&M(e),m=!1,h()}}}function La(t){var N,D,E,F,H,y;let e,l,n,i,s=(((E=(D=(N=t[3].conf)==null?void 0:N.hw)==null?void 0:D.vcc)==null?void 0:E.offset)??"Vcc offset")+"",o,r,f,c,_,d,m=(((y=(H=(F=t[3].conf)==null?void 0:F.hw)==null?void 0:H.vcc)==null?void 0:y.multiplier)??"Multiplier")+"",h,v,b,w,k,A,L,O=(t[0].board==2||t[0].board==100)&&Ia(t);return{c(){e=p("input"),l=g(),n=p("div"),i=p("div"),o=C(s),r=p("br"),f=g(),c=p("input"),_=g(),d=p("div"),h=C(m),v=p("br"),b=g(),w=p("input"),k=g(),O&&O.c(),u(e,"type","hidden"),u(e,"name","iv"),e.value="true",u(c,"name","ivo"),u(c,"type","number"),u(c,"min","0.0"),u(c,"max","3.5"),u(c,"step","0.01"),u(c,"class","in-f tr w-full"),u(i,"class","w-1/3"),u(w,"name","ivm"),u(w,"type","number"),u(w,"min","0.1"),u(w,"max","10"),u(w,"step","0.01"),u(w,"class","in-l tr w-full"),u(d,"class","w-1/3 pr-1"),u(n,"class","my-1 flex flex-wrap")},m(S,j){T(S,e,j),T(S,l,j),T(S,n,j),a(n,i),a(i,o),a(i,r),a(i,f),a(i,c),V(c,t[7].i.v.o),a(n,_),a(n,d),a(d,h),a(d,v),a(d,b),a(d,w),V(w,t[7].i.v.m),a(n,k),O&&O.m(n,null),A||(L=[re(c,"input",t[117]),re(w,"input",t[118])],A=!0)},p(S,j){var $,G,W,X,U,K;j[0]&8&&s!==(s=(((W=(G=($=S[3].conf)==null?void 0:$.hw)==null?void 0:G.vcc)==null?void 0:W.offset)??"Vcc offset")+"")&&q(o,s),j[0]&128&&ye(c.value)!==S[7].i.v.o&&V(c,S[7].i.v.o),j[0]&8&&m!==(m=(((K=(U=(X=S[3].conf)==null?void 0:X.hw)==null?void 0:U.vcc)==null?void 0:K.multiplier)??"Multiplier")+"")&&q(h,m),j[0]&128&&ye(w.value)!==S[7].i.v.m&&V(w,S[7].i.v.m),S[0].board==2||S[0].board==100?O?O.p(S,j):(O=Ia(S),O.c(),O.m(n,null)):O&&(O.d(1),O=null)},d(S){S&&(M(e),M(l),M(n)),O&&O.d(),A=!1,Dt(L)}}}function Ia(t){var c,_,d;let e,l=(((d=(_=(c=t[3].conf)==null?void 0:c.hw)==null?void 0:_.vcc)==null?void 0:d.boot)??"Boot limit")+"",n,i,s,o,r,f;return{c(){e=p("div"),n=C(l),i=p("br"),s=g(),o=p("input"),u(o,"name","ivb"),u(o,"type","number"),u(o,"min","2.5"),u(o,"max","3.5"),u(o,"step","0.1"),u(o,"class","in-s tr w-full"),u(e,"class","w-1/3 pl-1")},m(m,h){T(m,e,h),a(e,n),a(e,i),a(e,s),a(e,o),V(o,t[7].i.v.b),r||(f=re(o,"input",t[119]),r=!0)},p(m,h){var v,b,w;h[0]&8&&l!==(l=(((w=(b=(v=m[3].conf)==null?void 0:v.hw)==null?void 0:b.vcc)==null?void 0:w.boot)??"Boot limit")+"")&&q(n,l),h[0]&128&&ye(o.value)!==m[7].i.v.b&&V(o,m[7].i.v.b)},d(m){m&&M(e),r=!1,f()}}}function Ra(t){var O,N,D,E,F,H;let e,l,n=(((N=(O=t[3].conf)==null?void 0:O.debug)==null?void 0:N.title)??"Debugging")+"",i,s,o,r,f,c,_,d,m,h,v=(((E=(D=t[3].conf)==null?void 0:D.debug)==null?void 0:E.enable)??"Enable debugging")+"",b,w,k,A,L=((H=(F=t[7])==null?void 0:F.d)==null?void 0:H.s)&&Fa(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("a"),o.textContent="ⓘ",r=g(),f=p("input"),c=g(),_=p("div"),d=p("label"),m=p("input"),h=g(),b=C(v),w=g(),L&&L.c(),u(l,"class","text-sm"),u(o,"href","https://amsleser.no/blog/post/24-telnet-debug"),u(o,"target","_blank"),u(o,"class","float-right"),u(f,"type","hidden"),u(f,"name","d"),f.value="true",u(m,"type","checkbox"),u(m,"name","ds"),m.__value="true",V(m,m.__value),u(m,"class","rounded mb-1"),u(_,"class","mt-3"),u(e,"class","cnt")},m(y,S){T(y,e,S),a(e,l),a(l,i),a(e,s),a(e,o),a(e,r),a(e,f),a(e,c),a(e,_),a(_,d),a(d,m),m.checked=t[7].d.s,a(d,h),a(d,b),a(e,w),L&&L.m(e,null),k||(A=re(m,"change",t[120]),k=!0)},p(y,S){var j,$,G,W,X,U;S[0]&8&&n!==(n=((($=(j=y[3].conf)==null?void 0:j.debug)==null?void 0:$.title)??"Debugging")+"")&&q(i,n),S[0]&128&&(m.checked=y[7].d.s),S[0]&8&&v!==(v=(((W=(G=y[3].conf)==null?void 0:G.debug)==null?void 0:W.enable)??"Enable debugging")+"")&&q(b,v),(U=(X=y[7])==null?void 0:X.d)!=null&&U.s?L?L.p(y,S):(L=Fa(y),L.c(),L.m(e,null)):L&&(L.d(1),L=null)},d(y){y&&M(e),L&&L.d(),k=!1,A()}}}function Fa(t){var D,E,F,H;let e,l=(((E=(D=t[3].conf)==null?void 0:D.debug)==null?void 0:E.danger)??"Disable when done")+"",n,i,s,o,r,f,c=(((H=(F=t[3].conf)==null?void 0:F.debug)==null?void 0:H.telnet)??"Enable telnet")+"",_,d,m,h,v,b,w,k,A,L,O,N=t[7].d.t&&Ua(t);return{c(){e=p("div"),n=C(l),i=g(),s=p("div"),o=p("label"),r=p("input"),f=g(),_=C(c),d=g(),N&&N.c(),m=g(),h=p("div"),v=p("select"),b=p("option"),b.textContent="Verbose",w=p("option"),w.textContent="Debug",k=p("option"),k.textContent="Info",A=p("option"),A.textContent="Warning",u(e,"class","bd-red"),u(r,"type","checkbox"),u(r,"name","dt"),r.__value="true",V(r,r.__value),u(r,"class","rounded mb-1"),u(s,"class","my-1"),b.__value=1,V(b,b.__value),w.__value=2,V(w,w.__value),k.__value=3,V(k,k.__value),A.__value=4,V(A,A.__value),u(v,"name","dl"),u(v,"class","in-s"),t[7].d.l===void 0&&qt(()=>t[122].call(v)),u(h,"class","my-1")},m(y,S){T(y,e,S),a(e,n),T(y,i,S),T(y,s,S),a(s,o),a(o,r),r.checked=t[7].d.t,a(o,f),a(o,_),T(y,d,S),N&&N.m(y,S),T(y,m,S),T(y,h,S),a(h,v),a(v,b),a(v,w),a(v,k),a(v,A),Xe(v,t[7].d.l,!0),L||(O=[re(r,"change",t[121]),re(v,"change",t[122])],L=!0)},p(y,S){var j,$,G,W;S[0]&8&&l!==(l=((($=(j=y[3].conf)==null?void 0:j.debug)==null?void 0:$.danger)??"Disable when done")+"")&&q(n,l),S[0]&128&&(r.checked=y[7].d.t),S[0]&8&&c!==(c=(((W=(G=y[3].conf)==null?void 0:G.debug)==null?void 0:W.telnet)??"Enable telnet")+"")&&q(_,c),y[7].d.t?N?N.p(y,S):(N=Ua(y),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),S[0]&128&&Xe(v,y[7].d.l)},d(y){y&&(M(e),M(i),M(s),M(d),M(m),M(h)),N&&N.d(y),L=!1,Dt(O)}}}function Ua(t){var i,s;let e,l=(((s=(i=t[3].conf)==null?void 0:i.debug)==null?void 0:s.telnet_danger)??"Disable when done")+"",n;return{c(){e=p("div"),n=C(l),u(e,"class","bd-red")},m(o,r){T(o,e,r),a(e,n)},p(o,r){var f,c;r[0]&8&&l!==(l=(((c=(f=o[3].conf)==null?void 0:f.debug)==null?void 0:c.telnet_danger)??"Disable when done")+"")&&q(n,l)},d(o){o&&M(e)}}}function Ba(t){var m,h;let e,l,n=(((m=t[3].conf)==null?void 0:m.btn_reset)??"Factory reset")+"",i,s,o,r,f=(((h=t[3].btn)==null?void 0:h.reboot)??"Reboot")+"",c,_,d;return{c(){e=p("div"),l=p("button"),i=C(n),s=g(),o=p("div"),r=p("button"),c=C(f),u(l,"type","button"),u(l,"class","btn-red"),u(r,"type","button"),u(r,"class","btn-yellow"),u(o,"class","text-center")},m(v,b){T(v,e,b),a(e,l),a(l,i),T(v,s,b),T(v,o,b),a(o,r),a(r,c),_||(d=[re(l,"click",t[14]),re(r,"click",t[16])],_=!0)},p(v,b){var w,k;b[0]&8&&n!==(n=(((w=v[3].conf)==null?void 0:w.btn_reset)??"Factory reset")+"")&&q(i,n),b[0]&8&&f!==(f=(((k=v[3].btn)==null?void 0:k.reboot)??"Reboot")+"")&&q(c,f)},d(v){v&&(M(e),M(s),M(o)),_=!1,Dt(d)}}}function ya(t){var s;let e,l,n=(((s=t[3].btn)==null?void 0:s.save)??"Save")+"",i;return{c(){e=p("div"),l=p("button"),i=C(n),u(l,"type","submit"),u(l,"class","btn-pri"),u(e,"class","text-right")},m(o,r){T(o,e,r),a(e,l),a(l,i)},p(o,r){var f;r[0]&8&&n!==(n=(((f=o[3].btn)==null?void 0:f.save)??"Save")+"")&&q(i,n)},d(o){o&&M(e)}}}function I0(t){var te,ie,be,we,I,P,B,R,Y,J,fe,ce,me,pe,ke,ve,De,Ee,Oe,Le,st,dt,lt,Ze,Be,ft,Nt,bt,ut,ot,rt,Rt,Ke,Ie,je,$e,de,qe,Ge;let e,l,n,i,s,o,r,f,c,_,d=((be=(ie=(te=t[7])==null?void 0:te.p)==null?void 0:ie.r)==null?void 0:be.startsWith("NO"))||((P=(I=(we=t[7])==null?void 0:we.p)==null?void 0:I.r)==null?void 0:P.startsWith("10YNO"))||((Y=(R=(B=t[7])==null?void 0:B.p)==null?void 0:R.r)==null?void 0:Y.startsWith("10Y1001A1001A4")),m,h,v,b=((J=t[7])==null?void 0:J.d)&&((ce=(fe=t[0])==null?void 0:fe.features)==null?void 0:ce.includes("rdebug")),w,k,A,L,O,N,D,E,F,H,y,S,j,$,G=((me=t[7])==null?void 0:me.g)&&Ko(t),W=((pe=t[7])==null?void 0:pe.m)&&Zo(t),X=((ke=t[7])==null?void 0:ke.w)&&ta(t),U=((ve=t[7])==null?void 0:ve.n)&&aa(t),K=((De=t[7])==null?void 0:De.q)&&ua(t),se=((Oe=(Ee=t[7])==null?void 0:Ee.q)==null?void 0:Oe.m)==3&&_a(t),x=((st=(Le=t[7])==null?void 0:Le.q)==null?void 0:st.m)==4&&ma(t),z=((dt=t[7])==null?void 0:dt.c)&&pa(t),ee=d&&Sa(t),ue=((lt=t[7])==null?void 0:lt.u)&&Na(t),ae=((Be=(Ze=t[7])==null?void 0:Ze.i)==null?void 0:Be.h)&&(((ft=t[0])==null?void 0:ft.board)>20||((Nt=t[0])==null?void 0:Nt.chip)=="esp8266"||((ot=(ut=(bt=t[7])==null?void 0:bt.i)==null?void 0:ut.d)==null?void 0:ot.d)>0)&&Ea(t),le=b&&Ra(t),_e=((rt=t[1])==null?void 0:rt.a)&&Ba(t),ne=t[7]&&ya(t);return O=new _l({props:{active:t[4],message:((Ke=(Rt=t[3].conf)==null?void 0:Rt.mask)==null?void 0:Ke.loading)??"Loading"}}),D=new _l({props:{active:t[5],message:((je=(Ie=t[3].conf)==null?void 0:Ie.mask)==null?void 0:je.saving)??"Saving"}}),F=new _l({props:{active:t[10],message:((de=($e=t[3].conf)==null?void 0:$e.mask)==null?void 0:de.reset)??"Factory reset"}}),y=new _l({props:{active:t[11],message:((Ge=(qe=t[3].conf)==null?void 0:qe.mask)==null?void 0:Ge.reset_done)??"Done"}}),{c(){e=p("form"),l=p("div"),G&&G.c(),n=g(),W&&W.c(),i=g(),X&&X.c(),s=g(),U&&U.c(),o=g(),K&&K.c(),r=g(),se&&se.c(),f=g(),x&&x.c(),c=g(),z&&z.c(),_=g(),ee&&ee.c(),m=g(),ue&&ue.c(),h=g(),ae&&ae.c(),v=g(),le&&le.c(),w=g(),k=p("div"),_e&&_e.c(),A=g(),ne&&ne.c(),L=g(),Ne(O.$$.fragment),N=g(),Ne(D.$$.fragment),E=g(),Ne(F.$$.fragment),H=g(),Ne(y.$$.fragment),u(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),u(k,"class","grid grid-cols-3 mt-3"),u(e,"autocomplete","off")},m(ge,Te){T(ge,e,Te),a(e,l),G&&G.m(l,null),a(l,n),W&&W.m(l,null),a(l,i),X&&X.m(l,null),a(l,s),U&&U.m(l,null),a(l,o),K&&K.m(l,null),a(l,r),se&&se.m(l,null),a(l,f),x&&x.m(l,null),a(l,c),z&&z.m(l,null),a(l,_),ee&&ee.m(l,null),a(l,m),ue&&ue.m(l,null),a(l,h),ae&&ae.m(l,null),a(l,v),le&&le.m(l,null),a(e,w),a(e,k),_e&&_e.m(k,null),a(k,A),ne&&ne.m(k,null),T(ge,L,Te),Se(O,ge,Te),T(ge,N,Te),Se(D,ge,Te),T(ge,E,Te),Se(F,ge,Te),T(ge,H,Te),Se(y,ge,Te),S=!0,j||($=re(e,"submit",mn(t[15])),j=!0)},p(ge,Te){var Re,kt,ct,vt,xe,Ot,Gt,wt,_t,Ht,Qt,Ut,Bt,Xt,$t,Vt,Ft,Fe,Je,Ue,Pt,Lt,Qe,nt,Tt,at,he,et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae,Q;(Re=ge[7])!=null&&Re.g?G?(G.p(ge,Te),Te[0]&128&&Z(G,1)):(G=Ko(ge),G.c(),Z(G,1),G.m(l,n)):G&&(mt(),oe(G,1,1,()=>{G=null}),pt()),(kt=ge[7])!=null&&kt.m?W?W.p(ge,Te):(W=Zo(ge),W.c(),W.m(l,i)):W&&(W.d(1),W=null),(ct=ge[7])!=null&&ct.w?X?X.p(ge,Te):(X=ta(ge),X.c(),X.m(l,s)):X&&(X.d(1),X=null),(vt=ge[7])!=null&&vt.n?U?(U.p(ge,Te),Te[0]&128&&Z(U,1)):(U=aa(ge),U.c(),Z(U,1),U.m(l,o)):U&&(mt(),oe(U,1,1,()=>{U=null}),pt()),(xe=ge[7])!=null&&xe.q?K?(K.p(ge,Te),Te[0]&128&&Z(K,1)):(K=ua(ge),K.c(),Z(K,1),K.m(l,r)):K&&(mt(),oe(K,1,1,()=>{K=null}),pt()),((Gt=(Ot=ge[7])==null?void 0:Ot.q)==null?void 0:Gt.m)==3?se?se.p(ge,Te):(se=_a(ge),se.c(),se.m(l,f)):se&&(se.d(1),se=null),((_t=(wt=ge[7])==null?void 0:wt.q)==null?void 0:_t.m)==4?x?x.p(ge,Te):(x=ma(ge),x.c(),x.m(l,c)):x&&(x.d(1),x=null),(Ht=ge[7])!=null&&Ht.c?z?(z.p(ge,Te),Te[0]&128&&Z(z,1)):(z=pa(ge),z.c(),Z(z,1),z.m(l,_)):z&&(mt(),oe(z,1,1,()=>{z=null}),pt()),Te[0]&128&&(d=((Bt=(Ut=(Qt=ge[7])==null?void 0:Qt.p)==null?void 0:Ut.r)==null?void 0:Bt.startsWith("NO"))||((Vt=($t=(Xt=ge[7])==null?void 0:Xt.p)==null?void 0:$t.r)==null?void 0:Vt.startsWith("10YNO"))||((Je=(Fe=(Ft=ge[7])==null?void 0:Ft.p)==null?void 0:Fe.r)==null?void 0:Je.startsWith("10Y1001A1001A4"))),d?ee?ee.p(ge,Te):(ee=Sa(ge),ee.c(),ee.m(l,m)):ee&&(ee.d(1),ee=null),(Ue=ge[7])!=null&&Ue.u?ue?ue.p(ge,Te):(ue=Na(ge),ue.c(),ue.m(l,h)):ue&&(ue.d(1),ue=null),(Lt=(Pt=ge[7])==null?void 0:Pt.i)!=null&&Lt.h&&(((Qe=ge[0])==null?void 0:Qe.board)>20||((nt=ge[0])==null?void 0:nt.chip)=="esp8266"||((he=(at=(Tt=ge[7])==null?void 0:Tt.i)==null?void 0:at.d)==null?void 0:he.d)>0)?ae?(ae.p(ge,Te),Te[0]&129&&Z(ae,1)):(ae=Ea(ge),ae.c(),Z(ae,1),ae.m(l,v)):ae&&(mt(),oe(ae,1,1,()=>{ae=null}),pt()),Te[0]&129&&(b=((et=ge[7])==null?void 0:et.d)&&((xt=(ze=ge[0])==null?void 0:ze.features)==null?void 0:xt.includes("rdebug"))),b?le?le.p(ge,Te):(le=Ra(ge),le.c(),le.m(l,null)):le&&(le.d(1),le=null),(el=ge[1])!=null&&el.a?_e?_e.p(ge,Te):(_e=Ba(ge),_e.c(),_e.m(k,A)):_e&&(_e.d(1),_e=null),ge[7]?ne?ne.p(ge,Te):(ne=ya(ge),ne.c(),ne.m(k,null)):ne&&(ne.d(1),ne=null);const it={};Te[0]&16&&(it.active=ge[4]),Te[0]&8&&(it.message=((ll=(tl=ge[3].conf)==null?void 0:tl.mask)==null?void 0:ll.loading)??"Loading"),O.$set(it);const He={};Te[0]&32&&(He.active=ge[5]),Te[0]&8&&(He.message=((il=(nl=ge[3].conf)==null?void 0:nl.mask)==null?void 0:il.saving)??"Saving"),D.$set(He);const At={};Te[0]&1024&&(At.active=ge[10]),Te[0]&8&&(At.message=((ol=(sl=ge[3].conf)==null?void 0:sl.mask)==null?void 0:ol.reset)??"Factory reset"),F.$set(At);const ht={};Te[0]&2048&&(ht.active=ge[11]),Te[0]&8&&(ht.message=((Q=(Ae=ge[3].conf)==null?void 0:Ae.mask)==null?void 0:Q.reset_done)??"Done"),y.$set(ht)},i(ge){S||(Z(G),Z(U),Z(K),Z(z),Z(ae),Z(O.$$.fragment,ge),Z(D.$$.fragment,ge),Z(F.$$.fragment,ge),Z(y.$$.fragment,ge),S=!0)},o(ge){oe(G),oe(U),oe(K),oe(z),oe(ae),oe(O.$$.fragment,ge),oe(D.$$.fragment,ge),oe(F.$$.fragment,ge),oe(y.$$.fragment,ge),S=!1},d(ge){ge&&(M(e),M(L),M(N),M(E),M(H)),G&&G.d(),W&&W.d(),X&&X.d(),U&&U.d(),K&&K.d(),se&&se.d(),x&&x.d(),z&&z.d(),ee&&ee.d(),ue&&ue.d(),ae&&ae.d(),le&&le.d(),_e&&_e.d(),ne&&ne.d(),Me(O,ge),Me(D,ge),Me(F,ge),Me(y,ge),j=!1,$()}}}async function R0(){await(await fetch("reboot",{method:"POST"})).json()}function F0(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,{data:s}=e,o=Sn,r={};wl.subscribe(Q=>{l(3,r=Q)});let f=[{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"}],c=!0,_=!1,d=!1,m,h=[];Fn.subscribe(Q=>{var Ce,Kt,fl;Q.version&&(l(6,d=(Ce=Q==null?void 0:Q.c)==null?void 0:Ce.e),l(7,m=Q),l(4,c=!1),l(8,h=[{code:"en",name:"English"}]),(Kt=m==null?void 0:m.u)!=null&&Kt.lang&&m.u.lang!="en"&&h.push({code:m.u.lang,name:((fl=r.language)==null?void 0:fl.name)??"Unknown"}),h.push({code:"hub",name:"Load from server"}))}),Qc();let v={};$i.subscribe(Q=>{var Ce;for(let Kt=0;Kt(Jt.hostname=Ce.get("gh"),Jt.usrcfg=ml.success,Jt.booting=ml.reboot,Ce.get("nm")=="static"&&(Jt.net.ip=Ce.get("ni"),Jt.net.mask=Ce.get("nu"),Jt.net.gw=Ce.get("ng"),Jt.net.dns1=Ce.get("nd")),Jt.ui=m.u,Jt)),l(5,_=!1),on(n)}const L=function(){confirm("Reboot?")&&(rl.update(Q=>(Q.booting=!0,Q)),R0())};async function O(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),Fn.update(Ce=>(Ce.q.s.c=!1,Ce)))}async function N(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),Fn.update(Ce=>(Ce.q.s.r=!1,Ce)))}async function D(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),Fn.update(Ce=>(Ce.q.s.k=!1,Ce)))}const E=function(){m.q.s.e?m.q.p==1883&&l(7,m.q.p=8883,m):m.q.p==8883&&l(7,m.q.p=1883,m)};async function F(){if(m.u.lang=="hub"){const Q=await kl("http://hub.amsleser.no/hub/language/list.json");l(8,h=await Q.json()),l(7,m.u.lang=r.language.code,m)}}async function H(){l(7,m.p.e=!0,m)}let y=44;async function S(){const Q=await kl("cloudkey.json");if(Q.status==200){let Ce=await Q.json();window.open("https://www.amsleser.cloud/device/"+Ce.seed)}else alert("Not able to bind to cloud")}const j=window||global;j.bindToCloud=function(){console.log("BIND CALLED")};const $=[[]];function G(){m.g.h=this.value,l(7,m)}function W(){m.g.t=jt(this),l(7,m)}function X(){m.p.r=jt(this),l(7,m)}function U(){m.p.c=jt(this),l(7,m)}function K(){m.p.e=this.checked,l(7,m)}function se(){m.p.t=this.value,l(7,m)}function x(){m.g.s=jt(this),l(7,m)}function z(){m.g.u=this.value,l(7,m)}function ee(){m.g.p=this.value,l(7,m)}function ue(){m.g.c=this.value,l(7,m)}function ae(){m.m.a=jt(this),l(7,m)}function le(){m.m.b=ye(this.value),l(7,m)}function _e(){m.m.i=this.checked,l(7,m)}function ne(){m.m.b=jt(this),l(7,m)}function te(){m.m.p=jt(this),l(7,m)}function ie(){m.m.s=ye(this.value),l(7,m)}function be(){m.m.d=jt(this),l(7,m)}function we(){m.m.f=ye(this.value),l(7,m)}function I(){m.m.r=ye(this.value),l(7,m)}function P(){m.m.e.e=this.checked,l(7,m)}function B(){m.m.e.k=this.value,l(7,m)}function R(){m.m.e.a=this.value,l(7,m)}function Y(){m.m.m.e=this.checked,l(7,m)}function J(){m.m.m.w=ye(this.value),l(7,m)}function fe(){m.m.m.v=ye(this.value),l(7,m)}function ce(){m.m.m.a=ye(this.value),l(7,m)}function me(){m.m.m.c=ye(this.value),l(7,m)}function pe(){m.n.c=jt(this),l(7,m)}function ke(){m.w.s=this.__value,l(7,m)}function ve(){m.w.p=this.value,l(7,m)}function De(){m.w.p=this.value,l(7,m)}function Ee(){m.w.z=jt(this),l(7,m)}function Oe(){m.w.w=ye(this.value),l(7,m)}function Le(){m.w.b=this.checked,l(7,m)}function st(){m.n.m=jt(this),l(7,m)}function dt(){m.n.i=this.value,l(7,m)}function lt(){m.n.s=jt(this),l(7,m)}function Ze(){m.n.g=this.value,l(7,m)}function Be(){m.n.d1=this.value,l(7,m)}function ft(){m.n.d2=this.value,l(7,m)}function Nt(){m.n.x=this.checked,l(7,m)}function bt(){m.n.d=this.checked,l(7,m)}function ut(){m.n.h=this.checked,l(7,m)}function ot(){m.n.n1=this.value,l(7,m)}function rt(){m.q.s.e=this.checked,l(7,m)}function Rt(){m.q.h=this.value,l(7,m)}function Ke(){m.q.p=ye(this.value),l(7,m)}function Ie(){m.q.u=this.value,l(7,m)}function je(){m.q.a=this.value,l(7,m)}function $e(){m.q.c=this.value,l(7,m)}function de(){m.q.m=jt(this),l(7,m)}function qe(){m.q.b=this.value,l(7,m)}function Ge(){m.q.r=this.value,l(7,m)}function ge(){m.q.t=jt(this),l(7,m)}function Te(){m.q.d=ye(this.value),l(7,m)}function it(){m.q.i=ye(this.value),l(7,m)}function He(){m.q.k=ye(this.value),l(7,m)}function At(){m.o.e=this.value,l(7,m)}function ht(){m.o.c=this.value,l(7,m)}function Re(){m.o.u1=this.value,l(7,m)}function kt(){m.o.u2=this.value,l(7,m)}function ct(){m.o.u3=this.value,l(7,m)}function vt(){m.h.t=this.value,l(7,m)}function xe(){m.h.h=this.value,l(7,m)}function Ot(){m.h.n=this.value,l(7,m)}function Gt(){m.c.e=this.checked,l(7,m)}function wt(){m.c.p=jt(this),l(7,m)}function _t(){m.c.es=this.checked,l(7,m)}function Ht(){m.c.ze=this.checked,l(7,m)}function Qt(){m.c.zt=this.value,l(7,m)}function Ut(Q){m.t.t[Q]=ye(this.value),l(7,m)}function Bt(){m.t.h=ye(this.value),l(7,m)}function Xt(Q){m.u[Q.key]=jt(this),l(7,m)}function $t(){m.u.lang=jt(this),l(7,m)}function Vt(){m.i.h.p=jt(this),l(7,m)}function Ft(){m.i.h.t=jt(this),l(7,m)}function Fe(){m.i.h.u=this.checked,l(7,m)}function Je(){m.i.a=ye(this.value),l(7,m)}function Ue(){m.i.l.p=ye(this.value),l(7,m)}function Pt(){m.i.l.i=this.checked,l(7,m)}function Lt(){m.i.r.i=this.checked,l(7,m)}function Qe(){m.i.r.r=ye(this.value),l(7,m)}function nt(){m.i.r.g=ye(this.value),l(7,m)}function Tt(){m.i.r.b=ye(this.value),l(7,m)}function at(){m.i.d.d=ye(this.value),l(7,m)}function he(){m.i.t.d=ye(this.value),l(7,m)}function et(){m.i.t.a=ye(this.value),l(7,m)}function ze(){m.i.v.p=ye(this.value),l(7,m)}function xt(){m.i.v.d.v=ye(this.value),l(7,m)}function el(){m.i.v.d.g=ye(this.value),l(7,m)}function tl(){m.i.d.b=jt(this),l(7,m)}function ll(){m.i.v.o=ye(this.value),l(7,m)}function nl(){m.i.v.m=ye(this.value),l(7,m)}function il(){m.i.v.b=ye(this.value),l(7,m)}function sl(){m.d.s=this.checked,l(7,m)}function ol(){m.d.t=this.checked,l(7,m)}function Ae(){m.d.l=jt(this),l(7,m)}return t.$$set=Q=>{"basepath"in Q&&l(24,n=Q.basepath),"sysinfo"in Q&&l(0,i=Q.sysinfo),"data"in Q&&l(1,s=Q.data)},t.$$.update=()=>{if(t.$$.dirty[0]&1&&l(12,y=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39),t.$$.dirty[0]&2){const Q=s==null?void 0:s.r;typeof Q=="number"&&(Q>=-50?l(2,o=ts):Q>=-60?l(2,o=es):Q>=-75?l(2,o=xi):l(2,o=Sn))}},[i,s,o,r,c,_,d,m,h,v,b,w,y,f,k,A,L,O,N,D,E,F,H,S,n,G,W,X,U,K,se,x,z,ee,ue,ae,le,_e,ne,te,ie,be,we,I,P,B,R,Y,J,fe,ce,me,pe,ke,$,ve,De,Ee,Oe,Le,st,dt,lt,Ze,Be,ft,Nt,bt,ut,ot,rt,Rt,Ke,Ie,je,$e,de,qe,Ge,ge,Te,it,He,At,ht,Re,kt,ct,vt,xe,Ot,Gt,wt,_t,Ht,Qt,Ut,Bt,Xt,$t,Vt,Ft,Fe,Je,Ue,Pt,Lt,Qe,nt,Tt,at,he,et,ze,xt,el,tl,ll,nl,il,sl,ol,Ae]}class U0 extends Mt{constructor(e){super(),St(this,e,F0,I0,Ct,{basepath:24,sysinfo:0,data:1},null,[-1,-1,-1,-1,-1])}}function ja(t,e,l){const n=t.slice();return n[21]=e[l],n}function za(t){let e,l=t[1].cpu+"",n,i;return{c(){e=C("("),n=C(l),i=C("MHz)")},m(s,o){T(s,e,o),T(s,n,o),T(s,i,o)},p(s,o){o&2&&l!==(l=s[1].cpu+"")&&q(n,l)},d(s){s&&(M(e),M(n),M(i))}}}function B0(t){let e=Ye(t[1].chip,t[1].board)+"",l;return{c(){l=C(e)},m(n,i){T(n,l,i)},p(n,i){i&2&&e!==(e=Ye(n[1].chip,n[1].board)+"")&&q(l,e)},d(n){n&&M(l)}}}function Ha(t){var X,U,K,se,x,z,ee,ue;let e,l=(((U=(X=t[3].status)==null?void 0:X.device)==null?void 0:U.apmac)??"AP MAC")+"",n,i,s=t[1].apmac+"",o,r,f,c=(((se=(K=t[3].status)==null?void 0:K.device)==null?void 0:se.last_boot)??"Last boot")+"",_,d,m,h,v,b,w=(((z=(x=t[3].status)==null?void 0:x.device)==null?void 0:z.reason)??"Reason")+"",k,A,L=(((ue=(ee=t[3][gs(t[1].chip)])==null?void 0:ee.reason)==null?void 0:ue[t[1].boot_reason])??t[1].boot_reason)+"",O,N,D=t[1].boot_reason+"",E,F,H=t[1].ex_cause+"",y,S,j;const $=[j0,y0],G=[];function W(ae,le){return ae[0].u>0?0:1}return m=W(t),h=G[m]=$[m](t),{c(){e=p("div"),n=C(l),i=C(": "),o=C(s),r=g(),f=p("div"),_=C(c),d=C(`: + `),h.c(),v=g(),b=p("div"),k=C(w),A=C(": "),O=C(L),N=C(" ("),E=C(D),F=C("/"),y=C(H),S=C(")"),u(e,"class","my-2"),u(f,"class","my-2"),u(b,"class","my-2")},m(ae,le){T(ae,e,le),a(e,n),a(e,i),a(e,o),T(ae,r,le),T(ae,f,le),a(f,_),a(f,d),G[m].m(f,null),T(ae,v,le),T(ae,b,le),a(b,k),a(b,A),a(b,O),a(b,N),a(b,E),a(b,F),a(b,y),a(b,S),j=!0},p(ae,le){var ne,te,ie,be,we,I,P,B;(!j||le&8)&&l!==(l=(((te=(ne=ae[3].status)==null?void 0:ne.device)==null?void 0:te.apmac)??"AP MAC")+"")&&q(n,l),(!j||le&2)&&s!==(s=ae[1].apmac+"")&&q(o,s),(!j||le&8)&&c!==(c=(((be=(ie=ae[3].status)==null?void 0:ie.device)==null?void 0:be.last_boot)??"Last boot")+"")&&q(_,c);let _e=m;m=W(ae),m===_e?G[m].p(ae,le):(mt(),oe(G[_e],1,1,()=>{G[_e]=null}),pt(),h=G[m],h?h.p(ae,le):(h=G[m]=$[m](ae),h.c()),Z(h,1),h.m(f,null)),(!j||le&8)&&w!==(w=(((I=(we=ae[3].status)==null?void 0:we.device)==null?void 0:I.reason)??"Reason")+"")&&q(k,w),(!j||le&10)&&L!==(L=(((B=(P=ae[3][gs(ae[1].chip)])==null?void 0:P.reason)==null?void 0:B[ae[1].boot_reason])??ae[1].boot_reason)+"")&&q(O,L),(!j||le&2)&&D!==(D=ae[1].boot_reason+"")&&q(E,D),(!j||le&2)&&H!==(H=ae[1].ex_cause+"")&&q(y,H)},i(ae){j||(Z(h),j=!0)},o(ae){oe(h),j=!1},d(ae){ae&&(M(e),M(r),M(f),M(v),M(b)),G[m].d()}}}function y0(t){let e;return{c(){e=C("-")},m(l,n){T(l,e,n)},p:Ve,i:Ve,o:Ve,d(l){l&&M(e)}}}function j0(t){let e,l;return e=new Lu({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:"",offset:t[1].clock_offset}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),i&2&&(s.offset=n[1].clock_offset),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function Wa(t){var _;let e,l,n,i,s=(((_=t[3].btn)==null?void 0:_.reboot)??"Reboot")+"",o,r,f,c;return l=new hl({props:{to:"/consent",$$slots:{default:[z0]},$$scope:{ctx:t}}}),{c(){e=p("div"),Ne(l.$$.fragment),n=g(),i=p("button"),o=C(s),u(i,"class","btn-yellow-sm float-right"),u(e,"class","my-2")},m(d,m){T(d,e,m),Se(l,e,null),a(e,n),a(e,i),a(i,o),r=!0,f||(c=re(i,"click",t[11]),f=!0)},p(d,m){var v;const h={};m&16777224&&(h.$$scope={dirty:m,ctx:d}),l.$set(h),(!r||m&8)&&s!==(s=(((v=d[3].btn)==null?void 0:v.reboot)??"Reboot")+"")&&q(o,s)},i(d){r||(Z(l.$$.fragment,d),r=!0)},o(d){oe(l.$$.fragment,d),r=!1},d(d){d&&M(e),Me(l),f=!1,c()}}}function z0(t){var i,s;let e,l=(((s=(i=t[3].status)==null?void 0:i.device)==null?void 0:s.btn_consents)??"Consents")+"",n;return{c(){e=p("span"),n=C(l),u(e,"class","btn-pri-sm")},m(o,r){T(o,e,r),a(e,n)},p(o,r){var f,c;r&8&&l!==(l=(((c=(f=o[3].status)==null?void 0:f.device)==null?void 0:c.btn_consents)??"Consents")+"")&&q(n,l)},d(o){o&&M(e)}}}function Ga(t){var y,S,j,$,G,W,X,U;let e,l,n=(((S=(y=t[3].status)==null?void 0:y.meter)==null?void 0:S.title)??"Meter")+"",i,s,o,r=((($=(j=t[3].status)==null?void 0:j.meter)==null?void 0:$.manufacturer)??"Manufacturer")+"",f,c,_=ui(t[1].meter.mfg)+"",d,m,h,v=(((W=(G=t[3].status)==null?void 0:G.meter)==null?void 0:W.model)??"Model")+"",b,w,k=(t[1].meter.model?t[1].meter.model:"unknown")+"",A,L,O,N=(((U=(X=t[3].status)==null?void 0:X.meter)==null?void 0:U.id)??"ID")+"",D,E,F=(t[1].meter.id?t[1].meter.id:"unknown")+"",H;return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("div"),f=C(r),c=C(": "),d=C(_),m=g(),h=p("div"),b=C(v),w=C(": "),A=C(k),L=g(),O=p("div"),D=C(N),E=C(": "),H=C(F),u(l,"class","text-sm"),u(o,"class","my-2"),u(h,"class","my-2"),u(O,"class","my-2"),u(e,"class","cnt")},m(K,se){T(K,e,se),a(e,l),a(l,i),a(e,s),a(e,o),a(o,f),a(o,c),a(o,d),a(e,m),a(e,h),a(h,b),a(h,w),a(h,A),a(e,L),a(e,O),a(O,D),a(O,E),a(O,H)},p(K,se){var x,z,ee,ue,ae,le,_e,ne;se&8&&n!==(n=(((z=(x=K[3].status)==null?void 0:x.meter)==null?void 0:z.title)??"Meter")+"")&&q(i,n),se&8&&r!==(r=(((ue=(ee=K[3].status)==null?void 0:ee.meter)==null?void 0:ue.manufacturer)??"Manufacturer")+"")&&q(f,r),se&2&&_!==(_=ui(K[1].meter.mfg)+"")&&q(d,_),se&8&&v!==(v=(((le=(ae=K[3].status)==null?void 0:ae.meter)==null?void 0:le.model)??"Model")+"")&&q(b,v),se&2&&k!==(k=(K[1].meter.model?K[1].meter.model:"unknown")+"")&&q(A,k),se&8&&N!==(N=(((ne=(_e=K[3].status)==null?void 0:_e.meter)==null?void 0:ne.id)??"ID")+"")&&q(D,N),se&2&&F!==(F=(K[1].meter.id?K[1].meter.id:"unknown")+"")&&q(H,F)},d(K){K&&M(e)}}}function Va(t){var U,K,se,x,z,ee,ue,ae;let e,l,n=(((K=(U=t[3].status)==null?void 0:U.network)==null?void 0:K.title)??"Network")+"",i,s,o,r=(((x=(se=t[3].conf)==null?void 0:se.network)==null?void 0:x.ip)??"IP")+"",f,c,_=t[1].net.ip+"",d,m,h,v=(((ee=(z=t[3].conf)==null?void 0:z.network)==null?void 0:ee.mask)??"Mask")+"",b,w,k=t[1].net.mask+"",A,L,O,N=(((ae=(ue=t[3].conf)==null?void 0:ue.network)==null?void 0:ae.gw)??"Gateway")+"",D,E,F=t[1].net.gw+"",H,y,S,j,$,G=t[1].net.dns1&&Ka(t),W=t[1].net.dns2&&Ya(t),X=t[1].net.ipv6&&Xa(t);return{c(){e=p("div"),l=p("strong"),i=C(n),s=g(),o=p("div"),f=C(r),c=C(": "),d=C(_),m=g(),h=p("div"),b=C(v),w=C(": "),A=C(k),L=g(),O=p("div"),D=C(N),E=C(": "),H=C(F),y=g(),S=p("div"),G&&G.c(),j=g(),W&&W.c(),$=g(),X&&X.c(),u(l,"class","text-sm"),u(o,"class","my-2"),u(h,"class","my-2"),u(O,"class","my-2"),u(S,"class","my-2"),u(e,"class","cnt")},m(le,_e){T(le,e,_e),a(e,l),a(l,i),a(e,s),a(e,o),a(o,f),a(o,c),a(o,d),a(e,m),a(e,h),a(h,b),a(h,w),a(h,A),a(e,L),a(e,O),a(O,D),a(O,E),a(O,H),a(e,y),a(e,S),G&&G.m(S,null),a(S,j),W&&W.m(S,null),a(e,$),X&&X.m(e,null)},p(le,_e){var ne,te,ie,be,we,I,P,B;_e&8&&n!==(n=(((te=(ne=le[3].status)==null?void 0:ne.network)==null?void 0:te.title)??"Network")+"")&&q(i,n),_e&8&&r!==(r=(((be=(ie=le[3].conf)==null?void 0:ie.network)==null?void 0:be.ip)??"IP")+"")&&q(f,r),_e&2&&_!==(_=le[1].net.ip+"")&&q(d,_),_e&8&&v!==(v=(((I=(we=le[3].conf)==null?void 0:we.network)==null?void 0:I.mask)??"Mask")+"")&&q(b,v),_e&2&&k!==(k=le[1].net.mask+"")&&q(A,k),_e&8&&N!==(N=(((B=(P=le[3].conf)==null?void 0:P.network)==null?void 0:B.gw)??"Gateway")+"")&&q(D,N),_e&2&&F!==(F=le[1].net.gw+"")&&q(H,F),le[1].net.dns1?G?G.p(le,_e):(G=Ka(le),G.c(),G.m(S,j)):G&&(G.d(1),G=null),le[1].net.dns2?W?W.p(le,_e):(W=Ya(le),W.c(),W.m(S,null)):W&&(W.d(1),W=null),le[1].net.ipv6?X?X.p(le,_e):(X=Xa(le),X.c(),X.m(e,null)):X&&(X.d(1),X=null)},d(le){le&&M(e),G&&G.d(),W&&W.d(),X&&X.d()}}}function Ka(t){var o,r;let e=(((r=(o=t[3].conf)==null?void 0:o.network)==null?void 0:r.dns)??"DNS")+"",l,n,i=t[1].net.dns1+"",s;return{c(){l=C(e),n=C(": "),s=C(i)},m(f,c){T(f,l,c),T(f,n,c),T(f,s,c)},p(f,c){var _,d;c&8&&e!==(e=(((d=(_=f[3].conf)==null?void 0:_.network)==null?void 0:d.dns)??"DNS")+"")&&q(l,e),c&2&&i!==(i=f[1].net.dns1+"")&&q(s,i)},d(f){f&&(M(l),M(n),M(s))}}}function Ya(t){var o,r;let e=(((r=(o=t[3].conf)==null?void 0:o.network)==null?void 0:r.dns)??"DNS")+"",l,n,i=t[1].net.dns2+"",s;return{c(){l=C(e),n=C(": "),s=C(i)},m(f,c){T(f,l,c),T(f,n,c),T(f,s,c)},p(f,c){var _,d;c&8&&e!==(e=(((d=(_=f[3].conf)==null?void 0:_.network)==null?void 0:d.dns)??"DNS")+"")&&q(l,e),c&2&&i!==(i=f[1].net.dns2+"")&&q(s,i)},d(f){f&&(M(l),M(n),M(s))}}}function Xa(t){let e,l,n,i=t[1].net.ipv6.replace(/\b:?(?:0+:?){2,}/,"::")+"",s,o,r,f,c=t[1].net.dns1v6&&Qa(t),_=t[1].net.dns2v6&&Za(t);return{c(){e=p("div"),l=C("IPv6: "),n=p("span"),s=C(i),o=g(),r=p("div"),c&&c.c(),f=g(),_&&_.c(),sn(n,"font-size","14px"),u(e,"class","my-2"),u(r,"class","my-2")},m(d,m){T(d,e,m),a(e,l),a(e,n),a(n,s),T(d,o,m),T(d,r,m),c&&c.m(r,null),a(r,f),_&&_.m(r,null)},p(d,m){m&2&&i!==(i=d[1].net.ipv6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&q(s,i),d[1].net.dns1v6?c?c.p(d,m):(c=Qa(d),c.c(),c.m(r,f)):c&&(c.d(1),c=null),d[1].net.dns2v6?_?_.p(d,m):(_=Za(d),_.c(),_.m(r,null)):_&&(_.d(1),_=null)},d(d){d&&(M(e),M(o),M(r)),c&&c.d(),_&&_.d()}}}function Qa(t){let e,l,n=t[1].net.dns1v6.replace(/\b:?(?:0+:?){2,}/,"::")+"",i;return{c(){e=C("DNSv6: "),l=p("span"),i=C(n),sn(l,"font-size","14px")},m(s,o){T(s,e,o),T(s,l,o),a(l,i)},p(s,o){o&2&&n!==(n=s[1].net.dns1v6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&q(i,n)},d(s){s&&(M(e),M(l))}}}function Za(t){let e,l,n=t[1].net.dns2v6.replace(/\b:?(?:0+:?){2,}/,"::")+"",i;return{c(){e=C("DNSv6: "),l=p("span"),i=C(n),sn(l,"font-size","14px")},m(s,o){T(s,e,o),T(s,l,o),a(l,i)},p(s,o){o&2&&n!==(n=s[1].net.dns2v6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&q(i,n)},d(s){s&&(M(e),M(l))}}}function Ja(t){var f,c,_,d;let e,l,n=(((c=(f=t[3].status)==null?void 0:f.firmware)==null?void 0:c.failed)??"Upgrade from {0} to {1} failed").replace("{0}",t[1].upgrade.f).replace("{1}",t[1].upgrade.t)+"",i,s,o=(((d=(_=t[3].errors)==null?void 0:_.upgrade)==null?void 0:d[t[1].upgrade.e])??t[1].upgrade.e)+"",r;return{c(){e=p("div"),l=p("div"),i=C(n),s=g(),r=C(o),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(m,h){T(m,e,h),a(e,l),a(l,i),a(l,s),a(l,r)},p(m,h){var v,b,w,k;h&10&&n!==(n=(((b=(v=m[3].status)==null?void 0:v.firmware)==null?void 0:b.failed)??"Upgrade from {0} to {1} failed").replace("{0}",m[1].upgrade.f).replace("{1}",m[1].upgrade.t)+"")&&q(i,n),h&10&&o!==(o=(((k=(w=m[3].errors)==null?void 0:w.upgrade)==null?void 0:k[m[1].upgrade.e])??m[1].upgrade.e)+"")&&q(r,o)},d(m){m&&M(e)}}}function $a(t){var v,b;let e,l=(((b=(v=t[3].status)==null?void 0:v.firmware)==null?void 0:b.latest)??"Latest")+"",n,i,s,o=t[1].upgrade.n+"",r,f,c,_,d,m=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[1].upgrade.n&&t[1].upgrade.n!=t[1].version&&xa(t),h=t[1].fwconsent===2&&ef(t);return{c(){e=p("div"),n=C(l),i=C(`: + `),s=p("a"),r=C(o),c=g(),m&&m.c(),_=g(),h&&h.c(),d=yt(),u(s,"href",f="https://github.com/UtilitechAS/amsreader-firmware/releases/tag/"+t[1].upgrade.n),u(s,"class","ml-2 text-blue-600 hover:text-blue-800"),u(s,"target","_blank"),u(s,"rel","noreferrer"),u(e,"class","my-2 flex")},m(w,k){T(w,e,k),a(e,n),a(e,i),a(e,s),a(s,r),a(e,c),m&&m.m(e,null),T(w,_,k),h&&h.m(w,k),T(w,d,k)},p(w,k){var A,L;k&8&&l!==(l=(((L=(A=w[3].status)==null?void 0:A.firmware)==null?void 0:L.latest)??"Latest")+"")&&q(n,l),k&2&&o!==(o=w[1].upgrade.n+"")&&q(r,o),k&2&&f!==(f="https://github.com/UtilitechAS/amsreader-firmware/releases/tag/"+w[1].upgrade.n)&&u(s,"href",f),(w[1].security==0||w[0].a)&&w[1].fwconsent===1&&w[1].upgrade.n&&w[1].upgrade.n!=w[1].version?m?m.p(w,k):(m=xa(w),m.c(),m.m(e,null)):m&&(m.d(1),m=null),w[1].fwconsent===2?h?h.p(w,k):(h=ef(w),h.c(),h.m(d.parentNode,d)):h&&(h.d(1),h=null)},d(w){w&&(M(e),M(_),M(d)),m&&m.d(),h&&h.d(w)}}}function xa(t){let e,l,n,i,s;return{c(){var o,r;e=p("div"),l=p("button"),l.textContent="⇓",u(e,"class","flex-none ml-2 text-green-500"),u(e,"title",n=((r=(o=t[3].status)==null?void 0:o.firmware)==null?void 0:r.install)??"Install")},m(o,r){T(o,e,r),a(e,l),i||(s=re(l,"click",t[10]),i=!0)},p(o,r){var f,c;r&8&&n!==(n=((c=(f=o[3].status)==null?void 0:f.firmware)==null?void 0:c.install)??"Install")&&u(e,"title",n)},d(o){o&&M(e),i=!1,s()}}}function ef(t){var s,o;let e,l,n=(((o=(s=t[3].status)==null?void 0:s.firmware)==null?void 0:o.no_one_click)??"One-click upgrade disabled")+"",i;return{c(){e=p("div"),l=p("div"),i=C(n),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(r,f){T(r,e,f),a(e,l),a(l,i)},p(r,f){var c,_;f&8&&n!==(n=(((_=(c=r[3].status)==null?void 0:c.firmware)==null?void 0:_.no_one_click)??"One-click upgrade disabled")+"")&&q(i,n)},d(r){r&&M(e)}}}function tf(t){let e,l=Cs(Ye(t[1].chip,t[1].board))+"",n;return{c(){e=p("div"),n=C(l),u(e,"class","bd-red")},m(i,s){T(i,e,s),a(e,n)},p(i,s){s&2&&l!==(l=Cs(Ye(i[1].chip,i[1].board))+"")&&q(n,l)},d(i){i&&M(e)}}}function lf(t){let e,l,n,i,s,o;function r(_,d){return _[5].length==0?W0:H0}let f=r(t),c=f(t);return{c(){e=p("div"),l=p("form"),n=p("input"),i=g(),c.c(),sn(n,"display","none"),u(n,"name","file"),u(n,"type","file"),u(n,"accept",".bin"),u(l,"action","firmware"),u(l,"enctype","multipart/form-data"),u(l,"method","post"),u(l,"autocomplete","off"),u(e,"class","my-2 flex")},m(_,d){T(_,e,d),a(e,l),a(l,n),t[13](n),a(l,i),c.m(l,null),s||(o=[re(n,"change",t[14]),re(l,"submit",t[16])],s=!0)},p(_,d){f===(f=r(_))&&c?c.p(_,d):(c.d(1),c=f(_),c&&(c.c(),c.m(l,null)))},d(_){_&&M(e),t[13](null),c.d(),s=!1,Dt(o)}}}function H0(t){var r;let e=t[5][0].name+"",l,n,i,s=(((r=t[3].btn)==null?void 0:r.upload)??"Upload")+"",o;return{c(){l=C(e),n=g(),i=p("button"),o=C(s),u(i,"type","submit"),u(i,"class","btn-pri-sm float-right ml-2")},m(f,c){T(f,l,c),T(f,n,c),T(f,i,c),a(i,o)},p(f,c){var _;c&32&&e!==(e=f[5][0].name+"")&&q(l,e),c&8&&s!==(s=(((_=f[3].btn)==null?void 0:_.upload)??"Upload")+"")&&q(o,s)},d(f){f&&(M(l),M(n),M(i))}}}function W0(t){var o,r;let e,l=(((r=(o=t[3].status)==null?void 0:o.firmware)==null?void 0:r.btn_select_file)??"Select file")+"",n,i,s;return{c(){e=p("button"),n=C(l),u(e,"type","button"),u(e,"class","btn-pri-sm float-right")},m(f,c){T(f,e,c),a(e,n),i||(s=re(e,"click",t[15]),i=!0)},p(f,c){var _,d;c&8&&l!==(l=(((d=(_=f[3].status)==null?void 0:_.firmware)==null?void 0:d.btn_select_file)??"Select file")+"")&&q(n,l)},d(f){f&&M(e),i=!1,s()}}}function nf(t){var W,X,U,K,se,x;let e,l,n=(((X=(W=t[3].status)==null?void 0:W.backup)==null?void 0:X.title)??"Backup")+"",i,s,o,r,f,c,_,d,m=(((K=(U=t[3].status)==null?void 0:U.backup)==null?void 0:K.secrets)??"Include secrets")+"",h,v,b,w=(((x=(se=t[3].status)==null?void 0:se.backup)==null?void 0:x.secrets_desc)??"")+"",k,A,L,O,N,D,E,F,H=tt(t[9]),y=[];for(let z=0;z{ce=null}),pt()),(vt=de[0])!=null&&vt.a?me?(me.p(de,qe),qe&1&&Z(me,1)):(me=Wa(de),me.c(),Z(me,1),me.m(l,null)):me&&(mt(),oe(me,1,1,()=>{me=null}),pt()),de[1].meter?pe?pe.p(de,qe):(pe=Ga(de),pe.c(),pe.m(e,G)):pe&&(pe.d(1),pe=null),de[1].net?ke?ke.p(de,qe):(ke=Va(de),ke.c(),ke.m(e,W)):ke&&(ke.d(1),ke=null),(!J||qe&8)&&K!==(K=(((Ot=(xe=de[3].status)==null?void 0:xe.firmware)==null?void 0:Ot.title)??"Firmware")+"")&&q(se,K),(!J||qe&8)&&ee!==(ee=(((wt=(Gt=de[3].status)==null?void 0:Gt.firmware)==null?void 0:wt.installed)??"Installed")+"")&&q(ue,ee),(!J||qe&2)&&le!==(le=de[1].version+"")&&q(_e,le),de[1].upgrade.t&&de[1].upgrade.t!=de[1].version&&de[1].upgrade.e!=0&&de[1].upgrade.e!=123?ve?ve.p(de,qe):(ve=Ja(de),ve.c(),ve.m(X,te)):ve&&(ve.d(1),ve=null),de[1].upgrade.n?De?De.p(de,qe):(De=$a(de),De.c(),De.m(X,ie)):De&&(De.d(1),De=null),qe&3&&(be=(de[1].security==0||de[0].a)&&yn(de[1].board)),be?Ee?Ee.p(de,qe):(Ee=tf(de),Ee.c(),Ee.m(X,we)):Ee&&(Ee.d(1),Ee=null),de[1].security==0||de[0].a?Oe?Oe.p(de,qe):(Oe=lf(de),Oe.c(),Oe.m(X,null)):Oe&&(Oe.d(1),Oe=null),de[1].security==0||de[0].a?Le?Le.p(de,qe):(Le=nf(de),Le.c(),Le.m(e,null)):Le&&(Le.d(1),Le=null);const ge={};qe&64&&(ge.active=de[6]),qe&8&&(ge.message=((Ht=(_t=de[3].status)==null?void 0:_t.mask)==null?void 0:Ht.firmware)??"Uploading"),B.$set(ge);const Te={};qe&256&&(Te.active=de[8]),qe&8&&(Te.message=((Ut=(Qt=de[3].status)==null?void 0:Qt.mask)==null?void 0:Ut.config)??"Uploading"),Y.$set(Te)},i(de){J||(Z(L.$$.fragment,de),Z(ce),Z(me),Z(B.$$.fragment,de),Z(Y.$$.fragment,de),J=!0)},o(de){oe(L.$$.fragment,de),oe(ce),oe(me),oe(B.$$.fragment,de),oe(Y.$$.fragment,de),J=!1},d(de){de&&(M(e),M(P),M(R)),fe&&fe.d(),Me(L),ce&&ce.d(),me&&me.d(),pe&&pe.d(),ke&&ke.d(),ve&&ve.d(),De&&De.d(),Ee&&Ee.d(),Oe&&Oe.d(),Le&&Le.d(),Me(B,de),Me(Y,de)}}}async function Y0(){await(await fetch("reboot",{method:"POST"})).json()}function X0(t,e,l){let{data:n}=e,{sysinfo:i}=e,s=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price",key:"is"}],o={};wl.subscribe(F=>{l(3,o=F)});function r(){var F;confirm((((F=o.header)==null?void 0:F.upgrade)??"Upgrade to {0}?").replace("{0}",i.upgrade.n))&&(Ou(i.upgrade.n),rl.update(H=>(H.upgrade.t=i.upgrade.n,H.upgrade.p=0,H.upgrading=!0,H)))}const f=function(){var F;confirm(((F=o.device)==null?void 0:F.reboot_confirm)??"Reboot?")&&(rl.update(H=>(H.booting=!0,H)),Y0())};let c,_=[],d=!1,m,h=[],v=!1;ci();let b={hostname:"",ip:""};function w(F){l(8,v=!0);const H=new FormData;H.append("file",h[0]),fetch("configfile",{method:"POST",body:H}).then(y=>y.json()).then(y=>{rl.update(S=>(b&&b.hostname&&(S.hostname=b.hostname),S.booting=y.reboot,b&&b.ip&&(S.net.ip=b.ip),setTimeout(cn,5e3,i),S))}).catch(y=>{console.error("Error:",y),setTimeout(cn,5e3,i)})}function k(F){ai[F?"unshift":"push"](()=>{c=F,l(4,c)})}function A(){_=this.files,l(5,_)}const L=()=>{c.click()},O=()=>l(6,d=!0);function N(F){ai[F?"unshift":"push"](()=>{m=F,l(7,m)})}function D(){h=this.files,l(2,h)}const E=()=>{m.click()};return t.$$set=F=>{"data"in F&&l(0,n=F.data),"sysinfo"in F&&l(1,i=F.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&4&&h.length==1){let F=h[0],H=new FileReader,y=S=>{let j=S.target.result.split(` +`);for(let $ in j){let G=j[$];G.startsWith("hostname ")?b.hostname=G.split(" ")[1]:G.startsWith("ip ")&&(b.ip=G.split(" ")[1])}};H.onload=y,H.readAsText(F)}},[n,i,h,o,c,_,d,m,v,s,r,f,w,k,A,L,O,N,D,E]}class Q0 extends Mt{constructor(e){super(),St(this,e,X0,K0,Ct,{data:0,sysinfo:1})}}function af(t){let e,l,n=Ye(t[0],7)+"",i,s,o=Ye(t[0],5)+"",r,f,c=Ye(t[0],4)+"",_,d,m=Ye(t[0],3)+"",h,v,b,w,k=Ye(t[0],2)+"",A,L,O=Ye(t[0],1)+"",N,D,E=Ye(t[0],0)+"",F,H,y,S,j=Ye(t[0],101)+"",$,G,W=Ye(t[0],100)+"",X;return{c(){e=p("optgroup"),l=p("option"),i=C(n),s=p("option"),r=C(o),f=p("option"),_=C(c),d=p("option"),h=C(m),v=g(),b=p("optgroup"),w=p("option"),A=C(k),L=p("option"),N=C(O),D=p("option"),F=C(E),H=g(),y=p("optgroup"),S=p("option"),$=C(j),G=p("option"),X=C(W),l.__value=7,V(l,l.__value),s.__value=5,V(s,s.__value),f.__value=4,V(f,f.__value),d.__value=3,V(d,d.__value),u(e,"label","amsleser.no"),w.__value=2,V(w,w.__value),L.__value=1,V(L,L.__value),D.__value=0,V(D,D.__value),u(b,"label","Custom hardware"),S.__value=101,V(S,S.__value),G.__value=100,V(G,G.__value),u(y,"label","Generic hardware")},m(U,K){T(U,e,K),a(e,l),a(l,i),a(e,s),a(s,r),a(e,f),a(f,_),a(e,d),a(d,h),T(U,v,K),T(U,b,K),a(b,w),a(w,A),a(b,L),a(L,N),a(b,D),a(D,F),T(U,H,K),T(U,y,K),a(y,S),a(S,$),a(y,G),a(G,X)},p(U,K){K&1&&n!==(n=Ye(U[0],7)+"")&&q(i,n),K&1&&o!==(o=Ye(U[0],5)+"")&&q(r,o),K&1&&c!==(c=Ye(U[0],4)+"")&&q(_,c),K&1&&m!==(m=Ye(U[0],3)+"")&&q(h,m),K&1&&k!==(k=Ye(U[0],2)+"")&&q(A,k),K&1&&O!==(O=Ye(U[0],1)+"")&&q(N,O),K&1&&E!==(E=Ye(U[0],0)+"")&&q(F,E),K&1&&j!==(j=Ye(U[0],101)+"")&&q($,j),K&1&&W!==(W=Ye(U[0],100)+"")&&q(X,W)},d(U){U&&(M(e),M(v),M(b),M(H),M(y))}}}function ff(t){let e,l,n=Ye(t[0],201)+"",i,s,o=Ye(t[0],202)+"",r,f,c=Ye(t[0],203)+"",_,d,m=Ye(t[0],241)+"",h,v,b=Ye(t[0],242)+"",w,k,A=Ye(t[0],243)+"",L,O,N=Ye(t[0],245)+"",D,E,F=Ye(t[0],200)+"",H;return{c(){e=p("optgroup"),l=p("option"),i=C(n),s=p("option"),r=C(o),f=p("option"),_=C(c),d=p("option"),h=C(m),v=p("option"),w=C(b),k=p("option"),L=C(A),O=p("option"),D=C(N),E=p("option"),H=C(F),l.__value=201,V(l,l.__value),s.__value=202,V(s,s.__value),f.__value=203,V(f,f.__value),d.__value=241,V(d,d.__value),v.__value=242,V(v,v.__value),k.__value=243,V(k,k.__value),O.__value=245,V(O,O.__value),E.__value=200,V(E,E.__value),u(e,"label","Generic hardware")},m(y,S){T(y,e,S),a(e,l),a(l,i),a(e,s),a(s,r),a(e,f),a(f,_),a(e,d),a(d,h),a(e,v),a(v,w),a(e,k),a(k,L),a(e,O),a(O,D),a(e,E),a(E,H)},p(y,S){S&1&&n!==(n=Ye(y[0],201)+"")&&q(i,n),S&1&&o!==(o=Ye(y[0],202)+"")&&q(r,o),S&1&&c!==(c=Ye(y[0],203)+"")&&q(_,c),S&1&&m!==(m=Ye(y[0],241)+"")&&q(h,m),S&1&&b!==(b=Ye(y[0],242)+"")&&q(w,b),S&1&&A!==(A=Ye(y[0],243)+"")&&q(L,A),S&1&&N!==(N=Ye(y[0],245)+"")&&q(D,N),S&1&&F!==(F=Ye(y[0],200)+"")&&q(H,F)},d(y){y&&M(e)}}}function uf(t){let e,l,n=Ye(t[0],7)+"",i,s,o=Ye(t[0],6)+"",r,f,c=Ye(t[0],5)+"",_,d,m,h,v=Ye(t[0],51)+"",b,w,k=Ye(t[0],50)+"",A;return{c(){e=p("optgroup"),l=p("option"),i=C(n),s=p("option"),r=C(o),f=p("option"),_=C(c),d=g(),m=p("optgroup"),h=p("option"),b=C(v),w=p("option"),A=C(k),l.__value=7,V(l,l.__value),s.__value=6,V(s,s.__value),f.__value=5,V(f,f.__value),u(e,"label","amsleser.no"),h.__value=51,V(h,h.__value),w.__value=50,V(w,w.__value),u(m,"label","Generic hardware")},m(L,O){T(L,e,O),a(e,l),a(l,i),a(e,s),a(s,r),a(e,f),a(f,_),T(L,d,O),T(L,m,O),a(m,h),a(h,b),a(m,w),a(w,A)},p(L,O){O&1&&n!==(n=Ye(L[0],7)+"")&&q(i,n),O&1&&o!==(o=Ye(L[0],6)+"")&&q(r,o),O&1&&c!==(c=Ye(L[0],5)+"")&&q(_,c),O&1&&v!==(v=Ye(L[0],51)+"")&&q(b,v),O&1&&k!==(k=Ye(L[0],50)+"")&&q(A,k)},d(L){L&&(M(e),M(d),M(m))}}}function rf(t){let e,l,n=Ye(t[0],8)+"",i,s,o,r,f=Ye(t[0],71)+"",c,_,d=Ye(t[0],70)+"",m;return{c(){e=p("optgroup"),l=p("option"),i=C(n),s=g(),o=p("optgroup"),r=p("option"),c=C(f),_=p("option"),m=C(d),l.__value=8,V(l,l.__value),u(e,"label","Custom hardware"),r.__value=71,V(r,r.__value),_.__value=70,V(_,_.__value),u(o,"label","Generic hardware")},m(h,v){T(h,e,v),a(e,l),a(l,i),T(h,s,v),T(h,o,v),a(o,r),a(r,c),a(o,_),a(_,m)},p(h,v){v&1&&n!==(n=Ye(h[0],8)+"")&&q(i,n),v&1&&f!==(f=Ye(h[0],71)+"")&&q(c,f),v&1&&d!==(d=Ye(h[0],70)+"")&&q(m,d)},d(h){h&&(M(e),M(s),M(o))}}}function cf(t){let e,l,n=Ye(t[0],200)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=C(n),l.__value=200,V(l,l.__value),u(e,"label","Generic hardware")},m(s,o){T(s,e,o),a(e,l),a(l,i)},p(s,o){o&1&&n!==(n=Ye(s[0],200)+"")&&q(i,n)},d(s){s&&M(e)}}}function _f(t){let e,l,n=Ye(t[0],80)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=C(n),l.__value=80,V(l,l.__value),u(e,"label","Generic hardware")},m(s,o){T(s,e,o),a(e,l),a(l,i)},p(s,o){o&1&&n!==(n=Ye(s[0],80)+"")&&q(i,n)},d(s){s&&M(e)}}}function Z0(t){let e,l,n,i,s,o,r,f,c=t[0]=="esp8266"&&af(t),_=t[0]=="esp32"&&ff(t),d=t[0]=="esp32s2"&&uf(t),m=t[0]=="esp32c3"&&rf(t),h=t[0]=="esp32solo"&&cf(t),v=t[0]=="esp32s3"&&_f(t);return{c(){e=p("option"),l=g(),c&&c.c(),n=g(),_&&_.c(),i=g(),d&&d.c(),s=g(),m&&m.c(),o=g(),h&&h.c(),r=g(),v&&v.c(),f=yt(),e.__value=-1,V(e,e.__value)},m(b,w){T(b,e,w),T(b,l,w),c&&c.m(b,w),T(b,n,w),_&&_.m(b,w),T(b,i,w),d&&d.m(b,w),T(b,s,w),m&&m.m(b,w),T(b,o,w),h&&h.m(b,w),T(b,r,w),v&&v.m(b,w),T(b,f,w)},p(b,[w]){b[0]=="esp8266"?c?c.p(b,w):(c=af(b),c.c(),c.m(n.parentNode,n)):c&&(c.d(1),c=null),b[0]=="esp32"?_?_.p(b,w):(_=ff(b),_.c(),_.m(i.parentNode,i)):_&&(_.d(1),_=null),b[0]=="esp32s2"?d?d.p(b,w):(d=uf(b),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),b[0]=="esp32c3"?m?m.p(b,w):(m=rf(b),m.c(),m.m(o.parentNode,o)):m&&(m.d(1),m=null),b[0]=="esp32solo"?h?h.p(b,w):(h=cf(b),h.c(),h.m(r.parentNode,r)):h&&(h.d(1),h=null),b[0]=="esp32s3"?v?v.p(b,w):(v=_f(b),v.c(),v.m(f.parentNode,f)):v&&(v.d(1),v=null)},i:Ve,o:Ve,d(b){b&&(M(e),M(l),M(n),M(i),M(s),M(o),M(r),M(f)),c&&c.d(b),_&&_.d(b),d&&d.d(b),m&&m.d(b),h&&h.d(b),v&&v.d(b)}}}function J0(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class $0 extends Mt{constructor(e){super(),St(this,e,J0,Z0,Ct,{chip:0})}}function mf(t){let e;return{c(){e=p("div"),e.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",u(e,"class","bd-red")},m(l,n){T(l,e,n)},d(l){l&&M(e)}}}function pf(t){let e,l,n,i,s,o,r;return o=new Bi({props:{chip:t[0].chip}}),{c(){e=p("div"),l=C("HAN GPIO"),n=p("br"),i=g(),s=p("select"),Ne(o.$$.fragment),u(s,"name","vh"),u(s,"class","in-s"),u(e,"class","my-3")},m(f,c){T(f,e,c),a(e,l),a(e,n),a(e,i),a(e,s),Se(o,s,null),r=!0},p(f,c){const _={};c&1&&(_.chip=f[0].chip),o.$set(_)},i(f){r||(Z(o.$$.fragment,f),r=!0)},o(f){oe(o.$$.fragment,f),r=!1},d(f){f&&M(e),Me(o)}}}function x0(t){let e,l,n,i,s,o,r,f,c,_,d,m,h,v,b,w,k,A,L,O,N,D,E,F,H,y,S,j,$,G=t[0].usrcfg&&mf();v=new $0({props:{chip:t[0].chip}});let W=t[0].board&&t[0].board>20&&pf(t);return y=new _l({props:{active:t[1],message:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("input"),s=g(),o=p("strong"),o.textContent="Initial configuration",r=g(),G&&G.c(),f=g(),c=p("div"),_=C("Board type"),d=p("br"),m=g(),h=p("select"),Ne(v.$$.fragment),b=g(),W&&W.c(),w=g(),k=p("div"),A=p("label"),L=p("input"),O=C(" Clear all other configuration"),N=g(),D=p("div"),D.innerHTML='',E=g(),F=p("span"),F.textContent=" ",H=g(),Ne(y.$$.fragment),u(i,"type","hidden"),u(i,"name","v"),i.value="true",u(o,"class","text-sm"),u(h,"name","vb"),u(h,"class","in-s"),t[0].board===void 0&&qt(()=>t[5].call(h)),u(c,"class","my-3"),u(L,"type","checkbox"),u(L,"name","vr"),L.__value="true",V(L,L.__value),u(L,"class","rounded mb-1"),u(k,"class","my-3"),u(D,"class","my-3"),u(F,"class","clear-both"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(X,U){T(X,e,U),a(e,l),a(l,n),a(n,i),a(n,s),a(n,o),a(n,r),G&&G.m(n,null),a(n,f),a(n,c),a(c,_),a(c,d),a(c,m),a(c,h),Se(v,h,null),Xe(h,t[0].board,!0),a(n,b),W&&W.m(n,null),a(n,w),a(n,k),a(k,A),a(A,L),L.checked=t[2],a(A,O),a(n,N),a(n,D),a(n,E),a(n,F),T(X,H,U),Se(y,X,U),S=!0,j||($=[re(h,"change",t[5]),re(L,"change",t[6]),re(n,"submit",mn(t[3]))],j=!0)},p(X,[U]){X[0].usrcfg?G||(G=mf(),G.c(),G.m(n,f)):G&&(G.d(1),G=null);const K={};U&1&&(K.chip=X[0].chip),v.$set(K),U&1&&Xe(h,X[0].board),X[0].board&&X[0].board>20?W?(W.p(X,U),U&1&&Z(W,1)):(W=pf(X),W.c(),Z(W,1),W.m(n,w)):W&&(mt(),oe(W,1,1,()=>{W=null}),pt()),U&4&&(L.checked=X[2]);const se={};U&2&&(se.active=X[1]),y.$set(se)},i(X){S||(Z(v.$$.fragment,X),Z(W),Z(y.$$.fragment,X),S=!0)},o(X){oe(v.$$.fragment,X),oe(W),oe(y.$$.fragment,X),S=!1},d(X){X&&(M(e),M(H)),G&&G.d(),Me(v),W&&W.d(),Me(y,X),j=!1,Dt($)}}}function e_(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,s=!1;async function o(_){l(1,s=!0);const d=new FormData(_.target),m=new URLSearchParams;for(let b of d){const[w,k]=b;m.append(w,k)}let v=await(await fetch("save",{method:"POST",body:m})).json();l(1,s=!1),rl.update(b=>(b.vndcfg=v.success,b.booting=v.reboot,b.if.eth=b.boardType>240&&b.boardType<250,b)),on(n+(i.usrcfg?"":"setup"))}let r=!0;rl.subscribe(_=>{l(0,i=_),_.fwconsent===1&&l(2,r=!i.usrcfg)});function f(){i.board=jt(this),l(0,i)}function c(){r=this.checked,l(2,r)}return t.$$set=_=>{"basepath"in _&&l(4,n=_.basepath),"sysinfo"in _&&l(0,i=_.sysinfo)},[i,s,r,o,n,f,c]}class t_ extends Mt{constructor(e){super(),St(this,e,e_,x0,Ct,{basepath:4,sysinfo:0})}}function df(t,e,l){const n=t.slice();return n[13]=e[l],n}function hf(t,e,l){const n=t.slice();return n[16]=e[l],n}function vf(t){var i,s;let e,l=(((s=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:s.eth)??"Ethernet")+"",n;return{c(){e=p("option"),n=C(l),e.__value=3,V(e,e.__value)},m(o,r){T(o,e,r),a(e,n)},p(o,r){var f,c;r&4&&l!==(l=(((c=(f=o[2].conf)==null?void 0:f.connection)==null?void 0:c.eth)??"Ethernet")+"")&&q(n,l)},d(o){o&&M(e)}}}function bf(t){var A,L,O,N;let e,l=(((L=(A=t[2].conf)==null?void 0:A.connection)==null?void 0:L.ssid)??"SSID")+"",n,i,s,o,r,f,c=(((N=(O=t[2].conf)==null?void 0:O.connection)==null?void 0:N.psk)??"Password")+"",_,d,m,h,v;function b(D,E){return l_}let k=b()(t);return{c(){e=p("div"),n=C(l),i=g(),s=p("br"),o=g(),k.c(),r=g(),f=p("div"),_=C(c),d=p("br"),m=g(),h=p("input"),u(e,"class","my-3"),u(h,"name","sp"),u(h,"type","password"),u(h,"pattern",Wn),u(h,"class","in-s"),u(h,"autocomplete","off"),h.required=v=t[4]==2,u(f,"class","my-3")},m(D,E){T(D,e,E),a(e,n),a(e,i),a(e,s),a(e,o),k.m(e,null),T(D,r,E),T(D,f,E),a(f,_),a(f,d),a(f,m),a(f,h)},p(D,E){var F,H,y,S;E&4&&l!==(l=(((H=(F=D[2].conf)==null?void 0:F.connection)==null?void 0:H.ssid)??"SSID")+"")&&q(n,l),k.p(D,E),E&4&&c!==(c=(((S=(y=D[2].conf)==null?void 0:y.connection)==null?void 0:S.psk)??"Password")+"")&&q(_,c),E&16&&v!==(v=D[4]==2)&&(h.required=v)},d(D){D&&(M(e),M(r),M(f)),k.d()}}}function l_(t){var r;let e,l,n=((r=t[3])==null?void 0:r.c)==-1&&gf(t);function i(f,c){var _,d,m;if((d=(_=f[3])==null?void 0:_.n)!=null&&d.length)return i_;if(((m=f[3])==null?void 0:m.c)!=-1)return n_}let s=i(t),o=s&&s(t);return{c(){n&&n.c(),e=g(),o&&o.c(),l=yt()},m(f,c){n&&n.m(f,c),T(f,e,c),o&&o.m(f,c),T(f,l,c)},p(f,c){var _;((_=f[3])==null?void 0:_.c)==-1?n?n.p(f,c):(n=gf(f),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null),s===(s=i(f))&&o?o.p(f,c):(o&&o.d(1),o=s&&s(f),o&&(o.c(),o.m(l.parentNode,l)))},d(f){f&&(M(e),M(l)),n&&n.d(f),o&&o.d(f)}}}function gf(t){var i,s;let e,l=(((s=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:s.scanning)??"Scanning...")+"",n;return{c(){e=p("p"),n=C(l),u(e,"class","text-sm italic")},m(o,r){T(o,e,r),a(e,n)},p(o,r){var f,c;r&4&&l!==(l=(((c=(f=o[2].conf)==null?void 0:f.connection)==null?void 0:c.scanning)??"Scanning...")+"")&&q(n,l)},d(o){o&&M(e)}}}function n_(t){var i,s;let e,l=(((s=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:s.noNetworks)??"No networks found.")+"",n;return{c(){e=p("p"),n=C(l),u(e,"class","text-sm italic")},m(o,r){T(o,e,r),a(e,n)},p(o,r){var f,c;r&4&&l!==(l=(((c=(f=o[2].conf)==null?void 0:f.connection)==null?void 0:c.noNetworks)??"No networks found.")+"")&&q(n,l)},d(o){o&&M(e)}}}function i_(t){let e,l=[],n=new Map,i=tt(t[3].n);const s=o=>o[16].s;for(let o=0;ot[9].call(b)),u(_,"class","my-3"),u(H,"name","sh"),u(H,"type","text"),u(H,"class","in-s"),u(H,"maxlength","32"),u(H,"pattern",Gn),u(H,"placeholder","Optional, ex.: ams-reader"),u(H,"autocomplete","off"),u(S,"class","my-3"),u(W,"type","submit"),u(W,"class","btn-pri"),u(G,"class","my-3"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(J,fe){T(J,e,fe),a(e,l),a(l,n),a(n,i),a(n,s),a(n,o),a(o,f),a(n,c),a(n,_),a(_,m),a(_,h),a(_,v),a(_,b),a(b,w),a(w,A),ae&&ae.m(b,null),Xe(b,t[4],!0),a(n,L),le&&le.m(n,null),a(n,O),a(n,N),a(N,E),a(N,F),a(N,H),V(H,t[0].hostname),a(n,y),a(n,S),a(n,j),a(n,$),a(n,G),a(G,W),a(W,U),a(n,K),ne&&ne.m(n,null),T(J,se,fe),Se(x,J,fe),z=!0,ee||(ue=[re(b,"change",t[9]),re(H,"input",t[10]),re(n,"submit",mn(t[7]))],ee=!0)},p(J,[fe]){var me,pe,ke,ve,De,Ee,Oe,Le,st;(!z||fe&4)&&r!==(r=(((me=J[2].setup)==null?void 0:me.title)??"Setup")+"")&&q(f,r),(!z||fe&4)&&d!==(d=(((ke=(pe=J[2].conf)==null?void 0:pe.connection)==null?void 0:ke.title)??"Connection")+"")&&q(m,d),(!z||fe&4)&&k!==(k=(((De=(ve=J[2].conf)==null?void 0:ve.connection)==null?void 0:De.wifi)??"Connect to WiFi")+"")&&q(A,k),J[0].if&&J[0].if.eth?ae?ae.p(J,fe):(ae=vf(J),ae.c(),ae.m(b,null)):ae&&(ae.d(1),ae=null),fe&16&&Xe(b,J[4]),J[4]==1||J[4]==2?le?le.p(J,fe):(le=bf(J),le.c(),le.m(n,O)):le&&(le.d(1),le=null),(!z||fe&4)&&D!==(D=(((Oe=(Ee=J[2].conf)==null?void 0:Ee.general)==null?void 0:Oe.hostname)??"Hostname")+"")&&q(E,D),fe&1&&H.value!==J[0].hostname&&V(H,J[0].hostname),(!z||fe&4)&&X!==(X=(((Le=J[2].btn)==null?void 0:Le.save)??"Save")+"")&&q(U,X),J[6].length?ne?ne.p(J,fe):(ne=wf(J),ne.c(),ne.m(n,null)):ne&&(ne.d(1),ne=null);const ce={};fe&32&&(ce.active=J[5]),fe&4&&(ce.message=((st=J[2].setup)==null?void 0:st.mask)??"Lagrer"),x.$set(ce)},i(J){z||(Z(_e),Z(x.$$.fragment,J),z=!0)},o(J){oe(_e),oe(x.$$.fragment,J),z=!1},d(J){J&&(M(e),M(se)),ae&&ae.d(),le&&le.d(),ne&&ne.d(),Me(x,J),ee=!1,Dt(ue)}}}let o_=!1;function a_(t,e,l){let n=Sn,i={};wl.subscribe(b=>{l(2,i=b)});let s={};$i.subscribe(b=>{l(3,s=b)});let{sysinfo:o={}}=e,{data:r={}}=e,f=1,c=!1,_=[];function d(b){rl.update(w=>(w.trying=b,w))}async function m(b){l(5,c=!0);const w=new FormData(b.target),k=new URLSearchParams;for(let W of w){const[X,U]=W;k.append(X,U)}let L=await(await fetch("save",{method:"POST",body:k})).json();l(5,c=!1);const O=(w.get("sh")??"").trim(),D=(typeof L.message=="string"?L.message:"").split("|").map(W=>W.trim()),E=D[0]??"",F=D[1]??"",H=D[2]??"",y=E||O||o.hostname||(o!=null&&o.chipId?`ams-${o.chipId}`:"ams-reader"),S=F||(y&&y.indexOf(".")===-1&&y.indexOf(":")===-1?`${y}.local`:y),j=H,$=Array.from(new Set([j,y,S].filter(W=>W&&W.length>0)));l(6,_=L.reboot?[...$]:[]),rl.update(W=>{W.net||(W.net={});const X=y||W.hostname||O;return W.hostname=X,H&&(W.net.ip=H),W.targets=[...$],W.usrcfg=L.success,W.booting=L.reboot,W});const G=nn(rl);l(0,o=G),L.reboot&&setTimeout(()=>cn(G,d),5e3)}function h(){f=jt(this),l(4,f)}function v(){o.hostname=this.value,l(0,o)}return t.$$set=b=>{"sysinfo"in b&&l(0,o=b.sysinfo),"data"in b&&l(8,r=b.data)},t.$$.update=()=>{if(t.$$.dirty&256){const b=r==null?void 0:r.r;typeof b=="number"&&(b>=-50?l(1,n=ts):b>=-60?l(1,n=es):b>=-75?l(1,n=xi):l(1,n=Sn))}},[o,n,i,s,f,c,_,m,r,h,v]}class f_ extends Mt{constructor(e){super(),St(this,e,a_,s_,Ct,{sysinfo:0,data:8})}}function u_(t){var y,S,j,$;let e,l,n,i=(((y=t[2].upload)==null?void 0:y.title)??"Upload")+"",s,o,r,f,c,_=(((S=t[2].upload)==null?void 0:S.desc)??"")+"",d,m,h,v,b,w,k,A,L=(((j=t[2].btn)==null?void 0:j.upload)??"Upload")+"",O,N,D,E,F,H;return D=new _l({props:{active:t[3],message:(($=t[2].upload)==null?void 0:$.mask)??"Uploading"}}),{c(){e=p("div"),l=p("div"),n=p("strong"),s=C(i),o=g(),r=C(t[1]),f=g(),c=p("p"),d=C(_),m=g(),h=p("form"),v=p("input"),b=g(),w=p("div"),k=p("button"),A=p("p"),O=C(L),N=g(),Ne(D.$$.fragment),u(c,"class","mb-4"),u(v,"name","file"),u(v,"type","file"),u(A,"class","mb-4"),u(k,"type","submit"),u(k,"class","btn-pri"),u(w,"class","w-full text-right mt-4"),u(h,"action",t[0]),u(h,"enctype","multipart/form-data"),u(h,"method","post"),u(h,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(G,W){T(G,e,W),a(e,l),a(l,n),a(n,s),a(n,o),a(n,r),a(l,f),a(l,c),a(c,d),a(l,m),a(l,h),a(h,v),a(h,b),a(h,w),a(w,k),a(k,A),a(A,O),T(G,N,W),Se(D,G,W),E=!0,F||(H=re(h,"submit",t[4]),F=!0)},p(G,[W]){var U,K,se,x;(!E||W&4)&&i!==(i=(((U=G[2].upload)==null?void 0:U.title)??"Upload")+"")&&q(s,i),(!E||W&2)&&q(r,G[1]),(!E||W&4)&&_!==(_=(((K=G[2].upload)==null?void 0:K.desc)??"")+"")&&q(d,_),(!E||W&4)&&L!==(L=(((se=G[2].btn)==null?void 0:se.upload)??"Upload")+"")&&q(O,L),(!E||W&1)&&u(h,"action",G[0]);const X={};W&8&&(X.active=G[3]),W&4&&(X.message=((x=G[2].upload)==null?void 0:x.mask)??"Uploading"),D.$set(X)},i(G){E||(Z(D.$$.fragment,G),E=!0)},o(G){oe(D.$$.fragment,G),E=!1},d(G){G&&(M(e),M(N)),Me(D,G),F=!1,H()}}}function r_(t,e,l){let{action:n}=e,{title:i}=e,s={};wl.subscribe(f=>{l(2,s=f)});let o=!1;const r=()=>l(3,o=!0);return t.$$set=f=>{"action"in f&&l(0,n=f.action),"title"in f&&l(1,i=f.title)},[n,i,s,o,r]}class ss extends Mt{constructor(e){super(),St(this,e,r_,u_,Ct,{action:0,title:1})}}function c_(t){var te,ie,be,we,I,P,B;let e,l,n,i,s=(((te=t[1].consent)==null?void 0:te.title)??"Consents")+"",o,r,f,c,_,d=(((ie=t[1].consent)==null?void 0:ie.one_click)??"One-click")+"",m,h,v,b,w=(((be=t[1].consent)==null?void 0:be.read_more)??"Read more")+"",k,A,L,O,N,D,E,F=(((we=t[1].consent)==null?void 0:we.yes)??"Yes")+"",H,y,S,j,$,G,W=(((I=t[1].consent)==null?void 0:I.no)??"No")+"",X,U,K,se,x,z=(((P=t[1].btn)==null?void 0:P.save)??"Save")+"",ee,ue,ae,le,_e,ne;return ae=new _l({props:{active:t[2],message:((B=t[1].consent)==null?void 0:B.mask_saving)??"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("div"),o=C(s),r=g(),f=p("hr"),c=g(),_=p("div"),m=C(d),h=p("br"),v=g(),b=p("a"),k=C(w),A=p("br"),L=g(),O=p("label"),N=p("input"),E=g(),H=C(F),y=g(),S=p("label"),j=p("input"),G=g(),X=C(W),U=p("br"),K=g(),se=p("div"),x=p("button"),ee=C(z),ue=g(),Ne(ae.$$.fragment),u(b,"href",vl("Data-collection-on-one-click-firmware-upgrade")),u(b,"target","_blank"),u(b,"class","text-blue-600 hover:text-blue-800"),u(N,"type","radio"),u(N,"name","sf"),N.value=1,N.checked=D=t[0].fwconsent===1,u(N,"class","rounded m-2"),N.required=!0,u(j,"type","radio"),u(j,"name","sf"),j.value=2,j.checked=$=t[0].fwconsent===2,u(j,"class","rounded m-2"),j.required=!0,u(_,"class","my-3"),u(x,"type","submit"),u(x,"class","btn-pri"),u(se,"class","my-3"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(R,Y){T(R,e,Y),a(e,l),a(l,n),a(n,i),a(i,o),a(n,r),a(n,f),a(n,c),a(n,_),a(_,m),a(_,h),a(_,v),a(_,b),a(b,k),a(_,A),a(_,L),a(_,O),a(O,N),a(O,E),a(O,H),a(_,y),a(_,S),a(S,j),a(S,G),a(S,X),a(_,U),a(n,K),a(n,se),a(se,x),a(x,ee),T(R,ue,Y),Se(ae,R,Y),le=!0,_e||(ne=re(n,"submit",mn(t[3])),_e=!0)},p(R,[Y]){var fe,ce,me,pe,ke,ve,De;(!le||Y&2)&&s!==(s=(((fe=R[1].consent)==null?void 0:fe.title)??"Consents")+"")&&q(o,s),(!le||Y&2)&&d!==(d=(((ce=R[1].consent)==null?void 0:ce.one_click)??"One-click")+"")&&q(m,d),(!le||Y&2)&&w!==(w=(((me=R[1].consent)==null?void 0:me.read_more)??"Read more")+"")&&q(k,w),(!le||Y&1&&D!==(D=R[0].fwconsent===1))&&(N.checked=D),(!le||Y&2)&&F!==(F=(((pe=R[1].consent)==null?void 0:pe.yes)??"Yes")+"")&&q(H,F),(!le||Y&1&&$!==($=R[0].fwconsent===2))&&(j.checked=$),(!le||Y&2)&&W!==(W=(((ke=R[1].consent)==null?void 0:ke.no)??"No")+"")&&q(X,W),(!le||Y&2)&&z!==(z=(((ve=R[1].btn)==null?void 0:ve.save)??"Save")+"")&&q(ee,z);const J={};Y&4&&(J.active=R[2]),Y&2&&(J.message=((De=R[1].consent)==null?void 0:De.mask_saving)??"Saving"),ae.$set(J)},i(R){le||(Z(ae.$$.fragment,R),le=!0)},o(R){oe(ae.$$.fragment,R),le=!1},d(R){R&&(M(e),M(ue)),Me(ae,R),_e=!1,ne()}}}function __(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,s={};wl.subscribe(f=>{l(1,s=f)});let o=!1;async function r(f){l(2,o=!0);const c=new FormData(f.target),_=new URLSearchParams;for(let h of c){const[v,b]=h;_.append(v,b)}let m=await(await fetch("save",{method:"POST",body:_})).json();l(2,o=!1),rl.update(h=>(h.fwconsent=c.sf===!0?1:c.sf===!1?2:0,h.booting=m.reboot,h)),on(n)}return t.$$set=f=>{"basepath"in f&&l(4,n=f.basepath),"sysinfo"in f&&l(0,i=f.sysinfo)},[i,s,o,r,n]}class m_ extends Mt{constructor(e){super(),St(this,e,__,c_,Ct,{basepath:4,sysinfo:0})}}function Sf(t,e,l){const n=t.slice();return n[30]=e[l],n[31]=e,n[32]=l,n}function Mf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function p_(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Nf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function d_(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Tf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Pf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Ef(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function qf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Df(t){let e,l=tt(t[1].o),n=[];for(let i=0;i0?"text-green-600":"text-gray-300"),u(lt,"class",Be=t[32]{l(0,i=U)});let s=["mo","tu","we","th","fr","sa","su"],o={},r=!0,f=!1;Fu.subscribe(U=>{U.o&&(l(1,o=U),l(2,r=!1))}),Zc();async function c(U){l(3,f=!0);const K=new URLSearchParams;K.append("r","true"),K.append("rc",o.o.length),o.o.forEach(function(x,z){K.append("rt"+z,x.t),K.append("rn"+z,x.n),K.append("rd"+z,x.d),K.append("ra"+z,x.a),K.append("rh"+z,x.h),K.append("rv"+z,x.v),K.append("rsm"+z,x.s.m),K.append("rsd"+z,x.s.d),K.append("rem"+z,x.e.m),K.append("red"+z,x.e.d)}),await(await fetch("save",{method:"POST",body:K})).json(),l(3,f=!1),on(n+"configuration")}let _=function(U,K){return U.includes(K)?U=U.filter(function(se){return se!==K}):U.push(K),U},d=function(){let U=o.o;U.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.001,s:{m:0,d:0},e:{m:0,d:0}}),l(1,o.o=U,o)},m=function(U){let K=o.o;K.splice(U,1),l(1,o.o=K,o)},h=function(U){if(U<=0)return;let K=o.o;var se=K[U];K[U]=K[U-1],K[U-1]=se,l(1,o.o=K,o)},v=function(U){let K=o.o;if(!(U>=K.length-1)){var se=K[U];K[U]=K[U+1],K[U+1]=se,l(1,o.o=K,o)}};function b(U,K){U[K].n=this.value,l(1,o)}function w(U,K){U[K].d=jt(this),l(1,o)}function k(U,K){U[K].t=jt(this),l(1,o)}function A(U,K){U[K].v=ye(this.value),l(1,o)}const L=(U,K,se,x)=>l(1,se[x].a=_(U.a,K),o),O=(U,K,se,x)=>l(1,se[x].h=_(U.h,K),o),N=(U,K,se,x)=>l(1,se[x].h=_(U.h,K+8),o),D=(U,K,se,x)=>l(1,se[x].h=_(U.h,K+16),o);function E(U,K){U[K].s.d=jt(this),l(1,o)}function F(U,K){U[K].s.m=jt(this),l(1,o)}function H(U,K){U[K].e.d=jt(this),l(1,o)}function y(U,K){U[K].e.m=jt(this),l(1,o)}const S=U=>h(U),j=U=>h(U),$=U=>v(U),G=U=>v(U),W=U=>m(U),X=U=>m(U);return t.$$set=U=>{"basepath"in U&&l(11,n=U.basepath)},[i,o,r,f,s,c,_,d,m,h,v,n,b,w,k,A,L,O,N,D,E,F,H,y,S,j,$,G,W,X]}class k_ extends Mt{constructor(e){super(),St(this,e,g_,b_,Ct,{basepath:11},null,[-1,-1])}}function Bf(t,e,l){const n=t.slice();return n[13]=e[l],n[14]=e,n[15]=l,n}function yf(t,e,l){const n=t.slice();return n[13]=e[l],n[16]=e,n[17]=l,n}function jf(t){let e,l,n,i=tt(t[1]),s=[];for(let o=0;o{l(3,r=w)});let f=!1,c,_;async function d(){if(confirm("Clear all data?"))for(let w in i)(w.startsWith("i")||w.startsWith("e"))&&l(0,i[w]=0,i)}let m=!1;async function h(w){l(5,m=!0);const k=new FormData(w.target),A=new URLSearchParams;for(let O of k){const[N,D]=O;A.append(N,D)}await(await fetch(s,{method:"POST",body:A})).json(),l(5,m=!1),on(o)}function v(w){i[w.key]=ye(this.value),l(0,i)}function b(w){i[w.key]=ye(this.value),l(0,i)}return t.$$set=w=>{"prefix"in w&&l(8,n=w.prefix),"data"in w&&l(0,i=w.data),"url"in w&&l(9,s=w.url),"basepath"in w&&l(10,o=w.basepath)},t.$$.update=()=>{if(t.$$.dirty&263){l(1,c=[]),l(2,_=[]);for(let w in i){let k=[];w.startsWith("i")?k=c:w.startsWith("e")&&(k=_,i[w]&&l(4,f=!0)),k.push({key:w,name:n+" "+w.substring(1),value:i[w]})}}},[i,c,_,r,f,m,d,h,n,s,o,v,b]}class Bu extends Mt{constructor(e){super(),St(this,e,C_,w_,Ct,{prefix:8,data:0,url:9,basepath:10})}}function S_(t){let e,l;return e=new Xc({props:{data:t[6],sysinfo:t[7],prices:t[1],dayPlot:t[2],monthPlot:t[3],temperatures:t[4],translations:t[5],tariffData:t[8]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&64&&(s.data=n[6]),i&128&&(s.sysinfo=n[7]),i&2&&(s.prices=n[1]),i&4&&(s.dayPlot=n[2]),i&8&&(s.monthPlot=n[3]),i&16&&(s.temperatures=n[4]),i&32&&(s.translations=n[5]),i&256&&(s.tariffData=n[8]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function M_(t){let e,l;return e=new U0({props:{sysinfo:t[7],basepath:t[0],data:t[6]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.sysinfo=n[7]),i&1&&(s.basepath=n[0]),i&64&&(s.data=n[6]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function N_(t){let e,l;return e=new k_({props:{basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function T_(t){let e,l;return e=new Q0({props:{sysinfo:t[7],data:t[6]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.sysinfo=n[7]),i&64&&(s.data=n[6]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function P_(t){let e,l;return e=new ss({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p:Ve,i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function E_(t){let e,l;return e=new ss({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p:Ve,i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function q_(t){let e,l;return e=new ss({props:{title:"private key",action:"/mqtt-key"}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p:Ve,i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function D_(t){let e,l;return e=new m_({props:{sysinfo:t[7],basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.sysinfo=n[7]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function A_(t){let e,l;return e=new f_({props:{sysinfo:t[7],data:t[6]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.sysinfo=n[7]),i&64&&(s.data=n[6]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function O_(t){let e,l;return e=new t_({props:{sysinfo:t[7],basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.sysinfo=n[7]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function L_(t){let e,l;return e=new Bu({props:{prefix:"UTC Hour",data:t[2],url:"/dayplot",basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&4&&(s.data=n[2]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function I_(t){let e,l;return e=new Bu({props:{prefix:"Day",data:t[3],url:"/monthplot",basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&8&&(s.data=n[3]),i&1&&(s.basepath=n[0]),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function R_(t){let e,l,n,i,s,o,r,f,c,_,d,m,h,v,b,w,k,A,L,O,N,D,E,F,H,y;return e=new J1({props:{data:t[6],basepath:t[0]}}),n=new bl({props:{path:"/",$$slots:{default:[S_]},$$scope:{ctx:t}}}),s=new bl({props:{path:"/configuration",$$slots:{default:[M_]},$$scope:{ctx:t}}}),r=new bl({props:{path:"/priceconfig",$$slots:{default:[N_]},$$scope:{ctx:t}}}),c=new bl({props:{path:"/status",$$slots:{default:[T_]},$$scope:{ctx:t}}}),d=new bl({props:{path:"/mqtt-ca",$$slots:{default:[P_]},$$scope:{ctx:t}}}),h=new bl({props:{path:"/mqtt-cert",$$slots:{default:[E_]},$$scope:{ctx:t}}}),b=new bl({props:{path:"/mqtt-key",$$slots:{default:[q_]},$$scope:{ctx:t}}}),k=new bl({props:{path:"/consent",$$slots:{default:[D_]},$$scope:{ctx:t}}}),L=new bl({props:{path:"/setup",$$slots:{default:[A_]},$$scope:{ctx:t}}}),N=new bl({props:{path:"/vendor",$$slots:{default:[O_]},$$scope:{ctx:t}}}),E=new bl({props:{path:"/edit-day",$$slots:{default:[L_]},$$scope:{ctx:t}}}),H=new bl({props:{path:"/edit-month",$$slots:{default:[I_]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment),l=g(),Ne(n.$$.fragment),i=g(),Ne(s.$$.fragment),o=g(),Ne(r.$$.fragment),f=g(),Ne(c.$$.fragment),_=g(),Ne(d.$$.fragment),m=g(),Ne(h.$$.fragment),v=g(),Ne(b.$$.fragment),w=g(),Ne(k.$$.fragment),A=g(),Ne(L.$$.fragment),O=g(),Ne(N.$$.fragment),D=g(),Ne(E.$$.fragment),F=g(),Ne(H.$$.fragment)},m(S,j){Se(e,S,j),T(S,l,j),Se(n,S,j),T(S,i,j),Se(s,S,j),T(S,o,j),Se(r,S,j),T(S,f,j),Se(c,S,j),T(S,_,j),Se(d,S,j),T(S,m,j),Se(h,S,j),T(S,v,j),Se(b,S,j),T(S,w,j),Se(k,S,j),T(S,A,j),Se(L,S,j),T(S,O,j),Se(N,S,j),T(S,D,j),Se(E,S,j),T(S,F,j),Se(H,S,j),y=!0},p(S,j){const $={};j&64&&($.data=S[6]),j&1&&($.basepath=S[0]),e.$set($);const G={};j&2558&&(G.$$scope={dirty:j,ctx:S}),n.$set(G);const W={};j&2241&&(W.$$scope={dirty:j,ctx:S}),s.$set(W);const X={};j&2049&&(X.$$scope={dirty:j,ctx:S}),r.$set(X);const U={};j&2240&&(U.$$scope={dirty:j,ctx:S}),c.$set(U);const K={};j&2048&&(K.$$scope={dirty:j,ctx:S}),d.$set(K);const se={};j&2048&&(se.$$scope={dirty:j,ctx:S}),h.$set(se);const x={};j&2048&&(x.$$scope={dirty:j,ctx:S}),b.$set(x);const z={};j&2177&&(z.$$scope={dirty:j,ctx:S}),k.$set(z);const ee={};j&2240&&(ee.$$scope={dirty:j,ctx:S}),L.$set(ee);const ue={};j&2177&&(ue.$$scope={dirty:j,ctx:S}),N.$set(ue);const ae={};j&2053&&(ae.$$scope={dirty:j,ctx:S}),E.$set(ae);const le={};j&2057&&(le.$$scope={dirty:j,ctx:S}),H.$set(le)},i(S){y||(Z(e.$$.fragment,S),Z(n.$$.fragment,S),Z(s.$$.fragment,S),Z(r.$$.fragment,S),Z(c.$$.fragment,S),Z(d.$$.fragment,S),Z(h.$$.fragment,S),Z(b.$$.fragment,S),Z(k.$$.fragment,S),Z(L.$$.fragment,S),Z(N.$$.fragment,S),Z(E.$$.fragment,S),Z(H.$$.fragment,S),y=!0)},o(S){oe(e.$$.fragment,S),oe(n.$$.fragment,S),oe(s.$$.fragment,S),oe(r.$$.fragment,S),oe(c.$$.fragment,S),oe(d.$$.fragment,S),oe(h.$$.fragment,S),oe(b.$$.fragment,S),oe(k.$$.fragment,S),oe(L.$$.fragment,S),oe(N.$$.fragment,S),oe(E.$$.fragment,S),oe(H.$$.fragment,S),y=!1},d(S){S&&(M(l),M(i),M(o),M(f),M(_),M(m),M(v),M(w),M(A),M(O),M(D),M(F)),Me(e,S),Me(n,S),Me(s,S),Me(r,S),Me(c,S),Me(d,S),Me(h,S),Me(b,S),Me(k,S),Me(L,S),Me(N,S),Me(E,S),Me(H,S)}}}function Gf(t){let e,l,n,i;const s=[U_,F_],o=[];function r(f,c){return f[7].trying?0:1}return e=r(t),l=o[e]=s[e](t),{c(){l.c(),n=yt()},m(f,c){o[e].m(f,c),T(f,n,c),i=!0},p(f,c){let _=e;e=r(f),e===_?o[e].p(f,c):(mt(),oe(o[_],1,1,()=>{o[_]=null}),pt(),l=o[e],l?l.p(f,c):(l=o[e]=s[e](f),l.c()),Z(l,1),l.m(n.parentNode,n))},i(f){i||(Z(l),i=!0)},o(f){oe(l),i=!1},d(f){f&&M(n),o[e].d(f)}}}function F_(t){let e,l;return e=new _l({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p:Ve,i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function U_(t){let e,l;return e=new _l({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[7].trying}}),{c(){Ne(e.$$.fragment)},m(n,i){Se(e,n,i),l=!0},p(n,i){const s={};i&128&&(s.message="Device is booting, please wait. Trying to reach it on "+n[7].trying),e.$set(s)},i(n){l||(Z(e.$$.fragment,n),l=!0)},o(n){oe(e.$$.fragment,n),l=!1},d(n){Me(e,n)}}}function B_(t){let e,l,n,i;l=new vu({props:{basepath:t[0],$$slots:{default:[R_]},$$scope:{ctx:t}}});let s=t[7].booting&&Gf(t);return{c(){e=p("div"),Ne(l.$$.fragment),n=g(),s&&s.c(),u(e,"class","container mx-auto m-3")},m(o,r){T(o,e,r),Se(l,e,null),a(e,n),s&&s.m(e,null),i=!0},p(o,[r]){const f={};r&1&&(f.basepath=o[0]),r&2559&&(f.$$scope={dirty:r,ctx:o}),l.$set(f),o[7].booting?s?(s.p(o,r),r&128&&Z(s,1)):(s=Gf(o),s.c(),Z(s,1),s.m(e,null)):s&&(mt(),oe(s,1,1,()=>{s=null}),pt())},i(o){i||(Z(l.$$.fragment,o),Z(s),i=!0)},o(o){oe(l.$$.fragment,o),oe(s),i=!1},d(o){o&&M(e),Me(l),s&&s.d()}}}function y_(t,e,l){let n=document.getElementsByTagName("base")[0].getAttribute("href");n||(n="/");let i;Ji.subscribe(v=>{l(1,i=v)});let s;Tu.subscribe(v=>{l(2,s=v)});let o;Pu.subscribe(v=>{l(3,o=v)});let r;Eu.subscribe(v=>{l(4,r=v)});let f={};wl.subscribe(v=>{l(5,f=v)});let c,_={},d={},m;rl.subscribe(v=>{var b;l(7,d=v),d.vndcfg===!1?on(n+"vendor"):d.usrcfg===!1?on(n+"setup"):d.fwconsent===0&&on(n+"consent"),d.ui.k===1?document.documentElement.classList.add("dark"):d.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"),d.ui.lang&&d.ui.lang!=((b=f==null?void 0:f.language)==null?void 0:b.code)&&Au(d.ui.lang),d.version&&m&&d.version!=m&&window.location.reload(),m=d.version,c&&clearTimeout(c),c=setTimeout(ci,!_||!_.u||_.u<30||d!=null&&d.upgrading?1e4:3e5)}),b1.subscribe(v=>{l(6,_=v),Bc(v)});let h={};return Du.subscribe(v=>{l(8,h=v)}),qu(),[n,i,s,o,r,f,_,d,h]}class j_ extends Mt{constructor(e){super(),St(this,e,y_,B_,Ct,{})}}new j_({target:document.getElementById("app")}); diff --git a/lib/SvelteUi/app/src/lib/Helpers.js b/lib/SvelteUi/app/src/lib/Helpers.js index 5a35941f..833c0619 100644 --- a/lib/SvelteUi/app/src/lib/Helpers.js +++ b/lib/SvelteUi/app/src/lib/Helpers.js @@ -162,41 +162,77 @@ export function getPriceSourceUrl(code) { let tries = 0; export function scanForDevice(sysinfo, updateFn) { - var url = ""; tries++; - var retry = function() { + const targets = buildScanTargets(sysinfo); + if(!targets.length) { + if(updateFn) updateFn(""); + setTimeout(scanForDevice, 1500, sysinfo, updateFn); + return; + } + + const target = targets[(tries - 1) % targets.length]; + if(!target) { + setTimeout(scanForDevice, 1000, sysinfo, updateFn); + return; + } + + const url = normalizeTarget(target); + if(console) console.log("Trying url " + url); + if(updateFn) updateFn(url); + + const retry = function() { setTimeout(scanForDevice, 1000, sysinfo, updateFn); }; - if(sysinfo.net.ip && tries%3 == 0) { - if(!sysinfo.net.ip) { - retry(); - return; - }; - url = "http://" + sysinfo.net.ip; - } else if(sysinfo.hostname && tries%3 == 1) { - url = "http://" + sysinfo.hostname; - } else if(sysinfo.hostname && tries%3 == 2) { - url = "http://" + sysinfo.hostname + ".local"; - } else { - url = ""; - } - if(console) console.log("Trying url " + url); - if(updateFn) updateFn(url); - - var xhr = new XMLHttpRequest(); + const xhr = new XMLHttpRequest(); xhr.timeout = 5000; xhr.addEventListener('abort', retry); xhr.addEventListener('error', retry); xhr.addEventListener('timeout', retry); - xhr.addEventListener('load', function(e) { + xhr.addEventListener('load', function() { window.location.href = url ? url : "/"; }); - xhr.open("GET", url + "/is-alive", true); + const healthUrl = url.replace(/\/$/, '') + "/is-alive"; + xhr.open("GET", healthUrl, true); xhr.send(); }; +function buildScanTargets(sysinfo = {}) { + const manualTargets = Array.isArray(sysinfo.targets) ? sysinfo.targets : []; + const fallbackTargets = []; + + if(sysinfo.net && sysinfo.net.ip) { + fallbackTargets.push(sysinfo.net.ip); + } + if(sysinfo.hostname) { + fallbackTargets.push(sysinfo.hostname); + const looksLikeHost = sysinfo.hostname.indexOf('.') === -1 && sysinfo.hostname.indexOf(':') === -1; + if(looksLikeHost) { + fallbackTargets.push(`${sysinfo.hostname}.local`); + } + } + + const candidates = [...manualTargets, ...fallbackTargets]; + const deduped = []; + for(const value of candidates) { + if(!value) continue; + const trimmed = value.toString().trim(); + if(!trimmed) continue; + if(!deduped.includes(trimmed)) deduped.push(trimmed); + } + return deduped; +} + +function normalizeTarget(target) { + if(!target) return ""; + const trimmed = target.toString().trim(); + if(trimmed.startsWith("http://") || trimmed.startsWith("https://")) { + return trimmed; + } + return `http://${trimmed}`; +} + export function capitalize(s) { return s.charAt(0).toUpperCase() + s.slice(1); } diff --git a/lib/SvelteUi/app/src/lib/SetupPanel.svelte b/lib/SvelteUi/app/src/lib/SetupPanel.svelte index 0c9a9864..15eec47f 100644 --- a/lib/SvelteUi/app/src/lib/SetupPanel.svelte +++ b/lib/SvelteUi/app/src/lib/SetupPanel.svelte @@ -1,5 +1,6 @@