commit 80c23ac51cd0e7642f3c3975fb91b82fd094bcc1 Author: Formsmith Date: Sat Jun 6 23:10:29 2026 +0300 Initial SketchForge open source release diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..f5e6522 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +# No environment variables are required for local development. diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3e0c6c4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +* text=auto eol=lf + +*.png binary +*.wasm binary +*.ico binary diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..67c8ac6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,45 @@ +name: Bug report +description: Report something broken or unexpected. +title: "[Bug]: " +labels: ["bug"] +body: + - type: textarea + id: summary + attributes: + label: Summary + description: What happened? + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce + description: List the exact steps needed to reproduce the issue. + placeholder: | + 1. Add a box + 2. Import an STL + 3. Group the shapes + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected behavior + validations: + required: true + - type: textarea + id: actual + attributes: + label: Actual behavior + validations: + required: true + - type: input + id: browser + attributes: + label: Browser and OS + placeholder: Chrome on Windows 11 + - type: textarea + id: media + attributes: + label: Screenshots or recordings + description: Add screenshots, recordings, or sample STL files if they help. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..0086358 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..fb7f0de --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,24 @@ +name: Feature request +description: Suggest an improvement or new editor capability. +title: "[Feature]: " +labels: ["enhancement"] +body: + - type: textarea + id: problem + attributes: + label: Problem + description: What workflow is difficult or missing today? + validations: + required: true + - type: textarea + id: proposal + attributes: + label: Proposal + description: What would you like to happen? + validations: + required: true + - type: textarea + id: context + attributes: + label: Extra context + description: Screenshots, examples, or related tools. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..8894655 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ +## Summary + +- + +## Testing + +- [ ] `npm run typecheck` +- [ ] Manually tested the affected workflow + +## Notes + +- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..17df19a --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# Dependencies +node_modules/ +.pnp +.pnp.* + +# Next.js +.next/ +out/ +build/ +dist/ + +# Environment files +.env +.env*.local +!.env.example + +# Logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# TypeScript +*.tsbuildinfo + +# Test and automation output +coverage/ +test-results/ +playwright-report/ +.playwright-cli/ + +# Deployment/local workspace state +.vercel/ +.codex/ +.codex-remote-attachments/ + +# OS/editor noise +.DS_Store +Thumbs.db +.idea/ +.vscode/ +*.swp +*.swo diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..db35e04 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +## 0.1.0 + +- Initial open-source alpha. +- Browser-based 3D workspace with primitive shape editing. +- STL import and STL/OBJ export. +- Grouping and hole subtraction workflows. +- Local project dashboard with generated thumbnails. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..eeb17c4 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,5 @@ +# Code of Conduct + +Be respectful, constructive, and patient with other contributors. + +This project is a small alpha codebase. Good bug reports, careful testing, and clear explanations are valued as much as code changes. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d83c0f8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,37 @@ +# Contributing + +Thanks for helping improve SketchForge. + +## Local Setup + +```bash +npm install +npm run dev +``` + +The app runs at `http://127.0.0.1:3000/` by default. + +## Before Opening a Pull Request + +- Keep changes focused. +- Avoid unrelated refactors. +- Run `npm run typecheck`. +- Manually test the editor workflow you changed. +- Include screenshots or short recordings for UI changes when possible. +- Call out changes to storage, import, export, grouping, or undo/redo behavior. + +## Areas That Need Care + +- STL import/export +- Imported mesh transforms +- Grouping, hole subtraction, and ungrouping +- Undo/redo history +- Project persistence and dashboard thumbnails +- Shape gizmos, snapping, and rotated-object dimensions + +## Style + +- Prefer existing project patterns before adding new abstractions. +- Keep UI behavior local to the relevant component unless the behavior is shared. +- Use TypeScript types instead of loose object shapes where practical. +- Keep comments short and useful. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8135b1d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 SketchForge contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..840338d --- /dev/null +++ b/README.md @@ -0,0 +1,83 @@ +# SketchForge + +An experimental browser-based 3D design workspace with STL import, shape grouping, hole subtraction, project thumbnails, and STL/OBJ export. + +## Status + +This is an alpha project. The editor is usable, but the codebase is still moving quickly and some workflows need more automated coverage before a stable release. + +## Features + +- Local project dashboard with generated thumbnails +- Primitive shape editing with resize, lift, rotate, mirror, align, copy, paste, undo, and redo +- STL import +- Shape grouping and hole subtraction workflows +- STL/OBJ export +- Local-first browser storage using localStorage and IndexedDB + +## Tech Stack + +- Next.js +- React +- TypeScript +- Three.js +- Manifold / CSG geometry tooling + +## Getting Started + +Requirements: + +- Node.js 20 or newer +- npm + +Install dependencies: + +```bash +npm install +``` + +Start the development server: + +```bash +npm run dev +``` + +Open: + +```text +http://127.0.0.1:3000/ +``` + +Run TypeScript checks: + +```bash +npm run typecheck +``` + +Build for production: + +```bash +npm run build +``` + +## Project Structure + +```text +src/app/ Next.js app routes and dashboard +src/components/ Editor, viewport, sidebar, and toolbar components +src/types/ Shared shape and editor types +src/generated/ Generated Manifold runtime source used by the app +public/assets/ Static UI and shape assets +``` + +## Local Data + +Projects are saved in the browser. Dashboard metadata uses `localStorage`, while shape data is stored in IndexedDB. Clearing browser storage will remove local projects. + +## Contributing + +Contributions are welcome. Please read `CONTRIBUTING.md` before opening a pull request. + +## License + +MIT. See `LICENSE`. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..17a3f37 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,17 @@ +# Security Policy + +## Supported Versions + +This project is currently alpha software. Security fixes are handled on the main development line. + +## Reporting a Vulnerability + +Please report security issues privately through the repository security advisory flow if it is available. + +Useful reports include: + +- Affected version or commit +- Steps to reproduce +- Expected and actual behavior +- Browser and operating system +- Relevant console or server logs with secrets removed diff --git a/next-env.d.ts b/next-env.d.ts new file mode 100644 index 0000000..830fb59 --- /dev/null +++ b/next-env.d.ts @@ -0,0 +1,6 @@ +/// +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/next.config.ts b/next.config.ts new file mode 100644 index 0000000..c45f199 --- /dev/null +++ b/next.config.ts @@ -0,0 +1,20 @@ +import type { NextConfig } from "next"; + +const isStaticExport = process.env.STATIC_EXPORT === "true"; + +const nextConfig: NextConfig = { + devIndicators: false, + allowedDevOrigins: ["localhost", "127.0.0.1", "192.168.2.5"], + images: { + unoptimized: true + }, + ...(isStaticExport + ? { + output: "export" as const, + trailingSlash: true, + assetPrefix: "./", + } + : {}), +}; + +export default nextConfig; diff --git a/open-static.html b/open-static.html new file mode 100644 index 0000000..4a4fd59 --- /dev/null +++ b/open-static.html @@ -0,0 +1,11 @@ + + + + + + Open SketchForge + + + Open SketchForge + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..cbc2b9b --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2000 @@ +{ + "name": "sketchforge", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sketchforge", + "version": "0.1.0", + "dependencies": { + "@tailwindcss/postcss": "^4.1.8", + "@types/three": "^0.184.1", + "clsx": "^2.1.1", + "lucide-react": "^0.511.0", + "manifold-3d": "^3.5.0", + "next": "^15.3.2", + "react": "^19.1.0", + "react-dom": "^19.1.0", + "tailwind-merge": "^3.3.0", + "tailwindcss": "^4.1.8", + "three": "^0.184.0", + "three-bvh-csg": "^0.0.18" + }, + "devDependencies": { + "@types/node": "^22.15.18", + "@types/react": "^19.1.4", + "@types/react-dom": "^19.1.5", + "typescript": "^5.8.3" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@dimforge/rapier3d-compat": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@dimforge/rapier3d-compat/-/rapier3d-compat-0.12.0.tgz", + "integrity": "sha512-uekIGetywIgopfD97oDL5PfeezkFpNhwlzlaEYNOA0N6ghdsOvh/HYjSMek5Q2O1PYvRSDFcqFVJl4r4ZBwOow==", + "license": "Apache-2.0" + }, + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@gltf-transform/core": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/core/-/core-4.3.0.tgz", + "integrity": "sha512-ZeaQfszGJ9LYwELszu45CuDQCsE26lJNNe36FVmN8xclaT6WDdCj7fwGpQXo0/l/YgAVAHX+uO7YNBW75/SRYw==", + "license": "MIT", + "dependencies": { + "property-graph": "^4.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/donmccurdy" + } + }, + "node_modules/@gltf-transform/extensions": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/extensions/-/extensions-4.3.0.tgz", + "integrity": "sha512-XDAjQPYVMHa/VDpSbfCBwI+/1muwRJCaXhUpLgnUzAjn0D//PgvIAcbNm1EwBl3LIWBSwjDUCn2LiMAjp+aXVw==", + "license": "MIT", + "dependencies": { + "@gltf-transform/core": "^4.3.0", + "ktx-parse": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/donmccurdy" + } + }, + "node_modules/@gltf-transform/functions": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@gltf-transform/functions/-/functions-4.3.0.tgz", + "integrity": "sha512-FZggHVgt3DHOezgESBrf2vDzuD2FYQYaNT2sT/aP316SIwhuiIwby3z7rhV9joDvWqqUaPkf1UmkjlOaY9riSQ==", + "license": "MIT", + "dependencies": { + "@gltf-transform/core": "^4.3.0", + "@gltf-transform/extensions": "^4.3.0", + "ktx-parse": "^1.0.1", + "ndarray": "^1.0.19", + "ndarray-lanczos": "^0.3.0", + "ndarray-pixels": "^5.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/donmccurdy" + } + }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", + "cpu": [ + "ppc64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", + "cpu": [ + "riscv64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "cpu": [ + "ppc64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", + "cpu": [ + "riscv64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.7.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "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.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "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/@jscadui/3mf-export": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@jscadui/3mf-export/-/3mf-export-0.5.0.tgz", + "integrity": "sha512-y5vZktqCjyi7wA38zqNlLIdZUIRZoOO9vCjLzwmL4bR0hk7B/Zm1IeffzJPFe1vFc0C1IEv3hm8caDv3doRk9g==", + "license": "MIT" + }, + "node_modules/@next/env": { + "version": "15.5.18", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.5.18.tgz", + "integrity": "sha512-hAV85Ckd9QR6RvH04MEKwsfLTksvFpO47j9xwtoIuvuPnlwecpSi+uZTtm8HirVbtlI2Fnz//xpcSTjFdyJk+g==", + "license": "MIT" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "15.5.18", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.5.18.tgz", + "integrity": "sha512-w0WvQf1n+txiwns/9pwIQteCJpZTbxzO2SE0FLcwuD4v0WEh1JPOjdyxWL21XwJsdpx8cFRjyzxzCS/siP7HcQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "15.5.18", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.5.18.tgz", + "integrity": "sha512-znn71QmDuxm+BOaglihMZfvyySMnNljkVIY5Z2TCssBmm+WqL6c19VhtH5ktFkHa8EZ2bnTUpcNcmNSQsg67og==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "15.5.18", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.5.18.tgz", + "integrity": "sha512-yPPe5MNL+igZUa+OsqQJisqSfh6oarIuA1Q0BDxljGJhRQyZeP+WRHh7rs/jZUGMh5aY0YdIjXZG0VohkKkUdw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "15.5.18", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.5.18.tgz", + "integrity": "sha512-glaCczEWIrHsokFZ3pP08U4BpKxwIdnT+txdOM32OBgpL9Yw4aqx8NejmgtZQZOdstQ5f0L3CasIZudzCuD+nw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "15.5.18", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.5.18.tgz", + "integrity": "sha512-oUfg2EgJmU3R0OCOWiokGFUTvZiPfXtriXiuF3YNxRoROCdgvTedHIzYoeKH34gsZxS/V7mHbfq2hpAHwhH1/A==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "15.5.18", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.5.18.tgz", + "integrity": "sha512-JLxSP3KTd9iu/bvUMQxH7RJo9xKSHf55/6RPE4a6FTSZygGn7uvZbCej0AHXydwkggQGSD9UddSjwv6Xz5ESfA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "15.5.18", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.5.18.tgz", + "integrity": "sha512-ir1v7enP52K2HNz3tQQvwF+x7VNxBk1ciiZ18WBPvxf4C59IqdfmHPJYK3vH7rSxpuCVw/8C712wTXNAtEp+NA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "15.5.18", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.5.18.tgz", + "integrity": "sha512-LIu5me6QTANCd25E7I5uIEfvgQ06RK7tvHAbYo3zCb3VpxQEPvMcSpd87NwUABDT6MbGPdEGR5VRiK4PPTJhQg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nodable/entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-nyT7T3nbMyBI/lvr6L5TyWbFJAI9FTgVRakNoBqCD+PmID8DzFrrNdLLtHMwMszOtqZa8PAOV24ZqDnQrhQINA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/nodable" + } + ], + "license": "MIT" + }, + "node_modules/@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@tailwindcss/node": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.0.tgz", + "integrity": "sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g==", + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.21.0", + "jiti": "^2.6.1", + "lightningcss": "1.32.0", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.3.0" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.0.tgz", + "integrity": "sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg==", + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.3.0", + "@tailwindcss/oxide-darwin-arm64": "4.3.0", + "@tailwindcss/oxide-darwin-x64": "4.3.0", + "@tailwindcss/oxide-freebsd-x64": "4.3.0", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.0", + "@tailwindcss/oxide-linux-arm64-gnu": "4.3.0", + "@tailwindcss/oxide-linux-arm64-musl": "4.3.0", + "@tailwindcss/oxide-linux-x64-gnu": "4.3.0", + "@tailwindcss/oxide-linux-x64-musl": "4.3.0", + "@tailwindcss/oxide-wasm32-wasi": "4.3.0", + "@tailwindcss/oxide-win32-arm64-msvc": "4.3.0", + "@tailwindcss/oxide-win32-x64-msvc": "4.3.0" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.0.tgz", + "integrity": "sha512-TJPiq67tKlLuObP6RkwvVGDoxCMBVtDgKkLfa/uyj7/FyxvQwHS+UOnVrXXgbEsfUaMgiVvC4KbJnRr26ho4Ng==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.0.tgz", + "integrity": "sha512-oMN/WZRb+SO37BmUElEgeEWuU8E/HXRkiODxJxLe1UTHVXLrdVSgfaJV7pSlhRGMSOiXLuxTIjfsF3wYvz8cgQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.0.tgz", + "integrity": "sha512-N6CUmu4a6bKVADfw77p+iw6Yd9Q3OBhe0veaDX+QazfuVYlQsHfDgxBrsjQ/IW+zywL8mTrNd0SdJT/zgtvMdA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.0.tgz", + "integrity": "sha512-zDL5hBkQdH5C6MpqbK3gQAgP80tsMwSI26vjOzjJtNCMUo0lFgOItzHKBIupOZNQxt3ouPH7RPhvNhiTfCe5CQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.0.tgz", + "integrity": "sha512-R06HdNi7A7OEoMsf6d4tjZ71RCWnZQPHj2mnotSFURjNLdBC+cIgXQ7l81CqeoiQftjf6OOblxXMInMgN2VzMA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.0.tgz", + "integrity": "sha512-qTJHELX8jetjhRQHCLilkVLmybpzNQAtaI/gaoVoidn/ufbNDbAo8KlK2J+yPoc8wQxvDxCmh/5lr8nC1+lTbg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.0.tgz", + "integrity": "sha512-Z6sukiQsngnWO+l39X4pPbiWT81IC+PLKF+PHxIlyZbGNb9MODfYlXEVlFvej5BOZInWX01kVyzeLvHsXhfczQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.0.tgz", + "integrity": "sha512-DRNdQRpSGzRGfARVuVkxvM8Q12nh19l4BF/G7zGA1oe+9wcC6saFBHTISrpIcKzhiXtSrlSrluCfvMuledoCTQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.0.tgz", + "integrity": "sha512-Z0IADbDo8bh6I7h2IQMx601AdXBLfFpEdUotft86evd/8ZPflZe9COPO8Q1vw+pfLWIUo9zN/JGZvwuAJqduqg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.0.tgz", + "integrity": "sha512-HNZGOUxEmElksYR7S6sC5jTeNGpobAsy9u7Gu0AskJ8/20FR9GqebUyB+HBcU/ax6BHuiuJi+Oda4B+YX6H1yA==", + "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.10.0", + "@emnapi/runtime": "^1.10.0", + "@emnapi/wasi-threads": "^1.2.1", + "@napi-rs/wasm-runtime": "^1.1.4", + "@tybys/wasm-util": "^0.10.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.0.tgz", + "integrity": "sha512-Pe+RPVTi1T+qymuuRpcdvwSVZjnll/f7n8gBxMMh3xLTctMDKqpdfGimbMyioqtLhUYZxdJ9wGNhV7MKHvgZsQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.0.tgz", + "integrity": "sha512-Mvrf2kXW/yeW/OTezZlCGOirXRcUuLIBx/5Y12BaPM7wJoryG6dfS/NJL8aBPqtTEx/Vm4T4vKzFUcKDT+TKUA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/postcss": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/postcss/-/postcss-4.3.0.tgz", + "integrity": "sha512-Jm05Tjx+9yCLGv5qw1c+84Psds8MnyrEQYCB+FFk2lgGiUjlRqdxke4mVTuYrj2xnVZqKim2Apr5ySuQRYAw/w==", + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "@tailwindcss/node": "4.3.0", + "@tailwindcss/oxide": "4.3.0", + "postcss": "^8.5.10", + "tailwindcss": "4.3.0" + } + }, + "node_modules/@tweenjs/tween.js": { + "version": "23.1.3", + "resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-23.1.3.tgz", + "integrity": "sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA==", + "license": "MIT" + }, + "node_modules/@types/ndarray": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@types/ndarray/-/ndarray-1.0.14.tgz", + "integrity": "sha512-oANmFZMnFQvb219SSBIhI1Ih/r4CvHDOzkWyJS/XRqkMrGH5/kaPSA1hQhdIBzouaE+5KpE/f5ylI9cujmckQg==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.19.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.19.tgz", + "integrity": "sha512-dyh/xO2Fh5bYrfWaaqGrRQQGkNdmYw6AmaAUvYeUMNTWQtvb796ikLdmTchRmOlOiIJ1TDXfWgVx1QkUlQ6Hew==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/react": { + "version": "19.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", + "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@types/stats.js": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.4.tgz", + "integrity": "sha512-jIBvWWShCvlBqBNIZt0KAshWpvSjhkwkEu4ZUcASoAvhmrgAUI2t1dXrjSL4xXVLB4FznPrIsX3nKXFl/Dt4vA==", + "license": "MIT" + }, + "node_modules/@types/three": { + "version": "0.184.1", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.184.1.tgz", + "integrity": "sha512-6q4VdiqVsrTRqmk62/BnlcAvIrnDM0zf2ZDVKI5kZiniWrSaOHaQzmbp+BNzoggc/8tgW412pL//wZIxu2PPTA==", + "license": "MIT", + "dependencies": { + "@dimforge/rapier3d-compat": "~0.12.0", + "@tweenjs/tween.js": "~23.1.3", + "@types/stats.js": "*", + "@types/webxr": ">=0.5.17", + "fflate": "~0.8.2", + "meshoptimizer": "~1.1.1" + } + }, + "node_modules/@types/webxr": { + "version": "0.5.24", + "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.24.tgz", + "integrity": "sha512-h8fgEd/DpoS9CBrjEQXR+dIDraopAEfu4wYVNY2tEPwk60stPWhvZMf4Foo5FakuQ7HFZoa8WceaWFervK2Ovg==", + "license": "MIT" + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001792", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001792.tgz", + "integrity": "sha512-hVLMUZFgR4JJ6ACt1uEESvQN1/dBVqPAKY0hgrV70eN3391K6juAfTjKZLKvOMsx8PxA7gsY1/tLMMTcfFLLpw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "license": "MIT" + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/commander": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", + "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "license": "MIT" + }, + "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/cwise-compiler": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cwise-compiler/-/cwise-compiler-1.1.3.tgz", + "integrity": "sha512-WXlK/m+Di8DMMcCjcWr4i+XzcQra9eCdXIJrgh4TUgh0pIS/yJduLxS9JgefsHJ/YVLdgPtXm9r62W92MvanEQ==", + "license": "MIT", + "dependencies": { + "uniq": "^1.0.0" + } + }, + "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.21.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.3.tgz", + "integrity": "sha512-QyL119InA+XXEkNLNTPCXPugSvOfhwv0JOlGNzvxs0hZaiHLNvXSpudUWsOlsXGWJh8G6ckCScEkVHfX3kw/2Q==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/esbuild-wasm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.27.7.tgz", + "integrity": "sha512-1k03e2/tGz+sLz3/xzoZmUsIqtaGIvJa8k4UqUeqCUry83nHmlxQYZUUES0WBFUYilSQUf7nDUGAciIIklljSg==", + "license": "MIT", + "peer": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/fast-xml-builder": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.2.0.tgz", + "integrity": "sha512-00aAWieqff+ZJhsXA4g1g7M8k+7AYoMUUHF+/zFb5U6Uv/P0Vl4QZo84/IcufzYalLuEj9928bXN9PbbFzMF0Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "dependencies": { + "path-expression-matcher": "^1.5.0", + "xml-naming": "^0.1.0" + } + }, + "node_modules/fast-xml-parser": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.8.0.tgz", + "integrity": "sha512-6bIM7fsJxeo3uXv7OncQYsBAMPJ7V16Slahl/6M98C/i2q+vB1+4a0MtrvYwDFEUrwDSbAmeLDRXsOBwrL7yAg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "dependencies": { + "@nodable/entities": "^2.1.0", + "fast-xml-builder": "^1.2.0", + "path-expression-matcher": "^1.5.0", + "strnum": "^2.3.0", + "xml-naming": "^0.1.0" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "license": "MIT" + }, + "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/iota-array": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/iota-array/-/iota-array-1.0.0.tgz", + "integrity": "sha512-pZ2xT+LOHckCatGQ3DcG/a+QuEqvoxqkiL7tvE8nn3uuu+f6i1TtpB5/FtWFbxUuVr5PZCx8KskuGatbJDXOWA==", + "license": "MIT" + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "license": "MIT" + }, + "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/ktx-parse": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ktx-parse/-/ktx-parse-1.1.0.tgz", + "integrity": "sha512-mKp3y+FaYgR7mXWAbyyzpa/r1zDWeaunH+INJO4fou3hb45XuNSwar+7llrRyvpMWafxSIi99RNFJ05MHedaJQ==", + "license": "MIT" + }, + "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/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/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/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/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/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/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" + ], + "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.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" + ], + "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.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" + ], + "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.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" + ], + "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.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/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/lucide-react": { + "version": "0.511.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.511.0.tgz", + "integrity": "sha512-VK5a2ydJ7xm8GvBeKLS9mu1pVK6ucef9780JVUjw6bAjJL/QXnd4Y0p7SPeOUMC27YhzNCZvm5d/QX0Tp3rc0w==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "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/manifold-3d": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/manifold-3d/-/manifold-3d-3.5.0.tgz", + "integrity": "sha512-4654oScSU3Xe5ye+otPAm3KNWG72xp946EGBZr0EIBJVCY8QKP09QuN6hpHPbTvYbEKfItKmgyhLHjkm+VA9eA==", + "license": "Apache-2.0", + "dependencies": { + "@gltf-transform/core": "^4.2.0", + "@gltf-transform/extensions": "^4.2.0", + "@gltf-transform/functions": "^4.2.0", + "@jridgewell/resolve-uri": "^3.1.2", + "@jridgewell/trace-mapping": "^0.3.31", + "@jscadui/3mf-export": "^0.5.0", + "commander": "^13.1.0", + "convert-source-map": "^2.0.0", + "fast-xml-parser": "^5.4.2", + "fflate": "^0.8.0", + "magic-string": "^0.30.21" + }, + "bin": { + "manifold-cad": "bin/manifold-cad" + }, + "peerDependencies": { + "@gltf-transform/core": "^4.2.0", + "@gltf-transform/extensions": "^4.2.0", + "@gltf-transform/functions": "^4.2.0", + "esbuild-wasm": "^0.27.3" + } + }, + "node_modules/meshoptimizer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-1.1.1.tgz", + "integrity": "sha512-oRFNWJRDA/WTrVj7NWvqa5HqE1t9MYDj2VaWirQCzCCrAd2GHrqR/sQezCxiWATPNlKTcRaPRHPJwIRoPBAp5g==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "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/ndarray": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/ndarray/-/ndarray-1.0.19.tgz", + "integrity": "sha512-B4JHA4vdyZU30ELBw3g7/p9bZupyew5a7tX1Y/gGeF2hafrPaQZhgrGQfsvgfYbgdFZjYwuEcnaobeM/WMW+HQ==", + "license": "MIT", + "dependencies": { + "iota-array": "^1.0.0", + "is-buffer": "^1.0.2" + } + }, + "node_modules/ndarray-lanczos": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/ndarray-lanczos/-/ndarray-lanczos-0.3.0.tgz", + "integrity": "sha512-5kBmmG3Zvyj77qxIAC4QFLKuYdDIBJwCG+DukT6jQHNa1Ft74/hPH1z5mbQXeHBt8yvGPBGVrr3wEOdJPYYZYg==", + "license": "MIT", + "dependencies": { + "@types/ndarray": "^1.0.11", + "ndarray": "^1.0.19" + } + }, + "node_modules/ndarray-ops": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/ndarray-ops/-/ndarray-ops-1.2.2.tgz", + "integrity": "sha512-BppWAFRjMYF7N/r6Ie51q6D4fs0iiGmeXIACKY66fLpnwIui3Wc3CXiD/30mgLbDjPpSLrsqcp3Z62+IcHZsDw==", + "license": "MIT", + "dependencies": { + "cwise-compiler": "^1.0.0" + } + }, + "node_modules/ndarray-pixels": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ndarray-pixels/-/ndarray-pixels-5.0.1.tgz", + "integrity": "sha512-IBtrpefpqlI8SPDCGjXk4v5NV5z7r3JSuCbfuEEXaM0vrOJtNGgYUa4C3Lt5H+qWdYF4BCPVFsnXhNC7QvZwkw==", + "license": "MIT", + "dependencies": { + "@types/ndarray": "^1.0.14", + "ndarray": "^1.0.19", + "ndarray-ops": "^1.2.2", + "sharp": "^0.34.0" + } + }, + "node_modules/next": { + "version": "15.5.18", + "resolved": "https://registry.npmjs.org/next/-/next-15.5.18.tgz", + "integrity": "sha512-eKL8zUJkX9Y5lE+RX/2YJoItVdGlIscyVyboeD9wSpp0PaGqjoA4tTpT2qPqz9ax+5IzGESyLSeZ/RCwbSZ2uQ==", + "license": "MIT", + "dependencies": { + "@next/env": "15.5.18", + "@swc/helpers": "0.5.15", + "caniuse-lite": "^1.0.30001579", + "postcss": "8.4.31", + "styled-jsx": "5.1.6" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "15.5.18", + "@next/swc-darwin-x64": "15.5.18", + "@next/swc-linux-arm64-gnu": "15.5.18", + "@next/swc-linux-arm64-musl": "15.5.18", + "@next/swc-linux-x64-gnu": "15.5.18", + "@next/swc-linux-x64-musl": "15.5.18", + "@next/swc-win32-arm64-msvc": "15.5.18", + "@next/swc-win32-x64-msvc": "15.5.18", + "sharp": "^0.34.3" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.51.1", + "babel-plugin-react-compiler": "*", + "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/next/node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "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.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/path-expression-matcher": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/path-expression-matcher/-/path-expression-matcher-1.5.0.tgz", + "integrity": "sha512-cbrerZV+6rvdQrrD+iGMcZFEiiSrbv9Tfdkvnusy6y0x0GKBXREFg/Y65GhIfm0tnLntThhzCnfKwp1WRjeCyQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "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/postcss": { + "version": "8.5.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.14.tgz", + "integrity": "sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==", + "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.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/property-graph": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/property-graph/-/property-graph-4.1.0.tgz", + "integrity": "sha512-AvPcP7XECNWy4LGmFQ77k7un4lSKM4eS29PTvW4ck95uYeLxXPWJM7hLuBqK91FaHqCcgJvIUCuNJjjxKE7VKQ==", + "license": "MIT" + }, + "node_modules/react": { + "version": "19.2.6", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.6.tgz", + "integrity": "sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.6", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.6.tgz", + "integrity": "sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.6" + } + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strnum": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.3.0.tgz", + "integrity": "sha512-ums3KNd42PGyx5xaoVTO1mjU1bH3NpY4vsrVlnv9PNGqQj8wd7rJ6nEypLrJ7z5vxK5RP0yMLo6J/Gsm62DI5Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, + "node_modules/styled-jsx": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", + "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/tailwind-merge": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.6.0.tgz", + "integrity": "sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/dcastil" + } + }, + "node_modules/tailwindcss": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.0.tgz", + "integrity": "sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q==", + "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/three": { + "version": "0.184.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.184.0.tgz", + "integrity": "sha512-wtTRjG92pM5eUg/KuUnHsqSAlPM296brTOcLgMRqEeylYTh/CdtvKUvCyyCQTzFuStieWxvZb8mVTMvdPyUpxg==", + "license": "MIT" + }, + "node_modules/three-bvh-csg": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/three-bvh-csg/-/three-bvh-csg-0.0.18.tgz", + "integrity": "sha512-M3GCZMmGFgASGuDf+YMamM83nVlD/vdwzVHcYbFxgW+g1S7/nKPiuY00YVHOMbjmJPh8mLevGZL65ItHUuGt2w==", + "license": "MIT", + "peerDependencies": { + "three": ">=0.179.0", + "three-mesh-bvh": ">=0.9.7" + } + }, + "node_modules/three-mesh-bvh": { + "version": "0.9.10", + "resolved": "https://registry.npmjs.org/three-mesh-bvh/-/three-mesh-bvh-0.9.10.tgz", + "integrity": "sha512-UOlTgPIeqUURcwaG8knxvBaruwZlC4X3/WSHEFO7rYvMVv/YNUrkfFEszvfj36pXV88dCHoHNnIp0PifkirnTQ==", + "license": "MIT", + "peer": true, + "peerDependencies": { + "three": ">= 0.159.0" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==", + "license": "MIT" + }, + "node_modules/xml-naming": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/xml-naming/-/xml-naming-0.1.0.tgz", + "integrity": "sha512-k8KO9hrMyNk6tUWqUfkTEZbezRRpONVOzUTnc97VnCvyj6Tf9lyUR9EDAIeiVLv56jsMcoXEwjW8Kv5yPY52lw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "engines": { + "node": ">=16.0.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..5d9ae8c --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "sketchforge", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "export": "set STATIC_EXPORT=true&& next build", + "start": "next start", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "@tailwindcss/postcss": "^4.1.8", + "@types/three": "^0.184.1", + "clsx": "^2.1.1", + "lucide-react": "^0.511.0", + "manifold-3d": "^3.5.0", + "next": "^15.3.2", + "react": "^19.1.0", + "react-dom": "^19.1.0", + "tailwind-merge": "^3.3.0", + "tailwindcss": "^4.1.8", + "three": "^0.184.0", + "three-bvh-csg": "^0.0.18" + }, + "devDependencies": { + "@types/node": "^22.15.18", + "@types/react": "^19.1.4", + "@types/react-dom": "^19.1.5", + "typescript": "^5.8.3" + } +} diff --git a/postcss.config.mjs b/postcss.config.mjs new file mode 100644 index 0000000..5ed0260 --- /dev/null +++ b/postcss.config.mjs @@ -0,0 +1,7 @@ +const config = { + plugins: { + "@tailwindcss/postcss": {} + } +}; + +export default config; diff --git a/public/assets/sketchforge/box-hole.png b/public/assets/sketchforge/box-hole.png new file mode 100644 index 0000000..17446f7 Binary files /dev/null and b/public/assets/sketchforge/box-hole.png differ diff --git a/public/assets/sketchforge/box-red.png b/public/assets/sketchforge/box-red.png new file mode 100644 index 0000000..aaa4aa3 Binary files /dev/null and b/public/assets/sketchforge/box-red.png differ diff --git a/public/assets/sketchforge/cone-purple.png b/public/assets/sketchforge/cone-purple.png new file mode 100644 index 0000000..3c0e8ee Binary files /dev/null and b/public/assets/sketchforge/cone-purple.png differ diff --git a/public/assets/sketchforge/cylinder-hole.png b/public/assets/sketchforge/cylinder-hole.png new file mode 100644 index 0000000..2bf95d3 Binary files /dev/null and b/public/assets/sketchforge/cylinder-hole.png differ diff --git a/public/assets/sketchforge/cylinder-orange.png b/public/assets/sketchforge/cylinder-orange.png new file mode 100644 index 0000000..6318860 Binary files /dev/null and b/public/assets/sketchforge/cylinder-orange.png differ diff --git a/public/assets/sketchforge/extrude-sketch.png b/public/assets/sketchforge/extrude-sketch.png new file mode 100644 index 0000000..5a29fb7 Binary files /dev/null and b/public/assets/sketchforge/extrude-sketch.png differ diff --git a/public/assets/sketchforge/extrude-star-blue.png b/public/assets/sketchforge/extrude-star-blue.png new file mode 100644 index 0000000..6d234a0 Binary files /dev/null and b/public/assets/sketchforge/extrude-star-blue.png differ diff --git a/public/assets/sketchforge/half-sphere-pink.png b/public/assets/sketchforge/half-sphere-pink.png new file mode 100644 index 0000000..16c69bb Binary files /dev/null and b/public/assets/sketchforge/half-sphere-pink.png differ diff --git a/public/assets/sketchforge/heart-red.png b/public/assets/sketchforge/heart-red.png new file mode 100644 index 0000000..6d234a0 Binary files /dev/null and b/public/assets/sketchforge/heart-red.png differ diff --git a/public/assets/sketchforge/icosahedron-red.png b/public/assets/sketchforge/icosahedron-red.png new file mode 100644 index 0000000..f0d6ffb Binary files /dev/null and b/public/assets/sketchforge/icosahedron-red.png differ diff --git a/public/assets/sketchforge/polygon-blue.png b/public/assets/sketchforge/polygon-blue.png new file mode 100644 index 0000000..b4e837a Binary files /dev/null and b/public/assets/sketchforge/polygon-blue.png differ diff --git a/public/assets/sketchforge/pyramid-yellow.png b/public/assets/sketchforge/pyramid-yellow.png new file mode 100644 index 0000000..226f641 Binary files /dev/null and b/public/assets/sketchforge/pyramid-yellow.png differ diff --git a/public/assets/sketchforge/revolve-sketch.png b/public/assets/sketchforge/revolve-sketch.png new file mode 100644 index 0000000..b418888 Binary files /dev/null and b/public/assets/sketchforge/revolve-sketch.png differ diff --git a/public/assets/sketchforge/ring-brown.png b/public/assets/sketchforge/ring-brown.png new file mode 100644 index 0000000..bd6f8d0 Binary files /dev/null and b/public/assets/sketchforge/ring-brown.png differ diff --git a/public/assets/sketchforge/roof-green.png b/public/assets/sketchforge/roof-green.png new file mode 100644 index 0000000..d90da5e Binary files /dev/null and b/public/assets/sketchforge/roof-green.png differ diff --git a/public/assets/sketchforge/round-roof-cyan.png b/public/assets/sketchforge/round-roof-cyan.png new file mode 100644 index 0000000..3fd824e Binary files /dev/null and b/public/assets/sketchforge/round-roof-cyan.png differ diff --git a/public/assets/sketchforge/scribble.png b/public/assets/sketchforge/scribble.png new file mode 100644 index 0000000..562190d Binary files /dev/null and b/public/assets/sketchforge/scribble.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/box.png b/public/assets/sketchforge/shape-icons-gray/box.png new file mode 100644 index 0000000..a781db6 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/box.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/cone.png b/public/assets/sketchforge/shape-icons-gray/cone.png new file mode 100644 index 0000000..48ad77a Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/cone.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/contact-sheet.png b/public/assets/sketchforge/shape-icons-gray/contact-sheet.png new file mode 100644 index 0000000..e81ada3 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/contact-sheet.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/cylinder.png b/public/assets/sketchforge/shape-icons-gray/cylinder.png new file mode 100644 index 0000000..991768b Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/cylinder.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/half-sphere.png b/public/assets/sketchforge/shape-icons-gray/half-sphere.png new file mode 100644 index 0000000..b560918 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/half-sphere.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/pyramid.png b/public/assets/sketchforge/shape-icons-gray/pyramid.png new file mode 100644 index 0000000..f3b3c1c Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/pyramid.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/raw/box.png b/public/assets/sketchforge/shape-icons-gray/raw/box.png new file mode 100644 index 0000000..cfcca56 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/raw/box.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/raw/cone.png b/public/assets/sketchforge/shape-icons-gray/raw/cone.png new file mode 100644 index 0000000..8f604dd Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/raw/cone.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/raw/cylinder.png b/public/assets/sketchforge/shape-icons-gray/raw/cylinder.png new file mode 100644 index 0000000..4bd271d Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/raw/cylinder.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/raw/half-sphere.png b/public/assets/sketchforge/shape-icons-gray/raw/half-sphere.png new file mode 100644 index 0000000..1f68c47 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/raw/half-sphere.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/raw/pyramid.png b/public/assets/sketchforge/shape-icons-gray/raw/pyramid.png new file mode 100644 index 0000000..5a81087 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/raw/pyramid.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/raw/round-roof.png b/public/assets/sketchforge/shape-icons-gray/raw/round-roof.png new file mode 100644 index 0000000..6259ecd Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/raw/round-roof.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/raw/sphere.png b/public/assets/sketchforge/shape-icons-gray/raw/sphere.png new file mode 100644 index 0000000..41e33b9 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/raw/sphere.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/raw/text.png b/public/assets/sketchforge/shape-icons-gray/raw/text.png new file mode 100644 index 0000000..3533b08 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/raw/text.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/raw/torus.png b/public/assets/sketchforge/shape-icons-gray/raw/torus.png new file mode 100644 index 0000000..0c51f53 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/raw/torus.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/raw/tube.png b/public/assets/sketchforge/shape-icons-gray/raw/tube.png new file mode 100644 index 0000000..812d508 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/raw/tube.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/raw/wedge.png b/public/assets/sketchforge/shape-icons-gray/raw/wedge.png new file mode 100644 index 0000000..79e8611 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/raw/wedge.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/round-roof.png b/public/assets/sketchforge/shape-icons-gray/round-roof.png new file mode 100644 index 0000000..626ef45 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/round-roof.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/sphere.png b/public/assets/sketchforge/shape-icons-gray/sphere.png new file mode 100644 index 0000000..aed10f8 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/sphere.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/text.png b/public/assets/sketchforge/shape-icons-gray/text.png new file mode 100644 index 0000000..b8c3fd1 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/text.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/torus.png b/public/assets/sketchforge/shape-icons-gray/torus.png new file mode 100644 index 0000000..bae8917 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/torus.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/tube.png b/public/assets/sketchforge/shape-icons-gray/tube.png new file mode 100644 index 0000000..a13150c Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/tube.png differ diff --git a/public/assets/sketchforge/shape-icons-gray/wedge.png b/public/assets/sketchforge/shape-icons-gray/wedge.png new file mode 100644 index 0000000..5981871 Binary files /dev/null and b/public/assets/sketchforge/shape-icons-gray/wedge.png differ diff --git a/public/assets/sketchforge/sketchforge-logo.png b/public/assets/sketchforge/sketchforge-logo.png new file mode 100644 index 0000000..5c5ba4f Binary files /dev/null and b/public/assets/sketchforge/sketchforge-logo.png differ diff --git a/public/assets/sketchforge/sphere-blue.png b/public/assets/sketchforge/sphere-blue.png new file mode 100644 index 0000000..71e588f Binary files /dev/null and b/public/assets/sketchforge/sphere-blue.png differ diff --git a/public/assets/sketchforge/sphere-hole.png b/public/assets/sketchforge/sphere-hole.png new file mode 100644 index 0000000..aa15a7c Binary files /dev/null and b/public/assets/sketchforge/sphere-hole.png differ diff --git a/public/assets/sketchforge/star-red.png b/public/assets/sketchforge/star-red.png new file mode 100644 index 0000000..9e9bb61 Binary files /dev/null and b/public/assets/sketchforge/star-red.png differ diff --git a/public/assets/sketchforge/text-red.png b/public/assets/sketchforge/text-red.png new file mode 100644 index 0000000..530ab78 Binary files /dev/null and b/public/assets/sketchforge/text-red.png differ diff --git a/public/assets/sketchforge/toolbar-sprite.svg b/public/assets/sketchforge/toolbar-sprite.svg new file mode 100644 index 0000000..3e04180 --- /dev/null +++ b/public/assets/sketchforge/toolbar-sprite.svg @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + copy + 54x62 + clipboard + 44x63 + hand + 50x61 + brush + 39x63 + trash + 40x62 + undo + 41x41 + redo + 40x40 + lightbulb + 75x67 + selection + 62x73 + group + 55x62 + burst + 49x62 + align + 47x53 + shapes + 44x53 + magnet + 40x63 + eraser + 48x59 + download + 46x56 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/assets/sketchforge/torus-blue.png b/public/assets/sketchforge/torus-blue.png new file mode 100644 index 0000000..f5178e3 Binary files /dev/null and b/public/assets/sketchforge/torus-blue.png differ diff --git a/public/assets/sketchforge/tube-orange.png b/public/assets/sketchforge/tube-orange.png new file mode 100644 index 0000000..22401c5 Binary files /dev/null and b/public/assets/sketchforge/tube-orange.png differ diff --git a/public/assets/sketchforge/vector-toolbar-icons.svg b/public/assets/sketchforge/vector-toolbar-icons.svg new file mode 100644 index 0000000..3cf3657 --- /dev/null +++ b/public/assets/sketchforge/vector-toolbar-icons.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/assets/sketchforge/wedge-blue.png b/public/assets/sketchforge/wedge-blue.png new file mode 100644 index 0000000..64e228b Binary files /dev/null and b/public/assets/sketchforge/wedge-blue.png differ diff --git a/public/manifold.js b/public/manifold.js new file mode 100644 index 0000000..95bcfe3 --- /dev/null +++ b/public/manifold.js @@ -0,0 +1,2 @@ +async function Module(moduleArg={}){var moduleRtn;var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(ENVIRONMENT_IS_NODE){const{createRequire}=await import("node:module");var require=createRequire(import.meta.url)}var _ManifoldInitialized=false;Module.setup=function(){if(_ManifoldInitialized)return;_ManifoldInitialized=true;Module.initTBB();function toVec(vec,list,f=(x=>x)){if(list){for(let x of list){vec.push_back(f(x))}}return vec}function fromVec(vec,f=(x=>x)){const result=[];const size=vec.size();for(let i=0;ix)){const result=[];const nPoly=vec.size();for(let i=0;itoVec(new Module.Vector_vec2,poly,p=>{if(p instanceof Array)return{x:p[0],y:p[1]};return p}))}function disposePolygons(polygonsVec){for(let i=0;iresult.min[f]),max:["x","y"].map(f=>result.max[f])}};Module.CrossSection.prototype.offset=function(delta,joinType="Round",miterLimit=2,circularSegments=0){return this._Offset(delta,joinTypeToInt(joinType),miterLimit,circularSegments)};Module.CrossSection.prototype.simplify=function(epsilon=1e-6){return this._Simplify(epsilon)};Module.CrossSection.prototype.extrude=function(height,nDivisions=0,twistDegrees=0,scaleTop=[1,1],center=false){scaleTop=vararg2vec2([scaleTop]);const man=Module._Extrude(this._ToPolygons(),height,nDivisions,twistDegrees,scaleTop);return center?man.translate([0,0,-height/2]):man};Module.CrossSection.prototype.revolve=function(circularSegments=0,revolveDegrees=360){return Module._Revolve(this._ToPolygons(),circularSegments,revolveDegrees)};Module.CrossSection.prototype.add=function(other){return this._add(cross(other))};Module.CrossSection.prototype.subtract=function(other){return this._subtract(cross(other))};Module.CrossSection.prototype.intersect=function(other){return this._intersect(cross(other))};Module.CrossSection.prototype.toPolygons=function(){const vec=this._ToPolygons();const result=vec2polygons(vec,v=>[v.x,v.y]);vec.delete();return result};Module.Manifold.prototype.smoothOut=function(minSharpAngle=52.5,minSmoothness=0){return this._SmoothOut(minSharpAngle,minSmoothness)};Module.Manifold.prototype.warp=function(func){const wasmFuncPtr=addFunction(function(vec3Ptr){const x=getValue(vec3Ptr,"double");const y=getValue(vec3Ptr+8,"double");const z=getValue(vec3Ptr+16,"double");const vert=[x,y,z];func(vert);setValue(vec3Ptr,vert[0],"double");setValue(vec3Ptr+8,vert[1],"double");setValue(vec3Ptr+16,vert[2],"double")},"vi");const out=this._Warp(wasmFuncPtr);removeFunction(wasmFuncPtr);const status=out.status();if(status!=="NoError"){throw new Module.ManifoldError(status)}return out};Module.Manifold.prototype.warpBatch=function(func){const wasmFuncPtr=addFunction(function(ptr,count){const heapF64=Module.HEAPF64??HEAPF64;if(!heapF64){throw new Error("WASM heap is not initialized (HEAPF64 unavailable)")}const verts=new Float64Array(heapF64.buffer,ptr,count*3);func(verts,count)},"vii");const out=this._WarpBatch(wasmFuncPtr);removeFunction(wasmFuncPtr);const status=out.status();if(status!=="NoError"){throw new Module.ManifoldError(status)}return out};Module.Manifold.prototype.calculateNormals=function(normalIdx=0,minSharpAngle=52.5){return this._CalculateNormals(normalIdx,minSharpAngle)};Module.Manifold.prototype.smoothByNormals=function(normalIdx=0){return this._SmoothByNormals(normalIdx)};Module.Manifold.prototype.setProperties=function(numProp,func){const oldNumProp=this.numProp();const wasmFuncPtr=addFunction(function(newPtr,vec3Ptr,oldPtr){const newProp=[];for(let i=0;i({faceID:hit.faceID,distance:hit.distance,position:["x","y","z"].map(f=>hit.position[f]),normal:["x","y","z"].map(f=>hit.normal[f])}));vec.delete();return result};Module.Manifold.prototype.split=function(manifold){const vec=this._Split(manifold);const result=fromVec(vec);vec.delete();return result};Module.Manifold.prototype.splitByPlane=function(normal,offset=0){const vec=this._SplitByPlane(vararg2vec3([normal]),offset);const result=fromVec(vec);vec.delete();return result};Module.Manifold.prototype.decompose=function(){const vec=this._Decompose();const result=fromVec(vec);vec.delete();return result};Module.Manifold.prototype.boundingBox=function(){const result=this._boundingBox();return{min:["x","y","z"].map(f=>result.min[f]),max:["x","y","z"].map(f=>result.max[f])}};Module.Manifold.prototype.simplify=function(tolerance=0){return this._Simplify(tolerance)};class Mesh{constructor({numProp=3,triVerts=new Uint32Array,vertProperties=new Float32Array,mergeFromVert,mergeToVert,runIndex,runOriginalID,faceID,halfedgeTangent,runTransform,runFlags,tolerance=0}={}){this.numProp=numProp;this.triVerts=triVerts;this.vertProperties=vertProperties;this.mergeFromVert=mergeFromVert;this.mergeToVert=mergeToVert;this.runIndex=runIndex;this.runOriginalID=runOriginalID;this.faceID=faceID;this.halfedgeTangent=halfedgeTangent;this.runTransform=runTransform;this.runFlags=runFlags;this.tolerance=tolerance}get numTri(){return this.triVerts.length/3}get numVert(){return this.vertProperties.length/this.numProp}get numRun(){return this.runOriginalID.length}merge(){const{changed,mesh}=Module._Merge(this);Object.assign(this,{...mesh});return changed}verts(tri){return this.triVerts.subarray(3*tri,3*(tri+1))}position(vert){return this.vertProperties.subarray(this.numProp*vert,this.numProp*vert+3)}extras(vert){return this.vertProperties.subarray(this.numProp*vert+3,this.numProp*(vert+1))}tangent(halfedge){return this.halfedgeTangent.subarray(4*halfedge,4*(halfedge+1))}transform(run){const mat4=new Array(16);for(const col of[0,1,2,3]){for(const row of[0,1,2]){mat4[4*col+row]=this.runTransform[12*run+3*col+row]}}mat4[15]=1;return mat4}backside(run){return this.runFlags!=null&&run{if(p instanceof Array)return{x:p[0],y:p[1]};return p})}Module.CrossSection.hull=function(...args){if(args.length==1)args=args[0];let pts=new Module.Vector_vec2;for(const cs of args){if(cs instanceof CrossSectionCtor){Module._crossSectionCollectVertices(pts,cs)}else if(cs instanceof Array&&cs.length==2&&typeof cs[0]=="number"){pts.push_back({x:cs[0],y:cs[1]})}else if(cs.x){pts.push_back(cs)}else{const wrap=cs[0].length==2&&typeof cs[0][0]=="number"||cs[0].x;const polys=wrap?[cs]:cs;for(const poly of polys)pushVec2(pts,poly)}}const result=Module._crossSectionHullPoints(pts);pts.delete();return result};Module.CrossSection.prototype=Object.create(CrossSectionCtor.prototype);Object.defineProperty(Module.CrossSection,Symbol.hasInstance,{get:()=>t=>t instanceof CrossSectionCtor});const ManifoldCtor=Module.Manifold;Module.Manifold=function(mesh){const manifold=new ManifoldCtor(mesh);const status=manifold.status();if(status!=="NoError"){throw new Module.ManifoldError(status)}return manifold};Module.Manifold.ofMesh=function(mesh){return new Module.Manifold(mesh)};Module.Manifold.tetrahedron=function(){return Module._Tetrahedron()};Module.Manifold.cube=function(...args){let size=undefined;if(args.length==0)size={x:1,y:1,z:1};else if(typeof args[0]=="number")size={x:args[0],y:args[0],z:args[0]};else size=vararg2vec3(args);const center=args[1]||false;return Module._Cube(size,center)};Module.Manifold.cylinder=function(height,radiusLow,radiusHigh=-1,circularSegments=0,center=false){return Module._Cylinder(height,radiusLow,radiusHigh,circularSegments,center)};Module.Manifold.sphere=function(radius,circularSegments=0){return Module._Sphere(radius,circularSegments)};Module.Manifold.smooth=function(mesh,sharpenedEdges=[]){const sharp=new Module.Vector_smoothness;toVec(sharp,sharpenedEdges);const result=Module._Smooth(mesh,sharp);sharp.delete();return result};Module.Manifold.extrude=function(polygons,height,nDivisions=0,twistDegrees=0,scaleTop=[1,1],center=false){const cs=polygons instanceof CrossSectionCtor?polygons:Module.CrossSection(polygons,"Positive");return cs.extrude(height,nDivisions,twistDegrees,scaleTop,center)};Module.Manifold.revolve=function(polygons,circularSegments=0,revolveDegrees=360){const cs=polygons instanceof CrossSectionCtor?polygons:Module.CrossSection(polygons,"Positive");return cs.revolve(circularSegments,revolveDegrees)};Module.Manifold.reserveIDs=function(n){return Module._ReserveIDs(n)};function manifoldBatchbool(name){return function(...args){if(args.length==1)args=args[0];const v=new Module.Vector_manifold;for(const m of args)v.push_back(m);const result=Module["_manifold"+name+"N"](v);v.delete();return result}}Module.Manifold.union=manifoldBatchbool("Union");Module.Manifold.compose=Module.Manifold.union;Module.Manifold.difference=manifoldBatchbool("Difference");Module.Manifold.intersection=manifoldBatchbool("Intersection");Module.Manifold.levelSet=function(sdf,bounds,edgeLength,level=0,tolerance=-1){const bounds2={min:{x:bounds.min[0],y:bounds.min[1],z:bounds.min[2]},max:{x:bounds.max[0],y:bounds.max[1],z:bounds.max[2]}};const wasmFuncPtr=addFunction(function(vec3Ptr){const x=getValue(vec3Ptr,"double");const y=getValue(vec3Ptr+8,"double");const z=getValue(vec3Ptr+16,"double");const vert=[x,y,z];return sdf(vert)},"di");const out=Module._LevelSet(wasmFuncPtr,bounds2,edgeLength,level,tolerance);removeFunction(wasmFuncPtr);return out};function pushVec3(vec,ps){toVec(vec,ps,p=>{if(p instanceof Array)return{x:p[0],y:p[1],z:p[2]};return p})}Module.Manifold.hull=function(...args){if(args.length==1)args=args[0];let pts=new Module.Vector_vec3;for(const m of args){if(m instanceof ManifoldCtor){Module._manifoldCollectVertices(pts,m)}else if(m instanceof Array&&m.length==3&&typeof m[0]=="number"){pts.push_back({x:m[0],y:m[1],z:m[2]})}else if(m.x){pts.push_back(m)}else{pushVec3(pts,m)}}const result=Module._manifoldHullPoints(pts);pts.delete();return result};Module.Manifold.prototype=Object.create(ManifoldCtor.prototype);Object.defineProperty(Module.Manifold,Symbol.hasInstance,{get:()=>t=>t instanceof ManifoldCtor});Module.triangulate=function(polygons,epsilon=-1,allowConvex=true){const polygonsVec=polygons2vec(polygons);const result=fromVec(Module._Triangulate(polygonsVec,epsilon,allowConvex),x=>[x[0],x[1],x[2]]);disposePolygons(polygonsVec);return result}};var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var _scriptName=import.meta.url;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("node:fs");if(_scriptName.startsWith("file:")){scriptDirectory=require("node:path").dirname(require("node:url").fileURLToPath(_scriptName))+"/"}readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{if(isFileURI(url)){return new Promise((resolve,reject)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){resolve(xhr.response);return}reject(xhr.status)};xhr.onerror=reject;xhr.send(null)})}var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;var isFileURI=filename=>filename.startsWith("file://");var readyPromiseResolve,readyPromiseReject;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var HEAP64,HEAPU64;var runtimeInitialized=false;function updateMemoryViews(){var b=wasmMemory.buffer;HEAP8=new Int8Array(b);HEAP16=new Int16Array(b);HEAPU8=new Uint8Array(b);HEAPU16=new Uint16Array(b);HEAP32=new Int32Array(b);HEAPU32=new Uint32Array(b);HEAPF32=new Float32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b);HEAPU64=new BigUint64Array(b)}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports["J"]()}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(onPostRuns)}function abort(what){Module["onAbort"]?.(what);what="Aborted("+what+")";err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject?.(e);throw e}var wasmBinaryFile;function findWasmBinary(){if(Module["locateFile"]){return locateFile("manifold.wasm")}return new URL("manifold.wasm",import.meta.url).href}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){var imports={a:wasmImports};return imports}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;wasmExports=applySignatureConversions(wasmExports);assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"])}var info=getWasmImports();if(Module["instantiateWasm"]){return new Promise((resolve,reject)=>{Module["instantiateWasm"](info,(inst,mod)=>{resolve(receiveInstance(inst,mod))})})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var addOnPostRun=cb=>onPostRuns.push(cb);var onPreRuns=[];var addOnPreRun=cb=>onPreRuns.push(cb);function getValue(ptr,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":return HEAP8[ptr>>>0];case"i8":return HEAP8[ptr>>>0];case"i16":return HEAP16[ptr>>>1>>>0];case"i32":return HEAP32[ptr>>>2>>>0];case"i64":return HEAP64[ptr>>>3>>>0];case"float":return HEAPF32[ptr>>>2>>>0];case"double":return HEAPF64[ptr>>>3>>>0];case"*":return HEAPU32[ptr>>>2>>>0];default:abort(`invalid type for getValue: ${type}`)}}var noExitRuntime=true;function setValue(ptr,value,type="i8"){if(type.endsWith("*"))type="*";switch(type){case"i1":HEAP8[ptr>>>0]=value;break;case"i8":HEAP8[ptr>>>0]=value;break;case"i16":HEAP16[ptr>>>1>>>0]=value;break;case"i32":HEAP32[ptr>>>2>>>0]=value;break;case"i64":HEAP64[ptr>>>3>>>0]=BigInt(value);break;case"float":HEAPF32[ptr>>>2>>>0]=value;break;case"double":HEAPF64[ptr>>>3>>>0]=value;break;case"*":HEAPU32[ptr>>>2>>>0]=value;break;default:abort(`invalid type for setValue: ${type}`)}}class ExceptionInfo{constructor(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24}set_type(type){HEAPU32[this.ptr+4>>>2>>>0]=type}get_type(){return HEAPU32[this.ptr+4>>>2>>>0]}set_destructor(destructor){HEAPU32[this.ptr+8>>>2>>>0]=destructor}get_destructor(){return HEAPU32[this.ptr+8>>>2>>>0]}set_caught(caught){caught=caught?1:0;HEAP8[this.ptr+12>>>0]=caught}get_caught(){return HEAP8[this.ptr+12>>>0]!=0}set_rethrown(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>>0]=rethrown}get_rethrown(){return HEAP8[this.ptr+13>>>0]!=0}init(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor)}set_adjusted_ptr(adjustedPtr){HEAPU32[this.ptr+16>>>2>>>0]=adjustedPtr}get_adjusted_ptr(){return HEAPU32[this.ptr+16>>>2>>>0]}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){ptr>>>=0;type>>>=0;destructor>>>=0;var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw exceptionLast}var __abort_js=()=>abort("");var structRegistrations={};var runDestructors=destructors=>{while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}};function readPointer(pointer){return this.fromWireType(HEAPU32[pointer>>>2>>>0])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var InternalError=class InternalError extends Error{constructor(message){super(message);this.name="InternalError"}};var throwInternalError=message=>{throw new InternalError(message)};var whenDependentTypesAreResolved=(myTypes,dependentTypes,getTypeConverters)=>{myTypes.forEach(type=>typeDependencies[type]=dependentTypes);function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i{typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}})}}if(0===unregisteredTypes.length){onComplete(typeConverters)}};var __embind_finalize_value_object=function(structType){structType>>>=0;var reg=structRegistrations[structType];delete structRegistrations[structType];var rawConstructor=reg.rawConstructor;var rawDestructor=reg.rawDestructor;var fieldRecords=reg.fields;var fieldTypes=fieldRecords.map(field=>field.getterReturnType).concat(fieldRecords.map(field=>field.setterArgumentType));whenDependentTypesAreResolved([structType],fieldTypes,fieldTypes=>{var fields={};for(var[i,field]of fieldRecords.entries()){const getterReturnType=fieldTypes[i];const getter=field.getter;const getterContext=field.getterContext;const setterArgumentType=fieldTypes[i+fieldRecords.length];const setter=field.setter;const setterContext=field.setterContext;fields[field.fieldName]={read:ptr=>getterReturnType.fromWireType(getter(getterContext,ptr)),write:(ptr,o)=>{var destructors=[];setter(setterContext,ptr,setterArgumentType.toWireType(destructors,o));runDestructors(destructors)},optional:getterReturnType.optional}}return[{name:reg.name,fromWireType:ptr=>{var rv={};for(var i in fields){rv[i]=fields[i].read(ptr)}rawDestructor(ptr);return rv},toWireType:(destructors,o)=>{for(var fieldName in fields){if(!(fieldName in o)&&!fields[fieldName].optional){throw new TypeError(`Missing field: "${fieldName}"`)}}var ptr=rawConstructor();for(fieldName in fields){fields[fieldName].write(ptr,o[fieldName])}if(destructors!==null){destructors.push(rawDestructor,ptr)}return ptr},readValueFromPointer:readPointer,destructorFunction:rawDestructor}]})};var AsciiToString=ptr=>{ptr>>>=0;var str="";while(1){var ch=HEAPU8[ptr++>>>0];if(!ch)return str;str+=String.fromCharCode(ch)}};var BindingError=class BindingError extends Error{constructor(message){super(message);this.name="BindingError"}};var throwBindingError=message=>{throw new BindingError(message)};function sharedRegisterType(rawType,registeredInstance,options={}){var name=registeredInstance.name;if(!rawType){throwBindingError(`type "${name}" must have a positive integer typeid pointer`)}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError(`Cannot register type '${name}' twice`)}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach(cb=>cb())}}function registerType(rawType,registeredInstance,options={}){return sharedRegisterType(rawType,registeredInstance,options)}var integerReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?pointer=>HEAP8[pointer>>>0]:pointer=>HEAPU8[pointer>>>0];case 2:return signed?pointer=>HEAP16[pointer>>>1>>>0]:pointer=>HEAPU16[pointer>>>1>>>0];case 4:return signed?pointer=>HEAP32[pointer>>>2>>>0]:pointer=>HEAPU32[pointer>>>2>>>0];case 8:return signed?pointer=>HEAP64[pointer>>>3>>>0]:pointer=>HEAPU64[pointer>>>3>>>0];default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};var __embind_register_bigint=function(primitiveType,name,size,minRange,maxRange){primitiveType>>>=0;name>>>=0;size>>>=0;name=AsciiToString(name);const isUnsignedType=minRange===0n;let fromWireType=value=>value;if(isUnsignedType){const bitSize=size*8;fromWireType=value=>BigInt.asUintN(bitSize,value);maxRange=fromWireType(maxRange)}registerType(primitiveType,{name,fromWireType,toWireType:(destructors,value)=>{if(typeof value=="number"){value=BigInt(value)}return value},readValueFromPointer:integerReadValueFromPointer(name,size,!isUnsignedType),destructorFunction:null})};function __embind_register_bool(rawType,name,trueValue,falseValue){rawType>>>=0;name>>>=0;name=AsciiToString(name);registerType(rawType,{name,fromWireType:function(wt){return!!wt},toWireType:function(destructors,o){return o?trueValue:falseValue},readValueFromPointer:function(pointer){return this.fromWireType(HEAPU8[pointer>>>0])},destructorFunction:null})}var shallowCopyInternalPointer=o=>({count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType});var throwInstanceAlreadyDeleted=obj=>{function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")};var finalizationRegistry=false;var detachFinalizer=handle=>{};var runDestructor=$$=>{if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}};var releaseClassHandle=$$=>{$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}};var attachFinalizer=handle=>{if(!globalThis.FinalizationRegistry){attachFinalizer=handle=>handle;return handle}finalizationRegistry=new FinalizationRegistry(info=>{releaseClassHandle(info.$$)});attachFinalizer=handle=>{var $$=handle.$$;var hasSmartPtr=!!$$.smartPtr;if(hasSmartPtr){var info={$$};finalizationRegistry.register(handle,info,handle)}return handle};detachFinalizer=handle=>finalizationRegistry.unregister(handle);return attachFinalizer(handle)};var deletionQueue=[];var flushPendingDeletes=()=>{while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}};var delayFunction;var init_ClassHandle=()=>{let proto=ClassHandle.prototype;Object.assign(proto,{isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;other.$$=other.$$;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right},clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}},delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}},isDeleted(){return!this.$$.ptr},deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}});const symbolDispose=Symbol.dispose;if(symbolDispose){proto[symbolDispose]=proto["delete"]}};function ClassHandle(){}var createNamedFunction=(name,func)=>Object.defineProperty(func,"name",{value:name});var registeredPointers={};var ensureOverloadTable=(proto,methodName,humanName)=>{if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(...args){if(!proto[methodName].overloadTable.hasOwnProperty(args.length)){throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${args.length}) - expects one of (${proto[methodName].overloadTable})!`)}return proto[methodName].overloadTable[args.length].apply(this,args)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}};var exposePublicSymbol=(name,value,numArguments)=>{if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError(`Cannot register public name '${name}' twice`)}ensureOverloadTable(Module,name,name);if(Module[name].overloadTable.hasOwnProperty(numArguments)){throwBindingError(`Cannot register multiple overloads of a function with the same number of arguments (${numArguments})!`)}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}};var char_0=48;var char_9=57;var makeLegalFunctionName=name=>{name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return`_${name}`}return name};function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}var upcastPointer=(ptr,ptrClass,desiredClass)=>{while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError(`Expected null or instance of ${desiredClass.name}, got an instance of ${ptrClass.name}`)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr};var embindRepr=v=>{if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}};function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle||!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError(`Cannot convert argument of type ${handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name} to parameter type ${this.name}`)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,Emval.toHandle(()=>clonedHandle["delete"]()));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupported sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError(`null is not a valid ${this.name}`)}return 0}if(!handle.$$){throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`)}if(!handle.$$.ptr){throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`)}if(handle.$$.ptrType.isConst){throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}var downcastPointer=(ptr,ptrClass,desiredClass)=>{if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)};var registeredInstances={};var getBasestPointer=(class_,ptr)=>{if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr};var getInheritedInstance=(class_,ptr)=>{ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]};var makeClassHandle=(prototype,record)=>{if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record,writable:true}}))};function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}var init_RegisteredPointer=()=>{Object.assign(RegisteredPointer.prototype,{getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr},destructor(ptr){this.rawDestructor?.(ptr)},readValueFromPointer:readPointer,fromWireType:RegisteredPointer_fromWireType})};function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this.toWireType=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this.toWireType=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this.toWireType=genericPointerToWireType}}var replacePublicSymbol=(name,value,numArguments)=>{if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistent public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}};var getWasmTableEntry=funcPtr=>wasmTable.get(funcPtr);var dynCall=(sig,ptr,args=[],promising=false)=>{var func=getWasmTableEntry(ptr);var rtn=func(...args);function convert(rtn){return sig[0]=="p"?rtn>>>0:rtn}return convert(rtn)};var getDynCaller=(sig,ptr,promising=false)=>(...args)=>dynCall(sig,ptr,args,promising);var embind__requireFunction=(signature,rawFunction,isAsync=false)=>{signature=AsciiToString(signature);function makeDynCaller(){if(signature.includes("p")){return getDynCaller(signature,rawFunction,isAsync)}var rtn=getWasmTableEntry(rawFunction);return rtn}var fp=makeDynCaller();if(typeof fp!="function"){throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`)}return fp};class UnboundTypeError extends Error{}var getTypeName=type=>{var ptr=___getTypeName(type);var rv=AsciiToString(ptr);_free(ptr);return rv};var throwUnboundTypeError=(message,types)=>{var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(`${message}: `+unboundTypes.map(getTypeName).join([", "]))};function __embind_register_class(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor){rawType>>>=0;rawPointerType>>>=0;rawConstPointerType>>>=0;baseClassRawType>>>=0;getActualTypeSignature>>>=0;getActualType>>>=0;upcastSignature>>>=0;upcast>>>=0;downcastSignature>>>=0;downcast>>>=0;name>>>=0;destructorSignature>>>=0;rawDestructor>>>=0;name=AsciiToString(name);getActualType=embind__requireFunction(getActualTypeSignature,getActualType);upcast&&=embind__requireFunction(upcastSignature,upcast);downcast&&=embind__requireFunction(downcastSignature,downcast);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);var legalFunctionName=makeLegalFunctionName(name);exposePublicSymbol(legalFunctionName,function(){throwUnboundTypeError(`Cannot construct ${name} due to unbound types`,[baseClassRawType])});whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],base=>{base=base[0];var baseClass;var basePrototype;if(baseClassRawType){baseClass=base.registeredClass;basePrototype=baseClass.instancePrototype}else{basePrototype=ClassHandle.prototype}var constructor=createNamedFunction(name,function(...args){if(Object.getPrototypeOf(this)!==instancePrototype){throw new BindingError(`Use 'new' to construct ${name}`)}if(undefined===registeredClass.constructor_body){throw new BindingError(`${name} has no accessible constructor`)}var body=registeredClass.constructor_body[args.length];if(undefined===body){throw new BindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${args.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`)}return body.apply(this,args)});var instancePrototype=Object.create(basePrototype,{constructor:{value:constructor}});constructor.prototype=instancePrototype;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast);if(registeredClass.baseClass){registeredClass.baseClass.__derivedClasses??=[];registeredClass.baseClass.__derivedClasses.push(registeredClass)}var referenceConverter=new RegisteredPointer(name,registeredClass,true,false,false);var pointerConverter=new RegisteredPointer(name+"*",registeredClass,false,false,false);var constPointerConverter=new RegisteredPointer(name+" const*",registeredClass,false,true,false);registeredPointers[rawType]={pointerType:pointerConverter,constPointerType:constPointerConverter};replacePublicSymbol(legalFunctionName,constructor);return[referenceConverter,pointerConverter,constPointerConverter]})}var heap32VectorToArray=(count,firstElement)=>{var array=[];for(var i=0;i>>2>>>0])}return array};function usesDestructorStack(argTypes){for(var i=1;i>>=0;rawArgTypesAddr>>>=0;invokerSignature>>>=0;invoker>>>=0;rawConstructor>>>=0;var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],classType=>{classType=classType[0];var humanName=`constructor ${classType.name}`;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError(`Cannot register multiple constructors with identical number of parameters (${argCount-1}) for class '${classType.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`)}classType.registeredClass.constructor_body[argCount-1]=()=>{throwUnboundTypeError(`Cannot construct ${classType.name} due to unbound types`,rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{argTypes.splice(1,0,null);classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor);return[]});return[]})};var getFunctionName=signature=>{signature=signature.trim();const argsIndex=signature.indexOf("(");if(argsIndex===-1)return signature;return signature.slice(0,argsIndex)};var __embind_register_class_function=function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,context,isPureVirtual,isAsync,isNonnullReturn){rawClassType>>>=0;methodName>>>=0;rawArgTypesAddr>>>=0;invokerSignature>>>=0;rawInvoker>>>=0;context>>>=0;var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=AsciiToString(methodName);methodName=getFunctionName(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker,isAsync);whenDependentTypesAreResolved([],[rawClassType],classType=>{classType=classType[0];var humanName=`${classType.name}.${methodName}`;if(methodName.startsWith("@@")){methodName=Symbol[methodName.substring(2)]}if(isPureVirtual){classType.registeredClass.pureVirtualFunctions.push(methodName)}function unboundTypesHandler(){throwUnboundTypeError(`Cannot call ${humanName} due to unbound types`,rawArgTypes)}var proto=classType.registeredClass.instancePrototype;var method=proto[methodName];if(undefined===method||undefined===method.overloadTable&&method.className!==classType.name&&method.argCount===argCount-2){unboundTypesHandler.argCount=argCount-2;unboundTypesHandler.className=classType.name;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-2]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,argTypes=>{var memberFunction=craftInvokerFunction(humanName,argTypes,classType,rawInvoker,context,isAsync);if(undefined===proto[methodName].overloadTable){memberFunction.argCount=argCount-2;proto[methodName]=memberFunction}else{proto[methodName].overloadTable[argCount-2]=memberFunction}return[]});return[]})};var emval_freelist=[];var emval_handles=[0,1,,1,null,1,true,1,false,1];function __emval_decref(handle){handle>>>=0;if(handle>9&&0===--emval_handles[handle+1]){emval_handles[handle]=undefined;emval_freelist.push(handle)}}var Emval={toValue:handle=>{if(!handle){throwBindingError(`Cannot use deleted val. handle = ${handle}`)}return emval_handles[handle]},toHandle:value=>{switch(value){case undefined:return 2;case null:return 4;case true:return 6;case false:return 8;default:{const handle=emval_freelist.pop()||emval_handles.length;emval_handles[handle]=value;emval_handles[handle+1]=1;return handle}}}};var EmValType={name:"emscripten::val",fromWireType:handle=>{var rv=Emval.toValue(handle);__emval_decref(handle);return rv},toWireType:(destructors,value)=>Emval.toHandle(value),readValueFromPointer:readPointer,destructorFunction:null};function __embind_register_emval(rawType){rawType>>>=0;return registerType(rawType,EmValType)}var enumReadValueFromPointer=(name,width,signed)=>{switch(width){case 1:return signed?function(pointer){return this.fromWireType(HEAP8[pointer>>>0])}:function(pointer){return this.fromWireType(HEAPU8[pointer>>>0])};case 2:return signed?function(pointer){return this.fromWireType(HEAP16[pointer>>>1>>>0])}:function(pointer){return this.fromWireType(HEAPU16[pointer>>>1>>>0])};case 4:return signed?function(pointer){return this.fromWireType(HEAP32[pointer>>>2>>>0])}:function(pointer){return this.fromWireType(HEAPU32[pointer>>>2>>>0])};default:throw new TypeError(`invalid integer width (${width}): ${name}`)}};function getEnumValueType(rawValueType){return rawValueType===0?"object":rawValueType===1?"number":"string"}function __embind_register_enum(rawType,name,size,isSigned,rawValueType){rawType>>>=0;name>>>=0;size>>>=0;name=AsciiToString(name);const valueType=getEnumValueType(rawValueType);switch(valueType){case"object":{function ctor(){}ctor.values={};registerType(rawType,{name,constructor:ctor,valueType,fromWireType:function(c){return this.constructor.values[c]},toWireType:(destructors,c)=>c.value,readValueFromPointer:enumReadValueFromPointer(name,size,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor);break}case"number":{var keysMap={};registerType(rawType,{name,keysMap,valueType,fromWireType:c=>c,toWireType:(destructors,c)=>c,readValueFromPointer:enumReadValueFromPointer(name,size,isSigned),destructorFunction:null});exposePublicSymbol(name,keysMap);delete Module[name].argCount;break}case"string":{var valuesMap={};var reverseMap={};var keysMap={};registerType(rawType,{name,valuesMap,reverseMap,keysMap,valueType,fromWireType:function(c){return this.reverseMap[c]},toWireType:function(destructors,c){return this.valuesMap[c]},readValueFromPointer:enumReadValueFromPointer(name,size,isSigned),destructorFunction:null});exposePublicSymbol(name,keysMap);delete Module[name].argCount;break}}}var requireRegisteredType=(rawType,humanName)=>{var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(`${humanName} has unknown type ${getTypeName(rawType)}`)}return impl};function __embind_register_enum_value(rawEnumType,name,enumValue){rawEnumType>>>=0;name>>>=0;var enumType=requireRegisteredType(rawEnumType,"enum");name=AsciiToString(name);switch(enumType.valueType){case"object":{var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(`${enumType.name}_${name}`,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value;break}case"number":{enumType.keysMap[name]=enumValue;break}case"string":{enumType.valuesMap[name]=enumValue;enumType.reverseMap[enumValue]=name;enumType.keysMap[name]=name;break}}}var floatReadValueFromPointer=(name,width)=>{switch(width){case 4:return function(pointer){return this.fromWireType(HEAPF32[pointer>>>2>>>0])};case 8:return function(pointer){return this.fromWireType(HEAPF64[pointer>>>3>>>0])};default:throw new TypeError(`invalid float width (${width}): ${name}`)}};var __embind_register_float=function(rawType,name,size){rawType>>>=0;name>>>=0;size>>>=0;name=AsciiToString(name);registerType(rawType,{name,fromWireType:value=>value,toWireType:(destructors,value)=>value,readValueFromPointer:floatReadValueFromPointer(name,size),destructorFunction:null})};function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn,isAsync,isNonnullReturn){name>>>=0;rawArgTypesAddr>>>=0;signature>>>=0;rawInvoker>>>=0;fn>>>=0;var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=AsciiToString(name);name=getFunctionName(name);rawInvoker=embind__requireFunction(signature,rawInvoker,isAsync);exposePublicSymbol(name,function(){throwUnboundTypeError(`Cannot call ${name} due to unbound types`,argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,argTypes=>{var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn,isAsync),argCount-1);return[]})}var __embind_register_integer=function(primitiveType,name,size,minRange,maxRange){primitiveType>>>=0;name>>>=0;size>>>=0;name=AsciiToString(name);const isUnsignedType=minRange===0;let fromWireType=value=>value;if(isUnsignedType){var bitshift=32-8*size;fromWireType=value=>value<>>bitshift;maxRange=fromWireType(maxRange)}registerType(primitiveType,{name,fromWireType,toWireType:(destructors,value)=>value,readValueFromPointer:integerReadValueFromPointer(name,size,minRange!==0),destructorFunction:null})};var installIndexedIterator=(proto,sizeMethodName,getMethodName)=>{const makeIterator=(size,getValue)=>{let index=0;return{next(){if(index>=size){return{done:true}}const current=index;index++;const value=getValue(current);return{value,done:false}},[Symbol.iterator](){return this}}};if(!proto[Symbol.iterator]){proto[Symbol.iterator]=function(){const size=this[sizeMethodName]();return makeIterator(size,i=>this[getMethodName](i))}}};var __embind_register_iterable=function(rawClassType,rawElementType,sizeMethodName,getMethodName){rawClassType>>>=0;rawElementType>>>=0;sizeMethodName>>>=0;getMethodName>>>=0;sizeMethodName=AsciiToString(sizeMethodName);getMethodName=AsciiToString(getMethodName);whenDependentTypesAreResolved([],[rawClassType,rawElementType],types=>{const classType=types[0];installIndexedIterator(classType.registeredClass.instancePrototype,sizeMethodName,getMethodName);return[]})};function __embind_register_memory_view(rawType,dataTypeIndex,name){rawType>>>=0;name>>>=0;var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){var size=HEAPU32[handle>>>2>>>0];var data=HEAPU32[handle+4>>>2>>>0];return new TA(HEAP8.buffer,data,size)}name=AsciiToString(name);registerType(rawType,{name,fromWireType:decodeMemoryView,readValueFromPointer:decodeMemoryView},{ignoreDuplicateRegistrations:true})}var EmValOptionalType=Object.assign({optional:true},EmValType);function __embind_register_optional(rawOptionalType,rawType){rawOptionalType>>>=0;rawType>>>=0;registerType(rawOptionalType,EmValOptionalType)}var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{outIdx>>>=0;if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=endIdx)break;heap[outIdx++>>>0]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++>>>0]=192|u>>6;heap[outIdx++>>>0]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++>>>0]=224|u>>12;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++>>>0]=240|u>>18;heap[outIdx++>>>0]=128|u>>12&63;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63;i++}}heap[outIdx>>>0]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var lengthBytesUTF8=str=>{var len=0;for(var i=0;i=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var UTF8Decoder=globalThis.TextDecoder&&new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{idx>>>=0;var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx>10,56320|ch&1023)}}return str};var UTF8ToString=(ptr,maxBytesToRead,ignoreNul)=>{ptr>>>=0;return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead,ignoreNul):""};function __embind_register_std_string(rawType,name){rawType>>>=0;name>>>=0;name=AsciiToString(name);var stdStringIsUTF8=true;registerType(rawType,{name,fromWireType(value){var length=HEAPU32[value>>>2>>>0];var payload=value+4;var str;if(stdStringIsUTF8){str=UTF8ToString(payload,length,true)}else{str="";for(var i=0;i>>0])}}_free(value);return str},toWireType(destructors,value){if(value instanceof ArrayBuffer){value=new Uint8Array(value)}var length;var valueIsOfTypeString=typeof value=="string";if(!(valueIsOfTypeString||ArrayBuffer.isView(value)&&value.BYTES_PER_ELEMENT==1)){throwBindingError("Cannot pass non-string to std::string")}if(stdStringIsUTF8&&valueIsOfTypeString){length=lengthBytesUTF8(value)}else{length=value.length}var base=_malloc(4+length+1);var ptr=base+4;HEAPU32[base>>>2>>>0]=length;if(valueIsOfTypeString){if(stdStringIsUTF8){stringToUTF8(value,ptr,length+1)}else{for(var i=0;i255){_free(base);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+i>>>0]=charCode}}}else{HEAPU8.set(value,ptr>>>0)}if(destructors!==null){destructors.push(_free,base)}return base},readValueFromPointer:readPointer,destructorFunction(ptr){_free(ptr)}})}var UTF16Decoder=globalThis.TextDecoder?new TextDecoder("utf-16le"):undefined;var UTF16ToString=(ptr,maxBytesToRead,ignoreNul)=>{var idx=ptr>>>1;var endIdx=findStringEnd(HEAPU16,idx,maxBytesToRead/2,ignoreNul);if(endIdx-idx>16&&UTF16Decoder)return UTF16Decoder.decode(HEAPU16.subarray(idx>>>0,endIdx>>>0));var str="";for(var i=idx;i>>0];str+=String.fromCharCode(codeUnit)}return str};var stringToUTF16=(str,outPtr,maxBytesToWrite)=>{maxBytesToWrite??=2147483647;if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>>1>>>0]=codeUnit;outPtr+=2}HEAP16[outPtr>>>1>>>0]=0;return outPtr-startPtr};var lengthBytesUTF16=str=>str.length*2;var UTF32ToString=(ptr,maxBytesToRead,ignoreNul)=>{var str="";var startIdx=ptr>>>2;for(var i=0;!(i>=maxBytesToRead/4);i++){var utf32=HEAPU32[startIdx+i>>>0];if(!utf32&&!ignoreNul)break;str+=String.fromCodePoint(utf32)}return str};var stringToUTF32=(str,outPtr,maxBytesToWrite)=>{outPtr>>>=0;maxBytesToWrite??=2147483647;if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i65535){i++}HEAP32[outPtr>>>2>>>0]=codePoint;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>>2>>>0]=0;return outPtr-startPtr};var lengthBytesUTF32=str=>{var len=0;for(var i=0;i65535){i++}len+=4}return len};function __embind_register_std_wstring(rawType,charSize,name){rawType>>>=0;charSize>>>=0;name>>>=0;name=AsciiToString(name);var decodeString,encodeString,lengthBytesUTF;if(charSize===2){decodeString=UTF16ToString;encodeString=stringToUTF16;lengthBytesUTF=lengthBytesUTF16}else{decodeString=UTF32ToString;encodeString=stringToUTF32;lengthBytesUTF=lengthBytesUTF32}registerType(rawType,{name,fromWireType:value=>{var length=HEAPU32[value>>>2>>>0];var str=decodeString(value+4,length*charSize,true);_free(value);return str},toWireType:(destructors,value)=>{if(!(typeof value=="string")){throwBindingError(`Cannot pass non-string to C++ string type ${name}`)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>>2>>>0]=length/charSize;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},readValueFromPointer:readPointer,destructorFunction(ptr){_free(ptr)}})}function __embind_register_value_object(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){rawType>>>=0;name>>>=0;constructorSignature>>>=0;rawConstructor>>>=0;destructorSignature>>>=0;rawDestructor>>>=0;structRegistrations[rawType]={name:AsciiToString(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),fields:[]}}function __embind_register_value_object_field(structType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){structType>>>=0;fieldName>>>=0;getterReturnType>>>=0;getterSignature>>>=0;getter>>>=0;getterContext>>>=0;setterArgumentType>>>=0;setterSignature>>>=0;setter>>>=0;setterContext>>>=0;structRegistrations[structType].fields.push({fieldName:AsciiToString(fieldName),getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext,setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext})}var __embind_register_void=function(rawType,name){rawType>>>=0;name>>>=0;name=AsciiToString(name);registerType(rawType,{isVoid:true,name,fromWireType:()=>undefined,toWireType:(destructors,o)=>undefined})};function __emval_array_to_memory_view(dst,src){dst>>>=0;src>>>=0;dst=Emval.toValue(dst);src=Emval.toValue(src);dst.set(src)}var emval_methodCallers=[];var emval_addMethodCaller=caller=>{var id=emval_methodCallers.length;emval_methodCallers.push(caller);return id};var emval_lookupTypes=(argCount,argTypes)=>{var a=new Array(argCount);for(var i=0;i>>2>>>0],`parameter ${i}`)}return a};var emval_returnValue=(toReturnWire,destructorsRef,handle)=>{var destructors=[];var result=toReturnWire(destructors,handle);if(destructors.length){HEAPU32[destructorsRef>>>2>>>0]=Emval.toHandle(destructors)}return result};var emval_symbols={};var getStringOrSymbol=address=>{var symbol=emval_symbols[address];if(symbol===undefined){return AsciiToString(address)}return symbol};var __emval_create_invoker=function(argCount,argTypesPtr,kind){argTypesPtr>>>=0;var GenericWireTypeSize=8;var[retType,...argTypes]=emval_lookupTypes(argCount,argTypesPtr);var toReturnWire=retType.toWireType.bind(retType);var argFromPtr=argTypes.map(type=>type.readValueFromPointer.bind(type));argCount--;var captures={toValue:Emval.toValue};var args=argFromPtr.map((argFromPtr,i)=>{var captureName=`argFromPtr${i}`;captures[captureName]=argFromPtr;return`${captureName}(args${i?"+"+i*GenericWireTypeSize:""})`});var functionBody;switch(kind){case 0:functionBody="toValue(handle)";break;case 2:functionBody="new (toValue(handle))";break;case 3:functionBody="";break;case 1:captures["getStringOrSymbol"]=getStringOrSymbol;functionBody="toValue(handle)[getStringOrSymbol(methodName)]";break}functionBody+=`(${args})`;if(!retType.isVoid){captures["toReturnWire"]=toReturnWire;captures["emval_returnValue"]=emval_returnValue;functionBody=`return emval_returnValue(toReturnWire, destructorsRef, ${functionBody})`}functionBody=`return function (handle, methodName, destructorsRef, args) {\n${functionBody}\n}`;var invokerFunction=new Function(Object.keys(captures),functionBody)(...Object.values(captures));var functionName=`methodCaller<(${argTypes.map(t=>t.name)}) => ${retType.name}>`;return emval_addMethodCaller(createNamedFunction(functionName,invokerFunction))};function __emval_equals(first,second){first>>>=0;second>>>=0;first=Emval.toValue(first);second=Emval.toValue(second);return first==second}function __emval_get_property(handle,key){handle>>>=0;key>>>=0;handle=Emval.toValue(handle);key=Emval.toValue(key);return Emval.toHandle(handle[key])}function __emval_incref(handle){handle>>>=0;if(handle>9){emval_handles[handle+1]+=1}}function __emval_invoke(caller,handle,methodName,destructorsRef,args){caller>>>=0;handle>>>=0;methodName>>>=0;destructorsRef>>>=0;args>>>=0;return emval_methodCallers[caller](handle,methodName,destructorsRef,args)}function __emval_new_cstring(v){v>>>=0;return Emval.toHandle(getStringOrSymbol(v))}function __emval_new_object(){return Emval.toHandle({})}function __emval_run_destructors(handle){handle>>>=0;var destructors=Emval.toValue(handle);runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle>>>=0;key>>>=0;value>>>=0;handle=Emval.toValue(handle);key=Emval.toValue(key);value=Emval.toValue(value);handle[key]=value}var getHeapMax=()=>4294901760;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};function _emscripten_resize_heap(requestedSize){requestedSize>>>=0;var oldSize=HEAPU8.length;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false}var updateTableMap=(offset,count)=>{if(functionsInTableMap){for(var i=offset;i{if(!functionsInTableMap){functionsInTableMap=new WeakMap;updateTableMap(0,wasmTable.length)}return functionsInTableMap.get(func)||0};var freeTableIndexes=[];var getEmptyTableSlot=()=>{if(freeTableIndexes.length){return freeTableIndexes.pop()}return wasmTable["grow"](1)};var setWasmTableEntry=(idx,func)=>wasmTable.set(idx,func);var uleb128EncodeWithLen=arr=>{const n=arr.length;return[n%128|128,n>>7,...arr]};var wasmTypeCodes={i:127,p:127,j:126,f:125,d:124,e:111};var generateTypePack=types=>uleb128EncodeWithLen(Array.from(types,type=>{var code=wasmTypeCodes[type];return code}));var convertJsFunctionToWasm=(func,sig)=>{var bytes=Uint8Array.of(0,97,115,109,1,0,0,0,1,...uleb128EncodeWithLen([1,96,...generateTypePack(sig.slice(1)),...generateTypePack(sig[0]==="v"?"":sig[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var module=new WebAssembly.Module(bytes);var instance=new WebAssembly.Instance(module,{e:{f:func}});var wrappedFunc=instance.exports["f"];return wrappedFunc};var addFunction=(func,sig)=>{var rtn=getFunctionAddress(func);if(rtn){return rtn}var ret=getEmptyTableSlot();try{setWasmTableEntry(ret,func)}catch(err){if(!(err instanceof TypeError)){throw err}var wrapped=convertJsFunctionToWasm(func,sig);setWasmTableEntry(ret,wrapped)}functionsInTableMap.set(func,ret);return ret};var removeFunction=index=>{functionsInTableMap.delete(getWasmTableEntry(index));setWasmTableEntry(index,null);freeTableIndexes.push(index)};init_ClassHandle();init_RegisteredPointer();{if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].shift()()}}}Module["addFunction"]=addFunction;Module["removeFunction"]=removeFunction;var ___getTypeName,_malloc,_free,memory,__indirect_function_table,wasmMemory,wasmTable;function assignWasmExports(wasmExports){___getTypeName=wasmExports["K"];_malloc=wasmExports["M"];_free=wasmExports["N"];memory=wasmMemory=wasmExports["I"];__indirect_function_table=wasmTable=wasmExports["L"]}var wasmImports={l:___cxa_throw,C:__abort_js,q:__embind_finalize_value_object,z:__embind_register_bigint,G:__embind_register_bool,j:__embind_register_class,i:__embind_register_class_constructor,a:__embind_register_class_function,E:__embind_register_emval,x:__embind_register_enum,d:__embind_register_enum_value,y:__embind_register_float,c:__embind_register_function,p:__embind_register_integer,m:__embind_register_iterable,h:__embind_register_memory_view,n:__embind_register_optional,F:__embind_register_std_string,w:__embind_register_std_wstring,r:__embind_register_value_object,k:__embind_register_value_object_field,H:__embind_register_void,u:__emval_array_to_memory_view,g:__emval_create_invoker,b:__emval_decref,o:__emval_equals,B:__emval_get_property,t:__emval_incref,f:__emval_invoke,s:__emval_new_cstring,A:__emval_new_object,e:__emval_run_destructors,v:__emval_set_property,D:_emscripten_resize_heap};function applySignatureConversions(wasmExports){wasmExports=Object.assign({},wasmExports);var makeWrapper_pp=f=>a0=>f(a0)>>>0;var makeWrapper_p=f=>()=>f()>>>0;wasmExports["K"]=makeWrapper_pp(wasmExports["K"]);wasmExports["M"]=makeWrapper_pp(wasmExports["M"]);wasmExports["_emscripten_stack_alloc"]=makeWrapper_pp(wasmExports["_emscripten_stack_alloc"]);wasmExports["emscripten_stack_get_current"]=makeWrapper_p(wasmExports["emscripten_stack_get_current"]);return wasmExports}function run(){preRun();function doRun(){Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve?.(Module);Module["onRuntimeInitialized"]?.();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(()=>{setTimeout(()=>Module["setStatus"](""),1);doRun()},1)}else{doRun()}}var wasmExports;wasmExports=await (createWasm());run();if(runtimeInitialized){moduleRtn=Module}else{moduleRtn=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject})} +;return moduleRtn}export default Module; diff --git a/public/manifold.wasm b/public/manifold.wasm new file mode 100644 index 0000000..5e4efdb Binary files /dev/null and b/public/manifold.wasm differ diff --git a/src/app/api/codex-screenshot/route.ts b/src/app/api/codex-screenshot/route.ts new file mode 100644 index 0000000..e82932d --- /dev/null +++ b/src/app/api/codex-screenshot/route.ts @@ -0,0 +1,38 @@ +import { mkdir, writeFile } from "node:fs/promises"; +import path from "node:path"; +import { NextRequest, NextResponse } from "next/server"; + +const localHosts = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]); + +function sanitizeFileName(value: unknown) { + const fallback = `codex-screenshot-${Date.now()}.png`; + if (typeof value !== "string") { + return fallback; + } + const cleaned = value.replace(/[^a-z0-9_.-]+/gi, "_").replace(/^_+|_+$/g, ""); + return cleaned.endsWith(".png") ? cleaned : `${cleaned || fallback}.png`; +} + +export async function POST(request: NextRequest) { + if (process.env.NODE_ENV === "production") { + return NextResponse.json({ error: "Codex screenshot capture is only available in local development." }, { status: 404 }); + } + + const host = request.headers.get("host")?.split(":")[0] ?? ""; + if (!localHosts.has(host)) { + return NextResponse.json({ error: "Codex screenshot capture only accepts local requests." }, { status: 403 }); + } + + const body = (await request.json()) as { dataUrl?: unknown; name?: unknown }; + if (typeof body.dataUrl !== "string" || !body.dataUrl.startsWith("data:image/png;base64,")) { + return NextResponse.json({ error: "Expected a PNG data URL." }, { status: 400 }); + } + + const bytes = Buffer.from(body.dataUrl.slice("data:image/png;base64,".length), "base64"); + const directory = path.join(process.cwd(), ".codex", "screenshots"); + await mkdir(directory, { recursive: true }); + + const filePath = path.join(directory, sanitizeFileName(body.name)); + await writeFile(filePath, bytes); + return NextResponse.json({ path: filePath, bytes: bytes.length }); +} diff --git a/src/app/api/local-download/route.ts b/src/app/api/local-download/route.ts new file mode 100644 index 0000000..ef7cb90 --- /dev/null +++ b/src/app/api/local-download/route.ts @@ -0,0 +1,31 @@ +import { promises as fs } from "fs"; +import path from "path"; +import { NextResponse } from "next/server"; + +function safeFileName(filename: string) { + const base = path.basename(filename).replace(/[<>:"/\\|?*\u0000-\u001f]/g, "_").trim(); + return base || "download.txt"; +} + +export async function POST(request: Request) { + try { + const body = (await request.json()) as { content?: unknown; filename?: unknown; folder?: unknown }; + if (typeof body.content !== "string" || typeof body.filename !== "string" || typeof body.folder !== "string") { + return NextResponse.json({ error: "Invalid download request" }, { status: 400 }); + } + + const trimmedFolder = body.folder.trim(); + if (!trimmedFolder) { + return NextResponse.json({ error: "Choose a folder first" }, { status: 400 }); + } + + const targetDirectory = path.isAbsolute(trimmedFolder) ? trimmedFolder : path.join(process.cwd(), trimmedFolder); + await fs.mkdir(targetDirectory, { recursive: true }); + const targetPath = path.join(targetDirectory, safeFileName(body.filename)); + await fs.writeFile(targetPath, body.content, "utf8"); + + return NextResponse.json({ path: targetPath }); + } catch (error) { + return NextResponse.json({ error: error instanceof Error ? error.message : "Could not save file" }, { status: 500 }); + } +} diff --git a/src/app/api/project-thumbnail/route.ts b/src/app/api/project-thumbnail/route.ts new file mode 100644 index 0000000..343180e --- /dev/null +++ b/src/app/api/project-thumbnail/route.ts @@ -0,0 +1,78 @@ +import { promises as fs } from "fs"; +import path from "path"; +import { NextResponse } from "next/server"; + +const THUMBNAIL_DIR = path.join(process.cwd(), ".codex", "project-thumbnails"); + +function safeProjectId(projectId: string) { + const clean = projectId.replace(/[^a-zA-Z0-9_-]/g, ""); + return clean || null; +} + +function thumbnailPath(projectId: string) { + const safeId = safeProjectId(projectId); + if (!safeId) { + return null; + } + return path.join(THUMBNAIL_DIR, `${safeId}.png`); +} + +export async function GET(request: Request) { + const projectId = new URL(request.url).searchParams.get("projectId") ?? ""; + const filePath = thumbnailPath(projectId); + if (!filePath) { + return new NextResponse("Invalid project id", { status: 400 }); + } + + try { + const image = await fs.readFile(filePath); + return new NextResponse(image, { + headers: { + "Cache-Control": "no-store", + "Content-Type": "image/png", + }, + }); + } catch { + return new NextResponse("Thumbnail not found", { status: 404 }); + } +} + +export async function POST(request: Request) { + let body: { dataUrl?: unknown; projectId?: unknown }; + try { + body = (await request.json()) as { dataUrl?: unknown; projectId?: unknown }; + } catch { + return NextResponse.json({ error: "Invalid thumbnail request" }, { status: 400 }); + } + + try { + if (typeof body.projectId !== "string" || typeof body.dataUrl !== "string") { + return NextResponse.json({ error: "Invalid thumbnail request" }, { status: 400 }); + } + + const filePath = thumbnailPath(body.projectId); + const match = body.dataUrl.match(/^data:image\/png;base64,(.+)$/); + if (!filePath || !match) { + return NextResponse.json({ error: "Invalid thumbnail image" }, { status: 400 }); + } + + await fs.mkdir(THUMBNAIL_DIR, { recursive: true }); + await fs.rm(filePath, { force: true }); + await fs.writeFile(filePath, Buffer.from(match[1], "base64")); + + return NextResponse.json({ version: Date.now() }); + } catch (error) { + return NextResponse.json({ error: error instanceof Error ? error.message : "Could not save thumbnail" }, { status: 500 }); + } +} + +export async function DELETE(request: Request) { + const projectId = new URL(request.url).searchParams.get("projectId") ?? ""; + const filePath = thumbnailPath(projectId); + if (!filePath) { + return NextResponse.json({ error: "Invalid project id" }, { status: 400 }); + } + + await fs.rm(filePath, { force: true }); + return NextResponse.json({ deleted: true }); +} diff --git a/src/app/globals.css b/src/app/globals.css new file mode 100644 index 0000000..4953243 --- /dev/null +++ b/src/app/globals.css @@ -0,0 +1,3299 @@ +@import "tailwindcss"; + +:root { + --background: #fafafa; + --foreground: #31465d; + --topbar: #f9f9fa; + --subbar: #f1f1f3; + --panel: #fafafa; + --tile: #f4f5f7; + --tile-hover: #ffffff; + --border: #dde2e8; + --border-strong: #cfd8e2; + --muted: #c5d0dc; + --muted-strong: #9cabb8; + --primary: #009cde; + --active-tab: #4f8edb; + --nav-text: #31465d; + --workplane: #9adcf0; + --workplane-soft: rgba(154, 220, 240, 0.28); + --star: #ffd543; + --shadow: 0 2px 6px rgba(35, 55, 75, 0.12); + --font-ui: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif; +} + +* { + box-sizing: border-box; +} + +html, +body { + width: 100%; + height: 100%; + margin: 0; + overflow: hidden; + background: var(--background); + color: var(--foreground); + font-family: var(--font-ui); + letter-spacing: 0; +} + +button, +a, +input { + font: inherit; +} + +button { + border: 0; +} + +.editor-stage { + display: none; +} + +.editor-stage.active { + display: block; +} + +.dashboard-shell { + width: 100vw; + height: 100vh; + min-width: 320px; + overflow: auto; + background: #f4f7f9; + color: #263f57; +} + +.dashboard-topbar { + position: sticky; + top: 0; + z-index: 8; + display: grid; + grid-template-columns: minmax(210px, 280px) minmax(180px, 1fr) auto; + gap: 18px; + align-items: center; + min-height: 64px; + padding: 10px 22px; + background: rgba(250, 252, 253, 0.96); + border-bottom: 1px solid #d8e1e8; + box-shadow: 0 1px 4px rgba(28, 49, 68, 0.08); +} + +.dashboard-brand { + display: inline-flex; + min-width: 0; + align-items: center; + gap: 10px; + color: #213c55; + background: transparent; + cursor: pointer; +} + +.dashboard-brand img { + width: 42px; + height: 42px; + display: block; +} + +.dashboard-brand span { + overflow: hidden; + font-size: 18px; + font-weight: 800; + text-overflow: ellipsis; + white-space: nowrap; +} + +.dashboard-search { + display: flex; + min-width: 0; + height: 40px; + align-items: center; + gap: 8px; + padding: 0 12px; + color: #6a7d8f; + background: #edf3f7; + border: 1px solid #d3dee7; + border-radius: 6px; +} + +.dashboard-search input { + min-width: 0; + width: 100%; + border: 0; + outline: 0; + color: #243d56; + background: transparent; + font-size: 14px; +} + +.dashboard-primary, +.dashboard-action-tile, +.project-card, +.dashboard-nav-item, +.dashboard-segmented button, +.dashboard-select { + transition: + background 140ms ease, + border-color 140ms ease, + box-shadow 140ms ease, + transform 140ms ease; +} + +.dashboard-primary { + display: inline-flex; + height: 40px; + align-items: center; + gap: 7px; + justify-content: center; + padding: 0 16px; + color: white; + background: #009cde; + border-radius: 6px; + box-shadow: 0 2px 5px rgba(0, 114, 164, 0.24); + cursor: pointer; +} + +.dashboard-primary:hover { + background: #008dcc; +} + +.dashboard-layout { + display: grid; + grid-template-columns: 148px minmax(0, 1fr); + min-height: calc(100vh - 64px); +} + +.dashboard-sidebar { + display: flex; + flex-direction: column; + justify-content: space-between; + padding: 18px 12px; + background: #ffffff; + border-right: 1px solid #d9e3ea; +} + +.dashboard-nav-stack { + display: grid; + gap: 8px; +} + +.dashboard-nav-item { + display: flex; + width: 100%; + height: 42px; + align-items: center; + gap: 10px; + padding: 0 12px; + color: #40586f; + background: transparent; + border-radius: 6px; + cursor: pointer; + font-size: 14px; + font-weight: 800; + text-align: left; +} + +.dashboard-nav-item span { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.dashboard-nav-item:hover, +.dashboard-nav-item.active { + color: #0a6f9b; + background: #e8f6fc; +} + +.dashboard-settings-button { + color: #536a80; +} + +.dashboard-main { + min-width: 0; + padding: 22px; +} + +.dashboard-actions-band { + display: grid; + grid-template-columns: repeat(3, minmax(170px, 1fr)); + gap: 14px; + margin-bottom: 24px; +} + +.dashboard-import-notice { + margin: -12px 0 20px; + color: #40586c; + font-size: 13px; + font-weight: 800; +} + +.dashboard-action-tile { + display: flex; + min-width: 0; + min-height: 88px; + align-items: center; + gap: 14px; + padding: 14px 16px; + color: #263f57; + background: #ffffff; + border: 1px solid #d9e3eb; + border-radius: 8px; + cursor: pointer; + text-align: left; + box-shadow: 0 1px 2px rgba(31, 52, 71, 0.05); +} + +.dashboard-action-tile:hover, +.project-card:hover { + border-color: #98d9ee; + box-shadow: 0 5px 15px rgba(32, 61, 82, 0.12); + transform: translateY(-1px); +} + +.dashboard-action-tile.create { + border-color: #8fd9f1; + background: #f4fcff; +} + +.dashboard-action-icon { + display: grid; + flex: 0 0 auto; + width: 44px; + height: 44px; + place-items: center; + color: #ffffff; + background: #00aeea; + border-radius: 8px; +} + +.dashboard-action-tile:not(.create) .dashboard-action-icon { + color: #254056; + background: #eef3f6; +} + +.dashboard-action-tile span:last-child { + min-width: 0; + overflow-wrap: anywhere; + font-size: 16px; + font-weight: 800; +} + +.dashboard-section-header { + display: flex; + min-width: 0; + align-items: end; + justify-content: space-between; + gap: 16px; + margin-bottom: 14px; +} + +.dashboard-section-header h1 { + margin: 0; + color: #213c55; + font-size: 28px; + line-height: 1.1; +} + +.dashboard-section-header span { + display: inline-block; + margin-top: 4px; + color: #708295; + font-size: 13px; +} + +.dashboard-controls { + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + gap: 9px; +} + +.dashboard-select { + display: inline-flex; + height: 36px; + align-items: center; + gap: 7px; + padding: 0 9px; + color: #40586f; + background: #ffffff; + border: 1px solid #d6e0e8; + border-radius: 6px; +} + +.dashboard-select select { + min-width: 82px; + border: 0; + outline: 0; + color: inherit; + background: transparent; + font: inherit; +} + +.dashboard-segmented { + display: inline-grid; + height: 36px; + grid-template-columns: 36px 36px; + overflow: hidden; + border: 1px solid #d6e0e8; + border-radius: 6px; + background: #ffffff; +} + +.dashboard-segmented button { + display: grid; + place-items: center; + color: #5d7184; + background: transparent; + cursor: pointer; +} + +.dashboard-segmented button.active { + color: #ffffff; + background: #40586f; +} + +.project-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); + gap: 15px; +} + +.project-list { + display: grid; + gap: 10px; +} + +.project-card { + position: relative; + display: grid; + min-width: 0; + padding: 10px; + color: #263f57; + background: #ffffff; + border: 1px solid #d9e3eb; + border-radius: 8px; + text-align: left; + box-shadow: 0 1px 2px rgba(31, 52, 71, 0.05); +} + +.project-list .project-card { + padding-right: 50px; +} + +.project-card-open { + display: grid; + min-width: 0; + grid-template-rows: auto auto auto; + gap: 9px; + padding: 0; + color: inherit; + background: transparent; + cursor: pointer; + text-align: left; +} + +.project-list .project-card-open { + grid-template-columns: 126px minmax(0, 1fr); + grid-template-rows: auto auto; + align-items: center; +} + +.project-preview { + position: relative; + display: block; + aspect-ratio: 16 / 10; + overflow: hidden; + border-radius: 6px; + background: #eaf8fd; +} + +.project-list .project-preview { + grid-row: 1 / span 2; +} + +.project-delete { + position: absolute; + top: 12px; + right: 12px; + display: grid; + width: 34px; + height: 34px; + place-items: center; + color: #5e7183; + background: rgba(255, 255, 255, 0.94); + border: 1px solid #d7e1e8; + border-radius: 6px; + cursor: pointer; + opacity: 0.92; + box-shadow: 0 2px 6px rgba(24, 43, 60, 0.1); +} + +.project-card:hover .project-delete, +.project-delete:focus-visible { + opacity: 1; +} + +.project-delete:hover { + color: #b01925; + border-color: #efb7be; + background: #fff4f5; +} + +.dashboard-confirm-overlay { + position: fixed; + inset: 0; + z-index: 70; + display: grid; + place-items: center; + padding: 24px; + background: rgba(23, 38, 52, 0.34); +} + +.dashboard-confirm-dialog { + width: min(420px, 100%); + overflow: hidden; + border: 1px solid #cbd9e3; + border-radius: 8px; + background: #ffffff; + box-shadow: 0 20px 55px rgba(31, 49, 67, 0.24); +} + +.dashboard-confirm-dialog header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; + padding: 16px 18px 12px; + border-bottom: 1px solid #e5edf3; +} + +.dashboard-confirm-dialog header strong { + color: #1d3448; + font-size: 16px; +} + +.dashboard-confirm-dialog header button { + display: grid; + width: 32px; + height: 32px; + place-items: center; + color: #60778b; + border: 1px solid #cbd9e3; + border-radius: 6px; + background: #ffffff; +} + +.dashboard-confirm-dialog p { + margin: 0; + padding: 18px; + color: #40586c; + font-size: 14px; + line-height: 1.45; +} + +.dashboard-confirm-dialog p span { + color: #1d3448; + font-weight: 800; +} + +.dashboard-confirm-actions { + display: flex; + justify-content: flex-end; + gap: 10px; + padding: 0 18px 18px; +} + +.dashboard-confirm-actions button { + height: 38px; + padding: 0 16px; + font-weight: 800; + border-radius: 6px; +} + +.dashboard-confirm-cancel { + color: #40586c; + border: 1px solid #cbd9e3; + background: #ffffff; +} + +.dashboard-confirm-delete { + color: #ffffff; + border: 1px solid #c82031; + background: #c82031; +} + +.project-empty { + display: grid; + min-height: 190px; + place-items: center; + align-content: center; + gap: 8px; + color: #6d8193; + background: #ffffff; + border: 1px dashed #cbd9e3; + border-radius: 8px; +} + +.project-empty strong { + color: #263f57; + font-size: 18px; +} + +.preview-grid { + position: absolute; + inset: 0; + background-image: + linear-gradient(rgba(0, 174, 234, 0.19) 1px, transparent 1px), + linear-gradient(90deg, rgba(0, 174, 234, 0.19) 1px, transparent 1px); + background-size: 18px 18px; + transform: perspective(360px) rotateX(56deg) translateY(20px) scale(1.3); + transform-origin: 50% 100%; +} + +.project-thumbnail-image { + display: block; + width: 100%; + height: 100%; + object-fit: cover; +} + +.preview-empty-mark { + position: absolute; + left: 50%; + top: 50%; + color: #6d8193; + font-size: 12px; + font-weight: 800; + text-align: center; + transform: translate(-50%, -50%); + white-space: nowrap; +} + +.preview-shape { + position: absolute; + display: block; + border-radius: 5px; + box-shadow: inset -10px -9px 0 rgba(0, 0, 0, 0.14); +} + +.preview-shape.cube { + left: 33%; + top: 29%; + width: 32%; + height: 36%; + background: #d91f2b; + transform: skewY(-8deg); +} + +.preview-shape.cylinder { + right: 19%; + top: 39%; + width: 18%; + height: 28%; + border-radius: 50% / 18%; + background: #2f9a62; +} + +.preview-shadow { + position: absolute; + left: 31%; + right: 18%; + bottom: 19%; + height: 18%; + background: rgba(38, 63, 87, 0.16); + transform: skewX(-22deg); +} + +.project-preview.accent-cyan { + background: #e7f8fd; +} + +.project-preview.accent-green { + background: #e9f7ef; +} + +.project-preview.accent-gold { + background: #fff6df; +} + +.project-preview.accent-red { + background: #fff0f0; +} + +.project-card-title { + min-width: 0; + overflow: hidden; + color: #263f57; + font-size: 15px; + font-weight: 800; + text-overflow: ellipsis; + white-space: nowrap; +} + +.project-card-meta { + min-width: 0; + overflow: hidden; + color: #6d8193; + font-size: 12px; + text-overflow: ellipsis; + white-space: nowrap; +} + +.toolbar-home-section { + min-width: 68px; +} + +.editor-nav-group { + border-right: 1px solid #d7e0e8; +} + +.editor-home-control svg { + width: 25px; + height: 25px; +} + +.dashboard-settings-panel { + position: fixed; + right: 22px; + bottom: 22px; + z-index: 12; + display: grid; + width: min(380px, calc(100vw - 32px)); + gap: 14px; + padding: 16px; + color: #263f57; + background: rgba(255, 255, 255, 0.98); + border: 1px solid #d6e1ea; + border-radius: 8px; + box-shadow: 0 12px 32px rgba(24, 44, 62, 0.18); +} + +.dashboard-settings-panel header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; +} + +.dashboard-settings-panel header strong { + font-size: 17px; +} + +.dashboard-settings-panel header button { + display: grid; + width: 30px; + height: 30px; + place-items: center; + color: #52697d; + background: #eef3f6; + border-radius: 5px; + cursor: pointer; +} + +.dashboard-setting-row { + display: grid; + gap: 7px; + color: #52697d; + font-size: 13px; + font-weight: 800; +} + +.dashboard-setting-row input, +.dashboard-setting-row select { + width: 100%; + height: 38px; + min-width: 0; + border: 1px solid #ccd9e3; + border-radius: 6px; + outline: 0; + padding: 0 10px; + color: #263f57; + background: #ffffff; + font: inherit; + font-weight: 600; +} + +.dashboard-setting-row input:disabled { + color: #95a5b4; + background: #edf2f6; +} + +@media (max-width: 860px) { + .dashboard-topbar { + grid-template-columns: 1fr auto; + } + + .dashboard-search { + grid-column: 1 / -1; + } + + .dashboard-layout { + grid-template-columns: 1fr; + } + + .dashboard-sidebar { + display: flex; + flex-direction: row; + gap: 8px; + padding: 10px; + border-right: 0; + border-bottom: 1px solid #d9e3ea; + } + + .dashboard-nav-stack { + display: flex; + flex: 1 1 auto; + gap: 8px; + } + + .dashboard-nav-item { + flex: 1 1 0; + min-width: 0; + justify-content: center; + padding: 0 10px; + } + + .dashboard-settings-button { + flex: 1 1 0; + } + + .dashboard-actions-band { + grid-template-columns: 1fr; + } + + .dashboard-section-header { + align-items: stretch; + flex-direction: column; + } + + .dashboard-controls { + justify-content: flex-start; + } +} + +.sketchforge-editor { + width: 100vw; + height: 100vh; + min-width: 320px; + overflow: hidden; + background: var(--background); +} + +.top-nav { + position: fixed; + inset: 0 0 auto 0; + z-index: 20; + display: flex; + align-items: center; + height: 48px; + background: var(--topbar); + border-bottom: 1px solid var(--border); +} + +.sf-logo { + display: grid; + width: 48px; + height: 48px; + place-items: center; + cursor: pointer; +} + +.sf-logo img { + width: 48px; + height: 48px; + display: block; +} + +.nav-icon { + display: grid; + width: 48px; + height: 48px; + place-items: center; + color: #28435d; + background: transparent; + cursor: pointer; +} + +.nav-icon:hover, +.mode-tab:hover { + background: #eef4f7; +} + +.menu-button { + color: #2c455f; +} + +.nav-spacer { + flex: 1; +} + +.mode-tabs { + display: flex; + height: 48px; + border-left: 1px solid var(--border); +} + +.mode-tab { + display: grid; + width: 50px; + height: 48px; + place-items: center; + color: #2c455f; + background: transparent; + border-right: 1px solid var(--border); + cursor: pointer; +} + +.mode-tab svg { + width: 39px; + height: 39px; +} + +.mode-tab.active { + color: white; + background: var(--active-tab); +} + +.mode-tab.active:hover { + background: var(--active-tab); +} + +.collaborator { + width: 52px; + border-left: 1px solid var(--border); +} + +.avatar { + position: relative; + width: 49px; + height: 48px; + background: + radial-gradient(circle at 50% 39%, #f3f6fb 0 12px, transparent 13px), + radial-gradient(circle at 50% 77%, #f3f6fb 0 22px, transparent 23px), + #5f95df; + border-left: 1px solid var(--border); + box-shadow: inset 0 0 0 3px #77a4e7; + cursor: pointer; +} + +.secondary-toolbar { + position: fixed; + inset: 0 0 auto 0; + z-index: 19; + display: flex; + align-items: stretch; + height: 76px; + background: linear-gradient(180deg, #fbfcfd 0%, #f4f7f9 54%, #edf2f5 100%); + border-bottom: 1px solid #d2dce5; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 1px 2px rgba(32, 54, 72, 0.06); +} + +.tool-group { + display: flex; + height: 76px; + border-right: 1px solid #d7e0e8; +} + +.tool-group.right { + border-left: 1px solid #d7e0e8; +} + +.toolbar-section { + position: relative; + display: flex; + min-width: 88px; + height: 76px; + flex-direction: column; + justify-content: flex-start; + border-right: 1px solid rgba(203, 215, 226, 0.82); + background: linear-gradient(90deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.1) 44%, rgba(210, 222, 232, 0.18)); +} + +.tool-group .toolbar-section:last-child { + border-right: 0; +} + +.toolbar-section.compact { + min-width: 78px; +} + +.toolbar-section-label { + order: 1; + height: 24px; + padding: 6px 9px 0; + color: #607589; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: 800; + line-height: 16px; + text-align: center; + text-transform: uppercase; + letter-spacing: 0; + white-space: nowrap; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.86); + user-select: none; +} + +.toolbar-section-tools { + order: 2; + display: flex; + height: 52px; + align-items: center; + justify-content: center; + padding: 0 3px 1px; +} + +.toolbar-spacer { + flex: 1; +} + +.toolbar-icon { + display: grid; + width: 43px; + height: 43px; + place-items: center; + color: #7890a4; + background: transparent; + border-radius: 3px; + cursor: pointer; + transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease; +} + +.toolbar-icon.disabled { + color: #d6e0e9; + cursor: default; + opacity: 1; +} + +.toolbar-icon:disabled { + pointer-events: none; +} + +.toolbar-icon:not(.disabled):hover { + background: rgba(255, 255, 255, 0.66); + box-shadow: inset 0 0 0 1px rgba(185, 202, 216, 0.86); + color: #29465f; +} + +.toolbar-icon.active { + background: rgba(255, 255, 255, 0.84); + box-shadow: inset 0 0 0 2px rgba(0, 166, 219, 0.28); + color: #0b8dbd; +} + +.toolbar-icon svg, +.toolbar-icon .toolbar-sprite-icon, +.toolbar-icon .vector-toolbar-sprite-icon { + width: 32px; + height: 32px; +} + +.toolbar-sprite-icon { + display: block; + background-repeat: no-repeat; + background-size: var(--sprite-width) var(--sprite-height); + background-position: var(--sprite-x) var(--sprite-y); + filter: grayscale(1) contrast(0.78) brightness(1.35); + opacity: 0.22; + transition: filter 120ms ease, opacity 120ms ease; +} + +.vector-toolbar-sprite-icon { + display: block; + flex: 0 0 auto; + background-repeat: no-repeat; + background-size: var(--vector-sprite-width) var(--vector-sprite-height); + background-position: var(--vector-sprite-x) var(--vector-sprite-y); + filter: grayscale(1) contrast(0.78) brightness(1.35); + opacity: 0.22; + transition: filter 120ms ease, opacity 120ms ease; +} + +.toolbar-icon.disabled .vector-toolbar-sprite-icon { + opacity: 0.22; +} + +.toolbar-icon:not(.disabled) .toolbar-sprite-icon, +.toolbar-icon:not(.disabled) .vector-toolbar-sprite-icon, +.shape-menu-trigger .vector-toolbar-sprite-icon, +.action-buttons button .vector-toolbar-sprite-icon { + filter: grayscale(0.35) sepia(0.12) saturate(1.7) hue-rotate(165deg) contrast(1.18) brightness(0.78) drop-shadow(0 0 1px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 3px rgba(0, 156, 222, 0.2)); + opacity: 0.94; +} + +.toolbar-icon:not(.disabled):hover .toolbar-sprite-icon, +.toolbar-icon:not(.disabled):hover .vector-toolbar-sprite-icon, +.shape-menu-trigger:hover .vector-toolbar-sprite-icon, +.shape-menu-trigger.active .vector-toolbar-sprite-icon, +.action-buttons button:hover .vector-toolbar-sprite-icon { + filter: grayscale(0.1) sepia(0.22) saturate(2.1) hue-rotate(164deg) contrast(1.2) brightness(0.72) drop-shadow(0 0 1px rgba(255, 255, 255, 1)) drop-shadow(0 0 5px rgba(0, 156, 222, 0.38)); + opacity: 1; +} + +.toolbar-icon.active .toolbar-sprite-icon, +.toolbar-icon.active .vector-toolbar-sprite-icon { + filter: grayscale(0.05) sepia(0.22) saturate(2.35) hue-rotate(164deg) contrast(1.2) brightness(0.7) drop-shadow(0 0 1px rgba(255, 255, 255, 1)) drop-shadow(0 0 5px rgba(0, 156, 222, 0.42)); + opacity: 1; +} + +.action-buttons { + order: 2; + display: flex; + align-items: center; + justify-content: center; + gap: 5px; + height: 52px; + padding: 0 6px 2px; +} + +.toolbar-actions-section { + flex: 0 0 152px; + min-width: 152px; + border-left: 1px solid rgba(203, 215, 226, 0.82); + border-right: 0; +} + +.toolbar-shapes-section { + min-width: 82px; +} + +.shape-menu-trigger { + position: relative; + display: grid; + width: 45px; + height: 43px; + place-items: center; + color: #244057; + background: transparent; + border: 1px solid transparent; + border-radius: 4px; + cursor: pointer; + transition: background 120ms ease, box-shadow 120ms ease, border-color 120ms ease; +} + +.shape-menu-trigger:hover, +.shape-menu-trigger.active { + background: rgba(255, 255, 255, 0.66); + border-color: transparent; + box-shadow: inset 0 0 0 1px rgba(185, 202, 216, 0.86); +} + +.shape-menu-trigger .vector-toolbar-sprite-icon { + width: 32px; + height: 32px; +} + +.shape-menu-dropdown { + position: absolute; + top: 76px; + left: 0; + z-index: 60; + width: 244px; + max-height: min(650px, calc(100vh - 92px)); + overflow: hidden; + color: #253f57; + background: rgba(250, 252, 253, 0.98); + border: 1px solid #cfdce5; + border-radius: 4px; + box-shadow: 0 14px 34px rgba(26, 47, 66, 0.22); +} + +.shape-menu-title { + height: 42px; + padding: 0 15px; + color: #294760; + font-size: 16px; + font-weight: 800; + line-height: 42px; + background: linear-gradient(180deg, #fff, #f3f7fa); + border-bottom: 1px solid #dbe5ed; +} + +.shape-menu-list { + display: flex; + max-height: min(608px, calc(100vh - 136px)); + flex-direction: column; + gap: 4px; + padding: 8px; + overflow-y: auto; +} + +.shape-menu-item { + display: flex; + min-height: 58px; + align-items: center; + justify-content: flex-start; + gap: 11px; + padding: 5px 10px 5px 7px; + color: #2c455c; + background: #f8fafb; + border: 1px solid transparent; + border-radius: 4px; + cursor: pointer; + touch-action: manipulation; + font-size: 14px; + font-weight: 800; + transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease; +} + +.shape-menu-item:hover { + background: #fff; + border-color: #cbd9e3; + box-shadow: 0 4px 12px rgba(28, 48, 68, 0.13); + transform: translateY(-1px); +} + +.shape-menu-item img { + flex: 0 0 auto; + width: 48px; + height: 48px; + object-fit: contain; + pointer-events: none; +} + +.shape-menu-item span { + overflow: hidden; + min-width: 0; + max-width: 150px; + text-align: left; + text-overflow: ellipsis; + white-space: nowrap; +} + +.action-buttons button { + box-sizing: border-box; + display: inline-flex; + width: 43px; + height: 43px; + align-items: center; + justify-content: center; + gap: 5px; + padding: 0; + color: #244057; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: 800; + line-height: 1; + letter-spacing: 0; + background: transparent; + border: 1px solid transparent; + border-radius: 4px; + cursor: pointer; + text-transform: uppercase; + box-shadow: none; + transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease; +} + +.action-buttons button:hover { + background: rgba(255, 255, 255, 0.66); + border-color: transparent; + box-shadow: inset 0 0 0 1px rgba(185, 202, 216, 0.86); +} + +.action-buttons .action-icon-button { + display: grid; + width: 43px; + place-items: center; + color: #244057; + text-transform: none; +} + +.action-buttons button .vector-toolbar-sprite-icon { + width: 32px; + height: 32px; +} + +.action-buttons .action-icon-button .vector-toolbar-sprite-icon { + width: 32px; + height: 32px; +} + +.top-dropdown { + position: fixed; + top: 76px; + left: 96px; + z-index: 45; + width: 218px; + padding: 6px 0; + color: #263f56; + background: #fff; + border: 1px solid #cfdce5; + border-radius: 3px; + box-shadow: 0 8px 22px rgba(29, 48, 66, 0.18); +} + +.top-dropdown button { + display: flex; + width: 100%; + min-height: 36px; + align-items: center; + gap: 10px; + padding: 0 14px; + color: #263f56; + text-align: left; + background: transparent; + cursor: pointer; +} + +.top-dropdown button:hover { + background: #eef8fc; +} + +.top-action-panel { + position: fixed; + top: 84px; + right: 18px; + z-index: 44; + width: 322px; + color: #253f57; + background: #fff; + border: 1px solid #cfdce5; + border-radius: 3px; + box-shadow: 0 10px 30px rgba(28, 48, 68, 0.2); +} + +.top-action-panel header { + display: flex; + height: 48px; + align-items: center; + justify-content: space-between; + padding: 0 9px 0 14px; + border-bottom: 1px solid #dde7ee; +} + +.top-action-panel strong { + font-size: 17px; + font-weight: 800; +} + +.top-action-panel header button { + display: grid; + width: 32px; + height: 32px; + place-items: center; + color: #4f6578; + background: transparent; + cursor: pointer; +} + +.top-action-panel header button:hover { + background: #eef8fc; +} + +.top-action-body { + display: grid; + gap: 10px; + padding: 13px; +} + +.top-action-body p { + margin: 0; + color: #51697c; + font-size: 13px; + font-weight: 700; + line-height: 1.35; +} + +.top-action-body button { + display: flex; + min-height: 38px; + align-items: center; + justify-content: center; + gap: 8px; + padding: 0 12px; + color: #173b5a; + background: #f7fafc; + border: 1px solid #d8e3ea; + border-radius: 3px; + cursor: pointer; + font-size: 13px; + font-weight: 800; +} + +.top-action-body button:hover { + background: #eef8fc; +} + +.top-action-body button svg, +.top-action-body button .vector-toolbar-sprite-icon { + width: 20px; + height: 20px; +} + +.top-action-body .import-drop-zone { + display: grid; + min-height: 132px; + align-content: center; + justify-items: center; + gap: 8px; + padding: 17px 14px; + color: #244057; + background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 248, 251, 0.96)); + border: 1.5px dashed rgba(93, 124, 150, 0.62); + border-radius: 5px; + text-align: center; +} + +.top-action-body .import-drop-zone:hover { + background: #fff; + border-color: rgba(0, 159, 227, 0.76); + box-shadow: inset 0 0 0 1px rgba(0, 159, 227, 0.12), 0 4px 14px rgba(30, 50, 70, 0.1); +} + +.import-drop-zone svg { + color: #244057; +} + +.import-drop-zone .vector-toolbar-sprite-icon { + width: 30px; + height: 30px; +} + +.import-drop-zone strong { + font-size: 13px; + font-weight: 800; + line-height: 1.25; +} + +.import-drop-zone span { + color: #62778a; + font-size: 12px; + font-weight: 700; +} + +.ai-build-body { + width: 430px; +} + +.top-action-panel:has(.ai-build-body) { + width: 456px; +} + +.ai-build-body label { + display: grid; + gap: 6px; +} + +.ai-build-body label span { + color: #40586d; + font-size: 12px; + font-weight: 800; +} + +.ai-build-body textarea { + min-height: 104px; + resize: vertical; + padding: 9px; + color: #18364f; + background: #f8fbfd; + border: 1px solid #d6e2ea; + border-radius: 3px; + font: 12px/1.45 Consolas, "Courier New", monospace; +} + +.ai-build-body label:first-child textarea { + min-height: 154px; +} + +.hidden-file-input { + display: none; +} + +.editor-toast { + position: fixed; + left: 64px; + bottom: 18px; + z-index: 50; + max-width: min(420px, calc(100vw - 380px)); + padding: 8px 12px; + overflow: hidden; + color: #2b455c; + font-size: 13px; + font-weight: 800; + text-overflow: ellipsis; + white-space: nowrap; + background: rgba(255, 255, 255, 0.92); + border: 1px solid #cfdce5; + border-radius: 3px; + box-shadow: 0 2px 10px rgba(28, 48, 68, 0.14); + pointer-events: none; +} + +.editor-body { + position: fixed; + inset: 76px 0 0 0; + display: flex; + min-height: 0; + background: var(--background); +} + +.workplane-stage { + position: relative; + flex: 1; + min-width: 0; + height: calc(100vh - 76px); + overflow: hidden; + background: var(--background); +} + +.view-cube { + position: absolute; + top: 22px; + left: 28px; + z-index: 4; + width: 82px; + height: 82px; + perspective: 420px; + color: #96a2ad; + font-size: 10px; + font-weight: 800; + line-height: 1; + text-align: center; + text-transform: uppercase; + filter: drop-shadow(0 2px 3px rgba(45, 64, 82, 0.14)); + opacity: 0.9; + pointer-events: none; +} + +.view-cube-inner { + position: relative; + width: 58px; + height: 58px; + margin: 12px; + transform-style: preserve-3d; + transition: transform 80ms linear; + will-change: transform; +} + +.cube-face { + position: absolute; + inset: 0; + display: grid; + place-items: center; + width: 58px; + height: 58px; + background: rgba(255, 255, 255, 0.9); + border: 2px solid #cfd7df; + backface-visibility: hidden; + box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68); +} + +.cube-top { + transform: rotateX(-90deg) translateZ(29px); + background: rgba(248, 250, 252, 0.94); +} + +.cube-bottom { + transform: rotateX(90deg) translateZ(29px); + color: #a8b1ba; + background: rgba(238, 243, 247, 0.9); +} + +.cube-front { + transform: translateZ(29px); + color: #8895a2; +} + +.cube-back { + transform: rotateY(180deg) translateZ(29px); + color: #a8b1ba; +} + +.cube-right { + transform: rotateY(90deg) translateZ(29px); +} + +.cube-left { + transform: rotateY(-90deg) translateZ(29px); +} + +.camera-controls { + position: absolute; + top: 173px; + left: 8px; + z-index: 4; + display: grid; + gap: 4px; +} + +.camera-controls button { + display: grid; + width: 51px; + height: 51px; + place-items: center; + color: #173b5a; + background: rgba(255, 255, 255, 0.88); + border: 1px solid #dfe6eb; + border-radius: 999px; + box-shadow: 0 1px 2px rgba(30, 50, 70, 0.08); + cursor: pointer; +} + +.camera-controls button:hover { + color: #000; + border-color: #c4d2dc; +} + +.workplane-wrap { + position: absolute; + inset: 0; + overflow: hidden; +} + +.workplane-plane { + position: absolute; + inset: 0; + overflow: hidden; + background: #f8fbfc; +} + +.workplane-plane::before { + content: none; +} + +.three-workplane-host { + position: absolute; + inset: 0; + z-index: 1; + touch-action: none; + cursor: grab; +} + +.three-workplane-host:active { + cursor: grabbing; +} + +.workplane-wrap.placing-workplane .three-workplane-host, +.workplane-wrap.placing-workplane .three-workplane-host:active { + cursor: crosshair; +} + +.three-workplane-host canvas { + display: block; + width: 100%; + height: 100%; +} + +.selection-marquee { + position: absolute; + z-index: 3; + background: rgba(0, 159, 227, 0.1); + border: 1px solid rgba(0, 159, 227, 0.82); + box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42); + pointer-events: none; +} + +.transform-overlay { + position: absolute; + inset: 0; + z-index: 4; + pointer-events: none; +} + +.transform-guides { + position: absolute; + inset: 0; + overflow: visible; + pointer-events: none; +} + +.transform-guides line { + stroke: rgba(31, 39, 46, 0.72); + stroke-width: 1.15; + stroke-dasharray: 4 4; + vector-effect: non-scaling-stroke; +} + +.transform-guides #dimension-arrow path { + fill: rgba(20, 27, 33, 0.92); +} + +.align-overlay { + position: absolute; + inset: 0; + z-index: 5; + pointer-events: none; +} + +.align-guides { + position: absolute; + inset: 0; + overflow: visible; + pointer-events: none; +} + +.align-guides line { + stroke: rgba(0, 174, 234, 0.92); + stroke-width: 1.5; + stroke-dasharray: 4 4; + vector-effect: non-scaling-stroke; +} + +.align-dot { + position: absolute; + width: 14px; + height: 14px; + padding: 0; + border: 2px solid #f8fbfc; + border-radius: 999px; + background: #192431; + box-shadow: 0 1px 5px rgba(13, 28, 40, 0.32); + cursor: pointer; + pointer-events: auto; + transform: translate(-50%, -50%); +} + +.align-dot:hover:not(:disabled), +.align-dot:focus-visible:not(:disabled) { + background: #00aeea; + outline: none; + box-shadow: 0 0 0 4px rgba(0, 174, 234, 0.18), 0 1px 5px rgba(13, 28, 40, 0.32); +} + +.align-dot.disabled, +.align-dot:disabled { + background: #9aa6ae; + box-shadow: none; + cursor: default; + opacity: 0.72; +} + +.mirror-overlay { + position: absolute; + inset: 0; + z-index: 5; + pointer-events: none; +} + +.mirror-guides { + position: absolute; + inset: 0; + overflow: visible; + pointer-events: none; +} + +.mirror-guides line { + stroke: rgba(0, 174, 234, 0.78); + stroke-width: 1.45; + stroke-dasharray: 5 4; + vector-effect: non-scaling-stroke; +} + +.mirror-handle { + position: absolute; + display: grid; + width: 64px; + height: 32px; + padding: 0; + place-items: center; + color: #192431; + background: transparent; + border: 0; + cursor: pointer; + pointer-events: auto; + transform: translate(-50%, -50%) rotate(var(--mirror-angle, 0deg)); +} + +.mirror-handle-icon { + width: 64px; + height: 24px; + overflow: visible; + filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.96)) drop-shadow(0 1px 4px rgba(13, 28, 40, 0.28)); +} + +.mirror-handle-icon path { + fill: none; + stroke: currentColor; + stroke-width: 4; + stroke-linecap: round; + stroke-linejoin: round; +} + +.mirror-handle:hover, +.mirror-handle:focus-visible { + color: #00aeea; + outline: none; +} + +.dimension-mark .dimension-extension, +.dimension-mark .dimension-line { + stroke: rgba(20, 27, 33, 0.88); + stroke-width: 1.25; + stroke-dasharray: none; + vector-effect: non-scaling-stroke; +} + +.dimension-mark .dimension-line { + marker-start: url("#dimension-arrow"); + marker-end: url("#dimension-arrow"); +} + +.dimension-label { + position: absolute; + left: 0; + top: 0; + z-index: 3; + min-width: 43px; + padding: 5px 7px; + border-radius: 3px; + background: rgba(255, 255, 255, 0.94); + border: 1px solid rgba(220, 229, 235, 0.86); + color: #16283a; + font-size: 14px; + font-weight: 500; + line-height: 1; + text-align: center; + pointer-events: auto; + cursor: text; + transform: translate3d(var(--overlay-x, 0), var(--overlay-y, 0), 0) translate(-50%, -50%); + will-change: transform; + box-shadow: 0 1px 4px rgba(20, 42, 58, 0.09); +} + +.dimension-input { + position: absolute; + left: 0; + top: 0; + z-index: 9; + width: 64px; + padding: 4px 6px; + border-radius: 3px; + border: 1px solid rgba(0, 159, 227, 0.85); + background: rgba(255, 255, 255, 0.98); + color: #16283a; + font-size: 14px; + font-weight: 500; + line-height: 1; + text-align: center; + pointer-events: auto; + transform: translate3d(var(--overlay-x, 0), var(--overlay-y, 0), 0) translate(-50%, -50%); + will-change: transform; + box-shadow: 0 2px 8px rgba(0, 159, 227, 0.18); + outline: none; +} + +.rotation-protractor-plane { + position: absolute; + inset: 0; + z-index: 1; + pointer-events: auto; + cursor: grab; + opacity: 0.9; + filter: drop-shadow(0 1px 2px rgba(20, 42, 58, 0.14)); +} + +.rotation-protractor-plane:active { + cursor: grabbing; +} + +.rotation-protractor-outer, +.rotation-protractor-inner { + fill: rgba(104, 203, 232, 0.1); + stroke: rgba(0, 159, 227, 0.85); + stroke-width: 1.3; + vector-effect: non-scaling-stroke; +} + +.rotation-protractor-inner { + fill: none; + stroke: rgba(0, 159, 227, 0.46); +} + +.rotation-tick { + stroke: rgba(0, 159, 227, 0.7); + stroke-width: 1; + vector-effect: non-scaling-stroke; +} + +.rotation-tick.major { + stroke: rgba(0, 121, 176, 0.9); + stroke-width: 1.6; +} + +.rotation-zero-line { + stroke: rgba(47, 61, 70, 0.38); + stroke-width: 1.1; + vector-effect: non-scaling-stroke; +} + +.rotation-current-line { + stroke: #f05a22; + stroke-width: 1.8; + vector-effect: non-scaling-stroke; +} + +.rotation-zero-label { + fill: #16283a; + paint-order: stroke; + stroke: rgba(255, 255, 255, 0.88); + stroke-width: 4px; + font-size: 13px; + font-weight: 700; + text-anchor: middle; + dominant-baseline: middle; +} + +.transform-handle, +.rotate-handle { + position: absolute; + left: 0; + top: 0; + z-index: 2; + width: 6px; + height: 6px; + padding: 0; + pointer-events: auto; + cursor: nwse-resize; + transform: translate3d(var(--overlay-x, 0), var(--overlay-y, 0), 0) translate(-50%, -50%); + will-change: transform; +} + +.transform-handle { + z-index: 5; + background: #e9eef1; + border: 1.5px solid #293743; + box-shadow: 0 1px 2px rgba(20, 30, 40, 0.16); +} + +.transform-handle.corner, +.transform-handle.height-top, +.transform-handle.height-mid, +.transform-handle.height-lift { + width: 8px; + height: 8px; + background: #edf2f4; +} + +.transform-handle.edge, +.transform-handle.dark { + width: 6px; + height: 6px; + background: #293743; +} + +.transform-handle.height-top, +.transform-handle.height-mid, +.transform-handle.height-lift { + cursor: ns-resize; +} + +.transform-handle.height-lift { + border: 0; + width: 0; + height: 0; + background: transparent; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 13px solid #293743; + box-shadow: none; +} + +.transform-handle.height-lift.lower { + border-bottom: 0; + border-top: 13px solid #293743; +} + +.rotate-handle { + z-index: 3; + width: 42px; + height: 42px; + color: rgba(47, 61, 70, 0.6); + background: transparent; + border: 0; + border-radius: 0; + box-shadow: none; + cursor: grab; + opacity: 1; + transform: translate3d(var(--overlay-x, 0), var(--overlay-y, 0), 0) translate(-50%, -50%) rotate(var(--rotate-handle-angle, 0deg)); +} + +.rotate-handle:hover { + color: rgba(47, 61, 70, 0.86); +} + +.rotate-handle-icon, +.rotate-handle-icon svg { + display: block; + width: 18px; + height: 18px; +} + +.rotate-handle-icon { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} + +.rotate-handle-icon svg { + fill: currentColor; +} + +.rotation-edit { + position: absolute; + left: 0; + top: 0; + z-index: 9; + display: inline-flex; + align-items: center; + gap: 2px; + width: 58px; + padding: 4px 6px; + border-radius: 4px; + border: 1px solid rgba(196, 213, 224, 0.92); + background: rgba(255, 255, 255, 0.98); + color: #16283a; + font-size: 13px; + font-weight: 700; + line-height: 1; + pointer-events: auto; + transform: translate3d(var(--overlay-x, 0), var(--overlay-y, 0), 0) translate(-50%, -50%); + will-change: transform; + box-shadow: 0 2px 8px rgba(20, 42, 58, 0.15); +} + +.rotation-edit input { + min-width: 0; + width: 100%; + border: 0; + background: transparent; + color: inherit; + font: inherit; + text-align: right; + outline: none; +} + +.rotation-edit span { + color: #506579; +} + +.rotation-readout { + position: absolute; + left: 0; + top: 0; + z-index: 3; + min-width: 34px; + padding: 5px 8px; + border-radius: 4px; + background: rgba(255, 255, 255, 0.96); + border: 1px solid rgba(196, 213, 224, 0.8); + color: #16283a; + font-size: 14px; + font-weight: 600; + line-height: 1; + text-align: center; + pointer-events: none; + transform: translate3d(var(--overlay-x, 0), var(--overlay-y, 0), 0) translate(-50%, -50%); + will-change: transform; + box-shadow: 0 2px 8px rgba(20, 42, 58, 0.14); +} + +.shape-inspector { + position: absolute; + top: 0; + right: 0; + bottom: 0; + z-index: 8; + display: flex; + flex-direction: column; + width: 320px; + max-height: none; + overflow-y: auto; + color: #243d56; + background: rgba(244, 246, 248, 0.96); + border-left: 1px solid #d8e0e7; + box-shadow: -2px 0 10px rgba(36, 61, 86, 0.08); +} + +.shape-inspector-header { + display: flex; + align-items: center; + height: 50px; + padding: 0 12px 0 9px; + background: rgba(252, 253, 254, 0.96); + border-bottom: 1px solid #dce4eb; +} + +.shape-inspector-header strong { + flex: 1; + padding-left: 13px; + font-size: 18px; + font-weight: 800; +} + +.inspector-header-actions { + display: flex; + align-items: center; + gap: 9px; +} + +.shape-inspector button { + font: inherit; +} + +.inspector-snap-dock { + position: sticky; + bottom: 0; + display: flex; + justify-content: flex-end; + margin-top: auto; + padding: 14px 12px 16px; + background: linear-gradient(180deg, rgba(244, 246, 248, 0), rgba(244, 246, 248, 0.98) 18px, rgba(244, 246, 248, 0.98)); + border-top: 1px solid rgba(216, 224, 231, 0.75); +} + +.inspector-header-icon { + display: grid; + width: 32px; + height: 38px; + place-items: center; + color: #40596f; + background: transparent; + border: 0; + cursor: pointer; +} + +.inspector-header-icon.active { + color: #0c9dd3; +} + +.shape-state-card { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 28px; + margin: 10px 10px 12px; + padding: 19px 28px 22px; + background: rgba(255, 255, 255, 0.98); + border-radius: 8px; +} + +.shape-state-card button { + display: grid; + min-width: 0; + place-items: center; + gap: 6px; + color: #4e6174; + background: transparent; + cursor: pointer; +} + +.shape-state-card button.active { + color: #7cbcff; +} + +.large-solid-swatch, +.large-hole-swatch { + display: block; + width: 64px; + height: 64px; + border-radius: 999px; +} + +.large-solid-swatch { + background: var(--swatch); + border: 4px solid #7bb8ff; + box-shadow: inset 0 0 0 4px white; +} + +.large-hole-swatch { + background: repeating-linear-gradient(135deg, #dedede 0 7px, #b8b8b8 7px 14px); + box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.55); +} + +.shape-state-card button:disabled, +.range-property input:disabled { + cursor: default; + opacity: 0.52; +} + +.color-card { + margin: 0 10px 12px; + padding: 13px 14px 15px; + background: rgba(255, 255, 255, 0.98); + border-radius: 8px; +} + +.color-card-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 12px; + color: #31465d; + font-size: 15px; + font-weight: 750; +} + +.color-value { + color: #718296; + font-size: 12px; + font-weight: 800; +} + +.color-grid { + display: grid; + grid-template-columns: repeat(7, 1fr); + gap: 8px; +} + +.color-grid button { + width: 100%; + aspect-ratio: 1; + min-width: 0; + padding: 0; + background: var(--shape-swatch); + border: 1px solid rgba(31, 50, 68, 0.22); + border-radius: 999px; + cursor: pointer; + box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5); +} + +.color-grid button.selected { + border-color: #0c9dd3; + box-shadow: + 0 0 0 3px rgba(12, 157, 211, 0.22), + inset 0 0 0 3px white; +} + +.color-grid button:hover:not(:disabled) { + transform: translateY(-1px); + box-shadow: + 0 2px 7px rgba(28, 48, 68, 0.16), + inset 0 0 0 2px rgba(255, 255, 255, 0.62); +} + +.color-grid button:disabled { + cursor: default; + opacity: 0.5; +} + +.custom-color { + display: grid; + grid-column: span 3; + grid-template-columns: 32px minmax(0, 1fr); + align-items: center; + gap: 9px; + min-width: 0; + height: 32px; + padding: 4px 10px 4px 5px; + color: #50677a; + font-size: 13px; + font-weight: 750; + background: #f4f8fb; + border: 1px solid #d3dfe8; + border-radius: 999px; + cursor: pointer; +} + +.custom-color input { + width: 24px; + height: 24px; + padding: 0; + background: transparent; + border: 0; + cursor: pointer; +} + +.custom-color span { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.custom-color.disabled, +.custom-color input:disabled { + cursor: default; + opacity: 0.55; +} + +.property-card { + margin: 0 10px 10px; + padding: 0 14px 18px; + background: rgba(255, 255, 255, 0.98); + border-radius: 8px; +} + +.property-card-header { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + height: 47px; + padding: 0; + color: #31465d; + background: transparent; + cursor: pointer; + font-size: 18px; + font-weight: 500; + text-align: left; +} + +.property-card-header svg { + transition: transform 0.15s ease; +} + +.property-card-header svg.collapsed { + transform: rotate(180deg); +} + +.property-card-header:hover { + color: #1f8ec3; +} + +.property-list { + display: grid; + gap: 17px; +} + +.range-property { + display: grid; + gap: 9px; + color: #637286; + font-size: 15px; + font-weight: 650; +} + +.text-property { + display: grid; + gap: 8px; + color: #637286; + font-size: 15px; + font-weight: 650; +} + +.select-property { + display: grid; + grid-template-columns: 92px minmax(0, 1fr); + align-items: center; + gap: 10px; + color: #637286; + font-size: 15px; + font-weight: 650; +} + +.text-property input, +.select-property select { + width: 100%; + height: 31px; + padding: 0 12px; + color: #526174; + font: 600 15px/1 var(--font-ui); + letter-spacing: 0; + background: #fff; + border: 1px solid #cbd6e1; + border-radius: 999px; + outline: 0; + box-shadow: inset 0 1px 1px rgba(25, 45, 65, 0.04); +} + +.select-property select { + cursor: pointer; +} + +.text-property input:focus, +.select-property select:focus { + border-color: #74bdf0; + box-shadow: 0 0 0 3px rgba(0, 156, 222, 0.14); +} + +.text-property input:disabled, +.select-property select:disabled { + cursor: default; + opacity: 0.52; +} + +.range-control { + position: relative; + height: 22px; + padding: 0 21px; +} + +.range-control output, +.range-value-input { + position: absolute; + z-index: 2; + top: -3px; + left: clamp(22px, calc(var(--slider-pos) + 7px), calc(100% - 22px)); + min-width: 31px; + height: 31px; + padding: 0 8px; + color: #617287; + font-size: 15px; + line-height: 29px; + text-align: center; + background: white; + border: 1px solid #cbd6e1; + border-radius: 999px; + transform: translateX(-50%); +} + +.range-control output { + cursor: text; +} + +.range-value-input { + width: 70px; + outline: 0; + font: 700 15px/29px var(--font-ui); +} + +.range-control input[type="range"] { + width: 100%; + height: 22px; + margin: 0; + appearance: none; + background: transparent; + cursor: pointer; +} + +.range-control input[type="range"]::-webkit-slider-runnable-track { + height: 4px; + background: + linear-gradient(to right, #00a6db 0 var(--slider-pos), #dbe1e7 var(--slider-pos) 100%); + border-radius: 999px; +} + +.range-control input[type="range"]::-webkit-slider-thumb { + width: 1px; + height: 1px; + appearance: none; +} + +.range-control input[type="range"]::-moz-range-track { + height: 4px; + background: #dbe1e7; + border-radius: 999px; +} + +.range-control input[type="range"]::-moz-range-progress { + height: 4px; + background: #00a6db; + border-radius: 999px; +} + +.inspector-header-icon:hover, +.shape-state-card button:not(:disabled):hover { + background: #eef8fc; +} + +.shape-floating-controls { + position: absolute; + left: 50%; + bottom: 28px; + z-index: 6; + display: flex; + align-items: center; + gap: 12px; + min-width: min(460px, calc(100vw - 420px)); + max-width: calc(100vw - 420px); + padding: 10px 12px 10px 14px; + color: #173b5a; + background: rgba(255, 255, 255, 0.94); + border: 1px solid #cfdce5; + border-radius: 5px; + box-shadow: 0 4px 18px rgba(22, 45, 68, 0.16); + transform: translateX(-50%); +} + +.selected-shape-name { + display: grid; + min-width: 0; + flex: 1; + gap: 2px; +} + +.selected-shape-name strong { + overflow: hidden; + font-size: 14px; + font-weight: 800; + line-height: 1.1; + text-overflow: ellipsis; + white-space: nowrap; +} + +.selected-shape-name span { + color: #607586; + font-size: 12px; + font-weight: 700; + line-height: 1.1; + white-space: nowrap; +} + +.shape-control-cluster { + display: flex; + gap: 6px; +} + +.shape-control-cluster button { + display: grid; + width: 34px; + height: 34px; + place-items: center; + color: #173b5a; + background: #f7fafc; + border: 1px solid #d8e3ea; + border-radius: 4px; + cursor: pointer; +} + +.shape-control-cluster button:hover { + background: #eaf5fa; + border-color: #a9c7d7; +} + +.sidebar-collapse { + position: absolute; + top: 500px; + right: -1px; + z-index: 5; + display: grid; + width: 18px; + height: 56px; + place-items: center; + background: #f5f7f8; + border: 1px solid var(--border); + border-right: 0; + cursor: pointer; +} + +.sidebar-collapse span { + width: 13px; + height: 25px; + background: #111; + clip-path: polygon(22% 0, 100% 50%, 22% 100%, 0 84%, 56% 50%, 0 16%); +} + +.grid-settings { + position: absolute; + right: 12px; + bottom: 11px; + z-index: 6; + color: #435a72; + font-size: 13px; +} + +.settings-button { + display: block; + width: 90px; + height: 22px; + margin: 0 0 10px auto; + color: #6d7f91; + background: #fbfbfc; + border: 1px solid #d9e0e7; + border-radius: 3px; + cursor: pointer; +} + +.snap-row { + position: relative; + display: flex; + align-items: center; + gap: 8px; + color: #435a72; + font-size: 13px; + font-weight: 500; + line-height: 22px; + white-space: nowrap; +} + +.snap-select { + display: inline-flex; + align-items: center; + justify-content: space-between; + width: 75px; + height: 22px; + padding: 0 5px 0 9px; + color: #6b7784; + font-size: 13px; + font-weight: 500; + line-height: 20px; + background: #fff; + border: 1px solid #d8e0e8; + border-radius: 2px; + cursor: pointer; +} + +.snap-menu { + position: absolute; + right: 0; + bottom: 26px; + z-index: 8; + width: 92px; + padding: 4px 0; + background: white; + border: 1px solid var(--border); + box-shadow: var(--shadow); +} + +.snap-menu button { + display: block; + width: 100%; + padding: 6px 9px; + color: #425a72; + text-align: left; + background: transparent; + cursor: pointer; +} + +.snap-menu button:hover, +.snap-menu .selected { + background: #eef4f7; +} + +.workspace-modal { + position: absolute; + inset: 0; + z-index: 30; + display: grid; + align-items: start; + justify-items: center; + padding-top: 36px; +} + +.workspace-modal-card { + position: relative; + z-index: 2; + width: 520px; + max-width: calc(100vw - 32px); + min-height: min(720px, calc(100vh - 104px)); + max-height: calc(100vh - 104px); + overflow: hidden; + color: #264158; + background: #fff; + border: 1px solid #cfd9e2; + border-radius: 3px; + box-shadow: 0 16px 48px rgba(25, 42, 58, 0.28); +} + +.workspace-modal-backdrop { + position: absolute; + inset: 0; + z-index: 1; + background: rgba(39, 52, 63, 0.08); + border: 0; + cursor: default; +} + +.workspace-modal-header { + display: flex; + align-items: center; + justify-content: space-between; + height: 55px; + padding: 0 10px 0 16px; + border-bottom: 1px solid #d8e1e8; +} + +.workspace-modal-header strong { + font-size: 18px; + font-weight: 800; +} + +.workspace-modal-header button { + display: grid; + width: 40px; + height: 40px; + place-items: center; + color: #50677a; + background: transparent; + border: 0; + cursor: pointer; +} + +.workspace-modal-body { + display: grid; + gap: 20px; + max-height: calc(100vh - 159px); + padding: 18px 18px 22px; + overflow: auto; +} + +.workspace-row, +.workspace-toggle, +.workspace-select { + display: grid; + grid-template-columns: 145px 1fr; + align-items: center; + gap: 8px; + min-height: 20px; + font-size: 14px; + font-weight: 700; +} + +.workspace-toggle { + padding-bottom: 16px; + border-bottom: 1px solid #e2e9ee; +} + +.workspace-toggle input { + justify-self: end; + width: 18px; + height: 18px; + accent-color: #0098c7; +} + +.workspace-color-button { + justify-self: end; + width: 22px; + height: 22px; + background: var(--workspace-bg); + border: 1px solid #b7c5cf; + border-radius: 2px; + cursor: pointer; +} + +.workspace-range { + display: grid; + grid-template-columns: 145px 1fr; + gap: 8px; + align-items: start; + padding-bottom: 14px; + border-bottom: 1px solid #e2e9ee; + font-size: 14px; + font-weight: 700; +} + +.workspace-range input { + width: 100%; + accent-color: #0fa7cf; +} + +.workspace-range small { + grid-column: 2; + display: flex; + justify-content: space-between; + color: #728697; + font-size: 12px; + font-weight: 700; +} + +.workspace-select select { + width: 100%; + height: 26px; + padding: 0 26px 0 8px; + color: #2f4a61; + background: #fff; + border: 1px solid #cfd9e2; + border-radius: 2px; + font-weight: 700; +} + +.workspace-dimensions { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 80px; + margin-left: 153px; +} + +.workspace-dimensions label { + display: grid; + gap: 6px; + color: #50677a; + font-size: 13px; + font-weight: 800; +} + +.workspace-dimensions input { + width: 80px; + height: 34px; + padding: 0 7px; + color: #243d56; + background: #fff; + border: 1px solid #cfd9e2; + border-radius: 2px; + font-weight: 800; +} + +.make-default-button { + height: 30px; + color: #264158; + background: #f7fafc; + border: 1px solid #d6e0e8; + border-radius: 3px; + cursor: pointer; + font-size: 13px; + font-weight: 800; +} + +.make-default-button { + width: 240px; + margin-left: 153px; +} + +.workspace-modal-header button:hover, +.make-default-button:hover { + background: #eef8fc; +} + +.shapes-sidebar { + position: relative; + z-index: 10; + width: 276px; + height: calc(100vh - 76px); + flex: 0 0 276px; + overflow: hidden; + background: var(--panel); + border-left: 1px solid #eef1f4; +} + +.sidebar-tools { + display: grid; + height: 72px; + grid-template-columns: repeat(3, 1fr); +} + +.sidebar-tool { + display: grid; + place-items: center; + color: var(--primary); + background: transparent; + cursor: pointer; +} + +.sidebar-tool svg { + width: 58px; + height: 58px; +} + +.sidebar-tool:hover { + background: #eef8fc; +} + +.category-row { + position: relative; + display: flex; + align-items: center; + gap: 2px; + height: 62px; + padding: 5px 4px 10px 9px; +} + +.category-button { + display: flex; + width: 208px; + height: 47px; + align-items: center; + justify-content: space-between; + padding: 0 11px 0 14px; + color: #40576e; + font-size: 16px; + background: #f9fafb; + border: 1px solid #dfe6ed; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(20, 40, 60, 0.07); + cursor: pointer; +} + +.search-button { + display: grid; + width: 48px; + height: 47px; + place-items: center; + color: #050505; + background: #f9fafb; + border: 1px solid #dfe6ed; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(20, 40, 60, 0.07); + cursor: pointer; +} + +.category-button:hover, +.search-button:hover { + background: #ffffff; +} + +.sidebar-search { + display: flex; + height: 38px; + align-items: center; + gap: 7px; + margin: -3px 9px 8px; + padding: 0 9px; + background: white; + border: 1px solid #dfe6ed; + border-radius: 3px; + box-shadow: var(--shadow); +} + +.sidebar-search input { + min-width: 0; + flex: 1; + color: #40576e; + background: transparent; + border: 0; + outline: 0; +} + +.category-menu { + position: absolute; + top: 128px; + right: 55px; + z-index: 12; + width: 228px; + max-height: min(70vh, 560px); + overflow: auto; + background: white; + border: 1px solid #d9e0e7; + box-shadow: 0 8px 20px rgba(30, 48, 66, 0.16); +} + +.category-menu button { + display: block; + width: 100%; + padding: 10px 12px; + color: #40576e; + font-size: 14px; + text-align: left; + background: white; + cursor: pointer; +} + +.category-menu button:hover, +.category-menu .selected { + background: #eef4f7; +} + +.shape-scroll { + height: calc(100vh - 230px); + padding: 0 4px 18px 9px; + overflow-y: auto; + scrollbar-color: #aaaaaa #d0d0d0; + scrollbar-width: thin; +} + +.shape-scroll::-webkit-scrollbar { + width: 8px; +} + +.shape-scroll::-webkit-scrollbar-track { + background: #d0d0d0; +} + +.shape-scroll::-webkit-scrollbar-thumb { + background: #aaaaaa; + border-radius: 8px; +} + +.shape-grid { + display: grid; + grid-template-columns: repeat(3, 82px); + gap: 11px 5px; +} + +.shape-tile { + position: relative; + display: grid; + width: 82px; + height: 92px; + place-items: center; + overflow: visible; + background: var(--tile); + border: 1px solid transparent; + cursor: grab; + transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease; +} + +.shape-tile:hover { + background: var(--tile-hover); + border-color: #dfe6ed; + box-shadow: 0 4px 12px rgba(28, 48, 68, 0.14); + transform: translateY(-1px); +} + +.shape-tile img { + display: block; + width: 70px; + height: 70px; + object-fit: contain; + pointer-events: none; +} + +.more-shapes { + display: block; + width: 119px; + height: 38px; + margin: 10px auto 22px; + color: #31465d; + font-size: 14px; + background: #fff; + border: 1px solid #d9e0e7; + border-radius: 3px; + box-shadow: 0 1px 2px rgba(25, 45, 65, 0.06); + cursor: pointer; +} + +.placed-shape { + position: absolute; + width: var(--shape-size); + height: var(--shape-size); + padding: 0; + background: transparent; + border: 0; + cursor: grab; + outline: 0; + transform: translate(-50%, -72%) rotate(var(--shape-rotation)); + transform-origin: center bottom; + user-select: none; +} + +.placed-shape:active { + cursor: grabbing; +} + +.placed-visual { + position: absolute; + inset: 0; + display: grid; + place-items: center; + color: var(--shape-color); + filter: drop-shadow(0 9px 9px rgba(23, 52, 70, 0.2)); +} + +.placed-visual.hole { + opacity: 0.7; + filter: grayscale(0.2) drop-shadow(0 7px 7px rgba(23, 52, 70, 0.16)); +} + +.placed-visual.hole::after { + position: absolute; + inset: 7%; + content: ""; + background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.38) 0 5px, rgba(74, 91, 105, 0.28) 5px 10px); + mix-blend-mode: screen; + pointer-events: none; +} + +.kind-box { + width: 72%; + height: 62%; + align-self: end; + background: linear-gradient(135deg, color-mix(in srgb, var(--shape-color), white 16%), var(--shape-color)); + border: 1px solid color-mix(in srgb, var(--shape-color), black 32%); + transform: skewY(5deg); +} + +.kind-box::before, +.kind-box::after { + position: absolute; + content: ""; +} + +.kind-box::before { + right: -17%; + bottom: 8%; + width: 17%; + height: 91%; + background: color-mix(in srgb, var(--shape-color), black 22%); + transform: skewY(-28deg); + transform-origin: left bottom; +} + +.kind-box::after { + top: -19%; + left: 8%; + width: 92%; + height: 20%; + background: color-mix(in srgb, var(--shape-color), white 22%); + transform: skewX(-42deg); + transform-origin: left bottom; +} + +.kind-cylinder, +.kind-tube, +.kind-ring { + width: 64%; + height: 70%; + align-self: end; + border-radius: 50% / 18%; + background: + radial-gradient(ellipse at 50% 11%, color-mix(in srgb, var(--shape-color), white 36%) 0 34%, transparent 35%), + linear-gradient(90deg, color-mix(in srgb, var(--shape-color), black 16%), var(--shape-color) 45%, color-mix(in srgb, var(--shape-color), white 20%) 72%, color-mix(in srgb, var(--shape-color), black 14%)); + border: 1px solid color-mix(in srgb, var(--shape-color), black 32%); +} + +.kind-torus, +.kind-tube, +.kind-ring { + height: 42%; + border-radius: 50%; + background: radial-gradient(ellipse at center, transparent 0 28%, color-mix(in srgb, var(--shape-color), black 20%) 30% 39%, var(--shape-color) 40% 66%, color-mix(in srgb, var(--shape-color), white 20%) 67% 100%); +} + +.kind-sphere, +.kind-halfSphere { + width: 68%; + height: 68%; + align-self: end; + border-radius: 50%; + background: radial-gradient(circle at 33% 25%, color-mix(in srgb, var(--shape-color), white 45%), var(--shape-color) 47%, color-mix(in srgb, var(--shape-color), black 24%) 100%); +} + +.kind-halfSphere { + height: 40%; + border-radius: 50% 50% 12% 12% / 82% 82% 18% 18%; +} + +.kind-cone { + width: 70%; + height: 76%; + align-self: end; + clip-path: polygon(50% 0, 86% 84%, 50% 100%, 14% 84%); + background: linear-gradient(90deg, color-mix(in srgb, var(--shape-color), black 20%), var(--shape-color) 52%, color-mix(in srgb, var(--shape-color), white 24%)); +} + +.kind-pyramid, +.kind-roof, +.kind-wedge { + width: 76%; + height: 70%; + align-self: end; + clip-path: polygon(50% 4%, 95% 88%, 44% 100%, 7% 77%); + background: linear-gradient(135deg, color-mix(in srgb, var(--shape-color), white 24%), var(--shape-color) 48%, color-mix(in srgb, var(--shape-color), black 24%)); + border: 1px solid color-mix(in srgb, var(--shape-color), black 24%); +} + +.kind-roof, +.kind-wedge { + clip-path: polygon(8% 68%, 62% 16%, 96% 54%, 42% 88%); +} + +.kind-sketch, +.kind-scribble { + width: 76%; + height: 55%; + align-self: end; + border-radius: 44% 56% 50% 45%; + background: color-mix(in srgb, var(--shape-color), white 12%); + border: 2px solid color-mix(in srgb, var(--shape-color), black 26%); + transform: rotate(-14deg); +} + +.kind-scribble { + border-radius: 22% 48% 30% 58%; +} + +.kind-polygon, +.kind-icosahedron { + width: 72%; + height: 72%; + align-self: end; + clip-path: polygon(50% 0, 91% 25%, 91% 73%, 50% 100%, 10% 74%, 10% 25%); + background: linear-gradient(145deg, color-mix(in srgb, var(--shape-color), white 18%), var(--shape-color) 45%, color-mix(in srgb, var(--shape-color), black 26%)); +} + +.kind-text { + width: 90%; + height: 50%; + align-self: end; + color: var(--shape-color); + font-size: calc(var(--shape-size) * 0.34); + font-weight: 900; + letter-spacing: 0; + text-shadow: 2px 2px 0 color-mix(in srgb, var(--shape-color), black 35%); +} + +.kind-star, +.kind-heart { + align-self: end; + color: var(--shape-color); + font-size: calc(var(--shape-size) * 0.78); + line-height: 1; + text-shadow: 2px 3px 0 color-mix(in srgb, var(--shape-color), black 26%); +} + +.selection-outline { + position: absolute; + inset: 1px; + border: 2px solid #42b6df; + border-radius: 2px; + box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.82); + pointer-events: none; +} + +.selection-outline::before, +.selection-outline::after { + position: absolute; + width: 9px; + height: 9px; + content: ""; + background: #fff; + border: 2px solid #42b6df; +} + +.selection-outline::before { + top: -6px; + left: -6px; +} + +.selection-outline::after { + right: -6px; + bottom: -6px; +} + +.shape-size-tag { + position: absolute; + left: 50%; + bottom: -25px; + padding: 2px 7px; + color: #31465d; + font-size: 11px; + white-space: nowrap; + background: #fff; + border: 1px solid #c9d6e1; + border-radius: 2px; + box-shadow: var(--shadow); + transform: translateX(-50%); +} + +.shape-mini-tools { + position: absolute; + left: 50%; + top: -31px; + display: flex; + overflow: hidden; + border: 1px solid #c9d6e1; + border-radius: 2px; + box-shadow: var(--shadow); + transform: translateX(-50%); +} + +.shape-mini-tools button { + width: 26px; + height: 25px; + color: #31465d; + font-size: 15px; + line-height: 23px; + background: #fff; + border-right: 1px solid #dbe4eb; + cursor: pointer; +} + +.shape-mini-tools button:last-child { + border-right: 0; +} + +.shape-mini-tools button:hover { + background: #eef8fc; +} + +.more-shapes:hover { + background: #eef4f7; +} + +@media (max-width: 980px) { + .secondary-toolbar { + overflow-x: auto; + overflow-y: hidden; + } + + .toolbar-section { + min-width: auto; + } + + .toolbar-section-label { + padding-inline: 7px; + font-size: 10px; + } + + .toolbar-actions-section { + flex-basis: 152px; + min-width: 152px; + } + + .shape-menu-dropdown { + position: fixed; + top: 76px; + left: 10px; + width: min(264px, calc(100vw - 20px)); + } + + .workspace-modal { + padding-top: 18px; + } + + .workspace-modal-card { + width: min(520px, calc(100vw - 24px)); + min-height: calc(100vh - 112px); + max-height: calc(100vh - 112px); + } + + .workplane-plane { + inset: 0; + } + + .grid-settings { + right: 12px; + } + + .shape-floating-controls { + left: 86px; + right: 18px; + min-width: 0; + max-width: none; + transform: none; + } + + .shape-inspector { + right: 0; + width: min(320px, calc(100vw - 18px)); + } +} + +@media (max-width: 640px) { + .mode-tabs, + .collaborator { + display: none; + } + + .action-buttons button { + width: 43px; + min-width: 43px; + padding: 0; + } + + .action-buttons .action-icon-button { + width: 43px; + min-width: 43px; + } + + .view-cube { + left: 18px; + transform: scale(0.82); + transform-origin: top left; + } + + .camera-controls { + left: 7px; + transform: scale(0.86); + transform-origin: top left; + } + + .workplane-plane { + inset: 0; + } + + .shape-floating-controls { + left: 58px; + right: 18px; + bottom: 82px; + } + + .shape-inspector { + top: 12px; + right: 12px; + left: 70px; + width: auto; + } + + .color-grid { + grid-template-columns: repeat(5, 24px); + gap: 7px; + } + + .color-grid button { + width: 24px; + height: 24px; + } +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx new file mode 100644 index 0000000..bf5d35e --- /dev/null +++ b/src/app/layout.tsx @@ -0,0 +1,23 @@ +import type { Metadata } from "next"; +import "./globals.css"; + +export const metadata: Metadata = { + title: "SketchForge 3D editor", + description: "Browser-based SketchForge editor workspace", + icons: { + icon: "assets/sketchforge/sketchforge-logo.png", + apple: "assets/sketchforge/sketchforge-logo.png", + }, +}; + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + + {children} + + ); +} diff --git a/src/app/page.tsx b/src/app/page.tsx new file mode 100644 index 0000000..d0b9a1f --- /dev/null +++ b/src/app/page.tsx @@ -0,0 +1,807 @@ +"use client"; + +import { Clock3, FileUp, Grid3X3, HomeIcon, List, Plus, Search, Settings, SlidersHorizontal, Trash2, X } from "lucide-react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { SketchForgeEditor, importedShapeFromStl } from "@/components/SketchForgeEditor"; +import type { WorkplaneShape } from "@/types/sketchforge"; + +type AppView = "dashboard" | "editor"; +type ViewMode = "grid" | "list"; +type DownloadMode = "browser" | "folder"; + +type DashboardProject = { + id: string; + name: string; + createdAt: number; + updatedAt: number; + shapes: number; + accent: "cyan" | "green" | "gold" | "red"; + thumbnailUrl?: string | null; + thumbnailVersion?: number; + revision?: number; +}; + +type StoredDashboardProject = Partial & { + designShapes?: unknown; +}; + +type ProjectShapeCacheEntry = { + revision: number; + shapes: WorkplaneShape[]; +}; + +type ProjectShapeRecord = ProjectShapeCacheEntry & { + id: string; + updatedAt: number; +}; + +const PROJECTS_STORAGE_KEY = "sketchForge.projects"; +const PROJECT_SHAPES_DB_NAME = "sketchForge.projectShapes"; +const PROJECT_SHAPES_STORE_NAME = "projectShapes"; +const DOWNLOAD_MODE_STORAGE_KEY = "sketchForge.downloadMode"; +const DOWNLOAD_FOLDER_STORAGE_KEY = "sketchForge.downloadFolder"; +const PROJECT_ACCENTS: DashboardProject["accent"][] = ["cyan", "green", "gold", "red"]; + +function formatUpdated(timestamp: number) { + const age = Date.now() - timestamp; + if (age < 60_000) return "Just now"; + if (age < 3_600_000) return `${Math.max(1, Math.round(age / 60_000))} min ago`; + if (age < 86_400_000) return "Today"; + return new Intl.DateTimeFormat(undefined, { month: "short", day: "numeric" }).format(new Date(timestamp)); +} + +function openProjectShapesDb() { + return new Promise((resolve, reject) => { + if (typeof window === "undefined" || !window.indexedDB) { + reject(new Error("Project shape storage is unavailable")); + return; + } + + const request = window.indexedDB.open(PROJECT_SHAPES_DB_NAME, 1); + request.onupgradeneeded = () => { + const database = request.result; + if (!database.objectStoreNames.contains(PROJECT_SHAPES_STORE_NAME)) { + database.createObjectStore(PROJECT_SHAPES_STORE_NAME, { keyPath: "id" }); + } + }; + request.onerror = () => reject(request.error ?? new Error("Could not open project shape storage")); + request.onsuccess = () => resolve(request.result); + }); +} + +async function loadProjectShapes(projectId: string) { + const database = await openProjectShapesDb(); + return new Promise((resolve, reject) => { + const transaction = database.transaction(PROJECT_SHAPES_STORE_NAME, "readonly"); + const request = transaction.objectStore(PROJECT_SHAPES_STORE_NAME).get(projectId); + request.onerror = () => reject(request.error ?? new Error("Could not load project shapes")); + request.onsuccess = () => resolve((request.result as ProjectShapeRecord | undefined) ?? null); + transaction.oncomplete = () => database.close(); + transaction.onerror = () => { + database.close(); + reject(transaction.error ?? new Error("Could not load project shapes")); + }; + }); +} + +async function saveProjectShapes(projectId: string, shapes: WorkplaneShape[], revision: number) { + const database = await openProjectShapesDb(); + return new Promise((resolve, reject) => { + const transaction = database.transaction(PROJECT_SHAPES_STORE_NAME, "readwrite"); + transaction.objectStore(PROJECT_SHAPES_STORE_NAME).put({ id: projectId, revision, shapes, updatedAt: Date.now() } satisfies ProjectShapeRecord); + transaction.oncomplete = () => { + database.close(); + resolve(); + }; + transaction.onerror = () => { + database.close(); + reject(transaction.error ?? new Error("Could not save project shapes")); + }; + transaction.onabort = () => { + database.close(); + reject(transaction.error ?? new Error("Could not save project shapes")); + }; + }); +} + +async function deleteProjectShapes(projectId: string) { + const database = await openProjectShapesDb(); + return new Promise((resolve, reject) => { + const transaction = database.transaction(PROJECT_SHAPES_STORE_NAME, "readwrite"); + transaction.objectStore(PROJECT_SHAPES_STORE_NAME).delete(projectId); + transaction.oncomplete = () => { + database.close(); + resolve(); + }; + transaction.onerror = () => { + database.close(); + reject(transaction.error ?? new Error("Could not delete project shapes")); + }; + }); +} + +function readStoredProjects() { + const legacyShapes: Record = {}; + if (typeof window === "undefined") return { projects: [] as DashboardProject[], legacyShapes }; + try { + const parsed = JSON.parse(window.localStorage.getItem(PROJECTS_STORAGE_KEY) ?? "[]") as StoredDashboardProject[]; + const projects = parsed + .filter((project) => typeof project.id === "string" && typeof project.name === "string") + .map((project, index) => { + const id = project.id as string; + const updatedAt = typeof project.updatedAt === "number" ? project.updatedAt : Date.now(); + const revision = typeof project.revision === "number" ? project.revision : updatedAt; + const designShapes = Array.isArray(project.designShapes) ? (project.designShapes as WorkplaneShape[]) : null; + if (designShapes) { + legacyShapes[id] = { revision, shapes: designShapes }; + } + return { + id, + name: project.name as string, + createdAt: typeof project.createdAt === "number" ? project.createdAt : Date.now(), + updatedAt, + shapes: typeof project.shapes === "number" ? project.shapes : (designShapes?.length ?? 0), + accent: PROJECT_ACCENTS.includes(project.accent as DashboardProject["accent"]) ? (project.accent as DashboardProject["accent"]) : PROJECT_ACCENTS[index % PROJECT_ACCENTS.length], + thumbnailUrl: typeof project.thumbnailUrl === "string" ? project.thumbnailUrl : null, + thumbnailVersion: typeof project.thumbnailVersion === "number" ? project.thumbnailVersion : undefined, + revision, + }; + }); + return { projects, legacyShapes }; + } catch { + return { projects: [], legacyShapes }; + } +} + +function readProjects() { + return readStoredProjects().projects; +} + +function mergeProjectForStorage(project: DashboardProject, storedProject?: DashboardProject) { + if (!storedProject) { + return project; + } + const projectRevision = project.revision ?? 0; + const storedRevision = storedProject.revision ?? 0; + if (storedRevision <= projectRevision) { + return project; + } + return { + ...project, + revision: storedProject.revision, + shapes: storedProject.shapes || project.shapes, + thumbnailUrl: project.thumbnailUrl ?? storedProject.thumbnailUrl, + thumbnailVersion: project.thumbnailVersion ?? storedProject.thumbnailVersion, + updatedAt: Math.max(project.updatedAt, storedProject.updatedAt), + }; +} + +function projectForStorage(project: DashboardProject): DashboardProject { + return { + id: project.id, + name: project.name, + createdAt: project.createdAt, + updatedAt: project.updatedAt, + shapes: project.shapes, + accent: project.accent, + thumbnailUrl: project.thumbnailUrl ?? null, + thumbnailVersion: project.thumbnailVersion, + revision: project.revision, + }; +} + +function mergeProjectsForStorage(projects: DashboardProject[]) { + const storedProjects = readProjects(); + const storedById = new Map(storedProjects.map((project) => [project.id, project])); + return projects.map((project) => projectForStorage(mergeProjectForStorage(project, storedById.get(project.id)))); +} + +function newProject(name: string, index: number, shapeCount = 0): DashboardProject { + const now = Date.now(); + return { + id: crypto.randomUUID(), + name, + createdAt: now, + updatedAt: now, + shapes: shapeCount, + accent: PROJECT_ACCENTS[index % PROJECT_ACCENTS.length], + revision: now, + }; +} + +function projectNameFromFileName(fileName: string) { + return fileName.replace(/\.[^.]+$/, "").trim() || "Imported STL design"; +} + +export default function Home() { + const [mounted, setMounted] = useState(false); + const [view, setView] = useState("dashboard"); + const [editorStarted, setEditorStarted] = useState(false); + const [activeProjectId, setActiveProjectId] = useState(null); + const [projects, setProjects] = useState([]); + const [query, setQuery] = useState(""); + const [viewMode, setViewMode] = useState("grid"); + const [sortMode, setSortMode] = useState("recent"); + const [settingsOpen, setSettingsOpen] = useState(false); + const [downloadMode, setDownloadMode] = useState("browser"); + const [downloadFolder, setDownloadFolder] = useState(""); + const [dashboardNotice, setDashboardNotice] = useState(""); + const [projectShapesById, setProjectShapesById] = useState>({}); + const projectsJsonRef = useRef(""); + const dashboardStlInputRef = useRef(null); + + useEffect(() => { + const { projects: storedProjects, legacyShapes } = readStoredProjects(); + setProjects(storedProjects); + if (Object.keys(legacyShapes).length > 0) { + setProjectShapesById(legacyShapes); + Object.entries(legacyShapes).forEach(([projectId, entry]) => { + void saveProjectShapes(projectId, entry.shapes, entry.revision).catch(() => { + setDashboardNotice("Could not migrate project shapes to larger storage"); + }); + }); + } + setDownloadMode(window.localStorage.getItem(DOWNLOAD_MODE_STORAGE_KEY) === "folder" ? "folder" : "browser"); + setDownloadFolder(window.localStorage.getItem(DOWNLOAD_FOLDER_STORAGE_KEY) ?? ""); + + const params = new URLSearchParams(window.location.search); + if (params.has("codexBooleanCase") || params.get("editor") === "1") { + const requestedProjectId = params.get("project"); + if (requestedProjectId && storedProjects.some((project) => project.id === requestedProjectId)) { + setActiveProjectId(requestedProjectId); + } + setEditorStarted(true); + setView("editor"); + } + setMounted(true); + }, []); + + useEffect(() => { + if (!mounted) return; + const localSerialized = JSON.stringify(projects); + const storageProjects = mergeProjectsForStorage(projects); + const serialized = JSON.stringify(storageProjects); + if (projectsJsonRef.current === serialized) return; + try { + window.localStorage.setItem(PROJECTS_STORAGE_KEY, serialized); + } catch (error) { + try { + window.localStorage.removeItem(PROJECTS_STORAGE_KEY); + window.localStorage.setItem(PROJECTS_STORAGE_KEY, serialized); + } catch { + setDashboardNotice(error instanceof Error ? error.message : "Could not save project list"); + return; + } + } + projectsJsonRef.current = serialized; + if (serialized !== localSerialized) { + setProjects(storageProjects); + } + }, [mounted, projects]); + + useEffect(() => { + if (!mounted) return; + const onStorage = (event: StorageEvent) => { + if (event.key !== PROJECTS_STORAGE_KEY) return; + projectsJsonRef.current = event.newValue ?? "[]"; + setProjects(readProjects()); + }; + window.addEventListener("storage", onStorage); + return () => window.removeEventListener("storage", onStorage); + }, [mounted]); + + useEffect(() => { + if (!activeProjectId) return; + if (projects.some((project) => project.id === activeProjectId)) return; + setActiveProjectId(null); + setView("dashboard"); + if (typeof window !== "undefined") { + window.history.replaceState(null, "", "/"); + } + }, [activeProjectId, projects]); + + useEffect(() => { + if (!mounted || !activeProjectId) return; + const activeProject = projects.find((project) => project.id === activeProjectId); + if (!activeProject) return; + const cached = projectShapesById[activeProjectId]; + if (cached && cached.revision === activeProject.revision) return; + + let canceled = false; + void loadProjectShapes(activeProjectId) + .then((record) => { + if (canceled) return; + const revision = activeProject.revision ?? record?.revision ?? Date.now(); + setProjectShapesById((current) => ({ + ...current, + [activeProjectId]: { + revision, + shapes: record?.shapes ?? [], + }, + })); + }) + .catch((error) => { + if (!canceled) { + setDashboardNotice(error instanceof Error ? error.message : "Could not load project shapes"); + setProjectShapesById((current) => ({ + ...current, + [activeProjectId]: { + revision: activeProject.revision ?? Date.now(), + shapes: [], + }, + })); + } + }); + return () => { + canceled = true; + }; + }, [activeProjectId, mounted, projectShapesById, projects]); + + useEffect(() => { + if (!mounted) return; + window.localStorage.setItem(DOWNLOAD_MODE_STORAGE_KEY, downloadMode); + window.localStorage.setItem(DOWNLOAD_FOLDER_STORAGE_KEY, downloadFolder); + }, [downloadFolder, downloadMode, mounted]); + + const visibleProjects = useMemo(() => { + const normalizedQuery = query.trim().toLowerCase(); + const filtered = normalizedQuery ? projects.filter((project) => project.name.toLowerCase().includes(normalizedQuery)) : projects; + return sortMode === "name" ? [...filtered].sort((a, b) => a.name.localeCompare(b.name)) : [...filtered].sort((a, b) => b.updatedAt - a.updatedAt); + }, [projects, query, sortMode]); + + const openEditor = (projectId: string | null, options: { allowMissingFromStorage?: boolean } = {}) => { + if (projectId && typeof window !== "undefined" && !options.allowMissingFromStorage) { + const storedProjects = readProjects(); + const storedProject = storedProjects.find((project) => project.id === projectId); + if (!storedProject) { + setProjects(storedProjects); + setActiveProjectId(null); + setView("dashboard"); + window.history.replaceState(null, "", "/"); + return; + } + setProjects(storedProjects.map((project) => (project.id === projectId ? { ...project, updatedAt: Date.now() } : project))); + } else if (projectId) { + setProjects((current) => current.map((project) => (project.id === projectId ? { ...project, updatedAt: Date.now() } : project))); + } + setActiveProjectId(projectId); + setEditorStarted(true); + setView("editor"); + if (typeof window !== "undefined") { + const nextUrl = projectId ? `/?editor=1&project=${encodeURIComponent(projectId)}` : "/?editor=1"; + window.history.replaceState(null, "", nextUrl); + } + }; + + const updateProjectSnapshot = useCallback((snapshot: { image: string; projectId: string; shapes: number }) => { + const version = Date.now(); + setProjects((current) => + current.map((project) => (project.id === snapshot.projectId ? { ...project, shapes: snapshot.shapes, updatedAt: version } : project)), + ); + void fetch("/api/project-thumbnail", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ dataUrl: snapshot.image, projectId: snapshot.projectId }), + }) + .then((response) => (response.ok ? response.json() : null)) + .then((payload: { version?: number } | null) => { + const nextVersion = payload?.version ?? Date.now(); + const thumbnailUrl = `/api/project-thumbnail?projectId=${encodeURIComponent(snapshot.projectId)}&v=${nextVersion}`; + setProjects((current) => + current.map((project) => + project.id === snapshot.projectId + ? { ...project, shapes: snapshot.shapes, thumbnailUrl, thumbnailVersion: nextVersion, updatedAt: nextVersion } + : project, + ), + ); + }) + .catch(() => { + setProjects((current) => + current.map((project) => (project.id === snapshot.projectId ? { ...project, shapes: snapshot.shapes, updatedAt: version } : project)), + ); + }); + }, []); + + const updateProjectShapes = useCallback((snapshot: { projectId: string; shapes: WorkplaneShape[] }) => { + const revision = Date.now(); + setProjectShapesById((current) => ({ + ...current, + [snapshot.projectId]: { revision, shapes: snapshot.shapes }, + })); + void saveProjectShapes(snapshot.projectId, snapshot.shapes, revision) + .then(() => { + setProjects((current) => + current.map((project) => + project.id === snapshot.projectId + ? { ...project, shapes: snapshot.shapes.length, updatedAt: revision, revision } + : project, + ), + ); + }) + .catch((error) => { + setDashboardNotice(error instanceof Error ? error.message : "Could not save project shapes"); + }); + }, []); + + const createAndOpenProject = (name?: string) => { + const project = newProject(name ?? `Untitled design ${projects.length + 1}`, projects.length); + setProjectShapesById((current) => ({ + ...current, + [project.id]: { revision: project.revision ?? project.updatedAt, shapes: [] }, + })); + void saveProjectShapes(project.id, [], project.revision ?? project.updatedAt).catch(() => { + setDashboardNotice("Could not prepare project shape storage"); + }); + setProjects((current) => [project, ...current]); + openEditor(project.id, { allowMissingFromStorage: true }); + }; + + const importStlFileFromDashboard = useCallback( + async (file: File) => { + const extension = file.name.split(".").pop()?.toLowerCase(); + if (extension !== "stl") { + setDashboardNotice("Unsupported file type. Use STL."); + return; + } + + try { + const shape = importedShapeFromStl(file.name, await file.arrayBuffer()); + const project = newProject(projectNameFromFileName(file.name), projects.length, 1); + const revision = project.revision ?? project.updatedAt; + await saveProjectShapes(project.id, [shape], revision); + setProjectShapesById((current) => ({ + ...current, + [project.id]: { revision, shapes: [shape] }, + })); + setDashboardNotice(`Imported ${file.name}`); + setProjects((current) => [project, ...current]); + openEditor(project.id, { allowMissingFromStorage: true }); + } catch (error) { + setDashboardNotice(error instanceof Error ? error.message : `Could not import ${file.name}`); + } + }, + [projects.length], + ); + + const openLatestProject = () => { + const latest = [...projects].sort((a, b) => b.updatedAt - a.updatedAt)[0]; + if (latest) { + openEditor(latest.id); + return; + } + createAndOpenProject(); + }; + + const openDashboard = () => { + if (activeProjectId) { + setProjects((current) => current.map((project) => (project.id === activeProjectId ? { ...project, updatedAt: Date.now() } : project))); + } + setView("dashboard"); + if (typeof window !== "undefined") { + window.history.replaceState(null, "", "/"); + } + }; + + const deleteProject = (projectId: string) => { + setProjects((current) => current.filter((project) => project.id !== projectId)); + setProjectShapesById((current) => { + const next = { ...current }; + delete next[projectId]; + return next; + }); + if (activeProjectId === projectId) { + setActiveProjectId(null); + } + void fetch(`/api/project-thumbnail?projectId=${encodeURIComponent(projectId)}`, { method: "DELETE" }); + void deleteProjectShapes(projectId).catch(() => { + setDashboardNotice("Could not delete project shapes from local storage"); + }); + }; + + if (!mounted) { + return null; + } + + const activeProject = activeProjectId ? projects.find((project) => project.id === activeProjectId) ?? null : null; + const activeProjectShapeEntry = activeProjectId ? projectShapesById[activeProjectId] : null; + const canRenderEditor = !activeProjectId || (Boolean(activeProject) && Boolean(activeProjectShapeEntry)); + const projectDebugSummary = projects.map((project) => ({ + id: project.id, + revision: project.revision, + shapes: project.shapes, + designShapes: projectShapesById[project.id]?.shapes.length ?? null, + thumbnail: Boolean(project.thumbnailUrl), + })); + + return ( + <> + + { + const file = event.currentTarget.files?.[0]; + if (file) { + void importStlFileFromDashboard(file); + } + event.currentTarget.value = ""; + }} + /> + {view === "dashboard" ? ( + setSettingsOpen(false)} + onCreate={() => createAndOpenProject()} + onDeleteProject={deleteProject} + onDownloadFolderChange={setDownloadFolder} + onDownloadModeChange={setDownloadMode} + onImportStl={() => dashboardStlInputRef.current?.click()} + onOpenProject={openEditor} + onOpenSettings={() => setSettingsOpen(true)} + onQueryChange={setQuery} + onSortModeChange={setSortMode} + onViewModeChange={setViewMode} + onWorkspace={openLatestProject} + /> + ) : null} + {editorStarted && canRenderEditor ? ( +
+ +
+ ) : null} + + ); +} + +function Dashboard({ + dashboardNotice, + downloadFolder, + downloadMode, + projects, + query, + settingsOpen, + sortMode, + viewMode, + onCloseSettings, + onCreate, + onDeleteProject, + onDownloadFolderChange, + onDownloadModeChange, + onImportStl, + onOpenProject, + onOpenSettings, + onQueryChange, + onSortModeChange, + onViewModeChange, + onWorkspace, +}: { + dashboardNotice: string; + downloadFolder: string; + downloadMode: DownloadMode; + projects: DashboardProject[]; + query: string; + settingsOpen: boolean; + sortMode: string; + viewMode: ViewMode; + onCloseSettings: () => void; + onCreate: () => void; + onDeleteProject: (projectId: string) => void; + onDownloadFolderChange: (value: string) => void; + onDownloadModeChange: (value: DownloadMode) => void; + onImportStl: () => void; + onOpenProject: (projectId: string) => void; + onOpenSettings: () => void; + onQueryChange: (value: string) => void; + onSortModeChange: (value: string) => void; + onViewModeChange: (value: ViewMode) => void; + onWorkspace: () => void; +}) { + const [projectPendingDeleteId, setProjectPendingDeleteId] = useState(null); + const projectPendingDelete = projects.find((project) => project.id === projectPendingDeleteId) ?? null; + + useEffect(() => { + if (!projectPendingDeleteId) return; + if (projects.some((project) => project.id === projectPendingDeleteId)) return; + setProjectPendingDeleteId(null); + }, [projectPendingDeleteId, projects]); + + const confirmProjectDelete = () => { + if (!projectPendingDelete) return; + onDeleteProject(projectPendingDelete.id); + setProjectPendingDeleteId(null); + }; + + return ( +
+
+ +
+ + onQueryChange(event.currentTarget.value)} placeholder="Search projects" aria-label="Search projects" /> +
+ +
+ +
+ + +
+
+ + + +
+ {dashboardNotice ? ( +
+ {dashboardNotice} +
+ ) : null} + +
+
+

Projects

+ {projects.length} visible +
+
+ +
+ + +
+
+
+ + {projects.length > 0 ? ( +
+ {projects.map((project) => ( +
+ + +
+ ))} +
+ ) : ( +
+ No projects yet + Create a 3D design and it will appear here. +
+ )} +
+
+ + {projectPendingDelete ? ( +
+
+
+ Delete project? + +
+

+ Do you actually want the project {projectPendingDelete.name} to be deleted? +

+
+ + +
+
+
+ ) : null} + + {settingsOpen ? ( +
+
+ Download settings + +
+ + +
+ ) : null} +
+ ); +} + +function ProjectPreview({ accent, thumbnailUrl }: { accent: DashboardProject["accent"]; thumbnailUrl?: string | null }) { + return ( +