diff --git a/.gitignore b/.gitignore index f53647f..9150fb3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ .dummy/ managed_components/ sdkconfig.* + +# The built site +site/public/ diff --git a/site/README.md b/site/README.md new file mode 100644 index 0000000..4c90b46 --- /dev/null +++ b/site/README.md @@ -0,0 +1,45 @@ +# The roro9stack site + +Source of https://roro9stack.net (docs/milestones/W1.md): a [Zola](https://www.getzola.org/) site. The home page, an Install page with a browser flasher, and the list of releases so far; the user guide, how-tos, FAQ and developer docs come next. + +``` +config.toml base_url, the repository and API addresses +content/ the pages (Markdown, with their template named in the front matter) +templates/ base, home, install, downloads, 404; illustrations/ is generated +data/ the App cards and the screenshots' captions +static/ css, js, fonts (self-hosted), img, screens (real screenshots), vendor/esp-web-tools +tools/ make_illustrations.py, check_site.py +``` + +## Build and look + +```sh +docker run --rm -u "$(id -u):$(id -g)" -v "$PWD/site:/app" -w /app ghcr.io/getzola/zola:v0.22.0 build # public/ +docker run --rm -u "$(id -u):$(id -g)" -p 1111:1111 -v "$PWD/site:/app" -w /app ghcr.io/getzola/zola:v0.22.0 serve --interface 0.0.0.0 +python3 site/tools/check_site.py site/public # what the pages promise, kept +``` + +Or `zola build` with a Zola of your own. The build reads the latest release and the list of releases from the Gitea API (`load_data`); if the server can't be reached, the pages say so instead of failing. + +## Publishing + +The web server pulls `main` and runs `zola build`, as for the blog. CI (`.gitea/workflows/site.yml`) builds the site and runs the checks when `site/`, `docs/`, `README.md` or `CONTEXT.md` change; the firmware workflow skips a change that touches only those. + +## Things to know + +- **The Install page needs Caddy's help.** Gitea's release downloads carry no CORS header, so the page asks the API from the browser only if Caddy, in front of Gitea, allows this origin: + + ```caddy + @releases { + method GET HEAD + path /twisla/roro9stack/releases/download/* /api/v1/repos/twisla/roro9stack/releases* + } + header @releases Access-Control-Allow-Origin "https://roro9stack.net" + header @releases Vary Origin + ``` + + Without it the page says it can't reach the release server and points to the esptool steps. +- **No third-party requests.** Fonts and the flasher library are served from here; `tools/check_site.py` fails the build if a page loads anything from another origin. +- **Illustrations.** `templates/illustrations/*.html` are generated by `tools/make_illustrations.py`; run it again rather than editing them. +- **Updating the flasher library:** see `static/vendor/esp-web-tools/README.txt`. +- **Fonts** are DM Mono and Hanken Grotesk, under the SIL Open Font License (the licences are in `static/fonts/`). diff --git a/site/config.toml b/site/config.toml new file mode 100644 index 0000000..b7674c7 --- /dev/null +++ b/site/config.toml @@ -0,0 +1,23 @@ +# roro9stack.net (docs/milestones/W1.md). Build with `zola build`; the web server pulls main and does this. +base_url = "https://roro9stack.net" +title = "roro9stack" +description = "Open firmware for the M5Stack Cardputer ADV with the Cap LoRa-1262: a LoRa scanner, GNSS, a Gemini browser, IRC, Wi-Fi tools, notes and more." +default_language = "en" +compile_sass = false +build_search_index = false +generate_feeds = false + +[markdown] +smart_punctuation = false + +[markdown.highlighting] +# Classes instead of inline colours; Zola 0.22 still wants a theme and writes giallo.css, which the +# templates don't link. +style = "class" +theme = "nord" + +[extra] +repo = "https://git.twis.la/twisla/roro9stack" +api = "https://git.twis.la/api/v1/repos/twisla/roro9stack" +blog = "https://experiments.twis.la" +contact = "contact@roro9stack.net" diff --git a/site/content/_index.md b/site/content/_index.md new file mode 100644 index 0000000..c018d98 --- /dev/null +++ b/site/content/_index.md @@ -0,0 +1,4 @@ ++++ +title = "roro9stack" +template = "index.html" ++++ diff --git a/site/content/downloads/index.md b/site/content/downloads/index.md new file mode 100644 index 0000000..69fa47a --- /dev/null +++ b/site/content/downloads/index.md @@ -0,0 +1,5 @@ ++++ +title = "Downloads" +description = "Every release of roro9stack: the signed update file, the factory image for USB, and what changed." +template = "downloads.html" ++++ diff --git a/site/content/install/index.md b/site/content/install/index.md new file mode 100644 index 0000000..9da768e --- /dev/null +++ b/site/content/install/index.md @@ -0,0 +1,41 @@ ++++ +title = "Install roro9stack" +description = "Flash roro9stack onto an M5Stack Cardputer ADV from your browser, or with esptool." +template = "install.html" ++++ + +## Before you start + +- An **M5Stack Cardputer ADV**, and a **USB-C cable that carries data** (a charge-only cable won't show up). +- **Chrome or Edge on a desktop computer.** Flashing from a page uses Web Serial, which Firefox and Safari don't have. Without it, use esptool below. +- The **Cap LoRa-1262** is optional for the install: the LoRa Scanner and GNSS need it, the other Apps don't. + +## Flash it + +1. **Put the Cardputer in download mode.** Hold **G0**, the button next to the screen, while you plug in the USB-C cable. +2. Press **Install roro9stack** above, choose the Cardputer in the list of serial ports (it's usually named after its chip, *ESP32-S3*, or *USB JTAG/serial debug unit*), and confirm. +3. Wait for it to finish, and don't unplug it. +4. The Cardputer restarts into a short **first-boot setup**: a name, a short name for the mesh, your region and your time zone. An interrupted setup simply starts again at the next boot. + +Flashing writes the firmware. What's on the SD card isn't touched. + +## Without Chrome: esptool + +Download the file ending in `-factory.bin` from [the downloads](/downloads/), put the Cardputer in download mode as above, and write it at offset 0: + +```sh +pip install esptool +esptool --chip esp32s3 write-flash 0x0 roro9stack--factory.bin +``` + +With esptool 4, the command is `esptool.py --chip esp32s3 write_flash 0x0 …`. On Linux your user needs access to the serial port: `sudo usermod -aG dialout "$USER"`, then log out and back in. The file's SHA-256 is listed above and in the release's `SHA256SUMS`. + +## After the first boot + +- **Wi-Fi:** Settings → Wi-Fi → add your network. +- **Updates:** Settings → Firmware shows the latest release and installs it from the project's server, with no computer. It runs the new firmware on Probation and goes back by itself if it doesn't hold. +- **Something went wrong:** hold G0 while plugging in USB, and flash again. A device that keeps crashing starts in Safe Mode, where Wi-Fi and updates still work. + +## Why this page loads from git.twis.la + +The flasher asks the project's own Gitea for the latest release and gives the browser that release's factory image. Nothing is copied to this site, and a new release appears here as soon as it exists. diff --git a/site/data/apps.toml b/site/data/apps.toml new file mode 100644 index 0000000..f8175e3 --- /dev/null +++ b/site/data/apps.toml @@ -0,0 +1,75 @@ +# The App cards on the home page. Each says what the firmware does today (docs/milestones/W1.md, Q185): +# what isn't built is marked planned, with its milestone. `icon` is a cell of static/img/icons-*.svg. + +[[app]] +num = "01" +tag = "LoRa Scanner" +title = "See what is on the air" +text = "Lists every packet it hears with time, RSSI, SNR, sender and hops, reading the Meshtastic header. A Sweep shows signal strength from 863 to 870 MHz. Capture to a pcap for Wireshark." +fact = "Only listens, never transmits" +icon = 1 + +[[app]] +num = "02" +tag = "GNSS" +title = "Find your place in the sky" +text = "Position and Sky views show where you are and which satellites you can see. Tracks save to the SD card as GPX, and the clock follows the fix." +fact = "Sky view and GPX Tracks" +icon = 2 + +[[app]] +num = "03" +tag = "Gemini" +title = "Browse Geminispace" +text = "Follow links with Tab and Enter, go Back to where you were, bookmark pages and save them to the SD card to read offline." +fact = "Certificates trusted on first use" +icon = 4 + +[[app]] +num = "04" +tag = "IRC" +title = "Chat from the keyboard" +text = "Join channels and type commands as you would anywhere, with daily logs written to the SD card." +fact = "Logs to SD" +icon = 5 + +[[app]] +num = "05" +tag = "Wi-Fi tools" +title = "Scan the air for networks" +text = "See the networks around you, sort and filter the list, and log scans to a CSV file on the SD card." +fact = "Scans log to CSV" +icon = 3 + +[[app]] +num = "06" +tag = "Notes" +title = "Write it down" +text = "Keep plain text notes on the SD card. There is no save key: the editor writes five seconds after you stop typing, through a temporary file, so a power cut never costs the note." +fact = "Plain .txt files in /notes" +icon = 6 + +[[app]] +num = "07" +tag = "Storage" +title = "Manage the SD card" +text = "Browse, copy, cut, rename and delete with a clipboard. Copies run in the background and Back cancels one. Opens text, hex, captures, tracks and update files." +fact = "Checks every copy by size" +icon = 8 + +[[app]] +num = "08" +tag = "System" +title = "Watch it think" +text = "Per-core load, every task and its spare stack, free heap, network traffic, battery and chip temperature, live." +fact = "Live and read-only" +icon = 7 + +[[app]] +num = "09" +tag = "Planned" +title = "A mesh messenger" +text = "Sending and reading messages on a Meshtastic-compatible mesh. The radio listens today, in the LoRa Scanner; transmitting is the next step and waits for a second node to test with." +fact = "Milestones M4 and M5 · not built yet" +icon = 0 +planned = true diff --git a/site/data/screens.toml b/site/data/screens.toml new file mode 100644 index 0000000..8a20f86 --- /dev/null +++ b/site/data/screens.toml @@ -0,0 +1,40 @@ +# Real screenshots (the Debug Console's `screenshot` command, 240 x 135 pixels, shown at twice that). +[[screen]] +file = "sweep.png" +alt = "The LoRa Scanner's Sweep view: bars of signal strength from 863.0 to 870.0 MHz with peak marks, a waterfall under them, and a footer reading floor -100, 863.2 MHz at -89 dBm" +caption = "LoRa Scanner, Sweep" + +[[screen]] +file = "sniffer.png" +alt = "The LoRa Scanner's packet list on LongFast 869.525 MHz while a Capture is recording: three packets, each with its time, RSSI, SNR and Meshtastic sender and hops" +caption = "LoRa Scanner, packets" + +[[screen]] +file = "sky.png" +alt = "The GNSS App's sky view: a circle with the satellites of four constellations as coloured dots, and a legend counting them: GPS 7 of 10, GLONASS 5 of 5, Galileo 1 of 1, BeiDou 4 of 5, 3D Fix" +caption = "GNSS, sky" + +[[screen]] +file = "gemini.png" +alt = "The Gemini App on the page Project Gemini at geminiprotocol.net: a heading, then the start of the text, Gemini in 100 words" +caption = "Gemini" + +[[screen]] +file = "system.png" +alt = "The System App's overview: Core 0 at 47 percent, Core 1 at 64 percent, memory 49 KB free, network, battery 97 percent, uptime, and a graph of both cores over two minutes" +caption = "System" + +[[screen]] +file = "notes.png" +alt = "The Notes editor on shopping-list.txt, 66 bytes, saved: Shopping list, milk, and a longer line that wraps on the screen" +caption = "Notes" + +[[screen]] +file = "storage.png" +alt = "The Storage App at the top of the SD card: the folders captures, gemini, gnss, irc, updates and wifi, and a Maintenance row, with 7.3 GB free" +caption = "Storage" + +[[screen]] +file = "update.png" +alt = "The full-screen progress of a firmware update: Receiving v0.10.0, a bar at 28 percent" +caption = "A firmware update" diff --git a/site/static/css/site.css b/site/static/css/site.css new file mode 100644 index 0000000..d50d1c1 --- /dev/null +++ b/site/static/css/site.css @@ -0,0 +1,234 @@ +/* roro9stack.net: the tokens and shapes of the design (docs/milestones/W1.md). Every colour is on the + device's RGB332 grid. Dark is the default; a visitor who prefers light gets light, and the switch + in the header overrides both. */ + +@font-face { font-family: "DM Mono"; src: url(/fonts/DMMono-Regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; } +@font-face { font-family: "DM Mono"; src: url(/fonts/DMMono-Medium.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; } +@font-face { font-family: "Hanken Grotesk"; src: url(/fonts/HankenGrotesk.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; } + +:root { + --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; + --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif; + + color-scheme: dark; + --s1: #494955; --s2: #000000; --s3: #6d6d55; --line: #6d6d55; --ls: #b6b6aa; + --ink: #ffffff; --muted: #b6dbff; + --cyan: #00dbff; --onfill: #000055; --cyandeep: #00dbff; --cyantext: #00dbff; + --mag: #ff00ff; --magtext: #ff92ff; --orange: #ff9200; --orangetext: #ffb655; + --icons: url(/img/icons-dark.svg); + --logo-dark: block; --logo-light: none; +} +@media (prefers-color-scheme: light) { + :root:not([data-theme="dark"]) { + color-scheme: light; + --s1: #ffffff; --s2: #dbffff; --s3: #b6dbff; --line: #92b6ff; --ls: #6d6daa; + --ink: #000055; --muted: #4949aa; + --cyandeep: #0092aa; --cyantext: #006daa; --magtext: #b600aa; --orangetext: #b64900; + --icons: url(/img/icons-light.svg); + --logo-dark: none; --logo-light: block; + } +} +:root[data-theme="light"] { + color-scheme: light; + --s1: #ffffff; --s2: #dbffff; --s3: #b6dbff; --line: #92b6ff; --ls: #6d6daa; + --ink: #000055; --muted: #4949aa; + --cyandeep: #0092aa; --cyantext: #006daa; --magtext: #b600aa; --orangetext: #b64900; + --icons: url(/img/icons-light.svg); + --logo-dark: none; --logo-light: block; +} + +* { box-sizing: border-box; } +html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; } +@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } } +body { margin: 0; background: var(--s1); color: var(--ink); font: 400 16px/24px var(--sans); } +a { color: inherit; text-decoration: none; } +a:hover { text-decoration: underline; text-underline-offset: 4px; } +img { max-width: 100%; height: auto; } +h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; } +ul, ol { padding: 0; list-style: none; } + +/* A focus ring must show. clip-path clips an outline along with everything else outside the shape, + so a focused notched control drops its notches and shows square corners and its ring. */ +:focus-visible { outline: 2px solid var(--cyandeep); outline-offset: 2px; } +.n-sm:focus-visible, .n-md:focus-visible, .n-lg:focus-visible { clip-path: none; } + +.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--cyan); color: var(--onfill); padding: 12px 16px; font: 500 14px/20px var(--mono); } +.skip:focus { top: 8px; } + +/* Notched corners: whole steps on a 4px grid (the device draws no curves). */ +.n-sm { clip-path: polygon(0 4px,4px 4px,4px 0,calc(100% - 4px) 0,calc(100% - 4px) 4px,100% 4px,100% calc(100% - 4px),calc(100% - 4px) calc(100% - 4px),calc(100% - 4px) 100%,4px 100%,4px calc(100% - 4px),0 calc(100% - 4px)); } +.n-md { clip-path: polygon(0 8px,4px 8px,4px 4px,8px 4px,8px 0,calc(100% - 8px) 0,calc(100% - 8px) 4px,calc(100% - 4px) 4px,calc(100% - 4px) 8px,100% 8px,100% calc(100% - 8px),calc(100% - 4px) calc(100% - 8px),calc(100% - 4px) calc(100% - 4px),calc(100% - 8px) calc(100% - 4px),calc(100% - 8px) 100%,8px 100%,8px calc(100% - 4px),4px calc(100% - 4px),4px calc(100% - 8px),0 calc(100% - 8px)); } +.n-lg { clip-path: polygon(0 16px,8px 16px,8px 8px,16px 8px,16px 0,calc(100% - 16px) 0,calc(100% - 16px) 8px,calc(100% - 8px) 8px,calc(100% - 8px) 16px,100% 16px,100% calc(100% - 16px),calc(100% - 8px) calc(100% - 16px),calc(100% - 8px) calc(100% - 8px),calc(100% - 16px) calc(100% - 8px),calc(100% - 16px) 100%,16px 100%,16px calc(100% - 8px),8px calc(100% - 8px),8px calc(100% - 16px),0 calc(100% - 16px)); } + +.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 32px; padding-right: 32px; } +.mono { font-family: var(--mono); } + +/* Header */ +.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: 24px; } +.brand { display: flex; align-items: center; min-height: 44px; } +.logo { height: 28px; width: auto; } +.logo-dark { display: var(--logo-dark); } +.logo-light { display: var(--logo-light); } +.bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } +.bar nav a, .link-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font: 400 14px/20px var(--mono); } +.link-btn { background: none; border: 0; color: inherit; cursor: pointer; } +.link-btn:hover { text-decoration: underline; text-underline-offset: 4px; } +.js-only { display: none; } +.js .js-only { display: inline-flex; } + +/* Buttons */ +.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; font: 500 14px/20px var(--mono); border: 0; cursor: pointer; } +.btn:hover { text-decoration: none; filter: brightness(1.08); } +.btn-primary { background: var(--cyan); color: var(--onfill); } +.btn-secondary { background: var(--s2); color: var(--ink); } +.bar nav a.btn { min-height: 44px; padding: 0 20px; } +.bar nav a.btn:hover { text-decoration: none; } + +/* Type */ +.eyebrow { font: 500 12px/16px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cyantext); } +.eyebrow-row { display: flex; align-items: center; gap: 8px; } +.eyebrow .v { text-transform: none; } +.dot { width: 8px; height: 8px; background: var(--cyan); flex: none; } +h1, h2 { font-family: var(--mono); font-weight: 500; } +h1 { font-size: 64px; line-height: 64px; letter-spacing: -.02em; } +h2 { font-size: 40px; line-height: 44px; letter-spacing: -.01em; } +h3 { font-size: 24px; line-height: 30px; font-weight: 600; } +.accent { color: var(--cyantext); } +.lead { font-size: 18px; line-height: 28px; max-width: 520px; } +.muted { color: var(--muted); } +.small { font-size: 14px; line-height: 20px; } +.caption { font: 400 12px/16px var(--mono); color: var(--muted); } +code, .code { font-family: var(--mono); font-size: .9em; } + +section { padding-top: 64px; padding-bottom: 64px; } +.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 680px; } +.stack { display: flex; flex-direction: column; gap: 24px; } + +/* Hero */ +.hero { padding-top: 48px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 48px; } +.hero-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 32px 56px; } +.hero-grid > div { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 24px; } +.hero-grid > div:first-child { flex-basis: 480px; } +.actions { display: flex; flex-wrap: wrap; gap: 16px; } +.facts { display: flex; flex-wrap: wrap; gap: 8px 24px; } +.facts li { display: flex; align-items: center; gap: 8px; font: 400 14px/20px var(--mono); color: var(--muted); } +.facts li::before { content: ""; width: 8px; height: 8px; background: var(--mag); display: block; } +.slab { background: var(--cyan); padding: 40px; display: flex; flex-wrap: wrap; gap: 32px; } +.slab .device { flex: 1 1 440px; min-width: 0; } +.illustration { display: block; width: 100%; height: auto; } +.illustration .mono { font-family: var(--mono); } +.hero .caption { margin-top: -36px; } + +/* Panels */ +.panel { background: var(--s2); padding: 32px; } +.status-box { background: var(--s2); padding: 24px 32px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; } +.status-box .eyebrow { color: var(--orangetext); } +.status-box p { flex: 1 1 420px; min-width: 0; } +.status-box a, .prose a, .steps a, .need a { color: var(--cyantext); text-decoration: underline; text-underline-offset: 4px; } + +.need { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; margin-top: 32px; } +.need li { display: flex; flex-direction: column; gap: 4px; padding-left: 16px; border-left: 4px solid var(--cyan); } +.need strong { font-weight: 600; } +.need span { color: var(--muted); } + +/* App cards */ +.cards { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 40px; } +.card { flex: 1 1 320px; min-width: 0; background: var(--s2); padding: 32px; display: flex; flex-direction: column; gap: 16px; } +.card-top { display: flex; justify-content: space-between; align-items: center; } +.card .tag { font: 500 12px/16px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cyantext); } +.card .num { font: 500 12px/16px var(--mono); letter-spacing: .08em; color: var(--muted); } +.card p { color: var(--muted); } +.card .fact { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 8px; font: 500 12px/16px var(--mono); letter-spacing: .04em; } +.card .fact::before { content: ""; width: 8px; height: 8px; background: var(--cyan); flex: none; } +.card.planned .tag { color: var(--orangetext); } +.card.planned .fact::before { background: var(--orange); } +.ic { width: 48px; height: 48px; flex: none; background-image: var(--icons); background-repeat: no-repeat; background-size: 144px 192px; image-rendering: pixelated; } +.i0 { background-position: 0 0; } .i1 { background-position: -48px 0; } .i2 { background-position: -96px 0; } +.i3 { background-position: 0 -48px; } .i4 { background-position: -48px -48px; } .i5 { background-position: -96px -48px; } +.i6 { background-position: 0 -96px; } .i7 { background-position: -48px -96px; } .i8 { background-position: -96px -96px; } +.i9 { background-position: 0 -144px; } +.cards-note { margin-top: 24px; font-size: 14px; line-height: 20px; color: var(--muted); } + +/* Real screenshots */ +.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; margin-top: 40px; } +.shot { background: var(--s2); padding: 16px; display: flex; flex-direction: column; gap: 12px; } +.shot img { display: block; width: 100%; height: auto; } /* shown at about half size: smoothed, not pixel-doubled */ +.shot figcaption { font: 500 12px/16px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); } + +/* Updates */ +.split { display: flex; flex-wrap: wrap; gap: 48px; } +.split > div { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 24px; } +.split > .aside { flex-basis: 420px; justify-content: center; gap: 32px; } +.updates { background: var(--s2); padding: 48px; } +.terminal { background: var(--s1); padding: 16px 20px; font: 400 14px/20px var(--mono); overflow-x: auto; white-space: pre; } +.terminal .p { color: var(--cyantext); } +.terminal .c { color: var(--muted); } +.num-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; } +.num-row .big { flex: none; min-width: 160px; font: 500 64px/64px var(--mono); letter-spacing: -.02em; } +.num-row p { flex: 1 1 200px; min-width: 0; color: var(--muted); } +.big.c1 { color: var(--cyantext); } .big.c2 { color: var(--magtext); } +.split > .blocks { display: flex; flex-direction: column; gap: 4px; background: var(--s2); padding: 32px; font: 400 14px/20px var(--mono); overflow-x: auto; white-space: pre; } +.split > .blocks .gap { height: 16px; } +.split > .blocks .c { color: var(--muted); } +.split > .blocks .p { color: var(--cyantext); } + +/* Call to action */ +.cta { background: var(--cyan); color: var(--onfill); padding: 48px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 40px; } +.cta > div:not(.nine) { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 20px; } +.cta p { font-size: 18px; line-height: 28px; max-width: 480px; } +.cta .btn { background: #000055; color: #ffffff; } +.nine { display: grid; grid-template-columns: repeat(5, 24px); gap: 4px; } +.nine i { display: block; width: 24px; height: 24px; } +.nine i.on { background: var(--s1); } + +/* Footer */ +footer .wrap { padding-top: 32px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 24px; } +.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; } +.foot-row span, footer small { font: 400 14px/20px var(--mono); color: var(--muted); } +footer nav { display: flex; flex-wrap: wrap; gap: 8px; } +footer nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font: 400 14px/20px var(--mono); } +footer small { display: block; max-width: 760px; } + +/* Pages: Install, Downloads, 404 */ +.page { padding-top: 32px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 40px; } +.page h1 { font-size: 48px; line-height: 52px; } +.page h2 { font-size: 32px; line-height: 36px; } +.prose { max-width: 720px; display: flex; flex-direction: column; gap: 16px; } +.prose h2 { margin-top: 24px; } +.prose ul { list-style: disc; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; } +.prose ol, .steps { list-style: decimal; padding-left: 24px; display: flex; flex-direction: column; gap: 12px; } +.prose pre { margin: 0; padding: 16px 20px; background: var(--s2); font: 400 14px/20px var(--mono); overflow-x: auto; clip-path: polygon(0 8px,4px 8px,4px 4px,8px 4px,8px 0,calc(100% - 8px) 0,calc(100% - 8px) 4px,calc(100% - 4px) 4px,calc(100% - 4px) 8px,100% 8px,100% calc(100% - 8px),calc(100% - 4px) calc(100% - 8px),calc(100% - 4px) calc(100% - 4px),calc(100% - 8px) calc(100% - 4px),calc(100% - 8px) 100%,8px 100%,8px calc(100% - 4px),4px calc(100% - 4px),4px calc(100% - 8px),0 calc(100% - 8px)); } +.prose pre code { font-size: 14px; } +.prose :not(pre) > code { background: var(--s2); padding: 0 6px; } +.prose table { border-collapse: collapse; width: 100%; } +.prose th, .prose td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; } + +.flasher { background: var(--s2); padding: 32px; display: flex; flex-direction: column; gap: 20px; max-width: 720px; } +.flasher dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 20px; font: 400 14px/20px var(--mono); } +.flasher dt { color: var(--muted); } +.flasher dd { overflow-wrap: anywhere; } +.flasher [hidden] { display: none !important; } +.flasher .msg { color: var(--orangetext); } +.hash { word-break: break-all; } + +.releases { display: flex; flex-direction: column; gap: 24px; } +.release { background: var(--s2); padding: 24px 32px; display: flex; flex-direction: column; gap: 12px; max-width: 880px; } +.release h2 { font-size: 28px; line-height: 32px; } +.release .meta { font: 400 14px/20px var(--mono); color: var(--muted); } +.release .files { display: flex; flex-wrap: wrap; gap: 8px 20px; font: 400 14px/20px var(--mono); } +.release .files a { color: var(--cyantext); text-decoration: underline; text-underline-offset: 4px; } + +@media (max-width: 720px) { + h1 { font-size: 40px; line-height: 44px; } + h2 { font-size: 32px; line-height: 36px; } + .wrap { padding-left: 20px; padding-right: 20px; } + section { padding-top: 48px; padding-bottom: 48px; } + .slab, .updates, .cta { padding: 24px; } + .panel, .card { padding: 24px; } + .hero .caption { margin-top: -24px; } + .num-row .big { font-size: 48px; line-height: 48px; min-width: 120px; } +} + +.accent-link { color: var(--cyantext); text-decoration: underline; text-underline-offset: 4px; } +.page > header { display: flex; flex-direction: column; gap: 12px; } +.page .lead { max-width: 720px; } diff --git a/site/static/fonts/DMMono-Medium.woff2 b/site/static/fonts/DMMono-Medium.woff2 new file mode 100644 index 0000000..67698d8 Binary files /dev/null and b/site/static/fonts/DMMono-Medium.woff2 differ diff --git a/site/static/fonts/DMMono-Regular.woff2 b/site/static/fonts/DMMono-Regular.woff2 new file mode 100644 index 0000000..03e4859 Binary files /dev/null and b/site/static/fonts/DMMono-Regular.woff2 differ diff --git a/site/static/fonts/HankenGrotesk.woff2 b/site/static/fonts/HankenGrotesk.woff2 new file mode 100644 index 0000000..518e2c4 Binary files /dev/null and b/site/static/fonts/HankenGrotesk.woff2 differ diff --git a/site/static/fonts/OFL-DMMono.txt b/site/static/fonts/OFL-DMMono.txt new file mode 100644 index 0000000..01450af --- /dev/null +++ b/site/static/fonts/OFL-DMMono.txt @@ -0,0 +1,93 @@ +Copyright 2020 The DM Mono Project Authors (https://www.github.com/googlefonts/dm-mono) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/site/static/fonts/OFL-HankenGrotesk.txt b/site/static/fonts/OFL-HankenGrotesk.txt new file mode 100644 index 0000000..9c8185d --- /dev/null +++ b/site/static/fonts/OFL-HankenGrotesk.txt @@ -0,0 +1,94 @@ +Copyright 2021 The Hanken Grotesk Project Authors (https://github.com/marcologous/hanken-grotesk) + + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/site/static/giallo.css b/site/static/giallo.css new file mode 100644 index 0000000..1a6078c --- /dev/null +++ b/site/static/giallo.css @@ -0,0 +1,213 @@ +/* + * theme "nord" generated by giallo + */ + +.z-code { + color: #D8DEE9; + background-color: #2E3440; +} + +.z-hl { + background-color: #3B4252; +} + +.giallo-ln { + color: #4C566A; +} + +.z-emphasis { font-style: italic; } +.z-strong { font-weight: bold; } +.z-comment { color: #616E88; } +.z-keyword { color: #81A1C1; } +.z-punctuation { color: #ECEFF4; } +.z-storage { color: #81A1C1; } +.z-string { color: #A3BE8C; } +.z-punctuation { color: #5E81AC; } +.z-constant.z-character { color: #EBCB8B; } +.z-constant.z-language { color: #81A1C1; } +.z-constant.z-numeric { color: #B48EAD; } +.z-constant.z-regexp { color: #EBCB8B; } +.z-invalid.z-deprecated { color: #D8DEE9; background-color: #EBCB8B; } +.z-invalid.z-illegal { color: #D8DEE9; background-color: #BF616A; } +.z-keyword.z-operator { color: #81A1C1; } +.z-markup.z-bold { font-weight: bold; } +.z-markup.z-changed { color: #EBCB8B; } +.z-markup.z-deleted { color: #BF616A; } +.z-markup.z-inserted { color: #A3BE8C; } +.z-meta.z-preprocessor { color: #5E81AC; } +.z-punctuation.z-section { color: #ECEFF4; } +.z-punctuation.z-terminator { color: #81A1C1; } +.z-string.z-regexp { color: #EBCB8B; } +.z-support.z-class { color: #8FBCBB; } +.z-support.z-constant { color: #81A1C1; } +.z-support.z-function { color: #88C0D0; } +.z-support.z-type { color: #8FBCBB; } +.z-token.z-debug-token { color: #B48EAD; } +.z-token.z-error-token { color: #BF616A; } +.z-token.z-info-token { color: #88C0D0; } +.z-token.z-warn-token { color: #EBCB8B; } +.z-variable.z-other { color: #D8DEE9; } +.z-variable.z-language { color: #81A1C1; } +.z-variable.z-parameter { color: #D8DEE9; } +.z-markup.z-heading { color: #88C0D0; } +.z-meta.z-property-value { color: #88C0D0; } +.z-constant.z-other { color: #D8DEE9; } +.z-storage.z-type { color: #8FBCBB; } +.z-punctuation.z-decorator { color: #D08770; } +.z-markup.z-italic { font-style: italic; } +.z-markup.z-quote { color: #616E88; } +.z-meta.z-function-call { color: #88C0D0; } +.z-support.z-type { color: #88C0D0; } +.z-meta.z-attribute { color: #5E81AC; } +.z-variable.z-interpolation { color: #D8DEE9; font-style: italic; } +.z-punctuation.z-decorator { color: #D08770; } +.z-punctuation.z-decorator { color: #D08770; } +.z-support.z-class { color: #8FBCBB; } +.z-support.z-type { color: #8FBCBB; } +.z-support.z-class { color: #8FBCBB; } +.z-support.z-type { color: #8FBCBB; } +.z-support.z-variable { color: #D8DEE9; } +.z-support.z-variable { color: #D8DEE9; } +.z-meta.z-method { color: #88C0D0; } +.z-punctuation.z-definition { color: #8FBCBB; } +.z-support.z-type { color: #D08770; } +.z-keyword.z-operator { color: #5E81AC; } +.z-constant.z-character.z-escape { color: #EBCB8B; } +.z-entity.z-name.z-class { color: #8FBCBB; } +.z-entity.z-name.z-function { color: #88C0D0; } +.z-entity.z-name.z-tag { color: #81A1C1; } +.z-entity.z-other.z-attribute-name { color: #8FBCBB; } +.z-entity.z-other.z-inherited-class { color: #8FBCBB; font-weight: bold; } +.z-keyword.z-other.z-new { color: #81A1C1; } +.z-punctuation.z-definition.z-method-parameters { color: #ECEFF4; } +.z-punctuation.z-definition.z-function-parameters { color: #ECEFF4; } +.z-punctuation.z-definition.z-parameters { color: #ECEFF4; } +.z-punctuation.z-definition.z-tag { color: #81A1C1; } +.z-punctuation.z-definition.z-comment { color: #616E88; } +.z-punctuation.z-definition.z-variable { color: #81A1C1; } +.z-support.z-function.z-construct { color: #81A1C1; } +.z-support.z-type.z-exception { color: #8FBCBB; } +.z-meta.z-preprocessor.z-include { color: #8FBCBB; } +.z-punctuation.z-definition.z-directive { color: #5E81AC; font-weight: bold; } +.z-punctuation.z-definition.z-directive { color: #5E81AC; font-weight: bold; } +.z-punctuation.z-definition.z-keyword { color: #81A1C1; } +.z-support.z-type.z-property-name { color: #D8DEE9; } +.z-punctuation.z-definition.z-from-file { color: #8FBCBB; } +.z-punctuation.z-definition.z-range { color: #8FBCBB; } +.z-punctuation.z-definition.z-separator { color: #81A1C1; } +.z-keyword.z-other.z-documentation { color: #8FBCBB; } +.z-storage.z-modifier.z-import { color: #8FBCBB; } +.z-storage.z-modifier.z-package { color: #8FBCBB; } +.z-storage.z-type.z-annotation { color: #D08770; } +.z-storage.z-type.z-generic { color: #8FBCBB; } +.z-storage.z-type.z-primitive { color: #81A1C1; } +.z-meta.z-object-literal.z-key { color: #88C0D0; } +.z-support.z-type.z-primitive { color: #81A1C1; } +.z-variable.z-other.z-object { color: #D8DEE9; } +.z-constant.z-other.z-inline-data { color: #D08770; font-style: italic; } +.z-punctuation.z-definition.z-entity { color: #81A1C1; } +.z-markup.z-fenced_code.z-block { color: #8FBCBB; } +.z-markup.z-inline.z-raw { color: #8FBCBB; } +.z-markup.z-underline.z-link { text-decoration: underline; } +.z-punctuation.z-definition.z-heading { color: #81A1C1; } +.z-punctuation.z-definition.z-constant { color: #81A1C1; } +.z-punctuation.z-definition.z-string { color: #81A1C1; } +.z-punctuation.z-definition.z-variable { color: #D8DEE9; } +.z-meta.z-function-call.z-object { color: #88C0D0; } +.z-meta.z-function-call.z-generic { color: #88C0D0; } +.z-entity.z-name.z-type { color: #8FBCBB; } +.z-punctuation.z-definition.z-interpolation { color: #EBCB8B; } +.z-meta.z-object-literal.z-key { color: #D8DEE9; } +.z-meta.z-object-literal.z-key { color: #D8DEE9; } +.z-entity.z-name.z-type { color: #8FBCBB; } +.z-entity.z-name.z-class { color: #8FBCBB; } +.z-entity.z-name.z-type { color: #8FBCBB; } +.z-entity.z-name.z-class { color: #8FBCBB; } +.z-support.z-constant.z-math { color: #8FBCBB; } +.z-support.z-constant.z-dom { color: #8FBCBB; } +.z-support.z-constant.z-json { color: #8FBCBB; } +.z-support.z-constant.z-math { color: #8FBCBB; } +.z-support.z-constant.z-dom { color: #8FBCBB; } +.z-support.z-constant.z-json { color: #8FBCBB; } +.z-keyword.z-other.z-doctype { color: #5E81AC; } +.z-string.z-unquoted.z-cdata { color: #D08770; font-style: italic; } +.z-entity.z-name.z-tag { color: #8FBCBB; } +.z-punctuation.z-definition.z-keyword { color: #D08770; } +.z-variable.z-other.z-readwrite { color: #D08770; } +.z-entity.z-name.z-function { color: #D08770; } +.z-punctuation.z-definition.z-template-expression { color: #81A1C1; } +.z-meta.z-method-call.z-with-arguments { color: #ECEFF4; } +.z-meta.z-brace.z-square { color: #ECEFF4; } +.z-meta.z-brace.z-round { color: #ECEFF4; } +.z-meta.z-brace.z-square { color: #ECEFF4; } +.z-meta.z-brace.z-round { color: #ECEFF4; } +.z-punctuation.z-definition.z-raw { color: #8FBCBB; } +.z-entity.z-name.z-function { color: #88C0D0; font-weight: bold; } +.z-variable.z-other.z-readwrite { color: #D08770; } +.z-entity.z-name.z-function { color: #D08770; } +.z-variable.z-other.z-readwrite { color: #D08770; } +.z-entity.z-name.z-function { color: #D08770; } +.z-entity.z-name.z-function { color: #88C0D0; } +.z-entity.z-name.z-function { color: #88C0D0; } +.z-meta.z-brace.z-square { color: #ECEFF4; } +.z-meta.z-brace.z-round { color: #ECEFF4; } +.z-meta.z-brace.z-square { color: #ECEFF4; } +.z-meta.z-brace.z-round { color: #ECEFF4; } +.z-entity.z-name.z-tag { color: #5E81AC; } +.z-punctuation.z-definition.z-string { color: #D08770; font-style: italic; } +.z-support.z-variable.z-property { color: #D8DEE9; } +.z-variable.z-other.z-object { color: #D8DEE9; } +.z-entity.z-name.z-type.z-class { color: #8FBCBB; } +.z-punctuation.z-end.z-definition.z-comment { color: #616E88; } +.z-punctuation.z-start.z-definition.z-comment { color: #616E88; } +.z-punctuation.z-section.z-embedded.z-begin { color: #81A1C1; } +.z-punctuation.z-section.z-embedded.z-end { color: #81A1C1; } +.z-punctuation.z-separator.z-pointer-access.z-c { color: #81A1C1; } +.z-constant.z-other.z-symbol.z-elixir { color: #D8DEE9; font-weight: bold; } +.z-variable.z-other.z-constant.z-elixir { color: #8FBCBB; } +.z-keyword.z-control.z-directive.z-conditional { color: #5E81AC; font-weight: bold; } +.z-keyword.z-control.z-directive.z-conditional { color: #5E81AC; font-weight: bold; } +.z-constant.z-other.z-color.z-rgb-value { color: #B48EAD; } +.z-keyword.z-control.z-at-rule.z-media { color: #D08770; } +.z-meta.z-diff.z-range.z-context { color: #8FBCBB; } +.z-meta.z-diff.z-header.z-from-file { color: #8FBCBB; } +.z-constant.z-other.z-placeholder.z-go { color: #EBCB8B; } +.z-keyword.z-other.z-documentation.z-directive { color: #8FBCBB; } +.z-keyword.z-other.z-documentation.z-custom { color: #8FBCBB; } +.z-punctuation.z-definition.z-keyword.z-javadoc { color: #8FBCBB; } +.z-storage.z-type.z-class.z-jsdoc { color: #8FBCBB; } +.z-variable.z-other.z-readwrite.z-alias { color: #8FBCBB; } +.z-constant.z-character.z-entity.z-html { color: #EBCB8B; } +.z-meta.z-tag.z-sgml.z-doctype { color: #5E81AC; } +.z-punctuation.z-separator.z-key-value.z-ini { color: #81A1C1; } +.z-beginning.z-punctuation.z-definition.z-list { color: #81A1C1; } +.z-beginning.z-punctuation.z-definition.z-quote { color: #8FBCBB; } +.z-constant.z-character.z-math.z-tex { color: #81A1C1; } +.z-punctuation.z-definition.z-math.z-begin { color: #5E81AC; } +.z-punctuation.z-definition.z-math.z-end { color: #5E81AC; } +.z-punctuation.z-math.z-operator.z-latex { color: #81A1C1; } +.z-constant.z-other.z-reference.z-link { color: #88C0D0; } +.z-string.z-other.z-link.z-description { color: #88C0D0; } +.z-string.z-other.z-link.z-title { color: #88C0D0; } +.z-entity.z-name.z-function.z-decorator { color: #D08770; } +.z-variable.z-parameter.z-function.z-language { color: #D8DEE9; } +.z-entity.z-name.z-type.z-trait { font-weight: bold; } +.z-entity.z-name.z-tag.z-namespace { color: #8FBCBB; } +.z-punctuation.z-definition.z-entity.z-html { color: #81A1C1; } +.z-punctuation.z-quasi.z-element.z-begin { color: #81A1C1; } +.z-punctuation.z-quasi.z-element.z-end { color: #81A1C1; } +.z-entity.z-name.z-type.z-module.z-elixir { color: #8FBCBB; } +.z-variable.z-other.z-readwrite.z-module.z-elixir { color: #D8DEE9; font-weight: bold; } +.z-string.z-quoted.z-other.z-lt-gt.z-include { color: #8FBCBB; } +.z-keyword.z-other.z-documentation.z-author.z-javadoc { color: #8FBCBB; } +.z-keyword.z-other.z-documentation.z-see.z-javadoc { color: #8FBCBB; } +.z-meta.z-tag.z-template.z-link.z-javadoc { color: #8FBCBB; } +.z-string.z-other.z-link.z-title.z-javadoc { color: #8FBCBB; } +.z-meta.z-tag.z-template.z-value.z-javadoc { color: #88C0D0; } +.z-punctuation.z-definition.z-tag.z-begin.z-javadoc { color: #616E88; } +.z-punctuation.z-definition.z-tag.z-end.z-javadoc { color: #616E88; } +.z-entity.z-name.z-section.z-group-title.z-ini { color: #88C0D0; } +.z-punctuation.z-definition.z-function.z-math.z-tex { color: #88C0D0; } +.z-punctuation.z-definition.z-interpolation.z-begin.z-bracket.z-curly { color: #81A1C1; } +.z-punctuation.z-definition.z-interpolation.z-end.z-bracket.z-curly { color: #81A1C1; } +.z-variable.z-parameter.z-function.z-language.z-special.z-self { color: #81A1C1; } diff --git a/site/static/img/favicon.svg b/site/static/img/favicon.svg new file mode 100644 index 0000000..8010f9b --- /dev/null +++ b/site/static/img/favicon.svg @@ -0,0 +1 @@ + diff --git a/site/static/img/icons-dark.svg b/site/static/img/icons-dark.svg new file mode 100644 index 0000000..6ffa5ad --- /dev/null +++ b/site/static/img/icons-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/static/img/icons-light.svg b/site/static/img/icons-light.svg new file mode 100644 index 0000000..a873545 --- /dev/null +++ b/site/static/img/icons-light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/static/img/logo-dark.svg b/site/static/img/logo-dark.svg new file mode 100644 index 0000000..84f1bbe --- /dev/null +++ b/site/static/img/logo-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/static/img/logo-light.svg b/site/static/img/logo-light.svg new file mode 100644 index 0000000..3f17df4 --- /dev/null +++ b/site/static/img/logo-light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/static/js/install.js b/site/static/js/install.js new file mode 100644 index 0000000..f4b769c --- /dev/null +++ b/site/static/js/install.js @@ -0,0 +1,69 @@ +// The Install page: asks the project's Gitea for the latest release, and gives ESP Web Tools a +// manifest for its factory image, built here, so the page offers a new release as soon as it exists +// and nothing is copied to this site (docs/milestones/W1.md, Q180). Gitea sits behind Caddy, which +// allows this origin to read the release API and the downloads. +(function () { + var box = document.getElementById("flasher"); + if (!box) return; + var $ = function (id) { return document.getElementById(id); }; + var status = $("flasher-status"); + var apiOrigin = new URL(box.dataset.api).origin; + var downloads = box.dataset.releasesPath; + + // A network error (which is also what a browser makes of a missing CORS header) and a release this + // page won't offer are different things to tell the visitor. + function fail(error) { + var unreachable = error instanceof TypeError; + status.textContent = (unreachable ? "Couldn't reach the release server (" + error.message + ")" : "This page can't offer the latest release (" + error.message + ")") + + ". Use the esptool steps below, or take the file from the downloads page."; + status.className = "msg"; + } + function human(bytes) { + return bytes >= 1048576 ? (bytes / 1048576).toFixed(2) + " MB" : Math.round(bytes / 1024) + " KB"; + } + // Only a download from the project's own server, for this repository, is ever handed to the flasher. + function trusted(url) { + try { + var u = new URL(url); + return u.origin === apiOrigin && u.pathname.indexOf(downloads) === 0 && u.pathname.indexOf("..") < 0 && !u.search; + } catch (e) { return false; } + } + + fetch(box.dataset.api + "/releases/latest", { headers: { Accept: "application/json" } }) + .then(function (r) { + if (!r.ok) throw new Error("answer " + r.status); + return r.json(); + }) + .then(function (rel) { + var assets = rel.assets || []; + var bin = assets.filter(function (a) { return /-factory\.bin$/.test(a.name); })[0]; + if (!bin) throw new Error("the latest release has no factory image"); + if (!trusted(bin.browser_download_url)) throw new Error("its download isn't on the project's server"); + var sums = assets.filter(function (a) { return a.name === "SHA256SUMS" && trusted(a.browser_download_url); })[0]; + + $("f-version").textContent = rel.tag_name; + $("f-size").textContent = human(bin.size); + if (rel.html_url) $("f-link").href = rel.html_url; + var manifest = { + name: "roro9stack", + version: rel.tag_name, + builds: [{ chipFamily: "ESP32-S3", parts: [{ path: bin.browser_download_url, offset: 0 }] }] + }; + var url = URL.createObjectURL(new Blob([JSON.stringify(manifest)], { type: "application/json" })); + var button = $("f-button"); + button.setAttribute("manifest", url); + button.hidden = false; + $("flasher-info").hidden = false; + status.textContent = "Latest release: " + rel.tag_name + "."; + + if (!sums) { $("f-sha").textContent = "not published"; return; } + return fetch(sums.browser_download_url) + .then(function (r) { return r.ok ? r.text() : ""; }) + .then(function (text) { + var line = text.split("\n").filter(function (l) { return l.indexOf(bin.name) >= 0; })[0]; + $("f-sha").textContent = line ? line.split(/\s+/)[0] : "not listed"; + }) + .catch(function () { $("f-sha").textContent = "unavailable"; }); + }) + .catch(fail); +})(); diff --git a/site/static/js/theme.js b/site/static/js/theme.js new file mode 100644 index 0000000..e7f7c8f --- /dev/null +++ b/site/static/js/theme.js @@ -0,0 +1,30 @@ +// The theme switch. Without JavaScript the page follows the visitor's setting (prefers-color-scheme); +// this adds a button that overrides it, remembered in this browser only. +(function () { + var root = document.documentElement; + root.classList.add("js"); + try { + var saved = localStorage.getItem("theme"); + if (saved === "dark" || saved === "light") root.setAttribute("data-theme", saved); + } catch (e) { /* storage blocked: the setting just isn't remembered */ } + + document.addEventListener("DOMContentLoaded", function () { + var button = document.getElementById("theme-toggle"); + if (!button) return; + function current() { + return root.getAttribute("data-theme") || (window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark"); + } + function show() { + var next = current() === "dark" ? "light" : "dark"; + button.textContent = next === "light" ? "Light" : "Dark"; + button.setAttribute("aria-label", "Switch to the " + next + " theme"); + } + button.addEventListener("click", function () { + var next = current() === "dark" ? "light" : "dark"; + root.setAttribute("data-theme", next); + try { localStorage.setItem("theme", next); } catch (e) { /* see above */ } + show(); + }); + show(); + }); +})(); diff --git a/site/static/screens/gemini.png b/site/static/screens/gemini.png new file mode 100644 index 0000000..6ecb2c9 Binary files /dev/null and b/site/static/screens/gemini.png differ diff --git a/site/static/screens/notes.png b/site/static/screens/notes.png new file mode 100644 index 0000000..2555f5c Binary files /dev/null and b/site/static/screens/notes.png differ diff --git a/site/static/screens/position.png b/site/static/screens/position.png new file mode 100644 index 0000000..b0fcda6 Binary files /dev/null and b/site/static/screens/position.png differ diff --git a/site/static/screens/sky.png b/site/static/screens/sky.png new file mode 100644 index 0000000..2a4db20 Binary files /dev/null and b/site/static/screens/sky.png differ diff --git a/site/static/screens/sniffer.png b/site/static/screens/sniffer.png new file mode 100644 index 0000000..5b4fe62 Binary files /dev/null and b/site/static/screens/sniffer.png differ diff --git a/site/static/screens/storage.png b/site/static/screens/storage.png new file mode 100644 index 0000000..9381de4 Binary files /dev/null and b/site/static/screens/storage.png differ diff --git a/site/static/screens/sweep.png b/site/static/screens/sweep.png new file mode 100644 index 0000000..0e138a1 Binary files /dev/null and b/site/static/screens/sweep.png differ diff --git a/site/static/screens/system.png b/site/static/screens/system.png new file mode 100644 index 0000000..06add47 Binary files /dev/null and b/site/static/screens/system.png differ diff --git a/site/static/screens/update.png b/site/static/screens/update.png new file mode 100644 index 0000000..7d3105c Binary files /dev/null and b/site/static/screens/update.png differ diff --git a/site/static/vendor/esp-web-tools/LICENSE b/site/static/vendor/esp-web-tools/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/site/static/vendor/esp-web-tools/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/site/static/vendor/esp-web-tools/README.txt b/site/static/vendor/esp-web-tools/README.txt new file mode 100644 index 0000000..6da6729 --- /dev/null +++ b/site/static/vendor/esp-web-tools/README.txt @@ -0,0 +1,9 @@ +ESP Web Tools 10.4.0 (https://github.com/esphome/esp-web-tools), Apache-2.0 (see LICENSE), +vendored so the Install page makes no request to a CDN. + +Only the files an ESP32-S3 needs (the Cardputer ADV): install-button.js, its chunks, and the S3 +flasher stub. The other chip families' chunks are loaded only if such a chip is detected, which this +page's manifest never asks for. + +Updating: `npm pack esp-web-tools`, then copy the same set from package/dist/web/ (the chunk file +names carry a hash and change with the version) and update the references in this README. diff --git a/site/static/vendor/esp-web-tools/esp32s3-DQt_R3ZE.js b/site/static/vendor/esp-web-tools/esp32s3-DQt_R3ZE.js new file mode 100644 index 0000000..b1ba7a1 --- /dev/null +++ b/site/static/vendor/esp-web-tools/esp32s3-DQt_R3ZE.js @@ -0,0 +1 @@ +import{ESP32ROM as t}from"./esp32-DNPRK0Ay.js";import"./install-dialog-im156JnI.js";import"./styles-sT2V1cOw.js";class i extends t{constructor(){super(...arguments),this.CHIP_NAME="ESP32-S3",this.IMAGE_CHIP_ID=9,this.EFUSE_BASE=1610641408,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.EFUSE_BLOCK1_ADDR=this.EFUSE_BASE+68,this.EFUSE_BLOCK2_ADDR=this.EFUSE_BASE+92,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612864,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.USB_RAM_BLOCK=2048,this.UARTDEV_BUF_NO_USB=3,this.UARTDEV_BUF_NO=1070526796,this.IROM_MAP_START=1107296256,this.IROM_MAP_END=1140850688,this.MEMORY_MAP=[[0,65536,"PADDING"],[1006632960,1023410176,"DROM"],[1023410176,1040187392,"EXTRAM_DATA"],[1611653120,1611661312,"RTC_DRAM"],[1070104576,1070596096,"BYTE_ACCESSIBLE"],[1070104576,1077813248,"MEM_INTERNAL"],[1070104576,1070596096,"DRAM"],[1073741824,1073848576,"IROM_MASK"],[1077346304,1077805056,"IRAM"],[1611653120,1611661312,"RTC_IRAM"],[1107296256,1115684864,"IROM"],[1342177280,1342185472,"RTC_DATA"]]}async getChipDescription(t){const i=await this.getMajorChipVersion(t),s=await this.getMinorChipVersion(t);return`${{0:"ESP32-S3 (QFN56)",1:"ESP32-S3-PICO-1 (LGA56)"}[await this.getPkgVersion(t)]||"unknown ESP32-S3"} (revision v${i}.${s})`}async getPkgVersion(t){return await t.readReg(this.EFUSE_BLOCK1_ADDR+12)>>21&7}async getRawMinorChipVersion(t){return((await t.readReg(this.EFUSE_BLOCK1_ADDR+20)>>23&1)<<3)+(await t.readReg(this.EFUSE_BLOCK1_ADDR+12)>>18&7)}async getMinorChipVersion(t){const i=await this.getRawMinorChipVersion(t);return await this.isEco0(t,i)?0:this.getRawMinorChipVersion(t)}async getRawMajorChipVersion(t){return await t.readReg(this.EFUSE_BLOCK1_ADDR+20)>>24&3}async getMajorChipVersion(t){const i=await this.getRawMinorChipVersion(t);return await this.isEco0(t,i)?0:this.getRawMajorChipVersion(t)}async getBlkVersionMajor(t){return await t.readReg(this.EFUSE_BLOCK2_ADDR+16)>>0&3}async getBlkVersionMinor(t){return await t.readReg(this.EFUSE_BLOCK1_ADDR+12)>>24&7}async isEco0(t,i){return 0==(7&i)&&1===await this.getBlkVersionMajor(t)&&1===await this.getBlkVersionMinor(t)}async getFlashCap(t){const i=this.EFUSE_BASE+68+12;return await t.readReg(i)>>27&7}async getFlashVendor(t){const i=this.EFUSE_BASE+68+16;return{1:"XMC",2:"GD",3:"FM",4:"TT",5:"BY"}[await t.readReg(i)>>0&7]||""}async getPsramCap(t){const i=this.EFUSE_BASE+68+16;return await t.readReg(i)>>3&3}async getPsramVendor(t){const i=this.EFUSE_BASE+68+16;return{1:"AP_3v3",2:"AP_1v8"}[await t.readReg(i)>>7&3]||""}async getChipFeatures(t){const i=["Wi-Fi","BLE"],s=await this.getFlashCap(t),e=await this.getFlashVendor(t),a={0:null,1:"Embedded Flash 8MB",2:"Embedded Flash 4MB"}[s],r=void 0!==a?a:"Unknown Embedded Flash";null!==a&&i.push(`${r} (${e})`);const n=await this.getPsramCap(t),_=await this.getPsramVendor(t),h={0:null,1:"Embedded PSRAM 8MB",2:"Embedded PSRAM 2MB"}[n],E=void 0!==h?h:"Unknown Embedded PSRAM";return null!==h&&i.push(`${E} (${_})`),i}async getCrystalFreq(t){return 40}_d2h(t){const i=(+t).toString(16);return 1===i.length?"0"+i:i}async postConnect(t){const i=255&await t.readReg(this.UARTDEV_BUF_NO);t.debug("In _post_connect "+i),i==this.UARTDEV_BUF_NO_USB&&(t.ESP_RAM_BLOCK=this.USB_RAM_BLOCK)}async readMac(t){let i=await t.readReg(this.MAC_EFUSE_REG);i>>>=0;let s=await t.readReg(this.MAC_EFUSE_REG+4);s=s>>>0&65535;const e=new Uint8Array(6);return e[0]=s>>8&255,e[1]=255&s,e[2]=i>>24&255,e[3]=i>>16&255,e[4]=i>>8&255,e[5]=255&i,this._d2h(e[0])+":"+this._d2h(e[1])+":"+this._d2h(e[2])+":"+this._d2h(e[3])+":"+this._d2h(e[4])+":"+this._d2h(e[5])}getEraseSize(t,i){return i}}export{i as ESP32S3ROM}; diff --git a/site/static/vendor/esp-web-tools/index-Dt9w-IG1.js b/site/static/vendor/esp-web-tools/index-Dt9w-IG1.js new file mode 100644 index 0000000..8c8a734 --- /dev/null +++ b/site/static/vendor/esp-web-tools/index-Dt9w-IG1.js @@ -0,0 +1,129 @@ +import{w as e,y as t,a as o,_ as i,t as l,i as n,x as a}from"./styles-sT2V1cOw.js";const s=e` + + + + + +`;let r=class extends n{render(){const e=(()=>{var e,t;const o=window.navigator.userAgent,i=(null===(t=null===(e=window.navigator)||void 0===e?void 0:e.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform;return-1!==["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(i)?"Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(i)?"iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(i)?"Windows":/Android/.test(o)?"Android":/Linux/.test(i)?"Linux":null})();return a` + +
No port selected
+
+
+ If you didn't select a port because you didn't see your device + listed, try the following steps: +
+
    +
  1. + Make sure that the device is connected to this computer (the one + that runs the browser that shows this website) +
  2. +
  3. + Most devices have a tiny light when it is powered on. If yours has + one, make sure it is on. +
  4. +
  5. + Make sure that the USB cable you use can be used for data and is + not a power-only cable. +
  6. + ${"Linux"===e?a` +
  7. + If you are using a Linux flavor, make sure that your user is + part of the dialout group so it has permission + to access the device. + sudo usermod -a -G dialout YourUserName + You may need to log out & back in or reboot to activate the + new group access. +
  8. + `:""} +
  9. + Make sure you have the right drivers installed. Below are the + drivers for common chips used in ESP devices: +
      +
    • + CP2102 drivers: + Windows & Mac +
    • +
    • + CH342, CH343, CH9102 drivers: + Windows, + Mac +
      + (download via blue button with ${s} icon) +
    • +
    • + CH340, CH341 drivers: + Windows, + Mac +
      + (download via blue button with ${s} icon) +
    • +
    +
  10. +
+
+
+ ${this.doTryAgain?a` + Cancel + + Try Again + + `:a` + Close + `} +
+
+ `}tryAgain(){var e;this.close(),null===(e=this.doTryAgain)||void 0===e||e.call(this)}close(){this.shadowRoot.querySelector("ew-dialog").close()}async _handleClose(){this.parentNode.removeChild(this)}};r.styles=[t,o` + li + li, + li > ul { + margin-top: 8px; + } + ul, + ol { + margin-bottom: 0; + padding-left: 1.5em; + } + li code.block { + display: block; + margin: 0.5em 0; + } + `],r=i([l("ewt-no-port-picked-dialog")],r);const d=async e=>{const t=document.createElement("ewt-no-port-picked-dialog");return t.doTryAgain=e,document.body.append(t),!0};export{d as openNoPortPickedDialog}; diff --git a/site/static/vendor/esp-web-tools/install-button.js b/site/static/vendor/esp-web-tools/install-button.js new file mode 100644 index 0000000..4889392 --- /dev/null +++ b/site/static/vendor/esp-web-tools/install-button.js @@ -0,0 +1 @@ +const e=async t=>{let o;import("./install-dialog-im156JnI.js").then((function(e){return e.i}));try{o=await navigator.serial.requestPort()}catch(o){return"NotFoundError"===o.name?void import("./index-Dt9w-IG1.js").then((o=>o.openNoPortPickedDialog((()=>e(t))))):void alert(`Error: ${o.message}`)}if(!o)return;try{await o.open({baudRate:115200,bufferSize:8192})}catch(e){return void alert(e.message)}const n=document.createElement("ewt-install-dialog");n.port=o,n.manifestPath=t.manifest||t.getAttribute("manifest"),n.overrides=t.overrides,n.addEventListener("closed",(()=>{o.close()}),{once:!0}),document.body.appendChild(n)};class t extends HTMLElement{connectedCallback(){if(this.renderRoot)return;if(this.renderRoot=this.attachShadow({mode:"open"}),!t.isSupported||!t.isAllowed)return this.toggleAttribute("install-unsupported",!0),void(this.renderRoot.innerHTML=t.isAllowed?"Your browser does not support installing things on ESP devices. Use Mozilla Firefox, Google Chrome or Microsoft Edge.":"You can only install ESP devices on HTTPS websites or on the localhost.");this.toggleAttribute("install-supported",!0);const o=document.createElement("slot");o.addEventListener("click",(async t=>{t.preventDefault(),e(this)})),o.name="activate";const n=document.createElement("button");if(n.innerText="Connect",o.append(n),"adoptedStyleSheets"in Document.prototype&&"replaceSync"in CSSStyleSheet.prototype){const e=new CSSStyleSheet;e.replaceSync(t.style),this.renderRoot.adoptedStyleSheets=[e]}else{const e=document.createElement("style");e.innerText=t.style,this.renderRoot.append(e)}this.renderRoot.append(o)}}t.isSupported="serial"in navigator,t.isAllowed=window.isSecureContext,t.style='\n button {\n position: relative;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n padding: 10px 24px;\n color: var(--esp-tools-button-text-color, #fff);\n background-color: var(--esp-tools-button-color, #03a9f4);\n border: none;\n border-radius: var(--esp-tools-button-border-radius, 9999px);\n }\n button::before {\n content: " ";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n opacity: 0.2;\n border-radius: var(--esp-tools-button-border-radius, 9999px);\n }\n button:hover::before {\n background-color: rgba(255,255,255,.8);\n }\n button:focus {\n outline: none;\n }\n button:focus::before {\n background-color: white;\n }\n button:active::before {\n background-color: grey;\n }\n :host([active]) button {\n color: rgba(0, 0, 0, 0.38);\n background-color: rgba(0, 0, 0, 0.12);\n box-shadow: none;\n cursor: unset;\n pointer-events: none;\n }\n .hidden {\n display: none;\n }',customElements.define("esp-web-install-button",t); diff --git a/site/static/vendor/esp-web-tools/install-dialog-im156JnI.js b/site/static/vendor/esp-web-tools/install-dialog-im156JnI.js new file mode 100644 index 0000000..5acce1c --- /dev/null +++ b/site/static/vendor/esp-web-tools/install-dialog-im156JnI.js @@ -0,0 +1,990 @@ +import{e,_ as t,o as i,i as r,x as s,a as o,n as a,t as n,m as l,b as d,E as c,c as h,s as p,D as u,d as f,f as m,r as v,g,h as _,j as b,k as y,B as x,l as w,p as E,q as S,u as k,T as A,v as R,w as I,y as C}from"./styles-sT2V1cOw.js";let T;function L(e,t=z){const i=$(e,t);return i&&(i.tabIndex=0,i.focus()),i}function O(e,t=z){const i=M(e,t);return i&&(i.tabIndex=0,i.focus()),i}function D(e,t=z){for(let i=0;i=0;i--){const r=e[i];if(t(r))return r}return null}function P(e,t,i=z,r=!0){if(t){const s=function(e,t,i=z,r=!0){for(let s=1;st&&!r)return null;const a=e[o];if(i(a))return a}return e[t]?e[t]:null}(e,t.index,i,r);return s&&(s.tabIndex=0,s.focus()),s}return O(e,i)}function z(e){return!e.disabled}const B={ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",Home:"Home",End:"End"};class U{constructor(e){this.handleKeydown=e=>{const t=e.key;if(e.defaultPrevented||!this.isNavigableKey(t))return;const i=this.items;if(!i.length)return;const r=D(i,this.isActivatable);e.preventDefault();const s=this.isRtl();let o=null;switch(t){case B.ArrowDown:case s?B.ArrowLeft:B.ArrowRight:o=P(i,r,this.isActivatable,this.wrapNavigation());break;case B.ArrowUp:case s?B.ArrowRight:B.ArrowLeft:o=F(i,r,this.isActivatable,this.wrapNavigation());break;case B.Home:o=L(i,this.isActivatable);break;case B.End:o=O(i,this.isActivatable)}o&&r&&r.item!==o&&(r.item.tabIndex=-1)},this.onDeactivateItems=()=>{const e=this.items;for(const t of e)this.deactivateItem(t)},this.onRequestActivation=e=>{this.onDeactivateItems();const t=e.target;this.activateItem(t),t.focus()},this.onSlotchange=()=>{const e=this.items;let t=!1;for(const i of e){!(!i.disabled&&i.tabIndex>-1)||t?i.tabIndex=-1:(t=!0,i.tabIndex=0)}if(t)return;const i=$(e,this.isActivatable);i&&(i.tabIndex=0)};const{isItem:t,getPossibleItems:i,isRtl:r,deactivateItem:s,activateItem:o,isNavigableKey:a,isActivatable:n,wrapNavigation:l}=e;this.isItem=t,this.getPossibleItems=i,this.isRtl=r,this.deactivateItem=s,this.activateItem=o,this.isNavigableKey=a,this.isActivatable=n,this.wrapNavigation=l??(()=>!0)}get items(){const e=this.getPossibleItems(),t=[];for(const i of e){if(this.isItem(i)){t.push(i);continue}const e=i.item;e&&this.isItem(e)&&t.push(e)}return t}activateNextItem(){const e=this.items,t=D(e,this.isActivatable);return t&&(t.item.tabIndex=-1),P(e,t,this.isActivatable,this.wrapNavigation())}activatePreviousItem(){const e=this.items,t=D(e,this.isActivatable);return t&&(t.item.tabIndex=-1),F(e,t,this.isActivatable,this.wrapNavigation())}}const N=new Set(Object.values(B));class H extends r{get items(){return this.listController.items}constructor(){super(),this.listController=new U({isItem:e=>e.hasAttribute("md-list-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:e=>{e.tabIndex=-1},activateItem:e=>{e.tabIndex=0},isNavigableKey:e=>N.has(e),isActivatable:e=>!e.disabled&&"text"!==e.type}),this.internals=this.attachInternals(),this.internals.role="list",this.addEventListener("keydown",this.listController.handleKeydown)}render(){return s` + + + `}activateNextItem(){return this.listController.activateNextItem()}activatePreviousItem(){return this.listController.activatePreviousItem()}}t([i({flatten:!0})],H.prototype,"slotItems",void 0);const q=o`:host{background:var(--md-list-container-color, var(--md-sys-color-surface, #fef7ff));color:unset;display:flex;flex-direction:column;outline:none;padding:8px 0;position:relative} +`;class G extends H{}G.styles=[q],customElements.define("ew-list",G);class W extends r{constructor(){super(...arguments),this.multiline=!1}render(){return s` + + +
+ + + + +
+ + + `}handleTextSlotChange(){let e=!1,t=0;for(const i of this.textSlots)if(Z(i)&&(t+=1),t>1){e=!0;break}this.multiline=e}}function Z(e){for(const i of e.assignedNodes({flatten:!0})){var t;const e=i.nodeType===Node.ELEMENT_NODE,r=i.nodeType===Node.TEXT_NODE&&(null===(t=i.textContent)||void 0===t?void 0:t.match(/\S/));if(e||r)return!0}return!1}t([a({type:Boolean,reflect:!0})],W.prototype,"multiline",void 0),t([function(t){return(i,r)=>e(i,r,{get(){return(this.renderRoot??T??(T=document.createDocumentFragment())).querySelectorAll(t)}})}(".text slot")],W.prototype,"textSlots",void 0);const V=o`:host{color:var(--md-sys-color-on-surface, #1d1b20);font-family:var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-large-size, 1rem);font-weight:var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-large-line-height, 1.5rem);align-items:center;box-sizing:border-box;display:flex;gap:16px;min-height:56px;overflow:hidden;padding:12px 16px;position:relative;text-overflow:ellipsis}:host([multiline]){min-height:72px}[name=overline]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-medium-size, 0.875rem);font-weight:var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-medium-line-height, 1.25rem)}[name=trailing-supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=container]::slotted(*){inset:0;position:absolute}.default-slot{display:inline}.default-slot,.text ::slotted(*){overflow:hidden;text-overflow:ellipsis}.text{display:flex;flex:1;flex-direction:column;overflow:hidden} +`;let j=class extends W{};j.styles=[V],j=t([n("md-item")],j);const K=Symbol.for(""),Y=e=>{if((null==e?void 0:e.r)===K)return null==e?void 0:e._$litStatic$},X=(e,...t)=>({_$litStatic$:t.reduce(((t,i,r)=>t+(e=>{if(void 0!==e._$litStatic$)return e._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(i)+e[r+1]),e[0]),r:K}),J=new Map,Q=(e=>(t,...i)=>{const r=i.length;let s,o;const a=[],n=[];let l,d=0,c=!1;for(;d +
+ ${this.renderRipple()} ${this.renderFocusRing()} +
+ + + ${this.renderBody()} + + `)}renderListItem(e){const t="link"===this.type;let i;switch(this.type){case"link":i=X`a`;break;case"button":i=X`button`;break;default:i=X`li`}const r="text"!==this.type,s=t&&this.target?this.target:c;return Q` + <${i} + id="item" + tabindex="${this.isDisabled||!r?-1:0}" + ?disabled=${this.isDisabled} + role="listitem" + aria-selected=${this.ariaSelected||c} + aria-checked=${this.ariaChecked||c} + aria-expanded=${this.ariaExpanded||c} + aria-haspopup=${this.ariaHasPopup||c} + class="list-item ${h(this.getRenderClasses())}" + href=${this.href||c} + target=${s} + @focus=${this.onFocus} + >${e} + `}renderRipple(){return"text"===this.type?c:s` `}renderFocusRing(){return"text"===this.type?c:s` `}onFocusRingVisibilityChanged(e){}getRenderClasses(){return{disabled:this.isDisabled}}renderBody(){return s` + + + + + + `}onFocus(){-1===this.tabIndex&&this.dispatchEvent(new Event("request-activation",{bubbles:!0,composed:!0}))}focus(){var e;null===(e=this.listItemRoot)||void 0===e||e.focus()}click(){this.listItemRoot?this.listItemRoot.click():super.click()}}te.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([a({type:Boolean,reflect:!0})],te.prototype,"disabled",void 0),t([a({reflect:!0})],te.prototype,"type",void 0),t([a({type:Boolean,attribute:"md-list-item",reflect:!0})],te.prototype,"isListItem",void 0),t([a()],te.prototype,"href",void 0),t([a()],te.prototype,"target",void 0),t([d(".list-item")],te.prototype,"listItemRoot",void 0);const ie=o`:host{display:flex;-webkit-tap-highlight-color:rgba(0,0,0,0);--md-ripple-hover-color: var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-list-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-list-item-pressed-state-layer-opacity, 0.12)}:host(:is([type=button]:not([disabled]),[type=link])){cursor:pointer}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;cursor:inherit;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);width:100%}.list-item.interactive{cursor:pointer}.list-item.disabled{opacity:var(--md-list-item-disabled-opacity, 0.3);pointer-events:none}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;height:100%;color:var(--md-list-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-list-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-list-item-one-line-container-height, 56px);padding-top:var(--md-list-item-top-space, 12px);padding-bottom:var(--md-list-item-bottom-space, 12px);padding-inline-start:var(--md-list-item-leading-space, 16px);padding-inline-end:var(--md-list-item-trailing-space, 16px)}md-item[multiline]{min-height:var(--md-list-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-list-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-list-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}@media(forced-colors: active){.disabled slot{color:GrayText}.list-item.disabled{color:GrayText;opacity:1}} +`;class re extends te{}re.styles=[ie],customElements.define("ew-list-item",re);class se extends u{}se.styles=[p],customElements.define("ew-divider",se);const oe=Symbol("createValidator"),ae=Symbol("getValidityAnchor"),ne=Symbol("privateValidator"),le=Symbol("privateSyncValidity"),de=Symbol("privateCustomValidationMessage");function ce(e){var t;class i extends e{constructor(){super(...arguments),this[t]=""}get validity(){return this[le](),this[f].validity}get validationMessage(){return this[le](),this[f].validationMessage}get willValidate(){return this[le](),this[f].willValidate}checkValidity(){return this[le](),this[f].checkValidity()}reportValidity(){return this[le](),this[f].reportValidity()}setCustomValidity(e){this[de]=e,this[le]()}requestUpdate(e,t,i){super.requestUpdate(e,t,i),this[le]()}firstUpdated(e){super.firstUpdated(e),this[le]()}[(t=de,le)](){this[ne]||(this[ne]=this[oe]());const{validity:e,validationMessage:t}=this[ne].getValidity(),i=!!this[de],r=this[de]||t;this[f].setValidity({...e,customError:i},r,this[ae]()??void 0)}[oe](){throw new Error("Implement [createValidator]")}[ae](){throw new Error("Implement [getValidityAnchor]")}}return i}const he=Symbol("getFormValue"),pe=Symbol("getFormState");function ue(e){class i extends e{get form(){return this[f].form}get labels(){return this[f].labels}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}attributeChangedCallback(e,t,i){if("name"!==e&&"disabled"!==e)super.attributeChangedCallback(e,t,i);else{const i="disabled"===e?null!==t:t;this.requestUpdate(e,i)}}requestUpdate(e,t,i){super.requestUpdate(e,t,i),this[f].setFormValue(this[he](),this[pe]())}[he](){throw new Error("Implement [getFormValue]")}[pe](){return this[he]()}formDisabledCallback(e){this.disabled=e}}return i.formAssociated=!0,t([a({noAccessor:!0})],i.prototype,"name",null),t([a({type:Boolean,noAccessor:!0})],i.prototype,"disabled",null),i}class fe{constructor(e){this.getCurrentState=e,this.currentValidity={validity:{},validationMessage:""}}getValidity(){const e=this.getCurrentState();if(!(!this.prevState||!this.equals(this.prevState,e)))return this.currentValidity;const{validity:t,validationMessage:i}=this.computeValidity(e);return this.prevState=this.copy(e),this.currentValidity={validationMessage:i,validity:{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing}},this.currentValidity}}class me extends fe{computeValidity(e){return this.checkboxControl||(this.checkboxControl=document.createElement("input"),this.checkboxControl.type="checkbox"),this.checkboxControl.checked=e.checked,this.checkboxControl.required=e.required,{validity:this.checkboxControl.validity,validationMessage:this.checkboxControl.validationMessage}}equals(e,t){return e.checked===t.checked&&e.required===t.required}copy({checked:e,required:t}){return{checked:e,required:t}}}const ve=l(ce(ue(m(r))));class ge extends ve{constructor(){super(),this.checked=!1,this.indeterminate=!1,this.required=!1,this.value="on",this.prevChecked=!1,this.prevDisabled=!1,this.prevIndeterminate=!1,this.addEventListener("click",(e=>{g(e)&&this.input&&(this.focus(),_(this.input))}))}update(e){(e.has("checked")||e.has("disabled")||e.has("indeterminate"))&&(this.prevChecked=e.get("checked")??this.checked,this.prevDisabled=e.get("disabled")??this.disabled,this.prevIndeterminate=e.get("indeterminate")??this.indeterminate),super.update(e)}render(){const e=!this.prevChecked&&!this.prevIndeterminate,t=this.prevChecked&&!this.prevIndeterminate,i=this.prevIndeterminate,r=this.checked&&!this.indeterminate,o=this.indeterminate,a=h({disabled:this.disabled,selected:r||o,unselected:!r&&!o,checked:r,indeterminate:o,"prev-unselected":e,"prev-checked":t,"prev-indeterminate":i,"prev-disabled":this.prevDisabled}),{ariaLabel:n,ariaInvalid:l}=this;return s` +
+ + +
+
+ + + +
+ `}handleInput(e){const t=e.target;this.checked=t.checked,this.indeterminate=t.indeterminate}handleChange(e){b(this,e)}[he](){return!this.checked||this.indeterminate?null:this.value}[pe](){return String(this.checked)}formResetCallback(){this.checked=this.hasAttribute("checked")}formStateRestoreCallback(e){this.checked="true"===e}[oe](){return new me((()=>this))}[ae](){return this.input}}ge.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([a({type:Boolean})],ge.prototype,"checked",void 0),t([a({type:Boolean})],ge.prototype,"indeterminate",void 0),t([a({type:Boolean})],ge.prototype,"required",void 0),t([a()],ge.prototype,"value",void 0),t([v()],ge.prototype,"prevChecked",void 0),t([v()],ge.prototype,"prevDisabled",void 0),t([v()],ge.prototype,"prevIndeterminate",void 0),t([d("input")],ge.prototype,"input",void 0);const _e=o`:host{border-start-start-radius:var(--md-checkbox-container-shape-start-start, var(--md-checkbox-container-shape, 2px));border-start-end-radius:var(--md-checkbox-container-shape-start-end, var(--md-checkbox-container-shape, 2px));border-end-end-radius:var(--md-checkbox-container-shape-end-end, var(--md-checkbox-container-shape, 2px));border-end-start-radius:var(--md-checkbox-container-shape-end-start, var(--md-checkbox-container-shape, 2px));display:inline-flex;height:var(--md-checkbox-container-size, 18px);position:relative;vertical-align:top;width:var(--md-checkbox-container-size, 18px);-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-checkbox-container-size, 18px))/2)}md-focus-ring{height:44px;inset:unset;width:44px}input{appearance:none;height:48px;margin:0;opacity:0;outline:none;position:absolute;width:48px;z-index:1;cursor:inherit}:host([touch-target=none]) input{height:100%;width:100%}.container{border-radius:inherit;display:flex;height:100%;place-content:center;place-items:center;position:relative;width:100%}.outline,.background,.icon{inset:0;position:absolute}.outline,.background{border-radius:inherit}.outline{border-color:var(--md-checkbox-outline-color, var(--md-sys-color-on-surface-variant, #49454f));border-style:solid;border-width:var(--md-checkbox-outline-width, 2px);box-sizing:border-box}.background{background-color:var(--md-checkbox-selected-container-color, var(--md-sys-color-primary, #6750a4))}.background,.icon{opacity:0;transition-duration:150ms,50ms;transition-property:transform,opacity;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15),linear;transform:scale(0.6)}:where(.selected) :is(.background,.icon){opacity:1;transition-duration:350ms,50ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1),linear;transform:scale(1)}md-ripple{border-radius:var(--md-checkbox-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));height:var(--md-checkbox-state-layer-size, 40px);inset:unset;width:var(--md-checkbox-state-layer-size, 40px);--md-ripple-hover-color: var(--md-checkbox-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-checkbox-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-opacity: var(--md-checkbox-pressed-state-layer-opacity, 0.12)}.selected md-ripple{--md-ripple-hover-color: var(--md-checkbox-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-checkbox-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-checkbox-selected-pressed-state-layer-opacity, 0.12)}.icon{fill:var(--md-checkbox-selected-icon-color, var(--md-sys-color-on-primary, #fff));height:var(--md-checkbox-icon-size, 18px);width:var(--md-checkbox-icon-size, 18px)}.mark.short{height:2px;transition-property:transform,height;width:2px}.mark.long{height:2px;transition-property:transform,width;width:10px}.mark{animation-duration:150ms;animation-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15);transition-duration:150ms;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15)}.selected .mark{animation-duration:350ms;animation-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1);transition-duration:350ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1)}.checked .mark,.prev-checked.unselected .mark{transform:scaleY(-1) translate(7px, -14px) rotate(45deg)}.checked .mark.short,.prev-checked.unselected .mark.short{height:5.6568542495px}.checked .mark.long,.prev-checked.unselected .mark.long{width:11.313708499px}.indeterminate .mark,.prev-indeterminate.unselected .mark{transform:scaleY(-1) translate(4px, -10px) rotate(0deg)}.prev-unselected .mark{transition-property:none}.prev-unselected.checked .mark.long{animation-name:prev-unselected-to-checked}@keyframes prev-unselected-to-checked{from{width:0}}:where(:hover) .outline{border-color:var(--md-checkbox-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-hover-outline-width, 2px)}:where(:hover) .background{background:var(--md-checkbox-selected-hover-container-color, var(--md-sys-color-primary, #6750a4))}:where(:hover) .icon{fill:var(--md-checkbox-selected-hover-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:focus-within) .outline{border-color:var(--md-checkbox-focus-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-focus-outline-width, 2px)}:where(:focus-within) .background{background:var(--md-checkbox-selected-focus-container-color, var(--md-sys-color-primary, #6750a4))}:where(:focus-within) .icon{fill:var(--md-checkbox-selected-focus-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:active) .outline{border-color:var(--md-checkbox-pressed-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-pressed-outline-width, 2px)}:where(:active) .background{background:var(--md-checkbox-selected-pressed-container-color, var(--md-sys-color-primary, #6750a4))}:where(:active) .icon{fill:var(--md-checkbox-selected-pressed-icon-color, var(--md-sys-color-on-primary, #fff))}:where(.disabled,.prev-disabled) :is(.background,.icon,.mark){animation-duration:0s;transition-duration:0s}:where(.disabled) .outline{border-color:var(--md-checkbox-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-disabled-outline-width, 2px);opacity:var(--md-checkbox-disabled-container-opacity, 0.38)}:where(.selected.disabled) .outline{visibility:hidden}:where(.selected.disabled) .background{background:var(--md-checkbox-selected-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-checkbox-selected-disabled-container-opacity, 0.38)}:where(.disabled) .icon{fill:var(--md-checkbox-selected-disabled-icon-color, var(--md-sys-color-surface, #fef7ff))}@media(forced-colors: active){.background{background-color:CanvasText}.selected.disabled .background{background-color:GrayText;opacity:1}.outline{border-color:CanvasText}.disabled .outline{border-color:GrayText;opacity:1}.icon{fill:Canvas}} +`;class be extends ge{}be.styles=[_e],customElements.define("ew-checkbox",be);class ye{constructor(e){this.targetElement=e,this.state={bold:!1,italic:!1,underline:!1,strikethrough:!1,foregroundColor:null,backgroundColor:null,carriageReturn:!1,lines:[],secret:!1}}logs(){return this.targetElement.innerText}processLine(e){const t=/(?:\033|\\033)(?:\[(.*?)[@-~]|\].*?(?:\007|\033\\))/g;let i=0;const r=document.createElement("span");r.classList.add("line");const s=e=>{if(""===e)return;const t=document.createElement("span");if(this.state.bold&&t.classList.add("log-bold"),this.state.italic&&t.classList.add("log-italic"),this.state.underline&&t.classList.add("log-underline"),this.state.strikethrough&&t.classList.add("log-strikethrough"),this.state.secret&&t.classList.add("log-secret"),null!==this.state.foregroundColor&&t.classList.add(`log-fg-${this.state.foregroundColor}`),null!==this.state.backgroundColor&&t.classList.add(`log-bg-${this.state.backgroundColor}`),t.appendChild(document.createTextNode(e)),r.appendChild(t),this.state.secret){const e=document.createElement("span");e.classList.add("log-secret-redacted"),e.appendChild(document.createTextNode("[redacted]")),r.appendChild(e)}};for(;;){const r=t.exec(e);if(null===r)break;const o=r.index;if(s(e.substring(i,o)),i=o+r[0].length,void 0!==r[1])for(const e of r[1].split(";"))switch(parseInt(e)){case 0:this.state.bold=!1,this.state.italic=!1,this.state.underline=!1,this.state.strikethrough=!1,this.state.foregroundColor=null,this.state.backgroundColor=null,this.state.secret=!1;break;case 1:this.state.bold=!0;break;case 3:this.state.italic=!0;break;case 4:this.state.underline=!0;break;case 5:this.state.secret=!0;break;case 6:this.state.secret=!1;break;case 9:this.state.strikethrough=!0;break;case 22:this.state.bold=!1;break;case 23:this.state.italic=!1;break;case 24:this.state.underline=!1;break;case 29:this.state.strikethrough=!1;break;case 30:this.state.foregroundColor="black";break;case 31:this.state.foregroundColor="red";break;case 32:this.state.foregroundColor="green";break;case 33:this.state.foregroundColor="yellow";break;case 34:this.state.foregroundColor="blue";break;case 35:this.state.foregroundColor="magenta";break;case 36:this.state.foregroundColor="cyan";break;case 37:this.state.foregroundColor="white";break;case 39:this.state.foregroundColor=null;break;case 41:this.state.backgroundColor="red";break;case 42:this.state.backgroundColor="green";break;case 43:this.state.backgroundColor="yellow";break;case 44:this.state.backgroundColor="blue";break;case 45:this.state.backgroundColor="magenta";break;case 46:this.state.backgroundColor="cyan";break;case 47:this.state.backgroundColor="white";break;case 40:case 49:this.state.backgroundColor=null}}return s(e.substring(i)),r}processLines(){const e=this.targetElement.scrollTop>this.targetElement.scrollHeight-this.targetElement.offsetHeight-50,t=this.state.carriageReturn,i=document.createDocumentFragment();if(0!=this.state.lines.length){for(const e of this.state.lines)this.state.carriageReturn&&"\n"!==e&&i.childElementCount&&i.removeChild(i.lastChild),i.appendChild(this.processLine(e)),this.state.carriageReturn=e.includes("\r");t&&"\n"!==this.state.lines[0]?this.targetElement.replaceChild(i,this.targetElement.lastChild):this.targetElement.appendChild(i),this.state.lines=[],e&&(this.targetElement.scrollTop=this.targetElement.scrollHeight)}}addLine(e){0==this.state.lines.length&&setTimeout((()=>this.processLines()),0),this.state.lines.push(e)}}const xe=e=>new Promise((t=>setTimeout(t,e)));class we{constructor(){this.chunks=""}transform(e,t){this.chunks+=e;const i=this.chunks.split(/\r?\n/);this.chunks=i.pop(),i.forEach((e=>t.enqueue(e+"\r\n")))}flush(e){e.enqueue(this.chunks)}}class Ee{transform(e,t){const i=new Date,r=i.getHours().toString().padStart(2,"0"),s=i.getMinutes().toString().padStart(2,"0"),o=i.getSeconds().toString().padStart(2,"0");t.enqueue(`[${r}:${s}:${o}]${e}`)}}class Se extends Error{}function ke(e){let t=e.length;for(;--t>=0;)e[t]=0}const Ae=256,Re=286,Ie=30,Ce=15,Te=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Le=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Oe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),De=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$e=new Array(576);ke($e);const Me=new Array(60);ke(Me);const Pe=new Array(512);ke(Pe);const Fe=new Array(256);ke(Fe);const ze=new Array(29);ke(ze);const Be=new Array(Ie);function Ue(e,t,i,r,s){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=s,this.has_stree=e&&e.length}let Ne,He,qe;function Ge(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}ke(Be);const We=e=>e<256?Pe[e]:Pe[256+(e>>>7)],Ze=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Ve=(e,t,i)=>{e.bi_valid>16-i?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<{Ve(e,i[2*t],i[2*t+1])},Ke=(e,t)=>{let i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},Ye=(e,t,i)=>{const r=new Array(16);let s,o,a=0;for(s=1;s<=Ce;s++)a=a+i[s-1]<<1,r[s]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=Ke(r[t]++,t))}},Xe=e=>{let t;for(t=0;t{e.bi_valid>8?Ze(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Qe=(e,t,i,r)=>{const s=2*t,o=2*i;return e[s]{const r=e.heap[i];let s=i<<1;for(;s<=e.heap_len&&(s{let r,s,o,a,n=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+n++],r+=(255&e.pending_buf[e.sym_buf+n++])<<8,s=e.pending_buf[e.sym_buf+n++],0===r?je(e,s,t):(o=Fe[s],je(e,o+Ae+1,t),a=Te[o],0!==a&&(s-=ze[o],Ve(e,s,a)),r--,o=We(r),je(e,o,i),a=Le[o],0!==a&&(r-=Be[o],Ve(e,r,a)))}while(n{const i=t.dyn_tree,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,n,l,d=-1;for(e.heap_len=0,e.heap_max=573,a=0;a>1;a>=1;a--)et(e,i,a);l=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],et(e,i,1),n=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=n,i[2*l]=i[2*a]+i[2*n],e.depth[l]=(e.depth[a]>=e.depth[n]?e.depth[a]:e.depth[n])+1,i[2*a+1]=i[2*n+1]=l,e.heap[1]=l++,et(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const i=t.dyn_tree,r=t.max_code,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,n=t.stat_desc.extra_base,l=t.stat_desc.max_length;let d,c,h,p,u,f,m=0;for(p=0;p<=Ce;p++)e.bl_count[p]=0;for(i[2*e.heap[e.heap_max]+1]=0,d=e.heap_max+1;d<573;d++)c=e.heap[d],p=i[2*i[2*c+1]+1]+1,p>l&&(p=l,m++),i[2*c+1]=p,c>r||(e.bl_count[p]++,u=0,c>=n&&(u=a[c-n]),f=i[2*c],e.opt_len+=f*(p+u),o&&(e.static_len+=f*(s[2*c+1]+u)));if(0!==m){do{for(p=l-1;0===e.bl_count[p];)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(p=l;0!==p;p--)for(c=e.bl_count[p];0!==c;)h=e.heap[--d],h>r||(i[2*h+1]!==p&&(e.opt_len+=(p-i[2*h+1])*i[2*h],i[2*h+1]=p),c--)}})(e,t),Ye(i,d,e.bl_count)},rt=(e,t,i)=>{let r,s,o=-1,a=t[1],n=0,l=7,d=4;for(0===a&&(l=138,d=3),t[2*(i+1)+1]=65535,r=0;r<=i;r++)s=a,a=t[2*(r+1)+1],++n{let r,s,o=-1,a=t[1],n=0,l=7,d=4;for(0===a&&(l=138,d=3),r=0;r<=i;r++)if(s=a,a=t[2*(r+1)+1],!(++n{Ve(e,0+(r?1:0),3),Je(e),Ze(e,i),Ze(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i};var nt=e=>{ot||((()=>{let e,t,i,r,s;const o=new Array(16);for(i=0,r=0;r<28;r++)for(ze[r]=i,e=0;e<1<>=7;r{let s,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t{let t;for(rt(e,e.dyn_ltree,e.l_desc.max_code),rt(e,e.dyn_dtree,e.d_desc.max_code),it(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*De[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),s=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=s&&(s=o)):s=o=i+5,i+4<=s&&-1!==t?at(e,t,i,r):4===e.strategy||o===s?(Ve(e,2+(r?1:0),3),tt(e,$e,Me)):(Ve(e,4+(r?1:0),3),((e,t,i,r)=>{let s;for(Ve(e,t-257,5),Ve(e,i-1,5),Ve(e,r-4,4),s=0;s(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(Fe[i]+Ae+1)]++,e.dyn_dtree[2*We(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Ve(e,2,3),je(e,256,$e),(e=>{16===e.bi_valid?(Ze(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var ct=(e,t,i,r)=>{let s=65535&e|0,o=e>>>16&65535|0,a=0;for(;0!==i;){a=i>2e3?2e3:i,i-=a;do{s=s+t[r++]|0,o=o+s|0}while(--a);s%=65521,o%=65521}return s|o<<16|0};const ht=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})());var pt=(e,t,i,r)=>{const s=ht,o=r+i;e^=-1;for(let i=r;i>>8^s[255&(e^t[i])];return-1^e},ut={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ft={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:mt,_tr_stored_block:vt,_tr_flush_block:gt,_tr_tally:_t,_tr_align:bt}=dt,{Z_NO_FLUSH:yt,Z_PARTIAL_FLUSH:xt,Z_FULL_FLUSH:wt,Z_FINISH:Et,Z_BLOCK:St,Z_OK:kt,Z_STREAM_END:At,Z_STREAM_ERROR:Rt,Z_DATA_ERROR:It,Z_BUF_ERROR:Ct,Z_DEFAULT_COMPRESSION:Tt,Z_FILTERED:Lt,Z_HUFFMAN_ONLY:Ot,Z_RLE:Dt,Z_FIXED:$t,Z_DEFAULT_STRATEGY:Mt,Z_UNKNOWN:Pt,Z_DEFLATED:Ft}=ft,zt=258,Bt=262,Ut=42,Nt=113,Ht=666,qt=(e,t)=>(e.msg=ut[t],t),Gt=e=>2*e-(e>4?9:0),Wt=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Zt=e=>{let t,i,r,s=e.w_size;t=e.hash_size,r=t;do{i=e.head[--r],e.head[r]=i>=s?i-s:0}while(--t);t=s,r=t;do{i=e.prev[--r],e.prev[r]=i>=s?i-s:0}while(--t)};let Vt=(e,t,i)=>(t<{let i;if(e.legacy_hash)i=e.ins_h=Vt(e,e.ins_h,e.window[t+3-1]);else{const r=e.window,s=r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24;i=e.ins_h=Math.imul(s,66521)+66521>>>16&e.hash_mask}const r=e.prev[t&e.w_mask]=e.head[i];return e.head[i]=t,r},Kt=e=>{const t=e.state;let i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},Yt=(e,t)=>{gt(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Kt(e.strm)},Xt=(e,t)=>{e.pending_buf[e.pending++]=t},Jt=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Qt=(e,t,i,r)=>{let s=e.avail_in;return s>r&&(s=r),0===s?0:(e.avail_in-=s,t.set(e.input.subarray(e.next_in,e.next_in+s),i),1===e.state.wrap?e.adler=ct(e.adler,t,s,i):2===e.state.wrap&&(e.adler=pt(e.adler,t,s,i)),e.next_in+=s,e.total_in+=s,s)},ei=(e,t)=>{let i,r,s=e.max_chain_length,o=e.strstart,a=e.prev_length,n=e.nice_match;const l=e.strstart>e.w_size-Bt?e.strstart-(e.w_size-Bt):0,d=e.window,c=e.w_mask,h=e.prev,p=e.strstart+zt;let u=d[o+a-1],f=d[o+a];e.prev_length>=e.good_match&&(s>>=2),n>e.lookahead&&(n=e.lookahead);do{if(i=t,d[i+a]===f&&d[i+a-1]===u&&d[i]===d[o]&&d[++i]===d[o+1]){o+=2,i++;do{}while(d[++o]===d[++i]&&d[++o]===d[++i]&&d[++o]===d[++i]&&d[++o]===d[++i]&&d[++o]===d[++i]&&d[++o]===d[++i]&&d[++o]===d[++i]&&d[++o]===d[++i]&&oa){if(e.match_start=t,a=r,r>=n)break;u=d[o+a-1],f=d[o+a]}}}while((t=h[t&c])>l&&0!=--s);return a<=e.lookahead?a:e.lookahead},ti=e=>{const t=e.w_size;let i,r,s;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Bt)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Zt(e),r+=t),0===e.strm.avail_in)break;if(i=Qt(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=i,e.legacy_hash){if(e.lookahead+e.insert>=3)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=Vt(e,e.ins_h,e.window[s+1]);e.insert&&(jt(e,s),s++,e.insert--,!(e.lookahead+e.insert<3)););}else if(e.lookahead+e.insert>3)for(s=e.strstart-e.insert;e.insert&&(jt(e,s),s++,e.insert--,!(e.lookahead+e.insert<=3)););}while(e.lookahead{let i,r,s,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,n=e.strm.avail_in;do{if(i=65535,s=e.bi_valid+42>>3,e.strm.avail_outr+e.strm.avail_in&&(i=r+e.strm.avail_in),i>s&&(i=s),i>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,Kt(e.strm),r&&(r>i&&(r=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,i-=r),i&&(Qt(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(0===a);return n-=e.strm.avail_in,n&&(n>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=n&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-n,e.strm.next_in),e.strstart),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.block_start=e.strstart),e.high_waters&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,s+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),s>e.strm.avail_in&&(s=e.strm.avail_in),s&&(Qt(e.strm,e.window,e.strstart,s),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.high_water>3,s=e.pending_buf_size-s>65535?65535:e.pending_buf_size-s,o=s>e.w_size?e.w_size:s,r=e.strstart-e.block_start,(r>=o||(r||t===Et)&&t!==yt&&0===e.strm.avail_in&&r<=s)&&(i=r>s?s:r,a=t===Et&&0===e.strm.avail_in&&i===r?1:0,vt(e,e.block_start,i,a),e.block_start+=i,Kt(e.strm)),a?3:1)},ri=(e,t)=>{let i,r;for(;;){if(e.lookahead=3&&(i=jt(e,e.strstart)),0!==i&&e.strstart-i<=e.w_size-Bt&&(e.match_length=ei(e,i)),e.match_length>=3)if(r=_t(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,i=jt(e,e.strstart)}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=Vt(e,e.ins_h,e.window[e.strstart+1]));else r=_t(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Yt(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Et?(Yt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Yt(e,!1),0===e.strm.avail_out)?1:2},si=(e,t)=>{let i,r,s;for(;;){if(e.lookahead=3&&(i=jt(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){s=e.strstart+e.lookahead-3,r=_t(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=s&&(i=jt(e,e.strstart))}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(Yt(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=_t(e,0,e.window[e.strstart-1]),r&&Yt(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=_t(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Et?(Yt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Yt(e,!1),0===e.strm.avail_out)?1:2};function oi(e,t,i,r,s){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=s}const ai=[new oi(0,0,0,0,ii),new oi(4,4,8,4,ri),new oi(4,5,16,8,ri),new oi(4,6,32,32,ri),new oi(4,4,16,16,si),new oi(8,16,32,32,si),new oi(8,16,128,128,si),new oi(8,32,128,256,si),new oi(32,128,258,1024,si),new oi(32,258,258,4096,si)];function ni(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ft,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Wt(this.dyn_ltree),Wt(this.dyn_dtree),Wt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Wt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Wt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const li=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Ut&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Nt&&t.status!==Ht?1:0},di=e=>{if(li(e))return qt(e,Rt);e.total_in=e.total_out=0,e.data_type=Pt;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Ut:Nt,e.adler=2===t.wrap?0:1,t.last_flush=-2,mt(t),kt},ci=e=>{const t=di(e);var i;return t===kt&&((i=e.state).window_size=2*i.w_size,Wt(i.head),i.max_lazy_match=ai[i.level].max_lazy,i.good_match=ai[i.level].good_length,i.nice_match=ai[i.level].nice_length,i.max_chain_length=ai[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=2,i.match_available=0,i.ins_h=0),t},hi=(e,t,i,r,s,o,a)=>{if(!e)return Rt;let n=1;if(t===Tt&&(t=6),r<0?(n=0,r=-r):r>15&&(n=2,r-=16),s<1||s>9||i!==Ft||r<8||r>15||t<0||t>9||o<0||o>$t||8===r&&1!==n)return qt(e,Rt);8===r&&(r=9);const l=new ni;return e.state=l,l.strm=e,l.status=Ut,l.wrap=n,l.gzhead=null,l.w_bits=r,l.w_size=1<{let i=t.length;if(li(e))return Rt;const r=e.state,s=r.wrap;if(2===s||1===s&&r.status!==Ut||r.lookahead)return Rt;if(1===s&&(e.adler=ct(e.adler,t,i,0)),r.wrap=0,i>=r.w_size){0===s&&(Wt(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(i-r.w_size,i),0),t=e,i=r.w_size}const o=e.avail_in,a=e.next_in,n=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,ti(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{jt(r,e),e++}while(--t);r.strstart=e,r.lookahead=2,ti(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=n,e.avail_in=o,r.wrap=s,kt},ui={deflateInit:(e,t)=>hi(e,t,Ft,15,8,Mt),deflateInit2:hi,deflateReset:ci,deflateResetKeep:di,deflateSetHeader:(e,t)=>li(e)||2!==e.state.wrap?Rt:(e.state.gzhead=t,kt),deflate:(e,t)=>{if(li(e)||t>St||t<0)return e?qt(e,Rt):Rt;const i=e.state;if(!e.output||0!==e.avail_in&&!e.input||i.status===Ht&&t!==Et)return qt(e,0===e.avail_out?Ct:Rt);const r=i.last_flush;if(i.last_flush=t,0!==i.pending){if(Kt(e),0===e.avail_out)return i.last_flush=-1,kt}else if(0===e.avail_in&&Gt(t)<=Gt(r)&&t!==Et)return qt(e,Ct);if(i.status===Ht&&0!==e.avail_in)return qt(e,Ct);if(i.status===Ut&&0===i.wrap&&(i.status=Nt),i.status===Ut){let t=Ft+(i.w_bits-8<<4)<<8,r=-1;if(r=i.strategy>=Ot||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=r<<6,0!==i.strstart&&(t|=32),t+=31-t%31,Jt(i,t),0!==i.strstart&&(Jt(i,e.adler>>>16),Jt(i,65535&e.adler)),e.adler=1,i.status=Nt,Kt(e),0!==i.pending)return i.last_flush=-1,kt}if(57===i.status)if(e.adler=0,Xt(i,31),Xt(i,139),Xt(i,8),i.gzhead)Xt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Xt(i,255&i.gzhead.time),Xt(i,i.gzhead.time>>8&255),Xt(i,i.gzhead.time>>16&255),Xt(i,i.gzhead.time>>24&255),Xt(i,9===i.level?2:i.strategy>=Ot||i.level<2?4:0),Xt(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(Xt(i,255&i.gzhead.extra.length),Xt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=pt(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(Xt(i,0),Xt(i,0),Xt(i,0),Xt(i,0),Xt(i,0),Xt(i,9===i.level?2:i.strategy>=Ot||i.level<2?4:0),Xt(i,3),i.status=Nt,Kt(e),0!==i.pending)return i.last_flush=-1,kt;if(69===i.status){if(i.gzhead.extra){let t=i.pending,r=(65535&i.gzhead.extra.length)-i.gzindex;for(;i.pending+r>i.pending_buf_size;){let s=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+s),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>t&&(e.adler=pt(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex+=s,Kt(e),0!==i.pending)return i.last_flush=-1,kt;t=0,r-=s}let s=new Uint8Array(i.gzhead.extra);i.pending_buf.set(s.subarray(i.gzindex,i.gzindex+r),i.pending),i.pending+=r,i.gzhead.hcrc&&i.pending>t&&(e.adler=pt(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){let t,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(e.adler=pt(e.adler,i.pending_buf,i.pending-r,r)),Kt(e),0!==i.pending)return i.last_flush=-1,kt;r=0}t=i.gzindexr&&(e.adler=pt(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){let t,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(e.adler=pt(e.adler,i.pending_buf,i.pending-r,r)),Kt(e),0!==i.pending)return i.last_flush=-1,kt;r=0}t=i.gzindexr&&(e.adler=pt(e.adler,i.pending_buf,i.pending-r,r))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(Kt(e),0!==i.pending))return i.last_flush=-1,kt;Xt(i,255&e.adler),Xt(i,e.adler>>8&255),e.adler=0}if(i.status=Nt,Kt(e),0!==i.pending)return i.last_flush=-1,kt}if(0!==e.avail_in||0!==i.lookahead||t!==yt&&i.status!==Ht){let r=0===i.level?ii(i,t):i.strategy===Ot?((e,t)=>{let i;for(;;){if(0===e.lookahead&&(ti(e),0===e.lookahead)){if(t===yt)return 1;break}if(e.match_length=0,i=_t(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(Yt(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Et?(Yt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Yt(e,!1),0===e.strm.avail_out)?1:2})(i,t):i.strategy===Dt?((e,t)=>{let i,r,s,o;const a=e.window;for(;;){if(e.lookahead<=zt){if(ti(e),e.lookahead<=zt&&t===yt)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(s=e.strstart-1,r=a[s],r===a[++s]&&r===a[++s]&&r===a[++s])){o=e.strstart+zt;do{}while(r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&se.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=_t(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=_t(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(Yt(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Et?(Yt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Yt(e,!1),0===e.strm.avail_out)?1:2})(i,t):ai[i.level].func(i,t);if(3!==r&&4!==r||(i.status=Ht),1===r||3===r)return 0===e.avail_out&&(i.last_flush=-1),kt;if(2===r&&(t===xt?bt(i):t!==St&&(vt(i,0,0,!1),t===wt&&(Wt(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),Kt(e),0===e.avail_out))return i.last_flush=-1,kt}return t!==Et?kt:i.wrap<=0?At:(2===i.wrap?(Xt(i,255&e.adler),Xt(i,e.adler>>8&255),Xt(i,e.adler>>16&255),Xt(i,e.adler>>24&255),Xt(i,255&e.total_in),Xt(i,e.total_in>>8&255),Xt(i,e.total_in>>16&255),Xt(i,e.total_in>>24&255)):(Jt(i,e.adler>>>16),Jt(i,65535&e.adler)),Kt(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?kt:At)},deflateEnd:e=>{if(li(e))return Rt;const t=e.state.status;return e.state=null,t===Nt?qt(e,It):kt},deflateSetDictionary:pi,deflateInfo:"pako deflate (from Nodeca project)"};const fi=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var mi={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)fi(i,t)&&(e[t]=i[t])}}return e},flattenChunks:e=>{let t=0;for(let i=0,r=e.length;i=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;gi[254]=gi[255]=1;var _i={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,r,s,o,a=e.length,n=0;for(s=0;s>>6,t[o++]=128|63&i):i<65536?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|63&i):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|63&i);return t},buf2string:(e,t)=>{const i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,s;const o=new Array(2*i);for(s=0,r=0;r4)o[s++]=65533,r+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&r1?o[s++]=65533:t<65536?o[s++]=t:(t-=65536,o[s++]=55296|t>>10&1023,o[s++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&vi)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let r=0;r{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+gi[e[i]]>t?i:t}};var bi=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const yi=Object.prototype.toString,{Z_NO_FLUSH:xi,Z_SYNC_FLUSH:wi,Z_FULL_FLUSH:Ei,Z_FINISH:Si,Z_OK:ki,Z_STREAM_END:Ai,Z_DEFAULT_COMPRESSION:Ri,Z_DEFAULT_STRATEGY:Ii,Z_DEFLATED:Ci}=ft,Ti={level:Ri,method:Ci,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ii,legacyHash:!0};function Li(e){this.options=mi.assign({},Ti,e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bi,this.strm.avail_out=0;let i=ui.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(i!==ki)throw new Error(ut[i]);if(t.header&&ui.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?_i.string2buf(t.dictionary):"[object ArrayBuffer]"===yi.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,i=ui.deflateSetDictionary(this.strm,e),i!==ki)throw new Error(ut[i]);this._dict_set=!0}}Li.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize;let s,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Si:xi,"string"==typeof e?i.input=_i.string2buf(e):"[object ArrayBuffer]"===yi.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(o===wi||o===Ei)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(s=ui.deflate(i,o),s===Ai)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),s=ui.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===ki;if(0!==i.avail_out){if(o>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},Li.prototype.onData=function(e){this.chunks.push(e)},Li.prototype.onEnd=function(e){e===ki&&(this.result=mi.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Oi={deflate:function(e,t){const i=new Li(t);if(i.push(e,!0),i.err)throw i.msg||ut[i.err];return i.result}};const Di=16209;var $i=function(e,t){let i,r,s,o,a,n,l,d,c,h,p,u,f,m,v,g,_,b,y,x,w,E,S,k;const A=e.state;i=e.next_in,S=e.input,r=i+(e.avail_in-5),s=e.next_out,k=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),n=A.dmax,l=A.wsize,d=A.whave,c=A.wnext,h=A.window,p=A.hold,u=A.bits,f=A.lencode,m=A.distcode,v=(1<>>24,p>>>=b,u-=b,b=_>>>16&255,0===b)k[s++]=65535&_;else{if(!(16&b)){if(0==(64&b)){_=f[(65535&_)+(p&(1<>>=b,u-=b),u<15&&(p+=S[i++]<>>24,p>>>=b,u-=b,b=_>>>16&255,!(16&b)){if(0==(64&b)){_=m[(65535&_)+(p&(1<n){e.msg="invalid distance too far back",A.mode=Di;break e}if(p>>>=b,u-=b,b=s-o,x>b){if(b=x-b,b>d&&A.sane){e.msg="invalid distance too far back",A.mode=Di;break e}if(w=0,E=h,0===c){if(w+=l-b,b2;)k[s++]=E[w++],k[s++]=E[w++],k[s++]=E[w++],y-=3;y&&(k[s++]=E[w++],y>1&&(k[s++]=E[w++]))}else{w=s-x;do{k[s++]=k[w++],k[s++]=k[w++],k[s++]=k[w++],y-=3}while(y>2);y&&(k[s++]=k[w++],y>1&&(k[s++]=k[w++]))}break}}break}}while(i>3,i-=y,u-=y<<3,p&=(1<{const l=n.bits;let d,c,h,p,u,f,m=0,v=0,g=0,_=0,b=0,y=0,x=0,w=0,E=0,S=0,k=null;const A=new Uint16Array(16),R=new Uint16Array(16);let I,C,T,L=null;for(m=0;m<=Mi;m++)A[m]=0;for(v=0;v=1&&0===A[_];_--);if(b>_&&(b=_),0===_)return s[o++]=20971520,s[o++]=20971520,n.bits=1,0;for(g=1;g<_&&0===A[g];g++);for(b0&&(0===e||1!==_))return-1;for(R[1]=0,m=1;m852||2===e&&E>592)return 1;for(;;){I=m-x,a[v]+1=f?(C=L[a[v]-f],T=k[a[v]-f]):(C=96,T=0),d=1<>x)+c]=I<<24|C<<16|T|0}while(0!==c);for(d=1<>=1;if(0!==d?(S&=d-1,S+=d):S=0,v++,0==--A[m]){if(m===_)break;m=t[i+a[v]]}if(m>b&&(S&p)!==h){for(0===x&&(x=b),u+=g,y=m-x,w=1<852||2===e&&E>592)return 1;h=S&p,s[h]=b<<24|y<<16|u-o|0}}return 0!==S&&(s[u+S]=m-x<<24|64<<16|0),n.bits=b,0};const{Z_FINISH:Ni,Z_BLOCK:Hi,Z_TREES:qi,Z_OK:Gi,Z_STREAM_END:Wi,Z_NEED_DICT:Zi,Z_STREAM_ERROR:Vi,Z_DATA_ERROR:ji,Z_MEM_ERROR:Ki,Z_BUF_ERROR:Yi,Z_DEFLATED:Xi}=ft,Ji=16180,Qi=16190,er=16191,tr=16192,ir=16194,rr=16199,sr=16200,or=16206,ar=16209,nr=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function lr(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const dr=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode16211?1:0},cr=e=>{if(dr(e))return Vi;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Ji,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Gi},hr=e=>{if(dr(e))return Vi;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,cr(e)},pr=(e,t)=>{let i;if(dr(e))return Vi;const r=e.state;return t<0?(i=0,t=-t):(i=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Vi:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=i,r.wbits=t,hr(e))},ur=(e,t)=>{if(!e)return Vi;const i=new lr;e.state=i,i.strm=e,i.window=null,i.mode=Ji;const r=pr(e,t);return r!==Gi&&(e.state=null),r};let fr,mr,vr=!0;const gr=e=>{if(vr){fr=new Int32Array(512),mr=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ui(1,e.lens,0,288,fr,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ui(2,e.lens,0,32,mr,0,e.work,{bits:5}),vr=!1}e.lencode=fr,e.lenbits=9,e.distcode=mr,e.distbits=5},_r=(e,t,i,r)=>{let s;const o=e.state;return null===o.window&&(o.window=new Uint8Array(1<=o.wsize?(o.window.set(t.subarray(i-o.wsize,i),0),o.wnext=0,o.whave=o.wsize):(s=o.wsize-o.wnext,s>r&&(s=r),o.window.set(t.subarray(i-r,i-r+s),o.wnext),(r-=s)?(o.window.set(t.subarray(i-r,i),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave{let i,r,s,o,a,n,l,d,c,h,p,u,f,m,v,g,_,b,y,x,w,E,S=0;const k=new Uint8Array(4);let A,R;const I=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(dr(e)||!e.output||!e.input&&0!==e.avail_in)return Vi;i=e.state,i.mode===er&&(i.mode=tr),a=e.next_out,s=e.output,l=e.avail_out,o=e.next_in,r=e.input,n=e.avail_in,d=i.hold,c=i.bits,h=n,p=l,E=Gi;e:for(;;)switch(i.mode){case Ji:if(0===i.wrap){i.mode=tr;break}for(;c<16;){if(0===n)break e;n--,d+=r[o++]<>>8&255,i.check=pt(i.check,k,2,0),d=0,c=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&d)<<8)+(d>>8))%31){e.msg="incorrect header check",i.mode=ar;break}if((15&d)!==Xi){e.msg="unknown compression method",i.mode=ar;break}if(d>>>=4,c-=4,w=8+(15&d),0===i.wbits&&(i.wbits=w),w>15||w>i.wbits){e.msg="invalid window size",i.mode=ar;break}i.dmax=1<>8&1),512&i.flags&&4&i.wrap&&(k[0]=255&d,k[1]=d>>>8&255,i.check=pt(i.check,k,2,0)),d=0,c=0,i.mode=16182;case 16182:for(;c<32;){if(0===n)break e;n--,d+=r[o++]<>>8&255,k[2]=d>>>16&255,k[3]=d>>>24&255,i.check=pt(i.check,k,4,0)),d=0,c=0,i.mode=16183;case 16183:for(;c<16;){if(0===n)break e;n--,d+=r[o++]<>8),512&i.flags&&4&i.wrap&&(k[0]=255&d,k[1]=d>>>8&255,i.check=pt(i.check,k,2,0)),d=0,c=0,i.mode=16184;case 16184:if(1024&i.flags){for(;c<16;){if(0===n)break e;n--,d+=r[o++]<>>8&255,i.check=pt(i.check,k,2,0)),d=0,c=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&(u=i.length,u>n&&(u=n),u&&(i.head&&(w=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(o,o+u),w)),512&i.flags&&4&i.wrap&&(i.check=pt(i.check,r,u,o)),n-=u,o+=u,i.length-=u),i.length))break e;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===n)break e;u=0;do{w=r[o+u++],i.head&&w&&i.length<65536&&(i.head.name+=String.fromCharCode(w))}while(w&&u>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=er;break;case 16189:for(;c<32;){if(0===n)break e;n--,d+=r[o++]<>>=7&c,c-=7&c,i.mode=or;break}for(;c<3;){if(0===n)break e;n--,d+=r[o++]<>>=1,c-=1,3&d){case 0:i.mode=16193;break;case 1:if(gr(i),i.mode=rr,t===qi){d>>>=2,c-=2;break e}break;case 2:i.mode=16196;break;case 3:e.msg="invalid block type",i.mode=ar}d>>>=2,c-=2;break;case 16193:for(d>>>=7&c,c-=7&c;c<32;){if(0===n)break e;n--,d+=r[o++]<>>16^65535)){e.msg="invalid stored block lengths",i.mode=ar;break}if(i.length=65535&d,d=0,c=0,i.mode=ir,t===qi)break e;case ir:i.mode=16195;case 16195:if(u=i.length,u){if(u>n&&(u=n),u>l&&(u=l),0===u)break e;s.set(r.subarray(o,o+u),a),n-=u,o+=u,l-=u,a+=u,i.length-=u;break}i.mode=er;break;case 16196:for(;c<14;){if(0===n)break e;n--,d+=r[o++]<>>=5,c-=5,i.ndist=1+(31&d),d>>>=5,c-=5,i.ncode=4+(15&d),d>>>=4,c-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=ar;break}i.have=0,i.mode=16197;case 16197:for(;i.have>>=3,c-=3}for(;i.have<19;)i.lens[I[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,A={bits:i.lenbits},E=Ui(0,i.lens,0,19,i.lencode,0,i.work,A),i.lenbits=A.bits,E){e.msg="invalid code lengths set",i.mode=ar;break}i.have=0,i.mode=16198;case 16198:for(;i.have>>24,g=S>>>16&255,_=65535&S,!(v<=c);){if(0===n)break e;n--,d+=r[o++]<>>=v,c-=v,i.lens[i.have++]=_;else{if(16===_){for(R=v+2;c>>=v,c-=v,0===i.have){e.msg="invalid bit length repeat",i.mode=ar;break}w=i.lens[i.have-1],u=3+(3&d),d>>>=2,c-=2}else if(17===_){for(R=v+3;c>>=v,c-=v,w=0,u=3+(7&d),d>>>=3,c-=3}else{for(R=v+7;c>>=v,c-=v,w=0,u=11+(127&d),d>>>=7,c-=7}if(i.have+u>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=ar;break}for(;u--;)i.lens[i.have++]=w}}if(i.mode===ar)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=ar;break}if(i.lenbits=9,A={bits:i.lenbits},E=Ui(1,i.lens,0,i.nlen,i.lencode,0,i.work,A),i.lenbits=A.bits,E){e.msg="invalid literal/lengths set",i.mode=ar;break}if(i.distbits=6,i.distcode=i.distdyn,A={bits:i.distbits},E=Ui(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,A),i.distbits=A.bits,E){e.msg="invalid distances set",i.mode=ar;break}if(i.mode=rr,t===qi)break e;case rr:i.mode=sr;case sr:if(n>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=n,i.hold=d,i.bits=c,$i(e,p),a=e.next_out,s=e.output,l=e.avail_out,o=e.next_in,r=e.input,n=e.avail_in,d=i.hold,c=i.bits,i.mode===er&&(i.back=-1);break}for(i.back=0;S=i.lencode[d&(1<>>24,g=S>>>16&255,_=65535&S,!(v<=c);){if(0===n)break e;n--,d+=r[o++]<>b)],v=S>>>24,g=S>>>16&255,_=65535&S,!(b+v<=c);){if(0===n)break e;n--,d+=r[o++]<>>=b,c-=b,i.back+=b}if(d>>>=v,c-=v,i.back+=v,i.length=_,0===g){i.mode=16205;break}if(32&g){i.back=-1,i.mode=er;break}if(64&g){e.msg="invalid literal/length code",i.mode=ar;break}i.extra=15&g,i.mode=16201;case 16201:if(i.extra){for(R=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;S=i.distcode[d&(1<>>24,g=S>>>16&255,_=65535&S,!(v<=c);){if(0===n)break e;n--,d+=r[o++]<>b)],v=S>>>24,g=S>>>16&255,_=65535&S,!(b+v<=c);){if(0===n)break e;n--,d+=r[o++]<>>=b,c-=b,i.back+=b}if(d>>>=v,c-=v,i.back+=v,64&g){e.msg="invalid distance code",i.mode=ar;break}i.offset=_,i.extra=15&g,i.mode=16203;case 16203:if(i.extra){for(R=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=ar;break}i.mode=16204;case 16204:if(0===l)break e;if(u=p-l,i.offset>u){if(u=i.offset-u,u>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=ar;break}u>i.wnext?(u-=i.wnext,f=i.wsize-u):f=i.wnext-u,u>i.length&&(u=i.length),m=i.window}else m=s,f=a-i.offset,u=i.length;u>l&&(u=l),l-=u,i.length-=u;do{s[a++]=m[f++]}while(--u);0===i.length&&(i.mode=sr);break;case 16205:if(0===l)break e;s[a++]=i.length,l--,i.mode=sr;break;case or:if(i.wrap){for(;c<32;){if(0===n)break e;n--,d|=r[o++]<ur(e,15),inflateInit2:ur,inflate:br,inflateEnd:e=>{if(dr(e))return Vi;let t=e.state;return t.window&&(t.window=null),e.state=null,Gi},inflateGetHeader:(e,t)=>{if(dr(e))return Vi;const i=e.state;return 0==(2&i.wrap)?Vi:(i.head=t,t.done=!1,Gi)},inflateSetDictionary:(e,t)=>{const i=t.length;let r,s,o;return dr(e)?Vi:(r=e.state,0!==r.wrap&&r.mode!==Qi?Vi:r.mode===Qi&&(s=1,s=ct(s,t,i,0),s!==r.check)?ji:(o=_r(e,t,i,i),o?(r.mode=16210,Ki):(r.havedict=1,Gi)))},inflateInfo:"pako inflate (from Nodeca project)"};var xr=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const wr=Object.prototype.toString,{Z_NO_FLUSH:Er,Z_FINISH:Sr,Z_OK:kr,Z_STREAM_END:Ar,Z_NEED_DICT:Rr,Z_STREAM_ERROR:Ir,Z_DATA_ERROR:Cr,Z_MEM_ERROR:Tr,Z_BUF_ERROR:Lr}=ft,Or={chunkSize:65536,windowBits:15,to:""};function Dr(e){this.options=mi.assign({},Or,e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bi,this.strm.avail_out=0;let i=yr.inflateInit2(this.strm,t.windowBits);if(i!==kr)throw new Error(ut[i]);if(this.header=new xr,yr.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=_i.string2buf(t.dictionary):"[object ArrayBuffer]"===wr.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=yr.inflateSetDictionary(this.strm,t.dictionary),i!==kr)))throw new Error(ut[i])}Dr.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize,s=this.options.dictionary;let o,a,n;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Sr:Er,"[object ArrayBuffer]"===wr.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),o=yr.inflate(i,a),o===Rr&&s&&(o=yr.inflateSetDictionary(i,s),o===kr?o=yr.inflate(i,a):o===Cr&&(o=Rr));i.avail_in>0&&o===Ar&&2&i.state.wrap&&0!==i.state.flags&&0!==i.input[i.next_in];)yr.inflateReset(i),o=yr.inflate(i,a);switch(o){case Ir:case Cr:case Rr:case Tr:return this.onEnd(o),this.ended=!0,!1}if(n=i.avail_out,i.next_out&&(0===i.avail_out||o===Ar||a>0))if("string"===this.options.to){let e=_i.utf8border(i.output,i.next_out),t=i.next_out-e,s=_i.buf2string(i.output,e);i.next_out=t,i.avail_out=r-t,t&&i.output.set(i.output.subarray(e,e+t),0),this.onData(s)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out)),i.avail_out=0,i.next_out=0;if(o!==kr&&o!==Lr||0!==n){if(o===Ar)return o=yr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===i.avail_in){if(a===Sr)return o=yr.inflateEnd(this.strm),this.onEnd(o===kr?Lr:o),this.ended=!0,!1;break}}}return!0},Dr.prototype.onData=function(e){this.chunks.push(e)},Dr.prototype.onEnd=function(e){e===kr&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=mi.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var $r={Inflate:Dr};const{deflate:Mr}=Oi,{Inflate:Pr}=$r;var Fr=Mr,zr=Pr;function Br(e,t,i=255){const r=e.length%t;if(0!==r){const s=new Uint8Array(t-r).fill(i),o=new Uint8Array(e.length+s.length);return o.set(e),o.set(s,e.length),o}return e}function Ur(e,t=239){for(let i=0;isetTimeout(t,e)))}class qr{constructor(e,t=!1,i=!0){this.device=e,this.tracing=t,this.slipReaderEnabled=!1,this.baudrate=0,this.traceLog="",this.lastTraceTime=Date.now(),this.buffer=new Uint8Array(0),this.onDeviceLostCallback=null,this.SLIP_END=192,this.SLIP_ESC=219,this.SLIP_ESC_END=220,this.SLIP_ESC_ESC=221,this._DTR_state=!1,this.slipReaderEnabled=i}setDeviceLostCallback(e){this.onDeviceLostCallback=e}updateDevice(e){this.device=e,this.trace("Device reference updated")}getInfo(){const e=this.device.getInfo();return e.usbVendorId&&e.usbProductId?`WebSerial VendorID 0x${e.usbVendorId.toString(16)} ProductID 0x${e.usbProductId.toString(16)}`:""}getPid(){return this.device.getInfo().usbProductId}trace(e){const t=`${`TRACE ${(Date.now()-this.lastTraceTime).toFixed(3)}`} ${e}`;console.log(t),this.traceLog+=t+"\n"}async returnTrace(){try{await navigator.clipboard.writeText(this.traceLog),console.log("Text copied to clipboard!")}catch(e){console.error("Failed to copy text:",e)}}hexify(e){return Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("").padEnd(16," ")}hexConvert(e,t=!0){if(t&&e.length>16){let t="",i=e;for(;i.length>0;){const e=i.slice(0,16),r=String.fromCharCode(...e).split("").map((e=>" "===e||e>=" "&&e<="~"&&" "!==e?e:".")).join("");i=i.slice(16),t+=`\n ${this.hexify(e.slice(0,8))} ${this.hexify(e.slice(8))} | ${r}`}return t}return this.hexify(e)}slipWriter(e){const t=[];t.push(192);for(let i=0;i0){r=this.buffer,this.buffer=new Uint8Array(0);break}await Hr(1)}if(!r||0===r.length){const e=null===t?"Serial data stream stopped: Possible serial noise or corruption.":"No serial data received.";throw this.tracing&&this.trace(e),new Error(e)}this.tracing&&this.trace(`Read ${r.length} bytes: ${this.hexConvert(r)}`);for(let e=0;esetTimeout(t,e)))}class Wr{constructor(e,t){this.resetDelay=t,this.transport=e}async reset(){await this.transport.setDTR(!1),await this.transport.setRTS(!0),await Gr(100),await this.transport.setDTR(!0),await this.transport.setRTS(!1),await Gr(this.resetDelay),await this.transport.setDTR(!1)}}class Zr{constructor(e){this.transport=e}async reset(){await this.transport.setRTS(!1),await this.transport.setDTR(!1),await Gr(100),await this.transport.setDTR(!0),await this.transport.setRTS(!1),await Gr(100),await this.transport.setRTS(!0),await this.transport.setDTR(!1),await this.transport.setRTS(!0),await Gr(100),await this.transport.setRTS(!1),await this.transport.setDTR(!1)}}class Vr{constructor(e,t=!1){this.transport=e,this.usingUsbOtg=t,this.transport=e}async reset(){this.usingUsbOtg?(await Gr(200),await this.transport.setRTS(!1),await Gr(200)):(await Gr(100),await this.transport.setRTS(!1))}}class jr{constructor(e,t){this.transport=e,this.sequenceString=t,this.transport=e}async reset(){const e={D:async e=>await this.transport.setDTR(e),R:async e=>await this.transport.setRTS(e),W:async e=>await Gr(e)};try{if(!function(e){const t=["D","R","W"],i=e.split("|");for(const e of i){const i=e[0],r=e.slice(1);if(!t.includes(i))return!1;if("D"===i||"R"===i){if("0"!==r&&"1"!==r)return!1}else if("W"===i){const e=parseInt(r);if(isNaN(e)||e<=0)return!1}}return!0}(this.sequenceString))return;const t=this.sequenceString.split("|");for(const i of t){const t=i[0],r=i.slice(1);"W"===t?await e.W(Number(r)):"D"!==t&&"R"!==t||await e[t]("1"===r)}}catch(e){throw new Error("Invalid custom reset sequence")}}}function Kr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yr,Xr;var Jr=Kr(Xr?Yr:(Xr=1,Yr=function(e){return atob(e)}));async function Qr(e,t){let i;switch(e){case"ESP32":i=await import("./stub_flasher_32-BLbsWvxO.js");break;case"ESP32-C2":i=await import("./stub_flasher_32c2-wLQhZItC.js");break;case"ESP32-C3":i=await import("./stub_flasher_32c3-DmSvHQKL.js");break;case"ESP32-C5":i=await import("./stub_flasher_32c5-D1WK4DyB.js");break;case"ESP32-C6":i=await import("./stub_flasher_32c6-ZuxjUVr4.js");break;case"ESP32-C61":i=await import("./stub_flasher_32c61-DeKkw9vN.js");break;case"ESP32-H2":i=await import("./stub_flasher_32h2-CZ4EIL3w.js");break;case"ESP32-P4":i=t&&t<300?await import("./stub_flasher_32p4rc1-DyGqUAeZ.js"):await import("./stub_flasher_32p4-CpHBYEwI.js");break;case"ESP32-S2":i=await import("./stub_flasher_32s2-CrsP1231.js");break;case"ESP32-S3":i=await import("./stub_flasher_32s3-CiJyd6Fk.js");break;case"ESP8266":i=await import("./stub_flasher_8266-CQFcqJ_a.js")}if(i)return{bss_start:i.bss_start,data:i.data,data_start:i.data_start,entry:i.entry,text:i.text,text_start:i.text_start,decodedData:es(i.data),decodedText:es(i.text)}}function es(e){const t=Jr(e).split("").map((function(e){return e.charCodeAt(0)}));return new Uint8Array(t)}class ts{constructor(){this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64,"32MB":80,"64MB":96,"128MB":112},this.FLASH_FREQUENCY={"80m":15,"40m":0,"26m":1,"20m":2}}getEraseSize(e,t){return t}}class is extends ts{constructor(){super(...arguments),this.CHIP_NAME="ESP8266",this.CHIP_DETECT_MAGIC_VALUE=[4293968129],this.EFUSE_RD_REG_BASE=1072693328,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.XTAL_CLK_DIVIDER=2,this.FLASH_WRITE_SIZE=16384,this.BOOTLOADER_FLASH_OFFSET=0,this.UART_DATE_REG_ADDR=0,this.FLASH_SIZES={"512KB":0,"256KB":16,"1MB":32,"2MB":48,"4MB":64,"2MB-c1":80,"4MB-c1":96,"8MB":128,"16MB":144},this.FLASH_FREQUENCY={"80m":15,"40m":0,"26m":1,"20m":2},this.MEMORY_MAP=[[1072693248,1072693264,"DPORT"],[1073643520,1073741824,"DRAM"],[1074790400,1074823168,"IRAM"],[1075843088,1076760592,"IROM"]],this.SPI_REG_BASE=1610613248,this.SPI_USR_OFFS=28,this.SPI_USR1_OFFS=32,this.SPI_USR2_OFFS=36,this.SPI_MOSI_DLEN_OFFS=0,this.SPI_MISO_DLEN_OFFS=0,this.SPI_W0_OFFS=64,this.getChipFeatures=async e=>{const t=["WiFi"];return"ESP8285"==await this.getChipDescription(e)&&t.push("Embedded Flash"),t}}async readEfuse(e,t){const i=this.EFUSE_RD_REG_BASE+4*t;return e.debug("Read efuse "+i),await e.readReg(i)}async getChipDescription(e){const t=await this.readEfuse(e,2);return 0!=(16&await this.readEfuse(e,0)|65536&t)?"ESP8285":"ESP8266EX"}async getCrystalFreq(e){const t=await e.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,i=e.transport.baudrate*t/1e6/this.XTAL_CLK_DIVIDER;let r;return r=i>33?40:26,Math.abs(r-i)>1&&e.info("WARNING: Detected crystal freq "+i+"MHz is quite different to normalized freq "+r+"MHz. Unsupported crystal in use?"),r}_d2h(e){const t=(+e).toString(16);return 1===t.length?"0"+t:t}async readMac(e){let t=await this.readEfuse(e,0);t>>>=0;let i=await this.readEfuse(e,1);i>>>=0;let r=await this.readEfuse(e,3);r>>>=0;const s=new Uint8Array(6);return 0!=r?(s[0]=r>>16&255,s[1]=r>>8&255,s[2]=255&r):0==(i>>16&255)?(s[0]=24,s[1]=254,s[2]=52):1==(i>>16&255)?(s[0]=172,s[1]=208,s[2]=116):e.error("Unknown OUI"),s[3]=i>>8&255,s[4]=255&i,s[5]=t>>24&255,this._d2h(s[0])+":"+this._d2h(s[1])+":"+this._d2h(s[2])+":"+this._d2h(s[3])+":"+this._d2h(s[4])+":"+this._d2h(s[5])}getEraseSize(e,t){return t}}is.IROM_MAP_START=1075838976,is.IROM_MAP_END=1076887552;var rs=Object.freeze({__proto__:null,ESP8266ROM:is});const ss=233;function os(e,t){return e+(t-1-e%t)}function as(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}class ns{constructor(e,t,i=null,r=0){this.addr=e,this.data=t,this.fileOffs=i,this.flags=r,this.includeInChecksum=!0,0!==this.addr&&this.padToAlignment(4)}copyWithNewAddr(e){return new ns(e,this.data,0)}splitImage(e){const t=new ns(this.addr,this.data.slice(0,e),0);return this.data=this.data.slice(e),this.addr+=e,this.fileOffs=null,t}toString(){let e=`len 0x${this.data.length.toString(16).padStart(5,"0")} load 0x${this.addr.toString(16).padStart(8,"0")}`;return null!==this.fileOffs&&(e+=` file_offs 0x${this.fileOffs.toString(16).padStart(8,"0")}`),e}getMemoryType(e){return e.ROM_LOADER.MEMORY_MAP.filter((e=>e[0]<=this.addr&&this.addre[2]))}padToAlignment(e){this.data=Br(this.data,e,0)}}class ls extends ns{constructor(e,t,i,r){super(t,i,null,r),this.name=e}toString(){return`${this.name} ${super.toString()}`}}class ds{constructor(e){this.SEG_HEADER_LEN=8,this.SHA256_DIGEST_LEN=32,this.ELF_FLAG_WRITE=1,this.ELF_FLAG_READ=2,this.ELF_FLAG_EXEC=4,this.segments=[],this.entrypoint=0,this.elfSha256=null,this.elfSha256Offset=0,this.padToSize=0,this.flashMode=0,this.flashSizeFreq=0,this.checksum=0,this.datalength=0,this.IROM_ALIGN=0,this.MMU_PAGE_SIZE_CONF=[],this.ROM_LOADER=e}loadCommonHeader(e,t,i){const r=e[t],s=e[t+1];if(this.flashMode=e[t+2],this.flashSizeFreq=e[t+3],this.entrypoint=as(e,t+4),r!==i)throw new Se(`Invalid firmware image magic=0x${r.toString(16)}`);return s}verify(){if(this.segments.length>16)throw new Se(`Invalid segment count ${this.segments.length} (max 16). Usually this indicates a linker script problem.`)}loadSegment(e,t,i=!1){const r=t,s=as(e,t),o=as(e,t+4);this.warnIfUnusualSegment(s,o,i);const a=e.slice(t+8,t+8+o);if(a.length1075838976||e<1073610752||t>65536)&&console.warn(`WARNING: Suspicious segment 0x${e.toString(16)}, length ${t}`)}maybePatchSegmentData(e,t){const i=e.length;if(this.elfSha256Offset>=t&&this.elfSha256Offseti)throw new Se(`Cannot place SHA256 digest on segment boundary(elf_sha256_offset=${this.elfSha256Offset}, file_pos=${t}, segment_size=${i})`);const s=r-this.SEG_HEADER_LEN;if(!e.slice(s,s+this.SHA256_DIGEST_LEN).every((e=>0===e)))throw new Se(`Contents of segment at SHA256 digest offset 0x${this.elfSha256Offset.toString(16)} are not all zero. Refusing to overwrite.`);if(!this.elfSha256||this.elfSha256.length!==this.SHA256_DIGEST_LEN)throw new Se("ELF SHA256 digest is not properly initialized");const o=e.slice(0,s),a=e.slice(s+this.SHA256_DIGEST_LEN),n=o.length+this.elfSha256.length+a.length,l=new Uint8Array(n);return l.set(o,0),l.set(this.elfSha256,o.length),l.set(a,o.length+this.elfSha256.length),l}return e}saveSegment(e,t,i,r=null){const s=this.maybePatchSegmentData(i.data,t),o=new DataView(e.buffer,t);return o.setUint32(0,i.addr,!0),o.setUint32(4,s.length,!0),e.set(s,t+8),null!==r?Ur(s,r):0}saveFlashSegment(e,t,i,r=null){if("ESP32"===this.ROM_LOADER.CHIP_NAME){const e=(t+i.data.length+this.SEG_HEADER_LEN)%this.IROM_ALIGN;if(e<36){const t=new Uint8Array(i.data.length+(36-e));t.set(i.data),t.fill(0,i.data.length),i.data=t}}return this.saveSegment(e,t,i,r)}readChecksum(e,t){return e[os(t,16)]}calculateChecksum(){let e=239;for(const t of this.segments)t.includeInChecksum&&(e=Ur(t.data,e));return e}appendChecksum(e,t,i){e[os(t,16)]=i}writeCommonHeader(e,t,i){e[t]=ss,e[t+1]=i,e[t+2]=this.flashMode,e[t+3]=this.flashSizeFreq;new DataView(e.buffer,t+4).setUint32(0,this.entrypoint,!0)}isIromAddr(e){return is.IROM_MAP_START<=e&&ethis.isIromAddr(e.addr)));if(e.length>0){if(1!==e.length)throw new Se(`Found ${e.length} segments that could be irom0. Bad ELF file?`);return e[0]}return null}getNonIromSegments(){const e=this.getIromSegment();return this.segments.filter((t=>t!==e))}sortSegments(){this.segments.length&&this.segments.sort(((e,t)=>e.addr-t.addr))}mergeAdjacentSegments(){if(!this.segments.length)return;const e=[];for(let t=this.segments.length-1;t>0;t--){const i=this.segments[t-1],r=this.segments[t];if(i.getMemoryType(this).join(",")===r.getMemoryType(this).join(",")&&i.includeInChecksum===r.includeInChecksum&&r.addr===i.addr+i.data.length&&(r.flags&this.ELF_FLAG_EXEC)==(i.flags&this.ELF_FLAG_EXEC)){const e=new Uint8Array(i.data.length+r.data.length);e.set(i.data),e.set(r.data,i.data.length),i.data=e}else e.unshift(r)}e.unshift(this.segments[0]),this.segments=e}setMmuPageSize(e){if(this.MMU_PAGE_SIZE_CONF||e===this.IROM_ALIGN){if(this.MMU_PAGE_SIZE_CONF&&!this.MMU_PAGE_SIZE_CONF.includes(e)){const t=this.MMU_PAGE_SIZE_CONF.map((e=>e/1024+"KB")).join(", ");throw new Se(`${e} bytes is not a valid ${this.ROM_LOADER.CHIP_NAME} page size, select from ${t}.`)}this.IROM_ALIGN=e}else console.warn(`WARNING: Changing MMU page size is not supported on ${this.ROM_LOADER.CHIP_NAME}! `+(0!==this.IROM_ALIGN?`Defaulting to ${this.IROM_ALIGN/1024}KB.`:""))}}class cs extends ds{constructor(e,t=null,i=!0,r=!1){super(e),this.securePad=null,this.flashMode=0,this.flashSizeFreq=0,this.version=1,this.WP_PIN_DISABLED=238,this.wpPin=this.WP_PIN_DISABLED,this.clkDrv=0,this.qDrv=0,this.dDrv=0,this.csDrv=0,this.hdDrv=0,this.wpDrv=0,this.chipId=0,this.minRev=0,this.minRevFull=0,this.maxRevFull=0,this.storedDigest=null,this.calcDigest=null,this.dataLength=0,this.IROM_ALIGN=65536,this.ROM_LOADER=e,this.appendDigest=i,this.ramOnlyHeader=r,null!==t&&this.loadFromFile(t)}async loadFromFile(e){const t=e instanceof Uint8Array?e:Nr(e);let i=0;const r=this.loadCommonHeader(t,i,ss);i+=8,this.loadExtendedHeader(t,i),i+=16;for(let e=0;ethis.isFlashAddr(e.addr))).sort(((e,t)=>e.addr-t.addr)),o=this.segments.filter((e=>!this.isFlashAddr(e.addr))).sort(((e,t)=>e.addr-t.addr));for(let e=0;e0){let e=s[0].addr;for(const t of s.slice(1)){if(Math.floor(t.addr/this.IROM_ALIGN)===Math.floor(e/this.IROM_ALIGN))throw new Se(`Segment loaded at 0x${t.addr.toString(16)} lands in same 64KB flash mapping as segment loaded at 0x${e.toString(16)}. Can't generate binary. Suggest changing linker script or ELF to merge sections.`);e=t.addr}}if(this.ramOnlyHeader){for(const s of o)r=this.saveSegment(t,i,s,r),i+=8+s.data.length,e++;this.appendChecksum(t,i,r),i=os(i,16);for(const o of s.reverse()){let s=this.getAlignmentDataNeeded(o,i);if(s>0){s0;){const a=s[0],n=this.getAlignmentDataNeeded(a,i);if(n>0){if(o.length>0&&n>this.SEG_HEADER_LEN){const e=o[0].splitImage(n);0===o[0].data.length&&o.shift(),r=this.saveSegment(t,i,e,r)}else{const e=new ns(0,new Uint8Array(n).fill(0),i);r=this.saveSegment(t,i,e,r)}i+=8+n,e++}else{if((i+8)%this.IROM_ALIGN!=a.addr%this.IROM_ALIGN)throw new Error("Flash segment alignment mismatch");r=this.saveFlashSegment(t,i,a,r),s.shift(),i+=8+a.data.length,e++}}for(const s of o)r=this.saveSegment(t,i,s,r),i+=8+s.data.length,e++}if(this.securePad){if(!this.appendDigest)throw new Error("secure_pad only applies if a SHA-256 digest is also appended to the image");const s=(i+this.SEG_HEADER_LEN)%this.IROM_ALIGN,o=16;let a=0;"1"===this.securePad?a=112:"2"===this.securePad&&(a=32);const n=(this.IROM_ALIGN-s-o-a)%this.IROM_ALIGN,l=new ns(0,new Uint8Array(n).fill(0),i);r=this.saveSegment(t,i,l,r),i+=8+n,e++}this.ramOnlyHeader||(this.appendChecksum(t,i,r),i=os(i,16));const a=i;if(this.ramOnlyHeader?t[1]=o.length:t[1]=e,this.appendDigest){const e=await crypto.subtle.digest("SHA-256",t.slice(0,a)),r=new Uint8Array(e);t.set(r,a),i+=32}if(this.padToSize&&i%this.padToSize!=0){const e=this.padToSize-i%this.padToSize,r=new Uint8Array(e);r.fill(255),t.set(r,i),i+=e}return t}loadExtendedHeader(e,t){const i=new DataView(e.buffer,t);this.wpPin=i.getUint8(0);const r=i.getUint8(1);[this.clkDrv,this.qDrv]=this.splitByte(r);const s=i.getUint8(2);[this.dDrv,this.csDrv]=this.splitByte(s);const o=i.getUint8(3);[this.hdDrv,this.wpDrv]=this.splitByte(o),this.chipId=i.getUint8(4),this.chipId!==this.ROM_LOADER.IMAGE_CHIP_ID&&console.warn(`Unexpected chip id in image. Expected ${this.ROM_LOADER.IMAGE_CHIP_ID} but value was ${this.chipId}. Is this image for a different chip model?`),this.minRev=i.getUint8(5),this.minRevFull=i.getUint16(6,!0),this.maxRevFull=i.getUint16(8,!0);const a=i.getUint8(15);if(0!==a&&1!==a)throw new Error(`Invalid value for append_digest field (0x${a.toString(16)}). Should be 0 or 1.`);this.appendDigest=1===a}saveExtendedHeader(e,t){const i=new ArrayBuffer(16),r=new DataView(i);r.setUint8(0,this.wpPin),r.setUint8(1,this.joinByte(this.clkDrv,this.qDrv)),r.setUint8(2,this.joinByte(this.dDrv,this.csDrv)),r.setUint8(3,this.joinByte(this.hdDrv,this.wpDrv)),r.setUint8(4,this.ROM_LOADER.IMAGE_CHIP_ID),r.setUint8(5,this.minRev),r.setUint16(6,this.minRevFull,!0),r.setUint16(8,this.maxRevFull,!0);for(let e=9;e<15;e++)r.setUint8(e,0);r.setUint8(15,this.appendDigest?1:0),e.set(new Uint8Array(i),t)}splitByte(e){return[15&e,e>>4&15]}joinByte(e,t){return 15&e|(15&t)<<4}getAlignmentDataNeeded(e,t){const i=e.addr%this.IROM_ALIGN-this.SEG_HEADER_LEN;let r=this.IROM_ALIGN-t%this.IROM_ALIGN+i;return 0===r||r===this.IROM_ALIGN?0:(r-=this.SEG_HEADER_LEN,r<0&&(r+=this.IROM_ALIGN),r)}}class hs extends ds{constructor(e,t=null){super(e),this.version=1,this.ROM_LOADER=e,this.flashMode=0,this.flashSizeFreq=0,null!==t&&this.loadFromFile(t)}loadFromFile(e){const t=e instanceof Uint8Array?e:Nr(e);let i=0;const r=this.loadCommonHeader(t,i,ss);i+=8;for(let e=0;enew Wr(e,t),customReset:(e,t)=>new jr(e,t),hardReset:(e,t)=>new Vr(e,t),usbJTAGSerialReset:e=>new Zr(e)},e.serialOptions&&(this.serialOptions=e.serialOptions),e.terminal&&(this.terminal=e.terminal,this.terminal.clean()),void 0!==e.debugLogging&&(this.debugLogging=e.debugLogging),e.port&&(this.transport=new qr(e.port)),void 0!==e.enableTracing&&(this.transport.tracing=e.enableTracing),(null===(t=e.resetConstructors)||void 0===t?void 0:t.classicReset)&&(this.resetConstructors.classicReset=null===(i=e.resetConstructors)||void 0===i?void 0:i.classicReset),(null===(r=e.resetConstructors)||void 0===r?void 0:r.customReset)&&(this.resetConstructors.customReset=null===(s=e.resetConstructors)||void 0===s?void 0:s.customReset),(null===(o=e.resetConstructors)||void 0===o?void 0:o.hardReset)&&(this.resetConstructors.hardReset=null===(a=e.resetConstructors)||void 0===a?void 0:a.hardReset),(null===(n=e.resetConstructors)||void 0===n?void 0:n.usbJTAGSerialReset)&&(this.resetConstructors.usbJTAGSerialReset=null===(l=e.resetConstructors)||void 0===l?void 0:l.usbJTAGSerialReset),this.info("esptool.js"),this.info("Serial port "+this.transport.getInfo())}write(e,t=!0){this.terminal?t?this.terminal.writeLine(e):this.terminal.write(e):console.log(e)}error(e,t=!0){this.write(`Error: ${e}`,t)}info(e,t=!0){this.write(e,t)}debug(e,t=!0){this.debugLogging&&this.write(`Debug: ${e}`,t)}_shortToBytearray(e){return new Uint8Array([255&e,e>>8&255])}_intToByteArray(e){return new Uint8Array([255&e,e>>8&255,e>>16&255,e>>24&255])}_byteArrayToShort(e,t){return e|t>>8}_byteArrayToInt(e,t,i,r){return e|t<<8|i<<16|r<<24}_appendBuffer(e,t){const i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),i.buffer}_appendArray(e,t){const i=new Uint8Array(e.length+t.length);return i.set(e,0),i.set(t,e.length),i}ui8ToBstr(e){let t="";for(let i=0;i0&&(o=this._appendArray(o,this._intToByteArray(this.chip.UART_DATE_REG_ADDR)),o=this._appendArray(o,this._intToByteArray(0)),o=this._appendArray(o,this._intToByteArray(0)),o=this._appendArray(o,this._intToByteArray(s))),await this.checkCommand("write target memory",this.ESP_WRITE_REG,o)}async sync(){this.debug("Sync");const e=new Uint8Array(36);let t;for(e[0]=7,e[1]=7,e[2]=18,e[3]=32,t=0;t<32;t++)e[4+t]=85;try{let t=await this.command(8,e,void 0,void 0,100);this.syncStubDetected=0===t[0];for(let e=0;e<7;e++)t=await this.readPacket(8,100),this.syncStubDetected=this.syncStubDetected&&0===t[0];return t}catch(e){throw this.debug("Sync err "+e),e}}async _connectAttempt(e="default_reset",t){this.debug("_connect_attempt "+e),t&&await t.reset();const i=this.transport.peek(),r=Array.from(i,(e=>String.fromCharCode(e))).join("").match(/boot:(0x[0-9a-fA-F]+)([\s\S]*?waiting for download)?/);let s=!1,o="",a=!1;r&&(s=!0,o=r[1],a=!!r[2]),this.debug(`bootMode:${o} downloadMode:${a}`);let n="";for(let e=0;e<5;e++)try{this.debug(`Sync connect attempt ${e}`),this.transport.flushInput();const t=await this.sync();return this.debug(t[0].toString()),"success"}catch(e){this.debug(`Error at sync ${e}`),n=e instanceof Error?e.message:"string"==typeof e?e:JSON.stringify(e)}return s&&(n=`Wrong boot mode detected (${o}).\n This chip needs to be in download mode.`,a&&(n="Download mode successfully detected, but getting no sync reply:\n The serial TX path seems to be down.")),n}constructResetSequence(e){if("no_reset"!==e)if("usb_reset"===e||this.transport.getPid()===this.USB_JTAG_SERIAL_PID){if(this.resetConstructors.usbJTAGSerialReset)return this.debug("using USB JTAG Serial Reset"),[this.resetConstructors.usbJTAGSerialReset(this.transport)]}else{const e=50,t=e+500;if(this.resetConstructors.classicReset)return this.debug("using Classic Serial Reset"),[this.resetConstructors.classicReset(this.transport,e),this.resetConstructors.classicReset(this.transport,t)]}return[]}async connect(e="default_reset",t=7,i=!0){let r;this.info("Connecting...",!1),await this.transport.connect(this.romBaudrate,this.serialOptions),this.transport.readLoop();const s=this.constructResetSequence(e);for(let i=0;i0?s[i%s.length]:null;if(r=await this._connectAttempt(e,t),"success"===r)break}if("success"!==r)throw new Se("Failed to connect with the device");if(this.debug("Connect attempt successful."),this.info("\n\r",!1),i){const e=await this.readReg(this.CHIP_DETECT_MAGIC_REG_ADDR)>>>0;this.debug("Chip Magic "+e.toString(16));const t=await async function(e){switch(e){case 15736195:{const{ESP32ROM:e}=await import("./esp32-DNPRK0Ay.js");return new e}case 203546735:case 1867591791:case 2084675695:{const{ESP32C2ROM:e}=await import("./esp32c2-CQ3ns5Nm.js");return new e}case 1763790959:case 456216687:case 1216438383:case 1130455151:{const{ESP32C3ROM:e}=await import("./esp32c3-2tchr35W.js");return new e}case 752910447:{const{ESP32C6ROM:e}=await import("./esp32c6-DolpfL0e.js");return new e}case 606167151:case 871374959:case 1333878895:{const{ESP32C61ROM:e}=await import("./esp32c61-C8HktcOt.js");return new e}case 285294703:case 1675706479:case 1607549039:{const{ESP32C5ROM:e}=await import("./esp32c5-CeCSizBL.js");return new e}case 3619110528:case 2548236392:{const{ESP32H2ROM:e}=await import("./esp32h2-L0n5WuSo.js");return new e}case 9:{const{ESP32S3ROM:e}=await import("./esp32s3-DQt_R3ZE.js");return new e}case 1990:{const{ESP32S2ROM:e}=await import("./esp32s2-w9SUkb7o.js");return new e}case 4293968129:{const{ESP8266ROM:e}=await Promise.resolve().then((function(){return rs}));return new e}case 0:case 182303440:case 117676761:{const{ESP32P4ROM:e}=await import("./esp32p4-MR0ikcda.js");return new e}default:return null}}(e);if(null===typeof this.chip)throw new Se(`Unexpected CHIP magic value ${e}. Failed to autodetect chip type.`);this.chip=t}}async detectChip(e="default_reset"){await this.connect(e),this.info("Detecting chip type... ",!1),null!=this.chip?this.info(this.chip.CHIP_NAME):this.info("unknown!")}async checkCommand(e="",t=null,i=new Uint8Array(0),r=0,s=0,o=this.DEFAULT_TIMEOUT){this.debug("check_command "+e);const a=await this.command(t,i,r,void 0,o);if(a&&a[1]&&a[1].length0?a[1].slice(0,s):a[0]}async memBegin(e,t,i,r){if(this.IS_STUB){const t=r,i=r+e,s=this.chip.getChipRevision?await this.chip.getChipRevision(this):void 0,o=await Qr(this.chip.CHIP_NAME,s);if(o){const e=[[o.bss_start||o.data_start,o.data_start+o.decodedData.length],[o.text_start,o.text_start+o.decodedText.length]];for(const[r,s]of e)if(tr)throw new Se(`Software loader is resident at 0x${r.toString(16).padStart(8,"0")}-0x${s.toString(16).padStart(8,"0")}.\n Can't load binary at overlapping address range 0x${t.toString(16).padStart(8,"0")}-0x${i.toString(16).padStart(8,"0")}.\n Either change binary loading address, or use the no-stub option to disable the software loader.`)}}this.debug("mem_begin "+e+" "+t+" "+i+" "+r.toString(16));let s=this._appendArray(this._intToByteArray(e),this._intToByteArray(t));s=this._appendArray(s,this._intToByteArray(i)),s=this._appendArray(s,this._intToByteArray(r)),await this.checkCommand("enter RAM download mode",this.ESP_MEM_BEGIN,s)}checksum(e,t=this.ESP_CHECKSUM_MAGIC){for(let i=0;i{const i=a+this.chip.SPI_MOSI_DLEN_OFFS,r=a+this.chip.SPI_MISO_DLEN_OFFS;e>0&&await this.writeReg(i,e-1),t>0&&await this.writeReg(r,t-1);let n=0;o>0&&(n|=o-1),s>0&&(n|=s-1<{const i=c;let r=(0===t?0:t-1)<<8|(0===e?0:e-1)<<17;o>0&&(r|=o-1),s>0&&(r|=s-1<32)throw new Se("Reading more than 32 bits back from a SPI flash operation is unsupported");if(t.length>64)throw new Se("Writing more than 64 bytes of data with one SPI command is unsupported");const v=8*t.length,g=await this.readReg(d),_=await this.readReg(h);let b=1<<31;i>0&&(b|=268435456),v>0&&(b|=134217728),s>0&&(b|=1073741824),o>0&&(b|=536870912),await u(v,i),await this.writeReg(d,b);let y,x=7<<28|e;if(await this.writeReg(h,x),r&&s>0&&(this.SPI_ADDR_REG_MSB&&(r<<=32-s),await this.writeReg(l,r)),0==v)await this.writeReg(p,0);else{t=Br(t,4,0);const e=[];for(let i=0;i>>0);let i=p;for(const t of e)await this.writeReg(i,t),i+=4}for(await this.writeReg(n,f),y=0;y<10&&(x=await this.readReg(n)&f,0!=x);y++);if(10===y)throw new Se("SPI command did not complete in time");const w=await this.readReg(p);return await this.writeReg(d,g),await this.writeReg(h,_),w}async readFlashId(){const e=new Uint8Array(0);return await this.runSpiflashCommand(159,e,24)}async eraseFlash(){this.info("Erasing flash (this may take a while)...");let e=new Date;const t=e.getTime(),i=await this.checkCommand("erase flash",this.ESP_ERASE_FLASH,void 0,void 0,void 0,this.CHIP_ERASE_TIMEOUT);e=new Date;const r=e.getTime();return this.info("Chip erase completed successfully in "+(r-t)/1e3+"s"),i}toHex(e){return Array.prototype.map.call(e,(e=>("00"+e.toString(16)).slice(-2))).join("")}async flashMd5sum(e,t){const i=this.timeoutPerMb(this.MD5_TIMEOUT_PER_MB,t);let r=this._appendArray(this._intToByteArray(e),this._intToByteArray(t));r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,this._intToByteArray(0));const s=this.IS_STUB?16:32,o=await this.checkCommand("calculate md5sum",this.ESP_SPI_FLASH_MD5,r,void 0,s,i);return this.toHex(o)}async readFlash(e,t,i=null){let r=this._appendArray(this._intToByteArray(e),this._intToByteArray(t));r=this._appendArray(r,this._intToByteArray(4096)),r=this._appendArray(r,this._intToByteArray(1024));const s=await this.checkCommand("read flash",this.ESP_READ_FLASH,r);if(0!=s)throw new Se("Failed to read memory: "+s);let o=new Uint8Array(0);for(;o.length0&&(o=this._appendArray(o,e),await this.transport.write(this._intToByteArray(o.length)),i&&i(e,o.length,t))}return o}async runStub(){if(this.syncStubDetected)return this.info("Stub is already running. No upload is necessary."),this.chip;this.info("Uploading stub...");const e=this.chip.getChipRevision?await this.chip.getChipRevision(this):void 0,t=await Qr(this.chip.CHIP_NAME,e);if(void 0===t)throw this.debug("Error loading Stub json"),new Error("Error loading Stub json");const i=[t.decodedText,t.decodedData];for(let e=0;et)throw new Se(`File ${i+1} doesn't fit in the available flash`)}let t,i;!0===this.IS_STUB&&!0===e.eraseAll&&await this.eraseFlash();for(let r=0;r=t.length;if(!e.compress)throw new Se("Yet to handle Non Compressed writes");{const e=f;u.push(o,c);const t=f-e;let i=3e3;this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,t)>3e3&&(i=this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,t)),!1===this.IS_STUB&&(p=i),await this.flashDeflBlock(o,n,p),this.IS_STUB&&(p=i)}l+=o.length,m+=s,n++,e.reportProgress&&e.reportProgress(r,l,d)}this.IS_STUB&&(e.compress?await this.flashDeflFinish(!1,p):await this.flashFinish(!1,p)),c=new Date;const v=c.getTime()-h;if(e.compress&&this.info("Wrote "+o+" bytes ("+l+" compressed) at 0x"+i.toString(16)+" in "+v/1e3+" seconds."),s){this.info("File md5: "+s);const e=await this.flashMd5sum(i,o);if(this.info("Flash md5: "+e),new String(e).valueOf()!=new String(s).valueOf())throw new Se("MD5 of file does not match data in flash!");this.info("Hash of data verified.")}}this.info("Leaving...")}async flashId(){this.debug("flash_id");const e=await this.readFlashId();this.info("Manufacturer: "+(255&e).toString(16));const t=e>>16&255;this.info("Device: "+(e>>8&255).toString(16)+t.toString(16)),this.info("Detected flash size: "+this.DETECTED_FLASH_SIZES[t])}async detectFlashSize(){this.debug("detectFlashSize");const e=await this.readFlashId()>>16&255;let t=this.DETECTED_FLASH_SIZES[e];return t?this.info("Auto-detected Flash size: "+t):(t="4MB",this.info("Could not auto-detect Flash size. defaulting to 4MB")),t}async softReset(e){if(this.IS_STUB){if("ESP8266"!=this.chip.CHIP_NAME)throw new Se("Soft resetting is currently only supported on ESP8266");e?(await this.flashBegin(0,0),await this.flashFinish(!0)):await this.command(this.ESP_RUN_USER_CODE,void 0,void 0,!1)}else{if(e)return;await this.flashBegin(0,0),await this.flashFinish(!1)}}async after(e="hard_reset",t,i){switch(e){case"hard_reset":if(this.resetConstructors.hardReset){this.info("Hard resetting via RTS pin...");const e=this.resetConstructors.hardReset(this.transport,t);await e.reset()}break;case"soft_reset":this.info("Soft resetting..."),await this.softReset(!1);break;case"no_reset_stub":this.info("Staying in flasher stub.");break;case"custom_reset":if(i||this.info("Custom reset sequence not provided, doing nothing."),this.resetConstructors.customReset||this.info("Custom reset constructor not available, doing nothing."),this.resetConstructors.customReset&&i){this.info("Custom resetting using sequence "+i);const e=this.resetConstructors.customReset(this.transport,i);await e.reset()}break;default:this.info("Staying in bootloader."),this.IS_STUB&&this.softReset(!0)}}}class Ss extends HTMLElement{constructor(){super(...arguments),this.allowInput=!0}logs(){var e;return(null===(e=this._console)||void 0===e?void 0:e.logs())||""}connectedCallback(){if(this._console)return;if(this.attachShadow({mode:"open"}).innerHTML=`\n \n
\n ${this.allowInput?"
\n >\n \n
\n ":""}\n `,this._console=new ye(this.shadowRoot.querySelector("div")),this.allowInput){const e=this.shadowRoot.querySelector("input");this.addEventListener("click",(()=>{var t;""===(null===(t=getSelection())||void 0===t?void 0:t.toString())&&e.focus()})),e.addEventListener("keydown",(e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),this._sendCommand())}))}const e=new AbortController,t=this._connect(e.signal);this._cancelConnection=()=>(e.abort(),t)}async _connect(e){this.logger.debug("Starting console read loop");try{await this.port.readable.pipeThrough(new TextDecoderStream,{signal:e}).pipeThrough(new TransformStream(new we)).pipeThrough(new TransformStream(new Ee)).pipeTo(new WritableStream({write:e=>{this._console.addLine(e.replace("\r",""))}})),e.aborted||(this._console.addLine(""),this._console.addLine(""),this._console.addLine("Terminal disconnected"))}catch(e){this._console.addLine(""),this._console.addLine(""),this._console.addLine(`Terminal disconnected: ${e}`)}finally{await xe(100),this.logger.debug("Finished console read loop")}}async _sendCommand(){const e=this.shadowRoot.querySelector("input"),t=e.value,i=new TextEncoder,r=this.port.writable.getWriter();await r.write(i.encode(t+"\r\n")),this._console.addLine(`> ${t}\r\n`),e.value="",e.focus();try{r.releaseLock()}catch(e){console.error("Ignoring release lock error",e)}}async disconnect(){this._cancelConnection&&(await this._cancelConnection(),this._cancelConnection=void 0)}async reset(){this.logger.debug("Triggering reset");const e=new qr(this.port);await e.setRTS(!0),await xe(100);const t=new Vr(e);await t.reset()}}function ks(e,t=!0){return t&&"rtl"===getComputedStyle(e).getPropertyValue("direction").trim()}customElements.define("ewt-console",Ss);const As=l(m(r));class Rs extends As{get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get form(){return this[f].form}get labels(){return this[f].labels}constructor(){super(),this.disabled=!1,this.softDisabled=!1,this.flipIconInRtl=!1,this.href="",this.download="",this.target="",this.ariaLabelSelected="",this.toggle=!1,this.selected=!1,this.type="submit",this.value="",this.flipIcon=ks(this,this.flipIconInRtl),this.addEventListener("click",this.handleClick.bind(this))}willUpdate(){this.href&&(this.disabled=!1,this.softDisabled=!1)}render(){const e=this.href?X`div`:X`button`,{ariaLabel:t,ariaHasPopup:i,ariaExpanded:r}=this,s=t&&this.ariaLabelSelected,o=this.toggle?this.selected:c;let a=c;return this.href||(a=s&&this.selected?this.ariaLabelSelected:t),Q`<${e} + class="icon-button ${h(this.getRenderClasses())}" + id="button" + aria-label="${a||c}" + aria-haspopup="${!this.href&&i||c}" + aria-expanded="${!this.href&&r||c}" + aria-pressed="${o}" + aria-disabled=${!this.href&&this.softDisabled||c} + ?disabled="${!this.href&&this.disabled}" + @click="${this.handleClickOnChild}"> + ${this.renderFocusRing()} + ${this.renderRipple()} + ${this.selected?c:this.renderIcon()} + ${this.selected?this.renderSelectedIcon():c} + ${this.href?this.renderLink():this.renderTouchTarget()} + `}renderLink(){const{ariaLabel:e}=this;return s` + + ${this.renderTouchTarget()} + + `}getRenderClasses(){return{"flip-icon":this.flipIcon,selected:this.toggle&&this.selected}}renderIcon(){return s``}renderSelectedIcon(){return s``}renderTouchTarget(){return s``}renderFocusRing(){return s``}renderRipple(){const e=!this.href&&(this.disabled||this.softDisabled);return s``}connectedCallback(){this.flipIcon=ks(this,this.flipIconInRtl),super.connectedCallback()}handleClick(e){if(!this.href&&this.softDisabled)return e.stopImmediatePropagation(),void e.preventDefault()}async handleClickOnChild(e){await 0,!this.toggle||this.disabled||this.softDisabled||e.defaultPrevented||(this.selected=!this.selected,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))}}y(Rs),Rs.formAssociated=!0,Rs.shadowRootOptions={mode:"open",delegatesFocus:!0},t([a({type:Boolean,reflect:!0})],Rs.prototype,"disabled",void 0),t([a({type:Boolean,attribute:"soft-disabled",reflect:!0})],Rs.prototype,"softDisabled",void 0),t([a({type:Boolean,attribute:"flip-icon-in-rtl"})],Rs.prototype,"flipIconInRtl",void 0),t([a()],Rs.prototype,"href",void 0),t([a()],Rs.prototype,"download",void 0),t([a()],Rs.prototype,"target",void 0),t([a({attribute:"aria-label-selected"})],Rs.prototype,"ariaLabelSelected",void 0),t([a({type:Boolean})],Rs.prototype,"toggle",void 0),t([a({type:Boolean,reflect:!0})],Rs.prototype,"selected",void 0),t([a()],Rs.prototype,"type",void 0),t([a({reflect:!0})],Rs.prototype,"value",void 0),t([v()],Rs.prototype,"flipIcon",void 0);const Is=o`:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);height:var(--_container-height);width:var(--_container-width);justify-content:center}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) max(0px,(48px - var(--_container-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host(:is([disabled],[soft-disabled])){pointer-events:none}.icon-button{place-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:flex;place-content:center;outline:none;padding:0;position:relative;text-decoration:none;user-select:none;z-index:0;flex:1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.icon ::slotted(*){font-size:var(--_icon-size);height:var(--_icon-size);width:var(--_icon-size);font-weight:inherit}md-ripple{z-index:-1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.flip-icon .icon{transform:scaleX(-1)}.icon{display:inline-flex}.link{display:grid;height:100%;outline:none;place-items:center;position:absolute;width:100%}.touch{position:absolute;height:max(48px,100%);width:max(48px,100%)}:host([touch-target=none]) .touch{display:none}@media(forced-colors: active){:host(:is([disabled],[soft-disabled])){--_disabled-icon-color: GrayText;--_disabled-icon-opacity: 1}} +`,Cs=o`:host{--_disabled-icon-color: var(--md-icon-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-icon-button-disabled-icon-opacity, 0.38);--_icon-size: var(--md-icon-button-icon-size, 24px);--_selected-focus-icon-color: var(--md-icon-button-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-icon-color: var(--md-icon-button-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-color: var(--md-icon-button-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-icon-button-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-icon-button-selected-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-icon-button-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-color: var(--md-icon-button-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-opacity: var(--md-icon-button-selected-pressed-state-layer-opacity, 0.12);--_state-layer-height: var(--md-icon-button-state-layer-height, 40px);--_state-layer-shape: var(--md-icon-button-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));--_state-layer-width: var(--md-icon-button-state-layer-width, 40px);--_focus-icon-color: var(--md-icon-button-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-icon-color: var(--md-icon-button-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-icon-button-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-opacity: var(--md-icon-button-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-icon-button-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-icon-color: var(--md-icon-button-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-icon-button-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-opacity: var(--md-icon-button-pressed-state-layer-opacity, 0.12);--_container-shape-start-start: 0;--_container-shape-start-end: 0;--_container-shape-end-end: 0;--_container-shape-end-start: 0;--_container-height: 0;--_container-width: 0;height:var(--_state-layer-height);width:var(--_state-layer-width)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_state-layer-height))/2) max(0px,(48px - var(--_state-layer-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_state-layer-shape);--md-focus-ring-shape-start-end: var(--_state-layer-shape);--md-focus-ring-shape-end-end: var(--_state-layer-shape);--md-focus-ring-shape-end-start: var(--_state-layer-shape)}.standard{background-color:rgba(0,0,0,0);color:var(--_icon-color);--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}.standard:hover{color:var(--_hover-icon-color)}.standard:focus{color:var(--_focus-icon-color)}.standard:active{color:var(--_pressed-icon-color)}.standard:is(:disabled,[aria-disabled=true]){color:var(--_disabled-icon-color)}md-ripple{border-radius:var(--_state-layer-shape)}.standard:is(:disabled,[aria-disabled=true]){opacity:var(--_disabled-icon-opacity)}.selected:not(:disabled,[aria-disabled=true]){color:var(--_selected-icon-color)}.selected:not(:disabled,[aria-disabled=true]):hover{color:var(--_selected-hover-icon-color)}.selected:not(:disabled,[aria-disabled=true]):focus{color:var(--_selected-focus-icon-color)}.selected:not(:disabled,[aria-disabled=true]):active{color:var(--_selected-pressed-icon-color)}.selected{--md-ripple-hover-color: var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity: var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-color: var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_selected-pressed-state-layer-opacity)} +`;class Ts extends Rs{}Ts.styles=[Is,Cs],customElements.define("ew-icon-button",Ts);const Ls=o`:host{--_active-indicator-color: var(--md-filled-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-text-field-active-indicator-height, 1px);--_caret-color: var(--md-filled-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_container-color: var(--md-filled-text-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_disabled-active-indicator-color: var(--md-filled-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-indicator-height: var(--md-filled-text-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-text-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-opacity: var(--md-filled-text-field-disabled-container-opacity, 0.04);--_disabled-input-text-color: var(--md-filled-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-input-text-opacity: var(--md-filled-text-field-disabled-input-text-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-text-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-filled-text-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-filled-text-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-filled-text-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-caret-color: var(--md-filled-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_error-focus-input-text-color: var(--md-filled-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-label-text-color: var(--md-filled-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-input-text-color: var(--md-filled-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-filled-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-state-layer-opacity: var(--md-filled-text-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-input-text-color: var(--md-filled-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-label-text-color: var(--md-filled-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-text-field-focus-active-indicator-height, 3px);--_focus-input-text-color: var(--md-filled-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-filled-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-active-indicator-height: var(--md-filled-text-field-hover-active-indicator-height, 1px);--_hover-input-text-color: var(--md-filled-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-filled-text-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-filled-text-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-color: var(--md-filled-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_input-text-font: var(--md-filled-text-field-input-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_input-text-line-height: var(--md-filled-text-field-input-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_input-text-placeholder-color: var(--md-filled-text-field-input-text-placeholder-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-prefix-color: var(--md-filled-text-field-input-text-prefix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-size: var(--md-filled-text-field-input-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_input-text-suffix-color: var(--md-filled-text-field-input-text-suffix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-weight: var(--md-filled-text-field-input-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_label-text-color: var(--md-filled-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-filled-text-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filled-text-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-populated-line-height: var(--md-filled-text-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_label-text-populated-size: var(--md-filled-text-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_label-text-size: var(--md-filled-text-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-filled-text-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_leading-icon-color: var(--md-filled-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-text-field-leading-icon-size, 24px);--_supporting-text-color: var(--md-filled-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-filled-text-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-line-height: var(--md-filled-text-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_supporting-text-size: var(--md-filled-text-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_supporting-text-weight: var(--md-filled-text-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_trailing-icon-color: var(--md-filled-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-text-field-trailing-icon-size, 24px);--_container-shape-start-start: var(--md-filled-text-field-container-shape-start-start, var(--md-filled-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-start-end: var(--md-filled-text-field-container-shape-start-end, var(--md-filled-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-end: var(--md-filled-text-field-container-shape-end-end, var(--md-filled-text-field-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-start: var(--md-filled-text-field-container-shape-end-start, var(--md-filled-text-field-container-shape, var(--md-sys-shape-corner-none, 0px)));--_icon-input-space: var(--md-filled-text-field-icon-input-space, 16px);--_leading-space: var(--md-filled-text-field-leading-space, 16px);--_trailing-space: var(--md-filled-text-field-trailing-space, 16px);--_top-space: var(--md-filled-text-field-top-space, 16px);--_bottom-space: var(--md-filled-text-field-bottom-space, 16px);--_input-text-prefix-trailing-space: var(--md-filled-text-field-input-text-prefix-trailing-space, 2px);--_input-text-suffix-leading-space: var(--md-filled-text-field-input-text-suffix-leading-space, 2px);--_with-label-top-space: var(--md-filled-text-field-with-label-top-space, 8px);--_with-label-bottom-space: var(--md-filled-text-field-with-label-bottom-space, 8px);--_focus-caret-color: var(--md-filled-text-field-focus-caret-color, var(--md-sys-color-primary, #6750a4));--_with-leading-icon-leading-space: var(--md-filled-text-field-with-leading-icon-leading-space, 12px);--_with-trailing-icon-trailing-space: var(--md-filled-text-field-with-trailing-icon-trailing-space, 12px);--md-filled-field-active-indicator-color: var(--_active-indicator-color);--md-filled-field-active-indicator-height: var(--_active-indicator-height);--md-filled-field-bottom-space: var(--_bottom-space);--md-filled-field-container-color: var(--_container-color);--md-filled-field-container-shape-end-end: var(--_container-shape-end-end);--md-filled-field-container-shape-end-start: var(--_container-shape-end-start);--md-filled-field-container-shape-start-end: var(--_container-shape-start-end);--md-filled-field-container-shape-start-start: var(--_container-shape-start-start);--md-filled-field-content-color: var(--_input-text-color);--md-filled-field-content-font: var(--_input-text-font);--md-filled-field-content-line-height: var(--_input-text-line-height);--md-filled-field-content-size: var(--_input-text-size);--md-filled-field-content-space: var(--_icon-input-space);--md-filled-field-content-weight: var(--_input-text-weight);--md-filled-field-disabled-active-indicator-color: var(--_disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height: var(--_disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity: var(--_disabled-active-indicator-opacity);--md-filled-field-disabled-container-color: var(--_disabled-container-color);--md-filled-field-disabled-container-opacity: var(--_disabled-container-opacity);--md-filled-field-disabled-content-color: var(--_disabled-input-text-color);--md-filled-field-disabled-content-opacity: var(--_disabled-input-text-opacity);--md-filled-field-disabled-label-text-color: var(--_disabled-label-text-color);--md-filled-field-disabled-label-text-opacity: var(--_disabled-label-text-opacity);--md-filled-field-disabled-leading-content-color: var(--_disabled-leading-icon-color);--md-filled-field-disabled-leading-content-opacity: var(--_disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color: var(--_disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity: var(--_disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-content-color: var(--_disabled-trailing-icon-color);--md-filled-field-disabled-trailing-content-opacity: var(--_disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color: var(--_error-active-indicator-color);--md-filled-field-error-content-color: var(--_error-input-text-color);--md-filled-field-error-focus-active-indicator-color: var(--_error-focus-active-indicator-color);--md-filled-field-error-focus-content-color: var(--_error-focus-input-text-color);--md-filled-field-error-focus-label-text-color: var(--_error-focus-label-text-color);--md-filled-field-error-focus-leading-content-color: var(--_error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color: var(--_error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-content-color: var(--_error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color: var(--_error-hover-active-indicator-color);--md-filled-field-error-hover-content-color: var(--_error-hover-input-text-color);--md-filled-field-error-hover-label-text-color: var(--_error-hover-label-text-color);--md-filled-field-error-hover-leading-content-color: var(--_error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color: var(--_error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity: var(--_error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color: var(--_error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-content-color: var(--_error-hover-trailing-icon-color);--md-filled-field-error-label-text-color: var(--_error-label-text-color);--md-filled-field-error-leading-content-color: var(--_error-leading-icon-color);--md-filled-field-error-supporting-text-color: var(--_error-supporting-text-color);--md-filled-field-error-trailing-content-color: var(--_error-trailing-icon-color);--md-filled-field-focus-active-indicator-color: var(--_focus-active-indicator-color);--md-filled-field-focus-active-indicator-height: var(--_focus-active-indicator-height);--md-filled-field-focus-content-color: var(--_focus-input-text-color);--md-filled-field-focus-label-text-color: var(--_focus-label-text-color);--md-filled-field-focus-leading-content-color: var(--_focus-leading-icon-color);--md-filled-field-focus-supporting-text-color: var(--_focus-supporting-text-color);--md-filled-field-focus-trailing-content-color: var(--_focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color: var(--_hover-active-indicator-color);--md-filled-field-hover-active-indicator-height: var(--_hover-active-indicator-height);--md-filled-field-hover-content-color: var(--_hover-input-text-color);--md-filled-field-hover-label-text-color: var(--_hover-label-text-color);--md-filled-field-hover-leading-content-color: var(--_hover-leading-icon-color);--md-filled-field-hover-state-layer-color: var(--_hover-state-layer-color);--md-filled-field-hover-state-layer-opacity: var(--_hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color: var(--_hover-supporting-text-color);--md-filled-field-hover-trailing-content-color: var(--_hover-trailing-icon-color);--md-filled-field-label-text-color: var(--_label-text-color);--md-filled-field-label-text-font: var(--_label-text-font);--md-filled-field-label-text-line-height: var(--_label-text-line-height);--md-filled-field-label-text-populated-line-height: var(--_label-text-populated-line-height);--md-filled-field-label-text-populated-size: var(--_label-text-populated-size);--md-filled-field-label-text-size: var(--_label-text-size);--md-filled-field-label-text-weight: var(--_label-text-weight);--md-filled-field-leading-content-color: var(--_leading-icon-color);--md-filled-field-leading-space: var(--_leading-space);--md-filled-field-supporting-text-color: var(--_supporting-text-color);--md-filled-field-supporting-text-font: var(--_supporting-text-font);--md-filled-field-supporting-text-line-height: var(--_supporting-text-line-height);--md-filled-field-supporting-text-size: var(--_supporting-text-size);--md-filled-field-supporting-text-weight: var(--_supporting-text-weight);--md-filled-field-top-space: var(--_top-space);--md-filled-field-trailing-content-color: var(--_trailing-icon-color);--md-filled-field-trailing-space: var(--_trailing-space);--md-filled-field-with-label-bottom-space: var(--_with-label-bottom-space);--md-filled-field-with-label-top-space: var(--_with-label-top-space);--md-filled-field-with-leading-content-leading-space: var(--_with-leading-icon-leading-space);--md-filled-field-with-trailing-content-trailing-space: var(--_with-trailing-icon-trailing-space)} +`;class Os extends r{constructor(){super(...arguments),this.disabled=!1,this.error=!1,this.focused=!1,this.label="",this.noAsterisk=!1,this.populated=!1,this.required=!1,this.resizable=!1,this.supportingText="",this.errorText="",this.count=-1,this.max=-1,this.hasStart=!1,this.hasEnd=!1,this.isAnimating=!1,this.refreshErrorAlert=!1,this.disableTransitions=!1}get counterText(){const e=this.count??-1,t=this.max??-1;return e<0||t<=0?"":`${e} / ${t}`}get supportingOrErrorText(){return this.error&&this.errorText?this.errorText:this.supportingText}reannounceError(){this.refreshErrorAlert=!0}update(e){e.has("disabled")&&void 0!==e.get("disabled")&&(this.disableTransitions=!0),this.disabled&&this.focused&&(e.set("focused",!0),this.focused=!1),this.animateLabelIfNeeded({wasFocused:e.get("focused"),wasPopulated:e.get("populated")}),super.update(e)}render(){var e,t,i,r;const o=this.renderLabel(!0),a=this.renderLabel(!1),n=null===(e=this.renderOutline)||void 0===e?void 0:e.call(this,o),l={disabled:this.disabled,"disable-transitions":this.disableTransitions,error:this.error&&!this.disabled,focused:this.focused,"with-start":this.hasStart,"with-end":this.hasEnd,populated:this.populated,resizable:this.resizable,required:this.required,"no-label":!this.label};return s` +
+
+ ${null===(t=this.renderBackground)||void 0===t?void 0:t.call(this)} + + ${null===(i=this.renderStateLayer)||void 0===i?void 0:i.call(this)} ${null===(r=this.renderIndicator)||void 0===r?void 0:r.call(this)} ${n} +
+
+ +
+
+
+ ${a} ${n?c:o} +
+
+ +
+
+
+ +
+
+
+ ${this.renderSupportingText()} +
+ `}updated(e){(e.has("supportingText")||e.has("errorText")||e.has("count")||e.has("max"))&&this.updateSlottedAriaDescribedBy(),this.refreshErrorAlert&&requestAnimationFrame((()=>{this.refreshErrorAlert=!1})),this.disableTransitions&&requestAnimationFrame((()=>{this.disableTransitions=!1}))}renderSupportingText(){const{supportingOrErrorText:e,counterText:t}=this;if(!e&&!t)return c;const i=s`${e}`,r=t?s`${t}`:c,o=this.error&&this.errorText&&!this.refreshErrorAlert;return s` +
${i}${r}
+ + `}updateSlottedAriaDescribedBy(){for(const e of this.slottedAriaDescribedBy)x(s`${this.supportingOrErrorText} ${this.counterText}`,e),e.setAttribute("hidden","")}renderLabel(e){if(!this.label)return c;let t;t=e?this.focused||this.populated||this.isAnimating:!this.focused&&!this.populated&&!this.isAnimating;const i={hidden:!t,floating:e,resting:!e},r=`${this.label}${this.required&&!this.noAsterisk?"*":""}`;return s` + ${r} + `}animateLabelIfNeeded({wasFocused:e,wasPopulated:t}){var i,r,s;if(!this.label)return;e??(e=this.focused),t??(t=this.populated);(e||t)!==(this.focused||this.populated)&&(this.isAnimating=!0,null===(i=this.labelAnimation)||void 0===i||i.cancel(),this.labelAnimation=null===(r=this.floatingLabelEl)||void 0===r?void 0:r.animate(this.getLabelKeyframes(),{duration:150,easing:w.STANDARD}),null===(s=this.labelAnimation)||void 0===s||s.addEventListener("finish",(()=>{this.isAnimating=!1})))}getLabelKeyframes(){const{floatingLabelEl:e,restingLabelEl:t}=this;if(!e||!t)return[];const{x:i,y:r,height:s}=e.getBoundingClientRect(),{x:o,y:a,height:n}=t.getBoundingClientRect(),l=e.scrollWidth,d=t.scrollWidth,c=d/l,h=`translateX(${o-i}px) translateY(${a-r+Math.round((n-s*c)/2)}px) scale(${c})`,p="translateX(0) translateY(0) scale(1)",u=t.clientWidth,f=d>u?u/c+"px":"";return this.focused||this.populated?[{transform:h,width:f},{transform:p,width:f}]:[{transform:p,width:f},{transform:h,width:f}]}getSurfacePositionClientRect(){return this.containerEl.getBoundingClientRect()}}t([a({type:Boolean})],Os.prototype,"disabled",void 0),t([a({type:Boolean})],Os.prototype,"error",void 0),t([a({type:Boolean})],Os.prototype,"focused",void 0),t([a()],Os.prototype,"label",void 0),t([a({type:Boolean,attribute:"no-asterisk"})],Os.prototype,"noAsterisk",void 0),t([a({type:Boolean})],Os.prototype,"populated",void 0),t([a({type:Boolean})],Os.prototype,"required",void 0),t([a({type:Boolean})],Os.prototype,"resizable",void 0),t([a({attribute:"supporting-text"})],Os.prototype,"supportingText",void 0),t([a({attribute:"error-text"})],Os.prototype,"errorText",void 0),t([a({type:Number})],Os.prototype,"count",void 0),t([a({type:Number})],Os.prototype,"max",void 0),t([a({type:Boolean,attribute:"has-start"})],Os.prototype,"hasStart",void 0),t([a({type:Boolean,attribute:"has-end"})],Os.prototype,"hasEnd",void 0),t([i({slot:"aria-describedby"})],Os.prototype,"slottedAriaDescribedBy",void 0),t([v()],Os.prototype,"isAnimating",void 0),t([v()],Os.prototype,"refreshErrorAlert",void 0),t([v()],Os.prototype,"disableTransitions",void 0),t([d(".label.floating")],Os.prototype,"floatingLabelEl",void 0),t([d(".label.resting")],Os.prototype,"restingLabelEl",void 0),t([d(".container")],Os.prototype,"containerEl",void 0);class Ds extends Os{renderBackground(){return s`
`}renderStateLayer(){return s`
`}renderIndicator(){return s`
`}}const $s=o`@layer styles{:host{--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_bottom-space: var(--md-filled-field-bottom-space, 16px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1d1b20));--_content-font: var(--md-filled-field-content-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_content-line-height: var(--md-filled-field-content-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_content-size: var(--md-filled-field-content-size, var(--md-sys-typescale-body-large-size, 1rem));--_content-space: var(--md-filled-field-content-space, 16px);--_content-weight: var(--md-filled-field-content-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-filled-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-content-opacity: var(--md-filled-field-disabled-leading-content-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-filled-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-content-opacity: var(--md-filled-field-disabled-trailing-content-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-filled-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-filled-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-filled-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-filled-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-filled-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-filled-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 3px);--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-filled-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-filled-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-content-color: var(--md-filled-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-filled-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-filled-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filled-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_label-text-size: var(--md-filled-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-filled-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_leading-content-color: var(--md-filled-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-space: var(--md-filled-field-leading-space, 16px);--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-filled-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-leading-space: var(--md-filled-field-supporting-text-leading-space, 16px);--_supporting-text-line-height: var(--md-filled-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_supporting-text-size: var(--md-filled-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_supporting-text-top-space: var(--md-filled-field-supporting-text-top-space, 4px);--_supporting-text-trailing-space: var(--md-filled-field-supporting-text-trailing-space, 16px);--_supporting-text-weight: var(--md-filled-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_top-space: var(--md-filled-field-top-space, 16px);--_trailing-content-color: var(--md-filled-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-space: var(--md-filled-field-trailing-space, 16px);--_with-label-bottom-space: var(--md-filled-field-with-label-bottom-space, 8px);--_with-label-top-space: var(--md-filled-field-with-label-top-space, 8px);--_with-leading-content-leading-space: var(--md-filled-field-with-leading-content-leading-space, 12px);--_with-trailing-content-trailing-space: var(--md-filled-field-with-trailing-content-trailing-space, 12px);--_container-shape-start-start: var(--md-filled-field-container-shape-start-start, var(--md-filled-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-start-end: var(--md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-end: var(--md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, var(--md-sys-shape-corner-none, 0px)));--_container-shape-end-start: var(--md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, var(--md-sys-shape-corner-none, 0px)))}.background,.state-layer{border-radius:inherit;inset:0;pointer-events:none;position:absolute}.background{background:var(--_container-color)}.state-layer{visibility:hidden}.field:not(.disabled):hover .state-layer{visibility:visible}.label.floating{position:absolute;top:var(--_with-label-top-space)}.field:not(.with-start) .label-wrapper{margin-inline-start:var(--_leading-space)}.field:not(.with-end) .label-wrapper{margin-inline-end:var(--_trailing-space)}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%;z-index:1}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:"";position:absolute;width:100%}.active-indicator::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .active-indicator::after{opacity:1}.field:not(.with-start) .content ::slotted(*){padding-inline-start:var(--_leading-space)}.field:not(.with-end) .content ::slotted(*){padding-inline-end:var(--_trailing-space)}.field:not(.no-label) .content ::slotted(:not(textarea)){padding-bottom:var(--_with-label-bottom-space);padding-top:calc(var(--_with-label-top-space) + var(--_label-text-populated-line-height))}.field:not(.no-label) .content ::slotted(textarea){margin-bottom:var(--_with-label-bottom-space);margin-top:calc(var(--_with-label-top-space) + var(--_label-text-populated-line-height))}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .background{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}.resizable .container{bottom:var(--_focus-active-indicator-height);clip-path:inset(var(--_focus-active-indicator-height) 0 0 0)}.resizable .container>*{top:var(--_focus-active-indicator-height)}}@layer hcm{@media(forced-colors: active){.disabled .active-indicator::before{border-color:GrayText;opacity:1}}} +`,Ms=o`:host{display:inline-flex;resize:both}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;height:100%;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;max-height:100%;min-height:100%;min-width:min-content;position:relative}.field,.container-overflow{resize:inherit}.resizable:not(.disabled) .container{resize:inherit;overflow:hidden}.disabled{pointer-events:none}slot[name=container]{border-radius:inherit}slot[name=container]::slotted(*){border-radius:inherit;inset:0;pointer-events:none;position:absolute}@layer styles{.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start{margin-inline:var(--_with-leading-content-leading-space) var(--_content-space)}.with-end .end{margin-inline:var(--_content-space) var(--_with-trailing-content-trailing-space)}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:is(.disabled,.disable-transitions) .content{transition:none}.content ::slotted(*){all:unset;color:currentColor;font-family:var(--_content-font);font-size:var(--_content-size);line-height:var(--_content-line-height);font-weight:var(--_content-weight);width:100%;overflow-wrap:revert;white-space:revert}.content ::slotted(:not(textarea)){padding-top:var(--_top-space);padding-bottom:var(--_bottom-space)}.content ::slotted(textarea){margin-top:var(--_top-space);margin-bottom:var(--_bottom-space)}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}}@layer hcm{@media(forced-colors: active){.disabled :is(.start,.content,.end){color:GrayText;opacity:1}}}@layer styles{.label{box-sizing:border-box;color:var(--_label-text-color);overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);width:min-content}.label-wrapper{inset:0;pointer-events:none;position:absolute}.label.resting{position:absolute;top:var(--_top-space)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}.label-wrapper{inset:0;position:absolute;text-align:initial}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .label:not(.hidden){color:GrayText;opacity:1}}}@layer styles{.supporting-text{color:var(--_supporting-text-color);display:flex;font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);gap:16px;justify-content:space-between;padding-inline-start:var(--_supporting-text-leading-space);padding-inline-end:var(--_supporting-text-trailing-space);padding-top:var(--_supporting-text-top-space)}.supporting-text :nth-child(2){flex-shrink:0}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .supporting-text{color:GrayText;opacity:1}}} +`;let Ps=class extends Ds{};Ps.styles=[Ms,$s],Ps=t([n("md-filled-field")],Ps);const Fs={},zs=E(class extends S{constructor(e){if(super(e),e.type!==k.PROPERTY&&e.type!==k.ATTRIBUTE&&e.type!==k.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===A||t===c)return t;const i=e.element,r=e.name;if(e.type===k.PROPERTY){if(t===i[r])return A}else if(e.type===k.BOOLEAN_ATTRIBUTE){if(!!t===i.hasAttribute(r))return A}else if(e.type===k.ATTRIBUTE&&i.getAttribute(r)===t+"")return A;return((e,t=Fs)=>{e._$AH=t})(e),t}}),Bs="important",Us=" !"+Bs,Ns=E(class extends S{constructor(e){var t;if(super(e),e.type!==k.ATTRIBUTE||"style"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const r=e[i];return null==r?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const r=t[e];if(null!=r){this.ft.add(e);const t="string"==typeof r&&r.endsWith(Us);e.includes("-")||t?i.setProperty(e,t?r.slice(0,-11):r,t?Bs:""):i[e]=r}}return A}}),Hs={fromAttribute:e=>e??"",toAttribute:e=>e||null},qs=Symbol("onReportValidity"),Gs=Symbol("privateCleanupFormListeners"),Ws=Symbol("privateDoNotReportInvalid"),Zs=Symbol("privateIsSelfReportingValidity"),Vs=Symbol("privateCallOnReportValidity");function js(e){var t,i,r;class s extends e{constructor(...e){super(...e),this[t]=new AbortController,this[i]=!1,this[r]=!1,this.addEventListener("invalid",(e=>{!this[Ws]&&e.isTrusted&&this.addEventListener("invalid",(()=>{this[Vs](e)}),{once:!0})}),{capture:!0})}checkValidity(){this[Ws]=!0;const e=super.checkValidity();return this[Ws]=!1,e}reportValidity(){this[Zs]=!0;const e=super.reportValidity();return e&&this[Vs](null),this[Zs]=!1,e}[(t=Gs,i=Ws,r=Zs,Vs)](e){const t=null==e?void 0:e.defaultPrevented;if(t)return;this[qs](e);!t&&(null==e?void 0:e.defaultPrevented)&&(this[Zs]||function(e,t){if(!e)return!0;let i;for(const t of e.elements)if(t.matches(":invalid")){i=t;break}return i===t}(this[f].form,this))&&this.focus()}[qs](e){throw new Error("Implement [onReportValidity]")}formAssociatedCallback(e){super.formAssociatedCallback&&super.formAssociatedCallback(e),this[Gs].abort(),e&&(this[Gs]=new AbortController,function(e,t,i,r){const s=function(e){if(!Ks.has(e)){const t=new EventTarget;Ks.set(e,t);for(const i of["reportValidity","requestSubmit"]){const r=e[i];e[i]=function(){t.dispatchEvent(new Event("before"));const e=Reflect.apply(r,this,arguments);return t.dispatchEvent(new Event("after")),e}}}return Ks.get(e)}(t);let o,a=!1,n=!1;s.addEventListener("before",(()=>{n=!0,o=new AbortController,a=!1,e.addEventListener("invalid",(()=>{a=!0}),{signal:o.signal})}),{signal:r}),s.addEventListener("after",(()=>{var e;n=!1,null===(e=o)||void 0===e||e.abort(),a||i()}),{signal:r}),t.addEventListener("submit",(()=>{n||i()}),{signal:r})}(this,e,(()=>{this[Vs](null)}),this[Gs].signal))}}return s}const Ks=new WeakMap;class Ys extends fe{computeValidity({state:e,renderedControl:t}){let i=t;Xs(e)&&!i?(i=this.inputControl||document.createElement("input"),this.inputControl=i):i||(i=this.textAreaControl||document.createElement("textarea"),this.textAreaControl=i);const r=Xs(e)?i:null;if(r&&(r.type=e.type),i.value!==e.value&&(i.value=e.value),i.required=e.required,r){const t=e;t.pattern?r.pattern=t.pattern:r.removeAttribute("pattern"),t.min?r.min=t.min:r.removeAttribute("min"),t.max?r.max=t.max:r.removeAttribute("max"),t.step?r.step=t.step:r.removeAttribute("step")}return(e.minLength??-1)>-1?i.setAttribute("minlength",String(e.minLength)):i.removeAttribute("minlength"),(e.maxLength??-1)>-1?i.setAttribute("maxlength",String(e.maxLength)):i.removeAttribute("maxlength"),{validity:i.validity,validationMessage:i.validationMessage}}equals({state:e},{state:t}){const i=e.type===t.type&&e.value===t.value&&e.required===t.required&&e.minLength===t.minLength&&e.maxLength===t.maxLength;return Xs(e)&&Xs(t)?i&&e.pattern===t.pattern&&e.min===t.min&&e.max===t.max&&e.step===t.step:i}copy({state:e}){return{state:Xs(e)?this.copyInput(e):this.copyTextArea(e),renderedControl:null}}copyInput(e){const{type:t,pattern:i,min:r,max:s,step:o}=e;return{...this.copySharedState(e),type:t,pattern:i,min:r,max:s,step:o}}copyTextArea(e){return{...this.copySharedState(e),type:e.type}}copySharedState({value:e,required:t,minLength:i,maxLength:r}){return{value:e,required:t,minLength:i,maxLength:r}}}function Xs(e){return"textarea"!==e.type}const Js=l(js(ce(ue(m(r)))));class Qs extends Js{constructor(){super(...arguments),this.error=!1,this.errorText="",this.label="",this.noAsterisk=!1,this.required=!1,this.value="",this.prefixText="",this.suffixText="",this.hasLeadingIcon=!1,this.hasTrailingIcon=!1,this.supportingText="",this.textDirection="",this.rows=2,this.cols=20,this.inputMode="",this.max="",this.maxLength=-1,this.min="",this.minLength=-1,this.noSpinner=!1,this.pattern="",this.placeholder="",this.readOnly=!1,this.multiple=!1,this.step="",this.type="text",this.autocomplete="",this.dirty=!1,this.focused=!1,this.nativeError=!1,this.nativeErrorText=""}get selectionDirection(){return this.getInputOrTextarea().selectionDirection}set selectionDirection(e){this.getInputOrTextarea().selectionDirection=e}get selectionEnd(){return this.getInputOrTextarea().selectionEnd}set selectionEnd(e){this.getInputOrTextarea().selectionEnd=e}get selectionStart(){return this.getInputOrTextarea().selectionStart}set selectionStart(e){this.getInputOrTextarea().selectionStart=e}get valueAsNumber(){const e=this.getInput();return e?e.valueAsNumber:NaN}set valueAsNumber(e){const t=this.getInput();t&&(t.valueAsNumber=e,this.value=t.value)}get valueAsDate(){const e=this.getInput();return e?e.valueAsDate:null}set valueAsDate(e){const t=this.getInput();t&&(t.valueAsDate=e,this.value=t.value)}get hasError(){return this.error||this.nativeError}select(){this.getInputOrTextarea().select()}setRangeText(...e){this.getInputOrTextarea().setRangeText(...e),this.value=this.getInputOrTextarea().value}setSelectionRange(e,t,i){this.getInputOrTextarea().setSelectionRange(e,t,i)}showPicker(){const e=this.getInput();e&&e.showPicker()}stepDown(e){const t=this.getInput();t&&(t.stepDown(e),this.value=t.value)}stepUp(e){const t=this.getInput();t&&(t.stepUp(e),this.value=t.value)}reset(){this.dirty=!1,this.value=this.getAttribute("value")??"",this.nativeError=!1,this.nativeErrorText=""}attributeChangedCallback(e,t,i){"value"===e&&this.dirty||super.attributeChangedCallback(e,t,i)}render(){const e={disabled:this.disabled,error:!this.disabled&&this.hasError,textarea:"textarea"===this.type,"no-spinner":this.noSpinner};return s` + + ${this.renderField()} + + `}updated(e){const t=this.getInputOrTextarea().value;this.value!==t&&(this.value=t)}renderField(){return Q`<${this.fieldTag} + class="field" + count=${this.value.length} + ?disabled=${this.disabled} + ?error=${this.hasError} + error-text=${this.getErrorText()} + ?focused=${this.focused} + ?has-end=${this.hasTrailingIcon} + ?has-start=${this.hasLeadingIcon} + label=${this.label} + ?no-asterisk=${this.noAsterisk} + max=${this.maxLength} + ?populated=${!!this.value} + ?required=${this.required} + ?resizable=${"textarea"===this.type} + supporting-text=${this.supportingText} + > + ${this.renderLeadingIcon()} + ${this.renderInputOrTextarea()} + ${this.renderTrailingIcon()} +
+ + `}renderLeadingIcon(){return s` + + + + `}renderTrailingIcon(){return s` + + + + `}renderInputOrTextarea(){const e={direction:this.textDirection},t=this.ariaLabel||this.label||c,i=this.autocomplete,r=(this.maxLength??-1)>-1,o=(this.minLength??-1)>-1;if("textarea"===this.type)return s` + + `;const a=this.renderPrefix(),n=this.renderSuffix(),l=this.inputMode;return s` +
+ ${a} + + ${n} +
+ `}renderPrefix(){return this.renderAffix(this.prefixText,!1)}renderSuffix(){return this.renderAffix(this.suffixText,!0)}renderAffix(e,t){if(!e)return c;return s`${e}`}getErrorText(){return this.error?this.errorText:this.nativeErrorText}handleFocusChange(){var e;this.focused=(null===(e=this.inputOrTextarea)||void 0===e?void 0:e.matches(":focus"))??!1}handleInput(e){this.dirty=!0,this.value=e.target.value}redispatchEvent(e){b(this,e)}getInputOrTextarea(){return this.inputOrTextarea||(this.connectedCallback(),this.scheduleUpdate()),this.isUpdatePending&&this.scheduleUpdate(),this.inputOrTextarea}getInput(){return"textarea"===this.type?null:this.getInputOrTextarea()}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0,this.hasTrailingIcon=this.trailingIcons.length>0}[he](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(e){this.value=e}focus(){this.getInputOrTextarea().focus()}[oe](){return new Ys((()=>({state:this,renderedControl:this.inputOrTextarea})))}[ae](){return this.inputOrTextarea}[qs](e){null==e||e.preventDefault();const t=this.getErrorText();var i;(this.nativeError=!!e,this.nativeErrorText=this.validationMessage,t===this.getErrorText())&&(null===(i=this.field)||void 0===i||i.reannounceError())}}Qs.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([a({type:Boolean,reflect:!0})],Qs.prototype,"error",void 0),t([a({attribute:"error-text"})],Qs.prototype,"errorText",void 0),t([a()],Qs.prototype,"label",void 0),t([a({type:Boolean,attribute:"no-asterisk"})],Qs.prototype,"noAsterisk",void 0),t([a({type:Boolean,reflect:!0})],Qs.prototype,"required",void 0),t([a()],Qs.prototype,"value",void 0),t([a({attribute:"prefix-text"})],Qs.prototype,"prefixText",void 0),t([a({attribute:"suffix-text"})],Qs.prototype,"suffixText",void 0),t([a({type:Boolean,attribute:"has-leading-icon"})],Qs.prototype,"hasLeadingIcon",void 0),t([a({type:Boolean,attribute:"has-trailing-icon"})],Qs.prototype,"hasTrailingIcon",void 0),t([a({attribute:"supporting-text"})],Qs.prototype,"supportingText",void 0),t([a({attribute:"text-direction"})],Qs.prototype,"textDirection",void 0),t([a({type:Number})],Qs.prototype,"rows",void 0),t([a({type:Number})],Qs.prototype,"cols",void 0),t([a({reflect:!0})],Qs.prototype,"inputMode",void 0),t([a()],Qs.prototype,"max",void 0),t([a({type:Number})],Qs.prototype,"maxLength",void 0),t([a()],Qs.prototype,"min",void 0),t([a({type:Number})],Qs.prototype,"minLength",void 0),t([a({type:Boolean,attribute:"no-spinner"})],Qs.prototype,"noSpinner",void 0),t([a()],Qs.prototype,"pattern",void 0),t([a({reflect:!0,converter:Hs})],Qs.prototype,"placeholder",void 0),t([a({type:Boolean,reflect:!0})],Qs.prototype,"readOnly",void 0),t([a({type:Boolean,reflect:!0})],Qs.prototype,"multiple",void 0),t([a()],Qs.prototype,"step",void 0),t([a({reflect:!0})],Qs.prototype,"type",void 0),t([a({reflect:!0})],Qs.prototype,"autocomplete",void 0),t([v()],Qs.prototype,"dirty",void 0),t([v()],Qs.prototype,"focused",void 0),t([v()],Qs.prototype,"nativeError",void 0),t([v()],Qs.prototype,"nativeErrorText",void 0),t([d(".input")],Qs.prototype,"inputOrTextarea",void 0),t([d(".field")],Qs.prototype,"field",void 0),t([i({slot:"leading-icon"})],Qs.prototype,"leadingIcons",void 0),t([i({slot:"trailing-icon"})],Qs.prototype,"trailingIcons",void 0);class eo extends Qs{constructor(){super(...arguments),this.fieldTag=X`md-filled-field`}}const to=o`:host{display:inline-flex;outline:none;resize:both;text-align:start;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}slot[name=container]{border-radius:inherit}.icon{color:currentColor;display:flex;align-items:center;justify-content:center;fill:currentColor;position:relative}.icon ::slotted(*){display:flex;position:absolute}[has-start] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[has-end] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)} +`;class io extends eo{constructor(){super(...arguments),this.fieldTag=X`md-filled-field`}}io.styles=[to,Ls],customElements.define("ew-filled-text-field",io);class ro extends r{connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){return s``}}const so=o`:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}:host{display:flex;pointer-events:none;transition-property:box-shadow,opacity}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity;--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000))}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15} +`;let oo=class extends ro{};oo.styles=[so],oo=t([n("md-elevation")],oo);const ao=function(e,t){return new CustomEvent("close-menu",{bubbles:!0,composed:!0,detail:{initiator:e,reason:t,itemPath:[e]}})},no={SPACE:"Space",ENTER:"Enter"},lo="click-selection",co="keydown",ho={ESCAPE:"Escape",SPACE:no.SPACE,ENTER:no.ENTER};function po(e){return Object.values(ho).some((t=>t===e))}function uo(e,t){const i=new Event("md-contains",{bubbles:!0,composed:!0});let r=[];const s=e=>{r=e.composedPath()};t.addEventListener("md-contains",s),e.dispatchEvent(i),t.removeEventListener("md-contains",s);return r.length>0}const fo="none",mo="list-root",vo="first-item",go="last-item",_o="end-start",bo="start-start";class yo{constructor(e,t){this.host=e,this.getProperties=t,this.surfaceStylesInternal={display:"none"},this.lastValues={isOpen:!1},this.host.addController(this)}get surfaceStyles(){return this.surfaceStylesInternal}async position(){const{surfaceEl:e,anchorEl:t,anchorCorner:i,surfaceCorner:r,positioning:s,xOffset:o,yOffset:a,disableBlockFlip:n,disableInlineFlip:l,repositionStrategy:d}=this.getProperties(),c=i.toLowerCase().trim(),h=r.toLowerCase().trim();if(!e||!t)return;const p=window.innerWidth,u=window.innerHeight,f=document.createElement("div");f.style.opacity="0",f.style.position="fixed",f.style.display="block",f.style.inset="0",document.body.appendChild(f);const m=f.getBoundingClientRect();f.remove();const v=window.innerHeight-m.bottom,g=window.innerWidth-m.right;this.surfaceStylesInternal={display:"block",opacity:"0"},this.host.requestUpdate(),await this.host.updateComplete,e.popover&&e.isConnected&&e.showPopover();const _=e.getSurfacePositionClientRect?e.getSurfacePositionClientRect():e.getBoundingClientRect(),b=t.getSurfacePositionClientRect?t.getSurfacePositionClientRect():t.getBoundingClientRect(),[y,x]=h.split("-"),[w,E]=c.split("-"),S="ltr"===getComputedStyle(e).direction;let{blockInset:k,blockOutOfBoundsCorrection:A,surfaceBlockProperty:R}=this.calculateBlock({surfaceRect:_,anchorRect:b,anchorBlock:w,surfaceBlock:y,yOffset:a,positioning:s,windowInnerHeight:u,blockScrollbarHeight:v});if(A&&!n){const e="start"===y?"end":"start",t="start"===w?"end":"start",i=this.calculateBlock({surfaceRect:_,anchorRect:b,anchorBlock:t,surfaceBlock:e,yOffset:a,positioning:s,windowInnerHeight:u,blockScrollbarHeight:v});A>i.blockOutOfBoundsCorrection&&(k=i.blockInset,A=i.blockOutOfBoundsCorrection,R=i.surfaceBlockProperty)}let{inlineInset:I,inlineOutOfBoundsCorrection:C,surfaceInlineProperty:T}=this.calculateInline({surfaceRect:_,anchorRect:b,anchorInline:E,surfaceInline:x,xOffset:o,positioning:s,isLTR:S,windowInnerWidth:p,inlineScrollbarWidth:g});if(C&&!l){const e="start"===x?"end":"start",t="start"===E?"end":"start",i=this.calculateInline({surfaceRect:_,anchorRect:b,anchorInline:t,surfaceInline:e,xOffset:o,positioning:s,isLTR:S,windowInnerWidth:p,inlineScrollbarWidth:g});Math.abs(C)>Math.abs(i.inlineOutOfBoundsCorrection)&&(I=i.inlineInset,C=i.inlineOutOfBoundsCorrection,T=i.surfaceInlineProperty)}"move"===d&&(k-=A,I-=C),this.surfaceStylesInternal={display:"block",opacity:"1",[R]:`${k}px`,[T]:`${I}px`},"resize"===d&&(A&&(this.surfaceStylesInternal.height=_.height-A+"px"),C&&(this.surfaceStylesInternal.width=_.width-C+"px")),this.host.requestUpdate()}calculateBlock(e){const{surfaceRect:t,anchorRect:i,anchorBlock:r,surfaceBlock:s,yOffset:o,positioning:a,windowInnerHeight:n,blockScrollbarHeight:l}=e,d="fixed"===a||"document"===a?1:0,c="document"===a?1:0,h="start"===s?1:0,p="end"===s?1:0,u=(r!==s?1:0)*i.height+o,f=h*i.top+p*(n-i.bottom-l);return{blockInset:d*f+c*(h*window.scrollY-p*window.scrollY)+u,blockOutOfBoundsCorrection:Math.abs(Math.min(0,n-f-u-t.height)),surfaceBlockProperty:"start"===s?"inset-block-start":"inset-block-end"}}calculateInline(e){const{isLTR:t,surfaceInline:i,anchorInline:r,anchorRect:s,surfaceRect:o,xOffset:a,positioning:n,windowInnerWidth:l,inlineScrollbarWidth:d}=e,c="fixed"===n||"document"===n?1:0,h="document"===n?1:0,p=t?1:0,u=t?0:1,f="start"===i?1:0,m="end"===i?1:0,v=(r!==i?1:0)*s.width+a,g=p*(f*s.left+m*(l-s.right-d))+u*(f*(l-s.right-d)+m*s.left);let _="start"===i?"inset-inline-start":"inset-inline-end";return"document"!==n&&"fixed"!==n||(_="start"===i&&t||"end"===i&&!t?"left":"right"),{inlineInset:c*g+v+h*(p*(f*window.scrollX-m*window.scrollX)+u*(m*window.scrollX-f*window.scrollX)),inlineOutOfBoundsCorrection:Math.abs(Math.min(0,l-g-v-o.width)),surfaceInlineProperty:_}}hostUpdate(){this.onUpdate()}hostUpdated(){this.onUpdate()}async onUpdate(){const e=this.getProperties();let t=!1;for(const[i,r]of Object.entries(e))if(t=t||r!==this.lastValues[i],t)break;const i=this.lastValues.isOpen!==e.isOpen,r=!!e.anchorEl,s=!!e.surfaceEl;t&&r&&s&&(this.lastValues.isOpen=e.isOpen,e.isOpen?(this.lastValues=e,await this.position(),e.onOpen()):i&&(await e.beforeClose(),this.close(),e.onClose()))}close(){this.surfaceStylesInternal={display:"none"},this.host.requestUpdate();const e=this.getProperties().surfaceEl;null!=e&&e.popover&&null!=e&&e.isConnected&&e.hidePopover()}}const xo=0,wo=1,Eo=2;class So{constructor(e){this.getProperties=e,this.typeaheadRecords=[],this.typaheadBuffer="",this.cancelTypeaheadTimeout=0,this.isTypingAhead=!1,this.lastActiveRecord=null,this.onKeydown=e=>{this.isTypingAhead?this.typeahead(e):this.beginTypeahead(e)},this.endTypeahead=()=>{this.isTypingAhead=!1,this.typaheadBuffer="",this.typeaheadRecords=[]}}get items(){return this.getProperties().getItems()}get active(){return this.getProperties().active}beginTypeahead(e){this.active&&("Space"===e.code||"Enter"===e.code||e.code.startsWith("Arrow")||"Escape"===e.code||(this.isTypingAhead=!0,this.typeaheadRecords=this.items.map(((e,t)=>[t,e,e.typeaheadText.trim().toLowerCase()])),this.lastActiveRecord=this.typeaheadRecords.find((e=>0===e[wo].tabIndex))??null,this.lastActiveRecord&&(this.lastActiveRecord[wo].tabIndex=-1),this.typeahead(e)))}typeahead(e){if(e.defaultPrevented)return;if(clearTimeout(this.cancelTypeaheadTimeout),"Enter"===e.code||e.code.startsWith("Arrow")||"Escape"===e.code)return this.endTypeahead(),void(this.lastActiveRecord&&(this.lastActiveRecord[wo].tabIndex=-1));"Space"===e.code&&e.preventDefault(),this.cancelTypeaheadTimeout=setTimeout(this.endTypeahead,this.getProperties().typeaheadBufferTime),this.typaheadBuffer+=e.key.toLowerCase();const t=this.lastActiveRecord?this.lastActiveRecord[xo]:-1,i=this.typeaheadRecords.length,r=e=>(e[xo]+i-t)%i,s=this.typeaheadRecords.filter((e=>!e[wo].disabled&&e[Eo].startsWith(this.typaheadBuffer))).sort(((e,t)=>r(e)-r(t)));if(0===s.length)return clearTimeout(this.cancelTypeaheadTimeout),this.lastActiveRecord&&(this.lastActiveRecord[wo].tabIndex=-1),void this.endTypeahead();const o=1===this.typaheadBuffer.length;let a;a=this.lastActiveRecord===s[0]&&o?s[1]??s[0]:s[0],this.lastActiveRecord&&(this.lastActiveRecord[wo].tabIndex=-1),this.lastActiveRecord=a,a[wo].tabIndex=0,a[wo].focus()}}const ko=new Set([B.ArrowDown,B.ArrowUp,B.Home,B.End]),Ao=new Set([B.ArrowLeft,B.ArrowRight,...ko]);class Ro extends r{get openDirection(){return"start"===this.menuCorner.split("-")[0]?"DOWN":"UP"}get anchorElement(){return this.anchor?this.getRootNode().querySelector(`#${this.anchor}`):this.currentAnchorElement}set anchorElement(e){this.currentAnchorElement=e,this.requestUpdate("anchorElement")}constructor(){super(),this.anchor="",this.positioning="absolute",this.quick=!1,this.hasOverflow=!1,this.open=!1,this.xOffset=0,this.yOffset=0,this.noHorizontalFlip=!1,this.noVerticalFlip=!1,this.typeaheadDelay=200,this.anchorCorner=_o,this.menuCorner=bo,this.stayOpenOnOutsideClick=!1,this.stayOpenOnFocusout=!1,this.skipRestoreFocus=!1,this.defaultFocus=vo,this.noNavigationWrap=!1,this.typeaheadActive=!0,this.isSubmenu=!1,this.pointerPath=[],this.isRepositioning=!1,this.openCloseAnimationSignal=R(),this.listController=new U({isItem:e=>e.hasAttribute("md-menu-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:e=>{e.selected=!1,e.tabIndex=-1},activateItem:e=>{e.selected=!0,e.tabIndex=0},isNavigableKey:e=>{if(!this.isSubmenu)return Ao.has(e);return e===("rtl"===getComputedStyle(this).direction?B.ArrowLeft:B.ArrowRight)||ko.has(e)},wrapNavigation:()=>!this.noNavigationWrap}),this.lastFocusedElement=null,this.typeaheadController=new So((()=>({getItems:()=>this.items,typeaheadBufferTime:this.typeaheadDelay,active:this.typeaheadActive}))),this.currentAnchorElement=null,this.internals=this.attachInternals(),this.menuPositionController=new yo(this,(()=>({anchorCorner:this.anchorCorner,surfaceCorner:this.menuCorner,surfaceEl:this.surfaceEl,anchorEl:this.anchorElement,positioning:"popover"===this.positioning?"document":this.positioning,isOpen:this.open,xOffset:this.xOffset,yOffset:this.yOffset,disableBlockFlip:this.noVerticalFlip,disableInlineFlip:this.noHorizontalFlip,onOpen:this.onOpened,beforeClose:this.beforeClose,onClose:this.onClosed,repositionStrategy:this.hasOverflow&&"popover"!==this.positioning?"move":"resize"}))),this.onWindowResize=()=>{this.isRepositioning||"document"!==this.positioning&&"fixed"!==this.positioning&&"popover"!==this.positioning||(this.isRepositioning=!0,this.reposition(),this.isRepositioning=!1)},this.handleFocusout=async e=>{const t=this.anchorElement;if(this.stayOpenOnFocusout||!this.open||this.pointerPath.includes(t))return;if(e.relatedTarget){if(uo(e.relatedTarget,this)||0!==this.pointerPath.length&&uo(e.relatedTarget,t))return}else if(this.pointerPath.includes(this))return;const i=this.skipRestoreFocus;this.skipRestoreFocus=!0,this.close(),await this.updateComplete,this.skipRestoreFocus=i},this.onOpened=async()=>{this.lastFocusedElement=function(e=document){let t=e.activeElement;for(;t&&null!==(i=t)&&void 0!==i&&null!==(i=i.shadowRoot)&&void 0!==i&&i.activeElement;){var i;t=t.shadowRoot.activeElement}return t}();const e=this.items,t=D(e);t&&this.defaultFocus!==fo&&(t.item.tabIndex=-1);let i=!this.quick;switch(this.quick?this.dispatchEvent(new Event("opening")):i=!!await this.animateOpen(),this.defaultFocus){case vo:const t=$(e);t&&(t.tabIndex=0,t.focus(),await t.updateComplete);break;case go:const i=M(e);i&&(i.tabIndex=0,i.focus(),await i.updateComplete);break;case mo:this.focus()}i||this.dispatchEvent(new Event("opened"))},this.beforeClose=async()=>{var e,t;(this.open=!1,this.skipRestoreFocus)||(null===(e=this.lastFocusedElement)||void 0===e||null===(t=e.focus)||void 0===t||t.call(e));this.quick||await this.animateClose()},this.onClosed=()=>{this.quick&&(this.dispatchEvent(new Event("closing")),this.dispatchEvent(new Event("closed")))},this.onWindowPointerdown=e=>{this.pointerPath=e.composedPath()},this.onDocumentClick=e=>{if(!this.open)return;const t=e.composedPath();this.stayOpenOnOutsideClick||t.includes(this)||t.includes(this.anchorElement)||(this.open=!1)},this.internals.role="menu",this.addEventListener("keydown",this.handleKeydown),this.addEventListener("keydown",this.captureKeydown,{capture:!0}),this.addEventListener("focusout",this.handleFocusout)}get items(){return this.listController.items}willUpdate(e){e.has("open")&&(this.open?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true"))}update(e){e.has("open")&&(this.open?this.setUpGlobalEventListeners():this.cleanUpGlobalEventListeners()),e.has("positioning")&&"popover"===this.positioning&&!this.showPopover&&(this.positioning="fixed"),super.update(e)}connectedCallback(){super.connectedCallback(),this.open&&this.setUpGlobalEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.cleanUpGlobalEventListeners()}getBoundingClientRect(){return this.surfaceEl?this.surfaceEl.getBoundingClientRect():super.getBoundingClientRect()}getClientRects(){return this.surfaceEl?this.surfaceEl.getClientRects():super.getClientRects()}render(){return this.renderSurface()}renderSurface(){return s` + + `}renderMenuItems(){return s``}renderElevation(){return s``}getSurfaceClasses(){return{open:this.open,fixed:"fixed"===this.positioning,"has-overflow":this.hasOverflow}}captureKeydown(e){e.target===this&&!e.defaultPrevented&&po(e.code)&&(e.preventDefault(),this.close()),this.typeaheadController.onKeydown(e)}async animateOpen(){const e=this.surfaceEl,t=this.slotEl;if(!e||!t)return!0;const i=this.openDirection;this.dispatchEvent(new Event("opening")),e.classList.toggle("animating",!0);const r=this.openCloseAnimationSignal.start(),s=e.offsetHeight,o="UP"===i,a=this.items,n=250/a.length,l=e.animate([{height:"0px"},{height:`${s}px`}],{duration:500,easing:w.EMPHASIZED}),d=t.animate([{transform:o?`translateY(-${s}px)`:""},{transform:""}],{duration:500,easing:w.EMPHASIZED}),c=e.animate([{opacity:0},{opacity:1}],50),h=[];for(let e=0;e{t.classList.toggle("md-menu-hidden",!1)})),h.push([t,i])}let p=e=>{};const u=new Promise((e=>{p=e}));return r.addEventListener("abort",(()=>{l.cancel(),d.cancel(),c.cancel(),h.forEach((([e,t])=>{e.classList.toggle("md-menu-hidden",!1),t.cancel()})),p(!0)})),l.addEventListener("finish",(()=>{e.classList.toggle("animating",!1),this.openCloseAnimationSignal.finish(),p(!1)})),await u}animateClose(){let e;const t=new Promise((t=>{e=t})),i=this.surfaceEl,r=this.slotEl;if(!i||!r)return e(!1),t;const s="UP"===this.openDirection;this.dispatchEvent(new Event("closing")),i.classList.toggle("animating",!0);const o=this.openCloseAnimationSignal.start(),a=i.offsetHeight,n=this.items,l=150,d=50/n.length,c=i.animate([{height:`${a}px`},{height:.35*a+"px"}],{duration:l,easing:w.EMPHASIZED_ACCELERATE}),h=r.animate([{transform:""},{transform:s?`translateY(-${.65*a}px)`:""}],{duration:l,easing:w.EMPHASIZED_ACCELERATE}),p=i.animate([{opacity:1},{opacity:0}],{duration:50,delay:100}),u=[];for(let e=0;e{t.classList.toggle("md-menu-hidden",!0)})),u.push([t,i])}return o.addEventListener("abort",(()=>{c.cancel(),h.cancel(),p.cancel(),u.forEach((([e,t])=>{t.cancel(),e.classList.toggle("md-menu-hidden",!1)})),e(!1)})),c.addEventListener("finish",(()=>{i.classList.toggle("animating",!1),u.forEach((([e])=>{e.classList.toggle("md-menu-hidden",!1)})),this.openCloseAnimationSignal.finish(),this.dispatchEvent(new Event("closed")),e(!0)})),t}handleKeydown(e){this.pointerPath=[],this.listController.handleKeydown(e)}setUpGlobalEventListeners(){document.addEventListener("click",this.onDocumentClick,{capture:!0}),window.addEventListener("pointerdown",this.onWindowPointerdown),document.addEventListener("resize",this.onWindowResize,{passive:!0}),window.addEventListener("resize",this.onWindowResize,{passive:!0})}cleanUpGlobalEventListeners(){document.removeEventListener("click",this.onDocumentClick,{capture:!0}),window.removeEventListener("pointerdown",this.onWindowPointerdown),document.removeEventListener("resize",this.onWindowResize),window.removeEventListener("resize",this.onWindowResize)}onCloseMenu(){this.close()}onDeactivateItems(e){e.stopPropagation(),this.listController.onDeactivateItems()}onRequestActivation(e){e.stopPropagation(),this.listController.onRequestActivation(e)}handleDeactivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!1}handleActivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!0}handleStayOpenOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!0}handleCloseOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!1}close(){this.open=!1;this.slotItems.forEach((e=>{var t;null===(t=e.close)||void 0===t||t.call(e)}))}show(){this.open=!0}activateNextItem(){return this.listController.activateNextItem()??null}activatePreviousItem(){return this.listController.activatePreviousItem()??null}reposition(){this.open&&this.menuPositionController.position()}}t([d(".menu")],Ro.prototype,"surfaceEl",void 0),t([d("slot")],Ro.prototype,"slotEl",void 0),t([a()],Ro.prototype,"anchor",void 0),t([a()],Ro.prototype,"positioning",void 0),t([a({type:Boolean})],Ro.prototype,"quick",void 0),t([a({type:Boolean,attribute:"has-overflow"})],Ro.prototype,"hasOverflow",void 0),t([a({type:Boolean,reflect:!0})],Ro.prototype,"open",void 0),t([a({type:Number,attribute:"x-offset"})],Ro.prototype,"xOffset",void 0),t([a({type:Number,attribute:"y-offset"})],Ro.prototype,"yOffset",void 0),t([a({type:Boolean,attribute:"no-horizontal-flip"})],Ro.prototype,"noHorizontalFlip",void 0),t([a({type:Boolean,attribute:"no-vertical-flip"})],Ro.prototype,"noVerticalFlip",void 0),t([a({type:Number,attribute:"typeahead-delay"})],Ro.prototype,"typeaheadDelay",void 0),t([a({attribute:"anchor-corner"})],Ro.prototype,"anchorCorner",void 0),t([a({attribute:"menu-corner"})],Ro.prototype,"menuCorner",void 0),t([a({type:Boolean,attribute:"stay-open-on-outside-click"})],Ro.prototype,"stayOpenOnOutsideClick",void 0),t([a({type:Boolean,attribute:"stay-open-on-focusout"})],Ro.prototype,"stayOpenOnFocusout",void 0),t([a({type:Boolean,attribute:"skip-restore-focus"})],Ro.prototype,"skipRestoreFocus",void 0),t([a({attribute:"default-focus"})],Ro.prototype,"defaultFocus",void 0),t([a({type:Boolean,attribute:"no-navigation-wrap"})],Ro.prototype,"noNavigationWrap",void 0),t([i({flatten:!0})],Ro.prototype,"slotItems",void 0),t([v()],Ro.prototype,"typeaheadActive",void 0);const Io=o`:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px))}.menu{border-radius:var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px));display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit;scrollbar-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit;scrollbar-width:inherit}.item-padding{padding-block:var(--md-menu-top-space, 8px) var(--md-menu-bottom-space, 8px)}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}} +`;let Co=class extends Ro{};Co.styles=[Io],Co=t([n("md-menu")],Co);class To extends fe{computeValidity(e){return this.selectControl||(this.selectControl=document.createElement("select")),x(s``,this.selectControl),this.selectControl.value=e.value,this.selectControl.required=e.required,{validity:this.selectControl.validity,validationMessage:this.selectControl.validationMessage}}equals(e,t){return e.value===t.value&&e.required===t.required}copy({value:e,required:t}){return{value:e,required:t}}}var Lo;const Oo=Symbol("value"),Do=l(js(ce(ue(m(r)))));class $o extends Do{get value(){return this[Oo]}set value(e){this.lastUserSetValue=e,this.select(e)}get options(){var e;return(null===(e=this.menu)||void 0===e?void 0:e.items)??[]}get selectedIndex(){const[e,t]=(this.getSelectedOptions()??[])[0]??[];return t??-1}set selectedIndex(e){this.lastUserSetSelectedIndex=e,this.selectIndex(e)}get selectedOptions(){return(this.getSelectedOptions()??[]).map((([e])=>e))}get hasError(){return this.error||this.nativeError}constructor(){super(),this.quick=!1,this.required=!1,this.errorText="",this.label="",this.noAsterisk=!1,this.supportingText="",this.error=!1,this.menuPositioning="popover",this.clampMenuWidth=!1,this.typeaheadDelay=200,this.hasLeadingIcon=!1,this.displayText="",this.menuAlign="start",this[Lo]="",this.lastUserSetValue=null,this.lastUserSetSelectedIndex=null,this.lastSelectedOption=null,this.lastSelectedOptionRecords=[],this.nativeError=!1,this.nativeErrorText="",this.focused=!1,this.open=!1,this.defaultFocus=fo,this.prevOpen=this.open,this.selectWidth=0,this.addEventListener("focus",this.handleFocus.bind(this)),this.addEventListener("blur",this.handleBlur.bind(this))}select(e){const t=this.options.find((t=>t.value===e));t&&this.selectItem(t)}selectIndex(e){const t=this.options[e];t&&this.selectItem(t)}reset(){for(const e of this.options)e.selected=e.hasAttribute("selected");this.updateValueAndDisplayText(),this.nativeError=!1,this.nativeErrorText=""}showPicker(){this.open=!0}[(Lo=Oo,qs)](e){null==e||e.preventDefault();const t=this.getErrorText();var i;(this.nativeError=!!e,this.nativeErrorText=this.validationMessage,t===this.getErrorText())&&(null===(i=this.field)||void 0===i||i.reannounceError())}update(e){if(this.hasUpdated||this.initUserSelection(),this.prevOpen!==this.open&&this.open){const e=this.getBoundingClientRect();this.selectWidth=e.width}this.prevOpen=this.open,super.update(e)}render(){return s` + + ${this.renderField()} ${this.renderMenu()} + + `}async firstUpdated(e){var t;await(null===(t=this.menu)||void 0===t?void 0:t.updateComplete),this.lastSelectedOptionRecords.length||this.initUserSelection(),this.lastSelectedOptionRecords.length||this.options.length||setTimeout((()=>{this.updateValueAndDisplayText()})),super.firstUpdated(e)}getRenderClasses(){return{disabled:this.disabled,error:this.error,open:this.open}}renderField(){const e=this.ariaLabel||this.label;return Q` + <${this.fieldTag} + aria-haspopup="listbox" + role="combobox" + part="field" + id="field" + tabindex=${this.disabled?"-1":"0"} + aria-label=${e||c} + aria-describedby="description" + aria-expanded=${this.open?"true":"false"} + aria-controls="listbox" + class="field" + label=${this.label} + ?no-asterisk=${this.noAsterisk} + .focused=${this.focused||this.open} + .populated=${!!this.displayText} + .disabled=${this.disabled} + .required=${this.required} + .error=${this.hasError} + ?has-start=${this.hasLeadingIcon} + has-end + supporting-text=${this.supportingText} + error-text=${this.getErrorText()} + @keydown=${this.handleKeydown} + @click=${this.handleClick}> + ${this.renderFieldContent()} +
+ `}renderFieldContent(){return[this.renderLeadingIcon(),this.renderLabel(),this.renderTrailingIcon()]}renderLeadingIcon(){return s` + + + + `}renderTrailingIcon(){return s` + + + + + + + + + `}renderLabel(){return s`
${this.displayText||s` `}
`}renderMenu(){const e=this.label||this.ariaLabel;return s``}renderMenuContent(){return s``}handleKeydown(e){if(this.open||this.disabled||!this.menu)return;const t=this.menu.typeaheadController,i="Space"===e.code||"ArrowDown"===e.code||"ArrowUp"===e.code||"End"===e.code||"Home"===e.code||"Enter"===e.code;if(!t.isTypingAhead&&i){switch(e.preventDefault(),this.open=!0,e.code){case"Space":case"ArrowDown":case"Enter":this.defaultFocus=fo;break;case"End":this.defaultFocus=go;break;case"ArrowUp":case"Home":this.defaultFocus=vo}return}if(1===e.key.length){var r,s;t.onKeydown(e),e.preventDefault();const{lastActiveRecord:i}=t;if(!i)return;null===(r=this.labelEl)||void 0===r||null===(s=r.setAttribute)||void 0===s||s.call(r,"aria-live","polite");this.selectItem(i[wo])&&this.dispatchInteractionEvents()}}handleClick(){this.open=!this.open}handleFocus(){this.focused=!0}handleBlur(){this.focused=!1}handleFocusout(e){e.relatedTarget&&uo(e.relatedTarget,this)||(this.open=!1)}getSelectedOptions(){if(!this.menu)return this.lastSelectedOptionRecords=[],null;const e=this.menu.items;return this.lastSelectedOptionRecords=function(e){const t=[];for(let i=0;ie===s)))?r=this.selectItem(i):(i.tabIndex=-1,i.blur()),r&&this.dispatchInteractionEvents()}selectItem(e){return(this.getSelectedOptions()??[]).forEach((([t])=>{e!==t&&(t.selected=!1)})),e.selected=!0,this.updateValueAndDisplayText()}handleRequestSelection(e){const t=e.target;this.lastSelectedOptionRecords.some((([e])=>e===t))||this.selectItem(t)}handleRequestDeselection(e){const t=e.target;this.lastSelectedOptionRecords.some((([e])=>e===t))&&this.updateValueAndDisplayText()}initUserSelection(){this.lastUserSetValue&&!this.lastSelectedOptionRecords.length?this.select(this.lastUserSetValue):null===this.lastUserSetSelectedIndex||this.lastSelectedOptionRecords.length?this.updateValueAndDisplayText():this.selectIndex(this.lastUserSetSelectedIndex)}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0}dispatchInteractionEvents(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0}))}getErrorText(){return this.error?this.errorText:this.nativeErrorText}[he](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(e){this.value=e}click(){var e;null===(e=this.field)||void 0===e||e.click()}[oe](){return new To((()=>this))}[ae](){return this.field}}$o.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([a({type:Boolean})],$o.prototype,"quick",void 0),t([a({type:Boolean})],$o.prototype,"required",void 0),t([a({type:String,attribute:"error-text"})],$o.prototype,"errorText",void 0),t([a()],$o.prototype,"label",void 0),t([a({type:Boolean,attribute:"no-asterisk"})],$o.prototype,"noAsterisk",void 0),t([a({type:String,attribute:"supporting-text"})],$o.prototype,"supportingText",void 0),t([a({type:Boolean,reflect:!0})],$o.prototype,"error",void 0),t([a({attribute:"menu-positioning"})],$o.prototype,"menuPositioning",void 0),t([a({type:Boolean,attribute:"clamp-menu-width"})],$o.prototype,"clampMenuWidth",void 0),t([a({type:Number,attribute:"typeahead-delay"})],$o.prototype,"typeaheadDelay",void 0),t([a({type:Boolean,attribute:"has-leading-icon"})],$o.prototype,"hasLeadingIcon",void 0),t([a({attribute:"display-text"})],$o.prototype,"displayText",void 0),t([a({attribute:"menu-align"})],$o.prototype,"menuAlign",void 0),t([a()],$o.prototype,"value",null),t([a({type:Number,attribute:"selected-index"})],$o.prototype,"selectedIndex",null),t([v()],$o.prototype,"nativeError",void 0),t([v()],$o.prototype,"nativeErrorText",void 0),t([v()],$o.prototype,"focused",void 0),t([v()],$o.prototype,"open",void 0),t([v()],$o.prototype,"defaultFocus",void 0),t([d(".field")],$o.prototype,"field",void 0),t([d("md-menu")],$o.prototype,"menu",void 0),t([d("#label")],$o.prototype,"labelEl",void 0),t([i({slot:"leading-icon",flatten:!0})],$o.prototype,"leadingIcons",void 0);class Mo extends $o{constructor(){super(...arguments),this.fieldTag=X`md-filled-field`}}const Po=o`:host{--_text-field-active-indicator-color: var(--md-filled-select-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-active-indicator-height: var(--md-filled-select-text-field-active-indicator-height, 1px);--_text-field-container-color: var(--md-filled-select-text-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_text-field-disabled-active-indicator-color: var(--md-filled-select-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-active-indicator-height: var(--md-filled-select-text-field-disabled-active-indicator-height, 1px);--_text-field-disabled-active-indicator-opacity: var(--md-filled-select-text-field-disabled-active-indicator-opacity, 0.38);--_text-field-disabled-container-color: var(--md-filled-select-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-container-opacity: var(--md-filled-select-text-field-disabled-container-opacity, 0.04);--_text-field-disabled-input-text-color: var(--md-filled-select-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-input-text-opacity: var(--md-filled-select-text-field-disabled-input-text-opacity, 0.38);--_text-field-disabled-label-text-color: var(--md-filled-select-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-label-text-opacity: var(--md-filled-select-text-field-disabled-label-text-opacity, 0.38);--_text-field-disabled-leading-icon-color: var(--md-filled-select-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-leading-icon-opacity: var(--md-filled-select-text-field-disabled-leading-icon-opacity, 0.38);--_text-field-disabled-supporting-text-color: var(--md-filled-select-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-supporting-text-opacity: var(--md-filled-select-text-field-disabled-supporting-text-opacity, 0.38);--_text-field-disabled-trailing-icon-color: var(--md-filled-select-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-trailing-icon-opacity: var(--md-filled-select-text-field-disabled-trailing-icon-opacity, 0.38);--_text-field-error-active-indicator-color: var(--md-filled-select-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-active-indicator-color: var(--md-filled-select-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-input-text-color: var(--md-filled-select-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-focus-label-text-color: var(--md-filled-select-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-leading-icon-color: var(--md-filled-select-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-focus-supporting-text-color: var(--md-filled-select-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-trailing-icon-color: var(--md-filled-select-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-active-indicator-color: var(--md-filled-select-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-input-text-color: var(--md-filled-select-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-label-text-color: var(--md-filled-select-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-leading-icon-color: var(--md-filled-select-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-hover-state-layer-color: var(--md-filled-select-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-state-layer-opacity: var(--md-filled-select-text-field-error-hover-state-layer-opacity, 0.08);--_text-field-error-hover-supporting-text-color: var(--md-filled-select-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-trailing-icon-color: var(--md-filled-select-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-input-text-color: var(--md-filled-select-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-label-text-color: var(--md-filled-select-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-leading-icon-color: var(--md-filled-select-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-supporting-text-color: var(--md-filled-select-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-trailing-icon-color: var(--md-filled-select-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-focus-active-indicator-color: var(--md-filled-select-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-active-indicator-height: var(--md-filled-select-text-field-focus-active-indicator-height, 3px);--_text-field-focus-input-text-color: var(--md-filled-select-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-focus-label-text-color: var(--md-filled-select-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-leading-icon-color: var(--md-filled-select-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-supporting-text-color: var(--md-filled-select-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-trailing-icon-color: var(--md-filled-select-text-field-focus-trailing-icon-color, var(--md-sys-color-primary, #6750a4));--_text-field-hover-active-indicator-color: var(--md-filled-select-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-active-indicator-height: var(--md-filled-select-text-field-hover-active-indicator-height, 1px);--_text-field-hover-input-text-color: var(--md-filled-select-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-label-text-color: var(--md-filled-select-text-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-leading-icon-color: var(--md-filled-select-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-state-layer-color: var(--md-filled-select-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-state-layer-opacity: var(--md-filled-select-text-field-hover-state-layer-opacity, 0.08);--_text-field-hover-supporting-text-color: var(--md-filled-select-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-trailing-icon-color: var(--md-filled-select-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-input-text-color: var(--md-filled-select-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-input-text-font: var(--md-filled-select-text-field-input-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-input-text-line-height: var(--md-filled-select-text-field-input-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_text-field-input-text-size: var(--md-filled-select-text-field-input-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_text-field-input-text-weight: var(--md-filled-select-text-field-input-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-label-text-color: var(--md-filled-select-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-label-text-font: var(--md-filled-select-text-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-label-text-line-height: var(--md-filled-select-text-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_text-field-label-text-populated-line-height: var(--md-filled-select-text-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_text-field-label-text-populated-size: var(--md-filled-select-text-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_text-field-label-text-size: var(--md-filled-select-text-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_text-field-label-text-weight: var(--md-filled-select-text-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-leading-icon-color: var(--md-filled-select-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-leading-icon-size: var(--md-filled-select-text-field-leading-icon-size, 24px);--_text-field-supporting-text-color: var(--md-filled-select-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-supporting-text-font: var(--md-filled-select-text-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-supporting-text-line-height: var(--md-filled-select-text-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_text-field-supporting-text-size: var(--md-filled-select-text-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_text-field-supporting-text-weight: var(--md-filled-select-text-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-trailing-icon-color: var(--md-filled-select-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-trailing-icon-size: var(--md-filled-select-text-field-trailing-icon-size, 24px);--_text-field-container-shape-start-start: var(--md-filled-select-text-field-container-shape-start-start, var(--md-filled-select-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_text-field-container-shape-start-end: var(--md-filled-select-text-field-container-shape-start-end, var(--md-filled-select-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_text-field-container-shape-end-end: var(--md-filled-select-text-field-container-shape-end-end, var(--md-filled-select-text-field-container-shape, var(--md-sys-shape-corner-none, 0px)));--_text-field-container-shape-end-start: var(--md-filled-select-text-field-container-shape-end-start, var(--md-filled-select-text-field-container-shape, var(--md-sys-shape-corner-none, 0px)));--md-filled-field-active-indicator-color: var(--_text-field-active-indicator-color);--md-filled-field-active-indicator-height: var(--_text-field-active-indicator-height);--md-filled-field-container-color: var(--_text-field-container-color);--md-filled-field-container-shape-end-end: var(--_text-field-container-shape-end-end);--md-filled-field-container-shape-end-start: var(--_text-field-container-shape-end-start);--md-filled-field-container-shape-start-end: var(--_text-field-container-shape-start-end);--md-filled-field-container-shape-start-start: var(--_text-field-container-shape-start-start);--md-filled-field-content-color: var(--_text-field-input-text-color);--md-filled-field-content-font: var(--_text-field-input-text-font);--md-filled-field-content-line-height: var(--_text-field-input-text-line-height);--md-filled-field-content-size: var(--_text-field-input-text-size);--md-filled-field-content-weight: var(--_text-field-input-text-weight);--md-filled-field-disabled-active-indicator-color: var(--_text-field-disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height: var(--_text-field-disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity: var(--_text-field-disabled-active-indicator-opacity);--md-filled-field-disabled-container-color: var(--_text-field-disabled-container-color);--md-filled-field-disabled-container-opacity: var(--_text-field-disabled-container-opacity);--md-filled-field-disabled-content-color: var(--_text-field-disabled-input-text-color);--md-filled-field-disabled-content-opacity: var(--_text-field-disabled-input-text-opacity);--md-filled-field-disabled-label-text-color: var(--_text-field-disabled-label-text-color);--md-filled-field-disabled-label-text-opacity: var(--_text-field-disabled-label-text-opacity);--md-filled-field-disabled-leading-content-color: var(--_text-field-disabled-leading-icon-color);--md-filled-field-disabled-leading-content-opacity: var(--_text-field-disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color: var(--_text-field-disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity: var(--_text-field-disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-content-color: var(--_text-field-disabled-trailing-icon-color);--md-filled-field-disabled-trailing-content-opacity: var(--_text-field-disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color: var(--_text-field-error-active-indicator-color);--md-filled-field-error-content-color: var(--_text-field-error-input-text-color);--md-filled-field-error-focus-active-indicator-color: var(--_text-field-error-focus-active-indicator-color);--md-filled-field-error-focus-content-color: var(--_text-field-error-focus-input-text-color);--md-filled-field-error-focus-label-text-color: var(--_text-field-error-focus-label-text-color);--md-filled-field-error-focus-leading-content-color: var(--_text-field-error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color: var(--_text-field-error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-content-color: var(--_text-field-error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color: var(--_text-field-error-hover-active-indicator-color);--md-filled-field-error-hover-content-color: var(--_text-field-error-hover-input-text-color);--md-filled-field-error-hover-label-text-color: var(--_text-field-error-hover-label-text-color);--md-filled-field-error-hover-leading-content-color: var(--_text-field-error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color: var(--_text-field-error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity: var(--_text-field-error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color: var(--_text-field-error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-content-color: var(--_text-field-error-hover-trailing-icon-color);--md-filled-field-error-label-text-color: var(--_text-field-error-label-text-color);--md-filled-field-error-leading-content-color: var(--_text-field-error-leading-icon-color);--md-filled-field-error-supporting-text-color: var(--_text-field-error-supporting-text-color);--md-filled-field-error-trailing-content-color: var(--_text-field-error-trailing-icon-color);--md-filled-field-focus-active-indicator-color: var(--_text-field-focus-active-indicator-color);--md-filled-field-focus-active-indicator-height: var(--_text-field-focus-active-indicator-height);--md-filled-field-focus-content-color: var(--_text-field-focus-input-text-color);--md-filled-field-focus-label-text-color: var(--_text-field-focus-label-text-color);--md-filled-field-focus-leading-content-color: var(--_text-field-focus-leading-icon-color);--md-filled-field-focus-supporting-text-color: var(--_text-field-focus-supporting-text-color);--md-filled-field-focus-trailing-content-color: var(--_text-field-focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color: var(--_text-field-hover-active-indicator-color);--md-filled-field-hover-active-indicator-height: var(--_text-field-hover-active-indicator-height);--md-filled-field-hover-content-color: var(--_text-field-hover-input-text-color);--md-filled-field-hover-label-text-color: var(--_text-field-hover-label-text-color);--md-filled-field-hover-leading-content-color: var(--_text-field-hover-leading-icon-color);--md-filled-field-hover-state-layer-color: var(--_text-field-hover-state-layer-color);--md-filled-field-hover-state-layer-opacity: var(--_text-field-hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color: var(--_text-field-hover-supporting-text-color);--md-filled-field-hover-trailing-content-color: var(--_text-field-hover-trailing-icon-color);--md-filled-field-label-text-color: var(--_text-field-label-text-color);--md-filled-field-label-text-font: var(--_text-field-label-text-font);--md-filled-field-label-text-line-height: var(--_text-field-label-text-line-height);--md-filled-field-label-text-populated-line-height: var(--_text-field-label-text-populated-line-height);--md-filled-field-label-text-populated-size: var(--_text-field-label-text-populated-size);--md-filled-field-label-text-size: var(--_text-field-label-text-size);--md-filled-field-label-text-weight: var(--_text-field-label-text-weight);--md-filled-field-leading-content-color: var(--_text-field-leading-icon-color);--md-filled-field-supporting-text-color: var(--_text-field-supporting-text-color);--md-filled-field-supporting-text-font: var(--_text-field-supporting-text-font);--md-filled-field-supporting-text-line-height: var(--_text-field-supporting-text-line-height);--md-filled-field-supporting-text-size: var(--_text-field-supporting-text-size);--md-filled-field-supporting-text-weight: var(--_text-field-supporting-text-weight);--md-filled-field-trailing-content-color: var(--_text-field-trailing-icon-color)}[has-start] .icon.leading{font-size:var(--_text-field-leading-icon-size);height:var(--_text-field-leading-icon-size);width:var(--_text-field-leading-icon-size)}.icon.trailing{font-size:var(--_text-field-trailing-icon-size);height:var(--_text-field-trailing-icon-size);width:var(--_text-field-trailing-icon-size)} +`,Fo=o`:host{color:unset;min-width:210px;display:flex}.field{cursor:default;outline:none}.select{position:relative;flex-direction:column}.icon.trailing svg,.icon ::slotted(*){fill:currentColor}.icon ::slotted(*){width:inherit;height:inherit;font-size:inherit}.icon slot{display:flex;height:100%;width:100%;align-items:center;justify-content:center}.icon.trailing :is(.up,.down){opacity:0;transition:opacity 75ms linear 75ms}.select:not(.open) .down,.select.open .up{opacity:1}.field,.select,md-menu{min-width:inherit;width:inherit;max-width:inherit;display:flex}md-menu{min-width:var(--__menu-min-width);max-width:var(--__menu-max-width, inherit)}.menu-wrapper{width:0px;height:0px;max-width:inherit}md-menu ::slotted(:not[disabled]){cursor:pointer}.field,.select{width:100%}:host{display:inline-flex}:host([disabled]){pointer-events:none} +`;class zo extends Mo{}zo.styles=[Fo,Po],customElements.define("ew-filled-select",zo);const Bo=o`:host{display:flex;--md-ripple-hover-color: var(--md-menu-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-menu-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-menu-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-menu-item-pressed-state-layer-opacity, 0.12)}:host([disabled]){opacity:var(--md-menu-item-disabled-opacity, 0.3);pointer-events:none}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.list-item:not(.disabled){cursor:pointer}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;color:var(--md-menu-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-menu-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-menu-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-menu-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-menu-item-one-line-container-height, 56px);padding-top:var(--md-menu-item-top-space, 12px);padding-bottom:var(--md-menu-item-bottom-space, 12px);padding-inline-start:var(--md-menu-item-leading-space, 16px);padding-inline-end:var(--md-menu-item-trailing-space, 16px)}md-item[multiline]{min-height:var(--md-menu-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-menu-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-menu-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-menu-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-menu-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-menu-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-menu-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-menu-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-menu-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}.list-item{background-color:var(--md-menu-item-container-color, transparent)}.list-item.selected{background-color:var(--md-menu-item-selected-container-color, var(--md-sys-color-secondary-container, #e8def8))}.selected:not(.disabled) ::slotted(*){color:var(--md-menu-item-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b))}@media(forced-colors: active){:host([disabled]),:host([disabled]) slot{color:GrayText;opacity:1}.list-item{position:relative}.list-item.selected::before{content:"";position:absolute;inset:0;box-sizing:border-box;border-radius:inherit;pointer-events:none;border:3px double CanvasText}} +`;class Uo{constructor(e,t){this.host=e,this.internalTypeaheadText=null,this.onClick=()=>{this.host.keepOpen||this.host.dispatchEvent(ao(this.host,{kind:lo}))},this.onKeydown=e=>{if(this.host.href&&"Enter"===e.code){const e=this.getInteractiveElement();e instanceof HTMLAnchorElement&&e.click()}if(e.defaultPrevented)return;const t=e.code;this.host.keepOpen&&"Escape"!==t||po(t)&&(e.preventDefault(),this.host.dispatchEvent(ao(this.host,{kind:co,key:t})))},this.getHeadlineElements=t.getHeadlineElements,this.getSupportingTextElements=t.getSupportingTextElements,this.getDefaultElements=t.getDefaultElements,this.getInteractiveElement=t.getInteractiveElement,this.host.addController(this)}get typeaheadText(){if(null!==this.internalTypeaheadText)return this.internalTypeaheadText;const e=this.getHeadlineElements(),t=[];return e.forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),0===t.length&&this.getDefaultElements().forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),0===t.length&&this.getSupportingTextElements().forEach((e=>{e.textContent&&e.textContent.trim()&&t.push(e.textContent.trim())})),t.join(" ")}get tagName(){switch(this.host.type){case"link":return"a";case"button":return"button";default:return"li"}}get role(){return"option"===this.host.type?"option":"menuitem"}hostConnected(){this.host.toggleAttribute("md-menu-item",!0)}hostUpdate(){this.host.href&&(this.host.type="link")}setTypeaheadText(e){this.internalTypeaheadText=e}}class No{get role(){return this.menuItemController.role}get typeaheadText(){return this.menuItemController.typeaheadText}setTypeaheadText(e){this.menuItemController.setTypeaheadText(e)}get displayText(){return null!==this.internalDisplayText?this.internalDisplayText:this.menuItemController.typeaheadText}setDisplayText(e){this.internalDisplayText=e}constructor(e,t){this.host=e,this.internalDisplayText=null,this.firstUpdate=!0,this.onClick=()=>{this.menuItemController.onClick()},this.onKeydown=e=>{this.menuItemController.onKeydown(e)},this.lastSelected=this.host.selected,this.menuItemController=new Uo(e,t),e.addController(this)}hostUpdate(){this.lastSelected!==this.host.selected&&(this.host.ariaSelected=this.host.selected?"true":"false")}hostUpdated(){this.lastSelected===this.host.selected||this.firstUpdate||(this.host.selected?this.host.dispatchEvent(new Event("request-selection",{bubbles:!0,composed:!0})):this.host.dispatchEvent(new Event("request-deselection",{bubbles:!0,composed:!0}))),this.lastSelected=this.host.selected,this.firstUpdate=!1}}const Ho=l(r);class qo extends Ho{constructor(){super(...arguments),this.disabled=!1,this.isMenuItem=!0,this.selected=!1,this.value="",this.type="option",this.selectOptionController=new No(this,{getHeadlineElements:()=>this.headlineElements,getSupportingTextElements:()=>this.supportingTextElements,getDefaultElements:()=>this.defaultElements,getInteractiveElement:()=>this.listItemRoot})}get typeaheadText(){return this.selectOptionController.typeaheadText}set typeaheadText(e){this.selectOptionController.setTypeaheadText(e)}get displayText(){return this.selectOptionController.displayText}set displayText(e){this.selectOptionController.setDisplayText(e)}render(){return this.renderListItem(s` + +
+ ${this.renderRipple()} ${this.renderFocusRing()} +
+ + + ${this.renderBody()} +
+ `)}renderListItem(e){return s` +
  • ${e}
  • + `}renderRipple(){return s` `}renderFocusRing(){return s` `}getRenderClasses(){return{disabled:this.disabled,selected:this.selected}}renderBody(){return s` + + + + + + `}focus(){var e;null===(e=this.listItemRoot)||void 0===e||e.focus()}}qo.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},t([a({type:Boolean,reflect:!0})],qo.prototype,"disabled",void 0),t([a({type:Boolean,attribute:"md-menu-item",reflect:!0})],qo.prototype,"isMenuItem",void 0),t([a({type:Boolean})],qo.prototype,"selected",void 0),t([a()],qo.prototype,"value",void 0),t([d(".list-item")],qo.prototype,"listItemRoot",void 0),t([i({slot:"headline"})],qo.prototype,"headlineElements",void 0),t([i({slot:"supporting-text"})],qo.prototype,"supportingTextElements",void 0),t([function(t){return(i,r)=>{const{slot:s}=t??{},o="slot"+(s?`[name=${s}]`:":not([name])");return e(i,r,{get(){var e;const i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(o);return(null==i?void 0:i.assignedNodes(t))??[]}})}}({slot:""})],qo.prototype,"defaultElements",void 0),t([a({attribute:"typeahead-text"})],qo.prototype,"typeaheadText",null),t([a({attribute:"display-text"})],qo.prototype,"displayText",null);class Go extends qo{}Go.styles=[Bo],customElements.define("ew-select-option",Go);const Wo=l(r);class Zo extends Wo{constructor(){super(...arguments),this.value=0,this.max=1,this.indeterminate=!1,this.fourColor=!1}render(){const{ariaLabel:e}=this;return s` +
    ${this.renderIndicator()}
    + `}getRenderClasses(){return{indeterminate:this.indeterminate,"four-color":this.fourColor}}}t([a({type:Number})],Zo.prototype,"value",void 0),t([a({type:Number})],Zo.prototype,"max",void 0),t([a({type:Boolean})],Zo.prototype,"indeterminate",void 0),t([a({type:Boolean,attribute:"four-color"})],Zo.prototype,"fourColor",void 0);class Vo extends Zo{renderIndicator(){return this.indeterminate?this.renderIndeterminateContainer():this.renderDeterminateContainer()}renderDeterminateContainer(){const e=100*(1-this.value/this.max);return s` + + + + + `}renderIndeterminateContainer(){return s`
    +
    +
    +
    +
    +
    +
    +
    `}}const jo=o`:host{--_active-indicator-color: var(--md-circular-progress-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-width: var(--md-circular-progress-active-indicator-width, 10);--_four-color-active-indicator-four-color: var(--md-circular-progress-four-color-active-indicator-four-color, var(--md-sys-color-tertiary-container, #ffd8e4));--_four-color-active-indicator-one-color: var(--md-circular-progress-four-color-active-indicator-one-color, var(--md-sys-color-primary, #6750a4));--_four-color-active-indicator-three-color: var(--md-circular-progress-four-color-active-indicator-three-color, var(--md-sys-color-tertiary, #7d5260));--_four-color-active-indicator-two-color: var(--md-circular-progress-four-color-active-indicator-two-color, var(--md-sys-color-primary-container, #eaddff));--_size: var(--md-circular-progress-size, 48px);display:inline-flex;vertical-align:middle;width:var(--_size);height:var(--_size);position:relative;align-items:center;justify-content:center;contain:strict;content-visibility:auto}.progress{flex:1;align-self:stretch;margin:4px}.progress,.spinner,.left,.right,.circle,svg,.track,.active-track{position:absolute;inset:0}svg{transform:rotate(-90deg)}circle{cx:50%;cy:50%;r:calc(50%*(1 - var(--_active-indicator-width)/100));stroke-width:calc(var(--_active-indicator-width)*1%);stroke-dasharray:100;fill:rgba(0,0,0,0)}.active-track{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1);stroke:var(--_active-indicator-color)}.track{stroke:rgba(0,0,0,0)}.progress.indeterminate{animation:linear infinite linear-rotate;animation-duration:1568.2352941176ms}.spinner{animation:infinite both rotate-arc;animation-duration:5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.left{overflow:hidden;inset:0 50% 0 0}.right{overflow:hidden;inset:0 0 0 50%}.circle{box-sizing:border-box;border-radius:50%;border:solid calc(var(--_active-indicator-width)/100*(var(--_size) - 8px));border-color:var(--_active-indicator-color) var(--_active-indicator-color) rgba(0,0,0,0) rgba(0,0,0,0);animation:expand-arc;animation-iteration-count:infinite;animation-fill-mode:both;animation-duration:1333ms,5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.four-color .circle{animation-name:expand-arc,four-color}.left .circle{rotate:135deg;inset:0 -100% 0 0}.right .circle{rotate:100deg;inset:0 0 0 -100%;animation-delay:-666.5ms,0ms}@media(forced-colors: active){.active-track{stroke:CanvasText}.circle{border-color:CanvasText CanvasText Canvas Canvas}}@keyframes expand-arc{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}100%{transform:rotate(265deg)}}@keyframes rotate-arc{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 linear-rotate{to{transform:rotate(360deg)}}@keyframes four-color{0%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}15%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}25%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}40%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}50%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}65%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}75%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}90%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}100%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}} +`;class Ko extends Vo{}Ko.styles=[jo],customElements.define("ew-circular-progress",Ko);class Yo extends r{render(){return s` +
    + + ${void 0!==this.progress?s`
    ${this.progress}%
    `:""} +
    + ${this.label} + `}}Yo.styles=o` + :host { + display: flex; + flex-direction: column; + text-align: center; + } + ew-circular-progress { + margin-bottom: 16px; + } + `,t([a()],Yo.prototype,"label",void 0),t([a()],Yo.prototype,"progress",void 0),customElements.define("ewt-page-progress",Yo);class Xo extends r{render(){return s` +
    ${this.icon}
    + ${this.label} + `}}Xo.styles=o` + :host { + display: flex; + flex-direction: column; + text-align: center; + } + .icon { + font-size: 50px; + line-height: 80px; + color: black; + } + `,t([a()],Xo.prototype,"icon",void 0),t([a()],Xo.prototype,"label",void 0),customElements.define("ewt-page-message",Xo);const Jo=I` + + + +`,Qo=I` + + + +`,ea=I` + + + +`,ta=I` + + + +`,ia=I` + + + +`,ra=I` + + + +`,sa=I` + + + +`,oa=I` + + + +`,aa=I` + + + +`,na=I` + + + +`,la=I` + + + +`,da=I` + + + +`,ca=I` + + + +`,ha=I` + + + +`,pa=["I".charCodeAt(0),"M".charCodeAt(0),"P".charCodeAt(0),"R".charCodeAt(0),"O".charCodeAt(0),"V".charCodeAt(0),1];var ua,fa;!function(e){e[e.CURRENT_STATE=1]="CURRENT_STATE",e[e.ERROR_STATE=2]="ERROR_STATE",e[e.RPC=3]="RPC",e[e.RPC_RESULT=4]="RPC_RESULT"}(ua||(ua={})),function(e){e[e.STOPPED=0]="STOPPED",e[e.READY=2]="READY",e[e.PROVISIONING=3]="PROVISIONING",e[e.PROVISIONED=4]="PROVISIONED"}(fa||(fa={}));const ma={0:"NO_ERROR",1:"INVALID_RPC_PACKET",2:"UNKNOWN_RPC_COMMAND",3:"UNABLE_TO_CONNECT",5:"BAD_HOSTNAME",254:"TIMEOUT",255:"UNKNOWN_ERROR"};class va extends Error{constructor(){super("Port is not ready")}}const ga=e=>"["+e.map((e=>((e,t=2)=>{let i=e.toString(16).toUpperCase();return i.startsWith("-")?"-0x"+i.substring(1).padStart(t,"0"):"0x"+i.padStart(t,"0")})(e))).join(", ")+"]",_a=e=>e.sort(((e,t)=>e.name.toLocaleLowerCase().localeCompare(t.name.toLocaleLowerCase()))),ba=(e,t)=>{const i=new Map;for(const t of e)i.set(t.name,t);for(const e of t)i.set(e.name,e);return _a(Array.from(i.values()))},ya=(e,t)=>e.length!==t.length||e.some(((e,i)=>e.name!==t[i].name||e.rssi!==t[i].rssi||e.secured!==t[i].secured));class xa extends EventTarget{get error(){return this._error}set error(e){this._error=e,this.dispatchEvent(new CustomEvent("error-changed",{detail:this._error}))}constructor(e,t){if(super(),this.port=e,this.logger=t,this._error=0,this._rpcLock=Promise.resolve(),null===e.readable)throw new Error("Port is not readable");if(null===e.writable)throw new Error("Port is not writable")}async initialize(e=1e3){if(this.logger.log("Initializing Improv Serial"),this._processInput(),void 0===this._reader)throw new va;let t;try{await new Promise((async(i,r)=>{setTimeout((()=>r(new Error("Improv Wi-Fi Serial not detected"))),e),t=setInterval((()=>this._sendRPC(2,[])),1e3),await this.requestCurrentState(),i(void 0)})),clearInterval(t),await this.requestInfo()}catch(e){throw await this.close(),e}finally{clearInterval(t)}return this.info}async close(){this._reader&&await new Promise((e=>{this._reader.cancel(),this.addEventListener("disconnect",e,{once:!0})}))}async requestCurrentState(){var e;const t=new AbortController;let i;try{await new Promise(((e,r)=>{this.addEventListener("state-changed",(()=>e()),{once:!0,signal:t.signal}),i=this._sendRPCWithResponse(2,[]),i.catch(r)}))}catch(e){throw new Error(`Error fetching current state: ${e}`)}finally{t.abort()}this.state===fa.PROVISIONED?this.nextUrl=(await i)[0]:null===(e=this._rpcFeedback)||void 0===e||e.resolve([])}async requestInfo(e){const t=await this._sendRPCWithResponse(3,[],e);this.info={firmware:t[0],version:t[1],name:t[3],chipFamily:t[2],osName:t.length>4?t[4]:null,osVersion:t.length>5?t[5]:null}}async provision(e,t,i){const r=new TextEncoder,s=r.encode(e),o=r.encode(t),a=[s.length,...s,o.length,...o],n=await this._sendRPCWithResponse(1,a,i);this.nextUrl=n[0]}async scan(e){const t=(await this._sendRPCWithMultipleResponses(4,[],e)).map((([e,t,i])=>({name:e,rssi:parseInt(t),secured:"NO"!==i})));return _a(t)}subscribeSSIDs(e){let t,i,r=!0;const s=(async()=>{for(;r;){let s;try{s=await this.scan(3e4)}catch(i){this.logger.error("Error while scanning for Wi-Fi networks",i),r&&void 0===t&&e(null);break}if(!r)break;const o=void 0===t?s:ba(t,s);(void 0===t||ya(t,o))&&(t=o,e(o)),await new Promise((e=>{i=e,setTimeout(e,3e3)}))}})();return()=>(r=!1,null==i||i(),s)}async getHostname(e){return(await this._sendRPCWithResponse(5,[],e))[0]}async setHostname(e,t){const i=new TextEncoder;return(await this._sendRPCWithResponse(5,[...i.encode(e)],t))[0]}async getDeviceName(e){return(await this._sendRPCWithResponse(6,[],e))[0]}async setDeviceName(e,t){const i=new TextEncoder,r=await this._sendRPCWithResponse(6,[...i.encode(e)],t);return this.info&&(this.info.name=r[0]),r[0]}async requestNetworkState(e){const t=await this._sendRPCWithResponse(7,[],e),i=parseInt(t[0]);return{online:0!=(1&i),supportsWifi:0!=(2&i),supportsEthernet:0!=(4&i),supportsThread:0!=(8&i),supportsModem:0!=(16&i),urls:t.slice(1)}}_sendRPC(e,t){this.writePacketToStream(ua.RPC,[e,t.length,...t])}_enqueueRPC(e,t){const i=()=>this._awaitRPCResultWithTimeout(e(),t).finally((()=>{this._rpcFeedback=void 0})),r=this._rpcLock.then(i,i);return this._rpcLock=r.catch((()=>{})),r}_sendRPCWithResponse(e,t,i=3e4){return this._enqueueRPC((()=>new Promise(((i,r)=>{this._rpcFeedback={command:e,resolve:i,reject:r},this._sendRPC(e,t)}))),i)}_sendRPCWithMultipleResponses(e,t,i=3e4){return this._enqueueRPC((()=>new Promise(((i,r)=>{this._rpcFeedback={command:e,resolve:i,reject:r,receivedData:[]},this._sendRPC(e,t)}))),i)}async _awaitRPCResultWithTimeout(e,t){if(!t)return await e;const i=setTimeout((()=>this._setError(254)),t);try{return await e}finally{clearTimeout(i)}}async _processInput(){this.logger.debug("Starting read loop"),this._reader=this.port.readable.getReader();try{let e,t=[],i=0;for(;;){const{value:r,done:s}=await this._reader.read();if(s)break;if(r&&0!==r.length)for(const s of r){if(!1===e){10===s&&(e=void 0);continue}if(!0===e){t.push(s),t.length===i&&(this._handleIncomingPacket(t),e=void 0,t=[]);continue}if(10===s){t=[];continue}if(t.push(s),9!==t.length)continue;if(e="IMPROV"===String.fromCharCode(...t.slice(0,6)),!e){t=[];continue}i=9+t[8]+1}}}catch(e){this.logger.error("Error while reading serial port",e)}finally{this._reader.releaseLock(),this._reader=void 0}this.logger.debug("Finished read loop"),this.dispatchEvent(new Event("disconnect"))}_handleIncomingPacket(e){const t=e.slice(6),i=t[0],r=t[1],s=t[2],o=t.slice(3,3+s);if(this.logger.debug("PROCESS",{version:i,packetType:r,packetLength:s,data:ga(o)}),1!==i)return void this.logger.error("Received unsupported version",i);let a=t[3+s],n=0;for(let t=0;t0?this._rpcFeedback.receivedData.push(t):this._rpcFeedback.resolve(this._rpcFeedback.receivedData):this._rpcFeedback.resolve(t)}else this.logger.error("Unable to handle packet",t);else this.logger.error(`Received invalid checksum ${a}. Expected ${n}`)}async writePacketToStream(e,t){const i=new Uint8Array([...pa,e,t.length,...t,0,0]);i[i.length-2]=255&i.reduce(((e,t)=>e+t),0),i[i.length-1]=10,this.logger.debug("Writing to stream:",ga(new Array(...i)));const r=this.port.writable.getWriter();await r.write(i);try{r.releaseLock()}catch(e){console.error("Ignoring release lock error",e)}}_setError(e){e>0&&this._rpcFeedback&&this._rpcFeedback.reject(ma[e]||`UNKNOWN_ERROR (${e})`),this.error=e}}const wa=async(e,t)=>{await e.setRTS(!0),await xe(100),await t.after()},Ea=(e,t="")=>{const i=new Blob([e],{type:"text/plain"}),r=URL.createObjectURL(i);((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)})(r,t),setTimeout((()=>URL.revokeObjectURL(r)),0)};console.log("ESP Web Tools 10.4.0 by Open Home Foundation; https://esphome.github.io/esp-web-tools/");const Sa="⚠️";class ka extends r{constructor(){super(...arguments),this.logger=console,this._state="DASHBOARD",this._installErase=!1,this._installConfirmed=!1,this._provisionForce=!1,this._wasProvisioned=!1,this._busy=!1,this._selectedSsid=null,this._manualSsid="",this._bodyOverflow=null,this._handleDisconnect=()=>{this._state="ERROR",this._error="Disconnected"}}render(){if(!this.port)return s``;let e,t,i=!1;return void 0===this._client&&"INSTALL"!==this._state&&"LOGS"!==this._state?this._error?[e,t]=this._renderError(this._error):t=this._renderProgress("Connecting"):"INSTALL"===this._state?[e,t,i]=this._renderInstall():"ASK_ERASE"===this._state?[e,t]=this._renderAskErase():"ERROR"===this._state?[e,t]=this._renderError(this._error):"DASHBOARD"===this._state?[e,t,i]=this._client?this._renderDashboard():this._renderDashboardNoImprov():"PROVISION"===this._state?[e,t]=this._renderProvision():"LOGS"===this._state&&([e,t]=this._renderLogs()),s` + + ${e?s`
    ${e}
    `:""} + ${i?s` + + ${Jo} + + `:""} + ${t} +
    + `}_renderProgress(e,t){return s` + + `}_renderError(e){return["Error",s` + +
    + Close +
    + `]}_renderDashboard(){const e=this._manifest.name;let t;return t=s` +
    + + +
    Connected to ${this._info.name}
    +
    + ${this._info.firmware} ${this._info.version} + (${this._info.chipFamily}) +
    +
    + ${this._isSameVersion?"":s` + {this._isSameFirmware?this._startInstall(!1):this._manifest.new_install_prompt_erase?this._state="ASK_ERASE":this._startInstall(!0)}} + > + ${oa} +
    + ${this._isSameFirmware?`Update ${this._manifest.name}`:`Install ${this._manifest.name}`} +
    +
    + `} + ${void 0===this._client.nextUrl?"":s` + + ${la} +
    Visit Device
    +
    + `} + ${this._manifest.home_assistant_domain&&this._client.state===fa.PROVISIONED?s` + + ${da} +
    Add to Home Assistant
    +
    + `:""} + {this._state="PROVISION",this._client.state===fa.PROVISIONED&&(this._provisionForce=!0)}} + > + ${aa} +
    + ${this._client.state===fa.PROVISIONED?"Change Wi-Fi":"Connect to Wi-Fi"} +
    +
    + {const e=this._client;e&&(await this._closeClientWithoutEvents(e),await xe(100)),this._client=void 0,this._state="LOGS"}} + > + ${na} +
    Logs & Console
    +
    + ${this._isSameFirmware&&this._manifest.funding_url?s` + + ${ha} +
    Fund Development
    +
    + `:""} + ${this._isSameVersion?s` + this._startInstall(!0)} + > + ${ca} +
    Erase User Data
    +
    + `:""} +
    +
    + `,[e,t,!0]}_renderDashboardNoImprov(){const e=this._manifest.name;let t;return t=s` +
    + + {this._manifest.new_install_prompt_erase?this._state="ASK_ERASE":this._startInstall(!0)}} + > + ${oa} +
    ${`Install ${this._manifest.name}`}
    +
    + {this._client=void 0,this._state="LOGS"}} + > + ${na} +
    Logs & Console
    +
    +
    +
    + `,[e,t,!0]}_renderProvision(){var e;let t,i="Configure Wi-Fi";if(this._busy)return[i,this._renderProgress("Trying to connect")];if(this._client.state===fa.STOPPED)i=void 0,t=s` +
    + Enable the device's Wi-Fi, then try + again.`} + > +
    +
    + {this._state="DASHBOARD"}} + > + Back + +
    + `;else if(this._provisionForce||this._client.state!==fa.PROVISIONED)if(void 0===this._ssids)t=this._renderProgress("Scanning for networks");else{let i;switch(this._client.error){case 3:i="Unable to connect";break;case 254:i="Timeout";break;case 0:case 2:break;default:i=`Unknown error (${this._client.error})`}const r=null===(e=this._ssids)||void 0===e?void 0:e.find((e=>e.name===this._selectedSsid));t=s` +
    +
    Connect your device to the network to start using it.
    + ${i?s`

    ${i}

    `:""} + ${null!==this._ssids?s` + {const t=e.target.selectedIndex;this._selectedSsid=t===this._ssids.length?null:this._ssids[t].name,this._manualSsid=""}} + > + ${this._ssids.map((e=>{const t=(i=e.rssi)>=-50?{icon:Qo,class:"signal-excellent"}:i>=-60?{icon:ea,class:"signal-good"}:i>=-70?{icon:ta,class:"signal-fair"}:{icon:ia,class:"signal-weak"};var i;return s` + + + ${t.icon} + + ${e.name} + + ${e.rssi}dB + + ${e.secured?ra:sa} + + + + `}))} + + + Join other… + + + `:""} + ${r?"":s` + + `} + ${!r||r.secured?s` + {"Enter"===e.key&&this._doProvision()}} + > + `:""} +
    +
    + {this._state="DASHBOARD"}} + > + ${this._installState&&this._installErase?"Skip":"Back"} + + Connect +
    + `}else{i=void 0;const e=!this._wasProvisioned&&(void 0!==this._client.nextUrl||"home_assistant_domain"in this._manifest);t=s` +
    + + ${e?s` + + ${void 0===this._client.nextUrl?"":s` + {this._state="DASHBOARD"}} + > + ${la} +
    Visit Device
    +
    + `} + ${this._manifest.home_assistant_domain?s` + {this._state="DASHBOARD"}} + > + ${da} +
    Add to Home Assistant
    +
    + `:""} + {this._state="DASHBOARD"}} + > +
    +
    Skip
    +
    +
    + `:""} +
    + + ${e?"":s` +
    + {this._state="DASHBOARD"}} + > + Continue + +
    + `} + `}return[i,t]}_renderAskErase(){return["Erase device",s` +
    +
    + Do you want to erase the device before installing + ${this._manifest.name}? All data on the device will be lost. +
    + +
    +
    + {this._state="DASHBOARD"}} + > + Back + + {const e=this.shadowRoot.querySelector("ew-checkbox");this._startInstall(e.checked)}} + > + Next + +
    + `]}_renderInstall(){let e,t;const i=!this._installErase&&this._isSameFirmware;if(!this._installConfirmed&&this._isSameVersion)e="Erase User Data",t=s` +
    + Do you want to reset your device and erase all user data from your + device? +
    +
    + + Erase User Data + +
    + `;else if(this._installConfirmed)if(this._installState&&"initializing"!==this._installState.state&&"preparing"!==this._installState.state)if("erasing"===this._installState.state)e="Installing",t=this._renderProgress("Erasing");else if("writing"===this._installState.state||"finished"===this._installState.state&&void 0===this._client){let i,r;e="Installing","finished"===this._installState.state?r="Wrapping up":this._installState.details.percentage<4?r="Installing":i=this._installState.details.percentage,t=this._renderProgress(s` + ${r?s`${r}
    `:""} +
    + This will take + ${"ESP8266"===this._installState.chipFamily?"a minute":"2 minutes"}.
    + Keep this page visible to prevent slow down + `,i)}else if("finished"===this._installState.state){e=void 0;const i=null!==this._client;t=s` + + +
    + {this._state=i&&this._installErase?"PROVISION":"DASHBOARD"}} + > + Next + +
    + `}else"error"===this._installState.state&&(e="Installation failed",t=s` + +
    + {this._initialize(),this._state="DASHBOARD"}} + > + Back + +
    + `);else e="Installing",t=this._renderProgress("Preparing installation");else{e="Confirm Installation";const r=i?"update to":"install";t=s` +
    + ${i?s`Your device is running + ${this._info.firmware} ${this._info.version}.

    `:""} + Do you want to ${r} + ${this._manifest.name} ${this._manifest.version}? + ${this._installErase?s`

    All data on the device will be erased.`:""} +
    +
    + {this._state="DASHBOARD"}} + > + Back + + + Install + +
    + `}return[e,t,!1]}_renderLogs(){let e;return e=s` +
    + +
    +
    + {await this.shadowRoot.querySelector("ewt-console").reset()}} + > + Reset Device + + {Ea(this.shadowRoot.querySelector("ewt-console").logs(),"esp-web-tools-logs.txt"),this.shadowRoot.querySelector("ewt-console").reset()}} + > + Download Logs + + {await this.shadowRoot.querySelector("ewt-console").disconnect(),this._state="DASHBOARD",this._initialize()}} + > + Back + +
    + `,["Logs",e]}willUpdate(e){e.has("_state")&&("ERROR"!==this._state&&(this._error=void 0),"PROVISION"===this._state?this._ssids=void 0:this._provisionForce=!1,"INSTALL"===this._state&&(this._installConfirmed=!1,this._installState=void 0))}get _showsProvisionForm(){var e;const t=null===(e=this._client)||void 0===e?void 0:e.state;return void 0!==t&&t!==fa.STOPPED&&(this._provisionForce||t!==fa.PROVISIONED)}_syncScanning(){const e="PROVISION"===this._state&&!this._busy&&this._showsProvisionForm;e!==!!this._unsubSSIDs&&(e?(this._scanGraceTimeout=setTimeout((()=>{this._scanGraceTimeout=void 0,void 0===this._ssids&&(this._ssids=[],this._selectedSsid=null)}),9100),this._unsubSSIDs=this._client.subscribeSSIDs((e=>{void 0===this._ssids&&0===(null==e?void 0:e.length)&&this._scanGraceTimeout||null===e&&this._ssids||(void 0===this._ssids?this._selectedSsid=null===e?null:(e=>e.length?e.reduce(((e,t)=>t.rssi>e.rssi?t:e)).name:null)(e):null===this._selectedSsid||(null==e?void 0:e.some((e=>e.name===this._selectedSsid)))||(this._manualSsid=this._selectedSsid,this._selectedSsid=null),this._ssids=e)}))):this._stopScanning())}async _stopScanning(){clearTimeout(this._scanGraceTimeout),this._scanGraceTimeout=void 0;const e=this._unsubSSIDs;e&&(this._unsubSSIDs=void 0,await e())}firstUpdated(e){super.firstUpdated(e),this._bodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this._initialize()}updated(e){super.updated(e),e.has("_state")&&this.setAttribute("state",this._state),this._syncScanning(),"PROVISION"===this._state&&(e.has("_selectedSsid")&&null===this._selectedSsid?this._focusFormElement("ew-filled-text-field[name=ssid]"):e.has("_ssids")&&void 0===e.get("_ssids")&&this._focusFormElement())}_focusFormElement(e="ew-filled-text-field, ew-filled-select"){const t=this.shadowRoot.querySelector(e);t&&t.updateComplete.then((()=>setTimeout((()=>t.focus()),100)))}async _initialize(e=!1){if(null===this.port.readable||null===this.port.writable)return this._state="ERROR",void(this._error="Serial port is not readable/writable. Close any other application using it and try again.");try{this._manifest=await(async e=>{const t=new URL(e,location.toString()).toString(),i=await fetch(t),r=await i.json();return"new_install_skip_erase"in r&&(console.warn('Manifest option "new_install_skip_erase" is deprecated. Use "new_install_prompt_erase" instead.'),r.new_install_skip_erase&&(r.new_install_prompt_erase=!0)),r})(this.manifestPath)}catch(e){return this._state="ERROR",void(this._error="Failed to download manifest")}if(0===this._manifest.new_install_improv_wait_time)return void(this._client=null);const t=new xa(this.port,this.logger);t.addEventListener("state-changed",(()=>{this.requestUpdate()})),t.addEventListener("error-changed",(()=>this.requestUpdate()));try{const i=e?void 0!==this._manifest.new_install_improv_wait_time?1e3*this._manifest.new_install_improv_wait_time:1e4:1500;this._info=await t.initialize(i),this._client=t,t.addEventListener("disconnect",this._handleDisconnect)}catch(e){this._info=void 0,e instanceof va?(this._state="ERROR",this._error="Serial port is not ready. Close any other application using it and try again."):(this._client=null,this.logger.error("Improv initialization failed.",e))}}_startInstall(e){this._state="INSTALL",this._installErase=e,this._installConfirmed=!1}async _confirmInstall(){this._installConfirmed=!0,this._installState=void 0,this._client&&await this._closeClientWithoutEvents(this._client),this._client=void 0,await this.port.close(),(async(e,t,i,r,s)=>{let o,a;const n=t=>e({...t,manifest:r,build:o,chipFamily:a}),l=new qr(t),d=t.getInfo(),c=d&&12346===d.usbVendorId&&void 0!==d.usbProductId&&[4097,4098,4099,2,3].includes(d.usbProductId),h=new Es({transport:l,baudrate:115200,enableTracing:!1});window.esploader=h,n({state:"initializing",message:"Initializing...",details:{done:!1}});try{await h.main(),await h.flashId()}catch(e){return console.error(e),n({state:"error",message:"Failed to initialize. Try resetting your device or holding the BOOT button while clicking INSTALL.",details:{error:"failed_initialize",details:e}}),await wa(l,h),void await l.disconnect()}a=h.chip.CHIP_NAME,n({state:"initializing",message:`Initialized. Found ${a}`,details:{done:!0}});const p=c?"cdc":"uart";if(o=r.builds.find((e=>e.chipFamily===a&&e.serialType===p))||r.builds.find((e=>e.chipFamily===a&&void 0===e.serialType)),!o)return n({state:"error",message:`Your ${a} board is not supported.`,details:{error:"not_supported",details:a}}),await wa(l,h),void await l.disconnect();n({state:"preparing",message:"Preparing installation...",details:{done:!1}});const u=i.startsWith("blob:")||i.startsWith("data:")?location.toString():new URL(i,location.toString()).toString(),f=o.parts.map((async e=>{const t=new URL(e.path,u).toString(),i=await fetch(t);if(!i.ok)throw new Error(`Downloading firmware ${e.path} failed: ${i.status}`);const r=new FileReader,s=await i.blob();return new Promise((e=>{r.addEventListener("load",(()=>e(r.result))),r.readAsArrayBuffer(s)}))})),m=[];let v=0;for(let e=0;e{const r=t/i*m[e].data.length,s=Math.floor((g+r)/v*100);t!==i?n({state:"writing",message:`Writing progress: ${s}%`,details:{bytesTotal:v,bytesWritten:g+t,percentage:s}}):g+=r}})}catch(e){return n({state:"error",message:e.message,details:{error:"write_failed",details:e}}),await wa(l,h),void await l.disconnect()}n({state:"writing",message:"Writing complete",details:{bytesTotal:v,bytesWritten:g,percentage:100}}),await wa(l,h),console.log("DISCONNECT"),await l.disconnect(),n({state:"finished",message:"All done!"})})((e=>{this._installState=e,"finished"===e.state?xe(100).then((()=>this.port.open({baudRate:115200,bufferSize:8192}))).then((()=>this._initialize(!0))).then((()=>this.requestUpdate())):"error"===e.state&&xe(100).then((()=>this.port.open({baudRate:115200,bufferSize:8192})))}),this.port,this.manifestPath,this._manifest,this._installErase)}async _doProvision(){var e;const t=null===this._selectedSsid?this.shadowRoot.querySelector("ew-filled-text-field[name=ssid]").value:this._selectedSsid,i=(null===(e=this.shadowRoot.querySelector("ew-filled-text-field[name=password]"))||void 0===e?void 0:e.value)||"";this._busy=!0,this._wasProvisioned=this._client.state===fa.PROVISIONED,await this._stopScanning();try{await this._client.provision(t,i,45e3)}catch(e){return}finally{this._busy=!1,this._provisionForce=!1}}_closeDialog(){this.shadowRoot.querySelector("ew-dialog").close()}async _handleClose(){this._client&&await this._closeClientWithoutEvents(this._client),((e,t,i,r)=>{r=r||{};const s=new CustomEvent(t,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed,detail:i});e.dispatchEvent(s)})(this,"closed"),document.body.style.overflow=this._bodyOverflow,this.parentNode.removeChild(this)}get _isSameFirmware(){var e;return!!this._info&&((null===(e=this.overrides)||void 0===e?void 0:e.checkSameFirmware)?this.overrides.checkSameFirmware(this._manifest,this._info):this._info.firmware===this._manifest.name)}get _isSameVersion(){return this._isSameFirmware&&this._info.version===this._manifest.version}async _closeClientWithoutEvents(e){await this._stopScanning(),e.removeEventListener("disconnect",this._handleDisconnect),await e.close()}_preventDefault(e){e.preventDefault()}}ka.styles=[C,o` + :host { + --mdc-dialog-max-width: 390px; + } + div[slot="headline"] { + padding-right: 48px; + } + ew-icon-button[slot="headline"] { + position: absolute; + right: 4px; + top: 8px; + } + ew-icon-button[slot="headline"] svg { + padding: 8px; + color: var(--text-color); + } + .dialog-nav svg { + color: var(--text-color); + } + .table-row { + display: flex; + } + .table-row.last { + margin-bottom: 16px; + } + .table-row svg { + width: 20px; + margin-right: 8px; + } + ew-filled-text-field, + ew-filled-select { + display: block; + margin-top: 16px; + } + ew-select-option svg { + width: 24px; + height: 24px; + display: block; + } + .network-details { + display: flex; + align-items: center; + gap: 8px; + margin-left: 16px; + color: var(--text-color); + font-size: 12px; + } + .signal-excellent, + .signal-good, + .lock-secured { + color: #34a853; + } + .signal-fair { + color: #fbbc04; + } + .signal-weak, + .lock-unsecured { + color: var(--danger-color); + } + label.formfield { + display: inline-flex; + align-items: center; + padding-right: 8px; + } + ew-list { + margin: 0 -24px; + padding: 0; + } + ew-list-item svg { + height: 24px; + } + ewt-page-message + ew-list { + padding-top: 16px; + } + .fake-icon { + width: 24px; + } + .error { + color: var(--danger-color); + } + .danger { + --mdc-theme-primary: var(--danger-color); + --mdc-theme-secondary: var(--danger-color); + --md-sys-color-primary: var(--danger-color); + --md-sys-color-on-surface: var(--danger-color); + } + button.link { + background: none; + color: inherit; + border: none; + padding: 0; + font: inherit; + text-align: left; + text-decoration: underline; + cursor: pointer; + } + :host([state="LOGS"]) ew-dialog { + max-width: 90vw; + max-height: 90vh; + } + ewt-console { + width: calc(80vw - 48px); + height: calc(90vh - 168px); + } + `],t([v()],ka.prototype,"_client",void 0),t([v()],ka.prototype,"_state",void 0),t([v()],ka.prototype,"_installErase",void 0),t([v()],ka.prototype,"_installConfirmed",void 0),t([v()],ka.prototype,"_installState",void 0),t([v()],ka.prototype,"_provisionForce",void 0),t([v()],ka.prototype,"_error",void 0),t([v()],ka.prototype,"_busy",void 0),t([v()],ka.prototype,"_ssids",void 0),t([v()],ka.prototype,"_selectedSsid",void 0),customElements.define("ewt-install-dialog",ka);var Aa=Object.freeze({__proto__:null,EwtInstallDialog:ka});export{ts as R,Aa as i}; diff --git a/site/static/vendor/esp-web-tools/stub_flasher_32s3-CiJyd6Fk.js b/site/static/vendor/esp-web-tools/stub_flasher_32s3-CiJyd6Fk.js new file mode 100644 index 0000000..a1164b3 --- /dev/null +++ b/site/static/vendor/esp-web-tools/stub_flasher_32s3-CiJyd6Fk.js @@ -0,0 +1 @@ +var A=1077381760,g="FIADYACAA2BMAMo/BIADYDZBAIH7/wxJwCAAmQjGBAAAgfj/wCAAqAiB9/+goHSICOAIACH2/8AgAIgCJ+jhHfAAAAAIAABgHAAAYBAAAGA2QQAh/P/AIAA4AkH7/8AgACgEICCUnOJB6P9GBAAMODCIAcAgAKgIiASgoHTgCAALImYC6Ib0/yHx/8AgADkCHfAAAPQryz9sq8o/hIAAAEBAAACs68o/+CvLPzZBALH5/yCgdBARICU5AZYaBoH2/5KhAZCZEZqYwCAAuAmR8/+goHSaiMAgAJIYAJCQ9BvJwMD0wCAAwlgAmpvAIACiSQDAIACSGACB6v+QkPSAgPSHmUeB5f+SoQGQmRGamMAgAMgJoeX/seP/h5wXxgEAfOiHGt7GCADAIACJCsAgALkJRgIAwCAAuQrAIACJCZHX/5qIDAnAIACSWAAd8AAAVCAAYFQwAGA2QQCR/f/AIACICYCAJFZI/5H6/8AgAIgJgIAkVkj/HfAAAAAsIABgACAAYAAAAAg2QQAQESCl/P8h+v8MCMAgAIJiAJH6/4H4/8AgAJJoAMAgAJgIVnn/wCAAiAJ88oAiMCAgBB3wAAAAAEA2QQAQESDl+/8Wav+B7P+R+//AIACSaADAIACYCFZ5/x3wAADoCABAuAgAQDaBAIH9/+AIABwGBgwAAABgVEMMCAwa0JURDI05Me0CiWGpUZlBiSGJEdkBLA8MzAxLgfL/4AgAUETAWjNaIuYUzQwCHfAAABQoAEA2QQAgoiCB/f/gCAAd8AAAcOL6PwggAGC8CgBAyAoAQDZhABARIGXv/zH5/70BrQOB+v/gCABNCgwS7OqIAZKiAJCIEIkBEBEg5fP/kfL/oKIBwCAAiAmgiCDAIACJCbgBrQOB7v/gCACgJIMd8AAAXIDKP/8PAABoq8o/NkEAgfz/DBmSSAAwnEGZKJH6/zkYKTgwMLSaIiozMDxBOUgx9v8ioAAyAwAiaAUnEwmBv//gCABGAwAAEBEgZfb/LQqMGiKgxR3wAP///wAEIABg9AgAQAwJAEAACQBANoEAMeT/KEMWghEQESAl5v8W+hAM+AwEJ6gMiCMMEoCANIAkkyBAdBARICXo/xARIOXg/yHa/yICABYyCqgjgev/QCoRFvQEJyg8gaH/4AgAgej/4AgA6CMMAgwaqWGpURyPQO4RDI3CoNgMWylBKTEpISkRKQGBl//gCACBlP/gCACGAgAAAKCkIYHb/+AIABwKBiAAAAAnKDmBjf/gCACB1P/gCADoIwwSHI9A7hEMjSwMDFutAilhKVFJQUkxSSFJEUkBgYP/4AgAgYH/4AgARgEAgcn/4AgADBqGDQAAKCMMGUAiEZCJAcwUgIkBkb//kCIQkb7/wCAAImkAIVr/wCAAgmIAwCAAiAJWeP8cCgwSQKKDKEOgIsApQygjqiIpIx3wAAA2gQCBaf/gCAAsBoYPAAAAga//4AgAYFRDDAgMGtCVEe0CqWGpUYlBiTGZITkRiQEsDwyNwqASsqAEgVz/4AgAgVr/4AgAWjNaIlBEwOYUvx3wAAAUCgBANmEAQYT/WDRQM2MWYwtYFFpTUFxBRgEAEBEgZeb/aESmFgRoJGel7xARIGXM/xZq/1F6/2gUUgUAFkUGgUX/4AgAYFB0gqEAUHjAd7MIzQO9Aq0Ghg4AzQe9Aq0GUtX/EBEgZfT/OlVQWEEMCUYFAADCoQCZARARIOXy/5gBctcBG5mQkHRgp4BwsoBXOeFww8AQESAl8f+BLv/gCACGBQDNA70CrQaB1f/gCACgoHSMSiKgxCJkBSgUOiIpFCg0MCLAKTQd8ABcBwBANkEAgf7/4AgAggoYDAmCyPwMEoApkx3wNkEAgfj/4AgAggoYDAmCyP0MEoApkx3wvP/OP0gAyj9QAMo/QCYAQDQmAEDQJgBANmEAfMitAoeTLTH3/8YFAACoAwwcvQGB9//gCACBj/6iAQCICOAIAKgDgfP/4AgA5hrdxgoAAABmAyYMA80BDCsyYQCB7v/gCACYAYHo/zeZDagIZhoIMeb/wCAAokMAmQgd8EQAyj8CAMo/KCYAQDZBACH8/4Hc/8gCqAix+v+B+//gCAAMCIkCHfCQBgBANkEAEBEgpfP/jLqB8v+ICIxIEBEgpfz/EBEg5fD/FioAoqAEgfb/4AgAHfAAAMo/SAYAQDZBABARIGXw/00KvDox5P8MGYgDDAobSEkDMeL/ijOCyMGAqYMiQwCgQHTMqjKvQDAygDCUkxZpBBARIOX2/0YPAK0Cge7/4AgAEBEgZer/rMox6f886YITABuIgID0glMAhzkPgq9AiiIMGiCkk6CgdBaqAAwCEBEgJfX/IlMAHfAAADZBAKKgwBARICX3/x3wAAA2QQCCoMCtAoeSEaKg2xARIKX1/6Kg3EYEAAAAAIKg24eSCBARIGX0/6Kg3RARIOXz/x3wNkEAOjLGAgAAogIAGyIQESCl+/83kvEd8AAAAFwcAEAgCgBAaBwAQHQcAEA2ISGi0RCB+v/gCACGDwAAUdD+DBRARBGCBQBAQ2PNBL0BrQKMmBARICWm/8YBAAAAgfD/4AgAoKB0/DrNBL0BotEQge3/4AgASiJAM8BW4/siogsQIrCtArLREIHo/+AIAK0CHAsQESCl9v8tA4YAACKgYx3wAACIJgBAhBsAQJQmAECQGwBANkEAEBEgpdj/rIoME0Fm//AzAYyyqASB9v/gCACtA8YJAK0DgfT/4AgAqASB8//gCAAGCQAQESDl0/8MGPCIASwDoIODrQgWkgCB7P/gCACGAQAAgej/4AgAHfBgBgBANkEhYqQd4GYRGmZZBgwXUqAAYtEQUKUgQHcRUmYaEBEg5ff/R7cCxkIArQaBt//gCADGLwCRjP5Qc8CCCQBAd2PNB70BrQIWqAAQESBllf/GAQAAAIGt/+AIAKCgdIyqDAiCZhZ9CEYSAAAAEBEgpeP/vQetARARICXn/xARIKXi/80HELEgYKYggaH/4AgAeiJ6VTe1yIKhB8CIEZKkHRqI4JkRiAgamZgJgHXAlzeDxur/DAiCRmyipBsQqqCBz//gCABWCv+yoguiBmwQu7AQESClsgD36hL2Rw+Sog0QmbB6maJJABt3hvH/fOmXmsFmRxKSoQeCJhrAmREamYkJN7gCh7WLIqILECKwvQatAoGA/+AIABARIOXY/60CHAsQESBl3P8QESDl1/8MGhARIOXm/x3wAADKP09IQUmwgABgoTrYUJiAAGC4gABgKjEdj7SAAGD8K8s/rIA3QJggDGA8gjdArIU3QAgACGCAIQxgEIA3QBCAA2BQgDdADAAAYDhAAGCcLMs///8AACyBAGAQQAAAACzLPxAsyz98kABg/4///4CQAGCEkABgeJAAYFQAyj9YAMo/XCzLPxQAAGDw//8A/CvLP1wAyj90gMo/gAcAQHgbAEC4JgBAZCYAQHQfAEDsCgBABCAAQFQJAEBQCgBAAAYAQBwpAEAkJwBACCgAQOQGAEB0gQRAnAkAQPwJAEAICgBAqAYAQIQJAEBsCQBAkAkAQCgIAEDYBgBANgEBIcH/DAoiYRCB5f/gCAAQESDlrP8WigQxvP8hvP9Bvf/AIAApAwwCwCAAKQTAIAApA1G5/zG5/2G5/8AgADkFwCAAOAZ89BBEAUAzIMAgADkGwCAAKQWGAQBJAksiBgIAIaj/Ma//QqAANzLsEBEgJcD/DEuiwUAQESClw/8ioQEQESDlvv8xY/2QIhEqI8AgADkCQaT/ITv9SQIQESClpf8tChb6BSGa/sGb/qgCDCuBnf7gCABBnP+xnf8cGgwMwCAAqQSBt//gCAAMGvCqAYEl/+AIALGW/6gCDBWBsv/gCACoAoEd/+AIAKgCga//4AgAQZD/wCAAKARQIiDAIAApBIYWABARIGWd/6yaQYr/HBqxiv/AIACiZAAgwiCBoP/gCAAhh/8MRAwawCAASQLwqgHGCAAAALGD/80KDFqBmP/gCABBgP9SoQHAIAAoBCwKUCIgwCAAKQSBAv/gCACBk//gCAAhef/AIAAoAsy6HMRAIhAiwvgMFCCkgwwLgYz/4AgAgYv/4AgAXQqMmkGo/QwSIkQARhQAHIYMEmlBYsEgqWFpMakhqRGpAf0K7QopUQyNwqCfsqAEIKIggWr94AgAcgEiHGhix+dgYHRnuAEtBTyGDBV3NgEMBUGU/VAiICAgdCJEABbiAKFZ/4Fy/+AIAIFb/eAIAPFW/wwdDBwMG+KhAEDdEQDMEWC7AQwKgWr/4AgAMYT9YtMrhhYAwCAAUgcAUFB0FhUFDBrwqgHAIAAiRwCByf7gCACionHAqhGBX//gCACBXv/gCABxQv986MAgAFgHfPqAVRAQqgHAIABZB4FY/+AIAIFX/+AIACCiIIFW/+AIAHEn/kHp/MAgACgEFmL5DAfAIABYBAwSwCAAeQQiQTQiBQEMKHnhIkE1glEbHDd3EiQcR3cSIWaSISIFA3IFAoAiEXAiIGZCEiglwCAAKAIp4YYBAAAAHCIiURsQESBlmf+yoAiiwTQQESDlnP+yBQMiBQKAuxEgSyAhGf8gIPRHshqioMAQESCll/+ioO4QESAll/8QESDllf+G2P8iBQEcRyc3N/YiGwYJAQAiwi8gIHS2QgIGJQBxC/9wIqAoAqACAAAiwv4gIHQcJye3Akb/AHEF/3AioCgCoAIAcsIwcHB0tlfFhvkALEkMByKgwJcUAob3AHnhDHKtBxARIGWQ/60HEBEg5Y//EBEgZY7/EBEgJY7/DIuiwTQiwv8QESBlkf9WIv1GQAAMElakOcLBIL0ErQSBCP/gCABWqjgcS6LBIBARICWP/4bAAAwSVnQ3gQL/4AgAoCSDxtoAJoQEDBLG2AAoJXg1cIIggIC0Vtj+EBEgZT7/eiKsmgb4/0EN/aCsQYIEAIz4gSL94AgARgMActfwRgMAAACB8f7gCAAW6v4G7v9wosDMF8anAKCA9FaY/EYKAEH+/KCg9YIEAJwYgRP94AgAxgMAfPgAiBGKd8YCAIHj/uAIABbK/kbf/wwYAIgRcKLAdzjKhgkAQfD8oKxBggQAjOiBBv3gCAAGAwBy1/AGAwAAgdX+4AgAFvr+BtL/cKLAVif9hosADAcioMAmhAIGqgAMBy0HRqgAJrT1Bn4ADBImtAIGogC4NaglDAcQESClgf+gJ4OGnQAMGWa0X4hFIKkRDAcioMKHugIGmwC4VaglkmEWEBEgZTT/kiEWoJeDRg4ADBlmtDSIRSCpEQwHIqDCh7oCRpAAKDW4VaglIHiCkmEWEBEgZTH/IcH8DAiSIRaJYiLSK3JiAqCYgy0JBoMAkbv8DAeiCQAioMZ3mgKGgQB4JbLE8CKgwLeXAiIpBQwHkqDvRgIAeoWCCBgbd4CZMLcn8oIFBXIFBICIEXCIIHIFBgB3EYB3IIIFB4CIAXCIIICZwIKgwQwHkCiTxm0AgaP8IqDGkggAfQkWmRqYOAwHIqDIdxkCBmcAKFiSSABGYgAciQwHDBKXFAIGYgD4dehl2FXIRbg1qCWBev7gCAAMCH0KoCiDBlsADBImRAJGVgCRX/6BX/7AIAB4CUAiEYB3ECB3IKglwCAAeQmRWv4MC8AgAHgJgHcQIHcgwCAAeQmRVv7AIAB4CYB3ECB3IMAgAHkJkVL+wCAAeAmAdxAgJyDAIAApCYFb/uAIAAYgAABAkDQMByKgwHcZAoY9AEBEQYvFfPhGDwCoPIJhFZJhFsJhFIFU/uAIAMIhFIIhFSgseByoDJIhFnByECYCDcAgANgKICgw0CIQIHcgwCAAeQobmcLMEEc5vsZ//2ZEAkZ+/wwHIqDAhiYADBImtALGIQAhL/6IVXgliQIhLv55AgwCBh0A8Sr+DAfIDwwZssTwjQctB7Apk8CJgyCIECKgxneYYKEk/n0I2AoioMm3PVOw4BQioMBWrgQtCIYCAAAqhYhoSyKJB40JIO3AKny3Mu0WaNjpCnkPxl//DBJmhBghFP6CIgCMGIKgyAwHeQIhEP55AgwSgCeDDAdGAQAADAcioP8goHQQESClUv9woHQQESDlUf8QESClUP9W8rAiBQEcJyc3H/YyAkbA/iLC/SAgdAz3J7cCxrz+cf/9cCKgKAKgAgAAcqDSdxJfcqDUd5ICBiEARrX+KDVYJRARIKU0/40KVmqsoqJxwKoRgmEVgQD+4AgAcfH9kfH9wCAAeAeCIRVwtDXAdxGQdxBwuyAgu4KtCFC7woH//eAIAKKj6IH0/eAIAMag/gAA2FXIRbg1qCUQESAlXP8GnP4AsgUDIgUCgLsRILsgssvwosUYEBEgJR//BpX+ACIFA3IFAoAiEXAiIIHt/eAIAHH7+yLC8Ig3gCJjFjKjiBeKgoCMQUYDAAAAgmEVEBEgpQP/giEVkicEphkFkicCl6jnEBEgZen+Fmr/qBfNArLFGIHc/eAIAIw6UqDEWVdYFypVWRdYNyAlwCk3gdb94AgABnf+AAAiBQOCBQJyxRiAIhFYM4AiICLC8FZFCvZSAoYnACKgyUYsAFGz/YHY+6gFKfGgiMCJgYgmrQmHsgEMOpJhFqJhFBARIOX6/qIhFIGq/akB6AWhqf3dCL0HwsE88sEggmEVgbz94AgAuCbNCqjxkiEWoLvAuSagIsC4Bap3qIGCIRWquwwKuQXAqYOAu8Cg0HTMiuLbgK0N4KmDrCqtCIJhFZJhFsJhFBARIKUM/4IhFZIhFsIhFIkFBgEAAAwcnQyMslgzjHXAXzHAVcCWNfXWfAAioMcpUwZA/lbcjygzFoKPIqDIBvv/KCVW0o4QESBlIv+ionHAqhGBif3gCACBlv3gCACGNP4oNRbSjBARIGUg/6Kj6IGC/eAIAOACAAYu/h3wAAAANkEAnQKCoMAoA4eZD8wyDBKGBwAMAikDfOKGDwAmEgcmIhiGAwAAAIKg24ApI4eZKgwiKQN88kYIAAAAIqDcJ5kKDBIpAy0IBgQAAACCoN188oeZBgwSKQMioNsd8AAA",C=1077379072,I="XADKP16ON0AzjzdAR5Q3QL2PN0BTjzdAvY83QB2QN0A6kTdArJE3QFWRN0DpjTdA0JA3QCyRN0BAkDdA0JE3QGiQN0DQkTdAIY83QH6PN0C9jzdAHZA3QDmPN0AqjjdAkJI3QA2UN0AAjTdALZQ3QACNN0AAjTdAAI03QACNN0AAjTdAAI03QACNN0AAjTdAKpI3QACNN0AlkzdADZQ3QAQInwAAAAAAAAAYAQQIBQAAAAAAAAAIAQQIBgAAAAAAAAAAAQQIIQAAAAAAIAAAEQQI3AAAAAAAIAAAEQQIDAAAAAAAIAAAAQQIEgAAAAAAIAAAESAoDAAQAQAA",B=1070279676,Q=1070202880,E={entry:A,text:g,text_start:C,data:I,data_start:B,bss_start:Q};export{Q as bss_start,I as data,B as data_start,E as default,A as entry,g as text,C as text_start}; diff --git a/site/static/vendor/esp-web-tools/styles-sT2V1cOw.js b/site/static/vendor/esp-web-tools/styles-sT2V1cOw.js new file mode 100644 index 0000000..7b06d99 --- /dev/null +++ b/site/static/vendor/esp-web-tools/styles-sT2V1cOw.js @@ -0,0 +1,113 @@ +function t(t,e,i,o){var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n}"function"==typeof SuppressedError&&SuppressedError;const e=globalThis,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),s=new WeakMap;let r=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==o)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(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}};const n=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>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[o+1]),t[0]);return new r(i,t,o)},a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,o))(e)})(t):t,{is:l,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:h,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,v=globalThis,m=v.trustedTypes,f=m?m.emptyScript:"",g=v.reactiveElementPolyfillSupport,b=(t,e)=>t,y={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}},x=(t,e)=>!l(t,e),_={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),v.litPropertyMetadata??(v.litPropertyMetadata=new WeakMap);let $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=_){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,e);void 0!==o&&d(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:s}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:o,set(e){const r=null==o?void 0:o.call(this);null!=s&&s.call(this,e),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...h(t),...p(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}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(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null===(e=t.hostConnected)||void 0===e||e.call(t))}removeController(t){var e;null===(e=this._$EO)||void 0===e||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,o)=>{if(i)t.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of o){const o=document.createElement("style"),s=e.litNonce;void 0!==s&&o.setAttribute("nonce",s),o.textContent=i.cssText,t.appendChild(o)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$EO)||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._$EO)||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)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(void 0!==o&&!0===i.reflect){var s;const r=(void 0!==(null===(s=i.converter)||void 0===s?void 0:s.toAttribute)?i.converter:y).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,o=i._$Eh.get(t);if(void 0!==o&&this._$Em!==o){var s,r;const t=i.getPropertyOptions(o),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:y;this._$Em=o,this[o]=n.fromAttribute(e,t.type)??(null===(r=this._$Ej)||void 0===r?void 0:r.get(o))??null,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){var o;const s=this.constructor,r=this[t];if(i??(i=s.getPropertyOptions(t)),!((i.hasChanged??x)(r,e)||i.useDefault&&i.reflect&&r===(null===(o=this._$Ej)||void 0===o?void 0:o.get(t))&&!this.hasAttribute(s._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:o,wrapped:s},r){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==s||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,o=this[e];!0!==t||this._$AL.has(e)||void 0===o||this.C(e,void 0,i,o)}}let t=!1;const e=this._$AL;try{var i;t=this.shouldUpdate(e),t?(this.willUpdate(e),null!==(i=this._$EO)&&void 0!==i&&i.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;null!==(e=this._$EO)&&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)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((t=>this._$ET(t,this[t])))),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[b("elementProperties")]=new Map,$[b("finalized")]=new Map,null!=g&&g({ReactiveElement:$}),(v.reactiveElementVersions??(v.reactiveElementVersions=[])).push("2.1.0");const A=globalThis,w=A.trustedTypes,C=w?w.createPolicy("lit-html",{createHTML:t=>t}):void 0,E="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,P="?"+S,T=`<${P}>`,k=document,I=()=>k.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,R=Array.isArray,z="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,N=/-->/g,M=/>/g,U=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,L=/"/g,F=/^(?:script|style|textarea|title)$/i,B=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),j=B(1),V=B(2),q=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),Y=new WeakMap,G=k.createTreeWalker(k,129);function K(t,e){if(!R(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(e):e}const Z=(t,e)=>{const i=t.length-1,o=[];let s,r=2===e?"":3===e?"":"",n=H;for(let e=0;e"===l[0]?(n=s??H,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?U:'"'===l[3]?L:D):n===L||n===D?n=U:n===N||n===M?n=H:(n=U,s=void 0);const h=n===U&&t[e+1].startsWith("/>")?" ":"";r+=n===H?i+T:d>=0?(o.push(a),i.slice(0,d)+E+i.slice(d)+S+h):i+S+(-2===d?e:h)}return[K(t,r+(t[i]||"")+(2===e?"":3===e?"":"")),o]};class J{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,r=0;const n=t.length-1,a=this.parts,[l,d]=Z(t,e);if(this.el=J.createElement(l,i),G.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=G.nextNode())&&a.length0){o.textContent=w?w.emptyScript:"";for(let i=0;iR(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==W&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(k.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=J.createElement(K(o.h,o.h[0]),this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.p(i);else{const t=new Q(s,this),e=t.u(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=Y.get(t.strings);return void 0===e&&Y.set(t.strings,e=new J(t)),e}k(t){R(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new tt(this.O(I()),this.O(I()),this,this.options)):i=e[o],i._$AI(s),o++;o2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=W}_$AI(t,e=this,i,o){const s=this.strings;let r=!1;if(void 0===s)t=X(this,t,e,0),r=!O(t)||t!==this._$AH&&t!==q,r&&(this._$AH=t);else{const o=t;let n,a;for(t=s[0],n=0;n{const o=(null==i?void 0:i.renderBefore)??e;let s=o._$litPart$;if(void 0===s){const t=(null==i?void 0:i.renderBefore)??null;o._$litPart$=s=new tt(e.insertBefore(I(),t),t,void 0,i??{})}return s._$AI(t),s};var lt;const dt=globalThis;let ct=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=at(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 q}};ct._$litElement$=!0,ct.finalized=!0,null===(lt=dt.litElementHydrateSupport)||void 0===lt||lt.call(dt,{LitElement:ct});const ht=dt.litElementPolyfillSupport;null==ht||ht({LitElement:ct}),(dt.litElementVersions??(dt.litElementVersions=[])).push("4.2.0");const pt=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)},ut={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:x},vt=(t=ut,e,i)=>{const{kind:o,metadata:s}=i;let r=globalThis.litPropertyMetadata.get(s);if(void 0===r&&globalThis.litPropertyMetadata.set(s,r=new Map),"setter"===o&&((t=Object.create(t)).wrapped=!0),r.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const s=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,s,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===o){const{name:o}=i;return function(i){const s=this[o];e.call(this,i),this.requestUpdate(o,s,t)}}throw Error("Unsupported decorator location: "+o)};function mt(t){return(e,i)=>"object"==typeof i?vt(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function ft(t){return mt({...t,state:!0,attribute:!1})}const gt=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);function bt(t,e){return(e,i,o)=>gt(e,i,{get(){return(e=>{var i;return(null===(i=e.renderRoot)||void 0===i?void 0:i.querySelector(t))??null})(this)}})}function yt(t){return(e,i)=>{const{slot:o,selector:s}=t??{},r="slot"+(o?`[name=${o}]`:":not([name])");return gt(e,i,{get(){var e;const i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(r),o=(null==i?void 0:i.assignedElements(t))??[];return void 0===s?o:o.filter((t=>t.matches(s)))}})}}const xt=n`:host{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end);box-sizing:border-box;cursor:pointer;display:inline-flex;gap:8px;min-height:var(--_container-height);outline:none;padding-block:calc((var(--_container-height) - max(var(--_label-text-line-height),var(--_icon-size)))/2);padding-inline-start:var(--_leading-space);padding-inline-end:var(--_trailing-space);place-content:center;place-items:center;position:relative;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);text-overflow:ellipsis;text-wrap:nowrap;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);vertical-align:top;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host(:is([disabled],[soft-disabled])){cursor:default;pointer-events:none}.button{border-radius:inherit;cursor:inherit;display:inline-flex;align-items:center;justify-content:center;border:none;outline:none;-webkit-appearance:none;vertical-align:middle;background:rgba(0,0,0,0);text-decoration:none;min-width:calc(64px - var(--_leading-space) - var(--_trailing-space));width:100%;z-index:0;height:100%;font:inherit;color:var(--_label-text-color);padding:0;gap:inherit;text-transform:inherit}.button::-moz-focus-inner{padding:0;border:0}:host(:hover) .button{color:var(--_hover-label-text-color)}:host(:focus-within) .button{color:var(--_focus-label-text-color)}:host(:active) .button{color:var(--_pressed-label-text-color)}.background{background:var(--_container-color);border-radius:inherit;inset:0;position:absolute}.label{overflow:hidden}:is(.button,.label,.label slot),.label ::slotted(*){text-overflow:inherit}:host(:is([disabled],[soft-disabled])) .label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}:host(:is([disabled],[soft-disabled])) .background{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}@media(forced-colors: active){.background{border:1px solid CanvasText}:host(:is([disabled],[soft-disabled])){--_disabled-icon-color: GrayText;--_disabled-icon-opacity: 1;--_disabled-container-opacity: 1;--_disabled-label-text-color: GrayText;--_disabled-label-text-opacity: 1}}:host([has-icon]:not([trailing-icon])){padding-inline-start:var(--_with-leading-icon-leading-space);padding-inline-end:var(--_with-leading-icon-trailing-space)}:host([has-icon][trailing-icon]){padding-inline-start:var(--_with-trailing-icon-leading-space);padding-inline-end:var(--_with-trailing-icon-trailing-space)}::slotted([slot=icon]){display:inline-flex;position:relative;writing-mode:horizontal-tb;fill:currentColor;flex-shrink:0;color:var(--_icon-color);font-size:var(--_icon-size);inline-size:var(--_icon-size);block-size:var(--_icon-size)}:host(:hover) ::slotted([slot=icon]){color:var(--_hover-icon-color)}:host(:focus-within) ::slotted([slot=icon]){color:var(--_focus-icon-color)}:host(:active) ::slotted([slot=icon]){color:var(--_pressed-icon-color)}:host(:is([disabled],[soft-disabled])) ::slotted([slot=icon]){color:var(--_disabled-icon-color);opacity:var(--_disabled-icon-opacity)}.touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) 0}:host([touch-target=none]) .touch{display:none} +`,_t=Symbol("attachableController");let $t;$t=new MutationObserver((t=>{for(const i of t){var e;null===(e=i.target[_t])||void 0===e||e.hostConnected()}}));class At{get htmlFor(){return this.host.getAttribute("for")}set htmlFor(t){null===t?this.host.removeAttribute("for"):this.host.setAttribute("for",t)}get control(){return this.host.hasAttribute("for")?this.htmlFor&&this.host.isConnected?this.host.getRootNode().querySelector(`#${this.htmlFor}`):null:this.currentControl||this.host.parentElement}set control(t){t?this.attach(t):this.detach()}constructor(t,e){var i;this.host=t,this.onControlChange=e,this.currentControl=null,t.addController(this),t[_t]=this,null===(i=$t)||void 0===i||i.observe(t,{attributeFilter:["for"]})}attach(t){t!==this.currentControl&&(this.setCurrentControl(t),this.host.removeAttribute("for"))}detach(){this.setCurrentControl(null),this.host.setAttribute("for","")}hostConnected(){this.setCurrentControl(this.control)}hostDisconnected(){this.setCurrentControl(null)}setCurrentControl(t){this.onControlChange(this.currentControl,t),this.currentControl=t}}const wt=["focusin","focusout","pointerdown"];class Ct extends ct{constructor(){super(...arguments),this.visible=!1,this.inward=!1,this.attachableController=new At(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}handleEvent(t){var e;if(!t[Et]){switch(t.type){default:return;case"focusin":this.visible=(null===(e=this.control)||void 0===e?void 0:e.matches(":focus-visible"))??!1;break;case"focusout":case"pointerdown":this.visible=!1}t[Et]=!0}}onControlChange(t,e){for(const i of wt)null==t||t.removeEventListener(i,this),null==e||e.addEventListener(i,this)}update(t){t.has("visible")&&this.dispatchEvent(new Event("visibility-changed")),super.update(t)}}t([mt({type:Boolean,reflect:!0})],Ct.prototype,"visible",void 0),t([mt({type:Boolean,reflect:!0})],Ct.prototype,"inward",void 0);const Et=Symbol("handledByFocusRing"),St=n`:host{animation-delay:0s,calc(var(--md-focus-ring-duration, 600ms)*.25);animation-duration:calc(var(--md-focus-ring-duration, 600ms)*.25),calc(var(--md-focus-ring-duration, 600ms)*.75);animation-timing-function:cubic-bezier(0.2, 0, 0, 1);box-sizing:border-box;color:var(--md-focus-ring-color, var(--md-sys-color-secondary, #625b71));display:none;pointer-events:none;position:absolute}:host([visible]){display:flex}:host(:not([inward])){animation-name:outward-grow,outward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));inset:calc(-1*var(--md-focus-ring-outward-offset, 2px));outline:var(--md-focus-ring-width, 3px) solid currentColor}:host([inward]){animation-name:inward-grow,inward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border:var(--md-focus-ring-width, 3px) solid currentColor;inset:var(--md-focus-ring-inward-offset, 0px)}@keyframes outward-grow{from{outline-width:0}to{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes outward-shrink{from{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-grow{from{border-width:0}to{border-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-shrink{from{border-width:var(--md-focus-ring-active-width, 8px)}}@media(prefers-reduced-motion){:host{animation:none}} +`;let Pt=class extends Ct{};Pt.styles=[St],Pt=t([pt("md-focus-ring")],Pt);const Tt={ATTRIBUTE:1,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},kt=t=>(...e)=>({_$litDirective$:t,values:e});class It{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 Ot=kt(class extends It{constructor(t){var e;if(super(t),t.type!==Tt.ATTRIBUTE||"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]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e){var i;e[t]&&(null===(i=this.nt)||void 0===i||!i.has(t))&&this.st.add(t)}return this.render(e)}const o=t.element.classList;for(const t of this.st)t in e||(o.remove(t),this.st.delete(t));for(const t in e){var s;const i=!!e[t];i===this.st.has(t)||(null===(s=this.nt)||void 0===s?void 0:s.has(t))||(i?(o.add(t),this.st.add(t)):(o.remove(t),this.st.delete(t)))}return q}}),Rt={STANDARD:"cubic-bezier(0.2, 0, 0, 1)",EMPHASIZED:"cubic-bezier(.3,0,0,1)",EMPHASIZED_ACCELERATE:"cubic-bezier(.3,0,.8,.15)"};function zt(){let t=null;return{start(){var e;return null===(e=t)||void 0===e||e.abort(),t=new AbortController,t.signal},finish(){t=null}}}var Ht;!function(t){t[t.INACTIVE=0]="INACTIVE",t[t.TOUCH_DELAY=1]="TOUCH_DELAY",t[t.HOLDING=2]="HOLDING",t[t.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"}(Ht||(Ht={}));const Nt=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],Mt=window.matchMedia("(forced-colors: active)");class Ut extends ct{constructor(){super(...arguments),this.disabled=!1,this.hovered=!1,this.pressed=!1,this.rippleSize="",this.rippleScale="",this.initialSize=0,this.state=Ht.INACTIVE,this.attachableController=new At(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){const t={hovered:this.hovered,pressed:this.pressed};return j`
    `}update(t){t.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),super.update(t)}handlePointerenter(t){this.shouldReactToEvent(t)&&(this.hovered=!0)}handlePointerleave(t){this.shouldReactToEvent(t)&&(this.hovered=!1,this.state!==Ht.INACTIVE&&this.endPressAnimation())}handlePointerup(t){if(this.shouldReactToEvent(t)){if(this.state!==Ht.HOLDING)return this.state===Ht.TOUCH_DELAY?(this.state=Ht.WAITING_FOR_CLICK,void this.startPressAnimation(this.rippleStartEvent)):void 0;this.state=Ht.WAITING_FOR_CLICK}}async handlePointerdown(t){if(this.shouldReactToEvent(t)){if(this.rippleStartEvent=t,!this.isTouch(t))return this.state=Ht.WAITING_FOR_CLICK,void this.startPressAnimation(t);this.state=Ht.TOUCH_DELAY,await new Promise((t=>{setTimeout(t,150)})),this.state===Ht.TOUCH_DELAY&&(this.state=Ht.HOLDING,this.startPressAnimation(t))}}handleClick(){this.disabled||(this.state!==Ht.WAITING_FOR_CLICK?this.state===Ht.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation()):this.endPressAnimation())}handlePointercancel(t){this.shouldReactToEvent(t)&&this.endPressAnimation()}handleContextmenu(){this.disabled||this.endPressAnimation()}determineRippleSize(){const{height:t,width:e}=this.getBoundingClientRect(),i=Math.max(t,e),o=Math.max(.35*i,75),s=this.currentCSSZoom??1,r=Math.floor(.2*i/s),n=Math.sqrt(e**2+t**2)+10;this.initialSize=r;const a=(n+o)/r;this.rippleScale=""+a/s,this.rippleSize=`${r}px`}getNormalizedPointerEventCoords(t){const{scrollX:e,scrollY:i}=window,{left:o,top:s}=this.getBoundingClientRect(),r=e+o,n=i+s,{pageX:a,pageY:l}=t,d=this.currentCSSZoom??1;return{x:(a-r)/d,y:(l-n)/d}}getTranslationCoordinates(t){const{height:e,width:i}=this.getBoundingClientRect(),o=this.currentCSSZoom??1,s={x:(i/o-this.initialSize)/2,y:(e/o-this.initialSize)/2};let r;return r=t instanceof PointerEvent?this.getNormalizedPointerEventCoords(t):{x:i/o/2,y:e/o/2},r={x:r.x-this.initialSize/2,y:r.y-this.initialSize/2},{startPoint:r,endPoint:s}}startPressAnimation(t){var e;if(!this.mdRoot)return;this.pressed=!0,null===(e=this.growAnimation)||void 0===e||e.cancel(),this.determineRippleSize();const{startPoint:i,endPoint:o}=this.getTranslationCoordinates(t),s=`${i.x}px, ${i.y}px`,r=`${o.x}px, ${o.y}px`;this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:[`translate(${s}) scale(1)`,`translate(${r}) scale(${this.rippleScale})`]},{pseudoElement:"::after",duration:450,easing:Rt.STANDARD,fill:"forwards"})}async endPressAnimation(){this.rippleStartEvent=void 0,this.state=Ht.INACTIVE;const t=this.growAnimation;let e=1/0;"number"==typeof(null==t?void 0:t.currentTime)?e=t.currentTime:null!=t&&t.currentTime&&(e=t.currentTime.to("ms").value),e>=225?this.pressed=!1:(await new Promise((t=>{setTimeout(t,225-e)})),this.growAnimation===t&&(this.pressed=!1))}shouldReactToEvent(t){if(this.disabled||!t.isPrimary)return!1;if(this.rippleStartEvent&&this.rippleStartEvent.pointerId!==t.pointerId)return!1;if("pointerenter"===t.type||"pointerleave"===t.type)return!this.isTouch(t);const e=1===t.buttons;return this.isTouch(t)||e}isTouch({pointerType:t}){return"touch"===t}async handleEvent(t){if(null==Mt||!Mt.matches)switch(t.type){case"click":this.handleClick();break;case"contextmenu":this.handleContextmenu();break;case"pointercancel":this.handlePointercancel(t);break;case"pointerdown":await this.handlePointerdown(t);break;case"pointerenter":this.handlePointerenter(t);break;case"pointerleave":this.handlePointerleave(t);break;case"pointerup":this.handlePointerup(t)}}onControlChange(t,e){for(const i of Nt)null==t||t.removeEventListener(i,this),null==e||e.addEventListener(i,this)}}t([mt({type:Boolean,reflect:!0})],Ut.prototype,"disabled",void 0),t([ft()],Ut.prototype,"hovered",void 0),t([ft()],Ut.prototype,"pressed",void 0),t([bt(".surface")],Ut.prototype,"mdRoot",void 0);const Dt=n`:host{display:flex;margin:auto;pointer-events:none}:host([disabled]){display:none}@media(forced-colors: active){:host{display:none}}:host,.surface{border-radius:inherit;position:absolute;inset:0;overflow:hidden}.surface{-webkit-tap-highlight-color:rgba(0,0,0,0)}.surface::before,.surface::after{content:"";opacity:0;position:absolute}.surface::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));inset:0;transition:opacity 15ms linear,background-color 15ms linear}.surface::after{background:radial-gradient(closest-side, var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1d1b20)) max(100% - 70px, 65%), transparent 100%);transform-origin:center center;transition:opacity 375ms linear}.hovered::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-ripple-hover-opacity, 0.08)}.pressed::after{opacity:var(--md-ripple-pressed-opacity, 0.12);transition-duration:105ms} +`;let Lt=class extends Ut{};Lt.styles=[Dt],Lt=t([pt("md-ripple")],Lt);const Ft=["role","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"],Bt=Ft.map(Vt);function jt(t){return Bt.includes(t)}function Vt(t){return t.replace("aria","aria-").replace(/Elements?/g,"").toLowerCase()}const qt=Symbol("privateIgnoreAttributeChangesFor");function Wt(t){var e;class i extends t{constructor(){super(...arguments),this[e]=new Set}attributeChangedCallback(t,e,i){if(!jt(t))return void super.attributeChangedCallback(t,e,i);if(this[qt].has(t))return;this[qt].add(t),this.removeAttribute(t),this[qt].delete(t);const o=Gt(t);null===i?delete this.dataset[o]:this.dataset[o]=i,this.requestUpdate(Gt(t),e)}getAttribute(t){return jt(t)?super.getAttribute(Yt(t)):super.getAttribute(t)}removeAttribute(t){super.removeAttribute(t),jt(t)&&(super.removeAttribute(Yt(t)),this.requestUpdate())}}return e=qt,function(t){for(const e of Ft){const i=Vt(e),o=Yt(i),s=Gt(i);t.createProperty(e,{attribute:i,noAccessor:!0}),t.createProperty(Symbol(o),{attribute:o,noAccessor:!0}),Object.defineProperty(t.prototype,e,{configurable:!0,enumerable:!0,get(){return this.dataset[s]??null},set(t){const i=this.dataset[s]??null;t!==i&&(null===t?delete this.dataset[s]:this.dataset[s]=t,this.requestUpdate(e,i))}})}}(i),i}function Yt(t){return`data-${t}`}function Gt(t){return t.replace(/-\w/,(t=>t[1].toUpperCase()))}const Kt=Symbol("internals"),Zt=Symbol("privateInternals");function Jt(t){return class extends t{get[Kt](){return this[Zt]||(this[Zt]=this.attachInternals()),this[Zt]}}}function Xt(t){t.addInitializer((t=>{const e=t;e.addEventListener("click",(async t=>{const{type:i,[Kt]:o}=e,{form:s}=o;s&&"button"!==i&&(await new Promise((t=>{setTimeout(t)})),t.defaultPrevented||("reset"!==i?(s.addEventListener("submit",(t=>{Object.defineProperty(t,"submitter",{configurable:!0,enumerable:!0,get:()=>e})}),{capture:!0,once:!0}),o.setFormValue(e.value),s.requestSubmit()):s.reset()))}))}))}function Qt(t){const e=new MouseEvent("click",{bubbles:!0});return t.dispatchEvent(e),e}function te(t){return t.currentTarget===t.target&&(t.composedPath()[0]===t.target&&(!t.target.disabled&&!function(t){const e=ee;e&&(t.preventDefault(),t.stopImmediatePropagation());return async function(){ee=!0,await null,ee=!1}(),e}(t)))}let ee=!1;const ie=Wt(Jt(ct));class oe extends ie{get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get form(){return this[Kt].form}constructor(){super(),this.disabled=!1,this.softDisabled=!1,this.href="",this.download="",this.target="",this.trailingIcon=!1,this.hasIcon=!1,this.type="submit",this.value="",this.addEventListener("click",this.handleClick.bind(this))}focus(){var t;null===(t=this.buttonElement)||void 0===t||t.focus()}blur(){var t;null===(t=this.buttonElement)||void 0===t||t.blur()}render(){var t;const e=this.disabled||this.softDisabled,i=this.href?this.renderLink():this.renderButton(),o=this.href?"link":"button";return j` + ${null===(t=this.renderElevationOrOutline)||void 0===t?void 0:t.call(this)} +
    + + + ${i} + `}renderButton(){const{ariaLabel:t,ariaHasPopup:e,ariaExpanded:i}=this;return j``}renderLink(){const{ariaLabel:t,ariaHasPopup:e,ariaExpanded:i}=this;return j`${this.renderContent()} + `}renderContent(){const t=j``;return j` + + ${this.trailingIcon?W:t} + + ${this.trailingIcon?t:W} + `}handleClick(t){if(this.softDisabled||this.disabled&&this.href)return t.stopImmediatePropagation(),void t.preventDefault();te(t)&&this.buttonElement&&(this.focus(),Qt(this.buttonElement))}handleSlotChange(){this.hasIcon=this.assignedIcons.length>0}}Xt(oe),oe.formAssociated=!0,oe.shadowRootOptions={mode:"open",delegatesFocus:!0},t([mt({type:Boolean,reflect:!0})],oe.prototype,"disabled",void 0),t([mt({type:Boolean,attribute:"soft-disabled",reflect:!0})],oe.prototype,"softDisabled",void 0),t([mt()],oe.prototype,"href",void 0),t([mt()],oe.prototype,"download",void 0),t([mt()],oe.prototype,"target",void 0),t([mt({type:Boolean,attribute:"trailing-icon",reflect:!0})],oe.prototype,"trailingIcon",void 0),t([mt({type:Boolean,attribute:"has-icon",reflect:!0})],oe.prototype,"hasIcon",void 0),t([mt()],oe.prototype,"type",void 0),t([mt({reflect:!0})],oe.prototype,"value",void 0),t([bt(".button")],oe.prototype,"buttonElement",void 0),t([yt({slot:"icon",flatten:!0})],oe.prototype,"assignedIcons",void 0);class se extends oe{}const re=n`:host{--_container-height: var(--md-text-button-container-height, 40px);--_disabled-label-text-color: var(--md-text-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-text-button-disabled-label-text-opacity, 0.38);--_focus-label-text-color: var(--md-text-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-text-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-text-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-text-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-text-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-text-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-text-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-text-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-text-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color: var(--md-text-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-text-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-text-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-text-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-text-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-text-button-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-icon-color: var(--md-text-button-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-color: var(--md-text-button-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-text-button-icon-size, 18px);--_pressed-icon-color: var(--md-text-button-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start: var(--md-text-button-container-shape-start-start, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-text-button-container-shape-start-end, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-text-button-container-shape-end-end, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-text-button-container-shape-end-start, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-text-button-leading-space, 12px);--_trailing-space: var(--md-text-button-trailing-space, 12px);--_with-leading-icon-leading-space: var(--md-text-button-with-leading-icon-leading-space, 12px);--_with-leading-icon-trailing-space: var(--md-text-button-with-leading-icon-trailing-space, 16px);--_with-trailing-icon-leading-space: var(--md-text-button-with-trailing-icon-leading-space, 16px);--_with-trailing-icon-trailing-space: var(--md-text-button-with-trailing-icon-trailing-space, 12px);--_container-color: none;--_disabled-container-color: none;--_disabled-container-opacity: 0} +`;class ne extends se{}ne.styles=[xt,re],customElements.define("ew-text-button",ne);class ae extends ct{constructor(){super(...arguments),this.inset=!1,this.insetStart=!1,this.insetEnd=!1}}t([mt({type:Boolean,reflect:!0})],ae.prototype,"inset",void 0),t([mt({type:Boolean,reflect:!0,attribute:"inset-start"})],ae.prototype,"insetStart",void 0),t([mt({type:Boolean,reflect:!0,attribute:"inset-end"})],ae.prototype,"insetEnd",void 0);const le=n`:host{box-sizing:border-box;color:var(--md-divider-color, var(--md-sys-color-outline-variant, #cac4d0));display:flex;height:var(--md-divider-thickness, 1px);width:100%}:host([inset]),:host([inset-start]){padding-inline-start:16px}:host([inset]),:host([inset-end]){padding-inline-end:16px}:host::before{background:currentColor;content:"";height:100%;width:100%}@media(forced-colors: active){:host::before{background:CanvasText}} +`;function de(t,e){!e.bubbles||t.shadowRoot&&!e.composed||e.stopPropagation();const i=Reflect.construct(e.constructor,[e.type,e]),o=t.dispatchEvent(i);return o||e.preventDefault(),o}let ce=class extends ae{};ce.styles=[le],ce=t([pt("md-divider")],ce);const he={dialog:[[[{transform:"translateY(-50px)"},{transform:"translateY(0)"}],{duration:500,easing:Rt.EMPHASIZED}]],scrim:[[[{opacity:0},{opacity:.32}],{duration:500,easing:"linear"}]],container:[[[{opacity:0},{opacity:1}],{duration:50,easing:"linear",pseudoElement:"::before"}],[[{height:"35%"},{height:"100%"}],{duration:500,easing:Rt.EMPHASIZED,pseudoElement:"::before"}]],headline:[[[{opacity:0},{opacity:0,offset:.2},{opacity:1}],{duration:250,easing:"linear",fill:"forwards"}]],content:[[[{opacity:0},{opacity:0,offset:.2},{opacity:1}],{duration:250,easing:"linear",fill:"forwards"}]],actions:[[[{opacity:0},{opacity:0,offset:.5},{opacity:1}],{duration:300,easing:"linear",fill:"forwards"}]]},pe={dialog:[[[{transform:"translateY(0)"},{transform:"translateY(-50px)"}],{duration:150,easing:Rt.EMPHASIZED_ACCELERATE}]],scrim:[[[{opacity:.32},{opacity:0}],{duration:150,easing:"linear"}]],container:[[[{height:"100%"},{height:"35%"}],{duration:150,easing:Rt.EMPHASIZED_ACCELERATE,pseudoElement:"::before"}],[[{opacity:"1"},{opacity:"0"}],{delay:100,duration:50,easing:"linear",pseudoElement:"::before"}]],headline:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]],content:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]],actions:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]]},ue=Wt(ct);class ve extends ue{get open(){return this.isOpen}set open(t){t!==this.isOpen&&(this.isOpen=t,t?(this.setAttribute("open",""),this.show()):(this.removeAttribute("open"),this.close()))}constructor(){super(),this.quick=!1,this.returnValue="",this.noFocusTrap=!1,this.getOpenAnimation=()=>he,this.getCloseAnimation=()=>pe,this.isOpen=!1,this.isOpening=!1,this.isConnectedPromise=this.getIsConnectedPromise(),this.isAtScrollTop=!1,this.isAtScrollBottom=!1,this.nextClickIsFromContent=!1,this.hasHeadline=!1,this.hasActions=!1,this.hasIcon=!1,this.escapePressedWithoutCancel=!1,this.treewalker=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT),this.addEventListener("submit",this.handleSubmit)}async show(){var t;this.isOpening=!0,await this.isConnectedPromise,await this.updateComplete;const e=this.dialog;if(e.open||!this.isOpening)return void(this.isOpening=!1);if(!this.dispatchEvent(new Event("open",{cancelable:!0})))return this.open=!1,void(this.isOpening=!1);e.showModal(),this.open=!0,this.scroller&&(this.scroller.scrollTop=0),null===(t=this.querySelector("[autofocus]"))||void 0===t||t.focus(),await this.animateDialog(this.getOpenAnimation()),this.dispatchEvent(new Event("opened")),this.isOpening=!1}async close(t=this.returnValue){if(this.isOpening=!1,!this.isConnected)return void(this.open=!1);await this.updateComplete;const e=this.dialog;if(!e.open||this.isOpening)return void(this.open=!1);const i=this.returnValue;this.returnValue=t;this.dispatchEvent(new Event("close",{cancelable:!0}))?(await this.animateDialog(this.getCloseAnimation()),e.close(t),this.open=!1,this.dispatchEvent(new Event("closed"))):this.returnValue=i}connectedCallback(){super.connectedCallback(),this.isConnectedPromiseResolve()}disconnectedCallback(){super.disconnectedCallback(),this.isConnectedPromise=this.getIsConnectedPromise()}render(){const t=this.open&&!(this.isAtScrollTop&&this.isAtScrollBottom),e={"has-headline":this.hasHeadline,"has-actions":this.hasActions,"has-icon":this.hasIcon,scrollable:t,"show-top-divider":t&&!this.isAtScrollTop,"show-bottom-divider":t&&!this.isAtScrollBottom},i=this.open&&!this.noFocusTrap,o=j` + + `,{ariaLabel:s}=this;return j` +
    + + ${i?o:W} +
    +
    + +

    + +

    + +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    + ${i?o:W} +
    + `}firstUpdated(){this.intersectionObserver=new IntersectionObserver((t=>{for(const e of t)this.handleAnchorIntersection(e)}),{root:this.scroller}),this.intersectionObserver.observe(this.topAnchor),this.intersectionObserver.observe(this.bottomAnchor)}handleDialogClick(){if(this.nextClickIsFromContent)return void(this.nextClickIsFromContent=!1);!this.dispatchEvent(new Event("cancel",{cancelable:!0}))||this.close()}handleContentClick(){this.nextClickIsFromContent=!0}handleSubmit(t){const e=t.target,{submitter:i}=t;"dialog"===e.getAttribute("method")&&i&&this.close(i.getAttribute("value")??this.returnValue)}handleCancel(t){if(t.target!==this.dialog)return;this.escapePressedWithoutCancel=!1;const e=!de(this,t);t.preventDefault(),e||this.close()}handleClose(){var t;this.escapePressedWithoutCancel&&(this.escapePressedWithoutCancel=!1,null===(t=this.dialog)||void 0===t||t.dispatchEvent(new Event("cancel",{cancelable:!0})))}handleKeydown(t){"Escape"===t.key&&(this.escapePressedWithoutCancel=!0,setTimeout((()=>{this.escapePressedWithoutCancel=!1})))}async animateDialog(t){var e;if(null===(e=this.cancelAnimations)||void 0===e||e.abort(),this.cancelAnimations=new AbortController,this.quick)return;const{dialog:i,scrim:o,container:s,headline:r,content:n,actions:a}=this;if(!(i&&o&&s&&r&&n&&a))return;const{container:l,dialog:d,scrim:c,headline:h,content:p,actions:u}=t,v=[[i,d??[]],[o,c??[]],[s,l??[]],[r,h??[]],[n,p??[]],[a,u??[]]],m=[];for(const[t,e]of v)for(const i of e){const e=t.animate(...i);this.cancelAnimations.signal.addEventListener("abort",(()=>{e.cancel()})),m.push(e)}await Promise.all(m.map((t=>t.finished.catch((()=>{})))))}handleHeadlineChange(t){const e=t.target;this.hasHeadline=e.assignedElements().length>0}handleActionsChange(t){const e=t.target;this.hasActions=e.assignedElements().length>0}handleIconChange(t){const e=t.target;this.hasIcon=e.assignedElements().length>0}handleAnchorIntersection(t){const{target:e,isIntersecting:i}=t;e===this.topAnchor&&(this.isAtScrollTop=i),e===this.bottomAnchor&&(this.isAtScrollBottom=i)}getIsConnectedPromise(){return new Promise((t=>{this.isConnectedPromiseResolve=t}))}handleFocusTrapFocus(t){const[e,i]=this.getFirstAndLastFocusableChildren();var o;if(!e||!i)return void(null===(o=this.dialog)||void 0===o||o.focus());const s=t.target===this.firstFocusTrap,r=!s,n=t.relatedTarget===e,a=t.relatedTarget===i,l=!n&&!a;if(r&&a||s&&l)return void e.focus();(s&&n||r&&l)&&i.focus()}getFirstAndLastFocusableChildren(){if(!this.treewalker)return[null,null];let t=null,e=null;for(this.treewalker.currentNode=this.treewalker.root;this.treewalker.nextNode();){const i=this.treewalker.currentNode;me(i)&&(t||(t=i),e=i)}return[t,e]}}function me(t){var e;const i=":not(:disabled,[disabled])";if(t.matches(":is(button,input,select,textarea,object,:is(a,area)[href],[tabindex],[contenteditable=true])"+i+':not([tabindex^="-"])'))return!0;return!!t.localName.includes("-")&&(!!t.matches(i)&&((null===(e=t.shadowRoot)||void 0===e?void 0:e.delegatesFocus)??!1))}t([mt({type:Boolean})],ve.prototype,"open",null),t([mt({type:Boolean})],ve.prototype,"quick",void 0),t([mt({attribute:!1})],ve.prototype,"returnValue",void 0),t([mt()],ve.prototype,"type",void 0),t([mt({type:Boolean,attribute:"no-focus-trap"})],ve.prototype,"noFocusTrap",void 0),t([bt("dialog")],ve.prototype,"dialog",void 0),t([bt(".scrim")],ve.prototype,"scrim",void 0),t([bt(".container")],ve.prototype,"container",void 0),t([bt(".headline")],ve.prototype,"headline",void 0),t([bt(".content")],ve.prototype,"content",void 0),t([bt(".actions")],ve.prototype,"actions",void 0),t([ft()],ve.prototype,"isAtScrollTop",void 0),t([ft()],ve.prototype,"isAtScrollBottom",void 0),t([bt(".scroller")],ve.prototype,"scroller",void 0),t([bt(".top.anchor")],ve.prototype,"topAnchor",void 0),t([bt(".bottom.anchor")],ve.prototype,"bottomAnchor",void 0),t([bt(".focus-trap")],ve.prototype,"firstFocusTrap",void 0),t([ft()],ve.prototype,"hasHeadline",void 0),t([ft()],ve.prototype,"hasActions",void 0),t([ft()],ve.prototype,"hasIcon",void 0);const fe=n`:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:"";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));flex:1;font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}} +`;class ge extends ve{}ge.styles=[fe],customElements.define("ew-dialog",ge);const be=n` + :host { + --roboto-font: Roboto, system-ui; + --text-color: rgba(0, 0, 0, 0.6); + --danger-color: #db4437; + + --md-sys-color-primary: #03a9f4; + --md-sys-color-on-primary: #fff; + --md-ref-typeface-brand: var(--roboto-font); + --md-ref-typeface-plain: var(--roboto-font); + + --md-sys-color-surface: #fff; + --md-sys-color-surface-container: #fff; + --md-sys-color-surface-container-high: #fff; + --md-sys-color-surface-container-highest: #f5f5f5; + --md-sys-color-secondary-container: #e0e0e0; + + --md-sys-typescale-headline-font: var(--roboto-font); + --md-sys-typescale-title-font: var(--roboto-font); + } + + a { + color: var(--md-sys-color-primary); + } +`;export{at as B,ae as D,W as E,q as T,t as _,n as a,bt as b,Ot as c,Kt as d,gt as e,Jt as f,te as g,Qt as h,ct as i,de as j,Xt as k,Rt as l,Wt as m,mt as n,yt as o,kt as p,It as q,ft as r,le as s,pt as t,Tt as u,zt as v,V as w,j as x,be as y}; diff --git a/site/templates/404.html b/site/templates/404.html new file mode 100644 index 0000000..120766a --- /dev/null +++ b/site/templates/404.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% block title %}Not found: roro9stack{% endblock %} +{% block main %} +
    +

    Not found.

    +

    There's no page here. Try the home page, Install or Downloads.

    +
    +{% endblock main %} diff --git a/site/templates/base.html b/site/templates/base.html new file mode 100644 index 0000000..2114593 --- /dev/null +++ b/site/templates/base.html @@ -0,0 +1,59 @@ + + + + + +{% block title %}roro9stack: open firmware for the Cardputer ADV{% endblock %} + + + + +{% if current_url %}{% endif %} + + + + + +{% block head %}{% endblock %} + + + + +
    + + + + + +
    + +
    +{% block main %}{% endblock %} +
    + +
    +
    +
    + © 2026 Clément Martin · Licensed GPL-3.0 + +
    + roro9stack is an independent project. It isn't affiliated with or endorsed by M5Stack or Meshtastic: those names belong to their owners. + This site sets no cookies and has no analytics, and its pages load nothing from other sites. The Install page asks the project's own server, git.twis.la, for the latest release. Questions, corrections: {{ config.extra.contact }}, or the issue tracker. +
    +
    + + diff --git a/site/templates/downloads.html b/site/templates/downloads.html new file mode 100644 index 0000000..7416c7f --- /dev/null +++ b/site/templates/downloads.html @@ -0,0 +1,34 @@ +{% extends "base.html" %} +{% block title %}Downloads: roro9stack{% endblock %} +{% block description %}{{ page.description }}{% endblock %} +{% block main %} +{% set releases = load_data(url=config.extra.api ~ "/releases?limit=30&draft=false&pre-release=false", format="json", required=false) %} +
    +
    + Downloads +

    {{ page.title }}

    +

    {{ page.description }} To put one on a device, install it from your browser.

    +
    + +
    +

    Each release has a signed update file (.ota: copy it to /updates on the SD card and install it from Settings → Firmware or the Storage App, or push it over Wi-Fi), a factory image (-factory.bin, the whole flash at offset 0 for a first install over USB), the symbols (.elf.gz, to decode a crash report) and SHA256SUMS. Debug Builds aren't published.

    +
    + + {% if releases %} +
    + {% for r in releases %} +
    +

    {{ r.tag_name }}

    +

    {{ r.published_at | date(format="%Y-%m-%d") }} · release notes

    +

    {{ r.body | split(pat="\n\n") | first }}

    +

    + {% for a in r.assets %}{{ a.name }} ({{ a.size | filesizeformat }}){% endfor %} +

    +
    + {% endfor %} +
    + {% else %} +

    The list of releases couldn't be read when this page was built. They're all on Gitea.

    + {% endif %} +
    +{% endblock main %} diff --git a/site/templates/illustrations/sky.html b/site/templates/illustrations/sky.html new file mode 100644 index 0000000..df0527a --- /dev/null +++ b/site/templates/illustrations/sky.html @@ -0,0 +1 @@ +GNSSSKYPOSITIONNSWESNR diff --git a/site/templates/illustrations/sweep.html b/site/templates/illustrations/sweep.html new file mode 100644 index 0000000..effa385 --- /dev/null +++ b/site/templates/illustrations/sweep.html @@ -0,0 +1 @@ +SNIFFERSWEEPCAPSWL863866.5870 MHz diff --git a/site/templates/index.html b/site/templates/index.html new file mode 100644 index 0000000..e44beda --- /dev/null +++ b/site/templates/index.html @@ -0,0 +1,139 @@ +{% extends "base.html" %} +{% block main %} +{% set latest = load_data(url=config.extra.api ~ "/releases/latest", format="json", required=false) %} +{% set apps = load_data(path="data/apps.toml", format="toml") %} +{% set screens = load_data(path="data/screens.toml", format="toml") %} +{% set px = [0,1,1,1,0, 1,0,0,0,1, 1,0,0,0,1, 0,1,1,1,1, 0,0,0,0,1, 0,0,0,0,1, 0,1,1,1,0] %} + +
    +
    +
    +
    Open firmware · GPL-3.0{% if latest %} · {{ latest.tag_name }}{% endif %}
    +

    Open firmware for a pocket computer.

    +
    +
    +

    roro9stack is firmware for the M5Stack Cardputer ADV with the Cap LoRa-1262: a LoRa scanner that reads Meshtastic traffic, GNSS, IRC, a Gemini browser, Wi-Fi tools, notes and more.

    + +
      +
    • GPL-3.0
    • +
    • Docker-only build
    • +
    • Signed updates
    • +
    +
    +
    +
    +
    {% include "illustrations/sweep.html" %}
    +
    {% include "illustrations/sky.html" %}
    +
    +

    Drawings of the LoRa Scanner's Sweep view and the GNSS sky view, not screenshots: the real screens are further down.

    +
    + +
    +
    +

    Where it stands

    +

    Early software{% if latest %}, {{ latest.tag_name }}{% endif %}. The radio listens; it doesn't transmit yet. Sending and reading mesh messages is planned and waits for a second node to test with. The milestones show what's done and what's next.

    +
    +
    + +
    +
    + Before you start +

    What you need.

    +
    +
      +
    • An M5Stack Cardputer ADVThe handheld the firmware runs on.
    • +
    • The Cap LoRa-1262The LoRa Scanner and GNSS need it. The other Apps don't use it.
    • +
    • A microSD cardFor Notes, Storage, Logs, Captures and Tracks.
    • +
    • Wi-FiFor IRC, Gemini and updates.
    • +
    • A computer, for the first installChrome or Edge, and a USB-C cable. After that the device updates itself.
    • +
    +
    + +
    +
    + What's inside +

    Apps for the radio, the web and the card.

    +
    +
    + {% for a in apps.app %} +
    + +
    {{ a.tag }}{{ a.num }}
    +

    {{ a.title }}

    +

    {{ a.text }}

    + {{ a.fact }} +
    + {% endfor %} +
    +

    Plus Settings, with its Wi-Fi and Firmware pages.

    +
    + +
    +
    + On the device +

    The real screens.

    +
    +
    + {% for s in screens.screen %} +
    + {{ s.alt }} +
    {{ s.caption }}
    +
    + {% endfor %} +
    +
    + +
    +
    +
    + Updates +

    Update over Wi-Fi. It rolls back if it fails.

    +

    Install a new release from the project's server in Settings, from the SD card, or push one from your computer. Every update is signed: the device checks the signature before it writes anything, restarts, and runs the new firmware on Probation. If it crashes, or can't reconnect Wi-Fi, it goes back to the previous firmware and says so.

    +
    $ scripts/flash.sh --ota 10.39.39.12
    +
    +
    +
    60 s

    The longest the device waits for you to stop typing before it restarts into an update.

    +
    3 min

    How long new firmware has to reconnect Wi-Fi on Probation before it rolls back.

    +
    3

    Crash restarts in a row, and it starts in Safe Mode: only Wi-Fi, updates and the Debug Console, so a fix can still be pushed.

    +
    +
    +
    + +
    +
    + Build and flash +

    Only Docker needed.

    +

    PlatformIO and the ESP32 toolchain run in a container. The first build downloads about 1 GB; after that, builds take under a minute.

    +

    If the upload can't connect, hold G0, the button next to the screen, while plugging in USB, then retry.

    +

    Prefer a ready-made build? Install it from your browser, or take the factory image and the signed update file from the downloads.

    +
    +
    +
    # run the tests, then build
    +
    $ scripts/ci.sh
    +
    +
    # flash over USB-C
    +
    $ scripts/flash.sh
    +
    +
    # or update over Wi-Fi
    +
    $ scripts/flash.sh --ota 10.39.39.12
    +
    +
    + +
    +
    +
    +

    Open source, GPL-3.0.

    +

    Read the code, flash it, send a patch.

    + +
    + +
    +
    +{% endblock main %} diff --git a/site/templates/install.html b/site/templates/install.html new file mode 100644 index 0000000..b90f5af --- /dev/null +++ b/site/templates/install.html @@ -0,0 +1,37 @@ +{% extends "base.html" %} +{% block title %}Install roro9stack: flash a Cardputer ADV from your browser{% endblock %} +{% block description %}{{ page.description }}{% endblock %} +{% block head %} + + +{% endblock %} +{% block main %} +
    +
    + Install +

    {{ page.title }}

    +

    {{ page.description }}

    +
    + +
    +

    Install from your browser

    +

    Looking for the latest release…

    + + + +
    + +
    + {{ page.content | safe }} +
    +
    +{% endblock main %} diff --git a/site/tools/check_site.py b/site/tools/check_site.py new file mode 100755 index 0000000..ed08888 --- /dev/null +++ b/site/tools/check_site.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 +"""Checks a built site (docs/milestones/W1.md): what the pages promise, kept. + +Usage: site/tools/check_site.py + +- No page loads anything from another origin: no script, stylesheet, image, font, frame or preload + from elsewhere (links a visitor follows are fine). +- Every page has a title, a description and a language, and every image has an alt attribute. +- Every file a page references on this site exists. +""" +import html.parser +import os +import re +import sys +import urllib.parse + +ROOT = sys.argv[1] if len(sys.argv) > 1 else "public" +HERE = os.path.dirname(os.path.abspath(__file__)) +BASE = re.search(r'base_url\s*=\s*"([^"]+)"', open(os.path.join(HERE, "..", "config.toml")).read()).group(1) +HOST = urllib.parse.urlparse(BASE).netloc + + +class Page(html.parser.HTMLParser): + def __init__(self): + super().__init__() + self.title = False + self.has_title = False + self.has_description = False + self.lang = None + self.loads = [] # (tag, url) of everything the page fetches by itself + self.images_without_alt = 0 + + def handle_starttag(self, tag, attrs): + a = dict(attrs) + if tag == "html": + self.lang = a.get("lang") + if tag == "title": + self.title = True + if tag == "meta" and a.get("name") == "description" and a.get("content"): + self.has_description = True + if tag in ("script", "img", "iframe", "frame", "embed", "source", "video", "audio") and a.get("src"): + self.loads.append((tag, a["src"])) + if tag == "link" and a.get("href") and a.get("rel", "") in ("stylesheet", "preload", "icon", "modulepreload", "prefetch"): + self.loads.append(("link " + a["rel"], a["href"])) + if tag == "img" and "alt" not in a: + self.images_without_alt += 1 + + def handle_data(self, data): + if self.title and data.strip(): + self.has_title = True + + def handle_endtag(self, tag): + if tag == "title": + self.title = False + + +problems = [] +pages = 0 +for folder, _, files in os.walk(ROOT): + for name in files: + if not name.endswith(".html"): + continue + path = os.path.join(folder, name) + shown = os.path.relpath(path, ROOT) + p = Page() + p.feed(open(path, encoding="utf-8").read()) + pages += 1 + if not p.has_title: problems.append(f"{shown}: no title") + if not p.has_description: problems.append(f"{shown}: no description") + if not p.lang: problems.append(f"{shown}: no language") + if p.images_without_alt: problems.append(f"{shown}: {p.images_without_alt} image(s) without alt") + for tag, url in p.loads: + u = urllib.parse.urlparse(url) + if u.netloc and u.netloc != HOST: + problems.append(f"{shown}: {tag} loads {url} from another origin") + elif not u.netloc and not u.scheme: + target = os.path.join(ROOT, u.path.lstrip("/")) if u.path.startswith("/") else os.path.join(folder, u.path) + if u.path and not os.path.exists(target): + problems.append(f"{shown}: {tag} {url} does not exist") + elif u.netloc == HOST: + target = os.path.join(ROOT, u.path.lstrip("/")) + if not os.path.exists(target): + problems.append(f"{shown}: {tag} {url} does not exist") + +if not pages: + problems.append(f"no pages found in {ROOT}") +for p in problems: + print("site check:", p) +print(f"site check: {pages} pages, {len(problems)} problem(s)") +sys.exit(1 if problems else 0) diff --git a/site/tools/make_illustrations.py b/site/tools/make_illustrations.py new file mode 100755 index 0000000..516ea62 --- /dev/null +++ b/site/tools/make_illustrations.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python3 +"""Writes the two illustrations on the home page (templates/illustrations/sweep.html and sky.html, inline SVG for Zola to include). + +They are drawings of the LoRa Scanner's Sweep view and the GNSS App's sky view on the Cardputer, +not screenshots, and the page says so. Every colour is one of the device's own (RGB332). The shapes +come from a deterministic generator, so running this again gives the same files: + + python3 site/tools/make_illustrations.py +""" +import math +import os + +HERE = os.path.dirname(os.path.abspath(__file__)) +OUT = os.path.join(HERE, "..", "templates", "illustrations") + +BLACK, SLATE, DIM, CYAN, MAG, WHITE, LABEL, ONFILL = "#000000", "#494955", "#6d6d55", "#00dbff", "#ff00ff", "#ffffff", "#b6dbff", "#000055" +ORANGE = "#ff9200" + + +def notch(x, y, w, h, n): + """A rectangle with its corners cut in two steps of n/2 (the site's .n-sm, .n-md and .n-lg).""" + a, b = n, n // 2 + pts = [(0, a), (b, a), (b, b), (a, b), (a, 0), (w - a, 0), (w - a, b), (w - b, b), (w - b, a), (w, a), (w, h - a), + (w - b, h - a), (w - b, h - b), (w - a, h - b), (w - a, h), (a, h), (a, h - b), (b, h - b), (b, h - a), (0, h - a)] + return " ".join(f"{x + px:g},{y + py:g}" for px, py in pts) + + +def rnd(n): + x = math.sin(n * 127.1 + 311.7) * 43758.5453 + return x - math.floor(x) + + +def jsround(v): + return math.floor(v + 0.5) + + +SOURCES = [(5, 0.72, 0.9), (13.5, 0.58, 1.2), (22, 0.95, 1.0), (27, 0.42, 0.8)] + + +def strength(i, r): + s = 0.05 + 0.1 * rnd(i * 7 + r * 13) + for k, (c, a, w) in enumerate(SOURCES): + if rnd(k * 10 + r) > 0.2: + g = math.exp(-((i - c) ** 2) / (2 * w * w)) + s = max(s, a * g * (0.6 + 0.4 * rnd(i * 3 + r * 5 + k))) + return min(s, 1) + + +def frame(parts, label): + keys_y = 306 + kw = (480 - 13 * 4) / 14 + keys = [] + for row in range(4): + for col in range(14): + x, y = 20 + col * (kw + 4), keys_y + row * 26 + keys.append(f'') + return ( + f'' + f'' + f'' + + "".join(parts) + "".join(keys) + "\n" + ) + + +def label(x, y, text, fill, anchor="start", weight=400, spacing=0.08): + return (f'{text}') + + +def sweep(): + p = [] + # Tabs and Status Bar letters + p.append(label(40, 44, "SNIFFER", LABEL, weight=500)) + p.append(f'') + p.append(label(112, 44, "SWEEP", ONFILL, weight=500)) + p.append(label(488, 44, "CAP", LABEL, "end", 500)) + p.append(label(457, 44, "SW", CYAN, "end", 500)) + p.append(label(434, 44, "L", CYAN, "end", 500)) + # Bars with peak hold + p.append(f'') + colw = (448 - 31 * 2) / 32 + for i in range(32): + s = strength(i, 0) + h = max(4, jsround(s * 100 / 4) * 4) + gap = jsround(rnd(i * 11 + 3) * 3) * 4 + gap = min(gap, 112 - h - 4 if 112 - h - 4 > 0 else 0) + x = 36 + i * (colw + 2) + p.append(f'') + p.append(f'') + # Waterfall, newest row on top + p.append(f'') + for r in range(6): + for i in range(32): + s = strength(i, r + 1) + if s < 0.3: + continue + color = CYAN if s < 0.6 else MAG if s < 0.85 else WHITE + p.append(f'') + p.append(label(32, 276, "863", LABEL, spacing=0)) + p.append(label(260, 276, "866.5", LABEL, "middle", spacing=0)) + p.append(label(488, 276, "870 MHz", LABEL, "end", spacing=0)) + return frame(p, "Illustration of the Cardputer showing the LoRa Scanner's Sweep view: bars of signal strength from 863 to 870 MHz with peak marks, and a waterfall under them") + + +def sky(): + p = [] + p.append(label(32, 44, "GNSS", WHITE, weight=500)) + p.append(f'') + p.append(label(457.5, 44, "SKY", ONFILL, weight=500)) + p.append(label(445.5, 44, "POSITION", LABEL, "end", 500)) + p.append(f'') + ox, oy, CELL, NC, CC = 48, 86, 5, 33, 16 + for y in range(NC): + for x in range(NC): + dx, dy = x - CC, y - CC + d = math.sqrt(dx * dx + dy * dy) + if any(abs(d - R) <= 0.5 for R in (15, 10, 5)): + color = DIM + elif (dx == 0 or dy == 0) and d < 15 and abs(dx + dy) % 2 == 0 and d > 0: + color = SLATE + else: + continue + p.append(f'') + cols = [CYAN, MAG, ORANGE, WHITE] + sats = [(20, 70, 0.8, 0), (75, 40, 0.6, 1), (130, 25, 0.35, 2), (160, 60, 0.9, 0), (210, 15, 0.25, 3), (250, 50, 0.7, 1), + (290, 30, 0.5, 0), (320, 75, 0.85, 2), (345, 35, 0.55, 1)] + for az, el, snr, ci in sats: + r = (90 - el) / 90 * 15 + a = az * math.pi / 180 + cx, cy = jsround(CC + r * math.sin(a)), jsround(CC - r * math.cos(a)) + p.append(f'') + p.append(f'') + p.append(label(ox + 82.5, 80, "N", MAG, "middle", 500, 0)) + p.append(label(ox + 82.5, 265, "S", LABEL, "middle", 500, 0)) + p.append(label(ox - 14, 172, "W", LABEL, "start", 500, 0)) + p.append(label(ox + 165 + 14, 172, "E", LABEL, "end", 500, 0)) + # Signal strength of each satellite + p.append(label(237, 107, "SNR", LABEL, weight=500)) + bw = (235 - 8 * 6) / 9 + for i, (az, el, snr, ci) in enumerate(sats): + h = max(8, jsround(snr * 124 / 4) * 4) + p.append(f'') + return frame(p, "Illustration of the GNSS App's sky view: the satellites' positions in a circle, and the signal strength of each as a bar") + + +if __name__ == "__main__": + os.makedirs(OUT, exist_ok=True) + for name, svg in (("sweep.html", sweep()), ("sky.html", sky())): + with open(os.path.join(OUT, name), "w") as f: + f.write(svg) + print(name, len(svg), "bytes")