diff --git a/APP_CORE/openvpn_api_v3.py b/APP_CORE/openvpn_api_v3.py index 57f2cb3..7135324 100644 --- a/APP_CORE/openvpn_api_v3.py +++ b/APP_CORE/openvpn_api_v3.py @@ -216,7 +216,32 @@ class OpenVPNAPI: for row in cursor.fetchall(): data.append(dict(zip(columns, row))) - + + # Active sessions per CN (the table may be absent on an old database) + sessions_by_cn = {} + try: + cursor.execute(''' + SELECT common_name, real_address, connected_since, bytes_received, bytes_sent + FROM active_sessions + ORDER BY connected_since, real_address + ''') + for cn, addr, since, rx, tx in cursor.fetchall(): + sessions_by_cn.setdefault(cn, []).append({ + 'real_address': addr, + 'connected_since': since, + 'bytes_received': rx or 0, + 'bytes_sent': tx or 0, + 'received_mb': round((rx or 0) / (1024 * 1024), 2), + 'sent_mb': round((tx or 0) / (1024 * 1024), 2), + }) + except sqlite3.Error: + sessions_by_cn = {} + + for client in data: + sessions = sessions_by_cn.get(client['common_name'], []) if client['status'] == 'Active' else [] + client['sessions_count'] = len(sessions) + client['sessions'] = sessions + return data except Exception as e: diff --git a/APP_CORE/test_multi_session.py b/APP_CORE/test_multi_session.py new file mode 100644 index 0000000..092740f --- /dev/null +++ b/APP_CORE/test_multi_session.py @@ -0,0 +1,41 @@ +import importlib +import sqlite3 + +import pytest + +FMT_SINCE = '2026-11-12 10:00:00' + + +@pytest.fixture +def api(tmp_path, monkeypatch): + monkeypatch.chdir(tmp_path) + monkeypatch.setenv("OVPMON_OPENVPN_MONITOR_DB_PATH", str(tmp_path / "api.db")) + monkeypatch.delenv("OVPMON_AUTO_MIGRATE", raising=False) + module = importlib.import_module("openvpn_api_v3") + return module.OpenVPNAPI() + + +def test_stats_include_sessions(api): + conn = sqlite3.connect(api.db_manager.db_path) + for cn, status in (('alice', 'Active'), ('bob', 'Active'), ('carol', 'Disconnected')): + conn.execute("INSERT INTO clients (common_name, status, real_address) VALUES (?,?,?)", + (cn, status, '1.1.1.1:1000')) + ids = {cn: i for i, cn in conn.execute("SELECT id, common_name FROM clients")} + mb = 1024 * 1024 + for cn, addr, rx, tx in (('alice', '1.1.1.1:1000', 2 * mb, mb), ('alice', '2.2.2.2:2000', 0, 0), + ('bob', '3.3.3.3:3000', mb, mb)): + conn.execute("INSERT INTO active_sessions (client_id, common_name, real_address, bytes_received," + " bytes_sent, connected_since, last_seen, session_id) VALUES (?,?,?,?,?,?,?,?)", + (ids[cn], cn, addr, rx, tx, FMT_SINCE, FMT_SINCE, None)) + conn.commit() + conn.close() + + by_cn = {c['common_name']: c for c in api.get_current_stats()} + assert by_cn['alice']['sessions_count'] == 2 + assert {s['real_address'] for s in by_cn['alice']['sessions']} == {'1.1.1.1:1000', '2.2.2.2:2000'} + first = next(s for s in by_cn['alice']['sessions'] if s['real_address'] == '1.1.1.1:1000') + assert (first['received_mb'], first['sent_mb'], first['connected_since']) == (2.0, 1.0, FMT_SINCE) + assert by_cn['bob']['sessions_count'] == 1 + assert by_cn['carol']['sessions_count'] == 0 and by_cn['carol']['sessions'] == [] + # existing fields are unchanged + assert by_cn['alice']['real_address'] == '1.1.1.1:1000' and by_cn['alice']['status'] == 'Active' diff --git a/APP_UI/src/utils/sessions.js b/APP_UI/src/utils/sessions.js new file mode 100644 index 0000000..167e685 --- /dev/null +++ b/APP_UI/src/utils/sessions.js @@ -0,0 +1,12 @@ +// Multi-session helpers for the Clients page + +// Badge "xN" is shown only when a client has more than one session +export const sessionsBadge = (c) => (c.sessions_count > 1 ? `×${c.sessions_count}` : null); + +// Toggle a client in the set of expanded rows (returns a new array) +export const toggleExpanded = (expanded, name) => + expanded.includes(name) ? expanded.filter(n => n !== name) : [...expanded, name]; + +// Sessions to render under a client row: only when expanded and there is more than one +export const visibleSessions = (c, expanded) => + (c.sessions_count > 1 && expanded.includes(c.common_name)) ? (c.sessions || []) : []; diff --git a/APP_UI/src/utils/sessions.test.js b/APP_UI/src/utils/sessions.test.js new file mode 100644 index 0000000..bdf1d90 --- /dev/null +++ b/APP_UI/src/utils/sessions.test.js @@ -0,0 +1,21 @@ +import { describe, it, expect } from 'vitest'; +import { sessionsBadge, toggleExpanded, visibleSessions } from './sessions'; + +describe('multi-session display', () => { + const multi = { common_name: 'alice', sessions_count: 2, sessions: [{ real_address: 'a' }, { real_address: 'b' }] }; + const single = { common_name: 'bob', sessions_count: 1, sessions: [{ real_address: 'c' }] }; + + it('shows the badge only for more than one session', () => { + expect(sessionsBadge(multi)).toBe('×2'); + expect(sessionsBadge(single)).toBeNull(); + expect(sessionsBadge({ common_name: 'old' })).toBeNull(); + }); + + it('expands and collapses the session list on click', () => { + expect(visibleSessions(multi, [])).toEqual([]); + const open = toggleExpanded([], 'alice'); + expect(visibleSessions(multi, open)).toHaveLength(2); + expect(visibleSessions(multi, toggleExpanded(open, 'alice'))).toEqual([]); + expect(visibleSessions(single, ['bob'])).toEqual([]); + }); +}); diff --git a/APP_UI/src/views/Clients.vue b/APP_UI/src/views/Clients.vue index 5e5641c..189eb27 100644 --- a/APP_UI/src/views/Clients.vue +++ b/APP_UI/src/views/Clients.vue @@ -12,6 +12,10 @@
{{ stats.activeClients }}
Active Clients
+
+
{{ stats.totalSessions }}
+
Active Sessions
+
@@ -78,17 +82,24 @@ {{ group.status }} Clients - + @@ -125,6 +145,7 @@ import { useApi } from '../composables/useApi'; import { useFormatters } from '../composables/useFormatters'; import HistoryModal from '../components/HistoryModal.vue'; import { useAppConfig } from '../composables/useAppConfig'; +import { sessionsBadge, toggleExpanded, visibleSessions } from '../utils/sessions'; const { fetchStats } = useApi(); const { formatBytes, formatRate, parseServerDate } = useFormatters(); @@ -137,6 +158,7 @@ const searchQuery = ref(''); const hideDisconnected = ref(false); const currentSort = ref('sent'); const historyModal = ref(null); +const expanded = ref([]); // CNs with an open session list; survives auto-refresh let intervalId = null; @@ -144,14 +166,16 @@ const stats = computed(() => { let totalReceived = 0; let totalSent = 0; let activeClients = 0; + let totalSessions = 0; clients.value.forEach(c => { totalReceived += c.total_bytes_received || 0; totalSent += c.total_bytes_sent || 0; if (c.status === 'Active') activeClients++; + totalSessions += c.sessions_count || 0; }); - return { totalReceived, totalSent, activeClients }; + return { totalReceived, totalSent, activeClients, totalSessions }; }); const filteredClients = computed(() => { diff --git a/DOCS/Changes/2026-11-12_Multi_Session_UI.md b/DOCS/Changes/2026-11-12_Multi_Session_UI.md new file mode 100644 index 0000000..02232b5 --- /dev/null +++ b/DOCS/Changes/2026-11-12_Multi_Session_UI.md @@ -0,0 +1,29 @@ +# Показ нескольких сессий клиента в UI (сводка, 2026-11-12) + +План: [2026-11-12_Multi_Session_UI_PLAN.md](2026-11-12_Multi_Session_UI_PLAN.md) + +## Что изменено + +- `APP_CORE/openvpn_api_v3.py`, `get_current_stats`: один запрос к `active_sessions`, группировка по CN. В запись клиента добавлены `sessions_count` и `sessions` (адрес, начало в UTC, байты, МБ). Для отключённых клиентов `0` и `[]`; при отсутствии таблицы список пуст. Прежние поля не менялись, `/api/v1/stats` отдаёт новые поля без правок маршрута. +- `APP_UI/src/views/Clients.vue`: бейдж «×N» (кнопка, `aria-expanded`) при двух и более сессиях; «N devices» вместо одного адреса; раскрывающиеся строки сессий (адрес, начало, Down/Up в МБ), состояние раскрытия в `ref` переживает автообновление; KPI «Active Sessions» рядом с «Active Clients». +- `APP_UI/src/utils/sessions.js`: чистые функции `sessionsBadge`, `toggleExpanded`, `visibleSessions`. +- `deploy/ui-dist` пересобран (`deploy/native/build-ui.sh --docker --publish`), `SOURCE_HASH` обновлён. +- Документация: `DOCS/Core_Monitoring/API_Reference.md` (новые поля), `DOCS/UI/Architecture.md` (страница Clients), строка в `DOCS/Changes/README.md`. +- Сборщик, схема БД и миграции не менялись. + +## Тесты (2 шт.) + +- `APP_CORE/test_multi_session.py`: CN с двумя сессиями, CN с одной, отключённый CN; прежние поля без изменений. +- `APP_UI/src/utils/sessions.test.js`: бейдж только при `sessions_count > 1`, раскрытие и сворачивание. + +## Проверки + +`pytest` в `APP_CORE`: 19 passed. `npm test`: 15 passed. `npm run lint`: без замечаний. Сборка UI в контейнере прошла, `SOURCE_HASH` совпадает с исходниками. + +## Отклонения от плана и ограничения + +- UI-тест проверяет чистые функции, а не смонтированный компонент: `@vue/test-utils` в проекте нет, зависимость не добавлялась. +- API-тест вызывает `api.get_current_stats()` напрямую: маршрут закрыт JWT и лишь пробрасывает поля. Красный прогон на старом коде отдельно не делался. +- Видимой подписи «Show sessions» нет, только `title` и `aria-expanded`. +- Ручная проверка на стенде с двумя устройствами под одним CN (шаг 4 плана) **не выполнена**. +- Коммит не создан. diff --git a/DOCS/Changes/2026-11-12_Multi_Session_UI_PLAN.md b/DOCS/Changes/2026-11-12_Multi_Session_UI_PLAN.md new file mode 100644 index 0000000..6f990d6 --- /dev/null +++ b/DOCS/Changes/2026-11-12_Multi_Session_UI_PLAN.md @@ -0,0 +1,56 @@ +# Показ нескольких сессий клиента в UI (план, 2026-11-12) + +Источник: анализ состояния проекта (запрос от 2026-11-12). Затронутый код: `APP_CORE/openvpn_api_v3.py`, `APP_UI/src/views/Clients.vue`, `APP_CORE/test_*.py`, `APP_UI/src/**/*.test.js`. + +Цель: в списке клиентов видно, что пользователь (CN) подключён с нескольких устройств, и можно посмотреть параметры каждой сессии. + +## 1. Исходное состояние + +- Сборщик пишет по строке на сессию в `active_sessions` (адрес, байты, `connected_since`, `session_id`), таблица обновляется каждый тик. +- `/api/v1/stats` отдаёт одну запись на CN: статус `Active`/`Disconnected`, суммарные байты и скорость, `real_address` последней сессии. +- `/api/v1/sessions` отдаёт все активные сессии, но UI его не вызывает. +- В UI число сессий и список устройств не видны. + +## 2. Решение + +Расширить `/api/v1/stats`, а не добавлять второй запрос из UI: поллинг остаётся один, данные согласованы между собой. + +| ID | Изменение | Результат | +|---|---|---| +| MU-1 | `get_current_stats`: один запрос к `active_sessions`, сессии группируются по `common_name`; в каждую запись клиента добавляются `sessions_count` (0 для отключённых) и `sessions` (адрес, `connected_since` в UTC, байты приёма и отправки) | API отдаёт число и список сессий вместе с клиентом | +| MU-2 | `Clients.vue`: бейдж «×N» рядом со статусом, если `sessions_count > 1`; в колонке адреса при N > 1 показывать «N devices» вместо одного адреса | многосессионность видна в списке | +| MU-3 | `Clients.vue`: по клику на бейдж раскрывается вложенная строка со списком сессий (адрес, начало, Down/Up в МБ), повторный клик скрывает; состояние раскрытия хранится в `ref` и переживает автообновление | детали по каждому устройству | +| MU-4 | KPI на странице Clients: рядом с `Active clients` показать общее число сессий (сумма `sessions_count`) | видна нагрузка по сессиям, а не только по пользователям | + +Вне объёма: изменение сборщика, схемы БД, метрики `Concurrent Users (Peak)` на Analytics (она считает пользователей, это корректно), принудительное отключение сессии. + +## 3. Шаги + +| # | Шаг | Результат | +|---|---|---| +| 0 | Тест API (красный на текущем коде): две строки `active_sessions` у одного CN, одна у другого, ни одной у третьего | поведение зафиксировано | +| 1 | MU-1 в `openvpn_api_v3.py`; обратная совместимость: существующие поля не меняются, поля только добавляются; при отсутствии таблицы `active_sessions` `sessions = []` | тест из шага 0 зелёный | +| 2 | MU-2, MU-4 в `Clients.vue` | бейдж и счётчик | +| 3 | MU-3 в `Clients.vue` | раскрывающийся список | +| 4 | Сборка UI и пересборка `deploy/ui-dist` по принятой процедуре проекта; ручная проверка на стенде с двумя клиентами под одним CN | подтверждено в реальном UI | +| 5 | Документация: `DOCS/Core_Monitoring/API_Reference.md` (поля `sessions_count`, `sessions`), `DOCS/UI` (описание страницы Clients), README.md, строка в таблице `DOCS/Changes/README.md`, сводка `2026-11-12_Multi_Session_UI.md` | документация актуальна | + +## 4. Автотесты (минимум, 2 шт.) + +1. **API** (`pytest`, в `APP_CORE`): `/api/v1/stats` возвращает `sessions_count` и `sessions` для CN с двумя сессиями, `0` и пустой список для отключённого, прежние поля без изменений. +2. **UI** (`Vitest`): компонент показывает бейдж «×2» только при `sessions_count > 1` и раскрывает список сессий по клику. + +## 5. Совместимость и риски + +- Схема и сборщик не меняются, миграций нет. Откат: возврат кода API и UI. +- Новые поля только добавляются, другие потребители `/api/v1/stats` не затронуты. +- Размер ответа растёт на число активных сессий (десятки строк), на поллинг не влияет. +- `connected_since` хранится в UTC, в UI выводится так же, как другие даты на странице, формат единый. +- Между двумя тиками сборщика список сессий может отставать на один тик; для мониторинга это допустимо. + +## 6. Порядок выполнения + +1. Утверждение плана. +2. Реализация субагентом (Sonnet 5.5, Medium Effort): шаги 0-3. +3. Проверка: `pytest` в `APP_CORE`, `npm test` и ESLint в `APP_UI`, ручная проверка (шаг 4). +4. Документация и сводка (шаг 5). diff --git a/DOCS/Changes/README.md b/DOCS/Changes/README.md index 1296f02..4da8293 100644 --- a/DOCS/Changes/README.md +++ b/DOCS/Changes/README.md @@ -29,3 +29,4 @@ Every change has a plan (`*_PLAN.md`) before it and a summary of what was done a | 2026-10-07 | Доставка UI: пересборка `deploy/ui-dist`, единый CSP с `OVPMON_CSP_CONNECT_EXTRA` (контейнеры и системный nginx, флаг `--csp-connect-extra`), `npm ci` в all-in-one, `app-ui` на `nginx-unprivileged` (порт 8080 внутри) | [plan](2026-10-07_UI_Delivery_Hardening_PLAN.md) · [change](2026-10-07_UI_Delivery_Hardening.md) | | 2026-10-07 | Backup: бейджи Type, Status и Last result в таблице Destinations выровнены по верхнему краю строки (`align-top`), дата остаётся под бейджем | [plan](2026-10-07_Backup_Badges_Align_PLAN.md) · [change](2026-10-07_Backup_Badges_Align.md) | | 2026-10-07 | Скорость (Mbps) на графиках за период больше суток: средняя скорость корзины из байтов агрегатных таблиц вместо нулей (история клиента и Analytics), подписи «RX/TX Mbps (avg)» | [plan](2026-10-07_Aggregated_Speed_PLAN.md) · [change](2026-10-07_Aggregated_Speed.md) | +| 2026-11-12 | Clients: несколько сессий одного пользователя видны в UI: бейдж «×N», «N devices» вместо адреса, раскрывающийся список сессий, KPI Active Sessions; `/api/v1/stats` отдаёт `sessions_count` и `sessions` | [plan](2026-11-12_Multi_Session_UI_PLAN.md) · [change](2026-11-12_Multi_Session_UI.md) | diff --git a/DOCS/Core_Monitoring/API_Reference.md b/DOCS/Core_Monitoring/API_Reference.md index 4aa1e50..07a91a0 100644 --- a/DOCS/Core_Monitoring/API_Reference.md +++ b/DOCS/Core_Monitoring/API_Reference.md @@ -142,6 +142,7 @@ Returns a snapshot of all known clients. Field notes (a user with several simultaneous sessions is one record): - `current_recv_rate_mbps` / `current_sent_rate_mbps`: peak over the last 30 seconds of the **sum of the rates of all sessions** of the user at one tick (not the rate of a single session). - `real_address`: the address of the session with the latest start. `last_bytes_received/sent` (table `clients`): the sum of the current counters of all active sessions. Per-session values are in `GET /sessions`. +- `sessions_count` and `sessions`: the active sessions of the user from `active_sessions` (`real_address`, `connected_since` in UTC, `bytes_received`, `bytes_sent`, `received_mb`, `sent_mb`). `0` and `[]` for a disconnected client or when the table is absent. The Clients page uses them for the "×N" badge and the list of devices. - In `GET /stats/` the history of every interval has the volume and the rate summed over the user's sessions (rate: `MAX` over the interval of the per-tick sum). #### Example Response diff --git a/DOCS/UI/Architecture.md b/DOCS/UI/Architecture.md index 6e13c3e..8c98d16 100644 --- a/DOCS/UI/Architecture.md +++ b/DOCS/UI/Architecture.md @@ -23,7 +23,7 @@ The frontend is a Single Page Application (SPA) built with **Vue 3** and **Vite* | Route | View | Purpose | |---|---|---| | `/` | `Analytics.vue` | traffic charts | -| `/clients`, `/certificates` | `Clients.vue`, `Certificates.vue` | connected clients, issued profiles | +| `/clients`, `/certificates` | `Clients.vue`, `Certificates.vue` | connected clients (badge "×N" and a list of sessions when a user is connected from several devices), issued profiles | | `/config/pki`, `/config/vpn` | `PKIConfig.vue`, `VPNConfig.vue` | PKI and server settings | | `/server` | `ServerManagement.vue` | OpenVPN process control | | `/backup` | `BackupRestore.vue` | **Backup and Restore** (MANAGEMENT section): destinations table with an add/edit modal (the form is built from the `fields` of `GET /backup/settings`: text, number, switch, password and multi-line secret fields; a field may carry a warning, for example plain FTP or a disabled certificate check; types with a pinned host key (SFTP) show it, and **Test** opens a confirmation with the fingerprint and a Trust button), backup panel (encryption status, **server name** field with the name actually used, destination checkboxes, progress per destination, history), restore panel (source, package list with the server name and the time in UTC and in the browser's local time, passphrase, red Restore button with a confirmation). It polls `GET /backup/status` every 2 s while a job runs. See [Backup and Restore](../Profiler_Management/Backup_Restore.md) | diff --git a/deploy/ui-dist/SOURCE_HASH b/deploy/ui-dist/SOURCE_HASH index 0b4fb35..351b31e 100644 --- a/deploy/ui-dist/SOURCE_HASH +++ b/deploy/ui-dist/SOURCE_HASH @@ -1 +1 @@ -8d9379ee7d6e1c766f9c3ebd363a0ea9f504703683fbc9f05dcf7c5e07c6538a +0dde6861a570886200b2f34cf375e07801fcd229eac29b12db2666723be9e97b diff --git a/deploy/ui-dist/assets/Account-D3bmpB1v.js b/deploy/ui-dist/assets/Account-DxXUov-q.js similarity index 99% rename from deploy/ui-dist/assets/Account-D3bmpB1v.js rename to deploy/ui-dist/assets/Account-DxXUov-q.js index 6260407..a2319d5 100644 --- a/deploy/ui-dist/assets/Account-D3bmpB1v.js +++ b/deploy/ui-dist/assets/Account-DxXUov-q.js @@ -1 +1 @@ -import{G as $,H as N,r as S,I as te,o as re,F as ie,a as J,d as x,e as u,q as V,g as T,J as Y,m as D,t as le,w as U,x as O,A as q,z as j,j as de,C as ue,k as I}from"./index-BfAhXdi6.js";import{a as ce,_ as ee}from"./ConfirmModal-wSxjHDVn.js";import"./vendor-ui-Dumif2LN.js";var z=function(){return z=Object.assign||function(h){for(var c,l=1,f=arguments.length;la.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=e*4+17;for(var i=[],o=0;o7)throw new RangeError("Invalid value");var v,C;for(v=r;;v++){var y=a.getNumDataCodewords(v,t)*8,E=p.getTotalBits(e,v);if(E<=y){C=E;break}if(v>=n)throw new RangeError("Data too long")}for(var m=0,A=[a.Ecc.MEDIUM,a.Ecc.QUARTILE,a.Ecc.HIGH];m>>3]|=G<<7-(H&7)}),new a(v,t,L,i)},a.prototype.getModule=function(e,t){return 0<=e&&e>>9)*1335;var i=(t<<10|r)^21522;f(i>>>15==0);for(var n=0;n<=5;n++)this.setFunctionModule(8,n,l(i,n));this.setFunctionModule(8,7,l(i,6)),this.setFunctionModule(8,8,l(i,7)),this.setFunctionModule(7,8,l(i,8));for(var n=9;n<15;n++)this.setFunctionModule(14-n,8,l(i,n));for(var n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,l(i,n));for(var n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,l(i,n));this.setFunctionModule(8,this.size-8,!0)},a.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^(e>>>11)*7973;var r=this.version<<12|e;f(r>>>18==0);for(var t=0;t<18;t++){var n=l(r,t),i=this.size-11+t%3,o=Math.floor(t/3);this.setFunctionModule(i,o,n),this.setFunctionModule(o,i,n)}}},a.prototype.drawFinderPattern=function(e,t){for(var r=-4;r<=4;r++)for(var n=-4;n<=4;n++){var i=Math.max(Math.abs(n),Math.abs(r)),o=e+n,v=t+r;0<=o&&o=v)&&M.push(k[P])})},m=0;m=1;r-=2){r==6&&(r=5);for(var n=0;n>>3],7-(t&7)),t++)}}f(t==e.length*8)},a.prototype.applyMask=function(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(var t=0;t5&&e++):(this.finderPenaltyAddHistory(n,i),r||(e+=this.finderPenaltyCountPatterns(i)*a.PENALTY_N3),r=this.modules[t][o],n=1);e+=this.finderPenaltyTerminateAndCount(r,n,i)*a.PENALTY_N3}for(var o=0;o5&&e++):(this.finderPenaltyAddHistory(v,i),r||(e+=this.finderPenaltyCountPatterns(i)*a.PENALTY_N3),r=this.modules[t][o],v=1);e+=this.finderPenaltyTerminateAndCount(r,v,i)*a.PENALTY_N3}for(var t=0;ta.MAX_VERSION)throw new RangeError("Version number out of range");var t=(16*e+128)*e+64;if(e>=2){var r=Math.floor(e/7)+2;t-=(25*r-10)*r-55,e>=7&&(t-=36)}return f(208<=t&&t<=29648),t},a.getNumDataCodewords=function(e,t){return Math.floor(a.getNumRawDataModules(e)/8)-a.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*a.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e]},a.reedSolomonComputeDivisor=function(e){if(e<1||e>255)throw new RangeError("Degree out of range");for(var t=[],r=0;r>>8||t>>>8)throw new RangeError("Byte out of range");for(var r=0,n=7;n>=0;n--)r=r<<1^(r>>>7)*285,r^=(t>>>n&1)*e;return f(r>>>8==0),r},a.prototype.finderPenaltyCountPatterns=function(e){var t=e[1];f(t<=this.size*3);var r=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(r&&e[0]>=t*4&&e[6]>=t?1:0)+(r&&e[6]>=t*4&&e[0]>=t?1:0)},a.prototype.finderPenaltyTerminateAndCount=function(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)},a.prototype.finderPenaltyAddHistory=function(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)},a.MIN_VERSION=1,a.MAX_VERSION=40,a.PENALTY_N1=3,a.PENALTY_N2=3,a.PENALTY_N3=40,a.PENALTY_N4=10,a.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],a.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],a})();s.QrCode=h;function c(a,e,t){if(e<0||e>31||a>>>e)throw new RangeError("Value out of range");for(var r=e-1;r>=0;r--)t.push(a>>>r&1)}function l(a,e){return(a>>>e&1)!=0}function f(a){if(!a)throw new Error("Assertion error")}var p=(function(){function a(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}return a.makeBytes=function(e){for(var t=[],r=0,n=e;r=1<=h.y+h.h?c:c.map(function(f,p){return p=h.x+h.w?f:!1})})}var X={value:{type:String,required:!0,default:""},size:{type:Number,default:100},level:{type:String,default:K,validator:function(s){return Z(s)}},background:{type:String,default:"#fff"},foreground:{type:String,default:"#000"},margin:{type:Number,required:!1,default:0},imageSettings:{type:Object,required:!1,default:function(){return{}}},gradient:{type:Boolean,required:!1,default:!1},gradientType:{type:String,required:!1,default:"linear",validator:function(s){return["linear","radial"].indexOf(s)>-1}},gradientStartColor:{type:String,required:!1,default:"#000"},gradientEndColor:{type:String,required:!1,default:"#fff"}},he=z(z({},X),{renderAs:{type:String,required:!1,default:"canvas",validator:function(s){return["canvas","svg"].indexOf(s)>-1}}}),ve=$({name:"QRCodeSvg",props:X,setup:function(s){var h=S(0),c=S(""),l,f=function(){var a=s.value,e=s.level,t=s.margin,r=t>>>0,n=Z(e)?e:K,i=Q.QrCode.encodeText(a,W[n]).getModules();if(h.value=i.length+r*2,s.imageSettings.src){var o=ne(i,s.size,r,s.imageSettings);l={x:o.x+r,y:o.y+r,width:o.w,height:o.h},o.excavation&&(i=oe(i,o.excavation))}c.value=ae(i,r)},p=function(){if(!s.gradient)return null;var a=s.gradientType==="linear"?{x1:"0%",y1:"0%",x2:"100%",y2:"100%"}:{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"};return N(s.gradientType==="linear"?"linearGradient":"radialGradient",z({id:"qr-gradient"},a),[N("stop",{offset:"0%",style:{stopColor:s.gradientStartColor}}),N("stop",{offset:"100%",style:{stopColor:s.gradientEndColor}})])};return f(),te(f),function(){return N("svg",{width:s.size,height:s.size,"shape-rendering":"crispEdges",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(h.value," ").concat(h.value)},[N("defs",{},[p()]),N("rect",{width:"100%",height:"100%",fill:s.background}),N("path",{fill:s.gradient?"url(#qr-gradient)":s.foreground,d:c.value}),s.imageSettings.src&&N("image",z({href:s.imageSettings.src},l))])}}}),pe=$({name:"QRCodeCanvas",props:X,setup:function(s,h){var c=S(null),l=S(null),f=function(){var a=s.value,e=s.level,t=s.size,r=s.margin,n=s.background,i=s.foreground,o=s.gradient,v=s.gradientType,C=s.gradientStartColor,y=s.gradientEndColor,E=r>>>0,m=Z(e)?e:K,A=c.value;if(A){var g=A.getContext("2d");if(g){var b=Q.QrCode.encodeText(a,W[m]).getModules(),M=b.length+E*2,R=l.value,P={x:0,y:0,width:0,height:0},k=s.imageSettings.src&&R!=null&&R.naturalWidth!==0&&R.naturalHeight!==0;if(k){var w=ne(b,s.size,E,s.imageSettings);P={x:w.x+E,y:w.y+E,width:w.w,height:w.h},w.excavation&&(b=oe(b,w.excavation))}var d=window.devicePixelRatio||1,_=t/M*d;if(A.height=A.width=t*d,g.scale(_,_),g.fillStyle=n,g.fillRect(0,0,M,M),o){var F=void 0;v==="linear"?F=g.createLinearGradient(0,0,M,M):F=g.createRadialGradient(M/2,M/2,0,M/2,M/2,M/2),F.addColorStop(0,C),F.addColorStop(1,y),g.fillStyle=F}else g.fillStyle=i;fe?g.fill(new Path2D(ae(b,E))):b.forEach(function(L,G){L.forEach(function(H,se){H&&g.fillRect(se+E,G+E,1,1)})}),k&&g.drawImage(R,P.x,P.y,P.width,P.height)}}};re(f),te(f);var p=h.attrs.style;return function(){return N(ie,[N("canvas",z(z({},h.attrs),{ref:c,style:z(z({},p),{width:"".concat(s.size,"px"),height:"".concat(s.size,"px")})})),s.imageSettings.src&&N("img",{ref:l,src:s.imageSettings.src,style:{display:"none"},onLoad:f})])}}}),me=$({name:"Qrcode",render:function(){var s=this.$props,h=s.renderAs,c=s.value,l=s.size,f=s.margin,p=s.level,a=s.background,e=s.foreground,t=s.imageSettings,r=s.gradient,n=s.gradientType,i=s.gradientStartColor,o=s.gradientEndColor;return N(h==="svg"?ve:pe,{value:c,size:l,margin:f,level:p,background:a,foreground:e,imageSettings:t,gradient:r,gradientType:n,gradientStartColor:i,gradientEndColor:o})},props:he});const we={class:"user-account-container mx-auto",style:{"max-width":"1000px"}},ge={class:"row g-4"},be={class:"col-lg-6"},Ce={class:"card p-0 h-100"},ye={class:"card-header seccard d-flex justify-content-between align-items-center"},Ee={key:0,class:"status-badge status-valid"},Me={class:"card-body p-4"},_e={key:0},Ae={key:0,class:"text-center py-4 d-flex flex-column align-items-center"},Pe=["disabled"],Se={key:0,class:"spinner-border spinner-border-sm me-2"},Re={key:1,class:"setup-steps fade-in"},Ne={class:"step-item mb-5 text-center"},xe={class:"qr-setup-container mx-auto"},Ie={class:"qr-code-wrapper p-3 d-inline-block rounded shadow-sm bg-white"},ke={class:"secret-box mt-3"},ze={class:"user-select-all font-monospace p-2 secret-value-box rounded small d-inline-block w-100"},Fe={class:"step-item text-center"},Te={class:"verification-group mx-auto",style:{"max-width":"300px"}},Ue={class:"input-group mb-3 shadow-sm rounded"},Oe=["disabled"],Be={key:0,class:"spinner-border spinner-border-sm me-2"},Le={key:1,class:"text-center py-4 d-flex flex-column align-items-center"},De={class:"mb-3"},Qe={class:"mb-3"},He={class:"mb-2"},Ve=["disabled"],qe={key:0,class:"spinner-border spinner-border-sm me-2"},Ge={class:"mb-3"},Ye={class:"mb-3"},$e={key:0,class:"mb-2"},Ke=["disabled"],We={key:0,class:"spinner-border spinner-border-sm me-2"},je={__name:"Account",setup(s){const{apiClient:h,authApiClient:c}=de(),l=ue(),f=S(null),p=S(null),a=S(null),e=S(!1),t=J({current_password:"",new_password:"",confirm_password:""}),r=()=>{t.current_password="",t.new_password="",t.confirm_password="",f.value.show()},n=async()=>{if(t.new_password!==t.confirm_password){l.show("New passwords do not match","error");return}e.value=!0;try{await c.post("/change-password",{current_password:t.current_password,new_password:t.new_password}),f.value.hide(),l.show("Password updated successfully.","success")}catch(w){l.show(w.response?.data?.error||"Failed to update password","error")}finally{e.value=!1}},i=S(!1),o=J({new_username:"",current_password:"",otp:""}),v=()=>{o.new_username="",o.current_password="",o.otp="",p.value.show()},C=async()=>{if(!/^[A-Za-z][A-Za-z0-9_.-]{2,31}$/.test(o.new_username)){l.show("Username must be 3-32 chars, start with a letter, and contain only letters, digits, . _ -","error");return}i.value=!0;try{const w=await c.post("/change-username",{new_username:o.new_username,current_password:o.current_password,otp:o.otp||void 0});try{localStorage.setItem("ovpmon_user",w.data.username)}catch{}window.dispatchEvent(new Event("ovpmon-user-changed")),p.value.hide(),l.show("Username updated. Use the new username the next time you sign in.","success")}catch(w){l.show(w.response?.data?.error||"Failed to update username","error")}finally{i.value=!1}},y=S(!1),E=S(!1),m=S(!1),A=S(""),g=S({secret:"",uri:""});re(async()=>{m.value=!0;try{const w=await h.get("/user/me");y.value=w.data.is_2fa_enabled}catch(w){console.error("Failed to fetch user status:",w)}finally{m.value=!1}});const M=async()=>{m.value=!0;try{const w=await c.post("/setup-2fa");g.value=w.data,E.value=!0}catch(w){l.show(w.response?.data?.error||"Failed to initialize 2FA setup.","error")}finally{m.value=!1}},R=async()=>{if(!(!A.value||A.value.length!==6)){m.value=!0;try{await c.post("/enable-2fa",{secret:g.value.secret,otp:A.value}),y.value=!0,l.show("Two-factor authentication has been enabled. Your dashboard is now more secure.","success")}catch(w){l.show(w.response?.data?.error||"The code you entered is invalid. Please check your authenticator app and try again.","error")}finally{m.value=!1}}},P=()=>{a.value.open({title:"Disable 2FA?",message:"This will reduce your account security by removing the second-layer protection from your dashboard.",confirmText:"Yes, disable",confirmBtnClass:"btn-action-danger"})},k=async()=>{try{await c.post("/disable-2fa"),y.value=!1,E.value=!1,l.show("Two-factor authentication has been disabled. Your account is now using standard password protection.","warning")}catch(w){l.show(w.response?.data?.error||"Failed to disable two-factor authentication. Please try again.","error")}};return(w,d)=>(I(),x("div",we,[u("div",ge,[u("div",{class:"col-lg-6"},[u("div",{class:"card h-100"},[d[10]||(d[10]=u("div",{class:"card-header seccard d-flex justify-content-between align-items-center"},[u("span",null,[u("i",{class:"fas fa-user-shield me-2"}),T("Security Settings")])],-1)),u("div",{class:"card-body p-4"},[u("div",{class:"text-center py-4 d-flex flex-column align-items-center"},[d[9]||(d[9]=Y('

Update Credentials

Maintain your account security by updating your password regularly to prevent unauthorized access.

',3)),u("button",{class:"btn btn-action btn-action-primary py-2 fw-bold btn-account-action",onClick:r}," Change Password "),u("button",{class:"btn btn-action btn-action-secondary py-2 fw-bold btn-account-action mt-2",onClick:v}," Change Username ")])])])]),u("div",be,[u("div",Ce,[u("div",ye,[d[12]||(d[12]=u("span",null,[u("i",{class:"fas fa-key me-2"}),T("Two-Factor Authentication")],-1)),y.value?(I(),x("span",Ee,[...d[11]||(d[11]=[u("i",{class:"fas fa-check-circle me-1"},null,-1),T("Active ",-1)])])):D("",!0)]),u("div",Me,[y.value?(I(),x("div",Le,[d[21]||(d[21]=Y('

2FA is Enabled

Your dashboard is now protected with two-factor authentication.

',3)),u("button",{class:"btn btn-action btn-action-danger py-2 fw-bold btn-account-action",onClick:P},[...d[20]||(d[20]=[u("i",{class:"fas fa-ban me-2"},null,-1),T("Disable 2FA ",-1)])])])):(I(),x("div",_e,[E.value?(I(),x("div",Re,[u("div",Ne,[d[16]||(d[16]=u("h5",{class:"mb-3 text-heading"},"1. Scan the QR Code",-1)),d[17]||(d[17]=u("p",{class:"text-muted small mb-4"},"Open your authenticator app and scan this code or manually enter the secret.",-1)),u("div",xe,[u("div",Ie,[V(me,{value:g.value.uri,size:150,level:"H",background:"#ffffff",foreground:"#24292f"},null,8,["value"])]),u("div",ke,[d[15]||(d[15]=u("div",{class:"small fw-bold text-muted mb-2"},"Manual Secret:",-1)),u("div",ze,le(g.value.secret),1)])])]),u("div",Fe,[d[19]||(d[19]=u("h5",{class:"mb-3 text-heading"},"2. Verify Connection",-1)),u("div",Te,[u("div",Ue,[U(u("input",{type:"text",class:"form-control text-center fw-bold","onUpdate:modelValue":d[0]||(d[0]=_=>A.value=_),placeholder:"000000",maxlength:"6",inputmode:"numeric",autocomplete:"one-time-code","aria-label":"6-digit authentication code"},null,512),[[O,A.value]]),u("button",{class:"btn btn-action btn-action-primary px-4 fw-bold",onClick:R,disabled:m.value},[m.value?(I(),x("span",Be)):D("",!0),d[18]||(d[18]=T(" Enable ",-1))],8,Oe)])])])])):(I(),x("div",Ae,[d[14]||(d[14]=Y('

Secure Your Account

Protect your OpenVPN Controller dashboard with second-layer security using Google Authenticator or any TOTP app.

',3)),u("button",{class:"btn btn-action btn-action-primary py-2 fw-bold btn-account-action",onClick:M,disabled:m.value},[m.value?(I(),x("span",Se)):D("",!0),d[13]||(d[13]=T(" Start Setup ",-1))],8,Pe)]))]))])])])]),V(ce,{ref_key:"disable2FAModal",ref:a,onConfirm:k},null,512),V(ee,{id:"passwordChangeModal",title:"Change Account Password",ref_key:"pwModal",ref:f},{body:q(()=>[u("form",{onSubmit:j(n,["prevent"]),id:"pwForm"},[u("div",De,[d[22]||(d[22]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"Current Password",-1)),U(u("input",{type:"password",class:"form-control","onUpdate:modelValue":d[1]||(d[1]=_=>t.current_password=_),placeholder:"Enter current password",autocomplete:"current-password",required:""},null,512),[[O,t.current_password]])]),u("div",Qe,[d[23]||(d[23]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"New Password",-1)),U(u("input",{type:"password",class:"form-control","onUpdate:modelValue":d[2]||(d[2]=_=>t.new_password=_),placeholder:"Min. 8 characters",autocomplete:"new-password",required:""},null,512),[[O,t.new_password]])]),u("div",He,[d[24]||(d[24]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"Confirm New Password",-1)),U(u("input",{type:"password",class:"form-control","onUpdate:modelValue":d[3]||(d[3]=_=>t.confirm_password=_),placeholder:"Confirm new password",autocomplete:"new-password",required:""},null,512),[[O,t.confirm_password]])])],32)]),footer:q(()=>[u("button",{type:"button",class:"btn-action btn-action-secondary",onClick:d[4]||(d[4]=_=>f.value.hide())},"Cancel"),u("button",{type:"submit",form:"pwForm",class:"btn-action btn-action-save",disabled:e.value},[e.value?(I(),x("span",qe)):D("",!0),d[25]||(d[25]=T(" Update Password ",-1))],8,Ve)]),_:1},512),V(ee,{id:"usernameChangeModal",title:"Change Account Username",ref_key:"userModal",ref:p},{body:q(()=>[u("form",{onSubmit:j(C,["prevent"]),id:"userForm"},[u("div",Ge,[d[26]||(d[26]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"New Username",-1)),U(u("input",{type:"text",class:"form-control","onUpdate:modelValue":d[5]||(d[5]=_=>o.new_username=_),placeholder:"3-32 chars: letters, digits, . _ -",pattern:"[A-Za-z][A-Za-z0-9_.\\-]{2,31}",autocomplete:"off",required:""},null,512),[[O,o.new_username]])]),u("div",Ye,[d[27]||(d[27]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"Current Password",-1)),U(u("input",{type:"password",class:"form-control","onUpdate:modelValue":d[6]||(d[6]=_=>o.current_password=_),placeholder:"Enter current password",autocomplete:"current-password",required:""},null,512),[[O,o.current_password]])]),y.value?(I(),x("div",$e,[d[28]||(d[28]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"2FA Code",-1)),U(u("input",{type:"text",class:"form-control","onUpdate:modelValue":d[7]||(d[7]=_=>o.otp=_),placeholder:"6-digit code",inputmode:"numeric",autocomplete:"one-time-code",required:""},null,512),[[O,o.otp]])])):D("",!0)],32)]),footer:q(()=>[u("button",{type:"button",class:"btn-action btn-action-secondary",onClick:d[8]||(d[8]=_=>p.value.hide())},"Cancel"),u("button",{type:"submit",form:"userForm",class:"btn-action btn-action-save",disabled:i.value},[i.value?(I(),x("span",We)):D("",!0),d[29]||(d[29]=T(" Update Username ",-1))],8,Ke)]),_:1},512)]))}};export{je as default}; +import{G as $,H as N,r as S,I as te,o as re,F as ie,a as J,d as x,e as u,q as V,g as T,J as Y,m as D,t as le,w as U,x as O,A as q,z as j,j as de,C as ue,k as I}from"./index-CH6sppUl.js";import{a as ce,_ as ee}from"./ConfirmModal-XwuF5iM0.js";import"./vendor-ui-Dumif2LN.js";var z=function(){return z=Object.assign||function(h){for(var c,l=1,f=arguments.length;la.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=e*4+17;for(var i=[],o=0;o7)throw new RangeError("Invalid value");var v,C;for(v=r;;v++){var y=a.getNumDataCodewords(v,t)*8,E=p.getTotalBits(e,v);if(E<=y){C=E;break}if(v>=n)throw new RangeError("Data too long")}for(var m=0,A=[a.Ecc.MEDIUM,a.Ecc.QUARTILE,a.Ecc.HIGH];m>>3]|=G<<7-(H&7)}),new a(v,t,L,i)},a.prototype.getModule=function(e,t){return 0<=e&&e>>9)*1335;var i=(t<<10|r)^21522;f(i>>>15==0);for(var n=0;n<=5;n++)this.setFunctionModule(8,n,l(i,n));this.setFunctionModule(8,7,l(i,6)),this.setFunctionModule(8,8,l(i,7)),this.setFunctionModule(7,8,l(i,8));for(var n=9;n<15;n++)this.setFunctionModule(14-n,8,l(i,n));for(var n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,l(i,n));for(var n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,l(i,n));this.setFunctionModule(8,this.size-8,!0)},a.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^(e>>>11)*7973;var r=this.version<<12|e;f(r>>>18==0);for(var t=0;t<18;t++){var n=l(r,t),i=this.size-11+t%3,o=Math.floor(t/3);this.setFunctionModule(i,o,n),this.setFunctionModule(o,i,n)}}},a.prototype.drawFinderPattern=function(e,t){for(var r=-4;r<=4;r++)for(var n=-4;n<=4;n++){var i=Math.max(Math.abs(n),Math.abs(r)),o=e+n,v=t+r;0<=o&&o=v)&&M.push(k[P])})},m=0;m=1;r-=2){r==6&&(r=5);for(var n=0;n>>3],7-(t&7)),t++)}}f(t==e.length*8)},a.prototype.applyMask=function(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(var t=0;t5&&e++):(this.finderPenaltyAddHistory(n,i),r||(e+=this.finderPenaltyCountPatterns(i)*a.PENALTY_N3),r=this.modules[t][o],n=1);e+=this.finderPenaltyTerminateAndCount(r,n,i)*a.PENALTY_N3}for(var o=0;o5&&e++):(this.finderPenaltyAddHistory(v,i),r||(e+=this.finderPenaltyCountPatterns(i)*a.PENALTY_N3),r=this.modules[t][o],v=1);e+=this.finderPenaltyTerminateAndCount(r,v,i)*a.PENALTY_N3}for(var t=0;ta.MAX_VERSION)throw new RangeError("Version number out of range");var t=(16*e+128)*e+64;if(e>=2){var r=Math.floor(e/7)+2;t-=(25*r-10)*r-55,e>=7&&(t-=36)}return f(208<=t&&t<=29648),t},a.getNumDataCodewords=function(e,t){return Math.floor(a.getNumRawDataModules(e)/8)-a.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*a.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e]},a.reedSolomonComputeDivisor=function(e){if(e<1||e>255)throw new RangeError("Degree out of range");for(var t=[],r=0;r>>8||t>>>8)throw new RangeError("Byte out of range");for(var r=0,n=7;n>=0;n--)r=r<<1^(r>>>7)*285,r^=(t>>>n&1)*e;return f(r>>>8==0),r},a.prototype.finderPenaltyCountPatterns=function(e){var t=e[1];f(t<=this.size*3);var r=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(r&&e[0]>=t*4&&e[6]>=t?1:0)+(r&&e[6]>=t*4&&e[0]>=t?1:0)},a.prototype.finderPenaltyTerminateAndCount=function(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)},a.prototype.finderPenaltyAddHistory=function(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)},a.MIN_VERSION=1,a.MAX_VERSION=40,a.PENALTY_N1=3,a.PENALTY_N2=3,a.PENALTY_N3=40,a.PENALTY_N4=10,a.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],a.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],a})();s.QrCode=h;function c(a,e,t){if(e<0||e>31||a>>>e)throw new RangeError("Value out of range");for(var r=e-1;r>=0;r--)t.push(a>>>r&1)}function l(a,e){return(a>>>e&1)!=0}function f(a){if(!a)throw new Error("Assertion error")}var p=(function(){function a(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}return a.makeBytes=function(e){for(var t=[],r=0,n=e;r=1<=h.y+h.h?c:c.map(function(f,p){return p=h.x+h.w?f:!1})})}var X={value:{type:String,required:!0,default:""},size:{type:Number,default:100},level:{type:String,default:K,validator:function(s){return Z(s)}},background:{type:String,default:"#fff"},foreground:{type:String,default:"#000"},margin:{type:Number,required:!1,default:0},imageSettings:{type:Object,required:!1,default:function(){return{}}},gradient:{type:Boolean,required:!1,default:!1},gradientType:{type:String,required:!1,default:"linear",validator:function(s){return["linear","radial"].indexOf(s)>-1}},gradientStartColor:{type:String,required:!1,default:"#000"},gradientEndColor:{type:String,required:!1,default:"#fff"}},he=z(z({},X),{renderAs:{type:String,required:!1,default:"canvas",validator:function(s){return["canvas","svg"].indexOf(s)>-1}}}),ve=$({name:"QRCodeSvg",props:X,setup:function(s){var h=S(0),c=S(""),l,f=function(){var a=s.value,e=s.level,t=s.margin,r=t>>>0,n=Z(e)?e:K,i=Q.QrCode.encodeText(a,W[n]).getModules();if(h.value=i.length+r*2,s.imageSettings.src){var o=ne(i,s.size,r,s.imageSettings);l={x:o.x+r,y:o.y+r,width:o.w,height:o.h},o.excavation&&(i=oe(i,o.excavation))}c.value=ae(i,r)},p=function(){if(!s.gradient)return null;var a=s.gradientType==="linear"?{x1:"0%",y1:"0%",x2:"100%",y2:"100%"}:{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"};return N(s.gradientType==="linear"?"linearGradient":"radialGradient",z({id:"qr-gradient"},a),[N("stop",{offset:"0%",style:{stopColor:s.gradientStartColor}}),N("stop",{offset:"100%",style:{stopColor:s.gradientEndColor}})])};return f(),te(f),function(){return N("svg",{width:s.size,height:s.size,"shape-rendering":"crispEdges",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(h.value," ").concat(h.value)},[N("defs",{},[p()]),N("rect",{width:"100%",height:"100%",fill:s.background}),N("path",{fill:s.gradient?"url(#qr-gradient)":s.foreground,d:c.value}),s.imageSettings.src&&N("image",z({href:s.imageSettings.src},l))])}}}),pe=$({name:"QRCodeCanvas",props:X,setup:function(s,h){var c=S(null),l=S(null),f=function(){var a=s.value,e=s.level,t=s.size,r=s.margin,n=s.background,i=s.foreground,o=s.gradient,v=s.gradientType,C=s.gradientStartColor,y=s.gradientEndColor,E=r>>>0,m=Z(e)?e:K,A=c.value;if(A){var g=A.getContext("2d");if(g){var b=Q.QrCode.encodeText(a,W[m]).getModules(),M=b.length+E*2,R=l.value,P={x:0,y:0,width:0,height:0},k=s.imageSettings.src&&R!=null&&R.naturalWidth!==0&&R.naturalHeight!==0;if(k){var w=ne(b,s.size,E,s.imageSettings);P={x:w.x+E,y:w.y+E,width:w.w,height:w.h},w.excavation&&(b=oe(b,w.excavation))}var d=window.devicePixelRatio||1,_=t/M*d;if(A.height=A.width=t*d,g.scale(_,_),g.fillStyle=n,g.fillRect(0,0,M,M),o){var F=void 0;v==="linear"?F=g.createLinearGradient(0,0,M,M):F=g.createRadialGradient(M/2,M/2,0,M/2,M/2,M/2),F.addColorStop(0,C),F.addColorStop(1,y),g.fillStyle=F}else g.fillStyle=i;fe?g.fill(new Path2D(ae(b,E))):b.forEach(function(L,G){L.forEach(function(H,se){H&&g.fillRect(se+E,G+E,1,1)})}),k&&g.drawImage(R,P.x,P.y,P.width,P.height)}}};re(f),te(f);var p=h.attrs.style;return function(){return N(ie,[N("canvas",z(z({},h.attrs),{ref:c,style:z(z({},p),{width:"".concat(s.size,"px"),height:"".concat(s.size,"px")})})),s.imageSettings.src&&N("img",{ref:l,src:s.imageSettings.src,style:{display:"none"},onLoad:f})])}}}),me=$({name:"Qrcode",render:function(){var s=this.$props,h=s.renderAs,c=s.value,l=s.size,f=s.margin,p=s.level,a=s.background,e=s.foreground,t=s.imageSettings,r=s.gradient,n=s.gradientType,i=s.gradientStartColor,o=s.gradientEndColor;return N(h==="svg"?ve:pe,{value:c,size:l,margin:f,level:p,background:a,foreground:e,imageSettings:t,gradient:r,gradientType:n,gradientStartColor:i,gradientEndColor:o})},props:he});const we={class:"user-account-container mx-auto",style:{"max-width":"1000px"}},ge={class:"row g-4"},be={class:"col-lg-6"},Ce={class:"card p-0 h-100"},ye={class:"card-header seccard d-flex justify-content-between align-items-center"},Ee={key:0,class:"status-badge status-valid"},Me={class:"card-body p-4"},_e={key:0},Ae={key:0,class:"text-center py-4 d-flex flex-column align-items-center"},Pe=["disabled"],Se={key:0,class:"spinner-border spinner-border-sm me-2"},Re={key:1,class:"setup-steps fade-in"},Ne={class:"step-item mb-5 text-center"},xe={class:"qr-setup-container mx-auto"},Ie={class:"qr-code-wrapper p-3 d-inline-block rounded shadow-sm bg-white"},ke={class:"secret-box mt-3"},ze={class:"user-select-all font-monospace p-2 secret-value-box rounded small d-inline-block w-100"},Fe={class:"step-item text-center"},Te={class:"verification-group mx-auto",style:{"max-width":"300px"}},Ue={class:"input-group mb-3 shadow-sm rounded"},Oe=["disabled"],Be={key:0,class:"spinner-border spinner-border-sm me-2"},Le={key:1,class:"text-center py-4 d-flex flex-column align-items-center"},De={class:"mb-3"},Qe={class:"mb-3"},He={class:"mb-2"},Ve=["disabled"],qe={key:0,class:"spinner-border spinner-border-sm me-2"},Ge={class:"mb-3"},Ye={class:"mb-3"},$e={key:0,class:"mb-2"},Ke=["disabled"],We={key:0,class:"spinner-border spinner-border-sm me-2"},je={__name:"Account",setup(s){const{apiClient:h,authApiClient:c}=de(),l=ue(),f=S(null),p=S(null),a=S(null),e=S(!1),t=J({current_password:"",new_password:"",confirm_password:""}),r=()=>{t.current_password="",t.new_password="",t.confirm_password="",f.value.show()},n=async()=>{if(t.new_password!==t.confirm_password){l.show("New passwords do not match","error");return}e.value=!0;try{await c.post("/change-password",{current_password:t.current_password,new_password:t.new_password}),f.value.hide(),l.show("Password updated successfully.","success")}catch(w){l.show(w.response?.data?.error||"Failed to update password","error")}finally{e.value=!1}},i=S(!1),o=J({new_username:"",current_password:"",otp:""}),v=()=>{o.new_username="",o.current_password="",o.otp="",p.value.show()},C=async()=>{if(!/^[A-Za-z][A-Za-z0-9_.-]{2,31}$/.test(o.new_username)){l.show("Username must be 3-32 chars, start with a letter, and contain only letters, digits, . _ -","error");return}i.value=!0;try{const w=await c.post("/change-username",{new_username:o.new_username,current_password:o.current_password,otp:o.otp||void 0});try{localStorage.setItem("ovpmon_user",w.data.username)}catch{}window.dispatchEvent(new Event("ovpmon-user-changed")),p.value.hide(),l.show("Username updated. Use the new username the next time you sign in.","success")}catch(w){l.show(w.response?.data?.error||"Failed to update username","error")}finally{i.value=!1}},y=S(!1),E=S(!1),m=S(!1),A=S(""),g=S({secret:"",uri:""});re(async()=>{m.value=!0;try{const w=await h.get("/user/me");y.value=w.data.is_2fa_enabled}catch(w){console.error("Failed to fetch user status:",w)}finally{m.value=!1}});const M=async()=>{m.value=!0;try{const w=await c.post("/setup-2fa");g.value=w.data,E.value=!0}catch(w){l.show(w.response?.data?.error||"Failed to initialize 2FA setup.","error")}finally{m.value=!1}},R=async()=>{if(!(!A.value||A.value.length!==6)){m.value=!0;try{await c.post("/enable-2fa",{secret:g.value.secret,otp:A.value}),y.value=!0,l.show("Two-factor authentication has been enabled. Your dashboard is now more secure.","success")}catch(w){l.show(w.response?.data?.error||"The code you entered is invalid. Please check your authenticator app and try again.","error")}finally{m.value=!1}}},P=()=>{a.value.open({title:"Disable 2FA?",message:"This will reduce your account security by removing the second-layer protection from your dashboard.",confirmText:"Yes, disable",confirmBtnClass:"btn-action-danger"})},k=async()=>{try{await c.post("/disable-2fa"),y.value=!1,E.value=!1,l.show("Two-factor authentication has been disabled. Your account is now using standard password protection.","warning")}catch(w){l.show(w.response?.data?.error||"Failed to disable two-factor authentication. Please try again.","error")}};return(w,d)=>(I(),x("div",we,[u("div",ge,[u("div",{class:"col-lg-6"},[u("div",{class:"card h-100"},[d[10]||(d[10]=u("div",{class:"card-header seccard d-flex justify-content-between align-items-center"},[u("span",null,[u("i",{class:"fas fa-user-shield me-2"}),T("Security Settings")])],-1)),u("div",{class:"card-body p-4"},[u("div",{class:"text-center py-4 d-flex flex-column align-items-center"},[d[9]||(d[9]=Y('

Update Credentials

Maintain your account security by updating your password regularly to prevent unauthorized access.

',3)),u("button",{class:"btn btn-action btn-action-primary py-2 fw-bold btn-account-action",onClick:r}," Change Password "),u("button",{class:"btn btn-action btn-action-secondary py-2 fw-bold btn-account-action mt-2",onClick:v}," Change Username ")])])])]),u("div",be,[u("div",Ce,[u("div",ye,[d[12]||(d[12]=u("span",null,[u("i",{class:"fas fa-key me-2"}),T("Two-Factor Authentication")],-1)),y.value?(I(),x("span",Ee,[...d[11]||(d[11]=[u("i",{class:"fas fa-check-circle me-1"},null,-1),T("Active ",-1)])])):D("",!0)]),u("div",Me,[y.value?(I(),x("div",Le,[d[21]||(d[21]=Y('

2FA is Enabled

Your dashboard is now protected with two-factor authentication.

',3)),u("button",{class:"btn btn-action btn-action-danger py-2 fw-bold btn-account-action",onClick:P},[...d[20]||(d[20]=[u("i",{class:"fas fa-ban me-2"},null,-1),T("Disable 2FA ",-1)])])])):(I(),x("div",_e,[E.value?(I(),x("div",Re,[u("div",Ne,[d[16]||(d[16]=u("h5",{class:"mb-3 text-heading"},"1. Scan the QR Code",-1)),d[17]||(d[17]=u("p",{class:"text-muted small mb-4"},"Open your authenticator app and scan this code or manually enter the secret.",-1)),u("div",xe,[u("div",Ie,[V(me,{value:g.value.uri,size:150,level:"H",background:"#ffffff",foreground:"#24292f"},null,8,["value"])]),u("div",ke,[d[15]||(d[15]=u("div",{class:"small fw-bold text-muted mb-2"},"Manual Secret:",-1)),u("div",ze,le(g.value.secret),1)])])]),u("div",Fe,[d[19]||(d[19]=u("h5",{class:"mb-3 text-heading"},"2. Verify Connection",-1)),u("div",Te,[u("div",Ue,[U(u("input",{type:"text",class:"form-control text-center fw-bold","onUpdate:modelValue":d[0]||(d[0]=_=>A.value=_),placeholder:"000000",maxlength:"6",inputmode:"numeric",autocomplete:"one-time-code","aria-label":"6-digit authentication code"},null,512),[[O,A.value]]),u("button",{class:"btn btn-action btn-action-primary px-4 fw-bold",onClick:R,disabled:m.value},[m.value?(I(),x("span",Be)):D("",!0),d[18]||(d[18]=T(" Enable ",-1))],8,Oe)])])])])):(I(),x("div",Ae,[d[14]||(d[14]=Y('

Secure Your Account

Protect your OpenVPN Controller dashboard with second-layer security using Google Authenticator or any TOTP app.

',3)),u("button",{class:"btn btn-action btn-action-primary py-2 fw-bold btn-account-action",onClick:M,disabled:m.value},[m.value?(I(),x("span",Se)):D("",!0),d[13]||(d[13]=T(" Start Setup ",-1))],8,Pe)]))]))])])])]),V(ce,{ref_key:"disable2FAModal",ref:a,onConfirm:k},null,512),V(ee,{id:"passwordChangeModal",title:"Change Account Password",ref_key:"pwModal",ref:f},{body:q(()=>[u("form",{onSubmit:j(n,["prevent"]),id:"pwForm"},[u("div",De,[d[22]||(d[22]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"Current Password",-1)),U(u("input",{type:"password",class:"form-control","onUpdate:modelValue":d[1]||(d[1]=_=>t.current_password=_),placeholder:"Enter current password",autocomplete:"current-password",required:""},null,512),[[O,t.current_password]])]),u("div",Qe,[d[23]||(d[23]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"New Password",-1)),U(u("input",{type:"password",class:"form-control","onUpdate:modelValue":d[2]||(d[2]=_=>t.new_password=_),placeholder:"Min. 8 characters",autocomplete:"new-password",required:""},null,512),[[O,t.new_password]])]),u("div",He,[d[24]||(d[24]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"Confirm New Password",-1)),U(u("input",{type:"password",class:"form-control","onUpdate:modelValue":d[3]||(d[3]=_=>t.confirm_password=_),placeholder:"Confirm new password",autocomplete:"new-password",required:""},null,512),[[O,t.confirm_password]])])],32)]),footer:q(()=>[u("button",{type:"button",class:"btn-action btn-action-secondary",onClick:d[4]||(d[4]=_=>f.value.hide())},"Cancel"),u("button",{type:"submit",form:"pwForm",class:"btn-action btn-action-save",disabled:e.value},[e.value?(I(),x("span",qe)):D("",!0),d[25]||(d[25]=T(" Update Password ",-1))],8,Ve)]),_:1},512),V(ee,{id:"usernameChangeModal",title:"Change Account Username",ref_key:"userModal",ref:p},{body:q(()=>[u("form",{onSubmit:j(C,["prevent"]),id:"userForm"},[u("div",Ge,[d[26]||(d[26]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"New Username",-1)),U(u("input",{type:"text",class:"form-control","onUpdate:modelValue":d[5]||(d[5]=_=>o.new_username=_),placeholder:"3-32 chars: letters, digits, . _ -",pattern:"[A-Za-z][A-Za-z0-9_.\\-]{2,31}",autocomplete:"off",required:""},null,512),[[O,o.new_username]])]),u("div",Ye,[d[27]||(d[27]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"Current Password",-1)),U(u("input",{type:"password",class:"form-control","onUpdate:modelValue":d[6]||(d[6]=_=>o.current_password=_),placeholder:"Enter current password",autocomplete:"current-password",required:""},null,512),[[O,o.current_password]])]),y.value?(I(),x("div",$e,[d[28]||(d[28]=u("label",{class:"form-label small fw-bold text-muted text-uppercase"},"2FA Code",-1)),U(u("input",{type:"text",class:"form-control","onUpdate:modelValue":d[7]||(d[7]=_=>o.otp=_),placeholder:"6-digit code",inputmode:"numeric",autocomplete:"one-time-code",required:""},null,512),[[O,o.otp]])])):D("",!0)],32)]),footer:q(()=>[u("button",{type:"button",class:"btn-action btn-action-secondary",onClick:d[8]||(d[8]=_=>p.value.hide())},"Cancel"),u("button",{type:"submit",form:"userForm",class:"btn-action btn-action-save",disabled:i.value},[i.value?(I(),x("span",We)):D("",!0),d[29]||(d[29]=T(" Update Username ",-1))],8,Ke)]),_:1},512)]))}};export{je as default}; diff --git a/deploy/ui-dist/assets/Analytics-wS3sZsf7.js b/deploy/ui-dist/assets/Analytics-CkWhgHOC.js similarity index 98% rename from deploy/ui-dist/assets/Analytics-wS3sZsf7.js rename to deploy/ui-dist/assets/Analytics-CkWhgHOC.js index 4c2b3a5..5c24a43 100644 --- a/deploy/ui-dist/assets/Analytics-wS3sZsf7.js +++ b/deploy/ui-dist/assets/Analytics-CkWhgHOC.js @@ -1 +1 @@ -import{r as c,a as T,u as z,o as B,b as E,c as I,d as n,e as t,t as o,f as R,g as r,w as A,v as V,h as F,F as b,i as D,j as P,k as i,n as H}from"./index-BfAhXdi6.js";import{u as X,g as G,C as W,a as q}from"./useTrafficChart-69f2EcZB.js";import{u as J}from"./useFormatters-CKGG-YVI.js";import{C as K}from"./vendor-charts-Bcjh2pZL.js";const Q={class:"kpi-grid mb-4"},Y={class:"stat-item"},Z={class:"stat-content"},$={class:"stat-item"},tt={class:"stat-content"},et={class:"stat-item"},st={class:"stat-content"},at={class:"card mb-4"},lt={class:"card-header d-flex justify-content-between align-items-center flex-wrap"},ot={class:"chart-header-controls"},nt={class:"d-flex align-items-center"},it={class:"toggle-wrapper me-2"},rt={class:"toggle-switch"},dt={class:"card-body"},ct={class:"chart-container"},ut={class:"row"},ft={class:"col-lg-7"},mt={class:"card"},vt={class:"card-body p-0"},pt={class:"table-responsive"},_t={class:"table"},ht={key:0},gt={key:1},yt={class:"user-select-all fw-bold",style:{color:"var(--text-heading)"}},xt={class:"font-monospace text-muted"},bt={class:"d-flex align-items-center"},Ct={class:"progress flex-grow-1",style:{height:"6px"}},kt={class:"ms-2 small text-muted w-25 text-end"},wt={class:"col-lg-5"},St={class:"card mb-4"},Tt={class:"card-body p-3",style:{"min-height":"120px","max-height":"200px","overflow-y":"auto"}},Rt={key:0,class:"text-muted text-center py-3 mb-0"},At={key:1,class:"text-muted text-center py-3 mb-0"},Dt={key:2,class:"list-group list-group-flush"},Nt={class:"fw-bold small"},Lt={class:"text-muted",style:{"font-size":"0.75rem"}},Ot={class:"badge status-warning text-dark"},Ut={class:"card"},Mt={class:"card-body d-flex align-items-center justify-content-around p-4",style:{"min-height":"200px"}},jt={class:"pie-container",style:{width:"140px",height:"140px",flex:"0 0 auto"}},zt={class:"ms-3 flex-grow-1"},Bt={class:"mb-3"},Et={class:"h5 mb-0",style:{color:"var(--text-heading)"}},It={class:"h5 mb-0",style:{color:"var(--text-heading)"}},Gt={__name:"Analytics",setup(Vt){const{fetchAnalytics:N,fetchCertificates:L}=P(),{formatBytes:f}=J(),{config:O}=E(),C=c(null),v=c(null);let u=null;const U=X(C,{maxPoints:96}),d=T({analytics:!0,certs:!0}),m=c("24h"),p=c(!1),a=T({concurrentUsers:"-",totalTraffic:0,expiringCerts:"-",totalReceived:0,totalSent:0,totalReceivedString:"-",totalSentString:"-"}),_=c([]),h=c([]);let k=[];const g=async()=>{d.analytics=!0;try{const l=await N(m.value);l.success&&M(l.data)}catch(l){console.error(l)}finally{d.analytics=!1}},w=async()=>{d.certs=!0;try{const e=(await L()).filter(s=>!s.is_revoked&&!s.is_expired&&s.days_remaining!=null&&s.days_remaining<=45);a.expiringCerts=e.length,h.value=e.sort((s,j)=>s.days_remaining-j.days_remaining)}catch(l){console.error(l)}finally{d.certs=!1}},M=l=>{a.concurrentUsers=l.max_concurrent_24h||0;const e=l.traffic_distribution||{rx:0,tx:0};a.totalReceived=Number(e.rx||0),a.totalSent=Number(e.tx||0),a.totalTraffic=a.totalReceived+a.totalSent,a.totalReceivedString=f(a.totalReceived),a.totalSentString=f(a.totalSent),_.value=(l.top_clients_24h||[]).map(s=>({name:s.common_name,total:Number(s.total_traffic||0),percent:a.totalTraffic>0?(Number(s.total_traffic)/a.totalTraffic*100).toFixed(1):0})),k=(l.global_history_24h||[]).map(s=>({timestamp:s.timestamp,bytes_received:s.total_rx,bytes_sent:s.total_tx,rx_rate_mbps:s.total_rx_rate,tx_rate_mbps:s.total_tx_rate})),y(),S()},y=()=>{U.render(k,{range:m.value,speedMode:p.value})},S=()=>{if(!v.value)return;u&&u.destroy();const l=v.value.getContext("2d"),e=G().isDark?"#161b22":"#ffffff";u=new K(l,{type:"doughnut",data:{labels:["Received","Sent"],datasets:[{data:[a.totalReceived,a.totalSent],backgroundColor:[W,q],borderColor:e,borderWidth:2,hoverOffset:4}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",plugins:{legend:{display:!1}}}})};let x;return z(()=>{y(),S()}),B(()=>{g(),w();const l=O.value?.refresh_interval||3e4;x=setInterval(()=>{g(),w()},l)}),I(()=>{x&&clearInterval(x),u&&u.destroy()}),(l,e)=>(i(),n(b,null,[t("div",Q,[t("div",Y,[t("div",Z,[t("h3",null,o(a.concurrentUsers),1),e[2]||(e[2]=t("p",{class:"stat-label"},"Concurrent Users (Peak)",-1))])]),t("div",$,[t("div",tt,[t("h3",null,o(R(f)(a.totalTraffic)),1),e[3]||(e[3]=t("p",{class:"stat-label"},"Traffic Volume (Total)",-1))])]),t("div",et,[t("div",st,[t("h3",null,o(a.expiringCerts),1),e[4]||(e[4]=t("p",{class:"stat-label"},"Expiring Soon (In 45 Days)",-1))])])]),t("div",at,[t("div",lt,[e[8]||(e[8]=t("span",null,[t("i",{class:"fas fa-chart-area me-2"}),r("Traffic Overview")],-1)),t("div",ot,[A(t("select",{class:"form-select form-select-sm",style:{width:"auto"},"onUpdate:modelValue":e[0]||(e[0]=s=>m.value=s),onChange:g},[...e[5]||(e[5]=[t("option",{value:"24h"},"Last 24 Hours",-1),t("option",{value:"7d"},"Last 7 Days",-1),t("option",{value:"30d"},"Last 1 Month",-1)])],544),[[V,m.value]]),t("div",nt,[t("div",it,[t("label",rt,[A(t("input",{type:"checkbox",id:"vizToggle","onUpdate:modelValue":e[1]||(e[1]=s=>p.value=s),onChange:y},null,544),[[F,p.value]]),e[6]||(e[6]=t("span",{class:"toggle-slider"},null,-1))])]),e[7]||(e[7]=t("label",{class:"small fw-bold user-select-none",style:{color:"var(--text-heading)",cursor:"pointer"},for:"vizToggle"}," Speed ",-1))])])]),t("div",dt,[t("div",ct,[t("canvas",{ref_key:"mainChartRef",ref:C},null,512)])])]),t("div",ut,[t("div",ft,[t("div",mt,[e[12]||(e[12]=t("div",{class:"card-header"},[t("i",{class:"fas fa-trophy me-2"}),r("TOP-10 Active Clients ")],-1)),t("div",vt,[t("div",pt,[t("table",_t,[e[11]||(e[11]=t("thead",null,[t("tr",null,[t("th",null,"Client Name"),t("th",null,"Total Data"),t("th",null,"Activity Share")])],-1)),t("tbody",null,[d.analytics?(i(),n("tr",ht,[...e[9]||(e[9]=[t("td",{colspan:"3",class:"text-center py-4 text-muted"},"Loading...",-1)])])):_.value.length===0?(i(),n("tr",gt,[...e[10]||(e[10]=[t("td",{colspan:"3",class:"text-center py-4 text-muted"},"No data available",-1)])])):(i(!0),n(b,{key:2},D(_.value,s=>(i(),n("tr",{key:s.name},[t("td",null,[t("span",yt,o(s.name),1)]),t("td",xt,o(R(f)(s.total)),1),t("td",null,[t("div",bt,[t("div",Ct,[t("div",{class:"progress-bar",role:"progressbar",style:H({width:s.percent+"%",backgroundColor:"#EC7C31"})},null,4)]),t("span",kt,o(s.percent)+"%",1)])])]))),128))])])])])])]),t("div",wt,[t("div",St,[e[14]||(e[14]=t("div",{class:"card-header d-flex justify-content-between align-items-center"},[t("span",null,[t("i",{class:"fas fa-exclamation-circle me-2"}),r("Certificate Alerts")]),t("span",{class:"badge bg-secondary",style:{"font-size":"0.7em"}},"Next 45 Days")],-1)),t("div",Tt,[d.certs?(i(),n("p",Rt,"Checking certificates...")):h.value.length===0?(i(),n("p",At,[...e[13]||(e[13]=[t("i",{class:"fas fa-check-circle text-success me-2"},null,-1),r("All Good ",-1)])])):(i(),n("div",Dt,[(i(!0),n(b,null,D(h.value,s=>(i(),n("div",{key:s.username,class:"list-group-item px-0 py-2 d-flex justify-content-between align-items-center border-0"},[t("div",null,[t("div",Nt,o(s.username),1),t("div",Lt,"Expires: "+o(s.expiration_date),1)]),t("span",Ot,o(s.days_remaining)+" days",1)]))),128))]))])]),t("div",Ut,[e[17]||(e[17]=t("div",{class:"card-header"},[t("i",{class:"fas fa-chart-pie me-2"}),r("Traffic Distribution ")],-1)),t("div",Mt,[t("div",jt,[t("canvas",{ref_key:"pieChartRef",ref:v},null,512)]),t("div",zt,[t("div",Bt,[e[15]||(e[15]=t("div",{class:"small text-muted mb-1"},[t("span",{class:"legend-dot",style:{background:"#1652B8"}}),r("Download ")],-1)),t("div",Et,o(a.totalReceivedString),1)]),t("div",null,[e[16]||(e[16]=t("div",{class:"small text-muted mb-1"},[t("span",{class:"legend-dot",style:{background:"#EC7C31"}}),r("Upload")],-1)),t("div",It,o(a.totalSentString),1)])])])])])])],64))}};export{Gt as default}; +import{r as c,a as T,u as z,o as B,b as E,c as I,d as n,e as t,t as o,f as R,g as r,w as A,v as V,h as F,F as b,i as D,j as P,k as i,n as H}from"./index-CH6sppUl.js";import{u as X,g as G,C as W,a as q}from"./useTrafficChart-DniISzMl.js";import{u as J}from"./useFormatters-CKGG-YVI.js";import{C as K}from"./vendor-charts-Bcjh2pZL.js";const Q={class:"kpi-grid mb-4"},Y={class:"stat-item"},Z={class:"stat-content"},$={class:"stat-item"},tt={class:"stat-content"},et={class:"stat-item"},st={class:"stat-content"},at={class:"card mb-4"},lt={class:"card-header d-flex justify-content-between align-items-center flex-wrap"},ot={class:"chart-header-controls"},nt={class:"d-flex align-items-center"},it={class:"toggle-wrapper me-2"},rt={class:"toggle-switch"},dt={class:"card-body"},ct={class:"chart-container"},ut={class:"row"},ft={class:"col-lg-7"},mt={class:"card"},vt={class:"card-body p-0"},pt={class:"table-responsive"},_t={class:"table"},ht={key:0},gt={key:1},yt={class:"user-select-all fw-bold",style:{color:"var(--text-heading)"}},xt={class:"font-monospace text-muted"},bt={class:"d-flex align-items-center"},Ct={class:"progress flex-grow-1",style:{height:"6px"}},kt={class:"ms-2 small text-muted w-25 text-end"},wt={class:"col-lg-5"},St={class:"card mb-4"},Tt={class:"card-body p-3",style:{"min-height":"120px","max-height":"200px","overflow-y":"auto"}},Rt={key:0,class:"text-muted text-center py-3 mb-0"},At={key:1,class:"text-muted text-center py-3 mb-0"},Dt={key:2,class:"list-group list-group-flush"},Nt={class:"fw-bold small"},Lt={class:"text-muted",style:{"font-size":"0.75rem"}},Ot={class:"badge status-warning text-dark"},Ut={class:"card"},Mt={class:"card-body d-flex align-items-center justify-content-around p-4",style:{"min-height":"200px"}},jt={class:"pie-container",style:{width:"140px",height:"140px",flex:"0 0 auto"}},zt={class:"ms-3 flex-grow-1"},Bt={class:"mb-3"},Et={class:"h5 mb-0",style:{color:"var(--text-heading)"}},It={class:"h5 mb-0",style:{color:"var(--text-heading)"}},Gt={__name:"Analytics",setup(Vt){const{fetchAnalytics:N,fetchCertificates:L}=P(),{formatBytes:f}=J(),{config:O}=E(),C=c(null),v=c(null);let u=null;const U=X(C,{maxPoints:96}),d=T({analytics:!0,certs:!0}),m=c("24h"),p=c(!1),a=T({concurrentUsers:"-",totalTraffic:0,expiringCerts:"-",totalReceived:0,totalSent:0,totalReceivedString:"-",totalSentString:"-"}),_=c([]),h=c([]);let k=[];const g=async()=>{d.analytics=!0;try{const l=await N(m.value);l.success&&M(l.data)}catch(l){console.error(l)}finally{d.analytics=!1}},w=async()=>{d.certs=!0;try{const e=(await L()).filter(s=>!s.is_revoked&&!s.is_expired&&s.days_remaining!=null&&s.days_remaining<=45);a.expiringCerts=e.length,h.value=e.sort((s,j)=>s.days_remaining-j.days_remaining)}catch(l){console.error(l)}finally{d.certs=!1}},M=l=>{a.concurrentUsers=l.max_concurrent_24h||0;const e=l.traffic_distribution||{rx:0,tx:0};a.totalReceived=Number(e.rx||0),a.totalSent=Number(e.tx||0),a.totalTraffic=a.totalReceived+a.totalSent,a.totalReceivedString=f(a.totalReceived),a.totalSentString=f(a.totalSent),_.value=(l.top_clients_24h||[]).map(s=>({name:s.common_name,total:Number(s.total_traffic||0),percent:a.totalTraffic>0?(Number(s.total_traffic)/a.totalTraffic*100).toFixed(1):0})),k=(l.global_history_24h||[]).map(s=>({timestamp:s.timestamp,bytes_received:s.total_rx,bytes_sent:s.total_tx,rx_rate_mbps:s.total_rx_rate,tx_rate_mbps:s.total_tx_rate})),y(),S()},y=()=>{U.render(k,{range:m.value,speedMode:p.value})},S=()=>{if(!v.value)return;u&&u.destroy();const l=v.value.getContext("2d"),e=G().isDark?"#161b22":"#ffffff";u=new K(l,{type:"doughnut",data:{labels:["Received","Sent"],datasets:[{data:[a.totalReceived,a.totalSent],backgroundColor:[W,q],borderColor:e,borderWidth:2,hoverOffset:4}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",plugins:{legend:{display:!1}}}})};let x;return z(()=>{y(),S()}),B(()=>{g(),w();const l=O.value?.refresh_interval||3e4;x=setInterval(()=>{g(),w()},l)}),I(()=>{x&&clearInterval(x),u&&u.destroy()}),(l,e)=>(i(),n(b,null,[t("div",Q,[t("div",Y,[t("div",Z,[t("h3",null,o(a.concurrentUsers),1),e[2]||(e[2]=t("p",{class:"stat-label"},"Concurrent Users (Peak)",-1))])]),t("div",$,[t("div",tt,[t("h3",null,o(R(f)(a.totalTraffic)),1),e[3]||(e[3]=t("p",{class:"stat-label"},"Traffic Volume (Total)",-1))])]),t("div",et,[t("div",st,[t("h3",null,o(a.expiringCerts),1),e[4]||(e[4]=t("p",{class:"stat-label"},"Expiring Soon (In 45 Days)",-1))])])]),t("div",at,[t("div",lt,[e[8]||(e[8]=t("span",null,[t("i",{class:"fas fa-chart-area me-2"}),r("Traffic Overview")],-1)),t("div",ot,[A(t("select",{class:"form-select form-select-sm",style:{width:"auto"},"onUpdate:modelValue":e[0]||(e[0]=s=>m.value=s),onChange:g},[...e[5]||(e[5]=[t("option",{value:"24h"},"Last 24 Hours",-1),t("option",{value:"7d"},"Last 7 Days",-1),t("option",{value:"30d"},"Last 1 Month",-1)])],544),[[V,m.value]]),t("div",nt,[t("div",it,[t("label",rt,[A(t("input",{type:"checkbox",id:"vizToggle","onUpdate:modelValue":e[1]||(e[1]=s=>p.value=s),onChange:y},null,544),[[F,p.value]]),e[6]||(e[6]=t("span",{class:"toggle-slider"},null,-1))])]),e[7]||(e[7]=t("label",{class:"small fw-bold user-select-none",style:{color:"var(--text-heading)",cursor:"pointer"},for:"vizToggle"}," Speed ",-1))])])]),t("div",dt,[t("div",ct,[t("canvas",{ref_key:"mainChartRef",ref:C},null,512)])])]),t("div",ut,[t("div",ft,[t("div",mt,[e[12]||(e[12]=t("div",{class:"card-header"},[t("i",{class:"fas fa-trophy me-2"}),r("TOP-10 Active Clients ")],-1)),t("div",vt,[t("div",pt,[t("table",_t,[e[11]||(e[11]=t("thead",null,[t("tr",null,[t("th",null,"Client Name"),t("th",null,"Total Data"),t("th",null,"Activity Share")])],-1)),t("tbody",null,[d.analytics?(i(),n("tr",ht,[...e[9]||(e[9]=[t("td",{colspan:"3",class:"text-center py-4 text-muted"},"Loading...",-1)])])):_.value.length===0?(i(),n("tr",gt,[...e[10]||(e[10]=[t("td",{colspan:"3",class:"text-center py-4 text-muted"},"No data available",-1)])])):(i(!0),n(b,{key:2},D(_.value,s=>(i(),n("tr",{key:s.name},[t("td",null,[t("span",yt,o(s.name),1)]),t("td",xt,o(R(f)(s.total)),1),t("td",null,[t("div",bt,[t("div",Ct,[t("div",{class:"progress-bar",role:"progressbar",style:H({width:s.percent+"%",backgroundColor:"#EC7C31"})},null,4)]),t("span",kt,o(s.percent)+"%",1)])])]))),128))])])])])])]),t("div",wt,[t("div",St,[e[14]||(e[14]=t("div",{class:"card-header d-flex justify-content-between align-items-center"},[t("span",null,[t("i",{class:"fas fa-exclamation-circle me-2"}),r("Certificate Alerts")]),t("span",{class:"badge bg-secondary",style:{"font-size":"0.7em"}},"Next 45 Days")],-1)),t("div",Tt,[d.certs?(i(),n("p",Rt,"Checking certificates...")):h.value.length===0?(i(),n("p",At,[...e[13]||(e[13]=[t("i",{class:"fas fa-check-circle text-success me-2"},null,-1),r("All Good ",-1)])])):(i(),n("div",Dt,[(i(!0),n(b,null,D(h.value,s=>(i(),n("div",{key:s.username,class:"list-group-item px-0 py-2 d-flex justify-content-between align-items-center border-0"},[t("div",null,[t("div",Nt,o(s.username),1),t("div",Lt,"Expires: "+o(s.expiration_date),1)]),t("span",Ot,o(s.days_remaining)+" days",1)]))),128))]))])]),t("div",Ut,[e[17]||(e[17]=t("div",{class:"card-header"},[t("i",{class:"fas fa-chart-pie me-2"}),r("Traffic Distribution ")],-1)),t("div",Mt,[t("div",jt,[t("canvas",{ref_key:"pieChartRef",ref:v},null,512)]),t("div",zt,[t("div",Bt,[e[15]||(e[15]=t("div",{class:"small text-muted mb-1"},[t("span",{class:"legend-dot",style:{background:"#1652B8"}}),r("Download ")],-1)),t("div",Et,o(a.totalReceivedString),1)]),t("div",null,[e[16]||(e[16]=t("div",{class:"small text-muted mb-1"},[t("span",{class:"legend-dot",style:{background:"#EC7C31"}}),r("Upload")],-1)),t("div",It,o(a.totalSentString),1)])])])])])])],64))}};export{Gt as default}; diff --git a/deploy/ui-dist/assets/BackupRestore-b-fUBt2d.js b/deploy/ui-dist/assets/BackupRestore-DWeGKaYC.js similarity index 99% rename from deploy/ui-dist/assets/BackupRestore-b-fUBt2d.js rename to deploy/ui-dist/assets/BackupRestore-DWeGKaYC.js index 76981e7..2e3f18a 100644 --- a/deploy/ui-dist/assets/BackupRestore-b-fUBt2d.js +++ b/deploy/ui-dist/assets/BackupRestore-DWeGKaYC.js @@ -1,4 +1,4 @@ -import{r as v,a as F,p as N,D as ze,o as qe,C as We,c as Ye,d as n,e as t,q as B,g as c,m as u,F as b,i as _,t as o,w as g,x,y as Ge,s as C,v as X,A as q,h as ee,z as ge,j as Je,k as l}from"./index-BfAhXdi6.js";import{u as Ze}from"./useFormatters-CKGG-YVI.js";import{_ as ye,a as te}from"./ConfirmModal-wSxjHDVn.js";import"./vendor-ui-Dumif2LN.js";const Qe={class:"backup-page"},Xe={class:"config-card backup-card"},et={class:"d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2"},tt=["disabled"],st={class:"table-responsive"},at={class:"table table-hover mb-0"},nt={key:0},lt={key:1},ot={class:"align-top"},it={class:"fw-semibold",style:{color:"var(--text-heading)"}},rt={class:"text-muted small"},dt={key:0,class:"small mt-1"},ct=["title"],ut={key:1,class:"status-badge status-warning"},pt={key:1,class:"small mt-1"},mt={class:"align-top"},bt={class:"status-badge status-client"},ft={class:"align-top"},gt={class:"align-top"},yt=["title"],vt={key:1,class:"text-muted small"},kt={key:2,class:"text-muted small"},ht={class:"align-top"},_t=["onClick","disabled"],wt={key:0,class:"fas fa-spinner fa-spin"},xt={key:1,class:"fas fa-plug"},St=["onClick","disabled"],Ct=["onClick","disabled"],$t={class:"config-card backup-card"},Tt={class:"d-flex justify-content-between align-items-center flex-wrap gap-2 mb-2"},Pt={key:0,class:"status-badge status-valid"},Nt={key:1,class:"status-badge status-warning"},Vt=["disabled"],It={class:"text-muted small mb-3"},Dt={class:"config-input-group"},Ut=["disabled"],At=["disabled"],Et={class:"text-muted small mt-2 mb-0"},Rt={class:"text-main"},Ft={key:0},Bt={key:1},Mt={key:0,class:"text-muted small mb-3"},jt={key:1,class:"mb-3"},Lt=["id","value","disabled"],Ot=["for"],Ht={class:"text-muted small"},Kt={key:0,class:"text-muted small"},zt={class:"btn-action-group justify-content-center mt-3"},qt=["disabled"],Wt={key:0,class:"fas fa-spinner fa-spin"},Yt={key:1,class:"fas fa-box-archive"},Gt={key:2,class:"nested-box fade-in mt-4"},Jt={class:"nested-label d-flex justify-content-between"},Zt={class:"backup-steps"},Qt={key:0,class:"fas fa-spinner fa-spin me-1"},Xt={class:"fw-semibold ms-2",style:{color:"var(--text-heading)"}},es={key:0,class:"text-muted small ms-1 mt-1"},ts={key:0,class:"text-muted small mt-2"},ss={key:3,class:"mt-4"},as={class:"table-responsive"},ns={class:"table table-hover mb-0"},ls={class:"text-capitalize"},os={class:"small text-muted"},is={class:"config-card backup-card"},rs={class:"config-row"},ds={class:"config-col"},cs={class:"select-container"},us=["disabled"],ps=["value"],ms={key:0,class:"text-muted small mt-2"},bs={key:1,class:"mt-2"},fs={class:"text-muted small mt-1"},gs={key:2,class:"mt-2"},ys={class:"text-muted small ms-2"},vs={class:"config-row"},ks={class:"config-col"},hs={class:"select-container"},_s=["disabled"],ws={value:"",disabled:""},xs=["value"],Ss={key:0,class:"config-row"},Cs={class:"config-col"},$s={class:"btn-action-group justify-content-center"},Ts=["disabled"],Ps={key:0,class:"fas fa-spinner fa-spin"},Ns={key:1,class:"fas fa-rotate-left"},Vs={key:1,class:"nested-box fade-in mt-4"},Is={class:"nested-label d-flex justify-content-between"},Ds={class:"backup-steps"},Us={class:"status-badge status-warning"},As={key:1,class:"mt-3"},Es={class:"mb-3"},Rs={class:"mb-3"},Fs={class:"select-container"},Bs=["value"],Ms={key:0,class:"form-text mt-2 small text-warning"},js={class:"form-label small fw-bold text-muted text-uppercase d-block"},Ls={class:"toggle-wrapper"},Os={class:"toggle-switch"},Hs=["onUpdate:modelValue"],Ks={class:"form-label small fw-bold text-muted text-uppercase"},zs=["onUpdate:modelValue","placeholder"],qs={key:0,class:"form-text mt-1 text-muted small"},Ws={class:"form-label small fw-bold text-muted text-uppercase"},Ys=["onUpdate:modelValue","placeholder"],Gs={class:"form-label small fw-bold text-muted text-uppercase"},Js=["onUpdate:modelValue"],Zs={class:"form-label small fw-bold text-muted text-uppercase"},Qs=["onUpdate:modelValue","placeholder"],Xs={key:0,class:"form-text mt-1 text-muted small"},ea={key:5,class:"form-text mt-2 small text-warning"},ta={key:0,class:"mb-3"},sa={key:0,class:"small text-main",style:{"word-break":"break-all"}},aa={key:1,class:"form-text small text-warning"},na={class:"mb-3"},la={class:"mb-1 d-flex align-items-center"},oa={class:"toggle-wrapper me-2"},ia={class:"toggle-switch"},ra=["disabled"],da={key:0,class:"spinner-border spinner-border-sm me-2"},ca={class:"mb-3"},ua={class:"mb-2"},pa=["disabled"],ma=["disabled"],ba={key:0,class:"spinner-border spinner-border-sm me-2"},ha={__name:"BackupRestore",setup(fa){const{profilesApiClient:y}=Je(),m=We(),{formatBytes:ve}=Ze(),se=v(!0),k=v(!1),M=v(null),p=F({encryption_enabled:!1,default_retention:14,local_root:"",types:[],server_name:"",effective_server_name:"",server_name_source:"hostname"}),P=v(""),V=v([]),W=v([]),$=v([]),i=F({kind:null,state:"idle",stages:[],results:[],warnings:[],message:null,relogin:!1}),j=v(!1),I=v(null),L=v(null),ae=v(null),ne=v(null),le=v(null),r=F({id:null,name:"",type:"local",enabled:!0,retention_count:14,params:{},secrets:{}}),O=v({}),S=F({value:"",confirm:""}),d=F({sourceId:null,checking:!1,sourceError:"",packages:[],packageName:"",passphrase:""});let D=null;const w=a=>a.response?.data?.detail||a.message,h=N(()=>i.state==="running"),H=N(()=>V.value.filter(a=>a.enabled)),U=a=>p.types.find(e=>e.id===a),Y=a=>U(a)?.label||a,A=N(()=>U(r.type)),ke=N(()=>A.value?.fields||[]),K=a=>!!U(a.type)?.remote&&!p.encryption_enabled,E=N(()=>d.packages.find(a=>a.name===d.packageName)||null),he=N(()=>!h.value&&!!E.value&&(!E.value.encrypted||d.passphrase.length>0)),z=a=>{if(!a)return"";const e=new Date(a);return isNaN(e)?a:e.toLocaleString()},oe=a=>a?a.replace("T"," ").replace(/(\.\d+)?Z$/,"")+" UTC":"",_e=a=>`${a.server_name} - ${oe(a.created_at)} (${z(a.created_at)} local) - ${ve(a.size)} - ${a.encrypted?"encrypted":"not encrypted"}`,we=a=>{const e=a.params||{};return a.type==="local"?`${p.local_root||""}/${e.folder||""}`.replace("//","/"):a.type==="s3"?`${e.bucket}${e.prefix?"/"+e.prefix:""} @ ${e.endpoint}`:a.type==="sftp"?`sftp://${e.username}@${e.host}:${e.port}/${e.directory}`:a.type==="ftp"?`${e.tls?"ftps":"ftp"}://${e.username}@${e.host}:${e.port}/${e.directory}`:""},xe=a=>a.type==="ftp"&&a.params&&a.params.tls===!1,Se={package:"Create package",encrypt:"Encrypt",upload:"Send to destinations",download:"Download package",decrypt:"Decrypt",verify:"Verify and unpack",prepare:"Check and migrate databases",safety_backup:"Save current state (safety copy)",stop_openvpn:"Stop OpenVPN if running",replace:"Replace data",finalize:"Regenerate server config, start OpenVPN"},ie=a=>Se[a]||a,re=a=>({pending:"far fa-circle text-muted",running:"fas fa-spinner fa-spin text-primary",done:"fas fa-check-circle text-success",error:"fas fa-times-circle text-danger"})[a]||"far fa-circle text-muted",G=a=>({done:"status-valid",partial:"status-warning",error:"status-expired",interrupted:"status-expired",running:"status-warning"})[a]||"status-secondary",J=a=>({done:"Success",partial:"Partial",error:"Failed",interrupted:"Interrupted",running:"Running"})[a]||a,Ce=a=>({ok:"status-valid",error:"status-expired",running:"status-warning"})[a]||"status-secondary",$e=a=>({ok:"Stored",error:"Failed",running:"Sending",pending:"Waiting",skipped:"Skipped"})[a]||a,Te=async()=>{const a=await y.get("/backup/settings");Object.assign(p,a.data),P.value=p.server_name||""},T=async()=>{const a=await y.get("/backup/destinations");V.value=a.data;const e=new Set(H.value.filter(s=>!K(s)).map(s=>s.id));$.value=$.value.filter(s=>e.has(s))},de=async()=>{const a=await y.get("/backup/history",{params:{limit:10}});W.value=a.data},ce=()=>{$.value=H.value.filter(a=>!K(a)).map(a=>a.id)},ue=()=>{D&&(clearInterval(D),D=null)},Z=()=>{D||(D=setInterval(R,2e3))},R=async()=>{const a=i.state==="running";try{const e=await y.get("/backup/status");Object.assign(i,e.data)}catch{return}if(i.state==="running"){Z();return}ue(),a&&await Pe()},Pe=async()=>{i.kind==="restore"?(j.value=!0,m.show(i.message||"Restore finished",i.state==="done"?"success":"error")):m.show(i.message||"Backup finished",i.state==="done"?"success":i.state==="partial"?"warning":"error");try{await Promise.all([T(),de()])}catch{}i.kind==="restore"&&await fe()},Q=a=>{const e={};return(U(a)?.fields||[]).forEach(s=>{s.kind.startsWith("secret")||(e[s.name]=s.default??(s.kind==="bool"?!1:""))}),e},pe=a=>!!O.value[a],Ne=()=>{const a=p.types[0]?.id||"local";Object.assign(r,{id:null,name:"",type:a,enabled:!0,retention_count:p.default_retention,params:Q(a),secrets:{}}),O.value={},I.value.show()},Ve=a=>{Object.assign(r,{id:a.id,name:a.name,type:a.type,enabled:a.enabled,retention_count:a.retention_count,params:{...Q(a.type),...a.params},secrets:{}}),O.value={...a.secrets},I.value.show()},Ie=()=>{r.params=Q(r.type),r.secrets={},O.value={}},De=async()=>{k.value=!0;const a={name:r.name,type:r.type,enabled:r.enabled,retention_count:r.retention_count,params:r.params,secrets:r.secrets};try{r.id?await y.put(`/backup/destinations/${r.id}`,a):await y.post("/backup/destinations",a),m.show("Destination saved.","success"),I.value.hide(),await T(),r.id||ce()}catch(e){m.show(w(e),"error")}finally{k.value=!1}},Ue=async a=>{M.value=a.id;try{const e=await y.post(`/backup/destinations/${a.id}/test`);e.data.needs_trust?Ae(a,e.data):m.show(e.data.message,e.data.ok?"success":"error"),await T()}catch(e){m.show(w(e),"error")}finally{M.value=null}},Ae=(a,e)=>{le.value.open({title:e.key_changed?"Host Key Changed":"Trust This Server?",message:(e.key_changed?`WARNING: the server now shows a different host key than the trusted one. This happens after a reinstall of the server, but also during an attack. +import{r as v,a as F,p as N,D as ze,o as qe,C as We,c as Ye,d as n,e as t,q as B,g as c,m as u,F as b,i as _,t as o,w as g,x,y as Ge,s as C,v as X,A as q,h as ee,z as ge,j as Je,k as l}from"./index-CH6sppUl.js";import{u as Ze}from"./useFormatters-CKGG-YVI.js";import{_ as ye,a as te}from"./ConfirmModal-XwuF5iM0.js";import"./vendor-ui-Dumif2LN.js";const Qe={class:"backup-page"},Xe={class:"config-card backup-card"},et={class:"d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2"},tt=["disabled"],st={class:"table-responsive"},at={class:"table table-hover mb-0"},nt={key:0},lt={key:1},ot={class:"align-top"},it={class:"fw-semibold",style:{color:"var(--text-heading)"}},rt={class:"text-muted small"},dt={key:0,class:"small mt-1"},ct=["title"],ut={key:1,class:"status-badge status-warning"},pt={key:1,class:"small mt-1"},mt={class:"align-top"},bt={class:"status-badge status-client"},ft={class:"align-top"},gt={class:"align-top"},yt=["title"],vt={key:1,class:"text-muted small"},kt={key:2,class:"text-muted small"},ht={class:"align-top"},_t=["onClick","disabled"],wt={key:0,class:"fas fa-spinner fa-spin"},xt={key:1,class:"fas fa-plug"},St=["onClick","disabled"],Ct=["onClick","disabled"],$t={class:"config-card backup-card"},Tt={class:"d-flex justify-content-between align-items-center flex-wrap gap-2 mb-2"},Pt={key:0,class:"status-badge status-valid"},Nt={key:1,class:"status-badge status-warning"},Vt=["disabled"],It={class:"text-muted small mb-3"},Dt={class:"config-input-group"},Ut=["disabled"],At=["disabled"],Et={class:"text-muted small mt-2 mb-0"},Rt={class:"text-main"},Ft={key:0},Bt={key:1},Mt={key:0,class:"text-muted small mb-3"},jt={key:1,class:"mb-3"},Lt=["id","value","disabled"],Ot=["for"],Ht={class:"text-muted small"},Kt={key:0,class:"text-muted small"},zt={class:"btn-action-group justify-content-center mt-3"},qt=["disabled"],Wt={key:0,class:"fas fa-spinner fa-spin"},Yt={key:1,class:"fas fa-box-archive"},Gt={key:2,class:"nested-box fade-in mt-4"},Jt={class:"nested-label d-flex justify-content-between"},Zt={class:"backup-steps"},Qt={key:0,class:"fas fa-spinner fa-spin me-1"},Xt={class:"fw-semibold ms-2",style:{color:"var(--text-heading)"}},es={key:0,class:"text-muted small ms-1 mt-1"},ts={key:0,class:"text-muted small mt-2"},ss={key:3,class:"mt-4"},as={class:"table-responsive"},ns={class:"table table-hover mb-0"},ls={class:"text-capitalize"},os={class:"small text-muted"},is={class:"config-card backup-card"},rs={class:"config-row"},ds={class:"config-col"},cs={class:"select-container"},us=["disabled"],ps=["value"],ms={key:0,class:"text-muted small mt-2"},bs={key:1,class:"mt-2"},fs={class:"text-muted small mt-1"},gs={key:2,class:"mt-2"},ys={class:"text-muted small ms-2"},vs={class:"config-row"},ks={class:"config-col"},hs={class:"select-container"},_s=["disabled"],ws={value:"",disabled:""},xs=["value"],Ss={key:0,class:"config-row"},Cs={class:"config-col"},$s={class:"btn-action-group justify-content-center"},Ts=["disabled"],Ps={key:0,class:"fas fa-spinner fa-spin"},Ns={key:1,class:"fas fa-rotate-left"},Vs={key:1,class:"nested-box fade-in mt-4"},Is={class:"nested-label d-flex justify-content-between"},Ds={class:"backup-steps"},Us={class:"status-badge status-warning"},As={key:1,class:"mt-3"},Es={class:"mb-3"},Rs={class:"mb-3"},Fs={class:"select-container"},Bs=["value"],Ms={key:0,class:"form-text mt-2 small text-warning"},js={class:"form-label small fw-bold text-muted text-uppercase d-block"},Ls={class:"toggle-wrapper"},Os={class:"toggle-switch"},Hs=["onUpdate:modelValue"],Ks={class:"form-label small fw-bold text-muted text-uppercase"},zs=["onUpdate:modelValue","placeholder"],qs={key:0,class:"form-text mt-1 text-muted small"},Ws={class:"form-label small fw-bold text-muted text-uppercase"},Ys=["onUpdate:modelValue","placeholder"],Gs={class:"form-label small fw-bold text-muted text-uppercase"},Js=["onUpdate:modelValue"],Zs={class:"form-label small fw-bold text-muted text-uppercase"},Qs=["onUpdate:modelValue","placeholder"],Xs={key:0,class:"form-text mt-1 text-muted small"},ea={key:5,class:"form-text mt-2 small text-warning"},ta={key:0,class:"mb-3"},sa={key:0,class:"small text-main",style:{"word-break":"break-all"}},aa={key:1,class:"form-text small text-warning"},na={class:"mb-3"},la={class:"mb-1 d-flex align-items-center"},oa={class:"toggle-wrapper me-2"},ia={class:"toggle-switch"},ra=["disabled"],da={key:0,class:"spinner-border spinner-border-sm me-2"},ca={class:"mb-3"},ua={class:"mb-2"},pa=["disabled"],ma=["disabled"],ba={key:0,class:"spinner-border spinner-border-sm me-2"},ha={__name:"BackupRestore",setup(fa){const{profilesApiClient:y}=Je(),m=We(),{formatBytes:ve}=Ze(),se=v(!0),k=v(!1),M=v(null),p=F({encryption_enabled:!1,default_retention:14,local_root:"",types:[],server_name:"",effective_server_name:"",server_name_source:"hostname"}),P=v(""),V=v([]),W=v([]),$=v([]),i=F({kind:null,state:"idle",stages:[],results:[],warnings:[],message:null,relogin:!1}),j=v(!1),I=v(null),L=v(null),ae=v(null),ne=v(null),le=v(null),r=F({id:null,name:"",type:"local",enabled:!0,retention_count:14,params:{},secrets:{}}),O=v({}),S=F({value:"",confirm:""}),d=F({sourceId:null,checking:!1,sourceError:"",packages:[],packageName:"",passphrase:""});let D=null;const w=a=>a.response?.data?.detail||a.message,h=N(()=>i.state==="running"),H=N(()=>V.value.filter(a=>a.enabled)),U=a=>p.types.find(e=>e.id===a),Y=a=>U(a)?.label||a,A=N(()=>U(r.type)),ke=N(()=>A.value?.fields||[]),K=a=>!!U(a.type)?.remote&&!p.encryption_enabled,E=N(()=>d.packages.find(a=>a.name===d.packageName)||null),he=N(()=>!h.value&&!!E.value&&(!E.value.encrypted||d.passphrase.length>0)),z=a=>{if(!a)return"";const e=new Date(a);return isNaN(e)?a:e.toLocaleString()},oe=a=>a?a.replace("T"," ").replace(/(\.\d+)?Z$/,"")+" UTC":"",_e=a=>`${a.server_name} - ${oe(a.created_at)} (${z(a.created_at)} local) - ${ve(a.size)} - ${a.encrypted?"encrypted":"not encrypted"}`,we=a=>{const e=a.params||{};return a.type==="local"?`${p.local_root||""}/${e.folder||""}`.replace("//","/"):a.type==="s3"?`${e.bucket}${e.prefix?"/"+e.prefix:""} @ ${e.endpoint}`:a.type==="sftp"?`sftp://${e.username}@${e.host}:${e.port}/${e.directory}`:a.type==="ftp"?`${e.tls?"ftps":"ftp"}://${e.username}@${e.host}:${e.port}/${e.directory}`:""},xe=a=>a.type==="ftp"&&a.params&&a.params.tls===!1,Se={package:"Create package",encrypt:"Encrypt",upload:"Send to destinations",download:"Download package",decrypt:"Decrypt",verify:"Verify and unpack",prepare:"Check and migrate databases",safety_backup:"Save current state (safety copy)",stop_openvpn:"Stop OpenVPN if running",replace:"Replace data",finalize:"Regenerate server config, start OpenVPN"},ie=a=>Se[a]||a,re=a=>({pending:"far fa-circle text-muted",running:"fas fa-spinner fa-spin text-primary",done:"fas fa-check-circle text-success",error:"fas fa-times-circle text-danger"})[a]||"far fa-circle text-muted",G=a=>({done:"status-valid",partial:"status-warning",error:"status-expired",interrupted:"status-expired",running:"status-warning"})[a]||"status-secondary",J=a=>({done:"Success",partial:"Partial",error:"Failed",interrupted:"Interrupted",running:"Running"})[a]||a,Ce=a=>({ok:"status-valid",error:"status-expired",running:"status-warning"})[a]||"status-secondary",$e=a=>({ok:"Stored",error:"Failed",running:"Sending",pending:"Waiting",skipped:"Skipped"})[a]||a,Te=async()=>{const a=await y.get("/backup/settings");Object.assign(p,a.data),P.value=p.server_name||""},T=async()=>{const a=await y.get("/backup/destinations");V.value=a.data;const e=new Set(H.value.filter(s=>!K(s)).map(s=>s.id));$.value=$.value.filter(s=>e.has(s))},de=async()=>{const a=await y.get("/backup/history",{params:{limit:10}});W.value=a.data},ce=()=>{$.value=H.value.filter(a=>!K(a)).map(a=>a.id)},ue=()=>{D&&(clearInterval(D),D=null)},Z=()=>{D||(D=setInterval(R,2e3))},R=async()=>{const a=i.state==="running";try{const e=await y.get("/backup/status");Object.assign(i,e.data)}catch{return}if(i.state==="running"){Z();return}ue(),a&&await Pe()},Pe=async()=>{i.kind==="restore"?(j.value=!0,m.show(i.message||"Restore finished",i.state==="done"?"success":"error")):m.show(i.message||"Backup finished",i.state==="done"?"success":i.state==="partial"?"warning":"error");try{await Promise.all([T(),de()])}catch{}i.kind==="restore"&&await fe()},Q=a=>{const e={};return(U(a)?.fields||[]).forEach(s=>{s.kind.startsWith("secret")||(e[s.name]=s.default??(s.kind==="bool"?!1:""))}),e},pe=a=>!!O.value[a],Ne=()=>{const a=p.types[0]?.id||"local";Object.assign(r,{id:null,name:"",type:a,enabled:!0,retention_count:p.default_retention,params:Q(a),secrets:{}}),O.value={},I.value.show()},Ve=a=>{Object.assign(r,{id:a.id,name:a.name,type:a.type,enabled:a.enabled,retention_count:a.retention_count,params:{...Q(a.type),...a.params},secrets:{}}),O.value={...a.secrets},I.value.show()},Ie=()=>{r.params=Q(r.type),r.secrets={},O.value={}},De=async()=>{k.value=!0;const a={name:r.name,type:r.type,enabled:r.enabled,retention_count:r.retention_count,params:r.params,secrets:r.secrets};try{r.id?await y.put(`/backup/destinations/${r.id}`,a):await y.post("/backup/destinations",a),m.show("Destination saved.","success"),I.value.hide(),await T(),r.id||ce()}catch(e){m.show(w(e),"error")}finally{k.value=!1}},Ue=async a=>{M.value=a.id;try{const e=await y.post(`/backup/destinations/${a.id}/test`);e.data.needs_trust?Ae(a,e.data):m.show(e.data.message,e.data.ok?"success":"error"),await T()}catch(e){m.show(w(e),"error")}finally{M.value=null}},Ae=(a,e)=>{le.value.open({title:e.key_changed?"Host Key Changed":"Trust This Server?",message:(e.key_changed?`WARNING: the server now shows a different host key than the trusted one. This happens after a reinstall of the server, but also during an attack. `:`The server of "${a.name}" showed this host key. Compare it with the fingerprint you know (ssh-keygen -lf on the server) before you trust it. diff --git a/deploy/ui-dist/assets/Certificates-Q5PSlJMg.js b/deploy/ui-dist/assets/Certificates-bKg5i2cX.js similarity index 99% rename from deploy/ui-dist/assets/Certificates-Q5PSlJMg.js rename to deploy/ui-dist/assets/Certificates-bKg5i2cX.js index 6b58c4b..0dd882f 100644 --- a/deploy/ui-dist/assets/Certificates-Q5PSlJMg.js +++ b/deploy/ui-dist/assets/Certificates-bKg5i2cX.js @@ -1 +1 @@ -import{r as v,p as g,l as F,k as r,A as S,e,d as c,m as C,w as D,y as O,s as z,x as q,g as k,t as i,F as T,o as oe,B as ie,q as L,f as j,h as re,i as Z,j as de,C as ue,z as V}from"./index-BfAhXdi6.js";import{_ as W,a as ce}from"./ConfirmModal-wSxjHDVn.js";import{T as pe}from"./vendor-ui-Dumif2LN.js";const fe={class:"mb-3"},ve={class:"input-group"},me={key:0,class:"text-danger small mt-2"},_e=["disabled"],be={__name:"NewClientModal",emits:["create"],setup(d,{expose:u,emit:x}){const m=x,y=v(null),n=v(""),f=v(null),w=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,_=g(()=>w.test(n.value)),$=()=>{n.value="",y.value.show()},N=()=>{y.value.hide()},h=()=>{_.value&&(m("create",n.value),N())};return u({open:$,close:N}),(b,a)=>(r(),F(W,{id:"newClientModal",title:"Create New Client",ref_key:"modal",ref:y,onOpened:a[1]||(a[1]=o=>f.value?.focus())},{body:S(()=>[e("div",fe,[a[3]||(a[3]=e("label",{for:"clientName",class:"form-label small text-muted text-uppercase fw-bold"},"Client Name",-1)),e("div",ve,[a[2]||(a[2]=e("span",{class:"input-group-text"},[e("i",{class:"fas fa-user"})],-1)),D(e("input",{type:"text",class:z(["form-control",{"is-invalid":n.value&&!_.value}]),id:"clientName","onUpdate:modelValue":a[0]||(a[0]=o=>n.value=o),placeholder:"e.g. laptop-user",maxlength:"64",autocomplete:"off",onKeyup:O(h,["enter"]),ref_key:"inputRef",ref:f},null,34),[[q,n.value]])]),n.value&&!_.value?(r(),c("div",me," Letters, digits, dashes and underscores only; the first character must be a letter or a digit. ")):C("",!0),a[4]||(a[4]=e("div",{class:"form-text mt-2 text-muted small"},[e("i",{class:"fas fa-info-circle me-1"}),k(" Use only alphanumeric characters, dashes, or underscores. ")],-1))])]),footer:S(()=>[e("button",{type:"button",class:"btn-action btn-action-secondary",onClick:N},"Cancel"),e("button",{type:"button",class:"btn-action btn-action-save",onClick:h,disabled:!_.value}," Create Client ",8,_e)]),_:1},512))}},I={__name:"StatusBadge",props:{profile:{type:Object,required:!0}},setup(d){const u=d,x=g(()=>{const m=u.profile;return m.is_revoked?{label:"Revoked",cls:"status-expired",icon:"fa-ban"}:m.is_expired?{label:"Expired",cls:"status-expired",icon:"fa-times-circle"}:m.days_remaining!=null&&m.days_remaining<=30?{label:"Expiring Soon",cls:"status-warning",icon:"fa-exclamation-triangle"}:{label:"Active",cls:"status-valid",icon:"fa-check-circle"}});return(m,y)=>(r(),c("span",{class:z(["status-badge",x.value.cls])},[e("i",{class:z(["fas me-1",x.value.icon])},null,2),k(i(x.value.label),1)],2))}},ye={class:"d-flex align-items-center gap-2 flex-wrap"},ge={class:"modal-title fw-bold mb-0",style:{color:"var(--text-heading)"}},xe={key:0},he={class:"profile-meta"},ke={key:0,class:"text-muted"},Ce={class:"certificate-file text-muted small text-break mt-0"},we={class:"form-text text-end"},$e=["disabled"],Ne={__name:"ProfileDetailsModal",emits:["save"],setup(d,{expose:u,emit:x}){const m=x,y=v(null),n=v(null),f=v(""),w=g(()=>f.value!==(n.value?.note||"")),_=g(()=>{const a=n.value?.days_remaining;return a==null?"":a>0?`${a} d`:"expired"}),$=a=>{if(!a)return"N/A";const o=new Date(a);if(isNaN(o))return a;const A=U=>String(U).padStart(2,"0");return`${o.getFullYear()}-${A(o.getMonth()+1)}-${A(o.getDate())} ${A(o.getHours())}:${A(o.getMinutes())}`},N=a=>{n.value=a,f.value=a.note||"",y.value.show()},h=()=>{y.value.hide()},b=()=>{m("save",{id:n.value.id,note:f.value}),h()};return u({open:N,close:h}),(a,o)=>(r(),F(W,{id:"profileDetailsModal",title:"Profile Details",ref_key:"modal",ref:y},{header:S(()=>[e("div",ye,[e("h5",ge,i(n.value?.username),1),n.value?(r(),F(I,{key:0,profile:n.value},null,8,["profile"])):C("",!0)])]),body:S(()=>[n.value?(r(),c("div",xe,[e("dl",he,[o[2]||(o[2]=e("dt",null,"Created",-1)),e("dd",null,i($(n.value.created_at)),1),o[3]||(o[3]=e("dt",null,"Expires",-1)),e("dd",null,[k(i($(n.value.expiration_date)),1),_.value?(r(),c("span",ke," ("+i(_.value)+")",1)):C("",!0)]),n.value.revoked_at?(r(),c(T,{key:0},[o[1]||(o[1]=e("dt",null,"Revoked",-1)),e("dd",null,i($(n.value.revoked_at)),1)],64)):C("",!0),o[4]||(o[4]=e("dt",null,"File",-1)),e("dd",Ce,i(n.value.file_path||"N/A"),1)]),o[5]||(o[5]=e("label",{for:"profileNote",class:"form-label small text-muted text-uppercase fw-bold"},"Note",-1)),D(e("textarea",{class:"form-control",id:"profileNote",rows:"3",maxlength:"1000","onUpdate:modelValue":o[0]||(o[0]=A=>f.value=A),placeholder:"Add a note about this profile..."},null,512),[[q,f.value]]),e("div",we,i(f.value.length)+" / 1000",1)])):C("",!0)]),footer:S(()=>[e("button",{type:"button",class:"btn-action btn-action-secondary",onClick:h},"Close"),e("button",{type:"button",class:"btn-action btn-action-save",onClick:b,disabled:!w.value},"Save",8,$e)]),_:1},512))}},Q=(d,u)=>{d._noteTooltip=new pe(d,{title:u,placement:"top",container:"body",html:!1,trigger:"hover",customClass:"note-tooltip"})},G=d=>{d._noteTooltip?.dispose(),d._noteTooltip=null},Ae=d=>d._noteTooltip?.hide(),J={mounted(d,u){d.addEventListener("click",()=>Ae(d)),u.value&&Q(d,u.value)},updated(d,u){u.value!==u.oldValue&&(G(d),u.value&&Q(d,u.value))},unmounted(d){G(d)}},Re={class:"stats-info mb-4",id:"statsInfo"},Me={class:"stat-item"},Te={class:"stat-value"},De={class:"stat-item"},Ee={class:"stat-value"},Le={class:"stat-item"},Ve={class:"stat-value"},Se={class:"stat-item"},Ue={class:"stat-value"},Be={class:"d-flex justify-content-between align-items-center mb-3 flex-wrap gap-3"},Ke={class:"d-flex gap-3 align-items-center flex-wrap"},je={class:"input-group input-group-sm",style:{width:"250px"}},ze=["disabled","title"],Pe={class:"d-flex align-items-center"},Fe={class:"toggle-wrapper me-2"},Oe={class:"toggle-switch"},Ie={class:"card",id:"certificatesCard"},qe={class:"card-header d-flex justify-content-between align-items-center bg-transparent"},He={class:"status-badge status-valid me-1"},Ye={class:"status-badge status-expired"},Ze={class:"table-responsive"},Qe={class:"table table-hover mb-0"},Ge={key:0},Je={key:1},We={key:0,class:"section-divider"},Xe={colspan:"6"},et=["onClick","onKeydown"],tt={class:"fw-semibold",style:{color:"var(--text-heading)"}},st={key:0,class:"fas fa-note-sticky text-muted ms-1 small"},lt={class:"certificate-file text-muted small"},nt=["onClick"],at=["onClick"],ot={class:"section-divider"},it={colspan:"6"},rt=["onClick","onKeydown"],dt={class:"fw-semibold",style:{color:"var(--text-heading)"}},ut={key:0,class:"fas fa-note-sticky text-muted ms-1 small"},ct={class:"certificate-file text-muted small"},pt={class:"fw-semibold text-muted"},ft=["onClick","disabled"],bt={__name:"Certificates",setup(d){const{profilesApiClient:u}=de(),x=ue(),{status:m,refresh:y}=ie(),n=v(!0),f=v([]),w=v(""),_=v(!1),$=v(null),N=v(null),h=v(null),b=(l,t="success")=>x.show(l,t),a=l=>{if(!l)return"N/A";try{const t=new Date(l);return isNaN(t)?l:t.toLocaleDateString()+" "+t.toLocaleTimeString()}catch{return l}},o=l=>l==null?"":l<=0?"text-danger":l<=30?"text-warning":"text-success",A=g(()=>{let l=f.value;if(w.value){const t=w.value.toLowerCase();l=l.filter(s=>(s.username||"").toLowerCase().includes(t))}return l}),U=g(()=>{const l=[],t=[];return A.value.forEach(s=>{s.is_revoked||s.is_expired?t.push(s):l.push(s)}),l.sort((s,p)=>(s.days_remaining??9999)-(p.days_remaining??9999)),t.sort((s,p)=>(p.days_remaining??-9999)-(s.days_remaining??-9999)),{active:l,expired:t}}),R=g(()=>U.value.active),M=g(()=>U.value.expired),X=g(()=>f.value.length),ee=g(()=>R.value.filter(l=>l.days_remaining!==null&&l.days_remaining<=30).length),B=async()=>{n.value=!0;try{const l=await u.get("/profiles");f.value=l.data||[]}catch(l){console.error(l),b("Failed to load profiles","error")}finally{n.value=!1}},te=()=>{$.value.open()},se=async l=>{try{n.value=!0,await u.post("/profiles",{username:l}),b("Client created successfully.","success"),B()}catch(t){b(t.response?.data?.detail||t.message,"error")}finally{n.value=!1}},K=l=>{h.value.open(l)},le=async({id:l,note:t})=>{try{await u.put(`/profiles/${l}/note`,{note:t}),b("Note saved.","success"),B()}catch(s){b(s.response?.data?.detail||s.message,"error")}},ne=async l=>{if(l.id)try{const t=await u.get(`/profiles/${l.id}/download`,{responseType:"blob"}),s=t.headers["content-disposition"];let p=`${l.username}.ovpn`;if(s){const P=s.match(/filename="?([^"]+)"?/);P&&P[1]&&(p=P[1])}const Y=window.URL.createObjectURL(new Blob([t.data])),E=document.createElement("a");E.href=Y,E.setAttribute("download",p),document.body.appendChild(E),E.click(),document.body.removeChild(E),setTimeout(()=>window.URL.revokeObjectURL(Y),1e3)}catch(t){b("Could not download config: "+(t.response?.data?.detail||t.message),"error")}},H=l=>{l.is_revoked||N.value.open({title:"Revoke Certificate?",message:`Are you sure you want to revoke access for ${l.username}? This action cannot be undone.`,confirmText:"Yes, Revoke",confirmBtnClass:"btn-action-danger",data:l})},ae=async l=>{try{n.value=!0,await u.delete(`/profiles/${l.id}`),b(`${l.username} has been revoked.`,"success"),B()}catch(t){b(t.response?.data?.detail||t.message,"error")}finally{n.value=!1}};return oe(()=>{y(),B()}),(l,t)=>(r(),c(T,null,[e("div",Re,[e("div",Me,[e("div",Te,i(X.value),1),t[2]||(t[2]=e("div",{class:"stat-label"},"Total Certificates",-1))]),e("div",De,[e("div",Ee,i(R.value.length),1),t[3]||(t[3]=e("div",{class:"stat-label"},"Active Certificates",-1))]),e("div",Le,[e("div",Ve,i(ee.value),1),t[4]||(t[4]=e("div",{class:"stat-label"},"Expiring in 30 days",-1))]),e("div",Se,[e("div",Ue,i(M.value.length),1),t[5]||(t[5]=e("div",{class:"stat-label"},"Expired / Revoked",-1))])]),e("div",Be,[e("div",Ke,[e("div",je,[t[6]||(t[6]=e("span",{class:"input-group-text"},[e("i",{class:"fas fa-search"})],-1)),D(e("input",{type:"text",class:"form-control",placeholder:"Search by client name...","onUpdate:modelValue":t[0]||(t[0]=s=>w.value=s)},null,512),[[q,w.value]])]),e("button",{class:"btn-action btn-action-save btn-sm",onClick:te,disabled:!j(m).pki_ready,title:j(m).pki_ready?"":"Initialize PKI first"},[...t[7]||(t[7]=[e("i",{class:"fas fa-plus me-1"},null,-1),k(" New Client ",-1)])],8,ze)]),e("div",Pe,[e("div",Fe,[e("label",Oe,[D(e("input",{type:"checkbox",id:"hideExpired","onUpdate:modelValue":t[1]||(t[1]=s=>_.value=s)},null,512),[[re,_.value]]),t[8]||(t[8]=e("span",{class:"toggle-slider"},null,-1))])]),t[9]||(t[9]=e("label",{class:"user-select-none text-muted",for:"hideExpired",style:{cursor:"pointer"}},"Hide Expired/Revoked",-1))])]),e("div",Ie,[e("div",qe,[t[14]||(t[14]=e("span",null,[e("i",{class:"fas fa-certificate me-2"}),k("Certificates List")],-1)),e("div",null,[e("div",null,[e("span",He,[t[10]||(t[10]=e("i",{class:"fas fa-check-circle me-1"},null,-1)),e("span",null,i(R.value.length),1),t[11]||(t[11]=k(" Active ",-1))]),e("span",Ye,[t[12]||(t[12]=e("i",{class:"fas fa-times-circle me-1"},null,-1)),e("span",null,i(M.value.length),1),t[13]||(t[13]=k(" Revoked/Expired ",-1))])])])]),e("div",Ze,[e("table",Qe,[t[22]||(t[22]=e("thead",null,[e("tr",null,[e("th",null,"Client Name"),e("th",null,"Type"),e("th",null,"Validity Not After"),e("th",null,"Days Remaining"),e("th",null,"Status"),e("th",null,"Actions")])],-1)),e("tbody",null,[n.value?(r(),c("tr",Ge,[...t[15]||(t[15]=[e("td",{colspan:"6",class:"text-center py-4"},[e("div",{class:"spinner-border spinner-border-sm text-primary",role:"status"},[e("span",{class:"visually-hidden"},"Loading...")]),e("p",{class:"mt-2 mb-0"},"Loading profiles...")],-1)])])):R.value.length===0&&M.value.length===0?(r(),c("tr",Je,[...t[16]||(t[16]=[e("td",{colspan:"6",class:"empty-state text-center py-5"},[e("i",{class:"fas fa-certificate fa-2x mb-3 text-muted"}),e("p",{class:"text-muted"},"No certificates found")],-1)])])):(r(),c(T,{key:2},[R.value.length>0?(r(),c("tr",We,[e("td",Xe,"Active Certificates ("+i(R.value.length)+")",1)])):C("",!0),(r(!0),c(T,null,Z(R.value,s=>(r(),c("tr",{key:s.id+"_active",style:{cursor:"pointer"},tabindex:"0",onClick:p=>K(s),onKeydown:O(V(p=>K(s),["self"]),["enter"])},[D((r(),c("td",null,[e("div",tt,[k(i(s.username)+" ",1),s.note?(r(),c("i",st)):C("",!0)]),e("div",lt,i(s.file_path||"N/A"),1)])),[[j(J),s.note]]),t[19]||(t[19]=e("td",null,[e("span",{class:"status-badge status-client"},"Client")],-1)),e("td",null,i(a(s.expiration_date)),1),e("td",{class:z(["fw-semibold",o(s.days_remaining)])},i(s.days_remaining),3),e("td",null,[L(I,{profile:s},null,8,["profile"])]),e("td",null,[e("button",{class:"btn btn-sm btn-link text-warning p-0 me-2",title:"Download Config",onClick:V(p=>ne(s),["stop"])},[...t[17]||(t[17]=[e("i",{class:"fas fa-download"},null,-1)])],8,nt),e("button",{class:"btn btn-sm btn-link text-danger p-0",title:"Revoke",onClick:V(p=>H(s),["stop"])},[...t[18]||(t[18]=[e("i",{class:"fas fa-ban"},null,-1)])],8,at)])],40,et))),128)),!_.value&&M.value.length>0?(r(),c(T,{key:1},[e("tr",ot,[e("td",it,"Expired / Revoked ("+i(M.value.length)+")",1)]),(r(!0),c(T,null,Z(M.value,s=>(r(),c("tr",{key:s.id+"_expired",style:{cursor:"pointer"},tabindex:"0",onClick:p=>K(s),onKeydown:O(V(p=>K(s),["self"]),["enter"])},[D((r(),c("td",null,[e("div",dt,[k(i(s.username)+" ",1),s.note?(r(),c("i",ut)):C("",!0)]),e("div",ct,i(s.file_path||"N/A"),1)])),[[j(J),s.note]]),t[21]||(t[21]=e("td",null,[e("span",{class:"status-badge status-client"},"Client")],-1)),e("td",null,i(a(s.expiration_date)),1),e("td",pt,i(s.days_remaining),1),e("td",null,[L(I,{profile:s},null,8,["profile"])]),e("td",null,[e("button",{class:"btn btn-sm btn-link text-danger p-0",title:"Revoke",onClick:V(p=>H(s),["stop"]),disabled:s.is_revoked},[...t[20]||(t[20]=[e("i",{class:"fas fa-ban"},null,-1)])],8,ft)])],40,rt))),128))],64)):C("",!0)],64))])])])]),L(be,{ref_key:"newClientModal",ref:$,onCreate:se},null,512),L(ce,{ref_key:"confirmModal",ref:N,onConfirm:ae},null,512),L(Ne,{ref_key:"detailsModal",ref:h,onSave:le},null,512)],64))}};export{bt as default}; +import{r as v,p as g,l as F,k as r,A as S,e,d as c,m as C,w as D,y as O,s as z,x as q,g as k,t as i,F as T,o as oe,B as ie,q as L,f as j,h as re,i as Z,j as de,C as ue,z as V}from"./index-CH6sppUl.js";import{_ as W,a as ce}from"./ConfirmModal-XwuF5iM0.js";import{T as pe}from"./vendor-ui-Dumif2LN.js";const fe={class:"mb-3"},ve={class:"input-group"},me={key:0,class:"text-danger small mt-2"},_e=["disabled"],be={__name:"NewClientModal",emits:["create"],setup(d,{expose:u,emit:x}){const m=x,y=v(null),n=v(""),f=v(null),w=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,_=g(()=>w.test(n.value)),$=()=>{n.value="",y.value.show()},N=()=>{y.value.hide()},h=()=>{_.value&&(m("create",n.value),N())};return u({open:$,close:N}),(b,a)=>(r(),F(W,{id:"newClientModal",title:"Create New Client",ref_key:"modal",ref:y,onOpened:a[1]||(a[1]=o=>f.value?.focus())},{body:S(()=>[e("div",fe,[a[3]||(a[3]=e("label",{for:"clientName",class:"form-label small text-muted text-uppercase fw-bold"},"Client Name",-1)),e("div",ve,[a[2]||(a[2]=e("span",{class:"input-group-text"},[e("i",{class:"fas fa-user"})],-1)),D(e("input",{type:"text",class:z(["form-control",{"is-invalid":n.value&&!_.value}]),id:"clientName","onUpdate:modelValue":a[0]||(a[0]=o=>n.value=o),placeholder:"e.g. laptop-user",maxlength:"64",autocomplete:"off",onKeyup:O(h,["enter"]),ref_key:"inputRef",ref:f},null,34),[[q,n.value]])]),n.value&&!_.value?(r(),c("div",me," Letters, digits, dashes and underscores only; the first character must be a letter or a digit. ")):C("",!0),a[4]||(a[4]=e("div",{class:"form-text mt-2 text-muted small"},[e("i",{class:"fas fa-info-circle me-1"}),k(" Use only alphanumeric characters, dashes, or underscores. ")],-1))])]),footer:S(()=>[e("button",{type:"button",class:"btn-action btn-action-secondary",onClick:N},"Cancel"),e("button",{type:"button",class:"btn-action btn-action-save",onClick:h,disabled:!_.value}," Create Client ",8,_e)]),_:1},512))}},I={__name:"StatusBadge",props:{profile:{type:Object,required:!0}},setup(d){const u=d,x=g(()=>{const m=u.profile;return m.is_revoked?{label:"Revoked",cls:"status-expired",icon:"fa-ban"}:m.is_expired?{label:"Expired",cls:"status-expired",icon:"fa-times-circle"}:m.days_remaining!=null&&m.days_remaining<=30?{label:"Expiring Soon",cls:"status-warning",icon:"fa-exclamation-triangle"}:{label:"Active",cls:"status-valid",icon:"fa-check-circle"}});return(m,y)=>(r(),c("span",{class:z(["status-badge",x.value.cls])},[e("i",{class:z(["fas me-1",x.value.icon])},null,2),k(i(x.value.label),1)],2))}},ye={class:"d-flex align-items-center gap-2 flex-wrap"},ge={class:"modal-title fw-bold mb-0",style:{color:"var(--text-heading)"}},xe={key:0},he={class:"profile-meta"},ke={key:0,class:"text-muted"},Ce={class:"certificate-file text-muted small text-break mt-0"},we={class:"form-text text-end"},$e=["disabled"],Ne={__name:"ProfileDetailsModal",emits:["save"],setup(d,{expose:u,emit:x}){const m=x,y=v(null),n=v(null),f=v(""),w=g(()=>f.value!==(n.value?.note||"")),_=g(()=>{const a=n.value?.days_remaining;return a==null?"":a>0?`${a} d`:"expired"}),$=a=>{if(!a)return"N/A";const o=new Date(a);if(isNaN(o))return a;const A=U=>String(U).padStart(2,"0");return`${o.getFullYear()}-${A(o.getMonth()+1)}-${A(o.getDate())} ${A(o.getHours())}:${A(o.getMinutes())}`},N=a=>{n.value=a,f.value=a.note||"",y.value.show()},h=()=>{y.value.hide()},b=()=>{m("save",{id:n.value.id,note:f.value}),h()};return u({open:N,close:h}),(a,o)=>(r(),F(W,{id:"profileDetailsModal",title:"Profile Details",ref_key:"modal",ref:y},{header:S(()=>[e("div",ye,[e("h5",ge,i(n.value?.username),1),n.value?(r(),F(I,{key:0,profile:n.value},null,8,["profile"])):C("",!0)])]),body:S(()=>[n.value?(r(),c("div",xe,[e("dl",he,[o[2]||(o[2]=e("dt",null,"Created",-1)),e("dd",null,i($(n.value.created_at)),1),o[3]||(o[3]=e("dt",null,"Expires",-1)),e("dd",null,[k(i($(n.value.expiration_date)),1),_.value?(r(),c("span",ke," ("+i(_.value)+")",1)):C("",!0)]),n.value.revoked_at?(r(),c(T,{key:0},[o[1]||(o[1]=e("dt",null,"Revoked",-1)),e("dd",null,i($(n.value.revoked_at)),1)],64)):C("",!0),o[4]||(o[4]=e("dt",null,"File",-1)),e("dd",Ce,i(n.value.file_path||"N/A"),1)]),o[5]||(o[5]=e("label",{for:"profileNote",class:"form-label small text-muted text-uppercase fw-bold"},"Note",-1)),D(e("textarea",{class:"form-control",id:"profileNote",rows:"3",maxlength:"1000","onUpdate:modelValue":o[0]||(o[0]=A=>f.value=A),placeholder:"Add a note about this profile..."},null,512),[[q,f.value]]),e("div",we,i(f.value.length)+" / 1000",1)])):C("",!0)]),footer:S(()=>[e("button",{type:"button",class:"btn-action btn-action-secondary",onClick:h},"Close"),e("button",{type:"button",class:"btn-action btn-action-save",onClick:b,disabled:!w.value},"Save",8,$e)]),_:1},512))}},Q=(d,u)=>{d._noteTooltip=new pe(d,{title:u,placement:"top",container:"body",html:!1,trigger:"hover",customClass:"note-tooltip"})},G=d=>{d._noteTooltip?.dispose(),d._noteTooltip=null},Ae=d=>d._noteTooltip?.hide(),J={mounted(d,u){d.addEventListener("click",()=>Ae(d)),u.value&&Q(d,u.value)},updated(d,u){u.value!==u.oldValue&&(G(d),u.value&&Q(d,u.value))},unmounted(d){G(d)}},Re={class:"stats-info mb-4",id:"statsInfo"},Me={class:"stat-item"},Te={class:"stat-value"},De={class:"stat-item"},Ee={class:"stat-value"},Le={class:"stat-item"},Ve={class:"stat-value"},Se={class:"stat-item"},Ue={class:"stat-value"},Be={class:"d-flex justify-content-between align-items-center mb-3 flex-wrap gap-3"},Ke={class:"d-flex gap-3 align-items-center flex-wrap"},je={class:"input-group input-group-sm",style:{width:"250px"}},ze=["disabled","title"],Pe={class:"d-flex align-items-center"},Fe={class:"toggle-wrapper me-2"},Oe={class:"toggle-switch"},Ie={class:"card",id:"certificatesCard"},qe={class:"card-header d-flex justify-content-between align-items-center bg-transparent"},He={class:"status-badge status-valid me-1"},Ye={class:"status-badge status-expired"},Ze={class:"table-responsive"},Qe={class:"table table-hover mb-0"},Ge={key:0},Je={key:1},We={key:0,class:"section-divider"},Xe={colspan:"6"},et=["onClick","onKeydown"],tt={class:"fw-semibold",style:{color:"var(--text-heading)"}},st={key:0,class:"fas fa-note-sticky text-muted ms-1 small"},lt={class:"certificate-file text-muted small"},nt=["onClick"],at=["onClick"],ot={class:"section-divider"},it={colspan:"6"},rt=["onClick","onKeydown"],dt={class:"fw-semibold",style:{color:"var(--text-heading)"}},ut={key:0,class:"fas fa-note-sticky text-muted ms-1 small"},ct={class:"certificate-file text-muted small"},pt={class:"fw-semibold text-muted"},ft=["onClick","disabled"],bt={__name:"Certificates",setup(d){const{profilesApiClient:u}=de(),x=ue(),{status:m,refresh:y}=ie(),n=v(!0),f=v([]),w=v(""),_=v(!1),$=v(null),N=v(null),h=v(null),b=(l,t="success")=>x.show(l,t),a=l=>{if(!l)return"N/A";try{const t=new Date(l);return isNaN(t)?l:t.toLocaleDateString()+" "+t.toLocaleTimeString()}catch{return l}},o=l=>l==null?"":l<=0?"text-danger":l<=30?"text-warning":"text-success",A=g(()=>{let l=f.value;if(w.value){const t=w.value.toLowerCase();l=l.filter(s=>(s.username||"").toLowerCase().includes(t))}return l}),U=g(()=>{const l=[],t=[];return A.value.forEach(s=>{s.is_revoked||s.is_expired?t.push(s):l.push(s)}),l.sort((s,p)=>(s.days_remaining??9999)-(p.days_remaining??9999)),t.sort((s,p)=>(p.days_remaining??-9999)-(s.days_remaining??-9999)),{active:l,expired:t}}),R=g(()=>U.value.active),M=g(()=>U.value.expired),X=g(()=>f.value.length),ee=g(()=>R.value.filter(l=>l.days_remaining!==null&&l.days_remaining<=30).length),B=async()=>{n.value=!0;try{const l=await u.get("/profiles");f.value=l.data||[]}catch(l){console.error(l),b("Failed to load profiles","error")}finally{n.value=!1}},te=()=>{$.value.open()},se=async l=>{try{n.value=!0,await u.post("/profiles",{username:l}),b("Client created successfully.","success"),B()}catch(t){b(t.response?.data?.detail||t.message,"error")}finally{n.value=!1}},K=l=>{h.value.open(l)},le=async({id:l,note:t})=>{try{await u.put(`/profiles/${l}/note`,{note:t}),b("Note saved.","success"),B()}catch(s){b(s.response?.data?.detail||s.message,"error")}},ne=async l=>{if(l.id)try{const t=await u.get(`/profiles/${l.id}/download`,{responseType:"blob"}),s=t.headers["content-disposition"];let p=`${l.username}.ovpn`;if(s){const P=s.match(/filename="?([^"]+)"?/);P&&P[1]&&(p=P[1])}const Y=window.URL.createObjectURL(new Blob([t.data])),E=document.createElement("a");E.href=Y,E.setAttribute("download",p),document.body.appendChild(E),E.click(),document.body.removeChild(E),setTimeout(()=>window.URL.revokeObjectURL(Y),1e3)}catch(t){b("Could not download config: "+(t.response?.data?.detail||t.message),"error")}},H=l=>{l.is_revoked||N.value.open({title:"Revoke Certificate?",message:`Are you sure you want to revoke access for ${l.username}? This action cannot be undone.`,confirmText:"Yes, Revoke",confirmBtnClass:"btn-action-danger",data:l})},ae=async l=>{try{n.value=!0,await u.delete(`/profiles/${l.id}`),b(`${l.username} has been revoked.`,"success"),B()}catch(t){b(t.response?.data?.detail||t.message,"error")}finally{n.value=!1}};return oe(()=>{y(),B()}),(l,t)=>(r(),c(T,null,[e("div",Re,[e("div",Me,[e("div",Te,i(X.value),1),t[2]||(t[2]=e("div",{class:"stat-label"},"Total Certificates",-1))]),e("div",De,[e("div",Ee,i(R.value.length),1),t[3]||(t[3]=e("div",{class:"stat-label"},"Active Certificates",-1))]),e("div",Le,[e("div",Ve,i(ee.value),1),t[4]||(t[4]=e("div",{class:"stat-label"},"Expiring in 30 days",-1))]),e("div",Se,[e("div",Ue,i(M.value.length),1),t[5]||(t[5]=e("div",{class:"stat-label"},"Expired / Revoked",-1))])]),e("div",Be,[e("div",Ke,[e("div",je,[t[6]||(t[6]=e("span",{class:"input-group-text"},[e("i",{class:"fas fa-search"})],-1)),D(e("input",{type:"text",class:"form-control",placeholder:"Search by client name...","onUpdate:modelValue":t[0]||(t[0]=s=>w.value=s)},null,512),[[q,w.value]])]),e("button",{class:"btn-action btn-action-save btn-sm",onClick:te,disabled:!j(m).pki_ready,title:j(m).pki_ready?"":"Initialize PKI first"},[...t[7]||(t[7]=[e("i",{class:"fas fa-plus me-1"},null,-1),k(" New Client ",-1)])],8,ze)]),e("div",Pe,[e("div",Fe,[e("label",Oe,[D(e("input",{type:"checkbox",id:"hideExpired","onUpdate:modelValue":t[1]||(t[1]=s=>_.value=s)},null,512),[[re,_.value]]),t[8]||(t[8]=e("span",{class:"toggle-slider"},null,-1))])]),t[9]||(t[9]=e("label",{class:"user-select-none text-muted",for:"hideExpired",style:{cursor:"pointer"}},"Hide Expired/Revoked",-1))])]),e("div",Ie,[e("div",qe,[t[14]||(t[14]=e("span",null,[e("i",{class:"fas fa-certificate me-2"}),k("Certificates List")],-1)),e("div",null,[e("div",null,[e("span",He,[t[10]||(t[10]=e("i",{class:"fas fa-check-circle me-1"},null,-1)),e("span",null,i(R.value.length),1),t[11]||(t[11]=k(" Active ",-1))]),e("span",Ye,[t[12]||(t[12]=e("i",{class:"fas fa-times-circle me-1"},null,-1)),e("span",null,i(M.value.length),1),t[13]||(t[13]=k(" Revoked/Expired ",-1))])])])]),e("div",Ze,[e("table",Qe,[t[22]||(t[22]=e("thead",null,[e("tr",null,[e("th",null,"Client Name"),e("th",null,"Type"),e("th",null,"Validity Not After"),e("th",null,"Days Remaining"),e("th",null,"Status"),e("th",null,"Actions")])],-1)),e("tbody",null,[n.value?(r(),c("tr",Ge,[...t[15]||(t[15]=[e("td",{colspan:"6",class:"text-center py-4"},[e("div",{class:"spinner-border spinner-border-sm text-primary",role:"status"},[e("span",{class:"visually-hidden"},"Loading...")]),e("p",{class:"mt-2 mb-0"},"Loading profiles...")],-1)])])):R.value.length===0&&M.value.length===0?(r(),c("tr",Je,[...t[16]||(t[16]=[e("td",{colspan:"6",class:"empty-state text-center py-5"},[e("i",{class:"fas fa-certificate fa-2x mb-3 text-muted"}),e("p",{class:"text-muted"},"No certificates found")],-1)])])):(r(),c(T,{key:2},[R.value.length>0?(r(),c("tr",We,[e("td",Xe,"Active Certificates ("+i(R.value.length)+")",1)])):C("",!0),(r(!0),c(T,null,Z(R.value,s=>(r(),c("tr",{key:s.id+"_active",style:{cursor:"pointer"},tabindex:"0",onClick:p=>K(s),onKeydown:O(V(p=>K(s),["self"]),["enter"])},[D((r(),c("td",null,[e("div",tt,[k(i(s.username)+" ",1),s.note?(r(),c("i",st)):C("",!0)]),e("div",lt,i(s.file_path||"N/A"),1)])),[[j(J),s.note]]),t[19]||(t[19]=e("td",null,[e("span",{class:"status-badge status-client"},"Client")],-1)),e("td",null,i(a(s.expiration_date)),1),e("td",{class:z(["fw-semibold",o(s.days_remaining)])},i(s.days_remaining),3),e("td",null,[L(I,{profile:s},null,8,["profile"])]),e("td",null,[e("button",{class:"btn btn-sm btn-link text-warning p-0 me-2",title:"Download Config",onClick:V(p=>ne(s),["stop"])},[...t[17]||(t[17]=[e("i",{class:"fas fa-download"},null,-1)])],8,nt),e("button",{class:"btn btn-sm btn-link text-danger p-0",title:"Revoke",onClick:V(p=>H(s),["stop"])},[...t[18]||(t[18]=[e("i",{class:"fas fa-ban"},null,-1)])],8,at)])],40,et))),128)),!_.value&&M.value.length>0?(r(),c(T,{key:1},[e("tr",ot,[e("td",it,"Expired / Revoked ("+i(M.value.length)+")",1)]),(r(!0),c(T,null,Z(M.value,s=>(r(),c("tr",{key:s.id+"_expired",style:{cursor:"pointer"},tabindex:"0",onClick:p=>K(s),onKeydown:O(V(p=>K(s),["self"]),["enter"])},[D((r(),c("td",null,[e("div",dt,[k(i(s.username)+" ",1),s.note?(r(),c("i",ut)):C("",!0)]),e("div",ct,i(s.file_path||"N/A"),1)])),[[j(J),s.note]]),t[21]||(t[21]=e("td",null,[e("span",{class:"status-badge status-client"},"Client")],-1)),e("td",null,i(a(s.expiration_date)),1),e("td",pt,i(s.days_remaining),1),e("td",null,[L(I,{profile:s},null,8,["profile"])]),e("td",null,[e("button",{class:"btn btn-sm btn-link text-danger p-0",title:"Revoke",onClick:V(p=>H(s),["stop"]),disabled:s.is_revoked},[...t[20]||(t[20]=[e("i",{class:"fas fa-ban"},null,-1)])],8,ft)])],40,rt))),128))],64)):C("",!0)],64))])])])]),L(be,{ref_key:"newClientModal",ref:$,onCreate:se},null,512),L(ce,{ref_key:"confirmModal",ref:N,onConfirm:ae},null,512),L(Ne,{ref_key:"detailsModal",ref:h,onSave:le},null,512)],64))}};export{bt as default}; diff --git a/deploy/ui-dist/assets/Clients-B12ijQb2.js b/deploy/ui-dist/assets/Clients-B12ijQb2.js new file mode 100644 index 0000000..21afb71 --- /dev/null +++ b/deploy/ui-dist/assets/Clients-B12ijQb2.js @@ -0,0 +1 @@ +import{r as u,o as F,c as K,l as Q,k as r,e as t,t as n,w as V,g as k,v as J,h as q,d,m as U,T as O,j as G,p as H,b as W,q as X,f as _,s as g,x as Y,y as I,F as N,i as E,z as Z}from"./index-CH6sppUl.js";import{u as tt}from"./useFormatters-CKGG-YVI.js";import{u as st}from"./useTrafficChart-DniISzMl.js";import{M as et}from"./vendor-ui-Dumif2LN.js";import"./vendor-charts-Bcjh2pZL.js";const lt={class:"modal-dialog modal-xl modal-dialog-centered"},at={class:"modal-content"},ot={class:"modal-header"},nt={class:"modal-title"},it={class:"modal-body"},rt={class:"chart-controls"},dt={class:"d-flex align-items-center gap-2"},ut={class:"d-flex align-items-center gap-3 bg-white-custom px-3 py-1 border rounded"},ct={class:"d-flex align-items-center"},vt={class:"toggle-wrapper me-2"},mt={class:"toggle-switch"},pt={class:"text-main user-select-none",style:{cursor:"pointer"},for:"vizToggle"},_t={class:"modal-chart-container"},ft={key:0,class:"position-absolute top-50 start-50 translate-middle"},yt={__name:"HistoryModal",setup(c,{expose:f}){const{fetchClientHistory:h}=G(),M=u(null),R=u(null),A=u(""),m=u("24h"),x=u(!1),C=u(!1);let y=null,b=null,i=0;const D=st(R,{maxPoints:48}),$=w=>{A.value=w,m.value="24h",x.value=!1,y?.show(),S()},T=()=>{y?.hide()},S=async()=>{if(!A.value)return;const w=++i;C.value=!0;try{const a=await h(A.value,m.value);if(w!==i)return;a.success&&a.data.history?(b=a.data.history.map(v=>({timestamp:v.timestamp,bytes_received:v.bytes_received,bytes_sent:v.bytes_sent,rx_rate_mbps:v.bytes_received_rate_mbps,tx_rate_mbps:v.bytes_sent_rate_mbps})),B()):(b=[],D.destroy())}catch(a){w===i&&console.error(a)}finally{w===i&&(C.value=!1)}},B=()=>{b&&D.render(b,{range:m.value,speedMode:x.value})};return F(()=>{y=new et(M.value),M.value.addEventListener("hidden.bs.modal",()=>{i++,C.value=!1,b=null,D.destroy()})}),K(()=>{i++,y?.dispose()}),f({open:$,close:T}),(w,a)=>(r(),Q(O,{to:"body"},[t("div",{class:"modal fade",id:"historyModal",tabindex:"-1","aria-hidden":"true",ref_key:"modalRef",ref:M},[t("div",lt,[t("div",at,[t("div",ot,[t("h5",nt,[a[2]||(a[2]=t("i",{class:"fas fa-chart-area me-2 text-primary"},null,-1)),t("span",null,n(A.value),1)]),a[3]||(a[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),t("div",it,[t("div",rt,[t("div",dt,[a[5]||(a[5]=t("label",{class:"text-muted"},[t("i",{class:"far fa-clock me-1"}),k(" Range:")],-1)),V(t("select",{"onUpdate:modelValue":a[0]||(a[0]=v=>m.value=v),class:"form-select form-select-sm",style:{width:"auto","min-width":"200px"},onChange:S},[...a[4]||(a[4]=[t("option",{value:"1h"},"Last 1 Hour (30s agg)",-1),t("option",{value:"3h"},"Last 3 Hours (1m agg)",-1),t("option",{value:"24h"},"Last 24 Hours (15m agg)",-1),t("option",{value:"7d"},"Last 7 Days (1h agg)",-1),t("option",{value:"30d"},"Last 30 Days (6h agg)",-1)])],544),[[J,m.value]])]),t("div",ut,[a[7]||(a[7]=t("span",{class:"small fw-bold text-muted"},"Metric:",-1)),t("div",ct,[t("div",vt,[t("label",mt,[V(t("input",{type:"checkbox",id:"vizToggle","onUpdate:modelValue":a[1]||(a[1]=v=>x.value=v),onChange:B},null,544),[[q,x.value]]),a[6]||(a[6]=t("span",{class:"toggle-slider"},null,-1))])]),t("label",pt,n(x.value?"Speed (Mbps)":"Data Volume"),1)])])]),t("div",_t,[t("canvas",{ref_key:"chartCanvas",ref:R},null,512),C.value?(r(),d("div",ft,[...a[8]||(a[8]=[t("div",{class:"spinner-border text-primary",role:"status"},null,-1)])])):U("",!0)])])])])],512)]))}},j=c=>c.sessions_count>1?`×${c.sessions_count}`:null,bt=(c,f)=>c.includes(f)?c.filter(h=>h!==f):[...c,f],gt=(c,f)=>c.sessions_count>1&&f.includes(c.common_name)?c.sessions||[]:[],ht={class:"stats-info mb-4"},xt={class:"stat-item"},wt={class:"stat-value"},kt={class:"stat-item"},Ct={class:"stat-value"},$t={class:"stat-item"},St={class:"stat-value"},Mt={class:"stat-item"},At={class:"stat-value"},Dt={class:"d-flex justify-content-between align-items-center mb-3 flex-wrap gap-3"},Lt={class:"d-flex gap-3 align-items-center flex-wrap"},Nt={class:"sort-btn-group"},Tt={class:"input-group input-group-sm",style:{width:"250px"}},Bt={class:"d-flex align-items-center"},Rt={class:"toggle-wrapper me-2"},Ut={class:"toggle-switch"},Vt={class:"card"},Ht={class:"card-header d-flex justify-content-between align-items-center"},Et={class:"text-muted"},zt={class:"table-responsive"},It={class:"table table-hover mb-0"},jt={key:0,class:"fas fa-sort-down ms-1"},Ft={key:0,class:"fas fa-sort-down ms-1"},Kt={key:0},qt={key:1},Gt={class:"section-divider"},Pt={colspan:"8"},Qt=["onClick"],Jt={class:"small text-muted"},Ot=["aria-expanded","onClick"],Wt={class:"font-monospace small"},Xt={class:"font-monospace small"},Yt={class:"font-monospace small"},Zt={key:1,class:"text-muted opacity-25"},ts={class:"font-monospace small"},ss={key:1,class:"text-muted opacity-25"},es={class:"small text-muted"},ls={class:"small text-muted ps-4"},as={class:"small text-muted"},os={class:"small text-muted",colspan:"2"},ns={class:"font-monospace small"},is={class:"font-monospace small"},ms={__name:"Clients",setup(c){const{fetchStats:f}=G(),{formatBytes:h,formatRate:M,parseServerDate:R}=tt(),{config:A}=W(),m=u([]),x=u(!0),C=u("Updating..."),y=u(""),b=u(!1),i=u("sent"),D=u(null),$=u([]);let T=null;const S=H(()=>{let l=0,s=0,o=0,p=0;return m.value.forEach(e=>{l+=e.total_bytes_received||0,s+=e.total_bytes_sent||0,e.status==="Active"&&o++,p+=e.sessions_count||0}),{totalReceived:l,totalSent:s,activeClients:o,totalSessions:p}}),B=H(()=>m.value.filter(l=>!(b.value&&l.status!=="Active"||y.value&&!l.common_name.toLowerCase().includes(y.value.toLowerCase().trim()))).sort((l,s)=>{if(l.status==="Active"&&s.status!=="Active")return-1;if(l.status!=="Active"&&s.status==="Active")return 1;const o=i.value==="received"?l.total_bytes_received:l.total_bytes_sent;return(i.value==="received"?s.total_bytes_received:s.total_bytes_sent)-o})),w=H(()=>{const l=[];let s=null,o=null;return B.value.forEach(p=>{p.status!==s&&(s=p.status,o={status:p.status,items:[]},l.push(o)),o.items.push(p)}),l}),a=async()=>{try{const l=await f();l.success&&(m.value=l.data,C.value=new Date().toLocaleTimeString())}catch(l){console.error(l)}finally{x.value=!1}},v=l=>{if(!l||l==="N/A")return"N/A";const s=R(l);return isNaN(s)?l:s.toLocaleString()},P=l=>{D.value.open(l)};return F(()=>{a();const l=A.value?.refresh_interval||3e4;T=setInterval(a,l)}),K(()=>{T&&clearInterval(T)}),(l,s)=>(r(),d(N,null,[t("div",ht,[t("div",xt,[t("div",wt,n(_(h)(S.value.totalReceived)),1),s[8]||(s[8]=t("div",{class:"stat-label"},"Total Received",-1))]),t("div",kt,[t("div",Ct,n(_(h)(S.value.totalSent)),1),s[9]||(s[9]=t("div",{class:"stat-label"},"Total Sent",-1))]),t("div",$t,[t("div",St,n(S.value.activeClients),1),s[10]||(s[10]=t("div",{class:"stat-label"},"Active Clients",-1))]),t("div",Mt,[t("div",At,n(S.value.totalSessions),1),s[11]||(s[11]=t("div",{class:"stat-label"},"Active Sessions",-1))])]),t("div",Dt,[t("div",Lt,[t("div",Nt,[t("button",{class:g(["sort-btn",{active:i.value==="received"}]),onClick:s[0]||(s[0]=o=>i.value="received")},"Received",2),t("button",{class:g(["sort-btn",{active:i.value==="sent"}]),onClick:s[1]||(s[1]=o=>i.value="sent")},"Sent",2)]),t("div",Tt,[s[12]||(s[12]=t("span",{class:"input-group-text"},[t("i",{class:"fas fa-search"})],-1)),V(t("input",{type:"text",class:"form-control",placeholder:"Search client...","onUpdate:modelValue":s[2]||(s[2]=o=>y.value=o)},null,512),[[Y,y.value]])])]),t("div",Bt,[t("div",Rt,[t("label",Ut,[V(t("input",{type:"checkbox",id:"hideDisconnected","onUpdate:modelValue":s[3]||(s[3]=o=>b.value=o)},null,512),[[q,b.value]]),s[13]||(s[13]=t("span",{class:"toggle-slider"},null,-1))])]),s[14]||(s[14]=t("label",{class:"user-select-none text-muted",for:"hideDisconnected",style:{cursor:"pointer"}},"Hide Disconnected",-1))])]),t("div",Vt,[t("div",Ht,[s[15]||(s[15]=t("span",null,[t("i",{class:"fas fa-network-wired me-2"}),k("Clients List")],-1)),t("small",Et,"Updated: "+n(C.value),1)]),t("div",zt,[t("table",It,[t("thead",null,[t("tr",null,[s[18]||(s[18]=t("th",null,"Client Name",-1)),s[19]||(s[19]=t("th",null,"Real Address",-1)),s[20]||(s[20]=t("th",null,"Status",-1)),t("th",{onClick:s[4]||(s[4]=o=>i.value="received"),onKeydown:s[5]||(s[5]=I(o=>i.value="received",["enter"])),tabindex:"0",class:g(["cursor-pointer",{"active-sort":i.value==="received"}])},[s[16]||(s[16]=k(" Received ",-1)),i.value==="received"?(r(),d("i",jt)):U("",!0)],34),t("th",{onClick:s[6]||(s[6]=o=>i.value="sent"),onKeydown:s[7]||(s[7]=I(o=>i.value="sent",["enter"])),tabindex:"0",class:g(["cursor-pointer",{"active-sort":i.value==="sent"}])},[s[17]||(s[17]=k(" Sent ",-1)),i.value==="sent"?(r(),d("i",Ft)):U("",!0)],34),s[21]||(s[21]=t("th",null,"Down Speed",-1)),s[22]||(s[22]=t("th",null,"Up Speed",-1)),s[23]||(s[23]=t("th",null,"Last Activity",-1))])]),t("tbody",null,[x.value&&m.value.length===0?(r(),d("tr",Kt,[...s[24]||(s[24]=[t("td",{colspan:"8",class:"text-center py-4 text-muted"},"Loading...",-1)])])):B.value.length===0?(r(),d("tr",qt,[...s[25]||(s[25]=[t("td",{colspan:"8",class:"text-center py-4 text-muted"},"No clients match your filter",-1)])])):(r(!0),d(N,{key:2},E(w.value,(o,p)=>(r(),d(N,{key:p},[t("tr",Gt,[t("td",Pt,[t("i",{class:g(["fas me-2 small",o.status==="Active"?"fa-circle text-success":"fa-circle text-danger"])},null,2),k(" "+n(o.status)+" Clients ",1)])]),(r(!0),d(N,null,E(o.items,e=>(r(),d(N,{key:e.common_name},[t("tr",null,[t("td",null,[t("a",{href:"#",onClick:Z(L=>P(e.common_name),["prevent"]),class:"client-link"},[k(n(e.common_name)+" ",1),s[26]||(s[26]=t("i",{class:"fas fa-chart-area ms-1 small opacity-50"},null,-1))],8,Qt)]),t("td",Jt,n(e.sessions_count>1?`${e.sessions_count} devices`:e.real_address||"-"),1),t("td",null,[t("span",{class:g(["status-badge",e.status==="Active"?"status-active":"status-disconnected"])},n(e.status),3),_(j)(e)?(r(),d("button",{key:0,type:"button",class:"btn btn-sm btn-outline-secondary ms-2 py-0 px-1","aria-expanded":$.value.includes(e.common_name),title:"Show sessions",onClick:L=>$.value=_(bt)($.value,e.common_name)},[k(n(_(j)(e))+" ",1),t("i",{class:g(["fas ms-1 small",$.value.includes(e.common_name)?"fa-chevron-up":"fa-chevron-down"])},null,2)],8,Ot)):U("",!0)]),t("td",Wt,n(_(h)(e.total_bytes_received)),1),t("td",Xt,n(_(h)(e.total_bytes_sent)),1),t("td",Yt,[e.status==="Active"?(r(),d("span",{key:0,class:g(e.current_recv_rate_mbps>.01?"text-success fw-bold":"text-muted opacity-75")},n(e.current_recv_rate_mbps?_(M)(e.current_recv_rate_mbps):"0.000 Mbps"),3)):(r(),d("span",Zt,"-"))]),t("td",ts,[e.status==="Active"?(r(),d("span",{key:0,class:g(e.current_sent_rate_mbps>.01?"text-warning fw-bold":"text-muted opacity-75")},n(e.current_sent_rate_mbps?_(M)(e.current_sent_rate_mbps):"0.000 Mbps"),3)):(r(),d("span",ss,"-"))]),t("td",es,n(v(e.last_activity)),1)]),(r(!0),d(N,null,E(_(gt)(e,$.value),(L,z)=>(r(),d("tr",{key:`${e.common_name}-s${z}`,class:"session-row"},[t("td",ls,[s[27]||(s[27]=t("i",{class:"fas fa-level-up-alt fa-rotate-90 me-2 opacity-50"},null,-1)),k("Session "+n(z+1),1)]),t("td",as,n(L.real_address||"-"),1),t("td",os,"Since "+n(v(L.connected_since)),1),t("td",ns,"Down "+n(L.received_mb)+" MB",1),t("td",is,"Up "+n(L.sent_mb)+" MB",1),s[28]||(s[28]=t("td",{colspan:"2"},null,-1))]))),128))],64))),128))],64))),128))])])])]),X(yt,{ref_key:"historyModal",ref:D},null,512)],64))}};export{ms as default}; diff --git a/deploy/ui-dist/assets/Clients-B4FTmkE-.js b/deploy/ui-dist/assets/Clients-B4FTmkE-.js deleted file mode 100644 index e70bba9..0000000 --- a/deploy/ui-dist/assets/Clients-B4FTmkE-.js +++ /dev/null @@ -1 +0,0 @@ -import{r as u,o as z,c as E,l as K,k as i,e as t,t as r,w as T,g as $,v as q,h as I,d,m as V,T as G,j,p as U,b as P,q as Q,f as C,s as b,x as J,y as H,F as N,i as B,z as O}from"./index-BfAhXdi6.js";import{u as W}from"./useFormatters-CKGG-YVI.js";import{u as X}from"./useTrafficChart-69f2EcZB.js";import{M as Y}from"./vendor-ui-Dumif2LN.js";import"./vendor-charts-Bcjh2pZL.js";const Z={class:"modal-dialog modal-xl modal-dialog-centered"},tt={class:"modal-content"},et={class:"modal-header"},st={class:"modal-title"},lt={class:"modal-body"},at={class:"chart-controls"},ot={class:"d-flex align-items-center gap-2"},nt={class:"d-flex align-items-center gap-3 bg-white-custom px-3 py-1 border rounded"},it={class:"d-flex align-items-center"},rt={class:"toggle-wrapper me-2"},dt={class:"toggle-switch"},ut={class:"text-main user-select-none",style:{cursor:"pointer"},for:"vizToggle"},ct={class:"modal-chart-container"},vt={key:0,class:"position-absolute top-50 start-50 translate-middle"},mt={__name:"HistoryModal",setup(F,{expose:R}){const{fetchClientHistory:h}=j(),x=u(null),D=u(null),w=u(""),m=u("24h"),y=u(!1),g=u(!1);let p=null,f=null,o=0;const k=X(D,{maxPoints:48}),A=_=>{w.value=_,m.value="24h",y.value=!1,p?.show(),S()},M=()=>{p?.hide()},S=async()=>{if(!w.value)return;const _=++o;g.value=!0;try{const l=await h(w.value,m.value);if(_!==o)return;l.success&&l.data.history?(f=l.data.history.map(c=>({timestamp:c.timestamp,bytes_received:c.bytes_received,bytes_sent:c.bytes_sent,rx_rate_mbps:c.bytes_received_rate_mbps,tx_rate_mbps:c.bytes_sent_rate_mbps})),L()):(f=[],k.destroy())}catch(l){_===o&&console.error(l)}finally{_===o&&(g.value=!1)}},L=()=>{f&&k.render(f,{range:m.value,speedMode:y.value})};return z(()=>{p=new Y(x.value),x.value.addEventListener("hidden.bs.modal",()=>{o++,g.value=!1,f=null,k.destroy()})}),E(()=>{o++,p?.dispose()}),R({open:A,close:M}),(_,l)=>(i(),K(G,{to:"body"},[t("div",{class:"modal fade",id:"historyModal",tabindex:"-1","aria-hidden":"true",ref_key:"modalRef",ref:x},[t("div",Z,[t("div",tt,[t("div",et,[t("h5",st,[l[2]||(l[2]=t("i",{class:"fas fa-chart-area me-2 text-primary"},null,-1)),t("span",null,r(w.value),1)]),l[3]||(l[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),t("div",lt,[t("div",at,[t("div",ot,[l[5]||(l[5]=t("label",{class:"text-muted"},[t("i",{class:"far fa-clock me-1"}),$(" Range:")],-1)),T(t("select",{"onUpdate:modelValue":l[0]||(l[0]=c=>m.value=c),class:"form-select form-select-sm",style:{width:"auto","min-width":"200px"},onChange:S},[...l[4]||(l[4]=[t("option",{value:"1h"},"Last 1 Hour (30s agg)",-1),t("option",{value:"3h"},"Last 3 Hours (1m agg)",-1),t("option",{value:"24h"},"Last 24 Hours (15m agg)",-1),t("option",{value:"7d"},"Last 7 Days (1h agg)",-1),t("option",{value:"30d"},"Last 30 Days (6h agg)",-1)])],544),[[q,m.value]])]),t("div",nt,[l[7]||(l[7]=t("span",{class:"small fw-bold text-muted"},"Metric:",-1)),t("div",it,[t("div",rt,[t("label",dt,[T(t("input",{type:"checkbox",id:"vizToggle","onUpdate:modelValue":l[1]||(l[1]=c=>y.value=c),onChange:L},null,544),[[I,y.value]]),l[6]||(l[6]=t("span",{class:"toggle-slider"},null,-1))])]),t("label",ut,r(y.value?"Speed (Mbps)":"Data Volume"),1)])])]),t("div",ct,[t("canvas",{ref_key:"chartCanvas",ref:D},null,512),g.value?(i(),d("div",vt,[...l[8]||(l[8]=[t("div",{class:"spinner-border text-primary",role:"status"},null,-1)])])):V("",!0)])])])])],512)]))}},pt={class:"stats-info mb-4"},ft={class:"stat-item"},_t={class:"stat-value"},yt={class:"stat-item"},bt={class:"stat-value"},gt={class:"stat-item"},ht={class:"stat-value"},xt={class:"d-flex justify-content-between align-items-center mb-3 flex-wrap gap-3"},wt={class:"d-flex gap-3 align-items-center flex-wrap"},kt={class:"sort-btn-group"},Ct={class:"input-group input-group-sm",style:{width:"250px"}},$t={class:"d-flex align-items-center"},At={class:"toggle-wrapper me-2"},Mt={class:"toggle-switch"},St={class:"card"},Dt={class:"card-header d-flex justify-content-between align-items-center"},Lt={class:"text-muted"},Nt={class:"table-responsive"},Tt={class:"table table-hover mb-0"},Rt={key:0,class:"fas fa-sort-down ms-1"},Ut={key:0,class:"fas fa-sort-down ms-1"},Vt={key:0},Ht={key:1},Bt={class:"section-divider"},zt={colspan:"8"},Et=["onClick"],It={class:"small text-muted"},jt={class:"font-monospace small"},Ft={class:"font-monospace small"},Kt={class:"font-monospace small"},qt={key:1,class:"text-muted opacity-25"},Gt={class:"font-monospace small"},Pt={key:1,class:"text-muted opacity-25"},Qt={class:"small text-muted"},te={__name:"Clients",setup(F){const{fetchStats:R}=j(),{formatBytes:h,formatRate:x,parseServerDate:D}=W(),{config:w}=P(),m=u([]),y=u(!0),g=u("Updating..."),p=u(""),f=u(!1),o=u("sent"),k=u(null);let A=null;const M=U(()=>{let s=0,e=0,a=0;return m.value.forEach(v=>{s+=v.total_bytes_received||0,e+=v.total_bytes_sent||0,v.status==="Active"&&a++}),{totalReceived:s,totalSent:e,activeClients:a}}),S=U(()=>m.value.filter(s=>!(f.value&&s.status!=="Active"||p.value&&!s.common_name.toLowerCase().includes(p.value.toLowerCase().trim()))).sort((s,e)=>{if(s.status==="Active"&&e.status!=="Active")return-1;if(s.status!=="Active"&&e.status==="Active")return 1;const a=o.value==="received"?s.total_bytes_received:s.total_bytes_sent;return(o.value==="received"?e.total_bytes_received:e.total_bytes_sent)-a})),L=U(()=>{const s=[];let e=null,a=null;return S.value.forEach(v=>{v.status!==e&&(e=v.status,a={status:v.status,items:[]},s.push(a)),a.items.push(v)}),s}),_=async()=>{try{const s=await R();s.success&&(m.value=s.data,g.value=new Date().toLocaleTimeString())}catch(s){console.error(s)}finally{y.value=!1}},l=s=>{if(!s||s==="N/A")return"N/A";const e=D(s);return isNaN(e)?s:e.toLocaleString()},c=s=>{k.value.open(s)};return z(()=>{_();const s=w.value?.refresh_interval||3e4;A=setInterval(_,s)}),E(()=>{A&&clearInterval(A)}),(s,e)=>(i(),d(N,null,[t("div",pt,[t("div",ft,[t("div",_t,r(C(h)(M.value.totalReceived)),1),e[8]||(e[8]=t("div",{class:"stat-label"},"Total Received",-1))]),t("div",yt,[t("div",bt,r(C(h)(M.value.totalSent)),1),e[9]||(e[9]=t("div",{class:"stat-label"},"Total Sent",-1))]),t("div",gt,[t("div",ht,r(M.value.activeClients),1),e[10]||(e[10]=t("div",{class:"stat-label"},"Active Clients",-1))])]),t("div",xt,[t("div",wt,[t("div",kt,[t("button",{class:b(["sort-btn",{active:o.value==="received"}]),onClick:e[0]||(e[0]=a=>o.value="received")},"Received",2),t("button",{class:b(["sort-btn",{active:o.value==="sent"}]),onClick:e[1]||(e[1]=a=>o.value="sent")},"Sent",2)]),t("div",Ct,[e[11]||(e[11]=t("span",{class:"input-group-text"},[t("i",{class:"fas fa-search"})],-1)),T(t("input",{type:"text",class:"form-control",placeholder:"Search client...","onUpdate:modelValue":e[2]||(e[2]=a=>p.value=a)},null,512),[[J,p.value]])])]),t("div",$t,[t("div",At,[t("label",Mt,[T(t("input",{type:"checkbox",id:"hideDisconnected","onUpdate:modelValue":e[3]||(e[3]=a=>f.value=a)},null,512),[[I,f.value]]),e[12]||(e[12]=t("span",{class:"toggle-slider"},null,-1))])]),e[13]||(e[13]=t("label",{class:"user-select-none text-muted",for:"hideDisconnected",style:{cursor:"pointer"}},"Hide Disconnected",-1))])]),t("div",St,[t("div",Dt,[e[14]||(e[14]=t("span",null,[t("i",{class:"fas fa-network-wired me-2"}),$("Clients List")],-1)),t("small",Lt,"Updated: "+r(g.value),1)]),t("div",Nt,[t("table",Tt,[t("thead",null,[t("tr",null,[e[17]||(e[17]=t("th",null,"Client Name",-1)),e[18]||(e[18]=t("th",null,"Real Address",-1)),e[19]||(e[19]=t("th",null,"Status",-1)),t("th",{onClick:e[4]||(e[4]=a=>o.value="received"),onKeydown:e[5]||(e[5]=H(a=>o.value="received",["enter"])),tabindex:"0",class:b(["cursor-pointer",{"active-sort":o.value==="received"}])},[e[15]||(e[15]=$(" Received ",-1)),o.value==="received"?(i(),d("i",Rt)):V("",!0)],34),t("th",{onClick:e[6]||(e[6]=a=>o.value="sent"),onKeydown:e[7]||(e[7]=H(a=>o.value="sent",["enter"])),tabindex:"0",class:b(["cursor-pointer",{"active-sort":o.value==="sent"}])},[e[16]||(e[16]=$(" Sent ",-1)),o.value==="sent"?(i(),d("i",Ut)):V("",!0)],34),e[20]||(e[20]=t("th",null,"Down Speed",-1)),e[21]||(e[21]=t("th",null,"Up Speed",-1)),e[22]||(e[22]=t("th",null,"Last Activity",-1))])]),t("tbody",null,[y.value&&m.value.length===0?(i(),d("tr",Vt,[...e[23]||(e[23]=[t("td",{colspan:"8",class:"text-center py-4 text-muted"},"Loading...",-1)])])):S.value.length===0?(i(),d("tr",Ht,[...e[24]||(e[24]=[t("td",{colspan:"8",class:"text-center py-4 text-muted"},"No clients match your filter",-1)])])):(i(!0),d(N,{key:2},B(L.value,(a,v)=>(i(),d(N,{key:v},[t("tr",Bt,[t("td",zt,[t("i",{class:b(["fas me-2 small",a.status==="Active"?"fa-circle text-success":"fa-circle text-danger"])},null,2),$(" "+r(a.status)+" Clients ",1)])]),(i(!0),d(N,null,B(a.items,n=>(i(),d("tr",{key:n.common_name},[t("td",null,[t("a",{href:"#",onClick:O(Jt=>c(n.common_name),["prevent"]),class:"client-link"},[$(r(n.common_name)+" ",1),e[25]||(e[25]=t("i",{class:"fas fa-chart-area ms-1 small opacity-50"},null,-1))],8,Et)]),t("td",It,r(n.real_address||"-"),1),t("td",null,[t("span",{class:b(["status-badge",n.status==="Active"?"status-active":"status-disconnected"])},r(n.status),3)]),t("td",jt,r(C(h)(n.total_bytes_received)),1),t("td",Ft,r(C(h)(n.total_bytes_sent)),1),t("td",Kt,[n.status==="Active"?(i(),d("span",{key:0,class:b(n.current_recv_rate_mbps>.01?"text-success fw-bold":"text-muted opacity-75")},r(n.current_recv_rate_mbps?C(x)(n.current_recv_rate_mbps):"0.000 Mbps"),3)):(i(),d("span",qt,"-"))]),t("td",Gt,[n.status==="Active"?(i(),d("span",{key:0,class:b(n.current_sent_rate_mbps>.01?"text-warning fw-bold":"text-muted opacity-75")},r(n.current_sent_rate_mbps?C(x)(n.current_sent_rate_mbps):"0.000 Mbps"),3)):(i(),d("span",Pt,"-"))]),t("td",Qt,r(l(n.last_activity)),1)]))),128))],64))),128))])])])]),Q(mt,{ref_key:"historyModal",ref:k},null,512)],64))}};export{te as default}; diff --git a/deploy/ui-dist/assets/ConfirmModal-wSxjHDVn.js b/deploy/ui-dist/assets/ConfirmModal-XwuF5iM0.js similarity index 97% rename from deploy/ui-dist/assets/ConfirmModal-wSxjHDVn.js rename to deploy/ui-dist/assets/ConfirmModal-XwuF5iM0.js index f6dda98..fbb6c6d 100644 --- a/deploy/ui-dist/assets/ConfirmModal-wSxjHDVn.js +++ b/deploy/ui-dist/assets/ConfirmModal-XwuF5iM0.js @@ -1 +1 @@ -import{M as $}from"./vendor-ui-Dumif2LN.js";import{r as o,p as M,o as S,c as z,l as C,k as u,e,s as g,d as k,m as w,K as p,T,t as _,L as E,A as y}from"./index-BfAhXdi6.js";const L=["id"],A={class:"modal-content"},I={class:"modal-header border-0 pb-0"},N={class:"modal-title fw-bold",style:{color:"var(--text-heading)"}},R={class:"modal-body"},V={key:0,class:"modal-footer border-0 pt-0"},q={__name:"BaseModal",props:{id:{type:String,required:!0},title:{type:String,default:""},size:{type:String,default:""}},emits:["opened","closed"],setup(d,{expose:f,emit:v}){const b=d,i=v,t=o(null);let s=null;const c=M(()=>b.size||""),r=()=>{s?.show()},m=()=>{s?.hide()};return S(()=>{s=new $(t.value),t.value.addEventListener("shown.bs.modal",()=>{i("opened")}),t.value.addEventListener("hidden.bs.modal",()=>{i("closed")})}),z(()=>{s?.dispose()}),f({show:r,hide:m}),(a,l)=>(u(),C(T,{to:"body"},[e("div",{class:"modal fade",id:d.id,tabindex:"-1","aria-hidden":"true",ref_key:"modalRef",ref:t},[e("div",{class:g(["modal-dialog modal-dialog-centered",c.value])},[e("div",A,[e("div",I,[p(a.$slots,"header",{},()=>[e("h5",N,_(d.title),1)]),l[0]||(l[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",R,[p(a.$slots,"body")]),a.$slots.footer?(u(),k("div",V,[p(a.$slots,"footer")])):w("",!0)])],2)],8,L)]))}},D={class:"text-main",style:{"white-space":"pre-line"}},F={__name:"ConfirmModal",emits:["confirm"],setup(d,{expose:f,emit:v}){const b=`confirm-${E()}`,i=v,t=o(null),s=o(""),c=o(""),r=o("Confirm"),m=o("btn-action-danger"),a=o(!0),l=o(null),x=n=>{s.value=n.title||"Are you sure?",c.value=n.message||"",r.value=n.confirmText||"Confirm",m.value=n.confirmBtnClass||"btn-action-danger",a.value=n.showCancel!==!1,l.value=n.data||null,t.value.show()},h=()=>{t.value.hide()},B=()=>{i("confirm",l.value),h()};return f({open:x,close:h}),(n,K)=>(u(),C(q,{id:b,title:s.value,ref_key:"modal",ref:t},{body:y(()=>[e("p",D,_(c.value),1)]),footer:y(()=>[a.value?(u(),k("button",{key:0,type:"button",class:"btn-action btn-action-secondary",onClick:h},"Cancel")):w("",!0),e("button",{type:"button",class:g(["btn-action",m.value]),onClick:B},_(r.value),3)]),_:1},8,["title"]))}};export{q as _,F as a}; +import{M as $}from"./vendor-ui-Dumif2LN.js";import{r as o,p as M,o as S,c as z,l as C,k as u,e,s as g,d as k,m as w,K as p,T,t as _,L as E,A as y}from"./index-CH6sppUl.js";const L=["id"],A={class:"modal-content"},I={class:"modal-header border-0 pb-0"},N={class:"modal-title fw-bold",style:{color:"var(--text-heading)"}},R={class:"modal-body"},V={key:0,class:"modal-footer border-0 pt-0"},q={__name:"BaseModal",props:{id:{type:String,required:!0},title:{type:String,default:""},size:{type:String,default:""}},emits:["opened","closed"],setup(d,{expose:f,emit:v}){const b=d,i=v,t=o(null);let s=null;const c=M(()=>b.size||""),r=()=>{s?.show()},m=()=>{s?.hide()};return S(()=>{s=new $(t.value),t.value.addEventListener("shown.bs.modal",()=>{i("opened")}),t.value.addEventListener("hidden.bs.modal",()=>{i("closed")})}),z(()=>{s?.dispose()}),f({show:r,hide:m}),(a,l)=>(u(),C(T,{to:"body"},[e("div",{class:"modal fade",id:d.id,tabindex:"-1","aria-hidden":"true",ref_key:"modalRef",ref:t},[e("div",{class:g(["modal-dialog modal-dialog-centered",c.value])},[e("div",A,[e("div",I,[p(a.$slots,"header",{},()=>[e("h5",N,_(d.title),1)]),l[0]||(l[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",R,[p(a.$slots,"body")]),a.$slots.footer?(u(),k("div",V,[p(a.$slots,"footer")])):w("",!0)])],2)],8,L)]))}},D={class:"text-main",style:{"white-space":"pre-line"}},F={__name:"ConfirmModal",emits:["confirm"],setup(d,{expose:f,emit:v}){const b=`confirm-${E()}`,i=v,t=o(null),s=o(""),c=o(""),r=o("Confirm"),m=o("btn-action-danger"),a=o(!0),l=o(null),x=n=>{s.value=n.title||"Are you sure?",c.value=n.message||"",r.value=n.confirmText||"Confirm",m.value=n.confirmBtnClass||"btn-action-danger",a.value=n.showCancel!==!1,l.value=n.data||null,t.value.show()},h=()=>{t.value.hide()},B=()=>{i("confirm",l.value),h()};return f({open:x,close:h}),(n,K)=>(u(),C(q,{id:b,title:s.value,ref_key:"modal",ref:t},{body:y(()=>[e("p",D,_(c.value),1)]),footer:y(()=>[a.value?(u(),k("button",{key:0,type:"button",class:"btn-action btn-action-secondary",onClick:h},"Cancel")):w("",!0),e("button",{type:"button",class:g(["btn-action",m.value]),onClick:B},_(r.value),3)]),_:1},8,["title"]))}};export{q as _,F as a}; diff --git a/deploy/ui-dist/assets/PKIConfig-aTZFQ7nU.js b/deploy/ui-dist/assets/PKIConfig-WA_fcodw.js similarity index 98% rename from deploy/ui-dist/assets/PKIConfig-aTZFQ7nU.js rename to deploy/ui-dist/assets/PKIConfig-WA_fcodw.js index e94e17f..465fb43 100644 --- a/deploy/ui-dist/assets/PKIConfig-aTZFQ7nU.js +++ b/deploy/ui-dist/assets/PKIConfig-WA_fcodw.js @@ -1 +1 @@ -import{a as V,r as g,p as w,o as O,c as R,d as c,e,q as K,z as L,m as j,w as l,x as a,v as U,h as G,g as C,t as Y,j as F,C as Q,B as H,k as p}from"./index-BfAhXdi6.js";import{a as S}from"./ConfirmModal-wSxjHDVn.js";import"./vendor-ui-Dumif2LN.js";const X={class:"config-wrapper"},J={class:"config-card"},W={class:"config-row"},Z={class:"config-col"},h={class:"config-col"},ss={class:"config-row"},es={class:"config-col",style:{"max-width":"50%"}},ts={class:"select-container"},ns={class:"config-row"},is={class:"config-col"},ls={class:"config-col"},as={class:"config-row"},os={class:"config-col"},rs={class:"config-col"},us={class:"config-row"},ds={class:"config-col"},cs={class:"config-col"},ps={class:"config-row"},fs={class:"config-col"},ys={class:"select-container"},vs={class:"config-col"},gs={class:"number-input-container"},bs={class:"number-input-controls"},ms={class:"config-row"},_s={class:"config-col"},ws={class:"number-input-container"},Cs={class:"number-input-controls"},ks={class:"config-col"},xs={class:"number-input-container"},Is={class:"number-input-controls"},qs={class:"config-row"},Ps={class:"config-col"},zs={class:"number-input-container"},Vs={class:"number-input-controls"},Ks={class:"config-col"},Us={class:"toggle-wrapper"},Ss={class:"toggle-switch"},Es={class:"btn-action-group"},Ts=["disabled"],$s=["disabled","title"],As={key:0,class:"fas fa-spinner fa-spin"},Bs={key:1,class:"fas fa-play-circle"},Ms=["disabled"],Ns={key:0,class:"fas fa-spinner fa-spin"},Ds={key:1,class:"fas fa-trash-alt"},Os={key:0,class:"config-label"},Ys={__name:"PKIConfig",setup(Rs){const{profilesApiClient:f}=F(),E=Q(),{refresh:k}=H(),n=V({fqdn_ca:"",fqdn_server:"",easyrsa_dn:"cn_only",easyrsa_req_country:"",easyrsa_req_province:"",easyrsa_req_city:"",easyrsa_req_org:"",easyrsa_req_email:"",easyrsa_req_ou:"",easyrsa_key_size:2048,easyrsa_ca_expire:null,easyrsa_cert_expire:null,easyrsa_cert_renew:null,easyrsa_crl_days:null,easyrsa_batch:!0}),x=g(null),I=g(null),r=g(!1),u=g(""),o=V({state:"idle",step:null,initialized:!1,error:null}),b=w(()=>o.state==="running"||u.value==="init"),m=w(()=>r.value||b.value),T={"init-pki":"Initializing PKI...",ca:"Building CA...","server-cert":"Building server certificate...",dh:"Generating DH parameters (this can take several minutes)...","ta-key":"Generating TLS key...",crl:"Generating CRL..."},$=w(()=>T[o.step]||"Initializing PKI...");let y=null;const d=(i,s="success")=>E.show(i,s),A=async()=>{try{const s=(await f.get("/config",{params:{section:"pki"}})).data,t=s.pki?s.pki:s;Object.keys(t).forEach(_=>{Object.hasOwn(n,_)&&(n[_]=t[_])})}catch(i){console.error(i),d("Failed to load PKI config from Management API.","error")}},q=()=>{y&&(clearInterval(y),y=null)},P=()=>{y||(y=setInterval(()=>v(),3e3))},v=async(i=!1)=>{const s=o.state==="running";try{const t=await f.get("/system/init/status");Object.assign(o,t.data)}catch(t){console.error(t);return}if(o.state==="running"){P();return}q(),s&&k(),s&&o.state==="done"?d("PKI initialized successfully!","success"):(s||i)&&o.state==="error"&&d(`Error initializing: ${o.error}`,"error")},z=async()=>{r.value=!0,u.value="save";try{await f.put("/config/pki",n),d("Configuration saved successfully!","success")}catch(i){d(`Error saving: ${i.message}`,"error")}finally{r.value=!1,u.value=""}},B=()=>{x.value.open({title:"Initialize PKI?",message:"Are you sure you want to initialize the system? This will start the PKI initialization process.",confirmText:"Yes, initialize",confirmBtnClass:"btn-action-primary"})},M=async()=>{r.value=!0,u.value="init";try{await f.post("/system/init"),o.state="running",P()}catch(i){i.response&&i.response.status===409?await v():d(`Error initializing: ${i.response?.data?.detail||i.message}`,"error")}finally{r.value=!1,u.value=""}},N=()=>{I.value.open({title:"Clear PKI?",message:"Are you sure you want to CLEAR the PKI? This will delete all certificates and cannot be undone.",confirmText:"Yes, clear",confirmBtnClass:"btn-action-danger"})},D=async()=>{r.value=!0,u.value="clear";try{const s=(await f.delete("/system/pki")).data;d(s.message||"PKI cleared successfully!","warning"),await v(),k()}catch(i){d(`Error clearing PKI: ${i.response?.data?.detail||i.message}`,"error")}finally{r.value=!1,u.value=""}};return O(()=>{A(),v(!0)}),R(q),(i,s)=>(p(),c("div",X,[e("div",J,[s[58]||(s[58]=e("div",{class:"config-header"},[e("h1",null,"PKI Infrastructure Configuration")],-1)),e("form",{onSubmit:L(z,["prevent"])},[e("div",W,[e("div",Z,[s[23]||(s[23]=e("label",{class:"config-label"},"FQDN: CA Cert CN",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[0]||(s[0]=t=>n.fqdn_ca=t)},null,512),[[a,n.fqdn_ca]])]),e("div",h,[s[24]||(s[24]=e("label",{class:"config-label"},"FQDN: Server Cert CN",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[1]||(s[1]=t=>n.fqdn_server=t)},null,512),[[a,n.fqdn_server]])])]),s[55]||(s[55]=e("div",{class:"config-divider"},null,-1)),e("div",ss,[e("div",es,[s[27]||(s[27]=e("label",{class:"config-label"},"EASYRSA DN",-1)),e("div",ts,[l(e("select",{class:"config-select","onUpdate:modelValue":s[2]||(s[2]=t=>n.easyrsa_dn=t)},[...s[25]||(s[25]=[e("option",{value:"cn_only"},"CN_ONLY",-1),e("option",{value:"org"},"ORG",-1)])],512),[[U,n.easyrsa_dn]]),s[26]||(s[26]=e("div",{class:"select-arrow"},[e("i",{class:"fas fa-chevron-down"})],-1))])]),s[28]||(s[28]=e("div",{class:"config-col",style:{"max-width":"50%"}},null,-1))]),e("div",ns,[e("div",is,[s[29]||(s[29]=e("label",{class:"config-label"},"Country",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[3]||(s[3]=t=>n.easyrsa_req_country=t)},null,512),[[a,n.easyrsa_req_country]])]),e("div",ls,[s[30]||(s[30]=e("label",{class:"config-label"},"Province / State",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[4]||(s[4]=t=>n.easyrsa_req_province=t)},null,512),[[a,n.easyrsa_req_province]])])]),e("div",as,[e("div",os,[s[31]||(s[31]=e("label",{class:"config-label"},"City",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[5]||(s[5]=t=>n.easyrsa_req_city=t)},null,512),[[a,n.easyrsa_req_city]])]),e("div",rs,[s[32]||(s[32]=e("label",{class:"config-label"},"Organization",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[6]||(s[6]=t=>n.easyrsa_req_org=t)},null,512),[[a,n.easyrsa_req_org]])])]),e("div",us,[e("div",ds,[s[33]||(s[33]=e("label",{class:"config-label"},"E-mail",-1)),l(e("input",{type:"email",class:"config-input","onUpdate:modelValue":s[7]||(s[7]=t=>n.easyrsa_req_email=t)},null,512),[[a,n.easyrsa_req_email]])]),e("div",cs,[s[34]||(s[34]=e("label",{class:"config-label"},"Organization Unit",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[8]||(s[8]=t=>n.easyrsa_req_ou=t)},null,512),[[a,n.easyrsa_req_ou]])])]),s[56]||(s[56]=e("div",{class:"config-divider"},null,-1)),e("div",ps,[e("div",fs,[s[37]||(s[37]=e("label",{class:"config-label"},"Key Size Length (Bits)",-1)),e("div",ys,[l(e("select",{class:"config-select","onUpdate:modelValue":s[9]||(s[9]=t=>n.easyrsa_key_size=t)},[...s[35]||(s[35]=[e("option",{value:"2048"},"2048",-1),e("option",{value:"4096"},"4096",-1)])],512),[[U,n.easyrsa_key_size]]),s[36]||(s[36]=e("div",{class:"select-arrow"},[e("i",{class:"fas fa-chevron-down"})],-1))])]),e("div",vs,[s[40]||(s[40]=e("label",{class:"config-label"},"CA Expire (Days)",-1)),e("div",gs,[l(e("input",{type:"number",class:"config-input","onUpdate:modelValue":s[10]||(s[10]=t=>n.easyrsa_ca_expire=t)},null,512),[[a,n.easyrsa_ca_expire,void 0,{number:!0}]]),e("div",bs,[e("button",{type:"button",class:"number-input-btn",onClick:s[11]||(s[11]=t=>n.easyrsa_ca_expire++)},[...s[38]||(s[38]=[e("i",{class:"fas fa-chevron-up"},null,-1)])]),e("button",{type:"button",class:"number-input-btn",onClick:s[12]||(s[12]=t=>n.easyrsa_ca_expire--)},[...s[39]||(s[39]=[e("i",{class:"fas fa-chevron-down"},null,-1)])])])])])]),e("div",ms,[e("div",_s,[s[43]||(s[43]=e("label",{class:"config-label"},"Cert Expire (Days)",-1)),e("div",ws,[l(e("input",{type:"number",class:"config-input","onUpdate:modelValue":s[13]||(s[13]=t=>n.easyrsa_cert_expire=t)},null,512),[[a,n.easyrsa_cert_expire,void 0,{number:!0}]]),e("div",Cs,[e("button",{type:"button",class:"number-input-btn",onClick:s[14]||(s[14]=t=>n.easyrsa_cert_expire++)},[...s[41]||(s[41]=[e("i",{class:"fas fa-chevron-up"},null,-1)])]),e("button",{type:"button",class:"number-input-btn",onClick:s[15]||(s[15]=t=>n.easyrsa_cert_expire--)},[...s[42]||(s[42]=[e("i",{class:"fas fa-chevron-down"},null,-1)])])])])]),e("div",ks,[s[46]||(s[46]=e("label",{class:"config-label"},"Cert Renew (Days)",-1)),e("div",xs,[l(e("input",{type:"number",class:"config-input","onUpdate:modelValue":s[16]||(s[16]=t=>n.easyrsa_cert_renew=t)},null,512),[[a,n.easyrsa_cert_renew,void 0,{number:!0}]]),e("div",Is,[e("button",{type:"button",class:"number-input-btn",onClick:s[17]||(s[17]=t=>n.easyrsa_cert_renew++)},[...s[44]||(s[44]=[e("i",{class:"fas fa-chevron-up"},null,-1)])]),e("button",{type:"button",class:"number-input-btn",onClick:s[18]||(s[18]=t=>n.easyrsa_cert_renew--)},[...s[45]||(s[45]=[e("i",{class:"fas fa-chevron-down"},null,-1)])])])])])]),e("div",qs,[e("div",Ps,[s[49]||(s[49]=e("label",{class:"config-label"},"CRL Valid (Days)",-1)),e("div",zs,[l(e("input",{type:"number",class:"config-input","onUpdate:modelValue":s[19]||(s[19]=t=>n.easyrsa_crl_days=t)},null,512),[[a,n.easyrsa_crl_days,void 0,{number:!0}]]),e("div",Vs,[e("button",{type:"button",class:"number-input-btn",onClick:s[20]||(s[20]=t=>n.easyrsa_crl_days++)},[...s[47]||(s[47]=[e("i",{class:"fas fa-chevron-up"},null,-1)])]),e("button",{type:"button",class:"number-input-btn",onClick:s[21]||(s[21]=t=>n.easyrsa_crl_days--)},[...s[48]||(s[48]=[e("i",{class:"fas fa-chevron-down"},null,-1)])])])])]),e("div",Ks,[s[51]||(s[51]=e("label",{class:"config-label"},"Batch",-1)),e("div",Us,[e("label",Ss,[l(e("input",{type:"checkbox","onUpdate:modelValue":s[22]||(s[22]=t=>n.easyrsa_batch=t)},null,512),[[G,n.easyrsa_batch]]),s[50]||(s[50]=e("span",{class:"toggle-slider"},null,-1))])])])]),s[57]||(s[57]=e("div",{class:"config-divider"},null,-1)),e("div",Es,[e("button",{type:"button",class:"btn-action btn-action-save",onClick:z,disabled:m.value},[...s[52]||(s[52]=[e("i",{class:"fas fa-save"},null,-1),C(" Save PKI ",-1)])],8,Ts),e("button",{type:"button",class:"btn-action btn-action-primary",onClick:B,disabled:m.value||o.initialized,title:o.initialized?"PKI is already initialized. Use Clear PKI to start over":""},[b.value?(p(),c("i",As)):(p(),c("i",Bs)),s[53]||(s[53]=C(" Init PKI ",-1))],8,$s),e("button",{type:"button",class:"btn-action btn-action-danger",onClick:N,disabled:m.value},[r.value&&u.value==="clear"?(p(),c("i",Ns)):(p(),c("i",Ds)),s[54]||(s[54]=C(" Clear PKI ",-1))],8,Ms)]),b.value?(p(),c("div",Os,Y($.value),1)):j("",!0)],32)]),K(S,{ref_key:"initModal",ref:x,onConfirm:M},null,512),K(S,{ref_key:"clearModal",ref:I,onConfirm:D},null,512)]))}};export{Ys as default}; +import{a as V,r as g,p as w,o as O,c as R,d as c,e,q as K,z as L,m as j,w as l,x as a,v as U,h as G,g as C,t as Y,j as F,C as Q,B as H,k as p}from"./index-CH6sppUl.js";import{a as S}from"./ConfirmModal-XwuF5iM0.js";import"./vendor-ui-Dumif2LN.js";const X={class:"config-wrapper"},J={class:"config-card"},W={class:"config-row"},Z={class:"config-col"},h={class:"config-col"},ss={class:"config-row"},es={class:"config-col",style:{"max-width":"50%"}},ts={class:"select-container"},ns={class:"config-row"},is={class:"config-col"},ls={class:"config-col"},as={class:"config-row"},os={class:"config-col"},rs={class:"config-col"},us={class:"config-row"},ds={class:"config-col"},cs={class:"config-col"},ps={class:"config-row"},fs={class:"config-col"},ys={class:"select-container"},vs={class:"config-col"},gs={class:"number-input-container"},bs={class:"number-input-controls"},ms={class:"config-row"},_s={class:"config-col"},ws={class:"number-input-container"},Cs={class:"number-input-controls"},ks={class:"config-col"},xs={class:"number-input-container"},Is={class:"number-input-controls"},qs={class:"config-row"},Ps={class:"config-col"},zs={class:"number-input-container"},Vs={class:"number-input-controls"},Ks={class:"config-col"},Us={class:"toggle-wrapper"},Ss={class:"toggle-switch"},Es={class:"btn-action-group"},Ts=["disabled"],$s=["disabled","title"],As={key:0,class:"fas fa-spinner fa-spin"},Bs={key:1,class:"fas fa-play-circle"},Ms=["disabled"],Ns={key:0,class:"fas fa-spinner fa-spin"},Ds={key:1,class:"fas fa-trash-alt"},Os={key:0,class:"config-label"},Ys={__name:"PKIConfig",setup(Rs){const{profilesApiClient:f}=F(),E=Q(),{refresh:k}=H(),n=V({fqdn_ca:"",fqdn_server:"",easyrsa_dn:"cn_only",easyrsa_req_country:"",easyrsa_req_province:"",easyrsa_req_city:"",easyrsa_req_org:"",easyrsa_req_email:"",easyrsa_req_ou:"",easyrsa_key_size:2048,easyrsa_ca_expire:null,easyrsa_cert_expire:null,easyrsa_cert_renew:null,easyrsa_crl_days:null,easyrsa_batch:!0}),x=g(null),I=g(null),r=g(!1),u=g(""),o=V({state:"idle",step:null,initialized:!1,error:null}),b=w(()=>o.state==="running"||u.value==="init"),m=w(()=>r.value||b.value),T={"init-pki":"Initializing PKI...",ca:"Building CA...","server-cert":"Building server certificate...",dh:"Generating DH parameters (this can take several minutes)...","ta-key":"Generating TLS key...",crl:"Generating CRL..."},$=w(()=>T[o.step]||"Initializing PKI...");let y=null;const d=(i,s="success")=>E.show(i,s),A=async()=>{try{const s=(await f.get("/config",{params:{section:"pki"}})).data,t=s.pki?s.pki:s;Object.keys(t).forEach(_=>{Object.hasOwn(n,_)&&(n[_]=t[_])})}catch(i){console.error(i),d("Failed to load PKI config from Management API.","error")}},q=()=>{y&&(clearInterval(y),y=null)},P=()=>{y||(y=setInterval(()=>v(),3e3))},v=async(i=!1)=>{const s=o.state==="running";try{const t=await f.get("/system/init/status");Object.assign(o,t.data)}catch(t){console.error(t);return}if(o.state==="running"){P();return}q(),s&&k(),s&&o.state==="done"?d("PKI initialized successfully!","success"):(s||i)&&o.state==="error"&&d(`Error initializing: ${o.error}`,"error")},z=async()=>{r.value=!0,u.value="save";try{await f.put("/config/pki",n),d("Configuration saved successfully!","success")}catch(i){d(`Error saving: ${i.message}`,"error")}finally{r.value=!1,u.value=""}},B=()=>{x.value.open({title:"Initialize PKI?",message:"Are you sure you want to initialize the system? This will start the PKI initialization process.",confirmText:"Yes, initialize",confirmBtnClass:"btn-action-primary"})},M=async()=>{r.value=!0,u.value="init";try{await f.post("/system/init"),o.state="running",P()}catch(i){i.response&&i.response.status===409?await v():d(`Error initializing: ${i.response?.data?.detail||i.message}`,"error")}finally{r.value=!1,u.value=""}},N=()=>{I.value.open({title:"Clear PKI?",message:"Are you sure you want to CLEAR the PKI? This will delete all certificates and cannot be undone.",confirmText:"Yes, clear",confirmBtnClass:"btn-action-danger"})},D=async()=>{r.value=!0,u.value="clear";try{const s=(await f.delete("/system/pki")).data;d(s.message||"PKI cleared successfully!","warning"),await v(),k()}catch(i){d(`Error clearing PKI: ${i.response?.data?.detail||i.message}`,"error")}finally{r.value=!1,u.value=""}};return O(()=>{A(),v(!0)}),R(q),(i,s)=>(p(),c("div",X,[e("div",J,[s[58]||(s[58]=e("div",{class:"config-header"},[e("h1",null,"PKI Infrastructure Configuration")],-1)),e("form",{onSubmit:L(z,["prevent"])},[e("div",W,[e("div",Z,[s[23]||(s[23]=e("label",{class:"config-label"},"FQDN: CA Cert CN",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[0]||(s[0]=t=>n.fqdn_ca=t)},null,512),[[a,n.fqdn_ca]])]),e("div",h,[s[24]||(s[24]=e("label",{class:"config-label"},"FQDN: Server Cert CN",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[1]||(s[1]=t=>n.fqdn_server=t)},null,512),[[a,n.fqdn_server]])])]),s[55]||(s[55]=e("div",{class:"config-divider"},null,-1)),e("div",ss,[e("div",es,[s[27]||(s[27]=e("label",{class:"config-label"},"EASYRSA DN",-1)),e("div",ts,[l(e("select",{class:"config-select","onUpdate:modelValue":s[2]||(s[2]=t=>n.easyrsa_dn=t)},[...s[25]||(s[25]=[e("option",{value:"cn_only"},"CN_ONLY",-1),e("option",{value:"org"},"ORG",-1)])],512),[[U,n.easyrsa_dn]]),s[26]||(s[26]=e("div",{class:"select-arrow"},[e("i",{class:"fas fa-chevron-down"})],-1))])]),s[28]||(s[28]=e("div",{class:"config-col",style:{"max-width":"50%"}},null,-1))]),e("div",ns,[e("div",is,[s[29]||(s[29]=e("label",{class:"config-label"},"Country",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[3]||(s[3]=t=>n.easyrsa_req_country=t)},null,512),[[a,n.easyrsa_req_country]])]),e("div",ls,[s[30]||(s[30]=e("label",{class:"config-label"},"Province / State",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[4]||(s[4]=t=>n.easyrsa_req_province=t)},null,512),[[a,n.easyrsa_req_province]])])]),e("div",as,[e("div",os,[s[31]||(s[31]=e("label",{class:"config-label"},"City",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[5]||(s[5]=t=>n.easyrsa_req_city=t)},null,512),[[a,n.easyrsa_req_city]])]),e("div",rs,[s[32]||(s[32]=e("label",{class:"config-label"},"Organization",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[6]||(s[6]=t=>n.easyrsa_req_org=t)},null,512),[[a,n.easyrsa_req_org]])])]),e("div",us,[e("div",ds,[s[33]||(s[33]=e("label",{class:"config-label"},"E-mail",-1)),l(e("input",{type:"email",class:"config-input","onUpdate:modelValue":s[7]||(s[7]=t=>n.easyrsa_req_email=t)},null,512),[[a,n.easyrsa_req_email]])]),e("div",cs,[s[34]||(s[34]=e("label",{class:"config-label"},"Organization Unit",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[8]||(s[8]=t=>n.easyrsa_req_ou=t)},null,512),[[a,n.easyrsa_req_ou]])])]),s[56]||(s[56]=e("div",{class:"config-divider"},null,-1)),e("div",ps,[e("div",fs,[s[37]||(s[37]=e("label",{class:"config-label"},"Key Size Length (Bits)",-1)),e("div",ys,[l(e("select",{class:"config-select","onUpdate:modelValue":s[9]||(s[9]=t=>n.easyrsa_key_size=t)},[...s[35]||(s[35]=[e("option",{value:"2048"},"2048",-1),e("option",{value:"4096"},"4096",-1)])],512),[[U,n.easyrsa_key_size]]),s[36]||(s[36]=e("div",{class:"select-arrow"},[e("i",{class:"fas fa-chevron-down"})],-1))])]),e("div",vs,[s[40]||(s[40]=e("label",{class:"config-label"},"CA Expire (Days)",-1)),e("div",gs,[l(e("input",{type:"number",class:"config-input","onUpdate:modelValue":s[10]||(s[10]=t=>n.easyrsa_ca_expire=t)},null,512),[[a,n.easyrsa_ca_expire,void 0,{number:!0}]]),e("div",bs,[e("button",{type:"button",class:"number-input-btn",onClick:s[11]||(s[11]=t=>n.easyrsa_ca_expire++)},[...s[38]||(s[38]=[e("i",{class:"fas fa-chevron-up"},null,-1)])]),e("button",{type:"button",class:"number-input-btn",onClick:s[12]||(s[12]=t=>n.easyrsa_ca_expire--)},[...s[39]||(s[39]=[e("i",{class:"fas fa-chevron-down"},null,-1)])])])])])]),e("div",ms,[e("div",_s,[s[43]||(s[43]=e("label",{class:"config-label"},"Cert Expire (Days)",-1)),e("div",ws,[l(e("input",{type:"number",class:"config-input","onUpdate:modelValue":s[13]||(s[13]=t=>n.easyrsa_cert_expire=t)},null,512),[[a,n.easyrsa_cert_expire,void 0,{number:!0}]]),e("div",Cs,[e("button",{type:"button",class:"number-input-btn",onClick:s[14]||(s[14]=t=>n.easyrsa_cert_expire++)},[...s[41]||(s[41]=[e("i",{class:"fas fa-chevron-up"},null,-1)])]),e("button",{type:"button",class:"number-input-btn",onClick:s[15]||(s[15]=t=>n.easyrsa_cert_expire--)},[...s[42]||(s[42]=[e("i",{class:"fas fa-chevron-down"},null,-1)])])])])]),e("div",ks,[s[46]||(s[46]=e("label",{class:"config-label"},"Cert Renew (Days)",-1)),e("div",xs,[l(e("input",{type:"number",class:"config-input","onUpdate:modelValue":s[16]||(s[16]=t=>n.easyrsa_cert_renew=t)},null,512),[[a,n.easyrsa_cert_renew,void 0,{number:!0}]]),e("div",Is,[e("button",{type:"button",class:"number-input-btn",onClick:s[17]||(s[17]=t=>n.easyrsa_cert_renew++)},[...s[44]||(s[44]=[e("i",{class:"fas fa-chevron-up"},null,-1)])]),e("button",{type:"button",class:"number-input-btn",onClick:s[18]||(s[18]=t=>n.easyrsa_cert_renew--)},[...s[45]||(s[45]=[e("i",{class:"fas fa-chevron-down"},null,-1)])])])])])]),e("div",qs,[e("div",Ps,[s[49]||(s[49]=e("label",{class:"config-label"},"CRL Valid (Days)",-1)),e("div",zs,[l(e("input",{type:"number",class:"config-input","onUpdate:modelValue":s[19]||(s[19]=t=>n.easyrsa_crl_days=t)},null,512),[[a,n.easyrsa_crl_days,void 0,{number:!0}]]),e("div",Vs,[e("button",{type:"button",class:"number-input-btn",onClick:s[20]||(s[20]=t=>n.easyrsa_crl_days++)},[...s[47]||(s[47]=[e("i",{class:"fas fa-chevron-up"},null,-1)])]),e("button",{type:"button",class:"number-input-btn",onClick:s[21]||(s[21]=t=>n.easyrsa_crl_days--)},[...s[48]||(s[48]=[e("i",{class:"fas fa-chevron-down"},null,-1)])])])])]),e("div",Ks,[s[51]||(s[51]=e("label",{class:"config-label"},"Batch",-1)),e("div",Us,[e("label",Ss,[l(e("input",{type:"checkbox","onUpdate:modelValue":s[22]||(s[22]=t=>n.easyrsa_batch=t)},null,512),[[G,n.easyrsa_batch]]),s[50]||(s[50]=e("span",{class:"toggle-slider"},null,-1))])])])]),s[57]||(s[57]=e("div",{class:"config-divider"},null,-1)),e("div",Es,[e("button",{type:"button",class:"btn-action btn-action-save",onClick:z,disabled:m.value},[...s[52]||(s[52]=[e("i",{class:"fas fa-save"},null,-1),C(" Save PKI ",-1)])],8,Ts),e("button",{type:"button",class:"btn-action btn-action-primary",onClick:B,disabled:m.value||o.initialized,title:o.initialized?"PKI is already initialized. Use Clear PKI to start over":""},[b.value?(p(),c("i",As)):(p(),c("i",Bs)),s[53]||(s[53]=C(" Init PKI ",-1))],8,$s),e("button",{type:"button",class:"btn-action btn-action-danger",onClick:N,disabled:m.value},[r.value&&u.value==="clear"?(p(),c("i",Ns)):(p(),c("i",Ds)),s[54]||(s[54]=C(" Clear PKI ",-1))],8,Ms)]),b.value?(p(),c("div",Os,Y($.value),1)):j("",!0)],32)]),K(S,{ref_key:"initModal",ref:x,onConfirm:M},null,512),K(S,{ref_key:"clearModal",ref:I,onConfirm:D},null,512)]))}};export{Ys as default}; diff --git a/deploy/ui-dist/assets/ServerManagement-BrgZCXB4.js b/deploy/ui-dist/assets/ServerManagement-Bi2HPYWE.js similarity index 96% rename from deploy/ui-dist/assets/ServerManagement-BrgZCXB4.js rename to deploy/ui-dist/assets/ServerManagement-Bi2HPYWE.js index e0b4692..fee7a9b 100644 --- a/deploy/ui-dist/assets/ServerManagement-BrgZCXB4.js +++ b/deploy/ui-dist/assets/ServerManagement-Bi2HPYWE.js @@ -1 +1 @@ -import{p as w,B as M,a as x,r as f,o as A,c as I,d as o,e as t,q as N,t as c,n as P,s as U,f as h,g as _,j as B,k as i,C as j}from"./index-BfAhXdi6.js";import{a as T}from"./ConfirmModal-wSxjHDVn.js";import"./vendor-ui-Dumif2LN.js";const V={class:"config-wrapper"},z={class:"config-card"},F={class:"stats-grid mb-4"},O={class:"stat-item full-width cpu-progress"},R={class:"stat-label d-flex justify-content-between"},D={class:"progress"},E=["aria-valuenow"],L={class:"stat-item"},q={class:"d-flex align-items-center"},H={class:"stat-item"},K={class:"stat-value"},Y={class:"stat-item"},G={class:"stat-value"},J={class:"stat-item"},Q={class:"stat-value monospace"},W={class:"btn-action-group justify-content-center"},X=["disabled","title"],Z={key:0,class:"fas fa-spinner fa-spin"},ss={key:1,class:"fas fa-play"},ts=["disabled","title"],es={key:0,class:"fas fa-spinner fa-spin"},as={key:1,class:"fas fa-sync-alt"},ns=["disabled"],os={key:0,class:"fas fa-spinner fa-spin"},is={key:1,class:"fas fa-stop"},ds={__name:"ServerManagement",setup(rs){const{profilesApiClient:b}=B(),S=j(),{status:r,refresh:k}=M(),m=w(()=>r.server_ready?"":r.pki_ready&&r.missing.length?`Missing server files: ${r.missing.join(", ")}`:"Initialize PKI first"),a=x({status:"unknown",pid:null,cpu_percent:0,memory_mb:0,uptime:null}),g=f(null),n=f(!1),l=f("");let d=null;const y=(e,s="success")=>S.show(e,s),p=async()=>{try{const e=await b.get("/server/process/stats");Object.assign(a,e.data)}catch(e){console.error("Failed to fetch stats:",e)}},C={start:"btn-action-primary",restart:"btn-action-save",stop:"btn-action-danger"},v=e=>{g.value.open({title:`${e.charAt(0).toUpperCase()}${e.slice(1)} the service?`,message:`Are you sure you want to ${e.toUpperCase()} the OpenVPN service?`,confirmText:`Yes, ${e}`,confirmBtnClass:C[e],data:e})},$=async e=>{n.value=!0,l.value=e;try{const s=await b.post(`/server/process/${e}`);y(s.data.message||`Service ${e} successful`,"success"),setTimeout(p,1e3)}catch(s){const u=s.response?.data?.detail||s.message;y(`Failed to ${e}: ${u}`,"error")}finally{n.value=!1,l.value=""}};return A(()=>{k(),p(),d=setInterval(p,5e3)}),I(()=>{d&&clearInterval(d)}),(e,s)=>(i(),o("div",V,[t("div",z,[s[11]||(s[11]=t("div",{class:"config-header"},[t("h1",null,"Server Process Management")],-1)),t("div",F,[t("div",O,[t("label",R,[s[3]||(s[3]=t("span",null,"CPU Usage",-1)),t("span",null,c(a.cpu_percent)+"%",1)]),t("div",D,[t("div",{class:"progress-bar progress-bar-brand",role:"progressbar",style:P({width:Math.min(a.cpu_percent,100)+"%"}),"aria-valuenow":a.cpu_percent,"aria-valuemin":"0","aria-valuemax":"100"},null,12,E)])]),t("div",L,[s[4]||(s[4]=t("label",{class:"stat-label"},"Status",-1)),t("div",q,[t("span",{class:U(["status-badge","status-"+(a.status==="running"?"active":"revoked")])},c(a.status.toUpperCase()),3)])]),t("div",H,[s[5]||(s[5]=t("label",{class:"stat-label"},"Process ID",-1)),t("div",K,c(a.pid||"N/A"),1)]),t("div",Y,[s[6]||(s[6]=t("label",{class:"stat-label"},"Memory (RSS)",-1)),t("div",G,c(a.memory_mb)+" MB",1)]),t("div",J,[s[7]||(s[7]=t("label",{class:"stat-label"},"Uptime",-1)),t("div",Q,c(a.uptime||"N/A"),1)])]),t("div",W,[t("button",{type:"button",class:"btn-action btn-action-primary",onClick:s[0]||(s[0]=u=>v("start")),disabled:n.value||a.status==="running"||!h(r).server_ready,title:m.value},[n.value&&l.value==="start"?(i(),o("i",Z)):(i(),o("i",ss)),s[8]||(s[8]=_(" Start Service ",-1))],8,X),t("button",{type:"button",class:"btn-action btn-action-save",onClick:s[1]||(s[1]=u=>v("restart")),disabled:n.value||!h(r).server_ready,title:m.value},[n.value&&l.value==="restart"?(i(),o("i",es)):(i(),o("i",as)),s[9]||(s[9]=_(" Restart Service ",-1))],8,ts),t("button",{type:"button",class:"btn-action btn-action-danger",onClick:s[2]||(s[2]=u=>v("stop")),disabled:n.value||a.status!=="running"},[n.value&&l.value==="stop"?(i(),o("i",os)):(i(),o("i",is)),s[10]||(s[10]=_(" Stop Service ",-1))],8,ns)])]),N(T,{ref_key:"confirmModal",ref:g,onConfirm:$},null,512)]))}};export{ds as default}; +import{p as w,B as M,a as x,r as f,o as A,c as I,d as o,e as t,q as N,t as c,n as P,s as U,f as h,g as _,j as B,k as i,C as j}from"./index-CH6sppUl.js";import{a as T}from"./ConfirmModal-XwuF5iM0.js";import"./vendor-ui-Dumif2LN.js";const V={class:"config-wrapper"},z={class:"config-card"},F={class:"stats-grid mb-4"},O={class:"stat-item full-width cpu-progress"},R={class:"stat-label d-flex justify-content-between"},D={class:"progress"},E=["aria-valuenow"],L={class:"stat-item"},q={class:"d-flex align-items-center"},H={class:"stat-item"},K={class:"stat-value"},Y={class:"stat-item"},G={class:"stat-value"},J={class:"stat-item"},Q={class:"stat-value monospace"},W={class:"btn-action-group justify-content-center"},X=["disabled","title"],Z={key:0,class:"fas fa-spinner fa-spin"},ss={key:1,class:"fas fa-play"},ts=["disabled","title"],es={key:0,class:"fas fa-spinner fa-spin"},as={key:1,class:"fas fa-sync-alt"},ns=["disabled"],os={key:0,class:"fas fa-spinner fa-spin"},is={key:1,class:"fas fa-stop"},ds={__name:"ServerManagement",setup(rs){const{profilesApiClient:b}=B(),S=j(),{status:r,refresh:k}=M(),m=w(()=>r.server_ready?"":r.pki_ready&&r.missing.length?`Missing server files: ${r.missing.join(", ")}`:"Initialize PKI first"),a=x({status:"unknown",pid:null,cpu_percent:0,memory_mb:0,uptime:null}),g=f(null),n=f(!1),l=f("");let d=null;const y=(e,s="success")=>S.show(e,s),p=async()=>{try{const e=await b.get("/server/process/stats");Object.assign(a,e.data)}catch(e){console.error("Failed to fetch stats:",e)}},C={start:"btn-action-primary",restart:"btn-action-save",stop:"btn-action-danger"},v=e=>{g.value.open({title:`${e.charAt(0).toUpperCase()}${e.slice(1)} the service?`,message:`Are you sure you want to ${e.toUpperCase()} the OpenVPN service?`,confirmText:`Yes, ${e}`,confirmBtnClass:C[e],data:e})},$=async e=>{n.value=!0,l.value=e;try{const s=await b.post(`/server/process/${e}`);y(s.data.message||`Service ${e} successful`,"success"),setTimeout(p,1e3)}catch(s){const u=s.response?.data?.detail||s.message;y(`Failed to ${e}: ${u}`,"error")}finally{n.value=!1,l.value=""}};return A(()=>{k(),p(),d=setInterval(p,5e3)}),I(()=>{d&&clearInterval(d)}),(e,s)=>(i(),o("div",V,[t("div",z,[s[11]||(s[11]=t("div",{class:"config-header"},[t("h1",null,"Server Process Management")],-1)),t("div",F,[t("div",O,[t("label",R,[s[3]||(s[3]=t("span",null,"CPU Usage",-1)),t("span",null,c(a.cpu_percent)+"%",1)]),t("div",D,[t("div",{class:"progress-bar progress-bar-brand",role:"progressbar",style:P({width:Math.min(a.cpu_percent,100)+"%"}),"aria-valuenow":a.cpu_percent,"aria-valuemin":"0","aria-valuemax":"100"},null,12,E)])]),t("div",L,[s[4]||(s[4]=t("label",{class:"stat-label"},"Status",-1)),t("div",q,[t("span",{class:U(["status-badge","status-"+(a.status==="running"?"active":"revoked")])},c(a.status.toUpperCase()),3)])]),t("div",H,[s[5]||(s[5]=t("label",{class:"stat-label"},"Process ID",-1)),t("div",K,c(a.pid||"N/A"),1)]),t("div",Y,[s[6]||(s[6]=t("label",{class:"stat-label"},"Memory (RSS)",-1)),t("div",G,c(a.memory_mb)+" MB",1)]),t("div",J,[s[7]||(s[7]=t("label",{class:"stat-label"},"Uptime",-1)),t("div",Q,c(a.uptime||"N/A"),1)])]),t("div",W,[t("button",{type:"button",class:"btn-action btn-action-primary",onClick:s[0]||(s[0]=u=>v("start")),disabled:n.value||a.status==="running"||!h(r).server_ready,title:m.value},[n.value&&l.value==="start"?(i(),o("i",Z)):(i(),o("i",ss)),s[8]||(s[8]=_(" Start Service ",-1))],8,X),t("button",{type:"button",class:"btn-action btn-action-save",onClick:s[1]||(s[1]=u=>v("restart")),disabled:n.value||!h(r).server_ready,title:m.value},[n.value&&l.value==="restart"?(i(),o("i",es)):(i(),o("i",as)),s[9]||(s[9]=_(" Restart Service ",-1))],8,ts),t("button",{type:"button",class:"btn-action btn-action-danger",onClick:s[2]||(s[2]=u=>v("stop")),disabled:n.value||a.status!=="running"},[n.value&&l.value==="stop"?(i(),o("i",os)):(i(),o("i",is)),s[10]||(s[10]=_(" Stop Service ",-1))],8,ns)])]),N(T,{ref_key:"confirmModal",ref:g,onConfirm:$},null,512)]))}};export{ds as default}; diff --git a/deploy/ui-dist/assets/VPNConfig-BwEwKZqY.js b/deploy/ui-dist/assets/VPNConfig-C-1CcRiV.js similarity index 99% rename from deploy/ui-dist/assets/VPNConfig-BwEwKZqY.js rename to deploy/ui-dist/assets/VPNConfig-C-1CcRiV.js index 1079085..d5b210a 100644 --- a/deploy/ui-dist/assets/VPNConfig-BwEwKZqY.js +++ b/deploy/ui-dist/assets/VPNConfig-C-1CcRiV.js @@ -1 +1 @@ -import{a as A,r as V,D as E,o as R,B as j,d as a,f as B,e as t,q as O,g as k,A as z,E as K,m as x,w as i,v as q,x as p,h as b,F as U,i as F,z as G,j as X,C as H,k as r}from"./index-BfAhXdi6.js";const P=/^(25[0-5]|2[0-4]\d|1?\d?\d)(\.(25[0-5]|2[0-4]\d|1?\d?\d)){3}$/;function J(c){const d=Number(c);if(c===""||c===null||!Number.isInteger(d)||d<0||d>32)return null;const u=d===0?0:4294967295<<32-d>>>0;return[24,16,8,0].map(v=>u>>>v&255).join(".")}function Q(c){if(typeof c!="string"||!P.test(c))return null;const d=c.split(".").reduce((m,n)=>(m<<8|Number(n))>>>0,0);let u=0;for(;u<32&&d&2147483648>>>u;)u++;const v=u===0?0:4294967295<<32-u>>>0;return d===v?u:null}function W(c){const d=String(c??"").trim(),[u,v,...m]=d.split("/");if(m.length||!P.test(u))return null;if(v===void 0)return{network:u,netmask:null};const n=J(v);return n?{network:u,netmask:n}:null}const Y={class:"config-wrapper"},Z={key:0,class:"config-card"},h={key:1,class:"config-card"},ss={class:"config-row"},ts={class:"config-col"},ns={class:"select-container"},es={class:"config-col"},os={class:"number-input-container"},ls={class:"number-input-controls"},is={class:"config-row"},as={class:"config-col"},rs={class:"config-col"},ds={class:"config-row"},us={class:"config-col"},ps={class:"number-input-container"},cs={class:"number-input-controls"},fs={class:"config-col"},vs={class:"number-input-container"},gs={class:"number-input-controls"},bs={class:"config-row"},ms={class:"config-col"},_s={class:"toggle-wrapper"},ys={class:"toggle-switch"},ks={key:0,class:"nested-box fade-in"},ws={class:"config-row mb-2"},Cs={class:"config-col"},xs={class:"list-container"},Ss=["onUpdate:modelValue"],Vs=["onClick"],Us={class:"config-row"},Fs={class:"config-col"},Ps={class:"toggle-wrapper"},Is={class:"toggle-switch"},Ds={key:1,class:"nested-box fade-in"},Ns={class:"config-row mb-2"},Ts={class:"config-col"},$s={class:"list-container"},Ls=["onUpdate:modelValue"],Ms=["onClick"],As={class:"config-row"},Es={class:"config-col"},Rs={class:"toggle-wrapper"},js={class:"toggle-switch"},Bs={class:"config-col"},Os={class:"toggle-wrapper"},zs={class:"toggle-switch"},Ks={class:"config-col"},qs={class:"toggle-wrapper"},Gs={class:"toggle-switch"},Xs={class:"config-row"},Hs={class:"config-col"},Js={class:"toggle-wrapper"},Qs={class:"toggle-switch"},Ws={key:2,class:"nested-box fade-in"},Ys={class:"config-row"},Zs={class:"config-col"},hs={class:"config-row mt-3"},st={class:"config-col"},tt={class:"config-row mt-4"},nt={class:"config-col"},et={class:"toggle-wrapper"},ot={class:"toggle-switch"},lt={key:3,class:"nested-box fade-in"},it={class:"config-row"},at={class:"config-col"},rt={class:"config-col"},dt={class:"number-input-container"},ut={class:"number-input-controls"},pt={class:"btn-action-group"},ct=["disabled"],ft={key:0,class:"fas fa-spinner fa-spin"},vt={key:1,class:"fas fa-save"},gt=["disabled"],bt={key:0,class:"fas fa-spinner fa-spin"},mt={key:1,class:"fas fa-rocket"},yt={__name:"VPNConfig",setup(c){const{profilesApiClient:d}=X(),u=H(),{status:v,refresh:m}=j(),n=A({protocol:"udp",port:1194,vpn_network:"",public_ip:"",tun_mtu:0,mssfix:0,tunnel_type:"FULL",split_routes:[],user_defined_dns:!1,dns_servers:[],duplicate_cn:!1,client_to_client:!1,crl_verify:!1,user_defined_cdscripts:!1,connect_script:"",disconnect_script:"",management_interface:!1,management_interface_address:"",management_port:7505}),w=V(!1),g=V(!1),_=V("");E(w,o=>{n.tunnel_type=o?"SPLIT":"FULL"});let S="";const y=(o,s="success")=>u.show(o,s),I=()=>n.split_routes.push(""),D=o=>n.split_routes.splice(o,1),N=()=>n.dns_servers.push(""),T=o=>n.dns_servers.splice(o,1),$=async()=>{try{const s=(await d.get("/config",{params:{section:"server"}})).data,l=s.server?s.server:s;if(Object.keys(l).forEach(e=>{Object.hasOwn(n,e)&&(e==="tunnel_type"&&(w.value=l[e]==="SPLIT"),n[e]=l[e])}),S=l.vpn_netmask||"",l.vpn_network&&l.vpn_netmask){const e=Q(l.vpn_netmask);e!==null&&(n.vpn_network=`${l.vpn_network}/${e}`)}}catch(o){console.error(o),y("Failed to load Server config from Management API.","error")}},L=async()=>{const o=W(n.vpn_network);if(!o){y("VPN subnet must be an IPv4 network in CIDR format, e.g. 172.20.1.0/24","error");return}g.value=!0,_.value="save";const s={...n};s.split_routes=s.split_routes.filter(l=>l&&l.trim()!==""),s.dns_servers=s.dns_servers.filter(l=>l&&l.trim()!==""),s.vpn_network=o.network,s.vpn_netmask=o.netmask||S||"255.255.255.0";try{await d.put("/config/server",s),S=s.vpn_netmask,y("Server configuration saved!","success")}catch(l){y(`Error saving: ${l.response?.data?.detail||l.message}`,"error")}finally{g.value=!1,_.value=""}},M=async()=>{g.value=!0,_.value="apply";try{const s=(await d.post("/server/configure")).data;y(s.message||"Configuration applied!","success")}catch(o){y(`Error applying: ${o.response?.data?.detail||o.message}`,"error"),m()}finally{g.value=!1,_.value=""}};return R(()=>{m(),$()}),(o,s)=>{const l=K("router-link");return r(),a("div",Y,[B(v).pki_ready?(r(),a("div",h,[s[75]||(s[75]=t("div",{class:"config-header"},[t("h1",null,"Server Infrastructure Configuration")],-1)),t("form",{onSubmit:G(L,["prevent"])},[t("div",ss,[t("div",ts,[s[30]||(s[30]=t("label",{class:"config-label"},"Tunnel Protocol",-1)),t("div",ns,[i(t("select",{class:"config-select","onUpdate:modelValue":s[0]||(s[0]=e=>n.protocol=e)},[...s[28]||(s[28]=[t("option",{value:"tcp"},"TCP",-1),t("option",{value:"udp"},"UDP",-1)])],512),[[q,n.protocol]]),s[29]||(s[29]=t("div",{class:"select-arrow"},[t("i",{class:"fas fa-chevron-down"})],-1))])]),t("div",es,[s[33]||(s[33]=t("label",{class:"config-label"},"Tunnel Port",-1)),t("div",os,[i(t("input",{type:"number",class:"config-input","onUpdate:modelValue":s[1]||(s[1]=e=>n.port=e)},null,512),[[p,n.port,void 0,{number:!0}]]),t("div",ls,[t("button",{type:"button",class:"number-input-btn",onClick:s[2]||(s[2]=e=>n.port++)},[...s[31]||(s[31]=[t("i",{class:"fas fa-chevron-up"},null,-1)])]),t("button",{type:"button",class:"number-input-btn",onClick:s[3]||(s[3]=e=>n.port--)},[...s[32]||(s[32]=[t("i",{class:"fas fa-chevron-down"},null,-1)])])])])])]),t("div",is,[t("div",as,[s[34]||(s[34]=t("label",{class:"config-label"},"VPN Subnet (CIDR Format)",-1)),i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":s[4]||(s[4]=e=>n.vpn_network=e),placeholder:"172.20.1.0/24"},null,512),[[p,n.vpn_network]])]),t("div",rs,[s[35]||(s[35]=t("label",{class:"config-label"},"Public IP",-1)),i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":s[5]||(s[5]=e=>n.public_ip=e)},null,512),[[p,n.public_ip]])])]),t("div",ds,[t("div",us,[s[38]||(s[38]=t("label",{class:"config-label"},"Tunnel MTU",-1)),t("div",ps,[i(t("input",{type:"number",class:"config-input","onUpdate:modelValue":s[6]||(s[6]=e=>n.tun_mtu=e),placeholder:"0 for default"},null,512),[[p,n.tun_mtu,void 0,{number:!0}]]),t("div",cs,[t("button",{type:"button",class:"number-input-btn",onClick:s[7]||(s[7]=e=>n.tun_mtu++)},[...s[36]||(s[36]=[t("i",{class:"fas fa-chevron-up"},null,-1)])]),t("button",{type:"button",class:"number-input-btn",onClick:s[8]||(s[8]=e=>n.tun_mtu--)},[...s[37]||(s[37]=[t("i",{class:"fas fa-chevron-down"},null,-1)])])])])]),t("div",fs,[s[41]||(s[41]=t("label",{class:"config-label"},"MSS FIX",-1)),t("div",vs,[i(t("input",{type:"number",class:"config-input","onUpdate:modelValue":s[9]||(s[9]=e=>n.mssfix=e),placeholder:"0 for default"},null,512),[[p,n.mssfix,void 0,{number:!0}]]),t("div",gs,[t("button",{type:"button",class:"number-input-btn",onClick:s[10]||(s[10]=e=>n.mssfix++)},[...s[39]||(s[39]=[t("i",{class:"fas fa-chevron-up"},null,-1)])]),t("button",{type:"button",class:"number-input-btn",onClick:s[11]||(s[11]=e=>n.mssfix--)},[...s[40]||(s[40]=[t("i",{class:"fas fa-chevron-down"},null,-1)])])])])])]),s[70]||(s[70]=t("div",{class:"config-divider"},null,-1)),t("div",bs,[t("div",ms,[s[43]||(s[43]=t("label",{class:"config-label"},"Enable Split Tunnel (Default FULL)",-1)),t("div",_s,[t("label",ys,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[12]||(s[12]=e=>w.value=e)},null,512),[[b,w.value]]),s[42]||(s[42]=t("span",{class:"toggle-slider"},null,-1))])])])]),w.value?(r(),a("div",ks,[t("div",ws,[t("div",Cs,[s[46]||(s[46]=t("label",{class:"nested-label"},"Split Routes (CIDR Format)",-1)),t("div",xs,[(r(!0),a(U,null,F(n.split_routes,(e,f)=>(r(),a("div",{key:f,class:"config-input-group mb-2"},[i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":C=>n.split_routes[f]=C,placeholder:"10.0.0.0/24"},null,8,Ss),[[p,n.split_routes[f]]]),t("button",{type:"button",class:"btn-icon-sm",onClick:C=>D(f)},[...s[44]||(s[44]=[t("i",{class:"fas fa-trash"},null,-1)])],8,Vs)]))),128))]),t("button",{type:"button",class:"btn-dashed text-primary",onClick:I},[...s[45]||(s[45]=[t("i",{class:"fas fa-plus text-primary"},null,-1),k(" Add Route ",-1)])])])])])):x("",!0),s[71]||(s[71]=t("div",{class:"config-divider"},null,-1)),t("div",Us,[t("div",Fs,[s[48]||(s[48]=t("label",{class:"config-label"},"Enable User-Defined DNS Servers",-1)),t("div",Ps,[t("label",Is,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[13]||(s[13]=e=>n.user_defined_dns=e)},null,512),[[b,n.user_defined_dns]]),s[47]||(s[47]=t("span",{class:"toggle-slider"},null,-1))])])])]),n.user_defined_dns?(r(),a("div",Ds,[t("div",Ns,[t("div",Ts,[s[51]||(s[51]=t("label",{class:"nested-label"},"DNS Servers",-1)),t("div",$s,[(r(!0),a(U,null,F(n.dns_servers,(e,f)=>(r(),a("div",{key:f,class:"config-input-group mb-2"},[i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":C=>n.dns_servers[f]=C,placeholder:"8.8.8.8"},null,8,Ls),[[p,n.dns_servers[f]]]),t("button",{type:"button",class:"btn-icon-sm",onClick:C=>T(f)},[...s[49]||(s[49]=[t("i",{class:"fas fa-trash"},null,-1)])],8,Ms)]))),128))]),t("button",{type:"button",class:"btn-dashed text-primary",onClick:N},[...s[50]||(s[50]=[t("i",{class:"fas fa-plus text-primary"},null,-1),k(" Add DNS ",-1)])])])])])):x("",!0),s[72]||(s[72]=t("div",{class:"config-divider"},null,-1)),t("div",As,[t("div",Es,[s[53]||(s[53]=t("label",{class:"config-label"},"Duplicate CN",-1)),t("div",Rs,[t("label",js,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[14]||(s[14]=e=>n.duplicate_cn=e)},null,512),[[b,n.duplicate_cn]]),s[52]||(s[52]=t("span",{class:"toggle-slider"},null,-1))])])]),t("div",Bs,[s[55]||(s[55]=t("label",{class:"config-label"},"Client-to-Client",-1)),t("div",Os,[t("label",zs,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[15]||(s[15]=e=>n.client_to_client=e)},null,512),[[b,n.client_to_client]]),s[54]||(s[54]=t("span",{class:"toggle-slider"},null,-1))])])]),t("div",Ks,[s[57]||(s[57]=t("label",{class:"config-label"},"CRL Verify",-1)),t("div",qs,[t("label",Gs,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[16]||(s[16]=e=>n.crl_verify=e)},null,512),[[b,n.crl_verify]]),s[56]||(s[56]=t("span",{class:"toggle-slider"},null,-1))])])])]),s[73]||(s[73]=t("div",{class:"config-divider"},null,-1)),t("div",Xs,[t("div",Hs,[s[59]||(s[59]=t("label",{class:"config-label"},"Enable Connection Scripts",-1)),t("div",Js,[t("label",Qs,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[17]||(s[17]=e=>n.user_defined_cdscripts=e)},null,512),[[b,n.user_defined_cdscripts]]),s[58]||(s[58]=t("span",{class:"toggle-slider"},null,-1))])])])]),n.user_defined_cdscripts?(r(),a("div",Ws,[t("div",Ys,[t("div",Zs,[s[60]||(s[60]=t("label",{class:"config-label"},"Path to Connect Script",-1)),i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":s[18]||(s[18]=e=>n.connect_script=e)},null,512),[[p,n.connect_script]])])]),t("div",hs,[t("div",st,[s[61]||(s[61]=t("label",{class:"config-label"},"Path to Disconnect Script",-1)),i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":s[19]||(s[19]=e=>n.disconnect_script=e)},null,512),[[p,n.disconnect_script]])])])])):x("",!0),t("div",tt,[t("div",nt,[s[63]||(s[63]=t("label",{class:"config-label"},"Enable Management Interface",-1)),t("div",et,[t("label",ot,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[20]||(s[20]=e=>n.management_interface=e)},null,512),[[b,n.management_interface]]),s[62]||(s[62]=t("span",{class:"toggle-slider"},null,-1))])])])]),n.management_interface?(r(),a("div",lt,[t("div",it,[t("div",at,[s[64]||(s[64]=t("label",{class:"config-label"},"Listener Address",-1)),i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":s[21]||(s[21]=e=>n.management_interface_address=e),placeholder:"127.0.0.1"},null,512),[[p,n.management_interface_address]])]),t("div",rt,[s[67]||(s[67]=t("label",{class:"config-label"},"Port",-1)),t("div",dt,[i(t("input",{type:"number",class:"config-input","onUpdate:modelValue":s[22]||(s[22]=e=>n.management_port=e),placeholder:"7505"},null,512),[[p,n.management_port,void 0,{number:!0}]]),t("div",ut,[t("button",{type:"button",class:"number-input-btn",onClick:s[23]||(s[23]=e=>n.management_port++)},[...s[65]||(s[65]=[t("i",{class:"fas fa-chevron-up"},null,-1)])]),t("button",{type:"button",class:"number-input-btn",onClick:s[24]||(s[24]=e=>n.management_port--)},[...s[66]||(s[66]=[t("i",{class:"fas fa-chevron-down"},null,-1)])])])])])])])):x("",!0),s[74]||(s[74]=t("div",{class:"config-divider"},null,-1)),t("div",pt,[t("button",{type:"submit",class:"btn-action btn-action-save",disabled:g.value},[g.value&&_.value==="save"?(r(),a("i",ft)):(r(),a("i",vt)),s[68]||(s[68]=k(" Save Server Configuration ",-1))],8,ct),t("button",{type:"button",class:"btn-action btn-action-primary",onClick:M,disabled:g.value},[g.value&&_.value==="apply"?(r(),a("i",bt)):(r(),a("i",mt)),s[69]||(s[69]=k(" Apply Configuration ",-1))],8,gt)])],32)])):(r(),a("div",Z,[s[26]||(s[26]=t("div",{class:"config-header"},[t("h1",null,"Server Infrastructure Configuration")],-1)),s[27]||(s[27]=t("p",null,[t("i",{class:"fas fa-lock me-2"}),k("The server cannot be configured until the PKI is initialized.")],-1)),O(l,{to:"/config/pki"},{default:z(()=>[...s[25]||(s[25]=[k("Go to PKI configuration",-1)])]),_:1})]))])}}};export{yt as default}; +import{a as A,r as V,D as E,o as R,B as j,d as a,f as B,e as t,q as O,g as k,A as z,E as K,m as x,w as i,v as q,x as p,h as b,F as U,i as F,z as G,j as X,C as H,k as r}from"./index-CH6sppUl.js";const P=/^(25[0-5]|2[0-4]\d|1?\d?\d)(\.(25[0-5]|2[0-4]\d|1?\d?\d)){3}$/;function J(c){const d=Number(c);if(c===""||c===null||!Number.isInteger(d)||d<0||d>32)return null;const u=d===0?0:4294967295<<32-d>>>0;return[24,16,8,0].map(v=>u>>>v&255).join(".")}function Q(c){if(typeof c!="string"||!P.test(c))return null;const d=c.split(".").reduce((m,n)=>(m<<8|Number(n))>>>0,0);let u=0;for(;u<32&&d&2147483648>>>u;)u++;const v=u===0?0:4294967295<<32-u>>>0;return d===v?u:null}function W(c){const d=String(c??"").trim(),[u,v,...m]=d.split("/");if(m.length||!P.test(u))return null;if(v===void 0)return{network:u,netmask:null};const n=J(v);return n?{network:u,netmask:n}:null}const Y={class:"config-wrapper"},Z={key:0,class:"config-card"},h={key:1,class:"config-card"},ss={class:"config-row"},ts={class:"config-col"},ns={class:"select-container"},es={class:"config-col"},os={class:"number-input-container"},ls={class:"number-input-controls"},is={class:"config-row"},as={class:"config-col"},rs={class:"config-col"},ds={class:"config-row"},us={class:"config-col"},ps={class:"number-input-container"},cs={class:"number-input-controls"},fs={class:"config-col"},vs={class:"number-input-container"},gs={class:"number-input-controls"},bs={class:"config-row"},ms={class:"config-col"},_s={class:"toggle-wrapper"},ys={class:"toggle-switch"},ks={key:0,class:"nested-box fade-in"},ws={class:"config-row mb-2"},Cs={class:"config-col"},xs={class:"list-container"},Ss=["onUpdate:modelValue"],Vs=["onClick"],Us={class:"config-row"},Fs={class:"config-col"},Ps={class:"toggle-wrapper"},Is={class:"toggle-switch"},Ds={key:1,class:"nested-box fade-in"},Ns={class:"config-row mb-2"},Ts={class:"config-col"},$s={class:"list-container"},Ls=["onUpdate:modelValue"],Ms=["onClick"],As={class:"config-row"},Es={class:"config-col"},Rs={class:"toggle-wrapper"},js={class:"toggle-switch"},Bs={class:"config-col"},Os={class:"toggle-wrapper"},zs={class:"toggle-switch"},Ks={class:"config-col"},qs={class:"toggle-wrapper"},Gs={class:"toggle-switch"},Xs={class:"config-row"},Hs={class:"config-col"},Js={class:"toggle-wrapper"},Qs={class:"toggle-switch"},Ws={key:2,class:"nested-box fade-in"},Ys={class:"config-row"},Zs={class:"config-col"},hs={class:"config-row mt-3"},st={class:"config-col"},tt={class:"config-row mt-4"},nt={class:"config-col"},et={class:"toggle-wrapper"},ot={class:"toggle-switch"},lt={key:3,class:"nested-box fade-in"},it={class:"config-row"},at={class:"config-col"},rt={class:"config-col"},dt={class:"number-input-container"},ut={class:"number-input-controls"},pt={class:"btn-action-group"},ct=["disabled"],ft={key:0,class:"fas fa-spinner fa-spin"},vt={key:1,class:"fas fa-save"},gt=["disabled"],bt={key:0,class:"fas fa-spinner fa-spin"},mt={key:1,class:"fas fa-rocket"},yt={__name:"VPNConfig",setup(c){const{profilesApiClient:d}=X(),u=H(),{status:v,refresh:m}=j(),n=A({protocol:"udp",port:1194,vpn_network:"",public_ip:"",tun_mtu:0,mssfix:0,tunnel_type:"FULL",split_routes:[],user_defined_dns:!1,dns_servers:[],duplicate_cn:!1,client_to_client:!1,crl_verify:!1,user_defined_cdscripts:!1,connect_script:"",disconnect_script:"",management_interface:!1,management_interface_address:"",management_port:7505}),w=V(!1),g=V(!1),_=V("");E(w,o=>{n.tunnel_type=o?"SPLIT":"FULL"});let S="";const y=(o,s="success")=>u.show(o,s),I=()=>n.split_routes.push(""),D=o=>n.split_routes.splice(o,1),N=()=>n.dns_servers.push(""),T=o=>n.dns_servers.splice(o,1),$=async()=>{try{const s=(await d.get("/config",{params:{section:"server"}})).data,l=s.server?s.server:s;if(Object.keys(l).forEach(e=>{Object.hasOwn(n,e)&&(e==="tunnel_type"&&(w.value=l[e]==="SPLIT"),n[e]=l[e])}),S=l.vpn_netmask||"",l.vpn_network&&l.vpn_netmask){const e=Q(l.vpn_netmask);e!==null&&(n.vpn_network=`${l.vpn_network}/${e}`)}}catch(o){console.error(o),y("Failed to load Server config from Management API.","error")}},L=async()=>{const o=W(n.vpn_network);if(!o){y("VPN subnet must be an IPv4 network in CIDR format, e.g. 172.20.1.0/24","error");return}g.value=!0,_.value="save";const s={...n};s.split_routes=s.split_routes.filter(l=>l&&l.trim()!==""),s.dns_servers=s.dns_servers.filter(l=>l&&l.trim()!==""),s.vpn_network=o.network,s.vpn_netmask=o.netmask||S||"255.255.255.0";try{await d.put("/config/server",s),S=s.vpn_netmask,y("Server configuration saved!","success")}catch(l){y(`Error saving: ${l.response?.data?.detail||l.message}`,"error")}finally{g.value=!1,_.value=""}},M=async()=>{g.value=!0,_.value="apply";try{const s=(await d.post("/server/configure")).data;y(s.message||"Configuration applied!","success")}catch(o){y(`Error applying: ${o.response?.data?.detail||o.message}`,"error"),m()}finally{g.value=!1,_.value=""}};return R(()=>{m(),$()}),(o,s)=>{const l=K("router-link");return r(),a("div",Y,[B(v).pki_ready?(r(),a("div",h,[s[75]||(s[75]=t("div",{class:"config-header"},[t("h1",null,"Server Infrastructure Configuration")],-1)),t("form",{onSubmit:G(L,["prevent"])},[t("div",ss,[t("div",ts,[s[30]||(s[30]=t("label",{class:"config-label"},"Tunnel Protocol",-1)),t("div",ns,[i(t("select",{class:"config-select","onUpdate:modelValue":s[0]||(s[0]=e=>n.protocol=e)},[...s[28]||(s[28]=[t("option",{value:"tcp"},"TCP",-1),t("option",{value:"udp"},"UDP",-1)])],512),[[q,n.protocol]]),s[29]||(s[29]=t("div",{class:"select-arrow"},[t("i",{class:"fas fa-chevron-down"})],-1))])]),t("div",es,[s[33]||(s[33]=t("label",{class:"config-label"},"Tunnel Port",-1)),t("div",os,[i(t("input",{type:"number",class:"config-input","onUpdate:modelValue":s[1]||(s[1]=e=>n.port=e)},null,512),[[p,n.port,void 0,{number:!0}]]),t("div",ls,[t("button",{type:"button",class:"number-input-btn",onClick:s[2]||(s[2]=e=>n.port++)},[...s[31]||(s[31]=[t("i",{class:"fas fa-chevron-up"},null,-1)])]),t("button",{type:"button",class:"number-input-btn",onClick:s[3]||(s[3]=e=>n.port--)},[...s[32]||(s[32]=[t("i",{class:"fas fa-chevron-down"},null,-1)])])])])])]),t("div",is,[t("div",as,[s[34]||(s[34]=t("label",{class:"config-label"},"VPN Subnet (CIDR Format)",-1)),i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":s[4]||(s[4]=e=>n.vpn_network=e),placeholder:"172.20.1.0/24"},null,512),[[p,n.vpn_network]])]),t("div",rs,[s[35]||(s[35]=t("label",{class:"config-label"},"Public IP",-1)),i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":s[5]||(s[5]=e=>n.public_ip=e)},null,512),[[p,n.public_ip]])])]),t("div",ds,[t("div",us,[s[38]||(s[38]=t("label",{class:"config-label"},"Tunnel MTU",-1)),t("div",ps,[i(t("input",{type:"number",class:"config-input","onUpdate:modelValue":s[6]||(s[6]=e=>n.tun_mtu=e),placeholder:"0 for default"},null,512),[[p,n.tun_mtu,void 0,{number:!0}]]),t("div",cs,[t("button",{type:"button",class:"number-input-btn",onClick:s[7]||(s[7]=e=>n.tun_mtu++)},[...s[36]||(s[36]=[t("i",{class:"fas fa-chevron-up"},null,-1)])]),t("button",{type:"button",class:"number-input-btn",onClick:s[8]||(s[8]=e=>n.tun_mtu--)},[...s[37]||(s[37]=[t("i",{class:"fas fa-chevron-down"},null,-1)])])])])]),t("div",fs,[s[41]||(s[41]=t("label",{class:"config-label"},"MSS FIX",-1)),t("div",vs,[i(t("input",{type:"number",class:"config-input","onUpdate:modelValue":s[9]||(s[9]=e=>n.mssfix=e),placeholder:"0 for default"},null,512),[[p,n.mssfix,void 0,{number:!0}]]),t("div",gs,[t("button",{type:"button",class:"number-input-btn",onClick:s[10]||(s[10]=e=>n.mssfix++)},[...s[39]||(s[39]=[t("i",{class:"fas fa-chevron-up"},null,-1)])]),t("button",{type:"button",class:"number-input-btn",onClick:s[11]||(s[11]=e=>n.mssfix--)},[...s[40]||(s[40]=[t("i",{class:"fas fa-chevron-down"},null,-1)])])])])])]),s[70]||(s[70]=t("div",{class:"config-divider"},null,-1)),t("div",bs,[t("div",ms,[s[43]||(s[43]=t("label",{class:"config-label"},"Enable Split Tunnel (Default FULL)",-1)),t("div",_s,[t("label",ys,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[12]||(s[12]=e=>w.value=e)},null,512),[[b,w.value]]),s[42]||(s[42]=t("span",{class:"toggle-slider"},null,-1))])])])]),w.value?(r(),a("div",ks,[t("div",ws,[t("div",Cs,[s[46]||(s[46]=t("label",{class:"nested-label"},"Split Routes (CIDR Format)",-1)),t("div",xs,[(r(!0),a(U,null,F(n.split_routes,(e,f)=>(r(),a("div",{key:f,class:"config-input-group mb-2"},[i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":C=>n.split_routes[f]=C,placeholder:"10.0.0.0/24"},null,8,Ss),[[p,n.split_routes[f]]]),t("button",{type:"button",class:"btn-icon-sm",onClick:C=>D(f)},[...s[44]||(s[44]=[t("i",{class:"fas fa-trash"},null,-1)])],8,Vs)]))),128))]),t("button",{type:"button",class:"btn-dashed text-primary",onClick:I},[...s[45]||(s[45]=[t("i",{class:"fas fa-plus text-primary"},null,-1),k(" Add Route ",-1)])])])])])):x("",!0),s[71]||(s[71]=t("div",{class:"config-divider"},null,-1)),t("div",Us,[t("div",Fs,[s[48]||(s[48]=t("label",{class:"config-label"},"Enable User-Defined DNS Servers",-1)),t("div",Ps,[t("label",Is,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[13]||(s[13]=e=>n.user_defined_dns=e)},null,512),[[b,n.user_defined_dns]]),s[47]||(s[47]=t("span",{class:"toggle-slider"},null,-1))])])])]),n.user_defined_dns?(r(),a("div",Ds,[t("div",Ns,[t("div",Ts,[s[51]||(s[51]=t("label",{class:"nested-label"},"DNS Servers",-1)),t("div",$s,[(r(!0),a(U,null,F(n.dns_servers,(e,f)=>(r(),a("div",{key:f,class:"config-input-group mb-2"},[i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":C=>n.dns_servers[f]=C,placeholder:"8.8.8.8"},null,8,Ls),[[p,n.dns_servers[f]]]),t("button",{type:"button",class:"btn-icon-sm",onClick:C=>T(f)},[...s[49]||(s[49]=[t("i",{class:"fas fa-trash"},null,-1)])],8,Ms)]))),128))]),t("button",{type:"button",class:"btn-dashed text-primary",onClick:N},[...s[50]||(s[50]=[t("i",{class:"fas fa-plus text-primary"},null,-1),k(" Add DNS ",-1)])])])])])):x("",!0),s[72]||(s[72]=t("div",{class:"config-divider"},null,-1)),t("div",As,[t("div",Es,[s[53]||(s[53]=t("label",{class:"config-label"},"Duplicate CN",-1)),t("div",Rs,[t("label",js,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[14]||(s[14]=e=>n.duplicate_cn=e)},null,512),[[b,n.duplicate_cn]]),s[52]||(s[52]=t("span",{class:"toggle-slider"},null,-1))])])]),t("div",Bs,[s[55]||(s[55]=t("label",{class:"config-label"},"Client-to-Client",-1)),t("div",Os,[t("label",zs,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[15]||(s[15]=e=>n.client_to_client=e)},null,512),[[b,n.client_to_client]]),s[54]||(s[54]=t("span",{class:"toggle-slider"},null,-1))])])]),t("div",Ks,[s[57]||(s[57]=t("label",{class:"config-label"},"CRL Verify",-1)),t("div",qs,[t("label",Gs,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[16]||(s[16]=e=>n.crl_verify=e)},null,512),[[b,n.crl_verify]]),s[56]||(s[56]=t("span",{class:"toggle-slider"},null,-1))])])])]),s[73]||(s[73]=t("div",{class:"config-divider"},null,-1)),t("div",Xs,[t("div",Hs,[s[59]||(s[59]=t("label",{class:"config-label"},"Enable Connection Scripts",-1)),t("div",Js,[t("label",Qs,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[17]||(s[17]=e=>n.user_defined_cdscripts=e)},null,512),[[b,n.user_defined_cdscripts]]),s[58]||(s[58]=t("span",{class:"toggle-slider"},null,-1))])])])]),n.user_defined_cdscripts?(r(),a("div",Ws,[t("div",Ys,[t("div",Zs,[s[60]||(s[60]=t("label",{class:"config-label"},"Path to Connect Script",-1)),i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":s[18]||(s[18]=e=>n.connect_script=e)},null,512),[[p,n.connect_script]])])]),t("div",hs,[t("div",st,[s[61]||(s[61]=t("label",{class:"config-label"},"Path to Disconnect Script",-1)),i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":s[19]||(s[19]=e=>n.disconnect_script=e)},null,512),[[p,n.disconnect_script]])])])])):x("",!0),t("div",tt,[t("div",nt,[s[63]||(s[63]=t("label",{class:"config-label"},"Enable Management Interface",-1)),t("div",et,[t("label",ot,[i(t("input",{type:"checkbox","onUpdate:modelValue":s[20]||(s[20]=e=>n.management_interface=e)},null,512),[[b,n.management_interface]]),s[62]||(s[62]=t("span",{class:"toggle-slider"},null,-1))])])])]),n.management_interface?(r(),a("div",lt,[t("div",it,[t("div",at,[s[64]||(s[64]=t("label",{class:"config-label"},"Listener Address",-1)),i(t("input",{type:"text",class:"config-input","onUpdate:modelValue":s[21]||(s[21]=e=>n.management_interface_address=e),placeholder:"127.0.0.1"},null,512),[[p,n.management_interface_address]])]),t("div",rt,[s[67]||(s[67]=t("label",{class:"config-label"},"Port",-1)),t("div",dt,[i(t("input",{type:"number",class:"config-input","onUpdate:modelValue":s[22]||(s[22]=e=>n.management_port=e),placeholder:"7505"},null,512),[[p,n.management_port,void 0,{number:!0}]]),t("div",ut,[t("button",{type:"button",class:"number-input-btn",onClick:s[23]||(s[23]=e=>n.management_port++)},[...s[65]||(s[65]=[t("i",{class:"fas fa-chevron-up"},null,-1)])]),t("button",{type:"button",class:"number-input-btn",onClick:s[24]||(s[24]=e=>n.management_port--)},[...s[66]||(s[66]=[t("i",{class:"fas fa-chevron-down"},null,-1)])])])])])])])):x("",!0),s[74]||(s[74]=t("div",{class:"config-divider"},null,-1)),t("div",pt,[t("button",{type:"submit",class:"btn-action btn-action-save",disabled:g.value},[g.value&&_.value==="save"?(r(),a("i",ft)):(r(),a("i",vt)),s[68]||(s[68]=k(" Save Server Configuration ",-1))],8,ct),t("button",{type:"button",class:"btn-action btn-action-primary",onClick:M,disabled:g.value},[g.value&&_.value==="apply"?(r(),a("i",bt)):(r(),a("i",mt)),s[69]||(s[69]=k(" Apply Configuration ",-1))],8,gt)])],32)])):(r(),a("div",Z,[s[26]||(s[26]=t("div",{class:"config-header"},[t("h1",null,"Server Infrastructure Configuration")],-1)),s[27]||(s[27]=t("p",null,[t("i",{class:"fas fa-lock me-2"}),k("The server cannot be configured until the PKI is initialized.")],-1)),O(l,{to:"/config/pki"},{default:z(()=>[...s[25]||(s[25]=[k("Go to PKI configuration",-1)])]),_:1})]))])}}};export{yt as default}; diff --git a/deploy/ui-dist/assets/index-BfAhXdi6.js b/deploy/ui-dist/assets/index-CH6sppUl.js similarity index 99% rename from deploy/ui-dist/assets/index-BfAhXdi6.js rename to deploy/ui-dist/assets/index-CH6sppUl.js index d4ade14..7384f08 100644 --- a/deploy/ui-dist/assets/index-BfAhXdi6.js +++ b/deploy/ui-dist/assets/index-CH6sppUl.js @@ -1,7 +1,7 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Analytics-wS3sZsf7.js","assets/useTrafficChart-69f2EcZB.js","assets/vendor-charts-Bcjh2pZL.js","assets/useFormatters-CKGG-YVI.js","assets/Clients-B4FTmkE-.js","assets/vendor-ui-Dumif2LN.js","assets/Certificates-Q5PSlJMg.js","assets/ConfirmModal-wSxjHDVn.js","assets/PKIConfig-aTZFQ7nU.js","assets/ServerManagement-BrgZCXB4.js","assets/BackupRestore-b-fUBt2d.js","assets/Account-D3bmpB1v.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Analytics-CkWhgHOC.js","assets/useTrafficChart-DniISzMl.js","assets/vendor-charts-Bcjh2pZL.js","assets/useFormatters-CKGG-YVI.js","assets/Clients-B12ijQb2.js","assets/vendor-ui-Dumif2LN.js","assets/Certificates-bKg5i2cX.js","assets/ConfirmModal-XwuF5iM0.js","assets/PKIConfig-WA_fcodw.js","assets/ServerManagement-Bi2HPYWE.js","assets/BackupRestore-DWeGKaYC.js","assets/Account-DxXUov-q.js"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();function bl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const $e={},Ls=[],hn=()=>{},Gu=()=>!1,xi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),yl=e=>e.startsWith("onUpdate:"),Ze=Object.assign,vl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},lm=Object.prototype.hasOwnProperty,Re=(e,t)=>lm.call(e,t),re=Array.isArray,Ds=e=>xr(e)==="[object Map]",Ws=e=>xr(e)==="[object Set]",Sc=e=>xr(e)==="[object Date]",pe=e=>typeof e=="function",ze=e=>typeof e=="string",Xt=e=>typeof e=="symbol",Me=e=>e!==null&&typeof e=="object",Ju=e=>(Me(e)||pe(e))&&pe(e.then)&&pe(e.catch),Xu=Object.prototype.toString,xr=e=>Xu.call(e),am=e=>xr(e).slice(8,-1),Yu=e=>xr(e)==="[object Object]",wl=e=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ar=bl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Oi=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},cm=/-\w/g,Wt=Oi(e=>e.replace(cm,t=>t.slice(1).toUpperCase())),um=/\B([A-Z])/g,qn=Oi(e=>e.replace(um,"-$1").toLowerCase()),Ri=Oi(e=>e.charAt(0).toUpperCase()+e.slice(1)),xo=Oi(e=>e?`on${Ri(e)}`:""),Un=(e,t)=>!Object.is(e,t),ai=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Pi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},fm=e=>{const t=ze(e)?Number(e):NaN;return isNaN(t)?e:t};let Tc;const Ni=()=>Tc||(Tc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ii(e){if(re(e)){const t={};for(let n=0;n{if(n){const s=n.split(hm);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function An(e){let t="";if(ze(e))t=e;else if(re(e))for(let n=0;nOr(n,t))}const ef=e=>!!(e&&e.__v_isRef===!0),cs=e=>ze(e)?e:e==null?"":re(e)||Me(e)&&(e.toString===Xu||!pe(e.toString))?ef(e)?cs(e.value):JSON.stringify(e,tf,2):String(e),tf=(e,t)=>ef(t)?tf(e,t.value):Ds(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],o)=>(n[Oo(s,o)+" =>"]=r,n),{})}:Ws(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Oo(n))}:Xt(t)?Oo(t):Me(t)&&!re(t)&&!Yu(t)?String(t):t,Oo=(e,t="")=>{var n;return Xt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let St;class ym{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=St,!t&&St&&(this.index=(St.scopes||(St.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0&&(St=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n0)return;if(ur){let t=ur;for(ur=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;cr;){let t=cr;for(cr=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function of(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function lf(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),Sl(s),wm(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function Go(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(af(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function af(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===_r)||(e.globalVersion=_r,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Go(e))))return;e.flags|=2;const t=e.dep,n=Be,s=Gt;Be=e,Gt=!0;try{of(e);const r=e.fn(e._value);(t.version===0||Un(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{Be=n,Gt=s,lf(e),e.flags&=-3}}function Sl(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)Sl(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function wm(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Gt=!0;const cf=[];function Sn(){cf.push(Gt),Gt=!1}function Tn(){const e=cf.pop();Gt=e===void 0?!0:e}function xc(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Be;Be=void 0;try{t()}finally{Be=n}}}let _r=0;class Em{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Tl{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Be||!Gt||Be===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Be)n=this.activeLink=new Em(Be,this),Be.deps?(n.prevDep=Be.depsTail,Be.depsTail.nextDep=n,Be.depsTail=n):Be.deps=Be.depsTail=n,uf(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Be.depsTail,n.nextDep=void 0,Be.depsTail.nextDep=n,Be.depsTail=n,Be.deps===n&&(Be.deps=s)}return n}trigger(t){this.version++,_r++,this.notify(t)}notify(t){Al();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Cl()}}}function uf(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)uf(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Jo=new WeakMap,us=Symbol(""),Xo=Symbol(""),br=Symbol("");function ct(e,t,n){if(Gt&&Be){let s=Jo.get(e);s||Jo.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new Tl),r.map=s,r.key=n),r.track()}}function wn(e,t,n,s,r,o){const l=Jo.get(e);if(!l){_r++;return}const c=u=>{u&&u.trigger()};if(Al(),t==="clear")l.forEach(c);else{const u=re(e),h=u&&wl(n);if(u&&n==="length"){const d=Number(s);l.forEach((m,_)=>{(_==="length"||_===br||!Xt(_)&&_>=d)&&c(m)})}else switch((n!==void 0||l.has(void 0))&&c(l.get(n)),h&&c(l.get(br)),t){case"add":u?h&&c(l.get("length")):(c(l.get(us)),Ds(e)&&c(l.get(Xo)));break;case"delete":u||(c(l.get(us)),Ds(e)&&c(l.get(Xo)));break;case"set":Ds(e)&&c(l.get(us));break}}Cl()}function Ps(e){const t=xe(e);return t===e?t:(ct(t,"iterate",br),qt(e)?t:t.map(Yt))}function ki(e){return ct(e=xe(e),"iterate",br),e}function Mn(e,t){return xn(e)?fs(e)?js(Yt(t)):js(t):Yt(t)}const Am={__proto__:null,[Symbol.iterator](){return Po(this,Symbol.iterator,e=>Mn(this,e))},concat(...e){return Ps(this).concat(...e.map(t=>re(t)?Ps(t):t))},entries(){return Po(this,"entries",e=>(e[1]=Mn(this,e[1]),e))},every(e,t){return bn(this,"every",e,t,void 0,arguments)},filter(e,t){return bn(this,"filter",e,t,n=>n.map(s=>Mn(this,s)),arguments)},find(e,t){return bn(this,"find",e,t,n=>Mn(this,n),arguments)},findIndex(e,t){return bn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return bn(this,"findLast",e,t,n=>Mn(this,n),arguments)},findLastIndex(e,t){return bn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return bn(this,"forEach",e,t,void 0,arguments)},includes(...e){return No(this,"includes",e)},indexOf(...e){return No(this,"indexOf",e)},join(e){return Ps(this).join(e)},lastIndexOf(...e){return No(this,"lastIndexOf",e)},map(e,t){return bn(this,"map",e,t,void 0,arguments)},pop(){return tr(this,"pop")},push(...e){return tr(this,"push",e)},reduce(e,...t){return Oc(this,"reduce",e,t)},reduceRight(e,...t){return Oc(this,"reduceRight",e,t)},shift(){return tr(this,"shift")},some(e,t){return bn(this,"some",e,t,void 0,arguments)},splice(...e){return tr(this,"splice",e)},toReversed(){return Ps(this).toReversed()},toSorted(e){return Ps(this).toSorted(e)},toSpliced(...e){return Ps(this).toSpliced(...e)},unshift(...e){return tr(this,"unshift",e)},values(){return Po(this,"values",e=>Mn(this,e))}};function Po(e,t,n){const s=ki(e),r=s[t]();return s!==e&&!qt(e)&&(r._next=r.next,r.next=()=>{const o=r._next();return o.done||(o.value=n(o.value)),o}),r}const Cm=Array.prototype;function bn(e,t,n,s,r,o){const l=ki(e),c=l!==e&&!qt(e),u=l[t];if(u!==Cm[t]){const m=u.apply(e,o);return c?Yt(m):m}let h=n;l!==e&&(c?h=function(m,_){return n.call(this,Mn(e,m),_,e)}:n.length>2&&(h=function(m,_){return n.call(this,m,_,e)}));const d=u.call(l,h,s);return c&&r?r(d):d}function Oc(e,t,n,s){const r=ki(e);let o=n;return r!==e&&(qt(e)?n.length>3&&(o=function(l,c,u){return n.call(this,l,c,u,e)}):o=function(l,c,u){return n.call(this,l,Mn(e,c),u,e)}),r[t](o,...s)}function No(e,t,n){const s=xe(e);ct(s,"iterate",br);const r=s[t](...n);return(r===-1||r===!1)&&Rl(n[0])?(n[0]=xe(n[0]),s[t](...n)):r}function tr(e,t,n=[]){Sn(),Al();const s=xe(e)[t].apply(e,n);return Cl(),Tn(),s}const Sm=bl("__proto__,__v_isRef,__isVue"),ff=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Xt));function Tm(e){Xt(e)||(e=String(e));const t=xe(this);return ct(t,"has",e),t.hasOwnProperty(e)}class df{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return o;if(n==="__v_raw")return s===(r?o?Mm:gf:o?mf:pf).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const l=re(t);if(!r){let u;if(l&&(u=Am[n]))return u;if(n==="hasOwnProperty")return Tm}const c=Reflect.get(t,n,dt(t)?t:s);if((Xt(n)?ff.has(n):Sm(n))||(r||ct(t,"get",n),o))return c;if(dt(c)){const u=l&&wl(n)?c:c.value;return r&&Me(u)?Qo(u):u}return Me(c)?r?Qo(c):gs(c):c}}class hf extends df{constructor(t=!1){super(!1,t)}set(t,n,s,r){let o=t[n];const l=re(t)&&wl(n);if(!this._isShallow){const h=xn(o);if(!qt(s)&&!xn(s)&&(o=xe(o),s=xe(s)),!l&&dt(o)&&!dt(s))return h||(o.value=s),!0}const c=l?Number(n)e,ni=e=>Reflect.getPrototypeOf(e);function Nm(e,t,n){return function(...s){const r=this.__v_raw,o=xe(r),l=Ds(o),c=e==="entries"||e===Symbol.iterator&&l,u=e==="keys"&&l,h=r[e](...s),d=n?Yo:t?js:Yt;return!t&&ct(o,"iterate",u?Xo:us),{next(){const{value:m,done:_}=h.next();return _?{value:m,done:_}:{value:c?[d(m[0]),d(m[1])]:d(m),done:_}},[Symbol.iterator](){return this}}}}function si(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Im(e,t){const n={get(r){const o=this.__v_raw,l=xe(o),c=xe(r);e||(Un(r,c)&&ct(l,"get",r),ct(l,"get",c));const{has:u}=ni(l),h=t?Yo:e?js:Yt;if(u.call(l,r))return h(o.get(r));if(u.call(l,c))return h(o.get(c));o!==l&&o.get(r)},get size(){const r=this.__v_raw;return!e&&ct(xe(r),"iterate",us),r.size},has(r){const o=this.__v_raw,l=xe(o),c=xe(r);return e||(Un(r,c)&&ct(l,"has",r),ct(l,"has",c)),r===c?o.has(r):o.has(r)||o.has(c)},forEach(r,o){const l=this,c=l.__v_raw,u=xe(c),h=t?Yo:e?js:Yt;return!e&&ct(u,"iterate",us),c.forEach((d,m)=>r.call(o,h(d),h(m),l))}};return Ze(n,e?{add:si("add"),set:si("set"),delete:si("delete"),clear:si("clear")}:{add(r){!t&&!qt(r)&&!xn(r)&&(r=xe(r));const o=xe(this);return ni(o).has.call(o,r)||(o.add(r),wn(o,"add",r,r)),this},set(r,o){!t&&!qt(o)&&!xn(o)&&(o=xe(o));const l=xe(this),{has:c,get:u}=ni(l);let h=c.call(l,r);h||(r=xe(r),h=c.call(l,r));const d=u.call(l,r);return l.set(r,o),h?Un(o,d)&&wn(l,"set",r,o):wn(l,"add",r,o),this},delete(r){const o=xe(this),{has:l,get:c}=ni(o);let u=l.call(o,r);u||(r=xe(r),u=l.call(o,r)),c&&c.call(o,r);const h=o.delete(r);return u&&wn(o,"delete",r,void 0),h},clear(){const r=xe(this),o=r.size!==0,l=r.clear();return o&&wn(r,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Nm(r,e,t)}),n}function xl(e,t){const n=Im(e,t);return(s,r,o)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(Re(n,r)&&r in s?n:s,r,o)}const km={get:xl(!1,!1)},Lm={get:xl(!1,!0)},Dm={get:xl(!0,!1)};const pf=new WeakMap,mf=new WeakMap,gf=new WeakMap,Mm=new WeakMap;function Fm(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function $m(e){return e.__v_skip||!Object.isExtensible(e)?0:Fm(am(e))}function gs(e){return xn(e)?e:Ol(e,!1,Om,km,pf)}function _f(e){return Ol(e,!1,Pm,Lm,mf)}function Qo(e){return Ol(e,!0,Rm,Dm,gf)}function Ol(e,t,n,s,r){if(!Me(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=$m(e);if(o===0)return e;const l=r.get(e);if(l)return l;const c=new Proxy(e,o===2?s:n);return r.set(e,c),c}function fs(e){return xn(e)?fs(e.__v_raw):!!(e&&e.__v_isReactive)}function xn(e){return!!(e&&e.__v_isReadonly)}function qt(e){return!!(e&&e.__v_isShallow)}function Rl(e){return e?!!e.__v_raw:!1}function xe(e){const t=e&&e.__v_raw;return t?xe(t):e}function jm(e){return!Re(e,"__v_skip")&&Object.isExtensible(e)&&Qu(e,"__v_skip",!0),e}const Yt=e=>Me(e)?gs(e):e,js=e=>Me(e)?Qo(e):e;function dt(e){return e?e.__v_isRef===!0:!1}function Tt(e){return bf(e,!1)}function Bm(e){return bf(e,!0)}function bf(e,t){return dt(e)?e:new Hm(e,t)}class Hm{constructor(t,n){this.dep=new Tl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:xe(t),this._value=n?t:Yt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||qt(t)||xn(t);t=s?t:xe(t),Un(t,n)&&(this._rawValue=t,this._value=s?t:Yt(t),this.dep.trigger())}}function At(e){return dt(e)?e.value:e}const Um={get:(e,t,n)=>t==="__v_raw"?e:At(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return dt(r)&&!dt(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function yf(e){return fs(e)?e:new Proxy(e,Um)}class Vm{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Tl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=_r-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Be!==this)return rf(this,!0),!0}get value(){const t=this.dep.track();return af(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function qm(e,t,n=!1){let s,r;return pe(e)?s=e:(s=e.get,r=e.set),new Vm(s,r,n)}const ri={},bi=new WeakMap;let is;function Wm(e,t=!1,n=is){if(n){let s=bi.get(n);s||bi.set(n,s=[]),s.push(e)}}function Km(e,t,n=$e){const{immediate:s,deep:r,once:o,scheduler:l,augmentJob:c,call:u}=n,h=H=>r?H:qt(H)||r===!1||r===0?En(H,1):En(H);let d,m,_,y,w=!1,S=!1;if(dt(e)?(m=()=>e.value,w=qt(e)):fs(e)?(m=()=>h(e),w=!0):re(e)?(S=!0,w=e.some(H=>fs(H)||qt(H)),m=()=>e.map(H=>{if(dt(H))return H.value;if(fs(H))return h(H);if(pe(H))return u?u(H,2):H()})):pe(e)?t?m=u?()=>u(e,2):e:m=()=>{if(_){Sn();try{_()}finally{Tn()}}const H=is;is=d;try{return u?u(e,3,[y]):e(y)}finally{is=H}}:m=hn,t&&r){const H=m,te=r===!0?1/0:r;m=()=>En(H(),te)}const x=vm(),D=()=>{d.stop(),x&&x.active&&vl(x.effects,d)};if(o&&t){const H=t;t=(...te)=>{H(...te),D()}}let F=S?new Array(e.length).fill(ri):ri;const $=H=>{if(!(!(d.flags&1)||!d.dirty&&!H))if(t){const te=d.run();if(r||w||(S?te.some((le,Z)=>Un(le,F[Z])):Un(te,F))){_&&_();const le=is;is=d;try{const Z=[te,F===ri?void 0:S&&F[0]===ri?[]:F,y];F=te,u?u(t,3,Z):t(...Z)}finally{is=le}}}else d.run()};return c&&c($),d=new nf(m),d.scheduler=l?()=>l($,!1):$,y=H=>Wm(H,!1,d),_=d.onStop=()=>{const H=bi.get(d);if(H){if(u)u(H,4);else for(const te of H)te();bi.delete(d)}},t?s?$(!0):F=d.run():l?l($.bind(null,!0),!0):d.run(),D.pause=d.pause.bind(d),D.resume=d.resume.bind(d),D.stop=D,D}function En(e,t=1/0,n){if(t<=0||!Me(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,dt(e))En(e.value,t,n);else if(re(e))for(let s=0;s{En(s,t,n)});else if(Yu(e)){for(const s in e)En(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&En(e[s],t,n)}return e}function Rr(e,t,n,s){try{return s?e(...s):e()}catch(r){Li(r,t,n)}}function Qt(e,t,n,s){if(pe(e)){const r=Rr(e,t,n,s);return r&&Ju(r)&&r.catch(o=>{Li(o,t,n)}),r}if(re(e)){const r=[];for(let o=0;o>>1,r=Et[s],o=yr(r);o=yr(n)?Et.push(e):Et.splice(Gm(t),0,e),e.flags|=1,wf()}}function wf(){yi||(yi=vf.then(Af))}function Jm(e){re(e)?Ms.push(...e):Fn&&e.id===-1?Fn.splice(Ns+1,0,e):e.flags&1||(Ms.push(e),e.flags|=1),wf()}function Rc(e,t,n=un+1){for(;nyr(n)-yr(s));if(Ms.length=0,Fn){Fn.push(...t);return}for(Fn=t,Ns=0;Nse.id==null?e.flags&2?-1:1/0:e.id;function Af(e){try{for(un=0;un{s._d&&Ai(-1);const o=vi(t);let l;try{l=e(...r)}finally{vi(o),s._d&&Ai(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function Io(e,t){if(lt===null)return e;const n=ji(lt),s=e.dirs||(e.dirs=[]);for(let r=0;r1)return n&&pe(t)?t.call(s&&s.proxy):t}}const Xm=Symbol.for("v-scx"),Ym=()=>Jt(Xm);function fr(e,t,n){return Sf(e,t,n)}function Sf(e,t,n=$e){const{immediate:s,deep:r,flush:o,once:l}=n,c=Ze({},n),u=t&&s||!t&&o!=="post";let h;if(Cr){if(o==="sync"){const y=Ym();h=y.__watcherHandles||(y.__watcherHandles=[])}else if(!u){const y=()=>{};return y.stop=hn,y.resume=hn,y.pause=hn,y}}const d=ut;c.call=(y,w,S)=>Qt(y,d,w,S);let m=!1;o==="post"?c.scheduler=y=>{yt(y,d&&d.suspense)}:o!=="sync"&&(m=!0,c.scheduler=(y,w)=>{w?y():Nl(y)}),c.augmentJob=y=>{t&&(y.flags|=4),m&&(y.flags|=2,d&&(y.id=d.uid,y.i=d))};const _=Km(e,t,c);return Cr&&(h?h.push(_):u&&_()),_}function Qm(e,t,n){const s=this.proxy,r=ze(e)?e.includes(".")?Tf(s,e):()=>s[e]:e.bind(s,s);let o;pe(t)?o=t:(o=t.handler,n=t);const l=Pr(this),c=Sf(r,o.bind(s),n);return l(),c}function Tf(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;re.__isTeleport,dr=e=>e&&(e.disabled||e.disabled===""),Pc=e=>e&&(e.defer||e.defer===""),Nc=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Ic=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Zo=(e,t)=>{const n=e&&e.to;return ze(n)?t?t(n):null:n},Of={name:"Teleport",__isTeleport:!0,process(e,t,n,s,r,o,l,c,u,h){const{mc:d,pc:m,pbc:_,o:{insert:y,querySelector:w,createText:S,createComment:x}}=h,D=dr(t.props);let{shapeFlag:F,children:$,dynamicChildren:H}=t;if(e==null){const te=t.el=S(""),le=t.anchor=S("");y(te,n,s),y(le,n,s);const Z=(z,fe)=>{F&16&&d($,z,fe,r,o,l,c,u)},B=()=>{const z=t.target=Zo(t.props,w),fe=Rf(z,t,S,y);z&&(l!=="svg"&&Nc(z)?l="svg":l!=="mathml"&&Ic(z)&&(l="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(z),D||(Z(z,fe),ui(t,!1)))};D&&(Z(n,le),ui(t,!0)),Pc(t.props)?(t.el.__isMounted=!1,yt(()=>{B(),delete t.el.__isMounted},o)):B()}else{if(Pc(t.props)&&e.el.__isMounted===!1){yt(()=>{Of.process(e,t,n,s,r,o,l,c,u,h)},o);return}t.el=e.el,t.targetStart=e.targetStart;const te=t.anchor=e.anchor,le=t.target=e.target,Z=t.targetAnchor=e.targetAnchor,B=dr(e.props),z=B?n:le,fe=B?te:Z;if(l==="svg"||Nc(le)?l="svg":(l==="mathml"||Ic(le))&&(l="mathml"),H?(_(e.dynamicChildren,H,z,r,o,l,c),Ml(e,t,!0)):u||m(e,t,z,fe,r,o,l,c,!1),D)B?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ii(t,n,te,h,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const _e=t.target=Zo(t.props,w);_e&&ii(t,_e,null,h,0)}else B&&ii(t,le,Z,h,1);ui(t,D)}},remove(e,t,n,{um:s,o:{remove:r}},o){const{shapeFlag:l,children:c,anchor:u,targetStart:h,targetAnchor:d,target:m,props:_}=e;if(m&&(r(h),r(d)),o&&r(u),l&16){const y=o||!dr(_);for(let w=0;w{e.isMounted=!0}),Il(()=>{e.isUnmounting=!0}),e}const Ut=[Function,Array],ng={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ut,onEnter:Ut,onAfterEnter:Ut,onEnterCancelled:Ut,onBeforeLeave:Ut,onLeave:Ut,onAfterLeave:Ut,onLeaveCancelled:Ut,onBeforeAppear:Ut,onAppear:Ut,onAfterAppear:Ut,onAppearCancelled:Ut};function sg(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function el(e,t,n,s,r){const{appear:o,mode:l,persisted:c=!1,onBeforeEnter:u,onEnter:h,onAfterEnter:d,onEnterCancelled:m,onBeforeLeave:_,onLeave:y,onAfterLeave:w,onLeaveCancelled:S,onBeforeAppear:x,onAppear:D,onAfterAppear:F,onAppearCancelled:$}=t,H=String(e.key),te=sg(n,e),le=(z,fe)=>{z&&Qt(z,s,9,fe)},Z=(z,fe)=>{const _e=fe[1];le(z,fe),re(z)?z.every(G=>G.length<=1)&&_e():z.length<=1&&_e()},B={mode:l,persisted:c,beforeEnter(z){let fe=u;if(!n.isMounted)if(o)fe=x||u;else return;z[os]&&z[os](!0);const _e=te[H];_e&&Is(e,_e)&&_e.el[os]&&_e.el[os](),le(fe,[z])},enter(z){let fe=h,_e=d,G=m;if(!n.isMounted)if(o)fe=D||h,_e=F||d,G=$||m;else return;let ye=!1;const Pe=z[oi]=Ye=>{ye||(ye=!0,Ye?le(G,[z]):le(_e,[z]),B.delayedLeave&&B.delayedLeave(),z[oi]=void 0)};fe?Z(fe,[z,Pe]):Pe()},leave(z,fe){const _e=String(e.key);if(z[oi]&&z[oi](!0),n.isUnmounting)return fe();le(_,[z]);let G=!1;const ye=z[os]=Pe=>{G||(G=!0,fe(),Pe?le(S,[z]):le(w,[z]),z[os]=void 0,te[_e]===e&&delete te[_e])};te[_e]=e,y?Z(y,[z,ye]):ye()},clone(z){return el(z,t,n,s)}};return B}function vr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,vr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Pf(e,t=!1,n){let s=[],r=0;for(let o=0;o1)for(let o=0;ohr(w,t&&(re(t)?t[S]:t),n,s,r));return}if(Fs(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&hr(e,t,n,s.component.subTree);return}const o=s.shapeFlag&4?ji(s.component):s.el,l=r?null:o,{i:c,r:u}=e,h=t&&t.r,d=c.refs===$e?c.refs={}:c.refs,m=c.setupState,_=xe(m),y=m===$e?Gu:w=>Re(_,w);if(h!=null&&h!==u){if(kc(t),ze(h))d[h]=null,y(h)&&(m[h]=null);else if(dt(h)){h.value=null;const w=t;w.k&&(d[w.k]=null)}}if(pe(u))Rr(u,c,12,[l,d]);else{const w=ze(u),S=dt(u);if(w||S){const x=()=>{if(e.f){const D=w?y(u)?m[u]:d[u]:u.value;if(r)re(D)&&vl(D,o);else if(re(D))D.includes(o)||D.push(o);else if(w)d[u]=[o],y(u)&&(m[u]=d[u]);else{const F=[o];u.value=F,e.k&&(d[e.k]=F)}}else w?(d[u]=l,y(u)&&(m[u]=l)):S&&(u.value=l,e.k&&(d[e.k]=l))};if(l){const D=()=>{x(),wi.delete(e)};D.id=-1,wi.set(e,D),yt(D,n)}else kc(e),x()}}}function kc(e){const t=wi.get(e);t&&(t.flags|=8,wi.delete(e))}Ni().requestIdleCallback;Ni().cancelIdleCallback;const Fs=e=>!!e.type.__asyncLoader,kf=e=>e.type.__isKeepAlive;function rg(e,t){Lf(e,"a",t)}function ig(e,t){Lf(e,"da",t)}function Lf(e,t,n=ut){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(Di(t,s,n),n){let r=n.parent;for(;r&&r.parent;)kf(r.parent.vnode)&&og(s,t,n,r),r=r.parent}}function og(e,t,n,s){const r=Di(t,e,s,!0);kl(()=>{vl(s[t],r)},n)}function Di(e,t,n=ut,s=!1){if(n){const r=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...l)=>{Sn();const c=Pr(n),u=Qt(t,n,e,l);return c(),Tn(),u});return s?r.unshift(o):r.push(o),o}}const On=e=>(t,n=ut)=>{(!Cr||e==="sp")&&Di(e,(...s)=>t(...s),n)},lg=On("bm"),Mi=On("m"),ag=On("bu"),Df=On("u"),Il=On("bum"),kl=On("um"),cg=On("sp"),ug=On("rtg"),fg=On("rtc");function dg(e,t=ut){Di("ec",e,t)}const hg="components";function Lc(e,t){return mg(hg,e,!0,t)||e}const pg=Symbol.for("v-ndc");function mg(e,t,n=!0,s=!1){const r=lt||ut;if(r){const o=r.type;{const c=e_(o,!1);if(c&&(c===t||c===Wt(t)||c===Ri(Wt(t))))return o}const l=Dc(r[e]||o[e],t)||Dc(r.appContext[e],t);return!l&&s?o:l}}function Dc(e,t){return e&&(e[t]||e[Wt(t)]||e[Ri(Wt(t))])}function gg(e,t,n,s){let r;const o=n,l=re(e);if(l||ze(e)){const c=l&&fs(e);let u=!1,h=!1;c&&(u=!qt(e),h=xn(e),e=ki(e)),r=new Array(e.length);for(let d=0,m=e.length;dt(c,u,void 0,o));else{const c=Object.keys(e);r=new Array(c.length);for(let u=0,h=c.length;u0;return t!=="default"&&(n.name=t),Ve(),Er(ot,null,[Ue("slot",n,s&&s())],h?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),Ve();const l=o&&Mf(o(n)),c=n.key||l&&l.key,u=Er(ot,{key:(c&&!Xt(c)?c:`_${t}`)+(!l&&s?"_fb":"")},l||(s?s():[]),l&&e._===1?64:-2);return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),o&&o._c&&(o._d=!0),u}function Mf(e){return e.some(t=>Ar(t)?!(t.type===pn||t.type===ot&&!Mf(t.children)):!0)?e:null}const tl=e=>e?ed(e)?ji(e):tl(e.parent):null,pr=Ze(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>tl(e.parent),$root:e=>tl(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>$f(e),$forceUpdate:e=>e.f||(e.f=()=>{Nl(e.update)}),$nextTick:e=>e.n||(e.n=Pl.bind(e.proxy)),$watch:e=>Qm.bind(e)}),ko=(e,t)=>e!==$e&&!e.__isScriptSetup&&Re(e,t),_g={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:o,accessCache:l,type:c,appContext:u}=e;if(t[0]!=="$"){const _=l[t];if(_!==void 0)switch(_){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return o[t]}else{if(ko(s,t))return l[t]=1,s[t];if(r!==$e&&Re(r,t))return l[t]=2,r[t];if(Re(o,t))return l[t]=3,o[t];if(n!==$e&&Re(n,t))return l[t]=4,n[t];nl&&(l[t]=0)}}const h=pr[t];let d,m;if(h)return t==="$attrs"&&ct(e.attrs,"get",""),h(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(n!==$e&&Re(n,t))return l[t]=4,n[t];if(m=u.config.globalProperties,Re(m,t))return m[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:o}=e;return ko(r,t)?(r[t]=n,!0):s!==$e&&Re(s,t)?(s[t]=n,!0):Re(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,props:o,type:l}},c){let u;return!!(n[c]||e!==$e&&c[0]!=="$"&&Re(e,c)||ko(t,c)||Re(o,c)||Re(s,c)||Re(pr,c)||Re(r.config.globalProperties,c)||(u=l.__cssModules)&&u[c])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Re(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Mc(e){return re(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let nl=!0;function bg(e){const t=$f(e),n=e.proxy,s=e.ctx;nl=!1,t.beforeCreate&&Fc(t.beforeCreate,e,"bc");const{data:r,computed:o,methods:l,watch:c,provide:u,inject:h,created:d,beforeMount:m,mounted:_,beforeUpdate:y,updated:w,activated:S,deactivated:x,beforeDestroy:D,beforeUnmount:F,destroyed:$,unmounted:H,render:te,renderTracked:le,renderTriggered:Z,errorCaptured:B,serverPrefetch:z,expose:fe,inheritAttrs:_e,components:G,directives:ye,filters:Pe}=t;if(h&&yg(h,s,null),l)for(const Ce in l){const de=l[Ce];pe(de)&&(s[Ce]=de.bind(n))}if(r){const Ce=r.call(n,n);Me(Ce)&&(e.data=gs(Ce))}if(nl=!0,o)for(const Ce in o){const de=o[Ce],Ct=pe(de)?de.bind(n,n):pe(de.get)?de.get.bind(n,n):hn,Rt=!pe(de)&&pe(de.set)?de.set.bind(n):hn,P=Vt({get:Ct,set:Rt});Object.defineProperty(s,Ce,{enumerable:!0,configurable:!0,get:()=>P.value,set:He=>P.value=He})}if(c)for(const Ce in c)Ff(c[Ce],s,n,Ce);if(u){const Ce=pe(u)?u.call(n):u;Reflect.ownKeys(Ce).forEach(de=>{ci(de,Ce[de])})}d&&Fc(d,e,"c");function Ee(Ce,de){re(de)?de.forEach(Ct=>Ce(Ct.bind(n))):de&&Ce(de.bind(n))}if(Ee(lg,m),Ee(Mi,_),Ee(ag,y),Ee(Df,w),Ee(rg,S),Ee(ig,x),Ee(dg,B),Ee(fg,le),Ee(ug,Z),Ee(Il,F),Ee(kl,H),Ee(cg,z),re(fe))if(fe.length){const Ce=e.exposed||(e.exposed={});fe.forEach(de=>{Object.defineProperty(Ce,de,{get:()=>n[de],set:Ct=>n[de]=Ct,enumerable:!0})})}else e.exposed||(e.exposed={});te&&e.render===hn&&(e.render=te),_e!=null&&(e.inheritAttrs=_e),G&&(e.components=G),ye&&(e.directives=ye),z&&If(e)}function yg(e,t,n=hn){re(e)&&(e=sl(e));for(const s in e){const r=e[s];let o;Me(r)?"default"in r?o=Jt(r.from||s,r.default,!0):o=Jt(r.from||s):o=Jt(r),dt(o)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>o.value,set:l=>o.value=l}):t[s]=o}}function Fc(e,t,n){Qt(re(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ff(e,t,n,s){let r=s.includes(".")?Tf(n,s):()=>n[s];if(ze(e)){const o=t[e];pe(o)&&fr(r,o)}else if(pe(e))fr(r,e.bind(n));else if(Me(e))if(re(e))e.forEach(o=>Ff(o,t,n,s));else{const o=pe(e.handler)?e.handler.bind(n):t[e.handler];pe(o)&&fr(r,o,e)}}function $f(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:o,config:{optionMergeStrategies:l}}=e.appContext,c=o.get(t);let u;return c?u=c:!r.length&&!n&&!s?u=t:(u={},r.length&&r.forEach(h=>Ei(u,h,l,!0)),Ei(u,t,l)),Me(t)&&o.set(t,u),u}function Ei(e,t,n,s=!1){const{mixins:r,extends:o}=t;o&&Ei(e,o,n,!0),r&&r.forEach(l=>Ei(e,l,n,!0));for(const l in t)if(!(s&&l==="expose")){const c=vg[l]||n&&n[l];e[l]=c?c(e[l],t[l]):t[l]}return e}const vg={data:$c,props:jc,emits:jc,methods:ir,computed:ir,beforeCreate:bt,created:bt,beforeMount:bt,mounted:bt,beforeUpdate:bt,updated:bt,beforeDestroy:bt,beforeUnmount:bt,destroyed:bt,unmounted:bt,activated:bt,deactivated:bt,errorCaptured:bt,serverPrefetch:bt,components:ir,directives:ir,watch:Eg,provide:$c,inject:wg};function $c(e,t){return t?e?function(){return Ze(pe(e)?e.call(this,this):e,pe(t)?t.call(this,this):t)}:t:e}function wg(e,t){return ir(sl(e),sl(t))}function sl(e){if(re(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Wt(t)}Modifiers`]||e[`${qn(t)}Modifiers`];function Tg(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||$e;let r=n;const o=t.startsWith("update:"),l=o&&Sg(s,t.slice(7));l&&(l.trim&&(r=n.map(d=>ze(d)?d.trim():d)),l.number&&(r=n.map(Pi)));let c,u=s[c=xo(t)]||s[c=xo(Wt(t))];!u&&o&&(u=s[c=xo(qn(t))]),u&&Qt(u,e,6,r);const h=s[c+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,Qt(h,e,6,r)}}const xg=new WeakMap;function Bf(e,t,n=!1){const s=n?xg:t.emitsCache,r=s.get(e);if(r!==void 0)return r;const o=e.emits;let l={},c=!1;if(!pe(e)){const u=h=>{const d=Bf(h,t,!0);d&&(c=!0,Ze(l,d))};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!o&&!c?(Me(e)&&s.set(e,null),null):(re(o)?o.forEach(u=>l[u]=null):Ze(l,o),Me(e)&&s.set(e,l),l)}function Fi(e,t){return!e||!xi(t)?!1:(t=t.slice(2).replace(/Once$/,""),Re(e,t[0].toLowerCase()+t.slice(1))||Re(e,qn(t))||Re(e,t))}function Bc(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[o],slots:l,attrs:c,emit:u,render:h,renderCache:d,props:m,data:_,setupState:y,ctx:w,inheritAttrs:S}=e,x=vi(e);let D,F;try{if(n.shapeFlag&4){const H=r||s,te=H;D=dn(h.call(te,H,d,m,y,_,w)),F=c}else{const H=t;D=dn(H.length>1?H(m,{attrs:c,slots:l,emit:u}):H(m,null)),F=t.props?c:Og(c)}}catch(H){mr.length=0,Li(H,e,1),D=Ue(pn)}let $=D;if(F&&S!==!1){const H=Object.keys(F),{shapeFlag:te}=$;H.length&&te&7&&(o&&H.some(yl)&&(F=Rg(F,o)),$=hs($,F,!1,!0))}return n.dirs&&($=hs($,null,!1,!0),$.dirs=$.dirs?$.dirs.concat(n.dirs):n.dirs),n.transition&&vr($,n.transition),D=$,vi(x),D}const Og=e=>{let t;for(const n in e)(n==="class"||n==="style"||xi(n))&&((t||(t={}))[n]=e[n]);return t},Rg=(e,t)=>{const n={};for(const s in e)(!yl(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Pg(e,t,n){const{props:s,children:r,component:o}=e,{props:l,children:c,patchFlag:u}=t,h=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return s?Hc(s,l,h):!!l;if(u&8){const d=t.dynamicProps;for(let m=0;mObject.create(Hf),Vf=e=>Object.getPrototypeOf(e)===Hf;function Ig(e,t,n,s=!1){const r={},o=Uf();e.propsDefaults=Object.create(null),qf(e,t,r,o);for(const l in e.propsOptions[0])l in r||(r[l]=void 0);n?e.props=s?r:_f(r):e.type.props?e.props=r:e.props=o,e.attrs=o}function kg(e,t,n,s){const{props:r,attrs:o,vnode:{patchFlag:l}}=e,c=xe(r),[u]=e.propsOptions;let h=!1;if((s||l>0)&&!(l&16)){if(l&8){const d=e.vnode.dynamicProps;for(let m=0;m{u=!0;const[_,y]=Wf(m,t,!0);Ze(l,_),y&&c.push(...y)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!o&&!u)return Me(e)&&s.set(e,Ls),Ls;if(re(o))for(let d=0;de==="_"||e==="_ctx"||e==="$stable",Dl=e=>re(e)?e.map(dn):[dn(e)],Dg=(e,t,n)=>{if(t._n)return t;const s=fn((...r)=>Dl(t(...r)),n);return s._c=!1,s},Kf=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Ll(r))continue;const o=e[r];if(pe(o))t[r]=Dg(r,o,s);else if(o!=null){const l=Dl(o);t[r]=()=>l}}},zf=(e,t)=>{const n=Dl(t);e.slots.default=()=>n},Gf=(e,t,n)=>{for(const s in t)(n||!Ll(s))&&(e[s]=t[s])},Mg=(e,t,n)=>{const s=e.slots=Uf();if(e.vnode.shapeFlag&32){const r=t._;r?(Gf(s,t,n),n&&Qu(s,"_",r,!0)):Kf(t,s)}else t&&zf(e,t)},Fg=(e,t,n)=>{const{vnode:s,slots:r}=e;let o=!0,l=$e;if(s.shapeFlag&32){const c=t._;c?n&&c===1?o=!1:Gf(r,t,n):(o=!t.$stable,Kf(t,r)),l=t}else t&&(zf(e,t),l={default:1});if(o)for(const c in r)!Ll(c)&&l[c]==null&&delete r[c]},yt=Ug;function $g(e){return jg(e)}function jg(e,t){const n=Ni();n.__VUE__=!0;const{insert:s,remove:r,patchProp:o,createElement:l,createText:c,createComment:u,setText:h,setElementText:d,parentNode:m,nextSibling:_,setScopeId:y=hn,insertStaticContent:w}=e,S=(g,b,A,I=null,k=null,N=null,W=void 0,q=null,U=!!b.dynamicChildren)=>{if(g===b)return;g&&!Is(g,b)&&(I=R(g),He(g,k,N,!0),g=null),b.patchFlag===-2&&(U=!1,b.dynamicChildren=null);const{type:M,ref:se,shapeFlag:J}=b;switch(M){case $i:x(g,b,A,I);break;case pn:D(g,b,A,I);break;case fi:g==null&&F(b,A,I,W);break;case ot:G(g,b,A,I,k,N,W,q,U);break;default:J&1?te(g,b,A,I,k,N,W,q,U):J&6?ye(g,b,A,I,k,N,W,q,U):(J&64||J&128)&&M.process(g,b,A,I,k,N,W,q,U,ee)}se!=null&&k?hr(se,g&&g.ref,N,b||g,!b):se==null&&g&&g.ref!=null&&hr(g.ref,null,N,g,!0)},x=(g,b,A,I)=>{if(g==null)s(b.el=c(b.children),A,I);else{const k=b.el=g.el;b.children!==g.children&&h(k,b.children)}},D=(g,b,A,I)=>{g==null?s(b.el=u(b.children||""),A,I):b.el=g.el},F=(g,b,A,I)=>{[g.el,g.anchor]=w(g.children,b,A,I,g.el,g.anchor)},$=({el:g,anchor:b},A,I)=>{let k;for(;g&&g!==b;)k=_(g),s(g,A,I),g=k;s(b,A,I)},H=({el:g,anchor:b})=>{let A;for(;g&&g!==b;)A=_(g),r(g),g=A;r(b)},te=(g,b,A,I,k,N,W,q,U)=>{if(b.type==="svg"?W="svg":b.type==="math"&&(W="mathml"),g==null)le(b,A,I,k,N,W,q,U);else{const M=g.el&&g.el._isVueCE?g.el:null;try{M&&M._beginPatch(),z(g,b,k,N,W,q,U)}finally{M&&M._endPatch()}}},le=(g,b,A,I,k,N,W,q)=>{let U,M;const{props:se,shapeFlag:J,transition:ne,dirs:ie}=g;if(U=g.el=l(g.type,N,se&&se.is,se),J&8?d(U,g.children):J&16&&B(g.children,U,null,I,k,Lo(g,N),W,q),ie&&ns(g,null,I,"created"),Z(U,g,g.scopeId,W,I),se){for(const Ne in se)Ne!=="value"&&!ar(Ne)&&o(U,Ne,null,se[Ne],N,I);"value"in se&&o(U,"value",null,se.value,N),(M=se.onVnodeBeforeMount)&&ln(M,I,g)}ie&&ns(g,null,I,"beforeMount");const he=Bg(k,ne);he&&ne.beforeEnter(U),s(U,b,A),((M=se&&se.onVnodeMounted)||he||ie)&&yt(()=>{M&&ln(M,I,g),he&&ne.enter(U),ie&&ns(g,null,I,"mounted")},k)},Z=(g,b,A,I,k)=>{if(A&&y(g,A),I)for(let N=0;N{for(let M=U;M{const q=b.el=g.el;let{patchFlag:U,dynamicChildren:M,dirs:se}=b;U|=g.patchFlag&16;const J=g.props||$e,ne=b.props||$e;let ie;if(A&&ss(A,!1),(ie=ne.onVnodeBeforeUpdate)&&ln(ie,A,b,g),se&&ns(b,g,A,"beforeUpdate"),A&&ss(A,!0),(J.innerHTML&&ne.innerHTML==null||J.textContent&&ne.textContent==null)&&d(q,""),M?fe(g.dynamicChildren,M,q,A,I,Lo(b,k),N):W||de(g,b,q,null,A,I,Lo(b,k),N,!1),U>0){if(U&16)_e(q,J,ne,A,k);else if(U&2&&J.class!==ne.class&&o(q,"class",null,ne.class,k),U&4&&o(q,"style",J.style,ne.style,k),U&8){const he=b.dynamicProps;for(let Ne=0;Ne{ie&&ln(ie,A,b,g),se&&ns(b,g,A,"updated")},I)},fe=(g,b,A,I,k,N,W)=>{for(let q=0;q{if(b!==A){if(b!==$e)for(const N in b)!ar(N)&&!(N in A)&&o(g,N,b[N],null,k,I);for(const N in A){if(ar(N))continue;const W=A[N],q=b[N];W!==q&&N!=="value"&&o(g,N,q,W,k,I)}"value"in A&&o(g,"value",b.value,A.value,k)}},G=(g,b,A,I,k,N,W,q,U)=>{const M=b.el=g?g.el:c(""),se=b.anchor=g?g.anchor:c("");let{patchFlag:J,dynamicChildren:ne,slotScopeIds:ie}=b;ie&&(q=q?q.concat(ie):ie),g==null?(s(M,A,I),s(se,A,I),B(b.children||[],A,se,k,N,W,q,U)):J>0&&J&64&&ne&&g.dynamicChildren&&g.dynamicChildren.length===ne.length?(fe(g.dynamicChildren,ne,A,k,N,W,q),(b.key!=null||k&&b===k.subTree)&&Ml(g,b,!0)):de(g,b,A,se,k,N,W,q,U)},ye=(g,b,A,I,k,N,W,q,U)=>{b.slotScopeIds=q,g==null?b.shapeFlag&512?k.ctx.activate(b,A,I,W,U):Pe(b,A,I,k,N,W,U):Ye(g,b,U)},Pe=(g,b,A,I,k,N,W)=>{const q=g.component=Jg(g,I,k);if(kf(g)&&(q.ctx.renderer=ee),Xg(q,!1,W),q.asyncDep){if(k&&k.registerDep(q,Ee,W),!g.el){const U=q.subTree=Ue(pn);D(null,U,b,A),g.placeholder=U.el}}else Ee(q,g,b,A,k,N,W)},Ye=(g,b,A)=>{const I=b.component=g.component;if(Pg(g,b,A))if(I.asyncDep&&!I.asyncResolved){Ce(I,b,A);return}else I.next=b,I.update();else b.el=g.el,I.vnode=b},Ee=(g,b,A,I,k,N,W)=>{const q=()=>{if(g.isMounted){let{next:J,bu:ne,u:ie,parent:he,vnode:Ne}=g;{const rt=Jf(g);if(rt){J&&(J.el=Ne.el,Ce(g,J,W)),rt.asyncDep.then(()=>{g.isUnmounted||q()});return}}let Se=J,at;ss(g,!1),J?(J.el=Ne.el,Ce(g,J,W)):J=Ne,ne&&ai(ne),(at=J.props&&J.props.onVnodeBeforeUpdate)&&ln(at,he,J,Ne),ss(g,!0);const Xe=Bc(g),st=g.subTree;g.subTree=Xe,S(st,Xe,m(st.el),R(st),g,k,N),J.el=Xe.el,Se===null&&Ng(g,Xe.el),ie&&yt(ie,k),(at=J.props&&J.props.onVnodeUpdated)&&yt(()=>ln(at,he,J,Ne),k)}else{let J;const{el:ne,props:ie}=b,{bm:he,m:Ne,parent:Se,root:at,type:Xe}=g,st=Fs(b);ss(g,!1),he&&ai(he),!st&&(J=ie&&ie.onVnodeBeforeMount)&&ln(J,Se,b),ss(g,!0);{at.ce&&at.ce._def.shadowRoot!==!1&&at.ce._injectChildStyle(Xe);const rt=g.subTree=Bc(g);S(null,rt,A,I,g,k,N),b.el=rt.el}if(Ne&&yt(Ne,k),!st&&(J=ie&&ie.onVnodeMounted)){const rt=b;yt(()=>ln(J,Se,rt),k)}(b.shapeFlag&256||Se&&Fs(Se.vnode)&&Se.vnode.shapeFlag&256)&&g.a&&yt(g.a,k),g.isMounted=!0,b=A=I=null}};g.scope.on();const U=g.effect=new nf(q);g.scope.off();const M=g.update=U.run.bind(U),se=g.job=U.runIfDirty.bind(U);se.i=g,se.id=g.uid,U.scheduler=()=>Nl(se),ss(g,!0),M()},Ce=(g,b,A)=>{b.component=g;const I=g.vnode.props;g.vnode=b,g.next=null,kg(g,b.props,I,A),Fg(g,b.children,A),Sn(),Rc(g),Tn()},de=(g,b,A,I,k,N,W,q,U=!1)=>{const M=g&&g.children,se=g?g.shapeFlag:0,J=b.children,{patchFlag:ne,shapeFlag:ie}=b;if(ne>0){if(ne&128){Rt(M,J,A,I,k,N,W,q,U);return}else if(ne&256){Ct(M,J,A,I,k,N,W,q,U);return}}ie&8?(se&16&&et(M,k,N),J!==M&&d(A,J)):se&16?ie&16?Rt(M,J,A,I,k,N,W,q,U):et(M,k,N,!0):(se&8&&d(A,""),ie&16&&B(J,A,I,k,N,W,q,U))},Ct=(g,b,A,I,k,N,W,q,U)=>{g=g||Ls,b=b||Ls;const M=g.length,se=b.length,J=Math.min(M,se);let ne;for(ne=0;nese?et(g,k,N,!0,!1,J):B(b,A,I,k,N,W,q,U,J)},Rt=(g,b,A,I,k,N,W,q,U)=>{let M=0;const se=b.length;let J=g.length-1,ne=se-1;for(;M<=J&&M<=ne;){const ie=g[M],he=b[M]=U?$n(b[M]):dn(b[M]);if(Is(ie,he))S(ie,he,A,null,k,N,W,q,U);else break;M++}for(;M<=J&&M<=ne;){const ie=g[J],he=b[ne]=U?$n(b[ne]):dn(b[ne]);if(Is(ie,he))S(ie,he,A,null,k,N,W,q,U);else break;J--,ne--}if(M>J){if(M<=ne){const ie=ne+1,he=iene)for(;M<=J;)He(g[M],k,N,!0),M++;else{const ie=M,he=M,Ne=new Map;for(M=he;M<=ne;M++){const it=b[M]=U?$n(b[M]):dn(b[M]);it.key!=null&&Ne.set(it.key,M)}let Se,at=0;const Xe=ne-he+1;let st=!1,rt=0;const tn=new Array(Xe);for(M=0;M=Xe){He(it,k,N,!0);continue}let Mt;if(it.key!=null)Mt=Ne.get(it.key);else for(Se=he;Se<=ne;Se++)if(tn[Se-he]===0&&Is(it,b[Se])){Mt=Se;break}Mt===void 0?He(it,k,N,!0):(tn[Mt-he]=M+1,Mt>=rt?rt=Mt:st=!0,S(it,b[Mt],A,null,k,N,W,q,U),at++)}const Dr=st?Hg(tn):Ls;for(Se=Dr.length-1,M=Xe-1;M>=0;M--){const it=he+M,Mt=b[it],Mr=b[it+1],Fr=it+1{const{el:N,type:W,transition:q,children:U,shapeFlag:M}=g;if(M&6){P(g.component.subTree,b,A,I);return}if(M&128){g.suspense.move(b,A,I);return}if(M&64){W.move(g,b,A,ee);return}if(W===ot){s(N,b,A);for(let J=0;Jq.enter(N),k);else{const{leave:J,delayLeave:ne,afterLeave:ie}=q,he=()=>{g.ctx.isUnmounted?r(N):s(N,b,A)},Ne=()=>{N._isLeaving&&N[os](!0),J(N,()=>{he(),ie&&ie()})};ne?ne(N,he,Ne):Ne()}else s(N,b,A)},He=(g,b,A,I=!1,k=!1)=>{const{type:N,props:W,ref:q,children:U,dynamicChildren:M,shapeFlag:se,patchFlag:J,dirs:ne,cacheIndex:ie}=g;if(J===-2&&(k=!1),q!=null&&(Sn(),hr(q,null,A,g,!0),Tn()),ie!=null&&(b.renderCache[ie]=void 0),se&256){b.ctx.deactivate(g);return}const he=se&1&&ne,Ne=!Fs(g);let Se;if(Ne&&(Se=W&&W.onVnodeBeforeUnmount)&&ln(Se,b,g),se&6)Je(g.component,A,I);else{if(se&128){g.suspense.unmount(A,I);return}he&&ns(g,null,b,"beforeUnmount"),se&64?g.type.remove(g,b,A,ee,I):M&&!M.hasOnce&&(N!==ot||J>0&&J&64)?et(M,b,A,!1,!0):(N===ot&&J&384||!k&&se&16)&&et(U,b,A),I&&Pt(g)}(Ne&&(Se=W&&W.onVnodeUnmounted)||he)&&yt(()=>{Se&&ln(Se,b,g),he&&ns(g,null,b,"unmounted")},A)},Pt=g=>{const{type:b,el:A,anchor:I,transition:k}=g;if(b===ot){ht(A,I);return}if(b===fi){H(g);return}const N=()=>{r(A),k&&!k.persisted&&k.afterLeave&&k.afterLeave()};if(g.shapeFlag&1&&k&&!k.persisted){const{leave:W,delayLeave:q}=k,U=()=>W(A,N);q?q(g.el,N,U):U()}else N()},ht=(g,b)=>{let A;for(;g!==b;)A=_(g),r(g),g=A;r(b)},Je=(g,b,A)=>{const{bum:I,scope:k,job:N,subTree:W,um:q,m:U,a:M}=g;Vc(U),Vc(M),I&&ai(I),k.stop(),N&&(N.flags|=8,He(W,g,b,A)),q&&yt(q,b),yt(()=>{g.isUnmounted=!0},b)},et=(g,b,A,I=!1,k=!1,N=0)=>{for(let W=N;W{if(g.shapeFlag&6)return R(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const b=_(g.anchor||g.el),A=b&&b[xf];return A?_(A):b};let X=!1;const O=(g,b,A)=>{let I;g==null?b._vnode&&(He(b._vnode,null,null,!0),I=b._vnode.component):S(b._vnode||null,g,b,null,null,null,A),b._vnode=g,X||(X=!0,Rc(I),Ef(),X=!1)},ee={p:S,um:He,m:P,r:Pt,mt:Pe,mc:B,pc:de,pbc:fe,n:R,o:e};return{render:O,hydrate:void 0,createApp:Cg(O)}}function Lo({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function ss({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Bg(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ml(e,t,n=!1){const s=e.children,r=t.children;if(re(s)&&re(r))for(let o=0;o>1,e[n[c]]0&&(t[s]=n[o-1]),n[o]=s)}}for(o=n.length,l=n[o-1];o-- >0;)n[o]=l,l=t[l];return n}function Jf(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Jf(t)}function Vc(e){if(e)for(let t=0;te.__isSuspense;function Ug(e,t){t&&t.pendingBranch?re(e)?t.effects.push(...e):t.effects.push(e):Jm(e)}const ot=Symbol.for("v-fgt"),$i=Symbol.for("v-txt"),pn=Symbol.for("v-cmt"),fi=Symbol.for("v-stc"),mr=[];let Dt=null;function Ve(e=!1){mr.push(Dt=e?null:[])}function Vg(){mr.pop(),Dt=mr[mr.length-1]||null}let wr=1;function Ai(e,t=!1){wr+=e,e<0&&Dt&&t&&(Dt.hasOnce=!0)}function Qf(e){return e.dynamicChildren=wr>0?Dt||Ls:null,Vg(),wr>0&&Dt&&Dt.push(e),e}function nt(e,t,n,s,r,o){return Qf(j(e,t,n,s,r,o,!0))}function Er(e,t,n,s,r){return Qf(Ue(e,t,n,s,r,!0))}function Ar(e){return e?e.__v_isVNode===!0:!1}function Is(e,t){return e.type===t.type&&e.key===t.key}const Zf=({key:e})=>e??null,di=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ze(e)||dt(e)||pe(e)?{i:lt,r:e,k:t,f:!!n}:e:null);function j(e,t=null,n=null,s=0,r=null,o=e===ot?0:1,l=!1,c=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Zf(t),ref:t&&di(t),scopeId:Cf,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:lt};return c?(Fl(u,n),o&128&&e.normalize(u)):n&&(u.shapeFlag|=ze(n)?8:16),wr>0&&!l&&Dt&&(u.patchFlag>0||o&6)&&u.patchFlag!==32&&Dt.push(u),u}const Ue=qg;function qg(e,t=null,n=null,s=0,r=null,o=!1){if((!e||e===pg)&&(e=pn),Ar(e)){const c=hs(e,t,!0);return n&&Fl(c,n),wr>0&&!o&&Dt&&(c.shapeFlag&6?Dt[Dt.indexOf(e)]=c:Dt.push(c)),c.patchFlag=-2,c}if(t_(e)&&(e=e.__vccOpts),t){t=Wg(t);let{class:c,style:u}=t;c&&!ze(c)&&(t.class=An(c)),Me(u)&&(Rl(u)&&!re(u)&&(u=Ze({},u)),t.style=Ii(u))}const l=ze(e)?1:Yf(e)?128:Zm(e)?64:Me(e)?4:pe(e)?2:0;return j(e,t,n,s,r,l,o,!0)}function Wg(e){return e?Rl(e)||Vf(e)?Ze({},e):e:null}function hs(e,t,n=!1,s=!1){const{props:r,ref:o,patchFlag:l,children:c,transition:u}=e,h=t?Kg(r||{},t):r,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&Zf(h),ref:t&&t.ref?n&&o?re(o)?o.concat(di(t)):[o,di(t)]:di(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ot?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&hs(e.ssContent),ssFallback:e.ssFallback&&hs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&s&&vr(d,u.clone(d)),d}function vt(e=" ",t=0){return Ue($i,null,e,t)}function Ow(e,t){const n=Ue(fi,null,e);return n.staticCount=t,n}function Hn(e="",t=!1){return t?(Ve(),Er(pn,null,e)):Ue(pn,null,e)}function dn(e){return e==null||typeof e=="boolean"?Ue(pn):re(e)?Ue(ot,null,e.slice()):Ar(e)?$n(e):Ue($i,null,String(e))}function $n(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:hs(e)}function Fl(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(re(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),Fl(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Vf(t)?t._ctx=lt:r===3&<&&(lt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else pe(t)?(t={default:t,_ctx:lt},n=32):(t=String(t),s&64?(n=16,t=[vt(t)]):n=8);e.children=t,e.shapeFlag|=n}function Kg(...e){const t={};for(let n=0;nut||lt;let Ci,il;{const e=Ni(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),o=>{r.length>1?r.forEach(l=>l(o)):r[0](o)}};Ci=t("__VUE_INSTANCE_SETTERS__",n=>ut=n),il=t("__VUE_SSR_SETTERS__",n=>Cr=n)}const Pr=e=>{const t=ut;return Ci(e),e.scope.on(),()=>{e.scope.off(),Ci(t)}},qc=()=>{ut&&ut.scope.off(),Ci(null)};function ed(e){return e.vnode.shapeFlag&4}let Cr=!1;function Xg(e,t=!1,n=!1){t&&il(t);const{props:s,children:r}=e.vnode,o=ed(e);Ig(e,s,o,t),Mg(e,r,n||t);const l=o?Yg(e,t):void 0;return t&&il(!1),l}function Yg(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,_g);const{setup:s}=n;if(s){Sn();const r=e.setupContext=s.length>1?Zg(e):null,o=Pr(e),l=Rr(s,e,0,[e.props,r]),c=Ju(l);if(Tn(),o(),(c||e.sp)&&!Fs(e)&&If(e),c){if(l.then(qc,qc),t)return l.then(u=>{Wc(e,u)}).catch(u=>{Li(u,e,0)});e.asyncDep=l}else Wc(e,l)}else td(e)}function Wc(e,t,n){pe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Me(t)&&(e.setupState=yf(t)),td(e)}function td(e,t,n){const s=e.type;e.render||(e.render=s.render||hn);{const r=Pr(e);Sn();try{bg(e)}finally{Tn(),r()}}}const Qg={get(e,t){return ct(e,"get",""),e[t]}};function Zg(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Qg),slots:e.slots,emit:e.emit,expose:t}}function ji(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(yf(jm(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in pr)return pr[n](e)},has(t,n){return n in t||n in pr}})):e.proxy}function e_(e,t=!0){return pe(e)?e.displayName||e.name:e.name||t&&e.__name}function t_(e){return pe(e)&&"__vccOpts"in e}const Vt=(e,t)=>qm(e,t,Cr);function nd(e,t,n){try{Ai(-1);const s=arguments.length;return s===2?Me(t)&&!re(t)?Ar(t)?Ue(e,null,[t]):Ue(e,t):Ue(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Ar(n)&&(n=[n]),Ue(e,t,n))}finally{Ai(1)}}const n_="3.5.26";let ol;const Kc=typeof window<"u"&&window.trustedTypes;if(Kc)try{ol=Kc.createPolicy("vue",{createHTML:e=>e})}catch{}const sd=ol?e=>ol.createHTML(e):e=>e,s_="http://www.w3.org/2000/svg",r_="http://www.w3.org/1998/Math/MathML",vn=typeof document<"u"?document:null,zc=vn&&vn.createElement("template"),i_={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?vn.createElementNS(s_,e):t==="mathml"?vn.createElementNS(r_,e):n?vn.createElement(e,{is:n}):vn.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>vn.createTextNode(e),createComment:e=>vn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>vn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const l=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{zc.innerHTML=sd(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const c=zc.content;if(s==="svg"||s==="mathml"){const u=c.firstChild;for(;u.firstChild;)c.appendChild(u.firstChild);c.removeChild(u)}t.insertBefore(c,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},In="transition",nr="animation",Bs=Symbol("_vtc"),rd={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},o_=Ze({},ng,rd),rs=(e,t=[])=>{re(e)?e.forEach(n=>n(...t)):e&&e(...t)},Gc=e=>e?re(e)?e.some(t=>t.length>1):e.length>1:!1;function l_(e){const t={};for(const G in e)G in rd||(t[G]=e[G]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:o=`${n}-enter-from`,enterActiveClass:l=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:u=o,appearActiveClass:h=l,appearToClass:d=c,leaveFromClass:m=`${n}-leave-from`,leaveActiveClass:_=`${n}-leave-active`,leaveToClass:y=`${n}-leave-to`}=e,w=a_(r),S=w&&w[0],x=w&&w[1],{onBeforeEnter:D,onEnter:F,onEnterCancelled:$,onLeave:H,onLeaveCancelled:te,onBeforeAppear:le=D,onAppear:Z=F,onAppearCancelled:B=$}=t,z=(G,ye,Pe,Ye)=>{G._enterCancelled=Ye,Dn(G,ye?d:c),Dn(G,ye?h:l),Pe&&Pe()},fe=(G,ye)=>{G._isLeaving=!1,Dn(G,m),Dn(G,y),Dn(G,_),ye&&ye()},_e=G=>(ye,Pe)=>{const Ye=G?Z:F,Ee=()=>z(ye,G,Pe);rs(Ye,[ye,Ee]),Jc(()=>{Dn(ye,G?u:o),cn(ye,G?d:c),Gc(Ye)||Xc(ye,s,S,Ee)})};return Ze(t,{onBeforeEnter(G){rs(D,[G]),cn(G,o),cn(G,l)},onBeforeAppear(G){rs(le,[G]),cn(G,u),cn(G,h)},onEnter:_e(!1),onAppear:_e(!0),onLeave(G,ye){G._isLeaving=!0;const Pe=()=>fe(G,ye);cn(G,m),G._enterCancelled?(cn(G,_),ll(G)):(ll(G),cn(G,_)),Jc(()=>{G._isLeaving&&(Dn(G,m),cn(G,y),Gc(H)||Xc(G,s,x,Pe))}),rs(H,[G,Pe])},onEnterCancelled(G){z(G,!1,void 0,!0),rs($,[G])},onAppearCancelled(G){z(G,!0,void 0,!0),rs(B,[G])},onLeaveCancelled(G){fe(G),rs(te,[G])}})}function a_(e){if(e==null)return null;if(Me(e))return[Do(e.enter),Do(e.leave)];{const t=Do(e);return[t,t]}}function Do(e){return fm(e)}function cn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Bs]||(e[Bs]=new Set)).add(t)}function Dn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Bs];n&&(n.delete(t),n.size||(e[Bs]=void 0))}function Jc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let c_=0;function Xc(e,t,n,s){const r=e._endId=++c_,o=()=>{r===e._endId&&s()};if(n!=null)return setTimeout(o,n);const{type:l,timeout:c,propCount:u}=id(e,t);if(!l)return s();const h=l+"end";let d=0;const m=()=>{e.removeEventListener(h,_),o()},_=y=>{y.target===e&&++d>=u&&m()};setTimeout(()=>{d(n[w]||"").split(", "),r=s(`${In}Delay`),o=s(`${In}Duration`),l=Yc(r,o),c=s(`${nr}Delay`),u=s(`${nr}Duration`),h=Yc(c,u);let d=null,m=0,_=0;t===In?l>0&&(d=In,m=l,_=o.length):t===nr?h>0&&(d=nr,m=h,_=u.length):(m=Math.max(l,h),d=m>0?l>h?In:nr:null,_=d?d===In?o.length:u.length:0);const y=d===In&&/\b(?:transform|all)(?:,|$)/.test(s(`${In}Property`).toString());return{type:d,timeout:m,propCount:_,hasTransform:y}}function Yc(e,t){for(;e.lengthQc(n)+Qc(e[s])))}function Qc(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ll(e){return(e?e.ownerDocument:document).body.offsetHeight}function u_(e,t,n){const s=e[Bs];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Zc=Symbol("_vod"),f_=Symbol("_vsh"),d_=Symbol(""),h_=/(?:^|;)\s*display\s*:/;function p_(e,t,n){const s=e.style,r=ze(n);let o=!1;if(n&&!r){if(t)if(ze(t))for(const l of t.split(";")){const c=l.slice(0,l.indexOf(":")).trim();n[c]==null&&hi(s,c,"")}else for(const l in t)n[l]==null&&hi(s,l,"");for(const l in n)l==="display"&&(o=!0),hi(s,l,n[l])}else if(r){if(t!==n){const l=s[d_];l&&(n+=";"+l),s.cssText=n,o=h_.test(n)}}else t&&e.removeAttribute("style");Zc in e&&(e[Zc]=o?s.display:"",e[f_]&&(s.display="none"))}const eu=/\s*!important$/;function hi(e,t,n){if(re(n))n.forEach(s=>hi(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=m_(e,t);eu.test(n)?e.setProperty(qn(s),n.replace(eu,""),"important"):e[s]=n}}const tu=["Webkit","Moz","ms"],Mo={};function m_(e,t){const n=Mo[t];if(n)return n;let s=Wt(t);if(s!=="filter"&&s in e)return Mo[t]=s;s=Ri(s);for(let r=0;rFo||(y_.then(()=>Fo=0),Fo=Date.now());function w_(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Qt(E_(s,n.value),t,5,[s])};return n.value=e,n.attached=v_(),n}function E_(e,t){if(re(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const lu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,A_=(e,t,n,s,r,o)=>{const l=r==="svg";t==="class"?u_(e,s,l):t==="style"?p_(e,n,s):xi(t)?yl(t)||__(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):C_(e,t,s,l))?(ru(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&su(e,t,s,l,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!ze(s))?ru(e,Wt(t),s,o,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),su(e,t,s,l))};function C_(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&lu(t)&&pe(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return lu(t)&&ze(n)?!1:t in e}const od=new WeakMap,ld=new WeakMap,Si=Symbol("_moveCb"),au=Symbol("_enterCb"),S_=e=>(delete e.props.mode,e),T_=S_({name:"TransitionGroup",props:Ze({},o_,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=$l(),s=tg();let r,o;return Df(()=>{if(!r.length)return;const l=e.moveClass||`${e.name||"v"}-move`;if(!N_(r[0].el,n.vnode.el,l)){r=[];return}r.forEach(O_),r.forEach(R_);const c=r.filter(P_);ll(n.vnode.el),c.forEach(u=>{const h=u.el,d=h.style;cn(h,l),d.transform=d.webkitTransform=d.transitionDuration="";const m=h[Si]=_=>{_&&_.target!==h||(!_||_.propertyName.endsWith("transform"))&&(h.removeEventListener("transitionend",m),h[Si]=null,Dn(h,l))};h.addEventListener("transitionend",m)}),r=[]}),()=>{const l=xe(e),c=l_(l);let u=l.tag||ot;if(r=[],o)for(let h=0;h{c.split(/\s+/).forEach(u=>u&&s.classList.remove(u))}),n.split(/\s+/).forEach(c=>c&&s.classList.add(c)),s.style.display="none";const o=t.nodeType===1?t:t.parentNode;o.appendChild(s);const{hasTransform:l}=id(s);return o.removeChild(s),l}const Hs=e=>{const t=e.props["onUpdate:modelValue"]||!1;return re(t)?n=>ai(t,n):t};function I_(e){e.target.composing=!0}function cu(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Cn=Symbol("_assign");function uu(e,t,n){return t&&(e=e.trim()),n&&(e=Pi(e)),e}const $o={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[Cn]=Hs(r);const o=s||r.props&&r.props.type==="number";Bn(e,t?"change":"input",l=>{l.target.composing||e[Cn](uu(e.value,n,o))}),(n||o)&&Bn(e,"change",()=>{e.value=uu(e.value,n,o)}),t||(Bn(e,"compositionstart",I_),Bn(e,"compositionend",cu),Bn(e,"change",cu))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:o}},l){if(e[Cn]=Hs(l),e.composing)return;const c=(o||e.type==="number")&&!/^0\d/.test(e.value)?Pi(e.value):e.value,u=t??"";c!==u&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===u)||(e.value=u))}},Rw={deep:!0,created(e,t,n){e[Cn]=Hs(n),Bn(e,"change",()=>{const s=e._modelValue,r=Sr(e),o=e.checked,l=e[Cn];if(re(s)){const c=El(s,r),u=c!==-1;if(o&&!u)l(s.concat(r));else if(!o&&u){const h=[...s];h.splice(c,1),l(h)}}else if(Ws(s)){const c=new Set(s);o?c.add(r):c.delete(r),l(c)}else l(ad(e,o))})},mounted:fu,beforeUpdate(e,t,n){e[Cn]=Hs(n),fu(e,t,n)}};function fu(e,{value:t,oldValue:n},s){e._modelValue=t;let r;if(re(t))r=El(t,s.props.value)>-1;else if(Ws(t))r=t.has(s.props.value);else{if(t===n)return;r=Or(t,ad(e,!0))}e.checked!==r&&(e.checked=r)}const Pw={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const r=Ws(t);Bn(e,"change",()=>{const o=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>n?Pi(Sr(l)):Sr(l));e[Cn](e.multiple?r?new Set(o):o:o[0]),e._assigning=!0,Pl(()=>{e._assigning=!1})}),e[Cn]=Hs(s)},mounted(e,{value:t}){du(e,t)},beforeUpdate(e,t,n){e[Cn]=Hs(n)},updated(e,{value:t}){e._assigning||du(e,t)}};function du(e,t){const n=e.multiple,s=re(t);if(!(n&&!s&&!Ws(t))){for(let r=0,o=e.options.length;rString(h)===String(c)):l.selected=El(t,c)>-1}else l.selected=t.has(c);else if(Or(Sr(l),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Sr(e){return"_value"in e?e._value:e.value}function ad(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const k_=["ctrl","shift","alt","meta"],L_={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>k_.some(n=>e[`${n}Key`]&&!t.includes(n))},al=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((r,...o)=>{for(let l=0;l{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(r=>{if(!("key"in r))return;const o=qn(r.key);if(t.some(l=>l===o||D_[l]===o))return e(r)}))},M_=Ze({patchProp:A_},i_);let hu;function F_(){return hu||(hu=$g(M_))}const $_=((...e)=>{const t=F_().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=B_(s);if(!r)return;const o=t._component;!pe(o)&&!o.render&&!o.template&&(o.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const l=n(r,!1,j_(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),l},t});function j_(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function B_(e){return ze(e)?document.querySelector(e):e}const H_="data:image/svg+xml,%3csvg%20width='119'%20height='119'%20viewBox='0%200%20119%20119'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M78.8326%2058.0426C78.8765%2048.6428%2071.4389%2040.699%2061.5235%2039.5555C51.6081%2038.4119%2042.3519%2044.4304%2039.982%2053.5619C37.6121%2062.6934%2042.8784%2072.049%2052.2379%2075.3346L44.6584%20113.322H73.7264L66.2799%2075.2595C73.8362%2072.5045%2078.8207%2065.6679%2078.8326%2058.0426Z'%20fill='white'/%3e%3cpath%20d='M118.249%2057.7933C117.583%2025.6833%2091.3083%200%2059.1246%200C26.9408%200%200.665851%2025.6833%203.09067e-08%2057.7933C-0.000675955%2078.6062%2011.0875%2097.8498%2029.1129%20108.319L32.9103%2083.2079C27.0781%2076.837%2023.8452%2068.5192%2023.8473%2059.8902C24.3594%2040.8148%2040.0026%2025.6167%2059.1246%2025.6167C78.2465%2025.6167%2093.8897%2040.8148%2094.4018%2059.8902C94.405%2068.5881%2091.1238%2076.9678%2085.2123%2083.3594L88.9843%20108.395C107.107%2097.9657%20118.266%2078.67%20118.249%2057.7933Z'%20fill='%23ED7F22'/%3e%3c/svg%3e",jo=Tt(null),Bo=Tt(!1);function cd(){return{config:jo,isLoaded:Bo,loadConfig:async()=>{if(!Bo.value)try{const t=await fetch("/config.json");jo.value=await t.json(),Bo.value=!0}catch(t){console.error("Failed to load configuration:",t),jo.value={api_base_url:"http://localhost:5001/api/v1",refresh_interval:3e4}}}}}function ud(e,t){return function(){return e.apply(t,arguments)}}const{toString:U_}=Object.prototype,{getPrototypeOf:jl}=Object,{iterator:Bi,toStringTag:fd}=Symbol,Hi=(e=>t=>{const n=U_.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),en=e=>(e=e.toLowerCase(),t=>Hi(t)===e),Ui=e=>t=>typeof t===e,{isArray:Ks}=Array,Us=Ui("undefined");function Nr(e){return e!==null&&!Us(e)&&e.constructor!==null&&!Us(e.constructor)&&xt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const dd=en("ArrayBuffer");function V_(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&dd(e.buffer),t}const q_=Ui("string"),xt=Ui("function"),hd=Ui("number"),Ir=e=>e!==null&&typeof e=="object",W_=e=>e===!0||e===!1,pi=e=>{if(Hi(e)!=="object")return!1;const t=jl(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(fd in e)&&!(Bi in e)},K_=e=>{if(!Ir(e)||Nr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},z_=en("Date"),G_=en("File"),J_=en("Blob"),X_=en("FileList"),Y_=e=>Ir(e)&&xt(e.pipe),Q_=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||xt(e.append)&&((t=Hi(e))==="formdata"||t==="object"&&xt(e.toString)&&e.toString()==="[object FormData]"))},Z_=en("URLSearchParams"),[eb,tb,nb,sb]=["ReadableStream","Request","Response","Headers"].map(en),rb=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function kr(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),Ks(e))for(s=0,r=e.length;s0;)if(r=n[s],t===r.toLowerCase())return r;return null}const ls=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,md=e=>!Us(e)&&e!==ls;function cl(){const{caseless:e,skipUndefined:t}=md(this)&&this||{},n={},s=(r,o)=>{const l=e&&pd(n,o)||o;pi(n[l])&&pi(r)?n[l]=cl(n[l],r):pi(r)?n[l]=cl({},r):Ks(r)?n[l]=r.slice():(!t||!Us(r))&&(n[l]=r)};for(let r=0,o=arguments.length;r(kr(t,(r,o)=>{n&&xt(r)?e[o]=ud(r,n):e[o]=r},{allOwnKeys:s}),e),ob=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),lb=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},ab=(e,t,n,s)=>{let r,o,l;const c={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),o=r.length;o-- >0;)l=r[o],(!s||s(l,e,t))&&!c[l]&&(t[l]=e[l],c[l]=!0);e=n!==!1&&jl(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},cb=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},ub=e=>{if(!e)return null;if(Ks(e))return e;let t=e.length;if(!hd(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},fb=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&jl(Uint8Array)),db=(e,t)=>{const s=(e&&e[Bi]).call(e);let r;for(;(r=s.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},hb=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},pb=en("HTMLFormElement"),mb=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),pu=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),gb=en("RegExp"),gd=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};kr(n,(r,o)=>{let l;(l=t(r,o,e))!==!1&&(s[o]=l||r)}),Object.defineProperties(e,s)},_b=e=>{gd(e,(t,n)=>{if(xt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(xt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},bb=(e,t)=>{const n={},s=r=>{r.forEach(o=>{n[o]=!0})};return Ks(e)?s(e):s(String(e).split(t)),n},yb=()=>{},vb=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function wb(e){return!!(e&&xt(e.append)&&e[fd]==="FormData"&&e[Bi])}const Eb=e=>{const t=new Array(10),n=(s,r)=>{if(Ir(s)){if(t.indexOf(s)>=0)return;if(Nr(s))return s;if(!("toJSON"in s)){t[r]=s;const o=Ks(s)?[]:{};return kr(s,(l,c)=>{const u=n(l,r+1);!Us(u)&&(o[c]=u)}),t[r]=void 0,o}}return s};return n(e,0)},Ab=en("AsyncFunction"),Cb=e=>e&&(Ir(e)||xt(e))&&xt(e.then)&&xt(e.catch),_d=((e,t)=>e?setImmediate:t?((n,s)=>(ls.addEventListener("message",({source:r,data:o})=>{r===ls&&o===n&&s.length&&s.shift()()},!1),r=>{s.push(r),ls.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",xt(ls.postMessage)),Sb=typeof queueMicrotask<"u"?queueMicrotask.bind(ls):typeof process<"u"&&process.nextTick||_d,Tb=e=>e!=null&&xt(e[Bi]),C={isArray:Ks,isArrayBuffer:dd,isBuffer:Nr,isFormData:Q_,isArrayBufferView:V_,isString:q_,isNumber:hd,isBoolean:W_,isObject:Ir,isPlainObject:pi,isEmptyObject:K_,isReadableStream:eb,isRequest:tb,isResponse:nb,isHeaders:sb,isUndefined:Us,isDate:z_,isFile:G_,isBlob:J_,isRegExp:gb,isFunction:xt,isStream:Y_,isURLSearchParams:Z_,isTypedArray:fb,isFileList:X_,forEach:kr,merge:cl,extend:ib,trim:rb,stripBOM:ob,inherits:lb,toFlatObject:ab,kindOf:Hi,kindOfTest:en,endsWith:cb,toArray:ub,forEachEntry:db,matchAll:hb,isHTMLForm:pb,hasOwnProperty:pu,hasOwnProp:pu,reduceDescriptors:gd,freezeMethods:_b,toObjectSet:bb,toCamelCase:mb,noop:yb,toFiniteNumber:vb,findKey:pd,global:ls,isContextDefined:md,isSpecCompliantForm:wb,toJSONObject:Eb,isAsyncFn:Ab,isThenable:Cb,setImmediate:_d,asap:Sb,isIterable:Tb};function me(e,t,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}C.inherits(me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:C.toJSONObject(this.config),code:this.code,status:this.status}}});const bd=me.prototype,yd={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{yd[e]={value:e}});Object.defineProperties(me,yd);Object.defineProperty(bd,"isAxiosError",{value:!0});me.from=(e,t,n,s,r,o)=>{const l=Object.create(bd);C.toFlatObject(e,l,function(d){return d!==Error.prototype},h=>h!=="isAxiosError");const c=e&&e.message?e.message:"Error",u=t==null&&e?e.code:t;return me.call(l,c,u,n,s,r),e&&l.cause==null&&Object.defineProperty(l,"cause",{value:e,configurable:!0}),l.name=e&&e.name||"Error",o&&Object.assign(l,o),l};const xb=null;function ul(e){return C.isPlainObject(e)||C.isArray(e)}function vd(e){return C.endsWith(e,"[]")?e.slice(0,-2):e}function mu(e,t,n){return e?e.concat(t).map(function(r,o){return r=vd(r),!n&&o?"["+r+"]":r}).join(n?".":""):t}function Ob(e){return C.isArray(e)&&!e.some(ul)}const Rb=C.toFlatObject(C,{},null,function(t){return/^is[A-Z]/.test(t)});function Vi(e,t,n){if(!C.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=C.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,x){return!C.isUndefined(x[S])});const s=n.metaTokens,r=n.visitor||d,o=n.dots,l=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&C.isSpecCompliantForm(t);if(!C.isFunction(r))throw new TypeError("visitor must be a function");function h(w){if(w===null)return"";if(C.isDate(w))return w.toISOString();if(C.isBoolean(w))return w.toString();if(!u&&C.isBlob(w))throw new me("Blob is not supported. Use a Buffer instead.");return C.isArrayBuffer(w)||C.isTypedArray(w)?u&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function d(w,S,x){let D=w;if(w&&!x&&typeof w=="object"){if(C.endsWith(S,"{}"))S=s?S:S.slice(0,-2),w=JSON.stringify(w);else if(C.isArray(w)&&Ob(w)||(C.isFileList(w)||C.endsWith(S,"[]"))&&(D=C.toArray(w)))return S=vd(S),D.forEach(function($,H){!(C.isUndefined($)||$===null)&&t.append(l===!0?mu([S],H,o):l===null?S:S+"[]",h($))}),!1}return ul(w)?!0:(t.append(mu(x,S,o),h(w)),!1)}const m=[],_=Object.assign(Rb,{defaultVisitor:d,convertValue:h,isVisitable:ul});function y(w,S){if(!C.isUndefined(w)){if(m.indexOf(w)!==-1)throw Error("Circular reference detected in "+S.join("."));m.push(w),C.forEach(w,function(D,F){(!(C.isUndefined(D)||D===null)&&r.call(t,D,C.isString(F)?F.trim():F,S,_))===!0&&y(D,S?S.concat(F):[F])}),m.pop()}}if(!C.isObject(e))throw new TypeError("data must be an object");return y(e),t}function gu(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Bl(e,t){this._pairs=[],e&&Vi(e,this,t)}const wd=Bl.prototype;wd.append=function(t,n){this._pairs.push([t,n])};wd.toString=function(t){const n=t?function(s){return t.call(this,s,gu)}:gu;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function Pb(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ed(e,t,n){if(!t)return e;const s=n&&n.encode||Pb;C.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let o;if(r?o=r(t,n):o=C.isURLSearchParams(t)?t.toString():new Bl(t,n).toString(s),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class _u{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){C.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Ad={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Nb=typeof URLSearchParams<"u"?URLSearchParams:Bl,Ib=typeof FormData<"u"?FormData:null,kb=typeof Blob<"u"?Blob:null,Lb={isBrowser:!0,classes:{URLSearchParams:Nb,FormData:Ib,Blob:kb},protocols:["http","https","file","blob","url","data"]},Hl=typeof window<"u"&&typeof document<"u",fl=typeof navigator=="object"&&navigator||void 0,Db=Hl&&(!fl||["ReactNative","NativeScript","NS"].indexOf(fl.product)<0),Mb=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Fb=Hl&&window.location.href||"http://localhost",$b=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Hl,hasStandardBrowserEnv:Db,hasStandardBrowserWebWorkerEnv:Mb,navigator:fl,origin:Fb},Symbol.toStringTag,{value:"Module"})),ft={...$b,...Lb};function jb(e,t){return Vi(e,new ft.classes.URLSearchParams,{visitor:function(n,s,r,o){return ft.isNode&&C.isBuffer(n)?(this.append(s,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Bb(e){return C.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Hb(e){const t={},n=Object.keys(e);let s;const r=n.length;let o;for(s=0;s=n.length;return l=!l&&C.isArray(r)?r.length:l,u?(C.hasOwnProp(r,l)?r[l]=[r[l],s]:r[l]=s,!c):((!r[l]||!C.isObject(r[l]))&&(r[l]=[]),t(n,s,r[l],o)&&C.isArray(r[l])&&(r[l]=Hb(r[l])),!c)}if(C.isFormData(e)&&C.isFunction(e.entries)){const n={};return C.forEachEntry(e,(s,r)=>{t(Bb(s),r,n,0)}),n}return null}function Ub(e,t,n){if(C.isString(e))try{return(t||JSON.parse)(e),C.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const Lr={transitional:Ad,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,o=C.isObject(t);if(o&&C.isHTMLForm(t)&&(t=new FormData(t)),C.isFormData(t))return r?JSON.stringify(Cd(t)):t;if(C.isArrayBuffer(t)||C.isBuffer(t)||C.isStream(t)||C.isFile(t)||C.isBlob(t)||C.isReadableStream(t))return t;if(C.isArrayBufferView(t))return t.buffer;if(C.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(s.indexOf("application/x-www-form-urlencoded")>-1)return jb(t,this.formSerializer).toString();if((c=C.isFileList(t))||s.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Vi(c?{"files[]":t}:t,u&&new u,this.formSerializer)}}return o||r?(n.setContentType("application/json",!1),Ub(t)):t}],transformResponse:[function(t){const n=this.transitional||Lr.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(C.isResponse(t)||C.isReadableStream(t))return t;if(t&&C.isString(t)&&(s&&!this.responseType||r)){const l=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(c){if(l)throw c.name==="SyntaxError"?me.from(c,me.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ft.classes.FormData,Blob:ft.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};C.forEach(["delete","get","head","post","put","patch"],e=>{Lr.headers[e]={}});const Vb=C.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qb=e=>{const t={};let n,s,r;return e&&e.split(` `).forEach(function(l){r=l.indexOf(":"),n=l.substring(0,r).trim().toLowerCase(),s=l.substring(r+1).trim(),!(!n||t[n]&&Vb[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},bu=Symbol("internals");function sr(e){return e&&String(e).trim().toLowerCase()}function mi(e){return e===!1||e==null?e:C.isArray(e)?e.map(mi):String(e)}function Wb(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Kb=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ho(e,t,n,s,r){if(C.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!C.isString(t)){if(C.isString(s))return t.indexOf(s)!==-1;if(C.isRegExp(s))return s.test(t)}}function zb(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function Gb(e,t){const n=C.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,o,l){return this[s].call(this,t,r,o,l)},configurable:!0})})}let Ot=class{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function o(c,u,h){const d=sr(u);if(!d)throw new Error("header name must be a non-empty string");const m=C.findKey(r,d);(!m||r[m]===void 0||h===!0||h===void 0&&r[m]!==!1)&&(r[m||u]=mi(c))}const l=(c,u)=>C.forEach(c,(h,d)=>o(h,d,u));if(C.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(C.isString(t)&&(t=t.trim())&&!Kb(t))l(qb(t),n);else if(C.isObject(t)&&C.isIterable(t)){let c={},u,h;for(const d of t){if(!C.isArray(d))throw TypeError("Object iterator must return a key-value pair");c[h=d[0]]=(u=c[h])?C.isArray(u)?[...u,d[1]]:[u,d[1]]:d[1]}l(c,n)}else t!=null&&o(n,t,s);return this}get(t,n){if(t=sr(t),t){const s=C.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return Wb(r);if(C.isFunction(n))return n.call(this,r,s);if(C.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=sr(t),t){const s=C.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||Ho(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function o(l){if(l=sr(l),l){const c=C.findKey(s,l);c&&(!n||Ho(s,s[c],c,n))&&(delete s[c],r=!0)}}return C.isArray(t)?t.forEach(o):o(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const o=n[s];(!t||Ho(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){const n=this,s={};return C.forEach(this,(r,o)=>{const l=C.findKey(s,o);if(l){n[l]=mi(r),delete n[o];return}const c=t?zb(o):String(o).trim();c!==o&&delete n[o],n[c]=mi(r),s[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return C.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&C.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[bu]=this[bu]={accessors:{}}).accessors,r=this.prototype;function o(l){const c=sr(l);s[c]||(Gb(r,l),s[c]=!0)}return C.isArray(t)?t.forEach(o):o(t),this}};Ot.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);C.reduceDescriptors(Ot.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});C.freezeMethods(Ot);function Uo(e,t){const n=this||Lr,s=t||n,r=Ot.from(s.headers);let o=s.data;return C.forEach(e,function(c){o=c.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function Sd(e){return!!(e&&e.__CANCEL__)}function zs(e,t,n){me.call(this,e??"canceled",me.ERR_CANCELED,t,n),this.name="CanceledError"}C.inherits(zs,me,{__CANCEL__:!0});function Td(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new me("Request failed with status code "+n.status,[me.ERR_BAD_REQUEST,me.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Jb(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xb(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,o=0,l;return t=t!==void 0?t:1e3,function(u){const h=Date.now(),d=s[o];l||(l=h),n[r]=u,s[r]=h;let m=o,_=0;for(;m!==r;)_+=n[m++],m=m%e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),h-l{n=d,r=null,o&&(clearTimeout(o),o=null),e(...h)};return[(...h)=>{const d=Date.now(),m=d-n;m>=s?l(h,d):(r=h,o||(o=setTimeout(()=>{o=null,l(r)},s-m)))},()=>r&&l(r)]}const Ti=(e,t,n=3)=>{let s=0;const r=Xb(50,250);return Yb(o=>{const l=o.loaded,c=o.lengthComputable?o.total:void 0,u=l-s,h=r(u),d=l<=c;s=l;const m={loaded:l,total:c,progress:c?l/c:void 0,bytes:u,rate:h||void 0,estimated:h&&c&&d?(c-l)/h:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},yu=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},vu=e=>(...t)=>C.asap(()=>e(...t)),Qb=ft.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ft.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):()=>!0,Zb=ft.hasStandardBrowserEnv?{write(e,t,n,s,r,o,l){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];C.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),C.isString(s)&&c.push(`path=${s}`),C.isString(r)&&c.push(`domain=${r}`),o===!0&&c.push("secure"),C.isString(l)&&c.push(`SameSite=${l}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ey(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ty(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function xd(e,t,n){let s=!ey(t);return e&&(s||n==!1)?ty(e,t):t}const wu=e=>e instanceof Ot?{...e}:e;function ps(e,t){t=t||{};const n={};function s(h,d,m,_){return C.isPlainObject(h)&&C.isPlainObject(d)?C.merge.call({caseless:_},h,d):C.isPlainObject(d)?C.merge({},d):C.isArray(d)?d.slice():d}function r(h,d,m,_){if(C.isUndefined(d)){if(!C.isUndefined(h))return s(void 0,h,m,_)}else return s(h,d,m,_)}function o(h,d){if(!C.isUndefined(d))return s(void 0,d)}function l(h,d){if(C.isUndefined(d)){if(!C.isUndefined(h))return s(void 0,h)}else return s(void 0,d)}function c(h,d,m){if(m in t)return s(h,d);if(m in e)return s(void 0,h)}const u={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:c,headers:(h,d,m)=>r(wu(h),wu(d),m,!0)};return C.forEach(Object.keys({...e,...t}),function(d){const m=u[d]||r,_=m(e[d],t[d],d);C.isUndefined(_)&&m!==c||(n[d]=_)}),n}const Od=e=>{const t=ps({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:o,headers:l,auth:c}=t;if(t.headers=l=Ot.from(l),t.url=Ed(xd(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&l.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),C.isFormData(n)){if(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(C.isFunction(n.getHeaders)){const u=n.getHeaders(),h=["content-type","content-length"];Object.entries(u).forEach(([d,m])=>{h.includes(d.toLowerCase())&&l.set(d,m)})}}if(ft.hasStandardBrowserEnv&&(s&&C.isFunction(s)&&(s=s(t)),s||s!==!1&&Qb(t.url))){const u=r&&o&&Zb.read(o);u&&l.set(r,u)}return t},ny=typeof XMLHttpRequest<"u",sy=ny&&function(e){return new Promise(function(n,s){const r=Od(e);let o=r.data;const l=Ot.from(r.headers).normalize();let{responseType:c,onUploadProgress:u,onDownloadProgress:h}=r,d,m,_,y,w;function S(){y&&y(),w&&w(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let x=new XMLHttpRequest;x.open(r.method.toUpperCase(),r.url,!0),x.timeout=r.timeout;function D(){if(!x)return;const $=Ot.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),te={data:!c||c==="text"||c==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:$,config:e,request:x};Td(function(Z){n(Z),S()},function(Z){s(Z),S()},te),x=null}"onloadend"in x?x.onloadend=D:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(D)},x.onabort=function(){x&&(s(new me("Request aborted",me.ECONNABORTED,e,x)),x=null)},x.onerror=function(H){const te=H&&H.message?H.message:"Network Error",le=new me(te,me.ERR_NETWORK,e,x);le.event=H||null,s(le),x=null},x.ontimeout=function(){let H=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const te=r.transitional||Ad;r.timeoutErrorMessage&&(H=r.timeoutErrorMessage),s(new me(H,te.clarifyTimeoutError?me.ETIMEDOUT:me.ECONNABORTED,e,x)),x=null},o===void 0&&l.setContentType(null),"setRequestHeader"in x&&C.forEach(l.toJSON(),function(H,te){x.setRequestHeader(te,H)}),C.isUndefined(r.withCredentials)||(x.withCredentials=!!r.withCredentials),c&&c!=="json"&&(x.responseType=r.responseType),h&&([_,w]=Ti(h,!0),x.addEventListener("progress",_)),u&&x.upload&&([m,y]=Ti(u),x.upload.addEventListener("progress",m),x.upload.addEventListener("loadend",y)),(r.cancelToken||r.signal)&&(d=$=>{x&&(s(!$||$.type?new zs(null,e,x):$),x.abort(),x=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const F=Jb(r.url);if(F&&ft.protocols.indexOf(F)===-1){s(new me("Unsupported protocol "+F+":",me.ERR_BAD_REQUEST,e));return}x.send(o||null)})},ry=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,r;const o=function(h){if(!r){r=!0,c();const d=h instanceof Error?h:this.reason;s.abort(d instanceof me?d:new zs(d instanceof Error?d.message:d))}};let l=t&&setTimeout(()=>{l=null,o(new me(`timeout ${t} of ms exceeded`,me.ETIMEDOUT))},t);const c=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(o):h.removeEventListener("abort",o)}),e=null)};e.forEach(h=>h.addEventListener("abort",o));const{signal:u}=s;return u.unsubscribe=()=>C.asap(c),u}},iy=function*(e,t){let n=e.byteLength;if(n{const r=oy(e,t);let o=0,l,c=u=>{l||(l=!0,s&&s(u))};return new ReadableStream({async pull(u){try{const{done:h,value:d}=await r.next();if(h){c(),u.close();return}let m=d.byteLength;if(n){let _=o+=m;n(_)}u.enqueue(new Uint8Array(d))}catch(h){throw c(h),h}},cancel(u){return c(u),r.return()}},{highWaterMark:2})},Au=64*1024,{isFunction:li}=C,ay=(({Request:e,Response:t})=>({Request:e,Response:t}))(C.global),{ReadableStream:Cu,TextEncoder:Su}=C.global,Tu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},cy=e=>{e=C.merge.call({skipUndefined:!0},ay,e);const{fetch:t,Request:n,Response:s}=e,r=t?li(t):typeof fetch=="function",o=li(n),l=li(s);if(!r)return!1;const c=r&&li(Cu),u=r&&(typeof Su=="function"?(w=>S=>w.encode(S))(new Su):async w=>new Uint8Array(await new n(w).arrayBuffer())),h=o&&c&&Tu(()=>{let w=!1;const S=new n(ft.origin,{body:new Cu,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!S}),d=l&&c&&Tu(()=>C.isReadableStream(new s("").body)),m={stream:d&&(w=>w.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!m[w]&&(m[w]=(S,x)=>{let D=S&&S[w];if(D)return D.call(S);throw new me(`Response type '${w}' is not supported`,me.ERR_NOT_SUPPORT,x)})});const _=async w=>{if(w==null)return 0;if(C.isBlob(w))return w.size;if(C.isSpecCompliantForm(w))return(await new n(ft.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(C.isArrayBufferView(w)||C.isArrayBuffer(w))return w.byteLength;if(C.isURLSearchParams(w)&&(w=w+""),C.isString(w))return(await u(w)).byteLength},y=async(w,S)=>{const x=C.toFiniteNumber(w.getContentLength());return x??_(S)};return async w=>{let{url:S,method:x,data:D,signal:F,cancelToken:$,timeout:H,onDownloadProgress:te,onUploadProgress:le,responseType:Z,headers:B,withCredentials:z="same-origin",fetchOptions:fe}=Od(w),_e=t||fetch;Z=Z?(Z+"").toLowerCase():"text";let G=ry([F,$&&$.toAbortSignal()],H),ye=null;const Pe=G&&G.unsubscribe&&(()=>{G.unsubscribe()});let Ye;try{if(le&&h&&x!=="get"&&x!=="head"&&(Ye=await y(B,D))!==0){let P=new n(S,{method:"POST",body:D,duplex:"half"}),He;if(C.isFormData(D)&&(He=P.headers.get("content-type"))&&B.setContentType(He),P.body){const[Pt,ht]=yu(Ye,Ti(vu(le)));D=Eu(P.body,Au,Pt,ht)}}C.isString(z)||(z=z?"include":"omit");const Ee=o&&"credentials"in n.prototype,Ce={...fe,signal:G,method:x.toUpperCase(),headers:B.normalize().toJSON(),body:D,duplex:"half",credentials:Ee?z:void 0};ye=o&&new n(S,Ce);let de=await(o?_e(ye,fe):_e(S,Ce));const Ct=d&&(Z==="stream"||Z==="response");if(d&&(te||Ct&&Pe)){const P={};["status","statusText","headers"].forEach(Je=>{P[Je]=de[Je]});const He=C.toFiniteNumber(de.headers.get("content-length")),[Pt,ht]=te&&yu(He,Ti(vu(te),!0))||[];de=new s(Eu(de.body,Au,Pt,()=>{ht&&ht(),Pe&&Pe()}),P)}Z=Z||"text";let Rt=await m[C.findKey(m,Z)||"text"](de,w);return!Ct&&Pe&&Pe(),await new Promise((P,He)=>{Td(P,He,{data:Rt,headers:Ot.from(de.headers),status:de.status,statusText:de.statusText,config:w,request:ye})})}catch(Ee){throw Pe&&Pe(),Ee&&Ee.name==="TypeError"&&/Load failed|fetch/i.test(Ee.message)?Object.assign(new me("Network Error",me.ERR_NETWORK,w,ye),{cause:Ee.cause||Ee}):me.from(Ee,Ee&&Ee.code,w,ye)}}},uy=new Map,Rd=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:r}=t,o=[s,r,n];let l=o.length,c=l,u,h,d=uy;for(;c--;)u=o[c],h=d.get(u),h===void 0&&d.set(u,h=c?new Map:cy(t)),d=h;return h};Rd();const Ul={http:xb,xhr:sy,fetch:{get:Rd}};C.forEach(Ul,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const xu=e=>`- ${e}`,fy=e=>C.isFunction(e)||e===null||e===!1;function dy(e,t){e=C.isArray(e)?e:[e];const{length:n}=e;let s,r;const o={};for(let l=0;l`adapter ${u} `+(h===!1?"is not supported by the environment":"is not available in the build"));let c=n?l.length>1?`since : `+l.map(xu).join(` `):" "+xu(l[0]):"as no adapter specified";throw new me("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return r}const Pd={getAdapter:dy,adapters:Ul};function Vo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new zs(null,e)}function Ou(e){return Vo(e),e.headers=Ot.from(e.headers),e.data=Uo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Pd.getAdapter(e.adapter||Lr.adapter,e)(e).then(function(s){return Vo(e),s.data=Uo.call(e,e.transformResponse,s),s.headers=Ot.from(s.headers),s},function(s){return Sd(s)||(Vo(e),s&&s.response&&(s.response.data=Uo.call(e,e.transformResponse,s.response),s.response.headers=Ot.from(s.response.headers))),Promise.reject(s)})}const Nd="1.13.2",qi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{qi[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ru={};qi.transitional=function(t,n,s){function r(o,l){return"[Axios v"+Nd+"] Transitional option '"+o+"'"+l+(s?". "+s:"")}return(o,l,c)=>{if(t===!1)throw new me(r(l," has been removed"+(n?" in "+n:"")),me.ERR_DEPRECATED);return n&&!Ru[l]&&(Ru[l]=!0,console.warn(r(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,c):!0}};qi.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function hy(e,t,n){if(typeof e!="object")throw new me("options must be an object",me.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const o=s[r],l=t[o];if(l){const c=e[o],u=c===void 0||l(c,o,e);if(u!==!0)throw new me("option "+o+" must be "+u,me.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new me("Unknown option "+o,me.ERR_BAD_OPTION)}}const gi={assertOptions:hy,validators:qi},an=gi.validators;let ds=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _u,response:new _u}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const o=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=` -`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ps(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&gi.assertOptions(s,{silentJSONParsing:an.transitional(an.boolean),forcedJSONParsing:an.transitional(an.boolean),clarifyTimeoutError:an.transitional(an.boolean)},!1),r!=null&&(C.isFunction(r)?n.paramsSerializer={serialize:r}:gi.assertOptions(r,{encode:an.function,serialize:an.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),gi.assertOptions(n,{baseUrl:an.spelling("baseURL"),withXsrfToken:an.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&C.merge(o.common,o[n.method]);o&&C.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=Ot.concat(l,o);const c=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(u=u&&S.synchronous,c.unshift(S.fulfilled,S.rejected))});const h=[];this.interceptors.response.forEach(function(S){h.push(S.fulfilled,S.rejected)});let d,m=0,_;if(!u){const w=[Ou.bind(this),void 0];for(w.unshift(...c),w.push(...h),_=w.length,d=Promise.resolve(n);m<_;)d=d.then(w[m++],w[m++]);return d}_=c.length;let y=n;for(;m<_;){const w=c[m++],S=c[m++];try{y=w(y)}catch(x){S.call(this,x);break}}try{d=Ou.call(this,y)}catch(w){return Promise.reject(w)}for(m=0,_=h.length;m<_;)d=d.then(h[m++],h[m++]);return d}getUri(t){t=ps(this.defaults,t);const n=xd(t.baseURL,t.url,t.allowAbsoluteUrls);return Ed(n,t.params,t.paramsSerializer)}};C.forEach(["delete","get","head","options"],function(t){ds.prototype[t]=function(n,s){return this.request(ps(s||{},{method:t,url:n,data:(s||{}).data}))}});C.forEach(["post","put","patch"],function(t){function n(s){return function(o,l,c){return this.request(ps(c||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:l}))}}ds.prototype[t]=n(),ds.prototype[t+"Form"]=n(!0)});let py=class Id{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(r=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const l=new Promise(c=>{s.subscribe(c),o=c}).then(r);return l.cancel=function(){s.unsubscribe(o)},l},t(function(o,l,c){s.reason||(s.reason=new zs(o,l,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Id(function(r){t=r}),cancel:t}}};function my(e){return function(n){return e.apply(null,n)}}function gy(e){return C.isObject(e)&&e.isAxiosError===!0}const dl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(dl).forEach(([e,t])=>{dl[t]=e});function kd(e){const t=new ds(e),n=ud(ds.prototype.request,t);return C.extend(n,ds.prototype,t,{allOwnKeys:!0}),C.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return kd(ps(e,r))},n}const qe=kd(Lr);qe.Axios=ds;qe.CanceledError=zs;qe.CancelToken=py;qe.isCancel=Sd;qe.VERSION=Nd;qe.toFormData=Vi;qe.AxiosError=me;qe.Cancel=qe.CanceledError;qe.all=function(t){return Promise.all(t)};qe.spread=my;qe.isAxiosError=gy;qe.mergeConfig=ps;qe.AxiosHeaders=Ot;qe.formToJSON=e=>Cd(C.isHTMLForm(e)?new FormData(e):e);qe.getAdapter=Pd.getAdapter;qe.HttpStatusCode=dl;qe.default=qe;const{Axios:Lw,AxiosError:Dw,CanceledError:Mw,isCancel:Fw,CancelToken:$w,VERSION:jw,all:Bw,Cancel:Hw,isAxiosError:Uw,spread:Vw,toFormData:qw,AxiosHeaders:Ww,HttpStatusCode:Kw,formToJSON:zw,getAdapter:Gw,mergeConfig:Jw}=qe,or=qe.create(),hl=qe.create(),Ld=qe.create(),Dd=e=>e?.api_base_url||"http://localhost:5001/api/v1",_y=e=>e?.profiles_api_base_url||"http://localhost:8000",by=e=>{const t=Dd(e).replace(/\/+$/,"");return/\/v1$/.test(t)?t.replace(/\/v1$/,"/auth"):t+"/../auth"},yy=e=>(e.response&&e.response.status===401&&(localStorage.removeItem("ovpmon_token"),localStorage.removeItem("ovpmon_user"),window.location.pathname!=="/login"&&(window.location.href="/login")),Promise.reject(e)),Vl=(e,t,{endSessionOn401:n=!0}={})=>{e.interceptors.request.use(s=>{const{config:r}=cd();s.baseURL=t(r.value);const o=localStorage.getItem("ovpmon_token");return o&&(s.headers.Authorization=`Bearer ${o}`),s}),n&&e.interceptors.response.use(s=>s,yy)};Vl(or,Dd);Vl(hl,_y);Vl(Ld,by,{endSessionOn401:!1});function ql(){return{apiClient:or,profilesApiClient:hl,authApiClient:Ld,fetchStats:async()=>(await or.get("/stats")).data,fetchClientHistory:async(r,o)=>(await or.get(`/stats/${r}`,{params:{range:o}})).data,fetchAnalytics:async r=>(await or.get("/analytics",{params:{range:r}})).data,fetchCertificates:async()=>{const r=await hl.get("/profiles");return Array.isArray(r.data)?r.data:[]}}}const ks=typeof document<"u";function Md(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function vy(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Md(e.default)}const Oe=Object.assign;function qo(e,t){const n={};for(const s in t){const r=t[s];n[s]=Zt(r)?r.map(e):e(r)}return n}const gr=()=>{},Zt=Array.isArray;function Pu(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Fd=/#/g,wy=/&/g,Ey=/\//g,Ay=/=/g,Cy=/\?/g,$d=/\+/g,Sy=/%5B/g,Ty=/%5D/g,jd=/%5E/g,xy=/%60/g,Bd=/%7B/g,Oy=/%7C/g,Hd=/%7D/g,Ry=/%20/g;function Wl(e){return e==null?"":encodeURI(""+e).replace(Oy,"|").replace(Sy,"[").replace(Ty,"]")}function Py(e){return Wl(e).replace(Bd,"{").replace(Hd,"}").replace(jd,"^")}function pl(e){return Wl(e).replace($d,"%2B").replace(Ry,"+").replace(Fd,"%23").replace(wy,"%26").replace(xy,"`").replace(Bd,"{").replace(Hd,"}").replace(jd,"^")}function Ny(e){return pl(e).replace(Ay,"%3D")}function Iy(e){return Wl(e).replace(Fd,"%23").replace(Cy,"%3F")}function ky(e){return Iy(e).replace(Ey,"%2F")}function Tr(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Ly=/\/$/,Dy=e=>e.replace(Ly,"");function Wo(e,t,n="/"){let s,r={},o="",l="";const c=t.indexOf("#");let u=t.indexOf("?");return u=c>=0&&u>c?-1:u,u>=0&&(s=t.slice(0,u),o=t.slice(u,c>0?c:t.length),r=e(o.slice(1))),c>=0&&(s=s||t.slice(0,c),l=t.slice(c,t.length)),s=jy(s??t,n),{fullPath:s+o+l,path:s,query:r,hash:Tr(l)}}function My(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Nu(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Fy(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&Vs(t.matched[s],n.matched[r])&&Ud(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Vs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ud(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!$y(e[n],t[n]))return!1;return!0}function $y(e,t){return Zt(e)?Iu(e,t):Zt(t)?Iu(t,e):e?.valueOf()===t?.valueOf()}function Iu(e,t){return Zt(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function jy(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let o=n.length-1,l,c;for(l=0;l1&&o--;else break;return n.slice(0,o).join("/")+"/"+s.slice(l).join("/")}const kn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let ml=(function(e){return e.pop="pop",e.push="push",e})({}),Ko=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function By(e){if(!e)if(ks){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Dy(e)}const Hy=/^[^#]+#/;function Uy(e,t){return e.replace(Hy,"#")+t}function Vy(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Wi=()=>({left:window.scrollX,top:window.scrollY});function qy(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=Vy(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function ku(e,t){return(history.state?history.state.position-t:-1)+e}const gl=new Map;function Wy(e,t){gl.set(e,t)}function Ky(e){const t=gl.get(e);return gl.delete(e),t}function zy(e){return typeof e=="string"||e&&typeof e=="object"}function Vd(e){return typeof e=="string"||typeof e=="symbol"}let Ke=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const qd=Symbol("");Ke.MATCHER_NOT_FOUND+"",Ke.NAVIGATION_GUARD_REDIRECT+"",Ke.NAVIGATION_ABORTED+"",Ke.NAVIGATION_CANCELLED+"",Ke.NAVIGATION_DUPLICATED+"";function qs(e,t){return Oe(new Error,{type:e,[qd]:!0},t)}function yn(e,t){return e instanceof Error&&qd in e&&(t==null||!!(e.type&t))}const Gy=["params","query","hash"];function Jy(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Gy)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Xy(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;sr&&pl(r)):[s&&pl(s)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+n,r!=null&&(t+="="+r))})}return t}function Yy(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=Zt(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return t}const Qy=Symbol(""),Du=Symbol(""),Ki=Symbol(""),Kl=Symbol(""),_l=Symbol("");function rr(){let e=[];function t(s){return e.push(s),()=>{const r=e.indexOf(s);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function jn(e,t,n,s,r,o=l=>l()){const l=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((c,u)=>{const h=_=>{_===!1?u(qs(Ke.NAVIGATION_ABORTED,{from:n,to:t})):_ instanceof Error?u(_):zy(_)?u(qs(Ke.NAVIGATION_GUARD_REDIRECT,{from:t,to:_})):(l&&s.enterCallbacks[r]===l&&typeof _=="function"&&l.push(_),c())},d=o(()=>e.call(s&&s.instances[r],t,n,h));let m=Promise.resolve(d);e.length<3&&(m=m.then(h)),m.catch(_=>u(_))})}function zo(e,t,n,s,r=o=>o()){const o=[];for(const l of e)for(const c in l.components){let u=l.components[c];if(!(t!=="beforeRouteEnter"&&!l.instances[c]))if(Md(u)){const h=(u.__vccOpts||u)[t];h&&o.push(jn(h,n,s,l,c,r))}else{let h=u();o.push(()=>h.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${c}" at "${l.path}"`);const m=vy(d)?d.default:d;l.mods[c]=d,l.components[c]=m;const _=(m.__vccOpts||m)[t];return _&&jn(_,n,s,l,c,r)()}))}}return o}function Zy(e,t){const n=[],s=[],r=[],o=Math.max(t.matched.length,e.matched.length);for(let l=0;lVs(h,c))?s.push(c):n.push(c));const u=e.matched[l];u&&(t.matched.find(h=>Vs(h,u))||r.push(u))}return[n,s,r]}let ev=()=>location.protocol+"//"+location.host;function Wd(e,t){const{pathname:n,search:s,hash:r}=t,o=e.indexOf("#");if(o>-1){let l=r.includes(e.slice(o))?e.slice(o).length:1,c=r.slice(l);return c[0]!=="/"&&(c="/"+c),Nu(c,"")}return Nu(n,e)+s+r}function tv(e,t,n,s){let r=[],o=[],l=null;const c=({state:_})=>{const y=Wd(e,location),w=n.value,S=t.value;let x=0;if(_){if(n.value=y,t.value=_,l&&l===w){l=null;return}x=S?_.position-S.position:0}else s(y);r.forEach(D=>{D(n.value,w,{delta:x,type:ml.pop,direction:x?x>0?Ko.forward:Ko.back:Ko.unknown})})};function u(){l=n.value}function h(_){r.push(_);const y=()=>{const w=r.indexOf(_);w>-1&&r.splice(w,1)};return o.push(y),y}function d(){if(document.visibilityState==="hidden"){const{history:_}=window;if(!_.state)return;_.replaceState(Oe({},_.state,{scroll:Wi()}),"")}}function m(){for(const _ of o)_();o=[],window.removeEventListener("popstate",c),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",c),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:u,listen:h,destroy:m}}function Mu(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Wi():null}}function nv(e){const{history:t,location:n}=window,s={value:Wd(e,n)},r={value:t.state};r.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(u,h,d){const m=e.indexOf("#"),_=m>-1?(n.host&&document.querySelector("base")?e:e.slice(m))+u:ev()+e+u;try{t[d?"replaceState":"pushState"](h,"",_),r.value=h}catch(y){console.error(y),n[d?"replace":"assign"](_)}}function l(u,h){o(u,Oe({},t.state,Mu(r.value.back,u,r.value.forward,!0),h,{position:r.value.position}),!0),s.value=u}function c(u,h){const d=Oe({},r.value,t.state,{forward:u,scroll:Wi()});o(d.current,d,!0),o(u,Oe({},Mu(s.value,u,null),{position:d.position+1},h),!1),s.value=u}return{location:s,state:r,push:c,replace:l}}function sv(e){e=By(e);const t=nv(e),n=tv(e,t.state,t.location,t.replace);function s(o,l=!0){l||n.pauseListeners(),history.go(o)}const r=Oe({location:"",base:e,go:s,createHref:Uy.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let as=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Qe=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Qe||{});const rv={type:as.Static,value:""},iv=/[a-zA-Z0-9_]/;function ov(e){if(!e)return[[]];if(e==="/")return[[rv]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(y){throw new Error(`ERR (${n})/"${h}": ${y}`)}let n=Qe.Static,s=n;const r=[];let o;function l(){o&&r.push(o),o=[]}let c=0,u,h="",d="";function m(){h&&(n===Qe.Static?o.push({type:as.Static,value:h}):n===Qe.Param||n===Qe.ParamRegExp||n===Qe.ParamRegExpEnd?(o.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${h}) must be alone in its segment. eg: '/:ids+.`),o.push({type:as.Param,value:h,regexp:d,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),h="")}function _(){h+=u}for(;ct.length?t.length===1&&t[0]===wt.Static+wt.Segment?1:-1:0}function Kd(e,t){let n=0;const s=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const fv={strict:!1,end:!0,sensitive:!1};function dv(e,t,n){const s=cv(ov(e.path),n),r=Oe(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function hv(e,t){const n=[],s=new Map;t=Pu(fv,t);function r(m){return s.get(m)}function o(m,_,y){const w=!y,S=Bu(m);S.aliasOf=y&&y.record;const x=Pu(t,m),D=[S];if("alias"in m){const H=typeof m.alias=="string"?[m.alias]:m.alias;for(const te of H)D.push(Bu(Oe({},S,{components:y?y.record.components:S.components,path:te,aliasOf:y?y.record:S})))}let F,$;for(const H of D){const{path:te}=H;if(_&&te[0]!=="/"){const le=_.record.path,Z=le[le.length-1]==="/"?"":"/";H.path=_.record.path+(te&&Z+te)}if(F=dv(H,_,x),y?y.alias.push(F):($=$||F,$!==F&&$.alias.push(F),w&&m.name&&!Hu(F)&&l(m.name)),zd(F)&&u(F),S.children){const le=S.children;for(let Z=0;Z{l($)}:gr}function l(m){if(Vd(m)){const _=s.get(m);_&&(s.delete(m),n.splice(n.indexOf(_),1),_.children.forEach(l),_.alias.forEach(l))}else{const _=n.indexOf(m);_>-1&&(n.splice(_,1),m.record.name&&s.delete(m.record.name),m.children.forEach(l),m.alias.forEach(l))}}function c(){return n}function u(m){const _=gv(m,n);n.splice(_,0,m),m.record.name&&!Hu(m)&&s.set(m.record.name,m)}function h(m,_){let y,w={},S,x;if("name"in m&&m.name){if(y=s.get(m.name),!y)throw qs(Ke.MATCHER_NOT_FOUND,{location:m});x=y.record.name,w=Oe(ju(_.params,y.keys.filter($=>!$.optional).concat(y.parent?y.parent.keys.filter($=>$.optional):[]).map($=>$.name)),m.params&&ju(m.params,y.keys.map($=>$.name))),S=y.stringify(w)}else if(m.path!=null)S=m.path,y=n.find($=>$.re.test(S)),y&&(w=y.parse(S),x=y.record.name);else{if(y=_.name?s.get(_.name):n.find($=>$.re.test(_.path)),!y)throw qs(Ke.MATCHER_NOT_FOUND,{location:m,currentLocation:_});x=y.record.name,w=Oe({},_.params,m.params),S=y.stringify(w)}const D=[];let F=y;for(;F;)D.unshift(F.record),F=F.parent;return{name:x,path:S,params:w,matched:D,meta:mv(D)}}e.forEach(m=>o(m));function d(){n.length=0,s.clear()}return{addRoute:o,resolve:h,removeRoute:l,clearRoutes:d,getRoutes:c,getRecordMatcher:r}}function ju(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Bu(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:pv(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function pv(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Hu(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function mv(e){return e.reduce((t,n)=>Oe(t,n.meta),{})}function gv(e,t){let n=0,s=t.length;for(;n!==s;){const o=n+s>>1;Kd(e,t[o])<0?s=o:n=o+1}const r=_v(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function _v(e){let t=e;for(;t=t.parent;)if(zd(t)&&Kd(e,t)===0)return t}function zd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Uu(e){const t=Jt(Ki),n=Jt(Kl),s=Vt(()=>{const u=At(e.to);return t.resolve(u)}),r=Vt(()=>{const{matched:u}=s.value,{length:h}=u,d=u[h-1],m=n.matched;if(!d||!m.length)return-1;const _=m.findIndex(Vs.bind(null,d));if(_>-1)return _;const y=Vu(u[h-2]);return h>1&&Vu(d)===y&&m[m.length-1].path!==y?m.findIndex(Vs.bind(null,u[h-2])):_}),o=Vt(()=>r.value>-1&&Ev(n.params,s.value.params)),l=Vt(()=>r.value>-1&&r.value===n.matched.length-1&&Ud(n.params,s.value.params));function c(u={}){if(wv(u)){const h=t[At(e.replace)?"replace":"push"](At(e.to)).catch(gr);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>h),h}return Promise.resolve()}return{route:s,href:Vt(()=>s.value.href),isActive:o,isExactActive:l,navigate:c}}function bv(e){return e.length===1?e[0]:e}const yv=Nf({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Uu,setup(e,{slots:t}){const n=gs(Uu(e)),{options:s}=Jt(Ki),r=Vt(()=>({[qu(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[qu(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&bv(t.default(n));return e.custom?o:nd("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},o)}}}),vv=yv;function wv(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Ev(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!Zt(r)||r.length!==s.length||s.some((o,l)=>o.valueOf()!==r[l].valueOf()))return!1}return!0}function Vu(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const qu=(e,t,n)=>e??t??n,Av=Nf({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Jt(_l),r=Vt(()=>e.route||s.value),o=Jt(Du,0),l=Vt(()=>{let h=At(o);const{matched:d}=r.value;let m;for(;(m=d[h])&&!m.components;)h++;return h}),c=Vt(()=>r.value.matched[l.value]);ci(Du,Vt(()=>l.value+1)),ci(Qy,c),ci(_l,r);const u=Tt();return fr(()=>[u.value,c.value,e.name],([h,d,m],[_,y,w])=>{d&&(d.instances[m]=h,y&&y!==d&&h&&h===_&&(d.leaveGuards.size||(d.leaveGuards=y.leaveGuards),d.updateGuards.size||(d.updateGuards=y.updateGuards))),h&&d&&(!y||!Vs(d,y)||!_)&&(d.enterCallbacks[m]||[]).forEach(S=>S(h))},{flush:"post"}),()=>{const h=r.value,d=e.name,m=c.value,_=m&&m.components[d];if(!_)return Wu(n.default,{Component:_,route:h});const y=m.props[d],w=y?y===!0?h.params:typeof y=="function"?y(h):y:null,x=nd(_,Oe({},w,t,{onVnodeUnmounted:D=>{D.component.isUnmounted&&(m.instances[d]=null)},ref:u}));return Wu(n.default,{Component:x,route:h})||x}}});function Wu(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Cv=Av;function Sv(e){const t=hv(e.routes,e),n=e.parseQuery||Xy,s=e.stringifyQuery||Lu,r=e.history,o=rr(),l=rr(),c=rr(),u=Bm(kn);let h=kn;ks&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=qo.bind(null,R=>""+R),m=qo.bind(null,ky),_=qo.bind(null,Tr);function y(R,X){let O,ee;return Vd(R)?(O=t.getRecordMatcher(R),ee=X):ee=R,t.addRoute(ee,O)}function w(R){const X=t.getRecordMatcher(R);X&&t.removeRoute(X)}function S(){return t.getRoutes().map(R=>R.record)}function x(R){return!!t.getRecordMatcher(R)}function D(R,X){if(X=Oe({},X||u.value),typeof R=="string"){const A=Wo(n,R,X.path),I=t.resolve({path:A.path},X),k=r.createHref(A.fullPath);return Oe(A,I,{params:_(I.params),hash:Tr(A.hash),redirectedFrom:void 0,href:k})}let O;if(R.path!=null)O=Oe({},R,{path:Wo(n,R.path,X.path).path});else{const A=Oe({},R.params);for(const I in A)A[I]==null&&delete A[I];O=Oe({},R,{params:m(A)}),X.params=m(X.params)}const ee=t.resolve(O,X),we=R.hash||"";ee.params=d(_(ee.params));const g=My(s,Oe({},R,{hash:Py(we),path:ee.path})),b=r.createHref(g);return Oe({fullPath:g,hash:we,query:s===Lu?Yy(R.query):R.query||{}},ee,{redirectedFrom:void 0,href:b})}function F(R){return typeof R=="string"?Wo(n,R,u.value.path):Oe({},R)}function $(R,X){if(h!==R)return qs(Ke.NAVIGATION_CANCELLED,{from:X,to:R})}function H(R){return Z(R)}function te(R){return H(Oe(F(R),{replace:!0}))}function le(R,X){const O=R.matched[R.matched.length-1];if(O&&O.redirect){const{redirect:ee}=O;let we=typeof ee=="function"?ee(R,X):ee;return typeof we=="string"&&(we=we.includes("?")||we.includes("#")?we=F(we):{path:we},we.params={}),Oe({query:R.query,hash:R.hash,params:we.path!=null?{}:R.params},we)}}function Z(R,X){const O=h=D(R),ee=u.value,we=R.state,g=R.force,b=R.replace===!0,A=le(O,ee);if(A)return Z(Oe(F(A),{state:typeof A=="object"?Oe({},we,A.state):we,force:g,replace:b}),X||O);const I=O;I.redirectedFrom=X;let k;return!g&&Fy(s,ee,O)&&(k=qs(Ke.NAVIGATION_DUPLICATED,{to:I,from:ee}),P(ee,ee,!0,!1)),(k?Promise.resolve(k):fe(I,ee)).catch(N=>yn(N)?yn(N,Ke.NAVIGATION_GUARD_REDIRECT)?N:Rt(N):de(N,I,ee)).then(N=>{if(N){if(yn(N,Ke.NAVIGATION_GUARD_REDIRECT))return Z(Oe({replace:b},F(N.to),{state:typeof N.to=="object"?Oe({},we,N.to.state):we,force:g}),X||I)}else N=G(I,ee,!0,b,we);return _e(I,ee,N),N})}function B(R,X){const O=$(R,X);return O?Promise.reject(O):Promise.resolve()}function z(R){const X=ht.values().next().value;return X&&typeof X.runWithContext=="function"?X.runWithContext(R):R()}function fe(R,X){let O;const[ee,we,g]=Zy(R,X);O=zo(ee.reverse(),"beforeRouteLeave",R,X);for(const A of ee)A.leaveGuards.forEach(I=>{O.push(jn(I,R,X))});const b=B.bind(null,R,X);return O.push(b),et(O).then(()=>{O=[];for(const A of o.list())O.push(jn(A,R,X));return O.push(b),et(O)}).then(()=>{O=zo(we,"beforeRouteUpdate",R,X);for(const A of we)A.updateGuards.forEach(I=>{O.push(jn(I,R,X))});return O.push(b),et(O)}).then(()=>{O=[];for(const A of g)if(A.beforeEnter)if(Zt(A.beforeEnter))for(const I of A.beforeEnter)O.push(jn(I,R,X));else O.push(jn(A.beforeEnter,R,X));return O.push(b),et(O)}).then(()=>(R.matched.forEach(A=>A.enterCallbacks={}),O=zo(g,"beforeRouteEnter",R,X,z),O.push(b),et(O))).then(()=>{O=[];for(const A of l.list())O.push(jn(A,R,X));return O.push(b),et(O)}).catch(A=>yn(A,Ke.NAVIGATION_CANCELLED)?A:Promise.reject(A))}function _e(R,X,O){c.list().forEach(ee=>z(()=>ee(R,X,O)))}function G(R,X,O,ee,we){const g=$(R,X);if(g)return g;const b=X===kn,A=ks?history.state:{};O&&(ee||b?r.replace(R.fullPath,Oe({scroll:b&&A&&A.scroll},we)):r.push(R.fullPath,we)),u.value=R,P(R,X,O,b),Rt()}let ye;function Pe(){ye||(ye=r.listen((R,X,O)=>{if(!Je.listening)return;const ee=D(R),we=le(ee,Je.currentRoute.value);if(we){Z(Oe(we,{replace:!0,force:!0}),ee).catch(gr);return}h=ee;const g=u.value;ks&&Wy(ku(g.fullPath,O.delta),Wi()),fe(ee,g).catch(b=>yn(b,Ke.NAVIGATION_ABORTED|Ke.NAVIGATION_CANCELLED)?b:yn(b,Ke.NAVIGATION_GUARD_REDIRECT)?(Z(Oe(F(b.to),{force:!0}),ee).then(A=>{yn(A,Ke.NAVIGATION_ABORTED|Ke.NAVIGATION_DUPLICATED)&&!O.delta&&O.type===ml.pop&&r.go(-1,!1)}).catch(gr),Promise.reject()):(O.delta&&r.go(-O.delta,!1),de(b,ee,g))).then(b=>{b=b||G(ee,g,!1),b&&(O.delta&&!yn(b,Ke.NAVIGATION_CANCELLED)?r.go(-O.delta,!1):O.type===ml.pop&&yn(b,Ke.NAVIGATION_ABORTED|Ke.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),_e(ee,g,b)}).catch(gr)}))}let Ye=rr(),Ee=rr(),Ce;function de(R,X,O){Rt(R);const ee=Ee.list();return ee.length?ee.forEach(we=>we(R,X,O)):console.error(R),Promise.reject(R)}function Ct(){return Ce&&u.value!==kn?Promise.resolve():new Promise((R,X)=>{Ye.add([R,X])})}function Rt(R){return Ce||(Ce=!R,Pe(),Ye.list().forEach(([X,O])=>R?O(R):X()),Ye.reset()),R}function P(R,X,O,ee){const{scrollBehavior:we}=e;if(!ks||!we)return Promise.resolve();const g=!O&&Ky(ku(R.fullPath,0))||(ee||!O)&&history.state&&history.state.scroll||null;return Pl().then(()=>we(R,X,g)).then(b=>b&&qy(b)).catch(b=>de(b,R,X))}const He=R=>r.go(R);let Pt;const ht=new Set,Je={currentRoute:u,listening:!0,addRoute:y,removeRoute:w,clearRoutes:t.clearRoutes,hasRoute:x,getRoutes:S,resolve:D,options:e,push:H,replace:te,go:He,back:()=>He(-1),forward:()=>He(1),beforeEach:o.add,beforeResolve:l.add,afterEach:c.add,onError:Ee.add,isReady:Ct,install(R){R.component("RouterLink",vv),R.component("RouterView",Cv),R.config.globalProperties.$router=Je,Object.defineProperty(R.config.globalProperties,"$route",{enumerable:!0,get:()=>At(u)}),ks&&!Pt&&u.value===kn&&(Pt=!0,H(r.location).catch(ee=>{}));const X={};for(const ee in kn)Object.defineProperty(X,ee,{get:()=>u.value[ee],enumerable:!0});R.provide(Ki,Je),R.provide(Kl,_f(X)),R.provide(_l,u);const O=R.unmount;ht.add(R),R.unmount=function(){ht.delete(R),ht.size<1&&(h=kn,ye&&ye(),ye=null,u.value=kn,Pt=!1,Ce=!1),O()}}};function et(R){return R.reduce((X,O)=>X.then(()=>z(O)),Promise.resolve())}return Je}function Gd(){return Jt(Ki)}function Tv(e){return Jt(Kl)}const xv=4,Ov=5e3,Rv=8e3,Vn=gs([]),ms=new Map;let Pv=1;const Jd=e=>{const t=ms.get(e);t&&clearTimeout(t.handle),ms.delete(e)},zl=e=>{Jd(e);const t=Vn.findIndex(n=>n.id===e);t!==-1&&Vn.splice(t,1)},Xd=(e,t)=>{Jd(e),ms.set(e,{handle:setTimeout(()=>zl(e),t),startedAt:Date.now(),remaining:t})},Nv=e=>{const t=ms.get(e);t&&(clearTimeout(t.handle),t.remaining=Math.max(0,t.remaining-(Date.now()-t.startedAt)),t.handle=null)},Iv=e=>{const t=ms.get(e);!t||t.handle!==null||Xd(e,t.remaining)},kv=(e,t="success",n)=>{const s=["success","warning","error","info"].includes(t)?t:"info",r=n??(s==="error"?Rv:Ov),o=Pv++;for(Vn.push({id:o,text:String(e??""),type:s,timeout:r});Vn.length>xv;)zl(Vn[0].id);return r>0&&Xd(o,r),o},Lv=()=>{ms.forEach(e=>clearTimeout(e.handle)),ms.clear(),Vn.splice(0,Vn.length)};function Gl(){return{toasts:Vn,show:kv,dismiss:zl,pause:Nv,resume:Iv,clear:Lv}}const Dv={class:"toast-stack"},Mv=["role","aria-live","onMouseenter","onMouseleave"],Fv={class:"app-toast-text"},$v=["onClick"],jv={__name:"ToastContainer",setup(e){const{toasts:t,dismiss:n,pause:s,resume:r,clear:o}=Gl(),l={success:"fa-check-circle",warning:"fa-exclamation-triangle",error:"fa-exclamation-circle",info:"fa-info-circle"};return Il(o),(c,u)=>(Ve(),nt("div",Dv,[Ue(x_,{name:"toast",tag:"div",class:"toast-stack-list"},{default:fn(()=>[(Ve(!0),nt(ot,null,gg(At(t),h=>(Ve(),nt("div",{key:h.id,class:An(["app-toast","app-toast-"+h.type]),role:h.type==="error"?"alert":"status","aria-live":h.type==="error"?"assertive":"polite","aria-atomic":"true",onMouseenter:d=>At(s)(h.id),onMouseleave:d=>At(r)(h.id)},[j("i",{class:An(["fas app-toast-icon",l[h.type]]),"aria-hidden":"true"},null,2),j("div",Fv,cs(h.text),1),j("button",{type:"button",class:"app-toast-close","aria-label":"Close notification",onClick:d=>At(n)(h.id)},[...u[0]||(u[0]=[j("i",{class:"fas fa-times","aria-hidden":"true"},null,-1)])],8,$v),h.timeout>0?(Ve(),nt("div",{key:0,class:"app-toast-progress",style:Ii({animationDuration:h.timeout+"ms"})},null,4)):Hn("",!0)],42,Mv))),128))]),_:1})]))}},lr=gs({pki_ready:!0,server_ready:!0,missing:[],state:"idle"}),Bv=async()=>{if(!localStorage.getItem("ovpmon_token"))return!1;try{const{profilesApiClient:e}=ql(),n=(await e.get("/system/init/status")).data||{};return lr.pki_ready=n.pki_ready!==!1,lr.server_ready=n.server_ready!==!1,lr.missing=n.missing||[],lr.state=n.state||"idle",!0}catch{return!1}};function Yd(){return{status:lr,refresh:Bv}}const Qd="theme",Jl=Tt(!1),Zd=e=>{Jl.value=e==="dark",document.documentElement.setAttribute("data-theme",e)},Hv=()=>{let e=null;try{e=localStorage.getItem(Qd)}catch{}e!=="dark"&&e!=="light"&&(e=window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"),Zd(e)},Uv=()=>{const e=Jl.value?"light":"dark";Zd(e);try{localStorage.setItem(Qd,e)}catch{}};function Vv(){return{isDark:Jl,toggleTheme:Uv}}function Xw(e){let t=null;Mi(()=>{t=new MutationObserver(n=>{n.some(s=>s.attributeName==="data-theme")&&e()}),t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}),kl(()=>t?.disconnect())}const qv={key:0,class:"d-flex justify-content-center align-items-center vh-100"},Wv={class:"sidebar-header"},Kv={class:"sidebar-menu"},zv={class:"sidebar-footer"},Gv={class:"main-content"},Jv={key:0,class:"top-navbar"},Xv={class:"d-flex align-items-center gap-3"},Yv={class:"navbar-actions"},Qv={class:"header-timezone d-none d-lg-inline-flex"},Zv={class:"user-profile ms-2"},ew={class:"user-avatar-small bg-primary text-white"},tw={class:"user-meta d-none d-md-block"},nw={class:"username"},sw={class:"content-wrapper"},rw={__name:"App",setup(e){const{loadConfig:t,isLoaded:n}=cd(),{apiClient:s}=ql(),r=Tt(new Date().toLocaleTimeString("en-us",{timeZoneName:"short"}).split(" ")[2]||"UTC"),{isDark:o,toggleTheme:l}=Vv(),c=Tt(0),u=Tt(!1),h=Tt(!1),d=Tv(),m=Gd(),{status:_,refresh:y}=Yd(),w=Gl(),S=Vt(()=>(d.fullPath,!d.meta.public&&!!localStorage.getItem("ovpmon_token"))),x=Tt(localStorage.getItem("ovpmon_user")||""),D=async()=>{if(!localStorage.getItem("ovpmon_token")){x.value="";return}x.value=localStorage.getItem("ovpmon_user")||"";try{const Z=await s.get("/user/me");Z.data?.username&&(x.value=Z.data.username,localStorage.setItem("ovpmon_user",Z.data.username))}catch{}},F=()=>{x.value=localStorage.getItem("ovpmon_user")||""},$=()=>{w.show("Initialize PKI first","info"),d.name!=="PKIConfig"&&m.push("/config/pki")},H=()=>{localStorage.removeItem("ovpmon_token"),localStorage.removeItem("ovpmon_user"),m.push("/login")},te=()=>{h.value=!h.value,localStorage.setItem("sidebarCompact",h.value)},le=()=>{c.value++};return fr(()=>d.path,()=>{u.value=!1,S.value&&(D(),y())}),Mi(async()=>{await t(),window.addEventListener("ovpmon-user-changed",F),S.value&&(D(),y());const Z=localStorage.getItem("sidebarCompact");h.value=Z==="true"}),(Z,B)=>{const z=Lc("router-link"),fe=Lc("router-view");return Ve(),nt(ot,null,[At(n)?(Ve(),nt("div",{key:1,class:An(["app-wrapper",{"mobile-nav-active":u.value,"sidebar-compact":h.value,"no-sidebar":!S.value}])},[u.value&&S.value?(Ve(),nt("div",{key:0,class:"mobile-overlay",onClick:B[0]||(B[0]=_e=>u.value=!1)})):Hn("",!0),S.value?(Ve(),nt("aside",{key:1,class:An(["sidebar",{compact:h.value}])},[j("div",Wv,[B[6]||(B[6]=j("img",{src:H_,alt:"OpenVPN",class:"sidebar-brand-icon"},null,-1)),B[7]||(B[7]=j("span",{class:"brand-text"},"OpenVPN Controller",-1)),j("button",{class:"btn btn-link text-muted d-md-none ms-auto",onClick:B[1]||(B[1]=_e=>u.value=!1)},[...B[5]||(B[5]=[j("i",{class:"fas fa-times"},null,-1)])])]),j("nav",Kv,[B[17]||(B[17]=j("div",{class:"nav-section-header"},"MONITORING",-1)),Ue(z,{to:"/",class:"nav-link","active-class":"active",title:"Analytics"},{default:fn(()=>[...B[8]||(B[8]=[j("i",{class:"fas fa-chart-line"},null,-1),vt(),j("span",null,"Analytics",-1)])]),_:1}),Ue(z,{to:"/clients",class:"nav-link","active-class":"active",title:"Clients"},{default:fn(()=>[...B[9]||(B[9]=[j("i",{class:"fas fa-network-wired"},null,-1),vt(),j("span",null,"Clients",-1)])]),_:1}),B[18]||(B[18]=j("div",{class:"nav-section-header mt-3"},"CONFIGURATION",-1)),Ue(z,{to:"/config/pki",class:"nav-link","active-class":"active",title:"PKI"},{default:fn(()=>[...B[10]||(B[10]=[j("i",{class:"fas fa-fingerprint"},null,-1),vt(),j("span",null,"PKI",-1)])]),_:1}),At(_).pki_ready?(Ve(),Er(z,{key:0,to:"/config/vpn",class:"nav-link","active-class":"active",title:"VPN"},{default:fn(()=>[...B[11]||(B[11]=[j("i",{class:"fas fa-server"},null,-1),vt(),j("span",null,"VPN",-1)])]),_:1})):(Ve(),nt("a",{key:1,href:"/config/pki",class:"nav-link nav-link-locked",title:"Initialize PKI first",onClick:al($,["prevent"])},[...B[12]||(B[12]=[j("i",{class:"fas fa-lock"},null,-1),vt(),j("span",null,"VPN",-1)])])),B[19]||(B[19]=j("div",{class:"nav-section-header mt-3"},"MANAGEMENT",-1)),Ue(z,{to:"/certificates",class:"nav-link","active-class":"active",title:"Certificates"},{default:fn(()=>[...B[13]||(B[13]=[j("i",{class:"fas fa-certificate"},null,-1),vt(),j("span",null,"Certificates",-1)])]),_:1}),Ue(z,{to:"/server",class:"nav-link","active-class":"active",title:"Server Process"},{default:fn(()=>[...B[14]||(B[14]=[j("i",{class:"fas fa-terminal"},null,-1),vt(),j("span",null,"Server Process",-1)])]),_:1}),Ue(z,{to:"/backup",class:"nav-link","active-class":"active",title:"Backup and Restore"},{default:fn(()=>[...B[15]||(B[15]=[j("i",{class:"fas fa-box-archive"},null,-1),vt(),j("span",null,"Backup and Restore",-1)])]),_:1}),B[20]||(B[20]=j("div",{class:"nav-section-header mt-3"},"ACCOUNT",-1)),Ue(z,{to:"/account",class:"nav-link","active-class":"active",title:"Account Settings"},{default:fn(()=>[...B[16]||(B[16]=[j("i",{class:"fas fa-user-cog"},null,-1),vt(),j("span",null,"Account Settings",-1)])]),_:1}),B[21]||(B[21]=j("div",{class:"mt-auto"},null,-1))]),j("div",zv,[j("button",{class:"btn btn-link toggle-btn d-none d-md-block w-100",onClick:te,title:"Toggle Sidebar"},[j("i",{class:An(["fas",h.value?"fa-chevron-right":"fa-chevron-left"])},null,2)])])],2)):Hn("",!0),j("main",Gv,[S.value?(Ve(),nt("header",Jv,[j("div",Xv,[j("button",{class:"btn-header d-md-none",onClick:B[2]||(B[2]=_e=>u.value=!u.value)},[...B[22]||(B[22]=[j("i",{class:"fas fa-bars"},null,-1)])]),B[23]||(B[23]=j("div",{class:"page-title"},null,-1))]),j("div",Yv,[j("span",Qv,[B[24]||(B[24]=j("i",{class:"fas fa-globe me-1 text-muted"},null,-1)),vt(cs(r.value),1)]),j("button",{class:"btn-header",onClick:B[3]||(B[3]=(..._e)=>At(l)&&At(l)(..._e)),title:"Toggle Theme"},[j("i",{class:An(["fas",At(o)?"fa-sun":"fa-moon"])},null,2)]),j("button",{class:"btn-header me-2",onClick:le,title:"Refresh"},[...B[25]||(B[25]=[j("i",{class:"fas fa-sync-alt"},null,-1)])]),B[27]||(B[27]=j("div",{class:"header-divider d-none d-md-block"},null,-1)),j("div",Zv,[j("div",ew,cs(x.value[0]?.toUpperCase()||"U"),1),j("div",tw,[j("span",nw,cs(x.value),1)])]),j("button",{class:"btn-header btn-logout ms-2",onClick:H,title:"Logout"},[...B[26]||(B[26]=[j("i",{class:"fas fa-sign-out-alt"},null,-1)])])])])):Hn("",!0),j("div",sw,[(Ve(),Er(fe,{key:Z.$route.fullPath+"-"+c.value}))])])],2)):(Ve(),nt("div",qv,[...B[4]||(B[4]=[j("div",{class:"spinner-border text-primary",role:"status"},[j("span",{class:"visually-hidden"},"Loading...")],-1)])])),Ue(jv)],64)}}},iw="modulepreload",ow=function(e){return"/"+e},Ku={},Ln=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){let u=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");r=u(n.map(h=>{if(h=ow(h),h in Ku)return;Ku[h]=!0;const d=h.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${m}`))return;const _=document.createElement("link");if(_.rel=d?"stylesheet":iw,d||(_.as="script"),_.crossOrigin="",_.href=h,c&&_.setAttribute("nonce",c),document.head.appendChild(_),d)return new Promise((y,w)=>{_.addEventListener("load",y),_.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})},lw={class:"login-page"},aw={class:"login-card"},cw={class:"login-body"},uw={class:"mb-4"},fw={class:"input-group"},dw={class:"mb-4"},hw={class:"input-group"},pw={key:0,class:"alert alert-danger fade show mb-4"},mw=["disabled"],gw={key:0,class:"spinner-border spinner-border-sm me-2"},_w={class:"mb-4"},bw={key:0,class:"alert alert-danger fade show mb-4"},yw=["disabled"],vw={key:0,class:"spinner-border spinner-border-sm me-2"},ww={__name:"Login",setup(e){const t=Gd(),{authApiClient:n}=ql(),s=Tt(!1),r=Tt(""),o=Tt(!1),l=Tt(""),c=Tt(""),u=gs({username:"",password:""}),h=async()=>{s.value=!0,r.value="";try{const _=await n.post("/login",u);_.data.requires_2fa?(o.value=!0,l.value=_.data.temp_token):(localStorage.setItem("ovpmon_token",_.data.token),localStorage.setItem("ovpmon_user",_.data.username),t.push("/"))}catch(_){console.error("Login Error:",_),r.value=_.response?.data?.error||"Login failed. Please check your connection."}finally{s.value=!1}},d=async()=>{s.value=!0,r.value="";try{const _=await n.post("/verify-2fa",{temp_token:l.value,otp:c.value});localStorage.setItem("ovpmon_token",_.data.token),localStorage.setItem("ovpmon_user",_.data.username),t.push("/")}catch(_){r.value=_.response?.data?.error||"Verification failed."}finally{s.value=!1}},m=()=>{o.value=!1,l.value="",c.value="",r.value=""};return(_,y)=>(Ve(),nt("div",lw,[j("div",aw,[y[12]||(y[12]=j("div",{class:"login-header"},[j("div",{class:"brand-logo"},[j("i",{class:"fas fa-shield-alt"})]),j("h1",null,"OpenVPN Controller"),j("p",{class:"text-muted"},"Secure Access Control")],-1)),j("div",cw,[o.value?(Ve(),nt("form",{key:1,onSubmit:al(d,["prevent"])},[y[11]||(y[11]=j("div",{class:"text-center mb-4"},[j("i",{class:"fas fa-key fa-3x text-warning mb-3"}),j("h3",null,"Two-Factor Authentication"),j("p",{class:"text-muted"},"Enter the 6-digit code from your authenticator app.")],-1)),j("div",_w,[Io(j("input",{type:"text",class:"form-control form-control-lg text-center fw-bold","onUpdate:modelValue":y[2]||(y[2]=w=>c.value=w),placeholder:"000 000",maxlength:"6",inputmode:"numeric",autocomplete:"one-time-code","aria-label":"6-digit authentication code",required:"",autofocus:""},null,512),[[$o,c.value]])]),r.value?(Ve(),nt("div",bw,[y[9]||(y[9]=j("i",{class:"fas fa-exclamation-circle me-2"},null,-1)),vt(cs(r.value),1)])):Hn("",!0),j("button",{type:"submit",class:"btn btn-warning w-100 py-2 fw-bold",disabled:s.value},[s.value?(Ve(),nt("span",vw)):Hn("",!0),y[10]||(y[10]=vt(" Verify & Continue ",-1))],8,yw),j("button",{type:"button",class:"btn btn-link w-100 mt-2 text-muted",onClick:m}," Back to login ")],32)):(Ve(),nt("form",{key:0,onSubmit:al(h,["prevent"])},[j("div",uw,[y[4]||(y[4]=j("label",{class:"form-label",for:"loginUsername"},"Username",-1)),j("div",fw,[y[3]||(y[3]=j("span",{class:"input-group-text"},[j("i",{class:"fas fa-user"})],-1)),Io(j("input",{id:"loginUsername",type:"text",class:"form-control","onUpdate:modelValue":y[0]||(y[0]=w=>u.username=w),placeholder:"Enter username",autocomplete:"username",required:""},null,512),[[$o,u.username]])])]),j("div",dw,[y[6]||(y[6]=j("label",{class:"form-label",for:"loginPassword"},"Password",-1)),j("div",hw,[y[5]||(y[5]=j("span",{class:"input-group-text"},[j("i",{class:"fas fa-lock"})],-1)),Io(j("input",{id:"loginPassword",type:"password",class:"form-control","onUpdate:modelValue":y[1]||(y[1]=w=>u.password=w),placeholder:"Enter password",autocomplete:"current-password",required:""},null,512),[[$o,u.password]])])]),r.value?(Ve(),nt("div",pw,[y[7]||(y[7]=j("i",{class:"fas fa-exclamation-circle me-2"},null,-1)),vt(cs(r.value),1)])):Hn("",!0),j("button",{type:"submit",class:"btn btn-primary w-100 py-2 fw-bold",disabled:s.value},[s.value?(Ve(),nt("span",gw)):Hn("",!0),y[8]||(y[8]=vt(" Sign In ",-1))],8,mw)],32))]),y[13]||(y[13]=j("div",{class:"login-footer text-center mt-4"},[j("p",{class:"small text-muted"},"© 2026 OpenVPN Controller")],-1))])]))}},Ew=[{path:"/",name:"Analytics",component:()=>Ln(()=>import("./Analytics-wS3sZsf7.js"),__vite__mapDeps([0,1,2,3]))},{path:"/clients",name:"Clients",component:()=>Ln(()=>import("./Clients-B4FTmkE-.js"),__vite__mapDeps([4,3,1,2,5]))},{path:"/certificates",name:"Certificates",component:()=>Ln(()=>import("./Certificates-Q5PSlJMg.js"),__vite__mapDeps([6,7,5]))},{path:"/config/pki",name:"PKIConfig",component:()=>Ln(()=>import("./PKIConfig-aTZFQ7nU.js"),__vite__mapDeps([8,7,5]))},{path:"/config/vpn",name:"VPNConfig",component:()=>Ln(()=>import("./VPNConfig-BwEwKZqY.js"),[]),meta:{requiresPki:!0}},{path:"/server",name:"ServerManagement",component:()=>Ln(()=>import("./ServerManagement-BrgZCXB4.js"),__vite__mapDeps([9,7,5]))},{path:"/backup",name:"BackupRestore",component:()=>Ln(()=>import("./BackupRestore-b-fUBt2d.js"),__vite__mapDeps([10,3,7,5]))},{path:"/account",name:"Account",component:()=>Ln(()=>import("./Account-D3bmpB1v.js"),__vite__mapDeps([11,7,5]))},{path:"/login",name:"Login",component:ww,meta:{public:!0}},{path:"/:pathMatch(.*)*",redirect:"/"}],eh=Sv({history:sv(),routes:Ew});eh.beforeEach(async(e,t,n)=>{const s=!!localStorage.getItem("ovpmon_token");if(!e.meta.public&&!s)n({name:"Login"});else if(e.name==="Login"&&s)n({name:"Analytics"});else if(e.meta.requiresPki){const{status:r,refresh:o}=Yd();await o()&&!r.pki_ready?(Gl().show("Initialize PKI before configuring the server","warning"),n({name:"PKIConfig"})):n()}else n()});var _i={exports:{}};var Aw=_i.exports,zu;function Cw(){return zu||(zu=1,(function(e,t){(function(n,s){e.exports=s()})(Aw,function(){const n=new Map,s={set(f,i,a){n.has(f)||n.set(f,new Map);const p=n.get(f);p.has(i)||p.size===0?p.set(i,a):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(p.keys())[0]}.`)},get:(f,i)=>n.has(f)&&n.get(f).get(i)||null,remove(f,i){if(!n.has(f))return;const a=n.get(f);a.delete(i),a.size===0&&n.delete(f)}},r="transitionend",o=f=>(f&&window.CSS&&window.CSS.escape&&(f=f.replace(/#([^\s"#']+)/g,(i,a)=>`#${CSS.escape(a)}`)),f),l=f=>f==null?`${f}`:Object.prototype.toString.call(f).match(/\s([a-z]+)/i)[1].toLowerCase(),c=f=>{f.dispatchEvent(new Event(r))},u=f=>!(!f||typeof f!="object")&&(f.jquery!==void 0&&(f=f[0]),f.nodeType!==void 0),h=f=>u(f)?f.jquery?f[0]:f:typeof f=="string"&&f.length>0?document.querySelector(o(f)):null,d=f=>{if(!u(f)||f.getClientRects().length===0)return!1;const i=getComputedStyle(f).getPropertyValue("visibility")==="visible",a=f.closest("details:not([open])");if(!a)return i;if(a!==f){const p=f.closest("summary");if(p&&p.parentNode!==a||p===null)return!1}return i},m=f=>!f||f.nodeType!==Node.ELEMENT_NODE||!!f.classList.contains("disabled")||(f.disabled!==void 0?f.disabled:f.hasAttribute("disabled")&&f.getAttribute("disabled")!=="false"),_=f=>{if(!document.documentElement.attachShadow)return null;if(typeof f.getRootNode=="function"){const i=f.getRootNode();return i instanceof ShadowRoot?i:null}return f instanceof ShadowRoot?f:f.parentNode?_(f.parentNode):null},y=()=>{},w=f=>{f.offsetHeight},S=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,x=[],D=()=>document.documentElement.dir==="rtl",F=f=>{var i;i=()=>{const a=S();if(a){const p=f.NAME,v=a.fn[p];a.fn[p]=f.jQueryInterface,a.fn[p].Constructor=f,a.fn[p].noConflict=()=>(a.fn[p]=v,f.jQueryInterface)}},document.readyState==="loading"?(x.length||document.addEventListener("DOMContentLoaded",()=>{for(const a of x)a()}),x.push(i)):i()},$=(f,i=[],a=f)=>typeof f=="function"?f.call(...i):a,H=(f,i,a=!0)=>{if(!a)return void $(f);const p=(T=>{if(!T)return 0;let{transitionDuration:L,transitionDelay:V}=window.getComputedStyle(T);const Y=Number.parseFloat(L),Q=Number.parseFloat(V);return Y||Q?(L=L.split(",")[0],V=V.split(",")[0],1e3*(Number.parseFloat(L)+Number.parseFloat(V))):0})(i)+5;let v=!1;const E=({target:T})=>{T===i&&(v=!0,i.removeEventListener(r,E),$(f))};i.addEventListener(r,E),setTimeout(()=>{v||c(i)},p)},te=(f,i,a,p)=>{const v=f.length;let E=f.indexOf(i);return E===-1?!a&&p?f[v-1]:f[0]:(E+=a?1:-1,p&&(E=(E+v)%v),f[Math.max(0,Math.min(E,v-1))])},le=/[^.]*(?=\..*)\.|.*/,Z=/\..*/,B=/::\d+$/,z={};let fe=1;const _e={mouseenter:"mouseover",mouseleave:"mouseout"},G=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function ye(f,i){return i&&`${i}::${fe++}`||f.uidEvent||fe++}function Pe(f){const i=ye(f);return f.uidEvent=i,z[i]=z[i]||{},z[i]}function Ye(f,i,a=null){return Object.values(f).find(p=>p.callable===i&&p.delegationSelector===a)}function Ee(f,i,a){const p=typeof i=="string",v=p?a:i||a;let E=Rt(f);return G.has(E)||(E=f),[p,v,E]}function Ce(f,i,a,p,v){if(typeof i!="string"||!f)return;let[E,T,L]=Ee(i,a,p);i in _e&&(T=(ce=>function(ae){if(!ae.relatedTarget||ae.relatedTarget!==ae.delegateTarget&&!ae.delegateTarget.contains(ae.relatedTarget))return ce.call(this,ae)})(T));const V=Pe(f),Y=V[L]||(V[L]={}),Q=Ye(Y,T,E?a:null);if(Q)return void(Q.oneOff=Q.oneOff&&v);const K=ye(T,i.replace(le,"")),ge=E?(function(oe,ce,ae){return function ue(Le){const je=oe.querySelectorAll(ce);for(let{target:ve}=Le;ve&&ve!==this;ve=ve.parentNode)for(const Te of je)if(Te===ve)return He(Le,{delegateTarget:ve}),ue.oneOff&&P.off(oe,Le.type,ce,ae),ae.apply(ve,[Le])}})(f,a,T):(function(oe,ce){return function ae(ue){return He(ue,{delegateTarget:oe}),ae.oneOff&&P.off(oe,ue.type,ce),ce.apply(oe,[ue])}})(f,T);ge.delegationSelector=E?a:null,ge.callable=T,ge.oneOff=v,ge.uidEvent=K,Y[K]=ge,f.addEventListener(L,ge,E)}function de(f,i,a,p,v){const E=Ye(i[a],p,v);E&&(f.removeEventListener(a,E,!!v),delete i[a][E.uidEvent])}function Ct(f,i,a,p){const v=i[a]||{};for(const[E,T]of Object.entries(v))E.includes(p)&&de(f,i,a,T.callable,T.delegationSelector)}function Rt(f){return f=f.replace(Z,""),_e[f]||f}const P={on(f,i,a,p){Ce(f,i,a,p,!1)},one(f,i,a,p){Ce(f,i,a,p,!0)},off(f,i,a,p){if(typeof i!="string"||!f)return;const[v,E,T]=Ee(i,a,p),L=T!==i,V=Pe(f),Y=V[T]||{},Q=i.startsWith(".");if(E===void 0){if(Q)for(const K of Object.keys(V))Ct(f,V,K,i.slice(1));for(const[K,ge]of Object.entries(Y)){const oe=K.replace(B,"");L&&!i.includes(oe)||de(f,V,T,ge.callable,ge.delegationSelector)}}else{if(!Object.keys(Y).length)return;de(f,V,T,E,v?a:null)}},trigger(f,i,a){if(typeof i!="string"||!f)return null;const p=S();let v=null,E=!0,T=!0,L=!1;i!==Rt(i)&&p&&(v=p.Event(i,a),p(f).trigger(v),E=!v.isPropagationStopped(),T=!v.isImmediatePropagationStopped(),L=v.isDefaultPrevented());const V=He(new Event(i,{bubbles:E,cancelable:!0}),a);return L&&V.preventDefault(),T&&f.dispatchEvent(V),V.defaultPrevented&&v&&v.preventDefault(),V}};function He(f,i={}){for(const[a,p]of Object.entries(i))try{f[a]=p}catch{Object.defineProperty(f,a,{configurable:!0,get:()=>p})}return f}function Pt(f){if(f==="true")return!0;if(f==="false")return!1;if(f===Number(f).toString())return Number(f);if(f===""||f==="null")return null;if(typeof f!="string")return f;try{return JSON.parse(decodeURIComponent(f))}catch{return f}}function ht(f){return f.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}const Je={setDataAttribute(f,i,a){f.setAttribute(`data-bs-${ht(i)}`,a)},removeDataAttribute(f,i){f.removeAttribute(`data-bs-${ht(i)}`)},getDataAttributes(f){if(!f)return{};const i={},a=Object.keys(f.dataset).filter(p=>p.startsWith("bs")&&!p.startsWith("bsConfig"));for(const p of a){let v=p.replace(/^bs/,"");v=v.charAt(0).toLowerCase()+v.slice(1),i[v]=Pt(f.dataset[p])}return i},getDataAttribute:(f,i)=>Pt(f.getAttribute(`data-bs-${ht(i)}`))};class et{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(i){return i=this._mergeConfigObj(i),i=this._configAfterMerge(i),this._typeCheckConfig(i),i}_configAfterMerge(i){return i}_mergeConfigObj(i,a){const p=u(a)?Je.getDataAttribute(a,"config"):{};return{...this.constructor.Default,...typeof p=="object"?p:{},...u(a)?Je.getDataAttributes(a):{},...typeof i=="object"?i:{}}}_typeCheckConfig(i,a=this.constructor.DefaultType){for(const[p,v]of Object.entries(a)){const E=i[p],T=u(E)?"element":l(E);if(!new RegExp(v).test(T))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${p}" provided type "${T}" but expected type "${v}".`)}}}class R extends et{constructor(i,a){super(),(i=h(i))&&(this._element=i,this._config=this._getConfig(a),s.set(this._element,this.constructor.DATA_KEY,this))}dispose(){s.remove(this._element,this.constructor.DATA_KEY),P.off(this._element,this.constructor.EVENT_KEY);for(const i of Object.getOwnPropertyNames(this))this[i]=null}_queueCallback(i,a,p=!0){H(i,a,p)}_getConfig(i){return i=this._mergeConfigObj(i,this._element),i=this._configAfterMerge(i),this._typeCheckConfig(i),i}static getInstance(i){return s.get(h(i),this.DATA_KEY)}static getOrCreateInstance(i,a={}){return this.getInstance(i)||new this(i,typeof a=="object"?a:null)}static get VERSION(){return"5.3.8"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(i){return`${i}${this.EVENT_KEY}`}}const X=f=>{let i=f.getAttribute("data-bs-target");if(!i||i==="#"){let a=f.getAttribute("href");if(!a||!a.includes("#")&&!a.startsWith("."))return null;a.includes("#")&&!a.startsWith("#")&&(a=`#${a.split("#")[1]}`),i=a&&a!=="#"?a.trim():null}return i?i.split(",").map(a=>o(a)).join(","):null},O={find:(f,i=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(i,f)),findOne:(f,i=document.documentElement)=>Element.prototype.querySelector.call(i,f),children:(f,i)=>[].concat(...f.children).filter(a=>a.matches(i)),parents(f,i){const a=[];let p=f.parentNode.closest(i);for(;p;)a.push(p),p=p.parentNode.closest(i);return a},prev(f,i){let a=f.previousElementSibling;for(;a;){if(a.matches(i))return[a];a=a.previousElementSibling}return[]},next(f,i){let a=f.nextElementSibling;for(;a;){if(a.matches(i))return[a];a=a.nextElementSibling}return[]},focusableChildren(f){const i=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(a=>`${a}:not([tabindex^="-"])`).join(",");return this.find(i,f).filter(a=>!m(a)&&d(a))},getSelectorFromElement(f){const i=X(f);return i&&O.findOne(i)?i:null},getElementFromSelector(f){const i=X(f);return i?O.findOne(i):null},getMultipleElementsFromSelector(f){const i=X(f);return i?O.find(i):[]}},ee=(f,i="hide")=>{const a=`click.dismiss${f.EVENT_KEY}`,p=f.NAME;P.on(document,a,`[data-bs-dismiss="${p}"]`,function(v){if(["A","AREA"].includes(this.tagName)&&v.preventDefault(),m(this))return;const E=O.getElementFromSelector(this)||this.closest(`.${p}`);f.getOrCreateInstance(E)[i]()})},we=".bs.alert",g=`close${we}`,b=`closed${we}`;class A extends R{static get NAME(){return"alert"}close(){if(P.trigger(this._element,g).defaultPrevented)return;this._element.classList.remove("show");const i=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,i)}_destroyElement(){this._element.remove(),P.trigger(this._element,b),this.dispose()}static jQueryInterface(i){return this.each(function(){const a=A.getOrCreateInstance(this);if(typeof i=="string"){if(a[i]===void 0||i.startsWith("_")||i==="constructor")throw new TypeError(`No method named "${i}"`);a[i](this)}})}}ee(A,"close"),F(A);const I='[data-bs-toggle="button"]';class k extends R{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(i){return this.each(function(){const a=k.getOrCreateInstance(this);i==="toggle"&&a[i]()})}}P.on(document,"click.bs.button.data-api",I,f=>{f.preventDefault();const i=f.target.closest(I);k.getOrCreateInstance(i).toggle()}),F(k);const N=".bs.swipe",W=`touchstart${N}`,q=`touchmove${N}`,U=`touchend${N}`,M=`pointerdown${N}`,se=`pointerup${N}`,J={endCallback:null,leftCallback:null,rightCallback:null},ne={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ie extends et{constructor(i,a){super(),this._element=i,i&&ie.isSupported()&&(this._config=this._getConfig(a),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return J}static get DefaultType(){return ne}static get NAME(){return"swipe"}dispose(){P.off(this._element,N)}_start(i){this._supportPointerEvents?this._eventIsPointerPenTouch(i)&&(this._deltaX=i.clientX):this._deltaX=i.touches[0].clientX}_end(i){this._eventIsPointerPenTouch(i)&&(this._deltaX=i.clientX-this._deltaX),this._handleSwipe(),$(this._config.endCallback)}_move(i){this._deltaX=i.touches&&i.touches.length>1?0:i.touches[0].clientX-this._deltaX}_handleSwipe(){const i=Math.abs(this._deltaX);if(i<=40)return;const a=i/this._deltaX;this._deltaX=0,a&&$(a>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(P.on(this._element,M,i=>this._start(i)),P.on(this._element,se,i=>this._end(i)),this._element.classList.add("pointer-event")):(P.on(this._element,W,i=>this._start(i)),P.on(this._element,q,i=>this._move(i)),P.on(this._element,U,i=>this._end(i)))}_eventIsPointerPenTouch(i){return this._supportPointerEvents&&(i.pointerType==="pen"||i.pointerType==="touch")}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const he=".bs.carousel",Ne=".data-api",Se="ArrowLeft",at="ArrowRight",Xe="next",st="prev",rt="left",tn="right",Dr=`slide${he}`,it=`slid${he}`,Mt=`keydown${he}`,Mr=`mouseenter${he}`,Fr=`mouseleave${he}`,nh=`dragstart${he}`,sh=`load${he}${Ne}`,rh=`click${he}${Ne}`,Xl="carousel",$r="active",Yl=".active",Ql=".carousel-item",ih=Yl+Ql,oh={[Se]:tn,[at]:rt},lh={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},ah={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class _s extends R{constructor(i,a){super(i,a),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=O.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===Xl&&this.cycle()}static get Default(){return lh}static get DefaultType(){return ah}static get NAME(){return"carousel"}next(){this._slide(Xe)}nextWhenVisible(){!document.hidden&&d(this._element)&&this.next()}prev(){this._slide(st)}pause(){this._isSliding&&c(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?P.one(this._element,it,()=>this.cycle()):this.cycle())}to(i){const a=this._getItems();if(i>a.length-1||i<0)return;if(this._isSliding)return void P.one(this._element,it,()=>this.to(i));const p=this._getItemIndex(this._getActive());if(p===i)return;const v=i>p?Xe:st;this._slide(v,a[i])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(i){return i.defaultInterval=i.interval,i}_addEventListeners(){this._config.keyboard&&P.on(this._element,Mt,i=>this._keydown(i)),this._config.pause==="hover"&&(P.on(this._element,Mr,()=>this.pause()),P.on(this._element,Fr,()=>this._maybeEnableCycle())),this._config.touch&&ie.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const a of O.find(".carousel-item img",this._element))P.on(a,nh,p=>p.preventDefault());const i={leftCallback:()=>this._slide(this._directionToOrder(rt)),rightCallback:()=>this._slide(this._directionToOrder(tn)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new ie(this._element,i)}_keydown(i){if(/input|textarea/i.test(i.target.tagName))return;const a=oh[i.key];a&&(i.preventDefault(),this._slide(this._directionToOrder(a)))}_getItemIndex(i){return this._getItems().indexOf(i)}_setActiveIndicatorElement(i){if(!this._indicatorsElement)return;const a=O.findOne(Yl,this._indicatorsElement);a.classList.remove($r),a.removeAttribute("aria-current");const p=O.findOne(`[data-bs-slide-to="${i}"]`,this._indicatorsElement);p&&(p.classList.add($r),p.setAttribute("aria-current","true"))}_updateInterval(){const i=this._activeElement||this._getActive();if(!i)return;const a=Number.parseInt(i.getAttribute("data-bs-interval"),10);this._config.interval=a||this._config.defaultInterval}_slide(i,a=null){if(this._isSliding)return;const p=this._getActive(),v=i===Xe,E=a||te(this._getItems(),p,v,this._config.wrap);if(E===p)return;const T=this._getItemIndex(E),L=K=>P.trigger(this._element,K,{relatedTarget:E,direction:this._orderToDirection(i),from:this._getItemIndex(p),to:T});if(L(Dr).defaultPrevented||!p||!E)return;const V=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(T),this._activeElement=E;const Y=v?"carousel-item-start":"carousel-item-end",Q=v?"carousel-item-next":"carousel-item-prev";E.classList.add(Q),w(E),p.classList.add(Y),E.classList.add(Y),this._queueCallback(()=>{E.classList.remove(Y,Q),E.classList.add($r),p.classList.remove($r,Q,Y),this._isSliding=!1,L(it)},p,this._isAnimated()),V&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return O.findOne(ih,this._element)}_getItems(){return O.find(Ql,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(i){return D()?i===rt?st:Xe:i===rt?Xe:st}_orderToDirection(i){return D()?i===st?rt:tn:i===st?tn:rt}static jQueryInterface(i){return this.each(function(){const a=_s.getOrCreateInstance(this,i);if(typeof i!="number"){if(typeof i=="string"){if(a[i]===void 0||i.startsWith("_")||i==="constructor")throw new TypeError(`No method named "${i}"`);a[i]()}}else a.to(i)})}}P.on(document,rh,"[data-bs-slide], [data-bs-slide-to]",function(f){const i=O.getElementFromSelector(this);if(!i||!i.classList.contains(Xl))return;f.preventDefault();const a=_s.getOrCreateInstance(i),p=this.getAttribute("data-bs-slide-to");return p?(a.to(p),void a._maybeEnableCycle()):Je.getDataAttribute(this,"slide")==="next"?(a.next(),void a._maybeEnableCycle()):(a.prev(),void a._maybeEnableCycle())}),P.on(window,sh,()=>{const f=O.find('[data-bs-ride="carousel"]');for(const i of f)_s.getOrCreateInstance(i)}),F(_s);const Gs=".bs.collapse",ch=`show${Gs}`,uh=`shown${Gs}`,fh=`hide${Gs}`,dh=`hidden${Gs}`,hh=`click${Gs}.data-api`,zi="show",bs="collapse",jr="collapsing",ph=`:scope .${bs} .${bs}`,Gi='[data-bs-toggle="collapse"]',mh={parent:null,toggle:!0},gh={parent:"(null|element)",toggle:"boolean"};class ys extends R{constructor(i,a){super(i,a),this._isTransitioning=!1,this._triggerArray=[];const p=O.find(Gi);for(const v of p){const E=O.getSelectorFromElement(v),T=O.find(E).filter(L=>L===this._element);E!==null&&T.length&&this._triggerArray.push(v)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return mh}static get DefaultType(){return gh}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let i=[];if(this._config.parent&&(i=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(v=>v!==this._element).map(v=>ys.getOrCreateInstance(v,{toggle:!1}))),i.length&&i[0]._isTransitioning||P.trigger(this._element,ch).defaultPrevented)return;for(const v of i)v.hide();const a=this._getDimension();this._element.classList.remove(bs),this._element.classList.add(jr),this._element.style[a]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const p=`scroll${a[0].toUpperCase()+a.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(jr),this._element.classList.add(bs,zi),this._element.style[a]="",P.trigger(this._element,uh)},this._element,!0),this._element.style[a]=`${this._element[p]}px`}hide(){if(this._isTransitioning||!this._isShown()||P.trigger(this._element,fh).defaultPrevented)return;const i=this._getDimension();this._element.style[i]=`${this._element.getBoundingClientRect()[i]}px`,w(this._element),this._element.classList.add(jr),this._element.classList.remove(bs,zi);for(const a of this._triggerArray){const p=O.getElementFromSelector(a);p&&!this._isShown(p)&&this._addAriaAndCollapsedClass([a],!1)}this._isTransitioning=!0,this._element.style[i]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(jr),this._element.classList.add(bs),P.trigger(this._element,dh)},this._element,!0)}_isShown(i=this._element){return i.classList.contains(zi)}_configAfterMerge(i){return i.toggle=!!i.toggle,i.parent=h(i.parent),i}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const i=this._getFirstLevelChildren(Gi);for(const a of i){const p=O.getElementFromSelector(a);p&&this._addAriaAndCollapsedClass([a],this._isShown(p))}}_getFirstLevelChildren(i){const a=O.find(ph,this._config.parent);return O.find(i,this._config.parent).filter(p=>!a.includes(p))}_addAriaAndCollapsedClass(i,a){if(i.length)for(const p of i)p.classList.toggle("collapsed",!a),p.setAttribute("aria-expanded",a)}static jQueryInterface(i){const a={};return typeof i=="string"&&/show|hide/.test(i)&&(a.toggle=!1),this.each(function(){const p=ys.getOrCreateInstance(this,a);if(typeof i=="string"){if(p[i]===void 0)throw new TypeError(`No method named "${i}"`);p[i]()}})}}P.on(document,hh,Gi,function(f){(f.target.tagName==="A"||f.delegateTarget&&f.delegateTarget.tagName==="A")&&f.preventDefault();for(const i of O.getMultipleElementsFromSelector(this))ys.getOrCreateInstance(i,{toggle:!1}).toggle()}),F(ys);var pt="top",Nt="bottom",It="right",mt="left",Br="auto",vs=[pt,Nt,It,mt],Wn="start",ws="end",Zl="clippingParents",Ji="viewport",Es="popper",ea="reference",Xi=vs.reduce(function(f,i){return f.concat([i+"-"+Wn,i+"-"+ws])},[]),Yi=[].concat(vs,[Br]).reduce(function(f,i){return f.concat([i,i+"-"+Wn,i+"-"+ws])},[]),ta="beforeRead",na="read",sa="afterRead",ra="beforeMain",ia="main",oa="afterMain",la="beforeWrite",aa="write",ca="afterWrite",ua=[ta,na,sa,ra,ia,oa,la,aa,ca];function nn(f){return f?(f.nodeName||"").toLowerCase():null}function kt(f){if(f==null)return window;if(f.toString()!=="[object Window]"){var i=f.ownerDocument;return i&&i.defaultView||window}return f}function Kn(f){return f instanceof kt(f).Element||f instanceof Element}function Ft(f){return f instanceof kt(f).HTMLElement||f instanceof HTMLElement}function Qi(f){return typeof ShadowRoot<"u"&&(f instanceof kt(f).ShadowRoot||f instanceof ShadowRoot)}const Zi={name:"applyStyles",enabled:!0,phase:"write",fn:function(f){var i=f.state;Object.keys(i.elements).forEach(function(a){var p=i.styles[a]||{},v=i.attributes[a]||{},E=i.elements[a];Ft(E)&&nn(E)&&(Object.assign(E.style,p),Object.keys(v).forEach(function(T){var L=v[T];L===!1?E.removeAttribute(T):E.setAttribute(T,L===!0?"":L)}))})},effect:function(f){var i=f.state,a={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(i.elements.popper.style,a.popper),i.styles=a,i.elements.arrow&&Object.assign(i.elements.arrow.style,a.arrow),function(){Object.keys(i.elements).forEach(function(p){var v=i.elements[p],E=i.attributes[p]||{},T=Object.keys(i.styles.hasOwnProperty(p)?i.styles[p]:a[p]).reduce(function(L,V){return L[V]="",L},{});Ft(v)&&nn(v)&&(Object.assign(v.style,T),Object.keys(E).forEach(function(L){v.removeAttribute(L)}))})}},requires:["computeStyles"]};function sn(f){return f.split("-")[0]}var zn=Math.max,Hr=Math.min,As=Math.round;function eo(){var f=navigator.userAgentData;return f!=null&&f.brands&&Array.isArray(f.brands)?f.brands.map(function(i){return i.brand+"/"+i.version}).join(" "):navigator.userAgent}function fa(){return!/^((?!chrome|android).)*safari/i.test(eo())}function Cs(f,i,a){i===void 0&&(i=!1),a===void 0&&(a=!1);var p=f.getBoundingClientRect(),v=1,E=1;i&&Ft(f)&&(v=f.offsetWidth>0&&As(p.width)/f.offsetWidth||1,E=f.offsetHeight>0&&As(p.height)/f.offsetHeight||1);var T=(Kn(f)?kt(f):window).visualViewport,L=!fa()&&a,V=(p.left+(L&&T?T.offsetLeft:0))/v,Y=(p.top+(L&&T?T.offsetTop:0))/E,Q=p.width/v,K=p.height/E;return{width:Q,height:K,top:Y,right:V+Q,bottom:Y+K,left:V,x:V,y:Y}}function to(f){var i=Cs(f),a=f.offsetWidth,p=f.offsetHeight;return Math.abs(i.width-a)<=1&&(a=i.width),Math.abs(i.height-p)<=1&&(p=i.height),{x:f.offsetLeft,y:f.offsetTop,width:a,height:p}}function da(f,i){var a=i.getRootNode&&i.getRootNode();if(f.contains(i))return!0;if(a&&Qi(a)){var p=i;do{if(p&&f.isSameNode(p))return!0;p=p.parentNode||p.host}while(p)}return!1}function mn(f){return kt(f).getComputedStyle(f)}function _h(f){return["table","td","th"].indexOf(nn(f))>=0}function Rn(f){return((Kn(f)?f.ownerDocument:f.document)||window.document).documentElement}function Ur(f){return nn(f)==="html"?f:f.assignedSlot||f.parentNode||(Qi(f)?f.host:null)||Rn(f)}function ha(f){return Ft(f)&&mn(f).position!=="fixed"?f.offsetParent:null}function Js(f){for(var i=kt(f),a=ha(f);a&&_h(a)&&mn(a).position==="static";)a=ha(a);return a&&(nn(a)==="html"||nn(a)==="body"&&mn(a).position==="static")?i:a||(function(p){var v=/firefox/i.test(eo());if(/Trident/i.test(eo())&&Ft(p)&&mn(p).position==="fixed")return null;var E=Ur(p);for(Qi(E)&&(E=E.host);Ft(E)&&["html","body"].indexOf(nn(E))<0;){var T=mn(E);if(T.transform!=="none"||T.perspective!=="none"||T.contain==="paint"||["transform","perspective"].indexOf(T.willChange)!==-1||v&&T.willChange==="filter"||v&&T.filter&&T.filter!=="none")return E;E=E.parentNode}return null})(f)||i}function no(f){return["top","bottom"].indexOf(f)>=0?"x":"y"}function Xs(f,i,a){return zn(f,Hr(i,a))}function pa(f){return Object.assign({},{top:0,right:0,bottom:0,left:0},f)}function ma(f,i){return i.reduce(function(a,p){return a[p]=f,a},{})}const ga={name:"arrow",enabled:!0,phase:"main",fn:function(f){var i,a=f.state,p=f.name,v=f.options,E=a.elements.arrow,T=a.modifiersData.popperOffsets,L=sn(a.placement),V=no(L),Y=[mt,It].indexOf(L)>=0?"height":"width";if(E&&T){var Q=(function(De,ke){return pa(typeof(De=typeof De=="function"?De(Object.assign({},ke.rects,{placement:ke.placement})):De)!="number"?De:ma(De,vs))})(v.padding,a),K=to(E),ge=V==="y"?pt:mt,oe=V==="y"?Nt:It,ce=a.rects.reference[Y]+a.rects.reference[V]-T[V]-a.rects.popper[Y],ae=T[V]-a.rects.reference[V],ue=Js(E),Le=ue?V==="y"?ue.clientHeight||0:ue.clientWidth||0:0,je=ce/2-ae/2,ve=Q[ge],Te=Le-K[Y]-Q[oe],be=Le/2-K[Y]/2+je,Ae=Xs(ve,be,Te),Ie=V;a.modifiersData[p]=((i={})[Ie]=Ae,i.centerOffset=Ae-be,i)}},effect:function(f){var i=f.state,a=f.options.element,p=a===void 0?"[data-popper-arrow]":a;p!=null&&(typeof p!="string"||(p=i.elements.popper.querySelector(p)))&&da(i.elements.popper,p)&&(i.elements.arrow=p)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ss(f){return f.split("-")[1]}var bh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function _a(f){var i,a=f.popper,p=f.popperRect,v=f.placement,E=f.variation,T=f.offsets,L=f.position,V=f.gpuAcceleration,Y=f.adaptive,Q=f.roundOffsets,K=f.isFixed,ge=T.x,oe=ge===void 0?0:ge,ce=T.y,ae=ce===void 0?0:ce,ue=typeof Q=="function"?Q({x:oe,y:ae}):{x:oe,y:ae};oe=ue.x,ae=ue.y;var Le=T.hasOwnProperty("x"),je=T.hasOwnProperty("y"),ve=mt,Te=pt,be=window;if(Y){var Ae=Js(a),Ie="clientHeight",De="clientWidth";Ae===kt(a)&&mn(Ae=Rn(a)).position!=="static"&&L==="absolute"&&(Ie="scrollHeight",De="scrollWidth"),(v===pt||(v===mt||v===It)&&E===ws)&&(Te=Nt,ae-=(K&&Ae===be&&be.visualViewport?be.visualViewport.height:Ae[Ie])-p.height,ae*=V?1:-1),v!==mt&&(v!==pt&&v!==Nt||E!==ws)||(ve=It,oe-=(K&&Ae===be&&be.visualViewport?be.visualViewport.width:Ae[De])-p.width,oe*=V?1:-1)}var ke,Ge=Object.assign({position:L},Y&&bh),Lt=Q===!0?(function(zt,gt){var jt=zt.x,Bt=zt.y,We=gt.devicePixelRatio||1;return{x:As(jt*We)/We||0,y:As(Bt*We)/We||0}})({x:oe,y:ae},kt(a)):{x:oe,y:ae};return oe=Lt.x,ae=Lt.y,V?Object.assign({},Ge,((ke={})[Te]=je?"0":"",ke[ve]=Le?"0":"",ke.transform=(be.devicePixelRatio||1)<=1?"translate("+oe+"px, "+ae+"px)":"translate3d("+oe+"px, "+ae+"px, 0)",ke)):Object.assign({},Ge,((i={})[Te]=je?ae+"px":"",i[ve]=Le?oe+"px":"",i.transform="",i))}const so={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(f){var i=f.state,a=f.options,p=a.gpuAcceleration,v=p===void 0||p,E=a.adaptive,T=E===void 0||E,L=a.roundOffsets,V=L===void 0||L,Y={placement:sn(i.placement),variation:Ss(i.placement),popper:i.elements.popper,popperRect:i.rects.popper,gpuAcceleration:v,isFixed:i.options.strategy==="fixed"};i.modifiersData.popperOffsets!=null&&(i.styles.popper=Object.assign({},i.styles.popper,_a(Object.assign({},Y,{offsets:i.modifiersData.popperOffsets,position:i.options.strategy,adaptive:T,roundOffsets:V})))),i.modifiersData.arrow!=null&&(i.styles.arrow=Object.assign({},i.styles.arrow,_a(Object.assign({},Y,{offsets:i.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:V})))),i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-placement":i.placement})},data:{}};var Vr={passive:!0};const ro={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(f){var i=f.state,a=f.instance,p=f.options,v=p.scroll,E=v===void 0||v,T=p.resize,L=T===void 0||T,V=kt(i.elements.popper),Y=[].concat(i.scrollParents.reference,i.scrollParents.popper);return E&&Y.forEach(function(Q){Q.addEventListener("scroll",a.update,Vr)}),L&&V.addEventListener("resize",a.update,Vr),function(){E&&Y.forEach(function(Q){Q.removeEventListener("scroll",a.update,Vr)}),L&&V.removeEventListener("resize",a.update,Vr)}},data:{}};var yh={left:"right",right:"left",bottom:"top",top:"bottom"};function qr(f){return f.replace(/left|right|bottom|top/g,function(i){return yh[i]})}var vh={start:"end",end:"start"};function ba(f){return f.replace(/start|end/g,function(i){return vh[i]})}function io(f){var i=kt(f);return{scrollLeft:i.pageXOffset,scrollTop:i.pageYOffset}}function oo(f){return Cs(Rn(f)).left+io(f).scrollLeft}function lo(f){var i=mn(f),a=i.overflow,p=i.overflowX,v=i.overflowY;return/auto|scroll|overlay|hidden/.test(a+v+p)}function ya(f){return["html","body","#document"].indexOf(nn(f))>=0?f.ownerDocument.body:Ft(f)&&lo(f)?f:ya(Ur(f))}function Ys(f,i){var a;i===void 0&&(i=[]);var p=ya(f),v=p===((a=f.ownerDocument)==null?void 0:a.body),E=kt(p),T=v?[E].concat(E.visualViewport||[],lo(p)?p:[]):p,L=i.concat(T);return v?L:L.concat(Ys(Ur(T)))}function ao(f){return Object.assign({},f,{left:f.x,top:f.y,right:f.x+f.width,bottom:f.y+f.height})}function va(f,i,a){return i===Ji?ao((function(p,v){var E=kt(p),T=Rn(p),L=E.visualViewport,V=T.clientWidth,Y=T.clientHeight,Q=0,K=0;if(L){V=L.width,Y=L.height;var ge=fa();(ge||!ge&&v==="fixed")&&(Q=L.offsetLeft,K=L.offsetTop)}return{width:V,height:Y,x:Q+oo(p),y:K}})(f,a)):Kn(i)?(function(p,v){var E=Cs(p,!1,v==="fixed");return E.top=E.top+p.clientTop,E.left=E.left+p.clientLeft,E.bottom=E.top+p.clientHeight,E.right=E.left+p.clientWidth,E.width=p.clientWidth,E.height=p.clientHeight,E.x=E.left,E.y=E.top,E})(i,a):ao((function(p){var v,E=Rn(p),T=io(p),L=(v=p.ownerDocument)==null?void 0:v.body,V=zn(E.scrollWidth,E.clientWidth,L?L.scrollWidth:0,L?L.clientWidth:0),Y=zn(E.scrollHeight,E.clientHeight,L?L.scrollHeight:0,L?L.clientHeight:0),Q=-T.scrollLeft+oo(p),K=-T.scrollTop;return mn(L||E).direction==="rtl"&&(Q+=zn(E.clientWidth,L?L.clientWidth:0)-V),{width:V,height:Y,x:Q,y:K}})(Rn(f)))}function wa(f){var i,a=f.reference,p=f.element,v=f.placement,E=v?sn(v):null,T=v?Ss(v):null,L=a.x+a.width/2-p.width/2,V=a.y+a.height/2-p.height/2;switch(E){case pt:i={x:L,y:a.y-p.height};break;case Nt:i={x:L,y:a.y+a.height};break;case It:i={x:a.x+a.width,y:V};break;case mt:i={x:a.x-p.width,y:V};break;default:i={x:a.x,y:a.y}}var Y=E?no(E):null;if(Y!=null){var Q=Y==="y"?"height":"width";switch(T){case Wn:i[Y]=i[Y]-(a[Q]/2-p[Q]/2);break;case ws:i[Y]=i[Y]+(a[Q]/2-p[Q]/2)}}return i}function Ts(f,i){i===void 0&&(i={});var a=i,p=a.placement,v=p===void 0?f.placement:p,E=a.strategy,T=E===void 0?f.strategy:E,L=a.boundary,V=L===void 0?Zl:L,Y=a.rootBoundary,Q=Y===void 0?Ji:Y,K=a.elementContext,ge=K===void 0?Es:K,oe=a.altBoundary,ce=oe!==void 0&&oe,ae=a.padding,ue=ae===void 0?0:ae,Le=pa(typeof ue!="number"?ue:ma(ue,vs)),je=ge===Es?ea:Es,ve=f.rects.popper,Te=f.elements[ce?je:ge],be=(function(gt,jt,Bt,We){var rn=jt==="clippingParents"?(function(Fe){var _t=Ys(Ur(Fe)),Ht=["absolute","fixed"].indexOf(mn(Fe).position)>=0&&Ft(Fe)?Js(Fe):Fe;return Kn(Ht)?_t.filter(function(Nn){return Kn(Nn)&&da(Nn,Ht)&&nn(Nn)!=="body"}):[]})(gt):[].concat(jt),on=[].concat(rn,[Bt]),Rs=on[0],tt=on.reduce(function(Fe,_t){var Ht=va(gt,_t,We);return Fe.top=zn(Ht.top,Fe.top),Fe.right=Hr(Ht.right,Fe.right),Fe.bottom=Hr(Ht.bottom,Fe.bottom),Fe.left=zn(Ht.left,Fe.left),Fe},va(gt,Rs,We));return tt.width=tt.right-tt.left,tt.height=tt.bottom-tt.top,tt.x=tt.left,tt.y=tt.top,tt})(Kn(Te)?Te:Te.contextElement||Rn(f.elements.popper),V,Q,T),Ae=Cs(f.elements.reference),Ie=wa({reference:Ae,element:ve,placement:v}),De=ao(Object.assign({},ve,Ie)),ke=ge===Es?De:Ae,Ge={top:be.top-ke.top+Le.top,bottom:ke.bottom-be.bottom+Le.bottom,left:be.left-ke.left+Le.left,right:ke.right-be.right+Le.right},Lt=f.modifiersData.offset;if(ge===Es&&Lt){var zt=Lt[v];Object.keys(Ge).forEach(function(gt){var jt=[It,Nt].indexOf(gt)>=0?1:-1,Bt=[pt,Nt].indexOf(gt)>=0?"y":"x";Ge[gt]+=zt[Bt]*jt})}return Ge}function wh(f,i){i===void 0&&(i={});var a=i,p=a.placement,v=a.boundary,E=a.rootBoundary,T=a.padding,L=a.flipVariations,V=a.allowedAutoPlacements,Y=V===void 0?Yi:V,Q=Ss(p),K=Q?L?Xi:Xi.filter(function(ce){return Ss(ce)===Q}):vs,ge=K.filter(function(ce){return Y.indexOf(ce)>=0});ge.length===0&&(ge=K);var oe=ge.reduce(function(ce,ae){return ce[ae]=Ts(f,{placement:ae,boundary:v,rootBoundary:E,padding:T})[sn(ae)],ce},{});return Object.keys(oe).sort(function(ce,ae){return oe[ce]-oe[ae]})}const Ea={name:"flip",enabled:!0,phase:"main",fn:function(f){var i=f.state,a=f.options,p=f.name;if(!i.modifiersData[p]._skip){for(var v=a.mainAxis,E=v===void 0||v,T=a.altAxis,L=T===void 0||T,V=a.fallbackPlacements,Y=a.padding,Q=a.boundary,K=a.rootBoundary,ge=a.altBoundary,oe=a.flipVariations,ce=oe===void 0||oe,ae=a.allowedAutoPlacements,ue=i.options.placement,Le=sn(ue),je=V||(Le!==ue&&ce?(function(Fe){if(sn(Fe)===Br)return[];var _t=qr(Fe);return[ba(Fe),_t,ba(_t)]})(ue):[qr(ue)]),ve=[ue].concat(je).reduce(function(Fe,_t){return Fe.concat(sn(_t)===Br?wh(i,{placement:_t,boundary:Q,rootBoundary:K,padding:Y,flipVariations:ce,allowedAutoPlacements:ae}):_t)},[]),Te=i.rects.reference,be=i.rects.popper,Ae=new Map,Ie=!0,De=ve[0],ke=0;ke=0,jt=gt?"width":"height",Bt=Ts(i,{placement:Ge,boundary:Q,rootBoundary:K,altBoundary:ge,padding:Y}),We=gt?zt?It:mt:zt?Nt:pt;Te[jt]>be[jt]&&(We=qr(We));var rn=qr(We),on=[];if(E&&on.push(Bt[Lt]<=0),L&&on.push(Bt[We]<=0,Bt[rn]<=0),on.every(function(Fe){return Fe})){De=Ge,Ie=!1;break}Ae.set(Ge,on)}if(Ie)for(var Rs=function(Fe){var _t=ve.find(function(Ht){var Nn=Ae.get(Ht);if(Nn)return Nn.slice(0,Fe).every(function(Zr){return Zr})});if(_t)return De=_t,"break"},tt=ce?3:1;tt>0&&Rs(tt)!=="break";tt--);i.placement!==De&&(i.modifiersData[p]._skip=!0,i.placement=De,i.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Aa(f,i,a){return a===void 0&&(a={x:0,y:0}),{top:f.top-i.height-a.y,right:f.right-i.width+a.x,bottom:f.bottom-i.height+a.y,left:f.left-i.width-a.x}}function Ca(f){return[pt,It,Nt,mt].some(function(i){return f[i]>=0})}const Sa={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(f){var i=f.state,a=f.name,p=i.rects.reference,v=i.rects.popper,E=i.modifiersData.preventOverflow,T=Ts(i,{elementContext:"reference"}),L=Ts(i,{altBoundary:!0}),V=Aa(T,p),Y=Aa(L,v,E),Q=Ca(V),K=Ca(Y);i.modifiersData[a]={referenceClippingOffsets:V,popperEscapeOffsets:Y,isReferenceHidden:Q,hasPopperEscaped:K},i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-reference-hidden":Q,"data-popper-escaped":K})}},Ta={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(f){var i=f.state,a=f.options,p=f.name,v=a.offset,E=v===void 0?[0,0]:v,T=Yi.reduce(function(Q,K){return Q[K]=(function(ge,oe,ce){var ae=sn(ge),ue=[mt,pt].indexOf(ae)>=0?-1:1,Le=typeof ce=="function"?ce(Object.assign({},oe,{placement:ge})):ce,je=Le[0],ve=Le[1];return je=je||0,ve=(ve||0)*ue,[mt,It].indexOf(ae)>=0?{x:ve,y:je}:{x:je,y:ve}})(K,i.rects,E),Q},{}),L=T[i.placement],V=L.x,Y=L.y;i.modifiersData.popperOffsets!=null&&(i.modifiersData.popperOffsets.x+=V,i.modifiersData.popperOffsets.y+=Y),i.modifiersData[p]=T}},co={name:"popperOffsets",enabled:!0,phase:"read",fn:function(f){var i=f.state,a=f.name;i.modifiersData[a]=wa({reference:i.rects.reference,element:i.rects.popper,placement:i.placement})},data:{}},xa={name:"preventOverflow",enabled:!0,phase:"main",fn:function(f){var i=f.state,a=f.options,p=f.name,v=a.mainAxis,E=v===void 0||v,T=a.altAxis,L=T!==void 0&&T,V=a.boundary,Y=a.rootBoundary,Q=a.altBoundary,K=a.padding,ge=a.tether,oe=ge===void 0||ge,ce=a.tetherOffset,ae=ce===void 0?0:ce,ue=Ts(i,{boundary:V,rootBoundary:Y,padding:K,altBoundary:Q}),Le=sn(i.placement),je=Ss(i.placement),ve=!je,Te=no(Le),be=Te==="x"?"y":"x",Ae=i.modifiersData.popperOffsets,Ie=i.rects.reference,De=i.rects.popper,ke=typeof ae=="function"?ae(Object.assign({},i.rects,{placement:i.placement})):ae,Ge=typeof ke=="number"?{mainAxis:ke,altAxis:ke}:Object.assign({mainAxis:0,altAxis:0},ke),Lt=i.modifiersData.offset?i.modifiersData.offset[i.placement]:null,zt={x:0,y:0};if(Ae){if(E){var gt,jt=Te==="y"?pt:mt,Bt=Te==="y"?Nt:It,We=Te==="y"?"height":"width",rn=Ae[Te],on=rn+ue[jt],Rs=rn-ue[Bt],tt=oe?-De[We]/2:0,Fe=je===Wn?Ie[We]:De[We],_t=je===Wn?-De[We]:-Ie[We],Ht=i.elements.arrow,Nn=oe&&Ht?to(Ht):{width:0,height:0},Zr=i.modifiersData["arrow#persistent"]?i.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},hc=Zr[jt],pc=Zr[Bt],ei=Xs(0,Ie[We],Nn[We]),Zp=ve?Ie[We]/2-tt-ei-hc-Ge.mainAxis:Fe-ei-hc-Ge.mainAxis,em=ve?-Ie[We]/2+tt+ei+pc+Ge.mainAxis:_t+ei+pc+Ge.mainAxis,Co=i.elements.arrow&&Js(i.elements.arrow),tm=Co?Te==="y"?Co.clientTop||0:Co.clientLeft||0:0,mc=(gt=Lt?.[Te])!=null?gt:0,nm=rn+em-mc,gc=Xs(oe?Hr(on,rn+Zp-mc-tm):on,rn,oe?zn(Rs,nm):Rs);Ae[Te]=gc,zt[Te]=gc-rn}if(L){var _c,sm=Te==="x"?pt:mt,rm=Te==="x"?Nt:It,ts=Ae[be],ti=be==="y"?"height":"width",bc=ts+ue[sm],yc=ts-ue[rm],So=[pt,mt].indexOf(Le)!==-1,vc=(_c=Lt?.[be])!=null?_c:0,wc=So?bc:ts-Ie[ti]-De[ti]-vc+Ge.altAxis,Ec=So?ts+Ie[ti]+De[ti]-vc-Ge.altAxis:yc,Ac=oe&&So?(function(im,om,To){var Cc=Xs(im,om,To);return Cc>To?To:Cc})(wc,ts,Ec):Xs(oe?wc:bc,ts,oe?Ec:yc);Ae[be]=Ac,zt[be]=Ac-ts}i.modifiersData[p]=zt}},requiresIfExists:["offset"]};function Eh(f,i,a){a===void 0&&(a=!1);var p,v,E=Ft(i),T=Ft(i)&&(function(K){var ge=K.getBoundingClientRect(),oe=As(ge.width)/K.offsetWidth||1,ce=As(ge.height)/K.offsetHeight||1;return oe!==1||ce!==1})(i),L=Rn(i),V=Cs(f,T,a),Y={scrollLeft:0,scrollTop:0},Q={x:0,y:0};return(E||!E&&!a)&&((nn(i)!=="body"||lo(L))&&(Y=(p=i)!==kt(p)&&Ft(p)?{scrollLeft:(v=p).scrollLeft,scrollTop:v.scrollTop}:io(p)),Ft(i)?((Q=Cs(i,!0)).x+=i.clientLeft,Q.y+=i.clientTop):L&&(Q.x=oo(L))),{x:V.left+Y.scrollLeft-Q.x,y:V.top+Y.scrollTop-Q.y,width:V.width,height:V.height}}function Ah(f){var i=new Map,a=new Set,p=[];function v(E){a.add(E.name),[].concat(E.requires||[],E.requiresIfExists||[]).forEach(function(T){if(!a.has(T)){var L=i.get(T);L&&v(L)}}),p.push(E)}return f.forEach(function(E){i.set(E.name,E)}),f.forEach(function(E){a.has(E.name)||v(E)}),p}var Oa={placement:"bottom",modifiers:[],strategy:"absolute"};function Ra(){for(var f=arguments.length,i=new Array(f),a=0;aNumber.parseInt(a,10)):typeof i=="function"?a=>i(a,this._element):i}_getPopperConfig(){const i={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(Je.setDataAttribute(this._menu,"popper","static"),i.modifiers=[{name:"applyStyles",enabled:!1}]),{...i,...$(this._config.popperConfig,[void 0,i])}}_selectMenuItem({key:i,target:a}){const p=O.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(v=>d(v));p.length&&te(p,a,i===Ia,!p.includes(a)).focus()}static jQueryInterface(i){return this.each(function(){const a=Kt.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0)throw new TypeError(`No method named "${i}"`);a[i]()}})}static clearMenus(i){if(i.button===2||i.type==="keyup"&&i.key!=="Tab")return;const a=O.find(Ih);for(const p of a){const v=Kt.getInstance(p);if(!v||v._config.autoClose===!1)continue;const E=i.composedPath(),T=E.includes(v._menu);if(E.includes(v._element)||v._config.autoClose==="inside"&&!T||v._config.autoClose==="outside"&&T||v._menu.contains(i.target)&&(i.type==="keyup"&&i.key==="Tab"||/input|select|option|textarea|form/i.test(i.target.tagName)))continue;const L={relatedTarget:v._element};i.type==="click"&&(L.clickEvent=i),v._completeHide(L)}}static dataApiKeydownHandler(i){const a=/input|textarea/i.test(i.target.tagName),p=i.key==="Escape",v=[Th,Ia].includes(i.key);if(!v&&!p||a&&!p)return;i.preventDefault();const E=this.matches(Jn)?this:O.prev(this,Jn)[0]||O.next(this,Jn)[0]||O.findOne(Jn,i.delegateTarget.parentNode),T=Kt.getOrCreateInstance(E);if(v)return i.stopPropagation(),T.show(),void T._selectMenuItem(i);T._isShown()&&(i.stopPropagation(),T.hide(),E.focus())}}P.on(document,La,Jn,Kt.dataApiKeydownHandler),P.on(document,La,Kr,Kt.dataApiKeydownHandler),P.on(document,ka,Kt.clearMenus),P.on(document,Nh,Kt.clearMenus),P.on(document,ka,Jn,function(f){f.preventDefault(),Kt.getOrCreateInstance(this).toggle()}),F(Kt);const Da="backdrop",Ma="show",Fa=`mousedown.bs.${Da}`,Hh={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Uh={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class $a extends et{constructor(i){super(),this._config=this._getConfig(i),this._isAppended=!1,this._element=null}static get Default(){return Hh}static get DefaultType(){return Uh}static get NAME(){return Da}show(i){if(!this._config.isVisible)return void $(i);this._append();const a=this._getElement();this._config.isAnimated&&w(a),a.classList.add(Ma),this._emulateAnimation(()=>{$(i)})}hide(i){this._config.isVisible?(this._getElement().classList.remove(Ma),this._emulateAnimation(()=>{this.dispose(),$(i)})):$(i)}dispose(){this._isAppended&&(P.off(this._element,Fa),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const i=document.createElement("div");i.className=this._config.className,this._config.isAnimated&&i.classList.add("fade"),this._element=i}return this._element}_configAfterMerge(i){return i.rootElement=h(i.rootElement),i}_append(){if(this._isAppended)return;const i=this._getElement();this._config.rootElement.append(i),P.on(i,Fa,()=>{$(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(i){H(i,this._getElement(),this._config.isAnimated)}}const zr=".bs.focustrap",Vh=`focusin${zr}`,qh=`keydown.tab${zr}`,ja="backward",Wh={autofocus:!0,trapElement:null},Kh={autofocus:"boolean",trapElement:"element"};class Ba extends et{constructor(i){super(),this._config=this._getConfig(i),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Wh}static get DefaultType(){return Kh}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),P.off(document,zr),P.on(document,Vh,i=>this._handleFocusin(i)),P.on(document,qh,i=>this._handleKeydown(i)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,P.off(document,zr))}_handleFocusin(i){const{trapElement:a}=this._config;if(i.target===document||i.target===a||a.contains(i.target))return;const p=O.focusableChildren(a);p.length===0?a.focus():this._lastTabNavDirection===ja?p[p.length-1].focus():p[0].focus()}_handleKeydown(i){i.key==="Tab"&&(this._lastTabNavDirection=i.shiftKey?ja:"forward")}}const Ha=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Ua=".sticky-top",Gr="padding-right",Va="margin-right";class ho{constructor(){this._element=document.body}getWidth(){const i=document.documentElement.clientWidth;return Math.abs(window.innerWidth-i)}hide(){const i=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Gr,a=>a+i),this._setElementAttributes(Ha,Gr,a=>a+i),this._setElementAttributes(Ua,Va,a=>a-i)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Gr),this._resetElementAttributes(Ha,Gr),this._resetElementAttributes(Ua,Va)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(i,a,p){const v=this.getWidth();this._applyManipulationCallback(i,E=>{if(E!==this._element&&window.innerWidth>E.clientWidth+v)return;this._saveInitialAttribute(E,a);const T=window.getComputedStyle(E).getPropertyValue(a);E.style.setProperty(a,`${p(Number.parseFloat(T))}px`)})}_saveInitialAttribute(i,a){const p=i.style.getPropertyValue(a);p&&Je.setDataAttribute(i,a,p)}_resetElementAttributes(i,a){this._applyManipulationCallback(i,p=>{const v=Je.getDataAttribute(p,a);v!==null?(Je.removeDataAttribute(p,a),p.style.setProperty(a,v)):p.style.removeProperty(a)})}_applyManipulationCallback(i,a){if(u(i))a(i);else for(const p of O.find(i,this._element))a(p)}}const $t=".bs.modal",zh=`hide${$t}`,Gh=`hidePrevented${$t}`,qa=`hidden${$t}`,Wa=`show${$t}`,Jh=`shown${$t}`,Xh=`resize${$t}`,Yh=`click.dismiss${$t}`,Qh=`mousedown.dismiss${$t}`,Zh=`keydown.dismiss${$t}`,ep=`click${$t}.data-api`,Ka="modal-open",za="show",po="modal-static",tp={backdrop:!0,focus:!0,keyboard:!0},np={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Xn extends R{constructor(i,a){super(i,a),this._dialog=O.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new ho,this._addEventListeners()}static get Default(){return tp}static get DefaultType(){return np}static get NAME(){return"modal"}toggle(i){return this._isShown?this.hide():this.show(i)}show(i){this._isShown||this._isTransitioning||P.trigger(this._element,Wa,{relatedTarget:i}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Ka),this._adjustDialog(),this._backdrop.show(()=>this._showElement(i)))}hide(){this._isShown&&!this._isTransitioning&&(P.trigger(this._element,zh).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(za),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){P.off(window,$t),P.off(this._dialog,$t),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new $a({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Ba({trapElement:this._element})}_showElement(i){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const a=O.findOne(".modal-body",this._dialog);a&&(a.scrollTop=0),w(this._element),this._element.classList.add(za),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,P.trigger(this._element,Jh,{relatedTarget:i})},this._dialog,this._isAnimated())}_addEventListeners(){P.on(this._element,Zh,i=>{i.key==="Escape"&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),P.on(window,Xh,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),P.on(this._element,Qh,i=>{P.one(this._element,Yh,a=>{this._element===i.target&&this._element===a.target&&(this._config.backdrop!=="static"?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Ka),this._resetAdjustments(),this._scrollBar.reset(),P.trigger(this._element,qa)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(P.trigger(this._element,Gh).defaultPrevented)return;const i=this._element.scrollHeight>document.documentElement.clientHeight,a=this._element.style.overflowY;a==="hidden"||this._element.classList.contains(po)||(i||(this._element.style.overflowY="hidden"),this._element.classList.add(po),this._queueCallback(()=>{this._element.classList.remove(po),this._queueCallback(()=>{this._element.style.overflowY=a},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const i=this._element.scrollHeight>document.documentElement.clientHeight,a=this._scrollBar.getWidth(),p=a>0;if(p&&!i){const v=D()?"paddingLeft":"paddingRight";this._element.style[v]=`${a}px`}if(!p&&i){const v=D()?"paddingRight":"paddingLeft";this._element.style[v]=`${a}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(i,a){return this.each(function(){const p=Xn.getOrCreateInstance(this,i);if(typeof i=="string"){if(p[i]===void 0)throw new TypeError(`No method named "${i}"`);p[i](a)}})}}P.on(document,ep,'[data-bs-toggle="modal"]',function(f){const i=O.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&f.preventDefault(),P.one(i,Wa,p=>{p.defaultPrevented||P.one(i,qa,()=>{d(this)&&this.focus()})});const a=O.findOne(".modal.show");a&&Xn.getInstance(a).hide(),Xn.getOrCreateInstance(i).toggle(this)}),ee(Xn),F(Xn);const gn=".bs.offcanvas",Ga=".data-api",sp=`load${gn}${Ga}`,Ja="show",Xa="showing",Ya="hiding",Qa=".offcanvas.show",rp=`show${gn}`,ip=`shown${gn}`,op=`hide${gn}`,Za=`hidePrevented${gn}`,ec=`hidden${gn}`,lp=`resize${gn}`,ap=`click${gn}${Ga}`,cp=`keydown.dismiss${gn}`,up={backdrop:!0,keyboard:!0,scroll:!1},fp={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class _n extends R{constructor(i,a){super(i,a),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return up}static get DefaultType(){return fp}static get NAME(){return"offcanvas"}toggle(i){return this._isShown?this.hide():this.show(i)}show(i){this._isShown||P.trigger(this._element,rp,{relatedTarget:i}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||new ho().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Xa),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Ja),this._element.classList.remove(Xa),P.trigger(this._element,ip,{relatedTarget:i})},this._element,!0))}hide(){this._isShown&&(P.trigger(this._element,op).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Ya),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(Ja,Ya),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new ho().reset(),P.trigger(this._element,ec)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const i=!!this._config.backdrop;return new $a({className:"offcanvas-backdrop",isVisible:i,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:i?()=>{this._config.backdrop!=="static"?this.hide():P.trigger(this._element,Za)}:null})}_initializeFocusTrap(){return new Ba({trapElement:this._element})}_addEventListeners(){P.on(this._element,cp,i=>{i.key==="Escape"&&(this._config.keyboard?this.hide():P.trigger(this._element,Za))})}static jQueryInterface(i){return this.each(function(){const a=_n.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0||i.startsWith("_")||i==="constructor")throw new TypeError(`No method named "${i}"`);a[i](this)}})}}P.on(document,ap,'[data-bs-toggle="offcanvas"]',function(f){const i=O.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&f.preventDefault(),m(this))return;P.one(i,ec,()=>{d(this)&&this.focus()});const a=O.findOne(Qa);a&&a!==i&&_n.getInstance(a).hide(),_n.getOrCreateInstance(i).toggle(this)}),P.on(window,sp,()=>{for(const f of O.find(Qa))_n.getOrCreateInstance(f).show()}),P.on(window,lp,()=>{for(const f of O.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(f).position!=="fixed"&&_n.getOrCreateInstance(f).hide()}),ee(_n),F(_n);const tc={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},dp=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),hp=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,pp=(f,i)=>{const a=f.nodeName.toLowerCase();return i.includes(a)?!dp.has(a)||!!hp.test(f.nodeValue):i.filter(p=>p instanceof RegExp).some(p=>p.test(a))},mp={allowList:tc,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},gp={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},_p={entry:"(string|element|function|null)",selector:"(string|element)"};class bp extends et{constructor(i){super(),this._config=this._getConfig(i)}static get Default(){return mp}static get DefaultType(){return gp}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(i=>this._resolvePossibleFunction(i)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(i){return this._checkContent(i),this._config.content={...this._config.content,...i},this}toHtml(){const i=document.createElement("div");i.innerHTML=this._maybeSanitize(this._config.template);for(const[v,E]of Object.entries(this._config.content))this._setContent(i,E,v);const a=i.children[0],p=this._resolvePossibleFunction(this._config.extraClass);return p&&a.classList.add(...p.split(" ")),a}_typeCheckConfig(i){super._typeCheckConfig(i),this._checkContent(i.content)}_checkContent(i){for(const[a,p]of Object.entries(i))super._typeCheckConfig({selector:a,entry:p},_p)}_setContent(i,a,p){const v=O.findOne(p,i);v&&((a=this._resolvePossibleFunction(a))?u(a)?this._putElementInTemplate(h(a),v):this._config.html?v.innerHTML=this._maybeSanitize(a):v.textContent=a:v.remove())}_maybeSanitize(i){return this._config.sanitize?(function(a,p,v){if(!a.length)return a;if(v&&typeof v=="function")return v(a);const E=new window.DOMParser().parseFromString(a,"text/html"),T=[].concat(...E.body.querySelectorAll("*"));for(const L of T){const V=L.nodeName.toLowerCase();if(!Object.keys(p).includes(V)){L.remove();continue}const Y=[].concat(...L.attributes),Q=[].concat(p["*"]||[],p[V]||[]);for(const K of Y)pp(K,Q)||L.removeAttribute(K.nodeName)}return E.body.innerHTML})(i,this._config.allowList,this._config.sanitizeFn):i}_resolvePossibleFunction(i){return $(i,[void 0,this])}_putElementInTemplate(i,a){if(this._config.html)return a.innerHTML="",void a.append(i);a.textContent=i.textContent}}const yp=new Set(["sanitize","allowList","sanitizeFn"]),mo="fade",Jr="show",vp=".tooltip-inner",nc=".modal",sc="hide.bs.modal",Qs="hover",go="focus",_o="click",wp={AUTO:"auto",TOP:"top",RIGHT:D()?"left":"right",BOTTOM:"bottom",LEFT:D()?"right":"left"},Ep={allowList:tc,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},Ap={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Yn extends R{constructor(i,a){if(Pa===void 0)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(i,a),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Ep}static get DefaultType(){return Ap}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),P.off(this._element.closest(nc),sc,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const i=P.trigger(this._element,this.constructor.eventName("show")),a=(_(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(i.defaultPrevented||!a)return;this._disposePopper();const p=this._getTipElement();this._element.setAttribute("aria-describedby",p.getAttribute("id"));const{container:v}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(v.append(p),P.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(p),p.classList.add(Jr),"ontouchstart"in document.documentElement)for(const E of[].concat(...document.body.children))P.on(E,"mouseover",y);this._queueCallback(()=>{P.trigger(this._element,this.constructor.eventName("shown")),this._isHovered===!1&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!P.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(Jr),"ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))P.off(i,"mouseover",y);this._activeTrigger[_o]=!1,this._activeTrigger[go]=!1,this._activeTrigger[Qs]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),P.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(i){const a=this._getTemplateFactory(i).toHtml();if(!a)return null;a.classList.remove(mo,Jr),a.classList.add(`bs-${this.constructor.NAME}-auto`);const p=(v=>{do v+=Math.floor(1e6*Math.random());while(document.getElementById(v));return v})(this.constructor.NAME).toString();return a.setAttribute("id",p),this._isAnimated()&&a.classList.add(mo),a}setContent(i){this._newContent=i,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(i){return this._templateFactory?this._templateFactory.changeContent(i):this._templateFactory=new bp({...this._config,content:i,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[vp]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(i){return this.constructor.getOrCreateInstance(i.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(mo)}_isShown(){return this.tip&&this.tip.classList.contains(Jr)}_createPopper(i){const a=$(this._config.placement,[this,i,this._element]),p=wp[a.toUpperCase()];return uo(this._element,i,this._getPopperConfig(p))}_getOffset(){const{offset:i}=this._config;return typeof i=="string"?i.split(",").map(a=>Number.parseInt(a,10)):typeof i=="function"?a=>i(a,this._element):i}_resolvePossibleFunction(i){return $(i,[this._element,this._element])}_getPopperConfig(i){const a={placement:i,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:p=>{this._getTipElement().setAttribute("data-popper-placement",p.state.placement)}}]};return{...a,...$(this._config.popperConfig,[void 0,a])}}_setListeners(){const i=this._config.trigger.split(" ");for(const a of i)if(a==="click")P.on(this._element,this.constructor.eventName("click"),this._config.selector,p=>{const v=this._initializeOnDelegatedTarget(p);v._activeTrigger[_o]=!(v._isShown()&&v._activeTrigger[_o]),v.toggle()});else if(a!=="manual"){const p=a===Qs?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),v=a===Qs?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");P.on(this._element,p,this._config.selector,E=>{const T=this._initializeOnDelegatedTarget(E);T._activeTrigger[E.type==="focusin"?go:Qs]=!0,T._enter()}),P.on(this._element,v,this._config.selector,E=>{const T=this._initializeOnDelegatedTarget(E);T._activeTrigger[E.type==="focusout"?go:Qs]=T._element.contains(E.relatedTarget),T._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},P.on(this._element.closest(nc),sc,this._hideModalHandler)}_fixTitle(){const i=this._element.getAttribute("title");i&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",i),this._element.setAttribute("data-bs-original-title",i),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(i,a){clearTimeout(this._timeout),this._timeout=setTimeout(i,a)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(i){const a=Je.getDataAttributes(this._element);for(const p of Object.keys(a))yp.has(p)&&delete a[p];return i={...a,...typeof i=="object"&&i?i:{}},i=this._mergeConfigObj(i),i=this._configAfterMerge(i),this._typeCheckConfig(i),i}_configAfterMerge(i){return i.container=i.container===!1?document.body:h(i.container),typeof i.delay=="number"&&(i.delay={show:i.delay,hide:i.delay}),typeof i.title=="number"&&(i.title=i.title.toString()),typeof i.content=="number"&&(i.content=i.content.toString()),i}_getDelegateConfig(){const i={};for(const[a,p]of Object.entries(this._config))this.constructor.Default[a]!==p&&(i[a]=p);return i.selector=!1,i.trigger="manual",i}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(i){return this.each(function(){const a=Yn.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0)throw new TypeError(`No method named "${i}"`);a[i]()}})}}F(Yn);const Cp=".popover-header",Sp=".popover-body",Tp={...Yn.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},xp={...Yn.DefaultType,content:"(null|string|element|function)"};class Xr extends Yn{static get Default(){return Tp}static get DefaultType(){return xp}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Cp]:this._getTitle(),[Sp]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(i){return this.each(function(){const a=Xr.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0)throw new TypeError(`No method named "${i}"`);a[i]()}})}}F(Xr);const bo=".bs.scrollspy",Op=`activate${bo}`,rc=`click${bo}`,Rp=`load${bo}.data-api`,Os="active",yo="[href]",ic=".nav-link",Pp=`${ic}, .nav-item > ${ic}, .list-group-item`,Np={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Ip={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Zs extends R{constructor(i,a){super(i,a),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Np}static get DefaultType(){return Ip}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const i of this._observableSections.values())this._observer.observe(i)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(i){return i.target=h(i.target)||document.body,i.rootMargin=i.offset?`${i.offset}px 0px -30%`:i.rootMargin,typeof i.threshold=="string"&&(i.threshold=i.threshold.split(",").map(a=>Number.parseFloat(a))),i}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(P.off(this._config.target,rc),P.on(this._config.target,rc,yo,i=>{const a=this._observableSections.get(i.target.hash);if(a){i.preventDefault();const p=this._rootElement||window,v=a.offsetTop-this._element.offsetTop;if(p.scrollTo)return void p.scrollTo({top:v,behavior:"smooth"});p.scrollTop=v}}))}_getNewObserver(){const i={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(a=>this._observerCallback(a),i)}_observerCallback(i){const a=T=>this._targetLinks.get(`#${T.target.id}`),p=T=>{this._previousScrollData.visibleEntryTop=T.target.offsetTop,this._process(a(T))},v=(this._rootElement||document.documentElement).scrollTop,E=v>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=v;for(const T of i){if(!T.isIntersecting){this._activeTarget=null,this._clearActiveClass(a(T));continue}const L=T.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(E&&L){if(p(T),!v)return}else E||L||p(T)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const i=O.find(yo,this._config.target);for(const a of i){if(!a.hash||m(a))continue;const p=O.findOne(decodeURI(a.hash),this._element);d(p)&&(this._targetLinks.set(decodeURI(a.hash),a),this._observableSections.set(a.hash,p))}}_process(i){this._activeTarget!==i&&(this._clearActiveClass(this._config.target),this._activeTarget=i,i.classList.add(Os),this._activateParents(i),P.trigger(this._element,Op,{relatedTarget:i}))}_activateParents(i){if(i.classList.contains("dropdown-item"))O.findOne(".dropdown-toggle",i.closest(".dropdown")).classList.add(Os);else for(const a of O.parents(i,".nav, .list-group"))for(const p of O.prev(a,Pp))p.classList.add(Os)}_clearActiveClass(i){i.classList.remove(Os);const a=O.find(`${yo}.${Os}`,i);for(const p of a)p.classList.remove(Os)}static jQueryInterface(i){return this.each(function(){const a=Zs.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0||i.startsWith("_")||i==="constructor")throw new TypeError(`No method named "${i}"`);a[i]()}})}}P.on(window,Rp,()=>{for(const f of O.find('[data-bs-spy="scroll"]'))Zs.getOrCreateInstance(f)}),F(Zs);const Qn=".bs.tab",kp=`hide${Qn}`,Lp=`hidden${Qn}`,Dp=`show${Qn}`,Mp=`shown${Qn}`,Fp=`click${Qn}`,$p=`keydown${Qn}`,jp=`load${Qn}`,Bp="ArrowLeft",oc="ArrowRight",Hp="ArrowUp",lc="ArrowDown",vo="Home",ac="End",Zn="active",cc="fade",wo="show",uc=".dropdown-toggle",Eo=`:not(${uc})`,fc='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Ao=`.nav-link${Eo}, .list-group-item${Eo}, [role="tab"]${Eo}, ${fc}`,Up=`.${Zn}[data-bs-toggle="tab"], .${Zn}[data-bs-toggle="pill"], .${Zn}[data-bs-toggle="list"]`;class es extends R{constructor(i){super(i),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),P.on(this._element,$p,a=>this._keydown(a)))}static get NAME(){return"tab"}show(){const i=this._element;if(this._elemIsActive(i))return;const a=this._getActiveElem(),p=a?P.trigger(a,kp,{relatedTarget:i}):null;P.trigger(i,Dp,{relatedTarget:a}).defaultPrevented||p&&p.defaultPrevented||(this._deactivate(a,i),this._activate(i,a))}_activate(i,a){i&&(i.classList.add(Zn),this._activate(O.getElementFromSelector(i)),this._queueCallback(()=>{i.getAttribute("role")==="tab"?(i.removeAttribute("tabindex"),i.setAttribute("aria-selected",!0),this._toggleDropDown(i,!0),P.trigger(i,Mp,{relatedTarget:a})):i.classList.add(wo)},i,i.classList.contains(cc)))}_deactivate(i,a){i&&(i.classList.remove(Zn),i.blur(),this._deactivate(O.getElementFromSelector(i)),this._queueCallback(()=>{i.getAttribute("role")==="tab"?(i.setAttribute("aria-selected",!1),i.setAttribute("tabindex","-1"),this._toggleDropDown(i,!1),P.trigger(i,Lp,{relatedTarget:a})):i.classList.remove(wo)},i,i.classList.contains(cc)))}_keydown(i){if(![Bp,oc,Hp,lc,vo,ac].includes(i.key))return;i.stopPropagation(),i.preventDefault();const a=this._getChildren().filter(v=>!m(v));let p;if([vo,ac].includes(i.key))p=a[i.key===vo?0:a.length-1];else{const v=[oc,lc].includes(i.key);p=te(a,i.target,v,!0)}p&&(p.focus({preventScroll:!0}),es.getOrCreateInstance(p).show())}_getChildren(){return O.find(Ao,this._parent)}_getActiveElem(){return this._getChildren().find(i=>this._elemIsActive(i))||null}_setInitialAttributes(i,a){this._setAttributeIfNotExists(i,"role","tablist");for(const p of a)this._setInitialAttributesOnChild(p)}_setInitialAttributesOnChild(i){i=this._getInnerElement(i);const a=this._elemIsActive(i),p=this._getOuterElement(i);i.setAttribute("aria-selected",a),p!==i&&this._setAttributeIfNotExists(p,"role","presentation"),a||i.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(i,"role","tab"),this._setInitialAttributesOnTargetPanel(i)}_setInitialAttributesOnTargetPanel(i){const a=O.getElementFromSelector(i);a&&(this._setAttributeIfNotExists(a,"role","tabpanel"),i.id&&this._setAttributeIfNotExists(a,"aria-labelledby",`${i.id}`))}_toggleDropDown(i,a){const p=this._getOuterElement(i);if(!p.classList.contains("dropdown"))return;const v=(E,T)=>{const L=O.findOne(E,p);L&&L.classList.toggle(T,a)};v(uc,Zn),v(".dropdown-menu",wo),p.setAttribute("aria-expanded",a)}_setAttributeIfNotExists(i,a,p){i.hasAttribute(a)||i.setAttribute(a,p)}_elemIsActive(i){return i.classList.contains(Zn)}_getInnerElement(i){return i.matches(Ao)?i:O.findOne(Ao,i)}_getOuterElement(i){return i.closest(".nav-item, .list-group-item")||i}static jQueryInterface(i){return this.each(function(){const a=es.getOrCreateInstance(this);if(typeof i=="string"){if(a[i]===void 0||i.startsWith("_")||i==="constructor")throw new TypeError(`No method named "${i}"`);a[i]()}})}}P.on(document,Fp,fc,function(f){["A","AREA"].includes(this.tagName)&&f.preventDefault(),m(this)||es.getOrCreateInstance(this).show()}),P.on(window,jp,()=>{for(const f of O.find(Up))es.getOrCreateInstance(f)}),F(es);const Pn=".bs.toast",Vp=`mouseover${Pn}`,qp=`mouseout${Pn}`,Wp=`focusin${Pn}`,Kp=`focusout${Pn}`,zp=`hide${Pn}`,Gp=`hidden${Pn}`,Jp=`show${Pn}`,Xp=`shown${Pn}`,dc="hide",Yr="show",Qr="showing",Yp={animation:"boolean",autohide:"boolean",delay:"number"},Qp={animation:!0,autohide:!0,delay:5e3};class er extends R{constructor(i,a){super(i,a),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Qp}static get DefaultType(){return Yp}static get NAME(){return"toast"}show(){P.trigger(this._element,Jp).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(dc),w(this._element),this._element.classList.add(Yr,Qr),this._queueCallback(()=>{this._element.classList.remove(Qr),P.trigger(this._element,Xp),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(P.trigger(this._element,zp).defaultPrevented||(this._element.classList.add(Qr),this._queueCallback(()=>{this._element.classList.add(dc),this._element.classList.remove(Qr,Yr),P.trigger(this._element,Gp)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Yr),super.dispose()}isShown(){return this._element.classList.contains(Yr)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(i,a){switch(i.type){case"mouseover":case"mouseout":this._hasMouseInteraction=a;break;case"focusin":case"focusout":this._hasKeyboardInteraction=a}if(a)return void this._clearTimeout();const p=i.relatedTarget;this._element===p||this._element.contains(p)||this._maybeScheduleHide()}_setListeners(){P.on(this._element,Vp,i=>this._onInteraction(i,!0)),P.on(this._element,qp,i=>this._onInteraction(i,!1)),P.on(this._element,Wp,i=>this._onInteraction(i,!0)),P.on(this._element,Kp,i=>this._onInteraction(i,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(i){return this.each(function(){const a=er.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0)throw new TypeError(`No method named "${i}"`);a[i](this)}})}}return ee(er),F(er),{Alert:A,Button:k,Carousel:_s,Collapse:ys,Dropdown:Kt,Modal:Xn,Offcanvas:_n,Popover:Xr,ScrollSpy:Zs,Tab:es,Toast:er,Tooltip:Yn}})})(_i)),_i.exports}Cw();Hv();const th=$_(rw);th.use(eh);th.mount("#app");export{fn as A,Yd as B,Gl as C,fr as D,Lc as E,ot as F,Nf as G,nd as H,Df as I,Ow as J,xw as K,Tw as L,Sw as T,gs as a,cd as b,kl as c,nt as d,j as e,At as f,vt as g,Rw as h,gg as i,ql as j,Ve as k,Er as l,Hn as m,Ii as n,Mi as o,Vt as p,Ue as q,Tt as r,An as s,cs as t,Xw as u,Pw as v,Io as w,$o as x,Nw as y,al as z}; +`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ps(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&gi.assertOptions(s,{silentJSONParsing:an.transitional(an.boolean),forcedJSONParsing:an.transitional(an.boolean),clarifyTimeoutError:an.transitional(an.boolean)},!1),r!=null&&(C.isFunction(r)?n.paramsSerializer={serialize:r}:gi.assertOptions(r,{encode:an.function,serialize:an.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),gi.assertOptions(n,{baseUrl:an.spelling("baseURL"),withXsrfToken:an.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&C.merge(o.common,o[n.method]);o&&C.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=Ot.concat(l,o);const c=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(u=u&&S.synchronous,c.unshift(S.fulfilled,S.rejected))});const h=[];this.interceptors.response.forEach(function(S){h.push(S.fulfilled,S.rejected)});let d,m=0,_;if(!u){const w=[Ou.bind(this),void 0];for(w.unshift(...c),w.push(...h),_=w.length,d=Promise.resolve(n);m<_;)d=d.then(w[m++],w[m++]);return d}_=c.length;let y=n;for(;m<_;){const w=c[m++],S=c[m++];try{y=w(y)}catch(x){S.call(this,x);break}}try{d=Ou.call(this,y)}catch(w){return Promise.reject(w)}for(m=0,_=h.length;m<_;)d=d.then(h[m++],h[m++]);return d}getUri(t){t=ps(this.defaults,t);const n=xd(t.baseURL,t.url,t.allowAbsoluteUrls);return Ed(n,t.params,t.paramsSerializer)}};C.forEach(["delete","get","head","options"],function(t){ds.prototype[t]=function(n,s){return this.request(ps(s||{},{method:t,url:n,data:(s||{}).data}))}});C.forEach(["post","put","patch"],function(t){function n(s){return function(o,l,c){return this.request(ps(c||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:l}))}}ds.prototype[t]=n(),ds.prototype[t+"Form"]=n(!0)});let py=class Id{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(r=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const l=new Promise(c=>{s.subscribe(c),o=c}).then(r);return l.cancel=function(){s.unsubscribe(o)},l},t(function(o,l,c){s.reason||(s.reason=new zs(o,l,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Id(function(r){t=r}),cancel:t}}};function my(e){return function(n){return e.apply(null,n)}}function gy(e){return C.isObject(e)&&e.isAxiosError===!0}const dl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(dl).forEach(([e,t])=>{dl[t]=e});function kd(e){const t=new ds(e),n=ud(ds.prototype.request,t);return C.extend(n,ds.prototype,t,{allOwnKeys:!0}),C.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return kd(ps(e,r))},n}const qe=kd(Lr);qe.Axios=ds;qe.CanceledError=zs;qe.CancelToken=py;qe.isCancel=Sd;qe.VERSION=Nd;qe.toFormData=Vi;qe.AxiosError=me;qe.Cancel=qe.CanceledError;qe.all=function(t){return Promise.all(t)};qe.spread=my;qe.isAxiosError=gy;qe.mergeConfig=ps;qe.AxiosHeaders=Ot;qe.formToJSON=e=>Cd(C.isHTMLForm(e)?new FormData(e):e);qe.getAdapter=Pd.getAdapter;qe.HttpStatusCode=dl;qe.default=qe;const{Axios:Lw,AxiosError:Dw,CanceledError:Mw,isCancel:Fw,CancelToken:$w,VERSION:jw,all:Bw,Cancel:Hw,isAxiosError:Uw,spread:Vw,toFormData:qw,AxiosHeaders:Ww,HttpStatusCode:Kw,formToJSON:zw,getAdapter:Gw,mergeConfig:Jw}=qe,or=qe.create(),hl=qe.create(),Ld=qe.create(),Dd=e=>e?.api_base_url||"http://localhost:5001/api/v1",_y=e=>e?.profiles_api_base_url||"http://localhost:8000",by=e=>{const t=Dd(e).replace(/\/+$/,"");return/\/v1$/.test(t)?t.replace(/\/v1$/,"/auth"):t+"/../auth"},yy=e=>(e.response&&e.response.status===401&&(localStorage.removeItem("ovpmon_token"),localStorage.removeItem("ovpmon_user"),window.location.pathname!=="/login"&&(window.location.href="/login")),Promise.reject(e)),Vl=(e,t,{endSessionOn401:n=!0}={})=>{e.interceptors.request.use(s=>{const{config:r}=cd();s.baseURL=t(r.value);const o=localStorage.getItem("ovpmon_token");return o&&(s.headers.Authorization=`Bearer ${o}`),s}),n&&e.interceptors.response.use(s=>s,yy)};Vl(or,Dd);Vl(hl,_y);Vl(Ld,by,{endSessionOn401:!1});function ql(){return{apiClient:or,profilesApiClient:hl,authApiClient:Ld,fetchStats:async()=>(await or.get("/stats")).data,fetchClientHistory:async(r,o)=>(await or.get(`/stats/${r}`,{params:{range:o}})).data,fetchAnalytics:async r=>(await or.get("/analytics",{params:{range:r}})).data,fetchCertificates:async()=>{const r=await hl.get("/profiles");return Array.isArray(r.data)?r.data:[]}}}const ks=typeof document<"u";function Md(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function vy(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Md(e.default)}const Oe=Object.assign;function qo(e,t){const n={};for(const s in t){const r=t[s];n[s]=Zt(r)?r.map(e):e(r)}return n}const gr=()=>{},Zt=Array.isArray;function Pu(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}const Fd=/#/g,wy=/&/g,Ey=/\//g,Ay=/=/g,Cy=/\?/g,$d=/\+/g,Sy=/%5B/g,Ty=/%5D/g,jd=/%5E/g,xy=/%60/g,Bd=/%7B/g,Oy=/%7C/g,Hd=/%7D/g,Ry=/%20/g;function Wl(e){return e==null?"":encodeURI(""+e).replace(Oy,"|").replace(Sy,"[").replace(Ty,"]")}function Py(e){return Wl(e).replace(Bd,"{").replace(Hd,"}").replace(jd,"^")}function pl(e){return Wl(e).replace($d,"%2B").replace(Ry,"+").replace(Fd,"%23").replace(wy,"%26").replace(xy,"`").replace(Bd,"{").replace(Hd,"}").replace(jd,"^")}function Ny(e){return pl(e).replace(Ay,"%3D")}function Iy(e){return Wl(e).replace(Fd,"%23").replace(Cy,"%3F")}function ky(e){return Iy(e).replace(Ey,"%2F")}function Tr(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Ly=/\/$/,Dy=e=>e.replace(Ly,"");function Wo(e,t,n="/"){let s,r={},o="",l="";const c=t.indexOf("#");let u=t.indexOf("?");return u=c>=0&&u>c?-1:u,u>=0&&(s=t.slice(0,u),o=t.slice(u,c>0?c:t.length),r=e(o.slice(1))),c>=0&&(s=s||t.slice(0,c),l=t.slice(c,t.length)),s=jy(s??t,n),{fullPath:s+o+l,path:s,query:r,hash:Tr(l)}}function My(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Nu(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Fy(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&Vs(t.matched[s],n.matched[r])&&Ud(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Vs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ud(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!$y(e[n],t[n]))return!1;return!0}function $y(e,t){return Zt(e)?Iu(e,t):Zt(t)?Iu(t,e):e?.valueOf()===t?.valueOf()}function Iu(e,t){return Zt(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function jy(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let o=n.length-1,l,c;for(l=0;l1&&o--;else break;return n.slice(0,o).join("/")+"/"+s.slice(l).join("/")}const kn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let ml=(function(e){return e.pop="pop",e.push="push",e})({}),Ko=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function By(e){if(!e)if(ks){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Dy(e)}const Hy=/^[^#]+#/;function Uy(e,t){return e.replace(Hy,"#")+t}function Vy(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Wi=()=>({left:window.scrollX,top:window.scrollY});function qy(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=Vy(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function ku(e,t){return(history.state?history.state.position-t:-1)+e}const gl=new Map;function Wy(e,t){gl.set(e,t)}function Ky(e){const t=gl.get(e);return gl.delete(e),t}function zy(e){return typeof e=="string"||e&&typeof e=="object"}function Vd(e){return typeof e=="string"||typeof e=="symbol"}let Ke=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const qd=Symbol("");Ke.MATCHER_NOT_FOUND+"",Ke.NAVIGATION_GUARD_REDIRECT+"",Ke.NAVIGATION_ABORTED+"",Ke.NAVIGATION_CANCELLED+"",Ke.NAVIGATION_DUPLICATED+"";function qs(e,t){return Oe(new Error,{type:e,[qd]:!0},t)}function yn(e,t){return e instanceof Error&&qd in e&&(t==null||!!(e.type&t))}const Gy=["params","query","hash"];function Jy(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Gy)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Xy(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;sr&&pl(r)):[s&&pl(s)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+n,r!=null&&(t+="="+r))})}return t}function Yy(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=Zt(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return t}const Qy=Symbol(""),Du=Symbol(""),Ki=Symbol(""),Kl=Symbol(""),_l=Symbol("");function rr(){let e=[];function t(s){return e.push(s),()=>{const r=e.indexOf(s);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function jn(e,t,n,s,r,o=l=>l()){const l=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((c,u)=>{const h=_=>{_===!1?u(qs(Ke.NAVIGATION_ABORTED,{from:n,to:t})):_ instanceof Error?u(_):zy(_)?u(qs(Ke.NAVIGATION_GUARD_REDIRECT,{from:t,to:_})):(l&&s.enterCallbacks[r]===l&&typeof _=="function"&&l.push(_),c())},d=o(()=>e.call(s&&s.instances[r],t,n,h));let m=Promise.resolve(d);e.length<3&&(m=m.then(h)),m.catch(_=>u(_))})}function zo(e,t,n,s,r=o=>o()){const o=[];for(const l of e)for(const c in l.components){let u=l.components[c];if(!(t!=="beforeRouteEnter"&&!l.instances[c]))if(Md(u)){const h=(u.__vccOpts||u)[t];h&&o.push(jn(h,n,s,l,c,r))}else{let h=u();o.push(()=>h.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${c}" at "${l.path}"`);const m=vy(d)?d.default:d;l.mods[c]=d,l.components[c]=m;const _=(m.__vccOpts||m)[t];return _&&jn(_,n,s,l,c,r)()}))}}return o}function Zy(e,t){const n=[],s=[],r=[],o=Math.max(t.matched.length,e.matched.length);for(let l=0;lVs(h,c))?s.push(c):n.push(c));const u=e.matched[l];u&&(t.matched.find(h=>Vs(h,u))||r.push(u))}return[n,s,r]}let ev=()=>location.protocol+"//"+location.host;function Wd(e,t){const{pathname:n,search:s,hash:r}=t,o=e.indexOf("#");if(o>-1){let l=r.includes(e.slice(o))?e.slice(o).length:1,c=r.slice(l);return c[0]!=="/"&&(c="/"+c),Nu(c,"")}return Nu(n,e)+s+r}function tv(e,t,n,s){let r=[],o=[],l=null;const c=({state:_})=>{const y=Wd(e,location),w=n.value,S=t.value;let x=0;if(_){if(n.value=y,t.value=_,l&&l===w){l=null;return}x=S?_.position-S.position:0}else s(y);r.forEach(D=>{D(n.value,w,{delta:x,type:ml.pop,direction:x?x>0?Ko.forward:Ko.back:Ko.unknown})})};function u(){l=n.value}function h(_){r.push(_);const y=()=>{const w=r.indexOf(_);w>-1&&r.splice(w,1)};return o.push(y),y}function d(){if(document.visibilityState==="hidden"){const{history:_}=window;if(!_.state)return;_.replaceState(Oe({},_.state,{scroll:Wi()}),"")}}function m(){for(const _ of o)_();o=[],window.removeEventListener("popstate",c),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",c),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:u,listen:h,destroy:m}}function Mu(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Wi():null}}function nv(e){const{history:t,location:n}=window,s={value:Wd(e,n)},r={value:t.state};r.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(u,h,d){const m=e.indexOf("#"),_=m>-1?(n.host&&document.querySelector("base")?e:e.slice(m))+u:ev()+e+u;try{t[d?"replaceState":"pushState"](h,"",_),r.value=h}catch(y){console.error(y),n[d?"replace":"assign"](_)}}function l(u,h){o(u,Oe({},t.state,Mu(r.value.back,u,r.value.forward,!0),h,{position:r.value.position}),!0),s.value=u}function c(u,h){const d=Oe({},r.value,t.state,{forward:u,scroll:Wi()});o(d.current,d,!0),o(u,Oe({},Mu(s.value,u,null),{position:d.position+1},h),!1),s.value=u}return{location:s,state:r,push:c,replace:l}}function sv(e){e=By(e);const t=nv(e),n=tv(e,t.state,t.location,t.replace);function s(o,l=!0){l||n.pauseListeners(),history.go(o)}const r=Oe({location:"",base:e,go:s,createHref:Uy.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let as=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Qe=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Qe||{});const rv={type:as.Static,value:""},iv=/[a-zA-Z0-9_]/;function ov(e){if(!e)return[[]];if(e==="/")return[[rv]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(y){throw new Error(`ERR (${n})/"${h}": ${y}`)}let n=Qe.Static,s=n;const r=[];let o;function l(){o&&r.push(o),o=[]}let c=0,u,h="",d="";function m(){h&&(n===Qe.Static?o.push({type:as.Static,value:h}):n===Qe.Param||n===Qe.ParamRegExp||n===Qe.ParamRegExpEnd?(o.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${h}) must be alone in its segment. eg: '/:ids+.`),o.push({type:as.Param,value:h,regexp:d,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),h="")}function _(){h+=u}for(;ct.length?t.length===1&&t[0]===wt.Static+wt.Segment?1:-1:0}function Kd(e,t){let n=0;const s=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const fv={strict:!1,end:!0,sensitive:!1};function dv(e,t,n){const s=cv(ov(e.path),n),r=Oe(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function hv(e,t){const n=[],s=new Map;t=Pu(fv,t);function r(m){return s.get(m)}function o(m,_,y){const w=!y,S=Bu(m);S.aliasOf=y&&y.record;const x=Pu(t,m),D=[S];if("alias"in m){const H=typeof m.alias=="string"?[m.alias]:m.alias;for(const te of H)D.push(Bu(Oe({},S,{components:y?y.record.components:S.components,path:te,aliasOf:y?y.record:S})))}let F,$;for(const H of D){const{path:te}=H;if(_&&te[0]!=="/"){const le=_.record.path,Z=le[le.length-1]==="/"?"":"/";H.path=_.record.path+(te&&Z+te)}if(F=dv(H,_,x),y?y.alias.push(F):($=$||F,$!==F&&$.alias.push(F),w&&m.name&&!Hu(F)&&l(m.name)),zd(F)&&u(F),S.children){const le=S.children;for(let Z=0;Z{l($)}:gr}function l(m){if(Vd(m)){const _=s.get(m);_&&(s.delete(m),n.splice(n.indexOf(_),1),_.children.forEach(l),_.alias.forEach(l))}else{const _=n.indexOf(m);_>-1&&(n.splice(_,1),m.record.name&&s.delete(m.record.name),m.children.forEach(l),m.alias.forEach(l))}}function c(){return n}function u(m){const _=gv(m,n);n.splice(_,0,m),m.record.name&&!Hu(m)&&s.set(m.record.name,m)}function h(m,_){let y,w={},S,x;if("name"in m&&m.name){if(y=s.get(m.name),!y)throw qs(Ke.MATCHER_NOT_FOUND,{location:m});x=y.record.name,w=Oe(ju(_.params,y.keys.filter($=>!$.optional).concat(y.parent?y.parent.keys.filter($=>$.optional):[]).map($=>$.name)),m.params&&ju(m.params,y.keys.map($=>$.name))),S=y.stringify(w)}else if(m.path!=null)S=m.path,y=n.find($=>$.re.test(S)),y&&(w=y.parse(S),x=y.record.name);else{if(y=_.name?s.get(_.name):n.find($=>$.re.test(_.path)),!y)throw qs(Ke.MATCHER_NOT_FOUND,{location:m,currentLocation:_});x=y.record.name,w=Oe({},_.params,m.params),S=y.stringify(w)}const D=[];let F=y;for(;F;)D.unshift(F.record),F=F.parent;return{name:x,path:S,params:w,matched:D,meta:mv(D)}}e.forEach(m=>o(m));function d(){n.length=0,s.clear()}return{addRoute:o,resolve:h,removeRoute:l,clearRoutes:d,getRoutes:c,getRecordMatcher:r}}function ju(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Bu(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:pv(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function pv(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Hu(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function mv(e){return e.reduce((t,n)=>Oe(t,n.meta),{})}function gv(e,t){let n=0,s=t.length;for(;n!==s;){const o=n+s>>1;Kd(e,t[o])<0?s=o:n=o+1}const r=_v(e);return r&&(s=t.lastIndexOf(r,s-1)),s}function _v(e){let t=e;for(;t=t.parent;)if(zd(t)&&Kd(e,t)===0)return t}function zd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Uu(e){const t=Jt(Ki),n=Jt(Kl),s=Vt(()=>{const u=At(e.to);return t.resolve(u)}),r=Vt(()=>{const{matched:u}=s.value,{length:h}=u,d=u[h-1],m=n.matched;if(!d||!m.length)return-1;const _=m.findIndex(Vs.bind(null,d));if(_>-1)return _;const y=Vu(u[h-2]);return h>1&&Vu(d)===y&&m[m.length-1].path!==y?m.findIndex(Vs.bind(null,u[h-2])):_}),o=Vt(()=>r.value>-1&&Ev(n.params,s.value.params)),l=Vt(()=>r.value>-1&&r.value===n.matched.length-1&&Ud(n.params,s.value.params));function c(u={}){if(wv(u)){const h=t[At(e.replace)?"replace":"push"](At(e.to)).catch(gr);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>h),h}return Promise.resolve()}return{route:s,href:Vt(()=>s.value.href),isActive:o,isExactActive:l,navigate:c}}function bv(e){return e.length===1?e[0]:e}const yv=Nf({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Uu,setup(e,{slots:t}){const n=gs(Uu(e)),{options:s}=Jt(Ki),r=Vt(()=>({[qu(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[qu(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&bv(t.default(n));return e.custom?o:nd("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},o)}}}),vv=yv;function wv(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Ev(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!Zt(r)||r.length!==s.length||s.some((o,l)=>o.valueOf()!==r[l].valueOf()))return!1}return!0}function Vu(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const qu=(e,t,n)=>e??t??n,Av=Nf({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Jt(_l),r=Vt(()=>e.route||s.value),o=Jt(Du,0),l=Vt(()=>{let h=At(o);const{matched:d}=r.value;let m;for(;(m=d[h])&&!m.components;)h++;return h}),c=Vt(()=>r.value.matched[l.value]);ci(Du,Vt(()=>l.value+1)),ci(Qy,c),ci(_l,r);const u=Tt();return fr(()=>[u.value,c.value,e.name],([h,d,m],[_,y,w])=>{d&&(d.instances[m]=h,y&&y!==d&&h&&h===_&&(d.leaveGuards.size||(d.leaveGuards=y.leaveGuards),d.updateGuards.size||(d.updateGuards=y.updateGuards))),h&&d&&(!y||!Vs(d,y)||!_)&&(d.enterCallbacks[m]||[]).forEach(S=>S(h))},{flush:"post"}),()=>{const h=r.value,d=e.name,m=c.value,_=m&&m.components[d];if(!_)return Wu(n.default,{Component:_,route:h});const y=m.props[d],w=y?y===!0?h.params:typeof y=="function"?y(h):y:null,x=nd(_,Oe({},w,t,{onVnodeUnmounted:D=>{D.component.isUnmounted&&(m.instances[d]=null)},ref:u}));return Wu(n.default,{Component:x,route:h})||x}}});function Wu(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Cv=Av;function Sv(e){const t=hv(e.routes,e),n=e.parseQuery||Xy,s=e.stringifyQuery||Lu,r=e.history,o=rr(),l=rr(),c=rr(),u=Bm(kn);let h=kn;ks&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=qo.bind(null,R=>""+R),m=qo.bind(null,ky),_=qo.bind(null,Tr);function y(R,X){let O,ee;return Vd(R)?(O=t.getRecordMatcher(R),ee=X):ee=R,t.addRoute(ee,O)}function w(R){const X=t.getRecordMatcher(R);X&&t.removeRoute(X)}function S(){return t.getRoutes().map(R=>R.record)}function x(R){return!!t.getRecordMatcher(R)}function D(R,X){if(X=Oe({},X||u.value),typeof R=="string"){const A=Wo(n,R,X.path),I=t.resolve({path:A.path},X),k=r.createHref(A.fullPath);return Oe(A,I,{params:_(I.params),hash:Tr(A.hash),redirectedFrom:void 0,href:k})}let O;if(R.path!=null)O=Oe({},R,{path:Wo(n,R.path,X.path).path});else{const A=Oe({},R.params);for(const I in A)A[I]==null&&delete A[I];O=Oe({},R,{params:m(A)}),X.params=m(X.params)}const ee=t.resolve(O,X),we=R.hash||"";ee.params=d(_(ee.params));const g=My(s,Oe({},R,{hash:Py(we),path:ee.path})),b=r.createHref(g);return Oe({fullPath:g,hash:we,query:s===Lu?Yy(R.query):R.query||{}},ee,{redirectedFrom:void 0,href:b})}function F(R){return typeof R=="string"?Wo(n,R,u.value.path):Oe({},R)}function $(R,X){if(h!==R)return qs(Ke.NAVIGATION_CANCELLED,{from:X,to:R})}function H(R){return Z(R)}function te(R){return H(Oe(F(R),{replace:!0}))}function le(R,X){const O=R.matched[R.matched.length-1];if(O&&O.redirect){const{redirect:ee}=O;let we=typeof ee=="function"?ee(R,X):ee;return typeof we=="string"&&(we=we.includes("?")||we.includes("#")?we=F(we):{path:we},we.params={}),Oe({query:R.query,hash:R.hash,params:we.path!=null?{}:R.params},we)}}function Z(R,X){const O=h=D(R),ee=u.value,we=R.state,g=R.force,b=R.replace===!0,A=le(O,ee);if(A)return Z(Oe(F(A),{state:typeof A=="object"?Oe({},we,A.state):we,force:g,replace:b}),X||O);const I=O;I.redirectedFrom=X;let k;return!g&&Fy(s,ee,O)&&(k=qs(Ke.NAVIGATION_DUPLICATED,{to:I,from:ee}),P(ee,ee,!0,!1)),(k?Promise.resolve(k):fe(I,ee)).catch(N=>yn(N)?yn(N,Ke.NAVIGATION_GUARD_REDIRECT)?N:Rt(N):de(N,I,ee)).then(N=>{if(N){if(yn(N,Ke.NAVIGATION_GUARD_REDIRECT))return Z(Oe({replace:b},F(N.to),{state:typeof N.to=="object"?Oe({},we,N.to.state):we,force:g}),X||I)}else N=G(I,ee,!0,b,we);return _e(I,ee,N),N})}function B(R,X){const O=$(R,X);return O?Promise.reject(O):Promise.resolve()}function z(R){const X=ht.values().next().value;return X&&typeof X.runWithContext=="function"?X.runWithContext(R):R()}function fe(R,X){let O;const[ee,we,g]=Zy(R,X);O=zo(ee.reverse(),"beforeRouteLeave",R,X);for(const A of ee)A.leaveGuards.forEach(I=>{O.push(jn(I,R,X))});const b=B.bind(null,R,X);return O.push(b),et(O).then(()=>{O=[];for(const A of o.list())O.push(jn(A,R,X));return O.push(b),et(O)}).then(()=>{O=zo(we,"beforeRouteUpdate",R,X);for(const A of we)A.updateGuards.forEach(I=>{O.push(jn(I,R,X))});return O.push(b),et(O)}).then(()=>{O=[];for(const A of g)if(A.beforeEnter)if(Zt(A.beforeEnter))for(const I of A.beforeEnter)O.push(jn(I,R,X));else O.push(jn(A.beforeEnter,R,X));return O.push(b),et(O)}).then(()=>(R.matched.forEach(A=>A.enterCallbacks={}),O=zo(g,"beforeRouteEnter",R,X,z),O.push(b),et(O))).then(()=>{O=[];for(const A of l.list())O.push(jn(A,R,X));return O.push(b),et(O)}).catch(A=>yn(A,Ke.NAVIGATION_CANCELLED)?A:Promise.reject(A))}function _e(R,X,O){c.list().forEach(ee=>z(()=>ee(R,X,O)))}function G(R,X,O,ee,we){const g=$(R,X);if(g)return g;const b=X===kn,A=ks?history.state:{};O&&(ee||b?r.replace(R.fullPath,Oe({scroll:b&&A&&A.scroll},we)):r.push(R.fullPath,we)),u.value=R,P(R,X,O,b),Rt()}let ye;function Pe(){ye||(ye=r.listen((R,X,O)=>{if(!Je.listening)return;const ee=D(R),we=le(ee,Je.currentRoute.value);if(we){Z(Oe(we,{replace:!0,force:!0}),ee).catch(gr);return}h=ee;const g=u.value;ks&&Wy(ku(g.fullPath,O.delta),Wi()),fe(ee,g).catch(b=>yn(b,Ke.NAVIGATION_ABORTED|Ke.NAVIGATION_CANCELLED)?b:yn(b,Ke.NAVIGATION_GUARD_REDIRECT)?(Z(Oe(F(b.to),{force:!0}),ee).then(A=>{yn(A,Ke.NAVIGATION_ABORTED|Ke.NAVIGATION_DUPLICATED)&&!O.delta&&O.type===ml.pop&&r.go(-1,!1)}).catch(gr),Promise.reject()):(O.delta&&r.go(-O.delta,!1),de(b,ee,g))).then(b=>{b=b||G(ee,g,!1),b&&(O.delta&&!yn(b,Ke.NAVIGATION_CANCELLED)?r.go(-O.delta,!1):O.type===ml.pop&&yn(b,Ke.NAVIGATION_ABORTED|Ke.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),_e(ee,g,b)}).catch(gr)}))}let Ye=rr(),Ee=rr(),Ce;function de(R,X,O){Rt(R);const ee=Ee.list();return ee.length?ee.forEach(we=>we(R,X,O)):console.error(R),Promise.reject(R)}function Ct(){return Ce&&u.value!==kn?Promise.resolve():new Promise((R,X)=>{Ye.add([R,X])})}function Rt(R){return Ce||(Ce=!R,Pe(),Ye.list().forEach(([X,O])=>R?O(R):X()),Ye.reset()),R}function P(R,X,O,ee){const{scrollBehavior:we}=e;if(!ks||!we)return Promise.resolve();const g=!O&&Ky(ku(R.fullPath,0))||(ee||!O)&&history.state&&history.state.scroll||null;return Pl().then(()=>we(R,X,g)).then(b=>b&&qy(b)).catch(b=>de(b,R,X))}const He=R=>r.go(R);let Pt;const ht=new Set,Je={currentRoute:u,listening:!0,addRoute:y,removeRoute:w,clearRoutes:t.clearRoutes,hasRoute:x,getRoutes:S,resolve:D,options:e,push:H,replace:te,go:He,back:()=>He(-1),forward:()=>He(1),beforeEach:o.add,beforeResolve:l.add,afterEach:c.add,onError:Ee.add,isReady:Ct,install(R){R.component("RouterLink",vv),R.component("RouterView",Cv),R.config.globalProperties.$router=Je,Object.defineProperty(R.config.globalProperties,"$route",{enumerable:!0,get:()=>At(u)}),ks&&!Pt&&u.value===kn&&(Pt=!0,H(r.location).catch(ee=>{}));const X={};for(const ee in kn)Object.defineProperty(X,ee,{get:()=>u.value[ee],enumerable:!0});R.provide(Ki,Je),R.provide(Kl,_f(X)),R.provide(_l,u);const O=R.unmount;ht.add(R),R.unmount=function(){ht.delete(R),ht.size<1&&(h=kn,ye&&ye(),ye=null,u.value=kn,Pt=!1,Ce=!1),O()}}};function et(R){return R.reduce((X,O)=>X.then(()=>z(O)),Promise.resolve())}return Je}function Gd(){return Jt(Ki)}function Tv(e){return Jt(Kl)}const xv=4,Ov=5e3,Rv=8e3,Vn=gs([]),ms=new Map;let Pv=1;const Jd=e=>{const t=ms.get(e);t&&clearTimeout(t.handle),ms.delete(e)},zl=e=>{Jd(e);const t=Vn.findIndex(n=>n.id===e);t!==-1&&Vn.splice(t,1)},Xd=(e,t)=>{Jd(e),ms.set(e,{handle:setTimeout(()=>zl(e),t),startedAt:Date.now(),remaining:t})},Nv=e=>{const t=ms.get(e);t&&(clearTimeout(t.handle),t.remaining=Math.max(0,t.remaining-(Date.now()-t.startedAt)),t.handle=null)},Iv=e=>{const t=ms.get(e);!t||t.handle!==null||Xd(e,t.remaining)},kv=(e,t="success",n)=>{const s=["success","warning","error","info"].includes(t)?t:"info",r=n??(s==="error"?Rv:Ov),o=Pv++;for(Vn.push({id:o,text:String(e??""),type:s,timeout:r});Vn.length>xv;)zl(Vn[0].id);return r>0&&Xd(o,r),o},Lv=()=>{ms.forEach(e=>clearTimeout(e.handle)),ms.clear(),Vn.splice(0,Vn.length)};function Gl(){return{toasts:Vn,show:kv,dismiss:zl,pause:Nv,resume:Iv,clear:Lv}}const Dv={class:"toast-stack"},Mv=["role","aria-live","onMouseenter","onMouseleave"],Fv={class:"app-toast-text"},$v=["onClick"],jv={__name:"ToastContainer",setup(e){const{toasts:t,dismiss:n,pause:s,resume:r,clear:o}=Gl(),l={success:"fa-check-circle",warning:"fa-exclamation-triangle",error:"fa-exclamation-circle",info:"fa-info-circle"};return Il(o),(c,u)=>(Ve(),nt("div",Dv,[Ue(x_,{name:"toast",tag:"div",class:"toast-stack-list"},{default:fn(()=>[(Ve(!0),nt(ot,null,gg(At(t),h=>(Ve(),nt("div",{key:h.id,class:An(["app-toast","app-toast-"+h.type]),role:h.type==="error"?"alert":"status","aria-live":h.type==="error"?"assertive":"polite","aria-atomic":"true",onMouseenter:d=>At(s)(h.id),onMouseleave:d=>At(r)(h.id)},[j("i",{class:An(["fas app-toast-icon",l[h.type]]),"aria-hidden":"true"},null,2),j("div",Fv,cs(h.text),1),j("button",{type:"button",class:"app-toast-close","aria-label":"Close notification",onClick:d=>At(n)(h.id)},[...u[0]||(u[0]=[j("i",{class:"fas fa-times","aria-hidden":"true"},null,-1)])],8,$v),h.timeout>0?(Ve(),nt("div",{key:0,class:"app-toast-progress",style:Ii({animationDuration:h.timeout+"ms"})},null,4)):Hn("",!0)],42,Mv))),128))]),_:1})]))}},lr=gs({pki_ready:!0,server_ready:!0,missing:[],state:"idle"}),Bv=async()=>{if(!localStorage.getItem("ovpmon_token"))return!1;try{const{profilesApiClient:e}=ql(),n=(await e.get("/system/init/status")).data||{};return lr.pki_ready=n.pki_ready!==!1,lr.server_ready=n.server_ready!==!1,lr.missing=n.missing||[],lr.state=n.state||"idle",!0}catch{return!1}};function Yd(){return{status:lr,refresh:Bv}}const Qd="theme",Jl=Tt(!1),Zd=e=>{Jl.value=e==="dark",document.documentElement.setAttribute("data-theme",e)},Hv=()=>{let e=null;try{e=localStorage.getItem(Qd)}catch{}e!=="dark"&&e!=="light"&&(e=window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"),Zd(e)},Uv=()=>{const e=Jl.value?"light":"dark";Zd(e);try{localStorage.setItem(Qd,e)}catch{}};function Vv(){return{isDark:Jl,toggleTheme:Uv}}function Xw(e){let t=null;Mi(()=>{t=new MutationObserver(n=>{n.some(s=>s.attributeName==="data-theme")&&e()}),t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}),kl(()=>t?.disconnect())}const qv={key:0,class:"d-flex justify-content-center align-items-center vh-100"},Wv={class:"sidebar-header"},Kv={class:"sidebar-menu"},zv={class:"sidebar-footer"},Gv={class:"main-content"},Jv={key:0,class:"top-navbar"},Xv={class:"d-flex align-items-center gap-3"},Yv={class:"navbar-actions"},Qv={class:"header-timezone d-none d-lg-inline-flex"},Zv={class:"user-profile ms-2"},ew={class:"user-avatar-small bg-primary text-white"},tw={class:"user-meta d-none d-md-block"},nw={class:"username"},sw={class:"content-wrapper"},rw={__name:"App",setup(e){const{loadConfig:t,isLoaded:n}=cd(),{apiClient:s}=ql(),r=Tt(new Date().toLocaleTimeString("en-us",{timeZoneName:"short"}).split(" ")[2]||"UTC"),{isDark:o,toggleTheme:l}=Vv(),c=Tt(0),u=Tt(!1),h=Tt(!1),d=Tv(),m=Gd(),{status:_,refresh:y}=Yd(),w=Gl(),S=Vt(()=>(d.fullPath,!d.meta.public&&!!localStorage.getItem("ovpmon_token"))),x=Tt(localStorage.getItem("ovpmon_user")||""),D=async()=>{if(!localStorage.getItem("ovpmon_token")){x.value="";return}x.value=localStorage.getItem("ovpmon_user")||"";try{const Z=await s.get("/user/me");Z.data?.username&&(x.value=Z.data.username,localStorage.setItem("ovpmon_user",Z.data.username))}catch{}},F=()=>{x.value=localStorage.getItem("ovpmon_user")||""},$=()=>{w.show("Initialize PKI first","info"),d.name!=="PKIConfig"&&m.push("/config/pki")},H=()=>{localStorage.removeItem("ovpmon_token"),localStorage.removeItem("ovpmon_user"),m.push("/login")},te=()=>{h.value=!h.value,localStorage.setItem("sidebarCompact",h.value)},le=()=>{c.value++};return fr(()=>d.path,()=>{u.value=!1,S.value&&(D(),y())}),Mi(async()=>{await t(),window.addEventListener("ovpmon-user-changed",F),S.value&&(D(),y());const Z=localStorage.getItem("sidebarCompact");h.value=Z==="true"}),(Z,B)=>{const z=Lc("router-link"),fe=Lc("router-view");return Ve(),nt(ot,null,[At(n)?(Ve(),nt("div",{key:1,class:An(["app-wrapper",{"mobile-nav-active":u.value,"sidebar-compact":h.value,"no-sidebar":!S.value}])},[u.value&&S.value?(Ve(),nt("div",{key:0,class:"mobile-overlay",onClick:B[0]||(B[0]=_e=>u.value=!1)})):Hn("",!0),S.value?(Ve(),nt("aside",{key:1,class:An(["sidebar",{compact:h.value}])},[j("div",Wv,[B[6]||(B[6]=j("img",{src:H_,alt:"OpenVPN",class:"sidebar-brand-icon"},null,-1)),B[7]||(B[7]=j("span",{class:"brand-text"},"OpenVPN Controller",-1)),j("button",{class:"btn btn-link text-muted d-md-none ms-auto",onClick:B[1]||(B[1]=_e=>u.value=!1)},[...B[5]||(B[5]=[j("i",{class:"fas fa-times"},null,-1)])])]),j("nav",Kv,[B[17]||(B[17]=j("div",{class:"nav-section-header"},"MONITORING",-1)),Ue(z,{to:"/",class:"nav-link","active-class":"active",title:"Analytics"},{default:fn(()=>[...B[8]||(B[8]=[j("i",{class:"fas fa-chart-line"},null,-1),vt(),j("span",null,"Analytics",-1)])]),_:1}),Ue(z,{to:"/clients",class:"nav-link","active-class":"active",title:"Clients"},{default:fn(()=>[...B[9]||(B[9]=[j("i",{class:"fas fa-network-wired"},null,-1),vt(),j("span",null,"Clients",-1)])]),_:1}),B[18]||(B[18]=j("div",{class:"nav-section-header mt-3"},"CONFIGURATION",-1)),Ue(z,{to:"/config/pki",class:"nav-link","active-class":"active",title:"PKI"},{default:fn(()=>[...B[10]||(B[10]=[j("i",{class:"fas fa-fingerprint"},null,-1),vt(),j("span",null,"PKI",-1)])]),_:1}),At(_).pki_ready?(Ve(),Er(z,{key:0,to:"/config/vpn",class:"nav-link","active-class":"active",title:"VPN"},{default:fn(()=>[...B[11]||(B[11]=[j("i",{class:"fas fa-server"},null,-1),vt(),j("span",null,"VPN",-1)])]),_:1})):(Ve(),nt("a",{key:1,href:"/config/pki",class:"nav-link nav-link-locked",title:"Initialize PKI first",onClick:al($,["prevent"])},[...B[12]||(B[12]=[j("i",{class:"fas fa-lock"},null,-1),vt(),j("span",null,"VPN",-1)])])),B[19]||(B[19]=j("div",{class:"nav-section-header mt-3"},"MANAGEMENT",-1)),Ue(z,{to:"/certificates",class:"nav-link","active-class":"active",title:"Certificates"},{default:fn(()=>[...B[13]||(B[13]=[j("i",{class:"fas fa-certificate"},null,-1),vt(),j("span",null,"Certificates",-1)])]),_:1}),Ue(z,{to:"/server",class:"nav-link","active-class":"active",title:"Server Process"},{default:fn(()=>[...B[14]||(B[14]=[j("i",{class:"fas fa-terminal"},null,-1),vt(),j("span",null,"Server Process",-1)])]),_:1}),Ue(z,{to:"/backup",class:"nav-link","active-class":"active",title:"Backup and Restore"},{default:fn(()=>[...B[15]||(B[15]=[j("i",{class:"fas fa-box-archive"},null,-1),vt(),j("span",null,"Backup and Restore",-1)])]),_:1}),B[20]||(B[20]=j("div",{class:"nav-section-header mt-3"},"ACCOUNT",-1)),Ue(z,{to:"/account",class:"nav-link","active-class":"active",title:"Account Settings"},{default:fn(()=>[...B[16]||(B[16]=[j("i",{class:"fas fa-user-cog"},null,-1),vt(),j("span",null,"Account Settings",-1)])]),_:1}),B[21]||(B[21]=j("div",{class:"mt-auto"},null,-1))]),j("div",zv,[j("button",{class:"btn btn-link toggle-btn d-none d-md-block w-100",onClick:te,title:"Toggle Sidebar"},[j("i",{class:An(["fas",h.value?"fa-chevron-right":"fa-chevron-left"])},null,2)])])],2)):Hn("",!0),j("main",Gv,[S.value?(Ve(),nt("header",Jv,[j("div",Xv,[j("button",{class:"btn-header d-md-none",onClick:B[2]||(B[2]=_e=>u.value=!u.value)},[...B[22]||(B[22]=[j("i",{class:"fas fa-bars"},null,-1)])]),B[23]||(B[23]=j("div",{class:"page-title"},null,-1))]),j("div",Yv,[j("span",Qv,[B[24]||(B[24]=j("i",{class:"fas fa-globe me-1 text-muted"},null,-1)),vt(cs(r.value),1)]),j("button",{class:"btn-header",onClick:B[3]||(B[3]=(..._e)=>At(l)&&At(l)(..._e)),title:"Toggle Theme"},[j("i",{class:An(["fas",At(o)?"fa-sun":"fa-moon"])},null,2)]),j("button",{class:"btn-header me-2",onClick:le,title:"Refresh"},[...B[25]||(B[25]=[j("i",{class:"fas fa-sync-alt"},null,-1)])]),B[27]||(B[27]=j("div",{class:"header-divider d-none d-md-block"},null,-1)),j("div",Zv,[j("div",ew,cs(x.value[0]?.toUpperCase()||"U"),1),j("div",tw,[j("span",nw,cs(x.value),1)])]),j("button",{class:"btn-header btn-logout ms-2",onClick:H,title:"Logout"},[...B[26]||(B[26]=[j("i",{class:"fas fa-sign-out-alt"},null,-1)])])])])):Hn("",!0),j("div",sw,[(Ve(),Er(fe,{key:Z.$route.fullPath+"-"+c.value}))])])],2)):(Ve(),nt("div",qv,[...B[4]||(B[4]=[j("div",{class:"spinner-border text-primary",role:"status"},[j("span",{class:"visually-hidden"},"Loading...")],-1)])])),Ue(jv)],64)}}},iw="modulepreload",ow=function(e){return"/"+e},Ku={},Ln=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){let u=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");r=u(n.map(h=>{if(h=ow(h),h in Ku)return;Ku[h]=!0;const d=h.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${m}`))return;const _=document.createElement("link");if(_.rel=d?"stylesheet":iw,d||(_.as="script"),_.crossOrigin="",_.href=h,c&&_.setAttribute("nonce",c),document.head.appendChild(_),d)return new Promise((y,w)=>{_.addEventListener("load",y),_.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})},lw={class:"login-page"},aw={class:"login-card"},cw={class:"login-body"},uw={class:"mb-4"},fw={class:"input-group"},dw={class:"mb-4"},hw={class:"input-group"},pw={key:0,class:"alert alert-danger fade show mb-4"},mw=["disabled"],gw={key:0,class:"spinner-border spinner-border-sm me-2"},_w={class:"mb-4"},bw={key:0,class:"alert alert-danger fade show mb-4"},yw=["disabled"],vw={key:0,class:"spinner-border spinner-border-sm me-2"},ww={__name:"Login",setup(e){const t=Gd(),{authApiClient:n}=ql(),s=Tt(!1),r=Tt(""),o=Tt(!1),l=Tt(""),c=Tt(""),u=gs({username:"",password:""}),h=async()=>{s.value=!0,r.value="";try{const _=await n.post("/login",u);_.data.requires_2fa?(o.value=!0,l.value=_.data.temp_token):(localStorage.setItem("ovpmon_token",_.data.token),localStorage.setItem("ovpmon_user",_.data.username),t.push("/"))}catch(_){console.error("Login Error:",_),r.value=_.response?.data?.error||"Login failed. Please check your connection."}finally{s.value=!1}},d=async()=>{s.value=!0,r.value="";try{const _=await n.post("/verify-2fa",{temp_token:l.value,otp:c.value});localStorage.setItem("ovpmon_token",_.data.token),localStorage.setItem("ovpmon_user",_.data.username),t.push("/")}catch(_){r.value=_.response?.data?.error||"Verification failed."}finally{s.value=!1}},m=()=>{o.value=!1,l.value="",c.value="",r.value=""};return(_,y)=>(Ve(),nt("div",lw,[j("div",aw,[y[12]||(y[12]=j("div",{class:"login-header"},[j("div",{class:"brand-logo"},[j("i",{class:"fas fa-shield-alt"})]),j("h1",null,"OpenVPN Controller"),j("p",{class:"text-muted"},"Secure Access Control")],-1)),j("div",cw,[o.value?(Ve(),nt("form",{key:1,onSubmit:al(d,["prevent"])},[y[11]||(y[11]=j("div",{class:"text-center mb-4"},[j("i",{class:"fas fa-key fa-3x text-warning mb-3"}),j("h3",null,"Two-Factor Authentication"),j("p",{class:"text-muted"},"Enter the 6-digit code from your authenticator app.")],-1)),j("div",_w,[Io(j("input",{type:"text",class:"form-control form-control-lg text-center fw-bold","onUpdate:modelValue":y[2]||(y[2]=w=>c.value=w),placeholder:"000 000",maxlength:"6",inputmode:"numeric",autocomplete:"one-time-code","aria-label":"6-digit authentication code",required:"",autofocus:""},null,512),[[$o,c.value]])]),r.value?(Ve(),nt("div",bw,[y[9]||(y[9]=j("i",{class:"fas fa-exclamation-circle me-2"},null,-1)),vt(cs(r.value),1)])):Hn("",!0),j("button",{type:"submit",class:"btn btn-warning w-100 py-2 fw-bold",disabled:s.value},[s.value?(Ve(),nt("span",vw)):Hn("",!0),y[10]||(y[10]=vt(" Verify & Continue ",-1))],8,yw),j("button",{type:"button",class:"btn btn-link w-100 mt-2 text-muted",onClick:m}," Back to login ")],32)):(Ve(),nt("form",{key:0,onSubmit:al(h,["prevent"])},[j("div",uw,[y[4]||(y[4]=j("label",{class:"form-label",for:"loginUsername"},"Username",-1)),j("div",fw,[y[3]||(y[3]=j("span",{class:"input-group-text"},[j("i",{class:"fas fa-user"})],-1)),Io(j("input",{id:"loginUsername",type:"text",class:"form-control","onUpdate:modelValue":y[0]||(y[0]=w=>u.username=w),placeholder:"Enter username",autocomplete:"username",required:""},null,512),[[$o,u.username]])])]),j("div",dw,[y[6]||(y[6]=j("label",{class:"form-label",for:"loginPassword"},"Password",-1)),j("div",hw,[y[5]||(y[5]=j("span",{class:"input-group-text"},[j("i",{class:"fas fa-lock"})],-1)),Io(j("input",{id:"loginPassword",type:"password",class:"form-control","onUpdate:modelValue":y[1]||(y[1]=w=>u.password=w),placeholder:"Enter password",autocomplete:"current-password",required:""},null,512),[[$o,u.password]])])]),r.value?(Ve(),nt("div",pw,[y[7]||(y[7]=j("i",{class:"fas fa-exclamation-circle me-2"},null,-1)),vt(cs(r.value),1)])):Hn("",!0),j("button",{type:"submit",class:"btn btn-primary w-100 py-2 fw-bold",disabled:s.value},[s.value?(Ve(),nt("span",gw)):Hn("",!0),y[8]||(y[8]=vt(" Sign In ",-1))],8,mw)],32))]),y[13]||(y[13]=j("div",{class:"login-footer text-center mt-4"},[j("p",{class:"small text-muted"},"© 2026 OpenVPN Controller")],-1))])]))}},Ew=[{path:"/",name:"Analytics",component:()=>Ln(()=>import("./Analytics-CkWhgHOC.js"),__vite__mapDeps([0,1,2,3]))},{path:"/clients",name:"Clients",component:()=>Ln(()=>import("./Clients-B12ijQb2.js"),__vite__mapDeps([4,3,1,2,5]))},{path:"/certificates",name:"Certificates",component:()=>Ln(()=>import("./Certificates-bKg5i2cX.js"),__vite__mapDeps([6,7,5]))},{path:"/config/pki",name:"PKIConfig",component:()=>Ln(()=>import("./PKIConfig-WA_fcodw.js"),__vite__mapDeps([8,7,5]))},{path:"/config/vpn",name:"VPNConfig",component:()=>Ln(()=>import("./VPNConfig-C-1CcRiV.js"),[]),meta:{requiresPki:!0}},{path:"/server",name:"ServerManagement",component:()=>Ln(()=>import("./ServerManagement-Bi2HPYWE.js"),__vite__mapDeps([9,7,5]))},{path:"/backup",name:"BackupRestore",component:()=>Ln(()=>import("./BackupRestore-DWeGKaYC.js"),__vite__mapDeps([10,3,7,5]))},{path:"/account",name:"Account",component:()=>Ln(()=>import("./Account-DxXUov-q.js"),__vite__mapDeps([11,7,5]))},{path:"/login",name:"Login",component:ww,meta:{public:!0}},{path:"/:pathMatch(.*)*",redirect:"/"}],eh=Sv({history:sv(),routes:Ew});eh.beforeEach(async(e,t,n)=>{const s=!!localStorage.getItem("ovpmon_token");if(!e.meta.public&&!s)n({name:"Login"});else if(e.name==="Login"&&s)n({name:"Analytics"});else if(e.meta.requiresPki){const{status:r,refresh:o}=Yd();await o()&&!r.pki_ready?(Gl().show("Initialize PKI before configuring the server","warning"),n({name:"PKIConfig"})):n()}else n()});var _i={exports:{}};var Aw=_i.exports,zu;function Cw(){return zu||(zu=1,(function(e,t){(function(n,s){e.exports=s()})(Aw,function(){const n=new Map,s={set(f,i,a){n.has(f)||n.set(f,new Map);const p=n.get(f);p.has(i)||p.size===0?p.set(i,a):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(p.keys())[0]}.`)},get:(f,i)=>n.has(f)&&n.get(f).get(i)||null,remove(f,i){if(!n.has(f))return;const a=n.get(f);a.delete(i),a.size===0&&n.delete(f)}},r="transitionend",o=f=>(f&&window.CSS&&window.CSS.escape&&(f=f.replace(/#([^\s"#']+)/g,(i,a)=>`#${CSS.escape(a)}`)),f),l=f=>f==null?`${f}`:Object.prototype.toString.call(f).match(/\s([a-z]+)/i)[1].toLowerCase(),c=f=>{f.dispatchEvent(new Event(r))},u=f=>!(!f||typeof f!="object")&&(f.jquery!==void 0&&(f=f[0]),f.nodeType!==void 0),h=f=>u(f)?f.jquery?f[0]:f:typeof f=="string"&&f.length>0?document.querySelector(o(f)):null,d=f=>{if(!u(f)||f.getClientRects().length===0)return!1;const i=getComputedStyle(f).getPropertyValue("visibility")==="visible",a=f.closest("details:not([open])");if(!a)return i;if(a!==f){const p=f.closest("summary");if(p&&p.parentNode!==a||p===null)return!1}return i},m=f=>!f||f.nodeType!==Node.ELEMENT_NODE||!!f.classList.contains("disabled")||(f.disabled!==void 0?f.disabled:f.hasAttribute("disabled")&&f.getAttribute("disabled")!=="false"),_=f=>{if(!document.documentElement.attachShadow)return null;if(typeof f.getRootNode=="function"){const i=f.getRootNode();return i instanceof ShadowRoot?i:null}return f instanceof ShadowRoot?f:f.parentNode?_(f.parentNode):null},y=()=>{},w=f=>{f.offsetHeight},S=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,x=[],D=()=>document.documentElement.dir==="rtl",F=f=>{var i;i=()=>{const a=S();if(a){const p=f.NAME,v=a.fn[p];a.fn[p]=f.jQueryInterface,a.fn[p].Constructor=f,a.fn[p].noConflict=()=>(a.fn[p]=v,f.jQueryInterface)}},document.readyState==="loading"?(x.length||document.addEventListener("DOMContentLoaded",()=>{for(const a of x)a()}),x.push(i)):i()},$=(f,i=[],a=f)=>typeof f=="function"?f.call(...i):a,H=(f,i,a=!0)=>{if(!a)return void $(f);const p=(T=>{if(!T)return 0;let{transitionDuration:L,transitionDelay:V}=window.getComputedStyle(T);const Y=Number.parseFloat(L),Q=Number.parseFloat(V);return Y||Q?(L=L.split(",")[0],V=V.split(",")[0],1e3*(Number.parseFloat(L)+Number.parseFloat(V))):0})(i)+5;let v=!1;const E=({target:T})=>{T===i&&(v=!0,i.removeEventListener(r,E),$(f))};i.addEventListener(r,E),setTimeout(()=>{v||c(i)},p)},te=(f,i,a,p)=>{const v=f.length;let E=f.indexOf(i);return E===-1?!a&&p?f[v-1]:f[0]:(E+=a?1:-1,p&&(E=(E+v)%v),f[Math.max(0,Math.min(E,v-1))])},le=/[^.]*(?=\..*)\.|.*/,Z=/\..*/,B=/::\d+$/,z={};let fe=1;const _e={mouseenter:"mouseover",mouseleave:"mouseout"},G=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function ye(f,i){return i&&`${i}::${fe++}`||f.uidEvent||fe++}function Pe(f){const i=ye(f);return f.uidEvent=i,z[i]=z[i]||{},z[i]}function Ye(f,i,a=null){return Object.values(f).find(p=>p.callable===i&&p.delegationSelector===a)}function Ee(f,i,a){const p=typeof i=="string",v=p?a:i||a;let E=Rt(f);return G.has(E)||(E=f),[p,v,E]}function Ce(f,i,a,p,v){if(typeof i!="string"||!f)return;let[E,T,L]=Ee(i,a,p);i in _e&&(T=(ce=>function(ae){if(!ae.relatedTarget||ae.relatedTarget!==ae.delegateTarget&&!ae.delegateTarget.contains(ae.relatedTarget))return ce.call(this,ae)})(T));const V=Pe(f),Y=V[L]||(V[L]={}),Q=Ye(Y,T,E?a:null);if(Q)return void(Q.oneOff=Q.oneOff&&v);const K=ye(T,i.replace(le,"")),ge=E?(function(oe,ce,ae){return function ue(Le){const je=oe.querySelectorAll(ce);for(let{target:ve}=Le;ve&&ve!==this;ve=ve.parentNode)for(const Te of je)if(Te===ve)return He(Le,{delegateTarget:ve}),ue.oneOff&&P.off(oe,Le.type,ce,ae),ae.apply(ve,[Le])}})(f,a,T):(function(oe,ce){return function ae(ue){return He(ue,{delegateTarget:oe}),ae.oneOff&&P.off(oe,ue.type,ce),ce.apply(oe,[ue])}})(f,T);ge.delegationSelector=E?a:null,ge.callable=T,ge.oneOff=v,ge.uidEvent=K,Y[K]=ge,f.addEventListener(L,ge,E)}function de(f,i,a,p,v){const E=Ye(i[a],p,v);E&&(f.removeEventListener(a,E,!!v),delete i[a][E.uidEvent])}function Ct(f,i,a,p){const v=i[a]||{};for(const[E,T]of Object.entries(v))E.includes(p)&&de(f,i,a,T.callable,T.delegationSelector)}function Rt(f){return f=f.replace(Z,""),_e[f]||f}const P={on(f,i,a,p){Ce(f,i,a,p,!1)},one(f,i,a,p){Ce(f,i,a,p,!0)},off(f,i,a,p){if(typeof i!="string"||!f)return;const[v,E,T]=Ee(i,a,p),L=T!==i,V=Pe(f),Y=V[T]||{},Q=i.startsWith(".");if(E===void 0){if(Q)for(const K of Object.keys(V))Ct(f,V,K,i.slice(1));for(const[K,ge]of Object.entries(Y)){const oe=K.replace(B,"");L&&!i.includes(oe)||de(f,V,T,ge.callable,ge.delegationSelector)}}else{if(!Object.keys(Y).length)return;de(f,V,T,E,v?a:null)}},trigger(f,i,a){if(typeof i!="string"||!f)return null;const p=S();let v=null,E=!0,T=!0,L=!1;i!==Rt(i)&&p&&(v=p.Event(i,a),p(f).trigger(v),E=!v.isPropagationStopped(),T=!v.isImmediatePropagationStopped(),L=v.isDefaultPrevented());const V=He(new Event(i,{bubbles:E,cancelable:!0}),a);return L&&V.preventDefault(),T&&f.dispatchEvent(V),V.defaultPrevented&&v&&v.preventDefault(),V}};function He(f,i={}){for(const[a,p]of Object.entries(i))try{f[a]=p}catch{Object.defineProperty(f,a,{configurable:!0,get:()=>p})}return f}function Pt(f){if(f==="true")return!0;if(f==="false")return!1;if(f===Number(f).toString())return Number(f);if(f===""||f==="null")return null;if(typeof f!="string")return f;try{return JSON.parse(decodeURIComponent(f))}catch{return f}}function ht(f){return f.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}const Je={setDataAttribute(f,i,a){f.setAttribute(`data-bs-${ht(i)}`,a)},removeDataAttribute(f,i){f.removeAttribute(`data-bs-${ht(i)}`)},getDataAttributes(f){if(!f)return{};const i={},a=Object.keys(f.dataset).filter(p=>p.startsWith("bs")&&!p.startsWith("bsConfig"));for(const p of a){let v=p.replace(/^bs/,"");v=v.charAt(0).toLowerCase()+v.slice(1),i[v]=Pt(f.dataset[p])}return i},getDataAttribute:(f,i)=>Pt(f.getAttribute(`data-bs-${ht(i)}`))};class et{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(i){return i=this._mergeConfigObj(i),i=this._configAfterMerge(i),this._typeCheckConfig(i),i}_configAfterMerge(i){return i}_mergeConfigObj(i,a){const p=u(a)?Je.getDataAttribute(a,"config"):{};return{...this.constructor.Default,...typeof p=="object"?p:{},...u(a)?Je.getDataAttributes(a):{},...typeof i=="object"?i:{}}}_typeCheckConfig(i,a=this.constructor.DefaultType){for(const[p,v]of Object.entries(a)){const E=i[p],T=u(E)?"element":l(E);if(!new RegExp(v).test(T))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${p}" provided type "${T}" but expected type "${v}".`)}}}class R extends et{constructor(i,a){super(),(i=h(i))&&(this._element=i,this._config=this._getConfig(a),s.set(this._element,this.constructor.DATA_KEY,this))}dispose(){s.remove(this._element,this.constructor.DATA_KEY),P.off(this._element,this.constructor.EVENT_KEY);for(const i of Object.getOwnPropertyNames(this))this[i]=null}_queueCallback(i,a,p=!0){H(i,a,p)}_getConfig(i){return i=this._mergeConfigObj(i,this._element),i=this._configAfterMerge(i),this._typeCheckConfig(i),i}static getInstance(i){return s.get(h(i),this.DATA_KEY)}static getOrCreateInstance(i,a={}){return this.getInstance(i)||new this(i,typeof a=="object"?a:null)}static get VERSION(){return"5.3.8"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(i){return`${i}${this.EVENT_KEY}`}}const X=f=>{let i=f.getAttribute("data-bs-target");if(!i||i==="#"){let a=f.getAttribute("href");if(!a||!a.includes("#")&&!a.startsWith("."))return null;a.includes("#")&&!a.startsWith("#")&&(a=`#${a.split("#")[1]}`),i=a&&a!=="#"?a.trim():null}return i?i.split(",").map(a=>o(a)).join(","):null},O={find:(f,i=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(i,f)),findOne:(f,i=document.documentElement)=>Element.prototype.querySelector.call(i,f),children:(f,i)=>[].concat(...f.children).filter(a=>a.matches(i)),parents(f,i){const a=[];let p=f.parentNode.closest(i);for(;p;)a.push(p),p=p.parentNode.closest(i);return a},prev(f,i){let a=f.previousElementSibling;for(;a;){if(a.matches(i))return[a];a=a.previousElementSibling}return[]},next(f,i){let a=f.nextElementSibling;for(;a;){if(a.matches(i))return[a];a=a.nextElementSibling}return[]},focusableChildren(f){const i=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(a=>`${a}:not([tabindex^="-"])`).join(",");return this.find(i,f).filter(a=>!m(a)&&d(a))},getSelectorFromElement(f){const i=X(f);return i&&O.findOne(i)?i:null},getElementFromSelector(f){const i=X(f);return i?O.findOne(i):null},getMultipleElementsFromSelector(f){const i=X(f);return i?O.find(i):[]}},ee=(f,i="hide")=>{const a=`click.dismiss${f.EVENT_KEY}`,p=f.NAME;P.on(document,a,`[data-bs-dismiss="${p}"]`,function(v){if(["A","AREA"].includes(this.tagName)&&v.preventDefault(),m(this))return;const E=O.getElementFromSelector(this)||this.closest(`.${p}`);f.getOrCreateInstance(E)[i]()})},we=".bs.alert",g=`close${we}`,b=`closed${we}`;class A extends R{static get NAME(){return"alert"}close(){if(P.trigger(this._element,g).defaultPrevented)return;this._element.classList.remove("show");const i=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,i)}_destroyElement(){this._element.remove(),P.trigger(this._element,b),this.dispose()}static jQueryInterface(i){return this.each(function(){const a=A.getOrCreateInstance(this);if(typeof i=="string"){if(a[i]===void 0||i.startsWith("_")||i==="constructor")throw new TypeError(`No method named "${i}"`);a[i](this)}})}}ee(A,"close"),F(A);const I='[data-bs-toggle="button"]';class k extends R{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(i){return this.each(function(){const a=k.getOrCreateInstance(this);i==="toggle"&&a[i]()})}}P.on(document,"click.bs.button.data-api",I,f=>{f.preventDefault();const i=f.target.closest(I);k.getOrCreateInstance(i).toggle()}),F(k);const N=".bs.swipe",W=`touchstart${N}`,q=`touchmove${N}`,U=`touchend${N}`,M=`pointerdown${N}`,se=`pointerup${N}`,J={endCallback:null,leftCallback:null,rightCallback:null},ne={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ie extends et{constructor(i,a){super(),this._element=i,i&&ie.isSupported()&&(this._config=this._getConfig(a),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return J}static get DefaultType(){return ne}static get NAME(){return"swipe"}dispose(){P.off(this._element,N)}_start(i){this._supportPointerEvents?this._eventIsPointerPenTouch(i)&&(this._deltaX=i.clientX):this._deltaX=i.touches[0].clientX}_end(i){this._eventIsPointerPenTouch(i)&&(this._deltaX=i.clientX-this._deltaX),this._handleSwipe(),$(this._config.endCallback)}_move(i){this._deltaX=i.touches&&i.touches.length>1?0:i.touches[0].clientX-this._deltaX}_handleSwipe(){const i=Math.abs(this._deltaX);if(i<=40)return;const a=i/this._deltaX;this._deltaX=0,a&&$(a>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(P.on(this._element,M,i=>this._start(i)),P.on(this._element,se,i=>this._end(i)),this._element.classList.add("pointer-event")):(P.on(this._element,W,i=>this._start(i)),P.on(this._element,q,i=>this._move(i)),P.on(this._element,U,i=>this._end(i)))}_eventIsPointerPenTouch(i){return this._supportPointerEvents&&(i.pointerType==="pen"||i.pointerType==="touch")}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const he=".bs.carousel",Ne=".data-api",Se="ArrowLeft",at="ArrowRight",Xe="next",st="prev",rt="left",tn="right",Dr=`slide${he}`,it=`slid${he}`,Mt=`keydown${he}`,Mr=`mouseenter${he}`,Fr=`mouseleave${he}`,nh=`dragstart${he}`,sh=`load${he}${Ne}`,rh=`click${he}${Ne}`,Xl="carousel",$r="active",Yl=".active",Ql=".carousel-item",ih=Yl+Ql,oh={[Se]:tn,[at]:rt},lh={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},ah={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class _s extends R{constructor(i,a){super(i,a),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=O.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===Xl&&this.cycle()}static get Default(){return lh}static get DefaultType(){return ah}static get NAME(){return"carousel"}next(){this._slide(Xe)}nextWhenVisible(){!document.hidden&&d(this._element)&&this.next()}prev(){this._slide(st)}pause(){this._isSliding&&c(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?P.one(this._element,it,()=>this.cycle()):this.cycle())}to(i){const a=this._getItems();if(i>a.length-1||i<0)return;if(this._isSliding)return void P.one(this._element,it,()=>this.to(i));const p=this._getItemIndex(this._getActive());if(p===i)return;const v=i>p?Xe:st;this._slide(v,a[i])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(i){return i.defaultInterval=i.interval,i}_addEventListeners(){this._config.keyboard&&P.on(this._element,Mt,i=>this._keydown(i)),this._config.pause==="hover"&&(P.on(this._element,Mr,()=>this.pause()),P.on(this._element,Fr,()=>this._maybeEnableCycle())),this._config.touch&&ie.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const a of O.find(".carousel-item img",this._element))P.on(a,nh,p=>p.preventDefault());const i={leftCallback:()=>this._slide(this._directionToOrder(rt)),rightCallback:()=>this._slide(this._directionToOrder(tn)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new ie(this._element,i)}_keydown(i){if(/input|textarea/i.test(i.target.tagName))return;const a=oh[i.key];a&&(i.preventDefault(),this._slide(this._directionToOrder(a)))}_getItemIndex(i){return this._getItems().indexOf(i)}_setActiveIndicatorElement(i){if(!this._indicatorsElement)return;const a=O.findOne(Yl,this._indicatorsElement);a.classList.remove($r),a.removeAttribute("aria-current");const p=O.findOne(`[data-bs-slide-to="${i}"]`,this._indicatorsElement);p&&(p.classList.add($r),p.setAttribute("aria-current","true"))}_updateInterval(){const i=this._activeElement||this._getActive();if(!i)return;const a=Number.parseInt(i.getAttribute("data-bs-interval"),10);this._config.interval=a||this._config.defaultInterval}_slide(i,a=null){if(this._isSliding)return;const p=this._getActive(),v=i===Xe,E=a||te(this._getItems(),p,v,this._config.wrap);if(E===p)return;const T=this._getItemIndex(E),L=K=>P.trigger(this._element,K,{relatedTarget:E,direction:this._orderToDirection(i),from:this._getItemIndex(p),to:T});if(L(Dr).defaultPrevented||!p||!E)return;const V=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(T),this._activeElement=E;const Y=v?"carousel-item-start":"carousel-item-end",Q=v?"carousel-item-next":"carousel-item-prev";E.classList.add(Q),w(E),p.classList.add(Y),E.classList.add(Y),this._queueCallback(()=>{E.classList.remove(Y,Q),E.classList.add($r),p.classList.remove($r,Q,Y),this._isSliding=!1,L(it)},p,this._isAnimated()),V&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return O.findOne(ih,this._element)}_getItems(){return O.find(Ql,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(i){return D()?i===rt?st:Xe:i===rt?Xe:st}_orderToDirection(i){return D()?i===st?rt:tn:i===st?tn:rt}static jQueryInterface(i){return this.each(function(){const a=_s.getOrCreateInstance(this,i);if(typeof i!="number"){if(typeof i=="string"){if(a[i]===void 0||i.startsWith("_")||i==="constructor")throw new TypeError(`No method named "${i}"`);a[i]()}}else a.to(i)})}}P.on(document,rh,"[data-bs-slide], [data-bs-slide-to]",function(f){const i=O.getElementFromSelector(this);if(!i||!i.classList.contains(Xl))return;f.preventDefault();const a=_s.getOrCreateInstance(i),p=this.getAttribute("data-bs-slide-to");return p?(a.to(p),void a._maybeEnableCycle()):Je.getDataAttribute(this,"slide")==="next"?(a.next(),void a._maybeEnableCycle()):(a.prev(),void a._maybeEnableCycle())}),P.on(window,sh,()=>{const f=O.find('[data-bs-ride="carousel"]');for(const i of f)_s.getOrCreateInstance(i)}),F(_s);const Gs=".bs.collapse",ch=`show${Gs}`,uh=`shown${Gs}`,fh=`hide${Gs}`,dh=`hidden${Gs}`,hh=`click${Gs}.data-api`,zi="show",bs="collapse",jr="collapsing",ph=`:scope .${bs} .${bs}`,Gi='[data-bs-toggle="collapse"]',mh={parent:null,toggle:!0},gh={parent:"(null|element)",toggle:"boolean"};class ys extends R{constructor(i,a){super(i,a),this._isTransitioning=!1,this._triggerArray=[];const p=O.find(Gi);for(const v of p){const E=O.getSelectorFromElement(v),T=O.find(E).filter(L=>L===this._element);E!==null&&T.length&&this._triggerArray.push(v)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return mh}static get DefaultType(){return gh}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let i=[];if(this._config.parent&&(i=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(v=>v!==this._element).map(v=>ys.getOrCreateInstance(v,{toggle:!1}))),i.length&&i[0]._isTransitioning||P.trigger(this._element,ch).defaultPrevented)return;for(const v of i)v.hide();const a=this._getDimension();this._element.classList.remove(bs),this._element.classList.add(jr),this._element.style[a]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const p=`scroll${a[0].toUpperCase()+a.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(jr),this._element.classList.add(bs,zi),this._element.style[a]="",P.trigger(this._element,uh)},this._element,!0),this._element.style[a]=`${this._element[p]}px`}hide(){if(this._isTransitioning||!this._isShown()||P.trigger(this._element,fh).defaultPrevented)return;const i=this._getDimension();this._element.style[i]=`${this._element.getBoundingClientRect()[i]}px`,w(this._element),this._element.classList.add(jr),this._element.classList.remove(bs,zi);for(const a of this._triggerArray){const p=O.getElementFromSelector(a);p&&!this._isShown(p)&&this._addAriaAndCollapsedClass([a],!1)}this._isTransitioning=!0,this._element.style[i]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(jr),this._element.classList.add(bs),P.trigger(this._element,dh)},this._element,!0)}_isShown(i=this._element){return i.classList.contains(zi)}_configAfterMerge(i){return i.toggle=!!i.toggle,i.parent=h(i.parent),i}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const i=this._getFirstLevelChildren(Gi);for(const a of i){const p=O.getElementFromSelector(a);p&&this._addAriaAndCollapsedClass([a],this._isShown(p))}}_getFirstLevelChildren(i){const a=O.find(ph,this._config.parent);return O.find(i,this._config.parent).filter(p=>!a.includes(p))}_addAriaAndCollapsedClass(i,a){if(i.length)for(const p of i)p.classList.toggle("collapsed",!a),p.setAttribute("aria-expanded",a)}static jQueryInterface(i){const a={};return typeof i=="string"&&/show|hide/.test(i)&&(a.toggle=!1),this.each(function(){const p=ys.getOrCreateInstance(this,a);if(typeof i=="string"){if(p[i]===void 0)throw new TypeError(`No method named "${i}"`);p[i]()}})}}P.on(document,hh,Gi,function(f){(f.target.tagName==="A"||f.delegateTarget&&f.delegateTarget.tagName==="A")&&f.preventDefault();for(const i of O.getMultipleElementsFromSelector(this))ys.getOrCreateInstance(i,{toggle:!1}).toggle()}),F(ys);var pt="top",Nt="bottom",It="right",mt="left",Br="auto",vs=[pt,Nt,It,mt],Wn="start",ws="end",Zl="clippingParents",Ji="viewport",Es="popper",ea="reference",Xi=vs.reduce(function(f,i){return f.concat([i+"-"+Wn,i+"-"+ws])},[]),Yi=[].concat(vs,[Br]).reduce(function(f,i){return f.concat([i,i+"-"+Wn,i+"-"+ws])},[]),ta="beforeRead",na="read",sa="afterRead",ra="beforeMain",ia="main",oa="afterMain",la="beforeWrite",aa="write",ca="afterWrite",ua=[ta,na,sa,ra,ia,oa,la,aa,ca];function nn(f){return f?(f.nodeName||"").toLowerCase():null}function kt(f){if(f==null)return window;if(f.toString()!=="[object Window]"){var i=f.ownerDocument;return i&&i.defaultView||window}return f}function Kn(f){return f instanceof kt(f).Element||f instanceof Element}function Ft(f){return f instanceof kt(f).HTMLElement||f instanceof HTMLElement}function Qi(f){return typeof ShadowRoot<"u"&&(f instanceof kt(f).ShadowRoot||f instanceof ShadowRoot)}const Zi={name:"applyStyles",enabled:!0,phase:"write",fn:function(f){var i=f.state;Object.keys(i.elements).forEach(function(a){var p=i.styles[a]||{},v=i.attributes[a]||{},E=i.elements[a];Ft(E)&&nn(E)&&(Object.assign(E.style,p),Object.keys(v).forEach(function(T){var L=v[T];L===!1?E.removeAttribute(T):E.setAttribute(T,L===!0?"":L)}))})},effect:function(f){var i=f.state,a={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(i.elements.popper.style,a.popper),i.styles=a,i.elements.arrow&&Object.assign(i.elements.arrow.style,a.arrow),function(){Object.keys(i.elements).forEach(function(p){var v=i.elements[p],E=i.attributes[p]||{},T=Object.keys(i.styles.hasOwnProperty(p)?i.styles[p]:a[p]).reduce(function(L,V){return L[V]="",L},{});Ft(v)&&nn(v)&&(Object.assign(v.style,T),Object.keys(E).forEach(function(L){v.removeAttribute(L)}))})}},requires:["computeStyles"]};function sn(f){return f.split("-")[0]}var zn=Math.max,Hr=Math.min,As=Math.round;function eo(){var f=navigator.userAgentData;return f!=null&&f.brands&&Array.isArray(f.brands)?f.brands.map(function(i){return i.brand+"/"+i.version}).join(" "):navigator.userAgent}function fa(){return!/^((?!chrome|android).)*safari/i.test(eo())}function Cs(f,i,a){i===void 0&&(i=!1),a===void 0&&(a=!1);var p=f.getBoundingClientRect(),v=1,E=1;i&&Ft(f)&&(v=f.offsetWidth>0&&As(p.width)/f.offsetWidth||1,E=f.offsetHeight>0&&As(p.height)/f.offsetHeight||1);var T=(Kn(f)?kt(f):window).visualViewport,L=!fa()&&a,V=(p.left+(L&&T?T.offsetLeft:0))/v,Y=(p.top+(L&&T?T.offsetTop:0))/E,Q=p.width/v,K=p.height/E;return{width:Q,height:K,top:Y,right:V+Q,bottom:Y+K,left:V,x:V,y:Y}}function to(f){var i=Cs(f),a=f.offsetWidth,p=f.offsetHeight;return Math.abs(i.width-a)<=1&&(a=i.width),Math.abs(i.height-p)<=1&&(p=i.height),{x:f.offsetLeft,y:f.offsetTop,width:a,height:p}}function da(f,i){var a=i.getRootNode&&i.getRootNode();if(f.contains(i))return!0;if(a&&Qi(a)){var p=i;do{if(p&&f.isSameNode(p))return!0;p=p.parentNode||p.host}while(p)}return!1}function mn(f){return kt(f).getComputedStyle(f)}function _h(f){return["table","td","th"].indexOf(nn(f))>=0}function Rn(f){return((Kn(f)?f.ownerDocument:f.document)||window.document).documentElement}function Ur(f){return nn(f)==="html"?f:f.assignedSlot||f.parentNode||(Qi(f)?f.host:null)||Rn(f)}function ha(f){return Ft(f)&&mn(f).position!=="fixed"?f.offsetParent:null}function Js(f){for(var i=kt(f),a=ha(f);a&&_h(a)&&mn(a).position==="static";)a=ha(a);return a&&(nn(a)==="html"||nn(a)==="body"&&mn(a).position==="static")?i:a||(function(p){var v=/firefox/i.test(eo());if(/Trident/i.test(eo())&&Ft(p)&&mn(p).position==="fixed")return null;var E=Ur(p);for(Qi(E)&&(E=E.host);Ft(E)&&["html","body"].indexOf(nn(E))<0;){var T=mn(E);if(T.transform!=="none"||T.perspective!=="none"||T.contain==="paint"||["transform","perspective"].indexOf(T.willChange)!==-1||v&&T.willChange==="filter"||v&&T.filter&&T.filter!=="none")return E;E=E.parentNode}return null})(f)||i}function no(f){return["top","bottom"].indexOf(f)>=0?"x":"y"}function Xs(f,i,a){return zn(f,Hr(i,a))}function pa(f){return Object.assign({},{top:0,right:0,bottom:0,left:0},f)}function ma(f,i){return i.reduce(function(a,p){return a[p]=f,a},{})}const ga={name:"arrow",enabled:!0,phase:"main",fn:function(f){var i,a=f.state,p=f.name,v=f.options,E=a.elements.arrow,T=a.modifiersData.popperOffsets,L=sn(a.placement),V=no(L),Y=[mt,It].indexOf(L)>=0?"height":"width";if(E&&T){var Q=(function(De,ke){return pa(typeof(De=typeof De=="function"?De(Object.assign({},ke.rects,{placement:ke.placement})):De)!="number"?De:ma(De,vs))})(v.padding,a),K=to(E),ge=V==="y"?pt:mt,oe=V==="y"?Nt:It,ce=a.rects.reference[Y]+a.rects.reference[V]-T[V]-a.rects.popper[Y],ae=T[V]-a.rects.reference[V],ue=Js(E),Le=ue?V==="y"?ue.clientHeight||0:ue.clientWidth||0:0,je=ce/2-ae/2,ve=Q[ge],Te=Le-K[Y]-Q[oe],be=Le/2-K[Y]/2+je,Ae=Xs(ve,be,Te),Ie=V;a.modifiersData[p]=((i={})[Ie]=Ae,i.centerOffset=Ae-be,i)}},effect:function(f){var i=f.state,a=f.options.element,p=a===void 0?"[data-popper-arrow]":a;p!=null&&(typeof p!="string"||(p=i.elements.popper.querySelector(p)))&&da(i.elements.popper,p)&&(i.elements.arrow=p)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ss(f){return f.split("-")[1]}var bh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function _a(f){var i,a=f.popper,p=f.popperRect,v=f.placement,E=f.variation,T=f.offsets,L=f.position,V=f.gpuAcceleration,Y=f.adaptive,Q=f.roundOffsets,K=f.isFixed,ge=T.x,oe=ge===void 0?0:ge,ce=T.y,ae=ce===void 0?0:ce,ue=typeof Q=="function"?Q({x:oe,y:ae}):{x:oe,y:ae};oe=ue.x,ae=ue.y;var Le=T.hasOwnProperty("x"),je=T.hasOwnProperty("y"),ve=mt,Te=pt,be=window;if(Y){var Ae=Js(a),Ie="clientHeight",De="clientWidth";Ae===kt(a)&&mn(Ae=Rn(a)).position!=="static"&&L==="absolute"&&(Ie="scrollHeight",De="scrollWidth"),(v===pt||(v===mt||v===It)&&E===ws)&&(Te=Nt,ae-=(K&&Ae===be&&be.visualViewport?be.visualViewport.height:Ae[Ie])-p.height,ae*=V?1:-1),v!==mt&&(v!==pt&&v!==Nt||E!==ws)||(ve=It,oe-=(K&&Ae===be&&be.visualViewport?be.visualViewport.width:Ae[De])-p.width,oe*=V?1:-1)}var ke,Ge=Object.assign({position:L},Y&&bh),Lt=Q===!0?(function(zt,gt){var jt=zt.x,Bt=zt.y,We=gt.devicePixelRatio||1;return{x:As(jt*We)/We||0,y:As(Bt*We)/We||0}})({x:oe,y:ae},kt(a)):{x:oe,y:ae};return oe=Lt.x,ae=Lt.y,V?Object.assign({},Ge,((ke={})[Te]=je?"0":"",ke[ve]=Le?"0":"",ke.transform=(be.devicePixelRatio||1)<=1?"translate("+oe+"px, "+ae+"px)":"translate3d("+oe+"px, "+ae+"px, 0)",ke)):Object.assign({},Ge,((i={})[Te]=je?ae+"px":"",i[ve]=Le?oe+"px":"",i.transform="",i))}const so={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(f){var i=f.state,a=f.options,p=a.gpuAcceleration,v=p===void 0||p,E=a.adaptive,T=E===void 0||E,L=a.roundOffsets,V=L===void 0||L,Y={placement:sn(i.placement),variation:Ss(i.placement),popper:i.elements.popper,popperRect:i.rects.popper,gpuAcceleration:v,isFixed:i.options.strategy==="fixed"};i.modifiersData.popperOffsets!=null&&(i.styles.popper=Object.assign({},i.styles.popper,_a(Object.assign({},Y,{offsets:i.modifiersData.popperOffsets,position:i.options.strategy,adaptive:T,roundOffsets:V})))),i.modifiersData.arrow!=null&&(i.styles.arrow=Object.assign({},i.styles.arrow,_a(Object.assign({},Y,{offsets:i.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:V})))),i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-placement":i.placement})},data:{}};var Vr={passive:!0};const ro={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(f){var i=f.state,a=f.instance,p=f.options,v=p.scroll,E=v===void 0||v,T=p.resize,L=T===void 0||T,V=kt(i.elements.popper),Y=[].concat(i.scrollParents.reference,i.scrollParents.popper);return E&&Y.forEach(function(Q){Q.addEventListener("scroll",a.update,Vr)}),L&&V.addEventListener("resize",a.update,Vr),function(){E&&Y.forEach(function(Q){Q.removeEventListener("scroll",a.update,Vr)}),L&&V.removeEventListener("resize",a.update,Vr)}},data:{}};var yh={left:"right",right:"left",bottom:"top",top:"bottom"};function qr(f){return f.replace(/left|right|bottom|top/g,function(i){return yh[i]})}var vh={start:"end",end:"start"};function ba(f){return f.replace(/start|end/g,function(i){return vh[i]})}function io(f){var i=kt(f);return{scrollLeft:i.pageXOffset,scrollTop:i.pageYOffset}}function oo(f){return Cs(Rn(f)).left+io(f).scrollLeft}function lo(f){var i=mn(f),a=i.overflow,p=i.overflowX,v=i.overflowY;return/auto|scroll|overlay|hidden/.test(a+v+p)}function ya(f){return["html","body","#document"].indexOf(nn(f))>=0?f.ownerDocument.body:Ft(f)&&lo(f)?f:ya(Ur(f))}function Ys(f,i){var a;i===void 0&&(i=[]);var p=ya(f),v=p===((a=f.ownerDocument)==null?void 0:a.body),E=kt(p),T=v?[E].concat(E.visualViewport||[],lo(p)?p:[]):p,L=i.concat(T);return v?L:L.concat(Ys(Ur(T)))}function ao(f){return Object.assign({},f,{left:f.x,top:f.y,right:f.x+f.width,bottom:f.y+f.height})}function va(f,i,a){return i===Ji?ao((function(p,v){var E=kt(p),T=Rn(p),L=E.visualViewport,V=T.clientWidth,Y=T.clientHeight,Q=0,K=0;if(L){V=L.width,Y=L.height;var ge=fa();(ge||!ge&&v==="fixed")&&(Q=L.offsetLeft,K=L.offsetTop)}return{width:V,height:Y,x:Q+oo(p),y:K}})(f,a)):Kn(i)?(function(p,v){var E=Cs(p,!1,v==="fixed");return E.top=E.top+p.clientTop,E.left=E.left+p.clientLeft,E.bottom=E.top+p.clientHeight,E.right=E.left+p.clientWidth,E.width=p.clientWidth,E.height=p.clientHeight,E.x=E.left,E.y=E.top,E})(i,a):ao((function(p){var v,E=Rn(p),T=io(p),L=(v=p.ownerDocument)==null?void 0:v.body,V=zn(E.scrollWidth,E.clientWidth,L?L.scrollWidth:0,L?L.clientWidth:0),Y=zn(E.scrollHeight,E.clientHeight,L?L.scrollHeight:0,L?L.clientHeight:0),Q=-T.scrollLeft+oo(p),K=-T.scrollTop;return mn(L||E).direction==="rtl"&&(Q+=zn(E.clientWidth,L?L.clientWidth:0)-V),{width:V,height:Y,x:Q,y:K}})(Rn(f)))}function wa(f){var i,a=f.reference,p=f.element,v=f.placement,E=v?sn(v):null,T=v?Ss(v):null,L=a.x+a.width/2-p.width/2,V=a.y+a.height/2-p.height/2;switch(E){case pt:i={x:L,y:a.y-p.height};break;case Nt:i={x:L,y:a.y+a.height};break;case It:i={x:a.x+a.width,y:V};break;case mt:i={x:a.x-p.width,y:V};break;default:i={x:a.x,y:a.y}}var Y=E?no(E):null;if(Y!=null){var Q=Y==="y"?"height":"width";switch(T){case Wn:i[Y]=i[Y]-(a[Q]/2-p[Q]/2);break;case ws:i[Y]=i[Y]+(a[Q]/2-p[Q]/2)}}return i}function Ts(f,i){i===void 0&&(i={});var a=i,p=a.placement,v=p===void 0?f.placement:p,E=a.strategy,T=E===void 0?f.strategy:E,L=a.boundary,V=L===void 0?Zl:L,Y=a.rootBoundary,Q=Y===void 0?Ji:Y,K=a.elementContext,ge=K===void 0?Es:K,oe=a.altBoundary,ce=oe!==void 0&&oe,ae=a.padding,ue=ae===void 0?0:ae,Le=pa(typeof ue!="number"?ue:ma(ue,vs)),je=ge===Es?ea:Es,ve=f.rects.popper,Te=f.elements[ce?je:ge],be=(function(gt,jt,Bt,We){var rn=jt==="clippingParents"?(function(Fe){var _t=Ys(Ur(Fe)),Ht=["absolute","fixed"].indexOf(mn(Fe).position)>=0&&Ft(Fe)?Js(Fe):Fe;return Kn(Ht)?_t.filter(function(Nn){return Kn(Nn)&&da(Nn,Ht)&&nn(Nn)!=="body"}):[]})(gt):[].concat(jt),on=[].concat(rn,[Bt]),Rs=on[0],tt=on.reduce(function(Fe,_t){var Ht=va(gt,_t,We);return Fe.top=zn(Ht.top,Fe.top),Fe.right=Hr(Ht.right,Fe.right),Fe.bottom=Hr(Ht.bottom,Fe.bottom),Fe.left=zn(Ht.left,Fe.left),Fe},va(gt,Rs,We));return tt.width=tt.right-tt.left,tt.height=tt.bottom-tt.top,tt.x=tt.left,tt.y=tt.top,tt})(Kn(Te)?Te:Te.contextElement||Rn(f.elements.popper),V,Q,T),Ae=Cs(f.elements.reference),Ie=wa({reference:Ae,element:ve,placement:v}),De=ao(Object.assign({},ve,Ie)),ke=ge===Es?De:Ae,Ge={top:be.top-ke.top+Le.top,bottom:ke.bottom-be.bottom+Le.bottom,left:be.left-ke.left+Le.left,right:ke.right-be.right+Le.right},Lt=f.modifiersData.offset;if(ge===Es&&Lt){var zt=Lt[v];Object.keys(Ge).forEach(function(gt){var jt=[It,Nt].indexOf(gt)>=0?1:-1,Bt=[pt,Nt].indexOf(gt)>=0?"y":"x";Ge[gt]+=zt[Bt]*jt})}return Ge}function wh(f,i){i===void 0&&(i={});var a=i,p=a.placement,v=a.boundary,E=a.rootBoundary,T=a.padding,L=a.flipVariations,V=a.allowedAutoPlacements,Y=V===void 0?Yi:V,Q=Ss(p),K=Q?L?Xi:Xi.filter(function(ce){return Ss(ce)===Q}):vs,ge=K.filter(function(ce){return Y.indexOf(ce)>=0});ge.length===0&&(ge=K);var oe=ge.reduce(function(ce,ae){return ce[ae]=Ts(f,{placement:ae,boundary:v,rootBoundary:E,padding:T})[sn(ae)],ce},{});return Object.keys(oe).sort(function(ce,ae){return oe[ce]-oe[ae]})}const Ea={name:"flip",enabled:!0,phase:"main",fn:function(f){var i=f.state,a=f.options,p=f.name;if(!i.modifiersData[p]._skip){for(var v=a.mainAxis,E=v===void 0||v,T=a.altAxis,L=T===void 0||T,V=a.fallbackPlacements,Y=a.padding,Q=a.boundary,K=a.rootBoundary,ge=a.altBoundary,oe=a.flipVariations,ce=oe===void 0||oe,ae=a.allowedAutoPlacements,ue=i.options.placement,Le=sn(ue),je=V||(Le!==ue&&ce?(function(Fe){if(sn(Fe)===Br)return[];var _t=qr(Fe);return[ba(Fe),_t,ba(_t)]})(ue):[qr(ue)]),ve=[ue].concat(je).reduce(function(Fe,_t){return Fe.concat(sn(_t)===Br?wh(i,{placement:_t,boundary:Q,rootBoundary:K,padding:Y,flipVariations:ce,allowedAutoPlacements:ae}):_t)},[]),Te=i.rects.reference,be=i.rects.popper,Ae=new Map,Ie=!0,De=ve[0],ke=0;ke=0,jt=gt?"width":"height",Bt=Ts(i,{placement:Ge,boundary:Q,rootBoundary:K,altBoundary:ge,padding:Y}),We=gt?zt?It:mt:zt?Nt:pt;Te[jt]>be[jt]&&(We=qr(We));var rn=qr(We),on=[];if(E&&on.push(Bt[Lt]<=0),L&&on.push(Bt[We]<=0,Bt[rn]<=0),on.every(function(Fe){return Fe})){De=Ge,Ie=!1;break}Ae.set(Ge,on)}if(Ie)for(var Rs=function(Fe){var _t=ve.find(function(Ht){var Nn=Ae.get(Ht);if(Nn)return Nn.slice(0,Fe).every(function(Zr){return Zr})});if(_t)return De=_t,"break"},tt=ce?3:1;tt>0&&Rs(tt)!=="break";tt--);i.placement!==De&&(i.modifiersData[p]._skip=!0,i.placement=De,i.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Aa(f,i,a){return a===void 0&&(a={x:0,y:0}),{top:f.top-i.height-a.y,right:f.right-i.width+a.x,bottom:f.bottom-i.height+a.y,left:f.left-i.width-a.x}}function Ca(f){return[pt,It,Nt,mt].some(function(i){return f[i]>=0})}const Sa={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(f){var i=f.state,a=f.name,p=i.rects.reference,v=i.rects.popper,E=i.modifiersData.preventOverflow,T=Ts(i,{elementContext:"reference"}),L=Ts(i,{altBoundary:!0}),V=Aa(T,p),Y=Aa(L,v,E),Q=Ca(V),K=Ca(Y);i.modifiersData[a]={referenceClippingOffsets:V,popperEscapeOffsets:Y,isReferenceHidden:Q,hasPopperEscaped:K},i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-reference-hidden":Q,"data-popper-escaped":K})}},Ta={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(f){var i=f.state,a=f.options,p=f.name,v=a.offset,E=v===void 0?[0,0]:v,T=Yi.reduce(function(Q,K){return Q[K]=(function(ge,oe,ce){var ae=sn(ge),ue=[mt,pt].indexOf(ae)>=0?-1:1,Le=typeof ce=="function"?ce(Object.assign({},oe,{placement:ge})):ce,je=Le[0],ve=Le[1];return je=je||0,ve=(ve||0)*ue,[mt,It].indexOf(ae)>=0?{x:ve,y:je}:{x:je,y:ve}})(K,i.rects,E),Q},{}),L=T[i.placement],V=L.x,Y=L.y;i.modifiersData.popperOffsets!=null&&(i.modifiersData.popperOffsets.x+=V,i.modifiersData.popperOffsets.y+=Y),i.modifiersData[p]=T}},co={name:"popperOffsets",enabled:!0,phase:"read",fn:function(f){var i=f.state,a=f.name;i.modifiersData[a]=wa({reference:i.rects.reference,element:i.rects.popper,placement:i.placement})},data:{}},xa={name:"preventOverflow",enabled:!0,phase:"main",fn:function(f){var i=f.state,a=f.options,p=f.name,v=a.mainAxis,E=v===void 0||v,T=a.altAxis,L=T!==void 0&&T,V=a.boundary,Y=a.rootBoundary,Q=a.altBoundary,K=a.padding,ge=a.tether,oe=ge===void 0||ge,ce=a.tetherOffset,ae=ce===void 0?0:ce,ue=Ts(i,{boundary:V,rootBoundary:Y,padding:K,altBoundary:Q}),Le=sn(i.placement),je=Ss(i.placement),ve=!je,Te=no(Le),be=Te==="x"?"y":"x",Ae=i.modifiersData.popperOffsets,Ie=i.rects.reference,De=i.rects.popper,ke=typeof ae=="function"?ae(Object.assign({},i.rects,{placement:i.placement})):ae,Ge=typeof ke=="number"?{mainAxis:ke,altAxis:ke}:Object.assign({mainAxis:0,altAxis:0},ke),Lt=i.modifiersData.offset?i.modifiersData.offset[i.placement]:null,zt={x:0,y:0};if(Ae){if(E){var gt,jt=Te==="y"?pt:mt,Bt=Te==="y"?Nt:It,We=Te==="y"?"height":"width",rn=Ae[Te],on=rn+ue[jt],Rs=rn-ue[Bt],tt=oe?-De[We]/2:0,Fe=je===Wn?Ie[We]:De[We],_t=je===Wn?-De[We]:-Ie[We],Ht=i.elements.arrow,Nn=oe&&Ht?to(Ht):{width:0,height:0},Zr=i.modifiersData["arrow#persistent"]?i.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},hc=Zr[jt],pc=Zr[Bt],ei=Xs(0,Ie[We],Nn[We]),Zp=ve?Ie[We]/2-tt-ei-hc-Ge.mainAxis:Fe-ei-hc-Ge.mainAxis,em=ve?-Ie[We]/2+tt+ei+pc+Ge.mainAxis:_t+ei+pc+Ge.mainAxis,Co=i.elements.arrow&&Js(i.elements.arrow),tm=Co?Te==="y"?Co.clientTop||0:Co.clientLeft||0:0,mc=(gt=Lt?.[Te])!=null?gt:0,nm=rn+em-mc,gc=Xs(oe?Hr(on,rn+Zp-mc-tm):on,rn,oe?zn(Rs,nm):Rs);Ae[Te]=gc,zt[Te]=gc-rn}if(L){var _c,sm=Te==="x"?pt:mt,rm=Te==="x"?Nt:It,ts=Ae[be],ti=be==="y"?"height":"width",bc=ts+ue[sm],yc=ts-ue[rm],So=[pt,mt].indexOf(Le)!==-1,vc=(_c=Lt?.[be])!=null?_c:0,wc=So?bc:ts-Ie[ti]-De[ti]-vc+Ge.altAxis,Ec=So?ts+Ie[ti]+De[ti]-vc-Ge.altAxis:yc,Ac=oe&&So?(function(im,om,To){var Cc=Xs(im,om,To);return Cc>To?To:Cc})(wc,ts,Ec):Xs(oe?wc:bc,ts,oe?Ec:yc);Ae[be]=Ac,zt[be]=Ac-ts}i.modifiersData[p]=zt}},requiresIfExists:["offset"]};function Eh(f,i,a){a===void 0&&(a=!1);var p,v,E=Ft(i),T=Ft(i)&&(function(K){var ge=K.getBoundingClientRect(),oe=As(ge.width)/K.offsetWidth||1,ce=As(ge.height)/K.offsetHeight||1;return oe!==1||ce!==1})(i),L=Rn(i),V=Cs(f,T,a),Y={scrollLeft:0,scrollTop:0},Q={x:0,y:0};return(E||!E&&!a)&&((nn(i)!=="body"||lo(L))&&(Y=(p=i)!==kt(p)&&Ft(p)?{scrollLeft:(v=p).scrollLeft,scrollTop:v.scrollTop}:io(p)),Ft(i)?((Q=Cs(i,!0)).x+=i.clientLeft,Q.y+=i.clientTop):L&&(Q.x=oo(L))),{x:V.left+Y.scrollLeft-Q.x,y:V.top+Y.scrollTop-Q.y,width:V.width,height:V.height}}function Ah(f){var i=new Map,a=new Set,p=[];function v(E){a.add(E.name),[].concat(E.requires||[],E.requiresIfExists||[]).forEach(function(T){if(!a.has(T)){var L=i.get(T);L&&v(L)}}),p.push(E)}return f.forEach(function(E){i.set(E.name,E)}),f.forEach(function(E){a.has(E.name)||v(E)}),p}var Oa={placement:"bottom",modifiers:[],strategy:"absolute"};function Ra(){for(var f=arguments.length,i=new Array(f),a=0;aNumber.parseInt(a,10)):typeof i=="function"?a=>i(a,this._element):i}_getPopperConfig(){const i={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(Je.setDataAttribute(this._menu,"popper","static"),i.modifiers=[{name:"applyStyles",enabled:!1}]),{...i,...$(this._config.popperConfig,[void 0,i])}}_selectMenuItem({key:i,target:a}){const p=O.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(v=>d(v));p.length&&te(p,a,i===Ia,!p.includes(a)).focus()}static jQueryInterface(i){return this.each(function(){const a=Kt.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0)throw new TypeError(`No method named "${i}"`);a[i]()}})}static clearMenus(i){if(i.button===2||i.type==="keyup"&&i.key!=="Tab")return;const a=O.find(Ih);for(const p of a){const v=Kt.getInstance(p);if(!v||v._config.autoClose===!1)continue;const E=i.composedPath(),T=E.includes(v._menu);if(E.includes(v._element)||v._config.autoClose==="inside"&&!T||v._config.autoClose==="outside"&&T||v._menu.contains(i.target)&&(i.type==="keyup"&&i.key==="Tab"||/input|select|option|textarea|form/i.test(i.target.tagName)))continue;const L={relatedTarget:v._element};i.type==="click"&&(L.clickEvent=i),v._completeHide(L)}}static dataApiKeydownHandler(i){const a=/input|textarea/i.test(i.target.tagName),p=i.key==="Escape",v=[Th,Ia].includes(i.key);if(!v&&!p||a&&!p)return;i.preventDefault();const E=this.matches(Jn)?this:O.prev(this,Jn)[0]||O.next(this,Jn)[0]||O.findOne(Jn,i.delegateTarget.parentNode),T=Kt.getOrCreateInstance(E);if(v)return i.stopPropagation(),T.show(),void T._selectMenuItem(i);T._isShown()&&(i.stopPropagation(),T.hide(),E.focus())}}P.on(document,La,Jn,Kt.dataApiKeydownHandler),P.on(document,La,Kr,Kt.dataApiKeydownHandler),P.on(document,ka,Kt.clearMenus),P.on(document,Nh,Kt.clearMenus),P.on(document,ka,Jn,function(f){f.preventDefault(),Kt.getOrCreateInstance(this).toggle()}),F(Kt);const Da="backdrop",Ma="show",Fa=`mousedown.bs.${Da}`,Hh={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Uh={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class $a extends et{constructor(i){super(),this._config=this._getConfig(i),this._isAppended=!1,this._element=null}static get Default(){return Hh}static get DefaultType(){return Uh}static get NAME(){return Da}show(i){if(!this._config.isVisible)return void $(i);this._append();const a=this._getElement();this._config.isAnimated&&w(a),a.classList.add(Ma),this._emulateAnimation(()=>{$(i)})}hide(i){this._config.isVisible?(this._getElement().classList.remove(Ma),this._emulateAnimation(()=>{this.dispose(),$(i)})):$(i)}dispose(){this._isAppended&&(P.off(this._element,Fa),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const i=document.createElement("div");i.className=this._config.className,this._config.isAnimated&&i.classList.add("fade"),this._element=i}return this._element}_configAfterMerge(i){return i.rootElement=h(i.rootElement),i}_append(){if(this._isAppended)return;const i=this._getElement();this._config.rootElement.append(i),P.on(i,Fa,()=>{$(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(i){H(i,this._getElement(),this._config.isAnimated)}}const zr=".bs.focustrap",Vh=`focusin${zr}`,qh=`keydown.tab${zr}`,ja="backward",Wh={autofocus:!0,trapElement:null},Kh={autofocus:"boolean",trapElement:"element"};class Ba extends et{constructor(i){super(),this._config=this._getConfig(i),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Wh}static get DefaultType(){return Kh}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),P.off(document,zr),P.on(document,Vh,i=>this._handleFocusin(i)),P.on(document,qh,i=>this._handleKeydown(i)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,P.off(document,zr))}_handleFocusin(i){const{trapElement:a}=this._config;if(i.target===document||i.target===a||a.contains(i.target))return;const p=O.focusableChildren(a);p.length===0?a.focus():this._lastTabNavDirection===ja?p[p.length-1].focus():p[0].focus()}_handleKeydown(i){i.key==="Tab"&&(this._lastTabNavDirection=i.shiftKey?ja:"forward")}}const Ha=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Ua=".sticky-top",Gr="padding-right",Va="margin-right";class ho{constructor(){this._element=document.body}getWidth(){const i=document.documentElement.clientWidth;return Math.abs(window.innerWidth-i)}hide(){const i=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Gr,a=>a+i),this._setElementAttributes(Ha,Gr,a=>a+i),this._setElementAttributes(Ua,Va,a=>a-i)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Gr),this._resetElementAttributes(Ha,Gr),this._resetElementAttributes(Ua,Va)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(i,a,p){const v=this.getWidth();this._applyManipulationCallback(i,E=>{if(E!==this._element&&window.innerWidth>E.clientWidth+v)return;this._saveInitialAttribute(E,a);const T=window.getComputedStyle(E).getPropertyValue(a);E.style.setProperty(a,`${p(Number.parseFloat(T))}px`)})}_saveInitialAttribute(i,a){const p=i.style.getPropertyValue(a);p&&Je.setDataAttribute(i,a,p)}_resetElementAttributes(i,a){this._applyManipulationCallback(i,p=>{const v=Je.getDataAttribute(p,a);v!==null?(Je.removeDataAttribute(p,a),p.style.setProperty(a,v)):p.style.removeProperty(a)})}_applyManipulationCallback(i,a){if(u(i))a(i);else for(const p of O.find(i,this._element))a(p)}}const $t=".bs.modal",zh=`hide${$t}`,Gh=`hidePrevented${$t}`,qa=`hidden${$t}`,Wa=`show${$t}`,Jh=`shown${$t}`,Xh=`resize${$t}`,Yh=`click.dismiss${$t}`,Qh=`mousedown.dismiss${$t}`,Zh=`keydown.dismiss${$t}`,ep=`click${$t}.data-api`,Ka="modal-open",za="show",po="modal-static",tp={backdrop:!0,focus:!0,keyboard:!0},np={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Xn extends R{constructor(i,a){super(i,a),this._dialog=O.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new ho,this._addEventListeners()}static get Default(){return tp}static get DefaultType(){return np}static get NAME(){return"modal"}toggle(i){return this._isShown?this.hide():this.show(i)}show(i){this._isShown||this._isTransitioning||P.trigger(this._element,Wa,{relatedTarget:i}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Ka),this._adjustDialog(),this._backdrop.show(()=>this._showElement(i)))}hide(){this._isShown&&!this._isTransitioning&&(P.trigger(this._element,zh).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(za),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){P.off(window,$t),P.off(this._dialog,$t),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new $a({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Ba({trapElement:this._element})}_showElement(i){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const a=O.findOne(".modal-body",this._dialog);a&&(a.scrollTop=0),w(this._element),this._element.classList.add(za),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,P.trigger(this._element,Jh,{relatedTarget:i})},this._dialog,this._isAnimated())}_addEventListeners(){P.on(this._element,Zh,i=>{i.key==="Escape"&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),P.on(window,Xh,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),P.on(this._element,Qh,i=>{P.one(this._element,Yh,a=>{this._element===i.target&&this._element===a.target&&(this._config.backdrop!=="static"?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Ka),this._resetAdjustments(),this._scrollBar.reset(),P.trigger(this._element,qa)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(P.trigger(this._element,Gh).defaultPrevented)return;const i=this._element.scrollHeight>document.documentElement.clientHeight,a=this._element.style.overflowY;a==="hidden"||this._element.classList.contains(po)||(i||(this._element.style.overflowY="hidden"),this._element.classList.add(po),this._queueCallback(()=>{this._element.classList.remove(po),this._queueCallback(()=>{this._element.style.overflowY=a},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const i=this._element.scrollHeight>document.documentElement.clientHeight,a=this._scrollBar.getWidth(),p=a>0;if(p&&!i){const v=D()?"paddingLeft":"paddingRight";this._element.style[v]=`${a}px`}if(!p&&i){const v=D()?"paddingRight":"paddingLeft";this._element.style[v]=`${a}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(i,a){return this.each(function(){const p=Xn.getOrCreateInstance(this,i);if(typeof i=="string"){if(p[i]===void 0)throw new TypeError(`No method named "${i}"`);p[i](a)}})}}P.on(document,ep,'[data-bs-toggle="modal"]',function(f){const i=O.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&f.preventDefault(),P.one(i,Wa,p=>{p.defaultPrevented||P.one(i,qa,()=>{d(this)&&this.focus()})});const a=O.findOne(".modal.show");a&&Xn.getInstance(a).hide(),Xn.getOrCreateInstance(i).toggle(this)}),ee(Xn),F(Xn);const gn=".bs.offcanvas",Ga=".data-api",sp=`load${gn}${Ga}`,Ja="show",Xa="showing",Ya="hiding",Qa=".offcanvas.show",rp=`show${gn}`,ip=`shown${gn}`,op=`hide${gn}`,Za=`hidePrevented${gn}`,ec=`hidden${gn}`,lp=`resize${gn}`,ap=`click${gn}${Ga}`,cp=`keydown.dismiss${gn}`,up={backdrop:!0,keyboard:!0,scroll:!1},fp={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class _n extends R{constructor(i,a){super(i,a),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return up}static get DefaultType(){return fp}static get NAME(){return"offcanvas"}toggle(i){return this._isShown?this.hide():this.show(i)}show(i){this._isShown||P.trigger(this._element,rp,{relatedTarget:i}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||new ho().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Xa),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Ja),this._element.classList.remove(Xa),P.trigger(this._element,ip,{relatedTarget:i})},this._element,!0))}hide(){this._isShown&&(P.trigger(this._element,op).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Ya),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(Ja,Ya),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new ho().reset(),P.trigger(this._element,ec)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const i=!!this._config.backdrop;return new $a({className:"offcanvas-backdrop",isVisible:i,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:i?()=>{this._config.backdrop!=="static"?this.hide():P.trigger(this._element,Za)}:null})}_initializeFocusTrap(){return new Ba({trapElement:this._element})}_addEventListeners(){P.on(this._element,cp,i=>{i.key==="Escape"&&(this._config.keyboard?this.hide():P.trigger(this._element,Za))})}static jQueryInterface(i){return this.each(function(){const a=_n.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0||i.startsWith("_")||i==="constructor")throw new TypeError(`No method named "${i}"`);a[i](this)}})}}P.on(document,ap,'[data-bs-toggle="offcanvas"]',function(f){const i=O.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&f.preventDefault(),m(this))return;P.one(i,ec,()=>{d(this)&&this.focus()});const a=O.findOne(Qa);a&&a!==i&&_n.getInstance(a).hide(),_n.getOrCreateInstance(i).toggle(this)}),P.on(window,sp,()=>{for(const f of O.find(Qa))_n.getOrCreateInstance(f).show()}),P.on(window,lp,()=>{for(const f of O.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(f).position!=="fixed"&&_n.getOrCreateInstance(f).hide()}),ee(_n),F(_n);const tc={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},dp=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),hp=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,pp=(f,i)=>{const a=f.nodeName.toLowerCase();return i.includes(a)?!dp.has(a)||!!hp.test(f.nodeValue):i.filter(p=>p instanceof RegExp).some(p=>p.test(a))},mp={allowList:tc,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},gp={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},_p={entry:"(string|element|function|null)",selector:"(string|element)"};class bp extends et{constructor(i){super(),this._config=this._getConfig(i)}static get Default(){return mp}static get DefaultType(){return gp}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(i=>this._resolvePossibleFunction(i)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(i){return this._checkContent(i),this._config.content={...this._config.content,...i},this}toHtml(){const i=document.createElement("div");i.innerHTML=this._maybeSanitize(this._config.template);for(const[v,E]of Object.entries(this._config.content))this._setContent(i,E,v);const a=i.children[0],p=this._resolvePossibleFunction(this._config.extraClass);return p&&a.classList.add(...p.split(" ")),a}_typeCheckConfig(i){super._typeCheckConfig(i),this._checkContent(i.content)}_checkContent(i){for(const[a,p]of Object.entries(i))super._typeCheckConfig({selector:a,entry:p},_p)}_setContent(i,a,p){const v=O.findOne(p,i);v&&((a=this._resolvePossibleFunction(a))?u(a)?this._putElementInTemplate(h(a),v):this._config.html?v.innerHTML=this._maybeSanitize(a):v.textContent=a:v.remove())}_maybeSanitize(i){return this._config.sanitize?(function(a,p,v){if(!a.length)return a;if(v&&typeof v=="function")return v(a);const E=new window.DOMParser().parseFromString(a,"text/html"),T=[].concat(...E.body.querySelectorAll("*"));for(const L of T){const V=L.nodeName.toLowerCase();if(!Object.keys(p).includes(V)){L.remove();continue}const Y=[].concat(...L.attributes),Q=[].concat(p["*"]||[],p[V]||[]);for(const K of Y)pp(K,Q)||L.removeAttribute(K.nodeName)}return E.body.innerHTML})(i,this._config.allowList,this._config.sanitizeFn):i}_resolvePossibleFunction(i){return $(i,[void 0,this])}_putElementInTemplate(i,a){if(this._config.html)return a.innerHTML="",void a.append(i);a.textContent=i.textContent}}const yp=new Set(["sanitize","allowList","sanitizeFn"]),mo="fade",Jr="show",vp=".tooltip-inner",nc=".modal",sc="hide.bs.modal",Qs="hover",go="focus",_o="click",wp={AUTO:"auto",TOP:"top",RIGHT:D()?"left":"right",BOTTOM:"bottom",LEFT:D()?"right":"left"},Ep={allowList:tc,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},Ap={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Yn extends R{constructor(i,a){if(Pa===void 0)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(i,a),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Ep}static get DefaultType(){return Ap}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),P.off(this._element.closest(nc),sc,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const i=P.trigger(this._element,this.constructor.eventName("show")),a=(_(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(i.defaultPrevented||!a)return;this._disposePopper();const p=this._getTipElement();this._element.setAttribute("aria-describedby",p.getAttribute("id"));const{container:v}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(v.append(p),P.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(p),p.classList.add(Jr),"ontouchstart"in document.documentElement)for(const E of[].concat(...document.body.children))P.on(E,"mouseover",y);this._queueCallback(()=>{P.trigger(this._element,this.constructor.eventName("shown")),this._isHovered===!1&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!P.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(Jr),"ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))P.off(i,"mouseover",y);this._activeTrigger[_o]=!1,this._activeTrigger[go]=!1,this._activeTrigger[Qs]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),P.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(i){const a=this._getTemplateFactory(i).toHtml();if(!a)return null;a.classList.remove(mo,Jr),a.classList.add(`bs-${this.constructor.NAME}-auto`);const p=(v=>{do v+=Math.floor(1e6*Math.random());while(document.getElementById(v));return v})(this.constructor.NAME).toString();return a.setAttribute("id",p),this._isAnimated()&&a.classList.add(mo),a}setContent(i){this._newContent=i,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(i){return this._templateFactory?this._templateFactory.changeContent(i):this._templateFactory=new bp({...this._config,content:i,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[vp]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(i){return this.constructor.getOrCreateInstance(i.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(mo)}_isShown(){return this.tip&&this.tip.classList.contains(Jr)}_createPopper(i){const a=$(this._config.placement,[this,i,this._element]),p=wp[a.toUpperCase()];return uo(this._element,i,this._getPopperConfig(p))}_getOffset(){const{offset:i}=this._config;return typeof i=="string"?i.split(",").map(a=>Number.parseInt(a,10)):typeof i=="function"?a=>i(a,this._element):i}_resolvePossibleFunction(i){return $(i,[this._element,this._element])}_getPopperConfig(i){const a={placement:i,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:p=>{this._getTipElement().setAttribute("data-popper-placement",p.state.placement)}}]};return{...a,...$(this._config.popperConfig,[void 0,a])}}_setListeners(){const i=this._config.trigger.split(" ");for(const a of i)if(a==="click")P.on(this._element,this.constructor.eventName("click"),this._config.selector,p=>{const v=this._initializeOnDelegatedTarget(p);v._activeTrigger[_o]=!(v._isShown()&&v._activeTrigger[_o]),v.toggle()});else if(a!=="manual"){const p=a===Qs?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),v=a===Qs?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");P.on(this._element,p,this._config.selector,E=>{const T=this._initializeOnDelegatedTarget(E);T._activeTrigger[E.type==="focusin"?go:Qs]=!0,T._enter()}),P.on(this._element,v,this._config.selector,E=>{const T=this._initializeOnDelegatedTarget(E);T._activeTrigger[E.type==="focusout"?go:Qs]=T._element.contains(E.relatedTarget),T._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},P.on(this._element.closest(nc),sc,this._hideModalHandler)}_fixTitle(){const i=this._element.getAttribute("title");i&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",i),this._element.setAttribute("data-bs-original-title",i),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(i,a){clearTimeout(this._timeout),this._timeout=setTimeout(i,a)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(i){const a=Je.getDataAttributes(this._element);for(const p of Object.keys(a))yp.has(p)&&delete a[p];return i={...a,...typeof i=="object"&&i?i:{}},i=this._mergeConfigObj(i),i=this._configAfterMerge(i),this._typeCheckConfig(i),i}_configAfterMerge(i){return i.container=i.container===!1?document.body:h(i.container),typeof i.delay=="number"&&(i.delay={show:i.delay,hide:i.delay}),typeof i.title=="number"&&(i.title=i.title.toString()),typeof i.content=="number"&&(i.content=i.content.toString()),i}_getDelegateConfig(){const i={};for(const[a,p]of Object.entries(this._config))this.constructor.Default[a]!==p&&(i[a]=p);return i.selector=!1,i.trigger="manual",i}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(i){return this.each(function(){const a=Yn.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0)throw new TypeError(`No method named "${i}"`);a[i]()}})}}F(Yn);const Cp=".popover-header",Sp=".popover-body",Tp={...Yn.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},xp={...Yn.DefaultType,content:"(null|string|element|function)"};class Xr extends Yn{static get Default(){return Tp}static get DefaultType(){return xp}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Cp]:this._getTitle(),[Sp]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(i){return this.each(function(){const a=Xr.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0)throw new TypeError(`No method named "${i}"`);a[i]()}})}}F(Xr);const bo=".bs.scrollspy",Op=`activate${bo}`,rc=`click${bo}`,Rp=`load${bo}.data-api`,Os="active",yo="[href]",ic=".nav-link",Pp=`${ic}, .nav-item > ${ic}, .list-group-item`,Np={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Ip={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Zs extends R{constructor(i,a){super(i,a),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Np}static get DefaultType(){return Ip}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const i of this._observableSections.values())this._observer.observe(i)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(i){return i.target=h(i.target)||document.body,i.rootMargin=i.offset?`${i.offset}px 0px -30%`:i.rootMargin,typeof i.threshold=="string"&&(i.threshold=i.threshold.split(",").map(a=>Number.parseFloat(a))),i}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(P.off(this._config.target,rc),P.on(this._config.target,rc,yo,i=>{const a=this._observableSections.get(i.target.hash);if(a){i.preventDefault();const p=this._rootElement||window,v=a.offsetTop-this._element.offsetTop;if(p.scrollTo)return void p.scrollTo({top:v,behavior:"smooth"});p.scrollTop=v}}))}_getNewObserver(){const i={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(a=>this._observerCallback(a),i)}_observerCallback(i){const a=T=>this._targetLinks.get(`#${T.target.id}`),p=T=>{this._previousScrollData.visibleEntryTop=T.target.offsetTop,this._process(a(T))},v=(this._rootElement||document.documentElement).scrollTop,E=v>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=v;for(const T of i){if(!T.isIntersecting){this._activeTarget=null,this._clearActiveClass(a(T));continue}const L=T.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(E&&L){if(p(T),!v)return}else E||L||p(T)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const i=O.find(yo,this._config.target);for(const a of i){if(!a.hash||m(a))continue;const p=O.findOne(decodeURI(a.hash),this._element);d(p)&&(this._targetLinks.set(decodeURI(a.hash),a),this._observableSections.set(a.hash,p))}}_process(i){this._activeTarget!==i&&(this._clearActiveClass(this._config.target),this._activeTarget=i,i.classList.add(Os),this._activateParents(i),P.trigger(this._element,Op,{relatedTarget:i}))}_activateParents(i){if(i.classList.contains("dropdown-item"))O.findOne(".dropdown-toggle",i.closest(".dropdown")).classList.add(Os);else for(const a of O.parents(i,".nav, .list-group"))for(const p of O.prev(a,Pp))p.classList.add(Os)}_clearActiveClass(i){i.classList.remove(Os);const a=O.find(`${yo}.${Os}`,i);for(const p of a)p.classList.remove(Os)}static jQueryInterface(i){return this.each(function(){const a=Zs.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0||i.startsWith("_")||i==="constructor")throw new TypeError(`No method named "${i}"`);a[i]()}})}}P.on(window,Rp,()=>{for(const f of O.find('[data-bs-spy="scroll"]'))Zs.getOrCreateInstance(f)}),F(Zs);const Qn=".bs.tab",kp=`hide${Qn}`,Lp=`hidden${Qn}`,Dp=`show${Qn}`,Mp=`shown${Qn}`,Fp=`click${Qn}`,$p=`keydown${Qn}`,jp=`load${Qn}`,Bp="ArrowLeft",oc="ArrowRight",Hp="ArrowUp",lc="ArrowDown",vo="Home",ac="End",Zn="active",cc="fade",wo="show",uc=".dropdown-toggle",Eo=`:not(${uc})`,fc='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Ao=`.nav-link${Eo}, .list-group-item${Eo}, [role="tab"]${Eo}, ${fc}`,Up=`.${Zn}[data-bs-toggle="tab"], .${Zn}[data-bs-toggle="pill"], .${Zn}[data-bs-toggle="list"]`;class es extends R{constructor(i){super(i),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),P.on(this._element,$p,a=>this._keydown(a)))}static get NAME(){return"tab"}show(){const i=this._element;if(this._elemIsActive(i))return;const a=this._getActiveElem(),p=a?P.trigger(a,kp,{relatedTarget:i}):null;P.trigger(i,Dp,{relatedTarget:a}).defaultPrevented||p&&p.defaultPrevented||(this._deactivate(a,i),this._activate(i,a))}_activate(i,a){i&&(i.classList.add(Zn),this._activate(O.getElementFromSelector(i)),this._queueCallback(()=>{i.getAttribute("role")==="tab"?(i.removeAttribute("tabindex"),i.setAttribute("aria-selected",!0),this._toggleDropDown(i,!0),P.trigger(i,Mp,{relatedTarget:a})):i.classList.add(wo)},i,i.classList.contains(cc)))}_deactivate(i,a){i&&(i.classList.remove(Zn),i.blur(),this._deactivate(O.getElementFromSelector(i)),this._queueCallback(()=>{i.getAttribute("role")==="tab"?(i.setAttribute("aria-selected",!1),i.setAttribute("tabindex","-1"),this._toggleDropDown(i,!1),P.trigger(i,Lp,{relatedTarget:a})):i.classList.remove(wo)},i,i.classList.contains(cc)))}_keydown(i){if(![Bp,oc,Hp,lc,vo,ac].includes(i.key))return;i.stopPropagation(),i.preventDefault();const a=this._getChildren().filter(v=>!m(v));let p;if([vo,ac].includes(i.key))p=a[i.key===vo?0:a.length-1];else{const v=[oc,lc].includes(i.key);p=te(a,i.target,v,!0)}p&&(p.focus({preventScroll:!0}),es.getOrCreateInstance(p).show())}_getChildren(){return O.find(Ao,this._parent)}_getActiveElem(){return this._getChildren().find(i=>this._elemIsActive(i))||null}_setInitialAttributes(i,a){this._setAttributeIfNotExists(i,"role","tablist");for(const p of a)this._setInitialAttributesOnChild(p)}_setInitialAttributesOnChild(i){i=this._getInnerElement(i);const a=this._elemIsActive(i),p=this._getOuterElement(i);i.setAttribute("aria-selected",a),p!==i&&this._setAttributeIfNotExists(p,"role","presentation"),a||i.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(i,"role","tab"),this._setInitialAttributesOnTargetPanel(i)}_setInitialAttributesOnTargetPanel(i){const a=O.getElementFromSelector(i);a&&(this._setAttributeIfNotExists(a,"role","tabpanel"),i.id&&this._setAttributeIfNotExists(a,"aria-labelledby",`${i.id}`))}_toggleDropDown(i,a){const p=this._getOuterElement(i);if(!p.classList.contains("dropdown"))return;const v=(E,T)=>{const L=O.findOne(E,p);L&&L.classList.toggle(T,a)};v(uc,Zn),v(".dropdown-menu",wo),p.setAttribute("aria-expanded",a)}_setAttributeIfNotExists(i,a,p){i.hasAttribute(a)||i.setAttribute(a,p)}_elemIsActive(i){return i.classList.contains(Zn)}_getInnerElement(i){return i.matches(Ao)?i:O.findOne(Ao,i)}_getOuterElement(i){return i.closest(".nav-item, .list-group-item")||i}static jQueryInterface(i){return this.each(function(){const a=es.getOrCreateInstance(this);if(typeof i=="string"){if(a[i]===void 0||i.startsWith("_")||i==="constructor")throw new TypeError(`No method named "${i}"`);a[i]()}})}}P.on(document,Fp,fc,function(f){["A","AREA"].includes(this.tagName)&&f.preventDefault(),m(this)||es.getOrCreateInstance(this).show()}),P.on(window,jp,()=>{for(const f of O.find(Up))es.getOrCreateInstance(f)}),F(es);const Pn=".bs.toast",Vp=`mouseover${Pn}`,qp=`mouseout${Pn}`,Wp=`focusin${Pn}`,Kp=`focusout${Pn}`,zp=`hide${Pn}`,Gp=`hidden${Pn}`,Jp=`show${Pn}`,Xp=`shown${Pn}`,dc="hide",Yr="show",Qr="showing",Yp={animation:"boolean",autohide:"boolean",delay:"number"},Qp={animation:!0,autohide:!0,delay:5e3};class er extends R{constructor(i,a){super(i,a),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Qp}static get DefaultType(){return Yp}static get NAME(){return"toast"}show(){P.trigger(this._element,Jp).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(dc),w(this._element),this._element.classList.add(Yr,Qr),this._queueCallback(()=>{this._element.classList.remove(Qr),P.trigger(this._element,Xp),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(P.trigger(this._element,zp).defaultPrevented||(this._element.classList.add(Qr),this._queueCallback(()=>{this._element.classList.add(dc),this._element.classList.remove(Qr,Yr),P.trigger(this._element,Gp)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Yr),super.dispose()}isShown(){return this._element.classList.contains(Yr)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(i,a){switch(i.type){case"mouseover":case"mouseout":this._hasMouseInteraction=a;break;case"focusin":case"focusout":this._hasKeyboardInteraction=a}if(a)return void this._clearTimeout();const p=i.relatedTarget;this._element===p||this._element.contains(p)||this._maybeScheduleHide()}_setListeners(){P.on(this._element,Vp,i=>this._onInteraction(i,!0)),P.on(this._element,qp,i=>this._onInteraction(i,!1)),P.on(this._element,Wp,i=>this._onInteraction(i,!0)),P.on(this._element,Kp,i=>this._onInteraction(i,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(i){return this.each(function(){const a=er.getOrCreateInstance(this,i);if(typeof i=="string"){if(a[i]===void 0)throw new TypeError(`No method named "${i}"`);a[i](this)}})}}return ee(er),F(er),{Alert:A,Button:k,Carousel:_s,Collapse:ys,Dropdown:Kt,Modal:Xn,Offcanvas:_n,Popover:Xr,ScrollSpy:Zs,Tab:es,Toast:er,Tooltip:Yn}})})(_i)),_i.exports}Cw();Hv();const th=$_(rw);th.use(eh);th.mount("#app");export{fn as A,Yd as B,Gl as C,fr as D,Lc as E,ot as F,Nf as G,nd as H,Df as I,Ow as J,xw as K,Tw as L,Sw as T,gs as a,cd as b,kl as c,nt as d,j as e,At as f,vt as g,Rw as h,gg as i,ql as j,Ve as k,Er as l,Hn as m,Ii as n,Mi as o,Vt as p,Ue as q,Tt as r,An as s,cs as t,Xw as u,Pw as v,Io as w,$o as x,Nw as y,al as z}; diff --git a/deploy/ui-dist/assets/useTrafficChart-69f2EcZB.js b/deploy/ui-dist/assets/useTrafficChart-DniISzMl.js similarity index 96% rename from deploy/ui-dist/assets/useTrafficChart-69f2EcZB.js rename to deploy/ui-dist/assets/useTrafficChart-DniISzMl.js index c881b34..4a4ff33 100644 --- a/deploy/ui-dist/assets/useTrafficChart-69f2EcZB.js +++ b/deploy/ui-dist/assets/useTrafficChart-DniISzMl.js @@ -1 +1 @@ -import{C as p,r as v}from"./vendor-charts-Bcjh2pZL.js";import{u as T}from"./useFormatters-CKGG-YVI.js";import{c as k}from"./index-BfAhXdi6.js";p.register(...v);const L="#1652B8",M="#EC7C31",_=1024*1024,S=()=>{const e=document.documentElement.getAttribute("data-theme")==="dark";return{isDark:e,gridColor:e?"rgba(240, 246, 252, 0.1)":"rgba(0,0,0,0.05)",textColor:e?"#8b949e":"#6c757d"}},A=(e,o)=>{if(!e||e.length===0)return[];if(e.length<=o)return e;const u=Math.ceil(e.length/o),n=[];for(let a=0;a{m+=r.bytes_received||0,c+=r.bytes_sent||0,s=Math.max(s,r.rx_rate_mbps||0),t=Math.max(t,r.tx_rate_mbps||0)}),n.push({timestamp:l[0].timestamp,bytes_received:m,bytes_sent:c,rx_rate_mbps:s,tx_rate_mbps:t})}return n},B=e=>{const o=/^(\d+)([hd])$/.exec(e||"");return o?Number(o[1])*(o[2]==="d"?24:1)>24:!1};function D(e,{maxPoints:o}){const{parseServerDate:u}=T();let n=null;const a=()=>{n&&(n.destroy(),n=null)},l=(c,s)=>{const t=u(c),r=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return s.includes("h")||s==="1d"?r:t.toLocaleDateString([],{month:"short",day:"numeric"})+" "+r},m=(c,{range:s,speedMode:t})=>{if(!e.value)return;a();const r=[],d=[],b=[];A(c,o).forEach(i=>{r.push(l(i.timestamp,s)),t?(d.push(i.rx_rate_mbps||0),b.push(i.tx_rate_mbps||0)):(d.push(i.bytes_received/_),b.push(i.bytes_sent/_))});const{gridColor:h,textColor:g}=S(),x=B(s)?" (avg)":"",f=(i,C,R,y)=>({label:i,data:C,borderColor:R,backgroundColor:y,borderWidth:2,fill:!0,tension:.3,pointRadius:3,pointHoverRadius:4});n=new p(e.value.getContext("2d"),{type:"line",data:{labels:r,datasets:[f(t?`RX Mbps${x}`:"Received (MB)",d,L,"rgba(22, 82, 184, 0.15)"),f(t?`TX Mbps${x}`:"Sent (MB)",b,M,"rgba(236, 124, 49, 0.15)")]},options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{labels:{color:g}}},scales:{x:{ticks:{color:g,maxTicksLimit:8},grid:{color:h}},y:{beginAtZero:!0,ticks:{color:g},grid:{color:h}}}}})};return k(a),{render:m,destroy:a}}export{L as C,M as a,S as g,D as u}; +import{C as p,r as v}from"./vendor-charts-Bcjh2pZL.js";import{u as T}from"./useFormatters-CKGG-YVI.js";import{c as k}from"./index-CH6sppUl.js";p.register(...v);const L="#1652B8",M="#EC7C31",_=1024*1024,S=()=>{const e=document.documentElement.getAttribute("data-theme")==="dark";return{isDark:e,gridColor:e?"rgba(240, 246, 252, 0.1)":"rgba(0,0,0,0.05)",textColor:e?"#8b949e":"#6c757d"}},A=(e,o)=>{if(!e||e.length===0)return[];if(e.length<=o)return e;const u=Math.ceil(e.length/o),n=[];for(let a=0;a{m+=r.bytes_received||0,c+=r.bytes_sent||0,s=Math.max(s,r.rx_rate_mbps||0),t=Math.max(t,r.tx_rate_mbps||0)}),n.push({timestamp:l[0].timestamp,bytes_received:m,bytes_sent:c,rx_rate_mbps:s,tx_rate_mbps:t})}return n},B=e=>{const o=/^(\d+)([hd])$/.exec(e||"");return o?Number(o[1])*(o[2]==="d"?24:1)>24:!1};function D(e,{maxPoints:o}){const{parseServerDate:u}=T();let n=null;const a=()=>{n&&(n.destroy(),n=null)},l=(c,s)=>{const t=u(c),r=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return s.includes("h")||s==="1d"?r:t.toLocaleDateString([],{month:"short",day:"numeric"})+" "+r},m=(c,{range:s,speedMode:t})=>{if(!e.value)return;a();const r=[],d=[],b=[];A(c,o).forEach(i=>{r.push(l(i.timestamp,s)),t?(d.push(i.rx_rate_mbps||0),b.push(i.tx_rate_mbps||0)):(d.push(i.bytes_received/_),b.push(i.bytes_sent/_))});const{gridColor:h,textColor:g}=S(),x=B(s)?" (avg)":"",f=(i,C,R,y)=>({label:i,data:C,borderColor:R,backgroundColor:y,borderWidth:2,fill:!0,tension:.3,pointRadius:3,pointHoverRadius:4});n=new p(e.value.getContext("2d"),{type:"line",data:{labels:r,datasets:[f(t?`RX Mbps${x}`:"Received (MB)",d,L,"rgba(22, 82, 184, 0.15)"),f(t?`TX Mbps${x}`:"Sent (MB)",b,M,"rgba(236, 124, 49, 0.15)")]},options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{labels:{color:g}}},scales:{x:{ticks:{color:g,maxTicksLimit:8},grid:{color:h}},y:{beginAtZero:!0,ticks:{color:g},grid:{color:h}}}}})};return k(a),{render:m,destroy:a}}export{L as C,M as a,S as g,D as u}; diff --git a/deploy/ui-dist/index.html b/deploy/ui-dist/index.html index 37a5907..1e2dcf1 100644 --- a/deploy/ui-dist/index.html +++ b/deploy/ui-dist/index.html @@ -6,7 +6,7 @@ OpenVPN Controller - +