diff --git a/_includes/custom-head.html b/_includes/custom-head.html index 7b988829..82389ed2 100644 --- a/_includes/custom-head.html +++ b/_includes/custom-head.html @@ -3,8 +3,10 @@ 1. Head over to https://realfavicongenerator.net/ to add your own favicons. 2. Customize default _includes/custom-head.html in your source directory and insert the given code snippet. + {% endcomment %} - \ No newline at end of file diff --git a/assets/manifests/SLZB07.json b/assets/manifests/SLZB07.json index b5f21274..128c0cf4 100644 --- a/assets/manifests/SLZB07.json +++ b/assets/manifests/SLZB07.json @@ -2,7 +2,6 @@ "product_name": "SMLIGHT SLZB-07", "baudrates": { "bootloader": [115200], - "cpc": [460800, 115200, 230400], "ezsp": [115200, 230400], "spinel": [460800] }, @@ -19,6 +18,12 @@ "type": "ncp-uart-hw", "version": "7.4.4.0" }, + { + "name": "Zigbee (EZSP SiSDK)", + "url": "https://github.com/darkxst/silabs-firmware-builder/releases/download/20241106/slzb07_zigbee_ncp_8.0.2.0_115200.gbl", + "type": "ncp-uart-hw", + "version": "8.0.2.0" + }, { "name": "Multi-PAN (RCP)", "url": "https://raw.githubusercontent.com/darkxst/silabs-firmware-builder/main/firmware_builds/slzb-07/rcp-uart-802154-v4.3.1-slzb-07-460800.gbl", @@ -31,6 +36,12 @@ "type": "ot-rcp", "version": "2.4.4.0" }, + { + "name": "OpenThread (SiSDK)", + "url": "https://github.com/darkxst/silabs-firmware-builder/releases/download/20241106/slzb07_opentread_rcp_2.5.2.0_GitHub-1fceb225b_gsdk_2024.6.2_460800.gbl", + "type": "ot-rcp", + "version": "2.5.2.0" + }, { "name": "Unlock Bootloader", "url": "https://raw.githubusercontent.com/darkxst/silabs-firmware-builder/main/firmware_builds/slzb-07/BTL_SLZB07.gbl", diff --git a/assets/manifests/slzb07Mg24.json b/assets/manifests/slzb07Mg24.json new file mode 100644 index 00000000..49c6d77b --- /dev/null +++ b/assets/manifests/slzb07Mg24.json @@ -0,0 +1,42 @@ +{ + "product_name": "SMLIGHT SLZB-07Mg24", + "baudrates": { + "bootloader": [115200], + "ezsp": [115200, 230400], + "spinel": [460800], + "router": [115200] + }, + "usb_filters": [ + { + "pid": 60000, + "vid": 4292 + } + ], + "firmwares": [ + { + "name": "Zigbee (EZSP)", + "url": "https://raw.githubusercontent.com/darkxst/silabs-firmware-builder/main/firmware_builds/slzb-07mg24/ncp-uart-hw-v7.4.4.0-slzb-07mg24-115200.gbl", + "type": "ncp-uart-hw", + "version": "7.4.4.0" + }, + { + "name": "Zigbee (EZSP SiSDK)", + "url": "https://github.com/darkxst/silabs-firmware-builder/releases/download/20241106/slzb07Mg24_zigbee_ncp_8.0.2.0_115200.gbl", + "type": "ncp-uart-hw", + "version": "8.0.2.0" + }, + { + "name": "OpenThread", + "url": "https://raw.githubusercontent.com/darkxst/silabs-firmware-builder/main/firmware_builds/slzb-07mg24/ot-rcp-v2.4.4.0-slzb-07mg24-460800.gbl", + "type": "ot-rcp", + "version": "2.4.4.0" + }, + { + "name": "OpenThread (SiSDK)", + "url": "https://github.com/darkxst/silabs-firmware-builder/releases/download/20241106/slzb07Mg24_opentread_rcp_2.5.2.0_GitHub-1fceb225b_gsdk_2024.6.2_460800.gbl", + "type": "ot-rcp", + "version": "2.5.2.0" + } + ], + "allow_custom_firmware_upload": true +} diff --git a/dist/const.d.ts b/dist/const.d.ts new file mode 100644 index 00000000..5bee83df --- /dev/null +++ b/dist/const.d.ts @@ -0,0 +1,78 @@ +export declare const mdiFirmware = "M9.5,8.5L11,10L8,13L11,16L9.5,17.5L5,13L9.5,8.5M14.5,17.5L13,16L16,13L13,10L14.5,8.5L19,13L14.5,17.5M21,2H3A2,2 0 0,0 1,4V20A2,2 0 0,0 3,22H21A2,2 0 0,0 23,20V4A2,2 0 0,0 21,2M21,20H3V6H21V20Z"; +export declare const mdiThread = "M12 0C5.383 0 0 5.384 0 12.002 0 18.574 5.31 23.928 11.865 24V12.012H7.938A2.12 2.12 0 0 0 5.82 14.13a2.12 2.12 0 0 0 2.116 2.117v2.616a4.738 4.738 0 0 1-4.731-4.733 4.738 4.738 0 0 1 4.731-4.734h3.928V8.074a3.943 3.943 0 0 1 3.938-3.94 3.944 3.944 0 0 1 3.94 3.94 3.944 3.944 0 0 1-3.94 3.939H14.48v11.731C19.911 22.598 24 17.77 24 12.002 24 5.384 18.617 0 12 0Zm5.127 8.073a1.325 1.325 0 0 0-1.324-1.324 1.325 1.325 0 0 0-1.323 1.324v1.323h1.323a1.325 1.325 0 0 0 1.324-1.323z"; +export declare enum ApplicationType { + GECKO_BOOTLOADER = "bootloader", + CPC = "cpc", + EZSP = "ezsp", + SPINEL = "spinel", + ROUTER = "router" +} +export declare const ApplicationNames: { + bootloader: string; + cpc: string; + ezsp: string; + spinel: string; + router: string; +}; +export declare enum FirmwareType { + ZIGBEE_NCP = "zigbee_ncp", + ZIGBEE_ROUTER = "zigbee_router", + OPENTHREAD_RCP = "openthread_rcp", + BOOTLOADER = "bootloader", + MULTIPAN = "multipan", + UNKNOWN = "unknown" +} +export declare const LegacyTypeToFirmwareType: { + 'ncp-uart-hw': FirmwareType; + 'ncp-uart-sw': FirmwareType; + 'rcp-uart-802154': FirmwareType; + 'ot-rcp': FirmwareType; + 'gecko-bootloader': FirmwareType; +}; +export declare const FirmwareIcons: { + zigbee_ncp: string; + zigbee_router: string; + multipan: string; + openthread_rcp: string; + bootloader: string; + unknown: string; +}; +export declare const FirmwareNames: { + zigbee_ncp: string; + zigbee_router: string; + multipan: string; + openthread_rcp: string; + bootloader: string; + unknown: string; +}; +export declare const ApplicationTypeToFirmwareType: { + cpc: FirmwareType; + ezsp: FirmwareType; + router: FirmwareType; + spinel: FirmwareType; + bootloader: FirmwareType; +}; +export interface USBFilter { + pid: number; + vid: number; +} +export interface Firmware { + name: string; + url: string; + type: FirmwareType; + version: string; +} +export interface ManifestBaudrates { + bootloader: number[]; + cpc: number[]; + ezsp: number[]; + spinel: number[]; + router: number[]; +} +export interface Manifest { + product_name: string; + baudrates: ManifestBaudrates; + usb_filters: USBFilter[]; + firmwares: Firmware[]; + allow_custom_firmware_upload: boolean; +} diff --git a/dist/const.js b/dist/const.js new file mode 100644 index 00000000..1482cbac --- /dev/null +++ b/dist/const.js @@ -0,0 +1,57 @@ +import { mdiMulticast, mdiZigbee, mdiRouter } from '@mdi/js'; +export const mdiFirmware = 'M9.5,8.5L11,10L8,13L11,16L9.5,17.5L5,13L9.5,8.5M14.5,17.5L13,16L16,13L13,10L14.5,8.5L19,13L14.5,17.5M21,2H3A2,2 0 0,0 1,4V20A2,2 0 0,0 3,22H21A2,2 0 0,0 23,20V4A2,2 0 0,0 21,2M21,20H3V6H21V20Z'; +export const mdiThread = 'M12 0C5.383 0 0 5.384 0 12.002 0 18.574 5.31 23.928 11.865 24V12.012H7.938A2.12 2.12 0 0 0 5.82 14.13a2.12 2.12 0 0 0 2.116 2.117v2.616a4.738 4.738 0 0 1-4.731-4.733 4.738 4.738 0 0 1 4.731-4.734h3.928V8.074a3.943 3.943 0 0 1 3.938-3.94 3.944 3.944 0 0 1 3.94 3.94 3.944 3.944 0 0 1-3.94 3.939H14.48v11.731C19.911 22.598 24 17.77 24 12.002 24 5.384 18.617 0 12 0Zm5.127 8.073a1.325 1.325 0 0 0-1.324-1.324 1.325 1.325 0 0 0-1.323 1.324v1.323h1.323a1.325 1.325 0 0 0 1.324-1.323z'; +export var ApplicationType; +(function (ApplicationType) { + ApplicationType["GECKO_BOOTLOADER"] = "bootloader"; + ApplicationType["CPC"] = "cpc"; + ApplicationType["EZSP"] = "ezsp"; + ApplicationType["SPINEL"] = "spinel"; + ApplicationType["ROUTER"] = "router"; +})(ApplicationType || (ApplicationType = {})); +export const ApplicationNames = { + [ApplicationType.GECKO_BOOTLOADER]: 'Bootloader (recovery)', + [ApplicationType.CPC]: 'Multi-PAN (RCP)', + [ApplicationType.EZSP]: 'Zigbee (EZSP)', + [ApplicationType.SPINEL]: 'OpenThread (RCP)', + [ApplicationType.ROUTER]: 'Zigbee Router', +}; +export var FirmwareType; +(function (FirmwareType) { + FirmwareType["ZIGBEE_NCP"] = "zigbee_ncp"; + FirmwareType["ZIGBEE_ROUTER"] = "zigbee_router"; + FirmwareType["OPENTHREAD_RCP"] = "openthread_rcp"; + FirmwareType["BOOTLOADER"] = "bootloader"; + FirmwareType["MULTIPAN"] = "multipan"; + FirmwareType["UNKNOWN"] = "unknown"; +})(FirmwareType || (FirmwareType = {})); +export const LegacyTypeToFirmwareType = { + 'ncp-uart-hw': FirmwareType.ZIGBEE_NCP, + 'ncp-uart-sw': FirmwareType.ZIGBEE_NCP, + 'rcp-uart-802154': FirmwareType.MULTIPAN, + 'ot-rcp': FirmwareType.OPENTHREAD_RCP, + 'gecko-bootloader': FirmwareType.BOOTLOADER, +}; +export const FirmwareIcons = { + [FirmwareType.ZIGBEE_NCP]: mdiZigbee, + [FirmwareType.ZIGBEE_ROUTER]: mdiRouter, + [FirmwareType.MULTIPAN]: mdiMulticast, + [FirmwareType.OPENTHREAD_RCP]: mdiThread, + [FirmwareType.BOOTLOADER]: mdiFirmware, + [FirmwareType.UNKNOWN]: mdiFirmware, +}; +export const FirmwareNames = { + [FirmwareType.ZIGBEE_NCP]: 'Zigbee (EZSP)', + [FirmwareType.ZIGBEE_ROUTER]: 'Zigbee Router', + [FirmwareType.MULTIPAN]: 'Multi-PAN (RCP)', + [FirmwareType.OPENTHREAD_RCP]: 'OpenThread (RCP)', + [FirmwareType.BOOTLOADER]: 'Gecko Bootloader', + [FirmwareType.UNKNOWN]: 'Unknown', +}; +export const ApplicationTypeToFirmwareType = { + [ApplicationType.CPC]: FirmwareType.MULTIPAN, + [ApplicationType.EZSP]: FirmwareType.ZIGBEE_NCP, + [ApplicationType.ROUTER]: FirmwareType.ZIGBEE_ROUTER, + [ApplicationType.SPINEL]: FirmwareType.OPENTHREAD_RCP, + [ApplicationType.GECKO_BOOTLOADER]: FirmwareType.BOOTLOADER, +}; diff --git a/dist/dummy_module_loader.py b/dist/dummy_module_loader.py new file mode 100644 index 00000000..1085d057 --- /dev/null +++ b/dist/dummy_module_loader.py @@ -0,0 +1,25 @@ +import sys +import unittest.mock + + +class DummyFinder: + """ + Combined module loader and finder that recursively returns Mock objects. + """ + + def __init__(self, name): + self.name = name + + def find_module(self, fullname, path=None): + if fullname.startswith(self.name): + return self + + def load_module(self, fullname): + return sys.modules.setdefault(fullname, unittest.mock.MagicMock(__path__=[])) + + +def __getattr__(name): + return unittest.mock.MagicMock() + + +sys.meta_path.append(DummyFinder(__name__)) \ No newline at end of file diff --git a/dist/firmware-selector.d.ts b/dist/firmware-selector.d.ts new file mode 100644 index 00000000..8dadd0ea --- /dev/null +++ b/dist/firmware-selector.d.ts @@ -0,0 +1,30 @@ +import { LitElement } from 'lit'; +import type { Pyodide } from './setup-pyodide'; +import type { Manifest } from './const'; +import './usf-file-upload'; +import './usf-icon'; +import '@material/mwc-dialog'; +import '@material/mwc-button'; +import '@material/mwc-formfield'; +import '@material/mwc-radio'; +import '@material/mwc-circular-progress'; +type GBLImage = any; +export declare function parseFirmwareBuffer(pyodide: Pyodide, buffer: ArrayBuffer): Promise; +export declare class FirmwareSelector extends LitElement { + pyodide: Pyodide; + manifest: Manifest; + private firmwareUploadIndex; + private firmwareLoaded; + firstUpdated(): void; + private firmwareUploadTypeChanged; + private customFirmwareChosen; + private loadFirmware; + render(): import("lit-html").TemplateResult<1>; + static styles: import("lit").CSSResult; +} +declare global { + interface HTMLElementTagNameMap { + 'firmware-selector': FirmwareSelector; + } +} +export {}; diff --git a/dist/firmware-selector.js b/dist/firmware-selector.js new file mode 100644 index 00000000..c0267736 --- /dev/null +++ b/dist/firmware-selector.js @@ -0,0 +1,147 @@ +import { __decorate } from "tslib"; +import { LitElement, html, css } from 'lit'; +import { customElement, state, property } from 'lit/decorators.js'; +import { classMap } from 'lit/directives/class-map.js'; +import { mdiFileUpload } from '@mdi/js'; +import { FirmwareIcons } from './const'; +import './usf-file-upload'; +import './usf-icon'; +import '@material/mwc-dialog'; +import '@material/mwc-button'; +import '@material/mwc-formfield'; +import '@material/mwc-radio'; +import '@material/mwc-circular-progress'; +const CUSTOM_UPLOAD_INDEX = 9999; +async function readFile(file) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onload = () => resolve(reader.result); + reader.onerror = e => reject(e); + reader.readAsArrayBuffer(file); + }); +} +export async function parseFirmwareBuffer(pyodide, buffer) { + const { GBLImage } = pyodide.pyimport('universal_silabs_flasher.firmware'); + return await GBLImage.from_bytes.callKwargs(pyodide.toPy(buffer), {}); +} +let FirmwareSelector = class FirmwareSelector extends LitElement { + constructor() { + super(...arguments); + this.firmwareUploadIndex = 0; + } + firmwareLoaded(firmware) { + this.dispatchEvent(new CustomEvent('firmwareLoaded', { + detail: { firmware }, + bubbles: true, + composed: true, + })); + } + firstUpdated() { + this.renderRoot + .querySelector('mwc-radio') + .dispatchEvent(new Event('change')); + } + async firmwareUploadTypeChanged(event) { + this.firmwareUploadIndex = parseInt(event.target.value, 10); + // The GBL file upload element will be rendered empty + if (this.firmwareUploadIndex === CUSTOM_UPLOAD_INDEX) { + this.firmwareLoaded(undefined); + return; + } + // Download the firmware + const firmware = this.manifest.firmwares[this.firmwareUploadIndex]; + const response = await fetch(firmware.url); + if (!response.ok) { + alert(`Failed to download firmware: ${response}`); + return; + } + const firmwareData = await response.arrayBuffer(); + await this.loadFirmware(firmwareData); + } + async customFirmwareChosen(event) { + const file = event.target.files[0]; + const firmwareData = await readFile(file); + await this.loadFirmware(firmwareData); + } + async loadFirmware(buffer) { + let firmware; + try { + firmware = await parseFirmwareBuffer(this.pyodide, buffer); + } + catch (e) { + firmware = undefined; + alert(`Failed to parse firmware: ${e}`); + } + this.firmwareLoaded(firmware); + } + render() { + return html ` + ${this.manifest.firmwares.map((fw, index) => html ` +
+ + + + + +
+ `)} + ${this.manifest.allow_custom_firmware_upload + ? html ` +
+ + + + + + + Upload +
+ ` + : ''} + `; + } +}; +FirmwareSelector.styles = css ` + .hidden { + display: none; + } + + mwc-formfield { + display: block; + } + + usf-icon { + margin-right: 1em; + } + `; +__decorate([ + property() +], FirmwareSelector.prototype, "pyodide", void 0); +__decorate([ + property() +], FirmwareSelector.prototype, "manifest", void 0); +__decorate([ + state() +], FirmwareSelector.prototype, "firmwareUploadIndex", void 0); +FirmwareSelector = __decorate([ + customElement('firmware-selector') +], FirmwareSelector); +export { FirmwareSelector }; diff --git a/dist/flashing-dialog.d.ts b/dist/flashing-dialog.d.ts new file mode 100644 index 00000000..a26da961 --- /dev/null +++ b/dist/flashing-dialog.d.ts @@ -0,0 +1,47 @@ +import { LitElement } from 'lit'; +import type { Pyodide } from './setup-pyodide'; +import '@material/mwc-button'; +import '@material/mwc-icon-button'; +import '@material/mwc-linear-progress'; +import '@material/mwc-circular-progress'; +import '@material/mwc-formfield'; +import '@material/mwc-radio'; +import '@material/mwc-dialog'; +import './usf-icon'; +import './usf-icon-button'; +import './usf-file-upload'; +import './firmware-selector'; +import type { Manifest } from './const'; +export declare class FlashingDialog extends LitElement { + static styles: import("lit").CSSResult; + private flashingStep; + pyodide?: Pyodide; + private pyodideLoadState; + manifest: Manifest; + private debugLog; + private selectedFirmware?; + private serialPort?; + private pyFlasher?; + private uploadProgress; + private progressState; + private mwcDialog; + firstUpdated(changedProperties: Map): void; + private getFirmwareMetadata; + private generateProbeMethods; + private selectSerialPort; + private onPyodideLoaded; + private detectRunningFirmware; + private selectFirmware; + private onFirmwareLoaded; + private flashFirmware; + private close; + private showDebugLog; + private formatHeadingText; + private simpleVersion; + render(): import("lit-html").TemplateResult<1>; +} +declare global { + interface HTMLElementTagNameMap { + 'flashing-dialog': FlashingDialog; + } +} diff --git a/dist/flashing-dialog.js b/dist/flashing-dialog.js new file mode 100644 index 00000000..b36405ad --- /dev/null +++ b/dist/flashing-dialog.js @@ -0,0 +1,599 @@ +import { __decorate } from "tslib"; +import { LitElement, html, css } from 'lit'; +import { customElement, state, property, query } from 'lit/decorators.js'; +import '@material/mwc-button'; +import '@material/mwc-icon-button'; +import '@material/mwc-linear-progress'; +import '@material/mwc-circular-progress'; +import '@material/mwc-formfield'; +import '@material/mwc-radio'; +import '@material/mwc-dialog'; +import { mdiChip, mdiShimmer, mdiAutorenew, mdiClose, mdiAlert } from '@mdi/js'; +import './usf-icon'; +import './usf-icon-button'; +import './usf-file-upload'; +import { parseFirmwareBuffer } from './firmware-selector'; +import './firmware-selector'; +import { FirmwareNames, ApplicationNames, ApplicationType, ApplicationTypeToFirmwareType, mdiFirmware, LegacyTypeToFirmwareType, } from './const'; +import { setupPyodide, PyodideLoadState } from './setup-pyodide'; +import { downloadFile } from './utils'; +var UploadProgressState; +(function (UploadProgressState) { + UploadProgressState[UploadProgressState["IDLE"] = 0] = "IDLE"; + UploadProgressState[UploadProgressState["CONNECTING"] = 1] = "CONNECTING"; + UploadProgressState[UploadProgressState["FLASHING"] = 2] = "FLASHING"; +})(UploadProgressState || (UploadProgressState = {})); +var FlashingStep; +(function (FlashingStep) { + FlashingStep[FlashingStep["IDLE"] = 0] = "IDLE"; + FlashingStep[FlashingStep["SELECTING_PORT"] = 1] = "SELECTING_PORT"; + FlashingStep[FlashingStep["PORT_SELECTION_CANCELLED"] = 2] = "PORT_SELECTION_CANCELLED"; + FlashingStep[FlashingStep["LOADING_PYODIDE"] = 3] = "LOADING_PYODIDE"; + FlashingStep[FlashingStep["PROBING"] = 4] = "PROBING"; + FlashingStep[FlashingStep["PROBING_COMPLETE"] = 5] = "PROBING_COMPLETE"; + FlashingStep[FlashingStep["PROBING_FAILED"] = 6] = "PROBING_FAILED"; + FlashingStep[FlashingStep["SELECT_FIRMWARE"] = 7] = "SELECT_FIRMWARE"; + FlashingStep[FlashingStep["INSTALLING"] = 8] = "INSTALLING"; + FlashingStep[FlashingStep["INSTALL_FAILED"] = 9] = "INSTALL_FAILED"; + FlashingStep[FlashingStep["DONE"] = 10] = "DONE"; +})(FlashingStep || (FlashingStep = {})); +let FlashingDialog = class FlashingDialog extends LitElement { + constructor() { + super(...arguments); + this.flashingStep = FlashingStep.IDLE; + this.pyodideLoadState = PyodideLoadState.LOADING_PYODIDE; + this.debugLog = ''; + this.uploadProgress = 0; + this.progressState = UploadProgressState.IDLE; + } + firstUpdated(changedProperties) { + super.firstUpdated(changedProperties); + this.mwcDialog.addEventListener('close', this.close); + this.selectSerialPort(); + } + getFirmwareMetadata() { + if (!this.selectedFirmware) { + return html ``; + } + let metadata; + try { + metadata = this.selectedFirmware.get_nabucasa_metadata(); + } + catch (e) { + return html ``; + } + const fwTypeValue = metadata.fw_type + .value; + if (fwTypeValue in LegacyTypeToFirmwareType) { + metadata.fw_type = LegacyTypeToFirmwareType[fwTypeValue]; + } + return html ` + + + + + + + + + + + + + + + +
Type + ${FirmwareNames[metadata.fw_type.value] || + 'unknown'} +
SDK Version${this.simpleVersion(metadata.sdk_version)}
EZSP Version${this.simpleVersion(metadata.ezsp_version) || '-'}
+ `; + } + generateProbeMethods(PyApplicationType) { + const baudrates = new Map(); + const probe_methods = []; + const valueToKeyMap = Object.entries(ApplicationType).reduce((acc, [key, value]) => { + acc[value] = key; + return acc; + }, {}); + const baudKeys = Object.keys(this.manifest.baudrates); + baudKeys.forEach(key => { + const pyAppTypeKey = valueToKeyMap[key]; + const pyAppEnum = PyApplicationType[pyAppTypeKey]; + if (pyAppTypeKey && pyAppEnum) { + probe_methods.push(pyAppEnum); + baudrates.set(pyAppEnum, this.manifest.baudrates[key]); + } + }); + return { baudrates, probe_methods }; + } + async selectSerialPort() { + this.flashingStep = FlashingStep.SELECTING_PORT; + const options = {}; + if (this.manifest.usb_filters) { + options.filters = this.manifest.usb_filters.map(f => ({ + usbProductId: f.pid, + usbVendorId: f.vid, + })); + } + try { + this.serialPort = await navigator.serial.requestPort(options); + } + catch (err) { + console.log(err); + this.mwcDialog.open = true; + this.serialPort = undefined; + this.flashingStep = FlashingStep.PORT_SELECTION_CANCELLED; + return; + } + this.mwcDialog.open = true; + this.flashingStep = FlashingStep.LOADING_PYODIDE; + this.pyodide = await setupPyodide(newLoadState => { + this.pyodideLoadState = newLoadState; + }); + await this.onPyodideLoaded(); + } + async onPyodideLoaded() { + this.pyodide.setStdout({ + batched: (msg) => { + console.log(msg); + this.debugLog += `${msg}\n`; + }, + }); + this.pyodide.setStderr({ + batched: (msg) => { + console.warn(msg); + this.debugLog += `${msg}\n`; + }, + }); + // Set up the flasher + this.pyodide + .pyimport('webserial_transport') + .set_global_serial_port(this.serialPort); + const PyApplicationType = this.pyodide.pyimport('universal_silabs_flasher.const').ApplicationType; + // Generate probe-methods and baudrates from manifest values + const { baudrates, probe_methods } = this.generateProbeMethods(PyApplicationType); + // Pyodide currently seems to have issues passing double proxied objects, especially + // with list comprehensions and generators. Until this is fixed, we need to + // explicitly convert the types with a wrapper function. + this.pyFlasher = this.pyodide + .runPython(` + from universal_silabs_flasher.flasher import Flasher + + def create_flasher(baudrates, probe_methods, device): + return Flasher( + baudrates=baudrates.to_py(), + probe_methods=probe_methods.to_py(), + device=device, + ) + + create_flasher + `) + .callKwargs({ + baudrates: baudrates, + probe_methods: probe_methods, + device: '/dev/webserial', // the device name is ignored + }); + await this.detectRunningFirmware(); + } + async detectRunningFirmware() { + this.flashingStep = FlashingStep.PROBING; + try { + await this.pyFlasher.probe_app_type(); + } + catch (e) { + this.pyFlasher = undefined; + this.serialPort = undefined; + this.flashingStep = FlashingStep.PROBING_FAILED; + return; + } + this.flashingStep = FlashingStep.PROBING_COMPLETE; + } + selectFirmware() { + this.flashingStep = FlashingStep.SELECT_FIRMWARE; + } + onFirmwareLoaded(e) { + this.selectedFirmware = e.detail.firmware; + } + async flashFirmware() { + this.flashingStep = FlashingStep.INSTALLING; + this.uploadProgress = 0; + await this.pyFlasher.enter_bootloader(); + try { + await this.pyFlasher.flash_firmware.callKwargs(this.selectedFirmware, { + progress_callback: (current, total) => { + this.uploadProgress = current / total; + }, + }); + this.flashingStep = FlashingStep.DONE; + } + catch (e) { + this.flashingStep = FlashingStep.INSTALL_FAILED; + } + } + async close() { + if (this.serialPort) { + await this.serialPort.close(); + } + this.parentNode.removeChild(this); + } + showDebugLog() { + const debugText = `data:text/plain;charset=utf-8,${encodeURIComponent(this.debugLog)}`; + downloadFile(debugText, 'silabs_flasher.log'); + } + formatHeadingText(text) { + if (text.length < 20) { + return text; + } + // FIXME: this moves the closing `x` out of the way + return text + '\u00A0'.repeat(8); + } + simpleVersion(version) { + if (!version) { + return null; + } + return Array.from(version.components) + .map((c) => c.data) + .join(''); + } + render() { + let content = html ``; + let headingText = 'Connecting'; + let showDebugLogButton = true; + let showCloseButton = true; + let hideActions = false; + if (this.flashingStep === FlashingStep.SELECTING_PORT) { + if (this.mwcDialog) { + this.mwcDialog.open = false; + } + hideActions = true; + showDebugLogButton = false; + headingText = 'Select a serial port'; + content = html `

+

+

Plug in and select your ${this.manifest.product_name}

+

`; + } + else if (this.flashingStep === FlashingStep.PORT_SELECTION_CANCELLED) { + showDebugLogButton = false; + headingText = 'Serial port was not selected'; + content = html `

+ If you didn't select a serial port because the + ${this.manifest.product_name} was missing, make sure the USB port it's + plugged into works and the ${this.manifest.product_name} is detected + by your operating system. +

+

+ If you are using Windows or macOS, install the + Silicon Labs CP2102 driver. +

+ + + Retry + `; + } + else if ([FlashingStep.LOADING_PYODIDE, FlashingStep.PROBING].includes(this.flashingStep)) { + hideActions = true; + showDebugLogButton = false; + headingText = ''; + content = html `

+

+ + +

+

+ Connecting... +
+ This can take a few seconds. +

+

`; + } + else if (this.flashingStep === FlashingStep.PROBING_FAILED) { + const isMacOS = navigator.userAgent.includes('Mac OS'); + const isUsingCP210x = this.manifest.usb_filters.find(filter => filter.vid == 4292 && filter.pid == 60000); + headingText = 'Connection failed'; + content = html `${isMacOS && isUsingCP210x + ? html `
+

macOS Driver Bug

+ +

+ The built-in drivers on macOS do not work properly with the + ${this.manifest.product_name}. Install the updated + Silicon Labs CP2102 driver + and re-connect to the serial port titled + CP210x USB to UART Bridge Controller + (cu.SLAB_USBtoUART). +

+
` + : ''} +

The running firmware could not be detected.

+ +

+ Make sure the USB port works and if you are using a USB extension + cable, make sure the cable can transfer data. Unplug the + ${this.manifest.product_name} and plug it back in to reset and try + again. +

+ + + Retry + `; + } + else if (this.flashingStep === FlashingStep.PROBING_COMPLETE) { + hideActions = true; + showDebugLogButton = false; + headingText = this.manifest.product_name; + const { Version } = this.pyodide.pyimport('universal_silabs_flasher.common'); + const appType = this.pyFlasher.app_type.value; + const compatibleFirmwareType = ApplicationTypeToFirmwareType[appType]; + const compatibleFirmware = this.manifest.firmwares.find(fw => fw.type === compatibleFirmwareType && + Version(fw.version) > this.pyFlasher.app_version && + !Version(fw.version).compatible_with(this.pyFlasher.app_version)); + // Show a one-click "upgrade" button if possible + let upgradeButton; + if (compatibleFirmware) { + upgradeButton = html ` { + const response = await fetch(compatibleFirmware.url); + const firmwareData = await response.arrayBuffer(); + this.selectedFirmware = await parseFirmwareBuffer(this.pyodide, firmwareData); + this.flashFirmware(); + }} + > + + Upgrade to  ${compatibleFirmware.version} + `; + } + content = html ` +

+ + + + + + + + + + + +
${ApplicationNames[appType] || 'unknown'} ${this.simpleVersion(this.pyFlasher.app_version)}
${this.manifest.product_name}
+

+ +
+ ${upgradeButton || ''} + + + Change firmware + +
`; + } + else if (this.flashingStep === FlashingStep.SELECT_FIRMWARE) { + headingText = this.manifest.product_name; + content = html ` +

Select new firmware to install.

+ + + + ${this.selectedFirmware + ? html `` + : ''} + + + Install + + `; + } + else if (this.flashingStep === FlashingStep.INSTALLING) { + // Hide the close button to prevent it from being accidentally clicked during flashing. + // The bootloader is resilient so nothing will actually break that can't be fixed by retrying. + hideActions = true; + showCloseButton = false; + headingText = 'Installing firmware'; + content = html ` +

+ The new firmware is now installing. Do not disconnect the + ${this.manifest.product_name} or close this browser window. +

+

+ Progress: ${(+this.uploadProgress * 100).toFixed(1)}% + +

+ `; + } + else if (this.flashingStep === FlashingStep.INSTALL_FAILED) { + headingText = 'Installation failed'; + content = html ` +

+ Firmware installation failed. Unplug your + ${this.manifest.product_name} and plug it back in to retry. +

+ + + Retry + + `; + } + else if (this.flashingStep === FlashingStep.DONE) { + headingText = 'Installation success'; + content = html ` +

Firmware has been successfully installed.

+ + + Continue + + `; + } + return html ` + + ${showCloseButton + ? html ` + + + + ` + : ''} + ${content} + ${showDebugLogButton + ? html ` + + Debug Log + + ` + : ''} + + `; + } +}; +FlashingDialog.styles = css ` + :host { + --mdc-theme-primary: #03a9f4; + } + + a { + color: var(--mdc-theme-primary); + } + + .metadata { + font-size: 0.8em; + } + + img { + vertical-align: middle; + } + + #closeButton { + position: absolute; + top: 10px; + right: 10px; + } + + p.spinner { + text-align: center; + font-size: 2em; + } + + p.firmware-metadata { + font-size: 0.8em; + line-height: 1.2; + overflow: auto; + } + + span.progress-text { + font-size: 0.8em; + } + + mwc-button usf-icon { + margin-right: 0.2em; + } + + #firmwareInstallButtons { + margin-left: -3px; + + text-align: left; + } + + #firmwareInstallButtons mwc-button { + display: block; + } + + #firmwareInstallButtons mwc-button:not(:last-child) { + margin-bottom: 0.3em; + } + + .centered { + text-align: center; + } + + td usf-icon { + vertical-align: bottom; + } + + section.warning { + background-color: hsl(38, 96%, 90%); + + font-size: 0.9em; + + margin-left: -24px; + margin-right: -24px; + + padding-left: 24px; + padding-right: 24px; + padding-top: 12px; + padding-bottom: 12px; + } + + section.warning h2 usf-icon { + vertical-align: text-bottom; + } + + section.warning code { + font-weight: bold; + } + `; +__decorate([ + state() +], FlashingDialog.prototype, "flashingStep", void 0); +__decorate([ + property() +], FlashingDialog.prototype, "pyodide", void 0); +__decorate([ + state() +], FlashingDialog.prototype, "pyodideLoadState", void 0); +__decorate([ + property() +], FlashingDialog.prototype, "manifest", void 0); +__decorate([ + state() +], FlashingDialog.prototype, "selectedFirmware", void 0); +__decorate([ + state() +], FlashingDialog.prototype, "serialPort", void 0); +__decorate([ + state() +], FlashingDialog.prototype, "uploadProgress", void 0); +__decorate([ + state() +], FlashingDialog.prototype, "progressState", void 0); +__decorate([ + query('mwc-dialog') +], FlashingDialog.prototype, "mwcDialog", void 0); +FlashingDialog = __decorate([ + customElement('flashing-dialog') +], FlashingDialog); +export { FlashingDialog }; diff --git a/dist/mock_sqlite3.py b/dist/mock_sqlite3.py new file mode 100644 index 00000000..15a065ed --- /dev/null +++ b/dist/mock_sqlite3.py @@ -0,0 +1,3 @@ +class sqlite3: + sqlite_version = "3.31.1" + sqlite_version_info = (3, 31, 1) \ No newline at end of file diff --git a/dist/nabucasa-zigbee-flasher.d.ts b/dist/nabucasa-zigbee-flasher.d.ts new file mode 100644 index 00000000..d9f5c659 --- /dev/null +++ b/dist/nabucasa-zigbee-flasher.d.ts @@ -0,0 +1,12 @@ +import { LitElement } from 'lit'; +import '@material/mwc-button'; +export declare class NabuCasaSilabsFlasher extends LitElement { + manifest: string; + openFlasherDialog(): Promise; + render(): import("lit-html").TemplateResult<1>; +} +declare global { + interface HTMLElementTagNameMap { + 'nabucasa-zigbee-flasher': NabuCasaSilabsFlasher; + } +} diff --git a/dist/nabucasa-zigbee-flasher.js b/dist/nabucasa-zigbee-flasher.js new file mode 100644 index 00000000..69ae8aa9 --- /dev/null +++ b/dist/nabucasa-zigbee-flasher.js @@ -0,0 +1,36 @@ +import { __decorate } from "tslib"; +import { LitElement, html } from 'lit'; +import { customElement, property } from 'lit/decorators.js'; +import '@material/mwc-button'; +let NabuCasaSilabsFlasher = class NabuCasaSilabsFlasher extends LitElement { + async openFlasherDialog() { + import('./flashing-dialog'); + const response = await fetch(this.manifest); + const manifest = await response.json(); + const dialog = document.createElement('flashing-dialog'); + dialog.manifest = manifest; + document.body.appendChild(dialog); + } + render() { + const supportsWebSerial = 'serial' in navigator; + return html ` + ${supportsWebSerial + ? html `Connect` + : html ` + Unfortunately, your browser does not support Web Serial. Open this + page in Google Chrome or Microsoft Edge. + `} + `; + } +}; +__decorate([ + property() +], NabuCasaSilabsFlasher.prototype, "manifest", void 0); +NabuCasaSilabsFlasher = __decorate([ + customElement('nabucasa-zigbee-flasher') +], NabuCasaSilabsFlasher); +export { NabuCasaSilabsFlasher }; diff --git a/dist/requirements.txt b/dist/requirements.txt new file mode 100644 index 00000000..6582b99b --- /dev/null +++ b/dist/requirements.txt @@ -0,0 +1,35 @@ +aiohappyeyeballs==2.4.3 +aiohttp==3.10.10 +aiosignal==1.3.1 +aiosqlite==0.20.0 +async-timeout==5.0.0 +attrs==24.2.0 +bellows==0.42.0 +cffi==1.17.1 +click==8.1.7 +click-log==0.4.0 +coloredlogs==15.0.1 +crc==7.0.0 +crccheck==1.3.0 +cryptography==43.0.3 +frozendict==2.4.6 +frozenlist==1.5.0 +gpiod==2.2.1 +humanfriendly==10.0 +idna==3.10 +jsonschema==4.23.0 +jsonschema-specifications==2024.10.1 +multidict==6.1.0 +propcache==0.2.0 +pure-pcapy3==1.0.1 +pycparser==2.22 +pyserial==3.5 +pyserial-asyncio==0.6 +pyserial-asyncio-fast==0.14 +referencing==0.35.1 +rpds-py==0.20.1 +setuptools==75.3.0 +typing_extensions==4.12.2 +voluptuous==0.15.2 +yarl==1.17.1 +zigpy==0.71.0 diff --git a/dist/setup-pyodide.d.ts b/dist/setup-pyodide.d.ts new file mode 100644 index 00000000..54ed8ddc --- /dev/null +++ b/dist/setup-pyodide.d.ts @@ -0,0 +1,7 @@ +export type Pyodide = any; +export declare enum PyodideLoadState { + LOADING_PYODIDE = 0, + INSTALLING_DEPENDENCIES = 1, + READY = 2 +} +export declare function setupPyodide(onStateChange: (newState: PyodideLoadState) => any): Promise; diff --git a/dist/setup-pyodide.js b/dist/setup-pyodide.js new file mode 100644 index 00000000..e08eda64 --- /dev/null +++ b/dist/setup-pyodide.js @@ -0,0 +1,103 @@ +import dummyModuleLoaderPy from './dummy_module_loader.py'; +import venvRequirementsTxt from './requirements.txt'; +import webSerialTransportPy from './webserial_transport.py'; +const MOCKED_MODULES = [ + // These dependencies shouldn't be mocked + // {package: 'async-timeout', module: 'async_timeout'}, + // {package: 'coloredlogs', module: 'coloredlogs'}, + // {package: 'humanfriendly', module: 'humanfriendly'}, + // Dependencies and sub-dependencies + { package: 'aiosignal', module: 'aiosignal' }, + { package: 'aiohttp', module: 'aiohttp' }, + { package: 'cffi', module: 'cffi' }, + { package: 'aiosqlite', module: 'aiosqlite' }, + { package: 'cryptography', module: 'cryptography' }, + { package: 'frozenlist', module: 'frozenlist' }, + { package: 'multidict', module: 'multidict' }, + { package: 'pycparser', module: 'pycparser' }, + { package: 'yarl', module: 'yarl' }, + { package: 'click', module: 'click' }, + { package: 'click-log', module: 'click_log' }, + { package: 'pure-pcapy3', module: 'pure_pcapy3' }, + { package: 'idna', module: 'idna' }, + { package: 'typing_extensions', module: 'typing_extensions' }, + { package: 'gpiod', module: 'gpiod' }, + { package: 'rpds', module: 'rpds' }, + { package: 'rpds-py', module: 'rpds-py' }, + // Internal modules not bundled by default with pyodide + { package: 'ssl', module: 'ssl', version: '1.0.0' }, +]; +const lineEnding = navigator.userAgent.toLowerCase().includes('win') + ? '\r\n' + : '\n'; +export var PyodideLoadState; +(function (PyodideLoadState) { + PyodideLoadState[PyodideLoadState["LOADING_PYODIDE"] = 0] = "LOADING_PYODIDE"; + PyodideLoadState[PyodideLoadState["INSTALLING_DEPENDENCIES"] = 1] = "INSTALLING_DEPENDENCIES"; + PyodideLoadState[PyodideLoadState["READY"] = 2] = "READY"; +})(PyodideLoadState || (PyodideLoadState = {})); +async function loadPyodide() { + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + script.onerror = e => reject(e); + script.onload = async () => { + const pyodide = await window.loadPyodide(); + resolve(pyodide); + }; + script.src = 'https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js'; + document.body.appendChild(script); + }); +} +function parseRequirementsTxt(requirementsTxt) { + const packages = new Map(); + for (const line of requirementsTxt.trim().split(lineEnding)) { + const [pkg, version] = line.split('=='); + packages.set(pkg, version); + } + return packages; +} +export async function setupPyodide(onStateChange) { + onStateChange(PyodideLoadState.LOADING_PYODIDE); + const pyodide = await loadPyodide(); + onStateChange(PyodideLoadState.INSTALLING_DEPENDENCIES); + await pyodide.loadPackage('micropip'); + const micropip = pyodide.pyimport('micropip'); + const requirementsTxt = parseRequirementsTxt(venvRequirementsTxt); + // Mock unnecessary packages to significantly reduce the download size + for (const mod of MOCKED_MODULES) { + micropip.add_mock_package.callKwargs({ + name: mod.package, + version: mod.version || requirementsTxt.get(mod.package), + modules: new Map([[mod.module, dummyModuleLoaderPy]]), + }); + } + // Include our webserial transport + micropip.add_mock_package.callKwargs({ + name: 'webserial_transport', + version: '1.0.0', + modules: new Map([['webserial_transport', webSerialTransportPy]]), + }); + // Filter mocked packages from requirements + const requirements = []; + for (const [pkg, version] of requirementsTxt) { + if (!MOCKED_MODULES.find(m => m.package === pkg)) { + requirements.push(`${pkg}==${version}`); + } + } + //side-load universal-silabs-flasher + const wheelPath = './universal_silabs_flasher-0.0.25-py3-none-any.whl'; + await micropip.install.callKwargs({ + requirements: wheelPath, + deps: false, + }); + // Install all packages to recreate the venv + await micropip.install.callKwargs({ + requirements: requirements, + deps: false, + }); + // Set up debug logging + const coloredlogs = pyodide.pyimport('coloredlogs'); + coloredlogs.install.callKwargs({ level: 'DEBUG' }); + onStateChange(PyodideLoadState.READY); + return pyodide; +} diff --git a/dist/tsconfig.tsbuildinfo b/dist/tsconfig.tsbuildinfo new file mode 100644 index 00000000..4c9d930c --- /dev/null +++ b/dist/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/tslib/tslib.d.ts","../node_modules/@mdi/js/mdi.d.ts","../src/const.ts","../node_modules/@lit/reactive-element/css-tag.d.ts","../node_modules/@lit/reactive-element/reactive-controller.d.ts","../node_modules/@lit/reactive-element/reactive-element.d.ts","../node_modules/@types/trusted-types/lib/index.d.ts","../node_modules/@types/trusted-types/index.d.ts","../node_modules/lit-html/directive.d.ts","../node_modules/lit-html/lit-html.d.ts","../node_modules/lit-element/lit-element.d.ts","../node_modules/lit-html/is-server.d.ts","../node_modules/lit/index.d.ts","../node_modules/@lit/reactive-element/decorators/base.d.ts","../node_modules/@lit/reactive-element/decorators/custom-element.d.ts","../node_modules/@lit/reactive-element/decorators/property.d.ts","../node_modules/@lit/reactive-element/decorators/state.d.ts","../node_modules/@lit/reactive-element/decorators/event-options.d.ts","../node_modules/@lit/reactive-element/decorators/query.d.ts","../node_modules/@lit/reactive-element/decorators/query-all.d.ts","../node_modules/@lit/reactive-element/decorators/query-async.d.ts","../node_modules/@lit/reactive-element/decorators/query-assigned-nodes.d.ts","../node_modules/@lit/reactive-element/decorators/query-assigned-elements.d.ts","../node_modules/lit/decorators.d.ts","../node_modules/lit-html/directives/class-map.d.ts","../node_modules/lit/directives/class-map.d.ts","../src/setup-pyodide.ts","../node_modules/@material/mwc-icon/mwc-icon.d.ts","../node_modules/@material/base/foundation.d.ts","../node_modules/@material/mwc-base/utils.d.ts","../node_modules/@material/base/types.d.ts","../node_modules/@material/mwc-base/base-element.d.ts","../node_modules/@material/ripple/types.d.ts","../node_modules/@material/ripple/adapter.d.ts","../node_modules/@material/ripple/foundation.d.ts","../node_modules/@material/mwc-ripple/mwc-ripple-base.d.ts","../node_modules/@material/mwc-ripple/mwc-ripple.d.ts","../node_modules/@material/mwc-base/aria-property.d.ts","../node_modules/@material/mwc-ripple/ripple-handlers.d.ts","../node_modules/@material/mwc-button/mwc-button-base.d.ts","../node_modules/@material/mwc-button/mwc-button.d.ts","../src/usf-file-upload.ts","../src/usf-icon.ts","../node_modules/blocking-elements/dist/blocking-elements.d.ts","../node_modules/@material/dialog/adapter.d.ts","../node_modules/@material/dialog/types.d.ts","../node_modules/@material/dialog/foundation.d.ts","../node_modules/@material/mwc-dialog/mwc-dialog-base.d.ts","../node_modules/@material/mwc-dialog/mwc-dialog.d.ts","../node_modules/@material/form-field/adapter.d.ts","../node_modules/@material/form-field/foundation.d.ts","../node_modules/@material/mwc-formfield/mwc-formfield-base.d.ts","../node_modules/@material/mwc-formfield/mwc-formfield.d.ts","../node_modules/@material/mwc-base/form-element.d.ts","../node_modules/@material/mwc-radio/single-selection-controller.d.ts","../node_modules/@material/radio/adapter.d.ts","../node_modules/@material/radio/foundation.d.ts","../node_modules/@material/mwc-radio/mwc-radio-base.d.ts","../node_modules/@material/mwc-radio/mwc-radio.d.ts","../node_modules/@material/mwc-circular-progress/mwc-circular-progress-base.d.ts","../node_modules/@material/mwc-circular-progress/mwc-circular-progress.d.ts","../src/firmware-selector.ts","../node_modules/@material/mwc-icon-button/mwc-icon-button-base.d.ts","../node_modules/@material/mwc-icon-button/mwc-icon-button.d.ts","../node_modules/@material/linear-progress/types.d.ts","../node_modules/@material/mwc-linear-progress/mwc-linear-progress-base.d.ts","../node_modules/@material/mwc-linear-progress/mwc-linear-progress.d.ts","../node_modules/@material/mwc-icon-button/mwc-icon-button.css.d.ts","../src/usf-icon-button.ts","../src/utils.ts","../src/flashing-dialog.ts","../src/global.d.ts","../src/nabucasa-zigbee-flasher.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/accepts/index.d.ts","../node_modules/@types/connect/index.d.ts","../node_modules/@types/body-parser/index.d.ts","../node_modules/@types/command-line-args/index.d.ts","../node_modules/@types/content-disposition/index.d.ts","../node_modules/@types/keygrip/index.d.ts","../node_modules/@types/range-parser/index.d.ts","../node_modules/@types/qs/index.d.ts","../node_modules/@types/express-serve-static-core/index.d.ts","../node_modules/@types/mime/Mime.d.ts","../node_modules/@types/mime/index.d.ts","../node_modules/@types/serve-static/index.d.ts","../node_modules/@types/express/index.d.ts","../node_modules/@types/cookies/index.d.ts","../node_modules/@types/estree/index.d.ts","../node_modules/@types/fs-extra/index.d.ts","../node_modules/@types/minimatch/index.d.ts","../node_modules/@types/glob/index.d.ts","../node_modules/@types/http-assert/index.d.ts","../node_modules/@types/http-errors/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/koa-compose/index.d.ts","../node_modules/@types/koa/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/parse5/lib/tree-adapters/default.d.ts","../node_modules/@types/parse5/index.d.ts","../node_modules/@types/resolve/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts","../node_modules/@types/w3c-web-serial/index.d.ts","../node_modules/@types/ws/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"f1c9fe42b65437a61104e601eb298c5c859fb522b483f1bdb700eed67a16f980","9c48425271c401960941c04def5896dcc068b46de1614c626fde75cd99368601",{"version":"9d033d52c44e5762c2690e995e24c76d4ae27fbf23296e8a22370205db67b9c9","signature":"708c26b2e554e0a3f501c46c9844715ede3dd4eb04328eda65888b3a85e2e178"},"52dd370c807255c61765347fc90a9bee3c522b8744dc222714e2bf6b5be3a823","1e5743b25a63fd34ffbae89adcbf248ee17db6ed08d90079ffa93803c3e80d2a","3cbcdf2a84c93c6b62d8d4584f613c8af7c6330ac2ba1ff781d10a3e0935beb9","2fcd2d22b1f30555e785105597cd8f57ed50300e213c4f1bbca6ae149f782c38",{"version":"bb4248c7f953233ac52332088fac897d62b82be07244e551d87c5049600b6cf7","affectsGlobalScope":true},"3f30c6b57bf5eb7a7d4298506b78b18d428a39a409e1eadd93a3fdd0299d2687","62da965db3bd1b4ce135048ae8a317d7eb1949068824cb949dd4a91f7e3d6c2d","eba7cf33380cc3a3cf614faf67300e14d0bdff9ea6c5cd6f4b040b1756a48ab1","5e7e090243bf203382a5cb04eabbdc38d78f6d5922f16f543e4da8fa007d5ff9","cd823094ded7c8ac4f94ab6dc387dab699293eb8323d9f948304efc07e4ae7b2","241000969e5367a9a9b9a4f57963e54e5a012c9d89c273526c0115650a7b9e5f","ac388c7c7a262213a3700451bc921e382a93fb27c0252c34ccf03540b4ce044b","097a7e3badfd1c4b35f72aa0f722f5714a4f6a84e53fca5a79dcfebbfc5e718d","fb0107c83e2e0e75b77dacd0c3c6c3ab6844e98dce2a8f858c6f0a57c12136a6","0a478dcb6e6bd8a5d871165659c79cee7b8c3b7a87289118d22e1a04d171e252","e385eb01000d045ea07cea09c488f66e051709a9ac460bf271623f9984e0c419","bf69beba89702c85d84546269e0d4e8b128d32e26b314ee9b501b0b32c82490b","46f3a421b048670d16a3c02589261f17c1cea687f2602eed31e1335b53aed785","4bcb813ea56182beaaab1e8274524eb9f1449b0d8e79efc4a0399de09e43f816","c784eab1cf838d9d6527bce3d9f2d373145606666b68f7610291a7adf6e6bda9","f0380f581cb015778c0fe51e95b5b7f6dae237280654558469b2486c1572268a","147cb5b590b77c8c58e4ef0af1ff11ee90ee2b34262816df0665b6ff8fd50aad","6e0575b628aedce5db38c17569e5c909beead07f9052fe7944fb8bfccc3db92e",{"version":"3a12d45f75b5e0c9ed3ea842be6bd5ee4ee2e99f7d5ad475e135d63c919b7347","signature":"84b25c6015d3d6194faffef9151aa38461a9c0b18f9abb45f8cf2303f07a5f92"},{"version":"27b285e901600242883d62a5fff9f5d262c6fa128b6e6c6963f981f2630a957e","affectsGlobalScope":true},"a0667520a6521c12128fc28cbd5b2af58eef11c5b2a7441e0f0d47f50bf6c8e3","0dcf4c2bf1bb547e2ae5b8dce4656a56fbd15e3401ff5236ea0b93b6c60f9249","820c26194ad4089bc503b02bbedbd86a865e9c8a05c58ef88c8d19d9c019712a","790b453e1b76814112c3870d6e12f5db992d3194fdb3529445317dd75cb538be","d375de88ab19f6c105a65fc89eca1ae782362c5c395283b0c85ef39c7b835dfe","aeda2fffbc651fe1fa60b913d45f291f5544c4840206cb3b1badc16d9f01a0f0","7b3c1d688dcb8645b5a6c37bce5b047da92b4c298ed8709e03e987e0efb035b1","29c64e1acb5b73f08a60e71154c65c8a34f885f1f2cc55ffa06dfd244c058883",{"version":"7d176f155e5f6fc9756ddcc1a6d3eb2673030a066e2b7846dfc81b5271f3e269","affectsGlobalScope":true},"024fea9ee598cfe747f18340ad74e4ea428fc2a7988250ff9fcfce5673b7d422","aea18a267a0770c365cc390ad0a0b9725ed7a4540e9a96319b0f5094ee0ca124","ae1351ed65b27a2b29a70a238024c957910e944aabbffce286099ed2b04f9baf",{"version":"3c19b3fb2f88bbd8f103fe2de0d6c0700dd9bf6678553f6db803162620b49e27","affectsGlobalScope":true},{"version":"34c84ce03cadc99e0ff028ac26224867f81b7c4a27e77004e73e2748a3e66633","signature":"b16ec9b05433cfbc31eaf2cf5bc5d1d2e307e53004dff3f2bd5456c8c7a61362","affectsGlobalScope":true},{"version":"fd9710660c3ebd7675ee9a878e213c970b9ab090d930761edad3c8eaa5fd94d3","signature":"9583871ebaf4b9b808e61d5f489f378144de42b95d1c69879bc903028dbd7e6f","affectsGlobalScope":true},"cb15b66bd994780a057a76999dd679cf9b231dd68b70d97db959b93d7caa3ee6","de08ddc1a9a278c2305bf224d7bff713e56e0b6a4035f937a8563a0aeed66b8a","0a0da6558db6161302f736d9a749f5553446861ecab733a4169d4ab2d1661e51","f23086edf5e741ece7f6224ef0f9e794303c6e4f9768a34eab79aa37a1a9d8cd","24b5be6a676756dab834cd31d673fb0c6292aa782304924b7ffcd727c48a4ac5",{"version":"fe673305b28e0bc515fd59bef58222cdac20388166a5d8f774369e6c11d5970c","affectsGlobalScope":true},"e59d273f3ce9e33fcae9ae358471210bf065b56d7f5eac8b05a82a97fc99dd36","f65ee1c1db33053d998edb8192a3f8a79e630170a7d6d3f99ca0988a9d8ce6c9","1f6050ac852a6550d50d7801eb7168aed5c18593bc0fa6803a23dc26350b781a",{"version":"f678e8443ae79cfbce41a2f488cdf721317b3bf22b8a1662cf5c541d89e2691f","affectsGlobalScope":true},{"version":"301b1a33102a2bf93e997834ff2f76a6766014572bfc3210310549225fbb023b","affectsGlobalScope":true},"c209c5e1249ee078118fcbd347a21122d12c7c9d0b19958e9c45a220871ac918","f6710f28ae1895d185d52254096212c67c286d107e123bc7feb0891ec2cccbf6","c4626a09a7c48781fb8e59b1af6c9868908dbbe981dd6eeadba3c9399e451aba","fda46b787ce32fcf604907ed6e046bddcc3baf99ab4fca320f6bb2ea8185f8ec",{"version":"42d49d483b14fd4b3c91b03d2f6312496e0726c52055991d03bcc981184ff79d","affectsGlobalScope":true},"376854482e6ad2c68d3151477cce7ef1ab28d212926e651ac02943b96608b2ef",{"version":"63cf0ae8f41c0d9f45aada64d58263e1a6b85ed2b44ccb6d247303a831064624","affectsGlobalScope":true},{"version":"b24529c5b7a27a640c61600de5727769e1ac19cf632d60f376a20f577dbfa4f3","signature":"2f0aa02d72522156025ef232e0e4f716c669bc0c1432de404d06e53c4122e807","affectsGlobalScope":true},"a5a7c7d197c7b1918bddb0dd30bf8979a38828b24467ec45db093bf4621507ef",{"version":"afcd875785333f656f79bf1b3a445ceecc6aaf8e2b7cde59309a8778f41de613","affectsGlobalScope":true},"75b569a919311369d3bfbff7bcaec663454b2124c270312ec4020906020cf6f6","e1169c37e35096ddc72e09ce6b1dba0fdfa99562e24f9415fe7b31664379392f",{"version":"30477925776c3f5e2234372601144fa3df541c755aa573249759158f0497952b","affectsGlobalScope":true},"d6c0b824e25ca3bdd752c8baa81a8c5c2da034ffaa54ad60fb5cb2bea6e2bcec",{"version":"05a5c0fff180a9b7c55bcae6a5f96a5872b23c7c4335512ab03460db27b8b985","signature":"df427933b781bb638e98a58631a96e082401d9e8354b51c83ba99001f4064f53","affectsGlobalScope":true},{"version":"002e3f49045882719edff5b59e8214a17942b3878869836950b946a8406752ef","signature":"d8db3925f064f0be9f55fa7dc80f00197ee638a59d77a333fff7dbdc55e4c923"},{"version":"4e1ec1a3ae4a6676fcd83f205030af254849b1975eebbc3a991f55e83b3e86e7","signature":"df8c5ecb0462a1746af9f1351429786ea4a5c1ab1b1d858b2c5fdb2864060a25","affectsGlobalScope":true},"87b0304ccebc2dedfcbbb2b346b3e880bf8b57f9b32e8791d47795afe9bc12fd",{"version":"6243a349b72fd60db297d8b2009cefe20af9977730cfbc293126f66a8baaeadf","signature":"db4c419678dd41bef130fb42beeb4edafeff754ed1d6994e60e4e41cd5d8a680","affectsGlobalScope":true},"7e771891adaa85b690266bc37bd6eb43bc57eecc4b54693ead36467e7369952a","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"ca72190df0eb9b09d4b600821c8c7b6c9747b75a1c700c4d57dc0bb72abc074c","affectsGlobalScope":true},"21a167fec8f933752fb8157f06d28fab6817af3ad9b0bdb1908a10762391eab9",{"version":"bb65c6267c5d6676be61acbf6604cf0a4555ac4b505df58ac15c831fcbff4e3e","affectsGlobalScope":true},"374ca798f244e464346f14301dc2a8b4b111af1a83b49fffef5906c338a1f922","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","dab86d9604fe40854ef3c0a6f9e8948873dc3509213418e5e457f410fd11200f","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","489532ff54b714f0e0939947a1c560e516d3ae93d51d639ab02e907a0e950114","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"816ad2e607a96de5bcac7d437f843f5afd8957f1fa5eefa6bba8e4ed7ca8fd84","affectsGlobalScope":true},"cec36af22f514322f870e81d30675c78df82ae8bf4863f5fd4e4424c040c678d","d903fafe96674bc0b2ac38a5be4a8fc07b14c2548d1cdb165a80ea24c44c0c54","5eec82ac21f84d83586c59a16b9b8502d34505d1393393556682fe7e7fde9ef2","04eb6578a588d6a46f50299b55f30e3a04ef27d0c5a46c57d8fcc211cd530faa","8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e630e5528e899219ae319e83bef54bf3bcb91b01d76861ecf881e8e614b167f0","affectsGlobalScope":true},"d076fede3cb042e7b13fc29442aaa03a57806bc51e2b26a67a01fbc66a7c0c12","7c013aa892414a7fdcfd861ae524a668eaa3ede8c7c0acafaf611948122c8d93","b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30",{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true},{"version":"b3624aed92dab6da8484280d3cb3e2f4130ec3f4ef3f8201c95144ae9e898bb6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","fd93cee2621ff42dabe57b7be402783fd1aa69ece755bcba1e0290547ae60513","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","223c37f62ce09a3d99e77498acdee7b2705a4ae14552fbdb4093600cd9164f3f",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","4c8525f256873c7ba3135338c647eaf0ca7115a1a2805ae2d0056629461186ce","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"f0900cd5d00fe1263ff41201fb8073dbeb984397e4af3b8002a5c207a30bdc33","affectsGlobalScope":true},{"version":"4c50342e1b65d3bee2ed4ab18f84842d5724ad11083bd666d8705dc7a6079d80","affectsGlobalScope":true},"06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","ec4bd1b200670fb567920db572d6701ed42a9641d09c4ff6869768c8f81b404c","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa",{"version":"da26af7362f53d122283bc69fed862b9a9fe27e01bc6a69d1d682e0e5a4df3e6","affectsGlobalScope":true},"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"8dbe725f8d237e70310977afcfa011629804d101ebaa0266cafda6b61ad72236","6738101ae8e56cd3879ab3f99630ada7d78097fc9fd334df7e766216778ca219","6d829824ead8999f87b6df21200df3c6150391b894b4e80662caa462bd48d073","afc559c1b93df37c25aef6b3dfa2d64325b0e112e887ee18bf7e6f4ec383fc90","629766229f541d92210f30a92b6038568ec165fab14b7ee53bdf13667da37ca3","204dbe6c72467fb14bbe8f06510b11fb541b6ce29580c6e10ebd3bdb2eb0c1f9","ce013414484233b24f42c0fcfca48a60bb66ab4e13c82953662305e8f1ee4925","16d51f964ec125ad2024cf03f0af444b3bc3ec3614d9345cc54d09bab45c9a4c","ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc",{"version":"c5dd1fef4cd4aaffc78786047bed5ae6fc1200d19a1946cbc4e2d3ed4d62c8fa","affectsGlobalScope":true},"5b9ecf7da4d71cf3832dbb8336150fa924631811f488ad4690c2dfec2b4fb1d7","951c85f75aac041dddbedfedf565886a7b494e29ec1532e2a9b4a6180560b50e","f47887b61c6cf2f48746980390d6cb5b8013518951d912cfb37fe748071942be","43cdd474c5aa3340da4816bb8f1ae7f3b1bcf9e70d997afc36a0f2c432378c84","eb96a2321f717bccc3e49e104e299152984b927ea4546b559ae631c06565819c","89ccbe04e737ce613f5f04990271cfa84901446350b8551b0555ddf19319723b","6de408de17cb0e3fa3a5e3d0f79bd104848d98dbfa72e92fddfa1a4aa3d8393c","963d59066dd6742da1918a6213a209bcc205b8ee53b1876ee2b4e6d80f97c85e","fd326577c62145816fe1acc306c734c2396487f76719d3785d4e825b34540b33","e98185f4249720ace1921d59c1ff4612fa5c633a183fc9bf28e2e7b8e3c7fd51","f463d61cf39c3a6a5f96cdf7adfdb72a0b1d663f7b5d5b6dd042adba835430c2","f3e604694b624fa3f83f6684185452992088f5efb2cf136b62474aa106d6f1b6","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","5006668996956580886022c05108e32c742823e1b5652aff7914917233731518","3a9b877f47119ac64aab98c61cae91a304ddeb6e8285ccd824a6aa665ffaeb95","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","fc37aca06f6b8b296c42412a2e75ab53d30cd1fa8a340a3bb328a723fd678377","5f2c582b9ef260cb9559a64221b38606378c1fabe17694592cdfe5975a6d7efa","8a19491eba2108d5c333c249699f40aff05ad312c04a17504573b27d91f0aede","2b93035328f7778d200252681c1d86285d501ed424825a18f81e4c3028aa51d9","2ac9c8332c5f8510b8bdd571f8271e0f39b0577714d5e95c1e79a12b2616f069","42c21aa963e7b86fa00801d96e88b36803188018d5ad91db2a9101bccd40b3ff","d31eb848cdebb4c55b4893b335a7c0cca95ad66dee13cbb7d0893810c0a9c301","77c1d91a129ba60b8c405f9f539e42df834afb174fe0785f89d92a2c7c16b77a","7a9e0a564fee396cacf706523b5aeed96e04c6b871a8bebefad78499fbffc5bc","906c751ef5822ec0dadcea2f0e9db64a33fb4ee926cc9f7efa38afe5d5371b2a","5387c049e9702f2d2d7ece1a74836a14b47fbebe9bbeb19f94c580a37c855351","c68391fb9efad5d99ff332c65b1606248c4e4a9f1dd9a087204242b56c7126d6","e9cf02252d3a0ced987d24845dcb1f11c1be5541f17e5daa44c6de2d18138d0c","e8b02b879754d85f48489294f99147aeccc352c760d95a6fe2b6e49cd400b2fe","9f6908ab3d8a86c68b86e38578afc7095114e66b2fc36a2a96e9252aac3998e0","0eedb2344442b143ddcd788f87096961cd8572b64f10b4afc3356aa0460171c6","71405cc70f183d029cc5018375f6c35117ffdaf11846c35ebf85ee3956b1b2a6","c68baff4d8ba346130e9753cefe2e487a16731bf17e05fdacc81e8c9a26aae9d","2cd15528d8bb5d0453aa339b4b52e0696e8b07e790c153831c642c3dea5ac8af","479d622e66283ffa9883fbc33e441f7fc928b2277ff30aacbec7b7761b4e9579","ade307876dc5ca267ca308d09e737b611505e015c535863f22420a11fffc1c54","f8cdefa3e0dee639eccbe9794b46f90291e5fd3989fcba60d2f08fde56179fb9","86c5a62f99aac7053976e317dbe9acb2eaf903aaf3d2e5bb1cafe5c2df7b37a8","2b300954ce01a8343866f737656e13243e86e5baef51bd0631b21dcef1f6e954","a2d409a9ffd872d6b9d78ead00baa116bbc73cfa959fce9a2f29d3227876b2a1","b288936f560cd71f4a6002953290de9ff8dfbfbf37f5a9391be5c83322324898","61178a781ef82e0ff54f9430397e71e8f365fc1e3725e0e5346f2de7b0d50dfa","6a6ccb37feb3aad32d9be026a3337db195979cd5727a616fc0f557e974101a54","c649ea79205c029a02272ef55b7ab14ada0903db26144d2205021f24727ac7a3","38e2b02897c6357bbcff729ef84c736727b45cc152abe95a7567caccdfad2a1d","d6610ea7e0b1a7686dba062a1e5544dd7d34140f4545305b7c6afaebfb348341","3dee35db743bdba2c8d19aece7ac049bde6fa587e195d86547c882784e6ba34c","b15e55c5fa977c2f25ca0b1db52cfa2d1fd4bf0baf90a8b90d4a7678ca462ff1","f41d30972724714763a2698ae949fbc463afb203b5fa7c4ad7e4de0871129a17","843dd7b6a7c6269fd43827303f5cbe65c1fecabc30b4670a50d5a15d57daeeb9","f06d8b8567ee9fd799bf7f806efe93b67683ef24f4dea5b23ef12edff4434d9d","6017384f697ff38bc3ef6a546df5b230c3c31329db84cbfe686c83bec011e2b2","e1a5b30d9248549ca0c0bb1d653bafae20c64c4aa5928cc4cd3017b55c2177b0","a593632d5878f17295bd53e1c77f27bf4c15212822f764a2bfc1702f4b413fa0","a868a534ba1c2ca9060b8a13b0ffbbbf78b4be7b0ff80d8c75b02773f7192c29","da7545aba8f54a50fde23e2ede00158dc8112560d934cee58098dfb03aae9b9d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","6aee496bf0ecfbf6731aa8cca32f4b6e92cdc0a444911a7d88410408a45ecc5d",{"version":"bb57936750f9fd7122012b820c6dab7eed1bb097acd52238f973f0be2cc75eef","affectsGlobalScope":true},"bc81aff061c53a7140270555f4b22da4ecfe8601e8027cf5aa175fbdc7927c31"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":false,"experimentalDecorators":true,"importHelpers":true,"module":6,"noEmitOnError":true,"outDir":"./","strict":true,"target":6},"fileIdsList":[[162],[48,162],[56,162],[48,56,162],[48,56,64,162],[46,47,162],[73,162],[71,87,88,162],[71,92,162],[55,71,72,73,162],[72,74,162],[55,68,70,79,80,81,162],[55,82,162],[55,162],[55,102,162],[52,74,86,87,88,89,162],[55,90,162],[52,74,92,93,162],[55,94,162],[55,79,80,81,162],[55,105,162],[55,107,162],[55,108,162],[55,79,81,96,97,98,99,162],[55,97,100,162],[55,72,74,76,77,162],[55,78,162],[72,162],[71,98,162],[73,75,162],[71,76,162],[135,162,169],[135,162,169,171],[135,162,169,171,175,182],[132,135,162,169,176,177],[162,172,177,178,181],[133,162,169],[132,133,162,169,186],[162,193],[132,135,136,140,146,161,162,169,170,174,175,183,188,189,192],[162,180],[162,179],[116,162],[119,162],[120,125,153,162],[121,132,133,140,150,161,162],[121,122,132,140,162],[123,162],[124,125,133,141,162],[125,150,158,162],[126,128,132,140,162],[127,162],[128,129,162],[132,162],[130,132,162],[132,133,134,150,161,162],[132,133,134,147,150,153,162],[162,166],[128,135,140,150,161,162],[132,133,135,136,140,150,158,161,162],[135,137,150,158,161,162],[116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168],[132,138,162],[139,161,162],[128,132,140,150,162],[141,162],[142,162],[119,143,162],[144,160,162,166],[145,162],[146,162],[132,147,148,162],[147,149,162,164],[120,132,150,151,152,153,162],[120,150,152,162],[150,151,162],[153,162],[154,162],[132,156,157,162],[156,157,162],[125,140,150,158,162],[159,162],[140,160,162],[120,135,146,161,162],[125,162],[150,162,163],[162,164],[162,165],[120,125,132,134,143,150,161,162,164,166],[150,162,167],[162,195],[162,196],[162,169],[162,198,237],[162,198,222,237],[162,237],[162,198],[162,198,223,237],[162,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236],[162,223,237],[135,162,169,180],[49,162],[132,135,137,140,150,158,161,162,167,169],[48,52,162],[52,162],[51,52,162],[50,51,162],[57,58,59,60,61,62,63,64,65,162],[67,162],[48,52,53,54,162],[43,44,162],[43,44,45,55,66,68,69,83,84,85,91,95,101,103,162],[43,44,45,55,66,69,83,84,85,91,95,101,103,104,106,109,111,112,162],[43,45,55,66,83,113,162],[43,114,162],[43,55,66,83,162],[43,66,105,110,162],[43,55,66,162],[43,162],[45,52,55,69,83,84,85,91,95,101,103],[45,52,55,69,83,84,85,91,95,101,103,104,106,109,111],[52,55,83],[55,105],[52,55]],"referencedMap":[[46,1],[56,2],[57,3],[60,4],[58,4],[62,4],[65,5],[64,1],[63,4],[61,4],[59,3],[47,1],[48,6],[71,1],[73,1],[87,7],[89,8],[88,1],[92,7],[93,9],[107,1],[80,1],[74,10],[96,11],[72,1],[82,12],[83,13],[102,14],[103,15],[90,16],[91,17],[94,18],[95,19],[105,20],[110,14],[106,21],[70,14],[108,22],[109,23],[100,24],[101,25],[97,1],[78,26],[79,27],[81,28],[98,1],[99,29],[76,30],[77,31],[75,1],[44,1],[170,32],[172,33],[173,1],[171,32],[174,1],[183,34],[184,1],[178,35],[182,36],[185,37],[187,38],[188,1],[189,1],[190,1],[191,1],[175,1],[192,39],[193,40],[179,41],[180,42],[186,1],[116,43],[117,43],[119,44],[120,45],[121,46],[122,47],[123,48],[124,49],[125,50],[126,51],[127,52],[128,53],[129,53],[131,54],[130,55],[132,54],[133,56],[134,57],[118,58],[168,1],[135,59],[136,60],[137,61],[169,62],[138,63],[139,64],[140,65],[141,66],[142,67],[143,68],[144,69],[145,70],[146,71],[147,72],[148,72],[149,73],[150,74],[152,75],[151,76],[153,77],[154,78],[155,1],[156,79],[157,80],[158,81],[159,82],[160,83],[161,84],[162,85],[163,86],[164,87],[165,88],[166,89],[167,90],[194,1],[196,91],[195,92],[177,1],[176,1],[197,93],[222,94],[223,95],[198,96],[201,96],[220,94],[221,94],[211,94],[210,97],[208,94],[203,94],[216,94],[214,94],[218,94],[202,94],[215,94],[219,94],[204,94],[205,94],[217,94],[199,94],[206,94],[207,94],[209,94],[213,94],[224,98],[212,94],[200,94],[237,99],[236,1],[231,98],[233,100],[232,98],[225,98],[226,98],[228,98],[230,98],[234,100],[235,100],[227,100],[229,100],[181,101],[50,102],[49,1],[238,1],[239,103],[86,1],[53,104],[51,105],[67,106],[54,1],[52,107],[66,108],[68,109],[55,110],[43,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[45,111],[104,112],[113,113],[114,1],[115,114],[69,115],[84,116],[111,117],[85,118],[112,119]],"exportedModulesMap":[[46,1],[56,2],[57,3],[60,4],[58,4],[62,4],[65,5],[64,1],[63,4],[61,4],[59,3],[47,1],[48,6],[71,1],[73,1],[87,7],[89,8],[88,1],[92,7],[93,9],[107,1],[80,1],[74,10],[96,11],[72,1],[82,12],[83,13],[102,14],[103,15],[90,16],[91,17],[94,18],[95,19],[105,20],[110,14],[106,21],[70,14],[108,22],[109,23],[100,24],[101,25],[97,1],[78,26],[79,27],[81,28],[98,1],[99,29],[76,30],[77,31],[75,1],[44,1],[170,32],[172,33],[173,1],[171,32],[174,1],[183,34],[184,1],[178,35],[182,36],[185,37],[187,38],[188,1],[189,1],[190,1],[191,1],[175,1],[192,39],[193,40],[179,41],[180,42],[186,1],[116,43],[117,43],[119,44],[120,45],[121,46],[122,47],[123,48],[124,49],[125,50],[126,51],[127,52],[128,53],[129,53],[131,54],[130,55],[132,54],[133,56],[134,57],[118,58],[168,1],[135,59],[136,60],[137,61],[169,62],[138,63],[139,64],[140,65],[141,66],[142,67],[143,68],[144,69],[145,70],[146,71],[147,72],[148,72],[149,73],[150,74],[152,75],[151,76],[153,77],[154,78],[155,1],[156,79],[157,80],[158,81],[159,82],[160,83],[161,84],[162,85],[163,86],[164,87],[165,88],[166,89],[167,90],[194,1],[196,91],[195,92],[177,1],[176,1],[197,93],[222,94],[223,95],[198,96],[201,96],[220,94],[221,94],[211,94],[210,97],[208,94],[203,94],[216,94],[214,94],[218,94],[202,94],[215,94],[219,94],[204,94],[205,94],[217,94],[199,94],[206,94],[207,94],[209,94],[213,94],[224,98],[212,94],[200,94],[237,99],[236,1],[231,98],[233,100],[232,98],[225,98],[226,98],[228,98],[230,98],[234,100],[235,100],[227,100],[229,100],[181,101],[50,102],[49,1],[238,1],[239,103],[86,1],[53,104],[51,105],[67,106],[54,1],[52,107],[66,108],[68,109],[55,110],[43,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[33,1],[30,1],[31,1],[32,1],[34,1],[7,1],[35,1],[40,1],[41,1],[36,1],[37,1],[38,1],[39,1],[1,1],[42,1],[104,120],[113,121],[114,1],[115,122],[84,122],[111,123],[85,124]],"semanticDiagnosticsPerFile":[46,56,57,60,58,62,65,64,63,61,59,47,48,71,73,87,89,88,92,93,107,80,74,96,72,82,83,102,103,90,91,94,95,105,110,106,70,108,109,100,101,97,78,79,81,98,99,76,77,75,44,170,172,173,171,174,183,184,178,182,185,187,188,189,190,191,175,192,193,179,180,186,116,117,119,120,121,122,123,124,125,126,127,128,129,131,130,132,133,134,118,168,135,136,137,169,138,139,140,141,142,143,144,145,146,147,148,149,150,152,151,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,194,196,195,177,176,197,222,223,198,201,220,221,211,210,208,203,216,214,218,202,215,219,204,205,217,199,206,207,209,213,224,212,200,237,236,231,233,232,225,226,228,230,234,235,227,229,181,50,49,238,239,86,53,51,67,54,52,66,68,55,43,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,33,30,31,32,34,7,35,40,41,36,37,38,39,1,42,45,104,113,114,115,69,84,111,85,112]},"version":"4.9.5"} \ No newline at end of file diff --git a/dist/usf-file-upload.d.ts b/dist/usf-file-upload.d.ts new file mode 100644 index 00000000..cfad9e5a --- /dev/null +++ b/dist/usf-file-upload.d.ts @@ -0,0 +1,17 @@ +import { LitElement } from 'lit'; +import '@material/mwc-button'; +export declare class FileUpload extends LitElement { + static styles: import("lit").CSSResult; + fileChanged(e: Event): void; + buttonClicked(): void; + private fileInput; + disabled: boolean; + accept?: string; + get files(): FileList | null; + render(): import("lit-html").TemplateResult<1>; +} +declare global { + interface HTMLElementTagNameMap { + 'usf-file-upload': FileUpload; + } +} diff --git a/dist/usf-file-upload.js b/dist/usf-file-upload.js new file mode 100644 index 00000000..b0c5ca27 --- /dev/null +++ b/dist/usf-file-upload.js @@ -0,0 +1,68 @@ +import { __decorate } from "tslib"; +import { LitElement, html, css } from 'lit'; +import { customElement, query, property } from 'lit/decorators.js'; +import '@material/mwc-button'; +let FileUpload = class FileUpload extends LitElement { + constructor() { + super(...arguments); + this.disabled = false; + } + fileChanged(e) { + this.requestUpdate(); + this.dispatchEvent(new Event(e.type, e)); + } + buttonClicked() { + this.fileInput.click(); + } + get files() { + if (!this.fileInput) { + return null; + } + return this.fileInput.files; + } + render() { + return html ` + + + + + + + ${this.files + ? html `${this.files.length > 0 + ? this.files[0].name + : 'No file selected'}` + : ''} + `; + } +}; +FileUpload.styles = css ` + mwc-button { + vertical-align: middle; + } + `; +__decorate([ + query('#file') +], FileUpload.prototype, "fileInput", void 0); +__decorate([ + property({ type: Boolean }) +], FileUpload.prototype, "disabled", void 0); +__decorate([ + property() +], FileUpload.prototype, "accept", void 0); +FileUpload = __decorate([ + customElement('usf-file-upload') +], FileUpload); +export { FileUpload }; diff --git a/dist/usf-icon-button.d.ts b/dist/usf-icon-button.d.ts new file mode 100644 index 00000000..72fd6fa0 --- /dev/null +++ b/dist/usf-icon-button.d.ts @@ -0,0 +1,9 @@ +import { IconButtonBase } from '@material/mwc-icon-button/mwc-icon-button-base'; +export declare class UsfIconButton extends IconButtonBase { + static styles: import("lit").CSSResult[]; +} +declare global { + interface HTMLElementTagNameMap { + 'usf-icon-button': UsfIconButton; + } +} diff --git a/dist/usf-icon-button.js b/dist/usf-icon-button.js new file mode 100644 index 00000000..2482db89 --- /dev/null +++ b/dist/usf-icon-button.js @@ -0,0 +1,11 @@ +import { __decorate } from "tslib"; +import { customElement } from 'lit/decorators.js'; +import { IconButtonBase } from '@material/mwc-icon-button/mwc-icon-button-base'; +import { styles } from '@material/mwc-icon-button/mwc-icon-button.css'; +let UsfIconButton = class UsfIconButton extends IconButtonBase { +}; +UsfIconButton.styles = [styles]; +UsfIconButton = __decorate([ + customElement('usf-icon-button') +], UsfIconButton); +export { UsfIconButton }; diff --git a/dist/usf-icon.d.ts b/dist/usf-icon.d.ts new file mode 100644 index 00000000..69c4ae9b --- /dev/null +++ b/dist/usf-icon.d.ts @@ -0,0 +1,11 @@ +import { LitElement } from 'lit'; +export declare class UsfIcon extends LitElement { + icon: string; + render(): import("lit-html").TemplateResult<1>; + static styles: import("lit").CSSResult; +} +declare global { + interface HTMLElementTagNameMap { + 'usf-icon': UsfIcon; + } +} diff --git a/dist/usf-icon.js b/dist/usf-icon.js new file mode 100644 index 00000000..5af27e2c --- /dev/null +++ b/dist/usf-icon.js @@ -0,0 +1,40 @@ +import { __decorate } from "tslib"; +import { LitElement, html, css } from 'lit'; +import { customElement, property } from 'lit/decorators.js'; +let UsfIcon = class UsfIcon extends LitElement { + render() { + return html ` + + `; + } +}; +UsfIcon.styles = css ` + :host, + svg { + display: inline-block; + width: 24px; + height: 24px; + } + + svg { + vertical-align: baseline; + } + `; +__decorate([ + property() +], UsfIcon.prototype, "icon", void 0); +UsfIcon = __decorate([ + customElement('usf-icon') +], UsfIcon); +export { UsfIcon }; diff --git a/dist/utils.d.ts b/dist/utils.d.ts new file mode 100644 index 00000000..4f6084bd --- /dev/null +++ b/dist/utils.d.ts @@ -0,0 +1 @@ +export declare function downloadFile(href: string, filename?: string): void; diff --git a/dist/utils.js b/dist/utils.js new file mode 100644 index 00000000..e69e375a --- /dev/null +++ b/dist/utils.js @@ -0,0 +1,9 @@ +export function downloadFile(href, filename = '') { + const a = document.createElement('a'); + a.target = '_blank'; + a.href = href; + a.download = filename; + document.body.appendChild(a); + a.dispatchEvent(new MouseEvent('click')); + document.body.removeChild(a); +} diff --git a/dist/web/flashing-dialog-12652b5a.js b/dist/web/flashing-dialog-12652b5a.js new file mode 100644 index 00000000..7dcbcf5a --- /dev/null +++ b/dist/web/flashing-dialog-12652b5a.js @@ -0,0 +1,524 @@ +import{l as e,o as t,_ as i,e as r,a as o,i as n,b as a,t as s,c as d,s as c,R as l,y as m,d as p,f as u,g as h,h as g,j as f,k as _,m as b,M as y,B as v,n as w,p as x,q as E}from"./nabucasa-zigbee-flasher.js";class k extends c{constructor(){super(...arguments),this.disabled=!1,this.icon="",this.shouldRenderRipple=!1,this.rippleHandlers=new l((()=>(this.shouldRenderRipple=!0,this.ripple)))}renderRipple(){return this.shouldRenderRipple?m` + + `:""}focus(){const e=this.buttonElement;e&&(this.rippleHandlers.startFocus(),e.focus())}blur(){const e=this.buttonElement;e&&(this.rippleHandlers.endFocus(),e.blur())}render(){return m``}handleRippleMouseDown(e){const t=()=>{window.removeEventListener("mouseup",t),this.handleRippleDeactivate()};window.addEventListener("mouseup",t),this.rippleHandlers.startPress(e)}handleRippleTouchStart(e){this.rippleHandlers.startPress(e)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}i([r({type:Boolean,reflect:!0})],k.prototype,"disabled",void 0),i([r({type:String})],k.prototype,"icon",void 0),i([o,r({type:String,attribute:"aria-label"})],k.prototype,"ariaLabel",void 0),i([o,r({type:String,attribute:"aria-haspopup"})],k.prototype,"ariaHasPopup",void 0),i([n("button")],k.prototype,"buttonElement",void 0),i([a("mwc-ripple")],k.prototype,"ripple",void 0),i([s()],k.prototype,"shouldRenderRipple",void 0),i([d({passive:!0})],k.prototype,"handleRippleMouseDown",null),i([d({passive:!0})],k.prototype,"handleRippleTouchStart",null);const S=u`.material-icons{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}.mdc-icon-button{font-size:24px;width:48px;height:48px;padding:12px}.mdc-icon-button .mdc-icon-button__focus-ring{display:none}.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{display:block;max-height:48px;max-width:48px}@media screen and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{pointer-events:none;border:2px solid transparent;border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}}@media screen and (forced-colors: active)and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{border-color:CanvasText}}@media screen and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring::after,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring::after{content:"";border:2px solid transparent;border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}}@media screen and (forced-colors: active)and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring::after,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring::after{border-color:CanvasText}}.mdc-icon-button.mdc-icon-button--reduced-size .mdc-icon-button__ripple{width:40px;height:40px;margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-icon-button.mdc-icon-button--reduced-size.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button.mdc-icon-button--reduced-size:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{max-height:40px;max-width:40px}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38))}.mdc-icon-button svg,.mdc-icon-button img{width:24px;height:24px}.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:transparent;fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;z-index:0;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}.mdc-icon-button__link{height:100%;left:0;outline:none;position:absolute;top:0;width:100%}.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:transparent;fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;z-index:0;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}.mdc-icon-button__link{height:100%;left:0;outline:none;position:absolute;top:0;width:100%}:host{display:inline-block;outline:none}:host([disabled]){pointer-events:none}.mdc-icon-button i,.mdc-icon-button svg,.mdc-icon-button img,.mdc-icon-button ::slotted(*){display:block}:host{--mdc-ripple-color: currentcolor;-webkit-tap-highlight-color:transparent}:host,.mdc-icon-button{vertical-align:top}.mdc-icon-button{width:var(--mdc-icon-button-size, 48px);height:var(--mdc-icon-button-size, 48px);padding:calc( (var(--mdc-icon-button-size, 48px) - var(--mdc-icon-size, 24px)) / 2 )}.mdc-icon-button i,.mdc-icon-button svg,.mdc-icon-button img,.mdc-icon-button ::slotted(*){display:block;width:var(--mdc-icon-size, 24px);height:var(--mdc-icon-size, 24px)}`;let L=class extends k{};L.styles=[S],L=i([h("mwc-icon-button")],L);class C extends c{constructor(){super(...arguments),this.indeterminate=!1,this.progress=0,this.buffer=1,this.reverse=!1,this.closed=!1,this.stylePrimaryHalf="",this.stylePrimaryFull="",this.styleSecondaryQuarter="",this.styleSecondaryHalf="",this.styleSecondaryFull="",this.animationReady=!0,this.closedAnimationOff=!1,this.resizeObserver=null}connectedCallback(){super.connectedCallback(),this.rootEl&&this.attachResizeObserver()}render(){const e={"mdc-linear-progress--closed":this.closed,"mdc-linear-progress--closed-animation-off":this.closedAnimationOff,"mdc-linear-progress--indeterminate":this.indeterminate,"mdc-linear-progress--animation-ready":this.animationReady},t={"--mdc-linear-progress-primary-half":this.stylePrimaryHalf,"--mdc-linear-progress-primary-half-neg":""!==this.stylePrimaryHalf?`-${this.stylePrimaryHalf}`:"","--mdc-linear-progress-primary-full":this.stylePrimaryFull,"--mdc-linear-progress-primary-full-neg":""!==this.stylePrimaryFull?`-${this.stylePrimaryFull}`:"","--mdc-linear-progress-secondary-quarter":this.styleSecondaryQuarter,"--mdc-linear-progress-secondary-quarter-neg":""!==this.styleSecondaryQuarter?`-${this.styleSecondaryQuarter}`:"","--mdc-linear-progress-secondary-half":this.styleSecondaryHalf,"--mdc-linear-progress-secondary-half-neg":""!==this.styleSecondaryHalf?`-${this.styleSecondaryHalf}`:"","--mdc-linear-progress-secondary-full":this.styleSecondaryFull,"--mdc-linear-progress-secondary-full-neg":""!==this.styleSecondaryFull?`-${this.styleSecondaryFull}`:""},i={"flex-basis":this.indeterminate?"100%":100*this.buffer+"%"},r={transform:this.indeterminate?"scaleX(1)":`scaleX(${this.progress})`};return m` +
+
+
+
+
+
+
+ +
+
+ +
+
`}update(e){!e.has("closed")||this.closed&&void 0!==e.get("closed")||this.syncClosedState(),super.update(e)}async firstUpdated(e){super.firstUpdated(e),this.attachResizeObserver()}syncClosedState(){this.closedAnimationOff=this.closed}updated(e){!e.has("indeterminate")&&e.has("reverse")&&this.indeterminate&&this.restartAnimation(),e.has("indeterminate")&&void 0!==e.get("indeterminate")&&this.indeterminate&&window.ResizeObserver&&this.calculateAndSetAnimationDimensions(this.rootEl.offsetWidth),super.updated(e)}disconnectedCallback(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),super.disconnectedCallback()}attachResizeObserver(){if(window.ResizeObserver)return this.resizeObserver=new window.ResizeObserver((e=>{if(this.indeterminate)for(const t of e)if(t.contentRect){const e=t.contentRect.width;this.calculateAndSetAnimationDimensions(e)}})),void this.resizeObserver.observe(this.rootEl);this.resizeObserver=null}calculateAndSetAnimationDimensions(e){const t=.8367142*e,i=2.00611057*e,r=.37651913*e,o=.84386165*e,n=1.60277782*e;this.stylePrimaryHalf=`${t}px`,this.stylePrimaryFull=`${i}px`,this.styleSecondaryQuarter=`${r}px`,this.styleSecondaryHalf=`${o}px`,this.styleSecondaryFull=`${n}px`,this.restartAnimation()}async restartAnimation(){this.animationReady=!1,await this.updateComplete,await new Promise(requestAnimationFrame),this.animationReady=!0,await this.updateComplete}open(){this.closed=!1}close(){this.closed=!0}}i([n(".mdc-linear-progress")],C.prototype,"rootEl",void 0),i([r({type:Boolean,reflect:!0})],C.prototype,"indeterminate",void 0),i([r({type:Number})],C.prototype,"progress",void 0),i([r({type:Number})],C.prototype,"buffer",void 0),i([r({type:Boolean,reflect:!0})],C.prototype,"reverse",void 0),i([r({type:Boolean,reflect:!0})],C.prototype,"closed",void 0),i([o,r({attribute:"aria-label"})],C.prototype,"ariaLabel",void 0),i([s()],C.prototype,"stylePrimaryHalf",void 0),i([s()],C.prototype,"stylePrimaryFull",void 0),i([s()],C.prototype,"styleSecondaryQuarter",void 0),i([s()],C.prototype,"styleSecondaryHalf",void 0),i([s()],C.prototype,"styleSecondaryFull",void 0),i([s()],C.prototype,"animationReady",void 0),i([s()],C.prototype,"closedAnimationOff",void 0);const R=u`@keyframes mdc-linear-progress-primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%);transform:translateX(var(--mdc-linear-progress-primary-half, 83.67142%))}100%{transform:translateX(200.611057%);transform:translateX(var(--mdc-linear-progress-primary-full, 200.611057%))}}@keyframes mdc-linear-progress-primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%);transform:translateX(var(--mdc-linear-progress-secondary-quarter, 37.651913%))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%);transform:translateX(var(--mdc-linear-progress-secondary-half, 84.386165%))}100%{transform:translateX(160.277782%);transform:translateX(var(--mdc-linear-progress-secondary-full, 160.277782%))}}@keyframes mdc-linear-progress-secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-buffering{from{transform:rotate(180deg) translateX(-10px)}}@keyframes mdc-linear-progress-primary-indeterminate-translate-reverse{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(-83.67142%);transform:translateX(var(--mdc-linear-progress-primary-half-neg, -83.67142%))}100%{transform:translateX(-200.611057%);transform:translateX(var(--mdc-linear-progress-primary-full-neg, -200.611057%))}}@keyframes mdc-linear-progress-secondary-indeterminate-translate-reverse{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(-37.651913%);transform:translateX(var(--mdc-linear-progress-secondary-quarter-neg, -37.651913%))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(-84.386165%);transform:translateX(var(--mdc-linear-progress-secondary-half-neg, -84.386165%))}100%{transform:translateX(-160.277782%);transform:translateX(var(--mdc-linear-progress-secondary-full-neg, -160.277782%))}}@keyframes mdc-linear-progress-buffering-reverse{from{transform:translateX(-10px)}}.mdc-linear-progress{position:relative;width:100%;transform:translateZ(0);outline:1px solid transparent;overflow:hidden;transition:opacity 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}@media screen and (forced-colors: active){.mdc-linear-progress{outline-color:CanvasText}}.mdc-linear-progress__bar{position:absolute;width:100%;height:100%;animation:none;transform-origin:top left;transition:transform 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-linear-progress__bar-inner{display:inline-block;position:absolute;width:100%;animation:none;border-top-style:solid}.mdc-linear-progress__buffer{display:flex;position:absolute;width:100%;height:100%}.mdc-linear-progress__buffer-dots{background-repeat:repeat-x;flex:auto;transform:rotate(180deg);animation:mdc-linear-progress-buffering 250ms infinite linear}.mdc-linear-progress__buffer-bar{flex:0 1 100%;transition:flex-basis 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-linear-progress__primary-bar{transform:scaleX(0)}.mdc-linear-progress__secondary-bar{display:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__bar{transition:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{left:-145.166611%}.mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{left:-54.888891%;display:block}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation:mdc-linear-progress-primary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-primary-indeterminate-scale 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation:mdc-linear-progress-secondary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-secondary-indeterminate-scale 2s infinite linear}[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__bar{right:0;-webkit-transform-origin:center right;transform-origin:center right}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation-name:mdc-linear-progress-primary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation-name:mdc-linear-progress-secondary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress:not([dir=ltr]) .mdc-linear-progress__buffer-dots,.mdc-linear-progress[dir=rtl]:not([dir=ltr]) .mdc-linear-progress__buffer-dots{animation:mdc-linear-progress-buffering-reverse 250ms infinite linear;transform:rotate(0)}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{right:-145.166611%;left:auto}[dir=rtl] .mdc-linear-progress:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar,.mdc-linear-progress[dir=rtl]:not([dir=ltr]).mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{right:-54.888891%;left:auto}.mdc-linear-progress--closed{opacity:0}.mdc-linear-progress--closed-animation-off .mdc-linear-progress__buffer-dots{animation:none}.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar,.mdc-linear-progress--closed-animation-off.mdc-linear-progress--indeterminate .mdc-linear-progress__bar .mdc-linear-progress__bar-inner{animation:none}.mdc-linear-progress__bar-inner{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-linear-progress__buffer-dots{background-image:url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23e6e6e6'/%3E%3C/svg%3E")}.mdc-linear-progress__buffer-bar{background-color:#e6e6e6}.mdc-linear-progress{height:4px}.mdc-linear-progress__bar-inner{border-top-width:4px}.mdc-linear-progress__buffer-dots{background-size:10px 4px}:host{display:block}.mdc-linear-progress__buffer-bar{background-color:#e6e6e6;background-color:var(--mdc-linear-progress-buffer-color, #e6e6e6)}.mdc-linear-progress__buffer-dots{background-image:url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23e6e6e6'/%3E%3C/svg%3E");background-image:var(--mdc-linear-progress-buffering-dots-image, url("data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='none slice'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23e6e6e6'/%3E%3C/svg%3E"))}`;let A=class extends C{};A.styles=[R],A=i([h("mwc-linear-progress")],A);class I extends c{constructor(){super(...arguments),this.indeterminate=!1,this.progress=0,this.density=0,this.closed=!1}open(){this.closed=!1}close(){this.closed=!0}render(){const e={"mdc-circular-progress--closed":this.closed,"mdc-circular-progress--indeterminate":this.indeterminate},t=48+4*this.density,i={width:`${t}px`,height:`${t}px`};return m` +
+ ${this.renderDeterminateContainer()} + ${this.renderIndeterminateContainer()} +
`}renderDeterminateContainer(){const e=48+4*this.density,t=e/2,i=this.density>=-3?18+11*this.density/6:12.5+5*(this.density+3)/4,r=6.2831852*i,o=(1-this.progress)*r,n=this.density>=-3?4+this.density*(1/3):3+(this.density+3)*(1/6);return m` +
+ + + + +
`}renderIndeterminateContainer(){return m` +
+
+ ${this.renderIndeterminateSpinnerLayer()} +
+
`}renderIndeterminateSpinnerLayer(){const e=48+4*this.density,t=e/2,i=this.density>=-3?18+11*this.density/6:12.5+5*(this.density+3)/4,r=6.2831852*i,o=.5*r,n=this.density>=-3?4+this.density*(1/3):3+(this.density+3)*(1/6);return m` +
+ + + +
+
+ + + +
+
+ + + +
`}update(e){super.update(e),e.has("progress")&&(this.progress>1&&(this.progress=1),this.progress<0&&(this.progress=0))}}i([r({type:Boolean,reflect:!0})],I.prototype,"indeterminate",void 0),i([r({type:Number,reflect:!0})],I.prototype,"progress",void 0),i([r({type:Number,reflect:!0})],I.prototype,"density",void 0),i([r({type:Boolean,reflect:!0})],I.prototype,"closed",void 0),i([o,r({type:String,attribute:"aria-label"})],I.prototype,"ariaLabel",void 0);const N=u`.mdc-circular-progress__determinate-circle,.mdc-circular-progress__indeterminate-circle-graphic{stroke:#6200ee;stroke:var(--mdc-theme-primary, #6200ee)}.mdc-circular-progress__determinate-track{stroke:transparent}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-color-1-fade-in-out{from{opacity:.99}25%{opacity:.99}26%{opacity:0}89%{opacity:0}90%{opacity:.99}to{opacity:.99}}@keyframes mdc-circular-progress-color-2-fade-in-out{from{opacity:0}15%{opacity:0}25%{opacity:.99}50%{opacity:.99}51%{opacity:0}to{opacity:0}}@keyframes mdc-circular-progress-color-3-fade-in-out{from{opacity:0}40%{opacity:0}50%{opacity:.99}75%{opacity:.99}76%{opacity:0}to{opacity:0}}@keyframes mdc-circular-progress-color-4-fade-in-out{from{opacity:0}65%{opacity:0}75%{opacity:.99}90%{opacity:.99}to{opacity:0}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}.mdc-circular-progress{display:inline-flex;position:relative;direction:ltr;line-height:0;transition:opacity 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:transparent}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{animation:mdc-circular-progress-container-rotate 1568.2352941176ms linear infinite}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-1{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-1-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-2{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-2-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-3{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-3-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-4{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-4-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--closed{opacity:0}:host{display:inline-flex}.mdc-circular-progress__determinate-track{stroke:transparent;stroke:var(--mdc-circular-progress-track-color, transparent)}`;let O=class extends I{};O.styles=[N],O=i([h("mwc-circular-progress")],O);var T,D,P={ROOT:"mdc-form-field"},F={LABEL_SELECTOR:".mdc-form-field > label"},H=function(e){function t(i){var r=e.call(this,b(b({},t.defaultAdapter),i))||this;return r.click=function(){r.handleClick()},r}return _(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return P},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return F},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},t.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},t.prototype.handleClick=function(){var e=this;this.adapter.activateInputRipple(),requestAnimationFrame((function(){e.adapter.deactivateInputRipple()}))},t}(y);const $=null!==(D=null===(T=window.ShadyDOM)||void 0===T?void 0:T.inUse)&&void 0!==D&&D;class M extends v{constructor(){super(...arguments),this.disabled=!1,this.containingForm=null,this.formDataListener=e=>{this.disabled||this.setFormData(e.formData)}}findFormElement(){if(!this.shadowRoot||$)return null;const e=this.getRootNode().querySelectorAll("form");for(const t of Array.from(e))if(t.contains(this))return t;return null}connectedCallback(){var e;super.connectedCallback(),this.containingForm=this.findFormElement(),null===(e=this.containingForm)||void 0===e||e.addEventListener("formdata",this.formDataListener)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.containingForm)||void 0===e||e.removeEventListener("formdata",this.formDataListener),this.containingForm=null}click(){this.formElement&&!this.disabled&&(this.formElement.focus(),this.formElement.click())}firstUpdated(){super.firstUpdated(),this.shadowRoot&&this.mdcRoot.addEventListener("change",(e=>{this.dispatchEvent(new Event("change",e))}))}}M.shadowRootOptions={mode:"open",delegatesFocus:!0},i([r({type:Boolean})],M.prototype,"disabled",void 0);const z=e=>(t,i)=>{if(t.constructor._observers){if(!t.constructor.hasOwnProperty("_observers")){const e=t.constructor._observers;t.constructor._observers=new Map,e.forEach(((e,i)=>t.constructor._observers.set(i,e)))}}else{t.constructor._observers=new Map;const e=t.updated;t.updated=function(t){e.call(this,t),t.forEach(((e,t)=>{const i=this.constructor._observers.get(t);void 0!==i&&i.call(this,this[t],e)}))}}t.constructor._observers.set(i,e)};class B extends v{constructor(){super(...arguments),this.alignEnd=!1,this.spaceBetween=!1,this.nowrap=!1,this.label="",this.mdcFoundationClass=H}createAdapter(){return{registerInteractionHandler:(e,t)=>{this.labelEl.addEventListener(e,t)},deregisterInteractionHandler:(e,t)=>{this.labelEl.removeEventListener(e,t)},activateInputRipple:async()=>{const e=this.input;if(e instanceof M){const t=await e.ripple;t&&t.startPress()}},deactivateInputRipple:async()=>{const e=this.input;if(e instanceof M){const t=await e.ripple;t&&t.endPress()}}}}get input(){var e,t;return null!==(t=null===(e=this.slottedInputs)||void 0===e?void 0:e[0])&&void 0!==t?t:null}render(){const e={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return m` +
+ + +
`}click(){this._labelClick()}_labelClick(){const e=this.input;e&&(e.focus(),e.click())}}i([r({type:Boolean})],B.prototype,"alignEnd",void 0),i([r({type:Boolean})],B.prototype,"spaceBetween",void 0),i([r({type:Boolean})],B.prototype,"nowrap",void 0),i([r({type:String}),z((async function(e){var t;null===(t=this.input)||void 0===t||t.setAttribute("aria-label",e)}))],B.prototype,"label",void 0),i([n(".mdc-form-field")],B.prototype,"mdcRoot",void 0),i([function(i,r,o){let n,a=i;return"object"==typeof i?(a=i.slot,n=i):n={flatten:r},o?e({slot:a,flatten:r,selector:o}):t({descriptor:e=>({get(){var e,t;const i="slot"+(a?`[name=${a}]`:":not([name])"),r=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(i);return null!==(t=null==r?void 0:r.assignedNodes(n))&&void 0!==t?t:[]},enumerable:!0,configurable:!0})})}("",!0,"*")],B.prototype,"slottedInputs",void 0),i([n("label")],B.prototype,"labelEl",void 0);const G=u`.mdc-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87));display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{margin-left:auto;margin-right:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}[dir=rtl] .mdc-form-field--space-between>label,.mdc-form-field--space-between>label[dir=rtl]{margin:0}:host{display:inline-flex}.mdc-form-field{width:100%}::slotted(*){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}::slotted(mwc-switch){margin-right:10px}[dir=rtl] ::slotted(mwc-switch),::slotted(mwc-switch[dir=rtl]){margin-left:10px}`;let U=class extends B{};U.styles=[G],U=i([h("mwc-formfield")],U);const V=Symbol("selection controller");class K{constructor(){this.selected=null,this.ordered=null,this.set=new Set}}class j{constructor(e){this.sets={},this.focusedSet=null,this.mouseIsDown=!1,this.updating=!1,e.addEventListener("keydown",(e=>{this.keyDownHandler(e)})),e.addEventListener("mousedown",(()=>{this.mousedownHandler()})),e.addEventListener("mouseup",(()=>{this.mouseupHandler()}))}static getController(e){const t=!("global"in e)||"global"in e&&e.global?document:e.getRootNode();let i=t[V];return void 0===i&&(i=new j(t),t[V]=i),i}keyDownHandler(e){const t=e.target;"checked"in t&&this.has(t)&&("ArrowRight"==e.key||"ArrowDown"==e.key?this.selectNext(t):"ArrowLeft"!=e.key&&"ArrowUp"!=e.key||this.selectPrevious(t))}mousedownHandler(){this.mouseIsDown=!0}mouseupHandler(){this.mouseIsDown=!1}has(e){return this.getSet(e.name).set.has(e)}selectPrevious(e){const t=this.getOrdered(e),i=t.indexOf(e),r=t[i-1]||t[t.length-1];return this.select(r),r}selectNext(e){const t=this.getOrdered(e),i=t.indexOf(e),r=t[i+1]||t[0];return this.select(r),r}select(e){e.click()}focus(e){if(this.mouseIsDown)return;const t=this.getSet(e.name),i=this.focusedSet;this.focusedSet=t,i!=t&&t.selected&&t.selected!=e&&t.selected.focus()}isAnySelected(e){const t=this.getSet(e.name);for(const e of t.set)if(e.checked)return!0;return!1}getOrdered(e){const t=this.getSet(e.name);return t.ordered||(t.ordered=Array.from(t.set),t.ordered.sort(((e,t)=>e.compareDocumentPosition(t)==Node.DOCUMENT_POSITION_PRECEDING?1:0))),t.ordered}getSet(e){return this.sets[e]||(this.sets[e]=new K),this.sets[e]}register(e){const t=e.name||e.getAttribute("name")||"",i=this.getSet(t);i.set.add(e),i.ordered=null}unregister(e){const t=this.getSet(e.name);t.set.delete(e),t.ordered=null,t.selected==e&&(t.selected=null)}update(e){if(this.updating)return;this.updating=!0;const t=this.getSet(e.name);if(e.checked){for(const i of t.set)i!=e&&(i.checked=!1);t.selected=e}if(this.isAnySelected(e))for(const e of t.set){if(void 0===e.formElementTabIndex)break;e.formElementTabIndex=e.checked?0:-1}this.updating=!1}}var q={NATIVE_CONTROL_SELECTOR:".mdc-radio__native-control"},X={DISABLED:"mdc-radio--disabled",ROOT:"mdc-radio"},W=function(e){function t(i){return e.call(this,b(b({},t.defaultAdapter),i))||this}return _(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return X},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return q},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlDisabled:function(){}}},enumerable:!1,configurable:!0}),t.prototype.setDisabled=function(e){var i=t.cssClasses.DISABLED;this.adapter.setNativeControlDisabled(e),e?this.adapter.addClass(i):this.adapter.removeClass(i)},t}(y);class Z extends M{constructor(){super(...arguments),this._checked=!1,this.useStateLayerCustomProperties=!1,this.global=!1,this.disabled=!1,this.value="on",this.name="",this.reducedTouchTarget=!1,this.mdcFoundationClass=W,this.formElementTabIndex=0,this.focused=!1,this.shouldRenderRipple=!1,this.rippleElement=null,this.rippleHandlers=new l((()=>(this.shouldRenderRipple=!0,this.ripple.then((e=>{this.rippleElement=e})),this.ripple)))}get checked(){return this._checked}set checked(e){var t,i;const r=this._checked;e!==r&&(this._checked=e,this.formElement&&(this.formElement.checked=e),null===(t=this._selectionController)||void 0===t||t.update(this),!1===e&&(null===(i=this.formElement)||void 0===i||i.blur()),this.requestUpdate("checked",r),this.dispatchEvent(new Event("checked",{bubbles:!0,composed:!0})))}_handleUpdatedValue(e){this.formElement.value=e}renderRipple(){return this.shouldRenderRipple?m``:""}get isRippleActive(){var e;return(null===(e=this.rippleElement)||void 0===e?void 0:e.isActive)||!1}connectedCallback(){super.connectedCallback(),this._selectionController=j.getController(this),this._selectionController.register(this),this._selectionController.update(this)}disconnectedCallback(){this._selectionController.unregister(this),this._selectionController=void 0}focus(){this.formElement.focus()}createAdapter(){return Object.assign(Object.assign({},w(this.mdcRoot)),{setNativeControlDisabled:e=>{this.formElement.disabled=e}})}handleFocus(){this.focused=!0,this.handleRippleFocus()}handleClick(){this.formElement.focus()}handleBlur(){this.focused=!1,this.formElement.blur(),this.rippleHandlers.endFocus()}setFormData(e){this.name&&this.checked&&e.append(this.name,this.value)}render(){const e={"mdc-radio--touch":!this.reducedTouchTarget,"mdc-ripple-upgraded--background-focused":this.focused,"mdc-radio--disabled":this.disabled};return m` +
+ +
+
+
+
+ ${this.renderRipple()} +
`}handleRippleMouseDown(e){const t=()=>{window.removeEventListener("mouseup",t),this.handleRippleDeactivate()};window.addEventListener("mouseup",t),this.rippleHandlers.startPress(e)}handleRippleTouchStart(e){this.rippleHandlers.startPress(e)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}changeHandler(){this.checked=this.formElement.checked}}i([n(".mdc-radio")],Z.prototype,"mdcRoot",void 0),i([n("input")],Z.prototype,"formElement",void 0),i([s()],Z.prototype,"useStateLayerCustomProperties",void 0),i([r({type:Boolean})],Z.prototype,"global",void 0),i([r({type:Boolean,reflect:!0})],Z.prototype,"checked",null),i([r({type:Boolean}),z((function(e){this.mdcFoundation.setDisabled(e)}))],Z.prototype,"disabled",void 0),i([r({type:String}),z((function(e){this._handleUpdatedValue(e)}))],Z.prototype,"value",void 0),i([r({type:String})],Z.prototype,"name",void 0),i([r({type:Boolean})],Z.prototype,"reducedTouchTarget",void 0),i([r({type:Number})],Z.prototype,"formElementTabIndex",void 0),i([s()],Z.prototype,"focused",void 0),i([s()],Z.prototype,"shouldRenderRipple",void 0),i([a("mwc-ripple")],Z.prototype,"ripple",void 0),i([o,r({attribute:"aria-label"})],Z.prototype,"ariaLabel",void 0),i([o,r({attribute:"aria-labelledby"})],Z.prototype,"ariaLabelledBy",void 0),i([d({passive:!0})],Z.prototype,"handleRippleTouchStart",null);const Y=u`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc((40px - 20px) / 2)}.mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.54)}.mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:#018786;border-color:var(--mdc-theme-secondary, #018786)}.mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:#018786;border-color:var(--mdc-theme-secondary, #018786)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio .mdc-radio__background::before{background-color:#018786;background-color:var(--mdc-theme-secondary, #018786)}.mdc-radio .mdc-radio__background::before{top:calc(-1 * (40px - 20px) / 2);left:calc(-1 * (40px - 20px) / 2);width:40px;height:40px}.mdc-radio .mdc-radio__native-control{top:calc((40px - 40px) / 2);right:calc((40px - 40px) / 2);left:calc((40px - 40px) / 2);width:40px;height:40px}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:GrayText}}.mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid transparent;border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:"";border:2px solid transparent;border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}:host{display:inline-block;outline:none}.mdc-radio{vertical-align:bottom}.mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unchecked-color, rgba(0, 0, 0, 0.54))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}`;let Q=class extends Z{};Q.styles=[Y],Q=i([h("mwc-radio")],Q),(()=>{var e,t,i;const r=Symbol(),o=Symbol(),n=Symbol(),a=Symbol(),s=Symbol(),d=Symbol(),c=Symbol(),l=Symbol(),m=Symbol(),p=Symbol(),u=Symbol(),h=Symbol(),g=Symbol();class f{constructor(){this[e]=[],this[t]=[],this[i]=new Set}destructor(){this[m](this[n]);const e=this;e[r]=null,e[n]=null,e[o]=null}get top(){const e=this[r];return e[e.length-1]||null}push(e){e&&e!==this.top&&(this.remove(e),this[d](e),this[r].push(e))}remove(e){const t=this[r].indexOf(e);return-1!==t&&(this[r].splice(t,1),t===this[r].length&&this[d](this.top),!0)}pop(){const e=this.top;return e&&this.remove(e),e}has(e){return-1!==this[r].indexOf(e)}[(e=r,t=n,i=o,d)](e){const t=this[o],i=this[n];if(!e)return this[m](i),t.clear(),void(this[n]=[]);const r=this[p](e);if(r[r.length-1].parentNode!==document.body)throw Error("Non-connected element cannot be a blocking element");this[n]=r;const a=this[u](e);if(!i.length)return void this[l](r,a,t);let s=i.length-1,d=r.length-1;for(;s>0&&d>0&&i[s]===r[d];)s--,d--;i[s]!==r[d]&&this[c](i[s],r[d]),s>0&&this[m](i.slice(0,s)),d>0&&this[l](r.slice(0,d),a,null)}[c](e,t){const i=e[a];this[h](e)&&!e.inert&&(e.inert=!0,i.add(e)),i.has(t)&&(t.inert=!1,i.delete(t)),t[s]=e[s],t[a]=i,e[s]=void 0,e[a]=void 0}[m](e){for(const t of e){t[s].disconnect(),t[s]=void 0;const e=t[a];for(const t of e)t.inert=!1;t[a]=void 0}}[l](e,t,i){for(const r of e){const e=r.parentNode,o=e.children,n=new Set;for(let e=0;ee instanceof HTMLElement));const t=e[0];return t||null}emitNotification(e,t){const i=new CustomEvent(e,{detail:t?{action:t}:{}});this.dispatchEvent(i)}getInitialFocusEl(){const e=`[${this.initialFocusAttribute}]`,t=this.querySelector(e);if(t)return t;const i=this.primarySlot.assignedNodes({flatten:!0}),r=this.searchNodeTreesForAttribute(i,this.initialFocusAttribute);if(r)return r;const o=this.secondarySlot.assignedNodes({flatten:!0}),n=this.searchNodeTreesForAttribute(o,this.initialFocusAttribute);if(n)return n;const a=this.contentSlot.assignedNodes({flatten:!0});return this.searchNodeTreesForAttribute(a,this.initialFocusAttribute)}searchNodeTreesForAttribute(e,t){for(const i of e)if(i instanceof HTMLElement){if(i.hasAttribute(t))return i;{const e=i.querySelector(`[${t}]`);if(e)return e}}return null}createAdapter(){return Object.assign(Object.assign({},w(this.mdcRoot)),{addBodyClass:()=>document.body.style.overflow="hidden",removeBodyClass:()=>document.body.style.overflow="",areButtonsStacked:()=>this.stacked,clickDefaultButton:()=>{const e=this.primaryButton;e&&e.click()},eventTargetMatches:(e,t)=>!!e&&x(e,t),getActionFromEvent:e=>{if(!e.target)return"";const t=E(e.target,`[${this.actionAttribute}]`);return t&&t.getAttribute(this.actionAttribute)},getInitialFocusEl:()=>this.getInitialFocusEl(),isContentScrollable:()=>{const e=this.contentElement;return!!e&&e.scrollHeight>e.offsetHeight},notifyClosed:e=>this.emitNotification("closed",e),notifyClosing:e=>{this.closingDueToDisconnect||(this.open=!1),this.emitNotification("closing",e)},notifyOpened:()=>this.emitNotification("opened"),notifyOpening:()=>{this.open=!0,this.emitNotification("opening")},reverseButtons:()=>{},releaseFocus:()=>{de.remove(this)},trapFocus:e=>{this.isConnected&&(de.push(this),e&&e.focus())},registerContentEventHandler:(e,t)=>{this.contentElement.addEventListener(e,t)},deregisterContentEventHandler:(e,t)=>{this.contentElement.removeEventListener(e,t)},isScrollableContentAtTop:()=>{const e=this.contentElement;return!!e&&0===e.scrollTop},isScrollableContentAtBottom:()=>{const e=this.contentElement;return!!e&&Math.ceil(e.scrollHeight-e.scrollTop)===e.clientHeight},registerWindowEventHandler:(e,t)=>{window.addEventListener(e,t,se())},deregisterWindowEventHandler:(e,t)=>{window.removeEventListener(e,t,se())}})}render(){const e={[ie.STACKED]:this.stacked};let t=m``;this.heading&&(t=this.renderHeading());const i={"mdc-dialog__actions":!this.hideActions};return m` +
+
+
+ ${t} +
+ +
+
+ + + + + + +
+
+
+
+
`}renderHeading(){return m` +

${this.heading}

`}firstUpdated(){super.firstUpdated(),this.mdcFoundation.setAutoStackButtons(!0),this.initialSupressDefaultPressSelector?this.suppressDefaultPressSelector=this.initialSupressDefaultPressSelector:this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,"mwc-textarea","mwc-menu mwc-list-item","mwc-select mwc-list-item"].join(", "),this.boundHandleClick=this.mdcFoundation.handleClick.bind(this.mdcFoundation),this.boundHandleKeydown=this.mdcFoundation.handleKeydown.bind(this.mdcFoundation),this.boundHandleDocumentKeydown=this.mdcFoundation.handleDocumentKeydown.bind(this.mdcFoundation)}connectedCallback(){super.connectedCallback(),this.open&&this.mdcFoundation&&!this.mdcFoundation.isOpen()&&(this.setEventListeners(),this.mdcFoundation.open())}disconnectedCallback(){super.disconnectedCallback(),this.open&&this.mdcFoundation&&(this.removeEventListeners(),this.closingDueToDisconnect=!0,this.mdcFoundation.close(this.currentAction||this.defaultAction),this.closingDueToDisconnect=!1,this.currentAction=void 0,de.remove(this))}forceLayout(){this.mdcFoundation.layout()}focus(){const e=this.getInitialFocusEl();e&&e.focus()}blur(){if(!this.shadowRoot)return;const e=this.shadowRoot.activeElement;if(e)e instanceof HTMLElement&&e.blur();else{const e=this.getRootNode(),t=e instanceof Document?e.activeElement:null;t instanceof HTMLElement&&t.blur()}}setEventListeners(){this.boundHandleClick&&this.mdcRoot.addEventListener("click",this.boundHandleClick),this.boundHandleKeydown&&this.mdcRoot.addEventListener("keydown",this.boundHandleKeydown,se()),this.boundHandleDocumentKeydown&&document.addEventListener("keydown",this.boundHandleDocumentKeydown,se())}removeEventListeners(){this.boundHandleClick&&this.mdcRoot.removeEventListener("click",this.boundHandleClick),this.boundHandleKeydown&&this.mdcRoot.removeEventListener("keydown",this.boundHandleKeydown),this.boundHandleDocumentKeydown&&document.removeEventListener("keydown",this.boundHandleDocumentKeydown)}close(){this.open=!1}show(){this.open=!0}}i([n(".mdc-dialog")],ce.prototype,"mdcRoot",void 0),i([n('slot[name="primaryAction"]')],ce.prototype,"primarySlot",void 0),i([n('slot[name="secondaryAction"]')],ce.prototype,"secondarySlot",void 0),i([n("#contentSlot")],ce.prototype,"contentSlot",void 0),i([n(".mdc-dialog__content")],ce.prototype,"contentElement",void 0),i([n(".mdc-container")],ce.prototype,"conatinerElement",void 0),i([r({type:Boolean})],ce.prototype,"hideActions",void 0),i([r({type:Boolean}),z((function(){this.forceLayout()}))],ce.prototype,"stacked",void 0),i([r({type:String})],ce.prototype,"heading",void 0),i([r({type:String}),z((function(e){this.mdcFoundation.setScrimClickAction(e)}))],ce.prototype,"scrimClickAction",void 0),i([r({type:String}),z((function(e){this.mdcFoundation.setEscapeKeyAction(e)}))],ce.prototype,"escapeKeyAction",void 0),i([r({type:Boolean,reflect:!0}),z((function(e){this.mdcFoundation&&this.isConnected&&(e?(this.setEventListeners(),this.mdcFoundation.open()):(this.removeEventListeners(),this.mdcFoundation.close(this.currentAction||this.defaultAction),this.currentAction=void 0))}))],ce.prototype,"open",void 0),i([r()],ce.prototype,"defaultAction",void 0),i([r()],ce.prototype,"actionAttribute",void 0),i([r()],ce.prototype,"initialFocusAttribute",void 0);const le=u`.mdc-dialog .mdc-dialog__surface{background-color:#fff;background-color:var(--mdc-theme-surface, #fff)}.mdc-dialog .mdc-dialog__scrim{background-color:rgba(0,0,0,.32)}.mdc-dialog .mdc-dialog__surface-scrim{background-color:rgba(0,0,0,.32)}.mdc-dialog .mdc-dialog__title{color:rgba(0,0,0,.87)}.mdc-dialog .mdc-dialog__content{color:rgba(0,0,0,.6)}.mdc-dialog .mdc-dialog__close{color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-dialog .mdc-dialog__close .mdc-icon-button__ripple::before,.mdc-dialog .mdc-dialog__close .mdc-icon-button__ripple::after{background-color:#000;background-color:var(--mdc-ripple-color, var(--mdc-theme-on-surface, #000))}.mdc-dialog .mdc-dialog__close:hover .mdc-icon-button__ripple::before,.mdc-dialog .mdc-dialog__close.mdc-ripple-surface--hover .mdc-icon-button__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-dialog .mdc-dialog__close.mdc-ripple-upgraded--background-focused .mdc-icon-button__ripple::before,.mdc-dialog .mdc-dialog__close:not(.mdc-ripple-upgraded):focus .mdc-icon-button__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-dialog .mdc-dialog__close:not(.mdc-ripple-upgraded) .mdc-icon-button__ripple::after{transition:opacity 150ms linear}.mdc-dialog .mdc-dialog__close:not(.mdc-ripple-upgraded):active .mdc-icon-button__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-dialog .mdc-dialog__close.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__title,.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__actions,.mdc-dialog.mdc-dialog--scrollable.mdc-dialog-scroll-divider-footer .mdc-dialog__actions{border-color:rgba(0,0,0,.12)}.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__title{border-bottom:1px solid rgba(0,0,0,.12);margin-bottom:0}.mdc-dialog.mdc-dialog-scroll-divider-header.mdc-dialog--fullscreen .mdc-dialog__header{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2),0px 2px 2px 0px rgba(0, 0, 0, 0.14),0px 1px 5px 0px rgba(0,0,0,.12)}.mdc-dialog .mdc-dialog__surface{border-radius:4px;border-radius:var(--mdc-shape-medium, 4px)}.mdc-dialog__surface{box-shadow:0px 11px 15px -7px rgba(0, 0, 0, 0.2),0px 24px 38px 3px rgba(0, 0, 0, 0.14),0px 9px 46px 8px rgba(0,0,0,.12)}.mdc-dialog__title{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-headline6-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1.25rem;font-size:var(--mdc-typography-headline6-font-size, 1.25rem);line-height:2rem;line-height:var(--mdc-typography-headline6-line-height, 2rem);font-weight:500;font-weight:var(--mdc-typography-headline6-font-weight, 500);letter-spacing:0.0125em;letter-spacing:var(--mdc-typography-headline6-letter-spacing, 0.0125em);text-decoration:inherit;text-decoration:var(--mdc-typography-headline6-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-headline6-text-transform, inherit)}.mdc-dialog__content{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-body1-font-size, 1rem);line-height:1.5rem;line-height:var(--mdc-typography-body1-line-height, 1.5rem);font-weight:400;font-weight:var(--mdc-typography-body1-font-weight, 400);letter-spacing:0.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, 0.03125em);text-decoration:inherit;text-decoration:var(--mdc-typography-body1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform, inherit)}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:0;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:#fff;background-color:var(--mdc-elevation-overlay-color, #fff)}.mdc-dialog,.mdc-dialog__scrim{position:fixed;top:0;left:0;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%}.mdc-dialog{display:none;z-index:7;z-index:var(--mdc-dialog-z-index, 7)}.mdc-dialog .mdc-dialog__content{padding:20px 24px 20px 24px}.mdc-dialog .mdc-dialog__surface{min-width:280px}@media(max-width: 592px){.mdc-dialog .mdc-dialog__surface{max-width:calc(100vw - 32px)}}@media(min-width: 592px){.mdc-dialog .mdc-dialog__surface{max-width:560px}}.mdc-dialog .mdc-dialog__surface{max-height:calc(100% - 32px)}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{max-width:none}@media(max-width: 960px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{max-height:560px;width:560px}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__close{right:-12px}}@media(max-width: 720px)and (max-width: 672px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{width:calc(100vw - 112px)}}@media(max-width: 720px)and (min-width: 672px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{width:560px}}@media(max-width: 720px)and (max-height: 720px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{max-height:calc(100vh - 160px)}}@media(max-width: 720px)and (min-height: 720px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{max-height:560px}}@media(max-width: 720px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__close{right:-12px}}@media(max-width: 720px)and (max-height: 400px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{height:100%;max-height:100vh;max-width:100vw;width:100vw;border-radius:0}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__close{order:-1;left:-12px}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__header{padding:0 16px 9px;justify-content:flex-start}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__title{margin-left:calc(16px - 2 * 12px)}}@media(max-width: 600px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{height:100%;max-height:100vh;max-width:100vw;width:100vw;border-radius:0}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__close{order:-1;left:-12px}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__header{padding:0 16px 9px;justify-content:flex-start}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__title{margin-left:calc(16px - 2 * 12px)}}@media(min-width: 960px){.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface{width:calc(100vw - 400px)}.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface .mdc-dialog__close{right:-12px}}.mdc-dialog.mdc-dialog__scrim--hidden .mdc-dialog__scrim{opacity:0}.mdc-dialog__scrim{opacity:0;z-index:-1}.mdc-dialog__container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;transform:scale(0.8);opacity:0;pointer-events:none}.mdc-dialog__surface{position:relative;display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;max-width:100%;max-height:100%;pointer-events:auto;overflow-y:auto}.mdc-dialog__surface .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}[dir=rtl] .mdc-dialog__surface,.mdc-dialog__surface[dir=rtl]{text-align:right}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-dialog__surface{outline:2px solid windowText}}.mdc-dialog__surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid transparent;border-radius:inherit;content:"";pointer-events:none}@media screen and (forced-colors: active){.mdc-dialog__surface::before{border-color:CanvasText}}@media screen and (-ms-high-contrast: active),screen and (-ms-high-contrast: none){.mdc-dialog__surface::before{content:none}}.mdc-dialog__title{display:block;margin-top:0;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:0 24px 9px}.mdc-dialog__title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mdc-dialog__title,.mdc-dialog__title[dir=rtl]{text-align:right}.mdc-dialog--scrollable .mdc-dialog__title{margin-bottom:1px;padding-bottom:15px}.mdc-dialog--fullscreen .mdc-dialog__header{align-items:baseline;border-bottom:1px solid transparent;display:inline-flex;justify-content:space-between;padding:0 24px 9px;z-index:1}@media screen and (forced-colors: active){.mdc-dialog--fullscreen .mdc-dialog__header{border-bottom-color:CanvasText}}.mdc-dialog--fullscreen .mdc-dialog__header .mdc-dialog__close{right:-12px}.mdc-dialog--fullscreen .mdc-dialog__title{margin-bottom:0;padding:0;border-bottom:0}.mdc-dialog--fullscreen.mdc-dialog--scrollable .mdc-dialog__title{border-bottom:0;margin-bottom:0}.mdc-dialog--fullscreen .mdc-dialog__close{top:5px}.mdc-dialog--fullscreen.mdc-dialog--scrollable .mdc-dialog__actions{border-top:1px solid transparent}@media screen and (forced-colors: active){.mdc-dialog--fullscreen.mdc-dialog--scrollable .mdc-dialog__actions{border-top-color:CanvasText}}.mdc-dialog__content{flex-grow:1;box-sizing:border-box;margin:0;overflow:auto}.mdc-dialog__content>:first-child{margin-top:0}.mdc-dialog__content>:last-child{margin-bottom:0}.mdc-dialog__title+.mdc-dialog__content,.mdc-dialog__header+.mdc-dialog__content{padding-top:0}.mdc-dialog--scrollable .mdc-dialog__title+.mdc-dialog__content{padding-top:8px;padding-bottom:8px}.mdc-dialog__content .mdc-deprecated-list:first-child:last-child{padding:6px 0 0}.mdc-dialog--scrollable .mdc-dialog__content .mdc-deprecated-list:first-child:last-child{padding:0}.mdc-dialog__actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid transparent}@media screen and (forced-colors: active){.mdc-dialog__actions{border-top-color:CanvasText}}.mdc-dialog--stacked .mdc-dialog__actions{flex-direction:column;align-items:flex-end}.mdc-dialog__button{margin-left:8px;margin-right:0;max-width:100%;text-align:right}[dir=rtl] .mdc-dialog__button,.mdc-dialog__button[dir=rtl]{margin-left:0;margin-right:8px}.mdc-dialog__button:first-child{margin-left:0;margin-right:0}[dir=rtl] .mdc-dialog__button:first-child,.mdc-dialog__button:first-child[dir=rtl]{margin-left:0;margin-right:0}[dir=rtl] .mdc-dialog__button,.mdc-dialog__button[dir=rtl]{text-align:left}.mdc-dialog--stacked .mdc-dialog__button:not(:first-child){margin-top:12px}.mdc-dialog--open,.mdc-dialog--opening,.mdc-dialog--closing{display:flex}.mdc-dialog--opening .mdc-dialog__scrim{transition:opacity 150ms linear}.mdc-dialog--opening .mdc-dialog__container{transition:opacity 75ms linear,transform 150ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-dialog--closing .mdc-dialog__scrim,.mdc-dialog--closing .mdc-dialog__container{transition:opacity 75ms linear}.mdc-dialog--closing .mdc-dialog__container{transform:none}.mdc-dialog--open .mdc-dialog__scrim{opacity:1}.mdc-dialog--open .mdc-dialog__container{transform:none;opacity:1}.mdc-dialog--open.mdc-dialog__surface-scrim--shown .mdc-dialog__surface-scrim{opacity:1;z-index:1}.mdc-dialog--open.mdc-dialog__surface-scrim--hiding .mdc-dialog__surface-scrim{transition:opacity 75ms linear}.mdc-dialog--open.mdc-dialog__surface-scrim--showing .mdc-dialog__surface-scrim{transition:opacity 150ms linear}.mdc-dialog__surface-scrim{display:none;opacity:0;position:absolute;width:100%;height:100%}.mdc-dialog__surface-scrim--shown .mdc-dialog__surface-scrim,.mdc-dialog__surface-scrim--showing .mdc-dialog__surface-scrim,.mdc-dialog__surface-scrim--hiding .mdc-dialog__surface-scrim{display:block}.mdc-dialog-scroll-lock{overflow:hidden}.mdc-dialog--no-content-padding .mdc-dialog__content{padding:0}.mdc-dialog--sheet .mdc-dialog__close{right:12px;top:9px;position:absolute;z-index:1}#actions:not(.mdc-dialog__actions){display:none}.mdc-dialog__surface{box-shadow:var(--mdc-dialog-box-shadow, 0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12))}@media(min-width: 560px){.mdc-dialog .mdc-dialog__surface{max-width:560px;max-width:var(--mdc-dialog-max-width, 560px)}}.mdc-dialog .mdc-dialog__scrim{background-color:rgba(0, 0, 0, 0.32);background-color:var(--mdc-dialog-scrim-color, rgba(0, 0, 0, 0.32))}.mdc-dialog .mdc-dialog__title{color:rgba(0, 0, 0, 0.87);color:var(--mdc-dialog-heading-ink-color, rgba(0, 0, 0, 0.87))}.mdc-dialog .mdc-dialog__content{color:rgba(0, 0, 0, 0.6);color:var(--mdc-dialog-content-ink-color, rgba(0, 0, 0, 0.6))}.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__title,.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__actions{border-color:rgba(0, 0, 0, 0.12);border-color:var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12))}.mdc-dialog .mdc-dialog__surface{min-width:280px;min-width:var(--mdc-dialog-min-width, 280px)}.mdc-dialog .mdc-dialog__surface{max-height:var(--mdc-dialog-max-height, calc(100% - 32px))}#actions ::slotted(*){margin-left:8px;margin-right:0;max-width:100%;text-align:right}[dir=rtl] #actions ::slotted(*),#actions ::slotted(*[dir=rtl]){margin-left:0;margin-right:8px}[dir=rtl] #actions ::slotted(*),#actions ::slotted(*[dir=rtl]){text-align:left}.mdc-dialog--stacked #actions{flex-direction:column-reverse}.mdc-dialog--stacked #actions *:not(:last-child) ::slotted(*){flex-basis:.000000001px;margin-top:12px}`;let me=class extends ce{};me.styles=[le],me=i([h("mwc-dialog")],me);let pe=class extends c{render(){return m` + + `}};pe.styles=u` + :host, + svg { + display: inline-block; + width: 24px; + height: 24px; + } + + svg { + vertical-align: baseline; + } + `,i([r()],pe.prototype,"icon",void 0),pe=i([h("usf-icon")],pe);let ue=class extends k{};ue.styles=[S],ue=i([h("usf-icon-button")],ue);let he=class extends c{constructor(){super(...arguments),this.disabled=!1}fileChanged(e){this.requestUpdate(),this.dispatchEvent(new Event(e.type,e))}buttonClicked(){this.fileInput.click()}get files(){return this.fileInput?this.fileInput.files:null}render(){return m` + + + + + + + ${this.files?m`${this.files.length>0?this.files[0].name:"No file selected"}`:""} + `}};he.styles=u` + mwc-button { + vertical-align: middle; + } + `,i([n("#file")],he.prototype,"fileInput",void 0),i([r({type:Boolean})],he.prototype,"disabled",void 0),i([r()],he.prototype,"accept",void 0),he=i([h("usf-file-upload")],he);const ge="M9.5,8.5L11,10L8,13L11,16L9.5,17.5L5,13L9.5,8.5M14.5,17.5L13,16L16,13L13,10L14.5,8.5L19,13L14.5,17.5M21,2H3A2,2 0 0,0 1,4V20A2,2 0 0,0 3,22H21A2,2 0 0,0 23,20V4A2,2 0 0,0 21,2M21,20H3V6H21V20Z";var fe;!function(e){e.GECKO_BOOTLOADER="bootloader",e.CPC="cpc",e.EZSP="ezsp",e.SPINEL="spinel",e.ROUTER="router"}(fe||(fe={}));const _e={[fe.GECKO_BOOTLOADER]:"Bootloader (recovery)",[fe.CPC]:"Multi-PAN (RCP)",[fe.EZSP]:"Zigbee (EZSP)",[fe.SPINEL]:"OpenThread (RCP)",[fe.ROUTER]:"Zigbee Router"};var be;!function(e){e.ZIGBEE_NCP="zigbee_ncp",e.ZIGBEE_ROUTER="zigbee_router",e.OPENTHREAD_RCP="openthread_rcp",e.BOOTLOADER="bootloader",e.MULTIPAN="multipan",e.UNKNOWN="unknown"}(be||(be={}));const ye={"ncp-uart-hw":be.ZIGBEE_NCP,"ncp-uart-sw":be.ZIGBEE_NCP,"rcp-uart-802154":be.MULTIPAN,"ot-rcp":be.OPENTHREAD_RCP,"gecko-bootloader":be.BOOTLOADER},ve={[be.ZIGBEE_NCP]:"M4.06,6.15C3.97,6.17 3.88,6.22 3.8,6.28C2.66,7.9 2,9.87 2,12A10,10 0 0,0 12,22C15,22 17.68,20.68 19.5,18.6L17,18.85C14.25,19.15 11.45,19.19 8.66,18.96C7.95,18.94 7.24,18.76 6.59,18.45C5.73,18.06 5.15,17.23 5.07,16.29C5.06,16.13 5.12,16 5.23,15.87L7.42,13.6L15.03,5.7V5.6H10.84C8.57,5.64 6.31,5.82 4.06,6.15M20.17,17.5C20.26,17.47 20.35,17.44 20.43,17.39C21.42,15.83 22,14 22,12A10,10 0 0,0 12,2C9.22,2 6.7,3.13 4.89,4.97H5.17C8.28,4.57 11.43,4.47 14.56,4.65C15.5,4.64 16.45,4.82 17.33,5.17C18.25,5.53 18.89,6.38 19,7.37C19,7.53 18.93,7.7 18.82,7.82L9.71,17.19L9,17.95V18.06H13.14C15.5,18 17.84,17.81 20.17,17.5Z",[be.ZIGBEE_ROUTER]:"M12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22C17.5 22 22 17.5 22 12C22 6.5 17.5 2 12 2M12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20M13 13V16H15L12 19L9 16H11V13M5 13H8V15L11 12L8 9V11H5M11 11V8H9L12 5L15 8H13V11M19 11H16V9L13 12L16 15V13H19",[be.MULTIPAN]:"M17 2V4H12C10.9 4 10 4.89 10 6V9H12V6H17V8L20 5L17 2M17 9V11H6.73C6.37 10.38 5.71 10 5 10C3.9 10 3 10.9 3 12S3.9 14 5 14C5.71 14 6.37 13.62 6.73 13H17V15L20 12L17 9M10 15V18C10 19.11 10.9 20 12 20H17V22L20 19L17 16V18H12V15H10Z",[be.OPENTHREAD_RCP]:"M12 0C5.383 0 0 5.384 0 12.002 0 18.574 5.31 23.928 11.865 24V12.012H7.938A2.12 2.12 0 0 0 5.82 14.13a2.12 2.12 0 0 0 2.116 2.117v2.616a4.738 4.738 0 0 1-4.731-4.733 4.738 4.738 0 0 1 4.731-4.734h3.928V8.074a3.943 3.943 0 0 1 3.938-3.94 3.944 3.944 0 0 1 3.94 3.94 3.944 3.944 0 0 1-3.94 3.939H14.48v11.731C19.911 22.598 24 17.77 24 12.002 24 5.384 18.617 0 12 0Zm5.127 8.073a1.325 1.325 0 0 0-1.324-1.324 1.325 1.325 0 0 0-1.323 1.324v1.323h1.323a1.325 1.325 0 0 0 1.324-1.323z",[be.BOOTLOADER]:ge,[be.UNKNOWN]:ge},we={[be.ZIGBEE_NCP]:"Zigbee (EZSP)",[be.ZIGBEE_ROUTER]:"Zigbee Router",[be.MULTIPAN]:"Multi-PAN (RCP)",[be.OPENTHREAD_RCP]:"OpenThread (RCP)",[be.BOOTLOADER]:"Gecko Bootloader",[be.UNKNOWN]:"Unknown"},xe={[fe.CPC]:be.MULTIPAN,[fe.EZSP]:be.ZIGBEE_NCP,[fe.ROUTER]:be.ZIGBEE_ROUTER,[fe.SPINEL]:be.OPENTHREAD_RCP,[fe.GECKO_BOOTLOADER]:be.BOOTLOADER},Ee=9999;async function ke(e,t){const{GBLImage:i}=e.pyimport("universal_silabs_flasher.firmware");return await i.from_bytes.callKwargs(e.toPy(t),{})}let Se=class extends c{constructor(){super(...arguments),this.firmwareUploadIndex=0}firmwareLoaded(e){this.dispatchEvent(new CustomEvent("firmwareLoaded",{detail:{firmware:e},bubbles:!0,composed:!0}))}firstUpdated(){this.renderRoot.querySelector("mwc-radio").dispatchEvent(new Event("change"))}async firmwareUploadTypeChanged(e){if(this.firmwareUploadIndex=parseInt(e.target.value,10),this.firmwareUploadIndex===Ee)return void this.firmwareLoaded(void 0);const t=this.manifest.firmwares[this.firmwareUploadIndex],i=await fetch(t.url);if(!i.ok)return void alert(`Failed to download firmware: ${i}`);const r=await i.arrayBuffer();await this.loadFirmware(r)}async customFirmwareChosen(e){const t=e.target.files[0],i=await async function(e){return new Promise(((t,i)=>{const r=new FileReader;r.onload=()=>t(r.result),r.onerror=e=>i(e),r.readAsArrayBuffer(e)}))}(t);await this.loadFirmware(i)}async loadFirmware(e){let t;try{t=await ke(this.pyodide,e)}catch(e){t=void 0,alert(`Failed to parse firmware: ${e}`)}this.firmwareLoaded(t)}render(){return m` + ${this.manifest.firmwares.map(((e,t)=>m` +
+ + + + + +
+ `))} + ${this.manifest.allow_custom_firmware_upload?m` +
+ + + + + + + Upload +
+ `:""} + `}};Se.styles=u` + .hidden { + display: none; + } + + mwc-formfield { + display: block; + } + + usf-icon { + margin-right: 1em; + } + `,i([r()],Se.prototype,"pyodide",void 0),i([r()],Se.prototype,"manifest",void 0),i([s()],Se.prototype,"firmwareUploadIndex",void 0),Se=i([h("firmware-selector")],Se);var Le='import sys\nimport unittest.mock\n\n\nclass DummyFinder:\n """\n Combined module loader and finder that recursively returns Mock objects.\n """\n\n def __init__(self, name):\n self.name = name\n\n def find_module(self, fullname, path=None):\n if fullname.startswith(self.name):\n return self\n\n def load_module(self, fullname):\n return sys.modules.setdefault(fullname, unittest.mock.MagicMock(__path__=[]))\n\n\ndef __getattr__(name):\n return unittest.mock.MagicMock()\n\n\nsys.meta_path.append(DummyFinder(__name__))',Ce="aiohappyeyeballs==2.4.3\naiohttp==3.10.10\naiosignal==1.3.1\naiosqlite==0.20.0\nasync-timeout==5.0.0\nattrs==24.2.0\nbellows==0.42.0\ncffi==1.17.1\nclick==8.1.7\nclick-log==0.4.0\ncoloredlogs==15.0.1\ncrc==7.0.0\ncrccheck==1.3.0\ncryptography==43.0.3\nfrozendict==2.4.6\nfrozenlist==1.5.0\ngpiod==2.2.1\nhumanfriendly==10.0\nidna==3.10\njsonschema==4.23.0\njsonschema-specifications==2024.10.1\nmultidict==6.1.0\npropcache==0.2.0\npure-pcapy3==1.0.1\npycparser==2.22\npyserial==3.5\npyserial-asyncio==0.6\npyserial-asyncio-fast==0.14\nreferencing==0.35.1\nrpds-py==0.20.1\nsetuptools==75.3.0\ntyping_extensions==4.12.2\nvoluptuous==0.15.2\nyarl==1.17.1\nzigpy==0.71.0\n",Re='from __future__ import annotations\n\nimport asyncio\nimport collections.abc\nimport logging\nimport sys\nimport typing\n\nimport js\n\n# Patch some built-in modules so that pyserial imports\ntry:\n import fcntl # noqa: F401\nexcept ImportError:\n sys.modules["fcntl"] = object() # type: ignore[assignment]\n\ntry:\n import termios # noqa: F401\nexcept ImportError:\n sys.modules["termios"] = object() # type: ignore[assignment]\n\nclass MockSqlite3:\n sqlite_version = "3.31.1"\n sqlite_version_info = (3, 31, 1)\ntry:\n import sqlite3 # noqa: F401\nexcept ImportError:\n sys.modules["sqlite3"] = MockSqlite3()\n\n_SERIAL_PORT = None\n_SERIAL_PORT_CLOSING_TASKS = []\n\n_LOGGER = logging.getLogger(__name__)\n\n\nasync def close_port(port: Any) -> None:\n _LOGGER.debug("Closing serial port")\n # XXX: `port.close` isn\'t a coroutine, it\'s an awaitable, so it cannot be directly\n # passed into `asyncio.create_task()`\n await port.close()\n _LOGGER.debug("Closed serial port")\n\n\nclass WebSerialTransport(asyncio.Transport):\n def __init__(\n self,\n loop: asyncio.BaseEventLoop,\n protocol: asyncio.Protocol,\n port,\n ) -> None:\n super().__init__()\n self._loop: asyncio.BaseEventLoop = loop\n self._protocol: asyncio.BaseProtocol | None = protocol\n self._port = port\n\n self._write_queue: asyncio.Queue = asyncio.Queue()\n self._is_closing = False\n\n self._js_reader = self._port.readable.getReader()\n self._js_writer = self._port.writable.getWriter()\n\n self._reader_task = loop.create_task(self._reader_loop())\n self._writer_task = loop.create_task(self._writer_loop())\n\n self._loop.call_soon(self._protocol.connection_made, self)\n\n async def _writer_loop(self) -> None:\n while True:\n chunk = await self._write_queue.get()\n\n try:\n await self._js_writer.write(js.Uint8Array.new(chunk))\n except Exception as e:\n self._cleanup(e)\n break\n\n async def _reader_loop(self) -> None:\n while True:\n result = await self._js_reader.read()\n if result.done:\n self._cleanup(RuntimeError("Other side has closed"))\n return\n\n self._protocol.data_received(bytes(result.value))\n\n def write(self, data: bytes) -> None:\n self._write_queue.put_nowait(data)\n\n def set_protocol(self, protocol: asyncio.BaseProtocol) -> None:\n self._protocol = protocol\n\n def get_protocol(self) -> asyncio.BaseProtocol:\n assert self._protocol is not None\n return self._protocol\n\n def is_closing(self) -> bool:\n return self._is_closing\n\n def __del__(self):\n self._cleanup(RuntimeError("Transport was not closed!"))\n\n def _cleanup(self, exception: BaseException | None) -> None:\n self._is_closing = True\n\n self._reader_task.cancel()\n self._writer_task.cancel()\n\n if self._js_reader is not None:\n self._js_reader.releaseLock()\n self._js_reader = None\n\n if self._js_writer is not None:\n self._js_writer.releaseLock()\n self._js_writer = None\n\n closing_task = None\n\n if self._port is not None:\n closing_task = asyncio.create_task(close_port(self._port))\n _SERIAL_PORT_CLOSING_TASKS.append(closing_task)\n self._port = None\n\n if self._protocol is not None:\n if closing_task is None:\n self._protocol.connection_lost(exception)\n else:\n closing_task.add_done_callback(\n lambda _, protocol=self._protocol: protocol.connection_lost(exception)\n )\n closing_task.add_done_callback(\n lambda _: _SERIAL_PORT_CLOSING_TASKS.remove(closing_task)\n )\n\n self._protocol = None\n\n def close(self) -> None:\n self._cleanup(None)\n\n\ndef set_global_serial_port(serial_port) -> None:\n global _SERIAL_PORT\n _SERIAL_PORT = serial_port\n\n\nasync def create_serial_connection(\n loop: asyncio.BaseEventLoop,\n protocol_factory: typing.Callable[[], asyncio.Protocol],\n url: str,\n *,\n parity=None,\n stopbits=None,\n baudrate: int,\n rtscts=False,\n xonxoff=False,\n) -> tuple[WebSerialTransport, asyncio.Protocol]:\n while _SERIAL_PORT_CLOSING_TASKS:\n _LOGGER.warning(\n "Serial connection was not closed before a new one was opened!"\n " Waiting before opening a new one."\n )\n await _SERIAL_PORT_CLOSING_TASKS.pop()\n\n # `url` is ignored, `_SERIAL_PORT` is used instead\n await _SERIAL_PORT.open(\n baudRate=baudrate,\n flowControl="hardware" if rtscts else None,\n )\n\n protocol = protocol_factory()\n transport = WebSerialTransport(loop, protocol, _SERIAL_PORT)\n\n return transport, protocol\n\n\n\n# Directly patch zigpy-serial\nimport zigpy.serial\nzigpy.serial.create_serial_connection = create_serial_connection\n';const Ae=[{package:"aiosignal",module:"aiosignal"},{package:"aiohttp",module:"aiohttp"},{package:"cffi",module:"cffi"},{package:"aiosqlite",module:"aiosqlite"},{package:"cryptography",module:"cryptography"},{package:"frozenlist",module:"frozenlist"},{package:"multidict",module:"multidict"},{package:"pycparser",module:"pycparser"},{package:"yarl",module:"yarl"},{package:"click",module:"click"},{package:"click-log",module:"click_log"},{package:"pure-pcapy3",module:"pure_pcapy3"},{package:"idna",module:"idna"},{package:"typing_extensions",module:"typing_extensions"},{package:"gpiod",module:"gpiod"},{package:"rpds",module:"rpds"},{package:"rpds-py",module:"rpds-py"},{package:"ssl",module:"ssl",version:"1.0.0"}],Ie=navigator.userAgent.toLowerCase().includes("win")?"\r\n":"\n";var Ne,Oe,Te;async function De(e){e(Ne.LOADING_PYODIDE);const t=await async function(){return new Promise(((e,t)=>{const i=document.createElement("script");i.onerror=e=>t(e),i.onload=async()=>{const t=await window.loadPyodide();e(t)},i.src="https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js",document.body.appendChild(i)}))}();e(Ne.INSTALLING_DEPENDENCIES),await t.loadPackage("micropip");const i=t.pyimport("micropip"),r=function(e){const t=new Map;for(const i of e.trim().split(Ie)){const[e,r]=i.split("==");t.set(e,r)}return t}(Ce);for(const e of Ae)i.add_mock_package.callKwargs({name:e.package,version:e.version||r.get(e.package),modules:new Map([[e.module,Le]])});i.add_mock_package.callKwargs({name:"webserial_transport",version:"1.0.0",modules:new Map([["webserial_transport",Re]])});const o=[];for(const[e,t]of r)Ae.find((t=>t.package===e))||o.push(`${e}==${t}`);await i.install.callKwargs({requirements:"./universal_silabs_flasher-0.0.25-py3-none-any.whl",deps:!1}),await i.install.callKwargs({requirements:o,deps:!1});return t.pyimport("coloredlogs").install.callKwargs({level:"DEBUG"}),e(Ne.READY),t}!function(e){e[e.LOADING_PYODIDE=0]="LOADING_PYODIDE",e[e.INSTALLING_DEPENDENCIES=1]="INSTALLING_DEPENDENCIES",e[e.READY=2]="READY"}(Ne||(Ne={})),function(e){e[e.IDLE=0]="IDLE",e[e.CONNECTING=1]="CONNECTING",e[e.FLASHING=2]="FLASHING"}(Oe||(Oe={})),function(e){e[e.IDLE=0]="IDLE",e[e.SELECTING_PORT=1]="SELECTING_PORT",e[e.PORT_SELECTION_CANCELLED=2]="PORT_SELECTION_CANCELLED",e[e.LOADING_PYODIDE=3]="LOADING_PYODIDE",e[e.PROBING=4]="PROBING",e[e.PROBING_COMPLETE=5]="PROBING_COMPLETE",e[e.PROBING_FAILED=6]="PROBING_FAILED",e[e.SELECT_FIRMWARE=7]="SELECT_FIRMWARE",e[e.INSTALLING=8]="INSTALLING",e[e.INSTALL_FAILED=9]="INSTALL_FAILED",e[e.DONE=10]="DONE"}(Te||(Te={}));let Pe=class extends c{constructor(){super(...arguments),this.flashingStep=Te.IDLE,this.pyodideLoadState=Ne.LOADING_PYODIDE,this.debugLog="",this.uploadProgress=0,this.progressState=Oe.IDLE}firstUpdated(e){super.firstUpdated(e),this.mwcDialog.addEventListener("close",this.close),this.selectSerialPort()}getFirmwareMetadata(){if(!this.selectedFirmware)return m``;let e;try{e=this.selectedFirmware.get_nabucasa_metadata()}catch(e){return m``}const t=e.fw_type.value;return t in ye&&(e.fw_type=ye[t]),m` + + + + + + + + + + + + + + + +
Type + ${we[e.fw_type.value]||"unknown"} +
SDK Version${this.simpleVersion(e.sdk_version)}
EZSP Version${this.simpleVersion(e.ezsp_version)||"-"}
+ `}generateProbeMethods(e){const t=new Map,i=[],r=Object.entries(fe).reduce(((e,[t,i])=>(e[i]=t,e)),{});return Object.keys(this.manifest.baudrates).forEach((o=>{const n=r[o],a=e[n];n&&a&&(i.push(a),t.set(a,this.manifest.baudrates[o]))})),{baudrates:t,probe_methods:i}}async selectSerialPort(){this.flashingStep=Te.SELECTING_PORT;const e={};this.manifest.usb_filters&&(e.filters=this.manifest.usb_filters.map((e=>({usbProductId:e.pid,usbVendorId:e.vid}))));try{this.serialPort=await navigator.serial.requestPort(e)}catch(e){return console.log(e),this.mwcDialog.open=!0,this.serialPort=void 0,void(this.flashingStep=Te.PORT_SELECTION_CANCELLED)}this.mwcDialog.open=!0,this.flashingStep=Te.LOADING_PYODIDE,this.pyodide=await De((e=>{this.pyodideLoadState=e})),await this.onPyodideLoaded()}async onPyodideLoaded(){this.pyodide.setStdout({batched:e=>{console.log(e),this.debugLog+=`${e}\n`}}),this.pyodide.setStderr({batched:e=>{console.warn(e),this.debugLog+=`${e}\n`}}),this.pyodide.pyimport("webserial_transport").set_global_serial_port(this.serialPort);const e=this.pyodide.pyimport("universal_silabs_flasher.const").ApplicationType,{baudrates:t,probe_methods:i}=this.generateProbeMethods(e);this.pyFlasher=this.pyodide.runPython("\n from universal_silabs_flasher.flasher import Flasher\n\n def create_flasher(baudrates, probe_methods, device):\n return Flasher(\n baudrates=baudrates.to_py(),\n probe_methods=probe_methods.to_py(),\n device=device,\n )\n\n create_flasher\n ").callKwargs({baudrates:t,probe_methods:i,device:"/dev/webserial"}),await this.detectRunningFirmware()}async detectRunningFirmware(){this.flashingStep=Te.PROBING;try{await this.pyFlasher.probe_app_type()}catch(e){return this.pyFlasher=void 0,this.serialPort=void 0,void(this.flashingStep=Te.PROBING_FAILED)}this.flashingStep=Te.PROBING_COMPLETE}selectFirmware(){this.flashingStep=Te.SELECT_FIRMWARE}onFirmwareLoaded(e){this.selectedFirmware=e.detail.firmware}async flashFirmware(){this.flashingStep=Te.INSTALLING,this.uploadProgress=0,await this.pyFlasher.enter_bootloader();try{await this.pyFlasher.flash_firmware.callKwargs(this.selectedFirmware,{progress_callback:(e,t)=>{this.uploadProgress=e/t}}),this.flashingStep=Te.DONE}catch(e){this.flashingStep=Te.INSTALL_FAILED}}async close(){this.serialPort&&await this.serialPort.close(),this.parentNode.removeChild(this)}showDebugLog(){!function(e,t=""){const i=document.createElement("a");i.target="_blank",i.href=e,i.download=t,document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click")),document.body.removeChild(i)}(`data:text/plain;charset=utf-8,${encodeURIComponent(this.debugLog)}`,"silabs_flasher.log")}formatHeadingText(e){return e.length<20?e:e+" ".repeat(8)}simpleVersion(e){return e?Array.from(e.components).map((e=>e.data)).join(""):null}render(){let e=m``,t="Connecting",i=!0,r=!0,o=!1;if(this.flashingStep===Te.SELECTING_PORT)this.mwcDialog&&(this.mwcDialog.open=!1),o=!0,i=!1,t="Select a serial port",e=m`

+

+

Plug in and select your ${this.manifest.product_name}

+

`;else if(this.flashingStep===Te.PORT_SELECTION_CANCELLED)i=!1,t="Serial port was not selected",e=m`

+ If you didn't select a serial port because the + ${this.manifest.product_name} was missing, make sure the USB port it's + plugged into works and the ${this.manifest.product_name} is detected + by your operating system. +

+

+ If you are using Windows or macOS, install the + Silicon Labs CP2102 driver. +

+ + + Retry + `;else if([Te.LOADING_PYODIDE,Te.PROBING].includes(this.flashingStep))o=!0,i=!1,t="",e=m`

+

+ + +

+

+ Connecting... +
+ This can take a few seconds. +

+

`;else if(this.flashingStep===Te.PROBING_FAILED){const i=navigator.userAgent.includes("Mac OS"),r=this.manifest.usb_filters.find((e=>4292==e.vid&&6e4==e.pid));t="Connection failed",e=m`${i&&r?m`
+

macOS Driver Bug

+ +

+ The built-in drivers on macOS do not work properly with the + ${this.manifest.product_name}. Install the updated + Silicon Labs CP2102 driver + and re-connect to the serial port titled + CP210x USB to UART Bridge Controller + (cu.SLAB_USBtoUART). +

+
`:""} +

The running firmware could not be detected.

+ +

+ Make sure the USB port works and if you are using a USB extension + cable, make sure the cable can transfer data. Unplug the + ${this.manifest.product_name} and plug it back in to reset and try + again. +

+ + + Retry + `}else if(this.flashingStep===Te.PROBING_COMPLETE){o=!0,i=!1,t=this.manifest.product_name;const{Version:r}=this.pyodide.pyimport("universal_silabs_flasher.common"),n=this.pyFlasher.app_type.value,a=xe[n],s=this.manifest.firmwares.find((e=>e.type===a&&r(e.version)>this.pyFlasher.app_version&&!r(e.version).compatible_with(this.pyFlasher.app_version)));let d;s&&(d=m`{const e=await fetch(s.url),t=await e.arrayBuffer();this.selectedFirmware=await ke(this.pyodide,t),this.flashFirmware()}} + > + + Upgrade to  ${s.version} + `),e=m` +

+ + + + + + + + + + + +
${_e[n]||"unknown"} ${this.simpleVersion(this.pyFlasher.app_version)}
${this.manifest.product_name}
+

+ +
+ ${d||""} + + + Change firmware + +
`}else this.flashingStep===Te.SELECT_FIRMWARE?(t=this.manifest.product_name,e=m` +

Select new firmware to install.

+ + + + ${this.selectedFirmware?m``:""} + + + Install + + `):this.flashingStep===Te.INSTALLING?(o=!0,r=!1,t="Installing firmware",e=m` +

+ The new firmware is now installing. Do not disconnect the + ${this.manifest.product_name} or close this browser window. +

+

+ Progress: ${(100*+this.uploadProgress).toFixed(1)}% + +

+ `):this.flashingStep===Te.INSTALL_FAILED?(t="Installation failed",e=m` +

+ Firmware installation failed. Unplug your + ${this.manifest.product_name} and plug it back in to retry. +

+ + + Retry + + `):this.flashingStep===Te.DONE&&(t="Installation success",e=m` +

Firmware has been successfully installed.

+ + + Continue + + `);return m` + + ${r?m` + + + + `:""} + ${e} + ${i?m` + + Debug Log + + `:""} + + `}};Pe.styles=u` + :host { + --mdc-theme-primary: #03a9f4; + } + + a { + color: var(--mdc-theme-primary); + } + + .metadata { + font-size: 0.8em; + } + + img { + vertical-align: middle; + } + + #closeButton { + position: absolute; + top: 10px; + right: 10px; + } + + p.spinner { + text-align: center; + font-size: 2em; + } + + p.firmware-metadata { + font-size: 0.8em; + line-height: 1.2; + overflow: auto; + } + + span.progress-text { + font-size: 0.8em; + } + + mwc-button usf-icon { + margin-right: 0.2em; + } + + #firmwareInstallButtons { + margin-left: -3px; + + text-align: left; + } + + #firmwareInstallButtons mwc-button { + display: block; + } + + #firmwareInstallButtons mwc-button:not(:last-child) { + margin-bottom: 0.3em; + } + + .centered { + text-align: center; + } + + td usf-icon { + vertical-align: bottom; + } + + section.warning { + background-color: hsl(38, 96%, 90%); + + font-size: 0.9em; + + margin-left: -24px; + margin-right: -24px; + + padding-left: 24px; + padding-right: 24px; + padding-top: 12px; + padding-bottom: 12px; + } + + section.warning h2 usf-icon { + vertical-align: text-bottom; + } + + section.warning code { + font-weight: bold; + } + `,i([s()],Pe.prototype,"flashingStep",void 0),i([r()],Pe.prototype,"pyodide",void 0),i([s()],Pe.prototype,"pyodideLoadState",void 0),i([r()],Pe.prototype,"manifest",void 0),i([s()],Pe.prototype,"selectedFirmware",void 0),i([s()],Pe.prototype,"serialPort",void 0),i([s()],Pe.prototype,"uploadProgress",void 0),i([s()],Pe.prototype,"progressState",void 0),i([n("mwc-dialog")],Pe.prototype,"mwcDialog",void 0),Pe=i([h("flashing-dialog")],Pe);export{Pe as FlashingDialog}; diff --git a/dist/web/nabucasa-zigbee-flasher.js b/dist/web/nabucasa-zigbee-flasher.js new file mode 100644 index 00000000..67114d9a --- /dev/null +++ b/dist/web/nabucasa-zigbee-flasher.js @@ -0,0 +1,46 @@ +var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};function e(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}var i=function(){return i=Object.assign||function(t){for(var e,i=1,r=arguments.length;i=0;s--)(o=t[s])&&(n=(a<3?o(n):a>3?o(e,i,n):o(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}function o(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],r=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}const a=window,n=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),d=new WeakMap;class c{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=d.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&d.set(e,t))}return t}toString(){return this.cssText}}const p=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,r)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1]),t[0]);return new c(i,t,s)},l=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new c("string"==typeof t?t:t+"",void 0,s))(e)})(t):t;var u;const h=window,m=h.trustedTypes,f=m?m.emptyScript:"",v=h.reactiveElementPolyfillSupport,g={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},b=(t,e)=>e!==t&&(e==e||t==t),y={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:b};class x extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const r=this._$Ep(i,e);void 0!==r&&(this._$Ev.set(r,i),t.push(r))})),t}static createProperty(t,e=y){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,r=this.getPropertyDescriptor(t,i,e);void 0!==r&&Object.defineProperty(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(r){const o=this[t];this[e]=r,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||y}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{n?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),r=a.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,t.appendChild(i)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=y){var r;const o=this.constructor._$Ep(t,i);if(void 0!==o&&!0===i.reflect){const a=(void 0!==(null===(r=i.converter)||void 0===r?void 0:r.toAttribute)?i.converter:g).toAttribute(e,i.type);this._$El=t,null==a?this.removeAttribute(o):this.setAttribute(o,a),this._$El=null}}_$AK(t,e){var i;const r=this.constructor,o=r._$Ev.get(t);if(void 0!==o&&this._$El!==o){const t=r.getPropertyOptions(o),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:g;this._$El=o,this[o]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let r=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||b)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):r=!1),!this.isUpdatePending&&r&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var _;x.finalized=!0,x.elementProperties=new Map,x.elementStyles=[],x.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:x}),(null!==(u=h.reactiveElementVersions)&&void 0!==u?u:h.reactiveElementVersions=[]).push("1.6.1");const A=window,w=A.trustedTypes,$=w?w.createPolicy("lit-html",{createHTML:t=>t}):void 0,E=`lit$${(Math.random()+"").slice(9)}$`,S="?"+E,C=`<${S}>`,R=document,k=(t="")=>R.createComment(t),T=t=>null===t||"object"!=typeof t&&"function"!=typeof t,H=Array.isArray,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,I=/>/g,z=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),F=/'/g,D=/"/g,U=/^(?:script|style|textarea|title)$/i,N=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),M=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),L=new WeakMap,V=R.createTreeWalker(R,129,null,!1),j=(t,e)=>{const i=t.length-1,r=[];let o,a=2===e?"":"",n=P;for(let e=0;e"===d[0]?(n=null!=o?o:P,c=-1):void 0===d[1]?c=-2:(c=n.lastIndex-d[2].length,s=d[1],n=void 0===d[3]?z:'"'===d[3]?D:F):n===D||n===F?n=z:n===O||n===I?n=P:(n=z,o=void 0);const l=n===z&&t[e+1].startsWith("/>")?" ":"";a+=n===P?i+C:c>=0?(r.push(s),i.slice(0,c)+"$lit$"+i.slice(c)+E+l):i+E+(-2===c?(r.push(void 0),e):l)}const s=a+(t[i]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==$?$.createHTML(s):s,r]};class G{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,a=0;const n=t.length-1,s=this.parts,[d,c]=j(t,e);if(this.el=G.createElement(d,i),V.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=V.nextNode())&&s.length0){r.textContent=w?w.emptyScript:"";for(let i=0;iH(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==B&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(R.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:r}=t,o="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=G.createElement(r.h,this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.p(i);else{const t=new W(o,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=L.get(t.strings);return void 0===e&&L.set(t.strings,e=new G(t)),e}k(t){H(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const o of t)r===e.length?e.push(i=new X(this.O(k()),this.O(k()),this,this.options)):i=e[r],i._$AI(o),r++;r2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=B}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,r){const o=this.strings;let a=!1;if(void 0===o)t=q(this,t,e,0),a=!T(t)||t!==this._$AH&&t!==M,a&&(this._$AH=t);else{const r=t;let n,s;for(t=o[0],n=0;n{var r,o;const a=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:e;let n=a._$litPart$;if(void 0===n){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;a._$litPart$=n=new X(e.insertBefore(k(),t),t,void 0,null!=i?i:{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return M}}ot.finalized=!0,ot._$litElement$=!0,null===(it=globalThis.litElementHydrateSupport)||void 0===it||it.call(globalThis,{LitElement:ot});const at=globalThis.litElementPolyfillSupport;null==at||at({LitElement:ot}),(null!==(rt=globalThis.litElementVersions)&&void 0!==rt?rt:globalThis.litElementVersions=[]).push("3.2.2");const nt=t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:r}=e;return{kind:i,elements:r,finisher(e){customElements.define(t,e)}}})(t,e),st=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function dt(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):st(t,e)}function ct(t){return dt({...t,state:!0})}const pt=({finisher:t,descriptor:e})=>(i,r)=>{var o;if(void 0===r){const r=null!==(o=i.originalKey)&&void 0!==o?o:i.key,a=null!=e?{kind:"method",placement:"prototype",key:r,descriptor:e(i.key)}:{...i,key:r};return null!=t&&(a.finisher=function(e){t(e,r)}),a}{const o=i.constructor;void 0!==e&&Object.defineProperty(i,r,e(r)),null==t||t(o,r)}};function lt(t){return pt({finisher:(e,i)=>{Object.assign(e.prototype[i],t)}})}function ut(t,e){return pt({descriptor:i=>{const r={get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==i?i:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof i?Symbol():"__"+i;r.get=function(){var i,r;return void 0===this[e]&&(this[e]=null!==(r=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==r?r:null),this[e]}}return r}})}function ht(t){return pt({descriptor:e=>({async get(){var e;return await this.updateComplete,null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0})})}var mt;const ft=null!=(null===(mt=window.HTMLSlotElement)||void 0===mt?void 0:mt.prototype.assignedElements)?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE));function vt(t){const{slot:e,selector:i}=null!=t?t:{};return pt({descriptor:r=>({get(){var r;const o="slot"+(e?`[name=${e}]`:":not([name])"),a=null===(r=this.renderRoot)||void 0===r?void 0:r.querySelector(o),n=null!=a?ft(a,t):[];return i?n.filter((t=>t.matches(i))):n},enumerable:!0,configurable:!0})})}const gt=p`:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}`;let bt=class extends ot{render(){return N``}};function yt(t,e){if(t.closest)return t.closest(e);for(var i=t;i;){if(xt(i,e))return i;i=i.parentElement}return null}function xt(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}function _t(t){return{addClass:e=>{t.classList.add(e)},removeClass:e=>{t.classList.remove(e)},hasClass:e=>t.classList.contains(e)}}bt.styles=[gt],bt=r([nt("mwc-icon")],bt);const At=()=>{},wt={get passive(){return!1}};document.addEventListener("x",At,wt),document.removeEventListener("x",At);class $t extends ot{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}var Et=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),St={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},Ct={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},Rt={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};var kt=["touchstart","pointerdown","mousedown","keydown"],Tt=["touchend","pointerup","mouseup","contextmenu"],Ht=[],Pt=function(t){function r(e){var o=t.call(this,i(i({},r.defaultAdapter),e))||this;return o.activationAnimationHasEnded=!1,o.activationTimer=0,o.fgDeactivationRemovalTimer=0,o.fgScale="0",o.frame={width:0,height:0},o.initialSize=0,o.layoutFrame=0,o.maxRadius=0,o.unboundedCoords={left:0,top:0},o.activationState=o.defaultActivationState(),o.activationTimerCallback=function(){o.activationAnimationHasEnded=!0,o.runDeactivationUXLogicIfReady()},o.activateHandler=function(t){o.activateImpl(t)},o.deactivateHandler=function(){o.deactivateImpl()},o.focusHandler=function(){o.handleFocus()},o.blurHandler=function(){o.handleBlur()},o.resizeHandler=function(){o.layout()},o}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return St},enumerable:!1,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return Ct},enumerable:!1,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return Rt},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),r.prototype.init=function(){var t=this,e=this.supportsPressRipple();if(this.registerRootHandlers(e),e){var i=r.cssClasses,o=i.ROOT,a=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(o),t.adapter.isUnbounded()&&(t.adapter.addClass(a),t.layoutInternal())}))}},r.prototype.destroy=function(){var t=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(r.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(r.cssClasses.FG_DEACTIVATION));var e=r.cssClasses,i=e.ROOT,o=e.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(i),t.adapter.removeClass(o),t.removeCssVars()}))}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},r.prototype.activate=function(t){this.activateImpl(t)},r.prototype.deactivate=function(){this.deactivateImpl()},r.prototype.layout=function(){var t=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame((function(){t.layoutInternal(),t.layoutFrame=0}))},r.prototype.setUnbounded=function(t){var e=r.cssClasses.UNBOUNDED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},r.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(r.cssClasses.BG_FOCUSED)}))},r.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(r.cssClasses.BG_FOCUSED)}))},r.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},r.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},r.prototype.registerRootHandlers=function(t){var e,i;if(t){try{for(var r=o(kt),a=r.next();!a.done;a=r.next()){var n=a.value;this.adapter.registerInteractionHandler(n,this.activateHandler)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},r.prototype.registerDeactivationHandlers=function(t){var e,i;if("keydown"===t.type)this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var r=o(Tt),a=r.next();!a.done;a=r.next()){var n=a.value;this.adapter.registerDocumentInteractionHandler(n,this.deactivateHandler)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}},r.prototype.deregisterRootHandlers=function(){var t,e;try{for(var i=o(kt),r=i.next();!r.done;r=i.next()){var a=r.value;this.adapter.deregisterInteractionHandler(a,this.activateHandler)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},r.prototype.deregisterDeactivationHandlers=function(){var t,e;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var i=o(Tt),r=i.next();!r.done;r=i.next()){var a=r.value;this.adapter.deregisterDocumentInteractionHandler(a,this.deactivateHandler)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},r.prototype.removeCssVars=function(){var t=this,e=r.strings;Object.keys(e).forEach((function(i){0===i.indexOf("VAR_")&&t.adapter.updateCssVariable(e[i],null)}))},r.prototype.activateImpl=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState;if(!i.isActivated){var r=this.previousActivationEvent;if(!(r&&void 0!==t&&r.type!==t.type))i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&(void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type)),void 0!==t&&Ht.length>0&&Ht.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState():(void 0!==t&&(Ht.push(t.target),this.registerDeactivationHandlers(t)),i.wasElementMadeActive=this.checkElementMadeActive(t),i.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame((function(){Ht=[],i.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(i.wasElementMadeActive=e.checkElementMadeActive(t),i.wasElementMadeActive&&e.animateActivation()),i.wasElementMadeActive||(e.activationState=e.defaultActivationState())})))}}},r.prototype.checkElementMadeActive=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},r.prototype.animateActivation=function(){var t=this,e=r.strings,i=e.VAR_FG_TRANSLATE_START,o=e.VAR_FG_TRANSLATE_END,a=r.cssClasses,n=a.FG_DEACTIVATION,s=a.FG_ACTIVATION,d=r.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var c="",p="";if(!this.adapter.isUnbounded()){var l=this.getFgTranslationCoordinates(),u=l.startPoint,h=l.endPoint;c=u.x+"px, "+u.y+"px",p=h.x+"px, "+h.y+"px"}this.adapter.updateCssVariable(i,c),this.adapter.updateCssVariable(o,p),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(n),this.adapter.computeBoundingRect(),this.adapter.addClass(s),this.activationTimer=setTimeout((function(){t.activationTimerCallback()}),d)},r.prototype.getFgTranslationCoordinates=function(){var t,e=this.activationState,i=e.activationEvent;return t=e.wasActivatedByPointer?function(t,e,i){if(!t)return{x:0,y:0};var r,o,a=e.x,n=e.y,s=a+i.left,d=n+i.top;if("touchstart"===t.type){var c=t;r=c.changedTouches[0].pageX-s,o=c.changedTouches[0].pageY-d}else{var p=t;r=p.pageX-s,o=p.pageY-d}return{x:r,y:o}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame.width/2,y:this.frame.height/2},{startPoint:t={x:t.x-this.initialSize/2,y:t.y-this.initialSize/2},endPoint:{x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2}}},r.prototype.runDeactivationUXLogicIfReady=function(){var t=this,e=r.cssClasses.FG_DEACTIVATION,i=this.activationState,o=i.hasDeactivationUXRun,a=i.isActivated;(o||!a)&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(e),this.fgDeactivationRemovalTimer=setTimeout((function(){t.adapter.removeClass(e)}),Rt.FG_DEACTIVATION_MS))},r.prototype.rmBoundedActivationClasses=function(){var t=r.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},r.prototype.resetActivationState=function(){var t=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout((function(){return t.previousActivationEvent=void 0}),r.numbers.TAP_DELAY_MS)},r.prototype.deactivateImpl=function(){var t=this,e=this.activationState;if(e.isActivated){var r=i({},e);e.isProgrammatic?(requestAnimationFrame((function(){t.animateDeactivation(r)})),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame((function(){t.activationState.hasDeactivationUXRun=!0,t.animateDeactivation(r),t.resetActivationState()})))}},r.prototype.animateDeactivation=function(t){var e=t.wasActivatedByPointer,i=t.wasElementMadeActive;(e||i)&&this.runDeactivationUXLogicIfReady()},r.prototype.layoutInternal=function(){var t=this;this.frame=this.adapter.computeBoundingRect();var e=Math.max(this.frame.height,this.frame.width);this.maxRadius=this.adapter.isUnbounded()?e:Math.sqrt(Math.pow(t.frame.width,2)+Math.pow(t.frame.height,2))+r.numbers.PADDING;var i=Math.floor(e*r.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&i%2!=0?this.initialSize=i-1:this.initialSize=i,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},r.prototype.updateLayoutCssVars=function(){var t=r.strings,e=t.VAR_FG_SIZE,i=t.VAR_LEFT,o=t.VAR_TOP,a=t.VAR_FG_SCALE;this.adapter.updateCssVariable(e,this.initialSize+"px"),this.adapter.updateCssVariable(a,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(i,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(o,this.unboundedCoords.top+"px"))},r}(Et),Ot=Pt;const It=1,zt=t=>(...e)=>({_$litDirective$:t,values:e});class Ft{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const Dt=zt(class extends Ft{constructor(t){var e;if(super(t),t.type!==It||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,r;if(void 0===this.nt){this.nt=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.st)||void 0===i?void 0:i.has(t))&&this.nt.add(t);return this.render(e)}const o=t.element.classList;this.nt.forEach((t=>{t in e||(o.remove(t),this.nt.delete(t))}));for(const t in e){const i=!!e[t];i===this.nt.has(t)||(null===(r=this.st)||void 0===r?void 0:r.has(t))||(i?(o.add(t),this.nt.add(t)):(o.remove(t),this.nt.delete(t)))}return M}}),Ut=zt(class extends Ft{constructor(t){var e;if(super(t),t.type!==It||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const r=t[i];return null==r?e:e+`${i=i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.vt){this.vt=new Set;for(const t in e)this.vt.add(t);return this.render(e)}this.vt.forEach((t=>{null==e[t]&&(this.vt.delete(t),t.includes("-")?i.removeProperty(t):i[t]="")}));for(const t in e){const r=e[t];null!=r&&(this.vt.add(t),t.includes("-")?i.setProperty(t,r):i[t]=r)}return M}});class Nt extends $t{constructor(){super(...arguments),this.primary=!1,this.accent=!1,this.unbounded=!1,this.disabled=!1,this.activated=!1,this.selected=!1,this.internalUseStateLayerCustomProperties=!1,this.hovering=!1,this.bgFocused=!1,this.fgActivation=!1,this.fgDeactivation=!1,this.fgScale="",this.fgSize="",this.translateStart="",this.translateEnd="",this.leftPos="",this.topPos="",this.mdcFoundationClass=Ot}get isActive(){return xt(this.parentElement||this,":active")}createAdapter(){return{browserSupportsCssVars:()=>!0,isUnbounded:()=>this.unbounded,isSurfaceActive:()=>this.isActive,isSurfaceDisabled:()=>this.disabled,addClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!0;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!0;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!0}},removeClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!1;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!1;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!1}},containsEventTarget:()=>!0,registerInteractionHandler:()=>{},deregisterInteractionHandler:()=>{},registerDocumentInteractionHandler:()=>{},deregisterDocumentInteractionHandler:()=>{},registerResizeHandler:()=>{},deregisterResizeHandler:()=>{},updateCssVariable:(t,e)=>{switch(t){case"--mdc-ripple-fg-scale":this.fgScale=e;break;case"--mdc-ripple-fg-size":this.fgSize=e;break;case"--mdc-ripple-fg-translate-end":this.translateEnd=e;break;case"--mdc-ripple-fg-translate-start":this.translateStart=e;break;case"--mdc-ripple-left":this.leftPos=e;break;case"--mdc-ripple-top":this.topPos=e}},computeBoundingRect:()=>(this.parentElement||this).getBoundingClientRect(),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset})}}startPress(t){this.waitForFoundation((()=>{this.mdcFoundation.activate(t)}))}endPress(){this.waitForFoundation((()=>{this.mdcFoundation.deactivate()}))}startFocus(){this.waitForFoundation((()=>{this.mdcFoundation.handleFocus()}))}endFocus(){this.waitForFoundation((()=>{this.mdcFoundation.handleBlur()}))}startHover(){this.hovering=!0}endHover(){this.hovering=!1}waitForFoundation(t){this.mdcFoundation?t():this.updateComplete.then(t)}update(t){t.has("disabled")&&this.disabled&&this.endHover(),super.update(t)}render(){const t=this.activated&&(this.primary||!this.accent),e=this.selected&&(this.primary||!this.accent),i={"mdc-ripple-surface--accent":this.accent,"mdc-ripple-surface--primary--activated":t,"mdc-ripple-surface--accent--activated":this.accent&&this.activated,"mdc-ripple-surface--primary--selected":e,"mdc-ripple-surface--accent--selected":this.accent&&this.selected,"mdc-ripple-surface--disabled":this.disabled,"mdc-ripple-surface--hover":this.hovering,"mdc-ripple-surface--primary":this.primary,"mdc-ripple-surface--selected":this.selected,"mdc-ripple-upgraded--background-focused":this.bgFocused,"mdc-ripple-upgraded--foreground-activation":this.fgActivation,"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation,"mdc-ripple-upgraded--unbounded":this.unbounded,"mdc-ripple-surface--internal-use-state-layer-custom-properties":this.internalUseStateLayerCustomProperties};return N` +
`}}r([ut(".mdc-ripple-surface")],Nt.prototype,"mdcRoot",void 0),r([dt({type:Boolean})],Nt.prototype,"primary",void 0),r([dt({type:Boolean})],Nt.prototype,"accent",void 0),r([dt({type:Boolean})],Nt.prototype,"unbounded",void 0),r([dt({type:Boolean})],Nt.prototype,"disabled",void 0),r([dt({type:Boolean})],Nt.prototype,"activated",void 0),r([dt({type:Boolean})],Nt.prototype,"selected",void 0),r([dt({type:Boolean})],Nt.prototype,"internalUseStateLayerCustomProperties",void 0),r([ct()],Nt.prototype,"hovering",void 0),r([ct()],Nt.prototype,"bgFocused",void 0),r([ct()],Nt.prototype,"fgActivation",void 0),r([ct()],Nt.prototype,"fgDeactivation",void 0),r([ct()],Nt.prototype,"fgScale",void 0),r([ct()],Nt.prototype,"fgSize",void 0),r([ct()],Nt.prototype,"translateStart",void 0),r([ct()],Nt.prototype,"translateEnd",void 0),r([ct()],Nt.prototype,"leftPos",void 0),r([ct()],Nt.prototype,"topPos",void 0);const Mt=p`.mdc-ripple-surface{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:block}:host .mdc-ripple-surface{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;will-change:unset}.mdc-ripple-surface--primary::before,.mdc-ripple-surface--primary::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary:hover::before,.mdc-ripple-surface--primary.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--primary.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before,.mdc-ripple-surface--primary--activated::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--activated:hover::before,.mdc-ripple-surface--primary--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--primary--selected::before,.mdc-ripple-surface--primary--selected::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--selected:hover::before,.mdc-ripple-surface--primary--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent::before,.mdc-ripple-surface--accent::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent:hover::before,.mdc-ripple-surface--accent.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--accent.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before,.mdc-ripple-surface--accent--activated::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--activated:hover::before,.mdc-ripple-surface--accent--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--accent--selected::before,.mdc-ripple-surface--accent--selected::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--selected:hover::before,.mdc-ripple-surface--accent--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--disabled{opacity:0}.mdc-ripple-surface--internal-use-state-layer-custom-properties::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties::after{background-color:#000;background-color:var(--mdc-ripple-hover-state-layer-color, #000)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:hover::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-state-layer-opacity, 0.04)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}`;let Bt=class extends Nt{};function Lt(t,e,i){if(void 0!==e)return function(t,e,i){const r=t.constructor;if(!i){const t=`__${e}`;if(!(i=r.getPropertyDescriptor(e,t)))throw new Error("@ariaProperty must be used after a @property decorator")}const o=i;let a="";if(!o.set)throw new Error(`@ariaProperty requires a setter for ${e}`);if(t.dispatchWizEvent)return i;const n={configurable:!0,enumerable:!0,set(t){if(""===a){const t=r.getPropertyOptions(e);a="string"==typeof t.attribute?t.attribute:e}this.hasAttribute(a)&&this.removeAttribute(a),o.set.call(this,t)}};return o.get&&(n.get=function(){return o.get.call(this)}),n}(t,e,i);throw new Error("@ariaProperty only supports TypeScript Decorators")}Bt.styles=[Mt],Bt=r([nt("mwc-ripple")],Bt);class Vt{constructor(t){this.startPress=e=>{t().then((t=>{t&&t.startPress(e)}))},this.endPress=()=>{t().then((t=>{t&&t.endPress()}))},this.startFocus=()=>{t().then((t=>{t&&t.startFocus()}))},this.endFocus=()=>{t().then((t=>{t&&t.endFocus()}))},this.startHover=()=>{t().then((t=>{t&&t.startHover()}))},this.endHover=()=>{t().then((t=>{t&&t.endHover()}))}}}const jt=t=>null!=t?t:B;class Gt extends ot{constructor(){super(...arguments),this.raised=!1,this.unelevated=!1,this.outlined=!1,this.dense=!1,this.disabled=!1,this.trailingIcon=!1,this.fullwidth=!1,this.icon="",this.label="",this.expandContent=!1,this.shouldRenderRipple=!1,this.rippleHandlers=new Vt((()=>(this.shouldRenderRipple=!0,this.ripple)))}renderOverlay(){return N``}renderRipple(){const t=this.raised||this.unelevated;return this.shouldRenderRipple?N``:""}focus(){const t=this.buttonElement;t&&(this.rippleHandlers.startFocus(),t.focus())}blur(){const t=this.buttonElement;t&&(this.rippleHandlers.endFocus(),t.blur())}getRenderClasses(){return{"mdc-button--raised":this.raised,"mdc-button--unelevated":this.unelevated,"mdc-button--outlined":this.outlined,"mdc-button--dense":this.dense}}render(){return N` + `}renderIcon(){return N` + + ${this.icon} + `}handleRippleActivate(t){const e=()=>{window.removeEventListener("mouseup",e),this.handleRippleDeactivate()};window.addEventListener("mouseup",e),this.rippleHandlers.startPress(t)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}Gt.shadowRootOptions={mode:"open",delegatesFocus:!0},r([Lt,dt({type:String,attribute:"aria-haspopup"})],Gt.prototype,"ariaHasPopup",void 0),r([dt({type:Boolean,reflect:!0})],Gt.prototype,"raised",void 0),r([dt({type:Boolean,reflect:!0})],Gt.prototype,"unelevated",void 0),r([dt({type:Boolean,reflect:!0})],Gt.prototype,"outlined",void 0),r([dt({type:Boolean})],Gt.prototype,"dense",void 0),r([dt({type:Boolean,reflect:!0})],Gt.prototype,"disabled",void 0),r([dt({type:Boolean,attribute:"trailingicon"})],Gt.prototype,"trailingIcon",void 0),r([dt({type:Boolean,reflect:!0})],Gt.prototype,"fullwidth",void 0),r([dt({type:String})],Gt.prototype,"icon",void 0),r([dt({type:String})],Gt.prototype,"label",void 0),r([dt({type:Boolean})],Gt.prototype,"expandContent",void 0),r([ut("#button")],Gt.prototype,"buttonElement",void 0),r([ht("mwc-ripple")],Gt.prototype,"ripple",void 0),r([ct()],Gt.prototype,"shouldRenderRipple",void 0),r([lt({passive:!0})],Gt.prototype,"handleRippleActivate",null);const qt=p`.mdc-button{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-button-font-size, 0.875rem);line-height:2.25rem;line-height:var(--mdc-typography-button-line-height, 2.25rem);font-weight:500;font-weight:var(--mdc-typography-button-font-weight, 500);letter-spacing:0.0892857143em;letter-spacing:var(--mdc-typography-button-letter-spacing, 0.0892857143em);text-decoration:none;text-decoration:var(--mdc-typography-button-text-decoration, none);text-transform:uppercase;text-transform:var(--mdc-typography-button-text-transform, uppercase)}.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:0;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:#fff;background-color:var(--mdc-elevation-overlay-color, #fff)}.mdc-button{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;user-select:none;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:transparent}.mdc-button .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button .mdc-button__icon{margin-left:0;margin-right:8px;display:inline-block;position:relative;vertical-align:top}[dir=rtl] .mdc-button .mdc-button__icon,.mdc-button .mdc-button__icon[dir=rtl]{margin-left:8px;margin-right:0}.mdc-button .mdc-button__label{position:relative}.mdc-button .mdc-button__focus-ring{display:none}@media screen and (forced-colors: active){.mdc-button.mdc-ripple-upgraded--background-focused .mdc-button__focus-ring,.mdc-button:not(.mdc-ripple-upgraded):focus .mdc-button__focus-ring{pointer-events:none;border:2px solid transparent;border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc( 100% + 4px );width:calc( 100% + 4px );display:block}}@media screen and (forced-colors: active)and (forced-colors: active){.mdc-button.mdc-ripple-upgraded--background-focused .mdc-button__focus-ring,.mdc-button:not(.mdc-ripple-upgraded):focus .mdc-button__focus-ring{border-color:CanvasText}}@media screen and (forced-colors: active){.mdc-button.mdc-ripple-upgraded--background-focused .mdc-button__focus-ring::after,.mdc-button:not(.mdc-ripple-upgraded):focus .mdc-button__focus-ring::after{content:"";border:2px solid transparent;border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}}@media screen and (forced-colors: active)and (forced-colors: active){.mdc-button.mdc-ripple-upgraded--background-focused .mdc-button__focus-ring::after,.mdc-button:not(.mdc-ripple-upgraded):focus .mdc-button__focus-ring::after{border-color:CanvasText}}.mdc-button .mdc-button__touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}.mdc-button__label+.mdc-button__icon{margin-left:8px;margin-right:0}[dir=rtl] .mdc-button__label+.mdc-button__icon,.mdc-button__label+.mdc-button__icon[dir=rtl]{margin-left:0;margin-right:8px}svg.mdc-button__icon{fill:currentColor}.mdc-button--touch{margin-top:6px;margin-bottom:6px}.mdc-button{padding:0 8px 0 8px}.mdc-button--unelevated{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--unelevated.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--unelevated.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--raised{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);padding:0 16px 0 16px}.mdc-button--raised.mdc-button--icon-trailing{padding:0 12px 0 16px}.mdc-button--raised.mdc-button--icon-leading{padding:0 16px 0 12px}.mdc-button--outlined{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button--outlined .mdc-button__ripple{border-style:solid;border-color:transparent}.mdc-button{height:36px;border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-button:not(:disabled){color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}.mdc-button:disabled{color:rgba(0, 0, 0, 0.38)}.mdc-button .mdc-button__icon{font-size:1.125rem;width:1.125rem;height:1.125rem}.mdc-button .mdc-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-button--raised,.mdc-button--unelevated{height:36px;border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-button--raised:not(:disabled),.mdc-button--unelevated:not(:disabled){background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee)}.mdc-button--raised:disabled,.mdc-button--unelevated:disabled{background-color:rgba(0, 0, 0, 0.12)}.mdc-button--raised:not(:disabled),.mdc-button--unelevated:not(:disabled){color:#fff;color:var(--mdc-theme-on-primary, #fff)}.mdc-button--raised:disabled,.mdc-button--unelevated:disabled{color:rgba(0, 0, 0, 0.38)}.mdc-button--raised .mdc-button__icon,.mdc-button--unelevated .mdc-button__icon{font-size:1.125rem;width:1.125rem;height:1.125rem}.mdc-button--raised .mdc-button__ripple,.mdc-button--unelevated .mdc-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-button--outlined{height:36px;border-radius:4px;border-radius:var(--mdc-shape-small, 4px);padding:0 15px 0 15px;border-width:1px}.mdc-button--outlined:not(:disabled){color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}.mdc-button--outlined:disabled{color:rgba(0, 0, 0, 0.38)}.mdc-button--outlined .mdc-button__icon{font-size:1.125rem;width:1.125rem;height:1.125rem}.mdc-button--outlined .mdc-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-button--outlined:not(:disabled){border-color:rgba(0, 0, 0, 0.12)}.mdc-button--outlined:disabled{border-color:rgba(0, 0, 0, 0.12)}.mdc-button--outlined.mdc-button--icon-trailing{padding:0 11px 0 15px}.mdc-button--outlined.mdc-button--icon-leading{padding:0 15px 0 11px}.mdc-button--outlined .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px;border-width:1px}.mdc-button--outlined .mdc-button__touch{left:calc(-1 * 1px);width:calc(100% + 2 * 1px)}.mdc-button--raised{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2),0px 2px 2px 0px rgba(0, 0, 0, 0.14),0px 1px 5px 0px rgba(0,0,0,.12);transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button--raised:hover,.mdc-button--raised:focus{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2),0px 4px 5px 0px rgba(0, 0, 0, 0.14),0px 1px 10px 0px rgba(0,0,0,.12)}.mdc-button--raised:active{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2),0px 8px 10px 1px rgba(0, 0, 0, 0.14),0px 3px 14px 2px rgba(0,0,0,.12)}.mdc-button--raised:disabled{box-shadow:0px 0px 0px 0px rgba(0, 0, 0, 0.2),0px 0px 0px 0px rgba(0, 0, 0, 0.14),0px 0px 0px 0px rgba(0,0,0,.12)}:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:transparent;vertical-align:top}:host([fullwidth]){width:100%}:host([raised]),:host([unelevated]){--mdc-ripple-color:#fff;--mdc-ripple-focus-opacity:0.24;--mdc-ripple-hover-opacity:0.08;--mdc-ripple-press-opacity:0.24}.trailing-icon ::slotted(*),.trailing-icon .mdc-button__icon,.leading-icon ::slotted(*),.leading-icon .mdc-button__icon{margin-left:0;margin-right:8px;display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}[dir=rtl] .trailing-icon ::slotted(*),[dir=rtl] .trailing-icon .mdc-button__icon,[dir=rtl] .leading-icon ::slotted(*),[dir=rtl] .leading-icon .mdc-button__icon,.trailing-icon ::slotted(*[dir=rtl]),.trailing-icon .mdc-button__icon[dir=rtl],.leading-icon ::slotted(*[dir=rtl]),.leading-icon .mdc-button__icon[dir=rtl]{margin-left:8px;margin-right:0}.trailing-icon ::slotted(*),.trailing-icon .mdc-button__icon{margin-left:8px;margin-right:0}[dir=rtl] .trailing-icon ::slotted(*),[dir=rtl] .trailing-icon .mdc-button__icon,.trailing-icon ::slotted(*[dir=rtl]),.trailing-icon .mdc-button__icon[dir=rtl]{margin-left:0;margin-right:8px}.slot-container{display:inline-flex;align-items:center;justify-content:center}.slot-container.flex{flex:auto}.mdc-button{flex:auto;overflow:hidden;padding-left:8px;padding-left:var(--mdc-button-horizontal-padding, 8px);padding-right:8px;padding-right:var(--mdc-button-horizontal-padding, 8px)}.mdc-button--raised{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mdc-button--raised:focus{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow-focus, var(--mdc-button-raised-box-shadow-hover, 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12)))}.mdc-button--raised:hover{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow-hover, 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12))}.mdc-button--raised:active{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow-active, 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12))}.mdc-button--raised:disabled{box-shadow:0px 0px 0px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 0px rgba(0, 0, 0, 0.14), 0px 0px 0px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow-disabled, 0px 0px 0px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 0px rgba(0, 0, 0, 0.14), 0px 0px 0px 0px rgba(0, 0, 0, 0.12))}.mdc-button--raised,.mdc-button--unelevated{padding-left:16px;padding-left:var(--mdc-button-horizontal-padding, 16px);padding-right:16px;padding-right:var(--mdc-button-horizontal-padding, 16px)}.mdc-button--outlined{border-width:1px;border-width:var(--mdc-button-outline-width, 1px);padding-left:calc(16px - 1px);padding-left:calc(var(--mdc-button-horizontal-padding, 16px) - var(--mdc-button-outline-width, 1px));padding-right:calc(16px - 1px);padding-right:calc(var(--mdc-button-horizontal-padding, 16px) - var(--mdc-button-outline-width, 1px))}.mdc-button--outlined:not(:disabled){border-color:rgba(0, 0, 0, 0.12);border-color:var(--mdc-button-outline-color, rgba(0, 0, 0, 0.12))}.mdc-button--outlined .ripple{top:calc(-1 * 1px);top:calc(-1 * var(--mdc-button-outline-width, 1px));left:calc(-1 * 1px);left:calc(-1 * var(--mdc-button-outline-width, 1px));right:initial;right:initial;border-width:1px;border-width:var(--mdc-button-outline-width, 1px);border-style:solid;border-color:transparent}[dir=rtl] .mdc-button--outlined .ripple,.mdc-button--outlined .ripple[dir=rtl]{left:initial;left:initial;right:calc(-1 * 1px);right:calc(-1 * var(--mdc-button-outline-width, 1px))}.mdc-button--dense{height:28px;margin-top:0;margin-bottom:0}.mdc-button--dense .mdc-button__touch{height:100%}:host([disabled]){pointer-events:none}:host([disabled]) .mdc-button{color:rgba(0, 0, 0, 0.38);color:var(--mdc-button-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-button--raised,:host([disabled]) .mdc-button--unelevated{background-color:rgba(0, 0, 0, 0.12);background-color:var(--mdc-button-disabled-fill-color, rgba(0, 0, 0, 0.12))}:host([disabled]) .mdc-button--outlined{border-color:rgba(0, 0, 0, 0.12);border-color:var(--mdc-button-disabled-outline-color, rgba(0, 0, 0, 0.12))}`;let Wt=class extends Gt{};Wt.styles=[qt],Wt=r([nt("mwc-button")],Wt);let Xt=class extends ot{async openFlasherDialog(){import("./flashing-dialog-12652b5a.js");const t=await fetch(this.manifest),e=await t.json(),i=document.createElement("flashing-dialog");i.manifest=e,document.body.appendChild(i)}render(){const t="serial"in navigator;return N` + ${t?N`Connect`:N` + Unfortunately, your browser does not support Web Serial. Open this + page in Google Chrome or Microsoft Edge. + `} + `}};r([dt()],Xt.prototype,"manifest",void 0),Xt=r([nt("nabucasa-zigbee-flasher")],Xt);export{$t as B,Et as M,Vt as R,r as _,Lt as a,ht as b,lt as c,jt as d,dt as e,p as f,nt as g,Dt as h,ut as i,Ut as j,e as k,vt as l,i as m,_t as n,pt as o,xt as p,yt as q,ot as s,ct as t,N as y}; diff --git a/dist/webserial_transport.py b/dist/webserial_transport.py new file mode 100644 index 00000000..9ef8867f --- /dev/null +++ b/dist/webserial_transport.py @@ -0,0 +1,178 @@ +from __future__ import annotations + +import asyncio +import collections.abc +import logging +import sys +import typing + +import js + +# Patch some built-in modules so that pyserial imports +try: + import fcntl # noqa: F401 +except ImportError: + sys.modules["fcntl"] = object() # type: ignore[assignment] + +try: + import termios # noqa: F401 +except ImportError: + sys.modules["termios"] = object() # type: ignore[assignment] + +class MockSqlite3: + sqlite_version = "3.31.1" + sqlite_version_info = (3, 31, 1) +try: + import sqlite3 # noqa: F401 +except ImportError: + sys.modules["sqlite3"] = MockSqlite3() + +_SERIAL_PORT = None +_SERIAL_PORT_CLOSING_TASKS = [] + +_LOGGER = logging.getLogger(__name__) + + +async def close_port(port: Any) -> None: + _LOGGER.debug("Closing serial port") + # XXX: `port.close` isn't a coroutine, it's an awaitable, so it cannot be directly + # passed into `asyncio.create_task()` + await port.close() + _LOGGER.debug("Closed serial port") + + +class WebSerialTransport(asyncio.Transport): + def __init__( + self, + loop: asyncio.BaseEventLoop, + protocol: asyncio.Protocol, + port, + ) -> None: + super().__init__() + self._loop: asyncio.BaseEventLoop = loop + self._protocol: asyncio.BaseProtocol | None = protocol + self._port = port + + self._write_queue: asyncio.Queue = asyncio.Queue() + self._is_closing = False + + self._js_reader = self._port.readable.getReader() + self._js_writer = self._port.writable.getWriter() + + self._reader_task = loop.create_task(self._reader_loop()) + self._writer_task = loop.create_task(self._writer_loop()) + + self._loop.call_soon(self._protocol.connection_made, self) + + async def _writer_loop(self) -> None: + while True: + chunk = await self._write_queue.get() + + try: + await self._js_writer.write(js.Uint8Array.new(chunk)) + except Exception as e: + self._cleanup(e) + break + + async def _reader_loop(self) -> None: + while True: + result = await self._js_reader.read() + if result.done: + self._cleanup(RuntimeError("Other side has closed")) + return + + self._protocol.data_received(bytes(result.value)) + + def write(self, data: bytes) -> None: + self._write_queue.put_nowait(data) + + def set_protocol(self, protocol: asyncio.BaseProtocol) -> None: + self._protocol = protocol + + def get_protocol(self) -> asyncio.BaseProtocol: + assert self._protocol is not None + return self._protocol + + def is_closing(self) -> bool: + return self._is_closing + + def __del__(self): + self._cleanup(RuntimeError("Transport was not closed!")) + + def _cleanup(self, exception: BaseException | None) -> None: + self._is_closing = True + + self._reader_task.cancel() + self._writer_task.cancel() + + if self._js_reader is not None: + self._js_reader.releaseLock() + self._js_reader = None + + if self._js_writer is not None: + self._js_writer.releaseLock() + self._js_writer = None + + closing_task = None + + if self._port is not None: + closing_task = asyncio.create_task(close_port(self._port)) + _SERIAL_PORT_CLOSING_TASKS.append(closing_task) + self._port = None + + if self._protocol is not None: + if closing_task is None: + self._protocol.connection_lost(exception) + else: + closing_task.add_done_callback( + lambda _, protocol=self._protocol: protocol.connection_lost(exception) + ) + closing_task.add_done_callback( + lambda _: _SERIAL_PORT_CLOSING_TASKS.remove(closing_task) + ) + + self._protocol = None + + def close(self) -> None: + self._cleanup(None) + + +def set_global_serial_port(serial_port) -> None: + global _SERIAL_PORT + _SERIAL_PORT = serial_port + + +async def create_serial_connection( + loop: asyncio.BaseEventLoop, + protocol_factory: typing.Callable[[], asyncio.Protocol], + url: str, + *, + parity=None, + stopbits=None, + baudrate: int, + rtscts=False, + xonxoff=False, +) -> tuple[WebSerialTransport, asyncio.Protocol]: + while _SERIAL_PORT_CLOSING_TASKS: + _LOGGER.warning( + "Serial connection was not closed before a new one was opened!" + " Waiting before opening a new one." + ) + await _SERIAL_PORT_CLOSING_TASKS.pop() + + # `url` is ignored, `_SERIAL_PORT` is used instead + await _SERIAL_PORT.open( + baudRate=baudrate, + flowControl="hardware" if rtscts else None, + ) + + protocol = protocol_factory() + transport = WebSerialTransport(loop, protocol, _SERIAL_PORT) + + return transport, protocol + + + +# Directly patch zigpy-serial +import zigpy.serial +zigpy.serial.create_serial_connection = create_serial_connection diff --git a/index.markdown b/index.markdown index 818e0353..e4c3e3b7 100644 --- a/index.markdown +++ b/index.markdown @@ -11,6 +11,7 @@ Supported devices: * Sonoff ZBDongle-E * Easyiot ZB-GW04 * SMLIGHT SLZB-07 +* SMLIGHT SLZB-07Mg24 * SMLIGHT SLZB-06M It will install the most recent recommended builds from [darkxst/silabs-firmware-builder](https://github.com/darkxst/silabs-firmware-builder). If you want the very latest builds, you can use `Custom URL` option. @@ -87,6 +88,19 @@ SMLIGHT SLZB-07 - Hardware flow control ----- +## SMLIGHT SLZB-07Mg24 +SMLIGHT SLZB-07Mg24 - Hardware flow control +![SMLIGHT SLZB-07](./assets/images/slzb-07.png) + +
+ + Connect + +
+
+ +----- + ## SMLIGHT SLZB-06M - SMLIGHT SLZB-06M - No hardware flow control diff --git a/universal_silabs_flasher-0.0.25-py3-none-any.whl b/universal_silabs_flasher-0.0.25-py3-none-any.whl new file mode 100644 index 00000000..36c52569 Binary files /dev/null and b/universal_silabs_flasher-0.0.25-py3-none-any.whl differ