Skip to content

Usenet streaming with a WebDAV server and a SABnzbd-compatible API

C#

Initial flattened commit.

nzbdav-devd883b56bb6e6
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..7f80b853
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+* text=auto
+* text eol=lf
\ No newline at end of file
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
new file mode 100644
index 00000000..22ded387
--- /dev/null
+++ b/.github/workflows/docker-publish.yml
@@ -0,0 +1,32 @@
+name: Build and Push Docker image to GHCR
+
+on:
+ push:
+ branches: [ main ] # Adjust to your default branch
+ workflow_dispatch:
+
+jobs:
+ build-and-push:
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: read
+ packages: write # Required to push to GHCR
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Log in to GHCR
+ uses: docker/login-action@v3
+ with:
+ registry: ghcr.io
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Build and push Docker image
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ push: true
+ tags: ghcr.io/${{ github.repository }}:pre-alpha
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..ff1f2adb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,18 @@
+#####################
+# non-project files #
+#####################
+
+bin/
+obj/
+/packages/
+riderModule.iml
+/_ReSharper.Caches/
+*.DotSettings.user
+nuget
+
+##############
+# IDE config #
+##############
+
+.idea/
+.vscode/
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..e94f276f
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,30 @@
+# Stage 1: Build frontend
+FROM node:alpine AS frontend-build
+WORKDIR /frontend
+COPY ./frontend ./
+RUN npm install
+RUN npm run build
+RUN npm prune --omit=dev
+
+# Stage 2: Build backend
+FROM mcr.microsoft.com/dotnet/sdk:9.0 AS backend-build
+WORKDIR /backend
+COPY ./backend ./
+RUN dotnet restore
+RUN dotnet publish -c Release -r linux-musl-x64 -o ./publish
+
+# Stage 3: Combined runtime
+FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine
+WORKDIR /app
+RUN mkdir /config
+RUN apk add --no-cache nodejs npm libc6-compat shadow su-exec bash
+COPY --from=frontend-build /frontend/node_modules ./frontend/node_modules
+COPY --from=frontend-build /frontend/package.json ./frontend/package.json
+COPY --from=frontend-build /frontend/server.js ./frontend/server.js
+COPY --from=frontend-build /frontend/build ./frontend/build
+COPY --from=backend-build /backend/publish ./backend
+EXPOSE 3000
+ENV NODE_ENV=production
+COPY entrypoint.sh /entrypoint.sh
+RUN chmod +x /entrypoint.sh
+CMD ["/entrypoint.sh"]
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..c1f57d46
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2025 nzbdav-dev
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..352a918b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,100 @@
+
+<p align="center">
+ <img width="1101" height="238" alt="image" src="https://github.com/user-attachments/assets/b14165f4-24ff-4abe-8af6-3ca852e781d4" />
+</p>
+
+# Nzb Dav
+
+NzbDav is a WebDAV server that allows you to mount NZB documents and access your Usenet downloads as a standard file system. It's designed to integrate with other media management tools like Sonarr and Radarr, by providing a SABnzbd-compatible API. With it, you can build an infinite Plex or Jellyfin media library that streams directory from your usenet provider at maxed-out speeds, without using any storage space on your own server.
+
+Check the video below for a demo:
+
+https://github.com/user-attachments/assets/d9f8caea-bb65-422e-831d-61d626d5b453
+
+
+# Key Features
+
+* 📁 **WebDAV Server** - *Provides a WebDAV endpoint for seamless integration.*
+* ☁️ **Mount NZB Documents** - *Mount and browse NZB documents as a virtual file system without downloading.*
+* 📽️ **Full Streaming and Seeking Abilities** - *Jump ahead to any point in your video streams.*
+* 🗃️ **Automatic Unrar** - *View, stream, and seek content within RAR archives*
+* 🧩 **SABnzbd-Compatible API** - *Integrate with Sonarr/Radarr and other tools using a compatible API.*
+
+
+# Getting Started
+
+The easiest way to get started is by using the official Docker image.
+
+To try it out, run the following command to pull and run the image with port `3000` exposed:
+
+```bash
+docker run --rm -it -p 3000:3000 ghcr.io/nzbdav-dev/nzbdav:pre-alpha
+```
+
+And if you would like to persist saved settings, attach a volume at `/config`
+
+```
+mkdir -p $(pwd)/nzbdav && \
+docker run --rm -it \
+ -v $(pwd)/nzbdav:/config \
+ -p 3000:3000 \
+ ghcr.io/nzbdav-dev/nzbdav:pre-alpha
+```
+After starting the container, be sure to navigate to the Settings page on the UI to finish setting up your usenet connection settings.
+
+<p align="center">
+ <img width="600" alt="settings-page" src="https://github.com/user-attachments/assets/894c9c12-364c-4a58-9b79-719cfa7a1f12" />
+</p>
+
+You'll also want to set up a username and password for logging in to the webdav server
+
+<p align="center">
+ <img width="600" alt="webdav-settings" src="https://github.com/user-attachments/assets/94dc7313-c766-4db0-b7f7-5cb601d02295" />
+</p>
+
+# RClone
+
+In order to integrate with Plex, Radarr, and Sonarr, you'll need to mount the webdav server onto your filesystem.
+
+```
+[nzb-dav]
+type = webdav
+url = // your endpoint
+vendor = other
+user = // your webdav user
+pass = // your rclone-obscured password https://rclone.org/commands/rclone_obscure
+```
+
+
+Below are the RClone settings I use.
+This setup disables Rclone's caching and streams directly, since the end-client (Plex/VLC/Chrome/etc) will already buffer-ahead anyway
+```
+--vfs-cache-mode=off
+--buffer-size=1024
+--dir-cache-time=1s
+--links
+```
+
+The "--links" setting in RClone is important. It allows *.rclonelink files within the webdav to be translated to symlinks when mounted onto your filesystem.
+
+# Radarr / Sonarr
+
+Once you have the webdav mounted onto your filesystem (e.g. accessible at `/mnt/nzbdav`), you can configure NZB-Dav as your download-client within Radarr and Sonarr, using the SABnzbd-compatible api.
+
+<p align="center">
+ <img width="600" alt="webdav-settings" src="https://github.com/user-attachments/assets/5ef6a362-7393-4b98-980a-a9e0e159ed72" />
+</p>
+
+### Steps
+* Radar will send an *.nzb to NZB-Dav to "download"
+* NZB-Dav will mount the nzb onto the webdav without actually downloading it.
+* RClone will make the nzb contents available to your filesystem by streaming, without using any storage space on your server.
+* NZB-Dav will tell Radarr that the "download" has completed within the `/mnt/nzbdav/completed-symlinks` folder.
+* Radarr will grab the symlinks from `/mnt/nzbdav/completed-symlinks` and will move them to wherever you have your media library.
+* The symlinks always point to the `/mnt/nzbdav/completed` folder which contain the streamable content.
+* Plex accesses one of the symlinks from your media library, it will automatically fetch and stream it from the mounted webdav.
+
+# More screenshots
+<img width="300" alt="onboarding" src="https://github.com/user-attachments/assets/4ca1bfed-3b98-4ff2-8108-59ed07a25591" />
+<img width="300" alt="queue and history" src="https://github.com/user-attachments/assets/6ae64b41-2ec4-4c40-9c40-de23e42a4178" />
+<img width="300" alt="dav-explorer" src="https://github.com/user-attachments/assets/0e72e987-2fc1-44b2-9ced-17aebbfbf823" />
diff --git a/backend/Api/Controllers/Authenticate/AuthenticateController.cs b/backend/Api/Controllers/Authenticate/AuthenticateController.cs
new file mode 100644
index 00000000..2cbebc89
--- /dev/null
+++ b/backend/Api/Controllers/Authenticate/AuthenticateController.cs
@@ -0,0 +1,31 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using NzbWebDAV.Database;
+using NzbWebDAV.Utils;
+
+namespace NzbWebDAV.Api.Controllers.Authenticate;
+
+[ApiController]
+[Route("api/authenticate")]
+public class AuthenticateController(DavDatabaseClient dbClient) : BaseApiController
+{
+ private async Task<AuthenticateResponse> Authenticate(AuthenticateRequest request)
+ {
+ var account = await dbClient.Ctx.Accounts
+ .Where(a => a.Type == request.Type && a.Username == request.Username)
+ .FirstOrDefaultAsync();
+
+ return new AuthenticateResponse()
+ {
+ Authenticated = account != null
+ && PasswordUtil.Verify(account.PasswordHash, request.Password, account.RandomSalt)
+ };
+ }
+
+ protected override async Task<IActionResult> HandleRequest()
+ {
+ var request = new AuthenticateRequest(HttpContext);
+ var response = await Authenticate(request);
+ return Ok(response);
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/Authenticate/AuthenticateRequest.cs b/backend/Api/Controllers/Authenticate/AuthenticateRequest.cs
new file mode 100644
index 00000000..81ea82f0
--- /dev/null
+++ b/backend/Api/Controllers/Authenticate/AuthenticateRequest.cs
@@ -0,0 +1,24 @@
+using Microsoft.AspNetCore.Http;
+using NzbWebDAV.Database.Models;
+
+namespace NzbWebDAV.Api.Controllers.Authenticate;
+
+public class AuthenticateRequest
+{
+ public Account.AccountType Type { get; init; }
+ public string Username { get; init; }
+ public string Password { get; init; }
+
+ public AuthenticateRequest(HttpContext context)
+ {
+ Username = context.Request.Form["username"].FirstOrDefault()?.ToLower() ??
+ throw new BadHttpRequestException("Username is required");
+
+ Password = context.Request.Form["password"].FirstOrDefault() ??
+ throw new BadHttpRequestException("Password is required");
+
+ Type = !Enum.TryParse<Account.AccountType>(context.Request.Form["type"], ignoreCase: true, out var parsedType)
+ ? throw new BadHttpRequestException("Invalid account type")
+ : parsedType;
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/Authenticate/AuthenticateResponse.cs b/backend/Api/Controllers/Authenticate/AuthenticateResponse.cs
new file mode 100644
index 00000000..253ec19d
--- /dev/null
+++ b/backend/Api/Controllers/Authenticate/AuthenticateResponse.cs
@@ -0,0 +1,6 @@
+namespace NzbWebDAV.Api.Controllers.Authenticate;
+
+public class AuthenticateResponse : BaseApiResponse
+{
+ public bool Authenticated { get; init; }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/BaseApiController.cs b/backend/Api/Controllers/BaseApiController.cs
new file mode 100644
index 00000000..155081fe
--- /dev/null
+++ b/backend/Api/Controllers/BaseApiController.cs
@@ -0,0 +1,54 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using NzbWebDAV.Extensions;
+using NzbWebDAV.Utils;
+
+namespace NzbWebDAV.Api.Controllers;
+
+public abstract class BaseApiController : ControllerBase
+{
+ protected virtual bool RequiresAuthentication => true;
+ protected abstract Task<IActionResult> HandleRequest();
+
+ [HttpGet]
+ [HttpPost]
+ public async Task<IActionResult> HandleApiRequest()
+ {
+ try
+ {
+ if (RequiresAuthentication)
+ {
+ var apiKey = HttpContext.GetRequestApiKey();
+ if (apiKey != EnvironmentUtil.GetVariable("FRONTEND_BACKEND_API_KEY"))
+ throw new UnauthorizedAccessException("API Key Required");
+ }
+
+ return await HandleRequest();
+ }
+ catch (BadHttpRequestException e)
+ {
+ return BadRequest(new BaseApiResponse()
+ {
+ Status = false,
+ Error = e.Message
+ });
+ }
+ catch (UnauthorizedAccessException e)
+ {
+ return Unauthorized(new BaseApiResponse()
+ {
+ Status = false,
+ Error = e.Message
+ });
+ }
+ catch (Exception e) when (e is not OperationCanceledException ||
+ !HttpContext.RequestAborted.IsCancellationRequested)
+ {
+ return StatusCode(500, new BaseApiResponse()
+ {
+ Status = false,
+ Error = e.Message
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/BaseApiResponse.cs b/backend/Api/Controllers/BaseApiResponse.cs
new file mode 100644
index 00000000..f01cf03d
--- /dev/null
+++ b/backend/Api/Controllers/BaseApiResponse.cs
@@ -0,0 +1,7 @@
+namespace NzbWebDAV.Api.Controllers;
+
+public class BaseApiResponse
+{
+ public bool Status { get; set; } = true;
+ public string? Error { get; set; }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/CreateAccount/CreateAccountController.cs b/backend/Api/Controllers/CreateAccount/CreateAccountController.cs
new file mode 100644
index 00000000..9dab392d
--- /dev/null
+++ b/backend/Api/Controllers/CreateAccount/CreateAccountController.cs
@@ -0,0 +1,33 @@
+using Microsoft.AspNetCore.Mvc;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Utils;
+
+namespace NzbWebDAV.Api.Controllers.CreateAccount;
+
+[ApiController]
+[Route("api/create-account")]
+public class CreateAccountController(DavDatabaseClient dbClient) : BaseApiController
+{
+ private async Task<CreateAccountResponse> CreateAccount(CreateAccountRequest request)
+ {
+ var randomSalt = Guid.NewGuid().ToString("N");
+ var account = new Account()
+ {
+ Type = request.Type,
+ Username = request.Username,
+ RandomSalt = randomSalt,
+ PasswordHash = PasswordUtil.Hash(request.Password, randomSalt),
+ };
+ dbClient.Ctx.Accounts.Add(account);
+ await dbClient.Ctx.SaveChangesAsync(HttpContext.RequestAborted);
+ return new CreateAccountResponse() { Status = true };
+ }
+
+ protected override async Task<IActionResult> HandleRequest()
+ {
+ var request = new CreateAccountRequest(HttpContext);
+ var response = await CreateAccount(request);
+ return Ok(response);
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/CreateAccount/CreateAccountRequest.cs b/backend/Api/Controllers/CreateAccount/CreateAccountRequest.cs
new file mode 100644
index 00000000..acb3c3d9
--- /dev/null
+++ b/backend/Api/Controllers/CreateAccount/CreateAccountRequest.cs
@@ -0,0 +1,24 @@
+using Microsoft.AspNetCore.Http;
+using NzbWebDAV.Database.Models;
+
+namespace NzbWebDAV.Api.Controllers.CreateAccount;
+
+public class CreateAccountRequest
+{
+ public Account.AccountType Type { get; init; }
+ public string Username { get; init; }
+ public string Password { get; init; }
+
+ public CreateAccountRequest(HttpContext context)
+ {
+ Username = context.Request.Form["username"].FirstOrDefault()?.ToLower() ??
+ throw new BadHttpRequestException("Username is required");
+
+ Password = context.Request.Form["password"].FirstOrDefault() ??
+ throw new BadHttpRequestException("Password is required");
+
+ Type = !Enum.TryParse<Account.AccountType>(context.Request.Form["type"], ignoreCase: true, out var parsedType)
+ ? throw new BadHttpRequestException("Invalid account type")
+ : parsedType;
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/CreateAccount/CreateAccountResponse.cs b/backend/Api/Controllers/CreateAccount/CreateAccountResponse.cs
new file mode 100644
index 00000000..2378c148
--- /dev/null
+++ b/backend/Api/Controllers/CreateAccount/CreateAccountResponse.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Api.Controllers.CreateAccount;
+
+public class CreateAccountResponse : BaseApiResponse
+{
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/GetConfig/GetConfigController.cs b/backend/Api/Controllers/GetConfig/GetConfigController.cs
new file mode 100644
index 00000000..f1ba4c6e
--- /dev/null
+++ b/backend/Api/Controllers/GetConfig/GetConfigController.cs
@@ -0,0 +1,27 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using NzbWebDAV.Database;
+
+namespace NzbWebDAV.Api.Controllers.GetConfig;
+
+[ApiController]
+[Route("api/get-config")]
+public class GetConfigController(DavDatabaseClient dbClient) : BaseApiController
+{
+ private async Task<GetConfigResponse> GetConfig(GetConfigRequest request)
+ {
+ var configItems = await dbClient.Ctx.ConfigItems
+ .Where(x => request.ConfigKeys.Contains(x.ConfigName))
+ .ToListAsync(HttpContext.RequestAborted);
+
+ var response = new GetConfigResponse { ConfigItems = configItems };
+ return response;
+ }
+
+ protected override async Task<IActionResult> HandleRequest()
+ {
+ var request = new GetConfigRequest(HttpContext);
+ var response = await GetConfig(request);
+ return Ok(response);
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/GetConfig/GetConfigRequest.cs b/backend/Api/Controllers/GetConfig/GetConfigRequest.cs
new file mode 100644
index 00000000..9add52bf
--- /dev/null
+++ b/backend/Api/Controllers/GetConfig/GetConfigRequest.cs
@@ -0,0 +1,16 @@
+using Microsoft.AspNetCore.Http;
+
+namespace NzbWebDAV.Api.Controllers.GetConfig;
+
+public class GetConfigRequest
+{
+ public HashSet<string> ConfigKeys { get; init; }
+
+ public GetConfigRequest(HttpContext context)
+ {
+ ConfigKeys = context.Request.Form["config-keys"]
+ .Where(x => x is not null)
+ .Select(x => x!)
+ .ToHashSet();
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/GetConfig/GetConfigResponse.cs b/backend/Api/Controllers/GetConfig/GetConfigResponse.cs
new file mode 100644
index 00000000..fddc6c05
--- /dev/null
+++ b/backend/Api/Controllers/GetConfig/GetConfigResponse.cs
@@ -0,0 +1,8 @@
+using NzbWebDAV.Database.Models;
+
+namespace NzbWebDAV.Api.Controllers.GetConfig;
+
+public class GetConfigResponse : BaseApiResponse
+{
+ public List<ConfigItem> ConfigItems { get; init; } = new();
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/GetWebdavItem/GetWebdavItemController.cs b/backend/Api/Controllers/GetWebdavItem/GetWebdavItemController.cs
new file mode 100644
index 00000000..9e5460a4
--- /dev/null
+++ b/backend/Api/Controllers/GetWebdavItem/GetWebdavItemController.cs
@@ -0,0 +1,72 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.StaticFiles;
+using NWebDav.Server.Stores;
+using NzbWebDAV.Extensions;
+using NzbWebDAV.WebDav;
+
+namespace NzbWebDAV.Api.Controllers.GetWebdavItem;
+
+[ApiController]
+[Route("view/{*path}")]
+public class ListWebdavDirectoryController(DatabaseStore store) : BaseApiController
+{
+ private static readonly FileExtensionContentTypeProvider MimeTypeProvider = new();
+
+ protected override bool RequiresAuthentication => false;
+
+ private async Task<Stream> GetWebdavItem(GetWebdavItemRequest request)
+ {
+ var item = await store.GetItemAsync(request.Item, HttpContext.RequestAborted);
+ if (item is null) throw new BadHttpRequestException("The file does not exist.");
+ if (item is IStoreCollection) throw new BadHttpRequestException("The file does not exist.");
+
+ // get the file stream and set the file-size in header
+ var stream = await item.GetReadableStreamAsync(HttpContext.RequestAborted);
+ var fileSize = stream.Length;
+
+ // set the content-typ header
+ Response.Headers["Content-Type"] = GetContentType(item.Name);
+ Response.Headers["Accept-Ranges"] = "bytes";
+
+ if (request.RangeStart is not null)
+ {
+ // compute
+ var end = request.RangeEnd ?? (fileSize - 1);
+ var chunkSize = 1 + end - request.RangeStart!.Value;
+
+ // seek
+ stream.Seek(request.RangeStart.Value, SeekOrigin.Begin);
+ if (request.RangeEnd is not null) stream = stream.LimitLength(chunkSize);
+
+ // set response headers
+ Response.Headers["Content-Range"] = $"bytes {request.RangeStart}-{end}/{fileSize}";
+ Response.Headers["Content-Length"] = chunkSize.ToString();
+ Response.StatusCode = 206;
+ }
+ else
+ {
+ Response.Headers["Content-Length"] = fileSize.ToString();
+ }
+
+ return stream;
+ }
+
+ protected override async Task<IActionResult> HandleRequest()
+ {
+ var request = new GetWebdavItemRequest(HttpContext);
+ await using var response = await GetWebdavItem(request);
+ await response.CopyToAsync(Response.Body, bufferSize: 1024, HttpContext.RequestAborted);
+ return new EmptyResult();
+ }
+
+ private static string GetContentType(string item)
+ {
+ var extension = Path.GetExtension(item).ToLower();
+ return extension == ".mkv" ? "video/webm"
+ : extension == ".rclonelink" ? "text/plain"
+ : extension == ".nfo" ? "text/plain"
+ : MimeTypeProvider.TryGetContentType(Path.GetFileName(item), out var mimeType) ? mimeType
+ : "application/octet-stream";
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/GetWebdavItem/GetWebdavItemRequest.cs b/backend/Api/Controllers/GetWebdavItem/GetWebdavItemRequest.cs
new file mode 100644
index 00000000..d9019fee
--- /dev/null
+++ b/backend/Api/Controllers/GetWebdavItem/GetWebdavItemRequest.cs
@@ -0,0 +1,47 @@
+using System.Security.Cryptography;
+using System.Text;
+using Microsoft.AspNetCore.Http;
+using NzbWebDAV.Utils;
+
+namespace NzbWebDAV.Api.Controllers.GetWebdavItem;
+
+public class GetWebdavItemRequest
+{
+ public string Item { get; init; }
+ public long? RangeStart { get; init; }
+ public long? RangeEnd { get; init; }
+
+ public GetWebdavItemRequest(HttpContext context)
+ {
+ // normalize path
+ var path = context.Request.Path.Value;
+ if (path.StartsWith("/")) path = path[1..];
+ if (path.StartsWith("view")) path = path[4..];
+ if (path.StartsWith("/")) path = path[1..];
+ Item = path;
+
+ // skip auth check for now
+ var downloadKey = context.Request.Query["downloadKey"];
+ if (!VerifyDownloadKey(downloadKey, Item))
+ throw new BadHttpRequestException("Invalid download key");
+
+
+ // parse range header
+ var rangeHeader = context.Request.Headers["Range"].FirstOrDefault() ?? "";
+ if (!rangeHeader.StartsWith("bytes=")) return;
+ var parts = rangeHeader[6..].Split("-", StringSplitOptions.RemoveEmptyEntries);
+ RangeStart = long.Parse(parts[0]);
+ if (parts.Length > 1) RangeEnd = long.Parse(parts[1]);
+ }
+
+
+ public static bool VerifyDownloadKey(string? downloadKey, string path)
+ {
+ var apiKey = EnvironmentUtil.GetVariable("FRONTEND_BACKEND_API_KEY");
+ var input = $"{path}_{apiKey}";
+ var inputBytes = Encoding.UTF8.GetBytes(input);
+ var hashBytes = SHA256.HashData(inputBytes);
+ var hash = Convert.ToHexStringLower(hashBytes);
+ return downloadKey == hash;
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/IsOnboarding/IsOnboardingController.cs b/backend/Api/Controllers/IsOnboarding/IsOnboardingController.cs
new file mode 100644
index 00000000..64fcb0b4
--- /dev/null
+++ b/backend/Api/Controllers/IsOnboarding/IsOnboardingController.cs
@@ -0,0 +1,25 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+
+namespace NzbWebDAV.Api.Controllers.IsOnboarding;
+
+[ApiController]
+[Route("api/is-onboarding")]
+public class IsOnboardingController(DavDatabaseClient dbClient) : BaseApiController
+{
+ private async Task<IsOnboardingResponse> IsOnboarding()
+ {
+ var account = await dbClient.Ctx.Accounts
+ .Where(a => a.Type == Account.AccountType.Admin)
+ .FirstOrDefaultAsync();
+ return new IsOnboardingResponse() { IsOnboarding = account == null };
+ }
+
+ protected override async Task<IActionResult> HandleRequest()
+ {
+ var response = await IsOnboarding();
+ return Ok(response);
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/IsOnboarding/IsOnboardingResponse.cs b/backend/Api/Controllers/IsOnboarding/IsOnboardingResponse.cs
new file mode 100644
index 00000000..520979cc
--- /dev/null
+++ b/backend/Api/Controllers/IsOnboarding/IsOnboardingResponse.cs
@@ -0,0 +1,6 @@
+namespace NzbWebDAV.Api.Controllers.IsOnboarding;
+
+public class IsOnboardingResponse : BaseApiResponse
+{
+ public bool IsOnboarding { get; init; }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/ListWebdavDirectory/ListWebdavDirectoryController.cs b/backend/Api/Controllers/ListWebdavDirectory/ListWebdavDirectoryController.cs
new file mode 100644
index 00000000..08f2e1af
--- /dev/null
+++ b/backend/Api/Controllers/ListWebdavDirectory/ListWebdavDirectoryController.cs
@@ -0,0 +1,38 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using NWebDav.Server.Stores;
+using NzbWebDAV.WebDav;
+using NzbWebDAV.WebDav.Base;
+
+namespace NzbWebDAV.Api.Controllers.ListWebdavDirectory;
+
+[ApiController]
+[Route("api/list-webdav-directory")]
+public class ListWebdavDirectoryController(DatabaseStore store) : BaseApiController
+{
+ private async Task<ListWebdavDirectoryResponse> ListWebdavDirectory(ListWebdavDirectoryRequest request)
+ {
+ var item = await store.GetItemAsync(request.Directory, HttpContext.RequestAborted);
+ if (item is null) throw new BadHttpRequestException("The directory does not exist.");
+ if (item is not IStoreCollection dir) throw new BadHttpRequestException("The directory does not exist.");
+ var children = new List<ListWebdavDirectoryResponse.DirectoryItem>();
+ await foreach (var child in dir.GetItemsAsync(HttpContext.RequestAborted))
+ {
+ children.Add(new ListWebdavDirectoryResponse.DirectoryItem()
+ {
+ Name = child.Name,
+ IsDirectory = (child is IStoreCollection),
+ Size = (child is BaseStoreItem bsi ? bsi.FileSize : null)
+ });
+ }
+
+ return new ListWebdavDirectoryResponse() { Items = children };
+ }
+
+ protected override async Task<IActionResult> HandleRequest()
+ {
+ var request = new ListWebdavDirectoryRequest(HttpContext);
+ var response = await ListWebdavDirectory(request);
+ return Ok(response);
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/ListWebdavDirectory/ListWebdavDirectoryRequest.cs b/backend/Api/Controllers/ListWebdavDirectory/ListWebdavDirectoryRequest.cs
new file mode 100644
index 00000000..27d31a4d
--- /dev/null
+++ b/backend/Api/Controllers/ListWebdavDirectory/ListWebdavDirectoryRequest.cs
@@ -0,0 +1,14 @@
+using Microsoft.AspNetCore.Http;
+using NzbWebDAV.Extensions;
+
+namespace NzbWebDAV.Api.Controllers.ListWebdavDirectory;
+
+public class ListWebdavDirectoryRequest
+{
+ public string Directory { get; init; }
+
+ public ListWebdavDirectoryRequest(HttpContext context)
+ {
+ Directory = context.Request.Form["directory"].FirstOrDefault() ?? "/";
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/ListWebdavDirectory/ListWebdavDirectoryResponse.cs b/backend/Api/Controllers/ListWebdavDirectory/ListWebdavDirectoryResponse.cs
new file mode 100644
index 00000000..af793828
--- /dev/null
+++ b/backend/Api/Controllers/ListWebdavDirectory/ListWebdavDirectoryResponse.cs
@@ -0,0 +1,17 @@
+using Microsoft.AspNetCore.Http;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Extensions;
+
+namespace NzbWebDAV.Api.Controllers.ListWebdavDirectory;
+
+public class ListWebdavDirectoryResponse
+{
+ public List<DirectoryItem> Items { get; init; } = new();
+
+ public class DirectoryItem
+ {
+ public string Name { get; init; } = null!;
+ public bool IsDirectory { get; init; }
+ public long? Size { get; init; }
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/RemoveUnlinkedFiles/RemoveUnlinkedFilesController.cs b/backend/Api/Controllers/RemoveUnlinkedFiles/RemoveUnlinkedFilesController.cs
new file mode 100644
index 00000000..79ade71d
--- /dev/null
+++ b/backend/Api/Controllers/RemoveUnlinkedFiles/RemoveUnlinkedFilesController.cs
@@ -0,0 +1,128 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Extensions;
+using NzbWebDAV.Utils;
+
+namespace NzbWebDAV.Api.Controllers.RemoveUnlinkedFiles;
+
+[ApiController]
+[Route("api/remove-unlinked-files")]
+public class RemoveUnlinkedFilesController(
+ DavDatabaseClient dbClient,
+ ConfigManager configManager
+) : BaseApiController
+{
+ private static readonly SemaphoreSlim Semaphore = new(1, 1);
+ private readonly HashSet<Guid> _removedItems = [];
+
+ protected override async Task<IActionResult> HandleRequest()
+ {
+ if (HttpContext.GetQueryParam("confirm") != "true")
+ throw new BadHttpRequestException("`confirm` parameter needs to be set to true");
+
+ var entered = await Semaphore.WaitAsync(TimeSpan.FromMilliseconds(500));
+ if (!entered) return Conflict($"The task is already in progress.");
+ try
+ {
+ return await RemoveUnlinkedFilesAsync();
+ }
+ catch (Exception ex)
+ {
+ return StatusCode(500, ex.Message);
+ }
+ finally
+ {
+ Semaphore.Release();
+ }
+ }
+
+ private async Task<IActionResult> RemoveUnlinkedFilesAsync()
+ {
+ var allDavItems = await dbClient.Ctx.Items.ToListAsync();
+
+ // get linked file paths
+ var linkedFilePaths = GetLinkedFilePaths();
+ if (linkedFilePaths.Count < 100)
+ {
+ return StatusCode(StatusCodes.Status403Forbidden, "error: " +
+ "There are less than one hundred linked files found in the library. " +
+ "Cancelling operation to prevent accidental bulk deletion.");
+ }
+
+ // determine paths to delete
+ // only delete paths that have existed longer than a day
+ var minExistance = TimeSpan.FromDays(1);
+ var allEmptyDirectories = allDavItems
+ .Where(x => x.Type == DavItem.ItemType.Directory)
+ .Where(x => x.CreatedAt < DateTime.Now.Subtract(minExistance))
+ .Where(x => x.Children.All(y => _removedItems.Contains(y.Id)));
+ var allUnlinkedFiles = allDavItems
+ .Where(x => x.Type is DavItem.ItemType.NzbFile or DavItem.ItemType.RarFile)
+ .Where(x => x.CreatedAt < DateTime.Now.Subtract(minExistance))
+ .Where(x => !linkedFilePaths.Contains(GetPath(x)))
+ .ToList();
+
+ // remove all empty directories
+ foreach (var emptyDirectory in allEmptyDirectories)
+ RemoveItem(emptyDirectory);
+
+ // remove all unlinked files
+ foreach (var unlinkedFile in allUnlinkedFiles)
+ RemoveItem(unlinkedFile);
+
+ // save changes to database
+ await dbClient.Ctx.SaveChangesAsync();
+
+ // return all removed paths
+ var allRemovedPaths = allDavItems
+ .Where(x => _removedItems.Contains(x.Id))
+ .Select(GetPath)
+ .ToList();
+ return Ok(allRemovedPaths);
+ }
+
+ private void RemoveItem(DavItem item)
+ {
+ // ignore protected folders
+ if (item.IsProtected()) return;
+
+ // ignore already removed items
+ if (_removedItems.Contains(item.Id)) return;
+
+ // remove the item
+ dbClient.Ctx.Items.Remove(item);
+ _removedItems.Add(item.Id);
+
+ // remove the parent directory, if it is empty.
+ if (item.Parent!.Children.All(x => _removedItems.Contains(x.Id)))
+ RemoveItem(item.Parent!);
+ }
+
+ private static string GetPath(DavItem? davItem)
+ {
+ ArgumentNullException.ThrowIfNull(davItem);
+ return davItem.Id != DavItem.Root.Id
+ ? Path.Combine(GetPath(davItem.Parent), davItem.Name)
+ : "/";
+ }
+
+ private HashSet<string> GetLinkedFilePaths()
+ {
+ var mountDir = configManager.GetRcloneMountDir();
+ var libraryRoot = EnvironmentUtil.GetVariable("LIBRARY_DIR")!;
+ return Directory.EnumerateFileSystemEntries(libraryRoot, "*", SearchOption.AllDirectories)
+ .Select(x => new FileInfo(x))
+ .Where(x => x.Attributes.HasFlag(FileAttributes.ReparsePoint))
+ .Select(x => x.LinkTarget)
+ .Where(x => x is not null)
+ .Select(x => x!)
+ .Where(x => x.StartsWith(mountDir))
+ .Select(x => x.RemovePrefix(mountDir))
+ .Select(x => x.StartsWith("/") ? x : $"/{x}")
+ .ToHashSet();
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/TestUsenetConnection/TestUsenetConnectionController.cs b/backend/Api/Controllers/TestUsenetConnection/TestUsenetConnectionController.cs
new file mode 100644
index 00000000..4b3b6fb8
--- /dev/null
+++ b/backend/Api/Controllers/TestUsenetConnection/TestUsenetConnectionController.cs
@@ -0,0 +1,35 @@
+using Microsoft.AspNetCore.Mvc;
+using NzbWebDAV.Clients;
+using NzbWebDAV.Exceptions;
+
+namespace NzbWebDAV.Api.Controllers.TestUsenetConnection;
+
+[ApiController]
+[Route("api/test-usenet-connection")]
+public class TestUsenetConnectionController() : BaseApiController
+{
+ private async Task<TestUsenetConnectionResponse> TestUsenetConnection(TestUsenetConnectionRequest request)
+ {
+ try
+ {
+ await UsenetStreamingClient.CreateNewConnection(
+ request.Host, request.Port, request.UseSsl, request.User, request.Pass, HttpContext.RequestAborted);
+ return new TestUsenetConnectionResponse { Status = true, Connected = true };
+ }
+ catch (CouldNotConnectToUsenetException)
+ {
+ return new TestUsenetConnectionResponse { Status = true, Connected = false };
+ }
+ catch (CouldNotLoginToUsenetException)
+ {
+ return new TestUsenetConnectionResponse { Status = true, Connected = false };
+ }
+ }
+
+ protected override async Task<IActionResult> HandleRequest()
+ {
+ var request = new TestUsenetConnectionRequest(HttpContext);
+ var response = await TestUsenetConnection(request);
+ return Ok(response);
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/TestUsenetConnection/TestUsenetConnectionRequest.cs b/backend/Api/Controllers/TestUsenetConnection/TestUsenetConnectionRequest.cs
new file mode 100644
index 00000000..c4fe2341
--- /dev/null
+++ b/backend/Api/Controllers/TestUsenetConnection/TestUsenetConnectionRequest.cs
@@ -0,0 +1,38 @@
+using Microsoft.AspNetCore.Http;
+
+namespace NzbWebDAV.Api.Controllers.TestUsenetConnection;
+
+public class TestUsenetConnectionRequest
+{
+ public string Host { get; init; }
+ public string User { get; init; }
+ public string Pass { get; init; }
+ public int Port { get; init; }
+ public bool UseSsl { get; init; }
+
+ public TestUsenetConnectionRequest(HttpContext context)
+ {
+ Host = context.Request.Form["host"].FirstOrDefault()
+ ?? throw new BadHttpRequestException("Usenet host is required");
+
+ User = context.Request.Form["user"].FirstOrDefault()
+ ?? throw new BadHttpRequestException("Usenet user is required");
+
+ Pass = context.Request.Form["pass"].FirstOrDefault()
+ ?? throw new BadHttpRequestException("Usenet pass is required");
+
+ var port = context.Request.Form["port"].FirstOrDefault()
+ ?? throw new BadHttpRequestException("Usenet port is required");
+
+ var useSsl = context.Request.Form["use-ssl"].FirstOrDefault()
+ ?? throw new BadHttpRequestException("Usenet use-ssl is required");
+
+ Port = !int.TryParse(port, out int portValue)
+ ? throw new BadHttpRequestException("Invalid usenet port")
+ : portValue;
+
+ UseSsl = !bool.TryParse(useSsl, out bool useSslValue)
+ ? throw new BadHttpRequestException("Invalid use-ssl value")
+ : useSslValue;
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/TestUsenetConnection/TestUsenetConnectionResponse.cs b/backend/Api/Controllers/TestUsenetConnection/TestUsenetConnectionResponse.cs
new file mode 100644
index 00000000..2072cdfb
--- /dev/null
+++ b/backend/Api/Controllers/TestUsenetConnection/TestUsenetConnectionResponse.cs
@@ -0,0 +1,6 @@
+namespace NzbWebDAV.Api.Controllers.TestUsenetConnection;
+
+public class TestUsenetConnectionResponse : BaseApiResponse
+{
+ public bool Connected { get; set; }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/UpdateConfig/UpdateConfigController.cs b/backend/Api/Controllers/UpdateConfig/UpdateConfigController.cs
new file mode 100644
index 00000000..d5aae84d
--- /dev/null
+++ b/backend/Api/Controllers/UpdateConfig/UpdateConfigController.cs
@@ -0,0 +1,58 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+
+namespace NzbWebDAV.Api.Controllers.UpdateConfig;
+
+[ApiController]
+[Route("api/update-config")]
+public class UpdateConfigController(DavDatabaseClient dbClient, ConfigManager configManager) : BaseApiController
+{
+ private async Task<UpdateConfigResponse> UpdateConfig(UpdateConfigRequest request)
+ {
+ // 1. Retrieve all ConfigItems from the database that match the ConfigNames in the request
+ var configNames = request.ConfigItems.Select(x => x.ConfigName).ToHashSet();
+ var existingItems = await dbClient.Ctx.ConfigItems
+ .Where(c => configNames.Contains(c.ConfigName))
+ .ToListAsync(HttpContext.RequestAborted);
+
+ // 2. Split the items into those that need to be updated and those that need to be inserted
+ var existingItemsDict = existingItems.ToDictionary(i => i.ConfigName);
+ var itemsToUpdate = new List<ConfigItem>();
+ var itemsToInsert = new List<ConfigItem>();
+ foreach (var item in request.ConfigItems)
+ {
+ if (existingItemsDict.TryGetValue(item.ConfigName, out ConfigItem? existingItem))
+ {
+ existingItem.ConfigValue = item.ConfigValue;
+ itemsToUpdate.Add(existingItem);
+ }
+ else
+ {
+ itemsToInsert.Add(item);
+ }
+ }
+
+ // 3. Perform bulk insert and bulk update
+ dbClient.Ctx.ConfigItems.AddRange(itemsToInsert);
+ dbClient.Ctx.ConfigItems.UpdateRange(itemsToUpdate);
+
+ // 4. Save changes in one call
+ await dbClient.Ctx.SaveChangesAsync(HttpContext.RequestAborted);
+
+ // 5. Update the ConfigManager
+ configManager.UpdateValues(request.ConfigItems);
+
+ // return
+ return new UpdateConfigResponse { Status = true };
+ }
+
+ protected override async Task<IActionResult> HandleRequest()
+ {
+ var request = new UpdateConfigRequest(HttpContext);
+ var response = await UpdateConfig(request);
+ return Ok(response);
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/UpdateConfig/UpdateConfigRequest.cs b/backend/Api/Controllers/UpdateConfig/UpdateConfigRequest.cs
new file mode 100644
index 00000000..55ab355d
--- /dev/null
+++ b/backend/Api/Controllers/UpdateConfig/UpdateConfigRequest.cs
@@ -0,0 +1,26 @@
+using Microsoft.AspNetCore.Http;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Utils;
+
+namespace NzbWebDAV.Api.Controllers.UpdateConfig;
+
+public class UpdateConfigRequest
+{
+ public List<ConfigItem> ConfigItems { get; init; }
+
+ public UpdateConfigRequest(HttpContext context)
+ {
+ ConfigItems = context.Request.Form
+ .Select(x => new ConfigItem()
+ {
+ ConfigName = x.Key,
+ ConfigValue = x.Value.FirstOrDefault() ?? ""
+ })
+ .Select(x => x.ConfigName != "webdav.pass" ? x : new ConfigItem()
+ {
+ ConfigName = x.ConfigName,
+ ConfigValue = PasswordUtil.Hash(x.ConfigValue)
+ })
+ .ToList();
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/Controllers/UpdateConfig/UpdateConfigResponse.cs b/backend/Api/Controllers/UpdateConfig/UpdateConfigResponse.cs
new file mode 100644
index 00000000..4fe06445
--- /dev/null
+++ b/backend/Api/Controllers/UpdateConfig/UpdateConfigResponse.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Api.Controllers.UpdateConfig;
+
+public class UpdateConfigResponse : BaseApiResponse
+{
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/AddFile/AddFileController.cs b/backend/Api/SabControllers/AddFile/AddFileController.cs
new file mode 100644
index 00000000..ad2f260e
--- /dev/null
+++ b/backend/Api/SabControllers/AddFile/AddFileController.cs
@@ -0,0 +1,57 @@
+using System.Text;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Services;
+using Usenet.Nzb;
+
+namespace NzbWebDAV.Api.SabControllers.AddFile;
+
+public class AddFileController(
+ HttpContext httpContext,
+ DavDatabaseClient dbClient,
+ QueueManager queueManager,
+ ConfigManager configManager
+) : SabApiController.BaseController(httpContext, configManager)
+{
+ public async Task<AddFileResponse> AddFileAsync(AddFileRequest request)
+ {
+ // load the document
+ var documentBytes = Encoding.UTF8.GetBytes(request.NzbFileContents);
+ using var memoryStream = new MemoryStream(documentBytes);
+ var document = await NzbDocument.LoadAsync(memoryStream);
+
+ // add the queueItem to the database
+ var queueItem = new QueueItem
+ {
+ Id = Guid.NewGuid(),
+ CreatedAt = DateTime.Now,
+ FileName = request.FileName,
+ JobName = Path.GetFileNameWithoutExtension(request.FileName),
+ NzbContents = request.NzbFileContents,
+ NzbFileSize = documentBytes.Length,
+ TotalSegmentBytes = document.Files.SelectMany(x => x.Segments).Select(x => x.Size).Sum(),
+ Category = request.Category,
+ Priority = request.Priority,
+ PostProcessing = request.PostProcessing,
+ PauseUntil = request.PauseUntil
+ };
+ dbClient.Ctx.QueueItems.Add(queueItem);
+ await dbClient.Ctx.SaveChangesAsync(request.CancellationToken);
+
+ // return response
+ return new AddFileResponse()
+ {
+ Status = true,
+ NzoIds = [queueItem.Id.ToString()],
+ };
+ }
+
+ protected override async Task<IActionResult> Handle()
+ {
+ var request = await AddFileRequest.New(httpContext);
+ return Ok(await AddFileAsync(request));
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/AddFile/AddFileRequest.cs b/backend/Api/SabControllers/AddFile/AddFileRequest.cs
new file mode 100644
index 00000000..485dbcbe
--- /dev/null
+++ b/backend/Api/SabControllers/AddFile/AddFileRequest.cs
@@ -0,0 +1,71 @@
+using Microsoft.AspNetCore.Http;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Extensions;
+
+namespace NzbWebDAV.Api.SabControllers.AddFile;
+
+public class AddFileRequest()
+{
+ public string FileName { get; init; }
+ public string MimeType { get; init; }
+ public string NzbFileContents { get; init; }
+ public string Category { get; init; }
+ public QueueItem.PriorityOption Priority { get; init; }
+ public QueueItem.PostProcessingOption PostProcessing { get; init; }
+ public DateTime? PauseUntil { get; init; }
+ public CancellationToken CancellationToken { get; init; }
+
+ public static async Task<AddFileRequest> New(HttpContext context)
+ {
+ var file =
+ context.Request.Form.Files["nzbFile"] ??
+ context.Request.Form.Files["name"] ??
+ throw new BadHttpRequestException("Invalid nzbFile/name param");
+
+ if (file.ContentType != "application/x-nzb")
+ throw new BadHttpRequestException("File mime type must be application/x-nzb");
+
+ using var streamReader = new StreamReader(file.OpenReadStream());
+
+ return new AddFileRequest()
+ {
+ FileName = file.FileName,
+ MimeType = file.ContentType,
+ NzbFileContents = await streamReader.ReadToEndAsync(context.RequestAborted),
+ Category = context.GetQueryParam("cat") ?? throw new BadHttpRequestException("Invalid cat param"),
+ Priority = MapPriorityOption(context.GetQueryParam("priority")),
+ PostProcessing = MapPostProcessingOption(context.GetQueryParam("pp")),
+ CancellationToken = context.RequestAborted
+ };
+ }
+
+ private static QueueItem.PriorityOption MapPriorityOption(string? priority)
+ {
+ return priority switch
+ {
+ "-100" => QueueItem.PriorityOption.Normal,
+ "-3" => QueueItem.PriorityOption.Duplicate,
+ "-2" => QueueItem.PriorityOption.Paused,
+ "-1" => QueueItem.PriorityOption.Low,
+ "0" => QueueItem.PriorityOption.Normal,
+ "1" => QueueItem.PriorityOption.High,
+ "2" => QueueItem.PriorityOption.Force,
+ null => QueueItem.PriorityOption.Normal,
+ _ => throw new BadHttpRequestException("Invalid priority")
+ };
+ }
+
+ private static QueueItem.PostProcessingOption MapPostProcessingOption(string? postProcessing)
+ {
+ return postProcessing switch
+ {
+ "-1" => QueueItem.PostProcessingOption.None,
+ "0" => QueueItem.PostProcessingOption.None,
+ "1" => QueueItem.PostProcessingOption.Repair,
+ "2" => QueueItem.PostProcessingOption.RepairUnpack,
+ "3" => QueueItem.PostProcessingOption.RepairUnpackDelete,
+ null => QueueItem.PostProcessingOption.None,
+ _ => throw new BadHttpRequestException("Invalid pp param")
+ };
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/AddFile/AddFileResponse.cs b/backend/Api/SabControllers/AddFile/AddFileResponse.cs
new file mode 100644
index 00000000..e6223fa9
--- /dev/null
+++ b/backend/Api/SabControllers/AddFile/AddFileResponse.cs
@@ -0,0 +1,9 @@
+using System.Text.Json.Serialization;
+
+namespace NzbWebDAV.Api.SabControllers.AddFile;
+
+public class AddFileResponse : SabBaseResponse
+{
+ [JsonPropertyName("nzo_ids")]
+ public List<string> NzoIds { get; set; } = [];
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetConfig/GetConfigController.cs b/backend/Api/SabControllers/GetConfig/GetConfigController.cs
new file mode 100644
index 00000000..e4eb7cad
--- /dev/null
+++ b/backend/Api/SabControllers/GetConfig/GetConfigController.cs
@@ -0,0 +1,54 @@
+using System.Text.Json;
+using System.Text.Json.Nodes;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Utils;
+
+namespace NzbWebDAV.Api.SabControllers.GetConfig;
+
+public class GetConfigController(
+ HttpContext httpContext,
+ ConfigManager configManager
+) : SabApiController.BaseController(httpContext, configManager)
+{
+ /// <summary>
+ /// Mimic the sabnzbd get_config api
+ /// </summary>
+ /// <returns>A valid sabnzbd config object</returns>
+ protected override async Task<IActionResult> Handle()
+ {
+ // read the config template from file and deserialize it
+ var config = await EmbeddedResourceUtil.ReadAllTextAsync("config_template.json");
+ var root = JsonNode.Parse(config)!;
+
+ // update the complete_dir
+ var completeDir = Path.Join(configManager.GetRcloneMountDir(), DavItem.SymlinkFolder.Name);
+ root["config"]!["misc"]!["complete_dir"] = completeDir;
+
+ // update the categories
+ var categoriesRoot = root["config"]?["categories"]?.AsArray()!;
+ var categories = configManager.GetApiCategories().Split(',')
+ .Where(x => !string.IsNullOrWhiteSpace(x))
+ .ToList();
+ foreach (var category in categories)
+ {
+ categoriesRoot.Add(new JsonObject
+ {
+ ["name"] = category,
+ ["order"] = 0,
+ ["pp"] = "",
+ ["script"] = "Default",
+ ["dir"] = category,
+ ["newzbin"] = "",
+ ["priority"] = -100
+ });
+ }
+
+ // serialize the config object back to json
+ var options = new JsonSerializerOptions { WriteIndented = true };
+ var response = root.ToJsonString(options);
+ return Content(response, "application/json");
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetConfig/config_template.json b/backend/Api/SabControllers/GetConfig/config_template.json
new file mode 100644
index 00000000..6b1fc9a3
--- /dev/null
+++ b/backend/Api/SabControllers/GetConfig/config_template.json
@@ -0,0 +1,46 @@
+{
+ "config": {
+ "misc": {
+ "complete_dir": "$COMPLETE_DIR",
+ "pre_check": 0,
+ "history_retention": "",
+ "history_retention_option": "all",
+ "history_retention_number": 1
+ },
+ "categories": [
+ {
+ "name": "*",
+ "order": 0,
+ "pp": "3",
+ "script": "None",
+ "dir": "",
+ "newzbin": "",
+ "priority": 0
+ }
+ ],
+ "servers": [
+ {
+ "name": "redacted",
+ "displayname": "redacted",
+ "host": "redacted",
+ "port": 563,
+ "timeout": 60,
+ "username": "redacted",
+ "password": "redacted",
+ "connections": 1,
+ "ssl": 1,
+ "ssl_verify": 3,
+ "ssl_ciphers": "",
+ "enable": 1,
+ "required": 0,
+ "optional": 0,
+ "retention": 0,
+ "expire_date": "",
+ "quota": "",
+ "usage_at_start": 0,
+ "priority": 0,
+ "notes": ""
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetFullStatus/GetFullStatusController.cs b/backend/Api/SabControllers/GetFullStatus/GetFullStatusController.cs
new file mode 100644
index 00000000..2399c072
--- /dev/null
+++ b/backend/Api/SabControllers/GetFullStatus/GetFullStatusController.cs
@@ -0,0 +1,26 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database.Models;
+
+namespace NzbWebDAV.Api.SabControllers.GetFullStatus;
+
+public class GetFullStatusController(
+ HttpContext httpContext,
+ ConfigManager configManager
+) : SabApiController.BaseController(httpContext, configManager)
+{
+ protected override Task<IActionResult> Handle()
+ {
+ // mimic sabnzbd fullstatus
+ var status = new GetFullStatusResponse()
+ {
+ Status = new GetFullStatusResponse.FullStatusObject()
+ {
+ CompleteDir = Path.Join(configManager.GetRcloneMountDir(), DavItem.SymlinkFolder.Name),
+ }
+ };
+
+ return Task.FromResult<IActionResult>(Ok(status));
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetFullStatus/GetFullStatusResponse.cs b/backend/Api/SabControllers/GetFullStatus/GetFullStatusResponse.cs
new file mode 100644
index 00000000..ca8ae1f4
--- /dev/null
+++ b/backend/Api/SabControllers/GetFullStatus/GetFullStatusResponse.cs
@@ -0,0 +1,15 @@
+using System.Text.Json.Serialization;
+
+namespace NzbWebDAV.Api.SabControllers.GetFullStatus;
+
+public class GetFullStatusResponse
+{
+ [JsonPropertyName("status")]
+ public required FullStatusObject Status { get; init; }
+
+ public class FullStatusObject
+ {
+ [JsonPropertyName("completedir")]
+ public required string CompleteDir { get; init; }
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetHistory/GetHistoryController.cs b/backend/Api/SabControllers/GetHistory/GetHistoryController.cs
new file mode 100644
index 00000000..ca768727
--- /dev/null
+++ b/backend/Api/SabControllers/GetHistory/GetHistoryController.cs
@@ -0,0 +1,64 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Utils;
+
+namespace NzbWebDAV.Api.SabControllers.GetHistory;
+
+public class GetHistoryController(
+ HttpContext httpContext,
+ DavDatabaseClient dbClient,
+ ConfigManager configManager
+) : SabApiController.BaseController(httpContext, configManager)
+{
+ private async Task<GetHistoryResponse> GetHistoryAsync(GetHistoryRequest request)
+ {
+ // get history items
+ var historyItems = await dbClient.Ctx.HistoryItems
+ .Where(q => q.Category == request.Category || request.Category == null)
+ .OrderByDescending(q => q.CreatedAt)
+ .Skip(request.Start)
+ .Take(request.Limit)
+ .ToArrayAsync(request.CancellationToken);
+
+ // get slots
+ var slots = historyItems
+ .Select(historyItem => new GetHistoryResponse.HistorySlot()
+ {
+ NzoId = historyItem.Id.ToString(),
+ NzbName = historyItem.FileName,
+ JobName = historyItem.JobName,
+ Category = historyItem.Category,
+ Status = historyItem.DownloadStatus,
+ SizeInBytes = historyItem.TotalSegmentBytes,
+ DownloadPath = Path.Join(new[]
+ {
+ configManager.GetRcloneMountDir(),
+ DavItem.SymlinkFolder.Name,
+ historyItem.Category,
+ historyItem.JobName
+ }),
+ DownloadTimeSeconds = historyItem.DownloadTimeSeconds,
+ FailMessage = historyItem.FailMessage ?? "",
+ })
+ .ToList();
+
+ // return response
+ return new GetHistoryResponse()
+ {
+ History = new GetHistoryResponse.HistoryObject()
+ {
+ Slots = slots,
+ }
+ };
+ }
+
+ protected override async Task<IActionResult> Handle()
+ {
+ var request = new GetHistoryRequest(httpContext);
+ return Ok(await GetHistoryAsync(request));
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetHistory/GetHistoryRequest.cs b/backend/Api/SabControllers/GetHistory/GetHistoryRequest.cs
new file mode 100644
index 00000000..efb2fadb
--- /dev/null
+++ b/backend/Api/SabControllers/GetHistory/GetHistoryRequest.cs
@@ -0,0 +1,35 @@
+using Microsoft.AspNetCore.Http;
+using NzbWebDAV.Extensions;
+
+namespace NzbWebDAV.Api.SabControllers.GetHistory;
+
+public class GetHistoryRequest
+{
+ public int Start { get; init; } = 0;
+ public int Limit { get; init; } = int.MaxValue;
+ public string? Category { get; init; }
+ public CancellationToken CancellationToken { get; set; }
+
+
+ public GetHistoryRequest(HttpContext context)
+ {
+ var startParam = context.GetQueryParam("start");
+ var limitParam = context.GetQueryParam("limit");
+ Category = context.GetQueryParam("category");
+ CancellationToken = context.RequestAborted;
+
+ if (startParam is not null)
+ {
+ var isValidStartParam = int.TryParse(startParam, out int start);
+ if (!isValidStartParam) throw new BadHttpRequestException("Invalid start parameter");
+ Start = start;
+ }
+
+ if (limitParam is not null)
+ {
+ var isValidLimit = int.TryParse(limitParam, out int limit);
+ if (!isValidLimit) throw new BadHttpRequestException("Invalid limit parameter");
+ Limit = limit;
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetHistory/GetHistoryResponse.cs b/backend/Api/SabControllers/GetHistory/GetHistoryResponse.cs
new file mode 100644
index 00000000..15807804
--- /dev/null
+++ b/backend/Api/SabControllers/GetHistory/GetHistoryResponse.cs
@@ -0,0 +1,47 @@
+using System.Text.Json.Serialization;
+using NzbWebDAV.Database.Models;
+
+namespace NzbWebDAV.Api.SabControllers.GetHistory;
+
+public class GetHistoryResponse : SabBaseResponse
+{
+ [JsonPropertyName("history")]
+ public HistoryObject History { get; set; }
+
+ public class HistoryObject
+ {
+ [JsonPropertyName("slots")]
+ public List<HistorySlot> Slots { get; set; }
+ }
+
+ public class HistorySlot
+ {
+ [JsonPropertyName("nzo_id")]
+ public string NzoId { get; set; }
+
+ [JsonPropertyName("nzb_name")]
+ public string NzbName { get; set; }
+
+ [JsonPropertyName("name")]
+ public string JobName { get; set; }
+
+ [JsonPropertyName("category")]
+ public string Category { get; set; }
+
+ [JsonPropertyName("status")]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public HistoryItem.DownloadStatusOption Status { get; set; }
+
+ [JsonPropertyName("bytes")]
+ public long SizeInBytes { get; set; }
+
+ [JsonPropertyName("storage")]
+ public string DownloadPath { get; set; }
+
+ [JsonPropertyName("download_time")]
+ public int DownloadTimeSeconds { get; set; }
+
+ [JsonPropertyName("fail_message")]
+ public string FailMessage { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetQueue/GetQueueController.cs b/backend/Api/SabControllers/GetQueue/GetQueueController.cs
new file mode 100644
index 00000000..17ed59d3
--- /dev/null
+++ b/backend/Api/SabControllers/GetQueue/GetQueueController.cs
@@ -0,0 +1,72 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Services;
+
+namespace NzbWebDAV.Api.SabControllers.GetQueue;
+
+public class GetQueueController(
+ HttpContext httpContext,
+ DavDatabaseClient dbClient,
+ QueueManager queueManager,
+ ConfigManager configManager
+) : SabApiController.BaseController(httpContext, configManager)
+{
+ private async Task<GetQueueResponse> GetQueueAsync(GetQueueRequest request)
+ {
+ // get in progress item
+ var (inProgressQueueItem, progressPercentage) = queueManager.GetInProgressQueueItem();
+
+ // get queued items
+ var ct = request.CancellationToken;
+ var queueItems = (await dbClient.GetQueueItems(request.Category, request.Start, request.Limit, ct))
+ .Where(x => x.Id != inProgressQueueItem?.Id)
+ .ToArray();
+
+ // get slots
+ var slots = queueItems
+ .Prepend(inProgressQueueItem)
+ .Where(queueItem => queueItem != null)
+ .Select((queueItem, index) =>
+ {
+ var percentage = (queueItem == inProgressQueueItem ? progressPercentage : 0)!.Value;
+ return new GetQueueResponse.QueueSlot
+ {
+ Index = index,
+ NzoId = queueItem!.Id.ToString(),
+ Priority = queueItem.Priority.ToString(),
+ Filename = queueItem.FileName,
+ Category = queueItem.Category,
+ Percentage = percentage.ToString()!,
+ Status = queueItem == inProgressQueueItem ? "Downloading" : "Queued",
+ TimeLeft = TimeSpan.Zero,
+ SizeInMB = FormatSizeMB(queueItem.TotalSegmentBytes),
+ SizeLeftInMB = FormatSizeMB((100 - percentage) * queueItem.TotalSegmentBytes / 100),
+ };
+ })
+ .ToList();
+
+ // return response
+ return new GetQueueResponse()
+ {
+ Queue = new GetQueueResponse.QueueObject()
+ {
+ Paused = false,
+ Slots = slots,
+ }
+ };
+ }
+
+ private static string FormatSizeMB(long bytes)
+ {
+ var megabytes = bytes / (1024.0 * 1024.0);
+ return megabytes.ToString("0.00");
+ }
+
+ protected override async Task<IActionResult> Handle()
+ {
+ var request = new GetQueueRequest(httpContext);
+ return Ok(await GetQueueAsync(request));
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetQueue/GetQueueRequest.cs b/backend/Api/SabControllers/GetQueue/GetQueueRequest.cs
new file mode 100644
index 00000000..a895d120
--- /dev/null
+++ b/backend/Api/SabControllers/GetQueue/GetQueueRequest.cs
@@ -0,0 +1,35 @@
+using Microsoft.AspNetCore.Http;
+using NzbWebDAV.Extensions;
+
+namespace NzbWebDAV.Api.SabControllers.GetQueue;
+
+public class GetQueueRequest
+{
+ public int Start { get; init; } = 0;
+ public int Limit { get; init; } = int.MaxValue;
+ public string? Category { get; init; }
+ public CancellationToken CancellationToken { get; init; }
+
+
+ public GetQueueRequest(HttpContext context)
+ {
+ var startParam = context.GetQueryParam("start");
+ var limitParam = context.GetQueryParam("limit");
+ Category = context.GetQueryParam("category");
+ CancellationToken = context.RequestAborted;
+
+ if (startParam is not null)
+ {
+ var isValidStartParam = int.TryParse(startParam, out int start);
+ if (!isValidStartParam) throw new BadHttpRequestException("Invalid start parameter");
+ Start = start;
+ }
+
+ if (limitParam is not null)
+ {
+ var isValidLimit = int.TryParse(limitParam, out int limit);
+ if (!isValidLimit) throw new BadHttpRequestException("Invalid limit parameter");
+ Limit = limit;
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetQueue/GetQueueResponse.cs b/backend/Api/SabControllers/GetQueue/GetQueueResponse.cs
new file mode 100644
index 00000000..57cd768a
--- /dev/null
+++ b/backend/Api/SabControllers/GetQueue/GetQueueResponse.cs
@@ -0,0 +1,62 @@
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace NzbWebDAV.Api.SabControllers.GetQueue;
+
+public class GetQueueResponse : SabBaseResponse
+{
+ [JsonPropertyName("queue")]
+ public QueueObject Queue { get; init; } = new();
+
+ public class QueueObject
+ {
+ [JsonPropertyName("paused")]
+ public bool Paused { get; init; } = false;
+
+ [JsonPropertyName("slots")]
+ public List<QueueSlot> Slots { get; init; } = new();
+ }
+
+ public class QueueSlot
+ {
+ [JsonPropertyName("index")]
+ public int Index { get; init; }
+
+ [JsonPropertyName("nzo_id")]
+ public string NzoId { get; init; }
+
+ [JsonPropertyName("priority")]
+ public string Priority { get; init; }
+
+ [JsonPropertyName("filename")]
+ public string Filename { get; init; }
+
+ [JsonPropertyName("cat")]
+ public string Category { get; init; }
+
+ [JsonPropertyName("percentage")]
+ public string Percentage { get; init; }
+
+ [JsonPropertyName("status")]
+ public string Status { get; init; }
+
+ [JsonPropertyName("timeleft")]
+ [JsonConverter(typeof(SabnzbdQueueTimeConverter))]
+ public TimeSpan TimeLeft { get; init; }
+
+ [JsonPropertyName("mb")]
+ public string SizeInMB { get; init; }
+
+ [JsonPropertyName("mbleft")]
+ public string SizeLeftInMB { get; init; }
+ }
+
+ public class SabnzbdQueueTimeConverter : JsonConverter<TimeSpan>
+ {
+ public override TimeSpan Read(ref Utf8JsonReader r, Type t, JsonSerializerOptions o) =>
+ throw new NotImplementedException();
+
+ public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options) =>
+ writer.WriteStringValue(value.ToString(@"d\:h\:m\:s"));
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetVersion/GetVersionController.cs b/backend/Api/SabControllers/GetVersion/GetVersionController.cs
new file mode 100644
index 00000000..76a39f3d
--- /dev/null
+++ b/backend/Api/SabControllers/GetVersion/GetVersionController.cs
@@ -0,0 +1,21 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using NzbWebDAV.Config;
+
+namespace NzbWebDAV.Api.SabControllers.GetVersion;
+
+public class GetVersionController(
+ HttpContext httpContext,
+ ConfigManager configManager
+) : SabApiController.BaseController(httpContext, configManager)
+{
+ public const string Version = "4.5.1";
+ protected override bool RequiresAuthentication => false;
+
+ protected override Task<IActionResult> Handle()
+ {
+ // mimic sabnzbd version
+ var version = new GetVersionResponse() { Version = Version };
+ return Task.FromResult<IActionResult>(Ok(version));
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/GetVersion/GetVersionResponse.cs b/backend/Api/SabControllers/GetVersion/GetVersionResponse.cs
new file mode 100644
index 00000000..26d102ef
--- /dev/null
+++ b/backend/Api/SabControllers/GetVersion/GetVersionResponse.cs
@@ -0,0 +1,6 @@
+namespace NzbWebDAV.Api.SabControllers.GetVersion;
+
+public class GetVersionResponse : SabBaseResponse
+{
+ public string Version { get; set; } = string.Empty;
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/RemoveFromHistory/RemoveFromHistoryController.cs b/backend/Api/SabControllers/RemoveFromHistory/RemoveFromHistoryController.cs
new file mode 100644
index 00000000..15571bf3
--- /dev/null
+++ b/backend/Api/SabControllers/RemoveFromHistory/RemoveFromHistoryController.cs
@@ -0,0 +1,25 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+
+namespace NzbWebDAV.Api.SabControllers.RemoveFromHistory;
+
+public class RemoveFromHistoryController(
+ HttpContext httpContext,
+ DavDatabaseClient dbClient,
+ ConfigManager configManager
+) : SabApiController.BaseController(httpContext, configManager)
+{
+ public async Task<RemoveFromHistoryResponse> RemoveFromHistory(RemoveFromHistoryRequest request)
+ {
+ await dbClient.RemoveHistoryItemAsync(request.NzoId);
+ return new RemoveFromHistoryResponse() { Status = true };
+ }
+
+ protected override async Task<IActionResult> Handle()
+ {
+ var request = new RemoveFromHistoryRequest(httpContext);
+ return Ok(await RemoveFromHistory(request));
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/RemoveFromHistory/RemoveFromHistoryRequest.cs b/backend/Api/SabControllers/RemoveFromHistory/RemoveFromHistoryRequest.cs
new file mode 100644
index 00000000..c95117e0
--- /dev/null
+++ b/backend/Api/SabControllers/RemoveFromHistory/RemoveFromHistoryRequest.cs
@@ -0,0 +1,16 @@
+using Microsoft.AspNetCore.Http;
+using NzbWebDAV.Extensions;
+
+namespace NzbWebDAV.Api.SabControllers.RemoveFromHistory;
+
+public class RemoveFromHistoryRequest()
+{
+ public string NzoId { get; init; }
+ public CancellationToken CancellationToken { get; init; }
+
+ public RemoveFromHistoryRequest(HttpContext httpContext): this()
+ {
+ NzoId = httpContext.GetQueryParam("value")!;
+ CancellationToken = httpContext.RequestAborted;
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/RemoveFromHistory/RemoveFromHistoryResponse.cs b/backend/Api/SabControllers/RemoveFromHistory/RemoveFromHistoryResponse.cs
new file mode 100644
index 00000000..8750c321
--- /dev/null
+++ b/backend/Api/SabControllers/RemoveFromHistory/RemoveFromHistoryResponse.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Api.SabControllers.RemoveFromHistory;
+
+public class RemoveFromHistoryResponse : SabBaseResponse
+{
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/RemoveFromQueue/RemoveFromQueueController.cs b/backend/Api/SabControllers/RemoveFromQueue/RemoveFromQueueController.cs
new file mode 100644
index 00000000..ef8ff93c
--- /dev/null
+++ b/backend/Api/SabControllers/RemoveFromQueue/RemoveFromQueueController.cs
@@ -0,0 +1,27 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Services;
+
+namespace NzbWebDAV.Api.SabControllers.RemoveFromQueue;
+
+public class RemoveFromQueueController(
+ HttpContext httpContext,
+ DavDatabaseClient dbClient,
+ QueueManager queueManager,
+ ConfigManager configManager
+) : SabApiController.BaseController(httpContext, configManager)
+{
+ public async Task<RemoveFromQueueResponse> RemoveFromQueue(RemoveFromQueueRequest request)
+ {
+ await queueManager.RemoveQueueItemAsync(request.NzoId, dbClient);
+ return new RemoveFromQueueResponse() { Status = true };
+ }
+
+ protected override async Task<IActionResult> Handle()
+ {
+ var request = new RemoveFromQueueRequest(httpContext);
+ return Ok(await RemoveFromQueue(request));
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/RemoveFromQueue/RemoveFromQueueRequest.cs b/backend/Api/SabControllers/RemoveFromQueue/RemoveFromQueueRequest.cs
new file mode 100644
index 00000000..0b6aa074
--- /dev/null
+++ b/backend/Api/SabControllers/RemoveFromQueue/RemoveFromQueueRequest.cs
@@ -0,0 +1,16 @@
+using Microsoft.AspNetCore.Http;
+using NzbWebDAV.Extensions;
+
+namespace NzbWebDAV.Api.SabControllers.RemoveFromQueue;
+
+public class RemoveFromQueueRequest()
+{
+ public string NzoId { get; init; }
+ public CancellationToken CancellationToken { get; init; }
+
+ public RemoveFromQueueRequest(HttpContext httpContext): this()
+ {
+ NzoId = httpContext.GetQueryParam("value")!;
+ CancellationToken = httpContext.RequestAborted;
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/RemoveFromQueue/RemoveFromQueueResponse.cs b/backend/Api/SabControllers/RemoveFromQueue/RemoveFromQueueResponse.cs
new file mode 100644
index 00000000..dec9a607
--- /dev/null
+++ b/backend/Api/SabControllers/RemoveFromQueue/RemoveFromQueueResponse.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Api.SabControllers.RemoveFromQueue;
+
+public class RemoveFromQueueResponse : SabBaseResponse
+{
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/SabApiController.cs b/backend/Api/SabControllers/SabApiController.cs
new file mode 100644
index 00000000..40052b8a
--- /dev/null
+++ b/backend/Api/SabControllers/SabApiController.cs
@@ -0,0 +1,111 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using NzbWebDAV.Api.SabControllers.AddFile;
+using NzbWebDAV.Api.SabControllers.GetConfig;
+using NzbWebDAV.Api.SabControllers.GetFullStatus;
+using NzbWebDAV.Api.SabControllers.GetHistory;
+using NzbWebDAV.Api.SabControllers.GetQueue;
+using NzbWebDAV.Api.SabControllers.GetVersion;
+using NzbWebDAV.Api.SabControllers.RemoveFromHistory;
+using NzbWebDAV.Api.SabControllers.RemoveFromQueue;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Extensions;
+using NzbWebDAV.Services;
+using NzbWebDAV.Utils;
+
+namespace NzbWebDAV.Api.SabControllers;
+
+[ApiController]
+[Route("api")]
+public class SabApiController(
+ DavDatabaseClient dbClient,
+ ConfigManager configManager,
+ QueueManager queueManager
+) : ControllerBase
+{
+ [HttpGet]
+ [HttpPost]
+ public async Task<IActionResult> HandleApiRequests()
+ {
+ try
+ {
+ var controller = GetController();
+ return await controller.HandleRequest();
+ }
+ catch (BadHttpRequestException e)
+ {
+ return BadRequest(new SabBaseResponse()
+ {
+ Status = false,
+ Error = e.Message
+ });
+ }
+ catch (UnauthorizedAccessException e)
+ {
+ return Unauthorized(new SabBaseResponse()
+ {
+ Status = false,
+ Error = e.Message
+ });
+ }
+ catch (Exception e)
+ {
+ return StatusCode(500, new SabBaseResponse()
+ {
+ Status = false,
+ Error = e.Message
+ });
+ }
+ }
+
+ public BaseController GetController()
+ {
+ switch (HttpContext.GetQueryParam("mode"))
+ {
+ case "version":
+ return new GetVersionController(HttpContext, configManager);
+ case "get_config":
+ return new GetConfigController(HttpContext, configManager);
+ case "fullstatus":
+ return new GetFullStatusController(HttpContext, configManager);
+ case "addfile":
+ return new AddFileController(HttpContext, dbClient, queueManager, configManager);
+
+ case "queue" when HttpContext.GetQueryParam("name") == "delete":
+ return new RemoveFromQueueController(HttpContext, dbClient, queueManager, configManager);
+ case "queue":
+ return new GetQueueController(HttpContext, dbClient, queueManager, configManager);
+
+ case "history" when HttpContext.GetQueryParam("name") == "delete":
+ return new RemoveFromHistoryController(HttpContext, dbClient, configManager);
+ case "history":
+ return new GetHistoryController(HttpContext, dbClient, configManager);
+
+ default:
+ throw new BadHttpRequestException("Invalid mode");
+ }
+ }
+
+ public abstract class BaseController(HttpContext httpContext, ConfigManager configManager) : ControllerBase
+ {
+ public Task<IActionResult> HandleRequest()
+ {
+ if (RequiresAuthentication)
+ {
+ var apiKey = httpContext.GetRequestApiKey();
+ var isValidKey = apiKey?.IsAny(
+ configManager.GetApiKey(),
+ EnvironmentUtil.GetVariable("FRONTEND_BACKEND_API_KEY")
+ );
+ if (!isValidKey.HasValue || !isValidKey.Value)
+ throw new UnauthorizedAccessException("API Key Required");
+ }
+
+ return Handle();
+ }
+
+ protected virtual bool RequiresAuthentication => true;
+ protected abstract Task<IActionResult> Handle();
+ }
+}
\ No newline at end of file
diff --git a/backend/Api/SabControllers/SabBaseResponse.cs b/backend/Api/SabControllers/SabBaseResponse.cs
new file mode 100644
index 00000000..68fdb8be
--- /dev/null
+++ b/backend/Api/SabControllers/SabBaseResponse.cs
@@ -0,0 +1,7 @@
+namespace NzbWebDAV.Api.SabControllers;
+
+public class SabBaseResponse
+{
+ public bool Status { get; set; } = true;
+ public string? Error { get; set; }
+}
\ No newline at end of file
diff --git a/backend/Clients/CachingNntpClient.cs b/backend/Clients/CachingNntpClient.cs
new file mode 100644
index 00000000..fff631da
--- /dev/null
+++ b/backend/Clients/CachingNntpClient.cs
@@ -0,0 +1,27 @@
+using Microsoft.Extensions.Caching.Memory;
+using Usenet.Nzb;
+using Usenet.Yenc;
+
+namespace NzbWebDAV.Clients;
+
+public class CachingNntpClient(INntpClient client, MemoryCache cache) : WrappingNntpClient(client)
+{
+ private readonly INntpClient _client = client;
+
+ public override async Task<YencHeader> GetSegmentYencHeaderAsync(string segmentId, CancellationToken cancellationToken)
+ {
+ var cacheKey = segmentId;
+ return (await cache.GetOrCreateAsync(cacheKey, cacheEntry =>
+ {
+ cacheEntry.Size = 1;
+ cacheEntry.SlidingExpiration = TimeSpan.FromHours(3);
+ return _client.GetSegmentYencHeaderAsync(segmentId, cancellationToken);
+ })!)!;
+ }
+
+ public override async Task<long> GetFileSizeAsync(NzbFile file, CancellationToken cancellationToken)
+ {
+ var header = await GetSegmentYencHeaderAsync(file.Segments[0].MessageId, cancellationToken);
+ return header.FileSize;
+ }
+}
\ No newline at end of file
diff --git a/backend/Clients/Connections/ConnectionLock.cs b/backend/Clients/Connections/ConnectionLock.cs
new file mode 100644
index 00000000..fcb2d43b
--- /dev/null
+++ b/backend/Clients/Connections/ConnectionLock.cs
@@ -0,0 +1,50 @@
+namespace NzbWebDAV.Clients.Connections;
+
+/// <summary>
+/// Disposable wrapper that automatically returns a borrowed connection to the
+/// originating <see cref="ConnectionPool{T}"/>.
+///
+/// Note: This class was authored by ChatGPT 3o
+/// </summary>
+public sealed class ConnectionLock<T> : IDisposable, IAsyncDisposable
+{
+ private readonly Action<T> _syncReturn;
+ private readonly Func<T, ValueTask>? _asyncReturn;
+ private T? _connection;
+ private int _disposed; // 0 == false, 1 == true
+
+ internal ConnectionLock(
+ T connection,
+ Action<T> syncReturn,
+ Func<T,ValueTask>? asyncReturn = null)
+ {
+ _connection = connection;
+ _syncReturn = syncReturn;
+ _asyncReturn = asyncReturn;
+ }
+
+ public T Connection
+ => _connection ?? throw new ObjectDisposedException(nameof(ConnectionLock<T>));
+
+ public void Dispose()
+ {
+ if (Interlocked.Exchange(ref _disposed, 1) == 1) return; // already done
+ var conn = Interlocked.Exchange(ref _connection, default);
+ if (conn is not null) _syncReturn(conn);
+ GC.SuppressFinalize(this);
+ }
+
+ public async ValueTask DisposeAsync()
+ {
+ if (Interlocked.Exchange(ref _disposed, 1) == 1) return;
+ var conn = Interlocked.Exchange(ref _connection, default);
+ if (conn is not null)
+ {
+ if (_asyncReturn is not null)
+ await _asyncReturn(conn).ConfigureAwait(false);
+ else
+ _syncReturn(conn);
+ }
+ GC.SuppressFinalize(this);
+ }
+}
\ No newline at end of file
diff --git a/backend/Clients/Connections/ConnectionPool.cs b/backend/Clients/Connections/ConnectionPool.cs
new file mode 100644
index 00000000..23b21942
--- /dev/null
+++ b/backend/Clients/Connections/ConnectionPool.cs
@@ -0,0 +1,225 @@
+using System.Collections.Concurrent;
+using System.Runtime.CompilerServices;
+
+namespace NzbWebDAV.Clients.Connections;
+
+/// <summary>
+/// Thread-safe, lazy connection pool.
+/// <para>
+/// * Connections are created through a user-supplied factory (sync or async).<br/>
+/// * At most <c>maxConnections</c> live instances exist at any time.<br/>
+/// * Idle connections older than <see cref="IdleTimeout"/> are disposed
+/// automatically by a background sweeper.<br/>
+/// * <see cref="Dispose"/> / <see cref="DisposeAsync"/> stop the sweeper and
+/// dispose all cached connections. Borrowed handles returned afterwards are
+/// destroyed immediately.
+/// * Note: This class was authored by ChatGPT 3o
+/// </para>
+/// </summary>
+public sealed class ConnectionPool<T> : IDisposable, IAsyncDisposable
+{
+ /* -------------------------------- configuration -------------------------------- */
+
+ public TimeSpan IdleTimeout { get; }
+
+ private readonly Func<CancellationToken, ValueTask<T>> _factory;
+
+ /* --------------------------------- state --------------------------------------- */
+
+ private readonly ConcurrentStack<Pooled> _available = new();
+ private readonly SemaphoreSlim _gate;
+ private readonly CancellationTokenSource _sweepCts = new();
+ private readonly Task _sweeperTask; // keeps timer alive
+
+ private long _live; // number of connections currently alive
+ private int _disposed; // 0 == false, 1 == true
+
+ /* ------------------------------------------------------------------------------ */
+
+ public ConnectionPool(
+ int maxConnections,
+ Func<CancellationToken, ValueTask<T>> connectionFactory,
+ TimeSpan? idleTimeout = null)
+ {
+ if (maxConnections <= 0)
+ throw new ArgumentOutOfRangeException(nameof(maxConnections));
+
+ _factory = connectionFactory
+ ?? throw new ArgumentNullException(nameof(connectionFactory));
+ IdleTimeout = idleTimeout ?? TimeSpan.FromMinutes(1);
+
+ _gate = new SemaphoreSlim(maxConnections, maxConnections);
+ _sweeperTask = Task.Run(SweepLoop); // background idle-reaper
+ }
+
+ /* ============================== public API ==================================== */
+
+ /// <summary>Borrow a connection; releases automatically with the lock.</summary>
+ public async Task<ConnectionLock<T>> GetConnectionLockAsync(
+ CancellationToken cancellationToken = default)
+ {
+ // Make caller cancellation also cancel the wait on the gate.
+ using var linked = CancellationTokenSource.CreateLinkedTokenSource(
+ cancellationToken, _sweepCts.Token);
+
+ await _gate.WaitAsync(linked.Token).ConfigureAwait(false);
+
+ // Pool might have been disposed after wait returned:
+ if (Volatile.Read(ref _disposed) == 1)
+ {
+ _gate.Release();
+ ThrowDisposed();
+ }
+
+ // Try to reuse an existing idle connection.
+ while (_available.TryPop(out var item))
+ {
+ if (!item.IsExpired(IdleTimeout))
+ return BuildLock(item.Connection);
+
+ // Stale – destroy and continue looking.
+ await DisposeConnectionAsync(item.Connection).ConfigureAwait(false);
+ Interlocked.Decrement(ref _live);
+ }
+
+ // Need a fresh connection.
+ T conn;
+ try
+ {
+ conn = await _factory(linked.Token).ConfigureAwait(false);
+ }
+ catch
+ {
+ _gate.Release(); // free the permit on failure
+ throw;
+ }
+
+ Interlocked.Increment(ref _live);
+ return BuildLock(conn);
+
+ ConnectionLock<T> BuildLock(T c)
+ => new ConnectionLock<T>(c, Return, ReturnAsync);
+
+ static void ThrowDisposed()
+ => throw new ObjectDisposedException(nameof(ConnectionPool<T>));
+ }
+
+ /* ========================== core helpers ====================================== */
+
+ private readonly record struct Pooled(T Connection, long LastTouchedMillis)
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public bool IsExpired(TimeSpan idle, long nowMillis = 0)
+ {
+ if (nowMillis == 0) nowMillis = Environment.TickCount64;
+ return unchecked(nowMillis - LastTouchedMillis) >= idle.TotalMilliseconds;
+ }
+ }
+
+ private void Return(T connection)
+ {
+ if (Volatile.Read(ref _disposed) == 1)
+ {
+ _ = DisposeConnectionAsync(connection); // fire & forget
+ Interlocked.Decrement(ref _live);
+ return;
+ }
+
+ _available.Push(new Pooled(connection, Environment.TickCount64));
+ _gate.Release();
+ }
+
+ private ValueTask ReturnAsync(T connection)
+ {
+ Return(connection);
+ return ValueTask.CompletedTask;
+ }
+
+ /* =================== idle sweeper (background) ================================= */
+
+ private async Task SweepLoop()
+ {
+ try
+ {
+ using var timer = new PeriodicTimer(IdleTimeout / 2);
+ while (await timer.WaitForNextTickAsync(_sweepCts.Token).ConfigureAwait(false))
+ await SweepOnce().ConfigureAwait(false);
+ }
+ catch (OperationCanceledException)
+ {
+ /* normal on disposal */
+ }
+ }
+
+ private async Task SweepOnce()
+ {
+ var now = Environment.TickCount64;
+ var survivors = new List<Pooled>();
+
+ while (_available.TryPop(out var item))
+ {
+ if (item.IsExpired(IdleTimeout, now))
+ {
+ await DisposeConnectionAsync(item.Connection).ConfigureAwait(false);
+ Interlocked.Decrement(ref _live);
+ }
+ else
+ {
+ survivors.Add(item);
+ }
+ }
+
+ // Preserve original LIFO order.
+ for (int i = survivors.Count - 1; i >= 0; i--)
+ _available.Push(survivors[i]);
+ }
+
+ /* ------------------------- dispose helpers ------------------------------------ */
+
+ private static async ValueTask DisposeConnectionAsync(T conn)
+ {
+ switch (conn)
+ {
+ case IAsyncDisposable ad:
+ await ad.DisposeAsync().ConfigureAwait(false);
+ break;
+ case IDisposable d:
+ d.Dispose();
+ break;
+ }
+ }
+
+ /* -------------------------- IAsyncDisposable ---------------------------------- */
+
+ public async ValueTask DisposeAsync()
+ {
+ if (Interlocked.Exchange(ref _disposed, 1) == 1) return;
+
+ _sweepCts.Cancel();
+
+ try
+ {
+ await _sweeperTask.ConfigureAwait(false); // await clean sweep exit
+ }
+ catch (OperationCanceledException)
+ {
+ /* ignore */
+ }
+
+ // Drain and dispose cached items.
+ while (_available.TryPop(out var item))
+ await DisposeConnectionAsync(item.Connection).ConfigureAwait(false);
+
+ _sweepCts.Dispose();
+ // Intentionally NOT disposing _gate: outstanding handles may still try
+ // to Release(). A SemaphoreSlim with no waiters is effectively inert.
+ GC.SuppressFinalize(this);
+ }
+
+ /* ----------------------------- IDisposable ------------------------------------ */
+
+ public void Dispose()
+ {
+ _ = DisposeAsync().AsTask(); // fire-and-forget synchronous path
+ }
+}
\ No newline at end of file
diff --git a/backend/Clients/INntpClient.cs b/backend/Clients/INntpClient.cs
new file mode 100644
index 00000000..a00a1dfb
--- /dev/null
+++ b/backend/Clients/INntpClient.cs
@@ -0,0 +1,18 @@
+using NzbWebDAV.Streams;
+using Usenet.Nntp.Responses;
+using Usenet.Nzb;
+using Usenet.Yenc;
+
+namespace NzbWebDAV.Clients;
+
+public interface INntpClient: IDisposable
+{
+ Task<bool> ConnectAsync(string host, int port, bool useSsl, CancellationToken cancellationToken);
+ Task<bool> AuthenticateAsync(string user, string pass, CancellationToken cancellationToken);
+ Task<NntpStatResponse> StatAsync(string segmentId, CancellationToken cancellationToken);
+ Task<YencHeaderStream> GetSegmentStreamAsync(string segmentId, CancellationToken cancellationToken);
+ Task<YencHeader> GetSegmentYencHeaderAsync(string segmentId, CancellationToken cancellationToken);
+ Task<long> GetFileSizeAsync(NzbFile file, CancellationToken cancellationToken);
+ Task<NntpDateResponse> DateAsync(CancellationToken cancellationToken);
+ Task WaitForReady(CancellationToken cancellationToken);
+}
\ No newline at end of file
diff --git a/backend/Clients/MultiConnectionNntpClient.cs b/backend/Clients/MultiConnectionNntpClient.cs
new file mode 100644
index 00000000..0d127306
--- /dev/null
+++ b/backend/Clients/MultiConnectionNntpClient.cs
@@ -0,0 +1,87 @@
+using NzbWebDAV.Clients.Connections;
+using NzbWebDAV.Streams;
+using Usenet.Nntp.Responses;
+using Usenet.Nzb;
+using Usenet.Yenc;
+
+namespace NzbWebDAV.Clients;
+
+public class MultiConnectionNntpClient(ConnectionPool<INntpClient> connectionPool) : INntpClient
+{
+ private ConnectionPool<INntpClient> _connectionPool = connectionPool;
+
+ public Task<bool> ConnectAsync(string host, int port, bool useSsl, CancellationToken cancellationToken)
+ {
+ throw new NotSupportedException("Please connect within the connectionFactory");
+ }
+
+ public Task<bool> AuthenticateAsync(string user, string pass, CancellationToken cancellationToken)
+ {
+ throw new NotSupportedException("Please authenticate within the connectionFactory");
+ }
+
+ public Task<NntpStatResponse> StatAsync(string segmentId, CancellationToken cancellationToken)
+ {
+ return RunWithConnection(connection => connection.StatAsync(segmentId, cancellationToken), cancellationToken);
+ }
+
+ public Task<NntpDateResponse> DateAsync(CancellationToken cancellationToken)
+ {
+ return RunWithConnection(connection => connection.DateAsync(cancellationToken), cancellationToken);
+ }
+
+ public Task<YencHeaderStream> GetSegmentStreamAsync(string segmentId, CancellationToken cancellationToken)
+ {
+ return RunWithConnection(connection => connection.GetSegmentStreamAsync(segmentId, cancellationToken), cancellationToken);
+ }
+
+ public Task<YencHeader> GetSegmentYencHeaderAsync(string segmentId, CancellationToken cancellationToken)
+ {
+ return RunWithConnection(connection => connection.GetSegmentYencHeaderAsync(segmentId, cancellationToken), cancellationToken);
+ }
+
+ public Task<long> GetFileSizeAsync(NzbFile file, CancellationToken cancellationToken)
+ {
+ return RunWithConnection(connection => connection.GetFileSizeAsync(file, cancellationToken), cancellationToken);
+ }
+
+ public async Task WaitForReady(CancellationToken cancellationToken)
+ {
+ using var connectionLock = await _connectionPool.GetConnectionLockAsync(cancellationToken);
+ }
+
+ private async Task<T> RunWithConnection<T>(Func<INntpClient, Task<T>> task, CancellationToken cancellationToken)
+ {
+ var connectionLock = await _connectionPool.GetConnectionLockAsync(cancellationToken);
+ try
+ {
+ var result = await task(connectionLock.Connection);
+
+ // we only want to release the connection-lock once the underlying connection is ready again.
+ // ReSharper disable once MethodSupportsCancellation
+ // we intentionally do not pass the cancellation token to ContinueWith,
+ // since we want the continuation to always run.
+ _ = connectionLock.Connection.WaitForReady(CancellationToken.None).ContinueWith(_ => connectionLock.Dispose());
+ return result;
+ }
+ catch (Exception)
+ {
+ // we also want to release the connection-lock if there was any error getting the result.
+ connectionLock.Dispose();
+ throw;
+ }
+ }
+
+ public void UpdateConnectionPool(ConnectionPool<INntpClient> connectionPool)
+ {
+ var oldConnectionPool = _connectionPool;
+ _connectionPool = connectionPool;
+ oldConnectionPool.Dispose();
+ }
+
+ public void Dispose()
+ {
+ _connectionPool.Dispose();
+ GC.SuppressFinalize(this);
+ }
+}
\ No newline at end of file
diff --git a/backend/Clients/ThreadSafeNntpClient.cs b/backend/Clients/ThreadSafeNntpClient.cs
new file mode 100644
index 00000000..6f9a86d7
--- /dev/null
+++ b/backend/Clients/ThreadSafeNntpClient.cs
@@ -0,0 +1,119 @@
+using NzbWebDAV.Exceptions;
+using NzbWebDAV.Extensions;
+using NzbWebDAV.Streams;
+using Usenet.Nntp;
+using Usenet.Nntp.Models;
+using Usenet.Nntp.Responses;
+using Usenet.Nzb;
+using Usenet.Yenc;
+
+namespace NzbWebDAV.Clients;
+
+public class ThreadSafeNntpClient : INntpClient
+{
+ private readonly NntpConnection _connection;
+ private readonly NntpClient _client;
+ private readonly SemaphoreSlim _semaphore = new(1, 1);
+
+ public ThreadSafeNntpClient()
+ {
+ _connection = new NntpConnection();
+ _client = new NntpClient(_connection);
+ }
+
+ public Task<bool> ConnectAsync(string host, int port, bool useSsl, CancellationToken cancellationToken)
+ {
+ return Synchronized(() => _client.ConnectAsync(host, port, useSsl), cancellationToken);
+ }
+
+ public Task<bool> AuthenticateAsync(string user, string pass, CancellationToken cancellationToken)
+ {
+ return Synchronized(() => _client.Authenticate(user, pass), cancellationToken);
+ }
+
+ public Task<NntpStatResponse> StatAsync(string segmentId, CancellationToken cancellationToken)
+ {
+ return Synchronized(() => _client.Stat(new NntpMessageId(segmentId)), cancellationToken);
+ }
+
+ public Task<NntpDateResponse> DateAsync(CancellationToken cancellationToken)
+ {
+ return Synchronized(() => _client.Date(), cancellationToken);
+ }
+
+ public async Task<YencHeaderStream> GetSegmentStreamAsync(string segmentId, CancellationToken cancellationToken)
+ {
+ await _semaphore.WaitAsync(cancellationToken);
+ return await Task.Run(() =>
+ {
+ try
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ var articleBody = GetArticleBody(segmentId);
+ var stream = YencStreamDecoder.Decode(articleBody);
+ return new YencHeaderStream(
+ stream.Header,
+ new BufferToEndStream(stream.OnDispose(OnDispose))
+ );
+
+ // we only want to release the semaphore once the stream is disposed.
+ void OnDispose() => _semaphore.Release();
+ }
+ catch (Exception)
+ {
+ // or if there is an error getting the stream itself.
+ _semaphore.Release();
+ throw;
+ }
+ });
+ }
+
+ public async Task<YencHeader> GetSegmentYencHeaderAsync(string segmentId, CancellationToken cancellationToken)
+ {
+ await using var stream = await GetSegmentStreamAsync(new NntpMessageId(segmentId), cancellationToken);
+ return stream.Header;
+ }
+
+ public async Task<long> GetFileSizeAsync(NzbFile file, CancellationToken cancellationToken)
+ {
+ var header = await GetSegmentYencHeaderAsync(file.Segments[0].MessageId.Value, cancellationToken);
+ return header.FileSize;
+ }
+
+ public async Task WaitForReady(CancellationToken cancellationToken)
+ {
+ await _semaphore.WaitAsync(cancellationToken);
+ _semaphore.Release();
+ }
+
+ private Task<T> Synchronized<T>(Func<T> run, CancellationToken cancellationToken)
+ {
+ return Synchronized(() => Task.Run(run, cancellationToken), cancellationToken);
+ }
+
+ private async Task<T> Synchronized<T>(Func<Task<T>> run, CancellationToken cancellationToken)
+ {
+ await _semaphore.WaitAsync(cancellationToken);
+ try
+ {
+ return await run();
+ }
+ finally
+ {
+ _semaphore.Release();
+ }
+ }
+
+ private IEnumerable<string> GetArticleBody(string segmentId)
+ {
+ return _client.Body(new NntpMessageId(segmentId))?.Article?.Body
+ ?? throw new UsenetArticleNotFoundException($"Article with message-id {segmentId} not found.");
+ }
+
+ public void Dispose()
+ {
+ _semaphore.Dispose();
+ _connection.Dispose();
+ GC.SuppressFinalize(this);
+ }
+}
\ No newline at end of file
diff --git a/backend/Clients/UsenetStreamingClient.cs b/backend/Clients/UsenetStreamingClient.cs
new file mode 100644
index 00000000..b4997920
--- /dev/null
+++ b/backend/Clients/UsenetStreamingClient.cs
@@ -0,0 +1,120 @@
+using Microsoft.Extensions.Caching.Memory;
+using NzbWebDAV.Clients.Connections;
+using NzbWebDAV.Config;
+using NzbWebDAV.Exceptions;
+using NzbWebDAV.Extensions;
+using NzbWebDAV.Streams;
+using Usenet.Nntp.Responses;
+using Usenet.Nzb;
+using Usenet.Yenc;
+
+namespace NzbWebDAV.Clients;
+
+public class UsenetStreamingClient
+{
+ private readonly INntpClient _client;
+
+ public UsenetStreamingClient(ConfigManager configManager)
+ {
+ // get connection settings from config-manager
+ var host = configManager.GetConfigValue("usenet.host") ?? string.Empty;
+ var port = int.Parse(configManager.GetConfigValue("usenet.port") ?? "563");
+ var useSsl = bool.Parse(configManager.GetConfigValue("usenet.use_ssl") ?? "true");
+ var user = configManager.GetConfigValue("usenet.user") ?? string.Empty;
+ var pass = configManager.GetConfigValue("usenet.pass") ?? string.Empty;
+ var connections = int.Parse(configManager.GetConfigValue("usenet.connections") ?? "10");
+
+ // initialize the nntp-client
+ var createNewConnection = (CancellationToken ct) => CreateNewConnection(host, port, useSsl, user, pass, ct);
+ ConnectionPool<INntpClient> connectionPool = new(connections, createNewConnection);
+ var multiConnectionClient = new MultiConnectionNntpClient(connectionPool);
+ var cache = new MemoryCache(new MemoryCacheOptions() { SizeLimit = 8192 });
+ _client = new CachingNntpClient(multiConnectionClient, cache);
+
+ // when config changes, update the connection-pool
+ configManager.OnConfigChanged += (_, configEventArgs) =>
+ {
+ // if unrelated config changed, do nothing
+ if (!configEventArgs.ChangedConfig.ContainsKey("usenet.host") &&
+ !configEventArgs.ChangedConfig.ContainsKey("usenet.port") &&
+ !configEventArgs.ChangedConfig.ContainsKey("usenet.use-ssl") &&
+ !configEventArgs.ChangedConfig.ContainsKey("usenet.user") &&
+ !configEventArgs.ChangedConfig.ContainsKey("usenet.pass") &&
+ !configEventArgs.ChangedConfig.ContainsKey("usenet.connections")) return;
+
+ // update the connection-pool according to the new config
+ var connectionCount = int.Parse(configEventArgs.NewConfig["usenet.connections"]);
+ var newHost = configEventArgs.NewConfig["usenet.host"];
+ var newPort = int.Parse(configEventArgs.NewConfig["usenet.port"]);
+ var newUseSsl = bool.Parse(configEventArgs.NewConfig["usenet.use-ssl"]);
+ var newUser = configEventArgs.NewConfig["usenet.user"];
+ var newPass = configEventArgs.NewConfig["usenet.pass"];
+ multiConnectionClient.UpdateConnectionPool(new(connectionCount, cancellationToken =>
+ CreateNewConnection(newHost, newPort, newUseSsl, newUser, newPass, cancellationToken)));
+ };
+ }
+
+ public async Task<bool> CheckNzbFileHealth(NzbFile nzbFile, CancellationToken cancellationToken = default)
+ {
+ var childCt = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
+ var tasks = nzbFile.Segments
+ .Select(x => x.MessageId.Value)
+ .Select(x => _client.StatAsync(x, childCt.Token))
+ .ToHashSet();
+
+ while (tasks.Count > 0)
+ {
+ var completedTask = await Task.WhenAny(tasks);
+ tasks.Remove(completedTask);
+
+ var completedResult = await completedTask;
+ if (completedResult.ResponseType != NntpStatResponseType.ArticleExists)
+ {
+ await childCt.CancelAsync();
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public async Task<NzbFileStream> GetFileStream(NzbFile nzbFile, int concurrentConnections, CancellationToken ct)
+ {
+ var firstSegmentId = nzbFile.GetOrderedSegmentIds().First();
+ var firstSegmentStream = await _client.GetSegmentStreamAsync(firstSegmentId, ct);
+ return new NzbFileStream(nzbFile, firstSegmentStream, _client, concurrentConnections);
+ }
+
+ public Stream GetFileStream(string[] segmentIds, long fileSize, int concurrentConnections)
+ {
+ return new NzbFileStream(segmentIds, fileSize, _client, concurrentConnections);
+ }
+
+ public Task<YencHeader> GetSegmentYencHeaderAsync(string segmentId, CancellationToken cancellationToken)
+ {
+ return _client.GetSegmentYencHeaderAsync(segmentId, cancellationToken);
+ }
+
+ public Task<long> GetFileSizeAsync(NzbFile file, CancellationToken cancellationToken)
+ {
+ return _client.GetFileSizeAsync(file, cancellationToken);
+ }
+
+ public static async ValueTask<INntpClient> CreateNewConnection
+ (
+ string host,
+ int port,
+ bool useSsl,
+ string user,
+ string pass,
+ CancellationToken cancellationToken
+ )
+ {
+ var connection = new ThreadSafeNntpClient();
+ if (!await connection.ConnectAsync(host, port, useSsl, cancellationToken))
+ throw new CouldNotConnectToUsenetException("Could not connect to usenet host. Check connection settings.");
+ if (!await connection.AuthenticateAsync(user, pass, cancellationToken))
+ throw new CouldNotLoginToUsenetException("Could not login to usenet host. Check username and password.");
+ return connection;
+ }
+}
\ No newline at end of file
diff --git a/backend/Clients/WrappingNntpClient.cs b/backend/Clients/WrappingNntpClient.cs
new file mode 100644
index 00000000..4a6b72a1
--- /dev/null
+++ b/backend/Clients/WrappingNntpClient.cs
@@ -0,0 +1,55 @@
+using NzbWebDAV.Streams;
+using Usenet.Nntp.Responses;
+using Usenet.Nzb;
+using Usenet.Yenc;
+
+namespace NzbWebDAV.Clients;
+
+public abstract class WrappingNntpClient(INntpClient client) : INntpClient
+{
+ public virtual Task<bool> ConnectAsync(string host, int port, bool useSsl, CancellationToken cancellationToken)
+ {
+ return client.ConnectAsync(host, port, useSsl, cancellationToken);
+ }
+
+ public virtual Task<bool> AuthenticateAsync(string user, string pass, CancellationToken cancellationToken)
+ {
+ return client.AuthenticateAsync(user, pass, cancellationToken);
+ }
+
+ public virtual Task<NntpStatResponse> StatAsync(string segmentId, CancellationToken cancellationToken)
+ {
+ return client.StatAsync(segmentId, cancellationToken);
+ }
+
+ public virtual Task<NntpDateResponse> DateAsync(CancellationToken cancellationToken)
+ {
+ return client.DateAsync(cancellationToken);
+ }
+
+ public virtual Task<YencHeaderStream> GetSegmentStreamAsync(string segmentId, CancellationToken cancellationToken)
+ {
+ return client.GetSegmentStreamAsync(segmentId, cancellationToken);
+ }
+
+ public virtual Task<YencHeader> GetSegmentYencHeaderAsync(string segmentId, CancellationToken cancellationToken)
+ {
+ return client.GetSegmentYencHeaderAsync(segmentId, cancellationToken);
+ }
+
+ public virtual Task<long> GetFileSizeAsync(NzbFile file, CancellationToken cancellationToken)
+ {
+ return client.GetFileSizeAsync(file, cancellationToken);
+ }
+
+ public virtual Task WaitForReady(CancellationToken cancellationToken)
+ {
+ return client.WaitForReady(cancellationToken);
+ }
+
+ public void Dispose()
+ {
+ client.Dispose();
+ GC.SuppressFinalize(this);
+ }
+}
\ No newline at end of file
diff --git a/backend/Config/ConfigManager.cs b/backend/Config/ConfigManager.cs
new file mode 100644
index 00000000..594f438b
--- /dev/null
+++ b/backend/Config/ConfigManager.cs
@@ -0,0 +1,101 @@
+using Microsoft.EntityFrameworkCore;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Utils;
+
+namespace NzbWebDAV.Config;
+
+public class ConfigManager
+{
+ private readonly Dictionary<string, string> _config = new();
+ public event EventHandler<ConfigEventArgs>? OnConfigChanged;
+
+ public async Task LoadConfig()
+ {
+ await using var dbContext = new DavDatabaseContext();
+ var configItems = await dbContext.ConfigItems.ToListAsync();
+ lock (_config)
+ {
+ _config.Clear();
+ foreach (var configItem in configItems)
+ {
+ _config[configItem.ConfigName] = configItem.ConfigValue;
+ }
+ }
+ }
+
+ public string? GetConfigValue(string configName)
+ {
+ lock (_config)
+ {
+ return _config.TryGetValue(configName, out string? value) ? value : null;
+ }
+ }
+
+ public void UpdateValues(List<ConfigItem> configItems)
+ {
+ lock (_config)
+ {
+ foreach (var configItem in configItems)
+ {
+ _config[configItem.ConfigName] = configItem.ConfigValue;
+ }
+
+ OnConfigChanged?.Invoke(this, new ConfigEventArgs
+ {
+ ChangedConfig = configItems.ToDictionary(x => x.ConfigName, x => x.ConfigValue),
+ NewConfig = _config
+ });
+ }
+ }
+
+ public string GetRcloneMountDir()
+ {
+ return StringUtil.EmptyToNull(GetConfigValue("rclone.mount-dir"))
+ ?? StringUtil.EmptyToNull(Environment.GetEnvironmentVariable("MOUNT_DIR"))
+ ?? "/tmp";
+ }
+
+ public string GetApiKey()
+ {
+ return StringUtil.EmptyToNull(GetConfigValue("api.key"))
+ ?? EnvironmentUtil.GetVariable("FRONTEND_BACKEND_API_KEY");
+ }
+
+ public string GetApiCategories()
+ {
+ return StringUtil.EmptyToNull(GetConfigValue("api.categories"))
+ ?? StringUtil.EmptyToNull(Environment.GetEnvironmentVariable("CATEGORIES"))
+ ?? "audio,software,tv,movies";
+ }
+
+ public int GetConnectionsPerStream()
+ {
+ return int.Parse(
+ StringUtil.EmptyToNull(GetConfigValue("usenet.connections-per-stream"))
+ ?? StringUtil.EmptyToNull(Environment.GetEnvironmentVariable("CONNECTIONS_PER_STREAM"))
+ ?? "1"
+ );
+ }
+
+ public string? GetWebdavUser()
+ {
+ return StringUtil.EmptyToNull(GetConfigValue("webdav.user"))
+ ?? StringUtil.EmptyToNull(Environment.GetEnvironmentVariable("WEBDAV_USER"));
+ }
+
+ public string? GetWebdavPasswordHash()
+ {
+ var hashedPass = StringUtil.EmptyToNull(GetConfigValue("webdav.pass"));
+ if (hashedPass != null) return hashedPass;
+ var pass = Environment.GetEnvironmentVariable("WEBDAV_PASSWORD");
+ if (pass != null) return PasswordUtil.Hash(pass);
+ return null;
+ }
+
+ public class ConfigEventArgs : EventArgs
+ {
+ public Dictionary<string, string> ChangedConfig { get; set; } = new();
+ public Dictionary<string, string> NewConfig { get; set; } = new();
+ }
+}
\ No newline at end of file
diff --git a/backend/Database/DavDatabaseClient.cs b/backend/Database/DavDatabaseClient.cs
new file mode 100644
index 00000000..9a035450
--- /dev/null
+++ b/backend/Database/DavDatabaseClient.cs
@@ -0,0 +1,136 @@
+using Microsoft.EntityFrameworkCore;
+using NzbWebDAV.Database.Models;
+
+namespace NzbWebDAV.Database;
+
+public sealed class DavDatabaseClient(DavDatabaseContext ctx)
+{
+ public DavDatabaseContext Ctx => ctx;
+
+ // directory
+ public Task<List<DavItem>> GetDirectoryChildrenAsync(Guid dirId, CancellationToken ct = default)
+ {
+ return ctx.Items.Where(x => x.ParentId == dirId).ToListAsync(ct);
+ }
+
+ public Task<DavItem?> GetDirectoryChildAsync(Guid dirId, string childName, CancellationToken ct = default)
+ {
+ return ctx.Items.FirstOrDefaultAsync(x => x.ParentId == dirId && x.Name == childName, ct);
+ }
+
+ public async Task<long> GetRecursiveSize(Guid dirId, CancellationToken ct = default)
+ {
+ if (dirId == DavItem.Root.Id)
+ {
+ return await Ctx.Items.SumAsync(x => x.FileSize, ct) ?? 0;
+ }
+
+ const string sql = @"
+ WITH RECURSIVE RecursiveChildren AS (
+ SELECT Id, FileSize
+ FROM DavItems
+ WHERE ParentId = @parentId
+
+ UNION ALL
+
+ SELECT d.Id, d.FileSize
+ FROM DavItems d
+ INNER JOIN RecursiveChildren rc ON d.ParentId = rc.Id
+ )
+ SELECT IFNULL(SUM(FileSize), 0)
+ FROM RecursiveChildren;
+ ";
+ var connection = Ctx.Database.GetDbConnection();
+ if (connection.State != System.Data.ConnectionState.Open) await connection.OpenAsync(ct);
+ await using var command = connection.CreateCommand();
+ command.CommandText = sql;
+ var parameter = command.CreateParameter();
+ parameter.ParameterName = "@parentId";
+ parameter.Value = dirId;
+ command.Parameters.Add(parameter);
+ var result = await command.ExecuteScalarAsync(ct);
+ return Convert.ToInt64(result);
+ }
+
+ // nzbfile
+ public async Task<DavNzbFile?> GetNzbFileAsync(Guid id, CancellationToken ct = default)
+ {
+ return await ctx.NzbFiles.FirstOrDefaultAsync(x => x.Id == id, ct);
+ }
+
+ // queue
+ public Task<QueueItem?> GetTopQueueItem(CancellationToken ct = default)
+ {
+ var nowTime = DateTime.Now;
+ return Ctx.QueueItems
+ .OrderByDescending(q => q.Priority)
+ .ThenBy(q => q.CreatedAt)
+ .Where(q => q.PauseUntil == null || DateTime.Now >= q.PauseUntil)
+ .Skip(0)
+ .Take(1)
+ .FirstOrDefaultAsync(ct);
+ }
+
+ public Task<QueueItem[]> GetQueueItems
+ (
+ string? category,
+ int start = 0,
+ int limit = int.MaxValue,
+ CancellationToken ct = default
+ )
+ {
+ return Ctx.QueueItems
+ .Where(q => q.Category == category || category == null)
+ .OrderByDescending(q => q.Priority)
+ .ThenBy(q => q.CreatedAt)
+ .Skip(start)
+ .Take(limit)
+ .Select(q => new QueueItem()
+ {
+ Id = q.Id,
+ CreatedAt = q.CreatedAt,
+ FileName = q.FileName,
+ NzbContents = null!,
+ NzbFileSize = q.NzbFileSize,
+ TotalSegmentBytes = q.TotalSegmentBytes,
+ Category = q.Category,
+ Priority = q.Priority,
+ PostProcessing = q.PostProcessing,
+ })
+ .ToArrayAsync(cancellationToken: ct);
+ }
+
+ public async Task RemoveQueueItemAsync(string id)
+ {
+ try
+ {
+ Ctx.QueueItems.Remove(new QueueItem() { Id = Guid.Parse(id) });
+ await Ctx.SaveChangesAsync();
+ }
+ catch (DbUpdateConcurrencyException e)
+ {
+ var ignoredErrorMessage = "expected to affect 1 row(s), but actually affected 0 row(s)";
+ if (!e.Message.Contains(ignoredErrorMessage)) throw;
+ }
+ }
+
+ // history
+ public async Task RemoveHistoryItemAsync(string id)
+ {
+ try
+ {
+ Ctx.HistoryItems.Remove(new HistoryItem() { Id = Guid.Parse(id) });
+ await Ctx.SaveChangesAsync();
+ }
+ catch (DbUpdateConcurrencyException e)
+ {
+ var ignoredErrorMessage = "expected to affect 1 row(s), but actually affected 0 row(s)";
+ if (!e.Message.Contains(ignoredErrorMessage)) throw;
+ }
+ }
+
+ private class FileSizeResult
+ {
+ public long TotalSize { get; init; }
+ }
+}
\ No newline at end of file
diff --git a/backend/Database/DavDatabaseContext.cs b/backend/Database/DavDatabaseContext.cs
new file mode 100644
index 00000000..bbc9a626
--- /dev/null
+++ b/backend/Database/DavDatabaseContext.cs
@@ -0,0 +1,249 @@
+using System.Text.Json;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using NzbWebDAV.Database.Interceptors;
+using NzbWebDAV.Database.Models;
+
+namespace NzbWebDAV.Database;
+
+public sealed class DavDatabaseContext() : DbContext(Options.Value)
+{
+ public static string ConfigPath => Environment.GetEnvironmentVariable("CONFIG_PATH") ?? "/config";
+
+ private static readonly Lazy<DbContextOptions<DavDatabaseContext>> Options = new(() =>
+ {
+ var databaseFilePath = Path.Join(ConfigPath, "db.sqlite");
+ return new DbContextOptionsBuilder<DavDatabaseContext>()
+ .UseSqlite($"Data Source={databaseFilePath}")
+ .AddInterceptors(new SqliteForeignKeyEnabler())
+ .Options;
+ });
+
+ // database sets
+ public DbSet<Account> Accounts => Set<Account>();
+ public DbSet<DavItem> Items => Set<DavItem>();
+ public DbSet<DavNzbFile> NzbFiles => Set<DavNzbFile>();
+ public DbSet<DavRarFile> RarFiles => Set<DavRarFile>();
+ public DbSet<QueueItem> QueueItems => Set<QueueItem>();
+ public DbSet<HistoryItem> HistoryItems => Set<HistoryItem>();
+ public DbSet<ConfigItem> ConfigItems => Set<ConfigItem>();
+
+ // tables
+ protected override void OnModelCreating(ModelBuilder b)
+ {
+ // Account
+ b.Entity<Account>(e =>
+ {
+ e.ToTable("Accounts");
+ e.HasKey(i => new { i.Type, i.Username });
+
+ e.Property(i => i.Type)
+ .HasConversion<int>()
+ .IsRequired();
+
+ e.Property(i => i.Username)
+ .IsRequired()
+ .HasMaxLength(255);
+
+ e.Property(i => i.PasswordHash)
+ .IsRequired();
+
+ e.Property(i => i.RandomSalt)
+ .IsRequired();
+ });
+
+ // DavItem
+ b.Entity<DavItem>(e =>
+ {
+ e.ToTable("DavItems");
+ e.HasKey(i => i.Id);
+
+ e.Property(i => i.Id)
+ .ValueGeneratedNever();
+
+ e.Property(i => i.CreatedAt)
+ .ValueGeneratedNever()
+ .IsRequired();
+
+ e.Property(i => i.Name)
+ .IsRequired()
+ .HasMaxLength(255);
+
+ e.Property(i => i.Type)
+ .HasConversion<int>()
+ .IsRequired();
+
+ e.HasOne(i => i.Parent)
+ .WithMany(p => p.Children)
+ .HasForeignKey(i => i.ParentId)
+ .OnDelete(DeleteBehavior.Cascade);
+
+ e.HasIndex(i => new { i.ParentId, i.Name })
+ .IsUnique();
+ });
+
+ // DavNzbFile
+ b.Entity<DavNzbFile>(e =>
+ {
+ e.ToTable("DavNzbFiles");
+ e.HasKey(f => f.Id);
+
+ e.Property(i => i.Id)
+ .ValueGeneratedNever();
+
+ e.Property(f => f.SegmentIds)
+ .HasConversion(new ValueConverter<string[], string>
+ (
+ v => JsonSerializer.Serialize(v, (JsonSerializerOptions?)null),
+ v => JsonSerializer.Deserialize<string[]>(v, (JsonSerializerOptions?)null) ?? Array.Empty<string>()
+ ))
+ .HasColumnType("TEXT") // store raw JSON
+ .IsRequired();
+
+ e.HasOne(f => f.DavItem)
+ .WithOne()
+ .HasForeignKey<DavNzbFile>(f => f.Id)
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ // DavRarFile
+ b.Entity<DavRarFile>(e =>
+ {
+ e.ToTable("DavRarFiles");
+ e.HasKey(f => f.Id);
+
+ e.Property(i => i.Id)
+ .ValueGeneratedNever();
+
+ e.Property(f => f.RarParts)
+ .HasConversion(new ValueConverter<DavRarFile.RarPart[], string>
+ (
+ v => JsonSerializer.Serialize(v, (JsonSerializerOptions?)null),
+ v => JsonSerializer.Deserialize<DavRarFile.RarPart[]>(v, (JsonSerializerOptions?)null)
+ ?? Array.Empty<DavRarFile.RarPart>()
+ ))
+ .HasColumnType("TEXT") // store raw JSON
+ .IsRequired();
+
+ e.HasOne(f => f.DavItem)
+ .WithOne()
+ .HasForeignKey<DavRarFile>(f => f.Id)
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ // QueueItem
+ b.Entity<QueueItem>(e =>
+ {
+ e.ToTable("QueueItems");
+ e.HasKey(i => i.Id);
+
+ e.Property(i => i.Id)
+ .ValueGeneratedNever();
+
+ e.Property(i => i.CreatedAt)
+ .ValueGeneratedNever()
+ .IsRequired();
+
+ e.Property(i => i.FileName)
+ .IsRequired();
+
+ e.Property(i => i.NzbContents)
+ .IsRequired();
+
+ e.Property(i => i.NzbFileSize)
+ .IsRequired();
+
+ e.Property(i => i.TotalSegmentBytes)
+ .IsRequired();
+
+ e.Property(i => i.Category)
+ .IsRequired();
+
+ e.Property(i => i.Priority)
+ .HasConversion<int>()
+ .IsRequired();
+
+ e.Property(i => i.PostProcessing)
+ .HasConversion<int>()
+ .IsRequired();
+
+ e.Property(i => i.PauseUntil)
+ .ValueGeneratedNever();
+
+ e.HasIndex(i => new { i.FileName })
+ .IsUnique();
+
+ e.Property(i => i.JobName)
+ .IsRequired();
+
+ e.HasIndex(i => new { i.Priority })
+ .IsUnique(false);
+
+ e.HasIndex(i => new { i.CreatedAt })
+ .IsUnique(false);
+
+ e.HasIndex(i => new { i.Category })
+ .IsUnique(false);
+
+ e.HasIndex(i => new { i.Priority, i.CreatedAt })
+ .IsUnique(false);
+
+ e.HasIndex(i => new { i.Category, i.Priority, i.CreatedAt })
+ .IsUnique(false);
+ });
+
+ // HistoryItem
+ b.Entity<HistoryItem>(e =>
+ {
+ e.ToTable("HistoryItems");
+ e.HasKey(i => i.Id);
+
+ e.Property(i => i.Id)
+ .ValueGeneratedNever();
+
+ e.Property(i => i.CreatedAt)
+ .ValueGeneratedNever()
+ .IsRequired();
+
+ e.Property(i => i.FileName)
+ .IsRequired();
+
+ e.Property(i => i.JobName)
+ .IsRequired();
+
+ e.Property(i => i.Category)
+ .IsRequired();
+
+ e.Property(i => i.DownloadStatus)
+ .HasConversion<int>()
+ .IsRequired();
+
+ e.Property(i => i.TotalSegmentBytes)
+ .IsRequired();
+
+ e.Property(i => i.DownloadTimeSeconds)
+ .IsRequired();
+
+ e.Property(i => i.FailMessage)
+ .IsRequired(false);
+
+ e.HasIndex(i => new { i.CreatedAt })
+ .IsUnique(false);
+
+ e.HasIndex(i => new { i.Category })
+ .IsUnique(false);
+
+ e.HasIndex(i => new { i.Category, i.CreatedAt })
+ .IsUnique(false);
+ });
+
+ // ConfigItem
+ b.Entity<ConfigItem>(e =>
+ {
+ e.ToTable("ConfigItems");
+ e.HasKey(i => i.ConfigName);
+ e.Property(i => i.ConfigValue)
+ .IsRequired();
+ });
+ }
+}
\ No newline at end of file
diff --git a/backend/Database/Interceptors/SqliteForeignKeyEnabler.cs b/backend/Database/Interceptors/SqliteForeignKeyEnabler.cs
new file mode 100644
index 00000000..134ec982
--- /dev/null
+++ b/backend/Database/Interceptors/SqliteForeignKeyEnabler.cs
@@ -0,0 +1,14 @@
+using System.Data.Common;
+using Microsoft.EntityFrameworkCore.Diagnostics;
+
+namespace NzbWebDAV.Database.Interceptors;
+
+public class SqliteForeignKeyEnabler : DbConnectionInterceptor
+{
+ public override void ConnectionOpened(DbConnection connection, ConnectionEndEventData eventData)
+ {
+ using var command = connection.CreateCommand();
+ command.CommandText = "PRAGMA foreign_keys = ON;";
+ command.ExecuteNonQuery();
+ }
+}
\ No newline at end of file
diff --git a/backend/Database/Migrations/20250529081501_InitializeDatabase.Designer.cs b/backend/Database/Migrations/20250529081501_InitializeDatabase.Designer.cs
new file mode 100644
index 00000000..1d1a8c83
--- /dev/null
+++ b/backend/Database/Migrations/20250529081501_InitializeDatabase.Designer.cs
@@ -0,0 +1,217 @@
+// <auto-generated />
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using NzbWebDAV.Database;
+
+#nullable disable
+
+namespace NzbWebDAV.Database.Migrations
+{
+ [DbContext(typeof(DavDatabaseContext))]
+ [Migration("20250529081501_InitializeDatabase")]
+ partial class InitializeDatabase
+ {
+ /// <inheritdoc />
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "9.0.4");
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<long?>("FileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("Name")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property<Guid?>("ParentId")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("Type")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId", "Name")
+ .IsUnique();
+
+ b.ToTable("DavItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("SegmentIds")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavNzbFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("RarParts")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavRarFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.HistoryItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("DownloadStatus")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("DownloadTimeSeconds")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("FailMessage")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("Category", "CreatedAt");
+
+ b.ToTable("HistoryItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.QueueItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("NzbContents")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("NzbFileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<DateTime?>("PauseUntil")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("PostProcessing")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("Priority")
+ .HasColumnType("INTEGER");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("FileName")
+ .IsUnique();
+
+ b.HasIndex("Priority");
+
+ b.HasIndex("Priority", "CreatedAt");
+
+ b.HasIndex("Category", "Priority", "CreatedAt");
+
+ b.ToTable("QueueItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "Parent")
+ .WithMany("Children")
+ .HasForeignKey("ParentId")
+ .OnDelete(DeleteBehavior.Cascade);
+
+ b.Navigation("Parent");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavNzbFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavRarFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Navigation("Children");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/backend/Database/Migrations/20250529081501_InitializeDatabase.cs b/backend/Database/Migrations/20250529081501_InitializeDatabase.cs
new file mode 100644
index 00000000..059b55d9
--- /dev/null
+++ b/backend/Database/Migrations/20250529081501_InitializeDatabase.cs
@@ -0,0 +1,224 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+using NzbWebDAV.Database.Models;
+
+#nullable disable
+
+namespace NzbWebDAV.Database.Migrations
+{
+ /// <inheritdoc />
+ public partial class InitializeDatabase : Migration
+ {
+ /// <inheritdoc />
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "DavItems",
+ columns: table => new
+ {
+ Id = table.Column<Guid>(type: "TEXT", nullable: false),
+ ParentId = table.Column<Guid>(type: "TEXT", nullable: true),
+ Name = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
+ FileSize = table.Column<long>(type: "INTEGER", nullable: true),
+ Type = table.Column<int>(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_DavItems", x => x.Id);
+ table.ForeignKey(
+ name: "FK_DavItems_DavItems_ParentId",
+ column: x => x.ParentId,
+ principalTable: "DavItems",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "HistoryItems",
+ columns: table => new
+ {
+ Id = table.Column<Guid>(type: "TEXT", nullable: false),
+ CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
+ FileName = table.Column<string>(type: "TEXT", nullable: false),
+ JobName = table.Column<string>(type: "TEXT", nullable: false),
+ Category = table.Column<string>(type: "TEXT", nullable: false),
+ DownloadStatus = table.Column<int>(type: "INTEGER", nullable: false),
+ TotalSegmentBytes = table.Column<long>(type: "INTEGER", nullable: false),
+ DownloadTimeSeconds = table.Column<int>(type: "INTEGER", nullable: false),
+ FailMessage = table.Column<string>(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_HistoryItems", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "QueueItems",
+ columns: table => new
+ {
+ Id = table.Column<Guid>(type: "TEXT", nullable: false),
+ CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
+ FileName = table.Column<string>(type: "TEXT", nullable: false),
+ JobName = table.Column<string>(type: "TEXT", nullable: false),
+ NzbContents = table.Column<string>(type: "TEXT", nullable: false),
+ NzbFileSize = table.Column<long>(type: "INTEGER", nullable: false),
+ TotalSegmentBytes = table.Column<long>(type: "INTEGER", nullable: false),
+ Category = table.Column<string>(type: "TEXT", nullable: false),
+ Priority = table.Column<int>(type: "INTEGER", nullable: false),
+ PostProcessing = table.Column<int>(type: "INTEGER", nullable: false),
+ PauseUntil = table.Column<DateTime>(type: "TEXT", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_QueueItems", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "DavNzbFiles",
+ columns: table => new
+ {
+ Id = table.Column<Guid>(type: "TEXT", nullable: false),
+ SegmentIds = table.Column<string>(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_DavNzbFiles", x => x.Id);
+ table.ForeignKey(
+ name: "FK_DavNzbFiles_DavItems_Id",
+ column: x => x.Id,
+ principalTable: "DavItems",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "DavRarFiles",
+ columns: table => new
+ {
+ Id = table.Column<Guid>(type: "TEXT", nullable: false),
+ RarParts = table.Column<string>(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_DavRarFiles", x => x.Id);
+ table.ForeignKey(
+ name: "FK_DavRarFiles_DavItems_Id",
+ column: x => x.Id,
+ principalTable: "DavItems",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_DavItems_ParentId_Name",
+ table: "DavItems",
+ columns: new[] { "ParentId", "Name" },
+ unique: true);
+
+ migrationBuilder.CreateIndex(
+ name: "IX_HistoryItems_Category",
+ table: "HistoryItems",
+ column: "Category");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_HistoryItems_Category_CreatedAt",
+ table: "HistoryItems",
+ columns: new[] { "Category", "CreatedAt" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_HistoryItems_CreatedAt",
+ table: "HistoryItems",
+ column: "CreatedAt");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_QueueItems_Category",
+ table: "QueueItems",
+ column: "Category");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_QueueItems_Category_Priority_CreatedAt",
+ table: "QueueItems",
+ columns: new[] { "Category", "Priority", "CreatedAt" });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_QueueItems_CreatedAt",
+ table: "QueueItems",
+ column: "CreatedAt");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_QueueItems_FileName",
+ table: "QueueItems",
+ column: "FileName",
+ unique: true);
+
+ migrationBuilder.CreateIndex(
+ name: "IX_QueueItems_Priority",
+ table: "QueueItems",
+ column: "Priority");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_QueueItems_Priority_CreatedAt",
+ table: "QueueItems",
+ columns: new[] { "Priority", "CreatedAt" });
+
+ migrationBuilder.InsertData(
+ table: "DavItems",
+ columns: new[] { "Id", "ParentId", "Name", "FileSize", "Type" },
+ values: new object[,]
+ {
+ {
+ // Root
+ Guid.Parse("00000000-0000-0000-0000-000000000000"),
+ null,
+ "/",
+ null,
+ 1, // Directory
+ },
+ {
+ // NzbFolder
+ Guid.Parse("00000000-0000-0000-0000-000000000001"),
+ Guid.Parse("00000000-0000-0000-0000-000000000000"),
+ "nzbs",
+ null,
+ 1, // Directory
+ },
+ {
+ // ContentFolder
+ DavItem.ContentFolder.Id,
+ Guid.Parse("00000000-0000-0000-0000-000000000000"),
+ "content",
+ null,
+ 1, // Directory
+ },
+ {
+ // SymlinkFolder
+ DavItem.SymlinkFolder.Id,
+ Guid.Parse("00000000-0000-0000-0000-000000000000"),
+ "completed-symlinks",
+ null,
+ 2, // Symlink-Root
+ }
+ }
+ );
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "DavNzbFiles");
+
+ migrationBuilder.DropTable(
+ name: "DavRarFiles");
+
+ migrationBuilder.DropTable(
+ name: "HistoryItems");
+
+ migrationBuilder.DropTable(
+ name: "QueueItems");
+
+ migrationBuilder.DropTable(
+ name: "DavItems");
+ }
+ }
+}
diff --git a/backend/Database/Migrations/20250529102749_Add-CreatedAt-To-DavItem.Designer.cs b/backend/Database/Migrations/20250529102749_Add-CreatedAt-To-DavItem.Designer.cs
new file mode 100644
index 00000000..b8873b5c
--- /dev/null
+++ b/backend/Database/Migrations/20250529102749_Add-CreatedAt-To-DavItem.Designer.cs
@@ -0,0 +1,220 @@
+// <auto-generated />
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using NzbWebDAV.Database;
+
+#nullable disable
+
+namespace NzbWebDAV.Database.Migrations
+{
+ [DbContext(typeof(DavDatabaseContext))]
+ [Migration("20250529102749_Add-CreatedAt-To-DavItem")]
+ partial class AddCreatedAtToDavItem
+ {
+ /// <inheritdoc />
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "9.0.4");
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<long?>("FileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("Name")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property<Guid?>("ParentId")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("Type")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId", "Name")
+ .IsUnique();
+
+ b.ToTable("DavItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("SegmentIds")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavNzbFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("RarParts")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavRarFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.HistoryItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("DownloadStatus")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("DownloadTimeSeconds")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("FailMessage")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("Category", "CreatedAt");
+
+ b.ToTable("HistoryItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.QueueItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("NzbContents")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("NzbFileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<DateTime?>("PauseUntil")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("PostProcessing")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("Priority")
+ .HasColumnType("INTEGER");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("FileName")
+ .IsUnique();
+
+ b.HasIndex("Priority");
+
+ b.HasIndex("Priority", "CreatedAt");
+
+ b.HasIndex("Category", "Priority", "CreatedAt");
+
+ b.ToTable("QueueItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "Parent")
+ .WithMany("Children")
+ .HasForeignKey("ParentId")
+ .OnDelete(DeleteBehavior.Cascade);
+
+ b.Navigation("Parent");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavNzbFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavRarFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Navigation("Children");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/backend/Database/Migrations/20250529102749_Add-CreatedAt-To-DavItem.cs b/backend/Database/Migrations/20250529102749_Add-CreatedAt-To-DavItem.cs
new file mode 100644
index 00000000..b3ad5c0d
--- /dev/null
+++ b/backend/Database/Migrations/20250529102749_Add-CreatedAt-To-DavItem.cs
@@ -0,0 +1,30 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace NzbWebDAV.Database.Migrations
+{
+ /// <inheritdoc />
+ public partial class AddCreatedAtToDavItem : Migration
+ {
+ /// <inheritdoc />
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn<DateTime>(
+ name: "CreatedAt",
+ table: "DavItems",
+ type: "TEXT",
+ nullable: false,
+ defaultValue: DateTime.MinValue); // this is `01/01/0001 00:00:00`
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "CreatedAt",
+ table: "DavItems");
+ }
+ }
+}
diff --git a/backend/Database/Migrations/20250605030729_Add-Accounts-Table.Designer.cs b/backend/Database/Migrations/20250605030729_Add-Accounts-Table.Designer.cs
new file mode 100644
index 00000000..2867e258
--- /dev/null
+++ b/backend/Database/Migrations/20250605030729_Add-Accounts-Table.Designer.cs
@@ -0,0 +1,242 @@
+// <auto-generated />
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using NzbWebDAV.Database;
+
+#nullable disable
+
+namespace NzbWebDAV.Database.Migrations
+{
+ [DbContext(typeof(DavDatabaseContext))]
+ [Migration("20250605030729_Add-Accounts-Table")]
+ partial class AddAccountsTable
+ {
+ /// <inheritdoc />
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "9.0.4");
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.Account", b =>
+ {
+ b.Property<int>("Type")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("Username")
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property<string>("PasswordHash")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("RandomSalt")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Type", "Username");
+
+ b.ToTable("Accounts", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<long?>("FileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("Name")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property<Guid?>("ParentId")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("Type")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId", "Name")
+ .IsUnique();
+
+ b.ToTable("DavItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("SegmentIds")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavNzbFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("RarParts")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavRarFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.HistoryItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("DownloadStatus")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("DownloadTimeSeconds")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("FailMessage")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("Category", "CreatedAt");
+
+ b.ToTable("HistoryItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.QueueItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("NzbContents")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("NzbFileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<DateTime?>("PauseUntil")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("PostProcessing")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("Priority")
+ .HasColumnType("INTEGER");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("FileName")
+ .IsUnique();
+
+ b.HasIndex("Priority");
+
+ b.HasIndex("Priority", "CreatedAt");
+
+ b.HasIndex("Category", "Priority", "CreatedAt");
+
+ b.ToTable("QueueItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "Parent")
+ .WithMany("Children")
+ .HasForeignKey("ParentId")
+ .OnDelete(DeleteBehavior.Cascade);
+
+ b.Navigation("Parent");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavNzbFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavRarFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Navigation("Children");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/backend/Database/Migrations/20250605030729_Add-Accounts-Table.cs b/backend/Database/Migrations/20250605030729_Add-Accounts-Table.cs
new file mode 100644
index 00000000..88e15eab
--- /dev/null
+++ b/backend/Database/Migrations/20250605030729_Add-Accounts-Table.cs
@@ -0,0 +1,35 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace NzbWebDAV.Database.Migrations
+{
+ /// <inheritdoc />
+ public partial class AddAccountsTable : Migration
+ {
+ /// <inheritdoc />
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "Accounts",
+ columns: table => new
+ {
+ Type = table.Column<int>(type: "INTEGER", nullable: false),
+ Username = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
+ PasswordHash = table.Column<string>(type: "TEXT", nullable: false),
+ RandomSalt = table.Column<string>(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Accounts", x => new { x.Type, x.Username });
+ });
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "Accounts");
+ }
+ }
+}
diff --git a/backend/Database/Migrations/20250710072717_AddConfigItemsTable.Designer.cs b/backend/Database/Migrations/20250710072717_AddConfigItemsTable.Designer.cs
new file mode 100644
index 00000000..10073cae
--- /dev/null
+++ b/backend/Database/Migrations/20250710072717_AddConfigItemsTable.Designer.cs
@@ -0,0 +1,256 @@
+// <auto-generated />
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using NzbWebDAV.Database;
+
+#nullable disable
+
+namespace NzbWebDAV.Database.Migrations
+{
+ [DbContext(typeof(DavDatabaseContext))]
+ [Migration("20250710072717_AddConfigItemsTable")]
+ partial class AddConfigItemsTable
+ {
+ /// <inheritdoc />
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "9.0.4");
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.Account", b =>
+ {
+ b.Property<int>("Type")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("Username")
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property<string>("PasswordHash")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("RandomSalt")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Type", "Username");
+
+ b.ToTable("Accounts", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.ConfigItem", b =>
+ {
+ b.Property<string>("ConfigName")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("ConfigValue")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("ConfigName");
+
+ b.ToTable("ConfigItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<long?>("FileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("Name")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property<Guid?>("ParentId")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("Type")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId", "Name")
+ .IsUnique();
+
+ b.ToTable("DavItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("SegmentIds")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavNzbFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("RarParts")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavRarFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.HistoryItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("DownloadStatus")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("DownloadTimeSeconds")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("FailMessage")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("Category", "CreatedAt");
+
+ b.ToTable("HistoryItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.QueueItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("NzbContents")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("NzbFileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<DateTime?>("PauseUntil")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("PostProcessing")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("Priority")
+ .HasColumnType("INTEGER");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("FileName")
+ .IsUnique();
+
+ b.HasIndex("Priority");
+
+ b.HasIndex("Priority", "CreatedAt");
+
+ b.HasIndex("Category", "Priority", "CreatedAt");
+
+ b.ToTable("QueueItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "Parent")
+ .WithMany("Children")
+ .HasForeignKey("ParentId")
+ .OnDelete(DeleteBehavior.Cascade);
+
+ b.Navigation("Parent");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavNzbFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavRarFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Navigation("Children");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/backend/Database/Migrations/20250710072717_AddConfigItemsTable.cs b/backend/Database/Migrations/20250710072717_AddConfigItemsTable.cs
new file mode 100644
index 00000000..e10ee488
--- /dev/null
+++ b/backend/Database/Migrations/20250710072717_AddConfigItemsTable.cs
@@ -0,0 +1,33 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace NzbWebDAV.Database.Migrations
+{
+ /// <inheritdoc />
+ public partial class AddConfigItemsTable : Migration
+ {
+ /// <inheritdoc />
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "ConfigItems",
+ columns: table => new
+ {
+ ConfigName = table.Column<string>(type: "TEXT", nullable: false),
+ ConfigValue = table.Column<string>(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ConfigItems", x => x.ConfigName);
+ });
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "ConfigItems");
+ }
+ }
+}
diff --git a/backend/Database/Migrations/20250722004955_Ensure-Api-Key-Exists.Designer.cs b/backend/Database/Migrations/20250722004955_Ensure-Api-Key-Exists.Designer.cs
new file mode 100644
index 00000000..a61282bf
--- /dev/null
+++ b/backend/Database/Migrations/20250722004955_Ensure-Api-Key-Exists.Designer.cs
@@ -0,0 +1,256 @@
+// <auto-generated />
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using NzbWebDAV.Database;
+
+#nullable disable
+
+namespace NzbWebDAV.Database.Migrations
+{
+ [DbContext(typeof(DavDatabaseContext))]
+ [Migration("20250722004955_Ensure-Api-Key-Exists")]
+ partial class EnsureApiKeyExists
+ {
+ /// <inheritdoc />
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "9.0.4");
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.Account", b =>
+ {
+ b.Property<int>("Type")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("Username")
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property<string>("PasswordHash")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("RandomSalt")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Type", "Username");
+
+ b.ToTable("Accounts", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.ConfigItem", b =>
+ {
+ b.Property<string>("ConfigName")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("ConfigValue")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("ConfigName");
+
+ b.ToTable("ConfigItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<long?>("FileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("Name")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property<Guid?>("ParentId")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("Type")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId", "Name")
+ .IsUnique();
+
+ b.ToTable("DavItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("SegmentIds")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavNzbFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("RarParts")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavRarFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.HistoryItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("DownloadStatus")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("DownloadTimeSeconds")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("FailMessage")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("Category", "CreatedAt");
+
+ b.ToTable("HistoryItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.QueueItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("NzbContents")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("NzbFileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<DateTime?>("PauseUntil")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("PostProcessing")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("Priority")
+ .HasColumnType("INTEGER");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("FileName")
+ .IsUnique();
+
+ b.HasIndex("Priority");
+
+ b.HasIndex("Priority", "CreatedAt");
+
+ b.HasIndex("Category", "Priority", "CreatedAt");
+
+ b.ToTable("QueueItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "Parent")
+ .WithMany("Children")
+ .HasForeignKey("ParentId")
+ .OnDelete(DeleteBehavior.Cascade);
+
+ b.Navigation("Parent");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavNzbFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavRarFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Navigation("Children");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/backend/Database/Migrations/20250722004955_Ensure-Api-Key-Exists.cs b/backend/Database/Migrations/20250722004955_Ensure-Api-Key-Exists.cs
new file mode 100644
index 00000000..6c81934a
--- /dev/null
+++ b/backend/Database/Migrations/20250722004955_Ensure-Api-Key-Exists.cs
@@ -0,0 +1,33 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+using NzbWebDAV.Utils;
+
+#nullable disable
+
+namespace NzbWebDAV.Database.Migrations
+{
+ /// <inheritdoc />
+ public partial class EnsureApiKeyExists : Migration
+ {
+ /// <inheritdoc />
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.InsertData(
+ table: "ConfigItems",
+ columns: new[] { "ConfigName", "ConfigValue" },
+ values: new object[,]
+ {
+ {
+ "api.key",
+ GuidUtil.GenerateSecureGuid().ToString("N")
+ },
+ }
+ );
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ // Intentionally left blank
+ }
+ }
+}
diff --git a/backend/Database/Migrations/DavDatabaseContextModelSnapshot.cs b/backend/Database/Migrations/DavDatabaseContextModelSnapshot.cs
new file mode 100644
index 00000000..56ee5ccd
--- /dev/null
+++ b/backend/Database/Migrations/DavDatabaseContextModelSnapshot.cs
@@ -0,0 +1,253 @@
+// <auto-generated />
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using NzbWebDAV.Database;
+
+#nullable disable
+
+namespace NzbWebDAV.Database.Migrations
+{
+ [DbContext(typeof(DavDatabaseContext))]
+ partial class DavDatabaseContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "9.0.4");
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.Account", b =>
+ {
+ b.Property<int>("Type")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("Username")
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property<string>("PasswordHash")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("RandomSalt")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Type", "Username");
+
+ b.ToTable("Accounts", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.ConfigItem", b =>
+ {
+ b.Property<string>("ConfigName")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("ConfigValue")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("ConfigName");
+
+ b.ToTable("ConfigItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<long?>("FileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("Name")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("TEXT");
+
+ b.Property<Guid?>("ParentId")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("Type")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParentId", "Name")
+ .IsUnique();
+
+ b.ToTable("DavItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("SegmentIds")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavNzbFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("RarParts")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("DavRarFiles", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.HistoryItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("DownloadStatus")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("DownloadTimeSeconds")
+ .HasColumnType("INTEGER");
+
+ b.Property<string>("FailMessage")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("Category", "CreatedAt");
+
+ b.ToTable("HistoryItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.QueueItem", b =>
+ {
+ b.Property<Guid>("Id")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("Category")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<DateTime>("CreatedAt")
+ .HasColumnType("TEXT");
+
+ b.Property<string>("FileName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("JobName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<string>("NzbContents")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property<long>("NzbFileSize")
+ .HasColumnType("INTEGER");
+
+ b.Property<DateTime?>("PauseUntil")
+ .HasColumnType("TEXT");
+
+ b.Property<int>("PostProcessing")
+ .HasColumnType("INTEGER");
+
+ b.Property<int>("Priority")
+ .HasColumnType("INTEGER");
+
+ b.Property<long>("TotalSegmentBytes")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Category");
+
+ b.HasIndex("CreatedAt");
+
+ b.HasIndex("FileName")
+ .IsUnique();
+
+ b.HasIndex("Priority");
+
+ b.HasIndex("Priority", "CreatedAt");
+
+ b.HasIndex("Category", "Priority", "CreatedAt");
+
+ b.ToTable("QueueItems", (string)null);
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "Parent")
+ .WithMany("Children")
+ .HasForeignKey("ParentId")
+ .OnDelete(DeleteBehavior.Cascade);
+
+ b.Navigation("Parent");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavNzbFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavNzbFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavRarFile", b =>
+ {
+ b.HasOne("NzbWebDAV.Database.Models.DavItem", "DavItem")
+ .WithOne()
+ .HasForeignKey("NzbWebDAV.Database.Models.DavRarFile", "Id")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("DavItem");
+ });
+
+ modelBuilder.Entity("NzbWebDAV.Database.Models.DavItem", b =>
+ {
+ b.Navigation("Children");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/backend/Database/Models/Account.cs b/backend/Database/Models/Account.cs
new file mode 100644
index 00000000..54ec1645
--- /dev/null
+++ b/backend/Database/Models/Account.cs
@@ -0,0 +1,15 @@
+namespace NzbWebDAV.Database.Models;
+
+public class Account
+{
+ public AccountType Type { get; init; }
+ public string Username { get; init; }
+ public string PasswordHash { get; init; }
+ public string RandomSalt { get; init; }
+
+ public enum AccountType
+ {
+ Admin = 1,
+ WebDav = 2,
+ }
+}
\ No newline at end of file
diff --git a/backend/Database/Models/ConfigItem.cs b/backend/Database/Models/ConfigItem.cs
new file mode 100644
index 00000000..15f76780
--- /dev/null
+++ b/backend/Database/Models/ConfigItem.cs
@@ -0,0 +1,23 @@
+using System.Collections.Immutable;
+
+namespace NzbWebDAV.Database.Models;
+
+public class ConfigItem
+{
+ public static readonly ImmutableHashSet<string> Keys = ImmutableHashSet.Create([
+ "api.key",
+ "api.categories",
+ "usenet.host",
+ "usenet.port",
+ "usenet.use-ssl",
+ "usenet.connections",
+ "usenet.user",
+ "usenet.pass",
+ "webdav.user",
+ "webdav.pass",
+ "rclone.mount-dir",
+ ]);
+
+ public string ConfigName { get; set; } = null!;
+ public string ConfigValue { get; set; } = null!;
+}
\ No newline at end of file
diff --git a/backend/Database/Models/DavItem.cs b/backend/Database/Models/DavItem.cs
new file mode 100644
index 00000000..c6d1ea0e
--- /dev/null
+++ b/backend/Database/Models/DavItem.cs
@@ -0,0 +1,69 @@
+using System.Text.Json.Serialization;
+
+namespace NzbWebDAV.Database.Models;
+
+public class DavItem
+{
+ public Guid Id { get; init; }
+ public DateTime CreatedAt { get; init; }
+ public Guid? ParentId { get; init; }
+ public string Name { get; init; } = null!;
+ public long? FileSize { get; set; }
+ public ItemType Type { get; init; }
+
+ // Important: numerical values cannot be
+ // changed without a database migration.
+ public enum ItemType
+ {
+ Directory = 1,
+ SymlinkRoot = 2,
+ NzbFile = 3,
+ RarFile = 4,
+ }
+
+ // navigation helpers
+ [JsonIgnore]
+ public DavItem? Parent { get; set; }
+
+ [JsonIgnore]
+ public ICollection<DavItem> Children { get; set; } = new List<DavItem>();
+
+ // static instances
+ // Important: assigned values cannot be
+ // changed without a database migration.
+ public static readonly DavItem Root = new()
+ {
+ Id = Guid.Parse("00000000-0000-0000-0000-000000000000"),
+ ParentId = null,
+ Name = "/",
+ FileSize = null,
+ Type = ItemType.Directory,
+ };
+
+ public static readonly DavItem NzbFolder = new()
+ {
+ Id = Guid.Parse("00000000-0000-0000-0000-000000000001"),
+ ParentId = Root.Id,
+ Name = "nzbs",
+ FileSize = null,
+ Type = ItemType.Directory,
+ };
+
+ public static readonly DavItem ContentFolder = new()
+ {
+ Id = Guid.Parse("00000000-0000-0000-0000-000000000002"),
+ ParentId = Root.Id,
+ Name = "content",
+ FileSize = null,
+ Type = ItemType.Directory,
+ };
+
+ public static readonly DavItem SymlinkFolder = new()
+ {
+ Id = Guid.Parse("00000000-0000-0000-0000-000000000003"),
+ ParentId = Root.Id,
+ Name = "completed-symlinks",
+ FileSize = null,
+ Type = ItemType.SymlinkRoot,
+ };
+}
\ No newline at end of file
diff --git a/backend/Database/Models/DavNzbFile.cs b/backend/Database/Models/DavNzbFile.cs
new file mode 100644
index 00000000..836759e4
--- /dev/null
+++ b/backend/Database/Models/DavNzbFile.cs
@@ -0,0 +1,10 @@
+namespace NzbWebDAV.Database.Models;
+
+public class DavNzbFile
+{
+ public Guid Id { get; set; } // foreign key to DavItem.Id
+ public string[] SegmentIds { get; set; } = [];
+
+ // navigation helpers
+ public DavItem? DavItem { get; set; }
+}
\ No newline at end of file
diff --git a/backend/Database/Models/DavRarFile.cs b/backend/Database/Models/DavRarFile.cs
new file mode 100644
index 00000000..8f2220f3
--- /dev/null
+++ b/backend/Database/Models/DavRarFile.cs
@@ -0,0 +1,18 @@
+namespace NzbWebDAV.Database.Models;
+
+public class DavRarFile
+{
+ public Guid Id { get; set; } // foreign key to DavItem.Id
+ public RarPart[] RarParts { get; set; } = [];
+
+ // navigation helpers
+ public DavItem? DavItem { get; set; }
+
+ public class RarPart
+ {
+ public string[] SegmentIds { get; set; } = [];
+ public long PartSize { get; set; }
+ public long Offset { get; set; }
+ public long ByteCount { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/backend/Database/Models/HistoryItem.cs b/backend/Database/Models/HistoryItem.cs
new file mode 100644
index 00000000..3fb97ac0
--- /dev/null
+++ b/backend/Database/Models/HistoryItem.cs
@@ -0,0 +1,20 @@
+namespace NzbWebDAV.Database.Models;
+
+public class HistoryItem
+{
+ public Guid Id { get; set; }
+ public DateTime CreatedAt { get; set; }
+ public string FileName { get; set; } = null!;
+ public string JobName { get; set; } = null!;
+ public string Category { get; set; }
+ public DownloadStatusOption DownloadStatus { get; set; }
+ public long TotalSegmentBytes { get; set; }
+ public int DownloadTimeSeconds { get; set; }
+ public string? FailMessage { get; set; }
+
+ public enum DownloadStatusOption
+ {
+ Completed = 1,
+ Failed = 2,
+ }
+}
\ No newline at end of file
diff --git a/backend/Database/Models/QueueItem.cs b/backend/Database/Models/QueueItem.cs
new file mode 100644
index 00000000..8d287fa6
--- /dev/null
+++ b/backend/Database/Models/QueueItem.cs
@@ -0,0 +1,36 @@
+namespace NzbWebDAV.Database.Models;
+
+public class QueueItem
+{
+ public Guid Id { get; set; }
+ public DateTime CreatedAt { get; set; }
+ public string FileName { get; set; } = null!;
+ public string JobName { get; set; } = null!;
+ public string NzbContents { get; set; } = null!;
+ public long NzbFileSize { get; set; }
+ public long TotalSegmentBytes { get; set; }
+ public string Category { get; set; } = null!;
+ public PriorityOption Priority { get; set; }
+ public PostProcessingOption PostProcessing { get; set; }
+ public DateTime? PauseUntil { get; set; }
+
+ public enum PriorityOption
+ {
+ Default = -100,
+ Duplicate = -3,
+ Paused = -2,
+ Low = -1,
+ Normal = 0,
+ High = 1,
+ Force = 2
+ }
+
+ public enum PostProcessingOption
+ {
+ Default = -1,
+ None = 0,
+ Repair = 1,
+ RepairUnpack = 2,
+ RepairUnpackDelete = 3
+ }
+}
\ No newline at end of file
diff --git a/backend/Dockerfile b/backend/Dockerfile
new file mode 100644
index 00000000..f6629db6
--- /dev/null
+++ b/backend/Dockerfile
@@ -0,0 +1,17 @@
+# Build the project
+FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env
+WORKDIR /nzb-webdav
+COPY ./ ./
+RUN dotnet restore
+RUN dotnet publish -c Release -r linux-musl-x64 -o ./publish
+
+# Build the production image
+FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine
+EXPOSE 8080
+WORKDIR /nzb-webdav
+RUN mkdir /config
+RUN apk add --no-cache libc6-compat shadow su-exec && rm -rf /var/cache/apk/*
+COPY --from=build-env /nzb-webdav/publish ./
+COPY entrypoint.sh /entrypoint.sh
+RUN chmod +x /entrypoint.sh
+CMD ["/entrypoint.sh"]
\ No newline at end of file
diff --git a/backend/Exceptions/CouldNotConnectToUsenetException.cs b/backend/Exceptions/CouldNotConnectToUsenetException.cs
new file mode 100644
index 00000000..a5ce507b
--- /dev/null
+++ b/backend/Exceptions/CouldNotConnectToUsenetException.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Exceptions;
+
+public class CouldNotConnectToUsenetException(string message) : RetryableDownloadException(message)
+{
+}
\ No newline at end of file
diff --git a/backend/Exceptions/CouldNotLoginToUsenetException.cs b/backend/Exceptions/CouldNotLoginToUsenetException.cs
new file mode 100644
index 00000000..30075bd2
--- /dev/null
+++ b/backend/Exceptions/CouldNotLoginToUsenetException.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Exceptions;
+
+public class CouldNotLoginToUsenetException(string message) : RetryableDownloadException(message)
+{
+}
\ No newline at end of file
diff --git a/backend/Exceptions/NoVideoFilesFoundException.cs b/backend/Exceptions/NoVideoFilesFoundException.cs
new file mode 100644
index 00000000..746bb2f8
--- /dev/null
+++ b/backend/Exceptions/NoVideoFilesFoundException.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Exceptions;
+
+public class NoVideoFilesFoundException(string message) : NonRetryableDownloadException(message)
+{
+}
\ No newline at end of file
diff --git a/backend/Exceptions/NonRetryableDownloadException.cs b/backend/Exceptions/NonRetryableDownloadException.cs
new file mode 100644
index 00000000..e1d36319
--- /dev/null
+++ b/backend/Exceptions/NonRetryableDownloadException.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Exceptions;
+
+public class NonRetryableDownloadException(string message) : Exception(message)
+{
+}
\ No newline at end of file
diff --git a/backend/Exceptions/PasswordProtectedRarException.cs b/backend/Exceptions/PasswordProtectedRarException.cs
new file mode 100644
index 00000000..c1a8fb19
--- /dev/null
+++ b/backend/Exceptions/PasswordProtectedRarException.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Exceptions;
+
+public class PasswordProtectedRarException(string message) : NonRetryableDownloadException(message)
+{
+}
\ No newline at end of file
diff --git a/backend/Exceptions/RetryableDownloadException.cs b/backend/Exceptions/RetryableDownloadException.cs
new file mode 100644
index 00000000..1a9d768d
--- /dev/null
+++ b/backend/Exceptions/RetryableDownloadException.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Exceptions;
+
+public class RetryableDownloadException(string message) : Exception(message)
+{
+}
\ No newline at end of file
diff --git a/backend/Exceptions/UnsupportedRarCompressionMethodException.cs b/backend/Exceptions/UnsupportedRarCompressionMethodException.cs
new file mode 100644
index 00000000..2773aaf5
--- /dev/null
+++ b/backend/Exceptions/UnsupportedRarCompressionMethodException.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Exceptions;
+
+public class UnsupportedRarCompressionMethodException(string message) : NonRetryableDownloadException(message)
+{
+}
\ No newline at end of file
diff --git a/backend/Exceptions/UsenetArticleNotFoundException.cs b/backend/Exceptions/UsenetArticleNotFoundException.cs
new file mode 100644
index 00000000..7970eef7
--- /dev/null
+++ b/backend/Exceptions/UsenetArticleNotFoundException.cs
@@ -0,0 +1,5 @@
+namespace NzbWebDAV.Exceptions;
+
+public class UsenetArticleNotFoundException(string message) : NonRetryableDownloadException(message)
+{
+}
\ No newline at end of file
diff --git a/backend/Extensions/DavItemExtensions.cs b/backend/Extensions/DavItemExtensions.cs
new file mode 100644
index 00000000..eb063dd0
--- /dev/null
+++ b/backend/Extensions/DavItemExtensions.cs
@@ -0,0 +1,19 @@
+using NzbWebDAV.Database.Models;
+
+namespace NzbWebDAV.Extensions;
+
+public static class DavItemExtensions
+{
+ private static readonly HashSet<Guid> Protected =
+ [
+ DavItem.Root.Id,
+ DavItem.SymlinkFolder.Id,
+ DavItem.ContentFolder.Id,
+ DavItem.NzbFolder.Id,
+ ];
+
+ public static bool IsProtected(this DavItem item)
+ {
+ return Protected.Contains(item.Id);
+ }
+}
\ No newline at end of file
diff --git a/backend/Extensions/ExceptionExtensions.cs b/backend/Extensions/ExceptionExtensions.cs
new file mode 100644
index 00000000..d6c7f2e0
--- /dev/null
+++ b/backend/Extensions/ExceptionExtensions.cs
@@ -0,0 +1,13 @@
+using NzbWebDAV.Exceptions;
+
+namespace NzbWebDAV.Extensions;
+
+public static class ExceptionExtensions
+{
+ public static bool IsNonRetryableDownloadException(this Exception exception)
+ {
+ return exception is NonRetryableDownloadException
+ or SharpCompress.Common.InvalidFormatException
+ or Usenet.Exceptions.InvalidYencDataException;
+ }
+}
\ No newline at end of file
diff --git a/backend/Extensions/HttpContextExtensions.cs b/backend/Extensions/HttpContextExtensions.cs
new file mode 100644
index 00000000..ad222eee
--- /dev/null
+++ b/backend/Extensions/HttpContextExtensions.cs
@@ -0,0 +1,17 @@
+using Microsoft.AspNetCore.Http;
+
+namespace NzbWebDAV.Extensions;
+
+public static class HttpContextExtensions
+{
+ public static string? GetQueryParam(this HttpContext httpContext, string name)
+ {
+ return httpContext.Request.Query[name].FirstOrDefault();
+ }
+
+ public static string? GetRequestApiKey(this HttpContext httpContext)
+ {
+ return httpContext.Request.Headers["x-api-key"].FirstOrDefault()
+ ?? httpContext.GetQueryParam("apikey");
+ }
+}
\ No newline at end of file
diff --git a/backend/Extensions/IEnumerableTaskExtensions.cs b/backend/Extensions/IEnumerableTaskExtensions.cs
new file mode 100644
index 00000000..4a0dbfd2
--- /dev/null
+++ b/backend/Extensions/IEnumerableTaskExtensions.cs
@@ -0,0 +1,67 @@
+// ReSharper disable InconsistentNaming
+
+namespace NzbWebDAV.Extensions;
+
+public static class IEnumerableTaskExtensions
+{
+ /// <summary>
+ /// Executes tasks with specified concurrency and enumerates results as they come in
+ /// </summary>
+ /// <param name="tasks">The tasks to execute</param>
+ /// <param name="concurrency">The max concurrency</param>
+ /// <param name="cancellationToken">The cancellation token</param>
+ /// <typeparam name="T">The resulting type of each task</typeparam>
+ /// <returns>An IAsyncEnumerable that enumerates task results as they come in</returns>
+ public static IEnumerable<Task<T>> WithConcurrency<T>
+ (
+ this IEnumerable<Task<T>> tasks,
+ int concurrency
+ ) where T : IDisposable
+ {
+ if (concurrency < 1)
+ throw new ArgumentException("concurrency must be greater than zero.");
+
+ if (concurrency == 1)
+ {
+ foreach (var task in tasks) yield return task;
+ yield break;
+ }
+
+ var isFirst = true;
+ var runningTasks = new Queue<Task<T>>();
+ Task<T>? completedTask = null;
+ try
+ {
+ foreach (var task in tasks)
+ {
+ if (isFirst)
+ {
+ // help with time-to-first-byte
+ yield return task;
+ isFirst = false;
+ continue;
+ }
+
+ runningTasks.Enqueue(task);
+ if (runningTasks.Count < concurrency) continue;
+ completedTask = runningTasks.Dequeue();
+ yield return completedTask;
+ completedTask = null;
+ }
+
+ while (runningTasks.Count > 0)
+ {
+ completedTask = runningTasks.Dequeue();
+ yield return completedTask;
+ completedTask = null;
+ }
+ }
+ finally
+ {
+ if (completedTask != null)
+ _ = completedTask.ContinueWith(x => x.Result.Dispose());
+ while (runningTasks.Count > 0)
+ _ = runningTasks.Dequeue().ContinueWith(x => x.Result.Dispose());
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/Extensions/NWebDavOptionsExtensions.cs b/backend/Extensions/NWebDavOptionsExtensions.cs
new file mode 100644
index 00000000..1fd7bb44
--- /dev/null
+++ b/backend/Extensions/NWebDavOptionsExtensions.cs
@@ -0,0 +1,13 @@
+using Microsoft.AspNetCore.Http;
+using NWebDav.Server;
+
+namespace NzbWebDAV.Extensions;
+
+public static class NWebDavOptionsExtensions
+{
+ public static Func<HttpContext, bool> GetFilter(this NWebDavOptions options)
+ {
+ return context => !context.Request.Path.StartsWithSegments("/api") &&
+ !context.Request.Path.StartsWithSegments("/view");
+ }
+}
\ No newline at end of file
diff --git a/backend/Extensions/NzbDocumentExtensions.cs b/backend/Extensions/NzbDocumentExtensions.cs
new file mode 100644
index 00000000..2cb5c845
--- /dev/null
+++ b/backend/Extensions/NzbDocumentExtensions.cs
@@ -0,0 +1,18 @@
+using Usenet.Nzb;
+
+namespace NzbWebDAV.Extensions;
+
+public static class NzbDocumentExtensions
+{
+ public static string? GetMetadataName(this NzbDocument nzbDocument)
+ {
+ return nzbDocument.MetaData.TryGetValue("name", out var name)
+ ? name.FirstOrDefault()
+ : null;
+ }
+
+ public static string GetShortCode(this NzbDocument nzbDocument)
+ {
+ return nzbDocument.GetHashCode().ToString("x8");
+ }
+}
\ No newline at end of file
diff --git a/backend/Extensions/NzbFileExtensions.cs b/backend/Extensions/NzbFileExtensions.cs
new file mode 100644
index 00000000..c196a668
--- /dev/null
+++ b/backend/Extensions/NzbFileExtensions.cs
@@ -0,0 +1,44 @@
+using System.Text.RegularExpressions;
+using Usenet.Nzb;
+
+namespace NzbWebDAV.Extensions;
+
+public static class NzbFileExtensions
+{
+ public static string[] GetOrderedSegmentIds(this NzbFile file)
+ {
+ return file.Segments
+ .OrderBy(x => x.Number)
+ .Select(x => x.MessageId.Value)
+ .ToArray();
+ }
+
+ public static string GetSubjectFileName(this NzbFile file)
+ {
+ return FirstNonEmpty(
+ () => TryParseFilename1(file),
+ () => TryParseFilename2(file)
+ );
+ }
+
+ private static string TryParseFilename1(this NzbFile file)
+ {
+ var match = Regex.Match(file.Subject, "\\\"(.*)\\\"");
+ if (match.Success) return match.Groups[1].Value;
+ return "";
+ }
+
+ private static string TryParseFilename2(this NzbFile file)
+ {
+ var matches = Regex.Matches(file.Subject, @"\[([^\[\]]*)\]");
+ return matches
+ .Select(x => x.Groups[1].Value)
+ .Where(x => Path.GetExtension(x).StartsWith("."))
+ .FirstOrDefault(x => Path.GetExtension(x).Length < 6) ?? "";
+ }
+
+ private static string FirstNonEmpty(params Func<string>[] funcs)
+ {
+ return funcs.Select(x => x.Invoke()).FirstOrDefault(x => x != "") ?? "";
+ }
+}
\ No newline at end of file
diff --git a/backend/Extensions/ObjectExtensions.cs b/backend/Extensions/ObjectExtensions.cs
new file mode 100644
index 00000000..e194692e
--- /dev/null
+++ b/backend/Extensions/ObjectExtensions.cs
@@ -0,0 +1,13 @@
+using System.Reflection;
+
+namespace NzbWebDAV.Extensions;
+
+public static class ObjectExtensions
+{
+ public static object? GetReflectionProperty(this object obj, string propertyName)
+ {
+ var type = obj.GetType();
+ var prop = type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
+ return prop?.GetValue(obj);
+ }
+}
\ No newline at end of file
diff --git a/backend/Extensions/RarHeaderExtensions.cs b/backend/Extensions/RarHeaderExtensions.cs
new file mode 100644
index 00000000..1a49c057
--- /dev/null
+++ b/backend/Extensions/RarHeaderExtensions.cs
@@ -0,0 +1,31 @@
+using SharpCompress.Common.Rar.Headers;
+
+namespace NzbWebDAV.Extensions;
+
+public static class RarHeaderExtensions
+{
+ public static byte GetCompressionMethod(this IRarHeader header)
+ {
+ return (byte)header.GetReflectionProperty("CompressionMethod")!;
+ }
+
+ public static long GetDataStartPosition(this IRarHeader header)
+ {
+ return (long)header.GetReflectionProperty("DataStartPosition")!;
+ }
+
+ public static long GetAdditionalDataSize(this IRarHeader header)
+ {
+ return (long)header.GetReflectionProperty("AdditionalDataSize")!;
+ }
+
+ public static long GetCompressedSize(this IRarHeader header)
+ {
+ return (long)header.GetReflectionProperty("CompressedSize")!;
+ }
+
+ public static string GetFileName(this IRarHeader header)
+ {
+ return (string)header.GetReflectionProperty("FileName")!;
+ }
+}
\ No newline at end of file
diff --git a/backend/Extensions/StreamExtensions.cs b/backend/Extensions/StreamExtensions.cs
new file mode 100644
index 00000000..53aac57e
--- /dev/null
+++ b/backend/Extensions/StreamExtensions.cs
@@ -0,0 +1,27 @@
+using NzbWebDAV.Streams;
+
+namespace NzbWebDAV.Extensions;
+
+public static class StreamExtensions
+{
+ public static Stream LimitLength(this Stream stream, long length)
+ {
+ return new LimitedLengthStream(stream, length);
+ }
+
+ public static void Drain(this Stream stream)
+ {
+ var buffer = new byte[1024];
+ while (stream.Read(buffer, 0, buffer.Length) > 0) ;
+ }
+
+ public static Stream OnDispose(this Stream stream, Action onDispose)
+ {
+ return new DisposableCallbackStream(stream, onDispose, async () => onDispose?.Invoke());
+ }
+
+ public static Stream OnDisposeAsync(this Stream stream, Func<ValueTask> onDisposeAsync)
+ {
+ return new DisposableCallbackStream(stream, onDisposeAsync: onDisposeAsync);
+ }
+}
\ No newline at end of file
diff --git a/backend/Extensions/StringExtensions.cs b/backend/Extensions/StringExtensions.cs
new file mode 100644
index 00000000..1a057669
--- /dev/null
+++ b/backend/Extensions/StringExtensions.cs
@@ -0,0 +1,14 @@
+namespace NzbWebDAV.Extensions;
+
+public static class StringExtensions
+{
+ public static bool IsAny(this string value, params string[] acceptedValues)
+ {
+ return acceptedValues.Any(acceptedValue => value == acceptedValue);
+ }
+
+ public static string RemovePrefix(this string value, string prefix)
+ {
+ return value.StartsWith(prefix) ? value[prefix.Length..] : value;
+ }
+}
\ No newline at end of file
diff --git a/backend/Middlewares/RequestCancelledMiddleware.cs b/backend/Middlewares/RequestCancelledMiddleware.cs
new file mode 100644
index 00000000..cca83840
--- /dev/null
+++ b/backend/Middlewares/RequestCancelledMiddleware.cs
@@ -0,0 +1,24 @@
+using Microsoft.AspNetCore.Http;
+
+namespace NzbWebDAV.Middlewares;
+
+public class RequestCancelledMiddleware(RequestDelegate next)
+{
+ public async Task InvokeAsync(HttpContext context)
+ {
+ try
+ {
+ await next(context);
+ }
+ catch (OperationCanceledException) when (context.RequestAborted.IsCancellationRequested)
+ {
+ // If the response has not started, we can write our custom response
+ if (!context.Response.HasStarted)
+ {
+ context.Response.Clear();
+ context.Response.StatusCode = 499; // Non-standard status code for client closed request
+ await context.Response.WriteAsync("Client closed request.");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/NzbWebDAV.csproj b/backend/NzbWebDAV.csproj
new file mode 100644
index 00000000..59f0bb7c
--- /dev/null
+++ b/backend/NzbWebDAV.csproj
@@ -0,0 +1,28 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>net9.0</TargetFramework>
+ <ImplicitUsings>enable</ImplicitUsings>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
+ <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.4">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ </PackageReference>
+ <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.4" />
+ <PackageReference Include="NWebDav.Server" Version="0.2.0-beta.2" />
+ <PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
+ <PackageReference Include="Serilog.Sinks.Console" Version="6.0.1-dev-00953" />
+ <PackageReference Include="SharpCompress" Version="0.39.0" />
+ <PackageReference Include="Usenet" Version="3.1.0" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <EmbeddedResource Include="Api\SabControllers\GetConfig\config_template.json" />
+ </ItemGroup>
+
+</Project>
diff --git a/backend/Program.cs b/backend/Program.cs
new file mode 100644
index 00000000..d1774385
--- /dev/null
+++ b/backend/Program.cs
@@ -0,0 +1,124 @@
+using System.Security.Claims;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.DataProtection;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.DependencyInjection;
+using NWebDav.Server;
+using NWebDav.Server.Authentication;
+using NWebDav.Server.Stores;
+using NzbWebDAV.Api.SabControllers;
+using NzbWebDAV.Clients;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Extensions;
+using NzbWebDAV.Middlewares;
+using NzbWebDAV.Services;
+using NzbWebDAV.Utils;
+using NzbWebDAV.WebDav;
+using NzbWebDAV.WebDav.Base;
+using Serilog;
+using Serilog.Events;
+using Serilog.Sinks.SystemConsole.Themes;
+
+namespace NzbWebDAV;
+
+class Program
+{
+ static async Task Main(string[] args)
+ {
+ // Initialize logger
+ var defaultLevel = LogEventLevel.Information;
+ var envLevel = Environment.GetEnvironmentVariable("LOG_LEVEL");
+ var level = Enum.TryParse<LogEventLevel>(envLevel, true, out var parsed) ? parsed : defaultLevel;
+ Log.Logger = new LoggerConfiguration()
+ .MinimumLevel.Is(level)
+ .MinimumLevel.Override("Microsoft.AspNetCore.Hosting", LogEventLevel.Warning)
+ .MinimumLevel.Override("Microsoft.AspNetCore.Mvc", LogEventLevel.Warning)
+ .MinimumLevel.Override("Microsoft.AspNetCore.Routing", LogEventLevel.Warning)
+ .MinimumLevel.Override("Microsoft.AspNetCore.DataProtection", LogEventLevel.Error)
+ .WriteTo.Console(theme: AnsiConsoleTheme.Code)
+ .CreateLogger();
+
+ // initialize database
+ var databaseContext = new DavDatabaseContext();
+ await databaseContext.Database.MigrateAsync();
+
+ // initialize the config-manager
+ var configManager = new ConfigManager();
+ await configManager.LoadConfig();
+
+ // initialize webapp
+ var builder = WebApplication.CreateBuilder(args);
+ builder.Host.UseSerilog();
+ builder.Services.AddControllers();
+ builder.Services
+ .AddSingleton(configManager)
+ .AddSingleton<UsenetStreamingClient>()
+ .AddSingleton<QueueManager>()
+ .AddScoped<DavDatabaseContext>()
+ .AddScoped<DavDatabaseClient>()
+ .AddScoped<DatabaseStore>()
+ .AddScoped<IStore, DatabaseStore>()
+ .AddScoped<GetAndHeadHandlerPatch>()
+ .AddScoped<SabApiController>()
+ .AddNWebDav(opts =>
+ {
+ opts.Handlers["GET"] = typeof(GetAndHeadHandlerPatch);
+ opts.Handlers["HEAD"] = typeof(GetAndHeadHandlerPatch);
+ opts.Filter = opts.GetFilter();
+ opts.RequireAuthentication = true;
+ });
+
+ // add basic auth
+ builder.Services
+ .AddDataProtection()
+ .PersistKeysToFileSystem(new DirectoryInfo(Path.Join(DavDatabaseContext.ConfigPath, "data-protection")));
+ builder.Services
+ .AddAuthentication(opts => opts.DefaultScheme = BasicAuthenticationDefaults.AuthenticationScheme)
+ .AddBasicAuthentication(opts =>
+ {
+ opts.AllowInsecureProtocol = true;
+ opts.CacheCookieName = "nzb-webdav-backend";
+ opts.CacheCookieExpiration = TimeSpan.FromHours(1);
+ opts.Events.OnValidateCredentials = (context) => ValidateCredentials(context, configManager);
+ });
+
+ // run
+ var app = builder.Build();
+ app.UseSerilogRequestLogging();
+ app.UseMiddleware<RequestCancelledMiddleware>();
+ app.UseAuthentication();
+ app.MapControllers();
+ app.UseNWebDav();
+ await app.RunAsync();
+ }
+
+ private static Task ValidateCredentials(ValidateCredentialsContext context, ConfigManager configManager)
+ {
+ var user = configManager.GetWebdavUser();
+ var passwordHash = configManager.GetWebdavPasswordHash();
+
+ if (user == null || passwordHash == null)
+ context.Fail("webdav user and password are not yet configured.");
+
+ if (context.Username == user && PasswordUtil.Verify(passwordHash!, context.Password))
+ {
+ var claims = new[]
+ {
+ new Claim(ClaimTypes.NameIdentifier, context.Username, ClaimValueTypes.String,
+ context.Options.ClaimsIssuer),
+ new Claim(ClaimTypes.Name, context.Username, ClaimValueTypes.String,
+ context.Options.ClaimsIssuer)
+ };
+
+ context.Principal = new ClaimsPrincipal(new ClaimsIdentity(claims, context.Scheme.Name));
+ context.Success();
+ }
+ else
+ {
+ context.Fail("invalid credentials");
+ }
+
+ return Task.CompletedTask;
+ }
+}
\ No newline at end of file
diff --git a/backend/Services/FileAggregators/FileAggregator.cs b/backend/Services/FileAggregators/FileAggregator.cs
new file mode 100644
index 00000000..0f1273b4
--- /dev/null
+++ b/backend/Services/FileAggregators/FileAggregator.cs
@@ -0,0 +1,36 @@
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Services.FileProcessors;
+
+namespace NzbWebDAV.Services.FileAggregators;
+
+public class FileAggregator(DavDatabaseClient dbClient, DavItem mountDirectory) : IAggregator
+{
+ public void UpdateDatabase(List<BaseProcessor.Result> processorResults)
+ {
+ foreach (var processorResult in processorResults)
+ {
+ if (processorResult is not FileProcessor.Result result) continue;
+ if (result.FileName == "") continue; // skip files whose name we can't determine
+
+ var davItem = new DavItem()
+ {
+ Id = Guid.NewGuid(),
+ CreatedAt = DateTime.Now,
+ ParentId = mountDirectory.Id,
+ Name = result.FileName,
+ FileSize = result.FileSize,
+ Type = DavItem.ItemType.NzbFile
+ };
+
+ var davNzbFile = new DavNzbFile()
+ {
+ Id = davItem.Id,
+ SegmentIds = result.NzbFile.Segments.Select(x => x.MessageId.Value).ToArray(),
+ };
+
+ dbClient.Ctx.Items.Add(davItem);
+ dbClient.Ctx.NzbFiles.Add(davNzbFile);
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/Services/FileAggregators/IAggregator.cs b/backend/Services/FileAggregators/IAggregator.cs
new file mode 100644
index 00000000..c9a73b65
--- /dev/null
+++ b/backend/Services/FileAggregators/IAggregator.cs
@@ -0,0 +1,8 @@
+using NzbWebDAV.Services.FileProcessors;
+
+namespace NzbWebDAV.Services.FileAggregators;
+
+public interface IAggregator
+{
+ public void UpdateDatabase(List<BaseProcessor.Result> processorResults);
+}
\ No newline at end of file
diff --git a/backend/Services/FileAggregators/RarAggregator.cs b/backend/Services/FileAggregators/RarAggregator.cs
new file mode 100644
index 00000000..557c409b
--- /dev/null
+++ b/backend/Services/FileAggregators/RarAggregator.cs
@@ -0,0 +1,97 @@
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Services.FileProcessors;
+
+namespace NzbWebDAV.Services.FileAggregators;
+
+public class RarAggregator(DavDatabaseClient dbClient, DavItem mountDirectory) : IAggregator
+{
+ public void UpdateDatabase(List<BaseProcessor.Result> processorResults)
+ {
+ var orderedArchiveParts = processorResults
+ .OfType<RarProcessor.Result>()
+ .OrderBy(x => x.PartNumber)
+ .ToList();
+
+ ProcessArchive(orderedArchiveParts);
+ }
+
+ private void ProcessArchive(List<RarProcessor.Result> archiveParts)
+ {
+ var archiveFiles = new Dictionary<string, List<DavRarFile.RarPart>>();
+ foreach (var archivePart in archiveParts)
+ {
+ foreach (var fileSegment in archivePart.StoredFileSegments)
+ {
+ if (!archiveFiles.ContainsKey(fileSegment.PathWithinArchive))
+ archiveFiles.Add(fileSegment.PathWithinArchive, new List<DavRarFile.RarPart>());
+
+ archiveFiles[fileSegment.PathWithinArchive].Add(new DavRarFile.RarPart()
+ {
+ SegmentIds = archivePart.NzbFile.Segments.Select(x => x.MessageId.Value).ToArray(),
+ PartSize = archivePart.PartSize,
+ Offset = fileSegment.Offset,
+ ByteCount = fileSegment.ByteCount,
+ });
+ }
+ }
+
+ foreach (var archiveFile in archiveFiles)
+ {
+ var pathWithinArchive = archiveFile.Key;
+ var rarParts = archiveFile.Value.ToArray();
+ var parentDirectory = EnsurePath(pathWithinArchive);
+
+ var davItem = new DavItem()
+ {
+ Id = Guid.NewGuid(),
+ CreatedAt = DateTime.Now,
+ ParentId = parentDirectory.Id,
+ Name = Path.GetFileName(pathWithinArchive),
+ FileSize = rarParts.Sum(x => x.ByteCount),
+ Type = DavItem.ItemType.RarFile
+ };
+
+ var davRarFile = new DavRarFile()
+ {
+ Id = davItem.Id,
+ RarParts = rarParts,
+ };
+
+ dbClient.Ctx.Items.Add(davItem);
+ dbClient.Ctx.RarFiles.Add(davRarFile);
+ }
+ }
+
+ private DavItem EnsurePath(string pathWithinArchive)
+ {
+ var pathSegments = pathWithinArchive.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
+ var parentDirectory = mountDirectory;
+ var pathKey = "";
+ for (var i = 0; i < pathSegments.Length - 1; i++)
+ {
+ pathKey = Path.Join(pathKey, pathSegments[i]);
+ parentDirectory = EnsureDirectory(parentDirectory, pathSegments[i], pathKey);
+ }
+
+ return parentDirectory;
+ }
+
+ private readonly Dictionary<string, DavItem> _directoryCache = new();
+
+ private DavItem EnsureDirectory(DavItem parentDirectory, string directoryName, string pathKey)
+ {
+ if (_directoryCache.TryGetValue(pathKey, out var cachedDirectory)) return cachedDirectory;
+ var directory = new DavItem()
+ {
+ Id = Guid.NewGuid(),
+ CreatedAt = DateTime.Now,
+ ParentId = parentDirectory.Id,
+ Name = directoryName,
+ Type = DavItem.ItemType.Directory
+ };
+ _directoryCache.Add(pathKey, directory);
+ dbClient.Ctx.Items.Add(directory);
+ return directory;
+ }
+}
\ No newline at end of file
diff --git a/backend/Services/FileProcessors/BaseProcessor.cs b/backend/Services/FileProcessors/BaseProcessor.cs
new file mode 100644
index 00000000..55096324
--- /dev/null
+++ b/backend/Services/FileProcessors/BaseProcessor.cs
@@ -0,0 +1,7 @@
+namespace NzbWebDAV.Services.FileProcessors;
+
+public abstract class BaseProcessor
+{
+ public abstract Task<Result> ProcessAsync();
+ public class Result { }
+}
\ No newline at end of file
diff --git a/backend/Services/FileProcessors/FileProcessor.cs b/backend/Services/FileProcessors/FileProcessor.cs
new file mode 100644
index 00000000..0384f663
--- /dev/null
+++ b/backend/Services/FileProcessors/FileProcessor.cs
@@ -0,0 +1,36 @@
+using NzbWebDAV.Clients;
+using NzbWebDAV.Extensions;
+using Usenet.Nzb;
+
+namespace NzbWebDAV.Services.FileProcessors;
+
+public class FileProcessor(NzbFile nzbFile, UsenetStreamingClient usenet, CancellationToken ct) : BaseProcessor
+{
+ public static bool CanProcess(NzbFile file)
+ {
+ // skip par2 files
+ return !file.GetSubjectFileName().EndsWith(".par2", StringComparison.OrdinalIgnoreCase);
+ }
+
+ public override async Task<BaseProcessor.Result> ProcessAsync()
+ {
+ var firstSegment = nzbFile.Segments[0].MessageId.Value;
+ var header = await usenet.GetSegmentYencHeaderAsync(firstSegment, default);
+ var subjectFilename = nzbFile.GetSubjectFileName();
+ var fileName = Path.GetFileName(subjectFilename != "" ? subjectFilename : header.FileName);
+
+ return new Result()
+ {
+ NzbFile = nzbFile,
+ FileName = fileName,
+ FileSize = header.FileSize,
+ };
+ }
+
+ public new class Result : BaseProcessor.Result
+ {
+ public NzbFile NzbFile { get; init; } = null!;
+ public string FileName { get; init; } = null!;
+ public long FileSize { get; init; }
+ }
+}
\ No newline at end of file
diff --git a/backend/Services/FileProcessors/RarProcessor.cs b/backend/Services/FileProcessors/RarProcessor.cs
new file mode 100644
index 00000000..d5de87fd
--- /dev/null
+++ b/backend/Services/FileProcessors/RarProcessor.cs
@@ -0,0 +1,131 @@
+using System.Text.RegularExpressions;
+using NzbWebDAV.Clients;
+using NzbWebDAV.Exceptions;
+using NzbWebDAV.Extensions;
+using SharpCompress.Common;
+using SharpCompress.Common.Rar.Headers;
+using SharpCompress.IO;
+using SharpCompress.Readers;
+using Usenet.Nzb;
+using Usenet.Yenc;
+
+namespace NzbWebDAV.Services.FileProcessors;
+
+public class RarProcessor(NzbFile nzbFile, UsenetStreamingClient usenet, CancellationToken ct) : BaseProcessor
+{
+ public static bool CanProcess(NzbFile file)
+ {
+ return IsRarFile(file.GetSubjectFileName());
+ }
+
+ public override async Task<BaseProcessor.Result> ProcessAsync()
+ {
+ try
+ {
+ await using var stream = await usenet.GetFileStream(nzbFile, concurrentConnections: 1, ct);
+ var filename = GetFileName(stream.FirstYencHeader);
+ return new Result()
+ {
+ NzbFile = nzbFile,
+ PartSize = stream.Length,
+ ArchiveName = GetArchiveName(filename),
+ PartNumber = GetPartNumber(filename),
+ StoredFileSegments = GetRarHeaders(stream)
+ .Select(x => new StoredFileSegment()
+ {
+ PathWithinArchive = x.GetFileName(),
+ Offset = x.GetDataStartPosition(),
+ ByteCount = x.GetAdditionalDataSize(),
+ }).ToArray(),
+ };
+ }
+ catch (CryptographicException ex)
+ {
+ throw new PasswordProtectedRarException("Password-protected RARs are not supported");
+ }
+ }
+
+ private static bool IsRarFile(string? filename)
+ {
+ if (string.IsNullOrEmpty(filename)) return false;
+ return filename.EndsWith(".rar", StringComparison.OrdinalIgnoreCase)
+ || Regex.IsMatch(filename, @"\.r(\d+)$", RegexOptions.IgnoreCase);
+ }
+
+ private string GetFileName(YencHeader? header)
+ {
+ // try getting the filename from subject and header
+ var fromSubject = nzbFile.GetSubjectFileName();
+ var fromHeader = header?.FileName ?? "";
+
+ // if only one of them ends in .rar, or .rXX, return that one
+ if (IsRarFile(fromSubject) && !IsRarFile(fromHeader)) return fromSubject;
+ if (IsRarFile(fromHeader) && !IsRarFile(fromSubject)) return fromHeader;
+
+ // if both end in .rar or .rXX, return whichever has a higher part number
+ return new[] { fromSubject, fromHeader }.MaxBy(GetPartNumber)!;
+ }
+
+ private string GetArchiveName(string filename)
+ {
+ // remove the .rar extension and remove the .partXX if it exists
+ var sansExtension = Path.GetFileNameWithoutExtension(filename);
+ sansExtension = Regex.Replace(sansExtension, @"\.part\d+$", "");
+ return sansExtension;
+ }
+
+ private int GetPartNumber(string filename)
+ {
+ // handle the `.partXXX.rar` format
+ var partMatch = Regex.Match(filename, @"\.part(\d+)\.rar$", RegexOptions.IgnoreCase);
+ if (partMatch.Success) return int.Parse(partMatch.Groups[1].Value);
+
+ // handle the `.rXXX` format
+ var rMatch = Regex.Match(filename, @"\.r(\d+)$", RegexOptions.IgnoreCase);
+ if (rMatch.Success) return int.Parse(rMatch.Groups[1].Value);
+
+ // handle the `.rar` format.
+ return -1;
+ }
+
+ private List<IRarHeader> GetRarHeaders(Stream stream)
+ {
+ var headerFactory = new RarHeaderFactory(StreamingMode.Seekable, new ReaderOptions());
+ var headers = new List<IRarHeader>();
+ foreach (var header in headerFactory.ReadHeaders(stream))
+ {
+ // we only care about file headers
+ if (header.HeaderType != HeaderType.File || header.GetFileName() == "QO") continue;
+
+ // we only support stored files (compression method m0).
+ if (header.GetCompressionMethod() != 0)
+ throw new UnsupportedRarCompressionMethodException(
+ "Only rar files with compression method m0 are supported.");
+
+ // add the headers
+ headers.Add(header);
+
+ // break early if we think there are no more headers.
+ var left = stream.Length - (header.GetDataStartPosition() + header.GetCompressedSize());
+ if (left < 1000) break;
+ }
+
+ return headers;
+ }
+
+ public new class Result : BaseProcessor.Result
+ {
+ public NzbFile NzbFile { get; init; } = null!;
+ public long PartSize { get; init; }
+ public string ArchiveName { get; init; } = null!;
+ public int PartNumber { get; init; }
+ public StoredFileSegment[] StoredFileSegments { get; init; } = [];
+ }
+
+ public class StoredFileSegment
+ {
+ public string PathWithinArchive { get; init; } = null!;
+ public long Offset { get; init; }
+ public long ByteCount { get; init; }
+ }
+}
\ No newline at end of file
diff --git a/backend/Services/QueueItemProcessor.cs b/backend/Services/QueueItemProcessor.cs
new file mode 100644
index 00000000..8e911f85
--- /dev/null
+++ b/backend/Services/QueueItemProcessor.cs
@@ -0,0 +1,197 @@
+using System.Text;
+using Microsoft.EntityFrameworkCore;
+using NzbWebDAV.Clients;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Extensions;
+using NzbWebDAV.Services.FileAggregators;
+using NzbWebDAV.Services.FileProcessors;
+using NzbWebDAV.Services.Validators;
+using NzbWebDAV.Utils;
+using Serilog;
+using Usenet.Nzb;
+
+namespace NzbWebDAV.Services;
+
+public class QueueItemProcessor(
+ QueueItem queueItem,
+ DavDatabaseClient dbClient,
+ UsenetStreamingClient usenetClient,
+ IProgress<int> progress,
+ CancellationToken ct
+)
+{
+ public async Task ProcessAsync()
+ {
+ // initialize
+ var startTime = DateTime.Now;
+
+ // process the job
+ try
+ {
+ await ProcessQueueItemAsync(startTime);
+ }
+
+ // when non-retryable errors are encountered
+ // we must still remove the queue-item and add
+ // it to the history as a failed job.
+ catch (Exception e) when (e.IsNonRetryableDownloadException())
+ {
+ try
+ {
+ await MarkQueueItemCompleted(startTime, error: e.Message);
+ }
+ catch (Exception ex)
+ {
+ Log.Error(e, ex.Message);
+ }
+ }
+
+ // when an unknown error is encountered
+ // let's not remove the item from the queue
+ // to give it a chance to retry. Simply
+ // log the error and retry in a minute.
+ catch (Exception e)
+ {
+ try
+ {
+ Log.Error($"Failed to process job, `{queueItem.JobName}` -- {e.Message} -- {e}");
+ dbClient.Ctx.ChangeTracker.Clear();
+ queueItem.PauseUntil = DateTime.Now.AddMinutes(1);
+ dbClient.Ctx.QueueItems.Attach(queueItem);
+ dbClient.Ctx.Entry(queueItem).Property(x => x.PauseUntil).IsModified = true;
+ await dbClient.Ctx.SaveChangesAsync();
+ }
+ catch (Exception ex)
+ {
+ Log.Error(ex, ex.Message);
+ }
+ }
+ }
+
+ private async Task ProcessQueueItemAsync(DateTime startTime)
+ {
+ // This NZB is already processed and mounted
+ if (await IsAlreadyDownloaded())
+ {
+ Log.Information($"Nzb `{queueItem.JobName}` is a duplicate. Skipping and marking complete.");
+ await MarkQueueItemCompleted(startTime);
+ return;
+ }
+
+ // read the nzb document
+ var documentBytes = Encoding.UTF8.GetBytes(queueItem.NzbContents);
+ using var stream = new MemoryStream(documentBytes);
+ var nzb = await NzbDocument.LoadAsync(stream);
+
+ // start the file processing tasks
+ var fileProcessingTasks = nzb.Files
+ .DistinctBy(x => x.GetSubjectFileName())
+ .Select(GetFileProcessor)
+ .Where(x => x is not null)
+ .Select(x => x!.ProcessAsync())
+ .ToList();
+
+ // wait for all file processing tasks to finish
+ var fileProcessingResults = await TaskUtil.WhenAllOrError(fileProcessingTasks, progress);
+
+ // update the database
+ await MarkQueueItemCompleted(startTime, error: null, () =>
+ {
+ var categoryFolder = GetOrCreateCategoryFolder();
+ var mountFolder = CreateMountFolder(categoryFolder);
+ new RarAggregator(dbClient, mountFolder).UpdateDatabase(fileProcessingResults);
+ new FileAggregator(dbClient, mountFolder).UpdateDatabase(fileProcessingResults);
+
+ // validate video files found
+ new EnsureImportableVideoValidator(dbClient).ThrowIfValidationFails();
+ });
+ }
+
+ private BaseProcessor? GetFileProcessor(NzbFile nzbFile)
+ {
+ return RarProcessor.CanProcess(nzbFile) ? new RarProcessor(nzbFile, usenetClient, ct)
+ : FileProcessor.CanProcess(nzbFile) ? new FileProcessor(nzbFile, usenetClient, ct)
+ : null;
+ }
+
+ private async Task<bool> IsAlreadyDownloaded()
+ {
+ var query = from mountFolder in dbClient.Ctx.Items
+ join categoryFolder in dbClient.Ctx.Items on mountFolder.ParentId equals categoryFolder.Id
+ where mountFolder.Name == queueItem.JobName
+ && mountFolder.ParentId != null
+ && categoryFolder.Name == queueItem.Category
+ && categoryFolder.ParentId == DavItem.ContentFolder.Id
+ select mountFolder;
+
+ return await query.AnyAsync();
+ }
+
+ private DavItem GetOrCreateCategoryFolder()
+ {
+ // if the category item already exists, return it
+ var categoryFolder = dbClient.Ctx.Items
+ .FirstOrDefault(x => x.Parent == DavItem.ContentFolder && x.Name == queueItem.Category);
+ if (categoryFolder is not null)
+ return categoryFolder;
+
+ // otherwise, create it
+ categoryFolder = new DavItem()
+ {
+ Id = Guid.NewGuid(),
+ CreatedAt = DateTime.Now,
+ ParentId = DavItem.ContentFolder.Id,
+ Name = queueItem.Category,
+ Type = DavItem.ItemType.Directory,
+ };
+ dbClient.Ctx.Items.Add(categoryFolder);
+ return categoryFolder;
+ }
+
+ private DavItem CreateMountFolder(DavItem categoryFolder)
+ {
+ var mountFolder = new DavItem()
+ {
+ Id = Guid.NewGuid(),
+ CreatedAt = DateTime.Now,
+ ParentId = categoryFolder.Id,
+ Name = queueItem.JobName,
+ Type = DavItem.ItemType.Directory,
+ };
+ dbClient.Ctx.Items.Add(mountFolder);
+ return mountFolder;
+ }
+
+ private HistoryItem CreateHistoryItem(DateTime jobStartTime, string? errorMessage = null)
+ {
+ return new HistoryItem()
+ {
+ Id = queueItem.Id,
+ CreatedAt = DateTime.Now,
+ FileName = queueItem.FileName,
+ JobName = queueItem.JobName,
+ Category = queueItem.Category,
+ DownloadStatus = errorMessage == null
+ ? HistoryItem.DownloadStatusOption.Completed
+ : HistoryItem.DownloadStatusOption.Failed,
+ TotalSegmentBytes = queueItem.TotalSegmentBytes,
+ DownloadTimeSeconds = (int)(DateTime.Now - jobStartTime).TotalSeconds,
+ FailMessage = errorMessage
+ };
+ }
+
+ private async Task MarkQueueItemCompleted
+ (
+ DateTime startTime,
+ string? error = null,
+ Action? databaseOperations = null
+ )
+ {
+ dbClient.Ctx.ChangeTracker.Clear();
+ databaseOperations?.Invoke();
+ dbClient.Ctx.QueueItems.Remove(queueItem);
+ dbClient.Ctx.HistoryItems.Add(CreateHistoryItem(startTime, error));
+ await dbClient.Ctx.SaveChangesAsync(ct);
+ }
+}
\ No newline at end of file
diff --git a/backend/Services/QueueManager.cs b/backend/Services/QueueManager.cs
new file mode 100644
index 00000000..42b19500
--- /dev/null
+++ b/backend/Services/QueueManager.cs
@@ -0,0 +1,144 @@
+using NzbWebDAV.Clients;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using Serilog;
+
+namespace NzbWebDAV.Services;
+
+public class QueueManager : IDisposable
+{
+ private InProgressQueueItem? _inProgressQueueItem;
+
+ private readonly UsenetStreamingClient _usenetClient;
+ private readonly CancellationTokenSource? _cancellationTokenSource;
+ private readonly SemaphoreSlim _semaphore = new(1, 1);
+
+ public QueueManager(UsenetStreamingClient usenetClient)
+ {
+ _usenetClient = usenetClient;
+ _cancellationTokenSource = new CancellationTokenSource();
+ _ = ProcessQueueAsync(_cancellationTokenSource.Token);
+ }
+
+ public (QueueItem? queueItem, int? progress) GetInProgressQueueItem()
+ {
+ return (_inProgressQueueItem?.QueueItem, _inProgressQueueItem?.ProgressPercentage);
+ }
+
+ public async Task RemoveQueueItemAsync(string queueItemId, DavDatabaseClient dbClient)
+ {
+ await LockAsync(async () =>
+ {
+ if (_inProgressQueueItem?.QueueItem?.Id.ToString() == queueItemId)
+ {
+ await _inProgressQueueItem.CancellationTokenSource.CancelAsync();
+ await _inProgressQueueItem.ProcessingTask;
+ }
+
+ await dbClient.RemoveQueueItemAsync(queueItemId);
+ });
+ }
+
+ private async Task ProcessQueueAsync(CancellationToken ct)
+ {
+ while (!ct.IsCancellationRequested)
+ {
+ try
+ {
+ // get the next queue-item from the database
+ await using var dbContext = new DavDatabaseContext();
+ var dbClient = new DavDatabaseClient(dbContext);
+ var queueItem = await dbClient.GetTopQueueItem(ct);
+ if (queueItem is null)
+ {
+ // if we're done with the queue, wait
+ // five seconds before checking again.
+ await Task.Delay(TimeSpan.FromSeconds(5), ct);
+ continue;
+ }
+
+ // process the queue-item
+ using var queueItemCancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(ct);
+ await LockAsync(() =>
+ {
+ _inProgressQueueItem = BeginProcessingQueueItem(
+ dbClient, queueItem, queueItemCancellationTokenSource
+ );
+ });
+ await (_inProgressQueueItem?.ProcessingTask ?? Task.CompletedTask);
+ await LockAsync(() => { _inProgressQueueItem = null; });
+ }
+ catch (OperationCanceledException)
+ {
+ // When the DeleteQueueItemAsync is called and the queue-item is currently
+ // being processed, we explicitly cancel the processing of the queue-item.
+ // Since this is expected API behavior, we can ignore this exception.
+ }
+ catch (Exception e)
+ {
+ Log.Error($"An unexpected error occured while processing the queue: {e.Message}");
+ }
+ }
+ }
+
+ private InProgressQueueItem BeginProcessingQueueItem
+ (
+ DavDatabaseClient dbClient,
+ QueueItem queueItem,
+ CancellationTokenSource cts
+ )
+ {
+ var progressHook = new Progress<int>();
+ var task = new QueueItemProcessor(queueItem, dbClient, _usenetClient, progressHook, cts.Token).ProcessAsync();
+ var inProgressQueueItem = new InProgressQueueItem()
+ {
+ QueueItem = queueItem,
+ ProcessingTask = task,
+ ProgressPercentage = 0,
+ CancellationTokenSource = cts
+ };
+ progressHook.ProgressChanged += (_, progress) =>
+ inProgressQueueItem.ProgressPercentage = progress;
+ return inProgressQueueItem;
+ }
+
+ private async Task LockAsync(Func<Task> actionAsync)
+ {
+ await _semaphore.WaitAsync();
+ try
+ {
+ await actionAsync();
+ }
+ finally
+ {
+ _semaphore.Release();
+ }
+ }
+
+ private async Task LockAsync(Action action)
+ {
+ await _semaphore.WaitAsync();
+ try
+ {
+ action();
+ }
+ finally
+ {
+ _semaphore.Release();
+ }
+ }
+
+ public void Dispose()
+ {
+ _cancellationTokenSource?.Cancel();
+ _cancellationTokenSource?.Dispose();
+ }
+
+ private class InProgressQueueItem
+ {
+ public QueueItem QueueItem { get; init; }
+ public int ProgressPercentage { get; set; }
+ public Task ProcessingTask { get; init; }
+ public CancellationTokenSource CancellationTokenSource { get; init; }
+ }
+}
\ No newline at end of file
diff --git a/backend/Services/Validators/EnsureImportableVideoValidator.cs b/backend/Services/Validators/EnsureImportableVideoValidator.cs
new file mode 100644
index 00000000..27fc7b08
--- /dev/null
+++ b/backend/Services/Validators/EnsureImportableVideoValidator.cs
@@ -0,0 +1,35 @@
+using Microsoft.EntityFrameworkCore;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Exceptions;
+
+namespace NzbWebDAV.Services.Validators;
+
+public class EnsureImportableVideoValidator(DavDatabaseClient dbClient)
+{
+ private static readonly HashSet<string> VideoExtensions =
+ [
+ ".webm", ".m4v", ".3gp", ".nsv", ".ty", ".strm", ".rm", ".rmvb", ".m3u", ".ifo", ".mov", ".qt", ".divx",
+ ".xvid", ".bivx", ".nrg", ".pva", ".wmv", ".asf", ".asx", ".ogm", ".ogv", ".m2v", ".avi", ".bin", ".dat",
+ ".dvr-ms", ".mpg", ".mpeg", ".mp4", ".avc", ".vp3", ".svq3", ".nuv", ".viv", ".dv", ".fli", ".flv", ".wpl",
+ ".img", ".iso", ".vob", ".mkv", ".mk3d", ".ts", ".wtv", ".m2ts"
+ ];
+
+ public void ThrowIfValidationFails()
+ {
+ if (!IsValid())
+ {
+ throw new NoVideoFilesFoundException("No importable videos found.");
+ }
+ }
+
+ private bool IsValid()
+ {
+ return dbClient.Ctx.ChangeTracker.Entries<DavItem>()
+ .Where(x => x.State == EntityState.Added)
+ .Select(x => x.Entity)
+ .Where(x => x.Type != DavItem.ItemType.Directory)
+ .Select(x => Path.GetExtension(x.Name).ToLower())
+ .Any(x => VideoExtensions.Contains(x));
+ }
+}
\ No newline at end of file
diff --git a/backend/Streams/BufferToEndStream.cs b/backend/Streams/BufferToEndStream.cs
new file mode 100644
index 00000000..5b74de98
--- /dev/null
+++ b/backend/Streams/BufferToEndStream.cs
@@ -0,0 +1,240 @@
+using System.Buffers;
+using System.IO.Pipelines;
+using System.Runtime.ExceptionServices;
+
+namespace NzbWebDAV.Streams;
+
+/// <summary>
+/// Wraps a readable <see cref="Stream"/>.
+/// • As soon as it is constructed it begins copying every byte
+/// from <paramref name="sourceStream"/> into memory.
+/// • Callers can read while the copy is in progress, but even if
+/// they never read (or dispose early) the copy continues in the
+/// background
+/// • Drains the source to EOF, then disposes it.
+/// • Dispose / DisposeAsync are non-blocking; they simply mark the public
+/// wrapper dead and release any waiting readers.
+/// • Note: This class was entirely authored by ChatGPT o3
+/// </summary>
+public sealed class BufferToEndStream : Stream
+{
+ // ─────────────────────────────────── configuration
+ private readonly int _segmentSize;
+
+ // ─────────────────────────────────── pipeline & pump
+ private readonly Pipe _pipe;
+ private readonly Task _pumpTask;
+
+ // ─────────────────────────────────── coordination primitives
+ private readonly CancellationTokenSource _localCts = new();
+ private readonly SemaphoreSlim _readLock = new(1, 1);
+
+ private volatile Exception? _backgroundError;
+ private volatile bool _publiclyDisposed;
+ private int _coreDisposed; // 0 ⇒ alive, 1 ⇒ core cleaned up
+
+ // ─────────────────────────────────── constructor
+ public BufferToEndStream(
+ Stream sourceStream,
+ int minimumSegmentSize = 1024,
+ long pauseWriterThreshold = long.MaxValue,
+ long resumeWriterThreshold = long.MaxValue - 1)
+ {
+ if (sourceStream is null) throw new ArgumentNullException(nameof(sourceStream));
+ if (!sourceStream.CanRead) throw new ArgumentException("Stream must be readable.", nameof(sourceStream));
+
+ _segmentSize = Math.Max(256, minimumSegmentSize);
+
+ _pipe = new Pipe(new PipeOptions(
+ pool: null, // default pool
+ readerScheduler: PipeScheduler.ThreadPool,
+ writerScheduler: PipeScheduler.ThreadPool,
+ pauseWriterThreshold: pauseWriterThreshold,
+ resumeWriterThreshold: resumeWriterThreshold,
+ minimumSegmentSize: _segmentSize,
+ useSynchronizationContext: false));
+
+ _pumpTask = Task.Run(() => PumpAsync(sourceStream), CancellationToken.None);
+ }
+
+ // ─────────────────────────────────── background producer
+ private async Task PumpAsync(Stream source)
+ {
+ byte[] scratch = ArrayPool<byte>.Shared.Rent(_segmentSize);
+
+ try
+ {
+ while (true)
+ {
+ int read = await source.ReadAsync(scratch, 0, scratch.Length).ConfigureAwait(false);
+ if (read == 0) break; // EOF
+
+ if (!_publiclyDisposed) // normal mode: write to Pipe
+ {
+ await _pipe.Writer.WriteAsync(
+ scratch.AsMemory(0, read),
+ CancellationToken.None).ConfigureAwait(false);
+ }
+ // else: wrapper already disposed → just discard into 'scratch'
+ }
+
+ _pipe.Writer.Complete(); // clean completion
+ }
+ catch (Exception ex) when (ex is not OperationCanceledException)
+ {
+ _backgroundError = ex;
+ _pipe.Writer.Complete(ex); // propagate to readers
+ }
+ finally
+ {
+ source.Dispose(); // ALWAYS reached
+ ArrayPool<byte>.Shared.Return(scratch);
+ }
+ }
+
+ // ─────────────────────────────────── core read helper
+ private async ValueTask<int> ReadCoreAsync(
+ Memory<byte> destination,
+ CancellationToken cancellationToken)
+ {
+ ThrowIfCoreDisposed();
+ if (destination.Length == 0) return 0;
+
+ using var linked = CancellationTokenSource
+ .CreateLinkedTokenSource(_localCts.Token, cancellationToken);
+
+ await _readLock.WaitAsync(linked.Token).ConfigureAwait(false);
+ try
+ {
+ while (true)
+ {
+ ReadResult result = await _pipe.Reader
+ .ReadAsync(linked.Token)
+ .ConfigureAwait(false);
+ var buffer = result.Buffer;
+
+ if (!buffer.IsEmpty)
+ {
+ int n = (int)Math.Min(buffer.Length, destination.Length);
+ buffer.Slice(0, n).CopyTo(destination.Span);
+ _pipe.Reader.AdvanceTo(buffer.GetPosition(n));
+ return n;
+ }
+
+ if (result.IsCompleted)
+ {
+ _pipe.Reader.AdvanceTo(buffer.End);
+
+ if (_backgroundError is not null)
+ ExceptionDispatchInfo.Capture(_backgroundError).Throw();
+
+ return 0; // true EOF
+ }
+
+ _pipe.Reader.AdvanceTo(buffer.Start, buffer.End); // nothing yet → loop
+ }
+ }
+ finally
+ {
+ _readLock.Release();
+ }
+ }
+
+ // ─────────────────────────────────── Stream overrides
+ public override int Read(Span<byte> buffer)
+ {
+ // simple sync path – allocate once then copy
+ byte[] tmp = ArrayPool<byte>.Shared.Rent(buffer.Length);
+ try
+ {
+ int read = ReadCoreAsync(tmp.AsMemory(0, buffer.Length), CancellationToken.None)
+ .AsTask().GetAwaiter().GetResult();
+ tmp.AsSpan(0, read).CopyTo(buffer);
+ return read;
+ }
+ finally
+ {
+ ArrayPool<byte>.Shared.Return(tmp);
+ }
+ }
+
+ public override int Read(byte[] array, int offset, int count) =>
+ Read(array.AsSpan(offset, count));
+
+ public override ValueTask<int> ReadAsync(
+ Memory<byte> buffer,
+ CancellationToken cancellationToken = default) =>
+ ReadCoreAsync(buffer, cancellationToken);
+
+ public override Task<int> ReadAsync(
+ byte[] array, int offset, int count, CancellationToken cancellationToken) =>
+ ReadCoreAsync(array.AsMemory(offset, count), cancellationToken).AsTask();
+
+ // ─────────────────────────────────── Dispose pattern
+ protected override void Dispose(bool disposing)
+ {
+ if (Interlocked.Exchange(ref _coreDisposed, 1) == 1) return;
+
+ if (disposing)
+ {
+ _publiclyDisposed = true; // pump switches to discard mode
+ _localCts.Cancel(); // cancel any waiting readers
+ _readLock.Dispose(); // forbid further reads
+
+ try { _pipe.Reader.Complete(); } // maybe already done – ignore
+ catch (InvalidOperationException) { }
+ }
+
+ base.Dispose(disposing); // returns immediately
+ }
+
+ public override async ValueTask DisposeAsync()
+ {
+ if (Interlocked.Exchange(ref _coreDisposed, 1) == 1) return;
+
+ _publiclyDisposed = true;
+ _localCts.Cancel();
+ _readLock.Dispose();
+
+ try { _pipe.Reader.Complete(); }
+ catch (InvalidOperationException) { }
+
+ await base.DisposeAsync().ConfigureAwait(false); // still non-blocking
+ }
+
+ // ─────────────────────────────────── plumbing
+ public override bool CanRead => _coreDisposed == 0;
+ public override bool CanSeek => false;
+ public override bool CanWrite => false;
+
+ public override long Length => throw new NotSupportedException();
+ public override long Position
+ {
+ get => throw new NotSupportedException();
+ set => throw new NotSupportedException();
+ }
+
+ public override void Flush() =>
+ throw new NotSupportedException();
+ public override Task FlushAsync(CancellationToken _) =>
+ throw new NotSupportedException();
+
+ public override long Seek(long _, SeekOrigin __) =>
+ throw new NotSupportedException();
+ public override void SetLength(long _) =>
+ throw new NotSupportedException();
+
+ public override void Write(byte[] _, int __, int ___) =>
+ throw new NotSupportedException();
+ public override void Write(ReadOnlySpan<byte> _) =>
+ throw new NotSupportedException();
+ public override ValueTask WriteAsync(ReadOnlyMemory<byte> _, CancellationToken __ = default) =>
+ throw new NotSupportedException();
+
+ // ─────────────────────────────────── helpers
+ private void ThrowIfCoreDisposed()
+ {
+ if (_coreDisposed != 0)
+ throw new ObjectDisposedException(nameof(BufferToEndStream));
+ }
+}
diff --git a/backend/Streams/CombinedStream.cs b/backend/Streams/CombinedStream.cs
new file mode 100644
index 00000000..5a3973e9
--- /dev/null
+++ b/backend/Streams/CombinedStream.cs
@@ -0,0 +1,110 @@
+namespace NzbWebDAV.Streams;
+
+public class CombinedStream(IEnumerable<Task<Stream>> streams) : Stream
+{
+ private readonly IEnumerator<Task<Stream>> _streams = streams.GetEnumerator();
+ private Stream? _currentStream;
+ private long _position;
+ private bool _isDisposed;
+
+ public override bool CanRead => true;
+ public override bool CanSeek => false;
+ public override bool CanWrite => false;
+ public override long Length => throw new NotSupportedException();
+
+ public override long Position
+ {
+ get => _position;
+ set => throw new NotSupportedException();
+ }
+
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ return ReadAsync(buffer, offset, count).GetAwaiter().GetResult();
+ }
+
+ public override async Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+ {
+ if (count == 0) return 0;
+ while (!cancellationToken.IsCancellationRequested)
+ {
+ // If we haven't read the first stream, read it.
+ if (_currentStream == null)
+ {
+ if (!_streams.MoveNext()) return 0;
+ _currentStream = await _streams.Current;
+ }
+
+ // read from our current stream
+ var readCount = await _currentStream.ReadAsync
+ (
+ buffer.AsMemory(offset, count),
+ cancellationToken
+ );
+ _position += readCount;
+ if (readCount > 0) return readCount;
+
+ // If we couldn't read anything from our current stream,
+ // it's time to advance to the next stream.
+ await _currentStream.DisposeAsync();
+ if (!_streams.MoveNext()) return 0;
+ _currentStream = await _streams.Current;
+ }
+
+ return 0;
+ }
+
+ public async Task DiscardBytesAsync(long count)
+ {
+ if (count == 0) return;
+ var remaining = count;
+ var throwaway = new byte[1024];
+ while (remaining > 0)
+ {
+ var toRead = (int)Math.Min(remaining, throwaway.Length);
+ var read = await ReadAsync(throwaway, 0, toRead);
+ remaining -= read;
+ if (read == 0) break;
+ }
+
+ _position += count;
+ }
+
+ public override void Flush()
+ {
+ throw new NotSupportedException();
+ }
+
+ public override long Seek(long offset, SeekOrigin origin)
+ {
+ throw new NotSupportedException();
+ }
+
+ public override void SetLength(long value)
+ {
+ throw new NotSupportedException();
+ }
+
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ throw new NotSupportedException();
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (_isDisposed) return;
+ if (!disposing) return;
+ _streams.Dispose();
+ _currentStream?.Dispose();
+ _isDisposed = true;
+ }
+
+ public override async ValueTask DisposeAsync()
+ {
+ if (_isDisposed) return;
+ if (_currentStream != null) await _currentStream.DisposeAsync();
+ _streams.Dispose();
+ _isDisposed = true;
+ GC.SuppressFinalize(this);
+ }
+}
\ No newline at end of file
diff --git a/backend/Streams/DisposableCallbackStream.cs b/backend/Streams/DisposableCallbackStream.cs
new file mode 100644
index 00000000..03fcf9bf
--- /dev/null
+++ b/backend/Streams/DisposableCallbackStream.cs
@@ -0,0 +1,92 @@
+namespace NzbWebDAV.Streams;
+
+/// <summary>
+/// A wrapper stream that delegates all operations to an inner stream and
+/// invokes optional callbacks when the stream is disposed synchronously or asynchronously.
+///
+/// Use this class to hook into the disposal lifecycle of a stream without modifying its implementation.
+/// </summary>
+public class DisposableCallbackStream : Stream
+{
+ private readonly Stream _inner;
+ private readonly Action? _onDispose;
+ private readonly Func<ValueTask>? _onDisposeAsync;
+ private bool _disposed;
+
+ // ReSharper disable once ConvertToPrimaryConstructor
+ public DisposableCallbackStream(Stream inner, Action? onDispose = null, Func<ValueTask>? onDisposeAsync = null)
+ {
+ _inner = inner ?? throw new ArgumentNullException(nameof(inner));
+ _onDispose = onDispose;
+ _onDisposeAsync = onDisposeAsync;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (_disposed) return;
+
+ if (disposing)
+ {
+ _inner.Dispose();
+ _onDispose?.Invoke();
+ }
+
+ _disposed = true;
+ base.Dispose(disposing);
+ }
+
+ public override async ValueTask DisposeAsync()
+ {
+ if (_disposed) return;
+
+ await _inner.DisposeAsync();
+
+ if (_onDisposeAsync != null)
+ await _onDisposeAsync();
+ else
+ _onDispose?.Invoke();
+
+ _disposed = true;
+ await base.DisposeAsync();
+ }
+
+ // Core stream overrides
+ public override bool CanRead => _inner.CanRead;
+ public override bool CanSeek => _inner.CanSeek;
+ public override bool CanWrite => _inner.CanWrite;
+ public override long Length => _inner.Length;
+
+ public override long Position
+ {
+ get => _inner.Position;
+ set => _inner.Position = value;
+ }
+
+ public override void Flush() => _inner.Flush();
+ public override Task FlushAsync(CancellationToken cancellationToken) => _inner.FlushAsync(cancellationToken);
+
+ public override long Seek(long offset, SeekOrigin origin) => _inner.Seek(offset, origin);
+ public override void SetLength(long value) => _inner.SetLength(value);
+
+ // Read/Write (sync)
+ public override int Read(byte[] buffer, int offset, int count) => _inner.Read(buffer, offset, count);
+ public override void Write(byte[] buffer, int offset, int count) => _inner.Write(buffer, offset, count);
+
+ // Read/Write (async)
+ public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+ => _inner.ReadAsync(buffer, offset, count, cancellationToken);
+
+ public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+ => _inner.WriteAsync(buffer, offset, count, cancellationToken);
+
+ // Modern Span/Memory overloads
+ public override int Read(Span<byte> buffer) => _inner.Read(buffer);
+
+ public override ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
+ => _inner.ReadAsync(buffer, cancellationToken);
+
+ public override void Write(ReadOnlySpan<byte> buffer) => _inner.Write(buffer);
+
+ public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken = default)
+ => _inner.WriteAsync(buffer, cancellationToken);
+}
\ No newline at end of file
diff --git a/backend/Streams/LimitedLengthStream.cs b/backend/Streams/LimitedLengthStream.cs
new file mode 100644
index 00000000..576d5467
--- /dev/null
+++ b/backend/Streams/LimitedLengthStream.cs
@@ -0,0 +1,66 @@
+namespace NzbWebDAV.Streams;
+
+public class LimitedLengthStream(Stream stream, long length) : Stream
+{
+ private bool _disposed;
+ private long _position = 0;
+
+ public override void Flush() => stream.Flush();
+
+ public override int Read(byte[] buffer, int offset, int count) =>
+ ReadAsync(buffer, offset, count, CancellationToken.None).GetAwaiter().GetResult();
+
+ public override async Task<int>
+ ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
+ await ReadAsync(buffer.AsMemory(offset, count), cancellationToken);
+
+ public override async ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
+ {
+ // If we've already read the specified length, return 0 (end of stream)
+ if (_position >= length)
+ return 0;
+
+ // Calculate how many bytes we can still read
+ var remainingBytes = (int)(length - _position);
+ var bytesToRead = Math.Min(remainingBytes, buffer.Length);
+
+ // Read from the underlying stream
+ var bytesRead = await stream.ReadAsync(buffer[..bytesToRead], cancellationToken);
+
+ // Update the position by the number of bytes read
+ _position += bytesRead;
+
+ // Return the number of bytes read
+ return bytesRead;
+ }
+
+ public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException();
+ public override void SetLength(long value) => throw new NotSupportedException();
+ public override void Write(byte[] buffer, int offset, int count) => stream.Write(buffer, offset, count);
+
+ public override bool CanRead => stream.CanRead;
+ public override bool CanSeek => false;
+ public override bool CanWrite => false;
+ public override long Length => length;
+
+ public override long Position
+ {
+ get => stream.Position;
+ set => throw new NotSupportedException();
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (_disposed) return;
+ stream.Dispose();
+ _disposed = true;
+ }
+
+ public override async ValueTask DisposeAsync()
+ {
+ if (_disposed) return;
+ await stream.DisposeAsync();
+ _disposed = true;
+ GC.SuppressFinalize(this);
+ }
+}
\ No newline at end of file
diff --git a/backend/Streams/NzbFileStream.cs b/backend/Streams/NzbFileStream.cs
new file mode 100644
index 00000000..404c39d3
--- /dev/null
+++ b/backend/Streams/NzbFileStream.cs
@@ -0,0 +1,159 @@
+using NzbWebDAV.Clients;
+using NzbWebDAV.Extensions;
+using NzbWebDAV.Utils;
+using Usenet.Nzb;
+using Usenet.Yenc;
+
+namespace NzbWebDAV.Streams;
+
+public class NzbFileStream(
+ string[] fileSegmentIds,
+ long fileSize,
+ INntpClient client,
+ int concurrentConnections
+) : Stream
+{
+ private long _position = 0;
+ private YencHeaderStream? _firstSegmentStream;
+ private CombinedStream? _innerStream;
+ private bool _disposed;
+
+ public YencHeader? FirstYencHeader => _firstSegmentStream?.Header;
+
+ public NzbFileStream
+ (
+ NzbFile file,
+ long fileSize,
+ INntpClient client,
+ int concurrentConnections
+ ) : this(file.GetOrderedSegmentIds(), fileSize, client, concurrentConnections)
+ {
+ }
+
+
+ public NzbFileStream
+ (
+ NzbFile file,
+ YencHeaderStream firstSegmentStream,
+ INntpClient client,
+ int concurrentConnections
+ ) : this(file.GetOrderedSegmentIds(), firstSegmentStream.Header.FileSize, client, concurrentConnections)
+ {
+ _firstSegmentStream = firstSegmentStream;
+ }
+
+ public override void Flush()
+ {
+ _innerStream?.Flush();
+ }
+
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ return ReadAsync(buffer, offset, count).GetAwaiter().GetResult();
+ }
+
+ public override async Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+ {
+ if (_innerStream == null) _innerStream = await GetFileStream(_position, cancellationToken);
+ var read = await _innerStream.ReadAsync(buffer, offset, count, cancellationToken);
+ _position += read;
+ return read;
+ }
+
+ public override long Seek(long offset, SeekOrigin origin)
+ {
+ var absoluteOffset = origin == SeekOrigin.Begin ? offset
+ : origin == SeekOrigin.Current ? _position + offset
+ : throw new InvalidOperationException("SeekOrigin must be Begin or Current.");
+ if (_position == absoluteOffset) return _position;
+ _position = absoluteOffset;
+ _innerStream?.Dispose();
+ _innerStream = null;
+ _firstSegmentStream?.Dispose();
+ _firstSegmentStream = null;
+ return _position;
+ }
+
+ public override void SetLength(long value)
+ {
+ throw new InvalidOperationException();
+ }
+
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ throw new InvalidOperationException();
+ }
+
+ public override bool CanRead => true;
+ public override bool CanSeek => true;
+ public override bool CanWrite => false;
+ public override long Length => fileSize;
+
+ public override long Position
+ {
+ get => _position;
+ set => Seek(value, SeekOrigin.Begin);
+ }
+
+
+ private async Task<(int segmentIndex, YencHeader header)> SeekSegment(long byteOffset,
+ CancellationToken cancellationToken)
+ {
+ YencHeader? header = null;
+ var segmentIndex = await InterpolationSearch.Find(0, fileSegmentIds.Length,
+ async guess =>
+ {
+ header = await client.GetSegmentYencHeaderAsync(fileSegmentIds[guess], cancellationToken);
+ if (header.PartOffset <= byteOffset && byteOffset < header.PartOffset + header.PartSize)
+ return null;
+ return byteOffset / (header.PartOffset + header.PartSize / 2.0d);
+ }
+ );
+ return (segmentIndex, header!);
+ }
+
+ private async Task<CombinedStream> GetFileStream(long rangeStart, CancellationToken cancellationToken)
+ {
+ if (rangeStart == 0) return GetCombinedStream(0, cancellationToken);
+ var (firstSegmentIndex, header) = await SeekSegment(rangeStart, cancellationToken);
+ var stream = GetCombinedStream(firstSegmentIndex, cancellationToken);
+ await stream.DiscardBytesAsync(rangeStart - header.PartOffset);
+ return stream;
+ }
+
+ private CombinedStream GetCombinedStream(int firstSegmentIndex, CancellationToken ct)
+ {
+ if (firstSegmentIndex == 0 && _firstSegmentStream != null)
+ {
+ return new CombinedStream(
+ fileSegmentIds[1..]
+ .Select(async x => (Stream)await client.GetSegmentStreamAsync(x, ct))
+ .Prepend(Task.FromResult<Stream>(_firstSegmentStream))
+ .WithConcurrency(concurrentConnections)
+ );
+ }
+
+ return new CombinedStream(
+ fileSegmentIds[firstSegmentIndex..]
+ .Select(async x => (Stream)await client.GetSegmentStreamAsync(x, ct))
+ .WithConcurrency(concurrentConnections)
+ );
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (_disposed) return;
+ _innerStream?.Dispose();
+ _firstSegmentStream?.Dispose();
+ _disposed = true;
+ }
+
+ public override async ValueTask DisposeAsync()
+ {
+ if (_disposed) return;
+ if (_innerStream != null) await _innerStream.DisposeAsync();
+ if (_firstSegmentStream != null) await _firstSegmentStream.DisposeAsync();
+ _disposed = true;
+ GC.SuppressFinalize(this);
+ }
+}
\ No newline at end of file
diff --git a/backend/Streams/ProbingStream.cs b/backend/Streams/ProbingStream.cs
new file mode 100644
index 00000000..f6c49a53
--- /dev/null
+++ b/backend/Streams/ProbingStream.cs
@@ -0,0 +1,132 @@
+namespace NzbWebDAV.Streams;
+
+/// <summary>
+/// This class wraps an underlying stream and exposes a method to
+/// probe whether the stream is empty or not, without changing the
+/// position of the stream. It does this by reading a single byte
+/// and buffering it in memory to relay during future Read requests.
+/// </summary>
+/// <param name="stream">The underlying stream to probe.</param>
+public class ProbingStream(Stream stream) : Stream
+{
+ private bool? _isEmpty;
+ private byte? _probeByte;
+ private bool _disposed;
+
+ public async Task<bool> IsEmptyAsync()
+ {
+ if (_isEmpty.HasValue)
+ return _isEmpty.Value;
+
+ var buffer = new byte[1];
+ var bytesRead = await stream.ReadAsync(buffer.AsMemory(0, 1));
+
+ if (bytesRead == 0)
+ {
+ _isEmpty = true;
+ }
+ else
+ {
+ _isEmpty = false;
+ _probeByte = buffer[0];
+ }
+
+ return _isEmpty.Value;
+ }
+
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ if (!_isEmpty.HasValue)
+ {
+ var read = stream.Read(buffer, offset, count);
+ _isEmpty = read == 0;
+ return read;
+ }
+
+ if (_probeByte.HasValue)
+ {
+ buffer[offset] = _probeByte.Value;
+ _probeByte = null;
+ var read = stream.Read(buffer, offset + 1, count - 1);
+ return 1 + read;
+ }
+
+ return stream.Read(buffer, offset, count);
+ }
+
+ public override async Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+ {
+ if (!_isEmpty.HasValue)
+ {
+ var read = await stream.ReadAsync(buffer.AsMemory(offset, count), cancellationToken);
+ _isEmpty = read == 0;
+ return read;
+ }
+
+ if (_probeByte.HasValue)
+ {
+ buffer[offset] = _probeByte.Value;
+ _probeByte = null;
+ var read = await stream.ReadAsync(buffer.AsMemory(offset + 1, count - 1), cancellationToken);
+ return 1 + read;
+ }
+
+ return await stream.ReadAsync(buffer, offset, count, cancellationToken);
+ }
+
+ public override async ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
+ {
+ if (!_isEmpty.HasValue)
+ {
+ var read = await stream.ReadAsync(buffer, cancellationToken);
+ _isEmpty = read == 0;
+ return read;
+ }
+
+ if (_probeByte.HasValue)
+ {
+ var span = buffer.Span;
+ if (span.Length == 0)
+ return 0;
+
+ span[0] = (byte)_probeByte.Value;
+ _probeByte = null;
+
+ var read = await stream.ReadAsync(buffer[1..], cancellationToken);
+ return 1 + read;
+ }
+
+ return await stream.ReadAsync(buffer, cancellationToken);
+ }
+
+ public override void Flush() => stream.Flush();
+ public override long Seek(long offset, SeekOrigin origin) => stream.Seek(offset, origin);
+ public override void SetLength(long value) => stream.SetLength(value);
+ public override void Write(byte[] buffer, int offset, int count) => stream.Write(buffer, offset, count);
+
+ public override bool CanRead => stream.CanRead;
+ public override bool CanSeek => stream.CanSeek;
+ public override bool CanWrite => stream.CanWrite;
+ public override long Length => stream.Length;
+
+ public override long Position
+ {
+ get => stream.Position;
+ set => stream.Position = value;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (_disposed) return;
+ stream.Dispose();
+ _disposed = true;
+ }
+
+ public override async ValueTask DisposeAsync()
+ {
+ if (_disposed) return;
+ await stream.DisposeAsync();
+ _disposed = true;
+ GC.SuppressFinalize(this);
+ }
+}
\ No newline at end of file
diff --git a/backend/Streams/RarFileStream.cs b/backend/Streams/RarFileStream.cs
new file mode 100644
index 00000000..6e31d396
--- /dev/null
+++ b/backend/Streams/RarFileStream.cs
@@ -0,0 +1,120 @@
+using NzbWebDAV.Clients;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Extensions;
+
+namespace NzbWebDAV.Streams;
+
+public class RarFileStream(
+ DavRarFile.RarPart[] rarParts,
+ UsenetStreamingClient usenet,
+ int concurrentConnections
+) : Stream
+{
+ private long _position = 0;
+ private CombinedStream? _innerStream;
+ private bool _disposed;
+
+
+ public override void Flush()
+ {
+ _innerStream?.Flush();
+ }
+
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ return ReadAsync(buffer, offset, count).GetAwaiter().GetResult();
+ }
+
+ public override async Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+ {
+ if (_innerStream == null) _innerStream = GetFileStream(_position, cancellationToken);
+ var read = await _innerStream.ReadAsync(buffer, offset, count, cancellationToken);
+ _position += read;
+ return read;
+ }
+
+ public override long Seek(long offset, SeekOrigin origin)
+ {
+ var absoluteOffset = origin == SeekOrigin.Begin ? offset
+ : origin == SeekOrigin.Current ? _position + offset
+ : throw new InvalidOperationException("SeekOrigin must be Begin or Current.");
+ if (_position == absoluteOffset) return _position;
+ _position = absoluteOffset;
+ _innerStream?.Dispose();
+ _innerStream = null;
+ return _position;
+ }
+
+ public override void SetLength(long value)
+ {
+ throw new InvalidOperationException();
+ }
+
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ throw new InvalidOperationException();
+ }
+
+ public override bool CanRead => true;
+ public override bool CanSeek => true;
+ public override bool CanWrite => false;
+ public override long Length { get; } = rarParts.Select(x => x.ByteCount).Sum();
+
+ public override long Position
+ {
+ get => _position;
+ set => Seek(value, SeekOrigin.Begin);
+ }
+
+
+ private (int rarPartIndex, long rarPartOffset) SeekRarPart(long byteOffset)
+ {
+ long offset = 0;
+ for (var i = 0; i < rarParts.Length; i++)
+ {
+ var rarPart = rarParts[i];
+ var nextOffset = offset + rarPart.ByteCount;
+ if (byteOffset < nextOffset)
+ return (i, offset);
+ offset = nextOffset;
+ }
+
+ throw new ArgumentOutOfRangeException(nameof(byteOffset));
+ }
+
+ private CombinedStream GetFileStream(long rangeStart, CancellationToken cancellationToken)
+ {
+ if (rangeStart == 0) return GetCombinedStream(0, 0, cancellationToken);
+ var (rarPartIndex, rarPartOffset) = SeekRarPart(rangeStart);
+ var stream = GetCombinedStream(rarPartIndex, rangeStart - rarPartOffset, cancellationToken);
+ return stream;
+ }
+
+ private CombinedStream GetCombinedStream(int firstRarPartIndex, long additionalOffset, CancellationToken ct)
+ {
+ var streams = rarParts[firstRarPartIndex..]
+ .Select((x, i) =>
+ {
+ var offset = (i == 0) ? additionalOffset : 0;
+ var stream = usenet.GetFileStream(x.SegmentIds, x.PartSize, concurrentConnections);
+ stream.Seek(x.Offset + offset, SeekOrigin.Begin);
+ return Task.FromResult(stream.LimitLength(x.ByteCount - offset));
+ });
+ return new CombinedStream(streams);
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (_disposed) return;
+ _innerStream?.Dispose();
+ _disposed = true;
+ }
+
+ public override async ValueTask DisposeAsync()
+ {
+ if (_disposed) return;
+ if (_innerStream != null) await _innerStream.DisposeAsync();
+ _disposed = true;
+ GC.SuppressFinalize(this);
+ }
+}
\ No newline at end of file
diff --git a/backend/Streams/YencHeaderStream.cs b/backend/Streams/YencHeaderStream.cs
new file mode 100644
index 00000000..49d2222f
--- /dev/null
+++ b/backend/Streams/YencHeaderStream.cs
@@ -0,0 +1,48 @@
+using Usenet.Yenc;
+
+namespace NzbWebDAV.Streams;
+
+public class YencHeaderStream(YencHeader header, Stream stream) : Stream
+{
+ public YencHeader Header => header;
+ private bool _disposed;
+
+ public override void Flush() => stream.Flush();
+ public override int Read(byte[] buffer, int offset, int count) => stream.Read(buffer, offset, count);
+
+ public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
+ stream.ReadAsync(buffer, offset, count, cancellationToken);
+
+ public override ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default) =>
+ stream.ReadAsync(buffer, cancellationToken);
+
+ public override long Seek(long offset, SeekOrigin origin) => stream.Seek(offset, origin);
+ public override void SetLength(long value) => stream.SetLength(value);
+ public override void Write(byte[] buffer, int offset, int count) => stream.Write(buffer, offset, count);
+
+ public override bool CanRead => stream.CanRead;
+ public override bool CanSeek => stream.CanSeek;
+ public override bool CanWrite => stream.CanWrite;
+ public override long Length => Header.PartSize;
+
+ public override long Position
+ {
+ get => stream.Position;
+ set => stream.Position = value;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (_disposed) return;
+ stream.Dispose();
+ _disposed = true;
+ }
+
+ public override async ValueTask DisposeAsync()
+ {
+ if (_disposed) return;
+ await stream.DisposeAsync();
+ _disposed = true;
+ GC.SuppressFinalize(this);
+ }
+}
\ No newline at end of file
diff --git a/backend/Utils/EmbeddedResourceUtil.cs b/backend/Utils/EmbeddedResourceUtil.cs
new file mode 100644
index 00000000..ff3fb74e
--- /dev/null
+++ b/backend/Utils/EmbeddedResourceUtil.cs
@@ -0,0 +1,47 @@
+using System.Diagnostics;
+using System.Reflection;
+
+namespace NzbWebDAV.Utils;
+
+public static class EmbeddedResourceUtil
+{
+ public static Stream GetStream(string resourcePath)
+ {
+ var assembly = Assembly.GetCallingAssembly();
+ var fullResourcePath = GetFullResourcePath(resourcePath);
+ return assembly.GetManifestResourceStream(fullResourcePath)!;
+ }
+
+ public static string ReadAllText(string resourcePath)
+ {
+ using var stream = GetStream(resourcePath);
+ using var reader = new StreamReader(stream);
+ return reader.ReadToEnd();
+ }
+
+ public static async Task<string> ReadAllTextAsync(string resourcePath)
+ {
+ await using var stream = GetStream(resourcePath);
+ using var reader = new StreamReader(stream);
+ return await reader.ReadToEndAsync();
+ }
+
+ private static string GetFullResourcePath(string resourcePath)
+ {
+ if (GetAllResourcePaths().Any(x => x == resourcePath))
+ return resourcePath;
+
+ return new StackTrace()
+ .GetFrames()
+ .Select(x => x.GetMethod()!)
+ .Select(x => x.ReflectedType!)
+ .Where(x => !x.FullName!.StartsWith("NzbWebDAV.Utils.EmbeddedResourceUtil"))
+ .First(x => !x.FullName!.StartsWith("System"))
+ .Namespace + "." + resourcePath;
+ }
+
+ public static string[] GetAllResourcePaths()
+ {
+ return Assembly.GetCallingAssembly().GetManifestResourceNames();
+ }
+}
\ No newline at end of file
diff --git a/backend/Utils/EnvironmentUtil.cs b/backend/Utils/EnvironmentUtil.cs
new file mode 100644
index 00000000..e76c93df
--- /dev/null
+++ b/backend/Utils/EnvironmentUtil.cs
@@ -0,0 +1,10 @@
+namespace NzbWebDAV.Utils;
+
+public static class EnvironmentUtil
+{
+ public static string GetVariable(string envVariable)
+ {
+ return Environment.GetEnvironmentVariable(envVariable) ??
+ throw new Exception($"The environment variable `{envVariable}` must be set.");
+ }
+}
\ No newline at end of file
diff --git a/backend/Utils/GuidUtil.cs b/backend/Utils/GuidUtil.cs
new file mode 100644
index 00000000..4574e08a
--- /dev/null
+++ b/backend/Utils/GuidUtil.cs
@@ -0,0 +1,20 @@
+using System.Security.Cryptography;
+
+namespace NzbWebDAV.Utils;
+
+public static class GuidUtil
+{
+ // Generates a guid using a cryptographically secure RNG
+ public static Guid GenerateSecureGuid()
+ {
+ byte[] bytes = new byte[16];
+ RandomNumberGenerator.Fill(bytes);
+
+ // Set version to 4 (random)
+ bytes[7] = (byte)((bytes[7] & 0x0F) | 0x40);
+ // Set variant to RFC 4122
+ bytes[8] = (byte)((bytes[8] & 0x3F) | 0x80);
+
+ return new Guid(bytes);
+ }
+}
\ No newline at end of file
diff --git a/backend/Utils/InterpolationSearch.cs b/backend/Utils/InterpolationSearch.cs
new file mode 100644
index 00000000..134d4bc6
--- /dev/null
+++ b/backend/Utils/InterpolationSearch.cs
@@ -0,0 +1,39 @@
+namespace NzbWebDAV.Utils;
+
+public static class InterpolationSearch
+{
+ public static async Task<int> Find
+ (
+ int startInclusive,
+ int endExclusive,
+ Func<int, Task<double?>> getGuessResult
+ )
+ {
+ var guess = (startInclusive + endExclusive) / 2;
+ return await Find(guess, startInclusive, endExclusive, getGuessResult);
+ }
+
+ private static async Task<int> Find
+ (
+ int guess,
+ int startInclusive,
+ int endExclusive,
+ Func<int, Task<double?>> guessResult
+ )
+ {
+ var result = await guessResult(guess);
+ if (result == null) return guess;
+ var newGuess = (int)((guess - startInclusive) * result.Value) + startInclusive;
+ if (newGuess >= endExclusive) newGuess = endExclusive - 1;
+ if (result < 1 && newGuess >= guess) newGuess--;
+ if (result > 1 && newGuess <= guess) newGuess++;
+ if (newGuess < 0 || newGuess >= endExclusive)
+ throw new Exception("Could not find through interpolation search.");
+
+ // Add termination condition to prevent infinite recursion
+ if (newGuess == guess || Math.Abs(newGuess - guess) <= 1)
+ return guess;
+
+ return await Find(newGuess, startInclusive, endExclusive, guessResult);
+ }
+}
\ No newline at end of file
diff --git a/backend/Utils/PasswordUtil.cs b/backend/Utils/PasswordUtil.cs
new file mode 100644
index 00000000..17baa1f9
--- /dev/null
+++ b/backend/Utils/PasswordUtil.cs
@@ -0,0 +1,18 @@
+using Microsoft.AspNetCore.Identity;
+
+namespace NzbWebDAV.Utils;
+
+public static class PasswordUtil
+{
+ private static readonly PasswordHasher<object> Hasher = new();
+
+ public static string Hash(string password, string salt = "")
+ {
+ return Hasher.HashPassword(null!, password + salt);
+ }
+
+ public static bool Verify(string hash, string password, string salt = "")
+ {
+ return Hasher.VerifyHashedPassword(null!, hash, password + salt) == PasswordVerificationResult.Success;
+ }
+}
\ No newline at end of file
diff --git a/backend/Utils/StringUtil.cs b/backend/Utils/StringUtil.cs
new file mode 100644
index 00000000..f2c5fece
--- /dev/null
+++ b/backend/Utils/StringUtil.cs
@@ -0,0 +1,9 @@
+namespace NzbWebDAV.Utils;
+
+public static class StringUtil
+{
+ public static string? EmptyToNull(string? value)
+ {
+ return value == "" ? null : value;
+ }
+}
\ No newline at end of file
diff --git a/backend/Utils/TaskUtil.cs b/backend/Utils/TaskUtil.cs
new file mode 100644
index 00000000..c5ff4d04
--- /dev/null
+++ b/backend/Utils/TaskUtil.cs
@@ -0,0 +1,39 @@
+namespace NzbWebDAV.Utils;
+
+public static class TaskUtil
+{
+ /// <summary>
+ /// Waits for all the given tasks to complete.
+ /// if any task throws an exception, the method short-circuit and stops early.
+ /// In the cases of no errors, the returned results are in order of completion.
+ /// </summary>
+ /// <param name="tasks">Tha tasks to wait on.</param>
+ /// <param name="progress">Callback handler for progress report.</param>
+ /// <typeparam name="T">The result type of each task.</typeparam>
+ /// <returns>The results of each task.</returns>
+ /// <exception cref="Exception">The first task error thrown.</exception>
+ public static async Task<List<T>> WhenAllOrError<T>(IEnumerable<Task<T>> tasks, IProgress<int>? progress = null)
+ {
+ var results = new List<T>();
+ var taskList = tasks.ToList();
+ var totalTasks = taskList.Count();
+ var completedTasks = 0;
+ while (taskList.Count > 0)
+ {
+ var completedTask = await Task.WhenAny(taskList);
+ taskList.Remove(completedTask);
+
+ if (completedTask.IsFaulted)
+ {
+ throw completedTask?.Exception?.InnerException ??
+ new Exception("An unknown error occurred.");
+ }
+
+ completedTasks++;
+ results.Add(completedTask.Result);
+ progress?.Report((completedTasks) * 100 / totalTasks);
+ }
+
+ return results;
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Base/BaseStoreCollection.cs b/backend/WebDav/Base/BaseStoreCollection.cs
new file mode 100644
index 00000000..c81e6142
--- /dev/null
+++ b/backend/WebDav/Base/BaseStoreCollection.cs
@@ -0,0 +1,203 @@
+using NWebDav.Server;
+using NWebDav.Server.Props;
+using NWebDav.Server.Stores;
+using NzbWebDAV.Streams;
+using NzbWebDAV.WebDav.Requests;
+
+namespace NzbWebDAV.WebDav.Base;
+
+public abstract class BaseStoreCollection : IStoreCollection
+{
+ // abstract members
+ public abstract string Name { get; }
+ public abstract string UniqueKey { get; }
+
+ protected abstract Task<StoreItemResult> CopyAsync(CopyRequest request);
+ protected abstract Task<IStoreItem?> GetItemAsync(GetItemRequest request);
+ protected abstract Task<IStoreItem[]> GetAllItemsAsync(CancellationToken cancellationToken);
+ protected abstract Task<StoreItemResult> CreateItemAsync(CreateItemRequest request);
+ protected abstract Task<StoreCollectionResult> CreateCollectionAsync(CreateCollectionRequest request);
+ protected abstract bool SupportsFastMove(SupportsFastMoveRequest request);
+ protected abstract Task<StoreItemResult> MoveItemAsync(MoveItemRequest request);
+ protected abstract Task<DavStatusCode> DeleteItemAsync(DeleteItemRequest request);
+
+ // private members
+ private BaseStoreEmptyFileManager EmptyFileManager => BaseStoreEmptyFileManager.GetEmptyFileManager(UniqueKey);
+
+ // interface implementation
+ public IPropertyManager? PropertyManager => BaseStoreCollectionPropertyManager.Instance;
+ public InfiniteDepthMode InfiniteDepthMode => InfiniteDepthMode.Rejected;
+
+ public Task<StoreItemResult> CopyAsync
+ (
+ IStoreCollection destination,
+ string name,
+ bool overwrite,
+ CancellationToken cancellationToken
+ )
+ {
+ return CopyAsync(new CopyRequest()
+ {
+ Destination = destination,
+ Name = name,
+ Overwrite = overwrite,
+ CancellationToken = cancellationToken
+ });
+ }
+
+ public async IAsyncEnumerable<IStoreItem> GetItemsAsync(CancellationToken cancellationToken)
+ {
+ var allItems = await GetAllItemsAsync(cancellationToken);
+ foreach (var item in allItems)
+ {
+ yield return item;
+ }
+
+ foreach (var item in EmptyFileManager.GetAllEmptyFiles())
+ yield return item;
+ }
+
+ public async Task<IStoreItem?> GetItemAsync(string name, CancellationToken cancellationToken)
+ {
+ return await GetItemAsync(new GetItemRequest()
+ {
+ Name = name,
+ CancellationToken = cancellationToken
+ }) ?? EmptyFileManager.Get(name);
+ }
+
+ public async Task<StoreItemResult> CreateItemAsync
+ (
+ string name,
+ Stream stream,
+ bool overwrite,
+ CancellationToken cancellationToken
+ )
+ {
+ var existingItem = await GetItemAsync(name, cancellationToken);
+ var probingStream = new ProbingStream(stream);
+
+ // if the item doesn't already exist, create it
+ //
+ // Note: The windows webdav client appears to create files in multiple steps
+ // with "CreateItemAsync" called twice.
+ // 1. CreateItemAsync is first called with an empty input stream to create an empty file.
+ // 2. CreateItemAsync is then called again with actual input stream and overwrite set to true.
+ // 3. If step #2 fails above, DeleteItemAsync is then called to remove the empty file created in step #1.
+ if (existingItem is null)
+ {
+ // This handles step #1 in the note above.
+ if (await probingStream.IsEmptyAsync())
+ {
+ var emptyFile = new BaseStoreEmptyFile(name);
+ EmptyFileManager.Add(emptyFile);
+ return new StoreItemResult(DavStatusCode.Created, emptyFile);
+ }
+ }
+
+ // this handles step #2 in the note above.
+ if (existingItem is null || overwrite)
+ {
+ EmptyFileManager.Remove(name);
+ return await CreateItemAsync(new CreateItemRequest()
+ {
+ Name = name,
+ Stream = probingStream,
+ Overwrite = overwrite,
+ CancellationToken = cancellationToken
+ });
+ }
+
+ return new StoreItemResult(DavStatusCode.Conflict);
+ }
+
+ public Task<StoreCollectionResult> CreateCollectionAsync
+ (
+ string name,
+ bool overwrite,
+ CancellationToken cancellationToken
+ )
+ {
+ return CreateCollectionAsync(new CreateCollectionRequest()
+ {
+ Name = name,
+ Overwrite = overwrite,
+ CancellationToken = cancellationToken
+ });
+ }
+
+ public bool SupportsFastMove(IStoreCollection destination, string destinationName, bool overwrite)
+ {
+ return SupportsFastMove(new SupportsFastMoveRequest()
+ {
+ Destination = destination,
+ DestinationName = destinationName,
+ Overwrite = overwrite
+ });
+ }
+
+ public Task<StoreItemResult> MoveItemAsync
+ (
+ string sourceName,
+ IStoreCollection destination,
+ string destinationName,
+ bool overwrite,
+ CancellationToken cancellationToken
+ )
+ {
+ return MoveItemAsync(new MoveItemRequest()
+ {
+ SourceName = sourceName,
+ Destination = destination,
+ DestinationName = destinationName,
+ Overwrite = overwrite,
+ CancellationToken = cancellationToken
+ });
+ }
+
+ public Task<DavStatusCode> DeleteItemAsync(string name, CancellationToken cancellationToken)
+ {
+ if (EmptyFileManager.Remove(name))
+ return Task.FromResult(DavStatusCode.Ok);
+
+ return DeleteItemAsync(new DeleteItemRequest()
+ {
+ Name = name,
+ CancellationToken = cancellationToken
+ });
+ }
+
+ // collections (directories) do not store content themselves
+ // these interface operations are not needed.
+ public Task<Stream> GetReadableStreamAsync(CancellationToken cancellationToken)
+ {
+ return Task.FromResult(Stream.Null);
+ }
+
+ public Task<DavStatusCode> UploadFromStreamAsync(Stream source, CancellationToken cancellationToken)
+ {
+ return Task.FromResult(DavStatusCode.Conflict);
+ }
+
+ // helpers
+ public async Task<IStoreItem?> ResolvePath(string path, CancellationToken cancellationToken)
+ {
+ var segments = path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
+ IStoreCollection current = this;
+ for (var i = 0; i < segments.Length; i++)
+ {
+ var nextItem = await current.GetItemAsync(segments[i], cancellationToken);
+ if (nextItem is null) return null;
+
+ if (i == segments.Length - 1)
+ return nextItem;
+
+ if (nextItem is not IStoreCollection nextCollection)
+ return null;
+
+ current = nextCollection;
+ }
+
+ return current;
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Base/BaseStoreCollectionPropertyManager.cs b/backend/WebDav/Base/BaseStoreCollectionPropertyManager.cs
new file mode 100644
index 00000000..c2d0ac03
--- /dev/null
+++ b/backend/WebDav/Base/BaseStoreCollectionPropertyManager.cs
@@ -0,0 +1,40 @@
+using System.Xml.Linq;
+using NWebDav.Server;
+using NWebDav.Server.Props;
+
+namespace NzbWebDAV.WebDav.Base;
+
+public class BaseStoreCollectionPropertyManager() : PropertyManager<BaseStoreCollection>(DavProperties)
+{
+ private static readonly XElement DavResourceType = new(WebDavNamespaces.DavNs + "collection");
+
+ private static readonly DavProperty<BaseStoreCollection>[] DavProperties =
+ [
+ new DavDisplayName<BaseStoreCollection>
+ {
+ Getter = collection => collection.Name
+ },
+ new DavGetResourceType<BaseStoreCollection>
+ {
+ Getter = _ => [DavResourceType]
+ },
+ new DavGetLastModified<BaseStoreCollection>
+ {
+ Getter = _ => default
+ },
+ new Win32FileAttributes<BaseStoreCollection>
+ {
+ Getter = _ => FileAttributes.Directory
+ },
+ new DavQuotaAvailableBytes<BaseStoreCollection>()
+ {
+ Getter = _ => long.MaxValue
+ },
+ new DavQuotaUsedBytes<BaseStoreCollection>()
+ {
+ Getter = _ => 0
+ }
+ ];
+
+ public static readonly BaseStoreCollectionPropertyManager Instance = new();
+}
\ No newline at end of file
diff --git a/backend/WebDav/Base/BaseStoreEmptyFile.cs b/backend/WebDav/Base/BaseStoreEmptyFile.cs
new file mode 100644
index 00000000..5a0d13cb
--- /dev/null
+++ b/backend/WebDav/Base/BaseStoreEmptyFile.cs
@@ -0,0 +1,27 @@
+using NWebDav.Server;
+using NWebDav.Server.Stores;
+using NzbWebDAV.WebDav.Requests;
+
+namespace NzbWebDAV.WebDav.Base;
+
+public class BaseStoreEmptyFile(string name) : BaseStoreItem
+{
+ public override string Name => name;
+ public override string UniqueKey { get; } = Guid.NewGuid().ToString();
+ public override long FileSize => 0;
+
+ public override Task<Stream> GetReadableStreamAsync(CancellationToken cancellationToken)
+ {
+ return Task.FromResult<Stream>(new MemoryStream([]));
+ }
+
+ protected override Task<DavStatusCode> UploadFromStreamAsync(UploadFromStreamRequest request)
+ {
+ return Task.FromResult(DavStatusCode.Forbidden);
+ }
+
+ protected override Task<StoreItemResult> CopyAsync(CopyRequest request)
+ {
+ throw new InvalidOperationException("this file cannot be copied.");
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Base/BaseStoreEmptyFileManager.cs b/backend/WebDav/Base/BaseStoreEmptyFileManager.cs
new file mode 100644
index 00000000..edbb543d
--- /dev/null
+++ b/backend/WebDav/Base/BaseStoreEmptyFileManager.cs
@@ -0,0 +1,41 @@
+using System.Collections.Concurrent;
+
+namespace NzbWebDAV.WebDav.Base;
+
+public class BaseStoreEmptyFileManager
+{
+ private static readonly ConcurrentDictionary<string, BaseStoreEmptyFileManager> emptyFileManagers = new();
+ private readonly ConcurrentDictionary<string, BaseStoreEmptyFile> _emptyFiles = new();
+
+ public static BaseStoreEmptyFileManager GetEmptyFileManager(string uuid)
+ {
+ lock (emptyFileManagers)
+ {
+ if (emptyFileManagers.TryGetValue(uuid, out var result))
+ return result;
+ result = new BaseStoreEmptyFileManager();
+ emptyFileManagers[uuid] = result;
+ return result;
+ }
+ }
+
+ public ICollection<BaseStoreEmptyFile> GetAllEmptyFiles()
+ {
+ return _emptyFiles.Values;
+ }
+
+ public BaseStoreEmptyFile? Get(string name)
+ {
+ return _emptyFiles.TryGetValue(name, out var result) ? result : null;
+ }
+
+ public void Add(BaseStoreEmptyFile file)
+ {
+ _ = _emptyFiles.TryAdd(file.Name, file);
+ }
+
+ public bool Remove(string name)
+ {
+ return _emptyFiles.TryRemove(name, out _);
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Base/BaseStoreItem.cs b/backend/WebDav/Base/BaseStoreItem.cs
new file mode 100644
index 00000000..ff20c5be
--- /dev/null
+++ b/backend/WebDav/Base/BaseStoreItem.cs
@@ -0,0 +1,46 @@
+using NWebDav.Server;
+using NWebDav.Server.Props;
+using NWebDav.Server.Stores;
+using NzbWebDAV.WebDav.Requests;
+
+namespace NzbWebDAV.WebDav.Base;
+
+public abstract class BaseStoreItem : IStoreItem
+{
+ // abstract members
+ public abstract string Name { get; }
+ public abstract string UniqueKey { get; }
+ public abstract long FileSize { get; }
+ public abstract Task<Stream> GetReadableStreamAsync(CancellationToken cancellationToken);
+ protected abstract Task<DavStatusCode> UploadFromStreamAsync(UploadFromStreamRequest request);
+ protected abstract Task<StoreItemResult> CopyAsync(CopyRequest request);
+
+ // interface implementation
+ public IPropertyManager? PropertyManager => BaseStoreItemPropertyManager.Instance;
+
+ public Task<DavStatusCode> UploadFromStreamAsync(Stream source, CancellationToken cancellationToken)
+ {
+ return UploadFromStreamAsync(new UploadFromStreamRequest()
+ {
+ Source = source,
+ CancellationToken = cancellationToken
+ });
+ }
+
+ public Task<StoreItemResult> CopyAsync
+ (
+ IStoreCollection destination,
+ string name,
+ bool overwrite,
+ CancellationToken cancellationToken
+ )
+ {
+ return CopyAsync(new CopyRequest()
+ {
+ Destination = destination,
+ Name = name,
+ Overwrite = overwrite,
+ CancellationToken = cancellationToken
+ });
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Base/BaseStoreItemPropertyManager.cs b/backend/WebDav/Base/BaseStoreItemPropertyManager.cs
new file mode 100644
index 00000000..69b7da26
--- /dev/null
+++ b/backend/WebDav/Base/BaseStoreItemPropertyManager.cs
@@ -0,0 +1,37 @@
+using Microsoft.AspNetCore.StaticFiles;
+using NWebDav.Server.Props;
+
+namespace NzbWebDAV.WebDav.Base;
+
+public class BaseStoreItemPropertyManager() : PropertyManager<BaseStoreItem>(DavProperties)
+{
+ private static readonly FileExtensionContentTypeProvider MimeTypeProvider = new();
+
+ private static readonly DavProperty<BaseStoreItem>[] DavProperties =
+ [
+ new DavDisplayName<BaseStoreItem>
+ {
+ Getter = item => item.Name
+ },
+ new DavGetContentLength<BaseStoreItem>
+ {
+ Getter = item => item.FileSize
+ },
+ new DavGetContentType<BaseStoreItem>
+ {
+ Getter = item => !MimeTypeProvider.TryGetContentType(item.Name, out var mimeType)
+ ? "application/octet-stream"
+ : mimeType
+ },
+ new DavGetLastModified<BaseStoreItem>
+ {
+ Getter = _ => default
+ },
+ new Win32FileAttributes<BaseStoreItem>
+ {
+ Getter = _ => FileAttributes.Normal
+ }
+ ];
+
+ public static readonly BaseStoreItemPropertyManager Instance = new();
+}
\ No newline at end of file
diff --git a/backend/WebDav/Base/GetAndHeadHandlerPatch.cs b/backend/WebDav/Base/GetAndHeadHandlerPatch.cs
new file mode 100644
index 00000000..54a25fb8
--- /dev/null
+++ b/backend/WebDav/Base/GetAndHeadHandlerPatch.cs
@@ -0,0 +1,201 @@
+using System.Globalization;
+using Microsoft.AspNetCore.Http;
+using NWebDav.Server;
+using NWebDav.Server.Handlers;
+using NWebDav.Server.Helpers;
+using NWebDav.Server.Props;
+using NWebDav.Server.Stores;
+
+namespace NzbWebDAV.WebDav.Base;
+
+/// <summary>
+/// Implementation of the GET and HEAD method.
+/// </summary>
+/// <remarks>
+/// The specification of the WebDAV GET and HEAD methods for collections
+/// can be found in the
+/// <see href="http://www.webdav.org/specs/rfc2518.html#rfc.section.8.4">
+/// WebDAV specification
+/// </see>.
+/// </remarks>
+public class GetAndHeadHandlerPatch : IRequestHandler
+{
+ private readonly IStore _store;
+
+ public GetAndHeadHandlerPatch(IStore store)
+ {
+ _store = store;
+ }
+
+ /// <summary>
+ /// Handle a GET or HEAD request.
+ /// </summary>
+ /// <param name="httpContext">
+ /// The HTTP context of the request.
+ /// </param>
+ /// <returns>
+ /// A task that represents the asynchronous GET or HEAD operation. The
+ /// task will always return <see langword="true"/> upon completion.
+ /// </returns>
+ public async Task<bool> HandleRequestAsync(HttpContext httpContext)
+ {
+ // Obtain request and response
+ var request = httpContext.Request;
+ var response = httpContext.Response;
+
+ // Determine if we are invoked as HEAD
+ var isHeadRequest = request.Method == HttpMethods.Head;
+
+ // Determine the requested range
+ var range = request.GetRange();
+
+ // Obtain the WebDAV collection
+ var entry = await _store.GetItemAsync(request.GetUri(), httpContext.RequestAborted).ConfigureAwait(false);
+ if (entry == null)
+ {
+ // Set status to not found
+ response.SetStatus(DavStatusCode.NotFound);
+ return true;
+ }
+
+ // ETag might be used for a conditional request
+ string? etag = null;
+
+ // Add non-expensive headers based on properties
+ var propertyManager = entry.PropertyManager;
+ if (propertyManager != null)
+ {
+ // Add Last-Modified header
+ var lastModifiedUtc = (string?)await propertyManager.GetPropertyAsync(entry, DavGetLastModified<IStoreItem>.PropertyName, true, httpContext.RequestAborted).ConfigureAwait(false);
+ if (lastModifiedUtc != null)
+ response.Headers.LastModified = lastModifiedUtc;
+
+ // Add ETag
+ etag = (string?)await propertyManager.GetPropertyAsync(entry, DavGetEtag<IStoreItem>.PropertyName, true, httpContext.RequestAborted).ConfigureAwait(false);
+ if (etag != null)
+ response.Headers.ETag = etag;
+
+ // Add type
+ var contentType = (string?)await propertyManager.GetPropertyAsync(entry, DavGetContentType<IStoreItem>.PropertyName, true, httpContext.RequestAborted).ConfigureAwait(false);
+ if (contentType != null)
+ response.ContentType = contentType;
+
+ // Add language
+ var contentLanguage = (string?)await propertyManager.GetPropertyAsync(entry, DavGetContentLanguage<IStoreItem>.PropertyName, true, httpContext.RequestAborted).ConfigureAwait(false);
+ if (contentLanguage != null)
+ response.Headers.ContentLanguage = contentLanguage;
+ }
+
+ // Stream the actual entry
+ var stream = await entry.GetReadableStreamAsync(httpContext.RequestAborted).ConfigureAwait(false);
+ await using (stream.ConfigureAwait(false))
+ {
+ if (stream != Stream.Null)
+ {
+ // Set the response
+ response.SetStatus(DavStatusCode.Ok);
+
+ // Set the expected content length
+ try
+ {
+ // We can only specify the Content-Length header if the
+ // length is known (this is typically true for seekable streams)
+ if (stream.CanSeek)
+ {
+ // Add a header that we accept ranges (bytes only)
+ response.Headers.AcceptRanges = "bytes";
+
+ // Determine the total length
+ var length = stream.Length;
+
+ // Check if an 'If-Range' was specified
+ if (range?.If != null && range?.If != default(DateTime) && propertyManager != null)
+ {
+ var lastModifiedText = (string?)await propertyManager.GetPropertyAsync(entry, DavGetLastModified<IStoreItem>.PropertyName, true, httpContext.RequestAborted).ConfigureAwait(false);
+ var lastModified = DateTime.Parse(lastModifiedText, CultureInfo.InvariantCulture);
+ if (lastModified != range.If)
+ range = null;
+ }
+
+ // Check if a range was specified
+ if (range != null)
+ {
+ var start = range.Start ?? 0;
+ var end = Math.Min(range.End ?? long.MaxValue, length-1);
+ length = end - start + 1;
+
+ // Write the range
+ response.Headers.ContentRange = $"bytes {start}-{end} / {stream.Length}";
+
+ // Set status to partial result if not all data can be sent
+ if (length < stream.Length)
+ response.SetStatus(DavStatusCode.PartialContent);
+ }
+
+ // Set the header, so the client knows how much data is required
+ response.ContentLength = length;
+ }
+ }
+ catch (NotSupportedException)
+ {
+ // If the content length is not supported, then we just skip it
+ }
+
+ // Do not return the actual item data if ETag matches
+ if (etag != null && request.Headers.IfNoneMatch == etag)
+ {
+ response.ContentLength = 0;
+ response.SetStatus(DavStatusCode.NotModified);
+ return true;
+ }
+
+ // HEAD method doesn't require the actual item data
+ if (!isHeadRequest)
+ await CopyToAsync(stream, response.Body, range?.Start ?? 0, range?.End, httpContext.RequestAborted).ConfigureAwait(false);
+ }
+ else
+ {
+ // Set the response
+ response.SetStatus(DavStatusCode.NoContent);
+ }
+ }
+ return true;
+ }
+
+ private async Task CopyToAsync(Stream src, Stream dest, long start, long? end, CancellationToken cancellationToken)
+ {
+ // Skip to the first offset
+ if (start > 0)
+ {
+ // We prefer seeking instead of draining data
+ if (!src.CanSeek)
+ throw new IOException("Cannot use range, because the source stream isn't seekable");
+
+ src.Seek(start, SeekOrigin.Begin);
+ }
+
+ // Determine the number of bytes to read
+ var bytesToRead = end - start + 1 ?? long.MaxValue;
+
+ // Read in 64KB blocks
+ var buffer = new byte[64 * 1024];
+
+ // Copy, until we don't get any data anymore
+ while (bytesToRead > 0)
+ {
+ // Read the requested bytes into memory
+ var requestedBytes = (int)Math.Min(bytesToRead, buffer.Length);
+ var bytesRead = await src.ReadAsync(buffer, 0, requestedBytes, cancellationToken).ConfigureAwait(false);
+
+ // We're done, if we cannot read any data anymore
+ if (bytesRead == 0)
+ return;
+
+ // Write the data to the destination stream
+ await dest.WriteAsync(buffer, 0, bytesRead, cancellationToken).ConfigureAwait(false);
+
+ // Decrement the number of bytes left to read
+ bytesToRead -= bytesRead;
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/DatabaseStore.cs b/backend/WebDav/DatabaseStore.cs
new file mode 100644
index 00000000..19924656
--- /dev/null
+++ b/backend/WebDav/DatabaseStore.cs
@@ -0,0 +1,40 @@
+using NWebDav.Server.Stores;
+using NzbWebDAV.Clients;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Services;
+
+namespace NzbWebDAV.WebDav;
+
+public class DatabaseStore(
+ DavDatabaseClient dbClient,
+ ConfigManager configManager,
+ UsenetStreamingClient usenetClient,
+ QueueManager queueManager
+) : IStore
+{
+ private readonly DatabaseStoreCollection _root = new(
+ DavItem.Root,
+ dbClient,
+ configManager,
+ usenetClient,
+ queueManager
+ );
+
+ public async Task<IStoreItem?> GetItemAsync(string path, CancellationToken cancellationToken)
+ {
+ path = path.Trim('/');
+ return path == "" ? _root : await _root.ResolvePath(path, cancellationToken);
+ }
+
+ public Task<IStoreItem?> GetItemAsync(Uri uri, CancellationToken cancellationToken)
+ {
+ return GetItemAsync(Uri.UnescapeDataString(uri.AbsolutePath), cancellationToken);
+ }
+
+ public async Task<IStoreCollection?> GetCollectionAsync(Uri uri, CancellationToken cancellationToken)
+ {
+ return await GetItemAsync(uri, cancellationToken) as IStoreCollection;
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/DatabaseStoreCollection.cs b/backend/WebDav/DatabaseStoreCollection.cs
new file mode 100644
index 00000000..9240c810
--- /dev/null
+++ b/backend/WebDav/DatabaseStoreCollection.cs
@@ -0,0 +1,111 @@
+using NWebDav.Server;
+using NWebDav.Server.Stores;
+using NzbWebDAV.Clients;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Extensions;
+using NzbWebDAV.Services;
+using NzbWebDAV.WebDav.Base;
+using NzbWebDAV.WebDav.Requests;
+
+namespace NzbWebDAV.WebDav;
+
+public class DatabaseStoreCollection(
+ DavItem davDirectory,
+ DavDatabaseClient dbClient,
+ ConfigManager configManager,
+ UsenetStreamingClient usenetClient,
+ QueueManager queueManager
+) : BaseStoreCollection
+{
+ public override string Name => davDirectory.Name;
+ public override string UniqueKey => davDirectory.Id.ToString();
+
+ protected override Task<StoreItemResult> CopyAsync(CopyRequest request)
+ {
+ throw new InvalidOperationException("Files and Directories cannot be copied.");
+ }
+
+ protected override async Task<IStoreItem?> GetItemAsync(GetItemRequest request)
+ {
+ var child = await dbClient.GetDirectoryChildAsync(davDirectory.Id, request.Name, request.CancellationToken);
+ if (child is null) return null;
+ return GetItem(child);
+ }
+
+ protected override async Task<IStoreItem[]> GetAllItemsAsync(CancellationToken cancellationToken)
+ {
+ return (await dbClient.GetDirectoryChildrenAsync(davDirectory.Id, cancellationToken))
+ .Select(GetItem)
+ .ToArray();
+ }
+
+ protected override Task<StoreItemResult> CreateItemAsync(CreateItemRequest request)
+ {
+ throw new InvalidOperationException("NZBs can only be added to the `/nzbs` folder.");
+ }
+
+ protected override Task<StoreCollectionResult> CreateCollectionAsync(CreateCollectionRequest request)
+ {
+ throw new InvalidOperationException("Directories cannot be created.");
+ }
+
+ protected override bool SupportsFastMove(SupportsFastMoveRequest request)
+ {
+ return false;
+ }
+
+ protected override Task<StoreItemResult> MoveItemAsync(MoveItemRequest request)
+ {
+ throw new InvalidOperationException("Files and Directories cannot be moved.");
+ }
+
+ protected override async Task<DavStatusCode> DeleteItemAsync(DeleteItemRequest request)
+ {
+ // Cannot delete items from dav root.
+ if (davDirectory.Id == DavItem.Root.Id)
+ return DavStatusCode.Forbidden;
+
+ // Get the item being deleted
+ var davItem = await dbClient.GetDirectoryChildAsync(davDirectory.Id, request.Name, request.CancellationToken);
+ if (davItem is null) return DavStatusCode.NotFound;
+
+ // If the item is a file, simply delete it and we're done.
+ if (davItem.Type is DavItem.ItemType.NzbFile or DavItem.ItemType.RarFile)
+ {
+ dbClient.Ctx.Items.Remove(davItem);
+ await dbClient.Ctx.SaveChangesAsync();
+ return DavStatusCode.Ok;
+ }
+
+ // If the item is a directory and it not a protected directory, simply delete it.
+ if (davItem.Type == DavItem.ItemType.Directory && !davItem.IsProtected())
+ {
+ dbClient.Ctx.Items.Remove(davItem);
+ await dbClient.Ctx.SaveChangesAsync();
+ return DavStatusCode.Ok;
+ }
+
+ // forbid deletion of any other items
+ return DavStatusCode.Forbidden;
+ }
+
+ private IStoreItem GetItem(DavItem davItem)
+ {
+ return davItem.Type switch
+ {
+ DavItem.ItemType.Directory when davItem.Id == DavItem.NzbFolder.Id =>
+ new DatabaseStoreWatchFolder(davItem, dbClient, configManager, usenetClient, queueManager),
+ DavItem.ItemType.Directory =>
+ new DatabaseStoreCollection(davItem, dbClient, configManager, usenetClient, queueManager),
+ DavItem.ItemType.SymlinkRoot =>
+ new DatabaseStoreSymlinkCollection(davItem, dbClient, configManager),
+ DavItem.ItemType.NzbFile =>
+ new DatabaseStoreNzbFile(davItem, dbClient, usenetClient, configManager),
+ DavItem.ItemType.RarFile =>
+ new DatabaseStoreRarFile(davItem, dbClient, usenetClient, configManager),
+ _ => throw new ArgumentException("Unrecognized directory child type.")
+ };
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/DatabaseStoreNzbFile.cs b/backend/WebDav/DatabaseStoreNzbFile.cs
new file mode 100644
index 00000000..53645c66
--- /dev/null
+++ b/backend/WebDav/DatabaseStoreNzbFile.cs
@@ -0,0 +1,43 @@
+using NWebDav.Server;
+using NWebDav.Server.Stores;
+using NzbWebDAV.Clients;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.WebDav.Base;
+using NzbWebDAV.WebDav.Requests;
+using Serilog;
+
+namespace NzbWebDAV.WebDav;
+
+public class DatabaseStoreNzbFile(
+ DavItem davNzbFile,
+ DavDatabaseClient dbClient,
+ UsenetStreamingClient usenetClient,
+ ConfigManager configManager
+) : BaseStoreItem
+{
+ public override string Name => davNzbFile.Name;
+ public override string UniqueKey => davNzbFile.Id.ToString();
+ public override long FileSize => davNzbFile.FileSize!.Value;
+
+ public override async Task<Stream> GetReadableStreamAsync(CancellationToken cancellationToken)
+ {
+ var id = davNzbFile.Id;
+ var file = await dbClient.GetNzbFileAsync(id, cancellationToken);
+ if (file is null) throw new FileNotFoundException($"Could not find nzb file with id: {id}");
+ return usenetClient.GetFileStream(file.SegmentIds, FileSize, configManager.GetConnectionsPerStream());
+ }
+
+ protected override Task<DavStatusCode> UploadFromStreamAsync(UploadFromStreamRequest request)
+ {
+ Log.Error("nzb-mounted files cannot be modified.");
+ return Task.FromResult(DavStatusCode.Forbidden);
+ }
+
+ protected override Task<StoreItemResult> CopyAsync(CopyRequest request)
+ {
+ Log.Error("nzb-mounted files cannot be copied.");
+ return Task.FromResult(new StoreItemResult(DavStatusCode.Forbidden));
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/DatabaseStoreQueueItem.cs b/backend/WebDav/DatabaseStoreQueueItem.cs
new file mode 100644
index 00000000..a7b8cc49
--- /dev/null
+++ b/backend/WebDav/DatabaseStoreQueueItem.cs
@@ -0,0 +1,41 @@
+using System.Text;
+using Microsoft.EntityFrameworkCore;
+using NWebDav.Server;
+using NWebDav.Server.Stores;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.WebDav.Base;
+using NzbWebDAV.WebDav.Requests;
+using Serilog;
+
+namespace NzbWebDAV.WebDav;
+
+public class DatabaseStoreQueueItem(
+ QueueItem queueItem,
+ DavDatabaseClient dbClient
+) : BaseStoreItem
+{
+ public QueueItem QueueItem => queueItem;
+ public override string Name => queueItem.FileName;
+ public override string UniqueKey => queueItem.Id.ToString();
+ public override long FileSize => queueItem.NzbFileSize;
+
+ public override async Task<Stream> GetReadableStreamAsync(CancellationToken ct)
+ {
+ var id = queueItem.Id;
+ var document = await dbClient.Ctx.QueueItems.Where(x => x.Id == id).FirstOrDefaultAsync(ct);
+ if (document is null) throw new FileNotFoundException($"Could not find nzb document with id: {id}");
+ return new MemoryStream(Encoding.UTF8.GetBytes(document.NzbContents));
+ }
+
+ protected override Task<DavStatusCode> UploadFromStreamAsync(UploadFromStreamRequest request)
+ {
+ Log.Error("Nzb document files cannot be modified.");
+ return Task.FromResult(DavStatusCode.Forbidden);
+ }
+
+ protected override Task<StoreItemResult> CopyAsync(CopyRequest request)
+ {
+ throw new InvalidOperationException("Nzb document files cannot be copied.");
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/DatabaseStoreRarFile.cs b/backend/WebDav/DatabaseStoreRarFile.cs
new file mode 100644
index 00000000..ecf82d0b
--- /dev/null
+++ b/backend/WebDav/DatabaseStoreRarFile.cs
@@ -0,0 +1,45 @@
+using Microsoft.EntityFrameworkCore;
+using NWebDav.Server;
+using NWebDav.Server.Stores;
+using NzbWebDAV.Clients;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Streams;
+using NzbWebDAV.WebDav.Base;
+using NzbWebDAV.WebDav.Requests;
+using Serilog;
+
+namespace NzbWebDAV.WebDav;
+
+public class DatabaseStoreRarFile(
+ DavItem davRarFile,
+ DavDatabaseClient dbClient,
+ UsenetStreamingClient usenetClient,
+ ConfigManager configManager
+) : BaseStoreItem
+{
+ public override string Name => davRarFile.Name;
+ public override string UniqueKey => davRarFile.Id.ToString();
+ public override long FileSize => davRarFile.FileSize!.Value;
+
+ public override async Task<Stream> GetReadableStreamAsync(CancellationToken ct)
+ {
+ var id = davRarFile.Id;
+ var rarFile = await dbClient.Ctx.RarFiles.Where(x => x.Id == id).FirstOrDefaultAsync(ct);
+ if (rarFile is null) throw new FileNotFoundException($"Could not find nzb file with id: {id}");
+ return new RarFileStream(rarFile.RarParts, usenetClient, configManager.GetConnectionsPerStream());
+ }
+
+ protected override Task<DavStatusCode> UploadFromStreamAsync(UploadFromStreamRequest request)
+ {
+ Log.Error("nzb-mounted files cannot be modified.");
+ return Task.FromResult(DavStatusCode.Forbidden);
+ }
+
+ protected override Task<StoreItemResult> CopyAsync(CopyRequest request)
+ {
+ Log.Error("nzb-mounted files cannot be copied.");
+ return Task.FromResult(new StoreItemResult(DavStatusCode.Forbidden));
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/DatabaseStoreSymlinkCollection.cs b/backend/WebDav/DatabaseStoreSymlinkCollection.cs
new file mode 100644
index 00000000..d9b1e305
--- /dev/null
+++ b/backend/WebDav/DatabaseStoreSymlinkCollection.cs
@@ -0,0 +1,139 @@
+using System.Text.RegularExpressions;
+using Microsoft.Extensions.Caching.Memory;
+using NWebDav.Server;
+using NWebDav.Server.Stores;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.WebDav.Base;
+using NzbWebDAV.WebDav.Requests;
+
+namespace NzbWebDAV.WebDav;
+
+public class DatabaseStoreSymlinkCollection(
+ DavItem davDirectory,
+ DavDatabaseClient dbClient,
+ ConfigManager configManager,
+ string parentPath = ""
+) : BaseStoreCollection
+{
+ public override string Name => davDirectory.Name;
+ public override string UniqueKey => davDirectory.Id.ToString();
+
+ private string RelativePath => davDirectory.Id == DavItem.SymlinkFolder.Id ? "" : Path.Join(parentPath, Name);
+ private Guid TargetId => davDirectory.Id == DavItem.SymlinkFolder.Id ? DavItem.ContentFolder.Id : davDirectory.Id;
+ private DeletedFileManager DeletedFiles => new(davDirectory.Id);
+
+ protected override Task<StoreItemResult> CopyAsync(CopyRequest request)
+ {
+ throw new InvalidOperationException("Files and Directories cannot be copied.");
+ }
+
+ protected override async Task<IStoreItem?> GetItemAsync(GetItemRequest request)
+ {
+ if (DeletedFiles.IsDeleted(request.Name)) return null;
+ var name = Regex.Replace(request.Name, @"\.rclonelink$", "");
+ var child = await dbClient.GetDirectoryChildAsync(TargetId, name, request.CancellationToken);
+ if (child is null) return null;
+ return GetItem(child);
+ }
+
+ protected override async Task<IStoreItem[]> GetAllItemsAsync(CancellationToken cancellationToken)
+ {
+ return (await dbClient.GetDirectoryChildrenAsync(TargetId, cancellationToken))
+ .Select(GetItem)
+ .Where(x => !DeletedFiles.IsDeleted(x.Name)) // must appear after Select(GetItem) for correct Name.
+ .ToArray();
+ }
+
+ protected override Task<StoreItemResult> CreateItemAsync(CreateItemRequest request)
+ {
+ throw new InvalidOperationException("NZBs can only be added to the `/nzbs` folder.");
+ }
+
+ protected override Task<StoreCollectionResult> CreateCollectionAsync(CreateCollectionRequest request)
+ {
+ throw new InvalidOperationException("Directories cannot be created.");
+ }
+
+ protected override bool SupportsFastMove(SupportsFastMoveRequest request)
+ {
+ return false;
+ }
+
+ protected override Task<StoreItemResult> MoveItemAsync(MoveItemRequest request)
+ {
+ throw new InvalidOperationException("Files and Directories cannot be moved.");
+ }
+
+ protected override Task<DavStatusCode> DeleteItemAsync(DeleteItemRequest request)
+ {
+ // Items cannot be deleted from the '/completed-symlinks' folder.
+ // This path simply mirrors the '/content' folder, except with symlinks.
+ // This allows radarr/sonarr to import the lightweight symlink, instead
+ // of trying to import large-sized media.
+ //
+ // However, when radarr attempts to import the symlink, it does so by moving
+ // it to the media library. But since the symlinks lives in a separate
+ // file-system (rclone-mounted webdav), the operating system will instead
+ // perform a copy-and-delete operation. For the import to succeed, we must
+ // trick the OS into thinking that the "delete" worked.
+ //
+ // The symlink doesn't actually exist anywhere. It takes zero storage and
+ // just gets created in memory, as needed, for webdav requests. The only
+ // thing that exists is the underlying data within the '/content' directory
+ // But in this request, we only want to "delete" the symlink. We don't want
+ // to delete the underlying media within the '/content' directory.
+ //
+ // Instead, we store the filename in a temporary cache (for 30 seconds).
+ // While the filename is in the cache, we will no longer create that
+ // symlink on-the-fly in subsequent webdav requests. It essentially
+ // mimics a deletion even though there was nothing to delete in the first
+ // place, since everything is created on the fly, mirroring the '/content'
+ // directory.
+ //
+ // (204 No Content) is the correct status code to return for a successful
+ // deletion of a file. This status code means the server has successfully
+ // processed the request, and there is no additional content to send in the
+ // response body. (200 OK) is also acceptable, but more appropriate for when
+ // the server also returns a response body with the status of the operation.
+ DeletedFiles.AddDeletedFile(request.Name, TimeSpan.FromSeconds(30));
+ return Task.FromResult(DavStatusCode.NoContent);
+ }
+
+ private IStoreItem GetItem(DavItem davItem)
+ {
+ return davItem.Type switch
+ {
+ DavItem.ItemType.Directory =>
+ new DatabaseStoreSymlinkCollection(davItem, dbClient, configManager, RelativePath),
+ DavItem.ItemType.NzbFile =>
+ new DatabaseStoreSymlinkFile(davItem, RelativePath, configManager),
+ DavItem.ItemType.RarFile =>
+ new DatabaseStoreSymlinkFile(davItem, RelativePath, configManager),
+ _ => throw new ArgumentException("Unrecognized directory child type.")
+ };
+ }
+
+ private class DeletedFileManager(Guid directoryId)
+ {
+ private static readonly MemoryCache DeletedFiles = new(new MemoryCacheOptions());
+
+ public void AddDeletedFile(string filename, TimeSpan? expiry = null)
+ {
+ using var entry = DeletedFiles.CreateEntry(GetKey(filename));
+ entry.SlidingExpiration = expiry ?? TimeSpan.FromSeconds(30);
+ entry.Value = true;
+ }
+
+ public bool IsDeleted(string filename)
+ {
+ return (bool)(DeletedFiles.Get(GetKey(filename)) ?? false);
+ }
+
+ private string GetKey(string filename)
+ {
+ return $"{directoryId}/{filename}";
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/DatabaseStoreSymlinkFile.cs b/backend/WebDav/DatabaseStoreSymlinkFile.cs
new file mode 100644
index 00000000..4d3d6638
--- /dev/null
+++ b/backend/WebDav/DatabaseStoreSymlinkFile.cs
@@ -0,0 +1,41 @@
+using System.Text;
+using NWebDav.Server;
+using NWebDav.Server.Stores;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Utils;
+using NzbWebDAV.WebDav.Base;
+using NzbWebDAV.WebDav.Requests;
+using Serilog;
+
+namespace NzbWebDAV.WebDav;
+
+public class DatabaseStoreSymlinkFile(DavItem davFile, string parentPath, ConfigManager configManager) : BaseStoreItem
+{
+ public override string Name => davFile.Name + ".rclonelink";
+ public override string UniqueKey => davFile.Id + ".rclonelink";
+ public override long FileSize => ContentBytes.Length;
+
+ private string TargetPath =>
+ Path.Combine(configManager.GetRcloneMountDir(), DavItem.ContentFolder.Name, parentPath, davFile.Name);
+
+ private byte[] ContentBytes =>
+ Encoding.UTF8.GetBytes(TargetPath);
+
+ public override Task<Stream> GetReadableStreamAsync(CancellationToken cancellationToken)
+ {
+ return Task.FromResult<Stream>(new MemoryStream(ContentBytes));
+ }
+
+ protected override Task<DavStatusCode> UploadFromStreamAsync(UploadFromStreamRequest request)
+ {
+ Log.Error("symlinks files cannot be modified. They simply mirror items in the /content root");
+ return Task.FromResult(DavStatusCode.Forbidden);
+ }
+
+ protected override Task<StoreItemResult> CopyAsync(CopyRequest request)
+ {
+ Log.Error("symlinks files cannot be copied. They simply mirror items in the /content root");
+ return Task.FromResult(new StoreItemResult(DavStatusCode.Forbidden));
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/DatabaseStoreWatchFolder.cs b/backend/WebDav/DatabaseStoreWatchFolder.cs
new file mode 100644
index 00000000..0d9b8e35
--- /dev/null
+++ b/backend/WebDav/DatabaseStoreWatchFolder.cs
@@ -0,0 +1,86 @@
+using Microsoft.EntityFrameworkCore;
+using NWebDav.Server;
+using NWebDav.Server.Stores;
+using NzbWebDAV.Api.SabControllers.AddFile;
+using NzbWebDAV.Api.SabControllers.RemoveFromQueue;
+using NzbWebDAV.Clients;
+using NzbWebDAV.Config;
+using NzbWebDAV.Database;
+using NzbWebDAV.Database.Models;
+using NzbWebDAV.Services;
+using NzbWebDAV.WebDav.Requests;
+
+namespace NzbWebDAV.WebDav;
+
+public class DatabaseStoreWatchFolder(
+ DavItem davDirectory,
+ DavDatabaseClient dbClient,
+ ConfigManager configManager,
+ UsenetStreamingClient usenetClient,
+ QueueManager queueManager
+) : DatabaseStoreCollection(davDirectory, dbClient, configManager, usenetClient, queueManager)
+{
+ protected override async Task<IStoreItem?> GetItemAsync(GetItemRequest request)
+ {
+ var queueItem = await dbClient.Ctx.QueueItems
+ .Where(x => x.FileName == request.Name)
+ .FirstOrDefaultAsync(request.CancellationToken);
+ if (queueItem is null) return null;
+ return new DatabaseStoreQueueItem(queueItem, dbClient);
+ }
+
+ protected override async Task<IStoreItem[]> GetAllItemsAsync(CancellationToken cancellationToken)
+ {
+ return (await dbClient.GetQueueItems(null, 0, int.MaxValue, cancellationToken))
+ .Select(x => new DatabaseStoreQueueItem(x, dbClient))
+ .Select(IStoreItem (x) => x)
+ .ToArray();
+ }
+
+ protected override async Task<StoreItemResult> CreateItemAsync(CreateItemRequest request)
+ {
+ var controller = new AddFileController(null!, dbClient, queueManager, configManager);
+ using var streamReader = new StreamReader(request.Stream);
+ var nzbFileContents = await streamReader.ReadToEndAsync(request.CancellationToken);
+ var addFileRequest = new AddFileRequest()
+ {
+ FileName = request.Name,
+ MimeType = "application/x-nzb",
+ Category = "uncategorized",
+ Priority = QueueItem.PriorityOption.Normal,
+ PostProcessing = QueueItem.PostProcessingOption.RepairUnpackDelete,
+ PauseUntil = DateTime.Now.AddSeconds(3),
+ NzbFileContents = nzbFileContents,
+ CancellationToken = request.CancellationToken
+ };
+ var response = await controller.AddFileAsync(addFileRequest);
+ var queueItem = dbClient.Ctx.ChangeTracker
+ .Entries<QueueItem>()
+ .Select(x => x.Entity)
+ .First(x => x.Id.ToString() == response.NzoIds[0]);
+ return new StoreItemResult(DavStatusCode.Created, new DatabaseStoreQueueItem(queueItem, dbClient));
+ }
+
+ protected override async Task<DavStatusCode> DeleteItemAsync(DeleteItemRequest request)
+ {
+ var controller = new RemoveFromQueueController(null!, dbClient, queueManager, configManager);
+
+ // get the item to delete
+ var item = await dbClient.Ctx.QueueItems
+ .Where(x => x.FileName == request.Name)
+ .FirstOrDefaultAsync(request.CancellationToken);
+
+ // if the item doesn't exist, return 404
+ if (item is null)
+ return DavStatusCode.NotFound;
+
+ // delete the item
+ dbClient.Ctx.ChangeTracker.Clear();
+ await controller.RemoveFromQueue(new RemoveFromQueueRequest()
+ {
+ NzoId = item.Id.ToString(),
+ CancellationToken = request.CancellationToken
+ });
+ return DavStatusCode.NoContent;
+ }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Requests/CopyRequest.cs b/backend/WebDav/Requests/CopyRequest.cs
new file mode 100644
index 00000000..32743aaa
--- /dev/null
+++ b/backend/WebDav/Requests/CopyRequest.cs
@@ -0,0 +1,11 @@
+using NWebDav.Server.Stores;
+
+namespace NzbWebDAV.WebDav.Requests;
+
+public class CopyRequest
+{
+ public required IStoreCollection Destination { get; init; }
+ public required string Name { get; init; }
+ public required bool Overwrite { get; init; }
+ public required CancellationToken CancellationToken { get; init; }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Requests/CreateCollectionRequest.cs b/backend/WebDav/Requests/CreateCollectionRequest.cs
new file mode 100644
index 00000000..d8e1dba4
--- /dev/null
+++ b/backend/WebDav/Requests/CreateCollectionRequest.cs
@@ -0,0 +1,8 @@
+namespace NzbWebDAV.WebDav.Requests;
+
+public class CreateCollectionRequest
+{
+ public required string Name { get; init; }
+ public required bool Overwrite { get; init; }
+ public required CancellationToken CancellationToken { get; init; }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Requests/CreateItemRequest.cs b/backend/WebDav/Requests/CreateItemRequest.cs
new file mode 100644
index 00000000..6f264a29
--- /dev/null
+++ b/backend/WebDav/Requests/CreateItemRequest.cs
@@ -0,0 +1,9 @@
+namespace NzbWebDAV.WebDav.Requests;
+
+public class CreateItemRequest
+{
+ public required string Name { get; init; }
+ public required Stream Stream { get; init; }
+ public required bool Overwrite { get; init; }
+ public required CancellationToken CancellationToken { get; init; }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Requests/DeleteItemRequest.cs b/backend/WebDav/Requests/DeleteItemRequest.cs
new file mode 100644
index 00000000..dad78eb5
--- /dev/null
+++ b/backend/WebDav/Requests/DeleteItemRequest.cs
@@ -0,0 +1,7 @@
+namespace NzbWebDAV.WebDav.Requests;
+
+public class DeleteItemRequest
+{
+ public required string Name { get; init; }
+ public required CancellationToken CancellationToken { get; init; }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Requests/GetItemRequest.cs b/backend/WebDav/Requests/GetItemRequest.cs
new file mode 100644
index 00000000..23043f68
--- /dev/null
+++ b/backend/WebDav/Requests/GetItemRequest.cs
@@ -0,0 +1,7 @@
+namespace NzbWebDAV.WebDav.Requests;
+
+public class GetItemRequest
+{
+ public required string Name { get; init; }
+ public required CancellationToken CancellationToken { get; init; }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Requests/MoveItemRequest.cs b/backend/WebDav/Requests/MoveItemRequest.cs
new file mode 100644
index 00000000..f967e04a
--- /dev/null
+++ b/backend/WebDav/Requests/MoveItemRequest.cs
@@ -0,0 +1,12 @@
+using NWebDav.Server.Stores;
+
+namespace NzbWebDAV.WebDav.Requests;
+
+public class MoveItemRequest
+{
+ public required string SourceName { get; init; }
+ public required IStoreCollection Destination { get; init; }
+ public required string DestinationName { get; init; }
+ public required bool Overwrite { get; init; }
+ public required CancellationToken CancellationToken { get; init; }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Requests/SupportsFastMoveRequest.cs b/backend/WebDav/Requests/SupportsFastMoveRequest.cs
new file mode 100644
index 00000000..a1427bd1
--- /dev/null
+++ b/backend/WebDav/Requests/SupportsFastMoveRequest.cs
@@ -0,0 +1,10 @@
+using NWebDav.Server.Stores;
+
+namespace NzbWebDAV.WebDav.Requests;
+
+public class SupportsFastMoveRequest
+{
+ public required IStoreCollection Destination { get; init; }
+ public required string DestinationName { get; init; }
+ public required bool Overwrite { get; init; }
+}
\ No newline at end of file
diff --git a/backend/WebDav/Requests/UploadFromStreamRequest.cs b/backend/WebDav/Requests/UploadFromStreamRequest.cs
new file mode 100644
index 00000000..2a0312a1
--- /dev/null
+++ b/backend/WebDav/Requests/UploadFromStreamRequest.cs
@@ -0,0 +1,7 @@
+namespace NzbWebDAV.WebDav.Requests;
+
+public class UploadFromStreamRequest
+{
+ public required Stream Source { get; init; }
+ public required CancellationToken CancellationToken { get; init; }
+}
\ No newline at end of file
diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh
new file mode 100644
index 00000000..08061ec4
--- /dev/null
+++ b/backend/entrypoint.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Use env vars or default to 1000
+PUID=${PUID:-1000}
+PGID=${PGID:-1000}
+
+# Create group if it doesn't exist
+if ! getent group appgroup >/dev/null; then
+ addgroup -g "$PGID" appgroup
+fi
+
+# Create user if it doesn't exist
+if ! id appuser >/dev/null 2>&1; then
+ adduser -D -H -u "$PUID" -G appgroup appuser
+fi
+
+# Switch to new user and run app
+exec su-exec appuser ./NzbWebDAV
\ No newline at end of file
diff --git a/entrypoint.sh b/entrypoint.sh
new file mode 100644
index 00000000..06800c62
--- /dev/null
+++ b/entrypoint.sh
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+wait_either() {
+ local pid1=$1
+ local pid2=$2
+
+ while true; do
+ if ! kill -0 "$pid1" 2>/dev/null; then
+ wait "$pid1"
+ EXITED_PID=$pid1
+ REMAINING_PID=$pid2
+ return $?
+ fi
+
+ if ! kill -0 "$pid2" 2>/dev/null; then
+ wait "$pid2"
+ EXITED_PID=$pid2
+ REMAINING_PID=$pid1
+ return $?
+ fi
+
+ sleep 0.5
+ done
+}
+
+# Use env vars or default to 1000
+PUID=${PUID:-1000}
+PGID=${PGID:-1000}
+
+# Create group if it doesn't exist
+if ! getent group appgroup >/dev/null; then
+ addgroup -g "$PGID" appgroup
+fi
+
+# Create user if it doesn't exist
+if ! id appuser >/dev/null 2>&1; then
+ adduser -D -H -u "$PUID" -G appgroup appuser
+fi
+
+# Set environment variables
+if [ -z "${BACKEND_URL}" ]; then
+ export BACKEND_URL="http://localhost:8080"
+fi
+
+if [ -z "${FRONTEND_BACKEND_API_KEY}" ]; then
+ export FRONTEND_BACKEND_API_KEY=$(head -c 32 /dev/urandom | hexdump -ve '1/1 "%.2x"')
+fi
+
+# Change permissions on /config directory to the given PUID and GUID
+chown $PUID:$GUID /config
+
+# Run backend as appuser in background
+cd /app/backend
+su-exec appuser ./NzbWebDAV &
+BACKEND_PID=$!
+
+# Run frontend as appuser in background
+cd /app/frontend
+su-exec appuser npm run start &
+FRONTEND_PID=$!
+
+# Wait for either to exit
+wait_either $BACKEND_PID $FRONTEND_PID
+EXIT_CODE=$?
+
+# Determine which process exited
+if [ "$EXITED_PID" -eq "$FRONTEND_PID" ]; then
+ echo "The web-frontend has exited. Shutting down the web-backend..."
+else
+ echo "The web-backend has exited. Shutting down the web-frontend..."
+fi
+
+# Kill the remaining process
+kill $REMAINING_PID
+
+# Exit with the code of the process that died first
+exit $EXIT_CODE
\ No newline at end of file
diff --git a/frontend/.dockerignore b/frontend/.dockerignore
new file mode 100644
index 00000000..9b8d5147
--- /dev/null
+++ b/frontend/.dockerignore
@@ -0,0 +1,4 @@
+.react-router
+build
+node_modules
+README.md
\ No newline at end of file
diff --git a/frontend/.gitignore b/frontend/.gitignore
new file mode 100644
index 00000000..d1179f3b
--- /dev/null
+++ b/frontend/.gitignore
@@ -0,0 +1,8 @@
+.DS_Store
+/node_modules/
+*.tsbuildinfo
+.env
+
+# React Router
+/.react-router/
+/build/
diff --git a/frontend/Dockerfile b/frontend/Dockerfile
new file mode 100644
index 00000000..a0fca141
--- /dev/null
+++ b/frontend/Dockerfile
@@ -0,0 +1,18 @@
+# Build the project
+FROM node:alpine AS build-env
+WORKDIR /nzb-webdav
+COPY ./ ./
+RUN npm install
+RUN npm run build
+RUN npm prune --omit=dev
+
+# Build the production image
+FROM node:alpine
+EXPOSE 3000
+WORKDIR /nzb-webdav
+ENV NODE_ENV=production
+COPY --from=build-env /nzb-webdav/node_modules ./node_modules
+COPY --from=build-env /nzb-webdav/package.json ./package.json
+COPY --from=build-env /nzb-webdav/server.js ./server.js
+COPY --from=build-env /nzb-webdav/build ./build
+CMD ["npm", "run", "start"]
\ No newline at end of file
diff --git a/frontend/README.md b/frontend/README.md
new file mode 100644
index 00000000..6215fdd9
--- /dev/null
+++ b/frontend/README.md
@@ -0,0 +1,86 @@
+# Welcome to React Router!
+
+A modern, production-ready template for building full-stack React applications using React Router.
+
+## Features
+
+- 🚀 Server-side rendering
+- ⚡️ Hot Module Replacement (HMR)
+- 📦 Asset bundling and optimization
+- 🔄 Data loading and mutations
+- 🔒 TypeScript by default
+- 🎉 TailwindCSS for styling
+- 📖 [React Router docs](https://reactrouter.com/)
+
+## Getting Started
+
+### Installation
+
+Install the dependencies:
+
+```bash
+npm install
+```
+
+### Development
+
+Start the development server with HMR:
+
+```bash
+npm run dev
+```
+
+Your application will be available at `http://localhost:5173`.
+
+## Building for Production
+
+Create a production build:
+
+```bash
+npm run build
+```
+
+## Deployment
+
+### Docker Deployment
+
+To build and run using Docker:
+
+```bash
+docker build -t my-app .
+
+# Run the container
+docker run -p 3000:3000 my-app
+```
+
+The containerized application can be deployed to any platform that supports Docker, including:
+
+- AWS ECS
+- Google Cloud Run
+- Azure Container Apps
+- Digital Ocean App Platform
+- Fly.io
+- Railway
+
+### DIY Deployment
+
+If you're familiar with deploying Node applications, the built-in app server is production-ready.
+
+Make sure to deploy the output of `npm run build`
+
+```
+├── package.json
+├── package-lock.json (or pnpm-lock.yaml, or bun.lockb)
+├── server.js
+├── build/
+│ ├── client/ # Static assets
+│ └── server/ # Server-side code
+```
+
+## Styling
+
+This template comes with [Tailwind CSS](https://tailwindcss.com/) already configured for a simple default starting experience. You can use whatever CSS framework you prefer.
+
+---
+
+Built with ❤️ using React Router.
diff --git a/frontend/app/app.css b/frontend/app/app.css
new file mode 100644
index 00000000..7d4be850
--- /dev/null
+++ b/frontend/app/app.css
@@ -0,0 +1,19 @@
+:root {
+ --top-nav-height: 60px;
+ --left-nav-width: 270px;
+ --body-background-color: hsl(198 100% 4%);
+ --top-nav-background-color: hsl(200 100% 7.65%);
+ --left-nav-background-color: hsl(196.8 100% 4.9%);
+ --page-padding: 25px;
+}
+
+
+html, body {
+ margin: 0;
+ min-width: 100%;
+ min-height: 100%;
+ position: absolute;
+ background-color: var(--body-background-color);
+ color: white;
+ font-family: Arial, Helvetica, sans-serif;
+}
\ No newline at end of file
diff --git a/frontend/app/app.css.d.ts b/frontend/app/app.css.d.ts
new file mode 100644
index 00000000..8cec2e9c
--- /dev/null
+++ b/frontend/app/app.css.d.ts
@@ -0,0 +1 @@
+export {};
\ No newline at end of file
diff --git a/frontend/app/auth/authentication.server.ts b/frontend/app/auth/authentication.server.ts
new file mode 100644
index 00000000..e082a476
--- /dev/null
+++ b/frontend/app/auth/authentication.server.ts
@@ -0,0 +1,27 @@
+import { createCookieSessionStorage } from "react-router";
+import crypto from "crypto"
+import { backendClient } from "~/clients/backend-client.server";
+
+type User = {
+ username: string;
+};
+
+export const sessionStorage = createCookieSessionStorage({
+ cookie: {
+ name: "__session",
+ httpOnly: true,
+ path: "/",
+ sameSite: "strict",
+ secrets: [process?.env?.SESSION_KEY || crypto.randomBytes(64).toString('hex')],
+ secure: ["true", "yes"].includes(process?.env?.SECURE_COOKIES || ""),
+ },
+});
+
+export async function authenticate(request: Request): Promise<User> {
+ const formData = await request.formData();
+ const username = formData.get("username")?.toString();
+ const password = formData.get("password")?.toString();
+ if (!username || !password) throw new Error("username and password required");
+ if (await backendClient.authenticate(username, password)) return { username: username };
+ throw new Error("Invalid credentials");
+}
\ No newline at end of file
diff --git a/frontend/app/auth/downloads.server.ts b/frontend/app/auth/downloads.server.ts
new file mode 100644
index 00000000..f76e0a50
--- /dev/null
+++ b/frontend/app/auth/downloads.server.ts
@@ -0,0 +1,12 @@
+import { createHash } from "node:crypto";
+
+export function getDownloadKey(path: string): string {
+ var input = `${path}_${process.env.FRONTEND_BACKEND_API_KEY}`;
+ return createHash('sha256').update(input).digest('hex');
+}
+
+export function verifyDownloadKey(downloadKey: string | null, path: string): boolean {
+ var input = `${path}_${process.env.FRONTEND_BACKEND_API_KEY}`;
+ var hash = createHash('sha256').update(input).digest('hex');
+ return downloadKey == hash;
+}
\ No newline at end of file
diff --git a/frontend/app/clients/backend-client.server.ts b/frontend/app/clients/backend-client.server.ts
new file mode 100644
index 00000000..3a977450
--- /dev/null
+++ b/frontend/app/clients/backend-client.server.ts
@@ -0,0 +1,263 @@
+class BackendClient {
+ public async isOnboarding(): Promise<boolean> {
+ const url = process.env.BACKEND_URL + "/api/is-onboarding";
+
+ const response = await fetch(url, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ "x-api-key": process.env.FRONTEND_BACKEND_API_KEY || ""
+ }
+ });
+
+ if (!response.ok) {
+ throw new Error(`Failed to fetch onboarding status: ${(await response.json()).error}`);
+ }
+
+ const data = await response.json();
+ return data.isOnboarding;
+ }
+
+ public async createAccount(username: string, password: string): Promise<boolean> {
+ const url = process.env.BACKEND_URL + "/api/create-account";
+
+ const response = await fetch(url, {
+ method: "POST",
+ headers: {
+ "x-api-key": process.env.FRONTEND_BACKEND_API_KEY || ""
+ },
+ body: (() => {
+ const form = new FormData();
+ form.append("username", username);
+ form.append("password", password);
+ form.append("type", "admin");
+ return form;
+ })()
+ });
+
+ if (!response.ok) {
+ throw new Error(`Failed to create account: ${(await response.json()).error}`);
+ }
+
+ const data = await response.json();
+ return data.status;
+ }
+
+ public async authenticate(username: string, password: string): Promise<boolean> {
+ const url = process.env.BACKEND_URL + "/api/authenticate";
+
+ const apiKey = process.env.FRONTEND_BACKEND_API_KEY || "";
+ const response = await fetch(url, {
+ method: "POST",
+ headers: { "x-api-key": apiKey },
+ body: (() => {
+ const form = new FormData();
+ form.append("username", username);
+ form.append("password", password);
+ form.append("type", "admin");
+ return form;
+ })()
+ });
+
+ if (!response.ok) {
+ throw new Error(`Failed to authenticate: ${(await response.json()).error}`);
+ }
+
+ const data = await response.json();
+ return data.authenticated;
+ }
+
+ public async getQueue(): Promise<any> {
+ const url = process.env.BACKEND_URL + "/api?mode=queue";
+
+ const apiKey = process.env.FRONTEND_BACKEND_API_KEY || "";
+ const response = await fetch(url, { headers: { "x-api-key": apiKey } });
+ if (!response.ok) {
+ throw new Error(`Failed to authenticate: ${(await response.json()).error}`);
+ }
+
+ const data = await response.json();
+ return data.queue;
+ }
+
+ public async getHistory(): Promise<HistoryResponse> {
+ const url = process.env.BACKEND_URL + "/api?mode=history";
+
+ const apiKey = process.env.FRONTEND_BACKEND_API_KEY || "";
+ const response = await fetch(url, { headers: { "x-api-key": apiKey } });
+ if (!response.ok) {
+ throw new Error(`Failed to authenticate: ${(await response.json()).error}`);
+ }
+
+ const data = await response.json();
+ return data.history;
+ }
+
+ public async addNzb(nzbFile: File): Promise<string> {
+ const url = process.env.BACKEND_URL + "/api?mode=addfile&cat=uncategorized&priority=0&pp=0";
+
+ const apiKey = process.env.FRONTEND_BACKEND_API_KEY || "";
+ const response = await fetch(url, {
+ method: "POST",
+ headers: { "x-api-key": apiKey },
+ body: (() => {
+ const form = new FormData();
+ form.append("nzbFile", nzbFile, nzbFile.name);
+ return form;
+ })()
+ });
+
+ if (!response.ok) {
+ throw new Error(`Failed to add nzb file: ${(await response.json()).error}`);
+ }
+ const data = await response.json();
+ if (!data.nzo_ids || data.nzo_ids.length != 1) {
+ throw new Error(`Failed to add nzb file: unexpected response format`);
+ }
+ return data.nzo_ids[0];
+ }
+
+ public async listWebdavDirectory(directory: string): Promise<DirectoryItem[]> {
+ const url = process.env.BACKEND_URL + "/api/list-webdav-directory";
+
+ const apiKey = process.env.FRONTEND_BACKEND_API_KEY || "";
+ const response = await fetch(url, {
+ method: "POST",
+ headers: { "x-api-key": apiKey },
+ body: (() => {
+ const form = new FormData();
+ form.append("directory", directory);
+ return form;
+ })()
+ });
+
+ if (!response.ok) {
+ throw new Error(`Failed to list webdav directory: ${(await response.json()).error}`);
+ }
+ const data = await response.json();
+ return data.items;
+ }
+
+ public async getConfig(keys: string[]): Promise<ConfigItem[]> {
+ const url = process.env.BACKEND_URL + "/api/get-config";
+
+ const apiKey = process.env.FRONTEND_BACKEND_API_KEY || "";
+ const response = await fetch(url, {
+ method: "POST",
+ headers: { "x-api-key": apiKey },
+ body: (() => {
+ const form = new FormData();
+ for (const key of keys) {
+ form.append("config-keys", key);
+ }
+ return form;
+ })()
+ });
+
+ if (!response.ok) {
+ throw new Error(`Failed to get config items: ${(await response.json()).error}`);
+ }
+ const data = await response.json();
+ return data.configItems || [];
+ }
+
+ public async updateConfig(configItems: ConfigItem[]): Promise<boolean> {
+ const url = process.env.BACKEND_URL + "/api/update-config";
+
+ const apiKey = process.env.FRONTEND_BACKEND_API_KEY || "";
+ const response = await fetch(url, {
+ method: "POST",
+ headers: { "x-api-key": apiKey },
+ body: (() => {
+ const form = new FormData();
+ for (const item of configItems) {
+ form.append(item.configName, item.configValue);
+ }
+ return form;
+ })()
+ });
+
+ if (!response.ok) {
+ throw new Error(`Failed to update config items: ${(await response.json()).error}`);
+ }
+ const data = await response.json();
+ return data.status;
+ }
+
+ public async testUsenetConnection(request: TestUsenetConnectionRequest): Promise<boolean> {
+ const url = process.env.BACKEND_URL + "/api/test-usenet-connection";
+
+ const apiKey = process.env.FRONTEND_BACKEND_API_KEY || "";
+ const response = await fetch(url, {
+ method: "POST",
+ headers: { "x-api-key": apiKey },
+ body: (() => {
+ const form = new FormData();
+ form.append("host", request.host);
+ form.append("port", request.port);
+ form.append("use-ssl", request.useSsl);
+ form.append("user", request.user);
+ form.append("pass", request.pass);
+ return form;
+ })()
+ });
+
+ if (!response.ok) {
+ throw new Error(`Failed to test-usenet-connection: ${(await response.json()).error}`);
+ }
+ const data = await response.json();
+ return data.connected || false;
+ }
+}
+
+export const backendClient = new BackendClient();
+
+export type QueueResponse = {
+ slots: [QueueSlot]
+}
+
+export type QueueSlot = {
+ nzo_id: string,
+ priority: string,
+ filename: string,
+ cat: string,
+ percentage: string,
+ status: string,
+ mb: string,
+ mbleft: string,
+}
+
+export type HistoryResponse = {
+ slots: [HistorySlot]
+}
+
+export type HistorySlot = {
+ nzo_id: string,
+ nzb_name: string,
+ name: string,
+ category: string,
+ status: string,
+ bytes: number,
+ storage: string,
+ download_time: number,
+ fail_message: string,
+}
+
+export type DirectoryItem = {
+ name: string,
+ isDirectory: boolean,
+ size: number | null | undefined,
+}
+
+export type ConfigItem = {
+ configName: string,
+ configValue: string,
+}
+
+export type TestUsenetConnectionRequest = {
+ host: string,
+ port: string,
+ useSsl: string,
+ user: string,
+ pass: string
+}
\ No newline at end of file
diff --git a/frontend/app/root.tsx b/frontend/app/root.tsx
new file mode 100644
index 00000000..02ba4d1a
--- /dev/null
+++ b/frontend/app/root.tsx
@@ -0,0 +1,34 @@
+import {
+ Links,
+ Meta,
+ Outlet,
+ Scripts,
+ ScrollRestoration,
+} from "react-router";
+
+import 'bootstrap/dist/css/bootstrap.min.css';
+import "./app.css";
+
+
+export function Layout({ children }: { children: React.ReactNode }) {
+ return (
+ <html lang="en" data-bs-theme="dark">
+ <head>
+ <meta charSet="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <link rel="icon" href="/logo.svg" />
+ <Meta />
+ <Links />
+ </head>
+ <body>
+ {children}
+ <ScrollRestoration />
+ <Scripts />
+ </body>
+ </html>
+ );
+}
+
+export default function App() {
+ return <Outlet />;
+}
\ No newline at end of file
diff --git a/frontend/app/routes.ts b/frontend/app/routes.ts
new file mode 100644
index 00000000..b533f58e
--- /dev/null
+++ b/frontend/app/routes.ts
@@ -0,0 +1,10 @@
+import { type RouteConfig } from "@react-router/dev/routes";
+import { flatRoutes } from "@react-router/fs-routes";
+
+export default [
+ ...(await flatRoutes()),
+ {
+ path: "/explore/*",
+ file: "routes/explore/route.tsx"
+ }
+] satisfies RouteConfig;
diff --git a/frontend/app/routes/_index/components/hamburger-menu/hamburger-menu.module.css b/frontend/app/routes/_index/components/hamburger-menu/hamburger-menu.module.css
new file mode 100644
index 00000000..8cd2f431
--- /dev/null
+++ b/frontend/app/routes/_index/components/hamburger-menu/hamburger-menu.module.css
@@ -0,0 +1,39 @@
+.container {
+ border-radius: 20px;
+ width: 40px;
+ height: 40px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-left: -5px;
+}
+
+@media not (pointer: coarse), (min-width: 900px) {
+ .container:hover {
+ background-color: #002b36;
+ cursor: pointer;
+ }
+}
+
+.container:active {
+ background-color: #073642;
+}
+
+.hamburger-icon {
+ background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M3 18v-2h18v2zm0-5v-2h18v2zm0-5V6h18v2z'/%3E%3C/svg%3E");
+ width: 30px;
+ height: 30px;
+}
+
+.close-icon {
+ background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z'/%3E%3C/svg%3E");
+ width: 30px;
+ height: 30px;
+}
+
+/* desktop */
+@media (min-width: 900px) {
+ .container {
+ display: none;
+ }
+}
\ No newline at end of file
diff --git a/frontend/app/routes/_index/components/hamburger-menu/hamburger-menu.module.css.d.ts b/frontend/app/routes/_index/components/hamburger-menu/hamburger-menu.module.css.d.ts
new file mode 100644
index 00000000..a3b24826
--- /dev/null
+++ b/frontend/app/routes/_index/components/hamburger-menu/hamburger-menu.module.css.d.ts
@@ -0,0 +1,7 @@
+declare const styles: {
+ readonly "close-icon": string;
+ readonly "container": string;
+ readonly "hamburger-icon": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/_index/components/hamburger-menu/hamburger-menu.tsx b/frontend/app/routes/_index/components/hamburger-menu/hamburger-menu.tsx
new file mode 100644
index 00000000..8d77b868
--- /dev/null
+++ b/frontend/app/routes/_index/components/hamburger-menu/hamburger-menu.tsx
@@ -0,0 +1,12 @@
+import styles from "./hamburger-menu.module.css"
+
+export type HamburgerMenuProps = {
+ isOpen: boolean
+ onClick: () => void,
+}
+
+export function HamburgerMenu(props: HamburgerMenuProps) {
+ const styleName = props.isOpen ? "close-icon" : "hamburger-icon";
+ const icon = <div className={styles[styleName]} onClick={props.onClick} />
+ return <div className={styles.container}>{icon}</div>
+}
\ No newline at end of file
diff --git a/frontend/app/routes/_index/components/layout/layout.module.css b/frontend/app/routes/_index/components/layout/layout.module.css
new file mode 100644
index 00000000..4f65e523
--- /dev/null
+++ b/frontend/app/routes/_index/components/layout/layout.module.css
@@ -0,0 +1,69 @@
+.container {
+ color: white;
+ font-family: helvetica;
+ max-width: 100%;
+ min-width: 100%;
+ min-height: 100%;
+ position: absolute;
+}
+
+.top-navigation {
+ background-color: var(--top-nav-background-color);
+ height: var(--top-nav-height);
+ position: fixed;
+ top: 0;
+ width: 100%;
+ z-index: 999;
+}
+
+.page {
+ max-width: 100%;
+ min-width: 100%;
+ min-height: 100%;
+ position: absolute;
+}
+
+.left-navigation {
+ background-color: var(--left-nav-background-color);
+ max-width: var(--left-nav-width);
+ min-width: var(--left-nav-width);
+ min-height: calc(100% - var(--top-nav-height));
+ position: fixed;
+ left: 0;
+ z-index: 999;
+ top: var(--top-nav-height);
+}
+
+.body {
+ top: var(--top-nav-height);
+ position: absolute;
+ left: var(--bodyLeft);
+ max-width: var(--width);
+ min-width: var(--width);
+ min-height: var(--height);
+ padding: var(--padding);
+ --bodyLeft: var(--left-nav-width);
+ --width: calc(100% - 2 * var(--padding) - var(--bodyLeft));
+ --height: calc(100% - 2 * var(--padding) - var(--top-nav-height));
+ --padding: 0px;
+}
+
+
+/* mobile */
+@media not (min-width: 900px) {
+ .left-navigation {
+ display: none;
+ }
+
+ .body {
+ --bodyLeft: 0px;
+ }
+
+ .container.hamburger-open .left-navigation {
+ display: block;
+ }
+
+ .container.hamburger-open .body {
+ filter: brightness(50%) blur(2px);
+ }
+}
\ No newline at end of file
diff --git a/frontend/app/routes/_index/components/layout/layout.module.css.d.ts b/frontend/app/routes/_index/components/layout/layout.module.css.d.ts
new file mode 100644
index 00000000..0aa6d94e
--- /dev/null
+++ b/frontend/app/routes/_index/components/layout/layout.module.css.d.ts
@@ -0,0 +1,10 @@
+declare const styles: {
+ readonly "body": string;
+ readonly "container": string;
+ readonly "hamburger-open": string;
+ readonly "left-navigation": string;
+ readonly "page": string;
+ readonly "top-navigation": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/_index/components/layout/layout.tsx b/frontend/app/routes/_index/components/layout/layout.tsx
new file mode 100644
index 00000000..8c0adeae
--- /dev/null
+++ b/frontend/app/routes/_index/components/layout/layout.tsx
@@ -0,0 +1,50 @@
+import { useState } from "react";
+import styles from "./layout.module.css";
+
+export type LayoutProps = {
+ topNavComponent: (props: RequiredTopNavProps) => React.ReactNode,
+ leftNavChild: React.ReactNode,
+ bodyChild: React.ReactNode,
+}
+
+export type RequiredTopNavProps = {
+ isHamburgerMenuOpen: boolean,
+ onHamburgerMenuClick: () => void,
+}
+
+export function Layout(props: LayoutProps) {
+ // data
+ const [isHamburgerMenuOpen, setIsHamburgerMenuOpen] = useState(false);
+
+ // events
+ const onHamburgerMenuClick = function () {
+ setIsHamburgerMenuOpen(!isHamburgerMenuOpen)
+ }
+
+ const onBodyClick = function() {
+ setIsHamburgerMenuOpen(false);
+ }
+
+ let containerClassName = styles["container"];
+ if (isHamburgerMenuOpen) containerClassName += " " + styles["hamburger-open"];
+
+ return (
+ <>
+ <div className={containerClassName}>
+ <div className={styles["top-navigation"]}>
+ <props.topNavComponent
+ isHamburgerMenuOpen={isHamburgerMenuOpen}
+ onHamburgerMenuClick={onHamburgerMenuClick} />
+ </div>
+ <div className={styles["page"]}>
+ <div className={styles["left-navigation"]}>
+ {props.leftNavChild}
+ </div>
+ <div className={styles["body"]} onClick={onBodyClick}>
+ {props.bodyChild}
+ </div>
+ </div>
+ </div>
+ </>
+ );
+}
\ No newline at end of file
diff --git a/frontend/app/routes/_index/components/left-navigation/left-navigation.module.css b/frontend/app/routes/_index/components/left-navigation/left-navigation.module.css
new file mode 100644
index 00000000..2c7b248c
--- /dev/null
+++ b/frontend/app/routes/_index/components/left-navigation/left-navigation.module.css
@@ -0,0 +1,110 @@
+.container {
+ padding: 20px;
+ padding-top: 30px;
+ color: #93a1a1;
+ position: absolute;
+ width: 100%;
+ min-height: 100%;
+}
+
+.unstyled {
+ all: unset;
+ width: 100%;
+}
+
+.item {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ gap: 10px;
+ border-radius: 10px;
+ padding: 10px;
+ margin-left: -10px;
+ margin-right: -10px;
+ text-decoration: unset;
+ color: inherit;
+}
+
+@media not (pointer: coarse), (min-width: 900px) {
+ .item:hover {
+ background-color: #002b36;
+ cursor: pointer;
+ }
+}
+
+.item:active {
+ background-color: #073642;
+}
+
+.queue-icon {
+ display: inline-block;
+ width: 22px;
+ height: 22px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%2393a1a1' d='M10 6h18v2H10zm0 6h18v2H10zm5 6h13v2H15zm-5 6h18v2H10zM4 14l7 5l-7 5z'/%3E%3C/svg%3E");
+}
+
+.explore-icon {
+ display: inline-block;
+ width: 22px;
+ height: 22px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2393a1a1' d='M2 4.75C2 3.784 2.784 3 3.75 3h4.971c.58 0 1.12.286 1.447.765l1.404 2.063a.25.25 0 0 0 .207.11h6.224c.966 0 1.75.783 1.75 1.75v.117H5.408a.848.848 0 0 0 0 1.695h15.484a1 1 0 0 1 .995 1.102L21 19.25c-.106 1.05-.784 1.75-1.75 1.75H3.75A1.75 1.75 0 0 1 2 19.25z'/%3E%3C/svg%3E");
+}
+
+.stream-icon {
+ display: inline-block;
+ width: 22px;
+ height: 22px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cdefs%3E%3Cmask id='ipSPlay0'%3E%3Cg fill='none' stroke-linejoin='round' stroke-width='4'%3E%3Cpath fill='%23fff' stroke='%23fff' d='M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4S4 12.954 4 24s8.954 20 20 20Z'/%3E%3Cpath fill='%23000' stroke='%23000' d='M20 24v-6.928l6 3.464L32 24l-6 3.464l-6 3.464z'/%3E%3C/g%3E%3C/mask%3E%3C/defs%3E%3Cpath fill='%2393a1a1' d='M0 0h48v48H0z' mask='url(%23ipSPlay0)'/%3E%3C/svg%3E");
+}
+
+.settings-icon {
+ display: inline-block;
+ width: 22px;
+ height: 22px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2393a1a1' d='M10.825 22q-.675 0-1.162-.45t-.588-1.1L8.85 18.8q-.325-.125-.612-.3t-.563-.375l-1.55.65q-.625.275-1.25.05t-.975-.8l-1.175-2.05q-.35-.575-.2-1.225t.675-1.075l1.325-1Q4.5 12.5 4.5 12.337v-.675q0-.162.025-.337l-1.325-1Q2.675 9.9 2.525 9.25t.2-1.225L3.9 5.975q.35-.575.975-.8t1.25.05l1.55.65q.275-.2.575-.375t.6-.3l.225-1.65q.1-.65.588-1.1T10.825 2h2.35q.675 0 1.163.45t.587 1.1l.225 1.65q.325.125.613.3t.562.375l1.55-.65q.625-.275 1.25-.05t.975.8l1.175 2.05q.35.575.2 1.225t-.675 1.075l-1.325 1q.025.175.025.338v.674q0 .163-.05.338l1.325 1q.525.425.675 1.075t-.2 1.225l-1.2 2.05q-.35.575-.975.8t-1.25-.05l-1.5-.65q-.275.2-.575.375t-.6.3l-.225 1.65q-.1.65-.587 1.1t-1.163.45zm1.225-6.5q1.45 0 2.475-1.025T15.55 12t-1.025-2.475T12.05 8.5q-1.475 0-2.488 1.025T8.55 12t1.013 2.475T12.05 15.5'/%3E%3C/svg%3E");
+}
+
+.title {
+ font-size: 20px;
+}
+
+.footer {
+ position: absolute;
+ padding: 20px;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+}
+
+.footer-item {
+ display: flex;
+ flex-direction: row;
+ gap: 5px;
+ align-items: center;
+}
+
+.github-icon {
+ display: inline-block;
+ width: 20px;
+ height: 20px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2393a1a1' d='M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2'/%3E%3C/svg%3E");
+}
+
+.logout-icon {
+ display: inline-block;
+ width: 22px;
+ height: 22px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2393a1a1' d='M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h6q.425 0 .713.288T12 4t-.288.713T11 5H5v14h6q.425 0 .713.288T12 20t-.288.713T11 21zm12.175-8H10q-.425 0-.712-.288T9 12t.288-.712T10 11h7.175L15.3 9.125q-.275-.275-.275-.675t.275-.7t.7-.313t.725.288L20.3 11.3q.3.3.3.7t-.3.7l-3.575 3.575q-.3.3-.712.288t-.713-.313q-.275-.3-.262-.712t.287-.688z'/%3E%3C/svg%3E");
+}
\ No newline at end of file
diff --git a/frontend/app/routes/_index/components/left-navigation/left-navigation.module.css.d.ts b/frontend/app/routes/_index/components/left-navigation/left-navigation.module.css.d.ts
new file mode 100644
index 00000000..8ace981d
--- /dev/null
+++ b/frontend/app/routes/_index/components/left-navigation/left-navigation.module.css.d.ts
@@ -0,0 +1,16 @@
+declare const styles: {
+ readonly "container": string;
+ readonly "explore-icon": string;
+ readonly "footer": string;
+ readonly "footer-item": string;
+ readonly "github-icon": string;
+ readonly "item": string;
+ readonly "logout-icon": string;
+ readonly "queue-icon": string;
+ readonly "settings-icon": string;
+ readonly "stream-icon": string;
+ readonly "title": string;
+ readonly "unstyled": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/_index/components/left-navigation/left-navigation.tsx b/frontend/app/routes/_index/components/left-navigation/left-navigation.tsx
new file mode 100644
index 00000000..7631e360
--- /dev/null
+++ b/frontend/app/routes/_index/components/left-navigation/left-navigation.tsx
@@ -0,0 +1,46 @@
+import { Form, Link } from "react-router";
+import styles from "./left-navigation.module.css";
+
+export type LefNavigationProps = {
+}
+
+
+export function LeftNavigation(props: LefNavigationProps) {
+ return (
+ <div className={styles.container}>
+ <Link className={styles.item} to={"/queue"}>
+ <div className={styles["queue-icon"]} />
+ <div className={styles.title}>Queue & History</div>
+ </Link>
+ <Link className={styles.item} to={"/explore"}>
+ <div className={styles["explore-icon"]} />
+ <div className={styles.title}>Dav Explore</div>
+ </Link>
+ <Link className={styles.item} to={"/settings"}>
+ <div className={styles["settings-icon"]} />
+ <div className={styles.title}>Settings</div>
+ </Link>
+
+ <div className={styles.footer}>
+ <div className={styles["footer-item"]}>
+ <div>github</div>
+ <div className={styles["github-icon"]} />
+ </div>
+ <div className={styles["footer-item"]}>
+ changelog
+ </div>
+ <div className={styles["footer-item"]}>
+ version: 0.2.0
+ </div>
+ <hr />
+ <Form method="post" action="/logout">
+ <input name="confirm" value="true" type="hidden" />
+ <button className={styles.unstyled + ' ' + styles.item} type="submit">
+ <div className={styles["logout-icon"]} />
+ <div className={styles.title}>Logout</div>
+ </button>
+ </Form>
+ </div>
+ </div>
+ );
+}
\ No newline at end of file
diff --git a/frontend/app/routes/_index/components/top-navigation/top-navigation.module.css b/frontend/app/routes/_index/components/top-navigation/top-navigation.module.css
new file mode 100644
index 00000000..72d9c02d
--- /dev/null
+++ b/frontend/app/routes/_index/components/top-navigation/top-navigation.module.css
@@ -0,0 +1,45 @@
+.container {
+ background-color: var(--top-nav-background-color);
+ display: flex;
+ align-items: center;
+ gap: 15px;
+
+ height: var(--top-nav-height);
+ padding: 0 var(--page-padding)
+}
+
+.title-container {
+ display: flex;
+ gap: 15px;
+ cursor: pointer;
+
+ /* touch area buffer */
+ padding: 10px;
+ margin: -10px;
+}
+
+.title {
+ color: white;
+ font-size: 1.5em;
+ font-style: normal;
+ font-weight: bold;
+}
+
+.logo {
+ height: 30px;
+ margin: auto;
+}
+
+/* mobile */
+@media (max-width: calc(899.999px)) {
+ .container {
+ justify-content: space-between;
+ }
+}
+
+/* if there's not enough space, hide the title */
+@media (max-width: 250px) {
+ .title {
+ display: none;
+ }
+}
\ No newline at end of file
diff --git a/frontend/app/routes/_index/components/top-navigation/top-navigation.module.css.d.ts b/frontend/app/routes/_index/components/top-navigation/top-navigation.module.css.d.ts
new file mode 100644
index 00000000..2fd7fdfd
--- /dev/null
+++ b/frontend/app/routes/_index/components/top-navigation/top-navigation.module.css.d.ts
@@ -0,0 +1,8 @@
+declare const styles: {
+ readonly "container": string;
+ readonly "logo": string;
+ readonly "title": string;
+ readonly "title-container": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/_index/components/top-navigation/top-navigation.tsx b/frontend/app/routes/_index/components/top-navigation/top-navigation.tsx
new file mode 100644
index 00000000..0de6b5de
--- /dev/null
+++ b/frontend/app/routes/_index/components/top-navigation/top-navigation.tsx
@@ -0,0 +1,22 @@
+import { memo } from "react";
+import type { RequiredTopNavProps } from "../layout/layout";
+import { useNavigate } from "react-router";
+import styles from "./top-navigation.module.css";
+import { HamburgerMenu } from "../hamburger-menu/hamburger-menu";
+
+export type TopNavigationProps = RequiredTopNavProps;
+
+export const TopNavigation = memo(function TopNavigation(props: TopNavigationProps) {
+ const { isHamburgerMenuOpen, onHamburgerMenuClick } = props;
+ const navigate = useNavigate();
+
+ return (
+ <div className={styles["container"]}>
+ <HamburgerMenu isOpen={isHamburgerMenuOpen} onClick={onHamburgerMenuClick} />
+ <div className={styles["title-container"]} onClick={() => navigate("/")}>
+ <img className={styles["logo"]} src="/logo.svg"></img>
+ <div className={styles["title"]}>Nzb DAV</div>
+ </div>
+ </div>
+ );
+});
\ No newline at end of file
diff --git a/frontend/app/routes/_index/route.tsx b/frontend/app/routes/_index/route.tsx
new file mode 100644
index 00000000..6878c6ce
--- /dev/null
+++ b/frontend/app/routes/_index/route.tsx
@@ -0,0 +1,10 @@
+import { redirect } from "react-router";
+import type { Route } from "./+types/route";
+import { sessionStorage } from "~/auth/authentication.server";
+
+export async function loader({ request }: Route.LoaderArgs) {
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ let user = session.get("user");
+ if (!user) return redirect("/login");
+ return redirect("/queue")
+}
\ No newline at end of file
diff --git a/frontend/app/routes/explore/breadcrumbs/breadcrumbs.module.css b/frontend/app/routes/explore/breadcrumbs/breadcrumbs.module.css
new file mode 100644
index 00000000..c8546914
--- /dev/null
+++ b/frontend/app/routes/explore/breadcrumbs/breadcrumbs.module.css
@@ -0,0 +1,53 @@
+.container {
+ display: flex;
+ flex-direction: row;
+ gap: 5px;
+ align-items: center;
+ flex-wrap: wrap;
+ margin-left: 16px;
+ margin-bottom: 32px;
+}
+
+.home-icon {
+ flex-shrink: 0;
+ display: inline-block;
+ width: 24px;
+ height: 24px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2393a1a1' d='M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8z'/%3E%3C/svg%3E");
+ transform: translateY(-1px);
+}
+
+.separator {
+ flex-shrink: 0;
+ display: inline-block;
+ width: 24px;
+ height: 24px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2393a1a1' d='M9.879 17.243a1 1 0 0 1-.707-1.707L12.707 12L9.172 8.464a1 1 0 0 1 1.414-1.414l4.242 4.243a1 1 0 0 1 0 1.414l-4.242 4.243a1 1 0 0 1-.707.293'/%3E%3C/svg%3E");
+}
+
+.directory:has(.home-icon) {
+ line-height: 0;
+}
+
+.directory {
+ border-radius: 10px;
+ padding: 7px 10px;
+ margin: -7px -10px;
+ word-break: break-all;
+ overflow-wrap: break-word;
+}
+
+@media not (pointer: coarse), (min-width: 900px) {
+ .directory:hover {
+ background-color: #002b36;
+ cursor: pointer;
+ }
+}
+
+.directory:active {
+ background-color: #073642;
+}
\ No newline at end of file
diff --git a/frontend/app/routes/explore/breadcrumbs/breadcrumbs.module.css.d.ts b/frontend/app/routes/explore/breadcrumbs/breadcrumbs.module.css.d.ts
new file mode 100644
index 00000000..29804f15
--- /dev/null
+++ b/frontend/app/routes/explore/breadcrumbs/breadcrumbs.module.css.d.ts
@@ -0,0 +1,8 @@
+declare const styles: {
+ readonly "container": string;
+ readonly "directory": string;
+ readonly "home-icon": string;
+ readonly "separator": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/explore/breadcrumbs/breadcrumbs.tsx b/frontend/app/routes/explore/breadcrumbs/breadcrumbs.tsx
new file mode 100644
index 00000000..367f70c6
--- /dev/null
+++ b/frontend/app/routes/explore/breadcrumbs/breadcrumbs.tsx
@@ -0,0 +1,32 @@
+import React from "react"
+import styles from "./breadcrumbs.module.css"
+import { useCallback } from "react"
+import { useNavigate } from "react-router"
+
+export type BreadcrumbProps = {
+ parentDirectories: string[]
+}
+
+export function Breadcrumbs({ parentDirectories }: BreadcrumbProps): React.ReactNode {
+ const navigate = useNavigate();
+ const onClick = useCallback((index: number) => {
+ if (index === -1) return navigate("/explore");
+ navigate(`/explore/${parentDirectories.slice(0, index + 1).join('/')}`)
+ }, [parentDirectories, navigate]);
+
+ return (
+ <div className={styles.container}>
+ <div className={styles.directory} onClick={() => onClick(-1)}>
+ <div className={styles["home-icon"]} />
+ </div>
+ {parentDirectories.map((parentDirectory, index) =>
+ <React.Fragment key={index}>
+ <div className={styles.separator} />
+ <div className={styles.directory} onClick={() => onClick(index)}>
+ {parentDirectory}
+ </div>
+ </React.Fragment>
+ )}
+ </div>
+ );
+}
\ No newline at end of file
diff --git a/frontend/app/routes/explore/route.module.css b/frontend/app/routes/explore/route.module.css
new file mode 100644
index 00000000..ad144c74
--- /dev/null
+++ b/frontend/app/routes/explore/route.module.css
@@ -0,0 +1,89 @@
+.container {
+ min-width: 100%;
+ min-height: 100%;
+ padding: 30px 35px 20px 35px;
+ color: #93a1a1;
+ font-size: 16px;
+}
+
+.item {
+ padding: 15px;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ gap: 15px;
+ border: 1px solid #ffffff20;
+ text-decoration: inherit;
+ color: inherit;
+}
+
+.item+.item {
+ border-top: none;
+}
+
+.item:first-of-type {
+ border-radius: 10px 10px 0 0;
+}
+
+.item:last-of-type {
+ border-radius: 0 0 10px 10px;
+}
+
+.item:first-of-type:last-of-type {
+ border-radius: 10px 10px 10px 10px;
+}
+
+@media not (pointer: coarse),
+(min-width: 900px) {
+ .item:hover {
+ background-color: #002b36;
+ cursor: pointer;
+ }
+}
+
+.item:active {
+ background-color: #073642;
+}
+
+.directory-icon {
+ flex-shrink: 0;
+ display: inline-block;
+ width: 40px;
+ height: 40px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2393a1a1' d='M2 4.75C2 3.784 2.784 3 3.75 3h4.971c.58 0 1.12.286 1.447.765l1.404 2.063a.25.25 0 0 0 .207.11h6.224c.966 0 1.75.783 1.75 1.75v.117H5.408a.848.848 0 0 0 0 1.695h15.484a1 1 0 0 1 .995 1.102L21 19.25c-.106 1.05-.784 1.75-1.75 1.75H3.75A1.75 1.75 0 0 1 2 19.25z'/%3E%3C/svg%3E");
+}
+
+.file-icon {
+ flex-shrink: 0;
+ display: inline-block;
+ width: 40px;
+ height: 40px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none'%3E%3Cpath d='m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z'/%3E%3Cpath fill='%2393a1a1' d='M12 2v6.5a1.5 1.5 0 0 0 1.356 1.493L13.5 10H20v10a2 2 0 0 1-1.85 1.995L18 22H6a2 2 0 0 1-1.995-1.85L4 20V4a2 2 0 0 1 1.85-1.995L6 2zm2 .043a2 2 0 0 1 .877.43l.123.113L19.414 7a2 2 0 0 1 .502.84l.04.16H14z'/%3E%3C/g%3E%3C/svg%3E");
+}
+
+.video-icon {
+ display: inline-block;
+ width: 40px;
+ height: 40px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%2393a1a1' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'%3E%3Cpath d='M39 6H9a3 3 0 0 0-3 3v30a3 3 0 0 0 3 3h30a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3'/%3E%3Cpath fill='%2393a1a1' d='M20.5 28v-6.062l5.25 3.03L31 28l-5.25 3.031l-5.25 3.031z'/%3E%3Cpath d='M6 15h36m-9-9l-6 9m-6-9l-6 9'/%3E%3C/g%3E%3C/svg%3E");
+}
+
+.image-icon {
+ display: inline-block;
+ width: 40px;
+ height: 35px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg fill='%2393a1a1'%3E%3Cpath d='M6.002 5.5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0'/%3E%3Cpath d='M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71l-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1z'/%3E%3C/g%3E%3C/svg%3E");
+}
+
+.item-name {
+ word-break: break-all;
+ overflow-wrap: break-word;
+}
\ No newline at end of file
diff --git a/frontend/app/routes/explore/route.module.css.d.ts b/frontend/app/routes/explore/route.module.css.d.ts
new file mode 100644
index 00000000..57332fd8
--- /dev/null
+++ b/frontend/app/routes/explore/route.module.css.d.ts
@@ -0,0 +1,11 @@
+declare const styles: {
+ readonly "container": string;
+ readonly "directory-icon": string;
+ readonly "file-icon": string;
+ readonly "image-icon": string;
+ readonly "item": string;
+ readonly "item-name": string;
+ readonly "video-icon": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/explore/route.tsx b/frontend/app/routes/explore/route.tsx
new file mode 100644
index 00000000..12e55679
--- /dev/null
+++ b/frontend/app/routes/explore/route.tsx
@@ -0,0 +1,102 @@
+import type { Route } from "./+types/route";
+import { Layout } from "../_index/components/layout/layout";
+import { TopNavigation } from "../_index/components/top-navigation/top-navigation";
+import { LeftNavigation } from "../_index/components/left-navigation/left-navigation";
+import { Breadcrumbs } from "./breadcrumbs/breadcrumbs";
+import styles from "./route.module.css"
+import { Link, redirect, useLocation, useNavigate } from "react-router";
+import { backendClient, type DirectoryItem } from "~/clients/backend-client.server";
+import { sessionStorage } from "~/auth/authentication.server";
+import { useCallback } from "react";
+import { lookup as getMimeType } from 'mime-types';
+import { getDownloadKey } from "~/auth/downloads.server";
+
+export type ExplorePageData = {
+ parentDirectories: string[],
+ items: (DirectoryItem | ExploreFile)[],
+}
+
+export type ExploreFile = DirectoryItem & {
+ mimeType: string,
+ downloadKey: string,
+}
+
+
+export async function loader({ request }: Route.LoaderArgs) {
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ let user = session.get("user");
+ if (!user) return redirect("/login");
+
+ let path = new URL(request.url).pathname;
+ if (path.startsWith("/")) path = path.slice(1);
+ if (path.startsWith("explore")) path = path.slice(7);
+ if (path.startsWith("/")) path = path.slice(1);
+
+ return {
+ parentDirectories: path == "" ? [] : path.split('/'),
+ items: (await backendClient.listWebdavDirectory(path)).map(x => {
+ if (x.isDirectory) return x;
+ return {
+ ...x,
+ mimeType: getMimeType(x.name),
+ downloadKey: getDownloadKey(`${path}/${x.name}`)
+ };
+ })
+ }
+}
+
+
+export default function Explore({ loaderData }: Route.ComponentProps) {
+ return (
+ <Layout
+ topNavComponent={TopNavigation}
+ bodyChild={<Body {...loaderData} />}
+ leftNavChild={<LeftNavigation />}
+ />
+ );
+}
+
+function Body({ parentDirectories, items }: ExplorePageData) {
+ const location = useLocation();
+ const navigate = useNavigate();
+
+ const getDirectoryPath = useCallback((directoryName: string) => {
+ return `${location.pathname}/${directoryName}`
+ }, [location.pathname, navigate]);
+
+ const getFilePath = useCallback((file: ExploreFile) => {
+ var pathname = location.pathname;
+ if (pathname.startsWith("/")) pathname = pathname.slice(1);
+ if (pathname.startsWith("explore")) pathname = pathname.slice(7);
+ if (pathname.startsWith("/")) pathname = pathname.slice(1);
+ return `/view/${pathname}/${file.name}?downloadKey=${file.downloadKey}`;
+ }, [location.pathname, navigate]);
+
+ return (
+ <div className={styles.container}>
+ <Breadcrumbs parentDirectories={parentDirectories} />
+ <div>
+ {items.filter(x => x.isDirectory).map((x, index) =>
+ <Link key={`${index}_dir_item`} to={getDirectoryPath(x.name)} className={styles.item}>
+ <div className={styles["directory-icon"]} />
+ <div className={styles["item-name"]}>{x.name}</div>
+ </Link>
+ )}
+ {items.filter(x => !x.isDirectory).map((x, index) =>
+ <a key={`${index}_file_item`} href={getFilePath(x as ExploreFile)} className={styles.item}>
+ <div className={getIcon(x as ExploreFile)} />
+ <div className={styles["item-name"]}>{x.name}</div>
+ </a>
+ )}
+ </div>
+ </div >
+ );
+}
+
+
+function getIcon(file: ExploreFile) {
+ if (file.name.toLowerCase().endsWith(".mkv")) return styles["video-icon"];
+ if (file.mimeType && file.mimeType.startsWith("video")) return styles["video-icon"];
+ if (file.mimeType && file.mimeType.startsWith("image")) return styles["image-icon"];
+ return styles["file-icon"];
+}
diff --git a/frontend/app/routes/login/route.module.css b/frontend/app/routes/login/route.module.css
new file mode 100644
index 00000000..b1389169
--- /dev/null
+++ b/frontend/app/routes/login/route.module.css
@@ -0,0 +1,27 @@
+.container {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 256px;
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ padding-bottom: 40px;
+}
+
+.logo {
+ height: 3.5em;
+}
+
+.title {
+ font-size: 2.5em;
+ font-style: normal;
+ font-weight: bold;
+ text-align: center;
+ margin-bottom: 15px;
+}
+
+.error {
+ margin: 0;
+}
\ No newline at end of file
diff --git a/frontend/app/routes/login/route.module.css.d.ts b/frontend/app/routes/login/route.module.css.d.ts
new file mode 100644
index 00000000..cb5b9f2f
--- /dev/null
+++ b/frontend/app/routes/login/route.module.css.d.ts
@@ -0,0 +1,8 @@
+declare const styles: {
+ readonly "container": string;
+ readonly "error": string;
+ readonly "logo": string;
+ readonly "title": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/login/route.tsx b/frontend/app/routes/login/route.tsx
new file mode 100644
index 00000000..00c3b03e
--- /dev/null
+++ b/frontend/app/routes/login/route.tsx
@@ -0,0 +1,61 @@
+import { Alert, Button, Form as BootstrapForm } from "react-bootstrap";
+import styles from "./route.module.css"
+import type { Route } from "./+types/route";
+import { authenticate, sessionStorage } from "~/auth/authentication.server";
+import { Form, redirect, useNavigation } from "react-router";
+import { backendClient } from "~/clients/backend-client.server";
+
+type LoginPageData = {
+ loginError: string
+}
+
+export async function loader({ request }: Route.LoaderArgs) {
+ // if already logged in, redirect to landing page
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ let user = session.get("user");
+ if (user) return redirect("/");
+
+ // if we need to go through onboarding, redirect to onboarding page
+ const isOnboarding = await backendClient.isOnboarding();
+ if (isOnboarding) return redirect("/onboarding");
+
+ // otherwise, proceed to login page!
+ return { loginError: null };
+}
+
+export default function Index({ loaderData, actionData }: Route.ComponentProps) {
+ const navigation = useNavigation();
+ const isLoading = navigation.state == "submitting";
+ const pageData = actionData || loaderData;
+ const showError = !!pageData.loginError;
+ const submitButtonDisabled = isLoading;
+ const submitButtonText = isLoading ? "Logging in..." : "Login";
+
+ return (
+ <>
+ <Form className={styles["container"]} method="POST">
+ <img className={styles["logo"]} src="/logo.svg"></img>
+ <div className={styles["title"]}>Nzb DAV</div>
+ <Alert className={styles["error"]} show={showError} variant="danger">{pageData.loginError}</Alert>
+ <BootstrapForm.Control name="username" type="text" placeholder="Username" autoFocus />
+ <BootstrapForm.Control name="password" type="password" placeholder="Password" />
+ <Button type="submit" variant="primary" disabled={submitButtonDisabled}>{submitButtonText}</Button>
+ </Form>
+ </>
+ );
+}
+
+export async function action({ request }: Route.ActionArgs) {
+ try {
+ let user = await authenticate(request);
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ session.set("user", user);
+ return redirect("/", { headers: { "Set-Cookie": await sessionStorage.commitSession(session) } });
+ }
+ catch (error) {
+ if (error instanceof Error) {
+ return { loginError: error.message };
+ }
+ throw error;
+ }
+}
\ No newline at end of file
diff --git a/frontend/app/routes/logout/route.tsx b/frontend/app/routes/logout/route.tsx
new file mode 100644
index 00000000..4ad55774
--- /dev/null
+++ b/frontend/app/routes/logout/route.tsx
@@ -0,0 +1,19 @@
+import type { Route } from "./+types/route";
+import { sessionStorage } from "~/auth/authentication.server";
+import { redirect } from "react-router";
+
+export async function action({ request }: Route.ActionArgs) {
+ // if already logged out, redirect to login page
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ let user = session.get("user");
+ if (!user) return redirect("/login");
+
+ // if we logout intent is not confirmed, redirect to landing page
+ const formData = await request.formData();
+ const confirm = formData.get("confirm")?.toString();
+ if (confirm !== "true") return redirect("/");
+
+ // otherwise, proceed to log out!
+ session.unset("user");
+ return redirect("/login", { headers: { "Set-Cookie": await sessionStorage.commitSession(session) } });
+}
\ No newline at end of file
diff --git a/frontend/app/routes/onboarding/route.module.css b/frontend/app/routes/onboarding/route.module.css
new file mode 100644
index 00000000..d72a43ee
--- /dev/null
+++ b/frontend/app/routes/onboarding/route.module.css
@@ -0,0 +1,28 @@
+.container {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 300px;
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ padding-bottom: 80px;
+}
+
+.logo {
+ height: 3.5em;
+}
+
+.title {
+ font-size: 2.5em;
+ font-style: normal;
+ font-weight: bold;
+ text-align: center;
+ margin-bottom: 15px;
+}
+
+.alert {
+ margin: 0;
+ margin-bottom: 30px;
+}
\ No newline at end of file
diff --git a/frontend/app/routes/onboarding/route.module.css.d.ts b/frontend/app/routes/onboarding/route.module.css.d.ts
new file mode 100644
index 00000000..dd8c8e63
--- /dev/null
+++ b/frontend/app/routes/onboarding/route.module.css.d.ts
@@ -0,0 +1,8 @@
+declare const styles: {
+ readonly "alert": string;
+ readonly "container": string;
+ readonly "logo": string;
+ readonly "title": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/onboarding/route.tsx b/frontend/app/routes/onboarding/route.tsx
new file mode 100644
index 00000000..b3b0c8d0
--- /dev/null
+++ b/frontend/app/routes/onboarding/route.tsx
@@ -0,0 +1,115 @@
+import { Alert, Button, Form as BootstrapForm } from "react-bootstrap";
+import styles from "./route.module.css"
+import type { Route } from "./+types/route";
+import { useState } from "react";
+import { backendClient } from "~/clients/backend-client.server";
+import { Form, redirect, useNavigation } from "react-router";
+import { sessionStorage } from "~/auth/authentication.server";
+
+type OnboardingPageData = {
+ error: string
+}
+
+export async function loader({ request }: Route.LoaderArgs) {
+ // if already logged in, redirect to landing page
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ let user = session.get("user");
+ if (user) return redirect("/");
+
+ // if we don't need to go through onboarding, redirect to login page
+ const isOnboarding = await backendClient.isOnboarding();
+ if (!isOnboarding) return redirect("/login");
+
+ // otherwise, proceed to onboarding page!
+ return { error: null };
+}
+
+export default function Index({ loaderData, actionData }: Route.ComponentProps) {
+ var pageData = actionData || loaderData;
+ const [username, setUsername] = useState("");
+ const [password, setPassword] = useState("");
+ const [confirmPassword, setConfirmPassword] = useState("");
+
+ const navigation = useNavigation();
+ const isLoading = navigation.state == "submitting";
+
+ var submitButtonDisabled = false;
+ var submitButtonText = "Register";
+ if (isLoading) {
+ submitButtonDisabled = true;
+ submitButtonText = "Registering...";
+ } else if (username == "") {
+ submitButtonDisabled = true;
+ submitButtonText = "Username is required";
+ } else if (password === "") {
+ submitButtonDisabled = true;
+ submitButtonText = "Password is required";
+ } else if (password != confirmPassword) {
+ submitButtonDisabled = true;
+ submitButtonText = "Passwords must match";
+ }
+
+ return (
+ <>
+ <Form className={styles["container"]} method="POST">
+ <img className={styles["logo"]} src="/logo.svg"></img>
+ <div className={styles["title"]}>Nzb DAV</div>
+ {pageData.error &&
+ <Alert className={styles["alert"]} variant="danger">
+ {pageData.error}
+ </Alert>
+ }
+ {!pageData.error &&
+ <Alert className={styles["alert"]} variant="warning">
+ <p style={{ marginBottom: "5px" }}>Welcome!</p>
+ Register your admin account.
+ </Alert>
+ }
+ <BootstrapForm.Control
+ autoFocus
+ name="username"
+ type="text"
+ placeholder="Username"
+ value={username}
+ onChange={e => setUsername(e.currentTarget.value)} />
+ <BootstrapForm.Control
+ name="password"
+ type="password"
+ placeholder="Password"
+ value={password}
+ onChange={e => setPassword(e.currentTarget.value)} />
+ <BootstrapForm.Control
+ type="password"
+ placeholder="Confirm Password"
+ value={confirmPassword}
+ onChange={e => setConfirmPassword(e.currentTarget.value)} />
+ <Button
+ type="submit"
+ variant="primary"
+ disabled={submitButtonDisabled}>
+ {submitButtonText}
+ </Button>
+ </Form>
+ </>
+ );
+}
+
+export async function action({ request }: Route.ActionArgs) {
+ try {
+ const formData = await request.formData();
+ const username = formData.get("username")?.toString();
+ const password = formData.get("password")?.toString();
+ if (!username || !password) throw new Error("username and password required");
+ var isSuccess = await backendClient.createAccount(username, password);
+ if (!isSuccess) throw new Error("Unknown error creating account");
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ session.set("user", { username: username });
+ return redirect("/", { headers: { "Set-Cookie": await sessionStorage.commitSession(session) } });
+ }
+ catch (error) {
+ if (error instanceof Error) {
+ return { error: error.message };
+ }
+ throw error
+ }
+}
\ No newline at end of file
diff --git a/frontend/app/routes/queue/components/empty-queue/empty-queue.module.css b/frontend/app/routes/queue/components/empty-queue/empty-queue.module.css
new file mode 100644
index 00000000..37021e6f
--- /dev/null
+++ b/frontend/app/routes/queue/components/empty-queue/empty-queue.module.css
@@ -0,0 +1,43 @@
+.container {
+ border-radius: 10px;
+ min-height: 300px;
+ border: 1px solid #586e75;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+}
+
+@media not (pointer: coarse), (min-width: 900px) {
+ .container:hover {
+ background-color: #ffffff08;
+ cursor: pointer;
+ }
+}
+
+.container:active {
+ background-color: #ffffff10;
+}
+
+.upload-icon {
+ display: inline-block;
+ width: 48px;
+ height: 48px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23586e75' fill-rule='evenodd' d='M12 3a1 1 0 0 1 .78.375l4 5a1 1 0 1 1-1.56 1.25L13 6.85V14a1 1 0 1 1-2 0V6.85L8.78 9.626a1 1 0 1 1-1.56-1.25l4-5A1 1 0 0 1 12 3M9 14v-1H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-4v1a3 3 0 1 1-6 0m8 2a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2z' clip-rule='evenodd'/%3E%3C/svg%3E");
+}
+
+.drop-icon {
+ display: inline-block;
+ width: 48px;
+ height: 48px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M24 0v24H0V0zM12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z'/%3E%3Cpath fill='%23586e75' d='M5.94 5.94a1.5 1.5 0 0 1 2.12 0L12 9.878l3.94-3.94a1.5 1.5 0 0 1 2.12 2.122l-5 5a1.5 1.5 0 0 1-2.12 0l-5-5a1.5 1.5 0 0 1 0-2.122Zm0 6a1.5 1.5 0 0 1 2.12 0L12 15.878l3.94-3.94a1.5 1.5 0 0 1 2.12 2.122l-5 5a1.5 1.5 0 0 1-2.12 0l-5-5a1.5 1.5 0 0 1 0-2.122Z'/%3E%3C/g%3E%3C/svg%3E");
+}
+
+.drag-active {
+ background-color: #073642;
+ border: 1px solid #073642;
+}
\ No newline at end of file
diff --git a/frontend/app/routes/queue/components/empty-queue/empty-queue.module.css.d.ts b/frontend/app/routes/queue/components/empty-queue/empty-queue.module.css.d.ts
new file mode 100644
index 00000000..2c221916
--- /dev/null
+++ b/frontend/app/routes/queue/components/empty-queue/empty-queue.module.css.d.ts
@@ -0,0 +1,8 @@
+declare const styles: {
+ readonly "container": string;
+ readonly "drag-active": string;
+ readonly "drop-icon": string;
+ readonly "upload-icon": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/queue/components/empty-queue/empty-queue.tsx b/frontend/app/routes/queue/components/empty-queue/empty-queue.tsx
new file mode 100644
index 00000000..32e0dde6
--- /dev/null
+++ b/frontend/app/routes/queue/components/empty-queue/empty-queue.tsx
@@ -0,0 +1,58 @@
+import { useCallback, useRef } from "react";
+import styles from "./empty-queue.module.css"
+import { useDropzone, type FileWithPath } from 'react-dropzone'
+import { className } from "~/utils/styling";
+import { useFetcher } from "react-router";
+
+export function EmptyQueue() {
+ const fetcher = useFetcher();
+ const formRef = useRef<HTMLFormElement>(null);
+ const inputRef = useRef<HTMLInputElement>(null);
+ const isSubmitting = (fetcher.state === 'submitting');
+
+ const { getRootProps, getInputProps, isDragActive } = useDropzone({
+ accept: { 'application/x-nzb': ['.nzb'] },
+ onDrop: useCallback((acceptedFiles: FileWithPath[]) => {
+ const dataTransfer = new DataTransfer();
+ acceptedFiles.forEach((file) => {
+ const newFile = new File([file], file.name, {
+ type: 'application/x-nzb',
+ lastModified: file.lastModified,
+ });
+ dataTransfer.items.add(newFile);
+ });
+ if (inputRef?.current) {
+ inputRef.current.files = dataTransfer.files;
+ fetcher.submit(formRef.current);
+ }
+ }, [])
+ });
+
+ return (
+ <fetcher.Form ref={formRef} method="POST" encType="multipart/form-data">
+ <div {...className([styles.container, isDragActive && styles["drag-active"]])} {...getRootProps()}>
+ <input {...getInputProps()} />
+ <input ref={inputRef} name="nzbFile" type="file" style={{ display: 'none' }} />
+
+ {isSubmitting && <>
+ <div>Uploading...</div>
+ </>}
+
+ {/* default view */}
+ {!isSubmitting && !isDragActive && <>
+ <div className={styles["upload-icon"]}></div>
+ <br />
+ <div>Queue is empty.</div>
+ <div>Upload an *.nzb file</div>
+ </>}
+
+ {/* when dragging a file */}
+ {!isSubmitting && isDragActive && <>
+ <div className={styles["drop-icon"]}></div>
+ <br />
+ <div>Drop your *.nzb file</div>
+ </>}
+ </div>
+ </fetcher.Form>
+ );
+}
\ No newline at end of file
diff --git a/frontend/app/routes/queue/components/history-table/history-table.module.css b/frontend/app/routes/queue/components/history-table/history-table.module.css
new file mode 100644
index 00000000..03ee91d4
--- /dev/null
+++ b/frontend/app/routes/queue/components/history-table/history-table.module.css
@@ -0,0 +1,41 @@
+.first-table-header {
+ padding-left: 15px !important;
+ border-radius: 10px 0 0 0;
+}
+
+.table-header {
+ text-align: center;
+}
+
+.last-table-header {
+ border-radius: 0 10px 0 0;
+ text-align: center;
+}
+
+.row-title {
+ max-width: 200px;
+ color: #93a1a1 !important;
+ --bs-table-bg: transparent;
+ padding: 15px 0 !important;
+ padding-left: 15px !important;
+}
+
+
+.truncate {
+ word-break: break-all;
+ line-clamp: 1;
+ -webkit-line-clamp: 1;
+ -webkit-box-orient: vertical;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ overflow: hidden;
+}
+
+.row-column {
+ max-width: 200px;
+ --bs-table-bg: transparent;
+ color: #93a1a1 !important;
+ text-align: center;
+ vertical-align: middle;
+ white-space: nowrap;
+}
\ No newline at end of file
diff --git a/frontend/app/routes/queue/components/history-table/history-table.module.css.d.ts b/frontend/app/routes/queue/components/history-table/history-table.module.css.d.ts
new file mode 100644
index 00000000..79e9ac84
--- /dev/null
+++ b/frontend/app/routes/queue/components/history-table/history-table.module.css.d.ts
@@ -0,0 +1,10 @@
+declare const styles: {
+ readonly "first-table-header": string;
+ readonly "last-table-header": string;
+ readonly "row-column": string;
+ readonly "row-title": string;
+ readonly "table-header": string;
+ readonly "truncate": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/queue/components/history-table/history-table.tsx b/frontend/app/routes/queue/components/history-table/history-table.tsx
new file mode 100644
index 00000000..9860e196
--- /dev/null
+++ b/frontend/app/routes/queue/components/history-table/history-table.tsx
@@ -0,0 +1,44 @@
+import type { HistoryResponse } from "~/clients/backend-client.server"
+import styles from "./history-table.module.css"
+import { Table } from "react-bootstrap"
+import { CategoryBadge, formatFileSize, StatusBadge } from "../queue-table/queue-table"
+
+export type HistoryTableProps = {
+ history: HistoryResponse
+}
+
+export function HistoryTable({ history }: HistoryTableProps) {
+
+ return (
+ <Table responsive>
+ <thead>
+ <tr>
+ <th className={styles["first-table-header"]}>Name</th>
+ <th className={styles["table-header"]}>Category</th>
+ <th className={styles["table-header"]}>Status</th>
+ <th className={styles["last-table-header"]}>Size</th>
+ </tr>
+ </thead>
+ <tbody>
+ {history.slots.map((slot, index) =>
+ <tr key={index}>
+ <td className={styles["row-title"]}>
+ <div className={styles.truncate}>
+ {slot.name}
+ </div>
+ </td>
+ <td className={styles["row-column"]}>
+ <CategoryBadge category={slot.category} />
+ </td>
+ <td className={styles["row-column"]}>
+ <StatusBadge status={slot.status} error={slot.fail_message} />
+ </td>
+ <td className={styles["row-column"]}>
+ {formatFileSize(slot.bytes)}
+ </td>
+ </tr>
+ )}
+ </tbody>
+ </Table>
+ );
+}
\ No newline at end of file
diff --git a/frontend/app/routes/queue/components/queue-table/queue-table.module.css b/frontend/app/routes/queue/components/queue-table/queue-table.module.css
new file mode 100644
index 00000000..59dc9a3b
--- /dev/null
+++ b/frontend/app/routes/queue/components/queue-table/queue-table.module.css
@@ -0,0 +1,47 @@
+.first-table-header {
+ padding-left: 15px !important;
+ border-radius: 10px 0 0 0;
+}
+
+.table-header {
+ text-align: center;
+}
+
+.last-table-header {
+ border-radius: 0 10px 0 0;
+ text-align: center;
+}
+
+.row-title {
+ max-width: 200px;
+ color: #93a1a1 !important;
+ --bs-table-bg: transparent;
+ padding: 15px 0 !important;
+ padding-left: 15px !important;
+}
+
+
+.truncate {
+ word-break: break-all;
+ line-clamp: 1;
+ -webkit-line-clamp: 1;
+ -webkit-box-orient: vertical;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ overflow: hidden;
+}
+
+.row-column {
+ max-width: 200px;
+ --bs-table-bg: transparent;
+ color: #93a1a1 !important;
+ text-align: center;
+ vertical-align: middle;
+ white-space: nowrap;
+}
+
+@media not (pointer: coarse), (min-width: 900px) {
+ .failure-badge:hover {
+ cursor: pointer;
+ }
+}
\ No newline at end of file
diff --git a/frontend/app/routes/queue/components/queue-table/queue-table.module.css.d.ts b/frontend/app/routes/queue/components/queue-table/queue-table.module.css.d.ts
new file mode 100644
index 00000000..8b242eda
--- /dev/null
+++ b/frontend/app/routes/queue/components/queue-table/queue-table.module.css.d.ts
@@ -0,0 +1,11 @@
+declare const styles: {
+ readonly "first-table-header": string;
+ readonly "last-table-header": string;
+ readonly "row-column": string;
+ readonly "row-title": string;
+ readonly "table-header": string;
+ readonly "truncate": string;
+ readonly "failure-badge": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/queue/components/queue-table/queue-table.tsx b/frontend/app/routes/queue/components/queue-table/queue-table.tsx
new file mode 100644
index 00000000..67c5e362
--- /dev/null
+++ b/frontend/app/routes/queue/components/queue-table/queue-table.tsx
@@ -0,0 +1,80 @@
+import type { QueueResponse } from "~/clients/backend-client.server"
+import styles from "./queue-table.module.css"
+import { Badge, OverlayTrigger, Table, Tooltip } from "react-bootstrap"
+
+export type QueueTableProps = {
+ queue: QueueResponse
+}
+
+export function QueueTable({ queue }: QueueTableProps) {
+ return (
+ <Table responsive>
+ <thead>
+ <tr>
+ <th className={styles["first-table-header"]}>FileName</th>
+ <th className={styles["table-header"]}>Category</th>
+ <th className={styles["table-header"]}>Status</th>
+ <th className={styles["last-table-header"]}>Size</th>
+ </tr>
+ </thead>
+ <tbody>
+ {queue.slots.map((slot, index) =>
+ <tr key={index}>
+ <td className={styles["row-title"]}>
+ <div className={styles.truncate}>
+ {slot.filename}
+ </div>
+ </td>
+ <td className={styles["row-column"]}>
+ <CategoryBadge category={slot.cat} />
+ </td>
+ <td className={styles["row-column"]}>
+ <StatusBadge status={slot.status} />
+ </td>
+ <td className={styles["row-column"]}>
+ {formatFileSize(Number(slot.mb) * 1024 * 1024)}
+ </td>
+ </tr>
+ )}
+ </tbody>
+ </Table>
+ );
+}
+
+export function CategoryBadge({ category }: { category: string }) {
+ const categoryLower = category?.toLowerCase();
+ let variant = 'secondary';
+ if (categoryLower === 'movies') variant = 'primary';
+ if (categoryLower === 'tv') variant = 'info';
+ return <Badge bg={variant}>{categoryLower}</Badge>
+}
+
+export function StatusBadge({ status, error }: { status: string, error?: string }) {
+ const statusLower = status?.toLowerCase();
+ let variant = "secondary";
+ if (statusLower === "completed") variant = "success";
+ if (statusLower === "failed") variant = "danger";
+ if (statusLower === "downloading") variant = "primary";
+
+ if (error?.startsWith("Article with message-id")) error = "Missing articles";
+ const badgeClass = statusLower === "failed" ? styles["failure-badge"] : "";
+ const overlay = statusLower == "failed"
+ ? <Tooltip>{error}</Tooltip>
+ : <></>;
+
+ return (
+ <OverlayTrigger placement="top" overlay={overlay} trigger="click">
+ <Badge bg={variant} className={badgeClass}>{statusLower}</Badge>
+ </OverlayTrigger>
+ );
+}
+
+export function formatFileSize(bytes: number) {
+ var suffix = "B";
+ if (bytes >= 1024) { bytes /= 1024; suffix = "KB"; }
+ if (bytes >= 1024) { bytes /= 1024; suffix = "MB"; }
+ if (bytes >= 1024) { bytes /= 1024; suffix = "GB"; }
+ if (bytes >= 1024) { bytes /= 1024; suffix = "TB"; }
+ if (bytes >= 1024) { bytes /= 1024; suffix = "PB"; }
+ return `${bytes.toFixed(2)} ${suffix}`;
+}
\ No newline at end of file
diff --git a/frontend/app/routes/queue/route.module.css b/frontend/app/routes/queue/route.module.css
new file mode 100644
index 00000000..4ef9a8e6
--- /dev/null
+++ b/frontend/app/routes/queue/route.module.css
@@ -0,0 +1,17 @@
+.container {
+ min-width: 100%;
+ min-height: 100%;
+ padding: 30px 35px 20px 35px;
+ color: #93a1a1;
+ font-size: 14px;
+}
+
+.section {
+ margin-bottom: 50px;
+}
+
+.section-title {
+ margin-bottom: 30px;
+}
+
+.section-body {}
\ No newline at end of file
diff --git a/frontend/app/routes/queue/route.module.css.d.ts b/frontend/app/routes/queue/route.module.css.d.ts
new file mode 100644
index 00000000..82813f8f
--- /dev/null
+++ b/frontend/app/routes/queue/route.module.css.d.ts
@@ -0,0 +1,8 @@
+declare const styles: {
+ readonly "container": string;
+ readonly "section": string;
+ readonly "section-body": string;
+ readonly "section-title": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/queue/route.tsx b/frontend/app/routes/queue/route.tsx
new file mode 100644
index 00000000..27f3e603
--- /dev/null
+++ b/frontend/app/routes/queue/route.tsx
@@ -0,0 +1,96 @@
+import { redirect } from "react-router";
+import type { Route } from "./+types/route";
+import { sessionStorage } from "~/auth/authentication.server";
+import { Layout } from "../_index/components/layout/layout";
+import { TopNavigation } from "../_index/components/top-navigation/top-navigation";
+import { LeftNavigation } from "../_index/components/left-navigation/left-navigation";
+import styles from "./route.module.css"
+import { Alert } from 'react-bootstrap';
+import { backendClient, type HistoryResponse, type QueueResponse } from "~/clients/backend-client.server";
+import { EmptyQueue } from "./components/empty-queue/empty-queue";
+import { HistoryTable } from "./components/history-table/history-table";
+import { QueueTable } from "./components/queue-table/queue-table";
+
+type BodyProps = {
+ loaderData: { queue: QueueResponse, history: HistoryResponse },
+ actionData: { error: string } | undefined
+};
+
+export async function loader({ request }: Route.LoaderArgs) {
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ let user = session.get("user");
+ if (!user) return redirect("/login");
+
+ var queuePromise = backendClient.getQueue();
+ var historyPromise = backendClient.getHistory();
+ var queue = await queuePromise;
+ var history = await historyPromise;
+ return {
+ queue: queue,
+ history: history,
+ }
+}
+
+export default function Queue(props: Route.ComponentProps) {
+ return (
+ <Layout
+ topNavComponent={TopNavigation}
+ bodyChild={<Body loaderData={props.loaderData} actionData={props.actionData} />}
+ leftNavChild={<LeftNavigation />}
+ />
+ );
+}
+
+function Body({ loaderData, actionData }: BodyProps) {
+ const { queue, history } = loaderData;
+ return (
+ <div className={styles.container}>
+ {/* queue */}
+ <div className={styles.section}>
+ <h3 className={styles["section-title"]}>
+ Queue
+ </h3>
+ <div className={styles["section-body"]}>
+ {/* error message */}
+ {actionData?.error &&
+ <Alert variant="danger">
+ {actionData?.error}
+ </Alert>
+ }
+ {queue.slots.length > 0 ? <QueueTable queue={queue} /> : <EmptyQueue />}
+ </div>
+ </div>
+
+ {/* history */}
+ <div className={styles.section}>
+ <h3 className={styles["section-title"]}>
+ History
+ </h3>
+ <div className={styles["section-body"]}>
+ <HistoryTable history={history} />
+ </div>
+ </div>
+ </div>
+ );
+}
+
+export async function action({ request }: Route.ActionArgs) {
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ let user = session.get("user");
+ if (!user) return redirect("/login");
+
+ try {
+ const formData = await request.formData();
+ const nzbFile = formData.get("nzbFile");
+ if (nzbFile instanceof File) {
+ await backendClient.addNzb(nzbFile);
+ } else {
+ return { error: "Error uploading nzb." }
+ }
+ } catch (error) {
+ if (error instanceof Error) {
+ return { error: error.message };
+ }
+ throw error;
+ }
+}
\ No newline at end of file
diff --git a/frontend/app/routes/quick-stream/route.tsx b/frontend/app/routes/quick-stream/route.tsx
new file mode 100644
index 00000000..add08d9b
--- /dev/null
+++ b/frontend/app/routes/quick-stream/route.tsx
@@ -0,0 +1,21 @@
+import type { Route } from "./+types/route";
+import { Layout } from "../_index/components/layout/layout";
+import { TopNavigation } from "../_index/components/top-navigation/top-navigation";
+import { LeftNavigation } from "../_index/components/left-navigation/left-navigation";
+
+
+export default function QuickStream(props: Route.ComponentProps) {
+ return (
+ <Layout
+ topNavComponent={TopNavigation}
+ bodyChild={<Body />}
+ leftNavChild={<LeftNavigation />}
+ />
+ );
+}
+
+function Body() {
+ return (
+ <div>QUICK STREAM</div>
+ );
+}
diff --git a/frontend/app/routes/settings.test-usenet-connection/route.tsx b/frontend/app/routes/settings.test-usenet-connection/route.tsx
new file mode 100644
index 00000000..05550d1b
--- /dev/null
+++ b/frontend/app/routes/settings.test-usenet-connection/route.tsx
@@ -0,0 +1,20 @@
+import type { Route } from "./+types/route";
+import { backendClient } from "~/clients/backend-client.server";
+import { redirect } from "react-router";
+import { sessionStorage } from "~/auth/authentication.server";
+
+export async function action({ request }: Route.ActionArgs) {
+ // ensure user is logged in
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ let user = session.get("user");
+ if (!user) return redirect("/login");
+
+ const formData = await request.formData();
+ return await backendClient.testUsenetConnection({
+ host: formData.get("host")!.toString(),
+ port: formData.get("port")!.toString(),
+ useSsl: formData.get("use-ssl")!.toString(),
+ user: formData.get("user")!.toString(),
+ pass: formData.get("pass")!.toString(),
+ });
+}
\ No newline at end of file
diff --git a/frontend/app/routes/settings.update/route.tsx b/frontend/app/routes/settings.update/route.tsx
new file mode 100644
index 00000000..df64c257
--- /dev/null
+++ b/frontend/app/routes/settings.update/route.tsx
@@ -0,0 +1,27 @@
+import type { Route } from "./+types/route";
+import { backendClient, type ConfigItem } from "~/clients/backend-client.server";
+import { redirect } from "react-router";
+import { sessionStorage } from "~/auth/authentication.server";
+
+export async function action({ request }: Route.ActionArgs) {
+ // ensure user is logged in
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ let user = session.get("user");
+ if (!user) return redirect("/login");
+
+ // get the ConfigItems to update
+ const formData = await request.formData();
+ const configJson = formData.get("config")!.toString();
+ const config = JSON.parse(configJson);
+ const configItems: ConfigItem[] = [];
+ for (const [key, value] of Object.entries<string>(config)) {
+ configItems.push({
+ configName: key,
+ configValue: value
+ })
+ }
+
+ // update the config items
+ await backendClient.updateConfig(configItems);
+ return { config: config }
+}
\ No newline at end of file
diff --git a/frontend/app/routes/settings/route.module.css b/frontend/app/routes/settings/route.module.css
new file mode 100644
index 00000000..23ad78a5
--- /dev/null
+++ b/frontend/app/routes/settings/route.module.css
@@ -0,0 +1,18 @@
+.container {
+ min-width: 100%;
+ min-height: 100%;
+ padding: 30px 35px 20px 35px;
+ color: #93a1a1;
+ font-size: 16px;
+}
+
+.tabs {
+ --bs-nav-tabs-link-active-bg: #002b36;
+ --bs-nav-link-color: #93a1a1;
+ --bs-nav-link-hover-color: #93a1a1;
+ margin-bottom: 25px;
+}
+
+.button {
+ margin-right: 10px;
+}
\ No newline at end of file
diff --git a/frontend/app/routes/settings/route.module.css.d.ts b/frontend/app/routes/settings/route.module.css.d.ts
new file mode 100644
index 00000000..598e4bc1
--- /dev/null
+++ b/frontend/app/routes/settings/route.module.css.d.ts
@@ -0,0 +1,7 @@
+declare const styles: {
+ readonly "container": string;
+ readonly "tabs": string;
+ readonly "button": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/settings/route.tsx b/frontend/app/routes/settings/route.tsx
new file mode 100644
index 00000000..69d69c02
--- /dev/null
+++ b/frontend/app/routes/settings/route.tsx
@@ -0,0 +1,151 @@
+import type { Route } from "./+types/route";
+import { Layout } from "../_index/components/layout/layout";
+import { TopNavigation } from "../_index/components/top-navigation/top-navigation";
+import { LeftNavigation } from "../_index/components/left-navigation/left-navigation";
+import styles from "./route.module.css"
+import { Tabs, Tab, Button } from "react-bootstrap"
+import { backendClient, type ConfigItem } from "~/clients/backend-client.server";
+import { redirect } from "react-router";
+import { sessionStorage } from "~/auth/authentication.server";
+import { isUsenetSettingsUpdated, UsenetSettings } from "./usenet/usenet";
+import React from "react";
+import { isSabnzbdSettingsUpdated, isSabnzbdSettingsValid, SabnzbdSettings } from "./sabnzbd/sabnzbd";
+import { isWebdavSettingsUpdated, isWebdavSettingsValid, WebdavSettings } from "./webdav/webdav";
+
+const defaultConfig = {
+ "api.key": "",
+ "api.categories": "",
+ "usenet.host": "",
+ "usenet.port": "",
+ "usenet.use-ssl": "false",
+ "usenet.connections": "",
+ "usenet.connections-per-stream": "",
+ "usenet.user": "",
+ "usenet.pass": "",
+ "webdav.user": "",
+ "webdav.pass": "",
+ "rclone.mount-dir": "",
+}
+
+export async function loader({ request }: Route.LoaderArgs) {
+ // ensure user is logged in
+ let session = await sessionStorage.getSession(request.headers.get("cookie"));
+ let user = session.get("user");
+ if (!user) return redirect("/login");
+
+ // fetch the config items
+ var configItems = await backendClient.getConfig(Object.keys(defaultConfig));
+
+ // transform to a map
+ const config: Record<string, string> = defaultConfig;
+ for (const item of configItems) {
+ config[item.configName] = item.configValue;
+ }
+ return { config: config }
+}
+
+export default function Settings(props: Route.ComponentProps) {
+ return (
+ <Layout
+ topNavComponent={TopNavigation}
+ bodyChild={<Body config={props.loaderData.config} />}
+ leftNavChild={<LeftNavigation />}
+ />
+ );
+}
+
+type BodyProps = {
+ config: Record<string, string>
+};
+
+function Body(props: BodyProps) {
+ const [config, setConfig] = React.useState(props.config);
+ const [newConfig, setNewConfig] = React.useState(config);
+ const [isUsenetSettingsReadyToSave, setIsUsenetSettingsReadyToSave] = React.useState(false);
+ const [isSaving, setIsSaving] = React.useState(false);
+ const [isSaved, setIsSaved] = React.useState(false);
+
+ const iseUsenetUpdated = isUsenetSettingsUpdated(config, newConfig);
+ const isSabnzbdUpdated = isSabnzbdSettingsUpdated(config, newConfig);
+ const isWebdavUpdated = isWebdavSettingsUpdated(config, newConfig);
+ const isUpdated = iseUsenetUpdated || isSabnzbdUpdated || isWebdavUpdated;
+
+ const usenetTitle = iseUsenetUpdated ? "Usenet ✏️" : "Usenet";
+ const sabnzbdTitle = isSabnzbdUpdated ? "SABnzbd ✏️" : "SABnzbd";
+ const webdavTitle = isWebdavUpdated ? "WebDAV ✏️" : "WebDAV";
+
+ const saveButtonLabel = isSaving ? "Saving..."
+ : !isUpdated && isSaved ? "Saved ✅"
+ : !isUpdated && !isSaved ? "There are no changes to save"
+ : iseUsenetUpdated && !isUsenetSettingsReadyToSave ? "Must test the usenet connection to save"
+ : isSabnzbdUpdated && !isSabnzbdSettingsValid(newConfig) ? "Invalid SABnzbd settings"
+ : isWebdavUpdated && !isWebdavSettingsValid(newConfig) ? "Invalid WebDAV settings"
+ : "Save";
+ const saveButtonVariant = saveButtonLabel === "Save" ? "primary"
+ : saveButtonLabel === "Saved ✅" ? "success"
+ : "secondary";
+ const isSaveButtonDisabled = saveButtonLabel !== "Save";
+
+ // events
+ const onClear = React.useCallback(() => {
+ setNewConfig(config);
+ setIsSaved(false);
+ }, [config, setNewConfig]);
+
+ const onUsenetSettingsReadyToSave = React.useCallback((isReadyToSave: boolean) => {
+ setIsUsenetSettingsReadyToSave(isReadyToSave);
+ }, [setIsUsenetSettingsReadyToSave]);
+
+ const onSave = React.useCallback(async () => {
+ setIsSaving(true);
+ setIsSaved(false);
+ const response = await fetch("/settings/update", {
+ method: "POST",
+ body: (() => {
+ const form = new FormData();
+ form.append("config", JSON.stringify(newConfig));
+ return form;
+ })()
+ });
+ if (response.ok) {
+ const updatedConfig = (await response.json()).config;
+ setConfig(updatedConfig);
+ }
+ setIsSaving(false);
+ setIsSaved(true);
+ }, [setIsSaving, setIsSaved, newConfig, setConfig]);
+
+ return (
+ <div className={styles.container}>
+ <Tabs
+ defaultActiveKey="usenet"
+ className={styles.tabs}
+ >
+ <Tab eventKey="usenet" title={usenetTitle}>
+ <UsenetSettings config={newConfig} setNewConfig={setNewConfig} onReadyToSave={onUsenetSettingsReadyToSave}/>
+ </Tab>
+ <Tab eventKey="sabnzbd" title={sabnzbdTitle}>
+ <SabnzbdSettings config={newConfig} setNewConfig={setNewConfig} />
+ </Tab>
+ <Tab eventKey="webdav" title={webdavTitle}>
+ <WebdavSettings config={newConfig} setNewConfig={setNewConfig} />
+ </Tab>
+ </Tabs>
+ <hr />
+ {isUpdated && <Button
+ className={styles.button}
+ variant="secondary"
+ disabled={!isUpdated}
+ onClick={() => onClear()}>
+ Clear
+ </Button>}
+ <Button
+ className={styles.button}
+ variant={saveButtonVariant}
+ disabled={isSaveButtonDisabled}
+ onClick={onSave}>
+ {saveButtonLabel}
+ </Button>
+ </div>
+ );
+}
diff --git a/frontend/app/routes/settings/sabnzbd/sabnzbd.module.css b/frontend/app/routes/settings/sabnzbd/sabnzbd.module.css
new file mode 100644
index 00000000..027ec316
--- /dev/null
+++ b/frontend/app/routes/settings/sabnzbd/sabnzbd.module.css
@@ -0,0 +1,15 @@
+.container {
+ max-width:400px;
+}
+
+.input {
+ margin-bottom: 8px;
+}
+
+.input::placeholder {
+ color: rgba(255, 255, 255, 0.25);
+}
+
+.error {
+ border: 1px solid red !important;
+}
\ No newline at end of file
diff --git a/frontend/app/routes/settings/sabnzbd/sabnzbd.module.css.d.ts b/frontend/app/routes/settings/sabnzbd/sabnzbd.module.css.d.ts
new file mode 100644
index 00000000..0f335a22
--- /dev/null
+++ b/frontend/app/routes/settings/sabnzbd/sabnzbd.module.css.d.ts
@@ -0,0 +1,7 @@
+declare const styles: {
+ readonly "container": string;
+ readonly "input": string;
+ readonly "error": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/settings/sabnzbd/sabnzbd.tsx b/frontend/app/routes/settings/sabnzbd/sabnzbd.tsx
new file mode 100644
index 00000000..a584f8a6
--- /dev/null
+++ b/frontend/app/routes/settings/sabnzbd/sabnzbd.tsx
@@ -0,0 +1,93 @@
+import { Button, Form, InputGroup } from "react-bootstrap";
+import styles from "./sabnzbd.module.css"
+import { useCallback, type Dispatch, type SetStateAction } from "react";
+import { className } from "~/utils/styling";
+
+type SabnzbdSettingsProps = {
+ config: Record<string, string>
+ setNewConfig: Dispatch<SetStateAction<Record<string, string>>>
+};
+
+export function SabnzbdSettings({ config, setNewConfig }: SabnzbdSettingsProps) {
+
+ const onRefreshApiKey = useCallback(() => {
+ setNewConfig({ ...config, "api.key": generateNewApiKey() })
+ }, [setNewConfig, config]);
+
+ return (
+ <div className={styles.container}>
+ <Form.Group>
+ <Form.Label htmlFor="api-key-input">API Key</Form.Label>
+ <InputGroup className={styles.input}>
+ <Form.Control
+ type="text"
+ id="api-key-input"
+ aria-describedby="api-key-help"
+ value={config["api.key"]}
+ readOnly />
+ <Button variant="primary" onClick={onRefreshApiKey}>
+ Refresh
+ </Button>
+ </InputGroup>
+ <Form.Text id="api-key-help" muted>
+ Use this API key when configuring your download client in Radarr or Sonarr
+ </Form.Text>
+ </Form.Group>
+ <hr />
+ <Form.Group>
+ <Form.Label htmlFor="categories-input">Categories</Form.Label>
+ <Form.Control
+ {...className([styles.input, !isValidCategories(config["api.categories"]) && styles.error])}
+ type="text"
+ id="categories-input"
+ aria-describedby="categories-help"
+ value={config["api.categories"]}
+ placeholder="tv, movies, audio, software"
+ onChange={e => setNewConfig({ ...config, "api.categories": e.target.value })} />
+ <Form.Text id="categories-help" muted>
+ Comma-separated categories. Only letters, numbers, and dashes are allowed.
+ </Form.Text>
+ </Form.Group>
+ <hr />
+ <Form.Group>
+ <Form.Label htmlFor="mount-dir-input">Rclone Mount Directory</Form.Label>
+ <Form.Control
+ className={styles.input}
+ type="text"
+ id="mount-dir-input"
+ aria-describedby="mount-dir-help"
+ placeholder="/mnt/nzbdav"
+ value={config["rclone.mount-dir"]}
+ onChange={e => setNewConfig({ ...config, "rclone.mount-dir": e.target.value })} />
+ <Form.Text id="mount-dir-help" muted>
+ The location at which you've mounted (or will mount) the webdav root, through Rclone. This is used to tell sonarr / radarr where to look for completed "downloads."
+ </Form.Text>
+ </Form.Group>
+ </div>
+ );
+}
+
+export function isSabnzbdSettingsUpdated(config: Record<string, string>, newConfig: Record<string, string>) {
+ return config["api.key"] !== newConfig["api.key"]
+ || config["api.categories"] !== newConfig["api.categories"]
+ || config["rclone.mount-dir"] !== newConfig["rclone.mount-dir"]
+}
+
+export function isSabnzbdSettingsValid(newConfig: Record<string, string>) {
+ return isValidCategories(newConfig["api.categories"]);
+}
+
+export function generateNewApiKey(): string {
+ return crypto.randomUUID().toString().replaceAll("-", "");
+}
+
+function isValidCategories(categories: string): boolean {
+ if (categories === "") return true;
+ var parts = categories.split(",");
+ return parts.map(x => x.trim()).every(x => isAlphaNumericWithDashes(x));
+}
+
+function isAlphaNumericWithDashes(input: string): boolean {
+ const regex = /^[A-Za-z0-9-]+$/;
+ return regex.test(input);
+}
\ No newline at end of file
diff --git a/frontend/app/routes/settings/usenet/usenet.module.css b/frontend/app/routes/settings/usenet/usenet.module.css
new file mode 100644
index 00000000..feac1f2f
--- /dev/null
+++ b/frontend/app/routes/settings/usenet/usenet.module.css
@@ -0,0 +1,22 @@
+.container {
+ max-width:400px;
+ margin-bottom: 25px;
+}
+
+.form-group {
+ margin-bottom: 12px;
+}
+
+.justify-right{
+ display: flex;
+ justify-content: end;
+ align-items: center;
+}
+
+.test-connection-button {
+ margin-top: 12px;
+}
+
+.input::placeholder {
+ color: rgba(255, 255, 255, 0.25);
+}
\ No newline at end of file
diff --git a/frontend/app/routes/settings/usenet/usenet.module.css.d.ts b/frontend/app/routes/settings/usenet/usenet.module.css.d.ts
new file mode 100644
index 00000000..a30bec0e
--- /dev/null
+++ b/frontend/app/routes/settings/usenet/usenet.module.css.d.ts
@@ -0,0 +1,9 @@
+declare const styles: {
+ readonly "container": string;
+ readonly "input": string;
+ readonly "form-group": string;
+ readonly "justify-right": string;
+ readonly "test-connection-button": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/settings/usenet/usenet.tsx b/frontend/app/routes/settings/usenet/usenet.tsx
new file mode 100644
index 00000000..8b8996e5
--- /dev/null
+++ b/frontend/app/routes/settings/usenet/usenet.tsx
@@ -0,0 +1,159 @@
+import { Button, Form } from "react-bootstrap";
+import styles from "./usenet.module.css"
+import { useCallback, useEffect, useState, type Dispatch, type SetStateAction } from "react";
+
+type UsenetSettingsProps = {
+ config: Record<string, string>
+ setNewConfig: Dispatch<SetStateAction<Record<string, string>>>
+ onReadyToSave: (isReadyToSave: boolean) => void
+};
+
+export function UsenetSettings({ config, setNewConfig, onReadyToSave }: UsenetSettingsProps) {
+ const [isFetching, setIsFetching] = useState(false);
+ const [isConnectionSuccessful, setIsConnectionSuccessful] = useState(false);
+ const [testedConfig, setTestedConfig] = useState({});
+ const isChangedSinceLastTest = isUsenetSettingsUpdated(config, testedConfig);
+
+ const TestButtonLabel = isFetching ? "Testing Connection..."
+ : !config["usenet.host"] ? "`Host` is required"
+ : !config["usenet.port"] ? "`Port` is required"
+ : !isPositiveInteger(config["usenet.port"]) ? "`Port` is invalid"
+ : !config["usenet.user"] ? "`User` is required"
+ : !config["usenet.pass"] ? "`Pass` is required"
+ : !config["usenet.connections"] ? "`Max Connections` is required"
+ : !config["usenet.connections-per-stream"] ? "`Connections Per Stream` is required"
+ : !isPositiveInteger(config["usenet.connections"]) ? "`Max Connections` is invalid"
+ : !config["usenet.connections-per-stream"] ? "`Connections Per Stream` is required"
+ : !isPositiveInteger(config["usenet.connections-per-stream"]) ? "`Connections Per Stream` is invalid"
+ : Number(config["usenet.connections-per-stream"]) > Number(config["usenet.connections"]) ? "`Connections Per Stream` is invalid"
+ : !isChangedSinceLastTest && isConnectionSuccessful ? "Connected ✅"
+ : !isChangedSinceLastTest && !isConnectionSuccessful ? "Test Connection ❌"
+ : "Test Connection";
+ const testButtonVariant = isFetching ? "secondary"
+ : TestButtonLabel === "Connected ✅" ? "success"
+ : TestButtonLabel.includes("Test Connection") ? "primary"
+ : "danger";
+ const IsTestButtonEnabled = TestButtonLabel == "Test Connection"
+ || TestButtonLabel == "Test Connection ❌";
+
+ const isReadyToSave = isConnectionSuccessful && !isChangedSinceLastTest;
+ useEffect(() => {
+ onReadyToSave && onReadyToSave(isReadyToSave);
+ }, [isReadyToSave])
+
+ const onTestButtonClicked = useCallback(async () => {
+ setIsFetching(true);
+ const response = await fetch("/settings/test-usenet-connection", {
+ method: "POST",
+ body: (() => {
+ const form = new FormData();
+ form.append("host", config["usenet.host"]);
+ form.append("port", config["usenet.port"]);
+ form.append("use-ssl", config["usenet.use-ssl"] || "false");
+ form.append("user", config["usenet.user"]);
+ form.append("pass", config["usenet.pass"]);
+ return form;
+ })()
+ });
+ const isConnectionSuccessful = response.ok && ((await response.json()) === true);
+ setIsFetching(false);
+ setTestedConfig(config);
+ setIsConnectionSuccessful(isConnectionSuccessful);
+ }, [config, setIsFetching, setIsConnectionSuccessful]);
+
+ return (
+ <div className={styles.container}>
+
+ <Form.Group className={styles["form-group"]}>
+ <Form.Label>Host</Form.Label>
+ <Form.Control
+ type="text"
+ className={styles.input}
+ value={config["usenet.host"] || ""}
+ onChange={e => setNewConfig({ ...config, "usenet.host": e.target.value })} />
+ </Form.Group>
+
+ <Form.Group className={styles["form-group"]}>
+ <Form.Label>Port</Form.Label>
+ <Form.Control
+ type="text"
+ className={styles.input}
+ value={config["usenet.port"] || ""}
+ onChange={e => setNewConfig({ ...config, "usenet.port": e.target.value })} />
+ </Form.Group>
+
+ <div className={styles["justify-right"]}>
+ <Form.Check
+ type="checkbox"
+ label={`Use SSL`}
+ checked={config["usenet.use-ssl"] === "true"}
+ onChange={e => setNewConfig({ ...config, "usenet.use-ssl": "" + e.target.checked })} />
+ </div>
+
+ <br />
+
+ <Form.Group className={styles["form-group"]}>
+ <Form.Label>User</Form.Label>
+ <Form.Control
+ type="text"
+ className={styles.input}
+ value={config["usenet.user"] || ""}
+ onChange={e => setNewConfig({ ...config, "usenet.user": e.target.value })} />
+ </Form.Group>
+
+ <Form.Group className={styles["form-group"]}>
+ <Form.Label>Pass</Form.Label>
+ <Form.Control
+ className={styles.input}
+ type="password"
+ value={config["usenet.pass"] || ""}
+ onChange={e => setNewConfig({ ...config, "usenet.pass": e.target.value })} />
+ </Form.Group>
+
+ <Form.Group className={styles["form-group"]}>
+ <Form.Label>Max Connections</Form.Label>
+ <Form.Control
+ className={styles.input}
+ type="text"
+ placeholder="50"
+ value={config["usenet.connections"] || ""}
+ onChange={e => setNewConfig({ ...config, "usenet.connections": e.target.value })} />
+ </Form.Group>
+
+ <Form.Group className={styles["form-group"]}>
+ <Form.Label>Connections Per Stream</Form.Label>
+ <Form.Control
+ className={styles.input}
+ type="text"
+ placeholder="5"
+ value={config["usenet.connections-per-stream"] || ""}
+ onChange={e => setNewConfig({ ...config, "usenet.connections-per-stream": e.target.value })} />
+ </Form.Group>
+
+ <div className={styles["justify-right"]}>
+ <Button
+ className={styles["test-connection-button"]}
+ variant={testButtonVariant}
+ disabled={!IsTestButtonEnabled}
+ onClick={() => onTestButtonClicked()}>
+ {TestButtonLabel}
+ </Button>
+ </div>
+ </div>
+ );
+}
+
+export function isUsenetSettingsUpdated(config: Record<string, string>, newConfig: Record<string, string>) {
+ return config["usenet.host"] !== newConfig["usenet.host"]
+ || config["usenet.port"] !== newConfig["usenet.port"]
+ || config["usenet.use-ssl"] !== newConfig["usenet.use-ssl"]
+ || config["usenet.user"] !== newConfig["usenet.user"]
+ || config["usenet.pass"] !== newConfig["usenet.pass"]
+ || config["usenet.connections"] !== newConfig["usenet.connections"]
+ || config["usenet.connections-per-stream"] !== newConfig["usenet.connections-per-stream"]
+}
+
+function isPositiveInteger(value: string) {
+ const num = Number(value);
+ return Number.isInteger(num) && num > 0 && value.trim() === num.toString();
+}
\ No newline at end of file
diff --git a/frontend/app/routes/settings/webdav/webdav.module.css b/frontend/app/routes/settings/webdav/webdav.module.css
new file mode 100644
index 00000000..027ec316
--- /dev/null
+++ b/frontend/app/routes/settings/webdav/webdav.module.css
@@ -0,0 +1,15 @@
+.container {
+ max-width:400px;
+}
+
+.input {
+ margin-bottom: 8px;
+}
+
+.input::placeholder {
+ color: rgba(255, 255, 255, 0.25);
+}
+
+.error {
+ border: 1px solid red !important;
+}
\ No newline at end of file
diff --git a/frontend/app/routes/settings/webdav/webdav.module.css.d.ts b/frontend/app/routes/settings/webdav/webdav.module.css.d.ts
new file mode 100644
index 00000000..0f335a22
--- /dev/null
+++ b/frontend/app/routes/settings/webdav/webdav.module.css.d.ts
@@ -0,0 +1,7 @@
+declare const styles: {
+ readonly "container": string;
+ readonly "input": string;
+ readonly "error": string;
+};
+export = styles;
+
diff --git a/frontend/app/routes/settings/webdav/webdav.tsx b/frontend/app/routes/settings/webdav/webdav.tsx
new file mode 100644
index 00000000..18944510
--- /dev/null
+++ b/frontend/app/routes/settings/webdav/webdav.tsx
@@ -0,0 +1,59 @@
+import { Form } from "react-bootstrap";
+import styles from "./webdav.module.css"
+import { type Dispatch, type SetStateAction } from "react";
+import { className } from "~/utils/styling";
+
+type SabnzbdSettingsProps = {
+ config: Record<string, string>
+ setNewConfig: Dispatch<SetStateAction<Record<string, string>>>
+};
+
+export function WebdavSettings({ config, setNewConfig }: SabnzbdSettingsProps) {
+
+ return (
+ <div className={styles.container}>
+ <Form.Group>
+ <Form.Label htmlFor="webdav-user-input">WebDAV User</Form.Label>
+ <Form.Control
+ {...className([styles.input, !isValidUser(config["webdav.user"]) && styles.error])}
+ type="text"
+ id="webdav-user-input"
+ aria-describedby="webdav-user-help"
+ placeholder="admin"
+ value={config["webdav.user"]}
+ onChange={e => setNewConfig({ ...config, "webdav.user": e.target.value })} />
+ <Form.Text id="webdav-user-help" muted>
+ Use this user to connect to the webdav. Only letters, numbers, dashes, and underscores allowed.
+ </Form.Text>
+ </Form.Group>
+ <hr />
+ <Form.Group>
+ <Form.Label htmlFor="webdav-pass-input">WebDAV Password</Form.Label>
+ <Form.Control
+ className={styles.input}
+ type="password"
+ id="webdav-pass-input"
+ aria-describedby="webdav-pass-help"
+ value={config["webdav.pass"]}
+ onChange={e => setNewConfig({ ...config, "webdav.pass": e.target.value })} />
+ <Form.Text id="webdav-pass-help" muted>
+ Use this password to connect to the webdav
+ </Form.Text>
+ </Form.Group>
+ </div>
+ );
+}
+
+export function isWebdavSettingsUpdated(config: Record<string, string>, newConfig: Record<string, string>) {
+ return config["webdav.user"] !== newConfig["webdav.user"]
+ || config["webdav.pass"] !== newConfig["webdav.pass"]
+}
+
+export function isWebdavSettingsValid(newConfig: Record<string, string>) {
+ return isValidUser(newConfig["webdav.user"]);
+}
+
+function isValidUser(user: string): boolean {
+ const regex = /^[A-Za-z0-9_-]+$/;
+ return regex.test(user);
+}
\ No newline at end of file
diff --git a/frontend/app/utils/styling.ts b/frontend/app/utils/styling.ts
new file mode 100644
index 00000000..fdd6b30f
--- /dev/null
+++ b/frontend/app/utils/styling.ts
@@ -0,0 +1,5 @@
+export function className(classNames: (string | false | null | undefined)[]) {
+ return {
+ className: classNames.filter(Boolean).join(' ')
+ }
+}
\ No newline at end of file
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
new file mode 100644
index 00000000..bce592b8
--- /dev/null
+++ b/frontend/package-lock.json
@@ -0,0 +1,5335 @@
+{
+ "name": "nzb-webdav",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "nzb-webdav",
+ "dependencies": {
+ "@react-router/express": "^7.5.3",
+ "@react-router/fs-routes": "^7.6.1",
+ "@react-router/node": "^7.5.3",
+ "bootstrap": "^5.3.6",
+ "compression": "^1.7.5",
+ "express": "^5.1.0",
+ "http-proxy-middleware": "^3.0.5",
+ "isbot": "^5.1.27",
+ "mime-types": "^3.0.1",
+ "morgan": "^1.10.0",
+ "react": "^19.1.0",
+ "react-bootstrap": "^2.10.10",
+ "react-dom": "^19.1.0",
+ "react-dropzone": "^14.3.8",
+ "react-router": "^7.5.3",
+ "remix-auth": "^4.2.0",
+ "remix-auth-form": "^3.0.0"
+ },
+ "devDependencies": {
+ "@react-router/dev": "^7.5.3",
+ "@tailwindcss/vite": "^4.1.4",
+ "@types/compression": "^1.7.5",
+ "@types/express": "^5.0.1",
+ "@types/express-serve-static-core": "^5.0.6",
+ "@types/mime-types": "^3.0.1",
+ "@types/morgan": "^1.9.9",
+ "@types/node": "^20",
+ "@types/react": "^19.1.2",
+ "@types/react-dom": "^19.1.2",
+ "cross-env": "^7.0.3",
+ "tailwindcss": "^4.1.4",
+ "typed-css-modules": "^0.9.1",
+ "typescript": "^5.8.3",
+ "vite": "^6.3.3",
+ "vite-tsconfig-paths": "^5.1.4"
+ }
+ },
+ "node_modules/@ampproject/remapping": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",
+ "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.5",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@babel/code-frame": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz",
+ "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==",
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.27.1",
+ "js-tokens": "^4.0.0",
+ "picocolors": "^1.1.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/compat-data": {
+ "version": "7.27.5",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.5.tgz",
+ "integrity": "sha512-KiRAp/VoJaWkkte84TvUd9qjdbZAdiqyvMxrGl1N6vzFogKmaLgoM3L1kgtLicp2HP5fBJS8JrZKLVIZGVJAVg==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/core": {
+ "version": "7.27.4",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.27.4.tgz",
+ "integrity": "sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g==",
+ "dependencies": {
+ "@ampproject/remapping": "^2.2.0",
+ "@babel/code-frame": "^7.27.1",
+ "@babel/generator": "^7.27.3",
+ "@babel/helper-compilation-targets": "^7.27.2",
+ "@babel/helper-module-transforms": "^7.27.3",
+ "@babel/helpers": "^7.27.4",
+ "@babel/parser": "^7.27.4",
+ "@babel/template": "^7.27.2",
+ "@babel/traverse": "^7.27.4",
+ "@babel/types": "^7.27.3",
+ "convert-source-map": "^2.0.0",
+ "debug": "^4.1.0",
+ "gensync": "^1.0.0-beta.2",
+ "json5": "^2.2.3",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/babel"
+ }
+ },
+ "node_modules/@babel/core/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/generator": {
+ "version": "7.27.5",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.5.tgz",
+ "integrity": "sha512-ZGhA37l0e/g2s1Cnzdix0O3aLYm66eF8aufiVteOgnwxgnRP8GoyMj7VWsgWnQbVKXyge7hqrFh2K2TQM6t1Hw==",
+ "dependencies": {
+ "@babel/parser": "^7.27.5",
+ "@babel/types": "^7.27.3",
+ "@jridgewell/gen-mapping": "^0.3.5",
+ "@jridgewell/trace-mapping": "^0.3.25",
+ "jsesc": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-annotate-as-pure": {
+ "version": "7.27.3",
+ "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.3.tgz",
+ "integrity": "sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==",
+ "dependencies": {
+ "@babel/types": "^7.27.3"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets": {
+ "version": "7.27.2",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz",
+ "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==",
+ "dependencies": {
+ "@babel/compat-data": "^7.27.2",
+ "@babel/helper-validator-option": "^7.27.1",
+ "browserslist": "^4.24.0",
+ "lru-cache": "^5.1.1",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/helper-create-class-features-plugin": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.1.tgz",
+ "integrity": "sha512-QwGAmuvM17btKU5VqXfb+Giw4JcN0hjuufz3DYnpeVDvZLAObloM77bhMXiqry3Iio+Ai4phVRDwl6WU10+r5A==",
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.27.1",
+ "@babel/helper-member-expression-to-functions": "^7.27.1",
+ "@babel/helper-optimise-call-expression": "^7.27.1",
+ "@babel/helper-replace-supers": "^7.27.1",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1",
+ "@babel/traverse": "^7.27.1",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/@babel/helper-member-expression-to-functions": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.27.1.tgz",
+ "integrity": "sha512-E5chM8eWjTp/aNoVpcbfM7mLxu9XGLWYise2eBKGQomAk/Mb4XoxyqXTZbuTohbsl8EKqdlMhnDI2CCLfcs9wA==",
+ "dependencies": {
+ "@babel/traverse": "^7.27.1",
+ "@babel/types": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-imports": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz",
+ "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==",
+ "dependencies": {
+ "@babel/traverse": "^7.27.1",
+ "@babel/types": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-transforms": {
+ "version": "7.27.3",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz",
+ "integrity": "sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==",
+ "dependencies": {
+ "@babel/helper-module-imports": "^7.27.1",
+ "@babel/helper-validator-identifier": "^7.27.1",
+ "@babel/traverse": "^7.27.3"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-optimise-call-expression": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.27.1.tgz",
+ "integrity": "sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==",
+ "dependencies": {
+ "@babel/types": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-plugin-utils": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz",
+ "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-replace-supers": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.27.1.tgz",
+ "integrity": "sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==",
+ "dependencies": {
+ "@babel/helper-member-expression-to-functions": "^7.27.1",
+ "@babel/helper-optimise-call-expression": "^7.27.1",
+ "@babel/traverse": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-skip-transparent-expression-wrappers": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.27.1.tgz",
+ "integrity": "sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==",
+ "dependencies": {
+ "@babel/traverse": "^7.27.1",
+ "@babel/types": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
+ "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz",
+ "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-option": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz",
+ "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helpers": {
+ "version": "7.27.4",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.4.tgz",
+ "integrity": "sha512-Y+bO6U+I7ZKaM5G5rDUZiYfUvQPUibYmAFe7EnKdnKBbVXDZxvp+MWOH5gYciY0EPk4EScsuFMQBbEfpdRKSCQ==",
+ "dependencies": {
+ "@babel/template": "^7.27.2",
+ "@babel/types": "^7.27.3"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/parser": {
+ "version": "7.27.5",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.5.tgz",
+ "integrity": "sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==",
+ "dependencies": {
+ "@babel/types": "^7.27.3"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-decorators": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.27.1.tgz",
+ "integrity": "sha512-YMq8Z87Lhl8EGkmb0MwYkt36QnxC+fzCgrl66ereamPlYToRpIk5nUjKUY3QKLWq8mwUB1BgbeXcTJhZOCDg5A==",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-jsx": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz",
+ "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-typescript": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz",
+ "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-modules-commonjs": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.27.1.tgz",
+ "integrity": "sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw==",
+ "dependencies": {
+ "@babel/helper-module-transforms": "^7.27.1",
+ "@babel/helper-plugin-utils": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-typescript": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.27.1.tgz",
+ "integrity": "sha512-Q5sT5+O4QUebHdbwKedFBEwRLb02zJ7r4A5Gg2hUoLuU3FjdMcyqcywqUrLCaDsFCxzokf7u9kuy7qz51YUuAg==",
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.27.1",
+ "@babel/helper-create-class-features-plugin": "^7.27.1",
+ "@babel/helper-plugin-utils": "^7.27.1",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1",
+ "@babel/plugin-syntax-typescript": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/preset-typescript": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.27.1.tgz",
+ "integrity": "sha512-l7WfQfX0WK4M0v2RudjuQK4u99BS6yLHYEmdtVPP7lKV013zr9DygFuWNlnbvQ9LR+LS0Egz/XAvGx5U9MX0fQ==",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.27.1",
+ "@babel/helper-validator-option": "^7.27.1",
+ "@babel/plugin-syntax-jsx": "^7.27.1",
+ "@babel/plugin-transform-modules-commonjs": "^7.27.1",
+ "@babel/plugin-transform-typescript": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/runtime": {
+ "version": "7.27.4",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.4.tgz",
+ "integrity": "sha512-t3yaEOuGu9NlIZ+hIeGbBjFtZT7j2cb2tg0fuaJKeGotchRjjLfrBA9Kwf8quhpP1EUuxModQg04q/mBwyg8uA==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/template": {
+ "version": "7.27.2",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz",
+ "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==",
+ "dependencies": {
+ "@babel/code-frame": "^7.27.1",
+ "@babel/parser": "^7.27.2",
+ "@babel/types": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/traverse": {
+ "version": "7.27.4",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.4.tgz",
+ "integrity": "sha512-oNcu2QbHqts9BtOWJosOVJapWjBDSxGCpFvikNR5TGDYDQf3JwpIoMzIKrvfoti93cLfPJEG4tH9SPVeyCGgdA==",
+ "dependencies": {
+ "@babel/code-frame": "^7.27.1",
+ "@babel/generator": "^7.27.3",
+ "@babel/parser": "^7.27.4",
+ "@babel/template": "^7.27.2",
+ "@babel/types": "^7.27.3",
+ "debug": "^4.3.1",
+ "globals": "^11.1.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/types": {
+ "version": "7.27.3",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.3.tgz",
+ "integrity": "sha512-Y1GkI4ktrtvmawoSq+4FCVHNryea6uR+qUQy0AGxLSsjCX0nVmkYQMBLHDkXZuo5hGx7eYdnIaslsdBFm7zbUw==",
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.27.1",
+ "@babel/helper-validator-identifier": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.5.tgz",
+ "integrity": "sha512-9o3TMmpmftaCMepOdA5k/yDw8SfInyzWWTjYTFCX3kPSDJMROQTb8jg+h9Cnwnmm1vOzvxN7gIfB5V2ewpjtGA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.5.tgz",
+ "integrity": "sha512-AdJKSPeEHgi7/ZhuIPtcQKr5RQdo6OO2IL87JkianiMYMPbCtot9fxPbrMiBADOWWm3T2si9stAiVsGbTQFkbA==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.5.tgz",
+ "integrity": "sha512-VGzGhj4lJO+TVGV1v8ntCZWJktV7SGCs3Pn1GRWI1SBFtRALoomm8k5E9Pmwg3HOAal2VDc2F9+PM/rEY6oIDg==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.5.tgz",
+ "integrity": "sha512-D2GyJT1kjvO//drbRT3Hib9XPwQeWd9vZoBJn+bu/lVsOZ13cqNdDeqIF/xQ5/VmWvMduP6AmXvylO/PIc2isw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.5.tgz",
+ "integrity": "sha512-GtaBgammVvdF7aPIgH2jxMDdivezgFu6iKpmT+48+F8Hhg5J/sfnDieg0aeG/jfSvkYQU2/pceFPDKlqZzwnfQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.5.tgz",
+ "integrity": "sha512-1iT4FVL0dJ76/q1wd7XDsXrSW+oLoquptvh4CLR4kITDtqi2e/xwXwdCVH8hVHU43wgJdsq7Gxuzcs6Iq/7bxQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.5.tgz",
+ "integrity": "sha512-nk4tGP3JThz4La38Uy/gzyXtpkPW8zSAmoUhK9xKKXdBCzKODMc2adkB2+8om9BDYugz+uGV7sLmpTYzvmz6Sw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.5.tgz",
+ "integrity": "sha512-PrikaNjiXdR2laW6OIjlbeuCPrPaAl0IwPIaRv+SMV8CiM8i2LqVUHFC1+8eORgWyY7yhQY+2U2fA55mBzReaw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.5.tgz",
+ "integrity": "sha512-cPzojwW2okgh7ZlRpcBEtsX7WBuqbLrNXqLU89GxWbNt6uIg78ET82qifUy3W6OVww6ZWobWub5oqZOVtwolfw==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.5.tgz",
+ "integrity": "sha512-Z9kfb1v6ZlGbWj8EJk9T6czVEjjq2ntSYLY2cw6pAZl4oKtfgQuS4HOq41M/BcoLPzrUbNd+R4BXFyH//nHxVg==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.5.tgz",
+ "integrity": "sha512-sQ7l00M8bSv36GLV95BVAdhJ2QsIbCuCjh/uYrWiMQSUuV+LpXwIqhgJDcvMTj+VsQmqAHL2yYaasENvJ7CDKA==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.5.tgz",
+ "integrity": "sha512-0ur7ae16hDUC4OL5iEnDb0tZHDxYmuQyhKhsPBV8f99f6Z9KQM02g33f93rNH5A30agMS46u2HP6qTdEt6Q1kg==",
+ "cpu": [
+ "loong64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.5.tgz",
+ "integrity": "sha512-kB/66P1OsHO5zLz0i6X0RxlQ+3cu0mkxS3TKFvkb5lin6uwZ/ttOkP3Z8lfR9mJOBk14ZwZ9182SIIWFGNmqmg==",
+ "cpu": [
+ "mips64el"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.5.tgz",
+ "integrity": "sha512-UZCmJ7r9X2fe2D6jBmkLBMQetXPXIsZjQJCjgwpVDz+YMcS6oFR27alkgGv3Oqkv07bxdvw7fyB71/olceJhkQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.5.tgz",
+ "integrity": "sha512-kTxwu4mLyeOlsVIFPfQo+fQJAV9mh24xL+y+Bm6ej067sYANjyEw1dNHmvoqxJUCMnkBdKpvOn0Ahql6+4VyeA==",
+ "cpu": [
+ "riscv64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.5.tgz",
+ "integrity": "sha512-K2dSKTKfmdh78uJ3NcWFiqyRrimfdinS5ErLSn3vluHNeHVnBAFWC8a4X5N+7FgVE1EjXS1QDZbpqZBjfrqMTQ==",
+ "cpu": [
+ "s390x"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.5.tgz",
+ "integrity": "sha512-uhj8N2obKTE6pSZ+aMUbqq+1nXxNjZIIjCjGLfsWvVpy7gKCOL6rsY1MhRh9zLtUtAI7vpgLMK6DxjO8Qm9lJw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.5.tgz",
+ "integrity": "sha512-pwHtMP9viAy1oHPvgxtOv+OkduK5ugofNTVDilIzBLpoWAM16r7b/mxBvfpuQDpRQFMfuVr5aLcn4yveGvBZvw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.5.tgz",
+ "integrity": "sha512-WOb5fKrvVTRMfWFNCroYWWklbnXH0Q5rZppjq0vQIdlsQKuw6mdSihwSo4RV/YdQ5UCKKvBy7/0ZZYLBZKIbwQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.5.tgz",
+ "integrity": "sha512-7A208+uQKgTxHd0G0uqZO8UjK2R0DDb4fDmERtARjSHWxqMTye4Erz4zZafx7Di9Cv+lNHYuncAkiGFySoD+Mw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.5.tgz",
+ "integrity": "sha512-G4hE405ErTWraiZ8UiSoesH8DaCsMm0Cay4fsFWOOUcz8b8rC6uCvnagr+gnioEjWn0wC+o1/TAHt+It+MpIMg==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.5.tgz",
+ "integrity": "sha512-l+azKShMy7FxzY0Rj4RCt5VD/q8mG/e+mDivgspo+yL8zW7qEwctQ6YqKX34DTEleFAvCIUviCFX1SDZRSyMQA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.5.tgz",
+ "integrity": "sha512-O2S7SNZzdcFG7eFKgvwUEZ2VG9D/sn/eIiz8XRZ1Q/DO5a3s76Xv0mdBzVM5j5R639lXQmPmSo0iRpHqUUrsxw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.5.tgz",
+ "integrity": "sha512-onOJ02pqs9h1iMJ1PQphR+VZv8qBMQ77Klcsqv9CNW2w6yLqoURLcgERAIurY6QE63bbLuqgP9ATqajFLK5AMQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.5.tgz",
+ "integrity": "sha512-TXv6YnJ8ZMVdX+SXWVBo/0p8LTcrUYngpWjvm91TMjjBQii7Oz11Lw5lbDV5Y0TzuhSJHwiH4hEtC1I42mMS0g==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@isaacs/cliui": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
+ "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
+ "dependencies": {
+ "string-width": "^5.1.2",
+ "string-width-cjs": "npm:string-width@^4.2.0",
+ "strip-ansi": "^7.0.1",
+ "strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
+ "wrap-ansi": "^8.1.0",
+ "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@isaacs/fs-minipass": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",
+ "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==",
+ "dev": true,
+ "dependencies": {
+ "minipass": "^7.0.4"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.8",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz",
+ "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==",
+ "dependencies": {
+ "@jridgewell/set-array": "^1.2.1",
+ "@jridgewell/sourcemap-codec": "^1.4.10",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/set-array": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",
+ "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
+ "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.25",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
+ "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/@mjackson/node-fetch-server": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/@mjackson/node-fetch-server/-/node-fetch-server-0.2.0.tgz",
+ "integrity": "sha512-EMlH1e30yzmTpGLQjlFmaDAjyOeZhng1/XCd7DExR8PNAnG/G1tyruZxEoUe11ClnwGhGrtsdnyyUx1frSzjng=="
+ },
+ "node_modules/@npmcli/git": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.1.0.tgz",
+ "integrity": "sha512-9hwoB3gStVfa0N31ymBmrX+GuDGdVA/QWShZVqE0HK2Af+7QGGrCTbZia/SW0ImUTjTne7SP91qxDmtXvDHRPQ==",
+ "dependencies": {
+ "@npmcli/promise-spawn": "^6.0.0",
+ "lru-cache": "^7.4.4",
+ "npm-pick-manifest": "^8.0.0",
+ "proc-log": "^3.0.0",
+ "promise-inflight": "^1.0.1",
+ "promise-retry": "^2.0.1",
+ "semver": "^7.3.5",
+ "which": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@npmcli/git/node_modules/lru-cache": {
+ "version": "7.18.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
+ "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@npmcli/package-json": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-4.0.1.tgz",
+ "integrity": "sha512-lRCEGdHZomFsURroh522YvA/2cVb9oPIJrjHanCJZkiasz1BzcnLr3tBJhlV7S86MBJBuAQ33is2D60YitZL2Q==",
+ "dependencies": {
+ "@npmcli/git": "^4.1.0",
+ "glob": "^10.2.2",
+ "hosted-git-info": "^6.1.1",
+ "json-parse-even-better-errors": "^3.0.0",
+ "normalize-package-data": "^5.0.0",
+ "proc-log": "^3.0.0",
+ "semver": "^7.5.3"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@npmcli/promise-spawn": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz",
+ "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==",
+ "dependencies": {
+ "which": "^3.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@pkgjs/parseargs": {
+ "version": "0.11.0",
+ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
+ "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
+ "optional": true,
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/@popperjs/core": {
+ "version": "2.11.8",
+ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
+ "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/popperjs"
+ }
+ },
+ "node_modules/@react-aria/ssr": {
+ "version": "3.9.8",
+ "resolved": "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.9.8.tgz",
+ "integrity": "sha512-lQDE/c9uTfBSDOjaZUJS8xP2jCKVk4zjQeIlCH90xaLhHDgbpCdns3xvFpJJujfj3nI4Ll9K7A+ONUBDCASOuw==",
+ "dependencies": {
+ "@swc/helpers": "^0.5.0"
+ },
+ "engines": {
+ "node": ">= 12"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
+ }
+ },
+ "node_modules/@react-router/dev": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@react-router/dev/-/dev-7.6.1.tgz",
+ "integrity": "sha512-E4pzxViSQ1Z4EPUz1p47ldm+qIbzfFbJtbXvxi+KSidpftf/ttjr+DtLEiTEdIqZTYv8trBASRtV6C5hn9GZQQ==",
+ "dependencies": {
+ "@babel/core": "^7.21.8",
+ "@babel/generator": "^7.21.5",
+ "@babel/parser": "^7.21.8",
+ "@babel/plugin-syntax-decorators": "^7.22.10",
+ "@babel/plugin-syntax-jsx": "^7.21.4",
+ "@babel/preset-typescript": "^7.21.5",
+ "@babel/traverse": "^7.23.2",
+ "@babel/types": "^7.22.5",
+ "@npmcli/package-json": "^4.0.1",
+ "@react-router/node": "7.6.1",
+ "arg": "^5.0.1",
+ "babel-dead-code-elimination": "^1.0.6",
+ "chokidar": "^4.0.0",
+ "dedent": "^1.5.3",
+ "es-module-lexer": "^1.3.1",
+ "exit-hook": "2.2.1",
+ "fs-extra": "^10.0.0",
+ "jsesc": "3.0.2",
+ "lodash": "^4.17.21",
+ "pathe": "^1.1.2",
+ "picocolors": "^1.1.1",
+ "prettier": "^2.7.1",
+ "react-refresh": "^0.14.0",
+ "semver": "^7.3.7",
+ "set-cookie-parser": "^2.6.0",
+ "valibot": "^0.41.0",
+ "vite-node": "3.0.0-beta.2"
+ },
+ "bin": {
+ "react-router": "bin.js"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "@react-router/serve": "^7.6.1",
+ "react-router": "^7.6.1",
+ "typescript": "^5.1.0",
+ "vite": "^5.1.0 || ^6.0.0",
+ "wrangler": "^3.28.2 || ^4.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@react-router/serve": {
+ "optional": true
+ },
+ "typescript": {
+ "optional": true
+ },
+ "wrangler": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@react-router/express": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@react-router/express/-/express-7.6.1.tgz",
+ "integrity": "sha512-cdmz6MhmzzMSXWP3xyVYVgpPdGcsKGREyNW99yEun2kOMzcY4R/64lgTECPmtODKhPSbuFRmQvUp80xPL7NT2Q==",
+ "dependencies": {
+ "@react-router/node": "7.6.1"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "express": "^4.17.1 || ^5",
+ "react-router": "7.6.1",
+ "typescript": "^5.1.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@react-router/fs-routes": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@react-router/fs-routes/-/fs-routes-7.6.1.tgz",
+ "integrity": "sha512-VU/giV4rOK1XLOn/nlXVwTOenYV2nmlc5piMFw0+ONOFdVujq3ZWDe7h8+qjiEQZ8wjbhs+uvaxSDli+ERQwfA==",
+ "dependencies": {
+ "minimatch": "^9.0.0"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "@react-router/dev": "^7.6.1",
+ "typescript": "^5.1.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@react-router/node": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@react-router/node/-/node-7.6.1.tgz",
+ "integrity": "sha512-RZ9IatEarjF1GSHV+OUHNaRKtfp27UXP2J8dVdax6K/UXHc45k3t9Zp6splqT88wob4CUt4loDQw/7srNvsQhQ==",
+ "dependencies": {
+ "@mjackson/node-fetch-server": "^0.2.0",
+ "source-map-support": "^0.5.21",
+ "stream-slice": "^0.1.2",
+ "undici": "^6.19.2"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "react-router": "7.6.1",
+ "typescript": "^5.1.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@restart/hooks": {
+ "version": "0.4.16",
+ "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.4.16.tgz",
+ "integrity": "sha512-f7aCv7c+nU/3mF7NWLtVVr0Ra80RqsO89hO72r+Y/nvQr5+q0UFGkocElTH6MJApvReVh6JHUFYn2cw1WdHF3w==",
+ "dependencies": {
+ "dequal": "^2.0.3"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0"
+ }
+ },
+ "node_modules/@restart/ui": {
+ "version": "1.9.4",
+ "resolved": "https://registry.npmjs.org/@restart/ui/-/ui-1.9.4.tgz",
+ "integrity": "sha512-N4C7haUc3vn4LTwVUPlkJN8Ach/+yIMvRuTVIhjilNHqegY60SGLrzud6errOMNJwSnmYFnt1J0H/k8FE3A4KA==",
+ "dependencies": {
+ "@babel/runtime": "^7.26.0",
+ "@popperjs/core": "^2.11.8",
+ "@react-aria/ssr": "^3.5.0",
+ "@restart/hooks": "^0.5.0",
+ "@types/warning": "^3.0.3",
+ "dequal": "^2.0.3",
+ "dom-helpers": "^5.2.0",
+ "uncontrollable": "^8.0.4",
+ "warning": "^4.0.3"
+ },
+ "peerDependencies": {
+ "react": ">=16.14.0",
+ "react-dom": ">=16.14.0"
+ }
+ },
+ "node_modules/@restart/ui/node_modules/@restart/hooks": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.5.1.tgz",
+ "integrity": "sha512-EMoH04NHS1pbn07iLTjIjgttuqb7qu4+/EyhAx27MHpoENcB2ZdSsLTNxmKD+WEPnZigo62Qc8zjGnNxoSE/5Q==",
+ "dependencies": {
+ "dequal": "^2.0.3"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0"
+ }
+ },
+ "node_modules/@restart/ui/node_modules/uncontrollable": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-8.0.4.tgz",
+ "integrity": "sha512-ulRWYWHvscPFc0QQXvyJjY6LIXU56f0h8pQFvhxiKk5V1fcI8gp9Ht9leVAhrVjzqMw0BgjspBINx9r6oyJUvQ==",
+ "peerDependencies": {
+ "react": ">=16.14.0"
+ }
+ },
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.41.1.tgz",
+ "integrity": "sha512-NELNvyEWZ6R9QMkiytB4/L4zSEaBC03KIXEghptLGLZWJ6VPrL63ooZQCOnlx36aQPGhzuOMwDerC1Eb2VmrLw==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.41.1.tgz",
+ "integrity": "sha512-DXdQe1BJ6TK47ukAoZLehRHhfKnKg9BjnQYUu9gzhI8Mwa1d2fzxA1aw2JixHVl403bwp1+/o/NhhHtxWJBgEA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.41.1.tgz",
+ "integrity": "sha512-5afxvwszzdulsU2w8JKWwY8/sJOLPzf0e1bFuvcW5h9zsEg+RQAojdW0ux2zyYAz7R8HvvzKCjLNJhVq965U7w==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.41.1.tgz",
+ "integrity": "sha512-egpJACny8QOdHNNMZKf8xY0Is6gIMz+tuqXlusxquWu3F833DcMwmGM7WlvCO9sB3OsPjdC4U0wHw5FabzCGZg==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.41.1.tgz",
+ "integrity": "sha512-DBVMZH5vbjgRk3r0OzgjS38z+atlupJ7xfKIDJdZZL6sM6wjfDNo64aowcLPKIx7LMQi8vybB56uh1Ftck/Atg==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.41.1.tgz",
+ "integrity": "sha512-3FkydeohozEskBxNWEIbPfOE0aqQgB6ttTkJ159uWOFn42VLyfAiyD9UK5mhu+ItWzft60DycIN1Xdgiy8o/SA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.41.1.tgz",
+ "integrity": "sha512-wC53ZNDgt0pqx5xCAgNunkTzFE8GTgdZ9EwYGVcg+jEjJdZGtq9xPjDnFgfFozQI/Xm1mh+D9YlYtl+ueswNEg==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.41.1.tgz",
+ "integrity": "sha512-jwKCca1gbZkZLhLRtsrka5N8sFAaxrGz/7wRJ8Wwvq3jug7toO21vWlViihG85ei7uJTpzbXZRcORotE+xyrLA==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.41.1.tgz",
+ "integrity": "sha512-g0UBcNknsmmNQ8V2d/zD2P7WWfJKU0F1nu0k5pW4rvdb+BIqMm8ToluW/eeRmxCared5dD76lS04uL4UaNgpNA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.41.1.tgz",
+ "integrity": "sha512-XZpeGB5TKEZWzIrj7sXr+BEaSgo/ma/kCgrZgL0oo5qdB1JlTzIYQKel/RmhT6vMAvOdM2teYlAaOGJpJ9lahg==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loongarch64-gnu": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.41.1.tgz",
+ "integrity": "sha512-bkCfDJ4qzWfFRCNt5RVV4DOw6KEgFTUZi2r2RuYhGWC8WhCA8lCAJhDeAmrM/fdiAH54m0mA0Vk2FGRPyzI+tw==",
+ "cpu": [
+ "loong64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.41.1.tgz",
+ "integrity": "sha512-3mr3Xm+gvMX+/8EKogIZSIEF0WUu0HL9di+YWlJpO8CQBnoLAEL/roTCxuLncEdgcfJcvA4UMOf+2dnjl4Ut1A==",
+ "cpu": [
+ "ppc64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.41.1.tgz",
+ "integrity": "sha512-3rwCIh6MQ1LGrvKJitQjZFuQnT2wxfU+ivhNBzmxXTXPllewOF7JR1s2vMX/tWtUYFgphygxjqMl76q4aMotGw==",
+ "cpu": [
+ "riscv64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.41.1.tgz",
+ "integrity": "sha512-LdIUOb3gvfmpkgFZuccNa2uYiqtgZAz3PTzjuM5bH3nvuy9ty6RGc/Q0+HDFrHrizJGVpjnTZ1yS5TNNjFlklw==",
+ "cpu": [
+ "riscv64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.41.1.tgz",
+ "integrity": "sha512-oIE6M8WC9ma6xYqjvPhzZYk6NbobIURvP/lEbh7FWplcMO6gn7MM2yHKA1eC/GvYwzNKK/1LYgqzdkZ8YFxR8g==",
+ "cpu": [
+ "s390x"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.41.1.tgz",
+ "integrity": "sha512-cWBOvayNvA+SyeQMp79BHPK8ws6sHSsYnK5zDcsC3Hsxr1dgTABKjMnMslPq1DvZIp6uO7kIWhiGwaTdR4Og9A==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.41.1.tgz",
+ "integrity": "sha512-y5CbN44M+pUCdGDlZFzGGBSKCA4A/J2ZH4edTYSSxFg7ce1Xt3GtydbVKWLlzL+INfFIZAEg1ZV6hh9+QQf9YQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.41.1.tgz",
+ "integrity": "sha512-lZkCxIrjlJlMt1dLO/FbpZbzt6J/A8p4DnqzSa4PWqPEUUUnzXLeki/iyPLfV0BmHItlYgHUqJe+3KiyydmiNQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.41.1.tgz",
+ "integrity": "sha512-+psFT9+pIh2iuGsxFYYa/LhS5MFKmuivRsx9iPJWNSGbh2XVEjk90fmpUEjCnILPEPJnikAU6SFDiEUyOv90Pg==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.1.tgz",
+ "integrity": "sha512-Wq2zpapRYLfi4aKxf2Xff0tN+7slj2d4R87WEzqw7ZLsVvO5zwYCIuEGSZYiK41+GlwUo1HiR+GdkLEJnCKTCw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@swc/helpers": {
+ "version": "0.5.17",
+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz",
+ "integrity": "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==",
+ "dependencies": {
+ "tslib": "^2.8.0"
+ }
+ },
+ "node_modules/@tailwindcss/node": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.8.tgz",
+ "integrity": "sha512-OWwBsbC9BFAJelmnNcrKuf+bka2ZxCE2A4Ft53Tkg4uoiE67r/PMEYwCsourC26E+kmxfwE0hVzMdxqeW+xu7Q==",
+ "dev": true,
+ "dependencies": {
+ "@ampproject/remapping": "^2.3.0",
+ "enhanced-resolve": "^5.18.1",
+ "jiti": "^2.4.2",
+ "lightningcss": "1.30.1",
+ "magic-string": "^0.30.17",
+ "source-map-js": "^1.2.1",
+ "tailwindcss": "4.1.8"
+ }
+ },
+ "node_modules/@tailwindcss/oxide": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.8.tgz",
+ "integrity": "sha512-d7qvv9PsM5N3VNKhwVUhpK6r4h9wtLkJ6lz9ZY9aeZgrUWk1Z8VPyqyDT9MZlem7GTGseRQHkeB1j3tC7W1P+A==",
+ "dev": true,
+ "hasInstallScript": true,
+ "dependencies": {
+ "detect-libc": "^2.0.4",
+ "tar": "^7.4.3"
+ },
+ "engines": {
+ "node": ">= 10"
+ },
+ "optionalDependencies": {
+ "@tailwindcss/oxide-android-arm64": "4.1.8",
+ "@tailwindcss/oxide-darwin-arm64": "4.1.8",
+ "@tailwindcss/oxide-darwin-x64": "4.1.8",
+ "@tailwindcss/oxide-freebsd-x64": "4.1.8",
+ "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.8",
+ "@tailwindcss/oxide-linux-arm64-gnu": "4.1.8",
+ "@tailwindcss/oxide-linux-arm64-musl": "4.1.8",
+ "@tailwindcss/oxide-linux-x64-gnu": "4.1.8",
+ "@tailwindcss/oxide-linux-x64-musl": "4.1.8",
+ "@tailwindcss/oxide-wasm32-wasi": "4.1.8",
+ "@tailwindcss/oxide-win32-arm64-msvc": "4.1.8",
+ "@tailwindcss/oxide-win32-x64-msvc": "4.1.8"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-android-arm64": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.8.tgz",
+ "integrity": "sha512-Fbz7qni62uKYceWYvUjRqhGfZKwhZDQhlrJKGtnZfuNtHFqa8wmr+Wn74CTWERiW2hn3mN5gTpOoxWKk0jRxjg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-darwin-arm64": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.8.tgz",
+ "integrity": "sha512-RdRvedGsT0vwVVDztvyXhKpsU2ark/BjgG0huo4+2BluxdXo8NDgzl77qh0T1nUxmM11eXwR8jA39ibvSTbi7A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-darwin-x64": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.8.tgz",
+ "integrity": "sha512-t6PgxjEMLp5Ovf7uMb2OFmb3kqzVTPPakWpBIFzppk4JE4ix0yEtbtSjPbU8+PZETpaYMtXvss2Sdkx8Vs4XRw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-freebsd-x64": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.8.tgz",
+ "integrity": "sha512-g8C8eGEyhHTqwPStSwZNSrOlyx0bhK/V/+zX0Y+n7DoRUzyS8eMbVshVOLJTDDC+Qn9IJnilYbIKzpB9n4aBsg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.8.tgz",
+ "integrity": "sha512-Jmzr3FA4S2tHhaC6yCjac3rGf7hG9R6Gf2z9i9JFcuyy0u79HfQsh/thifbYTF2ic82KJovKKkIB6Z9TdNhCXQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-arm64-gnu": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.8.tgz",
+ "integrity": "sha512-qq7jXtO1+UEtCmCeBBIRDrPFIVI4ilEQ97qgBGdwXAARrUqSn/L9fUrkb1XP/mvVtoVeR2bt/0L77xx53bPZ/Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-arm64-musl": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.8.tgz",
+ "integrity": "sha512-O6b8QesPbJCRshsNApsOIpzKt3ztG35gfX9tEf4arD7mwNinsoCKxkj8TgEE0YRjmjtO3r9FlJnT/ENd9EVefQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-x64-gnu": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.8.tgz",
+ "integrity": "sha512-32iEXX/pXwikshNOGnERAFwFSfiltmijMIAbUhnNyjFr3tmWmMJWQKU2vNcFX0DACSXJ3ZWcSkzNbaKTdngH6g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-x64-musl": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.8.tgz",
+ "integrity": "sha512-s+VSSD+TfZeMEsCaFaHTaY5YNj3Dri8rST09gMvYQKwPphacRG7wbuQ5ZJMIJXN/puxPcg/nU+ucvWguPpvBDg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.8.tgz",
+ "integrity": "sha512-CXBPVFkpDjM67sS1psWohZ6g/2/cd+cq56vPxK4JeawelxwK4YECgl9Y9TjkE2qfF+9/s1tHHJqrC4SS6cVvSg==",
+ "bundleDependencies": [
+ "@napi-rs/wasm-runtime",
+ "@emnapi/core",
+ "@emnapi/runtime",
+ "@tybys/wasm-util",
+ "@emnapi/wasi-threads",
+ "tslib"
+ ],
+ "cpu": [
+ "wasm32"
+ ],
+ "dev": true,
+ "optional": true,
+ "dependencies": {
+ "@emnapi/core": "^1.4.3",
+ "@emnapi/runtime": "^1.4.3",
+ "@emnapi/wasi-threads": "^1.0.2",
+ "@napi-rs/wasm-runtime": "^0.2.10",
+ "@tybys/wasm-util": "^0.9.0",
+ "tslib": "^2.8.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-win32-arm64-msvc": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.8.tgz",
+ "integrity": "sha512-7GmYk1n28teDHUjPlIx4Z6Z4hHEgvP5ZW2QS9ygnDAdI/myh3HTHjDqtSqgu1BpRoI4OiLx+fThAyA1JePoENA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-win32-x64-msvc": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.8.tgz",
+ "integrity": "sha512-fou+U20j+Jl0EHwK92spoWISON2OBnCazIc038Xj2TdweYV33ZRkS9nwqiUi2d/Wba5xg5UoHfvynnb/UB49cQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@tailwindcss/vite": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.1.8.tgz",
+ "integrity": "sha512-CQ+I8yxNV5/6uGaJjiuymgw0kEQiNKRinYbZXPdx1fk5WgiyReG0VaUx/Xq6aVNSUNJFzxm6o8FNKS5aMaim5A==",
+ "dev": true,
+ "dependencies": {
+ "@tailwindcss/node": "4.1.8",
+ "@tailwindcss/oxide": "4.1.8",
+ "tailwindcss": "4.1.8"
+ },
+ "peerDependencies": {
+ "vite": "^5.2.0 || ^6"
+ }
+ },
+ "node_modules/@types/body-parser": {
+ "version": "1.19.5",
+ "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz",
+ "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==",
+ "dev": true,
+ "dependencies": {
+ "@types/connect": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/compression": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@types/compression/-/compression-1.8.0.tgz",
+ "integrity": "sha512-g4vmPIwbTii9dX1HVioHbOolubEaf4re4vDxuzpKrzz9uI7uarBExi9begX0cXyIB85jXZ5X2A/v8rsHZxSAPw==",
+ "dev": true,
+ "dependencies": {
+ "@types/express": "*",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/connect": {
+ "version": "3.4.38",
+ "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz",
+ "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz",
+ "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ=="
+ },
+ "node_modules/@types/express": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.2.tgz",
+ "integrity": "sha512-BtjL3ZwbCQriyb0DGw+Rt12qAXPiBTPs815lsUvtt1Grk0vLRMZNMUZ741d5rjk+UQOxfDiBZ3dxpX00vSkK3g==",
+ "dev": true,
+ "dependencies": {
+ "@types/body-parser": "*",
+ "@types/express-serve-static-core": "^5.0.0",
+ "@types/serve-static": "*"
+ }
+ },
+ "node_modules/@types/express-serve-static-core": {
+ "version": "5.0.6",
+ "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz",
+ "integrity": "sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*",
+ "@types/qs": "*",
+ "@types/range-parser": "*",
+ "@types/send": "*"
+ }
+ },
+ "node_modules/@types/http-errors": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz",
+ "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==",
+ "dev": true
+ },
+ "node_modules/@types/http-proxy": {
+ "version": "1.17.16",
+ "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.16.tgz",
+ "integrity": "sha512-sdWoUajOB1cd0A8cRRQ1cfyWNbmFKLAqBB89Y8x5iYyG/mkJHc0YUH8pdWBy2omi9qtCpiIgGjuwO0dQST2l5w==",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/mime": {
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
+ "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
+ "dev": true
+ },
+ "node_modules/@types/mime-types": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-3.0.1.tgz",
+ "integrity": "sha512-xRMsfuQbnRq1Ef+C+RKaENOxXX87Ygl38W1vDfPHRku02TgQr+Qd8iivLtAMcR0KF5/29xlnFihkTlbqFrGOVQ==",
+ "dev": true
+ },
+ "node_modules/@types/morgan": {
+ "version": "1.9.9",
+ "resolved": "https://registry.npmjs.org/@types/morgan/-/morgan-1.9.9.tgz",
+ "integrity": "sha512-iRYSDKVaC6FkGSpEVVIvrRGw0DfJMiQzIn3qr2G5B3C//AWkulhXgaBd7tS9/J79GWSYMTHGs7PfI5b3Y8m+RQ==",
+ "dev": true,
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/node": {
+ "version": "20.17.57",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.57.tgz",
+ "integrity": "sha512-f3T4y6VU4fVQDKVqJV4Uppy8c1p/sVvS3peyqxyWnzkqXFJLRU7Y1Bl7rMS1Qe9z0v4M6McY0Fp9yBsgHJUsWQ==",
+ "dependencies": {
+ "undici-types": "~6.19.2"
+ }
+ },
+ "node_modules/@types/prop-types": {
+ "version": "15.7.14",
+ "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.14.tgz",
+ "integrity": "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ=="
+ },
+ "node_modules/@types/qs": {
+ "version": "6.14.0",
+ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz",
+ "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==",
+ "dev": true
+ },
+ "node_modules/@types/range-parser": {
+ "version": "1.2.7",
+ "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
+ "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
+ "dev": true
+ },
+ "node_modules/@types/react": {
+ "version": "19.1.6",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.6.tgz",
+ "integrity": "sha512-JeG0rEWak0N6Itr6QUx+X60uQmN+5t3j9r/OVDtWzFXKaj6kD1BwJzOksD0FF6iWxZlbE1kB0q9vtnU2ekqa1Q==",
+ "dependencies": {
+ "csstype": "^3.0.2"
+ }
+ },
+ "node_modules/@types/react-dom": {
+ "version": "19.1.5",
+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.1.5.tgz",
+ "integrity": "sha512-CMCjrWucUBZvohgZxkjd6S9h0nZxXjzus6yDfUb+xLxYM7VvjKNH1tQrE9GWLql1XoOP4/Ds3bwFqShHUYraGg==",
+ "dev": true,
+ "peerDependencies": {
+ "@types/react": "^19.0.0"
+ }
+ },
+ "node_modules/@types/react-transition-group": {
+ "version": "4.4.12",
+ "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.12.tgz",
+ "integrity": "sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==",
+ "peerDependencies": {
+ "@types/react": "*"
+ }
+ },
+ "node_modules/@types/send": {
+ "version": "0.17.4",
+ "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
+ "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
+ "dev": true,
+ "dependencies": {
+ "@types/mime": "^1",
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/serve-static": {
+ "version": "1.15.7",
+ "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz",
+ "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==",
+ "dev": true,
+ "dependencies": {
+ "@types/http-errors": "*",
+ "@types/node": "*",
+ "@types/send": "*"
+ }
+ },
+ "node_modules/@types/warning": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.3.tgz",
+ "integrity": "sha512-D1XC7WK8K+zZEveUPY+cf4+kgauk8N4eHr/XIHXGlGYkHLud6hK9lYfZk1ry1TNh798cZUCgb6MqGEG8DkJt6Q=="
+ },
+ "node_modules/accepts": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
+ "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
+ "dependencies": {
+ "mime-types": "^3.0.0",
+ "negotiator": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/accepts/node_modules/negotiator": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
+ "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/ansi-regex": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
+ "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
+ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/anymatch": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
+ "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
+ "dev": true,
+ "dependencies": {
+ "normalize-path": "^3.0.0",
+ "picomatch": "^2.0.4"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/anymatch/node_modules/picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/arg": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
+ "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg=="
+ },
+ "node_modules/attr-accept": {
+ "version": "2.2.5",
+ "resolved": "https://registry.npmjs.org/attr-accept/-/attr-accept-2.2.5.tgz",
+ "integrity": "sha512-0bDNnY/u6pPwHDMoF0FieU354oBi0a8rD9FcsLwzcGWbc8KS8KPIi7y+s13OlVY+gMWc/9xEMUgNE6Qm8ZllYQ==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/babel-dead-code-elimination": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/babel-dead-code-elimination/-/babel-dead-code-elimination-1.0.10.tgz",
+ "integrity": "sha512-DV5bdJZTzZ0zn0DC24v3jD7Mnidh6xhKa4GfKCbq3sfW8kaWhDdZjP3i81geA8T33tdYqWKw4D3fVv0CwEgKVA==",
+ "dependencies": {
+ "@babel/core": "^7.23.7",
+ "@babel/parser": "^7.23.6",
+ "@babel/traverse": "^7.23.7",
+ "@babel/types": "^7.23.6"
+ }
+ },
+ "node_modules/balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
+ },
+ "node_modules/basic-auth": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
+ "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==",
+ "dependencies": {
+ "safe-buffer": "5.1.2"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/basic-auth/node_modules/safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
+ },
+ "node_modules/binary-extensions": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
+ "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/body-parser": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz",
+ "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==",
+ "dependencies": {
+ "bytes": "^3.1.2",
+ "content-type": "^1.0.5",
+ "debug": "^4.4.0",
+ "http-errors": "^2.0.0",
+ "iconv-lite": "^0.6.3",
+ "on-finished": "^2.4.1",
+ "qs": "^6.14.0",
+ "raw-body": "^3.0.0",
+ "type-is": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/bootstrap": {
+ "version": "5.3.6",
+ "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.6.tgz",
+ "integrity": "sha512-jX0GAcRzvdwISuvArXn3m7KZscWWFAf1MKBcnzaN02qWMb3jpMoUX4/qgeiGzqyIb4ojulRzs89UCUmGcFSzTA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/twbs"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/bootstrap"
+ }
+ ],
+ "peerDependencies": {
+ "@popperjs/core": "^2.11.8"
+ }
+ },
+ "node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/braces": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
+ "dependencies": {
+ "fill-range": "^7.1.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/browserslist": {
+ "version": "4.25.0",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz",
+ "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "dependencies": {
+ "caniuse-lite": "^1.0.30001718",
+ "electron-to-chromium": "^1.5.160",
+ "node-releases": "^2.0.19",
+ "update-browserslist-db": "^1.1.3"
+ },
+ "bin": {
+ "browserslist": "cli.js"
+ },
+ "engines": {
+ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
+ }
+ },
+ "node_modules/buffer-from": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
+ },
+ "node_modules/bytes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/cac": {
+ "version": "6.7.14",
+ "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
+ "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/call-bind-apply-helpers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/call-bound": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "get-intrinsic": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/caniuse-lite": {
+ "version": "1.0.30001720",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001720.tgz",
+ "integrity": "sha512-Ec/2yV2nNPwb4DnTANEV99ZWwm3ZWfdlfkQbWSDDt+PsXEVYwlhPH8tdMaPunYTKKmz7AnHi2oNEi1GcmKCD8g==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ]
+ },
+ "node_modules/chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/chalk/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/chokidar": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
+ "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
+ "dependencies": {
+ "readdirp": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 14.16.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/chownr": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz",
+ "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==",
+ "dev": true,
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/classnames": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz",
+ "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow=="
+ },
+ "node_modules/cliui": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
+ "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
+ "dev": true,
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.1",
+ "wrap-ansi": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/cliui/node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cliui/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/cliui/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "node_modules/cliui/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cliui/node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cliui/node_modules/wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+ },
+ "node_modules/compressible": {
+ "version": "2.0.18",
+ "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz",
+ "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==",
+ "dependencies": {
+ "mime-db": ">= 1.43.0 < 2"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/compression": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.0.tgz",
+ "integrity": "sha512-k6WLKfunuqCYD3t6AsuPGvQWaKwuLLh2/xHNcX4qE+vIfDNXpSqnrhwA7O53R7WVQUnt8dVAIW+YHr7xTgOgGA==",
+ "dependencies": {
+ "bytes": "3.1.2",
+ "compressible": "~2.0.18",
+ "debug": "2.6.9",
+ "negotiator": "~0.6.4",
+ "on-headers": "~1.0.2",
+ "safe-buffer": "5.2.1",
+ "vary": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/compression/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/compression/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/content-disposition": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz",
+ "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==",
+ "dependencies": {
+ "safe-buffer": "5.2.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/content-type": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/convert-source-map": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="
+ },
+ "node_modules/cookie": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie-signature": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
+ "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
+ "engines": {
+ "node": ">=6.6.0"
+ }
+ },
+ "node_modules/cross-env": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
+ "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
+ "dev": true,
+ "dependencies": {
+ "cross-spawn": "^7.0.1"
+ },
+ "bin": {
+ "cross-env": "src/bin/cross-env.js",
+ "cross-env-shell": "src/bin/cross-env-shell.js"
+ },
+ "engines": {
+ "node": ">=10.14",
+ "npm": ">=6",
+ "yarn": ">=1"
+ }
+ },
+ "node_modules/cross-spawn": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
+ "dependencies": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/cross-spawn/node_modules/which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/cssesc": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
+ "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
+ "dev": true,
+ "bin": {
+ "cssesc": "bin/cssesc"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/csstype": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
+ "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
+ },
+ "node_modules/debug": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
+ "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/dedent": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.6.0.tgz",
+ "integrity": "sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA==",
+ "peerDependencies": {
+ "babel-plugin-macros": "^3.1.0"
+ },
+ "peerDependenciesMeta": {
+ "babel-plugin-macros": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/depd": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/dequal": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/detect-libc": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz",
+ "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==",
+ "devOptional": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/dom-helpers": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz",
+ "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==",
+ "dependencies": {
+ "@babel/runtime": "^7.8.7",
+ "csstype": "^3.0.2"
+ }
+ },
+ "node_modules/dunder-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/eastasianwidth": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
+ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
+ },
+ "node_modules/ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
+ },
+ "node_modules/electron-to-chromium": {
+ "version": "1.5.162",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.162.tgz",
+ "integrity": "sha512-hQA+Zb5QQwoSaXJWEAGEw1zhk//O7qDzib05Z4qTqZfNju/FAkrm5ZInp0JbTp4Z18A6bilopdZWEYrFSsfllA=="
+ },
+ "node_modules/emoji-regex": {
+ "version": "9.2.2",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
+ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="
+ },
+ "node_modules/encodeurl": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/enhanced-resolve": {
+ "version": "5.18.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz",
+ "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==",
+ "dev": true,
+ "dependencies": {
+ "graceful-fs": "^4.2.4",
+ "tapable": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/err-code": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz",
+ "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA=="
+ },
+ "node_modules/es-define-property": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-module-lexer": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz",
+ "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA=="
+ },
+ "node_modules/es-object-atoms": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
+ "dependencies": {
+ "es-errors": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/esbuild": {
+ "version": "0.25.5",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.5.tgz",
+ "integrity": "sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ==",
+ "hasInstallScript": true,
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.25.5",
+ "@esbuild/android-arm": "0.25.5",
+ "@esbuild/android-arm64": "0.25.5",
+ "@esbuild/android-x64": "0.25.5",
+ "@esbuild/darwin-arm64": "0.25.5",
+ "@esbuild/darwin-x64": "0.25.5",
+ "@esbuild/freebsd-arm64": "0.25.5",
+ "@esbuild/freebsd-x64": "0.25.5",
+ "@esbuild/linux-arm": "0.25.5",
+ "@esbuild/linux-arm64": "0.25.5",
+ "@esbuild/linux-ia32": "0.25.5",
+ "@esbuild/linux-loong64": "0.25.5",
+ "@esbuild/linux-mips64el": "0.25.5",
+ "@esbuild/linux-ppc64": "0.25.5",
+ "@esbuild/linux-riscv64": "0.25.5",
+ "@esbuild/linux-s390x": "0.25.5",
+ "@esbuild/linux-x64": "0.25.5",
+ "@esbuild/netbsd-arm64": "0.25.5",
+ "@esbuild/netbsd-x64": "0.25.5",
+ "@esbuild/openbsd-arm64": "0.25.5",
+ "@esbuild/openbsd-x64": "0.25.5",
+ "@esbuild/sunos-x64": "0.25.5",
+ "@esbuild/win32-arm64": "0.25.5",
+ "@esbuild/win32-ia32": "0.25.5",
+ "@esbuild/win32-x64": "0.25.5"
+ }
+ },
+ "node_modules/escalade": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
+ },
+ "node_modules/etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
+ },
+ "node_modules/exit-hook": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-2.2.1.tgz",
+ "integrity": "sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/express": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz",
+ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==",
+ "dependencies": {
+ "accepts": "^2.0.0",
+ "body-parser": "^2.2.0",
+ "content-disposition": "^1.0.0",
+ "content-type": "^1.0.5",
+ "cookie": "^0.7.1",
+ "cookie-signature": "^1.2.1",
+ "debug": "^4.4.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "finalhandler": "^2.1.0",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.0",
+ "merge-descriptors": "^2.0.0",
+ "mime-types": "^3.0.0",
+ "on-finished": "^2.4.1",
+ "once": "^1.4.0",
+ "parseurl": "^1.3.3",
+ "proxy-addr": "^2.0.7",
+ "qs": "^6.14.0",
+ "range-parser": "^1.2.1",
+ "router": "^2.2.0",
+ "send": "^1.1.0",
+ "serve-static": "^2.2.0",
+ "statuses": "^2.0.1",
+ "type-is": "^2.0.1",
+ "vary": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/fdir": {
+ "version": "6.4.5",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.5.tgz",
+ "integrity": "sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw==",
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/file-selector": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/file-selector/-/file-selector-2.1.2.tgz",
+ "integrity": "sha512-QgXo+mXTe8ljeqUFaX3QVHc5osSItJ/Km+xpocx0aSqWGMSCf6qYs/VnzZgS864Pjn5iceMRFigeAV7AfTlaig==",
+ "dependencies": {
+ "tslib": "^2.7.0"
+ },
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/fill-range": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
+ "dependencies": {
+ "to-regex-range": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/finalhandler": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz",
+ "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==",
+ "dependencies": {
+ "debug": "^4.4.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "on-finished": "^2.4.1",
+ "parseurl": "^1.3.3",
+ "statuses": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/follow-redirects": {
+ "version": "1.15.9",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
+ "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/RubenVerborgh"
+ }
+ ],
+ "engines": {
+ "node": ">=4.0"
+ },
+ "peerDependenciesMeta": {
+ "debug": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/foreground-child": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz",
+ "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==",
+ "dependencies": {
+ "cross-spawn": "^7.0.6",
+ "signal-exit": "^4.0.1"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/forwarded": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fresh": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
+ "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/fs-extra": {
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
+ "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
+ "dependencies": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "hasInstallScript": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/gensync": {
+ "version": "1.0.0-beta.2",
+ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
+ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+ "dev": true,
+ "engines": {
+ "node": "6.* || 8.* || >= 10.*"
+ }
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "es-define-property": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "es-object-atoms": "^1.1.1",
+ "function-bind": "^1.1.2",
+ "get-proto": "^1.0.1",
+ "gopd": "^1.2.0",
+ "has-symbols": "^1.1.0",
+ "hasown": "^2.0.2",
+ "math-intrinsics": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+ "dependencies": {
+ "dunder-proto": "^1.0.1",
+ "es-object-atoms": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/glob": {
+ "version": "10.4.5",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz",
+ "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==",
+ "dependencies": {
+ "foreground-child": "^3.1.0",
+ "jackspeak": "^3.1.2",
+ "minimatch": "^9.0.4",
+ "minipass": "^7.1.2",
+ "package-json-from-dist": "^1.0.0",
+ "path-scurry": "^1.11.1"
+ },
+ "bin": {
+ "glob": "dist/esm/bin.mjs"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dev": true,
+ "dependencies": {
+ "is-glob": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/globals": {
+ "version": "11.12.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
+ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/globrex": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
+ "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
+ "dev": true
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
+ },
+ "node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/hasown": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/hosted-git-info": {
+ "version": "6.1.3",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.3.tgz",
+ "integrity": "sha512-HVJyzUrLIL1c0QmviVh5E8VGyUS7xCFPS6yydaVd1UegW+ibV/CohqTH9MkOLDp5o+rb82DMo77PTuc9F/8GKw==",
+ "dependencies": {
+ "lru-cache": "^7.5.1"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/hosted-git-info/node_modules/lru-cache": {
+ "version": "7.18.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
+ "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/http-errors": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
+ "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
+ "dependencies": {
+ "depd": "2.0.0",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": "2.0.1",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/http-proxy": {
+ "version": "1.18.1",
+ "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
+ "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
+ "dependencies": {
+ "eventemitter3": "^4.0.0",
+ "follow-redirects": "^1.0.0",
+ "requires-port": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/http-proxy-middleware": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.5.tgz",
+ "integrity": "sha512-GLZZm1X38BPY4lkXA01jhwxvDoOkkXqjgVyUzVxiEK4iuRu03PZoYHhHRwxnfhQMDuaxi3vVri0YgSro/1oWqg==",
+ "dependencies": {
+ "@types/http-proxy": "^1.17.15",
+ "debug": "^4.3.6",
+ "http-proxy": "^1.18.1",
+ "is-glob": "^4.0.3",
+ "is-plain-object": "^5.0.0",
+ "micromatch": "^4.0.8"
+ },
+ "engines": {
+ "node": "^14.15.0 || ^16.10.0 || >=18.0.0"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/icss-replace-symbols": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz",
+ "integrity": "sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg==",
+ "dev": true
+ },
+ "node_modules/icss-utils": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz",
+ "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==",
+ "dev": true,
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "node_modules/invariant": {
+ "version": "2.2.4",
+ "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
+ "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
+ "dependencies": {
+ "loose-envify": "^1.0.0"
+ }
+ },
+ "node_modules/ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/is-binary-path": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
+ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
+ "dev": true,
+ "dependencies": {
+ "binary-extensions": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-core-module": {
+ "version": "2.16.1",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
+ "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==",
+ "dependencies": {
+ "hasown": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "dependencies": {
+ "is-extglob": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "engines": {
+ "node": ">=0.12.0"
+ }
+ },
+ "node_modules/is-plain-object": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
+ "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-promise": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
+ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="
+ },
+ "node_modules/is-there": {
+ "version": "4.5.2",
+ "resolved": "https://registry.npmjs.org/is-there/-/is-there-4.5.2.tgz",
+ "integrity": "sha512-ixMkfz3rtS1vEsLf0TjgjqUn96Q0ukpUVDMnPYVocJyTzu2G/QgEtqYddcHZawHO+R31cKVPggJmBLrm1vJCOg==",
+ "dev": true
+ },
+ "node_modules/isbot": {
+ "version": "5.1.28",
+ "resolved": "https://registry.npmjs.org/isbot/-/isbot-5.1.28.tgz",
+ "integrity": "sha512-qrOp4g3xj8YNse4biorv6O5ZShwsJM0trsoda4y7j/Su7ZtTTfVXFzbKkpgcSoDrHS8FcTuUwcU04YimZlZOxw==",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
+ },
+ "node_modules/jackspeak": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
+ "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
+ "dependencies": {
+ "@isaacs/cliui": "^8.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ },
+ "optionalDependencies": {
+ "@pkgjs/parseargs": "^0.11.0"
+ }
+ },
+ "node_modules/jiti": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz",
+ "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==",
+ "devOptional": true,
+ "bin": {
+ "jiti": "lib/jiti-cli.mjs"
+ }
+ },
+ "node_modules/js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
+ },
+ "node_modules/jsesc": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz",
+ "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==",
+ "bin": {
+ "jsesc": "bin/jsesc"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/json-parse-even-better-errors": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.2.tgz",
+ "integrity": "sha512-fi0NG4bPjCHunUJffmLd0gxssIgkNmArMvis4iNah6Owg1MCJjWhEcDLmsK6iGkJq3tHwbDkTlce70/tmXN4cQ==",
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/json5": {
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
+ "bin": {
+ "json5": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/jsonfile": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
+ "optionalDependencies": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "node_modules/lightningcss": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.1.tgz",
+ "integrity": "sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg==",
+ "devOptional": true,
+ "dependencies": {
+ "detect-libc": "^2.0.3"
+ },
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ },
+ "optionalDependencies": {
+ "lightningcss-darwin-arm64": "1.30.1",
+ "lightningcss-darwin-x64": "1.30.1",
+ "lightningcss-freebsd-x64": "1.30.1",
+ "lightningcss-linux-arm-gnueabihf": "1.30.1",
+ "lightningcss-linux-arm64-gnu": "1.30.1",
+ "lightningcss-linux-arm64-musl": "1.30.1",
+ "lightningcss-linux-x64-gnu": "1.30.1",
+ "lightningcss-linux-x64-musl": "1.30.1",
+ "lightningcss-win32-arm64-msvc": "1.30.1",
+ "lightningcss-win32-x64-msvc": "1.30.1"
+ }
+ },
+ "node_modules/lightningcss-darwin-arm64": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.1.tgz",
+ "integrity": "sha512-c8JK7hyE65X1MHMN+Viq9n11RRC7hgin3HhYKhrMyaXflk5GVplZ60IxyoVtzILeKr+xAJwg6zK6sjTBJ0FKYQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-darwin-x64": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.1.tgz",
+ "integrity": "sha512-k1EvjakfumAQoTfcXUcHQZhSpLlkAuEkdMBsI/ivWw9hL+7FtilQc0Cy3hrx0AAQrVtQAbMI7YjCgYgvn37PzA==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-freebsd-x64": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.1.tgz",
+ "integrity": "sha512-kmW6UGCGg2PcyUE59K5r0kWfKPAVy4SltVeut+umLCFoJ53RdCUWxcRDzO1eTaxf/7Q2H7LTquFHPL5R+Gjyig==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-arm-gnueabihf": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.1.tgz",
+ "integrity": "sha512-MjxUShl1v8pit+6D/zSPq9S9dQ2NPFSQwGvxBCYaBYLPlCWuPh9/t1MRS8iUaR8i+a6w7aps+B4N0S1TYP/R+Q==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-arm64-gnu": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.1.tgz",
+ "integrity": "sha512-gB72maP8rmrKsnKYy8XUuXi/4OctJiuQjcuqWNlJQ6jZiWqtPvqFziskH3hnajfvKB27ynbVCucKSm2rkQp4Bw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-arm64-musl": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.1.tgz",
+ "integrity": "sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-x64-gnu": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.1.tgz",
+ "integrity": "sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-x64-musl": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.1.tgz",
+ "integrity": "sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-win32-arm64-msvc": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.1.tgz",
+ "integrity": "sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-win32-x64-msvc": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.1.tgz",
+ "integrity": "sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lodash": {
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
+ },
+ "node_modules/loose-envify": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
+ "dependencies": {
+ "js-tokens": "^3.0.0 || ^4.0.0"
+ },
+ "bin": {
+ "loose-envify": "cli.js"
+ }
+ },
+ "node_modules/lru-cache": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
+ "dependencies": {
+ "yallist": "^3.0.2"
+ }
+ },
+ "node_modules/magic-string": {
+ "version": "0.30.17",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz",
+ "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==",
+ "dev": true,
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.0"
+ }
+ },
+ "node_modules/math-intrinsics": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/media-typer": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
+ "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/merge-descriptors": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
+ "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/micromatch": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
+ "dependencies": {
+ "braces": "^3.0.3",
+ "picomatch": "^2.3.1"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/micromatch/node_modules/picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.54.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz",
+ "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==",
+ "dependencies": {
+ "mime-db": "^1.54.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/minimatch": {
+ "version": "9.0.5",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
+ "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/minipass": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
+ "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ }
+ },
+ "node_modules/minizlib": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz",
+ "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==",
+ "dev": true,
+ "dependencies": {
+ "minipass": "^7.1.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
+ "node_modules/mkdirp": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz",
+ "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==",
+ "dev": true,
+ "bin": {
+ "mkdirp": "dist/cjs/src/bin.js"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/morgan": {
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz",
+ "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==",
+ "dependencies": {
+ "basic-auth": "~2.0.1",
+ "debug": "2.6.9",
+ "depd": "~2.0.0",
+ "on-finished": "~2.3.0",
+ "on-headers": "~1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/morgan/node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/morgan/node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ },
+ "node_modules/morgan/node_modules/on-finished": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
+ "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==",
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.11",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
+ "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/negotiator": {
+ "version": "0.6.4",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz",
+ "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/node-releases": {
+ "version": "2.0.19",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz",
+ "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw=="
+ },
+ "node_modules/normalize-package-data": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz",
+ "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==",
+ "dependencies": {
+ "hosted-git-info": "^6.0.0",
+ "is-core-module": "^2.8.1",
+ "semver": "^7.3.5",
+ "validate-npm-package-license": "^3.0.4"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/normalize-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/npm-install-checks": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-6.3.0.tgz",
+ "integrity": "sha512-W29RiK/xtpCGqn6f3ixfRYGk+zRyr+Ew9F2E20BfXxT5/euLdA/Nm7fO7OeTGuAmTs30cpgInyJ0cYe708YTZw==",
+ "dependencies": {
+ "semver": "^7.1.1"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/npm-normalize-package-bin": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz",
+ "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==",
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/npm-package-arg": {
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz",
+ "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==",
+ "dependencies": {
+ "hosted-git-info": "^6.0.0",
+ "proc-log": "^3.0.0",
+ "semver": "^7.3.5",
+ "validate-npm-package-name": "^5.0.0"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/npm-pick-manifest": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-8.0.2.tgz",
+ "integrity": "sha512-1dKY+86/AIiq1tkKVD3l0WI+Gd3vkknVGAggsFeBkTvbhMQ1OND/LKkYv4JtXPKUJ8bOTCyLiqEg2P6QNdK+Gg==",
+ "dependencies": {
+ "npm-install-checks": "^6.0.0",
+ "npm-normalize-package-bin": "^3.0.0",
+ "npm-package-arg": "^10.0.0",
+ "semver": "^7.3.5"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-inspect": {
+ "version": "1.13.4",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/on-finished": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/on-headers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
+ "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/package-json-from-dist": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
+ "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw=="
+ },
+ "node_modules/parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-scurry": {
+ "version": "1.11.1",
+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
+ "dependencies": {
+ "lru-cache": "^10.2.0",
+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/path-scurry/node_modules/lru-cache": {
+ "version": "10.4.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="
+ },
+ "node_modules/path-to-regexp": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz",
+ "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==",
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/pathe": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
+ "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ=="
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="
+ },
+ "node_modules/picomatch": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz",
+ "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.5.4",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.4.tgz",
+ "integrity": "sha512-QSa9EBe+uwlGTFmHsPKokv3B/oEMQZxfqW0QqNCyhpa6mB1afzulwn8hihglqAb2pOw+BJgNlmXQ8la2VeHB7w==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "dependencies": {
+ "nanoid": "^3.3.11",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/postcss-modules-extract-imports": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz",
+ "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==",
+ "dev": true,
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-modules-local-by-default": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz",
+ "integrity": "sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw==",
+ "dev": true,
+ "dependencies": {
+ "icss-utils": "^5.0.0",
+ "postcss-selector-parser": "^7.0.0",
+ "postcss-value-parser": "^4.1.0"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-modules-scope": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz",
+ "integrity": "sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==",
+ "dev": true,
+ "dependencies": {
+ "postcss-selector-parser": "^7.0.0"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-modules-values": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz",
+ "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==",
+ "dev": true,
+ "dependencies": {
+ "icss-utils": "^5.0.0"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >= 14"
+ },
+ "peerDependencies": {
+ "postcss": "^8.1.0"
+ }
+ },
+ "node_modules/postcss-selector-parser": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz",
+ "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==",
+ "dev": true,
+ "dependencies": {
+ "cssesc": "^3.0.0",
+ "util-deprecate": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/postcss-value-parser": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
+ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==",
+ "dev": true
+ },
+ "node_modules/prettier": {
+ "version": "2.8.8",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
+ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
+ "node_modules/proc-log": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz",
+ "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==",
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/promise-inflight": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
+ "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g=="
+ },
+ "node_modules/promise-retry": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz",
+ "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==",
+ "dependencies": {
+ "err-code": "^2.0.2",
+ "retry": "^0.12.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/prop-types": {
+ "version": "15.8.1",
+ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
+ "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
+ "dependencies": {
+ "loose-envify": "^1.4.0",
+ "object-assign": "^4.1.1",
+ "react-is": "^16.13.1"
+ }
+ },
+ "node_modules/prop-types-extra": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz",
+ "integrity": "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==",
+ "dependencies": {
+ "react-is": "^16.3.2",
+ "warning": "^4.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=0.14.0"
+ }
+ },
+ "node_modules/proxy-addr": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+ "dependencies": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/qs": {
+ "version": "6.14.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
+ "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
+ "dependencies": {
+ "side-channel": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/range-parser": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/raw-body": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz",
+ "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==",
+ "dependencies": {
+ "bytes": "3.1.2",
+ "http-errors": "2.0.0",
+ "iconv-lite": "0.6.3",
+ "unpipe": "1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/react": {
+ "version": "19.1.0",
+ "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz",
+ "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/react-bootstrap": {
+ "version": "2.10.10",
+ "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.10.10.tgz",
+ "integrity": "sha512-gMckKUqn8aK/vCnfwoBpBVFUGT9SVQxwsYrp9yDHt0arXMamxALerliKBxr1TPbntirK/HGrUAHYbAeQTa9GHQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.24.7",
+ "@restart/hooks": "^0.4.9",
+ "@restart/ui": "^1.9.4",
+ "@types/prop-types": "^15.7.12",
+ "@types/react-transition-group": "^4.4.6",
+ "classnames": "^2.3.2",
+ "dom-helpers": "^5.2.1",
+ "invariant": "^2.2.4",
+ "prop-types": "^15.8.1",
+ "prop-types-extra": "^1.1.0",
+ "react-transition-group": "^4.4.5",
+ "uncontrollable": "^7.2.1",
+ "warning": "^4.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": ">=16.14.8",
+ "react": ">=16.14.0",
+ "react-dom": ">=16.14.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-dom": {
+ "version": "19.1.0",
+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz",
+ "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==",
+ "dependencies": {
+ "scheduler": "^0.26.0"
+ },
+ "peerDependencies": {
+ "react": "^19.1.0"
+ }
+ },
+ "node_modules/react-dropzone": {
+ "version": "14.3.8",
+ "resolved": "https://registry.npmjs.org/react-dropzone/-/react-dropzone-14.3.8.tgz",
+ "integrity": "sha512-sBgODnq+lcA4P296DY4wacOZz3JFpD99fp+hb//iBO2HHnyeZU3FwWyXJ6salNpqQdsZrgMrotuko/BdJMV8Ug==",
+ "dependencies": {
+ "attr-accept": "^2.2.4",
+ "file-selector": "^2.1.0",
+ "prop-types": "^15.8.1"
+ },
+ "engines": {
+ "node": ">= 10.13"
+ },
+ "peerDependencies": {
+ "react": ">= 16.8 || 18.0.0"
+ }
+ },
+ "node_modules/react-is": {
+ "version": "16.13.1",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
+ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
+ },
+ "node_modules/react-lifecycles-compat": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
+ "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
+ },
+ "node_modules/react-refresh": {
+ "version": "0.14.2",
+ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz",
+ "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/react-router": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.6.1.tgz",
+ "integrity": "sha512-hPJXXxHJZEsPFNVbtATH7+MMX43UDeOauz+EAU4cgqTn7ojdI9qQORqS8Z0qmDlL1TclO/6jLRYUEtbWidtdHQ==",
+ "dependencies": {
+ "cookie": "^1.0.1",
+ "set-cookie-parser": "^2.6.0"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=18",
+ "react-dom": ">=18"
+ },
+ "peerDependenciesMeta": {
+ "react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-router/node_modules/cookie": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz",
+ "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/react-transition-group": {
+ "version": "4.4.5",
+ "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
+ "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==",
+ "dependencies": {
+ "@babel/runtime": "^7.5.5",
+ "dom-helpers": "^5.0.1",
+ "loose-envify": "^1.4.0",
+ "prop-types": "^15.6.2"
+ },
+ "peerDependencies": {
+ "react": ">=16.6.0",
+ "react-dom": ">=16.6.0"
+ }
+ },
+ "node_modules/readdirp": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
+ "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
+ "engines": {
+ "node": ">= 14.18.0"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/remix-auth": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/remix-auth/-/remix-auth-4.2.0.tgz",
+ "integrity": "sha512-3LSfWEvSgG2CgbG/p4ge5hbV8tTXWNnnYIGbTr9oSSiHz9dD7wh6S0MEyo3pwh7MlKezB2WIlevGeyqUZykk7g==",
+ "funding": [
+ "https://github.com/sponsors/sergiodxa"
+ ],
+ "engines": {
+ "node": ">=20.0.0"
+ }
+ },
+ "node_modules/remix-auth-form": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/remix-auth-form/-/remix-auth-form-3.0.0.tgz",
+ "integrity": "sha512-2c8d9BUJhnOrXg2w/iELLMj7RYT9EDI5eip9DSfN8caCTw0V33tNXvUNW44cYJQ8CjwAPi94vVaaezCHEdTSbQ==",
+ "funding": [
+ "https://github.com/sponsors/sergiodxa"
+ ],
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "remix-auth": "^4.0.0"
+ }
+ },
+ "node_modules/require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/requires-port": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
+ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
+ },
+ "node_modules/retry": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",
+ "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/rollup": {
+ "version": "4.41.1",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.41.1.tgz",
+ "integrity": "sha512-cPmwD3FnFv8rKMBc1MxWCwVQFxwf1JEmSX3iQXrRVVG15zerAIXRjMFVWnd5Q5QvgKF7Aj+5ykXFhUl+QGnyOw==",
+ "dependencies": {
+ "@types/estree": "1.0.7"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@rollup/rollup-android-arm-eabi": "4.41.1",
+ "@rollup/rollup-android-arm64": "4.41.1",
+ "@rollup/rollup-darwin-arm64": "4.41.1",
+ "@rollup/rollup-darwin-x64": "4.41.1",
+ "@rollup/rollup-freebsd-arm64": "4.41.1",
+ "@rollup/rollup-freebsd-x64": "4.41.1",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.41.1",
+ "@rollup/rollup-linux-arm-musleabihf": "4.41.1",
+ "@rollup/rollup-linux-arm64-gnu": "4.41.1",
+ "@rollup/rollup-linux-arm64-musl": "4.41.1",
+ "@rollup/rollup-linux-loongarch64-gnu": "4.41.1",
+ "@rollup/rollup-linux-powerpc64le-gnu": "4.41.1",
+ "@rollup/rollup-linux-riscv64-gnu": "4.41.1",
+ "@rollup/rollup-linux-riscv64-musl": "4.41.1",
+ "@rollup/rollup-linux-s390x-gnu": "4.41.1",
+ "@rollup/rollup-linux-x64-gnu": "4.41.1",
+ "@rollup/rollup-linux-x64-musl": "4.41.1",
+ "@rollup/rollup-win32-arm64-msvc": "4.41.1",
+ "@rollup/rollup-win32-ia32-msvc": "4.41.1",
+ "@rollup/rollup-win32-x64-msvc": "4.41.1",
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/router": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
+ "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
+ "dependencies": {
+ "debug": "^4.4.0",
+ "depd": "^2.0.0",
+ "is-promise": "^4.0.0",
+ "parseurl": "^1.3.3",
+ "path-to-regexp": "^8.0.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+ },
+ "node_modules/scheduler": {
+ "version": "0.26.0",
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz",
+ "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA=="
+ },
+ "node_modules/semver": {
+ "version": "7.7.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz",
+ "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/send": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz",
+ "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==",
+ "dependencies": {
+ "debug": "^4.3.5",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.0",
+ "mime-types": "^3.0.1",
+ "ms": "^2.1.3",
+ "on-finished": "^2.4.1",
+ "range-parser": "^1.2.1",
+ "statuses": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
+ "node_modules/serve-static": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz",
+ "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==",
+ "dependencies": {
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "parseurl": "^1.3.3",
+ "send": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
+ "node_modules/set-cookie-parser": {
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz",
+ "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ=="
+ },
+ "node_modules/setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
+ },
+ "node_modules/shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "dependencies": {
+ "shebang-regex": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/side-channel": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
+ "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.3",
+ "side-channel-list": "^1.0.0",
+ "side-channel-map": "^1.0.1",
+ "side-channel-weakmap": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-list": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
+ "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-map": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-weakmap": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3",
+ "side-channel-map": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/signal-exit": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/source-map-support": {
+ "version": "0.5.21",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
+ "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
+ "dependencies": {
+ "buffer-from": "^1.0.0",
+ "source-map": "^0.6.0"
+ }
+ },
+ "node_modules/spdx-correct": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz",
+ "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==",
+ "dependencies": {
+ "spdx-expression-parse": "^3.0.0",
+ "spdx-license-ids": "^3.0.0"
+ }
+ },
+ "node_modules/spdx-exceptions": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz",
+ "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w=="
+ },
+ "node_modules/spdx-expression-parse": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
+ "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
+ "dependencies": {
+ "spdx-exceptions": "^2.1.0",
+ "spdx-license-ids": "^3.0.0"
+ }
+ },
+ "node_modules/spdx-license-ids": {
+ "version": "3.0.21",
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz",
+ "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg=="
+ },
+ "node_modules/statuses": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
+ "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/stream-slice": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/stream-slice/-/stream-slice-0.1.2.tgz",
+ "integrity": "sha512-QzQxpoacatkreL6jsxnVb7X5R/pGw9OUv2qWTYWnmLpg4NdN31snPy/f3TdQE1ZUXaThRvj1Zw4/OGg0ZkaLMA=="
+ },
+ "node_modules/string-width": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
+ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
+ "dependencies": {
+ "eastasianwidth": "^0.2.0",
+ "emoji-regex": "^9.2.2",
+ "strip-ansi": "^7.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/string-width-cjs": {
+ "name": "string-width",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/string-width-cjs/node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/string-width-cjs/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
+ },
+ "node_modules/string-width-cjs/node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-ansi": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+ "dependencies": {
+ "ansi-regex": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
+ "node_modules/strip-ansi-cjs": {
+ "name": "strip-ansi",
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-ansi-cjs/node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tailwindcss": {
+ "version": "4.1.8",
+ "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.8.tgz",
+ "integrity": "sha512-kjeW8gjdxasbmFKpVGrGd5T4i40mV5J2Rasw48QARfYeQ8YS9x02ON9SFWax3Qf616rt4Cp3nVNIj6Hd1mP3og==",
+ "dev": true
+ },
+ "node_modules/tapable": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz",
+ "integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tar": {
+ "version": "7.4.3",
+ "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz",
+ "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==",
+ "dev": true,
+ "dependencies": {
+ "@isaacs/fs-minipass": "^4.0.0",
+ "chownr": "^3.0.0",
+ "minipass": "^7.1.2",
+ "minizlib": "^3.0.1",
+ "mkdirp": "^3.0.1",
+ "yallist": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tar/node_modules/yallist": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
+ "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==",
+ "dev": true,
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tinyglobby": {
+ "version": "0.2.14",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz",
+ "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==",
+ "dependencies": {
+ "fdir": "^6.4.4",
+ "picomatch": "^4.0.2"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
+ "node_modules/to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dependencies": {
+ "is-number": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=8.0"
+ }
+ },
+ "node_modules/toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/tsconfck": {
+ "version": "3.1.6",
+ "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.6.tgz",
+ "integrity": "sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==",
+ "dev": true,
+ "bin": {
+ "tsconfck": "bin/tsconfck.js"
+ },
+ "engines": {
+ "node": "^18 || >=20"
+ },
+ "peerDependencies": {
+ "typescript": "^5.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/tslib": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="
+ },
+ "node_modules/type-is": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz",
+ "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",
+ "dependencies": {
+ "content-type": "^1.0.5",
+ "media-typer": "^1.1.0",
+ "mime-types": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/typed-css-modules": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/typed-css-modules/-/typed-css-modules-0.9.1.tgz",
+ "integrity": "sha512-W2HWKncdKd+bLWsnuWB2EyuQBzZ7KJ9Byr/67KLiiyGegcN52rOveun9JR8yAvuL5IXunRMxt0eORMtAUj5bmA==",
+ "dev": true,
+ "dependencies": {
+ "camelcase": "^6.0.0",
+ "chalk": "^4.0.0",
+ "chokidar": "^3.4.0",
+ "glob": "^10.3.10",
+ "icss-replace-symbols": "^1.1.0",
+ "is-there": "^4.4.2",
+ "mkdirp": "^3.0.0",
+ "postcss": "^8.0.0",
+ "postcss-modules-extract-imports": "^3.0.0",
+ "postcss-modules-local-by-default": "^4.0.0",
+ "postcss-modules-scope": "^3.0.0",
+ "postcss-modules-values": "^4.0.0",
+ "yargs": "^17.7.2"
+ },
+ "bin": {
+ "tcm": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/typed-css-modules/node_modules/chokidar": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
+ "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
+ "dev": true,
+ "dependencies": {
+ "anymatch": "~3.1.2",
+ "braces": "~3.0.2",
+ "glob-parent": "~5.1.2",
+ "is-binary-path": "~2.1.0",
+ "is-glob": "~4.0.1",
+ "normalize-path": "~3.0.0",
+ "readdirp": "~3.6.0"
+ },
+ "engines": {
+ "node": ">= 8.10.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/typed-css-modules/node_modules/picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/typed-css-modules/node_modules/readdirp": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
+ "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
+ "dev": true,
+ "dependencies": {
+ "picomatch": "^2.2.1"
+ },
+ "engines": {
+ "node": ">=8.10.0"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.8.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
+ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
+ "devOptional": true,
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/uncontrollable": {
+ "version": "7.2.1",
+ "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz",
+ "integrity": "sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.6.3",
+ "@types/react": ">=16.9.11",
+ "invariant": "^2.2.4",
+ "react-lifecycles-compat": "^3.0.4"
+ },
+ "peerDependencies": {
+ "react": ">=15.0.0"
+ }
+ },
+ "node_modules/undici": {
+ "version": "6.21.3",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz",
+ "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==",
+ "engines": {
+ "node": ">=18.17"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "6.19.8",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
+ "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="
+ },
+ "node_modules/universalify": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/update-browserslist-db": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz",
+ "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "dependencies": {
+ "escalade": "^3.2.0",
+ "picocolors": "^1.1.1"
+ },
+ "bin": {
+ "update-browserslist-db": "cli.js"
+ },
+ "peerDependencies": {
+ "browserslist": ">= 4.21.0"
+ }
+ },
+ "node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
+ "dev": true
+ },
+ "node_modules/valibot": {
+ "version": "0.41.0",
+ "resolved": "https://registry.npmjs.org/valibot/-/valibot-0.41.0.tgz",
+ "integrity": "sha512-igDBb8CTYr8YTQlOKgaN9nSS0Be7z+WRuaeYqGf3Cjz3aKmSnqEmYnkfVjzIuumGqfHpa3fLIvMEAfhrpqN8ng==",
+ "peerDependencies": {
+ "typescript": ">=5"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/validate-npm-package-license": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
+ "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
+ "dependencies": {
+ "spdx-correct": "^3.0.0",
+ "spdx-expression-parse": "^3.0.0"
+ }
+ },
+ "node_modules/validate-npm-package-name": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.1.tgz",
+ "integrity": "sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==",
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/vary": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/vite": {
+ "version": "6.3.5",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz",
+ "integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==",
+ "dependencies": {
+ "esbuild": "^0.25.0",
+ "fdir": "^6.4.4",
+ "picomatch": "^4.0.2",
+ "postcss": "^8.5.3",
+ "rollup": "^4.34.9",
+ "tinyglobby": "^0.2.13"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
+ "jiti": ">=1.21.0",
+ "less": "*",
+ "lightningcss": "^1.21.0",
+ "sass": "*",
+ "sass-embedded": "*",
+ "stylus": "*",
+ "sugarss": "*",
+ "terser": "^5.16.0",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "jiti": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vite-node": {
+ "version": "3.0.0-beta.2",
+ "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.0.0-beta.2.tgz",
+ "integrity": "sha512-ofTf6cfRdL30Wbl9n/BX81EyIR5s4PReLmSurrxQ+koLaWUNOEo8E0lCM53OJkb8vpa2URM2nSrxZsIFyvY1rg==",
+ "dependencies": {
+ "cac": "^6.7.14",
+ "debug": "^4.4.0",
+ "es-module-lexer": "^1.5.4",
+ "pathe": "^1.1.2",
+ "vite": "^5.0.0 || ^6.0.0"
+ },
+ "bin": {
+ "vite-node": "vite-node.mjs"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/vite-tsconfig-paths": {
+ "version": "5.1.4",
+ "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-5.1.4.tgz",
+ "integrity": "sha512-cYj0LRuLV2c2sMqhqhGpaO3LretdtMn/BVX4cPLanIZuwwrkVl+lK84E/miEXkCHWXuq65rhNN4rXsBcOB3S4w==",
+ "dev": true,
+ "dependencies": {
+ "debug": "^4.1.1",
+ "globrex": "^0.1.2",
+ "tsconfck": "^3.0.3"
+ },
+ "peerDependencies": {
+ "vite": "*"
+ },
+ "peerDependenciesMeta": {
+ "vite": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/warning": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
+ "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==",
+ "dependencies": {
+ "loose-envify": "^1.0.0"
+ }
+ },
+ "node_modules/which": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz",
+ "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/which.js"
+ },
+ "engines": {
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/wrap-ansi": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
+ "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
+ "dependencies": {
+ "ansi-styles": "^6.1.0",
+ "string-width": "^5.0.1",
+ "strip-ansi": "^7.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/wrap-ansi-cjs": {
+ "name": "wrap-ansi",
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
+ },
+ "node_modules/wrap-ansi-cjs/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
+ },
+ "node_modules/y18n": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/yallist": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
+ },
+ "node_modules/yargs": {
+ "version": "17.7.2",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
+ "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
+ "dev": true,
+ "dependencies": {
+ "cliui": "^8.0.1",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.3",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^21.1.1"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/yargs-parser": {
+ "version": "21.1.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
+ "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
+ "dev": true,
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/yargs/node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/yargs/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "node_modules/yargs/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/yargs/node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ }
+ }
+}
diff --git a/frontend/package.json b/frontend/package.json
new file mode 100644
index 00000000..8b42f5da
--- /dev/null
+++ b/frontend/package.json
@@ -0,0 +1,48 @@
+{
+ "name": "nzb-webdav",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "build": "react-router build",
+ "dev": "cross-env NODE_ENV=development PORT=5173 node server.js",
+ "start": "node server.js",
+ "typecheck": "react-router typegen && tsc -b"
+ },
+ "dependencies": {
+ "@react-router/express": "^7.5.3",
+ "@react-router/fs-routes": "^7.6.1",
+ "@react-router/node": "^7.5.3",
+ "bootstrap": "^5.3.6",
+ "compression": "^1.7.5",
+ "express": "^5.1.0",
+ "http-proxy-middleware": "^3.0.5",
+ "isbot": "^5.1.27",
+ "mime-types": "^3.0.1",
+ "morgan": "^1.10.0",
+ "react": "^19.1.0",
+ "react-bootstrap": "^2.10.10",
+ "react-dom": "^19.1.0",
+ "react-dropzone": "^14.3.8",
+ "react-router": "^7.5.3",
+ "remix-auth": "^4.2.0",
+ "remix-auth-form": "^3.0.0"
+ },
+ "devDependencies": {
+ "@react-router/dev": "^7.5.3",
+ "@tailwindcss/vite": "^4.1.4",
+ "@types/compression": "^1.7.5",
+ "@types/express": "^5.0.1",
+ "@types/express-serve-static-core": "^5.0.6",
+ "@types/mime-types": "^3.0.1",
+ "@types/morgan": "^1.9.9",
+ "@types/node": "^20",
+ "@types/react": "^19.1.2",
+ "@types/react-dom": "^19.1.2",
+ "cross-env": "^7.0.3",
+ "tailwindcss": "^4.1.4",
+ "typed-css-modules": "^0.9.1",
+ "typescript": "^5.8.3",
+ "vite": "^6.3.3",
+ "vite-tsconfig-paths": "^5.1.4"
+ }
+}
diff --git a/frontend/public/logo.svg b/frontend/public/logo.svg
new file mode 100644
index 00000000..50b0bce2
--- /dev/null
+++ b/frontend/public/logo.svg
@@ -0,0 +1 @@
+<svg width="1000" xmlns="http://www.w3.org/2000/svg" height="1143.43" id="screenshot-dcc0b0bc-a1d5-807a-8006-469d348a177c" viewBox="0 0 1000 1143.43" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1"><g id="shape-dcc0b0bc-a1d5-807a-8006-469d348a177c" data-testid="Group" rx="0" ry="0"><g id="shape-dcc0b0bc-a1d5-807a-8006-469aa659ad9f" data-testid="Mask" rx="0" ry="0"><g clip-path="url(#render-2-410d00d8-a97d-8018-8006-469a0b802398-clip)"><g mask="url(#render-2-410d00d8-a97d-8018-8006-469a0b802398-mask)"><defs><filter id="render-2-410d00d8-a97d-8018-8006-469a0b802398-filter"><feFlood flood-color="white" result="FloodResult"/><feComposite in="FloodResult" in2="SourceGraphic" operator="in" result="comp"/></filter><clipPath id="render-2-410d00d8-a97d-8018-8006-469a0b802398-clip" class="mask-clip-path"><polyline points="0,0 1000,0 1000,1143.4296346275726 0,1143.4296346275726"/></clipPath><mask width="1000" maskUnits="userSpaceOnUse" height="1143.4296346275726" class="mask-shape" x="0" id="render-2-410d00d8-a97d-8018-8006-469a0b802398-mask" data-old-y="0" data-old-width="1000" data-old-x="0" y="0" data-old-height="1143.4296346275726"><g filter="url(#render-2-410d00d8-a97d-8018-8006-469a0b802398-filter)"><g id="shape-410d00d8-a97d-8018-8006-469a0b802398" data-testid="svg-path"><g class="fills" id="fills-410d00d8-a97d-8018-8006-469a0b802398"><path d="M0.000,107.197C0.000,47.994,47.969,0.000,107.143,0.000L598.500,0.000C626.906,0.025,654.140,11.335,674.214,31.444L968.643,325.877C988.751,346.008,1000.032,373.313,1000.000,401.773L1000.000,1036.233C1000.000,1095.436,952.031,1143.430,892.857,1143.430L107.143,1143.430C47.969,1143.430,0.000,1095.436,0.000,1036.233Z" style="fill: rgb(0, 0, 0);"/></g></g></g></mask></defs><g id="shape-dcc0b0bc-a1d5-807a-8006-469a8ad4ede0" data-testid="svg" width="500" height="500" rx="0" ry="0" style="fill: rgb(0, 0, 0);"><g id="shape-dcc0b0bc-a1d5-807a-8006-469a8ad4ede1" data-testid="svg-ellipse"><defs><radialGradient id="render-5-grad1" cx="0.5" cy="0.5" r="0.5" fx="0.5" fy="0.5"><stop offset="0" style="stop-color: rgb(255, 0, 0); stop-opacity: 1;"/><stop offset="1" style="stop-color: rgb(255, 100, 0); stop-opacity: 1;"/></radialGradient><radialGradient id="fill-color-gradient-render-5-0" cx="0.7363184336182638" cy="0.7805342170628501" r="0.5117203773125844" gradientTransform="matrix(0.886556, -0.462622, 0.462622, 0.886556, -0.277561, 0.429184)"><stop offset="0" stop-color="#da121e" stop-opacity="1"/><stop offset="1" stop-color="#ff6920" stop-opacity="1"/></radialGradient><pattern patternUnits="userSpaceOnUse" x="-703.5888704344144" y="-336.79344578085477" width="1501.031427778925" height="1126.413408276056" id="fill-0-render-5"><g><rect width="1501.031427778925" height="1126.413408276056" style="fill: url(&quot;#fill-color-gradient-render-5-0&quot;);"/></g></pattern></defs><g class="fills" id="fills-dcc0b0bc-a1d5-807a-8006-469a8ad4ede1"><ellipse cx="46.92684345504813" cy="226.41325835717328" rx="750.5157138894625" ry="563.206704138028" transform="matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)" fill="url(#fill-0-render-5)"/></g></g><g id="shape-dcc0b0bc-a1d5-807a-8006-469a8ad4ede2" data-testid="svg-ellipse"><defs><radialGradient id="render-6-grad2" cx="0.5" cy="0.5" r="0.5" fx="0.5" fy="0.5"><stop offset="0" style="stop-color: rgb(0, 255, 0); stop-opacity: 1;"/><stop offset="1" style="stop-color: rgb(0, 100, 255); stop-opacity: 1;"/></radialGradient></defs><g class="fills" id="fills-dcc0b0bc-a1d5-807a-8006-469a8ad4ede2"><ellipse cx="1338.1375352522793" cy="527.398866171551" rx="938.1446423618279" ry="750.9422721840377" transform="matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)" fill="url(#render-6-grad2)" style="fill: url(&quot;#render-6-grad2&quot;);"/></g></g><g id="shape-dcc0b0bc-a1d5-807a-8006-469a8ad4ede3" data-testid="svg-ellipse"><defs><radialGradient id="render-7-grad3" cx="0.5" cy="0.5" r="0.5" fx="0.5" fy="0.5"><stop offset="0" style="stop-color: rgb(255, 0, 255); stop-opacity: 1;"/><stop offset="1" style="stop-color: rgb(100, 0, 255); stop-opacity: 1;"/></radialGradient></defs><g class="fills" id="fills-dcc0b0bc-a1d5-807a-8006-469a8ad4ede3"><ellipse cx="148.75279054658358" cy="1229.32485523095" rx="844.3301781256448" ry="657.0744881610337" transform="matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)" fill="url(#render-7-grad3)" style="fill: url(&quot;#render-7-grad3&quot;);"/></g></g></g></g></g></g><g id="shape-dcc0b0bc-a1d5-807a-8006-469c52f31a16" data-testid="svg-path"><g class="fills" id="fills-dcc0b0bc-a1d5-807a-8006-469c52f31a16"><path d="M702.132,533.275L632.286,533.275L632.286,313.879C632.286,289.746,612.518,270.000,588.357,270.000L412.643,270.000C388.482,270.000,368.714,289.746,368.714,313.879L368.714,533.275L298.868,533.275C259.771,533.275,240.004,580.665,267.679,608.309L469.311,809.715C486.443,826.828,514.118,826.828,531.250,809.715L732.882,608.309C760.557,580.665,741.229,533.275,702.132,533.275ZM193.000,972.068C193.000,996.201,212.768,1015.947,236.929,1015.947L764.071,1015.947C788.232,1015.947,808.000,996.201,808.000,972.068C808.000,947.934,788.232,928.189,764.071,928.189L236.929,928.189C212.768,928.189,193.000,947.934,193.000,972.068Z" style="fill: rgb(255, 255, 255); fill-opacity: 1;"/></g></g></g></svg>
\ No newline at end of file
diff --git a/frontend/react-router.config.ts b/frontend/react-router.config.ts
new file mode 100644
index 00000000..6ff16f91
--- /dev/null
+++ b/frontend/react-router.config.ts
@@ -0,0 +1,7 @@
+import type { Config } from "@react-router/dev/config";
+
+export default {
+ // Config options...
+ // Server-side render by default, to enable SPA mode set this to `false`
+ ssr: true,
+} satisfies Config;
diff --git a/frontend/server.js b/frontend/server.js
new file mode 100644
index 00000000..50fea2bf
--- /dev/null
+++ b/frontend/server.js
@@ -0,0 +1,47 @@
+import compression from "compression";
+import express from "express";
+import morgan from "morgan";
+
+// Short-circuit the type-checking of the built output.
+const BUILD_PATH = "./build/server/index.js";
+const DEVELOPMENT = process.env.NODE_ENV === "development";
+const PORT = Number.parseInt(process.env.PORT || "3000");
+
+const app = express();
+
+app.use(compression());
+app.disable("x-powered-by");
+
+if (DEVELOPMENT) {
+ console.log("Starting development server");
+ const viteDevServer = await import("vite").then((vite) =>
+ vite.createServer({
+ server: { middlewareMode: true },
+ }),
+ );
+ app.use(viteDevServer.middlewares);
+ app.use(async (req, res, next) => {
+ try {
+ const source = await viteDevServer.ssrLoadModule("./server/app.ts");
+ return await source.app(req, res, next);
+ } catch (error) {
+ if (typeof error === "object" && error instanceof Error) {
+ viteDevServer.ssrFixStacktrace(error);
+ }
+ next(error);
+ }
+ });
+} else {
+ console.log("Starting production server");
+ app.use(
+ "/assets",
+ express.static("build/client/assets", { immutable: true, maxAge: "1y" }),
+ );
+ app.use(morgan("tiny"));
+ app.use(express.static("build/client", { maxAge: "1h" }));
+ app.use(await import(BUILD_PATH).then((mod) => mod.app));
+}
+
+app.listen(PORT, () => {
+ console.log(`Server is running on http://localhost:${PORT}`);
+});
diff --git a/frontend/server/app.ts b/frontend/server/app.ts
new file mode 100644
index 00000000..df861cda
--- /dev/null
+++ b/frontend/server/app.ts
@@ -0,0 +1,45 @@
+import "react-router";
+import { createRequestHandler } from "@react-router/express";
+import express from "express";
+import { createProxyMiddleware } from "http-proxy-middleware";
+
+declare module "react-router" {
+ interface AppLoadContext {
+ VALUE_FROM_EXPRESS: string;
+ }
+}
+
+export const app = express();
+
+// Proxy all webdav and api requests to the backend
+const forwardToBackend = createProxyMiddleware({
+ target: process.env.BACKEND_URL,
+ changeOrigin: true,
+});
+
+app.use((req, res, next) => {
+ if (
+ req.method.toUpperCase() === "PROPFIND"
+ || req.method.toUpperCase() === "OPTIONS"
+ || req.path.startsWith("/api")
+ || req.path.startsWith("/view")
+ || req.path.startsWith("/nzbs")
+ || req.path.startsWith("/content")
+ || req.path.startsWith("/completed-symlinks")
+ ) {
+ return forwardToBackend(req, res, next);
+ }
+ next();
+});
+
+// Let frontend handle all other requests
+app.use(
+ createRequestHandler({
+ build: () => import("virtual:react-router/server-build"),
+ getLoadContext() {
+ return {
+ VALUE_FROM_EXPRESS: "Hello from Express",
+ };
+ },
+ }),
+);
\ No newline at end of file
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
new file mode 100644
index 00000000..cea27d48
--- /dev/null
+++ b/frontend/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "files": [],
+ "references": [
+ { "path": "./tsconfig.node.json" },
+ { "path": "./tsconfig.vite.json" }
+ ],
+ "compilerOptions": {
+ "checkJs": true,
+ "verbatimModuleSyntax": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "noEmit": true
+ }
+}
diff --git a/frontend/tsconfig.node.json b/frontend/tsconfig.node.json
new file mode 100644
index 00000000..12107b46
--- /dev/null
+++ b/frontend/tsconfig.node.json
@@ -0,0 +1,13 @@
+{
+ "extends": "./tsconfig.json",
+ "include": ["server.js", "vite.config.ts"],
+ "compilerOptions": {
+ "composite": true,
+ "strict": true,
+ "types": ["node"],
+ "lib": ["ES2022"],
+ "target": "ES2022",
+ "module": "ES2022",
+ "moduleResolution": "bundler"
+ }
+}
diff --git a/frontend/tsconfig.vite.json b/frontend/tsconfig.vite.json
new file mode 100644
index 00000000..566c892a
--- /dev/null
+++ b/frontend/tsconfig.vite.json
@@ -0,0 +1,27 @@
+{
+ "extends": "./tsconfig.json",
+ "include": [
+ ".react-router/types/**/*",
+ "app/**/*",
+ "app/**/.server/**/*",
+ "app/**/.client/**/*",
+ "server/**/*"
+ ],
+ "compilerOptions": {
+ "composite": true,
+ "strict": true,
+ "lib": ["DOM", "DOM.Iterable", "ES2022"],
+ "types": ["vite/client"],
+ "target": "ES2022",
+ "module": "ES2022",
+ "moduleResolution": "bundler",
+ "jsx": "react-jsx",
+ "baseUrl": ".",
+ "rootDirs": [".", "./.react-router/types"],
+ "paths": {
+ "~/*": ["./app/*"]
+ },
+ "esModuleInterop": true,
+ "resolveJsonModule": true
+ }
+}
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
new file mode 100644
index 00000000..d60dca0c
--- /dev/null
+++ b/frontend/vite.config.ts
@@ -0,0 +1,18 @@
+import { reactRouter } from "@react-router/dev/vite";
+import tailwindcss from "@tailwindcss/vite";
+import { defineConfig } from "vite";
+import tsconfigPaths from "vite-tsconfig-paths";
+
+export default defineConfig(({ isSsrBuild }) => ({
+ server: {
+ allowedHosts: [".net"],
+ },
+ build: {
+ rollupOptions: isSsrBuild ? { input: "./server/app.ts" } : undefined,
+ },
+ plugins: [
+ tailwindcss(),
+ reactRouter(),
+ tsconfigPaths()
+ ],
+}));