diff --git a/package-lock.json b/package-lock.json index 22dd675..f397e14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,35 +1,36 @@ { "name": "lemmy-modder", - "version": "1.3.10", + "version": "1.9.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lemmy-modder", - "version": "1.3.10", + "version": "1.9.1", "license": "MIT", "dependencies": { - "@babel/core": "^7.23.3", - "@babel/preset-env": "^7.23.3", + "@babel/core": "^7.23.5", + "@babel/preset-env": "^7.23.5", "@babel/preset-react": "^7.23.3", "@braintree/sanitize-url": "^6.0.2", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", - "@mui/base": "^5.0.0-beta.23", - "@mui/icons-material": "^5.14.16", - "@mui/joy": "^5.0.0-beta.14", - "@mui/lab": "^5.0.0-alpha.152", + "@mui/base": "^5.0.0-beta.25", + "@mui/icons-material": "^5.14.19", + "@mui/joy": "^5.0.0-beta.16", + "@mui/lab": "^5.0.0-alpha.154", "@reduxjs/toolkit": "^1.9.7", - "@tanstack/react-query": "^5.8.1", - "@tanstack/react-query-devtools": "^5.8.1", - "axios": "^1.6.1", + "@tanstack/react-query": "^5.12.1", + "@tanstack/react-query-devtools": "^5.12.1", + "axios": "^1.6.2", "babel-loader": "^9.1.3", "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.8.1", "css-minimizer-webpack-plugin": "^5.0.1", "file-loader": "^6.2.0", "html-webpack-plugin": "^5.5.3", - "lemmy-js-client": "^0.18.1", + "lemmy-js-client": "npm:lemmy-js-client@^0.19.0-rc.19", + "lemmy-js-client18": "npm:lemmy-js-client@^0.18.1", "moment": "^2.29.4", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -38,13 +39,13 @@ "react-moment": "^1.1.3", "react-number-format": "^5.3.1", "react-redux": "^8.1.1", - "react-router-dom": "^6.18.0", + "react-router-dom": "^6.20.1", "redux": "^4.2.1", "redux-persist": "^6.0.0", "remove-markdown": "^0.5.0", "sass": "^1.69.5", "sass-loader": "^13.3.2", - "sonner": "^1.2.0", + "sonner": "^1.2.4", "style-loader": "^3.3.3", "url-loader": "^4.1.1", "webpack": "^5.89.0", @@ -54,7 +55,7 @@ "devDependencies": { "@babel/polyfill": "^7.12.1", "@babel/register": "^7.22.5", - "prettier": "^3.0.3" + "prettier": "^3.1.0" } }, "node_modules/@ampproject/remapping": { @@ -70,11 +71,11 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dependencies": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "engines": { @@ -82,28 +83,28 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.3.tgz", - "integrity": "sha512-BmR4bWbDIoFJmJ9z2cZ8Gmm2MXgEDgjdWgpKmKWUt54UGFJdlj31ECtbaDvCG/qVdG3AQ1SfpZEs01lUFbzLOQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.3.tgz", - "integrity": "sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.5.tgz", + "integrity": "sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.3", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.5", "@babel/helper-compilation-targets": "^7.22.15", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.2", - "@babel/parser": "^7.23.3", + "@babel/helpers": "^7.23.5", + "@babel/parser": "^7.23.5", "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.3", - "@babel/types": "^7.23.3", + "@babel/traverse": "^7.23.5", + "@babel/types": "^7.23.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -119,11 +120,11 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.3.tgz", - "integrity": "sha512-keeZWAV4LU3tW0qRi19HRpabC/ilM0HRBBzf9/k8FFiG4KVpiv0FIy4hHfLfFQZNhziCTPTmd59zoyv6DNISzg==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.5.tgz", + "integrity": "sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==", "dependencies": { - "@babel/types": "^7.23.3", + "@babel/types": "^7.23.5", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -378,9 +379,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "engines": { "node": ">=6.9.0" } @@ -394,9 +395,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", - "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "engines": { "node": ">=6.9.0" } @@ -415,22 +416,22 @@ } }, "node_modules/@babel/helpers": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.2.tgz", - "integrity": "sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.5.tgz", + "integrity": "sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==", "dependencies": { "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.23.0" + "@babel/traverse": "^7.23.5", + "@babel/types": "^7.23.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", @@ -441,9 +442,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.3.tgz", - "integrity": "sha512-uVsWNvlVsIninV2prNz/3lHCb+5CJ+e+IUBfbjToAHODtfGYLfCFuY4AU7TskI+dAKk+njsPiBjq1gKTvZOBaw==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.5.tgz", + "integrity": "sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==", "bin": { "parser": "bin/babel-parser.js" }, @@ -753,9 +754,9 @@ } }, "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.3.tgz", - "integrity": "sha512-59GsVNavGxAXCDDbakWSMJhajASb4kBCqDjqJsv+p5nKdbz7istmZ3HrX3L2LuiI80+zsOADCvooqQH3qGCucQ==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.4.tgz", + "integrity": "sha512-efdkfPhHYTtn0G6n2ddrESE91fgXxjlqLsnUtPWnJs4a4mZIbUaK7ffqKIIUKXSHwcDvaCVX6GXkaJJFqtX7jw==", "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-plugin-utils": "^7.22.5", @@ -800,9 +801,9 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.3.tgz", - "integrity": "sha512-QPZxHrThbQia7UdvfpaRRlq/J9ciz1J4go0k+lPBXbgaNeY7IQrBj/9ceWjvMMI07/ZBzHl/F0R/2K0qH7jCVw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.4.tgz", + "integrity": "sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -829,9 +830,9 @@ } }, "node_modules/@babel/plugin-transform-class-static-block": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.23.3.tgz", - "integrity": "sha512-PENDVxdr7ZxKPyi5Ffc0LjXdnJyrJxyqF5T5YjlVg4a0VFfQHW0r8iAtRiDXkfHlu1wwcvdtnndGYIeJLSuRMQ==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.23.4.tgz", + "integrity": "sha512-nsWu/1M+ggti1SOALj3hfx5FXzAY06fwPJsUZD4/A5e1bWi46VUIWtD+kOX6/IdhXGsXBWllLFDSnqSCdUNydQ==", "dependencies": { "@babel/helper-create-class-features-plugin": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", @@ -845,9 +846,9 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.3.tgz", - "integrity": "sha512-FGEQmugvAEu2QtgtU0uTASXevfLMFfBeVCIIdcQhn/uBQsMTjBajdnAtanQlOcuihWh10PZ7+HWvc7NtBwP74w==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.5.tgz", + "integrity": "sha512-jvOTR4nicqYC9yzOHIhXG5emiFEOpappSJAl73SDSEDcybD+Puuze8Tnpb9p9qEyYup24tq891gkaygIFvWDqg==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-compilation-targets": "^7.22.15", @@ -925,9 +926,9 @@ } }, "node_modules/@babel/plugin-transform-dynamic-import": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.23.3.tgz", - "integrity": "sha512-vTG+cTGxPFou12Rj7ll+eD5yWeNl5/8xvQvF08y5Gv3v4mZQoyFf8/n9zg4q5vvCWt5jmgymfzMAldO7orBn7A==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.23.4.tgz", + "integrity": "sha512-V6jIbLhdJK86MaLh4Jpghi8ho5fGzt3imHOBu/x0jlBaPYqDoWz4RDXjmMOfnh+JWNaQleEAByZLV0QzBT4YQQ==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-dynamic-import": "^7.8.3" @@ -955,9 +956,9 @@ } }, "node_modules/@babel/plugin-transform-export-namespace-from": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.23.3.tgz", - "integrity": "sha512-yCLhW34wpJWRdTxxWtFZASJisihrfyMOTOQexhVzA78jlU+dH7Dw+zQgcPepQ5F3C6bAIiblZZ+qBggJdHiBAg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.23.4.tgz", + "integrity": "sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-export-namespace-from": "^7.8.3" @@ -1000,9 +1001,9 @@ } }, "node_modules/@babel/plugin-transform-json-strings": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.23.3.tgz", - "integrity": "sha512-H9Ej2OiISIZowZHaBwF0tsJOih1PftXJtE8EWqlEIwpc7LMTGq0rPOrywKLQ4nefzx8/HMR0D3JGXoMHYvhi0A==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.23.4.tgz", + "integrity": "sha512-81nTOqM1dMwZ/aRXQ59zVubN9wHGqk6UtqRK+/q+ciXmRy8fSolhGVvG09HHRGo4l6fr/c4ZhXUQH0uFW7PZbg==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-json-strings": "^7.8.3" @@ -1029,9 +1030,9 @@ } }, "node_modules/@babel/plugin-transform-logical-assignment-operators": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.23.3.tgz", - "integrity": "sha512-+pD5ZbxofyOygEp+zZAfujY2ShNCXRpDRIPOiBmTO693hhyOEteZgl876Xs9SAHPQpcV0vz8LvA/T+w8AzyX8A==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.23.4.tgz", + "integrity": "sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" @@ -1150,9 +1151,9 @@ } }, "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.3.tgz", - "integrity": "sha512-xzg24Lnld4DYIdysyf07zJ1P+iIfJpxtVFOzX4g+bsJ3Ng5Le7rXx9KwqKzuyaUeRnt+I1EICwQITqc0E2PmpA==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.4.tgz", + "integrity": "sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" @@ -1165,9 +1166,9 @@ } }, "node_modules/@babel/plugin-transform-numeric-separator": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.23.3.tgz", - "integrity": "sha512-s9GO7fIBi/BLsZ0v3Rftr6Oe4t0ctJ8h4CCXfPoEJwmvAPMyNrfkOOJzm6b9PX9YXcCJWWQd/sBF/N26eBiMVw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.23.4.tgz", + "integrity": "sha512-mps6auzgwjRrwKEZA05cOwuDc9FAzoyFS4ZsG/8F43bTLf/TgkJg7QXOrPO1JO599iA3qgK9MXdMGOEC8O1h6Q==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-numeric-separator": "^7.10.4" @@ -1180,9 +1181,9 @@ } }, "node_modules/@babel/plugin-transform-object-rest-spread": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.3.tgz", - "integrity": "sha512-VxHt0ANkDmu8TANdE9Kc0rndo/ccsmfe2Cx2y5sI4hu3AukHQ5wAu4cM7j3ba8B9548ijVyclBU+nuDQftZsog==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.4.tgz", + "integrity": "sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g==", "dependencies": { "@babel/compat-data": "^7.23.3", "@babel/helper-compilation-targets": "^7.22.15", @@ -1213,9 +1214,9 @@ } }, "node_modules/@babel/plugin-transform-optional-catch-binding": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.23.3.tgz", - "integrity": "sha512-LxYSb0iLjUamfm7f1D7GpiS4j0UAC8AOiehnsGAP8BEsIX8EOi3qV6bbctw8M7ZvLtcoZfZX5Z7rN9PlWk0m5A==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.23.4.tgz", + "integrity": "sha512-XIq8t0rJPHf6Wvmbn9nFxU6ao4c7WhghTR5WyV8SrJfUFzyxhCm4nhC+iAp3HFhbAKLfYpgzhJ6t4XCtVwqO5A==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" @@ -1228,9 +1229,9 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.3.tgz", - "integrity": "sha512-zvL8vIfIUgMccIAK1lxjvNv572JHFJIKb4MWBz5OGdBQA0fB0Xluix5rmOby48exiJc987neOmP/m9Fnpkz3Tg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.4.tgz", + "integrity": "sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA==", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", @@ -1273,9 +1274,9 @@ } }, "node_modules/@babel/plugin-transform-private-property-in-object": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.23.3.tgz", - "integrity": "sha512-a5m2oLNFyje2e/rGKjVfAELTVI5mbA0FeZpBnkOWWV7eSmKQ+T/XW0Vf+29ScLzSxX+rnsarvU0oie/4m6hkxA==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.23.4.tgz", + "integrity": "sha512-9G3K1YqTq3F4Vt88Djx1UZ79PDyj+yKRnUy7cZGSMe+a7jkwD259uKKuUzQlPkGam7R+8RJwh5z4xO27fA1o2A==", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-create-class-features-plugin": "^7.22.15", @@ -1535,14 +1536,14 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.3.tgz", - "integrity": "sha512-ovzGc2uuyNfNAs/jyjIGxS8arOHS5FENZaNn4rtE7UdKMMkqHCvboHfcuhWLZNX5cB44QfcGNWjaevxMzzMf+Q==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.5.tgz", + "integrity": "sha512-0d/uxVD6tFGWXGDSfyMD1p2otoaKmu6+GD+NfAx0tMaH+dxORnp7T9TaVQ6mKyya7iBtCIVxHjWT7MuzzM9z+A==", "dependencies": { - "@babel/compat-data": "^7.23.3", + "@babel/compat-data": "^7.23.5", "@babel/helper-compilation-targets": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-validator-option": "^7.22.15", + "@babel/helper-validator-option": "^7.23.5", "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.23.3", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.23.3", "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.23.3", @@ -1566,25 +1567,25 @@ "@babel/plugin-syntax-top-level-await": "^7.14.5", "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", "@babel/plugin-transform-arrow-functions": "^7.23.3", - "@babel/plugin-transform-async-generator-functions": "^7.23.3", + "@babel/plugin-transform-async-generator-functions": "^7.23.4", "@babel/plugin-transform-async-to-generator": "^7.23.3", "@babel/plugin-transform-block-scoped-functions": "^7.23.3", - "@babel/plugin-transform-block-scoping": "^7.23.3", + "@babel/plugin-transform-block-scoping": "^7.23.4", "@babel/plugin-transform-class-properties": "^7.23.3", - "@babel/plugin-transform-class-static-block": "^7.23.3", - "@babel/plugin-transform-classes": "^7.23.3", + "@babel/plugin-transform-class-static-block": "^7.23.4", + "@babel/plugin-transform-classes": "^7.23.5", "@babel/plugin-transform-computed-properties": "^7.23.3", "@babel/plugin-transform-destructuring": "^7.23.3", "@babel/plugin-transform-dotall-regex": "^7.23.3", "@babel/plugin-transform-duplicate-keys": "^7.23.3", - "@babel/plugin-transform-dynamic-import": "^7.23.3", + "@babel/plugin-transform-dynamic-import": "^7.23.4", "@babel/plugin-transform-exponentiation-operator": "^7.23.3", - "@babel/plugin-transform-export-namespace-from": "^7.23.3", + "@babel/plugin-transform-export-namespace-from": "^7.23.4", "@babel/plugin-transform-for-of": "^7.23.3", "@babel/plugin-transform-function-name": "^7.23.3", - "@babel/plugin-transform-json-strings": "^7.23.3", + "@babel/plugin-transform-json-strings": "^7.23.4", "@babel/plugin-transform-literals": "^7.23.3", - "@babel/plugin-transform-logical-assignment-operators": "^7.23.3", + "@babel/plugin-transform-logical-assignment-operators": "^7.23.4", "@babel/plugin-transform-member-expression-literals": "^7.23.3", "@babel/plugin-transform-modules-amd": "^7.23.3", "@babel/plugin-transform-modules-commonjs": "^7.23.3", @@ -1592,15 +1593,15 @@ "@babel/plugin-transform-modules-umd": "^7.23.3", "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5", "@babel/plugin-transform-new-target": "^7.23.3", - "@babel/plugin-transform-nullish-coalescing-operator": "^7.23.3", - "@babel/plugin-transform-numeric-separator": "^7.23.3", - "@babel/plugin-transform-object-rest-spread": "^7.23.3", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4", + "@babel/plugin-transform-numeric-separator": "^7.23.4", + "@babel/plugin-transform-object-rest-spread": "^7.23.4", "@babel/plugin-transform-object-super": "^7.23.3", - "@babel/plugin-transform-optional-catch-binding": "^7.23.3", - "@babel/plugin-transform-optional-chaining": "^7.23.3", + "@babel/plugin-transform-optional-catch-binding": "^7.23.4", + "@babel/plugin-transform-optional-chaining": "^7.23.4", "@babel/plugin-transform-parameters": "^7.23.3", "@babel/plugin-transform-private-methods": "^7.23.3", - "@babel/plugin-transform-private-property-in-object": "^7.23.3", + "@babel/plugin-transform-private-property-in-object": "^7.23.4", "@babel/plugin-transform-property-literals": "^7.23.3", "@babel/plugin-transform-regenerator": "^7.23.3", "@babel/plugin-transform-reserved-words": "^7.23.3", @@ -1684,9 +1685,9 @@ "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" }, "node_modules/@babel/runtime": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", - "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.5.tgz", + "integrity": "sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -1713,18 +1714,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.3.tgz", - "integrity": "sha512-+K0yF1/9yR0oHdE0StHuEj3uTPzwwbrLGfNOndVJVV2TqA5+j3oljJUb4nmB954FLGjNem976+B+eDuLIjesiQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.5.tgz", + "integrity": "sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.3", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.5", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.3", - "@babel/types": "^7.23.3", + "@babel/parser": "^7.23.5", + "@babel/types": "^7.23.5", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1733,11 +1734,11 @@ } }, "node_modules/@babel/types": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.3.tgz", - "integrity": "sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.5.tgz", + "integrity": "sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==", "dependencies": { - "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, @@ -1914,9 +1915,9 @@ } }, "node_modules/@floating-ui/react-dom": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.2.tgz", - "integrity": "sha512-5qhlDvjaLmAst/rKb3VdlCinwTF4EYMiVxuuc/HVUjs46W0zgtbMmAZ1UTsDrRTxRmUEzl92mOtWbeeXL26lSQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.4.tgz", + "integrity": "sha512-CF8k2rgKeh/49UrnIBs4BdxPUV6vize/Db1d/YbCLyp9GiVZ0BEwf5AiDSxJRCr6yOkGqTFHtmrULxkEfYZ7dQ==", "dependencies": { "@floating-ui/dom": "^1.5.1" }, @@ -2079,14 +2080,14 @@ "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, "node_modules/@mui/base": { - "version": "5.0.0-beta.23", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.23.tgz", - "integrity": "sha512-9L8SQUGAWtd/Qi7Qem26+oSSgpY7f2iQTuvcz/rsGpyZjSomMMO6lwYeQSA0CpWM7+aN7eGoSY/WV6wxJiIxXw==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@floating-ui/react-dom": "^2.0.2", - "@mui/types": "^7.2.8", - "@mui/utils": "^5.14.17", + "version": "5.0.0-beta.25", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.25.tgz", + "integrity": "sha512-Iiv+IcappRRv6IBlknIVmLkXxfp51NEX1+l9f+dIbBuPU4PaRULegr1lCeHKsC45KU5ruxM5xMg4R/de03aJQg==", + "dependencies": { + "@babel/runtime": "^7.23.4", + "@floating-ui/react-dom": "^2.0.4", + "@mui/types": "^7.2.10", + "@mui/utils": "^5.14.19", "@popperjs/core": "^2.11.8", "clsx": "^2.0.0", "prop-types": "^15.8.1" @@ -2096,7 +2097,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0", @@ -2110,27 +2111,27 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "5.14.17", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.17.tgz", - "integrity": "sha512-eE0uxrpJAEL2ZXkeGLKg8HQDafsiXY+6eNpP4lcv3yIjFfGbU6Hj9/P7Adt8jpU+6JIhmxvILGj2r27pX+zdrQ==", + "version": "5.14.19", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.14.19.tgz", + "integrity": "sha512-y4JseIen5pmZs1n9hHy95HKKioKco8f6N2lford2AmjJigVJOv0KsU0qryiCpyuEUZmi/xCduVilHsK9DSkPcA==", "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" } }, "node_modules/@mui/icons-material": { - "version": "5.14.16", - "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.14.16.tgz", - "integrity": "sha512-wmOgslMEGvbHZjFLru8uH5E+pif/ciXAvKNw16q6joK6EWVWU5rDYWFknDaZhCvz8ZE/K8ZnJQ+lMG6GgHzXbg==", + "version": "5.14.19", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.14.19.tgz", + "integrity": "sha512-yjP8nluXxZGe3Y7pS+yxBV+hWZSsSBampCxkZwaw+1l+feL+rfP74vbEFbMrX/Kil9I/Y1tWfy5bs/eNvwNpWw==", "dependencies": { - "@babel/runtime": "^7.23.2" + "@babel/runtime": "^7.23.4" }, "engines": { "node": ">=12.0.0" }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@mui/material": "^5.0.0", @@ -2144,16 +2145,16 @@ } }, "node_modules/@mui/joy": { - "version": "5.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@mui/joy/-/joy-5.0.0-beta.14.tgz", - "integrity": "sha512-5N4tHgla/YGLRArcDb2GIgz8keXGXOeIdFVyP3hW1IZac0xJpiOuQNelxG9CVcZfEEAZ2V3r22ai7O2yq/8q+A==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@mui/base": "5.0.0-beta.23", - "@mui/core-downloads-tracker": "^5.14.17", - "@mui/system": "^5.14.17", - "@mui/types": "^7.2.8", - "@mui/utils": "^5.14.17", + "version": "5.0.0-beta.16", + "resolved": "https://registry.npmjs.org/@mui/joy/-/joy-5.0.0-beta.16.tgz", + "integrity": "sha512-0TMN/WXyKiwKg0svTsRMjFPONFNz1aDiNWEa14CudthW6Dzi8wzVfzjm0agqDmEh4KHfXwBjFPXSIREnki4dPg==", + "dependencies": { + "@babel/runtime": "^7.23.4", + "@mui/base": "5.0.0-beta.25", + "@mui/core-downloads-tracker": "^5.14.19", + "@mui/system": "^5.14.19", + "@mui/types": "^7.2.10", + "@mui/utils": "^5.14.19", "clsx": "^2.0.0", "prop-types": "^15.8.1" }, @@ -2162,7 +2163,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@emotion/react": "^11.5.0", @@ -2184,15 +2185,15 @@ } }, "node_modules/@mui/lab": { - "version": "5.0.0-alpha.152", - "resolved": "https://registry.npmjs.org/@mui/lab/-/lab-5.0.0-alpha.152.tgz", - "integrity": "sha512-P81QbS/FolrTAjm72N8ndTCYCdPufxJeftNcuc/L4ENHrAo8bV4wcweEyL2AcetfvTgpmGf3QaITrQv8Ts067A==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@mui/base": "5.0.0-beta.23", - "@mui/system": "^5.14.17", - "@mui/types": "^7.2.8", - "@mui/utils": "^5.14.17", + "version": "5.0.0-alpha.154", + "resolved": "https://registry.npmjs.org/@mui/lab/-/lab-5.0.0-alpha.154.tgz", + "integrity": "sha512-Rrhu8eUknjV6hhPMqq52e/p4/c6rvnu/k0AhysuljsHDZcHThYEZNe1mHFLveQ1RIje2VnJSsgmcNfcZKeOOAg==", + "dependencies": { + "@babel/runtime": "^7.23.4", + "@mui/base": "5.0.0-beta.25", + "@mui/system": "^5.14.19", + "@mui/types": "^7.2.10", + "@mui/utils": "^5.14.19", "clsx": "^2.0.0", "prop-types": "^15.8.1" }, @@ -2201,7 +2202,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@emotion/react": "^11.5.0", @@ -2301,12 +2302,12 @@ } }, "node_modules/@mui/private-theming": { - "version": "5.14.17", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.17.tgz", - "integrity": "sha512-u4zxsCm9xmQrlhVPug+Ccrtsjv7o2+rehvrgHoh0siSguvVgVQq5O3Hh10+tp/KWQo2JR4/nCEwquSXgITS1+g==", + "version": "5.14.19", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.19.tgz", + "integrity": "sha512-U9w39VpXLGVM8wZlUU/47YGTsBSk60ZQRRxQZtdqPfN1N7OVllQeN4cEKZKR8PjqqR3aYRcSciQ4dc6CttRoXQ==", "dependencies": { - "@babel/runtime": "^7.23.2", - "@mui/utils": "^5.14.17", + "@babel/runtime": "^7.23.4", + "@mui/utils": "^5.14.19", "prop-types": "^15.8.1" }, "engines": { @@ -2314,7 +2315,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0", @@ -2327,11 +2328,11 @@ } }, "node_modules/@mui/styled-engine": { - "version": "5.14.17", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.17.tgz", - "integrity": "sha512-AqpVjBEA7wnBvKPW168bNlqB6EN7HxTjLOY7oi275AzD/b1C7V0wqELy6NWoJb2yya5sRf7ENf4iNi3+T5cOgw==", + "version": "5.14.19", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.19.tgz", + "integrity": "sha512-jtj/Pyn/bS8PM7NXdFNTHWZfE3p+vItO4/HoQbUeAv3u+cnWXcTBGHHY/xdIn446lYGFDczTh1YyX8G4Ts0Rtg==", "dependencies": { - "@babel/runtime": "^7.23.2", + "@babel/runtime": "^7.23.4", "@emotion/cache": "^11.11.0", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -2341,7 +2342,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@emotion/react": "^11.4.1", @@ -2358,15 +2359,15 @@ } }, "node_modules/@mui/system": { - "version": "5.14.17", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.17.tgz", - "integrity": "sha512-Ccz3XlbCqka6DnbHfpL3o3TfOeWQPR+ewvNAgm8gnS9M0yVMmzzmY6z0w/C1eebb+7ZP7IoLUj9vojg/GBaTPg==", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@mui/private-theming": "^5.14.17", - "@mui/styled-engine": "^5.14.17", - "@mui/types": "^7.2.8", - "@mui/utils": "^5.14.17", + "version": "5.14.19", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.19.tgz", + "integrity": "sha512-4e3Q+2nx+vgEsd0h5ftxlZGB7XtkkPos/zWqCqnxUs1l/T70s0lF2YNrWHHdSQ7LgtBu0eQ0qweZG2pR7KwkAw==", + "dependencies": { + "@babel/runtime": "^7.23.4", + "@mui/private-theming": "^5.14.19", + "@mui/styled-engine": "^5.14.19", + "@mui/types": "^7.2.10", + "@mui/utils": "^5.14.19", "clsx": "^2.0.0", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -2376,7 +2377,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@emotion/react": "^11.5.0", @@ -2397,9 +2398,9 @@ } }, "node_modules/@mui/types": { - "version": "7.2.8", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.8.tgz", - "integrity": "sha512-9u0ji+xspl96WPqvrYJF/iO+1tQ1L5GTaDOeG3vCR893yy7VcWwRNiVMmPdPNpMDqx0WV1wtEW9OMwK9acWJzQ==", + "version": "7.2.10", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.10.tgz", + "integrity": "sha512-wX1vbDC+lzF7FlhT6A3ffRZgEoKWPF8VqRoTu4lZwouFX2t90KyCMsgepMw5DxLak1BSp/KP86CmtZttikb/gQ==", "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0" }, @@ -2410,12 +2411,12 @@ } }, "node_modules/@mui/utils": { - "version": "5.14.17", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.17.tgz", - "integrity": "sha512-yxnWgSS4J6DMFPw2Dof85yBkG02VTbEiqsikymMsnZnXDurtVGTIhlNuV24GTmFTuJMzEyTTU9UF+O7zaL8LEQ==", + "version": "5.14.19", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.19.tgz", + "integrity": "sha512-qAHvTXzk7basbyqPvhgWqN6JbmI2wLB/mf97GkSlz5c76MiKYV6Ffjvw9BjKZQ1YRb8rDX9kgdjRezOcoB91oQ==", "dependencies": { - "@babel/runtime": "^7.23.2", - "@types/prop-types": "^15.7.9", + "@babel/runtime": "^7.23.4", + "@types/prop-types": "^15.7.11", "prop-types": "^15.8.1", "react-is": "^18.2.0" }, @@ -2424,7 +2425,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0", @@ -2501,9 +2502,9 @@ } }, "node_modules/@remix-run/router": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.11.0.tgz", - "integrity": "sha512-BHdhcWgeiudl91HvVa2wxqZjSHbheSgIiDvxrF1VjFzBzpTtuDPkOdOi3Iqvc08kXtFkLjhbS+ML9aM8mJS+wQ==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.13.1.tgz", + "integrity": "sha512-so+DHzZKsoOcoXrILB4rqDkMDy7NLMErRdOxvzvOKb507YINKUP4Di+shbTZDhSE/pBZ+vr7XGIpcOO0VLSA+Q==", "engines": { "node": ">=14.0.0" } @@ -2514,63 +2515,52 @@ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" }, "node_modules/@tanstack/query-core": { - "version": "5.8.1", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.8.1.tgz", - "integrity": "sha512-Y0enatz2zQXBAsd7XmajlCs+WaitdR7dIFkqz9Xd7HL4KV04JOigWVreYseTmNH7YFSBSC/BJ9uuNp1MAf+GfA==", + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.12.1.tgz", + "integrity": "sha512-WbZztNmKq0t6QjdNmHzezbi/uifYo9j6e2GLJkodsYaYUlzMbAp91RDyeHkIZrm7EfO4wa6Sm5sxJZm5SPlh6w==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/query-devtools": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.7.4.tgz", - "integrity": "sha512-wx+gwRZUZq7ISXKFJgaAYvVPt+DwTaLKlzaVLB9SLBFIzcL8Jz8jDQGR9ZQp7/O7SVj0TohS8aFuiiGzQUvWyg==", + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.12.1.tgz", + "integrity": "sha512-AUWLgdZEYq/ckMZrtKpofOwqxuFiEIdy3gZOh/ouIBVra9ijXVTxYt5cZFSjXJT4q/o0DMii6xMZuIJx2qXZ6g==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/react-query": { - "version": "5.8.1", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.8.1.tgz", - "integrity": "sha512-YMagxS8iNPOLg0pK6WOjdSDlAvWKOf69udLOwQrBVmkC2SRLNLko7elo5Ro3ptlJkXvTVHidxC/h5KGi5bH1XQ==", + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.12.1.tgz", + "integrity": "sha512-pEqa0VENgw/0DunBAlnL7mruouCudclK/GecpgE5ayMAnLFW+FjBgMjNpMPeoSORzJKBsYgkgM7DYb3LQhXQxA==", "dependencies": { - "@tanstack/query-core": "5.8.1" + "@tanstack/query-core": "5.12.1" }, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "react": "^18.0.0", - "react-dom": "^18.0.0", - "react-native": "*" - }, - "peerDependenciesMeta": { - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - } + "react": "^18.0.0" } }, "node_modules/@tanstack/react-query-devtools": { - "version": "5.8.1", - "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.8.1.tgz", - "integrity": "sha512-sE6El2Yj98LlPDzf2Ju9IjWPZvqh2RgoQZ+Jomrfm80uA1HlHUvhXuOB0mOcyc706ZpNpL54no59JbgpHcMuUg==", + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.12.1.tgz", + "integrity": "sha512-imHdhA2KGDPAPbBEyztjYDhwn2HioTk6uPc7g6W0xORKTmHETQnAuWttqUHg8VHI3CHi5ACHPUAckoHg/PllMQ==", "dependencies": { - "@tanstack/query-devtools": "5.7.4" + "@tanstack/query-devtools": "5.12.1" }, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "@tanstack/react-query": "^5.8.1", - "react": "^18.0.0", - "react-dom": "^18.0.0" + "@tanstack/react-query": "^5.12.1", + "react": "^18.0.0" } }, "node_modules/@trysound/sax": { @@ -2740,9 +2730,9 @@ "integrity": "sha512-3YmXzzPAdOTVljVMkTMBdBEvlOLg2cDQaDhnnhT3nT9uDbnJzjWhKlzb+desT12Y7tGqaN6d+AbozcKzyL36Ng==" }, "node_modules/@types/prop-types": { - "version": "15.7.9", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.9.tgz", - "integrity": "sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==" + "version": "15.7.11", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz", + "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, "node_modules/@types/qs": { "version": "6.9.9", @@ -3152,9 +3142,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz", - "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -5692,6 +5682,16 @@ } }, "node_modules/lemmy-js-client": { + "version": "0.19.0-rc.19", + "resolved": "https://registry.npmjs.org/lemmy-js-client/-/lemmy-js-client-0.19.0-rc.19.tgz", + "integrity": "sha512-kae8V33QixbyYIA+pn7+sCeOOWL3eRgnFaNkZU8Y8vxhwZExIhkZus9jzVt/BoyPddVlafyBHxgAUsWXLA4tRA==", + "dependencies": { + "cross-fetch": "^3.1.5", + "form-data": "^4.0.0" + } + }, + "node_modules/lemmy-js-client18": { + "name": "lemmy-js-client", "version": "0.18.1", "resolved": "https://registry.npmjs.org/lemmy-js-client/-/lemmy-js-client-0.18.1.tgz", "integrity": "sha512-maafUZ9ZJkXthRZmM0+limJmymF2kmN/8SiKufS3V4OVNM72s+wUFFiyhKmA370g23iZRW6SUagE7jNKnqNyYQ==", @@ -6805,9 +6805,9 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", + "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -7059,11 +7059,11 @@ } }, "node_modules/react-router": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.18.0.tgz", - "integrity": "sha512-vk2y7Dsy8wI02eRRaRmOs9g2o+aE72YCx5q9VasT1N9v+lrdB79tIqrjMfByHiY5+6aYkH2rUa5X839nwWGPDg==", + "version": "6.20.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.20.1.tgz", + "integrity": "sha512-ccvLrB4QeT5DlaxSFFYi/KR8UMQ4fcD8zBcR71Zp1kaYTC5oJKYAp1cbavzGrogwxca+ubjkd7XjFZKBW8CxPA==", "dependencies": { - "@remix-run/router": "1.11.0" + "@remix-run/router": "1.13.1" }, "engines": { "node": ">=14.0.0" @@ -7073,12 +7073,12 @@ } }, "node_modules/react-router-dom": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.18.0.tgz", - "integrity": "sha512-Ubrue4+Ercc/BoDkFQfc6og5zRQ4A8YxSO3Knsne+eRbZ+IepAsK249XBH/XaFuOYOYr3L3r13CXTLvYt5JDjw==", + "version": "6.20.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.20.1.tgz", + "integrity": "sha512-npzfPWcxfQN35psS7rJgi/EW0Gx6EsNjfdJSAk73U/HqMEJZ2k/8puxfwHFgDQhBGmS3+sjnGbMdMSV45axPQw==", "dependencies": { - "@remix-run/router": "1.11.0", - "react-router": "6.18.0" + "@remix-run/router": "1.13.1", + "react-router": "6.20.1" }, "engines": { "node": ">=14.0.0" @@ -7724,9 +7724,9 @@ } }, "node_modules/sonner": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/sonner/-/sonner-1.2.0.tgz", - "integrity": "sha512-4bIPKrhF+Z4yEC4EZvNBswcVzMrUhztOQXqyIoiZqiqN1TT39FeK+TgRsQidvvztnYgOn4+S3LdAsri61c7ATA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sonner/-/sonner-1.2.4.tgz", + "integrity": "sha512-WGLP2QQnomgewaCTsK7YWiLcy5n1Yj83vsL5cP4zHMmpSkmFsCYTpQKhlXJrPE5kzjwbqCkCFXcOpbKc4vaUaA==", "peerDependencies": { "react": "^18.0.0", "react-dom": "^18.0.0" diff --git a/package.json b/package.json index 68333ce..bb4a097 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lemmy-modder", - "version": "1.3.10", + "version": "1.9.1", "description": "Lemmy Moderation App", "author": "tgxn", "license": "MIT", @@ -14,27 +14,28 @@ "test": "mocha --require @babel/register --require @babel/polyfill ./tests/api.mjs" }, "dependencies": { - "@babel/core": "^7.23.3", - "@babel/preset-env": "^7.23.3", + "@babel/core": "^7.23.5", + "@babel/preset-env": "^7.23.5", "@babel/preset-react": "^7.23.3", "@braintree/sanitize-url": "^6.0.2", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", - "@mui/base": "^5.0.0-beta.23", - "@mui/icons-material": "^5.14.16", - "@mui/joy": "^5.0.0-beta.14", - "@mui/lab": "^5.0.0-alpha.152", + "@mui/base": "^5.0.0-beta.25", + "@mui/icons-material": "^5.14.19", + "@mui/joy": "^5.0.0-beta.16", + "@mui/lab": "^5.0.0-alpha.154", "@reduxjs/toolkit": "^1.9.7", - "@tanstack/react-query": "^5.8.1", - "@tanstack/react-query-devtools": "^5.8.1", - "axios": "^1.6.1", + "@tanstack/react-query": "^5.12.1", + "@tanstack/react-query-devtools": "^5.12.1", + "axios": "^1.6.2", "babel-loader": "^9.1.3", "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.8.1", "css-minimizer-webpack-plugin": "^5.0.1", "file-loader": "^6.2.0", "html-webpack-plugin": "^5.5.3", - "lemmy-js-client": "^0.18.1", + "lemmy-js-client18": "npm:lemmy-js-client@^0.18.1", + "lemmy-js-client": "npm:lemmy-js-client@^0.19.0-rc.19", "moment": "^2.29.4", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -43,13 +44,13 @@ "react-moment": "^1.1.3", "react-number-format": "^5.3.1", "react-redux": "^8.1.1", - "react-router-dom": "^6.18.0", + "react-router-dom": "^6.20.1", "redux": "^4.2.1", "remove-markdown": "^0.5.0", "redux-persist": "^6.0.0", "sass": "^1.69.5", "sass-loader": "^13.3.2", - "sonner": "^1.2.0", + "sonner": "^1.2.4", "style-loader": "^3.3.3", "url-loader": "^4.1.1", "webpack": "^5.89.0", @@ -59,6 +60,6 @@ "devDependencies": { "@babel/polyfill": "^7.12.1", "@babel/register": "^7.22.5", - "prettier": "^3.0.3" + "prettier": "^3.1.0" } } diff --git a/src/App.jsx b/src/App.jsx index 6cbed6a..2030fb2 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -236,7 +236,7 @@ const queryClient = new QueryClient(); export default function App() { return ( - + diff --git a/src/components/Header/AccountMenu.jsx b/src/components/Header/AccountMenu.jsx index f91e11b..212e190 100644 --- a/src/components/Header/AccountMenu.jsx +++ b/src/components/Header/AccountMenu.jsx @@ -4,7 +4,8 @@ import { useDispatch, useSelector } from "react-redux"; import { useQueryClient } from "@tanstack/react-query"; -import { LemmyHttp } from "lemmy-js-client"; +import LemmyHttpMixed from "../../lib/LemmyHttpMixed.js"; +// import { LemmyHttp } from "lemmy-js-client"; import { Toaster, toast } from "sonner"; import Menu from "@mui/joy/Menu"; @@ -63,11 +64,17 @@ function UserListItem({ user }) { dispatch(setAccountIsLoading(true)); try { - const lemmyClient = new LemmyHttp(`https://${user.base}`); + const lemmyClient = new LemmyHttpMixed(`https://${user.base}`); + await lemmyClient.setupAuth(user.jwt); + const getSite = await lemmyClient.call("getSite"); - const getSite = await lemmyClient.getSite({ - auth: user.jwt, - }); + // const lemmyClient = new LemmyHttp(`https://${user.base}`, { + // headers: { + // Authorization: `Bearer ${user.jwt}`, + // }, + // }); + + // const getSite = await lemmyClient.getSite(); // there must be a user returned in this api call if (!getSite.my_user) { @@ -75,7 +82,7 @@ function UserListItem({ user }) { } // TODO we need to update the user's details in the saved accounts array too, if this is a saved session - dispatch(setCurrentUser({base: user.base, jwt: user.jwt, site: getSite})); + dispatch(setCurrentUser({ base: user.base, jwt: user.jwt, site: getSite })); } catch (e) { toast(typeof e == "string" ? e : e.message); } finally { diff --git a/src/hooks/useLemmyHttp.js b/src/hooks/useLemmyHttp.js index 64b4cbb..b6682a3 100644 --- a/src/hooks/useLemmyHttp.js +++ b/src/hooks/useLemmyHttp.js @@ -5,7 +5,8 @@ import { useDispatch, useSelector } from "react-redux"; import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; import { getSiteData } from "../hooks/getSiteData"; -import { LemmyHttp } from "lemmy-js-client"; +import LemmyHttpMixed from "../lib/LemmyHttpMixed"; +// import { LemmyHttp } from "lemmy-js-client"; import { selectCurrentUser, @@ -30,12 +31,9 @@ export function useLemmyHttp(callLemmyMethod, formData = {}) { const { isSuccess, isLoading, isError, error, data, isFetching, refetch } = useQuery({ queryKey: ["lemmyHttp", localPerson.id, callLemmyMethod, formDataArray], queryFn: async () => { - const lemmyClient = new LemmyHttp(`https://${currentUser.base}`); - - const siteData = await lemmyClient[callLemmyMethod]({ - auth: currentUser.jwt, - ...formData, - }); + const lemmyClient = new LemmyHttpMixed(`https://${currentUser.base}`); + await lemmyClient.setupAuth(currentUser.jwt); + const siteData = await lemmyClient.call(callLemmyMethod, formData); return siteData; }, @@ -62,10 +60,18 @@ export function useLemmyHttpAction(callLemmyMethod) { const mutation = useMutation({ mutationFn: async (formData) => { - const lemmyClient = new LemmyHttp(`https://${currentUser.base}`); - - const resultData = await lemmyClient[callLemmyMethod]({ - auth: currentUser.jwt, + const lemmyClientAuthed = new LemmyHttpMixed(`https://${currentUser.base}`); + await lemmyClientAuthed.setupAuth(currentUser.jwt); + // const getSite = await lemmyClientAuthed.call("getSite"); + + // const lemmyClient = new LemmyHttp(`https://${currentUser.base}`, { + // headers: { + // Authorization: `Bearer ${currentUser.jwt}`, + // }, + // }); + + const resultData = await lemmyClientAuthed.call(callLemmyMethod, { + // auth: currentUser.jwt, ...formData, }); @@ -97,11 +103,17 @@ export function refreshAllData() { mutationFn: async () => { dispatch(setAccountIsLoading(true)); - const lemmyClient = new LemmyHttp(`https://${currentUser.base}`); + const lemmyClientAuthed = new LemmyHttpMixed(`https://${currentUser.base}`); + await lemmyClientAuthed.setupAuth(currentUser.jwt); + const getSite = await lemmyClientAuthed.call("getSite"); - const getSite = await lemmyClient.getSite({ - auth: currentUser.jwt, - }); + // const lemmyClient = new LemmyHttp(`https://${currentUser.base}`, { + // headers: { + // Authorization: `Bearer ${currentUser.jwt}`, + // }, + // }); + + // const getSite = await lemmyClient.getSite(); dispatch(updateCurrentUserData(getSite)); diff --git a/src/hooks/useLemmyInfinite.js b/src/hooks/useLemmyInfinite.js index 6ef8206..40957f5 100644 --- a/src/hooks/useLemmyInfinite.js +++ b/src/hooks/useLemmyInfinite.js @@ -6,7 +6,8 @@ import { getSiteData } from "../hooks/getSiteData"; import { useSelector } from "react-redux"; -import { LemmyHttp } from "lemmy-js-client"; +import LemmyHttpMixed from "../lib/LemmyHttpMixed"; +// import { LemmyHttp } from "lemmy-js-client"; import { selectCurrentUser } from "../redux/reducer/accountReducer"; export default function useLemmyInfinite({ @@ -50,10 +51,18 @@ export default function useLemmyInfinite({ queryFn: async ({ pageParam = 1, ...rest }, optional) => { console.log("LemmyHttp inner infinite", callLemmyMethod, pageParam, rest, optional); - const lemmyClient = new LemmyHttp(`https://${currentUser.base}`); + const lemmyClientAuthed = new LemmyHttpMixed(`https://${currentUser.base}`); + await lemmyClientAuthed.setupAuth(currentUser.jwt); + // const getSite = await lemmyClientAuthed.call("getSite"); - const apiResultData = await lemmyClient[callLemmyMethod]({ - auth: currentUser.jwt, + // const lemmyClient = new LemmyHttp(`https://${currentUser.base}`, { + // headers: { + // Authorization: `Bearer ${currentUser.jwt}`, + // }, + // }); + + const apiResultData = await lemmyClientAuthed.call(callLemmyMethod, { + // auth: currentUser.jwt, page: pageParam, limit: perPage, ...formData, diff --git a/src/hooks/useLemmyModLog.js b/src/hooks/useLemmyModLog.js index f9be9bc..e7cc9b7 100644 --- a/src/hooks/useLemmyModLog.js +++ b/src/hooks/useLemmyModLog.js @@ -1,13 +1,9 @@ -import { useEffect, useMemo } from "react"; - -import { useQuery, useMutation, useInfiniteQuery } from "@tanstack/react-query"; +import { useMemo } from "react"; import { getSiteData } from "../hooks/getSiteData"; import { useSelector } from "react-redux"; -import { LemmyHttp } from "lemmy-js-client"; - import useLemmyInfinite from "./useLemmyInfinite"; import { getModLogTypeNames } from "../utils"; import { selectModLogCommunityId, selectModLogType } from "../redux/reducer/configReducer"; diff --git a/src/hooks/useLemmyReports.js b/src/hooks/useLemmyReports.js index 8a3d0b4..6d64db3 100644 --- a/src/hooks/useLemmyReports.js +++ b/src/hooks/useLemmyReports.js @@ -6,8 +6,6 @@ import { getSiteData } from "../hooks/getSiteData"; import { useSelector } from "react-redux"; -import { LemmyHttp } from "lemmy-js-client"; - import useLemmyInfinite from "./useLemmyInfinite"; import { selectFilterCommunity, diff --git a/src/lib/LemmyHttpMixed.js b/src/lib/LemmyHttpMixed.js new file mode 100644 index 0000000..9fd2e5d --- /dev/null +++ b/src/lib/LemmyHttpMixed.js @@ -0,0 +1,61 @@ +// Re-Export LemmyHttp with Version Helpers + +import { LemmyHttp } from "lemmy-js-client18"; +import { LemmyHttp as LemmyHttp19 } from "lemmy-js-client"; + +export default class LemmyHttpMixed { + constructor(baseUrl, options = {}) { + this.baseUrl = baseUrl; + + this.lemmyClient = new LemmyHttp(baseUrl, options); + this.lemmyClient19 = new LemmyHttp19(baseUrl, options); + } + + async getSiteVersion() { + // load cache + const cachedVersion = localStorage.getItem(this.baseUrl + ".version"); + const cachedExpires = localStorage.getItem(this.baseUrl + ".expires"); + + // check if cache is valid + if (cachedVersion && cachedExpires && cachedExpires > Date.now()) { + return cachedVersion; + } + + // call getSite and store version + const siteData = await this.lemmyClient.getSite(); + + // cache in cookies for 2 hours + localStorage.setItem(this.baseUrl + ".version", siteData.version); + localStorage.setItem(this.baseUrl + ".expires", Date.now() + 1000 * 60 * 60 * 2); + + return siteData.version; + } + + async setupAuth(userJwt) { + this.userJwt = userJwt; + + this.lemmyClient19.setHeaders({ + Authorization: `Bearer ${userJwt}`, + }); + } + + async call(method, formData) { + // get and cache version + if (!this.version) { + this.version = await this.getSiteVersion(); + } + console.log("this.version", this.version); + + // check version + if (this.version.indexOf("0.18") === -1) { + // call super + return await this.lemmyClient19[method](formData); + } else { + // call super + return await this.lemmyClient[method]({ + auth: this.userJwt, + ...formData, + }); + } + } +} diff --git a/src/pages/Login.jsx b/src/pages/Login.jsx index f91f897..ba771cc 100644 --- a/src/pages/Login.jsx +++ b/src/pages/Login.jsx @@ -18,10 +18,9 @@ import ListItemContent from "@mui/joy/ListItemContent"; import IconButton from "@mui/joy/IconButton"; import Delete from "@mui/icons-material/Delete"; +import LemmyHttpMixed from "../lib/LemmyHttpMixed"; import { LemmyHttp } from "lemmy-js-client"; -import { useLemmyUserDataAction } from "../hooks/useLemmyHttp"; - import { addUser, setAccountIsLoading, @@ -74,29 +73,20 @@ export default function LoginForm() { const auth = await lemmyClient.login(loginPayload); - /** - * 0.19.x :/ hmm - // this shows the `jwt` is present 👍 + // as long aws there is a JWT in the response from login, logged in! + if (auth.jwt) { console.log("auth", auth); + const lemmyClientAuthed = new LemmyHttpMixed(`https://${instanceBase}`); + await lemmyClientAuthed.setupAuth(auth.jwt); + const getSite = await lemmyClientAuthed.call("getSite"); - // cookie is called `auth` now. - lemmyClient.setHeaders({ - "Cookie": `auth=${auth.jwt}` - }); - - // this no longer has any params ! - const getSite = await lemmyClient.getSite(); - - console.log("getSite", getSite); + // const lemmyClientAuthed = new LemmyHttp(`https://${instanceBase}`, { + // headers: { + // Authorization: `Bearer ${auth.jwt}`, + // }, + // }); - * - */ - - // as long aws there is a JWT in the response from login, logged in! - if (auth.jwt) { - const getSite = await lemmyClient.getSite({ - auth: auth.jwt, - }); + // const getSite = await lemmyClientAuthed.getSite(); // save if they chose to if (saveSession) { @@ -316,11 +306,17 @@ export default function LoginForm() { dispatch(setAccountIsLoading(true)); try { - const lemmyClient = new LemmyHttp(`https://${user.base}`); + const lemmyClient = new LemmyHttpMixed(`https://${user.base}`); + await lemmyClient.setupAuth(user.jwt); + const getSite = await lemmyClient.call("getSite"); + + // const lemmyClientAuthed = new LemmyHttp(`https://${user.base}`, { + // headers: { + // Authorization: `Bearer ${user.jwt}`, + // }, + // }); - const getSite = await lemmyClient.getSite({ - auth: user.jwt, - }); + // const getSite = await lemmyClientAuthed.getSite(); if (!getSite || !getSite.my_user) { // set instance base to the current instance for easy login