diff --git a/app/.gitignore b/.gitignore similarity index 89% rename from app/.gitignore rename to .gitignore index 3b462cb..c79fcd9 100644 --- a/app/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ node_modules .vercel .netlify .wrangler -/.svelte-kit -/build +*/.svelte-kit +*/build # OS .DS_Store diff --git a/Caddyfile b/Caddyfile index 4627014..ce64fad 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,17 +1,35 @@ # Reverse proxy — single port for both the SvelteKit app and PocketBase -# Route: /api/* and /_/* → PocketBase +# Route: /api/basket, /api/checkout/*, /api/webhooks/* → SvelteKit app (commerce endpoints) +# /api/* and /_/* → PocketBase # everything else → SvelteKit app :8080 { + # SvelteKit commerce endpoints must reach the app, not PocketBase. + # These matchers are more specific than the generic /api/* handle below. + handle /api/basket { + reverse_proxy app:3000 + } + + handle /api/checkout/* { + reverse_proxy app:3000 + } + + handle /api/webhooks/* { + reverse_proxy app:3000 + } + + # PocketBase REST API (collections, records, files, health) handle /api/* { reverse_proxy pocketbase:80 } + # PocketBase admin UI handle /_/* { reverse_proxy pocketbase:80 } + # Public site + SSR pages handle { reverse_proxy app:3000 } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 223b11f..d87e180 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,17 @@ If schema import fails because of a PocketBase version mismatch, create these co - `file`: file, required, max select `1`, image mime types - `alt`: text +Commerce collections (see the Stripe section above for context): + +- `items` — `name` text, `description` text, `price` number, `image` relation→media, `type` select `item|item_with_time`, `stock` number (nullable), `duration` number (nullable, minutes), `active` bool +- `slots` — `item` relation→items, `start` date, `end` date, `status` select `available|held|booked`, `heldUntil` date (nullable), `order` relation→orders (nullable), `notes` text +- `baskets` — `status` select `active|completed|abandoned`, `expiresAt` date, `email` text, `customerDetails` json, `stripePaymentIntentId` text +- `basket_lines` — `basket` relation→baskets, `item` relation→items, `slot` relation→slots (nullable), `quantity` number, `lineType` select `item|slot` +- `orders` — `basket` relation→baskets, `email` text, `customerDetails` json, `total` number, `status` select `pending|paid|refunded`, `stripePaymentIntentId` text +- `order_lines` — `order` relation→orders, `item` relation→items, `slot` relation→slots (nullable), `quantity` number, `lineType` select `item|slot`, `name` text (snapshot), `price` number (snapshot), `start` date (nullable, snapshot) + +> **Schema format note:** `pb_schema.json` targets PocketBase 0.23+ using the `fields` array (not the legacy `schema` array). Relation and select fields carry their config (`collectionId`, `cascadeDelete`, `maxSelect`, `values`) at the field top level, not nested under `options`. Importing the whole file via the PocketBase admin UI or `PUT /api/collections/import` creates or updates all collections in one pass. + ## Authentication Admin routes live under `/admin`. Login accepts either: @@ -100,8 +111,28 @@ All `/admin` routes except `/admin/login` are guarded in `src/hooks.server.ts`. - `/admin/login` — sign in - `/admin/pages` — list/create pages - `/admin/pages/[slug]` — block editor with draft preview +- `/admin/calendar` — events shown by Upcoming Calendar blocks +- `/admin/items` — services and products shown in Shop blocks +- `/admin/slots` — manually created bookable time slots for services +- `/admin/orders` — read-only list of confirmed bookings and purchases - `/admin/globals` — header/footer editor +## Reservations & payments (Stripe) + +The shop/checkout blocks implement a basket-based booking flow: visitors add services (with time slots) or products to a server-side basket, then pay with an embedded Stripe Payment Element. Order creation is confirmed by the Stripe **webhook** (never the client). + +Setup: + +1. Add the Stripe + PocketBase-admin vars from `app/.env.example` to `app/.env` (local dev) or a root-level `.env` next to `docker-compose.yml` (Docker). +2. `POCKETBASE_ADMIN_EMAIL` / `POCKETBASE_ADMIN_PASSWORD` are the credentials of the PocketBase superuser you created — the basket/checkout/webhook APIs use a server-side admin client so collection rules can stay admin-only. +3. For local webhook testing, forward Stripe events with the CLI: + ```sh + stripe listen --forward-to localhost:8080/api/webhooks/stripe + ``` + Copy the printed `whsec_…` signing secret into `STRIPE_WEBHOOK_SECRET`. +4. Import the updated `pb_schema.json` (adds `items`, `slots`, `baskets`, `basket_lines`, `orders`, `order_lines`). The `basket_lines.slot` partial unique index guarantees two visitors can't hold the same slot. +5. Create a published page (e.g. slug `book`) with a `shop` block and a `checkout` block, and point the header CTA at it. + ## Public routes - `/` renders `pages.slug = "home"` diff --git a/app/.env.example b/app/.env.example index 29618d2..71a3dce 100644 --- a/app/.env.example +++ b/app/.env.example @@ -1 +1,13 @@ -PUBLIC_POCKETBASE_URL=http://localhost:8080 +PUBLIC_POCKETBASE_URL=http://localhost:8080 +POCKETBASE_INTERNAL_URL=http://pocketbase:80 +ORIGIN=http://localhost:8080 + +# Stripe +STRIPE_SECRET_KEY=sk_test_... +PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_... +STRIPE_WEBHOOK_SECRET=whsec_... +STRIPE_CURRENCY=eur + +# PocketBase admin credentials (for server-side basket/checkout/webhook APIs) +POCKETBASE_ADMIN_EMAIL=admin@example.com +POCKETBASE_ADMIN_PASSWORD=changeme diff --git a/app/bun.lock b/app/bun.lock new file mode 100644 index 0000000..d7d44d4 --- /dev/null +++ b/app/bun.lock @@ -0,0 +1,467 @@ +{ + "lockfileVersion": 1, + "configVersion": 0, + "workspaces": { + "": { + "name": "app", + "dependencies": { + "@dnd-kit/core": "^6.3.1", + "@dnd-kit/sortable": "^10.0.0", + "@dnd-kit/utilities": "^3.2.2", + "@stripe/stripe-js": "^9.12.1", + "@sveltejs/adapter-node": "^5.5.4", + "@tailwindcss/vite": "^4.3.0", + "@tiptap/core": "^3.23.4", + "@tiptap/extension-link": "^3.23.4", + "@tiptap/extension-placeholder": "^3.23.4", + "@tiptap/starter-kit": "^3.23.4", + "daisyui": "^5.5.19", + "pocketbase": "^0.26.9", + "stripe": "^22.3.2", + "svelte-tiptap": "^3.0.1", + "tailwindcss": "^4.3.0", + "uuid": "^14.0.0", + }, + "devDependencies": { + "@sveltejs/adapter-auto": "^7.0.1", + "@sveltejs/kit": "^2.57.0", + "@sveltejs/vite-plugin-svelte": "^7.0.0", + "@types/node": "^25.8.0", + "@types/uuid": "^10.0.0", + "svelte": "^5.55.2", + "svelte-check": "^4.4.6", + "typescript": "^6.0.2", + "vite": "^8.0.7", + }, + }, + }, + "packages": { + "@dnd-kit/accessibility": ["@dnd-kit/accessibility@3.1.1", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw=="], + + "@dnd-kit/core": ["@dnd-kit/core@6.3.1", "", { "dependencies": { "@dnd-kit/accessibility": "^3.1.1", "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ=="], + + "@dnd-kit/sortable": ["@dnd-kit/sortable@10.0.0", "", { "dependencies": { "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@dnd-kit/core": "^6.3.0", "react": ">=16.8.0" } }, "sha512-+xqhmIIzvAYMGfBYYnbKuNicfSsk4RksY2XdmJhT+HAC01nix6fHCztU68jooFiMUB01Ky3F0FyOvhG/BZrWkg=="], + + "@dnd-kit/utilities": ["@dnd-kit/utilities@3.2.2", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg=="], + + "@emnapi/core": ["@emnapi/core@1.10.0", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.1", "tslib": "^2.4.0" } }, "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw=="], + + "@emnapi/runtime": ["@emnapi/runtime@1.10.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA=="], + + "@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w=="], + + "@floating-ui/core": ["@floating-ui/core@1.7.5", "", { "dependencies": { "@floating-ui/utils": "^0.2.11" } }, "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ=="], + + "@floating-ui/dom": ["@floating-ui/dom@1.7.6", "", { "dependencies": { "@floating-ui/core": "^1.7.5", "@floating-ui/utils": "^0.2.11" } }, "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ=="], + + "@floating-ui/utils": ["@floating-ui/utils@0.2.11", "", {}, "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg=="], + + "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="], + + "@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="], + + "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="], + + "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="], + + "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], + + "@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.4", "", { "dependencies": { "@tybys/wasm-util": "^0.10.1" }, "peerDependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1" } }, "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow=="], + + "@oxc-project/types": ["@oxc-project/types@0.130.0", "", {}, "sha512-ibD2usx9JRu7f5pu2tMKMI4cpA4NgXJQoYRP4pQ7Pxmn1l6k/53qWtQWZayhYy3X4QZkt90Ot+mJEaeXouio6Q=="], + + "@polka/url": ["@polka/url@1.0.0-next.29", "", {}, "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww=="], + + "@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.0.1", "", { "os": "android", "cpu": "arm64" }, "sha512-fJI3I0r3C3Oj/zdBCpaCmBRZYf07xpaq4yCfDDoSFm+beWNzbIl26puW8RraUdugoJw/95zerNOn6jasAhzSmg=="], + + "@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.0.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-cKnAhWEsV7TPcA/5EAteDp6KcJZBQ2G+BqE7zayMMi7kMvwRsbv7WT9aOnn0WNl4SKEIf43vjS31iUPu80nzXg=="], + + "@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.0.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-YKrVwQjIRBPo+5G/u03wGjbdy4q7pyzCe93DK9VJ7zkVmeg8LJ7GbgsiHWdR4xSoe4CAXRD7Bcjgbtr64bkXNg=="], + + "@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.0.1", "", { "os": "freebsd", "cpu": "x64" }, "sha512-z/oBsREo46SsFqBwYtFe0kpJeBijAT48O/WXLI4suiCLBkr03RTtTJMCzSdDd2znlh8VJizL09XVkQgk8IZonw=="], + + "@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.0.1", "", { "os": "linux", "cpu": "arm" }, "sha512-ik8q7GM11zxvYxFc2PeDcT6TBvhCQMaUxfph/M5l9sKuTs/Sjg3L+Byw0F7w0ZVLBZmx30P+gG0ECzzN+MFcmQ=="], + + "@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.0.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-QoSx2EkyrrdZ6kcyE8stqZ62t0Yra8Fs5ia9lOxJrh6TMQJK7gQKmscdTHf7pOXKREKrVwOtJcQG3qVSfc866A=="], + + "@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.0.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-uwNwFpwKeNiZawfAWBgg0VIztPTV3ihhh1vV334h9ivnNLorxnQMU6Fz8wG1Zb4Qh9LC1/MkcyT3YlDXG3Rsgg=="], + + "@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.0.1", "", { "os": "linux", "cpu": "ppc64" }, "sha512-zY1bul7OWr7DFBiJ++wofXvnr8B45ce3QsQUhKrIhXsygAh7bTkwyeM1bi1a2g5C/yC/N8TZyGDEoMfm/l9mpg=="], + + "@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.0.1", "", { "os": "linux", "cpu": "s390x" }, "sha512-0frlsT/f4Ft6I7SMESTKnF3cZsdicQn1dCMkF/jT9wDLE+gGoiQfv1nmT9e+s7s/fekvvy6tZM2jHvI2tkbJDQ=="], + + "@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.0.1", "", { "os": "linux", "cpu": "x64" }, "sha512-XABVmGp9Tg0WspTVvwduTc4fpqy6JnAUrSQe6OuyqD/03nI7r0O9OWUkMIwFrjKAIqolvqoA4ZrJppgwE0Gxmw=="], + + "@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.0.1", "", { "os": "linux", "cpu": "x64" }, "sha512-bV4fzswuzVcKD90o/VM6QqKxnxlDq0g2BISDLNVmxrnhpv1DDbyPhCIjYfvzYLV+MvkKKnQt2Q6AO86SEBULUQ=="], + + "@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.0.1", "", { "os": "none", "cpu": "arm64" }, "sha512-/Mh0Zhq3OP7fVs0kcQHZP6lZEthMGTaSf8UBQYSFEZDWGXXlEC+nJ6EqenaK2t4LBXMe3A+K/G2BVXXdtOr4PQ=="], + + "@rolldown/binding-wasm32-wasi": ["@rolldown/binding-wasm32-wasi@1.0.1", "", { "dependencies": { "@emnapi/core": "1.10.0", "@emnapi/runtime": "1.10.0", "@napi-rs/wasm-runtime": "^1.1.4" }, "cpu": "none" }, "sha512-+1xc9X45l8ufsBAm6Gjvx2qDRIY9lTVt0cgWNcJ+1gdhXvkbxePA60yRTwSTuXL09CMhyJmjpV7E3NoyxbqFQQ=="], + + "@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.0.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-1D+UqZdfnuR+Jy1GgMJwi85bD40H21uNmOPRWQhw4oRSuolZ/B5rixZ45DK2KXOTCvmVCecauWgEhbw8bI7tOw=="], + + "@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.0.1", "", { "os": "win32", "cpu": "x64" }, "sha512-INAycaWuhlOK3wk4mRHGsdgwYWmd9cChdPdE9bwWmy6rn9VqVNYNFGhOdXrofXUxwHIncSiPNb8tNm8knDVIeQ=="], + + "@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.1", "", {}, "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw=="], + + "@rollup/plugin-commonjs": ["@rollup/plugin-commonjs@29.0.2", "", { "dependencies": { "@rollup/pluginutils": "^5.0.1", "commondir": "^1.0.1", "estree-walker": "^2.0.2", "fdir": "^6.2.0", "is-reference": "1.2.1", "magic-string": "^0.30.3", "picomatch": "^4.0.2" }, "peerDependencies": { "rollup": "^2.68.0||^3.0.0||^4.0.0" } }, "sha512-S/ggWH1LU7jTyi9DxZOKyxpVd4hF/OZ0JrEbeLjXk/DFXwRny0tjD2c992zOUYQobLrVkRVMDdmHP16HKP7GRg=="], + + "@rollup/plugin-json": ["@rollup/plugin-json@6.1.0", "", { "dependencies": { "@rollup/pluginutils": "^5.1.0" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" } }, "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA=="], + + "@rollup/plugin-node-resolve": ["@rollup/plugin-node-resolve@16.0.3", "", { "dependencies": { "@rollup/pluginutils": "^5.0.1", "@types/resolve": "1.20.2", "deepmerge": "^4.2.2", "is-module": "^1.0.0", "resolve": "^1.22.1" }, "peerDependencies": { "rollup": "^2.78.0||^3.0.0||^4.0.0" } }, "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg=="], + + "@rollup/pluginutils": ["@rollup/pluginutils@5.3.0", "", { "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", "picomatch": "^4.0.2" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" } }, "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q=="], + + "@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.60.4", "", { "os": "android", "cpu": "arm" }, "sha512-F5QXMSiFebS9hKZj02XhWLLnRpJ3B3AROP0tWbFBSj+6kCbg5m9j5JoHKd4mmSVy5mS/IMQloYgYxCuJC0fxEQ=="], + + "@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.60.4", "", { "os": "android", "cpu": "arm64" }, "sha512-GxxTKApUpzRhof7poWvCJHRF51C67u1R7D6DiluBE8wKU1u5GWE8t+v81JvJYtbawoBFX1hLv5Ei4eVjkWokaw=="], + + "@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.60.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-tua0TaJxMOB1R0V0RS1jFZ/RpURFDJIOR2A6jWwQeawuFyS4gBW+rntLRaQd0EQ4bd6Vp44Z2rXW+YYDBsj6IA=="], + + "@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.60.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-CSKq7MsP+5PFIcydhAiR1K0UhEI1A2jWXVKHPCBZ151yOutENwvnPocgVHkivu2kviURtCEB6zUQw0vs8RrhMg=="], + + "@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.60.4", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-+O8OkVdyvXMtJEciu2wS/pzm1IxntEEQx3z5TAVy4l32G0etZn+RsA48ARRrFm6Ri8fvqPQfgrvNxSjKAbnd3g=="], + + "@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.60.4", "", { "os": "freebsd", "cpu": "x64" }, "sha512-Iw3oMskH3AfNuhU0MSN7vNbdi4me/NiYo2azqPz/Le16zHSa+3RRmliCMWWQmh4lcndccU40xcJuTYJZxNo/lw=="], + + "@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.60.4", "", { "os": "linux", "cpu": "arm" }, "sha512-EIPRXTVQpHyF8WOo219AD2yEltPehLTcTMz2fn6JsatLYSzQf00hj3rulF+yauOlF9/FtM2WpkT/hJh/KJFGhA=="], + + "@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.60.4", "", { "os": "linux", "cpu": "arm" }, "sha512-J3Yh9PzzF1Ovah2At+lHiGQdsYgArxBbXv/zHfSyaiFQEqvNv7DcW98pCrmdjCZBrqBiKrKKe2V+aaSGWuBe/w=="], + + "@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.60.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-BFDEZMYfUvLn37ONE1yMBojPxnMlTFsdyNoqncT0qFq1mAfllL+ATMMJd8TeuVMiX84s1KbcxcZbXInmcO2mRg=="], + + "@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.60.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-pc9EYOSlOgdQ2uPl1o9PF6/kLSgaUosia7gOuS8mB69IxJvlclko1MECXysjs5ryez1/5zjYqx3+xYU0TU6R1A=="], + + "@rollup/rollup-linux-loong64-gnu": ["@rollup/rollup-linux-loong64-gnu@4.60.4", "", { "os": "linux", "cpu": "none" }, "sha512-NxnomyxYerDh5n4iLrNa+sH+Z+U4BMEE46V2PgQ/hoB909i8gV1M5wPojWg9fk1jWpO3IQnOs20K4wyZuFLEFQ=="], + + "@rollup/rollup-linux-loong64-musl": ["@rollup/rollup-linux-loong64-musl@4.60.4", "", { "os": "linux", "cpu": "none" }, "sha512-nbJnQ8a3z1mtmrwImCYhc6BGpThAyYVRQxw9uKSKG4wR6aAYno9sVjJ0zaZcW9BPJX1GbrDPf+SvdWjgTuDmnw=="], + + "@rollup/rollup-linux-ppc64-gnu": ["@rollup/rollup-linux-ppc64-gnu@4.60.4", "", { "os": "linux", "cpu": "ppc64" }, "sha512-2EU6acNrQLd8tYvo/LXW535wupT3m6fo7HKo6lr7ktQoItxTyOL1ZCR/GfGCuXl2vR+zmfI6eRXkSemafv+iVg=="], + + "@rollup/rollup-linux-ppc64-musl": ["@rollup/rollup-linux-ppc64-musl@4.60.4", "", { "os": "linux", "cpu": "ppc64" }, "sha512-WeBtoMuaMxiiIrO2IYP3xs6GMWkJP2C0EoT8beTLkUPmzV1i/UcOSVw1d5r9KBODtHKilG5yFxsGRnBbK3wJ4A=="], + + "@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.60.4", "", { "os": "linux", "cpu": "none" }, "sha512-FJHFfqpKUI3A10WrWKiFbBZ7yVbGT4q4B5o1qKFFojqpaYoh9LrQgqWCmmcxQzVSXYtyB5bzkXrYzlHTs21MYA=="], + + "@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.60.4", "", { "os": "linux", "cpu": "none" }, "sha512-mcEl6CUT5IAUmQf1m9FYSmVqCJlpQ8r8eyftFUHG8i9OhY7BkBXSUdnLH5DOf0wCOjcP9v/QO93zpmF1SptCCw=="], + + "@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.60.4", "", { "os": "linux", "cpu": "s390x" }, "sha512-ynt3JxVd2w2buzoKDWIyiV1pJW93xlQic1THVLXilz429oijRpSHivZAgp65KBu+cMcgf1eVVjdnTLvPxgCuoQ=="], + + "@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.60.4", "", { "os": "linux", "cpu": "x64" }, "sha512-Boiz5+MsaROEWDf+GGEwF8VMHGhlUoQMtIPjOgA5fv4osupqTVnJteQNKJwUcnUog2G55jYXH7KZFFiJe0TEzQ=="], + + "@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.60.4", "", { "os": "linux", "cpu": "x64" }, "sha512-+qfSY27qIrFfI/Hom04KYFw3GKZSGU4lXus51wsb5EuySfFlWRwjkKWoE9emgRw/ukoT4Udsj4W/+xxG8VbPKg=="], + + "@rollup/rollup-openbsd-x64": ["@rollup/rollup-openbsd-x64@4.60.4", "", { "os": "openbsd", "cpu": "x64" }, "sha512-VpTfOPHgVXEBeeR8hZ2O0F3aSso+JDWqTWmTmzcQKted54IAdUVbxE+j/MVxUsKa8L20HJhv3vUezVPoquqWjA=="], + + "@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.60.4", "", { "os": "none", "cpu": "arm64" }, "sha512-IPOsh5aRYuLv/nkU51X10Bf75Bsf6+gZdx1X+QP5QM6lIJFHHqbHLG0uJn/hWthzo13UAc2umiUorqZy3axoZg=="], + + "@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.60.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-4QzE9E81OohJ/HKzHhsqU+zcYYojVOXlFMs1DdyMT6qXl/niOH7AVElmmEdUNHHS/oRkc++d5k6Vy85zFs0DEw=="], + + "@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.60.4", "", { "os": "win32", "cpu": "ia32" }, "sha512-zTPgT1YuHHcd+Tmx7h8aml0FWFVelV5N54oHow9SLj+GfoDy/huQ+UV396N/C7KpMDMiPspRktzM1/0r1usYEA=="], + + "@rollup/rollup-win32-x64-gnu": ["@rollup/rollup-win32-x64-gnu@4.60.4", "", { "os": "win32", "cpu": "x64" }, "sha512-DRS4G7mi9lJxqEDezIkKCaUIKCrLUUDCUaCsTPCi/rtqaC6D/jjwslMQyiDU50Ka0JKpeXeRBFBAXwArY52vBw=="], + + "@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.60.4", "", { "os": "win32", "cpu": "x64" }, "sha512-QVTUovf40zgTqlFVrKA1uXMVvU2QWEFWfAH8Wdc48IxLvrJMQVMBRjuQyUpzZCDkakImib9eVazbWlC6ksWtJw=="], + + "@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="], + + "@stripe/stripe-js": ["@stripe/stripe-js@9.12.1", "", {}, "sha512-KLXPvjA0BfS4dQnW+ddHjwtIXMnIfKYxqmeNMmQCfKjvYog0cSG+Z7ZvK4RH1+bV90GC07nUztWDRWmJLi5HZQ=="], + + "@sveltejs/acorn-typescript": ["@sveltejs/acorn-typescript@1.0.9", "", { "peerDependencies": { "acorn": "^8.9.0" } }, "sha512-lVJX6qEgs/4DOcRTpo56tmKzVPtoWAaVbL4hfO7t7NVwl9AAXzQR6cihesW1BmNMPl+bK6dreu2sOKBP2Q9CIA=="], + + "@sveltejs/adapter-auto": ["@sveltejs/adapter-auto@7.0.1", "", { "peerDependencies": { "@sveltejs/kit": "^2.0.0" } }, "sha512-dvuPm1E7M9NI/+canIQ6KKQDU2AkEefEZ2Dp7cY6uKoPq9Z/PhOXABe526UdW2mN986gjVkuSLkOYIBnS/M2LQ=="], + + "@sveltejs/adapter-node": ["@sveltejs/adapter-node@5.5.4", "", { "dependencies": { "@rollup/plugin-commonjs": "^29.0.0", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^16.0.0", "rollup": "^4.59.0" }, "peerDependencies": { "@sveltejs/kit": "^2.4.0" } }, "sha512-45X92CXW+2J8ZUzPv3eLlKWEzINKiiGeFWTjyER4ZN4sGgNoaoeSkCY/QYNxHpPXy71QPsctwccBo9jJs0ySPQ=="], + + "@sveltejs/kit": ["@sveltejs/kit@2.60.1", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "@sveltejs/acorn-typescript": "^1.0.5", "@types/cookie": "^0.6.0", "acorn": "^8.14.1", "cookie": "^0.6.0", "devalue": "^5.8.1", "esm-env": "^1.2.2", "kleur": "^4.1.5", "magic-string": "^0.30.5", "mrmime": "^2.0.0", "set-cookie-parser": "^3.0.0", "sirv": "^3.0.0" }, "peerDependencies": { "@opentelemetry/api": "^1.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0", "svelte": "^4.0.0 || ^5.0.0-next.0", "typescript": "^5.3.3 || ^6.0.0", "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0" }, "optionalPeers": ["@opentelemetry/api"], "bin": { "svelte-kit": "svelte-kit.js" } }, "sha512-mQjlkNo+rJvpln7V2IGY2j99BqhcFbS4UN0AQNKNYfhBAFZTuCDAdW3a1sgf330mvtNvsBXn3HpAhcmvdJTcIQ=="], + + "@sveltejs/vite-plugin-svelte": ["@sveltejs/vite-plugin-svelte@7.1.2", "", { "dependencies": { "deepmerge": "^4.3.1", "magic-string": "^0.30.21", "obug": "^2.1.0", "vitefu": "^1.1.2" }, "peerDependencies": { "svelte": "^5.46.4", "vite": "^8.0.0-beta.7 || ^8.0.0" } }, "sha512-DrUBA2UXRfDmUX/ZTiEopd3X40yavsJF1FX2RygcuIScHL7o5YX1fMvoYnDhjeJQC4weCOklirpNWlcb2NiSeA=="], + + "@tailwindcss/node": ["@tailwindcss/node@4.3.0", "", { "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" } }, "sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g=="], + + "@tailwindcss/oxide": ["@tailwindcss/oxide@4.3.0", "", { "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" } }, "sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg=="], + + "@tailwindcss/oxide-android-arm64": ["@tailwindcss/oxide-android-arm64@4.3.0", "", { "os": "android", "cpu": "arm64" }, "sha512-TJPiq67tKlLuObP6RkwvVGDoxCMBVtDgKkLfa/uyj7/FyxvQwHS+UOnVrXXgbEsfUaMgiVvC4KbJnRr26ho4Ng=="], + + "@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/oxide-darwin-arm64@4.3.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-oMN/WZRb+SO37BmUElEgeEWuU8E/HXRkiODxJxLe1UTHVXLrdVSgfaJV7pSlhRGMSOiXLuxTIjfsF3wYvz8cgQ=="], + + "@tailwindcss/oxide-darwin-x64": ["@tailwindcss/oxide-darwin-x64@4.3.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-N6CUmu4a6bKVADfw77p+iw6Yd9Q3OBhe0veaDX+QazfuVYlQsHfDgxBrsjQ/IW+zywL8mTrNd0SdJT/zgtvMdA=="], + + "@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/oxide-freebsd-x64@4.3.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-zDL5hBkQdH5C6MpqbK3gQAgP80tsMwSI26vjOzjJtNCMUo0lFgOItzHKBIupOZNQxt3ouPH7RPhvNhiTfCe5CQ=="], + + "@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/oxide-linux-arm-gnueabihf@4.3.0", "", { "os": "linux", "cpu": "arm" }, "sha512-R06HdNi7A7OEoMsf6d4tjZ71RCWnZQPHj2mnotSFURjNLdBC+cIgXQ7l81CqeoiQftjf6OOblxXMInMgN2VzMA=="], + + "@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/oxide-linux-arm64-gnu@4.3.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-qTJHELX8jetjhRQHCLilkVLmybpzNQAtaI/gaoVoidn/ufbNDbAo8KlK2J+yPoc8wQxvDxCmh/5lr8nC1+lTbg=="], + + "@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/oxide-linux-arm64-musl@4.3.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-Z6sukiQsngnWO+l39X4pPbiWT81IC+PLKF+PHxIlyZbGNb9MODfYlXEVlFvej5BOZInWX01kVyzeLvHsXhfczQ=="], + + "@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/oxide-linux-x64-gnu@4.3.0", "", { "os": "linux", "cpu": "x64" }, "sha512-DRNdQRpSGzRGfARVuVkxvM8Q12nh19l4BF/G7zGA1oe+9wcC6saFBHTISrpIcKzhiXtSrlSrluCfvMuledoCTQ=="], + + "@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/oxide-linux-x64-musl@4.3.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Z0IADbDo8bh6I7h2IQMx601AdXBLfFpEdUotft86evd/8ZPflZe9COPO8Q1vw+pfLWIUo9zN/JGZvwuAJqduqg=="], + + "@tailwindcss/oxide-wasm32-wasi": ["@tailwindcss/oxide-wasm32-wasi@4.3.0", "", { "cpu": "none" }, "sha512-HNZGOUxEmElksYR7S6sC5jTeNGpobAsy9u7Gu0AskJ8/20FR9GqebUyB+HBcU/ax6BHuiuJi+Oda4B+YX6H1yA=="], + + "@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/oxide-win32-arm64-msvc@4.3.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-Pe+RPVTi1T+qymuuRpcdvwSVZjnll/f7n8gBxMMh3xLTctMDKqpdfGimbMyioqtLhUYZxdJ9wGNhV7MKHvgZsQ=="], + + "@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/oxide-win32-x64-msvc@4.3.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Mvrf2kXW/yeW/OTezZlCGOirXRcUuLIBx/5Y12BaPM7wJoryG6dfS/NJL8aBPqtTEx/Vm4T4vKzFUcKDT+TKUA=="], + + "@tailwindcss/vite": ["@tailwindcss/vite@4.3.0", "", { "dependencies": { "@tailwindcss/node": "4.3.0", "@tailwindcss/oxide": "4.3.0", "tailwindcss": "4.3.0" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7 || ^8" } }, "sha512-t6J3OrB5Fc0ExuhohouH0fWUGMYL6PTLhW+E7zIk/pdbnJARZDCwjBznFnkh5ynRnIRSI4YjtTH0t6USjJISrw=="], + + "@tiptap/core": ["@tiptap/core@3.23.4", "", { "peerDependencies": { "@tiptap/pm": "3.23.4" } }, "sha512-ni2LWE52bVeSt3L2HVBSmbBw+elc32ATej9C68EyKzN/8vR5ILxFn6RCdDTKm4asmwZyq2jys12dKmBdWMr9QA=="], + + "@tiptap/extension-blockquote": ["@tiptap/extension-blockquote@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4" } }, "sha512-7YjSibNlPcy9eGK+tHt5G/Njr7nPxl+rZ3rCC6TwtLIRLSHPnoGDsfFOgTPkXxaQcE1a/VQwemnYfWc3kdIjDQ=="], + + "@tiptap/extension-bold": ["@tiptap/extension-bold@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4" } }, "sha512-3L9tnZ12i+98u5df2nV2zGu/sc3rhI87E3ocn1YYAO8PJUAgZnMwdet8JawCrS1uut5sRKlxo3SXEmdNfRVm/w=="], + + "@tiptap/extension-bubble-menu": ["@tiptap/extension-bubble-menu@3.23.4", "", { "dependencies": { "@floating-ui/dom": "^1.0.0" }, "peerDependencies": { "@tiptap/core": "3.23.4", "@tiptap/pm": "3.23.4" } }, "sha512-EPTpL/IFp/aTGZErBq/Mc3dKznj6G/qNEkVYWjueOn1oKApyT0P6WVHGvu/vpMdErhzmoGDuFPPGVS6T8Upx2Q=="], + + "@tiptap/extension-bullet-list": ["@tiptap/extension-bullet-list@3.23.4", "", { "peerDependencies": { "@tiptap/extension-list": "3.23.4" } }, "sha512-mXB2KZOz1R+E6VNTZ3vzdAk7ZDGKjPmsJEZIQg1B5qRycTKg49/rCCkLA2QnqAwX6BzS3mLLH1RWE2W0oXD7vg=="], + + "@tiptap/extension-code": ["@tiptap/extension-code@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4" } }, "sha512-C0TeRipMycUEBnV+Mzx6eLp/yZb6Vi/waP3Tkb0lO5/ikg7LWLB7AlmMunjIXEUcR/pJHID/aEh5PfJFpysUDg=="], + + "@tiptap/extension-code-block": ["@tiptap/extension-code-block@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4", "@tiptap/pm": "3.23.4" } }, "sha512-UEU1w/85CSNKktbhESnIRmtjKcH7DeschReZA8err1wAnYLTKzid5ucnJSJ25iRg2V5Fnuws5gnPT5CVgdfXCQ=="], + + "@tiptap/extension-document": ["@tiptap/extension-document@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4" } }, "sha512-YC4G6VkxT629rlqUTwD6XvOpxjvghn7fxrK4RbyKVJY2C6E1vgmX0won1Ast6v+qTE6iONOMS6f6VyPxSGjg4w=="], + + "@tiptap/extension-dropcursor": ["@tiptap/extension-dropcursor@3.23.4", "", { "peerDependencies": { "@tiptap/extensions": "3.23.4" } }, "sha512-ujJQUIENk0RwVFCh5g/TOSEv1a7Pnam/cjHmSUqHWUNZkYS9aOqjm+JfURJPCinRS2oHvo3AARul5mkKgDJYcA=="], + + "@tiptap/extension-floating-menu": ["@tiptap/extension-floating-menu@3.23.4", "", { "peerDependencies": { "@floating-ui/dom": "^1.0.0", "@tiptap/core": "3.23.4", "@tiptap/pm": "3.23.4" } }, "sha512-eAc72bKM26yIPx0jsU8qdjE71vFNVu5R9jGbdItBMFc0SPLS4qY8g+8RJ+iWoLwbcSEpgooLS9D9sLfdAU+Tvw=="], + + "@tiptap/extension-gapcursor": ["@tiptap/extension-gapcursor@3.23.4", "", { "peerDependencies": { "@tiptap/extensions": "3.23.4" } }, "sha512-RuyvOlIGP6UpVOc0Lw0L63jKLtYM49CNhPV2OMSfwwwbBZ3pJGos2/SqpYg71d3sn+qpsAopS4Pfr8iPZog73A=="], + + "@tiptap/extension-hard-break": ["@tiptap/extension-hard-break@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4" } }, "sha512-ODlpZCi7n136BH9luM09EFL8Pg+bbRCd0tzCQM5BKMXRkLitYZA8Gl/f5DLmGJ50wzFsDPXK2Br2g9UvZK7COg=="], + + "@tiptap/extension-heading": ["@tiptap/extension-heading@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4" } }, "sha512-8W9Hqi0J69Xbqg08nPf4xRMJXMccaKFAgUE1tvy5PAWJSQxOMwkKQXgZXxwe+80sOMUnV8qveBqUy/ODMPgAxQ=="], + + "@tiptap/extension-horizontal-rule": ["@tiptap/extension-horizontal-rule@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4", "@tiptap/pm": "3.23.4" } }, "sha512-EA4kK8ywZ4dQNOdxeZbplmDDs5T5LjMgHpqxRwukj9wwKiILOK5E3fcKm1fCKh9Q02w96jax6YVccHwmgJP3sQ=="], + + "@tiptap/extension-italic": ["@tiptap/extension-italic@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4" } }, "sha512-jUAHi+HZlg47BzgVIy6y/UH5vev7vPQ95jddhB5K3hC122kvWFMXlken7UOnqzbxNcHs2+4Oi/ZJirYMpT4P5w=="], + + "@tiptap/extension-link": ["@tiptap/extension-link@3.23.4", "", { "dependencies": { "linkifyjs": "^4.3.3" }, "peerDependencies": { "@tiptap/core": "3.23.4", "@tiptap/pm": "3.23.4" } }, "sha512-XjxltY7MomwfTs6jmN6Bw5bb/upb34lpyqv2RiXppFTK25Br7ipksRjUpWpB4/csZeg30qwrLGVKxCol38ffrw=="], + + "@tiptap/extension-list": ["@tiptap/extension-list@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4", "@tiptap/pm": "3.23.4" } }, "sha512-yuauDm6qW/7q+ZO0YJBKQEGdnUm6DDTJM8AMp9bMZrT4jRf/zyUtNcZ91QEfFvBcyVuI+10PIOXtNPevhQ741Q=="], + + "@tiptap/extension-list-item": ["@tiptap/extension-list-item@3.23.4", "", { "peerDependencies": { "@tiptap/extension-list": "3.23.4" } }, "sha512-Q/JXosShD5oyDwukE6igdrZD2lb0ZgyoQTHYchk0pzU4frClFbn3RI1wKP+XeqKLhdO6KH2WZ9rERGH7PtDi7Q=="], + + "@tiptap/extension-list-keymap": ["@tiptap/extension-list-keymap@3.23.4", "", { "peerDependencies": { "@tiptap/extension-list": "3.23.4" } }, "sha512-9FezifCfuoc0o+5K6l4QNOOfelqxnDGg/f9oL1D/LFZPC54bPxpWWft9QCWOqyqZgyLCLjbCjciAlbgkrFUmmw=="], + + "@tiptap/extension-ordered-list": ["@tiptap/extension-ordered-list@3.23.4", "", { "peerDependencies": { "@tiptap/extension-list": "3.23.4" } }, "sha512-+3ofyssYnOTa1+nFWEmCAY1ngn8nAV1xo25JnNNC87NMU9WkSgr93jB7/uUJP0uui1C2dBLlaup3XXm108yarw=="], + + "@tiptap/extension-paragraph": ["@tiptap/extension-paragraph@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4" } }, "sha512-KbhXjCFzWphvFn5VU7E4dtmYDm+bssI1i0+CnXPWCXkjdaaX88ck68Xp1fKz8/bbI/CqlgiNDO/3TvqgtZ6woQ=="], + + "@tiptap/extension-placeholder": ["@tiptap/extension-placeholder@3.23.4", "", { "peerDependencies": { "@tiptap/extensions": "3.23.4" } }, "sha512-yHtAZkFR9M2AQmCi555w4ns1BBCqwRyYDYMtd10DBvqPX7T3TmGerPdUfI6sLr74GxnZ5zHOnOYdwAbeG5JzNw=="], + + "@tiptap/extension-strike": ["@tiptap/extension-strike@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4" } }, "sha512-Vnq5vW801zPbu1LtKeA5k4R241jY+hRjXeijYwIPxy15KzIiipY12518HiCf6/8kkRbMxgOfdYg9X4BRV3HV3g=="], + + "@tiptap/extension-text": ["@tiptap/extension-text@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4" } }, "sha512-q9kxver/MR18p66aWZHSPycnr9hcBFyVGeGj8gf+BQCzn5hpvtSYTfLvk1nq8GFhygdQ9/e3f7B5ovrm/jnpvw=="], + + "@tiptap/extension-underline": ["@tiptap/extension-underline@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4" } }, "sha512-F1ocPT10LV+seky25R1TMCRdc/Iof99jLcDSYDGr6mNEDY4ct2RvOeSM8aDdYq6CkH+vXt3i3JDeRwV23KzswQ=="], + + "@tiptap/extensions": ["@tiptap/extensions@3.23.4", "", { "peerDependencies": { "@tiptap/core": "3.23.4", "@tiptap/pm": "3.23.4" } }, "sha512-SlGPXauW8iKWG7wwuwC/0y/smLImp0h6GBIGgNnTBgIP/ThXQnjLMSZH0mW/REO87dQxkku01V3ARRywi+juhg=="], + + "@tiptap/pm": ["@tiptap/pm@3.23.4", "", { "dependencies": { "prosemirror-changeset": "^2.3.0", "prosemirror-commands": "^1.6.2", "prosemirror-dropcursor": "^1.8.1", "prosemirror-gapcursor": "^1.3.2", "prosemirror-history": "^1.4.1", "prosemirror-keymap": "^1.2.2", "prosemirror-model": "^1.24.1", "prosemirror-schema-list": "^1.5.0", "prosemirror-state": "^1.4.3", "prosemirror-tables": "^1.6.4", "prosemirror-transform": "^1.10.2", "prosemirror-view": "^1.38.1" } }, "sha512-+C5ngcoza47n3MjtjVBqBEBICPC0McdbwzJ+X6SSCviCLoqnSYanv5mIX9HWG0Q4fJ4BkdNM3VibZUxQaTbKyQ=="], + + "@tiptap/starter-kit": ["@tiptap/starter-kit@3.23.4", "", { "dependencies": { "@tiptap/core": "^3.23.4", "@tiptap/extension-blockquote": "^3.23.4", "@tiptap/extension-bold": "^3.23.4", "@tiptap/extension-bullet-list": "^3.23.4", "@tiptap/extension-code": "^3.23.4", "@tiptap/extension-code-block": "^3.23.4", "@tiptap/extension-document": "^3.23.4", "@tiptap/extension-dropcursor": "^3.23.4", "@tiptap/extension-gapcursor": "^3.23.4", "@tiptap/extension-hard-break": "^3.23.4", "@tiptap/extension-heading": "^3.23.4", "@tiptap/extension-horizontal-rule": "^3.23.4", "@tiptap/extension-italic": "^3.23.4", "@tiptap/extension-link": "^3.23.4", "@tiptap/extension-list": "^3.23.4", "@tiptap/extension-list-item": "^3.23.4", "@tiptap/extension-list-keymap": "^3.23.4", "@tiptap/extension-ordered-list": "^3.23.4", "@tiptap/extension-paragraph": "^3.23.4", "@tiptap/extension-strike": "^3.23.4", "@tiptap/extension-text": "^3.23.4", "@tiptap/extension-underline": "^3.23.4", "@tiptap/extensions": "^3.23.4", "@tiptap/pm": "^3.23.4" } }, "sha512-3VhU+NO6/ec9DMj/5Ej0nzARSq42cXnqW+QHCmTL3FNXkXQz+tw1KlfruT5GGJ3M0RssjWjRC0a39N/4S3qxeA=="], + + "@tybys/wasm-util": ["@tybys/wasm-util@0.10.2", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg=="], + + "@types/cookie": ["@types/cookie@0.6.0", "", {}, "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA=="], + + "@types/estree": ["@types/estree@1.0.9", "", {}, "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg=="], + + "@types/node": ["@types/node@25.8.0", "", { "dependencies": { "undici-types": ">=7.24.0 <7.24.7" } }, "sha512-TCFSk8IZh+iLX1xtksoBVtdmgL+1IX0fC9BeU4QqFSuNdN/K+HUlhqOzEmSYYpZUVsLYcPqc9KX+60iDuninSQ=="], + + "@types/resolve": ["@types/resolve@1.20.2", "", {}, "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q=="], + + "@types/trusted-types": ["@types/trusted-types@2.0.7", "", {}, "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw=="], + + "@types/uuid": ["@types/uuid@10.0.0", "", {}, "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ=="], + + "acorn": ["acorn@8.16.0", "", { "bin": "bin/acorn" }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="], + + "aria-query": ["aria-query@5.3.1", "", {}, "sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g=="], + + "axobject-query": ["axobject-query@4.1.0", "", {}, "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ=="], + + "chokidar": ["chokidar@4.0.3", "", { "dependencies": { "readdirp": "^4.0.1" } }, "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA=="], + + "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="], + + "commondir": ["commondir@1.0.1", "", {}, "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg=="], + + "cookie": ["cookie@0.6.0", "", {}, "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw=="], + + "daisyui": ["daisyui@5.5.19", "", {}, "sha512-pbFAkl1VCEh/MPCeclKL61I/MqRIFFhNU7yiXoDDRapXN4/qNCoMxeCCswyxEEhqL5eiTTfwHvucFtOE71C9sA=="], + + "deepmerge": ["deepmerge@4.3.1", "", {}, "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="], + + "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + + "devalue": ["devalue@5.8.1", "", {}, "sha512-4CXDYRBGqN+57wVJkuXBYmpAVUSg3L6JAQa/DFqm238G73E1wuyc/JhGQJzN7vUf/CMphYau2zXbfWzDR5aTEw=="], + + "enhanced-resolve": ["enhanced-resolve@5.21.3", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.3" } }, "sha512-QyL119InA+XXEkNLNTPCXPugSvOfhwv0JOlGNzvxs0hZaiHLNvXSpudUWsOlsXGWJh8G6ckCScEkVHfX3kw/2Q=="], + + "es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="], + + "esm-env": ["esm-env@1.2.2", "", {}, "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA=="], + + "esrap": ["esrap@2.2.9", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, "peerDependencies": { "@typescript-eslint/types": "^8.2.0" }, "optionalPeers": ["@typescript-eslint/types"] }, "sha512-4KijP+NxCWthMCUC3qHbE6n4vCjqgJS1uAYKhuT/GWfFTf1Qyive2TgOjep+gzbSzRfnNyaN/UU9YmdOt8Eg0A=="], + + "estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="], + + "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" } }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], + + "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + + "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], + + "graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="], + + "hasown": ["hasown@2.0.3", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg=="], + + "is-core-module": ["is-core-module@2.16.2", "", { "dependencies": { "hasown": "^2.0.3" } }, "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA=="], + + "is-module": ["is-module@1.0.0", "", {}, "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g=="], + + "is-reference": ["is-reference@3.0.3", "", { "dependencies": { "@types/estree": "^1.0.6" } }, "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw=="], + + "jiti": ["jiti@2.7.0", "", { "bin": "lib/jiti-cli.mjs" }, "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ=="], + + "kleur": ["kleur@4.1.5", "", {}, "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ=="], + + "lightningcss": ["lightningcss@1.32.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "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" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="], + + "lightningcss-android-arm64": ["lightningcss-android-arm64@1.32.0", "", { "os": "android", "cpu": "arm64" }, "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg=="], + + "lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.32.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ=="], + + "lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.32.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w=="], + + "lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.32.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig=="], + + "lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.32.0", "", { "os": "linux", "cpu": "arm" }, "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw=="], + + "lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ=="], + + "lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg=="], + + "lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA=="], + + "lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg=="], + + "lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.32.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw=="], + + "lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.32.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q=="], + + "linkifyjs": ["linkifyjs@4.3.3", "", {}, "sha512-P8aEP5U/D1/IlTY2OeYsErdwh9bGuLE30NcXtKEjgdHcahveQoQwM2yZNsioQHsWFz0P7KKudisbrzCgR0sDHg=="], + + "locate-character": ["locate-character@3.0.0", "", {}, "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA=="], + + "magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], + + "mri": ["mri@1.2.0", "", {}, "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA=="], + + "mrmime": ["mrmime@2.0.1", "", {}, "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ=="], + + "nanoid": ["nanoid@3.3.12", "", { "bin": "bin/nanoid.cjs" }, "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ=="], + + "obug": ["obug@2.1.1", "", {}, "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ=="], + + "orderedmap": ["orderedmap@2.1.1", "", {}, "sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g=="], + + "path-parse": ["path-parse@1.0.7", "", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="], + + "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], + + "picomatch": ["picomatch@4.0.4", "", {}, "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A=="], + + "pocketbase": ["pocketbase@0.26.9", "", {}, "sha512-Tiv1/hNuUzRdvT0d8hF03dfzuefQ1WdSRp1A1q3wzFC/WYhQcbU/Qlaubl/3ZDo6xvFXBS8JAgBS/L+ms7nkVQ=="], + + "postcss": ["postcss@8.5.14", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg=="], + + "prosemirror-changeset": ["prosemirror-changeset@2.4.1", "", { "dependencies": { "prosemirror-transform": "^1.0.0" } }, "sha512-96WBLhOaYhJ+kPhLg3uW359Tz6I/MfcrQfL4EGv4SrcqKEMC1gmoGrXHecPE8eOwTVCJ4IwgfzM8fFad25wNfw=="], + + "prosemirror-commands": ["prosemirror-commands@1.7.1", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.10.2" } }, "sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w=="], + + "prosemirror-dropcursor": ["prosemirror-dropcursor@1.8.2", "", { "dependencies": { "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0", "prosemirror-view": "^1.1.0" } }, "sha512-CCk6Gyx9+Tt2sbYk5NK0nB1ukHi2ryaRgadV/LvyNuO3ena1payM2z6Cg0vO1ebK8cxbzo41ku2DE5Axj1Zuiw=="], + + "prosemirror-gapcursor": ["prosemirror-gapcursor@1.4.1", "", { "dependencies": { "prosemirror-keymap": "^1.0.0", "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", "prosemirror-view": "^1.0.0" } }, "sha512-pMdYaEnjNMSwl11yjEGtgTmLkR08m/Vl+Jj443167p9eB3HVQKhYCc4gmHVDsLPODfZfjr/MmirsdyZziXbQKw=="], + + "prosemirror-history": ["prosemirror-history@1.5.0", "", { "dependencies": { "prosemirror-state": "^1.2.2", "prosemirror-transform": "^1.0.0", "prosemirror-view": "^1.31.0", "rope-sequence": "^1.3.0" } }, "sha512-zlzTiH01eKA55UAf1MEjtssJeHnGxO0j4K4Dpx+gnmX9n+SHNlDqI2oO1Kv1iPN5B1dm5fsljCfqKF9nFL6HRg=="], + + "prosemirror-keymap": ["prosemirror-keymap@1.2.3", "", { "dependencies": { "prosemirror-state": "^1.0.0", "w3c-keyname": "^2.2.0" } }, "sha512-4HucRlpiLd1IPQQXNqeo81BGtkY8Ai5smHhKW9jjPKRc2wQIxksg7Hl1tTI2IfT2B/LgX6bfYvXxEpJl7aKYKw=="], + + "prosemirror-model": ["prosemirror-model@1.25.6", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-RIm+e9BiqAaJ1mRECv3vR3C+VG8ELoTTI+47tVudGi82yLnFOx3G/p/iSPK1HmHQdKhkkrJ68NJqxh7S+FBVmQ=="], + + "prosemirror-schema-list": ["prosemirror-schema-list@1.5.1", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.7.3" } }, "sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q=="], + + "prosemirror-state": ["prosemirror-state@1.4.4", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-transform": "^1.0.0", "prosemirror-view": "^1.27.0" } }, "sha512-6jiYHH2CIGbCfnxdHbXZ12gySFY/fz/ulZE333G6bPqIZ4F+TXo9ifiR86nAHpWnfoNjOb3o5ESi7J8Uz1jXHw=="], + + "prosemirror-tables": ["prosemirror-tables@1.8.5", "", { "dependencies": { "prosemirror-keymap": "^1.2.3", "prosemirror-model": "^1.25.4", "prosemirror-state": "^1.4.4", "prosemirror-transform": "^1.10.5", "prosemirror-view": "^1.41.4" } }, "sha512-V/0cDCsHKHe/tfWkeCmthNUcEp1IVO3p6vwN8XtwE9PZQLAZJigbw3QoraAdfJPir4NKJtNvOB8oYGKRl+t0Dw=="], + + "prosemirror-transform": ["prosemirror-transform@1.12.0", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-GxboyN4AMIsoHNtz5uf2r2Ru551i5hWeCMD6E2Ib4Eogqoub0NflniaBPVQ4MrGE5yZ8JV9tUHg9qcZTTrcN4w=="], + + "prosemirror-view": ["prosemirror-view@1.41.8", "", { "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-TnKDdohEatgyZNGCDWIdccOHXhYloJwbwU+phw/a23KBvJIR9lWQWW7WHHK3vBdOLDNuF7TaX98GObUZOWkOnA=="], + + "react": ["react@19.2.6", "", {}, "sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q=="], + + "react-dom": ["react-dom@19.2.6", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.6" } }, "sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g=="], + + "readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="], + + "resolve": ["resolve@1.22.12", "", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": "bin/resolve" }, "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA=="], + + "rolldown": ["rolldown@1.0.1", "", { "dependencies": { "@oxc-project/types": "=0.130.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.0.1", "@rolldown/binding-darwin-arm64": "1.0.1", "@rolldown/binding-darwin-x64": "1.0.1", "@rolldown/binding-freebsd-x64": "1.0.1", "@rolldown/binding-linux-arm-gnueabihf": "1.0.1", "@rolldown/binding-linux-arm64-gnu": "1.0.1", "@rolldown/binding-linux-arm64-musl": "1.0.1", "@rolldown/binding-linux-ppc64-gnu": "1.0.1", "@rolldown/binding-linux-s390x-gnu": "1.0.1", "@rolldown/binding-linux-x64-gnu": "1.0.1", "@rolldown/binding-linux-x64-musl": "1.0.1", "@rolldown/binding-openharmony-arm64": "1.0.1", "@rolldown/binding-wasm32-wasi": "1.0.1", "@rolldown/binding-win32-arm64-msvc": "1.0.1", "@rolldown/binding-win32-x64-msvc": "1.0.1" }, "bin": "bin/cli.mjs" }, "sha512-X0KQHljNnEkWNqqiz9zJrGunh1B0HgOxLXvnFpCOcadzcy5qohZ3tqMEUg00vncoRovXuK3ZqCT9KnnKzoInFQ=="], + + "rollup": ["rollup@4.60.4", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.60.4", "@rollup/rollup-android-arm64": "4.60.4", "@rollup/rollup-darwin-arm64": "4.60.4", "@rollup/rollup-darwin-x64": "4.60.4", "@rollup/rollup-freebsd-arm64": "4.60.4", "@rollup/rollup-freebsd-x64": "4.60.4", "@rollup/rollup-linux-arm-gnueabihf": "4.60.4", "@rollup/rollup-linux-arm-musleabihf": "4.60.4", "@rollup/rollup-linux-arm64-gnu": "4.60.4", "@rollup/rollup-linux-arm64-musl": "4.60.4", "@rollup/rollup-linux-loong64-gnu": "4.60.4", "@rollup/rollup-linux-loong64-musl": "4.60.4", "@rollup/rollup-linux-ppc64-gnu": "4.60.4", "@rollup/rollup-linux-ppc64-musl": "4.60.4", "@rollup/rollup-linux-riscv64-gnu": "4.60.4", "@rollup/rollup-linux-riscv64-musl": "4.60.4", "@rollup/rollup-linux-s390x-gnu": "4.60.4", "@rollup/rollup-linux-x64-gnu": "4.60.4", "@rollup/rollup-linux-x64-musl": "4.60.4", "@rollup/rollup-openbsd-x64": "4.60.4", "@rollup/rollup-openharmony-arm64": "4.60.4", "@rollup/rollup-win32-arm64-msvc": "4.60.4", "@rollup/rollup-win32-ia32-msvc": "4.60.4", "@rollup/rollup-win32-x64-gnu": "4.60.4", "@rollup/rollup-win32-x64-msvc": "4.60.4", "fsevents": "~2.3.2" }, "bin": "dist/bin/rollup" }, "sha512-WHeFSbZYsPu3+bLoNRUuAO+wavNlocOPf3wSHTP7hcFKVnJeWsYlCDbr3mTS14FCizf9ccIxXA8sGL8zKeQN3g=="], + + "rope-sequence": ["rope-sequence@1.3.4", "", {}, "sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ=="], + + "sade": ["sade@1.8.1", "", { "dependencies": { "mri": "^1.1.0" } }, "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A=="], + + "scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="], + + "set-cookie-parser": ["set-cookie-parser@3.1.0", "", {}, "sha512-kjnC1DXBHcxaOaOXBHBeRtltsDG2nUiUni+jP92M9gYdW12rsmx92UsfpH7o5tDRs7I1ZZPSQJQGv3UaRfCiuw=="], + + "sirv": ["sirv@3.0.2", "", { "dependencies": { "@polka/url": "^1.0.0-next.24", "mrmime": "^2.0.0", "totalist": "^3.0.0" } }, "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g=="], + + "source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], + + "stripe": ["stripe@22.3.2", "", { "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-O13QOvgEIQvDlTy6Ubb5kB980wpbhmoZNsgCXKILjCMZS67f+bW+6w99k3gnSi/N1lkryoj1WYdpGT5Wc5edjg=="], + + "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="], + + "svelte": ["svelte@5.55.7", "", { "dependencies": { "@jridgewell/remapping": "^2.3.4", "@jridgewell/sourcemap-codec": "^1.5.0", "@sveltejs/acorn-typescript": "^1.0.5", "@types/estree": "^1.0.5", "@types/trusted-types": "^2.0.7", "acorn": "^8.12.1", "aria-query": "5.3.1", "axobject-query": "^4.1.0", "clsx": "^2.1.1", "devalue": "^5.8.1", "esm-env": "^1.2.1", "esrap": "^2.2.4", "is-reference": "^3.0.3", "locate-character": "^3.0.0", "magic-string": "^0.30.11", "zimmerframe": "^1.1.2" } }, "sha512-ymI5ykLPwIHW839E053FQbI1G+jnRFJEw3Kv5Y4njixVWywQBx+NUFpkkKyk5LIb36Fg9DVXSYpqiGekLD0hyw=="], + + "svelte-check": ["svelte-check@4.4.8", "", { "dependencies": { "@jridgewell/trace-mapping": "^0.3.25", "chokidar": "^4.0.1", "fdir": "^6.2.0", "picocolors": "^1.0.0", "sade": "^1.7.4" }, "peerDependencies": { "svelte": "^4.0.0 || ^5.0.0-next.0", "typescript": ">=5.0.0" }, "bin": "bin/svelte-check" }, "sha512-67adfgBox5eNSNIvIIwgFizKGdcRrGpiMoNO2obHcYuLz7iTa8Xgm/NGU3ntMFnNm8K1grFOIG6HhMLX/vcN8w=="], + + "svelte-tiptap": ["svelte-tiptap@3.0.1", "", { "peerDependencies": { "@floating-ui/dom": "^1.0.0", "@tiptap/core": "^3.0.0", "@tiptap/extension-bubble-menu": "^3.0.0", "@tiptap/extension-floating-menu": "^3.0.0", "@tiptap/pm": "^3.0.0", "svelte": "^5.0.0" } }, "sha512-Vi3kVGOd01f7mslOxGbJB7z2QavdvH+6WffhB+Y5fleTiZaW0YWqIboyO2u/uh4BQeosiINmmuRJ+Qwb7mYP+A=="], + + "tailwindcss": ["tailwindcss@4.3.0", "", {}, "sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q=="], + + "tapable": ["tapable@2.3.3", "", {}, "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A=="], + + "tinyglobby": ["tinyglobby@0.2.16", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg=="], + + "totalist": ["totalist@3.0.1", "", {}, "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ=="], + + "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + + "typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="], + + "undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="], + + "uuid": ["uuid@14.0.0", "", { "bin": "dist-node/bin/uuid" }, "sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg=="], + + "vite": ["vite@8.0.13", "", { "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", "postcss": "^8.5.14", "rolldown": "1.0.1", "tinyglobby": "^0.2.16" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.1.18", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@vitejs/devtools", "esbuild", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": "bin/vite.js" }, "sha512-MFtjBYgzmSxmgA4RAfjIyXWpGe1oALnjgUTzzV7QLx/TKxCzjtMH6Fd9/eVK+5Fg1qNoz5VAwsmMs/NofrmJvw=="], + + "vitefu": ["vitefu@1.1.3", "", { "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg=="], + + "w3c-keyname": ["w3c-keyname@2.2.8", "", {}, "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ=="], + + "zimmerframe": ["zimmerframe@1.1.4", "", {}, "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ=="], + + "@rollup/plugin-commonjs/is-reference": ["is-reference@1.2.1", "", { "dependencies": { "@types/estree": "*" } }, "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ=="], + + "rollup/@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], + } +} diff --git a/app/package-lock.json b/app/package-lock.json index eac7a1d..7f0587a 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -11,6 +11,7 @@ "@dnd-kit/core": "^6.3.1", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", + "@stripe/stripe-js": "^9.12.1", "@sveltejs/adapter-node": "^5.5.4", "@tailwindcss/vite": "^4.3.0", "@tiptap/core": "^3.23.4", @@ -19,6 +20,7 @@ "@tiptap/starter-kit": "^3.23.4", "daisyui": "^5.5.19", "pocketbase": "^0.26.9", + "stripe": "^22.3.2", "svelte-tiptap": "^3.0.1", "tailwindcss": "^4.3.0", "uuid": "^14.0.0" @@ -896,6 +898,15 @@ "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", "license": "MIT" }, + "node_modules/@stripe/stripe-js": { + "version": "9.12.1", + "resolved": "https://registry.npmjs.org/@stripe/stripe-js/-/stripe-js-9.12.1.tgz", + "integrity": "sha512-KLXPvjA0BfS4dQnW+ddHjwtIXMnIfKYxqmeNMmQCfKjvYog0cSG+Z7ZvK4RH1+bV90GC07nUztWDRWmJLi5HZQ==", + "license": "MIT", + "engines": { + "node": ">=12.16" + } + }, "node_modules/@sveltejs/acorn-typescript": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.9.tgz", @@ -2678,6 +2689,23 @@ "node": ">=0.10.0" } }, + "node_modules/stripe": { + "version": "22.3.2", + "resolved": "https://registry.npmjs.org/stripe/-/stripe-22.3.2.tgz", + "integrity": "sha512-O13QOvgEIQvDlTy6Ubb5kB980wpbhmoZNsgCXKILjCMZS67f+bW+6w99k3gnSi/N1lkryoj1WYdpGT5Wc5edjg==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", diff --git a/app/package.json b/app/package.json index 52be1d5..d181312 100644 --- a/app/package.json +++ b/app/package.json @@ -26,6 +26,7 @@ "@dnd-kit/core": "^6.3.1", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", + "@stripe/stripe-js": "^9.12.1", "@sveltejs/adapter-node": "^5.5.4", "@tailwindcss/vite": "^4.3.0", "@tiptap/core": "^3.23.4", @@ -34,6 +35,7 @@ "@tiptap/starter-kit": "^3.23.4", "daisyui": "^5.5.19", "pocketbase": "^0.26.9", + "stripe": "^22.3.2", "svelte-tiptap": "^3.0.1", "tailwindcss": "^4.3.0", "uuid": "^14.0.0" diff --git a/app/src/lib/admin/blockDefaults.ts b/app/src/lib/admin/blockDefaults.ts index 007ae9d..28fcf95 100644 --- a/app/src/lib/admin/blockDefaults.ts +++ b/app/src/lib/admin/blockDefaults.ts @@ -9,7 +9,9 @@ export const blockLabels: Record = { button: 'Button', spacer: 'Spacer', testimonials: 'Testimonials', - upcoming_calendar: 'Upcoming Calendar' + upcoming_calendar: 'Upcoming Calendar', + shop: 'Shop', + checkout: 'Checkout' }; export const blockTypes = Object.keys(blockLabels) as BlockType[]; @@ -63,6 +65,21 @@ export function createBlock(type: BlockType): ContentBlock { categories: [] }; break; + case 'shop': + base.data = { + title: 'Our Services', + itemTypeFilter: 'all', + itemIds: [], + layout: 'grid' + }; + break; + case 'checkout': + base.data = { + title: 'Checkout', + heading: 'Complete your booking', + notesLabel: 'Notes or special requests' + }; + break; } base.data._background = { type: 'none', color: '', attachment: 'scroll', overlay: false, overlayOpacity: 40 }; return base; diff --git a/app/src/lib/admin/editors/BlockEditor.svelte b/app/src/lib/admin/editors/BlockEditor.svelte index 09457cd..ff3012a 100644 --- a/app/src/lib/admin/editors/BlockEditor.svelte +++ b/app/src/lib/admin/editors/BlockEditor.svelte @@ -4,10 +4,13 @@ import RichTextEditor from './RichTextEditor.svelte'; import ImageUploader from './ImageUploader.svelte'; import SegmentedControl from './SegmentedControl.svelte'; + import ShopBlockEditor from './ShopBlockEditor.svelte'; + import CheckoutBlockEditor from './CheckoutBlockEditor.svelte'; - let { block, eventCategories = [], onChange = (block: ContentBlock) => {} } = $props<{ + let { block, eventCategories = [], items = [], onChange = (block: ContentBlock) => {} } = $props<{ block: ContentBlock | null; eventCategories?: string[]; + items?: { id: string; name: string; type: string }[]; onChange?: (block: ContentBlock) => void; }>(); @@ -200,6 +203,10 @@ {/if} + {:else if block.type === 'shop'} + + {:else if block.type === 'checkout'} + {/if}
diff --git a/app/src/lib/admin/editors/CheckoutBlockEditor.svelte b/app/src/lib/admin/editors/CheckoutBlockEditor.svelte new file mode 100644 index 0000000..5ecd756 --- /dev/null +++ b/app/src/lib/admin/editors/CheckoutBlockEditor.svelte @@ -0,0 +1,31 @@ + + +
+ + + +

Customer fields (name, email, phone, notes) and the payment flow are fixed and cannot be changed here.

+
diff --git a/app/src/lib/admin/editors/ShopBlockEditor.svelte b/app/src/lib/admin/editors/ShopBlockEditor.svelte new file mode 100644 index 0000000..9abfcfb --- /dev/null +++ b/app/src/lib/admin/editors/ShopBlockEditor.svelte @@ -0,0 +1,79 @@ + + +
+ + + updateData({ layout: v as 'grid' | 'list' })} + formatLabel={(v) => String(v).charAt(0).toUpperCase() + String(v).slice(1)} + /> + + updateData({ itemTypeFilter: v as ShopBlockData['itemTypeFilter'] })} + formatLabel={(v) => typeFilterLabels[String(v)] || String(v)} + /> + + {#if items.length} +
+
+

Items

+

Leave empty to show all items of the selected type.

+
+
+ {#each items as item} + + {/each} +
+
+ {:else} +

No items yet — create some under Items in the admin.

+ {/if} +
diff --git a/app/src/lib/basket.svelte.ts b/app/src/lib/basket.svelte.ts new file mode 100644 index 0000000..90b4cd5 --- /dev/null +++ b/app/src/lib/basket.svelte.ts @@ -0,0 +1,94 @@ +import { getContext, setContext } from 'svelte'; +import type { Basket, BasketLine } from '$lib/types'; + +const BASKET_KEY = 'basket'; + +export type BasketStore = ReturnType; + +export function createBasketStore(initial: Basket | null) { + let lines = $state(initial?.lines ?? []); + let status = $state(initial?.status ?? 'active'); + + const total = $derived( + lines.reduce((sum, line) => sum + (line.itemPrice ?? 0) * line.quantity, 0) + ); + const count = $derived(lines.reduce((sum, line) => sum + line.quantity, 0)); + + async function callApi(body: Record): Promise { + const res = await fetch('/api/basket', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(body) + }); + if (!res.ok) { + const err = await res.json().catch(() => ({})); + throw new Error(err?.message || `Basket request failed (${res.status})`); + } + const data = await res.json(); + return data.basket as Basket | null; + } + + function applyBasket(basket: Basket | null) { + lines = basket?.lines ?? []; + status = basket?.status ?? 'active'; + } + + async function refresh() { + const res = await fetch('/api/basket'); + if (!res.ok) return; + const data = await res.json(); + applyBasket(data.basket); + } + + /** Overwrite local state from server-provided layout data. */ + function syncFrom(basket: Basket | null) { + applyBasket(basket); + } + + async function addItemLine(itemId: string, quantity = 1) { + applyBasket(await callApi({ action: 'add_item', itemId, quantity })); + } + + async function addSlotLine(slotId: string) { + applyBasket(await callApi({ action: 'add_slot', slotId })); + } + + async function updateQuantity(lineId: string, quantity: number) { + applyBasket(await callApi({ action: 'update_quantity', lineId, quantity })); + } + + async function removeLine(lineId: string) { + applyBasket(await callApi({ action: 'remove_line', lineId })); + } + + return { + get lines() { + return lines; + }, + get total() { + return total; + }, + get count() { + return count; + }, + get status() { + return status; + }, + refresh, + syncFrom, + addItemLine, + addSlotLine, + updateQuantity, + removeLine + }; +} + +export function setBasketContext(store: BasketStore) { + setContext(BASKET_KEY, store); +} + +export function getBasketContext(): BasketStore { + const store = getContext(BASKET_KEY); + if (!store) throw new Error('Basket store not found in context — is this component inside the public layout?'); + return store; +} diff --git a/app/src/lib/blocks/BlockRenderer.svelte b/app/src/lib/blocks/BlockRenderer.svelte index bd80f73..9af2fd8 100644 --- a/app/src/lib/blocks/BlockRenderer.svelte +++ b/app/src/lib/blocks/BlockRenderer.svelte @@ -1,5 +1,5 @@ + +
+ {#if data.title} +

{data.title}

+ {/if} + {#if data.heading} +

{data.heading}

+ {/if} + + {#if basket.lines.length === 0} +
+

Your basket is empty

+

Pick a service or product above.

+
+ {:else} + +
    + {#each basket.lines as line (line.id)} + {@const pending = pendingLines.has(line.id)} +
  • + {#if line.itemImageUrl} + {line.itemName + {:else} +
    + {(line.itemName ?? '?').charAt(0).toUpperCase()} +
    + {/if} + +
    +

    {line.itemName ?? 'Item'}

    + {#if line.lineType === 'slot' && line.slotStart} +

    {formatSlotTime(line.slotStart)}

    + {/if} +

    {currency.format(line.itemPrice ?? 0)}

    +
    + + {#if line.lineType === 'item'} +
    + + {line.quantity} + +
    + {/if} + +

    + {currency.format((line.itemPrice ?? 0) * line.quantity)} +

    + + +
  • + {/each} +
+ + +
+
+ Subtotal + {currency.format(basket.total)} +
+
+ +
+ +
{ + e.preventDefault(); + startPayment(); + }} + > +

Your details

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + {#if payState === 'idle' || payState === 'creating'} + + {/if} +
+ + +
+

Payment

+ + {#if errorMsg} + + {/if} + + {#if basketChanged} +

+ Basket changed — please press Pay again. +

+ {/if} + + + + {#if payState === 'ready' || payState === 'confirming'} + + {/if} + + {#if payState === 'idle' && !errorMsg} +

+ Fill in your details and press Pay to continue to secure payment. +

+ {/if} +
+
+ {/if} +
diff --git a/app/src/lib/blocks/ShopBlock.svelte b/app/src/lib/blocks/ShopBlock.svelte new file mode 100644 index 0000000..2f2795e --- /dev/null +++ b/app/src/lib/blocks/ShopBlock.svelte @@ -0,0 +1,313 @@ + + +
+ {#if data.title} +

{data.title}

+ {/if} + +
+ {#each visibleItems as item (item.id)} + {@const ui = cardStates[item.id]} + {@const itemSlotsByDay = slotsByDay.get(item.id)} + {@const isService = item.type === 'item_with_time'} + {@const soldOut = !isService && item.stock === 0} + {@const itemInBasket = !isService && basket.lines.some((l) => l.item === item.id)} +
+ {#if item.imageUrl} + {item.name} + {:else} + + {/if} + +
+

{item.name}

+ {#if item.description} +

{item.description}

+ {/if} + +
+ {priceFormatter.format(item.price)} + {#if isService && item.duration != null} + {item.duration} min + {:else if !isService && item.stock != null && item.stock > 0 && item.stock <= 5} + + Only {item.stock} left + + {:else if soldOut} + + Sold out + + {/if} +
+ + {#if ui?.errorMsg} + + {/if} + +
+ {#if isService} + + {:else} + + {#if itemInBasket} + ✓ In basket + {/if} + {/if} +
+
+ + {#if isService && ui?.pickerOpen && itemSlotsByDay} +
+

Select a date

+
+ {#each months as month (month.label)} +
+

{month.label}

+
+ {#each weekdayLetters as letter, i (i)} + {letter} + {/each} + {#each month.days as day (day.dateKey)} + {@const selectable = day.inMonth && itemSlotsByDay.has(day.dateKey)} + {@const selected = selectable && ui.selectedDayKey === day.dateKey} + + {/each} +
+
+ {/each} +
+ + {#if ui.selectedDayKey} + {@const daySlots = itemSlotsByDay.get(ui.selectedDayKey) ?? []} +

Available times

+
+ {#each daySlots as slot (slot.id)} + {@const slotInBasket = basket.lines.some((l) => l.slot === slot.id)} + + {/each} +
+ {:else} +

+ Days with availability are highlighted{item.duration != null ? ` · ${item.duration} min per session` : ''}. +

+ {/if} + + {#if ui.justAdded} +

+ Added ✓ — view basket +

+ {/if} +
+ {/if} +
+ {/each} +
+
diff --git a/app/src/lib/components/Header.svelte b/app/src/lib/components/Header.svelte index 5f8caaa..d83c16d 100644 --- a/app/src/lib/components/Header.svelte +++ b/app/src/lib/components/Header.svelte @@ -1,6 +1,15 @@
@@ -20,8 +29,23 @@ {/each} - {#if header.ctaButton?.label} - {header.ctaButton.label} - {/if} +
+ {#if hasItems} + + + + + {basket.count} + + + {/if} + {#if header.ctaButton?.label} + {header.ctaButton.label} + {/if} +
diff --git a/app/src/lib/server/basket.ts b/app/src/lib/server/basket.ts new file mode 100644 index 0000000..cf2f105 --- /dev/null +++ b/app/src/lib/server/basket.ts @@ -0,0 +1,187 @@ +import type PocketBase from 'pocketbase'; +import type { Basket, BasketLine } from '$lib/types'; +import { getFileUrl } from '$lib/pb'; + +export const BASKET_COOKIE = 'basket_id'; +/** Basket lifetime — refreshed on every basket API call. */ +export const BASKET_TTL_MS = 24 * 60 * 60 * 1000; // 24h +/** How long a slot stays held once added to a basket / after a failed payment. */ +export const SLOT_HOLD_MS = 10 * 60 * 1000; // 10 min +/** Hold extended to this once a payment is in progress, so the slot survives + * the customer entering card details / retrying a declined card. */ +export const SLOT_CHECKOUT_HOLD_MS = 30 * 60 * 1000; // 30 min + +function now() { + return new Date(); +} + +function iso(date: Date) { + return date.toISOString(); +} + +/** + * Release any slots whose hold has expired, removing their basket lines + * and flipping them back to `available`. Also marks expired active + * baskets as `abandoned`. Runs lazily on basket reads / checkout. + * + * The expiry check is done in JS (parsing `heldUntil` as a UTC date) rather + * than via a PocketBase date-string filter, so a slot is never released + * *before* its hold genuinely lapses — regardless of how PocketBase stores / + * compares the date field. A slot is held for the full SLOT_HOLD_MS (or + * SLOT_CHECKOUT_HOLD_MS during payment). + */ +export async function sweepExpiredHolds(pb: PocketBase) { + const nowMs = Date.now(); + + // 1. Release expired slot holds (and drop the lines holding them) + const heldSlots = await pb + .collection('slots') + .getFullList({ filter: `status = 'held'` }) + .catch(() => []); + for (const slot of heldSlots) { + const heldUntilMs = slot.heldUntil ? Date.parse(slot.heldUntil) : NaN; + // Still valid, or no parseable hold to judge by — leave it alone. + if (Number.isNaN(heldUntilMs) || heldUntilMs > nowMs) continue; + + const lines = await pb + .collection('basket_lines') + .getFullList({ filter: `slot = "${slot.id}"` }) + .catch(() => []); + for (const line of lines) { + await pb.collection('basket_lines').delete(line.id).catch(() => {}); + } + await pb + .collection('slots') + .update(slot.id, { status: 'available', heldUntil: null }) + .catch(() => {}); + } + + // 2. Abandon expired active baskets (their slot holds were already + // covered by heldUntil above — same 10-min window < 24h basket TTL) + const nowIso = iso(now()); + await pb + .collection('baskets') + .getFullList({ filter: `status = 'active' && expiresAt < "${nowIso}"` }) + .then(async (expired) => { + for (const basket of expired) { + await pb.collection('baskets').update(basket.id, { status: 'abandoned' }).catch(() => {}); + } + }) + .catch(() => {}); +} + +/** Map raw PB records (with expand) to our Basket type. */ +function mapBasket(record: Record, lines: Record[]): Basket { + const mappedLines: BasketLine[] = lines.map((line) => { + const item = line.expand?.item; + const slot = line.expand?.slot; + const media = item?.expand?.image; + return { + id: line.id, + basket: line.basket, + item: line.item, + slot: line.slot || null, + quantity: line.quantity, + lineType: line.lineType, + itemName: item?.name, + itemPrice: item?.price, + itemImageUrl: media ? getFileUrl('media', media.id, media.file) : undefined, + slotStart: slot?.start, + slotEnd: slot?.end + }; + }); + return { + id: record.id, + status: record.status, + expiresAt: record.expiresAt, + email: record.email || null, + customerDetails: record.customerDetails || null, + stripePaymentIntentId: record.stripePaymentIntentId || null, + lines: mappedLines + }; +} + +/** Load a basket + its lines (with item/slot expand) by basket id. */ +export async function loadBasket(pb: PocketBase, basketId: string): Promise { + try { + const record = await pb.collection('baskets').getOne(basketId); + if (record.status !== 'active') return null; + const lines = await pb + .collection('basket_lines') + .getFullList({ filter: `basket = "${basketId}"`, expand: 'item,slot,item.image' }); + return mapBasket(record, lines); + } catch { + return null; + } +} + +/** Create a fresh active basket. */ +export async function createBasket(pb: PocketBase): Promise { + const record = await pb.collection('baskets').create({ + status: 'active', + expiresAt: iso(new Date(Date.now() + BASKET_TTL_MS)) + }); + return { + id: record.id, + status: 'active', + expiresAt: record.expiresAt, + email: null, + customerDetails: null, + stripePaymentIntentId: null, + lines: [] + }; +} + +/** Touch the basket expiry (rolling TTL). */ +export async function touchBasket(pb: PocketBase, basketId: string) { + await pb + .collection('baskets') + .update(basketId, { expiresAt: iso(new Date(Date.now() + BASKET_TTL_MS)) }) + .catch(() => {}); +} + +/** Release a slot hold for a basket line (slot back to available). */ +export async function releaseLineHold(pb: PocketBase, line: { slot?: string | null }) { + if (!line.slot) return; + await pb + .collection('slots') + .update(line.slot, { status: 'available', heldUntil: null }) + .catch(() => {}); +} + +/** + * Re-reserve (extend) the hold on every slot line in a basket, as long as + * the slot is still in `held` status. Used: + * - at checkout start (create-intent) with SLOT_CHECKOUT_HOLD_MS, so a + * service survives the customer entering card details / retrying a + * declined card; + * - after a failed payment (webhook) with SLOT_HOLD_MS, so the customer + * can retry within a fresh 10-minute window. + * The slot is genuinely still the customer's (nobody else could grab it + * while `held`), so renewing is safe. Slots whose status is no longer + * `held` (e.g. released and re-booked by someone else) are returned so the + * caller can inform the user. + */ +export async function extendBasketHolds( + pb: PocketBase, + basketId: string, + durationMs = SLOT_HOLD_MS +): Promise { + const unheld: string[] = []; + const lines = await pb + .collection('basket_lines') + .getFullList({ filter: `basket = "${basketId}" && lineType = "slot"` }) + .catch(() => []); + const until = iso(new Date(Date.now() + durationMs)); + for (const line of lines) { + const slotId = line.slot; + if (!slotId) continue; + const slot = await pb.collection('slots').getOne(slotId).catch(() => null); + if (slot && slot.status === 'held') { + await pb.collection('slots').update(slotId, { heldUntil: until }).catch(() => {}); + } else { + unheld.push(line.id); + } + } + return unheld; +} diff --git a/app/src/lib/server/pb-admin.ts b/app/src/lib/server/pb-admin.ts new file mode 100644 index 0000000..fa6646b --- /dev/null +++ b/app/src/lib/server/pb-admin.ts @@ -0,0 +1,53 @@ +import PocketBase, { ClientResponseError } from 'pocketbase'; +import { env } from '$env/dynamic/private'; + +let adminPb: PocketBase | null = null; +let authPromise: Promise | null = null; + +async function authenticate(): Promise { + const url = env.POCKETBASE_INTERNAL_URL || env.PUBLIC_POCKETBASE_URL || 'http://localhost:8080'; + const pb = new PocketBase(url); + pb.autoCancellation(false); + + const email = env.POCKETBASE_ADMIN_EMAIL; + const password = env.POCKETBASE_ADMIN_PASSWORD; + if (!email || !password) throw new Error('POCKETBASE_ADMIN_EMAIL and POCKETBASE_ADMIN_PASSWORD must be set'); + + await pb.collection('_superusers').authWithPassword(email, password); + adminPb = pb; + return pb; +} + +/** + * Server-only PocketBase client authenticated as admin. + * Used by basket/checkout/webhook API routes that need to bypass + * collection-level API rules (create baskets, hold slots, create orders). + * + * Concurrent callers share one in-flight auth attempt; if the cached token + * has since been invalidated (401 on first use), we re-authenticate once. + */ +export async function getAdminPb(): Promise { + if (adminPb?.authStore.isValid) return adminPb; + authPromise ??= authenticate().finally(() => { + authPromise = null; + }); + return authPromise; +} + +/** + * Run `fn` with the admin client; on a 401 (stale/invalidated token), + * re-authenticate and retry exactly once. + */ +export async function withAdminPb(fn: (pb: PocketBase) => Promise): Promise { + const pb = await getAdminPb(); + try { + return await fn(pb); + } catch (e) { + if (e instanceof ClientResponseError && e.status === 401) { + pb.authStore.clear(); + adminPb = null; + return fn(await getAdminPb()); + } + throw e; + } +} diff --git a/app/src/lib/stripe-client.ts b/app/src/lib/stripe-client.ts new file mode 100644 index 0000000..b7cd2ed --- /dev/null +++ b/app/src/lib/stripe-client.ts @@ -0,0 +1,15 @@ +import { loadStripe as _loadStripe } from '@stripe/stripe-js'; +import { env } from '$env/dynamic/public'; +import { browser } from '$app/environment'; + +let stripePromise: ReturnType | null = null; + +export function loadStripe() { + if (!browser) return null; + if (!stripePromise) { + const key = env.PUBLIC_STRIPE_PUBLISHABLE_KEY; + if (!key) throw new Error('PUBLIC_STRIPE_PUBLISHABLE_KEY is not set'); + stripePromise = _loadStripe(key); + } + return stripePromise; +} diff --git a/app/src/lib/stripe.server.ts b/app/src/lib/stripe.server.ts new file mode 100644 index 0000000..daf707a --- /dev/null +++ b/app/src/lib/stripe.server.ts @@ -0,0 +1,17 @@ +import Stripe from 'stripe'; +import { env } from '$env/dynamic/private'; + +let stripe: Stripe | null = null; + +export function getStripe(): Stripe { + if (!stripe) { + const key = env.STRIPE_SECRET_KEY; + if (!key) throw new Error('STRIPE_SECRET_KEY is not set'); + stripe = new Stripe(key); + } + return stripe; +} + +export function getCurrency(): string { + return env.STRIPE_CURRENCY || 'eur'; +} diff --git a/app/src/lib/types.ts b/app/src/lib/types.ts index efe9dc9..b394b38 100644 --- a/app/src/lib/types.ts +++ b/app/src/lib/types.ts @@ -6,7 +6,9 @@ export type BlockType = | 'button' | 'spacer' | 'testimonials' - | 'upcoming_calendar'; + | 'upcoming_calendar' + | 'shop' + | 'checkout'; export type BlockBackground = { type: 'none' | 'color' | 'image'; @@ -94,6 +96,109 @@ export const defaultFooter: FooterGlobal = { copyrightText: `© ${new Date().getFullYear()} Eva Shafik Massage. All rights reserved.` }; +// ── Commerce types ───────────────────────────────────────────────────── + +export type ItemType = 'item' | 'item_with_time'; + +export type ItemRecord = { + id: string; + name: string; + description: string; + price: number; + image: string; // media record id + imageUrl: string; // resolved URL (populated by server load) + type: ItemType; + stock: number | null; + duration: number | null; // minutes, for item_with_time + active: boolean; +}; + +export type SlotStatus = 'available' | 'held' | 'booked'; + +export type SlotRecord = { + id: string; + item: string; // item id + start: string; + end: string; + status: SlotStatus; + heldUntil: string | null; + order: string | null; + notes: string; +}; + +export type BasketStatus = 'active' | 'completed' | 'abandoned'; + +export type BasketLine = { + id: string; + basket: string; + item: string; + slot: string | null; + quantity: number; + lineType: 'item' | 'slot'; + // Expanded fields (populated server-side) + itemName?: string; + itemPrice?: number; + itemImageUrl?: string; + slotStart?: string; + slotEnd?: string; +}; + +export type Basket = { + id: string; + status: BasketStatus; + expiresAt: string; + email: string | null; + customerDetails: CustomerDetails | null; + stripePaymentIntentId: string | null; + lines: BasketLine[]; +}; + +export type CustomerDetails = { + name: string; + email: string; + phone: string; + notes: string; +}; + +export type OrderRecord = { + id: string; + basket: string; + email: string; + customerDetails: CustomerDetails; + total: number; + status: 'pending' | 'paid' | 'refunded'; + stripePaymentIntentId: string; + createdAt: string; + lines?: OrderLine[]; +}; + +export type OrderLine = { + id: string; + order: string; + item: string; + slot: string | null; + quantity: number; + lineType: 'item' | 'slot'; + name: string; + price: number; + start: string | null; +}; + +// ── Block data types ────────────────────────────────────────────────── + +export type ShopBlockData = { + title?: string; + itemTypeFilter?: 'all' | ItemType; + itemIds?: string[]; + layout?: 'grid' | 'list'; +}; + +export type CheckoutBlockData = { + title?: string; + heading?: string; + notesLabel?: string; +}; + export type ColorsGlobal = { background: string; heading: string; diff --git a/app/src/routes/+layout.server.ts b/app/src/routes/+layout.server.ts index 4bf3f43..cdc869a 100644 --- a/app/src/routes/+layout.server.ts +++ b/app/src/routes/+layout.server.ts @@ -1,4 +1,8 @@ import { defaultColors, defaultFooter, defaultHeader } from '$lib/types'; +import type { ItemRecord, SlotRecord } from '$lib/types'; +import { getFileUrl } from '$lib/pb'; +import { getAdminPb } from '$lib/server/pb-admin'; +import { BASKET_COOKIE, loadBasket, sweepExpiredHolds } from '$lib/server/basket'; import type { LayoutServerLoad } from './$types'; async function getGlobal(pb: App.Locals['pb'], key: string, fallback: unknown) { @@ -10,7 +14,9 @@ async function getGlobal(pb: App.Locals['pb'], key: string, fallback: unknown) { } } -export const load: LayoutServerLoad = async ({ locals, url }) => { +export const load: LayoutServerLoad = async ({ locals, cookies, url }) => { + const isAdmin = url.pathname.startsWith('/admin'); + const [header, footer, colors] = await Promise.all([ getGlobal(locals.pb, 'header', defaultHeader), getGlobal(locals.pb, 'footer', defaultFooter), @@ -19,5 +25,59 @@ export const load: LayoutServerLoad = async ({ locals, url }) => { if (!header.homePage) header.homePage = defaultHeader.homePage; - return { header, footer, colors, user: locals.user, url: { pathname: url.pathname } }; + // Commerce data is only needed on public pages. + let basket = null; + let items: ItemRecord[] = []; + let slots: SlotRecord[] = []; + + if (!isAdmin) { + try { + const pb = await getAdminPb(); + await sweepExpiredHolds(pb); + + const basketId = cookies.get(BASKET_COOKIE); + if (basketId) basket = await loadBasket(pb, basketId); + + const itemRecords = await pb + .collection('items') + .getFullList({ filter: 'active = true', sort: 'name', expand: 'image' }) + .catch(() => []); + items = itemRecords.map((record) => { + const media = record.expand?.image; + return { + id: record.id, + name: record.name, + description: record.description || '', + price: record.price, + image: record.image || '', + imageUrl: media ? getFileUrl('media', media.id, media.file) : '', + type: record.type, + stock: record.stock ?? null, + duration: record.duration ?? null, + active: record.active + }; + }); + + const nowIso = new Date().toISOString(); + const slotRecords = await pb + .collection('slots') + .getFullList({ filter: `status = 'available' && start >= "${nowIso}"`, sort: 'start' }) + .catch(() => []); + slots = slotRecords.map((record) => ({ + id: record.id, + item: record.item, + start: record.start, + end: record.end || '', + status: record.status, + heldUntil: record.heldUntil || null, + order: record.order || null, + notes: record.notes || '' + })); + } catch (e) { + // Admin PB not configured (e.g. fresh dev env) — commerce features off. + console.warn('Commerce data unavailable:', e instanceof Error ? e.message : e); + } + } + + return { header, footer, colors, user: locals.user, url: { pathname: url.pathname }, basket, items, slots }; }; diff --git a/app/src/routes/+layout.svelte b/app/src/routes/+layout.svelte index 75a35b0..bc2ca8b 100644 --- a/app/src/routes/+layout.svelte +++ b/app/src/routes/+layout.svelte @@ -3,11 +3,21 @@ import favicon from '$lib/assets/favicon.svg'; import Header from '$lib/components/Header.svelte'; import Footer from '$lib/components/Footer.svelte'; + import { createBasketStore, setBasketContext } from '$lib/basket.svelte'; import { onMount } from 'svelte'; let { children, data } = $props(); let isAdmin = $derived(data.url?.pathname?.startsWith('/admin')); + // One basket store per public layout instance — provided to all children + // (Header indicator, ShopBlock, CheckoutBlock). Never module-level state. + const basketStore = createBasketStore(data.basket ?? null); + setBasketContext(basketStore); + + // Keep the store in sync when layout data refreshes (e.g. after checkout + // clears the cookie and data.basket becomes null). + $effect(() => basketStore.syncFrom(data.basket ?? null)); + onMount(() => { if (data.colors && !isAdmin) { const root = document.documentElement; diff --git a/app/src/routes/+page.svelte b/app/src/routes/+page.svelte index 4a533f1..b7a76e1 100644 --- a/app/src/routes/+page.svelte +++ b/app/src/routes/+page.svelte @@ -8,4 +8,4 @@ {data.page.title} - + diff --git a/app/src/routes/[slug]/+page.svelte b/app/src/routes/[slug]/+page.svelte index 573030a..d473cdd 100644 --- a/app/src/routes/[slug]/+page.svelte +++ b/app/src/routes/[slug]/+page.svelte @@ -7,4 +7,4 @@ {data.page.title} - + diff --git a/app/src/routes/admin/+layout.svelte b/app/src/routes/admin/+layout.svelte index 2c94769..3db3d16 100644 --- a/app/src/routes/admin/+layout.svelte +++ b/app/src/routes/admin/+layout.svelte @@ -59,6 +59,9 @@
Pages Calendar + Items + Slots + Orders Globals + + {#if form?.message}
{form.message}
{/if} + +
+
+ + + + {#each items as item} + + + + + + + + + + {/each} + +
NameTypePriceStockDurationStatus
+
+ {#if item.imageUrl} + + {/if} + {item.name} +
+
{item.type === 'item_with_time' ? 'Service' : 'Product'}{eur.format(item.price)}{item.type === 'item' ? (item.stock ?? '—') : '—'}{item.type === 'item_with_time' ? `${item.duration ?? 0} min` : '—'}{item.active ? 'Active' : 'Inactive'}
+
+
+
+ +{#if showEditor} +
+
+
+

{draft.id ? 'Edit item' : 'Create item'}

+ +
+ +
+ + + + + + + +
+ + +
+ + {#if draft.type === 'item'} + + {:else} + + {/if} + +
+
Image
+
+ {#if draft.imageUrl} + + {/if} +
+ + +

+ {uploading ? 'Uploading…' : 'Upload a file or paste a media record id. A media picker will replace this in a later iteration.'} +

+
+
+
+ + + +
+ {#if draft.id} + + {:else} + + {/if} +
+ + +
+
+
+
+
+{/if} diff --git a/app/src/routes/admin/orders/+page.server.ts b/app/src/routes/admin/orders/+page.server.ts new file mode 100644 index 0000000..97607eb --- /dev/null +++ b/app/src/routes/admin/orders/+page.server.ts @@ -0,0 +1,34 @@ +import type { PageServerLoad } from './$types'; + +export const load: PageServerLoad = async ({ locals }) => { + // Sort by id, not 'created' — commerce collections were imported without + // autodate fields. PocketBase ids are time-sortable ULIDs. + const records = await locals.pb.collection('orders').getFullList({ sort: '-id' }).catch(() => []); + + const orders = []; + for (const record of records) { + const lineRecords = await locals.pb + .collection('order_lines') + .getFullList({ filter: `order = "${record.id}"` }) + .catch(() => []); + + orders.push({ + id: record.id, + email: String(record.email || ''), + customerDetails: record.customerDetails || {}, + total: Number(record.total) || 0, + status: String(record.status || 'pending'), + created: String(record.created || ''), + lines: lineRecords.map((line) => ({ + id: line.id, + name: String(line.name || ''), + price: Number(line.price) || 0, + quantity: Number(line.quantity) || 1, + lineType: String(line.lineType || 'item'), + start: line.start ? String(line.start) : '' + })) + }); + } + + return { orders }; +}; diff --git a/app/src/routes/admin/orders/+page.svelte b/app/src/routes/admin/orders/+page.svelte new file mode 100644 index 0000000..f5dc5f7 --- /dev/null +++ b/app/src/routes/admin/orders/+page.svelte @@ -0,0 +1,58 @@ + + +Orders | CMS + +
+
+

Orders

+

Confirmed bookings and purchases.

+
+ + {#if orders.length === 0} +
No orders yet.
+ {/if} + + {#each orders as order} +
+
+
+

{order.customerDetails?.name || order.email || 'Order'}

+

+ {order.email} + {#if order.customerDetails?.phone} · {order.customerDetails.phone}{/if} + {#if order.created} · {new Date(order.created).toLocaleString()}{/if} +

+
+
+ {order.status} + {eur.format(order.total)} +
+
+ +
    + {#each order.lines as line} +
  • + {line.quantity}× {line.name} — {eur.format(line.price)} + {#if line.lineType === 'slot' && line.start} + {new Date(line.start).toLocaleString()} + {/if} +
  • + {/each} +
+ + {#if order.customerDetails?.notes} +

"{order.customerDetails.notes}"

+ {/if} +
+ {/each} +
diff --git a/app/src/routes/admin/pages/[slug]/+page.server.ts b/app/src/routes/admin/pages/[slug]/+page.server.ts index 8cac9c9..5648aa7 100644 --- a/app/src/routes/admin/pages/[slug]/+page.server.ts +++ b/app/src/routes/admin/pages/[slug]/+page.server.ts @@ -6,7 +6,12 @@ export const load: PageServerLoad = async ({ params, locals }) => { const page = await locals.pb.collection('pages').getFirstListItem(`slug = "${params.slug}"`); const events = await locals.pb.collection('events').getFullList({ sort: 'start' }).catch(() => []); const eventCategories = extractCategories(events.map((event) => normalizeEvent(event))); - return { page, eventCategories }; + const items = await locals.pb + .collection('items') + .getFullList({ sort: 'name' }) + .then((records) => records.map(({ id, name, type }) => ({ id, name, type }))) + .catch(() => []); + return { page, eventCategories, items }; }; export const actions: Actions = { diff --git a/app/src/routes/admin/pages/[slug]/+page.svelte b/app/src/routes/admin/pages/[slug]/+page.svelte index 548a08a..d7dc228 100644 --- a/app/src/routes/admin/pages/[slug]/+page.svelte +++ b/app/src/routes/admin/pages/[slug]/+page.svelte @@ -87,7 +87,7 @@ (selectedId = id)} onDelete={deleteBlock} onMove={moveBlock} /> - + diff --git a/app/src/routes/admin/slots/+page.server.ts b/app/src/routes/admin/slots/+page.server.ts new file mode 100644 index 0000000..ee3e90c --- /dev/null +++ b/app/src/routes/admin/slots/+page.server.ts @@ -0,0 +1,96 @@ +import { fail } from '@sveltejs/kit'; +import type { createPocketBase } from '$lib/pb'; +import type { SlotStatus } from '$lib/types'; +import type { Actions, PageServerLoad } from './$types'; + +type Pb = ReturnType; + +type SlotPayload = + | { payload: { item: string; start: string; end: string; status: string; notes: string } } + | { error: string }; + +async function slotPayload(data: FormData, pb: Pb): Promise { + const itemId = String(data.get('item') || '').trim(); + const startValue = String(data.get('start') || '').trim(); + const status = String(data.get('status') || 'available').trim(); + const notes = String(data.get('notes') || '').trim(); + + if (!itemId || !startValue) return { error: 'Service and start are required.' }; + + const start = new Date(startValue); + if (Number.isNaN(start.getTime())) return { error: 'Invalid start time.' }; + + let item: Record; + try { + item = await pb.collection('items').getOne(itemId); + } catch { + return { error: 'Selected service was not found.' }; + } + if (item.type !== 'item_with_time') return { error: 'Selected service must be a bookable service.' }; + + const duration = Number(item.duration) || 0; + const end = new Date(start.getTime() + duration * 60_000); + + return { + payload: { item: itemId, start: start.toISOString(), end: end.toISOString(), status, notes } + }; +} + +export const load: PageServerLoad = async ({ locals }) => { + const itemRecords = await locals.pb + .collection('items') + .getFullList({ filter: "type = 'item_with_time' && active = true", sort: 'name' }) + .catch(() => []); + const items = itemRecords.map((record) => ({ + id: record.id, + name: String(record.name || ''), + duration: record.duration ?? 0 + })); + + const slotRecords = await locals.pb + .collection('slots') + .getFullList({ sort: '-start', expand: 'item' }) + .catch(() => []); + const slots = slotRecords.map((record) => ({ + id: record.id, + item: String(record.item || ''), + itemName: String(record.expand?.item?.name || 'Unknown service'), + itemDuration: record.expand?.item?.duration ?? null, + start: String(record.start || ''), + end: record.end ? String(record.end) : '', + status: String(record.status || 'available') as SlotStatus, + heldUntil: record.heldUntil ? String(record.heldUntil) : '', + order: record.order ? String(record.order) : '', + notes: String(record.notes || '') + })); + + return { items, slots }; +}; + +export const actions: Actions = { + create: async ({ request, locals }) => { + const data = await request.formData(); + const result = await slotPayload(data, locals.pb); + if ('error' in result) return fail(400, { message: result.error }); + await locals.pb.collection('slots').create(result.payload); + return { ok: true }; + }, + update: async ({ request, locals }) => { + const data = await request.formData(); + const id = String(data.get('id') || ''); + if (!id) return fail(400, { message: 'Slot id is required.' }); + const result = await slotPayload(data, locals.pb); + if ('error' in result) return fail(400, { message: result.error }); + await locals.pb.collection('slots').update(id, result.payload); + return { ok: true }; + }, + delete: async ({ request, locals }) => { + const data = await request.formData(); + const id = String(data.get('id') || ''); + if (!id) return fail(400, { message: 'Slot id is required.' }); + const record = await locals.pb.collection('slots').getOne(id).catch(() => null); + if (record && record.status === 'booked') return fail(400, { message: 'Booked slots cannot be deleted' }); + await locals.pb.collection('slots').delete(id); + return { ok: true }; + } +}; diff --git a/app/src/routes/admin/slots/+page.svelte b/app/src/routes/admin/slots/+page.svelte new file mode 100644 index 0000000..7d924b9 --- /dev/null +++ b/app/src/routes/admin/slots/+page.svelte @@ -0,0 +1,161 @@ + + +Slots | CMS + +
+
+
+

Slots

+

Create bookable time slots for your services.

+
+ +
+ + {#if form?.message}
{form.message}
{/if} + +
+
+ + + + {#each slots as slot} + + + + + + + + {/each} + +
ServiceDateDurationStatus
{slot.itemName}{new Date(slot.start).toLocaleString()}{slot.itemDuration ? `${slot.itemDuration} min` : '—'} + {slot.status} + + +
+
+
+
+ +{#if showEditor} +
+
+
+

{draft.id ? 'Edit slot' : 'Create slot'}

+ +
+ +
+ + + {#if isHeld} + + + {/if} + + {#if isHeld} +
+ This slot is currently held by a basket{draft.heldUntil ? ` (until ${new Date(draft.heldUntil).toLocaleString()})` : ''} — editing start/end is disabled. +
+ {/if} + + + + + {#if endLabel}

{endLabel}

{/if} + + + +
+ {#if draft.id} + + {:else} + + {/if} +
+ + +
+
+
+
+
+{/if} diff --git a/app/src/routes/api/basket/+server.ts b/app/src/routes/api/basket/+server.ts new file mode 100644 index 0000000..1b13b3d --- /dev/null +++ b/app/src/routes/api/basket/+server.ts @@ -0,0 +1,167 @@ +import { json, error, type Cookies } from '@sveltejs/kit'; +import type { RequestHandler } from './$types'; +import { getAdminPb } from '$lib/server/pb-admin'; +import { + BASKET_COOKIE, + BASKET_TTL_MS, + SLOT_HOLD_MS, + sweepExpiredHolds, + loadBasket, + createBasket, + touchBasket, + releaseLineHold +} from '$lib/server/basket'; +import type PocketBase from 'pocketbase'; + +function setBasketCookie(cookies: Cookies, basketId: string) { + cookies.set(BASKET_COOKIE, basketId, { + path: '/', + httpOnly: true, + sameSite: 'lax', + maxAge: BASKET_TTL_MS / 1000 + }); +} + +/** + * Resolve the current basket from the cookie. When `create` is true and no + * valid basket exists, a new one is created (and the cookie is set). + */ +async function resolveBasket(pb: PocketBase, cookies: Cookies, create: boolean) { + const id = cookies.get(BASKET_COOKIE); + if (id) { + const basket = await loadBasket(pb, id); + if (basket) return { basket, isNew: false }; + } + if (!create) return { basket: null, isNew: false }; + const basket = await createBasket(pb); + setBasketCookie(cookies, basket.id); + return { basket, isNew: true }; +} + +export const GET: RequestHandler = async ({ cookies }) => { + const pb = await getAdminPb(); + await sweepExpiredHolds(pb); + const { basket } = await resolveBasket(pb, cookies, false); + return json({ basket }); +}; + +export const POST: RequestHandler = async ({ request, cookies }) => { + const pb = await getAdminPb(); + await sweepExpiredHolds(pb); + + let body: Record; + try { + body = await request.json(); + } catch { + throw error(400, 'Invalid JSON body'); + } + + const action = String(body.action || ''); + + // All mutations need a basket — lazily created on first add. + const { basket } = await resolveBasket(pb, cookies, action === 'add_item' || action === 'add_slot'); + if (!basket) throw error(400, 'No active basket — add an item first'); + + switch (action) { + case 'add_item': { + const itemId = String(body.itemId || ''); + const quantity = Math.max(1, Number(body.quantity) || 1); + if (!itemId) throw error(400, 'itemId is required'); + + const item = await pb.collection('items').getOne(itemId).catch(() => null); + if (!item || !item.active) throw error(404, 'Item not found'); + if (item.type !== 'item') throw error(400, 'Use add_slot for bookable services'); + + const existing = basket.lines.find((l) => l.lineType === 'item' && l.item === itemId); + const newQty = (existing?.quantity ?? 0) + quantity; + if (item.stock != null && newQty > item.stock) { + throw error(409, `Only ${item.stock} in stock`); + } + + if (existing) { + await pb.collection('basket_lines').update(existing.id, { quantity: newQty }); + } else { + await pb.collection('basket_lines').create({ + basket: basket.id, + item: itemId, + quantity, + lineType: 'item' + }); + } + break; + } + + case 'add_slot': { + const slotId = String(body.slotId || ''); + if (!slotId) throw error(400, 'slotId is required'); + + if (basket.lines.some((l) => l.slot === slotId)) { + throw error(409, 'Slot already in your basket'); + } + + const slot = await pb.collection('slots').getOne(slotId).catch(() => null); + if (!slot) throw error(404, 'Slot not found'); + if (slot.status !== 'available') throw error(409, 'Slot is no longer available'); + + // Atomic guard: basket_lines.slot has a partial UNIQUE index, so two + // concurrent requests cannot both create a line for the same slot. + // The line is created first; whoever loses the race gets a 409. + let line; + try { + line = await pb.collection('basket_lines').create({ + basket: basket.id, + item: slot.item, + slot: slotId, + quantity: 1, + lineType: 'slot' + }); + } catch { + throw error(409, 'Slot was just reserved by someone else'); + } + + try { + await pb.collection('slots').update(slotId, { + status: 'held', + heldUntil: new Date(Date.now() + SLOT_HOLD_MS).toISOString() + }); + } catch (e) { + // Roll back the line if the hold update failed + await pb.collection('basket_lines').delete(line.id).catch(() => {}); + throw error(500, 'Could not reserve the slot — please try again'); + } + break; + } + + case 'update_quantity': { + const lineId = String(body.lineId || ''); + const quantity = Number(body.quantity); + const line = basket.lines.find((l) => l.id === lineId); + if (!line) throw error(404, 'Line not found in your basket'); + if (line.lineType === 'slot') throw error(400, 'Slot lines have fixed quantity 1'); + if (!Number.isInteger(quantity) || quantity < 1) throw error(400, 'Quantity must be a positive integer'); + + const item = await pb.collection('items').getOne(line.item).catch(() => null); + if (item?.stock != null && quantity > item.stock) { + throw error(409, `Only ${item.stock} in stock`); + } + await pb.collection('basket_lines').update(lineId, { quantity }); + break; + } + + case 'remove_line': { + const lineId = String(body.lineId || ''); + const line = basket.lines.find((l) => l.id === lineId); + if (!line) throw error(404, 'Line not found in your basket'); + await pb.collection('basket_lines').delete(lineId); + await releaseLineHold(pb, line); + break; + } + + default: + throw error(400, `Unknown action: ${action}`); + } + + await touchBasket(pb, basket.id); + const updated = await loadBasket(pb, basket.id); + return json({ basket: updated }); +}; diff --git a/app/src/routes/api/checkout/create-intent/+server.ts b/app/src/routes/api/checkout/create-intent/+server.ts new file mode 100644 index 0000000..c56ad63 --- /dev/null +++ b/app/src/routes/api/checkout/create-intent/+server.ts @@ -0,0 +1,102 @@ +import { json, error } from '@sveltejs/kit'; +import type { RequestHandler } from './$types'; +import { getAdminPb } from '$lib/server/pb-admin'; +import { BASKET_COOKIE, SLOT_CHECKOUT_HOLD_MS, sweepExpiredHolds, loadBasket, extendBasketHolds } from '$lib/server/basket'; +import { getStripe, getCurrency } from '$lib/stripe.server'; +import type { CustomerDetails } from '$lib/types'; + +export const POST: RequestHandler = async ({ request, cookies }) => { + const pb = await getAdminPb(); + + const basketId = cookies.get(BASKET_COOKIE); + // Payment is starting — extend any held slots to the checkout hold (30 min) + // so a booked service survives the customer entering card details or + // retrying a declined card. Extend BEFORE sweeping so a slot whose hold + // just lapsed is rescued rather than released at the moment they try to pay. + if (basketId) await extendBasketHolds(pb, basketId, SLOT_CHECKOUT_HOLD_MS); + await sweepExpiredHolds(pb); + + if (!basketId) throw error(400, 'No active basket'); + const basket = await loadBasket(pb, basketId); + if (!basket) throw error(400, 'Your session has expired — please re-select your items'); + if (!basket.lines.length) throw error(400, 'Your basket is empty — a time slot you selected may have expired. Please pick a slot from the shop and try again.'); + + let body: Record; + try { + body = await request.json(); + } catch { + throw error(400, 'Invalid JSON body'); + } + + const customer: CustomerDetails = { + name: String(body.name || '').trim(), + email: String(body.email || '').trim(), + phone: String(body.phone || '').trim(), + notes: String(body.notes || '').trim() + }; + if (!customer.name) throw error(400, 'Name is required'); + if (!customer.email || !/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(customer.email)) { + throw error(400, 'A valid email is required'); + } + + // Re-validate every line server-side (source of truth for the total). + let totalCents = 0; + for (const line of basket.lines) { + const item = await pb.collection('items').getOne(line.item).catch(() => null); + if (!item || !item.active) throw error(409, `"${line.itemName ?? 'An item'}" is no longer available`); + + if (line.lineType === 'slot') { + const slot = await pb.collection('slots').getOne(line.slot!).catch(() => null); + if (!slot || slot.status !== 'held') { + throw error(409, `Your time slot for "${item.name}" has expired — please pick it again`); + } + } else { + if (item.stock != null && item.stock < line.quantity) { + throw error(409, `Only ${item.stock} of "${item.name}" left in stock`); + } + } + totalCents += Math.round(item.price * 100) * line.quantity; + } + + if (totalCents <= 0) throw error(400, 'Basket total must be positive'); + + let paymentIntent; + if (basket.stripePaymentIntentId) { + // Reuse an existing intent when possible (page reload / retry). + try { + const existing = await getStripe().paymentIntents.retrieve(basket.stripePaymentIntentId); + if (existing.status === 'requires_payment_method' || existing.status === 'requires_confirmation') { + paymentIntent = await getStripe().paymentIntents.update(existing.id, { + amount: totalCents, + metadata: { basket_id: basket.id } + }); + } + } catch { + // Intent missing/invalid — fall through and create a new one + } + } + + if (!paymentIntent) { + paymentIntent = await getStripe().paymentIntents.create({ + amount: totalCents, + currency: getCurrency(), + automatic_payment_methods: { enabled: true }, + receipt_email: customer.email, + metadata: { + basket_id: basket.id, + line_summary: basket.lines + .map((l) => `${l.quantity}× ${l.itemName ?? l.item}`) + .join('; ') + .slice(0, 450) + } + }); + } + + await pb.collection('baskets').update(basket.id, { + stripePaymentIntentId: paymentIntent.id, + email: customer.email, + customerDetails: customer + }); + + return json({ clientSecret: paymentIntent.client_secret }); +}; diff --git a/app/src/routes/api/webhooks/stripe/+server.ts b/app/src/routes/api/webhooks/stripe/+server.ts new file mode 100644 index 0000000..fec8e6c --- /dev/null +++ b/app/src/routes/api/webhooks/stripe/+server.ts @@ -0,0 +1,122 @@ +import { json, error } from '@sveltejs/kit'; +import type { RequestHandler } from './$types'; +import { env } from '$env/dynamic/private'; +import { getStripe } from '$lib/stripe.server'; +import { getAdminPb } from '$lib/server/pb-admin'; +import { getFileUrl } from '$lib/pb'; +import { SLOT_HOLD_MS, extendBasketHolds } from '$lib/server/basket'; +import type PocketBase from 'pocketbase'; + +async function handlePaymentSucceeded(pb: PocketBase, paymentIntent: any) { + const basketId = paymentIntent.metadata?.basket_id; + if (!basketId) return; // Not one of ours + + // Idempotency: if an order already exists for this intent, we're done. + const existing = await pb + .collection('orders') + .getFirstListItem(`stripePaymentIntentId = "${paymentIntent.id}"`) + .catch(() => null); + if (existing) return; + + const basket = await pb.collection('baskets').getOne(basketId).catch(() => null); + if (!basket) return; + + const lines = await pb + .collection('basket_lines') + .getFullList({ filter: `basket = "${basketId}"`, expand: 'item,slot' }); + + // Create the order + const order = await pb.collection('orders').create({ + basket: basketId, + email: basket.email || paymentIntent.receipt_email || '', + customerDetails: basket.customerDetails || {}, + total: paymentIntent.amount / 100, + status: 'paid', + stripePaymentIntentId: paymentIntent.id + }); + + // Snapshot order lines, flip slots to booked, decrement item stock + for (const line of lines) { + const item = line.expand?.item; + const slot = line.expand?.slot; + await pb.collection('order_lines').create({ + order: order.id, + item: line.item, + slot: line.slot || null, + quantity: line.quantity, + lineType: line.lineType, + name: item?.name ?? 'Unknown item', + price: item?.price ?? 0, + start: slot?.start || null + }); + + if (line.lineType === 'slot' && line.slot) { + await pb + .collection('slots') + .update(line.slot, { status: 'booked', heldUntil: null, order: order.id }) + .catch(() => {}); + } else if (line.lineType === 'item' && item?.stock != null) { + await pb + .collection('items') + .update(item.id, { stock: Math.max(0, item.stock - line.quantity) }) + .catch(() => {}); + } + } + + // Basket completed — lines can go (order_lines hold the snapshot). + for (const line of lines) { + await pb.collection('basket_lines').delete(line.id).catch(() => {}); + } + await pb.collection('baskets').update(basketId, { status: 'completed' }).catch(() => {}); +} + +async function handlePaymentFailed(pb: PocketBase, paymentIntent: any) { + const basketId = paymentIntent.metadata?.basket_id; + if (!basketId) return; + + // The card was refused (or the payment otherwise failed). Keep the slots + // held for the customer so they can retry without re-picking them — just + // reset the hold to the standard 10-minute window. Starting payment again + // (create-intent) will extend it back to 30 min. + await extendBasketHolds(pb, basketId, SLOT_HOLD_MS).catch(() => {}); + + if (paymentIntent.id) { + await pb + .collection('baskets') + .update(basketId, { stripePaymentIntentId: null }) + .catch(() => {}); + } +} + +export const POST: RequestHandler = async ({ request }) => { + const secret = env.STRIPE_WEBHOOK_SECRET; + if (!secret) throw error(500, 'STRIPE_WEBHOOK_SECRET is not configured'); + + // Signature verification MUST use the raw request body. + const body = await request.text(); + const signature = request.headers.get('stripe-signature'); + if (!signature) throw error(400, 'Missing Stripe-Signature header'); + + let event; + try { + event = getStripe().webhooks.constructEvent(body, signature, secret); + } catch (e) { + throw error(400, `Webhook signature verification failed: ${e instanceof Error ? e.message : 'unknown'}`); + } + + const pb = await getAdminPb(); + + switch (event.type) { + case 'payment_intent.succeeded': + await handlePaymentSucceeded(pb, event.data.object); + break; + case 'payment_intent.payment_failed': + await handlePaymentFailed(pb, event.data.object); + break; + default: + // Unhandled event types are fine — acknowledge receipt. + break; + } + + return json({ received: true }); +}; diff --git a/app/src/routes/checkout/return/+page.server.ts b/app/src/routes/checkout/return/+page.server.ts new file mode 100644 index 0000000..e3346ac --- /dev/null +++ b/app/src/routes/checkout/return/+page.server.ts @@ -0,0 +1,64 @@ +import type { PageServerLoad } from './$types'; +import { getStripe } from '$lib/stripe.server'; +import { getAdminPb } from '$lib/server/pb-admin'; +import { BASKET_COOKIE } from '$lib/server/basket'; +import type { OrderRecord } from '$lib/types'; + +export const load: PageServerLoad = async ({ url, cookies }) => { + const intentId = url.searchParams.get('payment_intent'); + if (!intentId) return { state: 'missing' as const }; + + let intent; + try { + intent = await getStripe().paymentIntents.retrieve(intentId); + } catch { + return { state: 'invalid' as const }; + } + + const pb = await getAdminPb(); + + // Webhook may not have landed yet — the webhook is the source of truth. + const order = await pb + .collection('orders') + .getFirstListItem(`stripePaymentIntentId = "${intentId}"`) + .catch(() => null); + + if (!order) { + // Payment succeeded but webhook is still in flight. + if (intent.status === 'succeeded') return { state: 'processing' as const }; + return { state: intent.status === 'canceled' ? ('canceled' as const) : ('failed' as const) }; + } + + // Sort by id, not 'created' — the order_lines collection was imported without + // autodate fields. PocketBase ids are time-sortable ULIDs, so this preserves + // chronological order without requiring a schema migration. + const orderLines = await pb + .collection('order_lines') + .getFullList({ filter: `order = "${order.id}"`, sort: 'id' }); + + cookies.delete(BASKET_COOKIE, { path: '/' }); + + const result: OrderRecord = { + id: order.id, + basket: order.basket, + email: order.email, + customerDetails: order.customerDetails, + total: order.total, + status: order.status, + stripePaymentIntentId: order.stripePaymentIntentId, + createdAt: order.created, + lines: orderLines.map((l) => ({ + id: l.id, + order: l.order, + item: l.item, + slot: l.slot || null, + quantity: l.quantity, + lineType: l.lineType, + name: l.name, + price: l.price, + start: l.start || null + })) + }; + + return { state: 'paid' as const, order: result }; +}; diff --git a/app/src/routes/checkout/return/+page.svelte b/app/src/routes/checkout/return/+page.svelte new file mode 100644 index 0000000..b09b23d --- /dev/null +++ b/app/src/routes/checkout/return/+page.svelte @@ -0,0 +1,72 @@ + + + + Booking confirmation + + +
+ {#if data.state === 'paid' && data.order} +
✓
+

Thank you, {data.order.customerDetails?.name || 'friend'}!

+

+ Your booking is confirmed. A receipt was sent to {data.order.email}. +

+ +
+

Your order

+
    + {#each data.order.lines ?? [] as line} +
  • +
    + {line.quantity}× {line.name} + {#if line.start} +
    {formatSlotDate(line.start)}
    + {/if} +
    + {formatPrice(line.price * line.quantity)} +
  • + {/each} +
+
+ Total{formatPrice(data.order.total)} +
+
+ + Book another + {:else if data.state === 'processing'} +

Processing your payment…

+

+ Your payment went through — we're just finalizing your booking. This page refreshes automatically. +

+ + + + {:else if data.state === 'canceled' || data.state === 'failed'} +

Payment not completed

+

Your payment didn't go through — no money was captured. Please try again.

+ Back to the shop + {:else} +

Nothing to see here

+

This link is missing a payment reference.

+ Back to the shop + {/if} +
diff --git a/bun.lock b/bun.lock new file mode 100644 index 0000000..5e4fc7d --- /dev/null +++ b/bun.lock @@ -0,0 +1,17 @@ +{ + "lockfileVersion": 1, + "configVersion": 1, + "workspaces": { + "": { + "dependencies": { + "@stripe/stripe-js": "^9.12.1", + "stripe": "^22.3.2", + }, + }, + }, + "packages": { + "@stripe/stripe-js": ["@stripe/stripe-js@9.12.1", "", {}, "sha512-KLXPvjA0BfS4dQnW+ddHjwtIXMnIfKYxqmeNMmQCfKjvYog0cSG+Z7ZvK4RH1+bV90GC07nUztWDRWmJLi5HZQ=="], + + "stripe": ["stripe@22.3.2", "", { "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-O13QOvgEIQvDlTy6Ubb5kB980wpbhmoZNsgCXKILjCMZS67f+bW+6w99k3gnSi/N1lkryoj1WYdpGT5Wc5edjg=="], + } +} diff --git a/docker-compose.yml b/docker-compose.yml index f08961f..77f8816 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,14 @@ services: POCKETBASE_INTERNAL_URL: http://pocketbase:80 PUBLIC_POCKETBASE_URL: http://localhost:8080 ORIGIN: http://localhost:8080 - BODY_SIZE_LIMIT: 5242880 # 5MB + BODY_SIZE_LIMIT: 52428800 # 50MB — import payload embeds all images as base64 + # Commerce (reservation & payment system) — set these in a root-level .env + POCKETBASE_ADMIN_EMAIL: ${POCKETBASE_ADMIN_EMAIL:-} + POCKETBASE_ADMIN_PASSWORD: ${POCKETBASE_ADMIN_PASSWORD:-} + STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY:-} + STRIPE_WEBHOOK_SECRET: ${STRIPE_WEBHOOK_SECRET:-} + PUBLIC_STRIPE_PUBLISHABLE_KEY: ${PUBLIC_STRIPE_PUBLISHABLE_KEY:-} + STRIPE_CURRENCY: ${STRIPE_CURRENCY:-eur} # Internal only — served via the caddy reverse proxy expose: - "3000" @@ -33,7 +40,7 @@ services: ports: - "8080:8080" volumes: - - ./Caddyfile:/etc/caddy/Caddyfile:ro + - ./Caddyfile:/etc/caddy/Caddyfile:ro,Z depends_on: - app - pocketbase diff --git a/pb_schema.json b/pb_schema.json index 0818a81..562f2ed 100644 --- a/pb_schema.json +++ b/pb_schema.json @@ -290,5 +290,152 @@ "CREATE INDEX `idx_events_published` ON `events` (`published`)" ], "options": {} + }, + { + "id": "pbc_items00001", + "name": "items", + "type": "base", + "system": false, + "listRule": "active = true || @request.auth.id != ''", + "viewRule": "active = true || @request.auth.id != ''", + "createRule": "@request.auth.id != ''", + "updateRule": "@request.auth.id != ''", + "deleteRule": "@request.auth.id != ''", + "fields": [ + { "id": "text_itemname01", "name": "name", "type": "text", "system": false, "required": true, "presentable": true, "unique": false, "options": { "min": null, "max": 180, "pattern": "" } }, + { "id": "text_itemdesc01", "name": "description", "type": "text", "system": false, "required": false, "presentable": false, "unique": false, "options": { "min": null, "max": 2000, "pattern": "" } }, + { "id": "num_itemprice01", "name": "price", "type": "number", "system": false, "required": true, "presentable": false, "unique": false, "options": { "min": 0, "max": null } }, + { "id": "rel_itemimage01", "name": "image", "type": "relation", "system": false, "required": false, "presentable": false, "unique": false, "collectionId": "pbc_media00001", "cascadeDelete": false, "minSelect": 0, "maxSelect": 1, "displayFields": null }, + { "id": "sel_itemtype001", "name": "type", "type": "select", "system": false, "required": true, "presentable": false, "unique": false, "maxSelect": 1, "values": ["item", "item_with_time"] }, + { "id": "num_itemstock01", "name": "stock", "type": "number", "system": false, "required": false, "presentable": false, "unique": false, "options": { "min": 0, "max": null } }, + { "id": "num_itemdur0001", "name": "duration", "type": "number", "system": false, "required": false, "presentable": false, "unique": false, "options": { "min": 1, "max": null } }, + { "id": "bool_itemactive", "name": "active", "type": "bool", "system": false, "required": false, "presentable": false, "unique": false, "options": {} } + ], + "indexes": [], + "autodate": true, + "options": {} + }, + { + "id": "pbc_slots00001", + "name": "slots", + "type": "base", + "system": false, + "listRule": "status = 'available' || @request.auth.id != ''", + "viewRule": "status = 'available' || @request.auth.id != ''", + "createRule": "@request.auth.id != ''", + "updateRule": "@request.auth.id != ''", + "deleteRule": "@request.auth.id != ''", + "fields": [ + { "id": "rel_slotitem001", "name": "item", "type": "relation", "system": false, "required": true, "presentable": false, "unique": false, "collectionId": "pbc_items00001", "cascadeDelete": true, "minSelect": 0, "maxSelect": 1, "displayFields": null }, + { "id": "date_slotstart0", "name": "start", "type": "date", "system": false, "required": true, "presentable": false, "unique": false, "options": { "min": "", "max": "" } }, + { "id": "date_slotend000", "name": "end", "type": "date", "system": false, "required": false, "presentable": false, "unique": false, "options": { "min": "", "max": "" } }, + { "id": "sel_slotstatus0", "name": "status", "type": "select", "system": false, "required": true, "presentable": false, "unique": false, "maxSelect": 1, "values": ["available", "held", "booked"] }, + { "id": "date_slotheldun0", "name": "heldUntil", "type": "date", "system": false, "required": false, "presentable": false, "unique": false, "options": { "min": "", "max": "" } }, + { "id": "rel_slotorder01", "name": "order", "type": "relation", "system": false, "required": false, "presentable": false, "unique": false, "collectionId": "pbc_orders00001", "cascadeDelete": false, "minSelect": 0, "maxSelect": 1, "displayFields": null }, + { "id": "text_slotnotes0", "name": "notes", "type": "text", "system": false, "required": false, "presentable": false, "unique": false, "options": { "min": null, "max": 500, "pattern": "" } } + ], + "indexes": [ + "CREATE INDEX `idx_slots_item_start` ON `slots` (`item`, `start`)", + "CREATE INDEX `idx_slots_status` ON `slots` (`status`)" + ], + "autodate": true, + "options": {} + }, + { + "id": "pbc_baskets0001", + "name": "baskets", + "type": "base", + "system": false, + "listRule": "@request.auth.id != ''", + "viewRule": "@request.auth.id != ''", + "createRule": "", + "updateRule": "", + "deleteRule": "@request.auth.id != ''", + "fields": [ + { "id": "sel_basketstat0", "name": "status", "type": "select", "system": false, "required": true, "presentable": false, "unique": false, "maxSelect": 1, "values": ["active", "completed", "abandoned"] }, + { "id": "date_basketexp0", "name": "expiresAt", "type": "date", "system": false, "required": true, "presentable": false, "unique": false, "options": { "min": "", "max": "" } }, + { "id": "text_basketemai", "name": "email", "type": "text", "system": false, "required": false, "presentable": false, "unique": false, "options": { "min": null, "max": 254, "pattern": "" } }, + { "id": "json_basketcust", "name": "customerDetails", "type": "json", "system": false, "required": false, "presentable": false, "unique": false, "options": { "maxSize": 100000 } }, + { "id": "text_basketstrip", "name": "stripePaymentIntentId", "type": "text", "system": false, "required": false, "presentable": false, "unique": false, "options": { "min": null, "max": 200, "pattern": "" } } + ], + "indexes": [ + "CREATE INDEX `idx_baskets_status` ON `baskets` (`status`)" + ], + "autodate": true, + "options": {} + }, + { + "id": "pbc_basketlines1", + "name": "basket_lines", + "type": "base", + "system": false, + "listRule": "@request.auth.id != ''", + "viewRule": "@request.auth.id != ''", + "createRule": "", + "updateRule": "", + "deleteRule": "", + "fields": [ + { "id": "rel_blbasket0001", "name": "basket", "type": "relation", "system": false, "required": true, "presentable": false, "unique": false, "collectionId": "pbc_baskets0001", "cascadeDelete": true, "minSelect": 0, "maxSelect": 1, "displayFields": null }, + { "id": "rel_blitem000001", "name": "item", "type": "relation", "system": false, "required": true, "presentable": false, "unique": false, "collectionId": "pbc_items00001", "cascadeDelete": false, "minSelect": 0, "maxSelect": 1, "displayFields": null }, + { "id": "rel_blslot000001", "name": "slot", "type": "relation", "system": false, "required": false, "presentable": false, "unique": false, "collectionId": "pbc_slots00001", "cascadeDelete": false, "minSelect": 0, "maxSelect": 1, "displayFields": null }, + { "id": "num_blquantity01", "name": "quantity", "type": "number", "system": false, "required": true, "presentable": false, "unique": false, "options": { "min": 1, "max": null } }, + { "id": "sel_bllinetype01", "name": "lineType", "type": "select", "system": false, "required": true, "presentable": false, "unique": false, "maxSelect": 1, "values": ["item", "slot"] } + ], + "indexes": [ + "CREATE INDEX `idx_basket_lines_basket` ON `basket_lines` (`basket`)", + "CREATE UNIQUE INDEX `idx_basket_lines_slot_unique` ON `basket_lines` (`slot`) WHERE `slot` != ''" + ], + "autodate": true, + "options": {} + }, + { + "id": "pbc_orders00001", + "name": "orders", + "type": "base", + "system": false, + "listRule": "@request.auth.id != ''", + "viewRule": "@request.auth.id != ''", + "createRule": "", + "updateRule": "@request.auth.id != ''", + "deleteRule": "@request.auth.id != ''", + "fields": [ + { "id": "rel_orderbasket0", "name": "basket", "type": "relation", "system": false, "required": true, "presentable": false, "unique": false, "collectionId": "pbc_baskets0001", "cascadeDelete": false, "minSelect": 0, "maxSelect": 1, "displayFields": null }, + { "id": "text_orderemail0", "name": "email", "type": "text", "system": false, "required": true, "presentable": false, "unique": false, "options": { "min": null, "max": 254, "pattern": "" } }, + { "id": "json_ordercustde", "name": "customerDetails", "type": "json", "system": false, "required": false, "presentable": false, "unique": false, "options": { "maxSize": 100000 } }, + { "id": "num_ordertotal01", "name": "total", "type": "number", "system": false, "required": true, "presentable": false, "unique": false, "options": { "min": 0, "max": null } }, + { "id": "sel_orderstatus0", "name": "status", "type": "select", "system": false, "required": true, "presentable": false, "unique": false, "maxSelect": 1, "values": ["pending", "paid", "refunded"] }, + { "id": "text_orderstripe0", "name": "stripePaymentIntentId", "type": "text", "system": false, "required": true, "presentable": false, "unique": false, "options": { "min": null, "max": 200, "pattern": "" } } + ], + "indexes": [ + "CREATE INDEX `idx_orders_basket` ON `orders` (`basket`)" + ], + "autodate": true, + "options": {} + }, + { + "id": "pbc_orderlines01", + "name": "order_lines", + "type": "base", + "system": false, + "listRule": "@request.auth.id != ''", + "viewRule": "@request.auth.id != ''", + "createRule": "", + "updateRule": "", + "deleteRule": "", + "fields": [ + { "id": "rel_olorder00001", "name": "order", "type": "relation", "system": false, "required": true, "presentable": false, "unique": false, "collectionId": "pbc_orders00001", "cascadeDelete": true, "minSelect": 0, "maxSelect": 1, "displayFields": null }, + { "id": "rel_olitem000001", "name": "item", "type": "relation", "system": false, "required": true, "presentable": false, "unique": false, "collectionId": "pbc_items00001", "cascadeDelete": false, "minSelect": 0, "maxSelect": 1, "displayFields": null }, + { "id": "rel_olslot000001", "name": "slot", "type": "relation", "system": false, "required": false, "presentable": false, "unique": false, "collectionId": "pbc_slots00001", "cascadeDelete": false, "minSelect": 0, "maxSelect": 1, "displayFields": null }, + { "id": "num_olquantity01", "name": "quantity", "type": "number", "system": false, "required": true, "presentable": false, "unique": false, "options": { "min": 1, "max": null } }, + { "id": "sel_ollinetype01", "name": "lineType", "type": "select", "system": false, "required": true, "presentable": false, "unique": false, "maxSelect": 1, "values": ["item", "slot"] }, + { "id": "text_olname00001", "name": "name", "type": "text", "system": false, "required": true, "presentable": false, "unique": false, "options": { "min": null, "max": 180, "pattern": "" } }, + { "id": "num_olprice00001", "name": "price", "type": "number", "system": false, "required": true, "presentable": false, "unique": false, "options": { "min": 0, "max": null } }, + { "id": "date_olstart0001", "name": "start", "type": "date", "system": false, "required": false, "presentable": false, "unique": false, "options": { "min": "", "max": "" } } + ], + "indexes": [ + "CREATE INDEX `idx_order_lines_order` ON `order_lines` (`order`)" + ], + "autodate": true, + "options": {} } ]