diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7635e5e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +target/ +*/target/ +.git/ +.codegraph/ +diff/ +.idea/ +*.iml +dependency-reduced-pom.xml +wordpdf-web/node_modules +wordpdf-web/dist diff --git a/.gitignore b/.gitignore index b0958c1..56ac072 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,10 @@ target/ dependency-reduced-pom.xml +# Node (wordpdf-web) +node_modules/ +wordpdf-web/dist/ + # IDE .idea/ *.iml diff --git a/AGENTS.md b/AGENTS.md index d7bbcf3..fe83b82 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ ## Project Overview -Конвертер `.docx` → `.pdf` на чистом Java (docx4j + Apache FOP, без LibreOffice/Aspose). Java 17, только Maven. Модули: `wordpdf-core` (библиотека), `wordpdf-cli` (fat-jar через maven-shade). Единственный гейт перед `git push` — `mvn clean verify` (CI/lint в репозитории нет). +Конвертер `.docx` → `.pdf` на чистом Java (docx4j + Apache FOP, без LibreOffice/Aspose). Java 21, только Maven. Модули: `wordpdf-core` (библиотека), `wordpdf-app` (Spring Boot REST API); плюс `wordpdf-web` — React SPA в nginx-контейнере (отдельный деп, вне Maven). Единственный гейт перед `git push` — `mvn clean verify` (CI/lint в репозитории нет; SPA гейтуется `npm run build`). ## Architecture & Data Flow @@ -21,16 +21,21 @@ → `Docx4J.toFO(..., FLAG_EXPORT_PREFER_XSL)`. 5. `finally`: `deleteEmbeddedFontTempFiles()` (в 17.x `OpcPackage.close()` нет). +### REST API (`wordpdf-app`) + +- Конвертации **сериализованы** однопоточным `ThreadPoolExecutor` (очередь 16, переполнение → 503): ядро мутирует глобальный реестр `PhysicalFonts` (шаг 1 пайплайна), параллельные конвертации вырывают его друг у друга из-под рендера. +- Разделение ошибок: валидация байтов до очереди (`WordPdfValidator.checkInput(byte[])` + проверка zip-подписи + `checkPageCountLightweight(byte[])`) → `ValidationException` → 400; ошибки ядра/рендера → `ConversionFailedException` → 500; очередь занята → 503; таймаут (`wordpdf.convert-timeout`, 2m) → 504. Граница: сломанный контейнер → 400, валидный zip с мусором внутри → 500. +- Фронт ходит только на относительный `/api/...` — CORS не нужен (dev: vite-proxy → :8080; prod: nginx). + ### Критические инварианты (нарушение = битый вывод) - **`docx4j.convert.out.fo.gsubFeatures=false`** — ставится в статическом блоке `WordPdfConverter`. Иначе docx4j навешивает `fox:gsub-features` без объявления префикса → FO невалиден → `WordLayoutFixups` молча отказывается от всех фиксов → FOP падает на `docx4j-baseline`. Без фиксов нет колонок и колонок таблиц. -- **`ServicesResourceTransformer` в maven-shade (`wordpdf-cli`) обязателен**: `META-INF/services/org.apache.fop.fo.ElementMapping` дублируется в `docx4j-fo-renderer-core` и `docx4j-export-fo`; без слияния FOP падает на `UnknownXMLObj cannot be cast to Root`. В fat-jar из тестов не видно — проверять `java -jar`. -- **Не убирать shade-фильтры `META-INF/*.SF|*.DSA|*.RSA`** — подписанные jar ломают fat-jar. -- **`slf4j-simple` обязателен**: без него docx4j пишет «TO HIDE THESE MESSAGES» прямо в выходной PDF (регрессия `noLoggingWarningInPdf`). +- **`slf4j-simple` обязателен** в ядре: без него docx4j пишет «TO HIDE THESE MESSAGES» прямо в выходной PDF (регрессия `noLoggingWarningInPdf`). Приложение (`wordpdf-app`) исключает `slf4j-simple` из зависимости ядра — логи ведёт logback из Boot; предупреждение в PDF возникает только при полном отсутствии SLF4J-провайдера, `slf4j-simple.properties` из core остаётся инертным ресурсом. - **JAXB-обход обязан раскрывать `JAXBElement`** (иначе таблицы/раны молча пропускаются — оценка «1» вместо 121). Рекурсия через `ContentAccessor` из `org.docx4j.wml` (НЕ `org.docx4j.contentcontrol` — в 17.x его нет). Тип секции — `SectPr$Type.getVal()`; маркер — `R.LastRenderedPageBreak` (`CTLastRenderedPageBreak` в 17.x отсутствует). - FOP — форк `org.docx4j:docx4j-fo-renderer*` 2.11-docx4j.2 (пакеты `org.apache.fop.*`), умеет хинты `docx4j:baseline`/`docx4j:line-box`. `Fop.Renderers.getRenderer()` возвращает **список** — `FopFallbackFonts.rendererFonts` ищет `application/pdf`. - `docx2fo.xslt` в репозитория нет — он в jar `docx4j-export-fo`. `WordLayoutFixups` (включён по умолчанию в 17.x) постобработкой DOM FO даёт реальные колонки `w:cols/@w:num` и колонки таблиц; побочный эффект — авто-ширины колонок без `tblGrid`/`tcW` стали уже (слово может перенестись в ячейке). - Известный остаток эталона: U+2188 (ↈ) и U+218A (↊) — глифов нет ни в одном OFL-шрифте бандла, остаются `.notdef` (GNU FreeSerif GPL — не добавляем намеренно). +- **nginx `client_max_body_size 6m`** (`wordpdf-web/nginx.conf`) обязателен: без него upload > 1 МБ режется HTML-413 от nginx до бэкенда вместо JSON-ошибки API. ### Шрифты (30 TTF в `wordpdf-core/src/main/resources/fonts/`, SIL OFL) @@ -56,7 +61,10 @@ | `…/wordpdf/internal/chart/` | Java2D-рендер диаграмм/SmartArt в PNG | | `wordpdf-core/src/main/resources/fonts/` | 30 TTF + лицензии — бинарные фикстуры, часть jar | | `wordpdf-core/src/test/resources/samples/` | 11 закоммиченных `.docx`-фикстур (единственные фикстуры) | -| `wordpdf-cli/src/main/java/…/cli/` | `WordPdfCli` (fat-jar) | +| `wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/` | REST API: `ConvertController`, `ConversionService` (очередь), `ApiExceptionHandler` | +| `wordpdf-web/src/` | SPA (React+TS+Vite+Tailwind): компоненты в `components/`, вся сеть в `api.ts` | +| корневые `Dockerfile`, `docker-compose.yml` | образ бэкенда (multi-stage, temurin-21); compose web+app | +| `wordpdf-web/Dockerfile`, `wordpdf-web/nginx.conf` | образ SPA (node→nginx); прокси `/api`, `/swagger-ui`, `/v3/api-docs` | | `references/` | эталон Word 365 (`word.docx` + `word.pdf`) — **ручное сравнение, не фикстуры**, в тесты/jar не подключать | | `diff/`, корневые `word-export.*` | gitignored артефакты ручной калибровки | @@ -64,14 +72,14 @@ ```bash mvn clean verify # все модули + тесты — обязательный гейт перед push -mvn -pl wordpdf-cli package # fat-jar (из корня); из каталога cli — только с -am -java -jar wordpdf-cli/target/wordpdf-cli-1.0.0.jar in.docx [out.pdf] +mvn -pl wordpdf-app -am package # исполняемый jar бэкенда +java -jar wordpdf-app/target/wordpdf-app-1.0.0.jar # :8080, POST /api/v1/convert +npm run dev # (wordpdf-web/) SPA :5173, proxy /api → :8080 +docker compose up -d --build # всё вместе: SPA+nginx публикует :8080, app не публикуется mvn -pl wordpdf-core test -Dtest=WordPdfConverterTest#pageNumbers_recomputedNotCached # один тест ``` -CLI: 1 аргумент → PDF рядом с исходником; 2-й `.pdf` → явный выход; **два `.docx` = пакетная конвертация**. Коды возврата: 0 успех, 1 ошибка использования, 2 не сконвертирован хотя бы один файл. - -`dependency-reduced-pom.xml` — артефакт shade, не коммитить. +Compose: `web` проксирует `/api`, `/swagger-ui`, `/v3/api-docs` на `app` (DNS-имя в сети compose); бэкенд наружу не публикуется. `wordpdf.convert-timeout` переопределяется env `WORDPDF_CONVERT_TIMEOUT` (relaxed binding Boot). Пересоздать 10 фикстур (POI, test scope; `charts-smartart.docx` НЕ генерируется — исключение): @@ -83,35 +91,35 @@ java -cp wordpdf-core/target/test-classes:$(cat /tmp/cp.txt) \ ## Code Conventions & Common Patterns -- Классы `final`, приватный конструктор, только `static` (stateless, DI нет; конфигурация — `Docx4jProperties` + classpath-ресурсы). Исключения — экземпляры по природе docx4j: `BundledFontMapper` (наследник `BestMatchingMapper`), `DrawMlColor` (палитра темы). +- Классы `final`, приватный конструктор, только `static` (stateless, DI нет; конфигурация — `Docx4jProperties` + classpath-ресурсы). Исключения — экземпляры по природе: docx4j-классы `BundledFontMapper` (наследник `BestMatchingMapper`), `DrawMlColor` (палитра темы) и Spring-компоненты `wordpdf-app`. - Нормализаторы — единая сигнатура `public static byte[] normalize(byte[] docx) throws IOException` с флагом `changed`: нечего менять → вернуть **тот же массив** (`assertSame` в тестах); package-private хук `static String rewrite(String xml)` для юнит-тестов. - Ошибки публичного API — только `ConversionException extends RuntimeException`; внутренние `IOException`/`IllegalStateException` оборачиваются на границе. В chart — деградация вместо падения: неизвестный пресет → прямоугольник + лог. - Javadoc на русском, объясняет «почему» и ссылается на регрессию и фикстуру (формат: `Регрессия — WordPdfConverterTest#имя, фикстура samples/….docx`) — новый фикс оформлять так же. - Константы UPPER_SNAKE с числовыми эталонными значениями (`CAMERA_DISTANCE`, `MAX_PAGES`); начертания `V_REGULAR/V_BOLD/...`; модели — `record`; размеры в chart — в пунктах, растр × `DPI/72`. - Внутренние API package-private; наружу из `internal` торчат только `normalize`/`declare`/`DrawingPreRenderer.run`. -- `WordPdfCli.main` тонко обёртывает `public static int run(String[])` — CLI тестируется без `System.exit`. +- В `wordpdf-app` всё package-private (контроллер, advice, service, исключения); в SPA вся сетевая логика только в `src/api.ts` — компоненты `fetch` не вызывают. ## Important Files - `wordpdf-core/src/main/java/ru/pjandro/wordpdf/WordPdfConverter.java` — точка входа библиотеки + static-блок `gsubFeatures`. -- `wordpdf-cli/pom.xml` — shade: Main-Class, `ServicesResourceTransformer`, фильтры подписей. -- Корневой `pom.xml` — все версии зависимостей (в модулях версии не объявлять): docx4j `17.3.0`, slf4j `2.0.17`, JUnit `5.12.2`, PDFBox `3.0.7` (test), POI `5.5.1` (test, только генератор фикстур); форки FOP/jeuclid приходят транзитивно с `docx4j-export-fo`, пинить не надо. +- `wordpdf-app/pom.xml` — `spring-boot-maven-plugin` с **явной** execution `repackage` (в 4.1.1 сам не связывается, jar останется тонким); `slf4j-simple` исключён из зависимости ядра. +- Корневой `pom.xml` — все версии зависимостей (в модулях версии не объявлять): docx4j `17.3.2`, slf4j `2.0.20`, JUnit `6.1.3`, PDFBox `3.0.8` (test), POI `5.5.1` (test, только генератор фикстур), Spring Boot `4.1.1` (BOM-import), springdoc `3.1.1`; форки FOP/jeuclid приходят транзитивно с `docx4j-export-fo`, пинить не надо. - `wordpdf-core/src/main/resources/slf4j-simple.properties` — без него предупреждение лезет в PDF. - `wordpdf-core/src/test/java/ru/pjandro/wordpdf/SampleDocxGenerator.java` — main()-утилита пересоздания фикстур (команда в javadoc). ## Runtime & Tooling Preferences -- Java 17 + Maven (обязательны; wrapper `mvnw` нет). UTF-8. +- Java 21 + Maven (обязательны; wrapper `mvnw` нет). UTF-8. Фронт: Node.js ≥ 20.19 (Vite 7+), вне Maven-депа. - Только Maven (никакого Gradle/Ant); новые зависимости — latest stable, версии только в корневой `dependencyManagement`. - CI, линтеров, форматтеров, checkstyle — нет; проверка одна: `mvn clean verify`. -- Fat-jar проверять только `java -jar` (тесты идут по classpath и shade-проблем не видят). +- Исполняемый jar бэкенда проверять только `java -jar` (тесты идут по classpath и repackage-специфику не видят). ## Testing & QA -- JUnit 5, surefire c `-Djava.awt.headless=true`; только `Assertions` (без Mockito/AssertJ), package-private тесты в mirror-пакетах. +- JUnit 6 (`org.junit.jupiter:junit-jupiter`), surefire c `-Djava.awt.headless=true`; только `Assertions` (без Mockito/AssertJ, несмотря на test-классpath Boot), package-private тесты в mirror-пакетах. - **PDF сравнивается текстом, не растеризацией**: PDFBox `PDFTextStripper` для текста, override `processTextPosition` для шрифта конкретного символа (`fontNameOf`), обход ресурсов страницы для встроенных шрифтов (`EAAAAA+Carlito-Bold`) и счётчика картинок. Негативные маркеры — регрессии: `assertFalse(text.contains("#"))` (.notdef), `assertFalse(font.startsWith("Helvetica"))`. Пиксели — только в unit-тестах chart-пейнтеров (там сам код — Java2D); допуски 6–10%. - Текст нормализуется по пробелам (`tableImage_tableAndImage` — полное удаление пробелов: docx4j переносит слова в auto-fit таблицах). - Фикстуры — закоммиченные `samples/*.docx` (не генерировать в тестах); classpath → временный файл (`extractSample`/`extractToTemp`). In-memory docx — `ZipOutputStream` из литеральных XML или POI в `byte[]` (`WordPdfValidatorTest`). - Юниты нормализаторов работают строками (`rewrite`) и проверяют контракт «нечего менять → null / тот же массив» и неприкосновенность `[Content_Types].xml`. -- Тесты `wordpdf-cli` берут фикстуры из test-jar core (classifier `tests`) → `-pl wordpdf-cli` без `-am` не соберётся; проверять коды возврата `WordPdfCli.run`. +- Тесты `wordpdf-app` (`ConvertControllerTest`, MockMvc) берут фикстуры из test-jar core (classifier `tests`) → `-pl wordpdf-app` без `-am` не соберётся. Гейт SPA — `npm run build` (tsc -b); UI-тестов нет. - Каждый фикс бага docx4j/FOP сопровождается: байтовый нормализатор/pre-renderer + регрессионный тест с фикстурой + javadoc-ссылка. Проверенные пары: `DocxOnOffNormalizerTest`/`ruPlain_regularRunsUseRegularFont`, `FieldNormalizerTest`/`pageNumbers_recomputedNotCached`, `SymbolFontNormalizerTest`/`symbolFonts_bulletsAreNotHash`, `GlyphCoverageNormalizerTest`/`exoticGlyphs_drawnNotHash`, `WordPdfValidatorTest`/`staleCachePageCountRejectedBeforeRender`, `BundledFontsTest`/`noLoggingWarningInPdf`, `Surface3dPainterTest`/`chartsSmartArt_drawingsBecomeImages`. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2f24f3a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM maven:3.9-eclipse-temurin-21 AS build +WORKDIR /build +COPY pom.xml . +COPY wordpdf-core/pom.xml wordpdf-core/ +COPY wordpdf-app/pom.xml wordpdf-app/ +RUN mvn -B -q dependency:go-offline +COPY . . +RUN mvn -B -q -DskipTests package + +FROM eclipse-temurin:21-jre +# curl — только для HEALTHCHECK; runtime полный jre (не alpine-slim): Java2D +# chart-движка нужны AWT и fontconfig-нативки; бандл-шрифты лежат в jar, +# системные шрифты не нужны. Тесты в образе не гоняем — гейт mvn clean verify. +# Прокси из docker-config подмешивается в HEALTHCHECK-шелл и ломает curl +# (127.0.0.1:proxy внутри контейнера недоступен) — обнуляем на команде. +RUN apt-get update \ + && apt-get install -y --no-install-recommends curl \ + && rm -rf /var/lib/apt/lists/* \ + && useradd -r -u 10001 app +WORKDIR /app +COPY --from=build /build/wordpdf-app/target/wordpdf-app-1.0.0.jar app.jar +USER app +EXPOSE 8080 +HEALTHCHECK --interval=10s --timeout=3s --start-period=45s --retries=5 \ + CMD HTTP_PROXY= http_proxy= HTTPS_PROXY= https_proxy= curl -fsS http://127.0.0.1:8080/v3/api-docs >/dev/null || exit 1 +ENTRYPOINT ["java", "-Djava.awt.headless=true", "-jar", "/app/app.jar"] diff --git a/README.md b/README.md index e79d56e..f9b2c43 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,16 @@ LibreOffice/Aspose. Шрифты упакованы в jar — конверта в docx4j/FOP. - Частые MS-шрифты подменяются метрически совместимыми open-source аналогами (см. «Шрифты» ниже). -- Клиентская библиотека (`wordpdf-core`) и CLI (`wordpdf-cli`, fat-jar). +- Клиентская библиотека (`wordpdf-core`), REST API (`wordpdf-app`, Spring Boot) + и веб-интерфейс (`wordpdf-web`, React SPA). ## Структура ``` java-word-pdf/ ├── wordpdf-core/ библиотека: конвертер, шрифты, маппинг -└── wordpdf-cli/ командная строка (fat-jar через maven-shade) +├── wordpdf-app/ REST API: POST /api/v1/convert (Spring Boot, Swagger UI) +└── wordpdf-web/ веб-интерфейс (React + TypeScript + Vite + Tailwind, вне Maven) ``` Ключевые классы (`wordpdf-core`): @@ -34,28 +36,39 @@ java-word-pdf/ ## Сборка -Требуется **Java 17** и **Maven**. +Требуется **Java 21** и **Maven** (бэкенд), **Node.js ≥ 20.19** (веб-интерфейс). ```bash -mvn clean verify # сборка всех модулей + тесты -mvn -pl wordpdf-cli package # только fat-jar CLI +mvn clean verify # все модули + тесты +mvn -pl wordpdf-app -am package # исполняемый jar бэкенда ``` -Результат: `wordpdf-cli/target/wordpdf-cli-<версия>.jar` (fat-jar, все -зависимости внутри). +Результат: `wordpdf-app/target/wordpdf-app-<версия>.jar` (все зависимости +внутри). Для фронтенда — отдельный деп: `npm install && npm run build` +в `wordpdf-web/` (результат — статика в `wordpdf-web/dist/`). ## Использование -### CLI +### REST API ```bash -java -jar wordpdf-cli-1.0.0.jar in.docx # рядом создаётся in.pdf -java -jar wordpdf-cli-1.0.0.jar in.docx out.pdf # в указанный файл -java -jar wordpdf-cli-1.0.0.jar a.docx b.docx # пакетно: каждый -> свой .pdf +java -jar wordpdf-app/target/wordpdf-app-1.0.0.jar +curl -F "file=@doc.docx" http://localhost:8080/api/v1/convert -o doc.pdf ``` -Коды возврата: `0` — успех, `1` — ошибка использования, `2` — не удалось -конвертировать хотя бы один файл. +`POST /api/v1/convert` принимает multipart-поле `file` (.docx) и синхронно +возвращает байты PDF (`application/pdf`, attachment). + +|Код|Смысл| +|---|---| +|200|PDF в теле ответа| +|400|некорректный вход: не .docx / пустой / не zip / > 5 МБ / > 100 страниц| +|413|тело запроса больше контейнерного лимита multipart (6 МБ)| +|503|очередь конвертации занята — повторить позже| +|504|конвертация дольше таймаута (`wordpdf.convert-timeout`, по умолчанию 2m)| + +Ошибки — JSON `{"error": "..."}`. Интерактивная документация: +Swagger UI — `/swagger-ui.html`, OpenAPI — `/v3/api-docs`. ### Библиотека @@ -69,6 +82,20 @@ WordPdfConverter.convert(Path.of("doc.docx"), Path.of("out.pdf")); // явный Ошибки валидации (не `.docx`, файл не найден) бросают `ConversionException`. +### Веб-интерфейс и Docker + +```bash +docker compose up -d --build +``` + +Всё на `http://localhost:8080/`: nginx-контейнер `web` раздаёт SPA и проксирует +`/api`, `/swagger-ui`, `/v3/api-docs` на бэкенд (контейнер `app` наружу не +публикуется). + +Dev-режим без Docker: бэкенд `java -jar wordpdf-app/target/wordpdf-app-1.0.0.jar` +(порт 8080) + `npm run dev` в `wordpdf-web/` → `http://localhost:5173` +(Vite проксирует `/api` на 8080, CORS не нужен). + ## Шрифты В `wordpdf-core/src/main/resources/fonts/` упакованы 30 TTF: 7 текстовых @@ -139,3 +166,6 @@ docx ──> нормализация байтов ──> docx4j (Wordprocessin Тесты используют готовые `.docx` из `wordpdf-core/src/test/resources/samples/` (генерируются POI) и проверяют извлечённый PDFBox'ом текст и встраивание шрифтов. Запуск: `mvn test`. + +API (`wordpdf-app`) проверяется `MockMvc`-сквозняками (`ConvertControllerTest`) +на тех же фикстурах — ядро отдаёт их test-jar'ом. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0749efa --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +name: wordpdf +services: + app: + build: . + restart: unless-stopped + web: + build: ./wordpdf-web + ports: ["8080:80"] + depends_on: + app: + condition: service_healthy + restart: unless-stopped diff --git a/pom.xml b/pom.xml index 693e6dc..5f90257 100644 --- a/pom.xml +++ b/pom.xml @@ -14,32 +14,49 @@ wordpdf-core - wordpdf-cli + wordpdf-app - 17 - 17 + 21 UTF-8 - 17.3.0 - 2.0.17 + 17.3.2 + 2.0.20 + + + 4.1.1 + 3.1.1 - 5.12.2 - 3.0.7 + 6.1.3 + 3.0.8 5.5.1 + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + org.springdoc + springdoc-openapi-starter-webmvc-ui + ${springdoc.version} + org.docx4j docx4j-core ${docx4j.version} - + org.docx4j docx4j-JAXB-ReferenceImpl @@ -83,12 +100,12 @@ org.apache.maven.plugins maven-compiler-plugin - 3.15.0 + 3.16.0 org.apache.maven.plugins maven-surefire-plugin - 3.5.6 + 3.6.0 -Djava.awt.headless=true @@ -97,12 +114,12 @@ org.apache.maven.plugins maven-jar-plugin - 3.4.2 + 3.5.1 - org.apache.maven.plugins - maven-shade-plugin - 3.6.2 + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} diff --git a/wordpdf-app/pom.xml b/wordpdf-app/pom.xml new file mode 100644 index 0000000..065c8dc --- /dev/null +++ b/wordpdf-app/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + + + ru.pjandro + java-word-pdf + 1.0.0 + + + wordpdf-app + wordpdf-app + REST API поверх wordpdf-core: POST /api/v1/convert (Spring Boot, Swagger UI) + + + + ru.pjandro + wordpdf-core + ${project.version} + + + + org.slf4j + slf4j-simple + + + + + + org.springframework.boot + spring-boot-starter-webmvc + + + + org.springdoc + springdoc-openapi-starter-webmvc-ui + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.boot + spring-boot-webmvc-test + test + + + + ru.pjandro + wordpdf-core + ${project.version} + tests + test-jar + test + + + + org.apache.pdfbox + pdfbox + test + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + repackage + + repackage + + + + + + + diff --git a/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ApiExceptionHandler.java b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ApiExceptionHandler.java new file mode 100644 index 0000000..1c05e8c --- /dev/null +++ b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ApiExceptionHandler.java @@ -0,0 +1,82 @@ +package ru.pjandro.wordpdf.app; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.MissingServletRequestParameterException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.multipart.MaxUploadSizeExceededException; +import org.springframework.web.multipart.support.MissingServletRequestPartException; + +/** + * Единый перевод исключений в JSON {@code {"error": "..."}} с кодом по смыслу. + * + *

Голый {@code ru.pjandro.wordpdf.ConversionException} ядра сюда не доходит: + * контроллер и {@link ConversionService} превращают его на границе в + * {@link ValidationException}/{@link ConversionFailedException}; случайная + * утечка попадёт в обработчик {@link Exception} (500).

+ */ +@RestControllerAdvice +final class ApiExceptionHandler { + + private static final Logger log = LoggerFactory.getLogger(ApiExceptionHandler.class); + + /** Тело ответа ошибки; Jackson сериализует record как есть. */ + record ApiError(String error) { + } + + /** Некорректный вход: пустой, не .docx, не zip, битый zip, > 5 MiB, > 100 страниц. */ + @ExceptionHandler(ValidationException.class) + ResponseEntity validation(ValidationException e) { + return ResponseEntity.badRequest().body(new ApiError(e.getMessage())); + } + + /** Ошибка ядра/рендера при формально корректном входе. */ + @ExceptionHandler(ConversionFailedException.class) + ResponseEntity conversionFailed(ConversionFailedException e) { + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) + .body(new ApiError(e.getMessage())); + } + + /** Очередь конвертации занята/прерывание — повторить позже. */ + @ExceptionHandler(ConversionRejectedException.class) + ResponseEntity rejected(ConversionRejectedException e) { + return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE) + .body(new ApiError(e.getMessage())); + } + + /** Конвертация дольше {@code wordpdf.convert-timeout}. */ + @ExceptionHandler(ConversionTimeoutException.class) + ResponseEntity timeout(ConversionTimeoutException e) { + return ResponseEntity.status(HttpStatus.GATEWAY_TIMEOUT) + .body(new ApiError(e.getMessage())); + } + + /** + * Контейнерный лимит multipart (6 МБ в application.properties) сработал + * раньше ядра: текст свой, смысл тот же, что у 400 от {@code WordPdfValidator}. + */ + @ExceptionHandler(MaxUploadSizeExceededException.class) + ResponseEntity tooLarge(MaxUploadSizeExceededException e) { + return ResponseEntity.status(HttpStatus.PAYLOAD_TOO_LARGE) + .body(new ApiError("Файл больше 5 МБ")); + } + + /** Партита {@code file} нет в запросе — обе формы исключения возможны. */ + @ExceptionHandler({MissingServletRequestPartException.class, + MissingServletRequestParameterException.class}) + ResponseEntity missingFile(Exception e) { + return ResponseEntity.badRequest() + .body(new ApiError("Файл не передан (multipart-поле «file» обязательно)")); + } + + /** Прочее — внутренняя ошибка; подробность только в лог, не в ответ. */ + @ExceptionHandler(Exception.class) + ResponseEntity unexpected(Exception e) { + log.error("Необработанное исключение в API", e); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) + .body(new ApiError("Внутренняя ошибка конвертации")); + } +} diff --git a/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionFailedException.java b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionFailedException.java new file mode 100644 index 0000000..63db834 --- /dev/null +++ b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionFailedException.java @@ -0,0 +1,21 @@ +package ru.pjandro.wordpdf.app; + +/** + * Ошибка преобразования: контейнер .docx принят валидацией, но упал сам + * рендер (ядро, FOP, повреждённое содержимое внутри валидного zip). + * + *

Смысл отличается от {@link ValidationException}: вход формально корректен, + * отказал движок конвертации. Маппится в HTTP 500 ({@link ApiExceptionHandler}).

+ * + *

Регрессия — ConvertControllerTest#junkInsideValidZip_conversionError.

+ */ +class ConversionFailedException extends RuntimeException { + + ConversionFailedException(String message, Throwable cause) { + super(message, cause); + } + + ConversionFailedException(Throwable cause) { + super("Внутренняя ошибка конвертации", cause); + } +} diff --git a/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionRejectedException.java b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionRejectedException.java new file mode 100644 index 0000000..616a227 --- /dev/null +++ b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionRejectedException.java @@ -0,0 +1,15 @@ +package ru.pjandro.wordpdf.app; + +/** + * Очередь конвертации переполнена ({@code ConversionService.QUEUE_CAPACITY}) + * либо поток ожидания был прерван — сервис временно не может принять задачу. + * + *

Маппится в HTTP 503 ({@link ApiExceptionHandler}); клиенту осмысленно + * повторить тот же запрос позже.

+ */ +class ConversionRejectedException extends RuntimeException { + + ConversionRejectedException() { + super("Сервис конвертации занят — повторите позже"); + } +} diff --git a/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionService.java b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionService.java new file mode 100644 index 0000000..1e0aee4 --- /dev/null +++ b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionService.java @@ -0,0 +1,204 @@ +package ru.pjandro.wordpdf.app; + +import jakarta.annotation.PreDestroy; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import ru.pjandro.wordpdf.ConversionException; +import ru.pjandro.wordpdf.WordPdfConverter; +import ru.pjandro.wordpdf.WordPdfValidator; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.Duration; +import java.util.Locale; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +/** + * Конвертация .docx-байтов в PDF-байты поверх {@code wordpdf-core}. + * + *

Конвертации СЕРИАЛИЗОВАНЫ однопоточным executor'ом — не «на всякий + * случай»: каждая конвертация мутирует ГЛОБАЛЬНЫЙ реестр шрифтов docx4j + * ({@code new BundledFontMapper()} заново добавляет системные шрифты + * в {@code PhysicalFonts}, {@code BundledFonts.init()/restrictToBundled()} + * их вычищают — WordPdfConverter.java:125-130). Параллельные конвертации + * вырывают реестр друг у друга из-под рендера, ядро не потокобезопасно + * by design. Регрессия — ConvertControllerTest#concurrentRequests_bothSucceed.

+ * + *

Ошибки разделены по смыслу (требование к API): некорректный вход → + * {@link ValidationException} (400), ошибка рендер-стадии → + * {@link ConversionFailedException} (500). Граница: сломанный контейнер + * (не zip / битый zip / слишком большой / слишком длинный) — 400; валидный + * zip с мусором внутри (нет {@code word/document.xml}) — 500: lightweight- + * подсчёт страниц согласован с JAXB-путём ядра (может только завышать), + * поэтому уже принятый запрос внутренняя проверка ядра в ошибку не превратит.

+ */ +@Service +final class ConversionService { + + /** Сколько запросов ждут свободный воркер, прежде чем получить 503. */ + static final int QUEUE_CAPACITY = 16; + + private final ThreadPoolExecutor workers; + private final Duration timeout; + + ConversionService(@Value("${wordpdf.convert-timeout:2m}") Duration timeout) { + this.timeout = timeout; + this.workers = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, + new ArrayBlockingQueue<>(QUEUE_CAPACITY)); + } + + /** + * Полный путь: синхронная валидация байтов (до очереди — от obvious-отказа + * единый воркер не должен быть занят) → постановка в очередь → ожидание + * результата с таймаутом. + * + * @throws ValidationException некорректный вход (400) + * @throws ConversionFailedException ошибка ядра/рендера (500) + * @throws ConversionRejectedException очередь полна / прерывание (503) + * @throws ConversionTimeoutException конвертация дольше {@code wordpdf.convert-timeout} (504) + */ + byte[] convert(byte[] docxBytes, String originalFilename) { + validate(docxBytes); + Future future; + try { + future = workers.submit(() -> doConvert(docxBytes, originalFilename)); + } catch (RejectedExecutionException e) { + throw new ConversionRejectedException(); + } + try { + return future.get(timeout.toMillis(), TimeUnit.MILLISECONDS); + } catch (TimeoutException e) { + // cancel(true) не гарантирует мгновенной остановки FOP-рендера: + // воркер может ещё поработать на отменённой задаче. Принято + // осознанно — защита от зависания важнее точности отмены. + future.cancel(true); + throw new ConversionTimeoutException(timeout); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + future.cancel(true); + throw new ConversionRejectedException(); + } catch (ExecutionException e) { + Throwable cause = e.getCause(); + if (cause instanceof ValidationException ve) { + throw ve; + } + if (cause instanceof ConversionFailedException cfe) { + throw cfe; + } + if (cause instanceof ConversionRejectedException cre) { + throw cre; + } + if (cause instanceof ConversionTimeoutException cte) { + throw cte; + } + // любой прочий выход из воркера (в т.ч. не завёрнутый + // ConversionException ядра) — внутренняя ошибка, 500 + throw new ConversionFailedException(e); + } + } + + /** + * Валидация байтов переиспользует публичные byte-API ядра. Порядок значим: + * размер (дешёвая) → magic bytes → lightweight-разбор zip. + * + *

Проверка zip-подписи отдельным шагом обязательна: + * {@code ZipInputStream.getNextEntry()} на не-zip-потоке возвращает + * {@code null} молча, и {@link WordPdfValidator#checkPageCountLightweight(byte[])} + * такой вход не отверг бы (0 страниц). Регрессия — + * ConvertControllerTest#corruptNotAZip_rejected.

+ */ + void validate(byte[] docxBytes) { + try { + WordPdfValidator.checkInput(docxBytes); + } catch (ConversionException e) { + throw new ValidationException(e.getMessage(), e); + } + if (docxBytes.length < 4 || docxBytes[0] != 'P' || docxBytes[1] != 'K' + || (docxBytes[2] & 0xFF) != 0x03 || (docxBytes[3] & 0xFF) != 0x04) { + throw new ValidationException("Содержимое не похоже на .docx (не zip-архив)"); + } + try { + WordPdfValidator.checkPageCountLightweight(docxBytes); + } catch (ConversionException e) { + throw new ValidationException(e.getMessage(), e); + } + } + + /** + * Тело задачи воркера. Байтового API в ядре нет ({@code convertToStream} + * private и принимает {@code Path}), поэтому временные файлы; имя docx + * влияет на заголовок PDF (ядро берёт baseName файла), потому санитизировано. + */ + private static byte[] doConvert(byte[] docxBytes, String originalFilename) { + Path dir = null; + Path in = null; + Path out = null; + try { + dir = Files.createTempDirectory("wordpdf-"); + String docxName = safeDocxName(originalFilename); + in = dir.resolve(docxName); + out = dir.resolve(safeBaseName(originalFilename) + ".pdf"); + Files.write(in, docxBytes); + WordPdfConverter.convert(in, out); + return Files.readAllBytes(out); + } catch (ConversionException e) { + // всё, что упало на рендер-стадии, — ошибка преобразования, 500 + throw new ConversionFailedException("Не удалось конвертировать документ: " + + e.getMessage(), e); + } catch (IOException e) { + throw new ConversionFailedException(e); + } finally { + deleteQuietly(out); + deleteQuietly(in); + deleteQuietly(dir); + } + } + + /** Имя docx для временного файла: чистый base + обязательный суффикс .docx. */ + static String safeDocxName(String original) { + return safeBaseName(original) + ".docx"; + } + + /** + * Санитизация имени (единый источник для имени файла и Content-Disposition): + * без каталога, только буквы/цифры/пробел/ {@code . _ -}, без суффикса + * .docx; пустое после очистки → {@code document}. Кириллица разрешена — + * на Linux это валидное имя файла, и заголовок PDF остаётся читаемым. + */ + static String safeBaseName(String original) { + String base = original == null ? "" + : original.substring(Math.max(original.lastIndexOf('/'), + original.lastIndexOf('\\')) + 1); + base = base.replaceAll("[^\\p{L}\\p{N} ._-]", ""); + if (base.toLowerCase(Locale.ROOT).endsWith(".docx")) { + base = base.substring(0, base.length() - ".docx".length()); + } + if (base.isBlank()) { + base = "document"; + } + return base.strip(); + } + + private static void deleteQuietly(Path p) { + if (p == null) { + return; + } + try { + Files.deleteIfExists(p); + } catch (IOException ignored) { + // вторичная ошибка очистки не должна затенять основной результат + } + } + + @PreDestroy + void shutdown() { + workers.shutdownNow(); + } +} diff --git a/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionTimeoutException.java b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionTimeoutException.java new file mode 100644 index 0000000..2b043d6 --- /dev/null +++ b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConversionTimeoutException.java @@ -0,0 +1,18 @@ +package ru.pjandro.wordpdf.app; + +import java.time.Duration; + +/** + * Конвертация не завершилась за {@code wordpdf.convert-timeout}. + * + *

Маппится в HTTP 504 ({@link ApiExceptionHandler}). Отмена задачи + * не гарантирует мгновенной остановки FOP-рендера — воркер может ещё + * недолго поработать на отменённой задаче (осознанный компромисс, + * см. {@link ConversionService}).

+ */ +class ConversionTimeoutException extends RuntimeException { + + ConversionTimeoutException(Duration timeout) { + super("Конвертация превысила " + timeout.toSeconds() + " с — документ слишком сложный"); + } +} diff --git a/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConvertController.java b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConvertController.java new file mode 100644 index 0000000..0e26bdd --- /dev/null +++ b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ConvertController.java @@ -0,0 +1,64 @@ +package ru.pjandro.wordpdf.app; + +import io.swagger.v3.oas.annotations.Operation; +import org.springframework.http.ContentDisposition; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Locale; + +/** + * Единственный эндпоинт API: {@code POST /api/v1/convert} — multipart-поле + * {@code file} (.docx) → синхронный ответ байтами PDF. + * + *

Здесь только HTTP-слой: проверка presence/расширения и формирование + * {@code Content-Disposition}; проверка содержимого (zip, размер, страницы) — + * зона {@link ConversionService#validate}. Ошибки в JSON-ответ переводит + * {@link ApiExceptionHandler}.

+ */ +@RestController +final class ConvertController { + + private final ConversionService conversionService; + + ConvertController(ConversionService conversionService) { + this.conversionService = conversionService; + } + + @Operation(summary = "Конвертировать .docx в PDF") + @PostMapping( + path = "/api/v1/convert", + consumes = MediaType.MULTIPART_FORM_DATA_VALUE, + produces = MediaType.APPLICATION_PDF_VALUE) + ResponseEntity convert(@RequestParam("file") MultipartFile file) { + if (file == null || file.isEmpty()) { + throw new ValidationException("Файл не передан (multipart-поле «file» обязательно)"); + } + String name = file.getOriginalFilename(); + if (name == null || !name.toLowerCase(Locale.ROOT).endsWith(".docx")) { + // та же формулировка, что у WordPdfValidator.checkInput(Path) + throw new ValidationException("Поддерживается только .docx (без .doc): " + name); + } + byte[] docxBytes; + try { + docxBytes = file.getBytes(); + } catch (IOException e) { + throw new ValidationException("Не удалось прочитать загруженный файл", e); + } + byte[] pdf = conversionService.convert(docxBytes, name); + ContentDisposition disposition = ContentDisposition.attachment() + .filename(ConversionService.safeBaseName(name) + ".pdf", StandardCharsets.UTF_8) + .build(); + return ResponseEntity.ok() + .contentType(MediaType.APPLICATION_PDF) + .header(HttpHeaders.CONTENT_DISPOSITION, disposition.toString()) + .body(pdf); + } +} diff --git a/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ValidationException.java b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ValidationException.java new file mode 100644 index 0000000..bfe39b2 --- /dev/null +++ b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/ValidationException.java @@ -0,0 +1,23 @@ +package ru.pjandro.wordpdf.app; + +/** + * Некорректный вход: пустой файл, не .docx, не zip-архив, размер больше + * {@code WordPdfValidator.MAX_INPUT_BYTES}, страниц больше ста. + * + *

Отличается от {@link ConversionFailedException} смыслом: запрос + * некорректен сам по себе, повтор его же ничего не изменит. Маппится в HTTP 400 + * ({@link ApiExceptionHandler}).

+ * + *

Регрессия — ConvertControllerTest#nonDocxFilename_rejected, + * #oversizedOverCoreLimit_rejected, #corruptNotAZip_rejected.

+ */ +class ValidationException extends RuntimeException { + + ValidationException(String message) { + super(message); + } + + ValidationException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/WordPdfApplication.java b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/WordPdfApplication.java new file mode 100644 index 0000000..ae07e3b --- /dev/null +++ b/wordpdf-app/src/main/java/ru/pjandro/wordpdf/app/WordPdfApplication.java @@ -0,0 +1,20 @@ +package ru.pjandro.wordpdf.app; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Точка входа REST-приложения: HTTP API конвертации .docx → PDF поверх + * {@code wordpdf-core}. + * + *

Единственное место в приложении, где класс не «final + только static»: + * Spring-компоненты по определению экземпляры (как {@code BundledFontMapper} + * в ядре).

+ */ +@SpringBootApplication +public final class WordPdfApplication { + + public static void main(String[] args) { + SpringApplication.run(WordPdfApplication.class, args); + } +} diff --git a/wordpdf-app/src/main/resources/application.properties b/wordpdf-app/src/main/resources/application.properties new file mode 100644 index 0000000..4590a99 --- /dev/null +++ b/wordpdf-app/src/main/resources/application.properties @@ -0,0 +1,10 @@ +spring.application.name=wordpdf-app +# 6MB, а не 5MB: авторитетный лимит — ядро (WordPdfValidator.MAX_INPUT_BYTES +# = 5 MiB = 5 242 880 Б). С multipart-лимитом «5MB» (5 000 000 Б) файлы +# 5.0–5.24 МБ отбивались бы контейнером с неверным текстом ошибки раньше ядра. +# file-size-threshold=6MB держит файл в памяти (ядро и так читает всё в RAM). +spring.servlet.multipart.max-file-size=6MB +spring.servlet.multipart.max-request-size=6MB +spring.servlet.multipart.file-size-threshold=6MB +# Таймаут одной конвертации (binding Duration в ConversionService) +wordpdf.convert-timeout=2m diff --git a/wordpdf-app/src/test/java/ru/pjandro/wordpdf/app/ConvertControllerTest.java b/wordpdf-app/src/test/java/ru/pjandro/wordpdf/app/ConvertControllerTest.java new file mode 100644 index 0000000..c8c7f4f --- /dev/null +++ b/wordpdf-app/src/test/java/ru/pjandro/wordpdf/app/ConvertControllerTest.java @@ -0,0 +1,224 @@ +package ru.pjandro.wordpdf.app; + +import org.apache.pdfbox.Loader; +import org.apache.pdfbox.pdmodel.PDDocument; +import org.apache.pdfbox.text.PDFTextStripper; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.multipart; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * Сквозные тесты HTTP API (MockMvc): фикстуры — samples/*.docx из test-jar + * ядра, PDF разбирается PDFBox, текст нормализуется по пробелам — паттерны + * {@code WordPdfConverterTest} (norm/pdfText). + */ +@SpringBootTest +@AutoConfigureMockMvc +class ConvertControllerTest { + + private static final MediaType DOCX = + MediaType.parseMediaType("application/vnd.openxmlformats-officedocument.wordprocessingml.document"); + + @Autowired + private MockMvc mockMvc; + + /** Байты фикстуры из classpath (test-jar core: samples/…). */ + private static byte[] bytes(String resource) throws IOException { + try (InputStream in = ConvertControllerTest.class.getResourceAsStream(resource)) { + assertNotNull(in, "Нет ресурса: " + resource); + return in.readAllBytes(); + } + } + + private static MockMultipartFile docx(String filename, byte[] content) { + return new MockMultipartFile("file", filename, DOCX.toString(), content); + } + + /** Нормализует пробельные (PDFTextStripper вставляет переносы). */ + private static String norm(String s) { + return s.replaceAll("\\s+", " "); + } + + /** Извлекает весь текст из PDF-байтов (PDFBox, PDFTextStripper). */ + private static String pdfText(byte[] pdf) throws IOException { + try (PDDocument doc = Loader.loadPDF(pdf)) { + return new PDFTextStripper().getText(doc); + } + } + + /** Валидный zip с одной мусорной записью (не OPC-пакет). */ + private static byte[] zipWithGarbage() throws IOException { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + try (ZipOutputStream zout = new ZipOutputStream(bos)) { + zout.putNextEntry(new ZipEntry("garbage.txt")); + zout.write("это не документ".getBytes(StandardCharsets.UTF_8)); + zout.closeEntry(); + } + return bos.toByteArray(); + } + + @Test + void convertSample_returnsPdf() throws Exception { + MvcResult result = mockMvc.perform(multipart("/api/v1/convert") + .file(docx("ru-plain.docx", bytes("/samples/ru-plain.docx")))) + .andExpect(status().isOk()) + .andExpect(content().contentType(MediaType.APPLICATION_PDF)) + .andExpect(header().string(HttpHeaders.CONTENT_DISPOSITION, + org.hamcrest.Matchers.containsString("filename*=UTF-8''ru-plain.pdf"))) + .andReturn(); + byte[] pdf = result.getResponse().getContentAsByteArray(); + assertTrue(new String(pdf, 0, 4, StandardCharsets.US_ASCII).equals("%PDF"), + "тело не начинается с %PDF"); + String text = norm(pdfText(pdf)); + assertTrue(text.contains("Привет, мир!"), "нет «Привет, мир!»: " + text); + assertTrue(text.contains("абвгдеёжзийклмнопрстуфхцчшщъыьэюя"), + "нет алфавита: " + text); + } + + @Test + void cyrillicAndPathInFilename_sanitizedResponseName() throws Exception { + byte[] sample = bytes("/samples/ru-plain.docx"); + // имя «отчёт.pdf» в RFC 5987-кодировке + mockMvc.perform(multipart("/api/v1/convert").file(docx("отчёт.docx", sample))) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_DISPOSITION, + org.hamcrest.Matchers.containsString( + "filename*=UTF-8''%D0%BE%D1%82%D1%87%D1%91%D1%82.pdf"))); + // «a/../../evil.docx»: каталог и «..» обязаны быть вырезаны + mockMvc.perform(multipart("/api/v1/convert").file(docx("a/../../evil.docx", sample))) + .andExpect(status().isOk()) + .andExpect(result -> { + String cd = result.getResponse().getHeader(HttpHeaders.CONTENT_DISPOSITION); + assertNotNull(cd); + assertTrue(!cd.contains("/") && !cd.contains(".."), + "в Content-Disposition остались путь/«..»: " + cd); + assertTrue(cd.contains("evil.pdf"), "имя не сохранено: " + cd); + }); + } + + @Test + void nonDocxFilename_rejected() throws Exception { + mockMvc.perform(multipart("/api/v1/convert") + .file(docx("notes.txt", bytes("/samples/ru-plain.docx")))) + .andExpect(status().isBadRequest()) + .andExpect(jsonPath("$.error", + org.hamcrest.Matchers.containsString(".docx"))); + } + + @Test + void missingPart_rejected() throws Exception { + mockMvc.perform(multipart("/api/v1/convert")) + .andExpect(status().isBadRequest()) + .andExpect(jsonPath("$.error", + org.hamcrest.Matchers.containsString("не передан"))); + } + + @Test + void emptyFile_rejected() throws Exception { + mockMvc.perform(multipart("/api/v1/convert") + .file(docx("a.docx", new byte[0]))) + .andExpect(status().isBadRequest()); + } + + @Test + void oversizedOverCoreLimit_rejected() throws Exception { + // 5 MiB + 1 байт: проходит контейнерный multipart-лимит (6 MB) + // и отсекается валидацией ядра до очереди + byte[] big = new byte[5 * 1024 * 1024 + 1]; + mockMvc.perform(multipart("/api/v1/convert").file(docx("big.docx", big))) + .andExpect(status().isBadRequest()) + .andExpect(jsonPath("$.error", + org.hamcrest.Matchers.containsString("больше 5 МБ"))); + } + + @Test + void tooManyPages_rejectedBeforeRender() throws Exception { + mockMvc.perform(multipart("/api/v1/convert") + .file(docx("too-many-pages.docx", bytes("/samples/too-many-pages.docx")))) + .andExpect(status().isBadRequest()) + .andExpect(jsonPath("$.error", + org.hamcrest.Matchers.containsString("100"))); + } + + @Test + void concurrentRequests_bothSucceed() throws Exception { + // регрессия сериализации: без single-thread executor всплывает + // гонка глобального реестра PhysicalFonts в ядре + byte[] sample = bytes("/samples/ru-plain.docx"); + ExecutorService pool = Executors.newFixedThreadPool(2); + CountDownLatch start = new CountDownLatch(1); + try { + Future[] futures = new Future[2]; + for (int i = 0; i < 2; i++) { + futures[i] = pool.submit(() -> { + try { + start.await(); + MvcResult r = mockMvc.perform(multipart("/api/v1/convert") + .file(docx("ru-plain.docx", sample))) + .andExpect(status().isOk()) + .andReturn(); + byte[] pdf = r.getResponse().getContentAsByteArray(); + assertTrue(new String(pdf, 0, 4, StandardCharsets.US_ASCII).equals("%PDF"), + "ответ не PDF"); + } catch (Exception e) { + throw new IllegalStateException(e); + } + }); + } + start.countDown(); + for (Future f : futures) { + f.get(); + } + } finally { + pool.shutdownNow(); + } + } + + @Test + void corruptNotAZip_rejected() throws Exception { + // без zip-подписи ZipInputStream молча даёт 0 записей — отсекает + // отдельная проверка magic bytes + mockMvc.perform(multipart("/api/v1/convert") + .file(docx("broken.docx", "это просто текст, не архив" + .getBytes(StandardCharsets.UTF_8)))) + .andExpect(status().isBadRequest()) + .andExpect(jsonPath("$.error", + org.hamcrest.Matchers.containsString("не zip-архив"))); + } + + @Test + void junkInsideValidZip_conversionError() throws Exception { + // контейнер целый (валидный zip), мусор внутри — это ошибка + // преобразования (500), а не валидации (400) + mockMvc.perform(multipart("/api/v1/convert") + .file(docx("bad.docx", zipWithGarbage()))) + .andExpect(status().isInternalServerError()) + .andExpect(jsonPath("$.error", + org.hamcrest.Matchers.containsString("Не удалось конвертировать"))); + } +} diff --git a/wordpdf-cli/pom.xml b/wordpdf-cli/pom.xml deleted file mode 100644 index 928d25e..0000000 --- a/wordpdf-cli/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - 4.0.0 - - - ru.pjandro - java-word-pdf - 1.0.0 - - - wordpdf-cli - wordpdf-cli - CLI: конвертация docx в PDF (fat-jar) - - - - ru.pjandro - wordpdf-core - ${project.version} - - - - - org.junit.jupiter - junit-jupiter - test - - - - ru.pjandro - wordpdf-core - ${project.version} - tests - test-jar - test - - - - - - - - org.apache.maven.plugins - maven-shade-plugin - - - package - - shade - - - - - ru.pjandro.wordpdf.cli.WordPdfCli - - - - - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - - - - - diff --git a/wordpdf-cli/src/main/java/ru/pjandro/wordpdf/cli/WordPdfCli.java b/wordpdf-cli/src/main/java/ru/pjandro/wordpdf/cli/WordPdfCli.java deleted file mode 100644 index b9b3334..0000000 --- a/wordpdf-cli/src/main/java/ru/pjandro/wordpdf/cli/WordPdfCli.java +++ /dev/null @@ -1,91 +0,0 @@ -package ru.pjandro.wordpdf.cli; - -import ru.pjandro.wordpdf.ConversionException; -import ru.pjandro.wordpdf.WordPdfConverter; - -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Locale; - -/** - * Командная строка: конвертация docx в PDF. - * - * Использование: - *
- *   java -jar wordpdf-cli-1.0.0.jar in.docx [in2.docx]
- *   java -jar wordpdf-cli-1.0.0.jar in.docx out.pdf
- * 
- * - *
    - *
  • один аргумент: рядом с файлом создаётся {@code <имя>.pdf};
  • - *
  • два аргумента, второй — {@code .pdf}: конвертация в указанный файл;
  • - *
  • два аргумента, второй — {@code .docx}: пакетная конвертация, - * каждый исходник -> свой .pdf рядом с ним.
  • - *
- * - * Коды возврата: 0 — всё успешно, 1 — ошибка использования, - * 2 — не удалось конвертировать хотя бы один файл. - */ -public final class WordPdfCli { - - private WordPdfCli() { - } - - public static void main(String[] args) { - System.exit(run(args)); - } - - /** Точка входа без System.exit (удобно для тестов). - * - * @return код возврата (см. javadoc класса) - */ - public static int run(String[] args) { - if (args.length < 1 || args.length > 2) { - System.err.println(usage()); - return 1; - } - - boolean failed = false; - if (args.length == 2 && args[1].toLowerCase(Locale.ROOT).endsWith(".pdf")) { - // Два аргумента, второй — .pdf: явный выходной файл - failed |= !convertOne(Paths.get(args[0]), Paths.get(args[1])); - } else { - // Один входной, либо два .docx: каждый -> <имя>.pdf рядом с исходником - for (String in : args) { - failed |= !convertOne(Paths.get(in), null); - } - } - return failed ? 2 : 0; - } - - /** Конвертирует один файл и печатает результат. - * - * @param in входной .docx - * @param out выходной .pdf, или null (рядом с исходником) - * @return успех? - */ - private static boolean convertOne(Path in, Path out) { - try { - Path result; - if (out == null) { - result = WordPdfConverter.convert(in); - } else { - WordPdfConverter.convert(in, out); - result = out; - } - System.out.println(result + " — готово"); - return true; - } catch (ConversionException e) { - System.err.println(in + ": " + e.getMessage()); - return false; - } catch (Exception e) { - System.err.println(in + ": неожиданная ошибка: " + e); - return false; - } - } - - private static String usage() { - return "Использование: java -jar wordpdf-cli.jar \n" - + " java -jar wordpdf-cli.jar "; - } -} diff --git a/wordpdf-cli/src/test/java/ru/pjandro/wordpdf/cli/WordPdfCliTest.java b/wordpdf-cli/src/test/java/ru/pjandro/wordpdf/cli/WordPdfCliTest.java deleted file mode 100644 index adbd59b..0000000 --- a/wordpdf-cli/src/test/java/ru/pjandro/wordpdf/cli/WordPdfCliTest.java +++ /dev/null @@ -1,116 +0,0 @@ -package ru.pjandro.wordpdf.cli; - -import org.junit.jupiter.api.Test; -import ru.pjandro.wordpdf.WordPdfValidator; - -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.*; - -/** - * Smoke-тест CLI. Готовый .docx берётся из test-jar wordpdf-core - * (classpath: samples/ru-plain.docx). - */ -class WordPdfCliTest { - - @Test - void usageErrors() { - assertEquals(1, WordPdfCli.run(new String[]{}), "нет аргументов"); - assertEquals(1, WordPdfCli.run(new String[]{"a.docx", "b.docx", "c.docx"}), - "слишком много аргументов"); - } - - @Test - void missingFileReturnsError() { - assertEquals(2, WordPdfCli.run(new String[]{"/tmp/no-such-file-xyz.docx"})); - } - - /** - * Превышение 5 MiB на входе: CLI должен вернуть код 2 (ошибка конвертации) - * — валидатор бросает {@code ConversionException}, CLI ловит и печатает - * в stderr. - */ - @Test - void oversizedInputReturnsError() throws Exception { - Path tooBig = Files.createTempFile("cli-too-big-", ".docx"); - try { - Files.write(tooBig, - new byte[(int) WordPdfValidator.MAX_INPUT_BYTES + 1]); - assertEquals(2, WordPdfCli.run(new String[]{tooBig.toString()}), - "превышение лимита должно давать код 2"); - } finally { - // при регрессии guard'а CLI написал бы PDF рядом со входом — - // убирать и его, чтобы тест не оставлял артефактов - Files.deleteIfExists(tooBig); - Files.deleteIfExists(Path.of( - tooBig.toString().replaceFirst("\\.docx$", "") + ".pdf")); - } - } - - @Test - void convertsSampleWithExplicitOutput() throws Exception { - // Сэмпл из test-jar wordpdf-core - Path in = extractToTemp("samples/ru-plain.docx", "cli-in-"); - Path out = in.resolveSibling("cli-out.pdf"); - - int code = WordPdfCli.run(new String[]{in.toString(), out.toString()}); - - assertEquals(0, code, "CLI вернул ошибку"); - assertTrue(Files.isRegularFile(out), "PDF не создан"); - // Магический заголовок PDF - byte[] header = new byte[4]; - try (InputStream is = Files.newInputStream(out)) { - int read = is.readNBytes(header, 0, 4); - assertEquals(4, read); - } - assertEquals("%PDF", new String(header, StandardCharsets.US_ASCII)); - } - - @Test - void convertsSampleWithoutExplicitOutput() throws Exception { - // Выход = <имя без .docx>.pdf рядом с исходником - Path in = extractToTemp("samples/en-plain.docx", "cli-in2-"); - String name = in.getFileName().toString(); - int dot = name.lastIndexOf('.'); - Path expected = in.resolveSibling(name.substring(0, dot) + ".pdf"); - - int code = WordPdfCli.run(new String[]{in.toString()}); - - assertEquals(0, code, "CLI вернул ошибку"); - assertTrue(Files.isRegularFile(expected), "PDF не создан: " + expected); - } - - @Test - void batchConvertsBothInputs() throws Exception { - // Два .docx-аргумента = пакетная конвертация (не «вход/выход»): - // каждый исходник -> свой .pdf рядом - Path in1 = extractToTemp("samples/ru-plain.docx", "cli-b1-"); - Path in2 = extractToTemp("samples/en-plain.docx", "cli-b2-"); - - int code = WordPdfCli.run(new String[]{in1.toString(), in2.toString()}); - - assertEquals(0, code, "CLI вернул ошибку"); - for (Path in : List.of(in1, in2)) { - String name = in.getFileName().toString(); - int dot = name.lastIndexOf('.'); - Path expected = in.resolveSibling(name.substring(0, dot) + ".pdf"); - assertTrue(Files.isRegularFile(expected), "PDF не создан: " + expected); - } - } - - /** Выгружает ресурс (сэмпл) из classpath во временный файл. */ - private static Path extractToTemp(String resource, String prefix) throws Exception { - try (InputStream in = WordPdfCliTest.class.getClassLoader() - .getResourceAsStream(resource)) { - assertNotNull(in, "Нет ресурса: " + resource); - Path tmp = Files.createTempFile(prefix, ".docx"); - Files.copy(in, tmp, StandardCopyOption.REPLACE_EXISTING); - return tmp; - } - } -} diff --git a/wordpdf-core/pom.xml b/wordpdf-core/pom.xml index b097504..c6df595 100644 --- a/wordpdf-core/pom.xml +++ b/wordpdf-core/pom.xml @@ -20,7 +20,7 @@ org.docx4j docx4j-core
- + org.docx4j docx4j-JAXB-ReferenceImpl @@ -61,7 +61,7 @@ + используется тестами wordpdf-app. --> org.apache.maven.plugins maven-jar-plugin diff --git a/wordpdf-web/.dockerignore b/wordpdf-web/.dockerignore new file mode 100644 index 0000000..f06235c --- /dev/null +++ b/wordpdf-web/.dockerignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/wordpdf-web/.gitignore b/wordpdf-web/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/wordpdf-web/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/wordpdf-web/.oxlintrc.json b/wordpdf-web/.oxlintrc.json new file mode 100644 index 0000000..6fa991d --- /dev/null +++ b/wordpdf-web/.oxlintrc.json @@ -0,0 +1,8 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["react", "typescript", "oxc"], + "rules": { + "react/rules-of-hooks": "error", + "react/only-export-components": ["warn", { "allowConstantExport": true }] + } +} diff --git a/wordpdf-web/Dockerfile b/wordpdf-web/Dockerfile new file mode 100644 index 0000000..e2b7527 --- /dev/null +++ b/wordpdf-web/Dockerfile @@ -0,0 +1,17 @@ +FROM node:24-alpine AS build +# docker-прокси из ~/.docker/config.json BuildKit подмешивает в каждый RUN +# (ENV не перебивает), а 127.0.0.1 внутри контейнера недостижим — npm ci падает +# с ECONNREFUSED. Контейнер в сеть ходит напрямую, потому обнуляем прокси +# на самой команде. +WORKDIR /build +COPY package.json package-lock.json ./ +RUN HTTP_PROXY= http_proxy= HTTPS_PROXY= https_proxy= ALL_PROXY= all_proxy= npm ci +COPY . . +RUN npm run build + +FROM nginx:alpine +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build /build/dist /usr/share/nginx/html +# прокси из docker-config подмешивается в HEALTHCHECK-шелл — обнуляем на команде +HEALTHCHECK --interval=10s --timeout=3s --start-period=10s \ + CMD http_proxy= https_proxy= wget -qO /dev/null http://127.0.0.1/ || exit 1 diff --git a/wordpdf-web/README.md b/wordpdf-web/README.md new file mode 100644 index 0000000..86ec664 --- /dev/null +++ b/wordpdf-web/README.md @@ -0,0 +1,22 @@ +# wordpdf-web + +SPA-фронт конвертера Word → PDF: React 19 + TypeScript + Vite + Tailwind CSS v4. +В Maven-сборку не входит; деплоится отдельным nginx-контейнером (см. +`Dockerfile`/`nginx.conf` и корневой `docker-compose.yml`). + +## Dev + +```bash +npm install +npm run dev # http://localhost:5173, /api проксируется на :8080 +``` + +Бэкенд для dev: `java -jar ../wordpdf-app/target/wordpdf-app-1.0.0.jar`. + +## Сборка + +```bash +npm run build # tsc -b && vite build → dist/ +``` + +UI-тестов нет; гейт — успешная сборка (`tsc -b` ловит типизацию). diff --git a/wordpdf-web/index.html b/wordpdf-web/index.html new file mode 100644 index 0000000..dfcdea6 --- /dev/null +++ b/wordpdf-web/index.html @@ -0,0 +1,13 @@ + + + + + + + Word → PDF + + +
+ + + diff --git a/wordpdf-web/nginx.conf b/wordpdf-web/nginx.conf new file mode 100644 index 0000000..c68507f --- /dev/null +++ b/wordpdf-web/nginx.conf @@ -0,0 +1,11 @@ +server { + listen 80; + root /usr/share/nginx/html; + index index.html; + # без него upload >1MB режется HTML-413 от nginx до бэкенда + client_max_body_size 6m; + location /api/ { proxy_pass http://app:8080; } + location /swagger-ui { proxy_pass http://app:8080; } + location /v3/api-docs { proxy_pass http://app:8080; } + location / { try_files $uri $uri/ /index.html; } +} diff --git a/wordpdf-web/package-lock.json b/wordpdf-web/package-lock.json new file mode 100644 index 0000000..dfc8e8c --- /dev/null +++ b/wordpdf-web/package-lock.json @@ -0,0 +1,1942 @@ +{ + "name": "wordpdf-web", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "wordpdf-web", + "version": "0.0.0", + "dependencies": { + "@tailwindcss/vite": "^4.3.3", + "react": "^19.2.8", + "react-dom": "^19.2.8", + "tailwindcss": "^4.3.3" + }, + "devDependencies": { + "@types/node": "^24.13.3", + "@types/react": "^19.2.18", + "@types/react-dom": "^19.2.7", + "@vitejs/plugin-react": "^6.1.1", + "oxlint": "^1.81.0", + "typescript": "~6.0.2", + "vite": "^8.3.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.153.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.153.0.tgz", + "integrity": "sha512-jSNrRIyvPVLL5E1z/tS5zLAprosGz/FuI1PWwEOz59j3E4TTTzSpqKb/RDGqJhhW0QHYISGXxq582wGx6T11Tw==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@oxlint/binding-android-arm-eabi": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.88.0.tgz", + "integrity": "sha512-k6Fgkf86ubfeH4GvqYsRolfuVAp0pfYVZvifSlXNHPdMaWUOfxUrmLEeDD7hF6U2oJuhsVxhSWq86/xCJ+9MmA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-android-arm64": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.88.0.tgz", + "integrity": "sha512-AsIyhl9o1ejwtac7NMbhKpMdSml6NWR0ljKjZERxC8OHYDAW8o/Om9n1QHVLi4VCEUo42Zte2/Op9kyoGpJZMg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-arm64": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.88.0.tgz", + "integrity": "sha512-qgBjB7eEKcCB4RqjXGuoSZq74g0wD09fWFJ+HWcCJcKaga8TeUHtb+BY0SsxdleSLBgx4RZ7qmgo0EzqEq7JoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-x64": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.88.0.tgz", + "integrity": "sha512-sCz3X5Mw/xdzEzn4fsCt1Iq8NKJnGNfhR+b9B5k+4DysYAHsmIhYoocnBPiQ9kvY3+pUun2A0Z8Vtun/Nv6YoQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-freebsd-x64": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.88.0.tgz", + "integrity": "sha512-xTOdYOIqCufgIj0knvxu86FBfovP6QBiD7ngNva01gb8xPQCD5gXkE5APGczH35zStim1O3zqvFbLQmY85xXRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-gnueabihf": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.88.0.tgz", + "integrity": "sha512-BLadtw88NdYJBrAtC1dYzrPfSP2d5zgx6iuZycdD0YmZBJ2Nqbit9Z4PSaIb6gxK25dweArGMPbOmq/0ugwUPg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-musleabihf": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.88.0.tgz", + "integrity": "sha512-wILSczl/DaZsCcf7j7tvNbssp8hxEHIJxrv4j7+JjI3TAL1U/JTWbeUtoJJC/vo8+2hkTmHLYoKJjmiNbijdXw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-gnu": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.88.0.tgz", + "integrity": "sha512-jutT2Hy8JCuZuMwIFHo2HtyxfOfBJHyQxlBHBK1SL9W2f8n/WhjAP0FnDMz9d/mjhv9+QA0mx5AdQ9fDjsrFFg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-musl": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.88.0.tgz", + "integrity": "sha512-8N8iGV9hh4Lkeuq7QsEkjoXNRRflqR1G2qyoGYXcA0k5qllrdqmfylKEXyHIVERxqNDyMO4StqDQ0uLxXcBQAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-ppc64-gnu": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.88.0.tgz", + "integrity": "sha512-5ydcQt3znNQ/rGEWYRvpS2cK9+T18P2VYgnyJ+eloEAwi9YUmsXy5VGrRqNWIK6qzWwHGnEE3ojVqqQNo+f0hA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-gnu": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.88.0.tgz", + "integrity": "sha512-iGx0uvFT54b/5DPJdEBCxYIrVB3v0uTy+JhRh3CyEp8/22BXDkG8rffkFwREdLsdj9mOrPbJYVOZw8ipcBuzjw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-musl": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.88.0.tgz", + "integrity": "sha512-Wt47mKMWelVjRjuR7BCFxXkB0m79K1sTEbqMHRWciKUgo5iv7sWsF4RXSOyFYHD9zerNrkRZblnN273rhwOA1Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-s390x-gnu": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.88.0.tgz", + "integrity": "sha512-g3L12KCS4+1gtUt3RbJ4F+Yxx4LNmmZLEPfhd8rAHEJjJk2lAgNfnjGoP/phJyhG5WS6VbNYbJtadJelNfvTMA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-gnu": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.88.0.tgz", + "integrity": "sha512-og/XHVDOD9ZJgRiZkT9DgzQd4sr+JZW7e4l17Q/jVMZiIbeEd4uIu9iAoUbTF1gIvVZoRc4QDOxyVUvQGp4WHg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-musl": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.88.0.tgz", + "integrity": "sha512-EmhBsp+xuKb6YbZNEMLBo80Xw71AZOIm18do8ni/GLX/Lw1XzNhVYpbxO1KasYtoAvrGtCOdCPULRlIE0bPbTQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-openharmony-arm64": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.88.0.tgz", + "integrity": "sha512-DBUcx/KwYdg1DAz+G01P/GFv512J04EsZadbHptx2FTpWT/MWRg21ZToNHt9pnsfQRBQ3et/g+vqzbvrdAVbuA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-arm64-msvc": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.88.0.tgz", + "integrity": "sha512-xeVd0n4XG5HvynxfYvXi6uB+JvZbVZataowPS8cYpMbYg9mwE4sSyElFQd4LVJFifq8bRLDSR18XgEildmcXAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-ia32-msvc": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.88.0.tgz", + "integrity": "sha512-MA6iOw//amleaz2mVMsZrA7NHlEexjTrhIxSMFCXQi6IUuQO+3Od00GZhr2iCYw6RFzMW36jkKK/WHBXMsoQAw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-x64-msvc": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.88.0.tgz", + "integrity": "sha512-3Sz6rVWe8Dy+ufsXurFN1GX2dX43F/lQMSLelK9gFjiba7nHvLlqlhR5cHlWVnCpSqUY1hN9pyCX9XToe6ve6g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.13.tgz", + "integrity": "sha512-Vu/NICrgdRvUOeaJZIyB2FP63s6fO/4ud5l8dXmxDx9yDyn+mN0y+gsvsVviSli+T361Aqo0h46EuMoobrwawA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.13.tgz", + "integrity": "sha512-6LEoIrGy5vvCd2boNnv2soPSUZj/PRvhp8R/t9KlX+mIZxThIE/ZqxrGXxmuNX0FuvQFvLdZr7S4HrYpYBVhEQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.13.tgz", + "integrity": "sha512-CaJSRzlQ6Q+zkDMVA9OkVxBjVoPRCDEE3v0FSJ9kIQBgRjFApA3Si4ijhbNVUji7ZJt+PfO0e46qy4nPInHUPA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.13.tgz", + "integrity": "sha512-e4r340I5hxSzJkD3YJBxgzq/rJ3wwxwdLLb2FPt1Zpyem20nrQPT11DDEEkazwxaHumH8wpglsp/Ozgj/wT6mw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.13.tgz", + "integrity": "sha512-hoBWDZ4/K/mJKVMbsgUd1jfpA2DiOrJ54mpegObU9TBHBBrtX4FLIXJJQRDPZ/2Dn91GvPob+Z2hwKJzf4E5SQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.13.tgz", + "integrity": "sha512-oF9fZu3vTWnTiVAkDFxU9PJLt1nh20K9RRpuHsR7ZnE2L7XookBbDBVLojCVSLGbvtSlxeUNnjAj6DbNsKyzbg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.13.tgz", + "integrity": "sha512-DTpb/+jMiqWMPgphn4ksW1zW+XLJ6dJJ9FMvnIk9I291LhCctMPhMYJrP5t9p6C9qa3KXadDdUEZHBaPh3kNxQ==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.13.tgz", + "integrity": "sha512-xU+Kvv9N2A3SY35zFh1FWWNjxbadE/BKeqnkXe7vScU4GZsw757BlVmDLITZEq8DPpk6m7uoDYkK7P+x/uU5Ow==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.13.tgz", + "integrity": "sha512-XMk/hnhh25oQ756Lclb1Q11h4ll0xC0Esa5w4Vzp+mAE2S3AGJgeM0SonrIgY8fHhjarb6hcoTuwoFG0VVP2ig==", + "cpu": [ + "ppc64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.13.tgz", + "integrity": "sha512-U1BoTHYmlywE2n3HUWjzZ+8EQsKr+OwpxYuDWaubx42tUL8QSL7nOqRz/NVHanibbFP3M1Rxuprz/wNcbMKjqw==", + "cpu": [ + "s390x" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.13.tgz", + "integrity": "sha512-J4cm80Pc6wEwV5AZ42o62sIQgDk+Y7R2s646jIwuvO+4V46QB58N4vVuMPWCBaNgursXLpmUWJV//WQAkPvHBQ==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.13.tgz", + "integrity": "sha512-W0euZS40U4V6JkmEnVCIX9mcsL6cbXQ4X8c2w+MMOIjFg68TXUW+u3RT+2e1t1pv9mg/EP3pDtK3POXdQ7Rxyw==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.13.tgz", + "integrity": "sha512-do/AF/4n9MRshia3a5aXoy8xM2c6mgfT6D7H/dY6my5z+hfCIR4ab7mk4IRj++nsEQpKy39kd0DQnDq+r692tw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.13.tgz", + "integrity": "sha512-6FtUf2cJZobutJdxnGYX8z0vtbgqU0b2v8vfBhkXb9wp2MppMFtkunE+IaOntyi01rkIQoPW2GHABtfzsC0BRQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.13.tgz", + "integrity": "sha512-UKhFaZTeTcbKrb3iU82m17jVcPEAoqDkCN5MBqgPyZSwp/cQmib21crTS0DdH7T1B7wZRWEI89YQAOJMet5yhg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "license": "MIT" + }, + "node_modules/@tailwindcss/node": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.3.tgz", + "integrity": "sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg==", + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.24.1", + "jiti": "^2.7.0", + "lightningcss": "1.32.0", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.3.3" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/node/node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.3.tgz", + "integrity": "sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA==", + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.3.3", + "@tailwindcss/oxide-darwin-arm64": "4.3.3", + "@tailwindcss/oxide-darwin-x64": "4.3.3", + "@tailwindcss/oxide-freebsd-x64": "4.3.3", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.3", + "@tailwindcss/oxide-linux-arm64-gnu": "4.3.3", + "@tailwindcss/oxide-linux-arm64-musl": "4.3.3", + "@tailwindcss/oxide-linux-x64-gnu": "4.3.3", + "@tailwindcss/oxide-linux-x64-musl": "4.3.3", + "@tailwindcss/oxide-wasm32-wasi": "4.3.3", + "@tailwindcss/oxide-win32-arm64-msvc": "4.3.3", + "@tailwindcss/oxide-win32-x64-msvc": "4.3.3" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.3.tgz", + "integrity": "sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.3.tgz", + "integrity": "sha512-BiaWatpBcERQFDlOjRDpIVXuFK5PJez5SA4JMg6VYZdBYU+qKfV/vqjcIs+IYmtitf1xYQZTwXvU/8y4lfZUGw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.3.tgz", + "integrity": "sha512-fAeUqfV5ndhxRwai8cXGzdLvul9utWOmeTkv69unv4ZXixjn61Z+p9lCWdwOwA3TYboG3BwdVuN/RDjhBRl0mw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.3.tgz", + "integrity": "sha512-iyf5bV6+wnAlflVeEy7R25dupxTNECZN5QMI0qNT6eT+EgaGdZcKhGkr5SdoaWiLJ3spLqIY9VCeSGrwmtg4kw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.3.tgz", + "integrity": "sha512-aAYUprJAJQWWbRrPvtjdroZ56Md+JM8pMiopS6xGEwDfLhqj+2ver2p4nU4Mb3CRqcMmNBjo8KkUgcxhkzVQGQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.3.tgz", + "integrity": "sha512-nDxldcEENOxZRzC2uu9jrutZdAAQtb+8WWDCSnWL1zvBk1+FN+x6MtDViPB5AJMfttVCUhehGWus3XBPgatM/w==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.3.tgz", + "integrity": "sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.3.tgz", + "integrity": "sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.3.tgz", + "integrity": "sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.3.tgz", + "integrity": "sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.11.1", + "@emnapi/runtime": "^1.11.1", + "@emnapi/wasi-threads": "^1.2.2", + "@napi-rs/wasm-runtime": "^1.1.4", + "@tybys/wasm-util": "^0.10.2", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.3.tgz", + "integrity": "sha512-3rc292Ca2ceK6Ulcc/bAVnTs/3nDtoPhyEKlgPv+yQJQi/JS/AMJlqzxvlDacL1nekbrcf6bTqp/jV4qgnPxNQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.3.tgz", + "integrity": "sha512-yJ0pwIVc/nYeGoV02WtsN8KYyLQv7kyI2wDnkezyJlGGjkd4QLwDGAwl47YpPJeuI0M0ObaXGSPjvWDPeTPggw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.3.3.tgz", + "integrity": "sha512-yYU8cogLeSh/ms2jh8Fj7jaba/EWa7Ja6GoUqYZaraEuCI5YS6ms6ObZgjjedm+jm6XZjdNRWBpPP6Z86oOxcw==", + "license": "MIT", + "dependencies": { + "@tailwindcss/node": "4.3.3", + "@tailwindcss/oxide": "4.3.3", + "tailwindcss": "4.3.3" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" + } + }, + "node_modules/@types/node": { + "version": "24.19.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz", + "integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "undici-types": ">=7.24.0 <7.24.7" + } + }, + "node_modules/@types/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.3.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.1.2.tgz", + "integrity": "sha512-fhJNGUdscQa4HkI0xFxwonWyhnVReCPDbXI7FH7jmzpnVCrFQI7PRrhWecO263610vOrs9tr2Y4xcf8uAdFxbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.0.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", + "babel-plugin-react-compiler": "^1.0.0", + "oxc-transform-react": "^0.152.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "oxc-transform-react": { + "optional": true + } + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.26.0.tgz", + "integrity": "sha512-9vhedylFonb2YGogzUKX6+Ja72gOJbN1QHAqdrvqLwhdl/QWbKopzoUC9EbQNVsAns/bx/4uyqalrQAoy1IByw==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/oxlint": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.88.0.tgz", + "integrity": "sha512-uIcFgw8BmqvFRGzH5+r7d2zJMEexwNSrEmM6WQNnGh3VkO0XYTEFoyxyNE6tjKMUib9Cue4XJA2DoWruO5D6aw==", + "dev": true, + "license": "MIT", + "bin": { + "oxlint": "bin/oxlint" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + }, + "optionalDependencies": { + "@oxlint/binding-android-arm-eabi": "1.88.0", + "@oxlint/binding-android-arm64": "1.88.0", + "@oxlint/binding-darwin-arm64": "1.88.0", + "@oxlint/binding-darwin-x64": "1.88.0", + "@oxlint/binding-freebsd-x64": "1.88.0", + "@oxlint/binding-linux-arm-gnueabihf": "1.88.0", + "@oxlint/binding-linux-arm-musleabihf": "1.88.0", + "@oxlint/binding-linux-arm64-gnu": "1.88.0", + "@oxlint/binding-linux-arm64-musl": "1.88.0", + "@oxlint/binding-linux-ppc64-gnu": "1.88.0", + "@oxlint/binding-linux-riscv64-gnu": "1.88.0", + "@oxlint/binding-linux-riscv64-musl": "1.88.0", + "@oxlint/binding-linux-s390x-gnu": "1.88.0", + "@oxlint/binding-linux-x64-gnu": "1.88.0", + "@oxlint/binding-linux-x64-musl": "1.88.0", + "@oxlint/binding-openharmony-arm64": "1.88.0", + "@oxlint/binding-win32-arm64-msvc": "1.88.0", + "@oxlint/binding-win32-ia32-msvc": "1.88.0", + "@oxlint/binding-win32-x64-msvc": "1.88.0" + }, + "peerDependencies": { + "oxlint-tsgolint": ">=7.0.2003", + "vite-plus": "*" + }, + "peerDependenciesMeta": { + "oxlint-tsgolint": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.30", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.30.tgz", + "integrity": "sha512-zkd+e9S1AQHhmaBKye9zlFHWjOwVgqXl1q3ECYy8561K7qxR2cREf/STLskulBFd78k6AOFeA+ff1TtEzk9bAA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.0.tgz", + "integrity": "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.28.0" + }, + "peerDependencies": { + "react": "^19.3.0" + } + }, + "node_modules/rolldown": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.13.tgz", + "integrity": "sha512-/5apOkwWxtACcQtZ5WlrAsKS4JwXVThQPJZ3RqIruRY9UG9M8e0VlXN068xum/JRKA4aIUoJ13ghe/kGCvidiQ==", + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.153.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.13", + "@rolldown/binding-android-arm64": "1.2.13", + "@rolldown/binding-darwin-arm64": "1.2.13", + "@rolldown/binding-darwin-x64": "1.2.13", + "@rolldown/binding-freebsd-x64": "1.2.13", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.13", + "@rolldown/binding-linux-arm64-gnu": "1.2.13", + "@rolldown/binding-linux-arm64-musl": "1.2.13", + "@rolldown/binding-linux-ppc64-gnu": "1.2.13", + "@rolldown/binding-linux-s390x-gnu": "1.2.13", + "@rolldown/binding-linux-x64-gnu": "1.2.13", + "@rolldown/binding-linux-x64-musl": "1.2.13", + "@rolldown/binding-openharmony-arm64": "1.2.13", + "@rolldown/binding-win32-arm64-msvc": "1.2.13", + "@rolldown/binding-win32-x64-msvc": "1.2.13" + } + }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "license": "MIT" + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tailwindcss": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.3.tgz", + "integrity": "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==", + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.4.tgz", + "integrity": "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==", + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.29", + "rolldown": "~1.2.12", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + } + } +} diff --git a/wordpdf-web/package.json b/wordpdf-web/package.json new file mode 100644 index 0000000..27f7e55 --- /dev/null +++ b/wordpdf-web/package.json @@ -0,0 +1,27 @@ +{ + "name": "wordpdf-web", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "oxlint", + "preview": "vite preview" + }, + "dependencies": { + "@tailwindcss/vite": "^4.3.3", + "react": "^19.2.8", + "react-dom": "^19.2.8", + "tailwindcss": "^4.3.3" + }, + "devDependencies": { + "@types/node": "^24.13.3", + "@types/react": "^19.2.18", + "@types/react-dom": "^19.2.7", + "@vitejs/plugin-react": "^6.1.1", + "oxlint": "^1.81.0", + "typescript": "~6.0.2", + "vite": "^8.3.0" + } +} diff --git a/wordpdf-web/public/favicon.svg b/wordpdf-web/public/favicon.svg new file mode 100644 index 0000000..6893eb1 --- /dev/null +++ b/wordpdf-web/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wordpdf-web/src/api.ts b/wordpdf-web/src/api.ts new file mode 100644 index 0000000..065056c --- /dev/null +++ b/wordpdf-web/src/api.ts @@ -0,0 +1,32 @@ +/** Ошибка API: сервер ответил не 2xx — текст из JSON `{"error": …}`. */ +export class ApiError extends Error {} + +export interface ConvertResult { + blob: Blob + filename: string +} + +/** + * Единственная сетевая точка приложения: POST /api/v1/convert (multipart, + * поле `file`) → PDF-blob + имя файла из Content-Disposition. + * Таймаут на фронте не ставим: конвертация долгая — это ожидаемо. + */ +export async function convertDocx( + file: File, + signal: AbortSignal, +): Promise { + const fd = new FormData() + fd.append('file', file, file.name) + const resp = await fetch('/api/v1/convert', { method: 'POST', body: fd, signal }) + if (!resp.ok) { + const json = (await resp.json().catch(() => null)) as { error?: string } | null + throw new ApiError(json?.error ?? `HTTP ${resp.status}`) + } + // Framework 7 отдаёт `filename*=UTF-8''…` (charset в верхнем регистре) — + // флаг i обязателен; фолбэк — имя исходника с заменой расширения + const cd = resp.headers.get('Content-Disposition') ?? '' + const m = /filename\*=utf-8''([^;]+)/i.exec(cd) + const filename = m ? decodeURIComponent(m[1]) : file.name.replace(/\.docx$/i, '') + '.pdf' + const blob = await resp.blob() + return { blob, filename } +} diff --git a/wordpdf-web/src/components/App.tsx b/wordpdf-web/src/components/App.tsx new file mode 100644 index 0000000..abb5073 --- /dev/null +++ b/wordpdf-web/src/components/App.tsx @@ -0,0 +1,137 @@ +import { useEffect, useRef, useState } from 'react' +import { ApiError, convertDocx } from '../api' +import DropZone from './DropZone' +import Logo from './Logo' +import PdfPreview from './PdfPreview' +import StatusMessage from './StatusMessage' + +type Status = 'idle' | 'converting' | 'done' | 'error' + +interface Result { + url: string + filename: string + size: number +} + +export default function App() { + const [file, setFile] = useState(null) + const [status, setStatus] = useState('idle') + const [result, setResult] = useState(null) + const [error, setError] = useState(null) + const abortRef = useRef(null) + const urlRef = useRef(null) + + // снимаем blob-URL предыдущего результата — иначе он течёт до закрытия вкладки + const resetResult = () => { + if (urlRef.current) { + URL.revokeObjectURL(urlRef.current) + urlRef.current = null + } + setResult(null) + setError(null) + } + + const selectFile = (picked: File) => { + resetResult() + setStatus('idle') + setFile(picked) + } + + const convert = () => { + if (!file || status === 'converting') return + resetResult() + setStatus('converting') + const ac = new AbortController() + abortRef.current = ac + convertDocx(file, ac.signal) + .then(({ blob, filename }) => { + const url = URL.createObjectURL(blob) + urlRef.current = url + setResult({ url, filename, size: blob.size }) + setStatus('done') + }) + .catch((e: unknown) => { + if (e instanceof DOMException && e.name === 'AbortError') return + // ApiError — осмысленный текст из JSON; всё остальное — нет связи + setError(e instanceof ApiError ? e.message : 'Сервер недоступен') + setStatus('error') + }) + .finally(() => { + abortRef.current = null + }) + } + + useEffect( + () => () => { + abortRef.current?.abort() + if (urlRef.current) URL.revokeObjectURL(urlRef.current) + }, + [], + ) + + return ( +
+
+
+ +
+

Word → PDF

+

+ docx → PDF на docx4j + Apache FOP. Лимиты: файл ≤ 5 МБ, документ ≤ 100 + страниц. +

+
+
+ +
+ + +
+ +
+ + {status === 'done' && result && ( + + )} + {status === 'error' && error && } + + {status === 'done' && result && ( + + )} +
+ + +
+
+ ) +} diff --git a/wordpdf-web/src/components/DropZone.tsx b/wordpdf-web/src/components/DropZone.tsx new file mode 100644 index 0000000..de29522 --- /dev/null +++ b/wordpdf-web/src/components/DropZone.tsx @@ -0,0 +1,77 @@ +import { useRef, useState } from 'react' +import type { DragEvent } from 'react' + +interface Props { + file: File | null + disabled: boolean + onSelect: (file: File) => void +} + +/** + * Зона drag&drop + клик для выбора .docx. Скрытый input[type=file] — + * единственный источник выбора; drop берёт первый файл. + */ +export default function DropZone({ file, disabled, onSelect }: Props) { + const inputRef = useRef(null) + const [dragging, setDragging] = useState(false) + + const onDrop = (e: DragEvent) => { + e.preventDefault() + setDragging(false) + if (disabled) return + const dropped = e.dataTransfer.files[0] + if (dropped) onSelect(dropped) + } + + return ( + + ) +} diff --git a/wordpdf-web/src/components/Logo.tsx b/wordpdf-web/src/components/Logo.tsx new file mode 100644 index 0000000..121b53c --- /dev/null +++ b/wordpdf-web/src/components/Logo.tsx @@ -0,0 +1,21 @@ +/** Логотип: лист A4 → стрелка → лист PDF. Красится currentColor. */ +export default function Logo({ className }: { className?: string }) { + return ( + + ) +} diff --git a/wordpdf-web/src/components/PdfPreview.tsx b/wordpdf-web/src/components/PdfPreview.tsx new file mode 100644 index 0000000..f5d8795 --- /dev/null +++ b/wordpdf-web/src/components/PdfPreview.tsx @@ -0,0 +1,34 @@ +interface Props { + url: string + filename: string +} + +/** Предпросмотр PDF (blob-URL в iframe) + кнопки скачивания. */ +export default function PdfPreview({ url, filename }: Props) { + return ( +
+