diff --git a/.gitattributes b/.gitattributes index 389aaea..bdf6db8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,5 +14,6 @@ /AGENTS.md export-ignore /CLAUDE.md export-ignore /tests export-ignore +/ui export-ignore /phpunit.xml export-ignore /pint.json export-ignore diff --git a/.gitea/workflows/pr-ci.yml b/.gitea/workflows/pr-ci.yml index 12de92d..b8d77c8 100644 --- a/.gitea/workflows/pr-ci.yml +++ b/.gitea/workflows/pr-ci.yml @@ -96,6 +96,30 @@ jobs: - name: pest tests run: vendor/bin/pest + # The screens (ui/) are built into resources/dist, which is committed so a site needs no Node. Check that the + # sources type-check and that the committed bundle is what the sources build to. The node image has git (see below). + ui: + runs-on: docker + container: + image: node:22-bookworm + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: install + run: cd ui && npm ci --no-audit --no-fund + + - name: type check + run: cd ui && npm run typecheck + + - name: build + run: cd ui && npm run build + + - name: the committed bundle is up to date + run: | + git config --global --add safe.directory "$(pwd)" + git diff --exit-code -- resources/dist || { echo "resources/dist is out of date: run 'npm run build' in ui/ and commit it" >&2; exit 1; } + # Known vulnerabilities in the dependencies, and secrets or bad settings in the repository. security: runs-on: docker @@ -162,12 +186,12 @@ jobs: # every job above is. Do not rename it without changing the protection rule. pr-ci: runs-on: docker - needs: [flow, ledger, test, security] + needs: [flow, ledger, test, ui, security] if: always() container: image: alpine:3.20 steps: - name: all checks green run: | - echo "flow=${{ needs.flow.result }} ledger=${{ needs.ledger.result }} test=${{ needs.test.result }} security=${{ needs.security.result }}" - [ "${{ needs.flow.result }}" = "success" ] && [ "${{ needs.ledger.result }}" = "success" ] && [ "${{ needs.test.result }}" = "success" ] && [ "${{ needs.security.result }}" = "success" ] + echo "flow=${{ needs.flow.result }} ledger=${{ needs.ledger.result }} test=${{ needs.test.result }} ui=${{ needs.ui.result }} security=${{ needs.security.result }}" + [ "${{ needs.flow.result }}" = "success" ] && [ "${{ needs.ledger.result }}" = "success" ] && [ "${{ needs.test.result }}" = "success" ] && [ "${{ needs.ui.result }}" = "success" ] && [ "${{ needs.security.result }}" = "success" ] diff --git a/AGENTS.md b/AGENTS.md index 6d909c0..8cee59e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,6 +19,6 @@ between lil-koneko.com, CarsHub, iriks-it.nl and bouwbedrijf.iriks-it.nl, as one ## Open decisions -1. Frontend: ship the Inertia/Vue screens inside the package (built assets, published to the host) or make the package headless with a separate UI package. -2. Moving the rest from bouwbedrijf.iriks-it.nl, module by module: pages, reviews, then revisions, audit log, login and profile. Users, media and posts (with labels) are done. Leave out what is site-specific (the IriksIT API disk, the owner's simple screens, client names): this repo is public. +1. Frontend: decided and built: the screens are in the package (`ui/`, built into `resources/dist`, committed; PR CI checks it is up to date). Still open: a theme editor in the manager, and a `host` mode that publishes the sources for a site to build itself. +2. Moving the rest from bouwbedrijf.iriks-it.nl: real pages and reviews (now skeletons) and revisions. Users, media, posts, audit log and statistics are done, with their screens. Leave out what is site-specific (the IriksIT API disk, the owner's simple screens, client names): this repo is public. 3. How the host's own `User` and a package `Group` relate when the host has its own roles. diff --git a/CHANGELOG.md b/CHANGELOG.md index b0099e6..a9684cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ Every release has a section here, named after its version (for example `v0.1.0 - heading). The release pull request to `production` is stopped by PR CI when its section is missing, and the text of the section is the text of the release in Gitea. +## v0.4.0 - 2026-12-04 + +- Screens in the package: a small Vue app on the JSON routes, built and served by the package (a site needs no Node). Login, logout and + profile for an app that has none, a dashboard and menu, and screens for accounts, groups, media (with a picker for covers), posts, + categories and tags, the audit log with bans, and statistics. Pages and reviews show a read-only list. `MANAGER_UI=none` keeps only the + JSON routes. The default middleware is now `['web', 'manager.auth']` (a published config that still says `auth` keeps working). +- Themes: `dark` and `light`, your own as a JSON file (`php artisan manager:make-theme`) or in the config, chosen per account in the + profile (new table `manager_user_settings`; `MANAGER_THEME`, `MANAGER_USER_THEMES`). Every value is checked before it reaches a page. +- For AI agents: `php artisan manager:install` (no questions), `php artisan manager:doctor --json` (checks the setup, says how to fix + it, non-zero exit on failure), a step-by-step guide (`resources/ai/INTEGRATION.md`) and a Laravel Boost guideline. Modules report + their tables with `tables()`. +- PR CI: a job that type-checks and builds the screens and fails when the committed `resources/dist` is out of date. + ## v0.3.0 - 2026-12-04 - The Packagist step submits the package itself when Packagist does not know it yet (the update call answered 404), instead diff --git a/README.md b/README.md index 8a43692..af4287b 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,31 @@ php artisan migrate Put `IriksIT\Manager\Concerns\HasManagerAccess` on the `User` model. The manager lives at `/manager` (`MANAGER_PATH`) behind the `web` and `auth` middleware (`config/manager.php`). +## Set up with an AI agent + +```bash +php artisan manager:install --modules=users,media,posts --user-model="App\Models\User" +php artisan manager:doctor --json # non-zero exit when something is wrong; each problem has a `fix` +``` + +`resources/ai/INTEGRATION.md` is a step-by-step guide for an agent; `resources/boost/guidelines/core.blade.php` +is picked up by Laravel Boost. + +## Screens and themes + +The package brings its own screens (a small Vue app on the JSON routes, already built: your app needs no Node). They also +give an app without a login a login and a profile. `MANAGER_UI=none` turns them off, for an app that builds its own screens +on the JSON routes. A browser that opens a manager address gets the page; anything that asks for JSON gets the data. + +- **Looks.** Built in are `dark` and `light`. `MANAGER_THEME` is what everyone sees until they choose; with + `MANAGER_USER_THEMES=true` (default) each account picks its own in its profile. +- **The house style of the site.** `php artisan manager:make-theme acme --brand=#e4002b --name="Acme" --logo=/img/logo.svg --font="Inter, sans-serif"` + writes `resources/manager-themes/acme.json`; set `MANAGER_THEME=acme`. A theme is colours, a radius, fonts, a name and a logo, and every + value is checked, so a theme file can never put CSS or markup in the page. Themes can also be listed in `manager.themes`. +- **Not built yet:** a theme editor in the manager (themes are files for now), and screens for modules your own site adds (they show a notice). +- **Working on the screens:** the sources are in `ui/`; `npm ci && npm run build` there writes `resources/dist`, which is committed + (PR CI fails when it is out of date). + ## Modules | Key | What | Default | @@ -127,13 +152,12 @@ scheduled daily), so a code cannot be traced back afterwards. A browser that sen ## State of this version -Done: module registry and switches, permissions per module, users (accounts, groups, command), media -(library and public file route) posts (with categories and tags) and the audit log with bans and the statistics, 99 tests (`composer test`). +Done: module registry and switches, permissions per module, users (accounts, groups, command), media (library and public file +route), posts (with categories and tags), the audit log with bans, the statistics, the built-in screens for all of these (with a +login and profile), themes, and the install and doctor commands for AI agents. `composer test` runs the tests. -The answers of every action are JSON, in the shape the screens of bouwbedrijf.iriks-it.nl got as -Inertia props. The screens themselves are not in the package yet: the frontend is an open decision -(`AGENTS.md`). Pages and reviews are still skeletons (a list), and login, profile and revisions are not -ported yet. +Pages and reviews are still skeletons (a read-only list), and revisions are not ported yet. The answers of every action are JSON +in the shape the screens use, so an app can build its own screens with `MANAGER_UI=none`. ## Development cycle diff --git a/TOKENS.md b/TOKENS.md index 0c1f232..cd97b2c 100644 --- a/TOKENS.md +++ b/TOKENS.md @@ -22,3 +22,11 @@ Per stuk werk een rij; zie `dev/token-usage.py`. | 2026-12-04 | Wekelijkse update van de versiebereiken van afhankelijkheden, als pull request naar de open release | - | claude-sonnet-5-5 | 6 | 7.611 | 12 | 10.963 | 1.632.350 | 0,01 | | 2026-12-04 | De commit zonder AI-vermelding hersteld in de release, de uitleg over de nachtelijke scans gecorrigeerd en de notities in longterm-memory gemaakt | - | claude-sonnet-5-5 | 29 | 16.997 | 72 | 21.381 | 8.975.420 | 0,11 | | 2026-12-04 | De Packagist-stap meldt het pakket zelf aan als Packagist het nog niet kent | - | claude-sonnet-5-5 | 13 | 7.095 | 30 | 11.993 | 4.256.820 | 0,06 | +| 2026-12-04 | Installatie en gezondheidscheck voor AI (manager:install en manager:doctor) met een stappengids voor agents | - | claude-sonnet-5-5 | 12 | 12.112 | 28 | 64.789 | 2.344.181 | 0,04 | +| 2026-12-04 | Installatie en gezondheidscheck voor AI (manager:install en manager:doctor) met een stappengids voor agents | - | claude-fable-5-2 | 1 | 17.440 | 362.597 | 0 | 0 | 0,00 | +| 2026-12-04 | Schermen in het pakket: eigen login, profiel, menu en berichten, thema's per gebruiker en voor de huisstijl van de site | - | claude-sonnet-5-5 | 51 | 60.198 | 102 | 94.747 | 7.947.787 | 0,19 | +| 2026-12-04 | Schermen voor gebruikers, groepen, categorieën en tags, pagina's en reviews | - | claude-sonnet-5-5 | 11 | 13.236 | 24 | 21.715 | 2.310.933 | 0,06 | +| 2026-12-04 | Schermen voor media (met kiezer voor de omslag), de auditlog met blokkades en de statistieken | - | claude-sonnet-5-5 | 23 | 23.335 | 46 | 42.961 | 5.678.787 | 0,06 | +| 2026-12-04 | De stappengids en de installatie verbeterd na de proef met een verse agent | - | claude-sonnet-5-5 | 25 | 21.844 | 50 | 35.997 | 6.551.164 | 0,10 | +| 2026-12-04 | De stappengids en de installatie verbeterd na de proef met een verse agent | - | claude-haiku-5-5 | 11 | 8.233 | 22 | 51.184 | 444.805 | 0,00 | +| 2026-12-04 | Changelog van v0.4.0, wiki en notitie in longterm-memory | - | claude-sonnet-5-5 | 7 | 3.891 | 14 | 5.215 | 1.999.583 | 0,01 | diff --git a/config/manager.php b/config/manager.php index e2351e0..9fcd393 100644 --- a/config/manager.php +++ b/config/manager.php @@ -13,7 +13,28 @@ return [ | Middleware around every manager route. Authentication of the manager itself | is left to the host app: use the guard it already has. */ - 'middleware' => ['web', 'auth'], + 'middleware' => ['web', 'manager.auth'], + + /* + | The screens. `package`: the manager brings its own (a Vue app, built, served by the package; it also gives a login and + | a profile when the app has none). `none`: only the JSON API, for an app that builds its own screens. + */ + 'ui' => env('MANAGER_UI', 'package'), + + /* + | The name in the menu and on the login screen. + */ + 'name' => env('MANAGER_NAME'), + + /* + | Looks. `theme` is what everyone gets until they choose; `user_themes` lets each account pick its own (profile). + | A theme is a set of colours, a radius and fonts: built in are `dark` and `light`; the site's own live as JSON files in + | `themes_path` (make one with `php artisan manager:make-theme`) or here in `themes`, by key. + */ + 'theme' => env('MANAGER_THEME', 'dark'), + 'user_themes' => (bool) env('MANAGER_USER_THEMES', true), + 'themes_path' => null, // default: resources/manager-themes of the app + 'themes' => [], /* | The Eloquent model of the people who log in. Must use IriksIT\Manager\Concerns\HasManagerAccess. diff --git a/database/migrations/2026_12_05_000001_create_manager_user_settings.php b/database/migrations/2026_12_05_000001_create_manager_user_settings.php new file mode 100644 index 0000000..5b5ba25 --- /dev/null +++ b/database/migrations/2026_12_05_000001_create_manager_user_settings.php @@ -0,0 +1,25 @@ +getTable(); + + Schema::create(config('manager.table_prefix').'user_settings', function (Blueprint $table) use ($users) { + $table->id(); + $table->foreignId('user_id')->unique()->constrained($users)->cascadeOnDelete(); + $table->string('theme', 60)->nullable(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists(config('manager.table_prefix').'user_settings'); + } +}; diff --git a/resources/ai/INTEGRATION.md b/resources/ai/INTEGRATION.md new file mode 100644 index 0000000..3c5db6a --- /dev/null +++ b/resources/ai/INTEGRATION.md @@ -0,0 +1,31 @@ +# Integrating iriks-it/laravel-manager (guide for AI agents) + +Goal: the manager runs in this Laravel app and `php artisan manager:doctor --json` says `"ok": true`. Do the steps in +order and never edit files inside `vendor/`. + +1. `composer require iriks-it/laravel-manager` + (A version that is not on Packagist yet: first `composer config repositories.manager --json '{"type":"path","url":"/path/to/laravel-manager","options":{"symlink":false}}'`, then require `@dev`.) +2. Pick the modules. `users` and `media` are on; `pages` and `posts` are on by default; `reviews`, `audit` and `statistics` are off + (audit and statistics store visitor data: only switch them on when the owner says so). +3. `php artisan manager:install --modules=users,media,posts --user-model="App\Models\User"` + It writes the `MANAGER_*` switches to `.env` and publishes `config/manager.php`. Add `--path=admin` to move the URL. + It does not run the check itself (this process still has the old config): that is step 7. +4. Add the trait to the user model: `use \IriksIT\Manager\Concerns\HasManagerAccess;`. Never put `is_super_admin` in `$fillable`. +5. `php artisan config:clear && php artisan migrate && php artisan storage:link` (a new process, so it sees the switches of step 3). +6. Create the first super admin: `php artisan manager:create-user --name="..." --email="..." --password="<12+ chars>"`. +7. `php artisan manager:doctor --json`. Every check must be `ok` or an understood `warn`; each `fail` and `warn` has a `fix`. + Repeat until `"ok": true`. + +Facts that matter: +- The screens are part of the package (`MANAGER_UI=package`, the default): open `/manager` in a browser. The app does not need a + login of its own: when it has no route named `login`, the manager's own login at `/manager/login` is used. With + `MANAGER_UI=none` there are only the JSON routes. +- A browser address gets the screens, a request with `Accept: application/json` gets the data. To call the JSON routes from a + script: `GET /manager/login` once for the `XSRF-TOKEN` cookie, then `POST /manager/login` with header `X-XSRF-TOKEN` (the cookie + value, URL-decoded), `Accept: application/json` and body `{"email": "...", "password": "..."}`; the answer is `{"redirect": "/manager"}`. +- The look: `MANAGER_THEME=dark|light` or your own (`php artisan manager:make-theme acme --brand=#e4002b --name="Acme" --logo=/img/logo.svg`, + then `MANAGER_THEME=acme`). Each account can pick its own in its profile (`MANAGER_USER_THEMES=false` stops that). +- Anything that is off has no routes, tables or permissions. A module that needs another one fails at boot when that one is off. +- Do not add site-specific code to the package: a site's own part is its own module class (`Contracts\Module`, extend + `Modules\BaseModule`, add it to `manager.available`). +- Behind a proxy set trusted proxies before switching `audit` on. diff --git a/resources/boost/guidelines/core.blade.php b/resources/boost/guidelines/core.blade.php new file mode 100644 index 0000000..6b6a276 --- /dev/null +++ b/resources/boost/guidelines/core.blade.php @@ -0,0 +1,9 @@ +## iriks-it/laravel-manager + +A modular backend (users, media, pages, posts, reviews, audit, statistics) installed as a package. + +- To integrate it, follow `vendor/iriks-it/laravel-manager/resources/ai/INTEGRATION.md` step by step. +- Set it up with `php artisan manager:install --modules=... --user-model=...`, then `config:clear`, `migrate`, `storage:link`; verify in a new process with `php artisan manager:doctor --json` (non-zero exit on failure, every problem has a `fix`). +- The screens come with the package (`MANAGER_UI`), including a login when the app has none; themes: `php artisan manager:make-theme`, `MANAGER_THEME`. +- The user model needs the `HasManagerAccess` trait; `is_super_admin` is never mass assignable. The first super admin comes from `php artisan manager:create-user`. +- Switch parts with `MANAGER_=true|false`; never edit `vendor/`. Site-specific parts are your own `Module` class. diff --git a/resources/dist/manager.css b/resources/dist/manager.css new file mode 100644 index 0000000..8690a6e --- /dev/null +++ b/resources/dist/manager.css @@ -0,0 +1 @@ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:var(--m-font,ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500:oklch(63.7% .237 25.331);--color-emerald-500:oklch(69.6% .17 162.48);--color-black:#000;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-sm:.25rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--m-font,ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components{.m-card{background:var(--m-panel);border:1px solid var(--m-line);border-radius:var(--m-radius,.5rem)}.m-btn{border-radius:var(--m-radius,.5rem);cursor:pointer;border:1px solid #0000;align-items:center;gap:.4rem;padding:.5rem .9rem;font-size:.875rem;font-weight:600;transition:filter .15s;display:inline-flex}.m-btn:disabled{opacity:.5;cursor:not-allowed}.m-btn-primary{background:var(--m-brand);color:#fff}.m-btn-primary:hover:not(:disabled){filter:brightness(1.1)}.m-btn-secondary{background:var(--m-panel-2);border-color:var(--m-line);color:var(--m-text)}.m-btn-secondary:hover:not(:disabled){filter:brightness(1.15)}.m-btn-danger{color:#ef4444;background:0 0;border-color:#ef444466}.m-label{color:var(--m-muted);margin-bottom:.25rem;font-size:.8rem;font-weight:600;display:block}.m-input{border-radius:var(--m-radius,.5rem);border:1px solid var(--m-line);background:var(--m-ink);width:100%;color:var(--m-text);padding:.5rem .7rem;font-size:.9rem}.m-input:focus{outline:2px solid var(--m-brand);outline-offset:1px}.m-error{color:#ef4444;margin-top:.25rem;font-size:.8rem}.m-help{color:var(--m-muted);margin-top:.25rem;font-size:.75rem}.m-badge{background:var(--m-panel-2);border:1px solid var(--m-line);border-radius:999px;padding:.1rem .55rem;font-size:.7rem;font-weight:600;display:inline-block}}@layer utilities{.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.fixed{position:fixed}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.right-5{right:calc(var(--spacing) * 5)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-0{left:0}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-7{height:calc(var(--spacing) * 7)}.h-9{height:calc(var(--spacing) * 9)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-full{height:100%}.max-h-\[85vh\]{max-height:85vh}.min-h-screen{min-height:100vh}.w-4{width:calc(var(--spacing) * 4)}.w-9{width:calc(var(--spacing) * 9)}.w-32{width:calc(var(--spacing) * 32)}.w-60{width:calc(var(--spacing) * 60)}.w-auto{width:auto}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-\[12rem\]{max-width:12rem}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-3{min-width:calc(var(--spacing) * 3)}.min-w-\[10rem\]{min-width:10rem}.min-w-px{min-width:1px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line>:not(:last-child)){border-color:var(--m-line)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-brand{border-color:var(--m-brand)}.border-line{border-color:var(--m-line)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-brand,.bg-brand\/15{background-color:var(--m-brand)}@supports (color:color-mix(in lab,red,red)){.bg-brand\/15{background-color:color-mix(in oklab,var(--m-brand) 15%,transparent)}}.bg-panel{background-color:var(--m-panel)}.bg-panel-2{background-color:var(--m-panel-2)}.object-cover{object-fit:cover}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.pt-14{padding-top:calc(var(--spacing) * 14)}.pt-20{padding-top:calc(var(--spacing) * 20)}.pb-16{padding-bottom:calc(var(--spacing) * 16)}.text-left{text-align:left}.font-display{font-family:var(--m-font-display,var(--m-font,ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif))}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-all{word-break:break-all}.text-emerald-500{color:var(--color-emerald-500)}.text-muted{color:var(--m-muted)}.text-red-500{color:var(--color-red-500)}.text-text{color:var(--m-text)}.underline{text-decoration-line:underline}.opacity-50{opacity:.5}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){:is(:where(.group):hover .group-hover\:text-brand){color:var(--m-brand)}.hover\:border-brand:hover{border-color:var(--m-brand)}.hover\:bg-text\/5:hover{background-color:var(--m-text)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-text\/5:hover{background-color:color-mix(in oklab,var(--m-text) 5%,transparent)}}.hover\:text-text:hover{color:var(--m-text)}}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:48rem){.md\:ml-60{margin-left:calc(var(--spacing) * 60)}.md\:flex{display:flex}.md\:hidden{display:none}.md\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:px-8{padding-inline:calc(var(--spacing) * 8)}.md\:pt-0{padding-top:0}.md\:pt-8{padding-top:calc(var(--spacing) * 8)}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}}html,body{background:var(--m-ink);color:var(--m-text);font-family:var(--font-sans)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000} diff --git a/resources/dist/manager.js b/resources/dist/manager.js new file mode 100644 index 0000000..2644916 --- /dev/null +++ b/resources/dist/manager.js @@ -0,0 +1,2 @@ +function xn(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const te={},Ot=[],st=()=>{},Ai=()=>!1,Is=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),js=e=>e.startsWith("onUpdate:"),de=Object.assign,wn=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},qo=Object.prototype.hasOwnProperty,X=(e,t)=>qo.call(e,t),U=Array.isArray,xt=e=>Ht(e)==="[object Map]",bt=e=>Ht(e)==="[object Set]",Kn=e=>Ht(e)==="[object Date]",F=e=>typeof e=="function",re=e=>typeof e=="string",Ke=e=>typeof e=="symbol",Q=e=>e!==null&&typeof e=="object",Ei=e=>(Q(e)||F(e))&&F(e.then)&&F(e.catch),Pi=Object.prototype.toString,Ht=e=>Pi.call(e),Go=e=>Ht(e).slice(8,-1),Oi=e=>Ht(e)==="[object Object]",$n=e=>re(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zt=xn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),zo=1e4,Ds=e=>{let t=Object.create(null),s=0;return(n=>{const i=t[n];return i!==void 0?i:(++s>zo&&(t=Object.create(null),s=1),t[n]=e(n))})},Jo=/-\w/g,Se=Ds(e=>e.replace(Jo,t=>t.slice(1).toUpperCase())),Xo=/\B([A-Z])/g,Vt=Ds(e=>e.replace(Xo,"-$1").toLowerCase()),Us=Ds(e=>e.charAt(0).toUpperCase()+e.slice(1)),Xs=Ds(e=>e?`on${Us(e)}`:""),tt=(e,t)=>!Object.is(e,t),Ss=(e,...t)=>{for(let s=0;s{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},ds=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Wn;const Ls=()=>Wn||(Wn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function wt(e){if(U(e)){const t={};for(let s=0;ss.startsWith("/*")?"":s).split(Yo).forEach(s=>{if(s){const n=s.split(Zo);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Ce(e){let t="";if(re(e))t=e;else if(U(e))for(let s=0;sWe(s,t))}function zn(e){return Object.getPrototypeOf(e)===null&&e[Symbol.toPrimitive]==null&&typeof e.toString!="function"&&typeof e.valueOf!="function"?Ht(e):String(e)}const Ri=e=>!!(e&&e.__v_isRef===!0),p=e=>re(e)?e:e==null?"":U(e)||Q(e)&&(e.toString===Pi||!F(e.toString))?Ri(e)?p(e.value):JSON.stringify(e,Vi,2):String(e),Vi=(e,t)=>Ri(t)?Vi(e,t.value):xt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,i],o)=>(s[Ys(n,o)+" =>"]=i,s),{})}:bt(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Ys(s))}:Ke(t)?Ys(t):Q(t)&&!U(t)&&!Oi(t)?String(t):t,Ys=(e,t="")=>{var s;return Ke(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};let ue;class Ii{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&ue&&(ue.active?(this.parent=ue,this.index=(ue.scopes||(ue.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes){const n=this.scopes.slice();for(t=0,s=n.length;t0&&--this._on===0){if(ue===this)ue=this.prevScope;else{let t=ue;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s0)return;if(es){let t=es;for(es=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Qt;){let t=Qt;for(Qt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function Fi(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Bi(e){let t,s=e.depsTail,n=s;for(;n;){const i=n.prevDep;n.version===-1?(n===s&&(s=i),Tn(n),rl(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=s}function un(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Hi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Hi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===os)||(e.globalVersion=os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!un(e))))return;e.flags|=2;const t=e.dep,s=ne,n=He;ne=e,He=!0;try{Fi(e);const i=e.fn(e._value);(t.version===0||tt(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{ne=s,He=n,Bi(e),e.flags&=-3}}function Tn(e,t=!1){const{dep:s,prevSub:n,nextSub:i}=e;if(n&&(n.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let o=s.computed.deps;o;o=o.nextDep)Tn(o,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function rl(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let He=!0;const Ki=[];function nt(){Ki.push(He),He=!1}function it(){const e=Ki.pop();He=e===void 0?!0:e}function Jn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=ne;ne=void 0;try{t()}finally{ne=s}}}let os=0;class al{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class An{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(!ne||!He||ne===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==ne)s=this.activeLink=new al(ne,this),ne.deps?(s.prevDep=ne.depsTail,ne.depsTail.nextDep=s,ne.depsTail=s):ne.deps=ne.depsTail=s,Wi(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=ne.depsTail,s.nextDep=void 0,ne.depsTail.nextDep=s,ne.depsTail=s,ne.deps===s&&(ne.deps=n)}return s}trigger(t){this.version++,os++,this.notify(t)}notify(t){kn();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{Cn()}}}function Wi(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Wi(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const dn=new WeakMap,Mt=Symbol(""),fn=Symbol(""),Lt=Symbol("");function me(e,t,s){if(He&&ne){let n=dn.get(e);n||dn.set(e,n=new Map);let i=n.get(s);i||(n.set(s,i=new An),i.map=n,i.key=s),i.track()}}function ft(e,t,s,n,i,o){const l=dn.get(e);if(!l){os++;return}const r=a=>{a&&a.trigger()};if(kn(),t==="clear")l.forEach(r);else{const a=U(e),d=a&&$n(s);if(a&&s==="length"){const h=Number(n);l.forEach((b,v)=>{(v==="length"||v===Lt||!Ke(v)&&v>=h)&&r(b)})}else switch((s!==void 0||l.has(void 0))&&r(l.get(s)),d&&r(l.get(Lt)),t){case"add":a?d&&r(l.get("length")):(r(l.get(Mt)),xt(e)&&r(l.get(fn)));break;case"delete":a||(r(l.get(Mt)),xt(e)&&r(l.get(fn)));break;case"set":xt(e)&&r(l.get(Mt));break}}Cn()}function It(e){const t=Y(e);return t===e||(me(t,"iterate",Lt),Me(e))?t:qe(e)?ht(e)?t.map(s=>$t(Ve(s))):t.map($t):t.map(Ve)}function Fs(e){return me(e=Y(e),"iterate",Lt),e}const cl=e=>$t(Ve(e));function ut(e){return qe(e)?ht(e)?cl:$t:Ve}const ul={__proto__:null,[Symbol.iterator](){return Qs(this,Symbol.iterator,ut(this))},concat(...e){return It(this).concat(...e.map(t=>U(t)?It(t):t))},entries(){const e=ut(this);return Qs(this,"entries",t=>(t[1]=e(t[1]),t))},every(e,t){return at(this,"every",e,t,void 0,arguments)},filter(e,t){return at(this,"filter",e,t,s=>s.map(ut(this)),arguments)},find(e,t){return at(this,"find",e,t,s=>ut(this)(s),arguments)},findIndex(e,t){return at(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return at(this,"findLast",e,t,s=>ut(this)(s),arguments)},findLastIndex(e,t){return at(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return at(this,"forEach",e,t,void 0,arguments)},includes(...e){return en(this,"includes",e)},indexOf(...e){return en(this,"indexOf",e)},join(e){return It(this).join(e)},lastIndexOf(...e){return en(this,"lastIndexOf",e)},map(e,t){return at(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return Yn(this,"reduce",e,t)},reduceRight(e,...t){return Yn(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return at(this,"some",e,t,void 0,arguments)},splice(...e){return zt(this,"splice",e)},toReversed(){return It(this).toReversed()},toSorted(e){return It(this).toSorted(e)},toSpliced(...e){return It(this).toSpliced(...e)},unshift(...e){return zt(this,"unshift",e)},values(){return Qs(this,"values",ut(this))}};function Qs(e,t,s){const n=Fs(e),i=n[t],o=i.call(n);if(n!==e&&!Me(e)){if(o[Symbol.toStringTag]==="Array Iterator"){const l=Object.create(Object.getPrototypeOf(o));return l.next=()=>Xn(o.next(),s),i!==qi[t]&&Object.defineProperties(l,{return:{get(){const r=o.return;return typeof r=="function"?r.bind(o):r}},throw:{get(){const r=o.throw;return typeof r=="function"?r.bind(o):r}}}),l}o._next=o.next,o.next=()=>Xn(o._next(),s)}return o}function Xn(e,t){return e.done||(e.value=t(e.value)),e}const qi=Array.prototype;function at(e,t,s,n,i,o){const l=Fs(e),r=l!==e&&!Me(e),a=l[t];if(a!==qi[t]){const b=a.apply(e,o);return r?Ve(b):b}let d=s;if(l!==e)if(r){const b=ut(e);d=function(v,R){return s.call(this,b(v),R,e)}}else s.length>2&&(d=function(b,v){return s.call(this,b,v,e)});const h=a.call(l,d,n);return r&&i?i(h):h}function Yn(e,t,s,n){const i=Fs(e),o=i!==e&&!Me(e);let l=s,r=!1;if(i!==e)if(o){const d=ut(e);r=n.length===0,l=function(h,b,v){return r&&(r=!1,h=d(h)),s.call(this,h,d(b),v,e)}}else s.length>3&&(l=function(d,h,b){return s.call(this,d,h,b,e)});const a=i[t](l,...n);return r?ut(e)(a):a}function en(e,t,s){const n=Y(e);me(n,"iterate",Lt);const i=n[t](...s);return(i===-1||i===!1)&&On(s[0])?(s[0]=Y(s[0]),n[t](...s)):i}function zt(e,t,s=[]){nt(),kn();const n=Y(e)[t].apply(e,s);return Cn(),it(),n}const dl=xn("__proto__,__v_isRef,__isVue"),Gi=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ke));function fl(e){Ke(e)||(e=String(e));const t=Y(this);return me(t,"has",e),t.hasOwnProperty(e)}class zi{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const i=this._isReadonly,o=this._isShallow;if(s==="__v_isReactive")return!i;if(s==="__v_isReadonly")return i;if(s==="__v_isShallow")return o;if(s==="__v_raw")return n===(i?o?wl:Zi:o?Yi:Xi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const l=U(t);if(!i){let a;if(l&&(a=ul[s]))return a;if(s==="hasOwnProperty")return fl}const r=Reflect.get(t,s,fe(t)?t:n);if((Ke(s)?Gi.has(s):dl(s))||(i||me(t,"get",s),o))return r;if(fe(r)){const a=l&&$n(s)?r:r.value;return i&&Q(a)?hn(a):a}return Q(r)?i?hn(r):Kt(r):r}}class Ji extends zi{constructor(t=!1){super(!1,t)}set(t,s,n,i){let o=t[s];const l=U(t)&&$n(s);if(!this._isShallow){const d=qe(o);if(!Me(n)&&!qe(n)&&(o=Y(o),n=Y(n)),!l&&fe(o)&&!fe(n))return d||(o.value=n),!0}const r=l?Number(s)e,_s=e=>Reflect.getPrototypeOf(e);function bl(e,t,s){return function(...n){const i=this.__v_raw,o=Y(i),l=xt(o),r=e==="entries"||e===Symbol.iterator&&l,a=e==="keys"&&l,d=i[e](...n),h=s?pn:t?$t:Ve;return!t&&me(o,"iterate",a?fn:Mt),de(Object.create(d),{next(){const{value:b,done:v}=d.next();return v?{value:b,done:v}:{value:r?[h(b[0]),h(b[1])]:h(b),done:v}}})}}function ys(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function _l(e,t){const s={get(i){const o=this.__v_raw,l=Y(o),r=Y(i);e||(tt(i,r)&&me(l,"get",i),me(l,"get",r));const{has:a}=_s(l),d=t?pn:e?$t:Ve;if(a.call(l,i))return d(o.get(i));if(a.call(l,r))return d(o.get(r));o!==l&&o.get(i)},get size(){const i=this.__v_raw;return!e&&me(Y(i),"iterate",Mt),i.size},has(i){const o=this.__v_raw,l=Y(o),r=Y(i);return e||(tt(i,r)&&me(l,"has",i),me(l,"has",r)),i===r?o.has(i):o.has(i)||o.has(r)},forEach(i,o){const l=this,r=l.__v_raw,a=Y(r),d=t?pn:e?$t:Ve;return!e&&me(a,"iterate",Mt),r.forEach((h,b)=>i.call(o,d(h),d(b),l))}};return de(s,e?{add:ys("add"),set:ys("set"),delete:ys("delete"),clear:ys("clear")}:{add(i){const o=Y(this),l=_s(o),r=Y(i),a=!t&&!Me(i)&&!qe(i)?r:i;return l.has.call(o,a)||tt(i,a)&&l.has.call(o,i)||tt(r,a)&&l.has.call(o,r)||(o.add(a),ft(o,"add",a,a)),this},set(i,o){!t&&!Me(o)&&!qe(o)&&(o=Y(o));const l=Y(this),{has:r,get:a}=_s(l);let d=r.call(l,i);d||(i=Y(i),d=r.call(l,i));const h=a.call(l,i);return l.set(i,o),d?tt(o,h)&&ft(l,"set",i,o):ft(l,"add",i,o),this},delete(i){const o=Y(this),{has:l,get:r}=_s(o);let a=l.call(o,i);a||(i=Y(i),a=l.call(o,i)),r&&r.call(o,i);const d=o.delete(i);return a&&ft(o,"delete",i,void 0),d},clear(){const i=Y(this),o=i.size!==0,l=i.clear();return o&&ft(i,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(i=>{s[i]=bl(i,e,t)}),s}function En(e,t){const s=_l(e,t);return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_isShallow"?t:i==="__v_raw"?n:Reflect.get(X(s,i)&&i in n?s:n,i,o)}const yl={get:En(!1,!1)},vl={get:En(!1,!0)},xl={get:En(!0,!1)};const Xi=new WeakMap,Yi=new WeakMap,Zi=new WeakMap,wl=new WeakMap;function $l(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Kt(e){return qe(e)?e:Pn(e,!1,hl,yl,Xi)}function Sl(e){return Pn(e,!1,gl,vl,Yi)}function hn(e){return Pn(e,!0,ml,xl,Zi)}function Pn(e,t,s,n,i){if(!Q(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const o=i.get(e);if(o)return o;const l=$l(Go(e));if(l===0)return e;const r=new Proxy(e,l===2?n:s);return i.set(e,r),r}function ht(e){return qe(e)?ht(e.__v_raw):!!(e&&e.__v_isReactive)}function qe(e){return!!(e&&e.__v_isReadonly)}function Me(e){return!!(e&&e.__v_isShallow)}function On(e){return e?!!e.__v_raw:!1}function Y(e){const t=e&&e.__v_raw;return t?Y(t):e}function kl(e){return!X(e,"__v_skip")&&Object.isExtensible(e)&&Mi(e,"__v_skip",!0),e}const Ve=e=>Q(e)?Kt(e):e,$t=e=>Q(e)?hn(e):e;function fe(e){return e?e.__v_isRef===!0:!1}function ot(e){return Cl(e,!1)}function Cl(e,t){return fe(e)?e:new Tl(e,t)}class Tl{constructor(t,s){this.dep=new An,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:Y(t),this._value=s?t:Ve(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||Me(t)||qe(t);t=n?t:Y(t),tt(t,s)&&(this._rawValue=t,this._value=n?t:Ve(t),this.dep.trigger())}}function c(e){return fe(e)?e.value:e}const Al={get:(e,t,s)=>t==="__v_raw"?e:c(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const i=e[t];return fe(i)&&!fe(s)?(i.value=s,!0):Reflect.set(e,t,s,n)}};function Qi(e){return ht(e)?e:new Proxy(e,Al)}class El{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new An(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ne!==this)return Li(this,!0),!0}get value(){const t=this.dep.track();return Hi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Pl(e,t,s=!1){let n,i;return F(e)?n=e:(n=e.get,i=e.set),new El(n,i,s)}const vs={},As=new WeakMap;let Pt;function Ol(e,t=!1,s=Pt){if(s){let n=As.get(s);n||As.set(s,n=[]),n.push(e)}}function Ml(e,t,s=te){const{immediate:n,deep:i,once:o,scheduler:l,augmentJob:r,call:a,onStop:d}=s,h=W=>i?W:Me(W)||i===!1||i===0?Ze(W,1):Ze(W);let b,v,R,N,C=!1,w=!1;if(fe(e)?(v=()=>e.value,C=Me(e)):ht(e)?(v=()=>h(e),C=!0):U(e)?(w=!0,C=e.some(W=>ht(W)||Me(W)),v=()=>e.map(W=>{if(fe(W))return W.value;if(ht(W))return h(W);if(F(W))return a?a(W,2):W()})):F(e)?t?v=a?()=>a(e,2):e:v=()=>{if(R){nt();try{R()}finally{it()}}const W=Pt;Pt=b;try{return a?a(e,3,[N]):e(N)}finally{Pt=W}}:v=st,t&&i){const W=v,pe=i===!0?1/0:i;v=()=>Ze(W(),w?pe+1:pe)}const z=ji(),K=()=>{b.stop(),z&&z.active&&wn(z.effects,b)};let oe=!1;if(o&&t){const W=t;t=(...pe)=>{oe=!0;try{return W(...pe)}finally{K()}}}let le=w?new Array(e.length).fill(vs):vs;const Te=W=>{if(!(oe||!(b.flags&1)||!b.dirty&&!W))if(t){const pe=b.run();if(W||i||C||(w?pe.some((je,lt)=>tt(je,le[lt])):tt(pe,le))){const je=Pt;nt();try{R&&R(),Pt=b;const lt=[pe,le===vs?void 0:w&&le[0]===vs?[]:le,N];le=pe,a?a(t,3,lt):t(...lt)}finally{Pt=je,it()}}}else b.run()};return r&&r(Te),b=new Di(v),b.scheduler=l?()=>l(Te,!1):Te,N=W=>Ol(W,!1,b),R=b.onStop=()=>{const W=As.get(b);if(W){if(a)a(W,4);else for(const pe of W)pe();As.delete(b)}},d&&(b.onStop=()=>{R(),d()}),t?n?Te(!0):le=b.run():l?l(Te.bind(null,!0),!0):b.run(),K.pause=b.pause.bind(b),K.resume=b.resume.bind(b),K.stop=K,K}function Ze(e,t=1/0,s){if(t<=0||!Q(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,fe(e))Ze(e.value,t,s);else if(U(e))if(ht(e)&&!qe(e)&&!Me(e)){const n=Y(e);me(n,"iterate",Lt);for(let i=0;i{Ze(n,t,s)});else if(Oi(e)){for(const i in e)Ze(e[i],t,s);const n=Y(e);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Ze(e[i],t,s)}return e}function fs(e,t,s,n){try{return n?e(...n):e()}catch(i){Bs(i,t,s)}}function Ge(e,t,s,n){if(F(e)){const i=fs(e,t,s,n);return i&&Ei(i)&&i.catch(o=>{Bs(o,t,s,void 0,!0)}),i}if(U(e)){const i=[];for(let o=0;o>>1,i=$e[n],o=ls(i);o=ls(s)?$e.push(e):$e.splice(Rl(t),0,e),e.flags|=1,so()}}function so(){Es||(Es=eo.then(oo))}function Vl(e){if(!U(e))yt&&e.id===-1?yt.splice(jt+1,0,e):e.flags&1||(Qe.push(e),e.flags|=1);else for(let t=0;t=t))continue;$e.splice(n,1),n=e?n-1:Be,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function io(e,t,s=0){if(Qe.length){let n=Qe,i=0;if(t){n=[];for(let l=0;lls(l)-ls(r));if(Qe.length=i,yt){for(let l=0;le.id==null?e.flags&2?-1:1/0:e.id;function oo(e){try{for(Be=0;Be<$e.length;Be++){const t=$e[Be];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),fs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Be<$e.length;Be++){const t=$e[Be];t&&(t.flags&=-2)}Be=-1,$e.length=0,io(),Es=null,($e.length||Qe.length)&&oo()}}let ge=null,lo=null;function Ps(e){const t=ge;return ge=e,lo=e&&e.type.__scopeId||null,t}function Ie(e,t=ge,s){if(!t||e._n)return e;const n=(...i)=>{n._d&&ui(-1);const o=Ps(t),l=mt.length;let r;try{r=e(...i)}finally{for(let a=mt.length;a>l;a--)In();Ps(o),n._d&&ui(1)}return r};return n._n=!0,n._c=!0,n._d=!0,n}function B(e,t){if(ge===null)return e;const s=Gs(ge),n=e.dirs||(e.dirs=[]);for(let i=0;i1)return s&&F(t)?t.call(n&&n.proxy):t}}const Dl=Symbol.for("v-scx"),Ul=()=>ks(Dl);function Cs(e,t,s){return ro(e,t,s)}function ro(e,t,s=te){const{immediate:n,deep:i,flush:o,once:l}=s,r=de({},s),a=t&&n||!t&&o!=="post";let d;if(us){if(o==="sync"){const N=Ul();d=N.__watcherHandles||(N.__watcherHandles=[])}else if(!a){const N=()=>{};return N.stop=st,N.resume=st,N.pause=st,N}}let h=ye,b;if(h&&ji()!==h.scope)if(h.scope.active){const N=h.scope.run(()=>new Ii);N.run(()=>ll(()=>Promise.resolve().then(()=>{h=null,b&&(b.i=null)}))),r.onStop=()=>N.stop()}else h=null;r.call=(N,C,w)=>Ge(N,h,C,w);let v=!1;o==="post"?r.scheduler=N=>{N.i=h,we(N,h&&h.suspense)}:o!=="sync"&&(v=!0,r.scheduler=(N,C)=>{C?N():Mn(N)}),r.augmentJob=N=>{b=N,t&&(N.flags|=4),v&&(N.flags|=2,h&&(N.id=h.uid,N.i=h))};const R=Ml(e,t,r);return us&&(d?d.push(R):a&&R()),R}function Ll(e,t,s){const n=this.proxy,i=re(e)?e.includes(".")?ao(n,e):()=>n[e]:e.bind(n,n);let o;F(t)?o=t:(o=t.handler,s=t);const l=ps(this),r=ro(i,o.bind(n),s);return l(),r}function ao(e,t){const s=t.split(".");return()=>{let n=e;for(let i=0;ie.__isTeleport,sn=Symbol("_leaveCb");function Bl(e){let t=e[0];if(e.length>1){for(const s of e)if(s.type!==Ue){t=s;break}}return t}function co(e){if(!Nn(e))return Hs(e.type)&&e.children?Bl(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:s}=e;if(s){if(t&16)return s[0];if(t&32&&F(s.default))return s.default()}}function ts(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const s=e.component.subTree;ts(Hs(s.type)&&co(s)||s,t)}else if(e.shapeFlag&128){const s=e.suspense;if(s){const n=s.isHydrating?s.pendingBranch:s.activeBranch;n&&ts(n,t.clone(n))}else e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)}else if(e.transition=t,e.type===V&&U(e.children)){const s=xo(e.children,!1);s&&ts(s,t)}}function mn(e){if(e.component)return mn(e.component.subTree);if(e.type===V){const t=U(e.children)&&xo(e.children,!1);return t?mn(t):void 0}if(e.type!==Ue)return e}function _e(e,t){return F(e)?de({name:e.name},t,{setup:e}):e}function uo(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Zn(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Os=new WeakMap;function ss(e,t,s,n,i=!1){if(U(e)){e.forEach((C,w)=>ss(C,t&&(U(t)?t[w]:t),s,n,i));return}if(Dt(n)&&!i){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&ss(e,t,s,n.component.subTree);return}const o=n.shapeFlag&4?Gs(n.component):n.el,l=i?null:o,{i:r,r:a}=e,d=t&&t.r,h=r.refs===te?r.refs={}:r.refs,b=r.setupState,v=Y(b),R=b===te?Ai:C=>Zn(h,C)?!1:X(v,C),N=(C,w)=>!(w&&Zn(h,w));if(d!=null&&d!==a){if(Qn(t),re(d))h[d]=null,R(d)&&(b[d]=null);else if(fe(d)){const C=t;N(d,C.k)&&(d.value=null),C.k&&(h[C.k]=null)}}if(F(a))fs(a,r,12,[l,h]);else{const C=re(a),w=fe(a);if(C||w){const z=()=>{if(e.f){const K=C?R(a)?b[a]:h[a]:N()||!e.k?a.value:h[e.k];if(i)U(K)&&wn(K,o);else if(U(K))K.includes(o)||K.push(o);else if(C)h[a]=[o],R(a)&&(b[a]=h[a]);else{const oe=[o];N(a,e.k)&&(a.value=oe),e.k&&(h[e.k]=oe)}}else C?(h[a]=l,R(a)&&(b[a]=l)):w&&(N(a,e.k)&&(a.value=l),e.k&&(h[e.k]=l))};if(l){const K=()=>{z(),Os.delete(e)};K.id=-1,Os.set(e,K),we(K,s)}else Qn(e),z()}}}function Qn(e){const t=Os.get(e);t&&(t.flags|=8,Os.delete(e))}Ls().requestIdleCallback;Ls().cancelIdleCallback;const Dt=e=>!!e.type.__asyncLoader,Nn=e=>e.type.__isKeepAlive;function Hl(e,t){fo(e,"a",t)}function Kl(e,t){fo(e,"da",t)}function fo(e,t,s=ye){const n=e.__wdc||(e.__wdc=()=>{let i=s;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(rs(t,n,s),s){let i=s.parent;for(;i&&i.parent;)Nn(i.parent.vnode)&&Wl(n,t,s,i),i=i.parent}}function Wl(e,t,s,n){const i=rs(t,e,n,!0),o=rs("um",()=>wn(n[t],i),s);o.flags=16}function rs(e,t,s=ye,n=!1){if(s){const i=s[e]||(s[e]=[]),o=t.__weh||(t.__weh=(...l)=>{nt();const r=ps(s),a=Ge(t,s,e,l);return r(),it(),a});return n?i.unshift(o):i.push(o),o}}const _t=e=>(t,s=ye)=>{(!us||e==="sp")&&rs(e,(...n)=>t(...n),s)},ql=_t("bm"),po=_t("m"),Gl=_t("bu"),zl=_t("u"),Jl=_t("bum"),Xl=_t("um"),Yl=_t("sp"),Zl=_t("rtg"),Ql=_t("rtc");function er(e,t=ye){rs("ec",e,t)}const tr="components",ho=Symbol.for("v-ndc");function ei(e){return re(e)?sr(tr,e,!1)||e:e||ho}function sr(e,t,s=!0,n=!1){const i=ge||ye;if(i){const o=i.type;{const r=Lr(o,!1);if(r&&(r===t||r===Se(t)||r===Us(Se(t))))return o}const l=ti(i[e]||o[e],t)||ti(i.appContext[e],t);return!l&&n?o:l}}function ti(e,t){return e&&(e[t]||e[Se(t)]||e[Us(Se(t))])}function H(e,t,s,n){let i;const o=s,l=U(e);if(l||re(e)){const r=l&&ht(e);let a=!1,d=!1;r&&(a=!Me(e),d=qe(e),e=Fs(e)),i=new Array(e.length);for(let h=0,b=e.length;ht(r,a,void 0,o));else{const r=Object.keys(e);i=new Array(r.length);for(let a=0,d=r.length;a0;return g(),ke(V,null,[Ne("slot",d,n)],h?-2:64)}let l=e[t];l&&l._c&&(l._d=!1);const r=mt.length;g();let a;try{const d=l&&go(l(s)),h=s.key||o||d&&d.key;a=ke(V,{key:(h&&!Ke(h)?h:`_${t}`)+(!d&&n?"_fb":"")},d||(n?n():[]),d&&e._===1?64:-2)}catch(d){for(let h=mt.length;h>r;h--)In();throw d}finally{l&&l._c&&(l._d=!0)}return a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),a}function go(e){return e.some(t=>qs(t)?!(t.type===Ue||t.type===V&&!go(t.children)):!0)?e:null}const gn=e=>e?Do(e)?Gs(e):gn(e.parent):null,ns=de(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=>gn(e.parent),$root:e=>gn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>_o(e),$forceUpdate:e=>e.f||(e.f=()=>{Mn(e.update)}),$nextTick:e=>e.n||(e.n=to.bind(e.proxy)),$watch:e=>Ll.bind(e)}),nn=(e,t)=>e!==te&&!e.__isScriptSetup&&X(e,t),nr={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:i,props:o,accessCache:l,type:r,appContext:a}=e;if(t[0]!=="$"){const v=l[t];if(v!==void 0)switch(v){case 1:return n[t];case 2:return i[t];case 4:return s[t];case 3:return o[t]}else{if(nn(n,t))return l[t]=1,n[t];if(i!==te&&X(i,t))return l[t]=2,i[t];if(X(o,t))return l[t]=3,o[t];if(s!==te&&X(s,t))return l[t]=4,s[t];bn&&(l[t]=0)}}const d=ns[t];let h,b;if(d)return t==="$attrs"&&me(e.attrs,"get",""),d(e);if((h=r.__cssModules)&&(h=h[t]))return h;if(s!==te&&X(s,t))return l[t]=4,s[t];if(b=a.config.globalProperties,X(b,t))return b[t]},set({_:e},t,s){const{data:n,setupState:i,ctx:o}=e;return nn(i,t)?(i[t]=s,!0):n!==te&&X(n,t)?(n[t]=s,!0):X(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:i,props:o,type:l}},r){let a;return!!(s[r]||e!==te&&r[0]!=="$"&&X(e,r)||nn(t,r)||X(o,r)||X(n,r)||X(ns,r)||X(i.config.globalProperties,r)||(a=l.__cssModules)&&a[r])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:X(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function si(e){return U(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let bn=!0;function ir(e){const t=_o(e),s=e.proxy,n=e.ctx;bn=!1,t.beforeCreate&&ni(t.beforeCreate,e,"bc");const{data:i,computed:o,methods:l,watch:r,provide:a,inject:d,created:h,beforeMount:b,mounted:v,beforeUpdate:R,updated:N,activated:C,deactivated:w,beforeDestroy:z,beforeUnmount:K,destroyed:oe,unmounted:le,render:Te,renderTracked:W,renderTriggered:pe,errorCaptured:je,serverPrefetch:lt,expose:kt,inheritAttrs:Wt,components:hs,directives:ms,filters:Js}=t;if(d&&or(d,n,null),l)for(const ae in l){const se=l[ae];F(se)&&(n[ae]=se.bind(s))}if(i){const ae=i.call(s,s);Q(ae)&&(e.data=Kt(ae))}if(bn=!0,o)for(const ae in o){const se=o[ae],Ct=F(se)?se.bind(s,s):F(se.get)?se.get.bind(s,s):st,gs=!F(se)&&F(se.set)?se.set.bind(s):st,Tt=vt({get:Ct,set:gs});Object.defineProperty(n,ae,{enumerable:!0,configurable:!0,get:()=>Tt.value,set:Le=>Tt.value=Le})}if(r)for(const ae in r)bo(r[ae],n,s,ae);if(a){const ae=F(a)?a.call(s):a;Reflect.ownKeys(ae).forEach(se=>{jl(se,ae[se])})}h&&ni(h,e,"c");function ve(ae,se){U(se)?se.forEach(Ct=>ae(Ct.bind(s))):se&&ae(se.bind(s))}if(ve(ql,b),ve(po,v),ve(Gl,R),ve(zl,N),ve(Hl,C),ve(Kl,w),ve(er,je),ve(Ql,W),ve(Zl,pe),ve(Jl,K),ve(Xl,le),ve(Yl,lt),U(kt))if(kt.length){const ae=e.exposed||(e.exposed={});kt.forEach(se=>{Object.defineProperty(ae,se,{get:()=>s[se],set:Ct=>s[se]=Ct,enumerable:!0})})}else e.exposed||(e.exposed={});Te&&e.render===st&&(e.render=Te),Wt!=null&&(e.inheritAttrs=Wt),hs&&(e.components=hs),ms&&(e.directives=ms),lt&&uo(e)}function or(e,t,s=st){U(e)&&(e=_n(e));for(const n in e){const i=e[n];let o;Q(i)?"default"in i?o=ks(i.from||n,i.default,!0):o=ks(i.from||n):o=ks(i),fe(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:l=>o.value=l}):t[n]=o}}function ni(e,t,s){Ge(U(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function bo(e,t,s,n){let i=n.includes(".")?ao(s,n):()=>s[n];if(re(e)){const o=t[e];F(o)&&Cs(i,o)}else if(F(e))Cs(i,e.bind(s));else if(Q(e))if(U(e))e.forEach(o=>bo(o,t,s,n));else{const o=F(e.handler)?e.handler.bind(s):t[e.handler];F(o)&&Cs(i,o,e)}}function _o(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:l}}=e.appContext,r=o.get(t);let a;return r?a=r:!i.length&&!s&&!n?a=t:(a={},i.length&&i.forEach(d=>Ms(a,d,l,!0)),Ms(a,t,l)),Q(t)&&o.set(t,a),a}function Ms(e,t,s,n=!1){const{mixins:i,extends:o}=t;o&&Ms(e,o,s,!0),i&&i.forEach(l=>Ms(e,l,s,!0));for(const l in t)if(!(n&&l==="expose")){const r=lr[l]||s&&s[l];e[l]=r?r(e[l],t[l]):t[l]}return e}const lr={data:ii,props:oi,emits:oi,methods:Xt,computed:Xt,beforeCreate:xe,created:xe,beforeMount:xe,mounted:xe,beforeUpdate:xe,updated:xe,beforeDestroy:xe,beforeUnmount:xe,destroyed:xe,unmounted:xe,activated:xe,deactivated:xe,errorCaptured:xe,serverPrefetch:xe,components:Xt,directives:Xt,watch:ar,provide:ii,inject:rr};function ii(e,t){return t?e?function(){return de(F(e)?e.call(this,this):e,F(t)?t.call(this,this):t)}:t:e}function rr(e,t){return Xt(_n(e),_n(t))}function _n(e){if(U(e)){const t={};for(let s=0;st==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Se(t)}Modifiers`]||e[`${Vt(t)}Modifiers`];function fr(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||te;let i=s;const o=t.startsWith("update:"),l=o&&dr(n,t.slice(7));l&&(l.trim&&(i=s.map(h=>re(h)?h.trim():h)),l.number&&(i=i.map(ds)));let r,a=n[r=Xs(t)]||n[r=Xs(Se(t))];!a&&o&&(a=n[r=Xs(Vt(t))]),a&&Ge(a,e,6,i);const d=n[r+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[r])return;e.emitted[r]=!0,Ge(d,e,6,i)}}const pr=new WeakMap;function vo(e,t,s=!1){const n=s?pr:t.emitsCache,i=n.get(e);if(i!==void 0)return i;const o=e.emits;let l={},r=!1;if(!F(e)){const a=d=>{const h=vo(d,t,!0);h&&(r=!0,de(l,h))};!s&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!o&&!r?(Q(e)&&n.set(e,null),null):(U(o)?o.forEach(a=>l[a]=null):de(l,o),Q(e)&&n.set(e,l),l)}function Ks(e,t){return!e||!Is(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),X(e,t[0].toLowerCase()+t.slice(1))||X(e,Vt(t))||X(e,t))}function li(e){const{type:t,vnode:s,proxy:n,withProxy:i,propsOptions:[o],slots:l,attrs:r,emit:a,render:d,renderCache:h,props:b,data:v,setupState:R,ctx:N,inheritAttrs:C}=e,w=Ps(e);let z,K;try{if(s.shapeFlag&4){const le=i||n,Te=le;z=et(d.call(Te,le,h,b,R,v,N)),K=r}else{const le=t;z=et(le.length>1?le(b,{attrs:r,slots:l,emit:a}):le(b,null)),K=t.props?r:hr(r)}}catch(le){mt.length=0,Bs(le,e,1),z=Ne(Ue)}let oe=z;if(K&&C!==!1){const le=Object.keys(K),{shapeFlag:Te}=oe;le.length&&Te&7&&(o&&le.some(js)&&(K=mr(K,o)),oe=Ft(oe,K,!1,!0))}if(s.dirs&&(oe=Ft(oe,null,!1,!0),oe.dirs=oe.dirs?oe.dirs.concat(s.dirs):s.dirs),s.transition){const le=Hs(oe.type)&&co(oe)||oe;ts(le,s.transition)}return z=oe,Ps(w),z}function xo(e,t=!0){let s;for(let n=0;n{let t;for(const s in e)(s==="class"||s==="style"||Is(s))&&((t||(t={}))[s]=e[s]);return t},mr=(e,t)=>{const s={};for(const n in e)(!js(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function gr(e,t,s){const{props:n,children:i,component:o}=e,{props:l,children:r,patchFlag:a}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&a>=0){if(a&1024)return!0;if(a&16)return n?ri(n,l,d):!!l;if(a&8){const h=t.dynamicProps;for(let b=0;bObject.create($o),ko=e=>Object.getPrototypeOf(e)===$o;function _r(e,t,s,n=!1){const i={},o=So();e.propsDefaults=Object.create(null),Co(e,t,i,o);for(const l in e.propsOptions[0])l in i||(i[l]=void 0);s?e.props=n?i:Sl(i):e.type.props?e.props=i:e.props=o,e.attrs=o}function yr(e,t,s,n){const{props:i,attrs:o,vnode:{patchFlag:l}}=e,r=Y(i),[a]=e.propsOptions;let d=!1;if((n||l>0)&&!(l&16)){if(l&8){const h=e.vnode.dynamicProps;for(let b=0;b{a=!0;const[v,R]=To(b,t,!0);de(l,v),R&&r.push(...R)};!s&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!o&&!a)return Q(e)&&n.set(e,Ot),Ot;if(U(o))for(let h=0;he==="_"||e==="_ctx"||e==="$stable",Vn=e=>U(e)?e.map(et):[et(e)],xr=(e,t,s)=>{if(t._n)return t;const n=Ie((...i)=>Vn(t(...i)),s);return n._c=!1,n},Ao=(e,t,s)=>{const n=e._ctx;for(const i in e){if(Rn(i))continue;const o=e[i];if(F(o))t[i]=xr(i,o,n);else if(o!=null){const l=Vn(o);t[i]=()=>l}}},Eo=(e,t)=>{const s=Vn(t);e.slots.default=()=>s},Po=(e,t,s)=>{for(const n in t)(s||!Rn(n))&&(e[n]=t[n])},wr=(e,t,s)=>{const n=e.slots=So();if(e.vnode.shapeFlag&32){const i=t._;i?(Po(n,t,s),s&&Mi(n,"_",i,!0)):Ao(t,n)}else t&&Eo(e,t)},$r=(e,t,s)=>{const{vnode:n,slots:i}=e;let o=!0,l=te;if(n.shapeFlag&32){const r=t._;r?s&&r===1?o=!1:Po(i,t,s):(o=!t.$stable,Ao(t,i)),l=t}else t&&(Eo(e,t),l={default:1});if(o)for(const r in i)!Rn(r)&&l[r]==null&&delete i[r]},we=Er;function Sr(e){return kr(e)}function kr(e,t){const s=Ls();s.__VUE__=!0;const{insert:n,remove:i,patchProp:o,createElement:l,createText:r,createComment:a,setText:d,setElementText:h,parentNode:b,nextSibling:v,setScopeId:R=st,insertStaticContent:N}=e,C=(f,m,x,T=null,$=null,k=null,P=void 0,E=null,A=!!m.dynamicChildren)=>{if(f===m)return;f&&!Jt(f,m)&&(T=bs(f),Le(f,$,k,!0),f=null),m.patchFlag===-2&&(A=!1,m.dynamicChildren=null),m.dynamicChildren&&f&&f.dynamicChildren&&f.dynamicChildren.hasOnce&&(m.dynamicChildren===Ot&&(m.dynamicChildren=[]),m.dynamicChildren.hasOnce=!0);const{type:S,ref:j,shapeFlag:O}=m;switch(S){case Ws:w(f,m,x,T);break;case Ue:z(f,m,x,T);break;case ln:f==null&&K(m,x,T,P);break;case V:hs(f,m,x,T,$,k,P,E,A);break;default:O&1?Te(f,m,x,T,$,k,P,E,A):O&6?ms(f,m,x,T,$,k,P,E,A):(O&64||O&128)&&S.process(f,m,x,T,$,k,P,E,A,Gt)}j!=null&&$?ss(j,f&&f.ref,k,m||f,!m):j==null&&f&&f.ref!=null&&ss(f.ref,null,k,f,!0)},w=(f,m,x,T)=>{if(f==null)n(m.el=r(m.children),x,T);else{const $=m.el=f.el;m.children!==f.children&&d($,m.children)}},z=(f,m,x,T)=>{f==null?n(m.el=a(m.children||""),x,T):m.el=f.el},K=(f,m,x,T)=>{[f.el,f.anchor]=N(f.children,m,x,T,f.el,f.anchor)},oe=({el:f,anchor:m},x,T)=>{let $;for(;f&&f!==m;)$=v(f),n(f,x,T),f=$;n(m,x,T)},le=({el:f,anchor:m})=>{let x;for(;f&&f!==m;)x=v(f),i(f),f=x;i(m)},Te=(f,m,x,T,$,k,P,E,A)=>{if(m.type==="svg"?P="svg":m.type==="math"&&(P="mathml"),f==null)W(m,x,T,$,k,P,E,A);else{const S=f.el&&f.el._isVueCE?f.el:null;try{S&&S._beginPatch(),lt(f,m,$,k,P,E,A)}finally{S&&S._endPatch()}}},W=(f,m,x,T,$,k,P,E)=>{let A,S;const{props:j,shapeFlag:O,transition:D,dirs:L}=f;if(A=f.el=l(f.type,k,j&&j.is,j),O&8?h(A,f.children):O&16&&je(f.children,A,null,T,$,on(f,k),P,E),L&&At(f,null,T,"created"),pe(A,f,f.scopeId,P,T),j){for(const ee in j)ee!=="value"&&!Zt(ee)&&o(A,ee,null,j[ee],k,T);"value"in j&&o(A,"value",null,j.value,k),(S=j.onVnodeBeforeMount)&&Ye(S,T,f)}L&&At(f,null,T,"beforeMount");const J=Cr($,D);J?D.beforeEnter(A):D&&!D.persisted&&(A[Ar]=!0),n(A,m,x),((S=j&&j.onVnodeMounted)||J||L)&&we(()=>{S&&Ye(S,T,f),J&&D.enter(A),L&&At(f,null,T,"mounted")},$)},pe=(f,m,x,T,$)=>{if(x&&R(f,x),T)for(let k=0;k{for(let S=A;S{const E=m.el=f.el;let{patchFlag:A,dynamicChildren:S,dirs:j}=m;A|=f.patchFlag&16;const O=f.props||te,D=m.props||te;let L;if(x&&Et(x,!1),(L=D.onVnodeBeforeUpdate)&&Ye(L,x,m,f),j&&At(m,f,x,"beforeUpdate"),x&&Et(x,!0),S&&(!f.dynamicChildren||f.dynamicChildren.length!==S.length)&&(A=0,P=!1,S=null),(O.innerHTML&&D.innerHTML==null||O.textContent&&D.textContent==null)&&h(E,""),S?kt(f.dynamicChildren,S,E,x,T,on(m,$),k):P||se(f,m,E,null,x,T,on(m,$),k,!1),A>0){if(A&16)Wt(E,O,D,x,$);else if(A&2&&O.class!==D.class&&o(E,"class",null,D.class,$),A&4&&o(E,"style",O.style,D.style,$),A&8){const J=m.dynamicProps;for(let ee=0;ee{L&&Ye(L,x,m,f),j&&At(m,f,x,"updated")},T)},kt=(f,m,x,T,$,k,P)=>{for(let E=0;E{if(m!==x){if(m!==te)for(const k in m)!Zt(k)&&!(k in x)&&o(f,k,m[k],null,$,T);for(const k in x){if(Zt(k))continue;const P=x[k],E=m[k];P!==E&&k!=="value"&&o(f,k,E,P,$,T)}"value"in x&&o(f,"value",m.value,x.value,$)}},hs=(f,m,x,T,$,k,P,E,A)=>{const S=m.el=f?f.el:r(""),j=m.anchor=f?f.anchor:r("");let{patchFlag:O,dynamicChildren:D,slotScopeIds:L}=m;L&&(E=E?E.concat(L):L),f==null?(n(S,x,T),n(j,x,T),je(m.children||[],x,j,$,k,P,E,A)):O>0&&O&64&&D&&f.dynamicChildren&&f.dynamicChildren.length===D.length?(kt(f.dynamicChildren,D,x,$,k,P,E),(m.key!=null||$&&m===$.subTree)&&Oo(f,m,!0)):se(f,m,x,j,$,k,P,E,A)},ms=(f,m,x,T,$,k,P,E,A)=>{m.slotScopeIds=E,f==null?m.shapeFlag&512?$.ctx.activate(m,x,T,P,A):Js(m,x,T,$,k,P,A):jn(f,m,A)},Js=(f,m,x,T,$,k,P)=>{const E=f.component=Rr(f,T,$);if(Nn(f)&&(E.ctx.renderer=Gt),Ir(E,!1,P),E.asyncDep){if($&&$.registerDep(E,ve,P,k),!f.el){const A=E.subTree=Ne(Ue);z(null,A,m,x),f.placeholder=A.el}}else ve(E,f,m,x,$,k,P)},jn=(f,m,x)=>{const T=m.component=f.component;if(gr(f,m,x))if(T.asyncDep&&!T.asyncResolved){m.el=f.el,m.placeholder=f.placeholder,ae(T,m,x);return}else T.next=m,T.update();else m.el=f.el,m.placeholder=f.placeholder,T.vnode=m},ve=(f,m,x,T,$,k,P)=>{const E=()=>{if(f.isMounted){let{next:O,bu:D,u:L,parent:J,vnode:ee}=f;{const Je=Mo(f);if(Je){O&&(O.el=ee.el,ae(f,O,P)),Je.asyncDep.then(()=>{const rt=()=>{f.job.flags&8||($&&$.pendingBranch?we(rt,$):S())};rt.flags=48,we(rt,$)});return}}let Z=O,ce;Et(f,!1),O?(O.el=ee.el,ae(f,O,P)):O=ee,D&&Ss(D),(ce=O.props&&O.props.onVnodeBeforeUpdate)&&Ye(ce,J,O,ee),Et(f,!0);const he=li(f),Fe=f.subTree;f.subTree=he,C(Fe,he,b(Fe.el||is(Fe)),bs(Fe),f,$,k),O.el=he.el,Z===null&&br(f,he.el),L&&we(L,$),(ce=O.props&&O.props.onVnodeUpdated)&&we(()=>Ye(ce,J,O,ee),$)}else{let O;const{el:D,props:L}=m,{bm:J,m:ee,parent:Z,root:ce,type:he}=f,Fe=Dt(m);Et(f,!1),J&&Ss(J),!Fe&&(O=L&&L.onVnodeBeforeMount)&&Ye(O,Z,m),Et(f,!0);{ce.ce&&ce.ce._hasShadowRoot()&&ce.ce._injectChildStyle(he,f.parent?f.parent.type:void 0);const Je=f.subTree=li(f);C(null,Je,x,T,f,$,k),m.el=Je.el}if(ee&&we(ee,$),!Fe&&(O=L&&L.onVnodeMounted)){const Je=m;we(()=>Ye(O,Z,Je),$)}(m.shapeFlag&256||Z&&Dt(Z.vnode)&&Z.vnode.shapeFlag&256)&&f.a&&we(f.a,$),f.isMounted=!0,m=x=T=null}};f.scope.on();const A=f.effect=new Di(E);f.scope.off();const S=f.update=A.run.bind(A),j=f.job=A.runIfDirty.bind(A);j.i=f,j.id=f.uid,A.scheduler=()=>Mn(j),Et(f,!0),S()},ae=(f,m,x)=>{m.component=f;const T=f.vnode.props;f.vnode=m,f.next=null,yr(f,m.props,T,x),$r(f,m.children,x),nt(),no(f),it()},se=(f,m,x,T,$,k,P,E,A=!1)=>{const S=f&&f.children,j=f?f.shapeFlag:0,O=m.children,{patchFlag:D,shapeFlag:L}=m;if(D>0){if(D&128){gs(S,O,x,T,$,k,P,E,A);return}else if(D&256){Ct(S,O,x,T,$,k,P,E,A);return}}L&8?(j&16&&qt(S,$,k),O!==S&&h(x,O)):j&16?L&16?gs(S,O,x,T,$,k,P,E,A):qt(S,$,k,!0):(j&8&&h(x,""),L&16&&je(O,x,T,$,k,P,E,A))},Ct=(f,m,x,T,$,k,P,E,A)=>{f=f||Ot,m=m||Ot;const S=f.length,j=m.length,O=Math.min(S,j);let D;for(D=0;Dj?qt(f,$,k,!0,!1,O):je(m,x,T,$,k,P,E,A,O)},gs=(f,m,x,T,$,k,P,E,A)=>{let S=0;const j=m.length;let O=f.length-1,D=j-1;for(;S<=O&&S<=D;){const L=f[S],J=m[S]=A?dt(m[S]):et(m[S]);if(Jt(L,J))C(L,J,x,null,$,k,P,E,A);else break;S++}for(;S<=O&&S<=D;){const L=f[O],J=m[D]=A?dt(m[D]):et(m[D]);if(Jt(L,J))C(L,J,x,null,$,k,P,E,A);else break;O--,D--}if(S>O){if(S<=D){const L=D+1,J=LD)for(;S<=O;)Le(f[S],$,k,!0),S++;else{const L=S,J=S,ee=new Map;for(S=J;S<=D;S++){const Ee=m[S]=A?dt(m[S]):et(m[S]);Ee.key!=null&&ee.set(Ee.key,S)}let Z,ce=0;const he=D-J+1;let Fe=!1,Je=0;const rt=new Array(he);for(S=0;S=he){Le(Ee,$,k,!0);continue}let Xe;if(Ee.key!=null)Xe=ee.get(Ee.key);else for(Z=J;Z<=D;Z++)if(rt[Z-J]===0&&Jt(Ee,m[Z])){Xe=Z;break}Xe===void 0?Le(Ee,$,k,!0):(rt[Xe-J]=S+1,Xe>=Je?Je=Xe:Fe=!0,C(Ee,m[Xe],x,null,$,k,P,E,A),ce++)}const Fn=Fe?Tr(rt):Ot;for(Z=Fn.length-1,S=he-1;S>=0;S--){const Ee=J+S,Xe=m[Ee],Bn=m[Ee+1],Hn=Ee+1{const{el:k,type:P,transition:E,children:A,shapeFlag:S}=f;if(S&6){Tt(f.component.subTree,m,x,T);return}if(S&128){f.suspense.move(m,x,T);return}if(S&64){P.move(f,m,x,Gt);return}if(P===V){n(k,m,x);for(let O=0;OE.enter(k),$));else{const{leave:O,delayLeave:D,afterLeave:L}=E,J=()=>{f.ctx.isUnmounted?i(k):n(k,m,x)},ee=()=>{const Z=k._isLeaving||!!k[sn];k._isLeaving&&k[sn](!0),E.persisted&&!Z?J():O(k,()=>{J(),L&&L()})};D?D(k,J,ee):ee()}else n(k,m,x)},Le=(f,m,x,T=!1,$=!1)=>{const{type:k,props:P,ref:E,children:A,dynamicChildren:S,shapeFlag:j,patchFlag:O,dirs:D,cacheIndex:L,memo:J}=f;if((O===-2||S&&S.hasOnce)&&($=!1),E!=null&&(nt(),ss(E,null,x,f,!0),it()),L!=null&&(!f.ctx||f.ctx===m)&&(m.renderCache[L]=void 0),j&256&&m.ctx.deactivate(f))return;const ee=j&1&&D,Z=!Dt(f);let ce;if(Z&&(ce=P&&P.onVnodeBeforeUnmount)&&Ye(ce,m,f),j&6)Wo(f.component,x,T);else{if(j&128){f.suspense.unmount(x,T);return}ee&&At(f,null,m,"beforeUnmount"),j&64?f.type.remove(f,m,x,Gt,T):S&&!S.hasOnce&&(k!==V||O>0&&O&64)?qt(S,m,x,!1,!0):(k===V&&O&384||!$&&j&16)&&qt(A,m,x),T&&Dn(f)}const he=J!=null&&L==null;(Z&&(ce=P&&P.onVnodeUnmounted)||ee||he)&&we(()=>{ce&&Ye(ce,m,f),ee&&At(f,null,m,"unmounted"),he&&(f.el=null)},x)},Dn=f=>{const{type:m,el:x,anchor:T,transition:$}=f,k=m===V;if(k&&!$){Un(x,T);return}if(m===ln){le(f),$&&!$.persisted&&$.afterLeave&&$.afterLeave();return}const P=k?mn(f):f,E=()=>{k?b(x)&&Un(x,T):i(x),$&&!$.persisted&&$.afterLeave&&$.afterLeave()};if(P&&P.shapeFlag&1&&$&&!$.persisted){const{leave:A,delayLeave:S}=$,j=P.el,O=()=>A(j,E);S?S(j,E,O):O()}else E()},Un=(f,m)=>{let x;for(;f!==m;)x=v(f),i(f),f=x;i(m)},Wo=(f,m,x)=>{const{bum:T,scope:$,job:k,subTree:P,um:E,m:A,a:S}=f;ci(A),ci(S),T&&Ss(T),$.stop(),k?(k.flags|=8,Le(P,f,m,x)):P&&(P.transition=f.vnode.transition,Le(P,f,m,x)),E&&we(E,m);const j=()=>{f.isUnmounted=!0};j.flags=16,we(j,m)},qt=(f,m,x,T=!1,$=!1,k=0)=>{for(let P=k;P{if(f.shapeFlag&6)return bs(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const m=v(f.anchor||f.el),x=m&&m[Fl];return x?v(x):m},Ln=(f,m,x)=>{const T=f&&m._vnode?void 0:f&&f.component?f.component.uid:Nr();Il(()=>{f==null?m._vnode&&Le(m._vnode,null,null,!0):C(m._vnode||null,f,m,null,null,null,x),m._vnode=f},T)},Gt={p:C,um:Le,m:Tt,r:Dn,mt:Js,mc:je,pc:se,pbc:kt,n:bs,o:e};return{render:Ln,hydrate:void 0,createApp:ur(Ln)}}function on({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function Et({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Cr(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Oo(e,t,s=!1){const n=e.children,i=t.children;if(U(n)&&U(i))for(let o=0;o>1,e[s[r]]0&&(t[n]=s[o-1]),s[o]=n)}}for(o=s.length,l=s[o-1];o-- >0;)s[o]=l,l=t[l];return s}function Mo(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Mo(t)}function ci(e){if(e)for(let t=0;te.__isSuspense,Ar=Symbol("_deferredEnter");function Er(e,t){t&&t.pendingBranch?U(e)?t.effects.push(...e):t.effects.push(e):Vl(e)}const V=Symbol.for("v-fgt"),Ws=Symbol.for("v-txt"),Ue=Symbol.for("v-cmt"),ln=Symbol.for("v-stc"),mt=[];let Pe=null;function g(e=!1){mt.push(Pe=e?null:[])}function In(){mt.pop(),Pe=mt[mt.length-1]||null}let as=1;function ui(e,t=!1){as+=e,e<0&&Pe&&t&&(Pe.hasOnce=!0)}function Ro(e){return e.dynamicChildren=as>0?Pe||Ot:null,In(),as>0&&Pe&&Pe.push(e),e}function y(e,t,s,n,i,o){return Ro(u(e,t,s,n,i,o,!0))}function ke(e,t,s,n,i){return Ro(Ne(e,t,s,n,i,!0))}function qs(e){return e?e.__v_isVNode===!0:!1}function Jt(e,t){return e.type===t.type&&e.key===t.key}const Vo=({key:e})=>e??null,Ts=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?re(e)||fe(e)||F(e)?{i:ge,r:e,k:t,f:!!s}:e:null);function u(e,t=null,s=null,n=0,i=null,o=e===V?0:1,l=!1,r=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Vo(t),ref:t&&Ts(t),scopeId:lo,slotScopeIds:null,children:s,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:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:ge};return r?(Ns(a,s),o&128&&e.normalize(a)):s&&(a.shapeFlag|=re(s)?8:16),as>0&&!l&&Pe&&(a.patchFlag>0||o&6)&&a.patchFlag!==32&&Pe.push(a),a}const Ne=Pr;function Pr(e,t=null,s=null,n=0,i=null,o=!1){if((!e||e===ho)&&(e=Ue),qs(e)){const r=Ft(e,t,!0);return s&&Ns(r,s),as>0&&!o&&Pe&&(r.shapeFlag&6?Pe[Pe.indexOf(e)]=r:Pe.push(r)),r.patchFlag=-2,r}if(Fr(e)&&(e=e.__vccOpts),t){t=Or(t);let{class:r,style:a}=t;r&&!re(r)&&(t.class=Ce(r)),Q(a)&&(On(a)&&!U(a)&&(a=de({},a)),t.style=wt(a))}const l=re(e)?1:No(e)?128:Hs(e)?64:Q(e)?4:F(e)?2:0;return u(e,t,s,n,i,l,o,!0)}function Or(e){return e?On(e)?de({},e):ko(e)?de({},e[Lo]||e):e:null}function Ft(e,t,s=!1,n=!1){const{props:i,ref:o,patchFlag:l,children:r,transition:a}=e,d=t?Io(i||{},t):i,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Vo(d),ref:t&&t.ref?s&&o?U(o)?o.concat(Ts(t)):[o,Ts(t)]:Ts(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:r,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==V?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ft(e.ssContent),ssFallback:e.ssFallback&&Ft(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return a&&n&&ts(h,a.clone(h)),h}function q(e=" ",t=0){return Ne(Ws,null,e,t)}function M(e="",t=!1){return t?(g(),ke(Ue,null,e)):Ne(Ue,null,e)}function et(e){return e==null||typeof e=="boolean"?Ne(Ue):U(e)?Ne(V,null,e.slice()):qs(e)?dt(e):Ne(Ws,null,String(e))}function dt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ft(e)}function Ns(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(U(t))s=16;else if(typeof t=="object")if(n&65){const i=t.default;i&&(i._c&&(i._d=!1),Ns(e,i()),i._c&&(i._d=!0));return}else{s=32;const i=t._;!i&&!ko(t)?t._ctx=ge:i===3&&ge&&(ge.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(F(t)){if(n&65){Ns(e,{default:t});return}t={default:t,_ctx:ge},s=32}else t=String(t),n&64?(s=16,t=[q(t)]):s=8;e.children=t,e.shapeFlag|=s}function Io(...e){const t={};for(let s=0;sye||ge;let Rs,cs;{const e=Ls(),t=(s,n)=>{let i;return(i=e[s])||(i=e[s]=[]),i.push(n),o=>{i.length>1?i.forEach(l=>l(o)):i[0](o)}};Rs=t("__VUE_INSTANCE_SETTERS__",s=>ye=s),cs=t("__VUE_SSR_SETTERS__",s=>us=s)}const ps=e=>{const t=ye;return Rs(e),e.scope.on(),()=>{e.scope.off(),Rs(t)}},di=()=>{ye&&ye.scope.off(),Rs(null)};function Do(e){return e.vnode.shapeFlag&4}let us=!1;function Ir(e,t=!1,s=!1){t&&cs(t);const{props:n,children:i}=e.vnode,o=Do(e);_r(e,n,o,t),wr(e,i,s||t);const l=o?jr(e,t):void 0;return t&&cs(!1),l}function jr(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,nr);const{setup:n}=s;if(n){nt();const i=e.setupContext=n.length>1?Ur(e):null,o=ps(e),l=fs(n,e,0,[e.props,i]),r=Ei(l);if(it(),o(),(r||e.sp)&&!Dt(e)&&uo(e),r){if(l.then(di,di),t)return l.then(a=>{cs(!0);try{fi(e,a,t)}finally{cs(!1)}}).catch(a=>{Bs(a,e,0,void 0,!0),e.ssrRender=(d,h)=>h("")});e.asyncDep=l}else fi(e,l)}else Uo(e)}function fi(e,t,s){F(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Q(t)&&(e.setupState=Qi(t)),Uo(e)}function Uo(e,t,s){const n=e.type;e.render||(e.render=n.render||st);{const i=ps(e);nt();try{ir(e)}finally{it(),i()}}}const Lo=Symbol(),Dr={get(e,t){return me(e,"get",""),t===Lo?e:e[t]}};function Ur(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,Dr),slots:e.slots,emit:e.emit,expose:t}}function Gs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Qi(kl(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in ns)return ns[s](e)},has(t,s){return s in t||s in ns}})):e.proxy}function Lr(e,t=!0){return F(e)?e.displayName||e.name:e.name||t&&e.__name}function Fr(e){return F(e)&&"__vccOpts"in e}const vt=(e,t)=>Pl(e,t,us),Br="3.5.47";let vn;const pi=typeof window<"u"&&window.trustedTypes;if(pi)try{vn=pi.createPolicy("vue",{createHTML:e=>e})}catch{}const Fo=vn?e=>vn.createHTML(e):e=>e,Hr="http://www.w3.org/2000/svg",Kr="http://www.w3.org/1998/Math/MathML",ct=typeof document<"u"?document:null,hi=ct&&ct.createElement("template"),Wr={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const i=t==="svg"?ct.createElementNS(Hr,e):t==="mathml"?ct.createElementNS(Kr,e):s?ct.createElement(e,{is:s}):ct.createElement(e);return e==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:e=>ct.createTextNode(e),createComment:e=>ct.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ct.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,i,o){const l=s?s.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),s),!(i===o||!(i=i.nextSibling)););else{hi.innerHTML=Fo(n==="svg"?`${e}`:n==="mathml"?`${e}`:e);const r=hi.content;if(n==="svg"||n==="mathml"){const a=r.firstChild;for(;a.firstChild;)r.appendChild(a.firstChild);r.removeChild(a)}t.insertBefore(r,s)}return[l?l.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},qr=Symbol("_vtc");function Gr(e,t,s){const n=e[qr];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const mi=Symbol("_vod"),zr=Symbol("_vsh"),Jr=Symbol(""),Xr=/(?:^|;)\s*display\s*:/;function Yr(e,t,s){const n=e.style,i=re(s);let o=!1;if(s&&!i){if(t)if(re(t))for(const l of t.split(";")){const r=l.slice(0,l.indexOf(":")).trim();s[r]==null&&Yt(n,r,"")}else for(const l in t)s[l]==null&&Yt(n,l,"");for(const l in s){l==="display"&&(o=!0);const r=s[l];r!=null?Qr(e,l,!re(t)&&t?t[l]:void 0,r)||Yt(n,l,r):Yt(n,l,"")}}else if(i){if(t!==s){const l=n[Jr];l&&(s+=";"+l),n.cssText=s,o=Xr.test(s)}}else t&&e.removeAttribute("style");mi in e&&((!i||t!==s)&&(e[mi]=o?n.display:""),e[zr]&&(n.display="none"))}const xs=/\s*!important$/;function Yt(e,t,s){if(U(s))s.forEach(n=>Yt(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))xs.test(s)?e.setProperty(t,s.replace(xs,""),"important"):e.setProperty(t,s);else{const n=Zr(e,t);xs.test(s)?e.setProperty(Vt(n),s.replace(xs,""),"important"):e[n]=s}}const gi=["Webkit","Moz","ms"],rn={};function Zr(e,t){const s=rn[t];if(s)return s;let n=Se(t);if(n!=="filter"&&n in e)return rn[t]=n;n=Us(n);for(let i=0;ian||(oa.then(()=>an=0),an=Date.now());function ra(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;const i=s.value;if(U(i)){const o=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{o.call(n),n._stopped=!0};const l=i.slice(),r=[n];for(let a=0;ae.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,aa=(e,t,s,n,i,o)=>{const l=i==="svg";t==="class"?Gr(e,n,l):t==="style"?Yr(e,s,n):Is(t)?js(t)||ta(e,t,s,n,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ca(e,t,n,l))?(yi(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_i(e,t,n,l,o,t!=="value")):e._isVueCE&&(ua(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!re(n)))?yi(e,Se(t),n,o,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),_i(e,t,n,l))};function ca(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&xi(t)&&F(s));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 i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return xi(t)&&re(s)?!1:t in e}function ua(e,t){const s=e._def.props;if(!s)return!1;const n=Se(t);return Array.isArray(s)?s.some(i=>Se(i)===n):Object.keys(s).some(i=>Se(i)===n)}const St=e=>{const t=e.props["onUpdate:modelValue"]||!1;return U(t)?s=>Ss(t,s):t};function da(e){e.target.composing=!0}function wi(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Oe=Symbol("_assign"),ws=Symbol("_initialValue");function cn(e,t,s){return t&&(e=e.trim()),s&&(e=ds(e)),e}const G={created(e,{modifiers:{lazy:t,trim:s,number:n}},i){e.parentNode&&(e.type==="text"?e[ws]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[ws]=e.defaultValue.replace(/\r\n?/g,` +`))),e[Oe]=St(i);const o=n||i.props&&i.props.type==="number";pt(e,t?"change":"input",l=>{l.target.composing||e[Oe](cn(e.value,s,o))}),(s||o)&&pt(e,"change",()=>{e.value=cn(e.value,s,o)}),t||(pt(e,"compositionstart",da),pt(e,"compositionend",wi),pt(e,"change",wi))},mounted(e,{value:t,modifiers:{trim:s,number:n}}){const i=t??"",o=e[ws];delete e[ws],o!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==o?e[Oe](cn(e.value,s,n)):e.value=i},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:i,number:o}},l){if(e[Oe]=St(l),e.composing)return;const r=(o||e.type==="number")&&!/^0\d/.test(e.value)?ds(e.value):e.value,a=t??"";if(r===a)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(n&&t===s||i&&e.value.trim()===a)||(e.value=a)}},Nt={deep:!0,created(e,t,s){e[Oe]=St(s),pt(e,"change",()=>{const n=e._modelValue,i=Bt(e),o=e.checked,l=e[Oe];if(U(n)){const r=Sn(n,i),a=r!==-1;if(o&&!a)l(n.concat(i));else if(!o&&a){const d=[...n];d.splice(r,1),l(d)}}else if(bt(n)){const r=new Set(n);o?r.add(i):r.delete(i),l(r)}else l(Bo(e,o))})},mounted:$i,beforeUpdate(e,t,s){e[Oe]=St(s),$i(e,t,s)}};function $i(e,{value:t,oldValue:s},n){e._modelValue=t;let i;if(U(t))i=Sn(t,n.props.value)>-1;else if(bt(t))i=t.has(n.props.value);else{if(t===s)return;i=We(t,Bo(e,!0))}e.checked!==i&&(e.checked=i)}const fa={created(e,{value:t},s){e.checked=We(t,s.props.value),e[Oe]=St(s),pt(e,"change",()=>{e[Oe](Bt(e))})},beforeUpdate(e,{value:t,oldValue:s},n){e[Oe]=St(n),t!==s&&(e.checked=We(t,n.props.value))}},pa={deep:!0,created(e,{value:t,modifiers:{number:s}},n){e._modelValue=t,pt(e,"change",()=>{const i=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>s?ds(Bt(a)):Bt(a)),o=e.multiple,l=o?bt(e._modelValue)?new Set(i):i:i[0],r=e._pendingValue=[o,o?U(l)?i.slice():i:l];try{e[Oe](l)}finally{to(()=>{e._pendingValue===r&&(e._pendingValue=void 0)})}}),e[Oe]=St(n)},mounted(e,{value:t,modifiers:{number:s}}){Si(e,t,s)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[Oe]=St(s)},updated(e,{value:t,modifiers:{number:s}}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!ha(t,n[1],n[0]))&&Si(e,t,s)}};function ha(e,t,s){if(!s||U(e))return We(e,t);if(bt(e)){if(e.size!==t.length)return!1;for(const n of t)if(!e.has(n))return!1;return!0}return!1}function Si(e,t,s=!1){const n=e.multiple,i=U(t);if(!(n&&!i&&!bt(t))){for(let o=0,l=e.options.length;oString(h)===String(a)):r.selected=Sn(t,a)>-1}else r.selected=t.has(a)||s&&typeof a=="string"&&t.has(ds(a));else if(We(Bt(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Bt(e){return"_value"in e?e._value:e.value}function Bo(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const ma=["ctrl","shift","alt","meta"],ga={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)=>ma.some(s=>e[`${s}Key`]&&!t.includes(s))},De=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((i,...o)=>{for(let l=0;l{const t=_a().createApp(...e),{mount:s}=t;return t.mount=n=>{const i=xa(n);if(!i)return;const o=t._component;!F(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const l=s(i,!1,va(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),l},t});function va(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function xa(e){return re(e)?document.querySelector(e):e}class Rt extends Error{constructor(t,s){super(s?.message??`HTTP ${t}`),this.status=t,this.body=s}status;body;get errors(){return Object.fromEntries(Object.entries(this.body?.errors??{}).map(([t,s])=>[t,s[0]]))}}const I=JSON.parse(document.getElementById("manager-boot").textContent);function Ho(){const e=document.cookie.match(/(?:^|; )XSRF-TOKEN=([^;]+)/);return e?decodeURIComponent(e[1]):""}async function $s(e,t,s){const n=await fetch(t,{method:e,credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest","X-XSRF-TOKEN":Ho(),...s===void 0?{}:{"Content-Type":"application/json"}},body:s===void 0?void 0:JSON.stringify(s)}),i=n.status===204?null:await n.json().catch(()=>null);if(!n.ok)throw new Rt(n.status,i);return i}async function wa(e,t){const s=await fetch(e,{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest","X-XSRF-TOKEN":Ho()},body:t}),n=await s.json().catch(()=>null);if(!s.ok)throw new Rt(s.status,n);return n}const Re={get:e=>$s("GET",e),post:(e,t={})=>$s("POST",e,t),put:(e,t={})=>$s("PUT",e,t),delete:(e,t)=>$s("DELETE",e,t)};function gt(e){const t=Kt({values:{...e},errors:{},busy:!1,async send(s,n){t.busy=!0,t.errors={};try{return await Re[s](n,t.values)}catch(i){if(i instanceof Rt&&i.status===422)return t.errors=i.errors,null;throw i}finally{t.busy=!1}}});return t}const $a={Dashboard:"Dashboard","Log in":"Inloggen","Log out":"Uitloggen",Email:"E-mailadres",Password:"Wachtwoord","Keep me logged in":"Ingelogd blijven","Logging in…":"Bezig met inloggen…","Log in to manage the site.":"Log in om de site te beheren.","My account":"Mijn account",Name:"Naam","Email address":"E-mailadres","What you may do":"Wat je mag","Super admin: everything":"Super admin: alles","Not in a group yet":"Nog in geen groep","New password":"Nieuw wachtwoord","Leave empty to keep the password you have.":"Laat leeg om je wachtwoord te houden.","Current password":"Huidig wachtwoord","At least 12 characters.":"Minstens 12 tekens.","New password, once more":"Nieuw wachtwoord, nogmaals",Save:"Opslaan","Saving…":"Bezig met opslaan…","Saved.":"Opgeslagen.",Look:"Uiterlijk",Theme:"Thema",Posts:"Berichten","New post":"Nieuw bericht",Title:"Titel",Status:"Status",Category:"Categorie",Edit:"Bewerken",Delete:"Verwijderen","Put online":"Online zetten","Take offline":"Offline halen",Draft:"Concept",Scheduled:"Ingepland",Published:"Gepubliceerd","Are you sure?":"Weet je het zeker?","No posts yet.":"Nog geen berichten.","Address (slug)":"Adres (slug)",Summary:"Samenvatting","Text (Markdown)":"Tekst (Markdown)","Cover image":"Omslagafbeelding","Tags (comma separated)":"Tags (met komma's)",Featured:"Uitgelicht",Publish:"Publiceren","Publish at":"Publiceren op",Menu:"Menu","Loading…":"Laden…","You may not open this page.":"Je mag deze pagina niet openen.","Something went wrong. Try again.":"Er ging iets mis. Probeer het opnieuw.","This page has no screen in the manager yet.":"Deze pagina heeft nog geen scherm in de manager.","Go to the dashboard":"Naar het dashboard","The page expired. Reload it and try again.":"De pagina is verlopen. Laad hem opnieuw en probeer het nog eens.",Back:"Terug",Accounts:"Accounts","New account":"Nieuw account",you:"jij","Super admin":"Super admin",Groups:"Groepen",Cancel:"Annuleren","New group":"Nieuwe groep",Description:"Omschrijving",accounts:"accounts","Categories and tags":"Categorieën en tags",Categories:"Categorieën",Tags:"Tags",Add:"Toevoegen",Rename:"Hernoemen","New name":"Nieuwe naam",Pages:"Pagina's",Reviews:"Reviews","Nothing here yet.":"Hier is nog niets.",Previous:"Vorige",Next:"Volgende",Media:"Media","Choose an image":"Kies een afbeelding","No images yet.":"Nog geen afbeeldingen.","Uploaded.":"Geüpload.",Upload:"Uploaden","Uploading…":"Bezig met uploaden…","This file is in use. Delete it anyway?":"Dit bestand is in gebruik. Toch verwijderen?","Largest file":"Grootste bestand","Alternative text":"Alternatieve tekst",Used:"Gebruikt","No files yet.":"Nog geen bestanden.",Choose:"Kiezen","Audit log":"Auditlog","Addresses banned":"Geblokkeerde adressen","Logins (24 h)":"Logins (24 u)","Failed logins (24 h)":"Mislukte logins (24 u)","Refused (24 h)":"Geweigerd (24 u)",all:"alles",logins:"logins",failed:"mislukt",actions:"acties",viewed:"bekeken",refused:"geweigerd",bans:"blokkades",Search:"Zoeken",Account:"Account",Everyone:"Iedereen",Filter:"Filteren",Someone:"Iemand",banned:"geblokkeerd",Ban:"Blokkeren",Bans:"Blokkades","Minutes (0 = until lifted)":"Minuten (0 = tot opgeheven)",Reason:"Reden","Whole site":"Hele site","No bans.":"Geen blokkades.",automatic:"automatisch","whole site":"hele site",hits:"pogingen",Lift:"Opheffen",Rules:"Regels","until lifted":"tot opgeheven","Ban an address by itself after too many failed logins":"Een adres zelf blokkeren na te veel mislukte logins","Failed logins":"Mislukte logins","Within minutes":"Binnen minuten","Ban for minutes (0 = until lifted)":"Blokkeren voor minuten (0 = tot opgeheven)","Keep the log (days)":"Log bewaren (dagen)","Notes about addresses":"Notities over adressen",Group:"Groep",Note:"Notitie",Statistics:"Statistieken","compared with":"vergeleken met",Visitors:"Bezoekers",Visits:"Bezoeken","Page views":"Paginaweergaven","Average time":"Gemiddelde tijd","Bounce rate":"Bouncepercentage",Channels:"Kanalen",Sources:"Bronnen",Countries:"Landen",Devices:"Apparaten",Browsers:"Browsers",Systems:"Systemen",Direct:"Direct","When people visit":"Wanneer mensen komen",Programs:"Programma's",Download:"Downloaden",Open:"Openen","Created.":"Aangemaakt.","Deleted.":"Verwijderd."};let Ko={};function Sa(e){Ko=e.toLowerCase().startsWith("nl")?$a:{}}function _(e){return Ko[e]??e}const ka=["href"],ze=_e({__name:"Link",props:{href:{}},setup(e){function t(s,n){s.metaKey||s.ctrlKey||s.shiftKey||s.button!==0||(s.preventDefault(),zs(n))}return(s,n)=>(g(),y("a",{href:e.href,onClick:n[0]||(n[0]=i=>t(i,e.href))},[mo(s.$slots,"default")],8,ka))}}),Ca={class:"font-display mb-6 text-2xl font-bold"},Ta={class:"mb-4 text-muted"},Aa={class:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3"},Ea=_e({__name:"Dashboard",props:{navigation:{}},setup(e){return(t,s)=>(g(),y(V,null,[u("h1",Ca,p(c(_)("Dashboard")),1),u("p",Ta,p(c(I).user?.name),1),u("div",Aa,[(g(!0),y(V,null,H(e.navigation,n=>(g(),ke(ze,{key:n.href,href:n.href,class:"m-card block p-5 font-semibold transition hover:border-brand"},{default:Ie(()=>[q(p(c(_)(n.label)),1)]),_:2},1032,["href"]))),128))])],64))}}),Pa={class:"m-card max-w-xl p-6"},Oa={class:"text-sm"},Ma=_e({__name:"Fallback",setup(e){return(t,s)=>(g(),y("div",Pa,[u("p",Oa,p(c(_)("This page has no screen in the manager yet.")),1),Ne(ze,{href:c(I).base,class:"m-btn m-btn-secondary mt-4"},{default:Ie(()=>[q(p(c(_)("Go to the dashboard")),1)]),_:1},8,["href"])]))}}),Na={class:"grid min-h-screen place-items-center px-4"},Ra=["src"],Va={class:"font-display text-2xl font-bold"},Ia={class:"mt-1 text-sm text-muted"},ja={class:"mt-6"},Da={for:"email",class:"m-label"},Ua={key:0,class:"m-error"},La={class:"mt-4"},Fa={for:"password",class:"m-label"},Ba={key:0,class:"m-error"},Ha={class:"mt-4 flex items-center gap-2 text-sm text-muted"},Ka=["disabled"],Wa=_e({__name:"Login",setup(e){const t=gt({email:"",password:"",remember:!1});async function s(){const n=await t.send("post",I.base+"/login");n?window.location.assign(n.redirect):t.values.password=""}return(n,i)=>(g(),y("div",Na,[u("form",{class:"m-card w-full max-w-sm p-7",onSubmit:De(s,["prevent"])},[c(I).logo?(g(),y("img",{key:0,src:c(I).logo,alt:"",class:"mb-4 h-9 w-auto"},null,8,Ra)):M("",!0),u("h1",Va,p(c(I).name),1),u("p",Ia,p(c(_)("Log in to manage the site.")),1),u("div",ja,[u("label",Da,p(c(_)("Email")),1),B(u("input",{id:"email","onUpdate:modelValue":i[0]||(i[0]=o=>c(t).values.email=o),type:"email",autocomplete:"username",required:"",autofocus:"",class:"m-input"},null,512),[[G,c(t).values.email]]),c(t).errors.email?(g(),y("p",Ua,p(c(t).errors.email),1)):M("",!0)]),u("div",La,[u("label",Fa,p(c(_)("Password")),1),B(u("input",{id:"password","onUpdate:modelValue":i[1]||(i[1]=o=>c(t).values.password=o),type:"password",autocomplete:"current-password",required:"",class:"m-input"},null,512),[[G,c(t).values.password]]),c(t).errors.password?(g(),y("p",Ba,p(c(t).errors.password),1)):M("",!0)]),u("label",Ha,[B(u("input",{"onUpdate:modelValue":i[2]||(i[2]=o=>c(t).values.remember=o),type:"checkbox"},null,512),[[Nt,c(t).values.remember]]),q(" "+p(c(_)("Keep me logged in")),1)]),u("button",{type:"submit",class:"m-btn m-btn-primary mt-6 w-full justify-center",disabled:c(t).busy},p(c(t).busy?c(_)("Logging in…"):c(_)("Log in")),9,Ka)],32)]))}}),qa={class:"m-card max-h-[85vh] w-full max-w-3xl overflow-y-auto p-5",role:"dialog","aria-modal":"true"},Ga={class:"mb-4 flex items-center justify-between"},za={class:"font-display text-lg font-bold"},Ja={key:0,class:"text-sm text-muted"},Xa={key:1,class:"text-sm text-muted"},Ya={key:2,class:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4"},Za=["onClick"],Qa=["src","alt"],ec={class:"block truncate px-2 py-1 text-xs"},tc=_e({__name:"MediaPicker",emits:["pick","close"],setup(e,{emit:t}){const s=t,n=ot([]),i=ot(!0);return po(async()=>{try{n.value=(await Re.get(`${I.base}/media/items`)).items.filter(o=>o.is_image)}finally{i.value=!1}}),(o,l)=>(g(),y("div",{class:"fixed inset-0 z-50 grid place-items-center bg-black/60 p-4",onClick:l[1]||(l[1]=De(r=>s("close"),["self"]))},[u("div",qa,[u("div",Ga,[u("h2",za,p(c(_)("Choose an image")),1),u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:l[0]||(l[0]=r=>s("close"))},p(c(_)("Cancel")),1)]),i.value?(g(),y("p",Ja,p(c(_)("Loading…")),1)):n.value.length?(g(),y("div",Ya,[(g(!0),y(V,null,H(n.value,r=>(g(),y("button",{key:r.id,type:"button",class:"overflow-hidden rounded-lg border border-line text-left hover:border-brand",onClick:a=>s("pick",r.url)},[u("img",{src:r.url,alt:r.name,loading:"lazy",class:"aspect-square w-full object-cover"},null,8,Qa),u("span",ec,p(r.name),1)],8,Za))),128))])):(g(),y("p",Xa,p(c(_)("No images yet.")),1))])]))}}),sc={class:"mb-6 flex items-center justify-between gap-3"},nc={class:"font-display text-2xl font-bold"},ic={for:"title",class:"m-label"},oc={key:0,class:"m-error"},lc={class:"grid gap-5 sm:grid-cols-2"},rc={for:"slug",class:"m-label"},ac={key:0,class:"m-error"},cc={for:"category",class:"m-label"},uc={id:"categories"},dc=["value"],fc={for:"excerpt",class:"m-label"},pc={key:0,class:"m-error"},hc={for:"body",class:"m-label"},mc={key:0,class:"m-error"},gc={class:"grid gap-5 sm:grid-cols-2"},bc={for:"cover",class:"m-label"},_c={class:"flex gap-2"},yc={for:"tags",class:"m-label"},vc={id:"known-tags"},xc=["value"],wc={class:"flex flex-wrap items-center gap-6"},$c={class:"flex items-center gap-2 text-sm"},Sc={key:0,class:"flex items-center gap-2 text-sm"},kc={key:1},Cc={for:"at",class:"m-label"},Tc=["disabled"],Ci=_e({__name:"PostForm",props:{post:{},categories:{},known_tags:{}},setup(e){const s=e.post,n=gt({title:s?.title??"",slug:s?.slug??"",excerpt:s?.excerpt??"",body:s?.body??"",cover_image:s?.cover_image??"",category:s?.category??"",tags:s?.tags??[],is_featured:s?.is_featured??!1,is_published:s?.is_published??!1,published_at:s?.published_at??""}),i=ot(!1);let o=(s?.tags??[]).join(", ");async function l(){n.values.tags=o.split(",").map(a=>a.trim()).filter(Boolean),(s?await n.send("put",`${I.base}/posts/${s.id}`):await n.send("post",`${I.base}/posts`))&&(be(_(s?"Saved.":"Created.")),zs(`${I.base}/posts`))}return(r,a)=>(g(),y(V,null,[u("div",sc,[u("h1",nc,p(c(s)?c(s).title:c(_)("New post")),1),Ne(ze,{href:c(I).base+"/posts",class:"m-btn m-btn-secondary"},{default:Ie(()=>[q(p(c(_)("Back")),1)]),_:1},8,["href"])]),u("form",{class:"m-card max-w-3xl space-y-5 p-5",onSubmit:De(l,["prevent"])},[u("div",null,[u("label",ic,p(c(_)("Title")),1),B(u("input",{id:"title","onUpdate:modelValue":a[0]||(a[0]=d=>c(n).values.title=d),required:"",maxlength:"255",class:"m-input"},null,512),[[G,c(n).values.title]]),c(n).errors.title?(g(),y("p",oc,p(c(n).errors.title),1)):M("",!0)]),u("div",lc,[u("div",null,[u("label",rc,p(c(_)("Address (slug)")),1),B(u("input",{id:"slug","onUpdate:modelValue":a[1]||(a[1]=d=>c(n).values.slug=d),maxlength:"255",class:"m-input"},null,512),[[G,c(n).values.slug]]),c(n).errors.slug?(g(),y("p",ac,p(c(n).errors.slug),1)):M("",!0)]),u("div",null,[u("label",cc,p(c(_)("Category")),1),B(u("input",{id:"category","onUpdate:modelValue":a[2]||(a[2]=d=>c(n).values.category=d),list:"categories",maxlength:"60",class:"m-input"},null,512),[[G,c(n).values.category]]),u("datalist",uc,[(g(!0),y(V,null,H(e.categories,d=>(g(),y("option",{key:d,value:d},null,8,dc))),128))])])]),u("div",null,[u("label",fc,p(c(_)("Summary")),1),B(u("textarea",{id:"excerpt","onUpdate:modelValue":a[3]||(a[3]=d=>c(n).values.excerpt=d),rows:"2",maxlength:"500",class:"m-input"},null,512),[[G,c(n).values.excerpt]]),c(n).errors.excerpt?(g(),y("p",pc,p(c(n).errors.excerpt),1)):M("",!0)]),u("div",null,[u("label",hc,p(c(_)("Text (Markdown)")),1),B(u("textarea",{id:"body","onUpdate:modelValue":a[4]||(a[4]=d=>c(n).values.body=d),rows:"14",required:"",class:"m-input font-mono"},null,512),[[G,c(n).values.body]]),c(n).errors.body?(g(),y("p",mc,p(c(n).errors.body),1)):M("",!0)]),u("div",gc,[u("div",null,[u("label",bc,p(c(_)("Cover image")),1),u("div",_c,[B(u("input",{id:"cover","onUpdate:modelValue":a[5]||(a[5]=d=>c(n).values.cover_image=d),maxlength:"2048",class:"m-input"},null,512),[[G,c(n).values.cover_image]]),c(I).permissions.includes("media.view")?(g(),y("button",{key:0,type:"button",class:"m-btn m-btn-secondary shrink-0",onClick:a[6]||(a[6]=d=>i.value=!0)},p(c(_)("Choose")),1)):M("",!0)])]),u("div",null,[u("label",yc,p(c(_)("Tags (comma separated)")),1),B(u("input",{id:"tags","onUpdate:modelValue":a[7]||(a[7]=d=>fe(o)?o.value=d:o=d),list:"known-tags",class:"m-input"},null,512),[[G,c(o)]]),u("datalist",vc,[(g(!0),y(V,null,H(e.known_tags,d=>(g(),y("option",{key:d,value:d},null,8,xc))),128))])])]),u("div",wc,[u("label",$c,[B(u("input",{"onUpdate:modelValue":a[8]||(a[8]=d=>c(n).values.is_featured=d),type:"checkbox"},null,512),[[Nt,c(n).values.is_featured]]),q(" "+p(c(_)("Featured")),1)]),c(I).permissions.includes("posts.publish")?(g(),y("label",Sc,[B(u("input",{"onUpdate:modelValue":a[9]||(a[9]=d=>c(n).values.is_published=d),type:"checkbox"},null,512),[[Nt,c(n).values.is_published]]),q(" "+p(c(_)("Publish")),1)])):M("",!0),c(n).values.is_published?(g(),y("div",kc,[u("label",Cc,p(c(_)("Publish at")),1),B(u("input",{id:"at","onUpdate:modelValue":a[10]||(a[10]=d=>c(n).values.published_at=d),type:"datetime-local",class:"m-input"},null,512),[[G,c(n).values.published_at]])])):M("",!0)]),u("button",{type:"submit",class:"m-btn m-btn-primary",disabled:c(n).busy},p(c(n).busy?c(_)("Saving…"):c(_)("Save")),9,Tc)],32),i.value?(g(),ke(tc,{key:0,onPick:a[11]||(a[11]=d=>{c(n).values.cover_image=d,i.value=!1}),onClose:a[12]||(a[12]=d=>i.value=!1)})):M("",!0)],64))}}),Ac={class:"mb-6 flex flex-wrap items-center justify-between gap-3"},Ec={class:"font-display text-2xl font-bold"},Pc={key:0,class:"m-card p-5 text-sm text-muted"},Oc={key:1,class:"m-card divide-y divide-line"},Mc={class:"min-w-0"},Nc={class:"truncate font-semibold"},Rc={class:"mt-1 flex items-center gap-2 text-xs text-muted"},Vc={class:"m-badge"},Ic={key:0},jc={class:"flex gap-2"},Dc=["onClick"],Uc=["onClick"],Lc=_e({__name:"PostsIndex",props:{posts:{}},setup(e){const t={draft:"Draft",scheduled:"Scheduled",published:"Published"};async function s(i){await Re.put(`${I.base}/posts/${i.id}/online`,{online:i.status!=="published"}),await Ae()}async function n(i){window.confirm(_("Are you sure?"))&&(await Re.delete(`${I.base}/posts/${i.id}`),be(_("Deleted.")),await Ae())}return(i,o)=>(g(),y(V,null,[u("div",Ac,[u("h1",Ec,p(c(_)("Posts")),1),c(I).permissions.includes("posts.write")?(g(),ke(ze,{key:0,href:c(I).base+"/posts/create",class:"m-btn m-btn-primary"},{default:Ie(()=>[q(p(c(_)("New post")),1)]),_:1},8,["href"])):M("",!0)]),e.posts.length?(g(),y("ul",Oc,[(g(!0),y(V,null,H(e.posts,l=>(g(),y("li",{key:l.id,class:"flex flex-wrap items-center justify-between gap-3 p-4"},[u("div",Mc,[u("p",Nc,p(l.title),1),u("p",Rc,[u("span",Vc,p(c(_)(t[l.status])),1),l.category?(g(),y("span",Ic,p(l.category),1)):M("",!0)])]),u("div",jc,[c(I).permissions.includes("posts.publish")&&l.can_change?(g(),y("button",{key:0,type:"button",class:"m-btn m-btn-secondary",onClick:r=>s(l)},p(l.status==="published"?c(_)("Take offline"):c(_)("Put online")),9,Dc)):M("",!0),l.can_change?(g(),ke(ze,{key:1,href:`${c(I).base}/posts/${l.id}/edit`,class:"m-btn m-btn-secondary"},{default:Ie(()=>[q(p(c(_)("Edit")),1)]),_:1},8,["href"])):M("",!0),l.can_delete?(g(),y("button",{key:2,type:"button",class:"m-btn m-btn-danger",onClick:r=>n(l)},p(c(_)("Delete")),9,Uc)):M("",!0)])]))),128))])):(g(),y("p",Pc,p(c(_)("No posts yet.")),1))],64))}}),Fc={class:"font-display mb-6 text-2xl font-bold"},Bc={for:"name",class:"m-label"},Hc={key:0,class:"m-error"},Kc={class:"m-label"},Wc={class:"text-sm"},qc={class:"m-label"},Gc={class:"flex flex-wrap gap-1.5"},zc={key:0,class:"m-badge"},Jc={key:0,class:"m-badge"},Xc={key:0,class:"rounded-lg border border-line p-4"},Yc={class:"px-1.5 text-sm font-semibold"},Zc={class:"mt-1 flex flex-wrap gap-3"},Qc=["onUpdate:modelValue","value"],eu={class:"flex"},tu={key:0,class:"m-error"},su={class:"space-y-4 rounded-lg border border-line p-4"},nu={class:"px-1.5 text-sm font-semibold"},iu={class:"m-help"},ou={for:"current_password",class:"m-label"},lu={key:0,class:"m-error"},ru={for:"password",class:"m-label"},au={class:"m-help"},cu={key:0,class:"m-error"},uu={for:"password_confirmation",class:"m-label"},du=["disabled"],fu=_e({__name:"Profile",props:{profile:{}},setup(e){const t=e,s=gt({name:t.profile.name,theme:t.profile.theme,current_password:"",password:"",password_confirmation:""});async function n(){await s.send("put",I.base+"/profile")&&(be(_("Saved.")),s.values.theme!==I.theme&&window.location.reload(),s.values.current_password=s.values.password=s.values.password_confirmation="")}return(i,o)=>(g(),y(V,null,[u("h1",Fc,p(c(_)("My account")),1),u("form",{class:"m-card max-w-xl space-y-5 p-5",onSubmit:De(n,["prevent"])},[u("div",null,[u("label",Bc,p(c(_)("Name")),1),B(u("input",{id:"name","onUpdate:modelValue":o[0]||(o[0]=l=>c(s).values.name=l),type:"text",required:"",maxlength:"255",class:"m-input",autocomplete:"name"},null,512),[[G,c(s).values.name]]),c(s).errors.name?(g(),y("p",Hc,p(c(s).errors.name),1)):M("",!0)]),u("div",null,[u("span",Kc,p(c(_)("Email address")),1),u("p",Wc,p(e.profile.email),1)]),u("div",null,[u("span",qc,p(c(_)("What you may do")),1),u("p",Gc,[e.profile.is_super_admin?(g(),y("span",zc,p(c(_)("Super admin: everything")),1)):(g(),y(V,{key:1},[(g(!0),y(V,null,H(e.profile.groups,l=>(g(),y("span",{key:l,class:"m-badge"},p(l),1))),128)),e.profile.groups.length?M("",!0):(g(),y("span",Jc,p(c(_)("Not in a group yet")),1))],64))])]),e.profile.themes.length?(g(),y("fieldset",Xc,[u("legend",Yc,p(c(_)("Look")),1),u("div",Zc,[(g(!0),y(V,null,H(e.profile.themes,l=>(g(),y("label",{key:l.key,class:Ce(["flex cursor-pointer items-center gap-2 rounded-lg border px-3 py-2 text-sm",c(s).values.theme===l.key?"border-brand":"border-line"])},[B(u("input",{"onUpdate:modelValue":r=>c(s).values.theme=r,type:"radio",name:"theme",value:l.key,class:"sr-only"},null,8,Qc),[[fa,c(s).values.theme]]),u("span",eu,[(g(),y(V,null,H(["ink","panel","brand"],r=>u("span",{key:r,class:"h-4 w-4 border border-line",style:wt({background:l.colors[r]})},null,4)),64))]),q(" "+p(l.label),1)],2))),128))]),c(s).errors.theme?(g(),y("p",tu,p(c(s).errors.theme),1)):M("",!0)])):M("",!0),u("fieldset",su,[u("legend",nu,p(c(_)("New password")),1),u("p",iu,p(c(_)("Leave empty to keep the password you have.")),1),u("div",null,[u("label",ou,p(c(_)("Current password")),1),B(u("input",{id:"current_password","onUpdate:modelValue":o[1]||(o[1]=l=>c(s).values.current_password=l),type:"password",class:"m-input",autocomplete:"current-password"},null,512),[[G,c(s).values.current_password]]),c(s).errors.current_password?(g(),y("p",lu,p(c(s).errors.current_password),1)):M("",!0)]),u("div",null,[u("label",ru,p(c(_)("New password")),1),B(u("input",{id:"password","onUpdate:modelValue":o[2]||(o[2]=l=>c(s).values.password=l),type:"password",minlength:"12",maxlength:"200",class:"m-input",autocomplete:"new-password"},null,512),[[G,c(s).values.password]]),u("p",au,p(c(_)("At least 12 characters.")),1),c(s).errors.password?(g(),y("p",cu,p(c(s).errors.password),1)):M("",!0)]),u("div",null,[u("label",uu,p(c(_)("New password, once more")),1),B(u("input",{id:"password_confirmation","onUpdate:modelValue":o[3]||(o[3]=l=>c(s).values.password_confirmation=l),type:"password",maxlength:"200",class:"m-input",autocomplete:"new-password"},null,512),[[G,c(s).values.password_confirmation]])])]),u("button",{type:"submit",class:"m-btn m-btn-primary",disabled:c(s).busy},p(c(s).busy?c(_)("Saving…"):c(_)("Save")),9,du)],32)],64))}}),pu={class:"mb-6 flex flex-wrap items-center justify-between gap-3"},hu={class:"font-display text-2xl font-bold"},mu={class:"grid gap-4 sm:grid-cols-2"},gu={class:"m-label",for:"a-name"},bu={key:0,class:"m-error"},_u={class:"m-label",for:"a-email"},yu={key:0,class:"m-error"},vu={class:"m-label",for:"a-pass"},xu=["required"],wu={class:"m-help"},$u={key:0,class:"m-error"},Su={key:0},ku={class:"m-label"},Cu=["value","disabled"],Tu={class:"flex gap-2"},Au=["disabled"],Eu={class:"m-card divide-y divide-line"},Pu={class:"min-w-0"},Ou={class:"truncate font-semibold"},Mu={key:0,class:"text-xs font-normal text-muted"},Nu={class:"truncate text-xs text-muted"},Ru={class:"mt-1 flex flex-wrap gap-1"},Vu={key:0,class:"m-badge"},Iu={class:"flex gap-2"},ju=["onClick"],Du=["onClick"],Uu=_e({__name:"AccountsIndex",props:{accounts:{},groups:{}},setup(e){const t=ot(null),s=gt({name:"",email:"",password:"",groups:[]});function n(l){t.value=l,s.errors={},s.values.name=l==="new"?"":l.name,s.values.email=l==="new"?"":l.email,s.values.password="",s.values.groups=l==="new"?[]:l.groups.map(r=>r.id)}async function i(){const l=t.value;(l==="new"?await s.send("post",`${I.base}/accounts`):await s.send("put",`${I.base}/accounts/${l.id}`))&&(be(_("Saved.")),t.value=null,await Ae())}async function o(l){window.confirm(_("Are you sure?"))&&(await Re.delete(`${I.base}/accounts/${l.id}`),be(_("Deleted.")),await Ae())}return(l,r)=>(g(),y(V,null,[u("div",pu,[u("h1",hu,p(c(_)("Accounts")),1),u("button",{type:"button",class:"m-btn m-btn-primary",onClick:r[0]||(r[0]=a=>n("new"))},p(c(_)("New account")),1)]),t.value?(g(),y("form",{key:0,class:"m-card mb-6 max-w-2xl space-y-4 p-5",onSubmit:De(i,["prevent"])},[u("div",mu,[u("div",null,[u("label",gu,p(c(_)("Name")),1),B(u("input",{id:"a-name","onUpdate:modelValue":r[1]||(r[1]=a=>c(s).values.name=a),required:"",maxlength:"255",class:"m-input"},null,512),[[G,c(s).values.name]]),c(s).errors.name?(g(),y("p",bu,p(c(s).errors.name),1)):M("",!0)]),u("div",null,[u("label",_u,p(c(_)("Email address")),1),B(u("input",{id:"a-email","onUpdate:modelValue":r[2]||(r[2]=a=>c(s).values.email=a),type:"email",required:"",maxlength:"255",class:"m-input"},null,512),[[G,c(s).values.email]]),c(s).errors.email?(g(),y("p",yu,p(c(s).errors.email),1)):M("",!0)])]),u("div",null,[u("label",vu,p(c(_)("Password")),1),B(u("input",{id:"a-pass","onUpdate:modelValue":r[3]||(r[3]=a=>c(s).values.password=a),type:"password",minlength:"12",maxlength:"200",required:t.value==="new",class:"m-input",autocomplete:"new-password"},null,8,xu),[[G,c(s).values.password]]),u("p",wu,p(t.value==="new"?c(_)("At least 12 characters."):c(_)("Leave empty to keep the password you have.")),1),c(s).errors.password?(g(),y("p",$u,p(c(s).errors.password),1)):M("",!0)]),e.groups.length?(g(),y("fieldset",Su,[u("legend",ku,p(c(_)("Groups")),1),(g(!0),y(V,null,H(e.groups,a=>(g(),y("label",{key:a.id,class:Ce(["flex items-center gap-2 py-0.5 text-sm",a.can_give?"":"opacity-50"])},[B(u("input",{"onUpdate:modelValue":r[4]||(r[4]=d=>c(s).values.groups=d),type:"checkbox",value:a.id,disabled:!a.can_give},null,8,Cu),[[Nt,c(s).values.groups]]),q(" "+p(a.name),1)],2))),128))])):M("",!0),u("div",Tu,[u("button",{type:"submit",class:"m-btn m-btn-primary",disabled:c(s).busy},p(c(s).busy?c(_)("Saving…"):c(_)("Save")),9,Au),u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:r[5]||(r[5]=a=>t.value=null)},p(c(_)("Cancel")),1)])],32)):M("",!0),u("ul",Eu,[(g(!0),y(V,null,H(e.accounts,a=>(g(),y("li",{key:a.id,class:"flex flex-wrap items-center justify-between gap-3 p-4"},[u("div",Pu,[u("p",Ou,[q(p(a.name)+" ",1),a.is_you?(g(),y("span",Mu,"("+p(c(_)("you"))+")",1)):M("",!0)]),u("p",Nu,p(a.email),1),u("p",Ru,[a.is_super_admin?(g(),y("span",Vu,p(c(_)("Super admin")),1)):M("",!0),(g(!0),y(V,null,H(a.groups,d=>(g(),y("span",{key:d.id,class:"m-badge"},p(d.name),1))),128))])]),u("div",Iu,[a.can_change?(g(),y("button",{key:0,type:"button",class:"m-btn m-btn-secondary",onClick:d=>n(a)},p(c(_)("Edit")),9,ju)):M("",!0),a.can_delete?(g(),y("button",{key:1,type:"button",class:"m-btn m-btn-danger",onClick:d=>o(a)},p(c(_)("Delete")),9,Du)):M("",!0)])]))),128))])],64))}}),Lu={class:"mb-6 flex flex-wrap items-center justify-between gap-3"},Fu={class:"font-display text-2xl font-bold"},Bu={class:"m-label",for:"g-name"},Hu={key:0,class:"m-error"},Ku={class:"m-label",for:"g-desc"},Wu={class:"px-1 text-sm font-semibold"},qu=["value","onChange"],Gu={class:"flex gap-2"},zu=["disabled"],Ju={key:1,class:"m-card p-5 text-sm text-muted"},Xu={key:2,class:"m-card divide-y divide-line"},Yu={class:"min-w-0"},Zu={class:"font-semibold"},Qu={class:"text-xs font-normal text-muted"},ed={key:0,class:"text-xs text-muted"},td={class:"flex gap-2"},sd=["onClick"],nd=["onClick"],id=_e({__name:"GroupsIndex",props:{groups:{},catalogue:{}},setup(e){const t=e,s=ot(null),n=gt({name:"",description:"",permissions:[]}),i=t.catalogue.flatMap(d=>d.permissions);function o(d){s.value=d,n.errors={},n.values.name=d==="new"?"":d.name,n.values.description=d==="new"?"":d.description??"",n.values.permissions=d==="new"?[]:[...d.permissions]}function l(d){n.values.permissions.includes(d.value)?n.values.permissions=[...new Set([...n.values.permissions,...d.needs])]:n.values.permissions=n.values.permissions.filter(h=>!i.find(b=>b.value===h)?.needs.includes(d.value))}async function r(){const d=s.value;(d==="new"?await n.send("post",`${I.base}/groups`):await n.send("put",`${I.base}/groups/${d.id}`))&&(be(_("Saved.")),s.value=null,await Ae())}async function a(d){window.confirm(_("Are you sure?"))&&(await Re.delete(`${I.base}/groups/${d.id}`),be(_("Deleted.")),await Ae())}return(d,h)=>(g(),y(V,null,[u("div",Lu,[u("h1",Fu,p(c(_)("Groups")),1),u("button",{type:"button",class:"m-btn m-btn-primary",onClick:h[0]||(h[0]=b=>o("new"))},p(c(_)("New group")),1)]),s.value?(g(),y("form",{key:0,class:"m-card mb-6 max-w-3xl space-y-4 p-5",onSubmit:De(r,["prevent"])},[u("div",null,[u("label",Bu,p(c(_)("Name")),1),B(u("input",{id:"g-name","onUpdate:modelValue":h[1]||(h[1]=b=>c(n).values.name=b),required:"",maxlength:"60",class:"m-input"},null,512),[[G,c(n).values.name]]),c(n).errors.name?(g(),y("p",Hu,p(c(n).errors.name),1)):M("",!0)]),u("div",null,[u("label",Ku,p(c(_)("Description")),1),B(u("textarea",{id:"g-desc","onUpdate:modelValue":h[2]||(h[2]=b=>c(n).values.description=b),rows:"2",maxlength:"500",class:"m-input"},null,512),[[G,c(n).values.description]])]),(g(!0),y(V,null,H(e.catalogue,b=>(g(),y("fieldset",{key:b.section,class:"rounded-lg border border-line p-3"},[u("legend",Wu,p(b.section),1),(g(!0),y(V,null,H(b.permissions,v=>(g(),y("label",{key:v.value,class:"flex items-center gap-2 py-0.5 text-sm"},[B(u("input",{"onUpdate:modelValue":h[3]||(h[3]=R=>c(n).values.permissions=R),type:"checkbox",value:v.value,onChange:R=>l(v)},null,40,qu),[[Nt,c(n).values.permissions]]),q(" "+p(v.label),1)]))),128))]))),128)),u("div",Gu,[u("button",{type:"submit",class:"m-btn m-btn-primary",disabled:c(n).busy},p(c(n).busy?c(_)("Saving…"):c(_)("Save")),9,zu),u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:h[4]||(h[4]=b=>s.value=null)},p(c(_)("Cancel")),1)])],32)):M("",!0),e.groups.length?(g(),y("ul",Xu,[(g(!0),y(V,null,H(e.groups,b=>(g(),y("li",{key:b.id,class:"flex flex-wrap items-center justify-between gap-3 p-4"},[u("div",Yu,[u("p",Zu,[q(p(b.name)+" ",1),u("span",Qu,"· "+p(b.accounts)+" "+p(c(_)("accounts")),1)]),b.description?(g(),y("p",ed,p(b.description),1)):M("",!0)]),u("div",td,[u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:v=>o(b)},p(c(_)("Edit")),9,sd),u("button",{type:"button",class:"m-btn m-btn-danger",onClick:v=>a(b)},p(c(_)("Delete")),9,nd)])]))),128))])):(g(),y("p",Ju,p(c(_)("Nothing here yet.")),1))],64))}}),od={class:"font-display mb-6 text-2xl font-bold"},ld={key:0,class:"m-error mb-4"},rd={class:"grid gap-6 md:grid-cols-2"},ad={class:"mb-3 font-semibold"},cd=["onSubmit"],ud=["onUpdate:modelValue","aria-label"],dd={type:"submit",class:"m-btn m-btn-primary"},fd={class:"divide-y divide-line"},pd={class:"min-w-0 truncate"},hd={class:"text-xs text-muted"},md={class:"flex gap-1"},gd=["onClick"],bd=["onClick"],_d=_e({__name:"LabelsIndex",props:{categories:{},tags:{}},setup(e){const t=[{type:"category",title:"Categories"},{type:"tag",title:"Tags"}],s=ot({category:"",tag:""}),n=ot("");async function i(a){n.value="";try{await a(),await Ae()}catch(d){if(d instanceof Rt&&d.status===422)n.value=Object.values(d.errors)[0]??d.message;else throw d}}const o=a=>i(async()=>{await Re.post(`${I.base}/labels`,{type:a,name:s.value[a]}),s.value[a]="",be(_("Created."))}),l=(a,d)=>{const h=window.prompt(_("New name"),d);return h&&h!==d?i(()=>Re.put(`${I.base}/labels`,{type:a,name:d,new_name:h})):void 0},r=(a,d)=>window.confirm(_("Are you sure?"))?i(()=>Re.delete(`${I.base}/labels`,{type:a,name:d})):void 0;return(a,d)=>(g(),y(V,null,[u("h1",od,p(c(_)("Categories and tags")),1),n.value?(g(),y("p",ld,p(n.value),1)):M("",!0),u("div",rd,[(g(),y(V,null,H(t,h=>u("section",{key:h.type,class:"m-card p-4"},[u("h2",ad,p(c(_)(h.title)),1),u("form",{class:"mb-3 flex gap-2",onSubmit:De(b=>o(h.type),["prevent"])},[B(u("input",{"onUpdate:modelValue":b=>s.value[h.type]=b,required:"",maxlength:"60",class:"m-input","aria-label":c(_)(h.title)},null,8,ud),[[G,s.value[h.type]]]),u("button",dd,p(c(_)("Add")),1)],40,cd),u("ul",fd,[(g(!0),y(V,null,H(h.type==="category"?e.categories:e.tags,b=>(g(),y("li",{key:b.name,class:"flex items-center justify-between gap-2 py-2 text-sm"},[u("span",pd,[q(p(b.name)+" ",1),u("span",hd,"· "+p(b.posts),1)]),u("span",md,[u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:v=>l(h.type,b.name)},p(c(_)("Rename")),9,gd),u("button",{type:"button",class:"m-btn m-btn-danger",onClick:v=>r(h.type,b.name)},p(c(_)("Delete")),9,bd)])]))),128))])])),64))])],64))}}),yd={class:"mb-6 flex flex-wrap items-center justify-between gap-3"},vd={class:"font-display text-2xl font-bold"},xd=["accept","disabled"],wd=["title"],$d={class:"h-2 overflow-hidden rounded-full bg-panel-2"},Sd={class:"m-help"},kd=["src","alt"],Cd={class:"min-w-0 flex-1 space-y-3"},Td={class:"m-label",for:"m-name"},Ad=["disabled"],Ed={key:0,class:"m-error"},Pd={key:0},Od={class:"m-label",for:"m-alt"},Md=["disabled"],Nd={class:"m-help"},Rd={key:0},Vd={key:1},Id={class:"m-help break-all"},jd={class:"flex gap-2"},Dd=["disabled"],Ud={key:1,class:"m-card p-5 text-sm text-muted"},Ld={key:2,class:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5"},Fd=["onClick"],Bd=["src","alt"],Hd={key:1,class:"grid aspect-square w-full place-items-center text-xs text-muted"},Kd={class:"block truncate px-2 py-1.5 text-xs"},Wd=_e({__name:"MediaLibrary",props:{items:{},max_file_mb:{},extensions:{},storage:{}},setup(e){const t=h=>I.permissions.includes(h),s=ot(!1),n=ot(null),i=gt({name:"",alt:""}),o=h=>h>1e6?`${(h/1e6).toFixed(1)} MB`:`${Math.max(1,Math.round(h/1e3))} kB`;function l(h){n.value=h,i.errors={},i.values.name=h.name,i.values.alt=h.alt??""}async function r(h){const b=h.target;s.value=!0;try{for(const v of Array.from(b.files??[])){const R=new FormData;R.append("file",v),await wa(`${I.base}/media`,R)}be(_("Uploaded.")),await Ae()}catch(v){be(v instanceof Rt?Object.values(v.errors)[0]??v.message:_("Something went wrong. Try again."),!0)}finally{s.value=!1,b.value=""}}async function a(){n.value&&await i.send("put",`${I.base}/media/${n.value.id}`)&&(be(_("Saved.")),n.value=null,await Ae())}async function d(h){const b=h.usage_count>0?_("This file is in use. Delete it anyway?"):_("Are you sure?");window.confirm(b)&&(await Re.delete(`${I.base}/media/${h.id}`),n.value=null,be(_("Deleted.")),await Ae())}return(h,b)=>(g(),y(V,null,[u("div",yd,[u("h1",vd,p(c(_)("Media")),1),t("media.upload")?(g(),y("label",{key:0,class:Ce(["m-btn m-btn-primary cursor-pointer",s.value?"opacity-50":""])},[q(p(s.value?c(_)("Uploading…"):c(_)("Upload"))+" ",1),u("input",{type:"file",multiple:"",class:"sr-only",accept:e.extensions.map(v=>"."+v).join(","),disabled:s.value,onChange:r},null,40,xd)],2)):M("",!0)]),u("div",{class:"mb-6 max-w-md",title:`${o(e.storage.used)} / ${o(e.storage.limit)}`},[u("div",$d,[u("div",{class:"h-full bg-brand",style:wt({width:Math.min(100,e.storage.used/Math.max(1,e.storage.limit)*100)+"%"})},null,4)]),u("p",Sd,p(o(e.storage.used))+" / "+p(o(e.storage.limit))+" · "+p(c(_)("Largest file"))+": "+p(e.max_file_mb)+" MB",1)],8,wd),n.value?(g(),y("form",{key:0,class:"m-card mb-6 flex max-w-3xl flex-wrap gap-5 p-5",onSubmit:De(a,["prevent"])},[n.value.is_image?(g(),y("img",{key:0,src:n.value.url,alt:n.value.alt??"",class:"h-32 w-32 rounded-lg object-cover"},null,8,kd)):M("",!0),u("div",Cd,[u("div",null,[u("label",Td,p(c(_)("Name")),1),B(u("input",{id:"m-name","onUpdate:modelValue":b[0]||(b[0]=v=>c(i).values.name=v),required:"",maxlength:"250",class:"m-input",disabled:!t("media.edit")},null,8,Ad),[[G,c(i).values.name]]),c(i).errors.name?(g(),y("p",Ed,p(c(i).errors.name),1)):M("",!0)]),n.value.is_image?(g(),y("div",Pd,[u("label",Od,p(c(_)("Alternative text")),1),B(u("input",{id:"m-alt","onUpdate:modelValue":b[1]||(b[1]=v=>c(i).values.alt=v),maxlength:"500",class:"m-input",disabled:!t("media.edit")},null,8,Md),[[G,c(i).values.alt]])])):M("",!0),u("p",Nd,[q(p(n.value.mime_type)+" · "+p(o(n.value.size)),1),n.value.width?(g(),y("span",Rd," · "+p(n.value.width)+"×"+p(n.value.height),1)):M("",!0),q(" · "+p(c(_)("Used"))+": "+p(n.value.usage_count),1),n.value.uploaded_by?(g(),y("span",Vd," · "+p(n.value.uploaded_by),1)):M("",!0)]),u("p",Id,p(n.value.url),1),u("div",jd,[t("media.edit")?(g(),y("button",{key:0,type:"submit",class:"m-btn m-btn-primary",disabled:c(i).busy},p(c(_)("Save")),9,Dd)):M("",!0),t("media.delete")?(g(),y("button",{key:1,type:"button",class:"m-btn m-btn-danger",onClick:b[2]||(b[2]=v=>d(n.value))},p(c(_)("Delete")),1)):M("",!0),u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:b[3]||(b[3]=v=>n.value=null)},p(c(_)("Cancel")),1)])])],32)):M("",!0),e.items.length?(g(),y("div",Ld,[(g(!0),y(V,null,H(e.items,v=>(g(),y("button",{key:v.id,type:"button",class:Ce(["m-card overflow-hidden text-left transition hover:border-brand",n.value?.id===v.id?"border-brand":""]),onClick:R=>l(v)},[v.is_image?(g(),y("img",{key:0,src:v.url,alt:v.alt??"",loading:"lazy",class:"aspect-square w-full object-cover"},null,8,Bd)):(g(),y("span",Hd,p(v.mime_type),1)),u("span",Kd,p(v.name),1)],10,Fd))),128))])):(g(),y("p",Ud,p(c(_)("No files yet.")),1))],64))}}),qd={class:"font-display mb-6 text-2xl font-bold"},Gd={class:"mb-6 grid grid-cols-2 gap-3 md:grid-cols-4"},zd={class:"text-2xl font-bold"},Jd={class:"m-help"},Xd={class:"mb-4 flex flex-wrap gap-2"},Yd=["onClick"],Zd=["placeholder","aria-label"],Qd=["aria-label"],ef={value:""},tf=["value"],sf={type:"submit",class:"m-btn m-btn-secondary"},nf={key:0,class:"m-card p-5 text-sm text-muted"},of={key:1,class:"m-card divide-y divide-line"},lf={class:"min-w-0"},rf={class:"font-semibold"},af={key:1},cf={class:"text-xs text-muted"},uf={class:"flex gap-2"},df={key:0,class:"m-badge"},ff=["onClick"],pf={key:2,class:"mt-4 flex items-center gap-2"},hf={class:"text-sm text-muted"},mf={class:"font-display mb-3 mt-10 text-xl font-bold"},gf={class:"m-label",for:"b-min"},bf={class:"min-w-[10rem] flex-1"},_f={class:"m-label",for:"b-why"},yf={key:0,class:"flex items-center gap-2 text-sm"},vf={type:"submit",class:"m-btn m-btn-danger"},xf={key:1,class:"m-error w-full"},wf={key:4,class:"text-sm text-muted"},$f={key:5,class:"m-card divide-y divide-line"},Sf={class:"font-semibold"},kf={key:0,class:"m-badge"},Cf={key:1,class:"m-badge"},Tf={class:"text-xs text-muted"},Af=["onClick"],Ef={class:"font-display mb-3 mt-10 text-xl font-bold"},Pf={class:"flex items-center gap-2 text-sm sm:col-span-2"},Of={class:"m-label",for:"r-max"},Mf={class:"m-label",for:"r-win"},Nf={class:"m-label",for:"r-ban"},Rf={class:"m-label",for:"r-keep"},Vf=["max"],If={class:"m-help"},jf={class:"sm:col-span-2"},Df=["disabled"],Uf={class:"font-display mb-3 mt-10 text-xl font-bold"},Lf={class:"m-label",for:"n-group"},Ff={class:"min-w-[10rem] flex-1"},Bf={class:"m-label",for:"n-note"},Hf={type:"submit",class:"m-btn m-btn-secondary"},Kf={key:0,class:"m-error w-full"},Wf={key:0,class:"m-card divide-y divide-line text-sm"},qf={key:0,class:"m-badge"},Gf=_e({__name:"AuditLog",props:{entries:{},pagination:{},filters:{},accounts:{},summary:{},bans:{},notes:{},settings:{},max_keep_days:{},can_manage:{type:Boolean},my_ip:{},never_banned:{},whole_site_bans:{type:Boolean}},setup(e){const t=e,s=["all","logins","failed","actions","viewed","refused","bans"],n=Kt({q:t.filters.q,ip:t.filters.ip,user:t.filters.user??""}),i=N=>new Date(N).toLocaleString();function o(N){const C=new URLSearchParams,w={show:t.filters.show,q:n.q,ip:n.ip,user:n.user,...N};for(const[z,K]of Object.entries(w))K!==""&&K!=="all"&&K!==1&&C.set(z,String(K));zs(`${I.base}/audit${C.size?"?"+C:""}`)}const l=gt({ip:"",minutes:1440,reason:"",whole_site:!1});async function r(N){N&&(l.values.ip=N);const C=await l.send("post",`${I.base}/audit/bans`);C&&(be(C.message),l.values.ip=l.values.reason="",await Ae())}async function a(N){be((await Re.delete(`${I.base}/audit/bans/${N.id}`)).message),await Ae()}const d=gt({...t.settings});async function h(){await d.send("put",`${I.base}/audit/settings`)&&(be(_("Saved.")),await Ae())}const b=gt({ip:"",group:"",note:""});async function v(){await b.send("put",`${I.base}/audit/notes`)&&(be(_("Saved.")),b.values.ip=b.values.group=b.values.note="",await Ae())}const R=N=>N.expires_at?i(N.expires_at):_("until lifted");return(N,C)=>(g(),y(V,null,[u("h1",qd,p(c(_)("Audit log")),1),u("div",Gd,[(g(!0),y(V,null,H(e.summary,(w,z)=>(g(),y("div",{key:z,class:"m-card p-4"},[u("p",zd,p(w),1),u("p",Jd,p(c(_)(z==="banned"?"Addresses banned":z==="logins"?"Logins (24 h)":z==="failed"?"Failed logins (24 h)":"Refused (24 h)")),1)]))),128))]),u("nav",Xd,[(g(),y(V,null,H(s,w=>u("button",{key:w,type:"button",class:Ce(["m-btn",e.filters.show===w?"m-btn-primary":"m-btn-secondary"]),onClick:z=>o({show:w,page:1})},p(c(_)(w)),11,Yd)),64))]),u("form",{class:"mb-4 flex flex-wrap gap-2",onSubmit:C[3]||(C[3]=De(w=>o({page:1}),["prevent"]))},[B(u("input",{"onUpdate:modelValue":C[0]||(C[0]=w=>n.q=w),class:"m-input max-w-xs",placeholder:c(_)("Search"),"aria-label":c(_)("Search")},null,8,Zd),[[G,n.q]]),B(u("input",{"onUpdate:modelValue":C[1]||(C[1]=w=>n.ip=w),class:"m-input max-w-[12rem]",placeholder:"IP","aria-label":"IP"},null,512),[[G,n.ip]]),B(u("select",{"onUpdate:modelValue":C[2]||(C[2]=w=>n.user=w),class:"m-input max-w-[12rem]","aria-label":c(_)("Account")},[u("option",ef,p(c(_)("Everyone")),1),(g(!0),y(V,null,H(e.accounts,w=>(g(),y("option",{key:w.id,value:w.id},p(w.name),9,tf))),128))],8,Qd),[[pa,n.user]]),u("button",sf,p(c(_)("Filter")),1)],32),e.entries.length?(g(),y("ul",of,[(g(!0),y(V,null,H(e.entries,w=>(g(),y("li",{key:w.id,class:"flex flex-wrap items-start justify-between gap-3 p-4 text-sm"},[u("div",lf,[u("p",rf,[q(p(w.summary)+" ",1),w.subject?(g(),y(V,{key:0},[C[19]||(C[19]=q(" · ",-1)),w.subject.url?(g(),ke(ze,{key:0,href:w.subject.url,class:"underline"},{default:Ie(()=>[q(p(w.subject.label),1)]),_:2},1032,["href"])):(g(),y("span",af,p(w.subject.label),1))],64)):M("",!0)]),u("p",cf,p(i(w.at))+" · "+p(w.who??w.email??c(_)("Someone"))+" · "+p(w.ip)+" · "+p(w.browser),1)]),u("span",uf,[w.banned?(g(),y("span",df,p(c(_)("banned")),1)):M("",!0),e.can_manage&&w.ip&&!w.banned&&!w.never_banned&&w.ip!==e.my_ip?(g(),y("button",{key:1,type:"button",class:"m-btn m-btn-danger",onClick:z=>r(w.ip)},p(c(_)("Ban")),9,ff)):M("",!0)])]))),128))])):(g(),y("p",nf,p(c(_)("Nothing here yet.")),1)),e.pagination.pages>1?(g(),y("nav",pf,[e.pagination.page>1?(g(),y("button",{key:0,type:"button",class:"m-btn m-btn-secondary",onClick:C[4]||(C[4]=w=>o({page:e.pagination.page-1}))},p(c(_)("Previous")),1)):M("",!0),u("span",hf,p(e.pagination.page)+" / "+p(e.pagination.pages),1),e.pagination.pageo({page:e.pagination.page+1}))},p(c(_)("Next")),1)):M("",!0)])):M("",!0),u("h2",mf,p(c(_)("Bans")),1),e.can_manage?(g(),y("form",{key:3,class:"m-card mb-4 flex max-w-3xl flex-wrap items-end gap-3 p-4",onSubmit:C[10]||(C[10]=De(w=>r(),["prevent"]))},[u("div",null,[C[20]||(C[20]=u("label",{class:"m-label",for:"b-ip"},"IP",-1)),B(u("input",{id:"b-ip","onUpdate:modelValue":C[6]||(C[6]=w=>c(l).values.ip=w),required:"",class:"m-input"},null,512),[[G,c(l).values.ip]])]),u("div",null,[u("label",gf,p(c(_)("Minutes (0 = until lifted)")),1),B(u("input",{id:"b-min","onUpdate:modelValue":C[7]||(C[7]=w=>c(l).values.minutes=w),type:"number",min:"0",class:"m-input w-32"},null,512),[[G,c(l).values.minutes,void 0,{number:!0}]])]),u("div",bf,[u("label",_f,p(c(_)("Reason")),1),B(u("input",{id:"b-why","onUpdate:modelValue":C[8]||(C[8]=w=>c(l).values.reason=w),maxlength:"200",class:"m-input"},null,512),[[G,c(l).values.reason]])]),e.whole_site_bans?(g(),y("label",yf,[B(u("input",{"onUpdate:modelValue":C[9]||(C[9]=w=>c(l).values.whole_site=w),type:"checkbox"},null,512),[[Nt,c(l).values.whole_site]]),q(" "+p(c(_)("Whole site")),1)])):M("",!0),u("button",vf,p(c(_)("Ban")),1),c(l).errors.ip?(g(),y("p",xf,p(c(l).errors.ip),1)):M("",!0)],32)):M("",!0),e.bans.length?(g(),y("ul",$f,[(g(!0),y(V,null,H(e.bans,w=>(g(),y("li",{key:w.id,class:Ce(["flex flex-wrap items-center justify-between gap-3 p-4 text-sm",w.active?"":"opacity-50"])},[u("div",null,[u("p",Sf,[q(p(w.ip)+" ",1),w.automatic?(g(),y("span",kf,p(c(_)("automatic")),1)):M("",!0),C[21]||(C[21]=q()),w.whole_site?(g(),y("span",Cf,p(c(_)("whole site")),1)):M("",!0)]),u("p",Tf,p(w.reason)+" · "+p(R(w))+" · "+p(w.hits)+" "+p(c(_)("hits")),1)]),e.can_manage&&w.active?(g(),y("button",{key:0,type:"button",class:"m-btn m-btn-secondary",onClick:z=>a(w)},p(c(_)("Lift")),9,Af)):M("",!0)],2))),128))])):(g(),y("p",wf,p(c(_)("No bans.")),1)),e.can_manage?(g(),y(V,{key:6},[u("h2",Ef,p(c(_)("Rules")),1),u("form",{class:"m-card grid max-w-3xl gap-4 p-5 sm:grid-cols-2",onSubmit:De(h,["prevent"])},[u("label",Pf,[B(u("input",{"onUpdate:modelValue":C[11]||(C[11]=w=>c(d).values.auto_ban=w),type:"checkbox"},null,512),[[Nt,c(d).values.auto_ban]]),q(" "+p(c(_)("Ban an address by itself after too many failed logins")),1)]),u("div",null,[u("label",Of,p(c(_)("Failed logins")),1),B(u("input",{id:"r-max","onUpdate:modelValue":C[12]||(C[12]=w=>c(d).values.max_failures=w),type:"number",min:"3",max:"100",class:"m-input"},null,512),[[G,c(d).values.max_failures,void 0,{number:!0}]])]),u("div",null,[u("label",Mf,p(c(_)("Within minutes")),1),B(u("input",{id:"r-win","onUpdate:modelValue":C[13]||(C[13]=w=>c(d).values.window_minutes=w),type:"number",min:"1",max:"1440",class:"m-input"},null,512),[[G,c(d).values.window_minutes,void 0,{number:!0}]])]),u("div",null,[u("label",Nf,p(c(_)("Ban for minutes (0 = until lifted)")),1),B(u("input",{id:"r-ban","onUpdate:modelValue":C[14]||(C[14]=w=>c(d).values.ban_minutes=w),type:"number",min:"0",class:"m-input"},null,512),[[G,c(d).values.ban_minutes,void 0,{number:!0}]])]),u("div",null,[u("label",Rf,p(c(_)("Keep the log (days)")),1),B(u("input",{id:"r-keep","onUpdate:modelValue":C[15]||(C[15]=w=>c(d).values.keep_days=w),type:"number",min:"7",max:e.max_keep_days,class:"m-input"},null,8,Vf),[[G,c(d).values.keep_days,void 0,{number:!0}]]),u("p",If,"≤ "+p(e.max_keep_days),1)]),u("div",jf,[u("button",{type:"submit",class:"m-btn m-btn-primary",disabled:c(d).busy},p(c(_)("Save")),9,Df)]),(g(!0),y(V,null,H(c(d).errors,(w,z)=>(g(),y("p",{key:z,class:"m-error sm:col-span-2"},p(w),1))),128))],32),u("h2",Uf,p(c(_)("Notes about addresses")),1),u("form",{class:"m-card mb-4 flex max-w-3xl flex-wrap items-end gap-3 p-4",onSubmit:De(v,["prevent"])},[u("div",null,[C[22]||(C[22]=u("label",{class:"m-label",for:"n-ip"},"IP",-1)),B(u("input",{id:"n-ip","onUpdate:modelValue":C[16]||(C[16]=w=>c(b).values.ip=w),required:"",class:"m-input"},null,512),[[G,c(b).values.ip]])]),u("div",null,[u("label",Lf,p(c(_)("Group")),1),B(u("input",{id:"n-group","onUpdate:modelValue":C[17]||(C[17]=w=>c(b).values.group=w),maxlength:"60",class:"m-input"},null,512),[[G,c(b).values.group]])]),u("div",Ff,[u("label",Bf,p(c(_)("Note")),1),B(u("input",{id:"n-note","onUpdate:modelValue":C[18]||(C[18]=w=>c(b).values.note=w),maxlength:"2000",class:"m-input"},null,512),[[G,c(b).values.note]])]),u("button",Hf,p(c(_)("Save")),1),c(b).errors.ip?(g(),y("p",Kf,p(c(b).errors.ip),1)):M("",!0)],32),e.notes.length?(g(),y("ul",Wf,[(g(!0),y(V,null,H(e.notes,w=>(g(),y("li",{key:w.ip,class:"p-3"},[u("b",null,p(w.ip),1),C[23]||(C[23]=q()),w.group?(g(),y("span",qf,p(w.group),1)):M("",!0),q(" "+p(w.note),1)]))),128))])):M("",!0)],64)):M("",!0)],64))}}),zf={class:"mb-6 flex flex-wrap items-center justify-between gap-3"},Jf={class:"font-display text-2xl font-bold"},Xf={class:"text-sm text-muted"},Yf={key:0},Zf={class:"mb-6 flex flex-wrap gap-2"},Qf={class:"mb-6 grid grid-cols-2 gap-3 md:grid-cols-5"},ep={class:"text-2xl font-bold"},tp={class:"m-help"},sp={class:"m-card mb-6 p-4"},np={class:"mb-3 font-semibold"},ip=["aria-label"],op=["title"],lp={class:"mb-6 grid gap-6 md:grid-cols-2"},rp={class:"m-card p-4"},ap={class:"mb-3 font-semibold"},cp={key:0,class:"text-sm text-muted"},up={class:"divide-y divide-line text-sm"},dp={class:"truncate"},fp={class:"text-muted"},pp={class:"m-card p-4"},hp={class:"mb-3 font-semibold"},mp={key:0,class:"text-sm text-muted"},gp={class:"divide-y divide-line text-sm"},bp={class:"truncate"},_p={class:"text-muted"},yp={class:"mb-3 font-semibold"},vp={key:0,class:"text-sm text-muted"},xp={class:"divide-y divide-line text-sm"},wp={class:"truncate"},$p={class:"text-muted"},Sp={class:"m-card mb-6 overflow-x-auto p-4"},kp={class:"mb-3 font-semibold"},Cp={class:"space-y-0.5 text-xs"},Tp={class:"w-9 shrink-0 text-muted"},Ap=["title"],Ep={class:"m-card mb-6 p-4"},Pp={class:"mb-3 font-semibold"},Op={class:"text-sm font-normal text-muted"},Mp={key:0,class:"text-sm text-muted"},Np={class:"divide-y divide-line text-sm"},Rp={class:"text-xs text-muted"},Vp={class:"text-muted"},Ip={class:"flex flex-wrap items-center gap-2 text-sm"},jp={class:"text-muted"},Dp=["href"],Up=_e({__name:"StatisticsReport",props:{range:{},ranges:{},exports:{},totals:{},previous:{},series:{},pages:{},posts:{},channels:{},sources:{},countries:{},devices:{},browsers:{},systems:{},heatmap:{},bots:{}},setup(e){const t=e,s=vt(()=>[["Visitors","visitors"],["Visits","visits"],["Page views","page_views"],["Average time","average_seconds"],["Bounce rate","bounce_rate"]]),n=(h,b)=>h==="average_seconds"?`${Math.floor(b/60)}:${String(b%60).padStart(2,"0")}`:h==="bounce_rate"?`${b}%`:b.toLocaleString(),i=h=>{const b=t.previous?.[h];return b?Math.round((t.totals[h]-b)/b*100):null},o=vt(()=>Math.max(1,...t.series.map(h=>h.visits))),l=vt(()=>Math.max(1,...t.heatmap.flatMap(h=>h.hours))),r=vt(()=>[["Channels",t.channels],["Sources",t.sources],["Countries",t.countries],["Devices",t.devices],["Browsers",t.browsers],["Systems",t.systems]]),a=h=>`${I.base}/statistics?range=${h}`,d=h=>`${I.base}/statistics/export?sheet=${h}&range=${new URLSearchParams(ie.path.split("?")[1]??"").get("range")??t.range.key}`;return(h,b)=>(g(),y(V,null,[u("div",zf,[u("h1",Jf,p(c(_)("Statistics")),1),u("p",Xf,[q(p(e.range.from)+" → "+p(e.range.to),1),e.range.compared_to?(g(),y("span",Yf," · "+p(c(_)("compared with"))+" "+p(e.range.compared_to),1)):M("",!0)])]),u("nav",Zf,[(g(!0),y(V,null,H(e.ranges,v=>(g(),ke(ze,{key:v.key,href:a(v.key),class:Ce(["m-btn",e.range.key===v.key?"m-btn-primary":"m-btn-secondary"])},{default:Ie(()=>[q(p(v.label),1)]),_:2},1032,["href","class"]))),128))]),u("div",Qf,[(g(!0),y(V,null,H(s.value,([v,R])=>(g(),y("div",{key:R,class:"m-card p-4"},[u("p",ep,p(n(R,e.totals[R])),1),u("p",tp,[q(p(c(_)(v)),1),i(R)!==null?(g(),y("span",{key:0,class:Ce((i(R)??0)>=0?"text-emerald-500":"text-red-500")},p((i(R)??0)>0?"+":"")+p(i(R))+"%",3)):M("",!0)])]))),128))]),u("section",sp,[u("h2",np,p(c(_)("Visits")),1),u("div",{class:"flex h-40 items-end gap-px",role:"img","aria-label":c(_)("Visits")},[(g(!0),y(V,null,H(e.series,v=>(g(),y("div",{key:v.key,class:"min-w-px flex-1 rounded-t bg-brand",style:wt({height:Math.max(2,v.visits/o.value*100)+"%"}),title:`${v.label}: ${v.visits}`},null,12,op))),128))],8,ip)]),u("div",lp,[u("section",rp,[u("h2",ap,p(c(_)("Pages")),1),e.pages.length?M("",!0):(g(),y("p",cp,p(c(_)("Nothing here yet.")),1)),u("ul",up,[(g(!0),y(V,null,H(e.pages,v=>(g(),y("li",{key:v.path,class:"flex justify-between gap-3 py-1.5"},[u("span",dp,p(v.title??v.path),1),u("span",fp,p(v.views),1)]))),128))])]),u("section",pp,[u("h2",hp,p(c(_)("Posts")),1),e.posts.length?M("",!0):(g(),y("p",mp,p(c(_)("Nothing here yet.")),1)),u("ul",gp,[(g(!0),y(V,null,H(e.posts,v=>(g(),y("li",{key:v.slug,class:"flex justify-between gap-3 py-1.5"},[u("span",bp,p(v.title),1),u("span",_p,p(v.views),1)]))),128))])]),(g(!0),y(V,null,H(r.value,([v,R])=>(g(),y("section",{key:v,class:"m-card p-4"},[u("h2",yp,p(c(_)(v)),1),R.length?M("",!0):(g(),y("p",vp,p(c(_)("Nothing here yet.")),1)),u("ul",xp,[(g(!0),y(V,null,H(R,N=>(g(),y("li",{key:N.name+(N.channel??""),class:"flex justify-between gap-3 py-1.5"},[u("span",wp,p(N.name||c(_)("Direct")),1),u("span",$p,p(N.visits),1)]))),128))])]))),128))]),u("section",Sp,[u("h2",kp,p(c(_)("When people visit")),1),u("div",Cp,[(g(!0),y(V,null,H(e.heatmap,v=>(g(),y("div",{key:v.day,class:"flex items-center gap-0.5"},[u("span",Tp,p(v.day),1),(g(!0),y(V,null,H(v.hours,(R,N)=>(g(),y("span",{key:N,class:"block h-5 min-w-3 flex-1 rounded-sm border border-line",title:`${v.day} ${N}:00 · ${R}`,style:wt({background:`color-mix(in srgb, var(--m-brand) ${Math.round(R/l.value*100)}%, var(--m-panel-2))`})},null,12,Ap))),128))]))),128))])]),u("section",Ep,[u("h2",Pp,[q(p(c(_)("Programs"))+" ",1),u("span",Op,"· "+p(e.bots.total),1)]),e.bots.names.length?M("",!0):(g(),y("p",Mp,p(c(_)("Nothing here yet.")),1)),u("ul",Np,[(g(!0),y(V,null,H(e.bots.names,v=>(g(),y("li",{key:v.name,class:"flex justify-between gap-3 py-1.5"},[u("span",null,[q(p(v.name)+" ",1),u("span",Rp,p(v.kind),1)]),u("span",Vp,p(v.hits),1)]))),128))])]),u("p",Ip,[u("span",jp,p(c(_)("Download"))+":",1),(g(!0),y(V,null,H(e.exports,(v,R)=>(g(),y("a",{key:R,href:d(String(R)),class:"m-btn m-btn-secondary"},p(v)+" (CSV)",9,Dp))),128))])],64))}}),Lp={class:"font-display mb-6 text-2xl font-bold"},Fp={key:0,class:"m-card p-5 text-sm text-muted"},Bp={key:1,class:"m-card divide-y divide-line"},Hp={class:"min-w-0"},Kp={class:"truncate font-semibold"},Wp={class:"truncate text-xs text-muted"},qp={class:"m-badge"},Gp={key:2,class:"mt-4 flex gap-2"},zp=_e({__name:"ListPage",props:{data:{},current_page:{},last_page:{},path:{}},setup(e){const t=e,s=vt(()=>ie.path.includes("/reviews")?"reviews":"pages"),n=vt(()=>s.value==="reviews"?"Reviews":"Pages"),i=a=>s.value==="reviews"?a.author:a.title,o=a=>s.value==="reviews"?a.rating?"★".repeat(a.rating):"":a.slug,l=a=>s.value==="reviews"?a.is_visible:a.is_published,r=a=>`${ie.path.split("?")[0]}?page=${a}`;return(a,d)=>(g(),y(V,null,[u("h1",Lp,p(c(_)(n.value)),1),t.data.length?(g(),y("ul",Bp,[(g(!0),y(V,null,H(t.data,h=>(g(),y("li",{key:h.id,class:"flex items-center justify-between gap-3 p-4"},[u("div",Hp,[u("p",Kp,p(i(h)),1),u("p",Wp,p(o(h)),1)]),u("span",qp,p(l(h)?c(_)("Published"):c(_)("Draft")),1)]))),128))])):(g(),y("p",Fp,p(c(_)("Nothing here yet.")),1)),t.last_page>1?(g(),y("nav",Gp,[t.current_page>1?(g(),ke(ze,{key:0,href:r(t.current_page-1),class:"m-btn m-btn-secondary"},{default:Ie(()=>[q(p(c(_)("Previous")),1)]),_:1},8,["href"])):M("",!0),t.current_page[q(p(c(_)("Next")),1)]),_:1},8,["href"])):M("",!0)])):M("",!0)],64))}}),Jp=[{pattern:/^\/?$/,component:Ea,data:!0},{pattern:/^\/login$/,component:Wa,guest:!0},{pattern:/^\/profile$/,component:fu,data:!0},{pattern:/^\/posts$/,component:Lc,data:!0},{pattern:/^\/posts\/create$/,component:Ci,data:!0},{pattern:/^\/posts\/\d+\/edit$/,component:Ci,data:!0},{pattern:/^\/media$/,component:Wd,data:!0,source:"/media/items"},{pattern:/^\/audit$/,component:Gf,data:!0},{pattern:/^\/statistics$/,component:Up,data:!0},{pattern:/^\/accounts$/,component:Uu,data:!0},{pattern:/^\/groups$/,component:id,data:!0},{pattern:/^\/labels$/,component:_d,data:!0},{pattern:/^\/(pages|reviews)$/,component:zp,data:!0}],ie=Kt({path:"",component:null,props:{},loading:!0,forbidden:!1,toast:null});let Ti;function be(e,t=!1){ie.toast={text:e,error:t},window.clearTimeout(Ti),Ti=window.setTimeout(()=>ie.toast=null,4e3)}function Xp(e){return e.split("?")[0].slice(I.base.length)||"/"}async function Vs(e){const t=Jp.find(s=>s.pattern.test(Xp(e)));if(!I.user&&!t?.guest){window.location.assign(I.base+"/login");return}if(I.user&&t?.guest)return zs(I.base,!0);ie.loading=!0,ie.forbidden=!1,ie.path=e,ie.component=t?.component??Ma,ie.props={};try{ie.props=t?.data?await Re.get(t.source?I.base+t.source:e):{}}catch(s){s instanceof Rt&&s.status===401?window.location.assign(I.base+"/login"):s instanceof Rt&&s.status===403?ie.forbidden=!0:be(_("Something went wrong. Try again."),!0)}finally{ie.loading=!1}}function zs(e,t=!1){return window.history[t?"replaceState":"pushState"]({},"",e),window.scrollTo(0,0),Vs(e)}function Ae(){return Vs(ie.path)}function Yp(){window.addEventListener("popstate",()=>Vs(window.location.pathname+window.location.search)),Vs(window.location.pathname+window.location.search)}const Zp={class:"min-h-screen"},Qp={class:"fixed inset-x-0 top-0 z-40 flex h-14 items-center justify-between border-b border-line bg-panel px-4 md:hidden"},eh={class:"font-display font-bold"},th=["aria-expanded"],sh={class:"hidden h-16 items-center gap-2 px-5 md:flex"},nh=["src"],ih={class:"font-display text-lg font-bold"},oh={class:"flex-1 space-y-0.5 overflow-y-auto px-3 py-3","aria-label":"Manager"},lh={class:"border-t border-line p-4"},rh={class:"truncate text-sm font-semibold group-hover:text-brand"},ah={class:"truncate text-xs text-muted"},ch={class:"px-4 pb-16 pt-20 md:ml-60 md:px-8 md:pt-8"},uh={class:"mx-auto max-w-5xl"},dh=_e({__name:"Layout",setup(e){const t=ot(!1),s=vt(()=>[{label:"Dashboard",href:I.base},...I.navigation]);function n(o){const l=ie.path.split("?")[0];return o===I.base?l===o:l===o||l.startsWith(o+"/")}async function i(){const{redirect:o}=await Re.post(I.base+"/logout");window.location.assign(o)}return Cs(()=>ie.path,()=>t.value=!1),(o,l)=>(g(),y("div",Zp,[u("header",Qp,[u("span",eh,p(c(I).name),1),u("button",{type:"button",class:"m-btn m-btn-secondary","aria-expanded":t.value,onClick:l[0]||(l[0]=r=>t.value=!t.value)},p(c(_)("Menu")),9,th)]),u("aside",{class:Ce(["fixed inset-y-0 left-0 z-30 flex w-60 flex-col border-r border-line bg-panel pt-14 transition-transform md:translate-x-0 md:pt-0",t.value?"translate-x-0":"-translate-x-full"])},[u("div",sh,[c(I).logo?(g(),y("img",{key:0,src:c(I).logo,alt:"",class:"h-7 w-auto"},null,8,nh)):M("",!0),u("span",ih,p(c(I).name),1)]),u("nav",oh,[(g(!0),y(V,null,H(s.value,r=>(g(),ke(ze,{key:r.href,href:r.href,class:Ce(["block rounded-lg px-3 py-2 text-sm font-medium transition",n(r.href)?"bg-brand/15 text-text":"text-muted hover:bg-text/5 hover:text-text"]),"aria-current":n(r.href)?"page":void 0},{default:Ie(()=>[q(p(c(_)(r.label)),1)]),_:2},1032,["href","class","aria-current"]))),128))]),u("div",lh,[Ne(ze,{href:c(I).base+"/profile",class:"group block"},{default:Ie(()=>[u("p",rh,p(c(I).user?.name),1),u("p",ah,p(c(I).user?.email),1)]),_:1},8,["href"]),u("button",{type:"button",class:"m-btn m-btn-secondary mt-3 w-full justify-center",onClick:i},p(c(_)("Log out")),1)])],2),t.value?(g(),y("div",{key:0,class:"fixed inset-0 z-20 bg-black/60 md:hidden",onClick:l[1]||(l[1]=r=>t.value=!1)})):M("",!0),u("main",ch,[u("div",uh,[mo(o.$slots,"default")])])]))}}),fh={key:0,class:"m-card p-5 text-sm"},ph={key:1,class:"text-sm text-muted"},hh=_e({__name:"App",setup(e){return(t,s)=>(g(),y(V,null,[c(ie).component&&!c(I).user?(g(),ke(ei(c(ie).component),{key:0})):c(ie).component?(g(),ke(dh,{key:1},{default:Ie(()=>[c(ie).forbidden?(g(),y("p",fh,p(c(_)("You may not open this page.")),1)):c(ie).loading?(g(),y("p",ph,p(c(_)("Loading…")),1)):(g(),ke(ei(c(ie).component),tl(Io({key:2},c(ie).props)),null,16))]),_:1})):M("",!0),c(ie).toast?(g(),y("div",{key:2,role:"status",class:Ce(["fixed bottom-5 right-5 z-50 rounded-lg border border-l-4 border-line bg-panel px-4 py-3 text-sm font-medium text-text shadow-xl",c(ie).toast.error?"border-l-red-500":"border-l-emerald-500"])},p(c(ie).toast.text),3)):M("",!0)],64))}});Sa(I.locale);ya(hh).mount("#manager");Yp(); diff --git a/resources/views/shell.blade.php b/resources/views/shell.blade.php new file mode 100644 index 0000000..3ff5eb3 --- /dev/null +++ b/resources/views/shell.blade.php @@ -0,0 +1,17 @@ + + + + + + + {{ $title }} + {{-- The theme: values were checked by IriksIT\Manager\Support\Themes, nothing else goes in here. --}} + + + + +
+ + + + diff --git a/routes/guest.php b/routes/guest.php new file mode 100644 index 0000000..e12743a --- /dev/null +++ b/routes/guest.php @@ -0,0 +1,10 @@ +name('assets')->where('file', '[a-z.]+'); +Route::get('/login', fn () => abort(404))->name('login'); // the shell answers browsers before this runs +Route::post('/login', [LoginController::class, 'store'])->name('login.store')->middleware('throttle:manager-login'); diff --git a/routes/manager.php b/routes/manager.php index 752ce8f..7283459 100644 --- a/routes/manager.php +++ b/routes/manager.php @@ -2,5 +2,10 @@ use Illuminate\Support\Facades\Route; use IriksIT\Manager\Http\Controllers\DashboardController; +use IriksIT\Manager\Http\Controllers\LoginController; +use IriksIT\Manager\Http\Controllers\ProfileController; Route::get('/', DashboardController::class)->name('dashboard'); +Route::get('/profile', [ProfileController::class, 'show'])->name('profile.show'); +Route::put('/profile', [ProfileController::class, 'update'])->name('profile.update'); +Route::post('/logout', [LoginController::class, 'destroy'])->name('logout'); diff --git a/src/Console/DoctorCommand.php b/src/Console/DoctorCommand.php new file mode 100644 index 0000000..b5f0231 --- /dev/null +++ b/src/Console/DoctorCommand.php @@ -0,0 +1,157 @@ + */ + private array $checks = []; + + public function handle(ModuleRegistry $modules): int + { + $this->checkUserModel($modules); + $this->checkTables($modules); + $this->checkRoutes(); + $this->checkModules($modules); + + $failed = collect($this->checks)->contains('status', 'fail'); + + if ($this->option('json')) { + $this->line(json_encode(['ok' => ! $failed, 'checks' => $this->checks], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); + } else { + foreach ($this->checks as $check) { + $line = sprintf('[%s] %s: %s', strtoupper($check['status']), $check['check'], $check['message']); + $check['status'] === 'fail' ? $this->error($line) : ($check['status'] === 'warn' ? $this->warn($line) : $this->info($line)); + + if ($check['fix'] !== null && $check['status'] !== 'ok') { + $this->line(' fix: '.$check['fix']); + } + } + } + + return $failed ? self::FAILURE : self::SUCCESS; + } + + private function add(string $check, string $status, string $message, ?string $fix = null): void + { + $this->checks[] = ['check' => $check, 'status' => $status, 'message' => $message, 'fix' => $fix]; + } + + private function checkUserModel(ModuleRegistry $modules): void + { + $model = config('manager.user_model'); + + if (! is_string($model) || ! class_exists($model)) { + $this->add('user_model', 'fail', 'manager.user_model is not a class: '.var_export($model, true), 'Set MANAGER_USER_MODEL (or manager.user_model) to your User model, for example App\\Models\\User.'); + + return; + } + + $this->add('user_model', 'ok', "The user model is {$model}."); + + $guard = config('auth.defaults.guard'); + $loggedIn = config('auth.providers.'.config("auth.guards.{$guard}.provider").'.model'); + + if (is_string($loggedIn) && $loggedIn !== $model && ! is_subclass_of($loggedIn, $model) && ! is_subclass_of($model, $loggedIn)) { + $this->add('auth_model', 'fail', "People log in as {$loggedIn} (config/auth.php), but manager.user_model is {$model}: the manager would not know their rights.", 'Point manager.user_model (MANAGER_USER_MODEL) at the same model as the auth provider.'); + } + + if (! in_array(HasManagerAccess::class, class_uses_recursive($model), true)) { + $this->add('user_trait', 'fail', "{$model} does not use HasManagerAccess.", "Add `use \\IriksIT\\Manager\\Concerns\\HasManagerAccess;` inside the class {$model}."); + + return; + } + + $this->add('user_trait', 'ok', 'The user model uses HasManagerAccess.'); + + if (in_array('is_super_admin', (new $model)->getFillable(), true)) { + $this->add('super_admin_fillable', 'fail', 'is_super_admin is mass assignable: anyone who can fill the model could make themselves a super admin.', 'Remove is_super_admin from $fillable of the user model.'); + } + + if ($modules->enabled('users') && Schema::hasTable((new $model)->getTable()) && Schema::hasTable(config('manager.table_prefix').'groups')) { + $admins = $model::query()->where('is_super_admin', true)->count(); + $admins > 0 + ? $this->add('super_admin', 'ok', "{$admins} super admin(s) exist.") + : $this->add('super_admin', 'warn', 'There is no super admin yet: nobody can manage groups.', 'php artisan manager:create-user --name=... --email=... --password=...'); + } + } + + private function checkTables(ModuleRegistry $modules): void + { + $prefix = config('manager.table_prefix'); + $missing = []; + + foreach ($modules->active() as $module) { + foreach (method_exists($module, 'tables') ? $module->tables() : [] as $table) { + if (! Schema::hasTable($prefix.$table)) { + $missing[] = $prefix.$table; + } + } + } + + $missing === [] + ? $this->add('tables', 'ok', 'The tables of every active module exist.') + : $this->add('tables', 'fail', 'Missing tables: '.implode(', ', $missing), 'php artisan migrate'); + } + + private function checkRoutes(): void + { + Route::has('manager.dashboard') + ? $this->add('routes', 'ok', 'The manager routes are registered under /'.trim((string) config('manager.path'), '/').'.') + : $this->add('routes', 'fail', 'The manager routes are not registered.', 'Run `composer dump-autoload` and make sure the package service provider is discovered (not in dont-discover).'); + + if (Route::has('login')) { + $this->add('login', 'ok', 'The app has a login route.'); + } elseif (Route::has('manager.login')) { + $this->add('login', 'ok', 'The app has no login of its own: visitors use the login of the manager.'); + } else { + $this->add('login', 'warn', 'There is no login: the auth middleware has nowhere to send visitors.', 'Set MANAGER_UI=package (the manager brings a login), or add a login to the app.'); + } + } + + private function checkModules(ModuleRegistry $modules): void + { + $active = array_keys($modules->active()); + $this->add('modules', 'ok', 'Active modules: '.implode(', ', $active).'.'); + + if ($modules->enabled('media')) { + $disk = config('manager.media.disk'); + config("filesystems.disks.{$disk}") === null + ? $this->add('media_disk', 'fail', "The media disk \"{$disk}\" is not in config/filesystems.php.", 'Set MANAGER_MEDIA_DISK to a disk that exists.') + : $this->add('media_disk', 'ok', "The media disk is \"{$disk}\"."); + + if ($disk === 'public' && ! file_exists(public_path('storage'))) { + $this->add('storage_link', 'warn', 'public/storage does not exist: uploaded files cannot be served from the public disk.', 'php artisan storage:link'); + } + } + + if ($modules->enabled('audit')) { + $this->add('proxies', 'warn', 'The audit log stores the visitor address. Behind a proxy or load balancer, trusted proxies must be configured, or every visitor looks like one address and one bad actor can lock the manager out.', 'Configure trusted proxies (bootstrap/app.php: $middleware->trustProxies(...)) and set MANAGER_NEVER_BAN to your own address.'); + } + + if ($modules->enabled('statistics')) { + $pages = (array) config('manager.statistics.pages'); + $pages === ['/'] && ! config('manager.statistics.posts_path') + ? $this->add('statistics_pages', 'warn', 'Only the home page counts in the statistics.', 'Set manager.statistics.pages (and posts_path), or register a resolver with CountedPages::register().') + : $this->add('statistics_pages', 'ok', 'The statistics count '.count($pages).' page(s) and '.(config('manager.statistics.posts_path') ? 'the posts' : 'no posts').'.'); + } + } +} diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php new file mode 100644 index 0000000..82745e4 --- /dev/null +++ b/src/Console/InstallCommand.php @@ -0,0 +1,96 @@ +callSilently('vendor:publish', ['--tag' => 'manager-config']); + + $env = []; + + if ($list = $this->option('modules')) { + $wanted = array_filter(array_map('trim', explode(',', $list))); + $unknown = array_diff($wanted, array_keys($modules->all())); + + if ($unknown !== []) { + $this->error('Unknown module(s): '.implode(', ', $unknown).'. Known: '.implode(', ', array_keys($modules->all())).'.'); + + return self::FAILURE; + } + + foreach (array_keys($modules->all()) as $key) { + if (in_array($key, ['users', 'media'], true)) { + continue; // switched in config, on by default + } + + $env['MANAGER_'.strtoupper($key)] = in_array($key, $wanted, true) ? 'true' : 'false'; + } + } + + if ($model = $this->option('user-model')) { + $env['MANAGER_USER_MODEL'] = $model; + } + + if ($path = $this->option('path')) { + $env['MANAGER_PATH'] = trim($path, '/'); + } + + foreach ($env as $key => $value) { + $this->writeEnv($key, $value); + } + + if ($env !== []) { + $this->line('Wrote to .env: '.implode(', ', array_map(fn ($k, $v) => "{$k}={$v}", array_keys($env), $env)).'. Run `php artisan config:clear` if the config is cached.'); + } + + if ($this->option('migrate')) { + // The switches were just written: a fresh process sees them, this one still has the old config. + $this->line('Run `php artisan migrate` (a new process) so the migrations of the modules you switched on are loaded.'); + } + + if ($env !== []) { + // This process still has the old config: its check would report the old state. A new process is right. + $this->line('Next: add the HasManagerAccess trait to the user model, run `php artisan config:clear && php artisan migrate && php artisan storage:link`, then `php artisan manager:doctor --json`.'); + + return self::SUCCESS; + } + + return Artisan::call('manager:doctor', $this->option('json') ? ['--json' => true] : [], $this->output) === 0 ? self::SUCCESS : self::FAILURE; + } + + private function writeEnv(string $key, string $value): void + { + $file = base_path('.env'); + $contents = file_exists($file) ? file_get_contents($file) : ''; + $line = "{$key}={$value}"; + + $contents = preg_match("/^{$key}=.*$/m", $contents) + ? preg_replace("/^{$key}=.*$/m", $line, $contents) + : rtrim($contents, "\n")."\n{$line}\n"; + + file_put_contents($file, $contents); + } +} diff --git a/src/Console/MakeThemeCommand.php b/src/Console/MakeThemeCommand.php new file mode 100644 index 0000000..5bd6920 --- /dev/null +++ b/src/Console/MakeThemeCommand.php @@ -0,0 +1,95 @@ +argument('key'); + + if (! preg_match('/^[a-z0-9][a-z0-9-]{0,40}$/', $key)) { + $this->error('The key may only hold lowercase letters, numbers and dashes.'); + + return self::FAILURE; + } + + $raw = [ + 'label' => $this->option('label') ?: ucfirst($key), + 'scheme' => $this->option('light') ? 'light' : 'dark', + 'name' => $this->option('name'), + 'logo' => $this->option('logo'), + 'font' => $this->option('font'), + 'font_display' => $this->option('font-display'), + 'radius' => $this->option('radius'), + 'colors' => array_filter([ + 'brand' => $this->option('brand'), 'brand_alt' => $this->option('brand-alt'), 'ink' => $this->option('ink'), + 'panel' => $this->option('panel'), 'text' => $this->option('text'), + ]), + ]; + + // What the manager would accept: tell what was thrown away instead of silently writing a different theme. + $clean = $themes->sanitize($key, $raw); + $rejected = []; + + foreach ($raw['colors'] as $name => $value) { + ($clean['colors'][$name] ?? null) === $value || $rejected[] = $name.' ('.$value.')'; + } + + foreach (['radius', 'font', 'font_display', 'logo'] as $option) { + $raw[$option] !== null && ($clean[$option] ?? null) !== $raw[$option] && $rejected[] = $option.' ('.$raw[$option].')'; + } + + if ($rejected !== []) { + $this->error('Not accepted: '.implode(', ', $rejected).'. Colours are #rgb or #rrggbb; no quotes or semicolons in fonts.'); + + return self::FAILURE; + } + + $folder = $this->option('path') ?: (config('manager.themes_path') ?: resource_path('manager-themes')); + $file = rtrim($folder, '/')."/{$key}.json"; + + if (file_exists($file) && ! $this->option('force')) { + $this->error("{$file} exists. Use --force to overwrite it."); + + return self::FAILURE; + } + + is_dir($folder) || mkdir($folder, 0775, true); + $out = array_filter(['label' => $clean['label'], 'scheme' => $clean['scheme'], 'name' => $clean['name'], 'logo' => $clean['logo'], 'font' => $clean['font'], 'font_display' => $clean['font_display'], 'radius' => $clean['radius'], 'colors' => $clean['colors']], fn ($value) => $value !== null); + file_put_contents($file, json_encode($out, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)."\n"); + + $this->info("Wrote {$file}. Everyone sees it with MANAGER_THEME={$key}; each account can pick it in its profile."); + + return self::SUCCESS; + } +} diff --git a/src/Http/Controllers/AssetController.php b/src/Http/Controllers/AssetController.php new file mode 100644 index 0000000..600dd93 --- /dev/null +++ b/src/Http/Controllers/AssetController.php @@ -0,0 +1,22 @@ + 'application/javascript', 'manager.css' => 'text/css']; + + public function __invoke(string $file): BinaryFileResponse + { + abort_unless(isset(self::FILES[$file]) && is_file($path = __DIR__.'/../../../resources/dist/'.$file), 404); + + return response()->file($path, [ + 'Content-Type' => self::FILES[$file], + 'Cache-Control' => 'public, max-age=31536000, immutable', + 'X-Content-Type-Options' => 'nosniff', + ]); + } +} diff --git a/src/Http/Controllers/DashboardController.php b/src/Http/Controllers/DashboardController.php index bdec53b..810882b 100644 --- a/src/Http/Controllers/DashboardController.php +++ b/src/Http/Controllers/DashboardController.php @@ -15,6 +15,13 @@ class DashboardController fn (array $item) => $request->user()?->can($item['permission']), )); + if ($request->wantsJson()) { + return response()->json(['navigation' => array_map( + fn (array $item) => ['label' => $item['label'], 'href' => route($item['route'], [], false)], + $navigation, + )]); + } + return view('manager::dashboard', ['navigation' => $navigation]); } } diff --git a/src/Http/Controllers/LoginController.php b/src/Http/Controllers/LoginController.php new file mode 100644 index 0000000..d6614b9 --- /dev/null +++ b/src/Http/Controllers/LoginController.php @@ -0,0 +1,38 @@ +validate([ + 'email' => ['required', 'string', 'email', 'max:255'], + 'password' => ['required', 'string', 'max:200'], + ]); + + if (! Auth::attempt($credentials, $request->boolean('remember'))) { + throw ValidationException::withMessages(['email' => trans('auth.failed')]); + } + + $request->session()->regenerate(); + + return response()->json(['redirect' => '/'.trim((string) config('manager.path'), '/')]); + } + + public function destroy(Request $request): JsonResponse + { + Auth::guard()->logout(); + $request->session()->invalidate(); + $request->session()->regenerateToken(); + + return response()->json(['redirect' => Route::has('manager.login') ? route('manager.login', [], false) : '/']); + } +} diff --git a/src/Http/Controllers/ProfileController.php b/src/Http/Controllers/ProfileController.php new file mode 100644 index 0000000..98662a9 --- /dev/null +++ b/src/Http/Controllers/ProfileController.php @@ -0,0 +1,58 @@ +user(); + + return response()->json(['profile' => [ + 'name' => (string) $user->name, + 'email' => (string) $user->email, + 'is_super_admin' => method_exists($user, 'isManagerSuperAdmin') && $user->isManagerSuperAdmin(), + 'groups' => method_exists($user, 'managerGroups') ? $user->managerGroups()->pluck('name')->values() : [], + 'theme' => $themes->keyFor($user), + 'themes' => config('manager.user_themes') + ? collect($themes->all())->map(fn (array $theme, string $key) => ['key' => $key, 'label' => $theme['label'], 'colors' => $theme['colors']])->values() + : [], + ]]); + } + + public function update(Request $request, Themes $themes): JsonResponse + { + $user = $request->user(); + app(AuditTrail::class)->about($user); + + $data = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'current_password' => ['nullable', 'string', 'max:200'], + 'password' => ['nullable', 'string', 'min:12', 'max:200', 'confirmed'], + 'theme' => ['nullable', 'string', Rule::in(array_keys($themes->all()))], + ]); + + if (($data['password'] ?? '') !== '' && ! Hash::check((string) ($data['current_password'] ?? ''), $user->getAuthPassword())) { + return response()->json(['message' => 'The current password is not right.', 'errors' => ['current_password' => ['The current password is not right.']]], 422); + } + + $user->name = $data['name']; + ($data['password'] ?? '') !== '' && $user->password = Hash::make($data['password']); + $user->save(); + + if (config('manager.user_themes') && $request->has('theme')) { + UserSetting::query()->updateOrCreate(['user_id' => $user->getKey()], ['theme' => $data['theme'] ?: null]); + } + + return response()->json(['saved' => true]); + } +} diff --git a/src/Http/Middleware/Authenticate.php b/src/Http/Middleware/Authenticate.php new file mode 100644 index 0000000..5b990fd --- /dev/null +++ b/src/Http/Middleware/Authenticate.php @@ -0,0 +1,20 @@ +expectsJson()) { + return null; + } + + return Route::has('login') ? route('login') : (Route::has('manager.login') ? route('manager.login') : null); + } +} diff --git a/src/Http/Middleware/ServeShell.php b/src/Http/Middleware/ServeShell.php new file mode 100644 index 0000000..574e2da --- /dev/null +++ b/src/Http/Middleware/ServeShell.php @@ -0,0 +1,31 @@ +isMethodSafe() || $request->wantsJson() || $request->ajax()) { + return $next($request); + } + + $name = (string) $request->route()?->getName(); + + if ($name === 'manager.assets' || str_ends_with($name, '.export')) { + return $next($request); + } + + return response()->view('manager::shell', app(Shell::class)->data($request)); + } +} diff --git a/src/ManagerServiceProvider.php b/src/ManagerServiceProvider.php index 21fe62b..eca5548 100644 --- a/src/ManagerServiceProvider.php +++ b/src/ManagerServiceProvider.php @@ -2,7 +2,10 @@ namespace IriksIT\Manager; +use Illuminate\Cache\RateLimiting\Limit; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Gate; +use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\Facades\Route; use Illuminate\Support\ServiceProvider; use IriksIT\Manager\Support\ModuleRegistry; @@ -32,6 +35,11 @@ class ManagerServiceProvider extends ServiceProvider $this->publishes([__DIR__.'/../config/manager.php' => config_path('manager.php')], 'manager-config'); $this->loadViewsFrom(__DIR__.'/../resources/views', 'manager'); + $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); + + $this->app['router']->aliasMiddleware('manager.auth', Http\Middleware\Authenticate::class); + $this->app['router']->aliasMiddleware('manager.shell', Http\Middleware\ServeShell::class); + RateLimiter::for('manager-login', fn (Request $request) => Limit::perMinute(5)->by(strtolower((string) $request->input('email')).'|'.$request->ip())); foreach ($modules->active() as $module) { if ($module->migrations() !== null) { @@ -45,6 +53,10 @@ class ManagerServiceProvider extends ServiceProvider $module->boot(); } + if ($this->app->runningInConsole()) { + $this->commands([Console\InstallCommand::class, Console\DoctorCommand::class, Console\MakeThemeCommand::class]); + } + $this->registerGates($modules); $this->registerRoutes($modules); } @@ -64,7 +76,17 @@ class ManagerServiceProvider extends ServiceProvider private function registerRoutes(ModuleRegistry $modules): void { - Route::middleware([...$modules->middleware('before'), ...config('manager.middleware'), ...$modules->middleware('after')]) + $screens = config('manager.ui') === 'package'; + + if ($screens) { + // Outside `auth`, but behind the bans of the modules. + Route::middleware(['web', ...$modules->middleware('before'), 'manager.shell']) + ->prefix(config('manager.path')) + ->name('manager.') + ->group(fn () => $this->loadRoutesFrom(__DIR__.'/../routes/guest.php')); + } + + Route::middleware([...$modules->middleware('before'), ...config('manager.middleware'), ...($screens ? ['manager.shell'] : []), ...$modules->middleware('after')]) ->prefix(config('manager.path')) ->name('manager.') ->group(function () use ($modules) { diff --git a/src/Models/UserSetting.php b/src/Models/UserSetting.php new file mode 100644 index 0000000..0e18a5b --- /dev/null +++ b/src/Models/UserSetting.php @@ -0,0 +1,16 @@ + + */ + public function tables(): array + { + return []; + } + public function actions(): array { return []; diff --git a/src/Modules/Media/MediaModule.php b/src/Modules/Media/MediaModule.php index 876ae1b..ba9e36c 100644 --- a/src/Modules/Media/MediaModule.php +++ b/src/Modules/Media/MediaModule.php @@ -25,6 +25,11 @@ class MediaModule extends BaseModule return true; } + public function tables(): array + { + return ['media']; + } + public function permissions(): array { return [ diff --git a/src/Modules/Pages/PagesModule.php b/src/Modules/Pages/PagesModule.php index 1fc0732..d6c3a33 100644 --- a/src/Modules/Pages/PagesModule.php +++ b/src/Modules/Pages/PagesModule.php @@ -24,6 +24,11 @@ class PagesModule extends BaseModule return false; } + public function tables(): array + { + return ['pages']; + } + public function permissions(): array { return [ diff --git a/src/Modules/Posts/PostsModule.php b/src/Modules/Posts/PostsModule.php index 38306d2..af32646 100644 --- a/src/Modules/Posts/PostsModule.php +++ b/src/Modules/Posts/PostsModule.php @@ -24,6 +24,11 @@ class PostsModule extends BaseModule return false; } + public function tables(): array + { + return ['posts', 'post_labels']; + } + public function permissions(): array { return [ diff --git a/src/Modules/Reviews/ReviewsModule.php b/src/Modules/Reviews/ReviewsModule.php index bf7b63c..e09ecc6 100644 --- a/src/Modules/Reviews/ReviewsModule.php +++ b/src/Modules/Reviews/ReviewsModule.php @@ -22,6 +22,11 @@ class ReviewsModule extends BaseModule return false; } + public function tables(): array + { + return ['reviews']; + } + public function permissions(): array { return [ diff --git a/src/Modules/Statistics/StatisticsModule.php b/src/Modules/Statistics/StatisticsModule.php index d8d357f..8f7c11b 100644 --- a/src/Modules/Statistics/StatisticsModule.php +++ b/src/Modules/Statistics/StatisticsModule.php @@ -33,6 +33,11 @@ class StatisticsModule extends BaseModule return false; } + public function tables(): array + { + return ['visitor_salts', 'visits', 'page_views', 'bot_hits']; + } + public function permissions(): array { return [new Permission('statistics.view', 'See the visitor statistics and download them', 'Statistics')]; diff --git a/src/Modules/Users/UsersModule.php b/src/Modules/Users/UsersModule.php index b7ef624..fcda472 100644 --- a/src/Modules/Users/UsersModule.php +++ b/src/Modules/Users/UsersModule.php @@ -22,6 +22,11 @@ class UsersModule extends BaseModule return true; } + public function tables(): array + { + return ['groups', 'group_user']; + } + public function permissions(): array { return [ diff --git a/src/Support/ModuleRegistry.php b/src/Support/ModuleRegistry.php index 684ce7a..b4cf2c9 100644 --- a/src/Support/ModuleRegistry.php +++ b/src/Support/ModuleRegistry.php @@ -150,7 +150,7 @@ final class ModuleRegistry */ public function actions(): array { - $actions = []; + $actions = ['profile.update' => ['Changed own account']]; foreach ($this->active() as $module) { $actions = [...$actions, ...$module->actions()]; @@ -162,7 +162,7 @@ final class ModuleRegistry /** @return array */ public function views(): array { - $views = ['dashboard' => 'Opened the dashboard']; + $views = ['dashboard' => 'Opened the dashboard', 'profile.show' => 'Opened own account']; foreach ($this->active() as $module) { $views = [...$views, ...$module->views()]; diff --git a/src/Support/Shell.php b/src/Support/Shell.php new file mode 100644 index 0000000..36ba347 --- /dev/null +++ b/src/Support/Shell.php @@ -0,0 +1,54 @@ +, css: string, scripts: string, styles: string} */ + public function data(Request $request): array + { + $user = $request->user(); + $key = $this->themes->keyFor($user); + $theme = $this->themes->all()[$key]; + $dist = __DIR__.'/../../resources/dist'; + + $allowed = $user === null ? [] : array_values(array_filter( + [...$this->modules->permissionValues(), ManagerServiceProvider::MANAGE_GROUPS], + fn (string $permission) => Gate::forUser($user)->allows($permission), + )); + + $navigation = $user === null ? [] : array_values(array_map( + fn (array $item) => ['label' => $item['label'], 'href' => route($item['route'], [], false)], + array_filter($this->modules->navigation(), fn (array $item) => in_array($item['permission'], $allowed, true)), + )); + + return [ + 'css' => $this->themes->css($theme), + 'title' => $theme['name'] ?? config('manager.name') ?? config('app.name', 'Manager'), + 'version' => is_file($dist.'/manager.js') ? substr(md5_file($dist.'/manager.js').md5_file($dist.'/manager.css'), 0, 10) : 'dev', + 'boot' => [ + 'base' => '/'.trim((string) config('manager.path'), '/'), + 'name' => $theme['name'] ?? config('manager.name') ?? config('app.name', 'Manager'), + 'logo' => $theme['logo'], + 'locale' => app()->getLocale(), + 'user' => $user === null ? null : [ + 'name' => (string) ($user->name ?? ''), + 'email' => (string) ($user->email ?? ''), + 'is_super_admin' => method_exists($user, 'isManagerSuperAdmin') && $user->isManagerSuperAdmin(), + ], + 'permissions' => $allowed, + 'navigation' => $navigation, + 'theme' => $key, + 'can_login' => Route::has('manager.login'), + ], + ]; + } +} diff --git a/src/Support/Themes.php b/src/Support/Themes.php new file mode 100644 index 0000000..fd665b1 --- /dev/null +++ b/src/Support/Themes.php @@ -0,0 +1,128 @@ + ['label' => 'Dark', 'scheme' => 'dark', 'colors' => [ + 'ink' => '#0a0a12', 'panel' => '#12121d', 'panel2' => '#191927', 'line' => '#26263a', + 'muted' => '#a3a3b8', 'text' => '#f4f4f8', 'brand' => '#f43676', 'brand_alt' => '#ff6b9d', + ]], + 'light' => ['label' => 'Light', 'scheme' => 'light', 'colors' => [ + 'ink' => '#f4f6f8', 'panel' => '#ffffff', 'panel2' => '#eceff3', 'line' => '#d9dee5', + 'muted' => '#5d6a73', 'text' => '#192c27', 'brand' => '#009ba3', 'brand_alt' => '#007c83', + ]], + ]; + + /** @return array> */ + public function all(): array + { + $themes = self::BUILT_IN; + + foreach ((array) config('manager.themes', []) as $key => $theme) { + $themes[(string) $key] = $theme; + } + + $path = config('manager.themes_path') ?: (function_exists('resource_path') ? resource_path('manager-themes') : null); + + foreach ($path && is_dir($path) ? glob($path.'/*.json') : [] as $file) { + $theme = json_decode((string) file_get_contents($file), true); + + if (is_array($theme)) { + $themes[basename($file, '.json')] = $theme; + } + } + + $clean = []; + + foreach ($themes as $key => $theme) { + if (preg_match('/^[a-z0-9][a-z0-9-]{0,40}$/', (string) $key) && ($safe = $this->sanitize($key, $theme))) { + $clean[$key] = $safe; + } + } + + return $clean; + } + + /** The key of the theme this account sees: its own choice when allowed, else the site's. */ + public function keyFor(?object $user): string + { + $all = $this->all(); + $default = array_key_exists(config('manager.theme'), $all) ? config('manager.theme') : 'dark'; + + if ($user !== null && config('manager.user_themes') && $user->getKey() !== null) { + $chosen = UserSetting::query()->where('user_id', $user->getKey())->value('theme'); + + if ($chosen !== null && isset($all[$chosen])) { + return $chosen; + } + } + + return $default; + } + + /** @return array|null */ + public function sanitize(string $key, mixed $theme): ?array + { + if (! is_array($theme)) { + return null; + } + + $base = self::BUILT_IN[($theme['scheme'] ?? 'dark') === 'light' ? 'light' : 'dark']; + $colors = $base['colors']; + + foreach (self::COLORS as $name) { + $value = $theme['colors'][$name] ?? null; + + if (is_string($value) && preg_match('/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/', $value)) { + $colors[$name] = $value; + } + } + + $radius = $theme['radius'] ?? '0.5rem'; + $font = $theme['font'] ?? null; + $display = $theme['font_display'] ?? null; + $logo = $theme['logo'] ?? null; + $name = $theme['name'] ?? null; + $label = $theme['label'] ?? ucfirst(str_replace('-', ' ', $key)); + + return [ + 'label' => is_string($label) ? mb_substr(strip_tags($label), 0, 60) : $key, + 'scheme' => $base['scheme'], + 'colors' => $colors, + 'radius' => is_string($radius) && preg_match('/^\d{1,2}(\.\d{1,2})?(px|rem)$/', $radius) ? $radius : '0.5rem', + 'font' => is_string($font) && preg_match('/^[\w ,\'"-]{1,120}$/', $font) ? $font : null, + 'font_display' => is_string($display) && preg_match('/^[\w ,\'"-]{1,120}$/', $display) ? $display : null, + 'logo' => is_string($logo) && preg_match('#^(/|https://)[\w\-./%~]{1,300}$#', $logo) ? $logo : null, + 'name' => is_string($name) ? mb_substr(strip_tags($name), 0, 80) : null, + ]; + } + + /** The CSS variables of one theme, ready for a style block (values are already checked). */ + public function css(array $theme): string + { + $vars = []; + + foreach ($theme['colors'] as $name => $value) { + $vars[] = '--m-'.str_replace('_', '-', $name).':'.$value; + } + + $vars[] = '--m-radius:'.$theme['radius']; + $theme['font'] && $vars[] = '--m-font:'.$theme['font']; + $theme['font_display'] && $vars[] = '--m-font-display:'.$theme['font_display']; + $vars[] = 'color-scheme:'.$theme['scheme']; + + return ':root{'.implode(';', $vars).'}'; + } +} diff --git a/tests/Feature/AuditTest.php b/tests/Feature/AuditTest.php index 54555b5..4d22681 100644 --- a/tests/Feature/AuditTest.php +++ b/tests/Feature/AuditTest.php @@ -46,7 +46,8 @@ describe('what is switched on', function () { ->map(fn ($route) => $route->getName()) ->filter(fn ($name) => is_string($name) && str_starts_with($name, 'manager.')) ->map(fn ($name) => substr($name, 8)) - ->reject(fn ($name) => in_array($name, $labelled, true)) + // The login and the built files are outside `auth` (nobody is known there); a logout is logged by Laravel's Logout event. + ->reject(fn ($name) => in_array($name, [...$labelled, 'assets', 'login', 'login.store', 'logout'], true)) ->values()->all(); expect($missing)->toBe([]); diff --git a/tests/Feature/DoctorTest.php b/tests/Feature/DoctorTest.php new file mode 100644 index 0000000..2c266ec --- /dev/null +++ b/tests/Feature/DoctorTest.php @@ -0,0 +1,75 @@ +hadConfig = file_exists(config_path('manager.php')); + $this->env = file_exists(base_path('.env')) ? file_get_contents(base_path('.env')) : null; +}); +afterEach(function () { + $this->hadConfig || @unlink(config_path('manager.php')); + $this->env === null ? @unlink(base_path('.env')) : file_put_contents(base_path('.env'), $this->env); +}); + +function doctorReport(): array +{ + Artisan::call('manager:doctor', ['--json' => true]); + + return json_decode(Artisan::output(), true); +} + +it('reports a healthy setup as JSON with exit code 0', function () { + $report = doctorReport(); + $status = collect($report['checks'])->pluck('status', 'check'); + + expect($status['user_trait'])->toBe('ok') + ->and($status['tables'])->toBe('ok') + ->and($status['routes'])->toBe('ok') + ->and($report['ok'])->toBeTrue(); +}); + +it('fails with a fix when the user model is not a class', function () { + config(['manager.user_model' => 'Nope\\User']); + + $check = collect(doctorReport()['checks'])->firstWhere('check', 'user_model'); + + expect($check['status'])->toBe('fail')->and($check['fix'])->toContain('MANAGER_USER_MODEL'); + expect(Artisan::call('manager:doctor'))->toBe(1); +}); + +it('warns when there is no super admin yet', function () { + $check = collect(doctorReport()['checks'])->firstWhere('check', 'super_admin'); + + expect($check['status'])->toBe('warn')->and($check['fix'])->toContain('manager:create-user'); +}); + +it('lists the tables of the active modules', function () { + $tables = collect(app(ModuleRegistry::class)->active())->flatMap->tables(); + + expect($tables)->toContain('media', 'posts'); +}); + +it('refuses an unknown module in the installer', function () { + expect(Artisan::call('manager:install', ['--modules' => 'users,nonsense']))->toBe(1); +}); + +it('writes the switches to .env', function () { + $env = base_path('.env'); + + Artisan::call('manager:install', ['--modules' => 'users,media,posts', '--path' => 'admin']); + + $written = file_get_contents($env); + + expect($written)->toContain('MANAGER_PATH=admin')->toContain('MANAGER_AUDIT=false')->toContain('MANAGER_POSTS=true'); +}); + +it('leaves the check to a new process after it changed the switches', function () { + Artisan::call('manager:install', ['--path' => 'admin']); + + expect(Artisan::output())->toContain('manager:doctor')->not->toContain('[OK]'); +}); diff --git a/tests/Feature/ScreensTest.php b/tests/Feature/ScreensTest.php new file mode 100644 index 0000000..5a7f23b --- /dev/null +++ b/tests/Feature/ScreensTest.php @@ -0,0 +1,127 @@ + 'Ann', 'email' => 'ann@example.com', 'password' => Hash::make('a-long-enough-password')]); + $user->forceFill(['is_super_admin' => true])->save(); + test()->actingAs($user); + + return $user; +} + +it('gives a browser the shell and a script the data', function () { + signedIn(); + + $this->get('/manager/posts')->assertOk()->assertSee('id="manager"', false)->assertSee('"navigation"', false); + $this->getJson('/manager/posts')->assertOk()->assertJsonStructure(['posts']); +}); + +it('sends a guest to the login of the manager when the app has none', function () { + $this->get('/manager/posts')->assertRedirect('/manager/login'); + $this->getJson('/manager/posts')->assertUnauthorized(); + $this->get('/manager/login')->assertOk()->assertSee('"user":null', false); +}); + +it('logs in and out through the JSON routes', function () { + User::create(['name' => 'Ann', 'email' => 'ann@example.com', 'password' => Hash::make('a-long-enough-password')]); + + $this->postJson('/manager/login', ['email' => 'ann@example.com', 'password' => 'wrong'])->assertUnprocessable()->assertJsonValidationErrors('email'); + $this->postJson('/manager/login', ['email' => 'ann@example.com', 'password' => 'a-long-enough-password'])->assertOk()->assertJson(['redirect' => '/manager']); + $this->assertAuthenticated(); + $this->postJson('/manager/logout')->assertOk(); + $this->assertGuest(); +}); + +it('serves only the two built files', function () { + $this->get('/manager/_assets/manager.css')->assertOk()->assertHeader('X-Content-Type-Options', 'nosniff'); + $this->get('/manager/_assets/secret.php')->assertNotFound(); +}); + +it('has no screens when the app builds its own', function () { + config(['manager.ui' => 'none']); + + expect(Route::has('manager.login'))->toBeTrue(); // routes were registered at boot; the shell stays out of the way + signedIn(); + $this->get('/manager/posts')->assertOk()->assertJsonStructure(['posts']); +}); + +describe('themes', function () { + it('lets an account choose a theme, and only a known one', function () { + $user = signedIn(); + + $this->putJson('/manager/profile', ['name' => 'Ann', 'theme' => 'light'])->assertOk(); + expect(UserSetting::where('user_id', $user->id)->value('theme'))->toBe('light'); + $this->get('/manager')->assertSee('--m-brand:#009ba3', false); + + $this->putJson('/manager/profile', ['name' => 'Ann', 'theme' => 'nope'])->assertUnprocessable(); + }); + + it('ignores the choice when the site switched it off', function () { + config(['manager.user_themes' => false]); + $user = signedIn(); + UserSetting::create(['user_id' => $user->id, 'theme' => 'light']); + + expect(app(Themes::class)->keyFor($user))->toBe('dark'); + }); + + it('never lets a theme file put CSS or markup in the page', function () { + config(['manager.themes' => ['evil' => [ + 'colors' => ['brand' => 'red;}', 'ink' => '#123456'], + 'radius' => '1rem;}', 'font' => 'x', 'logo' => 'javascript:alert(1)', 'name' => 'Shop', + ]]]); + config(['manager.theme' => 'evil']); + signedIn(); + + $html = $this->get('/manager')->getContent(); + + expect($html)->not->toContain(' + + diff --git a/ui/src/api.ts b/ui/src/api.ts new file mode 100644 index 0000000..a5eb0e2 --- /dev/null +++ b/ui/src/api.ts @@ -0,0 +1,105 @@ +import { reactive } from 'vue'; + +export class ApiError extends Error { + constructor(public status: number, public body: any) { + super(body?.message ?? `HTTP ${status}`); + } + + /** Validation errors by field, first message each. */ + get errors(): Record { + return Object.fromEntries(Object.entries(this.body?.errors ?? {}).map(([k, v]) => [k, (v as string[])[0]])); + } +} + +/** What the page was started with (see resources/views/shell.blade.php). */ +export interface Boot { + base: string; + name: string; + logo: string | null; + locale: string; + user: { name: string; email: string; is_super_admin: boolean } | null; + permissions: string[]; + navigation: { label: string; href: string }[]; + theme: string; + can_login: boolean; +} + +export const boot: Boot = JSON.parse(document.getElementById('manager-boot')!.textContent!); + +function xsrf(): string { + const match = document.cookie.match(/(?:^|; )XSRF-TOKEN=([^;]+)/); + + return match ? decodeURIComponent(match[1]) : ''; +} + +export async function request(method: string, path: string, body?: unknown): Promise { + const response = await fetch(path, { + method, + credentials: 'same-origin', + headers: { + Accept: 'application/json', + 'X-Requested-With': 'XMLHttpRequest', + 'X-XSRF-TOKEN': xsrf(), + ...(body === undefined ? {} : { 'Content-Type': 'application/json' }), + }, + body: body === undefined ? undefined : JSON.stringify(body), + }); + const data = response.status === 204 ? null : await response.json().catch(() => null); + + if (!response.ok) { + throw new ApiError(response.status, data); + } + + return data as T; +} + +/** A file upload: multipart, the browser sets the content type. */ +export async function upload(path: string, form: FormData): Promise { + const response = await fetch(path, { + method: 'POST', + credentials: 'same-origin', + headers: { Accept: 'application/json', 'X-Requested-With': 'XMLHttpRequest', 'X-XSRF-TOKEN': xsrf() }, + body: form, + }); + const data = await response.json().catch(() => null); + + if (!response.ok) { + throw new ApiError(response.status, data); + } + + return data as T; +} + +export const api = { + get: (path: string) => request('GET', path), + post: (path: string, body: unknown = {}) => request('POST', path, body), + put: (path: string, body: unknown = {}) => request('PUT', path, body), + delete: (path: string, body?: unknown) => request('DELETE', path, body), +}; + +/** A form: values, errors by field, a busy flag. */ +export function useForm>(initial: T) { + const form = reactive({ + values: { ...initial } as T, + errors: {} as Record, + busy: false, + async send(method: 'post' | 'put', path: string): Promise { + form.busy = true; + form.errors = {}; + try { + return await api[method](path, form.values); + } catch (error) { + if (error instanceof ApiError && error.status === 422) { + form.errors = error.errors; + + return null; + } + throw error; + } finally { + form.busy = false; + } + }, + }); + + return form; +} diff --git a/ui/src/components/Layout.vue b/ui/src/components/Layout.vue new file mode 100644 index 0000000..0ac63e1 --- /dev/null +++ b/ui/src/components/Layout.vue @@ -0,0 +1,67 @@ + + + diff --git a/ui/src/components/Link.vue b/ui/src/components/Link.vue new file mode 100644 index 0000000..149dd9b --- /dev/null +++ b/ui/src/components/Link.vue @@ -0,0 +1,18 @@ + + + diff --git a/ui/src/components/MediaPicker.vue b/ui/src/components/MediaPicker.vue new file mode 100644 index 0000000..e574d1b --- /dev/null +++ b/ui/src/components/MediaPicker.vue @@ -0,0 +1,36 @@ + + + diff --git a/ui/src/i18n.ts b/ui/src/i18n.ts new file mode 100644 index 0000000..f966fb6 --- /dev/null +++ b/ui/src/i18n.ts @@ -0,0 +1,46 @@ +// Two languages for now: English (the default) and Dutch, picked from the locale the app runs in. +const nl: Record = { + 'Dashboard': 'Dashboard', 'Log in': 'Inloggen', 'Log out': 'Uitloggen', 'Email': 'E-mailadres', 'Password': 'Wachtwoord', + 'Keep me logged in': 'Ingelogd blijven', 'Logging in…': 'Bezig met inloggen…', 'Log in to manage the site.': 'Log in om de site te beheren.', + 'My account': 'Mijn account', 'Name': 'Naam', 'Email address': 'E-mailadres', 'What you may do': 'Wat je mag', + 'Super admin: everything': 'Super admin: alles', 'Not in a group yet': 'Nog in geen groep', 'New password': 'Nieuw wachtwoord', + 'Leave empty to keep the password you have.': 'Laat leeg om je wachtwoord te houden.', 'Current password': 'Huidig wachtwoord', + 'At least 12 characters.': 'Minstens 12 tekens.', 'New password, once more': 'Nieuw wachtwoord, nogmaals', 'Save': 'Opslaan', + 'Saving…': 'Bezig met opslaan…', 'Saved.': 'Opgeslagen.', 'Look': 'Uiterlijk', 'Theme': 'Thema', 'Posts': 'Berichten', + 'New post': 'Nieuw bericht', 'Title': 'Titel', 'Status': 'Status', 'Category': 'Categorie', 'Edit': 'Bewerken', 'Delete': 'Verwijderen', + 'Put online': 'Online zetten', 'Take offline': 'Offline halen', 'Draft': 'Concept', 'Scheduled': 'Ingepland', 'Published': 'Gepubliceerd', + 'Are you sure?': 'Weet je het zeker?', 'No posts yet.': 'Nog geen berichten.', 'Address (slug)': 'Adres (slug)', 'Summary': 'Samenvatting', + 'Text (Markdown)': 'Tekst (Markdown)', 'Cover image': 'Omslagafbeelding', 'Tags (comma separated)': 'Tags (met komma\'s)', + 'Featured': 'Uitgelicht', 'Publish': 'Publiceren', 'Publish at': 'Publiceren op', 'Menu': 'Menu', 'Loading…': 'Laden…', + 'You may not open this page.': 'Je mag deze pagina niet openen.', 'Something went wrong. Try again.': 'Er ging iets mis. Probeer het opnieuw.', + 'This page has no screen in the manager yet.': 'Deze pagina heeft nog geen scherm in de manager.', 'Go to the dashboard': 'Naar het dashboard', + 'The page expired. Reload it and try again.': 'De pagina is verlopen. Laad hem opnieuw en probeer het nog eens.', 'Back': 'Terug', + 'Accounts': 'Accounts', 'New account': 'Nieuw account', 'you': 'jij', 'Super admin': 'Super admin', 'Groups': 'Groepen', 'Cancel': 'Annuleren', + 'New group': 'Nieuwe groep', 'Description': 'Omschrijving', 'accounts': 'accounts', 'Categories and tags': 'Categorieën en tags', + 'Categories': 'Categorieën', 'Tags': 'Tags', 'Add': 'Toevoegen', 'Rename': 'Hernoemen', 'New name': 'Nieuwe naam', + 'Pages': 'Pagina\'s', 'Reviews': 'Reviews', 'Nothing here yet.': 'Hier is nog niets.', 'Previous': 'Vorige', 'Next': 'Volgende', 'Media': 'Media', + 'Choose an image': 'Kies een afbeelding', 'No images yet.': 'Nog geen afbeeldingen.', 'Uploaded.': 'Geüpload.', 'Upload': 'Uploaden', + 'Uploading…': 'Bezig met uploaden…', 'This file is in use. Delete it anyway?': 'Dit bestand is in gebruik. Toch verwijderen?', + 'Largest file': 'Grootste bestand', 'Alternative text': 'Alternatieve tekst', 'Used': 'Gebruikt', 'No files yet.': 'Nog geen bestanden.', 'Choose': 'Kiezen', + 'Audit log': 'Auditlog', 'Addresses banned': 'Geblokkeerde adressen', 'Logins (24 h)': 'Logins (24 u)', 'Failed logins (24 h)': 'Mislukte logins (24 u)', + 'Refused (24 h)': 'Geweigerd (24 u)', 'all': 'alles', 'logins': 'logins', 'failed': 'mislukt', 'actions': 'acties', 'viewed': 'bekeken', 'refused': 'geweigerd', 'bans': 'blokkades', + 'Search': 'Zoeken', 'Account': 'Account', 'Everyone': 'Iedereen', 'Filter': 'Filteren', 'Someone': 'Iemand', 'banned': 'geblokkeerd', 'Ban': 'Blokkeren', 'Bans': 'Blokkades', + 'Minutes (0 = until lifted)': 'Minuten (0 = tot opgeheven)', 'Reason': 'Reden', 'Whole site': 'Hele site', 'No bans.': 'Geen blokkades.', 'automatic': 'automatisch', + 'whole site': 'hele site', 'hits': 'pogingen', 'Lift': 'Opheffen', 'Rules': 'Regels', 'until lifted': 'tot opgeheven', + 'Ban an address by itself after too many failed logins': 'Een adres zelf blokkeren na te veel mislukte logins', 'Failed logins': 'Mislukte logins', 'Within minutes': 'Binnen minuten', + 'Ban for minutes (0 = until lifted)': 'Blokkeren voor minuten (0 = tot opgeheven)', 'Keep the log (days)': 'Log bewaren (dagen)', 'Notes about addresses': 'Notities over adressen', + 'Group': 'Groep', 'Note': 'Notitie', 'Statistics': 'Statistieken', 'compared with': 'vergeleken met', 'Visitors': 'Bezoekers', 'Visits': 'Bezoeken', 'Page views': 'Paginaweergaven', + 'Average time': 'Gemiddelde tijd', 'Bounce rate': 'Bouncepercentage', 'Channels': 'Kanalen', 'Sources': 'Bronnen', 'Countries': 'Landen', 'Devices': 'Apparaten', 'Browsers': 'Browsers', + 'Systems': 'Systemen', 'Direct': 'Direct', 'When people visit': 'Wanneer mensen komen', 'Programs': 'Programma\'s', 'Download': 'Downloaden', + 'Open': 'Openen', 'Created.': 'Aangemaakt.', 'Deleted.': 'Verwijderd.', +}; + +let words: Record = {}; + +export function setLocale(locale: string): void { + words = locale.toLowerCase().startsWith('nl') ? nl : {}; +} + +export function t(text: string): string { + return words[text] ?? text; +} diff --git a/ui/src/main.ts b/ui/src/main.ts new file mode 100644 index 0000000..745c36a --- /dev/null +++ b/ui/src/main.ts @@ -0,0 +1,10 @@ +import { createApp } from 'vue'; +import App from './App.vue'; +import { boot } from './api'; +import { setLocale } from './i18n'; +import { start } from './state'; +import './style.css'; + +setLocale(boot.locale); +createApp(App).mount('#manager'); +start(); diff --git a/ui/src/pages/AccountsIndex.vue b/ui/src/pages/AccountsIndex.vue new file mode 100644 index 0000000..98293df --- /dev/null +++ b/ui/src/pages/AccountsIndex.vue @@ -0,0 +1,103 @@ + + + diff --git a/ui/src/pages/AuditLog.vue b/ui/src/pages/AuditLog.vue new file mode 100644 index 0000000..6fa21d5 --- /dev/null +++ b/ui/src/pages/AuditLog.vue @@ -0,0 +1,171 @@ + + + diff --git a/ui/src/pages/Dashboard.vue b/ui/src/pages/Dashboard.vue new file mode 100644 index 0000000..05e5150 --- /dev/null +++ b/ui/src/pages/Dashboard.vue @@ -0,0 +1,17 @@ + + + diff --git a/ui/src/pages/Fallback.vue b/ui/src/pages/Fallback.vue new file mode 100644 index 0000000..2b2d3e4 --- /dev/null +++ b/ui/src/pages/Fallback.vue @@ -0,0 +1,12 @@ + + + diff --git a/ui/src/pages/GroupsIndex.vue b/ui/src/pages/GroupsIndex.vue new file mode 100644 index 0000000..1ddae1f --- /dev/null +++ b/ui/src/pages/GroupsIndex.vue @@ -0,0 +1,97 @@ + + +