diff --git a/package-lock.json b/package-lock.json index 83e37e9..7fd1e3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1506,13 +1506,14 @@ "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", - "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "aix" @@ -1522,13 +1523,14 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", - "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -1538,13 +1540,14 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", - "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -1554,13 +1557,14 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", - "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -1570,13 +1574,14 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", - "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1586,13 +1591,14 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", - "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1602,13 +1608,14 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", - "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1618,13 +1625,14 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", - "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -1634,13 +1642,14 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", - "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1650,13 +1659,14 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", - "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1666,13 +1676,14 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", - "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1682,13 +1693,14 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", - "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", "cpu": [ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1698,13 +1710,14 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", - "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", "cpu": [ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1714,13 +1727,14 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", - "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1730,13 +1744,14 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", - "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1746,13 +1761,14 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", - "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1762,13 +1778,14 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", - "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -1778,13 +1795,14 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", - "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -1794,13 +1812,14 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", - "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -1810,13 +1829,14 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", - "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" @@ -1826,13 +1846,14 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", - "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -1842,13 +1863,14 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", - "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -1858,13 +1880,14 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", - "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -2051,208 +2074,224 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.3.tgz", - "integrity": "sha512-X9alQ3XM6I9IlSlmC8ddAvMSyG1WuHk5oUnXGw+yUBs3BFoTizmG1La/Gr8fVJvDWAq+zlYTZ9DBgrlKRVY06g==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.22.5.tgz", + "integrity": "sha512-SU5cvamg0Eyu/F+kLeMXS7GoahL+OoizlclVFX3l5Ql6yNlywJJ0OuqTzUx0v+aHhPHEB/56CT06GQrRrGNYww==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.3.tgz", - "integrity": "sha512-eQK5JIi+POhFpzk+LnjKIy4Ks+pwJ+NXmPxOCSvOKSNRPONzKuUvWE+P9JxGZVxrtzm6BAYMaL50FFuPe0oWMQ==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.22.5.tgz", + "integrity": "sha512-S4pit5BP6E5R5C8S6tgU/drvgjtYW76FBuG6+ibG3tMvlD1h9LHVF9KmlmaUBQ8Obou7hEyS+0w+IR/VtxwNMQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.3.tgz", - "integrity": "sha512-Od4vE6f6CTT53yM1jgcLqNfItTsLt5zE46fdPaEmeFHvPs5SjZYlLpHrSiHEKR1+HdRfxuzXHjDOIxQyC3ptBA==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.22.5.tgz", + "integrity": "sha512-250ZGg4ipTL0TGvLlfACkIxS9+KLtIbn7BCZjsZj88zSg2Lvu3Xdw6dhAhfe/FjjXPVNCtcSp+WZjVsD3a/Zlw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.3.tgz", - "integrity": "sha512-0IMAO21axJeNIrvS9lSe/PGthc8ZUS+zC53O0VhF5gMxfmcKAP4ESkKOCwEi6u2asUrt4mQv2rjY8QseIEb1aw==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.22.5.tgz", + "integrity": "sha512-D8brJEFg5D+QxFcW6jYANu+Rr9SlKtTenmsX5hOSzNYVrK5oLAEMTUgKWYJP+wdKyCdeSwnapLsn+OVRFycuQg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.3.tgz", - "integrity": "sha512-ge2DC7tHRHa3caVEoSbPRJpq7azhG+xYsd6u2MEnJ6XzPSzQsTKyXvh6iWjXRf7Rt9ykIUWHtl0Uz3T6yXPpKw==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.22.5.tgz", + "integrity": "sha512-PNqXYmdNFyWNg0ma5LdY8wP+eQfdvyaBAojAXgO7/gs0Q/6TQJVXAXe8gwW9URjbS0YAammur0fynYGiWsKlXw==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.14.3.tgz", - "integrity": "sha512-ljcuiDI4V3ySuc7eSk4lQ9wU8J8r8KrOUvB2U+TtK0TiW6OFDmJ+DdIjjwZHIw9CNxzbmXY39wwpzYuFDwNXuw==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.22.5.tgz", + "integrity": "sha512-kSSCZOKz3HqlrEuwKd9TYv7vxPYD77vHSUvM2y0YaTGnFc8AdI5TTQRrM1yIp3tXCKrSL9A7JLoILjtad5t8pQ==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.3.tgz", - "integrity": "sha512-Eci2us9VTHm1eSyn5/eEpaC7eP/mp5n46gTRB3Aar3BgSvDQGJZuicyq6TsH4HngNBgVqC5sDYxOzTExSU+NjA==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.22.5.tgz", + "integrity": "sha512-oTXQeJHRbOnwRnRffb6bmqmUugz0glXaPyspp4gbQOPVApdpRrY/j7KP3lr7M8kTfQTyrBUzFjj5EuHAhqH4/w==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.3.tgz", - "integrity": "sha512-UrBoMLCq4E92/LCqlh+blpqMz5h1tJttPIniwUgOFJyjWI1qrtrDhhpHPuFxULlUmjFHfloWdixtDhSxJt5iKw==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.22.5.tgz", + "integrity": "sha512-qnOTIIs6tIGFKCHdhYitgC2XQ2X25InIbZFor5wh+mALH84qnFHvc+vmWUpyX97B0hNvwNUL4B+MB8vJvH65Fw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.3.tgz", - "integrity": "sha512-5aRjvsS8q1nWN8AoRfrq5+9IflC3P1leMoy4r2WjXyFqf3qcqsxRCfxtZIV58tCxd+Yv7WELPcO9mY9aeQyAmw==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.22.5.tgz", + "integrity": "sha512-TMYu+DUdNlgBXING13rHSfUc3Ky5nLPbWs4bFnT+R6Vu3OvXkTkixvvBKk8uO4MT5Ab6lC3U7x8S8El2q5o56w==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.3.tgz", - "integrity": "sha512-sk/Qh1j2/RJSX7FhEpJn8n0ndxy/uf0kI/9Zc4b1ELhqULVdTfN6HL31CDaTChiBAOgLcsJ1sgVZjWv8XNEsAQ==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.22.5.tgz", + "integrity": "sha512-PTQq1Kz22ZRvuhr3uURH+U/Q/a0pbxJoICGSprNLAoBEkyD3Sh9qP5I0Asn0y0wejXQBbsVMRZRxlbGFD9OK4A==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.3.tgz", - "integrity": "sha512-jOO/PEaDitOmY9TgkxF/TQIjXySQe5KVYB57H/8LRP/ux0ZoO8cSHCX17asMSv3ruwslXW/TLBcxyaUzGRHcqg==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.22.5.tgz", + "integrity": "sha512-bR5nCojtpuMss6TDEmf/jnBnzlo+6n1UhgwqUvRoe4VIotC7FG1IKkyJbwsT7JDsF2jxR+NTnuOwiGv0hLyDoQ==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.3.tgz", - "integrity": "sha512-8ybV4Xjy59xLMyWo3GCfEGqtKV5M5gCSrZlxkPGvEPCGDLNla7v48S662HSGwRd6/2cSneMQWiv+QzcttLrrOA==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.22.5.tgz", + "integrity": "sha512-N0jPPhHjGShcB9/XXZQWuWBKZQnC1F36Ce3sDqWpujsGjDz/CQtOL9LgTrJ+rJC8MJeesMWrMWVLKKNR/tMOCA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.3.tgz", - "integrity": "sha512-s+xf1I46trOY10OqAtZ5Rm6lzHre/UiLA1J2uOhCFXWkbZrJRkYBPO6FhvGfHmdtQ3Bx793MNa7LvoWFAm93bg==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.22.5.tgz", + "integrity": "sha512-uBa2e28ohzNNwjr6Uxm4XyaA1M/8aTgfF2T7UIlElLaeXkgpmIJ2EitVNQxjO9xLLLy60YqAgKn/AqSpCUkE9g==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.3.tgz", - "integrity": "sha512-+4h2WrGOYsOumDQ5S2sYNyhVfrue+9tc9XcLWLh+Kw3UOxAvrfOrSMFon60KspcDdytkNDh7K2Vs6eMaYImAZg==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.22.5.tgz", + "integrity": "sha512-RXT8S1HP8AFN/Kr3tg4fuYrNxZ/pZf1HemC5Tsddc6HzgGnJm0+Lh5rAHJkDuW3StI0ynNXukidROMXYl6ew8w==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.3.tgz", - "integrity": "sha512-T1l7y/bCeL/kUwh9OD4PQT4aM7Bq43vX05htPJJ46RTI4r5KNt6qJRzAfNfM+OYMNEVBWQzR2Gyk+FXLZfogGw==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.22.5.tgz", + "integrity": "sha512-ElTYOh50InL8kzyUD6XsnPit7jYCKrphmddKAe1/Ytt74apOxDq5YEcbsiKs0fR3vff3jEneMM+3I7jbqaMyBg==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.3.tgz", - "integrity": "sha512-/BypzV0H1y1HzgYpxqRaXGBRqfodgoBBCcsrujT6QRcakDQdfU+Lq9PENPh5jB4I44YWq+0C2eHsHya+nZY1sA==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.22.5.tgz", + "integrity": "sha512-+lvL/4mQxSV8MukpkKyyvfwhH266COcWlXE/1qxwN08ajovta3459zrjLghYMgDerlzNwLAcFpvU+WWE5y6nAQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -2472,10 +2511,11 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" }, "node_modules/@types/hoist-non-react-statics": { "version": "3.3.5", @@ -2852,9 +2892,10 @@ } }, "node_modules/axios": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", - "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -3415,11 +3456,12 @@ } }, "node_modules/esbuild": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", - "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -3427,29 +3469,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.20.2", - "@esbuild/android-arm": "0.20.2", - "@esbuild/android-arm64": "0.20.2", - "@esbuild/android-x64": "0.20.2", - "@esbuild/darwin-arm64": "0.20.2", - "@esbuild/darwin-x64": "0.20.2", - "@esbuild/freebsd-arm64": "0.20.2", - "@esbuild/freebsd-x64": "0.20.2", - "@esbuild/linux-arm": "0.20.2", - "@esbuild/linux-arm64": "0.20.2", - "@esbuild/linux-ia32": "0.20.2", - "@esbuild/linux-loong64": "0.20.2", - "@esbuild/linux-mips64el": "0.20.2", - "@esbuild/linux-ppc64": "0.20.2", - "@esbuild/linux-riscv64": "0.20.2", - "@esbuild/linux-s390x": "0.20.2", - "@esbuild/linux-x64": "0.20.2", - "@esbuild/netbsd-x64": "0.20.2", - "@esbuild/openbsd-x64": "0.20.2", - "@esbuild/sunos-x64": "0.20.2", - "@esbuild/win32-arm64": "0.20.2", - "@esbuild/win32-ia32": "0.20.2", - "@esbuild/win32-x64": "0.20.2" + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" } }, "node_modules/escape-string-regexp": { @@ -3886,6 +3928,7 @@ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -4807,6 +4850,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -5055,9 +5099,10 @@ } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "license": "ISC" }, "node_modules/possible-typed-array-names": { "version": "1.0.0", @@ -5069,9 +5114,9 @@ } }, "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.47", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", + "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", "dev": true, "funding": [ { @@ -5087,10 +5132,11 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.0", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -5635,12 +5681,13 @@ } }, "node_modules/rollup": { - "version": "4.14.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.3.tgz", - "integrity": "sha512-ag5tTQKYsj1bhrFC9+OEWqb5O6VYgtQDO9hPDBMmIbePwhfSr+ExlcU741t8Dhw5DkPCQf6noz0jb36D6W9/hw==", + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.22.5.tgz", + "integrity": "sha512-WoinX7GeQOFMGznEcWA1WrTQCd/tpEbMkc3nuMs9BT0CPjMdSjPMTVClwWd4pgSQwJdP65SK9mTCNvItlr5o7w==", "dev": true, + "license": "MIT", "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -5650,22 +5697,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.14.3", - "@rollup/rollup-android-arm64": "4.14.3", - "@rollup/rollup-darwin-arm64": "4.14.3", - "@rollup/rollup-darwin-x64": "4.14.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.14.3", - "@rollup/rollup-linux-arm-musleabihf": "4.14.3", - "@rollup/rollup-linux-arm64-gnu": "4.14.3", - "@rollup/rollup-linux-arm64-musl": "4.14.3", - "@rollup/rollup-linux-powerpc64le-gnu": "4.14.3", - "@rollup/rollup-linux-riscv64-gnu": "4.14.3", - "@rollup/rollup-linux-s390x-gnu": "4.14.3", - "@rollup/rollup-linux-x64-gnu": "4.14.3", - "@rollup/rollup-linux-x64-musl": "4.14.3", - "@rollup/rollup-win32-arm64-msvc": "4.14.3", - "@rollup/rollup-win32-ia32-msvc": "4.14.3", - "@rollup/rollup-win32-x64-msvc": "4.14.3", + "@rollup/rollup-android-arm-eabi": "4.22.5", + "@rollup/rollup-android-arm64": "4.22.5", + "@rollup/rollup-darwin-arm64": "4.22.5", + "@rollup/rollup-darwin-x64": "4.22.5", + "@rollup/rollup-linux-arm-gnueabihf": "4.22.5", + "@rollup/rollup-linux-arm-musleabihf": "4.22.5", + "@rollup/rollup-linux-arm64-gnu": "4.22.5", + "@rollup/rollup-linux-arm64-musl": "4.22.5", + "@rollup/rollup-linux-powerpc64le-gnu": "4.22.5", + "@rollup/rollup-linux-riscv64-gnu": "4.22.5", + "@rollup/rollup-linux-s390x-gnu": "4.22.5", + "@rollup/rollup-linux-x64-gnu": "4.22.5", + "@rollup/rollup-linux-x64-musl": "4.22.5", + "@rollup/rollup-win32-arm64-msvc": "4.22.5", + "@rollup/rollup-win32-ia32-msvc": "4.22.5", + "@rollup/rollup-win32-x64-msvc": "4.22.5", "fsevents": "~2.3.2" } }, @@ -5824,10 +5871,11 @@ } }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -6283,14 +6331,15 @@ } }, "node_modules/vite": { - "version": "5.2.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.9.tgz", - "integrity": "sha512-uOQWfuZBlc6Y3W/DTuQ1Sr+oIXWvqljLvS881SVmAj00d5RdgShLcuXWxseWPd4HXwiYBFW/vXHfKFeqj9uQnw==", + "version": "5.4.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", + "integrity": "sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==", "dev": true, + "license": "MIT", "dependencies": { - "esbuild": "^0.20.1", - "postcss": "^8.4.38", - "rollup": "^4.13.0" + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" @@ -6309,6 +6358,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -6326,6 +6376,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, diff --git a/src/Components/FileUploader/FileUploader.jsx b/src/Components/FileUploader/FileUploader.jsx new file mode 100644 index 0000000..e06b129 --- /dev/null +++ b/src/Components/FileUploader/FileUploader.jsx @@ -0,0 +1,152 @@ +import React, { Children, useState } from 'react'; +import { useForm } from 'react-hook-form'; +import { yupResolver } from '@hookform/resolvers/yup'; +import { Box, FormControl, FormErrorMessage, FormLabel, HStack, Icon, Image, Text, VStack, keyframes, useDisclosure } from '@chakra-ui/react'; +import * as Yup from 'yup'; +import { SlCloudUpload } from 'react-icons/sl'; +import { DeleteIcon } from '@chakra-ui/icons'; +import ImageViewer from '../ImageViewer'; // Make sure you have this component or replace it with a suitable one + +// Define max file size in bytes (2MB = 2 * 1024 * 1024 bytes) +const MAX_FILE_SIZE = 2 * 1024 * 1024; + +// Define a keyframes animation for fade-in +export const fadeIn = keyframes` + from { opacity: 0; } + to { opacity: 1; } +`; + +const FileUploader = ({ + label = "Upload File", + maxFileSize = MAX_FILE_SIZE, + allowedFormats = ['image/jpeg'], + onFileUpload, // Callback when a file is successfully uploaded + onFileRemove, // Callback when a file is removed + defaultPreview = null, // Default preview image if any + isRequired = true, // To make the input required or not + children, +}) => { + const [filePreview, setFilePreview] = useState(defaultPreview); + const { isOpen, onOpen, onClose } = useDisclosure(); + + const validationSchema = Yup.object().shape({ + file: Yup.mixed() + .test('fileSize', `File is too large. Max size is ${maxFileSize / (1024 * 1024)}MB.`, (value) => { + return value && value.length > 0 && value[0].size <= maxFileSize; + }) + .test('fileType', `Unsupported file format. Allowed formats: ${allowedFormats.join(', ')}.`, (value) => { + return value && value.length > 0 && allowedFormats.includes(value[0].type); + }), + }); + + const { register, formState: { errors }, handleSubmit, setValue } = useForm({ + resolver: yupResolver(validationSchema), + }); + + const handleFileChange = (event) => { + const file = event.target.files[0]; + if (file) { + // const fileURL = URL.createObjectURL(file); + // setFilePreview(fileURL); + setValue('file', event.target.files); + onFileUpload && onFileUpload(file, setFilePreview); // Call onFileUpload callback + } + }; + + const handleRemove = () => { + setFilePreview(null); + setValue('file', null); + onFileRemove && onFileRemove(); // Call onFileRemove callback + }; + + const handleClick = () => { + const fileInput = document.getElementById(`file-${label}`); + if (fileInput) { + fileInput.click(); // Trigger the file input click via ID + } + }; + + return ( + + + + {label} + + + {!filePreview && ( + + + + Drag and drop files here or{" "} + + Choose file + + + + )} + + {filePreview && ( + + File Preview + + + )} + + + + + + Supported formats- jpg, png, svg + + + Maximum size - 20MB + + + + {/* {errors.file && errors.file.message} */} + + {children} + + + + + ); +}; + +export default FileUploader; diff --git a/src/Components/ImageViewer.jsx b/src/Components/ImageViewer.jsx index 08e7bbe..78d3f8c 100644 --- a/src/Components/ImageViewer.jsx +++ b/src/Components/ImageViewer.jsx @@ -19,14 +19,14 @@ const ImageViewer = ({ src, isOpen, onClose }) => { - + {/* */} - + diff --git a/src/Components/ProfileImageViewer.jsx b/src/Components/ProfileImageViewer.jsx new file mode 100644 index 0000000..8205493 --- /dev/null +++ b/src/Components/ProfileImageViewer.jsx @@ -0,0 +1,36 @@ +import { AddIcon } from "@chakra-ui/icons"; +import { + Avatar, + Button, + HStack, + Image, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalFooter, + ModalHeader, + ModalOverlay, + Text, + VStack, +} from "@chakra-ui/react"; + +import React from "react"; + +const ProfileImageViewer = ({ isOpen, onOpen, onClose, imgLink, rounded, snap }) => { + return ( + + + + Null + + + ); +}; + +export default ProfileImageViewer; diff --git a/src/Components/ToastBox.jsx b/src/Components/ToastBox.jsx index ff96e68..3545cdd 100644 --- a/src/Components/ToastBox.jsx +++ b/src/Components/ToastBox.jsx @@ -14,7 +14,7 @@ const ToastBox = ({ message, status }) => { > {status === "error" || status === "warn" ? : } - {message} + {message} ); }; diff --git a/src/Contexts/GlobalStateProvider.jsx b/src/Contexts/GlobalStateProvider.jsx index ee73477..beb1e7e 100644 --- a/src/Contexts/GlobalStateProvider.jsx +++ b/src/Contexts/GlobalStateProvider.jsx @@ -457,6 +457,343 @@ const GlobalStateProvider = ({ children }) => { }, ]); + // const [department, setDepartment] = useState([ + // { + // "id": 1, + // "department": "FInance", + // "role": "Sr. Manager", + // "createdBy": "Reethik Thota", + // "dateTime": "12 June 2024, 10.00 am", + // "approvedBy": "Pooja Patade", + // }, + // { + // "id": 2, + // "department": "FInance", + // "role": "Sr. Manager", + // "createdBy": "Reethik Thota", + // "dateTime": "12 June 2024, 10.00 am", + // "approvedBy": "Pooja Patade", + // }, + // { + // "id": 3, + // "department": "FInance", + // "role": "Sr. Manager", + // "createdBy": "Reethik Thota", + // "dateTime": "12 June 2024, 10.00 am", + // "approvedBy": "Pooja Patade", + // }, + // { + // "id": 4, + // "department": "FInance", + // "role": "Sr. Manager", + // "createdBy": "Reethik Thota", + // "dateTime": "12 June 2024, 10.00 am", + // "approvedBy": "Pooja Patade", + // }, + // { + // "id": 5, + // "department": "FInance", + // "role": "Sr. Manager", + // "createdBy": "Reethik Thota", + // "dateTime": "12 June 2024, 10.00 am", + // "approvedBy": "Pooja Patade", + // }, + // { + // "id": 6, + // "department": "FInance", + // "role": "Sr. Manager", + // "createdBy": "Reethik Thota", + // "dateTime": "12 June 2024, 10.00 am", + // "approvedBy": "Pooja Patade", + // }, + // { + // "id": 7, + // "department": "FInance", + // "role": "Sr. Manager", + // "createdBy": "Reethik Thota", + // "dateTime": "12 June 2024, 10.00 am", + // "approvedBy": "Pooja Patade", + // }, + // { + // "id": 8, + // "department": "FInance", + // "role": "Sr. Manager", + // "createdBy": "Reethik Thota", + // "dateTime": "12 June 2024, 10.00 am", + // "approvedBy": "Pooja Patade", + // }, + // { + // "id": 9, + // "department": "FInance", + // "role": "Sr. Manager", + // "createdBy": "Reethik Thota", + // "dateTime": "12 June 2024, 10.00 am", + // "approvedBy": "Pooja Patade", + // }, + // { + // "id": 10, + // "department": "FInance", + // "role": "Sr. Manager", + // "createdBy": "Reethik Thota", + // "dateTime": "12 June 2024, 10.00 am", + // "approvedBy": "Pooja Patade", + // }, + // ]); + + // const [roles, setRoles] = useState([ + // { + // "id": 1, + // "role": "Sr Manager", + // "department": "Finance", + // "createdDuration": "11 June 2024, 10 am", + // "createdBy": "Pooja Patade", + // "permissions": "Subadmin", + // "status": "Published", + // }, + // { + // "id": 2, + // "role": "Sr Manager", + // "department": "Finance", + // "createdDuration": "11 June 2024, 10 am", + // "createdBy": "Pooja Patade", + // "permissions": "Subadmin", + // "status": "Published", + // }, + // { + // "id": 3, + // "role": "Sr Manager", + // "department": "Finance", + // "createdDuration": "11 June 2024, 10 am", + // "createdBy": "Pooja Patade", + // "permissions": "Subadmin", + // "status": "Saved as draft", + // }, + // { + // "id": 4, + // "role": "Sr Manager", + // "department": "Finance", + // "createdDuration": "11 June 2024, 10 am", + // "createdBy": "Pooja Patade", + // "permissions": "Subadmin", + // "status": "Published", + // }, + // { + // "id": 5, + // "role": "Sr Manager", + // "department": "Finance", + // "createdDuration": "11 June 2024, 10 am", + // "createdBy": "Pooja Patade", + // "permissions": "Subadmin", + // "status": "Saved as draft", + // }, + // { + // "id": 6, + // "role": "Sr Manager", + // "department": "Finance", + // "createdDuration": "11 June 2024, 10 am", + // "createdBy": "Pooja Patade", + // "permissions": "Subadmin", + // "status": "Saved as draft", + // }, + // { + // "id": 7, + // "role": "Sr Manager", + // "department": "Finance", + // "createdDuration": "11 June 2024, 10 am", + // "createdBy": "Pooja Patade", + // "permissions": "Subadmin", + // "status": "Saved as draft", + // }, + // { + // "id": 8, + // "role": "Sr Manager", + // "department": "Finance", + // "createdDuration": "11 June 2024, 10 am", + // "createdBy": "Pooja Patade", + // "permissions": "Subadmin", + // "status": "Saved as draft", + // }, + // { + // "id": 9, + // "role": "Sr Manager", + // "department": "Finance", + // "createdDuration": "11 June 2024, 10 am", + // "createdBy": "Pooja Patade", + // "permissions": "Subadmin", + // "status": "Published", + // }, + // { + // "id": 10, + // "role": "Sr Manager", + // "department": "Finance", + // "createdDuration": "11 June 2024, 10 am", + // "createdBy": "Pooja Patade", + // "permissions": "Subadmin", + // "status": "Saved as draft", + // }, + // { + // id: 2, + // name: "Travel Reimbursement - Q2 2024", + // lastUpdated: "15-08-2024 02:45 pm", + // reportType: "Expense", + // totalExpense: 1250.0, + // status: "Approved", + // }, + // { + // id: 3, + // name: "Client Meeting Expenses - August 2024", + // lastUpdated: "28-08-2024 09:30 am", + // reportType: "Expense", + // totalExpense: 600.5, + // status: "Fully Reimbursed", + // }, + // { + // id: 4, + // name: "Marketing Campaign - Q3 2024", + // lastUpdated: "10-09-2024 11:00 am", + // reportType: "Expense", + // totalExpense: 2300.0, + // status: "Disapproved", + // }, + // { + // id: 5, + // name: "Team Building Event - September 2024", + // lastUpdated: "22-09-2024 04:20 pm", + // reportType: "Expense", + // totalExpense: 800.0, + // status: "Fully Reimbursed", + // }, + // { + // id: 6, + // name: "Office Renovation - Phase 1", + // lastUpdated: "30-09-2024 03:10 pm", + // reportType: "Expense", + // totalExpense: 4500.0, + // status: "Saved", + // }, + // { + // id: 7, + // name: "Software Licenses - 2024 Renewal", + // lastUpdated: "05-10-2024 01:50 pm", + // reportType: "Expense", + // totalExpense: 3200.0, + // status: "Saved", + // }, + // { + // id: 8, + // name: "Conference Attendance - October 2024", + // lastUpdated: "15-10-2024 09:00 am", + // reportType: "Expense", + // totalExpense: 1500.0, + // status: "Partially Reimbursed", + // }, + // { + // id: 9, + // name: "Holiday Party - December 2024", + // lastUpdated: "20-12-2024 05:30 pm", + // reportType: "Expense", + // totalExpense: 2500.0, + // status: "Saved", + // }, + // { + // id: 10, + // name: "Client Gifts - End of Year 2024", + // lastUpdated: "31-12-2024 02:00 pm", + // reportType: "Expense", + // totalExpense: 1200.0, + // status: "Approved", + // }, + // { + // id: 11, + // name: "Training Programs - January 2025", + // lastUpdated: "15-01-2025 10:30 am", + // reportType: "Expense", + // totalExpense: 900.0, + // status: "Saved", + // }, + // { + // id: 7, + // name: "Software Licenses - 2024 Renewal", + // lastUpdated: "05-10-2024 01:50 pm", + // reportType: "Expense", + // totalExpense: 3200.0, + // status: "Saved", + // }, + // { + // id: 8, + // name: "Conference Attendance - October 2024", + // lastUpdated: "15-10-2024 09:00 am", + // reportType: "Expense", + // totalExpense: 1500.0, + // status: "Partially Reimbursed", + // }, + // { + // id: 9, + // name: "Holiday Party - December 2024", + // lastUpdated: "20-12-2024 05:30 pm", + // reportType: "Expense", + // totalExpense: 2500.0, + // status: "Saved", + // }, + // { + // id: 10, + // name: "Client Gifts - End of Year 2024", + // lastUpdated: "31-12-2024 02:00 pm", + // reportType: "Expense", + // totalExpense: 1200.0, + // status: "Approved", + // }, + // { + // id: 11, + // name: "Training Programs - January 2025", + // lastUpdated: "15-01-2025 10:30 am", + // reportType: "Expense", + // totalExpense: 900.0, + // status: "Saved", + // }, + // { + // id: 7, + // name: "Software Licenses - 2024 Renewal", + // lastUpdated: "05-10-2024 01:50 pm", + // reportType: "Expense", + // totalExpense: 3200.0, + // status: "Saved", + // }, + // { + // id: 8, + // name: "Conference Attendance - October 2024", + // lastUpdated: "15-10-2024 09:00 am", + // reportType: "Expense", + // totalExpense: 1500.0, + // status: "Partially Reimbursed", + // }, + // { + // id: 9, + // name: "Holiday Party - December 2024", + // lastUpdated: "20-12-2024 05:30 pm", + // reportType: "Expense", + // totalExpense: 2500.0, + // status: "Saved", + // }, + // { + // id: 10, + // name: "Client Gifts - End of Year 2024", + // lastUpdated: "31-12-2024 02:00 pm", + // reportType: "Expense", + // totalExpense: 1200.0, + // status: "Approved", + // }, + // { + // id: 11, + // name: "Training Programs - January 2025", + // lastUpdated: "15-01-2025 10:30 am", + // reportType: "Expense", + // totalExpense: 900.0, + // status: "Saved", + // }, + // ]); + + const [department, setDepartment] = useState([ { id: 1, @@ -637,7 +974,7 @@ const GlobalStateProvider = ({ children }) => { { id: "12451", name: "Kartikey Gautam", - emailID: "kg@wdimails.com", + emailID: "mailto:kg@wdimails.com", department: "Finance", role: "Sr. Accountant", permissions: "Subadmin", @@ -645,7 +982,7 @@ const GlobalStateProvider = ({ children }) => { { id: "12451", name: "Kartikey Gautam", - emailID: "kg@wdimails.com", + emailID: "mailto:kg@wdimails.com", department: "Finance", role: "Sr. Accountant", permissions: "Subadmin", @@ -653,7 +990,7 @@ const GlobalStateProvider = ({ children }) => { { id: "12451", name: "Kartikey Gautam", - emailID: "kg@wdimails.com", + emailID: "mailto:kg@wdimails.com", department: "Finance", role: "Sr. Accountant", permissions: "Subadmin", @@ -661,7 +998,7 @@ const GlobalStateProvider = ({ children }) => { { id: "12451", name: "Kartikey Gautam", - emailID: "kg@wdimails.com", + emailID: "mailto:kg@wdimails.com", department: "Finance", role: "Sr. Accountant", permissions: "Subadmin", @@ -669,7 +1006,7 @@ const GlobalStateProvider = ({ children }) => { { id: "12451", name: "Kartikey Gautam", - emailID: "kg@wdimails.com", + emailID: "mailto:kg@wdimails.com", department: "Finance", role: "Sr. Accountant", permissions: "Subadmin", @@ -677,7 +1014,7 @@ const GlobalStateProvider = ({ children }) => { { id: "12451", name: "Kartikey Gautam", - emailID: "kg@wdimails.com", + emailID: "mailto:kg@wdimails.com", department: "Finance", role: "Sr. Accountant", permissions: "Subadmin", @@ -685,7 +1022,7 @@ const GlobalStateProvider = ({ children }) => { { id: "12451", name: "Kartikey Gautam", - emailID: "kg@wdimails.com", + emailID: "mailto:kg@wdimails.com", department: "Finance", role: "Sr. Accountant", permissions: "Subadmin", @@ -693,7 +1030,7 @@ const GlobalStateProvider = ({ children }) => { { id: "12451", name: "Kartikey Gautam", - emailID: "kg@wdimails.com", + emailID: "mailto:kg@wdimails.com", department: "Finance", role: "Sr. Accountant", permissions: "Subadmin", @@ -701,7 +1038,7 @@ const GlobalStateProvider = ({ children }) => { { id: "12451", name: "Kartikey Gautam", - emailID: "kg@wdimails.com", + emailID: "mailto:kg@wdimails.com", department: "Finance", role: "Sr. Accountant", permissions: "Subadmin", @@ -709,60 +1046,95 @@ const GlobalStateProvider = ({ children }) => { { id: "12451", name: "Kartikey Gautam", - emailID: "kg@wdimails.com", + emailID: "mailto:kg@wdimails.com", department: "Finance", role: "Sr. Accountant", permissions: "Subadmin", }, ]); - const [reimbursementStatus, setReimbursementStatus] = useState([ - { - reportName: "Jan 12, 2022", - reportBy: "in***@wdimails.com", - reportAmount: "+91 ***8451254", - dateTime: "Sales", - orderStatus: "Approved", - approver: "Sales", - disburser: "Sales", - }, - { - reportName: "Jan 12, 2022", - reportBy: "in***@wdimails.com", - reportAmount: "+91 ***8451254", - dateTime: "Sales", - orderStatus: "Approved", - approver: "Sales", - disburser: "Sales", - }, - { - reportName: "Jan 12, 2022", - reportBy: "in***@wdimails.com", - reportAmount: "+91 ***8451254", - dateTime: "Sales", - orderStatus: "Approved", - approver: "Sales", - disburser: "Sales", - }, - { - reportName: "Jan 12, 2022", - reportBy: "in***@wdimails.com", - reportAmount: "+91 ***8451254", - dateTime: "Sales", - orderStatus: "Fully reimbursed", - approver: "Sales", - disburser: "Sales", - }, - { - reportName: "Jan 12, 2022", - reportBy: "in***@wdimails.com", - reportAmount: "+91 ***8451254", - dateTime: "Sales", - orderStatus: "Fully reimbursed", - approver: "Sales", - disburser: "Sales", - }, - ]); + // const [employeePermissions, setEmployeePermissions] = useState([ + // { + // "id": "12451", + // "name": "Kartikey Gautam", + // "emailID": "mailto:kg@wdimails.com", + // "department": "Finance", + // "role": "Sr. Accountant", + // "permissions": "Subadmin", + // }, + // { + // "id": "12451", + // "name": "Kartikey Gautam", + // "emailID": "mailto:kg@wdimails.com", + // "department": "Finance", + // "role": "Sr. Accountant", + // "permissions": "Subadmin", + // }, + // { + // "id": "12451", + // "name": "Kartikey Gautam", + // "emailID": "mailto:kg@wdimails.com", + // "department": "Finance", + // "role": "Sr. Accountant", + // "permissions": "Subadmin", + // }, + // { + // "id": "12451", + // "name": "Kartikey Gautam", + // "emailID": "mailto:kg@wdimails.com", + // "department": "Finance", + // "role": "Sr. Accountant", + // "permissions": "Subadmin", + // }, + // { + // "id": "12451", + // "name": "Kartikey Gautam", + // "emailID": "mailto:kg@wdimails.com", + // "department": "Finance", + // "role": "Sr. Accountant", + // "permissions": "Subadmin", + // }, + // { + // "id": "12451", + // "name": "Kartikey Gautam", + // "emailID": "mailto:kg@wdimails.com", + // "department": "Finance", + // "role": "Sr. Accountant", + // "permissions": "Subadmin", + // }, + // { + // "id": "12451", + // "name": "Kartikey Gautam", + // "emailID": "mailto:kg@wdimails.com", + // "department": "Finance", + // "role": "Sr. Accountant", + // "permissions": "Subadmin", + // }, + // { + // "id": "12451", + // "name": "Kartikey Gautam", + // "emailID": "mailto:kg@wdimails.com", + // "department": "Finance", + // "role": "Sr. Accountant", + // "permissions": "Subadmin", + // }, + // { + // "id": "12451", + // "name": "Kartikey Gautam", + // "emailID": "mailto:kg@wdimails.com", + // "department": "Finance", + // "role": "Sr. Accountant", + // "permissions": "Subadmin", + // }, + // { + // "id": "12451", + // "name": "Kartikey Gautam", + // "emailID": "mailto:kg@wdimails.com", + // "department": "Finance", + // "role": "Sr. Accountant", + // "permissions": "Subadmin", + // }, + // ]); const [advanceStatus, setAdvanceStatus] = useState([ { @@ -812,98 +1184,499 @@ const GlobalStateProvider = ({ children }) => { }, ]); + // const [reimbursementStatus, setReimbursementStatus] = useState([ + // { + // "reportName": "Jan 12, 2022", + // "reportBy": "in***@wdimails.com", + // "reportAmount": "+91 ***8451254", + // "dateTime": "Sales", + // "orderStatus": "Approved", + // "approver": "Sales", + // "disburser": "Sales", + // }, + // { + // "reportName": "Jan 12, 2022", + // "reportBy": "in***@wdimails.com", + // "reportAmount": "+91 ***8451254", + // "dateTime": "Sales", + // "orderStatus": "Approved", + // "approver": "Sales", + // "disburser": "Sales", + // }, + // { + // "reportName": "Jan 12, 2022", + // "reportBy": "in***@wdimails.com", + // "reportAmount": "+91 ***8451254", + // "dateTime": "Sales", + // "orderStatus": "Approved", + // "approver": "Sales", + // "disburser": "Sales", + // }, + // { + // "reportName": "Jan 12, 2022", + // "reportBy": "in***@wdimails.com", + // "reportAmount": "+91 ***8451254", + // "dateTime": "Sales", + // "orderStatus": "Fully reimbursed", + // "approver": "Sales", + // "disburser": "Sales", + // }, + // { + // "reportName": "Jan 12, 2022", + // "reportBy": "in***@wdimails.com", + // "reportAmount": "+91 ***8451254", + // "dateTime": "Sales", + // "orderStatus": "Fully reimbursed", + // "approver": "Sales", + // "disburser": "Sales", + // } + // ]); + const [reimbursementStatus, setReimbursementStatus] = useState([ + { + reportName: "Jan 12, 2022", + reportBy: "in***@wdimails.com", + reportAmount: "+91 ***8451254", + dateTime: "Sales", + orderStatus: "Approved", + approver: "Sales", + disburser: "Sales", + }, + { + reportName: "Jan 12, 2022", + reportBy: "in***@wdimails.com", + reportAmount: "+91 ***8451254", + dateTime: "Sales", + orderStatus: "Approved", + approver: "Sales", + disburser: "Sales", + }, + { + reportName: "Jan 12, 2022", + reportBy: "in***@wdimails.com", + reportAmount: "+91 ***8451254", + dateTime: "Sales", + orderStatus: "Approved", + approver: "Sales", + disburser: "Sales", + }, + { + reportName: "Jan 12, 2022", + reportBy: "in***@wdimails.com", + reportAmount: "+91 ***8451254", + dateTime: "Sales", + orderStatus: "Fully reimbursed", + approver: "Sales", + disburser: "Sales", + }, + { + reportName: "Jan 12, 2022", + reportBy: "in***@wdimails.com", + reportAmount: "+91 ***8451254", + dateTime: "Sales", + orderStatus: "Fully reimbursed", + approver: "Sales", + disburser: "Sales", + }, + ]); + + // const [advanceStatus, setAdvanceStatus] = useState([ + // { + // reportName: "Jan 12, 2022", + // reportBy: "in***@wdimails.com", + // reportAmount: "+91 ***8451254", + // dateTime: "Sales", + // orderStatus: "Approved", + // approver: "Sales", + // disburser: "Sales", + // }, + // { + // reportName: "Jan 12, 2022", + // reportBy: "in***@wdimails.com", + // reportAmount: "+91 ***8451254", + // dateTime: "Sales", + // orderStatus: "Approved", + // approver: "Sales", + // disburser: "Sales", + // }, + // { + // reportName: "Jan 12, 2022", + // reportBy: "in***@wdimails.com", + // reportAmount: "+91 ***8451254", + // dateTime: "Sales", + // orderStatus: "Approved", + // approver: "Sales", + // disburser: "Sales", + // }, + // { + // reportName: "Jan 12, 2022", + // reportBy: "in***@wdimails.com", + // reportAmount: "+91 ***8451254", + // dateTime: "Sales", + // orderStatus: "Fully reimbursed", + // approver: "Sales", + // disburser: "Sales", + // }, + // { + // reportName: "Jan 12, 2022", + // reportBy: "in***@wdimails.com", + // reportAmount: "+91 ***8451254", + // dateTime: "Sales", + // orderStatus: "Fully reimbursed", + // approver: "Sales", + // disburser: "Sales", + // }, + // ]); + + // const [digital, setDigital] = useState([ + // { + // id: 1, + // orderid: "#451245", + // laodStatus: "Fully Loaded", + // dateTime: "10 June 2024, 10am", + // totalvaluation: "₹ 70,000", + // activationStatus: "Active", + // CardDeliveryStatus: "Delivered", + // quantity: "500", + // }, + // { + // id: 2, + // orderid: "#451245", + // laodStatus: "Fully Loaded", + // dateTime: "10 June 2024, 10am", + // totalvaluation: "₹ 70,000", + // activationStatus: "Active", + // CardDeliveryStatus: "Not Delivered", + // quantity: "500", + // }, + // { + // id: 3, + // orderid: "#451245", + // laodStatus: "Fully Loaded", + // dateTime: "10 June 2024, 10am", + // totalvaluation: "₹ 70,000", + // activationStatus: "Activate", + // CardDeliveryStatus: "Delivered", + // quantity: "500", + // }, + // { + // id: 3, + // orderid: "#451245", + // laodStatus: "Fully Loaded", + // dateTime: "10 June 2024, 10am", + // totalvaluation: "₹ 70,000", + // activationStatus: "Partially Active", + // CardDeliveryStatus: "Partially Delivered", + // quantity: "500", + // }, + // { + // id: 4, + // orderid: "#451245", + // laodStatus: "Fully Loaded", + // dateTime: "10 June 2024, 10am", + // totalvaluation: "₹ 70,000", + // activationStatus: "Active", + // CardDeliveryStatus: "Not Delivered", + // quantity: "500", + // }, + // { + // id: 5, + // orderid: "#451245", + // laodStatus: "Fully Loaded", + // dateTime: "10 June 2024, 10am", + // totalvaluation: "₹ 70,000", + // activationStatus: "Partially Active", + // CardDeliveryStatus: "Not Delivered", + // quantity: "500", + // }, + // { + // id: 6, + // orderid: "#451245", + // laodStatus: "Fully Loaded", + // dateTime: "10 June 2024, 10am", + // totalvaluation: "₹ 70,000", + // activationStatus: "Active", + // CardDeliveryStatus: "Delivered", + // quantity: "500", + // }, + // { + // id: 7, + // orderid: "#451245", + // laodStatus: "Fully Loaded", + // dateTime: "10 June 2024, 10am", + // totalvaluation: "₹ 70,000", + // activationStatus: "Activate", + // CardDeliveryStatus: "Delivered", + // quantity: "500", + // }, + // { + // id: 8, + // orderid: "#451245", + // laodStatus: "Fully Loaded", + // dateTime: "10 June 2024, 10am", + // totalvaluation: "₹ 70,000", + // activationStatus: "Activate", + // CardDeliveryStatus: "Delivered", + // quantity: "500", + // }, + // ]); + + // const [advanceStatus, setAdvanceStatus] = useState([ + // { + // "reportName": "Jan 12, 2022", + // "reportBy": "in***@wdimails.com", + // "reportAmount": "+91 ***8451254", + // "dateTime": "Sales", + // "orderStatus": "Approved", + // "approver": "Sales", + // "disburser": "Sales", + // }, + // { + // "reportName": "Jan 12, 2022", + // "reportBy": "in***@wdimails.com", + // "reportAmount": "+91 ***8451254", + // "dateTime": "Sales", + // "orderStatus": "Approved", + // "approver": "Sales", + // "disburser": "Sales", + // }, + // { + // "reportName": "Jan 12, 2022", + // "reportBy": "in***@wdimails.com", + // "reportAmount": "+91 ***8451254", + // "dateTime": "Sales", + // "orderStatus": "Approved", + // "approver": "Sales", + // "disburser": "Sales", + // }, + // { + // "reportName": "Jan 12, 2022", + // "reportBy": "in***@wdimails.com", + // "reportAmount": "+91 ***8451254", + // "dateTime": "Sales", + // "orderStatus": "Fully reimbursed", + // "approver": "Sales", + // "disburser": "Sales", + // }, + // { + // "reportName": "Jan 12, 2022", + // "reportBy": "in***@wdimails.com", + // "reportAmount": "+91 ***8451254", + // "dateTime": "Sales", + // "orderStatus": "Fully reimbursed", + // "approver": "Sales", + // "disburser": "Sales", + // }, + + // ] + // ) + const [digital, setDigital] = useState([ { id: 1, - orderid: "#451245", - laodStatus: "Fully Loaded", - dateTime: "10 June 2024, 10am", - totalvaluation: "₹ 70,000", - activationStatus: "Active", - CardDeliveryStatus: "Delivered", - quantity: "500", + "orderid": "#451245", + "laodStatus": "Fully Loaded", + "dateTime": "10 June 2024, 10am", + "totalvaluation": "₹ 70,000", + "activationStatus": "Active", + "CardDeliveryStatus": "Delivered", + "quantity": "500" }, { id: 2, - orderid: "#451245", - laodStatus: "Fully Loaded", - dateTime: "10 June 2024, 10am", - totalvaluation: "₹ 70,000", - activationStatus: "Active", - CardDeliveryStatus: "Not Delivered", - quantity: "500", + "orderid": "#451245", + "laodStatus": "Fully Loaded", + "dateTime": "10 June 2024, 10am", + "totalvaluation": "₹ 70,000", + "activationStatus": "Active", + "CardDeliveryStatus": "Not Delivered", + "quantity": "500" }, { id: 3, - orderid: "#451245", - laodStatus: "Fully Loaded", - dateTime: "10 June 2024, 10am", - totalvaluation: "₹ 70,000", - activationStatus: "Activate", - CardDeliveryStatus: "Delivered", - quantity: "500", + "orderid": "#451245", + "laodStatus": "Fully Loaded", + "dateTime": "10 June 2024, 10am", + "totalvaluation": "₹ 70,000", + "activationStatus": "Activate", + "CardDeliveryStatus": "Delivered", + "quantity": "500" }, { id: 3, - orderid: "#451245", - laodStatus: "Fully Loaded", - dateTime: "10 June 2024, 10am", - totalvaluation: "₹ 70,000", - activationStatus: "Partially Active", - CardDeliveryStatus: "Partially Delivered", - quantity: "500", + "orderid": "#451245", + "laodStatus": "Fully Loaded", + "dateTime": "10 June 2024, 10am", + "totalvaluation": "₹ 70,000", + "activationStatus": "Partially Active", + "CardDeliveryStatus": "Partially Delivered", + "quantity": "500" + }, { id: 4, - orderid: "#451245", - laodStatus: "Fully Loaded", - dateTime: "10 June 2024, 10am", - totalvaluation: "₹ 70,000", - activationStatus: "Active", - CardDeliveryStatus: "Not Delivered", - quantity: "500", + "orderid": "#451245", + "laodStatus": "Fully Loaded", + "dateTime": "10 June 2024, 10am", + "totalvaluation": "₹ 70,000", + "activationStatus": "Active", + "CardDeliveryStatus": "Not Delivered", + "quantity": "500" }, { id: 5, - orderid: "#451245", - laodStatus: "Fully Loaded", - dateTime: "10 June 2024, 10am", - totalvaluation: "₹ 70,000", - activationStatus: "Partially Active", - CardDeliveryStatus: "Not Delivered", - quantity: "500", + "orderid": "#451245", + "laodStatus": "Fully Loaded", + "dateTime": "10 June 2024, 10am", + "totalvaluation": "₹ 70,000", + "activationStatus": "Partially Active", + "CardDeliveryStatus": "Not Delivered", + "quantity": "500" }, { id: 6, - orderid: "#451245", - laodStatus: "Fully Loaded", - dateTime: "10 June 2024, 10am", - totalvaluation: "₹ 70,000", - activationStatus: "Active", - CardDeliveryStatus: "Delivered", - quantity: "500", + "orderid": "#451245", + "laodStatus": "Fully Loaded", + "dateTime": "10 June 2024, 10am", + "totalvaluation": "₹ 70,000", + "activationStatus": "Active", + "CardDeliveryStatus": "Delivered", + "quantity": "500" }, { id: 7, - orderid: "#451245", - laodStatus: "Fully Loaded", - dateTime: "10 June 2024, 10am", - totalvaluation: "₹ 70,000", - activationStatus: "Activate", - CardDeliveryStatus: "Delivered", - quantity: "500", + "orderid": "#451245", + "laodStatus": "Fully Loaded", + "dateTime": "10 June 2024, 10am", + "totalvaluation": "₹ 70,000", + "activationStatus": "Activate", + "CardDeliveryStatus": "Delivered", + "quantity": "500" }, { id: 8, - orderid: "#451245", - laodStatus: "Fully Loaded", - dateTime: "10 June 2024, 10am", - totalvaluation: "₹ 70,000", - activationStatus: "Activate", - CardDeliveryStatus: "Delivered", - quantity: "500", + "orderid": "#451245", + "laodStatus": "Fully Loaded", + "dateTime": "10 June 2024, 10am", + "totalvaluation": "₹ 70,000", + "activationStatus": "Activate", + "CardDeliveryStatus": "Delivered", + "quantity": "500" }, - ]); + ]) + + + + const [AdvanceExpenseRequest, setAdvanceExpenseRequest] = useState([ + { + id: 1, + ReportName: "Advance expense report 2024", + ReportBy: { + profImage: "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", + profName: "Raju", + }, + ReportAmount: "₹ 50000", + DateTime: "10 June, 2924 10 am", + Approver: "Reethik thota", + Disburser: "Manav sain", + Action: "View" + }, + { + id: 2, + ReportName: "Advance expense report 2024", + ReportBy: { + profImage: "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", + profName: "Raju", + }, + ReportAmount: "₹ 50000", + DateTime: "10 June, 2924 10 am", + Approver: "Reethik thota", + Disburser: "Manav sain", + Action: "View" + }, + { + id: 3, + ReportName: "Advance expense report 2024", + ReportBy: { + profImage: "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", + profName: "Raju", + }, + ReportAmount: "₹ 50000", + DateTime: "10 June, 2924 10 am", + Approver: "Reethik thota", + Disburser: "Manav sain", + Action: "View" + }, + { + id: 4, + ReportName: "Advance expense report 2024", + ReportBy: { + profImage: "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", + profName: "Raju", + }, + ReportAmount: "₹ 50000", + DateTime: "10 June, 2924 10 am", + Approver: "Reethik thota", + Disburser: "Manav sain", + Action: "View" + }, + { + id: 5, + ReportName: "Advance expense report 2024", + ReportBy: { + profImage: "https://images.pexels.com/photos/771742/pexels-photo-771742.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", + profName: "Raju", + }, + ReportAmount: "₹ 50000", + DateTime: "10 June, 2924 10 am", + Approver: "Reethik thota", + Disburser: "Manav sain", + Action: "View" + }, + ]) + + const [AdvanceExpenseRequestView, setAdvanceExpenseRequestView] = useState([ + { + "DateTime": "10 June, 2924 10 am", + "Merchant": "Dine in", + "Category": "Food", + "Paymentmode": "Expense card", + "ReimburseAmount": "₹ 50000", + "Bills": "", + "Disburser": "Manav sain", + "Action": "" + }, + { + "DateTime": "10 June, 2924 10 am", + "Merchant": "Airtel postpaid", + "Category": "Telecom", + "Paymentmode": "Expense card", + "ReimburseAmount": "₹ 50000", + "Bills": "", + "Disburser": "Manav sain", + "Action": "" + }, + { + "DateTime": "10 June, 2924 10 am", + "Merchant": "Lorem ipsme", + "Category": "Fuel", + "Paymentmode": "Expense card", + "ReimburseAmount": "₹ 50000", + "Bills": "", + "Disburser": "Manav sain", + "Action": "" + }, + { + "DateTime": "10 June, 2924 10 am", + "Merchant": "Dine in", + "Category": "Food", + "Paymentmode": "Expense card", + "ReimburseAmount": "₹ 50000", + "Bills": "", + "Disburser": "Manav sain", + "Action": "" + }, + ]) + const [ApplicationStatus, setApplicationStatus] = useState([ { @@ -1134,6 +1907,10 @@ const GlobalStateProvider = ({ children }) => { setDigital, ApplicationStatus, setAdvanceStatus, + AdvanceExpenseRequest, + setAdvanceExpenseRequest, + AdvanceExpenseRequestView, + setAdvanceExpenseRequestView, walletProgram }} > diff --git a/src/Pages/Onboarding/OnboardingAboutCompany.jsx b/src/Pages/Onboarding/OnboardingAboutCompany.jsx index 873261b..6cae1a3 100644 --- a/src/Pages/Onboarding/OnboardingAboutCompany.jsx +++ b/src/Pages/Onboarding/OnboardingAboutCompany.jsx @@ -14,6 +14,8 @@ import { FormErrorMessage, IconButton, Button, + Spinner, + useToast, } from "@chakra-ui/react"; import PhoneInput from "react-phone-input-2"; import "react-phone-input-2/lib/style.css"; @@ -25,6 +27,9 @@ import * as Yup from "yup"; import { yupResolver } from "@hookform/resolvers/yup"; import { ArrowBackIcon, ArrowForwardIcon } from "@chakra-ui/icons"; import { OPACITY_ON_LOAD } from "../../Layout/animations"; +import { useSentFileMutation } from "../../Services/token.serivce"; +import FileUploader from "../../Components/FileUploader/FileUploader"; +import ToastBox from "../../Components/ToastBox"; // Validation schema using Yup const validationSchema = Yup.object().shape({ @@ -33,6 +38,7 @@ const validationSchema = Yup.object().shape({ mobileNumber_corporate: Yup.string() .matches(/^\d{10}$/, "Phone number must be 10 digits") .required("Phone number is required"), + logo_path_file_name:Yup.mixed().required('Company logo is required'), }); const OnboardingAboutCompany = ({ @@ -43,11 +49,15 @@ const OnboardingAboutCompany = ({ steps, handleNext, }) => { - const { data, isLoading } = useGetPrePopQuery(); + const { data } = useGetPrePopQuery(); + const toast = useToast() console.log(data?.data?.prepopulateData); const [phone, setPhone] = useState(""); + const [isLoading, setIsLoading] = useState(false); + + const [sendFile] = useSentFileMutation(); // Setup form handling with react-hook-form const { @@ -71,18 +81,65 @@ const OnboardingAboutCompany = ({ .splice(countryCode.length - 1, 15) .join("") ); // Sync phone number - setValue("ISDcode_corporate", countryCode); // Sync ISD code + setValue("ISDCode_corporate", countryCode); // Sync ISD code }; - // Handle form submission - const onSubmit = (data) => { - setCorpData({ ...corpData, ...data }); + const onSubmit = async (data) => { + setCorpData({ ...corpData, ...data }); handleNext(); // Handle your submit logic here }; + + + + + const handleFileUpload = async (file, setPreview) => { + setIsLoading(true) + console.log('File uploaded:', file); + const formData = new FormData(); + formData.append("document", file); // Append file + + const code = localStorage?.getItem("codeCorporate"); + try { + const res = await sendFile({ data: formData, code }); // Upload file to server + console.log(res); + if (res?.data?.data) { + // Assuming res.data.data contains the file URL or some ID + setCorpData({ ...corpData, logo_path_file_name:res?.data?.data }); + setValue("logo_path_file_name", res?.data?.data); + console.log(errors); + setPreview(res?.data?.data) + toast({ + render: () => , + }); + setIsLoading(false); + } else if (res?.error?.data?.message){ + toast({ + render: () => , + }); + + } else if(res?.error){ + toast({ + render: () => , + }); + + } + setIsLoading(false) + } catch (error) { + console.error("File upload failed", error); + + } + }; + + const handleFileRemove = () => { + console.log('File removed'); + }; + + + return ( - + About your company @@ -172,7 +229,7 @@ const OnboardingAboutCompany = ({ {/* Upload Company Logo Field */} - + {/* Upload Company Logo @@ -211,9 +268,24 @@ const OnboardingAboutCompany = ({ type="file" id="company-logo-file-input" style={{ display: "none" }} // Hide the file input + onChange={(e) => { + handleFileChange(e); // Handle file input + }} /> + + {fileName && ( + + Uploaded file: {fileName} + + )} + {errors.logo_path_file_name && ( + + {errors.logo_path_file_name.message} + + )} + Supported formats- jpg, png, svg @@ -247,12 +319,70 @@ const OnboardingAboutCompany = ({ rightIcon={} w={"100%"} type="submit" + isLoading={isLoading} > {activeStep === steps.length - 1 ? "Next step" : "Next step"} - + */} + + + + + {errors.logo_path_file_name?.message && ( + + {errors.logo_path_file_name?.message} + + )} + + + + + } + variant="outline" + size="sm" + px={8} + _hover={{ opacity: 0.8 }} + color={"#d0b8ef"} + border={"1px solid #d0b8ef"} + isDisabled={activeStep === 0} + onClick={() => setActiveStep(activeStep - 1)} + /> + + + + + + + {/* Display the loading spinner */} + {isLoading && ( + + Uploading please wait... + + )} + + ); }; diff --git a/src/Pages/Onboarding/OnboardingAddCompanyDetails.jsx b/src/Pages/Onboarding/OnboardingAddCompanyDetails.jsx index b70a61d..d571bef 100644 --- a/src/Pages/Onboarding/OnboardingAddCompanyDetails.jsx +++ b/src/Pages/Onboarding/OnboardingAddCompanyDetails.jsx @@ -1,40 +1,204 @@ -import React from 'react'; -import { Box, Input, Text, VStack, HStack, FormLabel } from '@chakra-ui/react'; +import React, { useState } from 'react'; +import { Box, Input, Text, VStack, HStack, FormLabel, IconButton, Button, useToast } from '@chakra-ui/react'; import { SlCloudUpload } from 'react-icons/sl'; import { useForm } from 'react-hook-form'; import { yupResolver } from '@hookform/resolvers/yup'; import * as yup from 'yup'; import { OPACITY_ON_LOAD } from '../../Layout/animations'; +import { ArrowBackIcon, ArrowForwardIcon } from '@chakra-ui/icons'; +import { useSentFileMutation } from '../../Services/token.serivce'; +import FileUploader from '../../Components/FileUploader/FileUploader'; +import ToastBox from '../../Components/ToastBox'; // Yup validation schema const schema = yup.object().shape({ - cin: yup + cin_number: yup .string() .required('CIN is required') .matches(/^[A-Za-z0-9]{21}$/, 'CIN must be exactly 21 characters long'), - pan: yup + pancard_number: yup .string() .required('Company PAN is required') .matches(/[A-Z]{5}[0-9]{4}[A-Z]{1}$/, 'Invalid PAN format'), - gst: yup + gst_number: yup .string() .required('GST number is required') .matches(/\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}/, 'Invalid GST number format'), - // gstFile: yup.mixed().required('GST certificate is required'), - // panFile: yup.mixed().required('PAN card is required'), + gst_file_path_name: yup.mixed().required('GST certificate is required'), + pancard_file_path_name: yup.mixed().required('PAN card is required'), }); -const OnboardingAddCompanyDetails = () => { - const { register, handleSubmit, formState: { errors } } = useForm({ +const OnboardingAddCompanyDetails = ({ + corpData, + setCorpData, + setActiveStep, + activeStep, + steps, + handleNext, +}) => { + const { register, handleSubmit, setValue, formState: { errors } } = useForm({ resolver: yupResolver(schema), }); + + const [fileName, setFileName] = useState(""); + const [ sendFile ] = useSentFileMutation() + const [ isLoading, setIsLoading ] = useState() + const toast = useToast() + const onSubmit = (data) => { console.log('Form Data:', data); + setCorpData({ ...corpData, ...data }); + handleNext(); }; + + + const handleFileChangeGst = async (e) => { + console.log("hit"); + const files = e.target.files; + console.log(files); + if (files && files.length > 0) { + // Assuming only one file is allowed + setFileName(files.name); + console.log(files); + + const formData = new FormData(); + formData.append("document", files[0]); // Append file + + + const code = localStorage?.getItem("codeCorporate"); + try { + const res = await sendFile({data:formData, code}); // Upload file to server + + if (res?.data?.data) { + console.log(res?.data?.data); + // Assuming res.data.data contains the file URL or some ID + setValue("gst_file_path_name", res?.data?.data); // Set value with server response + // setCorpData({ ...corpData, ...data }); + setIsLoading(false) + } + } catch (error) { + console.error("File upload failed", error); + } + + + + // setValue("logo_path_file_name", files); // Update react-hook-form state + } + }; + + + + const handleFileChangePan = async (e) => { + const files = e.target.files; + if (files && files.length > 0) { + // Assuming only one file is allowed + setFileName(files.name); + const formData = new FormData(); + formData.append("document", files[0]); // Append file + const code = localStorage?.getItem("codeCorporate"); + try { + const res = await sendFile({data:formData, code}); // Upload file to server + if (res?.data?.data) { + // Assuming res.data.data contains the file URL or some ID + setValue("pancard_file_path_name", res?.data?.data); // Set value with server response + // setCorpData({ ...corpData, ...data }); + setIsLoading(false) + } + } catch (error) { + console.error("File upload failed", error); + } + } + }; + + + + + const handleFileUploadGst = async (file, setPreview) => { + setIsLoading(true) + console.log('File uploaded:', file); + const formData = new FormData(); + formData.append("document", file); // Append file + + const code = localStorage?.getItem("codeCorporate"); + try { + const res = await sendFile({ data: formData, code }); // Upload file to server + console.log(res); + if (res?.data?.data) { + // Assuming res.data.data contains the file URL or some ID + setCorpData({ ...corpData, gst_file_path_name:res?.data?.data }); + setValue("gst_file_path_name", res?.data?.data); + console.log(errors); + setPreview(res?.data?.data) + toast({ + render: () => , + }); + setIsLoading(false); + } else if (res?.error?.data?.message){ + toast({ + render: () => , + }); + + } else if(res?.error){ + toast({ + render: () => , + }); + + } + setIsLoading(false) + } catch (error) { + console.error("File upload failed", error); + + } + }; + + + const handleFileUploadPan = async (file, setPreview) => { + setIsLoading(true) + console.log('File uploaded:', file); + const formData = new FormData(); + formData.append("document", file); // Append file + + const code = localStorage?.getItem("codeCorporate"); + try { + const res = await sendFile({ data: formData, code }); // Upload file to server + console.log(res); + if (res?.data?.data) { + // Assuming res.data.data contains the file URL or some ID + setCorpData({ ...corpData, pancard_file_path_name:res?.data?.data }); + setValue("pancard_file_path_name", res?.data?.data); + console.log(errors); + setPreview(res?.data?.data) + toast({ + render: () => , + }); + setIsLoading(false); + } else if (res?.error?.data?.message){ + toast({ + render: () => , + }); + + } else if(res?.error){ + toast({ + render: () => , + }); + + } + setIsLoading(false) + } catch (error) { + console.error("File upload failed", error); + + } + }; + + + + + + return ( - + Add company details @@ -54,9 +218,9 @@ const OnboardingAddCompanyDetails = () => { borderRadius="md" fontSize={"sm"} fontWeight={500} - {...register('cin')} + {...register('cin_number')} /> - {errors.cin && {errors.cin.message}} + {errors.cin_number && {errors.cin_number.message}} {/* Company PAN Field */} @@ -70,9 +234,9 @@ const OnboardingAddCompanyDetails = () => { borderRadius="md" fontSize={"sm"} fontWeight={500} - {...register('pan')} + {...register('pancard_number')} /> - {errors.pan && {errors.pan.message}} + {errors.pancard_number && {errors.pancard_number.message}} {/* Company GST Number */} @@ -86,13 +250,13 @@ const OnboardingAddCompanyDetails = () => { borderRadius="md" fontSize={"sm"} fontWeight={500} - {...register('gst')} + {...register('gst_number')} /> - {errors.gst && {errors.gst.message}} + {errors.gst_number && {errors.gst_number.message}} {/* Upload GST Certificate */} - + {/* Upload GST Certificate @@ -118,7 +282,7 @@ const OnboardingAddCompanyDetails = () => { mt={'2'} mb={0} > - Drag and drop files here or{' '} + Drag and drop files or{' '} Choose file @@ -128,10 +292,13 @@ const OnboardingAddCompanyDetails = () => { type="file" id="gst-file-input" style={{ display: 'none' }} - {...register('gstFile')} + + onChange={(e) => { + handleFileChangeGst(e); // Handle file input + }} /> - {errors.gstFile && {errors.gstFile.message}} + {errors.gst_file_path_name && {errors.gst_file_path_name.message}} @@ -141,10 +308,42 @@ const OnboardingAddCompanyDetails = () => { Maximum size - 20MB - + */} + + + + + {errors.gst_file_path_name?.message && ( + + {errors.gst_file_path_name?.message} + + )} + + + + + + {errors.pancard_file_path_name?.message && ( + + {errors.pancard_file_path_name?.message} + + )} + + + {/* Upload PAN Card */} - + {/* Upload PAN Card @@ -180,7 +379,11 @@ const OnboardingAddCompanyDetails = () => { type="file" id="pan-file-input" style={{ display: 'none' }} - {...register('panFile')} + + onChange={(e) => { + handleFileChangePan(e); // Handle file input + }} + /> {errors.panFile && {errors.panFile.message}} @@ -193,10 +396,10 @@ const OnboardingAddCompanyDetails = () => { Maximum size - 20MB - + */} {/* Submit Button */} - + {/* { > Submit - + */} + + + + + } + variant="outline" + size="sm" + px={8} + _hover={{ opacity: 0.8 }} + color={"#d0b8ef"} + border={"1px solid #d0b8ef"} + isDisabled={activeStep === 0} + onClick={() => setActiveStep(activeStep - 1)} + /> + + + + + {/* Display the loading spinner */} + {isLoading && ( + + Uploading please wait... + + )} ); }; diff --git a/src/Pages/Onboarding/OnboardingDirectorDetails.jsx b/src/Pages/Onboarding/OnboardingDirectorDetails.jsx index cf55cf4..b08ce83 100644 --- a/src/Pages/Onboarding/OnboardingDirectorDetails.jsx +++ b/src/Pages/Onboarding/OnboardingDirectorDetails.jsx @@ -1,294 +1,455 @@ -import React, { useState } from 'react'; -import { Box, Input, Text, VStack, HStack } from '@chakra-ui/react'; -import { SlCloudUpload } from 'react-icons/sl'; -import PhoneInput from 'react-phone-input-2'; +import React, { useState } from "react"; +import { Box, Input, Text, VStack, HStack, IconButton, Button, Icon, Image, useDisclosure } from "@chakra-ui/react"; +import { SlCloudUpload } from "react-icons/sl"; +import PhoneInput from "react-phone-input-2"; +import { useSentFileMutation } from "../../Services/token.serivce"; +import { ArrowBackIcon, ArrowForwardIcon, DeleteIcon } from "@chakra-ui/icons"; +import { fadeIn } from "../../Components/FileUploader/FileUploader"; +import ImageViewer from "../../Components/ImageViewer"; -const OnboardingDirectorDetails = () => { - const [directorForms, setDirectorForms] = useState([ - { id: 1, directorName: '', directorEmail: '', directorPhone: '', selectedPanImage: '', selectedAadharImage: '' } +const OnboardingDirectorDetails = ({ + corpData, + setCorpData, + setActiveStep, + activeStep, + steps, + handleNext, +}) => { + const [directorForms, setDirectorForms] = useState([ + { + director_name: "", + emailAddress: "", + ISDCode: "", + mobileNumber: "", + pancard_file_path_name: "", + aadhar_file_path_name: "", + }, + ]); + + const [directorFormErrors, setDirectorFormErrors] = useState([]); + const { isOpen, onOpen, onClose } = useDisclosure(); + const [ isLoading, setIsLoading ] = useState(false) + const [ prevLink, setPrevLink ] = useState(null) + + const [sendFile] = useSentFileMutation(); + async function uploadFile(file) { + const formData = new FormData(); + formData.append("document", file); // Append file + const code = localStorage?.getItem("codeCorporate"); + try { + const res = await sendFile({ data: formData, code }); // Upload file to server + return res?.data?.data; + } catch (error) { + console.error("File upload failed", error); + } + } + + // Add new director form + const handleAddDirector = () => { + setDirectorForms([ + ...directorForms, + { + director_name: "", + emailAddress: "", + mobileNumber: "", + pancard_file_path_name: "", + aadhar_file_path_name: "", + }, ]); + }; - const [directorFormErrors, setDirectorFormErrors] = useState([]); + // Update the form field for a particular director + const handleFieldChange = (index, field, value, country = {}) => { + const updatedForms = [...directorForms]; + if (field === "mobileNumber") { + const countryCode = `+${country.dialCode}`; + updatedForms[index]["ISDCode"] = countryCode; + updatedForms[index]["mobileNumber"] = value + .split("") + .splice(countryCode.length - 1, 15) + .join(""); + } + updatedForms[index][field] = value; + setDirectorForms(updatedForms); + }; - // Add new director form - const handleAddDirector = () => { - setDirectorForms([ - ...directorForms, - { id: directorForms.length + 1, directorName: '', directorEmail: '', directorPhone: '', selectedPanImage: '', selectedAadharImage: '' } - ]); - }; + // Handle file upload for PAN and Aadhar + const handleFileUpload = async (index, field, event) => { - // Update the form field for a particular director - const handleFieldChange = (index, field, value) => { - const updatedForms = [...directorForms]; - updatedForms[index][field] = value; - setDirectorForms(updatedForms); - }; + setIsLoading(true) + const file = event.target.files[0]; + if (file) { + const filePath = await uploadFile(file); + const updatedForms = [...directorForms]; + updatedForms[index][field] = filePath; // Store file name (or file object) + setDirectorForms(updatedForms); + setIsLoading(false) + } + }; - // Handle file upload for PAN and Aadhar - const handleFileUpload = (index, field, event) => { - const file = event.target.files[0]; - if (file) { - const updatedForms = [...directorForms]; - updatedForms[index][field] = file.name; // Store file name (or file object) - setDirectorForms(updatedForms); - } - }; + // Basic validation for each field + const validateForm = () => { + const errors = directorForms.map((directorForm) => { + let formErrors = {}; - // Basic validation for each field - const validateForm = () => { - const errors = directorForms.map((directorForm) => { - let formErrors = {}; + if (!directorForm.director_name) { + formErrors.director_name = "Director Name is required."; + } - if (!directorForm.directorName) { - formErrors.directorName = "Director Name is required."; - } + if ( + !directorForm.emailAddress || + !/\S+@\S+\.\S+/.test(directorForm.emailAddress) + ) { + formErrors.emailAddress = "Please enter a valid email address."; + } - if (!directorForm.directorEmail || !/\S+@\S+\.\S+/.test(directorForm.directorEmail)) { - formErrors.directorEmail = "Please enter a valid email address."; - } + if ( + !directorForm.mobileNumber || + directorForm.mobileNumber.length < 10 + ) { + formErrors.mobileNumber = + "Phone number is required and should be at least 10 digits."; + } - if (!directorForm.directorPhone || directorForm.directorPhone.length < 10) { - formErrors.directorPhone = "Phone number is required and should be at least 10 digits."; - } + if (!directorForm.pancard_file_path_name) { + formErrors.pancard_file_path_name = "Please upload a PAN file."; + } - if (!directorForm.selectedPanImage) { - formErrors.selectedPanImage = "Please upload a PAN file."; - } + if (!directorForm.aadhar_file_path_name) { + formErrors.aadhar_file_path_name = "Please upload an Aadhar file."; + } - if (!directorForm.selectedAadharImage) { - formErrors.selectedAadharImage = "Please upload an Aadhar file."; - } + return formErrors; + }); - return formErrors; - }); + setDirectorFormErrors(errors); - setDirectorFormErrors(errors); - - // Check if all forms are valid (no errors in any form) - const isValid = errors.every((formErrors) => Object.keys(formErrors).length === 0); - return isValid; - }; - - // Handle form submission - const handleSubmit = () => { - if (validateForm()) { - console.log("Form is valid, proceed with submission."); - } else { - console.log("Form has errors."); - } - }; - - return ( - - - Add director details - - - Lorem ipsum dolor sit amet, adipiscing elit. - - - {directorForms?.map((directorForm, index) => ( - - - Director {index + 1} - - - {/* Director Name Field */} - - - Director Name - - handleFieldChange(index, 'directorName', e.target.value)} - /> - {directorFormErrors[index]?.directorName && ( - {directorFormErrors[index].directorName} - )} - - - {/* Director Email Field */} - - - Email - - handleFieldChange(index, 'directorEmail', e.target.value)} - /> - {directorFormErrors[index]?.directorEmail && ( - {directorFormErrors[index].directorEmail} - )} - - - {/* Director Phone Number */} - - - Phone Number - - handleFieldChange(index, 'directorPhone', value)} - inputStyle={{ - width: "100%", - borderRadius: "md", - paddingLeft: "6", - border: "1px solid #e2e8f0", - height: "40px" - }} - buttonStyle={{ - border: "none", - borderRadius: "8px 0 0 8px", - backgroundColor: "transparent", - }} - /> - {directorFormErrors[index]?.directorPhone && ( - {directorFormErrors[index].directorPhone} - )} - - - {/* Upload Pan */} - - - Upload Pan - - document.getElementById(`pan-file-input-${index}`).click()} - > - - - - {directorForm.selectedPanImage || "Drag and drop files here or Choose file"} - - - handleFileUpload(index, 'selectedPanImage', e)} - /> - - {directorFormErrors[index]?.selectedPanImage && ( - {directorFormErrors[index].selectedPanImage} - )} - - - {/* Upload Aadhar */} - - - Upload Aadhar - - document.getElementById(`aadhar-file-input-${index}`).click()} - > - - - - {directorForm.selectedAadharImage || "Drag and drop files here or Choose file"} - - - handleFileUpload(index, 'selectedAadharImage', e)} - /> - - {directorFormErrors[index]?.selectedAadharImage && ( - {directorFormErrors[index].selectedAadharImage} - )} - - - - ))} - - - handleAddDirector()} - > - + Add director {directorForms.length + 1} - - - - - handleSubmit()} - > - Submit - - - + // Check if all forms are valid (no errors in any form) + const isValid = errors.every( + (formErrors) => Object.keys(formErrors).length === 0 ); + return isValid; + }; + + // Handle form submission + const handleSubmit = () => { + // console.log(directorForms); + if (validateForm()) { + console.log("Form is valid, proceed with submission."); + const data = { + directors: directorForms, + }; + setCorpData({ ...corpData, ...data }); + handleNext(); + } else { + console.log("Form has errors."); + } + }; + + return ( + + + Add director details + + + Lorem ipsum dolor sit amet, adipiscing elit. + + + {directorForms?.map((directorForm, index) => ( + + + Director {index + 1} + + + {/* Director Name Field */} + + + Director Name + + + handleFieldChange(index, "director_name", e.target.value) + } + /> + {directorFormErrors[index]?.director_name && ( + + {directorFormErrors[index].director_name} + + )} + + + {/* Director Email Field */} + + + Email + + + handleFieldChange(index, "emailAddress", e.target.value) + } + /> + {directorFormErrors[index]?.emailAddress && ( + + {directorFormErrors[index].emailAddress} + + )} + + + {/* Director Phone Number */} + + + Phone Number + + + handleFieldChange(index, "mobileNumber", value, country) + } + inputStyle={{ + width: "100%", + borderRadius: "md", + paddingLeft: "6", + border: "1px solid #e2e8f0", + height: "40px", + }} + buttonStyle={{ + border: "none", + borderRadius: "8px 0 0 8px", + backgroundColor: "transparent", + }} + /> + {directorFormErrors[index]?.mobileNumber && ( + + {directorFormErrors[index].mobileNumber} + + )} + + + {/* Upload Pan */} + + + Upload Pan + + + {directorForm.pancard_file_path_name? + + { + setPrevLink(`${import.meta.env.VITE_IMAGE_URL}${directorForm.pancard_file_path_name}`) + onOpen()}} + cursor={'pointer'} src={`${import.meta.env.VITE_IMAGE_URL}${directorForm.pancard_file_path_name}`} alt="File Preview" + h={32} + objectFit={'cover'} + boxShadow={"md"} + borderRadius={"md"} w="100%" + animation={`${fadeIn} 0.5s ease-in-out`} /> + + document.getElementById(`pan-file-input-${index}`).click() + } + color={"red.500"} boxSize={8} + rounded={'md'} p={2} position={'absolute'} top={1} right={1} + _hover={{ + bg: "#fff" + }} as={DeleteIcon} + /> + : + document.getElementById(`pan-file-input-${index}`).click() + } + > + + + {directorForm.pancard_file_path_name || + "Drag and drop files here or Choose file"} + + } + + handleFileUpload(index, "pancard_file_path_name", e) + } + /> + + {directorFormErrors[index]?.pancard_file_path_name && ( + + {directorFormErrors[index].pancard_file_path_name} + + )} + + + {/* Upload Aadhar */} + + + Upload Aadhar + + + {directorForm.aadhar_file_path_name? + + { + setPrevLink(`${import.meta.env.VITE_IMAGE_URL}${directorForm.aadhar_file_path_name}`) + onOpen()}} + cursor={'pointer'} src={`${import.meta.env.VITE_IMAGE_URL}${directorForm.aadhar_file_path_name}`} alt="File Preview" + h={32} + objectFit={'cover'} + boxShadow={"md"} + borderRadius={"md"} w="100%" + animation={`${fadeIn} 0.5s ease-in-out`} /> + + document.getElementById(`pan-file-input-${index}`).click() + } + color={"red.500"} boxSize={8} + rounded={'md'} p={2} position={'absolute'} top={1} right={1} + _hover={{ + bg: "#fff" + }} as={DeleteIcon} + /> + : + document.getElementById(`aadhar-file-input-${index}`).click() + } + > + + + {directorForm.aadhar_file_path_name || + "Drag and drop files here or Choose file"} + + } + + handleFileUpload(index, "aadhar_file_path_name", e) + } + /> + + {directorFormErrors[index]?.aadhar_file_path_name && ( + + {directorFormErrors[index].aadhar_file_path_name} + + )} + + + + ))} + + + handleAddDirector()} + > + + Add director {directorForms.length + 1} + + + + + } + variant="outline" + size="sm" + px={8} + _hover={{ opacity: 0.8 }} + color={"#d0b8ef"} + border={"1px solid #d0b8ef"} + isDisabled={activeStep === 0} + onClick={() => setActiveStep(activeStep - 1)} + /> + + + + + + {/* Display the loading spinner */} + {isLoading && ( + + Uploading please wait... + + )} + + ); }; export default OnboardingDirectorDetails; diff --git a/src/Pages/Onboarding/OnboardingFrame.jsx b/src/Pages/Onboarding/OnboardingFrame.jsx index 8499908..633d6d5 100644 --- a/src/Pages/Onboarding/OnboardingFrame.jsx +++ b/src/Pages/Onboarding/OnboardingFrame.jsx @@ -19,7 +19,7 @@ import { useSearchParams } from 'react-router-dom'; // Retrieve the active step from localStorage or set it to 0 if it doesn't exist -const initialStep = parseInt(localStorage.getItem("activeStep")) || 0; +// const initialStep = parseInt(localStorage.getItem("activeStep")) || 0; const OnboardingFrame = () => { @@ -58,7 +58,7 @@ const OnboardingFrame = () => { // Stepper configuration const { activeStep, setActiveStep } = useSteps({ - index: initialStep, // Initialize the active step from localStorage or 0 + index: 0, // Initialize the active step from localStorage or 0 count: steps.length, }); @@ -215,7 +215,7 @@ const handleNext = () => { }, }} > - + {/* Step Indicator (Horizontal) */} diff --git a/src/Pages/Onboarding/OnboardingSelectPackage.jsx b/src/Pages/Onboarding/OnboardingSelectPackage.jsx index 252aacd..7b62668 100644 --- a/src/Pages/Onboarding/OnboardingSelectPackage.jsx +++ b/src/Pages/Onboarding/OnboardingSelectPackage.jsx @@ -1,9 +1,34 @@ -import React from 'react'; -import { Box, Text, HStack, Image, Checkbox, List, ListItem, ListIcon } from '@chakra-ui/react'; +import React, { useState } from 'react'; +import { Box, Text, HStack, Image, Checkbox, List, ListItem, ListIcon, IconButton, Button, useToast, useDisclosure } from '@chakra-ui/react'; import { MdCheckCircle } from 'react-icons/md'; import oBenefits from "../../assets/o-benefits.svg"; import oExpense from "../../assets/o-expense.svg"; import oGift from "../../assets/o-gift.svg"; +import { ArrowBackIcon, ArrowForwardIcon } from '@chakra-ui/icons'; +import { useNavigate } from 'react-router-dom'; +import { useCorpReggisterMutation } from '../../Services/on.board.service'; +import ToastBox from '../../Components/ToastBox'; +import OnboardingSelectPackageModal from './OnboardingSelectPackageModal'; + +const OnboardingSelectPackage = ({ + corpData, + setCorpData, + setActiveStep, + activeStep, + steps, + handleNext, +}) => { + + const navigate = useNavigate() + const toast = useToast(); + const [ expence, setExpence ] = useState(false) + const [ gifting, setGifting ] = useState(false) + const [ benefits, setBenefits ] = useState(false) + const [isLoading, setIsLoading] = useState(false); + const [onBoard, setOnBoard] = useState(false); + + const { isOpen, onOpen, onClose } = useDisclosure() + const packages = [ { @@ -16,7 +41,8 @@ const packages = [ "Lorem ipsum dolor sit amet", "Lorem ipsum dolor sit amet", "Lorem ipsum dolor sit amet" - ] + ], + onChange:()=>setExpence(!expence) }, { id: 2, @@ -28,7 +54,8 @@ const packages = [ "Lorem ipsum dolor sit amet", "Lorem ipsum dolor sit amet", "Lorem ipsum dolor sit amet" - ] + ], + onChange:()=>setBenefits(!benefits) }, { id: 3, @@ -40,11 +67,76 @@ const packages = [ "Lorem ipsum dolor sit amet", "Lorem ipsum dolor sit amet", "Lorem ipsum dolor sit amet" - ] + ], + onChange:()=>setGifting(!gifting) } ]; -const OnboardingSelectPackage = () => { +const [ corpOnBoard ] = useCorpReggisterMutation() + +const onSubmit = async () =>{ + + setIsLoading(true) + setCorpData({ ...corpData, opted_for_expence: expence, opted_for_gifting:gifting, opted_for_benefit:benefits }); + + + + + const code = localStorage?.getItem("codeCorporateId"); + // Update corporate data + const updatedData ={ + ...corpData, + code_corporateId:code, + opted_for_expence: expence, + opted_for_gifting: gifting, + opted_for_benefit: benefits, + }; + + + console.log(updatedData); + + try { + const res = await corpOnBoard(updatedData) + + if(res?.data?.data){ + localStorage?.setItem('fullname',res?.data?.data?.fullName ) + + toast({ + // position: "bottom-left", + render: () => ( + + ), + }); + setOnBoard(true) + + setIsLoading(false) + + + }else if (res?.error?.data?.message){ + toast({ + render: () => , + }); + + }else if(res?.error){ + toast({ + render: () => , + }); + + } + + + + console.log(res?.data?.data?.fullname); + + } catch (error) { + + } + + + +} + +console.log(corpData); return ( @@ -66,7 +158,7 @@ const OnboardingSelectPackage = () => { > {`${pkg.title} - + { ))} + + + } + variant="outline" + size="sm" + px={8} + _hover={{ opacity: 0.8 }} + color={"#d0b8ef"} + border={"1px solid #d0b8ef"} + isDisabled={activeStep === 0} + onClick={() => setActiveStep(activeStep - 1)} + /> + + + + ); }; diff --git a/src/Pages/Onboarding/OnboardingSelectPackageModal.jsx b/src/Pages/Onboarding/OnboardingSelectPackageModal.jsx index cd9a905..4c7a32e 100644 --- a/src/Pages/Onboarding/OnboardingSelectPackageModal.jsx +++ b/src/Pages/Onboarding/OnboardingSelectPackageModal.jsx @@ -3,11 +3,12 @@ import React, { useState } from 'react'; import PrimaryButton from '../../Components/Buttons/PrimaryButton'; import OnboardingSelectPackageModalChild from './OnboardingSelectPackageModalChild'; -const OnboardingSelectPackageModal = ({ isOpen, onClose }) => { +const OnboardingSelectPackageModal = ({ isOpen, onClose, onSubmit, isLoading, onBoard }) => { const [isChildModalOpen, setIsChildModalOpen] = useState(false); - const handleProceed = () => { + const handleProceed = async () => { // Close the parent modal and open the child modal + await onSubmit() onClose(); setIsChildModalOpen(true); }; @@ -61,7 +62,7 @@ const OnboardingSelectPackageModal = ({ isOpen, onClose }) => { - + diff --git a/src/Pages/OptiFiiExpense/AdvanceExpenseRequest.jsx b/src/Pages/OptiFiiExpense/AdvanceExpenseRequest.jsx index 29d456b..446db9d 100644 --- a/src/Pages/OptiFiiExpense/AdvanceExpenseRequest.jsx +++ b/src/Pages/OptiFiiExpense/AdvanceExpenseRequest.jsx @@ -1,168 +1,466 @@ -import React from "react"; import { - Table, - TableContainer, - Tbody, - Td, - Th, - Thead, - Tr, - Skeleton, - TableCaption, - Radio, - RadioGroup, - CheckboxGroup, + Avatar, + Box, + Button, Checkbox, - Box, Text + Divider, + Flex, + HStack, + Icon, + Image, + Input, + InputGroup, + InputLeftElement, + Menu, + MenuButton, + MenuItem, + MenuList, + Radio, + Select, + Tag, + TagLabel, + Text, + VStack, } from "@chakra-ui/react"; -import { TABLE_PAGINATION } from "../../Constants/Paginations"; -import EmptySearchList from "../../Components/EmptySearchList"; +import { + Tabs, + TabList, + Tab, + TabIndicator, + TabPanels, + TabPanel, +} from "@chakra-ui/react"; +import React, { useContext, useEffect, useState } from "react"; import MiniHeader from "../../Components/MiniHeader"; +import GlobalStateContext from "../../Contexts/GlobalStateContext"; +import NormalTable from "../../Components/DataTable/NormalTable"; +import womenpfp from "../../assets/womenpfp1.png"; +import { + AddIcon, + CalendarIcon, + ChevronDownIcon, + EmailIcon, + SearchIcon, + ViewIcon, +} from "@chakra-ui/icons"; +import { + MdFilterList, + MdNotificationsNone, + MdOutlineHeadsetMic, +} from "react-icons/md"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; +import { Link, NavLink, useNavigate } from "react-router-dom"; +import { FaArrowUpFromBracket } from "react-icons/fa6"; +import { LuListFilter } from "react-icons/lu"; +import { BsFilterRight } from "react-icons/bs"; +import pdfIcon from "../../assets/pdfIcon.svg"; +import ExcelIcon from "../../assets/ExcelIcon.svg"; -const AdvanceExpenseRequest = ({ - data, - isLoading, - // tableHeadRow, - emptyMessage, - centered, - total, - showRadioButton, // New prop for showing the radio button - selectedRadio, - setSelectedRadio, // State for managing radio button selection -}) => { - const columnWidth = - data && data[0] - ? `${(100 / Object.keys(data[0]).length).toFixed(2)}%` - : "auto"; - const handleRadioChange = (value) => { - setSelectedRadio(value); - }; +const AdvanceExpenseRequest = () => { + const { AdvanceExpenseRequest } = useContext(GlobalStateContext); + const [isLoading, setIsLoading] = useState(false); + const [searchTerm, setSearchTerm] = useState(""); + const [users, setusers] = useState(50); + const navigate = useNavigate(); + + + + useEffect(() => { + // Set isLoading to true + setIsLoading(true); + + // Simulate a 3-second delay + const timer = setTimeout(() => { + setIsLoading(false); + }, 500); + + return () => clearTimeout(timer); + }, []); // ===============================[ Table Header ] + const tableHeadRow = [ "Sr. no", "Report name", "Report by", "Report amount", "Date & time", - "Order Status", "Approver", "Disburser", + "Action", ]; + const pendingTable = AdvanceExpenseRequest.map((item, index) => ({ + "Sr. no": ( + + + {/* */} + {item?.id} + + + ), + "Report name": ( + + {item?.ReportName} + + ), + "Report by": ( + + + {item?.ReportBy?.profName} + + ), + "Report amount": item?.ReportAmount, + "Date & time": item?.DateTime, + "Approver": item?.Approver, + "Disburser": item?.Disburser, + "Action": ( + navigate('/advance-expense-request-view')} + fontSize={"xs"} + color="#fff" + bg={'#6311CB'} + py={1.5} px={5} + borderRadius={5} + >{item?.Action} + ), + })); + const completedTable = AdvanceExpenseRequest.map((item, index) => ({ + "Sr. no": ( + + + {/* */} + + {item?.id} + + + ), + "Report name": ( + + {item?.ReportName} + + ), + "Report by": ( + + + {item?.ReportBy?.profName} + + ), + "Report amount": item?.ReportAmount, + "Date & time": item?.DateTime, + "Approver": item?.Approver, + "Disburser": item?.Disburser, + "Action": ( + {item?.Action} + ), + })); + const rejectedTable = AdvanceExpenseRequest.map((item, index) => ({ + "Sr. no": ( + + + {/* */} + + {item?.id} + + + ), + "Report name": ( + + {item?.ReportName} + + ), + "Report by": ( + + + {item?.ReportBy?.profName} + + ), + "Report amount": item?.ReportAmount, + "Date & time": item?.DateTime, + "Approver": item?.Approver, + "Disburser": item?.Disburser, + "Action": ( + {item?.Action} + ), + })); + + + + const tabsData = [ + { + label: 'Pending', + num: 50, + content: + }, + { + label: 'Completed', + content: + }, + { + label: 'Rejected', + content: + } + ]; return ( + + + + + + + + + setSearchTerm(e.target.value)} + /> + + + + + + + } + rightIcon={} + fontSize={"xs"} + color={"gray.700"} + variant="outline" + size={"sm"} + me={2} + > + Sort + + + Ascending + Descending + Recently Viewed + Recently Added + + + + Show + + entries + - - + + + + {/* } + title={"Pull back funds"} + /> */} + + + } + rightIcon={} + fontSize={"xs"} + colorScheme="gray" + color={"gray.700"} + variant="outline" + size={"sm"} + me={2} + > + Export + + + + Export as PDF + + + Export as Excel + + + + + } + rightIcon={} + fontSize={"xs"} + color={"gray.700"} + variant="outline" + size={"sm"} + me={2} + > + Filter + + + Ascending + Descending + Recently Viewed + Recently Added + + + + + + + + {tabsData?.map((tab, index) => ( + + {tab?.label} + {tab?.label == "Pending" && + {tab?.num}} + + ))} - - {data?.length === 0 ? ( - - ) : ( - - - {total ? total : "OptiFii v1.0.0"} - - - - {tableHeadRow.map((heading, index) => ( - - ))} - - - - {isLoading - ? Array.from({ length: TABLE_PAGINATION?.size }).map( - (_, index) => ( - - {tableHeadRow.map((_, i) => ( - - ))} - - ) - ) - : data?.map((item, index) => ( - - {tableHeadRow.map((heading, i) => ( - - ))} - - ))} - -
- {/* Conditionally render radio button in the heading */} - {showRadioButton && heading === "Select" ? ( - - {/* Disabled radio button in header */} - - ) : ( - isLoading ? : heading - )} -
- -
- {/* Conditionally render radio button in the table body */} - {showRadioButton && heading === "Select" ? ( - - {/* Dynamic radio buttons */} - - ) : ( - item[heading] - )} -
- )} -
+
+ + + {tabsData?.map((tabCont, index) => ( + + {tabCont?.content} + + ))} + + +
+
); }; -export default AdvanceExpenseRequest; \ No newline at end of file +export default AdvanceExpenseRequest; diff --git a/src/Pages/OptiFiiExpense/AdvanceExpenseRequestView.jsx b/src/Pages/OptiFiiExpense/AdvanceExpenseRequestView.jsx new file mode 100644 index 0000000..148116b --- /dev/null +++ b/src/Pages/OptiFiiExpense/AdvanceExpenseRequestView.jsx @@ -0,0 +1,275 @@ +import { + Box, + Button, + HStack, + VStack, + Icon, + Checkbox, + Tag, + TagLabel, + Text, + Image, + useDisclosure, + Alert, + CloseButton, + AlertDescription, + Flex, +} from "@chakra-ui/react"; +import React, { useContext, useEffect, useState } from "react"; +import MiniHeader from "../../Components/MiniHeader"; +import GlobalStateContext from "../../Contexts/GlobalStateContext"; +import NormalTable from "../../Components/DataTable/NormalTable"; +import { RiDeleteBin5Line } from "react-icons/ri"; +import { AiOutlineEdit } from "react-icons/ai"; +import { LiaFileInvoiceSolid } from "react-icons/lia"; +import { PiReceipt } from "react-icons/pi"; +import { MdOutlineNoFood } from "react-icons/md"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; +import { IoMdCheckmark } from "react-icons/io"; +import { RxCross2 } from "react-icons/rx"; +import PrimaryButton from "../../Components/Buttons/PrimaryButton" +import SecondaryButton from "../../Components/Buttons/SecondaryButton" +import { FaCheck } from "react-icons/fa"; + +const AdvanceExpenseRequestView = () => { + + const [alertStatus, setAlertStatus] = useState(null); + + const handleApprove = () => { + setAlertStatus('success'); + }; + + const handleReject = () => { + setAlertStatus('error'); + }; + + const { AdvanceExpenseRequestView } = useContext(GlobalStateContext); + const [isLoading, setIsLoading] = useState(false); + + useEffect(() => { + // Set isLoading to true + setIsLoading(true); + + // Simulate a 3-second delay + const timer = setTimeout(() => { + setIsLoading(false); // Set isLoading to false after 3 seconds + }, 500); + + // Cleanup the timer when the component unmounts or when the useEffect re-runs + return () => clearTimeout(timer); + }, []); // Empty dependency array means this effect runs once after the component mounts + + // ===============================[ Table Header ] + const tableHeadRow = [ + "Date & time", + "Merchant", + "Category", + "Payment mode", + "Reimburse Amount", + "Bills", + "Action", + ]; + + // const extractedArray = reportsHistory.map((item)=>({ })) + + const extractedArray = AdvanceExpenseRequestView.map((item, index) => ({ + "Date & time": item?.DateTime, + "Merchant": item?.Merchant, + "Category": item?.Category, + "Payment mode": item?.Paymentmode, + "Reimburse Amount": item?.ReimburseAmount, + "Bills": ( + + + + + + Invoice243 + + + ), + "Action": ( + + + + + + Approve + + + + + + Reject + + + + ) + })); + + return ( + + + + + + + {/* */} + {alertStatus === 'success' && ( + + + + + + Approved by giftryt + + + + + )} + + {alertStatus === 'error' && ( + + + + + + Rejected by giftryt + + + + + )} + + + + + + + Approved + + + + By Sr. Manager + + + + + In progress + + + + + Pending + + + By Sr. Manager + + + + + Pending + + + By Sr. Manager + + + + + Pending + + + By Sr. Manager + + + + + + + + + Report number : 1254587841 + + + Reimbursement report 2024 + + + + + Amount to be reimbursed + + + ₹ 50,000 + + + + + + + + Submitted by + + + Dan Abramov + + + Pooja Shah + + + poojashah @wdipl.com + + + + + + Duration - 10 June - 28 June + + + + + + + + + + + + + + + + + ); +}; + +export default AdvanceExpenseRequestView; diff --git a/src/Pages/StatusCheck/StatusCheck.jsx b/src/Pages/StatusCheck/StatusCheck.jsx index b666565..6e995f2 100644 --- a/src/Pages/StatusCheck/StatusCheck.jsx +++ b/src/Pages/StatusCheck/StatusCheck.jsx @@ -347,7 +347,7 @@ const StatusCheck = ({ isOnline = true }) => { shadow={"md"} h={"88vh"} > - + diff --git a/src/Routes/Routes.js b/src/Routes/Routes.js index 340580f..d95b22f 100644 --- a/src/Routes/Routes.js +++ b/src/Routes/Routes.js @@ -21,6 +21,7 @@ import ApplicationStatus from "../Pages/OptiFiiGifsAndVouchers/id/ApplicationSta import DigitalApplicationStatus from "../Pages/OptiFiiGifsAndVouchers/id/DigitalApplication"; import GiftDashboard from "../Pages/OptiFiiGifsAndVouchers/GiftDashboard"; import ReimbursementRequestView from "../Pages/OptiFiiExpense/ReimbursementRequestView"; +import AdvanceExpenseRequestView from "../Pages/OptiFiiExpense/AdvanceExpenseRequestView"; export const RouteLink = [ { path: "/", Component: Dashbaord }, { path: "/expenses", Component: Expenses }, @@ -33,6 +34,7 @@ export const RouteLink = [ { path: "/reimbursement-request", Component: ReimbursementRequest }, { path: "/reimbursement-request-view", Component: ReimbursementRequestView }, { path: "/advance-expense-request", Component: AdvanceExpenseRequest }, + { path: "/advance-expense-request-view", Component: AdvanceExpenseRequestView }, { path: "/optiFii-benefit", Component: OptiFiiTaxBenefit }, { path: "/optiFii-vouchers", Component: OptiFiiGifsAndVouchers }, { path: "/reports", Component: Report }, diff --git a/src/Services/on.board.service.js b/src/Services/on.board.service.js index 0ab1728..92d1680 100644 --- a/src/Services/on.board.service.js +++ b/src/Services/on.board.service.js @@ -19,10 +19,26 @@ export const onBoarding = createApi({ query: () => `/corporate/pre-populate`, providesTags: ["prePop"], }), + + + + + + corpReggister: builder.mutation({ + query: (data) => ({ + url: "/corporate/register-with-code", + method: "POST", + body: data , + }), + }), + + + + }), }); // Export hooks for usage in functional components -export const { useGetPrePopQuery } = onBoarding; +export const { useGetPrePopQuery, useCorpReggisterMutation } = onBoarding; diff --git a/src/Services/token.serivce.js b/src/Services/token.serivce.js index 01dfb5b..b8ac545 100644 --- a/src/Services/token.serivce.js +++ b/src/Services/token.serivce.js @@ -143,6 +143,20 @@ export const apiSlice = createApi({ }), + + + sentFile: builder.mutation({ + query: ({data, code}) => ({ + url: "/auth/admin/file-upload", + method: "POST", + body: data , + headers: { + 'x-auth-code': code, // Set your custom header here + }, + }), + }), + + @@ -150,4 +164,4 @@ export const apiSlice = createApi({ }), }); -export const { useLoginMutation, useRefreshTokenMutation, useForgotPasswordMutation, useResetPasswordMutation,useResendOtpMutation, useSetOtpMutation } = apiSlice; +export const { useLoginMutation, useRefreshTokenMutation, useForgotPasswordMutation, useResetPasswordMutation,useResendOtpMutation, useSetOtpMutation, useSentFileMutation } = apiSlice;