diff --git a/.github/workflows/localazy.yml b/.github/workflows/localazy.yml new file mode 100644 index 00000000..d3d0bed9 --- /dev/null +++ b/.github/workflows/localazy.yml @@ -0,0 +1,41 @@ +name: Deploy language files from localazy + +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Check out code from repo + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.x' + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-north-1 + + - name: Generate localazy-keys.json + run: | + echo '{"writeKey": "", "readKey": "${{secrets.LOCALAZY_READ_KEY}}"}' > localazy/localazy-keys.json + + - name: Create localazy language folder + run: mkdir -p localazy/language + + - name: Install Localazy CLI + run: npm install -g @localazy/cli + + - name: Download translations + working-directory: localazy + run: localazy download -k localazy-keys.json + + - name: Upload translations to S3 + run: aws s3 sync ./localazy/language/ s3://amscloud-private/language/ diff --git a/.gitignore b/.gitignore index f843197a..b32f8837 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ platformio-user.ini node_modules /gui/dist /scripts/*dev +localazy-keys.json +localazy/language diff --git a/doc/Poland/Stoen/HAN_Interface_Stoen_Operator_EN.pdf b/doc/Poland/Stoen/HAN_Interface_Stoen_Operator_EN.pdf new file mode 100644 index 00000000..519527f1 Binary files /dev/null and b/doc/Poland/Stoen/HAN_Interface_Stoen_Operator_EN.pdf differ diff --git a/doc/Poland/Stoen/interfejs-sieci-han-w-stoen-operator-v1-0-1.pdf b/doc/Poland/Stoen/interfejs-sieci-han-w-stoen-operator-v1-0-1.pdf new file mode 100644 index 00000000..cafee405 Binary files /dev/null and b/doc/Poland/Stoen/interfejs-sieci-han-w-stoen-operator-v1-0-1.pdf differ diff --git a/doc/Poland/Stoen/model-obiektow-dla-licznikow-bezposrednich-plc-v2.0.pdf b/doc/Poland/Stoen/model-obiektow-dla-licznikow-bezposrednich-plc-v2.0.pdf new file mode 100644 index 00000000..2dc158e5 Binary files /dev/null and b/doc/Poland/Stoen/model-obiektow-dla-licznikow-bezposrednich-plc-v2.0.pdf differ diff --git a/doc/Poland/Stoen/opis-dziennikow-zdarzen-oraz-lista-kodow-zdarzen-v1-0.pdf b/doc/Poland/Stoen/opis-dziennikow-zdarzen-oraz-lista-kodow-zdarzen-v1-0.pdf new file mode 100644 index 00000000..647f032e Binary files /dev/null and b/doc/Poland/Stoen/opis-dziennikow-zdarzen-oraz-lista-kodow-zdarzen-v1-0.pdf differ diff --git a/doc/Poland/Stoen/opis-profili-rejestrowane-kody-obis-v1-0-2.pdf b/doc/Poland/Stoen/opis-profili-rejestrowane-kody-obis-v1-0-2.pdf new file mode 100644 index 00000000..fe3fd09c Binary files /dev/null and b/doc/Poland/Stoen/opis-profili-rejestrowane-kody-obis-v1-0-2.pdf differ diff --git a/doc/Poland/Stoen/placeholder.txt b/doc/Poland/Stoen/placeholder.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/doc/Poland/Stoen/placeholder.txt @@ -0,0 +1 @@ + diff --git a/frames/KamstrupOmnipower_Bornholm_DK_5digitVoltage_9sep25.log b/frames/KamstrupOmnipower_Bornholm_DK_5digitVoltage_9sep25.log new file mode 100644 index 00000000..093ecc0e --- /dev/null +++ b/frames/KamstrupOmnipower_Bornholm_DK_5digitVoltage_9sep25.log @@ -0,0 +1,1375 @@ +*** Remote debug - over telnet - for ESP32 - version 3.0.5 +* Host name: ams-c6d8 IP:192.168.10.59 Mac address:58:CF:79:A1:D8:C6 +* Free Heap RAM: 110380 +* ESP SDK version: 4.4.5.230722 +****************************************************** +* Commands: + ? or help -> display these help of commands + q -> quit (close this connection) + m -> display memory available + v -> set debug level to verbose + d -> set debug level to debug + i -> set debug level to info + w -> set debug level to warning + e -> set debug level to errors + s -> set debug silence on/off + l -> show debug level + t -> show time (millis) + profiler: + p -> show time between actual and last message (in millis) + p min -> show only if time is this minimal + P time -> set debug level to profiler + c -> show colors + filter: + filter -> show only debugs with this + nofilter -> disable the filter +* Please type the command and press enter to execute.(? or h for this help) +*** +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 66 6D C6 58 +(V) EE A9 09 B2 79 6B 64 6A A7 13 D7 C7 EA 84 62 48 +(V) AA E6 58 46 07 82 32 31 74 D1 29 A0 F1 B0 97 0E +(V) C4 96 D2 05 0F 53 08 9F 90 D2 35 10 10 03 B5 00 +(V) 2B 5D C3 C0 09 1F 2E 8F B0 FB 77 8F B5 70 62 D5 +(V) 24 04 2B 0D A5 C1 95 DB F5 32 31 A6 89 D2 5B DB +(V) 62 22 FF 78 05 71 B1 AD 4D D6 6E 55 19 68 F1 87 +(V) A1 CE F8 D6 F1 C9 B4 DE 6F 47 0F E5 61 20 46 AF +(V) 9A 1D 3F 69 4F 8B 4E 5F 54 B3 AE DD D9 53 25 3A +(V) 11 4E 82 1B 10 5C B1 55 F6 65 BB 26 8E 64 EF E5 +(V) B0 18 71 1E C4 B5 D8 6A 95 05 67 8C E2 9E A2 82 +(V) B0 46 A9 B6 0C 3A 7D 57 96 DD 36 1D 5C 90 1E CD +(V) B9 F1 FD 51 BC EE 66 4F 1A 30 7D 88 01 77 D8 D1 +(V) 62 1A 31 E9 3E DA E0 17 16 56 DD 15 3B 3B 0C 37 +(V) C3 79 89 87 FB B2 01 BA EC CC A2 6D B3 41 1E B8 +(V) 66 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 66 6D C6 58 EE A9 09 B2 79 6B 64 6A +(V) A7 13 D7 C7 EA 84 62 48 AA E6 58 46 07 82 32 31 +(V) 74 D1 29 A0 F1 B0 97 0E C4 96 D2 05 0F 53 08 9F +(V) 90 D2 35 10 10 03 B5 00 2B 5D C3 C0 09 1F 2E 8F +(V) B0 FB 77 8F B5 70 62 D5 24 04 2B 0D A5 C1 95 DB +(V) F5 32 31 A6 89 D2 5B DB 62 22 FF 78 05 71 B1 AD +(V) 4D D6 6E 55 19 68 F1 87 A1 CE F8 D6 F1 C9 B4 DE +(V) 6F 47 0F E5 61 20 46 AF 9A 1D 3F 69 4F 8B 4E 5F +(V) 54 B3 AE DD D9 53 25 3A 11 4E 82 1B 10 5C B1 55 +(V) F6 65 BB 26 8E 64 EF E5 B0 18 71 1E C4 B5 D8 6A +(V) 95 05 67 8C E2 9E A2 82 B0 46 A9 B6 0C 3A 7D 57 +(V) 96 DD 36 1D 5C 90 1E CD B9 F1 FD 51 BC EE 66 4F +(V) 1A 30 7D 88 01 77 D8 D1 62 1A 31 E9 3E DA E0 17 +(V) 16 56 DD 15 3B 3B 0C 37 C3 79 89 87 FB B2 01 BA +(V) EC CC A2 6D B3 41 1E +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 66 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 00 +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 51 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 AA +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 FC 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 14 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 +(V) 56 B7 09 06 01 01 34 07 00 FF 12 57 2A 09 06 01 +(V) 01 48 07 00 FF 12 57 31 87 FB B2 01 BA EC CC A2 +(V) 6D B3 41 1E +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 00 FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 51 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 AA 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 FC 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 14 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 56 B7 +(V) 09 06 01 01 34 07 00 FF 12 57 2A 09 06 01 01 48 +(V) 07 00 FF 12 57 31 +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 51 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 AA 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 FC 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 14 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 24 09 06 01 01 20 07 00 FF 12 56 B7 09 06 +(V) 01 01 34 07 00 FF 12 57 2A 09 06 01 01 48 07 00 +(V) FF 12 57 31 +(V) DLMS +(D) NOT Ready to update (internal clock 13:11:02 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 67 B4 04 4A +(V) 0E 51 3B 6A 2E C2 27 66 64 E8 D4 32 6C 17 98 2D +(V) 15 C6 A1 7F BD 62 51 B5 2C B7 F4 12 D3 A7 2B 80 +(V) AA 1C C0 FD 32 B8 F0 A4 CF E9 56 E2 08 3F DB AF +(V) 66 B7 B0 D7 B2 31 AE 8D AD B2 08 14 63 29 FA 55 +(V) 45 D7 3C 09 AF 67 D8 11 47 53 1E AD 9A F1 A2 BA +(V) 14 B5 28 D5 59 26 EC 8A E7 82 3A 02 41 FE 0E B1 +(V) EF B9 2B 6F 95 99 56 BE FC E8 27 74 7F 32 A5 34 +(V) 56 63 32 8B 24 4D BD B1 64 B0 F1 F7 2A 98 52 16 +(V) DC 7E DA AF 2B C3 CD FE F6 C3 95 F7 13 79 69 2E +(V) 09 AB 4F AE 10 4A 37 07 45 0A BF 1C A6 A6 A8 7E +(V) 05 E9 03 2F AE 70 63 C4 93 06 BF 70 32 83 A3 90 +(V) F1 79 D2 96 87 F9 67 93 61 25 68 8D F8 BE E8 88 +(V) 7B 86 49 06 3A 69 6F 71 AA 42 87 F1 43 2D C6 A0 +(V) 18 30 6D 97 A4 63 6A 14 99 5C 87 A8 2A EF EE 0F +(V) 90 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 67 B4 04 4A 0E 51 3B 6A 2E C2 27 66 +(V) 64 E8 D4 32 6C 17 98 2D 15 C6 A1 7F BD 62 51 B5 +(V) 2C B7 F4 12 D3 A7 2B 80 AA 1C C0 FD 32 B8 F0 A4 +(V) CF E9 56 E2 08 3F DB AF 66 B7 B0 D7 B2 31 AE 8D +(V) AD B2 08 14 63 29 FA 55 45 D7 3C 09 AF 67 D8 11 +(V) 47 53 1E AD 9A F1 A2 BA 14 B5 28 D5 59 26 EC 8A +(V) E7 82 3A 02 41 FE 0E B1 EF B9 2B 6F 95 99 56 BE +(V) FC E8 27 74 7F 32 A5 34 56 63 32 8B 24 4D BD B1 +(V) 64 B0 F1 F7 2A 98 52 16 DC 7E DA AF 2B C3 CD FE +(V) F6 C3 95 F7 13 79 69 2E 09 AB 4F AE 10 4A 37 07 +(V) 45 0A BF 1C A6 A6 A8 7E 05 E9 03 2F AE 70 63 C4 +(V) 93 06 BF 70 32 83 A3 90 F1 79 D2 96 87 F9 67 93 +(V) 61 25 68 8D F8 BE E8 88 7B 86 49 06 3A 69 6F 71 +(V) AA 42 87 F1 43 2D C6 A0 18 30 6D 97 A4 63 6A 14 +(V) 99 5C 87 A8 2A EF EE +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 67 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 0A +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 5D 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 AF +(V) 09 06 01 01 1F 07 00 FF 06 00 00 01 01 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 14 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 +(V) 56 B6 09 06 01 01 34 07 00 FF 12 57 44 09 06 01 +(V) 01 48 07 00 FF 12 56 D4 97 A4 63 6A 14 99 5C 87 +(V) A8 2A EF EE +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 0A FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 5D 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 AF 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 01 01 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 14 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 56 B6 +(V) 09 06 01 01 34 07 00 FF 12 57 44 09 06 01 01 48 +(V) 07 00 FF 12 56 D4 +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 5D 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 AF 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 01 01 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 14 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 24 09 06 01 01 20 07 00 FF 12 56 B6 09 06 +(V) 01 01 34 07 00 FF 12 57 44 09 06 01 01 48 07 00 +(V) FF 12 56 D4 +(V) DLMS +(D) NOT Ready to update (internal clock 13:11:12 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 68 54 51 2D +(V) D8 F3 6D 53 A4 7A 3F 96 F3 07 16 FF B9 FF C4 49 +(V) 71 39 27 B9 04 7D DC 05 03 08 71 CA 84 1A 23 1B +(V) B8 79 09 1F 1E D5 FF EF 27 93 34 B0 6C 7F A9 40 +(V) B8 4A FF 6A D7 43 B0 84 38 A4 3C 87 6B D6 7C 38 +(V) 34 6C 21 FA E5 3F A6 BC 69 D1 F7 93 8A 76 3B 1B +(V) A2 86 40 CF 3B 71 3B BA 89 D4 44 F8 DD C3 0E ED +(V) 24 97 90 66 32 B6 E4 9E 64 F2 60 F8 64 C4 3E C4 +(V) 21 D1 23 7D 9C A3 C2 54 EE AB A3 09 85 1F D6 C8 +(V) 9C D5 D2 CB 96 FB E6 19 5B 12 ED CE 07 CC 17 C6 +(V) B9 FE 08 16 EF E5 8F 6E 99 BB 3E 5B 8D 9B FC 30 +(V) 17 B0 56 D2 4C 02 D6 10 27 80 85 8A 2C 9C AA BF +(V) 99 D5 57 AB 77 CB 67 0B D6 29 47 92 C4 0D 99 06 +(V) E0 FA A1 32 7B 85 0B 20 AA 44 4F 8A A7 72 A9 10 +(V) 8E BA E4 8C 08 58 9C C6 E2 3B 8F 15 91 88 8F 68 +(V) 69 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 68 54 51 2D D8 F3 6D 53 A4 7A 3F 96 +(V) F3 07 16 FF B9 FF C4 49 71 39 27 B9 04 7D DC 05 +(V) 03 08 71 CA 84 1A 23 1B B8 79 09 1F 1E D5 FF EF +(V) 27 93 34 B0 6C 7F A9 40 B8 4A FF 6A D7 43 B0 84 +(V) 38 A4 3C 87 6B D6 7C 38 34 6C 21 FA E5 3F A6 BC +(V) 69 D1 F7 93 8A 76 3B 1B A2 86 40 CF 3B 71 3B BA +(V) 89 D4 44 F8 DD C3 0E ED 24 97 90 66 32 B6 E4 9E +(V) 64 F2 60 F8 64 C4 3E C4 21 D1 23 7D 9C A3 C2 54 +(V) EE AB A3 09 85 1F D6 C8 9C D5 D2 CB 96 FB E6 19 +(V) 5B 12 ED CE 07 CC 17 C6 B9 FE 08 16 EF E5 8F 6E +(V) 99 BB 3E 5B 8D 9B FC 30 17 B0 56 D2 4C 02 D6 10 +(V) 27 80 85 8A 2C 9C AA BF 99 D5 57 AB 77 CB 67 0B +(V) D6 29 47 92 C4 0D 99 06 E0 FA A1 32 7B 85 0B 20 +(V) AA 44 4F 8A A7 72 A9 10 8E BA E4 8C 08 58 9C C6 +(V) E2 3B 8F 15 91 88 8F +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 68 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 14 +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 33 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9F +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 F0 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 +(V) 56 D1 09 06 01 01 34 07 00 FF 12 57 3B 09 06 01 +(V) 01 48 07 00 FF 12 56 D0 8C 08 58 9C C6 E2 3B 8F +(V) 15 91 88 8F +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 14 FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 33 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9F 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 F0 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 56 D1 +(V) 09 06 01 01 34 07 00 FF 12 57 3B 09 06 01 01 48 +(V) 07 00 FF 12 56 D0 +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 33 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 9F 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 F0 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 24 09 06 01 01 20 07 00 FF 12 56 D1 09 06 +(V) 01 01 34 07 00 FF 12 57 3B 09 06 01 01 48 07 00 +(V) FF 12 56 D0 +(V) DLMS +(D) NOT Ready to update (internal clock 13:11:22 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 69 2C 36 97 +(V) 97 11 89 84 2C AB B7 DB 1F 2A EE 2B 73 34 CC B6 +(V) E7 85 B3 1B AF 1C EF 5F 41 44 34 04 4B 66 75 49 +(V) DC 4D 14 BF 8C 4A 91 9E 4E 66 0F 98 08 5F 4F B8 +(V) 2F 06 15 D9 D2 79 0A DA F9 8F 35 9F B2 9B 85 B2 +(V) 75 79 5B 50 FE CA B6 F1 83 99 99 D3 C2 B9 71 B1 +(V) 9A FF AF 09 36 9E B8 34 53 6B 1E 8C 2D 07 A0 94 +(V) 8F D4 79 0D 91 15 D6 9E 26 E3 E0 6B A1 63 B4 98 +(V) 22 A3 E4 1E C3 AE 4C 68 EF 08 C0 2E DE 6C 87 9C +(V) AE 67 A2 E3 E4 86 EB 12 61 40 54 18 DF 55 AA 8D +(V) 05 AC 72 FB 89 FB CC 75 76 96 AB AB 8E 22 18 BA +(V) 79 44 FD 2A D2 60 D8 4E CD BE C5 86 F3 78 E6 44 +(V) 4E 58 3C C2 B3 46 94 DB C4 8A ED D6 EA D5 48 87 +(V) DE 25 0A 00 D7 19 32 AA 40 A7 EE 04 BF 15 AF F0 +(V) E3 6E 66 9A CF 44 68 3E E8 1B 99 97 D9 8A 37 0C +(V) 1E 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 69 2C 36 97 97 11 89 84 2C AB B7 DB +(V) 1F 2A EE 2B 73 34 CC B6 E7 85 B3 1B AF 1C EF 5F +(V) 41 44 34 04 4B 66 75 49 DC 4D 14 BF 8C 4A 91 9E +(V) 4E 66 0F 98 08 5F 4F B8 2F 06 15 D9 D2 79 0A DA +(V) F9 8F 35 9F B2 9B 85 B2 75 79 5B 50 FE CA B6 F1 +(V) 83 99 99 D3 C2 B9 71 B1 9A FF AF 09 36 9E B8 34 +(V) 53 6B 1E 8C 2D 07 A0 94 8F D4 79 0D 91 15 D6 9E +(V) 26 E3 E0 6B A1 63 B4 98 22 A3 E4 1E C3 AE 4C 68 +(V) EF 08 C0 2E DE 6C 87 9C AE 67 A2 E3 E4 86 EB 12 +(V) 61 40 54 18 DF 55 AA 8D 05 AC 72 FB 89 FB CC 75 +(V) 76 96 AB AB 8E 22 18 BA 79 44 FD 2A D2 60 D8 4E +(V) CD BE C5 86 F3 78 E6 44 4E 58 3C C2 B3 46 94 DB +(V) C4 8A ED D6 EA D5 48 87 DE 25 0A 00 D7 19 32 AA +(V) 40 A7 EE 04 BF 15 AF F0 E3 6E 66 9A CF 44 68 3E +(V) E8 1B 99 97 D9 8A 37 +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 69 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 1E +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 30 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9F +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 F0 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 +(V) 56 AF 09 06 01 01 34 07 00 FF 12 57 36 09 06 01 +(V) 01 48 07 00 FF 12 56 C3 9A CF 44 68 3E E8 1B 99 +(V) 97 D9 8A 37 +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 1E FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 30 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9F 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 F0 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 56 AF +(V) 09 06 01 01 34 07 00 FF 12 57 36 09 06 01 01 48 +(V) 07 00 FF 12 56 C3 +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 30 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 9F 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 F0 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 24 09 06 01 01 20 07 00 FF 12 56 AF 09 06 +(V) 01 01 34 07 00 FF 12 57 36 09 06 01 01 48 07 00 +(V) FF 12 56 C3 +(V) DLMS +(D) NOT Ready to update (internal clock 13:11:32 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 6A 70 A1 54 +(V) 4B D4 4F 58 3C D3 C2 99 44 61 B2 F4 B9 A9 FB 94 +(V) 27 4C D8 9F EA 52 5C FE 23 89 9C 97 FF C1 18 1D +(V) 20 79 B7 E6 8D 22 94 9D 05 4A BA 84 7E A9 11 B6 +(V) 49 5C D2 D8 46 1A 04 2E 68 FD 83 B3 C5 DC 46 D7 +(V) A6 BD F8 7D 4D 71 03 7D 42 4F BF 12 C4 80 C2 91 +(V) 00 59 8C EC 71 EA DB 59 A9 91 4B E7 06 7A DF DA +(V) 4D 6D 7C 6B 3F ED B9 EE 9E 72 DD 48 34 23 52 52 +(V) 15 DA 3F A9 46 9A 9C 14 A0 FB AB B8 AF EB 9D FB +(V) A1 71 85 22 D9 A8 85 C7 19 2F 4A 90 11 A5 2B 44 +(V) 20 DF 36 13 09 F7 65 71 1B FF 55 85 2C E9 21 F4 +(V) 88 7C FD 3E 0A 32 B6 F1 B7 CD 8D 35 13 91 ED 86 +(V) 83 7A 18 9A ED F9 6D 2A 90 C4 85 C5 B5 B7 19 D2 +(V) 07 7E 59 A0 BB EC 1C 10 A5 3E D4 BA E3 C9 23 93 +(V) B4 DD 25 4A 48 E3 F2 12 5C 31 20 70 A6 B1 17 76 +(V) 96 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 6A 70 A1 54 4B D4 4F 58 3C D3 C2 99 +(V) 44 61 B2 F4 B9 A9 FB 94 27 4C D8 9F EA 52 5C FE +(V) 23 89 9C 97 FF C1 18 1D 20 79 B7 E6 8D 22 94 9D +(V) 05 4A BA 84 7E A9 11 B6 49 5C D2 D8 46 1A 04 2E +(V) 68 FD 83 B3 C5 DC 46 D7 A6 BD F8 7D 4D 71 03 7D +(V) 42 4F BF 12 C4 80 C2 91 00 59 8C EC 71 EA DB 59 +(V) A9 91 4B E7 06 7A DF DA 4D 6D 7C 6B 3F ED B9 EE +(V) 9E 72 DD 48 34 23 52 52 15 DA 3F A9 46 9A 9C 14 +(V) A0 FB AB B8 AF EB 9D FB A1 71 85 22 D9 A8 85 C7 +(V) 19 2F 4A 90 11 A5 2B 44 20 DF 36 13 09 F7 65 71 +(V) 1B FF 55 85 2C E9 21 F4 88 7C FD 3E 0A 32 B6 F1 +(V) B7 CD 8D 35 13 91 ED 86 83 7A 18 9A ED F9 6D 2A +(V) 90 C4 85 C5 B5 B7 19 D2 07 7E 59 A0 BB EC 1C 10 +(V) A5 3E D4 BA E3 C9 23 93 B4 DD 25 4A 48 E3 F2 12 +(V) 5C 31 20 70 A6 B1 17 +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 6A 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 28 +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 29 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9D +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 EC 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 +(V) 56 8C 09 06 01 01 34 07 00 FF 12 56 C8 09 06 01 +(V) 01 48 07 00 FF 12 57 06 4A 48 E3 F2 12 5C 31 20 +(V) 70 A6 B1 17 +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 28 FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 29 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9D 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 EC 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 56 8C +(V) 09 06 01 01 34 07 00 FF 12 56 C8 09 06 01 01 48 +(V) 07 00 FF 12 57 06 +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 29 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 9D 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 EC 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 24 09 06 01 01 20 07 00 FF 12 56 8C 09 06 +(V) 01 01 34 07 00 FF 12 56 C8 09 06 01 01 48 07 00 +(V) FF 12 57 06 +(V) DLMS +(D) NOT Ready to update (internal clock 13:11:42 UTC, meter clock: 00:00:00, list type 2, est: 1) +(I) Had to reset DNS server +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 6B A5 53 BE +(V) 0E 46 92 7C 12 14 CC FB 06 29 6B 0F EE F1 43 60 +(V) 48 35 05 7A 48 77 DE 60 2A 99 5D F8 37 AC 5F 72 +(V) D3 5A 5F 69 F1 9A 6A 3D 80 6C 7F 11 52 31 7E 4F +(V) 9F BE B6 8B D0 6D 35 1C B1 1D 64 82 DB BE B6 93 +(V) 3A A8 61 E1 8A FC 84 D5 C1 A0 9F 3D D0 CC 2B EB +(V) 55 AF DD 32 CC 38 78 39 BF 45 3D C3 68 23 5A 6F +(V) 6D CE B7 7F FC 8B D8 C3 62 9D D1 52 FB D1 12 C1 +(V) 07 8C C5 32 6C A7 5D B6 76 BA 73 0B 0B 8B 82 96 +(V) 6E E9 FB 8A AC 53 CD 4F 46 CF BE F5 89 E6 8F 22 +(V) E9 9C CA 0A A0 FB EF 84 9B 59 C2 B4 6D 97 2A F5 +(V) 73 2D 00 98 8B CB 55 2F 8E FA AD 84 85 D1 B2 D5 +(V) 7E 4B 3B 98 B4 F0 DA 6A ED 51 6C B6 71 ED 5C 1E +(V) 3D 35 15 12 30 90 69 21 D1 F8 FE 28 49 AF 9B 18 +(V) EB 73 C8 DD 2B FD CF 06 A2 A1 38 9A 1A 38 F7 8D +(V) BB 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 6B A5 53 BE 0E 46 92 7C 12 14 CC FB +(V) 06 29 6B 0F EE F1 43 60 48 35 05 7A 48 77 DE 60 +(V) 2A 99 5D F8 37 AC 5F 72 D3 5A 5F 69 F1 9A 6A 3D +(V) 80 6C 7F 11 52 31 7E 4F 9F BE B6 8B D0 6D 35 1C +(V) B1 1D 64 82 DB BE B6 93 3A A8 61 E1 8A FC 84 D5 +(V) C1 A0 9F 3D D0 CC 2B EB 55 AF DD 32 CC 38 78 39 +(V) BF 45 3D C3 68 23 5A 6F 6D CE B7 7F FC 8B D8 C3 +(V) 62 9D D1 52 FB D1 12 C1 07 8C C5 32 6C A7 5D B6 +(V) 76 BA 73 0B 0B 8B 82 96 6E E9 FB 8A AC 53 CD 4F +(V) 46 CF BE F5 89 E6 8F 22 E9 9C CA 0A A0 FB EF 84 +(V) 9B 59 C2 B4 6D 97 2A F5 73 2D 00 98 8B CB 55 2F +(V) 8E FA AD 84 85 D1 B2 D5 7E 4B 3B 98 B4 F0 DA 6A +(V) ED 51 6C B6 71 ED 5C 1E 3D 35 15 12 30 90 69 21 +(V) D1 F8 FE 28 49 AF 9B 18 EB 73 C8 DD 2B FD CF 06 +(V) A2 A1 38 9A 1A 38 F7 +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 6B 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 32 +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 31 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9D +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 F1 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 +(V) 56 6B 09 06 01 01 34 07 00 FF 12 56 B2 09 06 01 +(V) 01 48 07 00 FF 12 57 0D DD 2B FD CF 06 A2 A1 38 +(V) 9A 1A 38 F7 +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0B 32 FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 31 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9D 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 F1 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 56 6B +(V) 09 06 01 01 34 07 00 FF 12 56 B2 09 06 01 01 48 +(V) 07 00 FF 12 57 0D +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 31 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 9D 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 F1 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 24 09 06 01 01 20 07 00 FF 12 56 6B 09 06 +(V) 01 01 34 07 00 FF 12 56 B2 09 06 01 01 48 07 00 +(V) FF 12 57 0D +(V) DLMS +(D) NOT Ready to update (internal clock 13:11:52 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 6C F9 6A 4C +(V) C3 08 A6 23 99 49 36 B7 75 93 B8 87 13 F1 B7 5B +(V) 14 98 9F DE 42 41 2F 54 0F 8B 25 F6 6B FE 0D DE +(V) 0F 03 60 D7 2B C3 5F 39 64 C0 86 2E 94 0A 1D 67 +(V) F7 A2 DC 8E 87 76 75 D7 4A 6B E8 AB 6A EA 2C D2 +(V) F5 2A BE 24 7D 02 48 93 FA C9 DB FD 84 C0 12 0D +(V) 6E EB 89 D5 B5 D9 50 15 50 93 38 20 DE 5F B2 A1 +(V) BE D5 28 B3 32 F6 7D 38 56 19 52 D6 EA 74 E6 90 +(V) F2 0E 2E 21 09 3C 81 71 8F 9E C2 86 FA 53 4C 98 +(V) 8F 57 71 E7 F7 91 5E 28 58 AB C1 B2 47 3A EA 72 +(V) EA 91 49 A8 20 20 C7 E3 7A 50 FF E2 8D 6F 1A F0 +(V) 3B 4F 25 30 0B 5E B4 40 EA 66 0E 5E 59 2C 78 3F +(V) DB CF 4B 45 B8 3D 2F B7 46 4D D6 0B CD 40 04 DE +(V) 8B 37 25 BE 4B A5 36 DF 84 09 7E 0B 2B A3 A8 5C +(V) 2C 12 F9 96 C4 A6 FA C6 84 EA EE 8F 19 31 FB 74 +(V) FF 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 6C F9 6A 4C C3 08 A6 23 99 49 36 B7 +(V) 75 93 B8 87 13 F1 B7 5B 14 98 9F DE 42 41 2F 54 +(V) 0F 8B 25 F6 6B FE 0D DE 0F 03 60 D7 2B C3 5F 39 +(V) 64 C0 86 2E 94 0A 1D 67 F7 A2 DC 8E 87 76 75 D7 +(V) 4A 6B E8 AB 6A EA 2C D2 F5 2A BE 24 7D 02 48 93 +(V) FA C9 DB FD 84 C0 12 0D 6E EB 89 D5 B5 D9 50 15 +(V) 50 93 38 20 DE 5F B2 A1 BE D5 28 B3 32 F6 7D 38 +(V) 56 19 52 D6 EA 74 E6 90 F2 0E 2E 21 09 3C 81 71 +(V) 8F 9E C2 86 FA 53 4C 98 8F 57 71 E7 F7 91 5E 28 +(V) 58 AB C1 B2 47 3A EA 72 EA 91 49 A8 20 20 C7 E3 +(V) 7A 50 FF E2 8D 6F 1A F0 3B 4F 25 30 0B 5E B4 40 +(V) EA 66 0E 5E 59 2C 78 3F DB CF 4B 45 B8 3D 2F B7 +(V) 46 4D D6 0B CD 40 04 DE 8B 37 25 BE 4B A5 36 DF +(V) 84 09 7E 0B 2B A3 A8 5C 2C 12 F9 96 C4 A6 FA C6 +(V) 84 EA EE 8F 19 31 FB +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 6C 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 00 +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 2F 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9D +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 F0 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 +(V) 56 5D 09 06 01 01 34 07 00 FF 12 56 AB 09 06 01 +(V) 01 48 07 00 FF 12 56 FC 96 C4 A6 FA C6 84 EA EE +(V) 8F 19 31 FB +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 00 FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 2F 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9D 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 F0 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 56 5D +(V) 09 06 01 01 34 07 00 FF 12 56 AB 09 06 01 01 48 +(V) 07 00 FF 12 56 FC +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 2F 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 9D 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 F0 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 24 09 06 01 01 20 07 00 FF 12 56 5D 09 06 +(V) 01 01 34 07 00 FF 12 56 AB 09 06 01 01 48 07 00 +(V) FF 12 56 FC +(V) DLMS +(D) NOT Ready to update (internal clock 13:12:02 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 6D 3D F2 4D +(V) 32 2C 01 E2 D2 F8 25 96 0A FA 06 66 91 A2 D4 A6 +(V) B1 E8 5A 75 B6 01 5D E5 EE 18 10 2C 3F BD 85 73 +(V) 0B 3A 98 B7 AC D9 E0 91 13 B0 E4 4E 9C 0E 15 FA +(V) 3F 85 AF CC 96 61 81 D2 5B 80 6D ED C1 61 16 35 +(V) 02 0A 5C A2 9D FF 2D 83 FF 30 6B 22 11 3A 57 D2 +(V) 2E 73 A1 CC BD 81 A9 AC E6 61 31 6F 89 A8 14 54 +(V) 32 A3 33 45 0D FF 08 A7 62 E9 2D 28 55 82 28 2B +(V) 0E 98 AE 73 A2 9D AC 4E 7A A9 F9 64 D9 15 B1 C2 +(V) F4 C7 52 BA 57 8B 9F 44 D4 92 38 37 A4 B1 72 44 +(V) 40 4C B9 4E 27 1E FE 75 50 A6 6C FB C9 68 19 68 +(V) DE BF 55 78 3C 9A DA 97 16 45 AA 50 EB 3B C7 91 +(V) C5 92 B8 D9 C1 E0 AA C3 0D 65 7D 05 5A F5 DA 66 +(V) BF 21 D3 CF 23 F8 77 03 37 D5 D4 F9 F1 4A 6E 6A +(V) D0 71 E0 20 EC A3 CB F0 3A 94 0B B7 77 3D B4 30 +(V) 11 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 6D 3D F2 4D 32 2C 01 E2 D2 F8 25 96 +(V) 0A FA 06 66 91 A2 D4 A6 B1 E8 5A 75 B6 01 5D E5 +(V) EE 18 10 2C 3F BD 85 73 0B 3A 98 B7 AC D9 E0 91 +(V) 13 B0 E4 4E 9C 0E 15 FA 3F 85 AF CC 96 61 81 D2 +(V) 5B 80 6D ED C1 61 16 35 02 0A 5C A2 9D FF 2D 83 +(V) FF 30 6B 22 11 3A 57 D2 2E 73 A1 CC BD 81 A9 AC +(V) E6 61 31 6F 89 A8 14 54 32 A3 33 45 0D FF 08 A7 +(V) 62 E9 2D 28 55 82 28 2B 0E 98 AE 73 A2 9D AC 4E +(V) 7A A9 F9 64 D9 15 B1 C2 F4 C7 52 BA 57 8B 9F 44 +(V) D4 92 38 37 A4 B1 72 44 40 4C B9 4E 27 1E FE 75 +(V) 50 A6 6C FB C9 68 19 68 DE BF 55 78 3C 9A DA 97 +(V) 16 45 AA 50 EB 3B C7 91 C5 92 B8 D9 C1 E0 AA C3 +(V) 0D 65 7D 05 5A F5 DA 66 BF 21 D3 CF 23 F8 77 03 +(V) 37 D5 D4 F9 F1 4A 6E 6A D0 71 E0 20 EC A3 CB F0 +(V) 3A 94 0B B7 77 3D B4 +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 6D 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 0A +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 2C 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9C +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 EE 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 +(V) 56 3F 09 06 01 01 34 07 00 FF 12 56 69 09 06 01 +(V) 01 48 07 00 FF 12 56 55 20 EC A3 CB F0 3A 94 0B +(V) B7 77 3D B4 +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 0A FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 2C 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9C 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 EE 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 56 3F +(V) 09 06 01 01 34 07 00 FF 12 56 69 09 06 01 01 48 +(V) 07 00 FF 12 56 55 +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 2C 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 9C 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 EE 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 24 09 06 01 01 20 07 00 FF 12 56 3F 09 06 +(V) 01 01 34 07 00 FF 12 56 69 09 06 01 01 48 07 00 +(V) FF 12 56 55 +(V) DLMS +(D) NOT Ready to update (internal clock 13:12:12 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 6E 94 D2 EB +(V) 74 2D 91 BB B4 32 11 5F 64 44 8B E6 4F CA DD 63 +(V) C0 6A B7 09 74 F2 9C 31 50 66 1F BC 79 0A 91 F9 +(V) 2E EA A0 47 80 E3 14 B9 13 9D FA FC 26 ED EA 43 +(V) D9 46 7E 53 5F CA B6 CA AC 24 27 B0 25 E6 6A 10 +(V) 2C 41 65 A8 FE 9C D2 DD 7F 8A 3B D2 3E 82 5F 24 +(V) 9D 45 44 15 DC 34 36 78 44 F3 9F 89 BA 8B 15 AA +(V) F5 6C 01 B5 E7 E9 07 87 48 7F DF C5 2B 5E ED 66 +(V) 35 45 B8 3A C5 4F 94 72 2D 4F 2F 61 B4 AE F7 B2 +(V) 3C 5B 00 84 CE 27 4C 59 E0 72 31 6E 84 57 DC 08 +(V) BA AC BC 51 E7 B2 12 8C F2 47 4B A5 88 FA E6 F1 +(V) E0 57 1F 82 FF 3A C2 8C F1 59 2D 9D 31 CC A9 E0 +(V) 92 45 9A 1C 83 C7 24 1E 6F BE 66 CC DC B0 C1 0D +(V) F2 21 80 7D 65 79 E7 BA 3B 58 36 EA 16 D6 03 3C +(V) 4D 8D EE A8 D2 71 51 F7 29 22 3C 56 90 F1 FF F5 +(V) DE 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 6E 94 D2 EB 74 2D 91 BB B4 32 11 5F +(V) 64 44 8B E6 4F CA DD 63 C0 6A B7 09 74 F2 9C 31 +(V) 50 66 1F BC 79 0A 91 F9 2E EA A0 47 80 E3 14 B9 +(V) 13 9D FA FC 26 ED EA 43 D9 46 7E 53 5F CA B6 CA +(V) AC 24 27 B0 25 E6 6A 10 2C 41 65 A8 FE 9C D2 DD +(V) 7F 8A 3B D2 3E 82 5F 24 9D 45 44 15 DC 34 36 78 +(V) 44 F3 9F 89 BA 8B 15 AA F5 6C 01 B5 E7 E9 07 87 +(V) 48 7F DF C5 2B 5E ED 66 35 45 B8 3A C5 4F 94 72 +(V) 2D 4F 2F 61 B4 AE F7 B2 3C 5B 00 84 CE 27 4C 59 +(V) E0 72 31 6E 84 57 DC 08 BA AC BC 51 E7 B2 12 8C +(V) F2 47 4B A5 88 FA E6 F1 E0 57 1F 82 FF 3A C2 8C +(V) F1 59 2D 9D 31 CC A9 E0 92 45 9A 1C 83 C7 24 1E +(V) 6F BE 66 CC DC B0 C1 0D F2 21 80 7D 65 79 E7 BA +(V) 3B 58 36 EA 16 D6 03 3C 4D 8D EE A8 D2 71 51 F7 +(V) 29 22 3C 56 90 F1 FF +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 6E 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 14 +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 38 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9E +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 F3 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 +(V) 56 37 09 06 01 01 34 07 00 FF 12 56 91 09 06 01 +(V) 01 48 07 00 FF 12 56 65 A8 D2 71 51 F7 29 22 3C +(V) 56 90 F1 FF +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 14 FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 38 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9E 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 F3 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 56 37 +(V) 09 06 01 01 34 07 00 FF 12 56 91 09 06 01 01 48 +(V) 07 00 FF 12 56 65 +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 38 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 9E 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 F3 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 24 09 06 01 01 20 07 00 FF 12 56 37 09 06 +(V) 01 01 34 07 00 FF 12 56 91 09 06 01 01 48 07 00 +(V) FF 12 56 65 +(V) DLMS +(D) NOT Ready to update (internal clock 13:12:22 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 6F C5 E8 C9 +(V) 00 4B 5F 0C 9F 66 7A EE 66 68 F8 A5 39 AD 68 E0 +(V) 95 3C AA 79 98 25 28 CE DD 7A 82 14 51 B3 E2 BA +(V) DA 09 74 12 AB 8C 47 45 33 7C 2C B5 25 3B 79 E1 +(V) 67 25 5E AB 59 91 54 98 9B 6C E0 C2 22 A4 0D DC +(V) C6 A2 62 DB 6A 3C B2 7F 1A 67 A7 A3 7E 03 D5 BB +(V) 8C FE A4 A2 CD 2B 6E EF DE 4D 47 DC 0B 29 30 57 +(V) D0 18 8F 75 40 C4 59 14 2C 6A 06 09 FA B3 12 76 +(V) D5 97 95 C8 D3 B5 8B F2 51 86 9B 79 2D 5D 33 5C +(V) D5 9A 2A 5E 68 A6 86 D8 18 6F E8 AC 55 78 95 BB +(V) D2 5C 4D 6F 96 DB 05 1F D4 A3 30 B3 AA FD 58 81 +(V) 76 C1 C0 4B 36 AE F9 94 21 3E 61 2E 2F A8 ED 8B +(V) 26 70 19 4D 84 4A E7 9F BF 63 27 BD 00 89 07 C1 +(V) 59 A7 9D FF F1 70 B5 E1 FF 8F BA E7 B3 70 C9 93 +(V) 20 45 12 55 94 A0 BA 57 76 49 FC E4 99 2B CA 85 +(V) 16 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 6F C5 E8 C9 00 4B 5F 0C 9F 66 7A EE +(V) 66 68 F8 A5 39 AD 68 E0 95 3C AA 79 98 25 28 CE +(V) DD 7A 82 14 51 B3 E2 BA DA 09 74 12 AB 8C 47 45 +(V) 33 7C 2C B5 25 3B 79 E1 67 25 5E AB 59 91 54 98 +(V) 9B 6C E0 C2 22 A4 0D DC C6 A2 62 DB 6A 3C B2 7F +(V) 1A 67 A7 A3 7E 03 D5 BB 8C FE A4 A2 CD 2B 6E EF +(V) DE 4D 47 DC 0B 29 30 57 D0 18 8F 75 40 C4 59 14 +(V) 2C 6A 06 09 FA B3 12 76 D5 97 95 C8 D3 B5 8B F2 +(V) 51 86 9B 79 2D 5D 33 5C D5 9A 2A 5E 68 A6 86 D8 +(V) 18 6F E8 AC 55 78 95 BB D2 5C 4D 6F 96 DB 05 1F +(V) D4 A3 30 B3 AA FD 58 81 76 C1 C0 4B 36 AE F9 94 +(V) 21 3E 61 2E 2F A8 ED 8B 26 70 19 4D 84 4A E7 9F +(V) BF 63 27 BD 00 89 07 C1 59 A7 9D FF F1 70 B5 E1 +(V) FF 8F BA E7 B3 70 C9 93 20 45 12 55 94 A0 BA 57 +(V) 76 49 FC E4 99 2B CA +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 6F 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 1E +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 36 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9D +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 F3 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 +(V) 56 1D 09 06 01 01 34 07 00 FF 12 56 71 09 06 01 +(V) 01 48 07 00 FF 12 56 48 55 94 A0 BA 57 76 49 FC +(V) E4 99 2B CA +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 1E FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 36 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9D 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 F3 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 56 1D +(V) 09 06 01 01 34 07 00 FF 12 56 71 09 06 01 01 48 +(V) 07 00 FF 12 56 48 +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 36 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 9D 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 F3 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 24 09 06 01 01 20 07 00 FF 12 56 1D 09 06 +(V) 01 01 34 07 00 FF 12 56 71 09 06 01 01 48 07 00 +(V) FF 12 56 48 +(V) DLMS +(D) NOT Ready to update (internal clock 13:12:32 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 70 8A A1 8B +(V) 64 1D B7 73 C1 55 9B 2D A6 B0 B2 55 B3 54 47 DB +(V) 7B A5 99 17 AF 05 BF 23 0E 2A 81 CB E8 44 6F F2 +(V) D1 B5 C0 D7 C2 DE E4 24 62 D0 89 8F E6 3F 64 75 +(V) 9D 3B 0B 19 F6 6A 60 40 90 9D FF 46 CB E4 05 44 +(V) C8 14 B5 6F D4 20 53 CB D1 56 EE DB E7 F6 F4 59 +(V) 47 23 CE 1B D0 30 0C C3 B5 1C 8F 71 29 BF 47 2C +(V) DE F2 68 C8 93 B9 EC 40 81 1A 7E 29 12 B8 70 01 +(V) 40 38 10 8E 6E 93 CB E7 F4 74 2F AF 33 28 6F 92 +(V) 5E 58 D5 8D A3 B0 6B DA C6 4C 2B 25 75 22 E6 87 +(V) C0 38 C3 7E BA EA 5B 6B 3B D3 BA 28 9D CB CD AB +(V) FB DB 8B EF 92 7B BB B5 59 38 D7 0A 71 3B F8 E0 +(V) 29 D2 6E 59 21 CE 18 CD 3E F6 69 FE 06 DE 0C 3B +(V) 60 D3 4D E5 A4 79 D0 94 D8 42 1A B1 FB DD 70 D4 +(V) 97 48 4B B0 FD 09 CF 09 4F 9E 17 03 65 A0 27 41 +(V) DC 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 70 8A A1 8B 64 1D B7 73 C1 55 9B 2D +(V) A6 B0 B2 55 B3 54 47 DB 7B A5 99 17 AF 05 BF 23 +(V) 0E 2A 81 CB E8 44 6F F2 D1 B5 C0 D7 C2 DE E4 24 +(V) 62 D0 89 8F E6 3F 64 75 9D 3B 0B 19 F6 6A 60 40 +(V) 90 9D FF 46 CB E4 05 44 C8 14 B5 6F D4 20 53 CB +(V) D1 56 EE DB E7 F6 F4 59 47 23 CE 1B D0 30 0C C3 +(V) B5 1C 8F 71 29 BF 47 2C DE F2 68 C8 93 B9 EC 40 +(V) 81 1A 7E 29 12 B8 70 01 40 38 10 8E 6E 93 CB E7 +(V) F4 74 2F AF 33 28 6F 92 5E 58 D5 8D A3 B0 6B DA +(V) C6 4C 2B 25 75 22 E6 87 C0 38 C3 7E BA EA 5B 6B +(V) 3B D3 BA 28 9D CB CD AB FB DB 8B EF 92 7B BB B5 +(V) 59 38 D7 0A 71 3B F8 E0 29 D2 6E 59 21 CE 18 CD +(V) 3E F6 69 FE 06 DE 0C 3B 60 D3 4D E5 A4 79 D0 94 +(V) D8 42 1A B1 FB DD 70 D4 97 48 4B B0 FD 09 CF 09 +(V) 4F 9E 17 03 65 A0 27 +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 70 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 28 +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 2E 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9C +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 EE 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 +(V) 56 3A 09 06 01 01 34 07 00 FF 12 56 82 09 06 01 +(V) 01 48 07 00 FF 12 56 58 B0 FD 09 CF 09 4F 9E 17 +(V) 03 65 A0 27 +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 28 FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 2E 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 9C 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 EE 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 24 09 06 01 01 20 07 00 FF 12 56 3A +(V) 09 06 01 01 34 07 00 FF 12 56 82 09 06 01 01 48 +(V) 07 00 FF 12 56 58 +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 2E 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 9C 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 EE 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 24 09 06 01 01 20 07 00 FF 12 56 3A 09 06 +(V) 01 01 34 07 00 FF 12 56 82 09 06 01 01 48 07 00 +(V) FF 12 56 58 +(V) DLMS +(D) NOT Ready to update (internal clock 13:12:42 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 71 8D 0C 56 +(V) 12 60 D6 0C 41 FC 05 D1 3A 01 82 28 67 50 11 56 +(V) BF ED E5 C7 EF 69 59 7B F8 C2 97 4E B1 6A D8 9C +(V) 56 07 22 64 51 27 B1 21 09 3D AA 0C 5D 78 7A F2 +(V) 54 91 DF 2A 77 BC F0 68 05 1D E7 58 1B 86 25 6A +(V) F7 DA 63 63 32 E4 4F 89 FB 2C 1D D8 5E 85 85 FE +(V) 7D A7 0D 0C 3D 38 A7 6B 7F EB 73 8E C4 BF 7A 34 +(V) 6D 2C B6 73 FC 80 BA 2C 5B DD 2C 5E 02 D1 B2 B3 +(V) 1C 5A D0 CA BD 7F 77 F0 A6 6E 6C EE 63 37 30 3F +(V) 46 46 64 13 44 66 98 80 85 45 48 72 11 A1 6D 09 +(V) 0C B4 66 50 38 C7 33 58 72 34 91 B6 23 E5 BF 5D +(V) BB 35 D1 47 81 40 E7 0A F7 16 56 88 39 8F 74 63 +(V) 76 97 0E 09 2B FC BE 69 26 13 4B BC 8F BA 21 08 +(V) 3C 1B 82 6E 79 AF B0 AD 41 E1 00 6A C0 29 C6 69 +(V) 05 62 2C A6 42 DF 77 CF A6 3B 1F 53 A6 E6 7E B7 +(V) 91 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 71 8D 0C 56 12 60 D6 0C 41 FC 05 D1 +(V) 3A 01 82 28 67 50 11 56 BF ED E5 C7 EF 69 59 7B +(V) F8 C2 97 4E B1 6A D8 9C 56 07 22 64 51 27 B1 21 +(V) 09 3D AA 0C 5D 78 7A F2 54 91 DF 2A 77 BC F0 68 +(V) 05 1D E7 58 1B 86 25 6A F7 DA 63 63 32 E4 4F 89 +(V) FB 2C 1D D8 5E 85 85 FE 7D A7 0D 0C 3D 38 A7 6B +(V) 7F EB 73 8E C4 BF 7A 34 6D 2C B6 73 FC 80 BA 2C +(V) 5B DD 2C 5E 02 D1 B2 B3 1C 5A D0 CA BD 7F 77 F0 +(V) A6 6E 6C EE 63 37 30 3F 46 46 64 13 44 66 98 80 +(V) 85 45 48 72 11 A1 6D 09 0C B4 66 50 38 C7 33 58 +(V) 72 34 91 B6 23 E5 BF 5D BB 35 D1 47 81 40 E7 0A +(V) F7 16 56 88 39 8F 74 63 76 97 0E 09 2B FC BE 69 +(V) 26 13 4B BC 8F BA 21 08 3C 1B 82 6E 79 AF B0 AD +(V) 41 E1 00 6A C0 29 C6 69 05 62 2C A6 42 DF 77 CF +(V) A6 3B 1F 53 A6 E6 7E +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 71 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 32 +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 27 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 98 +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 EC 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 23 09 06 01 01 20 07 00 FF 12 +(V) 56 2D 09 06 01 01 34 07 00 FF 12 56 A9 09 06 01 +(V) 01 48 07 00 FF 12 56 E4 A6 42 DF 77 CF A6 3B 1F +(V) 53 A6 E6 7E +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0C 32 FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 27 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 98 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 EC 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 23 09 06 01 01 20 07 00 FF 12 56 2D +(V) 09 06 01 01 34 07 00 FF 12 56 A9 09 06 01 01 48 +(V) 07 00 FF 12 56 E4 +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 27 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 98 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 EC 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 23 09 06 01 01 20 07 00 FF 12 56 2D 09 06 +(V) 01 01 34 07 00 FF 12 56 A9 09 06 01 01 48 07 00 +(V) FF 12 56 E4 +(V) DLMS +(D) NOT Ready to update (internal clock 13:12:52 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 72 4D 75 BA +(V) 26 B9 6D 9C 69 9A 1D 2C 47 F4 31 4C 08 45 E2 D0 +(V) 22 CE 1E 04 20 D4 8E 92 54 3E 09 4A 99 31 D2 26 +(V) AB DA CE 6A 44 9A DC 45 E2 62 42 D5 22 AB C0 A4 +(V) 9A 90 99 BC 31 32 57 74 C6 A0 60 46 ED 5B 25 5B +(V) 48 13 0C D5 3E 48 76 D3 04 44 B2 98 F9 FF 58 82 +(V) 30 5F BB 27 24 01 0D 03 0E E5 24 CD 57 2F 19 2D +(V) 99 53 39 38 07 6A 65 11 8F CD 43 71 AC 34 E8 CF +(V) 1B 8A A7 7E 67 D0 05 43 78 6C B8 4F EF E0 DF 89 +(V) 14 1A 05 61 C6 D7 B2 B6 8B 9F BE AC 95 C0 AB 57 +(V) 93 78 01 D9 5C 18 00 8D 57 01 03 91 E9 22 C5 DC +(V) A4 F8 CE 1F FF 9B AC 44 CE 05 97 AE A8 06 81 DD +(V) 02 A7 09 F6 43 7C 43 10 3D 8D D6 FD EA 83 BA 72 +(V) E1 55 D9 42 DB 67 D2 4A D6 13 22 77 34 B6 39 86 +(V) EB 05 C2 AE 55 86 6A F9 4C 63 82 F5 E3 37 BB 3B +(V) 8F 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 72 4D 75 BA 26 B9 6D 9C 69 9A 1D 2C +(V) 47 F4 31 4C 08 45 E2 D0 22 CE 1E 04 20 D4 8E 92 +(V) 54 3E 09 4A 99 31 D2 26 AB DA CE 6A 44 9A DC 45 +(V) E2 62 42 D5 22 AB C0 A4 9A 90 99 BC 31 32 57 74 +(V) C6 A0 60 46 ED 5B 25 5B 48 13 0C D5 3E 48 76 D3 +(V) 04 44 B2 98 F9 FF 58 82 30 5F BB 27 24 01 0D 03 +(V) 0E E5 24 CD 57 2F 19 2D 99 53 39 38 07 6A 65 11 +(V) 8F CD 43 71 AC 34 E8 CF 1B 8A A7 7E 67 D0 05 43 +(V) 78 6C B8 4F EF E0 DF 89 14 1A 05 61 C6 D7 B2 B6 +(V) 8B 9F BE AC 95 C0 AB 57 93 78 01 D9 5C 18 00 8D +(V) 57 01 03 91 E9 22 C5 DC A4 F8 CE 1F FF 9B AC 44 +(V) CE 05 97 AE A8 06 81 DD 02 A7 09 F6 43 7C 43 10 +(V) 3D 8D D6 FD EA 83 BA 72 E1 55 D9 42 DB 67 D2 4A +(V) D6 13 22 77 34 B6 39 86 EB 05 C2 AE 55 86 6A F9 +(V) 4C 63 82 F5 E3 37 BB +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 72 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0D 00 +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 29 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 99 +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 EC 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 23 09 06 01 01 20 07 00 FF 12 +(V) 56 72 09 06 01 01 34 07 00 FF 12 56 D1 09 06 01 +(V) 01 48 07 00 FF 12 57 1B AE 55 86 6A F9 4C 63 82 +(V) F5 E3 37 BB +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0D 00 FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 29 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 99 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 EC 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 23 09 06 01 01 20 07 00 FF 12 56 72 +(V) 09 06 01 01 34 07 00 FF 12 56 D1 09 06 01 01 48 +(V) 07 00 FF 12 57 1B +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 29 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 99 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 EC 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 23 09 06 01 01 20 07 00 FF 12 56 72 09 06 +(V) 01 01 34 07 00 FF 12 56 D1 09 06 01 01 48 07 00 +(V) FF 12 57 1B +(V) DLMS +(D) NOT Ready to update (internal clock 13:13:02 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 73 3F 2B D4 +(V) 15 BB 2B 02 D0 1F D8 F0 7F AB E9 D5 EE A7 4B F8 +(V) A2 D5 A4 6B 5E FE 72 31 91 49 76 22 77 A2 F5 8B +(V) 6C 42 60 CF 77 0D FF C4 CE 30 DE 1A BD B2 41 F1 +(V) DD 58 F1 58 C6 E4 D8 15 AE E9 8A 1B E6 2B D9 00 +(V) 2A 0B C2 BB A5 F1 3A 05 66 43 0D E4 1C CF F0 10 +(V) 09 7E C5 3F 84 26 16 26 D1 22 E5 D8 97 70 A7 2C +(V) 47 DF 3C 70 B8 B7 15 FA C8 AA 32 F4 D0 2F CD 43 +(V) 15 C6 B0 0D AD E3 BD 78 7B DC 46 B2 C8 C0 45 34 +(V) 71 26 FA 6B E6 C8 6A D2 17 53 D1 86 09 C7 BE 93 +(V) 12 BD 1E 0A B5 DA 7C 9B 39 C5 58 70 C2 D7 6A AB +(V) 60 04 BC 32 A6 01 6C CB 7F BC 29 86 FA 20 C6 14 +(V) 9D F8 AA DB 78 71 E3 68 0B E3 25 20 0D 01 D6 47 +(V) 33 AA 87 53 FC 26 77 71 AA 45 42 78 72 5B D9 E9 +(V) 1F A4 24 CB E0 2A 2F D2 32 A1 A9 3A 0C DE C7 E4 +(V) 42 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 73 3F 2B D4 15 BB 2B 02 D0 1F D8 F0 +(V) 7F AB E9 D5 EE A7 4B F8 A2 D5 A4 6B 5E FE 72 31 +(V) 91 49 76 22 77 A2 F5 8B 6C 42 60 CF 77 0D FF C4 +(V) CE 30 DE 1A BD B2 41 F1 DD 58 F1 58 C6 E4 D8 15 +(V) AE E9 8A 1B E6 2B D9 00 2A 0B C2 BB A5 F1 3A 05 +(V) 66 43 0D E4 1C CF F0 10 09 7E C5 3F 84 26 16 26 +(V) D1 22 E5 D8 97 70 A7 2C 47 DF 3C 70 B8 B7 15 FA +(V) C8 AA 32 F4 D0 2F CD 43 15 C6 B0 0D AD E3 BD 78 +(V) 7B DC 46 B2 C8 C0 45 34 71 26 FA 6B E6 C8 6A D2 +(V) 17 53 D1 86 09 C7 BE 93 12 BD 1E 0A B5 DA 7C 9B +(V) 39 C5 58 70 C2 D7 6A AB 60 04 BC 32 A6 01 6C CB +(V) 7F BC 29 86 FA 20 C6 14 9D F8 AA DB 78 71 E3 68 +(V) 0B E3 25 20 0D 01 D6 47 33 AA 87 53 FC 26 77 71 +(V) AA 45 42 78 72 5B D9 E9 1F A4 24 CB E0 2A 2F D2 +(V) 32 A1 A9 3A 0C DE C7 +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 73 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0D 0A +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 21 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 98 +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 E8 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 23 09 06 01 01 20 07 00 FF 12 +(V) 56 4C 09 06 01 01 34 07 00 FF 12 56 AF 09 06 01 +(V) 01 48 07 00 FF 12 56 F9 CB E0 2A 2F D2 32 A1 A9 +(V) 3A 0C DE C7 +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0D 0A FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 21 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 98 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 E8 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 23 09 06 01 01 20 07 00 FF 12 56 4C +(V) 09 06 01 01 34 07 00 FF 12 56 AF 09 06 01 01 48 +(V) 07 00 FF 12 56 F9 +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 21 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 98 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 E8 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 23 09 06 01 01 20 07 00 FF 12 56 4C 09 06 +(V) 01 01 34 07 00 FF 12 56 AF 09 06 01 01 48 07 00 +(V) FF 12 56 F9 +(V) DLMS +(D) NOT Ready to update (internal clock 13:13:12 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 74 BA 03 82 +(V) D7 7C 69 A0 9E E8 3C 27 3F 6A 6B B4 52 E4 CA 41 +(V) F6 F5 20 19 43 4F A7 FA E0 8A E8 49 B7 E0 9A 0B +(V) 9B A6 9E DD 50 F0 D5 B2 CB 8E EC 2F 50 9A 0F 55 +(V) 85 29 1D A6 07 11 4A 00 FE B4 BC 5D E4 B8 39 68 +(V) 9B 40 22 84 DC 56 E4 5E E2 84 6C 8F 46 27 51 26 +(V) 7C 1B 71 49 5F 3C 40 2A 1B 40 34 94 2E 8A A7 AE +(V) 2E BF DA 78 A2 E6 DE C0 B8 5A CF 1D 9E 2D 7C DA +(V) 34 9A 76 E5 2B F8 11 68 9C 62 1F 42 6E 8A 66 26 +(V) CD C9 8E 90 FE 9B 2F 2B 98 84 B0 05 83 32 B1 01 +(V) 1C 86 39 DF 88 A1 2E 9E 10 15 D2 F6 AA 61 DE 76 +(V) 83 01 CD 97 35 78 B9 1A AB FD 78 A5 39 3B D5 A4 +(V) 07 A2 0E 46 BA 41 CE 59 0C B6 97 2F C8 5F 83 12 +(V) 5B E0 17 5A 34 10 92 03 07 3F 22 32 CB 18 E8 AE +(V) 5B 7B 8D C2 43 34 CE B4 E3 7C 2B 76 7A D4 96 AD +(V) 36 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 74 BA 03 82 D7 7C 69 A0 9E E8 3C 27 +(V) 3F 6A 6B B4 52 E4 CA 41 F6 F5 20 19 43 4F A7 FA +(V) E0 8A E8 49 B7 E0 9A 0B 9B A6 9E DD 50 F0 D5 B2 +(V) CB 8E EC 2F 50 9A 0F 55 85 29 1D A6 07 11 4A 00 +(V) FE B4 BC 5D E4 B8 39 68 9B 40 22 84 DC 56 E4 5E +(V) E2 84 6C 8F 46 27 51 26 7C 1B 71 49 5F 3C 40 2A +(V) 1B 40 34 94 2E 8A A7 AE 2E BF DA 78 A2 E6 DE C0 +(V) B8 5A CF 1D 9E 2D 7C DA 34 9A 76 E5 2B F8 11 68 +(V) 9C 62 1F 42 6E 8A 66 26 CD C9 8E 90 FE 9B 2F 2B +(V) 98 84 B0 05 83 32 B1 01 1C 86 39 DF 88 A1 2E 9E +(V) 10 15 D2 F6 AA 61 DE 76 83 01 CD 97 35 78 B9 1A +(V) AB FD 78 A5 39 3B D5 A4 07 A2 0E 46 BA 41 CE 59 +(V) 0C B6 97 2F C8 5F 83 12 5B E0 17 5A 34 10 92 03 +(V) 07 3F 22 32 CB 18 E8 AE 5B 7B 8D C2 43 34 CE B4 +(V) E3 7C 2B 76 7A D4 96 +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 74 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0D 14 +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 24 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 99 +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 EB 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 23 09 06 01 01 20 07 00 FF 12 +(V) 56 68 09 06 01 01 34 07 00 FF 12 56 CE 09 06 01 +(V) 01 48 07 00 FF 12 57 3A C2 43 34 CE B4 E3 7C 2B +(V) 76 7A D4 96 +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0D 14 FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 24 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 99 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 EB 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 23 09 06 01 01 20 07 00 FF 12 56 68 +(V) 09 06 01 01 34 07 00 FF 12 56 CE 09 06 01 01 48 +(V) 07 00 FF 12 57 3A +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 24 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 99 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 EB 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 23 09 06 01 01 20 07 00 FF 12 56 68 09 06 +(V) 01 01 34 07 00 FF 12 56 CE 09 06 01 01 48 07 00 +(V) FF 12 57 3A +(V) DLMS +(D) NOT Ready to update (internal clock 13:13:22 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A1 00 41 03 13 2F 7A E6 E7 00 DB 08 4B 41 4D +(V) 45 01 AB F4 3F 82 00 E7 30 00 78 4A 75 FE 46 19 +(V) 3B 8D 55 CA DB 6E CE C1 94 4E CB EE 6C 96 5E A6 +(V) E5 00 9C 9B 20 B7 23 B8 FA 1D DC 74 CA 70 62 DA +(V) 77 9E DC B1 6B FE D3 D3 F5 75 99 4A B0 A4 BC 11 +(V) A4 35 AA 81 37 00 61 B5 19 E1 EE 6F DB 96 60 6D +(V) 4C BD A3 41 41 51 D4 DE 1D 29 57 CA C7 C1 9E 8D +(V) 1D 38 0B A2 6A 68 D8 71 02 40 75 79 A6 D7 2B F7 +(V) 53 05 65 A4 D1 E4 64 B5 15 96 C4 85 76 E6 8C 14 +(V) 4C 3D CD 61 91 C2 D5 44 BE 27 20 38 B2 5F 98 97 +(V) E2 CA 43 C1 E3 52 E2 CA 3F 34 B1 DD FE 6E 7E 2E +(V) 8E 65 C6 62 1E FA 71 9D F1 72 11 97 39 CA 56 85 +(V) 0E E1 9D 0B E1 11 8E 68 38 54 68 14 EF 0B 75 17 +(V) 9A 3B 2C 0E F7 3B F1 C1 AC BE 6D D3 5C 94 68 57 +(V) 00 F8 39 20 A5 6D 9D F8 80 49 3E D6 22 0E 78 29 +(V) 06 DE 5C EB 11 72 4B 67 0A 89 E8 19 92 0B 09 76 +(V) 87 7E +(V) LLC frame: +(V) E6 E7 00 DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 +(V) 30 00 78 4A 75 FE 46 19 3B 8D 55 CA DB 6E CE C1 +(V) 94 4E CB EE 6C 96 5E A6 E5 00 9C 9B 20 B7 23 B8 +(V) FA 1D DC 74 CA 70 62 DA 77 9E DC B1 6B FE D3 D3 +(V) F5 75 99 4A B0 A4 BC 11 A4 35 AA 81 37 00 61 B5 +(V) 19 E1 EE 6F DB 96 60 6D 4C BD A3 41 41 51 D4 DE +(V) 1D 29 57 CA C7 C1 9E 8D 1D 38 0B A2 6A 68 D8 71 +(V) 02 40 75 79 A6 D7 2B F7 53 05 65 A4 D1 E4 64 B5 +(V) 15 96 C4 85 76 E6 8C 14 4C 3D CD 61 91 C2 D5 44 +(V) BE 27 20 38 B2 5F 98 97 E2 CA 43 C1 E3 52 E2 CA +(V) 3F 34 B1 DD FE 6E 7E 2E 8E 65 C6 62 1E FA 71 9D +(V) F1 72 11 97 39 CA 56 85 0E E1 9D 0B E1 11 8E 68 +(V) 38 54 68 14 EF 0B 75 17 9A 3B 2C 0E F7 3B F1 C1 +(V) AC BE 6D D3 5C 94 68 57 00 F8 39 20 A5 6D 9D F8 +(V) 80 49 3E D6 22 0E 78 29 06 DE 5C EB 11 72 4B 67 +(V) 0A 89 E8 19 92 0B 09 +(V) GCM frame: +(V) DB 08 4B 41 4D 45 01 AB F4 3F 82 00 E7 30 00 78 +(V) 4A 75 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0D 1E +(V) FF 80 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 +(V) 5F 56 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 +(V) 35 37 30 36 35 36 37 32 38 30 34 36 33 39 39 31 +(V) 09 06 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 +(V) 38 42 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 +(V) 01 07 00 FF 06 00 00 02 25 09 06 01 01 02 07 00 +(V) FF 06 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 +(V) 00 00 1B 09 06 01 01 04 07 00 FF 06 00 00 00 99 +(V) 09 06 01 01 1F 07 00 FF 06 00 00 00 EC 09 06 01 +(V) 01 33 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 +(V) 00 FF 06 00 00 00 23 09 06 01 01 20 07 00 FF 12 +(V) 56 54 09 06 01 01 34 07 00 FF 12 56 A7 09 06 01 +(V) 01 48 07 00 FF 12 56 FC EB 11 72 4B 67 0A 89 E8 +(V) 19 92 0B 09 +(V) DLMS frame: +(V) 0F 00 00 00 00 0C 07 E9 09 09 02 0E 0D 1E FF 80 +(V) 00 00 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 +(V) 30 30 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 +(V) 30 36 35 36 37 32 38 30 34 36 33 39 39 31 09 06 +(V) 01 01 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 +(V) 4E 32 34 33 31 30 31 30 31 30 09 06 01 01 01 07 +(V) 00 FF 06 00 00 02 25 09 06 01 01 02 07 00 FF 06 +(V) 00 00 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 +(V) 1B 09 06 01 01 04 07 00 FF 06 00 00 00 99 09 06 +(V) 01 01 1F 07 00 FF 06 00 00 00 EC 09 06 01 01 33 +(V) 07 00 FF 06 00 00 00 13 09 06 01 01 47 07 00 FF +(V) 06 00 00 00 23 09 06 01 01 20 07 00 FF 12 56 54 +(V) 09 06 01 01 34 07 00 FF 12 56 A7 09 06 01 01 48 +(V) 07 00 FF 12 56 FC +(D) Received valid DLMS at 47 +196 +(V) Using application data: +(V) 02 19 0A 0E 4B 61 6D 73 74 72 75 70 5F 56 30 30 +(V) 30 31 09 06 01 01 00 00 05 FF 0A 10 35 37 30 36 +(V) 35 36 37 32 38 30 34 36 33 39 39 31 09 06 01 01 +(V) 60 01 01 FF 0A 12 36 38 34 31 31 33 38 42 4E 32 +(V) 34 33 31 30 31 30 31 30 09 06 01 01 01 07 00 FF +(V) 06 00 00 02 25 09 06 01 01 02 07 00 FF 06 00 00 +(V) 00 00 09 06 01 01 03 07 00 FF 06 00 00 00 1B 09 +(V) 06 01 01 04 07 00 FF 06 00 00 00 99 09 06 01 01 +(V) 1F 07 00 FF 06 00 00 00 EC 09 06 01 01 33 07 00 +(V) FF 06 00 00 00 13 09 06 01 01 47 07 00 FF 06 00 +(V) 00 00 23 09 06 01 01 20 07 00 FF 12 56 54 09 06 +(V) 01 01 34 07 00 FF 12 56 A7 09 06 01 01 48 07 00 +(V) FF 12 56 FC +(V) DLMS +(D) NOT Ready to update (internal clock 13:13:32 UTC, meter clock: 00:00:00, list type 2, est: 1) +q +* Debug: Command received: q +* Closing client connection ... diff --git a/frames/L&G-E350_Norway.raw b/frames/L&G-E350_Norway.raw new file mode 100644 index 00000000..fec2be5c --- /dev/null +++ b/frames/L&G-E350_Norway.raw @@ -0,0 +1,682 @@ +*** Remote debug - over telnet - for ESP32 - version 3.0.5 +* Host name: ams-e603 IP:10.10.10.62 Mac address:D8:3B:DA:C4:03:E6 +* Free Heap RAM: 87952 +* ESP SDK version: 4.4.5.230722 +****************************************************** +* Commands: + ? or help -> display these help of commands + q -> quit (close this connection) + m -> display memory available + v -> set debug level to verbose + d -> set debug level to debug + i -> set debug level to info + w -> set debug level to warning + e -> set debug level to errors + s -> set debug silence on/off + l -> show debug level + t -> show time (millis) + profiler: + p -> show time between actual and last message (in millis) + p min -> show only if time is this minimal + P time -> set debug level to profiler + c -> show colors + filter: + filter -> show only debugs with this + nofilter -> disable the filter +* Please type the command and press enter to execute.(? or h for this help) +*** +(V) HDLC frame: +(V) 7E A1 1E 41 08 83 13 EE EE E6 E7 00 0F 40 00 00 +(V) 00 00 01 0D 02 02 09 06 01 01 00 02 81 FF 0A 0B +(V) 45 4D 42 52 49 51 5F 56 31 5F 31 02 02 09 06 00 +(V) 00 60 01 00 FF 0A 10 31 33 39 34 33 35 39 37 00 +(V) 00 00 00 00 00 00 00 02 02 09 06 00 00 60 01 07 +(V) FF 0A 04 5A 46 46 31 02 03 09 06 01 00 01 07 00 +(V) FF 06 00 00 24 F4 02 02 0F 00 16 1B 02 03 09 06 +(V) 01 00 02 07 00 FF 06 00 00 00 00 02 02 0F 00 16 +(V) 1B 02 03 09 06 01 00 03 07 00 FF 06 00 00 00 31 +(V) 02 02 0F 00 16 1D 02 03 09 06 01 00 04 07 00 FF +(V) 06 00 00 00 00 02 02 0F 00 16 1D 02 03 09 06 01 +(V) 00 1F 07 00 FF 10 0C 6C 02 02 0F FE 16 21 02 03 +(V) 09 06 01 00 33 07 00 FF 10 00 00 02 02 0F FE 16 +(V) 21 02 03 09 06 01 00 47 07 00 FF 10 0D 68 02 02 +(V) 0F FE 16 21 02 03 09 06 01 00 20 07 00 FF 12 09 +(V) 2E 02 02 0F FF 16 23 02 03 09 06 01 00 34 07 00 +(V) FF 12 00 00 02 02 0F FF 16 23 02 03 09 06 01 00 +(V) 48 07 00 FF 12 09 10 02 02 0F FF 16 23 2F AF 7E +(V) +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 0D 02 02 09 06 01 +(V) 01 00 02 81 FF 0A 0B 45 4D 42 52 49 51 5F 56 31 +(V) 5F 31 02 02 09 06 00 00 60 01 00 FF 0A 10 31 33 +(V) 39 34 33 35 39 37 00 00 00 00 00 00 00 00 02 02 +(V) 09 06 00 00 60 01 07 FF 0A 04 5A 46 46 31 02 03 +(V) 09 06 01 00 01 07 00 FF 06 00 00 24 F4 02 02 0F +(V) 00 16 1B 02 03 09 06 01 00 02 07 00 FF 06 00 00 +(V) 00 00 02 02 0F 00 16 1B 02 03 09 06 01 00 03 07 +(V) 00 FF 06 00 00 00 31 02 02 0F 00 16 1D 02 03 09 +(V) 06 01 00 04 07 00 FF 06 00 00 00 00 02 02 0F 00 +(V) 16 1D 02 03 09 06 01 00 1F 07 00 FF 10 0C 6C 02 +(V) 02 0F FE 16 21 02 03 09 06 01 00 33 07 00 FF 10 +(V) 00 00 02 02 0F FE 16 21 02 03 09 06 01 00 47 07 +(V) 00 FF 10 0D 68 02 02 0F FE 16 21 02 03 09 06 01 +(V) 00 20 07 00 FF 12 09 2E 02 02 0F FF 16 23 02 03 +(V) 09 06 01 00 34 07 00 FF 12 00 00 02 02 0F FF 16 +(V) 23 02 03 09 06 01 00 48 07 00 FF 12 09 10 02 02 +(V) 0F FF 16 23 +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 0D 02 02 09 06 01 01 00 02 +(V) 81 FF 0A 0B 45 4D 42 52 49 51 5F 56 31 5F 31 02 +(V) 02 09 06 00 00 60 01 00 FF 0A 10 31 33 39 34 33 +(V) 35 39 37 00 00 00 00 00 00 00 00 02 02 09 06 00 +(V) 00 60 01 07 FF 0A 04 5A 46 46 31 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 F4 02 02 0F 00 16 1B +(V) 02 03 09 06 01 00 02 07 00 FF 06 00 00 00 00 02 +(V) 02 0F 00 16 1B 02 03 09 06 01 00 03 07 00 FF 06 +(V) 00 00 00 31 02 02 0F 00 16 1D 02 03 09 06 01 00 +(V) 04 07 00 FF 06 00 00 00 00 02 02 0F 00 16 1D 02 +(V) 03 09 06 01 00 1F 07 00 FF 10 0C 6C 02 02 0F FE +(V) 16 21 02 03 09 06 01 00 33 07 00 FF 10 00 00 02 +(V) 02 0F FE 16 21 02 03 09 06 01 00 47 07 00 FF 10 +(V) 0D 68 02 02 0F FE 16 21 02 03 09 06 01 00 20 07 +(V) 00 FF 12 09 2E 02 02 0F FF 16 23 02 03 09 06 01 +(V) 00 34 07 00 FF 12 00 00 02 02 0F FF 16 23 02 03 +(V) 09 06 01 00 48 07 00 FF 12 09 10 02 02 0F FF 16 +(V) 23 +(D) Received valid DLMS at 18 +267 +(V) Using application data: +(V) 01 0D 02 02 09 06 01 01 00 02 81 FF 0A 0B 45 4D +(V) 42 52 49 51 5F 56 31 5F 31 02 02 09 06 00 00 60 +(V) 01 00 FF 0A 10 31 33 39 34 33 35 39 37 00 00 00 +(V) 00 00 00 00 00 02 02 09 06 00 00 60 01 07 FF 0A +(V) 04 5A 46 46 31 02 03 09 06 01 00 01 07 00 FF 06 +(V) 00 00 24 F4 02 02 0F 00 16 1B 02 03 09 06 01 00 +(V) 02 07 00 FF 06 00 00 00 00 02 02 0F 00 16 1B 02 +(V) 03 09 06 01 00 03 07 00 FF 06 00 00 00 31 02 02 +(V) 0F 00 16 1D 02 03 09 06 01 00 04 07 00 FF 06 00 +(V) 00 00 00 02 02 0F 00 16 1D 02 03 09 06 01 00 1F +(V) 07 00 FF 10 0C 6C 02 02 0F FE 16 21 02 03 09 06 +(V) 01 00 33 07 00 FF 10 00 00 02 02 0F FE 16 21 02 +(V) 03 09 06 01 00 47 07 00 FF 10 0D 68 02 02 0F FE +(V) 16 21 02 03 09 06 01 00 20 07 00 FF 12 09 2E 02 +(V) 02 0F FF 16 23 02 03 09 06 01 00 34 07 00 FF 12 +(V) 00 00 02 02 0F FF 16 23 02 03 09 06 01 00 48 07 +(V) 00 FF 12 09 10 02 02 0F FF 16 23 +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:06 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 F4 02 02 0F 00 16 1B A7 7F 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 F4 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 F4 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) F4 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:07 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 F4 02 02 0F 00 16 1B A7 7F 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 F4 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 F4 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) F4 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:10 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 E0 02 02 0F 00 16 1B 18 A5 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 E0 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 E0 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) E0 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:12 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A1 1E 41 08 83 13 EE EE E6 E7 00 0F 40 00 00 +(V) 00 00 01 0D 02 02 09 06 01 01 00 02 81 FF 0A 0B +(V) 45 4D 42 52 49 51 5F 56 31 5F 31 02 02 09 06 00 +(V) 00 60 01 00 FF 0A 10 31 33 39 34 33 35 39 37 00 +(V) 00 00 00 00 00 00 00 02 02 09 06 00 00 60 01 07 +(V) FF 0A 04 00 00 00 00 02 03 09 06 01 00 01 07 00 +(V) FF 06 00 00 24 E0 02 02 0F 00 16 1B 02 03 09 06 +(V) 01 00 02 07 00 FF 06 00 00 00 00 02 02 0F 00 16 +(V) 1B 02 03 09 06 01 00 03 07 00 FF 06 00 00 00 28 +(V) 02 02 0F 00 16 1D 02 03 09 06 01 00 04 07 00 FF +(V) 06 00 00 00 00 02 02 0F 00 16 1D 02 03 09 06 01 +(V) 00 1F 07 00 FF 10 0C 68 02 02 0F FE 16 21 02 03 +(V) 09 06 01 00 33 07 00 FF 10 00 00 02 02 0F FE 16 +(V) 21 02 03 09 06 01 00 47 07 00 FF 10 0D 5D 02 02 +(V) 0F FE 16 21 02 03 09 06 01 00 20 07 00 FF 12 09 +(V) 2E 02 02 0F FF 16 23 02 03 09 06 01 00 34 07 00 +(V) FF 12 00 00 02 02 0F FF 16 23 02 03 09 06 01 00 +(V) 48 07 00 FF 12 09 10 02 02 0F FF 16 23 AE 9D 7E +(V) +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 0D 02 02 09 06 01 +(V) 01 00 02 81 FF 0A 0B 45 4D 42 52 49 51 5F 56 31 +(V) 5F 31 02 02 09 06 00 00 60 01 00 FF 0A 10 31 33 +(V) 39 34 33 35 39 37 00 00 00 00 00 00 00 00 02 02 +(V) 09 06 00 00 60 01 07 FF 0A 04 00 00 00 00 02 03 +(V) 09 06 01 00 01 07 00 FF 06 00 00 24 E0 02 02 0F +(V) 00 16 1B 02 03 09 06 01 00 02 07 00 FF 06 00 00 +(V) 00 00 02 02 0F 00 16 1B 02 03 09 06 01 00 03 07 +(V) 00 FF 06 00 00 00 28 02 02 0F 00 16 1D 02 03 09 +(V) 06 01 00 04 07 00 FF 06 00 00 00 00 02 02 0F 00 +(V) 16 1D 02 03 09 06 01 00 1F 07 00 FF 10 0C 68 02 +(V) 02 0F FE 16 21 02 03 09 06 01 00 33 07 00 FF 10 +(V) 00 00 02 02 0F FE 16 21 02 03 09 06 01 00 47 07 +(V) 00 FF 10 0D 5D 02 02 0F FE 16 21 02 03 09 06 01 +(V) 00 20 07 00 FF 12 09 2E 02 02 0F FF 16 23 02 03 +(V) 09 06 01 00 34 07 00 FF 12 00 00 02 02 0F FF 16 +(V) 23 02 03 09 06 01 00 48 07 00 FF 12 09 10 02 02 +(V) 0F FF 16 23 +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 0D 02 02 09 06 01 01 00 02 +(V) 81 FF 0A 0B 45 4D 42 52 49 51 5F 56 31 5F 31 02 +(V) 02 09 06 00 00 60 01 00 FF 0A 10 31 33 39 34 33 +(V) 35 39 37 00 00 00 00 00 00 00 00 02 02 09 06 00 +(V) 00 60 01 07 FF 0A 04 00 00 00 00 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 E0 02 02 0F 00 16 1B +(V) 02 03 09 06 01 00 02 07 00 FF 06 00 00 00 00 02 +(V) 02 0F 00 16 1B 02 03 09 06 01 00 03 07 00 FF 06 +(V) 00 00 00 28 02 02 0F 00 16 1D 02 03 09 06 01 00 +(V) 04 07 00 FF 06 00 00 00 00 02 02 0F 00 16 1D 02 +(V) 03 09 06 01 00 1F 07 00 FF 10 0C 68 02 02 0F FE +(V) 16 21 02 03 09 06 01 00 33 07 00 FF 10 00 00 02 +(V) 02 0F FE 16 21 02 03 09 06 01 00 47 07 00 FF 10 +(V) 0D 5D 02 02 0F FE 16 21 02 03 09 06 01 00 20 07 +(V) 00 FF 12 09 2E 02 02 0F FF 16 23 02 03 09 06 01 +(V) 00 34 07 00 FF 12 00 00 02 02 0F FF 16 23 02 03 +(V) 09 06 01 00 48 07 00 FF 12 09 10 02 02 0F FF 16 +(V) 23 +(D) Received valid DLMS at 18 +267 +(V) Using application data: +(V) 01 0D 02 02 09 06 01 01 00 02 81 FF 0A 0B 45 4D +(V) 42 52 49 51 5F 56 31 5F 31 02 02 09 06 00 00 60 +(V) 01 00 FF 0A 10 31 33 39 34 33 35 39 37 00 00 00 +(V) 00 00 00 00 00 02 02 09 06 00 00 60 01 07 FF 0A +(V) 04 00 00 00 00 02 03 09 06 01 00 01 07 00 FF 06 +(V) 00 00 24 E0 02 02 0F 00 16 1B 02 03 09 06 01 00 +(V) 02 07 00 FF 06 00 00 00 00 02 02 0F 00 16 1B 02 +(V) 03 09 06 01 00 03 07 00 FF 06 00 00 00 28 02 02 +(V) 0F 00 16 1D 02 03 09 06 01 00 04 07 00 FF 06 00 +(V) 00 00 00 02 02 0F 00 16 1D 02 03 09 06 01 00 1F +(V) 07 00 FF 10 0C 68 02 02 0F FE 16 21 02 03 09 06 +(V) 01 00 33 07 00 FF 10 00 00 02 02 0F FE 16 21 02 +(V) 03 09 06 01 00 47 07 00 FF 10 0D 5D 02 02 0F FE +(V) 16 21 02 03 09 06 01 00 20 07 00 FF 12 09 2E 02 +(V) 02 0F FF 16 23 02 03 09 06 01 00 34 07 00 FF 12 +(V) 00 00 02 02 0F FF 16 23 02 03 09 06 01 00 48 07 +(V) 00 FF 12 09 10 02 02 0F FF 16 23 +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:16 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 E0 02 02 0F 00 16 1B 18 A5 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 E0 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 E0 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) E0 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:17 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 A4 02 02 0F 00 16 1B 68 0D 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 A4 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 A4 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) A4 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:20 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 A4 02 02 0F 00 16 1B 68 0D 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 A4 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 A4 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) A4 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:22 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A1 1E 41 08 83 13 EE EE E6 E7 00 0F 40 00 00 +(V) 00 00 01 0D 02 02 09 06 01 01 00 02 81 FF 0A 0B +(V) 45 4D 42 52 49 51 5F 56 31 5F 31 02 02 09 06 00 +(V) 00 60 01 00 FF 0A 10 31 33 39 34 33 35 39 37 00 +(V) 00 00 00 00 00 00 00 02 02 09 06 00 00 60 01 07 +(V) FF 0A 04 5A 46 46 31 02 03 09 06 01 00 01 07 00 +(V) FF 06 00 00 24 A4 02 02 0F 00 16 1B 02 03 09 06 +(V) 01 00 02 07 00 FF 06 00 00 00 00 02 02 0F 00 16 +(V) 1B 02 03 09 06 01 00 03 07 00 FF 06 00 00 00 31 +(V) 02 02 0F 00 16 1D 02 03 09 06 01 00 04 07 00 FF +(V) 06 00 00 00 00 02 02 0F 00 16 1D 02 03 09 06 01 +(V) 00 1F 07 00 FF 10 0C 6E 02 02 0F FE 16 21 02 03 +(V) 09 06 01 00 33 07 00 FF 10 00 00 02 02 0F FE 16 +(V) 21 02 03 09 06 01 00 47 07 00 FF 10 0D 5C 02 02 +(V) 0F FE 16 21 02 03 09 06 01 00 20 07 00 FF 12 09 +(V) 38 02 02 0F FF 16 23 02 03 09 06 01 00 34 07 00 +(V) FF 12 00 00 02 02 0F FF 16 23 02 03 09 06 01 00 +(V) 48 07 00 FF 12 09 10 02 02 0F FF 16 23 4A DF 7E +(V) +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 0D 02 02 09 06 01 +(V) 01 00 02 81 FF 0A 0B 45 4D 42 52 49 51 5F 56 31 +(V) 5F 31 02 02 09 06 00 00 60 01 00 FF 0A 10 31 33 +(V) 39 34 33 35 39 37 00 00 00 00 00 00 00 00 02 02 +(V) 09 06 00 00 60 01 07 FF 0A 04 5A 46 46 31 02 03 +(V) 09 06 01 00 01 07 00 FF 06 00 00 24 A4 02 02 0F +(V) 00 16 1B 02 03 09 06 01 00 02 07 00 FF 06 00 00 +(V) 00 00 02 02 0F 00 16 1B 02 03 09 06 01 00 03 07 +(V) 00 FF 06 00 00 00 31 02 02 0F 00 16 1D 02 03 09 +(V) 06 01 00 04 07 00 FF 06 00 00 00 00 02 02 0F 00 +(V) 16 1D 02 03 09 06 01 00 1F 07 00 FF 10 0C 6E 02 +(V) 02 0F FE 16 21 02 03 09 06 01 00 33 07 00 FF 10 +(V) 00 00 02 02 0F FE 16 21 02 03 09 06 01 00 47 07 +(V) 00 FF 10 0D 5C 02 02 0F FE 16 21 02 03 09 06 01 +(V) 00 20 07 00 FF 12 09 38 02 02 0F FF 16 23 02 03 +(V) 09 06 01 00 34 07 00 FF 12 00 00 02 02 0F FF 16 +(V) 23 02 03 09 06 01 00 48 07 00 FF 12 09 10 02 02 +(V) 0F FF 16 23 +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 0D 02 02 09 06 01 01 00 02 +(V) 81 FF 0A 0B 45 4D 42 52 49 51 5F 56 31 5F 31 02 +(V) 02 09 06 00 00 60 01 00 FF 0A 10 31 33 39 34 33 +(V) 35 39 37 00 00 00 00 00 00 00 00 02 02 09 06 00 +(V) 00 60 01 07 FF 0A 04 5A 46 46 31 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 A4 02 02 0F 00 16 1B +(V) 02 03 09 06 01 00 02 07 00 FF 06 00 00 00 00 02 +(V) 02 0F 00 16 1B 02 03 09 06 01 00 03 07 00 FF 06 +(V) 00 00 00 31 02 02 0F 00 16 1D 02 03 09 06 01 00 +(V) 04 07 00 FF 06 00 00 00 00 02 02 0F 00 16 1D 02 +(V) 03 09 06 01 00 1F 07 00 FF 10 0C 6E 02 02 0F FE +(V) 16 21 02 03 09 06 01 00 33 07 00 FF 10 00 00 02 +(V) 02 0F FE 16 21 02 03 09 06 01 00 47 07 00 FF 10 +(V) 0D 5C 02 02 0F FE 16 21 02 03 09 06 01 00 20 07 +(V) 00 FF 12 09 38 02 02 0F FF 16 23 02 03 09 06 01 +(V) 00 34 07 00 FF 12 00 00 02 02 0F FF 16 23 02 03 +(V) 09 06 01 00 48 07 00 FF 12 09 10 02 02 0F FF 16 +(V) 23 +(D) Received valid DLMS at 18 +267 +(V) Using application data: +(V) 01 0D 02 02 09 06 01 01 00 02 81 FF 0A 0B 45 4D +(V) 42 52 49 51 5F 56 31 5F 31 02 02 09 06 00 00 60 +(V) 01 00 FF 0A 10 31 33 39 34 33 35 39 37 00 00 00 +(V) 00 00 00 00 00 02 02 09 06 00 00 60 01 07 FF 0A +(V) 04 5A 46 46 31 02 03 09 06 01 00 01 07 00 FF 06 +(V) 00 00 24 A4 02 02 0F 00 16 1B 02 03 09 06 01 00 +(V) 02 07 00 FF 06 00 00 00 00 02 02 0F 00 16 1B 02 +(V) 03 09 06 01 00 03 07 00 FF 06 00 00 00 31 02 02 +(V) 0F 00 16 1D 02 03 09 06 01 00 04 07 00 FF 06 00 +(V) 00 00 00 02 02 0F 00 16 1D 02 03 09 06 01 00 1F +(V) 07 00 FF 10 0C 6E 02 02 0F FE 16 21 02 03 09 06 +(V) 01 00 33 07 00 FF 10 00 00 02 02 0F FE 16 21 02 +(V) 03 09 06 01 00 47 07 00 FF 10 0D 5C 02 02 0F FE +(V) 16 21 02 03 09 06 01 00 20 07 00 FF 12 09 38 02 +(V) 02 0F FF 16 23 02 03 09 06 01 00 34 07 00 FF 12 +(V) 00 00 02 02 0F FF 16 23 02 03 09 06 01 00 48 07 +(V) 00 FF 12 09 10 02 02 0F FF 16 23 +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:26 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 + (V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 B8 02 02 0F 00 16 1B 3B 09 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 B8 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 B8 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) B8 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:27 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 B8 02 02 0F 00 16 1B 3B 09 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 B8 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 B8 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) B8 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:29 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 B8 02 02 0F 00 16 1B 3B 09 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 B8 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 B8 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) B8 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:32 UTC, meter clock: 00:00:00, list type 1, est: 1) +q(V) HDLC frame: +(V) 7E A1 1E 41 08 83 13 EE EE E6 E7 00 0F 40 00 00 +(V) 00 00 01 0D 02 02 09 06 01 01 00 02 81 FF 0A 0B +(V) 45 4D 42 52 49 51 5F 56 31 5F 31 02 02 09 06 00 +(V) 00 60 01 00 FF 0A 10 31 33 39 34 33 35 39 37 00 +(V) 00 00 00 00 00 00 00 02 02 09 06 00 00 60 01 07 +(V) FF 0A 04 5A 46 46 31 02 03 09 06 01 00 01 07 00 +(V) FF 06 00 00 24 A4 02 02 0F 00 16 1B 02 03 09 06 +(V) 01 00 02 07 00 FF 06 00 00 00 00 02 02 0F 00 16 +(V) 1B 02 03 09 06 01 00 03 07 00 FF 06 00 00 00 46 +(V) 02 02 0F 00 16 1D 02 03 09 06 01 00 04 07 00 FF +(V) 06 00 00 00 00 02 02 0F 00 16 1D 02 03 09 06 01 +(V) 00 1F 07 00 FF 10 0C 67 02 02 0F FE 16 21 02 03 +(V) 09 06 01 00 33 07 00 FF 10 00 00 02 02 0F FE 16 +(V) 21 02 03 09 06 01 00 47 07 00 FF 10 0D 5D 02 02 +(V) 0F FE 16 21 02 03 09 06 01 00 20 07 00 FF 12 09 +(V) 2E 02 02 0F FF 16 23 02 03 09 06 01 00 34 07 00 +(V) FF 12 00 00 02 02 0F FF 16 23 02 03 09 06 01 00 +(V) 48 07 00 FF 12 09 06 02 02 0F FF 16 23 3A 49 7E +(V) +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 0D 02 02 09 06 01 +(V) 01 00 02 81 FF 0A 0B 45 4D 42 52 49 51 5F 56 31 +(V) 5F 31 02 02 09 06 00 00 60 01 00 FF 0A 10 31 33 +(V) 39 34 33 35 39 37 00 00 00 00 00 00 00 00 02 02 +(V) 09 06 00 00 60 01 07 FF 0A 04 5A 46 46 31 02 03 +(V) 09 06 01 00 01 07 00 FF 06 00 00 24 A4 02 02 0F +(V) 00 16 1B 02 03 09 06 01 00 02 07 00 FF 06 00 00 +(V) 00 00 02 02 0F 00 16 1B 02 03 09 06 01 00 03 07 +(V) 00 FF 06 00 00 00 46 02 02 0F 00 16 1D 02 03 09 +(V) 06 01 00 04 07 00 FF 06 00 00 00 00 02 02 0F 00 +(V) 16 1D 02 03 09 06 01 00 1F 07 00 FF 10 0C 67 02 +(V) 02 0F FE 16 21 02 03 09 06 01 00 33 07 00 FF 10 +(V) 00 00 02 02 0F FE 16 21 02 03 09 06 01 00 47 07 +(V) 00 FF 10 0D 5D 02 02 0F FE 16 21 02 03 09 06 01 +(V) 00 20 07 00 FF 12 09 2E 02 02 0F FF 16 23 02 03 +(V) 09 06 01 00 34 07 00 FF 12 00 00 02 02 0F FF 16 +(V) 23 02 03 09 06 01 00 48 07 00 FF 12 09 06 02 02 +(V) 0F FF 16 23 +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 0D 02 02 09 06 01 01 00 02 +(V) 81 FF 0A 0B 45 4D 42 52 49 51 5F 56 31 5F 31 02 +(V) 02 09 06 00 00 60 01 00 FF 0A 10 31 33 39 34 33 +(V) 35 39 37 00 00 00 00 00 00 00 00 02 02 09 06 00 +(V) 00 60 01 07 FF 0A 04 5A 46 46 31 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 A4 02 02 0F 00 16 1B +(V) 02 03 09 06 01 00 02 07 00 FF 06 00 00 00 00 02 +(V) 02 0F 00 16 1B 02 03 09 06 01 00 03 07 00 FF 06 +(V) 00 00 00 46 02 02 0F 00 16 1D 02 03 09 06 01 00 +(V) 04 07 00 FF 06 00 00 00 00 02 02 0F 00 16 1D 02 +(V) 03 09 06 01 00 1F 07 00 FF 10 0C 67 02 02 0F FE +(V) 16 21 02 03 09 06 01 00 33 07 00 FF 10 00 00 02 +(V) 02 0F FE 16 21 02 03 09 06 01 00 47 07 00 FF 10 +(V) 0D 5D 02 02 0F FE 16 21 02 03 09 06 01 00 20 07 +(V) 00 FF 12 09 2E 02 02 0F FF 16 23 02 03 09 06 01 +(V) 00 34 07 00 FF 12 00 00 02 02 0F FF 16 23 02 03 +(V) 09 06 01 00 48 07 00 FF 12 09 06 02 02 0F FF 16 +(V) 23 +(D) Received valid DLMS at 18 +267 +(V) Using application data: +(V) 01 0D 02 02 09 06 01 01 00 02 81 FF 0A 0B 45 4D +(V) 42 52 49 51 5F 56 31 5F 31 02 02 09 06 00 00 60 +(V) 01 00 FF 0A 10 31 33 39 34 33 35 39 37 00 00 00 +(V) 00 00 00 00 00 02 02 09 06 00 00 60 01 07 FF 0A +(V) 04 5A 46 46 31 02 03 09 06 01 00 01 07 00 FF 06 +(V) 00 00 24 A4 02 02 0F 00 16 1B 02 03 09 06 01 00 +(V) 02 07 00 FF 06 00 00 00 00 02 02 0F 00 16 1B 02 +(V) 03 09 06 01 00 03 07 00 FF 06 00 00 00 46 02 02 +(V) 0F 00 16 1D 02 03 09 06 01 00 04 07 00 FF 06 00 +(V) 00 00 00 02 02 0F 00 16 1D 02 03 09 06 01 00 1F +(V) 07 00 FF 10 0C 67 02 02 0F FE 16 21 02 03 09 06 +(V) 01 00 33 07 00 FF 10 00 00 02 02 0F FE 16 21 02 +(V) 03 09 06 01 00 47 07 00 FF 10 0D 5D 02 02 0F FE +(V) 16 21 02 03 09 06 01 00 20 07 00 FF 12 09 2E 02 +(V) 02 0F FF 16 23 02 03 09 06 01 00 34 07 00 FF 12 +(V) 00 00 02 02 0F FF 16 23 02 03 09 06 01 00 48 07 +(V) 00 FF 12 09 06 02 02 0F FF 16 23 +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:36 UTC, meter clock: 00:00:00, list type 2, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 A4 02 02 0F 00 16 1B 68 0D 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 A4 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 A4 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) A4 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:37 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 A4 02 02 0F 00 16 1B 68 0D 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 A4 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 A4 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) A4 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:39 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 D5 02 02 0F 00 16 1B F1 83 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 D5 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 D5 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) D5 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:42 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A1 1E 41 08 83 13 EE EE E6 E7 00 0F 40 00 00 +(V) 00 00 01 0D 02 02 09 06 01 01 00 02 81 FF 0A 0B +(V) 45 4D 42 52 49 51 5F 56 31 5F 31 02 02 09 06 00 +(V) 00 60 01 00 FF 0A 10 31 33 39 34 33 35 39 37 00 +(V) 00 00 00 00 00 00 00 02 02 09 06 00 00 60 01 07 +(V) FF 0A 04 5A 46 46 31 02 03 09 06 01 00 01 07 00 +(V) FF 06 00 00 24 D5 02 02 0F 00 16 1B 02 03 09 06 +(V) 01 00 02 07 00 FF 06 00 00 00 00 02 02 0F 00 16 +(V) 1B 02 03 09 06 01 00 03 07 00 FF 06 00 00 00 3C +(V) 02 02 0F 00 16 1D 02 03 09 06 01 00 04 07 00 FF +(V) 06 00 00 00 00 02 02 0F 00 16 1D 02 03 09 06 01 +(V) 00 1F 07 00 FF 10 0C 77 02 02 0F FE 16 21 02 03 +(V) 09 06 01 00 33 07 00 FF 10 00 00 02 02 0F FE 16 +(V) 21 02 03 09 06 01 00 47 07 00 FF 10 0D 5F 02 02 +(V) 0F FE 16 21 02 03 09 06 01 00 20 07 00 FF 12 09 +(V) 2E 02 02 0F FF 16 23 02 03 09 06 01 00 34 07 00 +(V) FF 12 00 00 02 02 0F FF 16 23 02 03 09 06 01 00 +(V) 48 07 00 FF 12 09 06 02 02 0F FF 16 23 4A 9D 7E +(V) +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 0D 02 02 09 06 01 +(V) 01 00 02 81 FF 0A 0B 45 4D 42 52 49 51 5F 56 31 +(V) 5F 31 02 02 09 06 00 00 60 01 00 FF 0A 10 31 33 +(V) 39 34 33 35 39 37 00 00 00 00 00 00 00 00 02 02 +(V) 09 06 00 00 60 01 07 FF 0A 04 5A 46 46 31 02 03 +(V) 09 06 01 00 01 07 00 FF 06 00 00 24 D5 02 02 0F +(V) 00 16 1B 02 03 09 06 01 00 02 07 00 FF 06 00 00 +(V) 00 00 02 02 0F 00 16 1B 02 03 09 06 01 00 03 07 +(V) 00 FF 06 00 00 00 3C 02 02 0F 00 16 1D 02 03 09 +(V) 06 01 00 04 07 00 FF 06 00 00 00 00 02 02 0F 00 +(V) 16 1D 02 03 09 06 01 00 1F 07 00 FF 10 0C 77 02 +(V) 02 0F FE 16 21 02 03 09 06 01 00 33 07 00 FF 10 +(V) 00 00 02 02 0F FE 16 21 02 03 09 06 01 00 47 07 +(V) 00 FF 10 0D 5F 02 02 0F FE 16 21 02 03 09 06 01 +(V) 00 20 07 00 FF 12 09 2E 02 02 0F FF 16 23 02 03 +(V) 09 06 01 00 34 07 00 FF 12 00 00 02 02 0F FF 16 +(V) 23 02 03 09 06 01 00 48 07 00 FF 12 09 06 02 02 +(V) 0F FF 16 23 +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 0D 02 02 09 06 01 01 00 02 +(V) 81 FF 0A 0B 45 4D 42 52 49 51 5F 56 31 5F 31 02 +(V) 02 09 06 00 00 60 01 00 FF 0A 10 31 33 39 34 33 +(V) 35 39 37 00 00 00 00 00 00 00 00 02 02 09 06 00 +(V) 00 60 01 07 FF 0A 04 5A 46 46 31 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 D5 02 02 0F 00 16 1B +(V) 02 03 09 06 01 00 02 07 00 FF 06 00 00 00 00 02 +(V) 02 0F 00 16 1B 02 03 09 06 01 00 03 07 00 FF 06 +(V) 00 00 00 3C 02 02 0F 00 16 1D 02 03 09 06 01 00 +(V) 04 07 00 FF 06 00 00 00 00 02 02 0F 00 16 1D 02 +(V) 03 09 06 01 00 1F 07 00 FF 10 0C 77 02 02 0F FE +(V) 16 21 02 03 09 06 01 00 33 07 00 FF 10 00 00 02 +(V) 02 0F FE 16 21 02 03 09 06 01 00 47 07 00 FF 10 +(V) 0D 5F 02 02 0F FE 16 21 02 03 09 06 01 00 20 07 +(V) 00 FF 12 09 2E 02 02 0F FF 16 23 02 03 09 06 01 +(V) 00 34 07 00 FF 12 00 00 02 02 0F FF 16 23 02 03 +(V) 09 06 01 00 48 07 00 FF 12 09 06 02 02 0F FF 16 +(V) 23 +(D) Received valid DLMS at 18 +267 +(V) Using application data: +(V) 01 0D 02 02 09 06 01 01 00 02 81 FF 0A 0B 45 4D +(V) 42 52 49 51 5F 56 31 5F 31 02 02 09 06 00 00 60 +(V) 01 00 FF 0A 10 31 33 39 34 33 35 39 37 00 00 00 +(V) 00 00 00 00 00 02 02 09 06 00 00 60 01 07 FF 0A +(V) 04 5A 46 46 31 02 03 09 06 01 00 01 07 00 FF 06 +(V) 00 00 24 D5 02 02 0F 00 16 1B 02 03 09 06 01 00 +(V) 02 07 00 FF 06 00 00 00 00 02 02 0F 00 16 1B 02 +(V) 03 09 06 01 00 03 07 00 FF 06 00 00 00 3C 02 02 +(V) 0F 00 16 1D 02 03 09 06 01 00 04 07 00 FF 06 00 +(V) 00 00 00 02 02 0F 00 16 1D 02 03 09 06 01 00 1F +(V) 07 00 FF 10 0C 77 02 02 0F FE 16 21 02 03 09 06 +(V) 01 00 33 07 00 FF 10 00 00 02 02 0F FE 16 21 02 +(V) 03 09 06 01 00 47 07 00 FF 10 0D 5F 02 02 0F FE +(V) 16 21 02 03 09 06 01 00 20 07 00 FF 12 09 2E 02 +(V) 02 0F FF 16 23 02 03 09 06 01 00 34 07 00 FF 12 +(V) 00 00 02 02 0F FF 16 23 02 03 09 06 01 00 48 07 +(V) 00 FF 12 09 06 02 02 0F FF 16 23 +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:46 UTC, meter clock: 00:00:00, list type 2, est: 1) +qq(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 D5 02 02 0F 00 16 1B F1 83 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 D5 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 D5 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) D5 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:47 UTC, meter clock: 00:00:00, list type 1, est: 1) +q +* Debug: Command received: qqqqq +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 B8 02 02 0F 00 16 1B 3B 09 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 B8 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 B8 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) B8 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:49 UTC, meter clock: 00:00:00, list type 1, est: 1) +(V) HDLC frame: +(V) 7E A0 2A 41 08 83 13 04 13 E6 E7 00 0F 40 00 00 +(V) 00 00 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 +(V) 00 24 B8 02 02 0F 00 16 1B 3B 09 7E +(V) LLC frame: +(V) E6 E7 00 0F 40 00 00 00 00 01 01 02 03 09 06 01 +(V) 00 01 07 00 FF 06 00 00 24 B8 02 02 0F 00 16 1B +(V) +(V) DLMS frame: +(V) 0F 40 00 00 00 00 01 01 02 03 09 06 01 00 01 07 +(V) 00 FF 06 00 00 24 B8 02 02 0F 00 16 1B +(D) Received valid DLMS at 18 +23 +(V) Using application data: +(V) 01 01 02 03 09 06 01 00 01 07 00 FF 06 00 00 24 +(V) B8 02 02 0F 00 16 1B +(V) DLMS +(D) NOT Ready to update (internal clock 12:32:51 UTC, meter clock: 00:00:00, list type 1, est: 1) +q +* Debug: Command received: q +* Closing client connection ... diff --git a/lib/AmsConfiguration/include/AmsConfiguration.h b/lib/AmsConfiguration/include/AmsConfiguration.h index 0b2db91c..89b263a2 100644 --- a/lib/AmsConfiguration/include/AmsConfiguration.h +++ b/lib/AmsConfiguration/include/AmsConfiguration.h @@ -13,7 +13,6 @@ #define EEPROM_CHECK_SUM 104 // Used to check if config is stored. Change if structure changes #define EEPROM_CLEARED_INDICATOR 0xFC #define EEPROM_CONFIG_ADDRESS 0 -#define EEPROM_TEMP_CONFIG_ADDRESS 2048 #define CONFIG_SYSTEM_START 8 #define CONFIG_NETWORK_START 40 @@ -30,6 +29,7 @@ #define CONFIG_UI_START 1720 #define CONFIG_CLOUD_START 1742 #define CONFIG_UPGRADE_INFO_START 1934 +#define CONFIG_ZC_START 2000 #define CONFIG_METER_START_103 32 #define CONFIG_UPGRADE_INFO_START_103 216 @@ -256,6 +256,12 @@ struct CloudConfig { uint8_t proto; }; // 88 +struct ZmartChargeConfig { + bool enabled; + char token[21]; + char baseUrl[64]; +}; // 86 + class AmsConfiguration { public: bool hasConfig(); @@ -349,6 +355,13 @@ public: void clearCloudConfig(CloudConfig&); bool isCloudChanged(); void ackCloudConfig(); + + bool getZmartChargeConfig(ZmartChargeConfig&); + bool setZmartChargeConfig(ZmartChargeConfig&); + void clearZmartChargeConfig(ZmartChargeConfig&); + bool isZmartChargeConfigChanged(); + void ackZmartChargeConfig(); + void clear(); @@ -357,7 +370,7 @@ protected: private: uint8_t configVersion = 0; - bool sysChanged = false, networkChanged = false, mqttChanged = false, webChanged = false, meterChanged = true, ntpChanged = true, priceChanged = false, energyAccountingChanged = true, cloudChanged = true, uiLanguageChanged = false; + bool sysChanged = false, networkChanged = false, mqttChanged = false, webChanged = false, meterChanged = true, ntpChanged = true, priceChanged = false, energyAccountingChanged = true, cloudChanged = true, uiLanguageChanged = false, zcChanged = true; bool relocateConfig103(); // 2.2.12, until, but not including 2.3 diff --git a/lib/AmsConfiguration/include/hexutils.h b/lib/AmsConfiguration/include/hexutils.h index 73f62c66..8c344639 100644 --- a/lib/AmsConfiguration/include/hexutils.h +++ b/lib/AmsConfiguration/include/hexutils.h @@ -13,7 +13,7 @@ String toHex(uint8_t* in); String toHex(uint8_t* in, uint16_t size); void fromHex(uint8_t *out, String in, uint16_t size); -bool stripNonAscii(uint8_t* in, uint16_t size, bool extended = false); +bool stripNonAscii(uint8_t* in, uint16_t size, bool extended = false, bool trim = true); void debugPrint(uint8_t *buffer, uint16_t start, uint16_t length, Print* debugger); #endif \ No newline at end of file diff --git a/lib/AmsConfiguration/src/AmsConfiguration.cpp b/lib/AmsConfiguration/src/AmsConfiguration.cpp index 1171fd63..927e5776 100644 --- a/lib/AmsConfiguration/src/AmsConfiguration.cpp +++ b/lib/AmsConfiguration/src/AmsConfiguration.cpp @@ -13,13 +13,17 @@ bool AmsConfiguration::getSystemConfig(SystemConfig& config) { EEPROM.begin(EEPROM_SIZE); uint8_t configVersion = EEPROM.read(EEPROM_CONFIG_ADDRESS); - if(configVersion == EEPROM_CHECK_SUM || configVersion == EEPROM_CLEARED_INDICATOR) { + if(configVersion == EEPROM_CHECK_SUM) { EEPROM.get(CONFIG_SYSTEM_START, config); EEPROM.end(); return true; } else { - config.boardType = 0xFF; - config.vendorConfigured = false; + if(configVersion == EEPROM_CLEARED_INDICATOR) { + config.vendorConfigured = true; + } else { + config.vendorConfigured = false; + config.boardType = 0xFF; + } config.userConfigured = false; config.dataCollectionConsent = 0; config.energyspeedometer = 0; @@ -91,7 +95,7 @@ bool AmsConfiguration::setNetworkConfig(NetworkConfig& config) { } stripNonAscii((uint8_t*) config.ssid, 32, true); - stripNonAscii((uint8_t*) config.psk, 64, true); + stripNonAscii((uint8_t*) config.psk, 64, true, false); stripNonAscii((uint8_t*) config.ip, 16); stripNonAscii((uint8_t*) config.gateway, 16); stripNonAscii((uint8_t*) config.subnet, 16); @@ -186,7 +190,7 @@ bool AmsConfiguration::setMqttConfig(MqttConfig& config) { stripNonAscii((uint8_t*) config.publishTopic, 64); stripNonAscii((uint8_t*) config.subscribeTopic, 64); stripNonAscii((uint8_t*) config.username, 128, true); - stripNonAscii((uint8_t*) config.password, 256, true); + stripNonAscii((uint8_t*) config.password, 256, true, false); if(config.timeout < 500) config.timeout = 1000; if(config.timeout > 10000) config.timeout = 1000; if(config.keepalive < 5) config.keepalive = 60; @@ -252,7 +256,7 @@ bool AmsConfiguration::setWebConfig(WebConfig& config) { } stripNonAscii((uint8_t*) config.username, 37); - stripNonAscii((uint8_t*) config.password, 37); + stripNonAscii((uint8_t*) config.password, 37, false, false); stripNonAscii((uint8_t*) config.context, 37); EEPROM.begin(EEPROM_SIZE); @@ -892,6 +896,65 @@ void AmsConfiguration::ackCloudConfig() { cloudChanged = false; } +bool AmsConfiguration::getZmartChargeConfig(ZmartChargeConfig& config) { + if(hasConfig()) { + EEPROM.begin(EEPROM_SIZE); + EEPROM.get(CONFIG_ZC_START, config); + EEPROM.end(); + stripNonAscii((uint8_t*) config.token, 21); + stripNonAscii((uint8_t*) config.baseUrl, 64); + if(strlen(config.token) < 20) { + config.enabled = false; + memset(config.token, 0, 64); + memset(config.baseUrl, 0, 64); + } + if(strncmp_P(config.baseUrl, PSTR("https"), 5) != 0) { + memset(config.baseUrl, 0, 64); + snprintf_P(config.baseUrl, 64, PSTR("https://main.zmartcharge.com/api")); + } + return true; + } else { + clearZmartChargeConfig(config); + return false; + } +} + +bool AmsConfiguration::setZmartChargeConfig(ZmartChargeConfig& config) { + ZmartChargeConfig existing; + if(getZmartChargeConfig(existing)) { + zcChanged |= config.enabled != existing.enabled; + zcChanged |= memcmp(config.token, existing.token, 21) != 0; + zcChanged |= memcmp(config.token, existing.baseUrl, 64) != 0; + } else { + zcChanged = true; + } + + stripNonAscii((uint8_t*) config.token, 21); + stripNonAscii((uint8_t*) config.baseUrl, 64); + if(strncmp_P(config.baseUrl, PSTR("https"), 5) != 0) { + memset(config.baseUrl, 0, 64); + } + + EEPROM.begin(EEPROM_SIZE); + EEPROM.put(CONFIG_ZC_START, config); + bool ret = EEPROM.commit(); + EEPROM.end(); + return ret; +} + +void AmsConfiguration::clearZmartChargeConfig(ZmartChargeConfig& config) { + config.enabled = false; + memset(config.token, 0, 21); +} + +bool AmsConfiguration::isZmartChargeConfigChanged() { + return zcChanged; +} + +void AmsConfiguration::ackZmartChargeConfig() { + zcChanged = false; +} + void AmsConfiguration::setUiLanguageChanged() { uiLanguageChanged = true; } @@ -1093,6 +1156,10 @@ bool AmsConfiguration::relocateConfig103() { clearCloudConfig(cloud); EEPROM.put(CONFIG_CLOUD_START, cloud); + ZmartChargeConfig zcc; + clearZmartChargeConfig(zcc); + EEPROM.put(CONFIG_ZC_START, zcc); + EEPROM.put(EEPROM_CONFIG_ADDRESS, 104); bool ret = EEPROM.commit(); EEPROM.end(); @@ -1101,6 +1168,7 @@ bool AmsConfiguration::relocateConfig103() { bool AmsConfiguration::save() { EEPROM.begin(EEPROM_SIZE); + uint8_t configVersion = EEPROM.read(EEPROM_CONFIG_ADDRESS); EEPROM.put(EEPROM_CONFIG_ADDRESS, EEPROM_CHECK_SUM); bool success = EEPROM.commit(); EEPROM.end(); diff --git a/lib/AmsConfiguration/src/hexutils.cpp b/lib/AmsConfiguration/src/hexutils.cpp index c355b858..65fb19de 100644 --- a/lib/AmsConfiguration/src/hexutils.cpp +++ b/lib/AmsConfiguration/src/hexutils.cpp @@ -28,7 +28,7 @@ void fromHex(uint8_t *out, String in, uint16_t size) { } } -bool stripNonAscii(uint8_t* in, uint16_t size, bool extended) { +bool stripNonAscii(uint8_t* in, uint16_t size, bool extended, bool trim) { bool ret = false; for(uint16_t i = 0; i < size; i++) { if(in[i] == 0) { // Clear the rest with null-terminator @@ -43,6 +43,22 @@ bool stripNonAscii(uint8_t* in, uint16_t size, bool extended) { ret = true; } } + if(trim) { + // Strip leading spaces + while(in[0] == ' ') { + for(uint16_t i = 0; i < size; i++) { + in[i] = in[i+1]; + } + } + // Strip trailing spaces + for(int i = size-1; i > 0; i--) { + if(in[i] == ' ' || in[i] == 0) { + memset(in+i, 0, 1); + } else { + break; + } + } + } memset(in+size-1, 0, 1); // Make sure the last character is null-terminator return ret; } diff --git a/lib/AmsDecoder/include/DataParser.h b/lib/AmsDecoder/include/DataParser.h index eb80e6ce..a5eedfd6 100644 --- a/lib/AmsDecoder/include/DataParser.h +++ b/lib/AmsDecoder/include/DataParser.h @@ -24,7 +24,7 @@ #define DATA_PARSE_OK 0 #define DATA_PARSE_FAIL -1 #define DATA_PARSE_INCOMPLETE -2 -#define DATA_PARSE_BOUNDRY_FLAG_MISSING -3 +#define DATA_PARSE_BOUNDARY_FLAG_MISSING -3 #define DATA_PARSE_HEADER_CHECKSUM_ERROR -4 #define DATA_PARSE_FOOTER_CHECKSUM_ERROR -5 #define DATA_PARSE_INTERMEDIATE_SEGMENT -6 diff --git a/lib/AmsDecoder/src/Cosem.cpp b/lib/AmsDecoder/src/Cosem.cpp index 4cf3075a..cbf0c78f 100644 --- a/lib/AmsDecoder/src/Cosem.cpp +++ b/lib/AmsDecoder/src/Cosem.cpp @@ -19,8 +19,6 @@ time_t decodeCosemDateTime(CosemDateTime timestamp) { tm.Minute = timestamp.minute; tm.Second = timestamp.second; - //Serial.printf("\nY: %d, M: %d, D: %d, h: %d, m: %d, s: %d, deviation: 0x%2X, status: 0x%1X\n", tm.Year, tm.Month, tm.Day, tm.Hour, tm.Minute, tm.Second, timestamp.deviation, timestamp.status); - time_t time = makeTime(tm); int16_t deviation = ntohs(timestamp.deviation); if(deviation >= -720 && deviation <= 720) { diff --git a/lib/AmsDecoder/src/DsmrParser.cpp b/lib/AmsDecoder/src/DsmrParser.cpp index e638f015..fdc64d45 100644 --- a/lib/AmsDecoder/src/DsmrParser.cpp +++ b/lib/AmsDecoder/src/DsmrParser.cpp @@ -17,7 +17,7 @@ int8_t DSMRParser::parse(uint8_t *buf, DataParserContext &ctx, bool verified, Pr uint8_t lastByte = 0x00; for(uint16_t pos = 0; pos < ctx.length; pos++) { uint8_t b = *(buf+pos); - if(pos == 0 && b != '/') return DATA_PARSE_BOUNDRY_FLAG_MISSING; + if(pos == 0 && b != '/') return DATA_PARSE_BOUNDARY_FLAG_MISSING; if(pos > 0 && b == '!') crcPos = pos+1; if(crcPos > 0 && b == 0x0A && lastByte == 0x0D) { reachedEnd = true; diff --git a/lib/AmsDecoder/src/GbtParser.cpp b/lib/AmsDecoder/src/GbtParser.cpp index ec5d3a25..ee82d662 100644 --- a/lib/AmsDecoder/src/GbtParser.cpp +++ b/lib/AmsDecoder/src/GbtParser.cpp @@ -11,7 +11,7 @@ int8_t GBTParser::parse(uint8_t *d, DataParserContext &ctx) { GBTHeader* h = (GBTHeader*) (d); uint16_t sequence = ntohs(h->sequence); - if(h->flag != GBT_TAG) return DATA_PARSE_BOUNDRY_FLAG_MISSING; + if(h->flag != GBT_TAG) return DATA_PARSE_BOUNDARY_FLAG_MISSING; if(sequence == 1) { if(buf == NULL) buf = (uint8_t *)malloc((size_t)1024); // TODO find out from first package ? diff --git a/lib/AmsDecoder/src/GcmParser.cpp b/lib/AmsDecoder/src/GcmParser.cpp index 54de8a71..3cde0323 100644 --- a/lib/AmsDecoder/src/GcmParser.cpp +++ b/lib/AmsDecoder/src/GcmParser.cpp @@ -23,7 +23,7 @@ int8_t GCMParser::parse(uint8_t *d, DataParserContext &ctx, bool hastag) { uint32_t headersize = 0; uint8_t* ptr = (uint8_t*) d; if(hastag) { - if(*ptr != GCM_TAG) return DATA_PARSE_BOUNDRY_FLAG_MISSING; + if(*ptr != GCM_TAG) return DATA_PARSE_BOUNDARY_FLAG_MISSING; ptr++; headersize++; } diff --git a/lib/AmsDecoder/src/HdlcParser.cpp b/lib/AmsDecoder/src/HdlcParser.cpp index 3606e3cc..4f33f10c 100644 --- a/lib/AmsDecoder/src/HdlcParser.cpp +++ b/lib/AmsDecoder/src/HdlcParser.cpp @@ -29,7 +29,7 @@ int8_t HDLCParser::parse(uint8_t *d, DataParserContext &ctx) { // First and last byte should be HDLC_FLAG if(h->flag != HDLC_FLAG || f->flag != HDLC_FLAG) - return DATA_PARSE_BOUNDRY_FLAG_MISSING; + return DATA_PARSE_BOUNDARY_FLAG_MISSING; // Verify FCS if(ntohs(f->fcs) != crc16_x25(d + 1, len - sizeof *f - 1)) diff --git a/lib/AmsDecoder/src/MbusParser.cpp b/lib/AmsDecoder/src/MbusParser.cpp index 85285de8..ae948dfd 100644 --- a/lib/AmsDecoder/src/MbusParser.cpp +++ b/lib/AmsDecoder/src/MbusParser.cpp @@ -19,7 +19,7 @@ int8_t MBUSParser::parse(uint8_t *d, DataParserContext &ctx) { MbusHeader* mh = (MbusHeader*) d; if(mh->flag1 != MBUS_START || mh->flag2 != MBUS_START) - return DATA_PARSE_BOUNDRY_FLAG_MISSING; + return DATA_PARSE_BOUNDARY_FLAG_MISSING; // First two bytes is 1-byte length value repeated. Only used for last segment if(mh->len1 != mh->len2) @@ -40,7 +40,7 @@ int8_t MBUSParser::parse(uint8_t *d, DataParserContext &ctx) { MbusFooter* mf = (MbusFooter*) (d + len + headersize); if(mf->flag != MBUS_END) - return DATA_PARSE_BOUNDRY_FLAG_MISSING; + return DATA_PARSE_BOUNDARY_FLAG_MISSING; if(checksum(d + headersize, len) != mf->fcs) return DATA_PARSE_FOOTER_CHECKSUM_ERROR; diff --git a/lib/MeterCommunicators/include/IEC6205675.h b/lib/MeterCommunicators/include/IEC6205675.h index f4aaa9bb..3cd82b22 100644 --- a/lib/MeterCommunicators/include/IEC6205675.h +++ b/lib/MeterCommunicators/include/IEC6205675.h @@ -11,6 +11,9 @@ #include "AmsConfiguration.h" #include "DataParser.h" #include "Cosem.h" +#if defined(AMS_REMOTE_DEBUG) +#include "RemoteDebug.h" +#endif #define NOVALUE 0xFFFFFFFF @@ -21,7 +24,11 @@ struct AmsOctetTimestamp { class IEC6205675 : public AmsData { public: - IEC6205675(const char* payload, uint8_t useMeterType, MeterConfig* meterConfig, DataParserContext &ctx, AmsData &state); + #if defined(AMS_REMOTE_DEBUG) + IEC6205675(const char* payload, uint8_t useMeterType, MeterConfig* meterConfig, DataParserContext &ctx, AmsData &state, RemoteDebug* debugger); + #else + IEC6205675(const char* payload, uint8_t useMeterType, MeterConfig* meterConfig, DataParserContext &ctx, AmsData &state, Stream* debugger); + #endif private: CosemData* getCosemDataAt(uint8_t index, const char* ptr); diff --git a/lib/MeterCommunicators/src/IEC6205675.cpp b/lib/MeterCommunicators/src/IEC6205675.cpp index b02e7a35..17ccebed 100644 --- a/lib/MeterCommunicators/src/IEC6205675.cpp +++ b/lib/MeterCommunicators/src/IEC6205675.cpp @@ -11,7 +11,11 @@ #include "Uptime.h" #include "hexutils.h" -IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterConfig, DataParserContext &ctx, AmsData &state) { +#if defined(AMS_REMOTE_DEBUG) +IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterConfig, DataParserContext &ctx, AmsData &state, RemoteDebug* debugger) { +#else +IEC6205675::IEC6205675(const char* payload, uint8_t useMeterType, MeterConfig* meterConfig, DataParserContext &ctx, AmsData &state, Stream* debugger) { +#endif float val; char str[64]; @@ -635,12 +639,6 @@ IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterCo } } - if(this->packageTimestamp > 0) { - if(meterType == AmsTypeKamstrup) { - this->packageTimestamp = this->packageTimestamp - 3600; - } - } - uint8_t str_len = 0; str_len = getString(AMS_OBIS_VERSION, sizeof(AMS_OBIS_VERSION), ((char *) (d)), str); if(str_len > 0) { @@ -741,8 +739,12 @@ IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, MeterConfig* meterCo if(meterTs != NULL) { AmsOctetTimestamp* amst = (AmsOctetTimestamp*) meterTs; time_t ts = decodeCosemDateTime(amst->dt); - if(amst->dt.deviation == 0x8000) { // Deviation not specified, adjust from localtime to UTC + int16_t deviation = ntohs(amst->dt.deviation); + if(deviation < -720 || deviation > 720) { // Deviation not specified, adjust from localtime to UTC meterTimestamp = tz.toUTC(ts); + if(ctx.timestamp > 0) { + this->packageTimestamp = tz.toUTC(ctx.timestamp); + } } else if(meterType == AmsTypeAidon) { meterTimestamp = ts - 3600; // 21.09.24, the clock is now correct } else { diff --git a/lib/MeterCommunicators/src/PassiveMeterCommunicator.cpp b/lib/MeterCommunicators/src/PassiveMeterCommunicator.cpp index 8ffa500b..60b499c8 100644 --- a/lib/MeterCommunicators/src/PassiveMeterCommunicator.cpp +++ b/lib/MeterCommunicators/src/PassiveMeterCommunicator.cpp @@ -278,7 +278,7 @@ AmsData* PassiveMeterCommunicator::getData(AmsData& meterState) { #endif debugger->printf_P(PSTR("DLMS\n")); // TODO: Split IEC6205675 into DataParserKaifa and DataParserObis. This way we can add other means of parsing, for those other proprietary formats - data = new IEC6205675(payload, meterState.getMeterType(), &meterConfig, ctx, meterState); + data = new IEC6205675(payload, meterState.getMeterType(), &meterConfig, ctx, meterState, debugger); } } else if(ctx.type == DATA_TAG_DSMR) { data = new IEC6205621(payload, tz, &meterConfig); @@ -509,11 +509,11 @@ void PassiveMeterCommunicator::printHanReadError(int pos) { #endif { switch(pos) { - case DATA_PARSE_BOUNDRY_FLAG_MISSING: + case DATA_PARSE_BOUNDARY_FLAG_MISSING: #if defined(AMS_REMOTE_DEBUG) if (debugger->isActive(RemoteDebug::WARNING)) #endif - debugger->printf_P(PSTR("Boundry flag missing\n")); + debugger->printf_P(PSTR("Boundary flag missing\n")); break; case DATA_PARSE_HEADER_CHECKSUM_ERROR: #if defined(AMS_REMOTE_DEBUG) diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index 22dbead3..55b96b5b 100644 --- a/lib/SvelteUi/app/dist/index.js +++ b/lib/SvelteUi/app/dist/index.js @@ -1,7 +1,7 @@ -var Zu=Object.defineProperty;var Ju=(t,e,l)=>e in t?Zu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[e]=l;var mi=(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 o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function ze(){}function gl(t,e){for(const l in e)t[l]=e[l];return t}function eu(t){return t()}function bo(){return Object.create(null)}function zt(t){t.forEach(eu)}function Hi(t){return typeof t=="function"}function St(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Zn;function oi(t,e){return t===e?!0:(Zn||(Zn=document.createElement("a")),Zn.href=e,t===Zn.href)}function $u(t){return Object.keys(t).length===0}function zi(t,...e){if(t==null){for(const n of e)n(void 0);return ze}const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function rn(t){let e;return zi(t,l=>e=l)(),e}function Tl(t,e,l){t.$$.on_destroy.push(zi(e,l))}function yi(t,e,l,n){if(t){const i=tu(t,e,l,n);return t[0](i)}}function tu(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 o=[],a=Math.max(e.dirty.length,i.length);for(let r=0;r32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function 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 er=["width","height"];function Sn(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&&er.indexOf(n)===-1?t[n]=e[n]:u(t,n,e[n])}function Fe(t){return t===""?null:+t}function tr(t){return Array.from(t.childNodes)}function E(t,e){e=""+e,t.data!==e&&(t.data=e)}function lr(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function nr(t,e,l){~xu.indexOf(l)?lr(t,e):E(t,e)}function H(t,e){t.value=e??""}function ln(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function He(t,e,l){for(let n=0;n{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=re(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),P(n)}}function or(t,e,{bubbles:l=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:l,cancelable:n})}function go(t,e){return new t(e)}let zn;function Un(t){zn=t}function Kn(){if(!zn)throw new Error("Function called outside component initialization");return zn}function lu(t){Kn().$$.on_mount.push(t)}function sr(t){Kn().$$.on_destroy.push(t)}function ar(){const t=Kn();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=or(e,l,{cancelable:n});return i.slice().forEach(a=>{a.call(t,o)}),!o.defaultPrevented}return!0}}function jn(t,e){return Kn().$$.context.set(t,e),e}function on(t){return Kn().$$.context.get(t)}const vn=[],fi=[];let wn=[];const ko=[],nu=Promise.resolve();let Ci=!1;function iu(){Ci||(Ci=!0,nu.then(ou))}function fr(){return iu(),nu}function At(t){wn.push(t)}const pi=new Set;let dn=0;function ou(){if(dn!==0)return;const t=zn;do{try{for(;dnt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),wn=e}const ni=new Set;let an;function mt(){an={r:0,c:[],p:an}}function pt(){an.r||zt(an.c),an=an.p}function X(t,e){t&&t.i&&(ni.delete(t),t.i(e))}function ee(t,e,l,n){if(t&&t.o){if(ni.has(t))return;ni.add(t),an.c.push(()=>{ni.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function ft(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function Si(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const a=t[o],r=e[o];if(r){for(const f in a)f in r||(n[f]=1);for(const f in r)i[f]||(l[f]=r[f],i[f]=1);t[o]=r}else for(const f in a)i[f]=1}for(const a in n)a in l||(l[a]=void 0);return l}function $n(t){return typeof t=="object"&&t!==null?t:{}}function Ne(t){t&&t.c()}function Me(t,e,l){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,l),At(()=>{const o=t.$$.on_mount.map(eu).filter(Hi);t.$$.on_destroy?t.$$.on_destroy.push(...o):zt(o),t.$$.on_mount=[]}),i.forEach(At)}function Pe(t,e){const l=t.$$;l.fragment!==null&&(rr(l.after_update),zt(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function cr(t,e){t.$$.dirty[0]===-1&&(vn.push(t),iu(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=v.length?v[0]:d;return c.ctx&&i(c.ctx[_],c.ctx[_]=g)&&(!c.skip_bound&&c.bound[_]&&c.bound[_](g),m&&cr(t,_)),d}):[],c.update(),m=!0,zt(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const _=tr(e.target);c.fragment&&c.fragment.l(_),_.forEach(P)}else c.fragment&&c.fragment.c();e.intro&&X(t.$$.fragment),Me(t,e.target,e.anchor),ou()}Un(f)}class Nt{constructor(){mi(this,"$$");mi(this,"$$set")}$destroy(){Pe(this,1),this.$destroy=ze}$on(e,l){if(!Hi(l))return ze;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(l),()=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!$u(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const _r="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(_r);const wo=t=>typeof t>"u",su=t=>typeof t=="function",au=t=>typeof t=="number";function mr(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function fu(){let t=0;return()=>t++}function pr(){return Math.random().toString(36).substring(2)}const Ol=typeof window>"u";function uu(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const ru=(t,e)=>t?{}:{style:e},Mi=t=>({"aria-hidden":"true",...ru(t,"display:none;")}),hn=[];function cu(t,e){return{subscribe:sl(t,e).subscribe}}function sl(t,e=ze){let l;const n=new Set;function i(r){if(St(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:o,subscribe:a}}function dr(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 o=e.length<2;return cu(l,(a,r)=>{let f=!1;const c=[];let m=0,_=ze;const d=()=>{if(m)return;_();const g=e(n?c[0]:c,a,r);o?a(g):_=Hi(g)?g:ze},v=i.map((g,b)=>zi(g,k=>{c[b]=k,m&=~(1<{m|=1<`@@svnav-ctx__${t}`,Pi=Yn("LOCATION"),Mn=Yn("ROUTER"),_u=Yn("ROUTE"),hr=Yn("ROUTE_PARAMS"),vr=Yn("FOCUS_ELEM"),mu=/^:(.+)/,Fn=(t,e,l)=>t.substr(e,l),Ni=(t,e)=>Fn(t,0,e.length)===e,br=t=>t==="",gr=t=>mu.test(t),pu=t=>t[0]==="*",kr=t=>t.replace(/\*.*$/,""),du=t=>t.replace(/(^\/+|\/+$)/g,"");function ql(t,e=!1){const l=du(t).split("/");return e?l.filter(Boolean):l}const di=(t,e)=>t+(e?`?${e}`:""),Yi=t=>`/${du(t)}`;function Qn(...t){const e=n=>ql(n,!0).join("/"),l=t.map(e).join("/");return Yi(l)}const Qi=1,ci=2,_n=3,wr=4,hu=5,Cr=6,vu=7,Sr=8,Mr=9,bu=10,gu=11,Pr={[Qi]:"Link",[ci]:"Route",[_n]:"Router",[wr]:"useFocus",[hu]:"useLocation",[Cr]:"useMatch",[vu]:"useNavigate",[Sr]:"useParams",[Mr]:"useResolvable",[bu]:"useResolve",[gu]:"navigate"},Xi=t=>Pr[t];function Nr(t,e){let l;return t===ci?l=e.path?`path="${e.path}"`:"default":t===Qi?l=`to="${e.to}"`:t===_n&&(l=`basepath="${e.basepath||""}"`),`<${Xi(t)} ${l||""} />`}function Tr(t,e,l,n){const i=l&&Nr(n||t,l),o=i?` +var $u=Object.defineProperty;var xu=(t,e,l)=>e in t?$u(t,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[e]=l;var mi=(t,e,l)=>(xu(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 o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function He(){}function Cl(t,e){for(const l in e)t[l]=e[l];return t}function nu(t){return t()}function go(){return Object.create(null)}function Ht(t){t.forEach(nu)}function zi(t){return typeof t=="function"}function St(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Zn;function oi(t,e){return t===e?!0:(Zn||(Zn=document.createElement("a")),Zn.href=e,t===Zn.href)}function er(t){return Object.keys(t).length===0}function Hi(t,...e){if(t==null){for(const n of e)n(void 0);return He}const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function rn(t){let e;return Hi(t,l=>e=l)(),e}function Tl(t,e,l){t.$$.on_destroy.push(Hi(e,l))}function yi(t,e,l,n){if(t){const i=iu(t,e,l,n);return t[0](i)}}function iu(t,e,l,n){return t[1]&&n?Cl(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 o=[],a=Math.max(e.dirty.length,i.length);for(let r=0;r32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function 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 lr=["width","height"];function Sn(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&&lr.indexOf(n)===-1?t[n]=e[n]:u(t,n,e[n])}function Fe(t){return t===""?null:+t}function nr(t){return Array.from(t.childNodes)}function E(t,e){e=""+e,t.data!==e&&(t.data=e)}function ir(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function or(t,e,l){~tr.indexOf(l)?ir(t,e):E(t,e)}function z(t,e){t.value=e??""}function ln(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function ze(t,e,l){for(let n=0;n{a.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=re(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),P(n)}}function ar(t,e,{bubbles:l=!1,cancelable:n=!1}={}){return new CustomEvent(t,{detail:e,bubbles:l,cancelable:n})}function ko(t,e){return new t(e)}let Hn;function Un(t){Hn=t}function Kn(){if(!Hn)throw new Error("Function called outside component initialization");return Hn}function Yi(t){Kn().$$.on_mount.push(t)}function fr(t){Kn().$$.on_destroy.push(t)}function ur(){const t=Kn();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=ar(e,l,{cancelable:n});return i.slice().forEach(a=>{a.call(t,o)}),!o.defaultPrevented}return!0}}function jn(t,e){return Kn().$$.context.set(t,e),e}function on(t){return Kn().$$.context.get(t)}const vn=[],fi=[];let wn=[];const wo=[],ou=Promise.resolve();let Ci=!1;function su(){Ci||(Ci=!0,ou.then(au))}function rr(){return su(),ou}function At(t){wn.push(t)}const pi=new Set;let dn=0;function au(){if(dn!==0)return;const t=Hn;do{try{for(;dnt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),wn=e}const ni=new Set;let an;function _t(){an={r:0,c:[],p:an}}function mt(){an.r||Ht(an.c),an=an.p}function X(t,e){t&&t.i&&(ni.delete(t),t.i(e))}function te(t,e,l,n){if(t&&t.o){if(ni.has(t))return;ni.add(t),an.c.push(()=>{ni.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function at(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function Si(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const a=t[o],r=e[o];if(r){for(const f in a)f in r||(n[f]=1);for(const f in r)i[f]||(l[f]=r[f],i[f]=1);t[o]=r}else for(const f in a)i[f]=1}for(const a in n)a in l||(l[a]=void 0);return l}function $n(t){return typeof t=="object"&&t!==null?t:{}}function Ne(t){t&&t.c()}function Me(t,e,l){const{fragment:n,after_update:i}=t.$$;n&&n.m(e,l),At(()=>{const o=t.$$.on_mount.map(nu).filter(zi);t.$$.on_destroy?t.$$.on_destroy.push(...o):Ht(o),t.$$.on_mount=[]}),i.forEach(At)}function Pe(t,e){const l=t.$$;l.fragment!==null&&(_r(l.after_update),Ht(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function mr(t,e){t.$$.dirty[0]===-1&&(vn.push(t),su(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=v.length?v[0]:d;return c.ctx&&i(c.ctx[_],c.ctx[_]=g)&&(!c.skip_bound&&c.bound[_]&&c.bound[_](g),m&&mr(t,_)),d}):[],c.update(),m=!0,Ht(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const _=nr(e.target);c.fragment&&c.fragment.l(_),_.forEach(P)}else c.fragment&&c.fragment.c();e.intro&&X(t.$$.fragment),Me(t,e.target,e.anchor),au()}Un(f)}class Nt{constructor(){mi(this,"$$");mi(this,"$$set")}$destroy(){Pe(this,1),this.$destroy=He}$on(e,l){if(!zi(l))return He;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&&!er(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const pr="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(pr);const Co=t=>typeof t>"u",fu=t=>typeof t=="function",uu=t=>typeof t=="number";function dr(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function ru(){let t=0;return()=>t++}function hr(){return Math.random().toString(36).substring(2)}const Ol=typeof window>"u";function cu(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const _u=(t,e)=>t?{}:{style:e},Mi=t=>({"aria-hidden":"true",..._u(t,"display:none;")}),hn=[];function mu(t,e){return{subscribe:fl(t,e).subscribe}}function fl(t,e=He){let l;const n=new Set;function i(r){if(St(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:o,subscribe:a}}function vr(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 o=e.length<2;return mu(l,(a,r)=>{let f=!1;const c=[];let m=0,_=He;const d=()=>{if(m)return;_();const g=e(n?c[0]:c,a,r);o?a(g):_=zi(g)?g:He},v=i.map((g,b)=>Hi(g,k=>{c[b]=k,m&=~(1<{m|=1<`@@svnav-ctx__${t}`,Pi=Yn("LOCATION"),Mn=Yn("ROUTER"),pu=Yn("ROUTE"),br=Yn("ROUTE_PARAMS"),gr=Yn("FOCUS_ELEM"),du=/^:(.+)/,Fn=(t,e,l)=>t.substr(e,l),Ni=(t,e)=>Fn(t,0,e.length)===e,kr=t=>t==="",wr=t=>du.test(t),hu=t=>t[0]==="*",Cr=t=>t.replace(/\*.*$/,""),vu=t=>t.replace(/(^\/+|\/+$)/g,"");function ql(t,e=!1){const l=vu(t).split("/");return e?l.filter(Boolean):l}const di=(t,e)=>t+(e?`?${e}`:""),Qi=t=>`/${vu(t)}`;function Qn(...t){const e=n=>ql(n,!0).join("/"),l=t.map(e).join("/");return Qi(l)}const Xi=1,ci=2,_n=3,Sr=4,bu=5,Mr=6,gu=7,Pr=8,Nr=9,ku=10,wu=11,Tr={[Xi]:"Link",[ci]:"Route",[_n]:"Router",[Sr]:"useFocus",[bu]:"useLocation",[Mr]:"useMatch",[gu]:"useNavigate",[Pr]:"useParams",[Nr]:"useResolvable",[ku]:"useResolve",[wu]:"navigate"},Zi=t=>Tr[t];function qr(t,e){let l;return t===ci?l=e.path?`path="${e.path}"`:"default":t===Xi?l=`to="${e.to}"`:t===_n&&(l=`basepath="${e.basepath||""}"`),`<${Zi(t)} ${l||""} />`}function Er(t,e,l,n){const i=l&&qr(n||t,l),o=i?` -Occurred in: ${i}`:"",a=Xi(t),r=su(e)?e(a):e;return`<${a}> ${r}${o}`}const ku=t=>(...e)=>t(Tr(...e)),wu=ku(t=>{throw new Error(t)}),ui=ku(console.warn),Co=4,qr=3,Er=2,Dr=1,Ar=1;function Or(t,e){const l=t.default?0:ql(t.fullPath).reduce((n,i)=>{let o=n;return o+=Co,br(i)?o+=Ar:gr(i)?o+=Er:pu(i)?o-=Co+Dr:o+=qr,o},0);return{route:t,score:l,index:e}}function Lr(t){return t.map(Or).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function Cu(t,e){let l,n;const[i]=e.split("?"),o=ql(i),a=o[0]==="",r=Lr(t);for(let f=0,c=r.length;f({...m,params:d,uri:M});if(m.default){n=v(e);continue}const g=ql(m.fullPath),b=Math.max(o.length,g.length);let k=0;for(;k{c===".."?f.pop():c!=="."&&f.push(c)}),di(`/${f.join("/")}`,n)}function So(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,a=ql(e,!0),r=ql(l,!0);for(;a.length;)a[0]!==r[0]&&wu(_n,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),a.shift(),r.shift();return{pathname:Qn(...r),hash:n,search:i,state:o}}const Mo=t=>t.length===1?"":t,Zi=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?Mo(Fn(t,l)):"",a=i?Fn(t,0,l):t,r=n?Mo(Fn(a,e)):"";return{pathname:(n?Fn(a,0,e):a)||"/",search:r,hash:o}},Rr=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function Fr(t,e,l){return Qn(l,Ir(t,e))}function Br(t,e){const l=Yi(kr(t)),n=ql(l,!0),i=ql(e,!0).slice(0,n.length),o=Su({fullPath:l},Qn(...i));return o&&o.uri}const hi="POP",Ur="PUSH",jr="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 Hr(t){let e=[],l=vi(t),n=hi;const i=(o=e)=>o.forEach(a=>a({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const a=()=>{l=vi(t),n=hi,i([o])};i([o]);const r=uu(t,"popstate",a);return()=>{r(),e=e.filter(f=>f!==o)}},navigate(o,a){const{state:r={},replace:f=!1}=a||{};if(n=f?jr:Ur,au(o))a&&ui(gu,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=hi,t.history.go(o);else{const c={...r,_key:pr()};try{t.history[f?"replaceState":"pushState"](c,"",o)}catch{t.location[f?"replace":"assign"](o)}}l=vi(t),i()}}}function bi(t,e){return{...Zi(e),state:t}}function zr(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,o){e++,l=l.slice(0,e),l.push(bi(n,o))},replaceState(n,i,o){l[e]=bi(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const yr=!!(!Ol&&window.document&&window.document.createElement),Wr=!Ol&&window.location.origin==="null",Mu=Hr(yr&&!Wr?window:zr()),{navigate:nn}=Mu;let El=null,Pu=!0;function Gr(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nEl.level||t.level===El.level&&Gr(t.routerId,El.routerId))&&(El=t)}function Kr(){El=null}function Yr(){Pu=!1}function Po(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=uu(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function Qr(t,e){return Number(t.dataset.svnavRouteEnd)===e}function Xr(t){return/^H[1-6]$/i.test(t.tagName)}function No(t,e=document){return e.querySelector(t)}function Zr(t){let l=No(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!Qr(l,t);){if(Xr(l))return l;const n=No("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||Zr(t.id);l||ui(_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,ci),!Po(l)&&Po(document.documentElement)})}const $r=(t,e,l)=>(n,i)=>fr().then(()=>{if(!El||Pu){Yr();return}if(n&&Jr(El.route),t.announcements&&i){const{path:o,fullPath:a,meta:r,params:f,uri:c}=El.route,m=t.createAnnouncement({path:o,fullPath:a,meta:r,params:f,uri:c},rn(l));Promise.resolve(m).then(_=>{e.set(_)})}Kr()}),xr="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 e1(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},ru(t[6],xr)],i={};for(let o=0;o`Navigated to ${Q.uri}`,announcements:!0,...g},M=m,L=Yi(m),R=on(Pi),F=on(Mn),T=!R,A=l1(),O=v&&!(F&&!F.manageFocus),j=sl("");Tl(t,j,Q=>l(0,r=Q));const K=F?F.disableInlineStyles:b,G=sl([]);Tl(t,G,Q=>l(20,a=Q));const q=sl(null);Tl(t,q,Q=>l(18,i=Q));let U=!1;const Z=T?0:F.level+1,Y=T?sl((()=>So(Ol?Zi(_):d.location,L))()):R;Tl(t,Y,Q=>l(17,n=Q));const W=sl(n);Tl(t,W,Q=>l(19,o=Q));const B=$r(k,j,Y),y=Q=>se=>se.filter(ue=>ue.id!==Q);function ne(Q){if(Ol){if(U)return;const se=Su(Q,n.pathname);if(se)return U=!0,se}else G.update(se=>{const ue=y(Q.id)(se);return ue.push(Q),ue})}function te(Q){G.update(y(Q))}return!T&&m!==To&&ui(_n,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:m}),T&&(lu(()=>d.listen(se=>{const ue=So(se.location,L);W.set(n),Y.set(ue)})),jn(Pi,Y)),jn(Mn,{activeRoute:q,registerRoute:ne,unregisterRoute:te,manageFocus:O,level:Z,id:A,history:T?d:F.history,basepath:T?L:F.basepath,disableInlineStyles:K}),t.$$set=Q=>{"basepath"in Q&&l(11,m=Q.basepath),"url"in Q&&l(12,_=Q.url),"history"in Q&&l(13,d=Q.history),"primary"in Q&&l(14,v=Q.primary),"a11y"in Q&&l(15,g=Q.a11y),"disableInlineStyles"in Q&&l(16,b=Q.disableInlineStyles),"$$scope"in Q&&l(21,c=Q.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&m!==M&&ui(_n,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const Q=Cu(a,n.pathname);q.set(Q)}if(t.$$.dirty[0]&655360&&T){const Q=!!n.hash,se=!Q&&O,ue=!Q||n.pathname!==o.pathname;B(se,ue)}t.$$.dirty[0]&262144&&O&&i&&i.primary&&Vr({level:Z,routerId:A,route:i})},[r,k,T,A,O,j,K,G,q,Y,W,m,_,d,v,g,b,n,i,o,a,c,f]}class i1 extends Nt{constructor(e){super(),Pt(this,e,n1,t1,St,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const Nu=i1;function Xn(t,e,l=Mn,n=_n){on(l)||wu(t,o=>`You cannot use ${o} outside of a ${Xi(n)}.`,e)}const o1=t=>{const{subscribe:e}=on(t);return{subscribe:e}};function Tu(){return Xn(hu),o1(Pi)}function qu(){const{history:t}=on(Mn);return t}function Eu(){const t=on(_u);return t?dr(t,e=>e.base):sl("/")}function Du(){Xn(bu);const t=Eu(),{basepath:e}=on(Mn);return n=>Fr(n,rn(t),e)}function s1(){Xn(vu);const t=Du(),{navigate:e}=qu();return(n,i)=>{const o=au(n)?n:t(n);return e(o,i)}}const a1=t=>({params:t&16,location:t&8}),qo=t=>({params:Ol?rn(t[10]):t[4],location:t[3],navigate:t[11]});function Eo(t){let e,l;return e=new Nu({props:{primary:t[1],$$slots:{default:[r1]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function f1(t){let e;const l=t[18].default,n=yi(l,t,t[19],qo);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&Gi(n,l,i,i[19],e?Wi(l,i[19],o,a1):Vi(i[19]),qo)},i(i){e||(X(n,i),e=!0)},o(i){ee(n,i),e=!1},d(i){n&&n.d(i)}}}function u1(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Ol?rn(t[10]):t[4],t[12]];var o=t[0];function a(r,f){let c={};for(let m=0;m{Pe(c,1)}),pt()}o?(e=go(o,a(r,f)),Ne(e.$$.fragment),X(e.$$.fragment,1),Me(e,l.parentNode,l)):e=null}else if(o){const c=f&7192?Si(i,[f&8&&{location:r[3]},f&2048&&{navigate:r[11]},f&1040&&$n(Ol?rn(r[10]):r[4]),f&4096&&$n(r[12])]):{};e.$set(c)}},i(r){n||(e&&X(e.$$.fragment,r),n=!0)},o(r){e&&ee(e.$$.fragment,r),n=!1},d(r){r&&P(l),e&&Pe(e,r)}}}function r1(t){let e,l,n,i;const o=[u1,f1],a=[];function r(f,c){return f[0]!==null?0:1}return e=r(t),l=a[e]=o[e](t),{c(){l.c(),n=Wt()},m(f,c){a[e].m(f,c),N(f,n,c),i=!0},p(f,c){let m=e;e=r(f),e===m?a[e].p(f,c):(mt(),ee(a[m],1,1,()=>{a[m]=null}),pt(),l=a[e],l?l.p(f,c):(l=a[e]=o[e](f),l.c()),X(l,1),l.m(n.parentNode,n))},i(f){i||(X(l),i=!0)},o(f){ee(l),i=!1},d(f){f&&P(n),a[e].d(f)}}}function c1(t){let e,l,n,i,o,a=[Mi(t[7]),{"data-svnav-route-start":t[5]}],r={};for(let _=0;_{f=null}),pt())},i(_){o||(X(f),o=!0)},o(_){ee(f),o=!1},d(_){_&&(P(e),P(l),P(n),P(i)),f&&f.d(_)}}}const _1=fu();function m1(t,e,l){let n;const i=["path","component","meta","primary"];let o=ai(e,i),a,r,f,c,{$$slots:m={},$$scope:_}=e,{path:d=""}=e,{component:v=null}=e,{meta:g={}}=e,{primary:b=!0}=e;Xn(ci,e);const k=_1(),{registerRoute:M,unregisterRoute:L,activeRoute:R,disableInlineStyles:F}=on(Mn);Tl(t,R,U=>l(16,a=U));const T=Eu();Tl(t,T,U=>l(17,f=U));const A=Tu();Tl(t,A,U=>l(3,r=U));const O=sl(null);let j;const K=sl(),G=sl({});Tl(t,G,U=>l(4,c=U)),jn(_u,K),jn(hr,G),jn(vr,O);const q=s1();return Ol||sr(()=>L(k)),t.$$set=U=>{l(24,e=gl(gl({},e),si(U))),l(12,o=ai(e,i)),"path"in U&&l(13,d=U.path),"component"in U&&l(0,v=U.component),"meta"in U&&l(14,g=U.meta),"primary"in U&&l(1,b=U.primary),"$$scope"in U&&l(19,_=U.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const U=d==="",Z=Qn(f,d),V={id:k,path:d,meta:g,default:U,fullPath:U?"":Z,base:U?f:Br(Z,r.pathname),primary:b,focusElement:O};K.set(V),l(15,j=M(V))}if(t.$$.dirty&98304&&l(2,n=!!(j||a&&a.id===k)),t.$$.dirty&98308&&n){const{params:U}=j||a;G.set(U)}},e=si(e),[v,b,n,r,c,k,R,F,T,A,G,q,o,d,g,j,a,f,m,_]}class p1 extends Nt{constructor(e){super(),Pt(this,e,m1,c1,St,{path:13,component:0,meta:14,primary:1})}}const bl=p1;function d1(t){let e,l,n,i;const o=t[13].default,a=yi(o,t,t[12],null);let r=[{href:t[0]},t[2],t[1]],f={};for(let c=0;cl(11,_=O));const R=ar(),F=Du(),{navigate:T}=qu();function A(O){R("click",O),mr(O)&&(O.preventDefault(),T(n,{state:k,replace:a||b}))}return t.$$set=O=>{l(19,e=gl(gl({},e),si(O))),l(18,m=ai(e,c)),"to"in O&&l(5,g=O.to),"replace"in O&&l(6,b=O.replace),"state"in O&&l(7,k=O.state),"getProps"in O&&l(8,M=O.getProps),"$$scope"in O&&l(12,v=O.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=F(g,_)),t.$$.dirty&2049&&l(10,i=Ni(_.pathname,n)),t.$$.dirty&2049&&l(9,o=n===_.pathname),t.$$.dirty&2049&&(a=Zi(n)===Rr(_)),t.$$.dirty&512&&l(2,r=o?{"aria-current":"page"}:{}),l(1,f=(()=>{if(su(M)){const O=M({location:_,href:n,isPartiallyCurrent:i,isCurrent:o});return{...m,...O}}return m})())},e=si(e),[n,f,r,L,A,g,b,k,M,o,i,_,v,d]}class v1 extends Nt{constructor(e){super(),Pt(this,e,h1,d1,St,{to:5,replace:6,state:7,getProps:8})}}const hl=v1;function tn(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function b1(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 yn(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 Dt(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function Ze(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 Hn(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Qt(t,e){return t==1||t==2&&e}function ml(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 Cn(t,e){return t.setTime(t.getTime()+e*36e5),t}function g1(t,e){return t.setTime(t.getTime()+e*6e4),t}function k1(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function w1(t){return t=="EOE"?"https://transparency.entsoe.eu/":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}let xn=0;function Wn(t,e){var l="";xn++;var n=function(){setTimeout(Wn,1e3,t,e)};if(t.net.ip&&xn%3==0){if(!t.net.ip){n();return}l="http://"+t.net.ip}else t.hostname&&xn%3==1?l="http://"+t.hostname:t.hostname&&xn%3==2?l="http://"+t.hostname+".local":l="";console&&console.log("Trying url "+l),e&&e(l);var i=new XMLHttpRequest;i.timeout=5e3,i.addEventListener("abort",n),i.addEventListener("error",n),i.addEventListener("timeout",n),i.addEventListener("load",function(o){window.location.href=l||"/"}),i.open("GET",l+"/is-alive",!0),i.send()}function ol(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Do(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 Gn(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 cn="((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}",Ll="[\\x20-\\x7E]+",Pn="[\\x20-\\xFF]+",Vn="[A-Za-z0-9_\\-]+",Au="[0-9A-Fa-f]+",Rn="[0-9]+",ii={},Ti=[];async function C1(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),o=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),o}let gi;async function Ou(){if(Ti.length){let t=Ti.shift();delete ii[t.resource];try{let e=await C1(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(Ou,100)}Ou();async function vl(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 _i(){Nl=await(await vl("sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),_l.set(Nl)}const _l=sl(Nl,t=>(_i(),function(){}));function S1(t){_l.update(e=>(e.trying=t,e))}let ei=0,Ao=-127,Oo=null,M1={};const P1=cu(M1,t=>{let e,l;async function n(){vl("data.json").then(i=>i.json()).then(i=>{t(i),Ao!=i.t&&(Ao=i.t,setTimeout(N1,2e3)),Oo==null&&i.pe&&i.p!=null&&(Oo=i.p,Ru()),(!Nl||!Nl.chip||Nl.booting||ei>1&&!Hn(Nl.board))&&(_i(),Dl&&clearTimeout(Dl),Dl=setTimeout(Di,2e3),Al&&clearTimeout(Al),Al=setTimeout(Oi,3e3)),i.u,Dl||(Dl=Di()),Al||(Al=Oi());let o=5e3;if(Hn(Nl.board)&&i.v>2.5){let a=3.3-Math.min(3.3,i.v);a>0&&(o=Math.max(a,.1)*10*5e3)}o>5e3&&console.log("Next in "+o+"ms"),e&&clearTimeout(e),e=setTimeout(n,o),ei=0}).catch(i=>{ei++,ei>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(n,15e3),l||(l=setTimeout(Wn,5e3,Nl,S1))):e=setTimeout(n,Hn(Nl.board)?1e4:5e3)})}return n(),function(){clearTimeout(e)}});let ti,bn={};const Lu=sl(bn);let qi={};const Iu=sl(qi);async function Ru(){ti&&(clearTimeout(ti),ti=0),bn=await(await vl("importprice.json")).json(),Lu.set(bn),bn!=null&&bn.importExportPriceDifferent&&(qi=await(await vl("exportprice.json")).json(),Iu.set(qi)),ti=setTimeout(Ru,(24-new Date().getHours())*36e5+10)}let Ei={},Dl;async function Di(){Dl&&(clearTimeout(Dl),Dl=0),Ei=await(await vl("dayplot.json")).json(),Fu.set(Ei),Dl=setTimeout(Di,(60-new Date().getMinutes())*6e4+20)}const Fu=sl(Ei,t=>function(){});let Ai={},Al;async function Oi(){Al&&(clearTimeout(Al),Al=0),Ai=await(await vl("monthplot.json")).json(),Bu.set(Ai),Al=setTimeout(Oi,(24-new Date().getHours())*36e5+40)}const Bu=sl(Ai,t=>function(){});let Li={};async function N1(){Li=await(await vl("temperature.json")).json(),Uu.set(Li)}const Uu=sl(Li,t=>function(){});let Ii={},li;async function ju(){li&&(clearTimeout(li),li=0),Ii=await(await vl("tariff.json")).json(),Hu.set(Ii),li=setTimeout(ju,(60-new Date().getMinutes())*6e4+30)}const Hu=sl(Ii,t=>function(){});let gn={c:-1,n:[]};async function T1(){let e=await(await vl("wifiscan.json",{timeout:3e4})).json(),l=[];gn.c=0,gn.n=[];for(let n=0;n(T1(),function(){}));let Ri=!1;const kl=sl(Ri);async function zu(t){Ri=await(await vl("translations.json"+(t?"?lang="+t:""))).json(),kl.set(Ri)}zu();function Lo(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 yu(t){return await(await fetch("upgrade?expected_version="+t,{method:"POST"})).json()}function Io(t){var f;let e=(((f=t[1].header)==null?void 0:f.uptime)??"Up")+"",l,n,i;function o(c,m){return c[2]>1?I1:c[2]>0?L1:c[3]>1?O1:c[3]>0?A1:c[4]>1?D1:c[4]>0?E1:q1}let a=o(t),r=a(t);return{c(){l=S(e),n=h(),r.c(),i=Wt()},m(c,m){N(c,l,m),N(c,n,m),r.m(c,m),N(c,i,m)},p(c,m){var _;m&2&&e!==(e=(((_=c[1].header)==null?void 0:_.uptime)??"Up")+"")&&E(l,e),a===(a=o(c))&&r?r.p(c,m):(r.d(1),r=a(c),r&&(r.c(),r.m(i.parentNode,i)))},d(c){c&&(P(l),P(n),P(i)),r.d(c)}}}function q1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.seconds)??"s")+"",i;return{c(){e=S(t[0]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&1&&E(e,a[0]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.seconds)??"s")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function E1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.minute)??"m")+"",i;return{c(){e=S(t[4]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&16&&E(e,a[4]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.minute)??"m")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function D1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.minutes)??"m")+"",i;return{c(){e=S(t[4]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&16&&E(e,a[4]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.minutes)??"m")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function A1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.hour)??"h")+"",i;return{c(){e=S(t[3]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&8&&E(e,a[3]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.hour)??"h")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function O1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.hours)??"h")+"",i;return{c(){e=S(t[3]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&8&&E(e,a[3]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.hours)??"h")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function L1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.day)??"d")+"",i;return{c(){e=S(t[2]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&4&&E(e,a[2]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.day)??"d")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function I1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.days)??"d")+"",i;return{c(){e=S(t[2]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&4&&E(e,a[2]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.days)??"d")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function R1(t){let e,l=t[0]&&Io(t);return{c(){l&&l.c(),e=Wt()},m(n,i){l&&l.m(n,i),N(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Io(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:ze,o:ze,d(n){n&&P(e),l&&l.d(n)}}}function F1(t,e,l){let{epoch:n}=e,i={};kl.subscribe(f=>{l(1,i=f)});let o=0,a=0,r=0;return t.$$set=f=>{"epoch"in f&&l(0,n=f.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(2,o=Math.floor(n/86400)),l(3,a=Math.floor(n/3600)),l(4,r=Math.floor(n/60)))},[n,i,o,a,r]}class B1 extends Nt{constructor(e){super(),Pt(this,e,F1,R1,St,{epoch:0})}}function U1(t){let e,l,n;return{c(){e=p("span"),l=S(t[2]),u(e,"title",t[1]),u(e,"class",n="bd-"+t[0])},m(i,o){N(i,e,o),s(e,l)},p(i,[o]){o&4&&E(l,i[2]),o&2&&u(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&u(e,"class",n)},i:ze,o:ze,d(i){i&&P(e)}}}function j1(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=a=>{"color"in a&&l(0,n=a.color),"title"in a&&l(1,i=a.title),"text"in a&&l(2,o=a.text)},[n,i,o]}class fn extends Nt{constructor(e){super(),Pt(this,e,j1,U1,St,{color:0,title:1,text:2})}}function H1(t){let e,l=`${Dt(t[0].getDate())}.${Dt(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Dt(t[0].getHours())}:${Dt(t[0].getMinutes())}`,n;return{c(){e=p("span"),n=S(l),u(e,"class",t[1])},m(i,o){N(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Dt(i[0].getDate())}.${Dt(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Dt(i[0].getHours())}:${Dt(i[0].getMinutes())}`)&&E(n,l),o&2&&u(e,"class",i[1])},d(i){i&&P(e)}}}function z1(t){var n;let e=`${Dt(t[0].getDate())}. ${t[2].months?(n=t[2].months)==null?void 0:n[t[0].getMonth()]:Dt(t[0].getMonth()+1)} ${Dt(t[0].getHours())}:${Dt(t[0].getMinutes())}`,l;return{c(){l=S(e)},m(i,o){N(i,l,o)},p(i,o){var a;o&5&&e!==(e=`${Dt(i[0].getDate())}. ${i[2].months?(a=i[2].months)==null?void 0:a[i[0].getMonth()]:Dt(i[0].getMonth()+1)} ${Dt(i[0].getHours())}:${Dt(i[0].getMinutes())}`)&&E(l,e)},d(i){i&&P(l)}}}function y1(t){let e;function l(o,a){return o[3]?z1:H1}let n=l(t),i=n(t);return{c(){i.c(),e=Wt()},m(o,a){i.m(o,a),N(o,e,a)},p(o,[a]){n===(n=l(o))&&i?i.p(o,a):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:ze,o:ze,d(o){o&&P(e),i.d(o)}}}function W1(t,e,l){let n={};kl.subscribe(f=>{l(2,n=f)});let{timestamp:i}=e,{fullTimeColor:o}=e,{offset:a}=e,r;return t.$$set=f=>{"timestamp"in f&&l(0,i=f.timestamp),"fullTimeColor"in f&&l(1,o=f.fullTimeColor),"offset"in f&&l(4,a=f.offset)},t.$$.update=()=>{t.$$.dirty&17&&(l(3,r=Math.abs(new Date().getTime()-i.getTime())<3e5),isNaN(a)||Cn(i,a-(24+i.getHours()-i.getUTCHours())%24))},[i,o,n,r,a]}class Wu extends Nt{constructor(e){super(),Pt(this,e,W1,y1,St,{timestamp:0,fullTimeColor:1,offset:4})}}function G1(t){let e,l,n;return{c(){e=Ft("svg"),l=Ft("path"),n=Ft("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,o){N(i,e,o),s(e,l),s(e,n)},p:ze,i:ze,o:ze,d(i){i&&P(e)}}}class V1 extends Nt{constructor(e){super(),Pt(this,e,null,G1,St,{})}}function K1(t){let e,l;return{c(){e=Ft("svg"),l=Ft("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){N(n,e,i),s(e,l)},p:ze,i:ze,o:ze,d(n){n&&P(e)}}}class Y1 extends Nt{constructor(e){super(),Pt(this,e,null,K1,St,{})}}function Q1(t){let e,l;return{c(){e=Ft("svg"),l=Ft("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),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){N(n,e,i),s(e,l)},p:ze,i:ze,o:ze,d(n){n&&P(e)}}}class X1 extends Nt{constructor(e){super(),Pt(this,e,null,Q1,St,{})}}function Z1(t){let e,l,n=t[2].version+"",i;return{c(){e=S("AMS reader "),l=p("span"),i=S(n)},m(o,a){N(o,e,a),N(o,l,a),s(l,i)},p(o,a){a&4&&n!==(n=o[2].version+"")&&E(i,n)},d(o){o&&(P(e),P(l))}}}function Ro(t){let e,l=(t[1].t>-50?t[1].t.toFixed(1):"-")+"",n,i;return{c(){e=p("div"),n=S(l),i=S("°C"),u(e,"class","flex-none my-auto")},m(o,a){N(o,e,a),s(e,n),s(e,i)},p(o,a){a&2&&l!==(l=(o[1].t>-50?o[1].t.toFixed(1):"-")+"")&&E(n,l)},d(o){o&&P(e)}}}function Fo(t){var i,o,a;let e,l=(((i=t[4].header)==null?void 0:i.han)??"HAN")+": "+(((a=(o=t[4].errors)==null?void 0:o.han)==null?void 0:a[t[1].he])??t[1].he),n;return{c(){e=p("div"),n=S(l),u(e,"class","bd-red")},m(r,f){N(r,e,f),s(e,n)},p(r,f){var c,m,_;f&18&&l!==(l=(((c=r[4].header)==null?void 0:c.han)??"HAN")+": "+(((_=(m=r[4].errors)==null?void 0:m.han)==null?void 0:_[r[1].he])??r[1].he))&&E(n,l)},d(r){r&&P(e)}}}function Bo(t){var i,o,a;let e,l=(((i=t[4].header)==null?void 0:i.mqtt)??"MQTT")+": "+(((a=(o=t[4].errors)==null?void 0:o.mqtt)==null?void 0:a[t[1].me])??t[1].me),n;return{c(){e=p("div"),n=S(l),u(e,"class","bd-red")},m(r,f){N(r,e,f),s(e,n)},p(r,f){var c,m,_;f&18&&l!==(l=(((c=r[4].header)==null?void 0:c.mqtt)??"MQTT")+": "+(((_=(m=r[4].errors)==null?void 0:m.mqtt)==null?void 0:_[r[1].me])??r[1].me))&&E(n,l)},d(r){r&&P(e)}}}function Uo(t){var i,o,a;let e,l=(((i=t[4].header)==null?void 0:i.price)??"PS")+": "+(((a=(o=t[4].errors)==null?void 0:o.price)==null?void 0:a[t[1].ee])??t[1].ee),n;return{c(){e=p("div"),n=S(l),u(e,"class","bd-red")},m(r,f){N(r,e,f),s(e,n)},p(r,f){var c,m,_;f&18&&l!==(l=(((c=r[4].header)==null?void 0:c.price)??"PS")+": "+(((_=(m=r[4].errors)==null?void 0:m.price)==null?void 0:_[r[1].ee])??r[1].ee))&&E(n,l)},d(r){r&&P(e)}}}function jo(t){let e,l,n,i,o,a,r,f;return l=new hl({props:{to:"/configuration",$$slots:{default:[J1]},$$scope:{ctx:t}}}),a=new hl({props:{to:"/status",$$slots:{default:[$1]},$$scope:{ctx:t}}}),{c(){var c,m;e=p("div"),Ne(l.$$.fragment),i=h(),o=p("div"),Ne(a.$$.fragment),u(e,"class","flex-none px-1 mt-1"),u(e,"title",n=((c=t[4].header)==null?void 0:c.config)??""),u(o,"class","flex-none px-1 mt-1"),u(o,"title",r=((m=t[4].header)==null?void 0:m.status)??"")},m(c,m){N(c,e,m),Me(l,e,null),N(c,i,m),N(c,o,m),Me(a,o,null),f=!0},p(c,m){var v,g;const _={};m&64&&(_.$$scope={dirty:m,ctx:c}),l.$set(_),(!f||m&16&&n!==(n=((v=c[4].header)==null?void 0:v.config)??""))&&u(e,"title",n);const d={};m&64&&(d.$$scope={dirty:m,ctx:c}),a.$set(d),(!f||m&16&&r!==(r=((g=c[4].header)==null?void 0:g.status)??""))&&u(o,"title",r)},i(c){f||(X(l.$$.fragment,c),X(a.$$.fragment,c),f=!0)},o(c){ee(l.$$.fragment,c),ee(a.$$.fragment,c),f=!1},d(c){c&&(P(e),P(i),P(o)),Pe(l),Pe(a)}}}function J1(t){let e,l;return e=new V1({}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function $1(t){let e,l;return e=new Y1({}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function x1(t){let e,l;function n(a,r){return a[2].security==0||a[1].a?lc:tc}let i=n(t),o=i(t);return{c(){var a;e=p("div"),o.c(),u(e,"class","flex-none mr-3 text-yellow-500"),u(e,"title",l=(((a=t[4].header)==null?void 0:a.new_version)??"New version")+": "+t[2].upgrade.n)},m(a,r){N(a,e,r),o.m(e,null)},p(a,r){var f;i===(i=n(a))&&o?o.p(a,r):(o.d(1),o=i(a),o&&(o.c(),o.m(e,null))),r&20&&l!==(l=(((f=a[4].header)==null?void 0:f.new_version)??"New version")+": "+a[2].upgrade.n)&&u(e,"title",l)},d(a){a&&P(e),o.d()}}}function ec(t){let e,l,n=t[2].upgrade.t+"",i,o,a=t[3].toFixed(1)+"",r,f;return{c(){e=p("div"),l=S("Upgrading to "),i=S(n),o=S(", "),r=S(a),f=S("%"),u(e,"class","flex-none mr-3 mt-1 text-yellow-300")},m(c,m){N(c,e,m),s(e,l),s(e,i),s(e,o),s(e,r),s(e,f)},p(c,m){m&4&&n!==(n=c[2].upgrade.t+"")&&E(i,n),m&8&&a!==(a=c[3].toFixed(1)+"")&&E(r,a)},d(c){c&&P(e)}}}function tc(t){var r;let e,l=(((r=t[4].header)==null?void 0:r.new_version)??"New version")+"",n,i,o=t[2].upgrade.n+"",a;return{c(){e=p("span"),n=S(l),i=S(": "),a=S(o)},m(f,c){N(f,e,c),s(e,n),s(e,i),s(e,a)},p(f,c){var m;c&16&&l!==(l=(((m=f[4].header)==null?void 0:m.new_version)??"New version")+"")&&E(n,l),c&4&&o!==(o=f[2].upgrade.n+"")&&E(a,o)},d(f){f&&P(e)}}}function lc(t){var m;let e,l,n=(((m=t[4].header)==null?void 0:m.new_version)??"New version")+"",i,o,a=t[2].upgrade.n+"",r,f,c;return{c(){e=p("button"),l=p("span"),i=S(n),o=S(": "),r=S(a),u(l,"class","mt-1"),u(e,"class","flex")},m(_,d){N(_,e,d),s(e,l),s(l,i),s(l,o),s(l,r),f||(c=re(e,"click",t[5]),f=!0)},p(_,d){var v;d&16&&n!==(n=(((v=_[4].header)==null?void 0:v.new_version)??"New version")+"")&&E(i,n),d&4&&a!==(a=_[2].upgrade.n+"")&&E(r,a)},d(_){_&&P(e),f=!1,c()}}}function nc(t){var _e,he;let e,l,n,i,o,a,r,f,c,m,_,d=(((_e=t[4].header)==null?void 0:_e.mem)??"Free")+"",v,g,b=(t[1].m?(t[1].m/1e3).toFixed(1):"-")+"",k,M,L,R,F,T,A,O,j,K,G,q,U,Z,V,Y,W,B,y,ne,te,Q,se,ue,fe,le,de,ie,me,oe,pe;i=new hl({props:{to:"/",$$slots:{default:[Z1]},$$scope:{ctx:t}}}),f=new B1({props:{epoch:t[1].u}});let we=t[1].t>-50&&Ro(t);F=new fn({props:{title:"ESP",text:t[2].booting?((he=t[4].header)==null?void 0:he.booting)??"Booting":t[1].v>2?t[1].v.toFixed(2)+"V":"ESP",color:tn(t[2].booting?2:t[1].em)}}),A=new fn({props:{title:"HAN",text:"HAN",color:tn(t[2].booting?9:t[1].hm)}}),j=new fn({props:{title:"WiFi",text:t[1].r?t[1].r.toFixed(0)+"dBm":"WiFi",color:tn(t[2].booting?9:t[1].wm)}}),G=new fn({props:{title:"MQTT",text:"MQTT",color:tn(t[2].booting?9:t[1].mm)}});let C=(t[1].he<0||t[1].he>0)&&Fo(t),w=t[1].me<0&&Bo(t),I=(t[1].ee>0||t[1].ee<0)&&Uo(t);se=new Wu({props:{timestamp:t[1].c?new Date(t[1].c*1e3):new Date(0),offset:t[2].clock_offset,fullTimeColor:"text-red-500"}});let D=t[2].vndcfg&&t[2].usrcfg&&jo(t);ie=new X1({});function z(J,ve){if(J[2].upgrading)return ec;if(J[2].fwconsent===1&&J[2].upgrade.n)return x1}let x=z(t),ae=x&&x(t);return{c(){var J;e=p("nav"),l=p("div"),n=p("div"),Ne(i.$$.fragment),o=h(),a=p("div"),r=p("div"),Ne(f.$$.fragment),c=h(),we&&we.c(),m=h(),_=p("div"),v=S(d),g=S(": "),k=S(b),M=S("kb"),L=h(),R=p("div"),Ne(F.$$.fragment),T=h(),Ne(A.$$.fragment),O=h(),Ne(j.$$.fragment),K=h(),Ne(G.$$.fragment),q=h(),C&&C.c(),U=h(),w&&w.c(),Z=h(),I&&I.c(),V=h(),Y=p("div"),W=p("div"),B=p("a"),y=p("img"),te=h(),Q=p("div"),Ne(se.$$.fragment),ue=h(),D&&D.c(),fe=h(),le=p("div"),de=p("a"),Ne(ie.$$.fragment),oe=h(),ae&&ae.c(),u(n,"class","flex text-lg text-gray-100 p-2"),u(r,"class","flex-none my-auto"),u(_,"class","flex-none my-auto"),u(a,"class","flex-none my-auto p-2 flex space-x-4"),u(R,"class","flex-auto flex-wrap my-auto justify-center p-2"),u(y,"class","logo"),oi(y.src,ne=(t[0]+"/logo.svg").replace("//","/"))||u(y,"src",ne),u(y,"alt","GitHub repo"),u(B,"class","float-right"),u(B,"href","https://github.com/UtilitechAS/amsreader-firmware"),u(B,"target","_blank"),u(B,"rel","noreferrer"),u(B,"aria-label","GitHub"),u(W,"class","flex-none"),u(Q,"class","flex-none my-auto px-2"),u(de,"href",ml("")),u(de,"target","_blank"),u(de,"rel","noreferrer"),u(le,"class","flex-none px-1 mt-1"),u(le,"title",me=((J=t[4].header)==null?void 0:J.doc)??""),u(Y,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),u(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),u(e,"class","hdr")},m(J,ve){N(J,e,ve),s(e,l),s(l,n),Me(i,n,null),s(l,o),s(l,a),s(a,r),Me(f,r,null),s(a,c),we&&we.m(a,null),s(a,m),s(a,_),s(_,v),s(_,g),s(_,k),s(_,M),s(l,L),s(l,R),Me(F,R,null),s(R,T),Me(A,R,null),s(R,O),Me(j,R,null),s(R,K),Me(G,R,null),s(l,q),C&&C.m(l,null),s(l,U),w&&w.m(l,null),s(l,Z),I&&I.m(l,null),s(l,V),s(l,Y),s(Y,W),s(W,B),s(B,y),s(Y,te),s(Y,Q),Me(se,Q,null),s(Y,ue),D&&D.m(Y,null),s(Y,fe),s(Y,le),s(le,de),Me(ie,de,null),s(Y,oe),ae&&ae.m(Y,null),pe=!0},p(J,[ve]){var Je,wt,et;const ke={};ve&68&&(ke.$$scope={dirty:ve,ctx:J}),i.$set(ke);const De={};ve&2&&(De.epoch=J[1].u),f.$set(De),J[1].t>-50?we?we.p(J,ve):(we=Ro(J),we.c(),we.m(a,m)):we&&(we.d(1),we=null),(!pe||ve&16)&&d!==(d=(((Je=J[4].header)==null?void 0:Je.mem)??"Free")+"")&&E(v,d),(!pe||ve&2)&&b!==(b=(J[1].m?(J[1].m/1e3).toFixed(1):"-")+"")&&E(k,b);const Te={};ve&22&&(Te.text=J[2].booting?((wt=J[4].header)==null?void 0:wt.booting)??"Booting":J[1].v>2?J[1].v.toFixed(2)+"V":"ESP"),ve&6&&(Te.color=tn(J[2].booting?2:J[1].em)),F.$set(Te);const Ae={};ve&6&&(Ae.color=tn(J[2].booting?9:J[1].hm)),A.$set(Ae);const Le={};ve&2&&(Le.text=J[1].r?J[1].r.toFixed(0)+"dBm":"WiFi"),ve&6&&(Le.color=tn(J[2].booting?9:J[1].wm)),j.$set(Le);const Ee={};ve&6&&(Ee.color=tn(J[2].booting?9:J[1].mm)),G.$set(Ee),J[1].he<0||J[1].he>0?C?C.p(J,ve):(C=Fo(J),C.c(),C.m(l,U)):C&&(C.d(1),C=null),J[1].me<0?w?w.p(J,ve):(w=Bo(J),w.c(),w.m(l,Z)):w&&(w.d(1),w=null),J[1].ee>0||J[1].ee<0?I?I.p(J,ve):(I=Uo(J),I.c(),I.m(l,V)):I&&(I.d(1),I=null),(!pe||ve&1&&!oi(y.src,ne=(J[0]+"/logo.svg").replace("//","/")))&&u(y,"src",ne);const Ie={};ve&2&&(Ie.timestamp=J[1].c?new Date(J[1].c*1e3):new Date(0)),ve&4&&(Ie.offset=J[2].clock_offset),se.$set(Ie),J[2].vndcfg&&J[2].usrcfg?D?(D.p(J,ve),ve&4&&X(D,1)):(D=jo(J),D.c(),X(D,1),D.m(Y,fe)):D&&(mt(),ee(D,1,1,()=>{D=null}),pt()),(!pe||ve&16&&me!==(me=((et=J[4].header)==null?void 0:et.doc)??""))&&u(le,"title",me),x===(x=z(J))&&ae?ae.p(J,ve):(ae&&ae.d(1),ae=x&&x(J),ae&&(ae.c(),ae.m(Y,null)))},i(J){pe||(X(i.$$.fragment,J),X(f.$$.fragment,J),X(F.$$.fragment,J),X(A.$$.fragment,J),X(j.$$.fragment,J),X(G.$$.fragment,J),X(se.$$.fragment,J),X(D),X(ie.$$.fragment,J),pe=!0)},o(J){ee(i.$$.fragment,J),ee(f.$$.fragment,J),ee(F.$$.fragment,J),ee(A.$$.fragment,J),ee(j.$$.fragment,J),ee(G.$$.fragment,J),ee(se.$$.fragment,J),ee(D),ee(ie.$$.fragment,J),pe=!1},d(J){J&&P(e),Pe(i),Pe(f),we&&we.d(),Pe(F),Pe(A),Pe(j),Pe(G),C&&C.d(),w&&w.d(),I&&I.d(),Pe(se),D&&D.d(),Pe(ie),ae&&ae.d()}}}function ic(t,e,l){let{basepath:n="/"}=e,{data:i={}}=e,o={};function a(){var c;confirm((((c=f.header)==null?void 0:c.upgrade)??"Upgrade to {0}?").replace("{0}",o.upgrade.n))&&(yu(o.upgrade.n),_l.update(m=>(m.upgrade.t=o.upgrade.n,m.upgrade.p=0,m.upgrading=!0,m)))}let r;_l.subscribe(c=>{l(2,o=c)});let f={};return kl.subscribe(c=>{l(4,f=c)}),t.$$set=c=>{"basepath"in c&&l(0,n=c.basepath),"data"in c&&l(1,i=c.data)},t.$$.update=()=>{t.$$.dirty&4&&l(3,r=Math.max(0,o.upgrade.p))},[n,i,o,r,f,a]}class oc extends Nt{constructor(e){super(),Pt(this,e,ic,nc,St,{basepath:0,data:1})}}function sc(t){let e,l,n,i;return{c(){e=Ft("svg"),l=Ft("path"),n=Ft("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(o,a){N(o,e,a),s(e,l),s(e,n)},p(o,[a]){a&1&&i!==(i=ki(150,150,115,210,210+300*o[0]/100))&&u(n,"d",i),a&2&&u(n,"stroke",o[1])},i:ze,o:ze,d(o){o&&P(e)}}}function Ho(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 o=Ho(t,e,l,i),a=Ho(t,e,l,n),r=i-n<=180?"0":"1",f=["M",o.x,o.y,"A",l,l,0,r,0,a.x,a.y].join(" ");return f}function ac(t,e,l){let{pct:n=0}=e,{color:i="red"}=e;return t.$$set=o=>{"pct"in o&&l(0,n=o.pct),"color"in o&&l(1,i=o.color)},[n,i]}class fc extends Nt{constructor(e){super(),Pt(this,e,ac,sc,St,{pct:0,color:1})}}function zo(t){let e,l,n,i=t[1][0]+"",o,a,r,f=t[1][1]+"",c,m;return{c(){e=p("br"),l=h(),n=p("span"),o=S(i),a=h(),r=p("span"),c=S(f),m=S("/kWh"),u(n,"class","pl-sub"),u(r,"class","pl-snt")},m(_,d){N(_,e,d),N(_,l,d),N(_,n,d),s(n,o),N(_,a,d),N(_,r,d),s(r,c),s(r,m)},p(_,d){d&2&&i!==(i=_[1][0]+"")&&E(o,i),d&2&&f!==(f=_[1][1]+"")&&E(c,f)},d(_){_&&(P(e),P(l),P(n),P(a),P(r))}}}function uc(t){let e,l,n,i,o,a,r,f,c,m,_=t[3][0]+"",d,v,g,b=t[3][1]+"",k,M,L;l=new fc({props:{pct:t[4],color:t[2](t[4],document.documentElement.classList.contains("dark"))}});let R=t[1]&&zo(t);return{c(){e=p("div"),Ne(l.$$.fragment),n=h(),i=p("span"),o=p("span"),a=S(t[0]),r=h(),f=p("br"),c=h(),m=p("span"),d=S(_),v=h(),g=p("span"),k=S(b),M=h(),R&&R.c(),u(o,"class","pl-lab"),u(m,"class","pl-val"),u(g,"class","pl-unt"),u(i,"class","pl-ov"),u(e,"class","pl-root")},m(F,T){N(F,e,T),Me(l,e,null),s(e,n),s(e,i),s(i,o),s(o,a),s(i,r),s(i,f),s(i,c),s(i,m),s(m,d),s(i,v),s(i,g),s(g,k),s(i,M),R&&R.m(i,null),L=!0},p(F,[T]){const A={};T&16&&(A.pct=F[4]),T&20&&(A.color=F[2](F[4],document.documentElement.classList.contains("dark"))),l.$set(A),(!L||T&1)&&E(a,F[0]),(!L||T&8)&&_!==(_=F[3][0]+"")&&E(d,_),(!L||T&8)&&b!==(b=F[3][1]+"")&&E(k,b),F[1]?R?R.p(F,T):(R=zo(F),R.c(),R.m(i,null)):R&&(R.d(1),R=null)},i(F){L||(X(l.$$.fragment,F),L=!0)},o(F){ee(l.$$.fragment,F),L=!1},d(F){F&&P(e),Pe(l),R&&R.d()}}}function rc(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:a}=e,{sub:r=["",""]}=e,{colorFn:f}=e,c,m=0;return t.$$set=_=>{"val"in _&&l(5,n=_.val),"max"in _&&l(6,i=_.max),"unit"in _&&l(7,o=_.unit),"label"in _&&l(0,a=_.label),"sub"in _&&l(1,r=_.sub),"colorFn"in _&&l(2,f=_.colorFn)},t.$$.update=()=>{t.$$.dirty&224&&(l(3,c=rl(n,o)),l(4,m=Math.min(n,i)/i*100))},[a,r,f,c,m,n,i,o]}class Gu extends Nt{constructor(e){super(),Pt(this,e,rc,uc,St,{val:5,max:6,unit:7,label:0,sub:1,colorFn:2})}}function yo(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Wo(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Go(t,e,l){const n=t.slice();return n[15]=e[l],n}function Vo(t){let e,l,n,i,o,a,r,f=(t[0].title||t[0].link)&&Ko(t),c=ft(t[0].y.ticks),m=[];for(let b=0;b{f=null}),pt()),k&129){c=ft(b[0].y.ticks);let M;for(M=0;M{o=null}),pt())},i(a){n||(X(o),n=!0)},o(a){ee(o),n=!1},d(a){a&&P(e),i&&i.d(),o&&o.d()}}}function Yo(t){let e,l=t[0].title+"",n,i;return{c(){e=p("div"),n=S(l),u(e,"class","text-sm font-bold"),At(()=>t[9].call(e))},m(o,a){N(o,e,a),s(e,n),i=Ki(e,t[9].bind(e))},p(o,a){a&1&&l!==(l=o[0].title+"")&&E(n,l)},d(o){o&&P(e),i()}}}function Qo(t){let e,l,n,i;const o=[_c,cc],a=[];function r(f,c){return f[0].link.route?0:1}return l=r(t),n=a[l]=o[l](t),{c(){e=p("div"),n.c(),u(e,"class","text-xs text-right")},m(f,c){N(f,e,c),a[l].m(e,null),i=!0},p(f,c){let m=l;l=r(f),l===m?a[l].p(f,c):(mt(),ee(a[m],1,1,()=>{a[m]=null}),pt(),n=a[l],n?n.p(f,c):(n=a[l]=o[l](f),n.c()),X(n,1),n.m(e,null))},i(f){i||(X(n),i=!0)},o(f){ee(n),i=!1},d(f){f&&P(e),a[l].d()}}}function cc(t){let e,l=t[0].link.text+"",n,i,o;return{c(){e=p("a"),n=S(l),u(e,"href",i=t[0].link.url),u(e,"target",o=t[0].link.target)},m(a,r){N(a,e,r),s(e,n)},p(a,r){r&1&&l!==(l=a[0].link.text+"")&&E(n,l),r&1&&i!==(i=a[0].link.url)&&u(e,"href",i),r&1&&o!==(o=a[0].link.target)&&u(e,"target",o)},i:ze,o:ze,d(a){a&&P(e)}}}function _c(t){let e,l;return e=new hl({props:{to:t[0].link.url,$$slots:{default:[mc]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.to=n[0].link.url),i&262145&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function mc(t){let e=t[0].link.text+"",l;return{c(){l=S(e)},m(n,i){N(n,l,i)},p(n,i){i&1&&e!==(e=n[0].link.text+"")&&E(l,e)},d(n){n&&P(l)}}}function Xo(t){let e,l,n,i=t[15].label+"",o,a,r,f;return{c(){e=Ft("g"),l=Ft("line"),n=Ft("text"),o=S(i),u(l,"x2","100%"),u(n,"y","-4"),u(n,"x",a=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,m){N(c,e,m),s(e,l),s(e,n),s(n,o)},p(c,m){m&1&&i!==(i=c[15].label+"")&&E(o,i),m&1&&a!==(a=c[15].align=="right"?"85%":"")&&u(n,"x",a),m&1&&r!==(r="tick tick-"+c[15].value+" tick-"+c[15].color)&&u(e,"class",r),m&129&&f!==(f="translate(0, "+c[7](c[15].value)+")")&&u(e,"transform",f)},d(c){c&&P(e)}}}function Zo(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Xo(t);return{c(){n&&n.c(),l=Wt()},m(i,o){n&&n.m(i,o),N(i,l,o)},p(i,o){o&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,o):(n=Xo(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){i&&P(l),n&&n.d(i)}}}function Jo(t){let e,l,n=(t[3]>20||t[13]%2==0)&&$o(t);return{c(){e=Ft("g"),n&&n.c(),u(e,"class","tick"),u(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,o){N(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=$o(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&u(e,"transform",l)},d(i){i&&P(e),n&&n.d()}}}function $o(t){let e,l=t[11].label+"",n,i;return{c(){e=Ft("text"),n=S(l),u(e,"x",i=t[3]/2),u(e,"y","-4")},m(o,a){N(o,e,a),s(e,n)},p(o,a){a&1&&l!==(l=o[11].label+"")&&E(n,l),a&8&&i!==(i=o[3]/2)&&u(e,"x",i)},d(o){o&&P(e)}}}function xo(t){let e=!isNaN(t[6](t[13])),l,n=e&&Jo(t);return{c(){n&&n.c(),l=Wt()},m(i,o){n&&n.m(i,o),N(i,l,o)},p(i,o){o&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,o):(n=Jo(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){i&&P(l),n&&n.d(i)}}}function es(t){let e,l,n=t[11].value!==void 0&&ts(t),i=t[11].value2>1e-4&&is(t);return{c(){e=Ft("g"),n&&n.c(),l=Ft("g"),i&&i.c()},m(o,a){N(o,e,a),n&&n.m(e,null),N(o,l,a),i&&i.m(l,null)},p(o,a){o[11].value!==void 0?n?n.p(o,a):(n=ts(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,a):(i=is(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&(P(e),P(l)),n&&n.d(),i&&i.d()}}}function ts(t){let e,l,n,i,o,a,r,f=t[3]>15&&ls(t);return{c(){e=Ft("rect"),f&&f.c(),r=Wt(),u(e,"x",l=t[6](t[13])+2),u(e,"y",n=t[7](t[11].value)),u(e,"width",i=t[3]*.95),u(e,"height",o=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),u(e,"fill",a=t[11].color)},m(c,m){N(c,e,m),f&&f.m(c,m),N(c,r,m)},p(c,m){m&64&&l!==(l=c[6](c[13])+2)&&u(e,"x",l),m&129&&n!==(n=c[7](c[11].value))&&u(e,"y",n),m&8&&i!==(i=c[3]*.95)&&u(e,"width",i),m&129&&o!==(o=c[7](c[0].y.min)-c[7](Math.min(c[0].y.min,0)+c[11].value))&&u(e,"height",o),m&1&&a!==(a=c[11].color)&&u(e,"fill",a),c[3]>15?f?f.p(c,m):(f=ls(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(P(e),P(r)),f&&f.d(c)}}}function ls(t){let e,l=t[11].label+"",n,i,o,a,r,f,c=t[11].title&&ns(t);return{c(){e=Ft("text"),n=S(l),c&&c.c(),f=Wt(),u(e,"width",i=t[3]*.95),u(e,"dominant-baseline","middle"),u(e,"text-anchor",o=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]m[7](0)-m[8]&&!m[0].dark?m[11].color:"white")&&u(e,"fill",a),_&457&&r!==(r="translate("+(m[6](m[13])+m[3]/2)+" "+(m[7](m[11].value)>m[7](0)-m[8]?m[7](m[11].value)-m[8]:m[7](m[11].value)+10)+") rotate("+(m[11].labelAngle?m[11].labelAngle:m[3]15&&os(t);return{c(){e=Ft("rect"),f&&f.c(),r=Wt(),u(e,"x",l=t[6](t[13])+2),u(e,"y",n=t[7](0)),u(e,"width",i=t[3]*.95),u(e,"height",o=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),u(e,"fill",a=t[11].color2?t[11].color2:t[11].color)},m(c,m){N(c,e,m),f&&f.m(c,m),N(c,r,m)},p(c,m){m&64&&l!==(l=c[6](c[13])+2)&&u(e,"x",l),m&128&&n!==(n=c[7](0))&&u(e,"y",n),m&8&&i!==(i=c[3]*.95)&&u(e,"width",i),m&129&&o!==(o=c[7](c[0].y.min)-c[7](c[0].y.min+c[11].value2))&&u(e,"height",o),m&1&&a!==(a=c[11].color2?c[11].color2:c[11].color)&&u(e,"fill",a),c[3]>15?f?f.p(c,m):(f=os(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(P(e),P(r)),f&&f.d(c)}}}function os(t){let e,l=t[11].label2+"",n,i,o,a,r,f=t[11].title2&&ss(t);return{c(){e=Ft("text"),n=S(l),f&&f.c(),r=Wt(),u(e,"width",i=t[3]*.95),u(e,"dominant-baseline","middle"),u(e,"text-anchor","middle"),u(e,"fill",o=t[7](-t[11].value2)t[10].call(e))},m(o,a){N(o,e,a),i&&i.m(e,null),l=Ki(e,t[10].bind(e)),n=!0},p(o,[a]){o[0].x.ticks&&o[0].points&&o[4]?i?(i.p(o,a),a&17&&X(i,1)):(i=Vo(o),i.c(),X(i,1),i.m(e,null)):i&&(mt(),ee(i,1,1,()=>{i=null}),pt())},i(o){n||(X(i),n=!0)},o(o){ee(i),n=!1},d(o){o&&P(e),i&&i.d(),l()}}}let un=30;function dc(t,e,l){let{config:n}=e,i,o,a,r,f,c,m,_=0;function d(){_=this.clientHeight,l(5,_)}function v(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=g=>{"config"in g&&l(0,n=g.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,c=o-_);let g=i-(n.padding.left+n.padding.right);l(3,a=g/n.points.length),l(8,m=an.y.max?M=n.padding.bottom:kc||M<0?0:M})}},[n,i,o,a,c,_,r,f,m,d,v]}class pn extends Nt{constructor(e){super(),Pt(this,e,dc,pc,St,{config:0})}}function hc(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function vc(t,e,l){let{title:n}=e,{u1:i}=e,{u2:o}=e,{u3:a}=e,{ds:r}=e,f={};function c(m){return{label:Zt(m)+"V",title:m.toFixed(1)+" V",value:isNaN(m)?0:m,color:b1(m||0,document.documentElement.classList.contains("dark"))}}return t.$$set=m=>{"title"in m&&l(1,n=m.title),"u1"in m&&l(2,i=m.u1),"u2"in m&&l(3,o=m.u2),"u3"in m&&l(4,a=m.u3),"ds"in m&&l(5,r=m.ds)},t.$$.update=()=>{if(t.$$.dirty&62){let m=[],_=[];i>0&&(m.push({label:r===1?"L1-L2":"L1"}),_.push(c(i))),o>0&&(m.push({label:r===1?"L1-L3":"L2"}),_.push(c(o))),a>0&&(m.push({label:r===1?"L2-L3":"L3"}),_.push(c(a))),l(0,f={title:n,padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:m},points:_})}},[f,n,i,o,a,r]}class bc extends Nt{constructor(e){super(),Pt(this,e,vc,hc,St,{title:1,u1:2,u2:3,u3:4,ds:5})}}function gc(t){var D,z,x,ae,_e;let e,l,n=(((D=t[0].reactive)==null?void 0:D.title)??"Reactive")+"",i,o,a,r,f=(((z=t[0].reactive)==null?void 0:z.instant_in)??"Instant in")+"",c,m,_,d=t[1][0]+"",v,g,b=t[1][1]+"",k,M,L,R=(((x=t[0].reactive)==null?void 0:x.instant_out)??"Instant out")+"",F,T,A,O=t[2][0]+"",j,K,G=t[2][1]+"",q,U,Z,V,Y=(((ae=t[0].reactive)==null?void 0:ae.total_in)??"Total in")+"",W,B,y,ne=t[3][0]+"",te,Q,se=t[3][1]+"",ue,fe,le,de=(((_e=t[0].reactive)==null?void 0:_e.total_out)??"Total out")+"",ie,me,oe,pe=t[4][0]+"",we,C,w=t[4][1]+"",I;return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("div"),r=p("div"),c=S(f),m=h(),_=p("div"),v=S(d),g=h(),k=S(b),M=h(),L=p("div"),F=S(R),T=h(),A=p("div"),j=S(O),K=h(),q=S(G),U=h(),Z=p("div"),V=p("div"),W=S(Y),B=h(),y=p("div"),te=S(ne),Q=h(),ue=S(se),fe=h(),le=p("div"),ie=S(de),me=h(),oe=p("div"),we=S(pe),C=h(),I=S(w),u(_,"class","text-right"),u(A,"class","text-right"),u(a,"class","grid grid-cols-2 mt-4"),u(y,"class","text-right"),u(oe,"class","text-right"),u(Z,"class","grid grid-cols-2 mt-4"),u(e,"class","mx-2 text-sm")},m(he,J){N(he,e,J),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(r,c),s(a,m),s(a,_),s(_,v),s(_,g),s(_,k),s(a,M),s(a,L),s(L,F),s(a,T),s(a,A),s(A,j),s(A,K),s(A,q),s(e,U),s(e,Z),s(Z,V),s(V,W),s(Z,B),s(Z,y),s(y,te),s(y,Q),s(y,ue),s(Z,fe),s(Z,le),s(le,ie),s(Z,me),s(Z,oe),s(oe,we),s(oe,C),s(oe,I)},p(he,[J]){var ve,ke,De,Te,Ae;J&1&&n!==(n=(((ve=he[0].reactive)==null?void 0:ve.title)??"Reactive")+"")&&E(i,n),J&1&&f!==(f=(((ke=he[0].reactive)==null?void 0:ke.instant_in)??"Instant in")+"")&&E(c,f),J&2&&d!==(d=he[1][0]+"")&&E(v,d),J&2&&b!==(b=he[1][1]+"")&&E(k,b),J&1&&R!==(R=(((De=he[0].reactive)==null?void 0:De.instant_out)??"Instant out")+"")&&E(F,R),J&4&&O!==(O=he[2][0]+"")&&E(j,O),J&4&&G!==(G=he[2][1]+"")&&E(q,G),J&1&&Y!==(Y=(((Te=he[0].reactive)==null?void 0:Te.total_in)??"Total in")+"")&&E(W,Y),J&8&&ne!==(ne=he[3][0]+"")&&E(te,ne),J&8&&se!==(se=he[3][1]+"")&&E(ue,se),J&1&&de!==(de=(((Ae=he[0].reactive)==null?void 0:Ae.total_out)??"Total out")+"")&&E(ie,de),J&16&&pe!==(pe=he[4][0]+"")&&E(we,pe),J&16&&w!==(w=he[4][1]+"")&&E(I,w)},i:ze,o:ze,d(he){he&&P(e)}}}function kc(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:a}=e,{translations:r={}}=e,f,c,m,_;return t.$$set=d=>{"importInstant"in d&&l(5,n=d.importInstant),"exportInstant"in d&&l(6,i=d.exportInstant),"importTotal"in d&&l(7,o=d.importTotal),"exportTotal"in d&&l(8,a=d.exportTotal),"translations"in d&&l(0,r=d.translations)},t.$$.update=()=>{t.$$.dirty&480&&(l(1,f=rl(n,"VAr")),l(2,c=rl(i,"VAr")),l(3,m=rl(o*1e3,"VArh")),l(4,_=rl(a*1e3,"VArh")))},[r,f,c,m,_,n,i,o,a]}class wc extends Nt{constructor(e){super(),Pt(this,e,kc,gc,St,{importInstant:5,exportInstant:6,importTotal:7,exportTotal:8,translations:0})}}function fs(t){let e;function l(o,a){return o[3]?Sc:Cc}let n=l(t),i=n(t);return{c(){i.c(),e=Wt()},m(o,a){i.m(o,a),N(o,e,a)},p(o,a){n===(n=l(o))&&i?i.p(o,a):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){o&&P(e),i.d(o)}}}function Cc(t){var z,x,ae,_e,he;let e,l=(((z=t[4].realtime)==null?void 0:z.consumption)??"Consumption")+"",n,i,o,a,r=ol(((x=t[4].common)==null?void 0:x.hour)??"Hour")+"",f,c,m,_=t[6][0]+"",d,v,g=t[6][1]+"",b,k,M,L=ol(((ae=t[4].common)==null?void 0:ae.day)??"Day")+"",R,F,T,A=t[7][0]+"",O,j,K=t[7][1]+"",G,q,U,Z=ol(((_e=t[4].common)==null?void 0:_e.month)??"Month")+"",V,Y,W,B=t[8][0]+"",y,ne,te=t[8][1]+"",Q,se,ue,fe=(((he=t[4].realtime)==null?void 0:he.last_month)??"Last month")+"",le,de,ie,me=t[9][0]+"",oe,pe,we=t[9][1]+"",C,w,I,D=t[5]&&us(t);return{c(){e=p("strong"),n=S(l),i=h(),o=p("div"),a=p("div"),f=S(r),c=h(),m=p("div"),d=S(_),v=h(),b=S(g),k=h(),M=p("div"),R=S(L),F=h(),T=p("div"),O=S(A),j=h(),G=S(K),q=h(),U=p("div"),V=S(Z),Y=h(),W=p("div"),y=S(B),ne=h(),Q=S(te),se=h(),ue=p("div"),le=S(fe),de=h(),ie=p("div"),oe=S(me),pe=h(),C=S(we),w=h(),D&&D.c(),I=Wt(),u(m,"class","text-right"),u(T,"class","text-right"),u(W,"class","text-right"),u(ie,"class","text-right"),u(o,"class","grid grid-cols-2 mb-3")},m(J,ve){N(J,e,ve),s(e,n),N(J,i,ve),N(J,o,ve),s(o,a),s(a,f),s(o,c),s(o,m),s(m,d),s(m,v),s(m,b),s(o,k),s(o,M),s(M,R),s(o,F),s(o,T),s(T,O),s(T,j),s(T,G),s(o,q),s(o,U),s(U,V),s(o,Y),s(o,W),s(W,y),s(W,ne),s(W,Q),s(o,se),s(o,ue),s(ue,le),s(o,de),s(o,ie),s(ie,oe),s(ie,pe),s(ie,C),N(J,w,ve),D&&D.m(J,ve),N(J,I,ve)},p(J,ve){var ke,De,Te,Ae,Le;ve&16&&l!==(l=(((ke=J[4].realtime)==null?void 0:ke.consumption)??"Consumption")+"")&&E(n,l),ve&16&&r!==(r=ol(((De=J[4].common)==null?void 0:De.hour)??"Hour")+"")&&E(f,r),ve&64&&_!==(_=J[6][0]+"")&&E(d,_),ve&64&&g!==(g=J[6][1]+"")&&E(b,g),ve&16&&L!==(L=ol(((Te=J[4].common)==null?void 0:Te.day)??"Day")+"")&&E(R,L),ve&128&&A!==(A=J[7][0]+"")&&E(O,A),ve&128&&K!==(K=J[7][1]+"")&&E(G,K),ve&16&&Z!==(Z=ol(((Ae=J[4].common)==null?void 0:Ae.month)??"Month")+"")&&E(V,Z),ve&256&&B!==(B=J[8][0]+"")&&E(y,B),ve&256&&te!==(te=J[8][1]+"")&&E(Q,te),ve&16&&fe!==(fe=(((Le=J[4].realtime)==null?void 0:Le.last_month)??"Last month")+"")&&E(le,fe),ve&512&&me!==(me=J[9][0]+"")&&E(oe,me),ve&512&&we!==(we=J[9][1]+"")&&E(C,we),J[5]?D?D.p(J,ve):(D=us(J),D.c(),D.m(I.parentNode,I)):D&&(D.d(1),D=null)},d(J){J&&(P(e),P(i),P(o),P(w),P(I)),D&&D.d(J)}}}function Sc(t){var nt,je,yt,al,nl,fl,il,jt,Ht,Ke;let e,l=(((nt=t[4].common)==null?void 0:nt.import)??"Import")+"",n,i,o,a,r=ol(((je=t[4].common)==null?void 0:je.hour)??"Hour")+"",f,c,m,_=t[6][0]+"",d,v,g=t[6][1]+"",b,k,M,L,R=ol(((yt=t[4].common)==null?void 0:yt.day)??"Day")+"",F,T,A,O=t[7][0]+"",j,K,G=t[7][1]+"",q,U,Z,V,Y=ol(((al=t[4].common)==null?void 0:al.month)??"Month")+"",W,B,y,ne=t[8][0]+"",te,Q,se=t[8][1]+"",ue,fe,le,de,ie=(((nl=t[4].realtime)==null?void 0:nl.last_mo)??"Last mo.")+"",me,oe,pe,we=t[9][0]+"",C,w,I=t[9][1]+"",D,z,x,ae,_e,he=(((fl=t[4].common)==null?void 0:fl.export)??"Export")+"",J,ve,ke,De,Te=ol(((il=t[4].common)==null?void 0:il.hour)??"Hour")+"",Ae,Le,Ee,Ie=t[10][0]+"",Je,wt,et=t[10][1]+"",ut,Ct,ht,rt,it=ol(((jt=t[4].common)==null?void 0:jt.day)??"Day")+"",vt,Ot,$e,Re=t[11][0]+"",Be,tt,ge=t[11][1]+"",qe,Ge,ce,Ce,xe=ol(((Ht=t[4].common)==null?void 0:Ht.month)??"Month")+"",ye,Lt,gt,Ye=t[12][0]+"",Mt,ot,_t=t[12][1]+"",lt,Bt,Xt,ct,at=(((Ke=t[4].realtime)==null?void 0:Ke.last_mo)??"Last mo.")+"",Gt,Jt,Tt,Yt=t[13][0]+"",xt,$t,Vt=t[13][1]+"",It,Ve,Qe,Xe=t[5]&&rs(t),qt=t[5]&&cs(t),Ut=t[5]&&_s(t),dt=t[5]&&ms(t),st=t[5]&&ps(t),bt=t[5]&&ds(t),Rt=t[5]&&hs(t),be=t[5]&&vs(t);return{c(){e=p("strong"),n=S(l),i=h(),o=p("div"),a=p("div"),f=S(r),c=h(),m=p("div"),d=S(_),v=h(),b=S(g),k=h(),Xe&&Xe.c(),M=h(),L=p("div"),F=S(R),T=h(),A=p("div"),j=S(O),K=h(),q=S(G),U=h(),qt&&qt.c(),Z=h(),V=p("div"),W=S(Y),B=h(),y=p("div"),te=S(ne),Q=h(),ue=S(se),fe=h(),Ut&&Ut.c(),le=h(),de=p("div"),me=S(ie),oe=h(),pe=p("div"),C=S(we),w=h(),D=S(I),z=h(),dt&&dt.c(),ae=h(),_e=p("strong"),J=S(he),ve=h(),ke=p("div"),De=p("div"),Ae=S(Te),Le=h(),Ee=p("div"),Je=S(Ie),wt=h(),ut=S(et),Ct=h(),st&&st.c(),ht=h(),rt=p("div"),vt=S(it),Ot=h(),$e=p("div"),Be=S(Re),tt=h(),qe=S(ge),Ge=h(),bt&&bt.c(),ce=h(),Ce=p("div"),ye=S(xe),Lt=h(),gt=p("div"),Mt=S(Ye),ot=h(),lt=S(_t),Bt=h(),Rt&&Rt.c(),Xt=h(),ct=p("div"),Gt=S(at),Jt=h(),Tt=p("div"),xt=S(Yt),$t=h(),It=S(Vt),Ve=h(),be&&be.c(),u(m,"class","text-right"),u(A,"class","text-right"),u(y,"class","text-right"),u(pe,"class","text-right"),u(o,"class",x="grid grid-cols-"+t[14]+" mb-3"),u(Ee,"class","text-right"),u($e,"class","text-right"),u(gt,"class","text-right"),u(Tt,"class","text-right"),u(ke,"class",Qe="grid grid-cols-"+t[14])},m(Se,$){N(Se,e,$),s(e,n),N(Se,i,$),N(Se,o,$),s(o,a),s(a,f),s(o,c),s(o,m),s(m,d),s(m,v),s(m,b),s(o,k),Xe&&Xe.m(o,null),s(o,M),s(o,L),s(L,F),s(o,T),s(o,A),s(A,j),s(A,K),s(A,q),s(o,U),qt&&qt.m(o,null),s(o,Z),s(o,V),s(V,W),s(o,B),s(o,y),s(y,te),s(y,Q),s(y,ue),s(o,fe),Ut&&Ut.m(o,null),s(o,le),s(o,de),s(de,me),s(o,oe),s(o,pe),s(pe,C),s(pe,w),s(pe,D),s(o,z),dt&&dt.m(o,null),N(Se,ae,$),N(Se,_e,$),s(_e,J),N(Se,ve,$),N(Se,ke,$),s(ke,De),s(De,Ae),s(ke,Le),s(ke,Ee),s(Ee,Je),s(Ee,wt),s(Ee,ut),s(ke,Ct),st&&st.m(ke,null),s(ke,ht),s(ke,rt),s(rt,vt),s(ke,Ot),s(ke,$e),s($e,Be),s($e,tt),s($e,qe),s(ke,Ge),bt&&bt.m(ke,null),s(ke,ce),s(ke,Ce),s(Ce,ye),s(ke,Lt),s(ke,gt),s(gt,Mt),s(gt,ot),s(gt,lt),s(ke,Bt),Rt&&Rt.m(ke,null),s(ke,Xt),s(ke,ct),s(ct,Gt),s(ke,Jt),s(ke,Tt),s(Tt,xt),s(Tt,$t),s(Tt,It),s(ke,Ve),be&&be.m(ke,null)},p(Se,$){var Oe,ul,tl,pl,dl,wl,Cl,Sl,Ml,Pl;$&16&&l!==(l=(((Oe=Se[4].common)==null?void 0:Oe.import)??"Import")+"")&&E(n,l),$&16&&r!==(r=ol(((ul=Se[4].common)==null?void 0:ul.hour)??"Hour")+"")&&E(f,r),$&64&&_!==(_=Se[6][0]+"")&&E(d,_),$&64&&g!==(g=Se[6][1]+"")&&E(b,g),Se[5]?Xe?Xe.p(Se,$):(Xe=rs(Se),Xe.c(),Xe.m(o,M)):Xe&&(Xe.d(1),Xe=null),$&16&&R!==(R=ol(((tl=Se[4].common)==null?void 0:tl.day)??"Day")+"")&&E(F,R),$&128&&O!==(O=Se[7][0]+"")&&E(j,O),$&128&&G!==(G=Se[7][1]+"")&&E(q,G),Se[5]?qt?qt.p(Se,$):(qt=cs(Se),qt.c(),qt.m(o,Z)):qt&&(qt.d(1),qt=null),$&16&&Y!==(Y=ol(((pl=Se[4].common)==null?void 0:pl.month)??"Month")+"")&&E(W,Y),$&256&&ne!==(ne=Se[8][0]+"")&&E(te,ne),$&256&&se!==(se=Se[8][1]+"")&&E(ue,se),Se[5]?Ut?Ut.p(Se,$):(Ut=_s(Se),Ut.c(),Ut.m(o,le)):Ut&&(Ut.d(1),Ut=null),$&16&&ie!==(ie=(((dl=Se[4].realtime)==null?void 0:dl.last_mo)??"Last mo.")+"")&&E(me,ie),$&512&&we!==(we=Se[9][0]+"")&&E(C,we),$&512&&I!==(I=Se[9][1]+"")&&E(D,I),Se[5]?dt?dt.p(Se,$):(dt=ms(Se),dt.c(),dt.m(o,null)):dt&&(dt.d(1),dt=null),$&16384&&x!==(x="grid grid-cols-"+Se[14]+" mb-3")&&u(o,"class",x),$&16&&he!==(he=(((wl=Se[4].common)==null?void 0:wl.export)??"Export")+"")&&E(J,he),$&16&&Te!==(Te=ol(((Cl=Se[4].common)==null?void 0:Cl.hour)??"Hour")+"")&&E(Ae,Te),$&1024&&Ie!==(Ie=Se[10][0]+"")&&E(Je,Ie),$&1024&&et!==(et=Se[10][1]+"")&&E(ut,et),Se[5]?st?st.p(Se,$):(st=ps(Se),st.c(),st.m(ke,ht)):st&&(st.d(1),st=null),$&16&&it!==(it=ol(((Sl=Se[4].common)==null?void 0:Sl.day)??"Day")+"")&&E(vt,it),$&2048&&Re!==(Re=Se[11][0]+"")&&E(Be,Re),$&2048&&ge!==(ge=Se[11][1]+"")&&E(qe,ge),Se[5]?bt?bt.p(Se,$):(bt=ds(Se),bt.c(),bt.m(ke,ce)):bt&&(bt.d(1),bt=null),$&16&&xe!==(xe=ol(((Ml=Se[4].common)==null?void 0:Ml.month)??"Month")+"")&&E(ye,xe),$&4096&&Ye!==(Ye=Se[12][0]+"")&&E(Mt,Ye),$&4096&&_t!==(_t=Se[12][1]+"")&&E(lt,_t),Se[5]?Rt?Rt.p(Se,$):(Rt=hs(Se),Rt.c(),Rt.m(ke,Xt)):Rt&&(Rt.d(1),Rt=null),$&16&&at!==(at=(((Pl=Se[4].realtime)==null?void 0:Pl.last_mo)??"Last mo.")+"")&&E(Gt,at),$&8192&&Yt!==(Yt=Se[13][0]+"")&&E(xt,Yt),$&8192&&Vt!==(Vt=Se[13][1]+"")&&E(It,Vt),Se[5]?be?be.p(Se,$):(be=vs(Se),be.c(),be.m(ke,null)):be&&(be.d(1),be=null),$&16384&&Qe!==(Qe="grid grid-cols-"+Se[14])&&u(ke,"class",Qe)},d(Se){Se&&(P(e),P(i),P(o),P(ae),P(_e),P(ve),P(ke)),Xe&&Xe.d(),qt&&qt.d(),Ut&&Ut.d(),dt&&dt.d(),st&&st.d(),bt&&bt.d(),Rt&&Rt.d(),be&&be.d()}}}function us(t){var oe,pe,we,C,w,I;let e,l=(((oe=t[4].realtime)==null?void 0:oe.cost)??"Cost")+"",n,i,o,a,r=ol(((pe=t[4].common)==null?void 0:pe.hour)??"Hour")+"",f,c,m,_=Zt(t[1].h.c,2)+"",d,v,g,b,k,M=ol(((we=t[4].common)==null?void 0:we.day)??"Day")+"",L,R,F,T=Zt(t[1].d.c,1)+"",A,O,j,K,G,q=ol(((C=t[4].common)==null?void 0:C.month)??"Month")+"",U,Z,V,Y=Zt(t[1].m.c)+"",W,B,y,ne,te,Q=(((w=t[4].realtime)==null?void 0:w.last_month)??"Last month")+"",se,ue,fe,le=Zt((I=t[0].last_month)==null?void 0:I.c)+"",de,ie,me;return{c(){e=p("strong"),n=S(l),i=h(),o=p("div"),a=p("div"),f=S(r),c=h(),m=p("div"),d=S(_),v=h(),g=S(t[2]),b=h(),k=p("div"),L=S(M),R=h(),F=p("div"),A=S(T),O=h(),j=S(t[2]),K=h(),G=p("div"),U=S(q),Z=h(),V=p("div"),W=S(Y),B=h(),y=S(t[2]),ne=h(),te=p("div"),se=S(Q),ue=h(),fe=p("div"),de=S(le),ie=h(),me=S(t[2]),u(m,"class","text-right"),u(F,"class","text-right"),u(V,"class","text-right"),u(fe,"class","text-right"),u(o,"class","grid grid-cols-2")},m(D,z){N(D,e,z),s(e,n),N(D,i,z),N(D,o,z),s(o,a),s(a,f),s(o,c),s(o,m),s(m,d),s(m,v),s(m,g),s(o,b),s(o,k),s(k,L),s(o,R),s(o,F),s(F,A),s(F,O),s(F,j),s(o,K),s(o,G),s(G,U),s(o,Z),s(o,V),s(V,W),s(V,B),s(V,y),s(o,ne),s(o,te),s(te,se),s(o,ue),s(o,fe),s(fe,de),s(fe,ie),s(fe,me)},p(D,z){var x,ae,_e,he,J,ve;z&16&&l!==(l=(((x=D[4].realtime)==null?void 0:x.cost)??"Cost")+"")&&E(n,l),z&16&&r!==(r=ol(((ae=D[4].common)==null?void 0:ae.hour)??"Hour")+"")&&E(f,r),z&2&&_!==(_=Zt(D[1].h.c,2)+"")&&E(d,_),z&4&&E(g,D[2]),z&16&&M!==(M=ol(((_e=D[4].common)==null?void 0:_e.day)??"Day")+"")&&E(L,M),z&2&&T!==(T=Zt(D[1].d.c,1)+"")&&E(A,T),z&4&&E(j,D[2]),z&16&&q!==(q=ol(((he=D[4].common)==null?void 0:he.month)??"Month")+"")&&E(U,q),z&2&&Y!==(Y=Zt(D[1].m.c)+"")&&E(W,Y),z&4&&E(y,D[2]),z&16&&Q!==(Q=(((J=D[4].realtime)==null?void 0:J.last_month)??"Last month")+"")&&E(se,Q),z&1&&le!==(le=Zt((ve=D[0].last_month)==null?void 0:ve.c)+"")&&E(de,le),z&4&&E(me,D[2])},d(D){D&&(P(e),P(i),P(o))}}}function rs(t){let e,l=Zt(t[1].h.c,2)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].h.c,2)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function cs(t){let e,l=Zt(t[1].d.c,1)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].d.c,1)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function _s(t){let e,l=Zt(t[1].m.c)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].m.c)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function ms(t){var a;let e,l=Zt((a=t[0].last_month)==null?void 0:a.c)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(r,f){N(r,e,f),s(e,n),s(e,i),s(e,o)},p(r,f){var c;f&1&&l!==(l=Zt((c=r[0].last_month)==null?void 0:c.c)+"")&&E(n,l),f&4&&E(o,r[2])},d(r){r&&P(e)}}}function ps(t){let e,l=Zt(t[1].h.i,2)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].h.i,2)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function ds(t){let e,l=Zt(t[1].d.i,1)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].d.i,1)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function hs(t){let e,l=Zt(t[1].m.i)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].m.i)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function vs(t){var a;let e,l=Zt((a=t[0].last_month)==null?void 0:a.i)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(r,f){N(r,e,f),s(e,n),s(e,i),s(e,o)},p(r,f){var c;f&1&&l!==(l=Zt((c=r[0].last_month)==null?void 0:c.i)+"")&&E(n,l),f&4&&E(o,r[2])},d(r){r&&P(e)}}}function Mc(t){var m;let e,l,n=(((m=t[4].realtime)==null?void 0:m.title)??"Real time calculations")+"",i,o,a,r,f,c=t[1]&&fs(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("br"),r=p("br"),f=h(),c&&c.c(),u(e,"class","mx-2 text-sm")},m(_,d){N(_,e,d),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),c&&c.m(e,null)},p(_,[d]){var v;d&16&&n!==(n=(((v=_[4].realtime)==null?void 0:v.title)??"Real time calculations")+"")&&E(i,n),_[1]?c?c.p(_,d):(c=fs(_),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:ze,o:ze,d(_){_&&P(e),c&&c.d()}}}function Pc(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:a}=e,{translations:r={}}=e,f,c,m,_,d,v,g,b,k=!1,M=3;return t.$$set=L=>{"sysinfo"in L&&l(0,n=L.sysinfo),"data"in L&&l(1,i=L.data),"currency"in L&&l(2,o=L.currency),"hasExport"in L&&l(3,a=L.hasExport),"translations"in L&&l(4,r=L.translations)},t.$$.update=()=>{var L,R,F,T,A,O,j,K;t.$$.dirty&35&&(l(5,k=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(14,M=k?3:2),l(6,f=rl(((L=i==null?void 0:i.h)==null?void 0:L.u)*1e3,"Wh")),l(7,c=rl(((R=i==null?void 0:i.d)==null?void 0:R.u)*1e3,"Wh")),l(8,m=rl(((F=i==null?void 0:i.m)==null?void 0:F.u)*1e3,"Wh")),l(9,_=rl(((T=n==null?void 0:n.last_month)==null?void 0:T.u)*1e3,"Wh")),l(10,d=rl(((A=i==null?void 0:i.h)==null?void 0:A.p)*1e3,"Wh")),l(11,v=rl(((O=i==null?void 0:i.d)==null?void 0:O.p)*1e3,"Wh")),l(12,g=rl(((j=i==null?void 0:i.m)==null?void 0:j.p)*1e3,"Wh")),l(13,b=rl(((K=n==null?void 0:n.last_month)==null?void 0:K.p)*1e3,"Wh")))},[n,i,o,a,r,k,f,c,m,_,d,v,g,b,M]}class Nc extends Nt{constructor(e){super(),Pt(this,e,Pc,Mc,St,{sysinfo:0,data:1,currency:2,hasExport:3,translations:4})}}function Tc(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function qc(t,e,l){let{title:n}=e,{json:i}=e,{sysinfo:o}=e,a={},r,f,c=document.documentElement.classList.contains("dark");return t.$$set=m=>{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,o=m.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&54){let m=i.currency,_=0,d=[],v=[],g=[];l(5,f=l(4,r=0));let b=new Date,k=Math.floor((b.getHours()*60+b.getMinutes())/(i==null?void 0:i.resolution));for(console.log("Starting at index "+k),b.setMinutes(Math.floor(b.getMinutes()/i.resolution)*i.resolution,0,0);i!=null&&i.hasOwnProperty(Dt(k))&&(_=i[Dt(k++)],_!=null);)v.push({label:g.length>1&&i.resolution<60&&b.getMinutes()!=0?"":Dt(b.getHours())}),g.push(_*100),l(5,f=Math.min(f,_*100)),l(4,r=Math.max(r,_*100)),g1(b,i.resolution);let M=Gn(Math.max(Math.abs(f)/100,Math.abs(r)/100),m);if(M&&M[1]&&M[1]!=m)for(m=M[1],l(5,f*=100),l(4,r*=100),k=0;k=0?A.toFixed(O):"",title:A>=0?A.toFixed(2)+" "+m:"",value:_>=0?Math.abs(_):0,label2:A<0?A.toFixed(O):"",title2:A<0?A.toFixed(2)+" "+m:"",value2:_<0?Math.abs(_):0,color:c?"#5c2da5":"#7c3aed"})}let R=Math.max(r,Math.abs(f));if(f<0){l(5,f=Math.min(R/4*-1,f));let A=Math.ceil(Math.abs(f)/R*4),O=f/A;for(k=1;k{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,o=m.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let m=0,_=[],d=[],v=[];l(5,f=l(4,r=0));let g=new Date,b=new Date;b.setDate(0),b.setHours(12);let k=(b.getHours()-b.getUTCHours())%24-o.clock_offset,M=g.getUTCHours();for(Cn(g,-k-24),m=M;m<24;m++){let T=i["i"+Dt(m)],A=i["e"+Dt(m)];T===void 0&&(T=0),A===void 0&&(A=0),d.push({label:Dt(g.getHours())}),v.push({label:T.toFixed(1),title:T.toFixed(2)+" kWh",value:T*10,label2:A.toFixed(1),title2:A.toFixed(2)+" kWh",value2:A*10,color:c?"#5c2da5":"#7c3aed",color2:c?"#27728e":"#37829e"}),l(5,f=Math.max(f,A*10)),l(4,r=Math.max(r,T*10)),Cn(g,1)}for(m=0;m{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,o=m.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let m=0,_=[],d=[],v=[];l(5,f=l(4,r=0));let g=new Date,b=new Date;b.setDate(0),b.setHours(12);let k=(b.getHours()-b.getUTCHours())%24-o.clock_offset;for(Cn(g,-k),Cn(b,-k),m=g.getDate();m<=b.getDate();m++){let F=i["i"+Dt(m)],T=i["e"+Dt(m)];F===void 0&&(F=0),T===void 0&&(T=0),d.push({label:Dt(m)}),v.push({label:F.toFixed(F<10?1:0),title:F.toFixed(2)+" kWh",value:F,label2:T.toFixed(T<10?1:0),title2:T.toFixed(2)+" kWh",value2:T,color:c?"#5c2da5":"#7c3aed",color2:c?"#27728e":"#37829e"}),l(5,f=Math.max(f,T)),l(4,r=Math.max(r,F))}for(m=1;m{"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,m=0,_=[],d=[],v=[];i.s&&i.s.forEach((k,M)=>{var L=k.n?k.n:k.a;m=k.v,m==-127&&(m=0),d.push({label:L.slice(-4)}),v.push({label:m.toFixed(1),value:m,color:o?"#5c2da5":"#7c3aed"}),l(4,f=Math.min(f,m)),l(3,r=Math.max(r,m))}),l(3,r=Math.ceil(r)),l(4,f=Math.floor(f));let g=r;f<0&&(g+=Math.abs(f));let b=g/4;for(c=0;c<5;c++)m=f+b*c,_.push({value:m,label:m.toFixed(1)});l(0,a={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:_},x:{ticks:d},points:v})}},[a,n,i,r,f]}class Bc extends Nt{constructor(e){super(),Pt(this,e,Fc,Rc,St,{title:1,json:2})}}function Uc(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}let jc=0;function Hc(t,e,l){let{title:n}=e,{translations:i={}}=e,o=document.documentElement.classList.contains("dark"),a={},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 m=0,_=[],d=[],v=[];if(_.push({value:0,label:0}),f&&f.p)for(m=0;m0?Dt(g.d)+"."+(i.months?(c=i.months)==null?void 0:c[new Date().getMonth()]:Dt(new Date().getMonth()+1)):"-"}),l(4,r=Math.max(r,g.v))}if(f&&f.t){for(m=0;m=r)break;_.push({value:g,label:g})}_.push({label:f.m.toFixed(1),align:"right",color:"green",value:f.m})}f&&f.c&&(_.push({label:f.c.toFixed(0),color:"orange",value:f.c}),l(4,r=Math.max(r,f.c))),l(4,r=Math.ceil(r)),l(0,a={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:35,bottom:20,left:35},y:{min:jc,max:r,ticks:_},x:{ticks:d},points:v})}},[a,n,i,f,r]}class zc extends Nt{constructor(e){super(),Pt(this,e,Hc,Uc,St,{title:1,translations:2,tariffData:3})}}let sn=0,yc={data:[]};async function eo(){let e=await(await vl(sn<0?"realtime.json":"realtime.json?offset="+sn)).json();to.update(l=>{for(let n=0;n=0&&(sn+=e.size,snkn||Fi-kn>300?(eo(),wi=0):to.update(t=>{if(t.lastUpdate)for(;kn>t.lastUpdate;)t.data.unshift(Vu),t.data=t.data.slice(0,t.size),t.lastUpdate+=10,wi++;else t.lastUpdate=kn;return t})}function Vc(t){if(Vu=t.i-t.e,kn=t.u,!bs){eo(),bs=!0,Fi=kn;return}Wc()&&Gc()}function gs(t,e,l){const n=t.slice();return n[18]=e[l],n[20]=l,n}function ks(t,e,l){const n=t.slice();return n[21]=e[l],n}function Kc(t){let e,l,n;return{c(){e=p("strong"),l=S(t[0]),n=S(" not available"),u(e,"class","text-sm")},m(i,o){N(i,e,o),s(e,l),s(e,n)},p(i,o){o&1&&E(l,i[0])},d(i){i&&P(e)}}}function Yc(t){let e,l,n,i,o,a,r,f=t[8]&&ws(t);return{c(){e=p("strong"),l=S(t[0]),n=S(" ("),i=S(t[12]),o=S(")"),a=h(),f&&f.c(),r=Wt(),u(e,"class","text-sm")},m(c,m){N(c,e,m),s(e,l),s(e,n),s(e,i),s(e,o),N(c,a,m),f&&f.m(c,m),N(c,r,m)},p(c,m){m&1&&E(l,c[0]),m&4096&&E(i,c[12]),c[8]?f?f.p(c,m):(f=ws(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(P(e),P(a),P(r)),f&&f.d(c)}}}function ws(t){let e,l,n,i,o,a=ft(t[8]),r=[];for(let m=0;mt[17].call(e))},m(a,r){N(a,e,r),o.m(e,null),l=Ki(e,t[17].bind(e))},p(a,[r]){i===(i=n(a))&&o?o.p(a,r):(o.d(1),o=i(a),o&&(o.c(),o.m(e,null)))},i:ze,o:ze,d(a){a&&P(e),o.d(),l()}}}function Xc(t,e,l){let{title:n}=e,i=document.documentElement.classList.contains("dark"),o=null;to.subscribe(T=>{l(16,o=T)});let a=!1,r,f,c,m,_,d,v,g=function(T,A,O){return Math.ceil(_-(T-A)/(O-A)*_)-25},b=function(T){return 30+Math.ceil(T/o.size*(d-35))},k,M,L,R;function F(){c=this.clientWidth,m=this.clientHeight,l(3,c),l(4,m)}return t.$$set=T=>{"title"in T&&l(0,n=T.title)},t.$$.update=()=>{if(t.$$.dirty&67582)if(l(5,_=parseInt(m)-50),l(6,d=c-35),l(10,L=d/o.size),l(2,f=0),l(1,r=0),o.data&&_>10&&d>100&&L>.1){l(11,a=!0);for(let O in o.data){let j=o.data[O];isNaN(j)&&(j=0),l(1,r=Math.max(Math.ceil(j/1e3)*1e3,r)),l(2,f=Math.min(Math.floor(j/1e3)*1e3,f))}let T=r-f;l(12,R=r>2500?"kW":"W"),l(8,k=[]);for(let O=f;O2500?(O/1e3).toFixed(1):O}),!(k.length>6));O+=T/5);l(9,M=[]);for(let O=0;O12));O+=Math.round(o.size/Math.round(d/120)));let A=o.size;l(7,v=b(o.size)+","+g(0,f,r)+" "+b(1)+","+g(0,f,r));for(let O in o.data){if(A<0)break;let j=o.data[O];isNaN(j)&&(j=0),l(7,v=b(A--)+","+g(j,f,r)+" "+v)}}else l(11,a=!1)},[n,r,f,c,m,_,d,v,k,M,L,a,R,i,g,b,o,F]}class Zc extends Nt{constructor(e){super(),Pt(this,e,Xc,Qc,St,{title:0})}}function Jc(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function $c(t,e,l){let{title:n}=e,{unit:i=""}=e,{l1:o=!1}=e,{l2:a=!1}=e,{l2x:r=!1}=e,{l3:f=!1}=e,{l1i:c=0}=e,{l2i:m=0}=e,{l3i:_=0}=e,{l1e:d=0}=e,{l2e:v=0}=e,{l3e:g=0}=e,{maxImport:b=0}=e,{maxExport:k=0}=e,{importColorFn:M}=e,{exportColorFn:L}=e,R={};function F(T,A){return{label:Zt(T>900?T/1e3:T)+(T>900?"k":"")+i,title:T.toFixed(2)+" "+i,value:isNaN(T)?0:T,color:M(T?T/b*100:0,document.documentElement.classList.contains("dark")),label2:Zt(A>900?A/1e3:A)+(A>900?"k":"")+i,title2:A.toFixed(2)+" "+i,value2:isNaN(A)?0:A,color2:L(A?A/k*100:0)}}return t.$$set=T=>{"title"in T&&l(1,n=T.title),"unit"in T&&l(2,i=T.unit),"l1"in T&&l(3,o=T.l1),"l2"in T&&l(4,a=T.l2),"l2x"in T&&l(5,r=T.l2x),"l3"in T&&l(6,f=T.l3),"l1i"in T&&l(7,c=T.l1i),"l2i"in T&&l(8,m=T.l2i),"l3i"in T&&l(9,_=T.l3i),"l1e"in T&&l(10,d=T.l1e),"l2e"in T&&l(11,v=T.l2e),"l3e"in T&&l(12,g=T.l3e),"maxImport"in T&&l(13,b=T.maxImport),"maxExport"in T&&l(14,k=T.maxExport),"importColorFn"in T&&l(15,M=T.importColorFn),"exportColorFn"in T&&l(16,L=T.exportColorFn)},t.$$.update=()=>{if(t.$$.dirty&32762){let T=[],A=[];o&&(T.push({label:"L1"}),A.push(F(c,d))),a&&(r?(T.push({label:"L2"}),A.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(T.push({label:"L2"}),A.push(F(m,v)))),f&&(T.push({label:"L3"}),A.push(F(_,g)));let O=[];if(k){let j=k>b?4:k*4/b;O.push({value:-k,label:"-100%"}),j>=4&&O.push({value:-k/4*3,label:"-75%"}),j>=2&&O.push({value:-k/2,label:"-50%"}),j>=4&&O.push({value:-k/4,label:"-25%"})}if(O.push({value:0,label:"0%"}),b){let j=b>k?4:b*4/k;O.push({value:b/4,label:"25%"}),j>=4&&O.push({value:b/2,label:"50%"}),j>=2&&O.push({value:b/4*3,label:"75%"}),j>=4&&O.push({value:b,label:"100%"})}l(0,R={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:15,bottom:20,left:35},y:{min:-k,max:b,ticks:O},x:{ticks:T},points:A})}},[R,n,i,o,a,r,f,c,m,_,d,v,g,b,k,M,L]}class lo extends Nt{constructor(e){super(),Pt(this,e,$c,Jc,St,{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 Ns(t){var M;let e,l,n,i,o,a,r=(t[0].mt?ri(t[0].mt):"-")+"",f,c,m,_=t[12][0]+"",d,v,g=t[12][1]+"",b,k;return i=new Gu({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:((M=t[7].common)==null?void 0:M.import)??"Import",sub:Gn(t[0].p,t[0].pc),colorFn:Ji}}),{c(){e=p("div"),l=p("div"),n=p("div"),Ne(i.$$.fragment),o=h(),a=p("div"),f=S(r),c=h(),m=p("div"),d=S(_),v=h(),b=S(g),u(n,"class","col-span-2"),u(m,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(L,R){N(L,e,R),s(e,l),s(l,n),Me(i,n,null),s(l,o),s(l,a),s(a,f),s(l,c),s(l,m),s(m,d),s(m,v),s(m,b),k=!0},p(L,R){var T;const F={};R&1&&(F.val=L[0].i?L[0].i:0),R&1&&(F.max=L[0].im?L[0].im:15e3),R&128&&(F.label=((T=L[7].common)==null?void 0:T.import)??"Import"),R&1&&(F.sub=Gn(L[0].p,L[0].pc)),i.$set(F),(!k||R&1)&&r!==(r=(L[0].mt?ri(L[0].mt):"-")+"")&&E(f,r),(!k||R&4096)&&_!==(_=L[12][0]+"")&&E(d,_),(!k||R&4096)&&g!==(g=L[12][1]+"")&&E(b,g)},i(L){k||(X(i.$$.fragment,L),k=!0)},o(L){ee(i.$$.fragment,L),k=!1},d(L){L&&P(e),Pe(i)}}}function Ts(t){var b;let e,l,n,i,o,a,r,f,c=t[13][0]+"",m,_,d=t[13][1]+"",v,g;return i=new Gu({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:((b=t[7].common)==null?void 0:b.export)??"Export",sub:Gn(t[0].px,t[0].pc),colorFn:yn}}),{c(){e=p("div"),l=p("div"),n=p("div"),Ne(i.$$.fragment),o=h(),a=p("div"),r=h(),f=p("div"),m=S(c),_=h(),v=S(d),u(n,"class","col-span-2"),u(f,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(k,M){N(k,e,M),s(e,l),s(l,n),Me(i,n,null),s(l,o),s(l,a),s(l,r),s(l,f),s(f,m),s(f,_),s(f,v),g=!0},p(k,M){var R;const L={};M&1&&(L.val=k[0].e?k[0].e:0),M&1&&(L.max=k[0].om?k[0].om*1e3:1e4),M&128&&(L.label=((R=k[7].common)==null?void 0:R.export)??"Export"),M&1&&(L.sub=Gn(k[0].px,k[0].pc)),i.$set(L),(!g||M&8192)&&c!==(c=k[13][0]+"")&&E(m,c),(!g||M&8192)&&d!==(d=k[13][1]+"")&&E(v,d)},i(k){g||(X(i.$$.fragment,k),g=!0)},o(k){ee(i.$$.fragment,k),g=!1},d(k){k&&P(e),Pe(i)}}}function qs(t){let e,l,n=t[0].l1&&Es(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){N(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&X(n,1)):(n=Es(i),n.c(),X(n,1),n.m(e,null)):n&&(mt(),ee(n,1,1,()=>{n=null}),pt())},i(i){l||(X(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Es(t){var n;let e,l;return e=new bc({props:{title:((n=t[7].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,o){Me(e,i,o),l=!0},p(i,o){var r;const a={};o&128&&(a.title=((r=i[7].common)==null?void 0:r.voltage)??"Volt"),o&1&&(a.u1=i[0].l1.u),o&1&&(a.u2=i[0].l2.u),o&1&&(a.u3=i[0].l3.u),o&1&&(a.ds=i[0].ds),e.$set(a)},i(i){l||(X(e.$$.fragment,i),l=!0)},o(i){ee(e.$$.fragment,i),l=!1},d(i){Pe(e,i)}}}function Ds(t){let e,l,n=t[0].l1&&As(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){N(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&X(n,1)):(n=As(i),n.c(),X(n,1),n.m(e,null)):n&&(mt(),ee(n,1,1,()=>{n=null}),pt())},i(i){l||(X(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function As(t){var n;let e,l;return e=new lo({props:{title:((n=t[7].common)==null?void 0:n.amperage)??"Amp",unit:"A",importColorFn:Ji,exportColorFn:yn,maxImport:t[0].mf,l1:t[9],l2:t[10],l3:t[11],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,o){Me(e,i,o),l=!0},p(i,o){var r;const a={};o&128&&(a.title=((r=i[7].common)==null?void 0:r.amperage)??"Amp"),o&1&&(a.maxImport=i[0].mf),o&512&&(a.l1=i[9]),o&1024&&(a.l2=i[10]),o&2048&&(a.l3=i[11]),o&1&&(a.l2x=i[0].l2.e),o&1&&(a.l1i=Math.max(Math.abs(i[0].l1.i),0)),o&1&&(a.l2i=Math.max(Math.abs(i[0].l2.i),0)),o&1&&(a.l3i=Math.max(Math.abs(i[0].l3.i),0)),e.$set(a)},i(i){l||(X(e.$$.fragment,i),l=!0)},o(i){ee(e.$$.fragment,i),l=!1},d(i){Pe(e,i)}}}function Os(t){let e,l,n=t[0].l1&&Ls(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){N(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&X(n,1)):(n=Ls(i),n.c(),X(n,1),n.m(e,null)):n&&(mt(),ee(n,1,1,()=>{n=null}),pt())},i(i){l||(X(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Ls(t){var n;let e,l;return e=new lo({props:{title:((n=t[7].dashboard)==null?void 0:n.phase)??"Phase",unit:"W",importColorFn:Ji,exportColorFn:yn,maxImport:(t[0].mf?t[0].mf:32)*230,maxExport:t[0].om?t[14]?t[0].om*1e3/Math.sqrt(3):t[0].om*1e3:0,l1:t[9],l2:t[10],l3:t[11],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,o){Me(e,i,o),l=!0},p(i,o){var r;const a={};o&128&&(a.title=((r=i[7].dashboard)==null?void 0:r.phase)??"Phase"),o&1&&(a.maxImport=(i[0].mf?i[0].mf:32)*230),o&16385&&(a.maxExport=i[0].om?i[14]?i[0].om*1e3/Math.sqrt(3):i[0].om*1e3:0),o&512&&(a.l1=i[9]),o&1024&&(a.l2=i[10]),o&2048&&(a.l3=i[11]),o&1&&(a.l1i=i[0].l1.p),o&1&&(a.l2i=i[0].l2.p),o&1&&(a.l3i=i[0].l3.p),o&1&&(a.l1e=i[0].l1.q),o&1&&(a.l2e=i[0].l2.q),o&1&&(a.l3e=i[0].l3.q),e.$set(a)},i(i){l||(X(e.$$.fragment,i),l=!0)},o(i){ee(e.$$.fragment,i),l=!1},d(i){Pe(e,i)}}}function Is(t){let e,l,n=t[0].l1&&Rs(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){N(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&X(n,1)):(n=Rs(i),n.c(),X(n,1),n.m(e,null)):n&&(mt(),ee(n,1,1,()=>{n=null}),pt())},i(i){l||(X(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Rs(t){var n;let e,l;return e=new lo({props:{title:((n=t[7].dashboard)==null?void 0:n.pf)??"Pf",importColorFn:yn,exportColorFn:yn,maxImport:1,l1:t[9],l2:t[10],l3:t[11],l1i:t[0].l1.f,l2i:t[0].l2.f,l3i:t[0].l3.f}}),{c(){Ne(e.$$.fragment)},m(i,o){Me(e,i,o),l=!0},p(i,o){var r;const a={};o&128&&(a.title=((r=i[7].dashboard)==null?void 0:r.pf)??"Pf"),o&512&&(a.l1=i[9]),o&1024&&(a.l2=i[10]),o&2048&&(a.l3=i[11]),o&1&&(a.l1i=i[0].l1.f),o&1&&(a.l2i=i[0].l2.f),o&1&&(a.l3i=i[0].l3.f),e.$set(a)},i(i){l||(X(e.$$.fragment,i),l=!0)},o(i){ee(e.$$.fragment,i),l=!1},d(i){Pe(e,i)}}}function Fs(t){let e,l,n;return l=new wc({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec,translations:t[7]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt")},m(i,o){N(i,e,o),Me(l,e,null),n=!0},p(i,o){const a={};o&1&&(a.importInstant=i[0].ri),o&1&&(a.exportInstant=i[0].re),o&1&&(a.importTotal=i[0].ric),o&1&&(a.exportTotal=i[0].rec),o&128&&(a.translations=i[7]),l.$set(a)},i(i){n||(X(l.$$.fragment,i),n=!0)},o(i){ee(l.$$.fragment,i),n=!1},d(i){i&&P(e),Pe(l)}}}function Bs(t){let e,l,n;return l=new Nc({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0,translations:t[7]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt")},m(i,o){N(i,e,o),Me(l,e,null),n=!0},p(i,o){const a={};o&2&&(a.sysinfo=i[1]),o&1&&(a.data=i[0].ea),o&1&&(a.currency=i[0].pc),o&1&&(a.hasExport=i[0].om>0||i[0].e>0),o&128&&(a.translations=i[7]),l.$set(a)},i(i){n||(X(l.$$.fragment,i),n=!0)},o(i){ee(l.$$.fragment,i),n=!1},d(i){i&&P(e),Pe(l)}}}function Us(t){var i;let e,l,n;return l=new zc({props:{title:((i=t[7].dashboard)==null?void 0:i.tariffpeak)??"Tariff peaks",tariffData:t[8],translations:t[7]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt h-64")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.tariffpeak)??"Tariff peaks"),a&256&&(r.tariffData=o[8]),a&128&&(r.translations=o[7]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){ee(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function js(t){var i;let e,l,n;return l=new Zc({props:{title:((i=t[7].dashboard)==null?void 0:i.realtime)??"Real time"}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.realtime)??"Real time"),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){ee(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function Hs(t){let e,l,n,i;const o=[e0,xc],a=[];function r(f,c){var m;return(m=f[2])!=null&&m.importExportPriceDifferent&&(f[0].om||f[0].e>0)?0:1}return e=r(t),l=a[e]=o[e](t),{c(){l.c(),n=Wt()},m(f,c){a[e].m(f,c),N(f,n,c),i=!0},p(f,c){let m=e;e=r(f),e===m?a[e].p(f,c):(mt(),ee(a[m],1,1,()=>{a[m]=null}),pt(),l=a[e],l?l.p(f,c):(l=a[e]=o[e](f),l.c()),X(l,1),l.m(n.parentNode,n))},i(f){i||(X(l),i=!0)},o(f){ee(l),i=!1},d(f){f&&P(n),a[e].d(f)}}}function xc(t){var i;let e,l,n;return l=new xi({props:{title:((i=t[7].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(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.price)??"Price"),a&4&&(r.json=o[2]),a&2&&(r.sysinfo=o[1]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){ee(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function e0(t){var i;let e,l,n;return l=new xi({props:{title:((i=t[7].dashboard)==null?void 0:i.price_import)??"Price import",json:t[2],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.price_import)??"Price import"),a&4&&(r.json=o[2]),a&2&&(r.sysinfo=o[1]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){ee(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function zs(t){var i;let e,l,n;return l=new xi({props:{title:((i=t[7].dashboard)==null?void 0:i.price_export)??"Price export",json:t[3],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.price_export)??"Price export"),a&8&&(r.json=o[3]),a&2&&(r.sysinfo=o[1]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){ee(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function ys(t){var i;let e,l,n;return l=new Ac({props:{title:((i=t[7].dashboard)==null?void 0:i.day)??"24 hours",json:t[4],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.day)??"24 hours"),a&16&&(r.json=o[4]),a&2&&(r.sysinfo=o[1]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){ee(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function Ws(t){var i;let e,l,n;return l=new Ic({props:{title:((i=t[7].dashboard)==null?void 0:i.month)??"{0} days",json:t[5],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.month)??"{0} days"),a&32&&(r.json=o[5]),a&2&&(r.sysinfo=o[1]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){ee(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function Gs(t){var i;let e,l,n;return l=new Bc({props:{title:((i=t[7].dashboard)==null?void 0:i.temperature)??"Temperature",json:t[6]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.temperature)??"Temperature"),a&64&&(r.json=o[6]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){ee(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function t0(t){var we;let e,l=Qt(t[1].ui.i,t[0].i),n,i=Qt(t[1].ui.e,t[0].om||t[0].e>0),o,a=Qt(t[1].ui.v,t[0].l1&&(t[0].l1.u>100||t[0].l2.u>100||t[0].l3.u>100)),r,f=Qt(t[1].ui.a,t[0].l1&&(t[0].l1.i>.01||t[0].l2.i>.01||t[0].l3.i>.01)),c,m=Qt(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=Qt(t[1].ui.f,t[0].l1&&(t[0].l1.f>.01||t[0].l2.f>.01||t[0].l3.f>.01)),v,g=Qt(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),b,k=Qt(t[1].ui.c,t[0].ea),M,L=Qt(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("NO")||t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),R,F=Qt(t[1].ui.l,t[0].hm==1),T,A=Qt(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),O,j=Qt(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)&&((we=t[2])==null?void 0:we.importExportPriceDifferent)&&(t[0].om||t[0].e>0)),K,G=Qt(t[1].ui.d,t[4]),q,U=Qt(t[1].ui.m,t[5]),Z,V=Qt(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[6].c>1),Y,W=l&&Ns(t),B=i&&Ts(t),y=a&&qs(t),ne=f&&Ds(t),te=m&&Os(t),Q=d&&Is(t),se=g&&Fs(t),ue=k&&Bs(t),fe=L&&Us(t),le=F&&js(t),de=A&&Hs(t),ie=j&&zs(t),me=G&&ys(t),oe=U&&Ws(t),pe=V&&Gs(t);return{c(){e=p("div"),W&&W.c(),n=h(),B&&B.c(),o=h(),y&&y.c(),r=h(),ne&&ne.c(),c=h(),te&&te.c(),_=h(),Q&&Q.c(),v=h(),se&&se.c(),b=h(),ue&&ue.c(),M=h(),fe&&fe.c(),R=h(),le&&le.c(),T=h(),de&&de.c(),O=h(),ie&&ie.c(),K=h(),me&&me.c(),q=h(),oe&&oe.c(),Z=h(),pe&&pe.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(C,w){N(C,e,w),W&&W.m(e,null),s(e,n),B&&B.m(e,null),s(e,o),y&&y.m(e,null),s(e,r),ne&&ne.m(e,null),s(e,c),te&&te.m(e,null),s(e,_),Q&&Q.m(e,null),s(e,v),se&&se.m(e,null),s(e,b),ue&&ue.m(e,null),s(e,M),fe&&fe.m(e,null),s(e,R),le&&le.m(e,null),s(e,T),de&&de.m(e,null),s(e,O),ie&&ie.m(e,null),s(e,K),me&&me.m(e,null),s(e,q),oe&&oe.m(e,null),s(e,Z),pe&&pe.m(e,null),Y=!0},p(C,[w]){var I;w&3&&(l=Qt(C[1].ui.i,C[0].i)),l?W?(W.p(C,w),w&3&&X(W,1)):(W=Ns(C),W.c(),X(W,1),W.m(e,n)):W&&(mt(),ee(W,1,1,()=>{W=null}),pt()),w&3&&(i=Qt(C[1].ui.e,C[0].om||C[0].e>0)),i?B?(B.p(C,w),w&3&&X(B,1)):(B=Ts(C),B.c(),X(B,1),B.m(e,o)):B&&(mt(),ee(B,1,1,()=>{B=null}),pt()),w&3&&(a=Qt(C[1].ui.v,C[0].l1&&(C[0].l1.u>100||C[0].l2.u>100||C[0].l3.u>100))),a?y?(y.p(C,w),w&3&&X(y,1)):(y=qs(C),y.c(),X(y,1),y.m(e,r)):y&&(mt(),ee(y,1,1,()=>{y=null}),pt()),w&3&&(f=Qt(C[1].ui.a,C[0].l1&&(C[0].l1.i>.01||C[0].l2.i>.01||C[0].l3.i>.01))),f?ne?(ne.p(C,w),w&3&&X(ne,1)):(ne=Ds(C),ne.c(),X(ne,1),ne.m(e,c)):ne&&(mt(),ee(ne,1,1,()=>{ne=null}),pt()),w&3&&(m=Qt(C[1].ui.h,C[0].l1&&(C[0].l1.p>.01||C[0].l2.p>.01||C[0].l3.p>.01||C[0].l1.q>.01||C[0].l2.q>.01||C[0].l3.q>.01))),m?te?(te.p(C,w),w&3&&X(te,1)):(te=Os(C),te.c(),X(te,1),te.m(e,_)):te&&(mt(),ee(te,1,1,()=>{te=null}),pt()),w&3&&(d=Qt(C[1].ui.f,C[0].l1&&(C[0].l1.f>.01||C[0].l2.f>.01||C[0].l3.f>.01))),d?Q?(Q.p(C,w),w&3&&X(Q,1)):(Q=Is(C),Q.c(),X(Q,1),Q.m(e,v)):Q&&(mt(),ee(Q,1,1,()=>{Q=null}),pt()),w&3&&(g=Qt(C[1].ui.r,C[0].ri>0||C[0].re>0||C[0].ric>0||C[0].rec>0)),g?se?(se.p(C,w),w&3&&X(se,1)):(se=Fs(C),se.c(),X(se,1),se.m(e,b)):se&&(mt(),ee(se,1,1,()=>{se=null}),pt()),w&3&&(k=Qt(C[1].ui.c,C[0].ea)),k?ue?(ue.p(C,w),w&3&&X(ue,1)):(ue=Bs(C),ue.c(),X(ue,1),ue.m(e,M)):ue&&(mt(),ee(ue,1,1,()=>{ue=null}),pt()),w&3&&(L=Qt(C[1].ui.t,C[0].pr&&(C[0].pr.startsWith("NO")||C[0].pr.startsWith("10YNO")||C[0].pr.startsWith("10Y1001A1001A4")))),L?fe?(fe.p(C,w),w&3&&X(fe,1)):(fe=Us(C),fe.c(),X(fe,1),fe.m(e,R)):fe&&(mt(),ee(fe,1,1,()=>{fe=null}),pt()),w&3&&(F=Qt(C[1].ui.l,C[0].hm==1)),F?le?(le.p(C,w),w&3&&X(le,1)):(le=js(C),le.c(),X(le,1),le.m(e,T)):le&&(mt(),ee(le,1,1,()=>{le=null}),pt()),w&3&&(A=Qt(C[1].ui.p,C[0].pe&&!Number.isNaN(C[0].p))),A?de?(de.p(C,w),w&3&&X(de,1)):(de=Hs(C),de.c(),X(de,1),de.m(e,O)):de&&(mt(),ee(de,1,1,()=>{de=null}),pt()),w&7&&(j=Qt(C[1].ui.p,C[0].pe&&!Number.isNaN(C[0].p)&&((I=C[2])==null?void 0:I.importExportPriceDifferent)&&(C[0].om||C[0].e>0))),j?ie?(ie.p(C,w),w&7&&X(ie,1)):(ie=zs(C),ie.c(),X(ie,1),ie.m(e,K)):ie&&(mt(),ee(ie,1,1,()=>{ie=null}),pt()),w&18&&(G=Qt(C[1].ui.d,C[4])),G?me?(me.p(C,w),w&18&&X(me,1)):(me=ys(C),me.c(),X(me,1),me.m(e,q)):me&&(mt(),ee(me,1,1,()=>{me=null}),pt()),w&34&&(U=Qt(C[1].ui.m,C[5])),U?oe?(oe.p(C,w),w&34&&X(oe,1)):(oe=Ws(C),oe.c(),X(oe,1),oe.m(e,Z)):oe&&(mt(),ee(oe,1,1,()=>{oe=null}),pt()),w&67&&(V=Qt(C[1].ui.s,C[0].t&&C[0].t!=-127&&C[6].c>1)),V?pe?(pe.p(C,w),w&67&&X(pe,1)):(pe=Gs(C),pe.c(),X(pe,1),pe.m(e,null)):pe&&(mt(),ee(pe,1,1,()=>{pe=null}),pt())},i(C){Y||(X(W),X(B),X(y),X(ne),X(te),X(Q),X(se),X(ue),X(fe),X(le),X(de),X(ie),X(me),X(oe),X(pe),Y=!0)},o(C){ee(W),ee(B),ee(y),ee(ne),ee(te),ee(Q),ee(se),ee(ue),ee(fe),ee(le),ee(de),ee(ie),ee(me),ee(oe),ee(pe),Y=!1},d(C){C&&P(e),W&&W.d(),B&&B.d(),y&&y.d(),ne&&ne.d(),te&&te.d(),Q&&Q.d(),se&&se.d(),ue&&ue.d(),fe&&fe.d(),le&&le.d(),de&&de.d(),ie&&ie.d(),me&&me.d(),oe&&oe.d(),pe&&pe.d()}}}function l0(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,{importPrices:o={}}=e,{exportPrices:a={}}=e,{dayPlot:r={}}=e,{monthPlot:f={}}=e,{temperatures:c={}}=e,{translations:m={}}=e,{tariffData:_={}}=e,d,v,g,b,k,M;return t.$$set=L=>{"data"in L&&l(0,n=L.data),"sysinfo"in L&&l(1,i=L.sysinfo),"importPrices"in L&&l(2,o=L.importPrices),"exportPrices"in L&&l(3,a=L.exportPrices),"dayPlot"in L&&l(4,r=L.dayPlot),"monthPlot"in L&&l(5,f=L.monthPlot),"temperatures"in L&&l(6,c=L.temperatures),"translations"in L&&l(7,m=L.translations),"tariffData"in L&&l(8,_=L.tariffData)},t.$$.update=()=>{var L,R,F,T,A,O,j,K,G,q,U,Z,V,Y,W;t.$$.dirty&3585&&(l(12,d=rl((n==null?void 0:n.ic)*1e3,"Wh")),l(13,v=rl((n==null?void 0:n.ec)*1e3,"Wh")),((L=n==null?void 0:n.l1)==null?void 0:L.u)==0&&((R=n==null?void 0:n.l2)==null?void 0:R.u)==0&&((F=n==null?void 0:n.l3)==null?void 0:F.u)==0?l(9,b=l(10,k=l(11,M=l(14,g=!0)))):(l(9,b=((T=n==null?void 0:n.l1)==null?void 0:T.u)>0||((A=n==null?void 0:n.l1)==null?void 0:A.i)>0||((O=n==null?void 0:n.l1)==null?void 0:O.p)>0||((j=n==null?void 0:n.l1)==null?void 0:j.q)>0),l(10,k=((K=n==null?void 0:n.l2)==null?void 0:K.u)>0||((G=n==null?void 0:n.l2)==null?void 0:G.i)>0||((q=n==null?void 0:n.l2)==null?void 0:q.p)>0||((U=n==null?void 0:n.l2)==null?void 0:U.q)>0),l(11,M=((Z=n==null?void 0:n.l3)==null?void 0:Z.u)>0||((V=n==null?void 0:n.l3)==null?void 0:V.i)>0||((Y=n==null?void 0:n.l3)==null?void 0:Y.p)>0||((W=n==null?void 0:n.l3)==null?void 0:W.q)>0),l(14,g=b&&k&&M)))},[n,i,o,a,r,f,c,m,_,b,k,M,d,v,g]}class n0 extends Nt{constructor(e){super(),Pt(this,e,l0,t0,St,{data:0,sysinfo:1,importPrices:2,exportPrices:3,dayPlot:4,monthPlot:5,temperatures:6,translations:7,tariffData:8})}}let Bi={};const Bn=sl(Bi);async function i0(){Bi=await(await fetch("configuration.json")).json(),Bn.set(Bi)}let Ui={};const Ku=sl(Ui);async function o0(){Ui=await(await fetch("priceconfig.json")).json(),Ku.set(Ui)}function Vs(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Ks(t){let e,l,n;return{c(){e=p("option"),e.textContent="UART0",l=h(),n=p("option"),n.textContent="UART2",e.__value=3,H(e,e.__value),n.__value=113,H(n,n.__value)},m(i,o){N(i,e,o),N(i,l,o),N(i,n,o)},d(i){i&&(P(e),P(l),P(n))}}}function Ys(t){let e;return{c(){e=p("option"),e.textContent=`GPIO${t[4]}`,e.__value=t[4],H(e,e.__value)},m(l,n){N(l,e,n)},d(l){l&&P(e)}}}function Qs(t){let e,l=t[4]>1&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Ys(t);return{c(){l&&l.c(),e=Wt()},m(n,i){l&&l.m(n,i),N(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Ys(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){n&&P(e),l&&l.d(n)}}}function s0(t){let e,l,n,i,o=t[0]=="esp8266"&&Ks(),a=ft({length:t[1]+1}),r=[];for(let f=0;f{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=19);break}},[n,i]}class ji extends Nt{constructor(e){super(),Pt(this,e,a0,s0,St,{chip:0})}}function Xs(t){let e,l,n=t[1]&&Zs(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,o){N(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Zs(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&P(e),n&&n.d()}}}function Zs(t){let e,l;return{c(){e=p("div"),l=S(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){N(n,e,i),s(e,l)},p(n,i){i&2&&E(l,n[1])},d(n){n&&P(e)}}}function f0(t){let e,l=t[0]&&Xs(t);return{c(){l&&l.c(),e=Wt()},m(n,i){l&&l.m(n,i),N(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Xs(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:ze,o:ze,d(n){n&&P(e),l&&l.d(n)}}}function u0(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class cl extends Nt{constructor(e){super(),Pt(this,e,u0,f0,St,{active:0,message:1})}}function Js(t,e,l){const n=t.slice();return n[1]=e[l],n}function $s(t){let e,l,n=t[1]+"",i;return{c(){e=p("option"),l=S("Europe/"),i=S(n),e.__value="Europe/"+t[1],H(e,e.__value)},m(o,a){N(o,e,a),s(e,l),s(e,i)},p:ze,d(o){o&&P(e)}}}function r0(t){let e,l,n,i=ft(t[0]),o=[];for(let a=0;a>1&1,D=0;D0;w--)D[w]=D[w]?D[w-1]^T.EXPONENT[j._modN(T.LOG[D[w]]+C)]:D[w-1];D[0]=T.EXPONENT[j._modN(T.LOG[D[0]]+C)]}for(C=0;C<=I;C++)D[C]=T.LOG[D[C]]},_checkBadness:function(){var C,w,I,D,z,x=0,ae=this._badness,_e=this.buffer,he=this.width;for(z=0;zhe*he;)ke-=he*he,ve++;for(x+=ve*j.N4,D=0;D=ae-2&&(C=ae-2,z>9&&C--);var _e=C;if(z>9){for(x[_e+2]=0,x[_e+3]=0;_e--;)w=x[_e],x[_e+3]|=255&w<<4,x[_e+2]=w>>4;x[2]|=255&C<<4,x[1]=C>>4,x[0]=64|C>>12}else{for(x[_e+1]=0,x[_e+2]=0;_e--;)w=x[_e],x[_e+2]|=255&w<<4,x[_e+1]=w>>4;x[1]|=255&C<<4,x[0]=64|C>>4}for(_e=C+3-(z<10);_e=5&&(I+=j.N1+D[w]-5);for(w=3;wC||D[w-3]*3>=D[w]*4||D[w+3]*3>=D[w]*4)&&(I+=j.N3);return I},_finish:function(){this._stringBuffer=this.buffer.slice();var C,w,I=0,D=3e4;for(w=0;w<8&&(this._applyMask(w),C=this._checkBadness(),C>=1)D&1&&(z[x-1-w+x*8]=1,w<6?z[8+x*w]=1:z[8+x*(w+1)]=1);for(w=0;w<7;w++,D>>=1)D&1&&(z[8+x*(x-7+w)]=1,w?z[6-w+x*8]=1:z[7+x*8]=1)},_interleaveBlocks:function(){var C,w,I=this._dataBlock,D=this._ecc,z=this._eccBlock,x=0,ae=this._calculateMaxLength(),_e=this._neccBlock1,he=this._neccBlock2,J=this._stringBuffer;for(C=0;C1)for(C=M.BLOCK[D],I=z-7;;){for(w=z-7;w>C-3&&(this._addAlignment(w,I),!(w6)for(C=O.BLOCK[x-7],w=17,I=0;I<6;I++)for(D=0;D<3;D++,w--)1&(w>11?x>>w-12:C>>w)?(z[5-I+ae*(2-D+ae-11)]=1,z[2-D+ae-11+ae*(5-I)]=1):(this._setMask(5-I,2-D+ae-11),this._setMask(2-D+ae-11,5-I))},_isMasked:function(C,w){var I=j._getMaskBit(C,w);return this._mask[I]===1},_pack:function(){var C,w,I,D=1,z=1,x=this.width,ae=x-1,_e=x-1,he=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(w=0;ww&&(I=C,C=w,w=I),I=w,I+=w*w,I>>=1,I+=C,I},_modN:function(C){for(;C>=255;)C-=255,C=(C>>8)+(C&255);return C},N1:3,N2:3,N3:40,N4:10}),K=j,G=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var C=this.element;C.width=C.height=this.qrious.size}}),q=G,U=_.extend(function(C,w,I,D){this.name=C,this.modifiable=!!w,this.defaultValue=I,this._valueTransformer=D},{transform:function(C){var w=this._valueTransformer;return typeof w=="function"?w(C,this):C}}),Z=U,V=_.extend(null,{abs:function(C){return C!=null?Math.abs(C):null},hasOwn:function(C,w){return Object.prototype.hasOwnProperty.call(C,w)},noop:function(){},toUpperCase:function(C){return C!=null?C.toUpperCase():null}}),Y=V,W=_.extend(function(C){this.options={},C.forEach(function(w){this.options[w.name]=w},this)},{exists:function(C){return this.options[C]!=null},get:function(C,w){return W._get(this.options[C],w)},getAll:function(C){var w,I=this.options,D={};for(w in I)Y.hasOwn(I,w)&&(D[w]=W._get(I[w],C));return D},init:function(C,w,I){typeof I!="function"&&(I=Y.noop);var D,z;for(D in this.options)Y.hasOwn(this.options,D)&&(z=this.options[D],W._set(z,z.defaultValue,w),W._createAccessor(z,w,I));this._setAll(C,w,!0)},set:function(C,w,I){return this._set(C,w,I)},setAll:function(C,w){return this._setAll(C,w)},_set:function(C,w,I,D){var z=this.options[C];if(!z)throw new Error("Invalid option: "+C);if(!z.modifiable&&!D)throw new Error("Option cannot be modified: "+C);return W._set(z,w,I)},_setAll:function(C,w,I){if(!C)return!1;var D,z=!1;for(D in C)Y.hasOwn(C,D)&&this._set(D,C[D],w,I)&&(z=!0);return z}},{_createAccessor:function(C,w,I){var D={get:function(){return W._get(C,w)}};C.modifiable&&(D.set=function(z){W._set(C,z,w)&&I(z,C)}),Object.defineProperty(w,C.name,D)},_get:function(C,w){return w["_"+C.name]},_set:function(C,w,I){var D="_"+C.name,z=I[D],x=C.transform(w??C.defaultValue);return I[D]=x,x!==z}}),B=W,y=_.extend(function(){this._services={}},{getService:function(C){var w=this._services[C];if(!w)throw new Error("Service is not being managed with name: "+C);return w},setService:function(C,w){if(this._services[C])throw new Error("Service is already managed with name: "+C);w&&(this._services[C]=w)}}),ne=y,te=new B([new Z("background",!0,"white"),new Z("backgroundAlpha",!0,1,Y.abs),new Z("element"),new Z("foreground",!0,"black"),new Z("foregroundAlpha",!0,1,Y.abs),new Z("level",!0,"L",Y.toUpperCase),new Z("mime",!0,"image/png"),new Z("padding",!0,null,Y.abs),new Z("size",!0,100,Y.abs),new Z("value",!0,"")]),Q=new ne,se=_.extend(function(C){te.init(C,this,this.update.bind(this));var w=te.get("element",this),I=Q.getService("element"),D=w&&I.isCanvas(w)?w:I.createCanvas(),z=w&&I.isImage(w)?w:I.createImage();this._canvasRenderer=new b(this,D,!0),this._imageRenderer=new q(this,z,z===w),this.update()},{get:function(){return te.getAll(this)},set:function(C){te.setAll(C,this)&&this.update()},toDataURL:function(C){return this.canvas.toDataURL(C||this.mime)},update:function(){var C=new K({level:this.level,value:this.value});this._canvasRenderer.render(C),this._imageRenderer.render(C)}},{use:function(C){Q.setService(C.getName(),C)}});Object.defineProperties(se.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var ue=se,fe=ue,le=_.extend({getName:function(){}}),de=le,ie=de.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(C){},isImage:function(C){}}),me=ie,oe=me.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(C){return C instanceof HTMLCanvasElement},isImage:function(C){return C instanceof HTMLImageElement}}),pe=oe;fe.use(new pe);var we=fe;return we})})(Qu);var h0=Qu.exports;const v0=d0(h0);function b0(t){let e,l;return{c(){e=p("img"),oi(e.src,l=t[2])||u(e,"src",l),u(e,"alt",t[0]),u(e,"class",t[1])},m(n,i){N(n,e,i)},p(n,[i]){i&4&&!oi(e.src,l=n[2])&&u(e,"src",l),i&1&&u(e,"alt",n[0]),i&2&&u(e,"class",n[1])},i:ze,o:ze,d(n){n&&P(e)}}}function g0(t,e,l){let{errorCorrection:n="L"}=e,{background:i="#fff"}=e,{color:o="#000"}=e,{size:a="200"}=e,{value:r=""}=e,{padding:f=0}=e,{className:c="qrcode"}=e,m="",_;function d(){_.set({background:i,foreground:o,level:n,padding:f,size:a,value:r}),l(2,m=_.toDataURL("image/jpeg"))}function v(){return m}return lu(()=>{l(9,_=new v0),r&&d()}),t.$$set=g=>{"errorCorrection"in g&&l(3,n=g.errorCorrection),"background"in g&&l(4,i=g.background),"color"in g&&l(5,o=g.color),"size"in g&&l(6,a=g.size),"value"in g&&l(0,r=g.value),"padding"in g&&l(7,f=g.padding),"className"in g&&l(1,c=g.className)},t.$$.update=()=>{t.$$.dirty&513&&r&&_&&d()},[r,c,m,n,i,o,a,f,v,_]}class k0 extends Nt{constructor(e){super(),Pt(this,e,g0,b0,St,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1,getImage:8})}get getImage(){return this.$$.ctx[8]}}function xs(t,e,l){const n=t.slice();return n[122]=e[l],n}function ea(t,e,l){const n=t.slice();return n[125]=e[l],n[126]=e,n[127]=l,n}function ta(t,e,l){const n=t.slice();return n[128]=e[l],n[129]=e,n[130]=l,n}function la(t,e,l){const n=t.slice();return n[131]=e[l],n}function w0(t,e,l){const n=t.slice();return n[134]=e[l],n}function C0(t,e,l){const n=t.slice();return n[137]=e[l],n}function S0(t,e,l){const n=t.slice();return n[140]=e[l],n}function na(t){var Ke,Se,$,Oe,ul,tl,pl,dl,wl,Cl,Sl,Ml,Pl,Il,Rl,Fl,We,kt,Bl,Ul,jl,Hl,zl,yl,Wl,Gl,Vl,Kl;let e,l,n=(((Se=(Ke=t[2].conf)==null?void 0:Ke.general)==null?void 0:Se.title)??"General")+"",i,o,a,r,f,c,m,_,d,v=(((Oe=($=t[2].conf)==null?void 0:$.general)==null?void 0:Oe.hostname)??"Hostname")+"",g,b,k,M,L,R,F=(((tl=(ul=t[2].conf)==null?void 0:ul.general)==null?void 0:tl.timezone)??"Time zone")+"",T,A,O,j,K,G,q,U,Z,V,Y,W=(((dl=(pl=t[2].conf)==null?void 0:pl.price)==null?void 0:dl.region)??"Price region")+"",B,y,ne,te,Q,se,ue,fe,le,de,ie,me,oe,pe,we,C,w,I,D,z,x,ae,_e,he,J,ve,ke,De,Te,Ae,Le,Ee,Ie,Je,wt=(((Cl=(wl=t[2].conf)==null?void 0:wl.price)==null?void 0:Cl.resolution)??"Resolution")+"",et,ut,Ct,ht,rt,it,vt=(((Ml=(Sl=t[2].conf)==null?void 0:Sl.price)==null?void 0:Ml.currency)??"Currency")+"",Ot,$e,Re,Be,tt,ge,qe,Ge,ce,Ce,xe,ye,Lt=(((Il=(Pl=t[2].conf)==null?void 0:Pl.price)==null?void 0:Il.enabled)??"Enabled")+"",gt,Ye,Mt,ot,_t=(((We=(Fl=(Rl=t[2].conf)==null?void 0:Rl.general)==null?void 0:Fl.security)==null?void 0:We.title)??"Security")+"",lt,Bt,Xt,ct,at,Gt=(((Ul=(Bl=(kt=t[2].conf)==null?void 0:kt.general)==null?void 0:Bl.security)==null?void 0:Ul.none)??"None")+"",Jt,Tt,Yt=(((zl=(Hl=(jl=t[2].conf)==null?void 0:jl.general)==null?void 0:Hl.security)==null?void 0:zl.conf)??"Conf")+"",xt,$t,Vt=(((Gl=(Wl=(yl=t[2].conf)==null?void 0:yl.general)==null?void 0:Wl.security)==null?void 0:Gl.all)??"All")+"",It,Ve,Qe,Xe,qt=(((Kl=(Vl=t[2].conf)==null?void 0:Vl.general)==null?void 0:Kl.context)??"Context")+"",Ut,dt,st,bt,Rt,be,nt,je;K=new _0({});let yt=!t[6].p.t&&ia(),al=ft([15,60]),nl=[];for(let Ue=0;Ue<2;Ue+=1)nl[Ue]=M0(S0(t,al,Ue));let fl=ft(["NOK","SEK","DKK","EUR","CHF"]),il=[];for(let Ue=0;Ue<5;Ue+=1)il[Ue]=P0(C0(t,fl,Ue));qe=new hl({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[N0]},$$scope:{ctx:t}}});let jt=t[6].p.e&&t[0].chip!="esp8266"&&oa(t),Ht=t[6].g.s>0&&sa(t);return{c(){var Ue,Et;e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),_=p("div"),d=p("div"),g=S(v),b=p("br"),k=h(),M=p("input"),L=h(),R=p("div"),T=S(F),A=p("br"),O=h(),j=p("select"),Ne(K.$$.fragment),G=h(),q=p("input"),U=h(),Z=p("div"),V=p("div"),Y=p("div"),B=S(W),y=p("br"),ne=h(),te=p("select"),Q=p("optgroup"),yt&&yt.c(),se=p("option"),se.textContent="NO1",ue=p("option"),ue.textContent="NO2",fe=p("option"),fe.textContent="NO3",le=p("option"),le.textContent="NO4",de=p("option"),de.textContent="NO5",ie=p("optgroup"),me=p("option"),me.textContent="SE1",oe=p("option"),oe.textContent="SE2",pe=p("option"),pe.textContent="SE3",we=p("option"),we.textContent="SE4",C=p("optgroup"),w=p("option"),w.textContent="DK1",I=p("option"),I.textContent="DK2",D=p("option"),D.textContent="Austria",z=p("option"),z.textContent="Belgium",x=p("option"),x.textContent="Czech Republic",ae=p("option"),ae.textContent="Estonia",_e=p("option"),_e.textContent="Finland",he=p("option"),he.textContent="France",J=p("option"),J.textContent="Germany",ve=p("option"),ve.textContent="Great Britain",ke=p("option"),ke.textContent="Latvia",De=p("option"),De.textContent="Lithuania",Te=p("option"),Te.textContent="Netherland",Ae=p("option"),Ae.textContent="Poland",Le=p("option"),Le.textContent="Slovenia",Ee=p("option"),Ee.textContent="Switzerland",Ie=h(),Je=p("div"),et=S(wt),ut=p("br"),Ct=h(),ht=p("select");for(let ll=0;ll<2;ll+=1)nl[ll].c();rt=h(),it=p("div"),Ot=S(vt),$e=p("br"),Re=h(),Be=p("select");for(let ll=0;ll<5;ll+=1)il[ll].c();tt=h(),ge=p("div"),Ne(qe.$$.fragment),Ge=h(),ce=p("div"),Ce=p("label"),xe=p("input"),ye=h(),gt=S(Lt),Ye=h(),jt&&jt.c(),Mt=h(),ot=p("div"),lt=S(_t),Bt=p("br"),Xt=h(),ct=p("select"),at=p("option"),Jt=S(Gt),Tt=p("option"),xt=S(Yt),$t=p("option"),It=S(Vt),Ve=h(),Ht&&Ht.c(),Qe=h(),Xe=p("div"),Ut=S(qt),dt=p("br"),st=h(),bt=p("input"),u(l,"class","text-sm"),u(a,"href",ml("General-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","g"),f.value="true",u(M,"name","gh"),u(M,"type","text"),u(M,"class","in-f w-full"),u(M,"pattern",Vn),u(j,"name","gt"),u(j,"class","in-l w-full"),t[6].g.t===void 0&&At(()=>t[25].call(j)),u(_,"class","flex"),u(m,"class","my-1"),u(q,"type","hidden"),u(q,"name","p"),q.value="true",se.__value="10YNO-1--------2",H(se,se.__value),ue.__value="10YNO-2--------T",H(ue,ue.__value),fe.__value="10YNO-3--------J",H(fe,fe.__value),le.__value="10YNO-4--------9",H(le,le.__value),de.__value="10Y1001A1001A48H",H(de,de.__value),u(Q,"label","Norway"),me.__value="10Y1001A1001A44P",H(me,me.__value),oe.__value="10Y1001A1001A45N",H(oe,oe.__value),pe.__value="10Y1001A1001A46L",H(pe,pe.__value),we.__value="10Y1001A1001A47J",H(we,we.__value),u(ie,"label","Sweden"),w.__value="10YDK-1--------W",H(w,w.__value),I.__value="10YDK-2--------M",H(I,I.__value),u(C,"label","Denmark"),D.__value="10YAT-APG------L",H(D,D.__value),z.__value="10YBE----------2",H(z,z.__value),x.__value="10YCZ-CEPS-----N",H(x,x.__value),ae.__value="10Y1001A1001A39I",H(ae,ae.__value),_e.__value="10YFI-1--------U",H(_e,_e.__value),he.__value="10YFR-RTE------C",H(he,he.__value),J.__value="10Y1001A1001A83F",H(J,J.__value),ve.__value="10YGB----------A",H(ve,ve.__value),ke.__value="10YLV-1001A00074",H(ke,ke.__value),De.__value="10YLT-1001A0008Q",H(De,De.__value),Te.__value="10YNL----------L",H(Te,Te.__value),Ae.__value="10YPL-AREA-----S",H(Ae,Ae.__value),Le.__value="10YSI-ELES-----O",H(Le,Le.__value),Ee.__value="10YCH-SWISSGRIDZ",H(Ee,Ee.__value),u(te,"name","pr"),u(te,"class","in-f w-full"),t[6].p.r===void 0&&At(()=>t[26].call(te)),u(Y,"class","w-full"),u(ht,"name","pm"),u(ht,"class","in-m"),t[6].p.m===void 0&&At(()=>t[27].call(ht)),u(Be,"name","pc"),u(Be,"class","in-l"),t[6].p.c===void 0&&At(()=>t[28].call(Be)),u(V,"class","flex"),u(Z,"class","my-1"),u(ge,"class","my-1"),u(xe,"type","checkbox"),u(xe,"name","pe"),xe.__value="true",H(xe,xe.__value),u(xe,"class","rounded mb-1"),u(ce,"class","my-1"),at.__value=0,H(at,at.__value),Tt.__value=1,H(Tt,Tt.__value),$t.__value=2,H($t,$t.__value),u(ct,"name","gs"),u(ct,"class","in-s"),t[6].g.s===void 0&&At(()=>t[31].call(ct)),u(ot,"class","my-1"),u(bt,"name","gc"),u(bt,"type","text"),u(bt,"pattern",Vn),u(bt,"placeholder",Rt=((Et=(Ue=t[2].conf)==null?void 0:Ue.general)==null?void 0:Et.context_placeholder)??"/"),u(bt,"class","in-s"),u(bt,"maxlength","36"),u(Xe,"class","my-1"),u(e,"class","cnt")},m(Ue,Et){N(Ue,e,Et),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,_),s(_,d),s(d,g),s(d,b),s(d,k),s(d,M),H(M,t[6].g.h),s(_,L),s(_,R),s(R,T),s(R,A),s(R,O),s(R,j),Me(K,j,null),He(j,t[6].g.t,!0),s(e,G),s(e,q),s(e,U),s(e,Z),s(Z,V),s(V,Y),s(Y,B),s(Y,y),s(Y,ne),s(Y,te),s(te,Q),yt&&yt.m(Q,null),s(Q,se),s(Q,ue),s(Q,fe),s(Q,le),s(Q,de),s(te,ie),s(ie,me),s(ie,oe),s(ie,pe),s(ie,we),s(te,C),s(C,w),s(C,I),s(te,D),s(te,z),s(te,x),s(te,ae),s(te,_e),s(te,he),s(te,J),s(te,ve),s(te,ke),s(te,De),s(te,Te),s(te,Ae),s(te,Le),s(te,Ee),He(te,t[6].p.r,!0),s(V,Ie),s(V,Je),s(Je,et),s(Je,ut),s(Je,Ct),s(Je,ht);for(let ll=0;ll<2;ll+=1)nl[ll]&&nl[ll].m(ht,null);He(ht,t[6].p.m,!0),s(V,rt),s(V,it),s(it,Ot),s(it,$e),s(it,Re),s(it,Be);for(let ll=0;ll<5;ll+=1)il[ll]&&il[ll].m(Be,null);He(Be,t[6].p.c,!0),s(e,tt),s(e,ge),Me(qe,ge,null),s(e,Ge),s(e,ce),s(ce,Ce),s(Ce,xe),xe.checked=t[6].p.e,s(Ce,ye),s(Ce,gt),s(ce,Ye),jt&&jt.m(ce,null),s(e,Mt),s(e,ot),s(ot,lt),s(ot,Bt),s(ot,Xt),s(ot,ct),s(ct,at),s(at,Jt),s(ct,Tt),s(Tt,xt),s(ct,$t),s($t,It),He(ct,t[6].g.s,!0),s(e,Ve),Ht&&Ht.m(e,null),s(e,Qe),s(e,Xe),s(Xe,Ut),s(Xe,dt),s(Xe,st),s(Xe,bt),H(bt,t[6].g.c),be=!0,nt||(je=[re(M,"input",t[24]),re(j,"change",t[25]),re(te,"change",t[26]),re(ht,"change",t[27]),re(Be,"change",t[28]),re(xe,"change",t[29]),re(ct,"change",t[31]),re(bt,"input",t[34])],nt=!0)},p(Ue,Et){var Yl,Ql,Xl,Zl,Jl,$l,xl,en,Nn,Tn,qn,En,Dn,An,On,Ln,In,io,oo,so,ao,fo,uo,ro,co,_o,mo,po,ho,vo;(!be||Et[0]&4)&&n!==(n=(((Ql=(Yl=Ue[2].conf)==null?void 0:Yl.general)==null?void 0:Ql.title)??"General")+"")&&E(i,n),(!be||Et[0]&4)&&v!==(v=(((Zl=(Xl=Ue[2].conf)==null?void 0:Xl.general)==null?void 0:Zl.hostname)??"Hostname")+"")&&E(g,v),Et[0]&64&&M.value!==Ue[6].g.h&&H(M,Ue[6].g.h),(!be||Et[0]&4)&&F!==(F=((($l=(Jl=Ue[2].conf)==null?void 0:Jl.general)==null?void 0:$l.timezone)??"Time zone")+"")&&E(T,F),Et[0]&64&&He(j,Ue[6].g.t),(!be||Et[0]&4)&&W!==(W=(((en=(xl=Ue[2].conf)==null?void 0:xl.price)==null?void 0:en.region)??"Price region")+"")&&E(B,W),Ue[6].p.t?yt&&(yt.d(1),yt=null):yt||(yt=ia(),yt.c(),yt.m(Q,se)),Et[0]&64&&He(te,Ue[6].p.r),(!be||Et[0]&4)&&wt!==(wt=(((Tn=(Nn=Ue[2].conf)==null?void 0:Nn.price)==null?void 0:Tn.resolution)??"Resolution")+"")&&E(et,wt),Et[0]&64&&He(ht,Ue[6].p.m),(!be||Et[0]&4)&&vt!==(vt=(((En=(qn=Ue[2].conf)==null?void 0:qn.price)==null?void 0:En.currency)??"Currency")+"")&&E(Ot,vt),Et[0]&64&&He(Be,Ue[6].p.c);const ll={};Et[0]&4|Et[4]&524288&&(ll.$$scope={dirty:Et,ctx:Ue}),qe.$set(ll),Et[0]&64&&(xe.checked=Ue[6].p.e),(!be||Et[0]&4)&&Lt!==(Lt=(((An=(Dn=Ue[2].conf)==null?void 0:Dn.price)==null?void 0:An.enabled)??"Enabled")+"")&&E(gt,Lt),Ue[6].p.e&&Ue[0].chip!="esp8266"?jt?jt.p(Ue,Et):(jt=oa(Ue),jt.c(),jt.m(ce,null)):jt&&(jt.d(1),jt=null),(!be||Et[0]&4)&&_t!==(_t=(((In=(Ln=(On=Ue[2].conf)==null?void 0:On.general)==null?void 0:Ln.security)==null?void 0:In.title)??"Security")+"")&&E(lt,_t),(!be||Et[0]&4)&&Gt!==(Gt=(((so=(oo=(io=Ue[2].conf)==null?void 0:io.general)==null?void 0:oo.security)==null?void 0:so.none)??"None")+"")&&E(Jt,Gt),(!be||Et[0]&4)&&Yt!==(Yt=(((uo=(fo=(ao=Ue[2].conf)==null?void 0:ao.general)==null?void 0:fo.security)==null?void 0:uo.conf)??"Conf")+"")&&E(xt,Yt),(!be||Et[0]&4)&&Vt!==(Vt=(((_o=(co=(ro=Ue[2].conf)==null?void 0:ro.general)==null?void 0:co.security)==null?void 0:_o.all)??"All")+"")&&E(It,Vt),Et[0]&64&&He(ct,Ue[6].g.s),Ue[6].g.s>0?Ht?Ht.p(Ue,Et):(Ht=sa(Ue),Ht.c(),Ht.m(e,Qe)):Ht&&(Ht.d(1),Ht=null),(!be||Et[0]&4)&&qt!==(qt=(((po=(mo=Ue[2].conf)==null?void 0:mo.general)==null?void 0:po.context)??"Context")+"")&&E(Ut,qt),(!be||Et[0]&4&&Rt!==(Rt=((vo=(ho=Ue[2].conf)==null?void 0:ho.general)==null?void 0:vo.context_placeholder)??"/"))&&u(bt,"placeholder",Rt),Et[0]&64&&bt.value!==Ue[6].g.c&&H(bt,Ue[6].g.c)},i(Ue){be||(X(K.$$.fragment,Ue),X(qe.$$.fragment,Ue),be=!0)},o(Ue){ee(K.$$.fragment,Ue),ee(qe.$$.fragment,Ue),be=!1},d(Ue){Ue&&P(e),Pe(K),yt&&yt.d(),el(nl,Ue),el(il,Ue),Pe(qe),jt&&jt.d(),Ht&&Ht.d(),nt=!1,zt(je)}}}function ia(t){let e,l,n,i,o;return{c(){e=p("option"),e.textContent="NO1 w/support",l=p("option"),l.textContent="NO2 w/support",n=p("option"),n.textContent="NO3 w/support",i=p("option"),i.textContent="NO4 w/support",o=p("option"),o.textContent="NO5 w/support",e.__value="NO1S",H(e,e.__value),l.__value="NO2S",H(l,l.__value),n.__value="NO3S",H(n,n.__value),i.__value="NO4S",H(i,i.__value),o.__value="NO5S",H(o,o.__value)},m(a,r){N(a,e,r),N(a,l,r),N(a,n,r),N(a,i,r),N(a,o,r)},d(a){a&&(P(e),P(l),P(n),P(i),P(o))}}}function M0(t){let e;return{c(){e=p("option"),e.textContent=`${t[140]}M`,e.__value=t[140],H(e,e.__value)},m(l,n){N(l,e,n)},p:ze,d(l){l&&P(e)}}}function P0(t){let e;return{c(){e=p("option"),e.textContent=`${t[137]}`,e.__value=t[137],H(e,e.__value)},m(l,n){N(l,e,n)},p:ze,d(l){l&&P(e)}}}function N0(t){var n,i;let e=(((i=(n=t[2].conf)==null?void 0:n.price)==null?void 0:i.conf)??"Configure")+"",l;return{c(){l=S(e)},m(o,a){N(o,l,a)},p(o,a){var r,f;a[0]&4&&e!==(e=(((f=(r=o[2].conf)==null?void 0:r.price)==null?void 0:f.conf)??"Configure")+"")&&E(l,e)},d(o){o&&P(l)}}}function oa(t){let e,l,n,i,o;return{c(){var a,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=(a=t[2].conf)==null?void 0:a.price)==null?void 0:r.api_key_placeholder)??""),u(l,"pattern",Vn)},m(a,r){N(a,e,r),N(a,l,r),H(l,t[6].p.t),i||(o=re(l,"input",t[30]),i=!0)},p(a,r){var f,c;r[0]&4&&n!==(n=((c=(f=a[2].conf)==null?void 0:f.price)==null?void 0:c.api_key_placeholder)??"")&&u(l,"placeholder",n),r[0]&64&&l.value!==a[6].p.t&&H(l,a[6].p.t)},d(a){a&&(P(e),P(l)),i=!1,o()}}}function sa(t){var k,M,L,R,F,T;let e,l=(((L=(M=(k=t[2].conf)==null?void 0:k.general)==null?void 0:M.security)==null?void 0:L.username)??"Username")+"",n,i,o,a,r,f,c=(((T=(F=(R=t[2].conf)==null?void 0:R.general)==null?void 0:F.security)==null?void 0:T.password)??"Password")+"",m,_,d,v,g,b;return{c(){e=p("div"),n=S(l),i=p("br"),o=h(),a=p("input"),r=h(),f=p("div"),m=S(c),_=p("br"),d=h(),v=p("input"),u(a,"name","gu"),u(a,"type","text"),u(a,"class","in-s"),u(a,"maxlength","36"),u(a,"pattern",Ll),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",Ll),u(f,"class","my-1")},m(A,O){N(A,e,O),s(e,n),s(e,i),s(e,o),s(e,a),H(a,t[6].g.u),N(A,r,O),N(A,f,O),s(f,m),s(f,_),s(f,d),s(f,v),H(v,t[6].g.p),g||(b=[re(a,"input",t[32]),re(v,"input",t[33])],g=!0)},p(A,O){var j,K,G,q,U,Z;O[0]&4&&l!==(l=(((G=(K=(j=A[2].conf)==null?void 0:j.general)==null?void 0:K.security)==null?void 0:G.username)??"Username")+"")&&E(n,l),O[0]&64&&a.value!==A[6].g.u&&H(a,A[6].g.u),O[0]&4&&c!==(c=(((Z=(U=(q=A[2].conf)==null?void 0:q.general)==null?void 0:U.security)==null?void 0:Z.password)??"Password")+"")&&E(m,c),O[0]&64&&v.value!==A[6].g.p&&H(v,A[6].g.p)},d(A){A&&(P(e),P(r),P(f)),g=!1,zt(b)}}}function aa(t){var ce,Ce,xe,ye,Lt,gt,Ye,Mt,ot,_t,lt,Bt,Xt,ct,at,Gt,Jt,Tt,Yt,xt,$t,Vt,It;let e,l,n=(((Ce=(ce=t[2].conf)==null?void 0:ce.meter)==null?void 0:Ce.title)??"Meter")+"",i,o,a,r,f,c,m,_,d,v=(((Lt=(ye=(xe=t[2].conf)==null?void 0:xe.meter)==null?void 0:ye.comm)==null?void 0:Lt.title)??"Communication")+"",g,b,k,M,L,R=(((Mt=(Ye=(gt=t[2].conf)==null?void 0:gt.meter)==null?void 0:Ye.comm)==null?void 0:Mt.passive)??"Passive")+"",F,T,A=(((lt=(_t=(ot=t[2].conf)==null?void 0:ot.meter)==null?void 0:_t.comm)==null?void 0:lt.pulse)??"Pulse")+"",O,j=(Xt=(Bt=t[0])==null?void 0:Bt.features)==null?void 0:Xt.includes("kmp"),K,G,q,U=(((ct=t[2].common)==null?void 0:ct.voltage)??"Voltage")+"",Z,V,Y,W,B,y,ne,te,Q,se=(((Gt=(at=t[2].conf)==null?void 0:at.meter)==null?void 0:Gt.fuse)??"Main fuse")+"",ue,fe,le,de,ie,me,oe,pe,we,C=(((Tt=(Jt=t[2].conf)==null?void 0:Jt.meter)==null?void 0:Tt.prod)??"Production")+"",w,I,D,z,x,ae,_e,he,J,ve,ke,De,Te,Ae,Le=(((xt=(Yt=t[2].conf)==null?void 0:Yt.meter)==null?void 0:xt.encrypted)??"Encrypted")+"",Ee,Ie,Je,wt,et,ut,Ct,ht=(((It=(Vt=($t=t[2].conf)==null?void 0:$t.meter)==null?void 0:Vt.multipliers)==null?void 0:It.title)??"Multipliers")+"",rt,it,vt,Ot,$e=j&&fa();function Re(Ve,Qe){return Ve[6].m.a===2?q0:T0}let Be=Re(t),tt=Be(t),ge=t[6].m.e.e&&ua(t),qe=t[6].m.e.e&&ra(t),Ge=t[6].m.m.e&&ca(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("input"),_=h(),d=p("div"),g=S(v),b=p("br"),k=h(),M=p("select"),L=p("option"),F=S(R),T=p("option"),O=S(A),$e&&$e.c(),K=h(),tt.c(),G=h(),q=p("div"),Z=S(U),V=p("br"),Y=h(),W=p("select"),B=p("option"),B.textContent="400V (TN)",y=p("option"),y.textContent="230V (IT/TT)",ne=h(),te=p("div"),Q=p("div"),ue=S(se),fe=p("br"),le=h(),de=p("label"),ie=p("input"),me=h(),oe=p("span"),oe.textContent="A",pe=h(),we=p("div"),w=S(C),I=p("br"),D=h(),z=p("label"),x=p("input"),ae=h(),_e=p("span"),_e.textContent="kWp",he=h(),J=p("div"),J.innerHTML="",ve=h(),ke=p("div"),De=p("label"),Te=p("input"),Ae=h(),Ee=S(Le),Ie=h(),ge&&ge.c(),Je=h(),qe&&qe.c(),wt=h(),et=p("label"),ut=p("input"),Ct=h(),rt=S(ht),it=h(),Ge&&Ge.c(),u(l,"class","text-sm"),u(a,"href",ml("Meter-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","m"),f.value="true",u(m,"type","hidden"),u(m,"name","mo"),m.value="1",L.__value=0,H(L,L.__value),T.__value=2,H(T,T.__value),u(M,"name","ma"),u(M,"class","in-s"),t[6].m.a===void 0&&At(()=>t[35].call(M)),u(d,"class","my-1"),B.__value=2,H(B,B.__value),y.__value=1,H(y,y.__value),u(W,"name","md"),u(W,"class","in-s"),t[6].m.d===void 0&&At(()=>t[41].call(W)),u(q,"class","my-1"),u(ie,"name","mf"),u(ie,"type","number"),u(ie,"min","5"),u(ie,"max","65535"),u(ie,"class","in-f tr w-full"),u(oe,"class","in-post"),u(de,"class","flex"),u(Q,"class","mx-1"),u(x,"name","mr"),u(x,"type","number"),u(x,"min","0"),u(x,"max","65535"),u(x,"class","in-f tr w-full"),u(_e,"class","in-post"),u(z,"class","flex"),u(we,"class","mx-1"),u(te,"class","my-1 flex"),u(J,"class","my-1"),u(Te,"type","checkbox"),u(Te,"name","me"),Te.__value="true",H(Te,Te.__value),u(Te,"class","rounded mb-1"),u(ke,"class","my-1"),u(ut,"type","checkbox"),u(ut,"name","mm"),ut.__value="true",H(ut,ut.__value),u(ut,"class","rounded mb-1"),u(e,"class","cnt")},m(Ve,Qe){N(Ve,e,Qe),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(e,_),s(e,d),s(d,g),s(d,b),s(d,k),s(d,M),s(M,L),s(L,F),s(M,T),s(T,O),$e&&$e.m(M,null),He(M,t[6].m.a,!0),s(e,K),tt.m(e,null),s(e,G),s(e,q),s(q,Z),s(q,V),s(q,Y),s(q,W),s(W,B),s(W,y),He(W,t[6].m.d,!0),s(e,ne),s(e,te),s(te,Q),s(Q,ue),s(Q,fe),s(Q,le),s(Q,de),s(de,ie),H(ie,t[6].m.f),s(de,me),s(de,oe),s(te,pe),s(te,we),s(we,w),s(we,I),s(we,D),s(we,z),s(z,x),H(x,t[6].m.r),s(z,ae),s(z,_e),s(e,he),s(e,J),s(e,ve),s(e,ke),s(ke,De),s(De,Te),Te.checked=t[6].m.e.e,s(De,Ae),s(De,Ee),s(ke,Ie),ge&&ge.m(ke,null),s(e,Je),qe&&qe.m(e,null),s(e,wt),s(e,et),s(et,ut),ut.checked=t[6].m.m.e,s(et,Ct),s(et,rt),s(e,it),Ge&&Ge.m(e,null),vt||(Ot=[re(M,"change",t[35]),re(W,"change",t[41]),re(ie,"input",t[42]),re(x,"input",t[43]),re(Te,"change",t[44]),re(ut,"change",t[47])],vt=!0)},p(Ve,Qe){var Xe,qt,Ut,dt,st,bt,Rt,be,nt,je,yt,al,nl,fl,il,jt,Ht,Ke,Se,$,Oe,ul,tl;Qe[0]&4&&n!==(n=(((qt=(Xe=Ve[2].conf)==null?void 0:Xe.meter)==null?void 0:qt.title)??"Meter")+"")&&E(i,n),Qe[0]&4&&v!==(v=(((st=(dt=(Ut=Ve[2].conf)==null?void 0:Ut.meter)==null?void 0:dt.comm)==null?void 0:st.title)??"Communication")+"")&&E(g,v),Qe[0]&4&&R!==(R=(((be=(Rt=(bt=Ve[2].conf)==null?void 0:bt.meter)==null?void 0:Rt.comm)==null?void 0:be.passive)??"Passive")+"")&&E(F,R),Qe[0]&4&&A!==(A=(((yt=(je=(nt=Ve[2].conf)==null?void 0:nt.meter)==null?void 0:je.comm)==null?void 0:yt.pulse)??"Pulse")+"")&&E(O,A),Qe[0]&1&&(j=(nl=(al=Ve[0])==null?void 0:al.features)==null?void 0:nl.includes("kmp")),j?$e||($e=fa(),$e.c(),$e.m(M,null)):$e&&($e.d(1),$e=null),Qe[0]&64&&He(M,Ve[6].m.a),Be===(Be=Re(Ve))&&tt?tt.p(Ve,Qe):(tt.d(1),tt=Be(Ve),tt&&(tt.c(),tt.m(e,G))),Qe[0]&4&&U!==(U=(((fl=Ve[2].common)==null?void 0:fl.voltage)??"Voltage")+"")&&E(Z,U),Qe[0]&64&&He(W,Ve[6].m.d),Qe[0]&4&&se!==(se=(((jt=(il=Ve[2].conf)==null?void 0:il.meter)==null?void 0:jt.fuse)??"Main fuse")+"")&&E(ue,se),Qe[0]&64&&Fe(ie.value)!==Ve[6].m.f&&H(ie,Ve[6].m.f),Qe[0]&4&&C!==(C=(((Ke=(Ht=Ve[2].conf)==null?void 0:Ht.meter)==null?void 0:Ke.prod)??"Production")+"")&&E(w,C),Qe[0]&64&&Fe(x.value)!==Ve[6].m.r&&H(x,Ve[6].m.r),Qe[0]&64&&(Te.checked=Ve[6].m.e.e),Qe[0]&4&&Le!==(Le=((($=(Se=Ve[2].conf)==null?void 0:Se.meter)==null?void 0:$.encrypted)??"Encrypted")+"")&&E(Ee,Le),Ve[6].m.e.e?ge?ge.p(Ve,Qe):(ge=ua(Ve),ge.c(),ge.m(ke,null)):ge&&(ge.d(1),ge=null),Ve[6].m.e.e?qe?qe.p(Ve,Qe):(qe=ra(Ve),qe.c(),qe.m(e,wt)):qe&&(qe.d(1),qe=null),Qe[0]&64&&(ut.checked=Ve[6].m.m.e),Qe[0]&4&&ht!==(ht=(((tl=(ul=(Oe=Ve[2].conf)==null?void 0:Oe.meter)==null?void 0:ul.multipliers)==null?void 0:tl.title)??"Multipliers")+"")&&E(rt,ht),Ve[6].m.m.e?Ge?Ge.p(Ve,Qe):(Ge=ca(Ve),Ge.c(),Ge.m(e,null)):Ge&&(Ge.d(1),Ge=null)},d(Ve){Ve&&P(e),$e&&$e.d(),tt.d(),ge&&ge.d(),qe&&qe.d(),Ge&&Ge.d(),vt=!1,zt(Ot)}}}function fa(t){let e;return{c(){e=p("option"),e.textContent="KMP",e.__value=9,H(e,e.__value)},m(l,n){N(l,e,n)},d(l){l&&P(e)}}}function T0(t){var ue,fe,le,de,ie,me;let e,l,n=(((fe=(ue=t[2].conf)==null?void 0:ue.meter)==null?void 0:fe.buffer)??"Buffer size")+"",i,o,a,r=(((de=(le=t[2].conf)==null?void 0:le.meter)==null?void 0:de.serial)??"Serial conf.")+"",f,c,m,_,d,v=(((me=(ie=t[2].conf)==null?void 0:ie.meter)==null?void 0:me.inverted)??"inverted")+"",g,b,k,M,L,R,F,T,A,O,j,K,G,q,U,Z,V,Y,W,B,y,ne,te,Q=ft([3,12,24,48,96,192,384,576,1152]),se=[];for(let oe=0;oe<9;oe+=1)se[oe]=E0(w0(t,Q,oe));return{c(){e=p("div"),l=p("span"),i=S(n),o=h(),a=p("span"),f=S(r),c=h(),m=p("label"),_=p("input"),d=h(),g=S(v),b=h(),k=p("div"),M=p("select"),L=p("option"),R=S("Autodetect");for(let oe=0;oe<9;oe+=1)se[oe].c();T=h(),A=p("select"),O=p("option"),j=S("-"),G=p("option"),G.textContent="7N1",q=p("option"),q.textContent="8N1",U=p("option"),U.textContent="8N2",Z=p("option"),Z.textContent="7E1",V=p("option"),V.textContent="8E1",W=h(),B=p("input"),u(l,"class","float-right"),u(_,"name","mi"),_.__value="true",H(_,_.__value),u(_,"type","checkbox"),u(_,"class","rounded mb-1"),u(m,"class","mt-2 ml-3 whitespace-nowrap"),L.__value=0,H(L,L.__value),L.disabled=F=t[6].m.b!=0,u(M,"name","mb"),u(M,"class","in-f tr w-1/2"),t[6].m.b===void 0&&At(()=>t[38].call(M)),O.__value=0,H(O,O.__value),O.disabled=K=t[6].m.b!=0,G.__value=2,H(G,G.__value),q.__value=3,H(q,q.__value),U.__value=7,H(U,U.__value),Z.__value=10,H(Z,Z.__value),V.__value=11,H(V,V.__value),u(A,"name","mp"),u(A,"class","in-m"),A.disabled=Y=t[6].m.b==0,t[6].m.p===void 0&&At(()=>t[39].call(A)),u(B,"name","ms"),u(B,"type","number"),u(B,"min",64),u(B,"max",y=t[0].chip=="esp8266"?t[6].i.h.p==3||t[6].i.h.p==113?512:256:4096),u(B,"step",64),u(B,"class","in-l tr w-1/2"),u(k,"class","flex w-full"),u(e,"class","my-1")},m(oe,pe){N(oe,e,pe),s(e,l),s(l,i),s(e,o),s(e,a),s(a,f),s(e,c),s(e,m),s(m,_),_.checked=t[6].m.i,s(m,d),s(m,g),s(e,b),s(e,k),s(k,M),s(M,L),s(L,R);for(let we=0;we<9;we+=1)se[we]&&se[we].m(M,null);He(M,t[6].m.b,!0),s(k,T),s(k,A),s(A,O),s(O,j),s(A,G),s(A,q),s(A,U),s(A,Z),s(A,V),He(A,t[6].m.p,!0),s(k,W),s(k,B),H(B,t[6].m.s),ne||(te=[re(_,"change",t[37]),re(M,"change",t[38]),re(A,"change",t[39]),re(B,"input",t[40])],ne=!0)},p(oe,pe){var we,C,w,I,D,z;pe[0]&4&&n!==(n=(((C=(we=oe[2].conf)==null?void 0:we.meter)==null?void 0:C.buffer)??"Buffer size")+"")&&E(i,n),pe[0]&4&&r!==(r=(((I=(w=oe[2].conf)==null?void 0:w.meter)==null?void 0:I.serial)??"Serial conf.")+"")&&E(f,r),pe[0]&64&&(_.checked=oe[6].m.i),pe[0]&4&&v!==(v=(((z=(D=oe[2].conf)==null?void 0:D.meter)==null?void 0:z.inverted)??"inverted")+"")&&E(g,v),pe[0]&64&&F!==(F=oe[6].m.b!=0)&&(L.disabled=F),pe[0]&64&&He(M,oe[6].m.b),pe[0]&64&&K!==(K=oe[6].m.b!=0)&&(O.disabled=K),pe[0]&64&&Y!==(Y=oe[6].m.b==0)&&(A.disabled=Y),pe[0]&64&&He(A,oe[6].m.p),pe[0]&65&&y!==(y=oe[0].chip=="esp8266"?oe[6].i.h.p==3||oe[6].i.h.p==113?512:256:4096)&&u(B,"max",y),pe[0]&64&&Fe(B.value)!==oe[6].m.s&&H(B,oe[6].m.s)},d(oe){oe&&P(e),el(se,oe),ne=!1,zt(te)}}}function q0(t){var c,m;let e,l,n=(((m=(c=t[2].conf)==null?void 0:c.meter)==null?void 0:m.pulses)??"Pulses per kWh")+"",i,o,a,r,f;return{c(){e=p("div"),l=p("span"),i=S(n),o=h(),a=p("input"),u(a,"name","mb"),u(a,"class","in-s tr"),u(a,"type","number"),u(a,"min",1),u(a,"max",3600),u(e,"class","my-1")},m(_,d){N(_,e,d),s(e,l),s(l,i),s(e,o),s(e,a),H(a,t[6].m.b),r||(f=re(a,"input",t[36]),r=!0)},p(_,d){var v,g;d[0]&4&&n!==(n=(((g=(v=_[2].conf)==null?void 0:v.meter)==null?void 0:g.pulses)??"Pulses per kWh")+"")&&E(i,n),d[0]&64&&Fe(a.value)!==_[6].m.b&&H(a,_[6].m.b)},d(_){_&&P(e),r=!1,f()}}}function E0(t){let e;return{c(){e=p("option"),e.textContent=`${t[134]*100}`,e.__value=t[134]*100,H(e,e.__value)},m(l,n){N(l,e,n)},p:ze,d(l){l&&P(e)}}}function ua(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",Au)},m(o,a){N(o,e,a),N(o,l,a),H(l,t[6].m.e.k),n||(i=re(l,"input",t[45]),n=!0)},p(o,a){a[0]&64&&l.value!==o[6].m.e.k&&H(l,o[6].m.e.k)},d(o){o&&(P(e),P(l)),n=!1,i()}}}function ra(t){var c,m;let e,l=(((m=(c=t[2].conf)==null?void 0:c.meter)==null?void 0:m.authkey)??"Authentication key")+"",n,i,o,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),o=h(),a=p("input"),u(a,"name","mea"),u(a,"type","text"),u(a,"class","in-s"),u(a,"pattern",Au),u(e,"class","my-1")},m(_,d){N(_,e,d),s(e,n),s(e,i),s(e,o),s(e,a),H(a,t[6].m.e.a),r||(f=re(a,"input",t[46]),r=!0)},p(_,d){var v,g;d[0]&4&&l!==(l=(((g=(v=_[2].conf)==null?void 0:v.meter)==null?void 0:g.authkey)??"Authentication key")+"")&&E(n,l),d[0]&64&&a.value!==_[6].m.e.a&&H(a,_[6].m.e.a)},d(_){_&&P(e),r=!1,f()}}}function ca(t){var Y,W,B,y,ne,te,Q,se,ue,fe,le,de;let e,l,n=(((B=(W=(Y=t[2].conf)==null?void 0:Y.meter)==null?void 0:W.multipliers)==null?void 0:B.watt)??"Watt")+"",i,o,a,r,f,c,m=(((te=(ne=(y=t[2].conf)==null?void 0:y.meter)==null?void 0:ne.multipliers)==null?void 0:te.volt)??"Volt")+"",_,d,v,g,b,k,M=(((ue=(se=(Q=t[2].conf)==null?void 0:Q.meter)==null?void 0:se.multipliers)==null?void 0:ue.amp)??"Amp")+"",L,R,F,T,A,O,j=(((de=(le=(fe=t[2].conf)==null?void 0:fe.meter)==null?void 0:le.multipliers)==null?void 0:de.kwh)??"kWh")+"",K,G,q,U,Z,V;return{c(){e=p("div"),l=p("div"),i=S(n),o=p("br"),a=h(),r=p("input"),f=h(),c=p("div"),_=S(m),d=p("br"),v=h(),g=p("input"),b=h(),k=p("div"),L=S(M),R=p("br"),F=h(),T=p("input"),A=h(),O=p("div"),K=S(j),G=p("br"),q=h(),U=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(g,"name","mmv"),u(g,"type","number"),u(g,"min","0.00"),u(g,"max","1000"),u(g,"step","0.001"),u(g,"class","in-m tr w-full"),u(c,"class","w-1/4"),u(T,"name","mma"),u(T,"type","number"),u(T,"min","0.00"),u(T,"max","1000"),u(T,"step","0.001"),u(T,"class","in-m tr w-full"),u(k,"class","w-1/4"),u(U,"name","mmc"),u(U,"type","number"),u(U,"min","0.00"),u(U,"max","1000"),u(U,"step","0.001"),u(U,"class","in-l tr w-full"),u(O,"class","w-1/4"),u(e,"class","flex my-1")},m(ie,me){N(ie,e,me),s(e,l),s(l,i),s(l,o),s(l,a),s(l,r),H(r,t[6].m.m.w),s(e,f),s(e,c),s(c,_),s(c,d),s(c,v),s(c,g),H(g,t[6].m.m.v),s(e,b),s(e,k),s(k,L),s(k,R),s(k,F),s(k,T),H(T,t[6].m.m.a),s(e,A),s(e,O),s(O,K),s(O,G),s(O,q),s(O,U),H(U,t[6].m.m.c),Z||(V=[re(r,"input",t[48]),re(g,"input",t[49]),re(T,"input",t[50]),re(U,"input",t[51])],Z=!0)},p(ie,me){var oe,pe,we,C,w,I,D,z,x,ae,_e,he;me[0]&4&&n!==(n=(((we=(pe=(oe=ie[2].conf)==null?void 0:oe.meter)==null?void 0:pe.multipliers)==null?void 0:we.watt)??"Watt")+"")&&E(i,n),me[0]&64&&Fe(r.value)!==ie[6].m.m.w&&H(r,ie[6].m.m.w),me[0]&4&&m!==(m=(((I=(w=(C=ie[2].conf)==null?void 0:C.meter)==null?void 0:w.multipliers)==null?void 0:I.volt)??"Volt")+"")&&E(_,m),me[0]&64&&Fe(g.value)!==ie[6].m.m.v&&H(g,ie[6].m.m.v),me[0]&4&&M!==(M=(((x=(z=(D=ie[2].conf)==null?void 0:D.meter)==null?void 0:z.multipliers)==null?void 0:x.amp)??"Amp")+"")&&E(L,M),me[0]&64&&Fe(T.value)!==ie[6].m.m.a&&H(T,ie[6].m.m.a),me[0]&4&&j!==(j=(((he=(_e=(ae=ie[2].conf)==null?void 0:ae.meter)==null?void 0:_e.multipliers)==null?void 0:he.kwh)??"kWh")+"")&&E(K,j),me[0]&64&&Fe(U.value)!==ie[6].m.m.c&&H(U,ie[6].m.m.c)},d(ie){ie&&P(e),Z=!1,zt(V)}}}function _a(t){var O,j,K,G,q,U;let e,l,n=(((j=(O=t[2].conf)==null?void 0:O.connection)==null?void 0:j.title)??"Connection")+"",i,o,a,r,f,c,m,_,d,v=(((G=(K=t[2].conf)==null?void 0:K.connection)==null?void 0:G.wifi)??"WiFi")+"",g,b,k=(((U=(q=t[2].conf)==null?void 0:q.connection)==null?void 0:U.ap)??"AP")+"",M,L,R,F,T=t[0].if&&t[0].if.eth&&ma(t),A=(t[6].n.c==1||t[6].n.c==2)&&pa(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),_=p("select"),d=p("option"),g=S(v),b=p("option"),M=S(k),T&&T.c(),L=h(),A&&A.c(),u(l,"class","text-sm"),u(a,"href",ml("Network-connection")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","w"),f.value="true",d.__value=1,H(d,d.__value),b.__value=2,H(b,b.__value),u(_,"name","nc"),u(_,"class","in-s"),t[6].n.c===void 0&&At(()=>t[52].call(_)),u(m,"class","my-1"),u(e,"class","cnt")},m(Z,V){N(Z,e,V),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,_),s(_,d),s(d,g),s(_,b),s(b,M),T&&T.m(_,null),He(_,t[6].n.c,!0),s(e,L),A&&A.m(e,null),R||(F=re(_,"change",t[52]),R=!0)},p(Z,V){var Y,W,B,y,ne,te;V[0]&4&&n!==(n=(((W=(Y=Z[2].conf)==null?void 0:Y.connection)==null?void 0:W.title)??"Connection")+"")&&E(i,n),V[0]&4&&v!==(v=(((y=(B=Z[2].conf)==null?void 0:B.connection)==null?void 0:y.wifi)??"WiFi")+"")&&E(g,v),V[0]&4&&k!==(k=(((te=(ne=Z[2].conf)==null?void 0:ne.connection)==null?void 0:te.ap)??"AP")+"")&&E(M,k),Z[0].if&&Z[0].if.eth?T?T.p(Z,V):(T=ma(Z),T.c(),T.m(_,null)):T&&(T.d(1),T=null),V[0]&64&&He(_,Z[6].n.c),Z[6].n.c==1||Z[6].n.c==2?A?A.p(Z,V):(A=pa(Z),A.c(),A.m(e,null)):A&&(A.d(1),A=null)},d(Z){Z&&P(e),T&&T.d(),A&&A.d(),R=!1,F()}}}function ma(t){var i,o;let e,l=(((o=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:o.eth)??"Ethernet")+"",n;return{c(){e=p("option"),n=S(l),e.__value=3,H(e,e.__value)},m(a,r){N(a,e,r),s(e,n)},p(a,r){var f,c;r[0]&4&&l!==(l=(((c=(f=a[2].conf)==null?void 0:f.connection)==null?void 0:c.eth)??"Ethernet")+"")&&E(n,l)},d(a){a&&P(e)}}}function pa(t){var De,Te,Ae,Le,Ee,Ie,Je,wt,et,ut,Ct,ht,rt,it,vt,Ot,$e,Re,Be,tt,ge,qe,Ge;let e,l=(((Te=(De=t[2].conf)==null?void 0:De.connection)==null?void 0:Te.ssid)??"SSID")+"",n,i,o,a,r,f,c,m,_,d,v=(((Le=(Ae=t[2].conf)==null?void 0:Ae.connection)==null?void 0:Le.psk)??"Password")+"",g,b,k,M,L,R,F,T=(((Je=(Ie=(Ee=t[2].conf)==null?void 0:Ee.connection)==null?void 0:Ie.ps)==null?void 0:Je.title)??"Power saving")+"",A,O,j,K,G,q=(((ut=(et=(wt=t[2].conf)==null?void 0:wt.connection)==null?void 0:et.ps)==null?void 0:ut.default)??"Default")+"",U,Z,V=(((rt=(ht=(Ct=t[2].conf)==null?void 0:Ct.connection)==null?void 0:ht.ps)==null?void 0:rt.off)??"Off")+"",Y,W,B=(((Ot=(vt=(it=t[2].conf)==null?void 0:it.connection)==null?void 0:vt.ps)==null?void 0:Ot.min)??"Min")+"",y,ne,te=(((Be=(Re=($e=t[2].conf)==null?void 0:$e.connection)==null?void 0:Re.ps)==null?void 0:Be.max)??"Max")+"",Q,se,ue,fe=(((ge=(tt=t[2].conf)==null?void 0:tt.connection)==null?void 0:ge.pwr)??"Power")+"",le,de,ie,me,oe,pe,we,C,w,I,D,z,x=(((Ge=(qe=t[2].conf)==null?void 0:qe.connection)==null?void 0:Ge.tick_11b)??"802.11b")+"",ae,_e,he;function J(ce,Ce){return ce[8]?A0:D0}let ve=J(t),ke=ve(t);return{c(){e=p("div"),n=S(l),i=h(),o=p("label"),a=p("input"),r=S(" manual"),f=h(),c=p("br"),m=h(),ke.c(),_=h(),d=p("div"),g=S(v),b=p("br"),k=h(),M=p("input"),L=h(),R=p("div"),F=p("div"),A=S(T),O=p("br"),j=h(),K=p("select"),G=p("option"),U=S(q),Z=p("option"),Y=S(V),W=p("option"),y=S(B),ne=p("option"),Q=S(te),se=h(),ue=p("div"),le=S(fe),de=p("br"),ie=h(),me=p("div"),oe=p("input"),pe=h(),we=p("span"),we.textContent="dBm",C=h(),w=p("div"),I=p("label"),D=p("input"),z=h(),ae=S(x),u(a,"type","checkbox"),a.__value="true",H(a,a.__value),u(a,"class","rounded mb-1"),u(o,"class","float-right mr-3"),u(e,"class","my-1"),u(M,"name","wp"),u(M,"type","password"),u(M,"class","in-s"),u(M,"pattern",Pn),u(d,"class","my-1"),G.__value=255,H(G,G.__value),Z.__value=0,H(Z,Z.__value),W.__value=1,H(W,W.__value),ne.__value=2,H(ne,ne.__value),u(K,"name","wz"),u(K,"class","in-s"),t[6].w.z===void 0&&At(()=>t[57].call(K)),u(F,"class","w-1/2"),u(oe,"name","ww"),u(oe,"type","number"),u(oe,"min","0"),u(oe,"max","20.5"),u(oe,"step","0.5"),u(oe,"class","in-f tr w-full"),u(we,"class","in-post"),u(me,"class","flex"),u(ue,"class","ml-2 w-1/2"),u(R,"class","my-1 flex"),u(D,"type","checkbox"),u(D,"name","wb"),D.__value="true",H(D,D.__value),u(D,"class","rounded mb-1"),u(w,"class","my-3")},m(ce,Ce){N(ce,e,Ce),s(e,n),s(e,i),s(e,o),s(o,a),a.checked=t[8],s(o,r),s(e,f),s(e,c),s(e,m),ke.m(e,null),N(ce,_,Ce),N(ce,d,Ce),s(d,g),s(d,b),s(d,k),s(d,M),H(M,t[6].w.p),N(ce,L,Ce),N(ce,R,Ce),s(R,F),s(F,A),s(F,O),s(F,j),s(F,K),s(K,G),s(G,U),s(K,Z),s(Z,Y),s(K,W),s(W,y),s(K,ne),s(ne,Q),He(K,t[6].w.z,!0),s(R,se),s(R,ue),s(ue,le),s(ue,de),s(ue,ie),s(ue,me),s(me,oe),H(oe,t[6].w.w),s(me,pe),s(me,we),N(ce,C,Ce),N(ce,w,Ce),s(w,I),s(I,D),D.checked=t[6].w.b,s(I,z),s(I,ae),_e||(he=[re(a,"change",t[53]),re(M,"input",t[56]),re(K,"change",t[57]),re(oe,"input",t[58]),re(D,"change",t[59])],_e=!0)},p(ce,Ce){var xe,ye,Lt,gt,Ye,Mt,ot,_t,lt,Bt,Xt,ct,at,Gt,Jt,Tt,Yt,xt,$t,Vt,It,Ve,Qe;Ce[0]&4&&l!==(l=(((ye=(xe=ce[2].conf)==null?void 0:xe.connection)==null?void 0:ye.ssid)??"SSID")+"")&&E(n,l),Ce[0]&256&&(a.checked=ce[8]),ve===(ve=J(ce))&&ke?ke.p(ce,Ce):(ke.d(1),ke=ve(ce),ke&&(ke.c(),ke.m(e,null))),Ce[0]&4&&v!==(v=(((gt=(Lt=ce[2].conf)==null?void 0:Lt.connection)==null?void 0:gt.psk)??"Password")+"")&&E(g,v),Ce[0]&64&&M.value!==ce[6].w.p&&H(M,ce[6].w.p),Ce[0]&4&&T!==(T=(((ot=(Mt=(Ye=ce[2].conf)==null?void 0:Ye.connection)==null?void 0:Mt.ps)==null?void 0:ot.title)??"Power saving")+"")&&E(A,T),Ce[0]&4&&q!==(q=(((Bt=(lt=(_t=ce[2].conf)==null?void 0:_t.connection)==null?void 0:lt.ps)==null?void 0:Bt.default)??"Default")+"")&&E(U,q),Ce[0]&4&&V!==(V=(((at=(ct=(Xt=ce[2].conf)==null?void 0:Xt.connection)==null?void 0:ct.ps)==null?void 0:at.off)??"Off")+"")&&E(Y,V),Ce[0]&4&&B!==(B=(((Tt=(Jt=(Gt=ce[2].conf)==null?void 0:Gt.connection)==null?void 0:Jt.ps)==null?void 0:Tt.min)??"Min")+"")&&E(y,B),Ce[0]&4&&te!==(te=((($t=(xt=(Yt=ce[2].conf)==null?void 0:Yt.connection)==null?void 0:xt.ps)==null?void 0:$t.max)??"Max")+"")&&E(Q,te),Ce[0]&64&&He(K,ce[6].w.z),Ce[0]&4&&fe!==(fe=(((It=(Vt=ce[2].conf)==null?void 0:Vt.connection)==null?void 0:It.pwr)??"Power")+"")&&E(le,fe),Ce[0]&64&&Fe(oe.value)!==ce[6].w.w&&H(oe,ce[6].w.w),Ce[0]&64&&(D.checked=ce[6].w.b),Ce[0]&4&&x!==(x=(((Qe=(Ve=ce[2].conf)==null?void 0:Ve.connection)==null?void 0:Qe.tick_11b)??"802.11b")+"")&&E(ae,x)},d(ce){ce&&(P(e),P(_),P(d),P(L),P(R),P(C),P(w)),ke.d(),_e=!1,zt(he)}}}function D0(t){var f,c;let e,l,n,i,o,a=((f=t[9])==null?void 0:f.c)==-1&&da(),r=((c=t[9])==null?void 0:c.n)&&ha(t);return{c(){e=p("select"),a&&a.c(),l=Wt(),r&&r.c(),u(e,"name","ws"),u(e,"class","in-s"),e.required=n=t[6].n.c==1||t[6].n.c==2,t[6].w.s===void 0&&At(()=>t[55].call(e))},m(m,_){N(m,e,_),a&&a.m(e,null),s(e,l),r&&r.m(e,null),He(e,t[6].w.s,!0),i||(o=re(e,"change",t[55]),i=!0)},p(m,_){var d,v;((d=m[9])==null?void 0:d.c)==-1?a||(a=da(),a.c(),a.m(e,l)):a&&(a.d(1),a=null),(v=m[9])!=null&&v.n?r?r.p(m,_):(r=ha(m),r.c(),r.m(e,null)):r&&(r.d(1),r=null),_[0]&64&&n!==(n=m[6].n.c==1||m[6].n.c==2)&&(e.required=n),_[0]&64&&He(e,m[6].w.s)},d(m){m&&P(e),a&&a.d(),r&&r.d(),i=!1,o()}}}function A0(t){let e,l,n,i;return{c(){e=p("input"),u(e,"name","ws"),u(e,"type","text"),u(e,"class","in-s"),u(e,"pattern",Pn),e.required=l=t[6].n.c==1||t[6].n.c==2},m(o,a){N(o,e,a),H(e,t[6].w.s),n||(i=re(e,"input",t[54]),n=!0)},p(o,a){a[0]&64&&l!==(l=o[6].n.c==1||o[6].n.c==2)&&(e.required=l),a[0]&64&&e.value!==o[6].w.s&&H(e,o[6].w.s)},d(o){o&&P(e),n=!1,i()}}}function da(t){let e;return{c(){e=p("option"),e.textContent="Scanning...",e.__value="",H(e,e.__value),e.selected=!0,e.disabled=!0},m(l,n){N(l,e,n)},d(l){l&&P(e)}}}function ha(t){var i;let e,l=ft((i=t[9])==null?void 0:i.n),n=[];for(let o=0;ot[60].call(g)),u(A,"name","ni"),u(A,"type","text"),u(A,"class","in-m w-full"),A.disabled=O=t[6].n.m=="dhcp",A.required=j=t[6].n.m=="static",u(A,"pattern",cn),u(G,"name","ns"),u(G,"class","in-l"),G.disabled=U=t[6].n.m=="dhcp",G.required=Z=t[6].n.m=="static",t[6].n.s===void 0&&At(()=>t[62].call(G)),u(v,"class","flex"),u(f,"class","my-1"),u(y,"name","nx"),y.__value="true",H(y,y.__value),u(y,"type","checkbox"),u(y,"class","rounded mb-1"),u(W,"class","my-1"),u(ue,"name","nd"),ue.__value="true",H(ue,ue.__value),u(ue,"type","checkbox"),u(ue,"class","rounded mb-1"),u(Q,"class","my-1"),u(me,"type","hidden"),u(me,"name","ntp"),me.value="true",u(D,"name","ntpd"),D.__value="true",H(D,D.__value),u(D,"type","checkbox"),u(D,"class","rounded mb-1"),u(I,"class","ml-4"),u(ve,"name","ntph"),u(ve,"type","text"),u(ve,"class","in-s"),u(ve,"pattern",Ll),u(J,"class","flex"),u(pe,"class","my-1"),u(e,"class","cnt")},m(Re,Be){N(Re,e,Be),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(f,m),s(f,_),s(f,d),s(f,v),s(v,g),s(g,b),s(b,M),s(g,L),s(L,F),He(g,t[6].n.m,!0),s(v,T),s(v,A),H(A,t[6].n.i),s(v,K),s(v,G),Me(q,G,null),He(G,t[6].n.s,!0),s(e,V),Ae&&Ae.m(e,null),s(e,Y),s(e,W),s(W,B),s(B,y),y.checked=t[6].n.x,s(B,ne),s(e,te),s(e,Q),s(Q,se),s(se,ue),ue.checked=t[6].n.d,s(se,fe),s(se,de),s(e,ie),s(e,me),s(e,oe),s(e,pe),s(pe,C),s(pe,w),s(pe,I),s(I,D),D.checked=t[6].n.h,s(I,z),s(I,ae),s(pe,_e),s(pe,he),s(pe,J),s(J,ve),H(ve,t[6].n.n1),ke=!0,De||(Te=[re(g,"change",t[60]),re(A,"input",t[61]),re(G,"change",t[62]),re(y,"change",t[66]),re(ue,"change",t[67]),re(D,"change",t[68]),re(ve,"input",t[69])],De=!0)},p(Re,Be){var tt,ge,qe,Ge,ce,Ce,xe,ye,Lt,gt,Ye,Mt,ot,_t;(!ke||Be[0]&4)&&n!==(n=(((ge=(tt=Re[2].conf)==null?void 0:tt.network)==null?void 0:ge.title)??"Network")+"")&&E(i,n),(!ke||Be[0]&4)&&c!==(c=(((Ge=(qe=Re[2].conf)==null?void 0:qe.network)==null?void 0:Ge.ip)??"IP")+"")&&E(m,c),(!ke||Be[0]&4)&&k!==(k=(((Ce=(ce=Re[2].conf)==null?void 0:ce.network)==null?void 0:Ce.dhcp)??"DHCP")+"")&&E(M,k),(!ke||Be[0]&4)&&R!==(R=(((ye=(xe=Re[2].conf)==null?void 0:xe.network)==null?void 0:ye.static)??"Static")+"")&&E(F,R),Be[0]&64&&He(g,Re[6].n.m),(!ke||Be[0]&64&&O!==(O=Re[6].n.m=="dhcp"))&&(A.disabled=O),(!ke||Be[0]&64&&j!==(j=Re[6].n.m=="static"))&&(A.required=j),Be[0]&64&&A.value!==Re[6].n.i&&H(A,Re[6].n.i),(!ke||Be[0]&64&&U!==(U=Re[6].n.m=="dhcp"))&&(G.disabled=U),(!ke||Be[0]&64&&Z!==(Z=Re[6].n.m=="static"))&&(G.required=Z),Be[0]&64&&He(G,Re[6].n.s),Re[6].n.m=="static"?Ae?Ae.p(Re,Be):(Ae=ga(Re),Ae.c(),Ae.m(e,Y)):Ae&&(Ae.d(1),Ae=null),Be[0]&64&&(y.checked=Re[6].n.x),Be[0]&64&&(ue.checked=Re[6].n.d),(!ke||Be[0]&4)&&le!==(le=(((gt=(Lt=Re[2].conf)==null?void 0:Lt.network)==null?void 0:gt.tick_mdns)??"mDNS")+"")&&E(de,le),(!ke||Be[0]&4)&&we!==(we=(((Mt=(Ye=Re[2].conf)==null?void 0:Ye.network)==null?void 0:Mt.ntp)??"NTP")+"")&&E(C,we),Be[0]&64&&(D.checked=Re[6].n.h),(!ke||Be[0]&4)&&x!==(x=(((_t=(ot=Re[2].conf)==null?void 0:ot.network)==null?void 0:_t.tick_ntp_dhcp)??"from DHCP")+"")&&E(ae,x),Be[0]&64&&ve.value!==Re[6].n.n1&&H(ve,Re[6].n.n1)},i(Re){ke||(X(q.$$.fragment,Re),ke=!0)},o(Re){ee(q.$$.fragment,Re),ke=!1},d(Re){Re&&P(e),Pe(q),Ae&&Ae.d(),De=!1,zt(Te)}}}function ga(t){var R,F,T,A;let e,l=(((F=(R=t[2].conf)==null?void 0:R.network)==null?void 0:F.gw)??"Gateway")+"",n,i,o,a,r,f,c=(((A=(T=t[2].conf)==null?void 0:T.network)==null?void 0:A.dns)??"DNS")+"",m,_,d,v,g,b,k,M,L;return{c(){e=p("div"),n=S(l),i=p("br"),o=h(),a=p("input"),r=h(),f=p("div"),m=S(c),_=p("br"),d=h(),v=p("div"),g=p("input"),b=h(),k=p("input"),u(a,"name","ng"),u(a,"type","text"),u(a,"class","in-s"),u(a,"pattern",cn),u(e,"class","my-1"),u(g,"name","nd1"),u(g,"type","text"),u(g,"class","in-f w-full"),u(g,"pattern",cn),u(k,"name","nd2"),u(k,"type","text"),u(k,"class","in-l w-full"),u(k,"pattern",cn),u(v,"class","flex"),u(f,"class","my-1")},m(O,j){N(O,e,j),s(e,n),s(e,i),s(e,o),s(e,a),H(a,t[6].n.g),N(O,r,j),N(O,f,j),s(f,m),s(f,_),s(f,d),s(f,v),s(v,g),H(g,t[6].n.d1),s(v,b),s(v,k),H(k,t[6].n.d2),M||(L=[re(a,"input",t[63]),re(g,"input",t[64]),re(k,"input",t[65])],M=!0)},p(O,j){var K,G,q,U;j[0]&4&&l!==(l=(((G=(K=O[2].conf)==null?void 0:K.network)==null?void 0:G.gw)??"Gateway")+"")&&E(n,l),j[0]&64&&a.value!==O[6].n.g&&H(a,O[6].n.g),j[0]&4&&c!==(c=(((U=(q=O[2].conf)==null?void 0:q.network)==null?void 0:U.dns)??"DNS")+"")&&E(m,c),j[0]&64&&g.value!==O[6].n.d1&&H(g,O[6].n.d1),j[0]&64&&k.value!==O[6].n.d2&&H(k,O[6].n.d2)},d(O){O&&(P(e),P(r),P(f)),M=!1,zt(L)}}}function ka(t){var bt,Rt,be,nt,je,yt,al,nl,fl,il,jt,Ht,Ke,Se,$,Oe,ul,tl,pl,dl,wl,Cl,Sl,Ml,Pl,Il,Rl,Fl;let e,l,n=(((Rt=(bt=t[2].conf)==null?void 0:bt.mqtt)==null?void 0:Rt.title)??"MQTT")+"",i,o,a,r,f,c,m,_=(((nt=(be=t[2].conf)==null?void 0:be.mqtt)==null?void 0:nt.server)??"Server")+"",d,v,g,b,k,M,L,R,F,T,A,O,j=(((yt=(je=t[2].conf)==null?void 0:je.mqtt)==null?void 0:yt.user)??"Username")+"",K,G,q,U,Z,V,Y=(((nl=(al=t[2].conf)==null?void 0:al.mqtt)==null?void 0:nl.pass)??"Password")+"",W,B,y,ne,te,Q,se,ue=(((il=(fl=t[2].conf)==null?void 0:fl.mqtt)==null?void 0:il.id)??"Client ID")+"",fe,le,de,ie,me,oe,pe,we=(((Ht=(jt=t[2].conf)==null?void 0:jt.mqtt)==null?void 0:Ht.payload)??"Payload")+"",C,w,I,D,z,x,ae,_e,he,J,ve,ke,De,Te,Ae=(((Se=(Ke=t[2].conf)==null?void 0:Ke.mqtt)==null?void 0:Se.publish)??"Publish topic")+"",Le,Ee,Ie,Je,wt,et,ut=(((Oe=($=t[2].conf)==null?void 0:$.mqtt)==null?void 0:Oe.subscribe)??"Subscribe topic")+"",Ct,ht,rt,it,vt,Ot,$e,Re=(((tl=(ul=t[2].conf)==null?void 0:ul.mqtt)==null?void 0:tl.update)??"Update method")+"",Be,tt,ge,qe=(((dl=(pl=t[2].conf)==null?void 0:pl.mqtt)==null?void 0:dl.interval)??"Interval")+"",Ge,ce,Ce,xe,ye,Lt=(((Cl=(wl=t[2].conf)==null?void 0:wl.mqtt)==null?void 0:Cl.realtime)??"Real time")+"",gt,Ye,Mt=(((Ml=(Sl=t[2].conf)==null?void 0:Sl.mqtt)==null?void 0:Ml.interval)??"Interval")+"",ot,_t,lt,Bt,Xt,ct,at=(((Il=(Pl=t[2].conf)==null?void 0:Pl.mqtt)==null?void 0:Il.timeout)??"Timeout")+"",Gt,Jt,Tt,Yt=(((Fl=(Rl=t[2].conf)==null?void 0:Rl.mqtt)==null?void 0:Fl.keepalive)??"Keep-alive")+"",xt,$t,Vt,It,Ve,Qe,Xe,qt,Ut,dt=t[0].chip!="esp8266"&&wa(t),st=t[6].q.s.e&&Ca(t);return{c(){var We,kt;e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),d=S(_),v=h(),dt&&dt.c(),g=h(),b=p("br"),k=h(),M=p("div"),L=p("input"),R=h(),F=p("input"),T=h(),st&&st.c(),A=h(),O=p("div"),K=S(j),G=p("br"),q=h(),U=p("input"),Z=h(),V=p("div"),W=S(Y),B=p("br"),y=h(),ne=p("input"),te=h(),Q=p("div"),se=p("div"),fe=S(ue),le=p("br"),de=h(),ie=p("input"),oe=h(),pe=p("div"),C=S(we),w=p("br"),I=h(),D=p("select"),z=p("option"),z.textContent="Raw (minimal)",x=p("option"),x.textContent="Raw (full)",ae=p("option"),ae.textContent="Domoticz",_e=p("option"),_e.textContent="Home-Assistant",he=p("option"),he.textContent="JSON (classic)",J=p("option"),J.textContent="JSON (multi topic)",ve=p("option"),ve.textContent="JSON (flat)",ke=p("option"),ke.textContent="HEX dump",De=h(),Te=p("div"),Le=S(Ae),Ee=p("br"),Ie=h(),Je=p("input"),wt=h(),et=p("div"),Ct=S(ut),ht=p("br"),rt=h(),it=p("input"),Ot=h(),$e=p("div"),Be=S(Re),tt=h(),ge=p("span"),Ge=S(qe),ce=h(),Ce=p("div"),xe=p("select"),ye=p("option"),gt=S(Lt),Ye=p("option"),ot=S(Mt),_t=h(),lt=p("input"),Xt=h(),ct=p("div"),Gt=S(at),Jt=h(),Tt=p("span"),xt=S(Yt),$t=h(),Vt=p("div"),It=p("input"),Ve=h(),Qe=p("input"),u(l,"class","text-sm"),u(a,"href",ml("MQTT-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","q"),f.value="true",u(L,"name","qh"),u(L,"type","text"),u(L,"class","in-f w-2/3"),u(L,"pattern",Ll),u(F,"name","qp"),u(F,"type","number"),u(F,"min","1024"),u(F,"max","65535"),u(F,"class","in-l tr w-1/3"),u(M,"class","flex"),u(m,"class","my-1"),u(U,"name","qu"),u(U,"type","text"),u(U,"class","in-s"),u(U,"pattern",Pn),u(O,"class","my-1"),u(ne,"name","qa"),u(ne,"type","password"),u(ne,"class","in-s"),u(ne,"pattern",Pn),u(V,"class","my-1"),u(ie,"name","qc"),u(ie,"type","text"),u(ie,"class","in-f w-full"),ie.required=me=t[6].q.h,u(ie,"pattern",Vn),z.__value=1,H(z,z.__value),x.__value=2,H(x,x.__value),ae.__value=3,H(ae,ae.__value),_e.__value=4,H(_e,_e.__value),he.__value=0,H(he,he.__value),J.__value=5,H(J,J.__value),ve.__value=6,H(ve,ve.__value),ke.__value=255,H(ke,ke.__value),u(D,"name","qm"),u(D,"class","in-l"),t[6].q.m===void 0&&At(()=>t[76].call(D)),u(Q,"class","my-1 flex"),u(Je,"name","qb"),u(Je,"type","text"),u(Je,"class","in-s"),u(Je,"pattern",Ll),u(Te,"class","my-1"),u(it,"name","qr"),u(it,"type","text"),u(it,"class","in-s"),u(it,"pattern",Ll),u(it,"placeholder",vt=t[6].q.b+"/command"),u(et,"class","my-1"),u(ge,"class","float-right"),ye.__value=0,H(ye,ye.__value),Ye.__value=1,H(Ye,Ye.__value),u(xe,"name","qt"),u(xe,"class","in-f w-1/2"),t[6].q.t===void 0&&At(()=>t[79].call(xe)),u(lt,"name","qd"),u(lt,"type","number"),u(lt,"min","1"),u(lt,"max","3600"),u(lt,"class","in-l tr w-1/2"),lt.disabled=Bt=((kt=(We=t[6])==null?void 0:We.q)==null?void 0:kt.t)!=1,u(Ce,"class","flex"),u($e,"class","my-1"),u(Tt,"class","float-right"),u(It,"name","qi"),u(It,"type","number"),u(It,"min","500"),u(It,"max","10000"),u(It,"class","in-f tr w-1/2"),u(Qe,"name","qk"),u(Qe,"type","number"),u(Qe,"min","5"),u(Qe,"max","180"),u(Qe,"class","in-l tr w-1/2"),u(Vt,"class","flex"),u(ct,"class","my-1"),u(e,"class","cnt")},m(We,kt){N(We,e,kt),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,d),s(m,v),dt&&dt.m(m,null),s(m,g),s(m,b),s(m,k),s(m,M),s(M,L),H(L,t[6].q.h),s(M,R),s(M,F),H(F,t[6].q.p),s(e,T),st&&st.m(e,null),s(e,A),s(e,O),s(O,K),s(O,G),s(O,q),s(O,U),H(U,t[6].q.u),s(e,Z),s(e,V),s(V,W),s(V,B),s(V,y),s(V,ne),H(ne,t[6].q.a),s(e,te),s(e,Q),s(Q,se),s(se,fe),s(se,le),s(se,de),s(se,ie),H(ie,t[6].q.c),s(Q,oe),s(Q,pe),s(pe,C),s(pe,w),s(pe,I),s(pe,D),s(D,z),s(D,x),s(D,ae),s(D,_e),s(D,he),s(D,J),s(D,ve),s(D,ke),He(D,t[6].q.m,!0),s(e,De),s(e,Te),s(Te,Le),s(Te,Ee),s(Te,Ie),s(Te,Je),H(Je,t[6].q.b),s(e,wt),s(e,et),s(et,Ct),s(et,ht),s(et,rt),s(et,it),H(it,t[6].q.r),s(e,Ot),s(e,$e),s($e,Be),s($e,tt),s($e,ge),s(ge,Ge),s($e,ce),s($e,Ce),s(Ce,xe),s(xe,ye),s(ye,gt),s(xe,Ye),s(Ye,ot),He(xe,t[6].q.t,!0),s(Ce,_t),s(Ce,lt),H(lt,t[6].q.d),s(e,Xt),s(e,ct),s(ct,Gt),s(ct,Jt),s(ct,Tt),s(Tt,xt),s(ct,$t),s(ct,Vt),s(Vt,It),H(It,t[6].q.i),s(Vt,Ve),s(Vt,Qe),H(Qe,t[6].q.k),Xe=!0,qt||(Ut=[re(L,"input",t[71]),re(F,"input",t[72]),re(U,"input",t[73]),re(ne,"input",t[74]),re(ie,"input",t[75]),re(D,"change",t[76]),re(Je,"input",t[77]),re(it,"input",t[78]),re(xe,"change",t[79]),re(lt,"input",t[80]),re(It,"input",t[81]),re(Qe,"input",t[82])],qt=!0)},p(We,kt){var Bl,Ul,jl,Hl,zl,yl,Wl,Gl,Vl,Kl,Ue,Et,ll,Yl,Ql,Xl,Zl,Jl,$l,xl,en,Nn,Tn,qn,En,Dn,An,On,Ln,In;(!Xe||kt[0]&4)&&n!==(n=(((Ul=(Bl=We[2].conf)==null?void 0:Bl.mqtt)==null?void 0:Ul.title)??"MQTT")+"")&&E(i,n),(!Xe||kt[0]&4)&&_!==(_=(((Hl=(jl=We[2].conf)==null?void 0:jl.mqtt)==null?void 0:Hl.server)??"Server")+"")&&E(d,_),We[0].chip!="esp8266"?dt?dt.p(We,kt):(dt=wa(We),dt.c(),dt.m(m,g)):dt&&(dt.d(1),dt=null),kt[0]&64&&L.value!==We[6].q.h&&H(L,We[6].q.h),kt[0]&64&&Fe(F.value)!==We[6].q.p&&H(F,We[6].q.p),We[6].q.s.e?st?(st.p(We,kt),kt[0]&64&&X(st,1)):(st=Ca(We),st.c(),X(st,1),st.m(e,A)):st&&(mt(),ee(st,1,1,()=>{st=null}),pt()),(!Xe||kt[0]&4)&&j!==(j=(((yl=(zl=We[2].conf)==null?void 0:zl.mqtt)==null?void 0:yl.user)??"Username")+"")&&E(K,j),kt[0]&64&&U.value!==We[6].q.u&&H(U,We[6].q.u),(!Xe||kt[0]&4)&&Y!==(Y=(((Gl=(Wl=We[2].conf)==null?void 0:Wl.mqtt)==null?void 0:Gl.pass)??"Password")+"")&&E(W,Y),kt[0]&64&&ne.value!==We[6].q.a&&H(ne,We[6].q.a),(!Xe||kt[0]&4)&&ue!==(ue=(((Kl=(Vl=We[2].conf)==null?void 0:Vl.mqtt)==null?void 0:Kl.id)??"Client ID")+"")&&E(fe,ue),(!Xe||kt[0]&64&&me!==(me=We[6].q.h))&&(ie.required=me),kt[0]&64&&ie.value!==We[6].q.c&&H(ie,We[6].q.c),(!Xe||kt[0]&4)&&we!==(we=(((Et=(Ue=We[2].conf)==null?void 0:Ue.mqtt)==null?void 0:Et.payload)??"Payload")+"")&&E(C,we),kt[0]&64&&He(D,We[6].q.m),(!Xe||kt[0]&4)&&Ae!==(Ae=(((Yl=(ll=We[2].conf)==null?void 0:ll.mqtt)==null?void 0:Yl.publish)??"Publish topic")+"")&&E(Le,Ae),kt[0]&64&&Je.value!==We[6].q.b&&H(Je,We[6].q.b),(!Xe||kt[0]&4)&&ut!==(ut=(((Xl=(Ql=We[2].conf)==null?void 0:Ql.mqtt)==null?void 0:Xl.subscribe)??"Subscribe topic")+"")&&E(Ct,ut),(!Xe||kt[0]&64&&vt!==(vt=We[6].q.b+"/command"))&&u(it,"placeholder",vt),kt[0]&64&&it.value!==We[6].q.r&&H(it,We[6].q.r),(!Xe||kt[0]&4)&&Re!==(Re=(((Jl=(Zl=We[2].conf)==null?void 0:Zl.mqtt)==null?void 0:Jl.update)??"Update method")+"")&&E(Be,Re),(!Xe||kt[0]&4)&&qe!==(qe=(((xl=($l=We[2].conf)==null?void 0:$l.mqtt)==null?void 0:xl.interval)??"Interval")+"")&&E(Ge,qe),(!Xe||kt[0]&4)&&Lt!==(Lt=(((Nn=(en=We[2].conf)==null?void 0:en.mqtt)==null?void 0:Nn.realtime)??"Real time")+"")&&E(gt,Lt),(!Xe||kt[0]&4)&&Mt!==(Mt=(((qn=(Tn=We[2].conf)==null?void 0:Tn.mqtt)==null?void 0:qn.interval)??"Interval")+"")&&E(ot,Mt),kt[0]&64&&He(xe,We[6].q.t),(!Xe||kt[0]&64&&Bt!==(Bt=((Dn=(En=We[6])==null?void 0:En.q)==null?void 0:Dn.t)!=1))&&(lt.disabled=Bt),kt[0]&64&&Fe(lt.value)!==We[6].q.d&&H(lt,We[6].q.d),(!Xe||kt[0]&4)&&at!==(at=(((On=(An=We[2].conf)==null?void 0:An.mqtt)==null?void 0:On.timeout)??"Timeout")+"")&&E(Gt,at),(!Xe||kt[0]&4)&&Yt!==(Yt=(((In=(Ln=We[2].conf)==null?void 0:Ln.mqtt)==null?void 0:In.keepalive)??"Keep-alive")+"")&&E(xt,Yt),kt[0]&64&&Fe(It.value)!==We[6].q.i&&H(It,We[6].q.i),kt[0]&64&&Fe(Qe.value)!==We[6].q.k&&H(Qe,We[6].q.k)},i(We){Xe||(X(st),Xe=!0)},o(We){ee(st),Xe=!1},d(We){We&&P(e),dt&&dt.d(),st&&st.d(),qt=!1,zt(Ut)}}}function wa(t){let e,l,n,i,o;return{c(){e=p("label"),l=p("input"),n=S(" SSL"),u(l,"type","checkbox"),u(l,"name","qs"),l.__value="true",H(l,l.__value),u(l,"class","rounded mb-1"),u(e,"class","float-right mr-3")},m(a,r){N(a,e,r),s(e,l),l.checked=t[6].q.s.e,s(e,n),i||(o=[re(l,"change",t[70]),re(l,"change",t[20])],i=!0)},p(a,r){r[0]&64&&(l.checked=a[6].q.s.e)},d(a){a&&P(e),i=!1,zt(o)}}}function Ca(t){let e,l,n,i,o,a,r,f,c,m,_,d,v;const g=[L0,O0],b=[];function k(O,j){return O[6].q.s.c?0:1}n=k(t),i=b[n]=g[n](t);const M=[B0,F0],L=[];function R(O,j){return O[6].q.s.r?0:1}r=R(t),f=L[r]=M[r](t);const F=[z0,H0],T=[];function A(O,j){return O[6].q.s.k?0:1}return _=A(t),d=T[_]=F[_](t),{c(){e=p("div"),l=p("span"),i.c(),o=h(),a=p("span"),f.c(),c=h(),m=p("span"),d.c(),u(l,"class","flex pr-2"),u(a,"class","flex pr-2"),u(m,"class","flex pr-2"),u(e,"class","my-1 flex")},m(O,j){N(O,e,j),s(e,l),b[n].m(l,null),s(e,o),s(e,a),L[r].m(a,null),s(e,c),s(e,m),T[_].m(m,null),v=!0},p(O,j){let K=n;n=k(O),n===K?b[n].p(O,j):(mt(),ee(b[K],1,1,()=>{b[K]=null}),pt(),i=b[n],i?i.p(O,j):(i=b[n]=g[n](O),i.c()),X(i,1),i.m(l,null));let G=r;r=R(O),r===G?L[r].p(O,j):(mt(),ee(L[G],1,1,()=>{L[G]=null}),pt(),f=L[r],f?f.p(O,j):(f=L[r]=M[r](O),f.c()),X(f,1),f.m(a,null));let q=_;_=A(O),_===q?T[_].p(O,j):(mt(),ee(T[q],1,1,()=>{T[q]=null}),pt(),d=T[_],d?d.p(O,j):(d=T[_]=F[_](O),d.c()),X(d,1),d.m(m,null))},i(O){v||(X(i),X(f),X(d),v=!0)},o(O){ee(i),ee(f),ee(d),v=!1},d(O){O&&P(e),b[n].d(),L[r].d(),T[_].d()}}}function O0(t){let e,l;return e=new hl({props:{to:"/mqtt-ca",$$slots:{default:[I0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[4]&524288&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function L0(t){let e,l,n,i,o,a,r;return l=new hl({props:{to:"/mqtt-ca",$$slots:{default:[R0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=h(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){N(f,e,c),Me(l,e,null),N(f,n,c),N(f,i,c),o=!0,a||(r=[re(i,"click",t[17]),re(i,"keypress",t[17])],a=!0)},p(f,c){const m={};c[0]&4|c[4]&524288&&(m.$$scope={dirty:c,ctx:f}),l.$set(m)},i(f){o||(X(l.$$.fragment,f),o=!0)},o(f){ee(l.$$.fragment,f),o=!1},d(f){f&&(P(e),P(n),P(i)),Pe(l),a=!1,zt(r)}}}function I0(t){var n,i,o,a;let e,l;return e=new fn({props:{color:"blue",text:((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_ca_upload)??"Upload CA",title:((a=(o=t[2].conf)==null?void 0:o.mqtt)==null?void 0:a.title_ca)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Me(e,r,f),l=!0},p(r,f){var m,_,d,v;const c={};f[0]&4&&(c.text=((_=(m=r[2].conf)==null?void 0:m.mqtt)==null?void 0:_.btn_ca_upload)??"Upload CA"),f[0]&4&&(c.title=((v=(d=r[2].conf)==null?void 0:d.mqtt)==null?void 0:v.title_ca)??""),e.$set(c)},i(r){l||(X(e.$$.fragment,r),l=!0)},o(r){ee(e.$$.fragment,r),l=!1},d(r){Pe(e,r)}}}function R0(t){var n,i;let e=(((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.ca_ok)??"CA OK")+"",l;return{c(){l=S(e)},m(o,a){N(o,l,a)},p(o,a){var r,f;a[0]&4&&e!==(e=(((f=(r=o[2].conf)==null?void 0:r.mqtt)==null?void 0:f.ca_ok)??"CA OK")+"")&&E(l,e)},d(o){o&&P(l)}}}function F0(t){let e,l;return e=new hl({props:{to:"/mqtt-cert",$$slots:{default:[U0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[4]&524288&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function B0(t){let e,l,n,i,o,a,r;return l=new hl({props:{to:"/mqtt-cert",$$slots:{default:[j0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=h(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){N(f,e,c),Me(l,e,null),N(f,n,c),N(f,i,c),o=!0,a||(r=[re(i,"click",t[18]),re(i,"keypress",t[18])],a=!0)},p(f,c){const m={};c[0]&4|c[4]&524288&&(m.$$scope={dirty:c,ctx:f}),l.$set(m)},i(f){o||(X(l.$$.fragment,f),o=!0)},o(f){ee(l.$$.fragment,f),o=!1},d(f){f&&(P(e),P(n),P(i)),Pe(l),a=!1,zt(r)}}}function U0(t){var n,i,o,a;let e,l;return e=new fn({props:{color:"blue",text:((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_crt_upload)??"Upload cert",title:((a=(o=t[2].conf)==null?void 0:o.mqtt)==null?void 0:a.title_crt)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Me(e,r,f),l=!0},p(r,f){var m,_,d,v;const c={};f[0]&4&&(c.text=((_=(m=r[2].conf)==null?void 0:m.mqtt)==null?void 0:_.btn_crt_upload)??"Upload cert"),f[0]&4&&(c.title=((v=(d=r[2].conf)==null?void 0:d.mqtt)==null?void 0:v.title_crt)??""),e.$set(c)},i(r){l||(X(e.$$.fragment,r),l=!0)},o(r){ee(e.$$.fragment,r),l=!1},d(r){Pe(e,r)}}}function j0(t){var n,i;let e=(((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.crt_ok)??"Cert OK")+"",l;return{c(){l=S(e)},m(o,a){N(o,l,a)},p(o,a){var r,f;a[0]&4&&e!==(e=(((f=(r=o[2].conf)==null?void 0:r.mqtt)==null?void 0:f.crt_ok)??"Cert OK")+"")&&E(l,e)},d(o){o&&P(l)}}}function H0(t){let e,l;return e=new hl({props:{to:"/mqtt-key",$$slots:{default:[y0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[4]&524288&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function z0(t){let e,l,n,i,o,a,r;return l=new hl({props:{to:"/mqtt-key",$$slots:{default:[W0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=h(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){N(f,e,c),Me(l,e,null),N(f,n,c),N(f,i,c),o=!0,a||(r=[re(i,"click",t[19]),re(i,"keypress",t[19])],a=!0)},p(f,c){const m={};c[0]&4|c[4]&524288&&(m.$$scope={dirty:c,ctx:f}),l.$set(m)},i(f){o||(X(l.$$.fragment,f),o=!0)},o(f){ee(l.$$.fragment,f),o=!1},d(f){f&&(P(e),P(n),P(i)),Pe(l),a=!1,zt(r)}}}function y0(t){var n,i,o,a;let e,l;return e=new fn({props:{color:"blue",text:((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_key_upload)??"Upload key",title:((a=(o=t[2].conf)==null?void 0:o.mqtt)==null?void 0:a.title_key)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Me(e,r,f),l=!0},p(r,f){var m,_,d,v;const c={};f[0]&4&&(c.text=((_=(m=r[2].conf)==null?void 0:m.mqtt)==null?void 0:_.btn_key_upload)??"Upload key"),f[0]&4&&(c.title=((v=(d=r[2].conf)==null?void 0:d.mqtt)==null?void 0:v.title_key)??""),e.$set(c)},i(r){l||(X(e.$$.fragment,r),l=!0)},o(r){ee(e.$$.fragment,r),l=!1},d(r){Pe(e,r)}}}function W0(t){var n,i;let e=(((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.key_ok)??"Key OK")+"",l;return{c(){l=S(e)},m(o,a){N(o,l,a)},p(o,a){var r,f;a[0]&4&&e!==(e=(((f=(r=o[2].conf)==null?void 0:r.mqtt)==null?void 0:f.key_ok)??"Key OK")+"")&&E(l,e)},d(o){o&&P(l)}}}function Sa(t){var Q,se,ue,fe,le,de,ie,me,oe,pe,we,C;let e,l,n=(((ue=(se=(Q=t[2].conf)==null?void 0:Q.mqtt)==null?void 0:se.domoticz)==null?void 0:ue.title)??"Domoticz")+"",i,o,a,r,f,c,m,_,d=(((de=(le=(fe=t[2].conf)==null?void 0:fe.mqtt)==null?void 0:le.domoticz)==null?void 0:de.eidx)??"Electricity IDX")+"",v,g,b,k,M,L,R=(((oe=(me=(ie=t[2].conf)==null?void 0:ie.mqtt)==null?void 0:me.domoticz)==null?void 0:oe.cidx)??"Current IDX")+"",F,T,A,O,j,K,G=(((C=(we=(pe=t[2].conf)==null?void 0:pe.mqtt)==null?void 0:we.domoticz)==null?void 0:C.vidx)??"Voltage IDX")+"",q,U,Z,V,Y,W,B,y,ne,te;return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),_=p("div"),v=S(d),g=p("br"),b=h(),k=p("input"),M=h(),L=p("div"),F=S(R),T=p("br"),A=h(),O=p("input"),j=h(),K=p("div"),q=S(G),U=S(`: L1, L2 & L3 - `),Z=p("div"),V=p("input"),Y=h(),W=p("input"),B=h(),y=p("input"),u(l,"class","text-sm"),u(a,"href",ml("MQTT-configuration#domoticz")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","o"),f.value="true",u(k,"name","oe"),u(k,"type","text"),u(k,"class","in-f tr w-full"),u(k,"pattern",Rn),u(_,"class","w-1/2"),u(O,"name","oc"),u(O,"type","text"),u(O,"class","in-l tr w-full"),u(O,"pattern",Rn),u(L,"class","w-1/2"),u(m,"class","my-1 flex"),u(V,"name","ou1"),u(V,"type","text"),u(V,"class","in-f tr w-1/3"),u(V,"pattern",Rn),u(W,"name","ou2"),u(W,"type","text"),u(W,"class","in-m tr w-1/3"),u(W,"pattern",Rn),u(y,"name","ou3"),u(y,"type","text"),u(y,"class","in-l tr w-1/3"),u(y,"pattern",Rn),u(Z,"class","flex"),u(K,"class","my-1"),u(e,"class","cnt")},m(w,I){N(w,e,I),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,_),s(_,v),s(_,g),s(_,b),s(_,k),H(k,t[6].o.e),s(m,M),s(m,L),s(L,F),s(L,T),s(L,A),s(L,O),H(O,t[6].o.c),s(e,j),s(e,K),s(K,q),s(K,U),s(K,Z),s(Z,V),H(V,t[6].o.u1),s(Z,Y),s(Z,W),H(W,t[6].o.u2),s(Z,B),s(Z,y),H(y,t[6].o.u3),ne||(te=[re(k,"input",t[83]),re(O,"input",t[84]),re(V,"input",t[85]),re(W,"input",t[86]),re(y,"input",t[87])],ne=!0)},p(w,I){var D,z,x,ae,_e,he,J,ve,ke,De,Te,Ae;I[0]&4&&n!==(n=(((x=(z=(D=w[2].conf)==null?void 0:D.mqtt)==null?void 0:z.domoticz)==null?void 0:x.title)??"Domoticz")+"")&&E(i,n),I[0]&4&&d!==(d=(((he=(_e=(ae=w[2].conf)==null?void 0:ae.mqtt)==null?void 0:_e.domoticz)==null?void 0:he.eidx)??"Electricity IDX")+"")&&E(v,d),I[0]&64&&k.value!==w[6].o.e&&H(k,w[6].o.e),I[0]&4&&R!==(R=(((ke=(ve=(J=w[2].conf)==null?void 0:J.mqtt)==null?void 0:ve.domoticz)==null?void 0:ke.cidx)??"Current IDX")+"")&&E(F,R),I[0]&64&&O.value!==w[6].o.c&&H(O,w[6].o.c),I[0]&4&&G!==(G=(((Ae=(Te=(De=w[2].conf)==null?void 0:De.mqtt)==null?void 0:Te.domoticz)==null?void 0:Ae.vidx)??"Voltage IDX")+"")&&E(q,G),I[0]&64&&V.value!==w[6].o.u1&&H(V,w[6].o.u1),I[0]&64&&W.value!==w[6].o.u2&&H(W,w[6].o.u2),I[0]&64&&y.value!==w[6].o.u3&&H(y,w[6].o.u3)},d(w){w&&P(e),ne=!1,zt(te)}}}function Ma(t){var B,y,ne,te,Q,se,ue,fe,le,de,ie,me;let e,l,n=(((ne=(y=(B=t[2].conf)==null?void 0:B.mqtt)==null?void 0:y.ha)==null?void 0:ne.title)??"Home-Assistant")+"",i,o,a,r,f,c,m,_=(((se=(Q=(te=t[2].conf)==null?void 0:te.mqtt)==null?void 0:Q.ha)==null?void 0:se.discovery)??"Discovery topic prefix")+"",d,v,g,b,k,M,L=(((le=(fe=(ue=t[2].conf)==null?void 0:ue.mqtt)==null?void 0:fe.ha)==null?void 0:le.hostname)??"Hostname for URL")+"",R,F,T,A,O,j,K,G=(((me=(ie=(de=t[2].conf)==null?void 0:de.mqtt)==null?void 0:ie.ha)==null?void 0:me.tag)??"Name tag")+"",q,U,Z,V,Y,W;return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),d=S(_),v=p("br"),g=h(),b=p("input"),k=h(),M=p("div"),R=S(L),F=p("br"),T=h(),A=p("input"),j=h(),K=p("div"),q=S(G),U=p("br"),Z=h(),V=p("input"),u(l,"class","text-sm"),u(a,"href",ml("MQTT-configuration#home-assistant")),u(a,"target","_blank"),u(a,"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(m,"class","my-1"),u(A,"name","hh"),u(A,"type","text"),u(A,"class","in-s"),u(A,"placeholder",O=t[6].g.h+".local"),u(A,"pattern",Ll),u(M,"class","my-1"),u(V,"name","hn"),u(V,"type","text"),u(V,"class","in-s"),u(V,"pattern",Ll),u(K,"class","my-1"),u(e,"class","cnt")},m(oe,pe){N(oe,e,pe),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,d),s(m,v),s(m,g),s(m,b),H(b,t[6].h.t),s(e,k),s(e,M),s(M,R),s(M,F),s(M,T),s(M,A),H(A,t[6].h.h),s(e,j),s(e,K),s(K,q),s(K,U),s(K,Z),s(K,V),H(V,t[6].h.n),Y||(W=[re(b,"input",t[88]),re(A,"input",t[89]),re(V,"input",t[90])],Y=!0)},p(oe,pe){var we,C,w,I,D,z,x,ae,_e,he,J,ve;pe[0]&4&&n!==(n=(((w=(C=(we=oe[2].conf)==null?void 0:we.mqtt)==null?void 0:C.ha)==null?void 0:w.title)??"Home-Assistant")+"")&&E(i,n),pe[0]&4&&_!==(_=(((z=(D=(I=oe[2].conf)==null?void 0:I.mqtt)==null?void 0:D.ha)==null?void 0:z.discovery)??"Discovery topic prefix")+"")&&E(d,_),pe[0]&64&&b.value!==oe[6].h.t&&H(b,oe[6].h.t),pe[0]&4&&L!==(L=(((_e=(ae=(x=oe[2].conf)==null?void 0:x.mqtt)==null?void 0:ae.ha)==null?void 0:_e.hostname)??"Hostname for URL")+"")&&E(R,L),pe[0]&64&&O!==(O=oe[6].g.h+".local")&&u(A,"placeholder",O),pe[0]&64&&A.value!==oe[6].h.h&&H(A,oe[6].h.h),pe[0]&4&&G!==(G=(((ve=(J=(he=oe[2].conf)==null?void 0:he.mqtt)==null?void 0:J.ha)==null?void 0:ve.tag)??"Name tag")+"")&&E(q,G),pe[0]&64&&V.value!==oe[6].h.n&&H(V,oe[6].h.n)},d(oe){oe&&P(e),Y=!1,zt(W)}}}function Pa(t){var j,K,G,q,U,Z,V,Y;let e,l,n=(((K=(j=t[2].conf)==null?void 0:j.cloud)==null?void 0:K.title)??"Cloud connections")+"",i,o,a,r,f,c,m=(q=(G=t[0])==null?void 0:G.features)==null?void 0:q.includes("cloud"),_,d,v,g,b,k=(((Z=(U=t[2].conf)==null?void 0:U.cloud)==null?void 0:Z.es)??"Energy Speedometer")+"",M,L,R,F,T,A=m&&Na(t),O=((Y=(V=t[6])==null?void 0:V.c)==null?void 0:Y.es)&&Da(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),A&&A.c(),_=h(),d=p("div"),v=p("label"),g=p("input"),b=h(),M=S(k),L=h(),O&&O.c(),u(l,"class","text-sm"),u(a,"href",ml("Cloud")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","c"),f.value="true",u(g,"type","checkbox"),u(g,"class","rounded mb-1"),u(g,"name","ces"),g.__value="true",H(g,g.__value),u(d,"class","my-1"),u(e,"class","cnt")},m(W,B){N(W,e,B),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),A&&A.m(e,null),s(e,_),s(e,d),s(d,v),s(v,g),g.checked=t[6].c.es,s(v,b),s(v,M),s(d,L),O&&O.m(d,null),R=!0,F||(T=re(g,"change",t[93]),F=!0)},p(W,B){var y,ne,te,Q,se,ue,fe,le;(!R||B[0]&4)&&n!==(n=(((ne=(y=W[2].conf)==null?void 0:y.cloud)==null?void 0:ne.title)??"Cloud connections")+"")&&E(i,n),B[0]&1&&(m=(Q=(te=W[0])==null?void 0:te.features)==null?void 0:Q.includes("cloud")),m?A?A.p(W,B):(A=Na(W),A.c(),A.m(e,_)):A&&(A.d(1),A=null),B[0]&64&&(g.checked=W[6].c.es),(!R||B[0]&4)&&k!==(k=(((ue=(se=W[2].conf)==null?void 0:se.cloud)==null?void 0:ue.es)??"Energy Speedometer")+"")&&E(M,k),(le=(fe=W[6])==null?void 0:fe.c)!=null&&le.es?O?(O.p(W,B),B[0]&64&&X(O,1)):(O=Da(W),O.c(),X(O,1),O.m(d,null)):O&&(mt(),ee(O,1,1,()=>{O=null}),pt())},i(W){R||(X(O),R=!0)},o(W){ee(O),R=!1},d(W){W&&P(e),A&&A.d(),O&&O.d(),F=!1,T()}}}function Na(t){var _,d;let e,l,n,i,o=(((d=(_=t[2].conf)==null?void 0:_.cloud)==null?void 0:d.ams)??"AMS reader cloud")+"",a,r,f,c,m=t[6].c.e&&Ta(t);return{c(){e=p("div"),l=p("label"),n=p("input"),i=h(),a=S(o),r=h(),m&&m.c(),u(n,"type","checkbox"),u(n,"name","ce"),n.__value="true",H(n,n.__value),u(n,"class","rounded mb-1"),u(e,"class","my-1")},m(v,g){N(v,e,g),s(e,l),s(l,n),n.checked=t[6].c.e,s(l,i),s(l,a),s(e,r),m&&m.m(e,null),f||(c=re(n,"change",t[91]),f=!0)},p(v,g){var b,k;g[0]&64&&(n.checked=v[6].c.e),g[0]&4&&o!==(o=(((k=(b=v[2].conf)==null?void 0:b.cloud)==null?void 0:k.ams)??"AMS reader cloud")+"")&&E(a,o),v[6].c.e?m?m.p(v,g):(m=Ta(v),m.c(),m.m(e,null)):m&&(m.d(1),m=null)},d(v){v&&P(e),m&&m.d(),f=!1,c()}}}function Ta(t){let e,l,n,i,o,a,r,f,c,m,_=t[6].c.p==0&&qa(),d=t[5]&&Ea(t);return{c(){e=p("div"),l=p("label"),l.textContent="Protocol",n=h(),i=p("select"),_&&_.c(),o=p("option"),o.textContent="TCP",a=p("option"),a.textContent="HTTP",r=h(),d&&d.c(),f=Wt(),u(l,"for","cp"),o.__value=1,H(o,o.__value),a.__value=2,H(a,a.__value),u(i,"name","cp"),u(i,"class","in-s"),t[6].c.p===void 0&&At(()=>t[92].call(i)),u(e,"class","ml-6")},m(v,g){N(v,e,g),s(e,l),s(e,n),s(e,i),_&&_.m(i,null),s(i,o),s(i,a),He(i,t[6].c.p,!0),N(v,r,g),d&&d.m(v,g),N(v,f,g),c||(m=re(i,"change",t[92]),c=!0)},p(v,g){v[6].c.p==0?_||(_=qa(),_.c(),_.m(i,o)):_&&(_.d(1),_=null),g[0]&64&&He(i,v[6].c.p),v[5]?d?d.p(v,g):(d=Ea(v),d.c(),d.m(f.parentNode,f)):d&&(d.d(1),d=null)},d(v){v&&(P(e),P(r),P(f)),_&&_.d(),d&&d.d(v),c=!1,m()}}}function qa(t){let e;return{c(){e=p("option"),e.textContent="UDP",e.__value=0,H(e,e.__value),u(e,"title","No longer recommended")},m(l,n){N(l,e,n)},d(l){l&&P(e)}}}function Ea(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,o){N(i,e,o),l||(n=re(e,"click",t[22]),l=!0)},p:ze,d(i){i&&P(e),l=!1,n()}}}function Da(t){let e,l,n=t[0].mac+"",i,o,a,r,f=(t[0].meter.id?t[0].meter.id:"missing, required")+"",c,m,_,d,v=t[0].mac&&t[0].meter.id&&Aa(t);return{c(){e=p("div"),l=S("MAC: "),i=S(n),o=h(),a=p("div"),r=S("Meter ID: "),c=S(f),m=h(),v&&v.c(),_=Wt(),u(e,"class","pl-5"),u(a,"class","pl-5")},m(g,b){N(g,e,b),s(e,l),s(e,i),N(g,o,b),N(g,a,b),s(a,r),s(a,c),N(g,m,b),v&&v.m(g,b),N(g,_,b),d=!0},p(g,b){(!d||b[0]&1)&&n!==(n=g[0].mac+"")&&E(i,n),(!d||b[0]&1)&&f!==(f=(g[0].meter.id?g[0].meter.id:"missing, required")+"")&&E(c,f),g[0].mac&&g[0].meter.id?v?(v.p(g,b),b[0]&1&&X(v,1)):(v=Aa(g),v.c(),X(v,1),v.m(_.parentNode,_)):v&&(mt(),ee(v,1,1,()=>{v=null}),pt())},i(g){d||(X(v),d=!0)},o(g){ee(v),d=!1},d(g){g&&(P(e),P(o),P(a),P(m),P(_)),v&&v.d(g)}}}function Aa(t){let e,l,n;return l=new k0({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,o){N(i,e,o),Me(l,e,null),n=!0},p(i,o){const a={};o[0]&1&&(a.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(a)},i(i){n||(X(l.$$.fragment,i),n=!0)},o(i){ee(l.$$.fragment,i),n=!1},d(i){i&&P(e),Pe(l)}}}function Oa(t){var G,q,U,Z,V;let e,l,n=(((q=(G=t[2].conf)==null?void 0:G.thresholds)==null?void 0:q.title)??"Thresholds")+"",i,o,a,r,f,c,m,_,d,v,g=(((Z=(U=t[2].conf)==null?void 0:U.thresholds)==null?void 0:Z.avg)??"Average of")+"",b,k,M,L,R,F=(((V=t[2].common)==null?void 0:V.hours)??"hours")+"",T,A,O,j=ft({length:9}),K=[];for(let Y=0;Yt[97].call(k)),u(d,"class","w-1/2"),u(m,"class","flex flex-wrap"),u(e,"class","cnt")},m(q,U){N(q,e,U),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m);for(let Z=0;Z20&&Ua(t),d=((L=(M=(k=t[6])==null?void 0:k.i)==null?void 0:M.d)==null?void 0:L.d)>0&&za(t),v=t[0].chip=="esp8266"&&ya(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),_&&_.c(),f=h(),d&&d.c(),c=h(),v&&v.c(),u(l,"class","text-sm"),u(a,"href",ml("GPIO-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(e,"class","cnt")},m(R,F){N(R,e,F),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),_&&_.m(e,null),s(e,f),d&&d.m(e,null),s(e,c),v&&v.m(e,null),m=!0},p(R,F){var T,A,O,j,K;(!m||F[0]&4)&&n!==(n=(((A=(T=R[2].conf)==null?void 0:T.hw)==null?void 0:A.title)??"Hardware")+"")&&E(i,n),R[0].board>20?_?(_.p(R,F),F[0]&1&&X(_,1)):(_=Ua(R),_.c(),X(_,1),_.m(e,f)):_&&(mt(),ee(_,1,1,()=>{_=null}),pt()),((K=(j=(O=R[6])==null?void 0:O.i)==null?void 0:j.d)==null?void 0:K.d)>0?d?d.p(R,F):(d=za(R),d.c(),d.m(e,c)):d&&(d.d(1),d=null),R[0].chip=="esp8266"?v?v.p(R,F):(v=ya(R),v.c(),v.m(e,null)):v&&(v.d(1),v=null)},i(R){m||(X(_),m=!0)},o(R){ee(_),m=!1},d(R){R&&P(e),_&&_.d(),d&&d.d(),v&&v.d()}}}function Ua(t){var Bt,Xt,ct,at,Gt,Jt,Tt,Yt,xt,$t,Vt,It,Ve,Qe,Xe,qt,Ut,dt,st,bt,Rt,be,nt,je,yt,al,nl,fl,il,jt,Ht,Ke,Se;let e,l,n,i,o=(((ct=(Xt=(Bt=t[2].conf)==null?void 0:Bt.hw)==null?void 0:Xt.han)==null?void 0:ct.rx)??"HAN RX")+"",a,r,f,c,m,_,d,v=(((Jt=(Gt=(at=t[2].conf)==null?void 0:at.hw)==null?void 0:Gt.han)==null?void 0:Jt.tx)??"HAN TX")+"",g,b,k,M,L,R,F,T,A,O,j=(((xt=(Yt=(Tt=t[2].conf)==null?void 0:Tt.hw)==null?void 0:Yt.han)==null?void 0:xt.pullup)??"pullup")+"",K,G,q,U,Z=(((Vt=($t=t[2].conf)==null?void 0:$t.hw)==null?void 0:Vt.ap_btn)??"AP button")+"",V,Y,W,B,y,ne,te=(((Qe=(Ve=(It=t[2].conf)==null?void 0:It.hw)==null?void 0:Ve.led)==null?void 0:Qe.title)??"LED")+"",Q,se,ue,fe,le,de,ie,me,oe,pe,we=(((Ut=(qt=(Xe=t[2].conf)==null?void 0:Xe.hw)==null?void 0:qt.led)==null?void 0:Ut.inverted)??"inverted")+"",C,w,I,D=(((bt=(st=(dt=t[2].conf)==null?void 0:dt.hw)==null?void 0:st.led)==null?void 0:bt.rgb)??"RGB")+"",z,x,ae,_e,he=(((nt=(be=(Rt=t[2].conf)==null?void 0:Rt.hw)==null?void 0:be.led)==null?void 0:nt.inverted)??"inverted")+"",J,ve,ke,De,Te,Ae,Le,Ee,Ie,Je,wt,et,ut=(((al=(yt=(je=t[2].conf)==null?void 0:je.hw)==null?void 0:yt.led)==null?void 0:al.disable)??"LED dis. GPIO")+"",Ct,ht,rt,it,vt,Ot=(((fl=(nl=t[2].conf)==null?void 0:nl.hw)==null?void 0:fl.temp)??"Temperature")+"",$e,Re,Be,tt,ge,qe,Ge=(((jt=(il=t[2].conf)==null?void 0:il.hw)==null?void 0:jt.temp_analog)??"Analog temp")+"",ce,Ce,xe,ye,Lt,gt,Ye,Mt,ot;m=new ji({props:{chip:t[0].chip}}),L=new ji({props:{chip:t[0].chip}});let _t=t[0].chip!="esp8266"&&ja(t),lt=((Se=(Ke=(Ht=t[6])==null?void 0:Ht.i)==null?void 0:Ke.v)==null?void 0:Se.p)>0&&Ha(t);return{c(){e=p("input"),l=h(),n=p("div"),i=p("div"),a=S(o),r=p("br"),f=h(),c=p("select"),Ne(m.$$.fragment),_=h(),d=p("div"),g=S(v),b=p("br"),k=h(),M=p("select"),Ne(L.$$.fragment),R=h(),F=p("div"),T=p("label"),A=p("input"),O=h(),K=S(j),G=h(),q=p("div"),U=p("div"),V=S(Z),Y=p("br"),W=h(),B=p("input"),y=h(),ne=p("div"),Q=S(te),se=p("br"),ue=h(),fe=p("div"),le=p("input"),de=h(),ie=p("div"),me=p("label"),oe=p("input"),pe=h(),C=S(we),w=h(),I=p("div"),z=S(D),x=p("label"),ae=p("input"),_e=h(),J=S(he),ve=p("br"),ke=h(),De=p("div"),Te=p("input"),Ae=h(),Le=p("input"),Ee=h(),Ie=p("input"),Je=h(),wt=p("div"),et=p("div"),Ct=S(ut),ht=h(),rt=p("input"),it=h(),vt=p("div"),$e=S(Ot),Re=p("br"),Be=h(),tt=p("input"),ge=h(),qe=p("div"),ce=S(Ge),Ce=p("br"),xe=h(),ye=p("input"),Lt=h(),_t&&_t.c(),gt=h(),lt&<.c(),u(e,"type","hidden"),u(e,"name","i"),e.value="true",u(c,"name","ihp"),u(c,"class","in-f w-full"),t[6].i.h.p===void 0&&At(()=>t[98].call(c)),u(i,"class","w-1/3"),u(M,"name","iht"),u(M,"class","in-l w-full"),t[6].i.h.t===void 0&&At(()=>t[99].call(M)),u(d,"class","w-1/3"),u(A,"name","ihu"),A.__value="true",H(A,A.__value),u(A,"type","checkbox"),u(A,"class","rounded mb-1"),u(T,"class","ml-2"),u(F,"class","w-1/3"),u(n,"class","flex flex-wrap"),u(B,"name","ia"),u(B,"type","number"),u(B,"min","0"),u(B,"max",t[12]),u(B,"class","in-f tr w-full"),u(U,"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(fe,"class","flex"),u(ne,"class","w-1/3"),u(oe,"name","ili"),oe.__value="true",H(oe,oe.__value),u(oe,"type","checkbox"),u(oe,"class","rounded mb-1"),u(me,"class","ml-4"),u(ie,"class","w-1/3"),u(ae,"name","iri"),ae.__value="true",H(ae,ae.__value),u(ae,"type","checkbox"),u(ae,"class","rounded mb-1"),u(x,"class","ml-4"),u(Te,"name","irr"),u(Te,"type","number"),u(Te,"min","0"),u(Te,"max",t[12]),u(Te,"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(Ie,"name","irb"),u(Ie,"type","number"),u(Ie,"min","0"),u(Ie,"max",t[12]),u(Ie,"class","in-l tr w-1/3"),u(De,"class","flex"),u(I,"class","w-full"),u(rt,"name","idd"),u(rt,"type","number"),u(rt,"min","0"),u(rt,"max",t[12]),u(rt,"class","in-s tr"),u(et,"class","my-1 pr-1 w-1/3"),u(wt,"class","w-full"),u(tt,"name","itd"),u(tt,"type","number"),u(tt,"min","0"),u(tt,"max",t[12]),u(tt,"class","in-f tr w-full"),u(vt,"class","my-1 w-1/3"),u(ye,"name","ita"),u(ye,"type","number"),u(ye,"min","0"),u(ye,"max",t[12]),u(ye,"class","in-l tr w-full"),u(qe,"class","my-1 pr-1 w-1/3"),u(q,"class","flex flex-wrap")},m($,Oe){N($,e,Oe),N($,l,Oe),N($,n,Oe),s(n,i),s(i,a),s(i,r),s(i,f),s(i,c),Me(m,c,null),He(c,t[6].i.h.p,!0),s(n,_),s(n,d),s(d,g),s(d,b),s(d,k),s(d,M),Me(L,M,null),He(M,t[6].i.h.t,!0),s(n,R),s(n,F),s(F,T),s(T,A),A.checked=t[6].i.h.u,s(T,O),s(T,K),N($,G,Oe),N($,q,Oe),s(q,U),s(U,V),s(U,Y),s(U,W),s(U,B),H(B,t[6].i.a),s(q,y),s(q,ne),s(ne,Q),s(ne,se),s(ne,ue),s(ne,fe),s(fe,le),H(le,t[6].i.l.p),s(q,de),s(q,ie),s(ie,me),s(me,oe),oe.checked=t[6].i.l.i,s(me,pe),s(me,C),s(q,w),s(q,I),s(I,z),s(I,x),s(x,ae),ae.checked=t[6].i.r.i,s(x,_e),s(x,J),s(I,ve),s(I,ke),s(I,De),s(De,Te),H(Te,t[6].i.r.r),s(De,Ae),s(De,Le),H(Le,t[6].i.r.g),s(De,Ee),s(De,Ie),H(Ie,t[6].i.r.b),s(q,Je),s(q,wt),s(wt,et),s(et,Ct),s(et,ht),s(et,rt),H(rt,t[6].i.d.d),s(q,it),s(q,vt),s(vt,$e),s(vt,Re),s(vt,Be),s(vt,tt),H(tt,t[6].i.t.d),s(q,ge),s(q,qe),s(qe,ce),s(qe,Ce),s(qe,xe),s(qe,ye),H(ye,t[6].i.t.a),s(q,Lt),_t&&_t.m(q,null),s(q,gt),lt&<.m(q,null),Ye=!0,Mt||(ot=[re(c,"change",t[98]),re(M,"change",t[99]),re(A,"change",t[100]),re(B,"input",t[101]),re(le,"input",t[102]),re(oe,"change",t[103]),re(ae,"change",t[104]),re(Te,"input",t[105]),re(Le,"input",t[106]),re(Ie,"input",t[107]),re(rt,"input",t[108]),re(tt,"input",t[109]),re(ye,"input",t[110])],Mt=!0)},p($,Oe){var pl,dl,wl,Cl,Sl,Ml,Pl,Il,Rl,Fl,We,kt,Bl,Ul,jl,Hl,zl,yl,Wl,Gl,Vl,Kl,Ue,Et,ll,Yl,Ql,Xl,Zl,Jl,$l,xl,en;(!Ye||Oe[0]&4)&&o!==(o=(((wl=(dl=(pl=$[2].conf)==null?void 0:pl.hw)==null?void 0:dl.han)==null?void 0:wl.rx)??"HAN RX")+"")&&E(a,o);const ul={};Oe[0]&1&&(ul.chip=$[0].chip),m.$set(ul),Oe[0]&64&&He(c,$[6].i.h.p),(!Ye||Oe[0]&4)&&v!==(v=(((Ml=(Sl=(Cl=$[2].conf)==null?void 0:Cl.hw)==null?void 0:Sl.han)==null?void 0:Ml.tx)??"HAN TX")+"")&&E(g,v);const tl={};Oe[0]&1&&(tl.chip=$[0].chip),L.$set(tl),Oe[0]&64&&He(M,$[6].i.h.t),Oe[0]&64&&(A.checked=$[6].i.h.u),(!Ye||Oe[0]&4)&&j!==(j=(((Rl=(Il=(Pl=$[2].conf)==null?void 0:Pl.hw)==null?void 0:Il.han)==null?void 0:Rl.pullup)??"pullup")+"")&&E(K,j),(!Ye||Oe[0]&4)&&Z!==(Z=(((We=(Fl=$[2].conf)==null?void 0:Fl.hw)==null?void 0:We.ap_btn)??"AP button")+"")&&E(V,Z),(!Ye||Oe[0]&4096)&&u(B,"max",$[12]),Oe[0]&64&&Fe(B.value)!==$[6].i.a&&H(B,$[6].i.a),(!Ye||Oe[0]&4)&&te!==(te=(((Ul=(Bl=(kt=$[2].conf)==null?void 0:kt.hw)==null?void 0:Bl.led)==null?void 0:Ul.title)??"LED")+"")&&E(Q,te),(!Ye||Oe[0]&4096)&&u(le,"max",$[12]),Oe[0]&64&&Fe(le.value)!==$[6].i.l.p&&H(le,$[6].i.l.p),Oe[0]&64&&(oe.checked=$[6].i.l.i),(!Ye||Oe[0]&4)&&we!==(we=(((zl=(Hl=(jl=$[2].conf)==null?void 0:jl.hw)==null?void 0:Hl.led)==null?void 0:zl.inverted)??"inverted")+"")&&E(C,we),(!Ye||Oe[0]&4)&&D!==(D=(((Gl=(Wl=(yl=$[2].conf)==null?void 0:yl.hw)==null?void 0:Wl.led)==null?void 0:Gl.rgb)??"RGB")+"")&&E(z,D),Oe[0]&64&&(ae.checked=$[6].i.r.i),(!Ye||Oe[0]&4)&&he!==(he=(((Ue=(Kl=(Vl=$[2].conf)==null?void 0:Vl.hw)==null?void 0:Kl.led)==null?void 0:Ue.inverted)??"inverted")+"")&&E(J,he),(!Ye||Oe[0]&4096)&&u(Te,"max",$[12]),Oe[0]&64&&Fe(Te.value)!==$[6].i.r.r&&H(Te,$[6].i.r.r),(!Ye||Oe[0]&4096)&&u(Le,"max",$[12]),Oe[0]&64&&Fe(Le.value)!==$[6].i.r.g&&H(Le,$[6].i.r.g),(!Ye||Oe[0]&4096)&&u(Ie,"max",$[12]),Oe[0]&64&&Fe(Ie.value)!==$[6].i.r.b&&H(Ie,$[6].i.r.b),(!Ye||Oe[0]&4)&&ut!==(ut=(((Yl=(ll=(Et=$[2].conf)==null?void 0:Et.hw)==null?void 0:ll.led)==null?void 0:Yl.disable)??"LED dis. GPIO")+"")&&E(Ct,ut),(!Ye||Oe[0]&4096)&&u(rt,"max",$[12]),Oe[0]&64&&Fe(rt.value)!==$[6].i.d.d&&H(rt,$[6].i.d.d),(!Ye||Oe[0]&4)&&Ot!==(Ot=(((Xl=(Ql=$[2].conf)==null?void 0:Ql.hw)==null?void 0:Xl.temp)??"Temperature")+"")&&E($e,Ot),(!Ye||Oe[0]&4096)&&u(tt,"max",$[12]),Oe[0]&64&&Fe(tt.value)!==$[6].i.t.d&&H(tt,$[6].i.t.d),(!Ye||Oe[0]&4)&&Ge!==(Ge=(((Jl=(Zl=$[2].conf)==null?void 0:Zl.hw)==null?void 0:Jl.temp_analog)??"Analog temp")+"")&&E(ce,Ge),(!Ye||Oe[0]&4096)&&u(ye,"max",$[12]),Oe[0]&64&&Fe(ye.value)!==$[6].i.t.a&&H(ye,$[6].i.t.a),$[0].chip!="esp8266"?_t?_t.p($,Oe):(_t=ja($),_t.c(),_t.m(q,gt)):_t&&(_t.d(1),_t=null),((en=(xl=($l=$[6])==null?void 0:$l.i)==null?void 0:xl.v)==null?void 0:en.p)>0?lt?lt.p($,Oe):(lt=Ha($),lt.c(),lt.m(q,null)):lt&&(lt.d(1),lt=null)},i($){Ye||(X(m.$$.fragment,$),X(L.$$.fragment,$),Ye=!0)},o($){ee(m.$$.fragment,$),ee(L.$$.fragment,$),Ye=!1},d($){$&&(P(e),P(l),P(n),P(G),P(q)),Pe(m),Pe(L),_t&&_t.d(),lt&<.d(),Mt=!1,zt(ot)}}}function ja(t){var c,m,_;let e,l=(((_=(m=(c=t[2].conf)==null?void 0:c.hw)==null?void 0:m.vcc)==null?void 0:_.title)??"Vcc")+"",n,i,o,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),o=h(),a=p("input"),u(a,"name","ivp"),u(a,"type","number"),u(a,"min","0"),u(a,"max",t[12]),u(a,"class","in-s tr w-full"),u(e,"class","my-1 pl-1 w-1/3")},m(d,v){N(d,e,v),s(e,n),s(e,i),s(e,o),s(e,a),H(a,t[6].i.v.p),r||(f=re(a,"input",t[111]),r=!0)},p(d,v){var g,b,k;v[0]&4&&l!==(l=(((k=(b=(g=d[2].conf)==null?void 0:g.hw)==null?void 0:b.vcc)==null?void 0:k.title)??"Vcc")+"")&&E(n,l),v[0]&4096&&u(a,"max",d[12]),v[0]&64&&Fe(a.value)!==d[6].i.v.p&&H(a,d[6].i.v.p)},d(d){d&&P(e),r=!1,f()}}}function Ha(t){var g,b,k;let e,l=(((k=(b=(g=t[2].conf)==null?void 0:g.hw)==null?void 0:b.vcc)==null?void 0:k.divider)??"Voltage divider")+"",n,i,o,a,r,f,c,m,_,d,v;return{c(){var M,L,R,F,T,A;e=p("div"),n=S(l),i=p("br"),o=h(),a=p("div"),r=p("input"),c=h(),m=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=((R=(L=(M=t[2].conf)==null?void 0:M.hw)==null?void 0:L.vcc)==null?void 0:R.div_vcc)??"VCC"),u(m,"name","ivdg"),u(m,"type","number"),u(m,"min","0"),u(m,"max","65535"),u(m,"class","in-l tr w-full"),u(m,"placeholder",_=((A=(T=(F=t[2].conf)==null?void 0:F.hw)==null?void 0:T.vcc)==null?void 0:A.div_gnd)??"GND"),u(a,"class","flex"),u(e,"class","my-1")},m(M,L){N(M,e,L),s(e,n),s(e,i),s(e,o),s(e,a),s(a,r),H(r,t[6].i.v.d.v),s(a,c),s(a,m),H(m,t[6].i.v.d.g),d||(v=[re(r,"input",t[112]),re(m,"input",t[113])],d=!0)},p(M,L){var R,F,T,A,O,j,K,G,q;L[0]&4&&l!==(l=(((T=(F=(R=M[2].conf)==null?void 0:R.hw)==null?void 0:F.vcc)==null?void 0:T.divider)??"Voltage divider")+"")&&E(n,l),L[0]&4&&f!==(f=((j=(O=(A=M[2].conf)==null?void 0:A.hw)==null?void 0:O.vcc)==null?void 0:j.div_vcc)??"VCC")&&u(r,"placeholder",f),L[0]&64&&Fe(r.value)!==M[6].i.v.d.v&&H(r,M[6].i.v.d.v),L[0]&4&&_!==(_=((q=(G=(K=M[2].conf)==null?void 0:K.hw)==null?void 0:G.vcc)==null?void 0:q.div_gnd)??"GND")&&u(m,"placeholder",_),L[0]&64&&Fe(m.value)!==M[6].i.v.d.g&&H(m,M[6].i.v.d.g)},d(M){M&&P(e),d=!1,zt(v)}}}function za(t){var g,b,k,M,L,R,F,T,A,O,j,K;let e,l=(((M=(k=(b=(g=t[2].conf)==null?void 0:g.hw)==null?void 0:b.led)==null?void 0:k.behaviour)==null?void 0:M.title)??"LED behaviour")+"",n,i,o,a,r=(((T=(F=(R=(L=t[2].conf)==null?void 0:L.hw)==null?void 0:R.led)==null?void 0:F.behaviour)==null?void 0:T.enabled)??"Enabled")+"",f,c,m=(((K=(j=(O=(A=t[2].conf)==null?void 0:A.hw)==null?void 0:O.led)==null?void 0:j.behaviour)==null?void 0:K.disabled)??"Disabled")+"",_,d,v;return{c(){e=p("div"),n=S(l),i=h(),o=p("select"),a=p("option"),f=S(r),c=p("option"),_=S(m),a.__value=0,H(a,a.__value),c.__value=1,H(c,c.__value),u(o,"name","idb"),u(o,"class","in-s"),t[6].i.d.b===void 0&&At(()=>t[114].call(o)),u(e,"class","my-1 w-full")},m(G,q){N(G,e,q),s(e,n),s(e,i),s(e,o),s(o,a),s(a,f),s(o,c),s(c,_),He(o,t[6].i.d.b,!0),d||(v=re(o,"change",t[114]),d=!0)},p(G,q){var U,Z,V,Y,W,B,y,ne,te,Q,se,ue;q[0]&4&&l!==(l=(((Y=(V=(Z=(U=G[2].conf)==null?void 0:U.hw)==null?void 0:Z.led)==null?void 0:V.behaviour)==null?void 0:Y.title)??"LED behaviour")+"")&&E(n,l),q[0]&4&&r!==(r=(((ne=(y=(B=(W=G[2].conf)==null?void 0:W.hw)==null?void 0:B.led)==null?void 0:y.behaviour)==null?void 0:ne.enabled)??"Enabled")+"")&&E(f,r),q[0]&4&&m!==(m=(((ue=(se=(Q=(te=G[2].conf)==null?void 0:te.hw)==null?void 0:Q.led)==null?void 0:se.behaviour)==null?void 0:ue.disabled)??"Disabled")+"")&&E(_,m),q[0]&64&&He(o,G[6].i.d.b)},d(G){G&&P(e),d=!1,v()}}}function ya(t){var T,A,O,j,K,G;let e,l,n,i,o=(((O=(A=(T=t[2].conf)==null?void 0:T.hw)==null?void 0:A.vcc)==null?void 0:O.offset)??"Vcc offset")+"",a,r,f,c,m,_,d=(((G=(K=(j=t[2].conf)==null?void 0:j.hw)==null?void 0:K.vcc)==null?void 0:G.multiplier)??"Multiplier")+"",v,g,b,k,M,L,R,F=(t[0].board==2||t[0].board==100)&&Wa(t);return{c(){e=p("input"),l=h(),n=p("div"),i=p("div"),a=S(o),r=p("br"),f=h(),c=p("input"),m=h(),_=p("div"),v=S(d),g=p("br"),b=h(),k=p("input"),M=h(),F&&F.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(k,"name","ivm"),u(k,"type","number"),u(k,"min","0.1"),u(k,"max","10"),u(k,"step","0.01"),u(k,"class","in-l tr w-full"),u(_,"class","w-1/3 pr-1"),u(n,"class","my-1 flex flex-wrap")},m(q,U){N(q,e,U),N(q,l,U),N(q,n,U),s(n,i),s(i,a),s(i,r),s(i,f),s(i,c),H(c,t[6].i.v.o),s(n,m),s(n,_),s(_,v),s(_,g),s(_,b),s(_,k),H(k,t[6].i.v.m),s(n,M),F&&F.m(n,null),L||(R=[re(c,"input",t[115]),re(k,"input",t[116])],L=!0)},p(q,U){var Z,V,Y,W,B,y;U[0]&4&&o!==(o=(((Y=(V=(Z=q[2].conf)==null?void 0:Z.hw)==null?void 0:V.vcc)==null?void 0:Y.offset)??"Vcc offset")+"")&&E(a,o),U[0]&64&&Fe(c.value)!==q[6].i.v.o&&H(c,q[6].i.v.o),U[0]&4&&d!==(d=(((y=(B=(W=q[2].conf)==null?void 0:W.hw)==null?void 0:B.vcc)==null?void 0:y.multiplier)??"Multiplier")+"")&&E(v,d),U[0]&64&&Fe(k.value)!==q[6].i.v.m&&H(k,q[6].i.v.m),q[0].board==2||q[0].board==100?F?F.p(q,U):(F=Wa(q),F.c(),F.m(n,null)):F&&(F.d(1),F=null)},d(q){q&&(P(e),P(l),P(n)),F&&F.d(),L=!1,zt(R)}}}function Wa(t){var c,m,_;let e,l=(((_=(m=(c=t[2].conf)==null?void 0:c.hw)==null?void 0:m.vcc)==null?void 0:_.boot)??"Boot limit")+"",n,i,o,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),o=h(),a=p("input"),u(a,"name","ivb"),u(a,"type","number"),u(a,"min","2.5"),u(a,"max","3.5"),u(a,"step","0.1"),u(a,"class","in-s tr w-full"),u(e,"class","w-1/3 pl-1")},m(d,v){N(d,e,v),s(e,n),s(e,i),s(e,o),s(e,a),H(a,t[6].i.v.b),r||(f=re(a,"input",t[117]),r=!0)},p(d,v){var g,b,k;v[0]&4&&l!==(l=(((k=(b=(g=d[2].conf)==null?void 0:g.hw)==null?void 0:b.vcc)==null?void 0:k.boot)??"Boot limit")+"")&&E(n,l),v[0]&64&&Fe(a.value)!==d[6].i.v.b&&H(a,d[6].i.v.b)},d(d){d&&P(e),r=!1,f()}}}function Ga(t){var F,T,A,O,j,K;let e,l,n=(((T=(F=t[2].conf)==null?void 0:F.debug)==null?void 0:T.title)??"Debugging")+"",i,o,a,r,f,c,m,_,d,v,g=(((O=(A=t[2].conf)==null?void 0:A.debug)==null?void 0:O.enable)??"Enable debugging")+"",b,k,M,L,R=((K=(j=t[6])==null?void 0:j.d)==null?void 0:K.s)&&Va(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),_=p("label"),d=p("input"),v=h(),b=S(g),k=h(),R&&R.c(),u(l,"class","text-sm"),u(a,"href","https://amsleser.no/blog/post/24-telnet-debug"),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","d"),f.value="true",u(d,"type","checkbox"),u(d,"name","ds"),d.__value="true",H(d,d.__value),u(d,"class","rounded mb-1"),u(m,"class","mt-3"),u(e,"class","cnt")},m(G,q){N(G,e,q),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,_),s(_,d),d.checked=t[6].d.s,s(_,v),s(_,b),s(e,k),R&&R.m(e,null),M||(L=re(d,"change",t[118]),M=!0)},p(G,q){var U,Z,V,Y,W,B;q[0]&4&&n!==(n=(((Z=(U=G[2].conf)==null?void 0:U.debug)==null?void 0:Z.title)??"Debugging")+"")&&E(i,n),q[0]&64&&(d.checked=G[6].d.s),q[0]&4&&g!==(g=(((Y=(V=G[2].conf)==null?void 0:V.debug)==null?void 0:Y.enable)??"Enable debugging")+"")&&E(b,g),(B=(W=G[6])==null?void 0:W.d)!=null&&B.s?R?R.p(G,q):(R=Va(G),R.c(),R.m(e,null)):R&&(R.d(1),R=null)},d(G){G&&P(e),R&&R.d(),M=!1,L()}}}function Va(t){var A,O,j,K;let e,l=(((O=(A=t[2].conf)==null?void 0:A.debug)==null?void 0:O.danger)??"Disable when done")+"",n,i,o,a,r,f,c=(((K=(j=t[2].conf)==null?void 0:j.debug)==null?void 0:K.telnet)??"Enable telnet")+"",m,_,d,v,g,b,k,M,L,R,F,T=t[6].d.t&&Ka(t);return{c(){e=p("div"),n=S(l),i=h(),o=p("div"),a=p("label"),r=p("input"),f=h(),m=S(c),_=h(),T&&T.c(),d=h(),v=p("div"),g=p("select"),b=p("option"),b.textContent="Verbose",k=p("option"),k.textContent="Debug",M=p("option"),M.textContent="Info",L=p("option"),L.textContent="Warning",u(e,"class","bd-red"),u(r,"type","checkbox"),u(r,"name","dt"),r.__value="true",H(r,r.__value),u(r,"class","rounded mb-1"),u(o,"class","my-1"),b.__value=1,H(b,b.__value),k.__value=2,H(k,k.__value),M.__value=3,H(M,M.__value),L.__value=4,H(L,L.__value),u(g,"name","dl"),u(g,"class","in-s"),t[6].d.l===void 0&&At(()=>t[120].call(g)),u(v,"class","my-1")},m(G,q){N(G,e,q),s(e,n),N(G,i,q),N(G,o,q),s(o,a),s(a,r),r.checked=t[6].d.t,s(a,f),s(a,m),N(G,_,q),T&&T.m(G,q),N(G,d,q),N(G,v,q),s(v,g),s(g,b),s(g,k),s(g,M),s(g,L),He(g,t[6].d.l,!0),R||(F=[re(r,"change",t[119]),re(g,"change",t[120])],R=!0)},p(G,q){var U,Z,V,Y;q[0]&4&&l!==(l=(((Z=(U=G[2].conf)==null?void 0:U.debug)==null?void 0:Z.danger)??"Disable when done")+"")&&E(n,l),q[0]&64&&(r.checked=G[6].d.t),q[0]&4&&c!==(c=(((Y=(V=G[2].conf)==null?void 0:V.debug)==null?void 0:Y.telnet)??"Enable telnet")+"")&&E(m,c),G[6].d.t?T?T.p(G,q):(T=Ka(G),T.c(),T.m(d.parentNode,d)):T&&(T.d(1),T=null),q[0]&64&&He(g,G[6].d.l)},d(G){G&&(P(e),P(i),P(o),P(_),P(d),P(v)),T&&T.d(G),R=!1,zt(F)}}}function Ka(t){var i,o;let e,l=(((o=(i=t[2].conf)==null?void 0:i.debug)==null?void 0:o.telnet_danger)??"Disable when done")+"",n;return{c(){e=p("div"),n=S(l),u(e,"class","bd-red")},m(a,r){N(a,e,r),s(e,n)},p(a,r){var f,c;r[0]&4&&l!==(l=(((c=(f=a[2].conf)==null?void 0:f.debug)==null?void 0:c.telnet_danger)??"Disable when done")+"")&&E(n,l)},d(a){a&&P(e)}}}function Ya(t){var d,v;let e,l,n=(((d=t[2].conf)==null?void 0:d.btn_reset)??"Factory reset")+"",i,o,a,r,f=(((v=t[2].btn)==null?void 0:v.reboot)??"Reboot")+"",c,m,_;return{c(){e=p("div"),l=p("button"),i=S(n),o=h(),a=p("div"),r=p("button"),c=S(f),u(l,"type","button"),u(l,"class","btn-red"),u(r,"type","button"),u(r,"class","btn-yellow"),u(a,"class","text-center")},m(g,b){N(g,e,b),s(e,l),s(l,i),N(g,o,b),N(g,a,b),s(a,r),s(r,c),m||(_=[re(l,"click",t[14]),re(r,"click",t[16])],m=!0)},p(g,b){var k,M;b[0]&4&&n!==(n=(((k=g[2].conf)==null?void 0:k.btn_reset)??"Factory reset")+"")&&E(i,n),b[0]&4&&f!==(f=(((M=g[2].btn)==null?void 0:M.reboot)??"Reboot")+"")&&E(c,f)},d(g){g&&(P(e),P(o),P(a)),m=!1,zt(_)}}}function Qa(t){var o;let e,l,n=(((o=t[2].btn)==null?void 0:o.save)??"Save")+"",i;return{c(){e=p("div"),l=p("button"),i=S(n),u(l,"type","submit"),u(l,"class","btn-pri"),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,l),s(l,i)},p(a,r){var f;r[0]&4&&n!==(n=(((f=a[2].btn)==null?void 0:f.save)??"Save")+"")&&E(i,n)},d(a){a&&P(e)}}}function G0(t){var me,oe,pe,we,C,w,I,D,z,x,ae,_e,he,J,ve,ke,De,Te,Ae,Le,Ee,Ie,Je,wt,et,ut,Ct,ht,rt,it,vt,Ot,$e,Re,Be,tt,ge,qe,Ge;let e,l,n,i,o,a,r,f,c,m,_=((pe=(oe=(me=t[6])==null?void 0:me.p)==null?void 0:oe.r)==null?void 0:pe.startsWith("NO"))||((w=(C=(we=t[6])==null?void 0:we.p)==null?void 0:C.r)==null?void 0:w.startsWith("10YNO"))||((z=(D=(I=t[6])==null?void 0:I.p)==null?void 0:D.r)==null?void 0:z.startsWith("10Y1001A1001A4")),d,v,g,b=((x=t[6])==null?void 0:x.d)&&((_e=(ae=t[0])==null?void 0:ae.features)==null?void 0:_e.includes("rdebug")),k,M,L,R,F,T,A,O,j,K,G,q,U,Z,V=((he=t[6])==null?void 0:he.g)&&na(t),Y=((J=t[6])==null?void 0:J.m)&&aa(t),W=((ve=t[6])==null?void 0:ve.w)&&_a(t),B=((ke=t[6])==null?void 0:ke.n)&&ba(t),y=((De=t[6])==null?void 0:De.q)&&ka(t),ne=((Ae=(Te=t[6])==null?void 0:Te.q)==null?void 0:Ae.m)==3&&Sa(t),te=((Ee=(Le=t[6])==null?void 0:Le.q)==null?void 0:Ee.m)==4&&Ma(t),Q=((Ie=t[6])==null?void 0:Ie.c)&&Pa(t),se=_&&Oa(t),ue=((Je=t[6])==null?void 0:Je.u)&&Ia(t),fe=((et=(wt=t[6])==null?void 0:wt.i)==null?void 0:et.h)&&(((ut=t[0])==null?void 0:ut.board)>20||((Ct=t[0])==null?void 0:Ct.chip)=="esp8266"||((it=(rt=(ht=t[6])==null?void 0:ht.i)==null?void 0:rt.d)==null?void 0:it.d)>0)&&Ba(t),le=b&&Ga(t),de=((vt=t[1])==null?void 0:vt.a)&&Ya(t),ie=t[6]&&Qa(t);return F=new cl({props:{active:t[3],message:(($e=(Ot=t[2].conf)==null?void 0:Ot.mask)==null?void 0:$e.loading)??"Loading"}}),A=new cl({props:{active:t[4],message:((Be=(Re=t[2].conf)==null?void 0:Re.mask)==null?void 0:Be.saving)??"Saving"}}),j=new cl({props:{active:t[10],message:((ge=(tt=t[2].conf)==null?void 0:tt.mask)==null?void 0:ge.reset)??"Factory reset"}}),G=new cl({props:{active:t[11],message:((Ge=(qe=t[2].conf)==null?void 0:qe.mask)==null?void 0:Ge.reset_done)??"Done"}}),{c(){e=p("form"),l=p("div"),V&&V.c(),n=h(),Y&&Y.c(),i=h(),W&&W.c(),o=h(),B&&B.c(),a=h(),y&&y.c(),r=h(),ne&&ne.c(),f=h(),te&&te.c(),c=h(),Q&&Q.c(),m=h(),se&&se.c(),d=h(),ue&&ue.c(),v=h(),fe&&fe.c(),g=h(),le&&le.c(),k=h(),M=p("div"),de&&de.c(),L=h(),ie&&ie.c(),R=h(),Ne(F.$$.fragment),T=h(),Ne(A.$$.fragment),O=h(),Ne(j.$$.fragment),K=h(),Ne(G.$$.fragment),u(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),u(M,"class","grid grid-cols-3 mt-3"),u(e,"autocomplete","off")},m(ce,Ce){N(ce,e,Ce),s(e,l),V&&V.m(l,null),s(l,n),Y&&Y.m(l,null),s(l,i),W&&W.m(l,null),s(l,o),B&&B.m(l,null),s(l,a),y&&y.m(l,null),s(l,r),ne&&ne.m(l,null),s(l,f),te&&te.m(l,null),s(l,c),Q&&Q.m(l,null),s(l,m),se&&se.m(l,null),s(l,d),ue&&ue.m(l,null),s(l,v),fe&&fe.m(l,null),s(l,g),le&&le.m(l,null),s(e,k),s(e,M),de&&de.m(M,null),s(M,L),ie&&ie.m(M,null),N(ce,R,Ce),Me(F,ce,Ce),N(ce,T,Ce),Me(A,ce,Ce),N(ce,O,Ce),Me(j,ce,Ce),N(ce,K,Ce),Me(G,ce,Ce),q=!0,U||(Z=re(e,"submit",mn(t[15])),U=!0)},p(ce,Ce){var Ye,Mt,ot,_t,lt,Bt,Xt,ct,at,Gt,Jt,Tt,Yt,xt,$t,Vt,It,Ve,Qe,Xe,qt,Ut,dt,st,bt,Rt,be,nt,je,yt,al,nl,fl,il,jt,Ht,Ke,Se,$;(Ye=ce[6])!=null&&Ye.g?V?(V.p(ce,Ce),Ce[0]&64&&X(V,1)):(V=na(ce),V.c(),X(V,1),V.m(l,n)):V&&(mt(),ee(V,1,1,()=>{V=null}),pt()),(Mt=ce[6])!=null&&Mt.m?Y?Y.p(ce,Ce):(Y=aa(ce),Y.c(),Y.m(l,i)):Y&&(Y.d(1),Y=null),(ot=ce[6])!=null&&ot.w?W?W.p(ce,Ce):(W=_a(ce),W.c(),W.m(l,o)):W&&(W.d(1),W=null),(_t=ce[6])!=null&&_t.n?B?(B.p(ce,Ce),Ce[0]&64&&X(B,1)):(B=ba(ce),B.c(),X(B,1),B.m(l,a)):B&&(mt(),ee(B,1,1,()=>{B=null}),pt()),(lt=ce[6])!=null&<.q?y?(y.p(ce,Ce),Ce[0]&64&&X(y,1)):(y=ka(ce),y.c(),X(y,1),y.m(l,r)):y&&(mt(),ee(y,1,1,()=>{y=null}),pt()),((Xt=(Bt=ce[6])==null?void 0:Bt.q)==null?void 0:Xt.m)==3?ne?ne.p(ce,Ce):(ne=Sa(ce),ne.c(),ne.m(l,f)):ne&&(ne.d(1),ne=null),((at=(ct=ce[6])==null?void 0:ct.q)==null?void 0:at.m)==4?te?te.p(ce,Ce):(te=Ma(ce),te.c(),te.m(l,c)):te&&(te.d(1),te=null),(Gt=ce[6])!=null&&Gt.c?Q?(Q.p(ce,Ce),Ce[0]&64&&X(Q,1)):(Q=Pa(ce),Q.c(),X(Q,1),Q.m(l,m)):Q&&(mt(),ee(Q,1,1,()=>{Q=null}),pt()),Ce[0]&64&&(_=((Yt=(Tt=(Jt=ce[6])==null?void 0:Jt.p)==null?void 0:Tt.r)==null?void 0:Yt.startsWith("NO"))||((Vt=($t=(xt=ce[6])==null?void 0:xt.p)==null?void 0:$t.r)==null?void 0:Vt.startsWith("10YNO"))||((Qe=(Ve=(It=ce[6])==null?void 0:It.p)==null?void 0:Ve.r)==null?void 0:Qe.startsWith("10Y1001A1001A4"))),_?se?se.p(ce,Ce):(se=Oa(ce),se.c(),se.m(l,d)):se&&(se.d(1),se=null),(Xe=ce[6])!=null&&Xe.u?ue?ue.p(ce,Ce):(ue=Ia(ce),ue.c(),ue.m(l,v)):ue&&(ue.d(1),ue=null),(Ut=(qt=ce[6])==null?void 0:qt.i)!=null&&Ut.h&&(((dt=ce[0])==null?void 0:dt.board)>20||((st=ce[0])==null?void 0:st.chip)=="esp8266"||((be=(Rt=(bt=ce[6])==null?void 0:bt.i)==null?void 0:Rt.d)==null?void 0:be.d)>0)?fe?(fe.p(ce,Ce),Ce[0]&65&&X(fe,1)):(fe=Ba(ce),fe.c(),X(fe,1),fe.m(l,g)):fe&&(mt(),ee(fe,1,1,()=>{fe=null}),pt()),Ce[0]&65&&(b=((nt=ce[6])==null?void 0:nt.d)&&((yt=(je=ce[0])==null?void 0:je.features)==null?void 0:yt.includes("rdebug"))),b?le?le.p(ce,Ce):(le=Ga(ce),le.c(),le.m(l,null)):le&&(le.d(1),le=null),(al=ce[1])!=null&&al.a?de?de.p(ce,Ce):(de=Ya(ce),de.c(),de.m(M,L)):de&&(de.d(1),de=null),ce[6]?ie?ie.p(ce,Ce):(ie=Qa(ce),ie.c(),ie.m(M,null)):ie&&(ie.d(1),ie=null);const xe={};Ce[0]&8&&(xe.active=ce[3]),Ce[0]&4&&(xe.message=((fl=(nl=ce[2].conf)==null?void 0:nl.mask)==null?void 0:fl.loading)??"Loading"),F.$set(xe);const ye={};Ce[0]&16&&(ye.active=ce[4]),Ce[0]&4&&(ye.message=((jt=(il=ce[2].conf)==null?void 0:il.mask)==null?void 0:jt.saving)??"Saving"),A.$set(ye);const Lt={};Ce[0]&1024&&(Lt.active=ce[10]),Ce[0]&4&&(Lt.message=((Ke=(Ht=ce[2].conf)==null?void 0:Ht.mask)==null?void 0:Ke.reset)??"Factory reset"),j.$set(Lt);const gt={};Ce[0]&2048&&(gt.active=ce[11]),Ce[0]&4&&(gt.message=(($=(Se=ce[2].conf)==null?void 0:Se.mask)==null?void 0:$.reset_done)??"Done"),G.$set(gt)},i(ce){q||(X(V),X(B),X(y),X(Q),X(fe),X(F.$$.fragment,ce),X(A.$$.fragment,ce),X(j.$$.fragment,ce),X(G.$$.fragment,ce),q=!0)},o(ce){ee(V),ee(B),ee(y),ee(Q),ee(fe),ee(F.$$.fragment,ce),ee(A.$$.fragment,ce),ee(j.$$.fragment,ce),ee(G.$$.fragment,ce),q=!1},d(ce){ce&&(P(e),P(R),P(T),P(O),P(K)),V&&V.d(),Y&&Y.d(),W&&W.d(),B&&B.d(),y&&y.d(),ne&&ne.d(),te&&te.d(),Q&&Q.d(),se&&se.d(),ue&&ue.d(),fe&&fe.d(),le&&le.d(),de&&de.d(),ie&&ie.d(),Pe(F,ce),Pe(A,ce),Pe(j,ce),Pe(G,ce),U=!1,Z()}}}async function V0(){await(await fetch("reboot",{method:"POST"})).json()}function K0(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,{data:o}=e,a={};kl.subscribe(Ke=>{l(2,a=Ke)});let r=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Per phase",key:"h"},{name:"Power factor",key:"f"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Realtime plot",key:"l"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"},{name:"Dark mode",key:"k"}],f=!0,c=!1,m=!1,_,d=[];Bn.subscribe(Ke=>{var Se,$,Oe;Ke.version&&(l(5,m=(Se=Ke==null?void 0:Ke.c)==null?void 0:Se.e),l(6,_=Ke),l(3,f=!1),l(7,d=[{code:"en",name:"English"}]),($=_==null?void 0:_.u)!=null&&$.lang&&_.u.lang!="en"&&d.push({code:_.u.lang,name:((Oe=a.language)==null?void 0:Oe.name)??"Unknown"}),d.push({code:"hub",name:"Load from server"}))}),i0();let v=!0,g={};$i.subscribe(Ke=>{var Se;l(8,v=!0);for(let $=0;$(tl.hostname=Se.get("gh"),tl.usrcfg=ul.success,tl.booting=ul.reboot,Se.get("nm")=="static"&&(tl.net.ip=Se.get("ni"),tl.net.mask=Se.get("nu"),tl.net.gw=Se.get("ng"),tl.net.dns1=Se.get("nd")),tl.ui=_.u,tl)),l(4,c=!1),nn(n)}const R=function(){confirm("Reboot?")&&(_l.update(Ke=>(Ke.booting=!0,Ke)),V0())};async function F(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),Bn.update(Se=>(Se.q.s.c=!1,Se)))}async function T(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),Bn.update(Se=>(Se.q.s.r=!1,Se)))}async function A(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),Bn.update(Se=>(Se.q.s.k=!1,Se)))}const O=function(){_.q.s.e?_.q.p==1883&&l(6,_.q.p=8883,_):_.q.p==8883&&l(6,_.q.p=1883,_)};async function j(){if(_.u.lang=="hub"){const Ke=await vl("http://hub.amsleser.no/hub/language/list.json");l(7,d=await Ke.json()),l(6,_.u.lang=a.language.code,_)}}let K=44;async function G(){const Ke=await vl("cloudkey.json");if(Ke.status==200){let Se=await Ke.json();window.open("https://www.amsleser.cloud/device/"+Se.seed)}else alert("Not able to bind to cloud")}const q=window||global;q.bindToCloud=function(){console.log("BIND CALLED")};function U(){_.g.h=this.value,l(6,_)}function Z(){_.g.t=Kt(this),l(6,_)}function V(){_.p.r=Kt(this),l(6,_)}function Y(){_.p.m=Kt(this),l(6,_)}function W(){_.p.c=Kt(this),l(6,_)}function B(){_.p.e=this.checked,l(6,_)}function y(){_.p.t=this.value,l(6,_)}function ne(){_.g.s=Kt(this),l(6,_)}function te(){_.g.u=this.value,l(6,_)}function Q(){_.g.p=this.value,l(6,_)}function se(){_.g.c=this.value,l(6,_)}function ue(){_.m.a=Kt(this),l(6,_)}function fe(){_.m.b=Fe(this.value),l(6,_)}function le(){_.m.i=this.checked,l(6,_)}function de(){_.m.b=Kt(this),l(6,_)}function ie(){_.m.p=Kt(this),l(6,_)}function me(){_.m.s=Fe(this.value),l(6,_)}function oe(){_.m.d=Kt(this),l(6,_)}function pe(){_.m.f=Fe(this.value),l(6,_)}function we(){_.m.r=Fe(this.value),l(6,_)}function C(){_.m.e.e=this.checked,l(6,_)}function w(){_.m.e.k=this.value,l(6,_)}function I(){_.m.e.a=this.value,l(6,_)}function D(){_.m.m.e=this.checked,l(6,_)}function z(){_.m.m.w=Fe(this.value),l(6,_)}function x(){_.m.m.v=Fe(this.value),l(6,_)}function ae(){_.m.m.a=Fe(this.value),l(6,_)}function _e(){_.m.m.c=Fe(this.value),l(6,_)}function he(){_.n.c=Kt(this),l(6,_)}function J(){v=this.checked,l(8,v)}function ve(){_.w.s=this.value,l(6,_)}function ke(){_.w.s=Kt(this),l(6,_)}function De(){_.w.p=this.value,l(6,_)}function Te(){_.w.z=Kt(this),l(6,_)}function Ae(){_.w.w=Fe(this.value),l(6,_)}function Le(){_.w.b=this.checked,l(6,_)}function Ee(){_.n.m=Kt(this),l(6,_)}function Ie(){_.n.i=this.value,l(6,_)}function Je(){_.n.s=Kt(this),l(6,_)}function wt(){_.n.g=this.value,l(6,_)}function et(){_.n.d1=this.value,l(6,_)}function ut(){_.n.d2=this.value,l(6,_)}function Ct(){_.n.x=this.checked,l(6,_)}function ht(){_.n.d=this.checked,l(6,_)}function rt(){_.n.h=this.checked,l(6,_)}function it(){_.n.n1=this.value,l(6,_)}function vt(){_.q.s.e=this.checked,l(6,_)}function Ot(){_.q.h=this.value,l(6,_)}function $e(){_.q.p=Fe(this.value),l(6,_)}function Re(){_.q.u=this.value,l(6,_)}function Be(){_.q.a=this.value,l(6,_)}function tt(){_.q.c=this.value,l(6,_)}function ge(){_.q.m=Kt(this),l(6,_)}function qe(){_.q.b=this.value,l(6,_)}function Ge(){_.q.r=this.value,l(6,_)}function ce(){_.q.t=Kt(this),l(6,_)}function Ce(){_.q.d=Fe(this.value),l(6,_)}function xe(){_.q.i=Fe(this.value),l(6,_)}function ye(){_.q.k=Fe(this.value),l(6,_)}function Lt(){_.o.e=this.value,l(6,_)}function gt(){_.o.c=this.value,l(6,_)}function Ye(){_.o.u1=this.value,l(6,_)}function Mt(){_.o.u2=this.value,l(6,_)}function ot(){_.o.u3=this.value,l(6,_)}function _t(){_.h.t=this.value,l(6,_)}function lt(){_.h.h=this.value,l(6,_)}function Bt(){_.h.n=this.value,l(6,_)}function Xt(){_.c.e=this.checked,l(6,_)}function ct(){_.c.p=Kt(this),l(6,_)}function at(){_.c.es=this.checked,l(6,_)}function Gt(Ke){_.t.t[Ke]=Fe(this.value),l(6,_)}function Jt(){_.t.h=Fe(this.value),l(6,_)}function Tt(Ke){_.u[Ke.key]=Kt(this),l(6,_)}function Yt(){_.u.lang=Kt(this),l(6,_)}function xt(){_.i.h.p=Kt(this),l(6,_)}function $t(){_.i.h.t=Kt(this),l(6,_)}function Vt(){_.i.h.u=this.checked,l(6,_)}function It(){_.i.a=Fe(this.value),l(6,_)}function Ve(){_.i.l.p=Fe(this.value),l(6,_)}function Qe(){_.i.l.i=this.checked,l(6,_)}function Xe(){_.i.r.i=this.checked,l(6,_)}function qt(){_.i.r.r=Fe(this.value),l(6,_)}function Ut(){_.i.r.g=Fe(this.value),l(6,_)}function dt(){_.i.r.b=Fe(this.value),l(6,_)}function st(){_.i.d.d=Fe(this.value),l(6,_)}function bt(){_.i.t.d=Fe(this.value),l(6,_)}function Rt(){_.i.t.a=Fe(this.value),l(6,_)}function be(){_.i.v.p=Fe(this.value),l(6,_)}function nt(){_.i.v.d.v=Fe(this.value),l(6,_)}function je(){_.i.v.d.g=Fe(this.value),l(6,_)}function yt(){_.i.d.b=Kt(this),l(6,_)}function al(){_.i.v.o=Fe(this.value),l(6,_)}function nl(){_.i.v.m=Fe(this.value),l(6,_)}function fl(){_.i.v.b=Fe(this.value),l(6,_)}function il(){_.d.s=this.checked,l(6,_)}function jt(){_.d.t=this.checked,l(6,_)}function Ht(){_.d.l=Kt(this),l(6,_)}return t.$$set=Ke=>{"basepath"in Ke&&l(23,n=Ke.basepath),"sysinfo"in Ke&&l(0,i=Ke.sysinfo),"data"in Ke&&l(1,o=Ke.data)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(12,K=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39)},[i,o,a,f,c,m,_,d,v,g,b,k,K,r,M,L,R,F,T,A,O,j,G,n,U,Z,V,Y,W,B,y,ne,te,Q,se,ue,fe,le,de,ie,me,oe,pe,we,C,w,I,D,z,x,ae,_e,he,J,ve,ke,De,Te,Ae,Le,Ee,Ie,Je,wt,et,ut,Ct,ht,rt,it,vt,Ot,$e,Re,Be,tt,ge,qe,Ge,ce,Ce,xe,ye,Lt,gt,Ye,Mt,ot,_t,lt,Bt,Xt,ct,at,Gt,Jt,Tt,Yt,xt,$t,Vt,It,Ve,Qe,Xe,qt,Ut,dt,st,bt,Rt,be,nt,je,yt,al,nl,fl,il,jt,Ht]}class Y0 extends Nt{constructor(e){super(),Pt(this,e,K0,G0,St,{basepath:23,sysinfo:0,data:1},null,[-1,-1,-1,-1,-1])}}function Xa(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=S("("),n=S(l),i=S("MHz)")},m(o,a){N(o,e,a),N(o,n,a),N(o,i,a)},p(o,a){a&2&&l!==(l=o[1].cpu+"")&&E(n,l)},d(o){o&&(P(e),P(n),P(i))}}}function Q0(t){let e=Ze(t[1].chip,t[1].board)+"",l;return{c(){l=S(e)},m(n,i){N(n,l,i)},p(n,i){i&2&&e!==(e=Ze(n[1].chip,n[1].board)+"")&&E(l,e)},d(n){n&&P(l)}}}function Ja(t){var W,B,y,ne,te,Q,se,ue;let e,l=(((B=(W=t[3].status)==null?void 0:W.device)==null?void 0:B.apmac)??"AP MAC")+"",n,i,o=t[1].apmac+"",a,r,f,c=(((ne=(y=t[3].status)==null?void 0:y.device)==null?void 0:ne.last_boot)??"Last boot")+"",m,_,d,v,g,b,k=(((Q=(te=t[3].status)==null?void 0:te.device)==null?void 0:Q.reason)??"Reason")+"",M,L,R=(((ue=(se=t[3][Do(t[1].chip)])==null?void 0:se.reason)==null?void 0:ue[t[1].boot_reason])??t[1].boot_reason)+"",F,T,A=t[1].boot_reason+"",O,j,K=t[1].ex_cause+"",G,q,U;const Z=[Z0,X0],V=[];function Y(fe,le){return fe[0].u>0?0:1}return d=Y(t),v=V[d]=Z[d](t),{c(){e=p("div"),n=S(l),i=S(": "),a=S(o),r=h(),f=p("div"),m=S(c),_=S(`: - `),v.c(),g=h(),b=p("div"),M=S(k),L=S(": "),F=S(R),T=S(" ("),O=S(A),j=S("/"),G=S(K),q=S(")"),u(e,"class","my-2"),u(f,"class","my-2"),u(b,"class","my-2")},m(fe,le){N(fe,e,le),s(e,n),s(e,i),s(e,a),N(fe,r,le),N(fe,f,le),s(f,m),s(f,_),V[d].m(f,null),N(fe,g,le),N(fe,b,le),s(b,M),s(b,L),s(b,F),s(b,T),s(b,O),s(b,j),s(b,G),s(b,q),U=!0},p(fe,le){var ie,me,oe,pe,we,C,w,I;(!U||le&8)&&l!==(l=(((me=(ie=fe[3].status)==null?void 0:ie.device)==null?void 0:me.apmac)??"AP MAC")+"")&&E(n,l),(!U||le&2)&&o!==(o=fe[1].apmac+"")&&E(a,o),(!U||le&8)&&c!==(c=(((pe=(oe=fe[3].status)==null?void 0:oe.device)==null?void 0:pe.last_boot)??"Last boot")+"")&&E(m,c);let de=d;d=Y(fe),d===de?V[d].p(fe,le):(mt(),ee(V[de],1,1,()=>{V[de]=null}),pt(),v=V[d],v?v.p(fe,le):(v=V[d]=Z[d](fe),v.c()),X(v,1),v.m(f,null)),(!U||le&8)&&k!==(k=(((C=(we=fe[3].status)==null?void 0:we.device)==null?void 0:C.reason)??"Reason")+"")&&E(M,k),(!U||le&10)&&R!==(R=(((I=(w=fe[3][Do(fe[1].chip)])==null?void 0:w.reason)==null?void 0:I[fe[1].boot_reason])??fe[1].boot_reason)+"")&&E(F,R),(!U||le&2)&&A!==(A=fe[1].boot_reason+"")&&E(O,A),(!U||le&2)&&K!==(K=fe[1].ex_cause+"")&&E(G,K)},i(fe){U||(X(v),U=!0)},o(fe){ee(v),U=!1},d(fe){fe&&(P(e),P(r),P(f),P(g),P(b)),V[d].d()}}}function X0(t){let e;return{c(){e=S("-")},m(l,n){N(l,e,n)},p:ze,i:ze,o:ze,d(l){l&&P(e)}}}function Z0(t){let e,l;return e=new Wu({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:"",offset:t[1].clock_offset}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),i&2&&(o.offset=n[1].clock_offset),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function $a(t){var m;let e,l,n,i,o=(((m=t[3].btn)==null?void 0:m.reboot)??"Reboot")+"",a,r,f,c;return l=new hl({props:{to:"/consent",$$slots:{default:[J0]},$$scope:{ctx:t}}}),{c(){e=p("div"),Ne(l.$$.fragment),n=h(),i=p("button"),a=S(o),u(i,"class","btn-yellow-sm float-right"),u(e,"class","my-2")},m(_,d){N(_,e,d),Me(l,e,null),s(e,n),s(e,i),s(i,a),r=!0,f||(c=re(i,"click",t[11]),f=!0)},p(_,d){var g;const v={};d&16777224&&(v.$$scope={dirty:d,ctx:_}),l.$set(v),(!r||d&8)&&o!==(o=(((g=_[3].btn)==null?void 0:g.reboot)??"Reboot")+"")&&E(a,o)},i(_){r||(X(l.$$.fragment,_),r=!0)},o(_){ee(l.$$.fragment,_),r=!1},d(_){_&&P(e),Pe(l),f=!1,c()}}}function J0(t){var i,o;let e,l=(((o=(i=t[3].status)==null?void 0:i.device)==null?void 0:o.btn_consents)??"Consents")+"",n;return{c(){e=p("span"),n=S(l),u(e,"class","btn-pri-sm")},m(a,r){N(a,e,r),s(e,n)},p(a,r){var f,c;r&8&&l!==(l=(((c=(f=a[3].status)==null?void 0:f.device)==null?void 0:c.btn_consents)??"Consents")+"")&&E(n,l)},d(a){a&&P(e)}}}function xa(t){var G,q,U,Z,V,Y,W,B;let e,l,n=(((q=(G=t[3].status)==null?void 0:G.meter)==null?void 0:q.title)??"Meter")+"",i,o,a,r=(((Z=(U=t[3].status)==null?void 0:U.meter)==null?void 0:Z.manufacturer)??"Manufacturer")+"",f,c,m=ri(t[1].meter.mfg)+"",_,d,v,g=(((Y=(V=t[3].status)==null?void 0:V.meter)==null?void 0:Y.model)??"Model")+"",b,k,M=(t[1].meter.model?t[1].meter.model:"unknown")+"",L,R,F,T=(((B=(W=t[3].status)==null?void 0:W.meter)==null?void 0:B.id)??"ID")+"",A,O,j=(t[1].meter.id?t[1].meter.id:"unknown")+"",K;return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("div"),f=S(r),c=S(": "),_=S(m),d=h(),v=p("div"),b=S(g),k=S(": "),L=S(M),R=h(),F=p("div"),A=S(T),O=S(": "),K=S(j),u(l,"class","text-sm"),u(a,"class","my-2"),u(v,"class","my-2"),u(F,"class","my-2"),u(e,"class","cnt")},m(y,ne){N(y,e,ne),s(e,l),s(l,i),s(e,o),s(e,a),s(a,f),s(a,c),s(a,_),s(e,d),s(e,v),s(v,b),s(v,k),s(v,L),s(e,R),s(e,F),s(F,A),s(F,O),s(F,K)},p(y,ne){var te,Q,se,ue,fe,le,de,ie;ne&8&&n!==(n=(((Q=(te=y[3].status)==null?void 0:te.meter)==null?void 0:Q.title)??"Meter")+"")&&E(i,n),ne&8&&r!==(r=(((ue=(se=y[3].status)==null?void 0:se.meter)==null?void 0:ue.manufacturer)??"Manufacturer")+"")&&E(f,r),ne&2&&m!==(m=ri(y[1].meter.mfg)+"")&&E(_,m),ne&8&&g!==(g=(((le=(fe=y[3].status)==null?void 0:fe.meter)==null?void 0:le.model)??"Model")+"")&&E(b,g),ne&2&&M!==(M=(y[1].meter.model?y[1].meter.model:"unknown")+"")&&E(L,M),ne&8&&T!==(T=(((ie=(de=y[3].status)==null?void 0:de.meter)==null?void 0:ie.id)??"ID")+"")&&E(A,T),ne&2&&j!==(j=(y[1].meter.id?y[1].meter.id:"unknown")+"")&&E(K,j)},d(y){y&&P(e)}}}function ef(t){var B,y,ne,te,Q,se,ue,fe;let e,l,n=(((y=(B=t[3].status)==null?void 0:B.network)==null?void 0:y.title)??"Network")+"",i,o,a,r=(((te=(ne=t[3].conf)==null?void 0:ne.network)==null?void 0:te.ip)??"IP")+"",f,c,m=t[1].net.ip+"",_,d,v,g=(((se=(Q=t[3].conf)==null?void 0:Q.network)==null?void 0:se.mask)??"Mask")+"",b,k,M=t[1].net.mask+"",L,R,F,T=(((fe=(ue=t[3].conf)==null?void 0:ue.network)==null?void 0:fe.gw)??"Gateway")+"",A,O,j=t[1].net.gw+"",K,G,q,U,Z,V=t[1].net.dns1&&tf(t),Y=t[1].net.dns2&&lf(t),W=t[1].net.ipv6&&nf(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("div"),f=S(r),c=S(": "),_=S(m),d=h(),v=p("div"),b=S(g),k=S(": "),L=S(M),R=h(),F=p("div"),A=S(T),O=S(": "),K=S(j),G=h(),q=p("div"),V&&V.c(),U=h(),Y&&Y.c(),Z=h(),W&&W.c(),u(l,"class","text-sm"),u(a,"class","my-2"),u(v,"class","my-2"),u(F,"class","my-2"),u(q,"class","my-2"),u(e,"class","cnt")},m(le,de){N(le,e,de),s(e,l),s(l,i),s(e,o),s(e,a),s(a,f),s(a,c),s(a,_),s(e,d),s(e,v),s(v,b),s(v,k),s(v,L),s(e,R),s(e,F),s(F,A),s(F,O),s(F,K),s(e,G),s(e,q),V&&V.m(q,null),s(q,U),Y&&Y.m(q,null),s(e,Z),W&&W.m(e,null)},p(le,de){var ie,me,oe,pe,we,C,w,I;de&8&&n!==(n=(((me=(ie=le[3].status)==null?void 0:ie.network)==null?void 0:me.title)??"Network")+"")&&E(i,n),de&8&&r!==(r=(((pe=(oe=le[3].conf)==null?void 0:oe.network)==null?void 0:pe.ip)??"IP")+"")&&E(f,r),de&2&&m!==(m=le[1].net.ip+"")&&E(_,m),de&8&&g!==(g=(((C=(we=le[3].conf)==null?void 0:we.network)==null?void 0:C.mask)??"Mask")+"")&&E(b,g),de&2&&M!==(M=le[1].net.mask+"")&&E(L,M),de&8&&T!==(T=(((I=(w=le[3].conf)==null?void 0:w.network)==null?void 0:I.gw)??"Gateway")+"")&&E(A,T),de&2&&j!==(j=le[1].net.gw+"")&&E(K,j),le[1].net.dns1?V?V.p(le,de):(V=tf(le),V.c(),V.m(q,U)):V&&(V.d(1),V=null),le[1].net.dns2?Y?Y.p(le,de):(Y=lf(le),Y.c(),Y.m(q,null)):Y&&(Y.d(1),Y=null),le[1].net.ipv6?W?W.p(le,de):(W=nf(le),W.c(),W.m(e,null)):W&&(W.d(1),W=null)},d(le){le&&P(e),V&&V.d(),Y&&Y.d(),W&&W.d()}}}function tf(t){var a,r;let e=(((r=(a=t[3].conf)==null?void 0:a.network)==null?void 0:r.dns)??"DNS")+"",l,n,i=t[1].net.dns1+"",o;return{c(){l=S(e),n=S(": "),o=S(i)},m(f,c){N(f,l,c),N(f,n,c),N(f,o,c)},p(f,c){var m,_;c&8&&e!==(e=(((_=(m=f[3].conf)==null?void 0:m.network)==null?void 0:_.dns)??"DNS")+"")&&E(l,e),c&2&&i!==(i=f[1].net.dns1+"")&&E(o,i)},d(f){f&&(P(l),P(n),P(o))}}}function lf(t){var a,r;let e=(((r=(a=t[3].conf)==null?void 0:a.network)==null?void 0:r.dns)??"DNS")+"",l,n,i=t[1].net.dns2+"",o;return{c(){l=S(e),n=S(": "),o=S(i)},m(f,c){N(f,l,c),N(f,n,c),N(f,o,c)},p(f,c){var m,_;c&8&&e!==(e=(((_=(m=f[3].conf)==null?void 0:m.network)==null?void 0:_.dns)??"DNS")+"")&&E(l,e),c&2&&i!==(i=f[1].net.dns2+"")&&E(o,i)},d(f){f&&(P(l),P(n),P(o))}}}function nf(t){let e,l,n,i=t[1].net.ipv6.replace(/\b:?(?:0+:?){2,}/,"::")+"",o,a,r,f,c=t[1].net.dns1v6&&of(t),m=t[1].net.dns2v6&&sf(t);return{c(){e=p("div"),l=S("IPv6: "),n=p("span"),o=S(i),a=h(),r=p("div"),c&&c.c(),f=h(),m&&m.c(),ln(n,"font-size","14px"),u(e,"class","my-2"),u(r,"class","my-2")},m(_,d){N(_,e,d),s(e,l),s(e,n),s(n,o),N(_,a,d),N(_,r,d),c&&c.m(r,null),s(r,f),m&&m.m(r,null)},p(_,d){d&2&&i!==(i=_[1].net.ipv6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&E(o,i),_[1].net.dns1v6?c?c.p(_,d):(c=of(_),c.c(),c.m(r,f)):c&&(c.d(1),c=null),_[1].net.dns2v6?m?m.p(_,d):(m=sf(_),m.c(),m.m(r,null)):m&&(m.d(1),m=null)},d(_){_&&(P(e),P(a),P(r)),c&&c.d(),m&&m.d()}}}function of(t){let e,l,n=t[1].net.dns1v6.replace(/\b:?(?:0+:?){2,}/,"::")+"",i;return{c(){e=S("DNSv6: "),l=p("span"),i=S(n),ln(l,"font-size","14px")},m(o,a){N(o,e,a),N(o,l,a),s(l,i)},p(o,a){a&2&&n!==(n=o[1].net.dns1v6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&E(i,n)},d(o){o&&(P(e),P(l))}}}function sf(t){let e,l,n=t[1].net.dns2v6.replace(/\b:?(?:0+:?){2,}/,"::")+"",i;return{c(){e=S("DNSv6: "),l=p("span"),i=S(n),ln(l,"font-size","14px")},m(o,a){N(o,e,a),N(o,l,a),s(l,i)},p(o,a){a&2&&n!==(n=o[1].net.dns2v6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&E(i,n)},d(o){o&&(P(e),P(l))}}}function af(t){var f,c,m,_;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,o,a=(((_=(m=t[3].errors)==null?void 0:m.upgrade)==null?void 0:_[t[1].upgrade.e])??t[1].upgrade.e)+"",r;return{c(){e=p("div"),l=p("div"),i=S(n),o=h(),r=S(a),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(d,v){N(d,e,v),s(e,l),s(l,i),s(l,o),s(l,r)},p(d,v){var g,b,k,M;v&10&&n!==(n=(((b=(g=d[3].status)==null?void 0:g.firmware)==null?void 0:b.failed)??"Upgrade from {0} to {1} failed").replace("{0}",d[1].upgrade.f).replace("{1}",d[1].upgrade.t)+"")&&E(i,n),v&10&&a!==(a=(((M=(k=d[3].errors)==null?void 0:k.upgrade)==null?void 0:M[d[1].upgrade.e])??d[1].upgrade.e)+"")&&E(r,a)},d(d){d&&P(e)}}}function ff(t){var g,b;let e,l=(((b=(g=t[3].status)==null?void 0:g.firmware)==null?void 0:b.latest)??"Latest")+"",n,i,o,a=t[1].upgrade.n+"",r,f,c,m,_,d=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[1].upgrade.n&&t[1].upgrade.n!=t[1].version&&uf(t),v=t[1].fwconsent===2&&rf(t);return{c(){e=p("div"),n=S(l),i=S(`: - `),o=p("a"),r=S(a),c=h(),d&&d.c(),m=h(),v&&v.c(),_=Wt(),u(o,"href",f="https://github.com/UtilitechAS/amsreader-firmware/releases/tag/"+t[1].upgrade.n),u(o,"class","ml-2 text-blue-600 hover:text-blue-800"),u(o,"target","_blank"),u(o,"rel","noreferrer"),u(e,"class","my-2 flex")},m(k,M){N(k,e,M),s(e,n),s(e,i),s(e,o),s(o,r),s(e,c),d&&d.m(e,null),N(k,m,M),v&&v.m(k,M),N(k,_,M)},p(k,M){var L,R;M&8&&l!==(l=(((R=(L=k[3].status)==null?void 0:L.firmware)==null?void 0:R.latest)??"Latest")+"")&&E(n,l),M&2&&a!==(a=k[1].upgrade.n+"")&&E(r,a),M&2&&f!==(f="https://github.com/UtilitechAS/amsreader-firmware/releases/tag/"+k[1].upgrade.n)&&u(o,"href",f),(k[1].security==0||k[0].a)&&k[1].fwconsent===1&&k[1].upgrade.n&&k[1].upgrade.n!=k[1].version?d?d.p(k,M):(d=uf(k),d.c(),d.m(e,null)):d&&(d.d(1),d=null),k[1].fwconsent===2?v?v.p(k,M):(v=rf(k),v.c(),v.m(_.parentNode,_)):v&&(v.d(1),v=null)},d(k){k&&(P(e),P(m),P(_)),d&&d.d(),v&&v.d(k)}}}function uf(t){let e,l,n,i,o;return{c(){var a,r;e=p("div"),l=p("button"),l.textContent="⇓",u(e,"class","flex-none ml-2 text-green-500"),u(e,"title",n=((r=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:r.install)??"Install")},m(a,r){N(a,e,r),s(e,l),i||(o=re(l,"click",t[10]),i=!0)},p(a,r){var f,c;r&8&&n!==(n=((c=(f=a[3].status)==null?void 0:f.firmware)==null?void 0:c.install)??"Install")&&u(e,"title",n)},d(a){a&&P(e),i=!1,o()}}}function rf(t){var o,a;let e,l,n=(((a=(o=t[3].status)==null?void 0:o.firmware)==null?void 0:a.no_one_click)??"One-click upgrade disabled")+"",i;return{c(){e=p("div"),l=p("div"),i=S(n),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(r,f){N(r,e,f),s(e,l),s(l,i)},p(r,f){var c,m;f&8&&n!==(n=(((m=(c=r[3].status)==null?void 0:c.firmware)==null?void 0:m.no_one_click)??"One-click upgrade disabled")+"")&&E(i,n)},d(r){r&&P(e)}}}function cf(t){let e,l=Lo(Ze(t[1].chip,t[1].board))+"",n;return{c(){e=p("div"),n=S(l),u(e,"class","bd-red")},m(i,o){N(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=Lo(Ze(i[1].chip,i[1].board))+"")&&E(n,l)},d(i){i&&P(e)}}}function _f(t){let e,l,n,i,o,a;function r(m,_){return m[5].length==0?x0:$0}let f=r(t),c=f(t);return{c(){e=p("div"),l=p("form"),n=p("input"),i=h(),c.c(),ln(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(m,_){N(m,e,_),s(e,l),s(l,n),t[13](n),s(l,i),c.m(l,null),o||(a=[re(n,"change",t[14]),re(l,"submit",t[16])],o=!0)},p(m,_){f===(f=r(m))&&c?c.p(m,_):(c.d(1),c=f(m),c&&(c.c(),c.m(l,null)))},d(m){m&&P(e),t[13](null),c.d(),o=!1,zt(a)}}}function $0(t){var r;let e=t[5][0].name+"",l,n,i,o=(((r=t[3].btn)==null?void 0:r.upload)??"Upload")+"",a;return{c(){l=S(e),n=h(),i=p("button"),a=S(o),u(i,"type","submit"),u(i,"class","btn-pri-sm float-right ml-2")},m(f,c){N(f,l,c),N(f,n,c),N(f,i,c),s(i,a)},p(f,c){var m;c&32&&e!==(e=f[5][0].name+"")&&E(l,e),c&8&&o!==(o=(((m=f[3].btn)==null?void 0:m.upload)??"Upload")+"")&&E(a,o)},d(f){f&&(P(l),P(n),P(i))}}}function x0(t){var a,r;let e,l=(((r=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:r.btn_select_file)??"Select file")+"",n,i,o;return{c(){e=p("button"),n=S(l),u(e,"type","button"),u(e,"class","btn-pri-sm float-right")},m(f,c){N(f,e,c),s(e,n),i||(o=re(e,"click",t[15]),i=!0)},p(f,c){var m,_;c&8&&l!==(l=(((_=(m=f[3].status)==null?void 0:m.firmware)==null?void 0:_.btn_select_file)??"Select file")+"")&&E(n,l)},d(f){f&&P(e),i=!1,o()}}}function mf(t){var Y,W,B,y,ne,te;let e,l,n=(((W=(Y=t[3].status)==null?void 0:Y.backup)==null?void 0:W.title)??"Backup")+"",i,o,a,r,f,c,m,_,d=(((y=(B=t[3].status)==null?void 0:B.backup)==null?void 0:y.secrets)??"Include secrets")+"",v,g,b,k=(((te=(ne=t[3].status)==null?void 0:ne.backup)==null?void 0:te.secrets_desc)??"")+"",M,L,R,F,T,A,O,j,K=ft(t[9]),G=[];for(let Q=0;Q{_e=null}),pt()),(_t=ge[0])!=null&&_t.a?he?(he.p(ge,qe),qe&1&&X(he,1)):(he=$a(ge),he.c(),X(he,1),he.m(l,null)):he&&(mt(),ee(he,1,1,()=>{he=null}),pt()),ge[1].meter?J?J.p(ge,qe):(J=xa(ge),J.c(),J.m(e,V)):J&&(J.d(1),J=null),ge[1].net?ve?ve.p(ge,qe):(ve=ef(ge),ve.c(),ve.m(e,Y)):ve&&(ve.d(1),ve=null),(!x||qe&8)&&y!==(y=(((Bt=(lt=ge[3].status)==null?void 0:lt.firmware)==null?void 0:Bt.title)??"Firmware")+"")&&E(ne,y),(!x||qe&8)&&se!==(se=(((ct=(Xt=ge[3].status)==null?void 0:Xt.firmware)==null?void 0:ct.installed)??"Installed")+"")&&E(ue,se),(!x||qe&2)&&le!==(le=ge[1].version+"")&&E(de,le),ge[1].upgrade.t&&ge[1].upgrade.t!=ge[1].version&&ge[1].upgrade.e!=0&&ge[1].upgrade.e!=123?ke?ke.p(ge,qe):(ke=af(ge),ke.c(),ke.m(W,me)):ke&&(ke.d(1),ke=null),ge[1].upgrade.n?De?De.p(ge,qe):(De=ff(ge),De.c(),De.m(W,oe)):De&&(De.d(1),De=null),qe&3&&(pe=(ge[1].security==0||ge[0].a)&&Hn(ge[1].board)),pe?Te?Te.p(ge,qe):(Te=cf(ge),Te.c(),Te.m(W,we)):Te&&(Te.d(1),Te=null),ge[1].security==0||ge[0].a?Ae?Ae.p(ge,qe):(Ae=_f(ge),Ae.c(),Ae.m(W,null)):Ae&&(Ae.d(1),Ae=null),ge[1].security==0||ge[0].a?Le?Le.p(ge,qe):(Le=mf(ge),Le.c(),Le.m(e,null)):Le&&(Le.d(1),Le=null);const ce={};qe&64&&(ce.active=ge[6]),qe&8&&(ce.message=((Gt=(at=ge[3].status)==null?void 0:at.mask)==null?void 0:Gt.firmware)??"Uploading"),I.$set(ce);const Ce={};qe&256&&(Ce.active=ge[8]),qe&8&&(Ce.message=((Tt=(Jt=ge[3].status)==null?void 0:Jt.mask)==null?void 0:Tt.config)??"Uploading"),z.$set(Ce)},i(ge){x||(X(R.$$.fragment,ge),X(_e),X(he),X(I.$$.fragment,ge),X(z.$$.fragment,ge),x=!0)},o(ge){ee(R.$$.fragment,ge),ee(_e),ee(he),ee(I.$$.fragment,ge),ee(z.$$.fragment,ge),x=!1},d(ge){ge&&(P(e),P(w),P(D)),ae&&ae.d(),Pe(R),_e&&_e.d(),he&&he.d(),J&&J.d(),ve&&ve.d(),ke&&ke.d(),De&&De.d(),Te&&Te.d(),Ae&&Ae.d(),Le&&Le.d(),Pe(I,ge),Pe(z,ge)}}}async function n_(){await(await fetch("reboot",{method:"POST"})).json()}function i_(t,e,l){let{data:n}=e,{sysinfo:i}=e,o=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price",key:"is"}],a={};kl.subscribe(j=>{l(3,a=j)});function r(){var j;confirm((((j=a.header)==null?void 0:j.upgrade)??"Upgrade to {0}?").replace("{0}",i.upgrade.n))&&(yu(i.upgrade.n),_l.update(K=>(K.upgrade.t=i.upgrade.n,K.upgrade.p=0,K.upgrading=!0,K)))}const f=function(){var j;confirm(((j=a.device)==null?void 0:j.reboot_confirm)??"Reboot?")&&(_l.update(K=>(K.booting=!0,K)),n_())};let c,m=[],_=!1,d,v=[],g=!1;_i();let b={hostname:"",ip:""};function k(j){l(8,g=!0);const K=new FormData;K.append("file",v[0]),fetch("configfile",{method:"POST",body:K}).then(G=>G.json()).then(G=>{_l.update(q=>(b&&b.hostname&&(q.hostname=b.hostname),q.booting=G.reboot,b&&b.ip&&(q.net.ip=b.ip),setTimeout(Wn,5e3,i),q))}).catch(G=>{console.error("Error:",G),setTimeout(Wn,5e3,i)})}function M(j){fi[j?"unshift":"push"](()=>{c=j,l(4,c)})}function L(){m=this.files,l(5,m)}const R=()=>{c.click()},F=()=>l(6,_=!0);function T(j){fi[j?"unshift":"push"](()=>{d=j,l(7,d)})}function A(){v=this.files,l(2,v)}const O=()=>{d.click()};return t.$$set=j=>{"data"in j&&l(0,n=j.data),"sysinfo"in j&&l(1,i=j.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&4&&v.length==1){let j=v[0],K=new FileReader,G=q=>{let U=q.target.result.split(` -`);for(let Z in U){let V=U[Z];V.startsWith("hostname ")?b.hostname=V.split(" ")[1]:V.startsWith("ip ")&&(b.ip=V.split(" ")[1])}};K.onload=G,K.readAsText(j)}},[n,i,v,a,c,m,_,d,g,o,r,f,k,M,L,R,F,T,A,O]}class o_ extends Nt{constructor(e){super(),Pt(this,e,i_,l_,St,{data:0,sysinfo:1})}}function hf(t){let e,l,n=Ze(t[0],7)+"",i,o,a=Ze(t[0],5)+"",r,f,c=Ze(t[0],4)+"",m,_,d=Ze(t[0],3)+"",v,g,b,k,M=Ze(t[0],2)+"",L,R,F=Ze(t[0],1)+"",T,A,O=Ze(t[0],0)+"",j,K,G,q,U=Ze(t[0],101)+"",Z,V,Y=Ze(t[0],100)+"",W;return{c(){e=p("optgroup"),l=p("option"),i=S(n),o=p("option"),r=S(a),f=p("option"),m=S(c),_=p("option"),v=S(d),g=h(),b=p("optgroup"),k=p("option"),L=S(M),R=p("option"),T=S(F),A=p("option"),j=S(O),K=h(),G=p("optgroup"),q=p("option"),Z=S(U),V=p("option"),W=S(Y),l.__value=7,H(l,l.__value),o.__value=5,H(o,o.__value),f.__value=4,H(f,f.__value),_.__value=3,H(_,_.__value),u(e,"label","amsleser.no"),k.__value=2,H(k,k.__value),R.__value=1,H(R,R.__value),A.__value=0,H(A,A.__value),u(b,"label","Custom hardware"),q.__value=101,H(q,q.__value),V.__value=100,H(V,V.__value),u(G,"label","Generic hardware")},m(B,y){N(B,e,y),s(e,l),s(l,i),s(e,o),s(o,r),s(e,f),s(f,m),s(e,_),s(_,v),N(B,g,y),N(B,b,y),s(b,k),s(k,L),s(b,R),s(R,T),s(b,A),s(A,j),N(B,K,y),N(B,G,y),s(G,q),s(q,Z),s(G,V),s(V,W)},p(B,y){y&1&&n!==(n=Ze(B[0],7)+"")&&E(i,n),y&1&&a!==(a=Ze(B[0],5)+"")&&E(r,a),y&1&&c!==(c=Ze(B[0],4)+"")&&E(m,c),y&1&&d!==(d=Ze(B[0],3)+"")&&E(v,d),y&1&&M!==(M=Ze(B[0],2)+"")&&E(L,M),y&1&&F!==(F=Ze(B[0],1)+"")&&E(T,F),y&1&&O!==(O=Ze(B[0],0)+"")&&E(j,O),y&1&&U!==(U=Ze(B[0],101)+"")&&E(Z,U),y&1&&Y!==(Y=Ze(B[0],100)+"")&&E(W,Y)},d(B){B&&(P(e),P(g),P(b),P(K),P(G))}}}function vf(t){let e,l,n=Ze(t[0],201)+"",i,o,a=Ze(t[0],202)+"",r,f,c=Ze(t[0],203)+"",m,_,d=Ze(t[0],241)+"",v,g,b=Ze(t[0],242)+"",k,M,L=Ze(t[0],243)+"",R,F,T=Ze(t[0],245)+"",A,O,j=Ze(t[0],200)+"",K;return{c(){e=p("optgroup"),l=p("option"),i=S(n),o=p("option"),r=S(a),f=p("option"),m=S(c),_=p("option"),v=S(d),g=p("option"),k=S(b),M=p("option"),R=S(L),F=p("option"),A=S(T),O=p("option"),K=S(j),l.__value=201,H(l,l.__value),o.__value=202,H(o,o.__value),f.__value=203,H(f,f.__value),_.__value=241,H(_,_.__value),g.__value=242,H(g,g.__value),M.__value=243,H(M,M.__value),F.__value=245,H(F,F.__value),O.__value=200,H(O,O.__value),u(e,"label","Generic hardware")},m(G,q){N(G,e,q),s(e,l),s(l,i),s(e,o),s(o,r),s(e,f),s(f,m),s(e,_),s(_,v),s(e,g),s(g,k),s(e,M),s(M,R),s(e,F),s(F,A),s(e,O),s(O,K)},p(G,q){q&1&&n!==(n=Ze(G[0],201)+"")&&E(i,n),q&1&&a!==(a=Ze(G[0],202)+"")&&E(r,a),q&1&&c!==(c=Ze(G[0],203)+"")&&E(m,c),q&1&&d!==(d=Ze(G[0],241)+"")&&E(v,d),q&1&&b!==(b=Ze(G[0],242)+"")&&E(k,b),q&1&&L!==(L=Ze(G[0],243)+"")&&E(R,L),q&1&&T!==(T=Ze(G[0],245)+"")&&E(A,T),q&1&&j!==(j=Ze(G[0],200)+"")&&E(K,j)},d(G){G&&P(e)}}}function bf(t){let e,l,n=Ze(t[0],7)+"",i,o,a=Ze(t[0],6)+"",r,f,c=Ze(t[0],5)+"",m,_,d,v,g=Ze(t[0],51)+"",b,k,M=Ze(t[0],50)+"",L;return{c(){e=p("optgroup"),l=p("option"),i=S(n),o=p("option"),r=S(a),f=p("option"),m=S(c),_=h(),d=p("optgroup"),v=p("option"),b=S(g),k=p("option"),L=S(M),l.__value=7,H(l,l.__value),o.__value=6,H(o,o.__value),f.__value=5,H(f,f.__value),u(e,"label","amsleser.no"),v.__value=51,H(v,v.__value),k.__value=50,H(k,k.__value),u(d,"label","Generic hardware")},m(R,F){N(R,e,F),s(e,l),s(l,i),s(e,o),s(o,r),s(e,f),s(f,m),N(R,_,F),N(R,d,F),s(d,v),s(v,b),s(d,k),s(k,L)},p(R,F){F&1&&n!==(n=Ze(R[0],7)+"")&&E(i,n),F&1&&a!==(a=Ze(R[0],6)+"")&&E(r,a),F&1&&c!==(c=Ze(R[0],5)+"")&&E(m,c),F&1&&g!==(g=Ze(R[0],51)+"")&&E(b,g),F&1&&M!==(M=Ze(R[0],50)+"")&&E(L,M)},d(R){R&&(P(e),P(_),P(d))}}}function gf(t){let e,l,n=Ze(t[0],8)+"",i,o,a,r,f=Ze(t[0],71)+"",c,m,_=Ze(t[0],70)+"",d;return{c(){e=p("optgroup"),l=p("option"),i=S(n),o=h(),a=p("optgroup"),r=p("option"),c=S(f),m=p("option"),d=S(_),l.__value=8,H(l,l.__value),u(e,"label","Custom hardware"),r.__value=71,H(r,r.__value),m.__value=70,H(m,m.__value),u(a,"label","Generic hardware")},m(v,g){N(v,e,g),s(e,l),s(l,i),N(v,o,g),N(v,a,g),s(a,r),s(r,c),s(a,m),s(m,d)},p(v,g){g&1&&n!==(n=Ze(v[0],8)+"")&&E(i,n),g&1&&f!==(f=Ze(v[0],71)+"")&&E(c,f),g&1&&_!==(_=Ze(v[0],70)+"")&&E(d,_)},d(v){v&&(P(e),P(o),P(a))}}}function kf(t){let e,l,n=Ze(t[0],200)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=S(n),l.__value=200,H(l,l.__value),u(e,"label","Generic hardware")},m(o,a){N(o,e,a),s(e,l),s(l,i)},p(o,a){a&1&&n!==(n=Ze(o[0],200)+"")&&E(i,n)},d(o){o&&P(e)}}}function wf(t){let e,l,n=Ze(t[0],80)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=S(n),l.__value=80,H(l,l.__value),u(e,"label","Generic hardware")},m(o,a){N(o,e,a),s(e,l),s(l,i)},p(o,a){a&1&&n!==(n=Ze(o[0],80)+"")&&E(i,n)},d(o){o&&P(e)}}}function s_(t){let e,l,n,i,o,a,r,f,c=t[0]=="esp8266"&&hf(t),m=t[0]=="esp32"&&vf(t),_=t[0]=="esp32s2"&&bf(t),d=t[0]=="esp32c3"&&gf(t),v=t[0]=="esp32solo"&&kf(t),g=t[0]=="esp32s3"&&wf(t);return{c(){e=p("option"),l=h(),c&&c.c(),n=h(),m&&m.c(),i=h(),_&&_.c(),o=h(),d&&d.c(),a=h(),v&&v.c(),r=h(),g&&g.c(),f=Wt(),e.__value=-1,H(e,e.__value)},m(b,k){N(b,e,k),N(b,l,k),c&&c.m(b,k),N(b,n,k),m&&m.m(b,k),N(b,i,k),_&&_.m(b,k),N(b,o,k),d&&d.m(b,k),N(b,a,k),v&&v.m(b,k),N(b,r,k),g&&g.m(b,k),N(b,f,k)},p(b,[k]){b[0]=="esp8266"?c?c.p(b,k):(c=hf(b),c.c(),c.m(n.parentNode,n)):c&&(c.d(1),c=null),b[0]=="esp32"?m?m.p(b,k):(m=vf(b),m.c(),m.m(i.parentNode,i)):m&&(m.d(1),m=null),b[0]=="esp32s2"?_?_.p(b,k):(_=bf(b),_.c(),_.m(o.parentNode,o)):_&&(_.d(1),_=null),b[0]=="esp32c3"?d?d.p(b,k):(d=gf(b),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null),b[0]=="esp32solo"?v?v.p(b,k):(v=kf(b),v.c(),v.m(r.parentNode,r)):v&&(v.d(1),v=null),b[0]=="esp32s3"?g?g.p(b,k):(g=wf(b),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i:ze,o:ze,d(b){b&&(P(e),P(l),P(n),P(i),P(o),P(a),P(r),P(f)),c&&c.d(b),m&&m.d(b),_&&_.d(b),d&&d.d(b),v&&v.d(b),g&&g.d(b)}}}function a_(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class f_ extends Nt{constructor(e){super(),Pt(this,e,a_,s_,St,{chip:0})}}function Cf(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){N(l,e,n)},d(l){l&&P(e)}}}function Sf(t){let e,l,n,i,o,a,r;return a=new ji({props:{chip:t[0].chip}}),{c(){e=p("div"),l=S("HAN GPIO"),n=p("br"),i=h(),o=p("select"),Ne(a.$$.fragment),u(o,"name","vh"),u(o,"class","in-s"),u(e,"class","my-3")},m(f,c){N(f,e,c),s(e,l),s(e,n),s(e,i),s(e,o),Me(a,o,null),r=!0},p(f,c){const m={};c&1&&(m.chip=f[0].chip),a.$set(m)},i(f){r||(X(a.$$.fragment,f),r=!0)},o(f){ee(a.$$.fragment,f),r=!1},d(f){f&&P(e),Pe(a)}}}function u_(t){let e,l,n,i,o,a,r,f,c,m,_,d,v,g,b,k,M,L,R,F,T,A,O,j,K,G,q,U,Z,V=t[0].usrcfg&&Cf();g=new f_({props:{chip:t[0].chip}});let Y=t[0].board&&t[0].board>20&&Sf(t);return G=new cl({props:{active:t[1],message:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("input"),o=h(),a=p("strong"),a.textContent="Initial configuration",r=h(),V&&V.c(),f=h(),c=p("div"),m=S("Board type"),_=p("br"),d=h(),v=p("select"),Ne(g.$$.fragment),b=h(),Y&&Y.c(),k=h(),M=p("div"),L=p("label"),R=p("input"),F=S(" Clear all other configuration"),T=h(),A=p("div"),A.innerHTML='',O=h(),j=p("span"),j.textContent=" ",K=h(),Ne(G.$$.fragment),u(i,"type","hidden"),u(i,"name","v"),i.value="true",u(a,"class","text-sm"),u(v,"name","vb"),u(v,"class","in-s"),t[0].board===void 0&&At(()=>t[5].call(v)),u(c,"class","my-3"),u(R,"type","checkbox"),u(R,"name","vr"),R.__value="true",H(R,R.__value),u(R,"class","rounded mb-1"),u(M,"class","my-3"),u(A,"class","my-3"),u(j,"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(W,B){N(W,e,B),s(e,l),s(l,n),s(n,i),s(n,o),s(n,a),s(n,r),V&&V.m(n,null),s(n,f),s(n,c),s(c,m),s(c,_),s(c,d),s(c,v),Me(g,v,null),He(v,t[0].board,!0),s(n,b),Y&&Y.m(n,null),s(n,k),s(n,M),s(M,L),s(L,R),R.checked=t[2],s(L,F),s(n,T),s(n,A),s(n,O),s(n,j),N(W,K,B),Me(G,W,B),q=!0,U||(Z=[re(v,"change",t[5]),re(R,"change",t[6]),re(n,"submit",mn(t[3]))],U=!0)},p(W,[B]){W[0].usrcfg?V||(V=Cf(),V.c(),V.m(n,f)):V&&(V.d(1),V=null);const y={};B&1&&(y.chip=W[0].chip),g.$set(y),B&1&&He(v,W[0].board),W[0].board&&W[0].board>20?Y?(Y.p(W,B),B&1&&X(Y,1)):(Y=Sf(W),Y.c(),X(Y,1),Y.m(n,k)):Y&&(mt(),ee(Y,1,1,()=>{Y=null}),pt()),B&4&&(R.checked=W[2]);const ne={};B&2&&(ne.active=W[1]),G.$set(ne)},i(W){q||(X(g.$$.fragment,W),X(Y),X(G.$$.fragment,W),q=!0)},o(W){ee(g.$$.fragment,W),ee(Y),ee(G.$$.fragment,W),q=!1},d(W){W&&(P(e),P(K)),V&&V.d(),Pe(g),Y&&Y.d(),Pe(G,W),U=!1,zt(Z)}}}function r_(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,o=!1;async function a(m){l(1,o=!0);const _=new FormData(m.target),d=new URLSearchParams;for(let b of _){const[k,M]=b;d.append(k,M)}let g=await(await fetch("save",{method:"POST",body:d})).json();l(1,o=!1),_l.update(b=>(b.vndcfg=g.success,b.booting=g.reboot,b.if.eth=b.boardType>240&&b.boardType<250,b)),nn(n+(i.usrcfg?"/":"/setup"))}let r=!1;_l.subscribe(m=>{l(0,i=m),m.fwconsent===1&&l(2,r=!i.usrcfg)});function f(){i.board=Kt(this),l(0,i)}function c(){r=this.checked,l(2,r)}return t.$$set=m=>{"basepath"in m&&l(4,n=m.basepath),"sysinfo"in m&&l(0,i=m.sysinfo)},[i,o,r,a,n,f,c]}class c_ extends Nt{constructor(e){super(),Pt(this,e,r_,u_,St,{basepath:4,sysinfo:0})}}function Mf(t,e,l){const n=t.slice();return n[13]=e[l],n}function Pf(t){var i,o;let e,l=(((o=(i=t[1].conf)==null?void 0:i.connection)==null?void 0:o.eth)??"Ethernet")+"",n;return{c(){e=p("option"),n=S(l),e.__value=3,H(e,e.__value)},m(a,r){N(a,e,r),s(e,n)},p(a,r){var f,c;r&2&&l!==(l=(((c=(f=a[1].conf)==null?void 0:f.connection)==null?void 0:c.eth)??"Ethernet")+"")&&E(n,l)},d(a){a&&P(e)}}}function Nf(t){var j,K,G,q;let e,l=(((K=(j=t[1].conf)==null?void 0:j.connection)==null?void 0:K.ssid)??"SSID")+"",n,i,o,a,r,f,c,m,_,d,v=(((q=(G=t[1].conf)==null?void 0:G.connection)==null?void 0:q.psk)??"Password")+"",g,b,k,M,L,R,F;function T(U,Z){return U[2]?m_:__}let A=T(t),O=A(t);return{c(){e=p("div"),n=S(l),i=h(),o=p("label"),a=p("input"),r=S(" manual"),f=h(),c=p("br"),m=h(),O.c(),_=h(),d=p("div"),g=S(v),b=p("br"),k=h(),M=p("input"),u(a,"type","checkbox"),a.__value="true",H(a,a.__value),u(a,"class","rounded mb-1"),u(o,"class","float-right mr-3"),u(e,"class","my-3"),u(M,"name","sp"),u(M,"type","password"),u(M,"pattern",Pn),u(M,"class","in-s"),u(M,"autocomplete","off"),M.required=L=t[5]==2,u(d,"class","my-3")},m(U,Z){N(U,e,Z),s(e,n),s(e,i),s(e,o),s(o,a),a.checked=t[2],s(o,r),s(e,f),s(e,c),s(e,m),O.m(e,null),N(U,_,Z),N(U,d,Z),s(d,g),s(d,b),s(d,k),s(d,M),R||(F=re(a,"change",t[9]),R=!0)},p(U,Z){var V,Y,W,B;Z&2&&l!==(l=(((Y=(V=U[1].conf)==null?void 0:V.connection)==null?void 0:Y.ssid)??"SSID")+"")&&E(n,l),Z&4&&(a.checked=U[2]),A===(A=T(U))&&O?O.p(U,Z):(O.d(1),O=A(U),O&&(O.c(),O.m(e,null))),Z&2&&v!==(v=(((B=(W=U[1].conf)==null?void 0:W.connection)==null?void 0:B.psk)??"Password")+"")&&E(g,v),Z&32&&L!==(L=U[5]==2)&&(M.required=L)},d(U){U&&(P(e),P(_),P(d)),O.d(),R=!1,F()}}}function __(t){var a,r;let e,l,n,i=((a=t[3])==null?void 0:a.c)==-1&&Tf(),o=((r=t[3])==null?void 0:r.n)&&qf(t);return{c(){e=p("select"),i&&i.c(),l=Wt(),o&&o.c(),u(e,"name","ss"),u(e,"class","in-s"),e.required=n=t[5]==1||t[5]==2},m(f,c){N(f,e,c),i&&i.m(e,null),s(e,l),o&&o.m(e,null)},p(f,c){var m,_;((m=f[3])==null?void 0:m.c)==-1?i||(i=Tf(),i.c(),i.m(e,l)):i&&(i.d(1),i=null),(_=f[3])!=null&&_.n?o?o.p(f,c):(o=qf(f),o.c(),o.m(e,null)):o&&(o.d(1),o=null),c&32&&n!==(n=f[5]==1||f[5]==2)&&(e.required=n)},d(f){f&&P(e),i&&i.d(),o&&o.d()}}}function m_(t){let e,l;return{c(){e=p("input"),u(e,"name","ss"),u(e,"type","text"),u(e,"pattern",Pn),u(e,"class","in-s"),e.required=l=t[5]==1||t[5]==2},m(n,i){N(n,e,i)},p(n,i){i&32&&l!==(l=n[5]==1||n[5]==2)&&(e.required=l)},d(n){n&&P(e)}}}function Tf(t){let e;return{c(){e=p("option"),e.textContent="Scanning...",e.__value="",H(e,e.__value),e.selected=!0,e.disabled=!0},m(l,n){N(l,e,n)},d(l){l&&P(e)}}}function qf(t){var i;let e,l=ft((i=t[3])==null?void 0:i.n),n=[];for(let o=0;ot[8].call(b)),u(m,"class","my-3"),u(U,"name","sh"),u(U,"type","text"),u(U,"class","in-s"),u(U,"maxlength","32"),u(U,"pattern",Vn),u(U,"placeholder","Optional, ex.: ams-reader"),u(U,"autocomplete","off"),u(W,"type","checkbox"),u(W,"name","sm"),W.__value="static",H(W,W.__value),u(W,"class","rounded mb-1"),u(V,"class","my-3"),u(fe,"type","submit"),u(fe,"class","btn-pri"),u(ue,"class","my-3"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Ee,Ie){N(Ee,e,Ie),s(e,l),s(l,n),s(n,i),s(n,o),s(n,a),s(a,f),s(n,c),s(n,m),s(m,d),s(m,v),s(m,g),s(m,b),s(b,k),s(k,L),s(b,R),s(R,T),C&&C.m(b,null),He(b,t[5],!0),s(n,A),w&&w.m(n,null),s(n,O),s(n,j),s(j,G),s(j,q),s(j,U),H(U,t[0].hostname),s(n,Z),s(n,V),s(V,Y),s(Y,W),W.checked=t[4],s(Y,B),s(Y,ne),s(V,te),I&&I.m(V,null),s(n,Q),D&&D.m(n,null),s(n,se),s(n,ue),s(ue,fe),s(fe,de),N(Ee,ie,Ie),Me(me,Ee,Ie),oe=!0,pe||(we=[re(b,"change",t[8]),re(U,"input",t[10]),re(W,"change",t[11]),re(n,"submit",mn(t[7]))],pe=!0)},p(Ee,[Ie]){var wt,et,ut,Ct,ht,rt,it,vt,Ot,$e,Re,Be;(!oe||Ie&2)&&r!==(r=(((wt=Ee[1].setup)==null?void 0:wt.title)??"Setup")+"")&&E(f,r),(!oe||Ie&2)&&_!==(_=(((ut=(et=Ee[1].conf)==null?void 0:et.connection)==null?void 0:ut.title)??"Connection")+"")&&E(d,_),(!oe||Ie&2)&&M!==(M=(((ht=(Ct=Ee[1].conf)==null?void 0:Ct.connection)==null?void 0:ht.wifi)??"Connect to WiFi")+"")&&E(L,M),(!oe||Ie&2)&&F!==(F=(((it=(rt=Ee[1].conf)==null?void 0:rt.connection)==null?void 0:it.ap)??"Standalone access point")+"")&&E(T,F),Ee[0].if&&Ee[0].if.eth?C?C.p(Ee,Ie):(C=Pf(Ee),C.c(),C.m(b,null)):C&&(C.d(1),C=null),Ie&32&&He(b,Ee[5]),Ee[5]==1||Ee[5]==2?w?w.p(Ee,Ie):(w=Nf(Ee),w.c(),w.m(n,O)):w&&(w.d(1),w=null),(!oe||Ie&2)&&K!==(K=(((Ot=(vt=Ee[1].conf)==null?void 0:vt.general)==null?void 0:Ot.hostname)??"Hostname")+"")&&E(G,K),Ie&1&&U.value!==Ee[0].hostname&&H(U,Ee[0].hostname),Ie&16&&(W.checked=Ee[4]),(!oe||Ie&2)&&y!==(y=((($e=Ee[1].setup)==null?void 0:$e.static)??"Static IP")+"")&&E(ne,y),Ee[4]?I?(I.p(Ee,Ie),Ie&16&&X(I,1)):(I=Df(Ee),I.c(),X(I,1),I.m(V,null)):I&&(mt(),ee(I,1,1,()=>{I=null}),pt()),Ee[4]?D?D.p(Ee,Ie):(D=Af(Ee),D.c(),D.m(n,se)):D&&(D.d(1),D=null),(!oe||Ie&2)&&le!==(le=(((Re=Ee[1].btn)==null?void 0:Re.save)??"Save")+"")&&E(de,le);const Je={};Ie&64&&(Je.active=Ee[6]),Ie&2&&(Je.message=((Be=Ee[1].setup)==null?void 0:Be.mask)??"Saving"),me.$set(Je)},i(Ee){oe||(X(I),X(me.$$.fragment,Ee),oe=!0)},o(Ee){ee(I),ee(me.$$.fragment,Ee),oe=!1},d(Ee){Ee&&(P(e),P(ie)),C&&C.d(),w&&w.d(),I&&I.d(),D&&D.d(),Pe(me,Ee),pe=!1,zt(we)}}}function d_(t,e,l){let n={};kl.subscribe(k=>{l(1,n=k)});let i=!1,o={};$i.subscribe(k=>{l(3,o=k)});let{sysinfo:a={}}=e,r=!1,f=1,c=!1;function m(k){_l.update(M=>(M.trying=k,M))}async function _(k){l(6,c=!0);const M=new FormData(k.target),L=new URLSearchParams;for(let T of M){const[A,O]=T;L.append(A,O)}let F=await(await fetch("save",{method:"POST",body:L})).json();l(6,c=!1),_l.update(T=>(T.hostname=M.get("sh"),T.usrcfg=F.success,T.booting=F.reboot,r&&(T.net.ip=M.get("si"),T.net.mask=M.get("su"),T.net.gw=M.get("sg"),T.net.dns1=M.get("sd")),F.reboot&&setTimeout(Wn,5e3,a,m),T))}function d(){f=Kt(this),l(5,f)}function v(){i=this.checked,l(2,i)}function g(){a.hostname=this.value,l(0,a)}function b(){r=this.checked,l(4,r)}return t.$$set=k=>{"sysinfo"in k&&l(0,a=k.sysinfo)},[a,n,i,o,r,f,c,_,d,v,g,b]}class h_ extends Nt{constructor(e){super(),Pt(this,e,d_,p_,St,{sysinfo:0})}}function v_(t){var G,q,U,Z;let e,l,n,i=(((G=t[2].upload)==null?void 0:G.title)??"Upload")+"",o,a,r,f,c,m=(((q=t[2].upload)==null?void 0:q.desc)??"")+"",_,d,v,g,b,k,M,L,R=(((U=t[2].btn)==null?void 0:U.upload)??"Upload")+"",F,T,A,O,j,K;return A=new cl({props:{active:t[3],message:((Z=t[2].upload)==null?void 0:Z.mask)??"Uploading"}}),{c(){e=p("div"),l=p("div"),n=p("strong"),o=S(i),a=h(),r=S(t[1]),f=h(),c=p("p"),_=S(m),d=h(),v=p("form"),g=p("input"),b=h(),k=p("div"),M=p("button"),L=p("p"),F=S(R),T=h(),Ne(A.$$.fragment),u(c,"class","mb-4"),u(g,"name","file"),u(g,"type","file"),u(L,"class","mb-4"),u(M,"type","submit"),u(M,"class","btn-pri"),u(k,"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(V,Y){N(V,e,Y),s(e,l),s(l,n),s(n,o),s(n,a),s(n,r),s(l,f),s(l,c),s(c,_),s(l,d),s(l,v),s(v,g),s(v,b),s(v,k),s(k,M),s(M,L),s(L,F),N(V,T,Y),Me(A,V,Y),O=!0,j||(K=re(v,"submit",t[4]),j=!0)},p(V,[Y]){var B,y,ne,te;(!O||Y&4)&&i!==(i=(((B=V[2].upload)==null?void 0:B.title)??"Upload")+"")&&E(o,i),(!O||Y&2)&&E(r,V[1]),(!O||Y&4)&&m!==(m=(((y=V[2].upload)==null?void 0:y.desc)??"")+"")&&E(_,m),(!O||Y&4)&&R!==(R=(((ne=V[2].btn)==null?void 0:ne.upload)??"Upload")+"")&&E(F,R),(!O||Y&1)&&u(v,"action",V[0]);const W={};Y&8&&(W.active=V[3]),Y&4&&(W.message=((te=V[2].upload)==null?void 0:te.mask)??"Uploading"),A.$set(W)},i(V){O||(X(A.$$.fragment,V),O=!0)},o(V){ee(A.$$.fragment,V),O=!1},d(V){V&&(P(e),P(T)),Pe(A,V),j=!1,K()}}}function b_(t,e,l){let{action:n}=e,{title:i}=e,o={};kl.subscribe(f=>{l(2,o=f)});let a=!1;const r=()=>l(3,a=!0);return t.$$set=f=>{"action"in f&&l(0,n=f.action),"title"in f&&l(1,i=f.title)},[n,i,o,a,r]}class no extends Nt{constructor(e){super(),Pt(this,e,b_,v_,St,{action:0,title:1})}}function g_(t){var me,oe,pe,we,C,w,I;let e,l,n,i,o=(((me=t[1].consent)==null?void 0:me.title)??"Consents")+"",a,r,f,c,m,_=(((oe=t[1].consent)==null?void 0:oe.one_click)??"One-click")+"",d,v,g,b,k=(((pe=t[1].consent)==null?void 0:pe.read_more)??"Read more")+"",M,L,R,F,T,A,O,j=(((we=t[1].consent)==null?void 0:we.yes)??"Yes")+"",K,G,q,U,Z,V,Y=(((C=t[1].consent)==null?void 0:C.no)??"No")+"",W,B,y,ne,te,Q=(((w=t[1].btn)==null?void 0:w.save)??"Save")+"",se,ue,fe,le,de,ie;return fe=new cl({props:{active:t[2],message:((I=t[1].consent)==null?void 0:I.mask_saving)??"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("div"),a=S(o),r=h(),f=p("hr"),c=h(),m=p("div"),d=S(_),v=p("br"),g=h(),b=p("a"),M=S(k),L=p("br"),R=h(),F=p("label"),T=p("input"),O=h(),K=S(j),G=h(),q=p("label"),U=p("input"),V=h(),W=S(Y),B=p("br"),y=h(),ne=p("div"),te=p("button"),se=S(Q),ue=h(),Ne(fe.$$.fragment),u(b,"href",ml("Data-collection-on-one-click-firmware-upgrade")),u(b,"target","_blank"),u(b,"class","text-blue-600 hover:text-blue-800"),u(T,"type","radio"),u(T,"name","sf"),T.value=1,T.checked=A=t[0].fwconsent===1,u(T,"class","rounded m-2"),T.required=!0,u(U,"type","radio"),u(U,"name","sf"),U.value=2,U.checked=Z=t[0].fwconsent===2,u(U,"class","rounded m-2"),U.required=!0,u(m,"class","my-3"),u(te,"type","submit"),u(te,"class","btn-pri"),u(ne,"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,z){N(D,e,z),s(e,l),s(l,n),s(n,i),s(i,a),s(n,r),s(n,f),s(n,c),s(n,m),s(m,d),s(m,v),s(m,g),s(m,b),s(b,M),s(m,L),s(m,R),s(m,F),s(F,T),s(F,O),s(F,K),s(m,G),s(m,q),s(q,U),s(q,V),s(q,W),s(m,B),s(n,y),s(n,ne),s(ne,te),s(te,se),N(D,ue,z),Me(fe,D,z),le=!0,de||(ie=re(n,"submit",mn(t[3])),de=!0)},p(D,[z]){var ae,_e,he,J,ve,ke,De;(!le||z&2)&&o!==(o=(((ae=D[1].consent)==null?void 0:ae.title)??"Consents")+"")&&E(a,o),(!le||z&2)&&_!==(_=(((_e=D[1].consent)==null?void 0:_e.one_click)??"One-click")+"")&&E(d,_),(!le||z&2)&&k!==(k=(((he=D[1].consent)==null?void 0:he.read_more)??"Read more")+"")&&E(M,k),(!le||z&1&&A!==(A=D[0].fwconsent===1))&&(T.checked=A),(!le||z&2)&&j!==(j=(((J=D[1].consent)==null?void 0:J.yes)??"Yes")+"")&&E(K,j),(!le||z&1&&Z!==(Z=D[0].fwconsent===2))&&(U.checked=Z),(!le||z&2)&&Y!==(Y=(((ve=D[1].consent)==null?void 0:ve.no)??"No")+"")&&E(W,Y),(!le||z&2)&&Q!==(Q=(((ke=D[1].btn)==null?void 0:ke.save)??"Save")+"")&&E(se,Q);const x={};z&4&&(x.active=D[2]),z&2&&(x.message=((De=D[1].consent)==null?void 0:De.mask_saving)??"Saving"),fe.$set(x)},i(D){le||(X(fe.$$.fragment,D),le=!0)},o(D){ee(fe.$$.fragment,D),le=!1},d(D){D&&(P(e),P(ue)),Pe(fe,D),de=!1,ie()}}}function k_(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,o={};kl.subscribe(f=>{l(1,o=f)});let a=!1;async function r(f){l(2,a=!0);const c=new FormData(f.target),m=new URLSearchParams;for(let v of c){const[g,b]=v;m.append(g,b)}let d=await(await fetch("save",{method:"POST",body:m})).json();l(2,a=!1),_l.update(v=>(v.fwconsent=c.sf===!0?1:c.sf===!1?2:0,v.booting=d.reboot,v)),nn(n)}return t.$$set=f=>{"basepath"in f&&l(4,n=f.basepath),"sysinfo"in f&&l(0,i=f.sysinfo)},[i,o,a,r,n]}class w_ extends Nt{constructor(e){super(),Pt(this,e,k_,g_,St,{basepath:4,sysinfo:0})}}function Of(t,e,l){const n=t.slice();return n[30]=e[l],n[31]=e,n[32]=l,n}function Lf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function C_(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function If(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function S_(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Rf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Ff(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Bf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Uf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function jf(t){let e,l=ft(t[1].o),n=[];for(let i=0;i0?"text-green-600":"text-gray-300"),u(Je,"class",et=t[32]{l(0,i=B)});let o=["mo","tu","we","th","fr","sa","su"],a={},r=!0,f=!1;Ku.subscribe(B=>{B.o&&(l(1,a=B),l(2,r=!1))}),o0();async function c(B){l(3,f=!0);const y=new URLSearchParams;y.append("r","true"),y.append("rc",a.o.length),a.o.forEach(function(te,Q){y.append("rt"+Q,te.t),y.append("rn"+Q,te.n),y.append("rd"+Q,te.d),y.append("ra"+Q,te.a),y.append("rh"+Q,te.h),y.append("rv"+Q,te.v),y.append("rsm"+Q,te.s.m),y.append("rsd"+Q,te.s.d),y.append("rem"+Q,te.e.m),y.append("red"+Q,te.e.d)}),await(await fetch("save",{method:"POST",body:y})).json(),l(3,f=!1),nn(n+"configuration")}let m=function(B,y){return B.includes(y)?B=B.filter(function(ne){return ne!==y}):B.push(y),B},_=function(){let B=a.o;B.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.001,s:{m:0,d:0},e:{m:0,d:0}}),l(1,a.o=B,a)},d=function(B){let y=a.o;y.splice(B,1),l(1,a.o=y,a)},v=function(B){if(B<=0)return;let y=a.o;var ne=y[B];y[B]=y[B-1],y[B-1]=ne,l(1,a.o=y,a)},g=function(B){let y=a.o;if(!(B>=y.length-1)){var ne=y[B];y[B]=y[B+1],y[B+1]=ne,l(1,a.o=y,a)}};function b(B,y){B[y].n=this.value,l(1,a)}function k(B,y){B[y].d=Kt(this),l(1,a)}function M(B,y){B[y].t=Kt(this),l(1,a)}function L(B,y){B[y].v=Fe(this.value),l(1,a)}const R=(B,y,ne,te)=>l(1,ne[te].a=m(B.a,y),a),F=(B,y,ne,te)=>l(1,ne[te].h=m(B.h,y),a),T=(B,y,ne,te)=>l(1,ne[te].h=m(B.h,y+8),a),A=(B,y,ne,te)=>l(1,ne[te].h=m(B.h,y+16),a);function O(B,y){B[y].s.d=Kt(this),l(1,a)}function j(B,y){B[y].s.m=Kt(this),l(1,a)}function K(B,y){B[y].e.d=Kt(this),l(1,a)}function G(B,y){B[y].e.m=Kt(this),l(1,a)}const q=B=>v(B),U=B=>v(B),Z=B=>g(B),V=B=>g(B),Y=B=>d(B),W=B=>d(B);return t.$$set=B=>{"basepath"in B&&l(11,n=B.basepath)},[i,a,r,f,o,c,m,_,d,v,g,n,b,k,M,L,R,F,T,A,O,j,K,G,q,U,Z,V,Y,W]}class q_ extends Nt{constructor(e){super(),Pt(this,e,T_,N_,St,{basepath:11},null,[-1,-1])}}function Yf(t,e,l){const n=t.slice();return n[13]=e[l],n[14]=e,n[15]=l,n}function Qf(t,e,l){const n=t.slice();return n[13]=e[l],n[16]=e,n[17]=l,n}function Xf(t){let e,l,n,i=ft(t[1]),o=[];for(let a=0;a{l(3,r=k)});let f=!1,c,m;async function _(){if(confirm("Clear all data?"))for(let k in i)(k.startsWith("i")||k.startsWith("e"))&&l(0,i[k]=0,i)}let d=!1;async function v(k){l(5,d=!0);const M=new FormData(k.target),L=new URLSearchParams;for(let F of M){const[T,A]=F;L.append(T,A)}await(await fetch(o,{method:"POST",body:L})).json(),l(5,d=!1),nn(a)}function g(k){i[k.key]=Fe(this.value),l(0,i)}function b(k){i[k.key]=Fe(this.value),l(0,i)}return t.$$set=k=>{"prefix"in k&&l(8,n=k.prefix),"data"in k&&l(0,i=k.data),"url"in k&&l(9,o=k.url),"basepath"in k&&l(10,a=k.basepath)},t.$$.update=()=>{if(t.$$.dirty&263){l(1,c=[]),l(2,m=[]);for(let k in i){let M=[];k.startsWith("i")?M=c:k.startsWith("e")&&(M=m,i[k]&&l(4,f=!0)),M.push({key:k,name:n+" "+k.substring(1),value:i[k]})}}},[i,c,m,r,f,d,_,v,n,o,a,g,b]}class Xu extends Nt{constructor(e){super(),Pt(this,e,D_,E_,St,{prefix:8,data:0,url:9,basepath:10})}}function A_(t){let e,l;return e=new n0({props:{data:t[7],sysinfo:t[8],importPrices:t[1],exportPrices:t[2],dayPlot:t[3],monthPlot:t[4],temperatures:t[5],translations:t[6],tariffData:t[9]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&128&&(o.data=n[7]),i&256&&(o.sysinfo=n[8]),i&2&&(o.importPrices=n[1]),i&4&&(o.exportPrices=n[2]),i&8&&(o.dayPlot=n[3]),i&16&&(o.monthPlot=n[4]),i&32&&(o.temperatures=n[5]),i&64&&(o.translations=n[6]),i&512&&(o.tariffData=n[9]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function O_(t){let e,l;return e=new Y0({props:{sysinfo:t[8],basepath:t[0],data:t[7]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.sysinfo=n[8]),i&1&&(o.basepath=n[0]),i&128&&(o.data=n[7]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function L_(t){let e,l;return e=new q_({props:{basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function I_(t){let e,l;return e=new o_({props:{sysinfo:t[8],data:t[7]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.sysinfo=n[8]),i&128&&(o.data=n[7]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function R_(t){let e,l;return e=new no({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p:ze,i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function F_(t){let e,l;return e=new no({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p:ze,i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function B_(t){let e,l;return e=new no({props:{title:"private key",action:"/mqtt-key"}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p:ze,i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function U_(t){let e,l;return e=new w_({props:{sysinfo:t[8],basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.sysinfo=n[8]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function j_(t){let e,l;return e=new h_({props:{sysinfo:t[8]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.sysinfo=n[8]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function H_(t){let e,l;return e=new c_({props:{sysinfo:t[8],basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.sysinfo=n[8]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function z_(t){let e,l;return e=new Xu({props:{prefix:"UTC Hour",data:t[3],url:"/dayplot",basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&8&&(o.data=n[3]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function y_(t){let e,l;return e=new Xu({props:{prefix:"Day",data:t[4],url:"/monthplot",basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&16&&(o.data=n[4]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function W_(t){let e,l,n,i,o,a,r,f,c,m,_,d,v,g,b,k,M,L,R,F,T,A,O,j,K,G;return e=new oc({props:{data:t[7],basepath:t[0]}}),n=new bl({props:{path:"/",$$slots:{default:[A_]},$$scope:{ctx:t}}}),o=new bl({props:{path:"/configuration",$$slots:{default:[O_]},$$scope:{ctx:t}}}),r=new bl({props:{path:"/priceconfig",$$slots:{default:[L_]},$$scope:{ctx:t}}}),c=new bl({props:{path:"/status",$$slots:{default:[I_]},$$scope:{ctx:t}}}),_=new bl({props:{path:"/mqtt-ca",$$slots:{default:[R_]},$$scope:{ctx:t}}}),v=new bl({props:{path:"/mqtt-cert",$$slots:{default:[F_]},$$scope:{ctx:t}}}),b=new bl({props:{path:"/mqtt-key",$$slots:{default:[B_]},$$scope:{ctx:t}}}),M=new bl({props:{path:"/consent",$$slots:{default:[U_]},$$scope:{ctx:t}}}),R=new bl({props:{path:"/setup",$$slots:{default:[j_]},$$scope:{ctx:t}}}),T=new bl({props:{path:"/vendor",$$slots:{default:[H_]},$$scope:{ctx:t}}}),O=new bl({props:{path:"/edit-day",$$slots:{default:[z_]},$$scope:{ctx:t}}}),K=new bl({props:{path:"/edit-month",$$slots:{default:[y_]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment),l=h(),Ne(n.$$.fragment),i=h(),Ne(o.$$.fragment),a=h(),Ne(r.$$.fragment),f=h(),Ne(c.$$.fragment),m=h(),Ne(_.$$.fragment),d=h(),Ne(v.$$.fragment),g=h(),Ne(b.$$.fragment),k=h(),Ne(M.$$.fragment),L=h(),Ne(R.$$.fragment),F=h(),Ne(T.$$.fragment),A=h(),Ne(O.$$.fragment),j=h(),Ne(K.$$.fragment)},m(q,U){Me(e,q,U),N(q,l,U),Me(n,q,U),N(q,i,U),Me(o,q,U),N(q,a,U),Me(r,q,U),N(q,f,U),Me(c,q,U),N(q,m,U),Me(_,q,U),N(q,d,U),Me(v,q,U),N(q,g,U),Me(b,q,U),N(q,k,U),Me(M,q,U),N(q,L,U),Me(R,q,U),N(q,F,U),Me(T,q,U),N(q,A,U),Me(O,q,U),N(q,j,U),Me(K,q,U),G=!0},p(q,U){const Z={};U&128&&(Z.data=q[7]),U&1&&(Z.basepath=q[0]),e.$set(Z);const V={};U&5118&&(V.$$scope={dirty:U,ctx:q}),n.$set(V);const Y={};U&4481&&(Y.$$scope={dirty:U,ctx:q}),o.$set(Y);const W={};U&4097&&(W.$$scope={dirty:U,ctx:q}),r.$set(W);const B={};U&4480&&(B.$$scope={dirty:U,ctx:q}),c.$set(B);const y={};U&4096&&(y.$$scope={dirty:U,ctx:q}),_.$set(y);const ne={};U&4096&&(ne.$$scope={dirty:U,ctx:q}),v.$set(ne);const te={};U&4096&&(te.$$scope={dirty:U,ctx:q}),b.$set(te);const Q={};U&4353&&(Q.$$scope={dirty:U,ctx:q}),M.$set(Q);const se={};U&4352&&(se.$$scope={dirty:U,ctx:q}),R.$set(se);const ue={};U&4353&&(ue.$$scope={dirty:U,ctx:q}),T.$set(ue);const fe={};U&4105&&(fe.$$scope={dirty:U,ctx:q}),O.$set(fe);const le={};U&4113&&(le.$$scope={dirty:U,ctx:q}),K.$set(le)},i(q){G||(X(e.$$.fragment,q),X(n.$$.fragment,q),X(o.$$.fragment,q),X(r.$$.fragment,q),X(c.$$.fragment,q),X(_.$$.fragment,q),X(v.$$.fragment,q),X(b.$$.fragment,q),X(M.$$.fragment,q),X(R.$$.fragment,q),X(T.$$.fragment,q),X(O.$$.fragment,q),X(K.$$.fragment,q),G=!0)},o(q){ee(e.$$.fragment,q),ee(n.$$.fragment,q),ee(o.$$.fragment,q),ee(r.$$.fragment,q),ee(c.$$.fragment,q),ee(_.$$.fragment,q),ee(v.$$.fragment,q),ee(b.$$.fragment,q),ee(M.$$.fragment,q),ee(R.$$.fragment,q),ee(T.$$.fragment,q),ee(O.$$.fragment,q),ee(K.$$.fragment,q),G=!1},d(q){q&&(P(l),P(i),P(a),P(f),P(m),P(d),P(g),P(k),P(L),P(F),P(A),P(j)),Pe(e,q),Pe(n,q),Pe(o,q),Pe(r,q),Pe(c,q),Pe(_,q),Pe(v,q),Pe(b,q),Pe(M,q),Pe(R,q),Pe(T,q),Pe(O,q),Pe(K,q)}}}function xf(t){let e,l,n,i;const o=[V_,G_],a=[];function r(f,c){return f[8].trying?0:1}return e=r(t),l=a[e]=o[e](t),{c(){l.c(),n=Wt()},m(f,c){a[e].m(f,c),N(f,n,c),i=!0},p(f,c){let m=e;e=r(f),e===m?a[e].p(f,c):(mt(),ee(a[m],1,1,()=>{a[m]=null}),pt(),l=a[e],l?l.p(f,c):(l=a[e]=o[e](f),l.c()),X(l,1),l.m(n.parentNode,n))},i(f){i||(X(l),i=!0)},o(f){ee(l),i=!1},d(f){f&&P(n),a[e].d(f)}}}function G_(t){let e,l;return e=new cl({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p:ze,i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function V_(t){let e,l;return e=new cl({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[8].trying}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.message="Device is booting, please wait. Trying to reach it on "+n[8].trying),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){ee(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function K_(t){let e,l,n,i;l=new Nu({props:{basepath:t[0],$$slots:{default:[W_]},$$scope:{ctx:t}}});let o=t[8].booting&&xf(t);return{c(){e=p("div"),Ne(l.$$.fragment),n=h(),o&&o.c(),u(e,"class","container mx-auto m-3")},m(a,r){N(a,e,r),Me(l,e,null),s(e,n),o&&o.m(e,null),i=!0},p(a,[r]){const f={};r&1&&(f.basepath=a[0]),r&5119&&(f.$$scope={dirty:r,ctx:a}),l.$set(f),a[8].booting?o?(o.p(a,r),r&256&&X(o,1)):(o=xf(a),o.c(),X(o,1),o.m(e,null)):o&&(mt(),ee(o,1,1,()=>{o=null}),pt())},i(a){i||(X(l.$$.fragment,a),X(o),i=!0)},o(a){ee(l.$$.fragment,a),ee(o),i=!1},d(a){a&&P(e),Pe(l),o&&o.d()}}}function Y_(t,e,l){let n=document.getElementsByTagName("base")[0].getAttribute("href");n||(n="/");let i;Lu.subscribe(b=>{l(1,i=b)});let o;Iu.subscribe(b=>{l(2,o=b)});let a;Fu.subscribe(b=>{l(3,a=b)});let r;Bu.subscribe(b=>{l(4,r=b)});let f;Uu.subscribe(b=>{l(5,f=b)});let c={};kl.subscribe(b=>{l(6,c=b)});let m,_={},d={},v;_l.subscribe(b=>{var k;l(8,d=b),d.vndcfg===!1?nn(n+"vendor"):d.usrcfg===!1?nn(n+"setup"):d.fwconsent===0&&nn(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!=((k=c==null?void 0:c.language)==null?void 0:k.code)&&zu(d.ui.lang),d.version&&v&&d.version!=v&&window.location.reload(),v=d.version,m&&clearTimeout(m),m=setTimeout(_i,!_||!_.u||_.u<30||d!=null&&d.upgrading?1e4:3e5)}),P1.subscribe(b=>{l(7,_=b),Vc(b)});let g={};return Hu.subscribe(b=>{l(9,g=b)}),ju(),[n,i,o,a,r,f,c,_,d,g]}class Q_ extends Nt{constructor(e){super(),Pt(this,e,Y_,K_,St,{})}}new Q_({target:document.getElementById("app")}); +Occurred in: ${i}`:"",a=Zi(t),r=fu(e)?e(a):e;return`<${a}> ${r}${o}`}const Cu=t=>(...e)=>t(Er(...e)),Su=Cu(t=>{throw new Error(t)}),ui=Cu(console.warn),So=4,Dr=3,Ar=2,Or=1,Lr=1;function Ir(t,e){const l=t.default?0:ql(t.fullPath).reduce((n,i)=>{let o=n;return o+=So,kr(i)?o+=Lr:wr(i)?o+=Ar:hu(i)?o-=So+Or:o+=Dr,o},0);return{route:t,score:l,index:e}}function Rr(t){return t.map(Ir).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function Mu(t,e){let l,n;const[i]=e.split("?"),o=ql(i),a=o[0]==="",r=Rr(t);for(let f=0,c=r.length;f({...m,params:d,uri:M});if(m.default){n=v(e);continue}const g=ql(m.fullPath),b=Math.max(o.length,g.length);let k=0;for(;k{c===".."?f.pop():c!=="."&&f.push(c)}),di(`/${f.join("/")}`,n)}function Mo(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,a=ql(e,!0),r=ql(l,!0);for(;a.length;)a[0]!==r[0]&&Su(_n,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),a.shift(),r.shift();return{pathname:Qn(...r),hash:n,search:i,state:o}}const Po=t=>t.length===1?"":t,Ji=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?Po(Fn(t,l)):"",a=i?Fn(t,0,l):t,r=n?Po(Fn(a,e)):"";return{pathname:(n?Fn(a,0,e):a)||"/",search:r,hash:o}},Br=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function Ur(t,e,l){return Qn(l,Fr(t,e))}function jr(t,e){const l=Qi(Cr(t)),n=ql(l,!0),i=ql(e,!0).slice(0,n.length),o=Pu({fullPath:l},Qn(...i));return o&&o.uri}const hi="POP",zr="PUSH",Hr="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 yr(t){let e=[],l=vi(t),n=hi;const i=(o=e)=>o.forEach(a=>a({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const a=()=>{l=vi(t),n=hi,i([o])};i([o]);const r=cu(t,"popstate",a);return()=>{r(),e=e.filter(f=>f!==o)}},navigate(o,a){const{state:r={},replace:f=!1}=a||{};if(n=f?Hr:zr,uu(o))a&&ui(wu,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=hi,t.history.go(o);else{const c={...r,_key:hr()};try{t.history[f?"replaceState":"pushState"](c,"",o)}catch{t.location[f?"replace":"assign"](o)}}l=vi(t),i()}}}function bi(t,e){return{...Ji(e),state:t}}function Wr(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,o){e++,l=l.slice(0,e),l.push(bi(n,o))},replaceState(n,i,o){l[e]=bi(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const Gr=!!(!Ol&&window.document&&window.document.createElement),Vr=!Ol&&window.location.origin==="null",Nu=yr(Gr&&!Vr?window:Wr()),{navigate:nn}=Nu;let El=null,Tu=!0;function Kr(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nEl.level||t.level===El.level&&Kr(t.routerId,El.routerId))&&(El=t)}function Qr(){El=null}function Xr(){Tu=!1}function No(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=cu(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function Zr(t,e){return Number(t.dataset.svnavRouteEnd)===e}function Jr(t){return/^H[1-6]$/i.test(t.tagName)}function To(t,e=document){return e.querySelector(t)}function $r(t){let l=To(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!Zr(l,t);){if(Jr(l))return l;const n=To("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function xr(t){Promise.resolve(rn(t.focusElement)).then(e=>{const l=e||$r(t.id);l||ui(_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,ci),!No(l)&&No(document.documentElement)})}const e1=(t,e,l)=>(n,i)=>rr().then(()=>{if(!El||Tu){Xr();return}if(n&&xr(El.route),t.announcements&&i){const{path:o,fullPath:a,meta:r,params:f,uri:c}=El.route,m=t.createAnnouncement({path:o,fullPath:a,meta:r,params:f,uri:c},rn(l));Promise.resolve(m).then(_=>{e.set(_)})}Qr()}),t1="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 l1(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},_u(t[6],t1)],i={};for(let o=0;o`Navigated to ${Y.uri}`,announcements:!0,...g},M=m,O=Qi(m),F=on(Pi),I=on(Mn),T=!F,A=i1(),R=v&&!(I&&!I.manageFocus),j=fl("");Tl(t,j,Y=>l(0,r=Y));const V=I?I.disableInlineStyles:b,H=fl([]);Tl(t,H,Y=>l(20,a=Y));const q=fl(null);Tl(t,q,Y=>l(18,i=Y));let U=!1;const Z=T?0:I.level+1,Q=T?fl((()=>Mo(Ol?Ji(_):d.location,O))()):F;Tl(t,Q,Y=>l(17,n=Y));const K=fl(n);Tl(t,K,Y=>l(19,o=Y));const B=e1(k,j,Q),W=Y=>le=>le.filter(ue=>ue.id!==Y);function ie(Y){if(Ol){if(U)return;const le=Pu(Y,n.pathname);if(le)return U=!0,le}else H.update(le=>{const ue=W(Y.id)(le);return ue.push(Y),ue})}function ee(Y){H.update(W(Y))}return!T&&m!==qo&&ui(_n,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:m}),T&&(Yi(()=>d.listen(le=>{const ue=Mo(le.location,O);K.set(n),Q.set(ue)})),jn(Pi,Q)),jn(Mn,{activeRoute:q,registerRoute:ie,unregisterRoute:ee,manageFocus:R,level:Z,id:A,history:T?d:I.history,basepath:T?O:I.basepath,disableInlineStyles:V}),t.$$set=Y=>{"basepath"in Y&&l(11,m=Y.basepath),"url"in Y&&l(12,_=Y.url),"history"in Y&&l(13,d=Y.history),"primary"in Y&&l(14,v=Y.primary),"a11y"in Y&&l(15,g=Y.a11y),"disableInlineStyles"in Y&&l(16,b=Y.disableInlineStyles),"$$scope"in Y&&l(21,c=Y.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&m!==M&&ui(_n,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const Y=Mu(a,n.pathname);q.set(Y)}if(t.$$.dirty[0]&655360&&T){const Y=!!n.hash,le=!Y&&R,ue=!Y||n.pathname!==o.pathname;B(le,ue)}t.$$.dirty[0]&262144&&R&&i&&i.primary&&Yr({level:Z,routerId:A,route:i})},[r,k,T,A,R,j,V,H,q,Q,K,m,_,d,v,g,b,n,i,o,a,c,f]}class s1 extends Nt{constructor(e){super(),Pt(this,e,o1,n1,St,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const qu=s1;function Xn(t,e,l=Mn,n=_n){on(l)||Su(t,o=>`You cannot use ${o} outside of a ${Zi(n)}.`,e)}const a1=t=>{const{subscribe:e}=on(t);return{subscribe:e}};function Eu(){return Xn(bu),a1(Pi)}function Du(){const{history:t}=on(Mn);return t}function Au(){const t=on(pu);return t?vr(t,e=>e.base):fl("/")}function Ou(){Xn(ku);const t=Au(),{basepath:e}=on(Mn);return n=>Ur(n,rn(t),e)}function f1(){Xn(gu);const t=Ou(),{navigate:e}=Du();return(n,i)=>{const o=uu(n)?n:t(n);return e(o,i)}}const u1=t=>({params:t&16,location:t&8}),Eo=t=>({params:Ol?rn(t[10]):t[4],location:t[3],navigate:t[11]});function Do(t){let e,l;return e=new qu({props:{primary:t[1],$$slots:{default:[_1]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function r1(t){let e;const l=t[18].default,n=yi(l,t,t[19],Eo);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&Gi(n,l,i,i[19],e?Wi(l,i[19],o,u1):Vi(i[19]),Eo)},i(i){e||(X(n,i),e=!0)},o(i){te(n,i),e=!1},d(i){n&&n.d(i)}}}function c1(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Ol?rn(t[10]):t[4],t[12]];var o=t[0];function a(r,f){let c={};for(let m=0;m{Pe(c,1)}),mt()}o?(e=ko(o,a(r,f)),Ne(e.$$.fragment),X(e.$$.fragment,1),Me(e,l.parentNode,l)):e=null}else if(o){const c=f&7192?Si(i,[f&8&&{location:r[3]},f&2048&&{navigate:r[11]},f&1040&&$n(Ol?rn(r[10]):r[4]),f&4096&&$n(r[12])]):{};e.$set(c)}},i(r){n||(e&&X(e.$$.fragment,r),n=!0)},o(r){e&&te(e.$$.fragment,r),n=!1},d(r){r&&P(l),e&&Pe(e,r)}}}function _1(t){let e,l,n,i;const o=[c1,r1],a=[];function r(f,c){return f[0]!==null?0:1}return e=r(t),l=a[e]=o[e](t),{c(){l.c(),n=yt()},m(f,c){a[e].m(f,c),N(f,n,c),i=!0},p(f,c){let m=e;e=r(f),e===m?a[e].p(f,c):(_t(),te(a[m],1,1,()=>{a[m]=null}),mt(),l=a[e],l?l.p(f,c):(l=a[e]=o[e](f),l.c()),X(l,1),l.m(n.parentNode,n))},i(f){i||(X(l),i=!0)},o(f){te(l),i=!1},d(f){f&&P(n),a[e].d(f)}}}function m1(t){let e,l,n,i,o,a=[Mi(t[7]),{"data-svnav-route-start":t[5]}],r={};for(let _=0;_{f=null}),mt())},i(_){o||(X(f),o=!0)},o(_){te(f),o=!1},d(_){_&&(P(e),P(l),P(n),P(i)),f&&f.d(_)}}}const p1=ru();function d1(t,e,l){let n;const i=["path","component","meta","primary"];let o=ai(e,i),a,r,f,c,{$$slots:m={},$$scope:_}=e,{path:d=""}=e,{component:v=null}=e,{meta:g={}}=e,{primary:b=!0}=e;Xn(ci,e);const k=p1(),{registerRoute:M,unregisterRoute:O,activeRoute:F,disableInlineStyles:I}=on(Mn);Tl(t,F,U=>l(16,a=U));const T=Au();Tl(t,T,U=>l(17,f=U));const A=Eu();Tl(t,A,U=>l(3,r=U));const R=fl(null);let j;const V=fl(),H=fl({});Tl(t,H,U=>l(4,c=U)),jn(pu,V),jn(br,H),jn(gr,R);const q=f1();return Ol||fr(()=>O(k)),t.$$set=U=>{l(24,e=Cl(Cl({},e),si(U))),l(12,o=ai(e,i)),"path"in U&&l(13,d=U.path),"component"in U&&l(0,v=U.component),"meta"in U&&l(14,g=U.meta),"primary"in U&&l(1,b=U.primary),"$$scope"in U&&l(19,_=U.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const U=d==="",Z=Qn(f,d),G={id:k,path:d,meta:g,default:U,fullPath:U?"":Z,base:U?f:jr(Z,r.pathname),primary:b,focusElement:R};V.set(G),l(15,j=M(G))}if(t.$$.dirty&98304&&l(2,n=!!(j||a&&a.id===k)),t.$$.dirty&98308&&n){const{params:U}=j||a;H.set(U)}},e=si(e),[v,b,n,r,c,k,F,I,T,A,H,q,o,d,g,j,a,f,m,_]}class h1 extends Nt{constructor(e){super(),Pt(this,e,d1,m1,St,{path:13,component:0,meta:14,primary:1})}}const wl=h1;function v1(t){let e,l,n,i;const o=t[13].default,a=yi(o,t,t[12],null);let r=[{href:t[0]},t[2],t[1]],f={};for(let c=0;cl(11,_=R));const F=ur(),I=Ou(),{navigate:T}=Du();function A(R){F("click",R),dr(R)&&(R.preventDefault(),T(n,{state:k,replace:a||b}))}return t.$$set=R=>{l(19,e=Cl(Cl({},e),si(R))),l(18,m=ai(e,c)),"to"in R&&l(5,g=R.to),"replace"in R&&l(6,b=R.replace),"state"in R&&l(7,k=R.state),"getProps"in R&&l(8,M=R.getProps),"$$scope"in R&&l(12,v=R.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=I(g,_)),t.$$.dirty&2049&&l(10,i=Ni(_.pathname,n)),t.$$.dirty&2049&&l(9,o=n===_.pathname),t.$$.dirty&2049&&(a=Ji(n)===Br(_)),t.$$.dirty&512&&l(2,r=o?{"aria-current":"page"}:{}),l(1,f=(()=>{if(fu(M)){const R=M({location:_,href:n,isPartiallyCurrent:i,isCurrent:o});return{...m,...R}}return m})())},e=si(e),[n,f,r,O,A,g,b,k,M,o,i,_,v,d]}class g1 extends Nt{constructor(e){super(),Pt(this,e,b1,v1,St,{to:5,replace:6,state:7,getProps:8})}}const gl=g1;function tn(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function k1(t,e){return t>218&&t<242?"#23ac05":t>212&&t<248?"#b1d900":t>208&&t<252?"#a3b200":"#b20000"}function $i(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 yn(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 Dt(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function Xe(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";case 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 zn(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Qt(t,e){return t==1||t==2&&e}function hl(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 Cn(t,e){return t.setTime(t.getTime()+e*36e5),t}function w1(t,e){return t.setTime(t.getTime()+e*6e4),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 S1(t){return t=="EOE"?"https://transparency.entsoe.eu/":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}let xn=0;function Wn(t,e){var l="";xn++;var n=function(){setTimeout(Wn,1e3,t,e)};if(t.net.ip&&xn%3==0){if(!t.net.ip){n();return}l="http://"+t.net.ip}else t.hostname&&xn%3==1?l="http://"+t.hostname:t.hostname&&xn%3==2?l="http://"+t.hostname+".local":l="";console&&console.log("Trying url "+l),e&&e(l);var i=new XMLHttpRequest;i.timeout=5e3,i.addEventListener("abort",n),i.addEventListener("error",n),i.addEventListener("timeout",n),i.addEventListener("load",function(o){window.location.href=l||"/"}),i.open("GET",l+"/is-alive",!0),i.send()}function ol(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Ao(t){return t.startsWith("esp32")?"esp32":t}function _l(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 Gn(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 cn="((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}",Ll="[\\x20-\\x7E]+",Pn="[\\x20-\\xFF]+",Vn="[A-Za-z0-9_\\-]+",Lu="[0-9A-Fa-f]+",Rn="[0-9]+",ii={},Ti=[];async function M1(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),o=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),o}let gi;async function Iu(){if(Ti.length){let t=Ti.shift();delete ii[t.resource];try{let e=await M1(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(Iu,100)}Iu();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 _i(){Nl=await(await kl("sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),pl.set(Nl)}const pl=fl(Nl,t=>(_i(),function(){}));function P1(t){pl.update(e=>(e.trying=t,e))}let ei=0,Oo=-127,Lo=null,N1={};const T1=mu(N1,t=>{let e,l;async function n(){kl("data.json").then(i=>i.json()).then(i=>{t(i),Oo!=i.t&&(Oo=i.t,setTimeout(q1,2e3)),Lo==null&&i.pe&&i.p!=null&&(Lo=i.p,Bu()),(!Nl||!Nl.chip||Nl.booting||ei>1&&!zn(Nl.board))&&(_i(),Dl&&clearTimeout(Dl),Dl=setTimeout(Di,2e3),Al&&clearTimeout(Al),Al=setTimeout(Oi,3e3)),i.u,Dl||(Dl=Di()),Al||(Al=Oi());let o=5e3;if(zn(Nl.board)&&i.v>2.5){let a=3.3-Math.min(3.3,i.v);a>0&&(o=Math.max(a,.1)*10*5e3)}o>5e3&&console.log("Next in "+o+"ms"),e&&clearTimeout(e),e=setTimeout(n,o),ei=0}).catch(i=>{ei++,ei>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(n,15e3),l||(l=setTimeout(Wn,5e3,Nl,P1))):e=setTimeout(n,zn(Nl.board)?1e4:5e3)})}return n(),function(){clearTimeout(e)}});let ti,bn={};const Ru=fl(bn);let qi={};const Fu=fl(qi);async function Bu(){ti&&(clearTimeout(ti),ti=0),bn=await(await kl("importprice.json")).json(),Ru.set(bn),bn!=null&&bn.importExportPriceDifferent&&(qi=await(await kl("exportprice.json")).json(),Fu.set(qi)),ti=setTimeout(Bu,(24-new Date().getHours())*36e5+10)}let Ei={},Dl;async function Di(){Dl&&(clearTimeout(Dl),Dl=0),Ei=await(await kl("dayplot.json")).json(),Uu.set(Ei),Dl=setTimeout(Di,(60-new Date().getMinutes())*6e4+20)}const Uu=fl(Ei,t=>function(){});let Ai={},Al;async function Oi(){Al&&(clearTimeout(Al),Al=0),Ai=await(await kl("monthplot.json")).json(),ju.set(Ai),Al=setTimeout(Oi,(24-new Date().getHours())*36e5+40)}const ju=fl(Ai,t=>function(){});let Li={};async function q1(){Li=await(await kl("temperature.json")).json(),zu.set(Li)}const zu=fl(Li,t=>function(){});let Ii={},li;async function Hu(){li&&(clearTimeout(li),li=0),Ii=await(await kl("tariff.json")).json(),yu.set(Ii),li=setTimeout(Hu,(60-new Date().getMinutes())*6e4+30)}const yu=fl(Ii,t=>function(){});let gn={c:-1,n:[]};async function E1(){let e=await(await kl("wifiscan.json",{timeout:3e4})).json(),l=[];gn.c=0,gn.n=[];for(let n=0;n(E1(),function(){}));let Ri=!1;const Sl=fl(Ri);async function Wu(t){Ri=await(await kl("translations.json"+(t?"?lang="+t:""))).json(),Sl.set(Ri)}Wu();function Io(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 Gu(t){return await(await fetch("upgrade?expected_version="+t,{method:"POST"})).json()}function Ro(t){var f;let e=(((f=t[1].header)==null?void 0:f.uptime)??"Up")+"",l,n,i;function o(c,m){return c[2]>1?F1:c[2]>0?R1:c[3]>1?I1:c[3]>0?L1:c[4]>1?O1:c[4]>0?A1:D1}let a=o(t),r=a(t);return{c(){l=S(e),n=h(),r.c(),i=yt()},m(c,m){N(c,l,m),N(c,n,m),r.m(c,m),N(c,i,m)},p(c,m){var _;m&2&&e!==(e=(((_=c[1].header)==null?void 0:_.uptime)??"Up")+"")&&E(l,e),a===(a=o(c))&&r?r.p(c,m):(r.d(1),r=a(c),r&&(r.c(),r.m(i.parentNode,i)))},d(c){c&&(P(l),P(n),P(i)),r.d(c)}}}function D1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.seconds)??"s")+"",i;return{c(){e=S(t[0]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&1&&E(e,a[0]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.seconds)??"s")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function A1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.minute)??"m")+"",i;return{c(){e=S(t[4]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&16&&E(e,a[4]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.minute)??"m")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function O1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.minutes)??"m")+"",i;return{c(){e=S(t[4]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&16&&E(e,a[4]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.minutes)??"m")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function L1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.hour)??"h")+"",i;return{c(){e=S(t[3]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&8&&E(e,a[3]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.hour)??"h")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function I1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.hours)??"h")+"",i;return{c(){e=S(t[3]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&8&&E(e,a[3]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.hours)??"h")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function R1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.day)??"d")+"",i;return{c(){e=S(t[2]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&4&&E(e,a[2]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.day)??"d")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function F1(t){var o;let e,l,n=(((o=t[1].common)==null?void 0:o.days)??"d")+"",i;return{c(){e=S(t[2]),l=h(),i=S(n)},m(a,r){N(a,e,r),N(a,l,r),N(a,i,r)},p(a,r){var f;r&4&&E(e,a[2]),r&2&&n!==(n=(((f=a[1].common)==null?void 0:f.days)??"d")+"")&&E(i,n)},d(a){a&&(P(e),P(l),P(i))}}}function B1(t){let e,l=t[0]&&Ro(t);return{c(){l&&l.c(),e=yt()},m(n,i){l&&l.m(n,i),N(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Ro(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:He,o:He,d(n){n&&P(e),l&&l.d(n)}}}function U1(t,e,l){let{epoch:n}=e,i={};Sl.subscribe(f=>{l(1,i=f)});let o=0,a=0,r=0;return t.$$set=f=>{"epoch"in f&&l(0,n=f.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(2,o=Math.floor(n/86400)),l(3,a=Math.floor(n/3600)),l(4,r=Math.floor(n/60)))},[n,i,o,a,r]}class j1 extends Nt{constructor(e){super(),Pt(this,e,U1,B1,St,{epoch:0})}}function z1(t){let e,l,n;return{c(){e=p("span"),l=S(t[2]),u(e,"title",t[1]),u(e,"class",n="bd-"+t[0])},m(i,o){N(i,e,o),s(e,l)},p(i,[o]){o&4&&E(l,i[2]),o&2&&u(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&u(e,"class",n)},i:He,o:He,d(i){i&&P(e)}}}function H1(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=a=>{"color"in a&&l(0,n=a.color),"title"in a&&l(1,i=a.title),"text"in a&&l(2,o=a.text)},[n,i,o]}class fn extends Nt{constructor(e){super(),Pt(this,e,H1,z1,St,{color:0,title:1,text:2})}}function y1(t){let e,l=`${Dt(t[0].getDate())}.${Dt(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Dt(t[0].getHours())}:${Dt(t[0].getMinutes())}`,n;return{c(){e=p("span"),n=S(l),u(e,"class",t[1])},m(i,o){N(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Dt(i[0].getDate())}.${Dt(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Dt(i[0].getHours())}:${Dt(i[0].getMinutes())}`)&&E(n,l),o&2&&u(e,"class",i[1])},d(i){i&&P(e)}}}function W1(t){var n;let e=`${Dt(t[0].getDate())}. ${t[2].months?(n=t[2].months)==null?void 0:n[t[0].getMonth()]:Dt(t[0].getMonth()+1)} ${Dt(t[0].getHours())}:${Dt(t[0].getMinutes())}`,l;return{c(){l=S(e)},m(i,o){N(i,l,o)},p(i,o){var a;o&5&&e!==(e=`${Dt(i[0].getDate())}. ${i[2].months?(a=i[2].months)==null?void 0:a[i[0].getMonth()]:Dt(i[0].getMonth()+1)} ${Dt(i[0].getHours())}:${Dt(i[0].getMinutes())}`)&&E(l,e)},d(i){i&&P(l)}}}function G1(t){let e;function l(o,a){return o[3]?W1:y1}let n=l(t),i=n(t);return{c(){i.c(),e=yt()},m(o,a){i.m(o,a),N(o,e,a)},p(o,[a]){n===(n=l(o))&&i?i.p(o,a):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:He,o:He,d(o){o&&P(e),i.d(o)}}}function V1(t,e,l){let n={};Sl.subscribe(f=>{l(2,n=f)});let{timestamp:i}=e,{fullTimeColor:o}=e,{offset:a}=e,r;return t.$$set=f=>{"timestamp"in f&&l(0,i=f.timestamp),"fullTimeColor"in f&&l(1,o=f.fullTimeColor),"offset"in f&&l(4,a=f.offset)},t.$$.update=()=>{t.$$.dirty&17&&(l(3,r=Math.abs(new Date().getTime()-i.getTime())<3e5),isNaN(a)||Cn(i,a-(24+i.getHours()-i.getUTCHours())%24))},[i,o,n,r,a]}class Vu extends Nt{constructor(e){super(),Pt(this,e,V1,G1,St,{timestamp:0,fullTimeColor:1,offset:4})}}function K1(t){let e,l,n;return{c(){e=Ft("svg"),l=Ft("path"),n=Ft("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,o){N(i,e,o),s(e,l),s(e,n)},p:He,i:He,o:He,d(i){i&&P(e)}}}class Y1 extends Nt{constructor(e){super(),Pt(this,e,null,K1,St,{})}}function Q1(t){let e,l;return{c(){e=Ft("svg"),l=Ft("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){N(n,e,i),s(e,l)},p:He,i:He,o:He,d(n){n&&P(e)}}}class X1 extends Nt{constructor(e){super(),Pt(this,e,null,Q1,St,{})}}function Z1(t){let e,l;return{c(){e=Ft("svg"),l=Ft("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),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){N(n,e,i),s(e,l)},p:He,i:He,o:He,d(n){n&&P(e)}}}class J1 extends Nt{constructor(e){super(),Pt(this,e,null,Z1,St,{})}}function $1(t){let e,l,n=t[2].version+"",i;return{c(){e=S("AMS reader "),l=p("span"),i=S(n)},m(o,a){N(o,e,a),N(o,l,a),s(l,i)},p(o,a){a&4&&n!==(n=o[2].version+"")&&E(i,n)},d(o){o&&(P(e),P(l))}}}function Fo(t){let e,l=(t[1].t>-50?t[1].t.toFixed(1):"-")+"",n,i;return{c(){e=p("div"),n=S(l),i=S("°C"),u(e,"class","flex-none my-auto")},m(o,a){N(o,e,a),s(e,n),s(e,i)},p(o,a){a&2&&l!==(l=(o[1].t>-50?o[1].t.toFixed(1):"-")+"")&&E(n,l)},d(o){o&&P(e)}}}function Bo(t){var i,o,a;let e,l=(((i=t[4].header)==null?void 0:i.han)??"HAN")+": "+(((a=(o=t[4].errors)==null?void 0:o.han)==null?void 0:a[t[1].he])??t[1].he),n;return{c(){e=p("div"),n=S(l),u(e,"class","bd-red")},m(r,f){N(r,e,f),s(e,n)},p(r,f){var c,m,_;f&18&&l!==(l=(((c=r[4].header)==null?void 0:c.han)??"HAN")+": "+(((_=(m=r[4].errors)==null?void 0:m.han)==null?void 0:_[r[1].he])??r[1].he))&&E(n,l)},d(r){r&&P(e)}}}function Uo(t){var i,o,a;let e,l=(((i=t[4].header)==null?void 0:i.mqtt)??"MQTT")+": "+(((a=(o=t[4].errors)==null?void 0:o.mqtt)==null?void 0:a[t[1].me])??t[1].me),n;return{c(){e=p("div"),n=S(l),u(e,"class","bd-red")},m(r,f){N(r,e,f),s(e,n)},p(r,f){var c,m,_;f&18&&l!==(l=(((c=r[4].header)==null?void 0:c.mqtt)??"MQTT")+": "+(((_=(m=r[4].errors)==null?void 0:m.mqtt)==null?void 0:_[r[1].me])??r[1].me))&&E(n,l)},d(r){r&&P(e)}}}function jo(t){var i,o,a;let e,l=(((i=t[4].header)==null?void 0:i.price)??"PS")+": "+(((a=(o=t[4].errors)==null?void 0:o.price)==null?void 0:a[t[1].ee])??t[1].ee),n;return{c(){e=p("div"),n=S(l),u(e,"class","bd-red")},m(r,f){N(r,e,f),s(e,n)},p(r,f){var c,m,_;f&18&&l!==(l=(((c=r[4].header)==null?void 0:c.price)??"PS")+": "+(((_=(m=r[4].errors)==null?void 0:m.price)==null?void 0:_[r[1].ee])??r[1].ee))&&E(n,l)},d(r){r&&P(e)}}}function zo(t){let e,l,n,i,o,a,r,f;return l=new gl({props:{to:"/configuration",$$slots:{default:[x1]},$$scope:{ctx:t}}}),a=new gl({props:{to:"/status",$$slots:{default:[ec]},$$scope:{ctx:t}}}),{c(){var c,m;e=p("div"),Ne(l.$$.fragment),i=h(),o=p("div"),Ne(a.$$.fragment),u(e,"class","flex-none px-1 mt-1"),u(e,"title",n=((c=t[4].header)==null?void 0:c.config)??""),u(o,"class","flex-none px-1 mt-1"),u(o,"title",r=((m=t[4].header)==null?void 0:m.status)??"")},m(c,m){N(c,e,m),Me(l,e,null),N(c,i,m),N(c,o,m),Me(a,o,null),f=!0},p(c,m){var v,g;const _={};m&64&&(_.$$scope={dirty:m,ctx:c}),l.$set(_),(!f||m&16&&n!==(n=((v=c[4].header)==null?void 0:v.config)??""))&&u(e,"title",n);const d={};m&64&&(d.$$scope={dirty:m,ctx:c}),a.$set(d),(!f||m&16&&r!==(r=((g=c[4].header)==null?void 0:g.status)??""))&&u(o,"title",r)},i(c){f||(X(l.$$.fragment,c),X(a.$$.fragment,c),f=!0)},o(c){te(l.$$.fragment,c),te(a.$$.fragment,c),f=!1},d(c){c&&(P(e),P(i),P(o)),Pe(l),Pe(a)}}}function x1(t){let e,l;return e=new Y1({}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function ec(t){let e,l;return e=new X1({}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function tc(t){let e,l;function n(a,r){return a[2].security==0||a[1].a?ic:nc}let i=n(t),o=i(t);return{c(){var a;e=p("div"),o.c(),u(e,"class","flex-none mr-3 text-yellow-500"),u(e,"title",l=(((a=t[4].header)==null?void 0:a.new_version)??"New version")+": "+t[2].upgrade.n)},m(a,r){N(a,e,r),o.m(e,null)},p(a,r){var f;i===(i=n(a))&&o?o.p(a,r):(o.d(1),o=i(a),o&&(o.c(),o.m(e,null))),r&20&&l!==(l=(((f=a[4].header)==null?void 0:f.new_version)??"New version")+": "+a[2].upgrade.n)&&u(e,"title",l)},d(a){a&&P(e),o.d()}}}function lc(t){let e,l,n=t[2].upgrade.t+"",i,o,a=t[3].toFixed(1)+"",r,f;return{c(){e=p("div"),l=S("Upgrading to "),i=S(n),o=S(", "),r=S(a),f=S("%"),u(e,"class","flex-none mr-3 mt-1 text-yellow-300")},m(c,m){N(c,e,m),s(e,l),s(e,i),s(e,o),s(e,r),s(e,f)},p(c,m){m&4&&n!==(n=c[2].upgrade.t+"")&&E(i,n),m&8&&a!==(a=c[3].toFixed(1)+"")&&E(r,a)},d(c){c&&P(e)}}}function nc(t){var r;let e,l=(((r=t[4].header)==null?void 0:r.new_version)??"New version")+"",n,i,o=t[2].upgrade.n+"",a;return{c(){e=p("span"),n=S(l),i=S(": "),a=S(o)},m(f,c){N(f,e,c),s(e,n),s(e,i),s(e,a)},p(f,c){var m;c&16&&l!==(l=(((m=f[4].header)==null?void 0:m.new_version)??"New version")+"")&&E(n,l),c&4&&o!==(o=f[2].upgrade.n+"")&&E(a,o)},d(f){f&&P(e)}}}function ic(t){var m;let e,l,n=(((m=t[4].header)==null?void 0:m.new_version)??"New version")+"",i,o,a=t[2].upgrade.n+"",r,f,c;return{c(){e=p("button"),l=p("span"),i=S(n),o=S(": "),r=S(a),u(l,"class","mt-1"),u(e,"class","flex")},m(_,d){N(_,e,d),s(e,l),s(l,i),s(l,o),s(l,r),f||(c=re(e,"click",t[5]),f=!0)},p(_,d){var v;d&16&&n!==(n=(((v=_[4].header)==null?void 0:v.new_version)??"New version")+"")&&E(i,n),d&4&&a!==(a=_[2].upgrade.n+"")&&E(r,a)},d(_){_&&P(e),f=!1,c()}}}function oc(t){var pe,he;let e,l,n,i,o,a,r,f,c,m,_,d=(((pe=t[4].header)==null?void 0:pe.mem)??"Free")+"",v,g,b=(t[1].m?(t[1].m/1e3).toFixed(1):"-")+"",k,M,O,F,I,T,A,R,j,V,H,q,U,Z,G,Q,K,B,W,ie,ee,Y,le,ue,fe,ne,de,oe,_e,se,me;i=new gl({props:{to:"/",$$slots:{default:[$1]},$$scope:{ctx:t}}}),f=new j1({props:{epoch:t[1].u}});let we=t[1].t>-50&&Fo(t);I=new fn({props:{title:"ESP",text:t[2].booting?((he=t[4].header)==null?void 0:he.booting)??"Booting":t[1].v>2?t[1].v.toFixed(2)+"V":"ESP",color:tn(t[2].booting?2:t[1].em)}}),A=new fn({props:{title:"HAN",text:"HAN",color:tn(t[2].booting?9:t[1].hm)}}),j=new fn({props:{title:"WiFi",text:t[1].r?t[1].r.toFixed(0)+"dBm":"WiFi",color:tn(t[2].booting?9:t[1].wm)}}),H=new fn({props:{title:"MQTT",text:"MQTT",color:tn(t[2].booting?9:t[1].mm)}});let C=(t[1].he<0||t[1].he>0)&&Bo(t),w=t[1].me<0&&Uo(t),L=(t[1].ee>0||t[1].ee<0)&&jo(t);le=new Vu({props:{timestamp:t[1].c?new Date(t[1].c*1e3):new Date(0),offset:t[2].clock_offset,fullTimeColor:"text-red-500"}});let D=t[2].vndcfg&&t[2].usrcfg&&zo(t);oe=new J1({});function y(J,ve){if(J[2].upgrading)return lc;if(J[2].fwconsent===1&&J[2].upgrade.n)return tc}let $=y(t),ae=$&&$(t);return{c(){var J;e=p("nav"),l=p("div"),n=p("div"),Ne(i.$$.fragment),o=h(),a=p("div"),r=p("div"),Ne(f.$$.fragment),c=h(),we&&we.c(),m=h(),_=p("div"),v=S(d),g=S(": "),k=S(b),M=S("kb"),O=h(),F=p("div"),Ne(I.$$.fragment),T=h(),Ne(A.$$.fragment),R=h(),Ne(j.$$.fragment),V=h(),Ne(H.$$.fragment),q=h(),C&&C.c(),U=h(),w&&w.c(),Z=h(),L&&L.c(),G=h(),Q=p("div"),K=p("div"),B=p("a"),W=p("img"),ee=h(),Y=p("div"),Ne(le.$$.fragment),ue=h(),D&&D.c(),fe=h(),ne=p("div"),de=p("a"),Ne(oe.$$.fragment),se=h(),ae&&ae.c(),u(n,"class","flex text-lg text-gray-100 p-2"),u(r,"class","flex-none my-auto"),u(_,"class","flex-none my-auto"),u(a,"class","flex-none my-auto p-2 flex space-x-4"),u(F,"class","flex-auto flex-wrap my-auto justify-center p-2"),u(W,"class","logo"),oi(W.src,ie=(t[0]+"/logo.svg").replace("//","/"))||u(W,"src",ie),u(W,"alt","GitHub repo"),u(B,"class","float-right"),u(B,"href","https://github.com/UtilitechAS/amsreader-firmware"),u(B,"target","_blank"),u(B,"rel","noreferrer"),u(B,"aria-label","GitHub"),u(K,"class","flex-none"),u(Y,"class","flex-none my-auto px-2"),u(de,"href",hl("")),u(de,"target","_blank"),u(de,"rel","noreferrer"),u(ne,"class","flex-none px-1 mt-1"),u(ne,"title",_e=((J=t[4].header)==null?void 0:J.doc)??""),u(Q,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),u(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),u(e,"class","hdr")},m(J,ve){N(J,e,ve),s(e,l),s(l,n),Me(i,n,null),s(l,o),s(l,a),s(a,r),Me(f,r,null),s(a,c),we&&we.m(a,null),s(a,m),s(a,_),s(_,v),s(_,g),s(_,k),s(_,M),s(l,O),s(l,F),Me(I,F,null),s(F,T),Me(A,F,null),s(F,R),Me(j,F,null),s(F,V),Me(H,F,null),s(l,q),C&&C.m(l,null),s(l,U),w&&w.m(l,null),s(l,Z),L&&L.m(l,null),s(l,G),s(l,Q),s(Q,K),s(K,B),s(B,W),s(Q,ee),s(Q,Y),Me(le,Y,null),s(Q,ue),D&&D.m(Q,null),s(Q,fe),s(Q,ne),s(ne,de),Me(oe,de,null),s(Q,se),ae&&ae.m(Q,null),me=!0},p(J,[ve]){var Ze,kt,xe;const ke={};ve&68&&(ke.$$scope={dirty:ve,ctx:J}),i.$set(ke);const De={};ve&2&&(De.epoch=J[1].u),f.$set(De),J[1].t>-50?we?we.p(J,ve):(we=Fo(J),we.c(),we.m(a,m)):we&&(we.d(1),we=null),(!me||ve&16)&&d!==(d=(((Ze=J[4].header)==null?void 0:Ze.mem)??"Free")+"")&&E(v,d),(!me||ve&2)&&b!==(b=(J[1].m?(J[1].m/1e3).toFixed(1):"-")+"")&&E(k,b);const Te={};ve&22&&(Te.text=J[2].booting?((kt=J[4].header)==null?void 0:kt.booting)??"Booting":J[1].v>2?J[1].v.toFixed(2)+"V":"ESP"),ve&6&&(Te.color=tn(J[2].booting?2:J[1].em)),I.$set(Te);const Oe={};ve&6&&(Oe.color=tn(J[2].booting?9:J[1].hm)),A.$set(Oe);const Le={};ve&2&&(Le.text=J[1].r?J[1].r.toFixed(0)+"dBm":"WiFi"),ve&6&&(Le.color=tn(J[2].booting?9:J[1].wm)),j.$set(Le);const Ee={};ve&6&&(Ee.color=tn(J[2].booting?9:J[1].mm)),H.$set(Ee),J[1].he<0||J[1].he>0?C?C.p(J,ve):(C=Bo(J),C.c(),C.m(l,U)):C&&(C.d(1),C=null),J[1].me<0?w?w.p(J,ve):(w=Uo(J),w.c(),w.m(l,Z)):w&&(w.d(1),w=null),J[1].ee>0||J[1].ee<0?L?L.p(J,ve):(L=jo(J),L.c(),L.m(l,G)):L&&(L.d(1),L=null),(!me||ve&1&&!oi(W.src,ie=(J[0]+"/logo.svg").replace("//","/")))&&u(W,"src",ie);const Ie={};ve&2&&(Ie.timestamp=J[1].c?new Date(J[1].c*1e3):new Date(0)),ve&4&&(Ie.offset=J[2].clock_offset),le.$set(Ie),J[2].vndcfg&&J[2].usrcfg?D?(D.p(J,ve),ve&4&&X(D,1)):(D=zo(J),D.c(),X(D,1),D.m(Q,fe)):D&&(_t(),te(D,1,1,()=>{D=null}),mt()),(!me||ve&16&&_e!==(_e=((xe=J[4].header)==null?void 0:xe.doc)??""))&&u(ne,"title",_e),$===($=y(J))&&ae?ae.p(J,ve):(ae&&ae.d(1),ae=$&&$(J),ae&&(ae.c(),ae.m(Q,null)))},i(J){me||(X(i.$$.fragment,J),X(f.$$.fragment,J),X(I.$$.fragment,J),X(A.$$.fragment,J),X(j.$$.fragment,J),X(H.$$.fragment,J),X(le.$$.fragment,J),X(D),X(oe.$$.fragment,J),me=!0)},o(J){te(i.$$.fragment,J),te(f.$$.fragment,J),te(I.$$.fragment,J),te(A.$$.fragment,J),te(j.$$.fragment,J),te(H.$$.fragment,J),te(le.$$.fragment,J),te(D),te(oe.$$.fragment,J),me=!1},d(J){J&&P(e),Pe(i),Pe(f),we&&we.d(),Pe(I),Pe(A),Pe(j),Pe(H),C&&C.d(),w&&w.d(),L&&L.d(),Pe(le),D&&D.d(),Pe(oe),ae&&ae.d()}}}function sc(t,e,l){let{basepath:n="/"}=e,{data:i={}}=e,o={};function a(){var c;confirm((((c=f.header)==null?void 0:c.upgrade)??"Upgrade to {0}?").replace("{0}",o.upgrade.n))&&(Gu(o.upgrade.n),pl.update(m=>(m.upgrade.t=o.upgrade.n,m.upgrade.p=0,m.upgrading=!0,m)))}let r;pl.subscribe(c=>{l(2,o=c)});let f={};return Sl.subscribe(c=>{l(4,f=c)}),t.$$set=c=>{"basepath"in c&&l(0,n=c.basepath),"data"in c&&l(1,i=c.data)},t.$$.update=()=>{t.$$.dirty&4&&l(3,r=Math.max(0,o.upgrade.p))},[n,i,o,r,f,a]}class ac extends Nt{constructor(e){super(),Pt(this,e,sc,oc,St,{basepath:0,data:1})}}function fc(t){let e,l,n,i;return{c(){e=Ft("svg"),l=Ft("path"),n=Ft("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(o,a){N(o,e,a),s(e,l),s(e,n)},p(o,[a]){a&1&&i!==(i=ki(150,150,115,210,210+300*o[0]/100))&&u(n,"d",i),a&2&&u(n,"stroke",o[1])},i:He,o:He,d(o){o&&P(e)}}}function Ho(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 o=Ho(t,e,l,i),a=Ho(t,e,l,n),r=i-n<=180?"0":"1",f=["M",o.x,o.y,"A",l,l,0,r,0,a.x,a.y].join(" ");return f}function uc(t,e,l){let{pct:n=0}=e,{color:i="red"}=e;return t.$$set=o=>{"pct"in o&&l(0,n=o.pct),"color"in o&&l(1,i=o.color)},[n,i]}class rc extends Nt{constructor(e){super(),Pt(this,e,uc,fc,St,{pct:0,color:1})}}function yo(t){let e,l,n,i=t[1][0]+"",o,a,r,f=t[1][1]+"",c,m;return{c(){e=p("br"),l=h(),n=p("span"),o=S(i),a=h(),r=p("span"),c=S(f),m=S("/kWh"),u(n,"class","pl-sub"),u(r,"class","pl-snt")},m(_,d){N(_,e,d),N(_,l,d),N(_,n,d),s(n,o),N(_,a,d),N(_,r,d),s(r,c),s(r,m)},p(_,d){d&2&&i!==(i=_[1][0]+"")&&E(o,i),d&2&&f!==(f=_[1][1]+"")&&E(c,f)},d(_){_&&(P(e),P(l),P(n),P(a),P(r))}}}function cc(t){let e,l,n,i,o,a,r,f,c,m,_=t[3][0]+"",d,v,g,b=t[3][1]+"",k,M,O;l=new rc({props:{pct:t[4],color:t[2](t[4],document.documentElement.classList.contains("dark"))}});let F=t[1]&&yo(t);return{c(){e=p("div"),Ne(l.$$.fragment),n=h(),i=p("span"),o=p("span"),a=S(t[0]),r=h(),f=p("br"),c=h(),m=p("span"),d=S(_),v=h(),g=p("span"),k=S(b),M=h(),F&&F.c(),u(o,"class","pl-lab"),u(m,"class","pl-val"),u(g,"class","pl-unt"),u(i,"class","pl-ov"),u(e,"class","pl-root")},m(I,T){N(I,e,T),Me(l,e,null),s(e,n),s(e,i),s(i,o),s(o,a),s(i,r),s(i,f),s(i,c),s(i,m),s(m,d),s(i,v),s(i,g),s(g,k),s(i,M),F&&F.m(i,null),O=!0},p(I,[T]){const A={};T&16&&(A.pct=I[4]),T&20&&(A.color=I[2](I[4],document.documentElement.classList.contains("dark"))),l.$set(A),(!O||T&1)&&E(a,I[0]),(!O||T&8)&&_!==(_=I[3][0]+"")&&E(d,_),(!O||T&8)&&b!==(b=I[3][1]+"")&&E(k,b),I[1]?F?F.p(I,T):(F=yo(I),F.c(),F.m(i,null)):F&&(F.d(1),F=null)},i(I){O||(X(l.$$.fragment,I),O=!0)},o(I){te(l.$$.fragment,I),O=!1},d(I){I&&P(e),Pe(l),F&&F.d()}}}function _c(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:a}=e,{sub:r=["",""]}=e,{colorFn:f}=e,c,m=0;return t.$$set=_=>{"val"in _&&l(5,n=_.val),"max"in _&&l(6,i=_.max),"unit"in _&&l(7,o=_.unit),"label"in _&&l(0,a=_.label),"sub"in _&&l(1,r=_.sub),"colorFn"in _&&l(2,f=_.colorFn)},t.$$.update=()=>{t.$$.dirty&224&&(l(3,c=_l(n,o)),l(4,m=Math.min(n,i)/i*100))},[a,r,f,c,m,n,i,o]}class Ku extends Nt{constructor(e){super(),Pt(this,e,_c,cc,St,{val:5,max:6,unit:7,label:0,sub:1,colorFn:2})}}function Wo(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Go(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Vo(t,e,l){const n=t.slice();return n[15]=e[l],n}function Ko(t){let e,l,n,i,o,a,r,f=(t[0].title||t[0].link)&&Yo(t),c=at(t[0].y.ticks),m=[];for(let b=0;b{f=null}),mt()),k&129){c=at(b[0].y.ticks);let M;for(M=0;M{o=null}),mt())},i(a){n||(X(o),n=!0)},o(a){te(o),n=!1},d(a){a&&P(e),i&&i.d(),o&&o.d()}}}function Qo(t){let e,l=t[0].title+"",n,i;return{c(){e=p("div"),n=S(l),u(e,"class","text-sm font-bold"),At(()=>t[9].call(e))},m(o,a){N(o,e,a),s(e,n),i=Ki(e,t[9].bind(e))},p(o,a){a&1&&l!==(l=o[0].title+"")&&E(n,l)},d(o){o&&P(e),i()}}}function Xo(t){let e,l,n,i;const o=[pc,mc],a=[];function r(f,c){return f[0].link.route?0:1}return l=r(t),n=a[l]=o[l](t),{c(){e=p("div"),n.c(),u(e,"class","text-xs text-right")},m(f,c){N(f,e,c),a[l].m(e,null),i=!0},p(f,c){let m=l;l=r(f),l===m?a[l].p(f,c):(_t(),te(a[m],1,1,()=>{a[m]=null}),mt(),n=a[l],n?n.p(f,c):(n=a[l]=o[l](f),n.c()),X(n,1),n.m(e,null))},i(f){i||(X(n),i=!0)},o(f){te(n),i=!1},d(f){f&&P(e),a[l].d()}}}function mc(t){let e,l=t[0].link.text+"",n,i,o;return{c(){e=p("a"),n=S(l),u(e,"href",i=t[0].link.url),u(e,"target",o=t[0].link.target)},m(a,r){N(a,e,r),s(e,n)},p(a,r){r&1&&l!==(l=a[0].link.text+"")&&E(n,l),r&1&&i!==(i=a[0].link.url)&&u(e,"href",i),r&1&&o!==(o=a[0].link.target)&&u(e,"target",o)},i:He,o:He,d(a){a&&P(e)}}}function pc(t){let e,l;return e=new gl({props:{to:t[0].link.url,$$slots:{default:[dc]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.to=n[0].link.url),i&262145&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function dc(t){let e=t[0].link.text+"",l;return{c(){l=S(e)},m(n,i){N(n,l,i)},p(n,i){i&1&&e!==(e=n[0].link.text+"")&&E(l,e)},d(n){n&&P(l)}}}function Zo(t){let e,l,n,i=t[15].label+"",o,a,r,f;return{c(){e=Ft("g"),l=Ft("line"),n=Ft("text"),o=S(i),u(l,"x2","100%"),u(n,"y","-4"),u(n,"x",a=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,m){N(c,e,m),s(e,l),s(e,n),s(n,o)},p(c,m){m&1&&i!==(i=c[15].label+"")&&E(o,i),m&1&&a!==(a=c[15].align=="right"?"85%":"")&&u(n,"x",a),m&1&&r!==(r="tick tick-"+c[15].value+" tick-"+c[15].color)&&u(e,"class",r),m&129&&f!==(f="translate(0, "+c[7](c[15].value)+")")&&u(e,"transform",f)},d(c){c&&P(e)}}}function Jo(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Zo(t);return{c(){n&&n.c(),l=yt()},m(i,o){n&&n.m(i,o),N(i,l,o)},p(i,o){o&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,o):(n=Zo(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){i&&P(l),n&&n.d(i)}}}function $o(t){let e,l,n=(t[3]>20||t[13]%2==0)&&xo(t);return{c(){e=Ft("g"),n&&n.c(),u(e,"class","tick"),u(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,o){N(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=xo(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&u(e,"transform",l)},d(i){i&&P(e),n&&n.d()}}}function xo(t){let e,l=t[11].label+"",n,i;return{c(){e=Ft("text"),n=S(l),u(e,"x",i=t[3]/2),u(e,"y","-4")},m(o,a){N(o,e,a),s(e,n)},p(o,a){a&1&&l!==(l=o[11].label+"")&&E(n,l),a&8&&i!==(i=o[3]/2)&&u(e,"x",i)},d(o){o&&P(e)}}}function es(t){let e=!isNaN(t[6](t[13])),l,n=e&&$o(t);return{c(){n&&n.c(),l=yt()},m(i,o){n&&n.m(i,o),N(i,l,o)},p(i,o){o&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,o):(n=$o(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){i&&P(l),n&&n.d(i)}}}function ts(t){let e,l,n=t[11].value!==void 0&&ls(t),i=t[11].value2>1e-4&&os(t);return{c(){e=Ft("g"),n&&n.c(),l=Ft("g"),i&&i.c()},m(o,a){N(o,e,a),n&&n.m(e,null),N(o,l,a),i&&i.m(l,null)},p(o,a){o[11].value!==void 0?n?n.p(o,a):(n=ls(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,a):(i=os(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&(P(e),P(l)),n&&n.d(),i&&i.d()}}}function ls(t){let e,l,n,i,o,a,r,f=t[3]>15&&ns(t);return{c(){e=Ft("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]*.95),u(e,"height",o=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),u(e,"fill",a=t[11].color)},m(c,m){N(c,e,m),f&&f.m(c,m),N(c,r,m)},p(c,m){m&64&&l!==(l=c[6](c[13])+2)&&u(e,"x",l),m&129&&n!==(n=c[7](c[11].value))&&u(e,"y",n),m&8&&i!==(i=c[3]*.95)&&u(e,"width",i),m&129&&o!==(o=c[7](c[0].y.min)-c[7](Math.min(c[0].y.min,0)+c[11].value))&&u(e,"height",o),m&1&&a!==(a=c[11].color)&&u(e,"fill",a),c[3]>15?f?f.p(c,m):(f=ns(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(P(e),P(r)),f&&f.d(c)}}}function ns(t){let e,l=t[11].label+"",n,i,o,a,r,f,c=t[11].title&&is(t);return{c(){e=Ft("text"),n=S(l),c&&c.c(),f=yt(),u(e,"width",i=t[3]*.95),u(e,"dominant-baseline","middle"),u(e,"text-anchor",o=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]m[7](0)-m[8]&&!m[0].dark?m[11].color:"white")&&u(e,"fill",a),_&457&&r!==(r="translate("+(m[6](m[13])+m[3]/2)+" "+(m[7](m[11].value)>m[7](0)-m[8]?m[7](m[11].value)-m[8]:m[7](m[11].value)+10)+") rotate("+(m[11].labelAngle?m[11].labelAngle:m[3]15&&ss(t);return{c(){e=Ft("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]*.95),u(e,"height",o=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),u(e,"fill",a=t[11].color2?t[11].color2:t[11].color)},m(c,m){N(c,e,m),f&&f.m(c,m),N(c,r,m)},p(c,m){m&64&&l!==(l=c[6](c[13])+2)&&u(e,"x",l),m&128&&n!==(n=c[7](0))&&u(e,"y",n),m&8&&i!==(i=c[3]*.95)&&u(e,"width",i),m&129&&o!==(o=c[7](c[0].y.min)-c[7](c[0].y.min+c[11].value2))&&u(e,"height",o),m&1&&a!==(a=c[11].color2?c[11].color2:c[11].color)&&u(e,"fill",a),c[3]>15?f?f.p(c,m):(f=ss(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(P(e),P(r)),f&&f.d(c)}}}function ss(t){let e,l=t[11].label2+"",n,i,o,a,r,f=t[11].title2&&as(t);return{c(){e=Ft("text"),n=S(l),f&&f.c(),r=yt(),u(e,"width",i=t[3]*.95),u(e,"dominant-baseline","middle"),u(e,"text-anchor","middle"),u(e,"fill",o=t[7](-t[11].value2)t[10].call(e))},m(o,a){N(o,e,a),i&&i.m(e,null),l=Ki(e,t[10].bind(e)),n=!0},p(o,[a]){o[0].x.ticks&&o[0].points&&o[4]?i?(i.p(o,a),a&17&&X(i,1)):(i=Ko(o),i.c(),X(i,1),i.m(e,null)):i&&(_t(),te(i,1,1,()=>{i=null}),mt())},i(o){n||(X(i),n=!0)},o(o){te(i),n=!1},d(o){o&&P(e),i&&i.d(),l()}}}let un=30;function vc(t,e,l){let{config:n}=e,i,o,a,r,f,c,m,_=0;function d(){_=this.clientHeight,l(5,_)}function v(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=g=>{"config"in g&&l(0,n=g.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,c=o-_);let g=i-(n.padding.left+n.padding.right);l(3,a=g/n.points.length),l(8,m=an.y.max?M=n.padding.bottom:kc||M<0?0:M})}},[n,i,o,a,c,_,r,f,m,d,v]}class pn extends Nt{constructor(e){super(),Pt(this,e,vc,hc,St,{config:0})}}function bc(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function gc(t,e,l){let{title:n}=e,{u1:i}=e,{u2:o}=e,{u3:a}=e,{ds:r}=e,f={};function c(m){return{label:Zt(m)+"V",title:m.toFixed(1)+" V",value:isNaN(m)?0:m,color:k1(m||0,document.documentElement.classList.contains("dark"))}}return t.$$set=m=>{"title"in m&&l(1,n=m.title),"u1"in m&&l(2,i=m.u1),"u2"in m&&l(3,o=m.u2),"u3"in m&&l(4,a=m.u3),"ds"in m&&l(5,r=m.ds)},t.$$.update=()=>{if(t.$$.dirty&62){let m=[],_=[];i>0&&(m.push({label:r===1?"L1-L2":"L1"}),_.push(c(i))),o>0&&(m.push({label:r===1?"L1-L3":"L2"}),_.push(c(o))),a>0&&(m.push({label:r===1?"L2-L3":"L3"}),_.push(c(a))),l(0,f={title:n,padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:m},points:_})}},[f,n,i,o,a,r]}class kc extends Nt{constructor(e){super(),Pt(this,e,gc,bc,St,{title:1,u1:2,u2:3,u3:4,ds:5})}}function wc(t){var D,y,$,ae,pe;let e,l,n=(((D=t[0].reactive)==null?void 0:D.title)??"Reactive")+"",i,o,a,r,f=(((y=t[0].reactive)==null?void 0:y.instant_in)??"Instant in")+"",c,m,_,d=t[1][0]+"",v,g,b=t[1][1]+"",k,M,O,F=((($=t[0].reactive)==null?void 0:$.instant_out)??"Instant out")+"",I,T,A,R=t[2][0]+"",j,V,H=t[2][1]+"",q,U,Z,G,Q=(((ae=t[0].reactive)==null?void 0:ae.total_in)??"Total in")+"",K,B,W,ie=t[3][0]+"",ee,Y,le=t[3][1]+"",ue,fe,ne,de=(((pe=t[0].reactive)==null?void 0:pe.total_out)??"Total out")+"",oe,_e,se,me=t[4][0]+"",we,C,w=t[4][1]+"",L;return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("div"),r=p("div"),c=S(f),m=h(),_=p("div"),v=S(d),g=h(),k=S(b),M=h(),O=p("div"),I=S(F),T=h(),A=p("div"),j=S(R),V=h(),q=S(H),U=h(),Z=p("div"),G=p("div"),K=S(Q),B=h(),W=p("div"),ee=S(ie),Y=h(),ue=S(le),fe=h(),ne=p("div"),oe=S(de),_e=h(),se=p("div"),we=S(me),C=h(),L=S(w),u(_,"class","text-right"),u(A,"class","text-right"),u(a,"class","grid grid-cols-2 mt-4"),u(W,"class","text-right"),u(se,"class","text-right"),u(Z,"class","grid grid-cols-2 mt-4"),u(e,"class","mx-2 text-sm")},m(he,J){N(he,e,J),s(e,l),s(l,i),s(e,o),s(e,a),s(a,r),s(r,c),s(a,m),s(a,_),s(_,v),s(_,g),s(_,k),s(a,M),s(a,O),s(O,I),s(a,T),s(a,A),s(A,j),s(A,V),s(A,q),s(e,U),s(e,Z),s(Z,G),s(G,K),s(Z,B),s(Z,W),s(W,ee),s(W,Y),s(W,ue),s(Z,fe),s(Z,ne),s(ne,oe),s(Z,_e),s(Z,se),s(se,we),s(se,C),s(se,L)},p(he,[J]){var ve,ke,De,Te,Oe;J&1&&n!==(n=(((ve=he[0].reactive)==null?void 0:ve.title)??"Reactive")+"")&&E(i,n),J&1&&f!==(f=(((ke=he[0].reactive)==null?void 0:ke.instant_in)??"Instant in")+"")&&E(c,f),J&2&&d!==(d=he[1][0]+"")&&E(v,d),J&2&&b!==(b=he[1][1]+"")&&E(k,b),J&1&&F!==(F=(((De=he[0].reactive)==null?void 0:De.instant_out)??"Instant out")+"")&&E(I,F),J&4&&R!==(R=he[2][0]+"")&&E(j,R),J&4&&H!==(H=he[2][1]+"")&&E(q,H),J&1&&Q!==(Q=(((Te=he[0].reactive)==null?void 0:Te.total_in)??"Total in")+"")&&E(K,Q),J&8&&ie!==(ie=he[3][0]+"")&&E(ee,ie),J&8&&le!==(le=he[3][1]+"")&&E(ue,le),J&1&&de!==(de=(((Oe=he[0].reactive)==null?void 0:Oe.total_out)??"Total out")+"")&&E(oe,de),J&16&&me!==(me=he[4][0]+"")&&E(we,me),J&16&&w!==(w=he[4][1]+"")&&E(L,w)},i:He,o:He,d(he){he&&P(e)}}}function Cc(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:a}=e,{translations:r={}}=e,f,c,m,_;return t.$$set=d=>{"importInstant"in d&&l(5,n=d.importInstant),"exportInstant"in d&&l(6,i=d.exportInstant),"importTotal"in d&&l(7,o=d.importTotal),"exportTotal"in d&&l(8,a=d.exportTotal),"translations"in d&&l(0,r=d.translations)},t.$$.update=()=>{t.$$.dirty&480&&(l(1,f=_l(n,"VAr")),l(2,c=_l(i,"VAr")),l(3,m=_l(o*1e3,"VArh")),l(4,_=_l(a*1e3,"VArh")))},[r,f,c,m,_,n,i,o,a]}class Sc extends Nt{constructor(e){super(),Pt(this,e,Cc,wc,St,{importInstant:5,exportInstant:6,importTotal:7,exportTotal:8,translations:0})}}function us(t){let e;function l(o,a){return o[3]?Pc:Mc}let n=l(t),i=n(t);return{c(){i.c(),e=yt()},m(o,a){i.m(o,a),N(o,e,a)},p(o,a){n===(n=l(o))&&i?i.p(o,a):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){o&&P(e),i.d(o)}}}function Mc(t){var y,$,ae,pe,he;let e,l=(((y=t[4].realtime)==null?void 0:y.consumption)??"Consumption")+"",n,i,o,a,r=ol((($=t[4].common)==null?void 0:$.hour)??"Hour")+"",f,c,m,_=t[6][0]+"",d,v,g=t[6][1]+"",b,k,M,O=ol(((ae=t[4].common)==null?void 0:ae.day)??"Day")+"",F,I,T,A=t[7][0]+"",R,j,V=t[7][1]+"",H,q,U,Z=ol(((pe=t[4].common)==null?void 0:pe.month)??"Month")+"",G,Q,K,B=t[8][0]+"",W,ie,ee=t[8][1]+"",Y,le,ue,fe=(((he=t[4].realtime)==null?void 0:he.last_month)??"Last month")+"",ne,de,oe,_e=t[9][0]+"",se,me,we=t[9][1]+"",C,w,L,D=t[5]&&rs(t);return{c(){e=p("strong"),n=S(l),i=h(),o=p("div"),a=p("div"),f=S(r),c=h(),m=p("div"),d=S(_),v=h(),b=S(g),k=h(),M=p("div"),F=S(O),I=h(),T=p("div"),R=S(A),j=h(),H=S(V),q=h(),U=p("div"),G=S(Z),Q=h(),K=p("div"),W=S(B),ie=h(),Y=S(ee),le=h(),ue=p("div"),ne=S(fe),de=h(),oe=p("div"),se=S(_e),me=h(),C=S(we),w=h(),D&&D.c(),L=yt(),u(m,"class","text-right"),u(T,"class","text-right"),u(K,"class","text-right"),u(oe,"class","text-right"),u(o,"class","grid grid-cols-2 mb-3")},m(J,ve){N(J,e,ve),s(e,n),N(J,i,ve),N(J,o,ve),s(o,a),s(a,f),s(o,c),s(o,m),s(m,d),s(m,v),s(m,b),s(o,k),s(o,M),s(M,F),s(o,I),s(o,T),s(T,R),s(T,j),s(T,H),s(o,q),s(o,U),s(U,G),s(o,Q),s(o,K),s(K,W),s(K,ie),s(K,Y),s(o,le),s(o,ue),s(ue,ne),s(o,de),s(o,oe),s(oe,se),s(oe,me),s(oe,C),N(J,w,ve),D&&D.m(J,ve),N(J,L,ve)},p(J,ve){var ke,De,Te,Oe,Le;ve&16&&l!==(l=(((ke=J[4].realtime)==null?void 0:ke.consumption)??"Consumption")+"")&&E(n,l),ve&16&&r!==(r=ol(((De=J[4].common)==null?void 0:De.hour)??"Hour")+"")&&E(f,r),ve&64&&_!==(_=J[6][0]+"")&&E(d,_),ve&64&&g!==(g=J[6][1]+"")&&E(b,g),ve&16&&O!==(O=ol(((Te=J[4].common)==null?void 0:Te.day)??"Day")+"")&&E(F,O),ve&128&&A!==(A=J[7][0]+"")&&E(R,A),ve&128&&V!==(V=J[7][1]+"")&&E(H,V),ve&16&&Z!==(Z=ol(((Oe=J[4].common)==null?void 0:Oe.month)??"Month")+"")&&E(G,Z),ve&256&&B!==(B=J[8][0]+"")&&E(W,B),ve&256&&ee!==(ee=J[8][1]+"")&&E(Y,ee),ve&16&&fe!==(fe=(((Le=J[4].realtime)==null?void 0:Le.last_month)??"Last month")+"")&&E(ne,fe),ve&512&&_e!==(_e=J[9][0]+"")&&E(se,_e),ve&512&&we!==(we=J[9][1]+"")&&E(C,we),J[5]?D?D.p(J,ve):(D=rs(J),D.c(),D.m(L.parentNode,L)):D&&(D.d(1),D=null)},d(J){J&&(P(e),P(i),P(o),P(w),P(L)),D&&D.d(J)}}}function Pc(t){var lt,je,Wt,ul,nl,rl,il,jt,zt,al;let e,l=(((lt=t[4].common)==null?void 0:lt.import)??"Import")+"",n,i,o,a,r=ol(((je=t[4].common)==null?void 0:je.hour)??"Hour")+"",f,c,m,_=t[6][0]+"",d,v,g=t[6][1]+"",b,k,M,O,F=ol(((Wt=t[4].common)==null?void 0:Wt.day)??"Day")+"",I,T,A,R=t[7][0]+"",j,V,H=t[7][1]+"",q,U,Z,G,Q=ol(((ul=t[4].common)==null?void 0:ul.month)??"Month")+"",K,B,W,ie=t[8][0]+"",ee,Y,le=t[8][1]+"",ue,fe,ne,de,oe=(((nl=t[4].realtime)==null?void 0:nl.last_mo)??"Last mo.")+"",_e,se,me,we=t[9][0]+"",C,w,L=t[9][1]+"",D,y,$,ae,pe,he=(((rl=t[4].common)==null?void 0:rl.export)??"Export")+"",J,ve,ke,De,Te=ol(((il=t[4].common)==null?void 0:il.hour)??"Hour")+"",Oe,Le,Ee,Ie=t[10][0]+"",Ze,kt,xe=t[10][1]+"",ft,wt,dt,ut,nt=ol(((jt=t[4].common)==null?void 0:jt.day)??"Day")+"",ht,Ot,Je,Re=t[11][0]+"",Be,et,ge=t[11][1]+"",qe,Ge,ce,Ce,$e=ol(((zt=t[4].common)==null?void 0:zt.month)??"Month")+"",ye,Lt,bt,Ke=t[12][0]+"",Mt,it,ct=t[12][1]+"",tt,Bt,Xt,rt,st=(((al=t[4].realtime)==null?void 0:al.last_mo)??"Last mo.")+"",Gt,Jt,Tt,Yt=t[13][0]+"",xt,$t,Vt=t[13][1]+"",It,Ve,Ye,Qe=t[5]&&cs(t),qt=t[5]&&_s(t),Ut=t[5]&&ms(t),pt=t[5]&&ps(t),ot=t[5]&&ds(t),vt=t[5]&&hs(t),Rt=t[5]&&vs(t),be=t[5]&&bs(t);return{c(){e=p("strong"),n=S(l),i=h(),o=p("div"),a=p("div"),f=S(r),c=h(),m=p("div"),d=S(_),v=h(),b=S(g),k=h(),Qe&&Qe.c(),M=h(),O=p("div"),I=S(F),T=h(),A=p("div"),j=S(R),V=h(),q=S(H),U=h(),qt&&qt.c(),Z=h(),G=p("div"),K=S(Q),B=h(),W=p("div"),ee=S(ie),Y=h(),ue=S(le),fe=h(),Ut&&Ut.c(),ne=h(),de=p("div"),_e=S(oe),se=h(),me=p("div"),C=S(we),w=h(),D=S(L),y=h(),pt&&pt.c(),ae=h(),pe=p("strong"),J=S(he),ve=h(),ke=p("div"),De=p("div"),Oe=S(Te),Le=h(),Ee=p("div"),Ze=S(Ie),kt=h(),ft=S(xe),wt=h(),ot&&ot.c(),dt=h(),ut=p("div"),ht=S(nt),Ot=h(),Je=p("div"),Be=S(Re),et=h(),qe=S(ge),Ge=h(),vt&&vt.c(),ce=h(),Ce=p("div"),ye=S($e),Lt=h(),bt=p("div"),Mt=S(Ke),it=h(),tt=S(ct),Bt=h(),Rt&&Rt.c(),Xt=h(),rt=p("div"),Gt=S(st),Jt=h(),Tt=p("div"),xt=S(Yt),$t=h(),It=S(Vt),Ve=h(),be&&be.c(),u(m,"class","text-right"),u(A,"class","text-right"),u(W,"class","text-right"),u(me,"class","text-right"),u(o,"class",$="grid grid-cols-"+t[14]+" mb-3"),u(Ee,"class","text-right"),u(Je,"class","text-right"),u(bt,"class","text-right"),u(Tt,"class","text-right"),u(ke,"class",Ye="grid grid-cols-"+t[14])},m(Ae,x){N(Ae,e,x),s(e,n),N(Ae,i,x),N(Ae,o,x),s(o,a),s(a,f),s(o,c),s(o,m),s(m,d),s(m,v),s(m,b),s(o,k),Qe&&Qe.m(o,null),s(o,M),s(o,O),s(O,I),s(o,T),s(o,A),s(A,j),s(A,V),s(A,q),s(o,U),qt&&qt.m(o,null),s(o,Z),s(o,G),s(G,K),s(o,B),s(o,W),s(W,ee),s(W,Y),s(W,ue),s(o,fe),Ut&&Ut.m(o,null),s(o,ne),s(o,de),s(de,_e),s(o,se),s(o,me),s(me,C),s(me,w),s(me,D),s(o,y),pt&&pt.m(o,null),N(Ae,ae,x),N(Ae,pe,x),s(pe,J),N(Ae,ve,x),N(Ae,ke,x),s(ke,De),s(De,Oe),s(ke,Le),s(ke,Ee),s(Ee,Ze),s(Ee,kt),s(Ee,ft),s(ke,wt),ot&&ot.m(ke,null),s(ke,dt),s(ke,ut),s(ut,ht),s(ke,Ot),s(ke,Je),s(Je,Be),s(Je,et),s(Je,qe),s(ke,Ge),vt&&vt.m(ke,null),s(ke,ce),s(ke,Ce),s(Ce,ye),s(ke,Lt),s(ke,bt),s(bt,Mt),s(bt,it),s(bt,tt),s(ke,Bt),Rt&&Rt.m(ke,null),s(ke,Xt),s(ke,rt),s(rt,Gt),s(ke,Jt),s(ke,Tt),s(Tt,xt),s(Tt,$t),s(Tt,It),s(ke,Ve),be&&be.m(ke,null)},p(Ae,x){var Se,Ct,tl,cl,dl,sl,vl,bl,Ml,Pl;x&16&&l!==(l=(((Se=Ae[4].common)==null?void 0:Se.import)??"Import")+"")&&E(n,l),x&16&&r!==(r=ol(((Ct=Ae[4].common)==null?void 0:Ct.hour)??"Hour")+"")&&E(f,r),x&64&&_!==(_=Ae[6][0]+"")&&E(d,_),x&64&&g!==(g=Ae[6][1]+"")&&E(b,g),Ae[5]?Qe?Qe.p(Ae,x):(Qe=cs(Ae),Qe.c(),Qe.m(o,M)):Qe&&(Qe.d(1),Qe=null),x&16&&F!==(F=ol(((tl=Ae[4].common)==null?void 0:tl.day)??"Day")+"")&&E(I,F),x&128&&R!==(R=Ae[7][0]+"")&&E(j,R),x&128&&H!==(H=Ae[7][1]+"")&&E(q,H),Ae[5]?qt?qt.p(Ae,x):(qt=_s(Ae),qt.c(),qt.m(o,Z)):qt&&(qt.d(1),qt=null),x&16&&Q!==(Q=ol(((cl=Ae[4].common)==null?void 0:cl.month)??"Month")+"")&&E(K,Q),x&256&&ie!==(ie=Ae[8][0]+"")&&E(ee,ie),x&256&&le!==(le=Ae[8][1]+"")&&E(ue,le),Ae[5]?Ut?Ut.p(Ae,x):(Ut=ms(Ae),Ut.c(),Ut.m(o,ne)):Ut&&(Ut.d(1),Ut=null),x&16&&oe!==(oe=(((dl=Ae[4].realtime)==null?void 0:dl.last_mo)??"Last mo.")+"")&&E(_e,oe),x&512&&we!==(we=Ae[9][0]+"")&&E(C,we),x&512&&L!==(L=Ae[9][1]+"")&&E(D,L),Ae[5]?pt?pt.p(Ae,x):(pt=ps(Ae),pt.c(),pt.m(o,null)):pt&&(pt.d(1),pt=null),x&16384&&$!==($="grid grid-cols-"+Ae[14]+" mb-3")&&u(o,"class",$),x&16&&he!==(he=(((sl=Ae[4].common)==null?void 0:sl.export)??"Export")+"")&&E(J,he),x&16&&Te!==(Te=ol(((vl=Ae[4].common)==null?void 0:vl.hour)??"Hour")+"")&&E(Oe,Te),x&1024&&Ie!==(Ie=Ae[10][0]+"")&&E(Ze,Ie),x&1024&&xe!==(xe=Ae[10][1]+"")&&E(ft,xe),Ae[5]?ot?ot.p(Ae,x):(ot=ds(Ae),ot.c(),ot.m(ke,dt)):ot&&(ot.d(1),ot=null),x&16&&nt!==(nt=ol(((bl=Ae[4].common)==null?void 0:bl.day)??"Day")+"")&&E(ht,nt),x&2048&&Re!==(Re=Ae[11][0]+"")&&E(Be,Re),x&2048&&ge!==(ge=Ae[11][1]+"")&&E(qe,ge),Ae[5]?vt?vt.p(Ae,x):(vt=hs(Ae),vt.c(),vt.m(ke,ce)):vt&&(vt.d(1),vt=null),x&16&&$e!==($e=ol(((Ml=Ae[4].common)==null?void 0:Ml.month)??"Month")+"")&&E(ye,$e),x&4096&&Ke!==(Ke=Ae[12][0]+"")&&E(Mt,Ke),x&4096&&ct!==(ct=Ae[12][1]+"")&&E(tt,ct),Ae[5]?Rt?Rt.p(Ae,x):(Rt=vs(Ae),Rt.c(),Rt.m(ke,Xt)):Rt&&(Rt.d(1),Rt=null),x&16&&st!==(st=(((Pl=Ae[4].realtime)==null?void 0:Pl.last_mo)??"Last mo.")+"")&&E(Gt,st),x&8192&&Yt!==(Yt=Ae[13][0]+"")&&E(xt,Yt),x&8192&&Vt!==(Vt=Ae[13][1]+"")&&E(It,Vt),Ae[5]?be?be.p(Ae,x):(be=bs(Ae),be.c(),be.m(ke,null)):be&&(be.d(1),be=null),x&16384&&Ye!==(Ye="grid grid-cols-"+Ae[14])&&u(ke,"class",Ye)},d(Ae){Ae&&(P(e),P(i),P(o),P(ae),P(pe),P(ve),P(ke)),Qe&&Qe.d(),qt&&qt.d(),Ut&&Ut.d(),pt&&pt.d(),ot&&ot.d(),vt&&vt.d(),Rt&&Rt.d(),be&&be.d()}}}function rs(t){var se,me,we,C,w,L;let e,l=(((se=t[4].realtime)==null?void 0:se.cost)??"Cost")+"",n,i,o,a,r=ol(((me=t[4].common)==null?void 0:me.hour)??"Hour")+"",f,c,m,_=Zt(t[1].h.c,2)+"",d,v,g,b,k,M=ol(((we=t[4].common)==null?void 0:we.day)??"Day")+"",O,F,I,T=Zt(t[1].d.c,1)+"",A,R,j,V,H,q=ol(((C=t[4].common)==null?void 0:C.month)??"Month")+"",U,Z,G,Q=Zt(t[1].m.c)+"",K,B,W,ie,ee,Y=(((w=t[4].realtime)==null?void 0:w.last_month)??"Last month")+"",le,ue,fe,ne=Zt((L=t[0].last_month)==null?void 0:L.c)+"",de,oe,_e;return{c(){e=p("strong"),n=S(l),i=h(),o=p("div"),a=p("div"),f=S(r),c=h(),m=p("div"),d=S(_),v=h(),g=S(t[2]),b=h(),k=p("div"),O=S(M),F=h(),I=p("div"),A=S(T),R=h(),j=S(t[2]),V=h(),H=p("div"),U=S(q),Z=h(),G=p("div"),K=S(Q),B=h(),W=S(t[2]),ie=h(),ee=p("div"),le=S(Y),ue=h(),fe=p("div"),de=S(ne),oe=h(),_e=S(t[2]),u(m,"class","text-right"),u(I,"class","text-right"),u(G,"class","text-right"),u(fe,"class","text-right"),u(o,"class","grid grid-cols-2")},m(D,y){N(D,e,y),s(e,n),N(D,i,y),N(D,o,y),s(o,a),s(a,f),s(o,c),s(o,m),s(m,d),s(m,v),s(m,g),s(o,b),s(o,k),s(k,O),s(o,F),s(o,I),s(I,A),s(I,R),s(I,j),s(o,V),s(o,H),s(H,U),s(o,Z),s(o,G),s(G,K),s(G,B),s(G,W),s(o,ie),s(o,ee),s(ee,le),s(o,ue),s(o,fe),s(fe,de),s(fe,oe),s(fe,_e)},p(D,y){var $,ae,pe,he,J,ve;y&16&&l!==(l=((($=D[4].realtime)==null?void 0:$.cost)??"Cost")+"")&&E(n,l),y&16&&r!==(r=ol(((ae=D[4].common)==null?void 0:ae.hour)??"Hour")+"")&&E(f,r),y&2&&_!==(_=Zt(D[1].h.c,2)+"")&&E(d,_),y&4&&E(g,D[2]),y&16&&M!==(M=ol(((pe=D[4].common)==null?void 0:pe.day)??"Day")+"")&&E(O,M),y&2&&T!==(T=Zt(D[1].d.c,1)+"")&&E(A,T),y&4&&E(j,D[2]),y&16&&q!==(q=ol(((he=D[4].common)==null?void 0:he.month)??"Month")+"")&&E(U,q),y&2&&Q!==(Q=Zt(D[1].m.c)+"")&&E(K,Q),y&4&&E(W,D[2]),y&16&&Y!==(Y=(((J=D[4].realtime)==null?void 0:J.last_month)??"Last month")+"")&&E(le,Y),y&1&&ne!==(ne=Zt((ve=D[0].last_month)==null?void 0:ve.c)+"")&&E(de,ne),y&4&&E(_e,D[2])},d(D){D&&(P(e),P(i),P(o))}}}function cs(t){let e,l=Zt(t[1].h.c,2)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].h.c,2)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function _s(t){let e,l=Zt(t[1].d.c,1)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].d.c,1)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function ms(t){let e,l=Zt(t[1].m.c)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].m.c)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function ps(t){var a;let e,l=Zt((a=t[0].last_month)==null?void 0:a.c)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(r,f){N(r,e,f),s(e,n),s(e,i),s(e,o)},p(r,f){var c;f&1&&l!==(l=Zt((c=r[0].last_month)==null?void 0:c.c)+"")&&E(n,l),f&4&&E(o,r[2])},d(r){r&&P(e)}}}function ds(t){let e,l=Zt(t[1].h.i,2)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].h.i,2)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function hs(t){let e,l=Zt(t[1].d.i,1)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].d.i,1)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function vs(t){let e,l=Zt(t[1].m.i)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,n),s(e,i),s(e,o)},p(a,r){r&2&&l!==(l=Zt(a[1].m.i)+"")&&E(n,l),r&4&&E(o,a[2])},d(a){a&&P(e)}}}function bs(t){var a;let e,l=Zt((a=t[0].last_month)==null?void 0:a.i)+"",n,i,o;return{c(){e=p("div"),n=S(l),i=h(),o=S(t[2]),u(e,"class","text-right")},m(r,f){N(r,e,f),s(e,n),s(e,i),s(e,o)},p(r,f){var c;f&1&&l!==(l=Zt((c=r[0].last_month)==null?void 0:c.i)+"")&&E(n,l),f&4&&E(o,r[2])},d(r){r&&P(e)}}}function Nc(t){var m;let e,l,n=(((m=t[4].realtime)==null?void 0:m.title)??"Real time calculations")+"",i,o,a,r,f,c=t[1]&&us(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("br"),r=p("br"),f=h(),c&&c.c(),u(e,"class","mx-2 text-sm")},m(_,d){N(_,e,d),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),c&&c.m(e,null)},p(_,[d]){var v;d&16&&n!==(n=(((v=_[4].realtime)==null?void 0:v.title)??"Real time calculations")+"")&&E(i,n),_[1]?c?c.p(_,d):(c=us(_),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:He,o:He,d(_){_&&P(e),c&&c.d()}}}function Tc(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:a}=e,{translations:r={}}=e,f,c,m,_,d,v,g,b,k=!1,M=3;return t.$$set=O=>{"sysinfo"in O&&l(0,n=O.sysinfo),"data"in O&&l(1,i=O.data),"currency"in O&&l(2,o=O.currency),"hasExport"in O&&l(3,a=O.hasExport),"translations"in O&&l(4,r=O.translations)},t.$$.update=()=>{var O,F,I,T,A,R,j,V;t.$$.dirty&35&&(l(5,k=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(14,M=k?3:2),l(6,f=_l(((O=i==null?void 0:i.h)==null?void 0:O.u)*1e3,"Wh")),l(7,c=_l(((F=i==null?void 0:i.d)==null?void 0:F.u)*1e3,"Wh")),l(8,m=_l(((I=i==null?void 0:i.m)==null?void 0:I.u)*1e3,"Wh")),l(9,_=_l(((T=n==null?void 0:n.last_month)==null?void 0:T.u)*1e3,"Wh")),l(10,d=_l(((A=i==null?void 0:i.h)==null?void 0:A.p)*1e3,"Wh")),l(11,v=_l(((R=i==null?void 0:i.d)==null?void 0:R.p)*1e3,"Wh")),l(12,g=_l(((j=i==null?void 0:i.m)==null?void 0:j.p)*1e3,"Wh")),l(13,b=_l(((V=n==null?void 0:n.last_month)==null?void 0:V.p)*1e3,"Wh")))},[n,i,o,a,r,k,f,c,m,_,d,v,g,b,M]}class qc extends Nt{constructor(e){super(),Pt(this,e,Tc,Nc,St,{sysinfo:0,data:1,currency:2,hasExport:3,translations:4})}}function Ec(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function Dc(t,e,l){let{title:n}=e,{json:i}=e,{sysinfo:o}=e,a={},r,f,c=document.documentElement.classList.contains("dark"),m=new Date;return Yi(()=>{let _;function d(){l(6,m=new Date),_=setTimeout(()=>{d()},(15-m.getMinutes()%15)*6e4)}return d(),()=>{clearTimeout(_)}}),t.$$set=_=>{"title"in _&&l(1,n=_.title),"json"in _&&l(2,i=_.json),"sysinfo"in _&&l(3,o=_.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&118){let _=i.currency,d=0,v=[],g=[],b=[];l(5,f=l(4,r=0));let k=Math.floor((m.getHours()*60+m.getMinutes())/(i==null?void 0:i.resolution));for(m.setMinutes(Math.floor(m.getMinutes()/i.resolution)*i.resolution,0,0);i!=null&&i.hasOwnProperty(Dt(k))&&(d=i[Dt(k++)],d!=null);)g.push({label:b.length>1&&i.resolution<60&&m.getMinutes()!=0?"":Dt(m.getHours())}),b.push(d*100),l(5,f=Math.min(f,d*100)),l(4,r=Math.max(r,d*100)),w1(m,i.resolution);let M=Gn(Math.max(Math.abs(f)/100,Math.abs(r)/100),_);if(M&&M[1]&&M[1]!=_)for(_=M[1],l(5,f*=100),l(4,r*=100),k=0;k=0?A.toFixed(R):"",title:A>=0?A.toFixed(2)+" "+_:"",value:d>=0?Math.abs(d):0,label2:A<0?A.toFixed(R):"",title2:A<0?A.toFixed(2)+" "+_:"",value2:d<0?Math.abs(d):0,color:c?"#5c2da5":"#7c3aed"})}let F=Math.max(r,Math.abs(f));if(f<0){l(5,f=Math.min(F/4*-1,f));let A=Math.ceil(Math.abs(f)/F*4),R=f/A;for(k=1;k{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,o=m.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let m=0,_=[],d=[],v=[];l(5,f=l(4,r=0));let g=new Date,b=new Date;b.setDate(0),b.setHours(12);let k=(b.getHours()-b.getUTCHours())%24-o.clock_offset,M=g.getUTCHours();for(Cn(g,-k-24),m=M;m<24;m++){let T=i["i"+Dt(m)],A=i["e"+Dt(m)];T===void 0&&(T=0),A===void 0&&(A=0),d.push({label:Dt(g.getHours())}),v.push({label:T.toFixed(1),title:T.toFixed(2)+" kWh",value:T*10,label2:A.toFixed(1),title2:A.toFixed(2)+" kWh",value2:A*10,color:c?"#5c2da5":"#7c3aed",color2:c?"#27728e":"#37829e"}),l(5,f=Math.max(f,A*10)),l(4,r=Math.max(r,T*10)),Cn(g,1)}for(m=0;m{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,o=m.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&62){let m=0,_=[],d=[],v=[];l(5,f=l(4,r=0));let g=new Date,b=new Date;b.setDate(0),b.setHours(12);let k=(b.getHours()-b.getUTCHours())%24-o.clock_offset;for(Cn(g,-k),Cn(b,-k),m=g.getDate();m<=b.getDate();m++){let I=i["i"+Dt(m)],T=i["e"+Dt(m)];I===void 0&&(I=0),T===void 0&&(T=0),d.push({label:Dt(m)}),v.push({label:I.toFixed(I<10?1:0),title:I.toFixed(2)+" kWh",value:I,label2:T.toFixed(T<10?1:0),title2:T.toFixed(2)+" kWh",value2:T,color:c?"#5c2da5":"#7c3aed",color2:c?"#27728e":"#37829e"}),l(5,f=Math.max(f,T)),l(4,r=Math.max(r,I))}for(m=1;m{"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,m=0,_=[],d=[],v=[];i.s&&i.s.forEach((k,M)=>{var O=k.n?k.n:k.a;m=k.v,m==-127&&(m=0),d.push({label:O.slice(-4)}),v.push({label:m.toFixed(1),value:m,color:o?"#5c2da5":"#7c3aed"}),l(4,f=Math.min(f,m)),l(3,r=Math.max(r,m))}),l(3,r=Math.ceil(r)),l(4,f=Math.floor(f));let g=r;f<0&&(g+=Math.abs(f));let b=g/4;for(c=0;c<5;c++)m=f+b*c,_.push({value:m,label:m.toFixed(1)});l(0,a={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:_},x:{ticks:d},points:v})}},[a,n,i,r,f]}class jc extends Nt{constructor(e){super(),Pt(this,e,Uc,Bc,St,{title:1,json:2})}}function zc(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}let Hc=0;function yc(t,e,l){let{title:n}=e,{translations:i={}}=e,o=document.documentElement.classList.contains("dark"),a={},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 m=0,_=[],d=[],v=[];if(_.push({value:0,label:0}),f&&f.p)for(m=0;m0?Dt(g.d)+"."+(i.months?(c=i.months)==null?void 0:c[new Date().getMonth()]:Dt(new Date().getMonth()+1)):"-"}),l(4,r=Math.max(r,g.v))}if(f&&f.t){for(m=0;m=r)break;_.push({value:g,label:g})}_.push({label:f.m.toFixed(1),align:"right",color:"green",value:f.m})}f&&f.c&&(_.push({label:f.c.toFixed(0),color:"orange",value:f.c}),l(4,r=Math.max(r,f.c))),l(4,r=Math.ceil(r)),l(0,a={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:35,bottom:20,left:35},y:{min:Hc,max:r,ticks:_},x:{ticks:d},points:v})}},[a,n,i,f,r]}class Wc extends Nt{constructor(e){super(),Pt(this,e,yc,zc,St,{title:1,translations:2,tariffData:3})}}let sn=0,Gc={data:[]};async function to(){let e=await(await kl(sn<0?"realtime.json":"realtime.json?offset="+sn)).json();lo.update(l=>{for(let n=0;n=0&&(sn+=e.size,snkn||Fi-kn>300?(to(),wi=0):lo.update(t=>{if(t.lastUpdate)for(;kn>t.lastUpdate;)t.data.unshift(Yu),t.data=t.data.slice(0,t.size),t.lastUpdate+=10,wi++;else t.lastUpdate=kn;return t})}function Yc(t){if(Yu=t.i-t.e,kn=t.u,!gs){to(),gs=!0,Fi=kn;return}Vc()&&Kc()}function ks(t,e,l){const n=t.slice();return n[18]=e[l],n[20]=l,n}function ws(t,e,l){const n=t.slice();return n[21]=e[l],n}function Qc(t){let e,l,n;return{c(){e=p("strong"),l=S(t[0]),n=S(" not available"),u(e,"class","text-sm")},m(i,o){N(i,e,o),s(e,l),s(e,n)},p(i,o){o&1&&E(l,i[0])},d(i){i&&P(e)}}}function Xc(t){let e,l,n,i,o,a,r,f=t[8]&&Cs(t);return{c(){e=p("strong"),l=S(t[0]),n=S(" ("),i=S(t[12]),o=S(")"),a=h(),f&&f.c(),r=yt(),u(e,"class","text-sm")},m(c,m){N(c,e,m),s(e,l),s(e,n),s(e,i),s(e,o),N(c,a,m),f&&f.m(c,m),N(c,r,m)},p(c,m){m&1&&E(l,c[0]),m&4096&&E(i,c[12]),c[8]?f?f.p(c,m):(f=Cs(c),f.c(),f.m(r.parentNode,r)):f&&(f.d(1),f=null)},d(c){c&&(P(e),P(a),P(r)),f&&f.d(c)}}}function Cs(t){let e,l,n,i,o,a=at(t[8]),r=[];for(let m=0;mt[17].call(e))},m(a,r){N(a,e,r),o.m(e,null),l=Ki(e,t[17].bind(e))},p(a,[r]){i===(i=n(a))&&o?o.p(a,r):(o.d(1),o=i(a),o&&(o.c(),o.m(e,null)))},i:He,o:He,d(a){a&&P(e),o.d(),l()}}}function Jc(t,e,l){let{title:n}=e,i=document.documentElement.classList.contains("dark"),o=null;lo.subscribe(T=>{l(16,o=T)});let a=!1,r,f,c,m,_,d,v,g=function(T,A,R){return Math.ceil(_-(T-A)/(R-A)*_)-25},b=function(T){return 30+Math.ceil(T/o.size*(d-35))},k,M,O,F;function I(){c=this.clientWidth,m=this.clientHeight,l(3,c),l(4,m)}return t.$$set=T=>{"title"in T&&l(0,n=T.title)},t.$$.update=()=>{if(t.$$.dirty&67582)if(l(5,_=parseInt(m)-50),l(6,d=c-35),l(10,O=d/o.size),l(2,f=0),l(1,r=0),o.data&&_>10&&d>100&&O>.1){l(11,a=!0);for(let R in o.data){let j=o.data[R];isNaN(j)&&(j=0),l(1,r=Math.max(Math.ceil(j/1e3)*1e3,r)),l(2,f=Math.min(Math.floor(j/1e3)*1e3,f))}let T=r-f;l(12,F=r>2500?"kW":"W"),l(8,k=[]);for(let R=f;R2500?(R/1e3).toFixed(1):R}),!(k.length>6));R+=T/5);l(9,M=[]);for(let R=0;R12));R+=Math.round(o.size/Math.round(d/120)));let A=o.size;l(7,v=b(o.size)+","+g(0,f,r)+" "+b(1)+","+g(0,f,r));for(let R in o.data){if(A<0)break;let j=o.data[R];isNaN(j)&&(j=0),l(7,v=b(A--)+","+g(j,f,r)+" "+v)}}else l(11,a=!1)},[n,r,f,c,m,_,d,v,k,M,O,a,F,i,g,b,o,I]}class $c extends Nt{constructor(e){super(),Pt(this,e,Jc,Zc,St,{title:0})}}function xc(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function e0(t,e,l){let{title:n}=e,{unit:i=""}=e,{l1:o=!1}=e,{l2:a=!1}=e,{l2x:r=!1}=e,{l3:f=!1}=e,{l1i:c=0}=e,{l2i:m=0}=e,{l3i:_=0}=e,{l1e:d=0}=e,{l2e:v=0}=e,{l3e:g=0}=e,{maxImport:b=0}=e,{maxExport:k=0}=e,{importColorFn:M}=e,{exportColorFn:O}=e,F={};function I(T,A){return{label:Zt(T>900?T/1e3:T)+(T>900?"k":"")+i,title:T.toFixed(2)+" "+i,value:isNaN(T)?0:T,color:M(T?T/b*100:0,document.documentElement.classList.contains("dark")),label2:Zt(A>900?A/1e3:A)+(A>900?"k":"")+i,title2:A.toFixed(2)+" "+i,value2:isNaN(A)?0:A,color2:O(A?A/k*100:0)}}return t.$$set=T=>{"title"in T&&l(1,n=T.title),"unit"in T&&l(2,i=T.unit),"l1"in T&&l(3,o=T.l1),"l2"in T&&l(4,a=T.l2),"l2x"in T&&l(5,r=T.l2x),"l3"in T&&l(6,f=T.l3),"l1i"in T&&l(7,c=T.l1i),"l2i"in T&&l(8,m=T.l2i),"l3i"in T&&l(9,_=T.l3i),"l1e"in T&&l(10,d=T.l1e),"l2e"in T&&l(11,v=T.l2e),"l3e"in T&&l(12,g=T.l3e),"maxImport"in T&&l(13,b=T.maxImport),"maxExport"in T&&l(14,k=T.maxExport),"importColorFn"in T&&l(15,M=T.importColorFn),"exportColorFn"in T&&l(16,O=T.exportColorFn)},t.$$.update=()=>{if(t.$$.dirty&32762){let T=[],A=[];o&&(T.push({label:"L1"}),A.push(I(c,d))),a&&(r?(T.push({label:"L2"}),A.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(T.push({label:"L2"}),A.push(I(m,v)))),f&&(T.push({label:"L3"}),A.push(I(_,g)));let R=[];if(k){let j=k>b?4:k*4/b;R.push({value:-k,label:"-100%"}),j>=4&&R.push({value:-k/4*3,label:"-75%"}),j>=2&&R.push({value:-k/2,label:"-50%"}),j>=4&&R.push({value:-k/4,label:"-25%"})}if(R.push({value:0,label:"0%"}),b){let j=b>k?4:b*4/k;R.push({value:b/4,label:"25%"}),j>=4&&R.push({value:b/2,label:"50%"}),j>=2&&R.push({value:b/4*3,label:"75%"}),j>=4&&R.push({value:b,label:"100%"})}l(0,F={title:n,dark:document.documentElement.classList.contains("dark"),padding:{top:20,right:15,bottom:20,left:35},y:{min:-k,max:b,ticks:R},x:{ticks:T},points:A})}},[F,n,i,o,a,r,f,c,m,_,d,v,g,b,k,M,O]}class no extends Nt{constructor(e){super(),Pt(this,e,e0,xc,St,{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 Ts(t){var M;let e,l,n,i,o,a,r=(t[0].mt?ri(t[0].mt):"-")+"",f,c,m,_=t[12][0]+"",d,v,g=t[12][1]+"",b,k;return i=new Ku({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:((M=t[7].common)==null?void 0:M.import)??"Import",sub:Gn(t[0].p,t[0].pc),colorFn:$i}}),{c(){e=p("div"),l=p("div"),n=p("div"),Ne(i.$$.fragment),o=h(),a=p("div"),f=S(r),c=h(),m=p("div"),d=S(_),v=h(),b=S(g),u(n,"class","col-span-2"),u(m,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(O,F){N(O,e,F),s(e,l),s(l,n),Me(i,n,null),s(l,o),s(l,a),s(a,f),s(l,c),s(l,m),s(m,d),s(m,v),s(m,b),k=!0},p(O,F){var T;const I={};F&1&&(I.val=O[0].i?O[0].i:0),F&1&&(I.max=O[0].im?O[0].im:15e3),F&128&&(I.label=((T=O[7].common)==null?void 0:T.import)??"Import"),F&1&&(I.sub=Gn(O[0].p,O[0].pc)),i.$set(I),(!k||F&1)&&r!==(r=(O[0].mt?ri(O[0].mt):"-")+"")&&E(f,r),(!k||F&4096)&&_!==(_=O[12][0]+"")&&E(d,_),(!k||F&4096)&&g!==(g=O[12][1]+"")&&E(b,g)},i(O){k||(X(i.$$.fragment,O),k=!0)},o(O){te(i.$$.fragment,O),k=!1},d(O){O&&P(e),Pe(i)}}}function qs(t){var b;let e,l,n,i,o,a,r,f,c=t[13][0]+"",m,_,d=t[13][1]+"",v,g;return i=new Ku({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:((b=t[7].common)==null?void 0:b.export)??"Export",sub:Gn(t[0].px,t[0].pc),colorFn:yn}}),{c(){e=p("div"),l=p("div"),n=p("div"),Ne(i.$$.fragment),o=h(),a=p("div"),r=h(),f=p("div"),m=S(c),_=h(),v=S(d),u(n,"class","col-span-2"),u(f,"class","text-right"),u(l,"class","grid grid-cols-2"),u(e,"class","cnt")},m(k,M){N(k,e,M),s(e,l),s(l,n),Me(i,n,null),s(l,o),s(l,a),s(l,r),s(l,f),s(f,m),s(f,_),s(f,v),g=!0},p(k,M){var F;const O={};M&1&&(O.val=k[0].e?k[0].e:0),M&1&&(O.max=k[0].om?k[0].om*1e3:1e4),M&128&&(O.label=((F=k[7].common)==null?void 0:F.export)??"Export"),M&1&&(O.sub=Gn(k[0].px,k[0].pc)),i.$set(O),(!g||M&8192)&&c!==(c=k[13][0]+"")&&E(m,c),(!g||M&8192)&&d!==(d=k[13][1]+"")&&E(v,d)},i(k){g||(X(i.$$.fragment,k),g=!0)},o(k){te(i.$$.fragment,k),g=!1},d(k){k&&P(e),Pe(i)}}}function Es(t){let e,l,n=t[0].l1&&Ds(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){N(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&X(n,1)):(n=Ds(i),n.c(),X(n,1),n.m(e,null)):n&&(_t(),te(n,1,1,()=>{n=null}),mt())},i(i){l||(X(n),l=!0)},o(i){te(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Ds(t){var n;let e,l;return e=new kc({props:{title:((n=t[7].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,o){Me(e,i,o),l=!0},p(i,o){var r;const a={};o&128&&(a.title=((r=i[7].common)==null?void 0:r.voltage)??"Volt"),o&1&&(a.u1=i[0].l1.u),o&1&&(a.u2=i[0].l2.u),o&1&&(a.u3=i[0].l3.u),o&1&&(a.ds=i[0].ds),e.$set(a)},i(i){l||(X(e.$$.fragment,i),l=!0)},o(i){te(e.$$.fragment,i),l=!1},d(i){Pe(e,i)}}}function As(t){let e,l,n=t[0].l1&&Os(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){N(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&X(n,1)):(n=Os(i),n.c(),X(n,1),n.m(e,null)):n&&(_t(),te(n,1,1,()=>{n=null}),mt())},i(i){l||(X(n),l=!0)},o(i){te(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Os(t){var n;let e,l;return e=new no({props:{title:((n=t[7].common)==null?void 0:n.amperage)??"Amp",unit:"A",importColorFn:$i,exportColorFn:yn,maxImport:t[0].mf,l1:t[9],l2:t[10],l3:t[11],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,o){Me(e,i,o),l=!0},p(i,o){var r;const a={};o&128&&(a.title=((r=i[7].common)==null?void 0:r.amperage)??"Amp"),o&1&&(a.maxImport=i[0].mf),o&512&&(a.l1=i[9]),o&1024&&(a.l2=i[10]),o&2048&&(a.l3=i[11]),o&1&&(a.l2x=i[0].l2.e),o&1&&(a.l1i=Math.max(Math.abs(i[0].l1.i),0)),o&1&&(a.l2i=Math.max(Math.abs(i[0].l2.i),0)),o&1&&(a.l3i=Math.max(Math.abs(i[0].l3.i),0)),e.$set(a)},i(i){l||(X(e.$$.fragment,i),l=!0)},o(i){te(e.$$.fragment,i),l=!1},d(i){Pe(e,i)}}}function Ls(t){let e,l,n=t[0].l1&&Is(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){N(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&X(n,1)):(n=Is(i),n.c(),X(n,1),n.m(e,null)):n&&(_t(),te(n,1,1,()=>{n=null}),mt())},i(i){l||(X(n),l=!0)},o(i){te(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Is(t){var n;let e,l;return e=new no({props:{title:((n=t[7].dashboard)==null?void 0:n.phase)??"Phase",unit:"W",importColorFn:$i,exportColorFn:yn,maxImport:(t[0].mf?t[0].mf:32)*230,maxExport:t[0].om?t[14]?t[0].om*1e3/Math.sqrt(3):t[0].om*1e3:0,l1:t[9],l2:t[10],l3:t[11],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,o){Me(e,i,o),l=!0},p(i,o){var r;const a={};o&128&&(a.title=((r=i[7].dashboard)==null?void 0:r.phase)??"Phase"),o&1&&(a.maxImport=(i[0].mf?i[0].mf:32)*230),o&16385&&(a.maxExport=i[0].om?i[14]?i[0].om*1e3/Math.sqrt(3):i[0].om*1e3:0),o&512&&(a.l1=i[9]),o&1024&&(a.l2=i[10]),o&2048&&(a.l3=i[11]),o&1&&(a.l1i=i[0].l1.p),o&1&&(a.l2i=i[0].l2.p),o&1&&(a.l3i=i[0].l3.p),o&1&&(a.l1e=i[0].l1.q),o&1&&(a.l2e=i[0].l2.q),o&1&&(a.l3e=i[0].l3.q),e.$set(a)},i(i){l||(X(e.$$.fragment,i),l=!0)},o(i){te(e.$$.fragment,i),l=!1},d(i){Pe(e,i)}}}function Rs(t){let e,l,n=t[0].l1&&Fs(t);return{c(){e=p("div"),n&&n.c(),u(e,"class","cnt")},m(i,o){N(i,e,o),n&&n.m(e,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&X(n,1)):(n=Fs(i),n.c(),X(n,1),n.m(e,null)):n&&(_t(),te(n,1,1,()=>{n=null}),mt())},i(i){l||(X(n),l=!0)},o(i){te(n),l=!1},d(i){i&&P(e),n&&n.d()}}}function Fs(t){var n;let e,l;return e=new no({props:{title:((n=t[7].dashboard)==null?void 0:n.pf)??"Pf",importColorFn:yn,exportColorFn:yn,maxImport:1,l1:t[9],l2:t[10],l3:t[11],l1i:t[0].l1.f,l2i:t[0].l2.f,l3i:t[0].l3.f}}),{c(){Ne(e.$$.fragment)},m(i,o){Me(e,i,o),l=!0},p(i,o){var r;const a={};o&128&&(a.title=((r=i[7].dashboard)==null?void 0:r.pf)??"Pf"),o&512&&(a.l1=i[9]),o&1024&&(a.l2=i[10]),o&2048&&(a.l3=i[11]),o&1&&(a.l1i=i[0].l1.f),o&1&&(a.l2i=i[0].l2.f),o&1&&(a.l3i=i[0].l3.f),e.$set(a)},i(i){l||(X(e.$$.fragment,i),l=!0)},o(i){te(e.$$.fragment,i),l=!1},d(i){Pe(e,i)}}}function Bs(t){let e,l,n;return l=new Sc({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec,translations:t[7]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt")},m(i,o){N(i,e,o),Me(l,e,null),n=!0},p(i,o){const a={};o&1&&(a.importInstant=i[0].ri),o&1&&(a.exportInstant=i[0].re),o&1&&(a.importTotal=i[0].ric),o&1&&(a.exportTotal=i[0].rec),o&128&&(a.translations=i[7]),l.$set(a)},i(i){n||(X(l.$$.fragment,i),n=!0)},o(i){te(l.$$.fragment,i),n=!1},d(i){i&&P(e),Pe(l)}}}function Us(t){let e,l,n;return l=new qc({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0,translations:t[7]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt")},m(i,o){N(i,e,o),Me(l,e,null),n=!0},p(i,o){const a={};o&2&&(a.sysinfo=i[1]),o&1&&(a.data=i[0].ea),o&1&&(a.currency=i[0].pc),o&1&&(a.hasExport=i[0].om>0||i[0].e>0),o&128&&(a.translations=i[7]),l.$set(a)},i(i){n||(X(l.$$.fragment,i),n=!0)},o(i){te(l.$$.fragment,i),n=!1},d(i){i&&P(e),Pe(l)}}}function js(t){var i;let e,l,n;return l=new Wc({props:{title:((i=t[7].dashboard)==null?void 0:i.tariffpeak)??"Tariff peaks",tariffData:t[8],translations:t[7]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt h-64")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.tariffpeak)??"Tariff peaks"),a&256&&(r.tariffData=o[8]),a&128&&(r.translations=o[7]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){te(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function zs(t){var i;let e,l,n;return l=new $c({props:{title:((i=t[7].dashboard)==null?void 0:i.realtime)??"Real time"}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.realtime)??"Real time"),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){te(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function Hs(t){let e,l,n,i;const o=[l0,t0],a=[];function r(f,c){var m;return(m=f[2])!=null&&m.importExportPriceDifferent&&(f[0].om||f[0].e>0)?0:1}return e=r(t),l=a[e]=o[e](t),{c(){l.c(),n=yt()},m(f,c){a[e].m(f,c),N(f,n,c),i=!0},p(f,c){let m=e;e=r(f),e===m?a[e].p(f,c):(_t(),te(a[m],1,1,()=>{a[m]=null}),mt(),l=a[e],l?l.p(f,c):(l=a[e]=o[e](f),l.c()),X(l,1),l.m(n.parentNode,n))},i(f){i||(X(l),i=!0)},o(f){te(l),i=!1},d(f){f&&P(n),a[e].d(f)}}}function t0(t){var i;let e,l,n;return l=new eo({props:{title:((i=t[7].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(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.price)??"Price"),a&4&&(r.json=o[2]),a&2&&(r.sysinfo=o[1]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){te(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function l0(t){var i;let e,l,n;return l=new eo({props:{title:((i=t[7].dashboard)==null?void 0:i.price_import)??"Price import",json:t[2],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.price_import)??"Price import"),a&4&&(r.json=o[2]),a&2&&(r.sysinfo=o[1]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){te(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function ys(t){var i;let e,l,n;return l=new eo({props:{title:((i=t[7].dashboard)==null?void 0:i.price_export)??"Price export",json:t[3],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.price_export)??"Price export"),a&8&&(r.json=o[3]),a&2&&(r.sysinfo=o[1]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){te(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function Ws(t){var i;let e,l,n;return l=new Lc({props:{title:((i=t[7].dashboard)==null?void 0:i.day)??"24 hours",json:t[4],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.day)??"24 hours"),a&16&&(r.json=o[4]),a&2&&(r.sysinfo=o[1]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){te(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function Gs(t){var i;let e,l,n;return l=new Fc({props:{title:((i=t[7].dashboard)==null?void 0:i.month)??"{0} days",json:t[5],sysinfo:t[1]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.month)??"{0} days"),a&32&&(r.json=o[5]),a&2&&(r.sysinfo=o[1]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){te(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function Vs(t){var i;let e,l,n;return l=new jc({props:{title:((i=t[7].dashboard)==null?void 0:i.temperature)??"Temperature",json:t[6]}}),{c(){e=p("div"),Ne(l.$$.fragment),u(e,"class","cnt gwf")},m(o,a){N(o,e,a),Me(l,e,null),n=!0},p(o,a){var f;const r={};a&128&&(r.title=((f=o[7].dashboard)==null?void 0:f.temperature)??"Temperature"),a&64&&(r.json=o[6]),l.$set(r)},i(o){n||(X(l.$$.fragment,o),n=!0)},o(o){te(l.$$.fragment,o),n=!1},d(o){o&&P(e),Pe(l)}}}function n0(t){var we;let e,l=Qt(t[1].ui.i,t[0].i),n,i=Qt(t[1].ui.e,t[0].om||t[0].e>0),o,a=Qt(t[1].ui.v,t[0].l1&&(t[0].l1.u>100||t[0].l2.u>100||t[0].l3.u>100)),r,f=Qt(t[1].ui.a,t[0].l1&&(t[0].l1.i>.01||t[0].l2.i>.01||t[0].l3.i>.01)),c,m=Qt(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=Qt(t[1].ui.f,t[0].l1&&(t[0].l1.f>.01||t[0].l2.f>.01||t[0].l3.f>.01)),v,g=Qt(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),b,k=Qt(t[1].ui.c,t[0].ea),M,O=Qt(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("NO")||t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),F,I=Qt(t[1].ui.l,t[0].hm==1),T,A=Qt(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),R,j=Qt(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)&&((we=t[2])==null?void 0:we.importExportPriceDifferent)&&(t[0].om||t[0].e>0)),V,H=Qt(t[1].ui.d,t[4]),q,U=Qt(t[1].ui.m,t[5]),Z,G=Qt(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[6].c>1),Q,K=l&&Ts(t),B=i&&qs(t),W=a&&Es(t),ie=f&&As(t),ee=m&&Ls(t),Y=d&&Rs(t),le=g&&Bs(t),ue=k&&Us(t),fe=O&&js(t),ne=I&&zs(t),de=A&&Hs(t),oe=j&&ys(t),_e=H&&Ws(t),se=U&&Gs(t),me=G&&Vs(t);return{c(){e=p("div"),K&&K.c(),n=h(),B&&B.c(),o=h(),W&&W.c(),r=h(),ie&&ie.c(),c=h(),ee&&ee.c(),_=h(),Y&&Y.c(),v=h(),le&&le.c(),b=h(),ue&&ue.c(),M=h(),fe&&fe.c(),F=h(),ne&&ne.c(),T=h(),de&&de.c(),R=h(),oe&&oe.c(),V=h(),_e&&_e.c(),q=h(),se&&se.c(),Z=h(),me&&me.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(C,w){N(C,e,w),K&&K.m(e,null),s(e,n),B&&B.m(e,null),s(e,o),W&&W.m(e,null),s(e,r),ie&&ie.m(e,null),s(e,c),ee&&ee.m(e,null),s(e,_),Y&&Y.m(e,null),s(e,v),le&&le.m(e,null),s(e,b),ue&&ue.m(e,null),s(e,M),fe&&fe.m(e,null),s(e,F),ne&&ne.m(e,null),s(e,T),de&&de.m(e,null),s(e,R),oe&&oe.m(e,null),s(e,V),_e&&_e.m(e,null),s(e,q),se&&se.m(e,null),s(e,Z),me&&me.m(e,null),Q=!0},p(C,[w]){var L;w&3&&(l=Qt(C[1].ui.i,C[0].i)),l?K?(K.p(C,w),w&3&&X(K,1)):(K=Ts(C),K.c(),X(K,1),K.m(e,n)):K&&(_t(),te(K,1,1,()=>{K=null}),mt()),w&3&&(i=Qt(C[1].ui.e,C[0].om||C[0].e>0)),i?B?(B.p(C,w),w&3&&X(B,1)):(B=qs(C),B.c(),X(B,1),B.m(e,o)):B&&(_t(),te(B,1,1,()=>{B=null}),mt()),w&3&&(a=Qt(C[1].ui.v,C[0].l1&&(C[0].l1.u>100||C[0].l2.u>100||C[0].l3.u>100))),a?W?(W.p(C,w),w&3&&X(W,1)):(W=Es(C),W.c(),X(W,1),W.m(e,r)):W&&(_t(),te(W,1,1,()=>{W=null}),mt()),w&3&&(f=Qt(C[1].ui.a,C[0].l1&&(C[0].l1.i>.01||C[0].l2.i>.01||C[0].l3.i>.01))),f?ie?(ie.p(C,w),w&3&&X(ie,1)):(ie=As(C),ie.c(),X(ie,1),ie.m(e,c)):ie&&(_t(),te(ie,1,1,()=>{ie=null}),mt()),w&3&&(m=Qt(C[1].ui.h,C[0].l1&&(C[0].l1.p>.01||C[0].l2.p>.01||C[0].l3.p>.01||C[0].l1.q>.01||C[0].l2.q>.01||C[0].l3.q>.01))),m?ee?(ee.p(C,w),w&3&&X(ee,1)):(ee=Ls(C),ee.c(),X(ee,1),ee.m(e,_)):ee&&(_t(),te(ee,1,1,()=>{ee=null}),mt()),w&3&&(d=Qt(C[1].ui.f,C[0].l1&&(C[0].l1.f>.01||C[0].l2.f>.01||C[0].l3.f>.01))),d?Y?(Y.p(C,w),w&3&&X(Y,1)):(Y=Rs(C),Y.c(),X(Y,1),Y.m(e,v)):Y&&(_t(),te(Y,1,1,()=>{Y=null}),mt()),w&3&&(g=Qt(C[1].ui.r,C[0].ri>0||C[0].re>0||C[0].ric>0||C[0].rec>0)),g?le?(le.p(C,w),w&3&&X(le,1)):(le=Bs(C),le.c(),X(le,1),le.m(e,b)):le&&(_t(),te(le,1,1,()=>{le=null}),mt()),w&3&&(k=Qt(C[1].ui.c,C[0].ea)),k?ue?(ue.p(C,w),w&3&&X(ue,1)):(ue=Us(C),ue.c(),X(ue,1),ue.m(e,M)):ue&&(_t(),te(ue,1,1,()=>{ue=null}),mt()),w&3&&(O=Qt(C[1].ui.t,C[0].pr&&(C[0].pr.startsWith("NO")||C[0].pr.startsWith("10YNO")||C[0].pr.startsWith("10Y1001A1001A4")))),O?fe?(fe.p(C,w),w&3&&X(fe,1)):(fe=js(C),fe.c(),X(fe,1),fe.m(e,F)):fe&&(_t(),te(fe,1,1,()=>{fe=null}),mt()),w&3&&(I=Qt(C[1].ui.l,C[0].hm==1)),I?ne?(ne.p(C,w),w&3&&X(ne,1)):(ne=zs(C),ne.c(),X(ne,1),ne.m(e,T)):ne&&(_t(),te(ne,1,1,()=>{ne=null}),mt()),w&3&&(A=Qt(C[1].ui.p,C[0].pe&&!Number.isNaN(C[0].p))),A?de?(de.p(C,w),w&3&&X(de,1)):(de=Hs(C),de.c(),X(de,1),de.m(e,R)):de&&(_t(),te(de,1,1,()=>{de=null}),mt()),w&7&&(j=Qt(C[1].ui.p,C[0].pe&&!Number.isNaN(C[0].p)&&((L=C[2])==null?void 0:L.importExportPriceDifferent)&&(C[0].om||C[0].e>0))),j?oe?(oe.p(C,w),w&7&&X(oe,1)):(oe=ys(C),oe.c(),X(oe,1),oe.m(e,V)):oe&&(_t(),te(oe,1,1,()=>{oe=null}),mt()),w&18&&(H=Qt(C[1].ui.d,C[4])),H?_e?(_e.p(C,w),w&18&&X(_e,1)):(_e=Ws(C),_e.c(),X(_e,1),_e.m(e,q)):_e&&(_t(),te(_e,1,1,()=>{_e=null}),mt()),w&34&&(U=Qt(C[1].ui.m,C[5])),U?se?(se.p(C,w),w&34&&X(se,1)):(se=Gs(C),se.c(),X(se,1),se.m(e,Z)):se&&(_t(),te(se,1,1,()=>{se=null}),mt()),w&67&&(G=Qt(C[1].ui.s,C[0].t&&C[0].t!=-127&&C[6].c>1)),G?me?(me.p(C,w),w&67&&X(me,1)):(me=Vs(C),me.c(),X(me,1),me.m(e,null)):me&&(_t(),te(me,1,1,()=>{me=null}),mt())},i(C){Q||(X(K),X(B),X(W),X(ie),X(ee),X(Y),X(le),X(ue),X(fe),X(ne),X(de),X(oe),X(_e),X(se),X(me),Q=!0)},o(C){te(K),te(B),te(W),te(ie),te(ee),te(Y),te(le),te(ue),te(fe),te(ne),te(de),te(oe),te(_e),te(se),te(me),Q=!1},d(C){C&&P(e),K&&K.d(),B&&B.d(),W&&W.d(),ie&&ie.d(),ee&&ee.d(),Y&&Y.d(),le&&le.d(),ue&&ue.d(),fe&&fe.d(),ne&&ne.d(),de&&de.d(),oe&&oe.d(),_e&&_e.d(),se&&se.d(),me&&me.d()}}}function i0(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,{importPrices:o={}}=e,{exportPrices:a={}}=e,{dayPlot:r={}}=e,{monthPlot:f={}}=e,{temperatures:c={}}=e,{translations:m={}}=e,{tariffData:_={}}=e,d,v,g,b,k,M;return t.$$set=O=>{"data"in O&&l(0,n=O.data),"sysinfo"in O&&l(1,i=O.sysinfo),"importPrices"in O&&l(2,o=O.importPrices),"exportPrices"in O&&l(3,a=O.exportPrices),"dayPlot"in O&&l(4,r=O.dayPlot),"monthPlot"in O&&l(5,f=O.monthPlot),"temperatures"in O&&l(6,c=O.temperatures),"translations"in O&&l(7,m=O.translations),"tariffData"in O&&l(8,_=O.tariffData)},t.$$.update=()=>{var O,F,I,T,A,R,j,V,H,q,U,Z,G,Q,K;t.$$.dirty&3585&&(l(12,d=_l((n==null?void 0:n.ic)*1e3,"Wh")),l(13,v=_l((n==null?void 0:n.ec)*1e3,"Wh")),((O=n==null?void 0:n.l1)==null?void 0:O.u)==0&&((F=n==null?void 0:n.l2)==null?void 0:F.u)==0&&((I=n==null?void 0:n.l3)==null?void 0:I.u)==0?l(9,b=l(10,k=l(11,M=l(14,g=!0)))):(l(9,b=((T=n==null?void 0:n.l1)==null?void 0:T.u)>0||((A=n==null?void 0:n.l1)==null?void 0:A.i)>0||((R=n==null?void 0:n.l1)==null?void 0:R.p)>0||((j=n==null?void 0:n.l1)==null?void 0:j.q)>0),l(10,k=((V=n==null?void 0:n.l2)==null?void 0:V.u)>0||((H=n==null?void 0:n.l2)==null?void 0:H.i)>0||((q=n==null?void 0:n.l2)==null?void 0:q.p)>0||((U=n==null?void 0:n.l2)==null?void 0:U.q)>0),l(11,M=((Z=n==null?void 0:n.l3)==null?void 0:Z.u)>0||((G=n==null?void 0:n.l3)==null?void 0:G.i)>0||((Q=n==null?void 0:n.l3)==null?void 0:Q.p)>0||((K=n==null?void 0:n.l3)==null?void 0:K.q)>0),l(14,g=b&&k&&M)))},[n,i,o,a,r,f,c,m,_,b,k,M,d,v,g]}class o0 extends Nt{constructor(e){super(),Pt(this,e,i0,n0,St,{data:0,sysinfo:1,importPrices:2,exportPrices:3,dayPlot:4,monthPlot:5,temperatures:6,translations:7,tariffData:8})}}let Bi={};const Bn=fl(Bi);async function s0(){Bi=await(await fetch("configuration.json")).json(),Bn.set(Bi)}let Ui={};const Qu=fl(Ui);async function a0(){Ui=await(await fetch("priceconfig.json")).json(),Qu.set(Ui)}function Ks(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Ys(t){let e,l,n;return{c(){e=p("option"),e.textContent="UART0",l=h(),n=p("option"),n.textContent="UART2",e.__value=3,z(e,e.__value),n.__value=113,z(n,n.__value)},m(i,o){N(i,e,o),N(i,l,o),N(i,n,o)},d(i){i&&(P(e),P(l),P(n))}}}function Qs(t){let e;return{c(){e=p("option"),e.textContent=`GPIO${t[4]}`,e.__value=t[4],z(e,e.__value)},m(l,n){N(l,e,n)},d(l){l&&P(e)}}}function Xs(t){let e,l=t[4]>1&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Qs(t);return{c(){l&&l.c(),e=yt()},m(n,i){l&&l.m(n,i),N(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Qs(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){n&&P(e),l&&l.d(n)}}}function f0(t){let e,l,n,i,o=t[0]=="esp8266"&&Ys(),a=at({length:t[1]+1}),r=[];for(let f=0;f{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=21);break}},[n,i]}class ji extends Nt{constructor(e){super(),Pt(this,e,u0,f0,St,{chip:0})}}function Zs(t){let e,l,n=t[1]&&Js(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,o){N(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Js(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&P(e),n&&n.d()}}}function Js(t){let e,l;return{c(){e=p("div"),l=S(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){N(n,e,i),s(e,l)},p(n,i){i&2&&E(l,n[1])},d(n){n&&P(e)}}}function r0(t){let e,l=t[0]&&Zs(t);return{c(){l&&l.c(),e=yt()},m(n,i){l&&l.m(n,i),N(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Zs(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:He,o:He,d(n){n&&P(e),l&&l.d(n)}}}function c0(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class ml extends Nt{constructor(e){super(),Pt(this,e,c0,r0,St,{active:0,message:1})}}function $s(t,e,l){const n=t.slice();return n[1]=e[l],n}function xs(t){let e,l,n=t[1]+"",i;return{c(){e=p("option"),l=S("Europe/"),i=S(n),e.__value="Europe/"+t[1],z(e,e.__value)},m(o,a){N(o,e,a),s(e,l),s(e,i)},p:He,d(o){o&&P(e)}}}function _0(t){let e,l,n,i=at(t[0]),o=[];for(let a=0;a>1&1,D=0;D0;w--)D[w]=D[w]?D[w-1]^T.EXPONENT[j._modN(T.LOG[D[w]]+C)]:D[w-1];D[0]=T.EXPONENT[j._modN(T.LOG[D[0]]+C)]}for(C=0;C<=L;C++)D[C]=T.LOG[D[C]]},_checkBadness:function(){var C,w,L,D,y,$=0,ae=this._badness,pe=this.buffer,he=this.width;for(y=0;yhe*he;)ke-=he*he,ve++;for($+=ve*j.N4,D=0;D=ae-2&&(C=ae-2,y>9&&C--);var pe=C;if(y>9){for($[pe+2]=0,$[pe+3]=0;pe--;)w=$[pe],$[pe+3]|=255&w<<4,$[pe+2]=w>>4;$[2]|=255&C<<4,$[1]=C>>4,$[0]=64|C>>12}else{for($[pe+1]=0,$[pe+2]=0;pe--;)w=$[pe],$[pe+2]|=255&w<<4,$[pe+1]=w>>4;$[1]|=255&C<<4,$[0]=64|C>>4}for(pe=C+3-(y<10);pe=5&&(L+=j.N1+D[w]-5);for(w=3;wC||D[w-3]*3>=D[w]*4||D[w+3]*3>=D[w]*4)&&(L+=j.N3);return L},_finish:function(){this._stringBuffer=this.buffer.slice();var C,w,L=0,D=3e4;for(w=0;w<8&&(this._applyMask(w),C=this._checkBadness(),C>=1)D&1&&(y[$-1-w+$*8]=1,w<6?y[8+$*w]=1:y[8+$*(w+1)]=1);for(w=0;w<7;w++,D>>=1)D&1&&(y[8+$*($-7+w)]=1,w?y[6-w+$*8]=1:y[7+$*8]=1)},_interleaveBlocks:function(){var C,w,L=this._dataBlock,D=this._ecc,y=this._eccBlock,$=0,ae=this._calculateMaxLength(),pe=this._neccBlock1,he=this._neccBlock2,J=this._stringBuffer;for(C=0;C1)for(C=M.BLOCK[D],L=y-7;;){for(w=y-7;w>C-3&&(this._addAlignment(w,L),!(w6)for(C=R.BLOCK[$-7],w=17,L=0;L<6;L++)for(D=0;D<3;D++,w--)1&(w>11?$>>w-12:C>>w)?(y[5-L+ae*(2-D+ae-11)]=1,y[2-D+ae-11+ae*(5-L)]=1):(this._setMask(5-L,2-D+ae-11),this._setMask(2-D+ae-11,5-L))},_isMasked:function(C,w){var L=j._getMaskBit(C,w);return this._mask[L]===1},_pack:function(){var C,w,L,D=1,y=1,$=this.width,ae=$-1,pe=$-1,he=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(w=0;ww&&(L=C,C=w,w=L),L=w,L+=w*w,L>>=1,L+=C,L},_modN:function(C){for(;C>=255;)C-=255,C=(C>>8)+(C&255);return C},N1:3,N2:3,N3:40,N4:10}),V=j,H=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var C=this.element;C.width=C.height=this.qrious.size}}),q=H,U=_.extend(function(C,w,L,D){this.name=C,this.modifiable=!!w,this.defaultValue=L,this._valueTransformer=D},{transform:function(C){var w=this._valueTransformer;return typeof w=="function"?w(C,this):C}}),Z=U,G=_.extend(null,{abs:function(C){return C!=null?Math.abs(C):null},hasOwn:function(C,w){return Object.prototype.hasOwnProperty.call(C,w)},noop:function(){},toUpperCase:function(C){return C!=null?C.toUpperCase():null}}),Q=G,K=_.extend(function(C){this.options={},C.forEach(function(w){this.options[w.name]=w},this)},{exists:function(C){return this.options[C]!=null},get:function(C,w){return K._get(this.options[C],w)},getAll:function(C){var w,L=this.options,D={};for(w in L)Q.hasOwn(L,w)&&(D[w]=K._get(L[w],C));return D},init:function(C,w,L){typeof L!="function"&&(L=Q.noop);var D,y;for(D in this.options)Q.hasOwn(this.options,D)&&(y=this.options[D],K._set(y,y.defaultValue,w),K._createAccessor(y,w,L));this._setAll(C,w,!0)},set:function(C,w,L){return this._set(C,w,L)},setAll:function(C,w){return this._setAll(C,w)},_set:function(C,w,L,D){var y=this.options[C];if(!y)throw new Error("Invalid option: "+C);if(!y.modifiable&&!D)throw new Error("Option cannot be modified: "+C);return K._set(y,w,L)},_setAll:function(C,w,L){if(!C)return!1;var D,y=!1;for(D in C)Q.hasOwn(C,D)&&this._set(D,C[D],w,L)&&(y=!0);return y}},{_createAccessor:function(C,w,L){var D={get:function(){return K._get(C,w)}};C.modifiable&&(D.set=function(y){K._set(C,y,w)&&L(y,C)}),Object.defineProperty(w,C.name,D)},_get:function(C,w){return w["_"+C.name]},_set:function(C,w,L){var D="_"+C.name,y=L[D],$=C.transform(w??C.defaultValue);return L[D]=$,$!==y}}),B=K,W=_.extend(function(){this._services={}},{getService:function(C){var w=this._services[C];if(!w)throw new Error("Service is not being managed with name: "+C);return w},setService:function(C,w){if(this._services[C])throw new Error("Service is already managed with name: "+C);w&&(this._services[C]=w)}}),ie=W,ee=new B([new Z("background",!0,"white"),new Z("backgroundAlpha",!0,1,Q.abs),new Z("element"),new Z("foreground",!0,"black"),new Z("foregroundAlpha",!0,1,Q.abs),new Z("level",!0,"L",Q.toUpperCase),new Z("mime",!0,"image/png"),new Z("padding",!0,null,Q.abs),new Z("size",!0,100,Q.abs),new Z("value",!0,"")]),Y=new ie,le=_.extend(function(C){ee.init(C,this,this.update.bind(this));var w=ee.get("element",this),L=Y.getService("element"),D=w&&L.isCanvas(w)?w:L.createCanvas(),y=w&&L.isImage(w)?w:L.createImage();this._canvasRenderer=new b(this,D,!0),this._imageRenderer=new q(this,y,y===w),this.update()},{get:function(){return ee.getAll(this)},set:function(C){ee.setAll(C,this)&&this.update()},toDataURL:function(C){return this.canvas.toDataURL(C||this.mime)},update:function(){var C=new V({level:this.level,value:this.value});this._canvasRenderer.render(C),this._imageRenderer.render(C)}},{use:function(C){Y.setService(C.getName(),C)}});Object.defineProperties(le.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var ue=le,fe=ue,ne=_.extend({getName:function(){}}),de=ne,oe=de.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(C){},isImage:function(C){}}),_e=oe,se=_e.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(C){return C instanceof HTMLCanvasElement},isImage:function(C){return C instanceof HTMLImageElement}}),me=se;fe.use(new me);var we=fe;return we})})(Zu);var b0=Zu.exports;const g0=v0(b0);function k0(t){let e,l;return{c(){e=p("img"),oi(e.src,l=t[2])||u(e,"src",l),u(e,"alt",t[0]),u(e,"class",t[1])},m(n,i){N(n,e,i)},p(n,[i]){i&4&&!oi(e.src,l=n[2])&&u(e,"src",l),i&1&&u(e,"alt",n[0]),i&2&&u(e,"class",n[1])},i:He,o:He,d(n){n&&P(e)}}}function w0(t,e,l){let{errorCorrection:n="L"}=e,{background:i="#fff"}=e,{color:o="#000"}=e,{size:a="200"}=e,{value:r=""}=e,{padding:f=0}=e,{className:c="qrcode"}=e,m="",_;function d(){_.set({background:i,foreground:o,level:n,padding:f,size:a,value:r}),l(2,m=_.toDataURL("image/jpeg"))}function v(){return m}return Yi(()=>{l(9,_=new g0),r&&d()}),t.$$set=g=>{"errorCorrection"in g&&l(3,n=g.errorCorrection),"background"in g&&l(4,i=g.background),"color"in g&&l(5,o=g.color),"size"in g&&l(6,a=g.size),"value"in g&&l(0,r=g.value),"padding"in g&&l(7,f=g.padding),"className"in g&&l(1,c=g.className)},t.$$.update=()=>{t.$$.dirty&513&&r&&_&&d()},[r,c,m,n,i,o,a,f,v,_]}class C0 extends Nt{constructor(e){super(),Pt(this,e,w0,k0,St,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1,getImage:8})}get getImage(){return this.$$.ctx[8]}}function ea(t,e,l){const n=t.slice();return n[125]=e[l],n}function ta(t,e,l){const n=t.slice();return n[128]=e[l],n[129]=e,n[130]=l,n}function la(t,e,l){const n=t.slice();return n[131]=e[l],n[132]=e,n[133]=l,n}function na(t,e,l){const n=t.slice();return n[134]=e[l],n}function S0(t,e,l){const n=t.slice();return n[137]=e[l],n}function M0(t,e,l){const n=t.slice();return n[140]=e[l],n}function P0(t,e,l){const n=t.slice();return n[143]=e[l],n}function ia(t){var al,Ae,x,Se,Ct,tl,cl,dl,sl,vl,bl,Ml,Pl,Il,Rl,Fl,We,gt,Bl,Ul,jl,zl,Hl,yl,Wl,Gl,Vl,Kl;let e,l,n=(((Ae=(al=t[2].conf)==null?void 0:al.general)==null?void 0:Ae.title)??"General")+"",i,o,a,r,f,c,m,_,d,v=(((Se=(x=t[2].conf)==null?void 0:x.general)==null?void 0:Se.hostname)??"Hostname")+"",g,b,k,M,O,F,I=(((tl=(Ct=t[2].conf)==null?void 0:Ct.general)==null?void 0:tl.timezone)??"Time zone")+"",T,A,R,j,V,H,q,U,Z,G,Q,K=(((dl=(cl=t[2].conf)==null?void 0:cl.price)==null?void 0:dl.region)??"Price region")+"",B,W,ie,ee,Y,le,ue,fe,ne,de,oe,_e,se,me,we,C,w,L,D,y,$,ae,pe,he,J,ve,ke,De,Te,Oe,Le,Ee,Ie,Ze,kt=(((vl=(sl=t[2].conf)==null?void 0:sl.price)==null?void 0:vl.resolution)??"Resolution")+"",xe,ft,wt,dt,ut,nt,ht=(((Ml=(bl=t[2].conf)==null?void 0:bl.price)==null?void 0:Ml.currency)??"Currency")+"",Ot,Je,Re,Be,et,ge,qe,Ge,ce,Ce,$e,ye,Lt=(((Il=(Pl=t[2].conf)==null?void 0:Pl.price)==null?void 0:Il.enabled)??"Enabled")+"",bt,Ke,Mt,it,ct=(((We=(Fl=(Rl=t[2].conf)==null?void 0:Rl.general)==null?void 0:Fl.security)==null?void 0:We.title)??"Security")+"",tt,Bt,Xt,rt,st,Gt=(((Ul=(Bl=(gt=t[2].conf)==null?void 0:gt.general)==null?void 0:Bl.security)==null?void 0:Ul.none)??"None")+"",Jt,Tt,Yt=(((Hl=(zl=(jl=t[2].conf)==null?void 0:jl.general)==null?void 0:zl.security)==null?void 0:Hl.conf)??"Conf")+"",xt,$t,Vt=(((Gl=(Wl=(yl=t[2].conf)==null?void 0:yl.general)==null?void 0:Wl.security)==null?void 0:Gl.all)??"All")+"",It,Ve,Ye,Qe,qt=(((Kl=(Vl=t[2].conf)==null?void 0:Vl.general)==null?void 0:Kl.context)??"Context")+"",Ut,pt,ot,vt,Rt,be,lt,je;V=new p0({});let Wt=!t[6].p.t&&oa(),ul=at([15,60]),nl=[];for(let Ue=0;Ue<2;Ue+=1)nl[Ue]=N0(P0(t,ul,Ue));let rl=at(["NOK","SEK","DKK","EUR","CHF"]),il=[];for(let Ue=0;Ue<5;Ue+=1)il[Ue]=T0(M0(t,rl,Ue));qe=new gl({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[q0]},$$scope:{ctx:t}}});let jt=t[6].p.e&&t[0].chip!="esp8266"&&sa(t),zt=t[6].g.s>0&&aa(t);return{c(){var Ue,Et;e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),_=p("div"),d=p("div"),g=S(v),b=p("br"),k=h(),M=p("input"),O=h(),F=p("div"),T=S(I),A=p("br"),R=h(),j=p("select"),Ne(V.$$.fragment),H=h(),q=p("input"),U=h(),Z=p("div"),G=p("div"),Q=p("div"),B=S(K),W=p("br"),ie=h(),ee=p("select"),Y=p("optgroup"),Wt&&Wt.c(),le=p("option"),le.textContent="NO1",ue=p("option"),ue.textContent="NO2",fe=p("option"),fe.textContent="NO3",ne=p("option"),ne.textContent="NO4",de=p("option"),de.textContent="NO5",oe=p("optgroup"),_e=p("option"),_e.textContent="SE1",se=p("option"),se.textContent="SE2",me=p("option"),me.textContent="SE3",we=p("option"),we.textContent="SE4",C=p("optgroup"),w=p("option"),w.textContent="DK1",L=p("option"),L.textContent="DK2",D=p("option"),D.textContent="Austria",y=p("option"),y.textContent="Belgium",$=p("option"),$.textContent="Czech Republic",ae=p("option"),ae.textContent="Estonia",pe=p("option"),pe.textContent="Finland",he=p("option"),he.textContent="France",J=p("option"),J.textContent="Germany",ve=p("option"),ve.textContent="Great Britain",ke=p("option"),ke.textContent="Latvia",De=p("option"),De.textContent="Lithuania",Te=p("option"),Te.textContent="Netherland",Oe=p("option"),Oe.textContent="Poland",Le=p("option"),Le.textContent="Slovenia",Ee=p("option"),Ee.textContent="Switzerland",Ie=h(),Ze=p("div"),xe=S(kt),ft=p("br"),wt=h(),dt=p("select");for(let ll=0;ll<2;ll+=1)nl[ll].c();ut=h(),nt=p("div"),Ot=S(ht),Je=p("br"),Re=h(),Be=p("select");for(let ll=0;ll<5;ll+=1)il[ll].c();et=h(),ge=p("div"),Ne(qe.$$.fragment),Ge=h(),ce=p("div"),Ce=p("label"),$e=p("input"),ye=h(),bt=S(Lt),Ke=h(),jt&&jt.c(),Mt=h(),it=p("div"),tt=S(ct),Bt=p("br"),Xt=h(),rt=p("select"),st=p("option"),Jt=S(Gt),Tt=p("option"),xt=S(Yt),$t=p("option"),It=S(Vt),Ve=h(),zt&&zt.c(),Ye=h(),Qe=p("div"),Ut=S(qt),pt=p("br"),ot=h(),vt=p("input"),u(l,"class","text-sm"),u(a,"href",hl("General-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","g"),f.value="true",u(M,"name","gh"),u(M,"type","text"),u(M,"class","in-f w-full"),u(M,"pattern",Vn),u(j,"name","gt"),u(j,"class","in-l w-full"),t[6].g.t===void 0&&At(()=>t[26].call(j)),u(_,"class","flex"),u(m,"class","my-1"),u(q,"type","hidden"),u(q,"name","p"),q.value="true",le.__value="10YNO-1--------2",z(le,le.__value),ue.__value="10YNO-2--------T",z(ue,ue.__value),fe.__value="10YNO-3--------J",z(fe,fe.__value),ne.__value="10YNO-4--------9",z(ne,ne.__value),de.__value="10Y1001A1001A48H",z(de,de.__value),u(Y,"label","Norway"),_e.__value="10Y1001A1001A44P",z(_e,_e.__value),se.__value="10Y1001A1001A45N",z(se,se.__value),me.__value="10Y1001A1001A46L",z(me,me.__value),we.__value="10Y1001A1001A47J",z(we,we.__value),u(oe,"label","Sweden"),w.__value="10YDK-1--------W",z(w,w.__value),L.__value="10YDK-2--------M",z(L,L.__value),u(C,"label","Denmark"),D.__value="10YAT-APG------L",z(D,D.__value),y.__value="10YBE----------2",z(y,y.__value),$.__value="10YCZ-CEPS-----N",z($,$.__value),ae.__value="10Y1001A1001A39I",z(ae,ae.__value),pe.__value="10YFI-1--------U",z(pe,pe.__value),he.__value="10YFR-RTE------C",z(he,he.__value),J.__value="10Y1001A1001A83F",z(J,J.__value),ve.__value="10YGB----------A",z(ve,ve.__value),ke.__value="10YLV-1001A00074",z(ke,ke.__value),De.__value="10YLT-1001A0008Q",z(De,De.__value),Te.__value="10YNL----------L",z(Te,Te.__value),Oe.__value="10YPL-AREA-----S",z(Oe,Oe.__value),Le.__value="10YSI-ELES-----O",z(Le,Le.__value),Ee.__value="10YCH-SWISSGRIDZ",z(Ee,Ee.__value),u(ee,"name","pr"),u(ee,"class","in-f w-full"),t[6].p.r===void 0&&At(()=>t[27].call(ee)),u(Q,"class","w-full"),u(dt,"name","pm"),u(dt,"class","in-m"),t[6].p.m===void 0&&At(()=>t[28].call(dt)),u(Be,"name","pc"),u(Be,"class","in-l"),t[6].p.c===void 0&&At(()=>t[29].call(Be)),u(G,"class","flex"),u(Z,"class","my-1"),u(ge,"class","my-1"),u($e,"type","checkbox"),u($e,"name","pe"),$e.__value="true",z($e,$e.__value),u($e,"class","rounded mb-1"),u(ce,"class","my-1"),st.__value=0,z(st,st.__value),Tt.__value=1,z(Tt,Tt.__value),$t.__value=2,z($t,$t.__value),u(rt,"name","gs"),u(rt,"class","in-s"),t[6].g.s===void 0&&At(()=>t[32].call(rt)),u(it,"class","my-1"),u(vt,"name","gc"),u(vt,"type","text"),u(vt,"pattern",Vn),u(vt,"placeholder",Rt=((Et=(Ue=t[2].conf)==null?void 0:Ue.general)==null?void 0:Et.context_placeholder)??"/"),u(vt,"class","in-s"),u(vt,"maxlength","36"),u(Qe,"class","my-1"),u(e,"class","cnt")},m(Ue,Et){N(Ue,e,Et),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,_),s(_,d),s(d,g),s(d,b),s(d,k),s(d,M),z(M,t[6].g.h),s(_,O),s(_,F),s(F,T),s(F,A),s(F,R),s(F,j),Me(V,j,null),ze(j,t[6].g.t,!0),s(e,H),s(e,q),s(e,U),s(e,Z),s(Z,G),s(G,Q),s(Q,B),s(Q,W),s(Q,ie),s(Q,ee),s(ee,Y),Wt&&Wt.m(Y,null),s(Y,le),s(Y,ue),s(Y,fe),s(Y,ne),s(Y,de),s(ee,oe),s(oe,_e),s(oe,se),s(oe,me),s(oe,we),s(ee,C),s(C,w),s(C,L),s(ee,D),s(ee,y),s(ee,$),s(ee,ae),s(ee,pe),s(ee,he),s(ee,J),s(ee,ve),s(ee,ke),s(ee,De),s(ee,Te),s(ee,Oe),s(ee,Le),s(ee,Ee),ze(ee,t[6].p.r,!0),s(G,Ie),s(G,Ze),s(Ze,xe),s(Ze,ft),s(Ze,wt),s(Ze,dt);for(let ll=0;ll<2;ll+=1)nl[ll]&&nl[ll].m(dt,null);ze(dt,t[6].p.m,!0),s(G,ut),s(G,nt),s(nt,Ot),s(nt,Je),s(nt,Re),s(nt,Be);for(let ll=0;ll<5;ll+=1)il[ll]&&il[ll].m(Be,null);ze(Be,t[6].p.c,!0),s(e,et),s(e,ge),Me(qe,ge,null),s(e,Ge),s(e,ce),s(ce,Ce),s(Ce,$e),$e.checked=t[6].p.e,s(Ce,ye),s(Ce,bt),s(ce,Ke),jt&&jt.m(ce,null),s(e,Mt),s(e,it),s(it,tt),s(it,Bt),s(it,Xt),s(it,rt),s(rt,st),s(st,Jt),s(rt,Tt),s(Tt,xt),s(rt,$t),s($t,It),ze(rt,t[6].g.s,!0),s(e,Ve),zt&&zt.m(e,null),s(e,Ye),s(e,Qe),s(Qe,Ut),s(Qe,pt),s(Qe,ot),s(Qe,vt),z(vt,t[6].g.c),be=!0,lt||(je=[re(M,"input",t[25]),re(j,"change",t[26]),re(ee,"change",t[27]),re(ee,"change",t[22]),re(dt,"change",t[28]),re(Be,"change",t[29]),re($e,"change",t[30]),re(rt,"change",t[32]),re(vt,"input",t[35])],lt=!0)},p(Ue,Et){var Yl,Ql,Xl,Zl,Jl,$l,xl,en,Nn,Tn,qn,En,Dn,An,On,Ln,In,oo,so,ao,fo,uo,ro,co,_o,mo,po,ho,vo,bo;(!be||Et[0]&4)&&n!==(n=(((Ql=(Yl=Ue[2].conf)==null?void 0:Yl.general)==null?void 0:Ql.title)??"General")+"")&&E(i,n),(!be||Et[0]&4)&&v!==(v=(((Zl=(Xl=Ue[2].conf)==null?void 0:Xl.general)==null?void 0:Zl.hostname)??"Hostname")+"")&&E(g,v),Et[0]&64&&M.value!==Ue[6].g.h&&z(M,Ue[6].g.h),(!be||Et[0]&4)&&I!==(I=((($l=(Jl=Ue[2].conf)==null?void 0:Jl.general)==null?void 0:$l.timezone)??"Time zone")+"")&&E(T,I),Et[0]&64&&ze(j,Ue[6].g.t),(!be||Et[0]&4)&&K!==(K=(((en=(xl=Ue[2].conf)==null?void 0:xl.price)==null?void 0:en.region)??"Price region")+"")&&E(B,K),Ue[6].p.t?Wt&&(Wt.d(1),Wt=null):Wt||(Wt=oa(),Wt.c(),Wt.m(Y,le)),Et[0]&64&&ze(ee,Ue[6].p.r),(!be||Et[0]&4)&&kt!==(kt=(((Tn=(Nn=Ue[2].conf)==null?void 0:Nn.price)==null?void 0:Tn.resolution)??"Resolution")+"")&&E(xe,kt),Et[0]&64&&ze(dt,Ue[6].p.m),(!be||Et[0]&4)&&ht!==(ht=(((En=(qn=Ue[2].conf)==null?void 0:qn.price)==null?void 0:En.currency)??"Currency")+"")&&E(Ot,ht),Et[0]&64&&ze(Be,Ue[6].p.c);const ll={};Et[0]&4|Et[4]&4194304&&(ll.$$scope={dirty:Et,ctx:Ue}),qe.$set(ll),Et[0]&64&&($e.checked=Ue[6].p.e),(!be||Et[0]&4)&&Lt!==(Lt=(((An=(Dn=Ue[2].conf)==null?void 0:Dn.price)==null?void 0:An.enabled)??"Enabled")+"")&&E(bt,Lt),Ue[6].p.e&&Ue[0].chip!="esp8266"?jt?jt.p(Ue,Et):(jt=sa(Ue),jt.c(),jt.m(ce,null)):jt&&(jt.d(1),jt=null),(!be||Et[0]&4)&&ct!==(ct=(((In=(Ln=(On=Ue[2].conf)==null?void 0:On.general)==null?void 0:Ln.security)==null?void 0:In.title)??"Security")+"")&&E(tt,ct),(!be||Et[0]&4)&&Gt!==(Gt=(((ao=(so=(oo=Ue[2].conf)==null?void 0:oo.general)==null?void 0:so.security)==null?void 0:ao.none)??"None")+"")&&E(Jt,Gt),(!be||Et[0]&4)&&Yt!==(Yt=(((ro=(uo=(fo=Ue[2].conf)==null?void 0:fo.general)==null?void 0:uo.security)==null?void 0:ro.conf)??"Conf")+"")&&E(xt,Yt),(!be||Et[0]&4)&&Vt!==(Vt=(((mo=(_o=(co=Ue[2].conf)==null?void 0:co.general)==null?void 0:_o.security)==null?void 0:mo.all)??"All")+"")&&E(It,Vt),Et[0]&64&&ze(rt,Ue[6].g.s),Ue[6].g.s>0?zt?zt.p(Ue,Et):(zt=aa(Ue),zt.c(),zt.m(e,Ye)):zt&&(zt.d(1),zt=null),(!be||Et[0]&4)&&qt!==(qt=(((ho=(po=Ue[2].conf)==null?void 0:po.general)==null?void 0:ho.context)??"Context")+"")&&E(Ut,qt),(!be||Et[0]&4&&Rt!==(Rt=((bo=(vo=Ue[2].conf)==null?void 0:vo.general)==null?void 0:bo.context_placeholder)??"/"))&&u(vt,"placeholder",Rt),Et[0]&64&&vt.value!==Ue[6].g.c&&z(vt,Ue[6].g.c)},i(Ue){be||(X(V.$$.fragment,Ue),X(qe.$$.fragment,Ue),be=!0)},o(Ue){te(V.$$.fragment,Ue),te(qe.$$.fragment,Ue),be=!1},d(Ue){Ue&&P(e),Pe(V),Wt&&Wt.d(),el(nl,Ue),el(il,Ue),Pe(qe),jt&&jt.d(),zt&&zt.d(),lt=!1,Ht(je)}}}function oa(t){let e,l,n,i,o;return{c(){e=p("option"),e.textContent="NO1 w/support",l=p("option"),l.textContent="NO2 w/support",n=p("option"),n.textContent="NO3 w/support",i=p("option"),i.textContent="NO4 w/support",o=p("option"),o.textContent="NO5 w/support",e.__value="NO1S",z(e,e.__value),l.__value="NO2S",z(l,l.__value),n.__value="NO3S",z(n,n.__value),i.__value="NO4S",z(i,i.__value),o.__value="NO5S",z(o,o.__value)},m(a,r){N(a,e,r),N(a,l,r),N(a,n,r),N(a,i,r),N(a,o,r)},d(a){a&&(P(e),P(l),P(n),P(i),P(o))}}}function N0(t){let e;return{c(){e=p("option"),e.textContent=`${t[143]}M`,e.__value=t[143],z(e,e.__value)},m(l,n){N(l,e,n)},p:He,d(l){l&&P(e)}}}function T0(t){let e;return{c(){e=p("option"),e.textContent=`${t[140]}`,e.__value=t[140],z(e,e.__value)},m(l,n){N(l,e,n)},p:He,d(l){l&&P(e)}}}function q0(t){var n,i;let e=(((i=(n=t[2].conf)==null?void 0:n.price)==null?void 0:i.conf)??"Configure")+"",l;return{c(){l=S(e)},m(o,a){N(o,l,a)},p(o,a){var r,f;a[0]&4&&e!==(e=(((f=(r=o[2].conf)==null?void 0:r.price)==null?void 0:f.conf)??"Configure")+"")&&E(l,e)},d(o){o&&P(l)}}}function sa(t){let e,l,n,i,o;return{c(){var a,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=(a=t[2].conf)==null?void 0:a.price)==null?void 0:r.api_key_placeholder)??""),u(l,"pattern",Vn)},m(a,r){N(a,e,r),N(a,l,r),z(l,t[6].p.t),i||(o=re(l,"input",t[31]),i=!0)},p(a,r){var f,c;r[0]&4&&n!==(n=((c=(f=a[2].conf)==null?void 0:f.price)==null?void 0:c.api_key_placeholder)??"")&&u(l,"placeholder",n),r[0]&64&&l.value!==a[6].p.t&&z(l,a[6].p.t)},d(a){a&&(P(e),P(l)),i=!1,o()}}}function aa(t){var k,M,O,F,I,T;let e,l=(((O=(M=(k=t[2].conf)==null?void 0:k.general)==null?void 0:M.security)==null?void 0:O.username)??"Username")+"",n,i,o,a,r,f,c=(((T=(I=(F=t[2].conf)==null?void 0:F.general)==null?void 0:I.security)==null?void 0:T.password)??"Password")+"",m,_,d,v,g,b;return{c(){e=p("div"),n=S(l),i=p("br"),o=h(),a=p("input"),r=h(),f=p("div"),m=S(c),_=p("br"),d=h(),v=p("input"),u(a,"name","gu"),u(a,"type","text"),u(a,"class","in-s"),u(a,"maxlength","36"),u(a,"pattern",Ll),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",Ll),u(f,"class","my-1")},m(A,R){N(A,e,R),s(e,n),s(e,i),s(e,o),s(e,a),z(a,t[6].g.u),N(A,r,R),N(A,f,R),s(f,m),s(f,_),s(f,d),s(f,v),z(v,t[6].g.p),g||(b=[re(a,"input",t[33]),re(v,"input",t[34])],g=!0)},p(A,R){var j,V,H,q,U,Z;R[0]&4&&l!==(l=(((H=(V=(j=A[2].conf)==null?void 0:j.general)==null?void 0:V.security)==null?void 0:H.username)??"Username")+"")&&E(n,l),R[0]&64&&a.value!==A[6].g.u&&z(a,A[6].g.u),R[0]&4&&c!==(c=(((Z=(U=(q=A[2].conf)==null?void 0:q.general)==null?void 0:U.security)==null?void 0:Z.password)??"Password")+"")&&E(m,c),R[0]&64&&v.value!==A[6].g.p&&z(v,A[6].g.p)},d(A){A&&(P(e),P(r),P(f)),g=!1,Ht(b)}}}function fa(t){var ce,Ce,$e,ye,Lt,bt,Ke,Mt,it,ct,tt,Bt,Xt,rt,st,Gt,Jt,Tt,Yt,xt,$t,Vt,It;let e,l,n=(((Ce=(ce=t[2].conf)==null?void 0:ce.meter)==null?void 0:Ce.title)??"Meter")+"",i,o,a,r,f,c,m,_,d,v=(((Lt=(ye=($e=t[2].conf)==null?void 0:$e.meter)==null?void 0:ye.comm)==null?void 0:Lt.title)??"Communication")+"",g,b,k,M,O,F=(((Mt=(Ke=(bt=t[2].conf)==null?void 0:bt.meter)==null?void 0:Ke.comm)==null?void 0:Mt.passive)??"Passive")+"",I,T,A=(((tt=(ct=(it=t[2].conf)==null?void 0:it.meter)==null?void 0:ct.comm)==null?void 0:tt.pulse)??"Pulse")+"",R,j=(Xt=(Bt=t[0])==null?void 0:Bt.features)==null?void 0:Xt.includes("kmp"),V,H,q,U=(((rt=t[2].common)==null?void 0:rt.voltage)??"Voltage")+"",Z,G,Q,K,B,W,ie,ee,Y,le=(((Gt=(st=t[2].conf)==null?void 0:st.meter)==null?void 0:Gt.fuse)??"Main fuse")+"",ue,fe,ne,de,oe,_e,se,me,we,C=(((Tt=(Jt=t[2].conf)==null?void 0:Jt.meter)==null?void 0:Tt.prod)??"Production")+"",w,L,D,y,$,ae,pe,he,J,ve,ke,De,Te,Oe,Le=(((xt=(Yt=t[2].conf)==null?void 0:Yt.meter)==null?void 0:xt.encrypted)??"Encrypted")+"",Ee,Ie,Ze,kt,xe,ft,wt,dt=(((It=(Vt=($t=t[2].conf)==null?void 0:$t.meter)==null?void 0:Vt.multipliers)==null?void 0:It.title)??"Multipliers")+"",ut,nt,ht,Ot,Je=j&&ua();function Re(Ve,Ye){return Ve[6].m.a===2?D0:E0}let Be=Re(t),et=Be(t),ge=t[6].m.e.e&&ra(t),qe=t[6].m.e.e&&ca(t),Ge=t[6].m.m.e&&_a(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("input"),_=h(),d=p("div"),g=S(v),b=p("br"),k=h(),M=p("select"),O=p("option"),I=S(F),T=p("option"),R=S(A),Je&&Je.c(),V=h(),et.c(),H=h(),q=p("div"),Z=S(U),G=p("br"),Q=h(),K=p("select"),B=p("option"),B.textContent="400V (TN)",W=p("option"),W.textContent="230V (IT/TT)",ie=h(),ee=p("div"),Y=p("div"),ue=S(le),fe=p("br"),ne=h(),de=p("label"),oe=p("input"),_e=h(),se=p("span"),se.textContent="A",me=h(),we=p("div"),w=S(C),L=p("br"),D=h(),y=p("label"),$=p("input"),ae=h(),pe=p("span"),pe.textContent="kWp",he=h(),J=p("div"),J.innerHTML="",ve=h(),ke=p("div"),De=p("label"),Te=p("input"),Oe=h(),Ee=S(Le),Ie=h(),ge&&ge.c(),Ze=h(),qe&&qe.c(),kt=h(),xe=p("label"),ft=p("input"),wt=h(),ut=S(dt),nt=h(),Ge&&Ge.c(),u(l,"class","text-sm"),u(a,"href",hl("Meter-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","m"),f.value="true",u(m,"type","hidden"),u(m,"name","mo"),m.value="1",O.__value=0,z(O,O.__value),T.__value=2,z(T,T.__value),u(M,"name","ma"),u(M,"class","in-s"),t[6].m.a===void 0&&At(()=>t[36].call(M)),u(d,"class","my-1"),B.__value=2,z(B,B.__value),W.__value=1,z(W,W.__value),u(K,"name","md"),u(K,"class","in-s"),t[6].m.d===void 0&&At(()=>t[42].call(K)),u(q,"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(se,"class","in-post"),u(de,"class","flex"),u(Y,"class","mx-1"),u($,"name","mr"),u($,"type","number"),u($,"min","0"),u($,"max","65535"),u($,"class","in-f tr w-full"),u(pe,"class","in-post"),u(y,"class","flex"),u(we,"class","mx-1"),u(ee,"class","my-1 flex"),u(J,"class","my-1"),u(Te,"type","checkbox"),u(Te,"name","me"),Te.__value="true",z(Te,Te.__value),u(Te,"class","rounded mb-1"),u(ke,"class","my-1"),u(ft,"type","checkbox"),u(ft,"name","mm"),ft.__value="true",z(ft,ft.__value),u(ft,"class","rounded mb-1"),u(e,"class","cnt")},m(Ve,Ye){N(Ve,e,Ye),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(e,_),s(e,d),s(d,g),s(d,b),s(d,k),s(d,M),s(M,O),s(O,I),s(M,T),s(T,R),Je&&Je.m(M,null),ze(M,t[6].m.a,!0),s(e,V),et.m(e,null),s(e,H),s(e,q),s(q,Z),s(q,G),s(q,Q),s(q,K),s(K,B),s(K,W),ze(K,t[6].m.d,!0),s(e,ie),s(e,ee),s(ee,Y),s(Y,ue),s(Y,fe),s(Y,ne),s(Y,de),s(de,oe),z(oe,t[6].m.f),s(de,_e),s(de,se),s(ee,me),s(ee,we),s(we,w),s(we,L),s(we,D),s(we,y),s(y,$),z($,t[6].m.r),s(y,ae),s(y,pe),s(e,he),s(e,J),s(e,ve),s(e,ke),s(ke,De),s(De,Te),Te.checked=t[6].m.e.e,s(De,Oe),s(De,Ee),s(ke,Ie),ge&&ge.m(ke,null),s(e,Ze),qe&&qe.m(e,null),s(e,kt),s(e,xe),s(xe,ft),ft.checked=t[6].m.m.e,s(xe,wt),s(xe,ut),s(e,nt),Ge&&Ge.m(e,null),ht||(Ot=[re(M,"change",t[36]),re(K,"change",t[42]),re(oe,"input",t[43]),re($,"input",t[44]),re(Te,"change",t[45]),re(ft,"change",t[48])],ht=!0)},p(Ve,Ye){var Qe,qt,Ut,pt,ot,vt,Rt,be,lt,je,Wt,ul,nl,rl,il,jt,zt,al,Ae,x,Se,Ct,tl;Ye[0]&4&&n!==(n=(((qt=(Qe=Ve[2].conf)==null?void 0:Qe.meter)==null?void 0:qt.title)??"Meter")+"")&&E(i,n),Ye[0]&4&&v!==(v=(((ot=(pt=(Ut=Ve[2].conf)==null?void 0:Ut.meter)==null?void 0:pt.comm)==null?void 0:ot.title)??"Communication")+"")&&E(g,v),Ye[0]&4&&F!==(F=(((be=(Rt=(vt=Ve[2].conf)==null?void 0:vt.meter)==null?void 0:Rt.comm)==null?void 0:be.passive)??"Passive")+"")&&E(I,F),Ye[0]&4&&A!==(A=(((Wt=(je=(lt=Ve[2].conf)==null?void 0:lt.meter)==null?void 0:je.comm)==null?void 0:Wt.pulse)??"Pulse")+"")&&E(R,A),Ye[0]&1&&(j=(nl=(ul=Ve[0])==null?void 0:ul.features)==null?void 0:nl.includes("kmp")),j?Je||(Je=ua(),Je.c(),Je.m(M,null)):Je&&(Je.d(1),Je=null),Ye[0]&64&&ze(M,Ve[6].m.a),Be===(Be=Re(Ve))&&et?et.p(Ve,Ye):(et.d(1),et=Be(Ve),et&&(et.c(),et.m(e,H))),Ye[0]&4&&U!==(U=(((rl=Ve[2].common)==null?void 0:rl.voltage)??"Voltage")+"")&&E(Z,U),Ye[0]&64&&ze(K,Ve[6].m.d),Ye[0]&4&&le!==(le=(((jt=(il=Ve[2].conf)==null?void 0:il.meter)==null?void 0:jt.fuse)??"Main fuse")+"")&&E(ue,le),Ye[0]&64&&Fe(oe.value)!==Ve[6].m.f&&z(oe,Ve[6].m.f),Ye[0]&4&&C!==(C=(((al=(zt=Ve[2].conf)==null?void 0:zt.meter)==null?void 0:al.prod)??"Production")+"")&&E(w,C),Ye[0]&64&&Fe($.value)!==Ve[6].m.r&&z($,Ve[6].m.r),Ye[0]&64&&(Te.checked=Ve[6].m.e.e),Ye[0]&4&&Le!==(Le=(((x=(Ae=Ve[2].conf)==null?void 0:Ae.meter)==null?void 0:x.encrypted)??"Encrypted")+"")&&E(Ee,Le),Ve[6].m.e.e?ge?ge.p(Ve,Ye):(ge=ra(Ve),ge.c(),ge.m(ke,null)):ge&&(ge.d(1),ge=null),Ve[6].m.e.e?qe?qe.p(Ve,Ye):(qe=ca(Ve),qe.c(),qe.m(e,kt)):qe&&(qe.d(1),qe=null),Ye[0]&64&&(ft.checked=Ve[6].m.m.e),Ye[0]&4&&dt!==(dt=(((tl=(Ct=(Se=Ve[2].conf)==null?void 0:Se.meter)==null?void 0:Ct.multipliers)==null?void 0:tl.title)??"Multipliers")+"")&&E(ut,dt),Ve[6].m.m.e?Ge?Ge.p(Ve,Ye):(Ge=_a(Ve),Ge.c(),Ge.m(e,null)):Ge&&(Ge.d(1),Ge=null)},d(Ve){Ve&&P(e),Je&&Je.d(),et.d(),ge&&ge.d(),qe&&qe.d(),Ge&&Ge.d(),ht=!1,Ht(Ot)}}}function ua(t){let e;return{c(){e=p("option"),e.textContent="KMP",e.__value=9,z(e,e.__value)},m(l,n){N(l,e,n)},d(l){l&&P(e)}}}function E0(t){var ue,fe,ne,de,oe,_e;let e,l,n=(((fe=(ue=t[2].conf)==null?void 0:ue.meter)==null?void 0:fe.buffer)??"Buffer size")+"",i,o,a,r=(((de=(ne=t[2].conf)==null?void 0:ne.meter)==null?void 0:de.serial)??"Serial conf.")+"",f,c,m,_,d,v=(((_e=(oe=t[2].conf)==null?void 0:oe.meter)==null?void 0:_e.inverted)??"inverted")+"",g,b,k,M,O,F,I,T,A,R,j,V,H,q,U,Z,G,Q,K,B,W,ie,ee,Y=at([3,12,24,48,96,192,384,576,1152]),le=[];for(let se=0;se<9;se+=1)le[se]=A0(S0(t,Y,se));return{c(){e=p("div"),l=p("span"),i=S(n),o=h(),a=p("span"),f=S(r),c=h(),m=p("label"),_=p("input"),d=h(),g=S(v),b=h(),k=p("div"),M=p("select"),O=p("option"),F=S("Autodetect");for(let se=0;se<9;se+=1)le[se].c();T=h(),A=p("select"),R=p("option"),j=S("-"),H=p("option"),H.textContent="7N1",q=p("option"),q.textContent="8N1",U=p("option"),U.textContent="8N2",Z=p("option"),Z.textContent="7E1",G=p("option"),G.textContent="8E1",K=h(),B=p("input"),u(l,"class","float-right"),u(_,"name","mi"),_.__value="true",z(_,_.__value),u(_,"type","checkbox"),u(_,"class","rounded mb-1"),u(m,"class","mt-2 ml-3 whitespace-nowrap"),O.__value=0,z(O,O.__value),O.disabled=I=t[6].m.b!=0,u(M,"name","mb"),u(M,"class","in-f tr w-1/2"),t[6].m.b===void 0&&At(()=>t[39].call(M)),R.__value=0,z(R,R.__value),R.disabled=V=t[6].m.b!=0,H.__value=2,z(H,H.__value),q.__value=3,z(q,q.__value),U.__value=7,z(U,U.__value),Z.__value=10,z(Z,Z.__value),G.__value=11,z(G,G.__value),u(A,"name","mp"),u(A,"class","in-m"),A.disabled=Q=t[6].m.b==0,t[6].m.p===void 0&&At(()=>t[40].call(A)),u(B,"name","ms"),u(B,"type","number"),u(B,"min",64),u(B,"max",W=t[0].chip=="esp8266"?t[6].i.h.p==3||t[6].i.h.p==113?512:256:4096),u(B,"step",64),u(B,"class","in-l tr w-1/2"),u(k,"class","flex w-full"),u(e,"class","my-1")},m(se,me){N(se,e,me),s(e,l),s(l,i),s(e,o),s(e,a),s(a,f),s(e,c),s(e,m),s(m,_),_.checked=t[6].m.i,s(m,d),s(m,g),s(e,b),s(e,k),s(k,M),s(M,O),s(O,F);for(let we=0;we<9;we+=1)le[we]&&le[we].m(M,null);ze(M,t[6].m.b,!0),s(k,T),s(k,A),s(A,R),s(R,j),s(A,H),s(A,q),s(A,U),s(A,Z),s(A,G),ze(A,t[6].m.p,!0),s(k,K),s(k,B),z(B,t[6].m.s),ie||(ee=[re(_,"change",t[38]),re(M,"change",t[39]),re(A,"change",t[40]),re(B,"input",t[41])],ie=!0)},p(se,me){var we,C,w,L,D,y;me[0]&4&&n!==(n=(((C=(we=se[2].conf)==null?void 0:we.meter)==null?void 0:C.buffer)??"Buffer size")+"")&&E(i,n),me[0]&4&&r!==(r=(((L=(w=se[2].conf)==null?void 0:w.meter)==null?void 0:L.serial)??"Serial conf.")+"")&&E(f,r),me[0]&64&&(_.checked=se[6].m.i),me[0]&4&&v!==(v=(((y=(D=se[2].conf)==null?void 0:D.meter)==null?void 0:y.inverted)??"inverted")+"")&&E(g,v),me[0]&64&&I!==(I=se[6].m.b!=0)&&(O.disabled=I),me[0]&64&&ze(M,se[6].m.b),me[0]&64&&V!==(V=se[6].m.b!=0)&&(R.disabled=V),me[0]&64&&Q!==(Q=se[6].m.b==0)&&(A.disabled=Q),me[0]&64&&ze(A,se[6].m.p),me[0]&65&&W!==(W=se[0].chip=="esp8266"?se[6].i.h.p==3||se[6].i.h.p==113?512:256:4096)&&u(B,"max",W),me[0]&64&&Fe(B.value)!==se[6].m.s&&z(B,se[6].m.s)},d(se){se&&P(e),el(le,se),ie=!1,Ht(ee)}}}function D0(t){var c,m;let e,l,n=(((m=(c=t[2].conf)==null?void 0:c.meter)==null?void 0:m.pulses)??"Pulses per kWh")+"",i,o,a,r,f;return{c(){e=p("div"),l=p("span"),i=S(n),o=h(),a=p("input"),u(a,"name","mb"),u(a,"class","in-s tr"),u(a,"type","number"),u(a,"min",1),u(a,"max",3600),u(e,"class","my-1")},m(_,d){N(_,e,d),s(e,l),s(l,i),s(e,o),s(e,a),z(a,t[6].m.b),r||(f=re(a,"input",t[37]),r=!0)},p(_,d){var v,g;d[0]&4&&n!==(n=(((g=(v=_[2].conf)==null?void 0:v.meter)==null?void 0:g.pulses)??"Pulses per kWh")+"")&&E(i,n),d[0]&64&&Fe(a.value)!==_[6].m.b&&z(a,_[6].m.b)},d(_){_&&P(e),r=!1,f()}}}function A0(t){let e;return{c(){e=p("option"),e.textContent=`${t[137]*100}`,e.__value=t[137]*100,z(e,e.__value)},m(l,n){N(l,e,n)},p:He,d(l){l&&P(e)}}}function ra(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",Lu)},m(o,a){N(o,e,a),N(o,l,a),z(l,t[6].m.e.k),n||(i=re(l,"input",t[46]),n=!0)},p(o,a){a[0]&64&&l.value!==o[6].m.e.k&&z(l,o[6].m.e.k)},d(o){o&&(P(e),P(l)),n=!1,i()}}}function ca(t){var c,m;let e,l=(((m=(c=t[2].conf)==null?void 0:c.meter)==null?void 0:m.authkey)??"Authentication key")+"",n,i,o,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),o=h(),a=p("input"),u(a,"name","mea"),u(a,"type","text"),u(a,"class","in-s"),u(a,"pattern",Lu),u(e,"class","my-1")},m(_,d){N(_,e,d),s(e,n),s(e,i),s(e,o),s(e,a),z(a,t[6].m.e.a),r||(f=re(a,"input",t[47]),r=!0)},p(_,d){var v,g;d[0]&4&&l!==(l=(((g=(v=_[2].conf)==null?void 0:v.meter)==null?void 0:g.authkey)??"Authentication key")+"")&&E(n,l),d[0]&64&&a.value!==_[6].m.e.a&&z(a,_[6].m.e.a)},d(_){_&&P(e),r=!1,f()}}}function _a(t){var Q,K,B,W,ie,ee,Y,le,ue,fe,ne,de;let e,l,n=(((B=(K=(Q=t[2].conf)==null?void 0:Q.meter)==null?void 0:K.multipliers)==null?void 0:B.watt)??"Watt")+"",i,o,a,r,f,c,m=(((ee=(ie=(W=t[2].conf)==null?void 0:W.meter)==null?void 0:ie.multipliers)==null?void 0:ee.volt)??"Volt")+"",_,d,v,g,b,k,M=(((ue=(le=(Y=t[2].conf)==null?void 0:Y.meter)==null?void 0:le.multipliers)==null?void 0:ue.amp)??"Amp")+"",O,F,I,T,A,R,j=(((de=(ne=(fe=t[2].conf)==null?void 0:fe.meter)==null?void 0:ne.multipliers)==null?void 0:de.kwh)??"kWh")+"",V,H,q,U,Z,G;return{c(){e=p("div"),l=p("div"),i=S(n),o=p("br"),a=h(),r=p("input"),f=h(),c=p("div"),_=S(m),d=p("br"),v=h(),g=p("input"),b=h(),k=p("div"),O=S(M),F=p("br"),I=h(),T=p("input"),A=h(),R=p("div"),V=S(j),H=p("br"),q=h(),U=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(g,"name","mmv"),u(g,"type","number"),u(g,"min","0.00"),u(g,"max","1000"),u(g,"step","0.001"),u(g,"class","in-m tr w-full"),u(c,"class","w-1/4"),u(T,"name","mma"),u(T,"type","number"),u(T,"min","0.00"),u(T,"max","1000"),u(T,"step","0.001"),u(T,"class","in-m tr w-full"),u(k,"class","w-1/4"),u(U,"name","mmc"),u(U,"type","number"),u(U,"min","0.00"),u(U,"max","1000"),u(U,"step","0.001"),u(U,"class","in-l tr w-full"),u(R,"class","w-1/4"),u(e,"class","flex my-1")},m(oe,_e){N(oe,e,_e),s(e,l),s(l,i),s(l,o),s(l,a),s(l,r),z(r,t[6].m.m.w),s(e,f),s(e,c),s(c,_),s(c,d),s(c,v),s(c,g),z(g,t[6].m.m.v),s(e,b),s(e,k),s(k,O),s(k,F),s(k,I),s(k,T),z(T,t[6].m.m.a),s(e,A),s(e,R),s(R,V),s(R,H),s(R,q),s(R,U),z(U,t[6].m.m.c),Z||(G=[re(r,"input",t[49]),re(g,"input",t[50]),re(T,"input",t[51]),re(U,"input",t[52])],Z=!0)},p(oe,_e){var se,me,we,C,w,L,D,y,$,ae,pe,he;_e[0]&4&&n!==(n=(((we=(me=(se=oe[2].conf)==null?void 0:se.meter)==null?void 0:me.multipliers)==null?void 0:we.watt)??"Watt")+"")&&E(i,n),_e[0]&64&&Fe(r.value)!==oe[6].m.m.w&&z(r,oe[6].m.m.w),_e[0]&4&&m!==(m=(((L=(w=(C=oe[2].conf)==null?void 0:C.meter)==null?void 0:w.multipliers)==null?void 0:L.volt)??"Volt")+"")&&E(_,m),_e[0]&64&&Fe(g.value)!==oe[6].m.m.v&&z(g,oe[6].m.m.v),_e[0]&4&&M!==(M=((($=(y=(D=oe[2].conf)==null?void 0:D.meter)==null?void 0:y.multipliers)==null?void 0:$.amp)??"Amp")+"")&&E(O,M),_e[0]&64&&Fe(T.value)!==oe[6].m.m.a&&z(T,oe[6].m.m.a),_e[0]&4&&j!==(j=(((he=(pe=(ae=oe[2].conf)==null?void 0:ae.meter)==null?void 0:pe.multipliers)==null?void 0:he.kwh)??"kWh")+"")&&E(V,j),_e[0]&64&&Fe(U.value)!==oe[6].m.m.c&&z(U,oe[6].m.m.c)},d(oe){oe&&P(e),Z=!1,Ht(G)}}}function ma(t){var R,j,V,H,q,U;let e,l,n=(((j=(R=t[2].conf)==null?void 0:R.connection)==null?void 0:j.title)??"Connection")+"",i,o,a,r,f,c,m,_,d,v=(((H=(V=t[2].conf)==null?void 0:V.connection)==null?void 0:H.wifi)??"WiFi")+"",g,b,k=(((U=(q=t[2].conf)==null?void 0:q.connection)==null?void 0:U.ap)??"AP")+"",M,O,F,I,T=t[0].if&&t[0].if.eth&&pa(t),A=(t[6].n.c==1||t[6].n.c==2)&&da(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),_=p("select"),d=p("option"),g=S(v),b=p("option"),M=S(k),T&&T.c(),O=h(),A&&A.c(),u(l,"class","text-sm"),u(a,"href",hl("Network-connection")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","w"),f.value="true",d.__value=1,z(d,d.__value),b.__value=2,z(b,b.__value),u(_,"name","nc"),u(_,"class","in-s"),t[6].n.c===void 0&&At(()=>t[53].call(_)),u(m,"class","my-1"),u(e,"class","cnt")},m(Z,G){N(Z,e,G),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,_),s(_,d),s(d,g),s(_,b),s(b,M),T&&T.m(_,null),ze(_,t[6].n.c,!0),s(e,O),A&&A.m(e,null),F||(I=re(_,"change",t[53]),F=!0)},p(Z,G){var Q,K,B,W,ie,ee;G[0]&4&&n!==(n=(((K=(Q=Z[2].conf)==null?void 0:Q.connection)==null?void 0:K.title)??"Connection")+"")&&E(i,n),G[0]&4&&v!==(v=(((W=(B=Z[2].conf)==null?void 0:B.connection)==null?void 0:W.wifi)??"WiFi")+"")&&E(g,v),G[0]&4&&k!==(k=(((ee=(ie=Z[2].conf)==null?void 0:ie.connection)==null?void 0:ee.ap)??"AP")+"")&&E(M,k),Z[0].if&&Z[0].if.eth?T?T.p(Z,G):(T=pa(Z),T.c(),T.m(_,null)):T&&(T.d(1),T=null),G[0]&64&&ze(_,Z[6].n.c),Z[6].n.c==1||Z[6].n.c==2?A?A.p(Z,G):(A=da(Z),A.c(),A.m(e,null)):A&&(A.d(1),A=null)},d(Z){Z&&P(e),T&&T.d(),A&&A.d(),F=!1,I()}}}function pa(t){var i,o;let e,l=(((o=(i=t[2].conf)==null?void 0:i.connection)==null?void 0:o.eth)??"Ethernet")+"",n;return{c(){e=p("option"),n=S(l),e.__value=3,z(e,e.__value)},m(a,r){N(a,e,r),s(e,n)},p(a,r){var f,c;r[0]&4&&l!==(l=(((c=(f=a[2].conf)==null?void 0:f.connection)==null?void 0:c.eth)??"Ethernet")+"")&&E(n,l)},d(a){a&&P(e)}}}function da(t){var De,Te,Oe,Le,Ee,Ie,Ze,kt,xe,ft,wt,dt,ut,nt,ht,Ot,Je,Re,Be,et,ge,qe,Ge;let e,l=(((Te=(De=t[2].conf)==null?void 0:De.connection)==null?void 0:Te.ssid)??"SSID")+"",n,i,o,a,r,f,c,m,_,d,v=(((Le=(Oe=t[2].conf)==null?void 0:Oe.connection)==null?void 0:Le.psk)??"Password")+"",g,b,k,M,O,F,I,T=(((Ze=(Ie=(Ee=t[2].conf)==null?void 0:Ee.connection)==null?void 0:Ie.ps)==null?void 0:Ze.title)??"Power saving")+"",A,R,j,V,H,q=(((ft=(xe=(kt=t[2].conf)==null?void 0:kt.connection)==null?void 0:xe.ps)==null?void 0:ft.default)??"Default")+"",U,Z,G=(((ut=(dt=(wt=t[2].conf)==null?void 0:wt.connection)==null?void 0:dt.ps)==null?void 0:ut.off)??"Off")+"",Q,K,B=(((Ot=(ht=(nt=t[2].conf)==null?void 0:nt.connection)==null?void 0:ht.ps)==null?void 0:Ot.min)??"Min")+"",W,ie,ee=(((Be=(Re=(Je=t[2].conf)==null?void 0:Je.connection)==null?void 0:Re.ps)==null?void 0:Be.max)??"Max")+"",Y,le,ue,fe=(((ge=(et=t[2].conf)==null?void 0:et.connection)==null?void 0:ge.pwr)??"Power")+"",ne,de,oe,_e,se,me,we,C,w,L,D,y,$=(((Ge=(qe=t[2].conf)==null?void 0:qe.connection)==null?void 0:Ge.tick_11b)??"802.11b")+"",ae,pe,he;function J(ce,Ce){return ce[8]?L0:O0}let ve=J(t),ke=ve(t);return{c(){e=p("div"),n=S(l),i=h(),o=p("label"),a=p("input"),r=S(" manual"),f=h(),c=p("br"),m=h(),ke.c(),_=h(),d=p("div"),g=S(v),b=p("br"),k=h(),M=p("input"),O=h(),F=p("div"),I=p("div"),A=S(T),R=p("br"),j=h(),V=p("select"),H=p("option"),U=S(q),Z=p("option"),Q=S(G),K=p("option"),W=S(B),ie=p("option"),Y=S(ee),le=h(),ue=p("div"),ne=S(fe),de=p("br"),oe=h(),_e=p("div"),se=p("input"),me=h(),we=p("span"),we.textContent="dBm",C=h(),w=p("div"),L=p("label"),D=p("input"),y=h(),ae=S($),u(a,"type","checkbox"),a.__value="true",z(a,a.__value),u(a,"class","rounded mb-1"),u(o,"class","float-right mr-3"),u(e,"class","my-1"),u(M,"name","wp"),u(M,"type","password"),u(M,"class","in-s"),u(M,"pattern",Pn),u(d,"class","my-1"),H.__value=255,z(H,H.__value),Z.__value=0,z(Z,Z.__value),K.__value=1,z(K,K.__value),ie.__value=2,z(ie,ie.__value),u(V,"name","wz"),u(V,"class","in-s"),t[6].w.z===void 0&&At(()=>t[58].call(V)),u(I,"class","w-1/2"),u(se,"name","ww"),u(se,"type","number"),u(se,"min","0"),u(se,"max","20.5"),u(se,"step","0.5"),u(se,"class","in-f tr w-full"),u(we,"class","in-post"),u(_e,"class","flex"),u(ue,"class","ml-2 w-1/2"),u(F,"class","my-1 flex"),u(D,"type","checkbox"),u(D,"name","wb"),D.__value="true",z(D,D.__value),u(D,"class","rounded mb-1"),u(w,"class","my-3")},m(ce,Ce){N(ce,e,Ce),s(e,n),s(e,i),s(e,o),s(o,a),a.checked=t[8],s(o,r),s(e,f),s(e,c),s(e,m),ke.m(e,null),N(ce,_,Ce),N(ce,d,Ce),s(d,g),s(d,b),s(d,k),s(d,M),z(M,t[6].w.p),N(ce,O,Ce),N(ce,F,Ce),s(F,I),s(I,A),s(I,R),s(I,j),s(I,V),s(V,H),s(H,U),s(V,Z),s(Z,Q),s(V,K),s(K,W),s(V,ie),s(ie,Y),ze(V,t[6].w.z,!0),s(F,le),s(F,ue),s(ue,ne),s(ue,de),s(ue,oe),s(ue,_e),s(_e,se),z(se,t[6].w.w),s(_e,me),s(_e,we),N(ce,C,Ce),N(ce,w,Ce),s(w,L),s(L,D),D.checked=t[6].w.b,s(L,y),s(L,ae),pe||(he=[re(a,"change",t[54]),re(M,"input",t[57]),re(V,"change",t[58]),re(se,"input",t[59]),re(D,"change",t[60])],pe=!0)},p(ce,Ce){var $e,ye,Lt,bt,Ke,Mt,it,ct,tt,Bt,Xt,rt,st,Gt,Jt,Tt,Yt,xt,$t,Vt,It,Ve,Ye;Ce[0]&4&&l!==(l=(((ye=($e=ce[2].conf)==null?void 0:$e.connection)==null?void 0:ye.ssid)??"SSID")+"")&&E(n,l),Ce[0]&256&&(a.checked=ce[8]),ve===(ve=J(ce))&&ke?ke.p(ce,Ce):(ke.d(1),ke=ve(ce),ke&&(ke.c(),ke.m(e,null))),Ce[0]&4&&v!==(v=(((bt=(Lt=ce[2].conf)==null?void 0:Lt.connection)==null?void 0:bt.psk)??"Password")+"")&&E(g,v),Ce[0]&64&&M.value!==ce[6].w.p&&z(M,ce[6].w.p),Ce[0]&4&&T!==(T=(((it=(Mt=(Ke=ce[2].conf)==null?void 0:Ke.connection)==null?void 0:Mt.ps)==null?void 0:it.title)??"Power saving")+"")&&E(A,T),Ce[0]&4&&q!==(q=(((Bt=(tt=(ct=ce[2].conf)==null?void 0:ct.connection)==null?void 0:tt.ps)==null?void 0:Bt.default)??"Default")+"")&&E(U,q),Ce[0]&4&&G!==(G=(((st=(rt=(Xt=ce[2].conf)==null?void 0:Xt.connection)==null?void 0:rt.ps)==null?void 0:st.off)??"Off")+"")&&E(Q,G),Ce[0]&4&&B!==(B=(((Tt=(Jt=(Gt=ce[2].conf)==null?void 0:Gt.connection)==null?void 0:Jt.ps)==null?void 0:Tt.min)??"Min")+"")&&E(W,B),Ce[0]&4&&ee!==(ee=((($t=(xt=(Yt=ce[2].conf)==null?void 0:Yt.connection)==null?void 0:xt.ps)==null?void 0:$t.max)??"Max")+"")&&E(Y,ee),Ce[0]&64&&ze(V,ce[6].w.z),Ce[0]&4&&fe!==(fe=(((It=(Vt=ce[2].conf)==null?void 0:Vt.connection)==null?void 0:It.pwr)??"Power")+"")&&E(ne,fe),Ce[0]&64&&Fe(se.value)!==ce[6].w.w&&z(se,ce[6].w.w),Ce[0]&64&&(D.checked=ce[6].w.b),Ce[0]&4&&$!==($=(((Ye=(Ve=ce[2].conf)==null?void 0:Ve.connection)==null?void 0:Ye.tick_11b)??"802.11b")+"")&&E(ae,$)},d(ce){ce&&(P(e),P(_),P(d),P(O),P(F),P(C),P(w)),ke.d(),pe=!1,Ht(he)}}}function O0(t){var f,c;let e,l,n,i,o,a=((f=t[9])==null?void 0:f.c)==-1&&ha(),r=((c=t[9])==null?void 0:c.n)&&va(t);return{c(){e=p("select"),a&&a.c(),l=yt(),r&&r.c(),u(e,"name","ws"),u(e,"class","in-s"),e.required=n=t[6].n.c==1||t[6].n.c==2,t[6].w.s===void 0&&At(()=>t[56].call(e))},m(m,_){N(m,e,_),a&&a.m(e,null),s(e,l),r&&r.m(e,null),ze(e,t[6].w.s,!0),i||(o=re(e,"change",t[56]),i=!0)},p(m,_){var d,v;((d=m[9])==null?void 0:d.c)==-1?a||(a=ha(),a.c(),a.m(e,l)):a&&(a.d(1),a=null),(v=m[9])!=null&&v.n?r?r.p(m,_):(r=va(m),r.c(),r.m(e,null)):r&&(r.d(1),r=null),_[0]&64&&n!==(n=m[6].n.c==1||m[6].n.c==2)&&(e.required=n),_[0]&64&&ze(e,m[6].w.s)},d(m){m&&P(e),a&&a.d(),r&&r.d(),i=!1,o()}}}function L0(t){let e,l,n,i;return{c(){e=p("input"),u(e,"name","ws"),u(e,"type","text"),u(e,"class","in-s"),u(e,"pattern",Pn),e.required=l=t[6].n.c==1||t[6].n.c==2},m(o,a){N(o,e,a),z(e,t[6].w.s),n||(i=re(e,"input",t[55]),n=!0)},p(o,a){a[0]&64&&l!==(l=o[6].n.c==1||o[6].n.c==2)&&(e.required=l),a[0]&64&&e.value!==o[6].w.s&&z(e,o[6].w.s)},d(o){o&&P(e),n=!1,i()}}}function ha(t){let e;return{c(){e=p("option"),e.textContent="Scanning...",e.__value="",z(e,e.__value),e.selected=!0,e.disabled=!0},m(l,n){N(l,e,n)},d(l){l&&P(e)}}}function va(t){var i;let e,l=at((i=t[9])==null?void 0:i.n),n=[];for(let o=0;ot[61].call(g)),u(A,"name","ni"),u(A,"type","text"),u(A,"class","in-m w-full"),A.disabled=R=t[6].n.m=="dhcp",A.required=j=t[6].n.m=="static",u(A,"pattern",cn),u(H,"name","ns"),u(H,"class","in-l"),H.disabled=U=t[6].n.m=="dhcp",H.required=Z=t[6].n.m=="static",t[6].n.s===void 0&&At(()=>t[63].call(H)),u(v,"class","flex"),u(f,"class","my-1"),u(W,"name","nx"),W.__value="true",z(W,W.__value),u(W,"type","checkbox"),u(W,"class","rounded mb-1"),u(K,"class","my-1"),u(ue,"name","nd"),ue.__value="true",z(ue,ue.__value),u(ue,"type","checkbox"),u(ue,"class","rounded mb-1"),u(Y,"class","my-1"),u(_e,"type","hidden"),u(_e,"name","ntp"),_e.value="true",u(D,"name","ntpd"),D.__value="true",z(D,D.__value),u(D,"type","checkbox"),u(D,"class","rounded mb-1"),u(L,"class","ml-4"),u(ve,"name","ntph"),u(ve,"type","text"),u(ve,"class","in-s"),u(ve,"pattern",Ll),u(J,"class","flex"),u(me,"class","my-1"),u(e,"class","cnt")},m(Re,Be){N(Re,e,Be),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(f,m),s(f,_),s(f,d),s(f,v),s(v,g),s(g,b),s(b,M),s(g,O),s(O,I),ze(g,t[6].n.m,!0),s(v,T),s(v,A),z(A,t[6].n.i),s(v,V),s(v,H),Me(q,H,null),ze(H,t[6].n.s,!0),s(e,G),Oe&&Oe.m(e,null),s(e,Q),s(e,K),s(K,B),s(B,W),W.checked=t[6].n.x,s(B,ie),s(e,ee),s(e,Y),s(Y,le),s(le,ue),ue.checked=t[6].n.d,s(le,fe),s(le,de),s(e,oe),s(e,_e),s(e,se),s(e,me),s(me,C),s(me,w),s(me,L),s(L,D),D.checked=t[6].n.h,s(L,y),s(L,ae),s(me,pe),s(me,he),s(me,J),s(J,ve),z(ve,t[6].n.n1),ke=!0,De||(Te=[re(g,"change",t[61]),re(A,"input",t[62]),re(H,"change",t[63]),re(W,"change",t[67]),re(ue,"change",t[68]),re(D,"change",t[69]),re(ve,"input",t[70])],De=!0)},p(Re,Be){var et,ge,qe,Ge,ce,Ce,$e,ye,Lt,bt,Ke,Mt,it,ct;(!ke||Be[0]&4)&&n!==(n=(((ge=(et=Re[2].conf)==null?void 0:et.network)==null?void 0:ge.title)??"Network")+"")&&E(i,n),(!ke||Be[0]&4)&&c!==(c=(((Ge=(qe=Re[2].conf)==null?void 0:qe.network)==null?void 0:Ge.ip)??"IP")+"")&&E(m,c),(!ke||Be[0]&4)&&k!==(k=(((Ce=(ce=Re[2].conf)==null?void 0:ce.network)==null?void 0:Ce.dhcp)??"DHCP")+"")&&E(M,k),(!ke||Be[0]&4)&&F!==(F=(((ye=($e=Re[2].conf)==null?void 0:$e.network)==null?void 0:ye.static)??"Static")+"")&&E(I,F),Be[0]&64&&ze(g,Re[6].n.m),(!ke||Be[0]&64&&R!==(R=Re[6].n.m=="dhcp"))&&(A.disabled=R),(!ke||Be[0]&64&&j!==(j=Re[6].n.m=="static"))&&(A.required=j),Be[0]&64&&A.value!==Re[6].n.i&&z(A,Re[6].n.i),(!ke||Be[0]&64&&U!==(U=Re[6].n.m=="dhcp"))&&(H.disabled=U),(!ke||Be[0]&64&&Z!==(Z=Re[6].n.m=="static"))&&(H.required=Z),Be[0]&64&&ze(H,Re[6].n.s),Re[6].n.m=="static"?Oe?Oe.p(Re,Be):(Oe=ka(Re),Oe.c(),Oe.m(e,Q)):Oe&&(Oe.d(1),Oe=null),Be[0]&64&&(W.checked=Re[6].n.x),Be[0]&64&&(ue.checked=Re[6].n.d),(!ke||Be[0]&4)&&ne!==(ne=(((bt=(Lt=Re[2].conf)==null?void 0:Lt.network)==null?void 0:bt.tick_mdns)??"mDNS")+"")&&E(de,ne),(!ke||Be[0]&4)&&we!==(we=(((Mt=(Ke=Re[2].conf)==null?void 0:Ke.network)==null?void 0:Mt.ntp)??"NTP")+"")&&E(C,we),Be[0]&64&&(D.checked=Re[6].n.h),(!ke||Be[0]&4)&&$!==($=(((ct=(it=Re[2].conf)==null?void 0:it.network)==null?void 0:ct.tick_ntp_dhcp)??"from DHCP")+"")&&E(ae,$),Be[0]&64&&ve.value!==Re[6].n.n1&&z(ve,Re[6].n.n1)},i(Re){ke||(X(q.$$.fragment,Re),ke=!0)},o(Re){te(q.$$.fragment,Re),ke=!1},d(Re){Re&&P(e),Pe(q),Oe&&Oe.d(),De=!1,Ht(Te)}}}function ka(t){var F,I,T,A;let e,l=(((I=(F=t[2].conf)==null?void 0:F.network)==null?void 0:I.gw)??"Gateway")+"",n,i,o,a,r,f,c=(((A=(T=t[2].conf)==null?void 0:T.network)==null?void 0:A.dns)??"DNS")+"",m,_,d,v,g,b,k,M,O;return{c(){e=p("div"),n=S(l),i=p("br"),o=h(),a=p("input"),r=h(),f=p("div"),m=S(c),_=p("br"),d=h(),v=p("div"),g=p("input"),b=h(),k=p("input"),u(a,"name","ng"),u(a,"type","text"),u(a,"class","in-s"),u(a,"pattern",cn),u(e,"class","my-1"),u(g,"name","nd1"),u(g,"type","text"),u(g,"class","in-f w-full"),u(g,"pattern",cn),u(k,"name","nd2"),u(k,"type","text"),u(k,"class","in-l w-full"),u(k,"pattern",cn),u(v,"class","flex"),u(f,"class","my-1")},m(R,j){N(R,e,j),s(e,n),s(e,i),s(e,o),s(e,a),z(a,t[6].n.g),N(R,r,j),N(R,f,j),s(f,m),s(f,_),s(f,d),s(f,v),s(v,g),z(g,t[6].n.d1),s(v,b),s(v,k),z(k,t[6].n.d2),M||(O=[re(a,"input",t[64]),re(g,"input",t[65]),re(k,"input",t[66])],M=!0)},p(R,j){var V,H,q,U;j[0]&4&&l!==(l=(((H=(V=R[2].conf)==null?void 0:V.network)==null?void 0:H.gw)??"Gateway")+"")&&E(n,l),j[0]&64&&a.value!==R[6].n.g&&z(a,R[6].n.g),j[0]&4&&c!==(c=(((U=(q=R[2].conf)==null?void 0:q.network)==null?void 0:U.dns)??"DNS")+"")&&E(m,c),j[0]&64&&g.value!==R[6].n.d1&&z(g,R[6].n.d1),j[0]&64&&k.value!==R[6].n.d2&&z(k,R[6].n.d2)},d(R){R&&(P(e),P(r),P(f)),M=!1,Ht(O)}}}function wa(t){var vt,Rt,be,lt,je,Wt,ul,nl,rl,il,jt,zt,al,Ae,x,Se,Ct,tl,cl,dl,sl,vl,bl,Ml,Pl,Il,Rl,Fl;let e,l,n=(((Rt=(vt=t[2].conf)==null?void 0:vt.mqtt)==null?void 0:Rt.title)??"MQTT")+"",i,o,a,r,f,c,m,_=(((lt=(be=t[2].conf)==null?void 0:be.mqtt)==null?void 0:lt.server)??"Server")+"",d,v,g,b,k,M,O,F,I,T,A,R,j=(((Wt=(je=t[2].conf)==null?void 0:je.mqtt)==null?void 0:Wt.user)??"Username")+"",V,H,q,U,Z,G,Q=(((nl=(ul=t[2].conf)==null?void 0:ul.mqtt)==null?void 0:nl.pass)??"Password")+"",K,B,W,ie,ee,Y,le,ue=(((il=(rl=t[2].conf)==null?void 0:rl.mqtt)==null?void 0:il.id)??"Client ID")+"",fe,ne,de,oe,_e,se,me,we=(((zt=(jt=t[2].conf)==null?void 0:jt.mqtt)==null?void 0:zt.payload)??"Payload")+"",C,w,L,D,y,$,ae,pe,he,J,ve,ke,De,Te,Oe=(((Ae=(al=t[2].conf)==null?void 0:al.mqtt)==null?void 0:Ae.publish)??"Publish topic")+"",Le,Ee,Ie,Ze,kt,xe,ft=(((Se=(x=t[2].conf)==null?void 0:x.mqtt)==null?void 0:Se.subscribe)??"Subscribe topic")+"",wt,dt,ut,nt,ht,Ot,Je,Re=(((tl=(Ct=t[2].conf)==null?void 0:Ct.mqtt)==null?void 0:tl.update)??"Update method")+"",Be,et,ge,qe=(((dl=(cl=t[2].conf)==null?void 0:cl.mqtt)==null?void 0:dl.interval)??"Interval")+"",Ge,ce,Ce,$e,ye,Lt=(((vl=(sl=t[2].conf)==null?void 0:sl.mqtt)==null?void 0:vl.realtime)??"Real time")+"",bt,Ke,Mt=(((Ml=(bl=t[2].conf)==null?void 0:bl.mqtt)==null?void 0:Ml.interval)??"Interval")+"",it,ct,tt,Bt,Xt,rt,st=(((Il=(Pl=t[2].conf)==null?void 0:Pl.mqtt)==null?void 0:Il.timeout)??"Timeout")+"",Gt,Jt,Tt,Yt=(((Fl=(Rl=t[2].conf)==null?void 0:Rl.mqtt)==null?void 0:Fl.keepalive)??"Keep-alive")+"",xt,$t,Vt,It,Ve,Ye,Qe,qt,Ut,pt=t[0].chip!="esp8266"&&Ca(t),ot=t[6].q.s.e&&Sa(t);return{c(){var We,gt;e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),d=S(_),v=h(),pt&&pt.c(),g=h(),b=p("br"),k=h(),M=p("div"),O=p("input"),F=h(),I=p("input"),T=h(),ot&&ot.c(),A=h(),R=p("div"),V=S(j),H=p("br"),q=h(),U=p("input"),Z=h(),G=p("div"),K=S(Q),B=p("br"),W=h(),ie=p("input"),ee=h(),Y=p("div"),le=p("div"),fe=S(ue),ne=p("br"),de=h(),oe=p("input"),se=h(),me=p("div"),C=S(we),w=p("br"),L=h(),D=p("select"),y=p("option"),y.textContent="Raw (minimal)",$=p("option"),$.textContent="Raw (full)",ae=p("option"),ae.textContent="Domoticz",pe=p("option"),pe.textContent="Home-Assistant",he=p("option"),he.textContent="JSON (classic)",J=p("option"),J.textContent="JSON (multi topic)",ve=p("option"),ve.textContent="JSON (flat)",ke=p("option"),ke.textContent="HEX dump",De=h(),Te=p("div"),Le=S(Oe),Ee=p("br"),Ie=h(),Ze=p("input"),kt=h(),xe=p("div"),wt=S(ft),dt=p("br"),ut=h(),nt=p("input"),Ot=h(),Je=p("div"),Be=S(Re),et=h(),ge=p("span"),Ge=S(qe),ce=h(),Ce=p("div"),$e=p("select"),ye=p("option"),bt=S(Lt),Ke=p("option"),it=S(Mt),ct=h(),tt=p("input"),Xt=h(),rt=p("div"),Gt=S(st),Jt=h(),Tt=p("span"),xt=S(Yt),$t=h(),Vt=p("div"),It=p("input"),Ve=h(),Ye=p("input"),u(l,"class","text-sm"),u(a,"href",hl("MQTT-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","q"),f.value="true",u(O,"name","qh"),u(O,"type","text"),u(O,"class","in-f w-2/3"),u(O,"pattern",Ll),u(I,"name","qp"),u(I,"type","number"),u(I,"min","1024"),u(I,"max","65535"),u(I,"class","in-l tr w-1/3"),u(M,"class","flex"),u(m,"class","my-1"),u(U,"name","qu"),u(U,"type","text"),u(U,"class","in-s"),u(U,"pattern",Pn),u(R,"class","my-1"),u(ie,"name","qa"),u(ie,"type","password"),u(ie,"class","in-s"),u(ie,"pattern",Pn),u(G,"class","my-1"),u(oe,"name","qc"),u(oe,"type","text"),u(oe,"class","in-f w-full"),oe.required=_e=t[6].q.h,u(oe,"pattern",Vn),y.__value=1,z(y,y.__value),$.__value=2,z($,$.__value),ae.__value=3,z(ae,ae.__value),pe.__value=4,z(pe,pe.__value),he.__value=0,z(he,he.__value),J.__value=5,z(J,J.__value),ve.__value=6,z(ve,ve.__value),ke.__value=255,z(ke,ke.__value),u(D,"name","qm"),u(D,"class","in-l"),t[6].q.m===void 0&&At(()=>t[77].call(D)),u(Y,"class","my-1 flex"),u(Ze,"name","qb"),u(Ze,"type","text"),u(Ze,"class","in-s"),u(Ze,"pattern",Ll),u(Te,"class","my-1"),u(nt,"name","qr"),u(nt,"type","text"),u(nt,"class","in-s"),u(nt,"pattern",Ll),u(nt,"placeholder",ht=t[6].q.b+"/command"),u(xe,"class","my-1"),u(ge,"class","float-right"),ye.__value=0,z(ye,ye.__value),Ke.__value=1,z(Ke,Ke.__value),u($e,"name","qt"),u($e,"class","in-f w-1/2"),t[6].q.t===void 0&&At(()=>t[80].call($e)),u(tt,"name","qd"),u(tt,"type","number"),u(tt,"min","1"),u(tt,"max","3600"),u(tt,"class","in-l tr w-1/2"),tt.disabled=Bt=((gt=(We=t[6])==null?void 0:We.q)==null?void 0:gt.t)!=1,u(Ce,"class","flex"),u(Je,"class","my-1"),u(Tt,"class","float-right"),u(It,"name","qi"),u(It,"type","number"),u(It,"min","500"),u(It,"max","10000"),u(It,"class","in-f tr w-1/2"),u(Ye,"name","qk"),u(Ye,"type","number"),u(Ye,"min","5"),u(Ye,"max","180"),u(Ye,"class","in-l tr w-1/2"),u(Vt,"class","flex"),u(rt,"class","my-1"),u(e,"class","cnt")},m(We,gt){N(We,e,gt),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,d),s(m,v),pt&&pt.m(m,null),s(m,g),s(m,b),s(m,k),s(m,M),s(M,O),z(O,t[6].q.h),s(M,F),s(M,I),z(I,t[6].q.p),s(e,T),ot&&ot.m(e,null),s(e,A),s(e,R),s(R,V),s(R,H),s(R,q),s(R,U),z(U,t[6].q.u),s(e,Z),s(e,G),s(G,K),s(G,B),s(G,W),s(G,ie),z(ie,t[6].q.a),s(e,ee),s(e,Y),s(Y,le),s(le,fe),s(le,ne),s(le,de),s(le,oe),z(oe,t[6].q.c),s(Y,se),s(Y,me),s(me,C),s(me,w),s(me,L),s(me,D),s(D,y),s(D,$),s(D,ae),s(D,pe),s(D,he),s(D,J),s(D,ve),s(D,ke),ze(D,t[6].q.m,!0),s(e,De),s(e,Te),s(Te,Le),s(Te,Ee),s(Te,Ie),s(Te,Ze),z(Ze,t[6].q.b),s(e,kt),s(e,xe),s(xe,wt),s(xe,dt),s(xe,ut),s(xe,nt),z(nt,t[6].q.r),s(e,Ot),s(e,Je),s(Je,Be),s(Je,et),s(Je,ge),s(ge,Ge),s(Je,ce),s(Je,Ce),s(Ce,$e),s($e,ye),s(ye,bt),s($e,Ke),s(Ke,it),ze($e,t[6].q.t,!0),s(Ce,ct),s(Ce,tt),z(tt,t[6].q.d),s(e,Xt),s(e,rt),s(rt,Gt),s(rt,Jt),s(rt,Tt),s(Tt,xt),s(rt,$t),s(rt,Vt),s(Vt,It),z(It,t[6].q.i),s(Vt,Ve),s(Vt,Ye),z(Ye,t[6].q.k),Qe=!0,qt||(Ut=[re(O,"input",t[72]),re(I,"input",t[73]),re(U,"input",t[74]),re(ie,"input",t[75]),re(oe,"input",t[76]),re(D,"change",t[77]),re(Ze,"input",t[78]),re(nt,"input",t[79]),re($e,"change",t[80]),re(tt,"input",t[81]),re(It,"input",t[82]),re(Ye,"input",t[83])],qt=!0)},p(We,gt){var Bl,Ul,jl,zl,Hl,yl,Wl,Gl,Vl,Kl,Ue,Et,ll,Yl,Ql,Xl,Zl,Jl,$l,xl,en,Nn,Tn,qn,En,Dn,An,On,Ln,In;(!Qe||gt[0]&4)&&n!==(n=(((Ul=(Bl=We[2].conf)==null?void 0:Bl.mqtt)==null?void 0:Ul.title)??"MQTT")+"")&&E(i,n),(!Qe||gt[0]&4)&&_!==(_=(((zl=(jl=We[2].conf)==null?void 0:jl.mqtt)==null?void 0:zl.server)??"Server")+"")&&E(d,_),We[0].chip!="esp8266"?pt?pt.p(We,gt):(pt=Ca(We),pt.c(),pt.m(m,g)):pt&&(pt.d(1),pt=null),gt[0]&64&&O.value!==We[6].q.h&&z(O,We[6].q.h),gt[0]&64&&Fe(I.value)!==We[6].q.p&&z(I,We[6].q.p),We[6].q.s.e?ot?(ot.p(We,gt),gt[0]&64&&X(ot,1)):(ot=Sa(We),ot.c(),X(ot,1),ot.m(e,A)):ot&&(_t(),te(ot,1,1,()=>{ot=null}),mt()),(!Qe||gt[0]&4)&&j!==(j=(((yl=(Hl=We[2].conf)==null?void 0:Hl.mqtt)==null?void 0:yl.user)??"Username")+"")&&E(V,j),gt[0]&64&&U.value!==We[6].q.u&&z(U,We[6].q.u),(!Qe||gt[0]&4)&&Q!==(Q=(((Gl=(Wl=We[2].conf)==null?void 0:Wl.mqtt)==null?void 0:Gl.pass)??"Password")+"")&&E(K,Q),gt[0]&64&&ie.value!==We[6].q.a&&z(ie,We[6].q.a),(!Qe||gt[0]&4)&&ue!==(ue=(((Kl=(Vl=We[2].conf)==null?void 0:Vl.mqtt)==null?void 0:Kl.id)??"Client ID")+"")&&E(fe,ue),(!Qe||gt[0]&64&&_e!==(_e=We[6].q.h))&&(oe.required=_e),gt[0]&64&&oe.value!==We[6].q.c&&z(oe,We[6].q.c),(!Qe||gt[0]&4)&&we!==(we=(((Et=(Ue=We[2].conf)==null?void 0:Ue.mqtt)==null?void 0:Et.payload)??"Payload")+"")&&E(C,we),gt[0]&64&&ze(D,We[6].q.m),(!Qe||gt[0]&4)&&Oe!==(Oe=(((Yl=(ll=We[2].conf)==null?void 0:ll.mqtt)==null?void 0:Yl.publish)??"Publish topic")+"")&&E(Le,Oe),gt[0]&64&&Ze.value!==We[6].q.b&&z(Ze,We[6].q.b),(!Qe||gt[0]&4)&&ft!==(ft=(((Xl=(Ql=We[2].conf)==null?void 0:Ql.mqtt)==null?void 0:Xl.subscribe)??"Subscribe topic")+"")&&E(wt,ft),(!Qe||gt[0]&64&&ht!==(ht=We[6].q.b+"/command"))&&u(nt,"placeholder",ht),gt[0]&64&&nt.value!==We[6].q.r&&z(nt,We[6].q.r),(!Qe||gt[0]&4)&&Re!==(Re=(((Jl=(Zl=We[2].conf)==null?void 0:Zl.mqtt)==null?void 0:Jl.update)??"Update method")+"")&&E(Be,Re),(!Qe||gt[0]&4)&&qe!==(qe=(((xl=($l=We[2].conf)==null?void 0:$l.mqtt)==null?void 0:xl.interval)??"Interval")+"")&&E(Ge,qe),(!Qe||gt[0]&4)&&Lt!==(Lt=(((Nn=(en=We[2].conf)==null?void 0:en.mqtt)==null?void 0:Nn.realtime)??"Real time")+"")&&E(bt,Lt),(!Qe||gt[0]&4)&&Mt!==(Mt=(((qn=(Tn=We[2].conf)==null?void 0:Tn.mqtt)==null?void 0:qn.interval)??"Interval")+"")&&E(it,Mt),gt[0]&64&&ze($e,We[6].q.t),(!Qe||gt[0]&64&&Bt!==(Bt=((Dn=(En=We[6])==null?void 0:En.q)==null?void 0:Dn.t)!=1))&&(tt.disabled=Bt),gt[0]&64&&Fe(tt.value)!==We[6].q.d&&z(tt,We[6].q.d),(!Qe||gt[0]&4)&&st!==(st=(((On=(An=We[2].conf)==null?void 0:An.mqtt)==null?void 0:On.timeout)??"Timeout")+"")&&E(Gt,st),(!Qe||gt[0]&4)&&Yt!==(Yt=(((In=(Ln=We[2].conf)==null?void 0:Ln.mqtt)==null?void 0:In.keepalive)??"Keep-alive")+"")&&E(xt,Yt),gt[0]&64&&Fe(It.value)!==We[6].q.i&&z(It,We[6].q.i),gt[0]&64&&Fe(Ye.value)!==We[6].q.k&&z(Ye,We[6].q.k)},i(We){Qe||(X(ot),Qe=!0)},o(We){te(ot),Qe=!1},d(We){We&&P(e),pt&&pt.d(),ot&&ot.d(),qt=!1,Ht(Ut)}}}function Ca(t){let e,l,n,i,o;return{c(){e=p("label"),l=p("input"),n=S(" SSL"),u(l,"type","checkbox"),u(l,"name","qs"),l.__value="true",z(l,l.__value),u(l,"class","rounded mb-1"),u(e,"class","float-right mr-3")},m(a,r){N(a,e,r),s(e,l),l.checked=t[6].q.s.e,s(e,n),i||(o=[re(l,"change",t[71]),re(l,"change",t[20])],i=!0)},p(a,r){r[0]&64&&(l.checked=a[6].q.s.e)},d(a){a&&P(e),i=!1,Ht(o)}}}function Sa(t){let e,l,n,i,o,a,r,f,c,m,_,d,v;const g=[R0,I0],b=[];function k(R,j){return R[6].q.s.c?0:1}n=k(t),i=b[n]=g[n](t);const M=[j0,U0],O=[];function F(R,j){return R[6].q.s.r?0:1}r=F(t),f=O[r]=M[r](t);const I=[W0,y0],T=[];function A(R,j){return R[6].q.s.k?0:1}return _=A(t),d=T[_]=I[_](t),{c(){e=p("div"),l=p("span"),i.c(),o=h(),a=p("span"),f.c(),c=h(),m=p("span"),d.c(),u(l,"class","flex pr-2"),u(a,"class","flex pr-2"),u(m,"class","flex pr-2"),u(e,"class","my-1 flex")},m(R,j){N(R,e,j),s(e,l),b[n].m(l,null),s(e,o),s(e,a),O[r].m(a,null),s(e,c),s(e,m),T[_].m(m,null),v=!0},p(R,j){let V=n;n=k(R),n===V?b[n].p(R,j):(_t(),te(b[V],1,1,()=>{b[V]=null}),mt(),i=b[n],i?i.p(R,j):(i=b[n]=g[n](R),i.c()),X(i,1),i.m(l,null));let H=r;r=F(R),r===H?O[r].p(R,j):(_t(),te(O[H],1,1,()=>{O[H]=null}),mt(),f=O[r],f?f.p(R,j):(f=O[r]=M[r](R),f.c()),X(f,1),f.m(a,null));let q=_;_=A(R),_===q?T[_].p(R,j):(_t(),te(T[q],1,1,()=>{T[q]=null}),mt(),d=T[_],d?d.p(R,j):(d=T[_]=I[_](R),d.c()),X(d,1),d.m(m,null))},i(R){v||(X(i),X(f),X(d),v=!0)},o(R){te(i),te(f),te(d),v=!1},d(R){R&&P(e),b[n].d(),O[r].d(),T[_].d()}}}function I0(t){let e,l;return e=new gl({props:{to:"/mqtt-ca",$$slots:{default:[F0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[4]&4194304&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function R0(t){let e,l,n,i,o,a,r;return l=new gl({props:{to:"/mqtt-ca",$$slots:{default:[B0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=h(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){N(f,e,c),Me(l,e,null),N(f,n,c),N(f,i,c),o=!0,a||(r=[re(i,"click",t[17]),re(i,"keypress",t[17])],a=!0)},p(f,c){const m={};c[0]&4|c[4]&4194304&&(m.$$scope={dirty:c,ctx:f}),l.$set(m)},i(f){o||(X(l.$$.fragment,f),o=!0)},o(f){te(l.$$.fragment,f),o=!1},d(f){f&&(P(e),P(n),P(i)),Pe(l),a=!1,Ht(r)}}}function F0(t){var n,i,o,a;let e,l;return e=new fn({props:{color:"blue",text:((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_ca_upload)??"Upload CA",title:((a=(o=t[2].conf)==null?void 0:o.mqtt)==null?void 0:a.title_ca)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Me(e,r,f),l=!0},p(r,f){var m,_,d,v;const c={};f[0]&4&&(c.text=((_=(m=r[2].conf)==null?void 0:m.mqtt)==null?void 0:_.btn_ca_upload)??"Upload CA"),f[0]&4&&(c.title=((v=(d=r[2].conf)==null?void 0:d.mqtt)==null?void 0:v.title_ca)??""),e.$set(c)},i(r){l||(X(e.$$.fragment,r),l=!0)},o(r){te(e.$$.fragment,r),l=!1},d(r){Pe(e,r)}}}function B0(t){var n,i;let e=(((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.ca_ok)??"CA OK")+"",l;return{c(){l=S(e)},m(o,a){N(o,l,a)},p(o,a){var r,f;a[0]&4&&e!==(e=(((f=(r=o[2].conf)==null?void 0:r.mqtt)==null?void 0:f.ca_ok)??"CA OK")+"")&&E(l,e)},d(o){o&&P(l)}}}function U0(t){let e,l;return e=new gl({props:{to:"/mqtt-cert",$$slots:{default:[z0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[4]&4194304&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function j0(t){let e,l,n,i,o,a,r;return l=new gl({props:{to:"/mqtt-cert",$$slots:{default:[H0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=h(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){N(f,e,c),Me(l,e,null),N(f,n,c),N(f,i,c),o=!0,a||(r=[re(i,"click",t[18]),re(i,"keypress",t[18])],a=!0)},p(f,c){const m={};c[0]&4|c[4]&4194304&&(m.$$scope={dirty:c,ctx:f}),l.$set(m)},i(f){o||(X(l.$$.fragment,f),o=!0)},o(f){te(l.$$.fragment,f),o=!1},d(f){f&&(P(e),P(n),P(i)),Pe(l),a=!1,Ht(r)}}}function z0(t){var n,i,o,a;let e,l;return e=new fn({props:{color:"blue",text:((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_crt_upload)??"Upload cert",title:((a=(o=t[2].conf)==null?void 0:o.mqtt)==null?void 0:a.title_crt)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Me(e,r,f),l=!0},p(r,f){var m,_,d,v;const c={};f[0]&4&&(c.text=((_=(m=r[2].conf)==null?void 0:m.mqtt)==null?void 0:_.btn_crt_upload)??"Upload cert"),f[0]&4&&(c.title=((v=(d=r[2].conf)==null?void 0:d.mqtt)==null?void 0:v.title_crt)??""),e.$set(c)},i(r){l||(X(e.$$.fragment,r),l=!0)},o(r){te(e.$$.fragment,r),l=!1},d(r){Pe(e,r)}}}function H0(t){var n,i;let e=(((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.crt_ok)??"Cert OK")+"",l;return{c(){l=S(e)},m(o,a){N(o,l,a)},p(o,a){var r,f;a[0]&4&&e!==(e=(((f=(r=o[2].conf)==null?void 0:r.mqtt)==null?void 0:f.crt_ok)??"Cert OK")+"")&&E(l,e)},d(o){o&&P(l)}}}function y0(t){let e,l;return e=new gl({props:{to:"/mqtt-key",$$slots:{default:[G0]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i[0]&4|i[4]&4194304&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function W0(t){let e,l,n,i,o,a,r;return l=new gl({props:{to:"/mqtt-key",$$slots:{default:[V0]},$$scope:{ctx:t}}}),{c(){e=p("span"),Ne(l.$$.fragment),n=h(),i=p("span"),i.textContent="🗑",u(e,"class","bd-on"),u(i,"class","bd-off")},m(f,c){N(f,e,c),Me(l,e,null),N(f,n,c),N(f,i,c),o=!0,a||(r=[re(i,"click",t[19]),re(i,"keypress",t[19])],a=!0)},p(f,c){const m={};c[0]&4|c[4]&4194304&&(m.$$scope={dirty:c,ctx:f}),l.$set(m)},i(f){o||(X(l.$$.fragment,f),o=!0)},o(f){te(l.$$.fragment,f),o=!1},d(f){f&&(P(e),P(n),P(i)),Pe(l),a=!1,Ht(r)}}}function G0(t){var n,i,o,a;let e,l;return e=new fn({props:{color:"blue",text:((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_key_upload)??"Upload key",title:((a=(o=t[2].conf)==null?void 0:o.mqtt)==null?void 0:a.title_key)??""}}),{c(){Ne(e.$$.fragment)},m(r,f){Me(e,r,f),l=!0},p(r,f){var m,_,d,v;const c={};f[0]&4&&(c.text=((_=(m=r[2].conf)==null?void 0:m.mqtt)==null?void 0:_.btn_key_upload)??"Upload key"),f[0]&4&&(c.title=((v=(d=r[2].conf)==null?void 0:d.mqtt)==null?void 0:v.title_key)??""),e.$set(c)},i(r){l||(X(e.$$.fragment,r),l=!0)},o(r){te(e.$$.fragment,r),l=!1},d(r){Pe(e,r)}}}function V0(t){var n,i;let e=(((i=(n=t[2].conf)==null?void 0:n.mqtt)==null?void 0:i.key_ok)??"Key OK")+"",l;return{c(){l=S(e)},m(o,a){N(o,l,a)},p(o,a){var r,f;a[0]&4&&e!==(e=(((f=(r=o[2].conf)==null?void 0:r.mqtt)==null?void 0:f.key_ok)??"Key OK")+"")&&E(l,e)},d(o){o&&P(l)}}}function Ma(t){var Y,le,ue,fe,ne,de,oe,_e,se,me,we,C;let e,l,n=(((ue=(le=(Y=t[2].conf)==null?void 0:Y.mqtt)==null?void 0:le.domoticz)==null?void 0:ue.title)??"Domoticz")+"",i,o,a,r,f,c,m,_,d=(((de=(ne=(fe=t[2].conf)==null?void 0:fe.mqtt)==null?void 0:ne.domoticz)==null?void 0:de.eidx)??"Electricity IDX")+"",v,g,b,k,M,O,F=(((se=(_e=(oe=t[2].conf)==null?void 0:oe.mqtt)==null?void 0:_e.domoticz)==null?void 0:se.cidx)??"Current IDX")+"",I,T,A,R,j,V,H=(((C=(we=(me=t[2].conf)==null?void 0:me.mqtt)==null?void 0:we.domoticz)==null?void 0:C.vidx)??"Voltage IDX")+"",q,U,Z,G,Q,K,B,W,ie,ee;return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),_=p("div"),v=S(d),g=p("br"),b=h(),k=p("input"),M=h(),O=p("div"),I=S(F),T=p("br"),A=h(),R=p("input"),j=h(),V=p("div"),q=S(H),U=S(`: L1, L2 & L3 + `),Z=p("div"),G=p("input"),Q=h(),K=p("input"),B=h(),W=p("input"),u(l,"class","text-sm"),u(a,"href",hl("MQTT-configuration#domoticz")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","o"),f.value="true",u(k,"name","oe"),u(k,"type","text"),u(k,"class","in-f tr w-full"),u(k,"pattern",Rn),u(_,"class","w-1/2"),u(R,"name","oc"),u(R,"type","text"),u(R,"class","in-l tr w-full"),u(R,"pattern",Rn),u(O,"class","w-1/2"),u(m,"class","my-1 flex"),u(G,"name","ou1"),u(G,"type","text"),u(G,"class","in-f tr w-1/3"),u(G,"pattern",Rn),u(K,"name","ou2"),u(K,"type","text"),u(K,"class","in-m tr w-1/3"),u(K,"pattern",Rn),u(W,"name","ou3"),u(W,"type","text"),u(W,"class","in-l tr w-1/3"),u(W,"pattern",Rn),u(Z,"class","flex"),u(V,"class","my-1"),u(e,"class","cnt")},m(w,L){N(w,e,L),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,_),s(_,v),s(_,g),s(_,b),s(_,k),z(k,t[6].o.e),s(m,M),s(m,O),s(O,I),s(O,T),s(O,A),s(O,R),z(R,t[6].o.c),s(e,j),s(e,V),s(V,q),s(V,U),s(V,Z),s(Z,G),z(G,t[6].o.u1),s(Z,Q),s(Z,K),z(K,t[6].o.u2),s(Z,B),s(Z,W),z(W,t[6].o.u3),ie||(ee=[re(k,"input",t[84]),re(R,"input",t[85]),re(G,"input",t[86]),re(K,"input",t[87]),re(W,"input",t[88])],ie=!0)},p(w,L){var D,y,$,ae,pe,he,J,ve,ke,De,Te,Oe;L[0]&4&&n!==(n=((($=(y=(D=w[2].conf)==null?void 0:D.mqtt)==null?void 0:y.domoticz)==null?void 0:$.title)??"Domoticz")+"")&&E(i,n),L[0]&4&&d!==(d=(((he=(pe=(ae=w[2].conf)==null?void 0:ae.mqtt)==null?void 0:pe.domoticz)==null?void 0:he.eidx)??"Electricity IDX")+"")&&E(v,d),L[0]&64&&k.value!==w[6].o.e&&z(k,w[6].o.e),L[0]&4&&F!==(F=(((ke=(ve=(J=w[2].conf)==null?void 0:J.mqtt)==null?void 0:ve.domoticz)==null?void 0:ke.cidx)??"Current IDX")+"")&&E(I,F),L[0]&64&&R.value!==w[6].o.c&&z(R,w[6].o.c),L[0]&4&&H!==(H=(((Oe=(Te=(De=w[2].conf)==null?void 0:De.mqtt)==null?void 0:Te.domoticz)==null?void 0:Oe.vidx)??"Voltage IDX")+"")&&E(q,H),L[0]&64&&G.value!==w[6].o.u1&&z(G,w[6].o.u1),L[0]&64&&K.value!==w[6].o.u2&&z(K,w[6].o.u2),L[0]&64&&W.value!==w[6].o.u3&&z(W,w[6].o.u3)},d(w){w&&P(e),ie=!1,Ht(ee)}}}function Pa(t){var B,W,ie,ee,Y,le,ue,fe,ne,de,oe,_e;let e,l,n=(((ie=(W=(B=t[2].conf)==null?void 0:B.mqtt)==null?void 0:W.ha)==null?void 0:ie.title)??"Home-Assistant")+"",i,o,a,r,f,c,m,_=(((le=(Y=(ee=t[2].conf)==null?void 0:ee.mqtt)==null?void 0:Y.ha)==null?void 0:le.discovery)??"Discovery topic prefix")+"",d,v,g,b,k,M,O=(((ne=(fe=(ue=t[2].conf)==null?void 0:ue.mqtt)==null?void 0:fe.ha)==null?void 0:ne.hostname)??"Hostname for URL")+"",F,I,T,A,R,j,V,H=(((_e=(oe=(de=t[2].conf)==null?void 0:de.mqtt)==null?void 0:oe.ha)==null?void 0:_e.tag)??"Name tag")+"",q,U,Z,G,Q,K;return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),d=S(_),v=p("br"),g=h(),b=p("input"),k=h(),M=p("div"),F=S(O),I=p("br"),T=h(),A=p("input"),j=h(),V=p("div"),q=S(H),U=p("br"),Z=h(),G=p("input"),u(l,"class","text-sm"),u(a,"href",hl("MQTT-configuration#home-assistant")),u(a,"target","_blank"),u(a,"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(m,"class","my-1"),u(A,"name","hh"),u(A,"type","text"),u(A,"class","in-s"),u(A,"placeholder",R=t[6].g.h+".local"),u(A,"pattern",Ll),u(M,"class","my-1"),u(G,"name","hn"),u(G,"type","text"),u(G,"class","in-s"),u(G,"pattern",Ll),u(V,"class","my-1"),u(e,"class","cnt")},m(se,me){N(se,e,me),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,d),s(m,v),s(m,g),s(m,b),z(b,t[6].h.t),s(e,k),s(e,M),s(M,F),s(M,I),s(M,T),s(M,A),z(A,t[6].h.h),s(e,j),s(e,V),s(V,q),s(V,U),s(V,Z),s(V,G),z(G,t[6].h.n),Q||(K=[re(b,"input",t[89]),re(A,"input",t[90]),re(G,"input",t[91])],Q=!0)},p(se,me){var we,C,w,L,D,y,$,ae,pe,he,J,ve;me[0]&4&&n!==(n=(((w=(C=(we=se[2].conf)==null?void 0:we.mqtt)==null?void 0:C.ha)==null?void 0:w.title)??"Home-Assistant")+"")&&E(i,n),me[0]&4&&_!==(_=(((y=(D=(L=se[2].conf)==null?void 0:L.mqtt)==null?void 0:D.ha)==null?void 0:y.discovery)??"Discovery topic prefix")+"")&&E(d,_),me[0]&64&&b.value!==se[6].h.t&&z(b,se[6].h.t),me[0]&4&&O!==(O=(((pe=(ae=($=se[2].conf)==null?void 0:$.mqtt)==null?void 0:ae.ha)==null?void 0:pe.hostname)??"Hostname for URL")+"")&&E(F,O),me[0]&64&&R!==(R=se[6].g.h+".local")&&u(A,"placeholder",R),me[0]&64&&A.value!==se[6].h.h&&z(A,se[6].h.h),me[0]&4&&H!==(H=(((ve=(J=(he=se[2].conf)==null?void 0:he.mqtt)==null?void 0:J.ha)==null?void 0:ve.tag)??"Name tag")+"")&&E(q,H),me[0]&64&&G.value!==se[6].h.n&&z(G,se[6].h.n)},d(se){se&&P(e),Q=!1,Ht(K)}}}function Na(t){var q,U,Z,G,Q,K,B,W,ie,ee;let e,l,n=(((U=(q=t[2].conf)==null?void 0:q.cloud)==null?void 0:U.title)??"Cloud connections")+"",i,o,a,r,f,c,m=(G=(Z=t[0])==null?void 0:Z.features)==null?void 0:G.includes("cloud"),_,d,v,g,b,k=(((K=(Q=t[2].conf)==null?void 0:Q.cloud)==null?void 0:K.es)??"Energy Speedometer")+"",M,O,F,I=(W=(B=t[0])==null?void 0:B.features)==null?void 0:W.includes("zc"),T,A,R,j=m&&Ta(t),V=((ee=(ie=t[6])==null?void 0:ie.c)==null?void 0:ee.es)&&Aa(t),H=I&&La(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),j&&j.c(),_=h(),d=p("div"),v=p("label"),g=p("input"),b=h(),M=S(k),O=h(),V&&V.c(),F=h(),H&&H.c(),u(l,"class","text-sm"),u(a,"href",hl("Cloud")),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","c"),f.value="true",u(g,"type","checkbox"),u(g,"class","rounded mb-1"),u(g,"name","ces"),g.__value="true",z(g,g.__value),u(d,"class","my-1"),u(e,"class","cnt")},m(Y,le){N(Y,e,le),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),j&&j.m(e,null),s(e,_),s(e,d),s(d,v),s(v,g),g.checked=t[6].c.es,s(v,b),s(v,M),s(d,O),V&&V.m(d,null),s(e,F),H&&H.m(e,null),T=!0,A||(R=re(g,"change",t[94]),A=!0)},p(Y,le){var ue,fe,ne,de,oe,_e,se,me,we,C;(!T||le[0]&4)&&n!==(n=(((fe=(ue=Y[2].conf)==null?void 0:ue.cloud)==null?void 0:fe.title)??"Cloud connections")+"")&&E(i,n),le[0]&1&&(m=(de=(ne=Y[0])==null?void 0:ne.features)==null?void 0:de.includes("cloud")),m?j?j.p(Y,le):(j=Ta(Y),j.c(),j.m(e,_)):j&&(j.d(1),j=null),le[0]&64&&(g.checked=Y[6].c.es),(!T||le[0]&4)&&k!==(k=(((_e=(oe=Y[2].conf)==null?void 0:oe.cloud)==null?void 0:_e.es)??"Energy Speedometer")+"")&&E(M,k),(me=(se=Y[6])==null?void 0:se.c)!=null&&me.es?V?(V.p(Y,le),le[0]&64&&X(V,1)):(V=Aa(Y),V.c(),X(V,1),V.m(d,null)):V&&(_t(),te(V,1,1,()=>{V=null}),mt()),le[0]&1&&(I=(C=(we=Y[0])==null?void 0:we.features)==null?void 0:C.includes("zc")),I?H?H.p(Y,le):(H=La(Y),H.c(),H.m(e,null)):H&&(H.d(1),H=null)},i(Y){T||(X(V),T=!0)},o(Y){te(V),T=!1},d(Y){Y&&P(e),j&&j.d(),V&&V.d(),H&&H.d(),A=!1,R()}}}function Ta(t){var _,d;let e,l,n,i,o=(((d=(_=t[2].conf)==null?void 0:_.cloud)==null?void 0:d.ams)??"AMS reader cloud")+"",a,r,f,c,m=t[6].c.e&&qa(t);return{c(){e=p("div"),l=p("label"),n=p("input"),i=h(),a=S(o),r=h(),m&&m.c(),u(n,"type","checkbox"),u(n,"name","ce"),n.__value="true",z(n,n.__value),u(n,"class","rounded mb-1"),u(e,"class","my-1")},m(v,g){N(v,e,g),s(e,l),s(l,n),n.checked=t[6].c.e,s(l,i),s(l,a),s(e,r),m&&m.m(e,null),f||(c=re(n,"change",t[92]),f=!0)},p(v,g){var b,k;g[0]&64&&(n.checked=v[6].c.e),g[0]&4&&o!==(o=(((k=(b=v[2].conf)==null?void 0:b.cloud)==null?void 0:k.ams)??"AMS reader cloud")+"")&&E(a,o),v[6].c.e?m?m.p(v,g):(m=qa(v),m.c(),m.m(e,null)):m&&(m.d(1),m=null)},d(v){v&&P(e),m&&m.d(),f=!1,c()}}}function qa(t){let e,l,n,i,o,a,r,f,c,m,_=t[6].c.p==0&&Ea(),d=t[5]&&Da(t);return{c(){e=p("div"),l=p("label"),l.textContent="Protocol",n=h(),i=p("select"),_&&_.c(),o=p("option"),o.textContent="TCP",a=p("option"),a.textContent="HTTP",r=h(),d&&d.c(),f=yt(),u(l,"for","cp"),o.__value=1,z(o,o.__value),a.__value=2,z(a,a.__value),u(i,"name","cp"),u(i,"class","in-s"),t[6].c.p===void 0&&At(()=>t[93].call(i)),u(e,"class","ml-6")},m(v,g){N(v,e,g),s(e,l),s(e,n),s(e,i),_&&_.m(i,null),s(i,o),s(i,a),ze(i,t[6].c.p,!0),N(v,r,g),d&&d.m(v,g),N(v,f,g),c||(m=re(i,"change",t[93]),c=!0)},p(v,g){v[6].c.p==0?_||(_=Ea(),_.c(),_.m(i,o)):_&&(_.d(1),_=null),g[0]&64&&ze(i,v[6].c.p),v[5]?d?d.p(v,g):(d=Da(v),d.c(),d.m(f.parentNode,f)):d&&(d.d(1),d=null)},d(v){v&&(P(e),P(r),P(f)),_&&_.d(),d&&d.d(v),c=!1,m()}}}function Ea(t){let e;return{c(){e=p("option"),e.textContent="UDP",e.__value=0,z(e,e.__value),u(e,"title","No longer recommended")},m(l,n){N(l,e,n)},d(l){l&&P(e)}}}function Da(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,o){N(i,e,o),l||(n=re(e,"click",t[23]),l=!0)},p:He,d(i){i&&P(e),l=!1,n()}}}function Aa(t){let e,l,n=t[0].mac+"",i,o,a,r,f=(t[0].meter.id?t[0].meter.id:"missing, required")+"",c,m,_,d,v=t[0].mac&&t[0].meter.id&&Oa(t);return{c(){e=p("div"),l=S("MAC: "),i=S(n),o=h(),a=p("div"),r=S("Meter ID: "),c=S(f),m=h(),v&&v.c(),_=yt(),u(e,"class","pl-5"),u(a,"class","pl-5")},m(g,b){N(g,e,b),s(e,l),s(e,i),N(g,o,b),N(g,a,b),s(a,r),s(a,c),N(g,m,b),v&&v.m(g,b),N(g,_,b),d=!0},p(g,b){(!d||b[0]&1)&&n!==(n=g[0].mac+"")&&E(i,n),(!d||b[0]&1)&&f!==(f=(g[0].meter.id?g[0].meter.id:"missing, required")+"")&&E(c,f),g[0].mac&&g[0].meter.id?v?(v.p(g,b),b[0]&1&&X(v,1)):(v=Oa(g),v.c(),X(v,1),v.m(_.parentNode,_)):v&&(_t(),te(v,1,1,()=>{v=null}),mt())},i(g){d||(X(v),d=!0)},o(g){te(v),d=!1},d(g){g&&(P(e),P(o),P(a),P(m),P(_)),v&&v.d(g)}}}function Oa(t){let e,l,n;return l=new C0({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,o){N(i,e,o),Me(l,e,null),n=!0},p(i,o){const a={};o[0]&1&&(a.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(a)},i(i){n||(X(l.$$.fragment,i),n=!0)},o(i){te(l.$$.fragment,i),n=!1},d(i){i&&P(e),Pe(l)}}}function La(t){let e,l,n,i,o,a,r,f,c=t[6].c.ze&&Ia(t);return{c(){e=p("div"),l=p("label"),n=p("input"),i=S(" ZmartCharge"),o=h(),c&&c.c(),a=yt(),u(n,"type","checkbox"),u(n,"name","cze"),n.__value="true",z(n,n.__value),u(n,"class","rounded mb-1"),u(e,"class","my-1")},m(m,_){N(m,e,_),s(e,l),s(l,n),n.checked=t[6].c.ze,s(l,i),N(m,o,_),c&&c.m(m,_),N(m,a,_),r||(f=re(n,"change",t[95]),r=!0)},p(m,_){_[0]&64&&(n.checked=m[6].c.ze),m[6].c.ze?c?c.p(m,_):(c=Ia(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(m){m&&(P(e),P(o),P(a)),c&&c.d(m),r=!1,f()}}}function Ia(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(o,a){N(o,e,a),s(e,l),z(l,t[6].c.zt),n||(i=re(l,"input",t[96]),n=!0)},p(o,a){a[0]&64&&l.value!==o[6].c.zt&&z(l,o[6].c.zt)},d(o){o&&P(e),n=!1,i()}}}function Ra(t){var H,q,U,Z,G;let e,l,n=(((q=(H=t[2].conf)==null?void 0:H.thresholds)==null?void 0:q.title)??"Thresholds")+"",i,o,a,r,f,c,m,_,d,v,g=(((Z=(U=t[2].conf)==null?void 0:U.thresholds)==null?void 0:Z.avg)??"Average of")+"",b,k,M,O,F,I=(((G=t[2].common)==null?void 0:G.hours)??"hours")+"",T,A,R,j=at({length:9}),V=[];for(let Q=0;Qt[100].call(k)),u(d,"class","w-1/2"),u(m,"class","flex flex-wrap"),u(e,"class","cnt")},m(q,U){N(q,e,U),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m);for(let Z=0;Z20&&Ha(t),d=((O=(M=(k=t[6])==null?void 0:k.i)==null?void 0:M.d)==null?void 0:O.d)>0&&Ga(t),v=t[0].chip=="esp8266"&&Va(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),_&&_.c(),f=h(),d&&d.c(),c=h(),v&&v.c(),u(l,"class","text-sm"),u(a,"href",hl("GPIO-configuration")),u(a,"target","_blank"),u(a,"class","float-right"),u(e,"class","cnt")},m(F,I){N(F,e,I),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),_&&_.m(e,null),s(e,f),d&&d.m(e,null),s(e,c),v&&v.m(e,null),m=!0},p(F,I){var T,A,R,j,V;(!m||I[0]&4)&&n!==(n=(((A=(T=F[2].conf)==null?void 0:T.hw)==null?void 0:A.title)??"Hardware")+"")&&E(i,n),F[0].board>20?_?(_.p(F,I),I[0]&1&&X(_,1)):(_=Ha(F),_.c(),X(_,1),_.m(e,f)):_&&(_t(),te(_,1,1,()=>{_=null}),mt()),((V=(j=(R=F[6])==null?void 0:R.i)==null?void 0:j.d)==null?void 0:V.d)>0?d?d.p(F,I):(d=Ga(F),d.c(),d.m(e,c)):d&&(d.d(1),d=null),F[0].chip=="esp8266"?v?v.p(F,I):(v=Va(F),v.c(),v.m(e,null)):v&&(v.d(1),v=null)},i(F){m||(X(_),m=!0)},o(F){te(_),m=!1},d(F){F&&P(e),_&&_.d(),d&&d.d(),v&&v.d()}}}function Ha(t){var Bt,Xt,rt,st,Gt,Jt,Tt,Yt,xt,$t,Vt,It,Ve,Ye,Qe,qt,Ut,pt,ot,vt,Rt,be,lt,je,Wt,ul,nl,rl,il,jt,zt,al,Ae;let e,l,n,i,o=(((rt=(Xt=(Bt=t[2].conf)==null?void 0:Bt.hw)==null?void 0:Xt.han)==null?void 0:rt.rx)??"HAN RX")+"",a,r,f,c,m,_,d,v=(((Jt=(Gt=(st=t[2].conf)==null?void 0:st.hw)==null?void 0:Gt.han)==null?void 0:Jt.tx)??"HAN TX")+"",g,b,k,M,O,F,I,T,A,R,j=(((xt=(Yt=(Tt=t[2].conf)==null?void 0:Tt.hw)==null?void 0:Yt.han)==null?void 0:xt.pullup)??"pullup")+"",V,H,q,U,Z=(((Vt=($t=t[2].conf)==null?void 0:$t.hw)==null?void 0:Vt.ap_btn)??"AP button")+"",G,Q,K,B,W,ie,ee=(((Ye=(Ve=(It=t[2].conf)==null?void 0:It.hw)==null?void 0:Ve.led)==null?void 0:Ye.title)??"LED")+"",Y,le,ue,fe,ne,de,oe,_e,se,me,we=(((Ut=(qt=(Qe=t[2].conf)==null?void 0:Qe.hw)==null?void 0:qt.led)==null?void 0:Ut.inverted)??"inverted")+"",C,w,L,D=(((vt=(ot=(pt=t[2].conf)==null?void 0:pt.hw)==null?void 0:ot.led)==null?void 0:vt.rgb)??"RGB")+"",y,$,ae,pe,he=(((lt=(be=(Rt=t[2].conf)==null?void 0:Rt.hw)==null?void 0:be.led)==null?void 0:lt.inverted)??"inverted")+"",J,ve,ke,De,Te,Oe,Le,Ee,Ie,Ze,kt,xe,ft=(((ul=(Wt=(je=t[2].conf)==null?void 0:je.hw)==null?void 0:Wt.led)==null?void 0:ul.disable)??"LED dis. GPIO")+"",wt,dt,ut,nt,ht,Ot=(((rl=(nl=t[2].conf)==null?void 0:nl.hw)==null?void 0:rl.temp)??"Temperature")+"",Je,Re,Be,et,ge,qe,Ge=(((jt=(il=t[2].conf)==null?void 0:il.hw)==null?void 0:jt.temp_analog)??"Analog temp")+"",ce,Ce,$e,ye,Lt,bt,Ke,Mt,it;m=new ji({props:{chip:t[0].chip}}),O=new ji({props:{chip:t[0].chip}});let ct=t[0].chip!="esp8266"&&ya(t),tt=((Ae=(al=(zt=t[6])==null?void 0:zt.i)==null?void 0:al.v)==null?void 0:Ae.p)>0&&Wa(t);return{c(){e=p("input"),l=h(),n=p("div"),i=p("div"),a=S(o),r=p("br"),f=h(),c=p("select"),Ne(m.$$.fragment),_=h(),d=p("div"),g=S(v),b=p("br"),k=h(),M=p("select"),Ne(O.$$.fragment),F=h(),I=p("div"),T=p("label"),A=p("input"),R=h(),V=S(j),H=h(),q=p("div"),U=p("div"),G=S(Z),Q=p("br"),K=h(),B=p("input"),W=h(),ie=p("div"),Y=S(ee),le=p("br"),ue=h(),fe=p("div"),ne=p("input"),de=h(),oe=p("div"),_e=p("label"),se=p("input"),me=h(),C=S(we),w=h(),L=p("div"),y=S(D),$=p("label"),ae=p("input"),pe=h(),J=S(he),ve=p("br"),ke=h(),De=p("div"),Te=p("input"),Oe=h(),Le=p("input"),Ee=h(),Ie=p("input"),Ze=h(),kt=p("div"),xe=p("div"),wt=S(ft),dt=h(),ut=p("input"),nt=h(),ht=p("div"),Je=S(Ot),Re=p("br"),Be=h(),et=p("input"),ge=h(),qe=p("div"),ce=S(Ge),Ce=p("br"),$e=h(),ye=p("input"),Lt=h(),ct&&ct.c(),bt=h(),tt&&tt.c(),u(e,"type","hidden"),u(e,"name","i"),e.value="true",u(c,"name","ihp"),u(c,"class","in-f w-full"),t[6].i.h.p===void 0&&At(()=>t[101].call(c)),u(i,"class","w-1/3"),u(M,"name","iht"),u(M,"class","in-l w-full"),t[6].i.h.t===void 0&&At(()=>t[102].call(M)),u(d,"class","w-1/3"),u(A,"name","ihu"),A.__value="true",z(A,A.__value),u(A,"type","checkbox"),u(A,"class","rounded mb-1"),u(T,"class","ml-2"),u(I,"class","w-1/3"),u(n,"class","flex flex-wrap"),u(B,"name","ia"),u(B,"type","number"),u(B,"min","0"),u(B,"max",t[12]),u(B,"class","in-f tr w-full"),u(U,"class","w-1/3"),u(ne,"name","ilp"),u(ne,"type","number"),u(ne,"min","0"),u(ne,"max",t[12]),u(ne,"class","in-l tr w-full"),u(fe,"class","flex"),u(ie,"class","w-1/3"),u(se,"name","ili"),se.__value="true",z(se,se.__value),u(se,"type","checkbox"),u(se,"class","rounded mb-1"),u(_e,"class","ml-4"),u(oe,"class","w-1/3"),u(ae,"name","iri"),ae.__value="true",z(ae,ae.__value),u(ae,"type","checkbox"),u(ae,"class","rounded mb-1"),u($,"class","ml-4"),u(Te,"name","irr"),u(Te,"type","number"),u(Te,"min","0"),u(Te,"max",t[12]),u(Te,"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(Ie,"name","irb"),u(Ie,"type","number"),u(Ie,"min","0"),u(Ie,"max",t[12]),u(Ie,"class","in-l tr w-1/3"),u(De,"class","flex"),u(L,"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(xe,"class","my-1 pr-1 w-1/3"),u(kt,"class","w-full"),u(et,"name","itd"),u(et,"type","number"),u(et,"min","0"),u(et,"max",t[12]),u(et,"class","in-f tr w-full"),u(ht,"class","my-1 w-1/3"),u(ye,"name","ita"),u(ye,"type","number"),u(ye,"min","0"),u(ye,"max",t[12]),u(ye,"class","in-l tr w-full"),u(qe,"class","my-1 pr-1 w-1/3"),u(q,"class","flex flex-wrap")},m(x,Se){N(x,e,Se),N(x,l,Se),N(x,n,Se),s(n,i),s(i,a),s(i,r),s(i,f),s(i,c),Me(m,c,null),ze(c,t[6].i.h.p,!0),s(n,_),s(n,d),s(d,g),s(d,b),s(d,k),s(d,M),Me(O,M,null),ze(M,t[6].i.h.t,!0),s(n,F),s(n,I),s(I,T),s(T,A),A.checked=t[6].i.h.u,s(T,R),s(T,V),N(x,H,Se),N(x,q,Se),s(q,U),s(U,G),s(U,Q),s(U,K),s(U,B),z(B,t[6].i.a),s(q,W),s(q,ie),s(ie,Y),s(ie,le),s(ie,ue),s(ie,fe),s(fe,ne),z(ne,t[6].i.l.p),s(q,de),s(q,oe),s(oe,_e),s(_e,se),se.checked=t[6].i.l.i,s(_e,me),s(_e,C),s(q,w),s(q,L),s(L,y),s(L,$),s($,ae),ae.checked=t[6].i.r.i,s($,pe),s($,J),s(L,ve),s(L,ke),s(L,De),s(De,Te),z(Te,t[6].i.r.r),s(De,Oe),s(De,Le),z(Le,t[6].i.r.g),s(De,Ee),s(De,Ie),z(Ie,t[6].i.r.b),s(q,Ze),s(q,kt),s(kt,xe),s(xe,wt),s(xe,dt),s(xe,ut),z(ut,t[6].i.d.d),s(q,nt),s(q,ht),s(ht,Je),s(ht,Re),s(ht,Be),s(ht,et),z(et,t[6].i.t.d),s(q,ge),s(q,qe),s(qe,ce),s(qe,Ce),s(qe,$e),s(qe,ye),z(ye,t[6].i.t.a),s(q,Lt),ct&&ct.m(q,null),s(q,bt),tt&&tt.m(q,null),Ke=!0,Mt||(it=[re(c,"change",t[101]),re(M,"change",t[102]),re(A,"change",t[103]),re(B,"input",t[104]),re(ne,"input",t[105]),re(se,"change",t[106]),re(ae,"change",t[107]),re(Te,"input",t[108]),re(Le,"input",t[109]),re(Ie,"input",t[110]),re(ut,"input",t[111]),re(et,"input",t[112]),re(ye,"input",t[113])],Mt=!0)},p(x,Se){var cl,dl,sl,vl,bl,Ml,Pl,Il,Rl,Fl,We,gt,Bl,Ul,jl,zl,Hl,yl,Wl,Gl,Vl,Kl,Ue,Et,ll,Yl,Ql,Xl,Zl,Jl,$l,xl,en;(!Ke||Se[0]&4)&&o!==(o=(((sl=(dl=(cl=x[2].conf)==null?void 0:cl.hw)==null?void 0:dl.han)==null?void 0:sl.rx)??"HAN RX")+"")&&E(a,o);const Ct={};Se[0]&1&&(Ct.chip=x[0].chip),m.$set(Ct),Se[0]&64&&ze(c,x[6].i.h.p),(!Ke||Se[0]&4)&&v!==(v=(((Ml=(bl=(vl=x[2].conf)==null?void 0:vl.hw)==null?void 0:bl.han)==null?void 0:Ml.tx)??"HAN TX")+"")&&E(g,v);const tl={};Se[0]&1&&(tl.chip=x[0].chip),O.$set(tl),Se[0]&64&&ze(M,x[6].i.h.t),Se[0]&64&&(A.checked=x[6].i.h.u),(!Ke||Se[0]&4)&&j!==(j=(((Rl=(Il=(Pl=x[2].conf)==null?void 0:Pl.hw)==null?void 0:Il.han)==null?void 0:Rl.pullup)??"pullup")+"")&&E(V,j),(!Ke||Se[0]&4)&&Z!==(Z=(((We=(Fl=x[2].conf)==null?void 0:Fl.hw)==null?void 0:We.ap_btn)??"AP button")+"")&&E(G,Z),(!Ke||Se[0]&4096)&&u(B,"max",x[12]),Se[0]&64&&Fe(B.value)!==x[6].i.a&&z(B,x[6].i.a),(!Ke||Se[0]&4)&&ee!==(ee=(((Ul=(Bl=(gt=x[2].conf)==null?void 0:gt.hw)==null?void 0:Bl.led)==null?void 0:Ul.title)??"LED")+"")&&E(Y,ee),(!Ke||Se[0]&4096)&&u(ne,"max",x[12]),Se[0]&64&&Fe(ne.value)!==x[6].i.l.p&&z(ne,x[6].i.l.p),Se[0]&64&&(se.checked=x[6].i.l.i),(!Ke||Se[0]&4)&&we!==(we=(((Hl=(zl=(jl=x[2].conf)==null?void 0:jl.hw)==null?void 0:zl.led)==null?void 0:Hl.inverted)??"inverted")+"")&&E(C,we),(!Ke||Se[0]&4)&&D!==(D=(((Gl=(Wl=(yl=x[2].conf)==null?void 0:yl.hw)==null?void 0:Wl.led)==null?void 0:Gl.rgb)??"RGB")+"")&&E(y,D),Se[0]&64&&(ae.checked=x[6].i.r.i),(!Ke||Se[0]&4)&&he!==(he=(((Ue=(Kl=(Vl=x[2].conf)==null?void 0:Vl.hw)==null?void 0:Kl.led)==null?void 0:Ue.inverted)??"inverted")+"")&&E(J,he),(!Ke||Se[0]&4096)&&u(Te,"max",x[12]),Se[0]&64&&Fe(Te.value)!==x[6].i.r.r&&z(Te,x[6].i.r.r),(!Ke||Se[0]&4096)&&u(Le,"max",x[12]),Se[0]&64&&Fe(Le.value)!==x[6].i.r.g&&z(Le,x[6].i.r.g),(!Ke||Se[0]&4096)&&u(Ie,"max",x[12]),Se[0]&64&&Fe(Ie.value)!==x[6].i.r.b&&z(Ie,x[6].i.r.b),(!Ke||Se[0]&4)&&ft!==(ft=(((Yl=(ll=(Et=x[2].conf)==null?void 0:Et.hw)==null?void 0:ll.led)==null?void 0:Yl.disable)??"LED dis. GPIO")+"")&&E(wt,ft),(!Ke||Se[0]&4096)&&u(ut,"max",x[12]),Se[0]&64&&Fe(ut.value)!==x[6].i.d.d&&z(ut,x[6].i.d.d),(!Ke||Se[0]&4)&&Ot!==(Ot=(((Xl=(Ql=x[2].conf)==null?void 0:Ql.hw)==null?void 0:Xl.temp)??"Temperature")+"")&&E(Je,Ot),(!Ke||Se[0]&4096)&&u(et,"max",x[12]),Se[0]&64&&Fe(et.value)!==x[6].i.t.d&&z(et,x[6].i.t.d),(!Ke||Se[0]&4)&&Ge!==(Ge=(((Jl=(Zl=x[2].conf)==null?void 0:Zl.hw)==null?void 0:Jl.temp_analog)??"Analog temp")+"")&&E(ce,Ge),(!Ke||Se[0]&4096)&&u(ye,"max",x[12]),Se[0]&64&&Fe(ye.value)!==x[6].i.t.a&&z(ye,x[6].i.t.a),x[0].chip!="esp8266"?ct?ct.p(x,Se):(ct=ya(x),ct.c(),ct.m(q,bt)):ct&&(ct.d(1),ct=null),((en=(xl=($l=x[6])==null?void 0:$l.i)==null?void 0:xl.v)==null?void 0:en.p)>0?tt?tt.p(x,Se):(tt=Wa(x),tt.c(),tt.m(q,null)):tt&&(tt.d(1),tt=null)},i(x){Ke||(X(m.$$.fragment,x),X(O.$$.fragment,x),Ke=!0)},o(x){te(m.$$.fragment,x),te(O.$$.fragment,x),Ke=!1},d(x){x&&(P(e),P(l),P(n),P(H),P(q)),Pe(m),Pe(O),ct&&ct.d(),tt&&tt.d(),Mt=!1,Ht(it)}}}function ya(t){var c,m,_;let e,l=(((_=(m=(c=t[2].conf)==null?void 0:c.hw)==null?void 0:m.vcc)==null?void 0:_.title)??"Vcc")+"",n,i,o,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),o=h(),a=p("input"),u(a,"name","ivp"),u(a,"type","number"),u(a,"min","0"),u(a,"max",t[12]),u(a,"class","in-s tr w-full"),u(e,"class","my-1 pl-1 w-1/3")},m(d,v){N(d,e,v),s(e,n),s(e,i),s(e,o),s(e,a),z(a,t[6].i.v.p),r||(f=re(a,"input",t[114]),r=!0)},p(d,v){var g,b,k;v[0]&4&&l!==(l=(((k=(b=(g=d[2].conf)==null?void 0:g.hw)==null?void 0:b.vcc)==null?void 0:k.title)??"Vcc")+"")&&E(n,l),v[0]&4096&&u(a,"max",d[12]),v[0]&64&&Fe(a.value)!==d[6].i.v.p&&z(a,d[6].i.v.p)},d(d){d&&P(e),r=!1,f()}}}function Wa(t){var g,b,k;let e,l=(((k=(b=(g=t[2].conf)==null?void 0:g.hw)==null?void 0:b.vcc)==null?void 0:k.divider)??"Voltage divider")+"",n,i,o,a,r,f,c,m,_,d,v;return{c(){var M,O,F,I,T,A;e=p("div"),n=S(l),i=p("br"),o=h(),a=p("div"),r=p("input"),c=h(),m=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=((F=(O=(M=t[2].conf)==null?void 0:M.hw)==null?void 0:O.vcc)==null?void 0:F.div_vcc)??"VCC"),u(m,"name","ivdg"),u(m,"type","number"),u(m,"min","0"),u(m,"max","65535"),u(m,"class","in-l tr w-full"),u(m,"placeholder",_=((A=(T=(I=t[2].conf)==null?void 0:I.hw)==null?void 0:T.vcc)==null?void 0:A.div_gnd)??"GND"),u(a,"class","flex"),u(e,"class","my-1")},m(M,O){N(M,e,O),s(e,n),s(e,i),s(e,o),s(e,a),s(a,r),z(r,t[6].i.v.d.v),s(a,c),s(a,m),z(m,t[6].i.v.d.g),d||(v=[re(r,"input",t[115]),re(m,"input",t[116])],d=!0)},p(M,O){var F,I,T,A,R,j,V,H,q;O[0]&4&&l!==(l=(((T=(I=(F=M[2].conf)==null?void 0:F.hw)==null?void 0:I.vcc)==null?void 0:T.divider)??"Voltage divider")+"")&&E(n,l),O[0]&4&&f!==(f=((j=(R=(A=M[2].conf)==null?void 0:A.hw)==null?void 0:R.vcc)==null?void 0:j.div_vcc)??"VCC")&&u(r,"placeholder",f),O[0]&64&&Fe(r.value)!==M[6].i.v.d.v&&z(r,M[6].i.v.d.v),O[0]&4&&_!==(_=((q=(H=(V=M[2].conf)==null?void 0:V.hw)==null?void 0:H.vcc)==null?void 0:q.div_gnd)??"GND")&&u(m,"placeholder",_),O[0]&64&&Fe(m.value)!==M[6].i.v.d.g&&z(m,M[6].i.v.d.g)},d(M){M&&P(e),d=!1,Ht(v)}}}function Ga(t){var g,b,k,M,O,F,I,T,A,R,j,V;let e,l=(((M=(k=(b=(g=t[2].conf)==null?void 0:g.hw)==null?void 0:b.led)==null?void 0:k.behaviour)==null?void 0:M.title)??"LED behaviour")+"",n,i,o,a,r=(((T=(I=(F=(O=t[2].conf)==null?void 0:O.hw)==null?void 0:F.led)==null?void 0:I.behaviour)==null?void 0:T.enabled)??"Enabled")+"",f,c,m=(((V=(j=(R=(A=t[2].conf)==null?void 0:A.hw)==null?void 0:R.led)==null?void 0:j.behaviour)==null?void 0:V.disabled)??"Disabled")+"",_,d,v;return{c(){e=p("div"),n=S(l),i=h(),o=p("select"),a=p("option"),f=S(r),c=p("option"),_=S(m),a.__value=0,z(a,a.__value),c.__value=1,z(c,c.__value),u(o,"name","idb"),u(o,"class","in-s"),t[6].i.d.b===void 0&&At(()=>t[117].call(o)),u(e,"class","my-1 w-full")},m(H,q){N(H,e,q),s(e,n),s(e,i),s(e,o),s(o,a),s(a,f),s(o,c),s(c,_),ze(o,t[6].i.d.b,!0),d||(v=re(o,"change",t[117]),d=!0)},p(H,q){var U,Z,G,Q,K,B,W,ie,ee,Y,le,ue;q[0]&4&&l!==(l=(((Q=(G=(Z=(U=H[2].conf)==null?void 0:U.hw)==null?void 0:Z.led)==null?void 0:G.behaviour)==null?void 0:Q.title)??"LED behaviour")+"")&&E(n,l),q[0]&4&&r!==(r=(((ie=(W=(B=(K=H[2].conf)==null?void 0:K.hw)==null?void 0:B.led)==null?void 0:W.behaviour)==null?void 0:ie.enabled)??"Enabled")+"")&&E(f,r),q[0]&4&&m!==(m=(((ue=(le=(Y=(ee=H[2].conf)==null?void 0:ee.hw)==null?void 0:Y.led)==null?void 0:le.behaviour)==null?void 0:ue.disabled)??"Disabled")+"")&&E(_,m),q[0]&64&&ze(o,H[6].i.d.b)},d(H){H&&P(e),d=!1,v()}}}function Va(t){var T,A,R,j,V,H;let e,l,n,i,o=(((R=(A=(T=t[2].conf)==null?void 0:T.hw)==null?void 0:A.vcc)==null?void 0:R.offset)??"Vcc offset")+"",a,r,f,c,m,_,d=(((H=(V=(j=t[2].conf)==null?void 0:j.hw)==null?void 0:V.vcc)==null?void 0:H.multiplier)??"Multiplier")+"",v,g,b,k,M,O,F,I=(t[0].board==2||t[0].board==100)&&Ka(t);return{c(){e=p("input"),l=h(),n=p("div"),i=p("div"),a=S(o),r=p("br"),f=h(),c=p("input"),m=h(),_=p("div"),v=S(d),g=p("br"),b=h(),k=p("input"),M=h(),I&&I.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(k,"name","ivm"),u(k,"type","number"),u(k,"min","0.1"),u(k,"max","10"),u(k,"step","0.01"),u(k,"class","in-l tr w-full"),u(_,"class","w-1/3 pr-1"),u(n,"class","my-1 flex flex-wrap")},m(q,U){N(q,e,U),N(q,l,U),N(q,n,U),s(n,i),s(i,a),s(i,r),s(i,f),s(i,c),z(c,t[6].i.v.o),s(n,m),s(n,_),s(_,v),s(_,g),s(_,b),s(_,k),z(k,t[6].i.v.m),s(n,M),I&&I.m(n,null),O||(F=[re(c,"input",t[118]),re(k,"input",t[119])],O=!0)},p(q,U){var Z,G,Q,K,B,W;U[0]&4&&o!==(o=(((Q=(G=(Z=q[2].conf)==null?void 0:Z.hw)==null?void 0:G.vcc)==null?void 0:Q.offset)??"Vcc offset")+"")&&E(a,o),U[0]&64&&Fe(c.value)!==q[6].i.v.o&&z(c,q[6].i.v.o),U[0]&4&&d!==(d=(((W=(B=(K=q[2].conf)==null?void 0:K.hw)==null?void 0:B.vcc)==null?void 0:W.multiplier)??"Multiplier")+"")&&E(v,d),U[0]&64&&Fe(k.value)!==q[6].i.v.m&&z(k,q[6].i.v.m),q[0].board==2||q[0].board==100?I?I.p(q,U):(I=Ka(q),I.c(),I.m(n,null)):I&&(I.d(1),I=null)},d(q){q&&(P(e),P(l),P(n)),I&&I.d(),O=!1,Ht(F)}}}function Ka(t){var c,m,_;let e,l=(((_=(m=(c=t[2].conf)==null?void 0:c.hw)==null?void 0:m.vcc)==null?void 0:_.boot)??"Boot limit")+"",n,i,o,a,r,f;return{c(){e=p("div"),n=S(l),i=p("br"),o=h(),a=p("input"),u(a,"name","ivb"),u(a,"type","number"),u(a,"min","2.5"),u(a,"max","3.5"),u(a,"step","0.1"),u(a,"class","in-s tr w-full"),u(e,"class","w-1/3 pl-1")},m(d,v){N(d,e,v),s(e,n),s(e,i),s(e,o),s(e,a),z(a,t[6].i.v.b),r||(f=re(a,"input",t[120]),r=!0)},p(d,v){var g,b,k;v[0]&4&&l!==(l=(((k=(b=(g=d[2].conf)==null?void 0:g.hw)==null?void 0:b.vcc)==null?void 0:k.boot)??"Boot limit")+"")&&E(n,l),v[0]&64&&Fe(a.value)!==d[6].i.v.b&&z(a,d[6].i.v.b)},d(d){d&&P(e),r=!1,f()}}}function Ya(t){var I,T,A,R,j,V;let e,l,n=(((T=(I=t[2].conf)==null?void 0:I.debug)==null?void 0:T.title)??"Debugging")+"",i,o,a,r,f,c,m,_,d,v,g=(((R=(A=t[2].conf)==null?void 0:A.debug)==null?void 0:R.enable)??"Enable debugging")+"",b,k,M,O,F=((V=(j=t[6])==null?void 0:j.d)==null?void 0:V.s)&&Qa(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("a"),a.textContent="ⓘ",r=h(),f=p("input"),c=h(),m=p("div"),_=p("label"),d=p("input"),v=h(),b=S(g),k=h(),F&&F.c(),u(l,"class","text-sm"),u(a,"href","https://amsleser.no/blog/post/24-telnet-debug"),u(a,"target","_blank"),u(a,"class","float-right"),u(f,"type","hidden"),u(f,"name","d"),f.value="true",u(d,"type","checkbox"),u(d,"name","ds"),d.__value="true",z(d,d.__value),u(d,"class","rounded mb-1"),u(m,"class","mt-3"),u(e,"class","cnt")},m(H,q){N(H,e,q),s(e,l),s(l,i),s(e,o),s(e,a),s(e,r),s(e,f),s(e,c),s(e,m),s(m,_),s(_,d),d.checked=t[6].d.s,s(_,v),s(_,b),s(e,k),F&&F.m(e,null),M||(O=re(d,"change",t[121]),M=!0)},p(H,q){var U,Z,G,Q,K,B;q[0]&4&&n!==(n=(((Z=(U=H[2].conf)==null?void 0:U.debug)==null?void 0:Z.title)??"Debugging")+"")&&E(i,n),q[0]&64&&(d.checked=H[6].d.s),q[0]&4&&g!==(g=(((Q=(G=H[2].conf)==null?void 0:G.debug)==null?void 0:Q.enable)??"Enable debugging")+"")&&E(b,g),(B=(K=H[6])==null?void 0:K.d)!=null&&B.s?F?F.p(H,q):(F=Qa(H),F.c(),F.m(e,null)):F&&(F.d(1),F=null)},d(H){H&&P(e),F&&F.d(),M=!1,O()}}}function Qa(t){var A,R,j,V;let e,l=(((R=(A=t[2].conf)==null?void 0:A.debug)==null?void 0:R.danger)??"Disable when done")+"",n,i,o,a,r,f,c=(((V=(j=t[2].conf)==null?void 0:j.debug)==null?void 0:V.telnet)??"Enable telnet")+"",m,_,d,v,g,b,k,M,O,F,I,T=t[6].d.t&&Xa(t);return{c(){e=p("div"),n=S(l),i=h(),o=p("div"),a=p("label"),r=p("input"),f=h(),m=S(c),_=h(),T&&T.c(),d=h(),v=p("div"),g=p("select"),b=p("option"),b.textContent="Verbose",k=p("option"),k.textContent="Debug",M=p("option"),M.textContent="Info",O=p("option"),O.textContent="Warning",u(e,"class","bd-red"),u(r,"type","checkbox"),u(r,"name","dt"),r.__value="true",z(r,r.__value),u(r,"class","rounded mb-1"),u(o,"class","my-1"),b.__value=1,z(b,b.__value),k.__value=2,z(k,k.__value),M.__value=3,z(M,M.__value),O.__value=4,z(O,O.__value),u(g,"name","dl"),u(g,"class","in-s"),t[6].d.l===void 0&&At(()=>t[123].call(g)),u(v,"class","my-1")},m(H,q){N(H,e,q),s(e,n),N(H,i,q),N(H,o,q),s(o,a),s(a,r),r.checked=t[6].d.t,s(a,f),s(a,m),N(H,_,q),T&&T.m(H,q),N(H,d,q),N(H,v,q),s(v,g),s(g,b),s(g,k),s(g,M),s(g,O),ze(g,t[6].d.l,!0),F||(I=[re(r,"change",t[122]),re(g,"change",t[123])],F=!0)},p(H,q){var U,Z,G,Q;q[0]&4&&l!==(l=(((Z=(U=H[2].conf)==null?void 0:U.debug)==null?void 0:Z.danger)??"Disable when done")+"")&&E(n,l),q[0]&64&&(r.checked=H[6].d.t),q[0]&4&&c!==(c=(((Q=(G=H[2].conf)==null?void 0:G.debug)==null?void 0:Q.telnet)??"Enable telnet")+"")&&E(m,c),H[6].d.t?T?T.p(H,q):(T=Xa(H),T.c(),T.m(d.parentNode,d)):T&&(T.d(1),T=null),q[0]&64&&ze(g,H[6].d.l)},d(H){H&&(P(e),P(i),P(o),P(_),P(d),P(v)),T&&T.d(H),F=!1,Ht(I)}}}function Xa(t){var i,o;let e,l=(((o=(i=t[2].conf)==null?void 0:i.debug)==null?void 0:o.telnet_danger)??"Disable when done")+"",n;return{c(){e=p("div"),n=S(l),u(e,"class","bd-red")},m(a,r){N(a,e,r),s(e,n)},p(a,r){var f,c;r[0]&4&&l!==(l=(((c=(f=a[2].conf)==null?void 0:f.debug)==null?void 0:c.telnet_danger)??"Disable when done")+"")&&E(n,l)},d(a){a&&P(e)}}}function Za(t){var d,v;let e,l,n=(((d=t[2].conf)==null?void 0:d.btn_reset)??"Factory reset")+"",i,o,a,r,f=(((v=t[2].btn)==null?void 0:v.reboot)??"Reboot")+"",c,m,_;return{c(){e=p("div"),l=p("button"),i=S(n),o=h(),a=p("div"),r=p("button"),c=S(f),u(l,"type","button"),u(l,"class","btn-red"),u(r,"type","button"),u(r,"class","btn-yellow"),u(a,"class","text-center")},m(g,b){N(g,e,b),s(e,l),s(l,i),N(g,o,b),N(g,a,b),s(a,r),s(r,c),m||(_=[re(l,"click",t[14]),re(r,"click",t[16])],m=!0)},p(g,b){var k,M;b[0]&4&&n!==(n=(((k=g[2].conf)==null?void 0:k.btn_reset)??"Factory reset")+"")&&E(i,n),b[0]&4&&f!==(f=(((M=g[2].btn)==null?void 0:M.reboot)??"Reboot")+"")&&E(c,f)},d(g){g&&(P(e),P(o),P(a)),m=!1,Ht(_)}}}function Ja(t){var o;let e,l,n=(((o=t[2].btn)==null?void 0:o.save)??"Save")+"",i;return{c(){e=p("div"),l=p("button"),i=S(n),u(l,"type","submit"),u(l,"class","btn-pri"),u(e,"class","text-right")},m(a,r){N(a,e,r),s(e,l),s(l,i)},p(a,r){var f;r[0]&4&&n!==(n=(((f=a[2].btn)==null?void 0:f.save)??"Save")+"")&&E(i,n)},d(a){a&&P(e)}}}function K0(t){var _e,se,me,we,C,w,L,D,y,$,ae,pe,he,J,ve,ke,De,Te,Oe,Le,Ee,Ie,Ze,kt,xe,ft,wt,dt,ut,nt,ht,Ot,Je,Re,Be,et,ge,qe,Ge;let e,l,n,i,o,a,r,f,c,m,_=((me=(se=(_e=t[6])==null?void 0:_e.p)==null?void 0:se.r)==null?void 0:me.startsWith("NO"))||((w=(C=(we=t[6])==null?void 0:we.p)==null?void 0:C.r)==null?void 0:w.startsWith("10YNO"))||((y=(D=(L=t[6])==null?void 0:L.p)==null?void 0:D.r)==null?void 0:y.startsWith("10Y1001A1001A4")),d,v,g,b=(($=t[6])==null?void 0:$.d)&&((pe=(ae=t[0])==null?void 0:ae.features)==null?void 0:pe.includes("rdebug")),k,M,O,F,I,T,A,R,j,V,H,q,U,Z,G=((he=t[6])==null?void 0:he.g)&&ia(t),Q=((J=t[6])==null?void 0:J.m)&&fa(t),K=((ve=t[6])==null?void 0:ve.w)&&ma(t),B=((ke=t[6])==null?void 0:ke.n)&&ga(t),W=((De=t[6])==null?void 0:De.q)&&wa(t),ie=((Oe=(Te=t[6])==null?void 0:Te.q)==null?void 0:Oe.m)==3&&Ma(t),ee=((Ee=(Le=t[6])==null?void 0:Le.q)==null?void 0:Ee.m)==4&&Pa(t),Y=((Ie=t[6])==null?void 0:Ie.c)&&Na(t),le=_&&Ra(t),ue=((Ze=t[6])==null?void 0:Ze.u)&&Ba(t),fe=((xe=(kt=t[6])==null?void 0:kt.i)==null?void 0:xe.h)&&(((ft=t[0])==null?void 0:ft.board)>20||((wt=t[0])==null?void 0:wt.chip)=="esp8266"||((nt=(ut=(dt=t[6])==null?void 0:dt.i)==null?void 0:ut.d)==null?void 0:nt.d)>0)&&za(t),ne=b&&Ya(t),de=((ht=t[1])==null?void 0:ht.a)&&Za(t),oe=t[6]&&Ja(t);return I=new ml({props:{active:t[3],message:((Je=(Ot=t[2].conf)==null?void 0:Ot.mask)==null?void 0:Je.loading)??"Loading"}}),A=new ml({props:{active:t[4],message:((Be=(Re=t[2].conf)==null?void 0:Re.mask)==null?void 0:Be.saving)??"Saving"}}),j=new ml({props:{active:t[10],message:((ge=(et=t[2].conf)==null?void 0:et.mask)==null?void 0:ge.reset)??"Factory reset"}}),H=new ml({props:{active:t[11],message:((Ge=(qe=t[2].conf)==null?void 0:qe.mask)==null?void 0:Ge.reset_done)??"Done"}}),{c(){e=p("form"),l=p("div"),G&&G.c(),n=h(),Q&&Q.c(),i=h(),K&&K.c(),o=h(),B&&B.c(),a=h(),W&&W.c(),r=h(),ie&&ie.c(),f=h(),ee&&ee.c(),c=h(),Y&&Y.c(),m=h(),le&&le.c(),d=h(),ue&&ue.c(),v=h(),fe&&fe.c(),g=h(),ne&&ne.c(),k=h(),M=p("div"),de&&de.c(),O=h(),oe&&oe.c(),F=h(),Ne(I.$$.fragment),T=h(),Ne(A.$$.fragment),R=h(),Ne(j.$$.fragment),V=h(),Ne(H.$$.fragment),u(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),u(M,"class","grid grid-cols-3 mt-3"),u(e,"autocomplete","off")},m(ce,Ce){N(ce,e,Ce),s(e,l),G&&G.m(l,null),s(l,n),Q&&Q.m(l,null),s(l,i),K&&K.m(l,null),s(l,o),B&&B.m(l,null),s(l,a),W&&W.m(l,null),s(l,r),ie&&ie.m(l,null),s(l,f),ee&&ee.m(l,null),s(l,c),Y&&Y.m(l,null),s(l,m),le&&le.m(l,null),s(l,d),ue&&ue.m(l,null),s(l,v),fe&&fe.m(l,null),s(l,g),ne&&ne.m(l,null),s(e,k),s(e,M),de&&de.m(M,null),s(M,O),oe&&oe.m(M,null),N(ce,F,Ce),Me(I,ce,Ce),N(ce,T,Ce),Me(A,ce,Ce),N(ce,R,Ce),Me(j,ce,Ce),N(ce,V,Ce),Me(H,ce,Ce),q=!0,U||(Z=re(e,"submit",mn(t[15])),U=!0)},p(ce,Ce){var Ke,Mt,it,ct,tt,Bt,Xt,rt,st,Gt,Jt,Tt,Yt,xt,$t,Vt,It,Ve,Ye,Qe,qt,Ut,pt,ot,vt,Rt,be,lt,je,Wt,ul,nl,rl,il,jt,zt,al,Ae,x;(Ke=ce[6])!=null&&Ke.g?G?(G.p(ce,Ce),Ce[0]&64&&X(G,1)):(G=ia(ce),G.c(),X(G,1),G.m(l,n)):G&&(_t(),te(G,1,1,()=>{G=null}),mt()),(Mt=ce[6])!=null&&Mt.m?Q?Q.p(ce,Ce):(Q=fa(ce),Q.c(),Q.m(l,i)):Q&&(Q.d(1),Q=null),(it=ce[6])!=null&&it.w?K?K.p(ce,Ce):(K=ma(ce),K.c(),K.m(l,o)):K&&(K.d(1),K=null),(ct=ce[6])!=null&&ct.n?B?(B.p(ce,Ce),Ce[0]&64&&X(B,1)):(B=ga(ce),B.c(),X(B,1),B.m(l,a)):B&&(_t(),te(B,1,1,()=>{B=null}),mt()),(tt=ce[6])!=null&&tt.q?W?(W.p(ce,Ce),Ce[0]&64&&X(W,1)):(W=wa(ce),W.c(),X(W,1),W.m(l,r)):W&&(_t(),te(W,1,1,()=>{W=null}),mt()),((Xt=(Bt=ce[6])==null?void 0:Bt.q)==null?void 0:Xt.m)==3?ie?ie.p(ce,Ce):(ie=Ma(ce),ie.c(),ie.m(l,f)):ie&&(ie.d(1),ie=null),((st=(rt=ce[6])==null?void 0:rt.q)==null?void 0:st.m)==4?ee?ee.p(ce,Ce):(ee=Pa(ce),ee.c(),ee.m(l,c)):ee&&(ee.d(1),ee=null),(Gt=ce[6])!=null&&Gt.c?Y?(Y.p(ce,Ce),Ce[0]&64&&X(Y,1)):(Y=Na(ce),Y.c(),X(Y,1),Y.m(l,m)):Y&&(_t(),te(Y,1,1,()=>{Y=null}),mt()),Ce[0]&64&&(_=((Yt=(Tt=(Jt=ce[6])==null?void 0:Jt.p)==null?void 0:Tt.r)==null?void 0:Yt.startsWith("NO"))||((Vt=($t=(xt=ce[6])==null?void 0:xt.p)==null?void 0:$t.r)==null?void 0:Vt.startsWith("10YNO"))||((Ye=(Ve=(It=ce[6])==null?void 0:It.p)==null?void 0:Ve.r)==null?void 0:Ye.startsWith("10Y1001A1001A4"))),_?le?le.p(ce,Ce):(le=Ra(ce),le.c(),le.m(l,d)):le&&(le.d(1),le=null),(Qe=ce[6])!=null&&Qe.u?ue?ue.p(ce,Ce):(ue=Ba(ce),ue.c(),ue.m(l,v)):ue&&(ue.d(1),ue=null),(Ut=(qt=ce[6])==null?void 0:qt.i)!=null&&Ut.h&&(((pt=ce[0])==null?void 0:pt.board)>20||((ot=ce[0])==null?void 0:ot.chip)=="esp8266"||((be=(Rt=(vt=ce[6])==null?void 0:vt.i)==null?void 0:Rt.d)==null?void 0:be.d)>0)?fe?(fe.p(ce,Ce),Ce[0]&65&&X(fe,1)):(fe=za(ce),fe.c(),X(fe,1),fe.m(l,g)):fe&&(_t(),te(fe,1,1,()=>{fe=null}),mt()),Ce[0]&65&&(b=((lt=ce[6])==null?void 0:lt.d)&&((Wt=(je=ce[0])==null?void 0:je.features)==null?void 0:Wt.includes("rdebug"))),b?ne?ne.p(ce,Ce):(ne=Ya(ce),ne.c(),ne.m(l,null)):ne&&(ne.d(1),ne=null),(ul=ce[1])!=null&&ul.a?de?de.p(ce,Ce):(de=Za(ce),de.c(),de.m(M,O)):de&&(de.d(1),de=null),ce[6]?oe?oe.p(ce,Ce):(oe=Ja(ce),oe.c(),oe.m(M,null)):oe&&(oe.d(1),oe=null);const $e={};Ce[0]&8&&($e.active=ce[3]),Ce[0]&4&&($e.message=((rl=(nl=ce[2].conf)==null?void 0:nl.mask)==null?void 0:rl.loading)??"Loading"),I.$set($e);const ye={};Ce[0]&16&&(ye.active=ce[4]),Ce[0]&4&&(ye.message=((jt=(il=ce[2].conf)==null?void 0:il.mask)==null?void 0:jt.saving)??"Saving"),A.$set(ye);const Lt={};Ce[0]&1024&&(Lt.active=ce[10]),Ce[0]&4&&(Lt.message=((al=(zt=ce[2].conf)==null?void 0:zt.mask)==null?void 0:al.reset)??"Factory reset"),j.$set(Lt);const bt={};Ce[0]&2048&&(bt.active=ce[11]),Ce[0]&4&&(bt.message=((x=(Ae=ce[2].conf)==null?void 0:Ae.mask)==null?void 0:x.reset_done)??"Done"),H.$set(bt)},i(ce){q||(X(G),X(B),X(W),X(Y),X(fe),X(I.$$.fragment,ce),X(A.$$.fragment,ce),X(j.$$.fragment,ce),X(H.$$.fragment,ce),q=!0)},o(ce){te(G),te(B),te(W),te(Y),te(fe),te(I.$$.fragment,ce),te(A.$$.fragment,ce),te(j.$$.fragment,ce),te(H.$$.fragment,ce),q=!1},d(ce){ce&&(P(e),P(F),P(T),P(R),P(V)),G&&G.d(),Q&&Q.d(),K&&K.d(),B&&B.d(),W&&W.d(),ie&&ie.d(),ee&&ee.d(),Y&&Y.d(),le&&le.d(),ue&&ue.d(),fe&&fe.d(),ne&&ne.d(),de&&de.d(),oe&&oe.d(),Pe(I,ce),Pe(A,ce),Pe(j,ce),Pe(H,ce),U=!1,Z()}}}async function Y0(){await(await fetch("reboot",{method:"POST"})).json()}function Q0(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,{data:o}=e,a={};Sl.subscribe(Se=>{l(2,a=Se)});let r=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Per phase",key:"h"},{name:"Power factor",key:"f"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Realtime plot",key:"l"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"},{name:"Dark mode",key:"k"}],f=!0,c=!1,m=!1,_,d=[];Bn.subscribe(Se=>{var Ct,tl,cl;Se.version&&(l(5,m=(Ct=Se==null?void 0:Se.c)==null?void 0:Ct.e),l(6,_=Se),l(3,f=!1),l(7,d=[{code:"en",name:"English"}]),(tl=_==null?void 0:_.u)!=null&&tl.lang&&_.u.lang!="en"&&d.push({code:_.u.lang,name:((cl=a.language)==null?void 0:cl.name)??"Unknown"}),d.push({code:"hub",name:"Load from server"}))}),s0();let v=!0,g={};xi.subscribe(Se=>{var Ct;l(8,v=!0);for(let tl=0;tl(sl.hostname=Ct.get("gh"),sl.usrcfg=dl.success,sl.booting=dl.reboot,Ct.get("nm")=="static"&&(sl.net.ip=Ct.get("ni"),sl.net.mask=Ct.get("nu"),sl.net.gw=Ct.get("ng"),sl.net.dns1=Ct.get("nd")),sl.ui=_.u,sl)),l(4,c=!1),nn(n)}const F=function(){confirm("Reboot?")&&(pl.update(Se=>(Se.booting=!0,Se)),Y0())};async function I(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),Bn.update(Ct=>(Ct.q.s.c=!1,Ct)))}async function T(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),Bn.update(Ct=>(Ct.q.s.r=!1,Ct)))}async function A(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),Bn.update(Ct=>(Ct.q.s.k=!1,Ct)))}const R=function(){_.q.s.e?_.q.p==1883&&l(6,_.q.p=8883,_):_.q.p==8883&&l(6,_.q.p=1883,_)};async function j(){if(_.u.lang=="hub"){const Se=await kl("http://hub.amsleser.no/hub/language/list.json");l(7,d=await Se.json()),l(6,_.u.lang=a.language.code,_)}}async function V(){l(6,_.p.e=!0,_)}let H=44;async function q(){const Se=await kl("cloudkey.json");if(Se.status==200){let Ct=await Se.json();window.open("https://www.amsleser.cloud/device/"+Ct.seed)}else alert("Not able to bind to cloud")}const U=window||global;U.bindToCloud=function(){console.log("BIND CALLED")};function Z(){_.g.h=this.value,l(6,_)}function G(){_.g.t=Kt(this),l(6,_)}function Q(){_.p.r=Kt(this),l(6,_)}function K(){_.p.m=Kt(this),l(6,_)}function B(){_.p.c=Kt(this),l(6,_)}function W(){_.p.e=this.checked,l(6,_)}function ie(){_.p.t=this.value,l(6,_)}function ee(){_.g.s=Kt(this),l(6,_)}function Y(){_.g.u=this.value,l(6,_)}function le(){_.g.p=this.value,l(6,_)}function ue(){_.g.c=this.value,l(6,_)}function fe(){_.m.a=Kt(this),l(6,_)}function ne(){_.m.b=Fe(this.value),l(6,_)}function de(){_.m.i=this.checked,l(6,_)}function oe(){_.m.b=Kt(this),l(6,_)}function _e(){_.m.p=Kt(this),l(6,_)}function se(){_.m.s=Fe(this.value),l(6,_)}function me(){_.m.d=Kt(this),l(6,_)}function we(){_.m.f=Fe(this.value),l(6,_)}function C(){_.m.r=Fe(this.value),l(6,_)}function w(){_.m.e.e=this.checked,l(6,_)}function L(){_.m.e.k=this.value,l(6,_)}function D(){_.m.e.a=this.value,l(6,_)}function y(){_.m.m.e=this.checked,l(6,_)}function $(){_.m.m.w=Fe(this.value),l(6,_)}function ae(){_.m.m.v=Fe(this.value),l(6,_)}function pe(){_.m.m.a=Fe(this.value),l(6,_)}function he(){_.m.m.c=Fe(this.value),l(6,_)}function J(){_.n.c=Kt(this),l(6,_)}function ve(){v=this.checked,l(8,v)}function ke(){_.w.s=this.value,l(6,_)}function De(){_.w.s=Kt(this),l(6,_)}function Te(){_.w.p=this.value,l(6,_)}function Oe(){_.w.z=Kt(this),l(6,_)}function Le(){_.w.w=Fe(this.value),l(6,_)}function Ee(){_.w.b=this.checked,l(6,_)}function Ie(){_.n.m=Kt(this),l(6,_)}function Ze(){_.n.i=this.value,l(6,_)}function kt(){_.n.s=Kt(this),l(6,_)}function xe(){_.n.g=this.value,l(6,_)}function ft(){_.n.d1=this.value,l(6,_)}function wt(){_.n.d2=this.value,l(6,_)}function dt(){_.n.x=this.checked,l(6,_)}function ut(){_.n.d=this.checked,l(6,_)}function nt(){_.n.h=this.checked,l(6,_)}function ht(){_.n.n1=this.value,l(6,_)}function Ot(){_.q.s.e=this.checked,l(6,_)}function Je(){_.q.h=this.value,l(6,_)}function Re(){_.q.p=Fe(this.value),l(6,_)}function Be(){_.q.u=this.value,l(6,_)}function et(){_.q.a=this.value,l(6,_)}function ge(){_.q.c=this.value,l(6,_)}function qe(){_.q.m=Kt(this),l(6,_)}function Ge(){_.q.b=this.value,l(6,_)}function ce(){_.q.r=this.value,l(6,_)}function Ce(){_.q.t=Kt(this),l(6,_)}function $e(){_.q.d=Fe(this.value),l(6,_)}function ye(){_.q.i=Fe(this.value),l(6,_)}function Lt(){_.q.k=Fe(this.value),l(6,_)}function bt(){_.o.e=this.value,l(6,_)}function Ke(){_.o.c=this.value,l(6,_)}function Mt(){_.o.u1=this.value,l(6,_)}function it(){_.o.u2=this.value,l(6,_)}function ct(){_.o.u3=this.value,l(6,_)}function tt(){_.h.t=this.value,l(6,_)}function Bt(){_.h.h=this.value,l(6,_)}function Xt(){_.h.n=this.value,l(6,_)}function rt(){_.c.e=this.checked,l(6,_)}function st(){_.c.p=Kt(this),l(6,_)}function Gt(){_.c.es=this.checked,l(6,_)}function Jt(){_.c.ze=this.checked,l(6,_)}function Tt(){_.c.zt=this.value,l(6,_)}function Yt(Se){_.t.t[Se]=Fe(this.value),l(6,_)}function xt(){_.t.h=Fe(this.value),l(6,_)}function $t(Se){_.u[Se.key]=Kt(this),l(6,_)}function Vt(){_.u.lang=Kt(this),l(6,_)}function It(){_.i.h.p=Kt(this),l(6,_)}function Ve(){_.i.h.t=Kt(this),l(6,_)}function Ye(){_.i.h.u=this.checked,l(6,_)}function Qe(){_.i.a=Fe(this.value),l(6,_)}function qt(){_.i.l.p=Fe(this.value),l(6,_)}function Ut(){_.i.l.i=this.checked,l(6,_)}function pt(){_.i.r.i=this.checked,l(6,_)}function ot(){_.i.r.r=Fe(this.value),l(6,_)}function vt(){_.i.r.g=Fe(this.value),l(6,_)}function Rt(){_.i.r.b=Fe(this.value),l(6,_)}function be(){_.i.d.d=Fe(this.value),l(6,_)}function lt(){_.i.t.d=Fe(this.value),l(6,_)}function je(){_.i.t.a=Fe(this.value),l(6,_)}function Wt(){_.i.v.p=Fe(this.value),l(6,_)}function ul(){_.i.v.d.v=Fe(this.value),l(6,_)}function nl(){_.i.v.d.g=Fe(this.value),l(6,_)}function rl(){_.i.d.b=Kt(this),l(6,_)}function il(){_.i.v.o=Fe(this.value),l(6,_)}function jt(){_.i.v.m=Fe(this.value),l(6,_)}function zt(){_.i.v.b=Fe(this.value),l(6,_)}function al(){_.d.s=this.checked,l(6,_)}function Ae(){_.d.t=this.checked,l(6,_)}function x(){_.d.l=Kt(this),l(6,_)}return t.$$set=Se=>{"basepath"in Se&&l(24,n=Se.basepath),"sysinfo"in Se&&l(0,i=Se.sysinfo),"data"in Se&&l(1,o=Se.data)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(12,H=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39)},[i,o,a,f,c,m,_,d,v,g,b,k,H,r,M,O,F,I,T,A,R,j,V,q,n,Z,G,Q,K,B,W,ie,ee,Y,le,ue,fe,ne,de,oe,_e,se,me,we,C,w,L,D,y,$,ae,pe,he,J,ve,ke,De,Te,Oe,Le,Ee,Ie,Ze,kt,xe,ft,wt,dt,ut,nt,ht,Ot,Je,Re,Be,et,ge,qe,Ge,ce,Ce,$e,ye,Lt,bt,Ke,Mt,it,ct,tt,Bt,Xt,rt,st,Gt,Jt,Tt,Yt,xt,$t,Vt,It,Ve,Ye,Qe,qt,Ut,pt,ot,vt,Rt,be,lt,je,Wt,ul,nl,rl,il,jt,zt,al,Ae,x]}class X0 extends Nt{constructor(e){super(),Pt(this,e,Q0,K0,St,{basepath:24,sysinfo:0,data:1},null,[-1,-1,-1,-1,-1])}}function $a(t,e,l){const n=t.slice();return n[21]=e[l],n}function xa(t){let e,l=t[1].cpu+"",n,i;return{c(){e=S("("),n=S(l),i=S("MHz)")},m(o,a){N(o,e,a),N(o,n,a),N(o,i,a)},p(o,a){a&2&&l!==(l=o[1].cpu+"")&&E(n,l)},d(o){o&&(P(e),P(n),P(i))}}}function Z0(t){let e=Xe(t[1].chip,t[1].board)+"",l;return{c(){l=S(e)},m(n,i){N(n,l,i)},p(n,i){i&2&&e!==(e=Xe(n[1].chip,n[1].board)+"")&&E(l,e)},d(n){n&&P(l)}}}function ef(t){var K,B,W,ie,ee,Y,le,ue;let e,l=(((B=(K=t[3].status)==null?void 0:K.device)==null?void 0:B.apmac)??"AP MAC")+"",n,i,o=t[1].apmac+"",a,r,f,c=(((ie=(W=t[3].status)==null?void 0:W.device)==null?void 0:ie.last_boot)??"Last boot")+"",m,_,d,v,g,b,k=(((Y=(ee=t[3].status)==null?void 0:ee.device)==null?void 0:Y.reason)??"Reason")+"",M,O,F=(((ue=(le=t[3][Ao(t[1].chip)])==null?void 0:le.reason)==null?void 0:ue[t[1].boot_reason])??t[1].boot_reason)+"",I,T,A=t[1].boot_reason+"",R,j,V=t[1].ex_cause+"",H,q,U;const Z=[$0,J0],G=[];function Q(fe,ne){return fe[0].u>0?0:1}return d=Q(t),v=G[d]=Z[d](t),{c(){e=p("div"),n=S(l),i=S(": "),a=S(o),r=h(),f=p("div"),m=S(c),_=S(`: + `),v.c(),g=h(),b=p("div"),M=S(k),O=S(": "),I=S(F),T=S(" ("),R=S(A),j=S("/"),H=S(V),q=S(")"),u(e,"class","my-2"),u(f,"class","my-2"),u(b,"class","my-2")},m(fe,ne){N(fe,e,ne),s(e,n),s(e,i),s(e,a),N(fe,r,ne),N(fe,f,ne),s(f,m),s(f,_),G[d].m(f,null),N(fe,g,ne),N(fe,b,ne),s(b,M),s(b,O),s(b,I),s(b,T),s(b,R),s(b,j),s(b,H),s(b,q),U=!0},p(fe,ne){var oe,_e,se,me,we,C,w,L;(!U||ne&8)&&l!==(l=(((_e=(oe=fe[3].status)==null?void 0:oe.device)==null?void 0:_e.apmac)??"AP MAC")+"")&&E(n,l),(!U||ne&2)&&o!==(o=fe[1].apmac+"")&&E(a,o),(!U||ne&8)&&c!==(c=(((me=(se=fe[3].status)==null?void 0:se.device)==null?void 0:me.last_boot)??"Last boot")+"")&&E(m,c);let de=d;d=Q(fe),d===de?G[d].p(fe,ne):(_t(),te(G[de],1,1,()=>{G[de]=null}),mt(),v=G[d],v?v.p(fe,ne):(v=G[d]=Z[d](fe),v.c()),X(v,1),v.m(f,null)),(!U||ne&8)&&k!==(k=(((C=(we=fe[3].status)==null?void 0:we.device)==null?void 0:C.reason)??"Reason")+"")&&E(M,k),(!U||ne&10)&&F!==(F=(((L=(w=fe[3][Ao(fe[1].chip)])==null?void 0:w.reason)==null?void 0:L[fe[1].boot_reason])??fe[1].boot_reason)+"")&&E(I,F),(!U||ne&2)&&A!==(A=fe[1].boot_reason+"")&&E(R,A),(!U||ne&2)&&V!==(V=fe[1].ex_cause+"")&&E(H,V)},i(fe){U||(X(v),U=!0)},o(fe){te(v),U=!1},d(fe){fe&&(P(e),P(r),P(f),P(g),P(b)),G[d].d()}}}function J0(t){let e;return{c(){e=S("-")},m(l,n){N(l,e,n)},p:He,i:He,o:He,d(l){l&&P(e)}}}function $0(t){let e,l;return e=new Vu({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:"",offset:t[1].clock_offset}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),i&2&&(o.offset=n[1].clock_offset),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function tf(t){var m;let e,l,n,i,o=(((m=t[3].btn)==null?void 0:m.reboot)??"Reboot")+"",a,r,f,c;return l=new gl({props:{to:"/consent",$$slots:{default:[x0]},$$scope:{ctx:t}}}),{c(){e=p("div"),Ne(l.$$.fragment),n=h(),i=p("button"),a=S(o),u(i,"class","btn-yellow-sm float-right"),u(e,"class","my-2")},m(_,d){N(_,e,d),Me(l,e,null),s(e,n),s(e,i),s(i,a),r=!0,f||(c=re(i,"click",t[11]),f=!0)},p(_,d){var g;const v={};d&16777224&&(v.$$scope={dirty:d,ctx:_}),l.$set(v),(!r||d&8)&&o!==(o=(((g=_[3].btn)==null?void 0:g.reboot)??"Reboot")+"")&&E(a,o)},i(_){r||(X(l.$$.fragment,_),r=!0)},o(_){te(l.$$.fragment,_),r=!1},d(_){_&&P(e),Pe(l),f=!1,c()}}}function x0(t){var i,o;let e,l=(((o=(i=t[3].status)==null?void 0:i.device)==null?void 0:o.btn_consents)??"Consents")+"",n;return{c(){e=p("span"),n=S(l),u(e,"class","btn-pri-sm")},m(a,r){N(a,e,r),s(e,n)},p(a,r){var f,c;r&8&&l!==(l=(((c=(f=a[3].status)==null?void 0:f.device)==null?void 0:c.btn_consents)??"Consents")+"")&&E(n,l)},d(a){a&&P(e)}}}function lf(t){var H,q,U,Z,G,Q,K,B;let e,l,n=(((q=(H=t[3].status)==null?void 0:H.meter)==null?void 0:q.title)??"Meter")+"",i,o,a,r=(((Z=(U=t[3].status)==null?void 0:U.meter)==null?void 0:Z.manufacturer)??"Manufacturer")+"",f,c,m=ri(t[1].meter.mfg)+"",_,d,v,g=(((Q=(G=t[3].status)==null?void 0:G.meter)==null?void 0:Q.model)??"Model")+"",b,k,M=(t[1].meter.model?t[1].meter.model:"unknown")+"",O,F,I,T=(((B=(K=t[3].status)==null?void 0:K.meter)==null?void 0:B.id)??"ID")+"",A,R,j=(t[1].meter.id?t[1].meter.id:"unknown")+"",V;return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("div"),f=S(r),c=S(": "),_=S(m),d=h(),v=p("div"),b=S(g),k=S(": "),O=S(M),F=h(),I=p("div"),A=S(T),R=S(": "),V=S(j),u(l,"class","text-sm"),u(a,"class","my-2"),u(v,"class","my-2"),u(I,"class","my-2"),u(e,"class","cnt")},m(W,ie){N(W,e,ie),s(e,l),s(l,i),s(e,o),s(e,a),s(a,f),s(a,c),s(a,_),s(e,d),s(e,v),s(v,b),s(v,k),s(v,O),s(e,F),s(e,I),s(I,A),s(I,R),s(I,V)},p(W,ie){var ee,Y,le,ue,fe,ne,de,oe;ie&8&&n!==(n=(((Y=(ee=W[3].status)==null?void 0:ee.meter)==null?void 0:Y.title)??"Meter")+"")&&E(i,n),ie&8&&r!==(r=(((ue=(le=W[3].status)==null?void 0:le.meter)==null?void 0:ue.manufacturer)??"Manufacturer")+"")&&E(f,r),ie&2&&m!==(m=ri(W[1].meter.mfg)+"")&&E(_,m),ie&8&&g!==(g=(((ne=(fe=W[3].status)==null?void 0:fe.meter)==null?void 0:ne.model)??"Model")+"")&&E(b,g),ie&2&&M!==(M=(W[1].meter.model?W[1].meter.model:"unknown")+"")&&E(O,M),ie&8&&T!==(T=(((oe=(de=W[3].status)==null?void 0:de.meter)==null?void 0:oe.id)??"ID")+"")&&E(A,T),ie&2&&j!==(j=(W[1].meter.id?W[1].meter.id:"unknown")+"")&&E(V,j)},d(W){W&&P(e)}}}function nf(t){var B,W,ie,ee,Y,le,ue,fe;let e,l,n=(((W=(B=t[3].status)==null?void 0:B.network)==null?void 0:W.title)??"Network")+"",i,o,a,r=(((ee=(ie=t[3].conf)==null?void 0:ie.network)==null?void 0:ee.ip)??"IP")+"",f,c,m=t[1].net.ip+"",_,d,v,g=(((le=(Y=t[3].conf)==null?void 0:Y.network)==null?void 0:le.mask)??"Mask")+"",b,k,M=t[1].net.mask+"",O,F,I,T=(((fe=(ue=t[3].conf)==null?void 0:ue.network)==null?void 0:fe.gw)??"Gateway")+"",A,R,j=t[1].net.gw+"",V,H,q,U,Z,G=t[1].net.dns1&&of(t),Q=t[1].net.dns2&&sf(t),K=t[1].net.ipv6&&af(t);return{c(){e=p("div"),l=p("strong"),i=S(n),o=h(),a=p("div"),f=S(r),c=S(": "),_=S(m),d=h(),v=p("div"),b=S(g),k=S(": "),O=S(M),F=h(),I=p("div"),A=S(T),R=S(": "),V=S(j),H=h(),q=p("div"),G&&G.c(),U=h(),Q&&Q.c(),Z=h(),K&&K.c(),u(l,"class","text-sm"),u(a,"class","my-2"),u(v,"class","my-2"),u(I,"class","my-2"),u(q,"class","my-2"),u(e,"class","cnt")},m(ne,de){N(ne,e,de),s(e,l),s(l,i),s(e,o),s(e,a),s(a,f),s(a,c),s(a,_),s(e,d),s(e,v),s(v,b),s(v,k),s(v,O),s(e,F),s(e,I),s(I,A),s(I,R),s(I,V),s(e,H),s(e,q),G&&G.m(q,null),s(q,U),Q&&Q.m(q,null),s(e,Z),K&&K.m(e,null)},p(ne,de){var oe,_e,se,me,we,C,w,L;de&8&&n!==(n=(((_e=(oe=ne[3].status)==null?void 0:oe.network)==null?void 0:_e.title)??"Network")+"")&&E(i,n),de&8&&r!==(r=(((me=(se=ne[3].conf)==null?void 0:se.network)==null?void 0:me.ip)??"IP")+"")&&E(f,r),de&2&&m!==(m=ne[1].net.ip+"")&&E(_,m),de&8&&g!==(g=(((C=(we=ne[3].conf)==null?void 0:we.network)==null?void 0:C.mask)??"Mask")+"")&&E(b,g),de&2&&M!==(M=ne[1].net.mask+"")&&E(O,M),de&8&&T!==(T=(((L=(w=ne[3].conf)==null?void 0:w.network)==null?void 0:L.gw)??"Gateway")+"")&&E(A,T),de&2&&j!==(j=ne[1].net.gw+"")&&E(V,j),ne[1].net.dns1?G?G.p(ne,de):(G=of(ne),G.c(),G.m(q,U)):G&&(G.d(1),G=null),ne[1].net.dns2?Q?Q.p(ne,de):(Q=sf(ne),Q.c(),Q.m(q,null)):Q&&(Q.d(1),Q=null),ne[1].net.ipv6?K?K.p(ne,de):(K=af(ne),K.c(),K.m(e,null)):K&&(K.d(1),K=null)},d(ne){ne&&P(e),G&&G.d(),Q&&Q.d(),K&&K.d()}}}function of(t){var a,r;let e=(((r=(a=t[3].conf)==null?void 0:a.network)==null?void 0:r.dns)??"DNS")+"",l,n,i=t[1].net.dns1+"",o;return{c(){l=S(e),n=S(": "),o=S(i)},m(f,c){N(f,l,c),N(f,n,c),N(f,o,c)},p(f,c){var m,_;c&8&&e!==(e=(((_=(m=f[3].conf)==null?void 0:m.network)==null?void 0:_.dns)??"DNS")+"")&&E(l,e),c&2&&i!==(i=f[1].net.dns1+"")&&E(o,i)},d(f){f&&(P(l),P(n),P(o))}}}function sf(t){var a,r;let e=(((r=(a=t[3].conf)==null?void 0:a.network)==null?void 0:r.dns)??"DNS")+"",l,n,i=t[1].net.dns2+"",o;return{c(){l=S(e),n=S(": "),o=S(i)},m(f,c){N(f,l,c),N(f,n,c),N(f,o,c)},p(f,c){var m,_;c&8&&e!==(e=(((_=(m=f[3].conf)==null?void 0:m.network)==null?void 0:_.dns)??"DNS")+"")&&E(l,e),c&2&&i!==(i=f[1].net.dns2+"")&&E(o,i)},d(f){f&&(P(l),P(n),P(o))}}}function af(t){let e,l,n,i=t[1].net.ipv6.replace(/\b:?(?:0+:?){2,}/,"::")+"",o,a,r,f,c=t[1].net.dns1v6&&ff(t),m=t[1].net.dns2v6&&uf(t);return{c(){e=p("div"),l=S("IPv6: "),n=p("span"),o=S(i),a=h(),r=p("div"),c&&c.c(),f=h(),m&&m.c(),ln(n,"font-size","14px"),u(e,"class","my-2"),u(r,"class","my-2")},m(_,d){N(_,e,d),s(e,l),s(e,n),s(n,o),N(_,a,d),N(_,r,d),c&&c.m(r,null),s(r,f),m&&m.m(r,null)},p(_,d){d&2&&i!==(i=_[1].net.ipv6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&E(o,i),_[1].net.dns1v6?c?c.p(_,d):(c=ff(_),c.c(),c.m(r,f)):c&&(c.d(1),c=null),_[1].net.dns2v6?m?m.p(_,d):(m=uf(_),m.c(),m.m(r,null)):m&&(m.d(1),m=null)},d(_){_&&(P(e),P(a),P(r)),c&&c.d(),m&&m.d()}}}function ff(t){let e,l,n=t[1].net.dns1v6.replace(/\b:?(?:0+:?){2,}/,"::")+"",i;return{c(){e=S("DNSv6: "),l=p("span"),i=S(n),ln(l,"font-size","14px")},m(o,a){N(o,e,a),N(o,l,a),s(l,i)},p(o,a){a&2&&n!==(n=o[1].net.dns1v6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&E(i,n)},d(o){o&&(P(e),P(l))}}}function uf(t){let e,l,n=t[1].net.dns2v6.replace(/\b:?(?:0+:?){2,}/,"::")+"",i;return{c(){e=S("DNSv6: "),l=p("span"),i=S(n),ln(l,"font-size","14px")},m(o,a){N(o,e,a),N(o,l,a),s(l,i)},p(o,a){a&2&&n!==(n=o[1].net.dns2v6.replace(/\b:?(?:0+:?){2,}/,"::")+"")&&E(i,n)},d(o){o&&(P(e),P(l))}}}function rf(t){var f,c,m,_;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,o,a=(((_=(m=t[3].errors)==null?void 0:m.upgrade)==null?void 0:_[t[1].upgrade.e])??t[1].upgrade.e)+"",r;return{c(){e=p("div"),l=p("div"),i=S(n),o=h(),r=S(a),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(d,v){N(d,e,v),s(e,l),s(l,i),s(l,o),s(l,r)},p(d,v){var g,b,k,M;v&10&&n!==(n=(((b=(g=d[3].status)==null?void 0:g.firmware)==null?void 0:b.failed)??"Upgrade from {0} to {1} failed").replace("{0}",d[1].upgrade.f).replace("{1}",d[1].upgrade.t)+"")&&E(i,n),v&10&&a!==(a=(((M=(k=d[3].errors)==null?void 0:k.upgrade)==null?void 0:M[d[1].upgrade.e])??d[1].upgrade.e)+"")&&E(r,a)},d(d){d&&P(e)}}}function cf(t){var g,b;let e,l=(((b=(g=t[3].status)==null?void 0:g.firmware)==null?void 0:b.latest)??"Latest")+"",n,i,o,a=t[1].upgrade.n+"",r,f,c,m,_,d=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[1].upgrade.n&&t[1].upgrade.n!=t[1].version&&_f(t),v=t[1].fwconsent===2&&mf(t);return{c(){e=p("div"),n=S(l),i=S(`: + `),o=p("a"),r=S(a),c=h(),d&&d.c(),m=h(),v&&v.c(),_=yt(),u(o,"href",f="https://github.com/UtilitechAS/amsreader-firmware/releases/tag/"+t[1].upgrade.n),u(o,"class","ml-2 text-blue-600 hover:text-blue-800"),u(o,"target","_blank"),u(o,"rel","noreferrer"),u(e,"class","my-2 flex")},m(k,M){N(k,e,M),s(e,n),s(e,i),s(e,o),s(o,r),s(e,c),d&&d.m(e,null),N(k,m,M),v&&v.m(k,M),N(k,_,M)},p(k,M){var O,F;M&8&&l!==(l=(((F=(O=k[3].status)==null?void 0:O.firmware)==null?void 0:F.latest)??"Latest")+"")&&E(n,l),M&2&&a!==(a=k[1].upgrade.n+"")&&E(r,a),M&2&&f!==(f="https://github.com/UtilitechAS/amsreader-firmware/releases/tag/"+k[1].upgrade.n)&&u(o,"href",f),(k[1].security==0||k[0].a)&&k[1].fwconsent===1&&k[1].upgrade.n&&k[1].upgrade.n!=k[1].version?d?d.p(k,M):(d=_f(k),d.c(),d.m(e,null)):d&&(d.d(1),d=null),k[1].fwconsent===2?v?v.p(k,M):(v=mf(k),v.c(),v.m(_.parentNode,_)):v&&(v.d(1),v=null)},d(k){k&&(P(e),P(m),P(_)),d&&d.d(),v&&v.d(k)}}}function _f(t){let e,l,n,i,o;return{c(){var a,r;e=p("div"),l=p("button"),l.textContent="⇓",u(e,"class","flex-none ml-2 text-green-500"),u(e,"title",n=((r=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:r.install)??"Install")},m(a,r){N(a,e,r),s(e,l),i||(o=re(l,"click",t[10]),i=!0)},p(a,r){var f,c;r&8&&n!==(n=((c=(f=a[3].status)==null?void 0:f.firmware)==null?void 0:c.install)??"Install")&&u(e,"title",n)},d(a){a&&P(e),i=!1,o()}}}function mf(t){var o,a;let e,l,n=(((a=(o=t[3].status)==null?void 0:o.firmware)==null?void 0:a.no_one_click)??"One-click upgrade disabled")+"",i;return{c(){e=p("div"),l=p("div"),i=S(n),u(l,"class","bd-yellow"),u(e,"class","my-2")},m(r,f){N(r,e,f),s(e,l),s(l,i)},p(r,f){var c,m;f&8&&n!==(n=(((m=(c=r[3].status)==null?void 0:c.firmware)==null?void 0:m.no_one_click)??"One-click upgrade disabled")+"")&&E(i,n)},d(r){r&&P(e)}}}function pf(t){let e,l=Io(Xe(t[1].chip,t[1].board))+"",n;return{c(){e=p("div"),n=S(l),u(e,"class","bd-red")},m(i,o){N(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=Io(Xe(i[1].chip,i[1].board))+"")&&E(n,l)},d(i){i&&P(e)}}}function df(t){let e,l,n,i,o,a;function r(m,_){return m[5].length==0?t_:e_}let f=r(t),c=f(t);return{c(){e=p("div"),l=p("form"),n=p("input"),i=h(),c.c(),ln(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(m,_){N(m,e,_),s(e,l),s(l,n),t[13](n),s(l,i),c.m(l,null),o||(a=[re(n,"change",t[14]),re(l,"submit",t[16])],o=!0)},p(m,_){f===(f=r(m))&&c?c.p(m,_):(c.d(1),c=f(m),c&&(c.c(),c.m(l,null)))},d(m){m&&P(e),t[13](null),c.d(),o=!1,Ht(a)}}}function e_(t){var r;let e=t[5][0].name+"",l,n,i,o=(((r=t[3].btn)==null?void 0:r.upload)??"Upload")+"",a;return{c(){l=S(e),n=h(),i=p("button"),a=S(o),u(i,"type","submit"),u(i,"class","btn-pri-sm float-right ml-2")},m(f,c){N(f,l,c),N(f,n,c),N(f,i,c),s(i,a)},p(f,c){var m;c&32&&e!==(e=f[5][0].name+"")&&E(l,e),c&8&&o!==(o=(((m=f[3].btn)==null?void 0:m.upload)??"Upload")+"")&&E(a,o)},d(f){f&&(P(l),P(n),P(i))}}}function t_(t){var a,r;let e,l=(((r=(a=t[3].status)==null?void 0:a.firmware)==null?void 0:r.btn_select_file)??"Select file")+"",n,i,o;return{c(){e=p("button"),n=S(l),u(e,"type","button"),u(e,"class","btn-pri-sm float-right")},m(f,c){N(f,e,c),s(e,n),i||(o=re(e,"click",t[15]),i=!0)},p(f,c){var m,_;c&8&&l!==(l=(((_=(m=f[3].status)==null?void 0:m.firmware)==null?void 0:_.btn_select_file)??"Select file")+"")&&E(n,l)},d(f){f&&P(e),i=!1,o()}}}function hf(t){var Q,K,B,W,ie,ee;let e,l,n=(((K=(Q=t[3].status)==null?void 0:Q.backup)==null?void 0:K.title)??"Backup")+"",i,o,a,r,f,c,m,_,d=(((W=(B=t[3].status)==null?void 0:B.backup)==null?void 0:W.secrets)??"Include secrets")+"",v,g,b,k=(((ee=(ie=t[3].status)==null?void 0:ie.backup)==null?void 0:ee.secrets_desc)??"")+"",M,O,F,I,T,A,R,j,V=at(t[9]),H=[];for(let Y=0;Y{pe=null}),mt()),(ct=ge[0])!=null&&ct.a?he?(he.p(ge,qe),qe&1&&X(he,1)):(he=tf(ge),he.c(),X(he,1),he.m(l,null)):he&&(_t(),te(he,1,1,()=>{he=null}),mt()),ge[1].meter?J?J.p(ge,qe):(J=lf(ge),J.c(),J.m(e,G)):J&&(J.d(1),J=null),ge[1].net?ve?ve.p(ge,qe):(ve=nf(ge),ve.c(),ve.m(e,Q)):ve&&(ve.d(1),ve=null),(!$||qe&8)&&W!==(W=(((Bt=(tt=ge[3].status)==null?void 0:tt.firmware)==null?void 0:Bt.title)??"Firmware")+"")&&E(ie,W),(!$||qe&8)&&le!==(le=(((rt=(Xt=ge[3].status)==null?void 0:Xt.firmware)==null?void 0:rt.installed)??"Installed")+"")&&E(ue,le),(!$||qe&2)&&ne!==(ne=ge[1].version+"")&&E(de,ne),ge[1].upgrade.t&&ge[1].upgrade.t!=ge[1].version&&ge[1].upgrade.e!=0&&ge[1].upgrade.e!=123?ke?ke.p(ge,qe):(ke=rf(ge),ke.c(),ke.m(K,_e)):ke&&(ke.d(1),ke=null),ge[1].upgrade.n?De?De.p(ge,qe):(De=cf(ge),De.c(),De.m(K,se)):De&&(De.d(1),De=null),qe&3&&(me=(ge[1].security==0||ge[0].a)&&zn(ge[1].board)),me?Te?Te.p(ge,qe):(Te=pf(ge),Te.c(),Te.m(K,we)):Te&&(Te.d(1),Te=null),ge[1].security==0||ge[0].a?Oe?Oe.p(ge,qe):(Oe=df(ge),Oe.c(),Oe.m(K,null)):Oe&&(Oe.d(1),Oe=null),ge[1].security==0||ge[0].a?Le?Le.p(ge,qe):(Le=hf(ge),Le.c(),Le.m(e,null)):Le&&(Le.d(1),Le=null);const ce={};qe&64&&(ce.active=ge[6]),qe&8&&(ce.message=((Gt=(st=ge[3].status)==null?void 0:st.mask)==null?void 0:Gt.firmware)??"Uploading"),L.$set(ce);const Ce={};qe&256&&(Ce.active=ge[8]),qe&8&&(Ce.message=((Tt=(Jt=ge[3].status)==null?void 0:Jt.mask)==null?void 0:Tt.config)??"Uploading"),y.$set(Ce)},i(ge){$||(X(F.$$.fragment,ge),X(pe),X(he),X(L.$$.fragment,ge),X(y.$$.fragment,ge),$=!0)},o(ge){te(F.$$.fragment,ge),te(pe),te(he),te(L.$$.fragment,ge),te(y.$$.fragment,ge),$=!1},d(ge){ge&&(P(e),P(w),P(D)),ae&&ae.d(),Pe(F),pe&&pe.d(),he&&he.d(),J&&J.d(),ve&&ve.d(),ke&&ke.d(),De&&De.d(),Te&&Te.d(),Oe&&Oe.d(),Le&&Le.d(),Pe(L,ge),Pe(y,ge)}}}async function o_(){await(await fetch("reboot",{method:"POST"})).json()}function s_(t,e,l){let{data:n}=e,{sysinfo:i}=e,o=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price",key:"is"}],a={};Sl.subscribe(j=>{l(3,a=j)});function r(){var j;confirm((((j=a.header)==null?void 0:j.upgrade)??"Upgrade to {0}?").replace("{0}",i.upgrade.n))&&(Gu(i.upgrade.n),pl.update(V=>(V.upgrade.t=i.upgrade.n,V.upgrade.p=0,V.upgrading=!0,V)))}const f=function(){var j;confirm(((j=a.device)==null?void 0:j.reboot_confirm)??"Reboot?")&&(pl.update(V=>(V.booting=!0,V)),o_())};let c,m=[],_=!1,d,v=[],g=!1;_i();let b={hostname:"",ip:""};function k(j){l(8,g=!0);const V=new FormData;V.append("file",v[0]),fetch("configfile",{method:"POST",body:V}).then(H=>H.json()).then(H=>{pl.update(q=>(b&&b.hostname&&(q.hostname=b.hostname),q.booting=H.reboot,b&&b.ip&&(q.net.ip=b.ip),setTimeout(Wn,5e3,i),q))}).catch(H=>{console.error("Error:",H),setTimeout(Wn,5e3,i)})}function M(j){fi[j?"unshift":"push"](()=>{c=j,l(4,c)})}function O(){m=this.files,l(5,m)}const F=()=>{c.click()},I=()=>l(6,_=!0);function T(j){fi[j?"unshift":"push"](()=>{d=j,l(7,d)})}function A(){v=this.files,l(2,v)}const R=()=>{d.click()};return t.$$set=j=>{"data"in j&&l(0,n=j.data),"sysinfo"in j&&l(1,i=j.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&4&&v.length==1){let j=v[0],V=new FileReader,H=q=>{let U=q.target.result.split(` +`);for(let Z in U){let G=U[Z];G.startsWith("hostname ")?b.hostname=G.split(" ")[1]:G.startsWith("ip ")&&(b.ip=G.split(" ")[1])}};V.onload=H,V.readAsText(j)}},[n,i,v,a,c,m,_,d,g,o,r,f,k,M,O,F,I,T,A,R]}class a_ extends Nt{constructor(e){super(),Pt(this,e,s_,i_,St,{data:0,sysinfo:1})}}function gf(t){let e,l,n=Xe(t[0],7)+"",i,o,a=Xe(t[0],5)+"",r,f,c=Xe(t[0],4)+"",m,_,d=Xe(t[0],3)+"",v,g,b,k,M=Xe(t[0],2)+"",O,F,I=Xe(t[0],1)+"",T,A,R=Xe(t[0],0)+"",j,V,H,q,U=Xe(t[0],101)+"",Z,G,Q=Xe(t[0],100)+"",K;return{c(){e=p("optgroup"),l=p("option"),i=S(n),o=p("option"),r=S(a),f=p("option"),m=S(c),_=p("option"),v=S(d),g=h(),b=p("optgroup"),k=p("option"),O=S(M),F=p("option"),T=S(I),A=p("option"),j=S(R),V=h(),H=p("optgroup"),q=p("option"),Z=S(U),G=p("option"),K=S(Q),l.__value=7,z(l,l.__value),o.__value=5,z(o,o.__value),f.__value=4,z(f,f.__value),_.__value=3,z(_,_.__value),u(e,"label","amsleser.no"),k.__value=2,z(k,k.__value),F.__value=1,z(F,F.__value),A.__value=0,z(A,A.__value),u(b,"label","Custom hardware"),q.__value=101,z(q,q.__value),G.__value=100,z(G,G.__value),u(H,"label","Generic hardware")},m(B,W){N(B,e,W),s(e,l),s(l,i),s(e,o),s(o,r),s(e,f),s(f,m),s(e,_),s(_,v),N(B,g,W),N(B,b,W),s(b,k),s(k,O),s(b,F),s(F,T),s(b,A),s(A,j),N(B,V,W),N(B,H,W),s(H,q),s(q,Z),s(H,G),s(G,K)},p(B,W){W&1&&n!==(n=Xe(B[0],7)+"")&&E(i,n),W&1&&a!==(a=Xe(B[0],5)+"")&&E(r,a),W&1&&c!==(c=Xe(B[0],4)+"")&&E(m,c),W&1&&d!==(d=Xe(B[0],3)+"")&&E(v,d),W&1&&M!==(M=Xe(B[0],2)+"")&&E(O,M),W&1&&I!==(I=Xe(B[0],1)+"")&&E(T,I),W&1&&R!==(R=Xe(B[0],0)+"")&&E(j,R),W&1&&U!==(U=Xe(B[0],101)+"")&&E(Z,U),W&1&&Q!==(Q=Xe(B[0],100)+"")&&E(K,Q)},d(B){B&&(P(e),P(g),P(b),P(V),P(H))}}}function kf(t){let e,l,n=Xe(t[0],201)+"",i,o,a=Xe(t[0],202)+"",r,f,c=Xe(t[0],203)+"",m,_,d=Xe(t[0],241)+"",v,g,b=Xe(t[0],242)+"",k,M,O=Xe(t[0],243)+"",F,I,T=Xe(t[0],245)+"",A,R,j=Xe(t[0],200)+"",V;return{c(){e=p("optgroup"),l=p("option"),i=S(n),o=p("option"),r=S(a),f=p("option"),m=S(c),_=p("option"),v=S(d),g=p("option"),k=S(b),M=p("option"),F=S(O),I=p("option"),A=S(T),R=p("option"),V=S(j),l.__value=201,z(l,l.__value),o.__value=202,z(o,o.__value),f.__value=203,z(f,f.__value),_.__value=241,z(_,_.__value),g.__value=242,z(g,g.__value),M.__value=243,z(M,M.__value),I.__value=245,z(I,I.__value),R.__value=200,z(R,R.__value),u(e,"label","Generic hardware")},m(H,q){N(H,e,q),s(e,l),s(l,i),s(e,o),s(o,r),s(e,f),s(f,m),s(e,_),s(_,v),s(e,g),s(g,k),s(e,M),s(M,F),s(e,I),s(I,A),s(e,R),s(R,V)},p(H,q){q&1&&n!==(n=Xe(H[0],201)+"")&&E(i,n),q&1&&a!==(a=Xe(H[0],202)+"")&&E(r,a),q&1&&c!==(c=Xe(H[0],203)+"")&&E(m,c),q&1&&d!==(d=Xe(H[0],241)+"")&&E(v,d),q&1&&b!==(b=Xe(H[0],242)+"")&&E(k,b),q&1&&O!==(O=Xe(H[0],243)+"")&&E(F,O),q&1&&T!==(T=Xe(H[0],245)+"")&&E(A,T),q&1&&j!==(j=Xe(H[0],200)+"")&&E(V,j)},d(H){H&&P(e)}}}function wf(t){let e,l,n=Xe(t[0],7)+"",i,o,a=Xe(t[0],6)+"",r,f,c=Xe(t[0],5)+"",m,_,d,v,g=Xe(t[0],51)+"",b,k,M=Xe(t[0],50)+"",O;return{c(){e=p("optgroup"),l=p("option"),i=S(n),o=p("option"),r=S(a),f=p("option"),m=S(c),_=h(),d=p("optgroup"),v=p("option"),b=S(g),k=p("option"),O=S(M),l.__value=7,z(l,l.__value),o.__value=6,z(o,o.__value),f.__value=5,z(f,f.__value),u(e,"label","amsleser.no"),v.__value=51,z(v,v.__value),k.__value=50,z(k,k.__value),u(d,"label","Generic hardware")},m(F,I){N(F,e,I),s(e,l),s(l,i),s(e,o),s(o,r),s(e,f),s(f,m),N(F,_,I),N(F,d,I),s(d,v),s(v,b),s(d,k),s(k,O)},p(F,I){I&1&&n!==(n=Xe(F[0],7)+"")&&E(i,n),I&1&&a!==(a=Xe(F[0],6)+"")&&E(r,a),I&1&&c!==(c=Xe(F[0],5)+"")&&E(m,c),I&1&&g!==(g=Xe(F[0],51)+"")&&E(b,g),I&1&&M!==(M=Xe(F[0],50)+"")&&E(O,M)},d(F){F&&(P(e),P(_),P(d))}}}function Cf(t){let e,l,n=Xe(t[0],8)+"",i,o,a,r,f=Xe(t[0],71)+"",c,m,_=Xe(t[0],70)+"",d;return{c(){e=p("optgroup"),l=p("option"),i=S(n),o=h(),a=p("optgroup"),r=p("option"),c=S(f),m=p("option"),d=S(_),l.__value=8,z(l,l.__value),u(e,"label","Custom hardware"),r.__value=71,z(r,r.__value),m.__value=70,z(m,m.__value),u(a,"label","Generic hardware")},m(v,g){N(v,e,g),s(e,l),s(l,i),N(v,o,g),N(v,a,g),s(a,r),s(r,c),s(a,m),s(m,d)},p(v,g){g&1&&n!==(n=Xe(v[0],8)+"")&&E(i,n),g&1&&f!==(f=Xe(v[0],71)+"")&&E(c,f),g&1&&_!==(_=Xe(v[0],70)+"")&&E(d,_)},d(v){v&&(P(e),P(o),P(a))}}}function Sf(t){let e,l,n=Xe(t[0],200)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=S(n),l.__value=200,z(l,l.__value),u(e,"label","Generic hardware")},m(o,a){N(o,e,a),s(e,l),s(l,i)},p(o,a){a&1&&n!==(n=Xe(o[0],200)+"")&&E(i,n)},d(o){o&&P(e)}}}function Mf(t){let e,l,n=Xe(t[0],80)+"",i;return{c(){e=p("optgroup"),l=p("option"),i=S(n),l.__value=80,z(l,l.__value),u(e,"label","Generic hardware")},m(o,a){N(o,e,a),s(e,l),s(l,i)},p(o,a){a&1&&n!==(n=Xe(o[0],80)+"")&&E(i,n)},d(o){o&&P(e)}}}function f_(t){let e,l,n,i,o,a,r,f,c=t[0]=="esp8266"&&gf(t),m=t[0]=="esp32"&&kf(t),_=t[0]=="esp32s2"&&wf(t),d=t[0]=="esp32c3"&&Cf(t),v=t[0]=="esp32solo"&&Sf(t),g=t[0]=="esp32s3"&&Mf(t);return{c(){e=p("option"),l=h(),c&&c.c(),n=h(),m&&m.c(),i=h(),_&&_.c(),o=h(),d&&d.c(),a=h(),v&&v.c(),r=h(),g&&g.c(),f=yt(),e.__value=-1,z(e,e.__value)},m(b,k){N(b,e,k),N(b,l,k),c&&c.m(b,k),N(b,n,k),m&&m.m(b,k),N(b,i,k),_&&_.m(b,k),N(b,o,k),d&&d.m(b,k),N(b,a,k),v&&v.m(b,k),N(b,r,k),g&&g.m(b,k),N(b,f,k)},p(b,[k]){b[0]=="esp8266"?c?c.p(b,k):(c=gf(b),c.c(),c.m(n.parentNode,n)):c&&(c.d(1),c=null),b[0]=="esp32"?m?m.p(b,k):(m=kf(b),m.c(),m.m(i.parentNode,i)):m&&(m.d(1),m=null),b[0]=="esp32s2"?_?_.p(b,k):(_=wf(b),_.c(),_.m(o.parentNode,o)):_&&(_.d(1),_=null),b[0]=="esp32c3"?d?d.p(b,k):(d=Cf(b),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null),b[0]=="esp32solo"?v?v.p(b,k):(v=Sf(b),v.c(),v.m(r.parentNode,r)):v&&(v.d(1),v=null),b[0]=="esp32s3"?g?g.p(b,k):(g=Mf(b),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i:He,o:He,d(b){b&&(P(e),P(l),P(n),P(i),P(o),P(a),P(r),P(f)),c&&c.d(b),m&&m.d(b),_&&_.d(b),d&&d.d(b),v&&v.d(b),g&&g.d(b)}}}function u_(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class r_ extends Nt{constructor(e){super(),Pt(this,e,u_,f_,St,{chip:0})}}function Pf(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){N(l,e,n)},d(l){l&&P(e)}}}function Nf(t){let e,l,n,i,o,a,r;return a=new ji({props:{chip:t[0].chip}}),{c(){e=p("div"),l=S("HAN GPIO"),n=p("br"),i=h(),o=p("select"),Ne(a.$$.fragment),u(o,"name","vh"),u(o,"class","in-s"),u(e,"class","my-3")},m(f,c){N(f,e,c),s(e,l),s(e,n),s(e,i),s(e,o),Me(a,o,null),r=!0},p(f,c){const m={};c&1&&(m.chip=f[0].chip),a.$set(m)},i(f){r||(X(a.$$.fragment,f),r=!0)},o(f){te(a.$$.fragment,f),r=!1},d(f){f&&P(e),Pe(a)}}}function c_(t){let e,l,n,i,o,a,r,f,c,m,_,d,v,g,b,k,M,O,F,I,T,A,R,j,V,H,q,U,Z,G=t[0].usrcfg&&Pf();g=new r_({props:{chip:t[0].chip}});let Q=t[0].board&&t[0].board>20&&Nf(t);return H=new ml({props:{active:t[1],message:"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("input"),o=h(),a=p("strong"),a.textContent="Initial configuration",r=h(),G&&G.c(),f=h(),c=p("div"),m=S("Board type"),_=p("br"),d=h(),v=p("select"),Ne(g.$$.fragment),b=h(),Q&&Q.c(),k=h(),M=p("div"),O=p("label"),F=p("input"),I=S(" Clear all other configuration"),T=h(),A=p("div"),A.innerHTML='',R=h(),j=p("span"),j.textContent=" ",V=h(),Ne(H.$$.fragment),u(i,"type","hidden"),u(i,"name","v"),i.value="true",u(a,"class","text-sm"),u(v,"name","vb"),u(v,"class","in-s"),t[0].board===void 0&&At(()=>t[5].call(v)),u(c,"class","my-3"),u(F,"type","checkbox"),u(F,"name","vr"),F.__value="true",z(F,F.__value),u(F,"class","rounded mb-1"),u(M,"class","my-3"),u(A,"class","my-3"),u(j,"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(K,B){N(K,e,B),s(e,l),s(l,n),s(n,i),s(n,o),s(n,a),s(n,r),G&&G.m(n,null),s(n,f),s(n,c),s(c,m),s(c,_),s(c,d),s(c,v),Me(g,v,null),ze(v,t[0].board,!0),s(n,b),Q&&Q.m(n,null),s(n,k),s(n,M),s(M,O),s(O,F),F.checked=t[2],s(O,I),s(n,T),s(n,A),s(n,R),s(n,j),N(K,V,B),Me(H,K,B),q=!0,U||(Z=[re(v,"change",t[5]),re(F,"change",t[6]),re(n,"submit",mn(t[3]))],U=!0)},p(K,[B]){K[0].usrcfg?G||(G=Pf(),G.c(),G.m(n,f)):G&&(G.d(1),G=null);const W={};B&1&&(W.chip=K[0].chip),g.$set(W),B&1&&ze(v,K[0].board),K[0].board&&K[0].board>20?Q?(Q.p(K,B),B&1&&X(Q,1)):(Q=Nf(K),Q.c(),X(Q,1),Q.m(n,k)):Q&&(_t(),te(Q,1,1,()=>{Q=null}),mt()),B&4&&(F.checked=K[2]);const ie={};B&2&&(ie.active=K[1]),H.$set(ie)},i(K){q||(X(g.$$.fragment,K),X(Q),X(H.$$.fragment,K),q=!0)},o(K){te(g.$$.fragment,K),te(Q),te(H.$$.fragment,K),q=!1},d(K){K&&(P(e),P(V)),G&&G.d(),Pe(g),Q&&Q.d(),Pe(H,K),U=!1,Ht(Z)}}}function __(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,o=!1;async function a(m){l(1,o=!0);const _=new FormData(m.target),d=new URLSearchParams;for(let b of _){const[k,M]=b;d.append(k,M)}let g=await(await fetch("save",{method:"POST",body:d})).json();l(1,o=!1),pl.update(b=>(b.vndcfg=g.success,b.booting=g.reboot,b.if.eth=b.boardType>240&&b.boardType<250,b)),nn(n+(i.usrcfg?"":"setup"))}let r=!0;pl.subscribe(m=>{l(0,i=m),m.fwconsent===1&&l(2,r=!i.usrcfg)});function f(){i.board=Kt(this),l(0,i)}function c(){r=this.checked,l(2,r)}return t.$$set=m=>{"basepath"in m&&l(4,n=m.basepath),"sysinfo"in m&&l(0,i=m.sysinfo)},[i,o,r,a,n,f,c]}class m_ extends Nt{constructor(e){super(),Pt(this,e,__,c_,St,{basepath:4,sysinfo:0})}}function Tf(t,e,l){const n=t.slice();return n[13]=e[l],n}function qf(t){var i,o;let e,l=(((o=(i=t[1].conf)==null?void 0:i.connection)==null?void 0:o.eth)??"Ethernet")+"",n;return{c(){e=p("option"),n=S(l),e.__value=3,z(e,e.__value)},m(a,r){N(a,e,r),s(e,n)},p(a,r){var f,c;r&2&&l!==(l=(((c=(f=a[1].conf)==null?void 0:f.connection)==null?void 0:c.eth)??"Ethernet")+"")&&E(n,l)},d(a){a&&P(e)}}}function Ef(t){var j,V,H,q;let e,l=(((V=(j=t[1].conf)==null?void 0:j.connection)==null?void 0:V.ssid)??"SSID")+"",n,i,o,a,r,f,c,m,_,d,v=(((q=(H=t[1].conf)==null?void 0:H.connection)==null?void 0:q.psk)??"Password")+"",g,b,k,M,O,F,I;function T(U,Z){return U[2]?d_:p_}let A=T(t),R=A(t);return{c(){e=p("div"),n=S(l),i=h(),o=p("label"),a=p("input"),r=S(" manual"),f=h(),c=p("br"),m=h(),R.c(),_=h(),d=p("div"),g=S(v),b=p("br"),k=h(),M=p("input"),u(a,"type","checkbox"),a.__value="true",z(a,a.__value),u(a,"class","rounded mb-1"),u(o,"class","float-right mr-3"),u(e,"class","my-3"),u(M,"name","sp"),u(M,"type","password"),u(M,"pattern",Pn),u(M,"class","in-s"),u(M,"autocomplete","off"),M.required=O=t[5]==2,u(d,"class","my-3")},m(U,Z){N(U,e,Z),s(e,n),s(e,i),s(e,o),s(o,a),a.checked=t[2],s(o,r),s(e,f),s(e,c),s(e,m),R.m(e,null),N(U,_,Z),N(U,d,Z),s(d,g),s(d,b),s(d,k),s(d,M),F||(I=re(a,"change",t[9]),F=!0)},p(U,Z){var G,Q,K,B;Z&2&&l!==(l=(((Q=(G=U[1].conf)==null?void 0:G.connection)==null?void 0:Q.ssid)??"SSID")+"")&&E(n,l),Z&4&&(a.checked=U[2]),A===(A=T(U))&&R?R.p(U,Z):(R.d(1),R=A(U),R&&(R.c(),R.m(e,null))),Z&2&&v!==(v=(((B=(K=U[1].conf)==null?void 0:K.connection)==null?void 0:B.psk)??"Password")+"")&&E(g,v),Z&32&&O!==(O=U[5]==2)&&(M.required=O)},d(U){U&&(P(e),P(_),P(d)),R.d(),F=!1,I()}}}function p_(t){var a,r;let e,l,n,i=((a=t[3])==null?void 0:a.c)==-1&&Df(),o=((r=t[3])==null?void 0:r.n)&&Af(t);return{c(){e=p("select"),i&&i.c(),l=yt(),o&&o.c(),u(e,"name","ss"),u(e,"class","in-s"),e.required=n=t[5]==1||t[5]==2},m(f,c){N(f,e,c),i&&i.m(e,null),s(e,l),o&&o.m(e,null)},p(f,c){var m,_;((m=f[3])==null?void 0:m.c)==-1?i||(i=Df(),i.c(),i.m(e,l)):i&&(i.d(1),i=null),(_=f[3])!=null&&_.n?o?o.p(f,c):(o=Af(f),o.c(),o.m(e,null)):o&&(o.d(1),o=null),c&32&&n!==(n=f[5]==1||f[5]==2)&&(e.required=n)},d(f){f&&P(e),i&&i.d(),o&&o.d()}}}function d_(t){let e,l;return{c(){e=p("input"),u(e,"name","ss"),u(e,"type","text"),u(e,"pattern",Pn),u(e,"class","in-s"),e.required=l=t[5]==1||t[5]==2},m(n,i){N(n,e,i)},p(n,i){i&32&&l!==(l=n[5]==1||n[5]==2)&&(e.required=l)},d(n){n&&P(e)}}}function Df(t){let e;return{c(){e=p("option"),e.textContent="Scanning...",e.__value="",z(e,e.__value),e.selected=!0,e.disabled=!0},m(l,n){N(l,e,n)},d(l){l&&P(e)}}}function Af(t){var i;let e,l=at((i=t[3])==null?void 0:i.n),n=[];for(let o=0;ot[8].call(b)),u(m,"class","my-3"),u(U,"name","sh"),u(U,"type","text"),u(U,"class","in-s"),u(U,"maxlength","32"),u(U,"pattern",Vn),u(U,"placeholder","Optional, ex.: ams-reader"),u(U,"autocomplete","off"),u(K,"type","checkbox"),u(K,"name","sm"),K.__value="static",z(K,K.__value),u(K,"class","rounded mb-1"),u(G,"class","my-3"),u(fe,"type","submit"),u(fe,"class","btn-pri"),u(ue,"class","my-3"),u(l,"class","cnt"),u(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Ee,Ie){N(Ee,e,Ie),s(e,l),s(l,n),s(n,i),s(n,o),s(n,a),s(a,f),s(n,c),s(n,m),s(m,d),s(m,v),s(m,g),s(m,b),s(b,k),s(k,O),s(b,F),s(F,T),C&&C.m(b,null),ze(b,t[5],!0),s(n,A),w&&w.m(n,null),s(n,R),s(n,j),s(j,H),s(j,q),s(j,U),z(U,t[0].hostname),s(n,Z),s(n,G),s(G,Q),s(Q,K),K.checked=t[4],s(Q,B),s(Q,ie),s(G,ee),L&&L.m(G,null),s(n,Y),D&&D.m(n,null),s(n,le),s(n,ue),s(ue,fe),s(fe,de),N(Ee,oe,Ie),Me(_e,Ee,Ie),se=!0,me||(we=[re(b,"change",t[8]),re(U,"input",t[10]),re(K,"change",t[11]),re(n,"submit",mn(t[7]))],me=!0)},p(Ee,[Ie]){var kt,xe,ft,wt,dt,ut,nt,ht,Ot,Je,Re,Be;(!se||Ie&2)&&r!==(r=(((kt=Ee[1].setup)==null?void 0:kt.title)??"Setup")+"")&&E(f,r),(!se||Ie&2)&&_!==(_=(((ft=(xe=Ee[1].conf)==null?void 0:xe.connection)==null?void 0:ft.title)??"Connection")+"")&&E(d,_),(!se||Ie&2)&&M!==(M=(((dt=(wt=Ee[1].conf)==null?void 0:wt.connection)==null?void 0:dt.wifi)??"Connect to WiFi")+"")&&E(O,M),(!se||Ie&2)&&I!==(I=(((nt=(ut=Ee[1].conf)==null?void 0:ut.connection)==null?void 0:nt.ap)??"Standalone access point")+"")&&E(T,I),Ee[0].if&&Ee[0].if.eth?C?C.p(Ee,Ie):(C=qf(Ee),C.c(),C.m(b,null)):C&&(C.d(1),C=null),Ie&32&&ze(b,Ee[5]),Ee[5]==1||Ee[5]==2?w?w.p(Ee,Ie):(w=Ef(Ee),w.c(),w.m(n,R)):w&&(w.d(1),w=null),(!se||Ie&2)&&V!==(V=(((Ot=(ht=Ee[1].conf)==null?void 0:ht.general)==null?void 0:Ot.hostname)??"Hostname")+"")&&E(H,V),Ie&1&&U.value!==Ee[0].hostname&&z(U,Ee[0].hostname),Ie&16&&(K.checked=Ee[4]),(!se||Ie&2)&&W!==(W=(((Je=Ee[1].setup)==null?void 0:Je.static)??"Static IP")+"")&&E(ie,W),Ee[4]?L?(L.p(Ee,Ie),Ie&16&&X(L,1)):(L=Lf(Ee),L.c(),X(L,1),L.m(G,null)):L&&(_t(),te(L,1,1,()=>{L=null}),mt()),Ee[4]?D?D.p(Ee,Ie):(D=If(Ee),D.c(),D.m(n,le)):D&&(D.d(1),D=null),(!se||Ie&2)&&ne!==(ne=(((Re=Ee[1].btn)==null?void 0:Re.save)??"Save")+"")&&E(de,ne);const Ze={};Ie&64&&(Ze.active=Ee[6]),Ie&2&&(Ze.message=((Be=Ee[1].setup)==null?void 0:Be.mask)??"Saving"),_e.$set(Ze)},i(Ee){se||(X(L),X(_e.$$.fragment,Ee),se=!0)},o(Ee){te(L),te(_e.$$.fragment,Ee),se=!1},d(Ee){Ee&&(P(e),P(oe)),C&&C.d(),w&&w.d(),L&&L.d(),D&&D.d(),Pe(_e,Ee),me=!1,Ht(we)}}}function v_(t,e,l){let n={};Sl.subscribe(k=>{l(1,n=k)});let i=!1,o={};xi.subscribe(k=>{l(3,o=k)});let{sysinfo:a={}}=e,r=!1,f=1,c=!1;function m(k){pl.update(M=>(M.trying=k,M))}async function _(k){l(6,c=!0);const M=new FormData(k.target),O=new URLSearchParams;for(let T of M){const[A,R]=T;O.append(A,R)}let I=await(await fetch("save",{method:"POST",body:O})).json();l(6,c=!1),pl.update(T=>(T.hostname=M.get("sh"),T.usrcfg=I.success,T.booting=I.reboot,r&&(T.net.ip=M.get("si"),T.net.mask=M.get("su"),T.net.gw=M.get("sg"),T.net.dns1=M.get("sd")),I.reboot&&setTimeout(Wn,5e3,a,m),T))}function d(){f=Kt(this),l(5,f)}function v(){i=this.checked,l(2,i)}function g(){a.hostname=this.value,l(0,a)}function b(){r=this.checked,l(4,r)}return t.$$set=k=>{"sysinfo"in k&&l(0,a=k.sysinfo)},[a,n,i,o,r,f,c,_,d,v,g,b]}class b_ extends Nt{constructor(e){super(),Pt(this,e,v_,h_,St,{sysinfo:0})}}function g_(t){var H,q,U,Z;let e,l,n,i=(((H=t[2].upload)==null?void 0:H.title)??"Upload")+"",o,a,r,f,c,m=(((q=t[2].upload)==null?void 0:q.desc)??"")+"",_,d,v,g,b,k,M,O,F=(((U=t[2].btn)==null?void 0:U.upload)??"Upload")+"",I,T,A,R,j,V;return A=new ml({props:{active:t[3],message:((Z=t[2].upload)==null?void 0:Z.mask)??"Uploading"}}),{c(){e=p("div"),l=p("div"),n=p("strong"),o=S(i),a=h(),r=S(t[1]),f=h(),c=p("p"),_=S(m),d=h(),v=p("form"),g=p("input"),b=h(),k=p("div"),M=p("button"),O=p("p"),I=S(F),T=h(),Ne(A.$$.fragment),u(c,"class","mb-4"),u(g,"name","file"),u(g,"type","file"),u(O,"class","mb-4"),u(M,"type","submit"),u(M,"class","btn-pri"),u(k,"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,Q){N(G,e,Q),s(e,l),s(l,n),s(n,o),s(n,a),s(n,r),s(l,f),s(l,c),s(c,_),s(l,d),s(l,v),s(v,g),s(v,b),s(v,k),s(k,M),s(M,O),s(O,I),N(G,T,Q),Me(A,G,Q),R=!0,j||(V=re(v,"submit",t[4]),j=!0)},p(G,[Q]){var B,W,ie,ee;(!R||Q&4)&&i!==(i=(((B=G[2].upload)==null?void 0:B.title)??"Upload")+"")&&E(o,i),(!R||Q&2)&&E(r,G[1]),(!R||Q&4)&&m!==(m=(((W=G[2].upload)==null?void 0:W.desc)??"")+"")&&E(_,m),(!R||Q&4)&&F!==(F=(((ie=G[2].btn)==null?void 0:ie.upload)??"Upload")+"")&&E(I,F),(!R||Q&1)&&u(v,"action",G[0]);const K={};Q&8&&(K.active=G[3]),Q&4&&(K.message=((ee=G[2].upload)==null?void 0:ee.mask)??"Uploading"),A.$set(K)},i(G){R||(X(A.$$.fragment,G),R=!0)},o(G){te(A.$$.fragment,G),R=!1},d(G){G&&(P(e),P(T)),Pe(A,G),j=!1,V()}}}function k_(t,e,l){let{action:n}=e,{title:i}=e,o={};Sl.subscribe(f=>{l(2,o=f)});let a=!1;const r=()=>l(3,a=!0);return t.$$set=f=>{"action"in f&&l(0,n=f.action),"title"in f&&l(1,i=f.title)},[n,i,o,a,r]}class io extends Nt{constructor(e){super(),Pt(this,e,k_,g_,St,{action:0,title:1})}}function w_(t){var _e,se,me,we,C,w,L;let e,l,n,i,o=(((_e=t[1].consent)==null?void 0:_e.title)??"Consents")+"",a,r,f,c,m,_=(((se=t[1].consent)==null?void 0:se.one_click)??"One-click")+"",d,v,g,b,k=(((me=t[1].consent)==null?void 0:me.read_more)??"Read more")+"",M,O,F,I,T,A,R,j=(((we=t[1].consent)==null?void 0:we.yes)??"Yes")+"",V,H,q,U,Z,G,Q=(((C=t[1].consent)==null?void 0:C.no)??"No")+"",K,B,W,ie,ee,Y=(((w=t[1].btn)==null?void 0:w.save)??"Save")+"",le,ue,fe,ne,de,oe;return fe=new ml({props:{active:t[2],message:((L=t[1].consent)==null?void 0:L.mask_saving)??"Saving"}}),{c(){e=p("div"),l=p("div"),n=p("form"),i=p("div"),a=S(o),r=h(),f=p("hr"),c=h(),m=p("div"),d=S(_),v=p("br"),g=h(),b=p("a"),M=S(k),O=p("br"),F=h(),I=p("label"),T=p("input"),R=h(),V=S(j),H=h(),q=p("label"),U=p("input"),G=h(),K=S(Q),B=p("br"),W=h(),ie=p("div"),ee=p("button"),le=S(Y),ue=h(),Ne(fe.$$.fragment),u(b,"href",hl("Data-collection-on-one-click-firmware-upgrade")),u(b,"target","_blank"),u(b,"class","text-blue-600 hover:text-blue-800"),u(T,"type","radio"),u(T,"name","sf"),T.value=1,T.checked=A=t[0].fwconsent===1,u(T,"class","rounded m-2"),T.required=!0,u(U,"type","radio"),u(U,"name","sf"),U.value=2,U.checked=Z=t[0].fwconsent===2,u(U,"class","rounded m-2"),U.required=!0,u(m,"class","my-3"),u(ee,"type","submit"),u(ee,"class","btn-pri"),u(ie,"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,y){N(D,e,y),s(e,l),s(l,n),s(n,i),s(i,a),s(n,r),s(n,f),s(n,c),s(n,m),s(m,d),s(m,v),s(m,g),s(m,b),s(b,M),s(m,O),s(m,F),s(m,I),s(I,T),s(I,R),s(I,V),s(m,H),s(m,q),s(q,U),s(q,G),s(q,K),s(m,B),s(n,W),s(n,ie),s(ie,ee),s(ee,le),N(D,ue,y),Me(fe,D,y),ne=!0,de||(oe=re(n,"submit",mn(t[3])),de=!0)},p(D,[y]){var ae,pe,he,J,ve,ke,De;(!ne||y&2)&&o!==(o=(((ae=D[1].consent)==null?void 0:ae.title)??"Consents")+"")&&E(a,o),(!ne||y&2)&&_!==(_=(((pe=D[1].consent)==null?void 0:pe.one_click)??"One-click")+"")&&E(d,_),(!ne||y&2)&&k!==(k=(((he=D[1].consent)==null?void 0:he.read_more)??"Read more")+"")&&E(M,k),(!ne||y&1&&A!==(A=D[0].fwconsent===1))&&(T.checked=A),(!ne||y&2)&&j!==(j=(((J=D[1].consent)==null?void 0:J.yes)??"Yes")+"")&&E(V,j),(!ne||y&1&&Z!==(Z=D[0].fwconsent===2))&&(U.checked=Z),(!ne||y&2)&&Q!==(Q=(((ve=D[1].consent)==null?void 0:ve.no)??"No")+"")&&E(K,Q),(!ne||y&2)&&Y!==(Y=(((ke=D[1].btn)==null?void 0:ke.save)??"Save")+"")&&E(le,Y);const $={};y&4&&($.active=D[2]),y&2&&($.message=((De=D[1].consent)==null?void 0:De.mask_saving)??"Saving"),fe.$set($)},i(D){ne||(X(fe.$$.fragment,D),ne=!0)},o(D){te(fe.$$.fragment,D),ne=!1},d(D){D&&(P(e),P(ue)),Pe(fe,D),de=!1,oe()}}}function C_(t,e,l){let{basepath:n="/"}=e,{sysinfo:i={}}=e,o={};Sl.subscribe(f=>{l(1,o=f)});let a=!1;async function r(f){l(2,a=!0);const c=new FormData(f.target),m=new URLSearchParams;for(let v of c){const[g,b]=v;m.append(g,b)}let d=await(await fetch("save",{method:"POST",body:m})).json();l(2,a=!1),pl.update(v=>(v.fwconsent=c.sf===!0?1:c.sf===!1?2:0,v.booting=d.reboot,v)),nn(n)}return t.$$set=f=>{"basepath"in f&&l(4,n=f.basepath),"sysinfo"in f&&l(0,i=f.sysinfo)},[i,o,a,r,n]}class S_ extends Nt{constructor(e){super(),Pt(this,e,C_,w_,St,{basepath:4,sysinfo:0})}}function Rf(t,e,l){const n=t.slice();return n[30]=e[l],n[31]=e,n[32]=l,n}function Ff(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function M_(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Bf(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 Uf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function jf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function zf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function Hf(t,e,l){const n=t.slice();return n[33]=e[l],n[35]=l,n}function yf(t){let e,l=at(t[1].o),n=[];for(let i=0;i0?"text-green-600":"text-gray-300"),u(Ze,"class",xe=t[32]{l(0,i=B)});let o=["mo","tu","we","th","fr","sa","su"],a={},r=!0,f=!1;Qu.subscribe(B=>{B.o&&(l(1,a=B),l(2,r=!1))}),a0();async function c(B){l(3,f=!0);const W=new URLSearchParams;W.append("r","true"),W.append("rc",a.o.length),a.o.forEach(function(ee,Y){W.append("rt"+Y,ee.t),W.append("rn"+Y,ee.n),W.append("rd"+Y,ee.d),W.append("ra"+Y,ee.a),W.append("rh"+Y,ee.h),W.append("rv"+Y,ee.v),W.append("rsm"+Y,ee.s.m),W.append("rsd"+Y,ee.s.d),W.append("rem"+Y,ee.e.m),W.append("red"+Y,ee.e.d)}),await(await fetch("save",{method:"POST",body:W})).json(),l(3,f=!1),nn(n+"configuration")}let m=function(B,W){return B.includes(W)?B=B.filter(function(ie){return ie!==W}):B.push(W),B},_=function(){let B=a.o;B.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.001,s:{m:0,d:0},e:{m:0,d:0}}),l(1,a.o=B,a)},d=function(B){let W=a.o;W.splice(B,1),l(1,a.o=W,a)},v=function(B){if(B<=0)return;let W=a.o;var ie=W[B];W[B]=W[B-1],W[B-1]=ie,l(1,a.o=W,a)},g=function(B){let W=a.o;if(!(B>=W.length-1)){var ie=W[B];W[B]=W[B+1],W[B+1]=ie,l(1,a.o=W,a)}};function b(B,W){B[W].n=this.value,l(1,a)}function k(B,W){B[W].d=Kt(this),l(1,a)}function M(B,W){B[W].t=Kt(this),l(1,a)}function O(B,W){B[W].v=Fe(this.value),l(1,a)}const F=(B,W,ie,ee)=>l(1,ie[ee].a=m(B.a,W),a),I=(B,W,ie,ee)=>l(1,ie[ee].h=m(B.h,W),a),T=(B,W,ie,ee)=>l(1,ie[ee].h=m(B.h,W+8),a),A=(B,W,ie,ee)=>l(1,ie[ee].h=m(B.h,W+16),a);function R(B,W){B[W].s.d=Kt(this),l(1,a)}function j(B,W){B[W].s.m=Kt(this),l(1,a)}function V(B,W){B[W].e.d=Kt(this),l(1,a)}function H(B,W){B[W].e.m=Kt(this),l(1,a)}const q=B=>v(B),U=B=>v(B),Z=B=>g(B),G=B=>g(B),Q=B=>d(B),K=B=>d(B);return t.$$set=B=>{"basepath"in B&&l(11,n=B.basepath)},[i,a,r,f,o,c,m,_,d,v,g,n,b,k,M,O,F,I,T,A,R,j,V,H,q,U,Z,G,Q,K]}class D_ extends Nt{constructor(e){super(),Pt(this,e,E_,q_,St,{basepath:11},null,[-1,-1])}}function Zf(t,e,l){const n=t.slice();return n[13]=e[l],n[14]=e,n[15]=l,n}function Jf(t,e,l){const n=t.slice();return n[13]=e[l],n[16]=e,n[17]=l,n}function $f(t){let e,l,n,i=at(t[1]),o=[];for(let a=0;a{l(3,r=k)});let f=!1,c,m;async function _(){if(confirm("Clear all data?"))for(let k in i)(k.startsWith("i")||k.startsWith("e"))&&l(0,i[k]=0,i)}let d=!1;async function v(k){l(5,d=!0);const M=new FormData(k.target),O=new URLSearchParams;for(let I of M){const[T,A]=I;O.append(T,A)}await(await fetch(o,{method:"POST",body:O})).json(),l(5,d=!1),nn(a)}function g(k){i[k.key]=Fe(this.value),l(0,i)}function b(k){i[k.key]=Fe(this.value),l(0,i)}return t.$$set=k=>{"prefix"in k&&l(8,n=k.prefix),"data"in k&&l(0,i=k.data),"url"in k&&l(9,o=k.url),"basepath"in k&&l(10,a=k.basepath)},t.$$.update=()=>{if(t.$$.dirty&263){l(1,c=[]),l(2,m=[]);for(let k in i){let M=[];k.startsWith("i")?M=c:k.startsWith("e")&&(M=m,i[k]&&l(4,f=!0)),M.push({key:k,name:n+" "+k.substring(1),value:i[k]})}}},[i,c,m,r,f,d,_,v,n,o,a,g,b]}class Ju extends Nt{constructor(e){super(),Pt(this,e,O_,A_,St,{prefix:8,data:0,url:9,basepath:10})}}function L_(t){let e,l;return e=new o0({props:{data:t[7],sysinfo:t[8],importPrices:t[1],exportPrices:t[2],dayPlot:t[3],monthPlot:t[4],temperatures:t[5],translations:t[6],tariffData:t[9]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&128&&(o.data=n[7]),i&256&&(o.sysinfo=n[8]),i&2&&(o.importPrices=n[1]),i&4&&(o.exportPrices=n[2]),i&8&&(o.dayPlot=n[3]),i&16&&(o.monthPlot=n[4]),i&32&&(o.temperatures=n[5]),i&64&&(o.translations=n[6]),i&512&&(o.tariffData=n[9]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function I_(t){let e,l;return e=new X0({props:{sysinfo:t[8],basepath:t[0],data:t[7]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.sysinfo=n[8]),i&1&&(o.basepath=n[0]),i&128&&(o.data=n[7]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function R_(t){let e,l;return e=new D_({props:{basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function F_(t){let e,l;return e=new a_({props:{sysinfo:t[8],data:t[7]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.sysinfo=n[8]),i&128&&(o.data=n[7]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function B_(t){let e,l;return e=new io({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p:He,i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function U_(t){let e,l;return e=new io({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p:He,i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function j_(t){let e,l;return e=new io({props:{title:"private key",action:"/mqtt-key"}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p:He,i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function z_(t){let e,l;return e=new S_({props:{sysinfo:t[8],basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.sysinfo=n[8]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function H_(t){let e,l;return e=new b_({props:{sysinfo:t[8]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.sysinfo=n[8]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function y_(t){let e,l;return e=new m_({props:{sysinfo:t[8],basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.sysinfo=n[8]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function W_(t){let e,l;return e=new Ju({props:{prefix:"UTC Hour",data:t[3],url:"/dayplot",basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&8&&(o.data=n[3]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function G_(t){let e,l;return e=new Ju({props:{prefix:"Day",data:t[4],url:"/monthplot",basepath:t[0]}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&16&&(o.data=n[4]),i&1&&(o.basepath=n[0]),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function V_(t){let e,l,n,i,o,a,r,f,c,m,_,d,v,g,b,k,M,O,F,I,T,A,R,j,V,H;return e=new ac({props:{data:t[7],basepath:t[0]}}),n=new wl({props:{path:"/",$$slots:{default:[L_]},$$scope:{ctx:t}}}),o=new wl({props:{path:"/configuration",$$slots:{default:[I_]},$$scope:{ctx:t}}}),r=new wl({props:{path:"/priceconfig",$$slots:{default:[R_]},$$scope:{ctx:t}}}),c=new wl({props:{path:"/status",$$slots:{default:[F_]},$$scope:{ctx:t}}}),_=new wl({props:{path:"/mqtt-ca",$$slots:{default:[B_]},$$scope:{ctx:t}}}),v=new wl({props:{path:"/mqtt-cert",$$slots:{default:[U_]},$$scope:{ctx:t}}}),b=new wl({props:{path:"/mqtt-key",$$slots:{default:[j_]},$$scope:{ctx:t}}}),M=new wl({props:{path:"/consent",$$slots:{default:[z_]},$$scope:{ctx:t}}}),F=new wl({props:{path:"/setup",$$slots:{default:[H_]},$$scope:{ctx:t}}}),T=new wl({props:{path:"/vendor",$$slots:{default:[y_]},$$scope:{ctx:t}}}),R=new wl({props:{path:"/edit-day",$$slots:{default:[W_]},$$scope:{ctx:t}}}),V=new wl({props:{path:"/edit-month",$$slots:{default:[G_]},$$scope:{ctx:t}}}),{c(){Ne(e.$$.fragment),l=h(),Ne(n.$$.fragment),i=h(),Ne(o.$$.fragment),a=h(),Ne(r.$$.fragment),f=h(),Ne(c.$$.fragment),m=h(),Ne(_.$$.fragment),d=h(),Ne(v.$$.fragment),g=h(),Ne(b.$$.fragment),k=h(),Ne(M.$$.fragment),O=h(),Ne(F.$$.fragment),I=h(),Ne(T.$$.fragment),A=h(),Ne(R.$$.fragment),j=h(),Ne(V.$$.fragment)},m(q,U){Me(e,q,U),N(q,l,U),Me(n,q,U),N(q,i,U),Me(o,q,U),N(q,a,U),Me(r,q,U),N(q,f,U),Me(c,q,U),N(q,m,U),Me(_,q,U),N(q,d,U),Me(v,q,U),N(q,g,U),Me(b,q,U),N(q,k,U),Me(M,q,U),N(q,O,U),Me(F,q,U),N(q,I,U),Me(T,q,U),N(q,A,U),Me(R,q,U),N(q,j,U),Me(V,q,U),H=!0},p(q,U){const Z={};U&128&&(Z.data=q[7]),U&1&&(Z.basepath=q[0]),e.$set(Z);const G={};U&5118&&(G.$$scope={dirty:U,ctx:q}),n.$set(G);const Q={};U&4481&&(Q.$$scope={dirty:U,ctx:q}),o.$set(Q);const K={};U&4097&&(K.$$scope={dirty:U,ctx:q}),r.$set(K);const B={};U&4480&&(B.$$scope={dirty:U,ctx:q}),c.$set(B);const W={};U&4096&&(W.$$scope={dirty:U,ctx:q}),_.$set(W);const ie={};U&4096&&(ie.$$scope={dirty:U,ctx:q}),v.$set(ie);const ee={};U&4096&&(ee.$$scope={dirty:U,ctx:q}),b.$set(ee);const Y={};U&4353&&(Y.$$scope={dirty:U,ctx:q}),M.$set(Y);const le={};U&4352&&(le.$$scope={dirty:U,ctx:q}),F.$set(le);const ue={};U&4353&&(ue.$$scope={dirty:U,ctx:q}),T.$set(ue);const fe={};U&4105&&(fe.$$scope={dirty:U,ctx:q}),R.$set(fe);const ne={};U&4113&&(ne.$$scope={dirty:U,ctx:q}),V.$set(ne)},i(q){H||(X(e.$$.fragment,q),X(n.$$.fragment,q),X(o.$$.fragment,q),X(r.$$.fragment,q),X(c.$$.fragment,q),X(_.$$.fragment,q),X(v.$$.fragment,q),X(b.$$.fragment,q),X(M.$$.fragment,q),X(F.$$.fragment,q),X(T.$$.fragment,q),X(R.$$.fragment,q),X(V.$$.fragment,q),H=!0)},o(q){te(e.$$.fragment,q),te(n.$$.fragment,q),te(o.$$.fragment,q),te(r.$$.fragment,q),te(c.$$.fragment,q),te(_.$$.fragment,q),te(v.$$.fragment,q),te(b.$$.fragment,q),te(M.$$.fragment,q),te(F.$$.fragment,q),te(T.$$.fragment,q),te(R.$$.fragment,q),te(V.$$.fragment,q),H=!1},d(q){q&&(P(l),P(i),P(a),P(f),P(m),P(d),P(g),P(k),P(O),P(I),P(A),P(j)),Pe(e,q),Pe(n,q),Pe(o,q),Pe(r,q),Pe(c,q),Pe(_,q),Pe(v,q),Pe(b,q),Pe(M,q),Pe(F,q),Pe(T,q),Pe(R,q),Pe(V,q)}}}function lu(t){let e,l,n,i;const o=[Y_,K_],a=[];function r(f,c){return f[8].trying?0:1}return e=r(t),l=a[e]=o[e](t),{c(){l.c(),n=yt()},m(f,c){a[e].m(f,c),N(f,n,c),i=!0},p(f,c){let m=e;e=r(f),e===m?a[e].p(f,c):(_t(),te(a[m],1,1,()=>{a[m]=null}),mt(),l=a[e],l?l.p(f,c):(l=a[e]=o[e](f),l.c()),X(l,1),l.m(n.parentNode,n))},i(f){i||(X(l),i=!0)},o(f){te(l),i=!1},d(f){f&&P(n),a[e].d(f)}}}function K_(t){let e,l;return e=new ml({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p:He,i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function Y_(t){let e,l;return e=new ml({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[8].trying}}),{c(){Ne(e.$$.fragment)},m(n,i){Me(e,n,i),l=!0},p(n,i){const o={};i&256&&(o.message="Device is booting, please wait. Trying to reach it on "+n[8].trying),e.$set(o)},i(n){l||(X(e.$$.fragment,n),l=!0)},o(n){te(e.$$.fragment,n),l=!1},d(n){Pe(e,n)}}}function Q_(t){let e,l,n,i;l=new qu({props:{basepath:t[0],$$slots:{default:[V_]},$$scope:{ctx:t}}});let o=t[8].booting&&lu(t);return{c(){e=p("div"),Ne(l.$$.fragment),n=h(),o&&o.c(),u(e,"class","container mx-auto m-3")},m(a,r){N(a,e,r),Me(l,e,null),s(e,n),o&&o.m(e,null),i=!0},p(a,[r]){const f={};r&1&&(f.basepath=a[0]),r&5119&&(f.$$scope={dirty:r,ctx:a}),l.$set(f),a[8].booting?o?(o.p(a,r),r&256&&X(o,1)):(o=lu(a),o.c(),X(o,1),o.m(e,null)):o&&(_t(),te(o,1,1,()=>{o=null}),mt())},i(a){i||(X(l.$$.fragment,a),X(o),i=!0)},o(a){te(l.$$.fragment,a),te(o),i=!1},d(a){a&&P(e),Pe(l),o&&o.d()}}}function X_(t,e,l){let n=document.getElementsByTagName("base")[0].getAttribute("href");n||(n="/");let i;Ru.subscribe(b=>{l(1,i=b)});let o;Fu.subscribe(b=>{l(2,o=b)});let a;Uu.subscribe(b=>{l(3,a=b)});let r;ju.subscribe(b=>{l(4,r=b)});let f;zu.subscribe(b=>{l(5,f=b)});let c={};Sl.subscribe(b=>{l(6,c=b)});let m,_={},d={},v;pl.subscribe(b=>{var k;l(8,d=b),d.vndcfg===!1?nn(n+"vendor"):d.usrcfg===!1?nn(n+"setup"):d.fwconsent===0&&nn(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!=((k=c==null?void 0:c.language)==null?void 0:k.code)&&Wu(d.ui.lang),d.version&&v&&d.version!=v&&window.location.reload(),v=d.version,m&&clearTimeout(m),m=setTimeout(_i,!_||!_.u||_.u<30||d!=null&&d.upgrading?1e4:3e5)}),T1.subscribe(b=>{l(7,_=b),Yc(b)});let g={};return yu.subscribe(b=>{l(9,g=b)}),Hu(),[n,i,o,a,r,f,c,_,d,g]}class Z_ extends Nt{constructor(e){super(),Pt(this,e,X_,Q_,St,{})}}new Z_({target:document.getElementById("app")}); diff --git a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte index d802e3fe..76c8a2a8 100644 --- a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte +++ b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte @@ -225,6 +225,10 @@ } } + async function enablePriceFetch() { + configuration.p.e = true; + } + let gpioMax = 44; $: { gpioMax = sysinfo.chip == 'esp8266' ? 16 : sysinfo.chip == 'esp32s2' ? 44 : 39; @@ -272,7 +276,7 @@
{translations.conf?.price?.region ?? "Price region"}
- {#if !configuration.p.t} @@ -761,6 +765,16 @@ {/if} {/if}
+ {#if sysinfo?.features?.includes('zc')} +
+ +
+ {#if configuration.c.ze} +
+ +
+ {/if} + {/if}
{/if} {#if configuration?.p?.r?.startsWith("NO") || configuration?.p?.r?.startsWith("10YNO") || configuration?.p?.r?.startsWith('10Y1001A1001A4')} diff --git a/lib/SvelteUi/app/src/lib/UartSelectOptions.svelte b/lib/SvelteUi/app/src/lib/UartSelectOptions.svelte index 086dfb4c..6f3fa856 100644 --- a/lib/SvelteUi/app/src/lib/UartSelectOptions.svelte +++ b/lib/SvelteUi/app/src/lib/UartSelectOptions.svelte @@ -7,7 +7,7 @@ case 'esp8266': gpioMax = 16; break; case 'esp32s2': gpioMax = 44; break; case 'esp32s3': gpioMax = 46; break; - case 'esp32c3': gpioMax = 19; break; + case 'esp32c3': gpioMax = 21; break; } } @@ -23,4 +23,3 @@ {/if} {/each} - diff --git a/lib/SvelteUi/app/src/lib/VendorPanel.svelte b/lib/SvelteUi/app/src/lib/VendorPanel.svelte index 6243012e..54c47720 100644 --- a/lib/SvelteUi/app/src/lib/VendorPanel.svelte +++ b/lib/SvelteUi/app/src/lib/VendorPanel.svelte @@ -32,10 +32,10 @@ return s; }); - navigate(basepath + (sysinfo.usrcfg ? "/" : "/setup")); + navigate(basepath + (sysinfo.usrcfg ? "" : "setup")); } - let cc = false; + let cc = true; sysinfoStore.subscribe(update => { sysinfo = update; if(update.fwconsent === 1) { diff --git a/lib/SvelteUi/app/translations.json b/lib/SvelteUi/app/translations.json index ab00d2c0..0f2fc9ef 100644 --- a/lib/SvelteUi/app/translations.json +++ b/lib/SvelteUi/app/translations.json @@ -318,7 +318,7 @@ "han" : { "-1" : "Parse error", "-2" : "Incomplete data received", - "-3" : "Payload boundry flag missing", + "-3" : "Payload boundary flag missing", "-4" : "Header checksum error", "-5" : "Footer checksum error", "-9" : "Unknown data received, check meter config", @@ -326,6 +326,7 @@ "-51" : "Authentication failed", "-52" : "Decryption failed", "-53" : "Encryption key invalid", + "89" : "Unrecognized data received from meter", "90" : "No HAN data received for at least 30s", "91" : "Serial break", "92" : "Serial buffer full", diff --git a/lib/SvelteUi/json/conf_cloud.json b/lib/SvelteUi/json/conf_cloud.json index 6aebb9a7..7597ace3 100644 --- a/lib/SvelteUi/json/conf_cloud.json +++ b/lib/SvelteUi/json/conf_cloud.json @@ -1,5 +1,7 @@ "c": { "e" : %s, "p" : %d, - "es": %s + "es": %s, + "ze": %s, + "zt" : "%s" } diff --git a/lib/SvelteUi/src/AmsWebServer.cpp b/lib/SvelteUi/src/AmsWebServer.cpp index 82820ae0..d3ef74e5 100644 --- a/lib/SvelteUi/src/AmsWebServer.cpp +++ b/lib/SvelteUi/src/AmsWebServer.cpp @@ -399,6 +399,10 @@ void AmsWebServer::sysinfoJson() { if(!features.isEmpty()) features += ","; features += "\"cloud\""; #endif + #if defined(ZMART_CHARGE) + if(!features.isEmpty()) features += ","; + features += "\"zc\""; + #endif int size = snprintf_P(buf, BufferSize, SYSINFO_JSON, FirmwareVersion::VersionString, @@ -939,6 +943,9 @@ void AmsWebServer::configurationJson() { config->getHomeAssistantConfig(haconf); CloudConfig cloud; config->getCloudConfig(cloud); + ZmartChargeConfig zcc; + config->getZmartChargeConfig(zcc); + stripNonAscii((uint8_t*) zcc.token, 21); bool qsc = false; bool qsr = false; @@ -1119,10 +1126,12 @@ void AmsWebServer::configurationJson() { cloud.enabled ? "true" : "false", cloud.proto, #if defined(ESP32) && defined(ENERGY_SPEEDOMETER_PASS) - sysConfig.energyspeedometer == 7 ? "true" : "false" + sysConfig.energyspeedometer == 7 ? "true" : "false", #else - "null" + "null", #endif + zcc.enabled ? "true" : "false", + zcc.token ); server.sendContent(buf); server.sendContent_P(PSTR("}")); @@ -1251,9 +1260,6 @@ void AmsWebServer::handleSave() { if(server.hasArg(F("v")) && server.arg(F("v")) == F("true")) { int boardType = server.arg(F("vb")).toInt(); int hanPin = server.arg(F("vh")).toInt(); - if(server.hasArg(F("vr")) && server.arg(F("vr")) == F("true")) { - config->clear(); - } MeterConfig meterConfig; config->getMeterConfig(meterConfig); @@ -1643,6 +1649,16 @@ void AmsWebServer::handleSave() { cloud.enabled = server.hasArg(F("ce")) && server.arg(F("ce")) == F("true"); cloud.proto = server.arg(F("cp")).toInt(); config->setCloudConfig(cloud); + + ZmartChargeConfig zcc; + config->getZmartChargeConfig(zcc); + zcc.enabled = server.hasArg(F("cze")) && server.arg(F("cze")) == F("true"); + String token = server.arg(F("czt")); + strcpy(zcc.token, token.c_str()); + if(server.hasArg(F("czu")) && server.arg(F("czu")).startsWith(F("https"))) { + strcpy(zcc.baseUrl, server.arg(F("czu")).c_str()); + } + config->setZmartChargeConfig(zcc); } if(server.hasArg(F("r")) && server.arg(F("r")) == F("true")) { @@ -1718,7 +1734,10 @@ void AmsWebServer::handleSave() { #endif debugger->printf_P(PSTR("Saving configuration now...\n")); - if (config->save()) { + // If vendor page and clear all config is selected + if(server.hasArg(F("v")) && server.arg(F("v")) == F("true") && server.hasArg(F("vr")) && server.arg(F("vr")) == F("true")) { + config->clear(); + } else if(config->save()) { #if defined(AMS_REMOTE_DEBUG) if (debugger->isActive(RemoteDebug::INFO)) #endif diff --git a/lib/ZmartCharge/include/ZmartChargeCloudConnector.h b/lib/ZmartCharge/include/ZmartChargeCloudConnector.h new file mode 100644 index 00000000..58291bae --- /dev/null +++ b/lib/ZmartCharge/include/ZmartChargeCloudConnector.h @@ -0,0 +1,52 @@ +#pragma once + +#include "RemoteDebug.h" +#include "AmsData.h" +#include "FirmwareVersion.h" + +#if defined(ESP8266) + #include +#elif defined(ESP32) // ARDUINO_ARCH_ESP32 + #include +#else + #warning "Unsupported board type" +#endif + +static const char ZC_LB_JSON[] PROGMEM = "{\"LBToken\":\"%s\",\"L1A\":\"%.1f\",\"L2A\":\"%.1f\",\"L3A\":\"%.1f\",\"HighConsumption\":\"%d\",\"CurrentPower\":\"%d\"}"; + +class ZmartChargeCloudConnector { +public: + ZmartChargeCloudConnector(RemoteDebug* debugger, char* buf) { + this->debugger = debugger; + this->json = buf; + http = new HTTPClient(); + http->setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS); + http->setReuse(false); + http->setTimeout(10000); + http->setUserAgent("ams2mqtt/" + String(FirmwareVersion::VersionString)); + }; + void setup(const char* baseUrl, const char* token); + void update(AmsData& data); + + bool isConfigChanged(); + void ackConfigChanged(); + + const char* getBaseUrl(); + +private: + RemoteDebug* debugger; + char baseUrl[64]; + char token[21]; + uint16_t BufferSize = 2048; + char* json; + + bool configChanged = false; + + bool lastFailed = false; + uint64_t lastUpdate = 0; + HTTPClient* http = NULL; + + uint16_t heartbeat = 30; + uint16_t heartbeatFast = 10; + uint16_t heartbeatFastThreshold = 32; +}; \ No newline at end of file diff --git a/lib/ZmartCharge/src/ZmartChargeCloudConnector.cpp b/lib/ZmartCharge/src/ZmartChargeCloudConnector.cpp new file mode 100644 index 00000000..6b17248b --- /dev/null +++ b/lib/ZmartCharge/src/ZmartChargeCloudConnector.cpp @@ -0,0 +1,100 @@ +#include "ZmartChargeCloudConnector.h" +#include "Uptime.h" +#include "ArduinoJson.h" + +void ZmartChargeCloudConnector::setup(const char* baseUrl, const char* token) { + memset(this->baseUrl, 0, 64); + memset(this->token, 0, 21); + strcpy(this->baseUrl, baseUrl); + strcpy(this->token, token); +} + +bool ZmartChargeCloudConnector::isConfigChanged() { + return configChanged; +} + +void ZmartChargeCloudConnector::ackConfigChanged() { + configChanged = false; +} + +const char* ZmartChargeCloudConnector::getBaseUrl() { + return baseUrl; +} + + +void ZmartChargeCloudConnector::update(AmsData& data) { + if(strlen(token) == 0) return; + + uint64_t now = millis64(); + + float maximum = max(max(data.getL1Current(), data.getL1Current()), data.getL3Current()); + bool fast = maximum > heartbeatFastThreshold; + + if(now - lastUpdate < (fast ? heartbeatFast : heartbeat) * 1000) return; + + if(strlen(token) != 20) { + lastUpdate = now; + if(debugger->isActive(RemoteDebug::WARNING)) debugger->printf_P(PSTR("(ZmartCharge) Token defined, but is incorrect length (%s, %d)\n"), token, strlen(token)); + return; + } + + if(((now - lastUpdate) / 1000) > (fast || lastFailed ? heartbeatFast : heartbeat)) { + if(debugger->isActive(RemoteDebug::DEBUG)) debugger->printf_P(PSTR("(ZmartCharge) Preparing to update cloud\n")); + memset(json, 0, BufferSize); + snprintf_P(json, BufferSize, ZC_LB_JSON, + token, + data.getL1Current(), + data.getL2Current(), + data.getL3Current(), + fast ? 1 : 0, + data.getActiveImportPower() + ); + lastFailed = true; + char url[128]; + memset(url, 0, 128); + snprintf_P(url, 128, PSTR("%s/loadbalancer"), baseUrl); + if(debugger->isActive(RemoteDebug::VERBOSE)) debugger->printf_P(PSTR("(ZmartCharge) Connecting to: %s\n"), baseUrl); + if(http->begin(url)) { + if(debugger->isActive(RemoteDebug::VERBOSE)) debugger->printf_P(PSTR("(ZmartCharge) Sending data: %s\n"), json); + int status = http->POST(json); + if(status == 200) { + lastFailed = false; + JsonDocument doc; + String body = http->getString(); + if(debugger->isActive(RemoteDebug::VERBOSE)) debugger->printf_P(PSTR("(ZmartCharge) Received data: %s\n"), body.c_str()); + deserializeJson(doc, body); + if(doc.containsKey("Settings")) { + if(doc["Settings"].containsKey("HeartBeatTime")) { + heartbeat = doc["Settings"]["HeartBeatTime"].as(); + } + if(doc["Settings"].containsKey("HearBeatTimeFast")) { + heartbeatFast = doc["Settings"]["HearBeatTimeFast"].as(); + } + if(doc["Settings"].containsKey("HeartBeatTimeFastThreshold")) { + heartbeatFastThreshold = doc["Settings"]["HeartBeatTimeFastThreshold"].as(); + } + if(doc["Settings"].containsKey("ZmartChargeUrl")) { + String newBaseUrl = doc["Settings"]["ZmartChargeUrl"].as(); + if(newBaseUrl.startsWith("https:") && strncmp(newBaseUrl.c_str(), baseUrl, strlen(baseUrl)) != 0) { + newBaseUrl.replace("\\/", "/"); + if(debugger->isActive(RemoteDebug::INFO)) debugger->printf_P(PSTR("(ZmartCharge) Received new URL: %s\n"), newBaseUrl.c_str()); + memset(baseUrl, 0, 64); + memcpy(baseUrl, newBaseUrl.c_str(), strlen(newBaseUrl.c_str())); + configChanged = true; + } + } + } + http->end(); + } else { + if(debugger->isActive(RemoteDebug::ERROR)) debugger->printf_P(PSTR("(ZmartCharge) Communication error, returned status: %d\n"), status); + if(debugger->isActive(RemoteDebug::ERROR)) debugger->printf(http->errorToString(status).c_str()); + if(debugger->isActive(RemoteDebug::DEBUG)) debugger->printf(http->getString().c_str()); + + http->end(); + } + } else { + if(debugger->isActive(RemoteDebug::ERROR)) debugger->printf_P(PSTR("(ZmartCharge) Unable to establish connection with cloud\n")); + } + lastUpdate = now; + } +} \ No newline at end of file diff --git a/localazy/localazy.json b/localazy/localazy.json new file mode 100644 index 00000000..d02d48f6 --- /dev/null +++ b/localazy/localazy.json @@ -0,0 +1,9 @@ +{ + "upload": {}, + "download": { + "includeSourceLang": true, + "folder": "./language/", + "files": "${lang}.json" + }, + "transformations": [] +} diff --git a/platformio.ini b/platformio.ini index fb0497a4..8416b12c 100755 --- a/platformio.ini +++ b/platformio.ini @@ -2,7 +2,7 @@ extra_configs = platformio-user.ini [common] -lib_deps = EEPROM, LittleFS, DNSServer, 256dpi/MQTT@2.5.2, OneWireNg@0.13.3, DallasTemperature@4.0.4, https://github.com/gskjold/RemoteDebug.git, PaulStoffregen/Time@1.6.1, JChristensen/Timezone@1.2.4, FirmwareVersion, AmsConfiguration, AmsData, AmsDataStorage, HwTools, Uptime, AmsDecoder, PriceService, EnergyAccounting, AmsFirmwareUpdater, AmsMqttHandler, RawMqttHandler, JsonMqttHandler, DomoticzMqttHandler, HomeAssistantMqttHandler, PassthroughMqttHandler, RealtimePlot, ConnectionHandler, MeterCommunicators +lib_deps = EEPROM, LittleFS, DNSServer, 256dpi/MQTT@2.5.2, OneWireNg@0.13.3, DallasTemperature@4.0.4, https://github.com/gskjold/RemoteDebug.git, PaulStoffregen/Time@1.6.1, JChristensen/Timezone@1.2.4, bblanchon/ArduinoJson@7.0.4, FirmwareVersion, AmsConfiguration, AmsData, AmsDataStorage, HwTools, Uptime, AmsDecoder, PriceService, EnergyAccounting, AmsFirmwareUpdater, AmsMqttHandler, RawMqttHandler, JsonMqttHandler, DomoticzMqttHandler, HomeAssistantMqttHandler, PassthroughMqttHandler, RealtimePlot, ConnectionHandler, MeterCommunicators lib_ignore = OneWire extra_scripts = pre:scripts/addversion.py @@ -19,7 +19,7 @@ build_flags = -fexceptions [esp32] -lib_deps = WiFi, Ethernet, ESPmDNS, WiFiClientSecure, HTTPClient, FS, WebServer, ESP32 Async UDP, ESP32SSDP, mulmer89/ESPRandom@1.5.0, ${common.lib_deps}, CloudConnector, SvelteUi +lib_deps = WiFi, Ethernet, ESPmDNS, WiFiClientSecure, HTTPClient, FS, WebServer, ESP32 Async UDP, ESP32SSDP, mulmer89/ESPRandom@1.5.0, ${common.lib_deps}, CloudConnector, ZmartCharge, SvelteUi [env:esp8266] platform = espressif8266@4.2.1 @@ -44,6 +44,7 @@ build_flags = -D AMS_REMOTE_DEBUG=1 -D AMS_CLOUD=1 -D AMS_KMP=1 + -D ZMART_CHARGE=1 -L precompiled/esp32 -lKmpTalker lib_ldf_mode = off @@ -70,6 +71,7 @@ build_flags = -D AMS_REMOTE_DEBUG=1 -D AMS_CLOUD=1 -D AMS_KMP=1 + -D ZMART_CHARGE=1 -L precompiled/esp32s2 -lKmpTalker lib_ldf_mode = off @@ -90,6 +92,7 @@ build_flags = -D AMS_REMOTE_DEBUG=1 -D AMS_CLOUD=1 -D AMS_KMP=1 + -D ZMART_CHARGE=1 -L precompiled/esp32 -lKmpTalker lib_ldf_mode = off @@ -109,6 +112,7 @@ build_flags = -D AMS_REMOTE_DEBUG=1 -D AMS_CLOUD=1 -D AMS_KMP=1 + -D ZMART_CHARGE=1 -L precompiled/esp32c3 -lKmpTalker lib_ldf_mode = off @@ -127,6 +131,7 @@ build_flags = -D AMS_REMOTE_DEBUG=1 -D AMS_CLOUD=1 -D AMS_KMP=1 + -D ZMART_CHARGE=1 -L precompiled/esp32s3 -lKmpTalker lib_ldf_mode = off diff --git a/src/AmsToMqttBridge.cpp b/src/AmsToMqttBridge.cpp index de59a633..67987b71 100644 --- a/src/AmsToMqttBridge.cpp +++ b/src/AmsToMqttBridge.cpp @@ -26,6 +26,9 @@ ADC_MODE(ADC_VCC); #if defined(AMS_CLOUD) #include "CloudConnector.h" #endif +#if defined(ZMART_CHARGE) +#include "ZmartChargeCloudConnector.h" +#endif #define WDT_TIMEOUT 120 #if defined(SLOW_PROC_TRIGGER_MS) @@ -43,6 +46,7 @@ ADC_MODE(ADC_VCC); #define METER_PARSER_PULSE 2 #define METER_PARSER_KAMSTRUP 9 +#define METER_ERROR_UNKNOWN_DATA 89 #define METER_ERROR_NO_DATA 90 #define METER_ERROR_BREAK 91 #define METER_ERROR_BUFFER 92 @@ -182,6 +186,11 @@ AmsFirmwareUpdater updater(&Debug, &hw, &meterState); AmsDataStorage ds(&Debug); #if defined(_CLOUDCONNECTOR_H) CloudConnector *cloud = NULL; +#endif +#if defined(ZMART_CHARGE) +ZmartChargeCloudConnector *zcloud = NULL; +#endif +#if defined(ESP32) __NOINIT_ATTR EnergyAccountingRealtimeData rtd; #else EnergyAccountingRealtimeData rtd; @@ -694,6 +703,36 @@ void loop() { cloud->update(meterState, ea); } #endif + + #if defined(ZMART_CHARGE) + if(config.isZmartChargeConfigChanged()) { + ZmartChargeConfig zcc; + if(config.getZmartChargeConfig(zcc) && zcc.enabled) { + if(zcloud == NULL) { + zcloud = new ZmartChargeCloudConnector(&Debug, (char*) commonBuffer); + } + zcloud->setup(zcc.baseUrl, zcc.token); + } else if(zcloud != NULL) { + delete zcloud; + zcloud = NULL; + } + config.ackZmartChargeConfig(); + } + if(zcloud != NULL) { + zcloud->update(meterState); + if(zcloud->isConfigChanged()) { + ZmartChargeConfig zcc; + if(config.getZmartChargeConfig(zcc)) { + const char* newBaseUrl = zcloud->getBaseUrl(); + memset(zcc.baseUrl, 0, 64); + memcpy(zcc.baseUrl, newBaseUrl, strlen(newBaseUrl)); + config.setZmartChargeConfig(zcc); + config.ackZmartChargeConfig(); + } + zcloud->ackConfigChanged(); + } + } + #endif start = millis(); handleUiLanguage(); end = millis(); @@ -1307,6 +1346,8 @@ bool readHanPort() { if(data != NULL) { if(data->getListType() > 0) { handleDataSuccess(data); + } else { + meterState.setLastError(METER_ERROR_UNKNOWN_DATA); } delete data; } @@ -1620,7 +1661,9 @@ void configFileParse() { } if(strncmp_P(buf, PSTR("boardType "), 10) == 0) { if(!lSys) { config.getSystemConfig(sys); lSys = true; }; - sys.boardType = String(buf+10).toInt(); + if(sys.boardType == 0xFF) { + sys.boardType = String(buf+10).toInt(); + } } else if(strncmp_P(buf, PSTR("netmode "), 8) == 0) { if(!lNetwork) { config.getNetworkConfig(network); lNetwork = true; }; network.mode = String(buf+8).toInt();