diff --git a/css/dronebridge.css b/css/dronebridge.css index 9eaedd9..fc5c817 100644 --- a/css/dronebridge.css +++ b/css/dronebridge.css @@ -8,6 +8,10 @@ margin-right: auto; } +.center-text { + text-align: center; +} + .hero { text-align: center; padding-left: 6rem; @@ -91,10 +95,36 @@ button.button-primary:focus { border-color: #9a4e0b; } -input, select { +input { color: #000; } +.custom-select select { + padding: 0.675em 6em 0.675em 1em; + background-color: white; + border-radius: 0.25rem; + color: black; + cursor: pointer; + height: max-content; +} + +.custom-select::before, +.custom-select::after { + --size: 0.3rem; + content: ""; + position: absolute; + right: 1rem; + pointer-events: none; +} + +.custom-select::before { + top: 40%; +} + +.custom-select::after { + top: 55%; +} + .dot_green { background-color: #68b838; } @@ -113,4 +143,50 @@ li { margin: auto; } +.loader { + width: 48px; + height: 48px; + display: inline-block; + position: relative; +} + +.loader::after, +.loader::before { + content: ""; + box-sizing: border-box; + width: 48px; + height: 48px; + border-radius: 50%; + border: 2px solid #FFF; + position: absolute; + left: 0; + top: 0; + animation: animloader 2s linear infinite; +} + +.loader::after { + animation-delay: 1s; +} + +@keyframes animloader { + 0% { + transform: scale(0); + opacity: 1; + } + 100% { + transform: scale(1); + opacity: 0; + } +} +.donate_div { + margin: 1rem; +} + +.paypal_button { + background-color: #fff; + width: 217px; + padding: 0.4em 2em; + border-radius: 0.6em; +} + /*# sourceMappingURL=dronebridge.css.map */ diff --git a/css/dronebridge.css.map b/css/dronebridge.css.map index ca93a50..fe83cac 100644 --- a/css/dronebridge.css.map +++ b/css/dronebridge.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../scss/dronebridge.scss"],"names":[],"mappings":"AAEA;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAEF;EACE;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;AACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE","file":"dronebridge.css"} \ No newline at end of file +{"version":3,"sourceRoot":"","sources":["../scss/dronebridge.scss"],"names":[],"mappings":"AAEA;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAEF;EACE;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;AACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAMF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;;;AAEF;AAAA;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAGF;EACE;IACE;IACA;;EAEF;IACE;IACA;;;AAIJ;EACE;;;AAGF;EACE;EACA;EACA;EACA","file":"dronebridge.css"} \ No newline at end of file diff --git a/db_releases/1_5/esp32/bootloader.bin b/db_releases/1_5/esp32/bootloader.bin new file mode 100644 index 0000000..eb2ab91 Binary files /dev/null and b/db_releases/1_5/esp32/bootloader.bin differ diff --git a/db_releases/1_5/esp32/db_esp32.bin b/db_releases/1_5/esp32/db_esp32.bin new file mode 100644 index 0000000..da085a8 Binary files /dev/null and b/db_releases/1_5/esp32/db_esp32.bin differ diff --git a/db_releases/1_5/esp32/flash_args.txt b/db_releases/1_5/esp32/flash_args.txt new file mode 100644 index 0000000..0d913f4 --- /dev/null +++ b/db_releases/1_5/esp32/flash_args.txt @@ -0,0 +1,5 @@ +--flash_mode dio --flash_freq 40m --flash_size 2MB +0x1000 bootloader/bootloader.bin +0x10000 db_esp32.bin +0x8000 partition_table/partition-table.bin +0x110000 www.bin diff --git a/db_releases/1_5/esp32/partition-table.bin b/db_releases/1_5/esp32/partition-table.bin new file mode 100644 index 0000000..8408511 Binary files /dev/null and b/db_releases/1_5/esp32/partition-table.bin differ diff --git a/db_releases/1_5/esp32/www.bin b/db_releases/1_5/esp32/www.bin new file mode 100644 index 0000000..a869f39 Binary files /dev/null and b/db_releases/1_5/esp32/www.bin differ diff --git a/db_releases/1_5/esp32c3/bootloader.bin b/db_releases/1_5/esp32c3/bootloader.bin new file mode 100644 index 0000000..5f7cb9e Binary files /dev/null and b/db_releases/1_5/esp32c3/bootloader.bin differ diff --git a/db_releases/1_5/esp32c3/db_esp32.bin b/db_releases/1_5/esp32c3/db_esp32.bin new file mode 100644 index 0000000..891c1a2 Binary files /dev/null and b/db_releases/1_5/esp32c3/db_esp32.bin differ diff --git a/db_releases/1_5/esp32c3/flash_args.txt b/db_releases/1_5/esp32c3/flash_args.txt new file mode 100644 index 0000000..314e335 --- /dev/null +++ b/db_releases/1_5/esp32c3/flash_args.txt @@ -0,0 +1,5 @@ +--flash_mode dio --flash_freq 80m --flash_size 2MB +0x0 bootloader/bootloader.bin +0x10000 db_esp32.bin +0x8000 partition_table/partition-table.bin +0x110000 www.bin diff --git a/db_releases/1_5/esp32c3/partition-table.bin b/db_releases/1_5/esp32c3/partition-table.bin new file mode 100644 index 0000000..8408511 Binary files /dev/null and b/db_releases/1_5/esp32c3/partition-table.bin differ diff --git a/db_releases/1_5/esp32c3/www.bin b/db_releases/1_5/esp32c3/www.bin new file mode 100644 index 0000000..a869f39 Binary files /dev/null and b/db_releases/1_5/esp32c3/www.bin differ diff --git a/db_releases/1_5/esp32s2/bootloader.bin b/db_releases/1_5/esp32s2/bootloader.bin new file mode 100644 index 0000000..912b1cb Binary files /dev/null and b/db_releases/1_5/esp32s2/bootloader.bin differ diff --git a/db_releases/1_5/esp32s2/db_esp32.bin b/db_releases/1_5/esp32s2/db_esp32.bin new file mode 100644 index 0000000..3b0d7a8 Binary files /dev/null and b/db_releases/1_5/esp32s2/db_esp32.bin differ diff --git a/db_releases/1_5/esp32s2/flash_args.txt b/db_releases/1_5/esp32s2/flash_args.txt new file mode 100644 index 0000000..85e62b2 --- /dev/null +++ b/db_releases/1_5/esp32s2/flash_args.txt @@ -0,0 +1,5 @@ +--flash_mode dio --flash_freq 80m --flash_size 2MB +0x1000 bootloader/bootloader.bin +0x10000 db_esp32.bin +0x8000 partition_table/partition-table.bin +0x110000 www.bin diff --git a/db_releases/1_5/esp32s2/partition-table.bin b/db_releases/1_5/esp32s2/partition-table.bin new file mode 100644 index 0000000..8408511 Binary files /dev/null and b/db_releases/1_5/esp32s2/partition-table.bin differ diff --git a/db_releases/1_5/esp32s2/www.bin b/db_releases/1_5/esp32s2/www.bin new file mode 100644 index 0000000..a869f39 Binary files /dev/null and b/db_releases/1_5/esp32s2/www.bin differ diff --git a/db_releases/1_5/esp32s3/bootloader.bin b/db_releases/1_5/esp32s3/bootloader.bin new file mode 100644 index 0000000..25814ee Binary files /dev/null and b/db_releases/1_5/esp32s3/bootloader.bin differ diff --git a/db_releases/1_5/esp32s3/db_esp32.bin b/db_releases/1_5/esp32s3/db_esp32.bin new file mode 100644 index 0000000..495bb03 Binary files /dev/null and b/db_releases/1_5/esp32s3/db_esp32.bin differ diff --git a/db_releases/1_5/esp32s3/flash_args.txt b/db_releases/1_5/esp32s3/flash_args.txt new file mode 100644 index 0000000..314e335 --- /dev/null +++ b/db_releases/1_5/esp32s3/flash_args.txt @@ -0,0 +1,5 @@ +--flash_mode dio --flash_freq 80m --flash_size 2MB +0x0 bootloader/bootloader.bin +0x10000 db_esp32.bin +0x8000 partition_table/partition-table.bin +0x110000 www.bin diff --git a/db_releases/1_5/esp32s3/partition-table.bin b/db_releases/1_5/esp32s3/partition-table.bin new file mode 100644 index 0000000..8408511 Binary files /dev/null and b/db_releases/1_5/esp32s3/partition-table.bin differ diff --git a/db_releases/1_5/esp32s3/www.bin b/db_releases/1_5/esp32s3/www.bin new file mode 100644 index 0000000..a869f39 Binary files /dev/null and b/db_releases/1_5/esp32s3/www.bin differ diff --git a/db_releases/2_0RC2/esp32/bootloader.bin b/db_releases/2_0RC2/esp32/bootloader.bin new file mode 100644 index 0000000..3aff4a3 Binary files /dev/null and b/db_releases/2_0RC2/esp32/bootloader.bin differ diff --git a/db_releases/2_0RC2/esp32/db_esp32.bin b/db_releases/2_0RC2/esp32/db_esp32.bin new file mode 100644 index 0000000..52b6dec Binary files /dev/null and b/db_releases/2_0RC2/esp32/db_esp32.bin differ diff --git a/db_releases/2_0RC2/esp32/flash_args.txt b/db_releases/2_0RC2/esp32/flash_args.txt new file mode 100644 index 0000000..2c98c4e --- /dev/null +++ b/db_releases/2_0RC2/esp32/flash_args.txt @@ -0,0 +1,5 @@ +--flash_mode dio --flash_freq 40m --flash_size 2MB +0x1000 bootloader/bootloader.bin +0x10000 db_esp32.bin +0x8000 partition_table/partition-table.bin +0x190000 www.bin diff --git a/db_releases/2_0RC2/esp32/partition-table.bin b/db_releases/2_0RC2/esp32/partition-table.bin new file mode 100644 index 0000000..1c18869 Binary files /dev/null and b/db_releases/2_0RC2/esp32/partition-table.bin differ diff --git a/db_releases/2_0RC2/esp32/www.bin b/db_releases/2_0RC2/esp32/www.bin new file mode 100644 index 0000000..fb57cb1 Binary files /dev/null and b/db_releases/2_0RC2/esp32/www.bin differ diff --git a/db_releases/2_0RC2/esp32c3/bootloader.bin b/db_releases/2_0RC2/esp32c3/bootloader.bin new file mode 100644 index 0000000..1da0618 Binary files /dev/null and b/db_releases/2_0RC2/esp32c3/bootloader.bin differ diff --git a/db_releases/2_0RC2/esp32c3/db_esp32.bin b/db_releases/2_0RC2/esp32c3/db_esp32.bin new file mode 100644 index 0000000..608c211 Binary files /dev/null and b/db_releases/2_0RC2/esp32c3/db_esp32.bin differ diff --git a/db_releases/2_0RC2/esp32c3/flash_args.txt b/db_releases/2_0RC2/esp32c3/flash_args.txt new file mode 100644 index 0000000..35e5c8c --- /dev/null +++ b/db_releases/2_0RC2/esp32c3/flash_args.txt @@ -0,0 +1,5 @@ +--flash_mode dio --flash_freq 80m --flash_size 2MB +0x0 bootloader/bootloader.bin +0x10000 db_esp32.bin +0x8000 partition_table/partition-table.bin +0x190000 www.bin diff --git a/db_releases/2_0RC2/esp32c3/partition-table.bin b/db_releases/2_0RC2/esp32c3/partition-table.bin new file mode 100644 index 0000000..1c18869 Binary files /dev/null and b/db_releases/2_0RC2/esp32c3/partition-table.bin differ diff --git a/db_releases/2_0RC2/esp32c3/www.bin b/db_releases/2_0RC2/esp32c3/www.bin new file mode 100644 index 0000000..fb57cb1 Binary files /dev/null and b/db_releases/2_0RC2/esp32c3/www.bin differ diff --git a/db_releases/2_0RC2/esp32c3_USBSerial/bootloader.bin b/db_releases/2_0RC2/esp32c3_USBSerial/bootloader.bin new file mode 100644 index 0000000..ad5a0ee Binary files /dev/null and b/db_releases/2_0RC2/esp32c3_USBSerial/bootloader.bin differ diff --git a/db_releases/2_0RC2/esp32c3_USBSerial/db_esp32.bin b/db_releases/2_0RC2/esp32c3_USBSerial/db_esp32.bin new file mode 100644 index 0000000..622a64d Binary files /dev/null and b/db_releases/2_0RC2/esp32c3_USBSerial/db_esp32.bin differ diff --git a/db_releases/2_0RC2/esp32c3_USBSerial/flash_args.txt b/db_releases/2_0RC2/esp32c3_USBSerial/flash_args.txt new file mode 100644 index 0000000..35e5c8c --- /dev/null +++ b/db_releases/2_0RC2/esp32c3_USBSerial/flash_args.txt @@ -0,0 +1,5 @@ +--flash_mode dio --flash_freq 80m --flash_size 2MB +0x0 bootloader/bootloader.bin +0x10000 db_esp32.bin +0x8000 partition_table/partition-table.bin +0x190000 www.bin diff --git a/db_releases/2_0RC2/esp32c3_USBSerial/partition-table.bin b/db_releases/2_0RC2/esp32c3_USBSerial/partition-table.bin new file mode 100644 index 0000000..1c18869 Binary files /dev/null and b/db_releases/2_0RC2/esp32c3_USBSerial/partition-table.bin differ diff --git a/db_releases/2_0RC2/esp32c3_USBSerial/www.bin b/db_releases/2_0RC2/esp32c3_USBSerial/www.bin new file mode 100644 index 0000000..fb57cb1 Binary files /dev/null and b/db_releases/2_0RC2/esp32c3_USBSerial/www.bin differ diff --git a/db_releases/2_0RC2/esp32c6/bootloader.bin b/db_releases/2_0RC2/esp32c6/bootloader.bin new file mode 100644 index 0000000..f391859 Binary files /dev/null and b/db_releases/2_0RC2/esp32c6/bootloader.bin differ diff --git a/db_releases/2_0RC2/esp32c6/db_esp32.bin b/db_releases/2_0RC2/esp32c6/db_esp32.bin new file mode 100644 index 0000000..46725cc Binary files /dev/null and b/db_releases/2_0RC2/esp32c6/db_esp32.bin differ diff --git a/db_releases/2_0RC2/esp32c6/flash_args.txt b/db_releases/2_0RC2/esp32c6/flash_args.txt new file mode 100644 index 0000000..35e5c8c --- /dev/null +++ b/db_releases/2_0RC2/esp32c6/flash_args.txt @@ -0,0 +1,5 @@ +--flash_mode dio --flash_freq 80m --flash_size 2MB +0x0 bootloader/bootloader.bin +0x10000 db_esp32.bin +0x8000 partition_table/partition-table.bin +0x190000 www.bin diff --git a/db_releases/2_0RC2/esp32c6/partition-table.bin b/db_releases/2_0RC2/esp32c6/partition-table.bin new file mode 100644 index 0000000..1c18869 Binary files /dev/null and b/db_releases/2_0RC2/esp32c6/partition-table.bin differ diff --git a/db_releases/2_0RC2/esp32c6/www.bin b/db_releases/2_0RC2/esp32c6/www.bin new file mode 100644 index 0000000..fb57cb1 Binary files /dev/null and b/db_releases/2_0RC2/esp32c6/www.bin differ diff --git a/db_releases/2_0RC2/esp32s2/bootloader.bin b/db_releases/2_0RC2/esp32s2/bootloader.bin new file mode 100644 index 0000000..7e5c1f2 Binary files /dev/null and b/db_releases/2_0RC2/esp32s2/bootloader.bin differ diff --git a/db_releases/2_0RC2/esp32s2/db_esp32.bin b/db_releases/2_0RC2/esp32s2/db_esp32.bin new file mode 100644 index 0000000..c58825e Binary files /dev/null and b/db_releases/2_0RC2/esp32s2/db_esp32.bin differ diff --git a/db_releases/2_0RC2/esp32s2/flash_args.txt b/db_releases/2_0RC2/esp32s2/flash_args.txt new file mode 100644 index 0000000..52643fb --- /dev/null +++ b/db_releases/2_0RC2/esp32s2/flash_args.txt @@ -0,0 +1,5 @@ +--flash_mode dio --flash_freq 80m --flash_size 2MB +0x1000 bootloader/bootloader.bin +0x10000 db_esp32.bin +0x8000 partition_table/partition-table.bin +0x190000 www.bin diff --git a/db_releases/2_0RC2/esp32s2/partition-table.bin b/db_releases/2_0RC2/esp32s2/partition-table.bin new file mode 100644 index 0000000..1c18869 Binary files /dev/null and b/db_releases/2_0RC2/esp32s2/partition-table.bin differ diff --git a/db_releases/2_0RC2/esp32s2/www.bin b/db_releases/2_0RC2/esp32s2/www.bin new file mode 100644 index 0000000..fb57cb1 Binary files /dev/null and b/db_releases/2_0RC2/esp32s2/www.bin differ diff --git a/db_releases/2_0RC2/esp32s3/bootloader.bin b/db_releases/2_0RC2/esp32s3/bootloader.bin new file mode 100644 index 0000000..96bdc05 Binary files /dev/null and b/db_releases/2_0RC2/esp32s3/bootloader.bin differ diff --git a/db_releases/2_0RC2/esp32s3/db_esp32.bin b/db_releases/2_0RC2/esp32s3/db_esp32.bin new file mode 100644 index 0000000..5954a98 Binary files /dev/null and b/db_releases/2_0RC2/esp32s3/db_esp32.bin differ diff --git a/db_releases/2_0RC2/esp32s3/flash_args.txt b/db_releases/2_0RC2/esp32s3/flash_args.txt new file mode 100644 index 0000000..35e5c8c --- /dev/null +++ b/db_releases/2_0RC2/esp32s3/flash_args.txt @@ -0,0 +1,5 @@ +--flash_mode dio --flash_freq 80m --flash_size 2MB +0x0 bootloader/bootloader.bin +0x10000 db_esp32.bin +0x8000 partition_table/partition-table.bin +0x190000 www.bin diff --git a/db_releases/2_0RC2/esp32s3/partition-table.bin b/db_releases/2_0RC2/esp32s3/partition-table.bin new file mode 100644 index 0000000..1c18869 Binary files /dev/null and b/db_releases/2_0RC2/esp32s3/partition-table.bin differ diff --git a/db_releases/2_0RC2/esp32s3/www.bin b/db_releases/2_0RC2/esp32s3/www.bin new file mode 100644 index 0000000..fb57cb1 Binary files /dev/null and b/db_releases/2_0RC2/esp32s3/www.bin differ diff --git a/dronebridge_esp32_flasher.js b/dronebridge_esp32_flasher.js new file mode 100644 index 0000000..dc52aac --- /dev/null +++ b/dronebridge_esp32_flasher.js @@ -0,0 +1,332 @@ +import { ESPLoader, Transport } from '/esptool/bundle.js'; +import { serial } from '/web-serial-polyfill/serial.js'; +if (!navigator.serial && navigator.usb) navigator.serial = serial; // switch to WebSerial over WebUSB by polyfill + +const not_compatible_warning = document.getElementById('not_compatible_warning'); +const conn_status_label = document.getElementById('conn_status'); +const connectButton = document.getElementById("connectButton"); +const software_selection = document.getElementById("software_selection"); +const hw_selection = document.getElementById("board_selection"); +const flash_button_div = document.getElementById("flash_button_div"); +const flash_button = document.getElementById("flash_button"); +const software_version_selector = document.getElementById("software_version_selector"); +const flavor_selector = document.getElementById("flavor_selector"); +const loader_div = document.getElementById("loader_div"); +const progress_bar1 = document.getElementById("progress_bar1"); +const progress_div = document.getElementById("progress_div"); +const flashing_div = document.getElementById("flashing_div"); +const success_msg_div = document.getElementById("success_msg_div"); +const flash_curr_file = document.getElementById("flash_curr_file"); + +class DBTarget { + constructor(chip_name, target_display_name, target_folder_name, target_files, target_addresses, target_flash_mode, + target_flash_freq) { + this.chip_name = chip_name; + this.target_display_name = target_display_name; + this.target_folder_name = target_folder_name; + this.target_files = target_files; + this.target_file_addresses = target_addresses; + this.flash_mode = target_flash_mode; + this.flash_freq = target_flash_freq; + } +} + +class DBRelease { + constructor(display_name, folder_name, db_targets) { + this.display_name = display_name; + this.folder_name = folder_name; + this.targets = db_targets; + } +} + +// const terminal = document.getElementById("terminal"); +// let Terminal; // Terminal is imported in HTML script +// const term = new Terminal({ cols: 120, rows: 40 }); +// term.open(terminal); +// const espLoaderTerminal = { +// clean() { +// term.clear(); +// }, +// writeLine(data) { +// term.writeln(data); +// }, +// write(data) { +// term.write(data); +// }, +// }; + +// Define DroneBridge for ESP32 releases manually here. No GitHub call etc. All locally available +let t_esp32 = new DBTarget("ESP32", "ESP32", "esp32/", ["bootloader.bin", "partition-table.bin", "db_esp32.bin", "www.bin"], [0x1000, 0x8000, 0x10000, 0x110000], "DIO", "40MHz"); +let t_espc3 = new DBTarget("ESP32-C3", "ESP32-C3", "esp32c3/", ["bootloader.bin", "partition-table.bin", "db_esp32.bin", "www.bin"], [0x0, 0x8000, 0x10000, 0x110000], "DIO", "80MHz"); +let t_esps2 = new DBTarget("ESP32-S2", "ESP32-S2", "esp32s2/", ["bootloader.bin", "partition-table.bin", "db_esp32.bin", "www.bin"], [0x1000, 0x8000, 0x10000, 0x110000], "DIO", "80MHz"); +let t_esp32s3 = new DBTarget("ESP32-S3", "ESP32-S3", "esp32s3/", ["bootloader.bin", "partition-table.bin", "db_esp32.bin", "www.bin"], [0x0, 0x8000, 0x10000, 0x110000], "DIO", "80MHz"); +let release_15 = new DBRelease("v1.5 (stable)", "/db_releases/1_5/", + [t_esp32, t_espc3, t_esps2, t_esp32s3]); + +let t2RC2_esp32 = new DBTarget("ESP32", "ESP32", "esp32/", ["bootloader.bin", "partition-table.bin", "db_esp32.bin", "www.bin"], [0x1000, 0x8000, 0x10000, 0x190000], "DIO", "40MHz"); +let t2RC2_espc3 = new DBTarget("ESP32-C3", "ESP32-C3", "esp32c3/", ["bootloader.bin", "partition-table.bin", "db_esp32.bin", "www.bin"], [0x0, 0x8000, 0x10000, 0x190000], "DIO", "80MHz"); +let t2RC2_espc3_usbserial = new DBTarget("ESP32-C3", "ESP32-C3 (USBSerial)", "esp32c3_USBSerial/", ["bootloader.bin", "partition-table.bin", "db_esp32.bin", "www.bin"], [0x0, 0x8000, 0x10000, 0x190000], "DIO", "80MHz"); +let t2RC2_espc6 = new DBTarget("ESP32-C6", "ESP32-C6", "esp32c6/", ["bootloader.bin", "partition-table.bin", "db_esp32.bin", "www.bin"], [0x0, 0x8000, 0x10000, 0x190000], "DIO", "80MHz"); +let t2RC2_esps2 = new DBTarget("ESP32-S2", "ESP32-S2", "esp32s2/", ["bootloader.bin", "partition-table.bin", "db_esp32.bin", "www.bin"], [0x1000, 0x8000, 0x10000, 0x190000], "DIO", "80MHz"); +let t2RC2_esp32s3 = new DBTarget("ESP32-S3", "ESP32-S3", "esp32s3/", ["bootloader.bin", "partition-table.bin", "db_esp32.bin", "www.bin"], [0x0, 0x8000, 0x10000, 0x190000], "DIO", "80MHz"); +let release_20RC2 = new DBRelease("v2.0RC2 (pre-release)", "/db_releases/2_0RC2/", + [t2RC2_esp32, t2RC2_espc3, t2RC2_espc3_usbserial, t2RC2_espc6, t2RC2_esps2, t2RC2_esp32s3]); + +// overall array containing all releases with flashing instructions +let db_releases = [release_20RC2, release_15]; + + +let device = null; +let transport; +let chip = null; +let esploader; + +browser_comp_check(); + +function browser_comp_check() { + if (!navigator.serial && !navigator.usb) { + // the browser is not supporting the required technology for this flasher to run + console.error("Your browser is not supported! Use a Chrome-Based browser instead!"); + not_compatible_warning.style.display = "block"; + flashing_div.style.display = "none"; + } else { + not_compatible_warning.style.display = "none"; + } +} + +/** + * Opens dialog for choosing the ESP32 and connects to it. Detects ESP32 chip + * @returns {Promise} + */ +connectButton.onclick = async () => { + if (device === null) { + device = await navigator.serial.requestPort({}); + transport = new Transport(device, true); + } + let chip_full_name = "Chip was not detected"; + connectButton.style.display = "none"; + loader_div.style.display = "block"; + try { + const flashOptions = { + transport, + baudrate: 460800, + //terminal: espLoaderTerminal, + }; + esploader = new ESPLoader(flashOptions); + chip_full_name = await esploader.main(); + chip = esploader.chip; + } catch (e) { + console.error(e); + // term.writeln(`Error: ${e.message}`); + display_ui_not_connected(); + } + console.log("Settings done for: " + chip_full_name); + loader_div.style.display = "none"; + display_ui_connected(); + populate_software_versions(); + add_new_falvors(software_version_selector.selectedIndex); +} + +/** + * Reads file (DroneBridge firmware file) from server and returns it + * @param url + * @returns {Promise} + */ +async function read_file(url) { + try { + // Fetch the binary file from the server + const response = await fetch(url); + const buffer = await response.arrayBuffer(); // Convert the response to an ArrayBuffer + + // Create a Blob from the ArrayBuffer + const blob = new Blob([buffer]); + + // Return a promise that resolves with the read file + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onload = function(event) { + resolve(event.target.result); // Resolve the promise with the result + }; + reader.onerror = function(error) { + reject(error); // Reject the promise if there's an error + }; + reader.readAsBinaryString(blob); + // reader.readAsArrayBuffer(blob); // create DOMString from binary array + }); + } catch (error) { + console.error('Error fetching the binary file:', error); + throw error; // Re-throw the error to be handled by the caller + } +} + +/** + * Create an array containing the release binaries and offsets that has the shape that esptool-js expects + * @param release_folder_name + * @param target_folder_name + * @param files_array + * @param offsets_array + * @returns {Promise<*[]>} + */ +async function create_file_array(release_folder_name, target_folder_name, files_array, offsets_array){ + let esptool_file_array = []; + for (let i = 0; i < files_array.length; i++) { + const url = release_folder_name + target_folder_name + files_array[i]; + await read_file(url).then(result => { + esptool_file_array.push({ data: result, address: offsets_array[i]}); + } + ); + } + return esptool_file_array; +} + +/** + * Read the files for that target and flash them to the ESP32 + * @returns {Promise} + */ +flash_button.onclick = async () => { + if (device != null) { + display_ui_flashing(); + let db_rel = db_releases[software_version_selector.selectedIndex]; + // get selected flavour based on display name from the overall target list + let target_name_selected = flavor_selector.options[flavor_selector.selectedIndex].text + let db_target = null; + for (let i = 0; i < db_rel.targets.length; i++) { + if (db_rel.targets[i].target_display_name === target_name_selected) { + db_target = db_rel.targets[i]; + break; + } + } + if (db_target == null) { + // That should never happen + console.error("Could not find selected target name in the DroneBridge targets" + target_name_selected); + return ; + } + try { + let esptool_file_array = await create_file_array( + db_rel.folder_name, + db_target.target_folder_name, + db_target.target_files, + db_target.target_file_addresses + ); + const flashOptions = { + fileArray: esptool_file_array, + flashSize: "keep", + flashMode: db_target.flash_mode, + flashFreq: db_target.flash_freq, + eraseAll: false, + compress: true, + reportProgress: (fileIndex, written, total) => { + progress_bar1.value = (written / total) * 100; + flash_curr_file.innerText = "Flashing ("+(fileIndex+1)+"/"+esptool_file_array.length+") " + db_target.target_files[fileIndex]; + }, + }; + await esploader.writeFlash(flashOptions); + } catch (e) { + console.error(e); + // term.writeln(`Error: ${e.message}`); + } finally { + display_ui_success(); + } + } else { + // we are not connected + clean_up(); + display_ui_not_connected(); + } +} + +/** + * User selected a new DroneBridge for ESP32 software version. Update the flavor list + */ +software_version_selector.onchange = async (ev) => { + if (ev.type === 'change') { + // Clear list + let i, L = flavor_selector.options.length - 1; + for(i = L; i >= 0; i--) { + flavor_selector.remove(i); + } + add_new_falvors(software_version_selector.selectedIndex); + if (flavor_selector.options.length === 0) { + // Connected ESP32 is not supported by this release + } + } // ignore others +} + +/** + * Adds the targets (chips) of that software version that match the connected chip to the list of options + * @param index + */ +function add_new_falvors(index) { + let db_target; + for (db_target of db_releases.at(index).targets) { + if (db_target.chip_name === chip.CHIP_NAME) { + // add to option list + let option = document.createElement("option"); + option.text = db_target.target_display_name; + flavor_selector.add(option) + } else { + // do not add - wrong chip + } + } +} + +/** + * Adds a software release versions to the list + * @param value DBRelease + * @param index + * @param array + */ +function add_to_software_version(value, index, array) { + let option = document.createElement("option"); + console.log(value.display_name) + option.text = value.display_name; + software_version_selector.add(option) +} + +/** + * Add all available software release versions to the list + */ +function populate_software_versions() { + db_releases.forEach(add_to_software_version); +} + +function display_ui_connected() { + conn_status_label.innerHTML = "Connected to " + chip.CHIP_NAME; + software_selection.style.display = "block"; + hw_selection.style.display = "block"; + flash_button_div.style.display = "block"; + success_msg_div.style.display = "none"; + flashing_div.style.display = "block"; + progress_div.style.display = "none"; +} + +function display_ui_not_connected() { + conn_status_label.innerHTML = "Not connected"; + software_selection.style.display = "none"; + hw_selection.style.display = "none"; + connectButton.style.display = "block"; + flash_button_div.style.display = "none"; + success_msg_div.style.display = "none"; + flashing_div.style.display = "block"; + progress_div.style.display = "none"; +} + +function display_ui_flashing() { + success_msg_div.style.display = "none"; + progress_div.style.display = "block"; + flashing_div.style.display = "block"; + flash_button_div.style.display = "none"; +} + +function display_ui_success() { + success_msg_div.style.display = "block"; + flashing_div.style.display = "none"; + flash_button_div.style.display = "none"; + progress_div.style.display = "none"; +} + +function clean_up() { + display_ui_not_connected(); + device = null; + transport = null; + chip = null; +} \ No newline at end of file diff --git a/esptool/bundle.js b/esptool/bundle.js new file mode 100644 index 0000000..6b1c0b1 --- /dev/null +++ b/esptool/bundle.js @@ -0,0 +1,2 @@ +class A extends Error{} +/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function t(A){let t=A.length;for(;--t>=0;)A[t]=0}const e=256,i=286,s=30,a=15,n=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),h=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),E=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),g=new Array(576);t(g);const o=new Array(60);t(o);const B=new Array(512);t(B);const w=new Array(256);t(w);const c=new Array(29);t(c);const I=new Array(s);function C(A,t,e,i,s){this.static_tree=A,this.extra_bits=t,this.extra_base=e,this.elems=i,this.max_length=s,this.has_stree=A&&A.length}let l,_,d;function D(A,t){this.dyn_tree=A,this.max_code=0,this.stat_desc=t}t(I);const M=A=>A<256?B[A]:B[256+(A>>>7)],Q=(A,t)=>{A.pending_buf[A.pending++]=255&t,A.pending_buf[A.pending++]=t>>>8&255},S=(A,t,e)=>{A.bi_valid>16-e?(A.bi_buf|=t<>16-A.bi_valid,A.bi_valid+=e-16):(A.bi_buf|=t<{S(A,e[2*t],e[2*t+1])},f=(A,t)=>{let e=0;do{e|=1&A,A>>>=1,e<<=1}while(--t>0);return e>>>1},F=(A,t,e)=>{const i=new Array(16);let s,n,h=0;for(s=1;s<=a;s++)h=h+e[s-1]<<1,i[s]=h;for(n=0;n<=t;n++){let t=A[2*n+1];0!==t&&(A[2*n]=f(i[t]++,t))}},u=A=>{let t;for(t=0;t{A.bi_valid>8?Q(A,A.bi_buf):A.bi_valid>0&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0},y=(A,t,e,i)=>{const s=2*t,a=2*e;return A[s]{const i=A.heap[e];let s=e<<1;for(;s<=A.heap_len&&(s{let s,a,r,E,g=0;if(0!==A.sym_next)do{s=255&A.pending_buf[A.sym_buf+g++],s+=(255&A.pending_buf[A.sym_buf+g++])<<8,a=A.pending_buf[A.sym_buf+g++],0===s?R(A,a,t):(r=w[a],R(A,r+e+1,t),E=n[r],0!==E&&(a-=c[r],S(A,a,E)),s--,r=M(s),R(A,r,i),E=h[r],0!==E&&(s-=I[r],S(A,s,E)))}while(g{const e=t.dyn_tree,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,n=t.stat_desc.elems;let h,r,E,g=-1;for(A.heap_len=0,A.heap_max=573,h=0;h>1;h>=1;h--)p(A,e,h);E=n;do{h=A.heap[1],A.heap[1]=A.heap[A.heap_len--],p(A,e,1),r=A.heap[1],A.heap[--A.heap_max]=h,A.heap[--A.heap_max]=r,e[2*E]=e[2*h]+e[2*r],A.depth[E]=(A.depth[h]>=A.depth[r]?A.depth[h]:A.depth[r])+1,e[2*h+1]=e[2*r+1]=E,A.heap[1]=E++,p(A,e,1)}while(A.heap_len>=2);A.heap[--A.heap_max]=A.heap[1],((A,t)=>{const e=t.dyn_tree,i=t.max_code,s=t.stat_desc.static_tree,n=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,r=t.stat_desc.extra_base,E=t.stat_desc.max_length;let g,o,B,w,c,I,C=0;for(w=0;w<=a;w++)A.bl_count[w]=0;for(e[2*A.heap[A.heap_max]+1]=0,g=A.heap_max+1;g<573;g++)o=A.heap[g],w=e[2*e[2*o+1]+1]+1,w>E&&(w=E,C++),e[2*o+1]=w,o>i||(A.bl_count[w]++,c=0,o>=r&&(c=h[o-r]),I=e[2*o],A.opt_len+=I*(w+c),n&&(A.static_len+=I*(s[2*o+1]+c)));if(0!==C){do{for(w=E-1;0===A.bl_count[w];)w--;A.bl_count[w]--,A.bl_count[w+1]+=2,A.bl_count[E]--,C-=2}while(C>0);for(w=E;0!==w;w--)for(o=A.bl_count[w];0!==o;)B=A.heap[--g],B>i||(e[2*B+1]!==w&&(A.opt_len+=(w-e[2*B+1])*e[2*B],e[2*B+1]=w),o--)}})(A,t),F(e,g,A.bl_count)},P=(A,t,e)=>{let i,s,a=-1,n=t[1],h=0,r=7,E=4;for(0===n&&(r=138,E=3),t[2*(e+1)+1]=65535,i=0;i<=e;i++)s=n,n=t[2*(i+1)+1],++h{let i,s,a=-1,n=t[1],h=0,r=7,E=4;for(0===n&&(r=138,E=3),i=0;i<=e;i++)if(s=n,n=t[2*(i+1)+1],!(++h{S(A,0+(i?1:0),3),T(A),Q(A,e),Q(A,~e),e&&A.pending_buf.set(A.window.subarray(t,t+e),A.pending),A.pending+=e};var U=(A,t,i,s)=>{let a,n,h=0;A.level>0?(2===A.strm.data_type&&(A.strm.data_type=(A=>{let t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==A.dyn_ltree[2*t])return 0;if(0!==A.dyn_ltree[18]||0!==A.dyn_ltree[20]||0!==A.dyn_ltree[26])return 1;for(t=32;t{let t;for(P(A,A.dyn_ltree,A.l_desc.max_code),P(A,A.dyn_dtree,A.d_desc.max_code),H(A,A.bl_desc),t=18;t>=3&&0===A.bl_tree[2*E[t]+1];t--);return A.opt_len+=3*(t+1)+5+5+4,t})(A),a=A.opt_len+3+7>>>3,n=A.static_len+3+7>>>3,n<=a&&(a=n)):a=n=i+5,i+4<=a&&-1!==t?G(A,t,i,s):4===A.strategy||n===a?(S(A,2+(s?1:0),3),k(A,g,o)):(S(A,4+(s?1:0),3),((A,t,e,i)=>{let s;for(S(A,t-257,5),S(A,e-1,5),S(A,i-4,4),s=0;s{O||((()=>{let A,t,e,E,D;const M=new Array(16);for(e=0,E=0;E<28;E++)for(c[E]=e,A=0;A<1<>=7;E(A.pending_buf[A.sym_buf+A.sym_next++]=t,A.pending_buf[A.sym_buf+A.sym_next++]=t>>8,A.pending_buf[A.sym_buf+A.sym_next++]=i,0===t?A.dyn_ltree[2*i]++:(A.matches++,t--,A.dyn_ltree[2*(w[i]+e+1)]++,A.dyn_dtree[2*M(t)]++),A.sym_next===A.sym_end),_tr_align:A=>{S(A,2,3),R(A,256,g),(A=>{16===A.bi_valid?(Q(A,A.bi_buf),A.bi_buf=0,A.bi_valid=0):A.bi_valid>=8&&(A.pending_buf[A.pending++]=255&A.bi_buf,A.bi_buf>>=8,A.bi_valid-=8)})(A)}};var Y=(A,t,e,i)=>{let s=65535&A|0,a=A>>>16&65535|0,n=0;for(;0!==e;){n=e>2e3?2e3:e,e-=n;do{s=s+t[i++]|0,a=a+s|0}while(--n);s%=65521,a%=65521}return s|a<<16|0};const K=new Uint32Array((()=>{let A,t=[];for(var e=0;e<256;e++){A=e;for(var i=0;i<8;i++)A=1&A?3988292384^A>>>1:A>>>1;t[e]=A}return t})());var x=(A,t,e,i)=>{const s=K,a=i+e;A^=-1;for(let e=i;e>>8^s[255&(A^t[e])];return-1^A},L={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},J={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:z,_tr_stored_block:v,_tr_flush_block:N,_tr_tally:Z,_tr_align:j}=b,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:q,Z_FULL_FLUSH:X,Z_FINISH:V,Z_BLOCK:$,Z_OK:AA,Z_STREAM_END:tA,Z_STREAM_ERROR:eA,Z_DATA_ERROR:iA,Z_BUF_ERROR:sA,Z_DEFAULT_COMPRESSION:aA,Z_FILTERED:nA,Z_HUFFMAN_ONLY:hA,Z_RLE:rA,Z_FIXED:EA,Z_DEFAULT_STRATEGY:gA,Z_UNKNOWN:oA,Z_DEFLATED:BA}=J,wA=258,cA=262,IA=42,CA=113,lA=666,_A=(A,t)=>(A.msg=L[t],t),dA=A=>2*A-(A>4?9:0),DA=A=>{let t=A.length;for(;--t>=0;)A[t]=0},MA=A=>{let t,e,i,s=A.w_size;t=A.hash_size,i=t;do{e=A.head[--i],A.head[i]=e>=s?e-s:0}while(--t);t=s,i=t;do{e=A.prev[--i],A.prev[i]=e>=s?e-s:0}while(--t)};let QA=(A,t,e)=>(t<{const t=A.state;let e=t.pending;e>A.avail_out&&(e=A.avail_out),0!==e&&(A.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),A.next_out),A.next_out+=e,t.pending_out+=e,A.total_out+=e,A.avail_out-=e,t.pending-=e,0===t.pending&&(t.pending_out=0))},RA=(A,t)=>{N(A,A.block_start>=0?A.block_start:-1,A.strstart-A.block_start,t),A.block_start=A.strstart,SA(A.strm)},fA=(A,t)=>{A.pending_buf[A.pending++]=t},FA=(A,t)=>{A.pending_buf[A.pending++]=t>>>8&255,A.pending_buf[A.pending++]=255&t},uA=(A,t,e,i)=>{let s=A.avail_in;return s>i&&(s=i),0===s?0:(A.avail_in-=s,t.set(A.input.subarray(A.next_in,A.next_in+s),e),1===A.state.wrap?A.adler=Y(A.adler,t,s,e):2===A.state.wrap&&(A.adler=x(A.adler,t,s,e)),A.next_in+=s,A.total_in+=s,s)},TA=(A,t)=>{let e,i,s=A.max_chain_length,a=A.strstart,n=A.prev_length,h=A.nice_match;const r=A.strstart>A.w_size-cA?A.strstart-(A.w_size-cA):0,E=A.window,g=A.w_mask,o=A.prev,B=A.strstart+wA;let w=E[a+n-1],c=E[a+n];A.prev_length>=A.good_match&&(s>>=2),h>A.lookahead&&(h=A.lookahead);do{if(e=t,E[e+n]===c&&E[e+n-1]===w&&E[e]===E[a]&&E[++e]===E[a+1]){a+=2,e++;do{}while(E[++a]===E[++e]&&E[++a]===E[++e]&&E[++a]===E[++e]&&E[++a]===E[++e]&&E[++a]===E[++e]&&E[++a]===E[++e]&&E[++a]===E[++e]&&E[++a]===E[++e]&&an){if(A.match_start=t,n=i,i>=h)break;w=E[a+n-1],c=E[a+n]}}}while((t=o[t&g])>r&&0!=--s);return n<=A.lookahead?n:A.lookahead},yA=A=>{const t=A.w_size;let e,i,s;do{if(i=A.window_size-A.lookahead-A.strstart,A.strstart>=t+(t-cA)&&(A.window.set(A.window.subarray(t,t+t-i),0),A.match_start-=t,A.strstart-=t,A.block_start-=t,A.insert>A.strstart&&(A.insert=A.strstart),MA(A),i+=t),0===A.strm.avail_in)break;if(e=uA(A.strm,A.window,A.strstart+A.lookahead,i),A.lookahead+=e,A.lookahead+A.insert>=3)for(s=A.strstart-A.insert,A.ins_h=A.window[s],A.ins_h=QA(A,A.ins_h,A.window[s+1]);A.insert&&(A.ins_h=QA(A,A.ins_h,A.window[s+3-1]),A.prev[s&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=s,s++,A.insert--,!(A.lookahead+A.insert<3)););}while(A.lookahead{let e,i,s,a=A.pending_buf_size-5>A.w_size?A.w_size:A.pending_buf_size-5,n=0,h=A.strm.avail_in;do{if(e=65535,s=A.bi_valid+42>>3,A.strm.avail_outi+A.strm.avail_in&&(e=i+A.strm.avail_in),e>s&&(e=s),e>8,A.pending_buf[A.pending-2]=~e,A.pending_buf[A.pending-1]=~e>>8,SA(A.strm),i&&(i>e&&(i=e),A.strm.output.set(A.window.subarray(A.block_start,A.block_start+i),A.strm.next_out),A.strm.next_out+=i,A.strm.avail_out-=i,A.strm.total_out+=i,A.block_start+=i,e-=i),e&&(uA(A.strm,A.strm.output,A.strm.next_out,e),A.strm.next_out+=e,A.strm.avail_out-=e,A.strm.total_out+=e)}while(0===n);return h-=A.strm.avail_in,h&&(h>=A.w_size?(A.matches=2,A.window.set(A.strm.input.subarray(A.strm.next_in-A.w_size,A.strm.next_in),0),A.strstart=A.w_size,A.insert=A.strstart):(A.window_size-A.strstart<=h&&(A.strstart-=A.w_size,A.window.set(A.window.subarray(A.w_size,A.w_size+A.strstart),0),A.matches<2&&A.matches++,A.insert>A.strstart&&(A.insert=A.strstart)),A.window.set(A.strm.input.subarray(A.strm.next_in-h,A.strm.next_in),A.strstart),A.strstart+=h,A.insert+=h>A.w_size-A.insert?A.w_size-A.insert:h),A.block_start=A.strstart),A.high_waters&&A.block_start>=A.w_size&&(A.block_start-=A.w_size,A.strstart-=A.w_size,A.window.set(A.window.subarray(A.w_size,A.w_size+A.strstart),0),A.matches<2&&A.matches++,s+=A.w_size,A.insert>A.strstart&&(A.insert=A.strstart)),s>A.strm.avail_in&&(s=A.strm.avail_in),s&&(uA(A.strm,A.window,A.strstart,s),A.strstart+=s,A.insert+=s>A.w_size-A.insert?A.w_size-A.insert:s),A.high_water>3,s=A.pending_buf_size-s>65535?65535:A.pending_buf_size-s,a=s>A.w_size?A.w_size:s,i=A.strstart-A.block_start,(i>=a||(i||t===V)&&t!==W&&0===A.strm.avail_in&&i<=s)&&(e=i>s?s:i,n=t===V&&0===A.strm.avail_in&&e===i?1:0,v(A,A.block_start,e,n),A.block_start+=e,SA(A.strm)),n?3:1)},kA=(A,t)=>{let e,i;for(;;){if(A.lookahead=3&&(A.ins_h=QA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),0!==e&&A.strstart-e<=A.w_size-cA&&(A.match_length=TA(A,e)),A.match_length>=3)if(i=Z(A,A.strstart-A.match_start,A.match_length-3),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=3){A.match_length--;do{A.strstart++,A.ins_h=QA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart}while(0!=--A.match_length);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=QA(A,A.ins_h,A.window[A.strstart+1]);else i=Z(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(i&&(RA(A,!1),0===A.strm.avail_out))return 1}return A.insert=A.strstart<2?A.strstart:2,t===V?(RA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(RA(A,!1),0===A.strm.avail_out)?1:2},HA=(A,t)=>{let e,i,s;for(;;){if(A.lookahead=3&&(A.ins_h=QA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=2,0!==e&&A.prev_length4096)&&(A.match_length=2)),A.prev_length>=3&&A.match_length<=A.prev_length){s=A.strstart+A.lookahead-3,i=Z(A,A.strstart-1-A.prev_match,A.prev_length-3),A.lookahead-=A.prev_length-1,A.prev_length-=2;do{++A.strstart<=s&&(A.ins_h=QA(A,A.ins_h,A.window[A.strstart+3-1]),e=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart)}while(0!=--A.prev_length);if(A.match_available=0,A.match_length=2,A.strstart++,i&&(RA(A,!1),0===A.strm.avail_out))return 1}else if(A.match_available){if(i=Z(A,0,A.window[A.strstart-1]),i&&RA(A,!1),A.strstart++,A.lookahead--,0===A.strm.avail_out)return 1}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(i=Z(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<2?A.strstart:2,t===V?(RA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(RA(A,!1),0===A.strm.avail_out)?1:2};function PA(A,t,e,i,s){this.good_length=A,this.max_lazy=t,this.nice_length=e,this.max_chain=i,this.func=s}const mA=[new PA(0,0,0,0,pA),new PA(4,4,8,4,kA),new PA(4,5,16,8,kA),new PA(4,6,32,32,kA),new PA(4,4,16,16,HA),new PA(8,16,32,32,HA),new PA(8,16,128,128,HA),new PA(8,32,128,256,HA),new PA(32,128,258,1024,HA),new PA(32,258,258,4096,HA)];function OA(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=BA,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),DA(this.dyn_ltree),DA(this.dyn_dtree),DA(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),DA(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),DA(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const GA=A=>{if(!A)return 1;const t=A.state;return!t||t.strm!==A||t.status!==IA&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==CA&&t.status!==lA?1:0},UA=A=>{if(GA(A))return _A(A,eA);A.total_in=A.total_out=0,A.data_type=oA;const t=A.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?IA:CA,A.adler=2===t.wrap?0:1,t.last_flush=-2,z(t),AA},bA=A=>{const t=UA(A);var e;return t===AA&&((e=A.state).window_size=2*e.w_size,DA(e.head),e.max_lazy_match=mA[e.level].max_lazy,e.good_match=mA[e.level].good_length,e.nice_match=mA[e.level].nice_length,e.max_chain_length=mA[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),t},YA=(A,t,e,i,s,a)=>{if(!A)return eA;let n=1;if(t===aA&&(t=6),i<0?(n=0,i=-i):i>15&&(n=2,i-=16),s<1||s>9||e!==BA||i<8||i>15||t<0||t>9||a<0||a>EA||8===i&&1!==n)return _A(A,eA);8===i&&(i=9);const h=new OA;return A.state=h,h.strm=A,h.status=IA,h.wrap=n,h.gzhead=null,h.w_bits=i,h.w_size=1<YA(A,t,BA,15,8,gA),deflateInit2:YA,deflateReset:bA,deflateResetKeep:UA,deflateSetHeader:(A,t)=>GA(A)||2!==A.state.wrap?eA:(A.state.gzhead=t,AA),deflate:(A,t)=>{if(GA(A)||t>$||t<0)return A?_A(A,eA):eA;const e=A.state;if(!A.output||0!==A.avail_in&&!A.input||e.status===lA&&t!==V)return _A(A,0===A.avail_out?sA:eA);const i=e.last_flush;if(e.last_flush=t,0!==e.pending){if(SA(A),0===A.avail_out)return e.last_flush=-1,AA}else if(0===A.avail_in&&dA(t)<=dA(i)&&t!==V)return _A(A,sA);if(e.status===lA&&0!==A.avail_in)return _A(A,sA);if(e.status===IA&&0===e.wrap&&(e.status=CA),e.status===IA){let t=BA+(e.w_bits-8<<4)<<8,i=-1;if(i=e.strategy>=hA||e.level<2?0:e.level<6?1:6===e.level?2:3,t|=i<<6,0!==e.strstart&&(t|=32),t+=31-t%31,FA(e,t),0!==e.strstart&&(FA(e,A.adler>>>16),FA(e,65535&A.adler)),A.adler=1,e.status=CA,SA(A),0!==e.pending)return e.last_flush=-1,AA}if(57===e.status)if(A.adler=0,fA(e,31),fA(e,139),fA(e,8),e.gzhead)fA(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),fA(e,255&e.gzhead.time),fA(e,e.gzhead.time>>8&255),fA(e,e.gzhead.time>>16&255),fA(e,e.gzhead.time>>24&255),fA(e,9===e.level?2:e.strategy>=hA||e.level<2?4:0),fA(e,255&e.gzhead.os),e.gzhead.extra&&e.gzhead.extra.length&&(fA(e,255&e.gzhead.extra.length),fA(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(A.adler=x(A.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=69;else if(fA(e,0),fA(e,0),fA(e,0),fA(e,0),fA(e,0),fA(e,9===e.level?2:e.strategy>=hA||e.level<2?4:0),fA(e,3),e.status=CA,SA(A),0!==e.pending)return e.last_flush=-1,AA;if(69===e.status){if(e.gzhead.extra){let t=e.pending,i=(65535&e.gzhead.extra.length)-e.gzindex;for(;e.pending+i>e.pending_buf_size;){let s=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>t&&(A.adler=x(A.adler,e.pending_buf,e.pending-t,t)),e.gzindex+=s,SA(A),0!==e.pending)return e.last_flush=-1,AA;t=0,i-=s}let s=new Uint8Array(e.gzhead.extra);e.pending_buf.set(s.subarray(e.gzindex,e.gzindex+i),e.pending),e.pending+=i,e.gzhead.hcrc&&e.pending>t&&(A.adler=x(A.adler,e.pending_buf,e.pending-t,t)),e.gzindex=0}e.status=73}if(73===e.status){if(e.gzhead.name){let t,i=e.pending;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(A.adler=x(A.adler,e.pending_buf,e.pending-i,i)),SA(A),0!==e.pending)return e.last_flush=-1,AA;i=0}t=e.gzindexi&&(A.adler=x(A.adler,e.pending_buf,e.pending-i,i)),e.gzindex=0}e.status=91}if(91===e.status){if(e.gzhead.comment){let t,i=e.pending;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(A.adler=x(A.adler,e.pending_buf,e.pending-i,i)),SA(A),0!==e.pending)return e.last_flush=-1,AA;i=0}t=e.gzindexi&&(A.adler=x(A.adler,e.pending_buf,e.pending-i,i))}e.status=103}if(103===e.status){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(SA(A),0!==e.pending))return e.last_flush=-1,AA;fA(e,255&A.adler),fA(e,A.adler>>8&255),A.adler=0}if(e.status=CA,SA(A),0!==e.pending)return e.last_flush=-1,AA}if(0!==A.avail_in||0!==e.lookahead||t!==W&&e.status!==lA){let i=0===e.level?pA(e,t):e.strategy===hA?((A,t)=>{let e;for(;;){if(0===A.lookahead&&(yA(A),0===A.lookahead)){if(t===W)return 1;break}if(A.match_length=0,e=Z(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,e&&(RA(A,!1),0===A.strm.avail_out))return 1}return A.insert=0,t===V?(RA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(RA(A,!1),0===A.strm.avail_out)?1:2})(e,t):e.strategy===rA?((A,t)=>{let e,i,s,a;const n=A.window;for(;;){if(A.lookahead<=wA){if(yA(A),A.lookahead<=wA&&t===W)return 1;if(0===A.lookahead)break}if(A.match_length=0,A.lookahead>=3&&A.strstart>0&&(s=A.strstart-1,i=n[s],i===n[++s]&&i===n[++s]&&i===n[++s])){a=A.strstart+wA;do{}while(i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&i===n[++s]&&sA.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=3?(e=Z(A,1,A.match_length-3),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(e=Z(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),e&&(RA(A,!1),0===A.strm.avail_out))return 1}return A.insert=0,t===V?(RA(A,!0),0===A.strm.avail_out?3:4):A.sym_next&&(RA(A,!1),0===A.strm.avail_out)?1:2})(e,t):mA[e.level].func(e,t);if(3!==i&&4!==i||(e.status=lA),1===i||3===i)return 0===A.avail_out&&(e.last_flush=-1),AA;if(2===i&&(t===q?j(e):t!==$&&(v(e,0,0,!1),t===X&&(DA(e.head),0===e.lookahead&&(e.strstart=0,e.block_start=0,e.insert=0))),SA(A),0===A.avail_out))return e.last_flush=-1,AA}return t!==V?AA:e.wrap<=0?tA:(2===e.wrap?(fA(e,255&A.adler),fA(e,A.adler>>8&255),fA(e,A.adler>>16&255),fA(e,A.adler>>24&255),fA(e,255&A.total_in),fA(e,A.total_in>>8&255),fA(e,A.total_in>>16&255),fA(e,A.total_in>>24&255)):(FA(e,A.adler>>>16),FA(e,65535&A.adler)),SA(A),e.wrap>0&&(e.wrap=-e.wrap),0!==e.pending?AA:tA)},deflateEnd:A=>{if(GA(A))return eA;const t=A.state.status;return A.state=null,t===CA?_A(A,iA):AA},deflateSetDictionary:(A,t)=>{let e=t.length;if(GA(A))return eA;const i=A.state,s=i.wrap;if(2===s||1===s&&i.status!==IA||i.lookahead)return eA;if(1===s&&(A.adler=Y(A.adler,t,e,0)),i.wrap=0,e>=i.w_size){0===s&&(DA(i.head),i.strstart=0,i.block_start=0,i.insert=0);let A=new Uint8Array(i.w_size);A.set(t.subarray(e-i.w_size,e),0),t=A,e=i.w_size}const a=A.avail_in,n=A.next_in,h=A.input;for(A.avail_in=e,A.next_in=0,A.input=t,yA(i);i.lookahead>=3;){let A=i.strstart,t=i.lookahead-2;do{i.ins_h=QA(i,i.ins_h,i.window[A+3-1]),i.prev[A&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=A,A++}while(--t);i.strstart=A,i.lookahead=2,yA(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,A.next_in=n,A.input=h,A.avail_in=a,i.wrap=s,AA},deflateInfo:"pako deflate (from Nodeca project)"};const xA=(A,t)=>Object.prototype.hasOwnProperty.call(A,t);var LA={assign:function(A){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if("object"!=typeof e)throw new TypeError(e+"must be non-object");for(const t in e)xA(e,t)&&(A[t]=e[t])}}return A},flattenChunks:A=>{let t=0;for(let e=0,i=A.length;e=252?6:A>=248?5:A>=240?4:A>=224?3:A>=192?2:1;zA[254]=zA[254]=1;var vA={string2buf:A=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(A);let t,e,i,s,a,n=A.length,h=0;for(s=0;s>>6,t[a++]=128|63&e):e<65536?(t[a++]=224|e>>>12,t[a++]=128|e>>>6&63,t[a++]=128|63&e):(t[a++]=240|e>>>18,t[a++]=128|e>>>12&63,t[a++]=128|e>>>6&63,t[a++]=128|63&e);return t},buf2string:(A,t)=>{const e=t||A.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(A.subarray(0,t));let i,s;const a=new Array(2*e);for(s=0,i=0;i4)a[s++]=65533,i+=n-1;else{for(t&=2===n?31:3===n?15:7;n>1&&i1?a[s++]=65533:t<65536?a[s++]=t:(t-=65536,a[s++]=55296|t>>10&1023,a[s++]=56320|1023&t)}}return((A,t)=>{if(t<65534&&A.subarray&&JA)return String.fromCharCode.apply(null,A.length===t?A:A.subarray(0,t));let e="";for(let i=0;i{(t=t||A.length)>A.length&&(t=A.length);let e=t-1;for(;e>=0&&128==(192&A[e]);)e--;return e<0||0===e?t:e+zA[A[e]]>t?e:t}};var NA=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const ZA=Object.prototype.toString,{Z_NO_FLUSH:jA,Z_SYNC_FLUSH:WA,Z_FULL_FLUSH:qA,Z_FINISH:XA,Z_OK:VA,Z_STREAM_END:$A,Z_DEFAULT_COMPRESSION:At,Z_DEFAULT_STRATEGY:tt,Z_DEFLATED:et}=J;function it(A){this.options=LA.assign({level:At,method:et,chunkSize:16384,windowBits:15,memLevel:8,strategy:tt},A||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new NA,this.strm.avail_out=0;let e=KA.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==VA)throw new Error(L[e]);if(t.header&&KA.deflateSetHeader(this.strm,t.header),t.dictionary){let A;if(A="string"==typeof t.dictionary?vA.string2buf(t.dictionary):"[object ArrayBuffer]"===ZA.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,e=KA.deflateSetDictionary(this.strm,A),e!==VA)throw new Error(L[e]);this._dict_set=!0}}function st(A,t){const e=new it(t);if(e.push(A,!0),e.err)throw e.msg||L[e.err];return e.result}it.prototype.push=function(A,t){const e=this.strm,i=this.options.chunkSize;let s,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?XA:jA,"string"==typeof A?e.input=vA.string2buf(A):"[object ArrayBuffer]"===ZA.call(A)?e.input=new Uint8Array(A):e.input=A,e.next_in=0,e.avail_in=e.input.length;;)if(0===e.avail_out&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),(a===WA||a===qA)&&e.avail_out<=6)this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;else{if(s=KA.deflate(e,a),s===$A)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),s=KA.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===VA;if(0!==e.avail_out){if(a>0&&e.next_out>0)this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;else if(0===e.avail_in)break}else this.onData(e.output)}return!0},it.prototype.onData=function(A){this.chunks.push(A)},it.prototype.onEnd=function(A){A===VA&&(this.result=LA.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var at={Deflate:it,deflate:st,deflateRaw:function(A,t){return(t=t||{}).raw=!0,st(A,t)},gzip:function(A,t){return(t=t||{}).gzip=!0,st(A,t)},constants:J};const nt=16209;var ht=function(A,t){let e,i,s,a,n,h,r,E,g,o,B,w,c,I,C,l,_,d,D,M,Q,S,R,f;const F=A.state;e=A.next_in,R=A.input,i=e+(A.avail_in-5),s=A.next_out,f=A.output,a=s-(t-A.avail_out),n=s+(A.avail_out-257),h=F.dmax,r=F.wsize,E=F.whave,g=F.wnext,o=F.window,B=F.hold,w=F.bits,c=F.lencode,I=F.distcode,C=(1<>>24,B>>>=d,w-=d,d=_>>>16&255,0===d)f[s++]=65535&_;else{if(!(16&d)){if(0==(64&d)){_=c[(65535&_)+(B&(1<>>=d,w-=d),w<15&&(B+=R[e++]<>>24,B>>>=d,w-=d,d=_>>>16&255,!(16&d)){if(0==(64&d)){_=I[(65535&_)+(B&(1<h){A.msg="invalid distance too far back",F.mode=nt;break A}if(B>>>=d,w-=d,d=s-a,M>d){if(d=M-d,d>E&&F.sane){A.msg="invalid distance too far back",F.mode=nt;break A}if(Q=0,S=o,0===g){if(Q+=r-d,d2;)f[s++]=S[Q++],f[s++]=S[Q++],f[s++]=S[Q++],D-=3;D&&(f[s++]=S[Q++],D>1&&(f[s++]=S[Q++]))}else{Q=s-M;do{f[s++]=f[Q++],f[s++]=f[Q++],f[s++]=f[Q++],D-=3}while(D>2);D&&(f[s++]=f[Q++],D>1&&(f[s++]=f[Q++]))}break}}break}}while(e>3,e-=D,w-=D<<3,B&=(1<{const r=h.bits;let E,g,o,B,w,c,I=0,C=0,l=0,_=0,d=0,D=0,M=0,Q=0,S=0,R=0,f=null;const F=new Uint16Array(16),u=new Uint16Array(16);let T,y,p,k=null;for(I=0;I<=rt;I++)F[I]=0;for(C=0;C=1&&0===F[_];_--);if(d>_&&(d=_),0===_)return s[a++]=20971520,s[a++]=20971520,h.bits=1,0;for(l=1;l<_&&0===F[l];l++);for(d0&&(0===A||1!==_))return-1;for(u[1]=0,I=1;I852||2===A&&S>592)return 1;for(;;){T=I-M,n[C]+1=c?(y=k[n[C]-c],p=f[n[C]-c]):(y=96,p=0),E=1<>M)+g]=T<<24|y<<16|p|0}while(0!==g);for(E=1<>=1;if(0!==E?(R&=E-1,R+=E):R=0,C++,0==--F[I]){if(I===_)break;I=t[e+n[C]]}if(I>d&&(R&B)!==o){for(0===M&&(M=d),w+=l,D=I-M,Q=1<852||2===A&&S>592)return 1;o=R&B,s[o]=d<<24|D<<16|w-a|0}}return 0!==R&&(s[w+R]=I-M<<24|64<<16|0),h.bits=d,0};const{Z_FINISH:ct,Z_BLOCK:It,Z_TREES:Ct,Z_OK:lt,Z_STREAM_END:_t,Z_NEED_DICT:dt,Z_STREAM_ERROR:Dt,Z_DATA_ERROR:Mt,Z_MEM_ERROR:Qt,Z_BUF_ERROR:St,Z_DEFLATED:Rt}=J,ft=16180,Ft=16190,ut=16191,Tt=16192,yt=16194,pt=16199,kt=16200,Ht=16206,Pt=16209,mt=A=>(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24);function Ot(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Gt=A=>{if(!A)return 1;const t=A.state;return!t||t.strm!==A||t.mode16211?1:0},Ut=A=>{if(Gt(A))return Dt;const t=A.state;return A.total_in=A.total_out=t.total=0,A.msg="",t.wrap&&(A.adler=1&t.wrap),t.mode=ft,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,lt},bt=A=>{if(Gt(A))return Dt;const t=A.state;return t.wsize=0,t.whave=0,t.wnext=0,Ut(A)},Yt=(A,t)=>{let e;if(Gt(A))return Dt;const i=A.state;return t<0?(e=0,t=-t):(e=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Dt:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=e,i.wbits=t,bt(A))},Kt=(A,t)=>{if(!A)return Dt;const e=new Ot;A.state=e,e.strm=A,e.window=null,e.mode=ft;const i=Yt(A,t);return i!==lt&&(A.state=null),i};let xt,Lt,Jt=!0;const zt=A=>{if(Jt){xt=new Int32Array(512),Lt=new Int32Array(32);let t=0;for(;t<144;)A.lens[t++]=8;for(;t<256;)A.lens[t++]=9;for(;t<280;)A.lens[t++]=7;for(;t<288;)A.lens[t++]=8;for(wt(1,A.lens,0,288,xt,0,A.work,{bits:9}),t=0;t<32;)A.lens[t++]=5;wt(2,A.lens,0,32,Lt,0,A.work,{bits:5}),Jt=!1}A.lencode=xt,A.lenbits=9,A.distcode=Lt,A.distbits=5},vt=(A,t,e,i)=>{let s;const a=A.state;return null===a.window&&(a.wsize=1<=a.wsize?(a.window.set(t.subarray(e-a.wsize,e),0),a.wnext=0,a.whave=a.wsize):(s=a.wsize-a.wnext,s>i&&(s=i),a.window.set(t.subarray(e-i,e-i+s),a.wnext),(i-=s)?(a.window.set(t.subarray(e-i,e),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whaveKt(A,15),inflateInit2:Kt,inflate:(A,t)=>{let e,i,s,a,n,h,r,E,g,o,B,w,c,I,C,l,_,d,D,M,Q,S,R=0;const f=new Uint8Array(4);let F,u;const T=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Gt(A)||!A.output||!A.input&&0!==A.avail_in)return Dt;e=A.state,e.mode===ut&&(e.mode=Tt),n=A.next_out,s=A.output,r=A.avail_out,a=A.next_in,i=A.input,h=A.avail_in,E=e.hold,g=e.bits,o=h,B=r,S=lt;A:for(;;)switch(e.mode){case ft:if(0===e.wrap){e.mode=Tt;break}for(;g<16;){if(0===h)break A;h--,E+=i[a++]<>>8&255,e.check=x(e.check,f,2,0),E=0,g=0,e.mode=16181;break}if(e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&E)<<8)+(E>>8))%31){A.msg="incorrect header check",e.mode=Pt;break}if((15&E)!==Rt){A.msg="unknown compression method",e.mode=Pt;break}if(E>>>=4,g-=4,Q=8+(15&E),0===e.wbits&&(e.wbits=Q),Q>15||Q>e.wbits){A.msg="invalid window size",e.mode=Pt;break}e.dmax=1<>8&1),512&e.flags&&4&e.wrap&&(f[0]=255&E,f[1]=E>>>8&255,e.check=x(e.check,f,2,0)),E=0,g=0,e.mode=16182;case 16182:for(;g<32;){if(0===h)break A;h--,E+=i[a++]<>>8&255,f[2]=E>>>16&255,f[3]=E>>>24&255,e.check=x(e.check,f,4,0)),E=0,g=0,e.mode=16183;case 16183:for(;g<16;){if(0===h)break A;h--,E+=i[a++]<>8),512&e.flags&&4&e.wrap&&(f[0]=255&E,f[1]=E>>>8&255,e.check=x(e.check,f,2,0)),E=0,g=0,e.mode=16184;case 16184:if(1024&e.flags){for(;g<16;){if(0===h)break A;h--,E+=i[a++]<>>8&255,e.check=x(e.check,f,2,0)),E=0,g=0}else e.head&&(e.head.extra=null);e.mode=16185;case 16185:if(1024&e.flags&&(w=e.length,w>h&&(w=h),w&&(e.head&&(Q=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(i.subarray(a,a+w),Q)),512&e.flags&&4&e.wrap&&(e.check=x(e.check,i,w,a)),h-=w,a+=w,e.length-=w),e.length))break A;e.length=0,e.mode=16186;case 16186:if(2048&e.flags){if(0===h)break A;w=0;do{Q=i[a+w++],e.head&&Q&&e.length<65536&&(e.head.name+=String.fromCharCode(Q))}while(Q&&w>9&1,e.head.done=!0),A.adler=e.check=0,e.mode=ut;break;case 16189:for(;g<32;){if(0===h)break A;h--,E+=i[a++]<>>=7&g,g-=7&g,e.mode=Ht;break}for(;g<3;){if(0===h)break A;h--,E+=i[a++]<>>=1,g-=1,3&E){case 0:e.mode=16193;break;case 1:if(zt(e),e.mode=pt,t===Ct){E>>>=2,g-=2;break A}break;case 2:e.mode=16196;break;case 3:A.msg="invalid block type",e.mode=Pt}E>>>=2,g-=2;break;case 16193:for(E>>>=7&g,g-=7&g;g<32;){if(0===h)break A;h--,E+=i[a++]<>>16^65535)){A.msg="invalid stored block lengths",e.mode=Pt;break}if(e.length=65535&E,E=0,g=0,e.mode=yt,t===Ct)break A;case yt:e.mode=16195;case 16195:if(w=e.length,w){if(w>h&&(w=h),w>r&&(w=r),0===w)break A;s.set(i.subarray(a,a+w),n),h-=w,a+=w,r-=w,n+=w,e.length-=w;break}e.mode=ut;break;case 16196:for(;g<14;){if(0===h)break A;h--,E+=i[a++]<>>=5,g-=5,e.ndist=1+(31&E),E>>>=5,g-=5,e.ncode=4+(15&E),E>>>=4,g-=4,e.nlen>286||e.ndist>30){A.msg="too many length or distance symbols",e.mode=Pt;break}e.have=0,e.mode=16197;case 16197:for(;e.have>>=3,g-=3}for(;e.have<19;)e.lens[T[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,F={bits:e.lenbits},S=wt(0,e.lens,0,19,e.lencode,0,e.work,F),e.lenbits=F.bits,S){A.msg="invalid code lengths set",e.mode=Pt;break}e.have=0,e.mode=16198;case 16198:for(;e.have>>24,l=R>>>16&255,_=65535&R,!(C<=g);){if(0===h)break A;h--,E+=i[a++]<>>=C,g-=C,e.lens[e.have++]=_;else{if(16===_){for(u=C+2;g>>=C,g-=C,0===e.have){A.msg="invalid bit length repeat",e.mode=Pt;break}Q=e.lens[e.have-1],w=3+(3&E),E>>>=2,g-=2}else if(17===_){for(u=C+3;g>>=C,g-=C,Q=0,w=3+(7&E),E>>>=3,g-=3}else{for(u=C+7;g>>=C,g-=C,Q=0,w=11+(127&E),E>>>=7,g-=7}if(e.have+w>e.nlen+e.ndist){A.msg="invalid bit length repeat",e.mode=Pt;break}for(;w--;)e.lens[e.have++]=Q}}if(e.mode===Pt)break;if(0===e.lens[256]){A.msg="invalid code -- missing end-of-block",e.mode=Pt;break}if(e.lenbits=9,F={bits:e.lenbits},S=wt(1,e.lens,0,e.nlen,e.lencode,0,e.work,F),e.lenbits=F.bits,S){A.msg="invalid literal/lengths set",e.mode=Pt;break}if(e.distbits=6,e.distcode=e.distdyn,F={bits:e.distbits},S=wt(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,F),e.distbits=F.bits,S){A.msg="invalid distances set",e.mode=Pt;break}if(e.mode=pt,t===Ct)break A;case pt:e.mode=kt;case kt:if(h>=6&&r>=258){A.next_out=n,A.avail_out=r,A.next_in=a,A.avail_in=h,e.hold=E,e.bits=g,ht(A,B),n=A.next_out,s=A.output,r=A.avail_out,a=A.next_in,i=A.input,h=A.avail_in,E=e.hold,g=e.bits,e.mode===ut&&(e.back=-1);break}for(e.back=0;R=e.lencode[E&(1<>>24,l=R>>>16&255,_=65535&R,!(C<=g);){if(0===h)break A;h--,E+=i[a++]<>d)],C=R>>>24,l=R>>>16&255,_=65535&R,!(d+C<=g);){if(0===h)break A;h--,E+=i[a++]<>>=d,g-=d,e.back+=d}if(E>>>=C,g-=C,e.back+=C,e.length=_,0===l){e.mode=16205;break}if(32&l){e.back=-1,e.mode=ut;break}if(64&l){A.msg="invalid literal/length code",e.mode=Pt;break}e.extra=15&l,e.mode=16201;case 16201:if(e.extra){for(u=e.extra;g>>=e.extra,g-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=16202;case 16202:for(;R=e.distcode[E&(1<>>24,l=R>>>16&255,_=65535&R,!(C<=g);){if(0===h)break A;h--,E+=i[a++]<>d)],C=R>>>24,l=R>>>16&255,_=65535&R,!(d+C<=g);){if(0===h)break A;h--,E+=i[a++]<>>=d,g-=d,e.back+=d}if(E>>>=C,g-=C,e.back+=C,64&l){A.msg="invalid distance code",e.mode=Pt;break}e.offset=_,e.extra=15&l,e.mode=16203;case 16203:if(e.extra){for(u=e.extra;g>>=e.extra,g-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){A.msg="invalid distance too far back",e.mode=Pt;break}e.mode=16204;case 16204:if(0===r)break A;if(w=B-r,e.offset>w){if(w=e.offset-w,w>e.whave&&e.sane){A.msg="invalid distance too far back",e.mode=Pt;break}w>e.wnext?(w-=e.wnext,c=e.wsize-w):c=e.wnext-w,w>e.length&&(w=e.length),I=e.window}else I=s,c=n-e.offset,w=e.length;w>r&&(w=r),r-=w,e.length-=w;do{s[n++]=I[c++]}while(--w);0===e.length&&(e.mode=kt);break;case 16205:if(0===r)break A;s[n++]=e.length,r--,e.mode=kt;break;case Ht:if(e.wrap){for(;g<32;){if(0===h)break A;h--,E|=i[a++]<{if(Gt(A))return Dt;let t=A.state;return t.window&&(t.window=null),A.state=null,lt},inflateGetHeader:(A,t)=>{if(Gt(A))return Dt;const e=A.state;return 0==(2&e.wrap)?Dt:(e.head=t,t.done=!1,lt)},inflateSetDictionary:(A,t)=>{const e=t.length;let i,s,a;return Gt(A)?Dt:(i=A.state,0!==i.wrap&&i.mode!==Ft?Dt:i.mode===Ft&&(s=1,s=Y(s,t,e,0),s!==i.check)?Mt:(a=vt(A,t,e,e),a?(i.mode=16210,Qt):(i.havedict=1,lt)))},inflateInfo:"pako inflate (from Nodeca project)"};var Zt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const jt=Object.prototype.toString,{Z_NO_FLUSH:Wt,Z_FINISH:qt,Z_OK:Xt,Z_STREAM_END:Vt,Z_NEED_DICT:$t,Z_STREAM_ERROR:Ae,Z_DATA_ERROR:te,Z_MEM_ERROR:ee}=J;function ie(A){this.options=LA.assign({chunkSize:65536,windowBits:15,to:""},A||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||A&&A.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new NA,this.strm.avail_out=0;let e=Nt.inflateInit2(this.strm,t.windowBits);if(e!==Xt)throw new Error(L[e]);if(this.header=new Zt,Nt.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=vA.string2buf(t.dictionary):"[object ArrayBuffer]"===jt.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=Nt.inflateSetDictionary(this.strm,t.dictionary),e!==Xt)))throw new Error(L[e])}function se(A,t){const e=new ie(t);if(e.push(A),e.err)throw e.msg||L[e.err];return e.result}ie.prototype.push=function(A,t){const e=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let a,n,h;if(this.ended)return!1;for(n=t===~~t?t:!0===t?qt:Wt,"[object ArrayBuffer]"===jt.call(A)?e.input=new Uint8Array(A):e.input=A,e.next_in=0,e.avail_in=e.input.length;;){for(0===e.avail_out&&(e.output=new Uint8Array(i),e.next_out=0,e.avail_out=i),a=Nt.inflate(e,n),a===$t&&s&&(a=Nt.inflateSetDictionary(e,s),a===Xt?a=Nt.inflate(e,n):a===te&&(a=$t));e.avail_in>0&&a===Vt&&e.state.wrap>0&&0!==A[e.next_in];)Nt.inflateReset(e),a=Nt.inflate(e,n);switch(a){case Ae:case te:case $t:case ee:return this.onEnd(a),this.ended=!0,!1}if(h=e.avail_out,e.next_out&&(0===e.avail_out||a===Vt))if("string"===this.options.to){let A=vA.utf8border(e.output,e.next_out),t=e.next_out-A,s=vA.buf2string(e.output,A);e.next_out=t,e.avail_out=i-t,t&&e.output.set(e.output.subarray(A,A+t),0),this.onData(s)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(a!==Xt||0!==h){if(a===Vt)return a=Nt.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===e.avail_in)break}}return!0},ie.prototype.onData=function(A){this.chunks.push(A)},ie.prototype.onEnd=function(A){A===Xt&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=LA.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var ae={Inflate:ie,inflate:se,inflateRaw:function(A,t){return(t=t||{}).raw=!0,se(A,t)},ungzip:se,constants:J};const{Deflate:ne,deflate:he,deflateRaw:re,gzip:Ee}=at,{Inflate:ge,inflate:oe,inflateRaw:Be,ungzip:we}=ae;var ce=he,Ie=ge;class Ce{constructor(A,t=!1,e=!0){this.device=A,this.tracing=t,this.slipReaderEnabled=!1,this.leftOver=new Uint8Array(0),this.baudrate=0,this.traceLog="",this.lastTraceTime=Date.now(),this._DTR_state=!1,this.slipReaderEnabled=e}getInfo(){const A=this.device.getInfo();return A.usbVendorId&&A.usbProductId?`WebSerial VendorID 0x${A.usbVendorId.toString(16)} ProductID 0x${A.usbProductId.toString(16)}`:""}getPid(){return this.device.getInfo().usbProductId}trace(A){const t=`${`TRACE ${(Date.now()-this.lastTraceTime).toFixed(3)}`} ${A}`;console.log(t),this.traceLog+=t+"\n"}async returnTrace(){try{await navigator.clipboard.writeText(this.traceLog),console.log("Text copied to clipboard!")}catch(A){console.error("Failed to copy text:",A)}}hexify(A){return Array.from(A).map((A=>A.toString(16).padStart(2,"0"))).join("").padEnd(16," ")}hexConvert(A,t=!0){if(t&&A.length>16){let t="",e=A;for(;e.length>0;){const A=e.slice(0,16),i=String.fromCharCode(...A).split("").map((A=>" "===A||A>=" "&&A<="~"&&" "!==A?A:".")).join("");e=e.slice(16),t+=`\n ${this.hexify(A.slice(0,8))} ${this.hexify(A.slice(8))} | ${i}`}return t}return this.hexify(A)}slipWriter(A){const t=[];t.push(192);for(let e=0;e0)return A;i=this.leftOver,this.leftOver=new Uint8Array(0)}if(null==this.device.readable)return this.leftOver;this.reader=this.device.readable.getReader();try{A>0&&(e=setTimeout((()=>{this.reader&&this.reader.cancel()}),A));do{const{value:A,done:t}=await this.reader.read();if(t)throw this.leftOver=i,new Error("Timeout");i=new Uint8Array(this._appendBuffer(i.buffer,A.buffer))}while(i.length0&&clearTimeout(e),this.reader.releaseLock()}if(this.tracing&&(console.log("Read bytes"),this.trace(`Read ${i.length} bytes: ${this.hexConvert(i)}`)),this.slipReaderEnabled){const A=this.slipReader(i);return this.tracing&&(console.log("Slip reader results"),this.trace(`Read ${A.length} bytes: ${this.hexConvert(A)}`)),A}return i}async rawRead(A=0){if(0!=this.leftOver.length){const A=this.leftOver;return this.leftOver=new Uint8Array(0),A}if(!this.device.readable)return this.leftOver;let t;this.reader=this.device.readable.getReader();try{A>0&&(t=setTimeout((()=>{this.reader&&this.reader.cancel()}),A));const{value:e,done:i}=await this.reader.read();return i||this.tracing&&(console.log("Raw Read bytes"),this.trace(`Read ${e.length} bytes: ${this.hexConvert(e)}`)),e}finally{A>0&&clearTimeout(t),this.reader.releaseLock()}}async setRTS(A){await this.device.setSignals({requestToSend:A}),await this.setDTR(this._DTR_state)}async setDTR(A){this._DTR_state=A,await this.device.setSignals({dataTerminalReady:A})}async connect(A=115200,t={}){await this.device.open({baudRate:A,dataBits:null==t?void 0:t.dataBits,stopBits:null==t?void 0:t.stopBits,bufferSize:null==t?void 0:t.bufferSize,parity:null==t?void 0:t.parity,flowControl:null==t?void 0:t.flowControl}),this.baudrate=A,this.leftOver=new Uint8Array(0)}async sleep(A){return new Promise((t=>setTimeout(t,A)))}async waitForUnlock(A){for(;this.device.readable&&this.device.readable.locked||this.device.writable&&this.device.writable.locked;)await this.sleep(A)}async disconnect(){var A,t;(null===(A=this.device.readable)||void 0===A?void 0:A.locked)&&await(null===(t=this.reader)||void 0===t?void 0:t.cancel()),await this.waitForUnlock(400),this.reader=void 0,await this.device.close()}}function le(A){return new Promise((t=>setTimeout(t,A)))}async function _e(A,t=50){await A.setDTR(!1),await A.setRTS(!0),await le(100),await A.setDTR(!0),await A.setRTS(!1),await le(t),await A.setDTR(!1)}async function de(A){await A.setRTS(!1),await A.setDTR(!1),await le(100),await A.setDTR(!0),await A.setRTS(!1),await le(100),await A.setRTS(!0),await A.setDTR(!1),await A.setRTS(!0),await le(100),await A.setRTS(!1),await A.setDTR(!1)}async function De(A,t=!1){t?(await le(200),await A.setRTS(!1),await le(200)):(await le(100),await A.setRTS(!1))}function Me(A){const t=["D","R","W"],e=A.split("|");for(const A of e){const e=A[0],i=A.slice(1);if(!t.includes(e))return!1;if("D"===e||"R"===e){if("0"!==i&&"1"!==i)return!1}else if("W"===e){const A=parseInt(i);if(isNaN(A)||A<=0)return!1}}return!0}async function Qe(A,t){const e={D:async t=>await A.setDTR(t),R:async t=>await A.setRTS(t),W:async A=>await le(A)};try{if(!Me(t))return;const A=t.split("|");for(const t of A){const A=t[0],i=t.slice(1);"W"===A?await e.W(Number(i)):"D"!==A&&"R"!==A||await e[A]("1"===i)}}catch(A){throw new Error("Invalid custom reset sequence")}}var Se=function(A){return atob(A)};class Re{constructor(A){this.ESP_RAM_BLOCK=6144,this.ESP_FLASH_BEGIN=2,this.ESP_FLASH_DATA=3,this.ESP_FLASH_END=4,this.ESP_MEM_BEGIN=5,this.ESP_MEM_END=6,this.ESP_MEM_DATA=7,this.ESP_WRITE_REG=9,this.ESP_READ_REG=10,this.ESP_SPI_ATTACH=13,this.ESP_CHANGE_BAUDRATE=15,this.ESP_FLASH_DEFL_BEGIN=16,this.ESP_FLASH_DEFL_DATA=17,this.ESP_FLASH_DEFL_END=18,this.ESP_SPI_FLASH_MD5=19,this.ESP_ERASE_FLASH=208,this.ESP_ERASE_REGION=209,this.ESP_READ_FLASH=210,this.ESP_RUN_USER_CODE=211,this.ESP_IMAGE_MAGIC=233,this.ESP_CHECKSUM_MAGIC=239,this.ROM_INVALID_RECV_MSG=5,this.ERASE_REGION_TIMEOUT_PER_MB=3e4,this.ERASE_WRITE_TIMEOUT_PER_MB=4e4,this.MD5_TIMEOUT_PER_MB=8e3,this.CHIP_ERASE_TIMEOUT=12e4,this.FLASH_READ_TIMEOUT=1e5,this.MAX_TIMEOUT=2*this.CHIP_ERASE_TIMEOUT,this.CHIP_DETECT_MAGIC_REG_ADDR=1073745920,this.DETECTED_FLASH_SIZES={18:"256KB",19:"512KB",20:"1MB",21:"2MB",22:"4MB",23:"8MB",24:"16MB"},this.DETECTED_FLASH_SIZES_NUM={18:256,19:512,20:1024,21:2048,22:4096,23:8192,24:16384},this.USB_JTAG_SERIAL_PID=4097,this.romBaudrate=115200,this.debugLogging=!1,this.syncStubDetected=!1,this.checksum=function(A){let t,e=239;for(t=0;tsetTimeout(t,A)))}write(A,t=!0){this.terminal?t?this.terminal.writeLine(A):this.terminal.write(A):console.log(A)}error(A,t=!0){this.write(`Error: ${A}`,t)}info(A,t=!0){this.write(A,t)}debug(A,t=!0){this.debugLogging&&this.write(`Debug: ${A}`,t)}_shortToBytearray(A){return new Uint8Array([255&A,A>>8&255])}_intToByteArray(A){return new Uint8Array([255&A,A>>8&255,A>>16&255,A>>24&255])}_byteArrayToShort(A,t){return A|t>>8}_byteArrayToInt(A,t,e,i){return A|t<<8|e<<16|i<<24}_appendBuffer(A,t){const e=new Uint8Array(A.byteLength+t.byteLength);return e.set(new Uint8Array(A),0),e.set(new Uint8Array(t),A.byteLength),e.buffer}_appendArray(A,t){const e=new Uint8Array(A.length+t.length);return e.set(A,0),e.set(t,A.length),e}ui8ToBstr(A){let t="";for(let e=0;e0&&(a=this._appendArray(a,this._intToByteArray(this.chip.UART_DATE_REG_ADDR)),a=this._appendArray(a,this._intToByteArray(0)),a=this._appendArray(a,this._intToByteArray(0)),a=this._appendArray(a,this._intToByteArray(s))),await this.checkCommand("write target memory",this.ESP_WRITE_REG,a)}async sync(){this.debug("Sync");const A=new Uint8Array(36);let t;for(A[0]=7,A[1]=7,A[2]=18,A[3]=32,t=0;t<32;t++)A[4+t]=85;try{const t=await this.command(8,A,void 0,void 0,100);return this.syncStubDetected=this.syncStubDetected&&0===t[0],t}catch(A){throw this.debug("Sync err "+A),A}}async _connectAttempt(A="default_reset",t=!1){if(this.debug("_connect_attempt "+A+" "+t),"no_reset"!==A)if(this.transport.getPid()===this.USB_JTAG_SERIAL_PID)await de(this.transport);else{const A=t?"D0|R1|W100|W2000|D1|R0|W50|D0":"D0|R1|W100|D1|R0|W50|D0";await Qe(this.transport,A)}let e=0,i=!0;for(;i;){try{e+=(await this.transport.read(1e3)).length}catch(A){if(this.debug(A.message),A instanceof Error){i=!1;break}}await this._sleep(50)}for(this.transport.slipReaderEnabled=!0,this.syncStubDetected=!0,e=7;e--;){try{const A=await this.sync();return this.debug(A[0].toString()),"success"}catch(A){A instanceof Error&&(t?this.info("_",!1):this.info(".",!1))}await this._sleep(50)}return"error"}async connect(t="default_reset",e=7,i=!1){let s,a;for(this.info("Connecting...",!1),await this.transport.connect(this.romBaudrate,this.serialOptions),s=0;s>>0;this.debug("Chip Magic "+t.toString(16));const e=await async function(A){switch(A){case 15736195:{const{ESP32ROM:A}=await Promise.resolve().then((function(){return He}));return new A}case 1867591791:case 2084675695:{const{ESP32C2ROM:A}=await Promise.resolve().then((function(){return ve}));return new A}case 1763790959:case 456216687:case 1216438383:case 1130455151:{const{ESP32C3ROM:A}=await Promise.resolve().then((function(){return Ye}));return new A}case 752910447:{const{ESP32C6ROM:A}=await Promise.resolve().then((function(){return Xe}));return new A}case 3619110528:{const{ESP32H2ROM:A}=await Promise.resolve().then((function(){return ii}));return new A}case 9:{const{ESP32S3ROM:A}=await Promise.resolve().then((function(){return Ei}));return new A}case 1990:{const{ESP32S2ROM:A}=await Promise.resolve().then((function(){return Ii}));return new A}case 4293968129:{const{ESP8266ROM:A}=await Promise.resolve().then((function(){return Mi}));return new A}case 0:case 182303440:case 117676761:{const{ESP32P4ROM:A}=await Promise.resolve().then((function(){return ui}));return new A}default:return null}}(t);if(null===this.chip)throw new A(`Unexpected CHIP magic value ${t}. Failed to autodetect chip type.`);this.chip=e}}async detectChip(A="default_reset"){await this.connect(A),this.info("Detecting chip type... ",!1),null!=this.chip?this.info(this.chip.CHIP_NAME):this.info("unknown!")}async checkCommand(A="",t=null,e=new Uint8Array(0),i=0,s=3e3){this.debug("check_command "+A);const a=await this.command(t,e,i,void 0,s);return a[1].length>4?a[1]:a[0]}async memBegin(A,t,e,i){this.debug("mem_begin "+A+" "+t+" "+e+" "+i.toString(16));let s=this._appendArray(this._intToByteArray(A),this._intToByteArray(t));s=this._appendArray(s,this._intToByteArray(e)),s=this._appendArray(s,this._intToByteArray(i)),await this.checkCommand("enter RAM download mode",this.ESP_MEM_BEGIN,s)}async memBlock(A,t){let e=this._appendArray(this._intToByteArray(A.length),this._intToByteArray(t));e=this._appendArray(e,this._intToByteArray(0)),e=this._appendArray(e,this._intToByteArray(0)),e=this._appendArray(e,A);const i=this.checksum(A);await this.checkCommand("write to target RAM",this.ESP_MEM_DATA,e,i)}async memFinish(A){const t=0===A?1:0,e=this._appendArray(this._intToByteArray(t),this._intToByteArray(A));await this.checkCommand("leave RAM download mode",this.ESP_MEM_END,e,void 0,50)}async flashSpiAttach(A){const t=this._intToByteArray(A);await this.checkCommand("configure SPI flash pins",this.ESP_SPI_ATTACH,t)}async flashBegin(A,t){const e=Math.floor((A+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),i=this.chip.getEraseSize(t,A),s=new Date,a=s.getTime();let n=3e3;0==this.IS_STUB&&(n=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,A)),this.debug("flash begin "+i+" "+e+" "+this.FLASH_WRITE_SIZE+" "+t+" "+A);let h=this._appendArray(this._intToByteArray(i),this._intToByteArray(e));h=this._appendArray(h,this._intToByteArray(this.FLASH_WRITE_SIZE)),h=this._appendArray(h,this._intToByteArray(t)),0==this.IS_STUB&&(h=this._appendArray(h,this._intToByteArray(0))),await this.checkCommand("enter Flash download mode",this.ESP_FLASH_BEGIN,h,void 0,n);const r=s.getTime();return 0!=A&&0==this.IS_STUB&&this.info("Took "+(r-a)/1e3+"."+(r-a)%1e3+"s to erase flash block"),e}async flashDeflBegin(A,t,e){const i=Math.floor((t+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),s=Math.floor((A+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),a=new Date,n=a.getTime();let h,r;this.IS_STUB?(h=A,r=3e3):(h=s*this.FLASH_WRITE_SIZE,r=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,h)),this.info("Compressed "+A+" bytes to "+t+"...");let E=this._appendArray(this._intToByteArray(h),this._intToByteArray(i));E=this._appendArray(E,this._intToByteArray(this.FLASH_WRITE_SIZE)),E=this._appendArray(E,this._intToByteArray(e)),"ESP32-S2"!==this.chip.CHIP_NAME&&"ESP32-S3"!==this.chip.CHIP_NAME&&"ESP32-C3"!==this.chip.CHIP_NAME&&"ESP32-C2"!==this.chip.CHIP_NAME||!1!==this.IS_STUB||(E=this._appendArray(E,this._intToByteArray(0))),await this.checkCommand("enter compressed flash mode",this.ESP_FLASH_DEFL_BEGIN,E,void 0,r);const g=a.getTime();return 0!=A&&!1===this.IS_STUB&&this.info("Took "+(g-n)/1e3+"."+(g-n)%1e3+"s to erase flash block"),i}async flashBlock(A,t,e){let i=this._appendArray(this._intToByteArray(A.length),this._intToByteArray(t));i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,A);const s=this.checksum(A);await this.checkCommand("write to target Flash after seq "+t,this.ESP_FLASH_DATA,i,s,e)}async flashDeflBlock(A,t,e){let i=this._appendArray(this._intToByteArray(A.length),this._intToByteArray(t));i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,A);const s=this.checksum(A);this.debug("flash_defl_block "+A[0].toString(16)+" "+A[1].toString(16)),await this.checkCommand("write compressed data to flash after seq "+t,this.ESP_FLASH_DEFL_DATA,i,s,e)}async flashFinish(A=!1){const t=A?0:1,e=this._intToByteArray(t);await this.checkCommand("leave Flash mode",this.ESP_FLASH_END,e)}async flashDeflFinish(A=!1){const t=A?0:1,e=this._intToByteArray(t);await this.checkCommand("leave compressed flash mode",this.ESP_FLASH_DEFL_END,e)}async runSpiflashCommand(t,e,i){const s=this.chip.SPI_REG_BASE,a=s+0,n=s+this.chip.SPI_USR_OFFS,h=s+this.chip.SPI_USR1_OFFS,r=s+this.chip.SPI_USR2_OFFS,E=s+this.chip.SPI_W0_OFFS;let g;g=null!=this.chip.SPI_MOSI_DLEN_OFFS?async(A,t)=>{const e=s+this.chip.SPI_MOSI_DLEN_OFFS,i=s+this.chip.SPI_MISO_DLEN_OFFS;A>0&&await this.writeReg(e,A-1),t>0&&await this.writeReg(i,t-1)}:async(A,t)=>{const e=h,i=(0===t?0:t-1)<<8|(0===A?0:A-1)<<17;await this.writeReg(e,i)};const o=1<<18;if(i>32)throw new A("Reading more than 32 bits back from a SPI flash operation is unsupported");if(e.length>64)throw new A("Writing more than 64 bytes of data with one SPI command is unsupported");const B=8*e.length,w=await this.readReg(n),c=await this.readReg(r);let I,C=1<<31;i>0&&(C|=268435456),B>0&&(C|=134217728),await g(B,i),await this.writeReg(n,C);let l=7<<28|t;if(await this.writeReg(r,l),0==B)await this.writeReg(E,0);else{if(e.length%4!=0){const A=new Uint8Array(e.length%4);e=this._appendArray(e,A)}let A=E;for(I=0;I("00"+A.toString(16)).slice(-2))).join("")}async flashMd5sum(A,t){const e=this.timeoutPerMb(this.MD5_TIMEOUT_PER_MB,t);let i=this._appendArray(this._intToByteArray(A),this._intToByteArray(t));i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,this._intToByteArray(0));let s=await this.checkCommand("calculate md5sum",this.ESP_SPI_FLASH_MD5,i,void 0,e);s instanceof Uint8Array&&s.length>16&&(s=s.slice(0,16));return this.toHex(s)}async readFlash(t,e,i=null){let s=this._appendArray(this._intToByteArray(t),this._intToByteArray(e));s=this._appendArray(s,this._intToByteArray(4096)),s=this._appendArray(s,this._intToByteArray(1024));const a=await this.checkCommand("read flash",this.ESP_READ_FLASH,s);if(0!=a)throw new A("Failed to read memory: "+a);let n=new Uint8Array(0);for(;n.length0&&(n=this._appendArray(n,t),await this.transport.write(this._intToByteArray(n.length)),i&&i(t,n.length,e))}return n}async runStub(){if(this.syncStubDetected)return this.info("Stub is already running. No upload is necessary."),this.chip;this.info("Uploading stub...");let t=Se(this.chip.ROM_TEXT),e=t.split("").map((function(A){return A.charCodeAt(0)}));const i=new Uint8Array(e);t=Se(this.chip.ROM_DATA),e=t.split("").map((function(A){return A.charCodeAt(0)}));const s=new Uint8Array(e);let a,n=Math.floor((i.length+this.ESP_RAM_BLOCK-1)/this.ESP_RAM_BLOCK);for(await this.memBegin(i.length,n,this.ESP_RAM_BLOCK,this.chip.TEXT_START),a=0;ae)throw new A(`File ${i+1} doesn't fit in the available flash`)}let e,i;!0===this.IS_STUB&&!0===t.eraseAll&&await this.eraseFlash();for(let s=0;s0&&(e+="ÿÿÿÿ".substring(4-a)),i=t.fileArray[s].address,this.debug("Image Length "+e.length),0===e.length){this.debug("Warning: File is empty");continue}e=this._updateImageFlashParams(e,i,t.flashSize,t.flashMode,t.flashFreq);let n=null;t.calculateMD5Hash&&(n=t.calculateMD5Hash(e),this.debug("Image MD5 "+n));const h=e.length;let r;if(t.compress){const A=this.bstrToUi8(e);e=this.ui8ToBstr(ce(A,{level:9})),r=await this.flashDeflBegin(h,e.length,i)}else r=await this.flashBegin(h,i);let E=0,g=0;const o=e.length;t.reportProgress&&t.reportProgress(s,0,o);let B=new Date;const w=B.getTime();let c=5e3;const I=new Ie({chunkSize:1});let C=0;for(I.onData=function(A){C+=A.byteLength};e.length>0;){this.debug("Write loop "+i+" "+E+" "+r),this.info("Writing at 0x"+(i+C).toString(16)+"... ("+Math.floor(100*(E+1)/r)+"%)");const a=this.bstrToUi8(e.slice(0,this.FLASH_WRITE_SIZE));if(!t.compress)throw new A("Yet to handle Non Compressed writes");{const A=C;I.push(a,!1);const t=C-A;let e=3e3;this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,t)>3e3&&(e=this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,t)),!1===this.IS_STUB&&(c=e),await this.flashDeflBlock(a,E,c),this.IS_STUB&&(c=e)}g+=a.length,e=e.slice(this.FLASH_WRITE_SIZE,e.length),E++,t.reportProgress&&t.reportProgress(s,g,o)}this.IS_STUB&&await this.readReg(this.CHIP_DETECT_MAGIC_REG_ADDR,c),B=new Date;const l=B.getTime()-w;if(t.compress&&this.info("Wrote "+h+" bytes ("+g+" compressed) at 0x"+i.toString(16)+" in "+l/1e3+" seconds."),n){const t=await this.flashMd5sum(i,h);if(new String(t).valueOf()!=new String(n).valueOf())throw this.info("File md5: "+n),this.info("Flash md5: "+t),new A("MD5 of file does not match data in flash!");this.info("Hash of data verified.")}}this.info("Leaving..."),this.IS_STUB&&(await this.flashBegin(0,0),t.compress?await this.flashDeflFinish():await this.flashFinish())}async flashId(){this.debug("flash_id");const A=await this.readFlashId();this.info("Manufacturer: "+(255&A).toString(16));const t=A>>16&255;this.info("Device: "+(A>>8&255).toString(16)+t.toString(16)),this.info("Detected flash size: "+this.DETECTED_FLASH_SIZES[t])}async getFlashSize(){this.debug("flash_id");const A=await this.readFlashId()>>16&255;return this.DETECTED_FLASH_SIZES_NUM[A]}async hardReset(){await this.transport.setRTS(!0),await this._sleep(100),await this.transport.setRTS(!1)}async softReset(){if(this.IS_STUB){if("ESP8266"!=this.chip.CHIP_NAME)throw new A("Soft resetting is currently only supported on ESP8266");await this.command(this.ESP_RUN_USER_CODE,void 0,void 0,!1)}else await this.flashBegin(0,0),await this.flashFinish(!1)}}class fe{getEraseSize(A,t){return t}}var Fe=1074521560,ue="CAD0PxwA9D8AAPQ/AMD8PxAA9D82QQAh+v/AIAA4AkH5/8AgACgEICB0nOIGBQAAAEH1/4H2/8AgAKgEiAigoHTgCAALImYC54b0/yHx/8AgADkCHfAAAKDr/T8Ya/0/hIAAAEBAAABYq/0/pOv9PzZBALH5/yCgdBARIKXHAJYaBoH2/5KhAZCZEZqYwCAAuAmR8/+goHSaiMAgAJIYAJCQ9BvJwMD0wCAAwlgAmpvAIACiSQDAIACSGACB6v+QkPSAgPSHmUeB5f+SoQGQmRGamMAgAMgJoeX/seP/h5wXxgEAfOiHGt7GCADAIACJCsAgALkJRgIAwCAAuQrAIACJCZHX/5qIDAnAIACSWAAd8AAA+CD0P/gw9D82QQCR/f/AIACICYCAJFZI/5H6/8AgAIgJgIAkVkj/HfAAAAAQIPQ/ACD0PwAAAAg2QQAQESCl/P8h+v8MCMAgAIJiAJH6/4H4/8AgAJJoAMAgAJgIVnn/wCAAiAJ88oAiMCAgBB3wAAAAAEA2QQAQESDl+/8Wav+B7P+R+//AIACSaADAIACYCFZ5/x3wAAAMwPw/////AAQg9D82QQAh/P84QhaDBhARIGX4/xb6BQz4DAQ3qA2YIoCZEIKgAZBIg0BAdBARICX6/xARICXz/4giDBtAmBGQqwHMFICrAbHt/7CZELHs/8AgAJJrAJHO/8AgAKJpAMAgAKgJVnr/HAkMGkCag5AzwJqIOUKJIh3w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/qBbNArLDGIGG/uAIAIw6MqDEOVY4FiozORY4NiAjwCk2xrX+ggMCIsMYMgMDDByAMxGAMyAyw/AGIwCBbP6RHf3oCDlx4JnAmWGYJwwal7MBDDqJ8anR6cEQESAlW/+o0ZFj/ujBqQGhYv7dCb0CwsEc8sEYmcGBa/7gCAC4J80KqHGI8aC7wLknoDPAuAiqIqhhmMGqu90EDBq5CMDag5C7wNDgdMx90tuA0K6TFmoBrQmJ8ZnByeEQESAlif+I8ZjByOGSaABhTv2INoyjwJ8xwJnA1ikAVvj11qwAMUn9IqDHKVNGAACMPJwIxoL+FoigYUT9IqDIKVZGf/4AMUH9IqDJKVNGfP4oI1bCnq0EgUX+4AgAoqJxwKoRgT7+4AgAgUL+4AgAxnP+AAAoMxaCnK0EgTz+4AgAoqPogTb+4AgA4AIARmz+HfAAAAA2QQCdAoKgwCgDh5kPzDIMEoYHAAwCKQN84oYPACYSByYiGIYDAAAAgqDbgCkjh5kqDCIpA3zyRggAAAAioNwnmQoMEikDLQgGBAAAAIKg3Xzyh5kGDBIpAyKg2x3wAAA=",Te=1074520064,ye="GOv8P9jnC0Bx6AtA8+wLQO3oC0CP6AtA7egLQEnpC0AG6gtAeOoLQCHqC0CB5wtAo+kLQPjpC0Bn6QtAmuoLQI7pC0Ca6gtAXegLQLPoC0Dt6AtASekLQHfoC0BM6wtAs+wLQKXmC0DX7AtApeYLQKXmC0Cl5gtApeYLQKXmC0Cl5gtApeYLQKXmC0Dz6gtApeYLQM3rC0Cz7AtA",pe=1073605544;class ke extends fe{constructor(){super(...arguments),this.CHIP_NAME="ESP32",this.IMAGE_CHIP_ID=0,this.EFUSE_RD_REG_BASE=1073061888,this.DR_REG_SYSCON_BASE=1073111040,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612856,this.XTAL_CLK_DIVIDER=1,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=4096,this.SPI_REG_BASE=1072963584,this.SPI_USR_OFFS=28,this.SPI_USR1_OFFS=32,this.SPI_USR2_OFFS=36,this.SPI_W0_OFFS=128,this.SPI_MOSI_DLEN_OFFS=40,this.SPI_MISO_DLEN_OFFS=44,this.TEXT_START=Te,this.ENTRY=Fe,this.DATA_START=pe,this.ROM_DATA=ye,this.ROM_TEXT=ue}async readEfuse(A,t){const e=this.EFUSE_RD_REG_BASE+4*t;return A.debug("Read efuse "+e),await A.readReg(e)}async getPkgVersion(A){const t=await this.readEfuse(A,3);let e=t>>9&7;return e+=(t>>2&1)<<3,e}async getChipRevision(A){const t=await this.readEfuse(A,3),e=await this.readEfuse(A,5),i=await A.readReg(this.DR_REG_SYSCON_BASE+124);return 0!=(t>>15&1)?0!=(e>>20&1)?0!=(i>>31&1)?3:2:1:0}async getChipDescription(A){const t=["ESP32-D0WDQ6","ESP32-D0WD","ESP32-D2WD","","ESP32-U4WDH","ESP32-PICO-D4","ESP32-PICO-V3-02"];let e="";const i=await this.getPkgVersion(A),s=await this.getChipRevision(A),a=3==s;return 0!=(1&await this.readEfuse(A,3))&&(t[0]="ESP32-S0WDQ6",t[1]="ESP32-S0WD"),a&&(t[5]="ESP32-PICO-V3"),e=i>=0&&i<=6?t[i]:"Unknown ESP32",!a||0!==i&&1!==i||(e+="-V3"),e+" (revision "+s+")"}async getChipFeatures(A){const t=["Wi-Fi"],e=await this.readEfuse(A,3);0===(2&e)&&t.push(" BT");0!==(1&e)?t.push(" Single Core"):t.push(" Dual Core");if(0!==(8192&e)){0!==(4096&e)?t.push(" 160MHz"):t.push(" 240MHz")}const i=await this.getPkgVersion(A);-1!==[2,4,5,6].indexOf(i)&&t.push(" Embedded Flash"),6===i&&t.push(" Embedded PSRAM");0!==(await this.readEfuse(A,4)>>8&31)&&t.push(" VRef calibration in efuse");0!==(e>>14&1)&&t.push(" BLK3 partially reserved");const s=3&await this.readEfuse(A,6);return t.push(" Coding Scheme "+["None","3/4","Repeat (UNSUPPORTED)","Invalid"][s]),t}async getCrystalFreq(A){const t=await A.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,e=A.transport.baudrate*t/1e6/this.XTAL_CLK_DIVIDER;let i;return i=e>33?40:26,Math.abs(i-e)>1&&A.info("WARNING: Unsupported crystal in use"),i}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async readMac(A){let t=await this.readEfuse(A,1);t>>>=0;let e=await this.readEfuse(A,2);e>>>=0;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}}var He=Object.freeze({__proto__:null,ESP32ROM:ke}),Pe=1077413532,me="QREixCbCBsa3NwRgEUc3RMg/2Mu3NARgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDdJyD8mylLEBs4izLcEAGB9WhMJCQDATBN09D8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLd1yT9BEZOFhboGxmE/Y0UFBrd3yT+ThweyA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI398g/EwcHsqFnupcDpgcItzbJP7d3yT+Thweyk4YGtmMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3JwBgfEudi/X/NzcAYHxLnYv1/4KAQREGxt03tycAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBB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jmwee7/Cv1gllEwUFcZfwx//ngGAg7/Bv0Zfwx//ngKAj0boDpMsA4wcEnO/wL9QTBYA+l/DH/+eAAB7v8A/PApRVuu/wj872UGZU1lRGWbZZJlqWWgZb9ktmTNZMRk22TQlhgoAAAA==",Oe=1077411840,Ge="IGvIP3YKOEDGCjhAHgs4QMILOEAuDDhA3As4QEIJOEB+CzhAvgs4QDILOEDyCDhAZgs4QPIIOEBQCjhAlgo4QMYKOEAeCzhAYgo4QKYJOEDWCThAXgo4QIAOOEDGCjhARg04QDgOOEAyCDhAYA44QDIIOEAyCDhAMgg4QDIIOEAyCDhAMgg4QDIIOEAyCDhA4gw4QDIIOEBkDThAOA44QA==",Ue=1070164912;class be extends fe{constructor(){super(...arguments),this.CHIP_NAME="ESP32-C3",this.IMAGE_CHIP_ID=5,this.EFUSE_BASE=1610647552,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.TEXT_START=Oe,this.ENTRY=Pe,this.DATA_START=Ue,this.ROM_DATA=Ge,this.ROM_TEXT=me}async getPkgVersion(A){const t=this.EFUSE_BASE+68+12;return await A.readReg(t)>>21&7}async getChipRevision(A){const t=this.EFUSE_BASE+68+12;return(await A.readReg(t)&7<<18)>>18}async getChipDescription(A){let t;t=0===await this.getPkgVersion(A)?"ESP32-C3":"unknown ESP32-C3";return t+=" (revision "+await this.getChipRevision(A)+")",t}async getChipFeatures(A){return["Wi-Fi"]}async getCrystalFreq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}getEraseSize(A,t){return t}}var Ye=Object.freeze({__proto__:null,ESP32C3ROM:be}),Ke=1077413304,xe="ARG3BwBgTsaDqYcASsg3Sco/JspSxAbOIsy3BABgfVoTCQkAwEwTdPQ/DeDyQGJEI6g0AUJJ0kSySSJKBWGCgIhAgycJABN19Q+Cl30U4xlE/8m/EwcADJRBqodjGOUAhUeFxiOgBQB5VYKABUdjh+YACUZjjcYAfVWCgEIFEwewDUGFY5XnAolHnMH1t5MGwA1jFtUAmMETBQAMgoCTBtANfVVjldcAmMETBbANgoC3dcs/QRGThQW6BsZhP2NFBQa3d8s/k4eHsQOnBwgD1kcIE3X1D5MGFgDCBsGCI5LXCDKXIwCnAAPXRwiRZ5OHBwRjHvcCN/fKPxMHh7GhZ7qXA6YHCLc2yz+3d8s/k4eHsZOGhrVjH+YAI6bHCCOg1wgjkgcIIaD5V+MG9fyyQEEBgoAjptcII6DnCN23NycAYHxLnYv1/zc3AGB8S52L9f+CgEERBsbdN7cnAGAjpgcCNwcACJjDmEN9/8hXskATRfX/BYlBAYKAQREGxtk/fd03BwBAtycAYJjDNycAYBxD/f+yQEEBgoBBESLEN8TKP5MHxABKwAOpBwEGxibCYwoJBEU3OcW9RxMExACBRGPWJwEERL2Ik7QUAH03hT8cRDcGgAATl8cAmeA3BgABt/b/AHWPtyYAYNjCkMKYQn3/QUeR4AVHMwnpQLqXIygkARzEskAiRJJEAklBAYKAQREGxhMHAAxjEOUCEwWwDZcAyP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YAAcEWk1dHARIHdY+9i9mPs4eHAwFFs9WHApfwx//ngOBMEwWAPpfwx//ngOBI3bSDpksBA6YLAYOlywADpYsA7/Av98G8g8U7AIPHKwAThYsBogXdjcEVqTptvO/w79qBtwPEOwCDxysAE4yLASIEXYzcREEUxeORR4VLY/6HCJMHkAzcyHm0A6cNACLQBUizh+xAPtaDJ4qwY3P0AA1IQsY6xO/wb9YiRzJIN8XKP+KFfBCThsoAEBATBUUCl/DH/+eA4Ek398o/kwjHAIJXA6eIsIOlDQAdjB2PPpyyVyOk6LCqi76VI6C9AJOHygCdjQHFoWdjlvUAWoVdOCOgbQEJxNxEmcPjQHD5Y98LAJMHcAyFv4VLt33LP7fMyj+TjY26k4zMAOm/45ULntxE44IHnpMHgAyxt4OniwDjmwecAUWX8Mf/54DAOQllEwUFcZfwx//ngCA2l/DH/+eA4DlNugOkywDjBgSaAUWX8Mf/54AgNxMFgD6X8Mf/54CgMwKUQbr2UGZU1lRGWbZZJlqWWgZb9ktmTNZMRk22TQlhgoA=",Le=1077411840,Je="DEDKP+AIOEAsCThAhAk4QFIKOEC+CjhAbAo4QKgHOEAOCjhATgo4QJgJOEBYBzhAzAk4QFgHOEC6CDhA/gg4QCwJOECECThAzAg4QBIIOEBCCDhAyAg4QBYNOEAsCThA1gs4QMoMOECkBjhA9Aw4QKQGOECkBjhApAY4QKQGOECkBjhApAY4QKQGOECkBjhAcgs4QKQGOEDyCzhAygw4QA==",ze=1070295976;var ve=Object.freeze({__proto__:null,ESP32C2ROM:class extends be{constructor(){super(...arguments),this.CHIP_NAME="ESP32-C2",this.IMAGE_CHIP_ID=12,this.EFUSE_BASE=1610647552,this.MAC_EFUSE_REG=this.EFUSE_BASE+64,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.XTAL_CLK_DIVIDER=1,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.TEXT_START=Le,this.ENTRY=Ke,this.DATA_START=ze,this.ROM_DATA=Je,this.ROM_TEXT=xe}async getPkgVersion(A){const t=this.EFUSE_BASE+64+4;return await A.readReg(t)>>22&7}async getChipRevision(A){const t=this.EFUSE_BASE+64+4;return(await A.readReg(t)&3<<20)>>20}async getChipDescription(A){let t;const e=await this.getPkgVersion(A);t=0===e||1===e?"ESP32-C2":"unknown ESP32-C2";return t+=" (revision "+await this.getChipRevision(A)+")",t}async getChipFeatures(A){return["Wi-Fi","BLE"]}async getCrystalFreq(A){const t=await A.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,e=A.transport.baudrate*t/1e6/this.XTAL_CLK_DIVIDER;let i;return i=e>33?40:26,Math.abs(i-e)>1&&A.info("WARNING: Unsupported crystal in use"),i}async changeBaudRate(A){26===await this.getCrystalFreq(A)&&A.changeBaud()}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}getEraseSize(A,t){return t}}}),Ne=1082132112,Ze="QREixCbCBsa39wBgEUc3BIRA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJhEAmylLEBs4izLcEAGB9WhMJC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A6WLAO/wT/79tIPFOwCDxysAE4WLAaIF3Y3BFe/wL9vZvO/wj8o9v4PHOwADxysAE4yLAaIH2Y8TjQf/BUS3O4VA3ERjBQ0AmcNjTIAAY1AEChMHcAzYyOOfB6iTB5AMYaiTh8u6mEO3t4RAk4fHsZmPPtaDJ4qwtzyEQGrQk4wMAZONy7oFSGNz/QANSELGOsTv8I/DIkcySDcFhEDihXwQk4bKsRAQEwWFApfwf//ngEA0glcDp4ywg6UNADMN/UAdjz6cslcjpOywKoS+lSOgvQCTh8qxnY0BxaFn45L19lqF7/CvziOgbQGZvy3044MHoJMHgAzcyPW6g6eLAOObB57v8C/ZCWUTBQVxl/B//+eAoCLv8K/Ul/B//+eA4CbRugOkywDjBwSc7/Cv1hMFgD6X8H//54BAIO/wT9IClFW67/DP0fZQZlTWVEZZtlkmWpZaBlv2S2ZM1kxGTbZNCWGCgAAA",je=1082130432,We="HCuEQEIKgECSCoBA6gqAQI4LgED6C4BAqAuAQA4JgEBKC4BAiguAQP4KgEC+CIBAMguAQL4IgEAcCoBAYgqAQJIKgEDqCoBALgqAQHIJgECiCYBAKgqAQEwOgECSCoBAEg2AQAQOgED+B4BALA6AQP4HgED+B4BA/geAQP4HgED+B4BA/geAQP4HgED+B4BArgyAQP4HgEAwDYBABA6AQA==",qe=1082469292;var Xe=Object.freeze({__proto__:null,ESP32C6ROM:class extends fe{constructor(){super(...arguments),this.CHIP_NAME="ESP32-C6",this.IMAGE_CHIP_ID=13,this.EFUSE_BASE=1611335680,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.TEXT_START=je,this.ENTRY=Ne,this.DATA_START=qe,this.ROM_DATA=We,this.ROM_TEXT=Ze}async getPkgVersion(A){const t=this.EFUSE_BASE+68+12;return await A.readReg(t)>>21&7}async getChipRevision(A){const t=this.EFUSE_BASE+68+12;return(await A.readReg(t)&7<<18)>>18}async getChipDescription(A){let t;t=0===await this.getPkgVersion(A)?"ESP32-C6":"unknown ESP32-C6";return t+=" (revision "+await this.getChipRevision(A)+")",t}async getChipFeatures(A){return["Wi-Fi"]}async getCrystalFreq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}getEraseSize(A,t){return t}}}),Ve=1082132112,$e="QREixCbCBsa39wBgEUc3BINA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJg0AmylLEBs4izLcEAGB9WhMJCQDATBN09A8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc1hEBBEZOFRboGxmE/Y0UFBrc3hECTh8exA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t4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wdwDL23hUu3PYRAt4yDQJONzbqTjAwB6b/jkgug3ETjjweekweADKm3g6eLAOOYB57v8M/YCWUTBQVxl/B//+eAQCLv8E/Ul/B//+eAgCb5sgOkywDjBASc7/BP1hMFgD6X8H//54DgH+/w79EClH2y7/Bv0fZQZlTWVEZZtlkmWpZaBlv2S2ZM1kxGTbZNCWGCgA==",Ai=1082130432,ti="EACDQEIKgECSCoBA6gqAQI4LgED6C4BAqAuAQA4JgEBKC4BAiguAQP4KgEC+CIBAMguAQL4IgEAcCoBAYgqAQJIKgEDqCoBALgqAQHIJgECiCYBAKgqAQFIOgECSCoBAEg2AQAoOgED+B4BAMg6AQP4HgED+B4BA/geAQP4HgED+B4BA/geAQP4HgED+B4BArgyAQP4HgEAwDYBACg6AQA==",ei=1082403756;var ii=Object.freeze({__proto__:null,ESP32H2ROM:class extends fe{constructor(){super(...arguments),this.CHIP_NAME="ESP32-H2",this.IMAGE_CHIP_ID=16,this.EFUSE_BASE=1610647552,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.USB_RAM_BLOCK=2048,this.UARTDEV_BUF_NO_USB=3,this.UARTDEV_BUF_NO=1070526796,this.TEXT_START=Ai,this.ENTRY=Ve,this.DATA_START=ei,this.ROM_DATA=ti,this.ROM_TEXT=$e}async getChipDescription(A){return this.CHIP_NAME}async getChipFeatures(A){return["BLE","IEEE802.15.4"]}async getCrystalFreq(A){return 32}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async postConnect(A){const t=255&await A.readReg(this.UARTDEV_BUF_NO);A.debug("In _post_connect "+t),t==this.UARTDEV_BUF_NO_USB&&(A.ESP_RAM_BLOCK=this.USB_RAM_BLOCK)}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}getEraseSize(A,t){return t}}}),si=1077381696,ai="FIADYACAA2BIAMo/BIADYDZBAIH7/wxJwCAAmQjGBAAAgfj/wCAAqAiB9/+goHSICOAIACH2/8AgAIgCJ+jhHfAAAAAIAABgHAAAYBAAAGA2QQAh/P/AIAA4AkH7/8AgACgEICCUnOJB6P9GBAAMODCIAcAgAKgIiASgoHTgCAALImYC6Ib0/yHx/8AgADkCHfAAAOwryz9kq8o/hIAAAEBAAACk68o/8CvLPzZBALH5/yCgdBARIKUrAZYaBoH2/5KhAZCZEZqYwCAAuAmR8/+goHSaiMAgAJIYAJCQ9BvJwMD0wCAAwlgAmpvAIACiSQDAIACSGACB6v+QkPSAgPSHmUeB5f+SoQGQmRGamMAgAMgJoeX/seP/h5wXxgEAfOiHGt7GCADAIACJCsAgALkJRgIAwCAAuQrAIACJCZHX/5qIDAnAIACSWAAd8AAAVCAAYFQwAGA2QQCR/f/AIACICYCAJFZI/5H6/8AgAIgJgIAkVkj/HfAAAAAsIABgACAAYAAAAAg2QQAQESCl/P8h+v8MCMAgAIJiAJH6/4H4/8AgAJJoAMAgAJgIVnn/wCAAiAJ88oAiMCAgBB3wAAAAAEA2QQAQESDl+/8Wav+B7P+R+//AIACSaADAIACYCFZ5/x3wAAAUKABANkEAIKIggf3/4AgAHf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null,ESP32S3ROM:class extends fe{constructor(){super(...arguments),this.CHIP_NAME="ESP32-S3",this.IMAGE_CHIP_ID=9,this.EFUSE_BASE=1610641408,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612864,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.USB_RAM_BLOCK=2048,this.UARTDEV_BUF_NO_USB=3,this.UARTDEV_BUF_NO=1070526796,this.TEXT_START=ni,this.ENTRY=si,this.DATA_START=ri,this.ROM_DATA=hi,this.ROM_TEXT=ai}async getChipDescription(A){return"ESP32-S3"}async getChipFeatures(A){return["Wi-Fi","BLE"]}async getCrystalFreq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async postConnect(A){const t=255&await A.readReg(this.UARTDEV_BUF_NO);A.debug("In _post_connect "+t),t==this.UARTDEV_BUF_NO_USB&&(A.ESP_RAM_BLOCK=this.USB_RAM_BLOCK)}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}getEraseSize(A,t){return t}}}),gi=1073907696,oi="CAAAYBwAAGBIAP0/EAAAYDZBACH7/8AgADgCQfr/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MCtk5w6rQiCYQ6SYQ0QESDlLf+I4ZjRgmcAUWv8eDWMo5CPMZCIwNYoAFY39tapADFm/CKgxylTRgAAjDmcB4Zt/hY3m1Fh/CKgyClVBmr+ADFe/CKgySlTBmf+AAAoI1ZSmRARIOVS/6KiccCqEYHS/eAIABARICU6/4Hk/eAIAAZd/gAAKDMW0pYQESBlUP+io+iByf3gCAAQESClN//gAgCGVP4AEBEg5Tb/HfAAADZBAJ0CgqDAKAOHmQ/MMgwShgcADAIpA3zihg8AJhIHJiIYhgMAAACCoNuAKSOHmSoMIikDfPJGCAAAACKg3CeZCgwSKQMtCAYEAAAAgqDdfPKHmQYMEikDIqDbHfAAAA==",Bi=1073905664,wi="ZCv9PzaLAkDBiwJAhpACQEqMAkDjiwJASowCQKmMAkByjQJA5Y0CQI2NAkDAigJAC40CQGSNAkDMjAJACI4CQPaMAkAIjgJAr4sCQA6MAkBKjAJAqYwCQMeLAkACiwJAx44CQD2QAkDYiQJAZZACQNiJAkDYiQJA2IkCQNiJAkDYiQJA2IkCQNiJAkDYiQJAZI4CQNiJAkBZjwJAPZACQA==",ci=1073622012;var Ii=Object.freeze({__proto__:null,ESP32S2ROM:class extends fe{constructor(){super(...arguments),this.CHIP_NAME="ESP32-S2",this.IMAGE_CHIP_ID=2,this.MAC_EFUSE_REG=1061265476,this.EFUSE_BASE=1061265408,this.UART_CLKDIV_REG=1061158932,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612856,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=4096,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1061167104,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_W0_OFFS=88,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.TEXT_START=Bi,this.ENTRY=gi,this.DATA_START=ci,this.ROM_DATA=wi,this.ROM_TEXT=oi}async getPkgVersion(A){const t=this.EFUSE_BASE+68+12;return await A.readReg(t)>>21&15}async getChipDescription(A){const t=["ESP32-S2","ESP32-S2FH16","ESP32-S2FH32"],e=await this.getPkgVersion(A);return e>=0&&e<=2?t[e]:"unknown ESP32-S2"}async getChipFeatures(A){const t=["Wi-Fi"],e=await this.getPkgVersion(A);1==e?t.push("Embedded 2MB Flash"):2==e&&t.push("Embedded 4MB Flash");const i=this.EFUSE_BASE+92+16;return 1==(await A.readReg(i)>>4&7)&&t.push("ADC and temperature sensor calibration in BLK2 of efuse"),t}async getCrystalFreq(A){return 40}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}getEraseSize(A,t){return t}}}),Ci=1074843652,li="qBAAQAH//0Z0AAAAkIH/PwgB/z+AgAAAhIAAAEBAAABIQf8/lIH/PzH5/xLB8CAgdAJhA4XvATKv/pZyA1H0/0H2/zH0/yAgdDA1gEpVwCAAaANCFQBAMPQbQ0BA9MAgAEJVADo2wCAAIkMAIhUAMev/ICD0N5I/Ieb/Meb/Qen/OjLAIABoA1Hm/yeWEoYAAAAAAMAgACkEwCAAWQNGAgDAIABZBMAgACkDMdv/OiIMA8AgADJSAAgxEsEQDfAAoA0AAJiB/z8Agf4/T0hBSais/z+krP8/KNAQQEzqEEAMAABg//8AAAAQAAAAAAEAAAAAAYyAAAAQQAAAAAD//wBAAAAAgf4/BIH+PxAnAAAUAABg//8PAKis/z8Igf4/uKz/PwCAAAA4KQAAkI//PwiD/z8Qg/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BAaOcQQGjnEEBo5xBAaOcQQGjnEEBo5xBAaOcQQCLaEEBf2hBAvuUQQAEAAAACAAAAAwAAAAQAAAAFAAAABwAAAAkAAAANAAAAEQAAABkAAAAhAAAAMQAAAEEAAABhAAAAgQAAAMEAAAABAQAAgQEAAAECAAABAwAAAQQAAAEGAAABCAAAAQwAAAEQAAABGAAAASAAAAEwAAABQAAAAWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAUAAAAGAAAABgAAAAcAAAAHAAAACAAAAAgAAAAJAAAACQAAAAoAAAAKAAAACwAAAAsAAAAMAAAADAAAAA0AAAANAAAAAAAAAAAAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAANAAAADwAAABEAAAATAAAAFwAAABsAAAAfAAAAIwAAACsAAAAzAAAAOwAAAEMAAABTAAAAYwAAAHMAAACDAAAAowAAAMMAAADjAAAAAgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAgAAAAMAAAADAAAAAwAAAAMAAAAEAAAABAAAAAQAAAAEAAAABQAAAAUAAAAFAAAABQAAAAAAAAAAAAAAAAAAABAREgAIBwkGCgULBAwDDQIOAQ8AAQEAAAEAAAAEAAAA",Di=1073720488;var Mi=Object.freeze({__proto__:null,ESP8266ROM:class extends fe{constructor(){super(...arguments),this.CHIP_NAME="ESP8266",this.CHIP_DETECT_MAGIC_VALUE=[4293968129],this.EFUSE_RD_REG_BASE=1072693328,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.XTAL_CLK_DIVIDER=2,this.FLASH_WRITE_SIZE=16384,this.BOOTLOADER_FLASH_OFFSET=0,this.UART_DATE_REG_ADDR=0,this.FLASH_SIZES={"512KB":0,"256KB":16,"1MB":32,"2MB":48,"4MB":64,"2MB-c1":80,"4MB-c1":96,"8MB":128,"16MB":144},this.SPI_REG_BASE=1610613248,this.SPI_USR_OFFS=28,this.SPI_USR1_OFFS=32,this.SPI_USR2_OFFS=36,this.SPI_MOSI_DLEN_OFFS=0,this.SPI_MISO_DLEN_OFFS=0,this.SPI_W0_OFFS=64,this.TEXT_START=_i,this.ENTRY=Ci,this.DATA_START=Di,this.ROM_DATA=di,this.ROM_TEXT=li,this.getChipFeatures=async A=>{const t=["WiFi"];return"ESP8285"==await this.getChipDescription(A)&&t.push("Embedded Flash"),t}}async readEfuse(A,t){const e=this.EFUSE_RD_REG_BASE+4*t;return A.debug("Read efuse "+e),await A.readReg(e)}async getChipDescription(A){const t=await this.readEfuse(A,2);return 0!=(16&await this.readEfuse(A,0)|65536&t)?"ESP8285":"ESP8266EX"}async getCrystalFreq(A){const t=await A.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,e=A.transport.baudrate*t/1e6/this.XTAL_CLK_DIVIDER;let i;return i=e>33?40:26,Math.abs(i-e)>1&&A.info("WARNING: Detected crystal freq "+e+"MHz is quite different to normalized freq "+i+"MHz. Unsupported crystal in use?"),i}_d2h(A){const t=(+A).toString(16);return 1===t.length?"0"+t:t}async readMac(A){let t=await this.readEfuse(A,0);t>>>=0;let e=await this.readEfuse(A,1);e>>>=0;let i=await this.readEfuse(A,3);i>>>=0;const s=new Uint8Array(6);return 0!=i?(s[0]=i>>16&255,s[1]=i>>8&255,s[2]=255&i):0==(e>>16&255)?(s[0]=24,s[1]=254,s[2]=52):1==(e>>16&255)?(s[0]=172,s[1]=208,s[2]=116):A.error("Unknown OUI"),s[3]=e>>8&255,s[4]=255&e,s[5]=t>>24&255,this._d2h(s[0])+":"+this._d2h(s[1])+":"+this._d2h(s[2])+":"+this._d2h(s[3])+":"+this._d2h(s[4])+":"+this._d2h(s[5])}getEraseSize(A,t){return t}}}),Qi=1341195918,Si="QREixCbCBsa3Jw1QEUc3BPVP2Mu3JA1QEwQEANxAkYuR57J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i9mPs4eHAwFFs9WHApfwzv/ngAA6EwWAPpfwzv/ngEA10byDpksBA6YLAYOlywADpYsA7/DP/n28g8U7AIPHKwAThYsBogXdjcEV7/DP21207/Avyz2/A8Q7AIPHKwATjIsBIgRdjNxEQRTN45FHhUtj/4cIkweQDNzIrbwDpw0AItAFSLOH7EA+1oMnirBjc/QADUhCxjrE7/CvxiJHMkg3hfVP4oV8EJOGCgEQEBMFhQKX8M7/54BgNze39U+TCAcBglcDp4iwg6UNAB2MHY8+nLJXI6TosKqLvpUjoL0Ak4cKAZ2NAcWhZ2OX9QBahe/wb9EjoG0BCcTcRJnD409w92PfCwCTB3AMvbeFS7c99k+3jPVPk43NupOMDAHpv+OaC5zcROOHB5yTB4AMqbeDp4sA45AHnO/wD9YJZRMFBXGX8M7/54CgIpfwzv/ngKAnTbIDpMsA4w4EmO/wz9MTBYA+l/DO/+eAgCAClFmy9lBmVNZURlm2WSZalloGW/ZLZkzWTEZNtk0JYYKAAAA=",Ri=1341194240,fi="EAD1TwYK8U9WCvFPrgrxT4QL8U/wC/FPngvxT9QI8U9AC/FPgAvxT8IK8U+ECPFP9grxT4QI8U/gCfFPJgrxT1YK8U+uCvFP8gnxTzgJ8U9oCfFP7gnxT0AO8U9WCvFPCA3xTwAO8U/EB/FPJA7xT8QH8U/EB/FPxAfxT8QH8U/EB/FPxAfxT8QH8U/EB/FPpAzxT8QH8U8mDfFPAA7xTw==",Fi=1341533100;var ui=Object.freeze({__proto__:null,ESP32P4ROM:class extends ke{constructor(){super(...arguments),this.CHIP_NAME="ESP32-P4",this.IMAGE_CHIP_ID=18,this.IROM_MAP_START=1073741824,this.IROM_MAP_END=1275068416,this.DROM_MAP_START=1073741824,this.DROM_MAP_END=1275068416,this.BOOTLOADER_FLASH_OFFSET=8192,this.CHIP_DETECT_MAGIC_VALUE=[0,182303440],this.UART_DATE_REG_ADDR=1343004812,this.EFUSE_BASE=1343410176,this.EFUSE_BLOCK1_ADDR=this.EFUSE_BASE+68,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.SPI_REG_BASE=1342754816,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.EFUSE_RD_REG_BASE=this.EFUSE_BASE+48,this.EFUSE_PURPOSE_KEY0_REG=this.EFUSE_BASE+52,this.EFUSE_PURPOSE_KEY0_SHIFT=24,this.EFUSE_PURPOSE_KEY1_REG=this.EFUSE_BASE+52,this.EFUSE_PURPOSE_KEY1_SHIFT=28,this.EFUSE_PURPOSE_KEY2_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY2_SHIFT=0,this.EFUSE_PURPOSE_KEY3_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY3_SHIFT=4,this.EFUSE_PURPOSE_KEY4_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY4_SHIFT=8,this.EFUSE_PURPOSE_KEY5_REG=this.EFUSE_BASE+56,this.EFUSE_PURPOSE_KEY5_SHIFT=12,this.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT_REG=this.EFUSE_RD_REG_BASE,this.EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT=1<<20,this.EFUSE_SPI_BOOT_CRYPT_CNT_REG=this.EFUSE_BASE+52,this.EFUSE_SPI_BOOT_CRYPT_CNT_MASK=7<<18,this.EFUSE_SECURE_BOOT_EN_REG=this.EFUSE_BASE+56,this.EFUSE_SECURE_BOOT_EN_MASK=1<<20,this.PURPOSE_VAL_XTS_AES256_KEY_1=2,this.PURPOSE_VAL_XTS_AES256_KEY_2=3,this.PURPOSE_VAL_XTS_AES128_KEY=4,this.SUPPORTS_ENCRYPTED_FLASH=!0,this.FLASH_ENCRYPTED_WRITE_ALIGN=16,this.MEMORY_MAP=[[0,65536,"PADDING"],[1073741824,1275068416,"DROM"],[1341128704,1341784064,"DRAM"],[1341128704,1341784064,"BYTE_ACCESSIBLE"],[1337982976,1338114048,"DROM_MASK"],[1337982976,1338114048,"IROM_MASK"],[1073741824,1275068416,"IROM"],[1341128704,1341784064,"IRAM"],[1343258624,1343291392,"RTC_IRAM"],[1343258624,1343291392,"RTC_DRAM"],[1611653120,1611661312,"MEM_INTERNAL2"]],this.UF2_FAMILY_ID=1026592404,this.EFUSE_MAX_KEY=5,this.KEY_PURPOSES={0:"USER/EMPTY",1:"ECDSA_KEY",2:"XTS_AES_256_KEY_1",3:"XTS_AES_256_KEY_2",4:"XTS_AES_128_KEY",5:"HMAC_DOWN_ALL",6:"HMAC_DOWN_JTAG",7:"HMAC_DOWN_DIGITAL_SIGNATURE",8:"HMAC_UP",9:"SECURE_BOOT_DIGEST0",10:"SECURE_BOOT_DIGEST1",11:"SECURE_BOOT_DIGEST2",12:"KM_INIT_KEY"},this.TEXT_START=Ri,this.ENTRY=Qi,this.DATA_START=Fi,this.ROM_DATA=fi,this.ROM_TEXT=Si}async getPkgVersion(A){const t=this.EFUSE_BLOCK1_ADDR+8;return await A.readReg(t)>>27&7}async getMinorChipVersion(A){const t=this.EFUSE_BLOCK1_ADDR+8;return await A.readReg(t)>>0&15}async getMajorChipVersion(A){const t=this.EFUSE_BLOCK1_ADDR+8;return await A.readReg(t)>>4&3}async getChipDescription(A){return`${0===await this.getPkgVersion(A)?"ESP32-P4":"unknown ESP32-P4"} (revision v${await this.getMajorChipVersion(A)}.${await this.getMinorChipVersion(A)})`}async getChipFeatures(A){return["High-Performance MCU"]}async getCrystalFreq(A){return 40}async getFlashVoltage(A){}async overrideVddsdio(A){A.debug("VDD_SDIO overrides are not supported for ESP32-P4")}async readMac(A){let t=await A.readReg(this.MAC_EFUSE_REG);t>>>=0;let e=await A.readReg(this.MAC_EFUSE_REG+4);e=e>>>0&65535;const i=new Uint8Array(6);return i[0]=e>>8&255,i[1]=255&e,i[2]=t>>24&255,i[3]=t>>16&255,i[4]=t>>8&255,i[5]=255&t,this._d2h(i[0])+":"+this._d2h(i[1])+":"+this._d2h(i[2])+":"+this._d2h(i[3])+":"+this._d2h(i[4])+":"+this._d2h(i[5])}async getFlashCryptConfig(A){}async getSecureBootEnabled(A){return await A.readReg(this.EFUSE_SECURE_BOOT_EN_REG)&this.EFUSE_SECURE_BOOT_EN_MASK}async getKeyBlockPurpose(A,t){if(t<0||t>this.EFUSE_MAX_KEY)return void A.debug(`Valid key block numbers must be in range 0-${this.EFUSE_MAX_KEY}`);const e=[[this.EFUSE_PURPOSE_KEY0_REG,this.EFUSE_PURPOSE_KEY0_SHIFT],[this.EFUSE_PURPOSE_KEY1_REG,this.EFUSE_PURPOSE_KEY1_SHIFT],[this.EFUSE_PURPOSE_KEY2_REG,this.EFUSE_PURPOSE_KEY2_SHIFT],[this.EFUSE_PURPOSE_KEY3_REG,this.EFUSE_PURPOSE_KEY3_SHIFT],[this.EFUSE_PURPOSE_KEY4_REG,this.EFUSE_PURPOSE_KEY4_SHIFT],[this.EFUSE_PURPOSE_KEY5_REG,this.EFUSE_PURPOSE_KEY5_SHIFT]],[i,s]=e[t];return await A.readReg(i)>>s&15}async isFlashEncryptionKeyValid(A){const t=[];for(let e=0;e<=this.EFUSE_MAX_KEY;e++){const i=await this.getKeyBlockPurpose(A,e);t.push(i)}if(void 0!==typeof t.find((A=>A===this.PURPOSE_VAL_XTS_AES128_KEY)))return!0;const e=t.find((A=>A===this.PURPOSE_VAL_XTS_AES256_KEY_1)),i=t.find((A=>A===this.PURPOSE_VAL_XTS_AES256_KEY_2));return void 0!==typeof e&&void 0!==typeof i}}});export{Re as ESPLoader,fe as ROM,Ce as Transport,_e as classicReset,Qe as customReset,De as hardReset,de as usbJTAGSerialReset,Me as validateCustomResetStringSequence}; diff --git a/images/de-pp-logo-150px.png b/images/de-pp-logo-150px.png new file mode 100644 index 0000000..898bf58 Binary files /dev/null and b/images/de-pp-logo-150px.png differ diff --git a/install.html b/install.html index 4fdf203..d73c628 100644 --- a/install.html +++ b/install.html @@ -12,7 +12,6 @@ - @@ -33,47 +32,70 @@
Online Serial Flashing Tool
DroneBridge for ESP32
-
This is not working for now. Come back later :(
+
Install DroneBridge for ESP32 directly using your browser!
-
-
- -
Not connected...
+
+ Your browser is not supported by this tool!
Use a Chrome-Based browser like Microsoft Edge or Google Chrome to access this tool! +
+
+
+ +
+
+
+
-
- -
-
- -
-
-
- + +
+
Successfully flashed DroneBridge to ESP32!
Next: Power cycle and then configure the device.
Fly save and have fun!
+ +
+
+ Buy Me A Coffee +
+
+
+ + Donate via PayPal + +
+
+
+
+
+ diff --git a/scss/dronebridge.scss b/scss/dronebridge.scss index a6ec4ed..0e56b67 100644 --- a/scss/dronebridge.scss +++ b/scss/dronebridge.scss @@ -10,6 +10,10 @@ margin-right: auto; } +.center-text { + text-align: center; +} + .hero { text-align: center; padding-left: 6rem; @@ -92,10 +96,39 @@ button.button-primary:focus { border-color: #9a4e0b } -input, select { +input { color: #000; } +.custom-select { +} + +.custom-select select { + padding: 0.675em 6em 0.675em 1em; + background-color: white; + border-radius: 0.25rem; + color: black; + cursor: pointer; + height: max-content; +} + +.custom-select::before, +.custom-select::after { + --size: 0.3rem; + content: ""; + position: absolute; + right: 1rem; + pointer-events: none; +} + +.custom-select::before { + top: 40%; +} + +.custom-select::after { + top: 55%; +} + .dot_green { background-color: #68b838 } @@ -113,3 +146,49 @@ input, select { li { margin: auto; } + +.loader { + width: 48px; + height: 48px; + display: inline-block; + position: relative; +} +.loader::after, +.loader::before { + content: ''; + box-sizing: border-box; + width: 48px; + height: 48px; + border-radius: 50%; + border: 2px solid #FFF; + position: absolute; + left: 0; + top: 0; + animation: animloader 2s linear infinite; +} +.loader::after { + animation-delay: 1s; +} + +@keyframes animloader { + 0% { + transform: scale(0); + opacity: 1; + } + 100% { + transform: scale(1); + opacity: 0; + } +} + +.donate_div { + margin: 1rem; +} + +.paypal_button { + background-color: #fff; + width: 217px; + padding: 0.4em 2em; + border-radius: 0.6em +} + diff --git a/web-serial-polyfill/serial.d.ts b/web-serial-polyfill/serial.d.ts new file mode 100644 index 0000000..694228a --- /dev/null +++ b/web-serial-polyfill/serial.d.ts @@ -0,0 +1,142 @@ +/// +/// +/// +export declare enum SerialPolyfillProtocol { + UsbCdcAcm = 0 +} +export interface SerialPolyfillOptions { + protocol?: SerialPolyfillProtocol; + usbControlInterfaceClass?: number; + usbTransferInterfaceClass?: number; +} +/** a class used to control serial devices over WebUSB */ +export declare class SerialPort { + private polyfillOptions_; + private device_; + private controlInterface_; + private transferInterface_; + private inEndpoint_; + private outEndpoint_; + private serialOptions_; + private readable_; + private writable_; + private outputSignals_; + /** + * constructor taking a WebUSB device that creates a SerialPort instance. + * @param {USBDevice} device A device acquired from the WebUSB API + * @param {SerialPolyfillOptions} polyfillOptions Optional options to + * configure the polyfill. + */ + constructor(device: USBDevice, polyfillOptions?: SerialPolyfillOptions); + /** + * Getter for the readable attribute. Constructs a new ReadableStream as + * necessary. + * @return {ReadableStream} the current readable stream + */ + get readable(): ReadableStream | null; + /** + * Getter for the writable attribute. Constructs a new WritableStream as + * necessary. + * @return {WritableStream} the current writable stream + */ + get writable(): WritableStream | null; + /** + * a function that opens the device and claims all interfaces needed to + * control and communicate to and from the serial device + * @param {SerialOptions} options Object containing serial options + * @return {Promise} A promise that will resolve when device is ready + * for communication + */ + open(options: SerialOptions): Promise; + /** + * Closes the port. + * + * @return {Promise} A promise that will resolve when the port is + * closed. + */ + close(): Promise; + /** + * Forgets the port. + * + * @return {Promise} A promise that will resolve when the port is + * forgotten. + */ + forget(): Promise; + /** + * A function that returns properties of the device. + * @return {SerialPortInfo} Device properties. + */ + getInfo(): SerialPortInfo; + /** + * A function used to change the serial settings of the device + * @param {object} options the object which carries serial settings data + * @return {Promise} A promise that will resolve when the options are + * set + */ + reconfigure(options: SerialOptions): Promise; + /** + * Sets control signal state for the port. + * @param {SerialOutputSignals} signals The signals to enable or disable. + * @return {Promise} a promise that is resolved when the signal state + * has been changed. + */ + setSignals(signals: SerialOutputSignals): Promise; + /** + * Checks the serial options for validity and throws an error if it is + * not valid + */ + private validateOptions; + /** + * Checks the baud rate for validity + * @param {number} baudRate the baud rate to check + * @return {boolean} A boolean that reflects whether the baud rate is valid + */ + private isValidBaudRate; + /** + * Checks the data bits for validity + * @param {number} dataBits the data bits to check + * @return {boolean} A boolean that reflects whether the data bits setting is + * valid + */ + private isValidDataBits; + /** + * Checks the stop bits for validity + * @param {number} stopBits the stop bits to check + * @return {boolean} A boolean that reflects whether the stop bits setting is + * valid + */ + private isValidStopBits; + /** + * Checks the parity for validity + * @param {string} parity the parity to check + * @return {boolean} A boolean that reflects whether the parity is valid + */ + private isValidParity; + /** + * sends the options alog the control interface to set them on the device + * @return {Promise} a promise that will resolve when the options are set + */ + private setLineCoding; +} +/** implementation of the global navigator.serial object */ +declare class Serial { + /** + * Requests permission to access a new port. + * + * @param {SerialPortRequestOptions} options + * @param {SerialPolyfillOptions} polyfillOptions + * @return {Promise} + */ + requestPort(options?: SerialPortRequestOptions, polyfillOptions?: SerialPolyfillOptions): Promise; + /** + * Get the set of currently available ports. + * + * @param {SerialPolyfillOptions} polyfillOptions Polyfill configuration that + * should be applied to these ports. + * @return {Promise} a promise that is resolved with a list of + * ports. + */ + getPorts(polyfillOptions?: SerialPolyfillOptions): Promise; +} +export declare const serial: Serial; +export {}; diff --git a/web-serial-polyfill/serial.js b/web-serial-polyfill/serial.js new file mode 100644 index 0000000..1741b7d --- /dev/null +++ b/web-serial-polyfill/serial.js @@ -0,0 +1,491 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of + * the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in + * writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES + * OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing + * permissions and limitations under the License. + */ +'use strict'; +export var SerialPolyfillProtocol; +(function (SerialPolyfillProtocol) { + SerialPolyfillProtocol[SerialPolyfillProtocol["UsbCdcAcm"] = 0] = "UsbCdcAcm"; +})(SerialPolyfillProtocol || (SerialPolyfillProtocol = {})); +const kSetLineCoding = 0x20; +const kSetControlLineState = 0x22; +const kSendBreak = 0x23; +const kDefaultBufferSize = 255; +const kDefaultDataBits = 8; +const kDefaultParity = 'none'; +const kDefaultStopBits = 1; +const kAcceptableDataBits = [16, 8, 7, 6, 5]; +const kAcceptableStopBits = [1, 2]; +const kAcceptableParity = ['none', 'even', 'odd']; +const kParityIndexMapping = ['none', 'odd', 'even']; +const kStopBitsIndexMapping = [1, 1.5, 2]; +const kDefaultPolyfillOptions = { + protocol: SerialPolyfillProtocol.UsbCdcAcm, + usbControlInterfaceClass: 2, + usbTransferInterfaceClass: 10, +}; +/** + * Utility function to get the interface implementing a desired class. + * @param {USBDevice} device The USB device. + * @param {number} classCode The desired interface class. + * @return {USBInterface} The first interface found that implements the desired + * class. + * @throws TypeError if no interface is found. + */ +function findInterface(device, classCode) { + const configuration = device.configurations[0]; + for (const iface of configuration.interfaces) { + const alternate = iface.alternates[0]; + if (alternate.interfaceClass === classCode) { + return iface; + } + } + throw new TypeError(`Unable to find interface with class ${classCode}.`); +} +/** + * Utility function to get an endpoint with a particular direction. + * @param {USBInterface} iface The interface to search. + * @param {USBDirection} direction The desired transfer direction. + * @return {USBEndpoint} The first endpoint with the desired transfer direction. + * @throws TypeError if no endpoint is found. + */ +function findEndpoint(iface, direction) { + const alternate = iface.alternates[0]; + for (const endpoint of alternate.endpoints) { + if (endpoint.direction == direction) { + return endpoint; + } + } + throw new TypeError(`Interface ${iface.interfaceNumber} does not have an ` + + `${direction} endpoint.`); +} +/** + * Implementation of the underlying source API[1] which reads data from a USB + * endpoint. This can be used to construct a ReadableStream. + * + * [1]: https://streams.spec.whatwg.org/#underlying-source-api + */ +class UsbEndpointUnderlyingSource { + /** + * Constructs a new UnderlyingSource that will pull data from the specified + * endpoint on the given USB device. + * + * @param {USBDevice} device + * @param {USBEndpoint} endpoint + * @param {function} onError function to be called on error + */ + constructor(device, endpoint, onError) { + this.type = 'bytes'; + this.device_ = device; + this.endpoint_ = endpoint; + this.onError_ = onError; + } + /** + * Reads a chunk of data from the device. + * + * @param {ReadableByteStreamController} controller + */ + pull(controller) { + (async () => { + var _a; + let chunkSize; + if (controller.desiredSize) { + const d = controller.desiredSize / this.endpoint_.packetSize; + chunkSize = Math.ceil(d) * this.endpoint_.packetSize; + } + else { + chunkSize = this.endpoint_.packetSize; + } + try { + const result = await this.device_.transferIn(this.endpoint_.endpointNumber, chunkSize); + if (result.status != 'ok') { + controller.error(`USB error: ${result.status}`); + this.onError_(); + } + if ((_a = result.data) === null || _a === void 0 ? void 0 : _a.buffer) { + const chunk = new Uint8Array(result.data.buffer, result.data.byteOffset, result.data.byteLength); + controller.enqueue(chunk); + } + } + catch (error) { + controller.error(error.toString()); + this.onError_(); + } + })(); + } +} +/** + * Implementation of the underlying sink API[2] which writes data to a USB + * endpoint. This can be used to construct a WritableStream. + * + * [2]: https://streams.spec.whatwg.org/#underlying-sink-api + */ +class UsbEndpointUnderlyingSink { + /** + * Constructs a new UnderlyingSink that will write data to the specified + * endpoint on the given USB device. + * + * @param {USBDevice} device + * @param {USBEndpoint} endpoint + * @param {function} onError function to be called on error + */ + constructor(device, endpoint, onError) { + this.device_ = device; + this.endpoint_ = endpoint; + this.onError_ = onError; + } + /** + * Writes a chunk to the device. + * + * @param {Uint8Array} chunk + * @param {WritableStreamDefaultController} controller + */ + async write(chunk, controller) { + try { + const result = await this.device_.transferOut(this.endpoint_.endpointNumber, chunk); + if (result.status != 'ok') { + controller.error(result.status); + this.onError_(); + } + } + catch (error) { + controller.error(error.toString()); + this.onError_(); + } + } +} +/** a class used to control serial devices over WebUSB */ +export class SerialPort { + /** + * constructor taking a WebUSB device that creates a SerialPort instance. + * @param {USBDevice} device A device acquired from the WebUSB API + * @param {SerialPolyfillOptions} polyfillOptions Optional options to + * configure the polyfill. + */ + constructor(device, polyfillOptions) { + this.polyfillOptions_ = Object.assign(Object.assign({}, kDefaultPolyfillOptions), polyfillOptions); + this.outputSignals_ = { + dataTerminalReady: false, + requestToSend: false, + break: false, + }; + this.device_ = device; + this.controlInterface_ = findInterface(this.device_, this.polyfillOptions_.usbControlInterfaceClass); + this.transferInterface_ = findInterface(this.device_, this.polyfillOptions_.usbTransferInterfaceClass); + this.inEndpoint_ = findEndpoint(this.transferInterface_, 'in'); + this.outEndpoint_ = findEndpoint(this.transferInterface_, 'out'); + } + /** + * Getter for the readable attribute. Constructs a new ReadableStream as + * necessary. + * @return {ReadableStream} the current readable stream + */ + get readable() { + var _a; + if (!this.readable_ && this.device_.opened) { + this.readable_ = new ReadableStream(new UsbEndpointUnderlyingSource(this.device_, this.inEndpoint_, () => { + this.readable_ = null; + }), { + highWaterMark: (_a = this.serialOptions_.bufferSize) !== null && _a !== void 0 ? _a : kDefaultBufferSize, + }); + } + return this.readable_; + } + /** + * Getter for the writable attribute. Constructs a new WritableStream as + * necessary. + * @return {WritableStream} the current writable stream + */ + get writable() { + var _a; + if (!this.writable_ && this.device_.opened) { + this.writable_ = new WritableStream(new UsbEndpointUnderlyingSink(this.device_, this.outEndpoint_, () => { + this.writable_ = null; + }), new ByteLengthQueuingStrategy({ + highWaterMark: (_a = this.serialOptions_.bufferSize) !== null && _a !== void 0 ? _a : kDefaultBufferSize, + })); + } + return this.writable_; + } + /** + * a function that opens the device and claims all interfaces needed to + * control and communicate to and from the serial device + * @param {SerialOptions} options Object containing serial options + * @return {Promise} A promise that will resolve when device is ready + * for communication + */ + async open(options) { + this.serialOptions_ = options; + this.validateOptions(); + try { + await this.device_.open(); + if (this.device_.configuration === null) { + await this.device_.selectConfiguration(1); + } + await this.device_.claimInterface(this.controlInterface_.interfaceNumber); + if (this.controlInterface_ !== this.transferInterface_) { + await this.device_.claimInterface(this.transferInterface_.interfaceNumber); + } + await this.setLineCoding(); + await this.setSignals({ dataTerminalReady: true }); + } + catch (error) { + if (this.device_.opened) { + await this.device_.close(); + } + throw new Error('Error setting up device: ' + error.toString()); + } + } + /** + * Closes the port. + * + * @return {Promise} A promise that will resolve when the port is + * closed. + */ + async close() { + const promises = []; + if (this.readable_) { + promises.push(this.readable_.cancel()); + } + if (this.writable_) { + promises.push(this.writable_.abort()); + } + await Promise.all(promises); + this.readable_ = null; + this.writable_ = null; + if (this.device_.opened) { + await this.setSignals({ dataTerminalReady: false, requestToSend: false }); + await this.device_.close(); + } + } + /** + * Forgets the port. + * + * @return {Promise} A promise that will resolve when the port is + * forgotten. + */ + async forget() { + return this.device_.forget(); + } + /** + * A function that returns properties of the device. + * @return {SerialPortInfo} Device properties. + */ + getInfo() { + return { + usbVendorId: this.device_.vendorId, + usbProductId: this.device_.productId, + }; + } + /** + * A function used to change the serial settings of the device + * @param {object} options the object which carries serial settings data + * @return {Promise} A promise that will resolve when the options are + * set + */ + reconfigure(options) { + this.serialOptions_ = Object.assign(Object.assign({}, this.serialOptions_), options); + this.validateOptions(); + return this.setLineCoding(); + } + /** + * Sets control signal state for the port. + * @param {SerialOutputSignals} signals The signals to enable or disable. + * @return {Promise} a promise that is resolved when the signal state + * has been changed. + */ + async setSignals(signals) { + this.outputSignals_ = Object.assign(Object.assign({}, this.outputSignals_), signals); + if (signals.dataTerminalReady !== undefined || + signals.requestToSend !== undefined) { + // The Set_Control_Line_State command expects a bitmap containing the + // values of all output signals that should be enabled or disabled. + // + // Ref: USB CDC specification version 1.1 §6.2.14. + const value = (this.outputSignals_.dataTerminalReady ? 1 << 0 : 0) | + (this.outputSignals_.requestToSend ? 1 << 1 : 0); + await this.device_.controlTransferOut({ + 'requestType': 'class', + 'recipient': 'interface', + 'request': kSetControlLineState, + 'value': value, + 'index': this.controlInterface_.interfaceNumber, + }); + } + if (signals.break !== undefined) { + // The SendBreak command expects to be given a duration for how long the + // break signal should be asserted. Passing 0xFFFF enables the signal + // until 0x0000 is send. + // + // Ref: USB CDC specification version 1.1 §6.2.15. + const value = this.outputSignals_.break ? 0xFFFF : 0x0000; + await this.device_.controlTransferOut({ + 'requestType': 'class', + 'recipient': 'interface', + 'request': kSendBreak, + 'value': value, + 'index': this.controlInterface_.interfaceNumber, + }); + } + } + /** + * Checks the serial options for validity and throws an error if it is + * not valid + */ + validateOptions() { + if (!this.isValidBaudRate(this.serialOptions_.baudRate)) { + throw new RangeError('invalid Baud Rate ' + this.serialOptions_.baudRate); + } + if (!this.isValidDataBits(this.serialOptions_.dataBits)) { + throw new RangeError('invalid dataBits ' + this.serialOptions_.dataBits); + } + if (!this.isValidStopBits(this.serialOptions_.stopBits)) { + throw new RangeError('invalid stopBits ' + this.serialOptions_.stopBits); + } + if (!this.isValidParity(this.serialOptions_.parity)) { + throw new RangeError('invalid parity ' + this.serialOptions_.parity); + } + } + /** + * Checks the baud rate for validity + * @param {number} baudRate the baud rate to check + * @return {boolean} A boolean that reflects whether the baud rate is valid + */ + isValidBaudRate(baudRate) { + return baudRate % 1 === 0; + } + /** + * Checks the data bits for validity + * @param {number} dataBits the data bits to check + * @return {boolean} A boolean that reflects whether the data bits setting is + * valid + */ + isValidDataBits(dataBits) { + if (typeof dataBits === 'undefined') { + return true; + } + return kAcceptableDataBits.includes(dataBits); + } + /** + * Checks the stop bits for validity + * @param {number} stopBits the stop bits to check + * @return {boolean} A boolean that reflects whether the stop bits setting is + * valid + */ + isValidStopBits(stopBits) { + if (typeof stopBits === 'undefined') { + return true; + } + return kAcceptableStopBits.includes(stopBits); + } + /** + * Checks the parity for validity + * @param {string} parity the parity to check + * @return {boolean} A boolean that reflects whether the parity is valid + */ + isValidParity(parity) { + if (typeof parity === 'undefined') { + return true; + } + return kAcceptableParity.includes(parity); + } + /** + * sends the options alog the control interface to set them on the device + * @return {Promise} a promise that will resolve when the options are set + */ + async setLineCoding() { + var _a, _b, _c; + // Ref: USB CDC specification version 1.1 §6.2.12. + const buffer = new ArrayBuffer(7); + const view = new DataView(buffer); + view.setUint32(0, this.serialOptions_.baudRate, true); + view.setUint8(4, kStopBitsIndexMapping.indexOf((_a = this.serialOptions_.stopBits) !== null && _a !== void 0 ? _a : kDefaultStopBits)); + view.setUint8(5, kParityIndexMapping.indexOf((_b = this.serialOptions_.parity) !== null && _b !== void 0 ? _b : kDefaultParity)); + view.setUint8(6, (_c = this.serialOptions_.dataBits) !== null && _c !== void 0 ? _c : kDefaultDataBits); + const result = await this.device_.controlTransferOut({ + 'requestType': 'class', + 'recipient': 'interface', + 'request': kSetLineCoding, + 'value': 0x00, + 'index': this.controlInterface_.interfaceNumber, + }, buffer); + if (result.status != 'ok') { + throw new DOMException('NetworkError', 'Failed to set line coding.'); + } + } +} +/** implementation of the global navigator.serial object */ +class Serial { + /** + * Requests permission to access a new port. + * + * @param {SerialPortRequestOptions} options + * @param {SerialPolyfillOptions} polyfillOptions + * @return {Promise} + */ + async requestPort(options, polyfillOptions) { + polyfillOptions = Object.assign(Object.assign({}, kDefaultPolyfillOptions), polyfillOptions); + const usbFilters = []; + if (options && options.filters) { + for (const filter of options.filters) { + const usbFilter = { + classCode: polyfillOptions.usbControlInterfaceClass, + }; + if (filter.usbVendorId !== undefined) { + usbFilter.vendorId = filter.usbVendorId; + } + if (filter.usbProductId !== undefined) { + usbFilter.productId = filter.usbProductId; + } + usbFilters.push(usbFilter); + } + } + if (usbFilters.length === 0) { + usbFilters.push({ + classCode: polyfillOptions.usbControlInterfaceClass, + }); + } + const device = await navigator.usb.requestDevice({ 'filters': usbFilters }); + const port = new SerialPort(device, polyfillOptions); + return port; + } + /** + * Get the set of currently available ports. + * + * @param {SerialPolyfillOptions} polyfillOptions Polyfill configuration that + * should be applied to these ports. + * @return {Promise} a promise that is resolved with a list of + * ports. + */ + async getPorts(polyfillOptions) { + polyfillOptions = Object.assign(Object.assign({}, kDefaultPolyfillOptions), polyfillOptions); + const devices = await navigator.usb.getDevices(); + const ports = []; + devices.forEach((device) => { + try { + const port = new SerialPort(device, polyfillOptions); + ports.push(port); + } + catch (e) { + // Skip unrecognized port. + } + }); + return ports; + } +} +/* an object to be used for starting the serial workflow */ +export const serial = new Serial(); +//# sourceMappingURL=serial.js.map \ No newline at end of file diff --git a/web-serial-polyfill/serial.js.map b/web-serial-polyfill/serial.js.map new file mode 100644 index 0000000..e53b0a4 --- /dev/null +++ b/web-serial-polyfill/serial.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serial.js","sourceRoot":"","sources":["../serial.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,YAAY,CAAC;AAEb,MAAM,CAAN,IAAY,sBAEX;AAFD,WAAY,sBAAsB;IAChC,6EAAS,CAAA;AACX,CAAC,EAFW,sBAAsB,KAAtB,sBAAsB,QAEjC;AAQD,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,MAAM,mBAAmB,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7C,MAAM,mBAAmB,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACnC,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAElD,MAAM,mBAAmB,GACrB,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC5B,MAAM,qBAAqB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AAE1C,MAAM,uBAAuB,GAAG;IAC9B,QAAQ,EAAE,sBAAsB,CAAC,SAAS;IAC1C,wBAAwB,EAAE,CAAC;IAC3B,yBAAyB,EAAE,EAAE;CAC9B,CAAC;AAEF;;;;;;;GAOG;AACH,SA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