diff --git a/bin/vp.js b/bin/vp.js new file mode 100755 index 0000000..53e05a3 --- /dev/null +++ b/bin/vp.js @@ -0,0 +1,33 @@ +#!/usr/bin/env node +import { spawn } from "node:child_process"; + +const [subcommand, ...rest] = process.argv.slice(2); + +let cmd = "vite"; +let args = []; + +if (subcommand === "check") { + cmd = "tsc"; + args = ["--noEmit", ...rest]; +} else if (subcommand === "test") { + cmd = "vitest"; + args = ["run", ...rest]; +} else if (subcommand === "dev") { + cmd = "vite"; + args = rest; +} else if (subcommand === "build") { + cmd = "vite"; + args = ["build", ...rest]; +} else if (subcommand) { + cmd = subcommand; + args = rest; +} + +const child = spawn(`pnpm exec ${cmd}`, args, { + stdio: "inherit", + shell: true, +}); + +child.on("exit", (code) => { + process.exit(code ?? 0); +}); diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..2705749 --- /dev/null +++ b/biome.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.5.15/schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "files": { + "ignoreUnknown": false + }, + "formatter": { + "enabled": true, + "indentStyle": "tab" + }, + "linter": { + "enabled": true, + "rules": { + "preset": "recommended" + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + }, + "assist": { + "enabled": true, + "actions": { + "source": { + "organizeImports": "on" + } + } + } +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..9103c3b --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + + + + Armonía del Ser | Panel Operador + + + + + +
+ + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..85b0a61 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "armonia-dashboard", + "version": "0.1.0", + "private": true, + "type": "module", + "bin": { + "vp": "./bin/vp.js" + }, + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview", + "check": "tsc --noEmit", + "test": "vitest run", + "lint": "biome check ." + }, + "devDependencies": { + "typescript": "^7.0.2", + "vite": "^8.3.4", + "vitest": "^5.0.5" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..d5301fb --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,1001 @@ +--- +lockfileVersion: '9.0' + +importers: + + .: + configDependencies: {} + packageManagerDependencies: + pnpm: + specifier: 12.14.0 + version: 12.14.0 + +packages: + + '@pnpm/exe.android-arm64@12.14.0': + resolution: {integrity: sha512-+iSh7x21C3A2hqc+Z0ZmbKTcn6YNlzrXM142PsnQH/dLj0DYxFzoBvc6XAnL/yfQ5nnH2ebBiRj/zVxr61fZbQ==} + cpu: [arm64] + os: [android] + + '@pnpm/exe.android-x64@12.14.0': + resolution: {integrity: sha512-qT+0LqEr2wBVaxcG2T8cX/R8SSRz2Rvpp8nRR4fh8tnGUZRch87gFmsHUAoSQh7w6j1h0qTjrA384j4xi8frvw==} + cpu: [x64] + os: [android] + + '@pnpm/exe.darwin-arm64@12.14.0': + resolution: {integrity: sha512-tnrdUB8ecJoehuKKqi1YHCBVl61xtJ9XVGcx5EviC6fWO4DeGI8GtXrjvJxDBM3nuVjJeWistgsUp/N142x4sw==} + cpu: [arm64] + os: [darwin] + + '@pnpm/exe.darwin-x64@12.14.0': + resolution: {integrity: sha512-vlBfGkruqQRsEHTW43cPwpYd7QlbIJ//cvpAdb3bVXkI8SgTPoXhCnc05m+ZNiPrrEkBsX/t7KHw9aXpkzPm3Q==} + cpu: [x64] + os: [darwin] + + '@pnpm/exe.freebsd-x64@12.14.0': + resolution: {integrity: sha512-Qg5rxBrGYl6Tfso+EyygPf84fY1Fzy55E/0or+iuYKtnf0vc0MlHJfVIlT7pBukMRntQHRik7hUi0Z4s7AlJsw==} + cpu: [x64] + os: [freebsd] + + '@pnpm/exe.linux-arm64-musl@12.14.0': + resolution: {integrity: sha512-DRIe4yQkXBGA/PhVJdzlbnllxBdAtnMMvTVLLcGpsK5FvJz9kxD2Hyxtn68ovmNkVX06f6p45cQwfm3wx2jn1A==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@pnpm/exe.linux-arm64@12.14.0': + resolution: {integrity: sha512-7joGShZ44Nk3WpNU+60JoOPjCXlgxhJAq11S2UiVtwCUDgTer1yTPPfxGW8pxaD6046actYLIYDbZNlubHWs0A==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-ppc64@12.14.0': + resolution: {integrity: sha512-gSoryn7ySdXd//gjgf3MvvA8ZerJayaSbuMZMtAWq4vb2/wlVEgpl0Kvqt54y58TRj533Qjq2txKgnxd4JyoAQ==} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-riscv64@12.14.0': + resolution: {integrity: sha512-EMjew1H9WqQ7pL+tYqCPwiuB+0PeCiJRV7fyWeuFw0wwYUajFBjcaPO3IGAVu9sdmJDU+e+HYv/Zey6aKae0Vw==} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-s390x@12.14.0': + resolution: {integrity: sha512-shYOj/SFoXD35fHe0pWr2JofwSXulC0BnEIXLj2QokDi0EF//AfKsui35yKIkTEl+s2VJybc3PO4iJNhKIj5Qw==} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@pnpm/exe.linux-x64-musl@12.14.0': + resolution: {integrity: sha512-btZiZ2Ot0llKK1ndSfA5i3IRX7/S0VrmzseNH/BJ4c+Cady+S81H6vvU1zByggHMyqQhC8OgxO5PiIY7D9bH0Q==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@pnpm/exe.linux-x64@12.14.0': + resolution: {integrity: sha512-F6K8e/jWxiuEYJaQtRRUG9ynBSTEHa+t7Lf86MKuOO5UA7WVVMbi+oB8nY6iKW++ncWS2yG6T9faXZGxqNsfoQ==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@pnpm/exe.win32-arm64@12.14.0': + resolution: {integrity: sha512-DOjlkVB6TtTKeAAe0hNZXn5S7YqESmo1Z6SGbR4BZNQ4isRg31XVHjX2RFTbY8gnZq68IwzyLmPqlEjMmYxofg==} + cpu: [arm64] + os: [win32] + + '@pnpm/exe.win32-x64@12.14.0': + resolution: {integrity: sha512-/LSX6mew/sLf08XqcjemuklNKf1K/Ftpgj4//hK/HKzI2dKbmxDB27a/2OaQ5a0O3/3OFzlssXDziZsi+yVBwQ==} + cpu: [x64] + os: [win32] + + pnpm@12.14.0: + resolution: {integrity: sha512-wYum2HmT09Fky16JSPMrLAbuhUSH4GzY2GeBNC+z5btGNDZwNHEehoArqpw3vqkGzhkprQjXCITJfYAd8TOJpg==} + engines: {node: '>=18.*'} + hasBin: true + +snapshots: + + '@pnpm/exe.android-arm64@12.14.0': + optional: true + + '@pnpm/exe.android-x64@12.14.0': + optional: true + + '@pnpm/exe.darwin-arm64@12.14.0': + optional: true + + '@pnpm/exe.darwin-x64@12.14.0': + optional: true + + '@pnpm/exe.freebsd-x64@12.14.0': + optional: true + + '@pnpm/exe.linux-arm64-musl@12.14.0': + optional: true + + '@pnpm/exe.linux-arm64@12.14.0': + optional: true + + '@pnpm/exe.linux-ppc64@12.14.0': + optional: true + + '@pnpm/exe.linux-riscv64@12.14.0': + optional: true + + '@pnpm/exe.linux-s390x@12.14.0': + optional: true + + '@pnpm/exe.linux-x64-musl@12.14.0': + optional: true + + '@pnpm/exe.linux-x64@12.14.0': + optional: true + + '@pnpm/exe.win32-arm64@12.14.0': + optional: true + + '@pnpm/exe.win32-x64@12.14.0': + optional: true + + pnpm@12.14.0: + optionalDependencies: + '@pnpm/exe.android-arm64': 12.14.0 + '@pnpm/exe.android-x64': 12.14.0 + '@pnpm/exe.darwin-arm64': 12.14.0 + '@pnpm/exe.darwin-x64': 12.14.0 + '@pnpm/exe.freebsd-x64': 12.14.0 + '@pnpm/exe.linux-arm64': 12.14.0 + '@pnpm/exe.linux-arm64-musl': 12.14.0 + '@pnpm/exe.linux-ppc64': 12.14.0 + '@pnpm/exe.linux-riscv64': 12.14.0 + '@pnpm/exe.linux-s390x': 12.14.0 + '@pnpm/exe.linux-x64': 12.14.0 + '@pnpm/exe.linux-x64-musl': 12.14.0 + '@pnpm/exe.win32-arm64': 12.14.0 + '@pnpm/exe.win32-x64': 12.14.0 + +--- +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + typescript: + specifier: ^7.0.2 + version: 7.0.2 + vite: + specifier: ^8.3.4 + version: 8.3.4 + vitest: + specifier: ^5.0.5 + version: 5.0.5(vite@8.3.4) + +packages: + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + + '@oxc-project/types@0.154.0': + resolution: {integrity: sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==} + + '@rolldown/binding-android-arm-eabi@1.2.14': + resolution: {integrity: sha512-aWR+XKH9+rW7m5fWq/5360J3mHycrx/o6xZM2DQFdJnTMdyP7/WzxPjhtLbVWdKo2y612/4U1bWqb3HQhiF7vg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.2.14': + resolution: {integrity: sha512-QiVxHofl6A8lQU7WAtOUY4QMVZXohxwz7WJJoeh8NBEUyKfIkMRKhYyq8az/1RypNiIXzNTtiS6KwHz0erxYRQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.2.14': + resolution: {integrity: sha512-lTQOzHuBIooh3jIr5XINQkjPGEuGy+Dsy0meXDr6Sjty0b99kYgGh4uBC/8mJX1T0kC8d6S0aPP1Y+bHkh6aBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.2.14': + resolution: {integrity: sha512-hyMKEGatjmBYCs/Q4sbIcL/GqpFEqsX3wc+HYVQ/85A4rxc1o7rPm4DUI4GV4k/h0ITddwFSGpqQunI14GXjTA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.2.14': + resolution: {integrity: sha512-u371GbXoVXrEgP20PwzoGNOdAOqAMhzo19JzzY+V4YmmnC+DTOoqdbMu+O+54emM59Mik/UdrtWgcuEDKWRPKA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.2.14': + resolution: {integrity: sha512-BqwKsdZQf6EqVWr8fv2MrDYzAvOZ7+NYFSJESRGs87fkseEhs0TU9TXgRJTkZoRRkxTizyEg1LKUXfU3/78uqg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.2.14': + resolution: {integrity: sha512-SD9kY8M009x/7s57Z1dgUVlP5+uYBgKQK0Tkr1WIWngrtUJmRCW1RJFMY7QDla2khXhmg2i5Io7MUjcmZNZ/KQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.2.14': + resolution: {integrity: sha512-BJ2CL19M6uuWesMgnqJzgxoI+N+eV7b0A9O9vLV42y+gitC41fNa8KElau1tHVzuLWX5GzEuxMPhAO0tQXQMkg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.2.14': + resolution: {integrity: sha512-4+Kl8daPV8NDHaD7mfCcc1pRM+Qg7ab8DyMm5FG5WoZgv4h2i3KFN1CybYBNbQqmuYm7ftJLvmMI1eHYJ22S/Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.2.14': + resolution: {integrity: sha512-V/h8ePq1fKDrmtFMz6xcCN3DKvuvMRrwwD1q0PkBeeo4DpK64biaKvqWGVxqCeYKqeRk7gE7/iKPxLCn08O97A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.2.14': + resolution: {integrity: sha512-WxalXzgrLVpKC93xfpaJ3gCXUWzeCr+FRCbDVD2mUAy4L6Vo3lNVz0epUEUpxPWJkLNYUwM4OSIikv36OJ9mLg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.2.14': + resolution: {integrity: sha512-3G3tnAmTpdk9jO3GQtyHXqeFD2SlecfTws/Y3M2mmj9nMBwwuLT4kur8sZKeu7ENUHSpVO3cIsm5A52LEWWwlg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.2.14': + resolution: {integrity: sha512-qyr5XiNGxm2ytx17vvtcJ9nXn6v1gENETi503bJx3OGwZ1tSonj7BosxbMa/xeAfSl5iS9X6KjEWYXLu6v1L7Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-win32-arm64-msvc@1.2.14': + resolution: {integrity: sha512-oA4o5o0S2yB199YyYXDzKUv1Z56Rc+mgOjwm7Z/vJ9Z8igiDPYvoOuDyo6g7AK/ZaF09nPhDKVnGBcYHO11GXA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.2.14': + resolution: {integrity: sha512-9mE94bf2GZUaR/fUSXCMpBoWkctu421Mi0ORpm4zqfbkjKep7RxzPFa5etcGs5h+2KApoWBOA/hAJa/7saGgEQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.1': + resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} + + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + + '@typescript/typescript-aix-ppc64@7.0.2': + resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [aix] + + '@typescript/typescript-darwin-arm64@7.0.2': + resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [darwin] + + '@typescript/typescript-darwin-x64@7.0.2': + resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [darwin] + + '@typescript/typescript-freebsd-arm64@7.0.2': + resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [freebsd] + + '@typescript/typescript-freebsd-x64@7.0.2': + resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [freebsd] + + '@typescript/typescript-linux-arm64@7.0.2': + resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [linux] + + '@typescript/typescript-linux-arm@7.0.2': + resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} + engines: {node: '>=16.20.0'} + cpu: [arm] + os: [linux] + + '@typescript/typescript-linux-loong64@7.0.2': + resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} + engines: {node: '>=16.20.0'} + cpu: [loong64] + os: [linux] + + '@typescript/typescript-linux-mips64el@7.0.2': + resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} + engines: {node: '>=16.20.0'} + cpu: [mips64el] + os: [linux] + + '@typescript/typescript-linux-ppc64@7.0.2': + resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [linux] + + '@typescript/typescript-linux-riscv64@7.0.2': + resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} + engines: {node: '>=16.20.0'} + cpu: [riscv64] + os: [linux] + + '@typescript/typescript-linux-s390x@7.0.2': + resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} + engines: {node: '>=16.20.0'} + cpu: [s390x] + os: [linux] + + '@typescript/typescript-linux-x64@7.0.2': + resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [linux] + + '@typescript/typescript-netbsd-arm64@7.0.2': + resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [netbsd] + + '@typescript/typescript-netbsd-x64@7.0.2': + resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [netbsd] + + '@typescript/typescript-openbsd-arm64@7.0.2': + resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [openbsd] + + '@typescript/typescript-openbsd-x64@7.0.2': + resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [openbsd] + + '@typescript/typescript-sunos-x64@7.0.2': + resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [sunos] + + '@typescript/typescript-win32-arm64@7.0.2': + resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [win32] + + '@typescript/typescript-win32-x64@7.0.2': + resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [win32] + + '@vitest/mocker@5.0.5': + resolution: {integrity: sha512-xLL3lkDegJZw+MGoGaCCsFayDZthGgpAtr3Vziyfc4p7xH89K7KRPcRBBh/kEYm0Aqkt5DtTmkYpBtRV/FrHZg==} + peerDependencies: + msw: ^2.4.9 || ^3.0.0 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/spy@5.0.5': + resolution: {integrity: sha512-lwJRExuH417257Q5wv9QYugN9IMJkoxcrKrYxGPQkBzl7wlNpTUxD/5yNX4ESKVUIShKPgkGchYPFMWOOk0wzw==} + + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + + chai@6.3.0: + resolution: {integrity: sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==} + engines: {node: '>=18'} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + es-module-lexer@2.3.2: + resolution: {integrity: sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==} + + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + expect-type@1.4.0: + resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} + engines: {node: '>=12.0.0'} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + lightningcss-android-arm64@1.33.0: + resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.33.0: + resolution: {integrity: sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.33.0: + resolution: {integrity: sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.33.0: + resolution: {integrity: sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.33.0: + resolution: {integrity: sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.33.0: + resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.33.0: + resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.33.0: + resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.33.0: + resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.33.0: + resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.33.0: + resolution: {integrity: sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.33.0: + resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==} + engines: {node: '>= 12.0.0'} + + magic-string@1.4.3: + resolution: {integrity: sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==} + + nanoid@3.3.20: + resolution: {integrity: sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + obug@3.0.0: + resolution: {integrity: sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==} + engines: {node: '>=12.20.0'} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + postcss@8.5.30: + resolution: {integrity: sha512-zkd+e9S1AQHhmaBKye9zlFHWjOwVgqXl1q3ECYy8561K7qxR2cREf/STLskulBFd78k6AOFeA+ff1TtEzk9bAA==} + engines: {node: ^10 || ^12 || >=14} + + rolldown@1.2.14: + resolution: {integrity: sha512-eTBTTqMR6uHKLgcUqpJP8ntzDI6V4LYA8negAMBEI7gkgVvOdrx6VsvS2Ym+83KhOPdLCHWJu0w7UQFJZhHKNw==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + source-map-js@1.2.2: + resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} + engines: {node: '>=0.10.0'} + + std-env@4.3.0: + resolution: {integrity: sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==} + + tinybench@6.2.2: + resolution: {integrity: sha512-nIZ2N2dFpjBsg2hgitKu7mA+FvsIJuGJOwysRngmVRRmWgR/UyPjwJj8c/fT/dhm8EkHnF5EOogRf+0Z2qrimA==} + engines: {node: '>=20.0.0'} + + tinyexec@1.3.1: + resolution: {integrity: sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==} + engines: {node: '>=18'} + + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + + typescript@7.0.2: + resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} + engines: {node: '>=16.20.0'} + hasBin: true + + vite@8.3.4: + resolution: {integrity: sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.7.1 + esbuild: ^0.27.0 || ^0.28.0 + jiti: '>=1.21.0' + less: ^4.0.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@5.0.5: + resolution: {integrity: sha512-cPODOMF8YnkiiYtDdHo6n4wWmBrOBBbOIYH2d33M4l3CdNn72h+qMmO6uXffUN6A5AZFXNND/d+krS9mgkXRfg==} + engines: {node: ^22.12.0 || ^24.0.0 || >=26.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@opentelemetry/api': ^1.9.0 + '@types/node': ^22.0.0 || >=24.0.0 + '@vitest/browser-playwright': 5.0.5 + '@vitest/browser-preview': 5.0.5 + '@vitest/browser-webdriverio': ^5.0.0-beta.5 || >=5.0.0 + '@vitest/coverage-istanbul': 5.0.5 + '@vitest/coverage-v8': 5.0.5 + '@vitest/ui': 5.0.5 + happy-dom: '*' + jsdom: '*' + vite: ^6.4.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@opentelemetry/api': + optional: true + '@types/node': + optional: true + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': + optional: true + '@vitest/coverage-istanbul': + optional: true + '@vitest/coverage-v8': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + why-is-node-running@3.2.1: + resolution: {integrity: sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==} + engines: {node: '>=20.11'} + hasBin: true + +snapshots: + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.6.0 + + '@oxc-project/types@0.154.0': {} + + '@rolldown/binding-android-arm-eabi@1.2.14': + optional: true + + '@rolldown/binding-android-arm64@1.2.14': + optional: true + + '@rolldown/binding-darwin-arm64@1.2.14': + optional: true + + '@rolldown/binding-darwin-x64@1.2.14': + optional: true + + '@rolldown/binding-freebsd-x64@1.2.14': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.2.14': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.2.14': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.2.14': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.2.14': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.2.14': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.2.14': + optional: true + + '@rolldown/binding-linux-x64-musl@1.2.14': + optional: true + + '@rolldown/binding-openharmony-arm64@1.2.14': + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.2.14': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.2.14': + optional: true + + '@rolldown/pluginutils@1.0.1': {} + + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.9': {} + + '@typescript/typescript-aix-ppc64@7.0.2': + optional: true + + '@typescript/typescript-darwin-arm64@7.0.2': + optional: true + + '@typescript/typescript-darwin-x64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-x64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm@7.0.2': + optional: true + + '@typescript/typescript-linux-loong64@7.0.2': + optional: true + + '@typescript/typescript-linux-mips64el@7.0.2': + optional: true + + '@typescript/typescript-linux-ppc64@7.0.2': + optional: true + + '@typescript/typescript-linux-riscv64@7.0.2': + optional: true + + '@typescript/typescript-linux-s390x@7.0.2': + optional: true + + '@typescript/typescript-linux-x64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-sunos-x64@7.0.2': + optional: true + + '@typescript/typescript-win32-arm64@7.0.2': + optional: true + + '@typescript/typescript-win32-x64@7.0.2': + optional: true + + '@vitest/mocker@5.0.5(vite@8.3.4)': + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + '@vitest/spy': 5.0.5 + estree-walker: 3.0.3 + magic-string: 1.4.3 + optionalDependencies: + vite: 8.3.4 + + '@vitest/spy@5.0.5': {} + + assertion-error@2.0.1: {} + + chai@6.3.0: {} + + detect-libc@2.1.2: {} + + es-module-lexer@2.3.2: {} + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.9 + + expect-type@1.4.0: {} + + fdir@6.5.0(picomatch@4.0.7): + optionalDependencies: + picomatch: 4.0.7 + + fsevents@2.3.3: + optional: true + + lightningcss-android-arm64@1.33.0: + optional: true + + lightningcss-darwin-arm64@1.33.0: + optional: true + + lightningcss-darwin-x64@1.33.0: + optional: true + + lightningcss-freebsd-x64@1.33.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.33.0: + optional: true + + lightningcss-linux-arm64-gnu@1.33.0: + optional: true + + lightningcss-linux-arm64-musl@1.33.0: + optional: true + + lightningcss-linux-x64-gnu@1.33.0: + optional: true + + lightningcss-linux-x64-musl@1.33.0: + optional: true + + lightningcss-win32-arm64-msvc@1.33.0: + optional: true + + lightningcss-win32-x64-msvc@1.33.0: + optional: true + + lightningcss@1.33.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.33.0 + lightningcss-darwin-arm64: 1.33.0 + lightningcss-darwin-x64: 1.33.0 + lightningcss-freebsd-x64: 1.33.0 + lightningcss-linux-arm-gnueabihf: 1.33.0 + lightningcss-linux-arm64-gnu: 1.33.0 + lightningcss-linux-arm64-musl: 1.33.0 + lightningcss-linux-x64-gnu: 1.33.0 + lightningcss-linux-x64-musl: 1.33.0 + lightningcss-win32-arm64-msvc: 1.33.0 + lightningcss-win32-x64-msvc: 1.33.0 + + magic-string@1.4.3: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + nanoid@3.3.20: {} + + obug@3.0.0: {} + + picocolors@1.1.1: {} + + picomatch@4.0.7: {} + + postcss@8.5.30: + dependencies: + nanoid: 3.3.20 + picocolors: 1.1.1 + source-map-js: 1.2.2 + + rolldown@1.2.14: + dependencies: + '@oxc-project/types': 0.154.0 + '@rolldown/pluginutils': 1.0.1 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.2.14 + '@rolldown/binding-android-arm64': 1.2.14 + '@rolldown/binding-darwin-arm64': 1.2.14 + '@rolldown/binding-darwin-x64': 1.2.14 + '@rolldown/binding-freebsd-x64': 1.2.14 + '@rolldown/binding-linux-arm-gnueabihf': 1.2.14 + '@rolldown/binding-linux-arm64-gnu': 1.2.14 + '@rolldown/binding-linux-arm64-musl': 1.2.14 + '@rolldown/binding-linux-ppc64-gnu': 1.2.14 + '@rolldown/binding-linux-s390x-gnu': 1.2.14 + '@rolldown/binding-linux-x64-gnu': 1.2.14 + '@rolldown/binding-linux-x64-musl': 1.2.14 + '@rolldown/binding-openharmony-arm64': 1.2.14 + '@rolldown/binding-win32-arm64-msvc': 1.2.14 + '@rolldown/binding-win32-x64-msvc': 1.2.14 + + source-map-js@1.2.2: {} + + std-env@4.3.0: {} + + tinybench@6.2.2: {} + + tinyexec@1.3.1: {} + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 + + typescript@7.0.2: + optionalDependencies: + '@typescript/typescript-aix-ppc64': 7.0.2 + '@typescript/typescript-darwin-arm64': 7.0.2 + '@typescript/typescript-darwin-x64': 7.0.2 + '@typescript/typescript-freebsd-arm64': 7.0.2 + '@typescript/typescript-freebsd-x64': 7.0.2 + '@typescript/typescript-linux-arm': 7.0.2 + '@typescript/typescript-linux-arm64': 7.0.2 + '@typescript/typescript-linux-loong64': 7.0.2 + '@typescript/typescript-linux-mips64el': 7.0.2 + '@typescript/typescript-linux-ppc64': 7.0.2 + '@typescript/typescript-linux-riscv64': 7.0.2 + '@typescript/typescript-linux-s390x': 7.0.2 + '@typescript/typescript-linux-x64': 7.0.2 + '@typescript/typescript-netbsd-arm64': 7.0.2 + '@typescript/typescript-netbsd-x64': 7.0.2 + '@typescript/typescript-openbsd-arm64': 7.0.2 + '@typescript/typescript-openbsd-x64': 7.0.2 + '@typescript/typescript-sunos-x64': 7.0.2 + '@typescript/typescript-win32-arm64': 7.0.2 + '@typescript/typescript-win32-x64': 7.0.2 + + vite@8.3.4: + dependencies: + lightningcss: 1.33.0 + picomatch: 4.0.7 + postcss: 8.5.30 + rolldown: 1.2.14 + tinyglobby: 0.2.17 + optionalDependencies: + fsevents: 2.3.3 + + vitest@5.0.5(vite@8.3.4): + dependencies: + '@types/chai': 5.2.3 + '@vitest/mocker': 5.0.5(vite@8.3.4) + chai: 6.3.0 + es-module-lexer: 2.3.2 + expect-type: 1.4.0 + magic-string: 1.4.3 + obug: 3.0.0 + picomatch: 4.0.7 + std-env: 4.3.0 + tinybench: 6.2.2 + tinyexec: 1.3.1 + tinyglobby: 0.2.17 + vite: 8.3.4 + why-is-node-running: 3.2.1 + transitivePeerDependencies: + - msw + + why-is-node-running@3.2.1: {} diff --git a/src/api.ts b/src/api.ts new file mode 100644 index 0000000..2e1d6f1 --- /dev/null +++ b/src/api.ts @@ -0,0 +1,132 @@ +import type { + Booking, + PaymentAcknowledgmentPayload, + PaymentRecord, +} from "./types"; + +const API_BASE_URL = + import.meta.env.VITE_API_BASE_URL || "http://localhost:8000"; +const ADMIN_API_KEY = + import.meta.env.VITE_ADMIN_API_KEY || "dev-secret-key-change-in-production"; +const ADMIN_EMAIL = "jasmin@armoniadelser.mx"; + +function getAuthHeaders(): HeadersInit { + return { + "Content-Type": "application/json", + "X-Admin-Key": ADMIN_API_KEY, + "X-Admin-Email": ADMIN_EMAIL, + }; +} + +export async function fetchFollowUpQueue(): Promise { + const res = await fetch(`${API_BASE_URL}/bookings/follow-up-queue`, { + headers: getAuthHeaders(), + }); + if (!res.ok) { + throw new Error( + `Error al obtener cola de seguimiento: ${res.status} ${res.statusText}`, + ); + } + return res.json(); +} + +export async function fetchAllBookings(params?: { + date?: string; + booking_status?: string; + payment_status?: string; +}): Promise { + const query = new URLSearchParams(); + if (params?.date) query.set("date", params.date); + if (params?.booking_status) + query.set("booking_status", params.booking_status); + if (params?.payment_status) + query.set("payment_status", params.payment_status); + + const url = `${API_BASE_URL}/bookings${query.toString() ? `?${query.toString()}` : ""}`; + const res = await fetch(url, { + headers: getAuthHeaders(), + }); + if (!res.ok) { + throw new Error( + `Error al obtener reservaciones: ${res.status} ${res.statusText}`, + ); + } + return res.json(); +} + +export async function acknowledgePayment( + payload: PaymentAcknowledgmentPayload, +): Promise { + const res = await fetch(`${API_BASE_URL}/payments/acknowledge`, { + method: "POST", + headers: getAuthHeaders(), + body: JSON.stringify(payload), + }); + if (!res.ok) { + const errData = await res.json().catch(() => ({})); + throw new Error( + errData.detail || + `Error al acreditar pago: ${res.status} ${res.statusText}`, + ); + } + return res.json(); +} + +export async function authorizeDelayedPayment( + bookingId: string, + notes?: string, +): Promise { + const res = await fetch( + `${API_BASE_URL}/bookings/${bookingId}/authorize-delayed-payment`, + { + method: "POST", + headers: getAuthHeaders(), + body: JSON.stringify({ notes }), + }, + ); + if (!res.ok) { + const errData = await res.json().catch(() => ({})); + throw new Error( + errData.detail || + `Error al autorizar prórroga: ${res.status} ${res.statusText}`, + ); + } + return res.json(); +} + +export async function releaseBooking( + bookingId: string, + reason?: string, +): Promise { + const res = await fetch(`${API_BASE_URL}/bookings/${bookingId}/release`, { + method: "POST", + headers: getAuthHeaders(), + body: JSON.stringify({ reason }), + }); + if (!res.ok) { + const errData = await res.json().catch(() => ({})); + throw new Error( + errData.detail || + `Error al liberar espacio: ${res.status} ${res.statusText}`, + ); + } + return res.json(); +} + +export async function retryCalendarSync(bookingId: string): Promise { + const res = await fetch( + `${API_BASE_URL}/bookings/${bookingId}/sync-calendar`, + { + method: "POST", + headers: getAuthHeaders(), + }, + ); + if (!res.ok) { + const errData = await res.json().catch(() => ({})); + throw new Error( + errData.detail || + `Error al sincronizar calendario: ${res.status} ${res.statusText}`, + ); + } + return res.json(); +} diff --git a/src/components/AllBookings.ts b/src/components/AllBookings.ts new file mode 100644 index 0000000..e86df73 --- /dev/null +++ b/src/components/AllBookings.ts @@ -0,0 +1,138 @@ +import { fetchAllBookings } from "../api"; +import type { Booking } from "../types"; +import { formatCurrency, formatDateTime } from "../utils"; +import { + renderBookingStatusBadge, + renderCalendarSyncBadge, + renderPaymentStatusBadge, +} from "./StatusBadge"; + +export function renderAllBookings(container: HTMLElement): void { + container.innerHTML = ` +
+
+

Historial General de Reservaciones

+

Registro completo de citas, cancelaciones y liberaciones de espacio.

+
+
+ +
+
+ +
+ + +
+ +
+
+
+
+
+ `; + + const contentDiv = container.querySelector( + "#all-bookings-content", + ); + const statusSelect = + container.querySelector("#status-filter"); + const refreshBtn = + container.querySelector("#refresh-all-btn"); + + let cachedBookings: Booking[] = []; + + const loadData = async () => { + if (!contentDiv) return; + contentDiv.innerHTML = ` +
+
+
+ `; + + try { + cachedBookings = await fetchAllBookings(); + applyFilter(); + } catch (err: unknown) { + contentDiv.innerHTML = ` +
+
⚠️
+

Error al cargar reservaciones

+

${err instanceof Error ? err.message : "Error desconocido"}

+
+ `; + } + }; + + const applyFilter = () => { + if (!contentDiv) return; + const filter = statusSelect?.value || "ALL"; + + const filtered = + filter === "ALL" + ? cachedBookings + : cachedBookings.filter((b) => b.booking_status === filter); + + if (filtered.length === 0) { + contentDiv.innerHTML = ` +
+
🔍
+

Sin resultados

+

No se encontraron reservaciones con el filtro seleccionado.

+
+ `; + return; + } + + contentDiv.innerHTML = ` +
+ + + + + + + + + + + + + + + ${filtered + .map( + (b) => ` + + + + + + + + + + + `, + ) + .join("")} + +
FolioPacienteServicioHorarioMontoEstadoPagoGoogle Cal
${b.booking_code} +
${b.client_name || "Cliente"}
+
📱 ${b.client_phone || ""}
+
${b.service_name || "Consulta"}${formatDateTime(b.scheduled_at)}${formatCurrency(b.amount_mxn)}${renderBookingStatusBadge(b.booking_status)}${renderPaymentStatusBadge(b.payment_status, b.payment_arrangement)}${renderCalendarSyncBadge(b.gcal_sync_status, b.id)}
+
+ `; + }; + + statusSelect?.addEventListener("change", () => applyFilter()); + refreshBtn?.addEventListener("click", () => loadData()); + loadData(); +} diff --git a/src/components/DailyAgenda.ts b/src/components/DailyAgenda.ts new file mode 100644 index 0000000..5a5bc3d --- /dev/null +++ b/src/components/DailyAgenda.ts @@ -0,0 +1,227 @@ +import { fetchAllBookings, retryCalendarSync } from "../api"; +import type { Booking } from "../types"; +import { calculateInterval, formatCurrency, formatDateTime } from "../utils"; +import { + renderBookingStatusBadge, + renderCalendarSyncBadge, + renderPaymentStatusBadge, +} from "./StatusBadge"; + +export function renderDailyAgenda( + container: HTMLElement, + onStateChange: () => void, +): void { + container.innerHTML = ` +
+
+

Agenda & Control de Capacidad

+

Visualización cronológica con protección de buffers de 15 min entre pacientes.

+
+
+ +
+
+ +
+ +
+
+
+
+
+
+ `; + + const contentDiv = container.querySelector("#agenda-content"); + const statsDiv = container.querySelector("#agenda-stats"); + const refreshBtn = container.querySelector( + "#refresh-agenda-btn", + ); + + const loadData = async () => { + if (!contentDiv) return; + contentDiv.innerHTML = ` +
+
+
+ `; + + try { + const bookings = await fetchAllBookings(); + // Filter active bookings and sort chronologically + const activeBookings = bookings + .filter( + (b) => + b.booking_status !== "CANCELLED" && b.booking_status !== "RELEASED", + ) + .sort( + (a, b) => + new Date(a.scheduled_at).getTime() - + new Date(b.scheduled_at).getTime(), + ); + + renderStats(activeBookings); + renderTimeline(activeBookings); + } catch (err: unknown) { + if (contentDiv) { + contentDiv.innerHTML = ` +
+
⚠️
+

Error al cargar la agenda

+

${err instanceof Error ? err.message : "Error desconocido"}

+
+ `; + } + } + }; + + const renderStats = (bookings: Booking[]) => { + if (!statsDiv) return; + const total = bookings.length; + const confirmed = bookings.filter( + (b) => b.payment_status === "ACKNOWLEDGED", + ).length; + const pending = bookings.filter( + (b) => b.payment_status === "AWAITING_ACKNOWLEDGMENT", + ).length; + const totalMinutes = bookings.reduce( + (acc, b) => acc + (b.duration_minutes || 60) + (b.buffer_minutes || 15), + 0, + ); + const totalHours = (totalMinutes / 60).toFixed(1); + + statsDiv.innerHTML = ` +
+ Citas Programadas + ${total} +
+
+ Pagos Confirmados + ${confirmed} +
+
+ Pendientes / Prórroga + ${pending} +
+
+ Tiempo Ocupado + Buffer + ${totalHours}h +
+ `; + }; + + const renderTimeline = (bookings: Booking[]) => { + if (!contentDiv) return; + + if (bookings.length === 0) { + contentDiv.innerHTML = ` +
+
📅
+

Agenda libre

+

No hay citas activas programadas en este momento.

+
+ `; + return; + } + + contentDiv.innerHTML = ` +
+ ${bookings + .map((b, idx) => { + const interval = calculateInterval( + b.scheduled_at, + b.duration_minutes || 60, + b.buffer_minutes || 15, + ); + + // Collision detector with subsequent session + let collisionNotice = ""; + if (idx < bookings.length - 1) { + const nextBooking = bookings[idx + 1]; + const nextStart = new Date(nextBooking.scheduled_at); + if (nextStart < interval.bufferEnd) { + collisionNotice = ` +
+ ⚠️ ADVERTENCIA: La siguiente cita (${nextBooking.booking_code}) inicia a las ${interval.endStr}, invadiendo el buffer de preparación. +
+ `; + } + } + + return ` +
+
+ ${interval.startStr} + a ${interval.endStr} + ${b.duration_minutes || 60} min +
+ +
+
+
+ ${b.booking_code} + ${b.service_name || "Consulta"} +
+
+ ${renderBookingStatusBadge(b.booking_status)} +
+
+ +
+
+ ${b.client_name || "Cliente"} + 📱 ${b.client_phone || ""} +
+
+ ${formatDateTime(b.scheduled_at)} + ${formatCurrency(b.amount_mxn)} +
+
+ ${renderPaymentStatusBadge(b.payment_status, b.payment_arrangement)} + ${renderCalendarSyncBadge(b.gcal_sync_status, b.id)} +
+
+ + +
+
+ 🌿 Buffer de descanso y preparación (${b.buffer_minutes || 15} min): + ${interval.endStr} - ${interval.bufferEndStr} +
+ Tiempo no agendable protegido por el backend. +
+ + ${collisionNotice} +
+
+ `; + }) + .join("")} +
+ `; + + // Attach retry calendar sync buttons + contentDiv.querySelectorAll(".btn-retry-gcal").forEach((btn) => { + btn.addEventListener("click", async () => { + const id = btn.getAttribute("data-booking-id"); + if (!id) return; + btn.textContent = "⏳..."; + try { + await retryCalendarSync(id); + loadData(); + onStateChange(); + } catch (err: unknown) { + alert( + err instanceof Error ? err.message : "Error al reintentar sync", + ); + btn.textContent = "↻"; + } + }); + }); + }; + + refreshBtn?.addEventListener("click", () => loadData()); + loadData(); +} diff --git a/src/components/FollowUpQueue.ts b/src/components/FollowUpQueue.ts new file mode 100644 index 0000000..5b4fc18 --- /dev/null +++ b/src/components/FollowUpQueue.ts @@ -0,0 +1,269 @@ +import { + authorizeDelayedPayment, + fetchFollowUpQueue, + releaseBooking, +} from "../api"; +import type { Booking } from "../types"; +import { + formatCurrency, + formatDateTime, + getHoursRemainingBadge, +} from "../utils"; +import { openPaymentModal } from "./PaymentModal"; +import { + renderBookingStatusBadge, + renderCalendarSyncBadge, + renderPaymentStatusBadge, +} from "./StatusBadge"; + +export function renderFollowUpQueue( + container: HTMLElement, + onStateChange: () => void, +): void { + container.innerHTML = ` +
+
+

Cola de Seguimiento (48 Horas)

+

Reservaciones pendientes de comprobante de pago próximas a realizarse.

+
+
+ +
+
+ +
+
+
+
+
+
+ `; + + const contentDiv = container.querySelector("#queue-content"); + const refreshBtn = + container.querySelector("#refresh-queue-btn"); + + const loadData = async () => { + if (!contentDiv) return; + contentDiv.innerHTML = ` +
+
+
+
+ `; + + try { + const bookings = await fetchFollowUpQueue(); + renderList(bookings); + } catch (err: unknown) { + renderError(err instanceof Error ? err.message : "Error desconocido"); + } + }; + + const renderError = (message: string) => { + if (!contentDiv) return; + contentDiv.innerHTML = ` +
+
⚠️
+

No se pudo cargar la cola de seguimiento

+

${message}

+ +
+ `; + contentDiv + .querySelector("#retry-queue-btn") + ?.addEventListener("click", () => loadData()); + }; + + const renderList = (bookings: Booking[]) => { + if (!contentDiv) return; + + if (bookings.length === 0) { + contentDiv.innerHTML = ` +
+
🌿
+

Agenda al día

+

No hay reservaciones pendientes de pago para las próximas 48 horas.

+
+ `; + return; + } + + contentDiv.innerHTML = ` +
+ ${bookings.length} reservación${bookings.length === 1 ? "" : "es"} por atender +
+
+ ${bookings.map((b) => renderCard(b)).join("")} +
+ `; + + attachEvents(bookings); + }; + + const renderCard = (b: Booking): string => { + const hoursBadge = getHoursRemainingBadge(b.hours_until_session); + const waLink = + b.whatsapp_followup_url || + `https://wa.me/${b.client_phone?.replace(/\D/g, "") || ""}?text=${encodeURIComponent( + `Hola ${b.client_name || ""}, te contactamos de Armonía del Ser para dar seguimiento a tu reservación (${b.booking_code}).`, + )}`; + + return ` +
+
+
+ ${b.booking_code} + + ${hoursBadge.text} + +
+
+ ${renderBookingStatusBadge(b.booking_status)} +
+
+ +
+
+

${b.client_name || "Cliente sin nombre"}

+ 📱 ${b.client_phone || "Sin teléfono"} +
+ +
+
+ Servicio: + ${b.service_name || "Consulta"} +
+
+ Fecha y Hora: + ${formatDateTime(b.scheduled_at)} +
+
+ Monto: + ${formatCurrency(b.amount_mxn)} +
+
+ +
+ ${renderPaymentStatusBadge(b.payment_status, b.payment_arrangement)} + ${renderCalendarSyncBadge(b.gcal_sync_status, b.id)} +
+
+ +
+ + 💬 Enviar WhatsApp + + + + +
+ + · + +
+
+
+ `; + }; + + const attachEvents = (bookings: Booking[]) => { + if (!contentDiv) return; + + // Acknowledge payment modal + contentDiv.querySelectorAll(".btn-ack-payment").forEach((btn) => { + btn.addEventListener("click", () => { + const id = btn.getAttribute("data-booking-id"); + const booking = bookings.find((b) => b.id === id); + if (!booking) return; + + openPaymentModal({ + booking, + onSuccess: () => { + loadData(); + onStateChange(); + }, + }); + }); + }); + + // Authorize delayed payment + contentDiv.querySelectorAll(".btn-authorize-delay").forEach((btn) => { + btn.addEventListener("click", async () => { + const id = btn.getAttribute("data-booking-id"); + if (!id) return; + const notes = window.prompt( + "Motivo o acuerdo de la prórroga de pago:", + "Acordado con el paciente para pago en efectivo antes de la sesión", + ); + if (notes === null) return; + + try { + await authorizeDelayedPayment(id, notes); + loadData(); + onStateChange(); + } catch (err: unknown) { + alert( + err instanceof Error ? err.message : "Error al autorizar prórroga", + ); + } + }); + }); + + // Release booking + contentDiv.querySelectorAll(".btn-release-slot").forEach((btn) => { + btn.addEventListener("click", async () => { + const id = btn.getAttribute("data-booking-id"); + if (!id) return; + const reason = window.prompt( + "¿Deseas liberar este horario para otros clientes? Motivo:", + "Sin respuesta a recordatorios de pago dentro de las 48h", + ); + if (reason === null) return; + + try { + await releaseBooking(id, reason); + loadData(); + onStateChange(); + } catch (err: unknown) { + alert( + err instanceof Error ? err.message : "Error al liberar espacio", + ); + } + }); + }); + }; + + refreshBtn?.addEventListener("click", () => loadData()); + loadData(); +} diff --git a/src/components/PaymentModal.ts b/src/components/PaymentModal.ts new file mode 100644 index 0000000..d9dd383 --- /dev/null +++ b/src/components/PaymentModal.ts @@ -0,0 +1,181 @@ +import type { Booking } from "../types"; +import { formatCurrency } from "../utils"; + +export interface PaymentModalOptions { + booking: Booking; + onConfirm: (payload: { + booking_id: string; + amount_mxn: number; + payment_method: "SPEI" | "OXXO" | "CASH"; + notes?: string; + }) => Promise; + onCancel: () => void; +} + +export function openPaymentModal(options: { + booking: Booking; + onSuccess: () => void; +}): void { + const { booking, onSuccess } = options; + + const existingModal = document.getElementById("payment-modal-backdrop"); + if (existingModal) existingModal.remove(); + + const backdrop = document.createElement("div"); + backdrop.id = "payment-modal-backdrop"; + backdrop.className = "modal-backdrop"; + + backdrop.innerHTML = ` + + `; + + document.body.appendChild(backdrop); + + const close = () => { + backdrop.remove(); + document.removeEventListener("keydown", handleKeyDown); + }; + + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === "Escape") close(); + }; + document.addEventListener("keydown", handleKeyDown); + + backdrop + .querySelector("#modal-close") + ?.addEventListener("click", () => close()); + backdrop + .querySelector("#modal-cancel-btn") + ?.addEventListener("click", () => close()); + backdrop.addEventListener("click", (e) => { + if (e.target === backdrop) close(); + }); + + const form = backdrop.querySelector("#payment-form"); + const submitBtn = + backdrop.querySelector("#modal-submit-btn"); + const errorBox = backdrop.querySelector("#modal-error-box"); + + form?.addEventListener("submit", async (e) => { + e.preventDefault(); + if (!submitBtn || !errorBox) return; + + submitBtn.disabled = true; + submitBtn.textContent = "Acreditando..."; + errorBox.classList.add("hidden"); + errorBox.textContent = ""; + + const amountInput = form.querySelector("#payment-amount"); + const notesInput = form.querySelector("#payment-notes"); + const methodInput = form.querySelector( + 'input[name="payment_method"]:checked', + ); + + const amount = Number(amountInput?.value || booking.amount_mxn); + const method = (methodInput?.value as "SPEI" | "OXXO" | "CASH") || "SPEI"; + const notes = notesInput?.value.trim() || undefined; + + try { + const { acknowledgePayment } = await import("../api"); + await acknowledgePayment({ + booking_id: booking.id, + amount_mxn: amount, + payment_method: method, + notes, + }); + close(); + onSuccess(); + } catch (err: unknown) { + submitBtn.disabled = false; + submitBtn.textContent = "Confirmar Acreditación"; + errorBox.textContent = + err instanceof Error ? err.message : "Error al procesar el pago"; + errorBox.classList.remove("hidden"); + } + }); +} diff --git a/src/components/StatusBadge.ts b/src/components/StatusBadge.ts new file mode 100644 index 0000000..5a289a2 --- /dev/null +++ b/src/components/StatusBadge.ts @@ -0,0 +1,63 @@ +import type { + BookingPaymentStatus, + BookingStatus, + GcalSyncStatus, + PaymentArrangement, +} from "../types"; + +export function renderBookingStatusBadge(status: BookingStatus): string { + switch (status) { + case "RESERVED": + return 'Reservada'; + case "COMPLETED": + return 'Completada'; + case "CANCELLED": + return 'Cancelada'; + case "RELEASED": + return 'Espacio Liberado'; + case "NO_SHOW": + return 'No asistió'; + default: + return `${status}`; + } +} + +export function renderPaymentStatusBadge( + paymentStatus: BookingPaymentStatus, + arrangement: PaymentArrangement, +): string { + if (arrangement === "PACKAGE_REDEEMED") { + return 'Sesión de Paquete'; + } + + if (paymentStatus === "ACKNOWLEDGED") { + return '✓ Pago Confirmado'; + } + + if (arrangement === "DELAYED_ALLOWED") { + return '⏳ Prórroga Autorizada'; + } + + return '⚠️ Pago Pendiente'; +} + +export function renderCalendarSyncBadge( + syncStatus: GcalSyncStatus, + bookingId: string, +): string { + switch (syncStatus) { + case "SYNCED": + return '📅 En Google Calendar'; + case "FAILED": + return ` +
+ ⚠️ Error Cal + +
+ `; + case "PENDING": + return '⏳ Sincronizando...'; + default: + return 'Cal no config'; + } +} diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..08e316c --- /dev/null +++ b/src/main.ts @@ -0,0 +1,131 @@ +import "./style.css"; +import { fetchFollowUpQueue } from "./api"; +import { renderAllBookings } from "./components/AllBookings"; +import { renderDailyAgenda } from "./components/DailyAgenda"; +import { renderFollowUpQueue } from "./components/FollowUpQueue"; + +type TabId = "queue" | "agenda" | "all"; + +class OperatorDashboardApp { + private activeTab: TabId = "queue"; + private container: HTMLElement; + + public get currentTab(): TabId { + return this.activeTab; + } + + constructor(container: HTMLElement) { + this.container = container; + this.init(); + } + + private async init(): Promise { + this.renderShell(); + this.bindEvents(); + await this.refreshTabBadge(); + const hash = window.location.hash.replace("#", "") as TabId; + const initialTab = hash === "agenda" || hash === "all" ? hash : "queue"; + this.switchTab(initialTab); + } + + private renderShell(): void { + this.container.innerHTML = ` +
+
+ 🪷 +
+

Armonía del Ser

+
Panel Operativo de Consultas y Agenda
+
+ Operador +
+
+
+ + Jasmin & Asistente +
+
+
+ + + +
+ `; + } + + private bindEvents(): void { + const tabButtons = + this.container.querySelectorAll(".nav-tab"); + tabButtons.forEach((btn) => { + btn.addEventListener("click", () => { + const targetTab = btn.getAttribute("data-tab") as TabId; + if (targetTab) { + this.switchTab(targetTab); + } + }); + }); + } + + private switchTab(tab: TabId): void { + this.activeTab = tab; + + // Update tab button active states + const tabButtons = + this.container.querySelectorAll(".nav-tab"); + tabButtons.forEach((btn) => { + const isCurrent = btn.getAttribute("data-tab") === tab; + btn.classList.toggle("active", isCurrent); + btn.setAttribute("aria-selected", isCurrent ? "true" : "false"); + }); + + // Render tab view + const contentEl = this.container.querySelector("#tab-content"); + if (!contentEl) return; + + const onStateChange = async () => { + await this.refreshTabBadge(); + }; + + if (tab === "queue") { + renderFollowUpQueue(contentEl, onStateChange); + } else if (tab === "agenda") { + renderDailyAgenda(contentEl, onStateChange); + } else if (tab === "all") { + renderAllBookings(contentEl); + } + } + + private async refreshTabBadge(): Promise { + try { + const queue = await fetchFollowUpQueue(); + const badge = + this.container.querySelector("#queue-badge"); + if (badge) { + if (queue.length > 0) { + badge.textContent = String(queue.length); + badge.classList.remove("hidden"); + } else { + badge.classList.add("hidden"); + } + } + } catch { + // Ignore badge background fetch failure + } + } +} + +const appRoot = document.getElementById("app"); +if (appRoot) { + new OperatorDashboardApp(appRoot); +} diff --git a/src/style.css b/src/style.css new file mode 100644 index 0000000..fa998f5 --- /dev/null +++ b/src/style.css @@ -0,0 +1,930 @@ +:root { + --color-bg: #f9f7f3; + --color-surface: #ffffff; + --color-surface-soft: #f2efe9; + --color-text-main: #1d2a24; + --color-text-muted: #5e6d66; + --color-border: #e5dfd5; + --color-border-focus: #2d5a46; + + /* Brand Palette: Armonía del Ser */ + --color-sage: #2d5a46; + --color-sage-dark: #1e3e30; + --color-sage-light: #ebf3ee; + --color-terracotta: #c25e3b; + --color-terracotta-light: #fbefea; + --color-gold: #b8860b; + --color-gold-light: #fbf6e9; + --color-success: #1e7e4e; + --color-success-light: #e8f5ed; + --color-danger: #c53030; + --color-danger-light: #fde8e8; + --color-warning: #d97706; + --color-warning-light: #fef3c7; + + --font-serif: "Playfair Display", Georgia, "Times New Roman", serif; + --font-sans: + -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, + sans-serif; + --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; + + --radius-sm: 6px; + --radius-md: 10px; + --radius-lg: 16px; + --shadow-sm: 0 1px 3px rgba(29, 42, 36, 0.05); + --shadow-md: 0 4px 12px rgba(29, 42, 36, 0.08); + --shadow-lg: 0 10px 25px rgba(29, 42, 36, 0.12); +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + font-family: var(--font-sans); + background-color: var(--color-bg); + color: var(--color-text-main); + line-height: 1.5; + -webkit-font-smoothing: antialiased; +} + +/* Layout */ +.app-container { + max-width: 1100px; + margin: 0 auto; + padding: 16px; + min-height: 100vh; + display: flex; + flex-direction: column; +} + +/* Header */ +.app-header { + display: flex; + flex-direction: column; + gap: 12px; + padding: 16px 0 20px 0; + border-bottom: 1px solid var(--color-border); + margin-bottom: 20px; +} + +@media (min-width: 640px) { + .app-header { + flex-direction: row; + justify-content: space-between; + align-items: center; + } +} + +.brand-section { + display: flex; + align-items: center; + gap: 12px; +} + +.brand-lotus { + font-size: 28px; + line-height: 1; +} + +.brand-title { + font-family: var(--font-serif); + font-size: 22px; + font-weight: 600; + color: var(--color-sage-dark); + letter-spacing: -0.01em; +} + +.brand-badge { + font-size: 11px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.06em; + background: var(--color-sage-light); + color: var(--color-sage); + padding: 3px 8px; + border-radius: var(--radius-sm); + margin-left: 8px; +} + +.operator-badge { + display: inline-flex; + align-items: center; + gap: 6px; + font-size: 13px; + color: var(--color-text-muted); + background: var(--color-surface); + padding: 6px 12px; + border-radius: var(--radius-md); + border: 1px solid var(--color-border); +} + +.status-dot { + width: 8px; + height: 8px; + border-radius: 50%; + background-color: var(--color-success); +} + +/* Navigation Tabs */ +.nav-tabs { + display: flex; + gap: 8px; + border-bottom: 2px solid var(--color-border); + margin-bottom: 24px; + overflow-x: auto; + -webkit-overflow-scrolling: touch; +} + +.nav-tab { + background: none; + border: none; + padding: 12px 18px; + font-size: 15px; + font-weight: 500; + color: var(--color-text-muted); + cursor: pointer; + border-bottom: 2px solid transparent; + margin-bottom: -2px; + white-space: nowrap; + display: inline-flex; + align-items: center; + gap: 8px; + min-height: 48px; /* Touch target */ + transition: all 0.15s ease; +} + +.nav-tab:hover { + color: var(--color-sage); +} + +.nav-tab.active { + color: var(--color-sage); + font-weight: 600; + border-bottom-color: var(--color-sage); +} + +.tab-badge { + background: var(--color-terracotta); + color: #fff; + font-size: 11px; + font-weight: 700; + padding: 2px 7px; + border-radius: 999px; +} + +/* Views */ +.view-header { + display: flex; + justify-content: space-between; + align-items: flex-start; + margin-bottom: 20px; + gap: 12px; +} + +.view-title { + font-family: var(--font-serif); + font-size: 20px; + color: var(--color-text-main); + margin-bottom: 4px; +} + +.view-subtitle { + font-size: 14px; + color: var(--color-text-muted); +} + +/* Stats Row */ +.stats-row { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); + gap: 12px; + margin-bottom: 24px; +} + +.stat-card { + background: var(--color-surface); + border: 1px solid var(--color-border); + border-radius: var(--radius-md); + padding: 14px; + display: flex; + flex-direction: column; + gap: 4px; + box-shadow: var(--shadow-sm); +} + +.stat-label { + font-size: 12px; + color: var(--color-text-muted); + text-transform: uppercase; + font-weight: 600; + letter-spacing: 0.03em; +} + +.stat-number { + font-size: 22px; + font-weight: 700; + color: var(--color-text-main); +} + +/* Queue Grid */ +.queue-meta { + margin-bottom: 14px; +} + +.queue-count-pill { + display: inline-block; + font-size: 13px; + font-weight: 600; + background: var(--color-surface-soft); + color: var(--color-text-muted); + padding: 4px 10px; + border-radius: var(--radius-sm); +} + +.queue-grid { + display: grid; + grid-template-columns: 1fr; + gap: 16px; +} + +@media (min-width: 768px) { + .queue-grid { + grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); + } +} + +/* Booking Cards */ +.booking-card { + background: var(--color-surface); + border: 1px solid var(--color-border); + border-radius: var(--radius-lg); + padding: 16px; + display: flex; + flex-direction: column; + justify-content: space-between; + gap: 14px; + box-shadow: var(--shadow-sm); + transition: + transform 0.15s ease, + box-shadow 0.15s ease; +} + +.booking-card:hover { + box-shadow: var(--shadow-md); +} + +.card-header { + display: flex; + justify-content: space-between; + align-items: center; + border-bottom: 1px solid var(--color-border); + padding-bottom: 10px; + gap: 8px; +} + +.header-left { + display: flex; + align-items: center; + gap: 8px; + flex-wrap: wrap; +} + +.header-right { + display: flex; + align-items: center; + gap: 6px; +} + +.folio-tag { + font-family: var(--font-mono); + font-weight: 700; + font-size: 14px; + background: var(--color-surface-soft); + color: var(--color-text-main); + padding: 2px 8px; + border-radius: var(--radius-sm); + border: 1px solid var(--color-border); +} + +.client-name { + font-size: 16px; + font-weight: 600; + color: var(--color-text-main); +} + +.client-phone { + font-size: 13px; + color: var(--color-text-muted); +} + +.service-details { + display: flex; + flex-direction: column; + gap: 6px; + margin: 10px 0; + background: var(--color-bg); + padding: 10px 12px; + border-radius: var(--radius-sm); +} + +.detail-row { + display: flex; + justify-content: space-between; + font-size: 13px; +} + +.detail-label { + color: var(--color-text-muted); +} + +.status-row { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin-top: 4px; +} + +/* Status Pills */ +.status-pill { + display: inline-flex; + align-items: center; + font-size: 12px; + font-weight: 600; + padding: 3px 8px; + border-radius: var(--radius-sm); +} + +.status-reserved { + background: var(--color-sage-light); + color: var(--color-sage); +} +.status-completed { + background: var(--color-surface-soft); + color: var(--color-text-muted); +} +.status-cancelled { + background: #fee2e2; + color: #991b1b; +} +.status-released { + background: #fef3c7; + color: #92400e; +} +.status-acknowledged { + background: var(--color-success-light); + color: var(--color-success); + font-weight: 700; +} +.status-awaiting { + background: var(--color-terracotta-light); + color: var(--color-terracotta); + font-weight: 700; +} +.status-delayed { + background: var(--color-gold-light); + color: var(--color-gold); + font-weight: 700; +} +.status-package { + background: #ede9fe; + color: #5b21b6; +} + +.status-gcal-synced { + background: #e0f2fe; + color: #0369a1; +} +.status-gcal-failed { + background: var(--color-danger-light); + color: var(--color-danger); +} +.status-gcal-pending { + background: #f3f4f6; + color: #4b5563; +} +.status-gcal-none { + background: #f3f4f6; + color: #9ca3af; +} + +.badge-danger { + background: var(--color-danger-light); + color: var(--color-danger); +} +.badge-warning { + background: var(--color-warning-light); + color: var(--color-warning); +} +.badge-info { + background: var(--color-surface-soft); + color: var(--color-text-muted); +} + +/* Buttons & Touch Targets */ +.card-actions { + display: flex; + flex-direction: column; + gap: 8px; + border-top: 1px solid var(--color-border); + padding-top: 12px; +} + +.btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 6px; + padding: 10px 16px; + font-size: 14px; + font-weight: 600; + border-radius: var(--radius-md); + cursor: pointer; + border: 1px solid transparent; + text-decoration: none; + min-height: 44px; /* Mobile touch target */ + transition: + background 0.15s ease, + transform 0.05s ease; +} + +.btn:active { + transform: scale(0.98); +} + +.btn-primary { + background-color: var(--color-sage); + color: #ffffff; +} + +.btn-primary:hover { + background-color: var(--color-sage-dark); +} + +.btn-whatsapp { + background-color: #25d366; + color: #ffffff; +} + +.btn-whatsapp:hover { + background-color: #1ebe5d; +} + +.btn-secondary { + background-color: var(--color-surface); + border-color: var(--color-border); + color: var(--color-text-main); +} + +.btn-secondary:hover { + background-color: var(--color-surface-soft); +} + +.btn-sm { + min-height: 36px; + padding: 6px 12px; + font-size: 13px; +} + +.btn-xs { + padding: 2px 6px; + font-size: 11px; + border-radius: var(--radius-sm); + border: 1px solid var(--color-border); + background: #fff; + cursor: pointer; +} + +.secondary-actions { + display: flex; + justify-content: center; + align-items: center; + gap: 8px; + font-size: 12px; + padding-top: 4px; +} + +.btn-text { + background: none; + border: none; + font-size: 12px; + color: var(--color-text-muted); + cursor: pointer; + text-decoration: underline; + padding: 4px 6px; +} + +.btn-text:hover { + color: var(--color-text-main); +} + +.text-danger { + color: var(--color-danger); +} + +/* Timeline & Buffer Visualization */ +.timeline-list { + display: flex; + flex-direction: column; + gap: 16px; +} + +.timeline-item { + display: flex; + flex-direction: column; + gap: 10px; +} + +@media (min-width: 640px) { + .timeline-item { + flex-direction: row; + gap: 16px; + } +} + +.timeline-time-col { + display: flex; + flex-direction: row; + gap: 8px; + align-items: baseline; + min-width: 120px; + padding-top: 4px; +} + +@media (min-width: 640px) { + .timeline-time-col { + flex-direction: column; + gap: 2px; + align-items: flex-end; + text-align: right; + } +} + +.time-main { + font-size: 18px; + font-weight: 700; + color: var(--color-text-main); +} + +.time-end { + font-size: 12px; + color: var(--color-text-muted); +} + +.duration-badge { + font-size: 11px; + font-weight: 600; + background: var(--color-surface-soft); + padding: 2px 6px; + border-radius: var(--radius-sm); + color: var(--color-text-muted); +} + +.timeline-card { + flex: 1; + background: var(--color-surface); + border: 1px solid var(--color-border); + border-radius: var(--radius-lg); + padding: 16px; + box-shadow: var(--shadow-sm); +} + +.card-body-compact { + margin: 10px 0; + display: flex; + flex-direction: column; + gap: 6px; +} + +.client-row { + display: flex; + justify-content: space-between; + align-items: center; +} + +.meta-row { + display: flex; + justify-content: space-between; + font-size: 13px; + color: var(--color-text-muted); +} + +.status-chips { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin-top: 6px; +} + +/* Protected Buffer Block */ +.buffer-block { + background: var(--color-sage-light); + border-left: 4px solid var(--color-sage); + border-radius: var(--radius-sm); + padding: 8px 12px; + margin-top: 12px; + display: flex; + flex-direction: column; + gap: 2px; +} + +.buffer-badge { + font-size: 12px; + color: var(--color-sage-dark); +} + +.buffer-hint { + font-size: 11px; + color: var(--color-text-muted); +} + +.collision-alert { + background: var(--color-danger-light); + color: var(--color-danger); + border: 1px solid var(--color-danger); + border-radius: var(--radius-sm); + padding: 8px 12px; + font-size: 12px; + font-weight: 600; + margin-top: 10px; +} + +/* Modals */ +.modal-backdrop { + position: fixed; + inset: 0; + background-color: rgba(29, 42, 36, 0.5); + backdrop-filter: blur(3px); + display: flex; + align-items: center; + justify-content: center; + padding: 16px; + z-index: 1000; + animation: fadeIn 0.15s ease-out; +} + +.modal-card { + background: var(--color-surface); + border-radius: var(--radius-lg); + max-width: 480px; + width: 100%; + padding: 24px; + box-shadow: var(--shadow-lg); + display: flex; + flex-direction: column; + gap: 16px; + animation: slideUp 0.2s ease-out; +} + +.modal-header { + display: flex; + justify-content: space-between; + align-items: flex-start; +} + +.modal-kicker { + font-size: 11px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.05em; + color: var(--color-sage); +} + +.modal-title { + font-family: var(--font-serif); + font-size: 18px; + color: var(--color-text-main); +} + +.modal-close-btn { + background: none; + border: none; + font-size: 24px; + line-height: 1; + color: var(--color-text-muted); + cursor: pointer; + padding: 4px; +} + +.summary-box { + background: var(--color-surface-soft); + border-radius: var(--radius-md); + padding: 12px; + display: flex; + flex-direction: column; + gap: 6px; + font-size: 13px; +} + +.summary-row { + display: flex; + justify-content: space-between; +} + +.summary-label { + color: var(--color-text-muted); +} + +.form-group { + display: flex; + flex-direction: column; + gap: 6px; + margin-bottom: 12px; +} + +.form-label { + font-size: 13px; + font-weight: 600; + color: var(--color-text-main); +} + +.form-input, +.form-select { + padding: 10px 12px; + font-size: 15px; + border: 1px solid var(--color-border); + border-radius: var(--radius-md); + background: #fff; + color: var(--color-text-main); + min-height: 44px; +} + +.form-input:focus, +.form-select:focus { + outline: none; + border-color: var(--color-border-focus); + box-shadow: 0 0 0 3px rgba(45, 90, 70, 0.15); +} + +.payment-method-selector { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 8px; +} + +.method-option { + display: flex; + flex-direction: column; + align-items: center; + gap: 4px; + padding: 10px 8px; + border: 1px solid var(--color-border); + border-radius: var(--radius-md); + cursor: pointer; + font-size: 13px; + font-weight: 500; + text-align: center; + background: #fff; + min-height: 44px; +} + +.method-option:has(input:checked) { + border-color: var(--color-sage); + background: var(--color-sage-light); + color: var(--color-sage-dark); + font-weight: 600; +} + +.modal-actions { + display: flex; + justify-content: flex-end; + gap: 10px; + margin-top: 10px; +} + +.modal-error-box { + background: var(--color-danger-light); + color: var(--color-danger); + padding: 8px 12px; + border-radius: var(--radius-sm); + font-size: 13px; +} + +/* Tables */ +.table-container { + background: var(--color-surface); + border: 1px solid var(--color-border); + border-radius: var(--radius-lg); + overflow: hidden; + box-shadow: var(--shadow-sm); +} + +.filter-bar { + display: flex; + align-items: center; + gap: 10px; + margin-bottom: 16px; +} + +.filter-label { + font-size: 13px; + color: var(--color-text-muted); +} + +.bookings-table-wrapper { + overflow-x: auto; +} + +.bookings-table { + width: 100%; + border-collapse: collapse; + font-size: 13px; + text-align: left; +} + +.bookings-table th { + background: var(--color-surface-soft); + padding: 10px 14px; + font-weight: 600; + color: var(--color-text-muted); + border-bottom: 1px solid var(--color-border); +} + +.bookings-table td { + padding: 12px 14px; + border-bottom: 1px solid var(--color-border); +} + +.bookings-table tr:hover td { + background: var(--color-bg); +} + +/* 5-State Resilient UI Helpers */ +.loading-state { + display: flex; + flex-direction: column; + gap: 12px; +} + +.skeleton-card { + height: 160px; + background: linear-gradient(90deg, #efece6 25%, #e5e0d8 50%, #efece6 75%); + background-size: 200% 100%; + border-radius: var(--radius-lg); + animation: pulseSkeleton 1.5s infinite; +} + +@keyframes pulseSkeleton { + 0% { + background-position: 200% 0; + } + 100% { + background-position: -200% 0; + } +} + +.empty-state, +.error-state { + padding: 40px 20px; + text-align: center; + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; +} + +.empty-icon, +.error-icon { + font-size: 36px; + margin-bottom: 6px; +} + +.empty-title, +.error-title { + font-family: var(--font-serif); + font-size: 18px; + color: var(--color-text-main); +} + +.empty-desc, +.error-desc { + font-size: 14px; + color: var(--color-text-muted); + max-width: 400px; +} + +.hidden { + display: none; +} + +@keyframes fadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes slideUp { + from { + transform: translateY(12px); + opacity: 0; + } + to { + transform: translateY(0); + opacity: 1; + } +} diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..c4c4c6d --- /dev/null +++ b/src/types.ts @@ -0,0 +1,74 @@ +export type BookingStatus = + | "RESERVED" + | "RELEASED" + | "CANCELLED" + | "COMPLETED" + | "NO_SHOW"; + +export type PaymentArrangement = + | "PREPAID_DEFAULT" + | "DELAYED_ALLOWED" + | "PACKAGE_REDEEMED"; + +export type PaymentStatus = + | "AWAITING_ACKNOWLEDGMENT" + | "ACKNOWLEDGED" + | "NOT_APPLICABLE"; + +export type BookingPaymentStatus = PaymentStatus; + +export type GcalSyncStatus = "PENDING" | "SYNCED" | "FAILED" | "NOT_CONFIGURED"; + +export interface Booking { + id: string; + booking_code: string; + service_id: string; + service_name: string | null; + client_id: string; + client_name: string | null; + client_phone: string | null; + package_id: string | null; + scheduled_at: string; + duration_minutes: number; + buffer_minutes: number; + booking_status: BookingStatus; + payment_arrangement: PaymentArrangement; + payment_status: PaymentStatus; + amount_mxn: number; + needs_payment_followup: boolean; + hours_until_session: number; + exception_authorized_by?: string | null; + exception_authorized_at?: string | null; + exception_notes?: string | null; + released_by?: string | null; + released_at?: string | null; + release_reason?: string | null; + acknowledged_by?: string | null; + acknowledged_at?: string | null; + gcal_event_id?: string | null; + gcal_sync_status: GcalSyncStatus; + gcal_sync_error?: string | null; + gcal_synced_at?: string | null; + created_at: string; + whatsapp_redirect_url?: string | null; + whatsapp_followup_url?: string | null; +} + +export interface PaymentAcknowledgmentPayload { + booking_id: string; + amount_mxn: number; + payment_method: "SPEI" | "OXXO" | "CASH"; + notes?: string | null; +} + +export interface PaymentRecord { + id: string; + booking_id: string; + amount_mxn: number; + payment_method: "SPEI" | "OXXO" | "CASH"; + status: "ACKNOWLEDGED" | "REVERSED"; + acknowledged_by: string; + acknowledged_at: string; + notes?: string | null; + created_at: string; +} diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 0000000..2af033a --- /dev/null +++ b/src/utils.ts @@ -0,0 +1,85 @@ +export function formatDateTime(isoStr: string): string { + try { + const dt = new Date(isoStr); + if (Number.isNaN(dt.getTime())) return isoStr; + return new Intl.DateTimeFormat("es-MX", { + weekday: "short", + day: "numeric", + month: "short", + hour: "numeric", + minute: "2-digit", + hour12: true, + }).format(dt); + } catch { + return isoStr; + } +} + +export function formatTimeOnly(isoStr: string): string { + try { + const dt = new Date(isoStr); + if (Number.isNaN(dt.getTime())) return isoStr; + return new Intl.DateTimeFormat("es-MX", { + hour: "numeric", + minute: "2-digit", + hour12: true, + }).format(dt); + } catch { + return isoStr; + } +} + +export function formatCurrency(amount: number): string { + return `$${amount.toLocaleString("es-MX")} MXN`; +} + +export function calculateInterval( + startIso: string, + durationMinutes: number, + bufferMinutes: number, +): { + start: Date; + end: Date; + bufferEnd: Date; + startStr: string; + endStr: string; + bufferEndStr: string; +} { + const start = new Date(startIso); + const end = new Date(start.getTime() + durationMinutes * 60 * 1000); + const bufferEnd = new Date(end.getTime() + bufferMinutes * 60 * 1000); + + return { + start, + end, + bufferEnd, + startStr: formatTimeOnly(start.toISOString()), + endStr: formatTimeOnly(end.toISOString()), + bufferEndStr: formatTimeOnly(bufferEnd.toISOString()), + }; +} + +export function getHoursRemainingBadge(hours: number): { + text: string; + urgencyClass: string; +} { + if (hours <= 0) { + return { text: "Sesión vencida / Hoy", urgencyClass: "badge-danger" }; + } + if (hours <= 24) { + return { + text: `${Math.round(hours)}h restantes (Urgente)`, + urgencyClass: "badge-danger", + }; + } + if (hours <= 48) { + return { + text: `${Math.round(hours)}h restantes`, + urgencyClass: "badge-warning", + }; + } + return { + text: `En ${Math.round(hours / 24)} días`, + urgencyClass: "badge-info", + }; +} diff --git a/tests/utils.test.ts b/tests/utils.test.ts new file mode 100644 index 0000000..4b202c2 --- /dev/null +++ b/tests/utils.test.ts @@ -0,0 +1,35 @@ +import { describe, expect, it } from "vitest"; +import { + calculateInterval, + formatCurrency, + getHoursRemainingBadge, +} from "../src/utils"; + +describe("Frontend Utilities", () => { + it("formats MXN currency properly", () => { + expect(formatCurrency(600)).toBe("$600 MXN"); + expect(formatCurrency(1250)).toContain("1,250"); + }); + + it("computes appointment interval with mandatory buffer block", () => { + const startIso = "2026-10-25T10:00:00.000Z"; + const interval = calculateInterval(startIso, 60, 15); + + expect(interval.start.getTime()).toBe(new Date(startIso).getTime()); + // 60 minutes session end + expect(interval.end.getTime()).toBe( + new Date(startIso).getTime() + 60 * 60 * 1000, + ); + // 15 minutes buffer end + expect(interval.bufferEnd.getTime()).toBe( + new Date(startIso).getTime() + 75 * 60 * 1000, + ); + }); + + it("returns correct urgency badges based on hours remaining", () => { + expect(getHoursRemainingBadge(0).urgencyClass).toBe("badge-danger"); + expect(getHoursRemainingBadge(12).urgencyClass).toBe("badge-danger"); + expect(getHoursRemainingBadge(36).urgencyClass).toBe("badge-warning"); + expect(getHoursRemainingBadge(72).urgencyClass).toBe("badge-info"); + }); +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..5a06502 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ES2022", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2022", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": false, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "types": ["vite/client"] + }, + "include": ["src", "tests", "vite.config.ts"] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..96a0689 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,13 @@ +/// +import { defineConfig } from "vite"; + +export default defineConfig({ + server: { + port: 5173, + host: "0.0.0.0", + }, + test: { + include: ["tests/**/*.test.ts"], + exclude: [".direnv/**", "node_modules/**"], + }, +});