Compare commits

..
28 Commits
Author SHA1 Message Date
Lan 0504e6e4dc chore: update Dockerfile to set HOST to 0.0.0.0 and reduce WORKERS to 1 2026-01-27 10:37:17 +08:00
Lan 24d49e1c9a chore: reduce number of workers in Dockerfile from 4 to 2 2026-01-27 10:05:33 +08:00
Lan a3f599fe51 refactor: streamline admin authorization logic and improve token handling 2026-01-25 23:40:15 +08:00
Lan 2e5dc532a0 perf: optimize memory usage for large file uploads 2026-01-25 21:28:16 +08:00
Lan 7f46c58898 ci: add dev branch support for Docker image builds 2026-01-25 21:27:59 +08:00
Lan 5a889bab47 feat: enhance file retrieval by using Pydantic models for serialization 2026-01-25 20:53:04 +08:00
Lan 5fee1c7b86 docs: update README files with improved formatting and additional features 2026-01-25 14:12:20 +08:00
Lan 73017935e9 fix: make detail field optional in APIResponse model 2026-01-24 15:28:17 +08:00
Lan a35b3c8262 feat: update Docker configuration and add environment variable documentation 2026-01-24 11:58:23 +08:00
Lan da5dc378a7 fix: return a dictionary from get_config method in ConfigService 2026-01-24 11:28:32 +08:00
Lan d170ca8005 feat: update Dockerfile to clone frontend themes into build directory and add legacy peer dependencies 2026-01-24 11:03:33 +08:00
Lan 0fe01c98db feat: update Dockerfile to use Node.js 20 and add build dependencies 2026-01-24 10:57:32 +08:00
Lan d5b0327f90 feat: add configuration documentation for OneDrive and OpenDAL storage integration 2026-01-24 10:53:48 +08:00
Lan 9120486449 Merge pull request #454 from jerryliang122/proxy-download
优化启用下载代理
2026-01-24 10:44:48 +08:00
Lan f5a5e03269 feat: update Dockerfile for multi-stage build and add frontend themes; update dependencies in requirements.txt 2026-01-24 10:31:43 +08:00
jerryliang ade5799db4 fix: 仅在获取到文件大小时才设置 Content-Length 头 2026-01-16 17:55:12 +08:00
jerryliang 6b728abbeb perf: 复用ClientSession提升文件下载性能 2026-01-16 17:33:22 +08:00
jerryliang ff1943d60c fix: 使用标准方法编码下载文件名 2026-01-16 17:18:14 +08:00
jerryliang 442ef5b0e0 feat: 优化文件下载响应中的Content-Length获取逻辑
为所有存储后端添加文件大小获取逻辑,优先从实际存储系统获取文件大小,失败时回退到数据库记录的大小
2026-01-16 16:53:39 +08:00
jerryliang 34e36944bd feat: 在所有存储实现中添加Content-Length响应头 2026-01-16 16:44:06 +08:00
jerryliang ba8802ad75 feat: 为所有存储后端实现流式文件下载
将文件下载方式从全量读取改为流式传输,减少内存占用并提高大文件下载性能
支持S3、OneDrive、OpenDAL和WebDAV存储后端的流式下载
添加错误处理和HTTP异常捕获
2026-01-16 15:45:12 +08:00
Lan bf43727531 Merge remote-tracking branch 'origin/master' 2026-01-11 14:26:02 +08:00
Lan d49a61d06e chore: update dependencies in requirements.txt 2026-01-11 14:25:53 +08:00
Lan 3074d9ba2e feat: https://github.com/vastsa/FileCodeBox/issues/442 密码进行hash存储 2026-01-07 20:36:59 +08:00
Lan 81ee640353 feat: https://github.com/vastsa/FileCodeBox/issues/386 https://github.com/vastsa/FileCodeBox/issues/380 2026-01-07 20:28:06 +08:00
Lan e87bcfcce5 fix: https://github.com/vastsa/FileCodeBox/issues/407 2026-01-07 20:04:44 +08:00
Lan e80be564a5 fix: https://github.com/vastsa/FileCodeBox/issues/362 2026-01-07 19:50:02 +08:00
Lan 69972e28b3 fix: https://github.com/vastsa/FileCodeBox/issues/449 2026-01-01 12:46:10 +08:00
144 changed files with 1930 additions and 1468 deletions

No files matched your search

+49 -2
View File
@@ -1,3 +1,50 @@
*.md
.idea
# Git
.git
.gitignore
.gitattributes
# IDE
.idea
.vscode
*.swp
*.swo
# Documentation
*.md
docs/
LICENSE
# Development
.venv
__pycache__
*.pyc
*.pyo
.pytest_cache
.coverage
htmlcov/
# macOS
.DS_Store
._*
# Frontend source (will be built from GitHub)
fcb-fronted/
themes/
# Test files
test_*.py
tests/
# Data (should be mounted as volume)
data/
# GitHub
.github/
# Docker
Dockerfile
docker-compose.yml
.dockerignore
# Claude
.claude/
+2
View File
@@ -5,6 +5,7 @@ on:
push:
branches:
- master
- dev
tags:
- 'v*'
@@ -31,6 +32,7 @@ jobs:
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' }}
type=raw,value=beta,enable={{is_default_branch}}
type=raw,value=latest,enable={{is_default_branch}}
+3 -2
View File
@@ -158,7 +158,8 @@ data/.env
# Ignore node_modules
node_modules/
AGENTS.md
dist/
dist/
# Frontend themes (built from GitHub during Docker build)
themes/
+47 -15
View File
@@ -1,24 +1,56 @@
FROM python:3.9.5-slim-buster
# 第一阶段:构建前端主题
FROM node:20-alpine AS frontend-builder
RUN apk add --no-cache git python3 make g++
WORKDIR /build
# 克隆并构建 2024 主题
RUN git clone --depth 1 https://github.com/vastsa/FileCodeBoxFronted.git /build/fronted-2024 && \
cd /build/fronted-2024 && \
npm install && \
npm run build
# 克隆并构建 2023 主题
RUN git clone --depth 1 https://github.com/vastsa/FileCodeBoxFronted2023.git /build/fronted-2023 && \
cd /build/fronted-2023 && \
npm install --legacy-peer-deps && \
npm run build
# 第二阶段:构建最终镜像
FROM python:3.12-slim-bookworm
LABEL author="Lan"
LABEL email="xzu@live.com"
# 将当前目录下的文件复制到容器的 /app 目录
COPY . /app
# 设置时区为亚洲/上海
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
# 设置工作目录
WORKDIR /app
# 删除不必要的目录,减少镜像体积
RUN rm -rf docs fcb-fronted
# 复制项目文件(通过 .dockerignore 排除不必要的文件)
COPY . .
# 安装依赖
RUN pip install -r requirements.txt
# 设置时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo 'Asia/Shanghai' > /etc/timezone
# 从构建阶段复制编译好的前端主题
COPY --from=frontend-builder /build/fronted-2024/dist ./themes/2024
COPY --from=frontend-builder /build/fronted-2023/dist ./themes/2023
# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt
# 环境变量配置
ENV HOST="0.0.0.0" \
PORT=12345 \
WORKERS=1 \
LOG_LEVEL="info"
# 暴露端口
EXPOSE 12345
# 启动应用
CMD ["python", "main.py"]
# 生产环境启动命令
CMD uvicorn main:app \
--host $HOST \
--port $PORT \
--workers $WORKERS \
--log-level $LOG_LEVEL \
--proxy-headers \
--forwarded-allow-ips "*"
+33 -41
View File
@@ -50,7 +50,7 @@ def verify_token(token: str) -> dict:
).digest()
expected_signature_b64 = base64.b64encode(expected_signature).decode()
if signature_b64 != expected_signature_b64:
if not hmac.compare_digest(signature_b64, expected_signature_b64):
raise ValueError("无效的签名")
# 解码payload
@@ -65,39 +65,41 @@ def verify_token(token: str) -> dict:
raise ValueError(f"token验证失败: {str(e)}")
def _extract_bearer_token(authorization: str) -> str:
if not authorization or not authorization.startswith("Bearer "):
raise HTTPException(status_code=401, detail="未授权或授权校验失败")
token = authorization.split(" ", 1)[1].strip()
if not token:
raise HTTPException(status_code=401, detail="未授权或授权校验失败")
return token
def _require_admin_payload(authorization: str) -> dict:
token = _extract_bearer_token(authorization)
try:
payload = verify_token(token)
except ValueError as e:
raise HTTPException(status_code=401, detail=str(e))
if not payload.get("is_admin", False):
raise HTTPException(status_code=401, detail="未授权或授权校验失败")
return payload
ADMIN_PUBLIC_ENDPOINTS = {("POST", "/admin/login")}
async def admin_required(
authorization: str = Header(default=None), request: Request = None
):
"""
验证管理员权限
"""
try:
if not authorization or not authorization.startswith("Bearer "):
is_admin = False
else:
try:
token = authorization.split(" ")[1]
payload = verify_token(token)
is_admin = payload.get("is_admin", False)
except ValueError as e:
is_admin = False
if request.url.path.startswith("/share/"):
if not settings.openUpload and not is_admin:
raise HTTPException(
status_code=403, detail="本站未开启游客上传,如需上传请先登录后台"
)
else:
if not is_admin:
raise HTTPException(status_code=401, detail="未授权或授权校验失败")
return is_admin
except ValueError as e:
raise HTTPException(status_code=401, detail=str(e))
if request and (request.method, request.url.path) in ADMIN_PUBLIC_ENDPOINTS:
return None
return _require_admin_payload(authorization)
async def share_required_login(
authorization: str = Header(default=None), request: Request = None
):
async def share_required_login(authorization: str = Header(default=None)):
"""
验证分享上传权限
@@ -109,21 +111,11 @@ async def share_required_login(
:return: 验证结果
"""
if not settings.openUpload:
try:
if not authorization or not authorization.startswith("Bearer "):
raise HTTPException(
status_code=403, detail="本站未开启游客上传,如需上传请先登录后台"
)
token = authorization.split(" ")[1]
try:
payload = verify_token(token)
if not payload.get("is_admin", False):
raise HTTPException(status_code=401, detail="未授权或授权校验失败")
except ValueError as e:
raise HTTPException(status_code=401, detail=str(e))
except Exception as e:
raise HTTPException(status_code=401, detail="认证失败:" + str(e))
if not authorization or not authorization.startswith("Bearer "):
raise HTTPException(
status_code=403, detail="本站未开启游客上传,如需上传请先登录后台"
)
_require_admin_payload(authorization)
return True
+16 -4
View File
@@ -4,10 +4,11 @@ import time
from core.response import APIResponse
from core.storage import FileStorageInterface, storages
from core.settings import settings
from apps.base.models import FileCodes, KeyValue
from apps.base.models import FileCodes, KeyValue, file_codes_pydantic
from apps.base.utils import get_expire_info, get_file_path_name
from fastapi import HTTPException
from core.settings import data_root
from core.utils import hash_password, is_password_hashed
class FileService:
@@ -25,7 +26,10 @@ class FileService:
await FileCodes.filter(prefix__icontains=keyword).limit(size).offset(offset)
)
total = await FileCodes.filter(prefix__icontains=keyword).count()
return files, total
files_pydantic = [
await file_codes_pydantic.from_tortoise_orm(f) for f in files
]
return files_pydantic, total
async def download_file(self, file_id: int):
file_code = await FileCodes.filter(id=file_id).first()
@@ -69,13 +73,16 @@ class FileService:
class ConfigService:
def get_config(self):
return settings.items()
return dict(settings.items())
async def update_config(self, data: dict):
admin_token = data.get("admin_token")
if admin_token is None or admin_token == "":
raise HTTPException(status_code=400, detail="管理员密码不能为空")
if not is_password_hashed(admin_token):
data["admin_token"] = hash_password(admin_token)
for key, value in data.items():
if key not in settings.default_config:
continue
@@ -108,7 +115,12 @@ class LocalFileService:
if not os.path.exists(data_root / "local"):
os.makedirs(data_root / "local")
for file in os.listdir(data_root / "local"):
files.append(LocalFileClass(file))
local_file = LocalFileClass(file)
files.append({
"file": local_file.file,
"ctime": local_file.ctime,
"size": local_file.size,
})
return files
async def delete_file(self, filename: str):
+29 -36
View File
@@ -17,36 +17,34 @@ from core.response import APIResponse
from apps.base.models import FileCodes, KeyValue
from apps.admin.dependencies import create_token
from core.settings import settings
from core.utils import get_now, verify_password
admin_api = APIRouter(prefix="/admin", tags=["管理"])
admin_api = APIRouter(
prefix="/admin", tags=["管理"], dependencies=[Depends(admin_required)]
)
@admin_api.post("/login")
async def login(data: LoginData):
# 验证管理员密码
if data.password != settings.admin_token:
if not verify_password(data.password, settings.admin_token):
raise HTTPException(status_code=401, detail="密码错误")
# 生成包含管理员身份的token
token = create_token({"is_admin": True})
return APIResponse(detail={"token": token, "token_type": "Bearer"})
@admin_api.get("/dashboard")
async def dashboard(admin: bool = Depends(admin_required)):
async def dashboard():
all_codes = await FileCodes.all()
all_size = str(sum([code.size for code in all_codes]))
sys_start = await KeyValue.filter(key="sys_start").first()
# 获取当前日期时间
now = datetime.datetime.now()
now = await get_now()
today_start = now.replace(hour=0, minute=0, second=0, microsecond=0)
yesterday_start = today_start - datetime.timedelta(days=1)
yesterday_end = today_start - datetime.timedelta(microseconds=1)
# 统计昨天一整天的记录数(从昨天0点到23:59:59)
yesterday_codes = FileCodes.filter(
created_at__gte=yesterday_start, created_at__lte=yesterday_end
)
# 统计今天到现在的记录数(从今天0点到现在)
today_codes = FileCodes.filter(created_at__gte=today_start)
return APIResponse(
detail={
@@ -63,9 +61,8 @@ async def dashboard(admin: bool = Depends(admin_required)):
@admin_api.delete("/file/delete")
async def file_delete(
data: IDData,
file_service: FileService = Depends(get_file_service),
admin: bool = Depends(admin_required),
data: IDData,
file_service: FileService = Depends(get_file_service),
):
await file_service.delete_file(data.id)
return APIResponse()
@@ -73,11 +70,10 @@ async def file_delete(
@admin_api.get("/file/list")
async def file_list(
page: int = 1,
size: int = 10,
keyword: str = "",
file_service: FileService = Depends(get_file_service),
admin: bool = Depends(admin_required),
page: int = 1,
size: int = 10,
keyword: str = "",
file_service: FileService = Depends(get_file_service),
):
files, total = await file_service.list_files(page, size, keyword)
return APIResponse(
@@ -92,17 +88,15 @@ async def file_list(
@admin_api.get("/config/get")
async def get_config(
config_service: ConfigService = Depends(get_config_service),
admin: bool = Depends(admin_required),
config_service: ConfigService = Depends(get_config_service),
):
return APIResponse(detail=config_service.get_config())
@admin_api.patch("/config/update")
async def update_config(
data: dict,
config_service: ConfigService = Depends(get_config_service),
admin: bool = Depends(admin_required),
data: dict,
config_service: ConfigService = Depends(get_config_service),
):
data.pop("themesChoices")
await config_service.update_config(data)
@@ -111,9 +105,8 @@ async def update_config(
@admin_api.get("/file/download")
async def file_download(
id: int,
file_service: FileService = Depends(get_file_service),
admin: bool = Depends(admin_required),
id: int,
file_service: FileService = Depends(get_file_service),
):
file_content = await file_service.download_file(id)
return file_content
@@ -121,8 +114,7 @@ async def file_download(
@admin_api.get("/local/lists")
async def get_local_lists(
local_file_service: LocalFileService = Depends(get_local_file_service),
admin: bool = Depends(admin_required),
local_file_service: LocalFileService = Depends(get_local_file_service),
):
files = await local_file_service.list_files()
return APIResponse(detail=files)
@@ -130,9 +122,8 @@ async def get_local_lists(
@admin_api.delete("/local/delete")
async def delete_local_file(
item: DeleteItem,
local_file_service: LocalFileService = Depends(get_local_file_service),
admin: bool = Depends(admin_required),
item: DeleteItem,
local_file_service: LocalFileService = Depends(get_local_file_service),
):
result = await local_file_service.delete_file(item.filename)
return APIResponse(detail=result)
@@ -140,9 +131,8 @@ async def delete_local_file(
@admin_api.post("/local/share")
async def share_local_file(
item: ShareItem,
file_service: FileService = Depends(get_file_service),
admin: bool = Depends(admin_required),
item: ShareItem,
file_service: FileService = Depends(get_file_service),
):
share_info = await file_service.share_local_file(item)
return APIResponse(detail=share_info)
@@ -150,8 +140,7 @@ async def share_local_file(
@admin_api.patch("/file/update")
async def update_file(
data: UpdateFileData,
admin: bool = Depends(admin_required),
data: UpdateFileData,
):
file_code = await FileCodes.filter(id=data.id).first()
if not file_code:
@@ -167,7 +156,11 @@ async def update_file(
update_data["prefix"] = data.prefix
if data.suffix is not None and data.suffix != file_code.suffix:
update_data["suffix"] = data.suffix
if data.expired_at is not None and data.expired_at != "" and data.expired_at != file_code.expired_at:
if (
data.expired_at is not None
and data.expired_at != ""
and data.expired_at != file_code.expired_at
):
update_data["expired_at"] = data.expired_at
if data.expired_count is not None and data.expired_count != file_code.expired_count:
update_data["expired_count"] = data.expired_count
+14
View File
@@ -0,0 +1,14 @@
from tortoise import connections
async def add_save_path_to_uploadchunk():
conn = connections.get("default")
await conn.execute_script(
"""
ALTER TABLE uploadchunk ADD COLUMN save_path VARCHAR(512) NULL;
"""
)
async def migrate():
await add_save_path_to_uploadchunk()
+5 -1
View File
@@ -49,6 +49,7 @@ class UploadChunk(models.Model):
file_size = fields.BigIntField()
chunk_size = fields.IntField()
file_name = fields.CharField(max_length=255)
save_path = fields.CharField(max_length=512, null=True)
created_at = fields.DatetimeField(auto_now_add=True)
completed = fields.BooleanField(default=False)
@@ -66,6 +67,7 @@ class KeyValue(Model):
class PresignUploadSession(models.Model):
"""预签名上传会话模型"""
id = fields.IntField(pk=True)
upload_id = fields.CharField(max_length=36, unique=True, index=True)
file_name = fields.CharField(max_length=255)
@@ -85,4 +87,6 @@ class PresignUploadSession(models.Model):
file_codes_pydantic = pydantic_model_creator(FileCodes, name="FileCodes")
upload_chunk_pydantic = pydantic_model_creator(UploadChunk, name="UploadChunk")
key_value_pydantic = pydantic_model_creator(KeyValue, name="KeyValue")
presign_upload_session_pydantic = pydantic_model_creator(PresignUploadSession, name="PresignUploadSession")
presign_upload_session_pydantic = pydantic_model_creator(
PresignUploadSession, name="PresignUploadSession"
)
+23 -21
View File
@@ -10,30 +10,32 @@ from typing import Optional, Tuple
from apps.base.dependencies import IPRateLimit
from apps.base.models import FileCodes
from core.settings import settings
from core.utils import get_random_num, get_random_string, max_save_times_desc, sanitize_filename
from core.utils import (
get_random_num,
get_random_string,
max_save_times_desc,
sanitize_filename,
get_now,
)
async def get_file_path_name(file: UploadFile) -> Tuple[str, str, str, str, str]:
"""获取文件路径和文件名"""
today = datetime.datetime.now()
storage_path = settings.storage_path.strip("/") # 移除开头和结尾的斜杠
today = await get_now()
storage_path = settings.storage_path.strip("/")
file_uuid = uuid.uuid4().hex
# 一些客户端对非ASCII字符会进行编码,需要解码
filename = await sanitize_filename(unquote(file.filename))
# 使用 UUID 作为子目录名
filename = await sanitize_filename(unquote(file.filename or ""))
base_path = f"share/data/{today.strftime('%Y/%m/%d')}/{file_uuid}"
# 如果设置了存储路径,将其添加到基础路径中
path = f"{storage_path}/{base_path}" if storage_path else base_path
prefix, suffix = os.path.splitext(filename)
# 保持原始文件名
save_path = f"{path}/{filename}"
return path, suffix, prefix, filename, save_path
async def get_chunk_file_path_name(file_name: str, upload_id: str) -> Tuple[str, str, str, str, str]:
"""获取切片文件的路径和文件名"""
today = datetime.datetime.now()
storage_path = settings.storage_path.strip("/") # 移除开头和结尾的斜杠
async def get_chunk_file_path_name(
file_name: str, upload_id: str
) -> Tuple[str, str, str, str, str]:
today = await get_now()
storage_path = settings.storage_path.strip("/")
base_path = f"share/data/{today.strftime('%Y/%m/%d')}/{upload_id}"
path = f"{storage_path}/{base_path}" if storage_path else base_path
prefix, suffix = os.path.splitext(file_name)
@@ -41,10 +43,11 @@ async def get_chunk_file_path_name(file_name: str, upload_id: str) -> Tuple[str,
return path, suffix, prefix, file_name, save_path
async def get_expire_info(expire_value: int, expire_style: str) -> Tuple[Optional[datetime.datetime], int, int, str]:
"""获取过期信息"""
async def get_expire_info(
expire_value: int, expire_style: str
) -> Tuple[Optional[datetime.datetime], int, int, str]:
expired_count, used_count = -1, 0
now = datetime.datetime.now()
now = await get_now()
code = None
max_timedelta = (
@@ -64,7 +67,7 @@ async def get_expire_info(expire_value: int, expire_style: str) -> Tuple[Optiona
"hour": lambda: now + datetime.timedelta(hours=expire_value),
"minute": lambda: now + datetime.timedelta(minutes=expire_value),
"count": lambda: (now + datetime.timedelta(days=1), expire_value),
"forever": lambda: (None, None), # 修改这里
"forever": lambda: (None, None),
}
if expire_style in expire_styles:
@@ -74,7 +77,7 @@ async def get_expire_info(expire_value: int, expire_style: str) -> Tuple[Optiona
if expire_style == "count":
expired_count = extra
elif expire_style == "forever":
code = await get_random_code(style="string") # 移动到这里
code = await get_random_code(style="string")
else:
expired_at = result
if expired_at and expired_at - now > max_timedelta:
@@ -88,12 +91,11 @@ async def get_expire_info(expire_value: int, expire_style: str) -> Tuple[Optiona
return expired_at, expired_count, used_count, code
async def get_random_code(style="num") -> str:
"""获取随机字符串"""
async def get_random_code(style: str = "num") -> str:
while True:
code = await get_random_num() if style == "num" else await get_random_string()
if not await FileCodes.filter(code=code).exists():
return code
return str(code)
async def calculate_file_hash(file: UploadFile, chunk_size=1024 * 1024) -> str:
+210 -139
View File
@@ -5,13 +5,25 @@ import uuid
from datetime import timedelta
from urllib.parse import unquote
from typing import Optional, Tuple, Union
from fastapi import APIRouter, Form, UploadFile, File, Depends, HTTPException
from starlette import status
from apps.admin.dependencies import share_required_login
from apps.base.models import FileCodes, UploadChunk, PresignUploadSession
from apps.base.schemas import SelectFileModel, InitChunkUploadModel, CompleteUploadModel, PresignUploadInitRequest
from apps.base.utils import get_expire_info, get_file_path_name, ip_limit, get_chunk_file_path_name
from apps.base.schemas import (
SelectFileModel,
InitChunkUploadModel,
CompleteUploadModel,
PresignUploadInitRequest,
)
from apps.base.utils import (
get_expire_info,
get_file_path_name,
ip_limit,
get_chunk_file_path_name,
)
from core.response import APIResponse
from core.settings import settings
from core.storage import storages, FileStorageInterface
@@ -25,7 +37,9 @@ class FileUploadService:
"""统一的文件上传服务"""
@staticmethod
async def generate_file_path(file_name: str, upload_id: str = None) -> tuple[str, str, str, str, str]:
async def generate_file_path(
file_name: str, upload_id: Optional[str] = None
) -> tuple[str, str, str, str, str]:
"""统一的路径生成"""
today = datetime.datetime.now()
storage_path = settings.storage_path.strip("/")
@@ -44,10 +58,12 @@ class FileUploadService:
file_path: str,
expire_value: int,
expire_style: str,
**extra_fields
**extra_fields,
) -> str:
"""统一创建FileCodes记录,返回code"""
expired_at, expired_count, used_count, code = await get_expire_info(expire_value, expire_style)
expired_at, expired_count, used_count, code = await get_expire_info(
expire_value, expire_style
)
prefix, suffix = os.path.splitext(file_name)
await FileCodes.create(
@@ -60,7 +76,7 @@ class FileUploadService:
expired_at=expired_at,
expired_count=expired_count,
used_count=used_count,
**extra_fields
**extra_fields,
)
return code
@@ -68,8 +84,7 @@ class FileUploadService:
async def validate_file_size(file: UploadFile, max_size: int) -> int:
size = file.size
if size is None:
# 读取流计算大小,保持指针复位
await file.seek(0, 2)
await file.seek(0, 2) # type: ignore[arg-type]
size = file.file.tell()
await file.seek(0)
if size > max_size:
@@ -86,10 +101,10 @@ async def create_file_code(code, **kwargs):
@share_api.post("/text/", dependencies=[Depends(share_required_login)])
async def share_text(
text: str = Form(...),
expire_value: int = Form(default=1, gt=0),
expire_style: str = Form(default="day"),
ip: str = Depends(ip_limit["upload"]),
text: str = Form(...),
expire_value: int = Form(default=1, gt=0),
expire_style: str = Form(default="day"),
ip: str = Depends(ip_limit["upload"]),
):
text_size = len(text.encode("utf-8"))
max_txt_size = 222 * 1024
@@ -114,15 +129,17 @@ async def share_text(
@share_api.post("/file/", dependencies=[Depends(share_required_login)])
async def share_file(
expire_value: int = Form(default=1, gt=0),
expire_style: str = Form(default="day"),
file: UploadFile = File(...),
ip: str = Depends(ip_limit["upload"]),
expire_value: int = Form(default=1, gt=0),
expire_style: str = Form(default="day"),
file: UploadFile = File(...),
ip: str = Depends(ip_limit["upload"]),
):
file_size = await validate_file_size(file, settings.uploadSize)
if expire_style not in settings.expireStyle:
raise HTTPException(status_code=400, detail="过期时间类型错误")
expired_at, expired_count, used_count, code = await get_expire_info(expire_value, expire_style)
expired_at, expired_count, used_count, code = await get_expire_info(
expire_value, expire_style
)
path, suffix, prefix, uuid_file_name, save_path = await get_file_path_name(file)
file_storage: FileStorageInterface = storages[settings.file_storage]()
await file_storage.save_file(file, save_path)
@@ -141,7 +158,9 @@ async def share_file(
return APIResponse(detail={"code": code, "name": file.filename})
async def get_code_file_by_code(code, check=True):
async def get_code_file_by_code(
code: str, check: bool = True
) -> Tuple[bool, Union[FileCodes, str]]:
file_code = await FileCodes.filter(code=code).first()
if not file_code:
return False, "文件不存在"
@@ -150,7 +169,7 @@ async def get_code_file_by_code(code, check=True):
return True, file_code
async def update_file_usage(file_code):
async def update_file_usage(file_code: FileCodes) -> None:
file_code.used_count += 1
if file_code.expired_count > 0:
file_code.expired_count -= 1
@@ -165,6 +184,7 @@ async def get_code_file(code: str, ip: str = Depends(ip_limit["error"])):
ip_limit["error"].add_ip(ip)
return APIResponse(code=404, detail=file_code)
assert isinstance(file_code, FileCodes)
await update_file_usage(file_code)
return await file_storage.get_file_response(file_code)
@@ -177,6 +197,7 @@ async def select_file(data: SelectFileModel, ip: str = Depends(ip_limit["error"]
ip_limit["error"].add_ip(ip)
return APIResponse(code=404, detail=file_code)
assert isinstance(file_code, FileCodes)
await update_file_usage(file_code)
return APIResponse(
detail={
@@ -201,6 +222,7 @@ async def download_file(key: str, code: str, ip: str = Depends(ip_limit["error"]
has, file_code = await get_code_file_by_code(code, False)
if not has:
return APIResponse(code=404, detail="文件不存在")
assert isinstance(file_code, FileCodes)
return (
APIResponse(detail=file_code.text)
if file_code.text
@@ -219,8 +241,7 @@ async def init_chunk_upload(data: InitChunkUploadModel):
if max_possible_size > settings.uploadSize:
max_size_mb = settings.uploadSize / (1024 * 1024)
raise HTTPException(
status_code=403,
detail=f"文件大小超过限制,最大为 {max_size_mb:.2f} MB"
status_code=403, detail=f"文件大小超过限制,最大为 {max_size_mb:.2f} MB"
)
# # 秒传检查
@@ -247,21 +268,25 @@ async def init_chunk_upload(data: InitChunkUploadModel):
).first()
if existing_session:
# 复用已有会话,获取已上传的分片列表
uploaded_chunks = await UploadChunk.filter(
upload_id=existing_session.upload_id,
completed=True
).values_list('chunk_index', flat=True)
return APIResponse(detail={
"existed": False,
"upload_id": existing_session.upload_id,
"chunk_size": existing_session.chunk_size,
"total_chunks": existing_session.total_chunks,
"uploaded_chunks": list(uploaded_chunks)
})
if not existing_session.save_path:
await UploadChunk.filter(upload_id=existing_session.upload_id).delete()
else:
uploaded_chunks = await UploadChunk.filter(
upload_id=existing_session.upload_id, completed=True
).values_list("chunk_index", flat=True)
return APIResponse(
detail={
"existed": False,
"upload_id": existing_session.upload_id,
"chunk_size": existing_session.chunk_size,
"total_chunks": existing_session.total_chunks,
"uploaded_chunks": list(uploaded_chunks),
}
)
# 创建新的上传会话
upload_id = uuid.uuid4().hex
_, _, _, _, save_path = await get_chunk_file_path_name(data.file_name, upload_id)
await UploadChunk.create(
upload_id=upload_id,
chunk_index=-1,
@@ -270,21 +295,27 @@ async def init_chunk_upload(data: InitChunkUploadModel):
chunk_size=data.chunk_size,
chunk_hash=data.file_hash,
file_name=data.file_name,
save_path=save_path,
)
return APIResponse(
detail={
"existed": False,
"upload_id": upload_id,
"chunk_size": data.chunk_size,
"total_chunks": total_chunks,
"uploaded_chunks": [],
}
)
return APIResponse(detail={
"existed": False,
"upload_id": upload_id,
"chunk_size": data.chunk_size,
"total_chunks": total_chunks,
"uploaded_chunks": []
})
@chunk_api.post("/upload/chunk/{upload_id}/{chunk_index}", dependencies=[Depends(share_required_login)])
@chunk_api.post(
"/upload/chunk/{upload_id}/{chunk_index}",
dependencies=[Depends(share_required_login)],
)
async def upload_chunk(
upload_id: str,
chunk_index: int,
chunk: UploadFile = File(...),
upload_id: str,
chunk_index: int,
chunk: UploadFile = File(...),
):
# 获取上传会话信息
chunk_info = await UploadChunk.filter(upload_id=upload_id, chunk_index=-1).first()
@@ -297,12 +328,12 @@ async def upload_chunk(
# 检查是否已上传(支持断点续传)
existing_chunk = await UploadChunk.filter(
upload_id=upload_id,
chunk_index=chunk_index,
completed=True
upload_id=upload_id, chunk_index=chunk_index, completed=True
).first()
if existing_chunk:
return APIResponse(detail={"chunk_hash": existing_chunk.chunk_hash, "skipped": True})
return APIResponse(
detail={"chunk_hash": existing_chunk.chunk_hash, "skipped": True}
)
# 读取分片数据并计算哈希
chunk_data = await chunk.read()
@@ -312,47 +343,49 @@ async def upload_chunk(
if chunk_size > chunk_info.chunk_size:
raise HTTPException(
status.HTTP_400_BAD_REQUEST,
detail=f"分片大小超过声明值: 最大 {chunk_info.chunk_size}, 实际 {chunk_size}"
detail=f"分片大小超过声明值: 最大 {chunk_info.chunk_size}, 实际 {chunk_size}",
)
# 计算已上传分片数,校验累计大小不超限(用分片数 * chunk_size 估算)
uploaded_count = await UploadChunk.filter(
upload_id=upload_id,
completed=True
upload_id=upload_id, completed=True
).count()
# 已上传分片的最大可能大小 + 当前分片
max_uploaded_size = uploaded_count * chunk_info.chunk_size + chunk_size
if max_uploaded_size > settings.uploadSize:
max_size_mb = settings.uploadSize / (1024 * 1024)
raise HTTPException(
status_code=403,
detail=f"累计上传大小超过限制,最大为 {max_size_mb:.2f} MB"
status_code=403, detail=f"累计上传大小超过限制,最大为 {max_size_mb:.2f} MB"
)
chunk_hash = hashlib.sha256(chunk_data).hexdigest()
# 获取文件路径
_, _, _, _, save_path = await get_chunk_file_path_name(chunk_info.file_name, upload_id)
save_path = chunk_info.save_path
# 保存分片到存储
storage = storages[settings.file_storage]()
try:
await storage.save_chunk(upload_id, chunk_index, chunk_data, chunk_hash, save_path)
await storage.save_chunk(
upload_id, chunk_index, chunk_data, chunk_hash, save_path
)
except Exception as e:
raise HTTPException(status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"分片保存失败: {str(e)}")
raise HTTPException(
status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"分片保存失败: {str(e)}"
)
# 更新或创建分片记录(保存成功后再记录)
await UploadChunk.update_or_create(
upload_id=upload_id,
chunk_index=chunk_index,
defaults={
'chunk_hash': chunk_hash,
'completed': True,
'file_size': chunk_info.file_size,
'total_chunks': chunk_info.total_chunks,
'chunk_size': chunk_info.chunk_size,
'file_name': chunk_info.file_name
}
"chunk_hash": chunk_hash,
"completed": True,
"file_size": chunk_info.file_size,
"total_chunks": chunk_info.total_chunks,
"chunk_size": chunk_info.chunk_size,
"file_name": chunk_info.file_name,
"save_path": chunk_info.save_path,
},
)
return APIResponse(detail={"chunk_hash": chunk_hash})
@@ -363,50 +396,56 @@ async def cancel_upload(upload_id: str):
chunk_info = await UploadChunk.filter(upload_id=upload_id, chunk_index=-1).first()
if not chunk_info:
raise HTTPException(status.HTTP_404_NOT_FOUND, detail="上传会话不存在")
# 获取文件路径
_, _, _, _, save_path = await get_chunk_file_path_name(chunk_info.file_name, upload_id)
save_path = chunk_info.save_path
# 清理存储中的临时文件
storage = storages[settings.file_storage]()
try:
await storage.clean_chunks(upload_id, save_path)
except Exception as e:
# 记录错误但不阻止删除数据库记录
pass
if save_path:
try:
await storage.clean_chunks(upload_id, save_path)
except Exception as e:
pass
# 清理数据库记录
await UploadChunk.filter(upload_id=upload_id).delete()
return APIResponse(detail={"message": "上传已取消"})
@chunk_api.get("/upload/status/{upload_id}", dependencies=[Depends(share_required_login)])
@chunk_api.get(
"/upload/status/{upload_id}", dependencies=[Depends(share_required_login)]
)
async def get_upload_status(upload_id: str):
"""获取上传状态"""
chunk_info = await UploadChunk.filter(upload_id=upload_id, chunk_index=-1).first()
if not chunk_info:
raise HTTPException(status.HTTP_404_NOT_FOUND, detail="上传会话不存在")
# 获取已上传的分片列表
uploaded_chunks = await UploadChunk.filter(
upload_id=upload_id,
completed=True
).values_list('chunk_index', flat=True)
return APIResponse(detail={
"upload_id": upload_id,
"file_name": chunk_info.file_name,
"file_size": chunk_info.file_size,
"chunk_size": chunk_info.chunk_size,
"total_chunks": chunk_info.total_chunks,
"uploaded_chunks": list(uploaded_chunks),
"progress": len(uploaded_chunks) / chunk_info.total_chunks * 100
})
upload_id=upload_id, completed=True
).values_list("chunk_index", flat=True)
return APIResponse(
detail={
"upload_id": upload_id,
"file_name": chunk_info.file_name,
"file_size": chunk_info.file_size,
"chunk_size": chunk_info.chunk_size,
"total_chunks": chunk_info.total_chunks,
"uploaded_chunks": list(uploaded_chunks),
"progress": len(uploaded_chunks) / chunk_info.total_chunks * 100,
}
)
@chunk_api.post("/upload/complete/{upload_id}", dependencies=[Depends(share_required_login)])
async def complete_upload(upload_id: str, data: CompleteUploadModel, ip: str = Depends(ip_limit["upload"])):
@chunk_api.post(
"/upload/complete/{upload_id}", dependencies=[Depends(share_required_login)]
)
async def complete_upload(
upload_id: str, data: CompleteUploadModel, ip: str = Depends(ip_limit["upload"])
):
# 获取上传基本信息
chunk_info = await UploadChunk.filter(upload_id=upload_id, chunk_index=-1).first()
if not chunk_info:
@@ -415,8 +454,7 @@ async def complete_upload(upload_id: str, data: CompleteUploadModel, ip: str = D
storage = storages[settings.file_storage]()
# 验证所有分片
completed_chunks_list = await UploadChunk.filter(
upload_id=upload_id,
completed=True
upload_id=upload_id, completed=True
).all()
if len(completed_chunks_list) != chunk_info.total_chunks:
raise HTTPException(status.HTTP_400_BAD_REQUEST, detail="分片不完整")
@@ -424,27 +462,29 @@ async def complete_upload(upload_id: str, data: CompleteUploadModel, ip: str = D
# 用分片数 * chunk_size 校验最大可能大小
max_total_size = len(completed_chunks_list) * chunk_info.chunk_size
if max_total_size > settings.uploadSize:
# 清理已上传的分片
_, _, _, _, save_path = await get_chunk_file_path_name(chunk_info.file_name, upload_id)
try:
await storage.clean_chunks(upload_id, save_path)
except Exception:
pass
save_path = chunk_info.save_path
if save_path:
try:
await storage.clean_chunks(upload_id, save_path)
except Exception:
pass
await UploadChunk.filter(upload_id=upload_id).delete()
max_size_mb = settings.uploadSize / (1024 * 1024)
raise HTTPException(
status_code=403,
detail=f"实际上传大小超过限制,最大为 {max_size_mb:.2f} MB"
status_code=403, detail=f"实际上传大小超过限制,最大为 {max_size_mb:.2f} MB"
)
# 获取文件路径
path, suffix, prefix, _, save_path = await get_chunk_file_path_name(chunk_info.file_name, upload_id)
save_path = chunk_info.save_path
path = os.path.dirname(save_path) if save_path else ""
prefix, suffix = os.path.splitext(chunk_info.file_name)
try:
# 合并文件并计算哈希
_, file_hash = await storage.merge_chunks(upload_id, chunk_info, save_path)
# 创建文件记录
expired_at, expired_count, used_count, code = await get_expire_info(data.expire_value, data.expire_style)
expired_at, expired_count, used_count, code = await get_expire_info(
data.expire_value, data.expire_style
)
await FileCodes.create(
code=code,
file_hash=file_hash, # 使用合并后计算的哈希
@@ -457,7 +497,7 @@ async def complete_upload(upload_id: str, data: CompleteUploadModel, ip: str = D
file_path=path,
uuid_file_name=f"{prefix}{suffix}",
prefix=prefix,
suffix=suffix
suffix=suffix,
)
# 清理临时文件
await storage.clean_chunks(upload_id, save_path)
@@ -473,7 +513,9 @@ async def complete_upload(upload_id: str, data: CompleteUploadModel, ip: str = D
await storage.clean_chunks(upload_id, save_path)
except Exception:
pass
raise HTTPException(status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"文件合并失败: {str(e)}")
raise HTTPException(
status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"文件合并失败: {str(e)}"
)
# ============ 预签名上传API ============
@@ -482,7 +524,9 @@ presign_api = APIRouter(prefix="/presign", tags=["预签名上传"])
PRESIGN_SESSION_EXPIRES = 900 # 15分钟
async def _get_valid_session(upload_id: str, expected_mode: str = None) -> PresignUploadSession:
async def _get_valid_session(
upload_id: str, expected_mode: Optional[str] = None
) -> PresignUploadSession:
"""获取并验证会话"""
session = await PresignUploadSession.filter(upload_id=upload_id).first()
if not session:
@@ -496,18 +540,27 @@ async def _get_valid_session(upload_id: str, expected_mode: str = None) -> Presi
@presign_api.post("/upload/init", dependencies=[Depends(share_required_login)])
async def presign_upload_init(data: PresignUploadInitRequest, ip: str = Depends(ip_limit["upload"])):
async def presign_upload_init(
data: PresignUploadInitRequest, ip: str = Depends(ip_limit["upload"])
):
"""初始化预签名上传,S3返回直传URL,其他存储返回代理URL"""
if data.file_size > settings.uploadSize:
raise HTTPException(403, f"文件大小超过限制,最大为 {settings.uploadSize / (1024*1024):.2f} MB")
raise HTTPException(
403,
f"文件大小超过限制,最大为 {settings.uploadSize / (1024 * 1024):.2f} MB",
)
if data.expire_style not in settings.expireStyle:
raise HTTPException(400, "过期时间类型错误")
upload_id = uuid.uuid4().hex
path, _, _, filename, save_path = await FileUploadService.generate_file_path(data.file_name, upload_id)
path, _, _, filename, save_path = await FileUploadService.generate_file_path(
data.file_name, upload_id
)
storage: FileStorageInterface = storages[settings.file_storage]()
presigned_url = await storage.generate_presigned_upload_url(save_path, PRESIGN_SESSION_EXPIRES)
presigned_url = await storage.generate_presigned_upload_url(
save_path, PRESIGN_SESSION_EXPIRES
)
mode = "direct" if presigned_url else "proxy"
upload_url = presigned_url or f"/api/presign/upload/proxy/{upload_id}"
@@ -524,16 +577,22 @@ async def presign_upload_init(data: PresignUploadInitRequest, ip: str = Depends(
)
ip_limit["upload"].add_ip(ip)
return APIResponse(detail={
"upload_id": upload_id,
"upload_url": upload_url,
"mode": mode,
"expires_in": PRESIGN_SESSION_EXPIRES,
})
return APIResponse(
detail={
"upload_id": upload_id,
"upload_url": upload_url,
"mode": mode,
"expires_in": PRESIGN_SESSION_EXPIRES,
}
)
@presign_api.put("/upload/proxy/{upload_id}", dependencies=[Depends(share_required_login)])
async def presign_upload_proxy(upload_id: str, file: UploadFile = File(...), ip: str = Depends(ip_limit["upload"])):
@presign_api.put(
"/upload/proxy/{upload_id}", dependencies=[Depends(share_required_login)]
)
async def presign_upload_proxy(
upload_id: str, file: UploadFile = File(...), ip: str = Depends(ip_limit["upload"])
):
"""代理模式上传,服务器转存到存储后端"""
session = await _get_valid_session(upload_id, expected_mode="proxy")
@@ -548,8 +607,11 @@ async def presign_upload_proxy(upload_id: str, file: UploadFile = File(...), ip:
raise HTTPException(500, f"文件保存失败: {str(e)}")
code = await FileUploadService.create_file_record(
session.file_name, file_size, os.path.dirname(session.save_path),
session.expire_value, session.expire_style
session.file_name,
file_size,
os.path.dirname(session.save_path),
session.expire_value,
session.expire_style,
)
await session.delete()
@@ -557,7 +619,9 @@ async def presign_upload_proxy(upload_id: str, file: UploadFile = File(...), ip:
return APIResponse(detail={"code": code, "name": session.file_name})
@presign_api.post("/upload/confirm/{upload_id}", dependencies=[Depends(share_required_login)])
@presign_api.post(
"/upload/confirm/{upload_id}", dependencies=[Depends(share_required_login)]
)
async def presign_upload_confirm(upload_id: str, ip: str = Depends(ip_limit["upload"])):
"""直传确认,客户端完成S3直传后调用获取分享码"""
session = await _get_valid_session(upload_id, expected_mode="direct")
@@ -567,8 +631,11 @@ async def presign_upload_confirm(upload_id: str, ip: str = Depends(ip_limit["upl
raise HTTPException(404, "文件未上传或上传失败")
code = await FileUploadService.create_file_record(
session.file_name, session.file_size, os.path.dirname(session.save_path),
session.expire_value, session.expire_style
session.file_name,
session.file_size,
os.path.dirname(session.save_path),
session.expire_value,
session.expire_style,
)
await session.delete()
@@ -576,22 +643,26 @@ async def presign_upload_confirm(upload_id: str, ip: str = Depends(ip_limit["upl
return APIResponse(detail={"code": code, "name": session.file_name})
@presign_api.get("/upload/status/{upload_id}", dependencies=[Depends(share_required_login)])
@presign_api.get(
"/upload/status/{upload_id}", dependencies=[Depends(share_required_login)]
)
async def presign_upload_status(upload_id: str):
"""查询上传会话状态"""
session = await PresignUploadSession.filter(upload_id=upload_id).first()
if not session:
raise HTTPException(404, "上传会话不存在")
return APIResponse(detail={
"upload_id": session.upload_id,
"file_name": session.file_name,
"file_size": session.file_size,
"mode": session.mode,
"created_at": session.created_at.isoformat(),
"expires_at": session.expires_at.isoformat(),
"is_expired": await session.is_expired(),
})
return APIResponse(
detail={
"upload_id": session.upload_id,
"file_name": session.file_name,
"file_size": session.file_size,
"mode": session.mode,
"created_at": session.created_at.isoformat(),
"expires_at": session.expires_at.isoformat(),
"is_expired": await session.is_expired(),
}
)
@presign_api.delete("/upload/{upload_id}", dependencies=[Depends(share_required_login)])
+4 -4
View File
@@ -2,14 +2,14 @@
# @Author : Lan
# @File : response.py
# @Software: PyCharm
from typing import Generic, TypeVar
from typing import Generic, Optional, TypeVar
from pydantic.v1.generics import GenericModel
from pydantic import BaseModel
T = TypeVar("T")
class APIResponse(GenericModel, Generic[T]):
class APIResponse(BaseModel, Generic[T]):
code: int = 200
message: str = "ok"
detail: T
detail: Optional[T] = None
+416 -184
View File
@@ -4,6 +4,8 @@
# @Software: PyCharm
import base64
import hashlib
import os
import tempfile
from core.logger import logger
import shutil
from typing import Optional
@@ -14,7 +16,6 @@ import aiohttp
import asyncio
from pathlib import Path
import datetime
import io
import re
import aioboto3
from botocore.config import Config
@@ -23,7 +24,7 @@ from core.response import APIResponse
from core.settings import data_root, settings
from apps.base.models import FileCodes, UploadChunk
from core.utils import get_file_url, sanitize_filename
from fastapi.responses import FileResponse
from fastapi.responses import FileResponse, StreamingResponse
class FileStorageInterface:
@@ -144,10 +145,20 @@ class SystemFileStorage(FileStorageInterface):
filename = f"{file_code.prefix}{file_code.suffix}"
encoded_filename = quote(filename, safe='')
content_disposition = f"attachment; filename*=UTF-8''{encoded_filename}"
# 尝试获取文件系统大小,如果成功则设置 Content-Length
headers = {"Content-Disposition": content_disposition}
try:
content_length = file_path.stat().st_size
headers["Content-Length"] = str(content_length)
except Exception:
# 如果获取文件大小失败,则不提供 Content-Length
pass
return FileResponse(
file_path,
media_type="application/octet-stream",
headers={"Content-Disposition": content_disposition},
headers=headers,
filename=filename # 保留原始文件名以备某些场景使用
)
@@ -275,11 +286,12 @@ class S3FileStorage(FileStorageInterface):
region_name=self.region_name,
config=Config(signature_version=self.signature_version),
) as s3:
await s3.put_object(
Bucket=self.bucket_name,
Key=save_path,
Body=await file.read(),
ContentType=file.content_type,
# 使用 upload_fileobj 流式上传,避免将整个文件加载到内存
await s3.upload_fileobj(
file.file,
self.bucket_name,
save_path,
ExtraArgs={"ContentType": file.content_type or "application/octet-stream"},
)
async def delete_file(self, file_code: FileCodes):
@@ -296,12 +308,29 @@ class S3FileStorage(FileStorageInterface):
async def get_file_response(self, file_code: FileCodes):
try:
filename = file_code.prefix + file_code.suffix
content_length = None # 初始化为 None,表示未知大小
async with self.session.client(
"s3",
endpoint_url=self.endpoint_url,
region_name=self.region_name,
config=Config(signature_version=self.signature_version),
) as s3:
# 尝试获取文件大小(HEAD请求)
try:
head_response = await s3.head_object(
Bucket=self.bucket_name,
Key=await file_code.get_file_path()
)
# 从HEAD响应中获取Content-Length
if 'ContentLength' in head_response:
content_length = head_response['ContentLength']
elif 'Content-Length' in head_response['ResponseMetadata']['HTTPHeaders']:
content_length = int(head_response['ResponseMetadata']['HTTPHeaders']['Content-Length'])
except Exception:
# 如果HEAD请求失败,则不提供 Content-Length
pass
link = await s3.generate_presigned_url(
"get_object",
Params={
@@ -310,20 +339,42 @@ class S3FileStorage(FileStorageInterface):
},
ExpiresIn=3600,
)
tmp = io.BytesIO()
async with aiohttp.ClientSession() as session:
async with session.get(link) as resp:
tmp.write(await resp.read())
tmp.seek(0)
content = tmp.read()
tmp.close()
return Response(
content,
# 创建ClientSession并传递给生成器复用
session = aiohttp.ClientSession()
async def stream_generator():
try:
async with session.get(link) as resp:
if resp.status != 200:
raise HTTPException(
status_code=resp.status,
detail=f"从S3获取文件失败: {resp.status}"
)
# 设置块大小(例如64KB)
chunk_size = 65536
while True:
chunk = await resp.content.read(chunk_size)
if not chunk:
break
yield chunk
finally:
await session.close()
from fastapi.responses import StreamingResponse
encoded_filename = quote(filename, safe='')
headers = {
"Content-Disposition": f"attachment; filename*=UTF-8''{encoded_filename}"
}
if content_length is not None:
headers["Content-Length"] = str(content_length)
return StreamingResponse(
stream_generator(),
media_type="application/octet-stream",
headers={
"Content-Disposition": f'attachment; filename="{filename.encode("utf-8").decode("latin-1")}"'
},
headers=headers
)
except HTTPException:
raise
except Exception:
raise HTTPException(status_code=503, detail="服务代理下载异常,请稍后再试")
@@ -376,12 +427,11 @@ class S3FileStorage(FileStorageInterface):
async def merge_chunks(self, upload_id: str, chunk_info: UploadChunk, save_path: str) -> tuple[str, str]:
"""
合并 S3 上的分片文件
由于分片是独立对象存储的,需要下载后合并再上传
使用 S3 的 multipart upload API 实现流式合并,避免内存问题
"""
file_sha256 = hashlib.sha256()
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
merged_data = io.BytesIO()
async with self.session.client(
's3',
endpoint_url=self.endpoint_url,
@@ -389,38 +439,70 @@ class S3FileStorage(FileStorageInterface):
region_name=self.region_name,
config=Config(signature_version=self.signature_version),
) as s3:
# 按顺序读取并验证每个分片
for i in range(chunk_info.total_chunks):
chunk_key = f"{chunk_dir}/{i}.part"
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
if not chunk_record:
raise ValueError(f"分片{i}记录不存在")
try:
response = await s3.get_object(
Bucket=self.bucket_name,
Key=chunk_key
)
chunk_data = await response['Body'].read()
except Exception as e:
raise ValueError(f"分片{i}文件不存在: {e}")
current_hash = hashlib.sha256(chunk_data).hexdigest()
if current_hash != chunk_record.chunk_hash:
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
file_sha256.update(chunk_data)
merged_data.write(chunk_data)
# 上传合并后的文件
merged_data.seek(0)
await s3.put_object(
# 创建 multipart upload
mpu = await s3.create_multipart_upload(
Bucket=self.bucket_name,
Key=save_path,
Body=merged_data.getvalue(),
ContentType='application/octet-stream'
)
mpu_id = mpu['UploadId']
parts = []
try:
# 按顺序读取、验证并上传每个分片
for i in range(chunk_info.total_chunks):
chunk_key = f"{chunk_dir}/{i}.part"
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
if not chunk_record:
raise ValueError(f"分片{i}记录不存在")
try:
response = await s3.get_object(
Bucket=self.bucket_name,
Key=chunk_key
)
chunk_data = await response['Body'].read()
except Exception as e:
raise ValueError(f"分片{i}文件不存在: {e}")
current_hash = hashlib.sha256(chunk_data).hexdigest()
if current_hash != chunk_record.chunk_hash:
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
file_sha256.update(chunk_data)
# 上传分片到 multipart upload
part_response = await s3.upload_part(
Bucket=self.bucket_name,
Key=save_path,
UploadId=mpu_id,
PartNumber=i + 1, # S3 part numbers start at 1
Body=chunk_data
)
parts.append({
'PartNumber': i + 1,
'ETag': part_response['ETag']
})
# 释放内存
del chunk_data
# 完成 multipart upload
await s3.complete_multipart_upload(
Bucket=self.bucket_name,
Key=save_path,
UploadId=mpu_id,
MultipartUpload={'Parts': parts}
)
except Exception as e:
# 出错时取消 multipart upload
await s3.abort_multipart_upload(
Bucket=self.bucket_name,
Key=save_path,
UploadId=mpu_id
)
raise e
return save_path, file_sha256.hexdigest()
async def clean_chunks(self, upload_id: str, save_path: str):
@@ -602,20 +684,51 @@ class OneDriveFileStorage(FileStorageInterface):
link = await asyncio.to_thread(
self._get_file_url, await file_code.get_file_path(), filename
)
tmp = io.BytesIO()
async with aiohttp.ClientSession() as session:
async with session.get(link) as resp:
tmp.write(await resp.read())
tmp.seek(0)
content = tmp.read()
tmp.close()
return Response(
content,
content_length = None # 初始化为 None,表示未知大小
# 创建ClientSession并复用
session = aiohttp.ClientSession()
# 尝试发送HEAD请求获取Content-Length
try:
async with session.head(link) as resp:
if resp.status == 200 and 'Content-Length' in resp.headers:
content_length = int(resp.headers['Content-Length'])
except Exception:
# 如果HEAD请求失败,则不提供 Content-Length
pass
async def stream_generator():
try:
async with session.get(link) as resp:
if resp.status != 200:
raise HTTPException(
status_code=resp.status,
detail=f"从OneDrive获取文件失败: {resp.status}"
)
chunk_size = 65536
while True:
chunk = await resp.content.read(chunk_size)
if not chunk:
break
yield chunk
finally:
await session.close()
encoded_filename = quote(filename, safe='')
headers = {
"Content-Disposition": f"attachment; filename*=UTF-8''{encoded_filename}"
}
if content_length is not None:
headers["Content-Length"] = str(content_length)
return StreamingResponse(
stream_generator(),
media_type="application/octet-stream",
headers={
"Content-Disposition": f'attachment; filename="{filename.encode("utf-8").decode("latin-1")}"'
},
headers=headers
)
except HTTPException:
raise
except Exception:
raise HTTPException(status_code=503, detail="服务代理下载异常,请稍后再试")
@@ -682,33 +795,44 @@ class OneDriveFileStorage(FileStorageInterface):
current_folder.upload(filename, data).execute_query()
async def merge_chunks(self, upload_id: str, chunk_info: UploadChunk, save_path: str) -> tuple[str, str]:
"""合并 OneDrive 上的分片文件"""
"""合并 OneDrive 上的分片文件,使用临时文件避免内存问题"""
file_sha256 = hashlib.sha256()
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
merged_data = io.BytesIO()
for i in range(chunk_info.total_chunks):
chunk_path = f"{chunk_dir}/{i}.part"
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
if not chunk_record:
raise ValueError(f"分片{i}记录不存在")
try:
chunk_data = await asyncio.to_thread(self._read_chunk, chunk_path)
except Exception as e:
raise ValueError(f"分片{i}文件不存在: {e}")
current_hash = hashlib.sha256(chunk_data).hexdigest()
if current_hash != chunk_record.chunk_hash:
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
file_sha256.update(chunk_data)
merged_data.write(chunk_data)
# 上传合并后的文件
merged_data.seek(0)
await asyncio.to_thread(self._upload_merged, save_path, merged_data.getvalue())
# 使用临时文件存储合并数据
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
temp_path = temp_file.name
try:
async with aiofiles.open(temp_path, 'wb') as out_file:
for i in range(chunk_info.total_chunks):
chunk_path = f"{chunk_dir}/{i}.part"
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
if not chunk_record:
raise ValueError(f"分片{i}记录不存在")
try:
chunk_data = await asyncio.to_thread(self._read_chunk, chunk_path)
except Exception as e:
raise ValueError(f"分片{i}文件不存在: {e}")
current_hash = hashlib.sha256(chunk_data).hexdigest()
if current_hash != chunk_record.chunk_hash:
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
file_sha256.update(chunk_data)
await out_file.write(chunk_data)
del chunk_data # 释放内存
# 读取临时文件并上传
async with aiofiles.open(temp_path, 'rb') as f:
merged_content = await f.read()
await asyncio.to_thread(self._upload_merged, save_path, merged_content)
finally:
# 清理临时文件
if os.path.exists(temp_path):
os.unlink(temp_path)
return save_path, file_sha256.hexdigest()
def _delete_chunk_dir(self, chunk_dir: str):
@@ -765,7 +889,9 @@ class OpenDALFileStorage(FileStorageInterface):
)
async def save_file(self, file: UploadFile, save_path: str):
await self.operator.write(save_path, file.file.read())
# 使用 asyncio.to_thread 避免阻塞事件循环
content = await asyncio.to_thread(file.file.read)
await self.operator.write(save_path, content)
async def delete_file(self, file_code: FileCodes):
await self.operator.delete(await file_code.get_file_path())
@@ -776,11 +902,54 @@ class OpenDALFileStorage(FileStorageInterface):
async def get_file_response(self, file_code: FileCodes):
try:
filename = file_code.prefix + file_code.suffix
content = await self.operator.read(await file_code.get_file_path())
content_length = None # 初始化为 None,表示未知大小
# 尝试获取文件大小
try:
stat_result = await self.operator.stat(await file_code.get_file_path())
if hasattr(stat_result, 'content_length') and stat_result.content_length:
content_length = stat_result.content_length
elif hasattr(stat_result, 'size') and stat_result.size:
content_length = stat_result.size
except Exception:
# 如果获取大小失败,则不提供 Content-Length
pass
# 尝试使用流式读取器
try:
# OpenDAL 可能提供 reader 方法返回一个异步读取器
reader = await self.operator.reader(await file_code.get_file_path())
except AttributeError:
# 如果 reader 方法不存在,回退到全量读取(兼容旧版本)
content = await self.operator.read(await file_code.get_file_path())
encoded_filename = quote(filename, safe='')
headers = {
"Content-Disposition": f"attachment; filename*=UTF-8''{encoded_filename}"
}
if content_length is not None:
headers["Content-Length"] = str(content_length)
return Response(
content, headers=headers, media_type="application/octet-stream"
)
async def stream_generator():
chunk_size = 65536
while True:
chunk = await reader.read(chunk_size)
if not chunk:
break
yield chunk
encoded_filename = quote(filename, safe='')
headers = {
"Content-Disposition": f'attachment; filename="{filename}"'}
return Response(
content, headers=headers, media_type="application/octet-stream"
"Content-Disposition": f"attachment; filename*=UTF-8''{encoded_filename}"
}
if content_length is not None:
headers["Content-Length"] = str(content_length)
return StreamingResponse(
stream_generator(),
media_type="application/octet-stream",
headers=headers
)
except Exception as e:
logger.info(e)
@@ -792,32 +961,43 @@ class OpenDALFileStorage(FileStorageInterface):
await self.operator.write(chunk_path, chunk_data)
async def merge_chunks(self, upload_id: str, chunk_info: UploadChunk, save_path: str) -> tuple[str, str]:
"""合并 OpenDAL 存储上的分片文件"""
"""合并 OpenDAL 存储上的分片文件,使用临时文件避免内存问题"""
file_sha256 = hashlib.sha256()
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
merged_data = io.BytesIO()
for i in range(chunk_info.total_chunks):
chunk_path = f"{chunk_dir}/{i}.part"
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
if not chunk_record:
raise ValueError(f"分片{i}记录不存在")
try:
chunk_data = await self.operator.read(chunk_path)
except Exception as e:
raise ValueError(f"分片{i}文件不存在: {e}")
current_hash = hashlib.sha256(chunk_data).hexdigest()
if current_hash != chunk_record.chunk_hash:
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
file_sha256.update(chunk_data)
merged_data.write(chunk_data)
# 写入合并后的文件
merged_data.seek(0)
await self.operator.write(save_path, merged_data.getvalue())
# 使用临时文件存储合并数据
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
temp_path = temp_file.name
try:
async with aiofiles.open(temp_path, 'wb') as out_file:
for i in range(chunk_info.total_chunks):
chunk_path = f"{chunk_dir}/{i}.part"
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
if not chunk_record:
raise ValueError(f"分片{i}记录不存在")
try:
chunk_data = await self.operator.read(chunk_path)
except Exception as e:
raise ValueError(f"分片{i}文件不存在: {e}")
current_hash = hashlib.sha256(chunk_data).hexdigest()
if current_hash != chunk_record.chunk_hash:
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
file_sha256.update(chunk_data)
await out_file.write(chunk_data)
del chunk_data # 释放内存
# 读取临时文件并写入存储
async with aiofiles.open(temp_path, 'rb') as f:
merged_content = await f.read()
await self.operator.write(save_path, merged_content)
finally:
# 清理临时文件
if os.path.exists(temp_path):
os.unlink(temp_path)
return save_path, file_sha256.hexdigest()
@@ -910,7 +1090,7 @@ class WebDAVFileStorage(FileStorageInterface):
current_path = current_path.parent
async def save_file(self, file: UploadFile, save_path: str):
"""保存文件(自动创建目录)"""
"""保存文件(自动创建目录,流式上传)"""
path_obj = Path(save_path)
directory_path = str(path_obj.parent)
# 提取原始文件名并进行清理
@@ -921,13 +1101,23 @@ class WebDAVFileStorage(FileStorageInterface):
try:
# 先创建目录结构
await self._mkdir_p(directory_path)
# 上传文件
# 上传文件(流式)
url = self._build_url(safe_save_path)
async def file_sender():
"""流式读取文件内容"""
chunk_size = 256 * 1024 # 256KB chunks
while True:
chunk = await asyncio.to_thread(file.file.read, chunk_size)
if not chunk:
break
yield chunk
async with aiohttp.ClientSession(auth=self.auth) as session:
content = await file.read()
async with session.put(
url, data=content, headers={
"Content-Type": file.content_type}
url,
data=file_sender(),
headers={"Content-Type": file.content_type or "application/octet-stream"}
) as resp:
if resp.status not in (200, 201, 204):
content = await resp.text()
@@ -969,26 +1159,50 @@ class WebDAVFileStorage(FileStorageInterface):
try:
filename = file_code.prefix + file_code.suffix
url = self._build_url(await file_code.get_file_path())
async with aiohttp.ClientSession(headers={
content_length = None # 初始化为 None,表示未知大小
# 创建ClientSession并复用(包含认证头)
session = aiohttp.ClientSession(headers={
"Authorization": f"Basic {base64.b64encode(f'{settings.webdav_username}:{settings.webdav_password}'.encode()).decode()}"
}) as session:
async with session.get(url) as resp:
if resp.status != 200:
raise HTTPException(
status_code=resp.status,
detail=f"文件获取失败{resp.status}: {await resp.text()}",
)
# 读取内容到内存
content = await resp.read()
return Response(
content=content,
media_type=resp.headers.get(
"Content-Type", "application/octet-stream"
),
headers={
"Content-Disposition": f'attachment; filename="{filename.encode("utf-8").decode()}"'
},
)
})
# 尝试发送HEAD请求获取Content-Length
try:
async with session.head(url) as resp:
if resp.status == 200 and 'Content-Length' in resp.headers:
content_length = int(resp.headers['Content-Length'])
except Exception:
# 如果HEAD请求失败,则不提供 Content-Length
pass
async def stream_generator():
try:
async with session.get(url) as resp:
if resp.status != 200:
raise HTTPException(
status_code=resp.status,
detail=f"文件获取失败{resp.status}: {await resp.text()}",
)
chunk_size = 65536
while True:
chunk = await resp.content.read(chunk_size)
if not chunk:
break
yield chunk
finally:
await session.close()
encoded_filename = quote(filename, safe='')
headers = {
"Content-Disposition": f"attachment; filename*=UTF-8''{encoded_filename}"
}
if content_length is not None:
headers["Content-Length"] = str(content_length)
return StreamingResponse(
stream_generator(),
media_type="application/octet-stream",
headers=headers
)
except aiohttp.ClientError as e:
raise HTTPException(
status_code=503, detail=f"WebDAV连接异常: {str(e)}")
@@ -1014,52 +1228,70 @@ class WebDAVFileStorage(FileStorageInterface):
async def merge_chunks(self, upload_id: str, chunk_info: UploadChunk, save_path: str) -> tuple[str, str]:
"""
合并 WebDAV 上的分片文件
由于大多数 WebDAV 服务器不支持 PATCH 追加,这里下载所有分片后合并上传
使用临时文件避免内存问题
"""
file_sha256 = hashlib.sha256()
chunk_dir = str(Path(save_path).parent / "chunks" / upload_id)
merged_data = io.BytesIO()
async with aiohttp.ClientSession(auth=self.auth) as session:
# 按顺序读取并验证每个分片
for i in range(chunk_info.total_chunks):
chunk_path = f"{chunk_dir}/{i}.part"
chunk_url = self._build_url(chunk_path)
# 获取分片记录
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
if not chunk_record:
raise ValueError(f"分片{i}记录不存在")
# 下载分片数据
async with session.get(chunk_url) as resp:
if resp.status != 200:
raise ValueError(f"分片{i}文件不存在或无法访问")
chunk_data = await resp.read()
# 验证哈希
current_hash = hashlib.sha256(chunk_data).hexdigest()
if current_hash != chunk_record.chunk_hash:
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
file_sha256.update(chunk_data)
merged_data.write(chunk_data)
# 确保目标目录存在
output_dir = str(Path(save_path).parent)
await self._mkdir_p(output_dir)
# 上传合并后的文件
output_url = self._build_url(save_path)
merged_data.seek(0)
async with session.put(output_url, data=merged_data.getvalue()) as resp:
if resp.status not in (200, 201, 204):
content = await resp.text()
raise HTTPException(
status_code=resp.status,
detail=f"合并文件上传失败: {content[:200]}"
)
# 使用临时文件存储合并数据,避免内存问题
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
temp_path = temp_file.name
try:
async with aiohttp.ClientSession(auth=self.auth) as session:
# 按顺序读取并验证每个分片,写入临时文件
async with aiofiles.open(temp_path, 'wb') as out_file:
for i in range(chunk_info.total_chunks):
chunk_path = f"{chunk_dir}/{i}.part"
chunk_url = self._build_url(chunk_path)
# 获取分片记录
chunk_record = await UploadChunk.filter(upload_id=upload_id, chunk_index=i).first()
if not chunk_record:
raise ValueError(f"分片{i}记录不存在")
# 下载分片数据
async with session.get(chunk_url) as resp:
if resp.status != 200:
raise ValueError(f"分片{i}文件不存在或无法访问")
chunk_data = await resp.read()
# 验证哈希
current_hash = hashlib.sha256(chunk_data).hexdigest()
if current_hash != chunk_record.chunk_hash:
raise ValueError(f"分片{i}哈希不匹配: 期望 {chunk_record.chunk_hash}, 实际 {current_hash}")
file_sha256.update(chunk_data)
await out_file.write(chunk_data)
del chunk_data # 释放内存
# 确保目标目录存在
output_dir = str(Path(save_path).parent)
await self._mkdir_p(output_dir)
# 流式上传合并后的文件
output_url = self._build_url(save_path)
async def file_sender():
async with aiofiles.open(temp_path, 'rb') as f:
while True:
chunk = await f.read(256 * 1024)
if not chunk:
break
yield chunk
async with session.put(output_url, data=file_sender()) as resp:
if resp.status not in (200, 201, 204):
content = await resp.text()
raise HTTPException(
status_code=resp.status,
detail=f"合并文件上传失败: {content[:200]}"
)
finally:
# 清理临时文件
if os.path.exists(temp_path):
os.unlink(temp_path)
return save_path, file_sha256.hexdigest()
async def clean_chunks(self, upload_id: str, save_path: str):
+16 -16
View File
@@ -46,38 +46,38 @@ async def delete_expire_files():
async def clean_incomplete_uploads():
"""清理超时未完成的分片上传"""
file_storage: FileStorageInterface = storages[settings.file_storage]()
# 默认 24 小时未完成的上传视为过期
expire_hours = getattr(settings, 'chunk_expire_hours', 24)
expire_hours = getattr(settings, "chunk_expire_hours", 24)
while True:
try:
expire_time = datetime.datetime.now() - datetime.timedelta(hours=expire_hours)
# 查找所有过期的上传会话(chunk_index=-1 的记录)
now = await get_now()
expire_time = now - datetime.timedelta(hours=expire_hours)
expired_sessions = await UploadChunk.filter(
chunk_index=-1,
created_at__lt=expire_time
chunk_index=-1, created_at__lt=expire_time
).all()
for session in expired_sessions:
try:
# 获取分片存储路径
_, _, _, _, save_path = await get_chunk_file_path_name(
session.file_name, session.upload_id
)
# 清理存储中的临时文件
save_path = session.save_path
if not save_path:
_, _, _, _, save_path = await get_chunk_file_path_name(
session.file_name, session.upload_id
)
await file_storage.clean_chunks(session.upload_id, save_path)
except Exception as e:
logging.error(f"清理分片文件失败 upload_id={session.upload_id}: {e}")
logging.error(
f"清理分片文件失败 upload_id={session.upload_id}: {e}"
)
try:
# 删除该会话的所有数据库记录
await UploadChunk.filter(upload_id=session.upload_id).delete()
logging.info(f"已清理过期上传会话 upload_id={session.upload_id}")
except Exception as e:
logging.error(f"删除分片记录失败 upload_id={session.upload_id}: {e}")
logging.error(
f"删除分片记录失败 upload_id={session.upload_id}: {e}"
)
except Exception as e:
logging.error(f"清理未完成上传任务异常: {e}")
finally:
await asyncio.sleep(3600) # 每小时执行一次
await asyncio.sleep(3600)
+46 -6
View File
@@ -47,7 +47,9 @@ async def get_select_token(code: str):
:return:
"""
token = settings.admin_token
return hashlib.sha256(f"{code}{int(time.time() / 1000)}000{token}".encode()).hexdigest()
return hashlib.sha256(
f"{code}{int(time.time() / 1000)}000{token}".encode()
).hexdigest()
async def get_file_url(code: str):
@@ -95,6 +97,44 @@ async def max_save_times_desc(max_save_seconds: int):
return desc_zh, desc_en
def hash_password(password: str) -> str:
"""
使用 SHA256 + salt 哈希密码
返回格式: sha256$<salt>$<hash>
"""
salt = os.urandom(16).hex()
password_hash = hashlib.sha256(f"{salt}{password}".encode()).hexdigest()
return f"sha256${salt}${password_hash}"
def verify_password(password: str, hashed: str) -> bool:
"""
验证密码是否匹配
支持新格式 (sha256$salt$hash) 和旧格式 (明文)
"""
if not hashed:
return False
# 新格式: sha256$salt$hash
if hashed.startswith("sha256$"):
parts = hashed.split("$")
if len(parts) != 3:
return False
_, salt, stored_hash = parts
password_hash = hashlib.sha256(f"{salt}{password}".encode()).hexdigest()
return password_hash == stored_hash
# 旧格式: 明文比较 (兼容迁移前的数据)
return password == hashed
def is_password_hashed(password: str) -> bool:
"""
检查密码是否已经是哈希格式
"""
return password.startswith("sha256$") and len(password.split("$")) == 3
async def sanitize_filename(filename: str) -> str:
"""
安全处理文件名:
@@ -105,15 +145,15 @@ async def sanitize_filename(filename: str) -> str:
filename = os.path.basename(filename)
illegal_chars = r'[\\/*?:"<>|\x00-\x1F]' # 包含控制字符
# 替换非法字符为下划线
cleaned = re.sub(illegal_chars, '_', filename)
cleaned = re.sub(illegal_chars, "_", filename)
# 处理空格(可选替换为_)
cleaned = cleaned.replace(' ', '_')
cleaned = cleaned.replace(" ", "_")
# 处理连续下划线
cleaned = re.sub(r'_+', '_', cleaned)
cleaned = re.sub(r"_+", "_", cleaned)
# 处理首尾特殊字符
cleaned = cleaned.strip('._')
cleaned = cleaned.strip("._")
# 处理空文件名情况
if not cleaned:
cleaned = 'unnamed_file'
cleaned = "unnamed_file"
# 长度限制(按需调整)
return cleaned[:255]
+74 -5
View File
@@ -15,6 +15,29 @@
Authorization: Bearer <token>
```
### 获取 Token
当管理面板关闭了游客上传(`openUpload=0`)时,需要先登录获取 token:
```bash
curl -X POST "http://localhost:12345/admin/login" \
-H "Content-Type: application/json" \
-d '{"password": "FileCodeBox2023"}'
```
**响应示例:**
```json
{
"code": 200,
"msg": "success",
"detail": {
"token": "xxx.xxx.xxx",
"token_type": "Bearer"
}
}
```
## 分享接口
### 分享文本
@@ -29,7 +52,22 @@ Authorization: Bearer <token>
|-------|------|------|--------|------|
| text | string | 是 | - | 要分享的文本内容 |
| expire_value | integer | 否 | 1 | 过期时间值 |
| expire_style | string | 否 | "day" | 过期时间单位(day/hour/minute) |
| expire_style | string | 否 | "day" | 过期时间单位(day/hour/minute/count/forever) |
**cURL 示例:**
```bash
# 游客上传(openUpload=1 时)
curl -X POST "http://localhost:12345/share/text/" \
-F "text=这是要分享的文本内容" \
-F "expire_value=1" \
-F "expire_style=day"
# 需要认证时(openUpload=0 时)
curl -X POST "http://localhost:12345/share/text/" \
-H "Authorization: Bearer xxx.xxx.xxx" \
-F "text=这是要分享的文本内容"
```
**响应示例:**
@@ -38,8 +76,7 @@ Authorization: Bearer <token>
"code": 200,
"msg": "success",
"detail": {
"code": "abc123",
"name": "text.txt"
"code": "abc123"
}
}
```
@@ -56,7 +93,32 @@ Authorization: Bearer <token>
|-------|------|------|--------|------|
| file | file | 是 | - | 要上传的文件 |
| expire_value | integer | 否 | 1 | 过期时间值 |
| expire_style | string | 否 | "day" | 过期时间单位(day/hour/minute) |
| expire_style | string | 否 | "day" | 过期时间单位(day/hour/minute/count/forever) |
**cURL 示例:**
```bash
# 上传文件(默认1天有效期)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt"
# 上传文件(7天有效期)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt" \
-F "expire_value=7" \
-F "expire_style=day"
# 上传文件(可下载10次)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt" \
-F "expire_value=10" \
-F "expire_style=count"
# 需要认证时
curl -X POST "http://localhost:12345/share/file/" \
-H "Authorization: Bearer xxx.xxx.xxx" \
-F "file=@/path/to/file.txt"
```
**响应示例:**
@@ -75,7 +137,7 @@ Authorization: Bearer <token>
**GET** `/share/select/`
通过分享码获取文件信息。
通过分享码获取文件信息(直接下载文件)。
**请求参数:**
@@ -83,6 +145,13 @@ Authorization: Bearer <token>
|-------|------|------|------|
| code | string | 是 | 文件分享码 |
**cURL 示例:**
```bash
# 通过取件码下载文件
curl -L "http://localhost:12345/share/select/?code=abc123" -o downloaded_file
```
**响应示例:**
```json
+74 -5
View File
@@ -15,6 +15,29 @@ Some APIs require `Authorization` header for authentication:
Authorization: Bearer <token>
```
### Get Token
When guest upload is disabled in admin panel (`openUpload=0`), you need to login first:
```bash
curl -X POST "http://localhost:12345/admin/login" \
-H "Content-Type: application/json" \
-d '{"password": "FileCodeBox2023"}'
```
**Response Example:**
```json
{
"code": 200,
"msg": "success",
"detail": {
"token": "xxx.xxx.xxx",
"token_type": "Bearer"
}
}
```
## Share API
### Share Text
@@ -29,7 +52,22 @@ Share text content and get a share code.
|-----------|------|----------|---------|-------------|
| text | string | Yes | - | Text content to share |
| expire_value | integer | No | 1 | Expiration time value |
| expire_style | string | No | "day" | Expiration time unit(day/hour/minute) |
| expire_style | string | No | "day" | Expiration time unit(day/hour/minute/count/forever) |
**cURL Example:**
```bash
# Guest upload (when openUpload=1)
curl -X POST "http://localhost:12345/share/text/" \
-F "text=This is the text content to share" \
-F "expire_value=1" \
-F "expire_style=day"
# When authentication required (openUpload=0)
curl -X POST "http://localhost:12345/share/text/" \
-H "Authorization: Bearer xxx.xxx.xxx" \
-F "text=This is the text content to share"
```
**Response Example:**
@@ -38,8 +76,7 @@ Share text content and get a share code.
"code": 200,
"msg": "success",
"detail": {
"code": "abc123",
"name": "text.txt"
"code": "abc123"
}
}
```
@@ -56,7 +93,32 @@ Upload and share a file, get a share code.
|-----------|------|----------|---------|-------------|
| file | file | Yes | - | File to upload |
| expire_value | integer | No | 1 | Expiration time value |
| expire_style | string | No | "day" | Expiration time unit(day/hour/minute) |
| expire_style | string | No | "day" | Expiration time unit(day/hour/minute/count/forever) |
**cURL Example:**
```bash
# Upload file (default 1 day expiration)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt"
# Upload file (7 days expiration)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt" \
-F "expire_value=7" \
-F "expire_style=day"
# Upload file (10 downloads limit)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt" \
-F "expire_value=10" \
-F "expire_style=count"
# When authentication required
curl -X POST "http://localhost:12345/share/file/" \
-H "Authorization: Bearer xxx.xxx.xxx" \
-F "file=@/path/to/file.txt"
```
**Response Example:**
@@ -75,7 +137,7 @@ Upload and share a file, get a share code.
**GET** `/share/select/`
Get file information by share code.
Get file information by share code (direct file download).
**Parameters:**
@@ -83,6 +145,13 @@ Get file information by share code.
|-----------|------|----------|-------------|
| code | string | Yes | File share code |
**cURL Example:**
```bash
# Download file by extraction code
curl -L "http://localhost:12345/share/select/?code=abc123" -o downloaded_file
```
**Response Example:**
```json
+41
View File
@@ -118,12 +118,53 @@ Content-Type: `multipart/form-data`
**cURL example:**
```bash
# Upload file (default 1 day expiration)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.pdf"
# Upload file with 7 days expiration
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.pdf" \
-F "expire_value=7" \
-F "expire_style=day"
# Upload file with 10 downloads limit
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.pdf" \
-F "expire_value=10" \
-F "expire_style=count"
# Share text
curl -X POST "http://localhost:12345/share/text/" \
-F "text=This is the text content to share"
# Download file by extraction code
curl -L "http://localhost:12345/share/select/?code=YOUR_CODE" -o downloaded_file
```
::: tip When Authentication Required
If guest upload is disabled in admin panel (`openUpload=0`), you need to login first:
```bash
# 1. Login to get token
curl -X POST "http://localhost:12345/admin/login" \
-H "Content-Type: application/json" \
-d '{"password": "FileCodeBox2023"}'
# Returns: {"code":200,"msg":"success","detail":{"token":"xxx.xxx.xxx","token_type":"Bearer"}}
# 2. Upload file with token
curl -X POST "http://localhost:12345/share/file/" \
-H "Authorization: Bearer xxx.xxx.xxx" \
-F "file=@/path/to/file.pdf"
# 3. Share text with token
curl -X POST "http://localhost:12345/share/text/" \
-H "Authorization: Bearer xxx.xxx.xxx" \
-F "text=This is the text content to share"
```
:::
## Chunked Upload API
+54 -1
View File
@@ -17,8 +17,61 @@ FileCodeBox 是一个简单高效的文件分享工具,支持文件临时中
### Docker 部署(推荐)
#### 快速启动
```bash
docker run -d --restart=always -p 12345:12345 -v /opt/FileCodeBox/:/app/data --name filecodebox lanol/filecodebox:beta
docker run -d --restart=always -p 12345:12345 -v /opt/FileCodeBox/:/app/data --name filecodebox lanol/filecodebox:latest
```
#### Docker Compose
```yml
version: "3"
services:
file-code-box:
image: lanol/filecodebox:latest
volumes:
- fcb-data:/app/data:rw
restart: unless-stopped
ports:
- "12345:12345"
environment:
- WORKERS=4
- LOG_LEVEL=info
volumes:
fcb-data:
external: false
```
#### 环境变量
| 变量 | 默认值 | 说明 |
|------|--------|------|
| `HOST` | `::` | 监听地址,支持 IPv4/IPv6 双栈 |
| `PORT` | `12345` | 服务端口 |
| `WORKERS` | `4` | 工作进程数,建议设置为 CPU 核心数 |
| `LOG_LEVEL` | `info` | 日志级别:debug/info/warning/error |
#### 自定义配置示例
```bash
docker run -d --restart=always \
-p 12345:12345 \
-v /opt/FileCodeBox/:/app/data \
-e WORKERS=8 \
-e LOG_LEVEL=warning \
--name filecodebox \
lanol/filecodebox:latest
```
### 配置反向代理(Nginx)
```nginx
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:12345;
}
```
### 手动部署
File renamed without changes.
File renamed without changes.
+41
View File
@@ -118,12 +118,53 @@ Content-Type: `multipart/form-data`
**cURL 示例:**
```bash
# 上传文件(默认1天有效期)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.pdf"
# 上传文件并指定有效期(7天)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.pdf" \
-F "expire_value=7" \
-F "expire_style=day"
# 上传文件并指定有效期(可下载10次)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.pdf" \
-F "expire_value=10" \
-F "expire_style=count"
# 分享文本
curl -X POST "http://localhost:12345/share/text/" \
-F "text=这是要分享的文本内容"
# 通过取件码下载文件
curl -L "http://localhost:12345/share/select/?code=取件码" -o downloaded_file
```
::: tip 需要认证时
如果管理面板关闭了游客上传(`openUpload=0`),需要先登录获取 token:
```bash
# 1. 登录获取 token
curl -X POST "http://localhost:12345/admin/login" \
-H "Content-Type: application/json" \
-d '{"password": "FileCodeBox2023"}'
# 返回: {"code":200,"msg":"success","detail":{"token":"xxx.xxx.xxx","token_type":"Bearer"}}
# 2. 使用 token 上传文件
curl -X POST "http://localhost:12345/share/file/" \
-H "Authorization: Bearer xxx.xxx.xxx" \
-F "file=@/path/to/file.pdf"
# 3. 使用 token 分享文本
curl -X POST "http://localhost:12345/share/text/" \
-H "Authorization: Bearer xxx.xxx.xxx" \
-F "text=这是要分享的文本内容"
```
:::
## 分片上传 API
对于大文件,FileCodeBox 支持分片上传功能。分片上传将大文件分割成多个小块分别上传,支持断点续传。
+20 -2
View File
@@ -22,6 +22,7 @@ from core.logger import logger
from core.response import APIResponse
from core.settings import data_root, settings, BASE_DIR, DEFAULT_CONFIG
from core.tasks import delete_expire_files, clean_incomplete_uploads
from core.utils import hash_password, is_password_hashed
@asynccontextmanager
@@ -63,13 +64,26 @@ async def load_config():
key="sys_start", defaults={"value": int(time.time() * 1000)}
)
settings.user_config = user_config.value
# 更新 ip_limit 配置
await migrate_password_to_hash()
ip_limit["error"].minutes = settings.errorMinute
ip_limit["error"].count = settings.errorCount
ip_limit["upload"].minutes = settings.uploadMinute
ip_limit["upload"].count = settings.uploadCount
async def migrate_password_to_hash():
if not is_password_hashed(settings.admin_token):
hashed = hash_password(settings.admin_token)
settings.admin_token = hashed
config_record = await KeyValue.filter(key="settings").first()
if config_record and config_record.value:
config_record.value["admin_token"] = hashed
await config_record.save()
logger.info("已将管理员密码迁移为哈希存储")
app = FastAPI(lifespan=lifespan)
app.add_middleware(
@@ -149,5 +163,9 @@ if __name__ == "__main__":
import uvicorn
uvicorn.run(
app="main:app", host=settings.serverHost, port=settings.serverPort, reload=False, workers=settings.serverWorkers
app="main:app",
host=settings.serverHost,
port=settings.serverPort,
reload=False,
workers=settings.serverWorkers,
)
+350 -222
View File
@@ -1,271 +1,339 @@
# FileCodeBox - 文件快递柜
<div align="center">
<img src="https://fastly.jsdelivr.net/gh/vastsa/FileCodeBox@V1.6/static/banners/img_1.png" alt="FileCodeBox Logo">
# FileCodeBox
<p><em>匿名口令分享文本和文件,像拿快递一样取文件</em></p>
### 文件快递柜 - 匿名口令分享文本和文件
[![GitHub stars](https://img.shields.io/github/stars/vastsa/FileCodeBox)](https://github.com/vastsa/FileCodeBox/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/vastsa/FileCodeBox)](https://github.com/vastsa/FileCodeBox/network)
[![GitHub issues](https://img.shields.io/github/issues/vastsa/FileCodeBox)](https://github.com/vastsa/FileCodeBox/issues)
[![GitHub license](https://img.shields.io/github/license/vastsa/FileCodeBox)](https://github.com/vastsa/FileCodeBox/blob/master/LICENSE)
[![QQ Group](https://img.shields.io/badge/QQ%20Group-739673698-blue.svg)](https://qm.qq.com/q/PemPzhdEIM)
[![Python Version](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org)
[![FastAPI](https://img.shields.io/badge/FastAPI-0.68+-green.svg)](https://fastapi.tiangolo.com)
[![Vue Version](https://img.shields.io/badge/Vue.js-3.x-brightgreen.svg)](https://v3.vuejs.org)
<img src="https://fastly.jsdelivr.net/gh/vastsa/FileCodeBox@V1.6/static/banners/img_1.png" alt="FileCodeBox Logo" width="400">
[English](./readme_en.md) | [部署教程](https://github.com/vastsa/FileCodeBox/wiki/部署教程) | [常见问题](https://github.com/vastsa/FileCodeBox/wiki/常见问题)
像拿快递一样取文件,无需注册,输入口令即可获取
[![GitHub stars](https://img.shields.io/github/stars/vastsa/FileCodeBox?style=flat-square&logo=github)](https://github.com/vastsa/FileCodeBox/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/vastsa/FileCodeBox?style=flat-square&logo=github)](https://github.com/vastsa/FileCodeBox/network)
[![GitHub issues](https://img.shields.io/github/issues/vastsa/FileCodeBox?style=flat-square&logo=github)](https://github.com/vastsa/FileCodeBox/issues)
[![GitHub license](https://img.shields.io/github/license/vastsa/FileCodeBox?style=flat-square)](https://github.com/vastsa/FileCodeBox/blob/master/LICENSE)
[![Docker Pulls](https://img.shields.io/docker/pulls/lanol/filecodebox?style=flat-square&logo=docker)](https://hub.docker.com/r/lanol/filecodebox)
[![Python](https://img.shields.io/badge/Python-3.8+-3776AB?style=flat-square&logo=python&logoColor=white)](https://www.python.org)
[![FastAPI](https://img.shields.io/badge/FastAPI-0.68+-009688?style=flat-square&logo=fastapi&logoColor=white)](https://fastapi.tiangolo.com)
[![Vue.js](https://img.shields.io/badge/Vue.js-3.x-4FC08D?style=flat-square&logo=vue.js&logoColor=white)](https://vuejs.org)
[English](./readme_en.md) | [在线演示](https://share.lanol.cn) | [部署教程](https://github.com/vastsa/FileCodeBox/wiki/部署教程) | [常见问题](https://github.com/vastsa/FileCodeBox/wiki/常见问题) | [QQ群: 739673698](https://qm.qq.com/q/PemPzhdEIM)
```bash
# 🚀 一键部署
docker run -d -p 12345:12345 -v /opt/FileCodeBox:/app/data --name filecodebox lanol/filecodebox:latest
# 国内镜像(如果上面拉取缓慢): docker.cnb.cool/aixk/filecodebox
```
</div>
## 🚀 更新计划
---
- [ ] 2025年皮肤
- [ ] 文件收集功能
## 目录
- [项目简介](#-项目简介)
- [功能特性](#-功能特性)
- [界面预览](#-界面预览)
- [快速开始](#-快速开始)
- [使用指南](#-使用指南)
- [开发指南](#-开发指南)
- [常见问题](#-常见问题)
- [贡献指南](#-贡献指南)
- [项目统计](#-项目统计)
- [免责声明](#-免责声明)
---
## 📝 项目简介
FileCodeBox 是一个基于 FastAPI + Vue3 开发的轻量级文件分享工具。它允许用户通过简单的方式分享文本和文件,接收者只需要一个提取码就可以取得文件,就像从快递柜取出快递一样简单。
FileCodeBox 是一个轻量级的文件分享工具,基于 **FastAPI + Vue3** 开发。用户可以通过简单的方式匿名分享文本和文件,接收者只需输入提取码即可获取内容——就像从快递柜取出快递一样简单。
## 🖼️ 功能预览
### 应用场景
别问前端源码怎么是js了,麻烦仔细看下面的内容
<div align="center">
<h3>
<a href="https://github.com/vastsa/FileCodeBoxFronted" target="_blank">
<img src="https://img.shields.io/badge/Frontend-主题2024仓库-blue?style=for-the-badge&logo=github" alt="前端仓库2024">
</a>
<a href="https://github.com/vastsa/FileCodeBoxFronted2023" target="_blank">
<img src="https://img.shields.io/badge/Frontend-主题2023仓库-blue?style=for-the-badge&logo=github" alt="前端仓库2023">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://share.lanol.cn" target="_blank">
<img src="https://img.shields.io/badge/Demo-share.lanol.cn-green?style=for-the-badge&logo=internet-explorer" alt="演示站点">
</a>
</h3>
</div>
| 场景 | 描述 |
|------|------|
| 📁 **临时文件分享** | 快速分享文件,无需注册登录 |
| 📝 **代码片段分享** | 分享代码、配置文件等文本内容 |
| 🕶️ **匿名文件传输** | 保护隐私的点对点传输 |
| 🔄 **跨设备传输** | 在不同设备间快速同步文件 |
| 💾 **临时存储** | 支持自定义过期时间的云存储 |
| 🌐 **私有服务** | 搭建企业或个人专属分享服务 |
### 新版界面
---
## ✨ 功能特性
<table>
<tr>
<td width="33%" valign="top">
### 🚀 轻量高效
- FastAPI + SQLite3 后端
- Vue3 + Element Plus 前端
- Docker 一键部署
- 资源占用极低
</td>
<td width="33%" valign="top">
### 🔒 安全可靠
- IP 上传频率限制
- 提取码错误次数限制
- 文件自动过期清理
- 支持管理员认证
</td>
<td width="33%" valign="top">
### 📤 便捷上传
- 拖拽上传
- 复制粘贴上传
- 命令行 curl 上传
- 批量文件上传
</td>
</tr>
<tr>
<td width="33%" valign="top">
### 🎫 灵活分享
- 随机/自定义提取码
- 可设置有效期(时间/次数)
- 支持永久有效
- 文本和文件统一管理
</td>
<td width="33%" valign="top">
### 💾 多存储支持
- 本地文件系统
- S3 兼容存储
- [OneDrive](./docs/guide/storage-onedrive.md)
- [OpenDAL](./docs/guide/storage-opendal.md)
</td>
<td width="33%" valign="top">
### 🌍 国际化
- 简体中文
- 繁体中文
- English
- 响应式设计 / 深色模式
</td>
</tr>
</table>
---
## 🖼️ 界面预览
> 前端源码仓库:[2024主题](https://github.com/vastsa/FileCodeBoxFronted) | [2023主题](https://github.com/vastsa/FileCodeBoxFronted2023)
<details open>
<summary><b>🎨 新版界面 (2024)</b></summary>
<br>
<div align="center">
<table>
<tr>
<td><img src="./.github/images/img_7.png" alt="文件上传" title="文件上传界面"></td>
<td><img src="./.github/images/img_8.png" alt="文本分享" title="文本分享界面"></td>
<td><img src="./.github/images/img_7.png" alt="文件上传"></td>
<td><img src="./.github/images/img_8.png" alt="文本分享"></td>
</tr>
<tr>
<td><img src="./.github/images/img_10.png" alt="文件管理" title="文件管理界面"></td>
<td><img src="./.github/images/img_9.png" alt="系统设置" title="系统设置界面"></td>
<td><img src="./.github/images/img_10.png" alt="文件管理"></td>
<td><img src="./.github/images/img_9.png" alt="系统设置"></td>
</tr>
<tr>
<td><img src="./.github/images/img_11.png" alt="移动端" title="移动端界面"></td>
<td><img src="./.github/images/img_12.png" alt="深色模式" title="深色模式界面"></td>
</tr>
<tr>
<td><img src="./.github/images/img_13.png" alt="国际化" title="国际化支持"></td>
<td><img src="./.github/images/img_14.png" alt="响应式" title="响应式设计"></td>
<td><img src="./.github/images/img_11.png" alt="移动端"></td>
<td><img src="./.github/images/img_12.png" alt="深色模式"></td>
</tr>
</table>
</div>
</details>
### 经典界面
<details>
<summary><b>📦 经典界面 (2023)</b></summary>
<br>
<div align="center">
<table>
<tr>
<td><img src="./.github/images/img.png" alt="首页" title="首页界面"></td>
<td><img src="./.github/images/img_1.png" alt="上传" title="上传界面"></td>
<td><img src="./.github/images/img.png" alt="首页"></td>
<td><img src="./.github/images/img_1.png" alt="上传"></td>
</tr>
<tr>
<td><img src="./.github/images/img_2.png" alt="管理" title="管理界面"></td>
<td><img src="./.github/images/img_3.png" alt="设置" title="设置界面"></td>
</tr>
<tr>
<td><img src="./.github/images/img_4.png" alt="分享" title="分享界面"></td>
<td><img src="./.github/images/img_5.png" alt="下载" title="下载界面"></td>
<td><img src="./.github/images/img_2.png" alt="管理"></td>
<td><img src="./.github/images/img_3.png" alt="设置"></td>
</tr>
</table>
</div>
</details>
## 🎯 应用场景
<table>
<tr>
<td align="center">
<h4>📁 临时文件分享</h4>
快速分享单个文件,无需注册登录
</td>
<td align="center">
<h4>📝 文本快速分享</h4>
分享代码片段、文本内容等
</td>
<td align="center">
<h4>🕶️ 匿名文件传输</h4>
保护隐私的文件传输方式
</td>
</tr>
<tr>
<td align="center">
<h4>💾 临时文件存储</h4>
支持设置过期时间的文件存储
</td>
<td align="center">
<h4>🔄 跨平台传输</h4>
在不同设备间快速传输文件
</td>
<td align="center">
<h4>🌐 小型分享服务</h4>
搭建私有的文件分享服务
</td>
</tr>
</table>
## ✨ 核心特性
<table>
<tr>
<td align="center">
<h4>🚀 轻量简洁</h4>
基于 FastAPI + SQLite3 + Vue3 + ElementUI,部署简单,性能出色
</td>
<td align="center">
<h4>📤 便捷上传</h4>
支持复制粘贴、拖拽上传,操作简单直观
</td>
<td align="center">
<h4>📦 多种类型</h4>
支持文本和各类文件的分享
</td>
</tr>
<tr>
<td align="center">
<h4>🔒 安全机制</h4>
- IP 限制上传次数
- 错误次数限制
- 文件过期机制
</td>
<td align="center">
<h4>🎫 提取码分享</h4>
随机提取码,可自定义次数及有效期
</td>
<td align="center">
<h4>🌍 多语言支持</h4>
支持中文简体、繁体及英文
</td>
</tr>
<tr>
<td align="center">
<h4>🎭 匿名分享</h4>
无需注册登录,保护隐私
</td>
<td align="center">
<h4>🛠 管理面板</h4>
文件管理和系统配置
</td>
<td align="center">
<h4>🐳 容器部署</h4>
支持 Docker 一键部署
</td>
</tr>
<tr>
<td align="center">
<h4>💾 存储扩展</h4>
支持本地存储、S3 协议、OneDrive 等
</td>
<td align="center">
<h4>📱 响应式设计</h4>
支持移动端访问
</td>
<td align="center">
<h4>💻 终端支持</h4>
支持命令行下载
</td>
</tr>
</table>
---
## 🚀 快速开始
### Docker 部署
### Docker 部署(推荐)
#### Docker CLI
**方式一:Docker CLI**
```bash
docker run -d --restart=always -p 12345:12345 -v /opt/FileCodeBox/:/app/data --name filecodebox lanol/filecodebox:beta
# Docker Hub(推荐)
docker run -d --restart always -p 12345:12345 -v /opt/FileCodeBox:/app/data --name filecodebox lanol/filecodebox:latest
# 国内镜像(如果 Docker Hub 拉取缓慢)
docker run -d --restart always -p 12345:12345 -v /opt/FileCodeBox:/app/data --name filecodebox docker.cnb.cool/aixk/filecodebox
```
#### Docker Compose
**方式二:Docker Compose**
```yml
version: "3"
```yaml
services:
file-code-box:
filecodebox:
image: lanol/filecodebox:latest
volumes:
- fcb-data:/app/data:rw
container_name: filecodebox
restart: unless-stopped
ports:
- "12345:12345"
volumes:
fcb-data:
external: false
volumes:
- ./data:/app/data
environment:
- WORKERS=4
- LOG_LEVEL=info
```
### 配置反向代理(Nginx示例)
```bash
docker compose up -d
```
请注意,必须添加以下配置来确保正确处理客户端IP和代理请求:
**环境变量说明**
| 变量 | 默认值 | 说明 |
|------|--------|------|
| `HOST` | `::` | 监听地址(支持 IPv4/IPv6 双栈) |
| `PORT` | `12345` | 服务端口 |
| `WORKERS` | `4` | 工作进程数(建议设为 CPU 核心数) |
| `LOG_LEVEL` | `info` | 日志级别:`debug` / `info` / `warning` / `error` |
### 反向代理配置
使用 Nginx 时,请添加以下配置以正确获取客户端 IP:
```nginx
location / {
proxy_set_header X-Real-IP $remote_addr; # 设置真实客户端IP
proxy_pass http://127.0.0.1:12345;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:12345;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 100m; # 根据需要调整上传大小限制
}
```
### 手动部署
1. 克隆项目
```bash
# 1. 克隆项目
git clone https://github.com/vastsa/FileCodeBox.git
```
2. 安装依赖
```bash
cd FileCodeBox
# 2. 安装依赖
pip install -r requirements.txt
```
3. 启动服务
```bash
# 3. 启动服务
python main.py
```
## 📖 使用说明
---
### 分享文件
## 📖 使用指南
1. 打开网页,点击"分享文件"
2. 选择或拖拽文件
3. 设置过期时间和次数
4. 获取提取码
### 基础操作
### 获取文件
| 操作 | 步骤 |
|------|------|
| **分享文件** | 打开网页 → 选择/拖拽文件 → 设置有效期 → 获取提取码 |
| **获取文件** | 打开网页 → 输入提取码 → 下载文件或查看文本 |
| **管理后台** | 访问 `/#/admin` → 输入密码 `FileCodeBox2023` |
1. 打开网页,输入提取码
2. 点击获取
3. 下载文件或查看文本
### 命令行使用(curl)
### 管理面板
<details>
<summary><b>点击展开 curl 使用示例</b></summary>
1. 访问 `/#/admin`
2. 输入管理员密码 `FileCodeBox2023`
3. 管理文件和配置
**上传文件**
```bash
# 基础上传(默认 1 天有效期)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt"
# 指定 1 小时有效期
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt" \
-F "expire_value=1" \
-F "expire_style=hour"
# 指定下载 10 次后过期
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt" \
-F "expire_value=10" \
-F "expire_style=count"
```
**分享文本**
```bash
curl -X POST "http://localhost:12345/share/text/" \
-F "text=要分享的文本内容"
```
**下载文件**
```bash
curl -L "http://localhost:12345/share/select/?code=提取码" -o filename
```
**有效期参数**
| `expire_style` | 说明 |
|----------------|------|
| `day` | 天数 |
| `hour` | 小时 |
| `minute` | 分钟 |
| `count` | 下载次数 |
| `forever` | 永久有效 |
**返回示例**
```json
{
"code": 200,
"msg": "success",
"detail": {
"code": "abcd1234",
"name": "file.txt"
}
}
```
**需要认证时**(管理员关闭游客上传后)
```bash
# 1. 获取 token
curl -X POST "http://localhost:12345/admin/login" \
-H "Content-Type: application/json" \
-d '{"password": "FileCodeBox2023"}'
# 2. 携带 token 上传
curl -X POST "http://localhost:12345/share/file/" \
-H "Authorization: Bearer <token>" \
-F "file=@/path/to/file.txt"
```
</details>
---
## 🛠 开发指南
@@ -273,71 +341,131 @@ python main.py
```
FileCodeBox/
├── apps/ # 应用代码
│ ├── admin/ # 管理后台
│ └── base/ # 基础功能
├── core/ # 核心功能
├── data/ # 数据目录
└── fcb-fronted/ # 前端代码
├── apps/ # 应用模块
│ ├── admin/ # 管理后台
│ └── base/ # 基础功能
├── core/ # 核心模块
├── data/ # 数据目录(运行时生成)
├── docs/ # 文档
└── main.py # 入口文件
```
### 开发环境
- Python 3.8+
- Node.js 14+
- Vue 3
- FastAPI
### 本地开发
1. 后端开发
**后端**
```bash
pip install -r requirements.txt
python main.py
```
2. 前端开发
**前端**
```bash
# 前端仓库: https://github.com/vastsa/FileCodeBoxFronted
cd fcb-fronted
npm install
npm run dev
```
## 🤝 贡献指南
### 技术栈
1. Fork 本项目
2. 创建新分支 `git checkout -b feature/xxx`
3. 提交更改 `git commit -m 'Add xxx'`
4. 推送到分支 `git push origin feature/xxx`
5. 提交 Pull Request
| 类别 | 技术 |
|------|------|
| **后端框架** | FastAPI 0.128+ / Uvicorn |
| **数据库** | SQLite + Tortoise ORM |
| **数据验证** | Pydantic 2.x |
| **异步支持** | aiofiles / aiohttp / aioboto3 |
| **对象存储** | S3 协议 / OneDrive / OpenDAL |
| **前端框架** | Vue 3 + Element Plus + Vite |
| **运行环境** | Python 3.8+ / Node.js 18+ |
| **容器化** | Docker / Docker Compose |
---
## ❓ 常见问题
### Q: 如何修改上传大小限制?
<details>
<summary><b>如何修改上传大小限制?</b></summary>
A: 在管理面板中修改配置项 `uploadSize`
在管理面板中修改 `uploadSize` 配置项。如果使用 Nginx 反向代理,还需修改 `client_max_body_size`。
</details>
### Q: 如何配置存储引擎?
<details>
<summary><b>如何配置存储引擎?</b></summary>
A: 在管理面板中选择存储引擎并配置相应参数
在管理面板中选择存储引擎类型并配置相应参数。支持本地存储、S3、OneDrive、OpenDAL 等。
</details>
### Q: 如何备份数据?
<details>
<summary><b>如何备份数据?</b></summary>
A: 备份 `data` 目录即可
备份 `data` 目录即可,包含数据库和上传的文件。
</details>
更多问题请访问 [Wiki](https://github.com/vastsa/FileCodeBox/wiki/常见问题)
<details>
<summary><b>如何修改管理员密码?</b></summary>
登录管理面板后,在系统设置中修改 `adminPassword` 配置项。
</details>
更多问题请访问 [Wiki](https://github.com/vastsa/FileCodeBox/wiki/常见问题) 或加入 [QQ群: 739673698](https://qm.qq.com/q/PemPzhdEIM)
---
## 🤝 贡献指南
欢迎提交 Issue 和 Pull Request!
```bash
# 1. Fork 并克隆
git clone https://github.com/your-username/FileCodeBox.git
# 2. 创建分支
git checkout -b feature/your-feature
# 3. 提交更改
git commit -m "feat: add your feature"
# 4. 推送并创建 PR
git push origin feature/your-feature
```
---
## 📊 项目统计
<div align="center">
<a href="https://hellogithub.com/repository/75ad7ffedd404a6485b4d621ec5b47e6" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=75ad7ffedd404a6485b4d621ec5b47e6&claim_uid=beSz6INEkCM4mDH" alt="Featured|HelloGitHub" style="width: 200px; height: 45px;" width="200" height="45" /></a>
<a href="https://hellogithub.com/repository/75ad7ffedd404a6485b4d621ec5b47e6" target="_blank">
<img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=75ad7ffedd404a6485b4d621ec5b47e6&claim_uid=beSz6INEkCM4mDH" alt="HelloGitHub" width="200">
</a>
![Repobeats](https://repobeats.axiom.co/api/embed/7a6c92f1d96ee57e6fb67f0df371528397b0c9ac.svg)
[![Star History](https://api.star-history.com/svg?repos=vastsa/FileCodeBox&type=Date)](https://star-history.com/#vastsa/FileCodeBox&Date)
</div>
---
## 🗓 更新计划
- [ ] 2025 年新皮肤
- [ ] 文件收集功能
---
## 📜 免责声明
本项目开源仅供学习使用,不得用于任何违法用途,否则后果自负,与作者无关。使用时请保留项目地址和版权信息。
本项目开源仅供学习交流使用,不得用于任何违法用途,否则后果自负,与作者无关。使用本项目时请保留项目地址和版权信息。
---
<div align="center">
**如果觉得项目不错,欢迎 ⭐ Star 支持!**
Made with ❤️ by [vastsa](https://github.com/vastsa)
</div>
+355 -224
View File
@@ -1,340 +1,471 @@
# FileCodeBox
<div align="center">
<img src="https://fastly.jsdelivr.net/gh/vastsa/FileCodeBox@V1.6/static/banners/img_1.png" alt="FileCodeBox Logo">
# FileCodeBox
<p><em>Share text and files anonymously with a passcode, like picking up a package</em></p>
### Anonymous File & Text Sharing with Passcode
[![GitHub stars](https://img.shields.io/github/stars/vastsa/FileCodeBox)](https://github.com/vastsa/FileCodeBox/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/vastsa/FileCodeBox)](https://github.com/vastsa/FileCodeBox/network)
[![GitHub issues](https://img.shields.io/github/issues/vastsa/FileCodeBox)](https://github.com/vastsa/FileCodeBox/issues)
[![GitHub license](https://img.shields.io/github/license/vastsa/FileCodeBox)](https://github.com/vastsa/FileCodeBox/blob/master/LICENSE)
[![QQ Group](https://img.shields.io/badge/QQ%20Group-739673698-blue.svg)](https://qm.qq.com/q/PemPzhdEIM)
[![Python Version](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://www.python.org)
[![FastAPI](https://img.shields.io/badge/FastAPI-0.68+-green.svg)](https://fastapi.tiangolo.com)
[![Vue Version](https://img.shields.io/badge/Vue.js-3.x-brightgreen.svg)](https://v3.vuejs.org)
<img src="https://fastly.jsdelivr.net/gh/vastsa/FileCodeBox@V1.6/static/banners/img_1.png" alt="FileCodeBox Logo" width="400">
[简体中文](./readme.md) | [Deployment Guide](https://github.com/vastsa/FileCodeBox/wiki/Deployment-Guide) | [FAQ](https://github.com/vastsa/FileCodeBox/wiki/FAQ)
Share files like picking up a package — no registration required, just enter the passcode
[![GitHub stars](https://img.shields.io/github/stars/vastsa/FileCodeBox?style=flat-square&logo=github)](https://github.com/vastsa/FileCodeBox/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/vastsa/FileCodeBox?style=flat-square&logo=github)](https://github.com/vastsa/FileCodeBox/network)
[![GitHub issues](https://img.shields.io/github/issues/vastsa/FileCodeBox?style=flat-square&logo=github)](https://github.com/vastsa/FileCodeBox/issues)
[![GitHub license](https://img.shields.io/github/license/vastsa/FileCodeBox?style=flat-square)](https://github.com/vastsa/FileCodeBox/blob/master/LICENSE)
[![Docker Pulls](https://img.shields.io/docker/pulls/lanol/filecodebox?style=flat-square&logo=docker)](https://hub.docker.com/r/lanol/filecodebox)
[![Python](https://img.shields.io/badge/Python-3.8+-3776AB?style=flat-square&logo=python&logoColor=white)](https://www.python.org)
[![FastAPI](https://img.shields.io/badge/FastAPI-0.128+-009688?style=flat-square&logo=fastapi&logoColor=white)](https://fastapi.tiangolo.com)
[![Vue.js](https://img.shields.io/badge/Vue.js-3.x-4FC08D?style=flat-square&logo=vue.js&logoColor=white)](https://vuejs.org)
[简体中文](./README.md) | [Live Demo](https://share.lanol.cn) | [Documentation](https://github.com/vastsa/FileCodeBox/wiki/Deployment-Guide) | [FAQ](https://github.com/vastsa/FileCodeBox/wiki/FAQ)
```bash
# 🚀 Quick Deploy
docker run -d -p 12345:12345 -v /opt/FileCodeBox:/app/data --name filecodebox lanol/filecodebox:latest
# China Mirror (if slow): docker.cnb.cool/aixk/filecodebox
```
</div>
---
## Table of Contents
- [Introduction](#-introduction)
- [Features](#-features)
- [Screenshots](#-screenshots)
- [Quick Start](#-quick-start)
- [Usage Guide](#-usage-guide)
- [Development](#-development)
- [FAQ](#-faq)
- [Contributing](#-contributing)
- [Statistics](#-statistics)
- [Disclaimer](#-disclaimer)
---
## 📝 Introduction
FileCodeBox is a lightweight file sharing tool developed with FastAPI + Vue3. It allows users to share text and files
easily, where recipients only need a passcode to retrieve the files, just like picking up a package from a delivery
locker.
FileCodeBox is a lightweight file sharing tool built with **FastAPI + Vue3**. Users can anonymously share text and files, and recipients only need to enter a passcode to retrieve the content — just like picking up a package from a locker.
## 🖼️ Preview
### Use Cases
<div align="center">
<h3>
<a href="https://github.com/vastsa/FileCodeBoxFronted" target="_blank">
<img src="https://img.shields.io/badge/Frontend-FileCodeBoxFronted2024-blue?style=for-the-badge&logo=github" alt="前端仓库2024">
</a>
<a href="https://github.com/vastsa/FileCodeBoxFronted2023" target="_blank">
<img src="https://img.shields.io/badge/Frontend-FileCodeBoxFronted2023-blue?style=for-the-badge&logo=github" alt="前端仓库2023">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://share.lanol.cn" target="_blank">
<img src="https://img.shields.io/badge/Demo-share.lanol.cn-green?style=for-the-badge&logo=internet-explorer" alt="演示站点">
</a>
</h3>
</div>
| Scenario | Description |
|----------|-------------|
| 📁 **Temporary File Sharing** | Quick file sharing without registration |
| 📝 **Code Snippet Sharing** | Share code, config files, and text content |
| 🕶️ **Anonymous Transfer** | Privacy-protected peer-to-peer transfer |
| 🔄 **Cross-Device Transfer** | Quickly sync files between devices |
| 💾 **Temporary Storage** | Cloud storage with custom expiration |
| 🌐 **Private Service** | Build your own enterprise or personal sharing service |
### New Interface
---
## ✨ Features
<table>
<tr>
<td width="33%" valign="top">
### 🚀 Lightweight & Fast
- FastAPI + SQLite3 backend
- Vue3 + Element Plus frontend
- One-click Docker deployment
- Minimal resource usage
</td>
<td width="33%" valign="top">
### 🔒 Secure & Reliable
- IP upload rate limiting
- Passcode attempt limiting
- Auto file expiration cleanup
- Admin authentication support
</td>
<td width="33%" valign="top">
### 📤 Easy Upload
- Drag & drop upload
- Copy & paste upload
- Command line curl upload
- Batch file upload
</td>
</tr>
<tr>
<td width="33%" valign="top">
### 🎫 Flexible Sharing
- Random / custom passcodes
- Set expiration (time/count)
- Permanent validity support
- Unified text & file management
</td>
<td width="33%" valign="top">
### 💾 Multiple Storage
- Local file system
- S3-compatible storage
- [OneDrive](./docs/guide/storage-onedrive.md)
- [OpenDAL](./docs/guide/storage-opendal.md)
</td>
<td width="33%" valign="top">
### 🌍 Internationalization
- Simplified Chinese
- Traditional Chinese
- English
- Responsive design / Dark mode
</td>
</tr>
</table>
---
## 🖼️ Screenshots
> Frontend repositories: [2024 Theme](https://github.com/vastsa/FileCodeBoxFronted) | [2023 Theme](https://github.com/vastsa/FileCodeBoxFronted2023)
<details open>
<summary><b>🎨 New Interface (2024)</b></summary>
<br>
<div align="center">
<table>
<tr>
<td><img src="./.github/images/img_7.png" alt="File Upload" title="File Upload Interface"></td>
<td><img src="./.github/images/img_8.png" alt="Text Share" title="Text Share Interface"></td>
<td><img src="./.github/images/img_7.png" alt="File Upload"></td>
<td><img src="./.github/images/img_8.png" alt="Text Share"></td>
</tr>
<tr>
<td><img src="./.github/images/img_10.png" alt="File Management" title="File Management Interface"></td>
<td><img src="./.github/images/img_9.png" alt="System Settings" title="System Settings Interface"></td>
<td><img src="./.github/images/img_10.png" alt="File Management"></td>
<td><img src="./.github/images/img_9.png" alt="System Settings"></td>
</tr>
<tr>
<td><img src="./.github/images/img_11.png" alt="Mobile View" title="Mobile Interface"></td>
<td><img src="./.github/images/img_12.png" alt="Dark Mode" title="Dark Mode Interface"></td>
</tr>
<tr>
<td><img src="./.github/images/img_13.png" alt="Internationalization" title="Language Support"></td>
<td><img src="./.github/images/img_14.png" alt="Responsive" title="Responsive Design"></td>
<td><img src="./.github/images/img_11.png" alt="Mobile View"></td>
<td><img src="./.github/images/img_12.png" alt="Dark Mode"></td>
</tr>
</table>
</div>
</details>
### Classic Interface
<details>
<summary><b>📦 Classic Interface (2023)</b></summary>
<br>
<div align="center">
<table>
<tr>
<td><img src="./.github/images/img.png" alt="Home" title="Home Page"></td>
<td><img src="./.github/images/img_1.png" alt="Upload" title="Upload Interface"></td>
<td><img src="./.github/images/img.png" alt="Home"></td>
<td><img src="./.github/images/img_1.png" alt="Upload"></td>
</tr>
<tr>
<td><img src="./.github/images/img_2.png" alt="Management" title="Management Interface"></td>
<td><img src="./.github/images/img_3.png" alt="Settings" title="Settings Interface"></td>
</tr>
<tr>
<td><img src="./.github/images/img_4.png" alt="Share" title="Share Interface"></td>
<td><img src="./.github/images/img_5.png" alt="Download" title="Download Interface"></td>
<td><img src="./.github/images/img_2.png" alt="Management"></td>
<td><img src="./.github/images/img_3.png" alt="Settings"></td>
</tr>
</table>
</div>
</details>
## 🎯 Use Cases
<table>
<tr>
<td align="center">
<h4>📁 Temporary File Sharing</h4>
Quick file sharing without registration
</td>
<td align="center">
<h4>📝 Quick Text Sharing</h4>
Share code snippets and text content
</td>
<td align="center">
<h4>🕶️ Anonymous Transfer</h4>
Privacy-protected file transfer
</td>
</tr>
<tr>
<td align="center">
<h4>💾 Temporary Storage</h4>
File storage with expiration time
</td>
<td align="center">
<h4>🔄 Cross-platform Transfer</h4>
Quick file transfer between devices
</td>
<td align="center">
<h4>🌐 Private Share Service</h4>
Build your own file sharing service
</td>
</tr>
</table>
## ✨ Core Features
<table>
<tr>
<td align="center">
<h4>🚀 Lightweight</h4>
Based on FastAPI + SQLite3 + Vue3 + ElementUI
</td>
<td align="center">
<h4>📤 Easy Upload</h4>
Support copy-paste and drag-drop
</td>
<td align="center">
<h4>📦 Multiple Types</h4>
Support text and various file types
</td>
</tr>
<tr>
<td align="center">
<h4>🔒 Security</h4>
- IP upload limits
- Error attempt limits
- File expiration
</td>
<td align="center">
<h4>🎫 Passcode Sharing</h4>
Random codes with customizable limits
</td>
<td align="center">
<h4>🌍 Multi-language</h4>
Support for Simplified Chinese, Traditional Chinese, and English
</td>
</tr>
<tr>
<td align="center">
<h4>🎭 Anonymous</h4>
No registration required
</td>
<td align="center">
<h4>🛠 Admin Panel</h4>
File and system management
</td>
<td align="center">
<h4>🐳 Docker</h4>
One-click deployment
</td>
</tr>
<tr>
<td align="center">
<h4>💾 Storage Options</h4>
Local, S3, OneDrive support
</td>
<td align="center">
<h4>📱 Responsive</h4>
Mobile-friendly design
</td>
<td align="center">
<h4>💻 CLI Support</h4>
Command-line download
</td>
</tr>
</table>
---
## 🚀 Quick Start
### Docker Deployment
### Docker Deployment (Recommended)
#### Docker CLI
**Option 1: Docker CLI**
```bash
docker run -d --restart=always -p 12345:12345 -v /opt/FileCodeBox/:/app/data --name filecodebox lanol/filecodebox:beta
# Docker Hub (Recommended)
docker run -d --restart always -p 12345:12345 -v /opt/FileCodeBox:/app/data --name filecodebox lanol/filecodebox:latest
# China Mirror (if Docker Hub is slow)
docker run -d --restart always -p 12345:12345 -v /opt/FileCodeBox:/app/data --name filecodebox docker.cnb.cool/aixk/filecodebox
```
#### Docker Compose
**Option 2: Docker Compose**
```ymlfix
version: "3"
services:s
file-code-box:
```yaml
services:
filecodebox:
image: lanol/filecodebox:latest
volumes:
- fcb-data:/app/data:rw
container_name: filecodebox
restart: unless-stopped
ports:
- "12345:12345"
volumes:
fcb-data:
external: false
volumes:
- ./data:/app/data
environment:
- WORKERS=4
- LOG_LEVEL=info
```
### Configure reverse proxy (Nginx example)
```bash
docker compose up -d
```
Please note that the following configurations must be added to ensure proper handling of client IP and proxy requests:
**Environment Variables**
| Variable | Default | Description |
|----------|---------|-------------|
| `HOST` | `::` | Listen address (supports IPv4/IPv6 dual-stack) |
| `PORT` | `12345` | Service port |
| `WORKERS` | `4` | Worker processes (recommended: CPU cores) |
| `LOG_LEVEL` | `info` | Log level: `debug` / `info` / `warning` / `error` |
### Reverse Proxy Configuration
When using Nginx, add the following configuration to properly obtain client IP:
```nginx
location / {
proxy_set_header X-Real-IP $remote_addr; #Set real client IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:12345 ;
proxy_pass http://127.0.0.1:12345;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 100m; # Adjust upload size limit as needed
}
```
### Manual Deployment
1. Clone the repository
```bash
# 1. Clone the repository
git clone https://github.com/vastsa/FileCodeBox.git
```
2. Install dependencies
```bash
cd FileCodeBox
# 2. Install dependencies
pip install -r requirements.txt
```
3. Start the service
```bash
# 3. Start the service
python main.py
```
---
## 📖 Usage Guide
### Share Files
### Basic Operations
1. Open the website, click "Share File"
2. Select or drag files
3. Set expiration time and count
4. Get the passcode
| Operation | Steps |
|-----------|-------|
| **Share File** | Open website → Select/drag files → Set expiration → Get passcode |
| **Retrieve File** | Open website → Enter passcode → Download file or view text |
| **Admin Panel** | Visit `/#/admin` → Enter password `FileCodeBox2023` |
### Retrieve Files
### Command Line Usage (curl)
1. Open the website, enter passcode
2. Click retrieve
3. Download file or view text
<details>
<summary><b>Click to expand curl examples</b></summary>
### Admin Panel
**Upload File**
1. Visit `/admin`
2. Enter admin password
3. Manage files and settings
```bash
# Basic upload (default 1 day expiration)
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt"
## 🛠 Development Guide
# Set 1 hour expiration
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt" \
-F "expire_value=1" \
-F "expire_style=hour"
# Set expiration after 10 downloads
curl -X POST "http://localhost:12345/share/file/" \
-F "file=@/path/to/file.txt" \
-F "expire_value=10" \
-F "expire_style=count"
```
**Share Text**
```bash
curl -X POST "http://localhost:12345/share/text/" \
-F "text=Text content to share"
```
**Download File**
```bash
curl -L "http://localhost:12345/share/select/?code=PASSCODE" -o filename
```
**Expiration Parameters**
| `expire_style` | Description |
|----------------|-------------|
| `day` | Days |
| `hour` | Hours |
| `minute` | Minutes |
| `count` | Download count |
| `forever` | Never expire |
**Response Example**
```json
{
"code": 200,
"msg": "success",
"detail": {
"code": "abcd1234",
"name": "file.txt"
}
}
```
**When Authentication Required** (after admin disables guest upload)
```bash
# 1. Get token
curl -X POST "http://localhost:12345/admin/login" \
-H "Content-Type: application/json" \
-d '{"password": "FileCodeBox2023"}'
# 2. Upload with token
curl -X POST "http://localhost:12345/share/file/" \
-H "Authorization: Bearer <token>" \
-F "file=@/path/to/file.txt"
```
</details>
---
## 🛠 Development
### Project Structure
```
FileCodeBox/
├── apps/ # Application code
│ ├── admin/ # Admin backend
│ └── base/ # Base functions
├── core/ # Core functions
├── data/ # Data directory
└── fcb-fronted/ # Frontend code
├── apps/ # Application modules
│ ├── admin/ # Admin backend
│ └── base/ # Base functionality
├── core/ # Core modules
├── data/ # Data directory (generated at runtime)
├── docs/ # Documentation
└── main.py # Entry point
```
### Development Environment
- Python 3.8+
- Node.js 14+
- Vue 3
- FastAPI
### Local Development
1. Backend development
**Backend**
```bash
pip install -r requirements.txt
python main.py
```
2. Frontend development
**Frontend**
```bash
# Frontend repo: https://github.com/vastsa/FileCodeBoxFronted
cd fcb-fronted
npm install
npm run dev
```
## 🤝 Contributing
### Tech Stack
1. Fork the project
2. Create your feature branch `git checkout -b feature/xxx`
3. Commit your changes `git commit -m 'Add xxx'`
4. Push to the branch `git push origin feature/xxx`
5. Open a Pull Request
| Category | Technology |
|----------|------------|
| **Backend Framework** | FastAPI 0.128+ / Uvicorn |
| **Database** | SQLite + Tortoise ORM |
| **Data Validation** | Pydantic 2.x |
| **Async Support** | aiofiles / aiohttp / aioboto3 |
| **Object Storage** | S3 Protocol / OneDrive / OpenDAL |
| **Frontend Framework** | Vue 3 + Element Plus + Vite |
| **Runtime** | Python 3.8+ / Node.js 18+ |
| **Containerization** | Docker / Docker Compose |
---
## ❓ FAQ
### Q: How to modify upload size limit?
<details>
<summary><b>How to modify upload size limit?</b></summary>
A: Change `uploadSize` in admin panel
Modify the `uploadSize` configuration in the admin panel. If using Nginx reverse proxy, also modify `client_max_body_size`.
</details>
### Q: How to configure storage engine?
<details>
<summary><b>How to configure storage engine?</b></summary>
A: Select storage engine and configure parameters in admin panel
Select the storage engine type and configure parameters in the admin panel. Supports local storage, S3, OneDrive, OpenDAL, etc.
</details>
### Q: How to backup data?
<details>
<summary><b>How to backup data?</b></summary>
A: Backup the `data` directory
Backup the `data` directory, which contains the database and uploaded files.
</details>
For more questions, visit [Wiki](https://github.com/vastsa/FileCodeBox/wiki/常见问题)
<details>
<summary><b>How to change admin password?</b></summary>
## �� Project Statistics and Analytics
After logging into the admin panel, modify the `adminPassword` configuration in system settings.
</details>
For more questions, visit [Wiki](https://github.com/vastsa/FileCodeBox/wiki/FAQ)
---
## 🤝 Contributing
Issues and Pull Requests are welcome!
```bash
# 1. Fork and clone
git clone https://github.com/your-username/FileCodeBox.git
# 2. Create branch
git checkout -b feature/your-feature
# 3. Commit changes
git commit -m "feat: add your feature"
# 4. Push and create PR
git push origin feature/your-feature
```
---
## 📊 Statistics
<div align="center">
<a href="https://hellogithub.com/repository/75ad7ffedd404a6485b4d621ec5b47e6" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=75ad7ffedd404a6485b4d621ec5b47e6&claim_uid=beSz6INEkCM4mDH" alt="Featured|HelloGitHub" style="width: 200px; height: 45px;" width="200" height="45" /></a>
<a href="https://hellogithub.com/repository/75ad7ffedd404a6485b4d621ec5b47e6" target="_blank">
<img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=75ad7ffedd404a6485b4d621ec5b47e6&claim_uid=beSz6INEkCM4mDH" alt="HelloGitHub" width="200">
</a>
![Repobeats](https://repobeats.axiom.co/api/embed/7a6c92f1d96ee57e6fb67f0df371528397b0c9ac.svg)
[![Star History](https://api.star-history.com/svg?repos=vastsa/FileCodeBox&type=Date)](https://star-history.com/#vastsa/FileCodeBox&Date)
</div>
---
## 🗓 Roadmap
- [ ] 2025 New Theme
- [ ] File Collection Feature
---
## 📜 Disclaimer
This project is open-source for learning purposes only. It should not be used for any illegal purposes. The author is
not responsible for any consequences. Please retain the project address and copyright information when using it.
This project is open-source for learning and communication purposes only. It should not be used for any illegal purposes. The author is not responsible for any consequences. Please retain the project address and copyright information when using it.
---
<div align="center">
**If you find this project helpful, please give it a ⭐ Star!**
Made with ❤️ by [vastsa](https://github.com/vastsa)
</div>
+8 -9
View File
@@ -1,9 +1,8 @@
aioboto3==11.2.0
aiohttp==3.10.11
aiofiles==24.1.0
botocore==1.29.76
fastapi==0.115.0
pydantic==2.4.0
uvicorn==0.23.2
tortoise-orm==0.20.0
python-multipart==0.0.20
aioboto3==15.5.0
aiohttp==3.13.3
aiofiles==25.1.0
fastapi==0.128.0
pydantic==2.12.5
uvicorn==0.40.0
tortoise-orm==0.25.3
python-multipart==0.0.21
-1
View File
@@ -1 +0,0 @@
import{a as s,a8 as n,P as c,N as e,U as r,R as a,j as o,o as i}from"./index-CxMsK_Ni.js";const l={style:{"text-align":"center"}},u={style:{color:"#333"},href:"https://github.com/vastsa/FileCodeBox"},f=s({__name:"AboutView",setup(_){const{t}=n();return(m,p)=>(i(),c("main",l,[e("span",null,[r(a(o(t)("admin.about.source1"))+" ",1),e("em",null,[e("a",u,a(o(t)("admin.about.source2")),1)])])]))}});export{f as default};
@@ -1 +0,0 @@
.el-container{box-sizing:border-box;display:flex;flex:1;flex-basis:auto;flex-direction:row;min-width:0}.el-container.is-vertical{flex-direction:column}.el-aside{box-sizing:border-box;flex-shrink:0;overflow:auto;width:var(--el-aside-width,300px)}.el-footer{--el-footer-padding:0 20px;--el-footer-height:60px;box-sizing:border-box;flex-shrink:0;height:var(--el-footer-height);padding:var(--el-footer-padding)}.el-header{--el-header-padding:0 20px;--el-header-height:60px;box-sizing:border-box;flex-shrink:0;height:var(--el-header-height);padding:var(--el-header-padding)}.el-main{--el-main-padding:20px;box-sizing:border-box;display:block;flex:1;flex-basis:auto;overflow:auto;padding:var(--el-main-padding)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transform-origin:center top;transition:var(--el-transition-md-fade)}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transform-origin:center bottom;transition:var(--el-transition-md-fade)}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transform-origin:top left;transition:var(--el-transition-md-fade)}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}:root{--el-menu-active-color:var(--el-color-primary);--el-menu-text-color:var(--el-text-color-primary);--el-menu-hover-text-color:var(--el-color-primary);--el-menu-bg-color:var(--el-fill-color-blank);--el-menu-hover-bg-color:var(--el-color-primary-light-9);--el-menu-item-height:56px;--el-menu-sub-item-height:calc(var(--el-menu-item-height) - 6px);--el-menu-horizontal-height:60px;--el-menu-horizontal-sub-item-height:36px;--el-menu-item-font-size:var(--el-font-size-base);--el-menu-item-hover-fill:var(--el-color-primary-light-9);--el-menu-border-color:var(--el-border-color);--el-menu-base-level-padding:20px;--el-menu-level-padding:20px;--el-menu-icon-width:24px}.el-menu{background-color:var(--el-menu-bg-color);border-right:1px solid var(--el-menu-border-color);box-sizing:border-box;list-style:none;margin:0;padding-left:0;position:relative}.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item-group__title,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-sub-menu__title{padding-left:calc(var(--el-menu-base-level-padding) + var(--el-menu-level)*var(--el-menu-level-padding));white-space:nowrap}.el-menu:not(.el-menu--collapse) .el-sub-menu__title{padding-right:calc(var(--el-menu-base-level-padding) + var(--el-menu-icon-width))}.el-menu--horizontal{border-right:none;display:flex;flex-wrap:nowrap;height:var(--el-menu-horizontal-height)}.el-menu--horizontal.el-menu--popup-container{height:unset}.el-menu--horizontal.el-menu{border-bottom:1px solid var(--el-menu-border-color)}.el-menu--horizontal>.el-menu-item{align-items:center;border-bottom:2px solid transparent;colorLine truncated
-1
View File
@@ -1 +0,0 @@
import{k as ie,T as Ke,t as ce,E as Qe,b as Xe}from"./el-input-CNNwOXGP.js";import{E as Ye,a as Ze}from"./el-form-item-llYGp2SQ.js";import"./el-tooltip-l0sNRNKZ.js";import{E as Pe,C as Je}from"./el-popper-C96qJ_vz.js";import{u as et,a as tt}from"./index-CBpXPsVN.js";import{_ as V,a as y,u as $,g as X,o as S,w,r as k,aC as Oe,aP as nt,j as h,T as Ne,l as ye,aG as at,c as f,P as A,h as D,n as Ie,ak as q,L as P,I as ue,aQ as ot,D as ve,b as Ce,i as de,s as x,aR as st,aS as lt,t as Ee,$ as re,p as _e,aT as Se,a0 as we,a1 as Be,z as I,W as Ae,G as Y,A as ze,C as ut,ab as pe,aU as $e,aV as ne,al as He,f as it,aW as rt,am as ke,d as me,aX as ct,m as dt,F as mt,aY as pt,M as Le,N as Me,aA as ft,U as ae,R as oe,aK as vt,a8 as ht,B as L,a9 as gt,ac as bt,af as _t,aF as Te}from"./index-CxMsK_Ni.js";import{f as Mt}from"./vnode-Cc0RQjVK.js";import"./_baseClone-DD6IrDYX.js";const yt=y({name:"ElCollapseTransition"}),It=y({...yt,setup(e){const a=$("collapse-transition"),n=t=>{t.style.maxHeight="",t.style.overflow=t.dataset.oldOverflow,t.style.paddingTop=t.dataset.oldPaddingTop,t.style.paddingBottom=t.dataset.oldPaddingBottom},o={beforeEnter(t){t.dataset||(t.dataset={}),t.dataset.oldPaddingTop=t.style.paddingTop,t.dataset.oldPaddingBottom=t.style.paddingBottom,t.style.height&&(t.dataset.elExistsHeight=t.style.height),t.style.maxHeight=0,t.style.paddingTop=0,t.style.paddingBottom=0},enter(t){requestAnimationFrame(()=>{t.dataset.oldOverflow=t.style.overflow,t.dataset.elExistsHeight?t.style.maxHeight=t.dataset.elExistsHeight:t.scrollHeight!==0?t.style.maxHeight=`${t.scrollHeight}px`:t.style.maxHeight=0,t.style.paddingTop=t.dataset.oldPaddingTop,t.style.paddingBottom=t.dataset.oldPaddingBottom,t.style.overflow="hidden"})},afterEnter(t){t.style.maxHeight="",t.style.overflow=t.dataset.oldOverflow},enterCancelled(t){n(t)},beforeLeave(t){t.dataset||(t.dataset={}),t.dataset.oldPaddingTop=t.style.paddingTop,t.dataset.oldPaddingBottom=t.style.paddingBottom,t.dataset.oldOverflow=t.style.overflow,t.style.maxHeight=`${t.scrollHeight}px`,t.style.overflow="hidden"},leave(t){t.scrollHeight!==0&&(t.style.maxHeight=0,t.style.paddingTop=0,t.style.paddingBottom=0)},afterLeave(t){n(t)},leaveCancelled(t){n(t)}};return(t,v)=>(S(),X(Ne,Oe({name:h(a).b()},nt(o)),{default:w(()=>[k(t.$slots,"default")]),_:3},16,["name"]))}});var Ct=V(It,[["__file","collapse-transition.vue"]]);const Et=ye(Ct),St=y({name:"ElContainer"}),wt=y({...St,props:{direction:{type:String}},setup(e){const a=e,n=at(),o=$("container"),t=f(()=>a.direction==="vertical"?!0:a.direction==="horizontal"?!1:n&&n.default?n.default().some(d=>{const g=d.type.name;return g==="ElHeader"||g==="ElFooter"}):!1);return(v,d)=>(S(),A("section",{class:D([h(o).b(),h(o).is("vertical",h(t))])},[k(v.$slots,"default")],2))}});var xt=V(wt,[["__file","container.vue"]]);const $t=y({name:"ElAside"}),kt=y({...$t,props:{width:{type:String,default:null}},setup(e){const a=e,n=$("aside"),o=f(()=>a.width?n.cssVarBlock({width:a.width}):{});return(t,v)=>(S(),A("aside",{class:D(h(n).b()),style:Ie(h(o))},[k(t.$slots,"default")],6))}});var De=V(kt,[["__file","aside.vue"]]);const Tt=y({name:"ElFooter"}),Pt=y({...Tt,props:{height:{type:String,default:null}},setup(e){const a=e,n=$("footer"),o=f(()=>a.height?n.cssVarBlock({height:a.height}):{});return(t,v)=>(S(),A("footer",{class:D(h(n).b()),style:Ie(h(o))},[k(t.$slots,"default")],6))}});var Ve=V(Pt,[["__file","footer.vue"]]);const Ot=y({name:"ElHeader"}),Nt=y({...Ot,props:{height:{type:String,default:null}},setup(e){const a=e,n=$("header"),o=f(()=>a.height?n.cssVarBlock({height:a.height}):{});return(t,v)=>(S(),A("header",{class:D(h(n).b()),style:Ie(h(o))},[k(t.$slots,"default")],6))}});var Fe=V(Nt,[["__file","header.vue"]]);const Bt=y({name:"ElMain"}),At=y({...Bt,setup(e){const a=$("main");return(n,o)=>(S(),A("main",{class:D(h(a).b())},[k(n.$slots,"default")],2))}});var Re=V(At,[["__file","main.vue"]]);const zt=ye(xt,{Aside:De,Footer:Ve,Header:Fe,Main:Re});q(De);q(Ve);const Ht=q(Fe),Lt=q(Re);let Dt=class{constructor(a,n){this.parent=a,this.domNode=n,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(a){a===this.subMenuItems.length?a=0:a<0&&(a=this.subMenuItems.length-1),this.subMenuItems[a].focus(),this.subIndex=a}addListeners(){const a=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,n=>{n.addEventListener("keydown",o=>{let t=!1;switch(o.code){case P.down:{this.gotoSubIndex(this.subIndex+1),t=!0;break}case P.up:{this.gotoSubIndex(this.subIndex-1),t=!0;break}case P.tab:{ie(a,"mouseleave");break}case P.enter:case P.numpadEnter:case P.space:{t=!0,o.currentTarget.click();break}}return t&&(o.preventDefault(),o.stopPropagation()),!1})})}},Vt=class{constructor(a,n){this.domNode=a,this.submenu=null,this.submenu=null,this.init(n)}init(a){this.domNode.setAttribute("tabindex","0");const n=this.domNode.querySelector(`.${a}-menu`);n&&(this.submenu=new Dt(this,n)),this.addListeners()Line truncated
@@ -1 +0,0 @@
.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color,var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary,20px);background-color:var(--el-drawer-bg-color);box-shadow:var(--el-box-shadow-dark);box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;position:absolute;transition:all var(--el-transition-duration)}.el-drawer .btt,.el-drawer .ltr,.el-drawer .rtl,.el-drawer .ttb{transform:translate(0)}.el-drawer__sr-focus:focus{outline:none!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{flex:1;font-size:16px;line-height:inherit;margin:0}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{background-color:transparent;border:none;color:inherit;cursor:pointer;display:inline-flex;font-size:var(--el-font-size-extra-large);outline:none}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;overflow:auto;padding:var(--el-drawer-padding-primary)}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{bottom:0;height:100%;top:0}.el-drawer.btt,.el-drawer.ttb{left:0;right:0;width:100%}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{background-color:transparent!important}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translate(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translate(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-progress{align-items:center;display:flex;line-height:1;position:relative}.el-progress__text{color:var(--el-text-color-regular);font-size:14px;line-height:1;margin-left:5px;min-width:50px}.el-progress__text i{display:block;vertical-align:middle}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{left:0;margin:0;position:absolute;text-align:center;top:50%;transform:translateY(-50%);width:100%}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{display:inline-block;vertical-align:middle}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{display:block;margin-right:0;padding-right:0}.el-progress--text-inside .el-progress-bar{margin-right:0;padding-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:var(--el-color-success)}.el-progress.is-success .el-progress__text{color:var(--el-color-success)}.el-progress.is-warning .el-progress-bar__inner{background-color:var(--el-color-warning)}.el-progress.is-warning .el-progress__text{color:var(--el-color-warning)}.el-progress.is-exception .el-progress-bar__inner{background-color:var(--el-color-danger)}.el-progress.is-exception .el-progress__text{color:var(--el-color-danger)}.el-progress-bar{box-sizing:border-box;flex-grow:1}.el-progress-bar__outer{background-color:var(--el-border-color-lighter);border-radius:100px;height:6px;overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{background-color:var(--el-color-primary);border-radius:100px;height:100%;left:0;line-height:1;position:absolute;text-align:right;top:0;transition:width .6s ease;white-space:nowrap}.el-progress-bar__inner:after{content:"";display:inline-block;height:100%;vertical-align:middle}.el-progress-bar__inner--indeterminate{animation:indeterminate 3s infinite;transform:translateZ(0)}.el-progress-bar__inner--striped{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0,transparent 50%,rgba(0,0,0,.1) 0,rgba(0,0,0,.1) 75%,transparent 0,transparent);background-size:1.25em 1.25em}.el-progress-bar__inner--striped.el-progress-bar__inner--striped-flow{animation:striped-flow 3s linear infinite}.el-progress-bar__innerText{color:#fff;display:inline-block;font-size:12px;margin:0 5px;vertical-align:middle}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@keyframes indeterminate{0%{left:-100%}to{left:100%}}@keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truLine truncated
@@ -1,297 +0,0 @@
import{e as lg,a as cg,j as ug,b as dg}from"./el-input-CNNwOXGP.js";import{u as _g,a as mg}from"./index-CBpXPsVN.js";import{b as bm,_ as hm,a as gn,aG as pg,c as St,s as pn,u as Tm,ao as gg,aH as Eg,g as Dt,o as Ne,w as ze,B as ot,T as fg,j as X,A as Sg,N as it,aC as bg,O as hg,P as rt,Q as Tn,h as bt,r as Yn,R as pt,W as Ol,as as Cm,C as Tg,l as Rm,d as ka,aI as Cg,aq as Rg,aJ as Ng,ar as yg,a2 as Og,G as _u,n as Bn,k as Ag,aK as Nm,t as mu,z as Ft,aL as ym,a0 as vg,ab as Cl,a8 as Ig,a9 as Om,U as mn,ac as pu,aF as Dg,aa as xg,aM as Mg,ad as wg,aN as Lg,aO as kg,ae as Pg}from"./index-CxMsK_Ni.js";import{e as Fg,f as Bg,g as Ug,E as Gg,h as Yg,d as qg}from"./config-CZWWa62X.js";import{E as zg}from"./el-tag-5pOVEKUY.js";var Hg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Al(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const Vg=bm({...Bg,direction:{type:String,default:"rtl",values:["ltr","rtl","ttb","btt"]},size:{type:[String,Number],default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},headerAriaLevel:{type:String,default:"2"}}),Wg=Fg,$g=gn({name:"ElDrawer",inheritAttrs:!1}),Kg=gn({...$g,props:Vg,emits:Wg,setup(t,{expose:e}){const a=t,o=pg();lg({scope:"el-drawer",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/drawer.html#slots"},St(()=>!!o.title));const c=pn(),s=pn(),d=Tm("drawer"),{t:u}=gg(),{afterEnter:_,afterLeave:p,beforeLeave:S,visible:h,rendered:y,titleId:O,bodyId:N,zIndex:w,onModalClick:L,onOpenAutoFocus:D,onCloseAutoFocus:U,onFocusoutPrevented:x,onCloseRequested:G,handleClose:F}=Ug(a,c),z=St(()=>a.direction==="rtl"||a.direction==="ltr"),$=St(()=>Eg(a.size));return e({handleClose:F,afterEnter:_,afterLeave:p}),(V,ee)=>(Ne(),Dt(X(ug),{to:V.appendTo,disabled:V.appendTo!=="body"?!1:!V.appendToBody},{default:ze(()=>[ot(fg,{name:X(d).b("fade"),onAfterEnter:X(_),onAfterLeave:X(p),onBeforeLeave:X(S),persisted:""},{default:ze(()=>[Sg(ot(X(Gg),{mask:V.modal,"overlay-class":V.modalClass,"z-index":X(w),onClick:X(L)},{default:ze(()=>[ot(X(cg),{loop:"",trapped:X(h),"focus-trap-el":c.value,"focus-start-el":s.value,onFocusAfterTrapped:X(D),onFocusAfterReleased:X(U),onFocusoutPrevented:X(x),onReleaseRequested:X(G)},{default:ze(()=>[it("div",bg({ref_key:"drawerRef",ref:c,"aria-modal":"true","aria-label":V.title||void 0,"aria-labelledby":V.title?void 0:X(O),"aria-describedby":X(N)},V.$attrs,{class:[X(d).b(),V.direction,X(h)&&"open"],style:X(z)?"width: "+X($):"height: "+X($),role:"dialog",onClick:hg(()=>{},["stop"])}),[it("span",{ref_key:"focusStartRef",ref:s,class:bt(X(d).e("sr-focus")),tabindex:"-1"},null,2),V.withHeader?(Ne(),rt("header",{key:0,class:bt([X(d).e("header"),V.headerClass])},[V.$slots.title?Yn(V.$slots,"title",{key:1},()=>[Tn(" DEPRECATED SLOT ")]):Yn(V.$slots,"header",{key:0,close:X(F),titleId:X(O),titleClass:X(d).e("title")},()=>[V.$slots.title?Tn("v-if",!0):(Ne(),rt("span",{key:0,id:X(O),role:"heading","aria-level":V.headerAriaLevel,class:bt(X(d).e("title"))},pt(V.title),11,["id","aria-level"]))]),V.showClose?(Ne(),rt("button",{key:2,"aria-label":X(u)("el.drawer.close"),class:bt(X(d).e("close-btn")),type:"button",onClick:X(F)},[ot(X(Ol),{class:bt(X(d).e("close"))},{default:ze(()=>[ot(X(Cm))]),_:1},8,["class"])],10,["aria-label","onClick"])):Tn("v-if",!0)],2)):Tn("v-if",!0),X(y)?(Ne(),rt("div",{key:1,id:X(N),class:bt([X(d).e("body"),V.bodyClass])},[Yn(V.$slots,"default")],10,["id"])):Tn("v-if",!0),V.$slots.footer?(Ne(),rt("div",{key:2,class:bt([X(d).e("footer"),V.footerClass])},[Yn(V.$slots,"footer")],2)):Tn("v-if",!0)],16,["aria-label","aria-labelledby","aria-describedby","onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[Tg,X(h)]])]),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["to","disabled"]))}});var Qg=hm(Kg,[["__file","drawer.vue"]]);const Xg=Rm(Qg),Zg=bm({type:{type:String,default:"line",values:["line","circle","dashboard"]},percentage:{type:Number,default:0,validator:t=>t>=0&&t<=100},status:{type:String,default:"",values:["","success","exception","warning"]},indeterminate:Boolean,duration:{type:Number,default:3},strokeWidth:{type:Number,default:6},strokeLinecap:{type:ka(String),default:"round"},textInside:Boolean,width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:ka([String,Array,Function]),default:""},striped:Boolean,stripedFlow:Boolean,format:{type:ka(Function),default:t=>`${t}%`}}),Jg=gn({name:"ElProgress"}),jg=gn({...Jg,props:Zg,setup(t){const e=t,a={success:"#13ce66",exception:"#ff4949",warning:"#e6a23c",default:"#20a0ff"},o=Tm("progress"),c=St(()=>{const x={width:`${e.percentage}%`,animationDuration:`${e.duration}s`},G=U(e.percentage);return G.includes("gradient"Line truncated
M 50 50
m 0 ${G?"":"-"}${x}
a ${x} ${x} 0 1 1 0 ${G?"-":""}${x*2}
a ${x} ${x} 0 1 1 0 ${G?"":"-"}${x*2}
`}),_=St(()=>2*Math.PI*d.value),p=St(()=>e.type==="dashboard"?.75:1),S=St(()=>`${-1*_.value*(1-p.value)/2}px`),h=St(()=>({strokeDasharray:`${_.value*p.value}px, ${_.value}px`,strokeDashoffset:S.value})),y=St(()=>({strokeDasharray:`${_.value*p.value*(e.percentage/100)}px, ${_.value}px`,strokeDashoffset:S.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),O=St(()=>{let x;return e.color?x=U(e.percentage):x=a[e.status]||a.default,x}),N=St(()=>e.status==="warning"?Cg:e.type==="line"?e.status==="success"?Rg:Ng:e.status==="success"?yg:Cm),w=St(()=>e.type==="line"?12+e.strokeWidth*.4:e.width*.111111+2),L=St(()=>e.format(e.percentage));function D(x){const G=100/x.length;return x.map((z,$)=>_u(z)?{color:z,percentage:($+1)*G}:z).sort((z,$)=>z.percentage-$.percentage)}const U=x=>{var G;const{color:F}=e;if(Og(F))return F(x);if(_u(F))return F;{const z=D(F);for(const $ of z)if($.percentage>x)return $.color;return(G=z[z.length-1])==null?void 0:G.color}};return(x,G)=>(Ne(),rt("div",{class:bt([X(o).b(),X(o).m(x.type),X(o).is(x.status),{[X(o).m("without-text")]:!x.showText,[X(o).m("text-inside")]:x.textInside}]),role:"progressbar","aria-valuenow":x.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[x.type==="line"?(Ne(),rt("div",{key:0,class:bt(X(o).b("bar"))},[it("div",{class:bt(X(o).be("bar","outer")),style:Bn({height:`${x.strokeWidth}px`})},[it("div",{class:bt([X(o).be("bar","inner"),{[X(o).bem("bar","inner","indeterminate")]:x.indeterminate},{[X(o).bem("bar","inner","striped")]:x.striped},{[X(o).bem("bar","inner","striped-flow")]:x.stripedFlow}]),style:Bn(X(c))},[(x.showText||x.$slots.default)&&x.textInside?(Ne(),rt("div",{key:0,class:bt(X(o).be("bar","innerText"))},[Yn(x.$slots,"default",{percentage:x.percentage},()=>[it("span",null,pt(X(L)),1)])],2)):Tn("v-if",!0)],6)],6)],2)):(Ne(),rt("div",{key:1,class:bt(X(o).b("circle")),style:Bn({height:`${x.width}px`,width:`${x.width}px`})},[(Ne(),rt("svg",{viewBox:"0 0 100 100"},[it("path",{class:bt(X(o).be("circle","track")),d:X(u),stroke:`var(${X(o).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":x.strokeLinecap,"stroke-width":X(s),fill:"none",style:Bn(X(h))},null,14,["d","stroke","stroke-linecap","stroke-width"]),it("path",{class:bt(X(o).be("circle","path")),d:X(u),stroke:X(O),fill:"none",opacity:x.percentage?1:0,"stroke-linecap":x.strokeLinecap,"stroke-width":X(s),style:Bn(X(y))},null,14,["d","stroke","opacity","stroke-linecap","stroke-width"])]))],6)),(x.showText||x.$slots.default)&&!x.textInside?(Ne(),rt("div",{key:2,class:bt(X(o).e("text")),style:Bn({fontSize:`${X(w)}px`})},[Yn(x.$slots,"default",{percentage:x.percentage},()=>[x.status?(Ne(),Dt(X(Ol),{key:1},{default:ze(()=>[(Ne(),Dt(Ag(X(N))))]),_:1})):(Ne(),rt("span",{key:0},pt(X(L)),1))])],6)):Tn("v-if",!0)],10,["aria-valuenow"]))}});var eE=hm(jg,[["__file","progress.vue"]]);const tE=Rm(eE),nE=Nm("fileData",()=>{const t=mu(JSON.parse(localStorage.getItem("receiveData")||"[]")||[]),e=mu(JSON.parse(localStorage.getItem("shareData")||"[]")||[]);function a(){localStorage.setItem("receiveData",JSON.stringify(t)),localStorage.setItem("shareData",JSON.stringify(e))}function o(u){t.unshift(u),a()}function c(u){e.unshift(u),a()}function s(u){t.splice(u,1),a()}function d(u){e.splice(u,1),a()}return{receiveData:t,shareData:e,save:a,addShareData:c,addReceiveData:o,deleteReceiveData:s,deleteShareData:d}}),Am=Nm("fileBox",()=>({showFileBox:pn(!1)}));function vm(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const a=t[e],o=typeof a;(o==="object"||o==="function")&&!Object.isFrozen(a)&&vm(a)}),t}class gu{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Im(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Nn(t,...e){const a=Object.create(null);for(const o in t)a[o]=t[o];return e.forEach(function(o){for(const c in o)a[c]=o[c]}),a}const rE="</span>",Eu=t=>!!t.scope,aE=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const a=t.split(".");return[`${e}${a.shift()}`,...a.map((o,c)=>`${o}${"_".repeat(c+1)}`)].join(" ")}return`${e}${t}`};class iE{constructor(e,a){this.buffer="",this.classPrefix=a.classPrefix,e.walk(this)}addText(e){this.buffer+=Im(e)}openNode(e){if(!Eu(e))return;const a=aE(e.scope,{prefix:this.classPrefix});this.span(a)}closeNode(e){Eu(e)&&(this.buffer+=rE)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const fu=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class vl{constructor(){this.rootNode=fu(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){tLine truncated
https://github.com/highlightjs/highlight.js/issues/2277`),Ae=W,he=te),ue===void 0&&(ue=!0);const re={code:he,language:Ae};be("before:highlight",re);const Xe=re.result?re.result:h(re.language,re.code,ue);return Xe.code=re.code,be("after:highlight",Xe),Xe}function h(W,te,ue,he){const Ae=Object.create(null);function re(j,se){return j.keywords[se]}function Xe(){if(!de.keywords){Ve.addText(ye);return}let j=0;de.keywordPatternRe.lastIndex=0;let se=de.keywordPatternRe.exec(ye),Ee="";for(;se;){Ee+=ye.substring(j,se.index);const Se=ht.case_insensitive?se[0].toLowerCase():se[0],Ze=re(de,Se);if(Ze){const[Et,An]=Ze;if(Ve.addText(Ee),Ee="",Ae[Se]=(Ae[Se]||0)+1,Ae[Se]<=KE&&(ln+=An),Et.startsWith("_"))Ee+=se[0];else{const vn=ht.classNameAliases[Et]||Et;Me(se[0],vn)}}else Ee+=se[0];j=de.keywordPatternRe.lastIndex,se=de.keywordPatternRe.exec(ye)}Ee+=ye.substring(j),Ve.addText(Ee)}function st(){if(ye==="")return;let j=null;if(typeof de.subLanguage=="string"){if(!e[de.subLanguage]){Ve.addText(ye);return}j=h(de.subLanguage,ye,!0,gt[de.subLanguage]),gt[de.subLanguage]=j._top}else j=O(ye,de.subLanguage.length?de.subLanguage:null);de.relevance>0&&(ln+=j.relevance),Ve.__addSublanguage(j._emitter,j.language)}function ve(){de.subLanguage!=null?st():Xe(),ye=""}function Me(j,se){j!==""&&(Ve.startScope(se),Ve.addText(j),Ve.endScope())}function Fe(j,se){let Ee=1;const Se=se.length-1;for(;Ee<=Se;){if(!j._emit[Ee]){Ee++;continue}const Ze=ht.classNameAliases[j[Ee]]||j[Ee],Et=se[Ee];Ze?Me(Et,Ze):(ye=Et,Xe(),ye=""),Ee++}}function we(j,se){return j.scope&&typeof j.scope=="string"&&Ve.openNode(ht.classNameAliases[j.scope]||j.scope),j.beginScope&&(j.beginScope._wrap?(Me(ye,ht.classNameAliases[j.beginScope._wrap]||j.beginScope._wrap),ye=""):j.beginScope._multi&&(Fe(j.beginScope,se),ye="")),de=Object.create(j,{parent:{value:de}}),de}function Ie(j,se,Ee){let Se=uE(j.endRe,Ee);if(Se){if(j["on:end"]){const Ze=new gu(j);j["on:end"](se,Ze),Ze.isMatchIgnored&&(Se=!1)}if(Se){for(;j.endsParent&&j.parent;)j=j.parent;return j}}if(j.endsWithParent)return Ie(j.parent,se,Ee)}function Be(j){return de.matcher.regexIndex===0?(ye+=j[0],1):(Ut=!0,0)}function je(j){const se=j[0],Ee=j.rule,Se=new gu(Ee),Ze=[Ee.__beforeBegin,Ee["on:begin"]];for(const Et of Ze)if(Et&&(Et(j,Se),Se.isMatchIgnored))return Be(se);return Ee.skip?ye+=se:(Ee.excludeBegin&&(ye+=se),ve(),!Ee.returnBegin&&!Ee.excludeBegin&&(ye=se)),we(Ee,j),Ee.returnBegin?0:se.length}function et(j){const se=j[0],Ee=te.substring(j.index),Se=Ie(de,j,Ee);if(!Se)return Tu;const Ze=de;de.endScope&&de.endScope._wrap?(ve(),Me(se,de.endScope._wrap)):de.endScope&&de.endScope._multi?(ve(),Fe(de.endScope,j)):Ze.skip?ye+=se:(Ze.returnEnd||Ze.excludeEnd||(ye+=se),ve(),Ze.excludeEnd&&(ye=se));do de.scope&&Ve.closeNode(),!de.skip&&!de.subLanguage&&(ln+=de.relevance),de=de.parent;while(de!==Se.parent);return Se.starts&&we(Se.starts,j),Ze.returnEnd?0:se.length}function ut(){const j=[];for(let se=de;se!==ht;se=se.parent)se.scope&&j.unshift(se.scope);j.forEach(se=>Ve.openNode(se))}let mt={};function En(j,se){const Ee=se&&se[0];if(ye+=j,Ee==null)return ve(),0;if(mt.type==="begin"&&se.type==="end"&&mt.index===se.index&&Ee===""){if(ye+=te.slice(se.index,se.index+1),!c){const Se=new Error(`0 width match regex (${W})`);throw Se.languageName=W,Se.badRule=mt.rule,Se}return 1}if(mt=se,se.type==="begin")return je(se);if(se.type==="illegal"&&!ue){const Se=new Error('Illegal lexeme "'+Ee+'" for mode "'+(de.scope||"<unnamed>")+'"');throw Se.mode=de,Se}else if(se.type==="end"){const Se=et(se);if(Se!==Tu)return Se}if(se.type==="illegal"&&Ee==="")return ye+=`
`,1;if(Ht>1e5&&Ht>se.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ye+=Ee,Ee.length}const ht=V(W);if(!ht)throw Mn(s.replace("{}",W)),new Error('Unknown language: "'+W+'"');const on=HE(ht);let sn="",de=he||on;const gt={},Ve=new u.__emitter(u);ut();let ye="",ln=0,Rt=0,Ht=0,Ut=!1;try{if(ht.__emitTokens)ht.__emitTokens(te,Ve);else{for(de.matcher.considerAll();;){Ht++,Ut?Ut=!1:de.matcher.considerAll(),de.matcher.lastIndex=Rt;const j=de.matcher.exec(te);if(!j)break;const se=te.substring(Rt,j.index),Ee=En(se,j);Rt=j.index+Ee}En(te.substring(Rt))}return Ve.finalize(),sn=Ve.toHTML(),{language:W,value:sn,relevance:ln,illegal:!1,_emitter:Ve,_top:de}}catch(j){if(j.message&&j.message.includes("Illegal"))return{language:W,value:Pa(te),illegal:!0,relevance:0,_illegalBy:{message:j.message,index:Rt,context:te.slice(Rt-100,Rt+100),mode:j.mode,resultSoFar:sn},_emitter:Ve};if(c)return{language:W,value:Pa(te),illegal:!1,relevance:0,errorRaised:j,_emitter:Ve,_top:de};throw j}}function y(W){const te={value:Pa(W),illegal:!1,relevance:0,_top:d,_emitter:new u.__emitter(u)};return te._emitter.addText(W),te}function O(W,te){te=te||u.languages||Object.keys(e);const ue=y(W),he=te.filter(V).filter(ce).map(ve=>h(ve,W,!1));he.unshift(ue);const Ae=he.sort((ve,Me)=>{if(ve.relevance!==Me.relevance)return Me.relevance-ve.relevance;if(ve.language&&Me.language){if(V(ve.language).supersetOf===Me.language)return 1;if(V(Me.language).supersetOf===ve.language)return-1}return 0}),[re,Xe]=Ae,st=re;return st.secondBest=Xe,st}function N(W,te,ue){const he=te&&a[te]||ue;W.classList.add("hljs"),W.classList.add(`language-${he}`)}function w(W){let te=null;const ue=p(W);if(_(ue))return;if(be("before:highlightElement",{el:W,language:ue}),W.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",W);return}if(W.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(W)),u.throwUnescapedHTML))throw new $E("One of your code blocks includes unescaped HTML.",W.innerHTML);te=W;const he=te.textContent,Ae=ue?S(he,{language:ue,ignoreIllegals:!0}):O(he);W.innerHTML=Ae.value,W.dataset.highlighted="yes",N(W,ue,Ae.language),W.result={language:Ae.language,re:Ae.relevance,relevance:Ae.relevance},Ae.secondBest&&(W.secondBest={language:Ae.secondBest.language,relevance:Ae.secondBest.relevance}),be("after:highlightElement",{el:W,result:Ae,text:he})}function L(W){u=hu(u,W)}const D=()=>{G(),Un("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function U(){G(),Un("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function G(){function W(){G()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",W,!1),x=!0;return}document.querySelectorAll(u.cssSelector).forEach(w)}function F(W,te){let ue=null;try{ue=te(t)}catch(he){if(Mn("Language definition for '{}' could not be registered.".replace("{}",W)),c)Mn(he);else throw he;ue=d}ue.name||(ue.name=W),e[W]=ue,ue.rawDefinition=te.bind(null,t),ue.aliases&&ee(ue.aliases,{languageName:W})}function z(W){delete e[W];for(const te of Object.keys(a))a[te]===W&&delete a[te]}function $(){return Object.keys(e)}function V(W){return W=(W||"").toLowerCase(),e[W]||e[a[W]]}function ee(W,{languageName:te}){typeof W=="string"&&(W=[W]),W.forEach(ue=>{a[ue.toLowerCase()]=te})}function ce(W){const te=V(W);return te&&!te.disableAutodetect}function ne(W){W["before:highlightBlock"]&&!W["before:highlightElement"]&&(W["before:highlightElement"]=te=>{W["before:highlightBlock"](Object.assign({block:te.el},te))}),W["after:highlightBlock"]&&!W["after:highlightElement"]&&(W["after:highlightElement"]=te=>{W["after:highlightBlock"](Object.assign({block:te.el},te))})}function me(W){ne(W),o.push(W)}function pe(W){const te=o.indexOf(W);te!==-1&&o.splice(te,1)}function be(W,te){const ue=W;o.forEach(function(he){he[ue]&&he[ue](te)})}function fe(W){return Un("10.7.0","highlightBlock will be removed entirely in v12.0"),Un("10.7.0","Please use highlightElement now."),w(W)}Object.assign(t,{highlight:S,highlightAuto:O,highlightAll:G,highlightElement:w,highlightBlock:fe,configure:L,initHighlighting:D,initHighlightingOnLoad:U,registerLanguage:F,unregisterLanguage:z,listLanguages:$,getLanguage:V,registerAliases:ee,autoDetection:ce,inherit:hu,addPlugin:me,removePlugin:pe}),t.debugMode=function(){c=!1},t.safeMode=function(){c=!0},t.versionString=WE,t.regex={concat:Ln,lookahead:Dm,either:Il,optional:lE,anyNumberOfTimes:sE};for(const W in wr)typeof wr[W]=="object"&&vm(wr[W]);return Object.assign(t,wr),t},Hn=Um({});Hn.newInstance=()=>Um({});var QE=Hn;Hn.HighlightJS=Hn;Hn.default=Hn;var Fa,Cu;function XE(){if(Cu)return Fa;Cu=1;function t(e){const a="[A-Za-zА-Яа-яёЁ_][A-Za-Line truncated
`},N]}}return Co=c,Co}var Ro,s_;function PS(){if(s_)return Ro;s_=1;function t(e){const a="[a-zA-Z_][\\w.]*",o="<\\?(lasso(script)?|=)",c="\\]|\\?>",s={$pattern:a+"|&[lg]t;",literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",keyword:"cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"},d=e.COMMENT("<!--","-->",{relevance:0}),u={className:"meta",begin:"\\[noprocess\\]",starts:{end:"\\[/noprocess\\]",returnEnd:!0,contains:[d]}},_={className:"meta",begin:"\\[/noprocess|"+o},p={className:"symbol",begin:"'"+a+"'"},S=[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.inherit(e.C_NUMBER_MODE,{begin:e.C_NUMBER_RE+"|(-?infinity|NaN)\\b"}),e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"`",end:"`"},{variants:[{begin:"[#$]"+a},{begin:"#",end:"\\d+",illegal:"\\W"}]},{className:"type",begin:"::\\s*",end:a,illegal:"\\W"},{className:"params",variants:[{begin:"-(?!infinity)"+a,relevance:0},{begin:"(\\.\\.\\.)"}]},{begin:/(->|\.)\s*/,relevance:0,contains:[p]},{className:"class",beginKeywords:"define",returnEnd:!0,end:"\\(|=>",contains:[e.inherit(e.TITLE_MODE,{begin:a+"(=(?!>))?|[-+*/%](?!>)"})]}];return{name:"Lasso",aliases:["ls","lassoscript"],case_insensitive:!0,keywords:s,contains:[{className:"meta",begin:c,relevance:0,starts:{end:"\\[|"+o,returnEnd:!0,relevance:0,contains:[d]}},u,_,{className:"meta",begin:"\\[no_square_brackets",starts:{end:"\\[/no_square_brackets\\]",keywords:s,contains:[{className:"meta",begin:c,relevance:0,starts:{end:"\\[noprocess\\]|"+o,returnEnd:!0,contains:[d]}},u,_].concat(S)}},{className:"meta",begin:"\\[",relevance:0},{className:"meta",begin:"^#!",end:"lasso9$",relevance:10}].concat(S)}}return Ro=t,Ro}var No,l_;function FS(){if(l_)return No;l_=1;function t(e){const o=e.regex.either(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map(ne=>ne+"(?![a-zA-Z@:_])")),c=new RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}","[qs]__?[a-zA-Z](?:_?[a-zA-Z])+","use(?:_i)?:[a-zA-Z]*","(?:else|fi|or):","(?:if|cs|exp):w","(?:hbox|vbox):n","::[a-zA-Z]_unbraced","::[a-zA-Z:]"].map(ne=>ne+"(?![a-zA-Z:_])").join("|")),s=[{begin:/[a-zA-Z@]+/},{begin:/[^a-zA-Z@]?/}],d=[{begin:/\^{6}[0-9a-f]{6}/},{begin:/\^{5}[0-9a-f]{5}/},{begin:/\^{4}[0-9a-f]{4}/},{begin:/\^{3}[0-9a-f]{3}/},{begin:/\^{2}[0-9a-f]{2}/},{begin:/\^{2}[\u0000-\u007f]/}],u={className:"keyword",begin:/\\/,relevance:0,contains:[{endsParent:!0,begin:o},{endsParent:!0,begin:c},{endsParent:!0,variants:d},{endsParent:!0,relevance:0,variants:s}]},_={className:"params",relevance:0,begin:/#+\d?/},p={variants:d},S={className:"built_in",relevance:0,begin:/[$&^_]/},h={className:"meta",begin:/% ?!(T[eE]X|tex|BIB|bib)/,end:"$",relevance:10},y=e.COMMENT("%","$",{relevance:0}),O=[u,_,p,S,h,y],N={begin:/\{/,end:/\}/,relevance:0,contains:["self",...O]},w=e.inheLine truncated
]`,w={scope:"string",variants:[h,S,y,O]},L={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},D=["false","null","true"],U=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],F={keyword:U,literal:(fe=>{const W=[];return fe.forEach(te=>{W.push(te),te.toLowerCase()===te?W.push(te.toUpperCase()):W.push(te.toLowerCase())}),W})(D),built_in:x},z=fe=>fe.map(W=>W.replace(/\|\d+$/,"")),$={variants:[{match:[/new/,a.concat(N,"+"),a.concat("(?!",z(x).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},V=a.concat(c,"\\b(?!\\()"),ee={variants:[{match:[a.concat(/::/,a.lookahead(/(?!class\b)/)),V],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,a.concat(/::/,a.lookahead(/(?!class\b)/)),V],scope:{1:"title.class",3:"variable.constant"}},{match:[s,a.concat("::",a.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ce={scope:"attr",match:a.concat(c,a.lookahead(":"),a.lookahead(/(?!::)/))},ne={relevance:0,begin:/\(/,end:/\)/,keywords:F,contains:[ce,u,ee,e.C_BLOCK_COMMENT_MODE,w,L,$]},me={relevance:0,match:[/\b/,a.concat("(?!fn\\b|function\\b|",z(U).join("\\b|"),"|",z(x).join("\\b|"),"\\b)"),c,a.concat(N,"*"),a.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[ne]};ne.contains.push(me);const pe=[ce,ee,e.C_BLOCK_COMMENT_MODE,w,L,$],be={begin:a.concat(/#\[\s*\\?/,a.either(s,d)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:D,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:D,keyword:["new","array"]},contains:["self",...pe]},...pe,{scope:"meta",variants:[{match:s},{match:d}]}]};return{case_insensitive:!1,keywords:F,contains:[be,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},_,{scope:"variable.language",match:/\$this\b/},u,me,ee,{match:[/const/,/\s/,c],scope:{1:"keyword",3:"variable.constant"}},$,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:F,contains:["self",be,u,ee,e.C_BLOCK_COMMENT_MODE,w,L]}]},{scope:"class",variants:[{beginKeywords:"enum",illegLine truncated
]*;`,relevance:0},{begin:"[vp][0-9]+"}]}}return Ps=t,Ps}var Fs,T0;function Xb(){if(T0)return Fs;T0=1;function t(e){const a="[a-z][a-zA-Z0-9_]*",o={className:"string",begin:"\\$.{1}"},c={className:"symbol",begin:"#"+e.UNDERSCORE_IDENT_RE};return{name:"Smalltalk",aliases:["st"],keywords:["self","super","nil","true","false","thisContext"],contains:[e.COMMENT('"','"'),e.APOS_STRING_MODE,{className:"type",begin:"\\b[A-Z][A-Za-z0-9_]*",relevance:0},{begin:a+":",relevance:0},e.C_NUMBER_MODE,c,o,{begin:"\\|[ ]*"+a+"([ ]+"+a+")*[ ]*\\|",returnBegin:!0,end:/\|/,illegal:/\S/,contains:[{begin:"(\\|[ ]*)?"+a}]},{begin:"#\\(",end:"\\)",contains:[e.APOS_STRING_MODE,o,e.C_NUMBER_MODE,c]}]}}return Fs=t,Fs}var Bs,C0;function Zb(){if(C0)return Bs;C0=1;function t(e){return{name:"SML (Standard ML)",aliases:["ml"],keywords:{$pattern:"[a-z_]\\w*!?",keyword:"abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while",built_in:"array bool char exn int list option order real ref string substring vector unit word",literal:"true false NONE SOME LESS EQUAL GREATER nil"},illegal:/\/\/|>>/,contains:[{className:"literal",begin:/\[(\|\|)?\]|\(\)/,relevance:0},e.COMMENT("\\(\\*","\\*\\)",{contains:["self"]}),{className:"symbol",begin:"'[A-Za-z_](?!')[\\w']*"},{className:"type",begin:"`[A-Z][\\w']*"},{className:"type",begin:"\\b[A-Z][\\w']*",relevance:0},{begin:"[a-z_]\\w*'[\\w']*"},e.inherit(e.APOS_STRING_MODE,{className:"string",relevance:0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"number",begin:"\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",relevance:0},{begin:/[-=]>/}]}}return Bs=t,Bs}var Us,R0;function Jb(){if(R0)return Us;R0=1;function t(e){const a={className:"variable",begin:/\b_+[a-zA-Z]\w*/},o={className:"title",begin:/[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/},c={className:"string",variants:[{begin:'"',end:'"',contains:[{begin:'""',relevance:0}]},{begin:"'",end:"'",contains:[{begin:"''",relevance:0}]}]},s=["break","breakWith","breakOut","breakTo","case","catch","continue","continueWith","default","do","else","exit","exitWith","for","forEach","from","if","local","private","switch","step","then","throw","to","try","waitUntil","while","with"],d=["blufor","civilian","configNull","controlNull","displayNull","diaryRecordNull","east","endl","false","grpNull","independent","lineBreak","locationNull","nil","objNull","opfor","pi","resistance","scriptNull","sideAmbientLife","sideEmpty","sideEnemy","sideFriendly","sideLogic","sideUnknown","taskNull","teamMemberNull","true","west"],u=["abs","accTime","acos","action","actionIDs","actionKeys","actionKeysEx","actionKeysImages","actionKeysNames","actionKeysNamesArray","actionName","actionParams","activateAddons","activatedAddons","activateKey","activeTitleEffectParams","add3DENConnection","add3DENEventHandler","add3DENLayer","addAction","addBackpack","addBackpackCargo","addBackpackCargoGlobal","addBackpackGlobal","addBinocularItem","addCamShake","addCuratorAddons","addCuratorCameraArea","addCuratorEditableObjects","addCuratorEditingArea","addCuratorPoints","addEditorObject","addEventHandler","addForce","addForceGeneratorRTD","addGoggles","addGroupIcon","addHandgunItem","addHeadgear","addItem","addItemCargo","addItemCargoGlobal","addItemPool","addItemToBackpack","addItemToUniform","addItemToVest","addLiveStats","addMagazine","addMagazineAmmoCargo","addMagazineCargo","addMagazineCargoGlobal","addMagazineGlobal","addMagazinePool","addMagazines","addMagazineTurret","addMenu","addMenuItem","addMissionEventHandler","addMPEventHandler","addMusicEventHandler","addonFiles","addOwnedMine","addPlayerScores","addPrimaryWeaponItem","addPublicVariableEventHandler","addRating","addResources","addScore","addScoreSide","addSecondaryWeaponItem","addSwitchableUnit","addTeamMember","addToRemainsCollector","addTorque","addUniform","addUserActionEventHandler","addVehicle","addVest","addWaypoint","addWeapon","addWeaponCargo","addWeaponCargoGlobal","addWeaponGlobal","addWeaponItem","addWeaponPool","addWeaponTurret","addWeaponWithAttachmentsCargo","addWeaponWithAttachmentsCargoGlobal","admin","agent","agents","AGLToASL","aimedAtTarget","aimPos","airDensityCurveRTD","airDensityRTD","airplaneThrottle","airportSide","AISFinishHeal","alive","all3DENEntities","allActiveTitleEffects","allAddonsInfo","allAirports","allControls","allCurators","allCutLayers","allDead","allDeadMen","allDiaryRecords","allDiarySubjects","allDisplays","allEnv3DSoundSources","allGroups","allLODs","allMapMarkers","allMines","allMissionObjects","allObjects","allow3DMode","allowCrewInImmobile","allowCuratorLogicIgnoreAreas","allowDamage","allowDammage","allowedService","allowFileOperations","allowFleeing","allowGetIn","allowService","allowSprint","allPlayers","allSimpleObjects","allSitesLine truncated
]*?"'`},{begin:`"[^\r
"]*"`}]},{className:"built_in",variants:[{begin:"\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()"}]},e.COMMENT("^[ ]*\\*.*$",!1),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}}return qs=t,qs}var zs,A0;function nh(){if(A0)return zs;A0=1;function t(e){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.COMMENT("/\\*\\*!","\\*/"),e.C_NUMBER_MODE,e.inherit(e.APOS_STRING_MODE,{illegal:null}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}return zs=t,zs}var Hs,v0;function rh(){if(v0)return Hs;v0=1;const t=p=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:p.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:p.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],a=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],o=[...e,...a],c=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),s=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-wLine truncated
(multipart)?`,end:`\\]
`},{className:"string",begin:"\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"},{className:"string",begin:"(\\+|-)\\d+"},{className:"keyword",relevance:10,variants:[{begin:"^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?"},{begin:"^progress(:?)(\\s+)?(pop|push)?"},{begin:"^tags:"},{begin:"^time:"}]}]}}return Vs=t,Vs}var Ws,D0;function ih(){if(D0)return Ws;D0=1;function t(V){return V?typeof V=="string"?V:V.source:null}function e(V){return a("(?=",V,")")}function a(...V){return V.map(ce=>t(ce)).join("")}function o(V){const ee=V[V.length-1];return typeof ee=="object"&&ee.constructor===Object?(V.splice(V.length-1,1),ee):{}}function c(...V){return"("+(o(V).capture?"":"?:")+V.map(ne=>t(ne)).join("|")+")"}const s=V=>a(/\b/,V,/\w$/.test(V)?/\b/:/\B/),d=["Protocol","Type"].map(s),u=["init","self"].map(s),_=["Any","Self"],p=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],S=["false","nil","true"],h=["assignment","associativity","higherThan","left","lowerThan","none","right"],y=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],O=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],N=c(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),w=c(N,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),L=a(N,w,"*"),D=c(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),U=c(D,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),x=a(D,U,"*"),G=a(/[A-Z]/,U,"*"),F=["attached","autoclosure",a(/convention\(/,c("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",a(/objc\(/,x,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],z=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function $(V){const ee={match:/\s+/,relevance:0},ce=V.COMMENT("/\\*","\\*/",{contains:["self"]}),ne=[V.C_LINE_COMMENT_MODE,ce],me={match:[/\./,c(...d,...u)],className:{2:"keyword"}},pe={match:a(/\./,c(...p)),relevance:0},be=p.filter(ke=>typeof ke=="string").concat(["_|0"]),fe=p.filter(ke=>typeof ke!="string").concat(_).map(s),W={variants:[{className:"keyword",match:c(...fe,...u)}]},te={$pattern:c(/\b\w+/,/#\w+/),keyword:be.concat(y),literal:S},ue=[me,pe,W],he={match:a(/\./,c(...O)),relevance:0},Ae={className:"built_in",match:a(/\b/,c(...O),/(?=\()/)},re=[he,Ae],Xe={match:/->/,relevance:0},st={className:"operatLine truncated
`," "],Bh=["{","}","|","\\","^","`"].concat(Fh),Uh=["'"].concat(Bh),tm=["%","/","?",";","#"].concat(Uh),nm=["/","?","#"],Gh=255,rm=/^[+a-z0-9A-Z_-]{0,63}$/,Yh=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,am={javascript:!0,"javascript:":!0},im={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function wl(t,e){if(t&&t instanceof Br)return t;const a=new Br;return a.parse(t,e),a}Br.prototype.parse=function(t,e){let a,o,c,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const p=Ph.exec(s);if(p)return this.pathname=p[1],p[2]&&(this.search=p[2]),this}let d=Lh.exec(s);if(d&&(d=d[0],a=d.toLowerCase(),this.protocol=d,s=s.substr(d.length)),(e||d||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(c=s.substr(0,2)==="//",c&&!(d&&am[d])&&(s=s.substr(2),this.slashes=!0)),!am[d]&&(c||d&&!im[d])){let p=-1;for(let N=0;N<nm.length;N++)o=s.indexOf(nm[N]),o!==-1&&(p===-1||o<p)&&(p=o);let S,h;p===-1?h=s.lastIndexOf("@"):h=s.lastIndexOf("@",p),h!==-1&&(S=s.slice(0,h),s=s.slice(h+1),this.auth=S),p=-1;for(let N=0;N<tm.length;N++)o=s.indexOf(tm[N]),o!==-1&&(p===-1||o<p)&&(p=o);p===-1&&(p=s.length),s[p-1]===":"&&p--;const y=s.slice(0,p);s=s.slice(p),this.parseHost(y),this.hostname=this.hostname||"";const O=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!O){const N=this.hostname.split(/\./);for(let w=0,L=N.length;w<L;w++){const D=N[w];if(D&&!D.match(rm)){let U="";for(let x=0,G=D.length;x<G;x++)D.charCodeAt(x)>127?U+="x":U+=D[x];if(!U.match(rm)){const x=N.slice(0,w),G=N.slice(w+1),F=D.match(Yh);F&&(x.push(F[1]),G.unshift(F[2])),G.length&&(s=G.join(".")+s),this.hostname=x.join(".");break}}}}this.hostname.length>Gh&&(this.hostname=""),O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const u=s.indexOf("#");u!==-1&&(this.hash=s.substr(u),s=s.slice(0,u));const _=s.indexOf("?");return _!==-1&&(this.search=s.substr(_),s=s.slice(0,_)),s&&(this.pathname=s),im[a]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Br.prototype.parseHost=function(t){let e=kh.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const qh=Object.freeze(Object.defineProperty({__proto__:null,decode:Vn,encode:_r,format:Ml,parse:wl},Symbol.toStringTag,{value:"Module"})),Ym=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,qm=/[\0-\x1F\x7F-\x9F]/,zh=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Ll=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,zm=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFALine truncated
`};rn.fence=function(t,e,a,o,c){const s=t[e],d=s.info?Wn(s.info).trim():"";let u="",_="";if(d){const S=d.split(/(\s+)/g);u=S[0],_=S.slice(2).join("")}let p;if(a.highlight?p=a.highlight(s.content,u,_)||On(s.content):p=On(s.content),p.indexOf("<pre")===0)return p+`
`;if(d){const S=s.attrIndex("class"),h=s.attrs?s.attrs.slice():[];S<0?h.push(["class",a.langPrefix+u]):(h[S]=h[S].slice(),h[S][1]+=" "+a.langPrefix+u);const y={attrs:h};return`<pre><code${c.renderAttrs(y)}>${p}</code></pre>
`}return`<pre><code${c.renderAttrs(s)}>${p}</code></pre>
`};rn.image=function(t,e,a,o,c){const s=t[e];return s.attrs[s.attrIndex("alt")][1]=c.renderInlineAsText(s.children,a,o),c.renderToken(t,e,a)};rn.hardbreak=function(t,e,a){return a.xhtmlOut?`<br />
`:`<br>
`};rn.softbreak=function(t,e,a){return a.breaks?a.xhtmlOut?`<br />
`:`<br>
`:`
`};rn.text=function(t,e){return On(t[e].content)};rn.html_block=function(t,e){return t[e].content};rn.html_inline=function(t,e){return t[e].content};function $n(){this.rules=qr({},rn)}$n.prototype.renderAttrs=function(e){let a,o,c;if(!e.attrs)return"";for(c="",a=0,o=e.attrs.length;a<o;a++)c+=" "+On(e.attrs[a][0])+'="'+On(e.attrs[a][1])+'"';return c};$n.prototype.renderToken=function(e,a,o){const c=e[a];let s="";if(c.hidden)return"";c.block&&c.nesting!==-1&&a&&e[a-1].hidden&&(s+=`
`),s+=(c.nesting===-1?"</":"<")+c.tag,s+=this.renderAttrs(c),c.nesting===0&&o.xhtmlOut&&(s+=" /");let d=!1;if(c.block&&(d=!0,c.nesting===1&&a+1<e.length)){const u=e[a+1];(u.type==="inline"||u.hidden||u.nesting===-1&&u.tag===c.tag)&&(d=!1)}return s+=d?`>
`:">",s};$n.prototype.renderInline=function(t,e,a){let o="";const c=this.rules;for(let s=0,d=t.length;s<d;s++){const u=t[s].type;typeof c[u]<"u"?o+=c[u](t,s,e,a,this):o+=this.renderToken(t,s,e)}return o};$n.prototype.renderInlineAsText=function(t,e,a){let o="";for(let c=0,s=t.length;c<s;c++)switch(t[c].type){case"text":o+=t[c].content;break;case"image":o+=this.renderInlineAsText(t[c].children,e,a);break;case"html_inline":case"html_block":o+=t[c].content;break;case"softbreak":case"hardbreak":o+=`
`;break}return o};$n.prototype.render=function(t,e,a){let o="";const c=this.rules;for(let s=0,d=t.length;s<d;s++){const u=t[s].type;u==="inline"?o+=this.renderInline(t[s].children,e,a):typeof c[u]<"u"?o+=c[u](t,s,e,a,this):o+=this.renderToken(t,s,e,a)}return o};function Ot(){this.__rules__=[],this.__cache__=null}Ot.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};Ot.prototype.__compile__=function(){const t=this,e=[""];t.__rules__.forEach(function(a){a.enabled&&a.alt.forEach(function(o){e.indexOf(o)<0&&e.push(o)})}),t.__cache__={},e.forEach(function(a){t.__cache__[a]=[],t.__rules__.forEach(function(o){o.enabled&&(a&&o.alt.indexOf(a)<0||t.__cache__[a].push(o.fn))})})};Ot.prototype.at=function(t,e,a){const o=this.__find__(t),c=a||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__[o].fn=e,this.__rules__[o].alt=c.alt||[],this.__cache__=null};Ot.prototype.before=function(t,e,a,o){const c=this.__find__(t),s=o||{};if(c===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(c,0,{name:e,enabled:!0,fn:a,alt:s.alt||[]}),this.__cache__=null};Ot.prototype.after=function(t,e,a,o){const c=this.__find__(t),s=o||{};if(c===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(c+1,0,{name:e,enabled:!0,fn:a,alt:s.alt||[]}),this.__cache__=null};Ot.prototype.push=function(t,e,a){const o=a||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:o.alt||[]}),this.__cache__=null};Ot.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const a=[];return t.forEach(function(o){const c=this.__find__(o);if(c<0){if(e)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[c].enabled=!0,a.push(o)},this),this.__cache__=null,a};Ot.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(a){a.enabled=!1}),this.enable(t,e)};Ot.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const a=[];return t.forEach(function(o){const c=this.__find__(o);if(c<0){if(e)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[c].enabled=!1,a.push(o)},this),this.__cache__=null,a};Ot.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function zt(t,e,a){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=a,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}zt.prototype.attrIndex=function(e){if(!this.attrs)return-1;const a=this.attrs;for(let o=0,c=a.length;o<c;o++)if(a[o][0]===e)return o;return-1};zt.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};zt.prototype.attrSet=function(e,a){const o=this.attrIndex(e),c=[e,a];o<0?this.attrPush(c):this.attrs[o]=c};zt.prototype.attrGet=function(e){const a=this.attrIndex(e);let o=null;return a>=0&&(o=this.attrs[a][1]),o};zt.prototype.attrJoin=function(e,a){const o=this.attrIndex(e);o<0?this.attrPush([e,a]):this.attrs[o][1]=this.attrs[o][1]+" "+a};function Qm(t,e,a){this.src=t,this.env=a,this.tokens=[],this.inlineMode=!1,this.md=e}Qm.prototype.Token=zt;const R1=/\r\n?|\n/g,N1=/\0/g;function y1(t){let e;e=t.src.replace(R1,`
`),e=e.replace(N1,"�"),t.src=e}function O1(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function A1(t){const e=t.tokens;for(let a=0,o=e.length;a<o;a++){const c=e[a];c.type==="inline"&&t.md.inline.parse(c.content,t.md,t.env,c.children)}}function v1(t){return/^<a[>\s]/i.test(t)}function I1(t){return/^<\/a\s*>/i.test(t)}function D1(t){const e=t.tokens;if(t.md.options.linkify)for(let a=0,o=e.length;a<o;a++){if(e[a].type!=="inline"||!t.md.linkify.pretest(e[a].content))continue;let c=e[a].children,s=0;for(let d=c.length-1;d>=0;d--){const u=c[d];if(u.type==="link_close"){for(d--;c[d].level!==u.level&&c[d].type!=="link_open";)d--;continue}if(u.type==="html_inline"&&(v1(u.content)&&s>0&&s--,I1(u.content)&&s++),!(s>0)&&u.type==="text"&&t.md.linkify.test(u.content)){const _=u.content;let p=t.md.linkify.match(_);const S=[];let h=u.level,y=0;p.length>0&&p[0].index===0&&d>0&&c[d-1].type==="text_special"&&(p=p.slice(1));for(let O=0;O<p.length;O++){const N=p[O].url,w=t.md.normalizeLink(N);if(!t.md.validateLink(w))continue;let L=p[O].text;p[O].schema?p[O].schema==="mailto:"&&!/^mailto:/i.test(L)?L=t.md.normalizeLinkText("mailto:"+L).replace(/^mailto:/,""):L=t.md.normalizeLinkText(L):L=t.md.normalizeLinkText("http://"+L).replace(/^http:\/\//,"");const D=p[O].index;if(D>y){const F=new t.Token("text","",0);F.content=_.slice(y,D),F.level=h,S.push(F)}const U=new t.Token("link_open","a",1);U.attrs=[["href",w]],U.level=h++,U.markup="linkify",U.info="auto",S.push(U);const x=new t.Token("text","",0);x.content=L,x.level=h,S.push(x);const G=new t.Token("link_close","a",-1);G.level=--h,G.markup="linkify",G.info="auto",S.push(G),y=p[O].lastIndex}if(y<_.length){const O=new t.Token("text","",0);O.content=_.slice(y),O.level=h,S.push(O)}e[a].children=c=$m(c,d,S)}}}}const Xm=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,x1=/\((c|tm|r)\)/i,M1=/\((c|tm|r)\)/ig,w1={c:"©",r:"®",tm:"™"};function L1(t,e){return w1[e.toLowerCase()]}function k1(t){let e=0;for(let a=t.length-1;a>=0;a--){const o=t[a];o.type==="text"&&!e&&(o.content=o.content.replace(M1,L1)),o.type==="link_open"&&o.info==="auto"&&e--,o.type==="link_close"&&o.info==="auto"&&e++}}function P1(t){let e=0;for(let a=t.length-1;a>=0;a--){const o=t[a];o.type==="text"&&!e&&Xm.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),o.type==="link_open"&&o.info==="auto"&&e--,o.type==="link_close"&&o.info==="auto"&&e++}}function F1(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(x1.test(t.tokens[e].content)&&k1(t.tokens[e].children),Xm.test(t.tokens[e].content)&&P1(t.tokens[e].children))}const B1=/['"]/,om=/['"]/g,sm="’";function Lr(t,e,a){return t.slice(0,e)+a+t.slice(e+1)}function U1(t,e){let a;const o=[];for(let c=0;c<t.length;c++){const s=t[c],d=t[c].level;for(a=o.length-1;a>=0&&!(o[a].level<=d);a--);if(o.length=a+1,s.type!=="text")continue;let u=s.content,_=0,p=u.length;e:for(;_<p;){om.lastIndex=_;const S=om.exec(u);if(!S)break;let h=!0,y=!0;_=S.index+1;const O=S[0]==="'";let N=32;if(S.index-1>=0)N=u.charCodeAt(S.index-1);else for(a=c-1;a>=0&&!(t[a].type==="softbreak"||t[a].type==="hardbreak");a--)if(t[a].content){N=t[a].content.charCodeAt(t[a].content.length-1);break}let w=32;if(_<p)w=u.charCodeAt(_);else for(a=c+1;a<t.length&&!(t[a].type==="softbreak"||t[a].type==="hardbreak");a++)if(t[a].content){w=t[a].content.charCodeAt(0);break}const L=ur(N)||cr(String.fromCharCode(N)),D=ur(w)||cr(String.fromCharCode(w)),U=lr(N),x=lr(w);if(x?h=!1:D&&(U||L||(h=!1)),U?y=!1:L&&(x||D||(y=!1)),w===34&&S[0]==='"'&&N>=48&&N<=57&&(y=h=!1),h&&y&&(h=L,y=D),!h&&!y){O&&(s.content=Lr(s.content,S.index,sm));continue}if(y)for(a=o.length-1;a>=0;a--){let G=o[a];if(o[a].level<d)break;if(G.single===O&&o[a].level===d){G=o[a];let F,z;O?(F=e.md.options.quotes[2],z=e.md.options.quotes[3]):(F=e.md.options.quotes[0],z=e.md.options.quotes[1]),s.content=Lr(s.content,S.index,z),t[G.token].content=Lr(t[G.token].content,G.pos,F),_+=z.length-1,G.token===c&&(_+=F.length-1),u=s.content,p=u.length,o.length=a;continue e}}h?o.push({token:c,pos:S.index,single:O,level:d}):y&&O&&(s.content=Lr(s.content,S.index,sm))}}}function G1(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!B1.test(t.tokens[e].content)||U1(t.tokens[e].children,t)}function Y1(t){let e,a;const o=t.tokens,c=o.length;for(let s=0;s<c;s++){if(o[s].type!=="inline")continue;const d=o[s].children,u=d.length;for(e=0;e<u;e++)d[e].type==="text_special"&&(d[e].type="text");for(e=a=0;e<u;e++)d[e].type==="text"&&e+1<u&&d[e+1].type==="text"?d[e+1].content=d[e].content+d[e+1].content:(e!==a&&(d[a]=d[e]),a++);e!==a&&(d.length=a)}}const gl=[["normalize",Line truncated
`,s.map=[e,t.line],!0}function V1(t,e,a,o){let c=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||c+3>s)return!1;const d=t.src.charCodeAt(c);if(d!==126&&d!==96)return!1;let u=c;c=t.skipChars(c,d);let _=c-u;if(_<3)return!1;const p=t.src.slice(u,c),S=t.src.slice(c,s);if(d===96&&S.indexOf(String.fromCharCode(d))>=0)return!1;if(o)return!0;let h=e,y=!1;for(;h++,!(h>=a||(c=u=t.bMarks[h]+t.tShift[h],s=t.eMarks[h],c<s&&t.sCount[h]<t.blkIndent));)if(t.src.charCodeAt(c)===d&&!(t.sCount[h]-t.blkIndent>=4)&&(c=t.skipChars(c,d),!(c-u<_)&&(c=t.skipSpaces(c),!(c<s)))){y=!0;break}_=t.sCount[e],t.line=h+(y?1:0);const O=t.push("fence","code",0);return O.info=S,O.content=t.getLines(e+1,h,_,!0),O.markup=p,O.map=[e,t.line],!0}function W1(t,e,a,o){let c=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];const d=t.lineMax;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(c)!==62)return!1;if(o)return!0;const u=[],_=[],p=[],S=[],h=t.md.block.ruler.getRules("blockquote"),y=t.parentType;t.parentType="blockquote";let O=!1,N;for(N=e;N<a;N++){const x=t.sCount[N]<t.blkIndent;if(c=t.bMarks[N]+t.tShift[N],s=t.eMarks[N],c>=s)break;if(t.src.charCodeAt(c++)===62&&!x){let F=t.sCount[N]+1,z,$;t.src.charCodeAt(c)===32?(c++,F++,$=!1,z=!0):t.src.charCodeAt(c)===9?(z=!0,(t.bsCount[N]+F)%4===3?(c++,F++,$=!1):$=!0):z=!1;let V=F;for(u.push(t.bMarks[N]),t.bMarks[N]=c;c<s;){const ee=t.src.charCodeAt(c);if(He(ee))ee===9?V+=4-(V+t.bsCount[N]+($?1:0))%4:V++;else break;c++}O=c>=s,_.push(t.bsCount[N]),t.bsCount[N]=t.sCount[N]+1+(z?1:0),p.push(t.sCount[N]),t.sCount[N]=V-F,S.push(t.tShift[N]),t.tShift[N]=c-t.bMarks[N];continue}if(O)break;let G=!1;for(let F=0,z=h.length;F<z;F++)if(h[F](t,N,a,!0)){G=!0;break}if(G){t.lineMax=N,t.blkIndent!==0&&(u.push(t.bMarks[N]),_.push(t.bsCount[N]),S.push(t.tShift[N]),p.push(t.sCount[N]),t.sCount[N]-=t.blkIndent);break}u.push(t.bMarks[N]),_.push(t.bsCount[N]),S.push(t.tShift[N]),p.push(t.sCount[N]),t.sCount[N]=-1}const w=t.blkIndent;t.blkIndent=0;const L=t.push("blockquote_open","blockquote",1);L.markup=">";const D=[e,0];L.map=D,t.md.block.tokenize(t,e,N);const U=t.push("blockquote_close","blockquote",-1);U.markup=">",t.lineMax=d,t.parentType=y,D[1]=t.line;for(let x=0;x<S.length;x++)t.bMarks[x+e]=u[x],t.tShift[x+e]=S[x],t.sCount[x+e]=p[x],t.bsCount[x+e]=_[x];return t.blkIndent=w,!0}function $1(t,e,a,o){const c=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.bMarks[e]+t.tShift[e];const d=t.src.charCodeAt(s++);if(d!==42&&d!==45&&d!==95)return!1;let u=1;for(;s<c;){const p=t.src.charCodeAt(s++);if(p!==d&&!He(p))return!1;p===d&&u++}if(u<3)return!1;if(o)return!0;t.line=e+1;const _=t.push("hr","hr",0);return _.map=[e,t.line],_.markup=Array(u+1).join(String.fromCharCode(d)),!0}function cm(t,e){const a=t.eMarks[e];let o=t.bMarks[e]+t.tShift[e];const c=t.src.charCodeAt(o++);if(c!==42&&c!==45&&c!==43)return-1;if(o<a){const s=t.src.charCodeAt(o);if(!He(s))return-1}return o}function um(t,e){const a=t.bMarks[e]+t.tShift[e],o=t.eMarks[e];let c=a;if(c+1>=o)return-1;let s=t.src.charCodeAt(c++);if(s<48||s>57)return-1;for(;;){if(c>=o)return-1;if(s=t.src.charCodeAt(c++),s>=48&&s<=57){if(c-a>=10)return-1;continue}if(s===41||s===46)break;return-1}return c<o&&(s=t.src.charCodeAt(c),!He(s))?-1:c}function K1(t,e){const a=t.level+2;for(let o=e+2,c=t.tokens.length-2;o<c;o++)t.tokens[o].level===a&&t.tokens[o].type==="paragraph_open"&&(t.tokens[o+2].hidden=!0,t.tokens[o].hidden=!0,o+=2)}function Q1(t,e,a,o){let c,s,d,u,_=e,p=!0;if(t.sCount[_]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[_]-t.listIndent>=4&&t.sCount[_]<t.blkIndent)return!1;let S=!1;o&&t.parentType==="paragraph"&&t.sCount[_]>=t.blkIndent&&(S=!0);let h,y,O;if((O=um(t,_))>=0){if(h=!0,d=t.bMarks[_]+t.tShift[_],y=Number(t.src.slice(d,O-1)),S&&y!==1)return!1}else if((O=cm(t,_))>=0)h=!1;else return!1;if(S&&t.skipSpaces(O)>=t.eMarks[_])return!1;if(o)return!0;const N=t.src.charCodeAt(O-1),w=t.tokens.length;h?(u=t.push("ordered_list_open","ol",1),y!==1&&(u.attrs=[["start",y]])):u=t.push("bullet_list_open","ul",1);const L=[_,0];u.map=L,u.markup=String.fromCharCode(N);let D=!1;const U=t.md.block.ruler.getRules("list"),x=t.parentType;for(t.parentType="list";_<a;){s=O,c=t.eMarks[_];const G=t.sCount[_]+O-(t.bMarks[_]+t.tShift[_]);let F=G;for(;s<c;){const fe=t.src.charCodeAt(s);if(fe===9)F+=4-(F+t.bsCount[_])%4;else if(fe===32)F++;else break;s++}const z=s;let $;z>=c?$=1:$=F-G,$>4&&($=1);const V=G+$;u=t.push("list_item_open","li",1),u.markup=String.fromCharCode(N);const ee=[_,0];u.map=ee,h&&(u.info=t.src.slice(d,O-1));const ce=t.tight,ne=t.tShift[_],me=t.sCount[_],pe=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=V,t.tight=!0,t.tShift[_]=z-t.bMarks[_],t.sCount[_]=F,z>=c&&t.isEmpty(_+1)?t.line=Math.min(t.line+2,a):t.md.block.tokenize(t,_,a,!0),(!t.tight||D)&&(p=!1),D=t.line-_>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=pe,t.tShift[_]=ne,t.sCount[_]=me,t.tight=ce,u=t.push("list_item_close","li",-1),u.markup=String.fromCharCode(N),_=t.line,ee[1]=_,_>=a||t.sCount[_]<t.blkInLine truncated
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l`+r/2.075+" -"+r+`
c5.3,-9.3,12,-14,20,-14
H400000v`+(40+r)+`H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M`+(834+r)+" "+n+"h400000v"+(40+r)+"h-400000z"},Ie=function(r,n){return"M263,"+(601+r+n)+`c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l`+r/2.084+" -"+r+`
c4.7,-7.3,11,-11,19,-11
H40000v`+(40+r)+`H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M`+(1001+r)+" "+n+"h400000v"+(40+r)+"h-400000z"},Be=function(r,n){return"M983 "+(10+r+n)+`
l`+r/3.13+" -"+r+`
c4,-6.7,10,-10,18,-10 H400000v`+(40+r)+`
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M`+(1001+r)+" "+n+"h400000v"+(40+r)+"h-400000z"},je=function(r,n){return"M424,"+(2398+r+n)+`
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l`+r/4.223+" -"+r+`c4,-6.7,10,-10,18,-10 H400000
v`+(40+r)+`H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M`+(1001+r)+" "+n+`
h400000v`+(40+r)+"h-400000z"},et=function(r,n){return"M473,"+(2713+r+n)+`
c339.3,-1799.3,509.3,-2700,510,-2702 l`+r/5.298+" -"+r+`
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+r)+`H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM`+(1001+r)+" "+n+"h400000v"+(40+r)+"H1017.7z"},ut=function(r){const n=r/2;return"M400000 "+r+" H0 L"+n+" 0 l65 45 L145 "+(r-80)+" H400000z"},mt=function(r,n,i){const l=i-54-n-r;return"M702 "+(r+n)+"H400000"+(40+r)+`
H742v`+l+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 `+n+"H400000v"+(40+r)+"H742z"},En=function(r,n,i){n=1e3*n;let l="";switch(r){case"sqrtMain":l=we(n,Fe);break;case"sqrtSize1":l=Ie(n,Fe);break;case"sqrtSize2":l=Be(n,Fe);break;case"sqrtSize3":l=je(n,Fe);break;case"sqrtSize4":l=et(n,Fe);break;case"sqrtTall":l=mt(n,Fe,i)}return l},ht=function(r,n){switch(r){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},on={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},sn=function(r,n){switch(r){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class de{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return D.contains(this.classes,n)}toNode(){const n=document.createDocumentFragment();for(let i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n}toMarkup(){let n="";for(let i=0;i<this.children.length;i++)n+=this.children[i].toMarkup();return n}toText(){const n=i=>i.toText();return this.children.map(n).join("")}}var gt={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222Line truncated
`+oe+" children.");for(let Ce=0;Ce<oe;Ce++){const Oe=new cn(B[Ce]),Le=new Wt([Oe],{width:"400em",height:J(Q),viewBox:"0 0 "+b+" "+H,preserveAspectRatio:Re[Ce]+" slice"}),qe=q.makeSvgSpan([le[Ce]],[Le],n);if(oe===1)return{span:qe,minWidth:Y,height:Q};qe.style.height=J(Q),A.push(qe)}return{span:q.makeSpan(["stretchy"],A,n),minWidth:Y,height:Q}}}const{span:l,minWidth:m,height:E}=i();return l.height=E,l.style.height=J(E),m>0&&(l.style.minWidth=J(m)),l}};function Te(r,n){if(!r||r.type!==n)throw new Error("Expected node of type "+n+", but got "+(r?"node of type "+r.type:String(r)));return r}function ua(r){const n=Nr(r);if(!n)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return n}function Nr(r){return r&&(r.type==="atom"||$l.hasOwnProperty(r.type))?r:null}const da=(r,n)=>{let i,l,m;r&&r.type==="supsub"?(l=Te(r.base,"accent"),i=l.base,r.base=i,m=Vl(De(r,n)),r.base=l):(l=Te(r,"accent"),i=l.base);const E=De(i,n.havingCrampedStyle()),b=l.isShifty&&D.isCharacterBox(i);let C=0;if(b){const H=D.getBaseElem(i),Q=De(H,n.havingCrampedStyle());C=Wr(Q).skew}const A=l.label==="\\c";let M=A?E.height+E.depth:Math.min(E.height,n.fontMetrics().xHeight),B;if(l.isStretchy)B=dn.svgSpan(l,n),B=q.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:E},{type:"elem",elem:B,wrapperClasses:["svg-align"],wrapperStyle:C>0?{width:"calc(100% - "+J(2*C)+")",marginLeft:J(2*C)}:void 0}]},n);else{let H,Q;l.label==="\\vec"?(H=q.staticSvg("vec",n),Q=q.svgData.vec[1]):(H=q.makeOrd({mode:l.mode,text:l.label},n,"textord"),H=Wr(H),H.italic=0,Q=H.width,A&&(M+=H.depth)),B=q.makeSpan(["accent-body"],[H]);const oe=l.label==="\\textcircled";oe&&(B.classes.push("accent-full"),M=E.height);let le=C;oe||(le-=Q/2),B.style.left=J(le),l.label==="\\textcircled"&&(B.style.top=".2em"),B=q.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:E},{type:"kern",size:-M},{type:"elem",elem:B}]},n)}const Y=q.makeSpan(["mord","accent"],[B],n);return m?(m.children[0]=Y,m.height=Math.max(Y.height,m.height),m.classes[0]="mord",m):Y},cc=(r,n)=>{const i=r.isStretchy?dn.mathMLnode(r.label):new Z.MathNode("mo",[wt(r.label,r.mode)]),l=new Z.MathNode("mover",[Ue(r.base,n),i]);return l.setAttribute("accent","true"),l},Np=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));ae({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,n)=>{const i=tr(n[0]),l=!Np.test(r.funcName),m=!l||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:l,isShifty:m,base:i}},htmlBuilder:da,mathmlBuilder:cc}),ae({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,n)=>{const i=n[0];let l=r.parser.mode;return l==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),l="text"),{type:"accent",mode:l,label:r.funcName,isStretchy:!1,isShifty:!0,base:i}},htmlBuilder:da,mathmlBuilder:cc}),ae({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,n)=>{let{parser:i,funcName:l}=r;const m=n[0];return{type:"accentUnder",mode:i.mode,label:l,base:m}},htmlBuilder:(r,n)=>{const i=De(r.base,n),l=dn.svgSpan(r,n),m=r.label==="\\utilde"?.12:0,E=q.makeVList({positionType:"top",positionData:i.height,children:[{type:"elem",elem:l,wrapperClasses:["svg-align"]},{type:"kern",size:m},{type:"elem",elem:i}]},n);return q.makeSpan(["mord","accentunder"],[E],n)},mathmlBuilder:(r,n)=>{const i=dn.mathMLnode(r.label),l=new Z.MathNode("munder",[Ue(r.base,n),i]);return l.setAttribute("accentunder","true"),l}});const yr=r=>{const n=new Z.MathNode("mpadded",r?[r]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};ae({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,n,i){let{parser:l,funcName:m}=r;return{type:"xArrow",mode:l.mode,label:m,body:n[0],bLine truncated
]`,$p="\\\\[a-zA-Z@]+",Kp="\\\\[^\uD800-\uDFFF]",Qp="("+$p+")"+jc+"*",Xp=`\\\\(
|[ \r ]+
?)[ \r ]*`,Ia="[̀-ͯ]",Zp=new RegExp(Ia+"+$"),Jp="("+jc+"+)|"+(Xp+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Ia+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Ia+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Qp)+("|"+Kp+")");class eu{constructor(n,i){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=i,this.tokenRegex=new RegExp(Jp,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,i){this.catcodes[n]=i}lex(){const n=this.input,i=this.tokenRegex.lastIndex;if(i===n.length)return new Lt("EOF",new It(this,i,i));const l=this.tokenRegex.exec(n);if(l===null||l.index!==i)throw new s("Unexpected character: '"+n[i]+"'",new Lt(n[i],new It(this,i,i+1)));const m=l[6]||l[3]||(l[2]?"\\ ":" ");if(this.catcodes[m]===14){const E=n.indexOf(`
`,this.tokenRegex.lastIndex);return E===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=E+1,this.lex()}return new Lt(m,new It(this,i,this.tokenRegex.lastIndex))}}class jp{constructor(n,i){n===void 0&&(n={}),i===void 0&&(i={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=i,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new s("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");const n=this.undefStack.pop();for(const i in n)n.hasOwnProperty(i)&&(n[i]==null?delete this.current[i]:this.current[i]=n[i])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,i,l){if(l===void 0&&(l=!1),l){for(let m=0;m<this.undefStack.length;m++)delete this.undefStack[m][n];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][n]=i)}else{const m=this.undefStack[this.undefStack.length-1];m&&!m.hasOwnProperty(n)&&(m[n]=this.current[n])}i==null?delete this.current[n]:this.current[n]=i}}var eg=Ic;R("\\noexpand",function(r){const n=r.popToken();return r.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}}),R("\\expandafter",function(r){const n=r.popToken();return r.expandOnce(!0),{tokens:[n],numArgs:0}}),R("\\@firstoftwo",function(r){return{tokens:r.consumeArgs(2)[0],numArgs:0}}),R("\\@secondoftwo",function(r){return{tokens:r.consumeArgs(2)[1],numArgs:0}}),R("\\@ifnextchar",function(r){const n=r.consumeArgs(3);r.consumeSpaces();const i=r.future();return n[0].length===1&&n[0][0].text===i.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}}),R("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),R("\\TextOrMath",function(r){const n=r.consumeArgs(2);return r.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});const tu={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};R("\\char",function(r){let n=r.popToken(),i,l="";if(n.text==="'")i=8,n=r.popToken();else if(n.text==='"')i=16,n=r.popToken();else if(n.text==="`")if(n=r.popToken(),n.text[0]==="\\")l=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new s("\\char` missing argument");l=n.text.charCodeAt(0)}else i=10;if(i){if(l=tu[n.text],l==null||l>=i)throw new s("Invalid base-"+i+" digit "+n.text);let m;for(;(m=tu[r.future().text])!=null&&m<i;)l*=i,l+=m,r.popToken()}return"\\@char{"+l+"}"});const Da=(r,n,i,l)=>{let m=r.consumeArg().tokens;if(m.length!==1)throw new s("\\newcommand's first argument must be a macro name");const E=m[0].text,b=r.isDefined(E);if(b&&!n)throw new s("\\newcommand{"+E+"} attempting to redefine "+(E+"; use \\renewcommand"));if(!b&&!i)throw new s("\\renewcommand{"+E+"} when command "+E+" does not yet exist; use \\newcommand");let C=0;if(m=r.consumeArg().tokens,m.length===1&&m[0].text==="["){let A="",M=r.expandNextToken();for(;M.text!=="]"&&M.text!=="EOF";)A+=M.text,M=r.expandNextToken();if(!A.match(/^\s*[0-9]+\s*$/))throw new s("Invalid number of arguments: "+A);C=parseInt(A),m=r.consumeArg().tokens}return b&&l||r.macros.set(E,{tokens:m,numArgs:C}),""};R("\\newcommand",r=>Da(r,!1,!0,!1)),R("\\renewcommand",r=>Da(r,!0,!1,!1)),R("\\providecommand",r=>Da(r,!0,!0,!0)),R("\\message",r=>{const n=r.consumeArgs(1)[0];return console.log(n.reverse().map(i=>i.text).join("")),""}),R("\\errmessage",r=>{const n=r.consumeArgs(1)[0];return console.error(n.reverse().map(i=>i.text).join("")),""}),R("\\show",r=>{const n=r.popToken(),i=n.text;return console.log(n,r.macros.get(i),hn[i],Ke.math[i],Ke.text[i]),""}),R("\\bgroup","{"),R("\\egroup","}"),R("~","\\nobreakspace"),R("\\lq","`"),R("\\rq","'"),R("\\aa","\\r a"),R("\\AA","\\r A"),R("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),R("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),R("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),R("ℬ","\\mathscr{B}"),R("ℰ","\\mathscr{E}"),R("ℱ","\\mathscr{F}"),R("ℋ","\\mathscr{H}"),R("ℐ","\\mathscr{I}"),R("ℒ","\\mathscr{L}"),R("ℳ","\\mathscr{M}"),R("ℛ","\\mathscr{R}"),R("ℭ","\\mathfrak{C}"),R("ℌ","\\mathfrak{H}"),R("ℨ","\\mathfrak{Z}"),R("\\Bbbk","\\Bbb{k}"),R("·","\\cdotp"),R("\\llap","\\mathllap{\\textrm{#1}}"),R("\\rlap","\\mathrlap{\\textrm{#1}}"),R("\\clap","\\mathclap{\\textrm{#1}}"),R("\\mathstrut","\\vphantom{(}"),R("\\underbar","\\underline{\\text{#1}}"),R("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),R("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),R("\\ne","\\neq"),R("≠","\\neq"),R("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),R("∉"Line truncated
please report what input caused this bug`);return E=E.slice(1,-1),{type:"verb",mode:"text",body:E,star:b}}su.hasOwnProperty(i[0])&&!Ke[this.mode][i[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+i[0]+'" used in math mode',n),i=su[i[0]]+i.slice(1));const l=Zp.exec(i);l&&(i=i.substring(0,l.index),i==="i"?i="ı":i==="j"&&(i="ȷ"));let m;if(Ke[this.mode][i]){this.settings.strict&&this.mode==="math"&&Sr.indexOf(i)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+i[0]+'" used in math mode',n);const E=Ke[this.mode][i].group,b=It.range(n);let C;if(Wl.hasOwnProperty(E)){const A=E;C={type:"atom",mode:this.mode,family:A,loc:b,text:i}}else C={type:E,mode:this.mode,loc:b,text:i};m=C}else if(i.charCodeAt(0)>=128)this.settings.strict&&(Me(i.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+i[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+i[0]+'"'+(" ("+i.charCodeAt(0)+")"),n)),m={type:"textord",mode:"text",loc:It.range(n),text:i};else return null;if(this.consume(),l)for(let E=0;E<l[0].length;E++){const b=l[0][E];if(!Ma[b])throw new s("Unknown accent ' "+b+"'",n);const C=Ma[b][this.mode]||Ma[b].text;if(!C)throw new s("Accent "+b+" unsupported in "+this.mode+" mode",n);m={type:"accent",mode:this.mode,loc:It.range(n),label:C,isStretchy:!1,isShifty:!0,base:m}}return m}}xr.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var wa=function(r,n){if(!(typeof r=="string"||r instanceof String))throw new TypeError("KaTeX can only parse string typed expression");const i=new xr(r,n);delete i.gullet.macros.current["\\df@tag"];let l=i.parse();if(delete i.gullet.macros.current["\\current@color"],delete i.gullet.macros.current["\\color"],i.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new s("\\tag works only in display equations");l=[{type:"tag",mode:"text",body:l,tag:i.subparse([new Lt("\\df@tag")])}]}return l};let lu=function(r,n,i){n.textContent="";const l=La(r,i).toNode();n.appendChild(l)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),lu=function(){throw new s("KaTeX doesn't work in quirks mode.")});const ng=function(r,n){return La(r,n).toMarkup()},rg=function(r,n){const i=new G(n);return wa(r,i)},cu=function(r,n,i){if(i.throwOnError||!(r instanceof s))throw r;const l=q.makeSpan(["katex-error"],[new At(n)]);return l.setAttribute("title",r.toString()),l.setAttribute("style","color:"+i.errorColor),l},La=function(r,n){const i=new G(n);try{const l=wa(r,i);return Sp(l,r,i)}catch(l){return cu(l,r,i)}};var ag={version:"0.16.21",render:lu,renderToString:ng,ParseError:s,SETTINGS_SCHEMA:U,__parse:rg,__renderToDomTree:La,__renderToHTMLTree:function(r,n){const i=new G(n);try{const l=wa(r,i);return bp(l,r,i)}catch(l){return cu(l,r,i)}},__setFontMetrics:ln,__defineSymbol:g,__defineFunction:ae,__defineMacro:R,__domTree:{Span:Yt,Anchor:Vt,SymbolNode:At,SvgNode:Wt,PathNode:cn,LineNode:fr}},ig=ag;return o=o.default,o}()})})(cp);var bC=cp.exports,Tl=bC;function fm(t,e){var a,o,c=t.posMax,s=!0,d=!0;return a=e>0?t.src.charCodeAt(e-1):-1,o=e+1<=c?t.src.charCodeAt(e+1):-1,(a===32||a===9||o>=48&&o<=57)&&(d=!1),(o===32||o===9)&&(s=!1),{can_open:s,can_close:d}}function hC(t,e){var a,o,c,s,d;if(t.src[t.pos]!=="$")return!1;if(s=fm(t,t.pos),!s.can_open)return e||(t.pending+="$"),t.pos+=1,!0;for(a=t.pos+1,o=a;(o=t.src.indexOf("$",o))!==-1;){for(d=o-1;t.src[d]==="\\";)d-=1;if((o-d)%2==1)break;o+=1}return o===-1?(e||(t.pending+="$"),t.pos=a,!0):o-a===0?(e||(t.pending+="$$"),t.pos=a+1,!0):(s=fm(t,o),s.can_close?(e||(c=t.push("math_inline","math",0),c.markup="$",c.content=t.src.slice(a,o)),t.pos=o+1,!0):(e||(t.pending+="$"),t.pos=a,!0))}function TC(t,e,a,o){var c,s,d,u,_=!1,p,S=t.bMarks[e]+t.tShift[e],h=t.eMarks[e];if(S+2>h||t.src.slice(S,S+2)!=="$$")return!1;if(S+=2,c=t.src.slice(S,h),o)return!0;for(c.trim().slice(-2)==="$$"&&(c=c.trim().slice(0,-2),_=!0),d=e;!_&&(d++,!(d>=a||(S=t.bMarks[d]+t.tShift[d],h=t.eMarks[d],S<h&&t.tShift[d]<t.blkIndent)));)t.src.slice(S,h).trim().slice(-2)==="$$"&&(u=t.src.slice(0,h).lastIndexOf("$$"),s=t.src.slice(S,u),_=!0);return t.line=d+1,p=t.push("math_block","math",0),p.block=!0,p.content=(c&&c.trim()?c+`
`:"")+t.getLines(e+1,d,t.tShift[e],!0)+(s&&s.trim()?s:""),p.map=[e,t.line],p.markup="$$",!0}function Pr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}var CC=function(e,a){a=a||{},a.katex&&(Tl=a.katex),a.blockClass||(a.blockClass="");var o=function(u){a.displayMode=!1;try{return Tl.renderToString(u,a)}catch(_){return a.throwOnError&&console.log(_),`<span class='katex-error' title='${Pr(_.toString())}'>${Pr(u)}</span>`}},c=function(u,_){return o(u[_].content)},s=function(u){a.displayMode=!0;try{return`<p class="katex-block ${a.blockClass}">`+Tl.renderToString(u,a)+"</p>"}catch(_){return a.throwOnError&&console.log(_),`<p class='katex-block katex-error ${a.blockClass}' title='${Pr(_.toString())}'>${Pr(u)}</p>`}},d=function(u,_){return s(u[_].content)+`
`};e.inline.ruler.after("escape","math_inline",hC),e.block.ruler.after("blockquote","math_block",TC,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=c,e.renderer.rules.math_block=d};const RC=Al(CC);/*!
* qrcode.vue v3.6.0
* A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3
* © 2017-PRESENT @scopewu(https://github.com/scopewu)
* MIT License.
*/var nn=function(){return nn=Object.assign||function(e){for(var a,o=1,c=arguments.length;o<c;o++){a=arguments[o];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},nn.apply(this,arguments)};var wn;(function(t){var e=function(){function d(u,_,p,S){if(this.version=u,this.errorCorrectionLevel=_,this.modules=[],this.isFunction=[],u<d.MIN_VERSION||u>d.MAX_VERSION)throw new RangeError("Version value out of range");if(S<-1||S>7)throw new RangeError("Mask value out of range");this.size=u*4+17;for(var h=[],y=0;y<this.size;y++)h.push(!1);for(var y=0;y<this.size;y++)this.modules.push(h.slice()),this.isFunction.push(h.slice());this.drawFunctionPatterns();var O=this.addEccAndInterleave(p);if(this.drawCodewords(O),S==-1)for(var N=1e9,y=0;y<8;y++){this.applyMask(y),this.drawFormatBits(y);var w=this.getPenaltyScore();w<N&&(S=y,N=w),this.applyMask(y)}c(0<=S&&S<=7),this.mask=S,this.applyMask(S),this.drawFormatBits(S),this.isFunction=[]}return d.encodeText=function(u,_){var p=t.QrSegment.makeSegments(u);return d.encodeSegments(p,_)},d.encodeBinary=function(u,_){var p=t.QrSegment.makeBytes(u);return d.encodeSegments([p],_)},d.encodeSegments=function(u,_,p,S,h,y){if(p===void 0&&(p=1),S===void 0&&(S=40),h===void 0&&(h=-1),y===void 0&&(y=!0),!(d.MIN_VERSION<=p&&p<=S&&S<=d.MAX_VERSION)||h<-1||h>7)throw new RangeError("Invalid value");var O,N;for(O=p;;O++){var w=d.getNumDataCodewords(O,_)*8,L=s.getTotalBits(u,O);if(L<=w){N=L;break}if(O>=S)throw new RangeError("Data too long")}for(var D=0,U=[d.Ecc.MEDIUM,d.Ecc.QUARTILE,d.Ecc.HIGH];D<U.length;D++){var x=U[D];y&&N<=d.getNumDataCodewords(O,x)*8&&(_=x)}for(var G=[],F=0,z=u;F<z.length;F++){var $=z[F];a($.mode.modeBits,4,G),a($.numChars,$.mode.numCharCountBits(O),G);for(var V=0,ee=$.getData();V<ee.length;V++){var ce=ee[V];G.push(ce)}}c(G.length==N);var ne=d.getNumDataCodewords(O,_)*8;c(G.length<=ne),a(0,Math.min(4,ne-G.length),G),a(0,(8-G.length%8)%8,G),c(G.length%8==0);for(var me=236;G.length<ne;me^=253)a(me,8,G);for(var pe=[];pe.length*8<G.length;)pe.push(0);return G.forEach(function(be,fe){return pe[fe>>>3]|=be<<7-(fe&7)}),new d(O,_,pe,h)},d.prototype.getModule=function(u,_){return 0<=u&&u<this.size&&0<=_&&_<this.size&&this.modules[_][u]},d.prototype.getModules=function(){return this.modules},d.prototype.drawFunctionPatterns=function(){for(var u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);for(var _=this.getAlignmentPatternPositions(),p=_.length,u=0;u<p;u++)for(var S=0;S<p;S++)u==0&&S==0||u==0&&S==p-1||u==p-1&&S==0||this.drawAlignmentPattern(_[u],_[S]);this.drawFormatBits(0),this.drawVersion()},d.prototype.drawFormatBits=function(u){for(var _=this.errorCorrectionLevel.formatBits<<3|u,p=_,S=0;S<10;S++)p=p<<1^(p>>>9)*1335;var h=(_<<10|p)^21522;c(h>>>15==0);for(var S=0;S<=5;S++)this.setFunctionModule(8,S,o(h,S));this.setFunctionModule(8,7,o(h,6)),this.setFunctionModule(8,8,o(h,7)),this.setFunctionModule(7,8,o(h,8));for(var S=9;S<15;S++)this.setFunctionModule(14-S,8,o(h,S));for(var S=0;S<8;S++)this.setFunctionModule(this.size-1-S,8,o(h,S));for(var S=8;S<15;S++)this.setFunctionModule(8,this.size-15+S,o(h,S));this.setFunctionModule(8,this.size-8,!0)},d.prototype.drawVersion=function(){if(!(this.version<7)){for(var u=this.version,_=0;_<12;_++)u=u<<1^(u>>>11)*7973;var p=this.version<<12|u;c(p>>>18==0);for(var _=0;_<18;_++){var S=o(p,_),h=this.size-11+_%3,y=Math.floor(_/3);this.setFunctionModule(h,y,S),this.setFunctionModule(y,h,S)}}},d.prototype.drawFinderPattern=function(u,_){for(var p=-4;p<=4;p++)for(var S=-4;S<=4;S++){var h=Math.max(Math.abs(S),Math.abs(p)),y=u+S,O=_+p;0<=y&&y<this.size&&0<=O&&O<this.size&&this.setFunctionModule(y,O,h!=2&&h!=4)}},d.prototype.drawAlignmentPattern=function(u,_){for(var p=-2;p<=2;p++)for(var S=-2;S<=2;S++)this.setFunctionModule(u+S,_+p,Math.max(Math.abs(S),Math.abs(p))!=1)},d.prototype.setFunctionModule=function(u,_,p){this.modules[_][u]=p,this.isFunction[_][u]=!0},d.prototype.addEccAndInterleave=function(u){var _=this.version,p=this.errorCorrectionLevel;if(u.length!=d.getNumDataCodewords(_,p))throw new RangeError("Invalid argument");for(var S=d.NUM_ERROR_CORRECTION_BLOCKS[p.ordinal][_],h=d.ECC_CODEWORDS_PER_BLOCK[p.ordinal][_],y=Math.floor(d.getNumRawDataModules(_)/8),O=S-y%S,N=Math.floor(y/S),w=[],L=d.reedSolomonComputeDivisor(h),D=0,U=0;D<S;D++){var x=u.slice(U,U+N-h+(D<O?0:1));U+=x.length;var G=d.reedSolomonComputeRemainder(x,L);D<O&&x.push(0),w.push(x.concat(G))}for(var F=[],z=function($){w.forEach(function(V,ee){($!=N-h||ee>=O)&&F.push(V[$])})},D=0;D<w[0].length;D++)z(D);return c(F.length==y),F},d.prototype.drawCodewords=function(u){if(u.length!=Math.floor(d.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");for(var _=0,p=this.size-1;p>=1;p-=2){p==6&&(p=5);for(var S=0;S<this.size;S++)for(var h=0;h<2;h++){var y=p-h,O=(p+1&2)==0,N=O?this.size-1-S:S;!thiLine truncated
-14
View File
@@ -1,14 +0,0 @@
import{s as Nn,l as Ln,m as Pn,n as ll,p as Rn,f as yl,U as bt,d as Fn,g as At,i as Vt,c as Nt,h as Cl,e as st,q as Tn,E as zn,t as Mn,b as On}from"./el-input-CNNwOXGP.js";import"./el-tag-5pOVEKUY.js";import{b as _n,i as wl,a as $n,E as Wn,d as dt,c as Sl}from"./el-select-LRJf3l5x.js";import{i as yt,g as Bn,k as Hn,c as An,a as xl,b as Vn,d as In,e as Kn,f as Dn,h as jn,j as Un,S as qn,E as El,C as Gn}from"./el-popper-C96qJ_vz.js";import"./el-tooltip-l0sNRNKZ.js";import{b3 as It,b4 as Yn,b5 as kl,b6 as Nl,b7 as Xn,b8 as Qn,b9 as Lt,ba as Jn,bb as Zn,E as Ie,G as we,e as ce,ag as Fe,ah as Ct,i as he,c as R,a7 as Le,aT as de,$ as ie,F as _e,s as N,al as oe,ai as Be,f as Xe,bc as nl,_ as Pe,a as j,aG as Ll,u as se,g as re,o as z,w as ee,N as te,P as V,Q as ge,h as W,j as C,A as Oe,O as ft,J as Qe,bd as ht,r as Te,ab as Ke,U as He,R as J,k as wt,n as Ae,b as $e,d as Kt,p as Dt,x as Pl,l as jt,ak as Ut,aV as pt,ao as Me,W as et,q as Rl,m as Fl,B as U,ac as vt,aW as Ve,be as ea,bf as al,bg as ta,S as la,bh as na,z as B,aS as qt,bi as aa,a5 as Je,a2 as Ne,a4 as ol,bj as Tl,a3 as oa,bk as sl,M as ke,bl as zl,bm as sa,aR as ra,bn as Ml,a0 as tt,aL as ia,aD as Gt,aQ as qe,D as Ze,a6 as ua,I as gt,t as ca,bo as rl,aY as il,C as ul,a1 as Ol,Y as da,bp as fa,a8 as ha,af as St,aF as xt}from"./index-CxMsK_Ni.js";function pa(e,t){return Nn(Ln(e,t,Pn),e+"")}function va(e,t,l){if(!It(l))return!1;var n=typeof t;return(n=="number"?yt(l)&&Yn(t,l.length):n=="string"&&t in l)?kl(l[t],e):!1}function ga(e){return pa(function(t,l){var n=-1,o=l.length,s=o>1?l[o-1]:void 0,i=o>2?l[2]:void 0;for(s=e.length>3&&typeof s=="function"?(o--,s):void 0,i&&va(l[0],l[1],i)&&(s=o<3?void 0:s,o=1),t=Object(t);++n<o;){var a=l[n];a&&e(t,a,n,s)}return t})}var ma="[object Object]",ba=Function.prototype,ya=Object.prototype,_l=ba.toString,Ca=ya.hasOwnProperty,wa=_l.call(Object);function Sa(e){if(!Nl(e)||Xn(e)!=ma)return!1;var t=Bn(e);if(t===null)return!0;var l=Ca.call(t,"constructor")&&t.constructor;return typeof l=="function"&&l instanceof l&&_l.call(l)==wa}function xa(e){return function(t,l,n){for(var o=-1,s=Object(t),i=n(t),a=i.length;a--;){var r=i[++o];if(l(s[r],r,s)===!1)break}return t}}var $l=xa();function Ea(e,t){return e&&$l(e,t,Hn)}function ka(e,t){return function(l,n){if(l==null)return l;if(!yt(l))return e(l,n);for(var o=l.length,s=-1,i=Object(l);++s<o&&n(i[s],s,i)!==!1;);return l}}var Na=ka(Ea);function Pt(e,t,l){(l!==void 0&&!kl(e[t],l)||l===void 0&&!(t in e))&&Qn(e,t,l)}function La(e){return Nl(e)&&yt(e)}function Rt(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Pa(e){return An(e,xl(e))}function Ra(e,t,l,n,o,s,i){var a=Rt(e,l),r=Rt(t,l),u=i.get(r);if(u){Pt(e,l,u);return}var d=s?s(a,r,l+"",e,t,i):void 0,f=d===void 0;if(f){var v=Lt(r),y=!v&&Vn(r),h=!v&&!y&&In(r);d=r,v||y||h?Lt(a)?d=a:La(a)?d=Kn(a):y?(f=!1,d=Dn(r,!0)):h?(f=!1,d=jn(r,!0)):d=[]:Sa(r)||ll(r)?(d=a,ll(a)?d=Pa(a):(!It(a)||Jn(a))&&(d=Un(r))):f=!1}f&&(i.set(r,d),o(d,r,n,s,i),i.delete(r)),Pt(e,l,d)}function Wl(e,t,l,n,o){e!==t&&$l(t,function(s,i){if(o||(o=new qn),It(s))Ra(e,t,i,l,Wl,n,o);else{var a=n?n(Rt(e,i),s,i+"",e,t,o):void 0;a===void 0&&(a=s),Pt(e,i,a)}},xl)}function Fa(e,t){var l=-1,n=yt(e)?Array(e.length):[];return Na(e,function(o,s,i){n[++l]=t(o,s,i)}),n}function Ta(e,t){var l=Lt(e)?Zn:Fa;return l(e,_n(t))}function za(e,t){return Rn(Ta(e,t))}function lt(e){return e===null}var Bl=ga(function(e,t,l){Wl(e,t,l)});const Ma=e=>Ie?window.requestAnimationFrame(e):setTimeout(e,16),Hl={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:Ct,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...yl(["ariaControls"])},Al={[bt]:e=>we(e)||ce(e)||Fe(e),change:e=>we(e)||ce(e)||Fe(e)},Ue=Symbol("checkboxGroupContextKey"),Oa=({model:e,isChecked:t})=>{const l=he(Ue,void 0),n=R(()=>{var s,i;const a=(s=l==null?void 0:l.max)==null?void 0:s.value,r=(i=l==null?void 0:l.min)==null?void 0:i.value;return!Le(a)&&e.value.length>=a&&!t.value||!Le(r)&&e.value.length<=r&&t.value});return{isDisabled:Fn(R(()=>(l==null?void 0:l.disabled.value)||n.value)),isLimitDisabled:n}},_a=(e,{model:t,isLimitExceeded:l,hasOwnLabel:n,isDisabled:o,isLabeledByFormItem:s})=>{const i=he(Ue,void 0),{formItem:a}=At(),{emit:r}=de();function u(h){var b,w,S,P;return[!0,e.trueValue,e.trueLabel].includes(h)?(w=(b=e.trueValue)!=null?b:e.trueLabel)!=null?w:!0:(P=(S=e.falseValue)!=null?S:e.falseLabel)!=null?P:!1}function d(h,b){r("change",u(h),b)}function f(h){if(l.value)return;const b=h.target;r("change",u(b.checked),h)}async functionLine truncated
* Checks if an event is supported in the current execution environment.
*
* NOTE: This will not work correctly for non-generic events such as `change`,
* `reset`, `load`, `error`, and `select`.
*
* Borrows from Modernizr.
*
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/const gs=function(e,t){if(e&&e.addEventListener){const l=function(n){const o=vs(n);t&&Reflect.apply(t,this,[n,o])};e.addEventListener("wheel",l,{passive:!0})}},ms={beforeMount(e,t){gs(e,t.value)}};let bs=1;const ys=j({name:"ElTable",directives:{Mousewheel:ms},components:{TableHeader:qo,TableBody:ts,TableFooter:as,ElScrollbar:Sl,hColgroup:Zl},props:is,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change","scroll"],setup(e){const{t}=Me(),l=se("table"),n=de();Dt(Re,n);const o=Wo(n,e);n.store=o;const s=new Ho({store:n.store,table:n,fit:e.fit,showHeader:e.showHeader});n.layout=s;const i=R(()=>(o.states.data.value||[]).length===0),{setCurrentRow:a,getSelectionRows:r,toggleRowSelection:u,clearSelection:d,clearFilter:f,toggleAllSelection:v,toggleRowExpansion:y,clearSort:h,sort:b,updateKeyChildren:w}=os(o),{isHidden:S,renderExpanded:P,setDragVisible:E,isGroup:c,handleMouseLeave:p,handleHeaderFooterMousewheel:g,tableSize:m,emptyBlockStyle:x,handleFixedMousewheel:L,resizeProxyVisible:M,bodyWidth:$,resizeState:O,doLayout:I,tableBodyStyles:Y,tableLayout:K,scrollbarViewStyle:q,scrollbarStyle:X}=ss(e,s,o,n),{scrollBarRef:T,scrollTo:k,setScrollLeft:_,setScrollTop:Z}=us(),le=dt(I,50),ne=`${l.namespace.value}-table_${bs++}`;n.tableId=ne,n.state={isGroup:c,resizeState:O,doLayout:I,debouncedUpdateLayout:le};const pe=R(()=>{var ue;return(ue=e.sumText)!=null?ue:t("el.table.sumText")}),me=R(()=>{var ue;return(ue=e.emptyText)!=null?ue:t("el.table.emptyText")}),Ee=R(()=>Jl(o.states.originColumns.value)[0]);return rs(n),Ol(()=>{le.cancel()}),{ns:l,layout:s,store:o,columns:Ee,handleHeaderFooterMousewheel:g,handleMouseLeave:p,tableId:ne,tableSize:m,isHidden:S,isEmpty:i,renderExpanded:P,resizeProxyVisible:M,resizeState:O,isGroup:c,bodyWidth:$,tableBodyStyles:Y,emptyBlockStyle:x,debouncedUpdateLayout:le,handleFixedMousewheel:L,setCurrentRow:a,getSelectionRows:r,toggleRowSelection:u,clearSelection:d,clearFilter:f,toggleAllSelection:v,toggleRowExpansion:y,clearSort:h,doLayout:I,sort:b,updateKeyChildren:w,t,setDragVisible:E,context:n,computedSumText:pe,computedEmptyText:me,tableLayout:K,scrollbarViewStyle:q,scrollbarStyle:X,scrollBarRef:T,scrollTo:k,setScrollLeft:_,setScrollTop:Z,allowDragLastColumn:e.allowDragLastColumn}}});function Cs(e,t,l,n,o,s){const i=ke("hColgroup"),a=ke("table-header"),r=ke("table-body"),u=ke("table-footer"),d=ke("el-scrollbar"),f=zl("mousewheel");return z(),V("div",{ref:"tableWrapper",class:W([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:(e.store.states.data.value||[]).length!==0&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:Ae(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:e.handleMouseLeave},[te("div",{class:W(e.ns.e("inner-wrapper"))},[te("div",{ref:"hiddenColumns",class:"hidden-columns"},[Te(e.$slots,"default")],512),e.showHeader&&e.tableLayout==="fixed"?Oe((z(),V("div",{key:0,ref:"headerWrapper",class:W(e.ns.e("header-wrapper"))},[te("table",{ref:"tableHeader",class:W(e.ns.e("header")),style:Ae(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[U(i,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),U(a,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,"allow-drag-last-column":e.allowDragLastColumn,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","append-filter-panel-to","allow-drag-last-column","onSetDragVisible"])],6)],2)),[[f,e.handleHeaderFooterMousewheel]]):ge("v-if",!0),te("div",{ref:"bodyWrapper",class:W(e.ns.e("body-wrapper"))},[U(d,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn,tabindex:e.scrollbarTabindex,onScroll:v=>e.$emit("scroll",v)},{default:ee(()=>[te("table",{ref:"tableBody",class:W(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:Ae({width:e.bodyWidth,tableLayout:e.tableLayout})},[U(i,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&e.tableLayout==="auto"?(z(),re(a,{key:0,ref:"tableHeaderRef",class:W(e.ns.e("body-header")),border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,onSetDragVisible:e.setDragVisible},null,8,["class","border","default-sort"Line truncated
-1
View File
@@ -1 +0,0 @@
.el-pagination{--el-pagination-font-size:14px;--el-pagination-bg-color:var(--el-fill-color-blank);--el-pagination-text-color:var(--el-text-color-primary);--el-pagination-border-radius:2px;--el-pagination-button-color:var(--el-text-color-primary);--el-pagination-button-width:32px;--el-pagination-button-height:32px;--el-pagination-button-disabled-color:var(--el-text-color-placeholder);--el-pagination-button-disabled-bg-color:var(--el-fill-color-blank);--el-pagination-button-bg-color:var(--el-fill-color);--el-pagination-hover-color:var(--el-color-primary);--el-pagination-font-size-small:12px;--el-pagination-button-width-small:24px;--el-pagination-button-height-small:24px;--el-pagination-button-width-large:40px;--el-pagination-button-height-large:40px;--el-pagination-item-gap:16px;align-items:center;color:var(--el-pagination-text-color);display:flex;font-size:var(--el-pagination-font-size);font-weight:400;white-space:nowrap}.el-pagination .el-input__inner{-moz-appearance:textfield;text-align:center}.el-pagination .el-select{width:128px}.el-pagination button{align-items:center;background:var(--el-pagination-bg-color);border:none;border-radius:var(--el-pagination-border-radius);box-sizing:border-box;color:var(--el-pagination-button-color);cursor:pointer;display:flex;font-size:var(--el-pagination-font-size);height:var(--el-pagination-button-height);justify-content:center;line-height:var(--el-pagination-button-height);min-width:var(--el-pagination-button-width);padding:0 4px;text-align:center}.el-pagination button *{pointer-events:none}.el-pagination button:focus{outline:none}.el-pagination button.is-active,.el-pagination button:hover{color:var(--el-pagination-hover-color)}.el-pagination button.is-active{cursor:default;font-weight:700}.el-pagination button.is-active.is-disabled{color:var(--el-text-color-secondary);font-weight:700}.el-pagination button.is-disabled,.el-pagination button:disabled{background-color:var(--el-pagination-button-disabled-bg-color);color:var(--el-pagination-button-disabled-color);cursor:not-allowed}.el-pagination button:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700;width:inherit}.el-pagination>.is-first{margin-left:0!important}.el-pagination>.is-last{margin-right:0!important}.el-pagination .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination__sizes,.el-pagination__total{color:var(--el-text-color-regular);font-weight:400;margin-left:var(--el-pagination-item-gap)}.el-pagination__total[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__jump{align-items:center;color:var(--el-text-color-regular);display:flex;font-weight:400;margin-left:var(--el-pagination-item-gap)}.el-pagination__jump[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__goto{margin-right:8px}.el-pagination__editor{box-sizing:border-box;text-align:center}.el-pagination__editor.el-input{width:56px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination__classifier{margin-left:8px}.el-pagination__rightwrapper{align-items:center;display:flex;flex:1;justify-content:flex-end}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{background-color:var(--el-pagination-button-bg-color);margin:0 4px}.el-pagination.is-background .btn-next.is-active,.el-pagination.is-background .btn-prev.is-active,.el-pagination.is-background .el-pager li.is-active{background-color:var(--el-color-primary);color:var(--el-color-white)}.el-pagination.is-background .btn-next.is-disabled,.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev.is-disabled,.el-pagination.is-background .btn-prev:disabled,.el-pagination.is-background .el-pager li.is-disabled,.el-pagination.is-background .el-pager li:disabled{background-color:var(--el-disabled-bg-color);color:var(--el-text-color-placeholder)}.el-pagination.is-background .btn-next.is-disabled.is-active,.el-pagination.is-background .btn-next:disabled.is-active,.el-pagination.is-background .btn-prev.is-disabled.is-active,.el-pagination.is-background .btn-prev:disabled.is-active,.el-pagination.is-background .el-pager li.is-disabled.is-active,.el-pagination.is-background .el-pager li:disabled.is-active{background-color:var(--el-fill-color-dark);color:var(--el-text-color-secondary)}.el-pagination.is-background .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li{font-size:var(--el-pagination-font-size-small);height:var(--el-pagination-button-height-small);line-height:var(--el-pagination-button-height-small);min-width:var(--el-pagination-button-width-small)}.el-pagination--small button,.el-pagination--small spanLine truncated
-1
View File
@@ -1 +0,0 @@
:root{--el-loading-spinner-size:42px;--el-loading-fullscreen-spinner-size:50px}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{background-color:var(--el-mask-color);bottom:0;left:0;margin:0;position:absolute;right:0;top:0;transition:opacity var(--el-transition-duration);z-index:2000}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:calc((0px - var(--el-loading-fullscreen-spinner-size))/2)}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:var(--el-loading-fullscreen-spinner-size);width:var(--el-loading-fullscreen-spinner-size)}.el-loading-spinner{margin-top:calc((0px - var(--el-loading-spinner-size))/2);position:absolute;text-align:center;top:50%;width:100%}.el-loading-spinner .el-loading-text{color:var(--el-color-primary);font-size:14px;margin:3px 0}.el-loading-spinner .circular{animation:loading-rotate 2s linear infinite;display:inline;height:var(--el-loading-spinner-size);width:var(--el-loading-spinner-size)}.el-loading-spinner .path{animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:var(--el-color-primary);stroke-linecap:round}.el-loading-spinner i{color:var(--el-color-primary)}.el-loading-fade-enter-from,.el-loading-fade-leave-to{opacity:0}@keyframes loading-rotate{to{transform:rotate(1turn)}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-row{box-sizing:border-box;display:flex;flex-wrap:wrap;position:relative}.el-row.is-justify-center{justify-content:center}.el-row.is-justify-end{justify-content:flex-end}.el-row.is-justify-space-between{justify-content:space-between}.el-row.is-justify-space-around{justify-content:space-around}.el-row.is-justify-space-evenly{justify-content:space-evenly}.el-row.is-align-top{align-items:flex-start}.el-row.is-align-middle{align-items:center}.el-row.is-align-bottom{align-items:flex-end}[class*=el-col-]{box-sizing:border-box}[class*=el-col-].is-guttered{display:block;min-height:1px}.el-col-0{flex:0 0 0%;max-width:0}.el-col-0,.el-col-0.is-guttered{display:none}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{left:0;position:relative}.el-col-1{flex:0 0 4.1666666667%;max-width:4.1666666667%}.el-col-1,.el-col-1.is-guttered{display:block}.el-col-offset-1{margin-left:4.1666666667%}.el-col-pull-1{position:relative;right:4.1666666667%}.el-col-push-1{left:4.1666666667%;position:relative}.el-col-2{flex:0 0 8.3333333333%;max-width:8.3333333333%}.el-col-2,.el-col-2.is-guttered{display:block}.el-col-offset-2{margin-left:8.3333333333%}.el-col-pull-2{position:relative;right:8.3333333333%}.el-col-push-2{left:8.3333333333%;position:relative}.el-col-3{flex:0 0 12.5%;max-width:12.5%}.el-col-3,.el-col-3.is-guttered{display:block}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{left:12.5%;position:relative}.el-col-4{flex:0 0 16.6666666667%;max-width:16.6666666667%}.el-col-4,.el-col-4.is-guttered{display:block}.el-col-offset-4{margin-left:16.6666666667%}.el-col-pull-4{position:relative;right:16.6666666667%}.el-col-push-4{left:16.6666666667%;position:relative}.el-col-5{flex:0 0 20.8333333333%;max-width:20.8333333333%}.el-col-5,.el-col-5.is-guttered{display:block}.el-col-offset-5{margin-left:20.8333333333%}.el-col-pull-5{position:relative;right:20.8333333333%}.el-col-push-5{left:20.8333333333%;position:relative}.el-col-6{flex:0 0 25%;max-width:25%}.el-col-6,.el-col-6.is-guttered{display:block}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{left:25%;position:relative}.el-col-7{flex:0 0 29.1666666667%;max-width:29.1666666667%}.el-col-7,.el-col-7.is-guttered{display:block}.el-col-offset-7{margin-left:29.1666666667%}.el-col-pull-7{position:relative;right:29.1666666667%}.el-col-push-7{left:29.1666666667%;position:relative}.el-col-8{flex:0 0 33.3333333333%;max-width:33.3333333333%}.el-col-8,.el-col-8.is-guttered{display:block}.el-col-offset-8{margin-left:33.3333333333%}.el-col-pull-8{position:relative;right:33.3333333333%}.el-col-push-8{left:33.3333333333%;position:relative}.el-col-9{flex:0 0 37.5%;max-width:37.5%}.el-col-9,.el-col-9.is-guttered{display:block}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{left:37.5%;position:relative}.el-col-10{flex:0 0 41.6666666667%;max-width:41.6666666667%}.el-col-10,.el-col-10.is-guttered{display:block}.el-col-offset-10{margin-left:41.6666666667%}.el-col-pull-10{position:relative;right:41.6666666667%}.el-col-push-10{left:41.6666666667%;position:relative}.el-col-11{flex:0 0 45.8333333333%;max-width:45.8333333333%}.el-col-11,.el-col-11.is-guttered{display:block}.el-col-offset-11{margin-left:45.8333333333%}.el-col-pull-11{position:relative;right:45.8333Line truncated
-1
View File
@@ -1 +0,0 @@
import{o as he,E as Ae,a as We,b as Re,u as Ce}from"./el-input-CNNwOXGP.js";import{E as Xe,u as Ye,a as xe,b as Je,c as Qe,d as en}from"./config-CZWWa62X.js";import{b as Ve,m as H,d as U,_ as de,a as P,i as nn,c as k,u as _e,e as we,f as le,g as T,o as h,w as v,r as fe,n as se,h as p,j as E,k as j,l as Oe,p as tn,q as on,s as M,t as me,v as sn,x as Ne,y as Pe,z as q,A as G,B as m,C as te,T as ze,D as ae,E as je,F as O,G as Y,H as Z,I as Ee,J as an,K as ln,L as rn,M as z,N as $,O as Q,P as D,Q as _,R as V,S as ee,U as W,V as un,W as cn,X as ke,Y as Be,Z as $e,$ as ie,a0 as De,a1 as dn,a2 as ue,a3 as Fe,a4 as Ke,a5 as Se,a6 as Ie,a7 as fn,a8 as mn,a9 as vn,aa as pn,ab as gn,ac as bn,ad as yn,ae as hn,af as Cn}from"./index-CxMsK_Ni.js";import{u as wn,a as En,_ as kn}from"./CardTools.vue_vue_type_script_setup_true_lang-CdJKhv07.js";import"./vnode-Cc0RQjVK.js";import"./el-tag-5pOVEKUY.js";import"./index-CBpXPsVN.js";const Bn=Ve({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:U([Number,Object]),default:()=>H({})},sm:{type:U([Number,Object]),default:()=>H({})},md:{type:U([Number,Object]),default:()=>H({})},lg:{type:U([Number,Object]),default:()=>H({})},xl:{type:U([Number,Object]),default:()=>H({})}}),He=Symbol("rowContextKey"),$n=P({name:"ElCol"}),Sn=P({...$n,props:Bn,setup(e){const n=e,{gutter:t}=nn(He,{gutter:k(()=>0)}),s=_e("col"),r=k(()=>{const l={};return t.value&&(l.paddingLeft=l.paddingRight=`${t.value/2}px`),l}),a=k(()=>{const l=[];return["span","offset","pull","push"].forEach(o=>{const g=n[o];we(g)&&(o==="span"?l.push(s.b(`${n[o]}`)):g>0&&l.push(s.b(`${o}-${n[o]}`)))}),["xs","sm","md","lg","xl"].forEach(o=>{we(n[o])?l.push(s.b(`${o}-${n[o]}`)):le(n[o])&&Object.entries(n[o]).forEach(([g,b])=>{l.push(g!=="span"?s.b(`${o}-${g}-${b}`):s.b(`${o}-${b}`))})}),t.value&&l.push(s.is("guttered")),[s.b(),l]});return(l,c)=>(h(),T(j(l.tag),{class:p(E(a)),style:se(E(r))},{default:v(()=>[fe(l.$slots,"default")]),_:3},8,["class","style"]))}});var In=de(Sn,[["__file","col.vue"]]);const Ln=Oe(In),Tn=["start","center","end","space-around","space-between","space-evenly"],Mn=["top","middle","bottom"],An=Ve({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:Tn,default:"start"},align:{type:String,values:Mn}}),Rn=P({name:"ElRow"}),Vn=P({...Rn,props:An,setup(e){const n=e,t=_e("row"),s=k(()=>n.gutter);tn(He,{gutter:s});const r=k(()=>{const l={};return n.gutter&&(l.marginRight=l.marginLeft=`-${n.gutter/2}px`),l}),a=k(()=>[t.b(),t.is(`justify-${n.justify}`,n.justify!=="start"),t.is(`align-${n.align}`,!!n.align)]);return(l,c)=>(h(),T(j(l.tag),{class:p(E(a)),style:se(E(r))},{default:v(()=>[fe(l.$slots,"default")]),_:3},8,["class","style"]))}});var _n=de(Vn,[["__file","row.vue"]]);const On=Oe(_n),Nn=e=>["",...on].includes(e);function Pn(e){let n;const t=M(!1),s=me({...e,originalPosition:"",originalOverflow:"",visible:!1});function r(i){s.text=i}function a(){const i=s.parent,f=b.ns;if(!i.vLoadingAddClassList){let u=i.getAttribute("loading-number");u=Number.parseInt(u)-1,u?i.setAttribute("loading-number",u.toString()):(ae(i,f.bm("parent","relative")),i.removeAttribute("loading-number")),ae(i,f.bm("parent","hidden"))}l(),g.unmount()}function l(){var i,f;(f=(i=b.$el)==null?void 0:i.parentNode)==null||f.removeChild(b.$el)}function c(){var i;e.beforeClose&&!e.beforeClose()||(t.value=!0,clearTimeout(n),n=setTimeout(y,400),s.visible=!1,(i=e.closed)==null||i.call(e))}function y(){if(!t.value)return;const i=s.parent;t.value=!1,i.vLoadingAddClassList=void 0,a()}const o=P({name:"ElLoading",setup(i,{expose:f}){const{ns:u,zIndex:C}=Pe("loading");return f({ns:u,zIndex:C}),()=>{const w=s.spinner||s.svg,B=q("svg",{class:"circular",viewBox:s.svgViewBox?s.svgViewBox:"0 0 50 50",...w?{innerHTML:w}:{}},[q("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),A=s.text?q("p",{class:u.b("text")},[s.text]):void 0;return q(ze,{name:u.b("fade"),onAfterLeave:y},{default:v(()=>[G(m("div",{style:{backgroundColor:s.background||""},class:[u.b("mask"),s.customClass,s.fullscreen?"is-fullscreen":""]},[q("div",{class:u.b("spinner")},[B,A])]),[[te,s.visible]])])})}}}),g=sn(o),b=g.mount(document.createElement("div"));return{...Ne(s),setText:r,removeElLoadingChild:l,close:c,handleAfterLeave:y,vm:b,get $el(){return b.$el}}}let ne;const zn=function(e={}){if(!je)return;const n=jn(e);if(n.fullscreen&&ne)return ne;const t=Pn({...n,closed:()=>{var r;(r=n.closed)==null||r.call(n),n.fullscreen&&(ne=void 0)}});Dn(n,n.parent,t),Le(n,n.parent,t),n.parent.vLoadingAddClassList=()=>Le(n,n.parent,t);let s=n.parent.getAttribute("loading-number");return s?s=`${Number.parseInt(s)+1}`:s="1",n.parent.setAttribute("loading-number",s),n.parent.appendChild(t.$el),O(()=>t.visible.value=n.visible),n.fullscreen&&(ne=t),t},jn=e=>{var n,t,s,r;let a;return Y(e.target)?a=(n=document.querySelector(e.target))!=null?n:document.body:a=e.target||docLine truncated
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
.el-empty{--el-empty-padding:40px 0;--el-empty-image-width:160px;--el-empty-description-margin-top:20px;--el-empty-bottom-margin-top:20px;--el-empty-fill-color-0:var(--el-color-white);--el-empty-fill-color-1:#fcfcfd;--el-empty-fill-color-2:#f8f9fb;--el-empty-fill-color-3:#f7f8fc;--el-empty-fill-color-4:#eeeff3;--el-empty-fill-color-5:#edeef2;--el-empty-fill-color-6:#e9ebef;--el-empty-fill-color-7:#e5e7e9;--el-empty-fill-color-8:#e0e3e9;--el-empty-fill-color-9:#d5d7de;align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;padding:var(--el-empty-padding);text-align:center}.el-empty__image{width:var(--el-empty-image-width)}.el-empty__image img{height:100%;-o-object-fit:contain;object-fit:contain;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top;width:100%}.el-empty__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;height:100%;vertical-align:top;width:100%}.el-empty__description{margin-top:var(--el-empty-description-margin-top)}.el-empty__description p{color:var(--el-text-color-secondary);font-size:var(--el-font-size-base);margin:0}.el-empty__bottom{margin-top:var(--el-empty-bottom-margin-top)}.file-list[data-v-d08589ab]{display:grid;width:100%;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px;padding:16px}.file-card[data-v-d08589ab]{align-items:center;justify-content:space-between;border-radius:10px;transition:all .3s ease}.file-card[data-v-d08589ab]:hover{box-shadow:0 6px 15px #00000040}.file-info[data-v-d08589ab]{flex:1}.file-name[data-v-d08589ab]{font-size:14px;font-weight:700;white-space:nowrap}.file-date[data-v-d08589ab]{font-size:12px;color:#a0a0b2}
-1
View File
@@ -1 +0,0 @@
import{u as q,E as H,b as Q}from"./el-input-CNNwOXGP.js";import{c as Z,h as A,d as J}from"./config-CZWWa62X.js";import{E as K,a as W}from"./el-form-item-llYGp2SQ.js";import"./el-tag-5pOVEKUY.js";import{E as X,a as Y}from"./el-select-LRJf3l5x.js";import"./el-popper-C96qJ_vz.js";import{_ as R,a as g,u as G,P as c,o as n,N as l,j as e,b as ee,ao as le,c as B,aH as te,Q as C,r as x,B as d,n as ae,h,R as m,l as oe,a8 as se,s as N,t as ne,g as V,ab as b,ac as F,w as i,af as $,U as k,aF as I}from"./index-CxMsK_Ni.js";import"./vnode-Cc0RQjVK.js";import"./_baseClone-DD6IrDYX.js";const re=g({name:"ImgEmpty"}),ie=g({...re,setup(_){const t=G("empty"),r=q();return(p,u)=>(n(),c("svg",{viewBox:"0 0 79 86",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[l("defs",null,[l("linearGradient",{id:`linearGradient-1-${e(r)}`,x1:"38.8503086%",y1:"0%",x2:"61.1496914%",y2:"100%"},[l("stop",{"stop-color":`var(${e(t).cssVarBlockName("fill-color-1")})`,offset:"0%"},null,8,["stop-color"]),l("stop",{"stop-color":`var(${e(t).cssVarBlockName("fill-color-4")})`,offset:"100%"},null,8,["stop-color"])],8,["id"]),l("linearGradient",{id:`linearGradient-2-${e(r)}`,x1:"0%",y1:"9.5%",x2:"100%",y2:"90.5%"},[l("stop",{"stop-color":`var(${e(t).cssVarBlockName("fill-color-1")})`,offset:"0%"},null,8,["stop-color"]),l("stop",{"stop-color":`var(${e(t).cssVarBlockName("fill-color-6")})`,offset:"100%"},null,8,["stop-color"])],8,["id"]),l("rect",{id:`path-3-${e(r)}`,x:"0",y:"0",width:"17",height:"36"},null,8,["id"])]),l("g",{id:"Illustrations",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[l("g",{id:"B-type",transform:"translate(-1268.000000, -535.000000)"},[l("g",{id:"Group-2",transform:"translate(1268.000000, 535.000000)"},[l("path",{id:"Oval-Copy-2",d:"M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z",fill:`var(${e(t).cssVarBlockName("fill-color-3")})`},null,8,["fill"]),l("polygon",{id:"Rectangle-Copy-14",fill:`var(${e(t).cssVarBlockName("fill-color-7")})`,transform:"translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",points:"13 58 53 58 42 45 2 45"},null,8,["fill"]),l("g",{id:"Group-Copy",transform:"translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)"},[l("polygon",{id:"Rectangle-Copy-10",fill:`var(${e(t).cssVarBlockName("fill-color-7")})`,transform:"translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",points:"2.84078316e-14 3 18 3 23 7 5 7"},null,8,["fill"]),l("polygon",{id:"Rectangle-Copy-11",fill:`var(${e(t).cssVarBlockName("fill-color-5")})`,points:"-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"},null,8,["fill"]),l("rect",{id:"Rectangle-Copy-12",fill:`url(#linearGradient-1-${e(r)})`,transform:"translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",x:"38",y:"7",width:"17",height:"36"},null,8,["fill"]),l("polygon",{id:"Rectangle-Copy-13",fill:`var(${e(t).cssVarBlockName("fill-color-2")})`,transform:"translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",points:"24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"},null,8,["fill"])]),l("rect",{id:"Rectangle-Copy-15",fill:`url(#linearGradient-2-${e(r)})`,x:"13",y:"45",width:"40",height:"36"},null,8,["fill"]),l("g",{id:"Rectangle-Copy-17",transform:"translate(53.000000, 45.000000)"},[l("use",{id:"Mask",fill:`var(${e(t).cssVarBlockName("fill-color-8")})`,transform:"translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ","xlink:href":`#path-3-${e(r)}`},null,8,["fill","xlink:href"]),l("polygon",{id:"Rectangle-Copy",fill:`var(${e(t).cssVarBlockName("fill-color-9")})`,mask:`url(#mask-4-${e(r)})`,transform:"translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",points:"7 0 24 0 20 18 7 16.5"},null,8,["fill","mask"])]),l("polygon",{id:"Rectangle-Copy-18",fill:`var(${e(t).cssVarBlockName("fill-color-2")})`,transform:"translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",points:"62 45 79 45 70 58 53 58"},null,8,["fill"])])])])]))}});var ce=R(ie,[["__file","img-empty.vue"]]);const de=ee({image:{type:String,default:""},imageSize:Number,description:{type:String,default:""}}),pe=g({name:"ElEmpty"}),me=g({...pe,props:de,setup(_){const t=_,{t:r}=le(),p=G("empty"),u=B(()=>t.description||r("el.table.emptyText")),y=B(()=>({width:te(t.imageSize)}));return(a,w)=>(n(),c("div",{class:h(e(p).b())},[l("div",{class:h(e(p).e("image")),style:ae(e(y))},[a.image?(n(),c("img",{key:0,src:a.image,ondragstart:"return false"},null,8,["src"])):x(a.$slots,"image",{key:1},()=>[d(ce)])],6),l("div",{class:h(e(p).e("description"))},[a.$slots.description?x(a.$slots,"description",{key:0}):(n(),c("p",{key:1},m(e(u)),1))],2),a.$slots.default?(n(),c("div",{key:0,class:h(e(p).e("bottom"))},[x(a.$slots,"default")],2)Line truncated
-1
View File
@@ -1 +0,0 @@
.el-radio-group{align-items:center;display:inline-flex;flex-wrap:wrap;font-size:0}.el-radio{--el-radio-font-size:var(--el-font-size-base);--el-radio-text-color:var(--el-text-color-regular);--el-radio-font-weight:var(--el-font-weight-primary);--el-radio-input-height:14px;--el-radio-input-width:14px;--el-radio-input-border-radius:var(--el-border-radius-circle);--el-radio-input-bg-color:var(--el-fill-color-blank);--el-radio-input-border:var(--el-border);--el-radio-input-border-color:var(--el-border-color);--el-radio-input-border-color-hover:var(--el-color-primary);align-items:center;color:var(--el-radio-text-color);cursor:pointer;display:inline-flex;font-size:var(--el-font-size-base);font-weight:var(--el-radio-font-weight);height:32px;margin-right:30px;outline:none;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.el-radio.el-radio--large{height:40px}.el-radio.el-radio--small{height:24px}.el-radio.is-bordered{border:var(--el-border);border-radius:var(--el-border-radius-base);box-sizing:border-box;padding:0 15px 0 9px}.el-radio.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-radio.is-bordered.is-disabled{border-color:var(--el-border-color-lighter);cursor:not-allowed}.el-radio.is-bordered.el-radio--large{border-radius:var(--el-border-radius-base);padding:0 19px 0 11px}.el-radio.is-bordered.el-radio--large .el-radio__label{font-size:var(--el-font-size-base)}.el-radio.is-bordered.el-radio--large .el-radio__inner{height:14px;width:14px}.el-radio.is-bordered.el-radio--small{border-radius:var(--el-border-radius-base);padding:0 11px 0 7px}.el-radio.is-bordered.el-radio--small .el-radio__label{font-size:12px}.el-radio.is-bordered.el-radio--small .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{cursor:pointer;display:inline-flex;outline:none;position:relative;vertical-align:middle;white-space:nowrap}.el-radio__input.is-disabled .el-radio__inner{border-color:var(--el-disabled-border-color)}.el-radio__input.is-disabled .el-radio__inner,.el-radio__input.is-disabled .el-radio__inner:after{background-color:var(--el-disabled-bg-color);cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color)}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:var(--el-text-color-placeholder)}.el-radio__input.is-disabled+span.el-radio__label{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{background:var(--el-color-primary);border-color:var(--el-color-primary)}.el-radio__input.is-checked .el-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:var(--el-color-primary)}.el-radio__input.is-focus .el-radio__inner{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner{background-color:var(--el-radio-input-bg-color);border:var(--el-radio-input-border);border-radius:var(--el-radio-input-border-radius);box-sizing:border-box;cursor:pointer;display:inline-block;height:var(--el-radio-input-height);position:relative;width:var(--el-radio-input-width)}.el-radio__inner:hover{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner:after{background-color:var(--el-color-white);border-radius:var(--el-radio-input-border-radius);content:"";height:4px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in;width:4px}.el-radio__original{bottom:0;left:0;margin:0;opacity:0;outline:none;position:absolute;right:0;top:0;z-index:-1}.el-radio__original:focus-visible+.el-radio__inner{border-radius:var(--el-radio-input-border-radius);outline:2px solid var(--el-radio-input-border-color-hover);outline-offset:1px}.el-radio:focus:not(:focus-visible):not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{box-shadow:0 0 2px 2px var(--el-radio-input-border-color-hover)}.el-radio__label{font-size:var(--el-radio-font-size);padding-left:8px}.el-radio.el-radio--large .el-radio__label{font-size:14px}.el-radio.el-radio--large .el-radio__inner{height:14px;width:14px}.el-radio.el-radio--small .el-radio__label{font-size:12px}.el-radio.el-radio--small .el-radio__inner{height:12px;width:12px}.el-upload{--el-upload-dragger-padding-horizontal:40px;--el-upload-dragger-padding-vertical:10px;align-items:center;cursor:pointer;display:inline-flex;justify-content:center;outline:none}.el-upload.is-disabled{cursor:not-allowed}.el-upload.is-disabled:focus{color:inherit}.el-upload.is-disabled:focus,.el-upload.is-disabled:focus .el-upload-dragger{border-color:var(--el-border-color-darker)}.el-upload.is-disabled .el-upload-dragger{background-color:var(--el-disabled-bg-color);cursor:not-allowed}.el-upload.is-disabled .el-upload-dragger .el-upload__text{color:var(--el-text-color-placeLine truncated
-1
View File
@@ -1 +0,0 @@
import{C as Ze,U as ae,c as et,d as M,e as tt,f as at,u as st,g as ot,h as lt,i as be,t as se,E as _e,b as nt}from"./el-input-CNNwOXGP.js";import{c as oe,d as rt}from"./config-CZWWa62X.js";import"./el-tag-5pOVEKUY.js";import{i as it,E as ut,a as dt}from"./el-select-LRJf3l5x.js";import"./el-popper-C96qJ_vz.js";import{E as ct,u as Se,a as Ee,_ as pt}from"./CardTools.vue_vue_type_script_setup_true_lang-CdJKhv07.js";import{G as ne,e as re,ag as ie,b as z,ah as ke,s as O,i as $e,c as P,ai as ue,_ as A,a as w,u as I,P as $,o as y,N as R,A as Ce,aj as Re,j as e,O as V,h as _,J as we,r as D,F as De,U as q,R as U,n as Fe,a0 as Ue,p as xe,t as ft,x as mt,$ as Y,ak as Pe,l as Be,al as Le,am as Ve,d as S,an as F,m as Z,ao as vt,g as B,w as E,ab as Te,ac as Oe,S as ze,Q as C,B as k,W as N,ap as yt,aq as gt,ar as ht,as as bt,at as _t,au as St,av as Et,aw as ee,ax as de,ay as kt,a2 as $t,az as Ct,a1 as Rt,aA as wt,aB as ce,aC as pe,a8 as le,aD as Dt,aE as Ft,aF as G,af as Ie}from"./index-CxMsK_Ni.js";import{b as Ut}from"./_baseClone-DD6IrDYX.js";import"./vnode-Cc0RQjVK.js";import"./index-CBpXPsVN.js";var xt=1,Pt=4;function fe(o){return Ut(o,xt|Pt)}const Ne=z({modelValue:{type:[String,Number,Boolean],default:void 0},size:ke,disabled:Boolean,label:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:void 0}}),Bt=z({...Ne,border:Boolean}),Ae={[ae]:o=>ne(o)||re(o)||ie(o),[Ze]:o=>ne(o)||re(o)||ie(o)},je=Symbol("radioGroupKey"),Ge=(o,u)=>{const t=O(),l=$e(je,void 0),r=P(()=>!!l),d=P(()=>ue(o.value)?o.label:o.value),p=P({get(){return r.value?l.modelValue:o.modelValue},set(i){r.value?l.changeEvent(i):u&&u(ae,i),t.value.checked=o.modelValue===d.value}}),b=et(P(()=>l==null?void 0:l.size)),c=M(P(()=>l==null?void 0:l.disabled)),v=O(!1),g=P(()=>c.value||r.value&&p.value!==d.value?-1:0);return tt({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-radio",ref:"https://element-plus.org/en-US/component/radio.html"},P(()=>r.value&&ue(o.value))),{radioRef:t,isGroup:r,radioGroup:l,focus:v,size:b,disabled:c,tabIndex:g,modelValue:p,actualValue:d}},Lt=w({name:"ElRadio"}),Vt=w({...Lt,props:Bt,emits:Ae,setup(o,{emit:u}){const t=o,l=I("radio"),{radioRef:r,radioGroup:d,focus:p,size:b,disabled:c,modelValue:v,actualValue:g}=Ge(t,u);function i(){De(()=>u("change",v.value))}return(f,s)=>{var n;return y(),$("label",{class:_([e(l).b(),e(l).is("disabled",e(c)),e(l).is("focus",e(p)),e(l).is("bordered",f.border),e(l).is("checked",e(v)===e(g)),e(l).m(e(b))])},[R("span",{class:_([e(l).e("input"),e(l).is("disabled",e(c)),e(l).is("checked",e(v)===e(g))])},[Ce(R("input",{ref_key:"radioRef",ref:r,"onUpdate:modelValue":a=>we(v)?v.value=a:null,class:_(e(l).e("original")),value:e(g),name:f.name||((n=e(d))==null?void 0:n.name),disabled:e(c),checked:e(v)===e(g),type:"radio",onFocus:a=>p.value=!0,onBlur:a=>p.value=!1,onChange:i,onClick:V(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","checked","onFocus","onBlur","onClick"]),[[Re,e(v)]]),R("span",{class:_(e(l).e("inner"))},null,2)],2),R("span",{class:_(e(l).e("label")),onKeydown:V(()=>{},["stop"])},[D(f.$slots,"default",{},()=>[q(U(f.label),1)])],42,["onKeydown"])],2)}}});var Tt=A(Vt,[["__file","radio.vue"]]);const Ot=z({...Ne}),zt=w({name:"ElRadioButton"}),It=w({...zt,props:Ot,setup(o){const u=o,t=I("radio"),{radioRef:l,focus:r,size:d,disabled:p,modelValue:b,radioGroup:c,actualValue:v}=Ge(u),g=P(()=>({backgroundColor:(c==null?void 0:c.fill)||"",borderColor:(c==null?void 0:c.fill)||"",boxShadow:c!=null&&c.fill?`-1px 0 0 0 ${c.fill}`:"",color:(c==null?void 0:c.textColor)||""}));return(i,f)=>{var s;return y(),$("label",{class:_([e(t).b("button"),e(t).is("active",e(b)===e(v)),e(t).is("disabled",e(p)),e(t).is("focus",e(r)),e(t).bm("button",e(d))])},[Ce(R("input",{ref_key:"radioRef",ref:l,"onUpdate:modelValue":n=>we(b)?b.value=n:null,class:_(e(t).be("button","original-radio")),value:e(v),type:"radio",name:i.name||((s=e(c))==null?void 0:s.name),disabled:e(p),onFocus:n=>r.value=!0,onBlur:n=>r.value=!1,onClick:V(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","onFocus","onBlur","onClick"]),[[Re,e(b)]]),R("span",{class:_(e(t).be("button","inner")),style:Fe(e(b)===e(v)?e(g):{}),onKeydown:V(()=>{},["stop"])},[D(i.$slots,"default",{},()=>[q(U(i.label),1)])],46,["onKeydown"])],2)}}});var qe=A(It,[["__file","radio-button.vue"]]);const Nt=z({id:{type:String,default:void 0},size:ke,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:void 0},fill:{type:String,default:""},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0},...at(["ariaLabel"])}),At=Ae,jt=w({name:"ElRadioGroup"}),Gt=w({...jt,props:Nt,emits:At,setup(o,{emit:u}){const t=o,l=I("radio"),r=st(),d=O(),{formItem:p}=ot(),{inputId:b,isLabeledByFormItem:c}=lt(t,{formItemContext:p}),v=i=>{u(ae,i),De(()=>u("change",i))};Ue(()=>{const i=d.value.querySelectorAll("[type=rLine truncated
@@ -1 +0,0 @@
.left-menu{margin-bottom:1rem;cursor:pointer;text-align:center;font-weight:700;font-size:1rem;letter-spacing:.4rem}small,.el-form-item__content{color:#909399;margin-left:.4rem}
@@ -1 +0,0 @@
import{E as w,b as z}from"./el-input-CNNwOXGP.js";import{E as S,a as h}from"./el-form-item-llYGp2SQ.js";import"./el-tag-5pOVEKUY.js";import{E as A,a as C}from"./el-select-LRJf3l5x.js";import"./el-popper-C96qJ_vz.js";import{a as E,a8 as B,s as D,g as V,w as o,af as b,B as e,P as v,Q as N,j as s,ac as M,ab as T,N as i,U as f,R as m,aF as y,o as _}from"./index-CxMsK_Ni.js";import"./_baseClone-DD6IrDYX.js";const F={style:{display:"flex",height:"38px",width:"45%"}},I={style:{display:"flex",height:"38px","margin-left":"20px"}},K={style:{"margin-left":"0.4rem"}},O={style:{"margin-left":"0.4rem"}},j={style:{"margin-left":"0.4rem"}},q={key:0},L={style:{display:"flex",height:"38px"}},P={style:{"margin-right":"0.4rem"}},Q={style:{width:"200px","margin-left":"0.4rem"}},R={style:{display:"flex",height:"38px"}},G={style:{width:"3rem","margin-right":"0.4rem"}},H={style:{width:"200px","margin-left":"0.4rem"}},J={style:{display:"flex",height:"38px"}},W={style:{"margin-right":"0.4rem"}},X={style:{width:"200px","margin-left":"0.4rem"}},Y={style:{display:"flex",height:"38px"}},Z={style:{width:"3rem","margin-right":"0.4rem"}},$={style:{width:"200px","margin-left":"0.4rem"}},ue=E({__name:"SettingView",setup(c){const{t:n}=B(),l=D({name:"",description:"",file_storage:"",expireStyle:[],themesChoices:[],themesSelect:"",admin_token:"",robotsText:"",keywords:"",notify_title:"",notify_content:"",openUpload:1,uploadSize:1,uploadMinute:1,max_save_seconds:0,opacity:.9,s3_access_key_id:"",background:"",showAdminAddr:0,page_explain:"",s3_secret_access_key:"",aws_session_token:"",s3_signature_version:"",s3_region_name:"",s3_bucket_name:"",s3_endpoint_url:"",s3_hostname:"",uploadCount:1,errorMinute:1,errorCount:1});(()=>{b({url:"/admin/config/get",method:"get"}).then(p=>{l.value=p.detail})})();const x=()=>{b({url:"/admin/config/update",method:"patch",data:l.value}).then(p=>{p.code==200?y.success(n("admin.settings.saveSuccess")):y.error(p.message)})};return(p,a)=>{const u=w,d=h,r=C,g=A,U=z,k=S;return _(),V(k,null,{default:o(()=>[e(d,{size:"large",label:s(n)("admin.settings.name")},{default:o(()=>[e(u,{modelValue:l.value.name,"onUpdate:modelValue":a[0]||(a[0]=t=>l.value.name=t)},null,8,["modelValue"])]),_:1},8,["label"]),e(d,{size:"large",label:s(n)("admin.settings.description")},{default:o(()=>[e(u,{modelValue:l.value.description,"onUpdate:modelValue":a[1]||(a[1]=t=>l.value.description=t)},null,8,["modelValue"])]),_:1},8,["label"]),e(d,{size:"large",label:s(n)("admin.settings.keywords"),style:{"letter-spacing":"0.3rem"}},{default:o(()=>[e(u,{modelValue:l.value.keywords,"onUpdate:modelValue":a[2]||(a[2]=t=>l.value.keywords=t)},null,8,["modelValue"])]),_:1},8,["label"]),e(d,{size:"large",label:s(n)("admin.settings.themeSelect")},{default:o(()=>[e(g,{modelValue:l.value.themesSelect,"onUpdate:modelValue":a[3]||(a[3]=t=>l.value.themesSelect=t),style:{width:"100%"}},{default:o(()=>[(_(!0),v(T,null,M(l.value.themesChoices,t=>(_(),V(r,{label:t.name,value:t.key},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])]),_:1},8,["label"]),e(d,{size:"large",label:s(n)("admin.settings.notify_title")},{default:o(()=>[e(u,{modelValue:l.value.notify_title,"onUpdate:modelValue":a[4]||(a[4]=t=>l.value.notify_title=t)},null,8,["modelValue"])]),_:1},8,["label"]),e(d,{size:"large",label:s(n)("admin.settings.notify_content")},{default:o(()=>[e(u,{modelValue:l.value.notify_content,"onUpdate:modelValue":a[5]||(a[5]=t=>l.value.notify_content=t)},null,8,["modelValue"])]),_:1},8,["label"]),e(d,{size:"large",label:s(n)("admin.settings.background")},{default:o(()=>[i("span",F,[e(u,{modelValue:l.value.background,"onUpdate:modelValue":a[6]||(a[6]=t=>l.value.background=t),placeholder:"url"},null,8,["modelValue"])]),i("span",I,[a[29]||(a[29]=f(" Opacity: ")),e(u,{type:"number",modelValue:l.value.opacity,"onUpdate:modelValue":a[7]||(a[7]=t=>l.value.opacity=t)},null,8,["modelValue"])])]),_:1},8,["label"]),e(d,{size:"large",label:s(n)("admin.settings.showAdminAddr")},{default:o(()=>[e(g,{modelValue:l.value.showAdminAddr,"onUpdate:modelValue":a[8]||(a[8]=t=>l.value.showAdminAddr=t),style:{width:"80%"}},{default:o(()=>[e(r,{label:s(n)("admin.settings.showAdmin.open"),value:1},null,8,["label"]),e(r,{label:s(n)("admin.settings.showAdmin.close"),value:0},null,8,["label"])]),_:1},8,["modelValue"]),i("small",K,m(s(n)("admin.settings.showAdmin.note")),1)]),_:1},8,["label"]),e(d,{size:"large",label:"robots.Text"},{default:o(()=>[e(u,{type:"textarea",modelValue:l.value.robotsText,"onUpdate:modelValue":a[9]||(a[9]=t=>l.value.robotsText=t),placeholder:"explain"},null,8,["modelValue"])]),_:1}),e(d,{size:"large",label:s(n)("admin.settings.explain")},{default:o(()=>[e(u,{type:"textarea",modelValue:l.value.page_explain,"onUpdate:modelValue":a[10]||(a[10]=t=>l.value.page_explain=t),placeholder:"explain"},null,8,["modelValue"])]),_:1},8,["label"]),e(d,{size:"large",label:s(n)("admin.settings.admin_token")},{default:o(()=>[e(u,{type:"password",modelValue:l.value.admin_token,"onUpdate:modelValuLine truncated
Loaded 100 of 144 files, more files were not shown because too many files have changed in this diff. Show more