diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe7dae8..ad4b86e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: version: ${{ steps.version.outputs.version }} steps: - name: Checkout - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -63,14 +63,14 @@ jobs: - { type: apk, sdk: 'itdoginfo/openwrt-sdk-apk:25.12.3@sha256:6d832008ddd1b8ec4edc84f5e6e0bf22a13ba2d6888083a8e69fa26d752c276f' } steps: - name: Checkout - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Setup Node.js - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: - node-version: '22' + node-version: '26' cache: npm cache-dependency-path: web/package-lock.json @@ -87,7 +87,7 @@ jobs: run: scripts/build-packages.sh ${{ matrix.type }} - name: Upload - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: package-${{ matrix.type }} # The app and its translation packages (luci-i18n-dawnline-). @@ -105,7 +105,7 @@ jobs: steps: # The whole history and the tags: the notes list the commits since the previous tag. - name: Checkout - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false fetch-depth: 0 @@ -116,7 +116,7 @@ jobs: cat notes.md - name: Download packages - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: pattern: package-* path: release @@ -129,7 +129,7 @@ jobs: cat sha256sums.txt - name: Publish the release - uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2 + uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: name: Dawnline ${{ github.ref_name }} tag_name: ${{ github.ref_name }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef87b38..cb83c3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,14 +24,14 @@ jobs: working-directory: web steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Setup Node.js - uses: actions/setup-node@v5 + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: - node-version: '22' + node-version: '26' cache: npm cache-dependency-path: web/package-lock.json @@ -51,6 +51,20 @@ jobs: id: types run: npm run --silent typecheck + # oxlint's correctness rules: what the types let through (a stray expression, a needless escape). + - name: Lint + id: lint + run: npm run --silent lint + + # Exports nobody imports, files nobody reaches, dependencies used but not listed (or listed but unused). + - name: Unused code + id: knip + run: | + if ! npm run --silent knip; then + echo "::error::knip found unused code or a dependency problem: remove it, or drop the export when only its own file uses it." + exit 1 + fi + # The catalogs follow the code: every string collected, translated, its placeholders kept. - name: Translations id: i18n @@ -64,17 +78,17 @@ jobs: id: tests run: npm test - # The bundles under package/ are committed: a build must change nothing - # and leave no new file behind (an output nobody added to git would be - # missing from the package). - - name: Build bundles and check they are committed + # The bundles under package/ are not committed (build.yml builds them + # before packaging): a build must touch no tracked file and leave every + # output it writes ignored by .gitignore, so none ends up in a commit. + - name: Build bundles and check they stay out of git id: build run: | npm run --silent build changed="$(git status --porcelain --untracked-files=all -- ../package)" if [ -n "$changed" ]; then echo "$changed" - echo "::error::The committed bundles are out of date or the build left new files. Run 'npm run build' in web/ and commit the result." + echo "::error::The build changed a tracked file under package/ or wrote one .gitignore does not cover." exit 1 fi @@ -88,6 +102,8 @@ jobs: echo "|---|---|" echo "| Formatting | ${{ steps.format.outcome }} |" echo "| Types | ${{ steps.types.outcome }} |" + echo "| Lint | ${{ steps.lint.outcome }} |" + echo "| Unused code | ${{ steps.knip.outcome }} |" echo "| Translations | ${{ steps.i18n.outcome }} |" echo "| Tests | ${{ steps.tests.outcome }} |" echo "| Bundles | ${{ steps.build.outcome }} |" @@ -98,7 +114,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -127,7 +143,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -174,7 +190,7 @@ jobs: release: ['24.10', '25.12'] steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.gitignore b/.gitignore index 176e429..b99cfc2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ node_modules/ dist/ .DS_Store web/coverage/ +# The web bundles: web/ builds them (npm run build), CI before packaging. +package/luci-app-dawnline/htdocs/luci-static/resources/dawnline/ +package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/ diff --git a/AGENTS.md b/AGENTS.md index 4e1ae44..6a14dd6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -17,7 +17,7 @@ This repo usually sits inside the router-admin workspace (`../AGENTS.md`). Its r ## Layout - `package/luci-app-dawnline/root/` — what lands on the router: ucode modules in `usr/share/ucode/dawnline/` (`rpc/` for the LuCI backend), the agent and updater in `usr/libexec/dawnline/`, the portal in `usr/share/dawnline/portal/`, the init script, rpcd ACL. -- `web/` — TypeScript sources of the admin UI (`src/admin`) and the portal (`src/portal`), shared code in `src/shared`; the built bundles are committed under `package/`. `web/i18n/` — the string catalogs' tools (`extract.ts`, `po.ts`, `lmo.ts`). +- `web/` — TypeScript sources of the admin UI (`src/admin`) and the portal (`src/portal`), shared code in `src/shared`; `npm run build` writes the bundles under `package/` (git-ignored: CI builds them before packaging). `web/i18n/` — the string catalogs' tools (`extract.ts`, `po.ts`, `lmo.ts`). - `package/luci-app-dawnline/po/` — the admin's catalog (`templates/dawnline.pot`, `ru/dawnline.po`): luci.mk builds the `luci-i18n-dawnline-ru` package from it. The portal's catalog is `web/src/portal/i18n/ru.po`, bundled into the portal. - `install.sh`, `uninstall.sh` — the standalone installer and uninstaller (both have `--dry-run`). - `scripts/` — `lint-ucode.py`, `compile-ucode.sh` (compiles every ucode file of a tree wherever ucode runs), `check-ucode.sh` (the same on the router, without installing), `ucode-container.sh` (compile and unit tests in the OpenWrt rootfs containers CI uses), `deploy.sh` (dev deploy over SSH), `build-packages.sh`, `build-release.sh`, `release-notes.sh`. @@ -27,7 +27,7 @@ This repo usually sits inside the router-admin workspace (`../AGENTS.md`). Its r - `python3 scripts/lint-ucode.py` (use before definition, exports, POSIX regexes, rpcd methods; layering notes are informational). - `scripts/ucode-container.sh` (needs docker): compiles every ucode file and runs `tests/ucode` on OpenWrt 24.10 and 25.12, exactly what CI does. `scripts/check-ucode.sh` compiles on the router instead when there is no docker. New ucode entry points are added to the compile list in `scripts/compile-ucode.sh`, to `lint-ucode.py`, and to the executables list in `.github/workflows/ci.yml`; a pure function gets a case in `tests/ucode/.test.uc`. -- In `web/`: `npm run format:check`, `npm run typecheck` (sources and tests), `npm run i18n:check` (after changing visible text: `npm run i18n`, translate the new entries in each `ru.po`), `npm test`, `npm run build` — and commit the rebuilt bundles and the catalogs (CI fails on a changed or new file under `package/`). +- In `web/`: `npm run format:check`, `npm run typecheck` (sources and tests), `npm run lint` (oxlint), `npm run knip` (unused exports and dependencies), `npm run i18n:check` (after changing visible text: `npm run i18n`, translate the new entries in each `ru.po`), `npm test`, `npm run build` — and commit the catalogs (the bundles stay out of git; CI fails when the build leaves a file under `package/` that `.gitignore` does not cover). - `shellcheck -S warning` for the shell scripts (CI finds them by shebang). - A tag builds only after CI passes on it (`build.yml` calls `ci.yml`). diff --git a/DESIGN.md b/DESIGN.md index d29d54f..cd1eb8a 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -58,160 +58,160 @@ colors: light-qr-bg: "#ffffff" typography: body: - fontFamily: Geist + fontFamily: system-ui fontSize: 15px fontWeight: 400 lineHeight: 22px letterSpacing: -0.011em display-number: - fontFamily: Geist + fontFamily: system-ui fontSize: 36px fontWeight: 600 lineHeight: 40px letterSpacing: -0.045em card-title-alone: - fontFamily: Geist + fontFamily: system-ui fontSize: 22px fontWeight: 500 lineHeight: 28px letterSpacing: -0.03em section-title: - fontFamily: Geist + fontFamily: system-ui fontSize: 20px fontWeight: 500 lineHeight: 28px letterSpacing: -0.025em sheet-title: - fontFamily: Geist + fontFamily: system-ui fontSize: 20px fontWeight: 500 lineHeight: 28px letterSpacing: -0.5px empty-title: - fontFamily: Geist + fontFamily: system-ui fontSize: 18px fontWeight: 500 lineHeight: 24px letterSpacing: -0.02em value: - fontFamily: Geist + fontFamily: system-ui fontSize: 17px fontWeight: 500 lineHeight: 24px letterSpacing: -0.02em fontFeature: '"tnum"' card-title: - fontFamily: Geist + fontFamily: system-ui fontSize: 16px fontWeight: 500 lineHeight: 22px letterSpacing: -0.02em button: - fontFamily: Geist + fontFamily: system-ui fontSize: 16px fontWeight: 500 lineHeight: 22px letterSpacing: -0.015em button-strong: - fontFamily: Geist + fontFamily: system-ui fontSize: 16px fontWeight: 600 lineHeight: 22px letterSpacing: -0.015em input: - fontFamily: Geist + fontFamily: system-ui fontSize: 16px fontWeight: 500 lineHeight: 24px letterSpacing: -0.012em step-title: - fontFamily: Geist + fontFamily: system-ui fontSize: 16px fontWeight: 500 lineHeight: 24px letterSpacing: -0.02em row-title: - fontFamily: Geist + fontFamily: system-ui fontSize: 15px fontWeight: 500 lineHeight: 22px letterSpacing: -0.02em breadcrumb: - fontFamily: Geist + fontFamily: system-ui fontSize: 15px - fontWeight: 400 + fontWeight: 500 lineHeight: 22px letterSpacing: -0.15px question-text: - fontFamily: Geist + fontFamily: system-ui fontSize: 15px fontWeight: 400 lineHeight: 21px desc: - fontFamily: Geist + fontFamily: system-ui fontSize: 14px fontWeight: 400 lineHeight: 20px menu-item: - fontFamily: Geist + fontFamily: system-ui fontSize: 14px fontWeight: 500 lineHeight: 20px toast: - fontFamily: Geist + fontFamily: system-ui fontSize: 14px fontWeight: 500 lineHeight: 20px meta: - fontFamily: Geist + fontFamily: system-ui fontSize: 13px fontWeight: 400 lineHeight: 18px pill-label: - fontFamily: Geist + fontFamily: system-ui fontSize: 13px fontWeight: 600 lineHeight: 18px label-sm: - fontFamily: Geist + fontFamily: system-ui fontSize: 12px fontWeight: 500 lineHeight: 16px tooltip: - fontFamily: Geist + fontFamily: system-ui fontSize: 12px fontWeight: 500 lineHeight: 12px letterSpacing: -0.1px divider-label: - fontFamily: Geist + fontFamily: system-ui fontSize: 12px fontWeight: 500 lineHeight: 22px letterSpacing: 0.06em axis: - fontFamily: Geist + fontFamily: system-ui fontSize: 11px fontWeight: 500 lineHeight: 16px axis-xs: - fontFamily: Geist + fontFamily: system-ui fontSize: 10px fontWeight: 500 lineHeight: 14px calendar-head: - fontFamily: Geist + fontFamily: system-ui fontSize: 9px fontWeight: 600 lineHeight: 10px mono-link: - fontFamily: Geist Mono + fontFamily: ui-monospace fontSize: 13px fontWeight: 400 lineHeight: 22px letterSpacing: 0px mono-code: - fontFamily: Geist Mono + fontFamily: ui-monospace fontSize: 12px fontWeight: 400 lineHeight: 18px @@ -446,12 +446,11 @@ The styles live in `web/src/portal/styles` (tokens in `tokens.css`), the motion The portal is one person's page on a router. -**Lineage.** The look was approved as a mockup (Oct 2026). It borrows from four places: +**Lineage.** The look was approved as a mockup (Oct 2026). It borrows from three places: - **skiper-ui:** skiper21's palette, accent, highlight and tab pill, and skiper103's bouncy accordion; - **iconiqui:** the breadcrumb and the edge fades (dia-text); -- **aicss.dev:** the busy orb, "Orbs B4 Converge"; -- **Vercel's Geist:** the type. +- **aicss.dev:** the busy orb, "Orbs B4 Converge". **Personality.** Calm, dark and tactile. The page is near-black (`#080808`). There are no borders: each layer is a step brighter than the one under it. One sky blue is the only accent. Every other colour means a state. The UI is made of big round shapes (36 px sheets, 28 px cards, pills), and glass icons are the only illustration. @@ -490,7 +489,7 @@ The measured luminance steps are tiny. In dark, raised vs bg is 1.07:1, field vs | Token | Dark | Light | Use | |---|---|---|---| -| `--text` | `#ededed` | `#0b0b0b` | Titles, values, current crumb, bold steps | +| `--text` | `#ededed` | `#0b0b0b` | Titles, values, the breadcrumb's place, bold steps | | `--text-2` | `#8c8c8a` | `#6d6d6b` | Secondary lines: statuses at rest, labels, hints, sheet subs, head values, accordion chevrons | | `--text-3` | `#4f4f4e` | `#a6a6a4` | Faint: counts ("3 of 4"), "OR", axis ends, placeholders, idle picker icons, the limit note, chevrons in badges | @@ -566,9 +565,9 @@ Frosted pane: dark `--gi-a .58 / --gi-b .14` white with a `.5` rim and no edge s ## Typography -**Families:** **Geist** (variable, 100–900) and **Geist Mono**. They are self-hosted as woff2 next to `portal.css` (CSP `font-src 'self'`). Geist ships in Latin and Cyrillic subsets split by `unicode-range`, Geist Mono in Latin. Fallbacks are `-apple-system, system-ui, 'Segoe UI', sans-serif` and `ui-monospace, 'SF Mono', Menlo, monospace`, all with `font-display: swap`. +**Families:** the system's own, nothing downloaded (no `@font-face`, no `font-src` in the CSP). Sans `system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif`: SF Pro on Apple, Segoe UI on Windows (Segoe UI Variable on 11), Roboto on Android, the desktop's sans on Linux. Mono `ui-monospace, 'SF Mono', SFMono-Regular, Menlo, 'Cascadia Mono', Consolas, 'Liberation Mono', 'DejaVu Sans Mono', monospace`: SF Mono in Safari, Menlo in Chrome on a Mac, Cascadia Mono or Consolas on Windows. Both are `--font` and `--mono` in `tokens.css`. -**Base:** `400 15px/22px`, `letter-spacing: -0.011em`, `-webkit-font-smoothing: antialiased`. Body `cursor: default`, because the page is an app, not a document. Fields, the link and the configuration keep the I-beam. +**Base:** `400 15px/22px`, `letter-spacing: -0.011em`, `-webkit-font-smoothing: antialiased`. Body `cursor: default` and `user-select: none`, because the page is an app, not a document: a title, a label or a value is not text to copy. What is typed or copied by hand can be selected, with the I-beam: fields, the mono text (the link, a hostname, a file's name) and the configuration. ### Scale (measured live) @@ -586,7 +585,7 @@ Frosted pane: dark `--gi-a .58 / --gi-b .14` white with a `.5` rim and no edge s | Step title | 16 / 24 | 500 | −0.02em | "1 Get AmneziaVPN" | | Row title | 15 / 22 | 500 | −0.02em | Accordion heads, notice title, month total | | Option title | 15 / 22 | 500 | −0.015em | "LAN Bypass" in its option row | -| Breadcrumb | 15 / 22 | 400 (current 500) | −0.15px | Server › person | +| Breadcrumb | 15 / 22 | 500 | −0.15px | The server's name | | Question text | 15 / 21 | 400 | — | Remove / Reconnect body | | Desc / sub / value line | 14 / 20 | 400 | — | Row descriptions, sheet subs, head values | | Menu item, toast | 14 / 20 | 500 | — | ⋯ menu, toast | @@ -604,7 +603,7 @@ Frosted pane: dark `--gi-a .58 / --gi-b .14` white with a `.5` rim and no edge s - **Tracking tightens as size grows:** −0.011em for body, −0.02em at 15–17 px, −0.025em to −0.045em for titles and numbers. Mono is always `0`. - **Only 400, 500 and 600.** 500 marks a title or a value, 600 marks a filled button, a number on display, a pill or a step number. - **Numbers that change use `.num`** (`tabular-nums`), so a morph or a hover readout never shifts its neighbours. -- **Mono is for things typed or copied by hand:** addresses, links, hostnames, the configuration. Names stay in Geist. +- **Mono is for things typed or copied by hand:** addresses, links, hostnames, the configuration. Names stay in the sans. - **One line where it fits:** names, statuses, crumbs and link rows end in an ellipsis. The full text goes in `title`. - `text-wrap: balance` for short centred paragraphs (first device, "gone" card, secure sheet). `pretty` for left-aligned question text. - **No uppercase** except the "OR" divider. **No ellipsis on buttons**: "Remove", never "Remove…". "…" appears only for progress and truncation. The single exception is another app's own menu label quoted verbatim ("Import Tunnel(s) from File…"). @@ -617,7 +616,7 @@ Frosted pane: dark `--gi-a .58 / --gi-b .14` white with a `.5` rim and no edge s ### Page frame - `.page`: `max-width: 1072px`, centred. The side gutter is `max(16px, safe-area)`. The top is `40px + safe-area-top` and the bottom `112px`, so the end of the scroll clears the bottom fade. -- No navbar. The page opens with a **breadcrumb row**: 32 px high and 32 px above the content. The Dawnline mark sits in a 32 px box (logo 24 px), then `server › person`, then on the right the language pill and the QR knob. +- No navbar. The page opens with a **breadcrumb row**: 32 px high and 32 px above the content. The Dawnline mark sits in a 32 px box (logo 24 px), then the server's name (not the person's: the page is theirs), then on the right the language pill and the QR knob. - **Edge fades** sit above the page and under every overlay: - **top:** 80 px plus the safe area, a `bg → 75% → 0` gradient with `backdrop-filter: blur(12px)` (not on a touch screen, where it would be drawn again on every frame of a scroll), masked `1 → .88 @44% → 0`. It shows only once `scrollY > 2`, so the breadcrumb at rest stays crisp. - **bottom:** 96 px, a plain `bg → transparent` gradient interpolated `in oklab`. @@ -720,8 +719,8 @@ Only the person moves the page: on a phone nothing the page does pulls it up or | 11 | Ends of the way | | 10 | Name chip, badge icon tile, link row knobs | | 9 | File card icon | -| 2.5–4 | Chart bars (2.5 month, 3 spark, 3 calendar cells), meter and hours bar, a field's selection wash (4) | -| 1 | A field's caret and selection handles | +| 2.5–4 | Chart bars (2.5 month, 3 spark, 3 calendar cells), meter and hours bar, a field's and the page's selection wash (4) | +| 1 | A field's caret and selection handles, the page's selection handles | | 999 / 50% | Buttons, pills, chips, toasts, tooltips, the switch / knobs, step numbers, reach marks, the switch's knob, the handles' knobs | ### Shape rules @@ -741,10 +740,10 @@ Measurements are CSS pixels, read live at 1138 px and 375 px. Source files are u ### Breadcrumb · `page/frame.ts` -- **Layout:** a 32 px row with `gap 10`. The mark box is 32 × 32 (logo 24). The path is 15/22 `text-2` with `gap 6` and a 14 px chevron; the current crumb is `text` 500 with `aria-current="page"`. +- **Layout:** a 32 px row with `gap 10`. The mark box is 32 × 32 (logo 24). The place, the server's name, is the one crumb: 15/22 `text` 500 with `aria-current="page"`. The person's name is not shown: the page is theirs, and on a phone it crowded the place out. - **Language pill** (`.cr-lang`, a pick pill: see below): 32 high, pill, `knob` fill, padding `0 8`, gap 6: the language's 16 px flag disc, its 14 px 500 code and a 14 px chevron. Its popup opens under it, 10 px away. - **QR knob** (`.cr-qr`): a knob with the QR icon. It opens into the page's code card where it stands (see below). -- **Truncation:** the crumbs truncate independently, each with its own ellipsis. +- **Truncation:** the place ends in an ellipsis where the row has no room for it. ### Dropdowns · `ui/drop.ts`, `styles/drop.css` @@ -786,6 +785,7 @@ The ⋯ menu, the pick pills' popups and the page code card are one kind of thin | `red` | bad / white | 600 | Remove | - **Size:** 48 high (`.sm` 40, 15 px), pill, padding 0 20 (`.sm` 0 16), gap 8, `.block` = full width. +- **Hover:** a filled one (`accent`, `red`) lets its fill down to 82%, `tint` deepens to accent 20%, `soft` takes text 6% over its knob. - **Press:** `scale(.95)`. No ellipsis, no blue text links for actions. - **Busy:** the button keeps its size. Its content blurs away and the **orb** comes up through the blur in the button's own colour. See *Motion → Busy orb*. @@ -796,6 +796,7 @@ The ⋯ menu, the pick pills' popups and the page code card are one kind of thin - Arrow for create, check for save. The field and its go button are the whole form: no label row, no separate Save. - **Caret** (`ui/caret.ts`, on name fields, with a mouse or trackpad; a touch screen keeps the system's): the input's own is hidden (`caret-color: transparent`) and the field draws one as macOS does: accent, 2 × 20, radius 1. It glides to where the next letter goes (see *Motion → Caret and selection*), and a click puts it where clicked at once. It blinks 0.6 s on / 0.6 s off with soft fades, stays solid while typing and blinks again 0.5 s after the last key. - **Selection** (`pointer: fine` only): the native selection is see-through and the text keeps its colour. Under the text sits an accent 26% wash, 22 high, radius 4, with an iOS handle at each end: a 2 × 22 line with a 9 px knob, on top at the start and under it at the end. A selection grows out of the caret and, on collapse, fades in place before its ends rejoin the caret. It never runs past the input's edges, so a long, scrolled name's wash stops before the go button. On a touch screen the field draws neither: the system's caret shows (in the accent) with its own selection and handles. +- **The page's selection** (`ui/selection.ts`, `pointer: fine` only), where text can be selected (*Typography → Base*): the same look as a field's, drawn over the text instead of under it (it cannot sit under every block's), each band blending so the words keep their colour (`screen` in dark, `multiply` in light, over an opaque `accent 26% on bg`). One band per line run, 2 px taller than its line, radius 4; a handle at each end. It stands on the layer of what holds it (the page under its edge fades, a sheet, a dropdown) and is clipped to what clips or scrolls it there. A press where nothing can be selected lets go of the selection (the browser keeps it over unselectable text, which is most of the page). A touch screen keeps the system's. - **Refusal:** a refused entry makes the field **shake** at once, while a red line under it (`ui/bad-line.ts`) says why in a few words, short enough for one line. - **Shake** (`shared/shake.ts`): iOS's wrong-passcode shake, a damped swing sideways about four times in 0.52 s (14 px at most, settling by half), linear over its frames. The field's outline goes red with it (a 1.5 px inset ring in `bad`, as the focus ring is drawn), holds 0.7 s and fades back to the ring the field has (focused or not) over 0.8 s on ease-out; another refusal starts it red again. Another one starts from where the field is, never jumping back; only its own animation is touched, so the focus ring's transition goes on. With less motion asked for it doesn't move (the red line or toast still says why). @@ -891,6 +892,7 @@ A repaint keeps the rows on the page and changes what they hold in place, the sa - **View:** padding `0 24 24`. - **View head** (`.vhead`): 76 high. Title 20/28 500, centred with a Back knob inside a flow. The head is the drag handle, with `touch-action: none` and a grab cursor. - **Sub line:** 14/20 `text-2`, pulled up 16 px under the head. +- **Scrolling:** what is taller than the screen scrolls inside the sheet with no scrollbar (a bar would cut into its round corners); so does the configuration in it. **Movement:** @@ -1006,7 +1008,7 @@ One choice with a switch (Add a device's **LAN Bypass**). A line that unfolds un ### File card and configuration - **File card:** `field`, radius 18, padding 12. A 38 × 46 "file" icon (radius 9, mono 10 600 ".conf"), the filename in mono 13, a 12 px line, and an accent `sm` block button. Inside an inset row it steps up one (*Accordion → Inset variant*). -- **Configuration:** `pre` 12/18 mono, max-height 16 rem, scrolls. +- **Configuration:** `pre` 12/18 mono, max-height 16 rem, scrolls (no scrollbar, as the sheet). - colours: section headers in accent, keys in `text`, values in `text-2`; - **keys are masked** (`••••` in `text-3`, letter-spaced 1 px) until "Show key". The mask and the key share one place and cross-fade; the one at rest is out of sight. @@ -1016,8 +1018,9 @@ One choice with a switch (Add a device's **LAN Bypass**). A line that unfolds un ### Demo-only pieces · `demo/` (not in the router build) -- "Demo" chip after the crumbs (26 high, accent-soft, 13 px 600). -- GitHub knob (its mark only, 32 px, as the QR knob) before the language pill (hidden below 480 px; a button in the drawer instead). +- **"Demo" and GitHub, one split pill** just before the language pill (`demo/crumbs.ts`): accent-soft, 32 high as the knobs beside it, "Demo" 14 px 600 with a down chevron, then GitHub's mark (38 wide). The halves are 2 px apart; their outer corners are half the height (16), the inner ones 4. Hover (a mouse only) deepens the tint to accent 20%; a press scales a half to 0.94. Over a card alone (no language) "Demo" stands alone after the place: 26 high, round, 13 px. +- **On a phone (< 560 px) the pill is a dock** at the bottom right, 20 px above the safe area, since the breadcrumb has no room for it. It lives in ``, outside the page: the page's entrance and a scenario's swap move the page with a transform and a filter, which would carry a fixed child along and leave its glass undrawn until they end. Glass (`--glass-bg`, blur 28 saturate 1.8, the glass edge), 36 high, "Demo" with an up chevron, GitHub 40 wide; the halves 2 px apart, corners 18 outside and 5 inside. Over the bottom fade, under the sheets (z 40). It rises from under the screen's edge (620 ms, EASE_OUT, 260 ms into the first wave) on a transform alone: Safari leaves a backdrop blur undrawn while the element's opacity is animating. Hover is a 7% film over the glass, never in place of it. +- A scenario's swap dims and blurs `.page`, not `#app`: a filter on `#app` would carry the fixed edge fades along until it ends. - Scenario drawer: grouped rows on `field`, 2 px apart inside a radius-20 group, 60 px min, glass 30; the current row in accent with a check. --- @@ -1383,6 +1386,7 @@ The ring does not travel: the old tile's ring fades and the new tile's ring draw | Caret blink | solid while it moves or they type; 0.5 s after the last key, 0.6 s on / 0.6 s off with soft fades (`caret-blink`); its on/off fade | 1200 ease-in-out loop; 100 linear | | Selection | grows out of the caret: both edges start where the caret is and ride the caret's spring; the wash and handles fade in. A wash still fading from the last selection turns back instead and glides from its old ends to the new ones. | 140 linear | | Selection collapses | the wash fades where it stands (no slide), then its ends rejoin the caret | 140 linear, the ends at 160 ms | +| The page's selection (`ui/selection.ts`) | as a field's: each line's ends ride the caret's spring; a new selection grows out of where it started, a line it reaches grows from the side it is reached from; on collapse it fades where it stands. Checked every frame while it shows: when the text moves or goes with no event (a scroll, a fold, a sheet's view or the sheet shut) it goes along at once, or fades where none of it shows | 140 linear, gone at 160 ms | #### 15. Other moments diff --git a/README.md b/README.md index a34b91c..4855ea1 100644 --- a/README.md +++ b/README.md @@ -400,7 +400,7 @@ scripts/ build, deploy and check scripts cd web npm ci npm run format # Prettier -npm run ci # format check, types, catalogs, tests, minified bundles +npm run ci # format check, types, lint, unused code, catalogs, tests, minified bundles npm run i18n # collect new strings into the catalogs (then translate them in ru.po) scripts/lint-ucode.py # static ucode checks @@ -412,8 +412,9 @@ scripts/capture-portal.mjs # the portal's from its demo, in Englis scripts/frame-screenshots.py # frame them for this README ``` -The web bundles and the catalogs are committed: CI fails when they are out of -date or a string is untranslated (`rules/i18n.md`). Pushing a tag `vX.Y.Z` +The web bundles are built, not committed (`npm run build` before +`scripts/build-packages.sh`); the catalogs are committed, and CI fails when they +are out of date or a string is untranslated (`rules/i18n.md`). Pushing a tag `vX.Y.Z` (matching `PKG_VERSION`) builds the packages and their translations with the OpenWrt SDK and publishes a release with `sha256sums.txt`. diff --git a/README_ru.md b/README_ru.md index ab0e036..0dd5872 100644 --- a/README_ru.md +++ b/README_ru.md @@ -404,7 +404,7 @@ scripts/ скрипты сборки, деплоя и cd web npm ci npm run format # Prettier -npm run ci # форматирование, типы, каталоги, тесты, минифицированные бандлы +npm run ci # форматирование, типы, линтер, неиспользуемый код, каталоги, тесты, бандлы npm run i18n # собрать новые строки в каталоги (затем перевести их в ru.po) scripts/lint-ucode.py # статические проверки ucode @@ -416,8 +416,9 @@ scripts/capture-portal.mjs # скриншоты портала д scripts/frame-screenshots.py # оформить их для README ``` -Бандлы и каталоги лежат в репозитории: CI падает, если они устарели или строка -не переведена (`rules/i18n.md`). Тег `vX.Y.Z` (совпадающий с `PKG_VERSION`) +Бандлы не лежат в репозитории, они собираются (`npm run build` перед +`scripts/build-packages.sh`); каталоги лежат, и CI падает, если они устарели или +строка не переведена (`rules/i18n.md`). Тег `vX.Y.Z` (совпадающий с `PKG_VERSION`) собирает пакеты и переводы в OpenWrt SDK и публикует релиз с `sha256sums.txt`. --- diff --git a/build/Dockerfile b/build/Dockerfile index d4128ce..c542ebd 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,7 +1,7 @@ # Builds luci-app-dawnline with the OpenWrt SDK. # docker build -f build/Dockerfile --build-arg SDK_IMAGE=itdoginfo/openwrt-sdk-ipk:24.10.6 . -# The web bundles (htdocs/.../app.js, portal assets) are built by npm first and -# committed; the SDK only packs files, so the package is the same on every arch. +# The web bundles (htdocs/.../app.js, portal assets) are built by npm first +# (not committed); the SDK only packs files, so the package is the same on every arch. ARG SDK_IMAGE=itdoginfo/openwrt-sdk-ipk:24.10.6 FROM ${SDK_IMAGE} diff --git a/package/luci-app-dawnline/Makefile b/package/luci-app-dawnline/Makefile index a72824c..cbc4cca 100644 --- a/package/luci-app-dawnline/Makefile +++ b/package/luci-app-dawnline/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-dawnline -PKG_VERSION:=0.15.1 +PKG_VERSION:=0.16.0 PKG_RELEASE:=1 PKG_LICENSE:=MIT # po//dawnline.po becomes luci-i18n-dawnline- (luci.mk), released diff --git a/package/luci-app-dawnline/htdocs/luci-static/resources/dawnline/app.js b/package/luci-app-dawnline/htdocs/luci-static/resources/dawnline/app.js deleted file mode 100644 index 5c53d10..0000000 --- a/package/luci-app-dawnline/htdocs/luci-static/resources/dawnline/app.js +++ /dev/null @@ -1,31 +0,0 @@ -// Generated from dawnline/web — do not edit by hand. -'use strict'; -'require baseclass'; -'require dom'; -'require poll'; -'require rpc'; -'require ui'; -var va=Object.create;var ds=Object.defineProperty;var ba=Object.getOwnPropertyDescriptor;var xa=Object.getOwnPropertyNames;var wa=Object.getPrototypeOf,ya=Object.prototype.hasOwnProperty;var ka=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var _a=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of xa(e))!ya.call(t,r)&&r!==o&&ds(t,r,{get:()=>e[r],enumerable:!(s=ba(e,r))||s.enumerable});return t};var Ca=(t,e,o)=>(o=t!=null?va(wa(t)):{},_a(e||!t||!t.__esModule?ds(o,"default",{value:t,enumerable:!0}):o,t));var _s=ka((ys,ks)=>{"use strict";var ws=(function(){var t=function(P,R){var w=236,k=17,y=P,O=o[R],b=null,f=0,T=null,C=[],A={},K=function(z,$){f=y*4+17,b=(function(E){for(var I=new Array(E),D=0;D=7&&te(z),T==null&&(T=ne(y,O,C)),ke(T,$)},Y=function(z,$){for(var E=-1;E<=7;E+=1)if(!(z+E<=-1||f<=z+E))for(var I=-1;I<=7;I+=1)$+I<=-1||f<=$+I||(0<=E&&E<=6&&(I==0||I==6)||0<=I&&I<=6&&(E==0||E==6)||2<=E&&E<=4&&2<=I&&I<=4?b[z+E][$+I]=!0:b[z+E][$+I]=!1)},Q=function(){for(var z=0,$=0,E=0;E<8;E+=1){K(!0,E);var I=r.getLostPoint(A);(E==0||z>I)&&(z=I,$=E)}return $},j=function(){for(var z=8;z>E&1)==1;b[Math.floor(E/3)][E%3+f-8-3]=I}for(var E=0;E<18;E+=1){var I=!z&&($>>E&1)==1;b[E%3+f-8-3][Math.floor(E/3)]=I}},me=function(z,$){for(var E=O<<3|$,I=r.getBCHTypeInfo(E),D=0;D<15;D+=1){var W=!z&&(I>>D&1)==1;D<6?b[D][8]=W:D<8?b[D+1][8]=W:b[f-15+D][8]=W}for(var D=0;D<15;D+=1){var W=!z&&(I>>D&1)==1;D<8?b[8][f-D-1]=W:D<9?b[8][15-D-1+1]=W:b[8][15-D-1]=W}b[f-8][8]=!z},ke=function(z,$){for(var E=-1,I=f-1,D=7,W=0,ee=r.getMaskFunction($),X=f-1;X>0;X-=2)for(X==6&&(X-=1);;){for(var ve=0;ve<2;ve+=1)if(b[I][X-ve]==null){var Le=!1;W>>D&1)==1);var re=ee(I,X-ve);re&&(Le=!Le),b[I][X-ve]=Le,D-=1,D==-1&&(W+=1,D=7)}if(I+=E,I<0||f<=I){I-=E,E=-E;break}}},U=function(z,$){for(var E=0,I=0,D=0,W=new Array($.length),ee=new Array($.length),X=0;X<$.length;X+=1){var ve=$[X].dataCount,Le=$[X].totalCount-ve;I=Math.max(I,ve),D=Math.max(D,Le),W[X]=new Array(ve);for(var re=0;re=0?is.getAt(as):0}}for(var ls=0,re=0;re<$.length;re+=1)ls+=$[re].totalCount;for(var ao=new Array(ls),hn=0,re=0;reX*8)throw"code length overflow. ("+D.getLengthInBits()+">"+X*8+")";for(D.getLengthInBits()+4<=X*8&&D.put(0,4);D.getLengthInBits()%8!=0;)D.putBit(!1);for(;!(D.getLengthInBits()>=X*8||(D.put(w,8),D.getLengthInBits()>=X*8));)D.put(k,8);return U(D,I)};A.addData=function(z,$){$=$||"Byte";var E=null;switch($){case"Numeric":E=c(z);break;case"Alphanumeric":E=p(z);break;case"Byte":E=u(z);break;case"Kanji":E=g(z);break;default:throw"mode:"+$}C.push(E),T=null},A.isDark=function(z,$){if(z<0||f<=z||$<0||f<=$)throw z+","+$;return b[z][$]},A.getModuleCount=function(){return f},A.make=function(){if(y<1){for(var z=1;z<40;z++){for(var $=l.getRSBlocks(z,O),E=d(),I=0;I"u"?z*4:$;var E="";E+='";for(var D=0;D';E+=""}return E+="",E+="
",E},A.createSvgTag=function(z,$,E,I){var D={};typeof arguments[0]=="object"&&(D=arguments[0],z=D.cellSize,$=D.margin,E=D.alt,I=D.title),z=z||2,$=typeof $>"u"?z*4:$,E=typeof E=="string"?{text:E}:E||{},E.text=E.text||null,E.id=E.text?E.id||"qrcode-description":null,I=typeof I=="string"?{text:I}:I||{},I.text=I.text||null,I.id=I.text?I.id||"qrcode-title":null;var W=A.getModuleCount()*z+$*2,ee,X,ve,Le,re="",ze;for(ze="l"+z+",0 0,"+z+" -"+z+",0 0,-"+z+"z ",re+=''+he(I.text)+"":"",re+=E.text?''+he(E.text)+"":"",re+='',re+='"u"?z*4:$;var E=A.getModuleCount()*z+$*2,I=$,D=E-$;return B(E,E,function(W,ee){if(I<=W&&W"u"?z*4:$;var I=A.getModuleCount()*z+$*2,D="";return D+="",D};var he=function(z){for(var $="",E=0;E":$+=">";break;case"&":$+="&";break;case'"':$+=""";break;default:$+=I;break}}return $},fe=function(z){var $=1;z=typeof z>"u"?$*2:z;var E=A.getModuleCount()*$+z*2,I=z,D=E-z,W,ee,X,ve,Le,re={"██":"█","█ ":"▀"," █":"▄"," ":" "},ze={"██":"▀","█ ":"▀"," █":" "," ":" "},Re="";for(W=0;W=D?ze[Le]:re[Le];Re+=` -`}return E%2&&z>0?Re.substring(0,Re.length-E-1)+Array(E+1).join("▀"):Re.substring(0,Re.length-1)};return A.createASCII=function(z,$){if(z=z||1,z<2)return fe($);z-=1,$=typeof $>"u"?z*2:$;var E=A.getModuleCount()*z+$*2,I=$,D=E-$,W,ee,X,ve,Le=Array(z+1).join("██"),re=Array(z+1).join(" "),ze="",Re="";for(W=0;W>>8),O.push(T&255)):O.push(k)}}return O}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},o={L:1,M:0,Q:3,H:2},s={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},r=(function(){var P=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],R=1335,w=7973,k=21522,y={},O=function(b){for(var f=0;b!=0;)f+=1,b>>>=1;return f};return y.getBCHTypeInfo=function(b){for(var f=b<<10;O(f)-O(R)>=0;)f^=R<=0;)f^=w<5&&(T+=3+K-5)}for(var C=0;C=256;)y-=255;return P[y]},k})();function a(P,R){if(typeof P.length>"u")throw P.length+"/"+R;var w=(function(){for(var y=0;y"u")throw"bad rs block @ typeNumber:"+y+"/errorCorrectionLevel:"+O;for(var f=b.length/3,T=[],C=0;C>>7-k%8&1)==1},w.put=function(k,y){for(var O=0;O>>y-O-1&1)==1)},w.getLengthInBits=function(){return R},w.putBit=function(k){var y=Math.floor(R/8);P.length<=y&&P.push(0),k&&(P[y]|=128>>>R%8),R+=1},w},c=function(P){var R=e.MODE_NUMBER,w=P,k={};k.getMode=function(){return R},k.getLength=function(b){return w.length},k.write=function(b){for(var f=w,T=0;T+2>>8&255)*192+(C&255),b.put(C,13),T+=2}if(T>>8)},R.writeBytes=function(w,k,y){k=k||0,y=y||w.length;for(var O=0;O0&&(w+=","),w+=P[k];return w+="]",w},R},x=function(){var P=0,R=0,w=0,k="",y={},O=function(f){k+=String.fromCharCode(b(f&63))},b=function(f){if(!(f<0)){if(f<26)return 65+f;if(f<52)return 97+(f-26);if(f<62)return 48+(f-52);if(f==62)return 43;if(f==63)return 47}throw"n:"+f};return y.writeByte=function(f){for(P=P<<8|f&255,R+=8,w+=1;R>=6;)O(P>>>R-6),R-=6},y.flush=function(){if(R>0&&(O(P<<6-R),P=0,R=0),w%3!=0)for(var f=3-w%3,T=0;T=R.length){if(y==0)return-1;throw"unexpected end of file./"+y}var f=R.charAt(w);if(w+=1,f=="=")return y=0,-1;if(f.match(/^\s$/))continue;k=k<<6|b(f.charCodeAt(0)),y+=6}var T=k>>>y-8&255;return y-=8,T};var b=function(f){if(65<=f&&f<=90)return f-65;if(97<=f&&f<=122)return f-97+26;if(48<=f&&f<=57)return f-48+52;if(f==43)return 62;if(f==47)return 63;throw"c:"+f};return O},S=function(P,R){var w=P,k=R,y=new Array(P*R),O={};O.setPixel=function(C,A,K){y[A*w+C]=K},O.write=function(C){C.writeString("GIF87a"),C.writeShort(w),C.writeShort(k),C.writeByte(128),C.writeByte(0),C.writeByte(0),C.writeByte(0),C.writeByte(0),C.writeByte(0),C.writeByte(255),C.writeByte(255),C.writeByte(255),C.writeString(","),C.writeShort(0),C.writeShort(0),C.writeShort(w),C.writeShort(k),C.writeByte(0);var A=2,K=f(A);C.writeByte(A);for(var Y=0;K.length-Y>255;)C.writeByte(255),C.writeBytes(K,Y,255),Y+=255;C.writeByte(K.length-Y),C.writeBytes(K,Y,K.length-Y),C.writeByte(0),C.writeString(";")};var b=function(C){var A=C,K=0,Y=0,Q={};return Q.write=function(j,Z){if(j>>>Z)throw"length over";for(;K+Z>=8;)A.writeByte(255&(j<>>=8-K,Y=0,K=0;Y=j<0&&A.writeByte(Y)},Q},f=function(C){for(var A=1<>6,128|i&63):i<55296||i>=57344?s.push(224|i>>12,128|i>>6&63,128|i&63):(r++,i=65536+((i&1023)<<10|o.charCodeAt(r)&1023),s.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63))}return s}return e(t)}})();(function(t){typeof define=="function"&&define.amd?define([],t):typeof ys=="object"&&(ks.exports=t())})(function(){return ws})});function lo(t,e){return t==null||t===!1||t===""||(Array.isArray(t)?t.forEach(o=>lo(o,e)):e.push(t instanceof Node?t:String(t))),e}function n(t,e,o){let s=window.E,r=e!=null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Node);return!r&&o===void 0?s(t,{},lo(e,[])):s(t,r?e:{},lo(o,[]))}var cs={phone:'',computer:'',tablet:'',router:'',server:'',other:'',ethernet:'',bridge:'',wifi:'',tunnel:'',plus:'',chart:'',reset:'',package:'',code:'',plug:'',sunrise:'',refresh:'',archive:'',qr:'',copy:'',download:'',link:'',amnezia:'',amneziawg:'',wireguard:'',appstore:'',googleplay:'',github:'',openwrt:'',apple:'',windows:'',linux:'',eye:'',share:'',arrow:'',trash:'',edit:'',pause:'',play:'',key:'',out:'',admin:'',shield:'',shieldplus:'',lock:'',zap:'',check:'',alert:'',x:'',globe:'',home:'',open:'',file:'',network:'',moon:'',chevron:'',clock:'',calendar:'',minus:'',more:'',pin:'',activity:''};function Mt(t,e="dl-icon"){let o=cs[t]??cs.phone;return``}function v(t,e="dl-icon"){let o=document.createElement("span");return o.className="dl-icon-wrap",o.innerHTML=Mt(t,e),o}function F(t,e="info",o=0){let s=document.querySelector(".dl-toasts");s||(s=n("div",{class:"dl-toasts dl-root",role:"status","aria-live":"polite"}),document.body.appendChild(s));let r=e==="error"?"x":e==="warning"?"alert":e==="success"?"check":null,i=()=>{a.classList.remove("show"),setTimeout(()=>a.remove(),200)},a=n("div",{class:`dl-toast ${e}`},[r?v(r):"",n("span",{},t),e==="error"?n("button",{type:"button","aria-label":_("Close"),click:i},v("x")):""]);s.appendChild(a),requestAnimationFrame(()=>a.classList.add("show")),setTimeout(i,o||(e==="error"?8e3:e==="warning"?5e3:2600))}function _e(t){return t instanceof Error?t.message:String(t)}async function q(t,e){try{let o=await t();return e&&F(e,"success",3500),o}catch(o){F(_e(o),"error",1e4);return}}function ps(t){try{let e=t();e&&typeof e.then=="function"&&e.catch(o=>F(_e(o),"error"))}catch(e){F(_e(e),"error")}}function co(){return(typeof document>"u"?"":document.documentElement.lang)||"en"}function ie(){let t=co();return t==="en"?"en-GB":t}function m(t,...e){let o=0;return t.replace(/%([%sd])/g,(s,r)=>r==="%"?"%":String(e[o++]??""))}function V(t,e){return t.toLocaleString(ie(),e===void 0?void 0:{minimumFractionDigits:e,maximumFractionDigits:e})}function G(t,e,o){return m(N_(t,e,o),V(t))}function oe(t,...e){let o=0;return t.split(/(%[%sd])/).filter(Boolean).map(s=>s==="%%"?"%":s==="%s"||s==="%d"?e[o++]:s)}var po=t=>_(t);function us(t){if(t&&typeof t=="object"){if(typeof t.error=="string")throw new Error(t.error);typeof t.warning=="string"&&t.warning&&F(t.warning,"warning",12e3)}return t}function J(t,e=[]){let o=rpc.declare({object:"luci.dawnline",method:t,params:[...e,"lang"]});return async(...s)=>us(await o(...e.map((r,i)=>s[i]),co()))}var La=J("logs_clear",["person","device","category","older_days"]),Ma=(t={})=>La(t.person??"",t.device??"",t.category??"",t.older_days??""),Ea=rpc.declare({object:"luci.dawnline",method:"person_update",params:["id","name","access","device_limit","expires","expire_action","expire_warn","quota_gb","quota_period","bonus_gb","hours","note","dns_mode","paused","services","circle","home_nets","server"]});async function Ta(t,e){let s=[t,...["name","access","device_limit","expires","expire_action","expire_warn","quota_gb","quota_period","bonus_gb","hours","note","dns_mode"].map(r=>e[r]),e.paused,e.services,e.circle,e.home_nets,e.server];return us(await Ea(...s))}var Sa=J("status",["days"]),Pa=J("device_update",["id","name","disabled","mtu","keepalive"]),$a=(t,e,o,s={})=>Pa(t,e,o,s.mtu,s.keepalive),N={rev:J("rev"),meter:J("meter",["since"]),personUpdate:Ta,settingsGet:J("settings_get"),portalInfo:J("portal_info"),settingsUpdate:J("settings_update",["values"]),serviceSet:J("service_set",["id","name","address","ports"]),serviceDelete:J("service_delete",["id"]),geoClear:J("geo_clear"),events:J("events",["limit","person","since"]),logsClear:Ma,interfaces:J("interfaces",["id"]),serverInterfaces:J("server_interfaces",["id","auto_wan","wan_device","auto_lan","lan_devices","lan_like","device_mesh","mesh"]),circleSet:J("circle_set",["id","server","name","color","members"]),circleDelete:J("circle_delete",["id"]),accessCheck:J("access_check",["from","to"]),homeHosts:J("home_hosts",["id"]),usageClear:J("usage_clear",["scope","id"]),uninstall:J("uninstall",["confirm"]),status:Sa,setupDefaults:J("setup_defaults"),serverCreate:J("server_create",["id","name","ifname","port","subnet","endpoint","mtu","preset","lan_zone","wan_zone","lan_like","portal_enabled","portal_port"]),serverObfuscation:J("server_obfuscation",["id","preset"]),serverUpdate:J("server_update",["id","values"]),serverPorts:J("server_ports",["id"]),endpointProbe:J("endpoint_probe",["host","id","port"]),serverDelete:J("server_delete",["id"]),personLinks:J("person_links",["id"]),personCreate:J("person_create",["name","slug","server","access","device_limit","expires","quota_gb","quota_period"]),personPause:J("person_pause",["id","paused"]),personRegen:J("person_regen",["id","remove"]),personDelete:J("person_delete",["id"]),personUsage:J("person_usage",["id","days"]),deviceCreate:J("device_create",["person","name","kind","lan_bypass"]),deviceConfig:J("device_config",["id","issue"]),deviceUpdate:$a,deviceDelete:J("device_delete",["id"]),deviceRotate:J("device_rotate",["id"]),apply:J("apply"),health:J("health"),healthFix:J("health_fix",["id"]),serviceLog:J("service_log"),serviceLogClear:J("service_log_clear",["older_days"]),backupList:J("backup_list"),backupCreate:J("backup_create"),backupRestore:J("backup_restore",["name"]),backupDelete:J("backup_delete",["name"]),backupRead:J("backup_read",["name"]),backupUpload:J("backup_upload",["data"]),exportJson:J("export"),importJson:J("import",["data"]),updatesStatus:J("updates_status"),updatesRun:J("updates_run",["what"]),updatesReleases:J("updates_releases",["page"]),updatesNotes:J("updates_notes",["component","tag","build"]),updatesChanges:J("updates_changes",["from","to"])};function H(t,e,o="neutral",s={}){let{disabled:r,...i}=s,a=n("button",{class:`cbi-button cbi-button-${o}`,type:"button",...i,click:async l=>{if(l.preventDefault(),l.stopPropagation(),!a.disabled){a.disabled=!0,a.classList.add("spinning");try{await e(l)}catch(d){F(_e(d),"error")}finally{a.disabled=!1,a.classList.remove("spinning")}}}},t);return a.disabled=!!r,a}function Pe(t,e,o,s="neutral",r=""){return H([v(t),n("span",{class:"dl-btn-label"},e)],o,s,{title:e,class:`cbi-button cbi-button-${s} dl-icon-btn ${r}`.trim()})}function Ee(t){return document.addEventListener("luci-navigate",t),()=>document.removeEventListener("luci-navigate",t)}var Et=null;function uo(t=!1){let e=Et;Et=null,e?.(t)}function ae(t,e,o,s=""){uo();let r=n("div",{class:`dl-modal ${s}`},e),i=n("div",{class:"button-row"},o);r.addEventListener("keydown",a=>{if(a.key==="Escape"){a.preventDefault(),a.stopPropagation(),le();return}if(a.key!=="Enter"||a.shiftKey||a.ctrlKey||a.metaKey||a.altKey)return;let l=a.target;if(!l||["TEXTAREA","BUTTON","SELECT","A"].includes(l.tagName))return;let d=i.querySelector(".cbi-button-positive");!d||d.disabled||(a.preventDefault(),d.click())}),ui.showModal(t,[r,i])}function le(){uo(),ui.hideModal()}function de(t=_("Cancel"),e=!1){return n("button",{class:`cbi-button ${e?"cbi-button-negative":"cbi-button-neutral"}`,type:"button",click:le},t)}function pe(t,e,o=_("Confirm"),s=!1){return new Promise(r=>{ae(t,e,[de()," ",n("button",{class:`cbi-button ${s?"cbi-button-negative":"cbi-button-positive"}`,type:"button",click:()=>{let i=Et;Et=null,ui.hideModal(),i?.(!0)}},o)]),Et=r})}Ee(()=>{Et&&(uo(),ui.hideModal())});async function xe(t,e=_("Copied to clipboard"),o=!1){try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(t);else{let s=n("textarea",{style:"position:fixed;opacity:0"},t);document.body.appendChild(s),s.select();let r=document.execCommand("copy");if(s.remove(),!r)throw new Error(_("Copying is blocked here. Select the text and copy it by hand."))}return F(e,"success",2500),!0}catch(s){return o||F(_e(s),"error"),!1}}function Ae(t,e,o="text/plain"){let s=globalThis,r=typeof e=="string"?new s.Blob([e],{type:o}):e,i=URL.createObjectURL(r),a=n("a",{href:i,download:t,style:"display:none"});document.body.appendChild(a),a.click(),setTimeout(()=>{URL.revokeObjectURL(i),a.remove()},1e3)}function mo(t,e){return new Promise(o=>{let s=n("input",{type:"file",accept:t,style:"display:none"});s.addEventListener("cancel",()=>{s.remove(),o(null)}),s.addEventListener("change",()=>{let r=s.files?.[0];if(s.remove(),!r)return o(null);let i=new FileReader;i.onload=()=>{let a=String(i.result??"");o({name:r.name,data:e==="base64"?a.replace(/^data:[^,]*,/,""):a})},i.onerror=()=>o(null),e==="base64"?i.readAsDataURL(r):i.readAsText(r)}),document.body.appendChild(s),s.click()})}function Te(t,e){let o=document.querySelector(".dl-dd");if(o&&(o.dlClose?o.dlClose():o.remove(),o.dlAnchor===t))return;let s=n("div",{class:"dl-dd dl-root",role:"menu"},e.map(u=>u?n("button",{type:"button",role:"menuitem",class:u.danger?"danger":u.warn?"warn":"",click:()=>{p(),ps(u.run)}},[u.icon??"",n("span",{},u.label)]):n("hr")));document.body.appendChild(s);let r=t.getBoundingClientRect(),i=s.offsetWidth,a=s.offsetHeight;s.style.top=`${r.bottom+6+a>window.innerHeight-8&&r.top-6-a>8?r.top-6-a:r.bottom+6}px`,s.style.left=`${Math.max(8,Math.min(r.right-i,window.innerWidth-i-8))}px`;let l=u=>{!s.contains(u.target)&&!t.contains(u.target)&&p()},d=u=>{if(u.key==="Escape"||u.key==="Tab")return p();let g=[...s.querySelectorAll("button:not([disabled])")];if(!g.length||!["ArrowDown","ArrowUp","Home","End"].includes(u.key))return;u.preventDefault();let M=g.indexOf(document.activeElement),x=u.key==="Home"?0:u.key==="End"?g.length-1:u.key==="ArrowDown"?(M+1)%g.length:(M-1+g.length)%g.length;g[x].focus({preventScroll:!0})},c=Ee(p);s.dlAnchor=t,s.dlClose=p;function p(){s.remove(),c(),document.removeEventListener("mousedown",l,!0),document.removeEventListener("keydown",d,!0),window.removeEventListener("scroll",p,!0)}setTimeout(()=>{document.addEventListener("mousedown",l,!0),document.addEventListener("keydown",d,!0),window.addEventListener("scroll",p,!0)}),s.querySelector("button")?.focus({preventScroll:!0})}var vt=null,ot=null,ho=0;function Tt(){vt&&(vt.style.display="none"),ot=null,clearInterval(ho),ho=0}function we(t,e){let o=s=>{vt??(vt=document.body.appendChild(n("div",{class:"dl-tip dl-tip-float dl-root"}))),vt.replaceChildren(...e().map(r=>typeof r=="string"?document.createTextNode(r):r)),vt.style.display="",vt.style.left=`${s.clientX}px`,vt.style.top=`${s.clientY-10}px`,ot=t,ho||(ho=window.setInterval(()=>{(!ot?.isConnected||!ot.getClientRects().length)&&Tt()},400))};t.addEventListener("mouseenter",o),t.addEventListener("mousemove",o),t.addEventListener("mouseleave",Tt),t.addEventListener("pointerup",s=>{s.pointerType!=="mouse"&&(ot===t?Tt():o(s))})}Ee(Tt);window.addEventListener("scroll",()=>ot&&Tt(),{capture:!0,passive:!0});document.addEventListener("pointerdown",t=>{ot&&!ot.contains(t.target)&&Tt()},!0);function Da(t,e,o){let s=0;for(;t>=o&&s=100||s===0?V(Math.round(t)):V(t,1)} ${e[s]}`}function se(t){return Da(!t||t<0?0:t,[_("B"),_("KB"),_("MB"),_("GB"),_("TB")],1024)}function We(t){let e=t*8,o=[_("bit/s"),_("kbit/s"),_("Mbit/s"),_("Gbit/s")];if(e<1e3)return`${V(Math.round(e))} ${o[0]}`;let s=e<1e6?1:e<1e9?2:3,r=e/1e3**s;return`${V(r,s===3||r<10?1:0)} ${o[s]}`}function ce(t,e=Date.now()/1e3){if(!t)return _("never");let o=Math.max(0,Math.round(e-t));return o<60?_("just now"):o<3600?m(_("%s min ago"),Math.floor(o/60)):o<86400?m(_("%s h ago"),Math.floor(o/3600)):o<86400*30?m(_("%s d ago"),Math.floor(o/86400)):new Date(t*1e3).toLocaleDateString(ie(),{day:"numeric",month:"short",year:"numeric"})}function st(t){if(!t||t<0)return"—";let e=Math.floor(t/86400),o=Math.floor(t%86400/3600),s=Math.floor(t%3600/60);return e?m(_("%sd %sh"),e,o):o?m(_("%sh %sm"),o,s):m(_("%sm"),s)}function Ft(t){let e=new Date(t*1e3),o=new Date,s=e.toDateString()===o.toDateString(),r=e.toLocaleTimeString(ie(),{hour:"2-digit",minute:"2-digit"});return s?r:`${e.toLocaleDateString(ie(),{day:"numeric",month:"short"})} ${r}`}function qe(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function Pt(t){let[e,o,s]=t.split("-").map(Number);return new Date(e,(o||1)-1,s||1,12)}function Ie(t){return(typeof t=="string"?/^\d{4}-\d{2}-\d{2}$/.test(t)?Pt(t):new Date(t):t).toLocaleDateString(ie(),{day:"numeric",month:"short",year:"numeric"})}function $e(t){return t?Ie(t):""}function fo(t,e){let o=s=>{let[r,i,a]=s.split("-").map(Number);return Date.UTC(r,i-1,a)};return Math.round((o(t)-o(e))/864e5)}function Gt(t,e){let o=Pt(t);return o.setDate(o.getDate()+e),qe(o)}function St(t,e){let[o,s,r]=t.split("-").map(Number),i=new Date(o,s-1+e,1,12),a=new Date(i.getFullYear(),i.getMonth()+1,0).getDate();return i.setDate(Math.min(r,a)),qe(i)}function Ge(t){return t?.length?t[t.length-1].day:qe(new Date)}function ms(t,e,o,s,r=30){let i=t||s;return e==="day"?Gt(i,o):e==="week"?Gt(i,7*o):e==="month"?St(i,o):e==="year"?St(i,12*o):Gt(i,r*o)}function rt(t,e=Date.now()){if(!t)return null;let o=typeof e=="number"?qe(new Date(e)):e,s=fo(t,o);return s>=0?s+1:s}function it(t,e){return e!=null&&e>0&&t.expire_warn>0&&e<=t.expire_warn}function fn(t){return t<=1?_("ends today"):t===2?_("ends tomorrow"):G(t,"ends in %s day","ends in %s days")}function $t(t){return t<1024?`${V(t)} ${_("B")}`:t<1048576?`${V(t/1024,t<10240?1:0)} ${_("KB")}`:`${V(t/1048576,1)} ${_("MB")}`}function bt(t){return{lan:_("Home network"),internet:_("Internet"),both:_("Home network + Internet")}[t]}var xt=20,Aa=[[128,191],[215,215],[247,247],[8192,11263],[12288,12351],[55296,63743],[65024,65039],[65072,65103],[65279,65279],[65520,65535],[126976,130047],[917504,917631]],Na=/^[A-Za-z0-9 ._-]$/,Ha=/^[\p{L}\p{M}\p{N}]$/u;function gn(t){let e=t.codePointAt(0)??0;return e<128?Na.test(t):!Aa.some(([o,s])=>e>=o&&e<=s)&&Ha.test(t)}function qt(t){let e=[...t];return e.length<=xt&&e.every(gn)}function go(t,e=""){return[...[...t].map(r=>gn(r)?r:" ").join("").replace(/\s+/g," ").trim()||_("Device")].slice(0,Math.max(1,xt-[...e].length)).join("").trimEnd()+e}function hs(t){return t==="other"?_("Device"):at(t)}var fs=["computer","phone","tablet","router","other"];function at(t){return{computer:_("PC"),phone:_("Phone"),tablet:_("Tablet"),router:_("Router"),other:_("Other")}[t]}function gs(t){return{active:_("Active"),paused:_("Paused"),expired:_("Expired"),quota:_("Data limit reached"),hours:_("Outside allowed hours"),no_server:_("No server"),server_off:_("Server is turned off")}[t]}function Oe(t){let e=t.trim().split(/\s+/).filter(Boolean);if(!e.length)return"?";let o=e[0][0]??"",s=e.length>1?e[e.length-1][0]??"":e[0][1]??"";return(o+s).toUpperCase()}function vn(t){let e=o=>o.disabled?3:o.online?0:o.handshake?1:2;return t.map((o,s)=>[o,s]).sort((o,s)=>e(o[0])-e(s[0])||o[1]-s[1]).map(([o])=>o)}function bn(t){return t.map(e=>e.endsWith(".0/24")?`${e.slice(0,-5)}.x`:e).join(", ")}function Kt(t,e){if(t.access!=="both"||!e)return[];let o=t.home_nets??[];return e.home.filter(s=>!o.length||o.includes(s.dev)).flatMap(s=>s.nets)}function Se(t,e,o){return n("span",{class:`dl-pill ${t}`,title:o??null},e)}function za(t){return t.state==="active"?"ok":t.state==="quota"||t.state==="expired"?"bad":"warn"}function Ra(t){return t.state==="server_off"&&t.paused?"paused":t.state}function vs(t){let e=Ra(t);return e==="active"||e==="server_off"?"":Se(za({...t,state:e}),gs(e))}function bs(t){let e=t.access==="both"?["lan","inet"]:t.access==="lan"?["lan"]:["inet"],o=n("span",{class:"dl-access","aria-label":bt(t.access)},e.map(s=>n("span",{class:`dl-ibadge ${s}`},v(s==="lan"?"home":"globe"))));return we(o,()=>[n("div",{class:"dl-tip-title"},bt(t.access)),t.access==="lan"&&t.services?.length?n("div",{class:"dl-muted"},G(t.services.length,"%s home service only","%s home services only")):""]),o}function Ia(t){return{active:null,paused:_("Paused"),expired:_("Access ended"),quota:_("Data limit"),hours:_("Outside hours"),server_off:_("Server off"),no_server:_("No server")}[t]}function xn(t,e,o=_("Not set up yet"),s){let r=new Date(t.handshake*1e3).toLocaleString(ie()),i=t.handshake?`${m(_("Last seen %s"),ce(t.handshake,e))} · ${r}`:"";if(t.disabled)return n("span",{class:"dl-dstat",title:i},_("Disabled"));if(t.online)return n("span",{class:"dl-dstat ok"},_("Connected"));let a=s&&Ia(s.state);return a?n("span",{class:"dl-dstat warn",title:i||_("Not connected yet")},a):t.handshake?n("span",{class:"dl-dstat",title:r},m(_("Last seen %s"),ce(t.handshake,e))):n("span",{class:"dl-dstat warn",title:_("Waiting for the first connection")},o)}var wn=null;function xs(t,e,o,s){wn?.close();let r=n("aside",{class:"dl-drawer",role:"dialog","aria-modal":"true"},[n("div",{class:"dl-drawer-head"},[t,n("button",{type:"button",class:"dl-drawer-x","aria-label":_("Close"),click:()=>c()},v("x"))]),n("div",{class:"dl-drawer-body"},e),o?n("div",{class:"dl-drawer-foot"},o):""]),i=n("div",{class:"dl-drawer-overlay dl-root",click:u=>{u.target===i&&c()}},r),a=u=>{u.key==="Escape"&&!document.body.classList.contains("modal-overlay-active")&&c()},l=!1,d=Ee(()=>c());function c(){l||(l=!0,d(),document.removeEventListener("keydown",a),i.classList.remove("open"),setTimeout(()=>i.remove(),220),wn===p&&(wn=null),s())}let p={close:c,panel:r};return document.addEventListener("keydown",a),document.body.appendChild(i),requestAnimationFrame(()=>i.classList.add("open")),wn=p,p}function ge(t,e,o){return n("div",{class:"dl-setrow"},[n("div",{class:"dl-stack"},[n("span",{class:"dl-setrow-label"},t),o?n("span",{class:"dl-sub"},o):""]),n("div",{class:"dl-setrow-ctl"},e)])}function Ce(t,e,o,s=e){let r=ge(t,s," "),i=r.querySelector(".dl-sub"),a=()=>{let l=o();i.textContent=l.text,i.classList.toggle("bad",l.bad),e.classList.toggle("cbi-input-invalid",l.bad)};return e.addEventListener("input",a),r.refresh=a,r.help=o,a(),r}function Me(t,e,o,s=e){let r=n("div",{class:"dl-sub"}),i=n("div",{class:"cbi-value dl-live"},[n("div",{class:"cbi-value-title"},[n("label",{},t),r]),n("div",{class:"cbi-value-field"},s)]),a=()=>{let l=o();r.textContent=l.text,r.classList.toggle("bad",l.bad),e.classList.toggle("cbi-input-invalid",l.bad)};return e.addEventListener("input",a),e.addEventListener("change",a),i.refresh=a,i.help=o,a(),i}function Be(t,e=[]){for(let o of t){let s=o.help?.();if(s?.bad)return s.text}for(let o of e){let s=o();if(s.bad)return s.text}return null}function Vt(t,e,o,s=""){return n("section",{class:`dl-setsec ${s}`},[n("div",{class:"dl-setsec-body"},[t?n("h3",{},t):"",...e]),o.length?n("div",{class:"dl-setsec-foot"},o):""])}function ye(t,e,o,s){return n("div",{class:"dl-group"},[n("div",{class:"dl-group-head"},[n("span",{class:"dl-group-ic"},v(t)),n("span",{class:"dl-stack"},[n("b",{},e),o?n("span",{class:"dl-sub"},o):""])]),n("div",{class:"dl-group-body"},s.filter(r=>r!==""))])}function lt(t,e,o,s,r){return n("div",{class:`dl-row dl-need-row ${e}`},[e?n("span",{class:"dl-need-ic"},v(t)):v(t),n("span",{class:"dl-row-main dl-stack"},[n("b",{},o),n("span",{class:"dl-sub"},s)]),r])}function wt(t){return n("div",{class:"dl-note warn"},[v("alert"),n("span",{},t)])}function yt(t,e){let o={ok:"success",warn:"warning",error:"error",info:"notice"}[t];return n("div",{class:`alert-message ${o}`},e)}function kt(t,e=""){let o=n("div",{class:e});return o.innerHTML=t,o}function be(t,e,o){let s=n("button",{type:"button",role:"switch",class:`dl-switch${t?" on":""}`,"aria-checked":t?"true":"false","aria-label":e,click:()=>{let r=!s.classList.contains("on");vo(s,r),o?.(r)}},n("i"));return s}function vo(t,e){t.classList.toggle("on",e),t.setAttribute("aria-checked",e?"true":"false")}var De=t=>t.classList.contains("on");function Ze(t,e,o={}){t.some(([i])=>i===e)||(t=[...t,[e,e]]);let s=n("div",{class:`dl-seg${o.cls?` ${o.cls}`:""}`,role:"radiogroup","aria-label":o.label??null,"data-value":e}),r=()=>s.querySelectorAll(":scope > button").forEach(i=>{let a=i.dataset.v===s.dataset.value;i.classList.toggle("on",a),i.setAttribute("aria-checked",a?"true":"false")});for(let[i,a]of t)s.appendChild(n("button",{type:"button",role:"radio","data-v":i,click:()=>{i!==s.dataset.value&&(o.optimistic!==!1&&(s.dataset.value=i,r()),o.onChange?.(i))}},a));return r(),s}function Yt(t,e,o,s={}){return n("button",{type:"button",...s,class:`dl-chipbtn${e?" on":""}${s.class?` ${s.class}`:""}`,"aria-pressed":e?"true":"false",click:o},t)}function Qe(t,e,o,s){return t.some(([r])=>r===e)||(t=[...t,[e,e]]),n("select",{class:"cbi-input-select","aria-label":o,change:r=>s?.(r.target.value)},t.map(([r,i])=>n("option",{value:r,selected:r===e?"selected":null},i)))}function yn(t,e,o){let s=new ui.Dropdown(e,Object.fromEntries(t),{multiple:!0,sort:t.map(([i])=>i),select_placeholder:_("None")}),r=s.render();return r.setAttribute("aria-label",o),{node:r,value:()=>s.getValue()}}function ue(t,e={}){return n("input",{type:"text",class:"cbi-input-text",value:t,...e})}var Ls=Ca(_s(),1),Oa=t=>``,Cs="#0a0a0a",Ba="#f2f2f2",ja={night:[Cs,Ba],day:["#ffffff",Cs]},Ms=t=>t.length>300,bo=null;function Ua(t){if(bo?.text===t)return bo.qr;let e=(0,Ls.default)(0,Ms(t)?"L":"H");return e.addData(t,"Byte"),e.make(),bo={text:t,qr:e},e}var Dt=t=>+t.toFixed(2);function xo(t,e,o,s,r){return`M${Dt(t+r)} ${Dt(e)}h${Dt(o-2*r)}a${r} ${r} 0 0 1 ${r} ${r}v${Dt(s-2*r)}a${r} ${r} 0 0 1 -${r} ${r}h-${Dt(o-2*r)}a${r} ${r} 0 0 1 -${r} -${r}v-${Dt(s-2*r)}a${r} ${r} 0 0 1 ${r} -${r}z`}function kn(t,e=3,o=!0,s="plain"){let r=Ms(t),i=s!=="plain",[a,l]=i?ja[s]:["#fff","#000"],d=Ua(t),c=d.getModuleCount(),p=c+e*2,u=o&&!r?Math.round(c*.22):0;u&&(c-u)%2&&u++;let g=(c-u)/2,M=g+u,x=(w,k)=>u>0&&w>=g&&w=g&&ki&&(k<7&&w<7||k<7&&w>=c-7||k>=c-7&&w<7),S="";if(i){let w=r?.48:.42;for(let k=0;k${Oa(i?a:"#fff")}`}let R=``;return i?`${R}${P}`:`${R}${P}`}function _t(){let t=document.documentElement.getAttribute("data-darkmode");return t!=null?t==="true":window.matchMedia?.("(prefers-color-scheme: dark)").matches??!1}function _n(t){let e=_t();return kt(kn(t,3,!0,e?"night":"day"),`dl-qr${e?"":" light"}`)}function wo(t){let e=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,2})$/.exec(t.trim());if(!e)return null;let[o,s,r,i]=e.slice(1,5).map(Number),a=Number(e[5]);if([o,s,r,i].some(c=>c>255)||a<8||a>30)return null;let l=o*2**24+s*2**16+r*2**8+i,d=2**(32-a);return{net:l-l%d,size:d}}var Wa=(t,e)=>t.netwo(t));function Nt(t){return t.split("/")[0].split(".").slice(0,3).join(".")}function Cn(t){return`${t.trim()}.0/24`}function ko(t,e,o){let s=t.trim(),r=/^\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(s)?wo(Cn(s)):null;if(!r)return{text:_("Three numbers, like 10.77.0."),bad:!0};if(!Ga.some(a=>r.net>=a.net&&r.net+r.size<=a.net+a.size))return{text:_("Use a private range: 10.x.x, 172.16–31.x or 192.168.x."),bad:!0};let i=e.find(a=>{let l=wo(a.cidr);return l!=null&&Wa(r,l)});if(i){let a=i.cidr.endsWith("/24")?`${Nt(i.cidr)}.x`:i.cidr,l=m(_("%s already uses %s."),i.name,a);return{text:o&&o!==s?`${l} ${m(_("Try %s."),o)}`:l,bad:!0}}return{text:m(_("Devices get %s – %s, the router %s."),`${s}.2`,`${s}.254`,`${s}.1`),bad:!1}}var Ts=(t,e)=>e.find(o=>o.from<=t&&t<=o.to)?.who??null,Fa=t=>Number.isInteger(t)&&t>=1&&t<=65535;function Jt(t,e,o){if(!Fa(t))return{text:_("Use a port from 1 to 65535."),bad:!0};let s=Ts(t,e);return s?{text:m(_("Used by %s. Choose another port."),s),bad:!0}:{text:o,bad:!1}}function Ln(t,e,o){let s=o?m(_("HTTPS here, plain HTTP for links on IP addresses on %s."),t+1):_("HTTPS on this port, opened on WAN."),r=Jt(t,e,s);if(r.bad||!o)return r;if(t===65535)return{text:_("Links on IP addresses also need the next port: choose a lower one."),bad:!0};let i=Ts(t+1,e);return i?{text:m(_("Links on IP addresses also need %s, used by %s. Choose another port."),t+1,i),bad:!0}:r}var Mn=t=>Array.from(t).length,Es=48,qa=/[<>"\\\u0000-\u001f\u007f]/,_o=(t,e)=>m(N_(t,"Up to %s character (%s now).","Up to %s characters (%s now)."),V(t),V(Mn(e)));function je(t,e=[],o=""){let s=t.trim();return s?Mn(t)>Es?{text:_o(Es,t),bad:!0}:qa.test(t)?{text:_('Names can’t contain < > " or \\.'),bad:!0}:e.some(r=>r.toLowerCase()===s.toLowerCase())?{text:m(_("“%s” already exists - pick another name."),s),bad:!0}:{text:o,bad:!1}:{text:_("Enter a name."),bad:!0}}function Co(t,e=[],o=""){return Mn(t.trim())>xt?{text:_o(xt,t.trim()),bad:!0}:qt(t.trim())?je(t,e,o):{text:_("Letters, digits, spaces and - _ . only."),bad:!0}}function Ss(t,e=[]){return Mn(t)>32?{text:_o(32,t),bad:!0}:je(t,e,_("Shown on the person cards."))}var Ka=/^[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,Va=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;function Ht(t){let e=Va.exec(t);return!!e&&e.slice(1).every(o=>Number(o)<=255)}function yo(t){return/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/.test(t)&&!/:::/.test(t)}function At(t,e,o=null){let s=t.trim();if(!s)return o!=null?{text:o,bad:!1}:{text:_("Enter a hostname or IP address."),bad:!0};if(/^[a-z]+:\/\//i.test(s))return{text:_("Leave out https:// - just the name."),bad:!0};if(/\/.*/.test(s))return{text:_("Just the name, without a path."),bad:!0};if(/^[^:\[]+:\d+$/.test(s))return{text:_("Just the name, without a port (the port is on AmneziaWG)."),bad:!0};if(/\s/.test(s))return{text:_("A hostname has no spaces."),bad:!0};if(s.length>253||!(Ka.test(s)||Ht(s)||yo(s)))return{text:_("Use a hostname or an IP address."),bad:!0};let r=yo(s)?`[${s}]`:s;return{text:e?m(_("Devices connect to %s."),`${r}:${e}`):m(_("Links use %s."),r),bad:!1}}function Ps(t,e){let o=t.split(/[ ,]+/).filter(Boolean);if(!o.length)return{text:m(_("This router (%s): queries go where your home network sends them, and home names work."),e),bad:!1};let s=o.find(i=>!Ht(i)&&!yo(i));if(s)return{text:m(_("“%s” is not an IP address. Separate several with commas."),s),bad:!0};let r=new Intl.ListFormat(ie(),{type:"conjunction"}).format(o);return{text:m(_("Devices use %s - home names and your LAN’s DNS filters no longer apply to them."),r),bad:!1}}function $s(t,e){let o=t.trim();if(!o)return{text:m(_("Automatic by device type and disguise: %s for computers and routers, %s for phones and tablets."),e.computer,e.phone),bad:!1};if(!/^\d{1,4}$/.test(o)||Number(o)<1280||Number(o)>1500)return{text:_("MTU must be 1280–1500, or empty for automatic."),bad:!0};let s=Number(o);return{text:m(_("Computers and routers get %s, phones and tablets %s."),s,Math.min(s,1280)),bad:!1}}function Ds(t){let e=t.trim();return e?!/^\d{1,3}$/.test(e)||Number(e)>600?{text:_("Use 0–600 seconds."),bad:!0}:Number(e)===0?{text:_("Off: NAT may close the tunnel when idle, and “Connected” lags."),bad:!1}:{text:m(_("Devices send a packet every %s s to keep NAT open (a little battery on phones)."),e),bad:!1}:{text:_("Default: a packet every 25 s keeps NAT open and “Connected” accurate."),bad:!1}}function As(t){let e=t.trim();return e&&(!/^\d{1,4}$/.test(e)||Number(e)<1280||Number(e)>1500)?{text:_("From 1280 to 1500."),bad:!0}:{text:_("Empty: automatic. Lower it when big pages hang on this device."),bad:!1}}function Ns(t){let e=t.trim();return e&&(!/^\d{1,4}$/.test(e)||Number(e)>600)?{text:_("From 0 to 600 seconds."),bad:!0}:{text:_("Seconds. Empty: as the server. Longer saves battery; behind some NATs it then drops."),bad:!1}}function En(t,e=0){let o=t.trim();if(!/^\d{1,2}$/.test(o)||Number(o)<1||Number(o)>32)return{text:_("Use 1–32."),bad:!0};let s=Number(o);return e>s?{text:e-s===1?m(N_(e,"Already has %s device: remove one first, or allow more.","Already has %s devices: remove one first, or allow more."),V(e)):m(N_(e,"Already has %s device: remove %s first, or allow more.","Already has %s devices: remove %s first, or allow more."),V(e),V(e-s)),bad:!0}:{text:G(s,"They can add %s device themselves.","They can add %s devices themselves."),bad:!1}}function Tn(t,e=!0){let o=t.trim();if(!o)return{text:_("Optional. No data limit."),bad:!1};let s=Number(o);return!/^\d+(\.\d+)?$/.test(o)||s<0||s>1e5?{text:_("A number of GB, up to 100000."),bad:!0}:s===0?{text:_("Optional. No data limit."),bad:!1}:{text:m(e?_("Paused after %s GB this month, resumed on the 1st."):_("Paused after %s GB in total."),V(s)),bad:!1}}function Hs(t,e,o,s){let r=t.trim();if(!r)return{text:_("Optional. No end date."),bad:!1};let i=o(r,e);return i==null?{text:_("Use a date."),bad:!0}:i<0?{text:_("That date has passed: access would end at once."),bad:!0}:{text:i===1?m(_("Access ends today (%s)."),s(r)):m(N_(i,"Access ends in %s day (%s).","Access ends in %s days (%s)."),V(i),s(r)),bad:!1}}function zs(t,e=null){let o=t.trim();return o?Ht(o)?e&&!e(o)?{text:m(_("%s is not in any home network of this server: nobody would reach it."),o),bad:!1}:{text:"",bad:!1}:{text:_("Use an IPv4 address, like 192.168.1.10."),bad:!0}:{text:_("The device’s address at home."),bad:!0}}function Rs(t){let e=t.split(/[ ,]+/).filter(Boolean);if(!e.length)return{text:_("All ports."),bad:!1};let o=e.find(s=>!/^\d{1,5}$/.test(s)||Number(s)<1||Number(s)>65535);return o?{text:m(_("“%s” is not a port (1–65535)."),o),bad:!0}:{text:m(N_(e.length,"Port %s.","Ports %s."),e.join(", ")),bad:!1}}function Is(t){let e=t.trim();return e?/^https?:\/\//i.test(e)?e.length>300||!/^https?:\/\/[A-Za-z0-9.-]+(:[0-9]+)?(\/[^\s"'<>]*)?$/.test(e)?{text:_("Not a usable address (no spaces or quotes)."),bad:!0}:{text:_("Wrong links are sent there instead of a “Not found”."),bad:!1}:{text:_("Must start with http:// or https://."),bad:!0}:{text:_("Wrong links get a bare “Not found”."),bad:!1}}function Os(t,e="phone.myata"){let o=t.trim();return o?/^[a-z0-9-]{1,32}(\.[a-z0-9-]{1,32})*$/.test(o)?{text:m(_("Devices get names like %s."),`${e}.${o}`),bad:!1}:{text:/[A-Z]/.test(o)?_("Lowercase only."):_("Lowercase letters, digits, dashes and dots."),bad:!0}:{text:m(_("The default, lan: devices get names like %s."),`${e}.lan`),bad:!1}}function Bs(t){let e=t.trim();return e?Ht(e)?{text:m(_("%s takes over when the tunnel is down."),e),bad:!1}:{text:_("Use an IPv4 address, or leave it empty."),bad:!0}:{text:_("None: without the tunnel those devices have no DNS."),bad:!1}}function js(t){let e=t.trim();return/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/.test(e)?{text:m(_("Runs within an hour after %s (router time)."),e),bad:!1}:{text:_("Use HH:MM, 00:00–23:59."),bad:!0}}function Lo(t,e,o,s={}){let r=0,i="",a=null;return{help:()=>{let{host:c,port:p}=t(),u=At(c,p,s.empty??null);return u.bad||!c.trim()?u:a&&a.host===c.trim()?{text:a.text,bad:a.bad}:{text:`${s.idle?.()||u.text} ${_("Checking where it points…")}`,bad:!1}},schedule:()=>{let{host:c}=t(),p=At(c,t().port,s.empty??null);p.bad||!c.trim()||c.trim()===a?.host||(clearTimeout(r),r=window.setTimeout(async()=>{let u=c.trim();i=u;try{let{id:g,port:M}=t(),x=await e(u,g,M);if(i!==u)return;a={host:u,text:x.text,bad:x.status==="error"}}catch{if(i!==u)return;a={host:u,text:p.text,bad:!1}}o()},700))}}}var Ya=Array.from({length:31},(t,e)=>{let o=e/30;return 14*Math.exp(-4.2*o)*Math.sin(o*Math.PI*2*3.6)}),Us=700,Ja=800;function Za(t){t.getAnimations().filter(i=>i.id==="redden").forEach(i=>i.cancel());let e=getComputedStyle(t),s=`${t.classList.contains("field")?"inset ":""}0 0 0 1.5px ${e.getPropertyValue("--bad").trim()||"#e5484d"}`,r=Us+Ja;t.animate([{boxShadow:s,offset:0},{boxShadow:s,offset:Us/r,easing:"cubic-bezier(0.23, 1, 0.32, 1)"}],{duration:r,id:"redden"})}function Mo(t,e={}){if(e.ring!==!1&&Za(t),typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches)return;let o=getComputedStyle(t).transform,s=o&&o!=="none"?new DOMMatrix(o).m41:0;t.getAnimations().filter(r=>r.id==="shake").forEach(r=>r.cancel()),t.animate(Ya.map((r,i)=>({transform:`translateX(${(i===0?s:r).toFixed(2)}px)`})),{duration:520,easing:"linear",id:"shake"})}function Ws(t){return[...t].every(gn)?m(_("Up to %s characters."),V(xt)):_("Only letters, digits, - _ .")}function Gs(t,e=t,o=()=>{},s={}){let r=()=>typeof e=="function"?e():e,i=t.value;t.addEventListener("beforeinput",a=>{if(i=t.value,a.inputType.startsWith("delete")||a.isComposing||a.inputType==="insertCompositionText")return;let l=a.data??a.dataTransfer?.getData("text/plain")??"",d=t.selectionStart??t.value.length,c=t.selectionEnd??d,p=t.value.slice(0,d)+l+t.value.slice(c);qt(p)||(a.preventDefault(),Mo(r(),s),o(Ws(p)))}),t.addEventListener("input",a=>{if(a instanceof InputEvent&&a.inputType.startsWith("delete")||qt(t.value)){i=t.value,o(null);return}let d=t.value,c=Math.min(t.selectionStart??i.length,i.length);t.value=i,t.setSelectionRange(c,c),a.stopImmediatePropagation(),Mo(r(),s),o(Ws(d))})}var Eo=["%d system package","%d system packages","%s (after %d repair)","%s (after %d repairs)","%s - %d repairs didn't help","%s - %s","%s - not repaired again (%d repairs didn't help)","%s has no IPv4 address.","%s is not a bridge, so Dawnline cannot join the LAN as a device.","%s needs a manual switch in Components","%s still give devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations.","%s still gives devices the old address: set the public address in the server settings (a DDNS name keeps working), then devices need new configurations.","%s · restored","Access rules","Activity","AmneziaWG is missing from the router","AmneziaWG is running again","AmneziaWG is running again · accepting connections on port %d","AmneziaWG isn't accepting connections on port %d","AmneziaWG isn't running","Backup","Browsers will refuse the portal after that. Renew it with ACME, or choose another certificate in Settings.","Changed: %s.","Choose a disguise on the Server page: it replaces the values set by hand.","Choose another interface name in the server settings.","Components","Connections","DNS for Home-only devices","Dawnline didn't stop it: the router's network restarted, someone stopped it by hand, or it failed.","Firewall","Install it in Dawnline → Components.","Install that AmneziaWG build in Dawnline → Components, or switch the disguise on the Server page.","Internet like a home device","MTU is now automatic","Missing: %s.","No LAN detected.","No free address on %s.","No free link-local range for the internal link.","No free routing table.","People","Personal links","Personal portal","Router","Servers","Speed","System packages","The new version did not answer in LuCI or its agent did not start. Try again from Components, or install it with install.sh to see why.","Traffic","Watchdog","Without kmod-nft-offload every packet on this path passes the firewall twice. Install it and restart Dawnline.","a new build needs a manual switch in Components","answers again","are loaded again","are missing","automatic update failed","background check failed: %s","can't reach Dawnline (luci.dawnline is missing in rpcd)","can't use the network interface %s: it exists and isn't Dawnline's","certificate expires %s","certificate expires within 7 days","certificate renewed · valid until %s","couldn't be repaired: %s","couldn't be updated - the previous rules stay, and changes to access wait until they load","couldn't load - no device is loaded into the tunnels until they do","couldn't load devices into the tunnel","couldn't start","couldn't start · %d failed attempts in %d min","failed - internet goes out directly for now","failed: %s",'has an invalid interface name "%s"',"installed the %s build","installed the %s build · %s","interface %s has Dawnline's settings again","interface %s was changed outside Dawnline","is kept down","is kept down: its disguise has values AmneziaWG cannot take","is kept down: its disguise needs AmneziaWG %s (installed: %s)","is kept down: its disguise needs AmneziaWG %s (installed: none)","is off","is on · traffic enters %s as %s","is ready again","isn't answering on port %d","isn't installed: no tunnel can run - install it in Dawnline → Components","isn't installed: tunnels were left as they are","isn't known to the network service - restart the network or reboot","isn't running","isn't running on this router (fw4): tunnels and the portal are closed","kernel module isn't installed: no tunnel can run - install it in Dawnline → Components","kernel module isn't loaded","loading it","loading them again","moved to word codes","netifd reads its protocol handlers when it starts; it was running before AmneziaWG was installed.","network changed - Dawnline set itself up again","nightly backup failed: %s","public address changed · %s → %s","reaches Dawnline again","reloading rpcd","restarted · version %s","restarting for the AmneziaWG update","restarting it","restoring them","rules for Dawnline are in place again","rules for Dawnline aren't loaded","rules for Dawnline were changed or removed","runs again","runs without its fast path","setting it up again","started","started with the router · version %s","started · accepting connections on port %s","started · version %s","stopped unexpectedly","stopped unexpectedly - started again","update failed","update to %s failed its check - rolled back to %s","updated automatically · %s","updated automatically · %s → %s","updated · %s","updated · %s → %s","updates available · %s","was broken - set up again (%s as %s)"];var Qa={connect:"connections",disconnect:"connections",roam:"connections",device_added:"people",device_removed:"people",devices_removed:"people",device_changed:"people",device_keys:"people",link_changed:"people",person_added:"people",person_removed:"people",person_changed:"people",paused:"people",resumed:"people",expiring:"people",expired_kept:"people",portal_blocked:"problems",device_failing:"problems",device_recovered:"problems"},Rt=["connections","people","problems"];function Ke(t){return{connections:_("Connections"),people:_("People"),problems:_("Problems")}[t]}function Fs(t){return{connections:_("Connects, disconnects and IP changes"),people:_("People and their devices added, changed, paused, removed"),problems:_("Blocked portal sign-ins and devices that can’t connect properly (tunnels and services are in the service log)")}[t]}var Zt=t=>Qa[t]??"problems";function Qt(t){return{awg:"AmneziaWG",dawnline:"Dawnline",portal:_("Portal")}[t]??t}var Xa=["person_added","person_removed","person_changed"];function Ve(t){return t.by?t.by:Xa.includes(t.type)||t.detail==="by admin"||t.detail?.endsWith(" (admin)")?"admin":t.detail?.endsWith(" (portal)")?"portal":null}function qs(t){return(t.detail??"").replace(/ \((admin|portal)\)$/,"").replace(/^by admin$/,"")}var Sn=t=>t.sys?["error","repair","down"].includes(t.sys.level):Zt(t.ev.type)==="problems";function Pn(t){let e=t.keep_days>0?G(t.keep_days,"%s day","%s days"):_("no age limit"),o=t.persist==="off"?_("kept in memory only (lost on reboot)"):t.persist==="10min"?_("saved to flash every 10 minutes"):_("saved to flash hourly");return m(_("Kept for %s, %s, %s."),e,G(t.max,"up to %s event","up to %s events"),o)}function To(t){return{"paused by admin":_("paused by admin"),"end date reached":_("end date reached"),"data limit reached":_("data limit reached"),"outside allowed hours":_("outside allowed hours"),"no server":_("no server"),"server turned off":_("server turned off")}[t]??t}function Ks(t){let e=/^(\d+) days?$/.exec(t);return e?Number(e[1]):null}function Vs(t){let e={name:_("name"),access:_("access"),device_limit:_("device limit"),expires:_("end date"),expire_action:_("what happens at the end"),expire_warn:_("warning before the end"),quota_gb:_("data limit"),quota_period:_("data limit period"),bonus_gb:_("extra data"),hours:_("allowed hours"),dns_mode:_("DNS"),paused:_("pause"),services:_("home services"),circle:_("circle","setting"),home_nets:_("home networks"),server:_("server")};return t.split(", ").map(o=>{let s=/^moved to (.+)$/.exec(o)?.[1];return s?m(_("moved to %s"),s):e[o]??o.replace(/_/g," ")}).join(", ")}function Ys(t){let e={mtu:"MTU",keepalive:_("keep-alive"),lan_bypass:_("LAN Bypass")};return t.split(", ").map(o=>e[o]??o).join(", ")}function So(t){let o={trying:[_("Unable to complete the handshake"),_("The device’s network may be blocking the connection.")],dropped:[_("Handshake complete, but no data"),_("This device is using an outdated configuration.")],shared:[_("On two devices at once"),_("The same configuration connects from two places in turn. Give the other device its own.")],unstable:[_("Connection keeps dropping"),_("It connects, but the connection breaks every few minutes: the network may be cutting it.")]}[t];return o?{title:o[0],line:o[1]}:null}function Js(t){return t.split(", ").map(e=>So(e)?.title??e).join(", ")}function Zs(t,e,o){let r={"cleared|the service log":_("You cleared the service log"),"cleared|the activity log":_("You cleared the activity log"),"exported|all settings":_("You exported all settings"),"imported|settings from a file":_("You imported settings from a file"),"restored|from a file":_("You restored a backup from a file"),"turned on|the personal portal":_("You turned on the personal portal"),"turned off|the personal portal":_("You turned off the personal portal"),"changed|the personal portal":_("You changed the personal portal"),"turned on|the watchdog":_("You turned on the watchdog"),"turned off|the watchdog":_("You turned off the watchdog"),"reset traffic history|for everyone":_("You reset traffic history for everyone")}[`${t}|${o??""}`];if(r)return{text:r,named:!1};let a={"created|server":_("You created server %s"),"changed|server":_("You changed server %s"),"removed|server":_("You removed server %s"),"turned on|server":_("You turned on server %s"),"turned off|server":_("You turned off server %s"),"added|circle":_("You added circle %s"),"changed|circle":_("You changed circle %s"),"removed|circle":_("You removed circle %s"),"restored|backup":_("You restored backup %s")}[`${t}|${e??""}`];return a?{text:a,named:!0}:t==="reset traffic history"&&/^for (.+)$/.exec(o??"")?.[1]?{text:_("You reset traffic history for %s"),named:!0}:null}var Qs=(t,e)=>t==="reset traffic history"?e.replace(/^for /,""):e;function Xs(t){let e=o=>{let s={"other addresses":_("other addresses"),certificate:_("certificate"),redirect:_("redirect"),"devices kept apart":_("devices kept apart"),"devices reach each other":_("devices reach each other"),"devices reach each other in circles":_("devices reach each other in circles"),"home network and internet path":_("home network and internet path"),"the file holds private keys":_("the file holds private keys"),"problems are only logged, nothing is repaired":_("problems are only logged, nothing is repaired"),name:_("name"),"public address":_("public address"),"AmneziaWG port":_("AmneziaWG port"),"tunnel network":_("tunnel network"),connections:Ke("connections"),people:Ke("people"),problems:Ke("problems")};if(s[o])return s[o];let r;return(r=/^port (\d+)$/.exec(o))?m(_("port %s"),r[1]):(r=/^address (.+)$/.exec(o))?m(_("address %s"),r[1]):(r=/^disguise: (.+)$/.exec(o))?m(_("disguise: %s"),r[1]):(r=/^(\d+) events?$/.exec(o))?G(Number(r[1]),"%s event","%s events"):(r=/^older than (\d+) days$/.exec(o))?G(Number(r[1]),"older than %s day","older than %s days"):(r=/^with (\d+) (person|people)$/.exec(o))?G(Number(r[1]),"with %s person","with %s people"):(r=/^(\d+) entr(y|ies)( older than (\d+) days)?$/.exec(o))?r[4]?`${G(Number(r[1]),"%s entry","%s entries")}, ${G(Number(r[4]),"older than %s day","older than %s days")}`:G(Number(r[1]),"%s entry","%s entries"):o};return t.split(" · ").map(o=>o.split(", ").map(e).join(", ")).join(" · ")}var el=null,tl=new Set(Eo);function nl(){return el??(el=Eo.filter(t=>/%[sd]/.test(t)&&t.replace(/%[sd]/g,"").trim()).map(t=>({t,fixed:t.replace(/%[sd]/g,"").length,re:new RegExp(`^${t.split(/(%[sd])/).map(e=>e==="%s"?"(.+?)":e==="%d"?"(\\d+)":e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("")}$`)})).sort((t,e)=>e.fixed-t.fixed))}function zt(t,e=0){let o=t.replace(/ — /g," - ");if(tl.has(o))return po(o);if(e>2)return t;for(let s of nl()){let r=s.re.exec(o);if(r)return m(po(s.t),...r.slice(1).map(i=>zt(i,e+1)))}return o.includes(", ")?o.split(", ").map(s=>zt(s,e+1)).join(", "):t}function er(t,e=120,o=26,s=qe(new Date)){let r=Math.max(1,...t),i=n("div",{class:"dl-spark"});return i.style.width=`${e}px`,i.style.height=`${o}px`,t.forEach((a,l)=>{let d=n("i");d.style.height=`${Math.max(6,a/r*100)}%`,a||d.classList.add("zero");let c=n("span",{},[d]),p=t.length-1-l;we(c,()=>[n("div",{class:"dl-tip-title"},p===0?_("Today"):p===1?_("Yesterday"):Pt(Gt(s,-p)).toLocaleDateString(ie(),{weekday:"short",day:"numeric",month:"short"})),n("div",{class:"dl-muted"},se(a))]),i.appendChild(c)}),i}function tr(t){let e=t==null?"":String(t);return/^[=+\-@\t\r]/.test(e)&&(e=`'${e}`),/[",\r\n]/.test(e)?`"${e.replace(/"/g,'""')}"`:e}function nr(t,e,o){return[t.map(s=>tr(o?.[s]??s)).join(","),...e.map(s=>t.map(r=>tr(s[r])).join(","))].join(` -`)}function ol(t){let e=new Map(t.people.map(s=>[s.id,s.name])),o=new Map(t.people.flatMap(s=>s.devices.map(r=>[r.id,r.name])));return{people:e,devices:o}}function Xe(t,e,o,s="",r=[]){let i=ol(t),a=[...e.map(u=>({ts:u.ts,category:Zt(u.type),type:u.type,person:u.person?i.people.get(u.person)??u.pname??u.person:"",device:u.device?i.devices.get(u.device)??u.dname??u.device:"",detail:u.detail??"",where:u.where??"",by:Ve(u)??""})),...r.map(u=>({ts:u.ts,category:"system",type:`${u.src}.${u.level}`,person:"",device:"",detail:`${u.who?`${u.who} `:""}${u.msg}${u.detail?` -${u.detail}`:""}`,where:Qt(u.src),by:""}))].sort((u,g)=>u.ts-g.ts).map(({ts:u,...g})=>({time:new Date(u*1e3).toISOString(),...g})),l=new Date().toISOString().slice(0,10),d=`dawnline-activity${s?`-${s}`:""}-${l}.${o}`;if(o==="json"){Ae(d,JSON.stringify(a,null,2),"application/json");return}let c=["time","category","type","person","device","detail","where","by"],p={time:_("Time"),category:_("Category"),type:_("Type"),person:_("Person"),device:_("Device"),detail:_("Detail"),where:_("Where"),by:_("By")};Ae(d,nr(c,a,p),"text/csv")}var sl=["","7","30","90"],rl=t=>t?G(Number(t),"Older than %s day","Older than %s days"):_("Everything"),or=t=>t?G(t,"%s event removed","%s events removed"):_("Nothing matched");function dt(t,e,o,s,r,i=!1){let a=n("select",{class:"cbi-input-select"},[n("option",{value:""},_("All categories")),...Rt.map(d=>n("option",{value:d,selected:d===r?"selected":null},Ke(d))),i?n("option",{value:"system",selected:r==="system"?"selected":null},_("System")):""]),l=n("select",{class:"cbi-input-select"},sl.map(d=>n("option",{value:d},rl(d))));ae(t,[n("p",{class:"dl-muted"},`${e} ${_("This cannot be undone; export first if you want a copy.")}`),n("label",{class:"dl-fld"},[n("span",{class:"dl-fld-label"},_("Category")),a]),n("label",{class:"dl-fld"},[n("span",{class:"dl-fld-label"},_("Which events")),l])],[de()," ",H(_("Clear"),async()=>{let d=0;if(a.value!=="system")try{d+=(await N.logsClear({...o,category:a.value,older_days:l.value})).removed}catch(c){F(_e(c),"error",1e4);return}if(i&&(a.value==="system"||a.value===""))try{d+=(await N.serviceLogClear(l.value)).removed}catch(c){le();let p=m(_("The service log was not cleared: %s"),_e(c));F(a.value==="system"?p:`${m(_("Activity: %s."),or(d).toLowerCase())} ${p}`,"error",1e4),s();return}le(),F(or(d),"success",3e3),s()},"negative")])}function It(t,e,o,s){let r=t==="device"?m(_("Clears %s's daily and monthly traffic history. Their person's totals and data limit are not changed."),o):t==="person"?m(_("Clears %s's traffic history and that of their devices. Their data limit starts again from zero."),o):_("Clears traffic history for everyone. Data limits start again from zero.");ae(t==="all"?_("Reset all traffic history?"):m(_("Reset traffic history for %s?"),o),[n("p",{class:"dl-muted"},r)],[de()," ",H(_("Reset"),async()=>{await q(()=>N.usageClear(t,e),_("Traffic history reset"))&&(le(),s())},"negative")])}var il={jc:"0",jmin:"0",jmax:"0",s1:"0",s2:"0",s3:"",s4:"",h1:"1",h2:"2",h3:"3",h4:"4",i1:"",i2:"",i3:"",i4:"",i5:""},al={header_protection_key:"HeaderProtectionKey",content_padding_addition:"ContentPaddingAddition",rekey_after_time:"RekeyAfterTime",rekey_timeout:"RekeyTimeout",reject_after_time:"RejectAfterTime",keepalive_timeout:"KeepaliveTimeout",max_handshake_attempts:"MaxHandshakeAttempts",random_trailers:"RandomTrailers",disable_cookies:"DisableCookies"};function ll(t){let e={};for(let[o,s]of Object.entries(al))t[o]!=null&&t[o]!==""&&(e[s]=String(t[o]));return e}function dl(t,e){let o=t.amnezia,s=o.obfuscation??{},r=d=>s[d]!=null&&s[d]!==""?String(s[d]):il[d],i=o.host.replace(/^\[(.*)\]$/,"$1"),a={H1:r("h1"),H2:r("h2"),H3:r("h3"),H4:r("h4"),I1:r("i1"),I2:r("i2"),I3:r("i3"),I4:r("i4"),I5:r("i5"),Jc:r("jc"),Jmin:r("jmin"),Jmax:r("jmax"),S1:r("s1"),S2:r("s2"),S3:r("s3"),S4:r("s4"),...ll(s),allowed_ips:o.allowed_ips,client_ip:o.client_ip,client_priv_key:o.client_priv_key,client_pub_key:o.client_pub_key,config:t.conf.replace(/\r?\n/g,`\r -`),hostName:i,mtu:o.mtu,persistent_keep_alive:o.persistent_keep_alive,port:Number(o.port),psk_key:o.psk_key,server_pub_key:o.server_pub_key},l={containers:[{container:"amnezia-awg",awg:{isThirdPartyConfig:!0,last_config:JSON.stringify(a),port:String(o.port),protocol_version:s.header_protection_key?"3.1":"2",transport_proto:"udp"}}],defaultContainer:"amnezia-awg",description:e,hostName:i};return o.dns[0]&&(l.dns1=o.dns[0],l.dns2=o.dns[1]||o.dns[0]),l}function cl(t){let e="";for(let o=0;o"u")return null;try{let o=new e.Blob([t]).stream().pipeThrough(new e.CompressionStream("deflate")),s=new Uint8Array(await new e.Response(o).arrayBuffer()),r=new Uint8Array(4+s.length);return new DataView(r.buffer).setUint32(0,t.length,!1),r.set(s,4),r}catch{return null}}async function Po(t,e,o=!0){let s=new TextEncoder().encode(JSON.stringify(dl(t,e))),r=o?await pl(s):null;return`vpn://${cl(r??s)}`}function rr(){return[{id:"off",title:_("Off"),ic:"zap",stealth:0,speed:4,text:_("Plain WireGuard-compatible traffic. Fastest, but easy to recognise and block."),apps:_("Any WireGuard app"),short:_("Any WireGuard app")},{id:"balanced",title:_("Balanced"),ic:"shield",stealth:3,speed:4,needs:"v2",text:_("AmneziaWG 2.0: junk packets, padded packets and a first packet that looks like DNS. For networks that learned to spot 1.0-style junk."),apps:_("AmneziaVPN 4.8.12 or newer, AmneziaWG 2.0+ apps"),short:_("AmneziaWG 2.0+ apps")},{id:"max",title:_("Maximum"),ic:"lock",stealth:4,speed:3,needs:"v3",text:_("AmneziaWG 3.1: encrypted packet headers, random tails and sizes, jittered timing, and a first packet that looks like DNS."),apps:_("Apps with AmneziaWG 3.1 (current AmneziaVPN)"),short:_("AmneziaWG 3.1 apps")}]}var Xt=t=>rr().find(e=>e.id===t),$n=t=>t.v3?"max":t.v2?"balanced":"off",en=t=>t==="standard"?_("Standard (old)"):t==="strong"?_("Strong (old)"):null;function ul(t,e){return e?t==="v2"?_("Needs AmneziaWG 2.0 or newer on the router (kmod-amneziawg and amneziawg-tools from July 2025 on)."):_("Needs AmneziaWG 3.1 on the router (kmod-amneziawg and amneziawg-tools 3.1)."):t==="v2"?_("Needs AmneziaWG on the router."):_("Needs AmneziaWG 3.1 on the router: install it first.")}function sr(t,e){return n("span",{class:"dl-dots",title:m(_("%s: %s of 4"),e,t)},[n("span",{class:"dl-dots-label"},e),n("span",{class:"dl-dots-row"},[0,1,2,3].map(o=>n("i",{class:odom.content(i,rr().map(l=>{let d=!l.needs||t[l.needs],c=l.id===e;return n("button",{type:"button",role:"radio","aria-checked":c?"true":"false","aria-disabled":d?null:"true",class:`dl-method${c?" on":""}${d?"":" off"}`,click:()=>{!d||c||(e=l.id,a(),o(l.id))}},[n("div",{class:"dl-method-head"},[n("span",{class:"dl-method-ic"},v(l.ic)),n("b",{},l.title),l.id===s?n("span",{class:"dl-pill ok"},_("Current")):""]),n("p",{},l.text),n("div",{class:"dl-method-meters"},[sr(l.stealth,_("Stealth")),sr(l.speed,_("Speed"))]),n("div",{class:"dl-method-foot"},d?[v(l.id==="off"?"wireguard":"amneziawg"),n("span",{},l.apps)]:[v("alert"),n("span",{},ul(l.needs,r))])])}));return a(),i}function ir(t,e){return n("div",{class:"dl-corehead"},[n("h3",{},t),e?n("span",{class:"dl-sub"},e):""])}var ar=[["jc","Jc"],["jmin","Jmin"],["jmax","Jmax"],["s1","S1"],["s2","S2"],["s3","S3"],["s4","S4"],["h1","H1"],["h2","H2"],["h3","H3"],["h4","H4"],["i1","I1"],["i2","I2"],["i3","I3"],["i4","I4"],["i5","I5"],["header_protection_key","HeaderProtectionKey"],["content_padding_addition","ContentPaddingAddition"],["rekey_after_time","RekeyAfterTime"],["rekey_timeout","RekeyTimeout"],["reject_after_time","RejectAfterTime"],["keepalive_timeout","KeepaliveTimeout"],["max_handshake_attempts","MaxHandshakeAttempts"],["random_trailers","RandomTrailers"],["disable_cookies","DisableCookies"]];function ml(t,e){let o=p=>p==="header_protection_key"?e:t[p]!=null&&t[p]!=="",s=ar.filter(([p])=>o(p));if(!s.length)return null;let r=(p,u)=>n("span",{class:"dl-pv"},[n("i",{},u),n("b",{},p==="header_protection_key"?_("set","key"):t[p])]),i=(p,u,g,M)=>{let x=ar.filter(([h])=>M.includes(h)&&o(h));return x.length?n("div",{class:"dl-pgroup"},[n("div",{class:"dl-pgroup-head"},[v(u),n("b",{},p)]),n("p",{},g),n("div",{class:"dl-pvals"},x.map(([h,S])=>r(h,S)))]):""},a=Number(t.jc||0),l=(t.i1??"").includes("0x8580")?_("A first packet shaped like a DNS answer."):_("Extra packets sent before the handshake."),d=s.filter(([p])=>p!=="header_protection_key").map(([p,u])=>`${u} = ${t[p]}`).join(` -`),c=n("div",{class:"dl-pgrid"},[i(_("Junk packets"),"zap",a?m(N_(a,"%s random packet of %s–%s bytes before each handshake.","%s random packets of %s–%s bytes before each handshake."),V(a),t.jmin,t.jmax):_("No junk packets."),["jc","jmin","jmax"]),i(_("Padding"),"archive",_("Random bytes in front of handshake, cookie and data packets, so their sizes do not match WireGuard."),["s1","s2","s3","s4"]),i(_("Packet types"),"key",_("The values that replace WireGuard’s recognisable message types."),["h1","h2","h3","h4"]),i(_("Signatures"),"globe",l,["i1","i2","i3","i4","i5"]),i(_("Protection"),"lock",_("AmneziaWG 3.1: encrypted headers, random tails and extra padding on data packets."),["header_protection_key","content_padding_addition","random_trailers","disable_cookies"]),i(_("Timing"),"clock",_("Handshake and key timers vary within these ranges instead of WireGuard’s fixed values."),["rekey_after_time","rekey_timeout","reject_after_time","keepalive_timeout","max_handshake_attempts"])]);return n("details",{class:"dl-params"},[n("summary",{},[v("chevron"),n("span",{},_("Current parameters")),n("span",{class:"dl-pcount"},String(s.length)),n("span",{class:"dl-spacer"}),n("button",{type:"button",class:"dl-linkbtn",click:p=>{p.preventDefault(),xe(d,e?_("Parameters copied. The header protection key is in each device’s file."):_("Parameters copied"))}},_("Copy as config"))]),c])}function lr(t,e){if(/^\s*\[.+\]\s*$/.test(t))return n("span",{class:"dl-conf-sec"},t);let o=/^(\s*[A-Za-z0-9]+\s*=)\s*(.*)$/.exec(t);if(!o)return document.createTextNode(t);let s=/^(\s*)(PrivateKey|PresharedKey)\b/.test(t);return n("span",{},[n("span",{class:"dl-conf-k"},o[1])," ",s&&!e?n("span",{class:"dl-conf-mask"},"••••••••••••••••"):o[2]])}function hl(t){let e=!1,o=n("pre",{class:"dl-conf"}),s=()=>dom.content(o,t.conf.split(` -`).flatMap((a,l)=>l?[` -`,lr(a,e)]:[lr(a,e)])),r=n("button",{type:"button",class:"dl-chipbtn",click:a=>{a.preventDefault(),e=!e,dom.content(r,[v(e?"x":"key"),e?_("Hide key"):_("Show key")]),s()}},[v("key"),_("Show key")]);s();let i=new Blob([t.conf]).size;return n("div",{class:"dl-stack gap8"},[n("div",{class:"dl-filecard"},[n("span",{class:"dl-filecard-ic"},".conf"),n("span",{class:"dl-stack"},[n("span",{class:"dl-mono dl-ellipsis"},t.filename),n("span",{class:"dl-sub"},`AmneziaWG · ${G(i,"%s byte","%s bytes")}`)]),H([v("download")," ",_("Download")],()=>Ae(t.filename,t.conf,"application/octet-stream"),"positive")]),n("details",{class:"dl-params"},[n("summary",{},[v("chevron"),n("span",{},_("Configuration")),n("span",{class:"dl-spacer"}),r,n("button",{type:"button",class:"dl-chipbtn",click:a=>{a.preventDefault(),xe(t.conf,_("Configuration copied"))}},[v("copy"),_("Copy")])]),o])])}function $o(t){let e=t.amnezia.obfuscation??{},o={h1:"1",h2:"2",h3:"3",h4:"4"};return Object.entries(e).every(([s,r])=>r==null||r===""||r===(o[s]??"0"))}async function fl(t,e="file"){if(!t.has_private_key)return n("div",{class:"dl-hint"},_("This device generated its own keys in the browser, so its full configuration only exists on that device."));let o=await Po(t,t.server),s={qr:()=>n("div",{class:"dl-qr-pane"},[_n(t.conf),n("span",{class:"dl-sub"},$o(t)?_("Scan with AmneziaVPN or any WireGuard app on the device."):_("Scan with AmneziaVPN or AmneziaWG on the device."))]),key:()=>n("div",{class:"dl-stack gap8"},[n("div",{class:"dl-linkbox"},[n("span",{class:"dl-mono"},o),H(_("Copy"),()=>xe(o,_("Key copied")))]),n("span",{class:"dl-sub"},m(_("AmneziaVPN → %s. Keep it private."),["+",_("Insert","AmneziaVPN app"),_("Continue","AmneziaVPN app")].join(" → ")))]),file:()=>hl(t)},r=n("div",{class:"dl-connect-body"}),i=n("div",{class:"dl-seg"}),a=l=>{i.querySelectorAll("button").forEach(d=>d.classList.toggle("on",d.dataset.id===l)),dom.content(r,s[l]())};for(let[l,d]of[["file",_("File")],["key",_("Key")],["qr",_("QR code")]])i.appendChild(n("button",{type:"button","data-id":l,click:()=>a(l)},d));return a(e),n("div",{class:"dl-stack gap12"},[i,r])}async function gl(t,e,o,s){let r=Xt(o),a=t.st.people.filter(d=>d.server===e.id).reduce((d,c)=>d+c.devices.length,0);await pe(s?_("Generate new disguise values?"):m(_("Switch to %s?"),r.title),[G(a,"%s AmneziaWG device stops connecting until it imports its configuration again (from their personal link or from you).","%s AmneziaWG devices stop connecting until they import their configuration again (from their personal link or from you)."),o==="max"?_("They need an app with AmneziaWG 3.1."):o==="balanced"?_("They need an app with AmneziaWG 2.0 or newer."):"",t.st.servers.length===1&&a?_("To keep the old disguise for some people, add a second server and move them there."):""].filter(Boolean).join(" "),s?_("Generate and apply"):_("Switch and apply"),!0)&&await q(()=>N.serverObfuscation(e.id,o),s?_("New values applied"):m(_("%s applied"),r.title))&&(F(_("Devices are marked “Update config” until they import again."),"info",6e3),await t.refresh())}function vl(t,e){let o=t.st,s=ue(String(e.port),{inputmode:"numeric",class:"cbi-input-text dl-w-port dl-mono"}),r=ue(e.mtu?String(e.mtu):"",{placeholder:_("Auto"),inputmode:"numeric",class:"cbi-input-text dl-w-port dl-mono"}),i=ue(String(e.keepalive??""),{placeholder:"25",inputmode:"numeric",class:"cbi-input-text dl-w-port dl-mono"}),a=Xt(e.preset)?e.preset:void 0,l=a??$n(o.awg),d=H("",()=>gl(t,e,l,l===a),"neutral"),c=()=>dom.content(d,l===a?[v("reset")," ",_("Generate new values")]:[m(_("Switch to %s"),Xt(l).title)]);c();let p=o.awg_state?.tools!==!1,u=[],g=Ce(_("UDP port"),s,()=>Jt(Number(s.value),u,[_("Opened on the WAN firewall automatically."),Number(s.value)===4500?_("4500 is IPsec’s port: most networks let it through."):""].filter(Boolean).join(" ")));N.serverPorts(e.id).then(h=>{u=h.udp_taken??[],g.refresh()}).catch(()=>{});let M=Ce("MTU",r,()=>$s(r.value,e.mtus)),x=Ce(_("Keep-alive"),i,()=>Ds(i.value));return Vt("",[ir("AmneziaWG",e.ifname),ye("globe",_("Listening"),_("Where devices reach this core from the internet"),[g]),ye("file",_("In every device configuration"),_("Changing these marks devices “Update config” until they import again"),[M,x]),ye("shield",_("Disguise"),_("So networks that block VPNs do not recognise the tunnel. Off = plain WireGuard"),[en(e.preset)?yt("warn",oe(_("%s is AmneziaWG 1.0 junk only, which networks learned to spot; it is not offered any more. Switch to %s or %s: devices import their configuration again."),n("b",{},en(e.preset)),n("b",{},_("Balanced")),n("b",{},_("Maximum")))):"",Dn(o.awg,l,h=>{l=h,c()},a,p),p&&!o.awg.v3?yt("info",oe(_("This router runs an older AmneziaWG. %s becomes available with kmod-amneziawg and amneziawg-tools 3.1."),n("b",{},_("Maximum")))):"",ml(e.obf??{},e.hpk)??"",n("div",{class:"dl-row-end"},[n("span",{class:"dl-sub"},_("Applies at once: every AmneziaWG device imports its configuration again.")),d])]),n("details",{class:"dl-params"},[n("summary",{},[v("chevron"),n("span",{},_("Tunnel")),n("span",{class:"dl-pcount"},"3")]),n("div",{class:"dl-params-body"},[ge(_("Interface"),n("span",{class:"dl-mono"},`${e.ifname} · ${m(_("router %s"),e.address)}`)),ge(_("Tunnel subnet"),n("span",{class:"dl-mono"},e.subnet),_("Device addresses come from it.")),ge(_("Server public key"),n("span",{class:"dl-keyrow"},[n("code",{class:"dl-mono"},e.public_key),H([v("copy")],()=>xe(e.public_key,_("Public key copied")),"neutral",{title:_("Copy"),class:"cbi-button cbi-button-neutral dl-icon-only sm"})]))])])],[n("span",{class:"dl-sub"},_("Port, MTU and keep-alive apply at once.")),H(_("Save"),()=>{let h=Be([g,M,x]);if(h){F(h,"warning");return}return t.save({port:s.value,mtu:r.value,keepalive:i.value},_("AmneziaWG saved"))},"positive")])}function bl(t){let e=Xt(t.preset),o=t.obf??{},s=(a,l)=>n("span",{class:`dl-segs ${l}`},[0,1,2,3].map(d=>n("i",{class:d+o[a]).map(a=>`${a.toUpperCase()} ${o[a]}`);return i.length&&r.push(i.slice(0,2).join(" · ")+(i.length>2?` +${i.length-2}`:"")),["h1","h2","h3","h4"].some(a=>o[a]&&o[a]!==String(["h1","h2","h3","h4"].indexOf(a)+1))&&r.push(_("H1–H4 random")),o.i1&&r.push(/0x(8580|0100)0001/.test(o.i1)?_("DNS-like first packets"):_("Signature packets")),t.hpk&&r.push(_("Encrypted headers")),r.length||r.push(e?.id==="off"?_("Plain WireGuard"):_("No values yet")),n("div",{class:"dl-bento-tile dl-disg"},[n("div",{class:"dl-bento-head"},[n("span",{class:"dl-metric-label"},_("Disguise")),n("a",{href:`${L.url("admin/network/dawnline/server")}?server=${encodeURIComponent(t.id)}§ion=awg`},_("Change"))]),n("div",{class:"dl-disg-id"},[n("span",{class:`dl-disg-ic${e?.id==="off"?" off":""}`},v(e?.ic??"shield")),n("span",{class:"dl-stack"},[n("b",{},e?e.title:en(t.preset)??_("Custom","disguise")),n("span",{class:"dl-sub"},e?e.short:en(t.preset)?_("Switch to Balanced or Maximum"):_("Set by hand"))])]),e?n("div",{class:"dl-disg-meters"},[n("span",{},_("Stealth")),s(e.stealth,"acc"),n("span",{},_("Speed")),s(e.speed,"ok")]):"",n("div",{class:"dl-disg-chips"},r.map(a=>n("span",{},a)))])}var Do={id:"awg",label:"AmneziaWG",settingsCard:vl,overviewTile:bl,connectBlock:fl,qrText:t=>t.conf,appKey:{get label(){return _("Copy AmneziaVPN config")},make:t=>Po(t,t.server)},file:{get label(){return _("Download AmneziaWG config")},make:t=>({name:t.filename,text:t.conf})}};var xl={awg:Do};function Fe(t){return xl[t?.core||"awg"]??Do}function Ot(t,e){return Fe(t.find(o=>o.id===e))}var wl=2,tn=new Set,Ao=null,An=null;async function dr(){if(document.visibilityState!=="visible"||!tn.size)return;let t=await N.rev().catch(()=>null);if(!t)return;let e=Ao!=null&&t.rev!==Ao;Ao=t.rev,t.version&&(An&&t.version!==An?(F(m(_("Dawnline was updated to %s: reload the page."),t.version),"warning",15e3),An=null):An??(An=t.version)),e&&tn.forEach(o=>o())}function Nn(t){return tn.add(t),poll.add(dr,wl),()=>{tn.delete(t),tn.size||poll.remove(dr)}}function ur(t,e,o,s,r=0){let i=[],a=null,l=p=>{a&&p>a.from&&i.push({...a,to:p}),a=null},d=t.filter(p=>p.device===e).sort((p,u)=>p.ts-u.ts);for(let p of d)if(p.type==="connect")l(p.ts),p.detail&&(a={ip:p.detail,from:p.ts,to:p.ts,live:!1});else if(p.type==="roam"){let u=p.detail?.split("→")[1]?.trim();l(p.ts),u&&(a={ip:u,from:p.ts,to:p.ts,live:!1})}else p.type==="disconnect"&&l(p.ts);let c=a;return c&&s?i.push({...c,to:Math.max(o,c.from),live:!0}):l(Math.min(o,r)),i}function et(t){return`${t.city||`${t.lat.toFixed(1)},${t.lon.toFixed(1)}`}|${t.cc}`}function mr(t,e,o,s){let r=new Map;for(let a of e)(a.device===o||!r.has(a.ip))&&r.set(a.ip,a);let i=[];for(let a of t){let l=r.get(a.ip);!l||a.to<=s||i.push({key:et(l),point:l,from:Math.max(a.from,s),to:a.to,live:a.live})}return i}function hr(t){let e=new Map,o=0;for(let s of t)e.set(s.key,(e.get(s.key)??0)+(s.to-s.from)),o+=s.to-s.from;return new Map([...e].map(([s,r])=>[s,o?r/o:0]))}function cr(t,e=2700){let o=[];for(let s of t){let r=o[o.length-1];if(r&&s.key!==r.key&&!s.live&&s.to-s.from{i&&(o.push({kind:"move",k:i,start:s,ms:e}),s+=e);let a=Math.min(1100,Math.max(350,(r.to-r.from)/3600*45));o.push({kind:"stay",k:i,start:s,ms:a}),s+=a}),{steps:o,total:s}}function br(t,e,o){let s=e.findIndex(l=>o>=l.start&&oo>=a.from&&oa.kind==="stay"&&a.k===s),i=t[s];return r.start+r.ms*Math.min(.999,Math.max(0,(o-i.from)/Math.max(1,i.to-i.from)))}var yl=t=>t<=0?0:t>=1?1:t<.5?2*t*t:1-(-2*t+2)**2/2;function wr(t){return-No/2+(1+No)*yl((t-pr)/(1-pr))}var yr=t=>t+gr>=1;function kr(t){return["interpolate",["linear"],["abs",["-",["get","pos"],t]],0,1,gr,1,No/2,0]}function _r(t,e){let o=t==="24h"?86400:t==="7d"?604800:2592e3,s=e-o,r=[],i=(l,d)=>{let c=(l-s)/o;c>.02&&c<.98&&r.push([c,d])},a=new Date(s*1e3);if(t==="24h")for(a.setMinutes(0,0,0);a.getTime()/1e3<=e;)a.getHours()%6===0&&i(a.getTime()/1e3,`${String(a.getHours()).padStart(2,"0")}:00`),a.setHours(a.getHours()+1);else if(t==="7d")for(a.setHours(12,0,0,0);a.getTime()/1e3<=e;a.setDate(a.getDate()+1))i(a.getTime()/1e3,a.toLocaleDateString(ie(),{weekday:"short"}));else{let l=new Date(e*1e3);l.setHours(0,0,0,0);for(let d=0;d<5;d++){let c=new Date(l);c.setDate(l.getDate()-7*d),i(c.getTime()/1e3,c.toLocaleDateString(ie(),{day:"numeric",month:"short"}))}r.reverse()}return r}var Hn=t=>new Date(t*1e3).toLocaleTimeString(ie(),{hour:"2-digit",minute:"2-digit"});function Cr(t,e){let o=s=>new Date(s*1e3).toDateString();return o(t)===o(e)?_("Today"):o(t)===o(e-86400)?_("Yesterday"):new Date(t*1e3).toLocaleDateString(ie(),{weekday:"short",day:"numeric",month:"short"})}var zo="https://unpkg.com/maplibre-gl@6.14.0/dist",Lr={module:"sha384-q26X6R1yFeg0QR9SHHn6U3Nb0ddRRTtwxsahubv5R89/v5nijKpk9KviUp9ZLySk",css:"sha384-1TZtfVz7qtwR5vD7cMwjGT+9uiK4lqE3pbUOPwYO6OCpb+TYP0S9vLIhG02JCU04"},Mr="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",Er="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",kl={online:0,"24h":86400,"7d":7*86400,"30d":30*86400},nn=null;function _l(t){if(t.appendChild(n("link",{rel:"stylesheet",href:`${zo}/maplibre-gl.css`,integrity:Lr.css,crossorigin:"anonymous"})),nn)return nn;let e=`${zo}/maplibre-gl.mjs`;return nn=new Promise((s,r)=>{let i=n("link",{rel:"modulepreload",href:e,integrity:Lr.module,crossorigin:"anonymous"});i.addEventListener("load",()=>s()),i.addEventListener("error",()=>r(new Error("integrity"))),document.head.appendChild(i)}).then(()=>import(e)).then(s=>(s.getWorkerUrl()||s.setWorkerUrl(`${zo}/maplibre-gl-worker.mjs`),s),s=>{throw nn=null,new Error(s?.message==="integrity"?_("The map library from the CDN is not the expected file: not loading it."):_("Could not load the map library (no internet access from this browser?)"))}),nn}var Cl=10,Tr=30,Ll=62,Ml=4,Sr=4.5,El=7,zn="#3b82f6",Ro="#8a8a8a";function Pr(t,e,o=.2,s=64){let[r,i]=t,[a,l]=e,d=a-r,c=d>180?a-360:d<-180?a+360:a,p=c-r,u=l-i,g=Math.hypot(p,u);if(g===0||o===0)return[t,[c,l]];let M=-u/g,x=p/g,h=g*o,S=(r+c)/2+M*h,B=(i+l)/2+x*h,P=[],R=Math.max(2,Math.floor(s));for(let w=0;w<=R;w+=1){let k=w/R,y=1-k;P.push([y*y*r+2*y*k*S+k*k*c,y*y*i+2*y*k*B+k*k*l])}return P}function Io(t,e){let o=new Map;for(let s of t.geo.points){if(t.person&&s.person!==t.person||t.device&&s.device!==t.device||(e==="online"?!s.online:t.now-s.ts>kl[e]))continue;let r=t.device?et(s):t.person?`${s.device}|${s.city}|${s.cc}`:s.device,i=o.get(r);(!i||s.online&&!i.online||s.online===i.online&&s.ts>i.ts)&&o.set(r,s)}return[...o.values()]}function Oo(t,e){let o=0;return Io(t,e).sort((s,r)=>Number(r.online)-Number(s.online)||r.ts-s.ts).map(s=>({...s,n:s.online?0:++o}))}var ct=class{constructor(e,o="online",s=380){this.cb=e;this.map=null;this.gl=null;this.markers=[];this.popup=null;this.theme=null;this.resize=null;this.fitBlind=!1;this.data=null;this.fitted=!1;this.fitKey=null;this.people=[];this.slots=[];this.merged=[];this.piles=new Map;this.dock=null;this.dockKey="";this.dockQuiet=!1;this.piledKeys=new Set;this.foldedKeys=new Set;this.targetZoom=null;this.before=null;this.hiddenKey="";this.focused=null;this.dead=!1;this.places=new Map;this.replaying=null;this.bandDots=[];this.range=o,this.status=n("div",{class:"dl-map-status"}),this.card=n("div",{class:"dl-map-card","aria-live":"polite"}),this.el=n("div",{class:"dl-geomap",style:`height:${s}px`},[this.status,this.card])}async mount(e){this.data=e;try{this.gl=await _l(this.el)}catch(s){this.status.textContent=s.message;return}if(this.dead)return;this.map=new this.gl.Map({container:this.el,style:_t()?Mr:Er,center:[e.geo.home?.lon??20,e.geo.home?.lat??50],zoom:1,renderWorldCopies:!1,attributionControl:{compact:!0},minZoom:1}),this.map.on("style.load",()=>this.layers()),this.map.on("move",()=>this.declutter()),this.map.once("idle",()=>{let s=this.el.querySelector(".maplibregl-ctrl-attrib");s?.classList.remove("maplibregl-compact-show"),s?.removeAttribute("open")}),this.resize=new ResizeObserver(()=>{!this.map||!this.el.clientWidth||!this.el.clientHeight||(this.map.resize(),this.fitBlind&&(this.fitKey=null,this.draw()))}),this.resize.observe(this.el);let o=_t();this.theme=new MutationObserver(()=>{!this.map||_t()===o||(o=_t(),this.map.setStyle(o?Mr:Er))}),this.theme.observe(document.documentElement,{attributes:!0,attributeFilter:["data-darkmode"]})}layers(){if(this.map){this.hiddenKey="",this.map.setProjection({type:"globe"}),this.map.addSource("dl-areas",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.addLayer({id:"dl-area",type:"circle",source:"dl-areas",paint:{"circle-radius":["interpolate",["exponential",2],["zoom"],2,6,6,26,9,140,12,900],"circle-color":["case",["get","online"],zn,Ro],"circle-opacity":["case",["get","online"],.12,.06],"circle-stroke-width":1,"circle-stroke-color":["case",["get","online"],zn,Ro],"circle-stroke-opacity":["case",["get","online"],.35,.15]}}),this.map.addSource("dl-band",{type:"geojson",data:{type:"FeatureCollection",features:this.bandDots}}),this.map.addLayer({id:"dl-band",type:"circle",source:"dl-band",paint:{"circle-radius":1.4,"circle-color":zn,"circle-opacity":0}}),this.map.addSource("dl-arcs",{type:"geojson",data:{type:"FeatureCollection",features:[]}});for(let e of[!1,!0])this.map.addLayer({id:e?"dl-arc-live":"dl-arc-recent",type:"line",source:"dl-arcs",filter:["==",["get","online"],e],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":e?zn:Ro,"line-width":2,"line-opacity":.85,"line-dasharray":[2,2]}});this.draw()}}setRange(e){this.range=e,this.fitKey=null,this.draw()}update(e){this.data=e,this.draw()}destroy(){this.dead=!0,this.dropCard();for(let e of this.piles.values())e.marker.remove();this.piles.clear(),this.theme?.disconnect(),this.resize?.disconnect(),this.map?.remove(),this.map=null}groups(e){let o=new Map;for(let s of e){let r=`${s.person}|${et(s)}`,i=o.get(r);i||(i={key:r,person:s.person,lat:s.lat,lon:s.lon,city:s.city,country:s.country,cc:s.cc,asn:s.asn,org:s.org,online:!1,ts:0,points:[]},o.set(r,i)),i.points.push(s),i.online||(i.online=s.online),i.ts=Math.max(i.ts,s.ts)}return[...o.values()]}draw(){if(!this.map||!this.data||!this.map.getSource("dl-arcs"))return;let e=this.data,o=this.groups(Io(e,this.range)),s=e.person||e.device?null:e.geo.home;for(let d of this.markers)d.remove();this.markers=[];let r=e.person||e.device?null:Sl(o,s),i=o.map(d=>({g:d,at:r?.get(d.key)??[d.lon,d.lat]}));if(this.slots=[],this.map.getSource("dl-areas").setData({type:"FeatureCollection",features:i.map(({g:d})=>({type:"Feature",properties:{online:d.online,key:d.key},geometry:{type:"Point",coordinates:[d.lon,d.lat]}}))}),this.map.getSource("dl-arcs").setData({type:"FeatureCollection",features:s?i.map(({g:d,at:c})=>({type:"Feature",properties:{online:d.online,person:d.person,key:d.key},geometry:{type:"LineString",coordinates:Pr([s.lon,s.lat],c)}})):[]}),s){let d=n("span",{class:"dl-mk-host"});d.innerHTML=`${Mt("server","dl-mk-host-ic")}`,this.dock=d.appendChild(n("span",{class:"dl-mk-dock"})),this.dockQuiet=this.dockKey!=="",this.dockKey="";let c=n("div",{class:"dl-mk-hub",title:`${_("Home router")}${s.city?` · ${s.city}`:""}${s.org?` · ${s.org}`:""}`},[d,n("span",{class:"dl-mk-label chip"},s.city||_("Home"))]);c.addEventListener("mouseenter",()=>this.showMerged(s.city)),c.addEventListener("mouseleave",()=>this.focus(this.focused)),c.addEventListener("click",()=>this.zoomToMerged()),this.add(c,[s.lon,s.lat],!0)}let a=new Map(e.device?Oo(e,this.range).map(d=>[et(d),d.n]):[]);this.people=[],this.places.clear();for(let{g:d,at:c}of i){let p=d.points.length,u=e.people.find(h=>h.id===d.person);if(e.person){let h=e.device?this.deviceMarker(d,c,u,a.get(et(d))??0):this.placeMarker(d,c,u);this.add(h,c);continue}let g=d.points.map(h=>u?.devices.find(S=>S.id===h.device)?.kind??"other"),M=n("span",{class:"dl-mk-badge"});M.innerHTML=p<=2?g.map(h=>Mt(h,"dl-mk-badge-ic")).join(""):String(p);let x=n("button",{type:"button",class:`dl-mk${d.online?" online":""}`,"aria-label":d.city?m(N_(p,"%s: %s device in %s","%s: %s devices in %s"),u?.name??_("Someone"),V(p),d.city):m(N_(p,"%s: %s device in an unknown city","%s: %s devices in an unknown city"),u?.name??_("Someone"),V(p))},[n("span",{class:"dl-mk-av"},[Oe(u?.name??"?"),M]),n("span",{class:"dl-mk-label below"},d.city||d.cc||"?")]);x.addEventListener("mouseenter",()=>this.focus(d.person)),x.addEventListener("mouseleave",()=>this.focus(null)),this.people.push({el:x,person:d.person}),x.addEventListener("click",h=>{h.stopPropagation(),this.openPopup(d,c,x)}),this.add(x,c,!1,u?.name??_("Someone"),`${d.city||d.cc||"?"} · ${d.online?_("now"):ce(d.ts,e.now)}`,d.key,d)}this.declutter();let l=i.map(d=>d.g.key).sort().join(";");if(l!==this.fitKey&&!this.popup){let d=this.fitted&&!this.fitBlind;if(this.fitBlind=!this.el.clientWidth||!this.el.clientHeight,this.fitKey=l,this.fitted=!0,s&&!i.length){let c={center:[s.lon,s.lat],zoom:12};d?this.glide(12,()=>this.map.flyTo({...c,duration:1200})):this.map.jumpTo(c)}else{let c=i.map(p=>p.at);s&&(c.length===0||this.range!=="online"||i.some(p=>p.g.online))&&c.push([s.lon,s.lat]),this.fit(c,d)}}this.status.textContent=i.length||s?"":_("No locations yet"),this.status.style.display=this.status.textContent?"":"none",this.focus(this.focused&&this.people.some(d=>d.person===this.focused)?this.focused:null)}add(e,o,s=!1,r,i,a,l){a&&this.foldedKeys.has(a)&&e.classList.add("merged"),a&&this.piledKeys.has(a)&&e.classList.add("piled"),e.dataset.key=a??"",e.classList.add("dl-mk-new"),requestAnimationFrame(()=>requestAnimationFrame(()=>e.classList.remove("dl-mk-new")));let d=new this.gl.Marker({element:e}).setLngLat(o).addTo(this.map);this.markers.push(d),this.slots.push({marker:d,el:e,at:o,fixed:s,who:r,where:i,g:l})}declutter(){if(!this.map)return;let e=this.map.getZoom();this.el.classList.toggle("dl-lod-far",e=Sr&&e{let l=this.map.project(a.at),d=a.el.querySelector(":scope > .dl-mk-host, :scope > .dl-mk-av, :scope > .dl-mk-tile");return{x:l.x,y:l.y,r:(d?.offsetWidth||24)/2+3,fixed:a.fixed}}),s=o.filter(a=>a.fixed);this.merged=[],this.foldedKeys.clear();let r=this.targetZoom==null?1:Math.min(1,2**(this.targetZoom-this.map.getZoom()));o.forEach((a,l)=>{if(a.fixed)return;let d=this.slots[l],c=d.el.classList.contains("merged")?12:6,p=s.find(u=>Math.hypot(u.x-a.x,u.y-a.y)*r{let c=this.slots[d];!c||c.fixed||(o[d].fixed&&([a,l]=[0,0]),c.marker.setOffset([a,l]),$l(c.el,a,l))})}closePopup(e=!1){let o=this.popup;if(!o||o.card.classList.contains("leaving"))return;o.card.classList.add("leaving"),setTimeout(()=>{this.popup===o&&this.dropCard()},140);let s=this.before;if(this.before=null,!s)return;let r=()=>this.map?.flyTo({...s,duration:800});if(!e)return r();let i=!1,a=()=>{i||(i=!0,window.removeEventListener("pointerup",a,!0),window.removeEventListener("pointercancel",a,!0),setTimeout(r,0))};window.addEventListener("pointerup",a,!0),window.addEventListener("pointercancel",a,!0),setTimeout(a,1500)}dropCard(){this.popup?.off(),this.popup?.card.remove(),this.popup=null}showMerged(e){this.merged.length&&(dom.content(this.card,[n("div",{class:"dl-map-card-head"},[n("b",{},e?m(_("Near %s"),e):_("Near the server")),` · ${_("click to zoom in")}`]),...this.merged.map(o=>n("div",{class:"dl-map-card-row"},[n("span",{},o.who),n("span",{class:"dl-faint"},o.where)]))]),this.card.classList.add("on"))}paintDock(){let e=this.dock;if(!e)return;let o=this.merged.map(r=>`${r.key}:${r.online?1:0}`).join("|");if(o===this.dockKey)return;this.dockKey=o,e.parentElement?.classList.toggle("docked",this.merged.length>0);let s=this.slots.find(r=>r.fixed).at;this.merged.length&&Dr(e,this.merged,this.faceActions(()=>[s]),this.dockQuiet),this.dockQuiet=!1}faceActions(e){return{click:(o,s)=>this.openFace(o,s,e()),hover:o=>this.focus(o?.g?.person??null)}}pileUp(e){let o=new Set;if(!this.data?.person&&!this.data?.device){let s=e.flatMap((l,d)=>!l.fixed&&this.slots[d].el.querySelector(":scope > .dl-mk-av")?[d]:[]),r=new Map(s.map(l=>[l,l])),i=l=>r.get(l)===l?l:i(r.get(l));for(let l of s)for(let d of s){if(d<=l)continue;let c=this.slots[l].el.classList.contains("piled")&&this.slots[d].el.classList.contains("piled");Math.hypot(e[l].x-e[d].x,e[l].y-e[d].y)this.slots[h]),c=d.map($r),p=c.map(h=>h.key).sort().join(",");o.add(p);let u=[d.reduce((h,S)=>h+S.at[0],0)/d.length,d.reduce((h,S)=>h+S.at[1],0)/d.length],g=this.piles.get(p);if(!g){let h=n("span",{class:"dl-mk-pile-box"}),S=[...new Set(d.map(R=>R.g?.city||R.g?.cc||"?"))],B=n("div",{class:"dl-mk-pile"},[h,n("span",{class:"dl-mk-label below"},S.length===1?S[0]:G(d.length,"%s person","%s people"))]);g={marker:new this.gl.Marker({element:B}).setLngLat(u).addTo(this.map),el:B,box:h,faces:c},B.addEventListener("mouseleave",()=>this.focus(this.focused));let P=g;B.addEventListener("click",R=>{R.stopPropagation(),this.zoomInTo(P.faces.map(w=>w.at),!1)}),this.piles.set(p,g)}g.faces=c;let M=g;Dr(g.box,c,this.faceActions(()=>M.faces.map(h=>h.at)));for(let h of l)this.slots[h].el.classList.add("piled"),Object.assign(e[h],{r:0,fixed:!0});let x=this.map.project(u);e.push({x:x.x,y:x.y,r:(g.el.offsetWidth||60)/2+3,fixed:!0})}}this.piledKeys=new Set(this.slots.filter(s=>s.el.classList.contains("piled")).map(s=>s.el.dataset.key??"")),this.slots.forEach((s,r)=>{(!e[r].fixed||s.fixed||s.el.classList.contains("merged"))&&s.el.classList.remove("piled")});for(let[s,r]of this.piles)o.has(s)||(this.piles.delete(s),r.el.classList.add("out"),setTimeout(()=>r.marker.remove(),200))}zoomToMerged(){!this.map||!this.merged.length||this.zoomInTo([this.slots.find(e=>e.fixed).at,...this.merged.map(e=>e.at)],!1)}openFace(e,o,s){if(!e.g)return;if(s.every(i=>Rn(i,e.at)<1))return this.openPopup(e.g,e.at,o);let r=()=>{let i=this.slots.find(a=>a.el.dataset.key===e.key);i?.g&&!i.el.classList.contains("merged")&&!i.el.classList.contains("piled")&&this.openPopup(i.g,i.at,i.el)};this.zoomInTo(this.nearby(e.at),!0)?this.map.once("moveend",r):r()}nearby(e){return[e,...this.slots.filter(o=>!o.fixed&&o.at!==e&&Rn(o.at,e)<=Tr).map(o=>o.at)]}zoomInTo(e,o){let s=new this.gl.LngLatBounds;for(let p of e)s.extend(p);let r=e.some(p=>e.some(u=>Rn(p,u)>Tr)),i=this.map.cameraForBounds(s,{padding:50,maxZoom:r?12:Cl}),a=this.map.getZoom(),l=e.map(p=>this.map.project(p)),d=0;l.forEach((p,u)=>l.slice(u+1).forEach(g=>{let M=Math.hypot(p.x-g.x,p.y-g.y),x=a+Math.log2(Ll/Math.max(M,1e-6));x<=12&&(d=Math.max(d,x))}));let c=Math.min(12,Math.max(i?.zoom??0,d));return c<=a+.05?!1:(o&&!this.before&&(this.before={center:this.map.getCenter().toArray(),zoom:a}),this.map.flyTo({center:i?.center??s.getCenter(),zoom:c,duration:800}),!0)}placeMarker(e,o,s){let r=this.data.now,i=[...e.points].sort((u,g)=>Number(g.online)-Number(u.online)||g.ts-u.ts)[0],a=s?.devices.find(u=>u.id===i.device)?.kind??"other",l=e.points.length,d=n("span",{class:"dl-mk-tile"});d.innerHTML=Mt(a,"dl-mk-tile-ic")+(l>1?`${l}`:"");let c=e.online?_("now"):ce(e.ts,r),p=n("button",{type:"button",class:`dl-mk place${e.online?" online":""}`,style:e.online?null:`--dl-mk-fade:${Math.max(.4,1-.6*(r-e.ts)/(30*86400)).toFixed(2)}`,"aria-label":e.city?m(N_(l,"%s device in %s, %s","%s devices in %s, %s"),V(l),e.city,c):m(N_(l,"%s device in an unknown city, %s","%s devices in an unknown city, %s"),V(l),c)},[d,n("span",{class:"dl-mk-label below"},[e.city||e.cc||"?",n("span",{class:"dl-mk-when"},c)])]);return p.addEventListener("click",u=>{u.stopPropagation(),this.openPopup(e,o,p)}),p}deviceMarker(e,o,s,r){let i=s?.devices.find(p=>p.id===e.points[0].device)?.kind??"other",a=n("span",{class:"dl-mk-tile"}),l=n("span",{class:"dl-mk-label below"}),d=n("button",{type:"button",class:"dl-mk place step"},[a,l]);d.addEventListener("click",p=>{p.stopPropagation(),this.openPopup(e,o,d)});let c=et(e);return this.places.set(c,{el:d,tile:a,label:l,when:null,g:e,n:r,kind:i}),this.paintPlace(c,!1),d}paintPlace(e,o){let s=this.places.get(e);if(!s)return;let r=this.replaying,i=r?r.active===e:s.g.online,a=s.el.classList.contains("online"),l=s.g.city||s.g.cc||"?";s.el.classList.toggle("online",i),s.el.classList.toggle("faded",!!r&&!i),s.tile.classList.toggle("sm",!i),i||!s.n?s.tile.innerHTML=Mt(s.kind,"dl-mk-tile-ic"):s.tile.textContent=String(s.n),s.when=null,i?(s.when=n("span",{class:`dl-mk-when${r?" inline":""}`},r?r.when:_("now")),s.label.replaceChildren(l,r?" · ":"",s.when)):s.label.replaceChildren(`${l} · ${s.g.online?_("now"):ce(s.g.ts,this.data.now)}`);let d=i?r?r.when:_("now"):s.g.online?_("now"):ce(s.g.ts,this.data.now);s.el.setAttribute("aria-label",`${s.n?`${s.n}: `:""}${s.g.city||_("an unknown city")}, ${d}`),o&&i&&!a&&(s.el.classList.remove("arrive"),s.el.offsetWidth,s.el.classList.add("arrive"),setTimeout(()=>s.el.classList.remove("arrive"),500))}replay(e,o=!0){let s=this.replaying;if(this.replaying=e,s&&e&&s.active===e.active){let r=e.active?this.places.get(e.active):null;r?.when&&(r.when.textContent=e.when);return}for(let r of this.places.keys())r!==e?.active&&this.paintPlace(r,o);e?.active&&this.paintPlace(e.active,o),this.declutter(),setTimeout(()=>this.declutter(),320)}hoverPlace(e){for(let[o,s]of this.places)s.el.classList.toggle("hl",o===e)}band(e,o){if(this.bandDots=[],this.map&&e&&o){let s=Pr(e,o),r=s.map(c=>this.map.project(c)),i=[0];for(let c=1;ci[d]?(p-i[d])/(i[d+1]-i[d]):0,g=[s[d][0]+(s[d+1][0]-s[d][0])*u,s[d][1]+(s[d+1][1]-s[d][1])*u];this.bandDots.push({type:"Feature",properties:{pos:c/l},geometry:{type:"Point",coordinates:g}})}}this.map?.getLayer("dl-band")&&(this.map.setPaintProperty("dl-band","circle-opacity",0),this.map.getSource("dl-band").setData({type:"FeatureCollection",features:this.bandDots}))}bandAt(e){this.map?.getLayer("dl-band")&&this.map.setPaintProperty("dl-band","circle-opacity",kr(e))}focus(e){this.focused=e;for(let a of this.people)a.el.classList.toggle("dim",!!e&&a.person!==e),a.el.classList.toggle("hl",a.person===e);let o=e?["case",["==",["get","person"],e],.85,.15]:.85;for(let a of["dl-arc-live","dl-arc-recent"])this.map?.getLayer(a)&&this.map.setPaintProperty(a,"line-opacity",o);if(this.card.classList.toggle("on",!!e),!e||!this.data)return;let s=this.data,r=s.people.find(a=>a.id===e),i=Io(s,this.range).filter(a=>a.person===e).sort((a,l)=>Number(l.online)-Number(a.online)||l.ts-a.ts);dom.content(this.card,[n("div",{class:"dl-map-card-head"},[n("b",{},r?.name??e),` · ${G(i.length,"%s device","%s devices")}`]),...i.map(a=>n("div",{class:"dl-map-card-row"},[n("span",{},r?.devices.find(l=>l.id===a.device)?.name??_("Device")),n("span",{class:"dl-faint"},`${a.city||a.cc||"?"} · ${a.online?_("now"):ce(a.ts,s.now)}`)]))])}fit(e,o=!1){if(!e.length)return;let s=(p,u)=>{let g=Math.PI/180,M=(u[1]-p[1])*g,x=(u[0]-p[0])*g,h=Math.sin(M/2)**2+Math.cos(p[1]*g)*Math.cos(u[1]*g)*Math.sin(x/2)**2;return 12742*Math.asin(Math.sqrt(h))},r=[e.reduce((p,u)=>p+u[0],0)/e.length,e.reduce((p,u)=>p+u[1],0)/e.length],i=e;if(e.length>=5){let p=[...e].sort((u,g)=>s(r,u)-s(r,g));i=p.slice(0,Math.ceil(p.length*.9))}let a=new this.gl.LngLatBounds(i[0],i[0]);i.forEach(p=>a.extend(p));let l=this.el.clientHeight||380,d=!!this.data?.person,c={padding:{top:this.data?.device?Math.min(56,l/4):Math.min(60,l/5),bottom:d?Math.min(52,l/4):Math.min(40,l/8),left:48,right:48},maxZoom:this.data?.person?11:12};o?this.glide(this.map.cameraForBounds(a,c)?.zoom??null,()=>this.map.fitBounds(a,{...c,duration:1200})):this.map.fitBounds(a,{...c,duration:0})}glide(e,o){this.targetZoom=e,this.declutter(),this.map.once("moveend",()=>{this.targetZoom=null,this.declutter()}),o()}openPopup(e,o,s){let r=this.data,i=[e.city,e.cc||e.country].filter(Boolean).join(", "),a=[...new Set(e.points.map(w=>w.person))],l=a.length===1?r.people.find(w=>w.id===a[0])?.name:void 0,d=e.points.sort((w,k)=>Number(k.online)-Number(w.online)||k.ts-w.ts).map(w=>{let k=r.people.find(O=>O.id===w.person),y=k?.devices.find(O=>O.id===w.device);return n("button",{type:"button",class:"dl-pop-row",click:()=>this.cb.openDevice(w.person,w.device)},[n("span",{class:`dl-pop-dot${w.online?" on":""}`}),n("span",{class:"dl-pop-name"},[n("b",{},k?.name??w.person),` · ${y?.name??_("device")}`]),n("span",{class:"dl-faint dl-nowrap"},w.online?_("now"):ce(w.ts,r.now))])}),c=n("div",{class:"dl-pop"},[n("div",{class:"dl-pop-head"},[n("span",{class:"dl-pop-net"},v("globe")),n("div",{class:"dl-stack"},[n("strong",{},e.org||_("Unknown network")),n("span",{class:"dl-faint"},[e.asn?`AS${e.asn} · `:"",i?`${i} · ${_("approximate")}`:_("approximate location")])])]),n("div",{class:"dl-pop-list"},d),a.length===1?n("div",{class:"dl-pop-actions"},[n("button",{type:"button",class:"cbi-button cbi-button-positive important",click:()=>this.cb.openPerson(a[0])},l?m(_("Open %s"),l):_("Open person"))]):""]);this.zoomInTo(this.nearby(o),!0),this.dropCard();let p=n("div",{class:"dl-root dl-popcard",role:"dialog"},[n("span",{class:"dl-popcard-tip"}),c]);document.body.appendChild(p);let u=this.el,g=s?.querySelector(".dl-mk-av, .dl-mk-tile")??s??null,M=()=>{if(!g)return;let w=g.getBoundingClientRect(),k=u.getBoundingClientRect(),y=w.left+w.width/2,O=w.top+w.height/2;p.classList.toggle("away",yk.right||Ok.bottom);let b=p.offsetWidth,f=p.offsetHeight,T=w.top-f-12>=8||w.top>window.innerHeight-w.bottom,C=Math.min(Math.max(8,y-b/2),window.innerWidth-b-8);p.classList.toggle("above",T),p.classList.toggle("below",!T),p.style.left=`${C}px`,p.style.top=`${T?w.top-f-12:w.bottom+12}px`,p.style.setProperty("--tip-x",`${y-C}px`)},x=w=>{w.target?.closest(".dl-popcard, .maplibregl-marker")||this.closePopup(!0)},h=w=>{w.key==="Escape"&&this.closePopup()},S=w=>{w.target instanceof Element&&w.target.closest(".dl-popcard")||this.closePopup()},B=()=>this.closePopup();this.map.on("move",M),window.addEventListener("scroll",S,{capture:!0,passive:!0}),window.addEventListener("resize",M),document.addEventListener("pointerdown",x,!0),document.addEventListener("keydown",h);let P=Ee(B);window.addEventListener("pagehide",B),this.popup={card:p,off:()=>{this.map?.off("move",M),window.removeEventListener("scroll",S,!0),window.removeEventListener("resize",M),document.removeEventListener("pointerdown",x,!0),document.removeEventListener("keydown",h),P(),window.removeEventListener("pagehide",B)}};let R=window.setInterval(()=>{if(this.popup?.card!==p)return clearInterval(R);(!u.isConnected||!u.getClientRects().length)&&this.dropCard()},400);M()}};function Tl(t,e=6){let o=t.map(s=>({x:s.x,y:s.y}));for(let s=0;s<16;s++){let r=!1;for(let i=0;i[s.x-t[r].x,s.y-t[r].y])}function Sl(t,e){let o=new Map,s=e?[[e.lon,e.lat]]:[],r=i=>s.some(a=>Rn(i,a)<1.3);for(let i of[...t].sort((a,l)=>a.key>>12)/1048575),d=(a&4095)/4096*2*Math.PI,c=[i.lon,i.lat];for(let p=0;p<24;p++){let u=d+p*2.39996,g=Math.min(8,l+p*.25);if(c=[i.lon+g*Math.sin(u)/(111.32*Math.cos(i.lat*Math.PI/180)),i.lat+g*Math.cos(u)/111.32],!r(c))break}s.push(c),o.set(i.key,c)}return o}function Pl(t){let e=2166136261;for(let o=0;o>>0}function $r(t){return{key:t.el.dataset.key??"",who:t.who??_("Someone"),where:t.where??"",online:!!t.g?.online,at:t.at,badge:t.el.querySelector(".dl-mk-badge")?.innerHTML??"",g:t.g}}function Dr(t,e,o,s=!1){let r=e.length>3,i=()=>[...t.children].filter(x=>!x.classList.contains("out")),a=new Map(i().map(x=>[x,x.getBoundingClientRect().left])),l=t.getBoundingClientRect().width,d=new Map;t.querySelectorAll(".dl-mk-face:not(.out)").forEach(x=>d.set(x.dataset.key??"",x));let c=t.querySelector(".dl-mk-more:not(.out)"),p=x=>{Object.assign(x.style,{position:"absolute",left:`${x.offsetLeft}px`,top:`${x.offsetTop}px`,transform:""}),x.classList.add("out"),setTimeout(()=>x.remove(),200)},u=[];for(let x of e.slice(0,r?2:3)){let h=d.get(x.key);if(d.delete(x.key),!h){let P=n("button",{type:"button",class:`dl-mk-face${s?"":" in"}`,"data-key":x.key},[n("span",{class:"dl-mk-av"},Oe(x.who)),n("span",{class:"dl-mk-badge"})]);P.addEventListener("animationend",()=>P.classList.remove("in"),{once:!0}),h=P}let S=h,B=S.querySelector(".dl-mk-badge");B.innerHTML!==x.badge&&(B.innerHTML=x.badge),S.title=`${x.who} · ${x.where}`,S.setAttribute("aria-label",`${x.who}, ${x.where}`),S.classList.toggle("on",x.online),S.onclick=P=>{P.stopPropagation(),o.click(x,S)},S.onmouseenter=()=>o.hover(x),S.onmouseleave=()=>o.hover(null),u.push(S)}for(let x of d.values())p(x);if(r){if(!c){c=n("span",{class:`dl-mk-more${s?"":" in"}`});let x=c;x.addEventListener("animationend",()=>x.classList.remove("in"),{once:!0})}c.textContent=`+${e.length-2}`,u.push(c)}else c&&p(c);let g=null;for(let x of u)(g?g.nextElementSibling:t.firstElementChild)!==x&&(g?g.after(x):t.prepend(x)),g=x;for(let x of u){let h=a.get(x);if(h==null)continue;let S=h-x.getBoundingClientRect().left;Math.abs(S)<.5||(x.style.transition="none",x.style.transform=`translateX(${S}px)`,x.offsetWidth,x.style.transition="",x.style.transform="")}t.style.width="";let M=t.getBoundingClientRect().width;if(l&&Math.abs(M-l)>.5){t.style.width=`${l}px`,t.offsetWidth,t.style.width=`${M}px`;let x=()=>{t.style.width="",t.removeEventListener("transitionend",x)};t.addEventListener("transitionend",x),setTimeout(x,400)}}function Rn(t,e){let o=Math.PI/180,s=Math.sin((e[1]-t[1])*o/2)**2+Math.cos(t[1]*o)*Math.cos(e[1]*o)*Math.sin((e[0]-t[0])*o/2)**2;return 12742*Math.asin(Math.min(1,Math.sqrt(s)))}function $l(t,e,o){let s=t.querySelector(":scope > .dl-mk-ptr"),r=Math.hypot(e,o);if(r<1){s?.remove();return}s||(s=n("span",{class:"dl-mk-ptr"},[n("i",{class:"line"}),n("i",{class:"spot"})]),t.prepend(s));let i=s.firstElementChild,a=s.lastElementChild;i.style.width=`${r}px`,i.style.transform=`rotate(${Math.atan2(-o,-e)}rad)`,a.style.transform=`translate(${-e}px, ${-o}px)`}function Bt(t,e,o=!0){let s=[["online",_("Online now")],["24h",_("24h")],["7d",_("7 days")],["30d",_("30 days")]],r=n("div",{class:"dl-seg",role:"tablist"});for(let[i,a]of s)i==="online"&&!o||r.appendChild(n("button",{type:"button",role:"tab",class:i===t?"on":"","data-v":i,click:()=>{r.querySelectorAll("button").forEach(l=>l.classList.toggle("on",l.dataset.v===i)),e(i)}},a));return r}var Ar={"24h":86400,"7d":7*86400,"30d":30*86400},Bo=(t,e)=>`${(t/e*100).toFixed(3)}%`,In=class{constructor(e,o,s){this.map=e;this.range=o;this.el=n("div",{class:"dl-dplaces"});this.controls=n("div",{class:"dl-map-replay"});this.pending=null;this.rows=new Map;this.st=[];this.steps=[];this.total=0;this.ms=0;this.stepI=-1;this.on=!1;this.playing=!1;this.raf=0;this.last=0;this.endTimer=0;this.play=n("button",{type:"button",class:"dl-map-btn"});this.chip=n("span",{class:"dl-map-chip"});this.stop=n("button",{type:"button",class:"dl-map-btn",title:_("Back to now"),"aria-label":_("Back to now")},v("x"));this.reduced=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;this.data=s,this.play.addEventListener("click",()=>this.toggle()),this.stop.addEventListener("click",()=>this.end()),this.paint()}mapData(){let e=this.data;return{geo:e.geo,people:[e.person],now:e.now,person:e.person.id,device:e.device.id}}update(e){let o={...this.pending??this.data,...e};if(this.on){this.pending=o;return}this.data=o,this.map.update(this.mapData()),this.paint()}setRange(e){this.end(),this.range=e,this.map.setRange(e),this.paint()}destroy(){cancelAnimationFrame(this.raf),clearTimeout(this.endTimer)}paint(){let e=this.data,o=Ar[this.range],s=e.now-o,r=mr(ur(e.events??[],e.device.id,e.now,e.device.online,e.device.handshake),e.geo.points,e.device.id,s),i=hr(r);this.st=fr(r);let a=Oo(this.mapData(),this.range),l=r.length>0;this.el.classList.toggle("strips",l),this.el.classList.toggle("can-replay",this.st.length>1),this.rows.clear(),dom.content(this.el,a.length?[...a.map(d=>{let c=et(d),p=i.get(c),u=l?n("div",{class:`dl-dplace-strip${d.online?" live":""}`},r.filter(M=>M.key===c).map(M=>n("i",{style:`left:${Bo(M.from-s,o)};width:${Bo(M.to-M.from,o)}`}))):"",g=n("div",{class:"dl-dplace-row"},[n("span",{class:`dl-dplace-n${d.online?" live":""}`},d.online?v(e.device.kind):String(d.n)),n("span",{class:"dl-row-main dl-stack"},[n("span",{},[d.city||d.cc||_("Unknown city"),d.org?n("span",{class:"dl-muted"},` · ${d.org}`):""]),n("span",{class:"dl-faint"},[n("span",{class:"dl-mono"},d.ip),p!=null?` · ${m(_("%s%% of the time"),p>0&&p<.005?"<1":Math.round(p*100))}`:""])]),n("span",{class:d.online?"dl-dplace-now":"dl-faint dl-nowrap"},d.online?_("now"):ce(d.ts,e.now)),u]);if(g.addEventListener("mouseenter",()=>this.map.hoverPlace(c)),g.addEventListener("mouseleave",()=>this.map.hoverPlace(null)),u){let M=x=>{let h=u.getBoundingClientRect();this.seek(s+o*Math.min(1,Math.max(0,(x.clientX-h.left)/h.width)))};u.addEventListener("pointerdown",x=>{u.setPointerCapture(x.pointerId),M(x)}),u.addEventListener("pointermove",x=>x.buttons&&M(x))}return this.rows.set(c,g),g}),l?n("div",{class:"dl-dplace-axis"},_r(this.range,e.now).map(([d,c])=>n("span",{style:`left:${(d*100).toFixed(2)}%`},c))):""]:n("div",{class:"dl-sub"},_("No locations in this period."))),this.paintControls()}paintControls(){dom.content(this.play,v(this.playing?"pause":"play")),this.play.title=this.playing?_("Pause","replay"):_("Replay this period"),this.play.setAttribute("aria-label",this.play.title),dom.content(this.controls,this.on?[this.play,this.chip,this.stop]:this.st.length>1?[this.play]:[])}begin(){this.on=!0,{steps:this.steps,total:this.total}=vr(this.st,this.reduced?400:Ho),this.ms=0,this.stepI=-1,this.map.replay({active:null,when:""},!0)}toggle(){if(this.playing){this.playing=!1,cancelAnimationFrame(this.raf),this.paintControls();return}clearTimeout(this.endTimer),(!this.on||this.ms>=this.total)&&this.begin(),this.playing=!0,this.last=performance.now(),this.paintControls(),this.raf=requestAnimationFrame(e=>this.frame(e))}frame(e){if(this.playing){if(this.ms=Math.min(this.total,this.ms+(e-this.last)),this.last=e,this.show(!0),this.msthis.frame(o));return}this.playing=!1,this.paintControls(),this.endTimer=window.setTimeout(()=>this.end(),1500)}}seek(e){this.st.length<2||(clearTimeout(this.endTimer),this.on||this.begin(),this.ms=xr(this.st,this.steps,e),this.stepI=-1,this.show(!1),this.paintControls())}show(e){let o=br(this.st,this.steps,this.ms),s=this.st[o.step.k];if(o.step.kind==="move"){let a=this.st[o.step.k-1];o.i!==this.stepI&&(this.map.replay({active:null,when:""},e),this.map.band([a.point.lon,a.point.lat],[s.point.lon,s.point.lat]));let l=wr(o.q);this.reduced||this.map.bandAt(l),(this.reduced?o.q>=.5:yr(l))&&this.map.replay({active:s.key,when:Hn(o.t)},e)}else o.i!==this.stepI&&this.map.band(),this.map.replay({active:s.key,when:Hn(o.t)},e);this.stepI=o.i;let r=this.data,i=r.now-Ar[this.range];this.el.classList.add("replay"),this.el.style.setProperty("--at",Bo(o.t-i,r.now-i));for(let[a,l]of this.rows)l.classList.toggle("cur",a===s.key);this.chip.textContent=`${Cr(o.t,r.now)}, ${Hn(o.t)} · ${s.point.city||s.point.cc||"?"}`}end(){if(cancelAnimationFrame(this.raf),clearTimeout(this.endTimer),!!this.on){this.on=!1,this.playing=!1,this.ms=0,this.stepI=-1,this.map.band(),this.map.replay(null,!1),this.el.classList.remove("replay");for(let e of this.rows.values())e.classList.remove("cur");this.pending?(this.data=this.pending,this.pending=null,this.map.update(this.mapData()),this.paint()):this.paintControls()}}};function jt(t){return`${L.url("admin/network/dawnline/server")}?${t?`server=${encodeURIComponent(t)}&`:""}section=people`}function He(t,e){return`${L.url("admin/network/dawnline/person")}?id=${encodeURIComponent(t)}${e?`&device=${encodeURIComponent(e)}`:""}`}function Nr(t){let e=So(t.state);return e?[n("span",{class:"dl-dstat warn"},e.title),n("span",{class:"dl-sub"},e.line)]:null}function Dl(t,e){return e?t.kind==="phone"||t.kind==="tablet"?e.mtus.phone:e.mtus.computer:t.mtu?null:t.mtu_used??null}function Hr(t,e,o,s,r,i,a){let l=Me(e,o,s);ae(t,[l],[de()," ",H(_("Save"),async()=>{let d=l.help();if(d.bad){F(d.text,"warning");return}await q(()=>N.deviceUpdate(i,void 0,void 0,r()),_("Saved"))&&(le(),await a())},"positive")]),setTimeout(()=>o.select(),50)}function zr(t,e){return n("input",{type:"text",class:"cbi-input-text",inputmode:"numeric",maxlength:4,value:t==null?"":String(t),placeholder:e})}function Al(t,e,o){let s=Dl(t,e),r=zr(t.mtu||null,s?m(_("Automatic: %s"),s):null);Hr(m(_("MTU of %s"),t.name),"MTU",r,()=>As(r.value),()=>({mtu:r.value.trim()}),t.id,o)}function Nl(t,e,o){let s=zr(t.keepalive,e?m(_("As the server: %s"),e.keepalive):null);Hr(m(_("Keep-alive of %s"),t.name),_("Keep-alive"),s,()=>Ns(s.value),()=>({keepalive:s.value.trim()}),t.id,o)}function Rr(t,e,o,s){let r=Kt(e,o),i=(l,d,c,p)=>n("span",{class:"dl-kv-act"},[n("span",{},[l,d?[" ",n("span",{class:"dl-faint"},d)]:""]),n("button",{type:"button",class:"dl-linkbtn","aria-label":c,click:p},_("Change"))]),a=t.keepalive_used;return[["MTU",i(t.mtu_used==null?"—":String(t.mtu_used),t.mtu?"":_("automatic"),_("Change the MTU"),()=>Al(t,o,s))],[_("Keep-alive"),i(a==null?"—":a?m(_("%s s"),a):_("Off"),t.keepalive!=null?"":_("as the server"),_("Change the keep-alive"),()=>Nl(t,o,s))],[_("LAN Bypass"),n("span",{},[t.lan_bypass?r.length?m(_("On, except %s (home)"),bn(r)):_("On"):_("Off")," ",n("span",{class:"dl-faint"},_("set when it was added"))])]]}function Hl(t){return t?new Date(t*1e3).toLocaleString(ie(),{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function jo(t,e,o=!1){return n("div",{class:"dl-kvrow"},[n("span",{class:"dl-kvrow-k"},t),n("button",{type:"button",class:`dl-kvrow-v copy${o?" dl-mono":""}`,title:_("Copy"),click:()=>xe(e,m(_("%s copied"),t))},[n("span",{},e),v("copy")])])}function on(t,e){return n("div",{class:"dl-kvrow"},[n("span",{class:"dl-kvrow-k"},t),n("span",{class:"dl-kvrow-v"},e)])}var Ir={connect:["ok","plug"],disconnect:["","plug"],roam:["","network"],device_added:["ok","plus"],device_removed:["","trash"],device_keys:["","reset"]};function zl(t){let e=s=>n("span",{class:"dl-muted"},s),o=Ve(t)==="portal"?_("on the portal"):Ve(t)==="admin"?_("by you"):"";switch(t.type){case"connect":return[...t.detail?oe(_("Connected from %s"),e(t.detail)):[_("Connected")],t.where?e(` · ${t.where}`):""];case"disconnect":return[_("Went offline")];case"roam":return[_("Changed network"),e(` · ${t.detail??""}`)];case"device_added":return o?oe(_("Added %s"),e(o)):[_("Added")];case"device_removed":return o?oe(_("Removed %s"),e(o)):[_("Removed")];default:return o?oe(_("New keys %s"),e(o)):[_("New keys")]}}function Rl(t,e,o){let s=t.filter(r=>r.device===e&&Ir[r.type]).reverse().slice(0,12);return s.length?n("div",{class:"dl-dev-log"},s.map(r=>{let[i,a]=Ir[r.type],l=new Date(r.ts*1e3);return n("div",{class:`dl-dev-log-row${Ve(r)==="admin"?" dl-ev-by-admin":""}`},[Ve(r)==="admin"?n("span",{class:"dl-ev-tile",title:_("Done by you in LuCI")},v("admin")):n("span",{class:`dl-ev-tile ev ${i}`},v(a)),n("span",{class:"dl-row-main"},zl(r)),n("span",{class:"dl-faint dl-nowrap",title:l.toLocaleString(ie())},ce(r.ts,o))])})):n("div",{class:"dl-sub"},_("No activity yet."))}async function Or(t,e,o){let s=await N.status(1).catch(()=>null),r=s?.people.find(a=>a.id===t),i=r?.devices.find(a=>a.id===e);s&&r&&i&&Ye(r,i,{...o,geo:s.geo,now:s.now,today:Ge(s.series),core:Ot(s.servers,r.server),server:s.servers.find(a=>a.id===r.server)})}function Il(t,e,o){let s=n("div",{class:"dl-row-actions"});return dom.content(s,H([v("qr")," ",_("Show the new configuration")],async()=>{let r=await q(()=>N.deviceConfig(t,!0));r&&(s.className="",dom.content(s,await e(r)),o())})),s}async function Ye(t,e,o){let s=await q(()=>N.deviceConfig(e.id));if(!s)return;let r=o.core??Fe(null),i=e,a=t,l=o.geo,d=o.now,c=o.today??qe(new Date),p=o.server,u=$=>r.connectBlock($,e.kind==="phone"||e.kind==="tablet"?"qr":"file"),g=e.config_stale,M=!1,x=()=>Il(e.id,u,()=>(g=!1,A())),h=g?x():await u(s),S=n("div",{class:"dl-drawer-title"}),B=n("div",{}),P=n("div",{}),R=n("div",{},n("div",{class:"dl-sub"},_("Loading…"))),w=[],k=$=>{w=$.filter(E=>E.device===i.id),dom.content(R,Rl($,i.id,d)),f?.update({events:$})},y=async($=!1)=>{let E=o.events?.();if(E&&!$)return k(E);let I=await N.events(2e3,t.id).catch(()=>null);I&&k(I.events)},O="30d",b=null,f=null,T=()=>{dom.content(S,[n("span",{class:`dl-dcard-ic${i.online?" on":""}`},v(i.kind)),n("div",{class:"dl-stack"},[n("div",{class:"dl-title-row"},[n("h3",{},i.name),H([v("edit")],()=>K(),"neutral",{title:_("Rename"),class:"cbi-button cbi-button-neutral dl-icon-only sm"})]),n("span",{class:"dl-sub"},`${a.name} · ${at(i.kind)}`)])]);let $=i.spark.map(([I,D])=>I+D),E=$.reduce((I,D)=>I+D,0);dom.content(B,n("div",{class:"dl-dstats"},[n("div",{class:"dl-dstats-cell wide"},[n("span",{class:"dl-metric-label"},_("Status")),i.link&&!i.disabled&&Nr(i.link)||xn(i,d,_("Waiting for the first connection"),a)]),n("div",{class:"dl-dstats-cell"},[n("span",{class:"dl-metric-label"},_("This month")),n("b",{},se(i.month[0]+i.month[1])),n("span",{class:"dl-sub dl-mono"},`↓ ${se(i.month[1])} ↑ ${se(i.month[0])}`)]),n("div",{class:"dl-dstats-cell"},[n("span",{class:"dl-metric-label"},_("Last 7 days")),n("b",{},se(E)),er($,120,22,c)])])),dom.content(P,n("div",{class:"dl-kv2"},[jo(_("Tunnel address"),i.address),...Rr(i,a,p,()=>(M=!0,A())).map(([I,D])=>on(I,D)),i.hostname&&a.access!=="internet"?jo(_("Local address"),i.hostname):"",i.endpoint&&!l?.points.some(I=>I.device===i.id&&I.ip===i.endpoint)?on(_("Client IP"),i.endpoint):"",on(_("Total"),n("span",{class:"dl-kv-act"},[`↓ ${se(i.total[1])} · ↑ ${se(i.total[0])}`,n("button",{type:"button",class:"dl-linkbtn danger",click:()=>It("device",i.id,i.name,()=>setTimeout(A,300))},_("Reset"))])),on(_("Added"),`${Hl(i.created)} · ${i.created_by==="portal"?_("from the portal"):_("by you")}`),s.amnezia.client_pub_key?jo(_("Public key"),s.amnezia.client_pub_key):on(_("Public key"),"—")])),dom.content(Y,[H([v(i.disabled?"play":"pause")," ",i.disabled?_("Enable"):_("Disable")],async()=>{await q(()=>N.deviceUpdate(i.id,void 0,!i.disabled),i.disabled?_("Device enabled"):_("Device disabled"))&&await A()},"neutral",i.disabled?{}:{class:"cbi-button cbi-button-neutral dl-btn-warn"}),H([v("key")," ",_("New keys")],async()=>{if(!await pe(_("Generate new keys?"),_("The current configuration on this device stops working until it is imported again."),_("Generate"),!0))return;await q(()=>N.deviceRotate(i.id),_("New keys generated"))&&(o.refresh(),z.close(),await Or(a.id,i.id,o))}),n("span",{class:"dl-spacer"}),H([v("trash")," ",_("Remove")],async()=>{await pe(m(_("Remove %s?"),i.name),_("The device is disconnected immediately and its configuration stops working."),_("Remove"),!0)&&await q(()=>N.deviceDelete(i.id),_("Device removed"))&&(z.close(),o.refresh())},"negative")])},C=async()=>{let $=await N.status(1).catch(()=>null),E=$?.people.find(D=>D.id===a.id),I=E?.devices.find(D=>D.id===i.id);!$||!E||!I||(a=E,i=I,l=$.geo,d=$.now,c=Ge($.series),p=$.servers.find(D=>D.id===E.server),T(),(i.config_stale||M)&&!g&&(g=!0,dom.content(j,Q(x()))),M=!1,f?.update({geo:$.geo,now:$.now,person:a,device:i}))},A=async()=>{await C(),o.refresh()},K=()=>{let $=n("input",{type:"text",class:"cbi-input-text",value:i.name}),E=jr($,()=>D.refresh()),I=a.devices.filter(W=>W.id!==i.id).map(W=>W.name),D=Me(_("Name"),$,()=>E(Co($.value,I,_("Shown in the portal and in the app."))));ae(m(_("Rename %s"),i.name),[D],[de()," ",H(_("Save"),async()=>{let W=D.help();if(W.bad){F(W.text,"warning");return}await q(()=>N.deviceUpdate(i.id,$.value,void 0),_("Renamed"))&&(le(),await A())},"positive")]),setTimeout(()=>$.select(),50)},Y=n("div",{class:"dl-drawer-actions"}),Q=$=>[n("div",{class:"dl-dsec-head"},[n("h4",{},_("Connect","section"))]),i.config_stale?wt(_("This device has an older configuration: networks or DNS changed since it was set up. Import it again with the QR code, key or file below.")):"",$],j=n("section",{class:"dl-dsec"},Q(h)),Z=n("section",{class:"dl-dsec"},[n("div",{class:"dl-dsec-head"},[n("h4",{},_("Activity")),n("div",{class:"dl-dsec-actions"},[n("button",{type:"button",class:"dl-linkbtn",click:()=>Xe({people:[a]},w,"csv",i.id)},_("Export")),n("button",{type:"button",class:"dl-linkbtn danger",click:()=>dt(m(_("Clear %s's activity"),i.name),m(_("Removes events about %s."),i.name),{device:i.id},()=>{y(!0),o.refresh()})},_("Clear")),n("a",{href:`${L.url("admin/network/dawnline/diagnostics")}?tab=log`},_("All activity"))])]),R]),te=n("section",{class:"dl-dsec"},[n("div",{class:"dl-dsec-head"},n("h4",{},_("Details","section"))),P]),me="";if(l?.enabled){b=new ct({openPerson:E=>location.href=He(E),openDevice:(E,I)=>location.href=He(E,I)},O,220);let $=f=new In(b,O,{geo:l,now:d??Date.now()/1e3,person:a,device:i,events:o.events?.()??null});me=n("section",{class:"dl-dsec"},[n("div",{class:"dl-dsec-head"},[n("h4",{},_("Locations")),Bt(O,E=>{O=E,$.setRange(E)},!1)]),n("div",{class:"dl-dmap"},[b.el,$.controls]),$.el])}let ke=!i.handshake||i.config_stale,U=n("div",{class:"dl-stack gap16"},ke?[B,j,te,me,Z]:[B,te,me,Z,j]);y();let ne=()=>{C(),y()},he=Nn(ne),fe=window.setInterval(ne,3e4),z=xs(S,U,Y,()=>{clearInterval(fe),he(),f?.destroy(),b?.destroy()});T(),b&&f&&requestAnimationFrame(()=>f&&b?.mount(f.mapData()))}function Br(t,e,o,s){let r=s.core??Fe(null),i=()=>q(()=>N.deviceConfig(o.id,!0)),a=[{label:_("Show QR code"),icon:v("qr"),run:async()=>{let l=await i();l&&ae(`${o.name} · ${_("QR code")}`,n("div",{class:"dl-qr-pane"},[_n(r.qrText(l)),n("span",{class:"dl-sub"},$o(l)?_("Scan with AmneziaVPN or any WireGuard app on the device."):_("Scan with AmneziaVPN or AmneziaWG on the device."))]),de(_("Close")))}},{label:r.file.label,icon:v("download"),run:async()=>{let l=await i();if(!l)return;let d=r.file.make(l);Ae(d.name,d.text,"application/octet-stream")}},r.appKey?{label:r.appKey.label,icon:v("copy"),run:async()=>{let l=await i();l&&xe(await r.appKey.make(l),_("Key copied"))}}:null,null,{label:_("Rename"),icon:v("edit"),run:()=>Ye(e,o,s)},{label:_("New keys"),icon:v("key"),run:async()=>{await pe(_("Generate new keys?"),_("The current configuration on this device stops working until it is imported again."),_("Generate"),!0)&&await q(()=>N.deviceRotate(o.id),_("New keys generated"))&&s.refresh()}},{label:o.disabled?_("Enable"):_("Disable"),icon:v(o.disabled?"play":"pause"),warn:!o.disabled,run:async()=>{await q(()=>N.deviceUpdate(o.id,void 0,!o.disabled),o.disabled?_("Device enabled"):_("Device disabled"))&&s.refresh()}},{label:_("Delete"),icon:v("trash"),danger:!0,run:async()=>{await pe(m(_("Remove %s?"),o.name),_("The device is disconnected immediately and its configuration stops working."),_("Remove"),!0)&&await q(()=>N.deviceDelete(o.id),_("Device removed"))&&s.refresh()}}];Te(t,a)}function jr(t,e){let o=null;return Gs(t,t,s=>{o=s,e()}),t.addEventListener("blur",()=>{o&&(o=null,e())}),s=>o?{text:o,bad:!0}:s}function pt(t,e){let o=t.devices.map(u=>u.name),s=u=>{let g=hs(u),M=1,x=go(g);for(;o.some(h=>h.toLowerCase()===x.toLowerCase());)x=go(g,` ${++M}`);return x},r="phone",i=n("input",{type:"text",class:"cbi-input-text",placeholder:s(r)}),a=jr(i,()=>l.refresh()),l=Me(_("Name"),i,()=>a(i.value.trim()?Co(i.value,o,_("Shown in the portal and in the app.")):{text:m(_("Named after its type: %s."),s(r)),bad:!1})),d=n("div",{class:"dl-kinds",role:"radiogroup","aria-label":_("Type")},fs.map(u=>n("button",{type:"button",role:"radio",class:u===r?"on":"","aria-checked":u===r?"true":"false","data-kind":u,click:()=>{r=u,d.querySelectorAll("button").forEach(g=>{let M=g.dataset.kind===u;g.classList.toggle("on",M),g.setAttribute("aria-checked",M?"true":"false")}),i.placeholder=s(u),l.refresh()}},[v(u),n("span",{},at(u))]))),c=be(!1,_("LAN Bypass")),p=t.devices.length>=t.device_limit;ae(m(_("Add a device for %s"),t.name),[p?n("p",{class:"dl-hint"},m(N_(t.device_limit,"%s already has %s of %s device. As admin you can still add one.","%s already has %s of %s devices. As admin you can still add one."),t.name,V(t.devices.length),V(t.device_limit))):"",n("div",{class:"dl-fld"},[n("span",{class:"dl-fld-label"},_("Type")),d]),n("div",{class:"cbi-value dl-live"},[n("div",{class:"cbi-value-title"},[n("label",{},_("LAN Bypass")),n("div",{class:"dl-sub"},Kt(t,e.server).length?m(_("The device’s local network stays reachable while connected, except %s: your home network."),bn(Kt(t,e.server))):_("The device’s local network stays reachable while connected."))]),n("div",{class:"cbi-value-field"},c)]),l],[de()," ",H(_("Add device"),async()=>{let u=l.help();if(u.bad){F(u.text,"warning");return}let g=i.value.trim()||s(r),M=await q(()=>N.deviceCreate(t.id,g,r,De(c)));M&&(le(),F(m(_("%s added"),g),"success",3e3),e.refresh(),await Or(t.id,M.id,e))},"positive")]),setTimeout(()=>i.focus(),50)}var tt=1080,rn=1512,Je=96,Ol="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",Bl="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",sn=t=>t.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]);function jl(t,e,o){let s=new URL(o),r=s.pathname.slice(1),i=m(_("Hi, %s"),t.name),a=Math.min(92,Math.floor((tt-2*Je)/(.58*i.length))),l=tt-2*Je,d=392,c=40,p=kn(o,2).replace("`${S}`;return``+u(Je+82,Je+42,36,"#a3a3a3",sn(e))+u(Je,276,a,"#ffffff",sn(i),'font-weight="600"')+u(Je,340,40,"#8a8a8a",sn(m(_("Scan to connect to %s"),e)))+``+p+`${sn(r)}`+u(tt/2,d+l+156,34,"#737373",sn(s.host),'text-anchor="middle"')+""}async function Ul(t){let e=new Image;e.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await e.decode();let o=document.createElement("canvas");return o.width=tt,o.height=rn,o.getContext("2d").drawImage(e,0,0,tt,rn),new Promise((s,r)=>o.toBlob(i=>i?s(i):r(new Error(_("Could not draw the card"))),"image/png"))}async function Ur(t){let e=await q(()=>N.personLinks(t));return e?e.link?{link:e.link,links:e.links??[]}:(F(_("The personal portal is off. Turn it on in Settings."),"warning"),null):null}async function On(t){let e=await Ur(t);e&&await xe(e.link,_("Personal link copied"))}async function an(t,e,o={}){let s=t.link,r=t.links;if(s===void 0){let h=await Ur(t.id);if(!h)return;s=h.link,r=h.links}if(!s){F(_("The personal portal is off. Turn it on in Settings."),"warning");return}let i=s,a=await q(()=>Ul(jl(t,e,i)));if(!a)return;let l=new File([a],`${t.id}-invite.png`,{type:"image/png"}),d=URL.createObjectURL(a),c=navigator,p=!!c.canShare?.({files:[l]}),u=!p&&typeof c.share=="function"&&(c.canShare?.({url:i})??!0),g=()=>{URL.revokeObjectURL(d),le()},M=async h=>{try{await c.share(h)}catch{}},x=p?H([v("link")," ",_("Share card")],()=>M({files:[l],title:m(_("Invite %s"),t.name)}),"positive"):u?H([v("link")," ",_("Share link")],()=>M({url:i,title:m(_("Invite %s"),t.name),text:_("Your personal VPN link")}),"positive"):H([v("download")," ",_("Download card")],()=>Ae(l.name,a),"positive");ae(o.title??m(_("Invite %s"),t.name),n("div",{class:"dl-invite"},[n("img",{src:d,alt:m(_("Invite card for %s"),t.name)}),n("div",{class:"dl-invite-side"},[n("p",{class:"dl-muted"},o.lead??m(_("Send %s the card or the link. They open it, add their devices and connect - no account needed."),t.name)),n("button",{type:"button",class:"dl-invite-link",title:_("Copy link"),click:()=>xe(i,_("Personal link copied"))},[n("span",{},i.replace(/^https:\/\//,"")),v("copy")]),...(r??[]).filter(h=>h!==i).map(h=>n("button",{type:"button",class:"dl-invite-link alt",title:_("Copy this link"),click:()=>xe(h,_("Link copied"))},[n("span",{},h.replace(/^https?:\/\//,"")),n("span",{class:`dl-pill ${h.startsWith("http:")?"warn":""}`},h.startsWith("http:")?"HTTP":_("Also")),v("copy")])),n("ol",{class:"dl-invite-steps"},[n("li",{},oe(_("Install %s on the device"),n("b",{},"AmneziaVPN"))),n("li",{},_("Open the link or scan the code")),n("li",{},_("Add the device and connect"))]),n("div",{class:"dl-invite-actions"},[x,H([v("copy")," ",_("Copy link")],()=>xe(i,_("Personal link copied")))])])]),[n("button",{class:"cbi-button cbi-button-neutral",click:g},_("Done"))],"wide")}function ln(t,e){let o=t.servers.find(d=>d.id===e)??t.servers[0],s=t.people.filter(d=>d.server===o.id),r=new Set(s.map(d=>d.id)),i=s.flatMap(d=>d.devices),a=d=>s.reduce((c,p)=>{let u=d(p);return[c[0]+u[0],c[1]+u[1]]},[0,0]),l=o.series?.[o.series.length-1];return{...t,servers:[o],people:s,series:o.series??t.series,events:t.events.filter(d=>d.person?r.has(d.person):!0),geo:{...t.geo,points:t.geo.points.filter(d=>r.has(d.person))},totals:{people:s.length,devices:i.length,online:i.filter(d=>d.online).length,active:s.filter(d=>d.state==="active").length,today:l?[l.rx,l.tx]:[0,0],month:a(d=>d.month)}}}var Wr=3,Uo=class{constructor(){this.n=0;this.shown=0}next(){return++this.n}take(e){return e{let g=e.next(),M=null;try{M=await t.fetch(u),o>=Wr&&F(_("The router answers again."),"success",3e3),o=0}catch{return++o===Wr&&F(_("The router is not answering: what you see may be out of date."),"warning",8e3),null}return M==null||!e.take(g)?null:(t.apply(M,p),M)},r=(p=!1)=>s(p,!1),i=()=>document.visibilityState==="visible",a=()=>i()&&(t.active?.()??!0)?s(!0,!1):Promise.resolve(null);poll.add(a,t.every);let l=t.live?Nn(()=>void(i()&&(t.active?.()??!0)&&s(!0,!0))):null,d=()=>{poll.remove(a),l?.(),c()},c=Ee(d);return{refresh:r,claim:()=>e.claim(),stop:d}}function ut(t){let e=document.activeElement;return!!t&&!!e&&e!==document.body&&t.contains(e)}function Ne(t,e,o=!1){return o&&ut(t)?!1:(dom.content(t,e),!0)}function Gr(t,e){let o=t,s=[{v:"internet",ic:"globe",text:_("Browse the internet through your router. No access to devices at home.")},{v:"lan",ic:"home",text:_("Reach devices at home (NAS, printer, cameras). Internet stays on their own connection.")},{v:"both",ic:"shield",text:_("Home devices and the internet, all through your router.")}],r=n("div",{class:"dl-choices"},s.map(i=>n("button",{type:"button",class:`dl-choice${i.v===o?" selected":""}`,"data-v":i.v,click:()=>{o=i.v,r.querySelectorAll(".dl-choice").forEach(a=>a.classList.toggle("selected",a.dataset.v===i.v)),e?.(i.v)}},[n("span",{class:"dl-choice-title"},[v(i.ic),bt(i.v)]),n("span",{class:"dl-choice-text"},i.text)])));return{el:r,get:()=>o}}function Wo(t){try{return localStorage.getItem(t)}catch{return null}}function Go(t,e){try{localStorage.setItem(t,e)}catch{}}function Wl(t){let e=t.devices.length,o=Math.max(1,t.device_limit,e),s=Math.min(160,o*22+(o-1)*3);return n("div",{class:"dl-slotbar",title:m(N_(t.device_limit,"%s of %s device","%s of %s devices"),e,t.device_limit)},[n("span",{class:"dl-slotbar-segs",style:`width: ${s}px`},Array.from({length:o},(r,i)=>n("i",{class:i>=t.device_limit?"over":it.state==="server_off"?t.paused:!["active","quota","expired"].includes(t.state),Fo=t=>t.state==="server_off"?t.paused:t.state!=="active",qr=t=>Fo(t)?t.state==="server_off"?"paused":t.state:null;function Gl(t,e){let o=rt(t.expires,e);return t.state==="quota"||t.state==="expired"||it(t,o)||!!t.quota_limit&&t.quota_used>=t.quota_limit*.9}function Kr(t,e){return St(t&&fo(t,e)>=0?t:e,1)}var Vr=t=>t.people.map(e=>e.id).sort().join(" "),Yr=!1,Ct=class{constructor(){this.list=n("div",{class:"dl-plist",role:"list"});this.filter=["all","online","attention","paused"].find(e=>e===(new URLSearchParams(location.search).get("filter")??Wo("dl.people.filter")))??"all";this.sort=["seen","name","usage"].find(e=>e===Wo("dl.people.sort"))??"seen";this.query="";this.noFooter=!0;this.serverId=null;this.el=null}async load(){return N.status(30)}scope(e){return this.serverId?ln(e,this.serverId):e}embed(e,o){return this.serverId=o,this.render(e)}person(e){return this.st.people.find(o=>o.id===e)}get today(){return Ge(this.st.series)}deviceOpts(e){return{refresh:()=>this.refresh(),geo:this.st.geo,now:this.st.now,today:this.today,core:Ot(this.st.servers,e.server),server:this.st.servers.find(o=>o.id===e.server)}}take(e,o){let s=this.scope(e),r=Vr(s)!==Vr(this.st);this.st=s,r?this.rebuild():(this.paintCards(o),this.decorate(o))}async update(){await this.poller?.refresh()}async refresh(){this.poller?.claim();let e=await N.status(30).catch(()=>null);e&&(this.st=this.scope(e),this.rebuild())}rebuild(){let e=new Map;for(let s of Array.from(this.list.children))s.dataset.sid&&e.set(s.dataset.sid,s);let o=this.st.people.map(s=>{let r=e.get(s.id)??n("div",{class:"dl-card",role:"listitem","data-sid":s.id});return this.renderCard(r,s.id)});dom.content(this.list,o.length?o:n("div",{class:"dl-plist-none"},this.st.servers.length?_("No people yet. Add someone and send them their personal link."):_("Set up the server first, then add people."))),this.decorate()}paintCards(e=!1){for(let o of this.st.people){let s=this.card(o.id);s&&!(e&&ut(s))&&this.renderCard(s,o.id)}}card(e){return this.list.querySelector(`[data-sid="${CSS.escape(e)}"]`)}render(e){let o=this.scope(e);this.st=o;let s=this,r=n("select",{class:"dl-select","aria-label":_("Sort"),change:d=>{s.sort=d.target.value,Go("dl.people.sort",s.sort),s.decorate()}},[n("option",{value:"seen",selected:s.sort==="seen"?"selected":null},_("Last seen","sort")),n("option",{value:"name",selected:s.sort==="name"?"selected":null},_("Name","sort")),n("option",{value:"usage",selected:s.sort==="usage"?"selected":null},_("Usage","sort"))]),i=n("input",{type:"search",class:"cbi-input-text dl-people-find",placeholder:_("Find…"),"aria-label":_("Find a person or device"),hidden:o.people.length>8?null:"hidden",input:d=>{s.query=d.target.value.trim().toLowerCase(),s.decorate()}}),a=d=>{let c=d.target;d.key==="/"&&!i.hidden&&!["INPUT","TEXTAREA","SELECT"].includes(c?.tagName)&&!c?.isContentEditable&&(d.preventDefault(),i.focus())};document.addEventListener("keydown",a),Ee(()=>document.removeEventListener("keydown",a));let l=n("div",{class:"dl-root"},[s.serverId?"":n("div",{class:"dl-pagehead"},[n("div",{class:"dl-stack"},[n("h2",{class:"dl-h1"},_("People")),n("span",{class:"dl-muted dl-people-count"},this.countText())]),o.servers.length?H([v("plus"),` ${_("Add person")}`],()=>s.openCreate(),"add"):""]),o.servers.length?"":n("div",{class:"alert-message warning"},oe(_("No server yet. %s before adding people."),n("a",{href:L.url("admin/network/dawnline/server")},_("Run the setup wizard")))),n("div",{class:"dl-toolbar"},[n("div",{class:"dl-seg dl-people-tabs",role:"tablist"}),n("div",{class:"dl-toolbar-end"},[i,r,s.serverId?H([v("plus"),` ${_("Add person")}`],()=>s.openCreate(),"add"):""])]),this.list]);return this.el=l,this.rebuild(),this.poller??(this.poller=nt({fetch:()=>N.status(30),every:30,live:!0,active:()=>!!s.el?.isConnected,apply:(d,c)=>s.take(d,c)})),!Yr&&new URLSearchParams(location.search).get("add")&&(Yr=!0,setTimeout(()=>s.openCreate(),100)),Promise.resolve(l)}countText(){let e=this.st.totals;return[G(e.people,"%s person","%s people"),G(e.devices,"%s device","%s devices"),m(_("%s online"),V(e.online))].join(" · ")}decorate(e=!1){let o=this.el?.querySelector(".dl-people-count");o&&(o.textContent=this.countText());let s=this.st.people,r=this.today,i=h=>Gl(h,r),a={all:s.length,online:s.filter(h=>h.online>0).length,attention:s.filter(i).length,paused:s.filter(h=>Fr(h)).length},l=this.el?.querySelector(".dl-people-tabs");if(l&&!(e&&ut(l))){let h={all:_("All"),online:_("Online"),attention:_("Needs attention"),paused:_("Paused")};dom.content(l,Object.keys(h).map(S=>n("button",{type:"button",role:"tab",class:S===this.filter?"on":"",click:()=>{this.filter=S,Go("dl.people.filter",S),this.decorate()}},[h[S],n("b",{class:S==="attention"&&a[S]?"warn":""},String(a[S]))])))}let d=this.query,c=h=>[h.name,h.note??"",...h.devices.flatMap(S=>[S.name,S.address,S.hostname,S.endpoint])].join(" ").toLowerCase(),p=h=>!(this.filter==="online"&&!h.online||this.filter==="attention"&&!i(h)||this.filter==="paused"&&!Fr(h)||d&&!c(h).includes(d)),u=h=>qr(h)==="paused"?2:Fo(h)?1:0,g=[...s].sort((h,S)=>u(h)-u(S)||(this.sort==="name"?h.name.localeCompare(S.name):this.sort==="usage"?S.month[0]+S.month[1]-(h.month[0]+h.month[1]):S.online-h.online||S.last_seen-h.last_seen)),M=0;for(let h of g){let S=this.card(h.id);if(!S)continue;this.list.appendChild(S),S.classList.toggle("dl-off",Fo(h));let B=p(h);S.classList.toggle("dl-filtered",!B),B&&M++}let x=this.el?.querySelector(".dl-people-none")??null;s.length&&!M?(x??(x=n("div",{class:"dl-empty dl-people-none"},n("p",{},_("No one here right now.")))),x.previousElementSibling!==this.list&&this.list.after(x)):x?.remove()}async quick(e,o,s){await q(()=>N.personUpdate(e.id,o),s)&&await this.update()}renderCard(e,o){let s=this.person(o);if(!s)return dom.content(e,n("em",{},_("This person was just removed."))),e;let r=this.today,i=rt(s.expires,r),a=Math.max(0,s.device_limit-s.devices.length),l=s.has_link??this.st.settings.portal_enabled,d=[],c=qr(s);if(s.expires&&c!=="expired"){let x=it(s,i),h=i!=null&&i<0;d.push(n("span",{class:`dl-pill-ic${h?" bad":x?" warn":""}`,title:m(_("Access ends %s"),$e(s.expires))},[v("calendar"),h?m(_("ended %s"),$e(s.expires)):x?fn(i):m(_("until %s"),$e(s.expires))]))}s.hours&&c!=="hours"&&d.push(n("span",{class:"dl-pill-ic",title:_("Allowed hours")},[v("clock"),s.hours.replace("-","–")]));let p=vn(s.devices).map(x=>n("button",{type:"button",class:`dl-chip${x.disabled?" disabled":""}${x.online?" live":""}`,title:[at(x.kind),x.address,x.online?m(_("online from %s"),x.endpoint):x.handshake?m(_("seen %s"),ce(x.handshake,this.st.now)):""].filter(Boolean).join(" · "),click:h=>{h.preventDefault(),Ye(s,x,this.deviceOpts(s))}},[v(x.kind),n("span",{class:"dl-chip-name"},x.name),!x.handshake&&!x.disabled?n("span",{class:"dl-chip-tag"},_("not set up")):""]));p.push(n("button",{type:"button",class:"dl-chip add",title:a>0?_("Add device"):_("Over the limit: admins can still add"),click:x=>{x.preventDefault(),pt(s,this.deviceOpts(s))}},[v("plus"),_("Add device")]));let u=[];s.expires&&it(s,i)&&c!=="expired"&&u.push(n("button",{type:"button",class:"dl-fix",click:()=>this.quick(s,{expires:Kr(s.expires,r)},_("Extended by 1 month"))},_("Extend 1 month")));let g=Pe("more",_("More"),x=>Te(x.currentTarget,[{label:_("Open"),icon:v("open"),run:()=>{location.href=He(s.id)}},l?{label:_("Invite card"),icon:v("qr"),run:()=>an(s,this.st.servers.find(h=>h.id===s.server)?.name??_("Home"))}:null,a>0?{label:_("Add device"),icon:v("plus"),run:()=>pt(s,this.deviceOpts(s))}:null,null,{label:s.paused?_("Resume"):_("Pause"),icon:v(s.paused?"play":"pause"),warn:!s.paused,run:()=>this.togglePause(s)},{label:_("Delete"),icon:v("trash"),danger:!0,run:()=>this.remove(s.id)}].filter((h,S,B)=>h||S>0&&B[S-1])),"neutral","dl-icon-only"),M=n("div",{class:"dl-pcard-actions"},[l?Pe("link",_("Copy link"),()=>On(s.id),"neutral","dl-icon-only"):"",g]);return dom.content(e,n("div",{class:"dl-pcard"},[n("div",{class:"dl-pcard-main"},[n("div",{class:"dl-pcard-top"},[n("span",{class:`dl-avatar${s.online?" online":""}`},Oe(s.name)),n("div",{class:"dl-pcard-who"},[n("div",{class:"dl-card-head"},[n("a",{class:"dl-card-name",href:He(s.id)},s.name),bs(s),...d]),Wl(s)])]),n("div",{class:"dl-chips"},p),u.length?n("div",{class:"dl-fixes"},u):""]),this.usageSide(s,M),c?this.stopStrip(s,c):""])),e}stopStrip(e,o){let s=this.today,r=St(`${s.slice(0,8)}01`,1),i=()=>this.quick(e,{bonus_gb:String((e.bonus_gb||0)+10)},_("+10 GB this month")),a={paused:["pause","warn",_("Paused"),_("Devices can’t connect until you resume"),["play",_("Resume"),()=>this.togglePause(e)]],quota:e.quota_period==="month"?["chart","bad",_("Data limit reached"),m(_("Paused until it resets on %s"),$e(r)),["plus",_("+10 GB this month"),i]]:["chart","bad",_("Data limit reached"),_("Paused until the limit is raised"),["edit",_("Change limit"),()=>location.href=He(e.id)]],expired:["calendar","bad",m(_("Access ended %s"),$e(e.expires)),_("Devices can’t connect"),["calendar",_("Extend 1 month"),()=>this.quick(e,{expires:Kr(e.expires,s)},_("Extended by 1 month"))]],hours:["clock","warn",_("Outside allowed hours"),m(_("Access %s (router time)"),e.hours.replace("-","–")),null],no_server:["alert","warn",_("No server"),_("Choose a server on their page"),null]},[l,d,c,p,u]=a[o];return n("div",{class:`dl-pstrip ${d}`},[n("span",{class:`dl-need-ic ${d}`},v(l)),n("span",{class:"dl-pstrip-text"},[n("b",{},c),n("span",{class:"dl-faint"},p)]),u?H([v(u[0]),` ${u[1]}`],u[2]):""])}usageSide(e,o){let s=e.quota_used||e.month[0]+e.month[1],r=e.quota_limit?Math.min(100,e.quota_used/e.quota_limit*100):0,i=e.devices.reduce((p,u)=>p+(u.spark[u.spark.length-1]??[0,0]).reduce((g,M)=>g+M),0),a=e.rate?.[e.rate.length-1],l=e.online&&a&&this.st.now-a[0]<180,d=n("div",{class:`dl-usebar${r>=100?" bad":r>=90?" warn":""}`});if(e.quota_limit){let p=n("i",{class:"fill"});p.style.width=`${r}%`,d.appendChild(p),we(d,()=>[n("div",{class:"dl-tip-title"},m(_("%s%% used"),V(r,1))),n("div",{class:"dl-muted"},`${m(_("%s of %s"),se(e.quota_used),se(e.quota_limit))} · ${m(_("%s left"),se(Math.max(0,e.quota_limit-e.quota_used)))}`),n("div",{class:"dl-faint"},e.quota_period==="total"?_("In total"):[_("This month"),e.bonus_gb?m(_("includes +%s GB extra"),V(e.bonus_gb)):""].filter(Boolean).join(" · "))])}else{let p=e.devices.map(u=>({d:u,v:u.month[0]+u.month[1]})).filter(u=>u.v>0).sort((u,g)=>g.v-u.v);p.forEach((u,g)=>{let M=n("i",{class:`c${Math.min(g,4)}`});M.style.flexGrow=String(u.v),d.appendChild(M)}),p.length&&we(d,()=>[n("div",{class:"dl-tip-title"},_("This month by device")),...p.map((u,g)=>n("div",{class:"dl-tip-row"},[n("span",{class:`dl-swatch c${Math.min(g,4)}`}),n("span",{},u.d.name),n("b",{},se(u.v))]))])}let c=e.quota_limit?m(_("%s left"),se(Math.max(0,e.quota_limit-e.quota_used))):_("no limit");return n("div",{class:"dl-pside"},[n("div",{class:"dl-pside-top"},[l?n("span",{class:"dl-pside-state live"},_("Online")):n("span",{class:"dl-pside-state"},e.online?_("Online"):e.last_seen?_("Offline"):_("Never connected")),o]),n("div",{class:"dl-use-num"},[n("b",{class:s?"":"dl-faint"},se(s)),n("span",{class:"dl-faint"},e.quota_limit?m(_("of %s"),se(e.quota_limit)):e.quota_period==="total"&&e.quota_gb?_("in total"):_("this month"))]),d,l?n("div",{class:"dl-use-live",title:_("Right now")},[`↓ ${We(a[2])}`,n("span",{class:"dl-faint"},`↑ ${We(a[1])}`)]):n("div",{class:"dl-faint dl-pside-foot"},i?`${m(_("today %s"),se(i))} · ${c}`:c)])}async togglePause(e){await q(()=>N.personPause(e.id,!e.paused),m(e.paused?_("%s resumed"):_("%s paused"),e.name))&&await this.refresh()}async remove(e){let o=this.person(e);await pe(m(_("Remove %s?"),o?.name??e),G(o?.devices.length??0,"%s device is disconnected immediately and the personal link stops working. Usage history is kept in backups.","All %s devices are disconnected immediately and the personal link stops working. Usage history is kept in backups."),_("Remove"),!0)&&await q(()=>N.personDelete(e),_("Person removed"))&&await this.refresh()}openCreate(){let e=this.st;if(!e.servers.length){F(_("Set up the server first."),"warning");return}let o=n("input",{type:"text",class:"cbi-input-text",placeholder:_("e.g. Myata"),maxlength:48}),s=(()=>{try{return JSON.parse(Wo("dl.person.last")??"{}")}catch{return{}}})(),r=Gr(s.access??"internet"),i=n("input",{type:"number",class:"cbi-input-text",min:1,max:32,value:e.settings.default_device_limit}),a=n("input",{type:"date",class:"cbi-input-text"}),l=n("input",{type:"number",class:"cbi-input-text",min:0,step:"any",placeholder:_("Unlimited"),value:s.quota??""}),d=(P,R)=>n("button",{type:"button",class:"cbi-button cbi-button-neutral",click:()=>{a.value=R?St(Ge(e.series),R):"",a.dispatchEvent(new Event("change"))}},P),c=e.servers[0],p=!this.serverId&&e.servers.length>1?n("select",{class:"cbi-input-select"},e.servers.map(P=>n("option",{value:P.id},P.name))):null,u=(P,R,w)=>n("div",{class:"cbi-value"},[n("label",{class:"cbi-value-title"},P),n("div",{class:"cbi-value-field"},[R,w?n("div",{class:"cbi-value-description"},w):""])]),g=Ge(e.series),M=Me(_("Name","person"),o,()=>je(o.value,[],_("Shown in their portal and apps."))),x=Me(_("Devices"),i,()=>En(i.value)),h=Me(_("End date"),a,()=>Hs(a.value,g,rt,$e),n("div",{class:"dl-actions"},[a,d(_("1 month"),1),d(_("3 months"),3),d(_("1 year"),12),d(_("None","end date"),0)])),S=Me(_("Monthly data (GB)"),l,()=>Tn(l.value));a.addEventListener("change",()=>h.refresh());let B=e.settings.portal_enabled;ae(_("Add person"),[M,p?u(_("Server"),p):"",n("div",{class:"cbi-value dl-block"},[n("label",{class:"cbi-value-title"},_("Access")),n("div",{class:"cbi-value-field"},r.el)]),x,h,S],[de()," ",H(B?_("Create and copy link"):_("Create"),async()=>{let P=Be([M,x,h,S]);if(P){F(P,"warning");return}let R=await q(()=>N.personCreate(o.value.trim(),"",p?.value??c.id,r.get(),i.value.trim(),a.value,l.value.trim(),"month"));R&&(Go("dl.person.last",JSON.stringify({access:r.get(),quota:l.value.trim()})),R.link&&await xe(R.link,_("Personal link copied"),!0),this.showCreated(R.id,o.value.trim(),R.link,e.servers.find(w=>w.id===(p?.value??c.id))?.name??c.name),await this.refresh())},"positive")]),setTimeout(()=>o.focus(),50)}showCreated(e,o,s,r){if(s){an({id:e,name:o,link:s},r,{title:m(_("%s is ready"),o),lead:m(_("Send %s the card or the link. They open it, add their devices and connect - no account needed."),o)});return}let i=this.person(e);ae(m(_("%s is ready"),o),[n("p",{},_("Created. Turn on the personal portal in Settings to get a link, or add devices for them here."))],[n("button",{class:"cbi-button cbi-button-neutral",click:le},_("Done"))," ",n("a",{class:"cbi-button cbi-button-neutral",href:`${L.url("admin/network/dawnline/settings")}?section=portal`},_("Open Settings"))," ",i?H(_("Add device"),()=>{le(),pt(i,this.deviceOpts(i))},"positive"):""])}};var Bn=["#3a83f7","#a78bfa","#f472b6","#f59e0b","#10b981","#22d3ee","#ef4444","#84cc16"],qo=t=>n("i",{class:"dl-circle-dot",style:`background:${Bn[t?.color??0]??Bn[0]}`}),mt=t=>t.access==="both"||t.access==="lan"&&!t.services?.length;function Jr(t,e,o){let s=ue(t?.name??e.name??"",{placeholder:_("NAS")}),r=ue(t?.address??e.address??"",{placeholder:"192.168.1.10",class:"cbi-input-text dl-mono"}),i=ue((t?.ports??e.ports??[]).join(", "),{placeholder:_("All ports, or e.g. 445, 5000"),class:"cbi-input-text dl-mono"}),a=Me(_("Name","circle or service"),s,()=>je(s.value,[],_("Shown to people who may reach it."))),l=Me(_("Address"),r,()=>zs(r.value)),d=Me(_("Ports"),i,()=>Rs(i.value));ae(t?m(_("Edit %s"),t.name):_("Add service"),[a,l,d],[de()," ",H(_("Save"),async()=>{let c=Be([a,l,d]);if(c){F(c,"warning");return}let p=i.value.split(/[ ,]+/).filter(Boolean);await q(()=>N.serviceSet(t?.id??"",s.value,r.value,p),_("Saved"))&&(le(),o())},"positive")])}function Fl(){let t=_("Web"),e=_("Printer");return{_smb:"SMB",_afpovertcp:"AFP",_http:t,_https:t,_ssh:"SSH",_sftp:"SFTP","_sftp-ssh":"SFTP",_ipp:e,_ipps:e,_printer:e,"_pdl-datastream":e,_airplay:"AirPlay",_raop:"AirPlay",_rfb:_("Screen sharing"),_googlecast:"Cast",_hap:"HomeKit",_rdp:_("Remote desktop"),_ftp:"FTP"}}function ql(t){let e=Fl(),o=new Map;for(let s of t.services){let r=e[s.type.split(".")[0]];!r||!s.port||(o.get(r)??o.set(r,new Set).get(r)).add(String(s.port))}return o.size?[...o].map(([s,r])=>[s,[...r].sort((i,a)=>+i-+a)]):[[_("Web"),["80","443"]],["SMB",["445"]],["SSH",["22"]]]}function Zr(t,e,o){let s=t,r=null,i=!1,a=null,l=new Set,d=n("div",{class:"dl-list"}),c=n("div",{class:"dl-stack gap8"},n("span",{class:"dl-sub"},_("Looking for devices at home…"))),p=()=>{let h=s.services;dom.content(d,h.length?h.map(S=>n("div",{class:"dl-row"},[v("home"),n("span",{class:"dl-row-main dl-stack"},[n("b",{},S.name),n("span",{class:"dl-mono dl-faint"},`${S.address} · ${S.ports.length?m(_("ports %s"),S.ports.join(", ")):_("all ports")}`)]),H(_("Edit"),()=>Jr(S,{},o)),H([v("trash")],async()=>{await pe(m(_("Remove %s?"),S.name),_("People limited to this service lose access to it."),_("Remove"),!0)&&await q(()=>N.serviceDelete(S.id),_("Removed"))&&await o()},"neutral",{title:_("Remove"),"aria-label":m(_("Remove %s"),S.name)})])):[n("div",{class:"dl-row dl-muted"},_("No services yet: pick ports of a device below."))])};async function u(h,S){if(!l.has(h.address)){l.add(h.address),M();try{let B=s.services.find(R=>R.address===h.address);(S===null?B&&await q(()=>N.serviceDelete(B.id),m(_("%s removed"),B.name)):await q(()=>N.serviceSet(B?.id??"",B?.name??(h.name||h.address),h.address,S),B?m(_("%s updated"),B.name):m(_("%s added"),h.name||h.address)))&&await o()}finally{l.delete(h.address),M()}}}function g(h){let S=s.services.find(k=>k.address===h.address),B=!!S&&!S.ports.length,P=new Set(S?.ports??[]),R=l.has(h.address),w=(k,y,O)=>Yt(k,y,O,{disabled:R?"disabled":null,"aria-busy":R?"true":null});return n("div",{class:"dl-row dl-host"},[v(h.services.some(k=>k.type.startsWith("_ipp")||k.type.startsWith("_printer"))?"file":"computer"),n("div",{class:"dl-host-body"},[n("span",{class:"dl-row-main dl-stack"},[n("b",{},h.name||h.address),n("span",{class:"dl-mono dl-faint"},h.address)]),n("div",{class:"dl-chips-row"},[w(_("All ports"),B,()=>u(h,B?null:[])),...ql(h).map(([k,y])=>{let O=!B&&y.every(b=>P.has(b));return w(`${k} ${y.join(", ")}`,O,()=>{let b=new Set(B?[]:P);for(let f of y)O?b.delete(f):b.add(f);u(h,b.size?[...b]:null)})})])])])}function M(){if(i)return dom.content(c,n("span",{class:"dl-sub"},_("Couldn't read the devices at home.")));if(!r)return;let h=r;if(!h.hosts.length)return dom.content(c,n("span",{class:"dl-sub"},_("No devices found in the home network right now.")));let S=n("details",{class:"dl-params",open:a??!s.services.length?"":null},[n("summary",{},[v("chevron"),n("span",{},_("Add from devices at home")),n("span",{class:"dl-pcount"},String(h.hosts.length))]),n("div",{class:"dl-params-body"},[n("span",{class:"dl-sub"},h.mdns?_("Ports they announce over Bonjour. Pick what to open, or all ports."):_("Devices that got an address from this router. Pick the ports to open, or all ports.")),n("div",{class:"dl-list"},h.hosts.map(g))])]);S.addEventListener("toggle",()=>a=S.open),dom.content(c,S)}return N.homeHosts(e).then(h=>{r=h,M()}).catch(()=>{i=!0,M()}),p(),{el:n("div",{class:"dl-stack gap8"},[n("div",{class:"dl-iflead"},[n("div",{class:"dl-iflead-row"},[n("b",{},_("Home services")),H([v("plus")," ",_("Add service")],()=>Jr(null,{},o))]),n("span",{class:"dl-sub"},_("Home-only people can be limited to these instead of whole networks (chosen on their page). Shared by all servers."))]),d,c]),update(h){s=h,p(),M()}}}function jn(t,e,o,s){let r=new Set(t.circles.filter(h=>h.server===e).map(h=>h.color)),i=o?.color??Bn.findIndex((h,S)=>!r.has(S));i<0&&(i=0);let a=ue(o?.name??"",{placeholder:_("Family")}),l=t.people.filter(h=>h.server===e).sort((h,S)=>h.name.localeCompare(S.name)),d=new Set(l.filter(h=>o&&h.circle===o.id).map(h=>h.id)),c=n("div",{class:"dl-swatches",role:"radiogroup","aria-label":_("Colour")}),p=()=>dom.content(c,Bn.map((h,S)=>n("button",{type:"button",role:"radio",class:`dl-swatch${S===i?" on":""}`,style:`--sw:${h}`,"aria-checked":S===i?"true":"false","aria-label":m(_("Colour %s"),S+1),click:()=>{i=S,p()}})));p();let u=n("div",{class:"dl-chips-row"},l.map(h=>{let S=h.circle&&h.circle!==o?.id?t.circles.find(B=>B.id===h.circle):void 0;return n("button",{type:"button",class:`dl-chipbtn${d.has(h.id)?" on":""}`,title:mt(h)?S?m(_("Now in %s"),S.name):"":m(_("%s has no home access: their devices aren't reachable anyway"),h.name),click:B=>{d.delete(h.id)||d.add(h.id),B.currentTarget.classList.toggle("on",d.has(h.id))}},[h.name,mt(h)?S?n("b",{},S.name):"":n("b",{},_("internet"))])})),g=(h,S)=>n("div",{class:"cbi-value"},[n("label",{class:"cbi-value-title"},h),n("div",{class:"cbi-value-field"},S)]),M=t.circles.filter(h=>h.server===e&&h.id!==o?.id).map(h=>h.name),x=Me(_("Name","circle or service"),a,()=>Ss(a.value,M));ae(o?m(_("Edit %s"),o.name):_("New circle"),[x,g(_("Colour"),c),g(_("People"),u),n("p",{class:"dl-sub"},_("Devices of people in one circle reach each other. A person is in one circle at a time."))],[o?H(_("Delete"),async()=>{await q(()=>N.circleDelete(o.id),m(_("%s deleted"),o.name))&&(le(),s())},"negative"):"",n("span",{class:"dl-spacer"}),de()," ",H(_("Save"),async()=>{let h=x.help();if(h.bad){F(h.text,"warning");return}await q(()=>N.circleSet(o?.id??"",e,a.value,i,[...d]),_("Saved"))&&(le(),s())},"positive")],"dl-circle-modal")}function Qr(t,e,o){let s=t.circles.filter(r=>r.server===e);return n("div",{class:"dl-chips-row dl-circles"},[...s.map(r=>{let i=t.people.filter(a=>a.circle===r.id).map(a=>a.name);return n("button",{type:"button",class:"dl-chip",title:m(_("Edit %s"),r.name),click:()=>jn(t,e,r,o)},[qo(r),n("b",{},r.name),n("span",{class:"dl-faint"},i.length?i.join(", "):_("nobody yet"))])}),n("button",{type:"button",class:"dl-chip add",title:_("New circle"),"aria-label":_("New circle"),click:()=>jn(t,e,null,o)},v("plus"))])}function Ko(t,e){let o=t.people.filter(p=>p.server===e.id),s=(p="")=>n("span",{class:"dl-yes"},[v("check"),p]),r=()=>n("span",{class:"dl-faint"},"—"),i=p=>{let u=new Set(p.map(M=>M.access==="lan"&&M.services?.length?"services":M.home_nets?.length?"some":"all"));u.size||u.add("all");let g={all:_("all networks"),some:_("their networks"),services:_("services")};return s([...u].map(M=>g[M]).join(" / "))},a=()=>e.mesh==="off"?r():e.mesh==="circles"?s(_("circle")):s(),l=e.lan_like?_("like home"):_("direct"),d=(p,u,g)=>n("tr",{},[n("td",{},[n("b",{},p),n("div",{class:"dl-sub"},G(u.length,"%s person","%s people"))]),...g.map(M=>n("td",{},M))]),c=p=>o.filter(u=>u.access===p);return n("section",{class:"dl-setsec"},[n("div",{class:"dl-setsec-body"},[n("div",{class:"dl-panel-head"},[n("h3",{},_("Who reaches what")),n("span",{class:"dl-spacer"}),n("span",{class:"dl-sub"},_("From the rules on this server"))]),n("div",{class:"dl-reach-wrap"},n("table",{class:"dl-table dl-reach"},[n("tr",{},["",_("Internet"),_("Home"),_("This router"),_("Each other")].map(p=>n("th",{},p))),d(_("Internet"),c("internet"),[s(l),r(),n("span",{class:"dl-faint"},"DNS"),r()]),d(_("Home"),c("lan"),[n("span",{class:"dl-faint"},_("their own")),i(c("lan")),s(),a()]),d(_("Both"),c("both"),[s(l),i(c("both")),s(),a()])])),n("p",{class:"dl-sub"},_("Home devices reach the devices of people with home access, on the networks those people reach. Paused, ended and over-the-limit people reach nothing."))])])}function Xr(t,e){let o=t.people.filter(c=>c.server===e.id).flatMap(c=>c.devices.map(p=>({id:p.id,label:`${c.name} · ${p.name}`}))).sort((c,p)=>c.label.localeCompare(p.label)),s="@addr",r=(c,p)=>{let u=n("select",{class:"cbi-input-select","aria-label":c},[...o.map(h=>n("option",{value:h.id,selected:h.id===p?"selected":null},h.label)),n("option",{value:s,selected:p===s?"selected":null},_("Address"))]),g=ue("",{placeholder:c,class:"cbi-input-text dl-mono"}),M=n("div",{class:"dl-check-end"},[u,g]),x=()=>g.hidden=u.value!==s;return u.addEventListener("change",x),x(),{el:M,value:()=>u.value===s?g.value.trim():u.value}},i=r("10.0.1.11",o[0]?.id??s),a=r("10.0.1.20:445",s),l=n("div",{class:"dl-stack gap8"}),d=async()=>{let c=await q(()=>N.accessCheck(i.value(),a.value()));if(!c)return;let p=c.steps.findIndex(u=>!u.ok);dom.content(l,[n("div",{class:`dl-verdict ${c.ok?"ok":"bad"}`},[n("b",{},c.ok?_("Allowed"):_("Blocked")),n("span",{class:"dl-sub"},c.ok?_("Every step lets it through"):m(_("Stops at step %s of %s"),p+1,c.steps.length))]),n("ul",{class:"dl-checks"},c.steps.map(u=>n("li",{},[n("span",{class:`dl-check-icon ${u.ok?"ok":"error"}`},v(u.ok?"check":"x")),n("div",{class:"dl-check-body"},[n("div",{class:"dl-check-title"},u.title),u.detail?n("div",{class:"dl-check-detail"},u.detail):""])])))])};return n("section",{class:"dl-setsec"},[n("div",{class:"dl-setsec-body"},[n("div",{class:"dl-panel-head"},[n("h3",{},_("Check access")),n("span",{class:"dl-spacer"}),n("span",{class:"dl-sub"},_("Why something does or does not connect"))]),n("div",{class:"dl-check-form"},[i.el,n("span",{class:"dl-faint"},"→"),a.el,H(_("Check"),d)]),l])])}function Un(t){return t==="app"?"Dawnline":t==="amneziawg"?"AmneziaWG":t==="packages"||t==="pkgs"?_("System packages"):void 0}function ht(t){return(t.startsWith("check")?t.slice(6)||"all":t).split(/[:@ ]/)[0]}function Wn(t){return ht(t.action==="check"?`check:${t.component??""}`:t.component??"")}function ei(t){return t=Math.max(0,Math.floor(t)),`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function ti(t,e){return!t?.from&&!t?.to?e:t.from&&t.to&&t.from!==t.to?`${t.from} → ${t.to}`:t.to??t.from??e}function ni(t,e){let o=t.check?.components??{},s=e==="all"?["app","amneziawg","packages"]:[e],r=[],i;for(let l of s){let d=o[l];if(d){if(d.error)return{tone:"warn",text:d.error};l==="packages"&&d.updates?r.push(G(d.updates,"%s system package","%s system packages")):l!=="packages"&&d.update&&d.installed&&d.latest&&(r.push(`${Un(l)} ${d.latest}`),e!=="all"&&(i=d.latest))}}if(r.length)return{tone:"acc",text:m(_("Update available: %s"),r.join(", ")),update:i};let a=s.length===1?o[s[0]]:null;return a?.status==="dev"?{tone:"acc",text:m(_("Installed version is newer than the release (%s)"),a.latest)}:a?.note?{tone:"warn",text:a.note}:{tone:"ok",text:s.length>1?_("Everything is up to date"):_("Latest version is installed")}}function oi(t,e,o,s){return e?t.id===e:o&&t.id===o?!1:t.state==="running"||s>0&&t.started>=s}var Vo=t=>new Promise(e=>setTimeout(e,t));async function dn(t,e,o){let s=o?Wn(o):ht(t),r=o?o.action==="check":t.startsWith("check"),i=Date.now(),a=n("b",{},Un(s)??(s==="all"?_("All components"):"Dawnline")),l=n("span",{class:"dl-pill dl-mono"},e.version??""),d=n("span",{class:"dl-pill info",hidden:!0}),c=n("span",{},"0:00"),p=n("pre",{class:"dl-log"},_("Operation started. Waiting for log output…")),u=n("div",{}),g=n("div",{class:"dl-op-actions"}),M=[],x=T=>dom.content(g,T),h=(T=!1)=>de(_("Close"),T);ae(e.title,n("div",{class:"dl-op"},[n("div",{class:"dl-op-head"},[a,e.version?l:"",d,n("span",{class:"dl-spacer"}),n("span",{class:"dl-faint dl-op-timer"},[v("clock"),c])]),n("div",{class:"dl-op-loghead"},[n("b",{},_("Operation log")),Pe("copy",_("Copy log"),()=>xe(M.join(` -`),_("Log copied")))]),p,u]),[g],"wide"),x([n("button",{class:"cbi-button cbi-button-neutral spinning",type:"button",disabled:"disabled"},r?_("Checking…"):_("Working…"))]);let S=o??null,B=o?.id,P,R=0,w=T=>{B!==T.id&&(B=T.id,e.onJob?.(T))};if(o)e.onJob?.(o);else try{let T=await N.updatesStatus().catch(()=>null);P=T?.job?.id,R=T?.now??0;let C=await N.updatesRun(t);C.job&&C.job.state==="running"&&C.job.id!==P&&(S=C.job,w(C.job))}catch(T){return M=[_e(T)],p.textContent=M[0],dom.content(u,n("div",{class:"dl-comp-status warn"},[v("alert"),n("span",{},_e(T))])),x([h(!0)]),F(_e(T),"error"),null}let k=null,y=0;for(;;){if(await Vo(1e3),k=await N.updatesStatus().catch(()=>null),!k){if(++y>60)break;continue}y=0;let T=k.job;if(!T||!oi(T,B,P,R)){if(Date.now()-i>15e3)break;continue}if(w(T),S=T,T.log.length){M=T.log;let C=p.scrollTop+p.clientHeight>=p.scrollHeight-8;p.textContent=M.join(` -`),C&&(p.scrollTop=p.scrollHeight)}if(l.textContent=ti(T,e.version??""),!l.isConnected&&l.textContent&&a.after(l),c.textContent=ei((T.finished??k.now)-T.started),T.state==="running"){d.hidden=!T.phase,d.textContent=T.phase;continue}break}if(p.scrollTop=p.scrollHeight,d.hidden=!1,!S||S.state==="running")return d.className="dl-pill warn",d.textContent=_("No answer"),dom.content(u,n("div",{class:"dl-comp-status warn"},[v("alert"),n("span",{},_("The router stopped answering. The job may still finish: reopen Components in a minute."))])),x([h()]),e.onDone?.(k),S;if(S.state==="failed")return d.className="dl-pill bad",d.textContent=_("Failed"),dom.content(u,n("div",{class:"dl-comp-status bad"},[v("x"),n("span",{},[n("b",{},(S.error??_("Operation failed")).replace(/\.$/,"")),r?"":`. ${_("Nothing else was changed.")}`])])),x([H(_("Copy log"),()=>xe(M.join(` -`),_("Log copied"))),h(!0)]),F(`${Un(s)??_("Update","noun")}: ${S.error??_("failed")}`,"error"),e.onDone?.(k),S;if(d.className="dl-pill ok",d.textContent=_("Finished"),r&&k){let T=ni(k,s);if(dom.content(u,n("div",{class:`dl-comp-status ${T.tone}`},[v(T.tone==="ok"?"check":T.tone==="warn"?"alert":"download"),n("span",{},T.text)])),F(T.text,T.tone==="warn"?"warning":"success"),e.onDone?.(k),T.update&&e.onUpdate){let C=k;x([h(),H(m(_("Update to %s"),T.update),()=>e.onUpdate(C),"positive")])}else x([h()]),T.tone==="ok"&&setTimeout(()=>u.isConnected&&le(),1200);return S}let O=/^app:(lang:|nolang$)/.exec(S.component??"");if(O){let T=()=>{ui.menu?.flushCache(),location.reload()};return dom.content(u,n("div",{class:"dl-comp-status ok"},[v("check"),n("span",{},[n("b",{},O[1]==="nolang"?_("The translation is removed."):_("The translation is installed."))," ",_("Reloading the page…")])])),x([h(),H(_("Reload now"),T,"positive")]),await Vo(4e3),u.isConnected&&T(),S}if(s==="app"&&S.to){let T=S.to,C=n("span",{},_("Waiting for the router to restart its services…"));dom.content(u,n("div",{class:"dl-comp-status ok"},[v("check"),n("span",{},[n("b",{},m(_("Dawnline %s is installed."),T))," ",C])]));let A=()=>{ui.menu?.flushCache(),location.reload()};x([h(),H(_("Reload now"),A,"positive")]),F(m(_("Dawnline updated to %s"),T),"success",6e3);for(let K=1;K<=30;K++)if(C.textContent=m(_("Waiting for the router to restart its services (%s of 30)…"),K),await Vo(1500),(await N.updatesStatus().catch(()=>null))?.version===T)return C.textContent=_("Services are back. Reloading…"),setTimeout(A,800),S;return C.textContent=_("Services restarted. Reload the page to use the new version."),S}let b=[...S.result?.pkgs?.updated??[],...S.result?.pkgs?.installed??[]],f=s==="pkgs"?b.length?m(_("Updated %s"),b.join(", ")):_("Updated system packages"):s==="amneziawg"?S.to?m(_("AmneziaWG %s is installed"),S.to):_("AmneziaWG is installed"):_("Operation completed");return dom.content(u,n("div",{class:"dl-comp-status ok"},[v("check"),n("span",{},f)])),x([h()]),F(f,"success"),e.onDone?.(k),S}function Kl(t){return{https:[_("Install HTTPS for the portal?"),_("Installing HTTPS for the portal")],acme:[_("Install ACME certificates?"),_("Installing ACME certificates")],home:[_("Install the home-like link?"),_("Installing the home-like link")],awg:[_("Install AmneziaWG?"),_("Installing AmneziaWG")]}[t]}async function si(t,e,o,s){let[r,i]=Kl(e);return!await pe(r,o,_("Install"))||(await dn(t,{title:i}))?.state!=="done"?!1:(setTimeout(()=>s?.(),4e3),!0)}function Gn(t){return si("amneziawg:auto","awg",_("Dawnline installs the AmneziaWG build made for this firmware and loads it. If the network service has to restart to learn it, connections drop for a few seconds."),t)}async function cn(t,e,o){return t==="awg"?Gn(o):e.length?si(`pkgs:${e.join(",")}`,t,m(_("%s from the OpenWrt feeds. Dawnline sets the rest up when they arrive."),e.join(", ")),o):!0}async function ri(t,e){if(t==="awg")return Gn(e);let o=await q(()=>N.updatesStatus());return o?cn(t,o.needs?.[t]??[],e):!1}var Vl=()=>[["wan","WAN"],["ethernet","Ethernet"],["wifi","Wi-Fi"],["vpn",_("VPN & tunnels")],["other",_("Other")]],Yl={wan:"globe",ethernet:"ethernet",bridge:"bridge",wifi:"wifi",vpn:"tunnel",other:"link"};function Yo(t){let e=n("b",{},oe(_("add its interface %s to their source interfaces yourself"),n("span",{class:"dl-mono"},t)));return[...oe(_("Off: internet traffic goes straight to the WAN, the fastest way. DNS still goes through this router. Proxies and filters here handle the tunnel only if you %s."),e)," ",n("span",{class:"dl-warn"},_("If the router’s DNS hands out proxy addresses, those sites won’t open without it."))]}function Jo(){return wt(_("Slower: every packet crosses the router twice. On a dual-core router expect up to a third less speed, and lost packets at full load."))}function ii(t,e,o){let s=t.id,r=e,i=n("div",{class:"dl-stack gap16"},n("section",{class:"dl-setsec"},n("div",{class:"dl-setsec-body"},n("p",{class:"dl-muted"},_("Loading interfaces…"))))),a,l=!0,d="",c=!0,p=!0,u="all",g=!1,M=Zr(r,s,o),x=new Set,h="",S=()=>JSON.stringify([p,l,l?"":d,c,[...x].sort()]),B=()=>a.detected.lan||a.saved.lan||"",P=()=>(l?a.detected.wan||a.saved.wan:d)||"",R=()=>new Map(a.devices.map(j=>[j.name,j])),w=()=>{let j=R();return[...c&&B()?[B()]:[],...[...x].filter(te=>te!==B())].filter(te=>te!==P()).map(te=>j.get(te)??{name:te,nets:[],missing:!0})},k=(j,Z)=>{a=j,Z&&(l=j.config.auto_wan,d=j.config.wan_device||j.detected.wan||j.saved.wan||"",c=j.config.auto_lan,p=j.config.lan_like,u=j.config.mesh??(j.config.device_mesh?"all":"off"),x=new Set(j.config.lan_devices),h=S()),Y()},y=async j=>{let Z=await N.interfaces(s).catch(te=>(F(te.message,"error"),null));Z&&k(Z,j)};function O(j){let Z=c&&j.name===B(),te=!!j.own||!!j.master||j.name===P()||Z;return Z||x.has(j.name)||!te&&(j.nets.length>0||!!j.missing)}function b(j){let Z=c&&j.name===B(),te=j.name===P(),me=!Z&&x.has(j.name),U=!(!!j.own||!!j.master||te||Z)&&(j.nets.length>0||me||!!j.missing),ne=(me||Z)&&!j.zone&&!j.missing,he=j.missing?_("Not present right now"):j.own?_("This server"):j.master?m(_("Port of %s"),j.master):te?`${_("Internet")}${j.zone?` · ${m(_("zone %s"),j.zone)}`:""}`:j.nets.length?j.nets.join(", "):_("No IPv4 network"),fe=n("button",{type:"button",class:`dl-if${me?" sel":""}${Z?" auto":""}${!U&&!me&&!Z?" off":""}${ne?" warn":""}`,"aria-pressed":me||Z?"true":"false","aria-disabled":U?null:"true",click:()=>{U&&(x.has(j.name)?x.delete(j.name):x.add(j.name),Y())}},[n("span",{class:"dl-if-ic"},v(Yl[j.kind]??"link")),n("span",{class:"dl-if-main"},[n("span",{class:"dl-if-name"},j.name),n("span",{class:"dl-if-sub"},he)]),Z?n("span",{class:"dl-if-badge ok"},_("Auto")):me?n("span",{class:"dl-if-check"},v("check")):""]);return we(fe,()=>[n("div",{class:"dl-tip-title"},j.name),n("div",{class:"dl-muted"},[j.logical?m(_("Interface %s"),j.logical):_("No netifd interface")," · ",j.zone?m(_("zone %s"),j.zone):_("no firewall zone")]),j.members.length?n("div",{class:"dl-muted"},m(_("Ports: %s"),j.members.join(", "))):"",j.nets.length?n("div",{class:"dl-mono"},j.nets.join(", ")):"",ne?n("div",{class:"dl-warn"},_("Not in a firewall zone: the firewall rejects this traffic.")):"",j.master?n("div",{class:"dl-muted"},m(_("Choose %s to include it."),j.master)):""]),fe}function f(){let j=a.like_home;return!p||!a.config.lan_like||!t.enabled?"":!a.needs?.length&&j.active&&j.bridged?"ok":"warn"}function T(){let j=a.like_home;return p?a.needs?.length?[n("span",{class:"dl-warn"},m(_("Needs %s."),new Intl.ListFormat(ie(),{type:"conjunction"}).format(a.needs)))," ",_("Until they are installed, internet traffic goes straight to the WAN.")]:a.config.lan_like?t.enabled?j.active&&j.bridged?oe(_("Internet traffic enters %s as %s, so whatever handles home traffic (proxies, filters, DNS) handles it too."),n("span",{class:"dl-mono"},j.dev??""),n("span",{class:"dl-mono"},j.address??"")):[n("span",{class:"dl-warn"},m(_("Not working: %s"),j.error??_("the link is down")))," ",_("Internet traffic goes straight to the WAN for now.")]:[_("Internet traffic enters the router from your LAN, so whatever handles home traffic (proxies, filters, DNS) handles it too.")]:[_("Internet traffic will enter the router from your LAN, so it is handled like any home device. Save to turn on.")]:Yo(t.ifname)}let C=j=>({off:_("Devices of different people never reach each other; a person's own devices don't either."),all:_("Devices of people with home access reach each other, like home devices do. Internet-only people never."),circles:_("Within a circle: family sees family, guests see guests. Everyone reaches their own devices. Internet-only people never.")})[j];function A(j,Z,te,me,ke="",U){return n("div",{class:U?"dl-setrow head":"dl-setrow"},[n("div",{class:"dl-lh-main"},[n("span",{class:`dl-need-ic ${ke}`},v(j)),n("div",{class:"dl-stack"},[n("span",{class:"dl-setrow-label"},Z),n("span",{class:"dl-sub"},te),U??""])]),n("div",{class:"dl-setrow-ctl"},me)])}let K=(j,Z)=>{let te=me=>n("span",{class:"dl-mono"},me);return j?n("span",{},[" ",...Z&&Z!==j?oe(_("Now: %s, was %s."),te(j),te(Z)):oe(_("Now: %s."),te(j))]):n("span",{},[" ",...Z?oe(_("Not found now: using %s."),te(Z)):[_("Not found.")]])};function Y(){let j=n("select",{class:"cbi-input-select","aria-label":_("Internet interface"),change:D=>{d=D.target.value,Y()}},a.devices.filter(D=>!D.own&&!D.master&&D.zone&&!D.missing).map(D=>n("option",{value:D.name,selected:D.name===d?"selected":null},`${D.name} · ${m(_("zone %s"),D.zone)}`))),te=w().flatMap(D=>D.nets.map(W=>[W,D.name])),me=JSON.parse(S()),ke=JSON.parse(h),U=(...D)=>D.some(W=>JSON.stringify(me[W])!==JSON.stringify(ke[W])),ne=U(0,1,2),he=U(3,4),fe=D=>H(_("Save"),async()=>{let W=await q(()=>N.serverInterfaces(s,l,l?"":d,c,[...x],p,u!=="off",u),_("Access saved"));W&&(k(W,!0),W.nets_changed&&W.lan_only&&F(G(W.lan_only,"%s person has Home-only access: their devices need the configuration again to reach the new networks.","%s people have Home-only access: their devices need the configuration again to reach the new networks."),"warning",1e4))},"positive",{disabled:!D}),z=n("section",{class:"dl-setsec dl-ifcard"},[n("div",{class:"dl-setsec-body"},[n("div",{class:"dl-panel-head"},[n("h3",{},_("Internet")),n("span",{class:"dl-spacer"}),n("span",{class:"dl-sub"},_("People with Internet or Both"))]),A("home",_("Internet like a home device"),T(),[p&&a.needs?.length?H(_("Install"),()=>cn("home",a.needs,()=>y(!1)),"positive"):"",be(p,_("Internet like a home device"),D=>{p=D,Y()})],f(),p?Jo():void 0),A("globe",_("Auto-detect WAN"),[_("The interface with the default route: the server port opens there and Internet access leaves through it."),K(a.detected.wan,a.saved.wan)],[l?"":j,be(l,_("Auto-detect WAN"),D=>{l=D,Y()})])]),n("div",{class:"dl-setsec-foot"},[n("span",{class:"dl-sub"},p?[_("Internet like a home device"),P()?[" · ",...oe(_("leaves through %s"),n("span",{class:"dl-mono"},P()))]:""]:P()?oe(_("Internet straight to %s"),n("span",{class:"dl-mono"},P())):_("No WAN found")),fe(ne)])]),$=Ze([["off",_("Off")],["all",_("Everyone")],["circles",_("Circles")]],u,{label:_("Devices reach each other"),cls:"sm",optimistic:!1,onChange:async D=>{let W={off:_("Off"),all:_("Everyone"),circles:_("Circles")}[D];await q(()=>N.serverUpdate(s,{mesh:D}),m(_("Devices reach each other: %s"),W))&&(u=D,a.config.mesh=D,Y(),await o())}}),E=n("section",{class:"dl-setsec dl-ifcard"},[n("div",{class:"dl-setsec-body"},[n("div",{class:"dl-panel-head"},[n("h3",{},_("Home network")),n("span",{class:"dl-spacer"}),n("span",{class:"dl-sub"},_("People with Home or Both")),H([v("reset")," ",_("Rescan")],()=>y(!1),"neutral",{title:_("Read the interfaces again")})]),A("network",_("Networks"),_("Everyone with home access reaches these, unless their page leaves one out; their devices can be reached from here too. Click one to add or remove it."),"","",Q()),A("link",_("Devices reach each other"),C(u),$,"",u==="circles"?Qr(r,s,o):void 0),M.el]),n("div",{class:"dl-setsec-foot"},[n("span",{class:"dl-sub dl-if-summary"},te.length?oe(_("Home access reaches %s"),n("span",{},te.flatMap(([D,W],ee)=>[ee?", ":"",n("span",{class:"dl-mono"},D),` (${W})`]))):_("No home network: Home access reaches nothing but this router.")),fe(he)])]),I=window.scrollY;i.style.minHeight=`${i.offsetHeight}px`,dom.content(i,[z,E]),i.style.minHeight="",window.scrollTo({top:I})}function Q(){let j=a.devices.filter(O),Z=a.devices.filter(te=>!O(te));return n("div",{class:"dl-stack gap8 dl-netpick"},[j.length?n("div",{class:"dl-ifgrid"},j.map(b)):n("span",{class:"dl-warn"},_("No home network: Home access reaches nothing but this router.")),n("label",{class:"dl-boxrow"},[n("span",{class:"dl-stack"},[n("span",{},_("Auto-detect LAN")),n("span",{class:"dl-sub"},[_("Adds the LAN this router uses."),K(a.detected.lan,a.saved.lan)])]),be(c,_("Auto-detect LAN"),te=>{c=te,Y()})]),Z.length?n("details",{class:"dl-params",open:g?"":null,toggle:te=>g=te.currentTarget.open},[n("summary",{},[v("chevron"),n("span",{},_("Other interfaces")),n("span",{class:"dl-pcount"},String(Z.length))]),n("div",{class:"dl-params-body"},[n("span",{class:"dl-sub"},_("The WAN, this server, ports and Wi-Fi of a bridge (they come with it) and interfaces without an IPv4 network.")),...Vl().map(([te,me])=>{let ke=Z.filter(U=>U.category===te);return ke.length?n("div",{class:"dl-ifgroup"},[n("h4",{},me),n("div",{class:"dl-ifgrid"},ke.map(b))]):""})])]):""])}return y(!0),{el:i,update(j){r=j,M.update(j),a&&Y()}}}var Fn=class{constructor(){this.points=[];this.at=0;this.now=0;this.keep=120;this.failed=0;this.error="";this.empty=0}live(e){return this.points.length>0&&e-this.at<5e3}since(e){return this.live(e)?this.points[this.points.length-1].ts:0}take(e,o){if("error"in e){this.failed++,this.error=e.error;return}let s=e.meter,r=this.live(o)?this.points:[];r.length&&s.ts>0&&s.tsd.ts>i)];this.keep=s.keep>1?s.keep:120;let l=a.length?a[a.length-1].ts:0;this.points=a.filter(d=>d.ts>l-this.keep),this.empty=this.points.length?0:this.empty+1,this.at=o,this.now=s.now,this.failed=0,this.error=""}speed(e,o){let s=this.failed>=3?this.error:null,r=this.live(o)?this.points:[],i=r.flatMap(u=>u.servers[e]?[[u.ts,u.servers[e][0],u.servers[e][1]]]:[]),a=r.length?r[r.length-1].ts:0,l=this.keep-1,d=i[i.length-1],c=d?this.now-d[0]:-1,p=c>=0&&c<5;return{pts:i,xs:i.map(u=>1-(a-u[0])/l),rx:p?d[1]:0,tx:p?d[2]:0,error:s,early:!r.length&&this.empty<3}}};var Jl={connect:"ok",disconnect:"",roam:"",device_added:"ok",device_removed:"",person_added:"",person_removed:"",paused:"warn",resumed:"ok",expiring:"warn",expired_kept:"",portal_blocked:"bad",person_changed:"",devices_removed:"warn",device_failing:"warn",device_recovered:"ok"},Zl={devices_removed:"trash",link_changed:"link",person_added:"plus",person_removed:"trash",person_changed:"edit",paused:"pause",resumed:"play",expiring:"calendar",expired_kept:"calendar"};function Ql(t,e){return e.device?t.people.flatMap(s=>s.devices).find(s=>s.id===e.device)?.kind??e.dkind??"other":Zl[e.type]??"activity"}var Xl=t=>/^\d{4}-\d{2}-\d{2}$/.test(t)?Ie(t):t;function Zo(t,e){let o=t.people.find(h=>h.id===e.person),s=o?.name??e.pname??e.person??"",r=o?.devices.find(h=>h.id===e.device)?.name??e.dname??"",i=h=>n("b",{},h),a=h=>n("span",{class:"dl-muted"},h),l=h=>n("span",{class:"dl-mono"},h),d=h=>e.hosts?.[h]?[n("span",{class:"dl-ev-host"},[n("b",{},e.hosts[h]),n("span",{class:"dl-faint"},` (${h})`)])]:[l(h)],c=(h,...S)=>oe(h,...S).map(B=>typeof B=="string"?a(B):B),p=(h,...S)=>{let B=_("You");return h.startsWith(`${B} `)?[n("span",{class:"dl-you"},B),...c(h.slice(B.length),...S)]:c(h,...S)},u=i(r?`${s} · ${r}`:s),g=qs(e),M=i(g||r||_("a device")),x=Ve(e);if(x==="admin")switch(e.type){case"device_added":return p(_("You added device %s for %s"),M,i(s));case"device_removed":return p(_("You removed device %s from %s"),M,i(s));case"paused":return p(_("You paused person %s"),i(s));case"resumed":return p(_("You resumed person %s"),i(s));case"device_changed":{let h=i(r||_("a device"));return g.startsWith("renamed from ")?[...p(_("You renamed device %s of %s"),h,i(s)),a(` · ${m(_("was %s"),g.slice(13))}`)]:g==="turned off"?p(_("You turned off device %s of %s"),h,i(s)):g==="turned on"?p(_("You turned on device %s of %s"),h,i(s)):[...p(_("You changed device %s of %s"),h,i(s)),...g?[a(` · ${Ys(g)}`)]:[]]}case"device_keys":return[...p(_("You issued new keys for device %s of %s"),M,i(s)),a(` · ${_("it needs its new configuration")}`)];case"link_changed":return[...p(_("You issued a new link for person %s"),i(s)),a(` · ${_("the old link stopped working")}`)]}switch(e.type){case"connect":return[...e.detail?c(_("Device %s connected from %s"),u,n("span",{},d(e.detail))):c(_("Device %s connected"),u),...e.where?[a(` · ${e.where}`)]:[]];case"disconnect":return c(_("Device %s went offline"),u);case"roam":return c(_("Device %s changed network %s"),u,n("span",{},(e.detail??"").split(" → ").flatMap((h,S)=>S?[a(" → "),...d(h)]:d(h))));case"device_added":return c(x==="portal"?_("Person %s added device %s on their portal"):_("Person %s added device %s"),i(s),M);case"device_removed":return c(x==="portal"?_("Person %s removed device %s on their portal"):_("Person %s removed device %s"),i(s),M);case"device_keys":return c(_("Person %s issued new keys for device %s on their portal"),i(s),M);case"person_added":return p(_("You added person %s"),i(e.detail??s));case"person_removed":return p(_("You removed person %s"),i(e.detail??s));case"person_changed":return[...p(_("You changed person %s"),i(s)),...g?[a(` · ${Vs(g)}`)]:[]];case"expiring":{let h=Ks(e.detail??"");return h!=null?c(N_(h,"Person %s’s access ends in %s day","Person %s’s access ends in %s days"),i(s),a(V(h))):c(_("Person %s’s access ends in a few days"),i(s))}case"expired_kept":return c(_("Person %s’s end date passed (%s) · access kept"),i(s),a(Xl(e.detail??"")));case"paused":return e.detail?c(_("Person %s paused - %s"),i(s),a(To(e.detail))):c(_("Person %s paused"),i(s));case"resumed":return e.detail&&e.detail!=="active"?c(_("Person %s resumed - %s"),i(s),a(To(e.detail))):c(_("Person %s resumed"),i(s));case"portal_blocked":return c(_("%s blocked %s for 15 min after too many wrong codes"),n("b",{class:"dl-sys-src"},_("Personal portal")),e.detail==="all Cloudflare visitors"?a(_("all Cloudflare visitors")):l(e.detail??""));case"devices_removed":return c(_("Person %s - all devices removed, end date reached"),i(s));case"device_failing":return[...c(_("Device %s has a connection problem"),u),...e.detail?[a(` · ${Js(e.detail)}`)]:[]];case"device_recovered":return c(_("Device %s connects normally again"),u);default:return[a(`${e.type}${e.detail?`: ${e.detail}`:""}`)]}}var ed={portal_blocked:["globe","bad"]};function td(t,e){if(t.servers.length<2||!e.person)return"";let o=t.people.find(r=>r.id===e.person),s=o&&t.servers.find(r=>r.id===o.server);return s?n("span",{class:"dl-ev-srv",title:_("Server")},s.name):""}function ft(t,e,o={}){let s=ed[e.type],r=Ve(e);return n("div",{class:`dl-row${r==="admin"?" dl-ev-by-admin":s?` dl-ev-by-system ${s[1]}`:""}`},[r==="admin"?n("span",{class:"dl-ev-tile",title:_("Done by you in LuCI")},v("admin")):s?n("span",{class:"dl-ev-tile sys"},v(s[0])):n("span",{class:`dl-ev-tile ev ${Jl[e.type]??""}`},v(Ql(t,e))),n("span",{class:"dl-row-main"},Zo(t,e)),o.server===!1?"":td(t,e),n("span",{class:"dl-faint dl-nowrap",title:new Date(e.ts*1e3).toLocaleString(ie())},o.time??ce(e.ts,t.now))])}var nd={info:"",up:"ok",down:"warn",repair:"warn",error:"bad"},od={awg:"tunnel",dawnline:"sunrise",portal:"globe"};function sd(t){return{info:_("info"),up:_("up"),down:_("down"),repair:_("repair"),error:_("error")}[t]??t}function rd(t){let e=Zs(t.msg,t.kind,t.who),o=_("You");if(!e)return[n("span",{class:"dl-you"},o),n("span",{class:"dl-muted"},` ${t.msg} `),t.kind?n("span",{class:"dl-ev-kind"},`${t.kind} `):"",t.who?n("b",{},t.who):""];let s=(e.named?oe(e.text,n("b",{},Qs(t.msg,t.who??""))):[e.text]).map(i=>typeof i=="string"?n("span",{class:"dl-muted"},i):i),r=s[0]?.textContent??"";return r.startsWith(`${o} `)?[n("span",{class:"dl-you"},o),n("span",{class:"dl-muted"},r.slice(o.length)),...s.slice(1)]:s}var ai=t=>t.split(` -`).map(e=>zt(e)).join(` -`);function qn(t,e,o,s){let r=t.by==="admin",i=zt(t.msg),a=n("div",{class:`dl-row dl-slog-row ${r?"dl-ev-by-admin":`dl-ev-by-system ${nd[t.level]??""}`}${t.detail?" has-detail":""}`},[r?n("span",{class:"dl-ev-tile",title:_("Done by you in LuCI")},v("admin")):n("span",{class:"dl-ev-tile sys",title:sd(t.level)},v(od[t.src]??"zap")),n("span",{class:"dl-row-main"},r?[...rd(t),t.note?n("span",{class:"dl-muted"},` · ${Xs(t.note)}`):"",t.detail?n("span",{class:`dl-slog-more${e?" open":""}`},v("chevron")):"",t.detail&&e?n("pre",{class:"dl-slog-detail"},ai(t.detail)):""]:[t.src==="awg"&&t.who&&t.who!=="AmneziaWG"?n("span",{class:"dl-ev-kind"},`${_("Server")} `):"",n("b",{class:"dl-sys-src",title:Qt(t.src)},t.who?t.src==="awg"?t.who:zt(t.who):Qt(t.src)),/^[:,]/.test(i)?"":" ",n("span",{class:"dl-muted"},i),t.detail?n("span",{class:`dl-slog-more${e?" open":""}`},v("chevron")):"",t.detail&&e?n("pre",{class:"dl-slog-detail"},ai(t.detail)):""]),n("span",{class:"dl-faint dl-nowrap",title:new Date(t.ts*1e3).toLocaleString(ie())},s)]);return t.detail&&a.addEventListener("click",l=>{l.target.closest("pre")||o()}),a}function li(t){let e=new Date(t*1e3),o=new Date,s=new Date;if(s.setDate(o.getDate()-1),e.toDateString()===o.toDateString())return _("Today");if(e.toDateString()===s.toDateString())return _("Yesterday");let r=e.toLocaleDateString(ie(),{weekday:"long",day:"numeric",month:"long"});return r.charAt(0).toLocaleUpperCase(ie())+r.slice(1)}var Ut=t=>Pt(t).toLocaleDateString(ie(),{day:"numeric",month:"short"}),pn=200,Wt=40;function di(t,e){let o=Math.max(1,...t.map(a=>Math.max(a[1],a[2]))),s=a=>t.map((l,d)=>`${e[d]*pn},${Wt-2-l[a]/o*(Wt-6)}`),r=s(2),i=s(1);return{area:`M${r.join(" L")} L${e[e.length-1]*pn},${Wt} L${e[0]*pn},${Wt}Z`,down:`M${r.join(" L")}`,up:`M${i.join(" L")}`}}var Kn=(t,e,o,s)=>n("div",{class:"dl-speed-col"},[n("span",{class:"dl-sub"},[n("span",{class:o},e),` ${t}`]),s]),ci=([t,e])=>[n("span",{},oe(_("Today %s"),n("b",{},se(t+e)))),n("span",{},[n("span",{class:"dl-dn"},"↓"),` ${se(e)} `,n("span",{class:"dl-up"},"↑"),` ${se(t)}`])];function pi(t,e,o,s=!1){let r=t.slice(-15),i=r[r.length-1],a=i&&e-i[0]<180,l=a?i[2]:0,d=a?i[1]:0,c;if(r.length>1&&!s){let u=di(r,r.map((g,M)=>M/(r.length-1)));c=kt(``),we(c,()=>{let g=r[r.length-1];return[n("div",{class:"dl-tip-title"},new Date(g[0]*1e3).toLocaleTimeString(ie(),{hour:"2-digit",minute:"2-digit"})),n("div",{},`↓ ${We(g[2])} · ↑ ${We(g[1])}`)]})}else c=n("div",{class:"dl-speed-wait"},[n("i"),s?"":n("span",{},_("Collecting… 1 point a minute"))]);let p=u=>s?n("span",{class:"dl-speed-val off"},"—"):n("span",{class:"dl-speed-val"},We(u));return n("div",{class:"dl-bento-tile"},[n("div",{class:"dl-bento-head"},[n("span",{class:"dl-metric-label"},_("Speed now")),s?"":n("span",{class:"dl-sub"},_("last 15 min"))]),n("div",{class:"dl-speed-cols"},[Kn(_("Download","speed"),"↓","dl-dn",p(l)),Kn(_("Upload","speed"),"↑","dl-up",p(d))]),c,n("div",{class:"dl-speed-today"},ci(o))])}var Vn=class{constructor(){this.span=n("span",{class:"dl-sub"},_("last 2 min"));this.down=n("span",{class:"dl-speed-val"});this.up=n("span",{class:"dl-speed-val"});this.chart=kt(``);this.wait=n("div",{class:"dl-speed-wait"});this.shown=this.wait;this.today=n("div",{class:"dl-speed-today"});this.el=n("div",{class:"dl-bento-tile"},[n("div",{class:"dl-bento-head"},[n("span",{class:"dl-metric-label"},_("Speed now")),this.span]),n("div",{class:"dl-speed-cols"},[Kn(_("Download","speed"),"↓","dl-dn",this.down),Kn(_("Upload","speed"),"↑","dl-up",this.up)]),this.wait,this.today])}update(e,o,s){let r=s||!!e.error;this.span.style.display=s?"none":"";for(let[l,d]of[[this.down,e.tx],[this.up,e.rx]])l.className=`dl-speed-val${r?" off":""}`,l.textContent=r?"—":We(d);let i=!r&&e.pts.length>1;if(i){let l=di(e.pts,e.xs),[d,c,p]=this.chart.querySelectorAll("path");d.setAttribute("d",l.area),c.setAttribute("d",l.down),p.setAttribute("d",l.up)}else dom.content(this.wait,[n("i"),s||e.early&&!e.error?"":n("span",{},e.error?m(_("Couldn't read the live speed: %s"),e.error):_("Collecting… 1 point a second"))]);let a=i?this.chart:this.wait;a!==this.shown&&(this.shown.replaceWith(a),this.shown=a),dom.content(this.today,ci(o))}};function Yn(t,e){let o=t.slice(-30),s=o.map(d=>d.rx+d.tx),r=Math.max(1,...s),i=s.reduce((d,c)=>d+c,0),a=s.reduce((d,c,p)=>c>s[d]?p:d,0),l=n("div",{class:"dl-bento-bars"},o.map((d,c)=>{let p=s[c],u=n("i",{class:c===o.length-1?"hi":"",style:`height:${Math.max(4,p/r*100)}%`}),g=n("span",{},[u]);return we(g,()=>[n("div",{class:"dl-tip-title"},c===o.length-1?`${_("Today")} · ${Ut(d.day)}`:Ut(d.day)),n("div",{},se(p)),n("div",{class:"dl-muted dl-mono"},`↓ ${se(d.tx)} ↑ ${se(d.rx)}`)]),g}));return n("div",{class:"dl-bento-tile month"},[n("div",{class:"dl-bento-head"},[n("span",{},[n("span",{class:"dl-metric-label"},_("Last 30 days")),n("b",{class:"dl-bento-total"},se(i))]),s[a]>0?n("span",{class:"dl-sub"},`${m(_("peak %s"),se(s[a]))} · ${Ut(o[a].day)}`):""]),o.length?l:n("p",{class:"dl-muted"},_("No traffic yet.")),n("div",{class:"dl-bento-head"},[n("span",{class:"dl-sub"},o.length?Ut(o[0].day):""),n("span",{class:"dl-sub"},e),n("span",{class:"dl-sub"},_("today"))])])}function mi(t){let e=t.slice(-30),o=e.map(r=>r.rx+r.tx),s=Math.max(1,...o);return n("div",{class:"dl-dbars"},e.map((r,i)=>{let a=n("i",{class:`${o[i]?"":"zero"}${i===e.length-1?" hi":""}`});a.style.height=`${Math.max(8,o[i]/s*100)}%`;let l=n("span",{},[a]);return we(l,()=>[n("div",{class:"dl-tip-title"},i===e.length-1?`${_("Today")} · ${Ut(r.day)}`:Ut(r.day)),n("div",{},se(o[i]))]),l}))}function hi(t){return{apply:_("Repair"),sync:_("Reload devices"),restart:_("Restart service"),netrestart:_("Restart network"),updates:_("Open Components")}[t]??_("Fix")}async function Jn(t){return t==="netrestart"&&!await pe(_("Restart the network?"),_("Every interface restarts. Connections drop for a few seconds."),_("Restart network"))?null:await q(()=>N.healthFix(t),_("Done"))??null}function Qo(t,e,o,s="action"){let r=t.fix;return r?r.startsWith("install:")?H(_("Install"),()=>ri(r.slice(8),o),s):r==="updates"?n("a",{class:`cbi-button cbi-button-${s}`,href:L.url("admin/network/dawnline/updates")},hi(r)):H(hi(r),()=>e(r),s):""}function id(t){return/^(awg|up_|peers_|fw_|reply_|port_|subnet_)/.test(t)?"shield":/^(portal|cert)/.test(t)?"link":/^(ep_|home_|resolver)/.test(t)?"globe":t==="clock"?"clock":t==="agent"?"activity":t==="flash"?"download":t==="nft"?"lock":t==="data"?"users":"alert"}function fi(t,e,o,s=3){let r=t.filter(a=>a.status==="error"||a.status==="warn").sort((a,l)=>a.status===l.status?0:a.status==="error"?-1:1);if(!r.length)return"";let i=r.length-s;return n("div",{class:"dl-list dl-notices"},[...r.slice(0,s).map(a=>lt(id(a.id),a.status==="error"?"bad":"warn",a.problem??a.title,a.detail,Qo(a,e,o,a.status==="error"?"positive":"neutral"))),i>0?n("a",{class:"dl-row dl-notices-more",href:L.url("admin/network/dawnline/diagnostics")},[m(_("%s more in Diagnostics"),V(i)),n("span",{class:"dl-spacer"}),"→"]):""])}function ad(t){let e=[],o=(l,d)=>n("a",{href:l},d),s=()=>o(L.url("admin/network/dawnline/diagnostics"),_("Open Diagnostics")),r=Ge(t.series),i=!!t.awg_state&&!t.awg_state.ok;for(let l of t.servers)l.enabled&&l.blocked?e.push({tone:"bad",text:[l.blocked," ",s()]}):l.enabled&&!l.up&&!i&&e.push({tone:"bad",text:[m(_("Tunnel %s is down."),l.ifname)," ",s()]});for(let l of t.people){let d=()=>o(He(l.id),l.name);if(l.state==="quota")e.push({tone:"warn",text:oe(_("%s reached the data limit."),d())});else if(l.state==="expired")e.push({tone:"warn",text:oe(_("%s’s access has ended."),d())});else{let c=rt(l.expires,r);it(l,c)?e.push({tone:"",text:oe(_("%s’s access %s."),d(),fn(c))}):c!=null&&c<0&&l.expire_action==="notify"&&e.push({tone:"",text:oe(_("%s’s end date passed (%s) · access kept."),d(),$e(l.expires))}),l.quota_limit&&l.quota_used>=l.quota_limit*.9&&e.push({tone:"",text:oe(_("%s has used 90% of the data limit."),d())})}}let a=t.people.flatMap(l=>l.devices.filter(d=>d.config_stale).map(d=>[l,d]));a.length&&e.push({tone:"warn",text:a.length===1?oe(_("%s needs its configuration again."),o(He(a[0][0].id,a[0][1].id),`${a[0][0].name} · ${a[0][1].name}`)):[G(a.length,"%s device needs its configuration again (networks or DNS changed).","%s devices need their configuration again (networks or DNS changed).")]});for(let l of t.servers)t.wan&&Ht(l.endpoint)&&l.endpoint!==t.wan&&e.push({tone:"warn",text:[m(_("Public address changed: %s still gives devices %s, the router is %s now."),l.name,l.endpoint,t.wan)," ",n("button",{type:"button",class:"dl-fix",click:async d=>{let c=d.currentTarget;c.disabled=!0,await q(()=>N.serverUpdate(l.id,{endpoint:t.wan}),m(_("%s uses %s now - devices need their configuration again"),l.name,t.wan)),c.disabled=!1}},_("Use the new address"))," ",_("A DDNS name would follow it by itself.")]});return t.servers.some(l=>l.lan_like)&&t.like_home.error&&e.push({tone:"warn",text:[m(_("Internet through the LAN is off: %s"),t.like_home.error)," ",o(L.url("admin/network/dawnline/diagnostics"),_("Details"))]}),!t.settings.portal_enabled&&!t.people.length&&e.push({tone:"",text:[_("The personal portal is off.")," ",o(L.url("admin/network/dawnline/settings"),_("Turn on"))]}),e}var Zn=class{constructor(e,o,s){this.srvId=e;this.meter=o;this.go=s;this.el=n("div",{class:"dl-srvov"});this.map=null;this.mapOn=null;this.range="online";this.parts={};this.healthAt=0;this.speed=new Vn}mount(e){this.st=ln(e,this.srvId);for(let o of["health","bento","map","side","activity"])this.parts[o]=n("div",{});return dom.content(this.el,[this.parts.health,this.parts.bento,this.parts.map,n("div",{class:"dl-grid2"},[this.parts.activity,this.parts.side])]),this.paint(),this.loadHealth(),this.el}update(e,o=!1){this.st=ln(e,this.srvId),this.paint(o),Date.now()-this.healthAt>6e4&&this.loadHealth()}async loadHealth(){this.healthAt=Date.now();let e=await N.health().catch(()=>null);if(!e)return;let o=()=>void this.loadHealth(),s=async r=>{await Jn(r)&&(o(),r==="netrestart"&&setTimeout(o,5e3))};Ne(this.parts.health,fi(e.checks,r=>void s(r),o),!0)}mapData(){return{geo:this.st.geo,people:this.st.people,now:this.st.now}}paintMap(){let e=this.st.geo.enabled;if(e===this.mapOn&&(!e||this.map)){this.map?.update(this.mapData());return}this.mapOn=e,dom.content(this.parts.map,this.mapCard())}mapCard(){let e=this.st,o=n("div",{class:"dl-panel-head pad"},[n("div",{class:"dl-stack"},[n("h3",{},_("Where people connect from")),n("span",{class:"dl-sub"},_("City-level, from the client IP · locations cached on the router"))]),n("span",{class:"dl-spacer"}),Bt(this.range,l=>{this.range=l,this.map?.setRange(l)})]);if(this.map?.destroy(),this.map=null,!e.geo.enabled)return n("div",{class:"dl-panel flush"},[o,n("div",{class:"dl-map-off"},oe(_("Locations are off. %s."),n("a",{href:L.url("admin/network/dawnline/settings")},_("Turn them on in Settings"))))]);let s=this.map=new ct({openPerson:l=>location.href=He(l),openDevice:(l,d)=>location.href=He(l,d)},this.range),r=Ee(()=>{r(),s.destroy(),this.map===s&&(this.map=null)}),i=n("div",{class:"dl-map-legend"},[n("span",{},[n("i",{class:"line live"}),_("Live tunnel")]),n("span",{},[n("i",{class:"line"}),_("Seen recently")])]),a=n("div",{class:"dl-map-wrap"},[s.el,i]);return requestAnimationFrame(()=>s.mount(this.mapData())),n("div",{class:"dl-panel flush"},[o,a])}paint(e=!1){let o=this.st,s=o.servers[0];this.paintMap(),e&&ut(this.parts.bento)?this.paintSpeed():dom.content(this.parts.bento,n("div",{class:"dl-bento"},[this.onlineTile(),this.speedTile(),Fe(s).overviewTile(s),this.monthTile()]));let r=ad(o);Ne(this.parts.side,n("div",{class:"dl-panel flush"},[n("div",{class:"dl-panel-head pad"},[n("h3",{},_("Needs attention")),n("span",{class:"dl-spacer"}),n("a",{href:L.url("admin/network/dawnline/diagnostics")},_("Health"))]),r.length?r.slice(0,8).map(a=>n("div",{class:"dl-attn-item dl-row"},[n("span",{class:`dl-ev-dot ${a.tone}`}),n("span",{},a.text),a.action??""])):n("div",{class:"dl-row dl-muted"},[v("check"),_("All good. Nothing needs you right now.")])]),e);let i=[...o.events].reverse().slice(0,8);Ne(this.parts.activity,n("div",{class:"dl-panel flush"},[n("div",{class:"dl-panel-head pad"},[n("h3",{},_("Activity")),n("span",{class:"dl-spacer"}),n("a",{href:`${L.url("admin/network/dawnline/diagnostics")}?tab=log`},_("View all"))]),i.length?i.map(a=>ft(o,a)):n("div",{class:"dl-row dl-muted"},_("Nothing yet. Connections, new devices and pauses appear here."))]),e)}onlineTile(){let e=this.st,o=e.servers[0]?!e.servers[0].enabled:!1,s=12,r=B=>{let[P,R]=B.spark[B.spark.length-1]??[0,0];return P+R},i=B=>e.geo.points.find(P=>P.device===B.id&&P.city)?.city,a=B=>/^(10\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.)/.test(B.endpoint??""),l=(B,P=!1)=>a(B)?P&&B.endpoint?`LAN · ${B.endpoint}`:"LAN":i(B)??"",d=B=>[...e.events].reverse().find(P=>P.type==="connect"&&P.device===B.id)?.ts??0,c=e.people.map(B=>({p:B,devs:B.devices.filter(P=>P.online).sort((P,R)=>r(R)-r(P))})).filter(B=>B.devs.length).sort((B,P)=>P.devs.reduce((R,w)=>R+r(w),0)-B.devs.reduce((R,w)=>R+r(w),0)),p=c.length<=2,u=({p:B,devs:P})=>{let R=P.map(d).filter(Boolean),w=R.length?Math.min(...R):0,k=(B.rate??[]).slice(-15),y=k[k.length-1],O=y&&e.now-y[0]<180?y:null,b=200,f=30,T=Math.max(1,...k.map(Q=>Math.max(Q[1],Q[2]))),C=Q=>k.map((j,Z)=>`${k.length>1?Z/(k.length-1)*b:b},${f-2-j[Q]/T*(f-6)}`),A=k.length>1?kt(``):"",K=!O||O[1]<64&&O[2]<64,Y=B.access==="both"?["home","globe"]:B.access==="lan"?["home"]:["globe"];return[n("div",{class:"dl-hc"},[n("div",{class:"dl-hc-head"},[n("span",{class:"dl-onl-av sm"},Oe(B.name)),n("span",{class:"dl-stack"},[n("b",{},B.name),n("span",{class:"dl-hc-since"},w?m(_("online for %s"),st(Math.max(60,e.now-w))):_("online"))]),n("span",{class:"dl-hc-reach"},Y.map(Q=>n("span",{class:`dl-ibadge ${Q==="home"?"lan":"inet"}`},v(Q))))]),n("div",{class:"dl-hc-speed"},[n("div",{class:"dl-hc-speed-row"},K?[n("span",{class:"dl-faint"},_("Idle right now"))]:[n("span",{},[n("span",{class:"dl-dn"},"↓"),` ${We(O[2])}`]),n("span",{},[n("span",{class:"dl-up"},"↑"),` ${We(O[1])}`]),n("span",{class:"dl-spacer"}),n("span",{class:"dl-faint"},_("15 min"))]),A]),n("div",{class:"dl-hc-devs"},P.map(Q=>n("span",{class:"dl-hc-dev"},[v(Q.kind),Q.name,l(Q)?[" · ",l(Q,!0)]:""]))),n("div",{class:"dl-hc-foot"},[n("span",{class:"dl-faint"},`${m(_("%s today"),se(P.reduce((Q,j)=>Q+r(j),0)))} · ${m(_("%s this month"),se(B.month[0]+B.month[1]))}`)])])]},g=B=>{let{p:P,devs:R}=B,w=n("span",{class:"dl-onl-dev"},R.length>1?String(R.length):v(R[0].kind)),k=n("a",{class:`dl-onl-p${p?"":" sm"}`,href:He(P.id),"aria-label":m(_("%s, online"),P.name)},[n("span",{class:"dl-onl-av"},[Oe(P.name),w]),p?n("span",{class:"dl-onl-name"},P.name):"",p?n("span",{class:"dl-onl-meta"},[...R.slice(0,3).map(y=>v(y.kind)),R.length>3?`+${R.length-3}`:"",l(R[0])?n("span",{},[" · ",l(R[0])]):""]):""]);return we(k,()=>u(B)),k},M=n("b",{class:`dl-onl-count${c.length?"":" none"}`},String(c.length)),x=c.reduce((B,P)=>B+P.devs.length,0);c.length&&we(M,()=>[`${G(c.length,"%s person","%s people")} · ${G(x,"%s device","%s devices")}`]);let h=c.length>s?c.slice(0,s-1):c,S=e.people.flatMap(B=>B.devices.map(P=>({p:B,d:P}))).filter(B=>B.d.handshake).sort((B,P)=>P.d.handshake-B.d.handshake)[0];return n("div",{class:"dl-bento-tile online"},[n("div",{class:"dl-bento-head"},[n("span",{class:"dl-metric-label"},_("Online")),M]),c.length?n("div",{class:`dl-onl-row${p?"":" grid"}`},[...h.map(g),c.length>s?n("a",{class:"dl-onl-p sm more",href:`${L.url("admin/network/dawnline/server")}?server=${encodeURIComponent(this.srvId)}§ion=people&filter=online`,title:_("Everyone online"),click:B=>{this.go&&(B.preventDefault(),this.go("people","online"))}},[n("span",{class:"dl-onl-av"},`+${c.length-h.length}`)]):""]):n("div",{class:"dl-onl-empty"},[n("span",{},o?_("The server is turned off"):_("Nobody is connected")),S?n("span",{class:"dl-sub"},m(_("Last: %s, %s"),S.p.name,ce(S.d.handshake,e.now))):n("span",{class:"dl-sub"},o?_("Devices connect once it is on"):_("No device has connected yet"))])])}speedTile(){return this.paintSpeed(),this.speed.el}paintSpeed(){if(!this.st)return;let e=this.st.servers[0];this.speed.update(this.meter.speed(this.srvId,Date.now()),this.st.totals.today,e?!e.enabled:!1)}monthTile(){let e=[...this.st.people].map(o=>[o,o.month[0]+o.month[1]]).filter(([,o])=>o>0).sort((o,s)=>s[1]-o[1]).slice(0,2);return Yn(this.st.series,e.length?m(_("Most: %s"),e.map(([o,s])=>`${o.name} ${se(s)}`).join(" · ")):"")}};var gi=["overview","people","connection","access","awg"],ld=t=>({overview:_("Overview"),people:_("People"),connection:_("Connection"),access:_("Access")})[t],dd={general:"connection",network:"connection",interfaces:"access",advanced:"awg",disguise:"awg",tunnel:"awg",core:"awg"},Xo=(t,e)=>{let o=new URLSearchParams;t&&o.set("server",t),e&&e!=="overview"&&o.set("section",e);let s=o.toString();return`${L.url("admin/network/dawnline/server")}${s?`?${s}`:""}`},un=class{constructor(){this.noFooter=!0;this.root=n("div",{class:"dl-root"});this.section="overview";this.srvId="";this.ov={};this.pp={};this.tabsEl=n("div",{});this.headEl=n("div",{});this.secEl=n("div",{});this.bodyEl=n("div",{class:"dl-srvbody"});this.meter=new Fn}async load(){let e=await N.status(31),o=e.servers.length?null:await N.setupDefaults();return[e,o]}render([e,o]){if(this.st=e,!e.servers.length&&o)return this.wizard(o);let s=new URLSearchParams(location.search),r=s.get("section")??"",i=dd[r]??r;return gi.includes(i)&&(this.section=i),this.srvId=(e.servers.find(a=>a.id===s.get("server"))??e.servers[0]).id,dom.content(this.root,[this.tabsEl,this.headEl,this.secEl,this.bodyEl]),this.paint(),this.poller?.stop(),this.poller=nt({fetch:()=>N.status(31),every:30,live:!0,active:()=>this.section==="overview"&&this.root.isConnected,apply:(a,l)=>{a.servers.length&&(this.st=a,this.paintHead(l),this.ov[this.current().id]?.update(a,l))}}),this.meterPoller?.stop(),this.meterPoller=nt({fetch:()=>N.meter(this.meter.since(Date.now())).then(a=>({meter:a}),a=>({error:_e(a)})),every:1,active:()=>this.section==="overview"&&this.root.isConnected&&this.current().enabled,apply:a=>{this.meter.take(a,Date.now()),this.ov[this.current().id]?.paintSpeed()}}),this.root}paintHead(e=!1){Ne(this.headEl,this.head(this.current()),e),(!e||!ut(this.tabsEl))&&this.paintTabs()}async refreshStatus(){let e=await N.status(31).catch(()=>null);return e?.servers.length?(this.st=e,this.paintHead(),e):null}current(){return this.st.servers.find(e=>e.id===this.srvId)??this.st.servers[0]}async refresh(){let e=await N.status(31).catch(()=>null);e&&(this.st=e,e.servers.length?this.paint():location.href=Xo())}paint(){this.paintTabs(),dom.content(this.headEl,this.head(this.current())),this.paintSections(),this.showSection(this.section)}paintTabs(){let e=this.current();dom.content(this.tabsEl,n("div",{class:"dl-srvtabs",role:"tablist","aria-label":_("Servers")},[...this.st.servers.map(o=>n("button",{type:"button",role:"tab",class:`dl-srvtab${o.id===e.id?" on":""}`,"aria-selected":o.id===e.id?"true":"false",click:()=>{o.id!==this.srvId&&(this.srvId=o.id,this.paint())}},[n("i",{class:`dot ${o.enabled?o.up?"ok":"bad":"warn"}`}),n("b",{},o.name)])),n("button",{type:"button",class:"dl-srvtab add",click:()=>this.addServer()},[v("plus"),_("Add server")])]))}paintSections(){let e=Fe(this.current());dom.content(this.secEl,n("div",{class:"dl-seg dl-srvsections",role:"tablist","aria-label":_("Server")},gi.map(o=>n("button",{type:"button",role:"tab","data-section":o,class:o===this.section?"on":"","aria-selected":o===this.section?"true":"false",click:()=>this.showSection(o)},o==="awg"?e.label:ld(o)))))}go(e,o){let s=this.pp[this.current().id];if(o&&s)s.filter=o,s.el&&s.decorate();else if(o){let r=this.pp[this.current().id]=new Ct;r.filter=o}this.showSection(e),window.scrollTo({top:0,behavior:"smooth"})}detachKept(){let e=[...Object.values(this.ov).map(o=>o.el),...Object.values(this.pp).map(o=>o.el)];for(let o of e)o&&this.bodyEl.contains(o)&&o.remove()}showSection(e){this.section=e,this.secEl.querySelectorAll("[data-section]").forEach(a=>{let l=a.dataset.section===e;a.classList.toggle("on",l),a.setAttribute("aria-selected",l?"true":"false")});let o=this.st,s=this.current(),i={overview:()=>{let a=this.ov[s.id];return a?(a.update(o),a.el):(this.ov[s.id]=new Zn(s.id,this.meter,(l,d)=>this.go(l,d))).mount(o)},people:()=>{var c,p;let a=this.pp[s.id];if(a?.el)return a.update(),a.el;let l=n("div",{},n("p",{class:"dl-muted"},_("Loading people…")));return((c=this.pp)[p=s.id]??(c[p]=new Ct)).embed(o,s.id).then(u=>{l.isConnected?dom.content(l,u):l.replaceChildren(u)}).catch(u=>{delete this.pp[s.id],dom.content(l,n("p",{class:"dl-muted"},m(_("Couldn't show people: %s"),_e(u))))}),l},connection:()=>this.connection(s),access:()=>this.access(s),awg:()=>this.awg(s)}[e]();this.detachKept(),dom.content(this.bodyEl,i)}head(e){let o=(i,a)=>n("span",{class:"dl-addrbar-seg"},[v(i),...a]),s=e.endpoint||"—",r=n("div",{class:"dl-actions"},[e.enabled?"":H([v("play"),` ${_("Turn on")}`],()=>this.save(e,{enabled:"1"},_("Server turned on")),"add")]);return n("div",{class:"dl-srvpagehead"},[n("div",{class:"dl-title-row"},[n("h2",{class:"dl-h1"},e.name),n("span",{class:`dl-pill ${e.enabled?e.up?"ok":"bad":"warn"}`},e.enabled?e.up?_("Running"):e.blocked?_("Can’t start"):_("Not running"):_("Turned off")),n("span",{class:"dl-spacer"}),r]),n("div",{class:"dl-addrbar"},[n("button",{type:"button",class:"dl-addrbar-seg main",title:_("Copy address"),click:()=>xe(s,_("Address copied"))},[v("globe"),n("span",{class:"dl-mono"},s),v("copy")]),o(Fe(e).id==="awg"?"amneziawg":"tunnel",[n("span",{class:"dl-mono"},`${Fe(e).label} :${e.port}`)]),e.up?o("clock",[m(_("up %s"),st(e.uptime))]):""]),e.blocked?wt(e.blocked):""])}async save(e,o,s=_("Saved")){await q(()=>N.serverUpdate(e.id,o),s)&&await this.refresh()}connection(e){let o=ue(e.name,{placeholder:_("Home")}),s=ue(e.endpoint,{placeholder:"vpn.example.com",class:"cbi-input-text dl-mono"}),r=ue(e.dns.join(", "),{placeholder:_("This router (recommended)"),class:"cbi-input-text dl-mono"}),i=this.st.people.filter(M=>M.server===e.id).length,a=H([v(e.enabled?"pause":"play"),` ${e.enabled?_("Turn off"):_("Turn on")}`],async()=>{e.enabled&&!await pe(m(_("Turn off %s?"),e.name),G(i,"The tunnel stops and %s person is disconnected until you turn it back on. Nothing is deleted.","The tunnel stops and %s people are disconnected until you turn it back on. Nothing is deleted."),_("Turn off"),!0)||await this.save(e,{enabled:e.enabled?"0":"1"},e.enabled?_("Server turned off"):_("Server turned on"))},e.enabled?"negative":"positive"),l=this.st.settings.portal_host,d=Ce(_("Name"),o,()=>je(o.value,[],_("Shown to people in their portal and apps."))),c=Lo(()=>({host:s.value,port:e.port,id:e.id}),(M,x,h)=>N.endpointProbe(M,x,h),()=>p.refresh(),{empty:l?m(_("Empty = the portal’s address (%s)."),l):_("Empty = the portal’s address.")}),p=Ce(_("Public address"),s,c.help);s.addEventListener("input",c.schedule),c.schedule();let u=e.reached?m(_("Reached from the internet %s."),ce(e.reached,this.st.now)):_("Never reached from the internet yet - test with a phone on mobile data."),g=Ce(_("DNS for devices"),r,()=>Ps(r.value,e.address));return n("div",{class:"dl-stack gap16"},[Vt(_("Connection"),[n("p",{class:"dl-muted"},_("The name people see, where devices find the router, and DNS. The port is on AmneziaWG.")),ye("router",_("Server"),_("What people see"),[d]),ye("globe",_("Devices connect to"),_("A DDNS name keeps links working when your IP changes; not through Cloudflare (use a DNS-only name or an IP)"),[p,n("div",{class:`dl-sub ${e.reached?"ok":"warn"}`},u)]),ye("file",_("For every device"),_("Changing it marks devices “Update config” until they import again"),[g])],[n("span"),H(_("Save"),()=>{let M=Be([d,p,g]);if(M){F(M,"warning");return}return this.save(e,{name:o.value,endpoint:s.value,dns:r.value})},"positive")]),Vt(_("Danger zone"),[n("div",{class:"dl-setrow"},[n("div",{class:"dl-stack"},[n("span",{class:"dl-setrow-label"},e.enabled?_("Turn off this server"):_("This server is off")),n("span",{class:"dl-sub"},e.enabled?_("Stops the tunnel and disconnects everyone on it. Settings and people are kept."):_("Nobody can connect. Turn it on to bring the tunnel back."))]),n("div",{class:"dl-setrow-ctl"},a)]),n("div",{class:"dl-setrow"},[n("div",{class:"dl-stack"},[n("span",{class:"dl-setrow-label"},_("Change the tunnel network")),n("span",{class:"dl-sub"},m(_("Devices have %s addresses now. A new range when it clashes with a network you connect to; every device then needs its configuration again."),`${Nt(e.subnet)}.x`))]),n("div",{class:"dl-setrow-ctl"},H([v("edit"),` ${_("Change")}`],()=>this.changeSubnet(e),"negative"))]),n("div",{class:"dl-setrow"},[n("div",{class:"dl-stack"},[n("span",{class:"dl-setrow-label"},_("Remove server")),n("span",{class:"dl-sub"},G(i,"Removes the tunnel, its firewall rules and %s person with all their devices. A backup is made first.","Removes the tunnel, its firewall rules and %s people with all their devices. A backup is made first."))]),n("div",{class:"dl-setrow-ctl"},H([v("trash"),` ${_("Remove")}`],()=>this.remove(e),"negative"))])],[],"danger")])}access(e){let o=Ko(this.st,e),s=ii(e,this.st,async()=>{let r=await this.refreshStatus();if(!r)return;let i=r.servers.find(l=>l.id===e.id)??e;s.update(r);let a=Ko(r,i);o.replaceWith(a),o=a});return n("div",{class:"dl-stack gap16"},[s.el,n("div",{class:"dl-health-cols"},[o,Xr(this.st,e)])])}awg(e){let o={st:this.st,save:(s,r)=>this.save(e,s,r),refresh:()=>this.refresh()};return n("div",{class:"dl-stack gap16"},[Fe(e).settingsCard(o,e)])}async addServer(){let e=await q(()=>N.setupDefaults());e&&dom.content(this.root,this.wizard(e,!0,()=>{dom.content(this.root,[this.tabsEl,this.headEl,this.secEl,this.bodyEl]),this.paint()}))}async changeSubnet(e){let o=await q(()=>N.serverPorts(e.id));if(!o)return;let s=o.networks??[],r=this.st.people.filter(l=>l.server===e.id).reduce((l,d)=>l+d.devices.length,0),i=ue(Nt(e.subnet),{class:"cbi-input-text dl-mono dl-w-range"}),a=Ce(_("Address range"),i,()=>ko(i.value,s,""));ae(_("Change the tunnel network"),[a,n("p",{class:"dl-muted"},r?G(r,"%s device gets a new address and stops connecting until it imports its configuration again (from their personal link or from you).","%s devices get new addresses and stop connecting until they import their configuration again (from their personal link or from you)."):_("No devices on this server yet: nothing else changes."))],[de()," ",H(_("Change"),async()=>{let l=a.help();if(l.bad){F(l.text,"warning");return}let d=Cn(i.value);if(d===e.subnet){le();return}await q(()=>N.serverUpdate(e.id,{subnet:d}),_("Tunnel network changed"))&&(le(),r&&F(_("Devices are marked “Update config” until they import again."),"info",6e3),await this.refresh())},"negative")]),setTimeout(()=>i.select(),50)}async remove(e){let o=this.st.people.filter(s=>s.server===e.id);ae(m(_("Remove %s?"),e.name),[n("p",{},G(o.length,"This removes the tunnel, its firewall rules and %s person with all their devices. A backup is made first.","This removes the tunnel, its firewall rules and %s people with all their devices. A backup is made first."))],[de()," ",H(_("Remove"),async()=>{le(),await q(()=>N.serverDelete(e.id),_("Server removed"))&&setTimeout(()=>{location.href=Xo()},800)},"negative")])}wizard(e,o=!1,s){let r={id:e.id,name:e.name,endpoint:e.endpoint,port:e.port,range:Nt(e.subnet),preset:$n(e.awg),portal:!1,portal_port:e.portal_port||8443,lan_like:!1,lan_zone:e.lan_zone,wan_zone:e.wan_zone},i=0,a=!o&&r.portal_port===r.port,l=()=>/^\d{1,3}(\.\d{1,3}){3}$/.test(r.endpoint),d=()=>Jt(r.port,e.udp_taken??[],r.port===4500?`${_("Opened on the WAN firewall automatically.")} ${_("4500 is IPsec’s port: most networks let it through.")}`:_("Opened on the WAN firewall automatically.")),c={ddns:_("From your DDNS name."),cert:_("From your Let’s Encrypt certificate."),wan:_("Your WAN address now - it may change; a DDNS name is better."),portal:_("The portal’s address.")},p=Lo(()=>({host:r.endpoint,port:r.port}),(C,A,K)=>N.endpointProbe(C,"",K),()=>u?.refresh(),{idle:()=>r.endpoint===e.endpoint&&e.endpoint_from?c[e.endpoint_from]??"":""}),u=null,g=e.wan_kind==="cgnat"||e.wan_kind==="private"?lt("alert","warn",e.wan_kind==="cgnat"?_("Your router has no public address (CGNAT)"):m(_("Your router is behind another router (WAN %s)"),e.wan_ip),e.wan_kind==="cgnat"?_("The ISP shares one address: devices can only connect if the ISP gives you a public address or IPv6. Ask them, or use a DDNS name that points at an IPv6 address."):_("Forward the UDP port on the upstream router to this one and use a DDNS name or that router’s public address here."),""):"",M=e.awg_state?.tools&&e.awg_state.handler===!1?wt(_("Creating the server restarts the network for a few seconds: AmneziaWG was installed after the network started.")):"",x=()=>ko(r.range,e.networks??[],Nt(e.subnet)),h=()=>Ln(r.portal_port,e.tcp_taken??[],l()),S=n("div",{class:"dl-wizard"}),B=(C,A={})=>{let K=ue(String(r[C]),A);return K.addEventListener("input",()=>{C==="port"||C==="portal_port"?r[C]=K.value.trim()===""?0:Number(K.value):r[C]=K.value.trim(),C==="port"&&a&&(r.portal_port=r.port),C==="portal_port"&&(a=r.portal_port===r.port)}),K},P=()=>{let C=Jo(),A=ge(_("Through the home network"),be(r.lan_like,_("Internet like a home device"),Q=>{r.lan_like=Q,K()})," "),K=()=>{dom.content(A.querySelector(".dl-sub"),r.lan_like?_("Whatever handles home traffic on this router (proxies, filters, DNS) handles theirs too. Change it later under Servers → Access."):Yo(e.ifname)),r.lan_like?A.after(C):C.remove()},Y=ye("home",_("Internet like a home device"),_("How devices reach the internet"),[A]);return K(),Y},R={id:"server",title:_("Server"),render:()=>n("div",{class:"dl-wizard-groups"},[n("p",{class:"dl-muted"},o?_("One more server: another port or disguise for networks where the first does not get through, or its own home access rules. People are moved between servers from their page."):_("Where devices connect to. A hostname that always points at your router (DDNS) keeps links working when your IP changes.")),ye("router",_("Server"),_("What people see"),[Ce(_("Name"),B("name"),()=>je(r.name,[],_("Shown to people in their portal and apps.")))]),ye("globe",_("Devices connect to"),_("A hostname or IP address of your router on the internet; not through Cloudflare (use a DNS-only name or an IP). IPv6 works too, and is the way out of CGNAT"),[(()=>{let C=B("endpoint",{placeholder:"vpn.example.com",class:"cbi-input-text dl-mono"});return u=Ce(_("Public address"),C,p.help),C.addEventListener("input",p.schedule),p.schedule(),u})()]),g,M]),check:()=>{let C=je(r.name);if(C.bad)return m(_("Name: %s"),C.text);let A=At(r.endpoint,r.port);return A.bad?m(_("Public address: %s"),A.text):null}},w={id:"awg",title:"AmneziaWG",render:()=>n("div",{class:"dl-wizard-groups"},[ye("globe",_("Listening"),_("Where devices reach AmneziaWG from the internet"),[Ce(_("UDP port"),B("port",{inputmode:"numeric",class:"cbi-input-text dl-w-port dl-mono"}),d)]),ye("network",_("Tunnel network"),_("Addresses devices get inside the tunnel"),[(()=>{let C=B("range",{class:"cbi-input-text dl-w-range dl-mono","aria-label":_("First three numbers of the device addresses")});return Ce(_("Device addresses"),C,x,n("span",{class:"dl-suffixed"},[C,n("span",{class:"dl-mono"},".x")]))})()]),ye("shield",_("Disguise"),_("So networks that block VPNs do not recognise the tunnel. Off = plain WireGuard"),[Dn(e.awg,r.preset,C=>r.preset=C,void 0,e.awg_state?.tools!==!1)]),o?P():""]),check:()=>{let C=d();if(C.bad)return m(_("UDP port: %s"),C.text);let A=x();return A.bad?m(_("Device addresses: %s"),A.text):null}},k={id:"portal",title:_("Portal"),render:()=>{let C=B("portal_port",{inputmode:"numeric",class:"cbi-input-text dl-w-port dl-mono"}),A=Ce(_("Listening port"),C,h);A.hidden=!r.portal;let K=Ze([["off",_("Off")],["on",_("On")]],r.portal?"on":"off",{label:_("Personal portal"),onChange:Y=>{r.portal=Y==="on",A.hidden=!r.portal}});return n("div",{class:"dl-wizard-groups"},[P(),ye("link",_("Personal portal"),_("A page where each person adds their own devices with their personal link"),[ge(_("Portal"),K,_("Off: only you add devices, from LuCI. On: people manage their devices within the limits you set.")),A])])},check:()=>{if(!r.portal)return null;let C=h();return C.bad?m(_("Portal port: %s"),C.text):null}},y=()=>[R,w,o?null:k].filter(C=>C!=null),O=e.awg_state,b=O?.missing??[],f=b.length?n("div",{class:"dl-list dl-notices"},[lt("shield","bad",_("AmneziaWG isn’t installed"),m(_("The tunnel needs %s. Install the build made for this firmware, then create the server."),new Intl.ListFormat(ie(),{type:"conjunction"}).format(b)),H(_("Install"),()=>Gn(()=>location.reload()),"positive"))]):O&&!O.loaded?n("div",{class:"dl-list dl-notices"},[lt("shield","warn",_("AmneziaWG’s kernel module doesn’t load on this firmware"),_("Try another build in Components, or update OpenWrt. The server can’t start until it loads."),n("a",{class:"cbi-button cbi-button-neutral",href:L.url("admin/network/dawnline/updates")},_("Open Components")))]):"",T=()=>{let C=y();i>=C.length&&(i=C.length-1),dom.content(S,[n("h2",{},o?_("Add a server"):_("Set up Dawnline")),f,n("div",{class:"dl-steps"},C.map((A,K)=>n("span",{class:`dl-step${K===i?" current":K0?H(_("Back"),()=>{i--,T()}):s?H(_("Cancel"),s):"",n("span",{class:"dl-spacer"}),i{let A=C[i].check?.();if(A){F(A,"warning");return}i++,T()},"positive"):H(_("Create server"),async()=>{for(let K of C){let Y=K.check?.();if(Y){F(Y,"warning");return}}let A=await q(()=>N.serverCreate(r.id,r.name,e.ifname,r.port,Cn(r.range),r.endpoint,e.mtu,r.preset,r.lan_zone,r.wan_zone,r.lan_like,o?void 0:r.portal,o?void 0:r.portal_port),_("Server created"));A&&(A.network_restart&&F(_("Restarting the network so it knows AmneziaWG: back in a few seconds")),setTimeout(()=>{location.href=Xo(A.id)},A.network_restart?1e4:1500))},"positive",{disabled:b.length>0,title:b.length?_("Install AmneziaWG first"):null})])])};return T(),S}};function gt(t){let e={el:t(),refresh(){let o=t();e.el.replaceWith(o),e.el=o}};return e}function Ue(t,e,o,s,r="",i=[]){return n("section",{class:`dl-setsec ${r}`,id:`dl-set-${t}`},[n("div",{class:"dl-setsec-body"},[i.length?n("div",{class:"dl-setsec-head"},[n("h3",{},e),n("span",{class:"dl-spacer"}),...i]):n("h3",{},e),...o]),s.length?n("div",{class:"dl-setsec-foot"},s):""])}function vi(t){let e=t.filter(r=>r.status!=="skip"),o=e.filter(r=>r.status==="error"||r.status==="warn"),s=e.some(r=>r.status==="error")?"error":o.length?"warn":"ok";return{bad:o,worst:s}}function bi(t){let e=t.d.settings,o=t.d.effective,s=t.d.cert,r=be(o.portal_enabled,_("Enable portal")),i=ue(e.portal_port,{placeholder:"8443",inputmode:"numeric",class:"cbi-input-text dl-w-port"}),a=ue(e.portal_redirect,{placeholder:_("Show “Not found”"),class:"cbi-input-text dl-mono"}),l=ue("",{placeholder:_("vpn.example.com or an IP"),"aria-label":_("Other address")}),d=U=>/^\d{1,3}(\.\d{1,3}){3}$/.test(U),c=[o.portal_host,...o.portal_alt??[]].filter((U,ne,he)=>U&&he.indexOf(U)===ne),p=!!t.portal,u=[],g=U=>{U&&!u.some(ne=>ne.host===U)&&u.push({host:U,kind:d(U)?"ip":"name",ips:[],here:!1,cloudflare:!1,cert:!1})},M=U=>{u=[...U,...u.filter(ne=>!U.some(he=>he.host===ne.host))],!c.length&&U[0]&&(c=[U[0].host])};t.portal&&M(t.portal.candidates),c.forEach(g);let x=U=>U.kind==="ip"?n("span",{class:"dl-addr-warn"},[v("alert"),_("Plain HTTP: the link and VPN keys travel unencrypted")]):n("span",{class:"dl-sub"},U.cloudflare?_("Behind Cloudflare · often stalls in Russia"):U.ips.length?U.here?U.cert?_("Points at this router · Let’s Encrypt certificate"):_("Points at this router · no certificate yet"):m(_("Points at %s, not this router"),U.ips.join(", ")):p?_("Your address"):_("Checking where it points…")),h=n("div",{class:"dl-addr-opts",role:"group","aria-label":_("Portal addresses")}),S=U=>{c.includes(U)?c.length>1&&(c=c.filter(ne=>ne!==U)):c=[...c,U],B(),w()},B=()=>dom.content(h,[...u.map(U=>{let ne=c.includes(U.host),he=c[0]===U.host;return n("div",{class:`dl-addr-opt${ne?" on":""}`,role:"checkbox","aria-checked":ne?"true":"false",tabindex:"0",click:()=>S(U.host),keydown:fe=>{(fe.key===" "||fe.key==="Enter")&&(fe.preventDefault(),S(U.host))}},[n("i",{class:"dl-addr-check"},ne?v("check"):""),n("span",{class:"dl-stack"},[n("span",{class:"dl-mono"},U.host),x(U)]),he?n("span",{class:"dl-pill info"},_("Main")):ne?n("button",{type:"button",class:"dl-linkbtn",click:fe=>{fe.stopPropagation(),c=[U.host,...c.filter(z=>z!==U.host)],B(),w()}},_("Make main")):U.cloudflare?n("span",{class:"dl-pill warn"},"Cloudflare"):U.kind==="ip"?n("span",{class:"dl-pill"},"IP"):U.here&&U.cert?n("span",{class:"dl-pill ok"},_("Recommended")):""])}),n("div",{class:"dl-addr-opt other"},[n("i",{class:"dl-addr-check"},v("plus")),l,H(_("Add"),()=>{let U=l.value.trim().toLowerCase();if(!U)return;let ne=At(U);if(ne.bad){F(ne.text,"warning");return}g(U),c.includes(U)||(c=[...c,U]),l.value="",B(),w()})])]);l.addEventListener("keydown",U=>{U.key==="Enter"&&(U.preventDefault(),l.nextElementSibling?.click())});let P=n("div",{class:"dl-links"}),R=()=>{},w=()=>{R();let U=Number(i.value)||o.portal_port;dom.content(P,c.map((ne,he)=>{let fe=d(ne),z=fe?U+1:U,$=`${fe?"http":"https"}://${ne}${z===(fe?80:443)?"":`:${z}`}/`;return n("div",{class:"dl-link-row"},[n("span",{class:`dl-link-ic ${fe?"warn":"ok"}`},v(fe?"alert":"lock")),n("span",{class:"dl-mono dl-link-url"},[$,n("b",{},"kamiro-telosu-bavine")]),he===0?n("span",{class:"dl-pill info"},_("Main")):fe?n("span",{class:"dl-pill warn"},"HTTP"):""])}))};B(),w(),i.addEventListener("input",()=>w());let k={portal:_("Portal running"),portal_dns:_("Points here"),portal_reply:_("Answers reach visitors"),portal_http:_("Plain HTTP"),cert:_("Certificate")},y=t.d.needs??{https:[],acme:[],home:[]},O=U=>{if(!o.portal_enabled)return n("div",{hidden:!0});if(!U)return ye("check",_("Ready to share"),_("The portal’s checks from Health"),[n("p",{class:"dl-muted dl-loading"},_("Running checks…"))]);let ne=U.filter(E=>E.status!=="skip");if(!ne.length)return n("div",{hidden:!0});let{bad:he,worst:fe}=vi(U),z=n("div",{class:"dl-ready-details",hidden:!0},ne.map(E=>n("div",{class:`dl-ready-item ${E.status}`},[v(E.status==="ok"?"check":"alert"),n("span",{class:"dl-stack"},[n("span",{},E.title),n("span",{class:"dl-sub"},E.detail)])]))),$=n("div",{class:"dl-stack gap8"},[n("div",{class:`dl-ready-sum ${fe}`},[v(fe==="ok"?"check":"alert"),n("span",{class:"dl-stack"},[n("b",{},fe==="ok"?G(ne.length,"All %s check passed","All %s checks passed"):m(N_(ne.length,"%s of %s check passed","%s of %s checks passed"),V(ne.length-he.length),V(ne.length))),he.length?n("span",{class:"dl-sub"},he.map(E=>E.detail).join(" ")):n("span",{class:"dl-sub"},_("Links will open for the people you send them to."))]),n("button",{type:"button",class:"dl-linkbtn",click:E=>{z.hidden=!z.hidden,E.currentTarget.textContent=z.hidden?_("Details"):_("Hide")}},_("Details"))]),n("div",{class:"dl-chips-row"},ne.map(E=>n("span",{class:`dl-check-chip ${E.status}`,title:E.detail},[v(E.status==="ok"?"check":"alert"),k[E.id]??E.title]))),z]);return ye("check",_("Ready to share"),_("The portal’s checks from Health"),[$])},b=U=>{if(!o.portal_enabled||!U&&!y.https.length)return n("span",{hidden:!0});if(y.https.length)return n("span",{class:"dl-pill bad"},_("Can’t start"));let{worst:ne}=vi(U);return n("span",{class:`dl-pill ${ne==="ok"?"ok":ne==="error"?"bad":"warn"}`},ne==="error"?_("Needs attention"):_("Ready"))},f=O(t.portal?.checks??null),T=b(t.portal?.checks??null);t.portalFill=U=>{p=!0,M(U.candidates),B(),w();let ne=O(U.checks);f.replaceWith(ne),f=ne;let he=b(U.checks);T.replaceWith(he),T=he};let C=s&&!s.self_signed&&s.expires?Ie(s.expires):"",A=Ce(_("Listening port"),i,()=>Ln(i.value.trim()===""?o.portal_port:Number(i.value),t.d.tcp_taken??[],c.some(d)));R=A.refresh;let K=Ce(_("Unknown links"),a,()=>Is(a.value)),Y=!!(e.portal_cert&&e.portal_key),Q=s?Y?_("Your files"):s.self_signed?_("Self-signed"):"Let’s Encrypt":_("Portal is off"),j=()=>{let U=ue(e.portal_cert,{placeholder:"/etc/ssl/…/fullchain.crt"}),ne=ue(e.portal_key,{placeholder:"/etc/ssl/…/key"});ae(_("Use your own certificate"),[n("p",{class:"dl-muted"},_("Paths on the router. Leave both empty to pick a certificate automatically.")),ge(_("Certificate file"),U),ge(_("Key file"),ne)],[de()," ",H(_("Save"),()=>{le(),t.save({portal_cert:U.value.trim(),portal_key:ne.value.trim()},_("Certificate saved"),"portal")},"positive")])},Z=(U,ne,he,fe,z,$)=>lt(U,ne,he,fe,H($,()=>cn(z,y[z],()=>t.reload("portal")),"positive")),te=y.https.length?Z("lock","bad",_("HTTPS isn’t available on this router"),m(_("The portal needs %s. It can’t start without them."),new Intl.ListFormat(ie(),{type:"conjunction"}).format(y.https)),"https",_("Install")):"",me=y.acme.length&&(!s||s.self_signed)?Z("lock","",_("Free certificate from Let’s Encrypt"),e.portal_host?m(_("ACME isn’t installed. With it the router gets a certificate for %s and browsers stop warning."),e.portal_host):_("ACME isn’t installed. With it the router gets a certificate and browsers stop warning."),"acme",_("Install ACME")):"",ke=[n("div",{class:"dl-row"},[v("lock"),n("span",{class:"dl-row-main dl-stack"},[n("b",{},[Q,C?n("span",{class:"dl-faint"},` · ${m(_("until %s"),C)}`):""]),n("span",{class:"dl-sub dl-ellipsis",title:s?.path??""},s?s.self_signed?_("Made by the router: browsers warn until a certificate covers the address."):`${Y?_("Your files"):_("Found automatically")} · ${s.path}`:_("Turn the portal on to see its certificate."))])]),n("div",{class:"dl-row"},[v("file"),n("span",{class:"dl-row-main dl-stack"},[n("b",{},_("Your own files")),n("span",{class:"dl-sub"},Y?`${e.portal_cert} · ${e.portal_key}`:_("Not set: the certificate is picked automatically."))]),Y?H(_("Reset"),()=>t.save({portal_cert:"",portal_key:""},_("Automatic certificate"),"portal"),"negative"):"",H(Y?_("Change"):_("Use files"),j)]),me];return Ue("portal",_("Personal portal"),[n("span",{class:"dl-muted"},_("A page where each person adds and manages their devices with their personal link.")),te?n("div",{class:"dl-list"},[te]):"",ye("network",_("Port"),_("How the portal listens (80 and 443 stay free)"),[A]),ye("edit",_("Appearance"),_("What people see"),[K]),ye("link",_("Addresses"),_("Pick one or more; the first is the main link"),[h,n("div",{class:"dl-stack gap8"},[P,n("span",{class:"dl-sub"},_("Example code; each person gets their own three words."))])]),ye("lock",_("Certificate"),_("Used for HTTPS links"),ke),f],[n("span"),H(_("Save"),()=>{let U=Be([A,K]);if(U){F(U,"warning");return}return t.save({portal_enabled:De(r)?"1":"0",portal_host:c[0]??"",portal_alt:c.slice(1),portal_port:i.value,portal_redirect:a.value.trim()},_("Saved"),"portal")},"positive")],"",[T,r])}function xi(t){let e=t.d.settings,o=t.d.effective,s=ue(e.default_device_limit,{placeholder:"3",inputmode:"numeric",class:"cbi-input-text dl-w-port"}),r=be(o.hostnames,_("Device hostnames")),i=ue(e.domain,{placeholder:"lan",class:"cbi-input-text dl-w-port"}),a=ue(e.home_dns_fallback==="none"?"":e.home_dns_fallback||o.home_dns_fallback||"",{placeholder:_("None"),inputmode:"decimal",class:"cbi-input-text dl-w-ip dl-mono"}),l=Ce(_("Devices per person"),s,()=>{if(!s.value.trim())return{text:_("The default, 3. Pre-filled when you add someone."),bad:!1};let p=En(s.value);return p.bad?p:{text:_("Pre-filled when you add someone."),bad:!1}}),d=Ce(_("Device hostnames"),i,()=>Os(i.value),n("div",{class:"dl-hostport"},[r,n("span",{class:"dl-faint dl-mono"},"phone.myata."),i])),c=Ce(_("Fallback DNS"),a,()=>{let p=Bs(a.value);return p.bad?p:{text:m(_("For Home-only devices using home names: %s"),p.text),bad:!1}});return Ue("defaults",_("New people"),[l,d,c],[n("span"),H(_("Save"),()=>{let p=Be([l,d,c]);if(p){F(p,"warning");return}return t.save({default_device_limit:s.value,hostnames:De(r)?"1":"0",domain:i.value,home_dns_fallback:a.value},_("Saved"),"defaults")},"positive")])}function wi(t){let e=t.d.effective,o=be(e.geo_enabled,_("Locations")),s=n("select",{class:"cbi-input-select"},[n("option",{value:"ipwho.is",selected:e.geo_provider!=="ipapi.co"?"selected":null},m(_("%s (fallback: %s)"),"ipwho.is","ipapi.co")),n("option",{value:"ipapi.co",selected:e.geo_provider==="ipapi.co"?"selected":null},m(_("%s (fallback: %s)"),"ipapi.co","ipwho.is"))]);return Ue("map",_("Map & locations"),[n("div",{class:"dl-setrow head"},[n("span",{class:"dl-muted"},_("Show where people connect from on the Overview and person pages, at city level.")),o]),ge(_("Provider"),s)],[n("span",{class:"dl-sub"},_("The router sends each new client IP to the provider once and caches the city. Map tiles load in your browser from CARTO; people never see the map.")),H(_("Save"),()=>t.save({geo_enabled:De(o)?"1":"0",geo_provider:s.value},_("Saved"),"map"),"positive")])}var cd=()=>[["app","Dawnline"],["amneziawg","AmneziaWG"],["packages",_("System packages")]];function yi(t){let e=t.d.effective.updates,o=be(e.check,_("Check automatically"),M=>g(M,De(r))),s=Qe([["6h",_("Every 6 h")],["12h",_("Every 12 h")],["1d",_("Daily")],["7d",_("Weekly")]],e.interval,_("How often")),r=be(e.auto,_("Install automatically"),M=>g(De(o),M)),i=ue(e.time,{placeholder:"04:00",inputmode:"numeric",class:"cbi-input-text dl-w-port dl-mono","aria-label":_("Time")}),a=Qe([["scheduled",_("At a set time")],["immediate",_("As soon as found")]],e.mode,_("When"),M=>i.hidden=M!=="scheduled");i.hidden=e.mode!=="scheduled";let l=yn(cd(),e.targets,_("Components")),d=be(e.keep,_("Keep the previous version")),c=be(e.mirrors,_("GitHub mirrors")),p=ge(_("How often"),s),u=[ge(_("When"),n("div",{class:"dl-hostport"},[a,i]),_("A set time keeps tunnel restarts out of the evening; the run happens within an hour of it.")),ge(_("Components"),l.node,_("AmneziaWG is off by default: a new kernel module restarts every tunnel."))],g=(M,x)=>{p.hidden=!M;for(let h of u)h.hidden=!x};return g(e.check,e.auto),Ue("updates",_("Updates"),[n("span",{class:"dl-muted"},_("How Dawnline keeps its components current. Every Dawnline update makes a backup of the settings first.")),ge(_("Check automatically"),o,_("Looks for new versions in the background; Components shows what it found and the service log names it.")),p,ge(_("Install automatically"),r,_("Downloads and installs new versions of the components below.")),...u,ge(_("Keep the previous version"),d,_("Saves the replaced Dawnline or AmneziaWG package on flash, so Roll back works without internet. Under 1 MB.")),ge(_("GitHub mirrors"),c,_("When GitHub is unreachable, download through mirrors. Checksums are still verified."))],[n("span",{class:"dl-sub"},_("Run a check or an update by hand in Components.")),H(_("Save"),()=>{if(a.value==="scheduled"){let M=js(i.value);if(M.bad){F(m(_("Time: %s"),M.text),"warning");return}}return t.save({update_check:De(o)?"1":"0",update_interval:s.value,update_auto:De(r)?"1":"0",update_mode:a.value,update_time:i.value.trim(),update_targets:l.value(),update_keep:De(d)?"1":"0",update_mirrors:De(c)?"1":"0"},_("Saved"),"updates")},"positive")])}function ki(t){let e=t.d.logs,o=e.policy,s=Qe([["7",G(7,"%s day","%s days")],["30",G(30,"%s day","%s days")],["90",G(90,"%s day","%s days")],["365",G(1,"%s year","%s years")],["0",_("No limit","retention")]],String(o.keep_days),_("Keep activity")),r=Qe([["500",V(500)],["2000",V(2e3)],["5000",V(5e3)],["20000",V(2e4)]],String(o.max),_("Maximum events")),i=Qe([["10min",_("Every 10 min")],["hourly",_("Hourly")],["off",_("Memory only")]],o.persist,_("Save to flash")),a=Qe([["31",G(1,"%s month","%s months")],["62",G(2,"%s month","%s months")],["180",G(6,"%s month","%s months")],["365",G(1,"%s year","%s years")],["730",G(2,"%s year","%s years")]],String(o.usage_days),_("Daily traffic")),l=Qe([["12",G(1,"%s year","%s years")],["24",G(2,"%s year","%s years")],["60",G(5,"%s year","%s years")],["120",G(10,"%s year","%s years")]],String(o.usage_months),_("Monthly traffic")),d=yn(Rt.map(g=>[g,n("span",{title:Fs(g)},[Ke(g)," ",n("span",{class:"dl-faint dl-opt-note"},V(e.by_category[g]??0))])]),o.categories,_("Record")),c=e.oldest?Ie(new Date(e.oldest*1e3)):"",p=(g,M,x,h)=>n("div",{class:"dl-row"},[v(g),n("span",{class:"dl-row-main dl-stack"},[n("b",{},M),n("span",{class:"dl-sub"},x)]),...h]),u=g=>H(g.toUpperCase(),async()=>{let[M,x]=await Promise.all([N.status(1),N.events(2e4)]);Xe(M,x.events,g)},"neutral",{title:m(_("Download the log as %s"),g.toUpperCase())});return Ue("logs",_("Logs & history"),[n("p",{class:"dl-muted"},Pn(o)),ge(_("Keep activity"),s,_("Older events are removed automatically.")),ge(_("Maximum size"),r,_("Newest events are kept when the log is full.")),ge(_("Record"),d.node,_("Switched-off categories are not logged from now on.")),ge(_("Save to flash"),i,_("The log lives in memory and is copied to flash. Memory only saves flash writes but is lost on reboot.")),ge(_("Daily traffic"),a,_("Per-day history behind the charts.")),ge(_("Monthly traffic"),l,_("Per-month totals; data limits use the current month.")),n("h4",{class:"dl-setsub"},_("Stored data")),n("div",{class:"dl-list"},[p("activity",_("Activity log"),e.events?`${m(_("%s since %s"),G(e.events,"%s event","%s events"),c)} · ${o.persist==="off"?m(_("%s in memory"),$t(e.log_ram)):m(_("%s in memory, %s on flash"),$t(e.log_ram),$t(e.log_flash))}`:_("Empty"),[u("csv"),u("json"),H(_("Clear"),()=>dt(_("Clear activity"),_("Removes events from the log on the router."),{},()=>t.reload("logs")),"negative")]),p("chart",_("Traffic history"),e.usage_days?`${m(_("%s since %s"),G(e.usage_days,"%s day","%s days"),Ie(e.usage_since))} · ${m(_("%s on flash"),$t(e.usage_flash))}`:_("Empty"),[H(_("Reset"),()=>It("all","","",()=>setTimeout(()=>t.reload("logs"),300)),"negative")]),p("pin",_("Location cache"),`${G(t.d.geo_cached,"%s address","%s addresses")} · ${m(_("%s on flash"),$t(e.geo_flash))}`,[H(_("Clear"),async()=>{await q(()=>N.geoClear(),_("Location cache cleared"))&&await t.reload("logs")},"negative")])])],[n("span",{class:"dl-sub"},_("Clear one person or device from their own page.")),H(_("Save"),()=>t.save({log_keep_days:s.value,log_max:r.value,log_persist:i.value,usage_keep_days:a.value,usage_keep_months:l.value,log_category:d.value()},_("Saved"),"logs"),"positive")])}function pd(t){return{manual:_("Manual"),auto:_("Nightly"),"pre-restore":_("Before restore"),"pre-import":_("Before import"),"pre-delete":_("Before removing a server"),"pre-update":_("Before update")}[t]??t}var _i=3;function es(t){let e=new Date(t*1e3),o=e.toLocaleTimeString(ie(),{hour:"2-digit",minute:"2-digit"}),s=Math.round((new Date(new Date().toDateString()).getTime()-new Date(e.toDateString()).getTime())/864e5);return s===0?m(_("Today, %s"),o):s===1?m(_("Yesterday, %s"),o):`${e.toLocaleDateString(ie(),{day:"numeric",month:"short"})}, ${o}`}async function ud(t){let e=await q(()=>N.backupRead(t.name));if(!e)return;let o=atob(e.data),s=new Uint8Array(o.length);for(let i=0;iud(t),"neutral","dl-icon-only"),Pe("more",_("More"),o=>Te(o.currentTarget,[{label:_("Restore"),icon:v("reset"),run:async()=>{await pe(_("Restore this backup?"),m(_("Everything returns to %s. The current state is backed up first."),es(t.created)),_("Restore"),!0)&&await q(()=>N.backupRestore(t.name),_("Restored"))&&e(!0)}},{label:_("Delete"),icon:v("trash"),danger:!0,run:async()=>{await pe(_("Delete this backup?"),m(_("The backup from %s is removed from the router."),es(t.created)),_("Delete"),!0)&&await q(()=>N.backupDelete(t.name),_("Backup deleted"))&&e()}}]),"neutral","dl-icon-only")])])}function Li(t,e){let o=t.slice(0,_i).map(d=>Ci(d,e)),s=t.slice(_i),r=t.length?n("div",{class:"dl-list"},[...o,s.length?n("details",{class:"dl-bk-older"},[n("summary",{},[v("chevron"),G(s.length,"%s older backup","%s older backups")]),...s.map(d=>Ci(d,e))]):""]):n("div",{class:"dl-list"},[n("div",{class:"dl-row dl-muted"},_("No backups yet."))]),i=H(_("Restore from file"),async()=>{let d=await mo(".tar.gz,.tgz,application/gzip","base64");if(!d)return;await pe(_("Restore from file?"),m(_("Replace the current Dawnline configuration with %s? The current state is backed up first."),d.name),_("Restore"),!0)&&await q(()=>N.backupUpload(d.data),_("Restored"))&&e(!0)}),a=H(_("Export JSON"),async()=>{let d=await q(()=>N.exportJson());d&&Ae(`dawnline-export-${new Date().toISOString().slice(0,10)}.json`,JSON.stringify(d,null,2),"application/json")}),l=H(_("Import JSON"),async()=>{let d=await mo(".json,application/json","text");if(!d)return;let c;try{c=JSON.parse(d.data)}catch{F(_("Not a JSON file."),"error");return}await pe(_("Import?"),_("This replaces the whole Dawnline configuration on this router. The current state is backed up first."),_("Import"),!0)&&await q(()=>N.importJson(c),_("Imported"))&&e(!0)});return n("section",{class:"dl-setsec",id:"dl-set-backups"},[n("div",{class:"dl-setsec-body"},[n("div",{class:"dl-setsec-head"},[n("div",{class:"dl-stack"},[n("h3",{},_("Backups")),n("span",{class:"dl-sub"},_("Nightly when something changed, and before every restore, import or update. The last 10 are kept."))]),n("span",{class:"dl-spacer"}),H([v("plus")," ",_("Back up now")],async()=>{await q(()=>N.backupCreate(),_("Backup created"))&&e()},"positive")]),r]),n("div",{class:"dl-setsec-foot"},[n("span",{class:"dl-sub"},_("Backups contain private keys: keep downloads safe. JSON moves everything except usage history to another router.")),n("span",{class:"dl-row-actions dl-bk-actions"},[i,a,l])])])}var ts="remove";function md(){let t=ue("",{placeholder:ts}),e=H(_("Remove Dawnline"),async()=>{await q(()=>N.uninstall(t.value.trim()),_("Dawnline removed"))&&(le(),setTimeout(()=>location.reload(),800))},"negative",{disabled:!0});t.addEventListener("input",()=>{e.disabled=t.value.trim()!==ts}),ae(_("Remove Dawnline?"),[n("p",{},m(_("Everyone is disconnected and the tunnel, firewall rules and portal are removed. A backup is made first. Type “%s” to confirm."),ts)),t],[de()," ",e])}function Mi(){return Ue("danger",_("Remove Dawnline from this router"),[n("p",{class:"dl-muted"},_("Deletes the tunnel, firewall rules, access table and hostnames Dawnline created, and stops the service. People and keys are kept in a backup."))],[n("span"),H(_("Remove"),()=>md(),"negative")],"danger")}var Qn=class{constructor(){this.root=n("div",{class:"dl-settings-main"});this.backups=[];this.portal=null;this.portalSeq=0;this.cards={}}load(){return N.settingsGet()}render(e){this.d=e,this.cards={portal:gt(()=>bi(this)),defaults:gt(()=>xi(this)),map:gt(()=>wi(this)),updates:gt(()=>yi(this)),logs:gt(()=>ki(this)),backups:gt(()=>Li(this.backups,r=>this.loadBackups(r))),danger:gt(()=>Mi())};let o=["portal","defaults","map","updates","logs","backups","danger"];dom.content(this.root,o.map(r=>this.cards[r].el)),this.loadBackups().then(()=>{new URLSearchParams(location.search).get("section")==="backups"&&document.getElementById("dl-set-backups")?.scrollIntoView({block:"start"})}),this.loadPortal();let s=new URLSearchParams(location.search).get("section");return s&&s!=="backups"&&requestAnimationFrame(()=>document.getElementById(`dl-set-${s}`)?.scrollIntoView({block:"start"})),n("div",{},[n("div",{class:"dl-pagehead"},[n("h2",{class:"dl-h1"},_("Settings"))]),this.root])}async save(e,o,s){let r=await q(()=>N.settingsUpdate(e),o);r&&(this.d=r,this.cards[s].refresh(),s==="portal"&&this.loadPortal())}async loadPortal(){let e=++this.portalSeq,o=await N.portalInfo().catch(()=>null);e===this.portalSeq&&(this.portal=o??this.portal??{candidates:[],checks:[]},this.portalFill?.(this.portal))}async loadBackups(e=!1){e&&await this.reload();let o=await N.backupList().catch(()=>null);o&&(this.backups=o.backups,this.cards.backups?.refresh())}async reload(e){let o=await N.settingsGet().catch(()=>null);if(o){if(this.d=o,e)this.cards[e].refresh();else for(let s of Object.values(this.cards))s.refresh();(!e||e==="portal")&&this.loadPortal()}}};function Ei(t,e=!1){return t&&(e?/^https?:\/\//i:/^https:\/\//i).test(t)?t:null}function Ti(t){let e=[],o=l=>{let d=[],c=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\[[^\]]+\]\((https?:\/\/[^)\s]+)\))|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?])/g,p=0;for(let u;u=c.exec(l);)u.index>p&&d.push(l.slice(p,u.index)),u[1]?d.push(n("code",{},u[1].slice(1,-1))):u[2]?d.push(n("b",{},u[2].slice(2,-2))):u[3]?d.push(n("a",{href:u[4],target:"_blank",rel:"noopener"},u[3].replace(/^\[|\]\(.*$/g,""))):u[5]&&d.push(n("a",{href:u[5],target:"_blank",rel:"noopener"},u[5].replace(/^https?:\/\/(github\.com\/)?/,""))),p=u.index+u[0].length;return p{r.length&&e.push(n("p",{},o(r.join(" ")))),r=[],s=null};for(let l of t.replace(/\r/g,"").split(` -`)){let d=l.trimEnd();if(i){/^```/.test(d.trim())?(e.push(n("pre",{},i.join(` -`))),i=null):i.push(l);continue}if(/^```/.test(d.trim())){a(),i=[];continue}let c=/^(#{1,6})\s+(.*)$/.exec(d),p=/^\s*[-*+]\s+(.*)$/.exec(d)??/^\s*\d+[.)]\s+(.*)$/.exec(d);c?(a(),e.push(n("h5",{},o(c[2])))):p?(r.length&&a(),s||(s=n("ul",{}),e.push(s)),s.appendChild(n("li",{},o(p[1])))):d.trim()?(s&&(s=null),r.push(d.trim())):a()}return i&&e.push(n("pre",{},i.join(` -`))),a(),e}function Si(t){let e=[],o=!1;for(let s of t.replace(/\r/g,"").split(` -`)){let r=/^#{1,6}\s+(.*)$/.exec(s);if(r){if(o=/^install\b/i.test(r[1].trim()),/^what.s new$/i.test(r[1].trim()))continue}else/^\*\*Full Changelog\*\*/.test(s)&&(o=!1);o||e.push(s)}return e.join(` -`).replace(/\n{3,}/g,` - -`).trim()}async function mn(t,e,o,s){let r=n("div",{class:"dl-notes"},n("p",{class:"dl-muted dl-loading"},_("Loading release notes…"))),i=n("div",{class:"dl-op-head"}),a="";ae(o,[i,r],[H([v("copy")," ",_("Copy")],()=>xe(a,_("Release notes copied")))," ",de(_("Close"))],"wide");try{let l=await N.updatesNotes(t,e,s??"");a=Si(l.body||"");let d=Ei(l.url);dom.content(i,[l.published?n("span",{class:"dl-pill"},Ie(l.published)):"",l.prerelease?n("span",{class:"dl-pill warn"},_("Pre-release")):"",n("span",{class:"dl-spacer"}),d?n("a",{href:d,target:"_blank",rel:"noopener",class:"dl-linkbtn"},[_("On GitHub")," ",v("open")]):""]),dom.content(r,a.trim()?Ti(a):n("p",{class:"dl-muted"},_("This release has no notes.")))}catch(l){dom.content(r,n("p",{class:"dl-muted"},_e(l)))}}function hd(t){let e={"6h":_("checks every 6 h"),"12h":_("checks every 12 h"),"1d":_("checks daily"),"7d":_("checks weekly")};return e[t]??e["1d"]}var ns=t=>t?Ie(t):"";function fd(t){let e=/^(.{20,}?)(?:;\s|:\s)/.exec(t)?.[1];return e||(t.length<=90?t:`${t.slice(0,90).replace(/[\s,;:]+\S*$/,"")}…`)}function $i(t,e){let o=t.st,s=o.policy,r=o.kept?.app,i=e?.update&&e.tag?e.tag:o.version,a=g=>()=>mn("app",g,m(_("What’s new in Dawnline %s"),g.replace(/^v/,""))),l=e?.tag&&(e.update||e.status==="latest")?gd(t,e.tag,e.update?o.version:""):null,d=e?.tag??i,c=s.check&&o.auto?.check?o.auto.check+({"6h":6,"12h":12,"1d":24,"7d":168}[s.interval]??24)*3600:0,p=(g,M)=>n("div",{class:"dl-stack gap4"},[n("span",{class:"dl-metric-label"},g),n("span",{class:"dl-comp-side-v"},M)]),u=[{label:_("What’s new"),ic:"file",run:a(i)},{label:_("Open on GitHub"),ic:"globe",run:()=>window.open(`https://github.com/${o.repo}`,"_blank","noopener")},null,{label:m(_("Reinstall %s"),o.version),ic:"reset",warn:!0,run:()=>t.op("app:reinstall",_("Reinstalling Dawnline"),o.version)},r?{label:m(_("Roll back to %s"),r.version),ic:"archive",warn:!0,run:async()=>{await pe(m(_("Roll back to Dawnline %s?"),r.version),m(_("The copy kept on the router replaces %s. A backup of the settings is made first."),o.version),_("Roll back"))&&t.op("app:rollback",_("Rolling back Dawnline"),o.version)}}:null];return n("section",{class:"dl-panel flush dl-comp-hero"},[n("div",{class:"dl-comp-hero-main"},[n("div",{class:"dl-comp-hero-head"},[n("span",{class:"dl-group-ic"},v("sunrise")),n("b",{class:"dl-comp-name"},"Dawnline"),t.state("app",e,e?.latest??""),n("span",{class:"dl-spacer"}),t.round(()=>t.op("check:app",_("Checking Dawnline"),o.version),u,!0)]),n("div",{class:"dl-comp-verrow"},[n("div",{class:"dl-stack"},[n("div",{class:"dl-comp-big"},[o.version,e?.update?n("small",{},`→ ${e.latest}`):e?.status==="dev"&&e.latest?n("small",{class:"dl-faint"},m(_("release %s"),e.latest)):""]),n("span",{class:"dl-faint dl-comp-meta"},e?.error?"":e?.update?e.published?m(_("released %s"),ns(e.published)):"":e?.status==="dev"?_("ahead of the latest release"):e?[_("latest release"),e.published?m(_("released %s"),ns(e.published)):""].filter(Boolean).join(" · "):_("not checked yet"))])]),l?.items.length?n("div",{class:"dl-stack gap4"},[n("ul",{class:"dl-comp-bullets"},l.items.map(g=>n("li",{},g))),l.total>l.items.length?n("button",{type:"button",class:"dl-linkbtn dl-comp-more",click:a(d)},G(l.total-l.items.length,"+%s more in What’s new","+%s more in What’s new")):""]):"",e?.error?n("p",{class:"dl-sub dl-comp-lead dl-upd-bad"},e.error):"",e?.update?n("div",{class:"dl-comp-btns"},[H(_("Update now"),()=>t.op("app",_("Updating Dawnline"),o.version),"positive",{disabled:t.busy}),H(_("What’s new"),a(i))]):"",bd(t),vd(t)]),n("div",{class:"dl-comp-hero-side"},[p(_("Source"),[v("globe"),n("a",{href:`https://github.com/${o.repo}`,target:"_blank",rel:"noopener"},o.repo)]),p(_("Auto-update"),[s.auto?Se("ok",_("On")):Se("",_("Off")),n("span",{class:"dl-muted"},s.auto?s.mode==="immediate"?_("as soon as found"):m(s.interval==="7d"?_("weekly at %s"):_("daily at %s"),s.time):s.check?hd(s.interval):_("checks off"))]),p(_("Last check"),o.check?[ce(o.check.time,o.now),c>o.now?n("span",{class:"dl-faint"},`· ${m(_("next in %s"),st(c-o.now))}`):""]:[_("Never")]),p(_("Rollback"),r?[n("span",{class:"dl-mono"},r.version),n("span",{class:"dl-faint"},_("kept on flash"))]:[n("span",{class:"dl-muted"},s.keep?_("Kept after the next update"):_("Off"))])])])}function gd(t,e,o){if(t.notes.has(e))return t.notes.get(e)??null;t.notes.set(e,null);let s=r=>r.replace(/\*\*|`|\[([^\]]+)\]\([^)]*\)/g,(i,a)=>a??"").trim();return(async()=>{let i=((await N.updatesNotes("app",e,"").catch(()=>null))?.body??"").split(` -`).map(l=>/^\s*[-*+]\s+(.*)$/.exec(l)?.[1]).filter(l=>!!l);i.length||(i=(await N.updatesChanges(o,e).catch(()=>null))?.items??[]);let a={items:i.slice(0,3).map(l=>fd(s(l))),total:i.length};t.notes.set(e,a),a.items.length&&t.root.isConnected&&t.paint()})(),null}function Xn(t){return t==="ru"?_("Russian translation"):t}function vd(t){let e=(t.st.translations??[]).includes("ru"),o=be(e,Xn("ru"),r=>{t.op(r?"app:lang:ru":"app:nolang",r?_("Adding the Russian translation"):_("Removing the Russian translation"),t.st.version)});o.disabled=t.busy;let s=n("details",{class:"dl-params dl-comp-fold",open:t.langOpen?"open":null},[n("summary",{},[v("chevron"),n("span",{},_("Translation")),n("span",{class:"dl-sub"},e?_("Russian"):_("English only"))]),n("div",{class:"dl-params-body"},[n("div",{class:"dl-list"},[n("div",{class:"dl-row"},[n("span",{class:"dl-row-main dl-stack"},[n("b",{},Xn("ru")),n("span",{class:"dl-sub"},_("LuCI pages for Dawnline"))]),n("span",{class:"dl-comp-bact"},o)])])])]);return s.addEventListener("toggle",()=>t.langOpen=s.open),s}function bd(t){let e=n("div",{class:"dl-params-body"}),o=n("details",{class:"dl-params dl-comp-vers",open:t.versOpen?"open":null},[n("summary",{},[v("chevron"),n("span",{},_("Versions")),n("span",{class:"dl-sub"},_("install any release"))]),e]);return o.addEventListener("toggle",()=>{t.versOpen=o.open,t.versOpen&&eo(t,e)}),t.versOpen&&eo(t,e),o}async function eo(t,e){let o=ue("",{placeholder:_("Tag, e.g. 0.3.1"),class:"cbi-input-text dl-mono","aria-label":_("Release tag")}),s=p=>{if(p=p.trim(),!/^v?[0-9][0-9A-Za-z.+~-]{0,40}$/.test(p))return F(_("Enter a release tag like 0.3.1"),"warning");Pi(t,p)};o.addEventListener("keydown",p=>{p.key==="Enter"&&(p.preventDefault(),s(o.value))});let r=n("div",{class:"dl-comp-tag"},[o,H(_("Install"),()=>s(o.value),"neutral",{disabled:t.busy})]),i=t.versPage,a=p=>{t.versPage=Math.max(1,t.versPage+p),eo(t,e)},l=p=>n("div",{class:"dl-comp-pager"},[n("button",{type:"button",class:"dl-linkbtn",disabled:i<=1?"disabled":null,click:()=>a(-1)},_("← Newer")),n("span",{class:"dl-faint"},m(_("Page %s"),i)),n("button",{type:"button",class:"dl-linkbtn",disabled:p?null:"disabled",click:()=>a(1)},_("Older →"))]),d=t.versCache.get(i);if(!d){dom.content(e,[r,n("p",{class:"dl-muted dl-loading"},_("Loading versions…"))]);try{d=(await N.updatesReleases(i)).releases}catch(p){if(i!==t.versPage||!e.isConnected)return;dom.content(e,[r,n("div",{class:"dl-row-actions"},[n("span",{class:"dl-muted"},m(_("Failed to load versions: %s"),_e(p))),H(_("Try again"),()=>eo(t,e))]),l(!1)]);return}if(t.versCache.set(i,d),i!==t.versPage||!e.isConnected)return}if(!d.length)return dom.content(e,[r,n("p",{class:"dl-muted"},i>1?_("No more versions."):_("No versions found.")),l(!1)]);let c=t.st.version;dom.content(e,[r,...d.map(p=>{let u=p.tag.replace(/^v/,"");return n("div",{class:"dl-comp-ver"},[n("span",{class:"dl-mono"},u),n("span",{class:"dl-sub"},ns(p.published)),p.prerelease?Se("warn",_("Pre-release")):"",n("span",{class:"dl-comp-ic"},Pe("file",_("What’s new"),()=>mn("app",p.tag,m(_("What’s new in Dawnline %s"),u)))),u===c?Se("ok",_("Installed")):H(_("Install"),()=>Pi(t,p.tag),"neutral",{disabled:t.busy})])}),l(d.length>=5)])}async function Pi(t,e){let o=e.replace(/^v/,"");o.localeCompare(t.st.version,void 0,{numeric:!0})<0&&!await pe(m(_("Install Dawnline %s?"),o),m(_("It is older than %s. A backup of the settings is made first; restore it from Settings if something looks wrong."),t.st.version),_("Install"))||t.op(`app@${e}`,m(_("Installing Dawnline %s"),o),t.st.version)}function Di(t,e){let o=t.st,s=o.kept?.amneziawg,r=e?.sources??{},i=Object.keys(r),a=e?.current??null,l=a?r[a]:void 0,d=!!e?.ru,c=o.needs?.awg??[],p=c.length?null:e?.installed??null,u=[];a&&p&&u.push({label:_("Reinstall this build"),warn:!0,ic:"reset",run:()=>t.op(`amneziawg:${a}${d?":ru":""}`,_("Reinstalling AmneziaWG"),p)}),s&&u.push({label:m(_("Roll back to %s"),s.version),ic:"archive",warn:!0,run:async()=>{await pe(m(_("Roll back AmneziaWG to %s?"),s.version),_("The build kept on the router is installed again. Every AmneziaWG tunnel restarts for a few seconds."),_("Roll back"))&&t.op("amneziawg:rollback",_("Rolling back AmneziaWG"),p??void 0)}});let g=[e?.release?{label:_("What’s new"),ic:"file",run:()=>mn("amneziawg",e.release,m(_("What’s new in the %s build"),l?.label??"AmneziaWG"),a??"slava")}:null,{label:_("Open on GitHub"),ic:"globe",run:()=>window.open(`https://github.com/${l?.repo??"Slava-Shchipunov/awg-openwrt"}`,"_blank","noopener")},...u.length?[null,...u]:[]].filter((b,f,T)=>b!==null||f>0&&T[f-1]!==null),M=o.tunnels??[],x=M.length?M.length===1?m(_("Switching restarts the tunnel for a few seconds: %s. Devices keep their configurations."),M[0]):m(N_(M.length,"Switching restarts %s tunnel for a few seconds: %s. Devices keep their configurations.","Switching restarts %s tunnels for a few seconds: %s. Devices keep their configurations."),V(M.length),M.join(", ")):_("Switching takes a few seconds. Devices keep their configurations."),h=M.length>1?m(_("%s and %s"),M.slice(0,-1).join(", "),M[M.length-1]):M[0],S=M.length?m(_("Switching restarts %s for a few seconds."),h):_("Switching takes a few seconds."),B=async b=>{let f=r[b];await pe(p?m(_("Switch to AmneziaWG %s?"),f.gen):m(_("Install AmneziaWG %s?"),f.gen),[m(_("The %s build, %s."),f.label,f.version),x,f.gen==="3.1"?_("Devices need AmneziaVPN 3.1 or newer."):""].filter(Boolean).join(" "),p?_("Switch"):_("Install"))&&t.op(`amneziawg:${b}${d?":ru":""}`,p?m(_("Switching to AmneziaWG %s"),f.gen):_("Installing AmneziaWG"),p??void 0)},P=b=>{let f=r[b],T=a===b&&!!p;return n("div",{class:"dl-row"},[n("span",{class:"dl-row-main dl-stack"},[n("b",{},f.gen?`AmneziaWG ${f.gen}`:"AmneziaWG"),n("span",{class:"dl-sub"},`${f.label} · ${f.gen==="3.1"?"AmneziaVPN 3.1+":_("every app")}`)]),n("span",{class:"dl-mono dl-faint dl-comp-bver"},f.version??_("none yet")),n("span",{class:"dl-comp-bact"},T?Se("ok",_("Active","build")):f.version?H(p?_("Switch"):_("Install"),()=>B(b),p?"neutral":"positive",{disabled:t.busy}):Se("",_("No build")))])},R=i.map(b=>r[b]?.newer?m(_("%s moves to %s with OpenWrt %s."),r[b].label,r[b].newer.gen,r[b].newer.tag.replace(/^v/,"")):"").filter(Boolean),w=be(d,_("Russian translation"),b=>{a&&t.op(`amneziawg:${a}${b?":ru":""}`,b?_("Adding the Russian translation"):_("Removing the Russian translation"),p??void 0)});w.disabled=!a||!p||t.busy;let k=t.awgOpen??!p,y=n("details",{class:"dl-params dl-comp-fold",open:k?"open":null},[n("summary",{},[v("chevron"),n("span",{},_("Build and translation"))]),n("div",{class:"dl-params-body"},[n("div",{class:"dl-list"},[...i.length?i.map(P):[n("div",{class:"dl-row"},n("span",{class:"dl-sub"},_("Check for updates to see the builds for this router.")))],n("div",{class:"dl-row"},[n("span",{class:"dl-row-main dl-stack"},[n("b",{},_("Russian translation")),n("span",{class:"dl-sub"},_("LuCI pages for AmneziaWG"))]),n("span",{class:"dl-comp-bact"},w)])]),p&&i.length||R.length?n("div",{class:`dl-comp-status ${p&&i.length?"warn":"acc"}`},[v(p&&i.length?"alert":"download"),n("span",{},[p&&i.length?n("b",{},S):"",...R.map(b=>` ${b}`)])]):""])]);y.addEventListener("toggle",()=>t.awgOpen=y.open);let O=[];return e?.update&&p&&a?O.push(H(m(_("Update to %s"),e.latest),()=>t.op(`amneziawg:${a}${d?":ru":""}`,_("Updating AmneziaWG"),p),"neutral",{disabled:t.busy})):O.push((e||c.length)&&!p?Se("warn",_("Not installed")):t.state("amneziawg",e,e?.latest??"")),O.push(t.round(()=>t.op("check:amneziawg",_("Checking AmneziaWG"),p??void 0),g)),[t.row("shield","AmneziaWG",[p?`${p}${e?.release?` · ${m(_("%s build"),e.release)}`:""}`:c.length?m(_("missing %s"),c.join(", ")):e?_("not installed"):_("version not checked")],O),n("div",{class:"dl-comp-foldwrap"},y)]}function xd(){return[{title:_("Home-like link"),sub:_("Policy routing and the veth pair"),pkgs:["ip-full","kmod-veth"],feature:"home"},{title:_("HTTPS for the portal"),sub:_("OpenSSL for uhttpd"),pkgs:["libustream-openssl","openssl-util"],feature:"https"},{title:_("Certificates (ACME)"),sub:_("Let’s Encrypt certificate for the portal"),pkgs:["acme","acme-acmesh-dnsapi"],feature:"acme",optional:!0}]}var os={home:"network",https:"lock",acme:"file"};function Ai(t,e){let o=t.st,s=e?.pkgs??{},r=xd().filter(c=>c.feature==="home"?o.home:o.portal),i=async(c,p,u=c)=>{await pe(m(_("Update %s?"),p),m(_("%s from the OpenWrt feeds. Services that use them restart for a moment."),u.join(", ")),_("Update"))&&t.op(`pkgs:${c.join(",")}`,m(_("Updating %s"),p))},a=[{label:_("Check system packages"),ic:"refresh",run:()=>t.op("check:packages",_("Checking system packages"))},{label:_("Open the OpenWrt package list"),ic:"globe",run:()=>window.open("https://openwrt.org/packages/start","_blank","noopener")}],l=0;return{rows:r.map(c=>{let p=c.pkgs.filter(h=>s[h]?.installed),u=[...new Set(p.flatMap(h=>[...s[h]?.latest?[h]:[],...s[h]?.with??[]]))],g=o.needs?.[c.feature]??c.pkgs.filter(h=>!s[h]?.installed),M=p.find(h=>s[h]?.latest),x=p.map(h=>`${h} ${s[h]?.installed??""}`).join(", ");return g.length?t.row(os[c.feature],c.title,[c.optional?_("not installed"):m(_("missing %s"),g.join(", "))],[H(_("Install"),()=>t.op(`pkgs:${g.join(",")}`,m(_("Installing %s"),c.title)),c.optional?"neutral":"positive",{disabled:t.busy}),n("span",{class:"dl-comp-ic"},t.more(a))]):e&&u.length?(l++,t.row(os[c.feature],c.title,M?[`${s[M].installed} → ${s[M].latest}`,u.length>1?` · +${u.length-1}`:""]:[u.join(", ")],[H(_("Update"),()=>i(p.filter(h=>s[h]?.latest||s[h]?.with?.length),c.title,u),"neutral",{disabled:t.busy}),n("span",{class:"dl-comp-ic"},t.more(a))])):t.row(os[c.feature],c.title,[x||c.sub],[t.state("pkgs",e,""),n("span",{class:"dl-comp-ic"},t.more(a))])}),updates:l,total:r.length}}function wd(t){return t==="app"?"Dawnline":t==="amneziawg"?"AmneziaWG":t==="pkgs"?_("System packages"):_("Components")}function yd(t){let e=/^(\d+) system packages?$/.exec(t)?.[1];return e?G(Number(e),"%s system package","%s system packages"):t}function Ni(t){let e=t.st,o=r=>{let i=ht(r.component??"app"),a=n("b",{},wd(i)),l="ok",d="check",c;if(r.kind==="found")l="accent",d="download",c=oe(r.auto?_("%s found by the automatic check"):_("%s found by a check"),n("b",{},(r.items??[]).map(yd).join(", ")));else if(r.state==="failed")l="bad",d="x",c=[...oe(r.kind==="install"?_("%s update failed"):_("%s check failed"),a),r.error?` · ${r.error}`:""];else if(/^app:(lang:|nolang$)/.test(r.component??"")){let p=/^app:lang:(.+)$/.exec(r.component??"")?.[1];c=p?oe(_("%s added by you"),n("b",{},Xn(p))):[_("Translation removed by you")]}else{let p=r.from&&r.to&&r.from!==r.to?`${r.from} → ${r.to}`:r.to??"";c=[...p?oe(r.auto?_("%s %s automatically"):_("%s %s by you"),a,p):oe(r.auto?_("%s updated automatically"):_("%s updated by you"),a),r.took?` · ${st(r.took)}`:""]}return n("div",{class:"dl-row"},[n("span",{class:`dl-ev-tile ev ${l}`},v(d)),n("span",{class:"dl-row-main"},c),n("span",{class:"dl-faint dl-nowrap",title:new Date(r.ts*1e3).toLocaleString(ie())},ce(r.ts,e.now))])},s=e.history??[];return n("section",{class:"dl-panel flush"},[n("div",{class:"dl-panel-head pad"},[n("h3",{},_("Activity")),n("span",{class:"dl-spacer"}),n("a",{href:`${L.url("admin/network/dawnline/diagnostics")}?tab=log`},_("All in Log →"))]),s.length?n("div",{},s.slice(0,8).map(o)):n("p",{class:"dl-sub dl-comp-empty"},_("Updates, and checks that found something, show up here."))])}var to=class{constructor(){this.root=n("div",{class:"dl-upd"});this.following=null;this.versOpen=!1;this.versPage=1;this.versCache=new Map;this.notes=new Map;this.awgOpen=null;this.langOpen=!1}load(){return N.updatesStatus()}render(e){return this.st=e,this.paint(),e.job?.state==="running"&&this.follow(e.job),poll.add(async()=>{if(!this.root.isConnected)return;let o=await N.updatesStatus().catch(()=>null);if(!o)return;let s=this.st;this.st=o,o.job?.state==="running"&&this.following!=="starting"&&o.job.id!==this.following&&this.follow(o.job),(o.job?.id!==s.job?.id||o.job?.state!==s.job?.state||o.job?.phase!==s.job?.phase||o.check?.time!==s.check?.time)&&this.paint()},5),this.root}get busy(){return this.st.job?.state==="running"}async refresh(e){this.st=e??await N.updatesStatus().catch(()=>null)??this.st,this.paint()}async op(e,o,s){if(this.busy||this.following==="starting"){F(_("Another component action is already running"),"warning");return}this.following="starting",this.paint();let r=ht(e),i=await dn(e,{title:o,version:s,onJob:a=>this.following=a.id,onDone:a=>this.refresh(a),onUpdate:a=>{let l=a.check?.components??{};r==="amneziawg"&&l.amneziawg?.current?this.op(`amneziawg:${l.amneziawg.current}${l.amneziawg.ru?":ru":""}`,_("Updating AmneziaWG"),l.amneziawg.installed??void 0):this.op("app",_("Updating Dawnline"),this.st.version)}});this.following==="starting"&&(this.following=i?.id??null),this.refresh()}async follow(e){this.following=e.id;let o={app:[_("Checking Dawnline"),_("Automatic update: Dawnline"),_("Updating Dawnline")],amneziawg:[_("Checking AmneziaWG"),_("Automatic update: AmneziaWG"),_("Updating AmneziaWG")],pkgs:[_("Checking system packages"),_("Automatic update: system packages"),_("Updating system packages")],all:[_("Checking components"),_("Automatic update: components"),_("Updating components")]};await dn(null,{title:(o[Wn(e)]??o.all)[e.action==="check"?0:e.auto?1:2],onDone:s=>this.refresh(s)},e)}paint(){let e=this.st,o=e.check?.components??{},s=e.firmware,r=Ai(this,o.packages),i=(e.needs?.awg??[]).length>0,l=(!i&&o.amneziawg?.update&&o.amneziawg.installed?1:0)+r.updates;dom.content(this.root,[n("div",{class:"dl-pagehead"},[n("div",{class:"dl-stack"},[n("h2",{class:"dl-h1"},_("Components")),n("span",{class:"dl-faint"},[s?.version?`OpenWrt ${s.version} · ${s.target}`:"",e.check?m(_("checked %s"),ce(e.check.time,e.now)):_("not checked yet")].filter(Boolean).join(" · "))]),n("div",{class:"dl-row-actions"},[n("a",{class:"cbi-button cbi-button-neutral dl-icon-btn",href:`${L.url("admin/network/dawnline/settings")}?section=updates`},[v("edit")," ",_("Settings")]),H([v("refresh")," ",_("Check all")],()=>this.op("check",_("Checking all components")),"neutral",{disabled:this.busy})])]),$i(this,o.app),n("div",{class:"dl-comp-cols"},[n("section",{class:"dl-panel flush"},[n("div",{class:"dl-panel-head pad"},[n("h3",{},_("Components")),n("span",{class:"dl-spacer"}),n("span",{class:"dl-faint dl-comp-count"},i?l?`${_("AmneziaWG not installed")} · ${G(l,"%s update","%s updates")}`:_("AmneziaWG not installed"):!o.amneziawg&&!o.packages?"":l?m(N_(l,"%s of %s needs an update","%s of %s need an update"),V(l),V(1+r.total)):_("Everything is up to date"))]),n("div",{},[...Di(this,o.amneziawg),...r.rows])]),Ni(this)])])}state(e,o,s){let r=this.st.job;if(r?.state==="running"){let i=l=>l==="packages"?"pkgs":l,a=r.action==="check"?[i(r.component||"all")]:(r.component??"").split(" ").map(l=>i(ht(l)));if(a.includes(e)||a.includes("all"))return n("button",{type:"button",class:"dl-pill info dl-comp-run",title:_("Show progress"),click:()=>this.follow(r)},[r.action==="check"?_("Checking…"):_("Updating…")])}return o?o.error?Se("warn",_("Check failed"),o.error):o.update?Se("info",_("Update available")):o.status==="dev"?Se("info",_("Newer than release"),m(_("The latest release is %s"),s)):Se("ok",_("Up to date")):Se("",_("Not checked"))}more(e){let o=H([v("more")],()=>Te(o,e.filter((s,r,i)=>s!==null||r>0&&rs?{label:s.label,icon:v(s.ic),warn:s.warn,run:s.run}:null)),"neutral",{title:_("More"),"aria-label":_("More")});return o}round(e,o,s=!1){let r=this.busy?" is-busy":"",i;return s?i=H([v("refresh")," ",_("Check")],e,"neutral",{class:`cbi-button cbi-button-neutral dl-comp-check${r}`,"aria-label":_("Check for updates")}):(i=Pe("refresh",_("Check for updates"),e,"neutral",r.trim()),i.removeAttribute("title"),i.setAttribute("aria-label",_("Check for updates")),we(i,()=>[_("Check for updates")])),n("span",{class:"dl-comp-ic"},[i,this.more(o)])}row(e,o,s,r){return n("div",{class:"dl-row"},[n("span",{class:"dl-group-ic"},v(e)),n("span",{class:"dl-row-main dl-stack"},[n("b",{},o),n("span",{class:"dl-mono dl-faint dl-comp-sub"},s)]),...r])}};var Hi=(t,e)=>n("div",{class:"cbi-value"},[n("label",{class:"cbi-value-title"},t),n("div",{class:"cbi-value-field"},e)]);function zi(t){let e=t.st.servers.find(o=>o.id===t.p.server)?.name??_("Home");an(t.p,e)}async function Ri(t){let e=t.p,o=e.code_set??0,s=e.devices.filter(l=>l.created_by==="portal"&&l.created>=o),r=s.map(l=>n("input",{type:"checkbox",id:`dl-rm-${l.id}`,checked:"checked","data-id":l.id})),i=[n("p",{},_("The old link stops working right away."))];s.length&&i.push(n("p",{},_("Devices added through the old link keep working until they are removed. Remove them too:")),n("div",{class:"dl-checklist"},s.map((l,d)=>n("label",{for:`dl-rm-${l.id}`},[r[d],` ${l.name}`]))));let a=async()=>{let l=r.filter(c=>c.checked).map(c=>c.dataset.id),d=await q(()=>N.personRegen(e.id,l),l.length?G(l.length,"New link created, %s device removed","New link created, %s devices removed"):_("New link created"));d&&(le(),l.length&&await t.refresh(),d.link&&await xe(d.link,_("New link copied")))};ae(_("Create a new link?"),i,[de()," ",H(_("Create new link"),a,"negative")])}function ss(t){let e=n("textarea",{class:"cbi-input-textarea dl-note-input",rows:3,maxlength:500,placeholder:_("Only you see this")},t.p.note??"");ae(_("Note"),[e],[de()," ",H(_("Save"),async()=>{le(),await t.patch({note:e.value.trim()},e.value.trim()?_("Note saved"):_("Note removed"))},"positive")]),setTimeout(()=>e.focus(),50)}function Ii(t){let e=t.p,o=n("select",{class:"cbi-input-select"},[n("option",{value:"pause",selected:e.expire_action==="pause"?"selected":null},_("Pause access")),n("option",{value:"notify",selected:e.expire_action==="notify"?"selected":null},_("Keep access")),n("option",{value:"remove",selected:e.expire_action==="remove"?"selected":null},_("Remove their devices"))]),s=n("select",{class:"cbi-input-select"},[0,1,3,7,14].map(r=>n("option",{value:r,selected:e.expire_warn===r?"selected":null},r?G(r,"%s day before","%s days before"):_("Don’t warn"))));ae(_("When access ends"),[Hi(_("Then"),o),n("div",{class:"cbi-value"},[n("label",{class:"cbi-value-title"},_("Warn")),n("div",{class:"cbi-value-field"},[s,n("div",{class:"cbi-value-description"},_("Shown in their portal and on the Overview."))])])],[de()," ",H(_("Save"),async()=>{le(),await t.patch({expire_action:o.value,expire_warn:s.value},_("Saved"))},"positive")])}function Oi(t){let e=n("input",{type:"text",class:"cbi-input-text",value:t.p.name,maxlength:48}),o=Me(_("Name","person"),e,()=>je(e.value,[],_("Shown in their portal and apps.")));ae(_("Rename"),[o],[de()," ",H(_("Save"),async()=>{let s=o.help();if(s.bad){F(s.text,"warning");return}await t.patch({name:e.value.trim()},_("Renamed"))&&le()},"positive")]),setTimeout(()=>e.select(),50)}function Bi(t){let e=t.p,o=t.st.servers.filter(i=>i.id!==e.server),s=n("select",{class:"cbi-input-select"},o.map(i=>n("option",{value:i.id},`${i.name} · ${i.endpoint||_("no address")}:${i.port}`))),r=e.devices.length;ae(m(_("Move %s to another server"),e.name),[Hi(_("Server"),s),n("p",{class:"dl-muted"},r?G(r,"%s device gets a new address and stops connecting until it imports its configuration again (from the personal link or from you). Circles and home networks of the old server are left behind.","%s devices get new addresses and stop connecting until they import their configuration again (from the personal link or from you). Circles and home networks of the old server are left behind."):_("They have no devices yet: nothing else changes."))],[de()," ",H(_("Move"),async()=>{await t.patch({server:s.value},m(_("Moved to %s"),o.find(i=>i.id===s.value)?.name??_("the server")))&&(le(),r&&F(_("Devices are marked “Update config” until they import again."),"info",6e3))},"positive")])}async function ji(t){let e=t.p;await pe(m(_("Delete %s?"),e.name),G(e.devices.length,"%s device is disconnected immediately and the personal link stops working.","All %s devices are disconnected immediately and the personal link stops working."),_("Delete"),!0)&&await q(()=>N.personDelete(e.id),_("Deleted"))&&(location.href=jt(e.server))}function Ui(t){let e=t.p,o=t.st,s=e.online?_("online now"):e.last_seen?m(_("last seen %s"),ce(e.last_seen,o.now)):_("never connected"),r=e.created?m(_("Added %s","date"),$e(qe(new Date(e.created*1e3)))):"",i=e.has_link??o.settings.portal_enabled,a=[{label:_("Rename"),icon:v("edit"),run:()=>Oi(t)},{label:e.note?_("Edit note"):_("Add note"),icon:v("file"),run:()=>ss(t)},...o.servers.length>1?[{label:_("Move to server…"),icon:v("server"),run:()=>Bi(t)}]:[],...i?[null,{label:_("Invite card"),icon:v("qr"),run:()=>zi(t)},{label:_("New link"),icon:v("key"),run:()=>Ri(t)}]:[],null,...e.paused?[]:[{label:_("Pause"),icon:v("pause"),warn:!0,run:()=>t.patch({paused:!0},_("Paused"))}],{label:_("Delete"),icon:v("trash"),danger:!0,run:()=>ji(t)}];return n("div",{class:"dl-person-head"},[n("div",{class:"dl-pagehead"},[n("div",{class:"dl-person-id"},[n("span",{class:`dl-avatar lg${e.online?" online":""}`},Oe(e.name)),n("div",{class:"dl-stack"},[n("div",{class:"dl-title-row"},[n("h2",{class:"dl-h1"},e.name),vs(e)]),n("span",{class:"dl-faint",title:r},`${m(N_(e.device_limit,"%s of %s device","%s of %s devices"),e.devices.length,e.device_limit)} · ${s}`)])]),n("div",{class:"dl-pcard-actions"},[e.paused?H([v("play"),` ${_("Resume")}`],()=>t.patch({paused:!1},_("Resumed")),"add"):"",i?Pe("link",_("Copy link"),()=>On(e.id),"neutral","dl-icon-only"):"",Pe("more",_("More"),l=>Te(l.currentTarget,a),"neutral","dl-icon-only")])]),e.note?n("button",{type:"button",class:"dl-pnote",title:_("Edit note"),click:()=>ss(t)},[v("file"),n("span",{},e.note)]):""])}function Wi(t){let e=t.p,o=t.series[t.series.length-1];return n("div",{class:`dl-person-live${e.online?"":" solo"}`},[e.online?pi(e.rate??[],t.st.now,o?[o.rx,o.tx]:[0,0]):"",Yn(t.series,m(_("%s this month"),se(e.month[0]+e.month[1])))])}async function kd(t,e){let o=await q(()=>N.deviceConfig(e.id,!0));o&&ae(m(_("Set up %s"),e.name),[await t.core.connectBlock(o,"qr")],[de(_("Close"))])}async function _d(t,e){let o=await q(()=>N.deviceConfig(e.id,!0));if(!o)return;if(!o.has_private_key){F(_("This device made its own keys in the browser; its configuration only exists there."),"warning");return}let s=t.core.file.make(o);Ae(s.name,s.text,"application/octet-stream")}function Gi(t){let e=t.p,o=t.st.now,s=d=>Ye(e,d,t.deviceOpts()),r=d=>c=>{c.target.closest("button:not(.dl-dcard-title), a")||s(d)},i=d=>H([v("more")],c=>Br(c.currentTarget,e,d,t.deviceOpts()),"neutral",{title:_("QR, file, key, rename, new keys, remove"),class:"cbi-button cbi-button-neutral dl-icon-only"}),a=vn(e.devices).map(d=>{let c=n("div",{class:"dl-dcard-head"},[n("span",{class:"dl-dcard-ic"},v(d.kind)),n("button",{type:"button",class:"dl-dcard-title",click:()=>s(d)},[n("b",{},d.name),xn(d,o,void 0,e),d.config_stale?n("span",{class:"dl-pill warn dl-stale"},_("Update config")):""]),i(d)]),p=n("div",{class:"dl-dcard-trend"},[n("div",{class:"dl-stack"},[n("b",{},se(d.month[0]+d.month[1])),n("span",{class:"dl-sub"},_("this month"))]),mi(t.devSeries[d.id]??[])]);return n("article",{class:`dl-dcard clickable${d.online?" online":""}${d.disabled?" off":""}`,click:r(d)},[c,d.handshake?p:d.disabled?n("div",{class:"dl-sub"},`${at(d.kind)} · ${m(d.created_by==="portal"?_("created %s in the portal."):_("created %s by you."),ce(d.created,o))}`):n("div",{class:"dl-chips-row"},[n("button",{type:"button",class:"dl-chipbtn",click:()=>kd(t,d)},[v("qr"),_("Show QR")]),n("button",{type:"button",class:"dl-chipbtn",click:()=>_d(t,d)},[v("download"),_("Config")])])])}),l=e.devices.length>=e.device_limit;return a.push(n("button",{type:"button",class:"dl-dslot add",click:()=>pt(e,t.deviceOpts())},[n("span",{class:"dl-dslot-ic"},v("plus")),n("span",{class:"dl-stack"},[n("b",{},_("Add device")),n("span",{class:"dl-sub"},l?`${_("Over the limit")} · ${m(_("%s of %s"),e.devices.length,e.device_limit)}`:m(_("%s of %s"),e.devices.length,e.device_limit))])])),n("section",{class:"dl-devsec"},[n("div",{class:"dl-panel-head"},[n("h3",{},_("Devices")),n("span",{class:"dl-sub"},m(_("%s online"),V(e.online)))]),n("div",{class:"dl-dgrid"},a)])}function Fi(t){let e=t.p,o=Ze([["device",_("Device’s own DNS")],["home",_("Home names")]],e.dns_mode,{label:"DNS",cls:"sm",optimistic:!1,onChange:r=>t.patch({dns_mode:r},r==="home"?_("Home names on - devices need their configuration again"):_("Device DNS - devices need their configuration again"))}),s=t.st.settings.home_dns_fallback;return n("div",{class:"dl-stack gap4 dl-dnspick"},[n("div",{class:"dl-row-actions"},[n("span",{class:"dl-sub"},"DNS"),o]),n("span",{class:"dl-sub"},e.dns_mode==="home"?s?oe(_("Names like %s work. Internet names are resolved at home, so they depend on the tunnel (%s takes over when it is down)."),n("span",{class:"dl-mono"},`nas.${t.st.settings.domain}`),n("span",{class:"dl-mono"},s)):oe(_("Names like %s work. Internet names are resolved at home, so they depend on the tunnel - with no fallback set, they stop when it is down."),n("span",{class:"dl-mono"},`nas.${t.st.settings.domain}`)):_("Internet keeps working exactly as without the VPN. Reach home devices by IP address."))])}function qi(t){let e=t.p,s=t.st.servers.find(i=>i.id===e.server)?.home??[];if(s.length<2)return"";let r=new Set(e.home_nets?.length?e.home_nets:s.map(i=>i.dev));return n("div",{class:"dl-stack gap4"},[n("div",{class:"dl-chips-row"},s.map(i=>Yt(i.dev,r.has(i.dev),()=>{let a=new Set(r);if(a.delete(i.dev)||a.add(i.dev),!a.size)return F(_("Keep at least one network, or choose Internet only."),"warning",5e3);let l=a.size===s.length?[]:[...a];t.patch({home_nets:l},l.length?m(_("%s reaches %s"),e.name,l.join(", ")):m(_("%s reaches every home network"),e.name))},{title:i.nets.join(", ")}))),n("span",{class:"dl-sub"},e.home_nets?.length?m(_("Home networks %s reaches. Networks added to the server later stay out."),e.name):m(_("Home networks %s reaches: all of them. Untick one to keep %s out of it."),e.name,e.name))])}function Ki(t){let e=new Set(t.p.services??[]);return n("div",{class:"dl-stack gap4"},[n("div",{class:"dl-chips-row"},t.st.services.map(o=>Yt(o.name,e.has(o.id),()=>{let s=new Set(e);s.delete(o.id)||s.add(o.id),t.patch({services:[...s]},s.size?_("Home services updated"):_("Whole home network"))},{title:`${o.address}${o.ports.length?` · ${o.ports.join(", ")}`:""}`}))),n("span",{class:"dl-sub"},e.size?_("Only the selected services at home."):_("Whole home network. Pick services to narrow it down."))])}function Vi(t){let e=t.p,o=t.st;if(o.servers.find(c=>c.id===e.server)?.mesh!=="circles"||!mt(e))return"";let r=o.circles.filter(c=>c.server===e.server),i=r.find(c=>c.id===e.circle),a=i?o.people.filter(c=>c.id!==e.id&&c.circle===i.id&&mt(c)).map(c=>c.name):[],l=n("button",{type:"button",class:"dl-chipbtn",click:()=>Te(l,[...r.map(c=>({label:c.name,icon:qo(c),run:()=>c.id!==e.circle&&t.patch({circle:c.id},m(_("%s is in %s"),e.name,c.name))})),e.circle?{label:_("No circle"),icon:v("x"),run:()=>t.patch({circle:""},m(_("%s is in no circle"),e.name))}:null,{label:_("New circle"),icon:v("plus"),run:()=>jn(o,e.server,null,()=>t.refresh())}])},_("Change")),d=i?o.people.filter(c=>c.circle===i.id&&mt(c)):[e];return n("div",{class:"dl-tile2"},[n("div",{class:"dl-tile2-label"},[n("span",{},_("Devices see each other")),l]),n("div",{class:"dl-tile2-row"},[n("span",{class:"dl-tile2-value"},i?i.name:_("No circle")),n("span",{class:"dl-avstack",title:d.map(c=>c.name).join(", ")},d.slice(0,5).map(c=>n("span",{class:"dl-avatar sm"},Oe(c.name))))]),n("span",{class:"dl-sub"},i?a.length?[e.name,...a].join(", "):m(_("Nobody else in %s yet"),i.name):m(_("Only %s's own devices"),e.name))])}function Yi(t){let e=t.p,o=t.st.now,s=n("div",{class:"dl-slots"});for(let a=0;a=e.device_limit,c=n("i",{class:d?"over":l?"used":""});we(c,()=>[n("div",{class:"dl-tip-title"},l?`${l.name}${d?` · ${_("over the limit")}`:""}`:_("Free slot")),n("div",{class:"dl-muted"},l?l.online?_("Connected"):l.handshake?m(_("Last seen %s"),ce(l.handshake,o)):_("Not set up yet"):_("They can add a device here"))]),s.appendChild(c)}let r=Math.max(1,e.devices.length),i=n("button",{type:"button","aria-label":_("Allow fewer devices"),disabled:e.device_limit<=r?"disabled":null,click:()=>t.patch({device_limit:String(e.device_limit-1)})},"−");return e.device_limit<=r&&e.devices.length>1&&we(i,()=>[n("div",{class:"dl-tip-title"},G(e.devices.length,"%s device in use","%s devices in use")),n("div",{class:"dl-muted"},_("Remove a device first to lower the limit"))]),n("div",{class:"dl-tile2"},[n("div",{class:"dl-tile2-label"},_("Devices")),n("div",{class:"dl-tile2-row"},[n("span",{class:"dl-tile2-value"},[String(e.devices.length),n("span",{class:"dl-faint"},` / ${e.device_limit}`)]),n("div",{class:"dl-stepper"},[i,n("button",{type:"button","aria-label":_("Allow more devices"),disabled:e.device_limit>=32?"disabled":null,click:()=>t.patch({device_limit:String(e.device_limit+1)})},"+")])]),s])}function Cd(t){return{internet:_("Browse the internet through your router. No access to devices at home, and home cannot reach theirs."),lan:_("Reach devices at home, and home reaches theirs. Internet stays on their own connection."),both:_("Home devices and the internet, all through your router. Home reaches their devices too.")}[t]}var Ji=/^([01]\d|2[0-3]):[0-5]\d$/;function Ld(t){let e=t.p,o=t.today,s=rt(e.expires,o),r=n("input",{type:"date",class:"dl-date-hidden",value:e.expires,tabindex:"-1","aria-hidden":"true"});r.addEventListener("change",()=>r.value&&t.patch({expires:r.value},m(_("Access until %s"),$e(r.value))));let i=(c,p)=>{let u=ms(e.expires&&(s??-1)>=0?e.expires:"",c,p,o);t.patch({expires:u},m(_("Access until %s"),$e(u)))},a=[["week",1,_("+1 week")],["month",1,_("+1 month")],["month",3,_("+3 months")],["year",1,_("+1 year")]].map(([c,p,u])=>n("button",{type:"button",class:"dl-chipbtn",click:()=>i(c,p)},u)),l=n("span",{class:"dl-datechip"},[n("button",{type:"button",class:"dl-chipbtn",click:()=>{r.focus({preventScroll:!0});try{r.showPicker()}catch{}}},[v("calendar"),e.expires?$e(e.expires):_("Date")]),r]),d={pause:_("pause access"),notify:_("keep access"),remove:_("remove their devices")}[e.expire_action];return n("div",{class:"dl-tile2"},[n("div",{class:"dl-tile2-label"},[n("span",{},_("Access ends")),e.expires?n("span",{class:s!=null&&s<0?"dl-bad":it(e,s)?"dl-warn":"dl-ok"},s!=null&&s<0?_("ended"):G(s??0,"%s day left","%s days left")):n("span",{class:"dl-faint"},_("no end date"))]),n("div",{class:"dl-chips-row"},[...a,l,e.expires?n("button",{type:"button",class:"dl-chipbtn",click:()=>t.patch({expires:""},_("No end date"))},_("No end")):""]),n("div",{class:"dl-tile2-foot"},[n("span",{class:"dl-muted"},e.expire_warn?m(N_(e.expire_warn,"When it ends: %s, warn %s day before","When it ends: %s, warn %s days before"),d,V(e.expire_warn)):m(_("When it ends: %s"),d)),n("a",{href:"#",click:c=>{c.preventDefault(),Ii(t)}},_("Change"))])])}function Md(t){let e=t.p,o=e.quota_used||e.month[0]+e.month[1],s=e.quota_limit?Math.min(100,e.quota_used/e.quota_limit*100):0,r=n("div",{class:`dl-meter${s>=100?" bad":s>=90?" warn":""}`},[n("i"),e.quota_limit?n("span",{class:"mark",title:_("Alert at 90%")}):""]);r.firstChild.style.width=`${s}%`,e.quota_limit&&we(r,()=>[n("div",{class:"dl-tip-title"},m(_("%s%% used"),V(s,1))),n("div",{class:"dl-muted"},`${m(_("%s of %s"),se(e.quota_used),se(e.quota_limit))} · ${m(_("%s left"),se(Math.max(0,e.quota_limit-e.quota_used)))}`),n("div",{class:"dl-faint"},_("Alert at 90%"))]);let i=Ze([["month",_("Monthly")],["total",_("Total")]],e.quota_period,{label:_("Data limit period"),cls:"sm",optimistic:!1,onChange:l=>t.patch({quota_period:l})}),a=[10,50,100].map(l=>n("button",{type:"button",class:`dl-chipbtn${e.quota_gb===l?" on":""}`,click:()=>t.patch({quota_gb:String(l)},m(_("Data limit %s GB"),V(l)))},`${V(l)} ${_("GB")}`));return a.push(n("button",{type:"button",class:`dl-chipbtn${e.quota_gb?"":" on"}`,click:()=>t.patch({quota_gb:""},_("No data limit"))},_("Unlimited"))),a.push(n("button",{type:"button",class:"dl-chipbtn",click:()=>{let l=n("input",{type:"number",class:"cbi-input-text dl-w-port",min:0,step:"any",value:e.quota_gb?String(e.quota_gb):""}),d=Me(_("Data limit (GB)"),l,()=>Tn(l.value,e.quota_period==="month"));ae(_("Data limit"),[d],[de()," ",H(_("Save"),async()=>{let c=d.help();if(c.bad){F(c.text,"warning");return}let p=l.value.trim();await t.patch({quota_gb:p},p&&Number(p)>0?m(_("Data limit %s GB"),V(Number(p))):_("No data limit"))&&le()},"positive")]),setTimeout(()=>l.select(),50)}},_("Custom"))),n("div",{class:"dl-tile2"},[n("div",{class:"dl-tile2-label"},[n("span",{},_("Data")),i]),n("div",{class:"dl-tile2-row"},[n("span",{class:"dl-tile2-value"},[se(o),e.quota_limit?n("span",{class:"dl-faint"},` ${m(_("of %s"),se(e.quota_limit))}`):n("span",{class:"dl-faint"},` · ${_("no limit")}`)]),e.quota_period==="month"?n("span",{class:"dl-sub"},_("resets on the 1st")):""]),e.quota_limit?r:"",n("div",{class:"dl-chips-row"},a),e.quota_gb&&e.quota_period==="month"?n("div",{class:"dl-tile2-foot"},[n("span",{class:"dl-muted"},e.bonus_gb?m(_("Includes +%s GB extra this month"),V(e.bonus_gb)):_("Need a little more this month?")),n("a",{href:"#",click:l=>{l.preventDefault(),t.patch({bonus_gb:String((e.bonus_gb||0)+10)},_("+10 GB this month"))}},_("+10 GB this month"))]):"",n("div",{class:"dl-tile2-foot"},[n("span",{class:"dl-muted"},m(_("%s in total"),se(e.total[0]+e.total[1]))),n("button",{type:"button",class:"dl-linkbtn danger",click:()=>It("person",e.id,e.name,()=>setTimeout(()=>t.refresh(),300))},_("Reset usage"))])])}function Ed(t){let e=t.p,o=!!e.hours,[s,r]=(e.hours||"07:00-23:00").split("-"),i=n("input",{type:"time",class:"cbi-input-text",value:s,"aria-label":_("From")}),a=n("input",{type:"time",class:"cbi-input-text",value:r,"aria-label":_("To")}),l=n("div",{class:"dl-tile2-row"},[i,n("span",{class:"dl-faint"},_("to","time range")),a]),d=()=>{let g=`${i.value}-${a.value}`;if(g!==e.hours){if(!Ji.test(i.value)||!Ji.test(a.value))return F(_("Enter both times, like 07:00 and 23:00."),"warning");if(i.value===a.value)return F(_("The start and the end must differ."),"warning");t.patch({hours:g},m(_("Allowed %s–%s"),i.value,a.value))}};l.addEventListener("focusout",g=>{l.contains(g.relatedTarget)||d()});for(let g of[i,a])g.addEventListener("keydown",M=>{M.key==="Enter"&&(M.preventDefault(),d())});let c=n("button",{type:"button",role:"switch","aria-checked":o?"true":"false",class:`dl-switch${o?" on":""}`,"aria-label":_("Limit hours"),click:()=>{if(o)return t.patch({hours:""},_("Any time"));c.classList.add("on"),c.setAttribute("aria-checked","true"),p.textContent=_("Set the hours, then press Enter"),u.appendChild(l),i.focus()}},n("i")),p=n("span",{},o?m(_("%s – %s (router time)"),s,r):_("Any time")),u=n("div",{class:"dl-tile2"},[n("div",{class:"dl-tile2-row"},[n("div",{class:"dl-stack"},[n("span",{class:"dl-tile2-label"},_("Allowed hours")),p]),c]),o?l:""]);return u}function Zi(t){let e=t.p,o=Ze(["internet","lan","both"].map(s=>[s,[v(s==="internet"?"globe":s==="lan"?"home":"shield"),s==="internet"?_("Internet"):s==="lan"?_("Home"):_("Both")]]),e.access,{label:_("Access"),cls:"wide",optimistic:!1,onChange:s=>t.patch({access:s},m(_("Access: %s"),bt(s)))});return n("section",{class:"dl-devsec","aria-label":_("Access and limits")},[n("div",{class:"dl-panel-head"},[n("h3",{},_("Access & limits"))]),n("div",{class:"dl-panel"},[n("div",{class:"dl-stack gap8"},[n("span",{class:"dl-tile2-label"},_("Can reach")),o,n("span",{class:"dl-sub"},Cd(e.access)),e.access==="lan"&&t.st.services.length?Ki(t):"",mt(e)?qi(t):"",e.access==="lan"?Fi(t):""]),n("div",{class:"dl-tiles2"},[Yi(t),Vi(t),Ld(t),Md(t),Ed(t)])])])}function Td(t){let e=t.st,o=n("div",{class:"dl-panel-head pad"},[n("h3",{},_("Locations")),n("span",{class:"dl-spacer"}),e.geo.enabled?Bt("30d",r=>t.map?.setRange(r),!1):"",H(_("Hide"),()=>{t.mapOpen=!1,t.map?.destroy(),t.map=null,t.paintPlaces()},"neutral")]);if(!e.geo.enabled)return n("div",{class:"dl-panel flush"},[o,n("div",{class:"dl-map-off"},oe(_("Locations are off. %s."),n("a",{href:L.url("admin/network/dawnline/settings")},_("Turn them on in Settings"))))]);let s=new ct({openPerson:()=>{},openDevice:(r,i)=>{let a=t.p.devices.find(l=>l.id===i);a&&Ye(t.p,a,t.deviceOpts())}},"30d",280);return t.map=s,requestAnimationFrame(()=>s.mount(t.mapData())),n("div",{class:"dl-panel flush"},[o,s.el])}function Qi(t){let e=t.st;if(!e.geo.enabled)return n("div",{class:"dl-places"},[v("pin"),n("div",{class:"dl-stack"},[n("span",{},_("Locations are off")),n("span",{class:"dl-sub"},_("City-level, from the client IP"))]),n("span",{class:"dl-spacer"}),n("a",{class:"cbi-button cbi-button-neutral",href:L.url("admin/network/dawnline/settings")},_("Turn on"))]);if(t.mapOpen)return t.map&&t.parts.places.contains(t.map.el)?null:Td(t);let o=e.now-30*86400,s=e.geo.points.filter(a=>a.person===t.p.id&&a.ts>=o).sort((a,l)=>l.ts-a.ts),r=[...new Set(s.map(a=>a.city||a.country).filter(Boolean))],i=s[0];return n("div",{class:"dl-places"},[v("pin"),n("div",{class:"dl-stack"},[n("span",{},i?i.city||i.country:_("No locations yet")),n("span",{class:"dl-sub"},i?[G(r.length,"%s place in 30 days","%s places in 30 days"),i.org].filter(Boolean).join(" · "):_("Shown after a device connects"))]),n("span",{class:"dl-spacer"}),s.length?H(_("Show map"),()=>{t.mapOpen=!0,t.paintPlaces()},"neutral"):""])}function Xi(t){let e=t.p,o=t.st,s=t.events.filter(l=>l.person===e.id),r=[],i=[...s].reverse();for(let l=0;l1){let u=p.querySelector(".dl-row-main");dom.content(u,[...Zo(o,d).slice(0,3),n("span",{class:"dl-muted"},G(c,"%s time","%s times"))]),u.title=i.slice(l,l+c).map(g=>g.detail??"").join(` -`)}r.push(p),l+=c-1}let a=H([v("more")],()=>Te(a,[{label:_("Export CSV"),icon:v("download"),run:()=>Xe(o,s,"csv",e.id)},{label:_("Export JSON"),icon:v("download"),run:()=>Xe(o,s,"json",e.id)},null,{label:m(_("Clear %s's activity"),e.name),icon:v("trash"),danger:!0,run:()=>dt(m(_("Clear %s's activity"),e.name),m(_("Removes events about %s and their devices."),e.name),{person:e.id},()=>t.refresh())}]),"neutral",{title:_("Export or clear"),class:"cbi-button cbi-button-neutral dl-icon-only"});return n("div",{class:"dl-panel flush"},[n("div",{class:"dl-panel-head pad"},[n("h3",{},_("Activity")),n("span",{class:"dl-sub"},s.length>10?m(_("latest 10 of %s"),V(s.length)):""),n("span",{class:"dl-spacer"}),a]),r.length?r:n("div",{class:"dl-row dl-muted"},_("Nothing yet."))])}var no=class{constructor(){this.id="";this.events=[];this.mapOpen=!1;this.map=null;this.parts={};this.series=[];this.devSeries={};this.ticks=0;this.fullNext=!1}async fetch(e){let[o,s,r]=await Promise.all([N.status(30),e?N.events(2e3,this.id).catch(()=>null):Promise.resolve(null),e?N.personUsage(this.id,30).catch(()=>null):Promise.resolve(null)]);return{st:o,ev:s?.events??null,use:r}}async load(){return this.id=new URLSearchParams(location.search).get("id")??"",this.fetch(!0)}render(e){this.take(e);let o=this.st.people.find(a=>a.id===this.id);if(!o)return n("div",{class:"dl-empty"},[n("h3",{},_("Person not found")),n("p",{},_("They may have been removed.")),n("a",{class:"cbi-button",href:L.url("admin/network/dawnline/server")},_("Back to Servers"))]);this.p=o;for(let a of["crumbs","head","devices","traffic","places","activity","limits"])this.parts[a]=n("div",{});this.parts.devices.className="dl-person-devices";let s=n("div",{},[this.parts.crumbs,this.parts.head,n("div",{class:"dl-grid-person"},[n("div",{class:"dl-col"},[this.parts.devices,this.parts.traffic,this.parts.places,this.parts.activity]),n("div",{class:"dl-col"},[this.parts.limits])])]);this.paint();let r=new URLSearchParams(location.search),i=r.get("device")&&o.devices.find(a=>a.id===r.get("device"));return i?setTimeout(()=>Ye(this.p,i,this.deviceOpts()),50):r.get("add")&&setTimeout(()=>pt(this.p,this.deviceOpts()),50),this.poller=nt({fetch:a=>{let l=a||this.fullNext||++this.ticks%4===0;return this.fullNext=!1,this.fetch(l)},every:15,live:!0,active:()=>s.isConnected,apply:(a,l)=>this.apply(a,l)}),s}take(e){this.st=e.st,e.ev&&(this.events=e.ev),e.use&&(this.series=e.use.person,this.devSeries=e.use.devices)}apply(e,o){this.take(e);let s=this.st.people.find(r=>r.id===this.id);if(!s){o||(location.href=jt(this.p?.server));return}this.p=s,this.paint(o),this.map?.update(this.mapData())}async refresh(){this.fullNext=!0,await this.poller?.refresh()}async patch(e,o){var i;this.poller?.claim();let s=await q(()=>N.personUpdate(this.p.id,e),o);if(!s)return!1;this.poller?.claim();let r=this.st.people.findIndex(a=>a.id===this.p.id);return(i=s.person).rate??(i.rate=this.p.rate),r>=0&&(this.st.people[r]=s.person),this.p=s.person,this.paint(),!0}get today(){return Ge(this.series.length?this.series:this.st.series)}get core(){return Ot(this.st.servers,this.p.server)}deviceOpts(){return{refresh:()=>this.refresh(),geo:this.st.geo,now:this.st.now,today:this.today,core:this.core,server:this.st.servers.find(e=>e.id===this.p.server),events:()=>this.events}}mapData(){return{geo:this.st.geo,people:this.st.people,now:this.st.now,person:this.p.id}}crumbs(){let e=this.p;return n("nav",{class:"dl-crumbs","aria-label":_("Breadcrumb")},[n("a",{href:jt(e.server)},this.st.servers.find(o=>o.id===e.server)?.name??_("Servers")),n("span",{},"/"),n("a",{href:jt(e.server)},_("People")),n("span",{},"/"),n("span",{},e.name)])}paint(e=!1){Ne(this.parts.crumbs,this.crumbs(),e),Ne(this.parts.head,Ui(this),e),Ne(this.parts.traffic,Wi(this),e),Ne(this.parts.devices,Gi(this),e),Ne(this.parts.limits,Zi(this),e),this.paintPlaces(e),Ne(this.parts.activity,Xi(this),e)}paintPlaces(e=!1){let o=Qi(this);o&&Ne(this.parts.places,o,e&&!this.mapOpen)}};var Sd={ok:"check",warn:"alert",error:"x",skip:"pause"},oo=class{constructor(e,o,s,r){this.el=n("div",{});this.wdEl=n("div",{});this.checksEl=n("div",{class:"dl-panel"});this.recentEl=n("div",{class:"dl-panel flush dl-recent"});this.checks=null;this.summary=n("div",{});this.open=new Set;this.st=e,this.sl=o,this.events=s,this.toLog=r,dom.content(this.el,[this.summary,this.wdEl,n("div",{class:"dl-health-cols"},[this.checksEl,this.recentEl])]),this.paintChecks(),this.paintLive(o,s)}async run(e){let o=e?await Jn(e):await N.health().catch(()=>null);o&&(this.take(o),e==="netrestart"&&setTimeout(()=>this.el.isConnected&&void this.run(),5e3))}take(e){this.checks=e.checks,this.paintChecks(),this.paintLive(e,this.events)}paintChecks(){let e=this.checks;if(!e){dom.content(this.summary,""),dom.content(this.checksEl,[n("div",{class:"dl-panel-head"},[n("h3",{},_("Checks"))]),n("p",{class:"dl-muted dl-loading"},_("Running checks…"))]);return}let o=e.filter(a=>a.status==="error").length,s=e.filter(a=>a.status==="warn").length;dom.content(this.summary,o?yt("error",G(o,"%s problem needs attention.","%s problems need attention.")):s?yt("warn",G(s,"%s warning.","%s warnings.")):yt("ok",_("All checks passed.")));let r=new Map;for(let a of this.sl.watchdog.repairs)r.set(a.id,Math.max(r.get(a.id)??0,a.ts));let i=()=>this.run();dom.content(this.checksEl,[n("div",{class:"dl-panel-head"},[n("h3",{},_("Checks")),n("span",{class:"dl-spacer"}),H(_("Run again"),i)]),n("ul",{class:"dl-checks"},e.map(a=>n("li",{},[n("span",{class:`dl-check-icon ${a.status}`},v(Sd[a.status])),n("div",{class:"dl-check-body"},[n("div",{class:"dl-check-title"},a.title),n("div",{class:"dl-check-detail"},a.detail),r.has(a.id)?n("div",{class:"dl-check-repaired"},m(_("Repaired by the watchdog at %s"),Ft(r.get(a.id)))):""]),Qo(a,l=>void this.run(l),i)])))])}paintLive(e,o){this.sl=e,this.events=o;let s=e.watchdog,r=s.beat!=null&&s.now-s.beat>180,i=s.repairs.filter(d=>s.now-d.ts<86400),a=i[i.length-1],l=be(s.enabled,_("Watchdog repairs"),async d=>{await q(()=>N.settingsUpdate({watchdog:d?"1":"0"}),d?_("Watchdog on"):_("Watchdog off"))||vo(l,!d);let p=await N.serviceLog().catch(()=>null);p&&this.paintLive(p,this.events)});dom.content(this.wdEl,n("div",{class:"dl-panel dl-wd"},[n("div",{class:"dl-wd-head"},[n("span",{class:`dl-wd-tile${s.enabled?"":" off"}`},v("shield")),n("div",{class:"dl-stack"},[n("span",{class:"dl-wd-title"},_("Watchdog")),n("span",{class:"dl-sub"},s.enabled?_("Every minute it checks the tunnels and services and repairs what it can on its own."):_("Off: problems are only written to the log. Nothing is repaired on its own."))]),n("span",{class:"dl-spacer"}),l]),n("div",{class:"dl-wd-foot"},[n("div",{class:"dl-wd-chips"},s.targets.map(d=>n("span",{class:`dl-check-chip${d.ok?"":" error"}`,title:d.ok?_("OK"):d.tries?`${_("Not working")} · ${G(d.tries,"%s repair","%s repairs")}`:_("Not working")},[v(d.ok?"check":"x"),d.name]))),n("span",{class:`dl-sub${r?" dl-warn-text":""}`},r?m(_("The agent has not checked in for %s min; cron restarts it after 5."),V(Math.round((s.now-s.beat)/60))):[s.last?m(_("Looked %s"),ce(s.last,s.now)):_("Starts within a minute")," · ",i.length?m(N_(i.length,"%s repair today, last %s at %s","%s repairs today, last %s at %s"),V(i.length),a.name,Ft(a.ts)):_("no repairs today")])])])),this.paintRecent()}paintRecent(){let e=(this.sl.watchdog.now||Date.now()/1e3)-604800,o=[...this.events.map(r=>({ts:r.ts,ev:r})),...this.sl.log.map(r=>({ts:r.ts,sys:r}))].filter(r=>r.ts>=e&&Sn(r)).sort((r,i)=>i.ts-r.ts),s=n("div",{class:"dl-panel-head pad"},[n("h3",{},_("Recent problems")),n("span",{class:"dl-spacer"}),o.length?n("a",{href:"#",click:r=>(r.preventDefault(),this.toLog())},`${_("All in Log")} →`):""]);if(!o.length){dom.content(this.recentEl,[s,n("div",{class:"dl-recent-empty"},[n("span",{class:"dl-check-icon ok"},v("check")),_("No problems in the last 7 days.")])]);return}dom.content(this.recentEl,[s,...o.slice(0,8).map(r=>{if(r.sys){let i=r.sys,a=`${i.ts}|${i.msg}`;return qn(i,this.open.has(a),()=>{this.open.delete(a)||this.open.add(a),this.paintRecent()},Ft(i.ts))}return ft(this.st,r.ev,{time:Ft(r.ts)})})])}};var so=300,Pd=["all","connections","people","system","problems"],ro=class{constructor(e,o,s){this.events=[];this.system=[];this.kind="all";this.shown=so;this.open=new Set;this.list=n("div",{});this.sub="";this.tabs=n("div",{class:"dl-seg",role:"tablist"});this.st=e,this.take(o),this.system=s,this.el=n("div",{},[n("div",{class:"dl-toolbar"},[this.tabs]),this.list]),this.paint()}actions(){let e=()=>this.kind==="all"?"":this.kind,o=i=>()=>{let a=this.filtered().reverse();Xe(this.st,a.filter(l=>l.ev).map(l=>l.ev),i,e(),a.filter(l=>l.sys).map(l=>l.sys))},s=H([v("download"),` ${_("Export")}`],()=>Te(s,[{label:_("CSV (spreadsheet)"),icon:v("download"),run:o("csv")},{label:"JSON",icon:v("download"),run:o("json")}])),r=H([v("trash"),` ${_("Clear")}`],()=>dt(_("Clear the log"),_("Removes events from the log on the router."),{},()=>this.reload(),this.kind==="all"?void 0:this.kind,!0));return[s,r]}take(e){this.events=e.events,this.policy=e.policy;let o=Rt.filter(r=>!e.policy.categories.includes(r)),s=Pn(e.policy);this.sub=o.length?`${s} ${m(_("Not recorded: %s."),o.map(r=>Ke(r).toLowerCase()).join(", "))}`:s}async reload(){let[e,o]=await Promise.all([N.events(2e4).catch(()=>null),N.serviceLog().catch(()=>null)]);e&&this.take(e),o&&(this.system=o.log),this.paint()}items(){return[...this.events.map(e=>({ts:e.ts,ev:e})),...this.system.map(e=>({ts:e.ts,sys:e}))].sort((e,o)=>o.ts-e.ts)}matches(e,o){return o==="all"?!0:o==="problems"?Sn(e):o==="system"?!!e.sys:!!e.ev&&Zt(e.ev.type)===o}filtered(){return this.items().filter(e=>this.matches(e,this.kind))}paintTabs(e){dom.content(this.tabs,Pd.map(o=>n("button",{type:"button",role:"tab",class:o===this.kind?"on":"","aria-selected":o===this.kind?"true":"false",click:()=>this.show(o)},[o==="all"?_("All"):o==="system"?_("System"):Ke(o),n("b",{},String(e.filter(s=>this.matches(s,o)).length))])))}show(e){this.kind=e,this.shown=so,this.paint()}paint(){this.paintTabs(this.items());let e=this.filtered();if(!e.length){dom.content(this.list,n("div",{class:"dl-empty"},[n("p",{},this.events.length||this.system.length?_("No events match."):_("The log is empty."))]));return}let o=[],s="",r=null;for(let i of e.slice(0,this.shown)){let a=li(i.ts);a!==s&&(s=a,r=n("div",{class:"dl-panel flush"},n("div",{class:"dl-panel-head pad"},n("h3",{},a))),o.push(r));let l=new Date(i.ts*1e3).toLocaleTimeString(ie(),{hour:"2-digit",minute:"2-digit"});if(i.sys){let d=`${i.sys.ts}|${i.sys.msg}`;r.appendChild(qn(i.sys,this.open.has(d),()=>{this.open.delete(d)||this.open.add(d),this.paint()},l))}else r.appendChild(ft(this.st,i.ev,{time:l}))}e.length>this.shown&&o.push(n("div",{class:"dl-more-row"},H(m(_("Show %s more of %s"),V(Math.min(so,e.length-this.shown)),V(e.length-this.shown)),()=>{this.shown+=so,this.paint()}))),dom.content(this.list,o)}};var $d=["health","log"],Dd=t=>t==="log"?_("Log"):_("Health"),rs=2e4,io=class{constructor(){this.tab=new URLSearchParams(location.search).get("tab")==="log"?"log":"health";this.segEl=n("div",{class:"dl-seg dl-srvsections dl-diag-tabs",role:"tablist","aria-label":_("Diagnostics")});this.subEl=n("span",{class:"dl-muted"});this.actionsEl=n("div",{class:"dl-row-actions"});this.bodyEl=n("div",{});this.eventsAt=0}load(){return this.eventsAt=Date.now(),Promise.all([N.status(1),N.events(rs),N.serviceLog()])}render([e,o,s]){return this.log=new ro(e,o,s.log),this.health=new oo(e,s,o.events,()=>{this.show("log"),this.log.show("problems")}),this.show(this.tab),nt({fetch:async()=>{let r=this.tab==="log",[i,a]=await Promise.all([N.serviceLog().catch(()=>null),r?N.events(rs).catch(()=>null):Promise.resolve(null)]);return i||a?{n:i,e:a}:null},every:10,active:()=>this.bodyEl.isConnected,apply:({n:r,e:i})=>this.take(r,i)}),n("div",{},[n("div",{class:"dl-pagehead"},[n("div",{class:"dl-stack"},[n("h2",{class:"dl-h1"},_("Diagnostics")),this.subEl]),this.actionsEl]),this.segEl,this.bodyEl])}take(e,o){o&&(this.log.take(o),this.eventsAt=Date.now()),e&&(this.log.system=e.log),e&&this.health.paintLive(e,o?.events??this.health.events),this.tab==="log"&&this.log.paint()}show(e){this.tab=e,dom.content(this.segEl,$d.map(o=>n("button",{type:"button",role:"tab",class:o===e?"on":"","aria-selected":o===e?"true":"false",click:()=>o!==this.tab&&this.show(o)},Dd(o)))),this.bodyEl.replaceChildren(e==="log"?this.log.el:this.health.el),this.subEl.textContent=e==="log"?this.log.sub:_("Everything Dawnline depends on, checked live. The watchdog repairs what it can on its own."),dom.content(this.actionsEl,e==="log"?this.log.actions():""),e==="log"?(this.log.paint(),Date.now()-this.eventsAt>1e4&&N.events(rs).then(o=>this.take(null,o)).catch(()=>null)):this.health.checks||this.health.run()}};var ea=":root{--dl-card: var(--panel-bg, var(--background-color-high, transparent));--dl-elevated: var(--elevated, var(--background-color-high, Canvas));--dl-line: var(--border, var(--border-color-medium, color-mix(in srgb, currentColor 14%, transparent)));--dl-fg: var(--foreground, var(--text-color-highest, currentColor));--dl-soft: var(--muted, color-mix(in srgb, var(--dl-fg) 5%, transparent));--dl-soft-hover: var(--soft-hover, color-mix(in srgb, var(--dl-fg) 10%, transparent));--dl-fg-muted: var(--muted-foreground, color-mix(in srgb, currentColor 65%, transparent));--dl-fg-faint: var(--text-tertiary, color-mix(in srgb, currentColor 50%, transparent));--dl-accent: var(--accent, #3a83f7);--dl-ok: var(--success, #00a240);--dl-warn: var(--warning, #e25507);--dl-bad: var(--danger, #e02e2a);--dl-info: var(--info, #2c67c5);--dl-ok-wash: var(--success-a15, color-mix(in srgb, var(--dl-ok) 15%, transparent));--dl-warn-wash: var(--warning-a15, color-mix(in srgb, var(--dl-warn) 15%, transparent));--dl-bad-wash: var(--destructive-a15, color-mix(in srgb, var(--dl-bad) 15%, transparent));--dl-info-wash: var(--info-a15, color-mix(in srgb, var(--dl-info) 15%, transparent));--dl-track: var(--foreground-a10, color-mix(in srgb, var(--dl-fg) 10%, transparent));--dl-chart-1: var(--chart-blue, #3a83f7);--dl-chart-2: var(--chart-green, var(--dl-ok));--dl-ring: var(--ring, #3a83f7);--dl-primary: var(--primary, var(--dl-fg));--dl-primary-fg: var(--primary-foreground, var(--dl-elevated));--dl-mono: var(--font-mono, ui-monospace, Menlo, Consolas, monospace);--dl-shadow: var(--shadow-sm, none);--dl-radius: 16px}:root[data-darkmode=true]{--dl-card: var(--panel-bg, var(--background-color-low, transparent));--dl-elevated: var(--elevated, var(--background-color-low, Canvas));--dl-accent: var(--accent, #006efe);--dl-ok: var(--success, #40c977);--dl-warn: var(--warning, #ff8549);--dl-bad: var(--danger, #ff6764);--dl-info: var(--info, #5ba2fe);--dl-ring: var(--ring, #5ba2febc)}.dl-root,.dl-modal{cursor:default}:is(.dl-root,.dl-modal) :is(input:not([type=checkbox],[type=radio],[type=range],[type=button],[type=submit]),textarea,[contenteditable=true]){cursor:text}.dl-icon-wrap{display:inline-flex;align-items:center;justify-content:center;line-height:0}.dl-icon{width:16px;height:16px}.dl-icon-btn{display:inline-flex!important;align-items:center;gap:6px}.dl-muted{color:var(--dl-fg-muted)}.dl-faint,.dl-sep{color:var(--dl-fg-faint)}.dl-nowrap{white-space:nowrap}.dl-mono{font-family:var(--dl-mono);font-size:13px}.dl-spacer{flex:1}.dl-pill{display:inline-flex;align-items:center;gap:4px;height:20px;padding:0 8px;border-radius:999px;font-size:12px;line-height:20px;font-weight:500;white-space:nowrap;background:var(--dl-soft);color:var(--dl-fg-muted)}.dl-pill.ok{background:var(--dl-ok-wash);color:var(--dl-ok)}.dl-pill.warn{background:var(--dl-warn-wash);color:var(--dl-warn)}.dl-pill.bad{background:var(--dl-bad-wash);color:var(--dl-bad)}.dl-pill.accent{background:var(--dl-info-wash);color:var(--dl-info)}.dl-pill.off{opacity:.75}.dl-panel{background:var(--dl-card);border:1px solid var(--dl-line);border-radius:var(--dl-radius);padding:16px;margin:0 0 16px;min-width:0;box-shadow:var(--dl-shadow)}.dl-panel-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin:0 0 12px}.dl-panel-head h3{margin:0!important;padding:0;font-size:16px;line-height:24px;font-weight:500;border:0;background:none}.dl-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:0 0 16px}.dl-tile{background:var(--dl-card);border:1px solid var(--dl-line);border-radius:var(--dl-radius);padding:14px 16px;min-width:0;box-shadow:var(--dl-shadow)}.dl-tile-label{font-size:12px;line-height:16px;font-weight:500;color:var(--dl-fg-faint)}.dl-tile-value{font-size:24px;line-height:32px;font-weight:500;margin-top:4px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:-.01em}.dl-tile-sub{font-size:12px;line-height:16px;color:var(--dl-fg-muted);margin-top:2px;font-variant-numeric:tabular-nums}.dl-grid2{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:0 16px}@media(max-width:960px){.dl-grid2{grid-template-columns:minmax(0,1fr)}}.dl-chart{display:block;width:100%;height:120px}.dl-bar-down{fill:var(--dl-chart-1)}.dl-bar-up{fill:var(--dl-chart-2);opacity:.8}.dl-legend{display:flex;gap:16px;font-size:12px;color:var(--dl-fg-muted);margin-top:8px}.dl-legend i{display:inline-block;width:8px;height:8px;border-radius:999px;margin-right:6px;vertical-align:0}.dl-legend .down{background:var(--dl-chart-1)}.dl-legend .up{background:var(--dl-chart-2)}.dl-events{list-style:none;margin:0;padding:0}.dl-events li{display:flex;gap:12px;align-items:baseline;padding:8px 0;border-top:1px solid var(--dl-line);font-size:14px;line-height:20px;min-width:0}.dl-events li:first-child{border-top:0;padding-top:0}.dl-ev-time{flex:0 0 88px;color:var(--dl-fg-faint);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:13px}.dl-ev-dot{flex:0 0 auto;width:6px;height:6px;border-radius:50%;background:var(--dl-fg-faint);transform:translateY(-2px)}.dl-ev-dot.ok{background:var(--dl-ok)}.dl-ev-dot.warn{background:var(--dl-warn)}.dl-ev-dot.bad{background:var(--dl-bad)}.dl-ev-dot.accent{background:var(--dl-accent)}.dl-row>.dl-ev-dot,.dl-dev-log-row>.dl-ev-dot{margin:0 4px}.dl-ev-tile{flex:none;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;margin:-2px -4px;border-radius:7px;background:color-mix(in srgb,var(--dl-accent) 16%,transparent);color:var(--dl-accent);align-self:center}.dl-ev-tile .dl-icon-wrap{display:inline-flex}.dl-ev-tile .dl-icon{width:14px;height:14px}.dl-row.dl-ev-by-admin{background:color-mix(in srgb,var(--dl-accent) 6%,transparent)}.dl-you{color:var(--dl-accent);font-weight:500}.dl-ev-kind{color:var(--dl-fg-faint)}.dl-slotbar{display:flex;align-items:center;gap:8px;margin:8px 0 0 44px}.dl-slotbar-segs{display:flex;gap:3px;flex:none;max-width:100%}.dl-slotbar-segs i{flex:1;min-width:2px;display:block;height:4px;border-radius:2px;background:var(--dl-soft-hover)}.dl-slotbar-segs i.used{background:var(--dl-fg-muted)}.dl-slotbar-text{font-size:12px;color:var(--dl-fg-faint);font-variant-numeric:tabular-nums}.dl-slotbar-segs i.over{background:color-mix(in srgb,var(--dl-warn) 80%,transparent)}.dl-ev-srv{flex:none;font-size:11px;line-height:18px;padding:0 8px;border-radius:999px;background:var(--dl-soft);color:var(--dl-fg-muted);white-space:nowrap}.dl-ev-by-system{--sys: var(--dl-fg-muted)}.dl-ev-by-system.ok{--sys: var(--dl-ok)}.dl-ev-by-system.warn{--sys: var(--dl-warn)}.dl-ev-by-system.bad{--sys: var(--dl-bad)}.dl-ev-tile.ev{background:var(--dl-soft);color:var(--dl-fg-muted)}.dl-ev-tile.ev.ok{background:var(--dl-ok-wash);color:var(--dl-ok)}.dl-ev-tile.ev.warn{background:var(--dl-warn-wash);color:var(--dl-warn)}.dl-ev-tile.ev.bad{background:var(--dl-bad-wash);color:var(--dl-bad)}.dl-ev-tile.ev.accent{background:color-mix(in srgb,var(--dl-accent) 16%,transparent);color:var(--dl-accent)}.dl-ev-tile.sys{background:color-mix(in srgb,var(--sys) 16%,transparent);color:var(--sys)}.dl-row.dl-ev-by-system{background:color-mix(in srgb,var(--sys) 6%,transparent)}.dl-sys-src{color:var(--sys)}.dl-ev-by-system:not(.ok):not(.warn):not(.bad) .dl-sys-src{color:var(--dl-fg)}.dl-ev-text{min-width:0;overflow-wrap:anywhere}.dl-server{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px}.dl-server-name{font-size:16px;line-height:24px;font-weight:500}.dl-kv{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:6px 24px;margin:12px 0 0;font-size:14px;line-height:20px}.dl-kv dt{color:var(--dl-fg-muted);font-weight:400;margin:0}.dl-kv dd{margin:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}";var ta='.dl-plist{display:block}.dl-plist>.dl-card{display:block;margin:0 0 12px;padding:16px;min-width:0;background:var(--dl-card);border:1px solid var(--dl-line);border-radius:var(--dl-radius);box-shadow:var(--dl-shadow)}.dl-plist>.dl-card.dl-filtered{display:none}.dl-plist>.dl-card.dl-off :is(.dl-card-name,.dl-avatar,.dl-access,.dl-slotbar,.dl-chips,.dl-pill-ic,.dl-use-num,.dl-pside-foot,.dl-pside-state){opacity:.45}.dl-plist>.dl-card.dl-off .dl-usebar i{background:var(--dl-fg-faint)}.dl-plist>.dl-card.dl-off .dl-chip-tag{background:var(--dl-soft);color:var(--dl-fg-muted)}.dl-pcard:has(>.dl-pstrip){row-gap:14px}.dl-pstrip{grid-column:1 / -1;display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin:0 -16px -16px;padding:10px 16px;border-top:1px solid var(--dl-line);border-radius:0 0 var(--dl-radius) var(--dl-radius);font-size:14px;line-height:20px}.dl-pstrip.warn{background:color-mix(in srgb,var(--dl-warn) 7%,transparent)}.dl-pstrip.bad{background:color-mix(in srgb,var(--dl-bad) 7%,transparent)}.dl-pstrip-text{flex:1;min-width:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:0 8px}.dl-pstrip-text b{font-weight:500}.dl-pstrip>.cbi-button{flex:none;height:32px!important}.dl-plist-none{color:var(--dl-fg-muted);text-align:center;padding:28px 16px;background:var(--dl-card);border:1px solid var(--dl-line);border-radius:var(--dl-radius)}.dl-card-head{display:flex;align-items:center;flex-wrap:wrap;gap:6px 8px}.dl-avatar{flex:0 0 auto;width:32px;height:32px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;color:var(--dl-fg);background:var(--dl-soft);position:relative;margin-right:4px;letter-spacing:.02em}.dl-avatar.online:after{content:"";position:absolute;right:-1px;bottom:-1px;width:9px;height:9px;border-radius:50%;background:var(--dl-ok);box-shadow:0 0 0 2px var(--dl-card)}.dl-card-name{font-size:16px;line-height:24px;font-weight:500}.dl-card-slug{font-size:13px;color:var(--dl-fg-faint);font-family:var(--dl-mono)}.dl-quota{margin:8px 0 0 44px;max-width:320px;height:6px;border-radius:999px;background:var(--dl-track);overflow:hidden}.dl-quota>i{display:block;height:100%;background:var(--dl-accent);border-radius:999px}.dl-quota.warn>i{background:var(--dl-warn)}.dl-quota.bad>i{background:var(--dl-bad)}.dl-chips{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 0 44px}.dl-chip{all:unset;box-sizing:border-box;cursor:pointer;display:inline-flex;align-items:center;gap:6px;max-width:240px;height:28px;padding:0 12px 0 10px;border-radius:999px;font-size:13px;background:var(--dl-soft);color:var(--dl-fg);transition:background .15s}.dl-chip:hover{background:var(--dl-soft-hover)}.dl-chip:focus-visible{outline:2px solid var(--dl-ring);outline-offset:2px}.dl-chip .dl-icon{width:14px;height:14px;color:var(--dl-fg-muted)}.dl-chip.add{background:transparent;border:1px dashed color-mix(in srgb,var(--dl-fg) 28%,transparent);color:var(--dl-fg-muted)}.dl-chip.add:hover{background:var(--dl-soft);color:var(--dl-fg);border-color:color-mix(in srgb,var(--dl-fg) 45%,transparent)}.dl-chip.add:hover .dl-icon{color:var(--dl-fg)}.dl-chip.disabled .dl-chip-name{text-decoration:line-through;color:var(--dl-fg-faint)}.dl-chip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-dot{flex:0 0 auto;width:6px;height:6px;border-radius:50%;background:var(--dl-fg-faint);opacity:.6}.dl-dot.online{background:var(--dl-ok);opacity:1;box-shadow:0 0 0 3px var(--dl-ok-wash)}.dl-empty{text-align:center;padding:40px 16px;background:var(--dl-card);border:1px solid var(--dl-line);border-radius:var(--dl-radius)}.dl-empty .dl-icon-wrap{width:40px;height:40px;border-radius:12px;background:var(--dl-soft);margin-bottom:12px}.dl-empty .dl-icon{width:20px;height:20px}.dl-empty h3{margin:0 0 4px!important;font-size:16px;font-weight:500}.dl-empty p{margin:0 0 16px;color:var(--dl-fg-muted);font-size:14px}.dl-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 16px}.dl-toolbar .dl-muted{font-size:13px}@media(max-width:640px){.dl-slotbar,.dl-chips,.dl-quota{margin-left:0}.dl-btn-label{display:none}}.cbi-value.dl-block{display:block!important}.cbi-value.dl-block>.cbi-value-title{display:block;width:auto;float:none;text-align:left;padding:0 0 8px}.cbi-value.dl-block>.cbi-value-field{display:block;width:100%;margin:0}.dl-people-find{width:160px;min-width:0}.dl-people-find[hidden]{display:none}';var na="#modal_overlay{z-index:1100!important}.dl-dd{position:fixed;z-index:1200;min-width:200px;padding:4px;border-radius:12px;background:var(--dl-elevated);border:1px solid var(--dl-line);box-shadow:0 12px 32px #0000004d;display:flex;flex-direction:column}.dl-dd button{all:unset;cursor:pointer;display:flex;align-items:center;gap:10px;padding:7px 10px;border-radius:8px;font-size:13px;color:var(--dl-fg)}.dl-dd button .dl-icon{width:15px;height:15px;color:var(--dl-fg-muted)}.dl-dd button:hover,.dl-dd button:focus-visible{background:var(--dl-soft)}.dl-dd button.danger,.dl-dd button.danger .dl-icon{color:var(--dl-bad, #e5484d)}.dl-dd button.warn,.dl-dd button.warn .dl-icon{color:var(--dl-warn)}.dl-dd hr{border:0;border-top:1px solid var(--dl-line);margin:4px 0}.dl-chipbtn b{font-weight:500;font-size:11px;margin-left:6px;opacity:.6}.dl-setsub{margin:20px 0 8px!important;font-size:13px;font-weight:500;color:var(--dl-fg)}.dl-row-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.dl-more-row{display:flex;justify-content:center;padding:8px 0 16px}.dl-dsec-actions{display:flex;align-items:center;gap:12px}.dl-kv-act{display:inline-flex;align-items:center;gap:12px;flex-wrap:wrap}.dl-linkbtn,.dl-bento-head a,.dl-bento-foot a,.dl-panel-head a,.dl-dsec-head a,.dl-tile2-foot a{all:unset;box-sizing:border-box;cursor:pointer;display:inline-flex;align-items:center;gap:4px;height:26px;padding:0 9px;margin:-4px -6px;border-radius:8px;font-size:12px;font-weight:500;color:var(--dl-fg-muted);text-decoration:none!important;white-space:nowrap;transition:background .12s,color .12s}.dl-bento-head a,.dl-bento-foot a,.dl-panel-head a,.dl-dsec-head a,.dl-tile2-foot a{color:var(--dl-accent)}.dl-linkbtn:hover,.dl-bento-head a:hover,.dl-bento-foot a:hover,.dl-panel-head a:hover,.dl-dsec-head a:hover,.dl-tile2-foot a:hover{background:var(--dl-soft);color:var(--dl-fg);text-decoration:none!important}.dl-bento-head a:hover,.dl-bento-foot a:hover,.dl-panel-head a:hover,.dl-dsec-head a:hover,.dl-tile2-foot a:hover{background:color-mix(in srgb,var(--dl-accent) 12%,transparent);color:var(--dl-accent)}.dl-linkbtn:focus-visible,.dl-bento-head a:focus-visible,.dl-bento-foot a:focus-visible,.dl-panel-head a:focus-visible{outline:2px solid var(--dl-ring);outline-offset:1px}.dl-linkbtn.danger:hover{color:var(--dl-bad);background:var(--dl-bad-wash)}.dl-ifcards{display:flex;flex-direction:column;gap:20px;margin:24px 0}.dl-ifcard .dl-setsec-body{gap:14px}.dl-iflead{display:flex;flex-direction:column;gap:2px;padding-top:14px;border-top:1px solid var(--dl-line)}.dl-iflead b{font-size:14px;font-weight:500}.dl-ifgroup h4{margin:0 0 8px!important;padding:0!important;font-size:11px!important;font-weight:500!important;letter-spacing:.06em;text-transform:uppercase;color:var(--dl-fg-muted);border:0!important;background:none!important}.dl-ifgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:8px}.dl-if{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:10px;min-height:52px;padding:8px 12px 8px 10px;min-width:0;border:1px solid var(--dl-line);border-radius:10px;background:var(--dl-card);transition:background .15s,border-color .15s}.dl-if:hover{background:var(--dl-soft)}.dl-if:focus-visible{outline:2px solid var(--dl-ring);outline-offset:2px}.dl-if-ic{width:30px;height:30px;border-radius:8px;background:var(--dl-soft);display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--dl-fg-muted)}.dl-if-ic .dl-icon{width:16px;height:16px}.dl-if-main{display:flex;flex-direction:column;min-width:0;flex:1}.dl-if-name{font-size:13.5px;font-weight:500;color:var(--dl-fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dl-if-sub{font:11px/16px var(--dl-mono);color:var(--dl-fg-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dl-if.sel{border-color:var(--dl-accent);background:color-mix(in srgb,var(--dl-accent) 9%,transparent)}.dl-if.sel .dl-if-ic{background:color-mix(in srgb,var(--dl-accent) 18%,transparent);color:var(--dl-accent)}.dl-if-check{color:var(--dl-accent);display:inline-flex}.dl-if-check .dl-icon{width:16px;height:16px}.dl-if.auto{border-color:color-mix(in srgb,var(--dl-ok) 55%,transparent);background:var(--dl-ok-wash);cursor:default}.dl-if.auto .dl-if-ic{background:color-mix(in srgb,var(--dl-ok) 18%,transparent);color:var(--dl-ok)}.dl-if-badge{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;flex:0 0 auto}.dl-if-badge.ok{color:var(--dl-ok)}.dl-if.off{cursor:default;opacity:.5}.dl-if.off:hover{background:var(--dl-card)}.dl-if.warn{border-color:color-mix(in srgb,var(--dl-warn) 60%,transparent)}.dl-if-wanctl{gap:10px;align-items:center}.dl-if-wanctl select{max-width:240px}.dl-if-summary{min-width:0;line-height:18px}.dl-warn{color:var(--dl-warn)}.dl-w-ip{width:160px}.dl-dnspick{padding-top:8px;border-top:1px solid var(--dl-line)}.dl-dnspick .dl-row-actions{gap:10px}.cbi-dropdown>ul:not(.dropdown) .dl-opt-note{display:none}.dl-note{display:flex;gap:8px;align-items:flex-start;padding:10px 12px;border-radius:10px;font-size:12.5px;line-height:18px;margin:0 0 10px;background:var(--dl-soft)}.dl-note.warn{background:var(--dl-warn-wash, color-mix(in srgb, var(--dl-warn) 14%, transparent))}.dl-note .dl-icon{width:15px;height:15px;flex:0 0 auto;margin-top:1px;color:var(--dl-warn)}.dl-stale{align-self:flex-start;margin-top:4px;font-size:10.5px}.dl-root .cbi-button.dl-btn-warn,.dl-btn-warn.cbi-button{background:var(--dl-warn-wash)!important;color:var(--dl-warn)!important;border-color:color-mix(in srgb,var(--dl-warn) 35%,transparent)!important}.dl-root .cbi-button.dl-btn-warn:hover,.dl-btn-warn.cbi-button:hover{background:color-mix(in srgb,var(--dl-warn) 24%,transparent)!important}.dl-btn-warn .dl-icon{color:var(--dl-warn)}.dl-srvtabs{display:flex;flex-wrap:wrap;gap:6px;padding:4px;margin:0 0 20px;border-radius:12px;background:var(--dl-soft);width:fit-content;max-width:100%}.dl-srvtab{all:unset;box-sizing:border-box;cursor:pointer;display:inline-flex;align-items:center;gap:8px;height:34px;padding:0 14px;border-radius:9px;font-size:13px;color:var(--dl-fg-muted);text-decoration:none!important;white-space:nowrap}.dl-srvtab b{font-weight:500}.dl-srvtab i.dot{width:7px;height:7px;border-radius:50%;background:var(--dl-fg-faint);flex:0 0 auto}.dl-srvtab i.dot.ok{background:var(--dl-ok);animation:dl-srv-pulse 2s ease-out infinite}.dl-srvtab i.dot.bad{background:var(--dl-bad)}.dl-srvtab i.dot.warn{background:var(--dl-warn)}@keyframes dl-srv-pulse{0%{box-shadow:0 0 color-mix(in srgb,var(--dl-ok) 55%,transparent)}70%,to{box-shadow:0 0 0 6px transparent}}@media(prefers-reduced-motion:reduce){.dl-srvtab i.dot.ok{animation:none}}.dl-srvtab:hover{color:var(--dl-fg);background:var(--dl-soft-hover)}.dl-srvtab.on{background:var(--dl-card);color:var(--dl-fg);box-shadow:0 1px 2px #0000002e,inset 0 0 0 1px var(--dl-line)}.dl-srvtab:focus-visible{outline:2px solid var(--dl-ring);outline-offset:1px}.dl-srvtab.add{color:var(--dl-fg-muted)}.dl-srvtab.add .dl-icon{width:14px;height:14px}.dl-srvhead{display:flex;flex-direction:column;gap:14px;margin:0 0 20px}.dl-srvhead .dl-title-row{display:flex;align-items:center;gap:10px}.dl-srvhead .dl-h1{margin:0!important}.dl-metrics.compact .dl-metric{padding:14px 18px}.dl-metrics.compact .dl-metric-value{display:flex;align-items:center;gap:6px;font-size:18px;line-height:26px;min-width:0}.dl-metrics.compact .dl-metric-value>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.dl-metrics.compact .dl-metric-value .dl-mono{font-size:15px}.dl-metrics.compact .cbi-button{flex:0 0 auto}.dl-srvsections{margin:0 0 16px}.dl-srvbody>.dl-setsec,.dl-srvbody>.dl-ifcards{margin:0}.dl-srvbody .dl-ifcards{margin:0}.dl-metric-ic{display:inline-flex;align-items:center;gap:8px;font-size:16px}.dl-metric-ic .dl-icon{width:18px;height:18px;color:var(--dl-accent)}.dl-keyrow{display:inline-flex;align-items:center;gap:8px;min-width:0}.dl-keyrow code{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;background:none;padding:0}.dl-params{border:1px solid var(--dl-line);border-radius:12px;background:var(--dl-card)}.dl-params>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;padding:10px 14px;font-size:13px;color:var(--dl-fg);user-select:none}.dl-params>summary::-webkit-details-marker{display:none}.dl-params>summary>.dl-icon-wrap{display:inline-flex;color:var(--dl-fg-muted);transition:transform .15s}.dl-params>summary>.dl-icon-wrap .dl-icon{width:15px;height:15px}.dl-params[open]>summary>.dl-icon-wrap{transform:rotate(90deg)}.dl-params>summary:focus{outline:none}.dl-params>summary:focus-visible{outline:2px solid var(--dl-ring);outline-offset:-2px;border-radius:12px}.dl-params>summary:hover{background:var(--dl-soft);border-radius:12px}.dl-pcount{font-size:11px;padding:0 6px;border-radius:999px;background:var(--dl-soft);color:var(--dl-fg-muted)}.dl-pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px;padding:4px 14px 14px}.dl-pgroup{display:flex;flex-direction:column;gap:6px;padding:12px;border-radius:10px;background:var(--dl-soft);min-width:0}.dl-pgroup-head{display:flex;align-items:center;gap:8px;font-size:13px}.dl-pgroup-head b{font-weight:500}.dl-pgroup-head .dl-icon{width:14px;height:14px;color:var(--dl-fg-muted)}.dl-pgroup p{margin:0!important;font-size:12px;line-height:17px;color:var(--dl-fg-muted)}.dl-pvals{display:flex;flex-wrap:wrap;gap:4px;margin-top:2px}.dl-pv{display:inline-flex;align-items:stretch;max-width:100%;border-radius:6px;overflow:hidden;font:500 11.5px/22px var(--dl-mono);box-shadow:inset 0 0 0 1px var(--dl-line)}.dl-pv i{font-style:normal;padding:0 6px;background:var(--dl-card);color:var(--dl-fg-faint)}.dl-pv b{font-weight:500;padding:0 7px;color:var(--dl-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}";var oa=".dl-methods{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px}.dl-method{all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;gap:10px;padding:14px;border-radius:12px;border:1px solid var(--dl-line);background:var(--dl-card);transition:border-color .15s,background .15s;min-width:0}.dl-method:hover{background:var(--dl-soft)}.dl-method:focus-visible{outline:2px solid var(--dl-ring);outline-offset:2px}.dl-method.on{border-color:var(--dl-accent);background:color-mix(in srgb,var(--dl-accent) 8%,transparent);box-shadow:inset 0 0 0 1px var(--dl-accent)}.dl-method.off{cursor:not-allowed;opacity:.55}.dl-method.off:hover{background:var(--dl-card)}.dl-method-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px}.dl-method-head .dl-pill{flex:none}.dl-method-head b{font-weight:500;font-size:14.5px;flex:1}.dl-method-ic{width:32px;height:32px;border-radius:9px;background:var(--dl-soft);display:inline-flex;align-items:center;justify-content:center;color:var(--dl-fg-muted);flex:0 0 auto}.dl-method-ic .dl-icon{width:17px;height:17px}.dl-method.on .dl-method-ic{background:color-mix(in srgb,var(--dl-accent) 18%,transparent);color:var(--dl-accent)}.dl-method p{margin:0!important;font-size:12.5px;line-height:18px;color:var(--dl-fg-muted);flex:1}.dl-method-meters{display:flex;gap:16px}.dl-dots{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--dl-fg-faint)}.dl-dots-row{display:inline-flex;gap:3px}.dl-dots-row i{width:6px;height:6px;border-radius:50%;background:var(--dl-line)}.dl-dots-row i.on{background:var(--dl-fg-muted)}.dl-method.on .dl-dots-row i.on{background:var(--dl-accent)}.dl-method-foot{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--dl-fg-faint);padding-top:8px;border-top:1px solid var(--dl-line)}.dl-method-foot .dl-icon{width:13px;height:13px;flex:0 0 auto}.dl-method.off .dl-method-foot{color:var(--dl-warn)}.dl-ibadge{display:inline-flex;align-items:center;gap:3px;height:22px;padding:0 6px;border-radius:999px;background:var(--dl-soft);color:var(--dl-fg-muted);flex:0 0 auto}.dl-ibadge .dl-icon{width:13px;height:13px}.dl-ibadge.warn{background:var(--dl-warn-wash);color:var(--dl-warn)}.dl-ibadge.bad{background:var(--dl-bad-wash);color:var(--dl-bad)}.dl-access{display:inline-flex;gap:4px;flex:0 0 auto}.dl-ibadge.lan{background:color-mix(in srgb,var(--dl-accent) 16%,transparent);color:var(--dl-accent)}.dl-ibadge.inet{background:var(--dl-ok-wash);color:var(--dl-ok)}";var sa=".dl-addrbar{display:inline-flex;align-items:stretch;flex-wrap:nowrap;max-width:100%;margin-top:4px;border:1px solid var(--dl-line);border-radius:10px;background:var(--dl-card);overflow:hidden}.dl-addrbar-seg{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:7px;padding:6px 12px;font-size:13px;color:var(--dl-fg-muted);border-left:1px solid var(--dl-line);white-space:nowrap;min-width:0}.dl-addrbar-seg:first-child{border-left:0}.dl-addrbar-seg .dl-icon{width:14px;height:14px;color:var(--dl-fg-faint);flex:0 0 auto}.dl-addrbar-seg .dl-mono{font-size:12.5px}.dl-addrbar-seg.main{cursor:pointer;color:var(--dl-fg)}.dl-addrbar-seg.main:hover{background:var(--dl-soft)}.dl-addrbar-seg.main:focus-visible{outline:2px solid var(--dl-ring);outline-offset:-2px}.dl-addrbar-seg.main>.dl-icon-wrap:last-child .dl-icon{opacity:.7}.dl-bento{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:auto auto;gap:10px;margin:0 0 20px}.dl-person-devices{margin-bottom:16px}.dl-person-head{display:flex;flex-direction:column;margin:0 0 20px}.dl-person-head>.dl-pagehead{margin-bottom:0;align-items:flex-start}.dl-pnote{all:unset;box-sizing:border-box;cursor:pointer;align-self:flex-start;display:inline-flex;align-items:flex-start;gap:6px;margin:10px 0 0 62px;max-width:60ch;padding:6px 12px 6px 10px;border-radius:10px;font-size:13px;line-height:18px;white-space:pre-line;background:var(--dl-soft);color:var(--dl-fg);box-shadow:inset 0 0 0 1px var(--dl-line)}.dl-pnote:hover{background:var(--dl-soft-hover)}.dl-pnote .dl-icon{width:14px;height:14px;flex:none;margin-top:2px;color:var(--dl-fg-muted)}.dl-note-input{width:100%;box-sizing:border-box;min-height:80px;resize:vertical}.dl-dcard-trend{display:flex;align-items:flex-end;gap:12px;min-width:0}.dl-dcard-trend>.dl-stack{flex:none}.dl-dcard-trend b{font-size:16px;font-weight:500;font-variant-numeric:tabular-nums}.dl-dbars{flex:1;min-width:0;height:32px;display:flex;align-items:flex-end;--dl-gap: 2px}.dl-dbars i{flex:1;min-width:0;border-radius:2px;background:var(--dl-chart-1);opacity:.55}.dl-dbars i.zero{background:var(--dl-track);opacity:1}.dl-dbars i.hi{opacity:1}.dl-dbars>span:hover i{opacity:1;filter:brightness(1.2)}.dl-datechip{position:relative;display:inline-flex}.dl-date-hidden{position:absolute!important;left:0;bottom:0;width:1px!important;min-width:0!important;height:1px!important;opacity:0;pointer-events:none;border:0!important;padding:0!important;margin:0!important}.dl-chipbtn .dl-icon{width:13px;height:13px}.dl-chipbtn:has(.dl-icon){display:inline-flex;align-items:center;gap:5px}.dl-places{display:flex;align-items:center;gap:12px;padding:12px 16px;border:1px solid var(--dl-line);border-radius:var(--dl-radius);background:var(--dl-card);font-size:14px}.dl-places>.dl-icon{width:18px;height:18px;color:var(--dl-fg-muted);flex:none}.dl-person-live{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}.dl-person-live .dl-bento-head{flex-wrap:nowrap;white-space:nowrap;min-width:0}.dl-person-live .dl-bento-head>*{min-width:0;overflow:hidden;text-overflow:ellipsis}.dl-person-live .dl-bento-head>:first-child{flex:none}.dl-person-live.solo{grid-template-columns:minmax(0,1fr)}.dl-person-live:not(.solo) .dl-bento-tile.month>.dl-bento-head:first-child{flex-wrap:wrap;row-gap:2px}.dl-person-live:not(.solo) .dl-bento-tile.month>.dl-bento-head:first-child>.dl-sub{flex-basis:100%}.dl-person-live>.dl-bento-tile,.dl-person-live>.dl-bento-tile.month{grid-column:auto;grid-row:auto}@media(max-width:760px){.dl-person-live{grid-template-columns:minmax(0,1fr)}}.dl-bento-tile{background:var(--dl-card);border:1px solid var(--dl-line);border-radius:var(--dl-radius);padding:14px 16px;display:flex;flex-direction:column;gap:10px;min-width:0;box-shadow:var(--dl-shadow)}.dl-bento-tile.month{grid-column:1 / -1}.dl-onl-count{font-size:13px;line-height:22px;min-width:22px;padding:0 8px;border-radius:999px;background:var(--dl-soft);text-align:center;font-weight:500;font-variant-numeric:tabular-nums}.dl-onl-count.none{color:var(--dl-fg-faint)}.dl-onl-row{flex:1;display:flex;align-items:center;justify-content:center;gap:12px;min-width:0}.dl-onl-p{display:flex;flex-direction:column;align-items:center;gap:5px;width:104px;min-width:0;padding:6px 2px;border-radius:12px;color:var(--dl-fg)!important;text-decoration:none!important}.dl-onl-p:hover{background:var(--dl-soft)}.dl-onl-av{position:relative;width:42px;height:42px;border-radius:50%;background:var(--dl-soft);display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:500;box-shadow:0 0 0 2px var(--dl-ok)}.dl-onl-p.more .dl-onl-av{box-shadow:0 0 0 1px var(--dl-line);color:var(--dl-fg-muted)}.dl-onl-dev{position:absolute;right:-6.5px;bottom:-6.5px;width:20px;height:20px;border-radius:8.5px;border:1.5px solid transparent;background:var(--dl-card);display:inline-flex;align-items:center;justify-content:center;font-size:10px;color:var(--dl-fg-muted)}.dl-onl-dev .dl-icon-wrap{display:inline-flex}.dl-onl-dev .dl-icon{width:12px;height:12px}.dl-onl-name{font-size:12.5px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-onl-p .dl-sub{font-size:11px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-onl-row.grid{flex-wrap:wrap;align-content:center;gap:10px 8px;max-height:108px;overflow:hidden}.dl-onl-p.sm{width:auto;padding:4px}.dl-onl-p:hover .dl-onl-dev{background:linear-gradient(var(--dl-soft),var(--dl-soft)),var(--dl-card)}.dl-onl-p.sm:hover{background:none}.dl-onl-p.sm:hover .dl-onl-dev{background:var(--dl-card)}.dl-onl-p.sm .dl-onl-av{transition:box-shadow .15s ease}.dl-onl-p.sm:hover .dl-onl-av{box-shadow:0 0 0 2px var(--dl-ok),0 0 0 6px var(--dl-soft)}.dl-onl-p.sm.more:hover .dl-onl-av{box-shadow:0 0 0 1px var(--dl-line),0 0 0 6px var(--dl-soft)}.dl-onl-p.sm .dl-onl-av{width:36px;height:36px;font-size:11.5px}.dl-onl-meta{display:inline-flex;align-items:center;gap:3px;font-size:11px;color:var(--dl-fg-faint);max-width:100%;white-space:nowrap;overflow:hidden}.dl-onl-meta .dl-icon-wrap{display:inline-flex}.dl-onl-meta .dl-icon{width:12px;height:12px}.dl-onl-av.sm{width:34px;height:34px;font-size:11.5px}.dl-tip-float:has(.dl-hc){padding:0;white-space:normal;border-radius:16px}.dl-hc{width:280px;padding:14px;display:flex;flex-direction:column;gap:10px}.dl-hc-head{display:flex;align-items:center;gap:10px}.dl-hc-head .dl-stack{flex:1;min-width:0}.dl-hc-head b{font-size:14px;font-weight:500}.dl-hc-since{font-size:11.5px;color:var(--dl-ok)}.dl-hc-reach{display:inline-flex;gap:4px}.dl-hc-speed{border-radius:12px;background:var(--dl-soft);padding:10px 12px;display:flex;flex-direction:column;gap:6px}.dl-hc-speed-row{display:flex;align-items:baseline;gap:12px;font-size:13px;font-variant-numeric:tabular-nums}.dl-hc-chart{display:block;width:100%;height:30px}.dl-hc-chart .area{fill:color-mix(in srgb,var(--dl-chart-1) 16%,transparent)}.dl-hc-chart .dn{fill:none;stroke:var(--dl-chart-1);stroke-width:1.5;vector-effect:non-scaling-stroke}.dl-hc-chart .up{fill:none;stroke:var(--dl-ok);stroke-width:1.2;vector-effect:non-scaling-stroke}.dl-hc-devs{display:flex;flex-wrap:wrap;gap:6px}.dl-hc-dev{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 9px;border-radius:999px;background:var(--dl-soft);font-size:11.5px}.dl-hc-dev .dl-icon-wrap{display:inline-flex}.dl-hc-dev .dl-icon{width:12px;height:12px;color:var(--dl-fg-muted)}.dl-hc-foot{display:flex;align-items:center;gap:8px;font-size:11.5px}.dl-disg-id{display:flex;align-items:center;gap:10px}.dl-disg-id b{font-size:16px;font-weight:500}.dl-disg-ic{width:36px;height:36px;border-radius:11px;background:color-mix(in srgb,var(--dl-accent) 14%,transparent);color:var(--dl-accent);display:inline-flex;align-items:center;justify-content:center;flex:none}.dl-disg-ic .dl-icon-wrap{display:inline-flex}.dl-disg-ic .dl-icon{width:18px;height:18px}.dl-disg-ic.off{background:var(--dl-soft);color:var(--dl-fg-muted)}.dl-disg-meters{display:grid;grid-template-columns:auto 1fr;gap:6px 10px;align-items:center;font-size:12px;color:var(--dl-fg-muted)}.dl-segs{display:inline-flex;gap:3px}.dl-segs i{width:18px;height:5px;border-radius:3px;background:var(--dl-track)}.dl-segs.acc i.on{background:var(--dl-accent)}.dl-segs.ok i.on{background:var(--dl-ok)}.dl-disg-chips{margin-top:auto;display:flex;flex-wrap:wrap;gap:5px}.dl-disg-chips span{font:11px/20px var(--dl-mono);padding:0 8px;border-radius:999px;background:var(--dl-soft);color:var(--dl-fg-muted);white-space:nowrap}.dl-onl-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:13px;text-align:center}.dl-bento-head{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}.dl-bento-head.start{justify-content:flex-start}.dl-bento-big{font-family:inherit;font-size:28px;line-height:34px;font-weight:500;letter-spacing:-.01em;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dl-bento-big small{font-size:13px;font-weight:400;color:var(--dl-fg-faint);letter-spacing:0}.dl-avstack{display:inline-flex}.dl-avstack .dl-avatar{margin-left:-7px;box-shadow:0 0 0 2px var(--dl-card)}.dl-avstack .dl-avatar:first-child{margin-left:0}.dl-avatar.more{background:var(--dl-soft);color:var(--dl-fg-muted)}.dl-bento-list{display:flex;flex-direction:column;gap:2px}.dl-bento-row{display:flex;align-items:center;gap:10px;padding:8px;margin:0 -8px;border-radius:10px;color:var(--dl-fg)!important;text-decoration:none!important;min-width:0;transition:background .12s}.dl-bento-row:hover{background:var(--dl-soft)}.dl-bento-row:hover b{text-decoration:none}.dl-bento-row:focus-visible{outline:2px solid var(--dl-ring);outline-offset:-2px}.dl-bento-row-main{display:flex;flex-direction:column;gap:1px;flex:1;min-width:0}.dl-bento-row-main b{font-weight:500;font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-bento-row-main .dl-sub{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-bento-row.off b{color:var(--dl-fg-muted);font-weight:400}.dl-bento-row-val{display:flex;flex-direction:column;align-items:flex-end;font-size:13px;font-variant-numeric:tabular-nums;white-space:nowrap}.dl-bento-row-val small{font-size:11px;color:var(--dl-fg-faint)}.dl-bento-sep{font-size:11px;color:var(--dl-fg-faint);padding:12px 0 4px}.dl-bento-devs{display:inline-flex;gap:3px;color:var(--dl-fg-faint)}.dl-bento-devs .dl-icon{width:13px;height:13px}.dl-bento-devs .on{color:var(--dl-ok)}.dl-bento-foot{display:flex;align-items:center;gap:10px;margin-top:auto;padding-top:10px;border-top:1px solid var(--dl-line);color:var(--dl-fg)!important;text-decoration:none!important}.dl-bento-foot.split,.dl-bento-foot.end{justify-content:space-between}.dl-bento-foot.end>a:only-child{margin-left:auto}.dl-bento-empty{display:flex;align-items:center;gap:10px;padding:14px 0;font-size:13.5px;color:var(--dl-fg-muted)}.dl-bento-empty .dl-icon{width:18px;height:18px}.dl-split{display:flex;height:6px;border-radius:3px;overflow:hidden;background:var(--dl-soft)}.dl-split i{display:block;height:100%}.dl-split i.dn{background:var(--dl-accent)}.dl-split i.up{background:var(--dl-ok)}.dl-dn{color:var(--dl-accent)}.dl-up{color:var(--dl-ok)}.dl-bento-method{display:flex;align-items:center;gap:8px;font-size:18px;font-weight:500}.dl-bento-method .dl-icon{width:20px;height:20px;color:var(--dl-accent)}.dl-meter{display:inline-flex;gap:3px}.dl-meter i{width:16px;height:4px;border-radius:2px;background:var(--dl-line)}.dl-meter i.on{background:var(--dl-accent)}.dl-bento-total{font-size:16px;font-weight:500;margin-left:8px}.dl-bento-bars{display:flex;align-items:flex-end;height:54px;--dl-gap: 3px}.dl-bento-bars i{flex:1;min-width:0;border-radius:3px 3px 0 0;background:var(--dl-soft-hover);transition:background .15s}.dl-bento-bars i.future{height:4px;background:var(--dl-soft)}.dl-bento-bars>span:hover i:not(.hi){background:var(--dl-fg-faint)}.dl-bento-bars i.hi{background:var(--dl-accent)}@media(max-width:700px){.dl-addrbar{flex-wrap:wrap}}@media(max-width:900px){.dl-bento{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.dl-bento-tile.online{grid-column:span 2}}@media(max-width:560px){.dl-bento{grid-template-columns:minmax(0,1fr)}.dl-bento-tile.online,.dl-bento-tile.month{grid-column:auto}}.dl-srvpagehead{display:flex;flex-direction:column;align-items:flex-start;gap:10px;margin:0 0 20px}.dl-srvpagehead>.dl-title-row{display:flex;align-items:center;gap:10px;width:100%;flex-wrap:wrap}.dl-srvpagehead .dl-actions{margin:0;flex-wrap:wrap}.dl-toolbar-end{display:flex;align-items:center;gap:8px;margin-left:auto;flex-wrap:nowrap;min-width:0}@media(max-width:640px){.dl-toolbar-end{flex-wrap:wrap;width:100%}}.dl-notices{margin:0 0 16px}.dl-notices .dl-need-row .dl-sub{overflow-wrap:anywhere}.dl-notices-more{font-size:13px;color:var(--dl-fg-muted);text-decoration:none}.dl-notices-more:hover{background:var(--dl-soft);color:var(--dl-fg)}.dl-speed-cols{display:grid;grid-template-columns:1fr 1fr;gap:12px}.dl-speed-col{display:flex;flex-direction:column;gap:2px;min-width:0}.dl-speed-val{font-size:20px;line-height:26px;font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dl-speed-today{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:var(--dl-fg-muted);white-space:nowrap;font-variant-numeric:tabular-nums}.dl-speed-today b{font-weight:500;color:var(--dl-fg)}.dl-speed-chart{display:block;width:100%;height:44px}.dl-speed-chart .area{fill:color-mix(in srgb,var(--dl-accent) 16%,transparent)}.dl-speed-chart .line{fill:none;stroke:var(--dl-accent);stroke-width:1.5;vector-effect:non-scaling-stroke}.dl-speed-chart .line.up{stroke:var(--dl-ok);stroke-width:1.2;opacity:.85}.dl-speed-wait{height:44px;display:flex;flex-direction:column;justify-content:flex-end;gap:6px;font-size:11px;color:var(--dl-fg-faint)}.dl-speed-wait i{display:block;height:1px;background:var(--dl-line);order:2}.dl-speed-val.off{color:var(--dl-fg-faint)}.dl-fld{display:flex;flex-direction:column;gap:8px;margin:0 0 16px}.dl-fld-label{font-size:13px;font-weight:500;color:var(--dl-fg)}.dl-fld .cbi-input-text{width:100%;box-sizing:border-box}.dl-kinds{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.dl-kinds button{all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:68px;border-radius:10px;border:1px solid var(--dl-line);color:var(--dl-fg-muted);font-size:12px;font-weight:500;text-align:center;min-width:0}.dl-kinds button .dl-icon{width:20px;height:20px}.dl-kinds button:hover{background:var(--dl-soft);color:var(--dl-fg)}.dl-kinds button:focus-visible{outline:2px solid var(--dl-ring);outline-offset:2px}.dl-kinds button.on{border-color:var(--dl-accent);color:var(--dl-fg);background:color-mix(in srgb,var(--dl-accent) 10%,transparent);box-shadow:inset 0 0 0 1px var(--dl-accent)}.dl-kinds button.on .dl-icon{color:var(--dl-accent)}.dl-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px}.dl-choice{all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;gap:4px;padding:12px 14px;border-radius:12px;background:var(--dl-card);box-shadow:inset 0 0 0 1px var(--dl-line);transition:background .15s,box-shadow .15s}.dl-choice:hover{background:var(--dl-soft)}.dl-choice:focus-visible{outline:2px solid var(--dl-ring);outline-offset:2px}.dl-choice.selected{box-shadow:inset 0 0 0 2px var(--dl-accent);background:var(--accent-a10, color-mix(in srgb, var(--dl-accent) 8%, transparent))}.dl-choice-title{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:500;color:var(--dl-fg)}.dl-choice-text{font-size:12px;line-height:16px;color:var(--dl-fg-muted)}.dl-attn-item>.cbi-button{margin-left:auto;flex:none;align-self:center}";var ra='.dl-steps{display:flex;align-items:center;gap:8px;margin:0 0 16px;flex-wrap:wrap}.dl-step{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:500;color:var(--dl-fg-faint)}.dl-step b{display:inline-flex;width:24px;height:24px;align-items:center;justify-content:center;border-radius:50%;background:var(--dl-soft);font-size:12px;font-weight:600}.dl-step.current{color:var(--dl-fg)}.dl-step.current b{background:var(--dl-primary);color:var(--dl-primary-fg)}.dl-step.done{color:var(--dl-fg-muted)}.dl-step.done b{background:var(--dl-ok-wash);color:var(--dl-ok)}.dl-step+.dl-step:before{content:"";width:24px;height:1px;background:var(--dl-line)}.dl-wizard .dl-panel>div{display:flex;flex-direction:column;gap:16px}.dl-wizard .dl-panel>div>p{margin:0!important;color:var(--dl-fg-muted)}.dl-wizard .dl-panel>div>.cbi-value{margin:0}.dl-wizard h4{font-size:14px;font-weight:500;margin:8px 0 -6px!important}.dl-wizard h4:first-child{margin-top:0!important}.dl-modal .cbi-tabmenu{margin-bottom:16px}.dl-modal .cbi-value.dl-live>.cbi-value-title{display:flex;flex-direction:column;gap:2px;text-align:left}.dl-modal .cbi-value.dl-live>.cbi-value-title>.dl-sub{white-space:normal}.dl-checklist{display:flex;flex-direction:column;gap:6px;margin:4px 0 8px}.dl-checklist label{display:flex;align-items:center;gap:8px;font-size:14px;cursor:pointer}.dl-checklist input{margin:0}.dl-invite{display:grid;grid-template-columns:250px minmax(0,1fr);gap:22px;align-items:start}.dl-invite img{display:block;width:100%;border-radius:18px;box-shadow:0 0 0 1px var(--dl-line)}.dl-invite-side{display:flex;flex-direction:column;gap:14px;min-width:0}.dl-invite-side>p{margin:0!important}.dl-invite-link{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:10px;min-width:0;padding:11px 14px;border-radius:12px;background:var(--dl-soft);font:13px/18px var(--dl-mono);color:var(--dl-fg)}.dl-invite-link>span:first-child{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-invite-link>.dl-icon-wrap{flex:none;display:inline-flex}.dl-invite-link .dl-icon{width:15px;height:15px;color:var(--dl-fg-muted);flex:none}.dl-invite-link:hover{background:var(--dl-soft-hover)}.dl-invite-link.alt{padding:8px 14px;font-size:12px;color:var(--dl-fg-muted)}.dl-invite-link>.dl-pill{flex:none}.dl-invite-steps{margin:0;padding-left:20px;list-style:decimal!important;font-size:13px;line-height:24px;color:var(--dl-fg-muted)}.dl-invite-steps b{color:var(--dl-fg);font-weight:500}.dl-invite-steps li{display:list-item!important;list-style:inherit!important;padding-left:4px}.dl-invite-actions{display:flex;gap:8px;flex-wrap:wrap}.modal:has(.dl-modal.wide){max-width:min(760px,94vw)!important;width:100%!important}@media(max-width:640px){.dl-invite{grid-template-columns:minmax(0,1fr)}.dl-invite img{max-width:260px;margin:0 auto}}.dl-toasts{position:fixed;left:50%;bottom:max(24px,env(safe-area-inset-bottom));transform:translate(-50%);z-index:100000;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}.dl-toast{pointer-events:auto;display:inline-flex;align-items:center;gap:8px;max-width:min(520px,92vw);padding:10px 16px;border-radius:999px;background:var(--dl-fg);color:var(--dl-card);font-size:13px;line-height:18px;box-shadow:0 10px 30px #0000004d;opacity:0;transform:translateY(12px);transition:opacity .18s,transform .18s}.dl-toast.show{opacity:1;transform:none}.dl-toast .dl-icon-wrap{display:inline-flex}.dl-toast .dl-icon{width:15px;height:15px}.dl-toast.success .dl-icon{color:var(--dl-ok)}.dl-toast.error{background:var(--dl-bad);color:#fff}.dl-toast.error .dl-icon{color:#fff}.dl-toast.warning{background:var(--dl-warn);color:#111}.dl-toast.warning .dl-icon{color:#111}.dl-toast button{all:unset;cursor:pointer;display:inline-flex;margin-left:4px;opacity:.8}.dl-toast button:hover{opacity:1}';var ia=".dl-setblock{display:flex;flex-direction:column;gap:8px;margin:0}.dl-addr-opts{display:flex;flex-direction:column;gap:6px}.dl-addr-opt{all:unset;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:16px minmax(0,1fr) auto;gap:12px;align-items:center;padding:10px 14px;border-radius:12px;box-shadow:inset 0 0 0 1px var(--dl-line);min-width:0}.dl-addr-opt:hover{background:var(--dl-soft)}.dl-addr-opt.on{box-shadow:inset 0 0 0 1.5px var(--dl-accent);background:color-mix(in srgb,var(--dl-accent) 7%,transparent)}.dl-addr-opt .dl-mono{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-addr-opt .dl-stack{min-width:0}.dl-addr-opt input{width:100%}.dl-addr-opt.other{cursor:default}.dl-addr-opt.other:hover{background:none}.dl-addr-opt.other input{width:100%}.dl-addr-check{width:16px;height:16px;border-radius:5px;box-shadow:inset 0 0 0 1.5px var(--dl-fg-faint);display:inline-flex;align-items:center;justify-content:center}.dl-addr-check .dl-icon-wrap{display:inline-flex}.dl-addr-check .dl-icon{width:12px;height:12px}.dl-addr-opt.on .dl-addr-check{background:var(--dl-accent);box-shadow:none;color:#fff}.dl-addr-opt.other .dl-addr-check{box-shadow:none;color:var(--dl-fg-muted)}.dl-addr-warn{display:inline-flex;align-items:center;gap:5px;font-size:12px;line-height:17px;color:var(--dl-warn)}.dl-addr-warn .dl-icon-wrap{display:inline-flex}.dl-addr-warn .dl-icon{width:13px;height:13px}.dl-pill.info{background:color-mix(in srgb,var(--dl-accent) 14%,transparent);color:var(--dl-accent)}.dl-links{border-radius:12px;background:var(--dl-soft);overflow:hidden}.dl-link-row{display:grid;grid-template-columns:18px minmax(0,1fr) auto;gap:10px;align-items:center;padding:11px 14px}.dl-link-row+.dl-link-row{border-top:1px solid var(--dl-line)}.dl-link-ic{display:inline-flex}.dl-link-ic .dl-icon{width:15px;height:15px}.dl-link-ic.ok .dl-icon{color:var(--dl-ok)}.dl-link-ic.warn .dl-icon{color:var(--dl-warn)}.dl-link-url{font-size:13px;color:var(--dl-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-link-url b{font-weight:500;color:var(--dl-accent)}@media(max-width:640px){.dl-link-url,.dl-addr-opt .dl-mono,.dl-filecard .dl-ellipsis,.dl-invite-link>span:first-child{white-space:normal;overflow-wrap:anywhere}}.dl-ready-sum{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:12px}.dl-ready-sum>.dl-icon-wrap{display:inline-flex}.dl-ready-sum>.dl-icon-wrap .dl-icon{width:18px;height:18px}.dl-ready-sum .dl-stack{flex:1;min-width:0}.dl-ready-sum b{font-weight:500;font-size:13px}.dl-ready-sum.ok{background:var(--dl-ok-wash)}.dl-ready-sum.ok b,.dl-ready-sum.ok .dl-icon{color:var(--dl-ok)}.dl-ready-sum.warn{background:var(--dl-warn-wash)}.dl-ready-sum.warn b,.dl-ready-sum.warn .dl-icon{color:var(--dl-warn)}.dl-ready-sum.error{background:var(--dl-bad-wash)}.dl-ready-sum.error b,.dl-ready-sum.error .dl-icon{color:var(--dl-bad)}.dl-check-chip{display:inline-flex;align-items:center;gap:5px;height:26px;padding:0 10px;border-radius:999px;background:var(--dl-soft);font-size:12px;color:var(--dl-fg-muted)}.dl-check-chip .dl-icon-wrap{display:inline-flex}.dl-check-chip .dl-icon{width:13px;height:13px;color:var(--dl-ok)}.dl-check-chip.warn{background:var(--dl-warn-wash);color:var(--dl-warn)}.dl-check-chip.warn .dl-icon{color:var(--dl-warn)}.dl-check-chip.error{background:var(--dl-bad-wash);color:var(--dl-bad)}.dl-check-chip.error .dl-icon{color:var(--dl-bad)}.dl-ready-details{display:flex;flex-direction:column;gap:8px;padding:4px 2px}.dl-ready-details[hidden]{display:none}.dl-ready-item{display:flex;align-items:flex-start;gap:8px;font-size:13px;line-height:18px;min-width:0}.dl-ready-item .dl-icon-wrap{display:inline-flex;margin-top:1px}.dl-ready-item .dl-icon{width:15px;height:15px}.dl-ready-item.ok .dl-icon{color:var(--dl-ok)}.dl-ready-item.warn .dl-icon{color:var(--dl-warn)}.dl-ready-item.error .dl-icon{color:var(--dl-bad)}.dl-params-body{display:flex;flex-direction:column;gap:14px;padding:6px 14px 14px}.dl-params-body>.dl-setrow{margin:0;padding:0}.dl-pgrid.flush{padding:0;grid-template-columns:repeat(2,minmax(0,1fr))}@media(max-width:640px){.dl-pgrid.flush{grid-template-columns:minmax(0,1fr)}}.dl-qr-pane{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}.dl-qr{width:min(280px,72vw);aspect-ratio:1;background:#0a0a0a;border-radius:18px;overflow:hidden}.dl-qr.light{background:#fff;box-shadow:inset 0 0 0 1px var(--dl-line)}.dl-qr svg{display:block;width:100%;height:100%}.dl-filecard{display:flex;align-items:center;gap:12px;padding:12px;border-radius:14px;background:var(--dl-soft);min-width:0}.dl-filecard>.dl-stack{flex:1;min-width:0}.dl-filecard-ic{width:40px;height:46px;border-radius:8px;flex:none;display:inline-flex;align-items:center;justify-content:center;font:10px var(--dl-mono);color:var(--dl-fg-muted);background:var(--dl-card);box-shadow:inset 0 0 0 1px var(--dl-line)}.dl-params>.dl-conf{margin:0;border-top:1px solid var(--dl-line);border-radius:0 0 12px 12px;background:none}.dl-conf-sec{color:var(--dl-accent)}.dl-conf-k{color:var(--dl-fg-faint)}.dl-conf-mask{padding:0 6px;border-radius:4px;background:var(--dl-soft);color:var(--dl-fg-muted)}.dl-params>summary .dl-chipbtn{height:26px;font-size:12px}.dl-conf{white-space:pre-wrap;word-break:break-all;max-height:22em;overflow:auto;font-family:var(--dl-mono);font-size:12px;line-height:18px;margin:0;padding:12px;border-radius:12px;background:var(--dl-soft)}.dl-key{width:100%;box-sizing:border-box;font-family:var(--dl-mono);font-size:12px;word-break:break-all;min-height:7em}.dl-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:12px 0 0}.dl-link-box{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.dl-link-box input{flex:1 1 18em;min-width:0;font-family:var(--dl-mono);font-size:12px}.dl-hint{font-size:12px;line-height:16px;color:var(--dl-fg-muted);margin:8px 0}.dl-divider{border:0;border-top:1px solid var(--dl-line);margin:16px 0}";var aa=".dl-checks{list-style:none;margin:0;padding:0}.dl-checks li{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--dl-line)}.dl-checks li:first-child{border-top:0;padding-top:0}.dl-checks li:last-child{padding-bottom:0}.dl-check-icon{flex:0 0 auto;width:28px;height:28px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center}.dl-check-icon .dl-icon{width:14px;height:14px}.dl-check-icon.ok{background:var(--dl-ok-wash);color:var(--dl-ok)}.dl-check-icon.warn{background:var(--dl-warn-wash);color:var(--dl-warn)}.dl-check-icon.error{background:var(--dl-bad-wash);color:var(--dl-bad)}.dl-check-icon.skip{background:var(--dl-soft);color:var(--dl-fg-faint)}.dl-check-body{flex:1;min-width:0}.dl-check-title{font-size:14px;line-height:20px;font-weight:500}.dl-check-detail{font-size:12px;line-height:16px;color:var(--dl-fg-muted);overflow-wrap:anywhere}.dl-check-repaired{margin-top:2px;font-size:12px;line-height:16px;color:var(--dl-warn)}.dl-wd{margin:0 0 16px;display:flex;flex-direction:column;gap:14px}.dl-wd-head{display:flex;align-items:center;gap:12px;min-width:0}.dl-wd-head>.dl-stack{min-width:0}.dl-wd-title{font-size:16px;line-height:24px;font-weight:500}.dl-wd-tile{flex:none;width:36px;height:36px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;background:var(--dl-ok-wash);color:var(--dl-ok)}.dl-wd-tile.off{background:var(--dl-soft);color:var(--dl-fg-faint)}.dl-wd-tile .dl-icon{width:18px;height:18px}.dl-wd-foot{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;padding-top:14px;border-top:1px solid var(--dl-line)}.dl-wd-chips{display:flex;flex-wrap:wrap;gap:6px;flex:1 1 auto;min-width:0}.dl-wd-chips .dl-check-chip.error .dl-icon{color:var(--dl-bad)}.dl-warn-text{color:var(--dl-warn)!important}.dl-health-cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(440px,100%),1fr));gap:16px;align-items:start}.dl-health-cols>.dl-panel{margin:0;min-width:0}.dl-recent{display:flex;flex-direction:column}.dl-recent .dl-panel-head a{font-size:13px}.dl-recent-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 16px;color:var(--dl-fg-muted);font-size:13px;border-top:1px solid var(--dl-line)}.dl-loading{margin:0;font-size:13px}.dl-diag-tabs{margin:0 0 16px}.dl-row.dl-slog-row{align-items:baseline}.dl-slog-row .dl-ev-tile{align-self:flex-start;margin-top:-1px}.dl-slog-row.has-detail{cursor:pointer}.dl-row.dl-slog-row.has-detail:hover{background:color-mix(in srgb,var(--sys) 11%,transparent)}.dl-slog-more{display:inline-flex;vertical-align:-2px;margin-left:6px;color:var(--dl-fg-faint);transform:rotate(90deg);transition:transform .15s}.dl-slog-more .dl-icon{width:14px;height:14px}.dl-slog-more.open{transform:rotate(-90deg)}.dl-slog-detail{margin:8px 0 2px;padding:8px 10px;border-radius:8px;background:var(--dl-soft);font-family:var(--dl-mono);font-size:12px;line-height:17px;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--dl-fg-muted);cursor:text}.dl-table{width:100%;border-collapse:collapse;font-size:14px;line-height:20px}.dl-table th{text-align:left;font-weight:500;color:var(--dl-fg-faint);padding:0 8px 8px;border-bottom:1px solid var(--dl-line)}.dl-table td{padding:10px 8px;border-bottom:1px solid var(--dl-line);vertical-align:middle}.dl-table th:first-child,.dl-table td:first-child{padding-left:0}.dl-table th:last-child,.dl-table td:last-child{padding-right:0}.dl-table tr:last-child td{border-bottom:0}.dl-table .dl-right{text-align:right;white-space:nowrap}.dl-log{max-height:18em;overflow:auto;font-family:var(--dl-mono);font-size:12px;line-height:18px;margin:8px 0 0;padding:12px;white-space:pre-wrap;border-radius:12px;background:var(--dl-soft)}";var la=".dl-pagehead{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:0 0 20px}.dl-h1{margin:0!important;padding:0!important;font-size:24px!important;line-height:32px!important;font-weight:500!important;border:0!important}.dl-title-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.dl-stack{display:flex;flex-direction:column;gap:2px;min-width:0}.dl-stack.gap4{gap:4px}.dl-stack.gap8{gap:8px}.dl-sub{font-size:12px;line-height:16px;color:var(--dl-fg-muted)}.dl-ok{color:var(--dl-ok)}.dl-warn{color:var(--dl-warn)}.dl-bad{color:var(--dl-bad)}.dl-icon-only{width:auto!important;min-width:0!important;aspect-ratio:1 / 1;padding:0!important;justify-content:center;display:inline-flex!important;align-items:center;border-radius:999px!important}.dl-panel.flush{padding:0;overflow:hidden}.dl-panel-head.pad{padding:16px 16px 12px;margin:0}.dl-col{display:flex;flex-direction:column;gap:16px;min-width:0}.dl-col>.dl-panel,.dl-col>section.dl-panel{margin:0}.dl-crumbs{display:flex;gap:8px;align-items:center;font-size:14px;margin:0 0 16px;color:var(--dl-fg-faint)}.dl-crumbs a{color:var(--dl-fg-faint)}.dl-crumbs a:hover{color:var(--dl-fg)}.dl-crumbs span:last-child{color:var(--dl-fg)}.dl-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));background:var(--dl-card);border:1px solid var(--dl-line);border-radius:var(--dl-radius);margin:0 0 16px;box-shadow:var(--dl-shadow)}.dl-metric{display:flex;flex-direction:column;gap:4px;padding:16px 20px;min-width:0}.dl-metric+.dl-metric{border-left:1px solid var(--dl-line)}.dl-metric-label{font-size:12px;font-weight:500;color:var(--dl-fg-faint)}.dl-metric-value{font-size:28px;line-height:36px;font-weight:500;letter-spacing:-.01em;font-variant-numeric:tabular-nums;white-space:nowrap}.dl-metric-value .dl-faint{font-size:16px}.dl-metric-sub{font-size:12px;color:var(--dl-fg-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media(max-width:900px){.dl-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.dl-metric:nth-child(3){border-left:0}.dl-metric:nth-child(n+3){border-top:1px solid var(--dl-line)}}.dl-seg{display:inline-flex;gap:2px;padding:3px;border-radius:999px;background:var(--dl-soft);flex-wrap:wrap}.dl-seg button{all:unset;cursor:pointer;display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:999px;font-size:13px;font-weight:500;color:var(--dl-fg-muted);white-space:nowrap}.dl-seg button:hover{color:var(--dl-fg)}.dl-seg button.on{background:var(--dl-soft-hover);color:var(--dl-fg)}.dl-seg.dl-srvsections{flex-wrap:nowrap;max-width:100%;overflow-x:auto;scrollbar-width:none}.dl-seg.dl-srvsections::-webkit-scrollbar{display:none}.dl-seg.dl-srvsections button{flex:none;white-space:nowrap}.dl-seg button:focus-visible{outline:2px solid var(--dl-ring)}.dl-seg button b{font-weight:500;font-size:11px;padding:0 6px;border-radius:999px;background:var(--dl-soft)}.dl-seg button b.warn{background:var(--dl-warn-wash);color:var(--dl-warn)}.dl-seg.sm button{padding:2px 9px;font-size:11px}.dl-seg.wide{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-radius:12px;padding:4px}.dl-seg.wide button{flex-direction:column;justify-content:center;padding:8px 6px;border-radius:9px;gap:3px;white-space:normal;text-align:center;line-height:16px}.dl-seg.wide button.on{background:var(--dl-primary);color:var(--dl-primary-fg)}";var da=`.dl-geomap{position:relative;border-top:1px solid var(--dl-line);background:transparent}.dl-map-status{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--dl-fg-muted);font-size:13px;z-index:1;pointer-events:none}.dl-map-wrap{position:relative}.dl-map-legend{position:absolute;left:12px;bottom:12px;display:flex;gap:12px;align-items:center;padding:6px 12px;border-radius:999px;font-size:12px;background:color-mix(in srgb,var(--dl-card) 88%,transparent);border:1px solid var(--dl-line);backdrop-filter:blur(6px);z-index:2}.dl-map-legend span{display:inline-flex;align-items:center;gap:6px;color:var(--dl-fg-muted)}.dl-map-legend i.line{width:14px;height:0;border-top:2px dashed #8a8a8a}.dl-map-legend i.line.live{border-top-color:#3b82f6}.dl-map-off{padding:32px 16px;text-align:center;color:var(--dl-fg-muted);border-top:1px solid var(--dl-line)}.dl-mk{all:unset;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;transition:opacity .2s}.dl-mk-hub{position:relative;display:flex;align-items:center;justify-content:center}.dl-mk-host{box-sizing:border-box;width:40px;height:40px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--dl-elevated) 60%,transparent);border:1px solid var(--dl-line);backdrop-filter:blur(6px);box-shadow:0 6px 16px #00000059}.dl-mk-host-tile{width:26px;height:26px;border-radius:7px;display:flex;align-items:center;justify-content:center;background:var(--dl-fg);color:var(--background, var(--dl-elevated))}.dl-mk-host-ic{width:14px;height:14px}.dl-mk-av{position:relative;box-sizing:border-box;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:500;line-height:1;border:2px solid #8a8a8a;background:var(--dl-elevated);color:var(--dl-fg-muted);transition:box-shadow .2s}.dl-mk.online .dl-mk-av{border-color:#3b82f6;background:color-mix(in srgb,#3b82f6 22%,var(--dl-elevated));color:var(--dl-fg)}.dl-mk-badge{position:absolute;left:16px;bottom:-6px;height:16px;min-width:16px;padding:0 3px;border-radius:8px;border:2px solid var(--dl-elevated);background:#6b6b6b;color:#fff;display:flex;align-items:center;justify-content:center;gap:1px;font-size:9px;font-weight:600;white-space:nowrap;box-sizing:content-box}.dl-mk.online .dl-mk-badge{background:#3b82f6}.dl-mk-badge-ic{width:10px;height:10px;stroke-width:2.2}.dl-mk-badge:has(>svg:only-child){width:16px;min-width:0;padding:0}.dl-mk-tile{position:relative;width:26px;height:26px;border-radius:7px;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--dl-fg) 18%,var(--dl-elevated));color:var(--dl-fg)}.dl-mk.place.online .dl-mk-tile{background:#3b82f6;color:#fff;box-shadow:0 2px 8px #3b82f659}.dl-mk-tile-ic{width:14px;height:14px}.dl-mk-tile-n{position:absolute;right:-5px;top:-5px;min-width:14px;height:14px;padding:0 3px;box-sizing:border-box;border-radius:7px;background:var(--dl-fg);color:var(--dl-elevated);font-size:9px;font-weight:600;line-height:14px;text-align:center}.dl-mk-when{display:block;text-align:center;color:var(--dl-fg-faint);font-weight:400}.dl-mk.place.online .dl-mk-when{color:#3b82f6}.dl-mk-tile.sm{width:18px;height:18px;border-radius:5px;font-size:9px;font-weight:600}.dl-dmap{border:1px solid var(--dl-line);border-radius:12px;overflow:hidden}.dl-dmap .dl-geomap{border-top:0}.dl-dplaces{display:flex;flex-direction:column;margin-top:4px}.dl-dplace-row{display:flex;align-items:center;gap:10px;padding:9px 2px;border-top:1px solid var(--dl-line);font-size:13px}.dl-dplace-row:first-child{border-top:0}.dl-dplace-n{flex:0 0 auto;width:20px;height:20px;border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;background:color-mix(in srgb,var(--dl-fg) 18%,var(--dl-elevated));color:var(--dl-fg)}.dl-dplace-n.live{background:#3b82f6;color:#fff}.dl-dplace-n .dl-icon{width:12px;height:12px}.dl-dplace-now{color:#3b82f6}.dl-dplaces.strips .dl-dplace-row{position:relative;display:grid;grid-template-columns:20px minmax(0,1fr) auto;column-gap:10px;row-gap:9px;margin:0 -10px;padding:11px 10px;border-top:0;border-radius:10px;transition:background .15s}.dl-dplaces.strips .dl-dplace-row+.dl-dplace-row:before{content:"";position:absolute;left:10px;right:10px;top:0;height:1px;background:var(--dl-line)}.dl-dplaces.strips .dl-dplace-row:is(:hover,.cur){background:var(--dl-soft)}.dl-dplaces.strips .dl-dplace-row:is(:hover,.cur):before,.dl-dplaces.strips .dl-dplace-row:is(:hover,.cur)+.dl-dplace-row:before{opacity:0}.dl-dplace-strip{grid-column:2 / 4;position:relative;height:6px;border-radius:3px;background:var(--dl-track)}.dl-dplaces.can-replay .dl-dplace-strip{cursor:ew-resize;touch-action:none}.dl-dplace-strip i{position:absolute;top:0;bottom:0;min-width:2px;border-radius:2px;background:#8a8a8a}.dl-dplace-strip.live i{background:#3b82f6}.dl-dplaces.replay .dl-dplace-strip:after{content:"";position:absolute;left:var(--at);top:-4px;bottom:-4px;width:2px;margin-left:-1px;border-radius:1px;background:var(--dl-fg);box-shadow:0 0 0 2px var(--dialog-bg, var(--dl-elevated));pointer-events:none}.dl-dplace-axis{position:relative;height:16px;margin:4px 0 0 30px;font-size:11px;line-height:16px;color:var(--dl-fg-faint)}.dl-dplace-axis span{position:absolute;top:0;transform:translate(-50%);white-space:nowrap}.dl-dmap{position:relative}.dl-map-replay{position:absolute;left:10px;top:10px;z-index:3;display:flex;align-items:center;gap:6px}.dl-map-btn{all:unset;box-sizing:border-box;cursor:pointer;width:28px;height:28px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;background:var(--dl-elevated);border:1px solid var(--dl-line);color:var(--dl-fg)}.dl-map-btn:hover{background:color-mix(in srgb,var(--dl-fg) 8%,var(--dl-elevated))}.dl-map-btn:focus-visible{outline:2px solid var(--dl-ring)}.dl-map-btn .dl-icon{width:13px;height:13px}.dl-map-chip{display:inline-flex;align-items:center;height:28px;box-sizing:border-box;padding:0 10px;border-radius:8px;font-size:11.5px;white-space:nowrap;background:var(--dl-elevated);border:1px solid var(--dl-line);color:var(--dl-fg);font-variant-numeric:tabular-nums}.dl-mk.step .dl-mk-tile{transition:width .3s cubic-bezier(.2,.8,.2,1),height .3s cubic-bezier(.2,.8,.2,1),border-radius .3s,background-color .3s,color .3s,box-shadow .3s,transform .24s}.dl-mk.step .dl-mk-tile.sm .dl-mk-tile-ic{width:11px;height:11px}.dl-mk.step.faded>*{opacity:.5}.dl-mk.step:is(.online,.hl){z-index:2}.dl-mk.step.hl .dl-mk-tile{box-shadow:0 0 0 3px color-mix(in srgb,#3b82f6 55%,transparent)}.dl-mk.step.arrive .dl-mk-tile{animation:dl-mk-arrive .45s cubic-bezier(.2,.8,.2,1)}@keyframes dl-mk-arrive{0%{transform:scale(.8)}55%{transform:scale(1.12)}to{transform:scale(1)}}.dl-mk-when.inline{display:inline}.dl-mk>*{transition:opacity .15s;opacity:var(--dl-mk-fade, 1)}.dl-mk.merged,.dl-mk.piled{pointer-events:none}.dl-mk.dl-mk-new>*{transition:none}.dl-mk.merged>*,.dl-mk.piled>*{opacity:0}.dl-mk-hub{cursor:default}.dl-mk-host{position:relative}.dl-mk-host{transition:border-radius .22s ease,border-right-color .22s ease}.dl-mk-host.docked{border-top-right-radius:0;border-bottom-right-radius:0;border-right-color:transparent}.dl-mk-dock{position:absolute;left:100%;top:-1px;height:40px;box-sizing:border-box;display:flex;align-items:center;gap:6px;padding:0 10px 0 2px;border:1px solid var(--dl-line);border-left:0;border-radius:0 11px 11px 0;background:color-mix(in srgb,var(--dl-elevated) 60%,transparent);backdrop-filter:blur(6px);box-shadow:0 6px 16px #00000059;pointer-events:none;opacity:0;clip-path:inset(-24px 100% -24px 0);transition:clip-path .28s cubic-bezier(.2,.8,.2,1),opacity .2s ease}.dl-mk-host.docked .dl-mk-dock{pointer-events:auto;opacity:1;clip-path:inset(-24px -24px -24px 0)}.dl-mk-new .dl-mk-host,.dl-mk-new .dl-mk-dock{transition:none}.dl-mk-pile{position:relative;display:flex;justify-content:center}.dl-mk-pile-box{box-sizing:border-box;height:40px;display:flex;align-items:center;gap:6px;padding:0 10px 0 6px;border-radius:20px;cursor:zoom-in;background:color-mix(in srgb,var(--dl-elevated) 60%,transparent);border:1px solid var(--dl-line);backdrop-filter:blur(6px);box-shadow:0 6px 16px #00000059;animation:dl-plate-in .26s cubic-bezier(.2,.8,.2,1) both;transition:opacity .18s ease,transform .18s ease}.dl-mk-pile.out{pointer-events:none}.dl-mk-pile.out>*{opacity:0;transform:scale(.85);transition:opacity .18s ease,transform .18s ease}@keyframes dl-plate-in{0%{opacity:0;transform:scale(.85)}}.dl-mk-face{all:unset;position:relative;display:flex;cursor:pointer;transition:transform .18s ease,opacity .18s ease}.dl-mk-face>.dl-mk-badge{position:relative;left:auto;bottom:-8px;margin-left:-12px;align-self:center}.dl-mk-face.on .dl-mk-av{border-color:#3b82f6;background:color-mix(in srgb,#3b82f6 22%,var(--dl-elevated));color:var(--dl-fg)}.dl-mk-face.on .dl-mk-badge{background:#3b82f6}.dl-mk-face:hover .dl-mk-av{box-shadow:0 0 0 4px #3b82f640}.dl-mk-face.in{animation:dl-dock-in .24s cubic-bezier(.2,.8,.2,1) both}.dl-mk-face.out{transform:scale(.4);opacity:0;pointer-events:none}@keyframes dl-dock-in{0%{transform:scale(.4);opacity:0}}.dl-mk-more{font-size:11px;font-weight:600;color:var(--dl-fg-muted)}.dl-mk-av,.dl-mk-tile{transition:box-shadow .2s,transform .24s cubic-bezier(.2,.8,.2,1)}.dl-mk.merged .dl-mk-av,.dl-mk.merged .dl-mk-tile,.dl-mk.piled .dl-mk-av{transform:scale(.5)}.dl-mk-host,.dl-mk-dock,.dl-mk-pile-box{transition-property:border-radius,border-right-color,clip-path,opacity,height,width,padding,gap}.dl-mk-dock,.dl-mk-pile-box{transition-duration:.22s;transition-timing-function:cubic-bezier(.2,.8,.2,1)}.dl-mk-pile-box{position:relative}.dl-mk-more{transition:transform .22s cubic-bezier(.2,.8,.2,1),opacity .18s ease}.dl-mk-more.in{animation:dl-dock-in .24s ease both}.dl-mk-more.out{transform:scale(.4);opacity:0}.dl-mk-face .dl-mk-av{transition:box-shadow .2s,transform .24s cubic-bezier(.2,.8,.2,1),width .2s ease,height .2s ease,font-size .2s ease}.dl-mk-face{transition:transform .22s cubic-bezier(.2,.8,.2,1),opacity .18s ease,margin .2s ease}.dl-mk-face>.dl-mk-badge{max-width:48px;overflow:hidden;transition:opacity .2s ease,transform .2s ease,max-width .22s ease,margin .22s ease,padding .22s ease,border-width .22s ease,height .22s ease,min-width .22s ease,width .22s ease,bottom .22s ease}.dl-lod-far .dl-mk-host{width:32px;height:32px;border-radius:9px}.dl-lod-far .dl-mk-host.docked{border-radius:9px 0 0 9px}.dl-lod-far .dl-mk-host-tile{width:20px;height:20px;border-radius:6px}.dl-lod-far .dl-mk-host-ic{width:11px;height:11px}.dl-lod-far .dl-mk-dock{height:32px;gap:0;padding:0 4px 0 0;border-radius:0 9px 9px 0}.dl-lod-far .dl-mk-pile-box{height:32px;gap:0;padding:0 4px;border-radius:16px}.dl-lod-far .dl-mk-face+.dl-mk-face{margin-left:-6px}.dl-lod-far .dl-mk-face .dl-mk-av{width:22px;height:22px;font-size:8px;box-shadow:0 0 0 2px var(--dl-elevated)}.dl-lod-far .dl-mk-face>.dl-mk-badge{max-width:0;min-width:0;padding:0;margin-left:0;border-width:0;opacity:0;transform:scale(.5);pointer-events:none}.dl-lod-far .dl-mk-more{margin-left:4px;font-size:10px}.dl-mk-label{transition:opacity .2s ease}.dl-lod-far .dl-mk:not(.step) .dl-mk-label{opacity:0}.dl-lod-mid .dl-mk-host{width:36px;height:36px}.dl-lod-mid .dl-mk-dock,.dl-lod-mid .dl-mk-pile-box{height:36px}.dl-lod-mid .dl-mk-face .dl-mk-av{width:24px;height:24px;font-size:9px}.dl-lod-mid .dl-mk-face>.dl-mk-badge{height:12px;min-width:12px;margin-left:-10px;bottom:-7px}.dl-lod-mid .dl-mk-face>.dl-mk-badge:has(>svg:only-child){width:12px}.dl-lod-mid .dl-mk-face>.dl-mk-badge .dl-mk-badge-ic{width:8px;height:8px}@media(prefers-reduced-motion:reduce){.dl-mk-dock,.dl-mk-pile-box,.dl-mk-face,.dl-mk-av,.dl-mk-tile,.dl-mk.step .dl-mk-tile,.dl-mk-host,.dl-mk-face>.dl-mk-badge{transition:none;animation:none}}.dl-mk-hub:has(.dl-mk-host.docked) .dl-mk-host{cursor:zoom-in}.dl-mk-ptr{position:absolute;left:50%;top:50%;width:0;height:0;z-index:-1;pointer-events:none}.dl-mk-ptr .line{position:absolute;left:0;top:-.5px;height:1px;background:var(--dl-fg-faint);transform-origin:0 50%}.dl-mk-ptr .spot{position:absolute;left:-3.5px;top:-3.5px;width:7px;height:7px;border-radius:50%;box-sizing:border-box;border:1.5px solid #fff;background:#8a8a8a}.dl-mk.online .dl-mk-ptr .spot,.dl-mk.place.online .dl-mk-ptr .spot{background:#3b82f6}.dl-mk.dim>*{opacity:.18}.dl-mk.hl .dl-mk-av{box-shadow:0 0 0 4px #3b82f640}.dl-mk-label{position:absolute;left:50%;bottom:100%;margin-bottom:4px;transform:translate(-50%);white-space:nowrap;pointer-events:none;font-size:10px;line-height:14px;font-weight:500;color:var(--dl-fg)}.dl-mk-label.below{bottom:auto;top:100%;margin:4px 0 0}.dl-mk-label.chip{padding:2px 6px;border-radius:4px;font-size:11px;line-height:16px;font-weight:600;background:color-mix(in srgb,var(--background, var(--dl-card)) 80%,transparent);backdrop-filter:blur(8px)}.dl-geomap .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib.maplibregl-compact{margin:0 10px 10px 0;min-height:28px;padding:0;border-radius:8px;background:var(--dl-elevated);border:1px solid var(--dl-line);color:var(--dl-fg-muted);box-shadow:none;font-size:11px;line-height:26px}.dl-geomap .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show){width:28px;height:28px;box-sizing:border-box}.dl-geomap .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show{padding:0 32px 0 10px}.dl-geomap .maplibregl-ctrl-attrib a{color:var(--dl-fg-muted)}.dl-geomap .maplibregl-ctrl-attrib-button{top:0;right:0;width:26px;height:26px;margin:0;border-radius:8px;background:none}.dl-geomap .maplibregl-ctrl-attrib-button:after{content:"";position:absolute;inset:5px;background:var(--dl-fg);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm-1.2 8.2h2.4V17h-2.4v-6.8ZM12 6a1.4 1.4 0 1 0 0 2.8A1.4 1.4 0 0 0 12 6Z'/%3E%3C/svg%3E") center / contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm-1.2 8.2h2.4V17h-2.4v-6.8ZM12 6a1.4 1.4 0 1 0 0 2.8A1.4 1.4 0 0 0 12 6Z'/%3E%3C/svg%3E") center / contain no-repeat}.dl-geomap .maplibregl-ctrl-attrib-button:focus{outline:none;box-shadow:none}.dl-geomap .maplibregl-ctrl-attrib-button:focus-visible{outline:2px solid var(--dl-ring)}.dl-map-card{position:absolute;right:12px;top:12px;z-index:3;min-width:200px;max-width:260px;padding:10px 12px;border-radius:10px;font-size:12px;line-height:20px;background:var(--dl-elevated);color:var(--dl-fg);border:1px solid var(--dl-line);box-shadow:var(--shadow-xl, 0 8px 16px -4px rgba(0,0,0,.4));opacity:0;transition:opacity .2s;pointer-events:none}.dl-map-card.on{opacity:1}.dl-map-card-head b{font-weight:500}.dl-map-card-row{display:flex;justify-content:space-between;gap:12px;white-space:nowrap}.dl-popcard{position:fixed;z-index:2100;width:max-content;max-width:300px;padding:12px;border-radius:12px;box-sizing:border-box;background:var(--dl-elevated);color:var(--dl-fg);border:1px solid var(--dl-line);box-shadow:var(--shadow-xl, 0 8px 16px -4px rgba(0,0,0,.4))}.dl-popcard.away{visibility:hidden}.dl-popcard.leaving{pointer-events:none}.dl-popcard-tip{position:absolute;left:var(--tip-x, 50%);width:10px;height:10px;margin-left:-6px;box-sizing:border-box;background:var(--dl-elevated);border:solid var(--dl-line);transform:rotate(45deg)}.dl-popcard.above .dl-popcard-tip{bottom:-6px;border-width:0 1px 1px 0}.dl-popcard.below .dl-popcard-tip{top:-6px;border-width:1px 0 0 1px}.dl-popcard.above{transform-origin:var(--tip-x, 50%) 100%}.dl-popcard.below{transform-origin:var(--tip-x, 50%) 0}@media(prefers-reduced-motion:no-preference){.dl-popcard{animation:dl-pop-in .16s ease-out}.dl-popcard.leaving{animation:dl-pop-out .14s ease-in forwards}}@keyframes dl-pop-in{0%{opacity:0;transform:scale(.94)}to{opacity:1;transform:none}}@keyframes dl-pop-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.94)}}.dl-pop{display:flex;flex-direction:column;gap:4px;font-size:12px;line-height:18px;min-width:210px}.dl-pop-head{display:flex;align-items:center;gap:8px;font-size:13px;margin-bottom:2px}.dl-pop-net{width:30px;height:30px;border-radius:9px;background:var(--dl-soft);display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--dl-fg-muted)}.dl-pop-list{display:flex;flex-direction:column;margin:6px 0 0;max-height:116px;overflow-y:auto}.dl-pop-row{all:unset;cursor:pointer;display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:8px}.dl-pop-row:hover{background:var(--dl-soft)}.dl-pop-row:focus{outline:none}.dl-pop-row:focus-visible{outline:2px solid var(--dl-ring)}.dl-pop-name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dl-pop-name b{font-weight:500}.dl-pop-dot{width:6px;height:6px;border-radius:50%;background:var(--dl-fg-faint);flex:0 0 auto}.dl-pop-dot.on{background:var(--dl-ok);box-shadow:0 0 0 3px var(--dl-ok-wash)}.dl-pop-actions{display:flex;gap:6px;margin-top:8px;padding-top:8px;border-top:1px solid var(--dl-line)}.dl-pop-actions .cbi-button{flex:1;height:28px!important;font-size:12px!important;justify-content:center}.dl-chartbox{position:relative}.dl-bars{display:flex;align-items:flex-end;gap:4px;border-bottom:1px solid var(--dl-line)}.dl-bar{flex:1;height:100%;display:flex;flex-direction:column-reverse;gap:1px;cursor:default;min-width:3px}.dl-bar i{display:block;border-radius:3px 3px 0 0}.dl-bar i.down{background:var(--dl-chart-1)}.dl-bar i.up{background:var(--dl-chart-2);opacity:.75;border-radius:3px 3px 0 0}.dl-bar:hover i{filter:brightness(1.25)}.dl-bar.empty{background:linear-gradient(to top,var(--dl-line) 2px,transparent 2px)}.dl-tip{position:absolute;top:-8px;transform:translate(-50%,-100%);padding:8px 10px;border-radius:10px;font-size:12px;line-height:18px;white-space:nowrap;background:var(--dl-elevated);border:1px solid var(--dl-line);box-shadow:var(--shadow-xl, 0 8px 16px -4px rgba(0,0,0,.4));pointer-events:none;z-index:3}.dl-tip-title{font-weight:500}.dl-tip-float{position:fixed;z-index:2000;color:var(--dl-fg)}.dl-meter,.dl-slots{cursor:default}.dl-axis{display:flex;justify-content:space-between;font-size:12px;color:var(--dl-fg-faint);margin-top:6px}.dl-legend i.down{background:var(--dl-chart-1)}.dl-legend i.up{background:var(--dl-chart-2)}.dl-spark{display:flex;align-items:flex-end;flex:0 0 auto;--dl-gap: 2px}.dl-spark i{flex:1;display:block;border-radius:2px 2px 0 0;background:var(--dl-chart-1);opacity:.85}.dl-spark i.zero{opacity:.22}.dl-spark>span:hover i:not(.zero){opacity:1;filter:brightness(1.25)}.dl-spark>span,.dl-dbars>span,.dl-bento-bars>span{flex:1;min-width:0;height:100%;display:flex;align-items:flex-end;padding:0 calc(var(--dl-gap) / 2)}.dl-spark>span:first-child,.dl-dbars>span:first-child,.dl-bento-bars>span:first-child{padding-left:0}.dl-spark>span:last-child,.dl-dbars>span:last-child,.dl-bento-bars>span:last-child{padding-right:0}`;var ca=`.dl-row{display:flex;align-items:center;gap:12px;padding:12px 16px;border-top:1px solid var(--dl-line);font-size:14px;line-height:20px;min-width:0}.dl-row.link{color:inherit;text-decoration:none}.dl-row.link:hover{background:var(--dl-soft)}.dl-row-main{flex:1;min-width:0;overflow-wrap:anywhere}.dl-row-main b{font-weight:500}.dl-attn{display:flex;flex-direction:column;gap:10px;padding:16px;border-top:1px solid var(--dl-line)}.dl-attn-item{display:flex;gap:10px;align-items:baseline;font-size:13px;color:var(--dl-fg-muted)}.dl-avatar.sm{width:26px;height:26px;font-size:10px;margin:0}.dl-avatar.lg{width:48px;height:48px;font-size:15px;margin:0}.dl-avatar.lg.online:after{width:12px;height:12px}.dl-list{border:1px solid var(--dl-line);border-radius:12px;overflow:hidden}.dl-list>.dl-row:first-child{border-top:0}.dl-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.dl-row-main.dl-stack{min-width:0}.dl-person-id{display:flex;align-items:center;gap:14px;min-width:0}.dl-grid-person{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);gap:16px;align-items:start}@media(max-width:1000px){.dl-grid-person{grid-template-columns:minmax(0,1fr)}}.dl-devsec{display:flex;flex-direction:column;gap:12px}.dl-devsec .dl-panel-head{margin:0}.dl-dgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.dl-dcard>.dl-dcard-head+*{margin-top:auto}@media(max-width:700px){.dl-dgrid{grid-template-columns:minmax(0,1fr)}}.dl-dgrid>.dl-dslot.add:only-child{grid-column:1 / -1}.dl-dcard{background:var(--dl-card);border:1px solid var(--dl-line);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:12px;min-width:0;box-shadow:var(--dl-shadow)}.dl-dcard.online{border-color:color-mix(in srgb,var(--dl-ok) 35%,transparent)}.dl-dcard.off{opacity:.7}.dl-dcard-head{display:flex;align-items:center;gap:12px}.dl-dcard-ic{width:40px;height:40px;border-radius:12px;background:var(--dl-soft);display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--dl-fg-muted)}.dl-dcard-ic .dl-icon{width:20px;height:20px}.dl-dcard.online .dl-dcard-ic{background:var(--dl-ok-wash);color:var(--dl-ok)}.dl-dcard-title{all:unset;cursor:pointer;flex:1;min-width:0;display:flex;flex-direction:column}.dl-dcard-title b{font-weight:500;font-size:15px}.dl-dstat{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--dl-fg-muted);white-space:nowrap;min-width:0}.dl-dstat i.dot{flex:none}.dl-dstat.ok{color:var(--dl-ok)}.dl-dstat.warn{color:var(--dl-warn)}.dl-dstat i.dot,.dl-savebar i.dot{width:6px;height:6px;border-radius:50%;background:var(--dl-fg-faint)}.dl-dstat i.dot.ok{background:var(--dl-ok);box-shadow:0 0 0 3px var(--dl-ok-wash)}.dl-dstat i.dot.warn{background:var(--dl-warn)}.dl-dcard-use{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}.dl-dcard-foot{padding-top:10px;border-top:1px solid var(--dl-line);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dl-dslot.add{all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:14px;min-height:0;border:1px dashed color-mix(in srgb,currentColor 18%,transparent);border-radius:14px;text-align:center;color:var(--dl-fg-muted);transition:background .15s,border-color .15s,color .15s}.dl-dslot.add .dl-stack{align-items:center}.dl-dslot.add:hover{border-color:color-mix(in srgb,currentColor 35%,transparent);color:var(--dl-fg)}.dl-dslot.add:focus-visible{outline:2px solid var(--dl-ring);outline-offset:2px}.dl-dslot.add b{font-weight:500}.dl-dslot.add:hover{background:var(--dl-soft)}.dl-dslot-ic{width:36px;height:36px;border-radius:999px;background:var(--dl-soft);display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--dl-fg-muted)}.dl-dslot.add:hover .dl-dslot-ic{background:var(--dl-primary);color:var(--dl-primary-fg)}.dl-tiles2{display:grid;gap:10px;margin-top:16px}.dl-tile2{border:1px solid var(--dl-line);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:10px;min-width:0}.dl-tile2-label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;font-weight:500;color:var(--dl-fg-faint)}.dl-tile2-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.dl-tile2-value{font-size:20px;line-height:28px;font-weight:500;letter-spacing:-.01em;font-variant-numeric:tabular-nums}.dl-tile2-value .dl-faint{font-size:14px;font-weight:400}.dl-tile2-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:10px;border-top:1px solid var(--dl-line);font-size:12px}.dl-stepper{display:inline-flex;align-items:stretch;height:32px;border:1px solid var(--input, var(--dl-line));border-radius:8px;overflow:hidden}.dl-stepper button{all:unset;cursor:pointer;width:32px;display:inline-flex;align-items:center;justify-content:center;font-size:16px;color:var(--dl-fg)}.dl-stepper button:hover{background:var(--dl-soft)}.dl-stepper button[disabled]{opacity:.35;cursor:not-allowed}.dl-stepper+.dl-stepper{margin-left:4px}.dl-step-select{border:0!important;border-left:1px solid var(--input, var(--dl-line))!important;border-right:1px solid var(--input, var(--dl-line))!important;border-radius:0!important;background:transparent!important;color:inherit;font:500 13px inherit;padding:0 10px!important;height:100%!important;min-width:0!important}.dl-slots{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:3px}.dl-slots i{height:4px;border-radius:999px;background:var(--dl-track);display:block}.dl-slots i.used{background:var(--dl-fg)}.dl-slots i.over{background:color-mix(in srgb,var(--dl-warn) 80%,transparent)}.dl-date{display:flex;align-items:center;gap:8px;flex:1 1 150px;min-width:0;box-sizing:border-box;height:34px;padding:0 10px;border:1px solid var(--input, var(--dl-line));border-radius:8px;color:var(--dl-fg-faint)}.dl-date input{border:0!important;background:transparent!important;box-shadow:none!important;padding:0!important;height:32px!important;color:var(--dl-fg);flex:1;min-width:0!important;width:100%!important}.dl-meter{position:relative;height:6px;border-radius:999px;background:var(--dl-track)}.dl-meter>i{display:block;height:100%;border-radius:999px;background:var(--dl-accent)}.dl-meter.warn>i{background:var(--dl-warn)}.dl-meter.bad>i{background:var(--dl-bad)}.dl-meter .mark{position:absolute;left:90%;top:-3px;width:1px;height:12px;background:var(--dl-warn)}.dl-meter.sm{height:4px}.dl-chips-row{display:flex;flex-wrap:wrap;gap:4px}.dl-chipbtn{all:unset;cursor:pointer;height:26px;padding:0 10px;border-radius:999px;background:var(--dl-soft);font-size:12px;font-weight:500;display:inline-flex;align-items:center}.dl-chipbtn:hover{background:var(--dl-soft-hover)}.dl-chipbtn.on{background:var(--dl-primary);color:var(--dl-primary-fg)}.dl-switch{all:unset;cursor:pointer;position:relative;width:32px;height:20px;border-radius:999px;background:var(--switch-off, var(--dl-track));flex:0 0 auto;transition:background .15s}.dl-switch i{position:absolute;left:2px;top:2px;width:16px;height:16px;border-radius:50%;background:#fff;transition:left .15s;box-shadow:0 1px 2px #0000004d}.dl-switch.on{background:var(--dl-accent)}.dl-switch.on i{left:14px}.dl-switch:focus-visible{outline:2px solid var(--dl-ring);outline-offset:2px}.dl-linkbox{display:flex;align-items:center;gap:8px;height:36px;padding:0 4px 0 12px;border:1px solid var(--input, var(--dl-line));border-radius:8px;background:var(--input-bg, transparent)}.dl-linkbox .dl-mono{flex:1;min-width:0;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--dl-fg-muted)}.dl-linkbox .cbi-button{height:28px!important}.dl-pcard{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:20px;align-items:stretch;min-width:0}.dl-pcard-main{min-width:0}.dl-pcard-top{display:flex;align-items:center;gap:12px;min-width:0}.dl-pcard-top .dl-avatar{margin-right:0}.dl-pcard-who{flex:1;min-width:0}.dl-pcard-who .dl-slotbar{margin:3px 0 0}.dl-pside{display:flex;flex-direction:column;justify-content:space-between;gap:8px;padding-left:20px;border-left:1px solid var(--dl-line);min-width:0}.dl-pside-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.dl-pside-state{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--dl-fg-muted)}.dl-pside-state.live{color:var(--dl-ok)}.dl-pside-foot{font-size:12px}.dl-pside .dl-use-num b{font-size:20px}.dl-none{display:none!important}.dl-pcard-actions{display:flex;gap:6px;flex:0 0 auto}.dl-pcard-actions .cbi-button{height:32px!important}.dl-icon-only .dl-btn-label{display:none}.dl-pill-ic{display:inline-flex;align-items:center;gap:4px;height:22px;padding:0 8px;border-radius:999px;font-size:12px;white-space:nowrap;background:var(--dl-soft);color:var(--dl-fg-muted)}.dl-pill-ic .dl-icon{width:12px;height:12px}.dl-pill-ic.warn{background:var(--dl-warn-wash);color:var(--dl-warn)}.dl-pill-ic.bad{background:var(--dl-bad-wash);color:var(--dl-bad)}.dl-use-num{display:flex;align-items:baseline;gap:6px;white-space:nowrap}.dl-use-num b{font-size:15px;font-weight:500}.dl-use-live{display:flex;align-items:center;gap:8px;font-size:12px;font-variant-numeric:tabular-nums}.dl-usebar{display:flex;gap:2px;height:6px;border-radius:999px;overflow:hidden;background:var(--dl-track)}.dl-usebar i{display:block;height:100%;min-width:3px;flex:0 1 0}.dl-usebar i.fill{flex:none;min-width:0;border-radius:999px;background:var(--dl-accent)}.dl-usebar.warn i.fill{background:var(--dl-warn)}.dl-usebar.bad i.fill{background:var(--dl-bad)}.dl-usebar .c0,.dl-swatch.c0{background:var(--dl-chart-1)}.dl-usebar .c1,.dl-swatch.c1{background:#8b7cf6}.dl-usebar .c2,.dl-swatch.c2{background:#2fb889}.dl-usebar .c3,.dl-swatch.c3{background:#d9a03f}.dl-usebar .c4,.dl-swatch.c4{background:var(--dl-fg-faint)}.dl-tip-row{display:flex;align-items:center;gap:8px;min-width:160px}.dl-tip-row b{margin-left:auto;font-weight:500}.dl-swatch{width:8px;height:8px;border-radius:2px;flex:none}.dl-card-name{color:var(--dl-fg)!important;text-decoration:none}.dl-card-name:hover{text-decoration:underline}.dl-chip-tag{font-size:11px;line-height:18px;padding:0 6px;border-radius:999px;background:var(--dl-warn-wash);color:var(--dl-warn)}.dl-chip.live{background:var(--dl-ok-wash);color:color-mix(in srgb,var(--dl-ok) 35%,var(--dl-fg))}.dl-chip.live:hover{background:color-mix(in srgb,var(--dl-ok) 22%,transparent)}.dl-chip.live .dl-icon{color:var(--dl-ok)}.dl-fixes{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0 0 44px}.dl-fix{all:unset;cursor:pointer;height:26px;padding:0 10px;border-radius:999px;background:var(--dl-info-wash);color:var(--dl-info);font-size:12px;font-weight:500;display:inline-flex;align-items:center}.dl-fix:hover{filter:brightness(1.15)}@media(max-width:760px){.dl-pcard{grid-template-columns:1fr}.dl-pside{padding:12px 0 0;border-left:0;border-top:1px solid var(--dl-line)}.dl-fixes{margin-left:0}}.dl-select{height:34px!important;border-radius:999px!important;min-width:136px!important;width:auto!important;padding:0 34px 0 14px!important;appearance:none!important;-webkit-appearance:none!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8f98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right 12px center!important;background-size:14px!important}.dl-savebar{position:fixed;left:50%;bottom:24px;transform:translate(-50%,160%);opacity:0;transition:transform .25s cubic-bezier(.2,.8,.2,1),opacity .2s;display:flex;align-items:center;gap:10px;padding:8px 8px 8px 18px;border-radius:999px;background:var(--dl-elevated);border:1px solid var(--dl-line);box-shadow:var(--shadow-2xl, 0 16px 32px -8px rgba(0,0,0,.5));z-index:60;pointer-events:none}.dl-savebar.show{transform:translate(-50%);opacity:1;pointer-events:auto}.dl-savebar-text{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:500}`;var pa=".dl-toast strong{display:block;font-weight:500}.dl-toast div{opacity:.8;font-size:13px}.dl-drawer-overlay{position:fixed;inset:0;z-index:900;display:flex;justify-content:flex-end;background:transparent;transition:background .2s}.dl-drawer-overlay.open{background:var(--scrim, rgba(0,0,0,.45))}.dl-drawer{width:min(520px,100%);height:100%;display:flex;flex-direction:column;background:var(--dialog-bg, var(--dl-elevated));color:var(--dl-fg);border-left:1px solid var(--dl-line);box-shadow:var(--shadow-2xl, -16px 0 32px -8px rgba(0,0,0,.5));transform:translate(100%);transition:transform .22s cubic-bezier(.2,.8,.2,1)}.dl-drawer-overlay.open .dl-drawer{transform:none}.dl-drawer-head{display:flex;align-items:center;gap:12px;padding:16px 20px;border-bottom:1px solid var(--dl-line)}.dl-drawer-title{flex:1;min-width:0;display:flex;align-items:center;gap:12px}.dl-drawer-title h3{margin:0!important;padding:0!important;border:0!important;font-size:18px!important;line-height:26px;font-weight:500!important}.dl-drawer-x{all:unset;cursor:pointer;width:32px;height:32px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:var(--dl-fg-muted)}.dl-drawer-x:hover{background:var(--dl-soft);color:var(--dl-fg)}.dl-drawer-body{flex:1;overflow:auto;padding:20px}.dl-drawer-foot{padding:12px 20px;border-top:1px solid var(--dl-line)}.dl-drawer-actions{display:flex;align-items:center;gap:8px}.dl-dcard-ic.on{background:var(--dl-ok-wash);color:var(--dl-ok)}.dl-icon-only.sm{width:28px;height:28px!important}.dl-stack.gap12{gap:12px}.dl-stack.gap16{gap:16px}.dl-dstats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--dl-line);border-radius:14px;overflow:hidden}.dl-dstats-cell{display:flex;flex-direction:column;gap:4px;padding:12px 14px;min-width:0}.dl-dstats-cell.wide{grid-column:span 2;border-bottom:1px solid var(--dl-line)}.dl-dstats-cell+.dl-dstats-cell:not(.wide):last-child{border-left:1px solid var(--dl-line)}.dl-dstats-cell b{font-size:16px;font-weight:500;font-variant-numeric:tabular-nums}.dl-dstats-cell .dl-dstat{font-size:14px}.dl-dsec{border:1px solid var(--dl-line);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:12px}.dl-dsec-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.dl-dsec-head h4{margin:0!important;padding:0!important;font-size:14px!important;font-weight:500!important;border:0!important}.dl-dstat i.dot{width:6px;height:6px;border-radius:50%;background:var(--dl-fg-faint);display:inline-block}.dl-connect-body{min-height:60px}.dl-connect-body .dl-qr{width:min(240px,70vw)}.dl-kv2{display:flex;flex-direction:column}.dl-kvrow{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:9px 0;border-top:1px solid var(--dl-line);font-size:13px;min-width:0}.dl-kvrow:first-child{border-top:0;padding-top:0}.dl-kvrow-k{color:var(--dl-fg-muted);flex:0 0 auto}.dl-kvrow-v{min-width:0;text-align:right;overflow-wrap:anywhere}.dl-kvrow-v.copy{all:unset;cursor:pointer;display:inline-flex;align-items:center;gap:6px;min-width:0;color:var(--dl-fg)}.dl-kvrow-v.copy span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-kvrow-v.copy .dl-icon{width:13px;height:13px;color:var(--dl-fg-faint)}.dl-kvrow-v.copy:hover .dl-icon{color:var(--dl-fg)}@media(max-width:560px){.dl-drawer{width:100%}.dl-dstats{grid-template-columns:minmax(0,1fr)}.dl-dstats-cell.wide{grid-column:auto}.dl-dstats-cell+.dl-dstats-cell:not(.wide):last-child{border-left:0;border-top:1px solid var(--dl-line)}}.dl-dev-log{display:flex;flex-direction:column}.dl-dev-log-row{display:flex;align-items:center;gap:10px;padding:8px 0;border-top:1px solid var(--dl-line);font-size:13px;line-height:20px;min-width:0}.dl-dev-log-row:first-child{border-top:0;padding-top:0}.dl-dev-log-row .dl-row-main{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}";var ua=".dl-settings-main{min-width:0;display:flex;flex-direction:column;gap:20px}.dl-setsec{background:var(--dl-card);border:1px solid var(--dl-line);border-radius:var(--dl-radius);overflow:hidden;scroll-margin-top:88px;box-shadow:var(--dl-shadow)}.dl-setsec-body{padding:20px;display:flex;flex-direction:column;gap:14px}.dl-setsec-body h3{margin:0!important;padding:0!important;font-size:18px!important;line-height:26px;font-weight:500!important;border:0!important}.dl-setsec-body p{margin:0}.dl-setsec-head{display:flex;align-items:center;gap:10px}.dl-group{border:1px solid var(--dl-line);border-radius:14px;padding:2px 16px}.dl-group-head{display:flex;align-items:center;gap:12px;padding:14px 0 10px}.dl-group-head b{font-size:15px;font-weight:500}.dl-group-ic{width:32px;height:32px;border-radius:10px;background:var(--dl-soft);color:var(--dl-fg-muted);display:inline-flex;align-items:center;justify-content:center;flex:none}.dl-group-ic .dl-icon-wrap{display:inline-flex}.dl-group-ic .dl-icon{width:16px;height:16px}.dl-group-body>*{padding:12px 0;margin:0!important}.dl-group-body>*+*:not(.alert-message):not(.dl-params):not(.dl-note){border-top:1px solid var(--dl-line)}.dl-group-body>.alert-message,.dl-group-body>.dl-params{margin:12px 0!important}.dl-group-body>.alert-message{padding:10px 14px}.dl-group-body>.dl-params{padding:0}.dl-group-body>.dl-note{margin:0 0 14px!important;padding:10px 12px}.dl-group-body>.alert-message+*,.dl-group-body>.dl-params+*,.dl-group-body>.dl-note+*{border-top:0}.dl-group-body>.dl-row{border-left:0;border-right:0;border-bottom:0;padding-left:0;padding-right:0;background:none}.dl-group-body>.dl-row:first-child{border-top:0}.dl-setsec-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px;padding:12px 20px;border-top:1px solid var(--dl-line);background:var(--dl-soft)}.dl-setsec.danger{border-color:color-mix(in srgb,var(--dl-bad) 40%,transparent)}.dl-setsec.danger .dl-setsec-foot{background:color-mix(in srgb,var(--dl-bad) 6%,transparent)}.dl-setrow{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,420px);align-items:center;gap:8px 24px}.dl-setrow.head{display:flex;justify-content:space-between;gap:16px}.dl-setrow-label{font-size:14px;font-weight:500}.dl-setrow-ctl{display:flex;justify-content:flex-end;min-width:0}.dl-setrow-ctl .dl-chips-row{justify-content:flex-end}.dl-setrow-ctl>input{width:100%}.dl-hostport{display:flex;align-items:center;gap:8px;flex:1;min-width:0;justify-content:flex-end}.dl-hostport input{flex:1;min-width:0}.dl-root input.dl-w-port,.dl-hostport input.dl-w-port{flex:0 0 90px;width:90px}.dl-root input.dl-w-range{flex:0 0 130px;width:130px}.dl-setrow .dl-sub.bad{color:var(--dl-bad)}.dl-suffixed{display:inline-flex;align-items:center;gap:6px}.dl-suffixed>span{color:var(--dl-fg-muted)}.dl-more summary{cursor:pointer;color:var(--dl-fg-muted);font-size:13px;margin-bottom:10px}.dl-more .dl-setrow+.dl-setrow{margin-top:10px}@media(max-width:760px){.dl-setrow:not(.head){grid-template-columns:minmax(0,1fr)}.dl-setrow-ctl,.dl-setrow-ctl .dl-chips-row{justify-content:flex-start}}.dl-need-ic{width:30px;height:30px;border-radius:9px;background:var(--dl-soft);color:var(--dl-fg-muted);display:inline-flex;align-items:center;justify-content:center;flex:none}.dl-need-ic .dl-icon-wrap{display:inline-flex}.dl-need-ic .dl-icon{width:15px;height:15px}.dl-need-row.bad .dl-need-ic,.dl-need-ic.bad{background:var(--dl-bad-wash);color:var(--dl-bad)}.dl-need-row.warn .dl-need-ic,.dl-need-ic.warn{background:var(--dl-warn-wash);color:var(--dl-warn)}.dl-need-ic.ok{background:var(--dl-ok-wash);color:var(--dl-ok)}.dl-lh-main{display:flex;align-items:flex-start;gap:12px;min-width:0}.dl-lh-main>.dl-need-ic{margin-top:1px}.dl-sub .dl-mono{font-size:.92em}.dl-need-row>.cbi-button{flex:none}.dl-bk-row .dl-group-ic{width:30px;height:30px}.dl-bk-older>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;padding:11px 16px;border-top:1px solid var(--dl-line);font-size:13px;color:var(--dl-fg-muted);user-select:none}.dl-bk-older>summary::-webkit-details-marker{display:none}.dl-bk-older>summary:hover{background:var(--dl-soft);color:var(--dl-fg)}.dl-bk-older>summary .dl-icon-wrap{display:inline-flex;transition:transform .15s}.dl-bk-older>summary .dl-icon{width:14px;height:14px}.dl-bk-older[open]>summary .dl-icon-wrap{transform:rotate(90deg)}#dl-set-backups .dl-setsec-head h3+.dl-sub{margin-top:2px}#dl-set-backups .dl-setsec-foot>.dl-sub{flex:1 1 260px}.dl-bk-actions{flex:0 1 auto;justify-content:flex-end}@media(max-width:640px){#dl-set-backups .dl-setsec-foot>.dl-sub{flex-basis:100%}.dl-bk-actions{justify-content:flex-start}}.dl-upd{display:flex;flex-direction:column;gap:16px}.dl-upd>.dl-pagehead{margin:0 0 4px}.dl-upd-bad{color:var(--dl-bad)}";var ma=".dl-comp-hero{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}.dl-comp-hero-main{padding:20px;display:flex;flex-direction:column;gap:12px;min-width:0}.dl-comp-hero-side{padding:20px;border-left:1px solid var(--dl-line);display:flex;flex-direction:column;gap:14px;min-width:0}.dl-comp-name{font-size:16px;font-weight:500}.dl-comp-hero-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}.dl-comp-hero-head .dl-spacer{flex:1}.dl-comp-big{font-family:var(--dl-mono);font-size:26px;line-height:34px;letter-spacing:-.02em;display:flex;align-items:baseline;gap:10px}.dl-comp-big small{font-size:14px;color:var(--dl-accent)}.dl-comp-big small.dl-faint{color:var(--dl-fg-faint)}.dl-comp-verrow{display:flex;align-items:center;gap:4px 12px;flex-wrap:wrap;min-width:0}.dl-comp-verrow .dl-spacer{flex:1}.dl-comp-meta{font-size:13px}.dl-comp-bullets{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:4px;color:var(--dl-fg-muted);font-size:13px}.dl-comp-bullets li{list-style:disc}.dl-comp-lead{margin:0}.dl-comp-more{align-self:flex-start;font-size:12px;color:var(--dl-fg-faint);margin-left:18px;padding:0!important}.dl-comp-more:hover{color:var(--dl-accent);background:none!important;text-decoration:underline;text-underline-offset:2px}.dl-comp-hero-main>.dl-comp-vers{margin-top:auto}.dl-comp-btns{display:flex;gap:8px;flex-wrap:nowrap;align-items:center;flex:none}.dl-comp-side-v{display:flex;align-items:center;gap:8px;font-size:14px;min-width:0;flex-wrap:wrap}.dl-comp-side-v .dl-icon{width:15px;height:15px;color:var(--dl-fg-muted)}.dl-comp-side-v a{color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-comp-side-v a:hover{color:var(--dl-accent)}.dl-comp-cols{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:16px;align-items:start}.dl-comp-cols>.dl-panel>div>.dl-row:first-child{border-top:1px solid var(--dl-line)}.dl-comp-count{font-size:13px}.dl-comp-sub{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-comp-ic{display:inline-flex;gap:4px;flex:none}.dl-comp-ic .cbi-button{width:30px;height:30px;padding:0!important;justify-content:center;border-radius:999px!important}.dl-comp-ic .dl-btn-label{display:none}.dl-comp-ic .dl-icon{width:14px;height:14px}.dl-comp-ic .is-busy{pointer-events:none;opacity:.5}.dl-comp-ic .cbi-button.dl-comp-check{width:auto;padding:0 12px 0 10px!important;gap:6px;display:inline-flex;align-items:center;font-size:13px}.dl-row>.dl-pill,.dl-row>.cbi-button,.dl-row>.dl-comp-ic{flex:none}button.dl-pill.dl-comp-run{all:unset;display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:999px;font-size:12px;cursor:pointer;background:color-mix(in srgb,var(--dl-accent) 14%,transparent);color:var(--dl-accent)}.dl-comp-foldwrap{padding:0 16px 14px 60px}.dl-comp-fold .dl-params-body{gap:12px}.dl-comp-fold .dl-list>.dl-row{padding:10px 14px}.dl-comp-bver{font-size:12px;width:130px;text-align:right;flex:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-comp-bact{width:84px;flex:none;display:flex;justify-content:flex-end}.dl-comp-warn{display:flex;align-items:flex-start;gap:8px;font-size:12px;line-height:18px;color:var(--dl-fg-muted)}.dl-comp-warn .dl-icon-wrap{display:inline-flex;flex:none;margin-top:2px}.dl-comp-warn .dl-icon{width:14px;height:14px;color:var(--dl-warn)}.dl-comp-empty{margin:0;padding:4px 16px 16px}@media(max-width:760px){.dl-comp-hero,.dl-comp-cols{grid-template-columns:minmax(0,1fr)}.dl-comp-hero-side{border-left:0;border-top:1px solid var(--dl-line)}.dl-comp-foldwrap{padding-left:16px}.dl-comp-bver{display:none}}.dl-comp-status{display:flex;align-items:center;gap:8px;font-size:13px;padding:9px 12px;border-radius:10px;background:var(--dl-soft);min-width:0}.dl-comp-status>.dl-icon-wrap{display:inline-flex;flex:none}.dl-comp-status .dl-icon{width:15px;height:15px}.dl-comp-status.ok{background:var(--dl-ok-wash);color:var(--dl-ok)}.dl-comp-status.acc{background:color-mix(in srgb,var(--dl-accent) 12%,transparent);color:var(--dl-accent)}.dl-comp-status.warn{background:var(--dl-warn-wash);color:var(--dl-warn)}.dl-comp-status.bad{background:var(--dl-bad-wash);color:var(--dl-bad)}.dl-comp-status b{font-weight:600}.dl-comp-vers .dl-params-body{gap:0;padding:4px 14px 12px}.dl-comp-tag{display:flex;gap:6px;padding:6px 0 10px}.dl-comp-tag input{flex:1;min-width:0}.dl-comp-ver{display:flex;align-items:center;gap:8px;padding:7px 0;border-top:1px solid var(--dl-line);font-size:13px}.dl-comp-ver .dl-mono{min-width:52px}.dl-comp-ver .dl-sub{flex:1}.dl-comp-ver .cbi-button:not(.dl-icon-btn){height:26px!important;font-size:12px!important}.dl-comp-pager{display:flex;align-items:center;justify-content:space-between;padding-top:10px;border-top:1px solid var(--dl-line);font-size:12px}.dl-comp-pager .dl-linkbtn[disabled]{opacity:.4;cursor:default}.dl-comp-vers .dl-loading,.dl-comp-vers .dl-params-body>p{padding:6px 0 10px}.dl-op-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:14px}.dl-op-head .dl-spacer{flex:1}.dl-op-timer{display:inline-flex;align-items:center;gap:5px;font-variant-numeric:tabular-nums}.dl-op-timer .dl-icon,.dl-op-head .dl-linkbtn .dl-icon{width:14px;height:14px}.dl-op-loghead{display:flex;align-items:center;justify-content:space-between}.dl-op-loghead b{font-weight:500;font-size:13px}.dl-op .dl-log{max-height:16em;min-height:12em;margin-top:8px}.dl-op .dl-comp-status{margin:14px 0 0}.dl-op-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;width:100%}.dl-notes{max-height:55vh;overflow:auto;border-radius:12px;background:var(--dl-soft);padding:14px 16px;font-size:13px;line-height:20px;overflow-wrap:anywhere}.dl-notes h5{margin:10px 0 6px;font-size:14px;font-weight:500}.dl-notes h5:first-child{margin-top:0}.dl-notes p{margin:0 0 8px}.dl-notes ul{margin:0 0 10px;padding-left:18px}.dl-notes li{list-style:disc}.dl-notes code{font-family:var(--dl-mono);font-size:12px;padding:1px 5px;border-radius:6px;background:var(--dl-soft-hover)}.dl-notes pre{font-family:var(--dl-mono);font-size:12px;padding:10px;border-radius:8px;background:var(--dl-soft-hover);white-space:pre-wrap;margin:0 0 10px}.dl-notes a{color:var(--dl-accent)}";var ha=".dl-chip.static{cursor:default}.dl-chip.static:hover{background:var(--dl-soft)}.dl-chip.static .dl-chip-name{font-weight:500}.dl-setrow.head .dl-chips-row,.dl-setrow.head .dl-note{margin-top:8px}.dl-setrow.head .dl-note{margin-bottom:0}.dl-setrow.head>.dl-lh-main,.dl-setrow.head>.dl-lh-main>.dl-stack{flex:1 1 auto;min-width:0}.dl-setrow.head>.dl-setrow-ctl:empty{display:none}.dl-setrow.head:has(>.dl-lh-main){align-items:flex-start}.dl-setrow.head>.dl-setrow-ctl{align-items:center;min-height:30px}.dl-netpick{margin-top:10px}.dl-boxrow{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0;padding:10px 14px;border:1px solid var(--dl-line);border-radius:12px;font-size:13px;cursor:pointer}.dl-boxrow>.dl-switch{flex:none}.dl-ifpick{display:flex;flex-direction:column;gap:12px;padding:14px;border:1px solid var(--dl-line);border-radius:14px}.dl-iflead-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.dl-host{align-items:flex-start}.dl-host>.dl-icon-wrap{margin-top:13px}.dl-host-body{flex:1;min-width:0;display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}.dl-host-body>.dl-row-main{flex:1 1 160px}.dl-circle-dot{display:inline-block;width:8px;height:8px;border-radius:50%;flex:none}.dl-circles .dl-chip b{font-weight:500}.dl-circle-name{display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:500}.dl-w400{font-weight:400}.dl-swatches{display:flex;flex-wrap:wrap;gap:8px}.dl-swatch{all:unset;cursor:pointer;width:22px;height:22px;border-radius:50%;background:var(--sw);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--dl-fg) 12%,transparent)}.dl-swatch.on{box-shadow:0 0 0 2px var(--dl-card),0 0 0 4px var(--sw)}.dl-swatch:focus-visible{outline:2px solid var(--dl-ring);outline-offset:3px}.dl-circle-modal .dl-chipbtn b{margin-left:6px;font-weight:500;font-size:11px;opacity:.6}.dl-reach td:first-child b{font-weight:500}.dl-ev-host{white-space:nowrap}.dl-ev-host b{font-weight:500;color:var(--dl-fg)}.dl-reach{font-size:13px}.dl-reach th,.dl-reach td{white-space:nowrap;padding-left:6px;padding-right:6px}.dl-reach-wrap{overflow-x:auto}.dl-yes{display:inline-flex;align-items:center;gap:4px;color:var(--dl-ok)}.dl-yes .dl-icon-wrap{display:inline-flex}.dl-yes .dl-icon{width:14px;height:14px}.dl-check-form{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto;align-items:start;gap:8px}.dl-check-form>.dl-faint{line-height:36px}.dl-check-end{display:flex;flex-direction:column;gap:6px;min-width:0}.dl-check-end>*{width:100%!important;min-width:0}@media(max-width:560px){.dl-check-form{grid-template-columns:minmax(0,1fr)}.dl-check-form>.dl-faint{display:none}}.dl-verdict{display:flex;align-items:baseline;gap:10px;padding:10px 12px;border-radius:12px}.dl-verdict b{font-weight:500}.dl-verdict.ok{background:var(--dl-ok-wash)}.dl-verdict.ok b{color:var(--dl-ok)}.dl-verdict.bad{background:var(--dl-bad-wash)}.dl-verdict.bad b{color:var(--dl-bad)}.dl-corehead{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 4px}.dl-corehead h3{margin:0!important}.dl-row-end{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.dl-dcard.clickable{cursor:pointer}.dl-dcard.clickable:hover{border-color:color-mix(in srgb,var(--dl-fg) 22%,transparent)}";var Vd=[ea,ta,na,oa,sa,ra,ia,aa,la,da,ca,pa,ua,ma,ha].join(` -`);function fa(){let t=document.createElement("style");return t.dataset.dawnline="1",t.textContent=Vd,t}function Lt(t){return()=>{let e=new t;return Object.assign({load:()=>e.load(),render:async s=>{let r=await e.render(s),i=document.createElement("div");return i.className="dl-root",i.append(fa(),r),i},addFooter(){return e.noFooter?document.createElement("div"):this.super("addFooter",[])}},{handleSave:null,handleSaveApply:null,handleReset:null})}}var ux=Lt(un),mx=Lt(Ct),hx=Lt(un),fx=Lt(Qn),gx=Lt(no),vx=Lt(io),bx=Lt(to);function ga(t){return()=>({load:()=>(ui.menu?.flushCache(),location.replace(`${L.url("admin/network/dawnline/diagnostics")}${t?`?tab=${t}`:""}`),new Promise(()=>{})),render:()=>document.createElement("div"),handleSave:null,handleSaveApply:null,handleReset:null})}var xx=ga(""),wx=ga("log");return baseclass.extend({ activity: wx, diagnostics: vx, health: xx, overview: ux, people: mx, person: gx, server: hx, settings: fx, updates: bx }); diff --git a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/LICENSE.txt b/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/LICENSE.txt deleted file mode 100644 index 3e44e16..0000000 --- a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/LICENSE.txt +++ /dev/null @@ -1,3 +0,0 @@ -Geist and Geist Mono are licensed under the SIL Open Font License, Version 1.1. -Copyright (c) 2023 Vercel, in collaboration with basement.studio. -https://github.com/vercel/geist-font/blob/main/OFL.txt diff --git a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/geist-cyrillic-wght-normal.woff2 b/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/geist-cyrillic-wght-normal.woff2 deleted file mode 100644 index 4b7a2be..0000000 Binary files a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/geist-cyrillic-wght-normal.woff2 and /dev/null differ diff --git a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/geist-latin-wght-normal.woff2 b/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/geist-latin-wght-normal.woff2 deleted file mode 100644 index 991445d..0000000 Binary files a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/geist-latin-wght-normal.woff2 and /dev/null differ diff --git a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/geist-mono-latin-wght-normal.woff2 b/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/geist-mono-latin-wght-normal.woff2 deleted file mode 100644 index 0750682..0000000 Binary files a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/geist-mono-latin-wght-normal.woff2 and /dev/null differ diff --git a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/icon.svg b/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/icon.svg deleted file mode 100644 index 2bb9132..0000000 --- a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/icon.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/portal.css b/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/portal.css deleted file mode 100644 index 095925d..0000000 --- a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/portal.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:Geist;src:url(geist-latin-wght-normal.woff2) format("woff2");font-weight:100 900;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2190-21FF,U+2212,U+2215}@font-face{font-family:Geist;src:url(geist-cyrillic-wght-normal.woff2) format("woff2");font-weight:100 900;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Geist Mono;src:url(geist-mono-latin-wght-normal.woff2) format("woff2");font-weight:100 900;font-display:swap}:root{color-scheme:dark;--bg: #080808;--raised: #121212;--field: #161616;--knob: #232323;--seg: rgba(237, 237, 237, .05);--seg-shadow: none;--line: rgba(255, 255, 255, .06);--text: #ededed;--text-2: #8c8c8a;--text-3: #4f4f4e;--accent: #4eafff;--accent-ink: #ffffff;--accent-soft: rgba(78, 175, 255, .13);--ok: #30d158;--ok-soft: rgba(48, 209, 88, .14);--warn: #ff8d28;--bad: #ff383c;--bad-soft: rgba(255, 56, 60, .13);--sel-bg: rgba(131, 209, 255, .25);--sel-fg: #64c6ff;--scrim: rgba(8, 8, 8, .8);--glass-bg: linear-gradient(rgba(255, 255, 255, .04), rgba(255, 255, 255, .04)), rgba(0, 0, 0, .4);--glass-edge: rgba(255, 255, 255, .05);--glass-sep: rgba(255, 255, 255, .04);--glass-text: #f5f5f5;--glass-sub: #8a8a8a;--glass-bad: var(--bad);--glass-hl: color-mix(in srgb, var(--raised), var(--text) 8%);--glass-hover: color-mix(in srgb, var(--raised), var(--text) 5%);--glass-shadow: 0 0 0 transparent;--line-glass: rgba(255, 255, 255, .07);--pop-shadow: 0 18px 48px -14px rgba(0, 0, 0, .75);--sheet-shadow: 0 24px 64px -16px rgba(0, 0, 0, .6);--bar: rgba(237, 237, 237, .13);--toast: #232323;--toast-fg: #ededed;--qr-bg: #0a0a0a;--gi-a: rgba(255, 255, 255, .58);--gi-b: rgba(255, 255, 255, .14);--gi-rim: rgba(255, 255, 255, .5);--gi-edge: rgba(0, 0, 0, 0);--gi-detail: #ffffff;--t-grey-a: #cfcfcd;--t-grey-b: #5a5a59;--t-blue-a: #a6d9ff;--t-blue-b: #1d84e6;--t-green-a: #a8f29c;--t-green-b: #30d158;--t-red-a: #ffadad;--t-red-b: #ff383c;--t-orange-a: #ffc08f;--t-orange-b: #ff8d28;--font: Geist, -apple-system, system-ui, "Segoe UI", sans-serif;--mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;--r-sheet: 36px;--r-card: 28px;--r-row: 20px;--r-field: 16px;--r-tile: 12px;--ease-out: cubic-bezier(.23, 1, .32, 1);--gutter-l: max(16px, env(safe-area-inset-left, 0px));--gutter-r: max(16px, env(safe-area-inset-right, 0px))}@media(prefers-color-scheme:light){:root{color-scheme:light;--bg: #f2f2f1;--raised: #ffffff;--field: #f3f3f2;--knob: #e8e8e7;--seg: #ffffff;--seg-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 .5px rgba(0, 0, 0, .05);--line: rgba(0, 0, 0, .07);--text: #0b0b0b;--text-2: #6d6d6b;--text-3: #a6a6a4;--accent: #2b9dff;--accent-soft: rgba(43, 157, 255, .12);--ok: #30d158;--ok-soft: rgba(48, 209, 88, .12);--warn: #ff8d28;--bad: #ff383c;--bad-soft: rgba(255, 56, 60, .1);--sel-bg: rgba(78, 175, 255, .22);--sel-fg: #0a76cf;--scrim: rgba(236, 236, 235, .62);--glass-bg: rgba(245, 245, 245, .6);--glass-edge: rgba(0, 0, 0, .04);--glass-sep: rgba(0, 0, 0, .03);--glass-text: #1a1a1a;--glass-sub: #727272;--glass-hl: color-mix(in srgb, var(--raised), var(--text) 11%);--glass-hover: color-mix(in srgb, var(--raised), var(--text) 4%);--glass-shadow: 0 8px 32px rgba(0, 0, 0, .12);--line-glass: rgba(0, 0, 0, .07);--pop-shadow: 0 18px 44px -14px rgba(0, 0, 0, .2);--sheet-shadow: 0 24px 64px -18px rgba(0, 0, 0, .22);--bar: rgba(11, 11, 11, .11);--toast: #0b0b0b;--toast-fg: #f2f2f1;--qr-bg: #ffffff;--gi-a: rgba(250, 250, 249, .72);--gi-b: rgba(206, 206, 204, .5);--gi-rim: rgba(255, 255, 255, .9);--gi-edge: rgba(0, 0, 0, .11);--gi-detail: rgba(28, 28, 28, .72);--t-grey-a: #a9a9a7;--t-grey-b: #3d3d3c;--t-blue-a: #7cc4ff;--t-blue-b: #0a6fd6;--t-green-a: #82e070;--t-green-b: #30d158;--t-red-a: #ff9090;--t-red-b: #ff383c}}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%;scrollbar-gutter:stable;overflow-anchor:none;touch-action:manipulation}body{margin:0;background:var(--bg);color:var(--text);font:400 15px/22px var(--font);letter-spacing:-.011em;-webkit-font-smoothing:antialiased;min-height:100vh;min-height:100dvh;cursor:default}body.locked{overflow:hidden}input,textarea,.linkrow .mono,.conf{cursor:text}::selection{background:var(--sel-bg);color:var(--sel-fg)}button{font:inherit;color:inherit;letter-spacing:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{cursor:default}a{color:inherit;text-decoration:none}:focus{outline:none}.kbd :focus-visible{outline:2px solid color-mix(in srgb,var(--accent) 65%,transparent);outline-offset:2px}[hidden]{display:none!important}.offscreen{position:fixed;left:-9999px;top:0;opacity:0}.mono{font-family:var(--mono);letter-spacing:0}.num{font-variant-numeric:tabular-nums}.ok-t{color:var(--ok)}.warn-t{color:var(--warn)}.bad-t{color:var(--bad)}.here-t{color:var(--accent)}.i{width:18px;height:18px;flex:none}.gi{width:24px;height:24px;flex:none;overflow:visible;--ta: var(--t-grey-a);--tb: var(--t-grey-b)}.gi.t-blue{--ta: var(--t-blue-a);--tb: var(--t-blue-b)}.gi.t-green{--ta: var(--t-green-a);--tb: var(--t-green-b)}.gi.t-red{--ta: var(--t-red-a);--tb: var(--t-red-b)}.gi.t-orange{--ta: var(--t-orange-a);--tb: var(--t-orange-b)}.gi .ta{stop-color:var(--ta)}.gi .tb{stop-color:var(--tb)}.gi .fa{stop-color:var(--gi-a)}.gi .fb{stop-color:var(--gi-b)}.gi .fc{stop-color:var(--ta);stop-opacity:.28}.gi .ge{stroke:var(--gi-edge)}.gi .gr{stroke:var(--gi-rim)}.gi .gd{stroke:var(--gi-detail)}.gi .gdf{color:var(--gi-detail)}.knob{width:32px;height:32px;border-radius:50%;background:var(--knob);color:var(--text);display:grid;place-items:center;flex:none;transition:transform .15s var(--ease-out),background-color .15s}.knob:hover{background:color-mix(in srgb,var(--knob),var(--text) 6%)}.knob:active{transform:scale(.8)}.knob .i{width:16px;height:16px}.knob.back .i{transform:rotate(180deg)}.knob[aria-expanded=true]{background:color-mix(in srgb,var(--knob),var(--text) 10%)}.btn{height:48px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 20px;font-size:16px;font-weight:500;letter-spacing:-.015em;user-select:none;-webkit-user-select:none;transition:transform .2s var(--ease-out),background-color .2s var(--ease-out),color .2s var(--ease-out)}.btn:active{transform:scale(.95)}.btn.block{width:100%}.btn.sm{height:40px;font-size:15px;padding:0 16px}.btn.accent{background:var(--accent);color:var(--accent-ink);font-weight:600}.btn.accent:hover{background:color-mix(in srgb,var(--accent) 82%,transparent)}.btn.tint{background:var(--accent-soft);color:var(--accent);font-weight:600}.btn.tint:hover{background:color-mix(in srgb,var(--accent) 20%,transparent)}.btn.tint:active{background:color-mix(in srgb,var(--accent) 24%,transparent)}.btn.soft{background:var(--knob);color:var(--text)}.btn.soft:hover{background:color-mix(in srgb,var(--knob),var(--text) 6%)}.btn.red{background:var(--bad);color:#fff;font-weight:600}.busy{position:relative}.orb{position:absolute;inset:0;margin:auto;width:28px;height:28px;overflow:hidden;contain:strict;pointer-events:none}.orb i{position:absolute;left:50%;top:50%;width:7px;height:7px;margin:-3.5px 0 0 -3.5px;border-radius:50%;background:currentColor;animation:orb-converge 1.8s linear infinite both}.orb i:nth-child(2){animation:orb-breathe 1.8s ease-in-out infinite both}@keyframes orb-converge{0%{transform:translateY(-5px) scale(1);filter:blur(0);animation-timing-function:linear}10%{transform:translateY(-5px) scale(1);filter:blur(0);animation-timing-function:cubic-bezier(.55,0,1,.45)}22%{transform:translate(2.15px,-1.25px) scale(.72);filter:blur(.8px);animation-timing-function:cubic-bezier(.33,1,.68,1)}33%{transform:translate(4.3px,2.5px) scale(1);filter:blur(0);animation-timing-function:linear}43%{transform:translate(4.3px,2.5px) scale(1);filter:blur(0);animation-timing-function:cubic-bezier(.55,0,1,.45)}55%{transform:translateY(2.5px) scale(.72);filter:blur(.8px);animation-timing-function:cubic-bezier(.33,1,.68,1)}66%{transform:translate(-4.3px,2.5px) scale(1);filter:blur(0);animation-timing-function:linear}77%{transform:translate(-4.3px,2.5px) scale(1);filter:blur(0);animation-timing-function:cubic-bezier(.55,0,1,.45)}88%{transform:translate(-2.15px,-1.25px) scale(.72);filter:blur(.8px);animation-timing-function:cubic-bezier(.33,1,.68,1)}to{transform:translateY(-5px) scale(1);filter:blur(0)}}@keyframes orb-breathe{0%,to{opacity:.16;filter:blur(2.4px);transform:scale(1.2)}50%{opacity:.32;filter:blur(1.6px);transform:scale(.98)}}.field{height:48px;border-radius:var(--r-field);background:var(--field);display:flex;align-items:center;gap:12px;padding:0 4px 0 16px;overflow:hidden;transition:box-shadow var(--spring-smooth-dur, 524ms) var(--spring-smooth, ease)}.field:focus-within{box-shadow:inset 0 0 0 1.5px color-mix(in srgb,var(--text) 16%,transparent)}.field input{flex:1;min-width:0;border:0;outline:0;background:transparent;padding:0;font:500 16px/24px var(--font);color:var(--text);letter-spacing:-.012em}.field input{caret-color:var(--accent)}.field input::placeholder{color:var(--text-3)}.go{width:48px;height:40px;border-radius:12px;background:var(--knob);color:var(--text-3);display:grid;place-items:center;flex:none;transition:background-color var(--spring-smooth-dur, 524ms) var(--spring-smooth, ease),color var(--spring-smooth-dur, 524ms) var(--spring-smooth, ease),transform .2s var(--ease-out)}.go .i{width:20px;height:20px}.go.ready{background:var(--accent);color:var(--accent-ink)}.go.ready:active{transform:scale(.9)}.go:not(.ready){cursor:not-allowed}.field.own-caret{position:relative}.field.own-caret input{caret-color:transparent}.caret{position:absolute;left:0;top:50%;width:2px;height:20px;margin-top:-10px;border-radius:1px;background:var(--accent);pointer-events:none;opacity:0;transition:opacity .1s linear;will-change:transform}.caret.on{opacity:1}.caret.on.blink{animation:caret-blink 1.2s ease-in-out infinite}@keyframes caret-blink{0%,38%{opacity:1}50%,88%{opacity:0}to{opacity:1}}.caret-mirror{position:absolute;left:-9999px;top:0;visibility:hidden;white-space:pre}.field.own-sel input{position:relative;z-index:1}.field.own-sel input::selection{background:transparent;color:var(--text)}.caret-sel{position:absolute;left:0;top:50%;height:22px;margin-top:-11px;border-radius:4px;background:color-mix(in srgb,var(--accent) 26%,transparent);pointer-events:none;opacity:0;transition:opacity .14s linear}.caret-hd{position:absolute;z-index:2;left:0;top:50%;width:2px;height:22px;margin-top:-11px;border-radius:1px;background:var(--accent);pointer-events:none;opacity:0;transition:opacity .14s linear}.caret-hd:after{content:"";position:absolute;left:50%;width:9px;height:9px;margin-left:-4.5px;border-radius:50%;background:var(--accent)}.caret-hd.s:after{top:-7px}.caret-hd.e:after{bottom:-7px}.field.selecting .caret-sel,.field.selecting .caret-hd{opacity:1}.field.saving input{color:transparent}.field.saving .caret{opacity:0!important;animation:none!important}.shim-clip{position:absolute;z-index:2;overflow:hidden;pointer-events:none}.shim{--shim-high: var(--text);--shim-base: color-mix(in oklab, var(--text) 38%, var(--raised));position:absolute;top:0;white-space:pre;-webkit-background-clip:text;background-clip:text;color:transparent}.seg{position:relative;display:flex;align-items:center;height:48px;padding:0 4px;border-radius:var(--r-field);background:var(--field)}.seg-pill{position:absolute;left:0;top:4px;height:40px;border-radius:12px;background:var(--seg);box-shadow:var(--seg-shadow);pointer-events:none}.seg-b{position:relative;z-index:1;height:40px;font-size:16px;font-weight:500;color:var(--text-3);white-space:nowrap;transition:color .2s var(--ease-out)}.seg-b.on{color:var(--text)}.seg-b:not(.on):hover{color:var(--text-2)}.appseg .seg-b{flex:0 0 56px;display:flex;align-items:center;justify-content:center;justify-content:safe center;gap:8px;padding:0 18px;overflow:hidden}.appseg .seg-b.on{flex:1 1 56px}.appseg{--b: 56px}.appseg .seg-pill{left:calc(4px + var(--i, 0) * var(--b));right:calc(4px + (var(--n, 1) - 1 - var(--i, 0)) * var(--b))}.appseg .seg-b .i{width:20px;height:20px}.appseg .seg-l{max-width:0;opacity:0;margin-left:-8px;overflow:hidden;white-space:nowrap}.appseg .seg-b.on .seg-l{max-width:180px;opacity:1;margin-left:0}.appseg{container-type:inline-size}@container (max-width: 300px){.appseg{--b: 44px}.appseg .seg-b{flex-basis:44px;padding:0 12px}}.kinds{display:grid;grid-template-columns:repeat(var(--n, 4),minmax(0,1fr));gap:8px;position:relative;container-type:inline-size}.kind{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0;color:var(--text-3);font-size:12px;line-height:16px;font-weight:500;transition:color .2s var(--ease-out)}.kind-tile{width:100%;height:56px;border-radius:14px;background:var(--field);display:grid;place-items:center;transition:background-color .2s var(--ease-out),transform .2s var(--ease-out),box-shadow .22s var(--ease-out)}.kind.on .kind-tile{box-shadow:inset 0 0 0 1.5px var(--accent)}.kind-lbl{white-space:nowrap}.kind:hover .kind-tile,.kbd .kind:focus-visible .kind-tile{background:var(--knob)}.kind:active .kind-tile{transform:scale(.94)}.kind:focus-visible{outline:none}.kbd .kind:focus-visible .kind-lbl,.kind.on{color:var(--text)}.kind .gi{width:26px;height:26px;filter:grayscale(1);opacity:.55;transition:filter .26s var(--ease-out),opacity .26s var(--ease-out)}.kind.on .gi{filter:none;opacity:1}@container (max-width: 330px){.kind-tile{height:50px}.kind{font-size:11.5px}}.swrow{width:100%;display:flex;align-items:center;gap:12px;padding:12px 12px 12px 14px;border-radius:16px;background:var(--field);color:var(--text);text-align:left;user-select:none;-webkit-user-select:none;transition:background-color .2s}.swrow:hover{background:color-mix(in srgb,var(--field),var(--knob) 50%)}.kinds+.swrow{margin:16px 0 12px}.swrow .gi{width:28px;height:28px;flex:none;transition:filter var(--spring-smooth-dur, 524ms) var(--spring-smooth, ease),opacity var(--spring-smooth-dur, 524ms) var(--spring-smooth, ease)}.swrow:not(.on) .gi{filter:grayscale(1);opacity:.55}.sw-t{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.sw-t b{font-size:15px;line-height:22px;font-weight:500;letter-spacing:-.015em}.sw-sub{font-size:13px;line-height:18px;color:var(--text-2)}.sw{position:relative;flex:none;width:44px;height:26px;border-radius:999px;background:var(--knob);transition:background-color var(--spring-smooth-dur, 524ms) var(--spring-smooth, ease)}.sw:after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:10px;background:var(--text-2);transition:transform var(--spring-smooth-dur, 524ms) var(--spring-smooth, ease),width var(--spring-smooth-dur, 524ms) var(--spring-smooth, ease),background-color var(--spring-smooth-dur, 524ms) var(--spring-smooth, ease)}.swrow.on .sw{background:var(--accent)}.swrow.on .sw:after{transform:translate(18px);background:var(--accent-ink)}.swrow:active .sw:after{width:27px}.swrow.on:active .sw:after{transform:translate(11px)}.or{display:flex;align-items:center;gap:12px;margin:22px 0;color:var(--text-3);font-size:12px;font-weight:500;letter-spacing:.06em}.or:before,.or:after{content:"";flex:1;height:1px;background:var(--line)}.badge{width:100%;text-align:left;display:flex;align-items:center;gap:12px;height:60px;padding:0 14px 0 12px;border-radius:18px;background:var(--field);transition:background-color .2s,transform .2s var(--ease-out)}.badge:hover{background:var(--knob)}.badge:active{transform:scale(.98)}.badge .b-ic{width:36px;height:36px;border-radius:10px;background:var(--text);color:var(--raised);display:grid;place-items:center;flex:none}.badge .b-ic .i{width:20px;height:20px}.badge .b-t{flex:1;min-width:0;display:flex;flex-direction:column}.badge .b-top{font-size:12px;line-height:16px;color:var(--text-2)}.badge .b-main{font-size:15px;line-height:20px;font-weight:500}.badge>.i{color:var(--text-3);width:16px;height:16px}.badge.primary .b-ic{background:var(--accent-soft);color:var(--accent)}.badges2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.badges2 .badge{padding:0 10px;gap:10px}.badges2 .badge>.i{display:none}.badges2 .b-ic{width:32px;height:32px}.hint{margin:0;font-size:13px;line-height:18px;color:var(--text-2)}.hint.bad-t{color:var(--bad)}.hint a,.hint button{color:var(--accent);font-weight:500}.howto{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:13px;color:var(--text-2)}.howto li{display:inline-flex;align-items:center;gap:6px}.howto li+li:before{content:"\203a";color:var(--text-3)}.howto b{color:var(--text);font-weight:500}.linkrow{display:flex;align-items:center;gap:8px;height:44px;padding:0 4px 0 14px;border-radius:14px;background:color-mix(in srgb,var(--knob) 72%,var(--field))}.view>.linkrow{background:var(--field)}.linkrow .mono{flex:1;min-width:0;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;user-select:all}.linkrow .knob{width:36px;height:36px;border-radius:10px;background:transparent}.linkrow .knob:hover{background:var(--knob)}.qrbox{position:relative;width:148px;height:148px;flex:none;border-radius:18px;overflow:hidden;background:var(--qr-bg)}.qrbox.light{box-shadow:inset 0 0 0 1px var(--line)}.qrbox.big{width:208px;height:208px;border-radius:24px;align-self:center}.qrbox.big+.linkrow{margin-top:16px}.qrbox.dense{width:100%;max-width:none;height:auto;aspect-ratio:1;align-self:stretch;border-radius:22px}.qrbox svg{display:block;width:100%;height:100%}.qrbox>svg.old{position:absolute;inset:0}.coderow{display:flex;gap:14px;align-items:flex-start}.coderow.stacked{flex-direction:column;align-items:stretch}.coderow .side{position:relative;display:flex;flex-direction:column;gap:8px;min-width:0;font-size:14px;line-height:20px;color:var(--text-2)}.coderow .side b{color:var(--text);font-weight:500}.side .words{display:flex;flex-direction:column;gap:8px}.side .words.old{position:absolute;left:0;right:0;top:0;pointer-events:none}.side .arr{color:var(--text-2);font-weight:400;margin:0 6px}@media(max-width:380px){.coderow{flex-direction:column}}@media(prefers-reduced-motion:reduce){.orb i{animation:none;opacity:.3;filter:blur(1.4px)}.orb i:first-child{opacity:1;filter:none}.caret.on.blink{animation:none}}.mt{position:relative}.mt-run{overflow:visible!important;text-overflow:clip!important}.mt-ib{display:inline-block;white-space:nowrap}.mt-new{white-space:nowrap}.mt-old{position:absolute;white-space:nowrap;pointer-events:none}.mt-new.w,.mt-old.w{white-space:inherit}.mt-new i,.mt-old i{font-style:normal;display:inline-block;white-space:pre}.bars{--gap: 3px;position:relative;display:flex;flex:none;margin-inline:calc(var(--gap) / -2)}.bars-week{--gap: 4px;transition:margin var(--fit)}.bars .col{display:flex;flex-direction:column;padding-inline:calc(var(--gap) / 2)}.bars-month .col{flex:1;min-width:0}.bars .half{display:flex;flex-direction:column}.bars .half.top{justify-content:flex-end;margin-bottom:3px}.bars i{display:block;border-radius:2.5px;transition:background-color .12s}.bars-week i{width:6px;border-radius:3px;transition:background-color .15s,width var(--fit),border-radius var(--fit)}.bars-week .col{transition:padding var(--fit)}.bars-week .axis{transition:left var(--fit),right var(--fit)}.bars .dn{background:color-mix(in srgb,var(--text) 24%,transparent)}.bars .up{background:color-mix(in srgb,var(--text) 11%,transparent)}.bars .today .dn{background:var(--accent)}.bars .today .up{background:color-mix(in srgb,var(--accent) 45%,transparent)}.bars .col:not(.future):hover .dn{background:var(--text-2)}.bars .col:not(.future):hover .up{background:color-mix(in srgb,var(--text-2) 50%,transparent)}.bars .today:hover .dn{background:color-mix(in srgb,var(--accent) 75%,var(--text))}.bars .future i{height:3px;background:color-mix(in srgb,var(--bar) 45%,transparent)}.bars .axis{position:absolute;left:calc(var(--gap) / 2);right:calc(var(--gap) / 2);height:1px;background:var(--line);pointer-events:none}.ud{display:inline-flex;flex-wrap:wrap;align-items:center;column-gap:10px;transition:column-gap var(--fit)}.ud>span{display:inline-flex;align-items:center;gap:2px;white-space:nowrap}.ud .i{width:.8em;height:.8em;stroke-width:2.2;color:var(--text-2)}.ud-dn .i{transform:rotate(90deg)}.ud-up{color:var(--text-2)}.ud-up .i{transform:rotate(-90deg);color:var(--text-3)}@media(prefers-reduced-motion:reduce){.bars-week,.bars-week .col,.bars-week .axis,.ud{transition:none}.bars-week i{transition:background-color .15s}}.acc{display:flex;flex-direction:column}.acc-row{background:var(--raised);overflow:hidden;border-radius:0;padding:0 8px;transition:background-color .15s}.acc-row.rt{border-top-left-radius:var(--r-row);border-top-right-radius:var(--r-row)}.acc-row.rb{border-bottom-left-radius:var(--r-row);border-bottom-right-radius:var(--r-row)}.acc-row.open{margin-block:10px}.acc-row.open.first{margin-top:0}.acc-row.open.last{margin-bottom:0}.acc-row:not(.open):not(.still):hover{background:color-mix(in srgb,var(--raised),var(--knob) 40%)}.acc-head{width:100%;display:flex;align-items:center;gap:10px;height:52px;padding:0 6px 0 8px;text-align:left}.acc-row.still .acc-head{cursor:default;padding-right:10px}.acc-head .gi{width:22px;height:22px}.acc-title{flex:1;min-width:0;font-size:15px;font-weight:500;letter-spacing:-.02em;display:flex;align-items:center;gap:8px}.acc-title .t{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.acc-val{display:flex;align-items:center;gap:8px;color:var(--text-2);font-size:14px;white-space:nowrap;transition:opacity .2s var(--ease-out),filter .2s var(--ease-out),transform .26s var(--ease-out)}.acc-val>span{display:inline-flex;align-items:center;gap:8px}.acc-row.open>.acc-head>.acc-val.hide-open{opacity:0;filter:blur(4px);transform:translate(8px);pointer-events:none}.acc-row.has-aside{position:relative;--aside-w: 72px}.acc-aside{position:absolute;top:0;right:40px;height:52px;display:flex;align-items:center;transition:opacity .2s var(--ease-out),filter .2s var(--ease-out),transform .2s var(--ease-out)}.acc-row:not(.open)>.acc-aside{opacity:0;filter:blur(4px);transform:translate(8px);pointer-events:none;visibility:hidden;transition-property:opacity,filter,transform,visibility}.acc-row.has-aside>.acc-head>.acc-title{transition:padding-right .2s var(--ease-out)}.acc-row.has-aside.open>.acc-head>.acc-title{padding-right:var(--aside-w)}.acc-chev{width:16px;height:16px;color:var(--text-2);transform:rotate(90deg);transition:transform var(--spring-soft-dur, .47s) var(--spring-soft, ease)}.acc-row.open>.acc-head>.acc-chev{transform:rotate(-90deg)}.acc-body{display:none;padding:0 8px 16px 40px}.acc-row.open>.acc-body,.acc-row.closing>.acc-body{display:flex;flex-direction:column;gap:12px}.acc .desc{margin:0;font-size:14px;line-height:20px;opacity:.6}.acc.inset .acc-row{background:var(--field)}.acc.inset .acc-row:not(.open):not(.still):hover{background:color-mix(in srgb,var(--field),var(--knob) 50%)}.acc.inset .acc-body{padding-left:8px}.acc.inset .seg,.acc.inset .badge{background:color-mix(in srgb,var(--knob) 65%,var(--field))}.acc.inset .badge:hover{background:var(--knob)}.acc.inset .filecard,.acc.inset .acc.inset .acc-row{background:color-mix(in srgb,var(--knob) 65%,var(--field))}.acc.inset .acc.inset .acc-row:not(.open):not(.still):hover{background:var(--knob)}.acc.inset .filecard-ic,.acc.inset .acc.inset .btn.soft{background:color-mix(in srgb,var(--knob),var(--text) 6%)}.acc.inset .acc.inset .btn.soft:hover{background:color-mix(in srgb,var(--knob),var(--text) 12%)}.acc.inset .acc.inset .conf{background:var(--knob)}@media(prefers-reduced-motion:reduce){.acc-chev{transition:none}}.edge-fade{position:fixed;left:0;right:0;z-index:30;pointer-events:none}.edge-fade.top{top:0;height:calc(80px + env(safe-area-inset-top,0px));opacity:0;transition:opacity .2s;background:linear-gradient(var(--bg) 0%,color-mix(in srgb,var(--bg) 75%,transparent) 50%,transparent 100%);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);-webkit-mask-image:linear-gradient(#000 0%,rgba(0,0,0,.88) 44%,transparent 100%);mask-image:linear-gradient(#000 0%,rgba(0,0,0,.88) 44%,transparent 100%)}@media(pointer:coarse){.edge-fade.top{-webkit-backdrop-filter:none;backdrop-filter:none}}body.scrolled .edge-fade.top{opacity:1}.edge-fade.bot{bottom:0;height:calc(96px + env(safe-area-inset-bottom,0px));background:linear-gradient(to top in oklab,var(--bg) 0%,transparent 100%)}.crumbs{display:flex;align-items:center;gap:10px;height:32px;margin:0 0 32px}.cr-mark{width:32px;height:32px;display:grid;place-items:center;flex:none}.logo{width:24px;height:24px;flex:none;overflow:hidden}.logo .sun,.logo .bar{fill:var(--text)}.cr-path{flex:1;min-width:0;display:flex;align-items:center;gap:6px;font-size:15px;line-height:22px;letter-spacing:-.15px;color:var(--text-2)}.cr-path span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cr-path .cur{color:var(--text);font-weight:500}.cr-path .i{width:14px;height:14px}.cr-lang{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 8px;border-radius:999px;background:var(--knob);color:var(--text);font-size:14px;font-weight:500;letter-spacing:-.01em;flex:none;transition:transform .15s var(--ease-out),background-color .15s}.cr-lang:hover{background:color-mix(in srgb,var(--knob),var(--text) 6%)}.cr-lang:active{transform:scale(.94)}.cr-lang[aria-expanded=true]{background:color-mix(in srgb,var(--knob),var(--text) 10%)}.cr-lang .pp-chev{margin-left:-2px}.page{max-width:1072px;margin:0 auto;padding-left:var(--gutter-l);padding-right:var(--gutter-r);padding-block:calc(40px + env(safe-area-inset-top,0px)) 112px}.cols{display:grid;gap:40px}.cols>.access{order:-1}@media(min-width:960px){.cols{grid-template-columns:minmax(0,1fr) 384px;gap:36px;align-items:start}.cols>.access{order:0;position:sticky;top:calc(84px + env(safe-area-inset-top,0px))}}.sec-head{display:flex;align-items:baseline;gap:8px;padding:0 4px 12px}.sec-head h2{margin:0;font-size:20px;line-height:28px;font-weight:500;letter-spacing:-.025em}.sec-head .aside{color:var(--text-3);font-size:14px;font-weight:500}.sec-head .aside.warn-t{color:var(--warn)}.note-s{margin:12px 4px 0;color:var(--text-3);font-size:13px;line-height:18px}.notice-slot{display:flow-root;overflow-y:clip}.notice{display:flex;align-items:center;gap:14px;padding:14px 18px 14px 14px;border-radius:24px;background:var(--raised);margin:0 0 22px}.notice .gi{width:36px;height:36px}.notice .t{display:flex;flex-direction:column;min-width:0}.notice b{font-weight:500;font-size:15px;line-height:22px;letter-spacing:-.02em}.notice span{color:var(--text-2);font-size:14px;line-height:20px}.notice.warn{background:color-mix(in srgb,var(--warn) 10%,var(--raised));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--warn) 22%,transparent)}.notice.bad{background:color-mix(in srgb,var(--bad) 10%,var(--raised));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--bad) 22%,transparent)}.page.single{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding-block:calc(24px + env(safe-area-inset-top,0px)) calc(24px + env(safe-area-inset-bottom,0px))}.page.single .crumbs{position:relative;left:12px;max-width:calc(100% - 84px);margin:0 0 16px}.page.single .cr-mark{position:absolute;right:calc(100% + 10px);top:0}.page.single .page-body{width:100%;max-width:400px}.page.single .gone{margin:0}.gone{max-width:400px;margin:12vh auto 0;padding:32px 24px 28px;border-radius:var(--r-sheet);background:var(--raised);text-align:center;display:flex;flex-direction:column;align-items:center}.gone .gi{width:56px;height:56px;margin-bottom:16px}.gone h1{margin:0;font-size:22px;line-height:28px;font-weight:500;letter-spacing:-.03em}.gone p{margin:6px 0 0;color:var(--text-2);text-wrap:balance}.pc-card{position:absolute;display:flex;flex-direction:column;gap:8px;width:244px;padding:10px;border-radius:24px}.pc-card .qrbox.big{width:224px;height:224px;border-radius:14px}.pc-row{display:flex;gap:6px}.pc-row .knob{width:36px;height:36px;background:color-mix(in srgb,var(--glass-text) 6%,transparent);color:var(--glass-text)}.pc-row .knob:hover{background:color-mix(in srgb,var(--glass-text) 11%,transparent)}.pc-copy{flex:1;min-width:0;height:36px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 14px;border-radius:999px;background:color-mix(in srgb,var(--glass-text) 6%,transparent);color:var(--glass-text);font-size:14px;font-weight:500;letter-spacing:-.01em;transition:transform .15s var(--ease-out),background-color .15s}.pc-copy:hover{background:color-mix(in srgb,var(--glass-text) 11%,transparent)}.pc-copy:active{transform:scale(.96)}.pc-copy .i{width:16px;height:16px;flex:none}.pc-copy .lbl{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pc-copy.copied{color:var(--ok)}.dgrid{display:grid;gap:10px;grid-template-columns:minmax(0,1fr)}@media(min-width:560px){.dgrid{grid-template-columns:repeat(2,minmax(0,1fr))}}.dev{background:var(--raised);border-radius:var(--r-card);padding:8px;display:flex;flex-direction:column;gap:8px;min-width:0;container:card / inline-size;--fit: var(--spring-smooth-dur, 524ms) var(--spring-smooth, ease)}.dev.is-here{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 32%,transparent)}.dev.off{opacity:.5}.dev-top{display:flex;align-items:center;gap:12px;padding:8px 6px 6px 10px}.dev-top .gi{width:32px;height:32px}.dev-id{flex:1;min-width:0;display:flex;flex-direction:column}.dev-name{font-size:16px;line-height:22px;font-weight:500;letter-spacing:-.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dev-stat{font-size:13px;line-height:18px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dev-stat.ok-t{color:var(--ok)}.dev-stat.warn-t{color:var(--warn)}.dev-stat.here-t{color:var(--accent)}.dev-stat.bad-t{color:var(--bad)}.dev-name.can-edit{align-self:flex-start;max-width:calc(100% + 12px);margin:0 -6px;padding:0 6px;border-radius:8px;cursor:text;outline:none;transition:background-color .15s var(--ease-out)}.dev-name.can-edit:hover{background:color-mix(in srgb,var(--raised),var(--text) 6%)}.kbd .dev-name.can-edit:focus-visible:not(.quiet){box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 60%,transparent)}.field.inline,.field.inline:focus-within{height:30px;margin:-4px -6px;padding:0 6px;gap:0;border-radius:8px;background:none;box-shadow:none;overflow:visible}.field.inline input{font:500 16px/22px var(--font);letter-spacing:-.02em}.dev-use{margin-top:auto;background:var(--field);border-radius:var(--r-row);padding:12px 14px 12px 16px;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:66px}.use-txt{display:flex;flex-direction:column;flex:1;min-width:0}.use-lbl{font-size:13px;line-height:18px;color:var(--text-2);white-space:nowrap}.use-val{font-size:17px;line-height:24px;font-weight:500;letter-spacing:-.02em;transition:font-size var(--fit),line-height var(--fit)}.dev .setup-btn{margin-top:auto}@container card (max-width: 313px){.use-val{font-size:15px;line-height:22px}.bars-week{--gap: 3px}.bars-week i{width:4px;border-radius:2px}}@container card (max-width: 253px){.use-val{font-size:14px;line-height:22px}.use-val .ud{column-gap:8px}}.dev.add{align-items:center;justify-content:center;min-height:144px;gap:10px;color:var(--text-2);font-weight:500;transition:background-color .2s var(--ease-out),transform .2s var(--ease-out)}.dev.add:hover{background:color-mix(in srgb,var(--raised),var(--knob) 45%)}@media(prefers-color-scheme:light){.dev.add:hover{background:color-mix(in srgb,var(--raised),var(--text) 2.5%);color:var(--text)}}.dev.add:active{transform:scale(.98)}.dev.add .gi{width:36px;height:36px}.dev.first{grid-column:1 / -1;align-items:center;text-align:center;padding:28px 24px 24px;gap:6px}.dev.first .gi{width:44px;height:44px;margin-bottom:8px}.dev.first b{font-size:18px;line-height:24px;font-weight:500;letter-spacing:-.02em}.dev.first p{margin:0 0 14px;color:var(--text-2);font-size:14px;line-height:20px;max-width:34ch;text-wrap:balance}.dev.first .btn{max-width:320px}.dgrid.snap .dev *{transition:none}@media(prefers-reduced-motion:reduce){.use-val{transition:none}}.reach2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.reach-tile{position:relative;display:flex;flex-direction:column;gap:1px;padding:12px 12px 12px 14px;border-radius:16px;background:var(--field);min-width:0}.reach-tile .rt-ic{width:28px;height:28px;margin-bottom:10px}.reach-tile b{font-size:14px;line-height:20px;font-weight:500;letter-spacing:-.015em}.reach-tile .rt-sub{font-size:12px;line-height:16px;color:var(--text-2)}.reach-tile .rt-mark{position:absolute;top:12px;right:12px;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:var(--ok-soft);color:var(--ok)}.reach-tile .rt-mark .i{width:12px;height:12px;stroke-width:2.4}.reach-tile.off b{color:var(--text-2)}.reach-tile.off .rt-sub{color:var(--text-3)}.reach-tile.off .rt-ic{opacity:.45}.reach-tile.off .rt-mark{background:var(--knob);color:var(--text-3)}.lbl-s{font-size:12px;font-weight:500;color:var(--text-2)}.names{display:flex;flex-wrap:wrap;gap:6px}.namechip{display:inline-flex;align-items:center;gap:8px;height:32px;padding:0 10px 0 12px;border-radius:10px;background:var(--field);font-family:var(--mono);font-size:13px;letter-spacing:0;transition:background-color .15s,transform .15s var(--ease-out)}.namechip:hover{background:var(--knob)}.namechip:active{transform:scale(.96)}.namechip .faint{color:var(--text-3)}.namechip .i{width:14px;height:14px;color:var(--text-2)}.ring{width:16px;height:16px;transform:rotate(-90deg)}.ring .trk{stroke:var(--bar)}.ring .arc{stroke:var(--accent)}.ring .arc.warn{stroke:var(--warn)}.ring .arc.bad{stroke:var(--bad)}.month{display:flex;flex-direction:column;gap:8px}.month-axis{position:relative;display:flex;justify-content:space-between;font-size:11px;color:var(--text-3);font-weight:500}.month-axis .td{position:absolute;transform:translate(-50%);color:var(--accent)}.month-axis .hide{visibility:hidden}.month-read{display:flex;justify-content:space-between;align-items:baseline;margin-top:10px;font-size:13px;color:var(--text-2)}.month-read>*{white-space:nowrap}.month-read .ud{color:var(--text);font-weight:500;font-size:15px;letter-spacing:-.02em}.meter{height:6px;border-radius:3px;background:var(--bar);overflow:hidden}.meter>i{display:block;height:100%;border-radius:3px;background:var(--accent)}.meter>i.warn{background:var(--warn)}.meter>i.bad{background:var(--bad)}.until{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;border-radius:16px;background:var(--field)}.until-num{display:flex;flex-direction:column;min-width:0}.until-num b{font-size:36px;line-height:40px;font-weight:600;letter-spacing:-.045em}.until-num span{font-size:13px;line-height:18px;color:var(--text-2)}.until-num .until-sub{margin-top:8px;font-size:12px;color:var(--text-3)}.until.soon .until-num b{color:var(--warn)}.cal{display:flex;flex-direction:column;gap:6px;flex:none}.cal-h,.cal-g{display:grid;grid-template-columns:repeat(7,10px);gap:5px}.cal-h span{font-size:9px;line-height:10px;font-weight:600;color:var(--text-3);text-align:center}.cal-g i{width:10px;height:10px;border-radius:3px;background:color-mix(in srgb,var(--text) 16%,transparent)}.cal-g i.past{background:color-mix(in srgb,var(--text) 5%,transparent)}.cal-g i.today{background:var(--accent)}.cal-g i.end{background:transparent;box-shadow:inset 0 0 0 1.5px var(--accent)}.cal-g i.after{background:transparent}.until.soon .cal-g i.today{background:var(--warn)}.until.soon .cal-g i.end{box-shadow:inset 0 0 0 1.5px var(--warn)}.acc-row.opened .cal-g i{animation:cal-in .36s var(--ease-out) backwards;animation-delay:calc(var(--i) * 7ms)}@keyframes cal-in{0%{opacity:0;transform:scale(.4)}}.hours{display:flex;flex-direction:column;gap:8px;padding:14px 16px;border-radius:16px;background:var(--field)}.hours-top{display:flex;justify-content:space-between;align-items:baseline;font-size:13px;color:var(--text-2)}.hours-top b{color:var(--text);font-weight:500;font-size:15px;letter-spacing:-.02em}.hours-bar{position:relative;height:8px;border-radius:4px;background:color-mix(in srgb,var(--text) 8%,transparent)}.hours-bar i{position:absolute;top:0;bottom:0;border-radius:4px;background:color-mix(in srgb,var(--ok) 70%,transparent)}.hours-now{position:absolute;top:-4px;width:2px;height:16px;margin-left:-1px;border-radius:1px;background:var(--text);box-shadow:0 0 0 2px var(--field)}.hours-now.out{background:var(--warn)}.hours-axis{display:flex;justify-content:space-between;font-size:10px;color:var(--text-3);font-weight:500}@media(prefers-reduced-motion:reduce){.acc-row.opened .cal-g i{animation:none}}.sheet-root{position:fixed;inset:0;z-index:50;display:none}.sheet-root.open{display:block}.scrim{position:absolute;inset:0;background:var(--scrim)}.sheet{position:absolute;left:var(--gutter-l);right:var(--gutter-r);bottom:calc(16px + env(safe-area-inset-bottom,0px));margin:0 auto;max-width:400px;max-height:calc(100% - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));background:var(--raised);border-radius:var(--r-sheet);box-shadow:var(--sheet-shadow);overflow:hidden;display:flex;flex-direction:column}@media(min-width:760px){.sheet-root.open{display:flex;align-items:center;justify-content:center}.sheet{position:relative;left:auto;right:auto;bottom:auto;margin:0;width:calc(100% - var(--gutter-l) - var(--gutter-r))}}.sheet .x{position:absolute;z-index:3;right:22px;top:22px}.vp{position:relative;overflow:hidden;flex:none}.sheet-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}.view{padding:0 24px 24px;display:flex;flex-direction:column}.vhead{display:flex;align-items:center;gap:12px;height:76px;padding-right:44px;flex:none;cursor:grab;touch-action:none}.vhead h2{flex:1;margin:0;font-size:20px;line-height:28px;font-weight:500;letter-spacing:-.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.vhead.center h2{text-align:center}.vhead.with-acts{padding-right:126px}.vsub{margin:-16px 0 18px;color:var(--text-2);font-size:14px;line-height:20px}.vhead.center+.vsub{text-align:center;margin:-6px auto 24px;max-width:32ch;text-wrap:balance}.view>.hint.bad-t{margin-top:8px}.secure-note{margin-top:12px;text-align:center}.sheet-acts{position:absolute;z-index:3;top:22px;right:58px}.hpill{position:relative;display:flex}.hp-b{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;color:var(--text-2);transition:background-color .15s,color .15s,transform .15s var(--ease-out)}.hp-b .i{width:16px;height:16px}.hp-b:hover{background:var(--knob);color:var(--text)}.hp-b:active{transform:scale(.94)}.hp-b.done{color:var(--ok)}.hp-tip{position:absolute;z-index:4;left:0;top:calc(100% + 8px);height:26px;padding:0 10px;display:flex;align-items:center;border-radius:999px;background:var(--toast);color:var(--toast-fg);font:500 12px/1 var(--font);letter-spacing:-.1px;white-space:nowrap;box-shadow:0 0 0 1px var(--line-glass),var(--pop-shadow);opacity:0;pointer-events:none;overflow:hidden;transform-origin:50% 0}.hp-tip.on{opacity:1}.hp-tip .tt{position:relative;display:inline-flex;justify-content:center;white-space:nowrap}.hp-tip .tt-m{position:absolute;left:0;top:0;visibility:hidden;white-space:nowrap}.sheet .x,.sheet-acts{transition:transform .15s var(--ease-out),background-color .15s,opacity .24s var(--ease-out),filter .24s var(--ease-out),scale .24s var(--ease-out)}.sheet.arrived .x,.sheet.arrived .sheet-acts,.sheet.asks .x{opacity:0;filter:blur(3px);scale:.9;pointer-events:none}.center-col,.ask{display:flex;flex-direction:column}.center-col{align-items:center;text-align:center}.ask{align-items:flex-start;text-align:left;padding-top:24px}.center-col.secure{padding-top:4px}:is(.center-col,.ask) .gi.xl{width:64px;height:64px;margin:8px 0 16px}.ask .gi.xl{margin:0 0 18px}:is(.center-col,.ask) h3{margin:0;font-size:20px;line-height:28px;font-weight:500;letter-spacing:-.5px}:is(.center-col,.ask) p{margin:6px 0 22px;color:var(--text-2);font-size:15px;line-height:21px}.center-col p{max-width:30ch;text-wrap:balance}.ask p{text-wrap:pretty}.center-col.secure p{margin-top:0}.btnrow{display:flex;gap:8px;width:100%}.btnrow .btn{flex:1}.btnrow2{display:grid;gap:8px}.btnrow2 .btn{width:100%}.setup{display:flex;flex-direction:column}.setup .notice{margin:0 0 16px}.steps-gap{height:22px}.step{display:flex;gap:12px}.step+.step{margin-top:20px}.step-n{width:24px;height:24px;border-radius:50%;background:var(--knob);font-size:13px;font-weight:600;display:grid;place-items:center;flex:none}.step-b{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}.step-t{font-size:16px;line-height:24px;font-weight:500;letter-spacing:-.02em}.step-box,.conn{display:flex;flex-direction:column;gap:10px}.way{display:flex;flex-direction:column;padding:12px 14px;border-radius:20px;background:var(--field);margin-bottom:18px}.way-row{display:flex;align-items:center;gap:10px}.way-end{width:34px;height:34px;border-radius:11px;background:var(--knob);display:grid;place-items:center;flex:none;color:var(--text-2);transition:background-color .4s var(--ease-out),color .4s var(--ease-out)}.way-end .i{width:17px;height:17px}.way-end.home{color:var(--accent);background:color-mix(in srgb,var(--accent) 14%,transparent)}.way-track{position:relative;flex:1;height:8px}.way-track:before,.way-glow,.way-fill{content:"";position:absolute;inset:0;-webkit-mask:radial-gradient(circle,#000 1.4px,transparent 1.9px) 0 50% / 9px 8px repeat-x;mask:radial-gradient(circle,#000 1.4px,transparent 1.9px) 0 50% / 9px 8px repeat-x}.way-track:before{background:var(--text-3);opacity:.8}.way-glow{overflow:hidden}.way-glow>span{position:absolute;inset:0;transition:opacity .2s var(--ease-out)}.way.trying .run,.way.done .run,.way.nodata .run,.way.stopped .run,.way:not(.trying) .knock{opacity:0}.way-glow i{position:absolute;inset:0;background:linear-gradient(90deg,transparent 32%,var(--accent) 50%,transparent 68%);transform:translate(-70%);animation:way-run 2s cubic-bezier(.45,0,.55,1) infinite}@keyframes way-run{0%{transform:translate(-70%)}72%,to{transform:translate(70%)}}.way-fill{background:var(--ok);clip-path:inset(0 100% 0 0);transition:clip-path .7s var(--ease-out) 80ms}.way.done .way-fill{clip-path:inset(0)}.way.done .way-end{color:var(--ok);background:var(--ok-soft)}.way.done .way-end.home,.way.nodata .way-end.home{transition-delay:.6s}.way.done .way-end.home .i{animation:way-dip .12s cubic-bezier(.45,0,.55,1) .48s,way-pop var(--spring-bouncy-dur, 572ms) var(--spring-bouncy, ease) .6s}@keyframes way-dip{to{transform:scale(.6)}}@keyframes way-pop{0%{transform:scale(.6)}to{transform:none}}.way-text{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:30px;margin-top:10px;text-align:center}.way-text .t{display:flex;flex-direction:column;align-items:center;min-width:0}.way-text b{position:relative;display:inline-flex;justify-content:center;white-space:nowrap;font-weight:500;font-size:14px;line-height:20px;transition:color .3s var(--ease-out)}.way-text .ws{color:var(--text-2);font-size:13px;line-height:18px}.way.done .way-text b{color:var(--ok)}.way-glow .knock i{background:linear-gradient(90deg,transparent 32%,var(--warn) 50%,transparent 68%);animation:way-knock 1.8s cubic-bezier(.45,0,.55,1) infinite}@keyframes way-knock{0%{transform:translate(-70%)}48%{transform:translate(34%)}62%{transform:translate(26%);opacity:1}86%,to{transform:translate(-70%);opacity:0}}.way-break{position:absolute;right:-2px;top:-5px;width:2px;height:18px;opacity:0;transition:opacity .2s var(--ease-out)}.way.trying .way-break{opacity:1}.way-break i{position:absolute;inset:0;border-radius:2px;background:var(--warn);transform:rotate(18deg);animation:way-break 1.8s cubic-bezier(.45,0,.55,1) infinite}@keyframes way-break{0%,40%{opacity:.25;transform:rotate(18deg) scaleY(.7)}50%{opacity:1;transform:rotate(18deg) scaleY(1.15)}70%,to{opacity:.25;transform:rotate(18deg) scaleY(.7)}}.way.trying .way-end.home{color:var(--warn);background:color-mix(in srgb,var(--warn) 14%,transparent)}.way.trying .way-text b,.way.nodata .way-text b{color:var(--warn)}.way.nodata .way-fill{clip-path:inset(0)}.way.nodata .way-end{color:var(--ok);background:var(--ok-soft)}.way-pkt{position:absolute;top:50%;left:0;width:8px;height:8px;margin-top:-4px;border-radius:50%;background:var(--warn);box-shadow:0 0 10px color-mix(in srgb,var(--warn) 70%,transparent);opacity:0;animation:way-drop 2.2s cubic-bezier(.45,0,.55,1) infinite}.way-pkt.b{animation-delay:1.1s}@keyframes way-drop{0%{left:0;opacity:0;transform:none}8%{opacity:1}46%{left:48%;opacity:1;transform:none}66%,to{left:54%;opacity:0;transform:translateY(16px) scale(.5)}}.filecard{display:flex;flex-direction:column;gap:10px;padding:12px;border-radius:18px;background:var(--field)}.fc-row{display:flex;align-items:center;gap:12px;min-width:0}.filecard-ic{width:38px;height:46px;border-radius:9px;background:var(--knob);font:600 10px/1 var(--mono);display:grid;place-items:center;color:var(--text-2);flex:none}.filecard .t{flex:1;min-width:0;display:flex;flex-direction:column}.filecard .t .mono{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.filecard .t span:last-child{font-size:12px;color:var(--text-2);line-height:16px}.confbar{display:flex;gap:8px}.conf{margin:0;padding:12px 14px;border-radius:14px;background:var(--field);font:12px/18px var(--mono);max-height:16rem;overflow:auto;white-space:pre;color:var(--text-2)}.conf .k{color:var(--text)}.conf .sec{color:var(--accent)}.conf .mask{color:var(--text-3);letter-spacing:1px}.osm{white-space:normal}.osm-ic{display:inline-grid;width:1.05em;height:1.05em;margin-right:.25em;vertical-align:-.16em}.osm-ic>svg{grid-area:1 / 1;width:100%;height:100%}.osm-ic .eye{fill:var(--field)}.osm-p{display:inline-block;white-space:pre}.scanline{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.3em}.scanline .osm{white-space:nowrap}@media(max-width:440px){.scanline{flex-direction:column;align-items:flex-start}}.way-text b .mt-old{color:var(--text-2)}@media(prefers-reduced-motion:reduce){.way-glow{display:none}.way-fill{transition:none}.way.done .way-end.home .i,.way-break i{animation:none}.way-pkt{display:none}}.pop{position:absolute;min-width:210px;overflow:hidden;border-radius:24px}.pop-body{position:relative;display:flex;flex-direction:column;padding:6px 0}.pop-grp{display:flex;flex-direction:column;padding:0 6px}.pop-sep{display:flex;align-items:center;height:13px;padding:0 16px}.pop-sep>span{flex:1;height:1px;background:var(--glass-sep)}.mi{position:relative;display:flex;align-items:center;gap:10px;width:100%;min-height:34px;padding:0 12px 0 14px;border-radius:18px;color:var(--glass-text);text-align:left;transition:transform .15s var(--ease-out)}.mi{z-index:3}.mi:active{transform:scale(.97)}.kbd .mi:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.mi>.i{position:relative;z-index:3;flex:none;color:currentColor;transition:scale var(--spring-glide-dur, .4s) var(--spring-glide, ease-out)}.mi>.i{width:16px;height:16px}.mi.hot>.i{scale:1.08}.mi-b{position:relative;z-index:3;display:flex;flex-direction:column;justify-content:center;gap:1px;min-width:0;padding:8px 0}.mi-l{font-size:14px;font-weight:400;line-height:18px;letter-spacing:-.2px}.mi-s{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;line-height:15px;color:var(--glass-sub);font-variant-numeric:tabular-nums}.mi.warn{color:var(--warn)}.mi.bad{color:var(--glass-bad)}.toasts{position:fixed;left:0;right:0;height:42px;bottom:calc(24px + env(safe-area-inset-bottom,0px));z-index:70;display:flex;justify-content:center;align-items:flex-end;pointer-events:none;padding-left:var(--gutter-l);padding-right:var(--gutter-r)}.toast{position:absolute;display:flex;align-items:center;gap:8px;height:42px;padding:0 18px 0 13px;border-radius:999px;background:var(--toast);color:var(--toast-fg);font-size:14px;font-weight:500;box-shadow:var(--pop-shadow);white-space:nowrap}.toast .i{width:18px;height:18px;color:var(--ok)}.toast.bad .i{color:var(--bad)}.drop{z-index:60;background:var(--glass-bg);-webkit-backdrop-filter:blur(28px) saturate(1.8);backdrop-filter:blur(28px) saturate(1.8);box-shadow:inset 0 0 0 1px var(--glass-edge),var(--glass-shadow)}.drop-hl{position:absolute;left:0;top:0;z-index:2;background:var(--glass-hl);opacity:0;pointer-events:none;transition:opacity .16s var(--ease-out),scale .15s var(--ease-out)}.drop-hl.moving{transition:opacity .16s var(--ease-out),scale .15s var(--ease-out),translate var(--spring-glide-dur, .4s) var(--spring-glide, ease-out),width var(--spring-glide-dur, .4s) var(--spring-glide, ease-out),height var(--spring-glide-dur, .4s) var(--spring-glide, ease-out),border-radius var(--spring-glide-dur, .4s) var(--spring-glide, ease-out)}.drop-hl.down{scale:.97}.pp{touch-action:none;-webkit-user-select:none;user-select:none}.pp-lead{position:relative;display:inline-flex;flex:none}.pp-lead>.pp-gone{position:absolute;inset:0}.pp-lead[hidden]{display:none}.pp-chev{width:14px;height:14px;flex:none;color:var(--text-2);rotate:90deg;transition:rotate .26s var(--ease-out)}.pp-pop{position:fixed;display:flex;gap:3px;padding:3px}.pp-pop.drop{box-shadow:none}.pp-pop.above{padding-bottom:9px}.pp-pop.below{padding-top:9px}.pp-shade{position:fixed;z-index:59;border-radius:999px;pointer-events:none;box-shadow:var(--glass-shadow)}.pp-ring{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;fill:none;stroke:var(--glass-edge);stroke-width:2}.pp-pop button{position:relative;z-index:3;display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 10px;border-radius:10px;color:var(--glass-sub);font-size:12.5px;font-weight:500;white-space:nowrap;transition:color .15s,background-color .15s,transform .15s var(--ease-out)}.pp-pop button:first-of-type{border-radius:17px 10px 10px 17px;padding-left:13px}.pp-pop button:last-of-type{border-radius:10px 17px 17px 10px;padding-right:13px}.pp-pop button.hot{color:var(--glass-text)}.pp-pop button:active{transform:scale(.96)}.pp-pop button[aria-checked=true]{color:var(--glass-text)}.kbd .pp-pop button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.flag{position:relative;width:16px;height:16px;border-radius:50%;overflow:hidden;flex:none}.flag svg{display:block;width:100%;height:100%}.flag:after{content:"";position:absolute;inset:0;border-radius:50%;box-shadow:inset 0 0 0 1px #0000002e}.pp-pop button:not([aria-checked=true]):not(.hot) .flag{opacity:.7} diff --git a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/portal.js b/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/portal.js deleted file mode 100644 index 2c8c5b7..0000000 --- a/package/luci-app-dawnline/root/usr/share/dawnline/portal/assets/portal.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict";(()=>{var Xi=Object.create;var Xo=Object.defineProperty;var Ji=Object.getOwnPropertyDescriptor;var Zi=Object.getOwnPropertyNames;var ea=Object.getPrototypeOf,ta=Object.prototype.hasOwnProperty;var na=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var oa=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Zi(t))!ta.call(e,r)&&r!==n&&Xo(e,r,{get:()=>t[r],enumerable:!(o=Ji(t,r))||o.enumerable});return e};var ra=(e,t,n)=>(n=e!=null?Xi(ea(e)):{},oa(t||!e||!e.__esModule?Xo(n,"default",{value:e,enumerable:!0}):n,e));var qr=na((Fr,Wr)=>{"use strict";var Gr=(function(){var e=function(g,v){var u=236,d=17,l=g,b=n[v],y=null,p=0,L=null,E=[],A={},F=function(S,H){p=l*4+17,y=(function(k){for(var D=new Array(k),$=0;$=7&&Z(S),L==null&&(L=Be(l,b,E)),le(L,H)},B=function(S,H){for(var k=-1;k<=7;k+=1)if(!(S+k<=-1||p<=S+k))for(var D=-1;D<=7;D+=1)H+D<=-1||p<=H+D||(0<=k&&k<=6&&(D==0||D==6)||0<=D&&D<=6&&(k==0||k==6)||2<=k&&k<=4&&2<=D&&D<=4?y[S+k][H+D]=!0:y[S+k][H+D]=!1)},N=function(){for(var S=0,H=0,k=0;k<8;k+=1){F(!0,k);var D=r.getLostPoint(A);(k==0||S>D)&&(S=D,H=k)}return H},q=function(){for(var S=8;S>k&1)==1;y[Math.floor(k/3)][k%3+p-8-3]=D}for(var k=0;k<18;k+=1){var D=!S&&(H>>k&1)==1;y[k%3+p-8-3][Math.floor(k/3)]=D}},te=function(S,H){for(var k=b<<3|H,D=r.getBCHTypeInfo(k),$=0;$<15;$+=1){var I=!S&&(D>>$&1)==1;$<6?y[$][8]=I:$<8?y[$+1][8]=I:y[p-15+$][8]=I}for(var $=0;$<15;$+=1){var I=!S&&(D>>$&1)==1;$<8?y[8][p-$-1]=I:$<9?y[8][15-$-1+1]=I:y[8][15-$-1]=I}y[p-8][8]=!S},le=function(S,H){for(var k=-1,D=p-1,$=7,I=0,G=r.getMaskFunction(H),W=p-1;W>0;W-=2)for(W==6&&(W-=1);;){for(var X=0;X<2;X+=1)if(y[D][W-X]==null){var oe=!1;I>>$&1)==1);var U=G(D,W-X);U&&(oe=!oe),y[D][W-X]=oe,$-=1,$==-1&&(I+=1,$=7)}if(D+=k,D<0||p<=D){D-=k,k=-k;break}}},me=function(S,H){for(var k=0,D=0,$=0,I=new Array(H.length),G=new Array(H.length),W=0;W=0?Yo.getAt(jo):0}}for(var Qo=0,U=0;UW*8)throw"code length overflow. ("+$.getLengthInBits()+">"+W*8+")";for($.getLengthInBits()+4<=W*8&&$.put(0,4);$.getLengthInBits()%8!=0;)$.putBit(!1);for(;!($.getLengthInBits()>=W*8||($.put(u,8),$.getLengthInBits()>=W*8));)$.put(d,8);return me($,D)};A.addData=function(S,H){H=H||"Byte";var k=null;switch(H){case"Numeric":k=m(S);break;case"Alphanumeric":k=M(S);break;case"Byte":k=h(S);break;case"Kanji":k=x(S);break;default:throw"mode:"+H}E.push(k),L=null},A.isDark=function(S,H){if(S<0||p<=S||H<0||p<=H)throw S+","+H;return y[S][H]},A.getModuleCount=function(){return p},A.make=function(){if(l<1){for(var S=1;S<40;S++){for(var H=c.getRSBlocks(S,b),k=f(),D=0;D";for(var $=0;$';k+=""}return k+="",k+="",k},A.createSvgTag=function(S,H,k,D){var $={};typeof arguments[0]=="object"&&($=arguments[0],S=$.cellSize,H=$.margin,k=$.alt,D=$.title),S=S||2,H=typeof H=="undefined"?S*4:H,k=typeof k=="string"?{text:k}:k||{},k.text=k.text||null,k.id=k.text?k.id||"qrcode-description":null,D=typeof D=="string"?{text:D}:D||{},D.text=D.text||null,D.id=D.text?D.id||"qrcode-title":null;var I=A.getModuleCount()*S+H*2,G,W,X,oe,U="",we;for(we="l"+S+",0 0,"+S+" -"+S+",0 0,-"+S+"z ",U+=''+de(D.text)+"":"",U+=k.text?''+de(k.text)+"":"",U+='',U+='":H+=">";break;case"&":H+="&";break;case'"':H+=""";break;default:H+=D;break}}return H},Ie=function(S){var H=1;S=typeof S=="undefined"?H*2:S;var k=A.getModuleCount()*H+S*2,D=S,$=k-S,I,G,W,X,oe,U={"██":"█","█ ":"▀"," █":"▄"," ":" "},we={"██":"▀","█ ":"▀"," █":" "," ":" "},ue="";for(I=0;I=$?we[oe]:U[oe];ue+=` -`}return k%2&&S>0?ue.substring(0,ue.length-k-1)+Array(k+1).join("▀"):ue.substring(0,ue.length-1)};return A.createASCII=function(S,H){if(S=S||1,S<2)return Ie(H);S-=1,H=typeof H=="undefined"?S*2:H;var k=A.getModuleCount()*S+H*2,D=H,$=k-H,I,G,W,X,oe=Array(S+1).join("██"),U=Array(S+1).join(" "),we="",ue="";for(I=0;I>>8),b.push(L&255)):b.push(d)}}return b}};var t={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},r=(function(){var g=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],v=1335,u=7973,d=21522,l={},b=function(y){for(var p=0;y!=0;)p+=1,y>>>=1;return p};return l.getBCHTypeInfo=function(y){for(var p=y<<10;b(p)-b(v)>=0;)p^=v<=0;)p^=u<5&&(L+=3+F-5)}for(var E=0;E=256;)l-=255;return g[l]},d})();function i(g,v){if(typeof g.length=="undefined")throw g.length+"/"+v;var u=(function(){for(var l=0;l>>7-d%8&1)==1},u.put=function(d,l){for(var b=0;b>>l-b-1&1)==1)},u.getLengthInBits=function(){return v},u.putBit=function(d){var l=Math.floor(v/8);g.length<=l&&g.push(0),d&&(g[l]|=128>>>v%8),v+=1},u},m=function(g){var v=t.MODE_NUMBER,u=g,d={};d.getMode=function(){return v},d.getLength=function(y){return u.length},d.write=function(y){for(var p=u,L=0;L+2>>8&255)*192+(E&255),y.put(E,13),L+=2}if(L>>8)},v.writeBytes=function(u,d,l){d=d||0,l=l||u.length;for(var b=0;b0&&(u+=","),u+=g[d];return u+="]",u},v},C=function(){var g=0,v=0,u=0,d="",l={},b=function(p){d+=String.fromCharCode(y(p&63))},y=function(p){if(!(p<0)){if(p<26)return 65+p;if(p<52)return 97+(p-26);if(p<62)return 48+(p-52);if(p==62)return 43;if(p==63)return 47}throw"n:"+p};return l.writeByte=function(p){for(g=g<<8|p&255,v+=8,u+=1;v>=6;)b(g>>>v-6),v-=6},l.flush=function(){if(v>0&&(b(g<<6-v),g=0,v=0),u%3!=0)for(var p=3-u%3,L=0;L=v.length){if(l==0)return-1;throw"unexpected end of file./"+l}var p=v.charAt(u);if(u+=1,p=="=")return l=0,-1;if(p.match(/^\s$/))continue;d=d<<6|y(p.charCodeAt(0)),l+=6}var L=d>>>l-8&255;return l-=8,L};var y=function(p){if(65<=p&&p<=90)return p-65;if(97<=p&&p<=122)return p-97+26;if(48<=p&&p<=57)return p-48+52;if(p==43)return 62;if(p==47)return 63;throw"c:"+p};return b},P=function(g,v){var u=g,d=v,l=new Array(g*v),b={};b.setPixel=function(E,A,F){l[A*u+E]=F},b.write=function(E){E.writeString("GIF87a"),E.writeShort(u),E.writeShort(d),E.writeByte(128),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(0),E.writeByte(255),E.writeByte(255),E.writeByte(255),E.writeString(","),E.writeShort(0),E.writeShort(0),E.writeShort(u),E.writeShort(d),E.writeByte(0);var A=2,F=p(A);E.writeByte(A);for(var B=0;F.length-B>255;)E.writeByte(255),E.writeBytes(F,B,255),B+=255;E.writeByte(F.length-B),E.writeBytes(F,B,F.length-B),E.writeByte(0),E.writeString(";")};var y=function(E){var A=E,F=0,B=0,N={};return N.write=function(q,Y){if(q>>>Y)throw"length over";for(;F+Y>=8;)A.writeByte(255&(q<>>=8-F,B=0,F=0;B=q<0&&A.writeByte(B)},N},p=function(E){for(var A=1<>6,128|s&63):s<55296||s>=57344?o.push(224|s>>12,128|s>>6&63,128|s&63):(r++,s=65536+((s&1023)<<10|n.charCodeAt(r)&1023),o.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|s&63))}return o}return t(e)}})();(function(e){typeof define=="function"&&define.amd?define([],e):typeof Fr=="object"&&(Wr.exports=e())})(function(){return Gr})});var Jo={s:{'"%s" already exists.':"Устройство «%s» уже есть.",'"%s" is already taken.':"Идентификатор «%s» уже занят.","%s (Android: %s)":"%s (на Android: %s)","%s (router time)":"%s (по времени роутера)","%s and %s overlap: each packet type needs values of its own.":"%s и %s пересекаются: у каждого типа пакетов должны быть свои значения.","%s can't use the network interface %s: it exists and isn't Dawnline's.":"Сервер %s не может использовать сетевой интерфейс %s: он уже существует и создан не Dawnline.","%s connected":"Подключено: %s","%s d ago":"%s дн. назад","%s h ago":"%s ч назад","%s has a tag that is not closed with >.":"%s: тег не закрыт символом >.",'%s has an invalid interface name "%s".':"У сервера %s недопустимое имя интерфейса «%s».","%s has no room for every device on %s.":"В подсети %s не хватит адресов для всех устройств сервера %s.","%s in total":"%s всего","%s is kept down.":"Сервер %s остановлен.","%s is kept down: its disguise has values AmneziaWG cannot take. %s":"Сервер %s остановлен: в его маскировке есть значения, которые AmneziaWG не примет. %s","%s is kept down: its disguise needs AmneziaWG %s (installed: %s).":"Сервер %s остановлен: для его маскировки нужен AmneziaWG %s (установлен %s).","%s is kept down: its disguise needs AmneziaWG %s (installed: none).":"Сервер %s остановлен: для его маскировки нужен AmneziaWG %s (не установлен).","%s left":"осталось %s","%s may not contain # or a line break.":"%s не может содержать # или перенос строки.","%s min ago":"%s мин назад","%s must be a number or a range like 10-100, up to 65535.":"%s: нужно число или диапазон вида 10-100, не больше 65535.","%s must be a number or a range like 100-200, up to 4294967295.":"%s: нужно число или диапазон вида 100-200, не больше 4294967295.","%s must be a number or a range like 5-15, from 1 to 65535.":"%s: нужно число или диапазон вида 5-15, от 1 до 65535.","%s must be a whole number from 0 to 65535.":"%s: нужно целое число от 0 до 65535.","%s must be at least 12 with header protection.":"%s: с защитой заголовков нужно не меньше 12.","%s must be from %d to %d.":"%s: от %d до %d.","%s must be on or off.":"%s: нужно on или off.","%s of %s":"%s из %s","%s of %s GB":"%s из %s ГБ","%s of %s GB this month":"%s из %s ГБ в этом месяце","%s of %s in total.":"Всего %s из %s.","%s options":"Действия с устройством %s","%s this month":"%s в этом месяце","%s your time":"%s по вашему времени","%s: <%s> is not a tag AmneziaWG apps accept: use with an even number of hex digits, , or with N from 1 to 1000, or .":"%s: тег <%s> не примут приложения AmneziaWG: используйте с чётным числом шестнадцатеричных цифр, , или с N от 1 до 1000 либо .","%sd %sh":"%s д %s ч","%sh %sm":"%s ч %s мин","%sm":"%s мин","A total for your whole access, it does not reset.":"Считается за весь срок доступа и не обнуляется.","APK file on":"APK-файл на","Access %s":"Доступ %s","Access ended":"Доступ закончился","Access must be lan, internet or both.":"Доступ должен быть lan, internet или both.","Access paused":"Доступ на паузе","Access until":"Доступ до",Active:"Активен","WireGuard appAdd Tunnel":"Добавить туннель","Add a device":"Добавить устройство","Add device":"Добавить устройство","Add it from the device":"Добавить с самого устройства","Add the connection":"Добавьте подключение","Add this device":"Добавить это устройство","Add this phone":"Добавить этот телефон","Add your first device":"Добавьте первое устройство","Adding devices isn't available right now: the VPN server isn't ready. Ask whoever sent you this link.":"Сейчас добавить устройство нельзя: VPN-сервер не готов. Обратитесь к тому, кто прислал вам эту ссылку.","Address copied":"Адрес скопирован","AmneziaWG is not installed (%s): install it in Dawnline → Components.":"AmneziaWG не установлен (%s): установите его в Dawnline → Компоненты.","AmneziaWG is not installed: install it in Dawnline → Components.":"AmneziaWG не установлен: установите его в Dawnline → Компоненты.","Android phone":"Телефон Android","Android tablet":"Планшет Android","Ask for a new one.":"Попросите новую.",B:"Б",Back:"Назад",Breadcrumb:"Навигационная цепочка",Cancel:"Отмена","Can’t finish connecting":"Не удаётся подключиться","Circle %s: server %s does not exist.":"Круг %s: сервера %s нет.",Close:"Закрыть","Close this and open it again to keep checking.":"Закройте окно и откройте его снова, чтобы проверить ещё раз.",Configuration:"Конфигурация","Configuration copied":"Конфигурация скопирована","Confirm the import and connect":"Подтвердите импорт и подключитесь",Connect:"Подключить",Connected:"Подключено","Connected, but no data":"Подключено, но данных нет","Connected, no data left":"Подключено, трафик закончился","Connected, outside your hours":"Подключено, вне часов доступа","Connection keeps dropping":"Связь постоянно рвётся","Connection settings only travel encrypted":"Настройки подключения передаются только в зашифрованном виде","AmneziaVPN appContinue":"Продолжить",Copied:"Скопировано",Copy:"Скопировать","Copy %s":"Скопировать %s","Copy %s config":"Скопировать конфигурацию %s","Copy IP address":"Скопировать IP-адрес","Copy link":"Скопировать ссылку","Copy local address":"Скопировать локальный адрес","Copy or save the connection":"Скопировать или сохранить подключение","Copy the configuration":"Скопировать конфигурацию","Copy the key":"Скопировать ключ","in a sentenceCopy the key":"Скопируйте ключ","Copy the link":"Скопировать ссылку","Copying is blocked here. Select the text and copy it by hand.":"Копирование здесь заблокировано. Выделите текст и скопируйте его вручную.","Create connection":"Создать подключение","WireGuard appCreate from QR code":"Создать из QR-кода","WireGuard appCreate from file or archive":"Создать из файла или архива","Cross-site request refused.":"Запрос с другого сайта отклонён.","Data limit must be a positive number of GB.":"Лимит трафика должен быть положительным числом ГБ.","Data limit reached":"Лимит трафика исчерпан","Data this month":"Трафик за месяц","Data used":"Трафик всего",Device:"Устройство","Device %s of %s: MTU %d is not between 1280 and 1500.":"Устройство %s (%s): MTU %d вне пределов от 1280 до 1500.","Device %s of %s: address %s is also used by device %s of %s.":"Устройство %s (%s): адрес %s уже занят устройством %s (%s).","Device %s of %s: address %s is not a plain IPv4 address.":"Устройство %s (%s): адрес %s не является обычным IPv4-адресом.","Device %s of %s: address %s is outside %s's tunnel %s.":"Устройство %s (%s): адрес %s вне туннеля сервера %s (%s).","Device %s of %s: address %s is the router's own address on %s.":"Устройство %s (%s): адрес %s принадлежит самому роутеру на сервере %s.","Device %s of %s: address (none) is not a plain IPv4 address.":"Устройство %s (%s): нет IPv4-адреса.","Device %s of %s: keep-alive %d is not between 0 and 600 seconds.":"Устройство %s (%s): keep-alive %d вне пределов от 0 до 600 секунд.","Device %s of %s: the preshared key is not a key.":"Устройство %s (%s): общий ключ (PSK) некорректен.","Device %s of %s: the private key is not a key.":"Устройство %s (%s): приватный ключ некорректен.","Device %s of %s: the public key is not a key.":"Устройство %s (%s): публичный ключ некорректен.","Device %s of %s: the public key is the server's own.":"Устройство %s (%s): публичный ключ совпадает с ключом сервера.","Device %s: person %s does not exist.":"Устройство %s: человека %s нет.","Device limit must be between 1 and 32.":"Лимит устройств: от 1 до 32.","Device limit reached (%d).":"Достигнут лимит устройств (%d).","Device name":"Имя устройства","Device not found.":"Устройство не найдено.","Device removed":"Устройство удалено","Devices at home":"Устройства дома","Devices at home and on this VPN reach yours as %s":"Устройства дома и в этом VPN обращаются к вашим по адресу %s",Disabled:"Отключено",Download:"Скачать","Download %s config":"Скачать конфигурацию %s","Download for Linux":"Скачать для Linux","Download for Mac":"Скачать для Mac","Download for Windows":"Скачать для Windows","Download from":"Скачать с сайта","Download on the":"Загрузите в","Download the file":"Скачать файл","Download the key":"Скачать ключ",Downloaded:"Получено","End date must be YYYY-MM-DD.":"Дата окончания должна быть в формате ГГГГ-ММ-ДД.","Endpoint must be a hostname or IP address.":"Адрес сервера должен быть именем хоста или IP-адресом.","Ends %s":"Закончится %s","Enter a device name: up to %d letters, digits, spaces and - _ .":"Введите название устройства: до %d букв, цифр, пробелов и - _ .","Except %s: those addresses lead to the home network.":"Кроме %s: эти адреса ведут в домашнюю сеть.",Expired:"Срок истёк","Extra data must be a positive number of GB.":"Дополнительный трафик должен быть положительным числом ГБ.","For computers and routers":"Для компьютеров и роутеров",GB:"ГБ","Gbit/s":"Гбит/с","Get %s":"Установите %s","Get %s on the %s and come back here.":"Установите %s на %s и вернитесь сюда.","Get %s on the router":"Установите %s на роутер","Get it on":"Доступно в","Give the device a name.":"Дайте устройству название.","Handshake complete, but no data":"Рукопожатие есть, но данных нет","Hide key":"Скрыть ключ","Home network":"Домашняя сеть","Home network + Internet":"Домашняя сеть и интернет","Hours must look like 07:00-23:00.":"Часы доступа указываются так: 07:00-23:00.","Hours, router time":"Часы доступа, время роутера","Hours, your time":"Часы доступа, ваше время","I1-I5 together must be at most 2000 characters, not %d.":"I1–I5 вместе: не больше 2000 символов, сейчас %d.","IP address copied":"IP-адрес скопирован","WireGuard appImport Tunnel(s) from File…":"Импорт туннелей из файла…","WireGuard appImport from file or archive":"Импорт из файла или архива","Import the configuration":"Импортируйте конфигурацию","WireGuard appImport tunnel(s) from file…":"Импорт туннелей из файла…","In %s:":"В %s:",Included:"Есть доступ","AmneziaVPN appInsert":"Вставить","Install from":"Установить с сайта","Interface name: 1-12 lowercase letters, digits or _.":"Имя интерфейса: 1–12 строчных латинских букв, цифр или _.",Internet:"Интернет","Invalid JSON.":"Некорректный JSON.","Invalid public key.":"Недопустимый публичный ключ.","It connects, but the connection breaks every few minutes. Another network may help.":"Устройство подключается, но связь рвётся каждые несколько минут. Может помочь другая сеть.","It ended on %s.":"Доступ закончился %s.","It gets new keys and its current settings stop working. Set it up again with the new ones that open next.":"Устройство получит новые ключи, а текущие настройки перестанут работать. Настройте его заново с новыми - они откроются следом.","It gets new keys. This device is connected through its current settings: it disconnects a few seconds after you confirm. Add the new ones that open next.":"Устройство получит новые ключи. Сейчас вы подключены через его текущие настройки: через несколько секунд после подтверждения связь прервётся. Добавьте новые - они откроются следом.","It reaches the router, but the connection never completes. The network may be blocking it.":"Устройство доходит до роутера, но подключение не завершается. Возможно, его блокирует сеть.","Its connection stops working at once. You can add it again later.":"Подключение сразу перестанет работать. Устройство можно будет добавить снова.","Jmin must not be larger than Jmax.":"Jmin не может быть больше Jmax.",KB:"КБ","Keep-alive must be 0-600 seconds.":"Keep-alive: от 0 до 600 секунд.","Key copied":"Ключ скопирован","Key generation failed (is amneziawg-tools installed?).":"Не удалось создать ключ (установлен ли amneziawg-tools?).","Key generation failed (no random data).":"Не удалось создать ключ (нет случайных данных).","Key generation failed.":"Не удалось создать ключ.","LAN Bypass":"Обход локальной сети",Language:"Язык","Last 7 days":"За 7 дней","Last connected %s":"В сети %s","Link copied":"Ссылка скопирована","Linux PC":"Компьютер с Linux",MB:"МБ","MTU must be 1280-1500.":"MTU: от 1280 до 1500.","Mbit/s":"Мбит/с","Method not allowed.":"Метод не поддерживается.",Mobile:"Мобильный","Monthly data must be a positive number of GB.":"Месячный лимит трафика должен быть положительным числом ГБ.",Name:"Имя","No connection yet":"Подключения пока нет","No data limit. The count starts again on the 1st.":"Лимита трафика нет. Счёт начинается заново 1-го числа.","No end date":"Бессрочно","No free address left on %s.":"На сервере %s не осталось свободных адресов.","No free addresses left in the server subnet.":"В подсети сервера не осталось свободных адресов.","No limit":"Без лимита","No server":"Нет сервера","No server yet":"Сервера пока нет","Not found.":"Не найден.","Not included":"Нет доступа","Not on the %s right now?":"Открыли на другом %s?","Not set up yet":"Ещё не настроено","Nothing gets through until it resets.":"Ничего не проходит, пока лимит не обнулится.","Nothing opened? %s and add it in the app.":"Ничего не открылось? %s и добавьте его в приложении.","Now, %s":"Сейчас %s",OR:"ИЛИ","Official release on GitHub":"Официальная версия на GitHub","On %s.":"Дата окончания - %s.","On GitHub":"На GitHub","On two devices at once":"На двух устройствах сразу","Only letters, digits, - _ .":"Только буквы, цифры, - _ .","Only the admin can change how a device connects.":"Менять настройки подключения устройства может только администратор.","Only the admin can turn devices off.":"Отключать устройства может только администратор.","stepOpen %s":"Откройте %s","Open %s.":"Доступ открыт %s.","Open a terminal in the folder with the file":"Откройте терминал в папке с файлом","Open in AmneziaVPN":"Открыть в AmneziaVPN","Open on another device":"Открыть на другом устройстве","Open on the device":"Открыть на устройстве","Open securely":"Открыть по HTTPS","Open the link securely":"Откройте защищённую ссылку","Open this link on the %s to set it up there.":"Откройте эту ссылку на %s, чтобы настроить его там.","Open this link over HTTPS to get the connection settings.":"Чтобы получить настройки подключения, откройте эту ссылку по HTTPS.","Open this page in Safari or Chrome: the store opens from here, but the app handoff does not.":"Откройте эту страницу в Safari или Chrome: магазин отсюда откроется, а передача в приложение - нет.","Open your link on the %s":"Откройте свою ссылку на %s","OpenWrt packages":"Пакеты OpenWrt","OpenWrt packages + kmod":"Пакеты OpenWrt + kmod",Other:"Другое","Other devices at home reach yours as %s":"Другие устройства дома обращаются к вашим по адресу %s","Out of data":"Трафик закончился","Outside allowed hours":"Вне часов доступа","Outside your hours":"Вне часов доступа",PC:"Компьютер",Paused:"На паузе","Person %s: circle %s does not exist.":"Человек %s: круга %s нет.","Person %s: has the same personal link as %s.":"Человек %s: личная ссылка совпадает со ссылкой человека %s.","Person %s: home service %s does not exist.":"Человек %s: домашнего сервиса %s нет.","Person %s: server %s does not exist.":"Человек %s: сервера %s нет.",Phone:"Телефон","Pick AmneziaVPN in the share sheet. Not there? %s and add it in the app.":"Выберите AmneziaVPN в меню «Поделиться». Его там нет? %s и добавьте его в приложении.","Pick the file and connect":"Выберите файл и подключитесь","Point its camera at the code: the link opens there.":"Наведите камеру устройства на код - ссылка откроется на нём.","Point its camera at the code: your page opens there with this device ready to add.":"Наведите камеру устройства на код - там откроется ваша страница, и его можно будет сразу добавить.","Port must be 1-65535.":"Порт: от 1 до 65535.","QR code":"QR-код","AmneziaVPN appQR code":"QR-код",Reconnect:"Переподключить","Reconnect %s":"Переподключить %s","Reconnect %s?":"Переподключить «%s»?","RejectAfterTime must be at most 180 seconds.":"RejectAfterTime: не больше 180 секунд.",Remove:"Удалить","Remove %s?":"Удалить «%s»?",Rename:"Переименовать","Rename %s":"Переименовать «%s»","Request failed (%s)":"Не удалось выполнить запрос (%s)","Request too large.":"Слишком большой запрос.","Resets on the 1st.":"Обнуляется 1-го числа.","Return to save, Esc to cancel":"Return сохраняет, Esc отменяет",Router:"Роутер",Run:"Выполните","S2 must not be S1 + 56: the handshake initiation and response would have the same size.":"S2 не может равняться S1 + 56: начальный и ответный пакеты рукопожатия будут одного размера.","WireGuard appScan from QR code":"Сканировать QR-код","Send it to the %s":"Отправить на %s","Send it to the %s in a message or a note, then in AmneziaVPN: %s.":"Отправьте его на %s в сообщении или заметке, затем в AmneziaVPN: %s.","Send it to the %s, then import %s in %s.":"Отправьте его на %s, затем импортируйте %s в %s.","Send to AmneziaVPN":"Отправить в AmneziaVPN","Server is disabled":"Сервер выключен","Server is turned off":"Сервер выключен","Set up %s":"Настроить %s","Set up a server first.":"Сначала настройте сервер.","Settings changed":"Настройки изменились","Settings changed, update needed":"Настройки изменились, нужно обновить","Share as a file":"Поделиться файлом","Share file":"Поделиться файлом","Share the file":"Поделиться файлом","Share the link":"Поделиться ссылкой","Show key":"Показать ключ","Straight into %s":"Сразу в %s","Subnet must look like 10.77.0.0/24.":"Подсеть указывается так: 10.77.0.0/24.","Subnet overlaps %s.":"Подсеть пересекается с %s.",TB:"ТБ",Tablet:"Планшет","Tap “%s” and connect":"Нажмите «%s» и подключитесь","That name is taken.":"Это имя уже занято.","The APK is for phones without Google Play, or where the store hides the app.":"APK - для телефонов без Google Play или если магазин скрывает приложение.","The admin has turned this device off.":"Администратор отключил это устройство.","The app goes on the %s.":"Приложение ставится на %s.","The browser may warn that the certificate is not trusted: it is this router’s own. Choose to continue (“Advanced” → “Proceed”).":"Браузер может предупредить, что сертификату нельзя доверять: это собственный сертификат роутера. Продолжите переход («Дополнительные» → «Перейти на сайт»).","The configuration is too long for a code. Scan this one to open your link on the %s instead.":"Конфигурация слишком длинная для QR-кода. Отсканируйте этот код, чтобы открыть свою ссылку на %s.","The connection":"Подключение","The connection as one key":"Подключение одним ключом","The header protection key is not a key.":"Ключ защиты заголовков некорректен.","The id may use lowercase letters, digits and underscores.":"В идентификаторе можно использовать строчные латинские буквы, цифры и подчёркивания.","The key is too long for a code. Scan this one to open your link on the %s instead.":"Ключ слишком длинный для QR-кода. Отсканируйте этот код, чтобы открыть свою ссылку на %s.","The packages and the file for OpenWrt":"Пакеты и файл для OpenWrt","The page could not load":"Не удалось загрузить страницу","The person has no server.":"У человека нет сервера.","The router can’t use what it sends: reconnect it.":"Роутер не принимает то, что отправляет устройство: переподключите его.","The router drops its traffic: the address does not match.":"Роутер отбрасывает его трафик: адрес не совпадает.","Then come back here and tap":"Затем вернитесь сюда и нажмите","Then import it in the app":"Затем импортируйте его в приложении","This connection is on two devices and they push each other out. Add the other one as its own device.":"Это подключение стоит на двух устройствах, и они вытесняют друг друга. Добавьте второе как отдельное устройство.","This device":"Это устройство","This key is already in use.":"Этот ключ уже используется.","This link no longer works":"Эта ссылка больше не работает","This page is open without encryption. To add or set up a device, open the same link over HTTPS:":"Эта страница открыта без шифрования. Чтобы добавить или настроить устройство, откройте ту же ссылку по HTTPS:","Through the router":"Через роутер",Today:"Сегодня","Too many changes in a short time. Try again in a few minutes.":"Слишком много изменений за короткое время. Попробуйте ещё раз через несколько минут.","Two steps, about a minute":"Два шага, около минуты","Two steps, about a minute: get the app, then add the connection.":"Два шага, около минуты: установите приложение, затем добавьте подключение.","Unable to complete the handshake":"Не удаётся завершить рукопожатие","Unknown DNS choice.":"Неизвестный вариант DNS.","Unknown action.":"Неизвестное действие.","Unknown circle.":"Неизвестный круг.","Unknown device.":"Неизвестное устройство.","Unknown end action.":"Неизвестное действие по окончании доступа.","Unknown person.":"Неизвестный человек.","Unknown server.":"Неизвестный сервер.","Unknown service %s.":"Неизвестный сервис %s.","Up to %s characters.":"Не больше %s символов.",Uploaded:"Отправлено","Waiting for the connection":"Ждём подключения","Warning must be 0-60 days.":"Предупреждать можно за 0–60 дней.","What is it?":"Что это за устройство?","Windows PC":"Компьютер с Windows",Yesterday:"Вчера","You already have a device with this name.":"У вас уже есть устройство с таким именем.","You haven’t been added to one.":"Вас ещё не добавили ни на один сервер.","Your access":"Ваш доступ","Your access has ended.":"Ваш доступ закончился.","Your access is paused.":"Ваш доступ на паузе.","Your devices":"Ваши устройства","Your devices can’t connect until it’s enabled again.":"Ваши устройства не подключатся, пока его снова не включат.","Your devices can’t connect until it’s extended.":"Ваши устройства не подключатся, пока доступ не продлят.","Your devices can’t connect until it’s resumed.":"Ваши устройства не подключатся, пока доступ не возобновят.","Your local network stays reachable while connected.":"Ваша локальная сеть остаётся доступной при подключении.","Your network may be blocking the connection.":"Возможно, ваша сеть блокирует подключение.","bit/s":"бит/с",computer:"компьютер","on thecomputer":"компьютере",device:"устройство","on thedevice":"устройстве",ended:"закончился","ends today":"закончится сегодня","ends tomorrow":"закончится завтра","just now":"только что","kbit/s":"кбит/с",name:"имя",never:"никогда","no limit":"без лимита",phone:"телефон","on thephone":"телефоне",router:"роутер","on therouter":"роутере",tablet:"планшет","on thetablet":"планшете","this device":"это устройство"},p:{"%s already has %d device. Remove one first to lower the limit to %d.":["%s: уже %d устройство. Чтобы снизить лимит до %d, сначала удалите одно из них.","%s: уже %d устройства. Чтобы снизить лимит до %d, сначала удалите одно из них.","%s: уже %d устройств. Чтобы снизить лимит до %d, сначала удалите одно из них."],"%s day":["%s день","%s дня","%s дней"],"%s of %s slot free":["Свободно %s из %s места","Свободно %s из %s мест","Свободно %s из %s мест"],"You have reached your limit of %s device":["Достигнут лимит - %s устройство","Достигнут лимит - %s устройства","Достигнут лимит - %s устройств"],"You have reached your limit of %s device. Remove one to add another.":["Достигнут лимит - %s устройство. Удалите одно, чтобы добавить новое.","Достигнут лимит - %s устройства. Удалите одно, чтобы добавить новое.","Достигнут лимит - %s устройств. Удалите одно, чтобы добавить новое."],"day left":["день остался","дня осталось","дней осталось"],"ends in %s day":["закончится через %s день","закончится через %s дня","закончится через %s дней"]}};var mn=[{code:"en",name:"English"},{code:"ru",name:"Русский"}],ia={ru:[Jo]},Zo={en:e=>e!==1?1:0,ru:e=>e%10===1&&e%100!==11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},tr="dl.lang";function aa(e,t){var o,r;let n=s=>s&&mn.some(i=>i.code===s)?s:null;return(r=(o=n(e))!=null?o:t.map(s=>n(s.toLowerCase().split(/[-_]/)[0])).find(Boolean))!=null?r:"en"}var ft="en",co=[],nr=[],or=(e,t)=>t?`${t}${e}`:e;function rr(e,t){let n=or(e,t);for(let o of co)if(n in o.s)return o.s[n];return e}function ca(e,t,n,o){var i,c,f;let r=or(t,o),s=(i=co.find(m=>r in m.p))==null?void 0:i.p[r];return(f=s==null?void 0:s[((c=Zo[ft])!=null?c:Zo.en)(e)])!=null?f:e===1?t:n}var mt=()=>ft,sr=e=>rr(e);function lo(e,t=!0){var n;if(ft=mn.some(o=>o.code===e)?e:"en",co=(n=ia[ft])!=null?n:[],document.documentElement.lang=ft,t)try{localStorage.setItem(tr,ft)}catch{}nr.forEach(o=>o())}function ir(e){nr.push(e)}function la(){try{return localStorage.getItem(tr)}catch{return null}}Object.assign(globalThis,{_:rr,N_:ca});var er;lo(aa(la(),(er=navigator.languages)!=null&&er.length?navigator.languages:[navigator.language]),!1);var ar={phone:'',computer:'',tablet:'',router:'',server:'',other:'',ethernet:'',bridge:'',wifi:'',tunnel:'',plus:'',chart:'',reset:'',package:'',code:'',plug:'',sunrise:'',refresh:'',archive:'',qr:'',copy:'',download:'',link:'',amnezia:'',amneziawg:'',wireguard:'',appstore:'',googleplay:'',github:'',openwrt:'',apple:'',windows:'',linux:'',eye:'',share:'',arrow:'',trash:'',edit:'',pause:'',play:'',key:'',out:'',admin:'',shield:'',shieldplus:'',lock:'',zap:'',check:'',alert:'',x:'',globe:'',home:'',open:'',file:'',network:'',moon:'',chevron:'',clock:'',calendar:'',minus:'',more:'',pin:'',activity:''};function hn(e,t="dl-icon"){var o;let n=(o=ar[e])!=null?o:ar.phone;return``}function cr(e,t){let n=o=>{o==null||o===!1||(Array.isArray(o)?o.forEach(n):e.appendChild(typeof o=="string"?document.createTextNode(o):o))};t.forEach(n)}function a(e,t={},...n){let o=document.createElement(e);for(let[r,s]of Object.entries(t))s==null||s===!1||(r.startsWith("on")&&typeof s=="function"?o.addEventListener(r.slice(2),s):r==="class"?o.className=String(s):s===!0?o.setAttribute(r,""):o.setAttribute(r,String(s)));return cr(o,n),o}function Ge(e,...t){e.replaceChildren(),cr(e,t)}function _e(e){let t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstElementChild}var V=(e,t="i")=>_e(hn(e,t));var uo=typeof matchMedia=="function"?matchMedia("(prefers-reduced-motion: reduce)"):null,ae=()=>!!(uo!=null&&uo.matches),da=3e4;function ua(e,t){if(!t.some(o=>"filter"in o))return t;let n=e.getBoundingClientRect();return n.width*n.heightr)}function rt(e,t,n=1){let o=Math.sqrt(e/n),r=t/(2*Math.sqrt(e*n)),s=h=>{if(r<.999){let R=o*Math.sqrt(1-r*r);return 1-Math.exp(-r*o*h)*(Math.cos(R*h)+r*o/R*Math.sin(R*h))}if(r<=1.001)return 1-Math.exp(-o*h)*(1+o*h);let x=Math.sqrt(r*r-1),w=-o*(r-x),C=-o*(r+x);return 1-(C*Math.exp(w*h)-w*Math.exp(C*h))/(C-w)},i=0;for(let h=0;h<3;h+=.004)Math.abs(1-s(h))>.0015&&(i=h);i+=.004;let c=1-s(i),f=h=>s(h)+c*(h/i)**3,m=[];for(let h=0;h<=64;h++)m.push(+f(i*h/64).toFixed(4));m[64]=1;let M=Math.round(i*1e3);return{duration:M,easing:`linear(${m.join(", ")})`,at:h=>h>=M?1:f(h/1e3)}}var De=rt(300,20),K=rt(300,35),Fe=rt(520,24),ur=rt(520,46),he=rt(380,28),lr=rt(900,60),dr=rt(640,40),Q="cubic-bezier(0.23, 1, 0.32, 1)",J="cubic-bezier(0.55, 0, 1, 0.45)",po="cubic-bezier(0.32, 0.72, 0, 1)";function pr(e){e.style.setProperty("--spring-bouncy",De.easing),e.style.setProperty("--spring-bouncy-dur",`${De.duration}ms`),e.style.setProperty("--spring-smooth",K.easing),e.style.setProperty("--spring-smooth-dur",`${K.duration}ms`),e.style.setProperty("--spring-soft",he.easing),e.style.setProperty("--spring-soft-dur",`${he.duration}ms`),e.style.setProperty("--spring-quick",lr.easing),e.style.setProperty("--spring-quick-dur",`${lr.duration}ms`),e.style.setProperty("--spring-glide",dr.easing),e.style.setProperty("--spring-glide-dur",`${dr.duration}ms`)}function O(e,t,n){var o;return ae()?t.some(r=>"opacity"in r)?e.animate(t.map(r=>"opacity"in r?{opacity:r.opacity}:{}),{duration:Math.min(Number((o=n.duration)!=null?o:200),160),easing:"ease-out",fill:n.fill}):e.animate(t,{...n,duration:0,delay:0}):e.animate(ua(e,t),n)}function fr(e,t){return e<=0||t<=0?0:(1-1/(e*.55/t+1))*t}function mr(e,t){return e<=0||t<=0?0:e*t/(.55*Math.max(1,t-e))}function hr(e,t,n){return e<=0||t<-.1?!1:t>.4||e>n/3}function pa(){return(typeof document=="undefined"?"":document.documentElement.lang)||"en"}function He(){let e=pa();return e==="en"?"en-GB":e}function z(e,...t){let n=0;return e.replace(/%([%sd])/g,(o,r)=>{var s;return r==="%"?"%":String((s=t[n++])!=null?s:"")})}function Me(e,t){return e.toLocaleString(He(),t===void 0?void 0:{minimumFractionDigits:t,maximumFractionDigits:t})}function Xe(e,t,n){return z(N_(e,t,n),Me(e))}function ht(e,...t){let n=0;return e.split(/(%[%sd])/).filter(Boolean).map(o=>o==="%%"?"%":o==="%s"||o==="%d"?t[n++]:o)}function fa(e,t,n){let o=0;for(;e>=n&&o=100||o===0?Me(Math.round(e)):Me(e,1)} ${t[o]}`}function We(e){return fa(!e||e<0?0:e,[_("B"),_("KB"),_("MB"),_("GB"),_("TB")],1024)}function gr(e,t=Date.now()/1e3){if(!e)return _("never");let n=Math.max(0,Math.round(t-e));return n<60?_("just now"):n<3600?z(_("%s min ago"),Math.floor(n/60)):n<86400?z(_("%s h ago"),Math.floor(n/3600)):n<86400*30?z(_("%s d ago"),Math.floor(n/86400)):new Date(e*1e3).toLocaleDateString(He(),{day:"numeric",month:"short",year:"numeric"})}function gn(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Oe(e){let[t,n,o]=e.split("-").map(Number);return new Date(t,(n||1)-1,o||1,12)}function ma(e){return(typeof e=="string"?/^\d{4}-\d{2}-\d{2}$/.test(e)?Oe(e):new Date(e):e).toLocaleDateString(He(),{day:"numeric",month:"short",year:"numeric"})}function yn(e){return e?ma(e):""}function ha(e,t){let n=o=>{let[r,s,i]=o.split("-").map(Number);return Date.UTC(r,s-1,i)};return Math.round((n(e)-n(t))/864e5)}function gt(e,t){let n=Oe(e);return n.setDate(n.getDate()+t),gn(n)}function vn(e,t=Date.now()){if(!e)return null;let n=typeof t=="number"?gn(new Date(t)):t,o=ha(e,n);return o>=0?o+1:o}function Ft(e,t){return t!=null&&t>0&&e.expire_warn>0&&t<=e.expire_warn}function yr(e){return e<=1?_("ends today"):e===2?_("ends tomorrow"):Xe(e,"ends in %s day","ends in %s days")}function vr(e){return{lan:_("Home network"),internet:_("Internet"),both:_("Home network + Internet")}[e]}var bn=20,ga=[[128,191],[215,215],[247,247],[8192,11263],[12288,12351],[55296,63743],[65024,65039],[65072,65103],[65279,65279],[65520,65535],[126976,130047],[917504,917631]],ya=/^[A-Za-z0-9 ._-]$/,va=/^[\p{L}\p{M}\p{N}]$/u;function xn(e){var n;let t=(n=e.codePointAt(0))!=null?n:0;return t<128?ya.test(e):!ga.some(([o,r])=>t>=o&&t<=r)&&va.test(e)}function fo(e){let t=[...e];return t.length<=bn&&t.every(xn)}function yt(e,t=""){return[...[...e].map(r=>xn(r)?r:" ").join("").replace(/\s+/g," ").trim()||_("Device")].slice(0,Math.max(1,bn-[...t].length)).join("").trimEnd()+t}function mo(e){return e==="other"?_("Device"):ho(e)}function ho(e){return{computer:_("PC"),phone:_("Phone"),tablet:_("Tablet"),router:_("Router"),other:_("Other")}[e]}function wn(e){let t=n=>n.disabled?3:n.online?0:n.handshake?1:2;return e.map((n,o)=>[n,o]).sort((n,o)=>t(n[0])-t(o[0])||n[1]-o[1]).map(([n])=>n)}function br(e){return e.map(t=>t.endsWith(".0/24")?`${t.slice(0,-5)}.x`:t).join(", ")}var Ee={vpn:"AmneziaVPN",awg:"AmneziaWG",wg:"WireGuard"};function wr(e,t=0){return/iPhone|iPad|iPod/.test(e)||/Macintosh/.test(e)&&t>1?"ios":/Android/.test(e)?"android":/Windows/.test(e)?"windows":/Mac OS X|Macintosh/.test(e)?"mac":/CrOS/.test(e)?"unknown":/Linux|X11/.test(e)?"linux":"unknown"}var Mr=e=>/Telegram|FBAN|FBAV|Instagram|VKClient|Line\//i.test(e);function Er(e,t,n=!1){return e==="router"||t==="unknown"?!1:e==="phone"||e==="tablet"?t==="ios"||t==="android":e==="computer"?t==="windows"||t==="mac"||t==="linux":n||t==="windows"||t==="mac"||t==="linux"}function kr(e){let t=[{id:"vpn",name:Ee.vpn},{id:"awg",name:Ee.awg}];return e==="off"&&t.push({id:"wg",name:Ee.wg}),t}var Mn="https://github.com/amnezia-vpn/amnezia-client/releases/latest",xr=e=>({href:e,top:_("APK file on"),main:"GitHub",mark:"github",why:_("The APK is for phones without Google Play, or where the store hides the app.")});function Lr(e,t){var i;let n=_("Download on the"),o=_("Get it on"),r=_("Official release on GitHub");return(i={vpn:{ios:{href:"https://apps.apple.com/app/amneziavpn/id1600529900",top:n,main:"App Store",mark:"appstore"},android:{href:"https://play.google.com/store/apps/details?id=org.amnezia.vpn",top:o,main:"Google Play",mark:"googleplay",alt:xr(Mn)},windows:{href:Mn,top:r,main:_("Download for Windows"),mark:"windows"},mac:{href:Mn,top:r,main:_("Download for Mac"),mark:"apple"},linux:{href:Mn,top:r,main:_("Download for Linux"),mark:"linux"}},awg:{ios:{href:"https://apps.apple.com/us/app/amneziawg/id6478942365",top:n,main:"App Store",mark:"appstore"},android:{href:"https://play.google.com/store/apps/details?id=org.amnezia.awg",top:o,main:"Google Play",mark:"googleplay",alt:xr("https://github.com/amnezia-vpn/amneziawg-android/releases")},windows:{href:"https://github.com/amnezia-vpn/amneziawg-windows-client/releases",top:r,main:_("Download for Windows"),mark:"windows"},mac:{href:"https://apps.apple.com/us/app/amneziawg/id6478942365",top:n,main:"Mac App Store",mark:"appstore"},linux:{href:"https://github.com/amnezia-vpn/amneziawg-tools",top:_("On GitHub"),main:"amneziawg-tools",mark:"linux"}},wg:{ios:{href:"https://apps.apple.com/app/wireguard/id1441195209",top:n,main:"App Store",mark:"appstore"},android:{href:"https://play.google.com/store/apps/details?id=com.wireguard.android",top:o,main:"Google Play",mark:"googleplay"},windows:{href:"https://www.wireguard.com/install/",top:_("Download from"),main:"wireguard.com",mark:"windows"},mac:{href:"https://apps.apple.com/app/wireguard/id1451685025",top:n,main:"Mac App Store",mark:"appstore"},linux:{href:"https://www.wireguard.com/install/",top:_("Install from"),main:"wireguard.com",mark:"linux"}}}[e][t])!=null?i:null}var Cr=e=>e==="wg"?{href:"https://openwrt.org/docs/guide-user/services/vpn/wireguard/start",top:_("OpenWrt packages"),main:"wireguard-tools",mark:"openwrt"}:{href:"https://openwrt.org/packages/start",top:_("OpenWrt packages + kmod"),main:"amneziawg-tools",mark:"openwrt"},go=e=>e==="android",qt=e=>`${e.replace(/\.conf$/i,"")}.vpn`,Je=(...e)=>e.join(" → ");function Wt(e){return{ios:{file:Je("+",_("Create from file or archive","WireGuard app")),qr:Je("+",_("Create from QR code","WireGuard app"))},android:{file:Je("+",_("Import from file or archive","WireGuard app")),qr:Je("+",_("Scan from QR code","WireGuard app"))},mac:{file:Je("+",_("Import Tunnel(s) from File…","WireGuard app"))},windows:{file:Je(_("Add Tunnel","WireGuard app"),_("Import tunnel(s) from file…","WireGuard app"))}}[e]}function Kt(e,t="unknown"){var o;if(e==="vpn")return Je("+",_("QR code","AmneziaVPN app"));let n=(o=Wt(t))==null?void 0:o.qr;return n!=null?n:z(_("%s (Android: %s)"),Wt("ios").qr,Wt("android").qr.replace(/^.* → /,""))}function En(e,t="unknown"){var n;return e==="vpn"?Je("+",_("Insert","AmneziaVPN app")):((n=Wt(t))!=null?n:Wt("android")).file}var Tr=()=>z(_("Tap “%s” and connect"),_("Continue","AmneziaVPN app"));function _r(e,t,n,o){if(t==="linux")return[[_("Open a terminal in the folder with the file"),""],[`${_("Run")} `,`sudo ${e==="wg"?"wg-quick":"awg-quick"} up ./${n}`]];let r=En(e,t);return[[z(_("Open %s","step"),Ee[e]),""],[r.replace(/ → [^→]*$/," → "),r.replace(/^.* → /,"")],[o?_("Confirm the import and connect"):_("Pick the file and connect"),""]]}function Sr(e){return{ios:"iPhone / iPad",android:"Android",windows:"Windows",mac:"Mac",linux:"Linux",unknown:_("this device")}[e]}var Ar=(e,t)=>`${e}#setup=${t}`;function $r(e){var t,n;return(n=(t=/^#setup=(d_[0-9a-f]{8})$/.exec(e))==null?void 0:t[1])!=null?n:null}var Hr=e=>`${e}#add`,Pr=e=>e==="#add",yo=(e,t=!1)=>(t?{phone:_("phone","on the"),tablet:_("tablet","on the"),computer:_("computer","on the"),router:_("router","on the"),other:_("device","on the")}:{phone:_("phone"),tablet:_("tablet"),computer:_("computer"),router:_("router"),other:_("device")})[e];var re=null,ge=()=>re;function Le(e){re=e}var ba=document.getElementById("app"),Dr,vt=(Dr=ba.dataset.base)!=null?Dr:"",Or=/^\/[a-z]{6}-[a-z]{6}-[a-z]{6}$/.test(vt)?vt.slice(1):"",bt=()=>location.origin+location.pathname,qe=()=>{var e;return(e=re==null?void 0:re.today)!=null?e:gn(new Date)},xt=()=>{var e;return(e=re==null?void 0:re.now)!=null?e:Date.now()/1e3},kn=()=>wr(navigator.userAgent,navigator.maxTouchPoints),xa=()=>(re==null?void 0:re.server.awg_disguise)===!1,Rr=()=>{var e;return(e=re==null?void 0:re.server.preset)!=null?e:xa()?"off":"max"},Nr=()=>(re==null?void 0:re.https_url)||null,Ke=()=>(re==null?void 0:re.server.name)||"Dawnline",Br=()=>{};function Ir(e){Br=e}var Se=(e={})=>Br(e);var Ze=class extends Error{constructor(n,o,r){super(o);this.status=n;this.httpsUrl=r}};async function ke(e,t){let n=await fetch(`${vt}/api/${e}`,{method:t===void 0?"GET":"POST",credentials:"omit",headers:t===void 0?{"Accept-Language":mt()}:{"Content-Type":"application/json","Accept-Language":mt()},body:t===void 0?void 0:JSON.stringify(t),cache:"no-store"}),o=null;try{o=await n.json()}catch{}if(!n.ok)throw new Ze(n.status,o!=null&&o.error?sr(o.error):z(_("Request failed (%s)"),n.status),(o==null?void 0:o.https_url)||void 0);return o}var Ln=e=>e instanceof Ze&&(e.status===404||e.status===401);var zr=ra(qr(),1),wa=e=>``,Kr="#0a0a0a",Ma="#f2f2f2",Ea={night:[Kr,Ma],day:["#ffffff",Kr]},Cn=e=>e.length>300,zt=null;function Vr(e){if((zt==null?void 0:zt.text)===e)return zt.qr;let t=(0,zr.default)(0,Cn(e)?"L":"H");return t.addData(e,"Byte"),t.make(),zt={text:e,qr:t},t}function ka(e){try{return Vr(e),!0}catch{return!1}}var La=1600,Ur=e=>e.length<=La&&ka(e),wt=e=>+e.toFixed(2);function vo(e,t,n,o,r){return`M${wt(e+r)} ${wt(t)}h${wt(n-2*r)}a${r} ${r} 0 0 1 ${r} ${r}v${wt(o-2*r)}a${r} ${r} 0 0 1 -${r} ${r}h-${wt(n-2*r)}a${r} ${r} 0 0 1 -${r} -${r}v-${wt(o-2*r)}a${r} ${r} 0 0 1 ${r} -${r}z`}function Yr(e,t=3,n=!0,o="plain"){let r=Cn(e),s=o!=="plain",[i,c]=s?Ea[o]:["#fff","#000"],f=Vr(e),m=f.getModuleCount(),M=m+t*2,h=n&&!r?Math.round(m*.22):0;h&&(m-h)%2&&h++;let x=(m-h)/2,w=x+h,C=(u,d)=>h>0&&u>=x&&u=x&&ds&&(d<7&&u<7||d<7&&u>=m-7||d>=m-7&&u<7),P="";if(s){let u=r?.48:.42;for(let d=0;d${wa(s?i:"#fff")}`}let v=``;return s?`${v}${g}`:`${v}${g}`}var jr={opacity:1,filter:"blur(0px)",transform:"none"},Ca={opacity:0,filter:"blur(5px)",transform:"scale(.86)"},Qr={opacity:0,filter:"blur(5px)",transform:"scale(.6)"},Xr={duration:180,easing:J,fill:"forwards"},Vt={duration:340,delay:70,easing:Q,fill:"backwards"},Jr=Vt.delay+Vt.duration,Tn=new WeakMap;function _n(e){let t=getComputedStyle(e);return{opacity:t.opacity,filter:t.filter==="none"?"blur(0px)":t.filter,transform:t.transform}}function Zr(e){var t;for(let n of[...e.childNodes])n.nodeType===Node.TEXT_NODE&&((t=n.textContent)!=null&&t.trim())&&n.replaceWith(a("span",{},n.textContent));return[...e.children].filter(n=>!n.classList.contains("orb"))}function es(e,t){var o;let n=(o=Tn.get(e))!=null?o:[];Tn.set(e,t),n.forEach(r=>r.cancel())}function ts(e){let t=Zr(e),n=t.map(_n),o=e.querySelector(":scope > .orb"),r=o!=null?o:a("span",{class:"orb","aria-hidden":"true"},a("i"),a("i"));o||e.append(r),e.classList.add("busy"),e.setAttribute("aria-busy","true"),es(e,[...t.map((s,i)=>O(s,[n[i],Ca],Xr)),O(r,[o?_n(o):Qr,jr],o?{...Vt,delay:0}:Vt)])}function ns(e){let t=e.querySelector(":scope > .orb"),n=Zr(e),o=[...t?[O(t,[_n(t),Qr],Xr)]:[],...n.map(r=>O(r,[_n(r),jr],Vt))];es(e,o),e.removeAttribute("aria-busy"),Promise.all(o.map(r=>r.finished)).then(()=>{Tn.get(e)===o&&(Tn.delete(e),o.forEach(r=>r.cancel()),t==null||t.remove(),e.classList.remove("busy"))},()=>{})}var os=e=>[...e].map(t=>a("i",{},t)),st=new WeakMap,ye=e=>{var t,n,o;return(o=(n=(t=st.get(e))==null?void 0:t.text)!=null?n:e.textContent)!=null?o:""},Ut={opacity:1,filter:"blur(0px)"},Ta=e=>e.opacity>.99&&(e.filter==="none"||e.filter==="blur(0px)");function it(e){let t=getComputedStyle(e),n=e.querySelector(":scope > .mt-new"),o=n&&getComputedStyle(n);return{opacity:+t.opacity*(o?+o.opacity:1),filter:t.filter==="none"&&o?o.filter:t.filter}}function An(e){let t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect()}function _a(e){let t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect()}function rs(e){var s;let t=e.firstChild;if(!t||t.nodeType!==Node.TEXT_NODE)return[];let n=document.createRange(),o=[],r=0;for(let i of(s=t.textContent)!=null?s:"")n.setStart(t,r),n.setEnd(t,r+i.length),o.push(n.getBoundingClientRect().left),r+=i.length;return o.map(i=>i-o[0])}function ss(e,t){let n=[...e.children];n.length&&n.forEach((o,r)=>{if(!r||t[r]===void 0)return;let s=n[0].getBoundingClientRect().left+t[r]-o.getBoundingClientRect().left;Math.abs(s)>.01&&(o.style.marginLeft=`${s}px`)})}function Sa(e,t){let n=0;for(;nnew Array(s.length+1).fill(0));for(let f=r.length-1;f>=0;f--)for(let m=s.length-1;m>=0;m--)i[f][m]=r[f]===s[m]?i[f+1][m+1]+1:Math.max(i[f+1][m],i[f][m+1]);let c=[];for(let f=0;f=i[f][m+1]?f++:m++;for(let f=o;f>0;f--)c.push([e.length-f,t.length-f]);return c}function Sn(e){let t=st.get(e);t&&(clearTimeout(t.timer),st.delete(e),e.getAnimations().forEach(n=>n.cancel()),e.classList.remove("mt","mt-ib","mt-run"),e.textContent=t.text)}function se(e,t){Sn(e),e.textContent=t}function Aa(e){let t=e.querySelector(":scope > .mt-new");if(!t)return null;let n=[...e.querySelectorAll(":scope > .mt-old")],o=An(t);return t.remove(),n.forEach(r=>r.remove()),{words:t,at:o,going:n}}function Mo(e,t=0,n=Ut){return O(e,[{opacity:n.opacity,filter:n.filter,transform:"none"},{opacity:0,filter:"blur(4px)",transform:"translateY(-0.45em)"}],{duration:220,delay:t,easing:J,fill:"forwards"})}function Eo(e,t=0){return O(e,[{opacity:0,filter:"blur(4px)",transform:"translateY(0.45em)"},{opacity:1,filter:"blur(0px)",transform:"none"}],{duration:380,delay:120+t,easing:Q,fill:"backwards"})}function ee(e,t,n=ye(e),o={}){var de,Ie,S,H,k,D,$,I;let{whole:r=!1,at:s}=o,i=st.get(e);if(i&&n===i.text&&t===i.text)return;let c=((de=o.glide)!=null?de:!0)&&!s,f=i?e.getBoundingClientRect():null,m=i&&n===i.text&&!ae()&&e.getClientRects().length?Aa(e):null;if(Sn(e),n===t||ae()||!e.getClientRects().length){e.textContent=t;return}let M=getComputedStyle(e),h=r&&M.display==="inline";M.display==="inline"&&!r&&e.classList.add("mt-ib"),M.position==="static"&&e.classList.add("mt"),e.classList.add("mt-run");let x=m?f:null,w=(S=(Ie=m==null?void 0:m.at)!=null?Ie:s)!=null?S:null,C=[];w||(e.textContent=n,x=e.getBoundingClientRect(),w=An(e),C=rs(e)),e.textContent=t;let R=e.getBoundingClientRect(),P=rs(e),T=(k=(H=f==null?void 0:f.width)!=null?H:x==null?void 0:x.width)!=null?k:R.width,g=c&&!h&&!!x&&Math.abs(R.width-T)>.5,v=!g||!x||Math.abs(R.left-x.left)<.5?"start":Math.abs(R.right-x.right)<.5?"end":"middle",u=a("span",{class:r?"mt-new w":"mt-new"},r?t:os(t)),d=(D=m==null?void 0:m.words)!=null?D:a("span",{class:r?"mt-old w":"mt-old"},r?n:os(n));if(d.classList.replace("mt-new","mt-old"),d.setAttribute("aria-hidden","true"),d.classList.contains("w")&&(d.style.width=`${w.width+1}px`),e.replaceChildren(u,d),m&&e.append(...m.going),o.color){d.style.color=o.color;let G=getComputedStyle(e).color;G!==o.color&&O(u,[{color:o.color},{color:G}],{duration:280,easing:Q})}g&&O(e,[{width:`${T}px`},{width:`${R.width}px`}],{duration:K.duration,easing:K.easing,fill:"forwards"});let l=e.getBoundingClientRect(),b=(G,W)=>{d.style.top=`${W}px`,v==="end"?d.style.right=`${-G}px`:v==="middle"?(d.style.left="50%",d.style.translate=`calc(-50% + ${G}px) 0`):d.style.left=`${G}px`},y=v==="end"?w.right-l.right:v==="middle"?(w.left+w.right-l.left-l.right)/2:w.left-l.left;b(y,w.top-l.top);let p=!m&&(($=d.querySelector("i"))==null?void 0:$.firstChild),L=p?_a(p):An(d);b(y+w.left-L.left,w.top-l.top+w.top-L.top);let E=m?it(d):(I=o.shows)!=null?I:Ut,A=()=>{let G=d.getAnimations();O(d,[{opacity:E.opacity,filter:E.filter},{opacity:0,filter:"blur(4px)"}],{duration:180*E.opacity,easing:J,fill:"forwards"}),G.forEach(W=>W.cancel())};if(r){A(),O(u,[{opacity:0,filter:"blur(4px)"},{opacity:1,filter:"blur(0px)"}],{duration:280,delay:60,easing:Q,fill:"backwards"});let G=Math.max(340,g?K.duration:0)+40;st.set(e,{text:t,timer:window.setTimeout(()=>Sn(e),G)});return}ss(u,P),m||ss(d,C);let F=d.classList.contains("w")?[]:[...d.children],B=[...u.children],N=F.length?Sa([...n],[...t]):[],q=new Set(N.map(([G])=>G)),Y=new Set(N.map(([,G])=>G));N.forEach(([G,W])=>{let X=F[G].getBoundingClientRect(),oe=B[W].getBoundingClientRect(),U=m?it(F[G]):E;F[G].style.visibility="hidden";let we=Math.abs(X.left-oe.left)>.5||Math.abs(X.top-oe.top)>.5,ue=Ta(U)?null:U;(we||ue)&&O(B[W],[{transform:`translate(${X.left-oe.left}px, ${X.top-oe.top}px)`,...ue},{transform:"none",...ue&&Ut}],{duration:K.duration,easing:K.easing})});let Z=m?[]:F.filter((G,W)=>!q.has(W));m&&A();let te=B.filter((G,W)=>!Y.has(W)),le=Math.min(12,160/Math.max(1,Z.length)),me=Math.min(22,260/Math.max(1,te.length));Z.forEach((G,W)=>Mo(G,W*le,E)),te.forEach((G,W)=>Eo(G,W*me));let Be=Math.max(220+Z.length*le,te.length?120+te.length*me+380:0,g||N.length?K.duration:0)+40;st.set(e,{text:t,timer:window.setTimeout(()=>Sn(e),Be)})}function Yt(e){return new Map([...e.querySelectorAll("[data-t]")].map(t=>[t.dataset.t,{text:ye(t),color:getComputedStyle(t).color,whole:t.hasAttribute("data-whole")}]))}function jt(e,t,n=[]){e.querySelectorAll("[data-t]").forEach(o=>{let r=t.get(o.dataset.t),s=ye(o);!r||r.text===s||st.has(o)||n.some(i=>i.contains(o))||ee(o,s,r.text,{color:r.color,whole:r.whole})})}var as=e=>e instanceof HTMLElement||e instanceof SVGElement,bo=e=>as(e)?e:a("span",{},e),wo=e=>`${e.tagName}.${[...e.classList].filter(t=>t!=="mt"&&t!=="mt-ib").join(" ")}`,cs=e=>e.outerHTML.replace(/\bgl\d+/g,"gl"),et=new Map,$n=new WeakMap,ls=new WeakSet;function $a(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(et.has(n))return!0;return!1}function Ha(e){var n;let t=(n=$n.get(e))!=null?n:0;!t&&getComputedStyle(e).position==="static"&&(e.classList.add("mt"),ls.add(e)),$n.set(e,t+1)}function is(e){var n;let t=((n=$n.get(e))!=null?n:1)-1;$n.set(e,t),!t&&ls.delete(e)&&e.classList.remove("mt")}function Mt(e,t,n,o,r=Ut){let s=et.get(e);if(s&&is(s),Ha(n),et.set(e,n),e.style.position="absolute",e.style.margin="0",e.style.left=`${t.left-o.left-n.clientLeft}px`,e.style.top=`${t.top-o.top-n.clientTop}px`,e.style.right="",e.style.translate="",e.style.width=`${t.width}px`,e.style.pointerEvents="none",e.setAttribute("aria-hidden","true"),n.appendChild(e),s)return;let i=e.getAnimations(),c=O(e,[{opacity:r.opacity,filter:r.filter},{opacity:0,filter:"blur(4px)"}],{duration:180*r.opacity,easing:J,fill:"forwards"});i.forEach(f=>f.cancel()),c.onfinish=c.oncancel=()=>{let f=et.get(e);f&&(et.delete(e),is(f),e.remove())}}function Pa(e){let t=new Map,n=(o,r)=>o.childNodes.forEach((s,i)=>{var M,h;let c=`${r}/${i}`;if(s.nodeType===Node.TEXT_NODE){if((M=s.textContent)!=null&&M.trim()){let x=document.createRange();x.selectNodeContents(s);let w=x.getBoundingClientRect();t.set(c,{kind:"#text",text:s.textContent,svg:"",at:w,words:w,node:s,shows:Ut})}return}if(!(s instanceof Element)||et.has(s)||s.classList.contains("mt-old"))return;let f=s instanceof SVGElement?cs(s):"",m=s instanceof HTMLElement&&!f?An((h=s.querySelector(":scope > .mt-new"))!=null?h:s):null;t.set(c,{kind:wo(s),text:s instanceof HTMLElement?ye(s):"",svg:f,at:s.getBoundingClientRect(),words:m,node:s,shows:it(s)}),f||n(s,c)});return n(e,""),t}function Da(e,t,n){let o={duration:K.duration,easing:K.easing};if(!(e instanceof HTMLElement)||getComputedStyle(e).display!=="inline")return O(e,[{transform:`translate(${t}px, ${n}px)`},{transform:"none"}],o);let r=e.style.position;getComputedStyle(e).position==="static"&&(e.style.position="relative");let s=O(e,[{left:`${t}px`,top:`${n}px`},{left:"0px",top:"0px"}],o);return s.onfinish=s.oncancel=()=>e.style.position=r,s}function ze(e,t){var r,s;let n=+getComputedStyle(e).opacity,o=(r=t==null?void 0:t.opacity)!=null?r:0;O(e,[{opacity:o,filter:(s=t==null?void 0:t.filter)!=null?s:"blur(4px)"},{opacity:n,filter:"blur(0px)"}],{duration:280*Math.min(1,Math.max(0,n-o)/(n||1)),delay:t?0:60,easing:Q,fill:"backwards"})}function tt(e,t){let n=Pa(e),o=e.getBoundingClientRect(),r=[...et.keys(),...e.querySelectorAll(".mt-old")].filter(T=>e.contains(T)&&!$a(T,e)&&as(T)).map(T=>({g:T,at:T.getBoundingClientRect(),over:T.parentElement,shows:et.has(T)?void 0:it(T)})),s=new Map([...n].map(([T,g])=>[g.node,T]));Ge(e,t);let i=new Map,c=()=>r.forEach(({g:T,at:g,over:v,shows:u})=>{let d=v&&s.get(v),l=d&&i.get(d),b=d&&n.get(d);l&&b&&b.at&&b.kind===wo(l)?Mt(T,g,l,b.at,u):Mt(T,g,e,o,u)});if(!n.size||ae())return c(),[];let f=e.getBoundingClientRect(),m=T=>T&&new DOMRect(T.left-o.left+f.left,T.top-o.top+f.top,T.width,T.height),M=[],h=[],x=new Set,w=[],C=(T,g,v)=>{var l;let u=T.parentElement,d=v?(l=n.get(v))==null?void 0:l.at:o;g!=null&&g.at&&h.push(u&&d?[bo(g.node),g.at,u,d,g.shows]:[bo(g.node),g.at,e,o,g.shows]),w.push(T),M.push(()=>ze(T))},R=(T,g,v)=>{let u=T.getBoundingClientRect(),d=g.left-o.left-(u.left-f.left),l=g.top-o.top-(u.top-f.top),b=d-v[0],y=l-v[1];return(Math.abs(b)>.5||Math.abs(y)>.5)&&Da(T,b,y),[d,l]},P=(T,g,v)=>[...T.childNodes].forEach((u,d)=>{var F,B;let l=`${g}/${d}`;x.add(l);let b=n.get(l);if(u.nodeType===Node.TEXT_NODE){let N=(F=u.textContent)!=null?F:"";if(!N.trim())return;let q=b&&(b.kind==="#text"||b.node instanceof HTMLElement&&!b.node.children.length)?b.text:null,Y=b&&b.shows.opacity<.99?b.shows:null;if(q===N&&!Y)return;let Z=a("span",{},N);if(u.replaceWith(Z),q===null||Math.max(N.length,q.length)>40)return C(Z,b,g);b!=null&&b.at&&R(Z,b.at,v),M.push(()=>{var te;return q===N?ze(Z,Y):ee(Z,N,q,{whole:!0,at:(te=m(b.words))!=null?te:void 0,shows:b.shows})});return}if(!(u instanceof Element))return;i.set(l,u);let y=u.getBoundingClientRect(),p=u instanceof SVGElement;if(!b||b.kind!==wo(u)||(p?b.svg!==cs(u):b.at&&Math.abs(b.at.height-y.height)>1))return C(u,b,g);let L=b.at?R(u,b.at,v):v,E=+getComputedStyle(u).opacity,A=Math.abs(b.shows.opacity-E)>.01?b.shows:null;if(p){A&&M.push(()=>ze(u,A));return}if(!u.children.length&&u instanceof HTMLElement){let N=(B=u.textContent)!=null?B:"";if(N===b.text||u.dataset.t)A&&M.push(()=>ze(u,A));else if(N.length<=40&&b.text.length<=40){let q={opacity:Math.min(1,b.shows.opacity/(E||1)),filter:b.shows.filter};M.push(()=>{var Y;return ee(u,N,b.text,{whole:!0,at:(Y=m(b.words))!=null?Y:void 0,shows:q})})}else C(u,b,g);return}A&&M.push(()=>ze(u,A)),P(u,l,L)});P(e,"",[0,0]);for(let[T,g]of n)!x.has(T)&&T.lastIndexOf("/")===0&&g.at&&h.push([bo(g.node),g.at,e,o,g.shows]);M.forEach(T=>T());for(let[T,g,v,u,d]of h)Mt(T,g,v,u,d);return c(),w}var Oa='',xo=()=>[V("apple"),_e(Oa)];function Ra(e,t){if(e===t)return["",e,e,""];let n=e.split(" "),o=t.split(" "),r=0;for(;rf?g[2]:g[1],M=g=>a("span",{class:"osm-p"},g),h=()=>{i=r.findIndex(g=>g[1]!==g[2]),i<0&&(f=0),s=r.map(g=>({pre:M(g[0]),word:M(m(g)),suf:M(g[3])})),c=i>=0?a("span",{class:"osm-ic"},xo()[f]):null,n.replaceChildren(...s.flatMap((g,v)=>[v?a("span",{class:"arr"},"›"):null,g.pre,v===i?c:null,g.word,g.suf]).filter(g=>!!g))},x={width:"1.05em",marginRight:"0.25em"},w=g=>{let v=getComputedStyle(g),u=Math.min(1,parseFloat(v.width)/(1.05*parseFloat(v.fontSize))||0),d=g.getAnimations();O(g,[{opacity:v.opacity,filter:v.filter,width:v.width,marginRight:v.marginRight},{opacity:0,filter:"blur(3px)",width:"0px",marginRight:"0px"}],{duration:220*u,easing:J,fill:"forwards"}).onfinish=()=>g.remove(),d.forEach(l=>l.cancel())},C=g=>O(g,[{opacity:0,filter:"blur(3px)",width:"0px",marginRight:"0px"},{opacity:1,filter:"blur(0px)",...x}],{duration:K.duration,easing:K.easing}),R=(g,v)=>{o.setAttribute("aria-label",(g===v?g:z(_("%s (Android: %s)"),g,v.split(" → ").pop())).replace(/ → /g," › "));let u=g.split(" → "),d=v.split(" → "),l=u.map((y,p)=>{var L;return Ra(y,(L=d[p])!=null?L:y)});if(!s.length||l.length!==r.length)return r=l,h();let b=i;r=l,i=r.findIndex(y=>y[1]!==y[2]),i<0&&(f=0),r.forEach((y,p)=>{ee(s[p].pre,y[0],void 0,{whole:!0}),ee(s[p].word,m(y),void 0,{whole:!0}),ee(s[p].suf,y[3],void 0,{whole:!0})}),i!==b&&(c&&w(c),c=i>=0?a("span",{class:"osm-ic"},xo()[f]):null,c&&(s[i].word.before(c),C(c)))};R(e,t);let P=()=>{if(!o.isConnected)return clearInterval(T);if(i<0||!c||!o.offsetParent)return;f=1-f,ee(s[i].word,m(r[i]));let g=c.firstElementChild,v=xo()[f];if(ae()){g.replaceWith(v);return}c.appendChild(v),O(g,[{opacity:1,filter:"blur(0px)",transform:"none"},{opacity:0,filter:"blur(3px)",transform:"scale(.5) rotate(-40deg)"}],{duration:200,easing:J,fill:"forwards"}).onfinish=()=>g.remove(),O(v,[{opacity:0,filter:"blur(3px)",transform:"scale(.5) rotate(40deg)"},{opacity:1,filter:"blur(0px)",transform:"none"}],{duration:Fe.duration,delay:80,easing:Fe.easing,fill:"backwards"})},T=window.setInterval(P,3e3);return{el:o,set:R}}var Hn=null,Qt=null,us=0;function ps(e,t,n){let o=getComputedStyle(e),r=O(e,[{opacity:o.opacity,transform:o.transform,filter:o.filter},t],{duration:n,easing:J,fill:"forwards"});e.getAnimations().forEach(s=>s!==r&&s.cancel()),r.onfinish=()=>e.remove()}function Re(e,t=!1){Hn!=null||(Hn=document.body.appendChild(a("div",{class:"toasts"}))),Qt&&ps(Qt,{opacity:0,transform:"scale(.96)",filter:"blur(4px)"},140);let n=a("div",{class:`toast${t?" bad":""}`,role:"status"},V(t?"alert":"check"),a("span",{},e));Hn.appendChild(n),Qt=n,O(n,[{opacity:0,transform:"translateY(18px) scale(.9)",filter:"blur(6px)"},{opacity:1,transform:"none",filter:"none"}],{duration:De.duration,easing:De.easing}),clearTimeout(us),us=window.setTimeout(()=>{Qt===n&&(Qt=null,ps(n,{opacity:0,transform:"translateY(6px) scale(.96)",filter:"blur(4px)"},180))},2400)}function fs(e,t){var o;let n=typeof t=="string"?V(t,(o=e.getAttribute("class"))!=null?o:"i"):t;return e.replaceWith(n),O(n,[{opacity:0,transform:"scale(.6)",filter:"blur(3px)"},{opacity:1,transform:"none",filter:"none"}],{duration:Fe.duration,easing:Fe.easing}),n}function Na(e){if(e.classList.contains("copied"))return;let t=e.querySelector("svg.i"),n=e.querySelector(".lbl, .b-main"),o=n?ye(n):"";e.classList.add("copied");let r=t?fs(t,"check"):null;n&&ee(n,_("Copied")),setTimeout(()=>{r&&t&&fs(r,t),n&&ee(n,o),e.classList.remove("copied")},1600)}async function ve(e,t=_("Copied"),n){try{await navigator.clipboard.writeText(e)}catch{let o=a("textarea",{class:"offscreen"},e);document.body.appendChild(o),o.select();let r=document.execCommand("copy");if(o.remove(),!r)return Re(_("Copying is blocked here. Select the text and copy it by hand."),!0)}n instanceof Element&&Na(n),Re(t)}function at(e,t){var r;let n=navigator;if(kn()!=="ios"||typeof n.share!="function"||typeof File=="undefined")return null;let o=new File([t],e,{type:"application/octet-stream"});return(r=n.canShare)!=null&&r.call(n,{files:[o]})?async()=>{try{await n.share({files:[o]})}catch(s){(s==null?void 0:s.name)!=="AbortError"&&Pn(e,t)}}:null}function Pn(e,t){let n=URL.createObjectURL(new Blob([t],{type:"application/octet-stream"})),o=a("a",{href:n,download:e,class:"offscreen"});document.body.appendChild(o),o.click(),setTimeout(()=>{URL.revokeObjectURL(n),o.remove()},1e3)}function Xt(e,t){let n=at(e,t);n?n():Pn(e,t)}async function Et(e,t){if(e.disabled)return;e.disabled=!0,ts(e);let n=performance.now();try{await t()}finally{let o=ae()?0:Jr-(performance.now()-n);o>0&&await new Promise(r=>setTimeout(r,o)),ns(e),e.disabled=!1}}var Dn=matchMedia("(prefers-color-scheme: light)"),Ba=()=>Dn.matches?"day":"night";function ko(e){let t=_e(Yr(e,3,!0,Ba()));return t.dataset.qr=e,t}function ms(e,t){e.dataset.qr=t.dataset.qr,e.classList.toggle("dense",Cn(t.dataset.qr)),e.classList.toggle("light",Dn.matches),e.dataset.mods=String(t.viewBox.baseVal.width)}function Jt(e,t=!1){let n=a("div",{class:`qrbox${t?" big":""}`}),o=ko(e);return n.append(o),ms(n,o),n}Dn.addEventListener("change",()=>document.querySelectorAll(".qrbox[data-qr]").forEach(e=>{e.querySelectorAll(":scope > svg[data-qr]").forEach(t=>t.replaceChildren(...ko(t.dataset.qr).childNodes)),e.classList.toggle("light",Dn.matches)}));function Ia(e){let t=getComputedStyle(e);return{opacity:t.opacity,filter:t.filter==="none"?"blur(0px)":t.filter}}function Lo(e,t,n){let o=w=>!!n&&!Ur(w),r=t,s=o(e),i=Jt(s?n.text:e),c=a("div",{class:"words"},s?n.words():r),f=a("div",{class:"side"},c),m=a("div",{class:`coderow${i.classList.contains("dense")?" stacked":""}`},i,f),M=null,h=new WeakSet,x=w=>{var A,F;let C=[...i.querySelectorAll(":scope > svg")],R=new Map(C.map(B=>[B,+getComputedStyle(B).opacity])),P=getComputedStyle(i),T=i.getBoundingClientRect(),g=parseFloat(P.borderTopLeftRadius)*new DOMMatrix(P.transform).a,v=(A=C.find(B=>B.dataset.qr===w))!=null?A:ko(w),u=C.indexOf(v);u<0&&i.prepend(v);let d=C.slice(u+1).filter(B=>!h.has(B)),l=C.slice(0,Math.max(0,u)),b=[v,...d].flatMap(B=>B.getAnimations());h.delete(v),ms(i,v),m.classList.toggle("stacked",i.classList.contains("dense"));let y=(F=R.get(v))!=null?F:0;O(v,[{opacity:y},{opacity:1}],{duration:200*(1-y),easing:Q}).onfinish=()=>{l.forEach(B=>B.remove()),v.classList.remove("old")},d.forEach(B=>{B.classList.add("old"),h.add(B),O(B,[{opacity:R.get(B)},{opacity:0}],{duration:220*R.get(B),delay:110,easing:J,fill:"both"}).onfinish=()=>B.remove()}),b.forEach(B=>B.cancel()),M==null||M.cancel(),M=null;let p=i.getBoundingClientRect(),L=T.width/p.width,E=T.height/p.height;T.width&&p.width&&(Math.abs(L-1)>.005||Math.abs(E-1)>.005)&&(M=O(i,[{transform:`scale(${L}, ${E})`,transformOrigin:"0 0",borderRadius:`${g/L}px`},{transform:"none",transformOrigin:"0 0",borderRadius:getComputedStyle(i).borderTopLeftRadius}],{duration:K.duration,easing:K.easing}))};return{el:m,swap(w,C){C&&(r=C);let R=s;s=o(w);let P=s?n.text:w;i.dataset.qr!==P&&x(P);let T=s?n.words():C!=null?C:R?r:null;if(s&&R&&T.map(d=>d.textContent).join("")===c.textContent&&(T=null),!T)return;let g=c,v=Ia(g),u=g.getAnimations();c=a("div",{class:"words"},T),f.appendChild(c),g.classList.add("old"),O(c,[{opacity:0,filter:"blur(3px)"},{opacity:1,filter:"blur(0px)"}],{duration:220,easing:Q}),O(g,[v,{opacity:0,filter:"blur(3px)"}],{duration:200,delay:90,easing:J,fill:"both"}).onfinish=()=>g.remove(),u.forEach(d=>d.cancel())}}}function On(e){let t=typeof navigator.share=="function";return a("div",{class:"linkrow"},a("span",{class:"mono"},e.replace(/^https?:\/\//,"")),a("button",{type:"button",class:"knob","aria-label":_("Copy the link"),onclick:n=>ve(e,_("Link copied"),n.currentTarget)},V("copy")),t?a("button",{type:"button",class:"knob","aria-label":_("Share the link"),onclick:()=>navigator.share({url:e,title:Ke()}).catch(()=>{})},V("share")):null)}var be=8,pe=12,Ve=null,Zt=()=>!!Ve;function Ue(e=!1){Ve==null||Ve(e)}function Ga(e){let t=getComputedStyle(e);return{opacity:t.opacity,transform:t.transform,filter:t.filter==="none"?"blur(0px)":t.filter}}function kt(e){O(e,[{opacity:0,transform:"scale(.5)",filter:"blur(6px)"},{opacity:1,transform:"none",filter:"blur(0px)"}],{duration:he.duration,easing:he.easing})}function Lt(e){let t=Ga(e);e.getAnimations().forEach(n=>n.cancel()),O(e,[t,{opacity:0,transform:"scale(.7)",filter:"blur(4px)"}],{duration:110,easing:J,fill:"forwards"}).onfinish=()=>e.remove()}function Ct(e,t,n){Ve&&Ve(!0);let o=i=>{let c=i.target;!e.contains(c)&&!t.contains(c)&&n()},r=i=>{i.key==="Escape"&&(i.stopPropagation(),n(),t.focus({preventScroll:!0}))},s=()=>n(!0);return document.addEventListener("pointerdown",o,!0),document.addEventListener("keydown",r,!0),addEventListener("resize",s),t.setAttribute("aria-expanded","true"),Ve=n,()=>Ve!==n?!1:(Ve=null,document.removeEventListener("pointerdown",o,!0),document.removeEventListener("keydown",r,!0),removeEventListener("resize",s),t.setAttribute("aria-expanded","false"),!0)}var Tt=null,hs=(e=!1)=>Tt==null?void 0:Tt(e);function gs(e){if(e.getAttribute("aria-expanded")==="true")return Ue();let t=bt(),n=typeof navigator.share=="function",o=a("div",{class:"pc-card drop",role:"dialog","aria-label":_("Open on another device")},Jt(t,!0),a("div",{class:"pc-row"},a("button",{type:"button",class:"pc-copy","aria-label":_("Copy the link"),onclick:w=>ve(t,_("Link copied"),w.currentTarget)},V("link"),a("span",{class:"lbl"},_("Copy link"))),n?a("button",{type:"button",class:"knob","aria-label":_("Share the link"),onclick:()=>navigator.share({url:t,title:Ke()}).catch(()=>{})},V("share")):null));document.body.append(o);let r=e.getBoundingClientRect(),s=o.offsetWidth,i=o.offsetHeight,c=r.left+r.width/2,f=Math.max(pe,Math.min(c-s/2,innerWidth-pe-s)),m=r.bottom+be+i<=innerHeight-pe||r.top-be-i{if(i!==r){if(r==null||r.classList.remove("hot"),r=i,!i)return void(o.style.opacity="0");i.classList.add("hot"),o.classList.toggle("moving",+getComputedStyle(o).opacity>.01),Object.assign(o.style,{translate:`${i.offsetLeft}px ${i.offsetTop}px`,width:`${i.offsetWidth}px`,height:`${i.offsetHeight}px`,borderRadius:getComputedStyle(i).borderRadius,opacity:"1"})}};for(let i of t)i.addEventListener("pointerenter",()=>s(i)),i.addEventListener("focus",()=>i.matches(":focus-visible")&&s(i)),i.addEventListener("pointerdown",()=>{o.classList.add("down"),document.addEventListener("pointerup",()=>o.classList.remove("down"),{once:!0,capture:!0})});return e.addEventListener("pointerleave",()=>s(n)),s(n),{light:i=>s(i!=null?i:n)}}var Nn=6,_t=10;function Fa(e,t,n,o,r){let s=r?Nn:0,i=r?t:t-Nn,c=r?0:t,f=M=>Math.round(M*100)/100,m=(M,h,x)=>`L ${f(M)} ${x} C ${f(M+(h-M)/4)} ${x} ${f(o-(h-M)/8)} ${c} ${f(o)} ${c} C ${f(o+(h-M)/8)} ${c} ${f(h-(h-M)/4)} ${x} ${f(h)} ${x} `;return`M ${n} ${s} ${r?m(o-_t,o+_t,s):""}L ${e-n} ${s} A ${n} ${n} 0 0 1 ${e-n} ${i} ${r?"":m(o+_t,o-_t,i)}L ${n} ${i} A ${n} ${n} 0 0 1 ${n} ${s} Z`}var ie=null;function Wa(e,t,n){let o=getComputedStyle(e);e.getAnimations().forEach(r=>r.cancel()),O(e,[{opacity:o.opacity,transform:o.transform,filter:o.filter},{opacity:0,...t}],{duration:n,easing:J,fill:"forwards"}).onfinish=()=>e.remove()}var ys=(e,t)=>{var n,o;return ie&&(o=(n=document.elementFromPoint(e,t))==null?void 0:n.closest(".pp-pop button"))!=null?o:null},vs=!1;function qa(){if(!vs){vs=!0,document.addEventListener("pointermove",e=>{let t=ie==null?void 0:ie.press;!ie||!t||(Math.hypot(e.clientX-t.x,e.clientY-t.y)>6&&(t.moved=!0),ie.light(ys(e.clientX,e.clientY)))},!0),document.addEventListener("pointerup",e=>{let t=ie,n=t==null?void 0:t.press;if(!t||!n)return;t.press=null;let o=ys(e.clientX,e.clientY);if(o&&t.pop.contains(o))return t.choose(o);(t.el.contains(document.elementFromPoint(e.clientX,e.clientY))?n.wasOpen&&!n.moved:n.moved)&&t.close()},!0),document.addEventListener("pointercancel",()=>ie&&(ie.press=null),!0),document.addEventListener("keydown",e=>{if(ie){if(e.key==="Tab")ie.close();else if((e.key==="ArrowLeft"||e.key==="ArrowRight")&&ie.pop.contains(document.activeElement)){e.preventDefault();let t=[...ie.pop.querySelectorAll("button")],n=t.indexOf(document.activeElement)+(e.key==="ArrowRight"?1:-1);t[Math.max(0,Math.min(t.length-1,n))].focus({preventScroll:!0})}}},!0);for(let e of["wheel","touchmove"])addEventListener(e,t=>ie&&!ie.pop.contains(t.target)&&!ie.el.contains(t.target)&&ie.close(),{passive:!0,capture:!0})}}function bs(e){qa();let t=e.value,n=P=>{var T;return(T=e.options.find(g=>g.value===P))!=null?T:e.options[0]},o=P=>e.short?e.short(P):n(P).label(),r=a("span",{class:"pp-lead"}),s=a("span",{class:"pp-t"}),i=V("chevron","i pp-chev"),c=a("button",{type:"button",class:`pp ${e.cls}`,"aria-haspopup":"menu","aria-expanded":"false"},r,s,i),f=(P=!1)=>{var v,u;let T=(u=(v=n(t)).lead)==null?void 0:u.call(v),g=P?[...r.children].filter(d=>!d.classList.contains("pp-gone")):[];if(r.replaceChildren(...g,...T?[T]:[]),r.hidden=!T&&!g.length,c.setAttribute("aria-label",e.label()),!!P){for(let d of g)d.classList.add("pp-gone"),Mo(d).onfinish=()=>d.remove();T&&Eo(T)}};se(s,o(t)),f(),i.addEventListener("transitionend",()=>{i.style.rotate==="-270deg"&&(i.style.transition="none",i.style.rotate="",i.getBoundingClientRect(),i.style.transition="")});let m=null,M=null,h=()=>!1,x=(P=!1)=>{!m||!h()||(P?(m.pop.remove(),M==null||M.remove()):(Lt(m.pop),M&&Wa(M,{},110)),M=null,ie===m&&(ie=null),m=null,i.style.rotate="-270deg")},w=P=>{let T=e.options[Number(P.dataset.i)].value;if(x(),T===t)return;let g=o(t);t=T,e.pick(T),f(!0),ee(s,o(T),g)},C=P=>{var le,me,Be;let T=a("div",{class:"pp-pop drop",role:"menu","aria-label":e.label()},...e.options.map((de,Ie)=>{var S,H;return a("button",{type:"button",role:"menuitemradio",tabindex:"-1","data-i":String(Ie),"aria-checked":String(de.value===t),onclick:k=>w(k.currentTarget)},(H=(S=de.lead)==null?void 0:S.call(de))!=null?H:null,a("span",{},de.label()))}));document.body.append(T);let g=c.getBoundingClientRect(),v=(me=(le=c.closest(".sheet"))==null?void 0:le.getBoundingClientRect())!=null?me:{left:0,right:innerWidth},u=T.offsetWidth,d=T.offsetHeight,l=g.left+g.width/2,b=Math.max(pe,v.left+10),y=Math.min(innerWidth-pe,v.right-10),p=Math.max(b,Math.min(l-u/2,y-u)),L=d+Nn,E=g.top-be-L>=pe,A=g.bottom+be+L<=innerHeight-pe,F=e.prefer==="below"&&A||!E,B=F?g.bottom+be:g.top-be-L;T.classList.add(F?"below":"above");let N=Math.max(d/2+_t,Math.min(l-p,u-d/2-_t)),q=Fa(u,L,d/2,N,F);Object.assign(T.style,{left:`${p}px`,top:`${B}px`,height:`${L}px`,clipPath:`path('${q}')`,transformOrigin:`${N}px ${F?0:L}px`});let Y=document.createElementNS("http://www.w3.org/2000/svg","svg");Y.setAttribute("class","pp-ring"),Y.setAttribute("aria-hidden","true"),Y.setAttribute("viewBox",`0 0 ${u} ${L}`);let Z=document.createElementNS("http://www.w3.org/2000/svg","path");Z.setAttribute("d",q),Y.append(Z),T.append(Y),M=a("div",{class:"pp-shade","aria-hidden":"true"}),Object.assign(M.style,{left:`${p}px`,top:`${B+(F?Nn:0)}px`,width:`${u}px`,height:`${d}px`}),T.before(M),O(M,[{opacity:0},{opacity:1}],{duration:220,easing:"ease-out"}),kt(T),h=Ct(T,c,x);let{light:te}=Rn(T,[...T.querySelectorAll("button")],T.querySelector('[aria-checked="true"]'));m={el:c,pop:T,close:x,choose:w,light:te,press:null},ie=m,i.style.rotate="-90deg",P&&((Be=T.querySelector('[aria-checked="true"]'))==null||Be.focus({preventScroll:!0}))},R=0;return c.addEventListener("pointerdown",P=>{if(P.button!==0)return;R=performance.now();let T=!!m;m||C(!1),m.press={wasOpen:T,x:P.clientX,y:P.clientY,moved:!1},c.hasPointerCapture(P.pointerId)&&c.releasePointerCapture(P.pointerId)}),c.addEventListener("click",()=>{performance.now()-R<800||(m?x():C(!0))}),{el:c,show(P){P!==t&&(t=P,se(s,o(P)),f())},close:x}}var Ka='',In=null,St=null,Bn=null;function Co(e){if(St)return St;In=a("header",{class:"crumbs"}),St=a("div",{class:"page-body"}),e.replaceChildren(a("div",{class:"edge-fade top","aria-hidden":"true"}),a("div",{class:"edge-fade bot","aria-hidden":"true"}),Bn=a("main",{class:"page"},In,St));let t=()=>document.body.classList.toggle("scrolled",scrollY>2);return addEventListener("scroll",t,{passive:!0}),t(),St}function ws(){let e=St;if(!e)return()=>{};let t=e.getBoundingClientRect(),n=innerHeight-t.top-(document.documentElement.scrollHeight-scrollY-t.bottom);return e.getAnimations().forEach(o=>o.cancel()),e.style.minHeight=`${n}px`,()=>{let o=e.lastElementChild,r=o?o.getBoundingClientRect().bottom-e.getBoundingClientRect().top:0;e.style.minHeight="",r