diff --git a/package-lock.json b/package-lock.json
index 8be3d08..6e8bbbe 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,20 +1,44 @@
{
- "name": "project-dark-triad",
+ "name": "dark-triad-assessments",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
- "name": "project-dark-triad",
+ "name": "dark-triad-assessments",
"version": "1.0.0",
"dependencies": {
- "express": "^4.17.1"
+ "chart.js": "^3.7.0",
+ "compression": "^1.7.4",
+ "cookie": "^0.7.1",
+ "cors": "^2.8.5",
+ "dayjs": "^1.10.7",
+ "dotenv": "^10.0.0",
+ "express": "^4.21.0",
+ "express-rate-limit": "^5.3.0",
+ "helmet": "^4.6.0",
+ "lodash": "^4.17.21",
+ "mathjs": "^9.5.1",
+ "nodemon": "^3.1.7"
+ },
+ "devDependencies": {
+ "semver": "^7.6.3"
+ }
+ },
+ "node_modules/@babel/runtime": {
+ "version": "7.25.7",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.7.tgz",
+ "integrity": "sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==",
+ "dependencies": {
+ "regenerator-runtime": "^0.14.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
}
},
"node_modules/accepts": {
"version": "1.3.8",
- "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
- "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
+ "license": "MIT",
"dependencies": {
"mime-types": "~2.1.34",
"negotiator": "0.6.3"
@@ -23,15 +47,41 @@
"node": ">= 0.6"
}
},
+ "node_modules/anymatch": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
+ "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
+ "dependencies": {
+ "normalize-path": "^3.0.0",
+ "picomatch": "^2.0.4"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
"node_modules/array-flatten": {
"version": "1.1.1",
- "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
- "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
+ "license": "MIT"
+ },
+ "node_modules/balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
+ },
+ "node_modules/binary-extensions": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
+ "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
},
"node_modules/body-parser": {
"version": "1.20.3",
- "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz",
- "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==",
+ "license": "MIT",
"dependencies": {
"bytes": "3.1.2",
"content-type": "~1.0.5",
@@ -51,18 +101,36 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
+ "node_modules/brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "node_modules/braces": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
+ "dependencies": {
+ "fill-range": "^7.1.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/bytes": {
"version": "3.1.2",
- "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
- "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/call-bind": {
"version": "1.0.7",
- "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz",
- "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
+ "license": "MIT",
"dependencies": {
"es-define-property": "^1.0.0",
"es-errors": "^1.3.0",
@@ -77,10 +145,95 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/chart.js": {
+ "version": "3.9.1",
+ "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.9.1.tgz",
+ "integrity": "sha512-Ro2JbLmvg83gXF5F4sniaQ+lTbSv18E+TIf2cOeiH1Iqd2PGFOtem+DUufMZsCJwFE7ywPOpfXFBwRTGq7dh6w=="
+ },
+ "node_modules/chokidar": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
+ "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
+ "dependencies": {
+ "anymatch": "~3.1.2",
+ "braces": "~3.0.2",
+ "glob-parent": "~5.1.2",
+ "is-binary-path": "~2.1.0",
+ "is-glob": "~4.0.1",
+ "normalize-path": "~3.0.0",
+ "readdirp": "~3.6.0"
+ },
+ "engines": {
+ "node": ">= 8.10.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/complex.js": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.2.0.tgz",
+ "integrity": "sha512-gKZLyOdqy5BZTh3PxB0RPuF51D8Go7MW2gV0uuagTW/lncAqndrbMmLiTwrfi6qSYx9tKU/b3GxNpLaz+wMBlw==",
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/rawify"
+ }
+ },
+ "node_modules/compressible": {
+ "version": "2.0.18",
+ "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz",
+ "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==",
+ "dependencies": {
+ "mime-db": ">= 1.43.0 < 2"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/compression": {
+ "version": "1.7.4",
+ "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz",
+ "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==",
+ "dependencies": {
+ "accepts": "~1.3.5",
+ "bytes": "3.0.0",
+ "compressible": "~2.0.16",
+ "debug": "2.6.9",
+ "on-headers": "~1.0.2",
+ "safe-buffer": "5.1.2",
+ "vary": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/compression/node_modules/bytes": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
+ "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/compression/node_modules/safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
+ },
+ "node_modules/concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
+ },
"node_modules/content-disposition": {
"version": "0.5.4",
- "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
- "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
+ "license": "MIT",
"dependencies": {
"safe-buffer": "5.2.1"
},
@@ -90,37 +243,55 @@
},
"node_modules/content-type": {
"version": "1.0.5",
- "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
- "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/cookie": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
- "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
+ "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/cookie-signature": {
"version": "1.0.6",
- "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
- "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
+ "license": "MIT"
+ },
+ "node_modules/cors": {
+ "version": "2.8.5",
+ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
+ "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
+ "dependencies": {
+ "object-assign": "^4",
+ "vary": "^1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/dayjs": {
+ "version": "1.11.13",
+ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz",
+ "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
},
"node_modules/debug": {
"version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "license": "MIT",
"dependencies": {
"ms": "2.0.0"
}
},
+ "node_modules/decimal.js": {
+ "version": "10.4.3",
+ "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz",
+ "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA=="
+ },
"node_modules/define-data-property": {
"version": "1.1.4",
- "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
- "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
+ "license": "MIT",
"dependencies": {
"es-define-property": "^1.0.0",
"es-errors": "^1.3.0",
@@ -135,38 +306,41 @@
},
"node_modules/depd": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
- "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/destroy": {
"version": "1.2.0",
- "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
- "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
+ "license": "MIT",
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
}
},
+ "node_modules/dotenv": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
+ "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/ee-first": {
"version": "1.1.1",
- "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
- "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
+ "license": "MIT"
},
"node_modules/encodeurl": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
- "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+ "license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/es-define-property": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz",
- "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==",
+ "license": "MIT",
"dependencies": {
"get-intrinsic": "^1.2.4"
},
@@ -176,21 +350,23 @@
},
"node_modules/es-errors": {
"version": "1.3.0",
- "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
- "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/escape-html": {
"version": "1.0.3",
- "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
- "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
+ "license": "MIT"
+ },
+ "node_modules/escape-latex": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz",
+ "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw=="
},
"node_modules/etag": {
"version": "1.8.1",
- "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
- "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "license": "MIT",
"engines": {
"node": ">= 0.6"
}
@@ -236,10 +412,33 @@
"node": ">= 0.10.0"
}
},
+ "node_modules/express-rate-limit": {
+ "version": "5.5.1",
+ "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-5.5.1.tgz",
+ "integrity": "sha512-MTjE2eIbHv5DyfuFz4zLYWxpqVhEhkTiwFGuB74Q9CSou2WHO52nlE5y3Zlg6SIsiYUIPj6ifFxnkPz6O3sIUg=="
+ },
+ "node_modules/express/node_modules/cookie": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
+ "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fill-range": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
+ "dependencies": {
+ "to-regex-range": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/finalhandler": {
"version": "1.3.1",
- "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz",
- "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==",
+ "license": "MIT",
"dependencies": {
"debug": "2.6.9",
"encodeurl": "~2.0.0",
@@ -255,32 +454,53 @@
},
"node_modules/forwarded": {
"version": "0.2.0",
- "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
- "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
+ "node_modules/fraction.js": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz",
+ "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==",
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "type": "patreon",
+ "url": "https://github.com/sponsors/rawify"
+ }
+ },
"node_modules/fresh": {
"version": "0.5.2",
- "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
- "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
+ "license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "hasInstallScript": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
"node_modules/function-bind": {
"version": "1.1.2",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
- "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-intrinsic": {
"version": "1.2.4",
- "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz",
- "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==",
+ "license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"function-bind": "^1.1.2",
@@ -295,10 +515,20 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dependencies": {
+ "is-glob": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
"node_modules/gopd": {
"version": "1.0.1",
- "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
- "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
+ "license": "MIT",
"dependencies": {
"get-intrinsic": "^1.1.3"
},
@@ -306,10 +536,17 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
"node_modules/has-property-descriptors": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
- "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
+ "license": "MIT",
"dependencies": {
"es-define-property": "^1.0.0"
},
@@ -319,8 +556,7 @@
},
"node_modules/has-proto": {
"version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz",
- "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==",
+ "license": "MIT",
"engines": {
"node": ">= 0.4"
},
@@ -330,8 +566,7 @@
},
"node_modules/has-symbols": {
"version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
- "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
+ "license": "MIT",
"engines": {
"node": ">= 0.4"
},
@@ -341,8 +576,7 @@
},
"node_modules/hasown": {
"version": "2.0.2",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
- "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "license": "MIT",
"dependencies": {
"function-bind": "^1.1.2"
},
@@ -350,10 +584,17 @@
"node": ">= 0.4"
}
},
+ "node_modules/helmet": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/helmet/-/helmet-4.6.0.tgz",
+ "integrity": "sha512-HVqALKZlR95ROkrnesdhbbZJFi/rIVSoNq6f3jA/9u6MIbTsPh3xZwihjeI5+DO/2sOV6HMHooXcEOuwskHpTg==",
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
"node_modules/http-errors": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
- "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
+ "license": "MIT",
"dependencies": {
"depd": "2.0.0",
"inherits": "2.0.4",
@@ -367,8 +608,7 @@
},
"node_modules/iconv-lite": {
"version": "0.4.24",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
- "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "license": "MIT",
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3"
},
@@ -376,47 +616,116 @@
"node": ">=0.10.0"
}
},
+ "node_modules/ignore-by-default": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz",
+ "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA=="
+ },
"node_modules/inherits": {
"version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ "license": "ISC"
},
"node_modules/ipaddr.js": {
"version": "1.9.1",
- "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
- "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "license": "MIT",
"engines": {
"node": ">= 0.10"
}
},
+ "node_modules/is-binary-path": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
+ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
+ "dependencies": {
+ "binary-extensions": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "dependencies": {
+ "is-extglob": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "engines": {
+ "node": ">=0.12.0"
+ }
+ },
+ "node_modules/javascript-natural-sort": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz",
+ "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw=="
+ },
+ "node_modules/lodash": {
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
+ },
+ "node_modules/mathjs": {
+ "version": "9.5.2",
+ "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-9.5.2.tgz",
+ "integrity": "sha512-c0erTq0GP503/Ch2OtDOAn50GIOsuxTMjmE00NI/vKJFSWrDaQHRjx6ai+16xYv70yBSnnpUgHZGNf9FR9IwmA==",
+ "dependencies": {
+ "@babel/runtime": "^7.15.4",
+ "complex.js": "^2.0.15",
+ "decimal.js": "^10.3.1",
+ "escape-latex": "^1.2.0",
+ "fraction.js": "^4.1.1",
+ "javascript-natural-sort": "^0.7.1",
+ "seedrandom": "^3.0.5",
+ "tiny-emitter": "^2.1.0",
+ "typed-function": "^2.0.0"
+ },
+ "bin": {
+ "mathjs": "bin/cli.js"
+ },
+ "engines": {
+ "node": ">= 12"
+ }
+ },
"node_modules/media-typer": {
"version": "0.3.0",
- "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
- "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
+ "license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/merge-descriptors": {
"version": "1.0.3",
- "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
- "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
+ "license": "MIT",
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/methods": {
"version": "1.1.2",
- "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
- "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
+ "license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime": {
"version": "1.6.0",
- "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
- "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+ "license": "MIT",
"bin": {
"mime": "cli.js"
},
@@ -426,16 +735,14 @@
},
"node_modules/mime-db": {
"version": "1.52.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
- "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
- "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "license": "MIT",
"dependencies": {
"mime-db": "1.52.0"
},
@@ -443,23 +750,95 @@
"node": ">= 0.6"
}
},
+ "node_modules/minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
"node_modules/ms": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
+ "license": "MIT"
},
"node_modules/negotiator": {
"version": "0.6.3",
- "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
- "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
+ "license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
+ "node_modules/nodemon": {
+ "version": "3.1.7",
+ "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.7.tgz",
+ "integrity": "sha512-hLj7fuMow6f0lbB0cD14Lz2xNjwsyruH251Pk4t/yIitCFJbmY1myuLlHm/q06aST4jg6EgAh74PIBBrRqpVAQ==",
+ "dependencies": {
+ "chokidar": "^3.5.2",
+ "debug": "^4",
+ "ignore-by-default": "^1.0.1",
+ "minimatch": "^3.1.2",
+ "pstree.remy": "^1.1.8",
+ "semver": "^7.5.3",
+ "simple-update-notifier": "^2.0.0",
+ "supports-color": "^5.5.0",
+ "touch": "^3.1.0",
+ "undefsafe": "^2.0.5"
+ },
+ "bin": {
+ "nodemon": "bin/nodemon.js"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/nodemon"
+ }
+ },
+ "node_modules/nodemon/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/nodemon/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
+ },
+ "node_modules/normalize-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/object-inspect": {
"version": "1.13.2",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz",
- "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==",
+ "license": "MIT",
"engines": {
"node": ">= 0.4"
},
@@ -469,8 +848,7 @@
},
"node_modules/on-finished": {
"version": "2.4.1",
- "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
- "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+ "license": "MIT",
"dependencies": {
"ee-first": "1.1.1"
},
@@ -478,23 +856,39 @@
"node": ">= 0.8"
}
},
+ "node_modules/on-headers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
+ "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
"node_modules/parseurl": {
"version": "1.3.3",
- "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
- "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/path-to-regexp": {
"version": "0.1.10",
- "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
- "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w=="
+ "license": "MIT"
+ },
+ "node_modules/picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
},
"node_modules/proxy-addr": {
"version": "2.0.7",
- "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
- "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+ "license": "MIT",
"dependencies": {
"forwarded": "0.2.0",
"ipaddr.js": "1.9.1"
@@ -503,10 +897,14 @@
"node": ">= 0.10"
}
},
+ "node_modules/pstree.remy": {
+ "version": "1.1.8",
+ "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz",
+ "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w=="
+ },
"node_modules/qs": {
"version": "6.13.0",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
- "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
+ "license": "BSD-3-Clause",
"dependencies": {
"side-channel": "^1.0.6"
},
@@ -519,16 +917,14 @@
},
"node_modules/range-parser": {
"version": "1.2.1",
- "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
- "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+ "license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/raw-body": {
"version": "2.5.2",
- "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
- "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
+ "license": "MIT",
"dependencies": {
"bytes": "3.1.2",
"http-errors": "2.0.0",
@@ -539,10 +935,24 @@
"node": ">= 0.8"
}
},
+ "node_modules/readdirp": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
+ "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
+ "dependencies": {
+ "picomatch": "^2.2.1"
+ },
+ "engines": {
+ "node": ">=8.10.0"
+ }
+ },
+ "node_modules/regenerator-runtime": {
+ "version": "0.14.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
+ "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
+ },
"node_modules/safe-buffer": {
"version": "5.2.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
- "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"funding": [
{
"type": "github",
@@ -556,17 +966,32 @@
"type": "consulting",
"url": "https://feross.org/support"
}
- ]
+ ],
+ "license": "MIT"
},
"node_modules/safer-buffer": {
"version": "2.1.2",
- "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
- "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+ "license": "MIT"
+ },
+ "node_modules/seedrandom": {
+ "version": "3.0.5",
+ "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz",
+ "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg=="
+ },
+ "node_modules/semver": {
+ "version": "7.6.3",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
+ "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
},
"node_modules/send": {
"version": "0.19.0",
- "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
- "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
+ "license": "MIT",
"dependencies": {
"debug": "2.6.9",
"depd": "2.0.0",
@@ -588,21 +1013,18 @@
},
"node_modules/send/node_modules/encodeurl": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
- "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
+ "license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/send/node_modules/ms": {
"version": "2.1.3",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
+ "license": "MIT"
},
"node_modules/serve-static": {
"version": "1.16.2",
- "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz",
- "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==",
+ "license": "MIT",
"dependencies": {
"encodeurl": "~2.0.0",
"escape-html": "~1.0.3",
@@ -615,8 +1037,7 @@
},
"node_modules/set-function-length": {
"version": "1.2.2",
- "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
- "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
+ "license": "MIT",
"dependencies": {
"define-data-property": "^1.1.4",
"es-errors": "^1.3.0",
@@ -631,13 +1052,11 @@
},
"node_modules/setprototypeof": {
"version": "1.2.0",
- "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
- "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
+ "license": "ISC"
},
"node_modules/side-channel": {
"version": "1.0.6",
- "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",
- "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==",
+ "license": "MIT",
"dependencies": {
"call-bind": "^1.0.7",
"es-errors": "^1.3.0",
@@ -651,26 +1070,69 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/simple-update-notifier": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz",
+ "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==",
+ "dependencies": {
+ "semver": "^7.5.3"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/statuses": {
"version": "2.0.1",
- "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
- "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
+ "license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
+ "node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/tiny-emitter": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
+ "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
+ },
+ "node_modules/to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dependencies": {
+ "is-number": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=8.0"
+ }
+ },
"node_modules/toidentifier": {
"version": "1.0.1",
- "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
- "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "license": "MIT",
"engines": {
"node": ">=0.6"
}
},
+ "node_modules/touch": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz",
+ "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==",
+ "bin": {
+ "nodetouch": "bin/nodetouch.js"
+ }
+ },
"node_modules/type-is": {
"version": "1.6.18",
- "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
- "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
+ "license": "MIT",
"dependencies": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
@@ -679,26 +1141,36 @@
"node": ">= 0.6"
}
},
+ "node_modules/typed-function": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-2.1.0.tgz",
+ "integrity": "sha512-bctQIOqx2iVbWGDGPWwIm18QScpu2XRmkC19D8rQGFsjKSgteq/o1hTZvIG/wuDq8fanpBDrLkLq+aEN/6y5XQ==",
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/undefsafe": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz",
+ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA=="
+ },
"node_modules/unpipe": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
- "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+ "license": "MIT",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/utils-merge": {
"version": "1.0.1",
- "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
- "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
+ "license": "MIT",
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/vary": {
"version": "1.1.2",
- "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
- "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+ "license": "MIT",
"engines": {
"node": ">= 0.8"
}
diff --git a/public/index.html b/public/index.html
deleted file mode 100644
index 906bf07..0000000
--- a/public/index.html
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
-
-
-
Dark Triad Assessments
-
-
-
-
-
-
-
-
-
-
-
-
Welcome to Dark Triad Assessments
-
Explore the darker aspects of personality through scientifically validated assessments
-
-
-
-
-
-
- Dark Triad Assessments
-
-
-
-
-
-
- Short Dark Triad (SD3)
- Assesses Machiavellianism, Narcissism, and Psychopathy (Jones & Paulhus, 2014).
-
-
-
- Dirty Dozen
- A concise measure of the Dark Triad traits (Jonason & Webster, 2010).
-
-
-
- Short Dark Tetrad (SD4)
- Assesses Machiavellianism, Narcissism, Psychopathy, and Sadism (Paulhus et al., 2020).
-
-
-
- MACH-IV
- Measures Machiavellianism in interpersonal relationships (Christie & Geis, 1970).
-
-
-
- Narcissistic Personality Inventory (NPI-40)
- Measures narcissistic personality traits (Raskin & Terry, 1988).
-
-
-
- Self-Report Psychopathy Scale (SRP-III)
- Assesses psychopathic traits in non-clinical populations (Paulhus et al., 2016).
-
-
-
- HEXACO-60
- Evaluates six major dimensions of personality, including the Dark Triad-relevant Honesty-Humility factor (Ashton & Lee, 2009).
-
-
-
-
-
-
-
-
- Psychometric Calculator
-
-
-
- Stroop Task
-
-
Name the color of the word, not the word itself.
-
This task measures cognitive flexibility and inhibition, which may relate to Dark Triad traits.
-
-
-
-
-
Results
-
Accuracy:
-
Average Response Time:
-
-
-
-
-
- Literature Review
-
-
-
-
-
-
-
-
-
-
-
×
-
Scientific Articles
-
-
-
-
-
-
×
-
Detailed Interpretation
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/public/script.js b/public/script.js
deleted file mode 100644
index 4441380..0000000
--- a/public/script.js
+++ /dev/null
@@ -1,1065 +0,0 @@
-'use strict';
-
-console.log('Script is running');
-
-// ===== Module: Theme Management =====
-document.addEventListener('DOMContentLoaded', initializeApp);
-
-function initializeApp() {
- const modules = [
- initializeDarkMode,
- initializeIntroScreen,
- initializeModals,
- initializeMenuToggle,
- initializeAssessments,
- initializeScientificArticles,
- initializeStroopTask,
- initializePsychometricCalculator,
- initializeBackgroundAndHistory
- ];
-
- modules.forEach(module => {
- try {
- module();
- } catch (error) {
- console.error(`Error initializing module: ${module.name}`, error);
- }
- });
-}
-
-function initializeDarkMode() {
- const darkModeToggle = document.getElementById('darkModeToggle');
- if (!darkModeToggle) {
- console.error('Dark mode toggle button not found');
- return;
- }
- darkModeToggle.addEventListener('click', toggleDarkMode);
- updateDarkModeToggle();
-
- // Check for user's preferred color scheme
- if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
- document.body.classList.add('dark-mode');
- updateDarkModeToggle();
- updateChartColors();
- }
-
- // Listen for changes in color scheme preference
- window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
- if (e.matches) {
- document.body.classList.add('dark-mode');
- } else {
- document.body.classList.remove('dark-mode');
- }
- updateDarkModeToggle();
- updateChartColors();
- });
-}
-
-function toggleDarkMode() {
- document.body.classList.toggle('dark-mode');
- updateDarkModeToggle();
- updateStyles();
- updateChartColors();
-
- // Save user preference
- localStorage.setItem('darkMode', document.body.classList.contains('dark-mode'));
-}
-
-function updateDarkModeToggle() {
- const darkModeToggle = document.getElementById('darkModeToggle');
- if (!darkModeToggle) return;
- darkModeToggle.textContent = document.body.classList.contains('dark-mode') ? '☀️ Light Mode' : '🌙 Dark Mode';
- darkModeToggle.style.color = document.body.classList.contains('dark-mode') ? '#ecf0f1' : '#333';
-
- // Update other UI elements
- const isDarkMode = document.body.classList.contains('dark-mode');
- const textColor = isDarkMode ? '#ecf0f1' : '#333';
- const backgroundColor = isDarkMode ? '#333' : '#ecf0f1';
- const accentColor = isDarkMode ? '#3498db' : '#2980b9';
-
- document.documentElement.style.setProperty('--text-color', textColor);
- document.documentElement.style.setProperty('--background-color', backgroundColor);
- document.documentElement.style.setProperty('--accent-color', accentColor);
-
- // Update specific elements
- const buttons = document.querySelectorAll('button');
- buttons.forEach(button => {
- button.style.color = textColor;
- button.style.backgroundColor = accentColor;
- });
-
- const inputs = document.querySelectorAll('input');
- inputs.forEach(input => {
- input.style.color = textColor;
- input.style.backgroundColor = backgroundColor;
- input.style.borderColor = accentColor;
- });
-
- // Update chart colors if chart exists
- if (window.resultsChart) {
- updateChartColors(isDarkMode);
- }
-
- // Trigger a custom event for other parts of the application
- const event = new CustomEvent('themeChanged', {
- detail: {
- isDarkMode,
- textColor,
- backgroundColor,
- accentColor
- }
- });
- document.dispatchEvent(event);
-
- // Log the theme change for debugging
- console.log(`Theme changed. Dark mode: ${isDarkMode}`);
-}
-
-function updateChartColors(isDarkMode) {
- const textColor = isDarkMode ? '#ecf0f1' : '#333';
- const backgroundColor = isDarkMode ? '#333' : '#ecf0f1';
-
- window.resultsChart.options.scales.r.pointLabels.color = textColor;
- window.resultsChart.options.plugins.legend.labels.color = textColor;
- window.resultsChart.options.plugins.tooltip.backgroundColor = backgroundColor;
- window.resultsChart.options.plugins.tooltip.titleColor = textColor;
- window.resultsChart.options.plugins.tooltip.bodyColor = textColor;
- window.resultsChart.update();
-}
-
-// Function to apply saved dark mode preference
-function applySavedDarkModePreference() {
- const savedDarkMode = localStorage.getItem('darkMode');
- if (savedDarkMode === 'true') {
- document.body.classList.add('dark-mode');
- updateDarkModeToggle();
- updateChartColors(true);
- }
-}
-
-// Call this function after DOM is loaded
-document.addEventListener('DOMContentLoaded', applySavedDarkModePreference);
-
-function updateChartColors(isDarkMode) {
- if (!window.resultsChart) return;
- const textColor = isDarkMode ? '#ecf0f1' : '#333';
- const backgroundColor = isDarkMode ? '#333' : '#ecf0f1';
-
- window.resultsChart.options.scales.r.pointLabels.color = textColor;
- window.resultsChart.options.plugins.legend.labels.color = textColor;
- window.resultsChart.options.plugins.tooltip.backgroundColor = backgroundColor;
- window.resultsChart.options.plugins.tooltip.titleColor = textColor;
- window.resultsChart.options.plugins.tooltip.bodyColor = textColor;
- window.resultsChart.update();
-}
-
-// ===== Module: Intro Screen Logic =====
-function initializeIntroScreen() {
- const intro = document.getElementById('intro');
- const content = document.getElementById('content');
-
- if (!intro || !content) {
- console.error('Required elements not found for intro screen');
- return;
- }
-
- setTimeout(() => {
- intro.style.opacity = '0';
- setTimeout(() => {
- intro.style.display = 'none';
- content.classList.remove('hidden');
- }, 500);
- }, 500);
-}
-
-// ===== Module: Menu Toggle =====
-function initializeMenuToggle() {
- const menuToggle = document.getElementById('menuToggle');
- const mainNav = document.getElementById('mainNav');
-
- if (!menuToggle || !mainNav) {
- console.error('Required elements not found for menu toggle');
- return;
- }
-
- menuToggle.addEventListener('click', () => {
- mainNav.classList.toggle('show');
-
- // Update aria-expanded attribute for accessibility
- const isExpanded = mainNav.classList.contains('show');
- menuToggle.setAttribute('aria-expanded', isExpanded.toString());
-
- // Update menu toggle appearance
- updateMenuToggleAppearance(isExpanded);
-
- // Handle focus management
- if (isExpanded) {
- // Set focus to the first focusable element in the menu
- const firstFocusableElement = mainNav.querySelector('a, button, input, select, textarea');
- if (firstFocusableElement) {
- firstFocusableElement.focus();
- }
- } else {
- // Return focus to menu toggle when closing
- menuToggle.focus();
- }
-
- // Announce menu state change for screen readers
- const menuStateAnnouncement = document.getElementById('menuStateAnnouncement');
- if (menuStateAnnouncement) {
- menuStateAnnouncement.textContent = isExpanded ? 'Menu opened' : 'Menu closed';
- } else {
- console.warn('Menu state announcement element not found');
- }
-
- // Update menu toggle icon or text if needed
- updateMenuToggleAppearance(isExpanded);
- });
-
- // Close menu when clicking outside
- document.addEventListener('click', (event) => {
- if (!menuToggle.contains(event.target) && !mainNav.contains(event.target)) {
- mainNav.classList.remove('show');
- menuToggle.setAttribute('aria-expanded', 'false');
- updateMenuToggleAppearance(false);
- }
- });
-
- // Close menu when pressing Escape key
- document.addEventListener('keydown', (event) => {
- if (event.key === 'Escape' && mainNav.classList.contains('show')) {
- mainNav.classList.remove('show');
- menuToggle.setAttribute('aria-expanded', 'false');
- updateMenuToggleAppearance(false);
- menuToggle.focus(); // Return focus to menu toggle
- }
- });
-
- // Initialize menu state
- const initialState = mainNav.classList.contains('show');
- menuToggle.setAttribute('aria-expanded', initialState.toString());
- updateMenuToggleAppearance(initialState);
-
- // Ensure the menu is properly hidden on page load if not expanded
- if (!initialState) {
- mainNav.style.display = 'none';
- }
-
- // Add resize event listener to handle menu visibility on window resize
- window.addEventListener('resize', () => {
- const isExpanded = mainNav.classList.contains('show');
- if (window.innerWidth > 768 && !isExpanded) { // Adjust breakpoint as needed
- mainNav.style.display = ''; // Reset to default display
- } else if (window.innerWidth <= 768 && !isExpanded) {
- mainNav.style.display = 'none';
- }
- });
-
- // Initialize focus trap for accessibility
- const focusableElements = mainNav.querySelectorAll('a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])');
- const firstFocusableElement = focusableElements[0];
- const lastFocusableElement = focusableElements[focusableElements.length - 1];
-
- mainNav.addEventListener('keydown', (e) => {
- if (e.key === 'Tab') {
- if (e.shiftKey && document.activeElement === firstFocusableElement) {
- e.preventDefault();
- lastFocusableElement.focus();
- } else if (!e.shiftKey && document.activeElement === lastFocusableElement) {
- e.preventDefault();
- firstFocusableElement.focus();
- }
- }
- });
-
- console.log('Menu toggle initialized');
-}
-
-function updateMenuToggleAppearance(isExpanded) {
- const menuToggle = document.getElementById('menuToggle');
- if (menuToggle) {
- // Update icon or text based on menu state
- menuToggle.innerHTML = isExpanded ? '✕' : '☰';
- menuToggle.setAttribute('aria-label', isExpanded ? 'Close menu' : 'Open menu');
- }
-}
-
-// Call initializeMenuToggle when the DOM is fully loaded
-document.addEventListener('DOMContentLoaded', initializeMenuToggle);
-
-// ===== Module: Assessments =====
-const assessments = {
- sdt3: [
- { question: "It's not wise to tell your secrets.", trait: "Machiavellianism" },
- // Add more SDT3 questions here
- ],
- dirtyDozen: [
- // Add Dirty Dozen questions here
- ],
- sdt4: [
- // Add SDT4 questions here
- ],
- machIV: [
- // Add MACH IV questions here
- ],
- mmpi: [
- // Add MMPI-style questions here
- ],
- hexaco: [
- // Add HEXACO questions here
- ],
- ocean: [
- // Add OCEAN questions here
- ]
-};
-
-let currentAssessment = '';
-let currentQuestionIndex = 0;
-let answers = {};
-let autoAdvanceTimer;
-
-function initializeAssessments() {
- const assessmentButtons = document.querySelectorAll('.assessment button');
- assessmentButtons.forEach(button => {
- button.addEventListener('click', (e) => {
- const assessmentType = e.target.closest('.assessment').id;
- startAssessment(assessmentType);
- });
- });
-}
-
-function startAssessment(assessment) {
- if (!assessments[assessment]) {
- console.error(`Invalid assessment type: ${assessment}`);
- return;
- }
-
- currentAssessment = assessment;
- currentQuestionIndex = 0;
- answers = {};
-
- const elementsToToggle = ['assessments', 'assessmentQuestions', 'progressBarContainer'];
- elementsToToggle.forEach(toggleElementVisibility);
-
- showQuestion();
-}
-
-function toggleElementVisibility(id) {
- const element = document.getElementById(id);
- if (element) {
- element.classList.toggle('hidden');
- } else {
- console.warn(`Element with id '${id}' not found`);
- }
-}
-
-function showQuestion() {
- const questionContainer = document.getElementById('assessmentQuestions');
- if (!questionContainer) {
- console.error('Question container not found');
- return;
- }
-
- const currentAssessmentQuestions = assessments[currentAssessment];
- if (!currentAssessmentQuestions || currentQuestionIndex >= currentAssessmentQuestions.length) {
- console.error('Invalid question index or assessment');
- return;
- }
-
- const question = currentAssessmentQuestions[currentQuestionIndex];
- const totalQuestions = currentAssessmentQuestions.length;
-
- questionContainer.innerHTML = generateQuestionHTML(question, currentQuestionIndex, totalQuestions);
-
- updateProgressBar();
- startAutoAdvance();
-}
-
-function generateQuestionHTML(question, index, total) {
- return `
-
-
Question ${index + 1} of ${total}
-
${question.question}
-
- ${generateOptionsHTML()}
-
-
-
-
- `;
-}
-
-function generateOptionsHTML() {
- return [1, 2, 3, 4, 5].map(value => `
-
- `).join('');
-}
-
-function getScaleLabel(value) {
- const labels = ['Strongly Disagree', 'Disagree', 'Neutral', 'Agree', 'Strongly Agree'];
- return labels[value - 1] || 'Unknown';
-}
-
-function startAutoAdvance() {
- let timeLeft = 4;
- const timerDisplay = document.getElementById('autoAdvanceTimer');
- if (!timerDisplay) {
- console.error('Timer display element not found');
- return;
- }
-
- updateTimerDisplay(timerDisplay, timeLeft);
-
- autoAdvanceTimer = setInterval(() => {
- timeLeft--;
- if (timeLeft > 0) {
- updateTimerDisplay(timerDisplay, timeLeft);
- } else {
- clearInterval(autoAdvanceTimer);
- submitAnswer();
- }
- }, 1000);
-}
-
-function updateTimerDisplay(timerDisplay, timeLeft) {
- timerDisplay.textContent = `Auto-advancing in ${timeLeft} seconds...`;
-}
-
-function resetAutoAdvance() {
- clearInterval(autoAdvanceTimer);
- startAutoAdvance();
-}
-
-function submitAnswer() {
- clearInterval(autoAdvanceTimer);
- const selectedAnswer = document.querySelector('input[name="answer"]:checked');
- if (selectedAnswer) {
- processAnswer(selectedAnswer.value);
- advanceQuestion();
- } else {
- alert('Please select an answer before proceeding.');
- startAutoAdvance();
- }
-}
-
-function processAnswer(value) {
- const question = assessments[currentAssessment][currentQuestionIndex];
- const score = parseInt(value, 10);
- answers[question.trait] = (answers[question.trait] || 0) + (question.reversed ? 6 - score : score);
-}
-
-function advanceQuestion() {
- currentQuestionIndex++;
- if (currentQuestionIndex < assessments[currentAssessment].length) {
- showQuestion();
- } else {
- showResults();
- }
-}
-
-function updateProgressBar() {
- const progressBar = document.getElementById('progressBar');
- if (!progressBar) return;
- const progress = ((currentQuestionIndex + 1) / assessments[currentAssessment].length) * 100;
- progressBar.style.width = `${progress}%`;
- progressBar.textContent = `${Math.round(progress)}%`;
-}
-
-// ===== Module: Results Handling =====
-function showResults() {
- toggleElementVisibility('assessmentQuestions');
- toggleElementVisibility('progressBarContainer');
- toggleElementVisibility('results');
- toggleElementVisibility('resultsChart');
-
- const traits = Object.keys(answers);
- const scores = traits.map(trait => {
- const maxScore = assessments[currentAssessment].filter(q => q.trait === trait).length * 5;
- return (answers[trait] / maxScore) * 100;
- });
-
- const resultsContainer = document.getElementById('results');
- resultsContainer.innerHTML = `
-
Your Results
- ${traits.map((trait, index) => `
-
${trait}: ${scores[index].toFixed(2)}%
- ℹ
- `).join('')}
-
-
-
- `;
-
- createChart(traits, scores);
-}
-
-function getTraitExplanation(trait) {
- const explanations = {
- 'Machiavellianism': 'Tendency to manipulate and exploit others for personal gain.',
- 'Narcissism': 'Excessive self-love, grandiosity, and need for admiration.',
- 'Psychopathy': 'Lack of empathy, impulsivity, and antisocial behavior.',
- 'Sadism': 'Deriving pleasure from inflicting pain or humiliation on others.',
- // Add explanations for other traits here
- };
- return explanations[trait] || 'No explanation available.';
-}
-
-function createChart(traits, scores) {
- const ctx = document.getElementById('resultsChart').getContext('2d');
- const isDarkMode = document.body.classList.contains('dark-mode');
- const textColor = isDarkMode ? '#ecf0f1' : '#333';
-
- if (window.resultsChart) {
- window.resultsChart.destroy();
- }
-
- window.resultsChart = new Chart(ctx, {
- type: 'radar',
- data: {
- labels: traits,
- datasets: [{
- label: 'Scores',
- data: scores,
- backgroundColor: 'rgba(54, 162, 235, 0.2)',
- borderColor: 'rgb(54, 162, 235)',
- borderWidth: 2
- }]
- },
- options: {
- scales: {
- r: {
- angleLines: {
- display: false
- },
- suggestedMin: 0,
- suggestedMax: 100,
- pointLabels: {
- color: textColor,
- font: {
- family: 'Lato, sans-serif'
- }
- },
- ticks: {
- backdropColor: 'transparent',
- color: textColor
- }
- }
- },
- plugins: {
- legend: {
- labels: {
- color: textColor,
- font: {
- family: 'Lato, sans-serif'
- }
- }
- }
- }
- }
- });
-}
-
-function resetAssessment() {
- document.getElementById('results').classList.add('hidden');
- document.getElementById('resultsChart').classList.add('hidden');
- document.getElementById('assessments').classList.remove('hidden');
- currentAssessment = '';
- currentQuestionIndex = 0;
- answers = {};
-}
-
-// ===== Module: Interpretation Modal =====
-function showInterpretation() {
- const interpretationModal = document.getElementById('interpretationModal');
- const interpretationContent = document.getElementById('interpretationContent');
-
- let content = '
Interpretation of Your Results
';
- Object.keys(answers).forEach(trait => {
- const score = (answers[trait] / (assessments[currentAssessment].filter(q => q.trait === trait).length * 5)) * 100;
- content += `
${trait}
`;
- content += `
Your score: ${score.toFixed(2)}%
`;
- content += `
${getDetailedInterpretation(trait, score)}
`;
- });
-
- interpretationContent.innerHTML = content;
- interpretationModal.style.display = 'block';
-}
-
-function getDetailedInterpretation(trait, score) {
- const interpretations = {
- 'Machiavellianism': {
- low: 'You tend to be straightforward in your interactions and may prefer direct approaches in dealing with others.',
- medium: 'You show a balance between strategic thinking and straightforward approaches in your interactions.',
- high: 'You tend to be strategic and calculating in your approach to social interactions and may be skilled at manipulating situations to your advantage.'
- },
- // Add interpretations for other traits here
- };
-
- if (score < 33) {
- return interpretations[trait].low;
- } else if (score < 66) {
- return interpretations[trait].medium;
- } else {
- return interpretations[trait].high;
- }
-}
-
-function closeInterpretationModal() {
- document.getElementById('interpretationModal').style.display = 'none';
-}
-
-// ===== Module: Scientific Articles =====
-function initializeScientificArticles() {
- const showArticlesButton = document.getElementById('showScientificArticles');
- showArticlesButton.addEventListener('click', showScientificArticles);
-}
-
-function showScientificArticles() {
- const modal = document.getElementById('articlesModal');
- const articlesList = document.getElementById('articlesList');
- articlesList.innerHTML = '';
-
- const articles = [
- { title: "The Dark Triad of personality: A 10 year review", authors: "Furnham, A., Richards, S. C., & Paulhus, D. L.", year: 2013, journal: "Social and Personality Psychology Compass", doi: "10.1111/spc3.12018" },
- { title: "The Short Dark Triad (SD3): A Brief Measure of Dark Personality Traits", authors: "Jones, D. N., & Paulhus, D. L.", year: 2014, journal: "Assessment", doi: "10.1177/1073191113514105" },
- // Add more articles here
- ];
-
- articles.forEach(article => {
- const li = document.createElement('li');
- li.innerHTML = `
${article.title}
- ${article.authors} (${article.year})
- ${article.journal}
- DOI:
${article.doi}`;
- articlesList.appendChild(li);
- });
-
- modal.style.display = 'block';
-}
-
-function closeModal() {
- document.getElementById('articlesModal').style.display = 'none';
-}
-
-// ===== Module: Stroop Task =====
-function initializeStroopTask() {
- const startButton = document.querySelector('#stroopTask button');
- if (!startButton) {
- console.error('Stroop task start button not found');
- return;
- }
- startButton.addEventListener('click', startStroopTask);
-}
-
-function startStroopTask() {
- const stroopInstructions = document.getElementById('stroopInstructions');
- const stroopGame = document.getElementById('stroopGame');
- if (!stroopInstructions || !stroopGame) {
- console.error('Required Stroop task elements not found');
- return;
- }
- stroopInstructions.classList.add('hidden');
- stroopGame.classList.remove('hidden');
-
- const colors = ['red', 'blue', 'green', 'yellow'];
- const words = ['RED', 'BLUE', 'GREEN', 'YELLOW'];
- let currentRound = 0;
- let correctAnswers = 0;
- let totalTime = 0;
- let startTime;
-
- function nextRound() {
- if (currentRound >= 10) {
- endStroopTask();
- return;
- }
-
- const wordElement = document.getElementById('stroopWord');
- const colorIndex = Math.floor(Math.random() * colors.length);
- const wordIndex = Math.floor(Math.random() * words.length);
-
- wordElement.textContent = words[wordIndex];
- wordElement.style.color = colors[colorIndex];
-
- const buttonsContainer = document.getElementById('stroopButtons');
- buttonsContainer.innerHTML = '';
- colors.forEach(color => {
- const button = document.createElement('button');
- button.textContent = color.toUpperCase();
- button.style.backgroundColor = color;
- button.addEventListener('click', () => checkAnswer(color));
- buttonsContainer.appendChild(button);
- });
-
- startTime = performance.now();
- }
-
- function checkAnswer(selectedColor) {
- const endTime = performance.now();
- const reactionTime = endTime - startTime;
- totalTime += reactionTime;
-
- if (selectedColor === document.getElementById('stroopWord').style.color) {
- correctAnswers++;
- }
-
- currentRound++;
- updateProgress();
- nextRound();
- }
-
- function updateProgress() {
- const progressElement = document.getElementById('stroopProgress');
- if (progressElement) {
- progressElement.style.width = `${(currentRound / 10) * 100}%`;
- }
- }
-
- function endStroopTask() {
- const stroopGame = document.getElementById('stroopGame');
- const stroopResults = document.getElementById('stroopResults');
- if (!stroopGame || !stroopResults) {
- console.error('Required Stroop task result elements not found');
- return;
- }
- stroopGame.classList.add('hidden');
- stroopResults.classList.remove('hidden');
-
- const accuracyElement = document.getElementById('stroopAccuracy');
- const avgTimeElement = document.getElementById('stroopAvgTime');
-
- if (accuracyElement && avgTimeElement) {
- const accuracy = (correctAnswers / 10) * 100;
- const avgTime = totalTime / 10;
- accuracyElement.textContent = `${accuracy.toFixed(2)}%`;
- avgTimeElement.textContent = `${avgTime.toFixed(2)}ms`;
- }
-
- // Add more detailed analysis here
- const analysisElement = document.createElement('div');
- analysisElement.innerHTML = `
-
Detailed Analysis:
-
Total correct answers: ${correctAnswers} out of 10
-
Average reaction time: ${(totalTime / 10).toFixed(2)}ms
-
Interpretation: ${interpretStroopResults(correctAnswers, totalTime / 10)}
- `;
- stroopResults.appendChild(analysisElement);
-
- // Calculate and display percentile ranks
- const accuracyPercentile = calculatePercentile(accuracy, 50, 15); // Assuming normal distribution
- const speedPercentile = calculatePercentile(avgTime, 1000, 200, true); // Assuming lower is better
-
- const percentileElement = document.createElement('div');
- percentileElement.innerHTML = `
-
Percentile Ranks:
-
Accuracy: ${accuracyPercentile.toFixed(2)}th percentile
-
Speed: ${speedPercentile.toFixed(2)}th percentile
- `;
- stroopResults.appendChild(percentileElement);
- }
-
- function interpretStroopResults(correctAnswers, avgTime) {
- let interpretation = "";
- if (correctAnswers >= 9) {
- interpretation += "Excellent accuracy. ";
- } else if (correctAnswers >= 7) {
- interpretation += "Good accuracy. ";
- } else {
- interpretation += "Room for improvement in accuracy. ";
- }
-
- if (avgTime < 800) {
- interpretation += "Very fast response time. ";
- } else if (avgTime < 1200) {
- interpretation += "Average response time. ";
- } else {
- interpretation += "Response time could be improved. ";
- }
-
- interpretation += "The Stroop effect demonstrates the interference in the reaction time of a task. ";
- interpretation += "A longer response time typically indicates a stronger interference effect. ";
- interpretation += "This test can provide insights into cognitive flexibility and executive function.";
-
- return interpretation;
- }
-
- function calculatePercentile(score, mean, stdDev, lowerIsBetter = false) {
- const zScore = (score - mean) / stdDev;
- const percentile = (1 - math.erf(zScore / Math.sqrt(2))) / 2;
- return lowerIsBetter ? percentile * 100 : (1 - percentile) * 100;
- }
-
- nextRound();
-}
-
-function resetStroopTask() {
- const stroopInstructions = document.getElementById('stroopInstructions');
- const stroopResults = document.getElementById('stroopResults');
- const stroopGame = document.getElementById('stroopGame');
- if (!stroopInstructions || !stroopResults || !stroopGame) {
- console.error('Required Stroop task elements not found for reset');
- return;
- }
- stroopResults.classList.add('hidden');
- stroopGame.classList.add('hidden');
- stroopInstructions.classList.remove('hidden');
-
- // Reset progress bar
- const progressElement = document.getElementById('stroopProgress');
- if (progressElement) {
- progressElement.style.width = '0%';
- }
-
- // Clear any previous results
- while (stroopResults.firstChild) {
- stroopResults.removeChild(stroopResults.firstChild);
- }
-
- // Reset global variables
- currentRound = 0;
- correctAnswers = 0;
- totalTime = 0;
-}
-
-// ===== Module: Psychometric Calculator =====
-function initializePsychometricCalculator() {
- const calculatorSection = document.getElementById('psychometric');
- if (!calculatorSection) {
- console.error('Psychometric calculator section not found');
- return;
- }
- calculatorSection.innerHTML = `
-
Psychometric Calculator
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- `;
-}
-
-function calculateZScore() {
- const rawScore = parseFloat(document.getElementById('rawScore').value);
- const mean = parseFloat(document.getElementById('mean').value);
- const stdDev = parseFloat(document.getElementById('stdDev').value);
-
- if (isNaN(rawScore) || isNaN(mean) || isNaN(stdDev)) {
- alert('Please enter valid numbers for all fields.');
- return;
- }
-
- if (stdDev <= 0) {
- alert('Standard deviation must be a positive number.');
- return;
- }
-
- const zScore = (rawScore - mean) / stdDev;
- const resultElement = document.getElementById('zScoreResult');
- const percentileElement = document.getElementById('percentileResult');
- const interpretationElement = document.getElementById('interpretationResult');
-
- if (resultElement && percentileElement && interpretationElement) {
- resultElement.textContent = `Z-Score: ${zScore.toFixed(2)}`;
-
- const { percentile, interpretation } = calculatePercentile(zScore);
-
- if (percentile !== null) {
- percentileElement.textContent = `Percentile: ${percentile}`;
- interpretationElement.textContent = `Interpretation: ${interpretation}`;
- } else {
- percentileElement.textContent = 'Error in percentile calculation';
- interpretationElement.textContent = interpretation;
- }
-
- // Additional contextualization
- let additionalContext = '';
- if (zScore > 3 || zScore < -3) {
- additionalContext = 'This score is considered extreme and may warrant further investigation.';
- } else if (zScore > 2 || zScore < -2) {
- additionalContext = 'This score is notably different from the average.';
- } else if (zScore > 1 || zScore < -1) {
- additionalContext = 'This score is moderately different from the average.';
- } else {
- additionalContext = 'This score is close to the average.';
- }
-
- const contextElement = document.createElement('p');
- contextElement.textContent = additionalContext;
- interpretationElement.appendChild(contextElement);
- } else {
- console.error('One or more result elements not found');
- }
-}
-
-function calculatePercentile(zScore) {
- // Using the error function (erf) to calculate the cumulative distribution function (CDF)
- try {
- const cdf = 0.5 * (1 + math.erf(zScore / Math.sqrt(2)));
- const percentile = cdf * 100;
-
- // Ensure the percentile is within the valid range
- if (percentile < 0 || percentile > 100) {
- throw new Error('Calculated percentile is out of range');
- }
-
- // Contextualize the result
- let interpretation;
- if (percentile < 2.5) {
- interpretation = "Extremely low (bottom 2.5%)";
- } else if (percentile < 16) {
- interpretation = "Low (bottom 16%)";
- } else if (percentile < 84) {
- interpretation = "Average (middle 68%)";
- } else if (percentile < 97.5) {
- interpretation = "High (top 16%)";
- } else {
- interpretation = "Extremely high (top 2.5%)";
- }
-
- return {
- percentile: percentile.toFixed(2),
- interpretation: interpretation
- };
- } catch (error) {
- console.error('Error in percentile calculation:', error);
- return {
- percentile: null,
- interpretation: 'Error in calculation. Please check your inputs.'
- };
- }
-}
-
-// ===== Module: Background and History =====
-function initializeBackgroundAndHistory() {
- const backgroundSection = document.getElementById('background');
- if (!backgroundSection) {
- console.error('Background section not found');
- return;
- }
- backgroundSection.innerHTML = `
-
Background & History of Dark Triad Research
-
The Dark Triad is a group of three personality traits: Narcissism, Machiavellianism, and Psychopathy. These traits are called "dark" because of their malevolent qualities.
-
Timeline:
-
- - 1970s: Research on individual dark personality traits begins
- - 2002: Paulhus and Williams coin the term "Dark Triad"
- - 2010s: Development of various Dark Triad measurement tools
- - Present: Ongoing research into the impact of Dark Triad traits in various contexts
-
-
-
-
Additional historical information and research milestones...
-
Key Researchers:
-
- - Delroy L. Paulhus
- - Kevin M. Williams
- - Daniel N. Jones
- - Robert D. Hare (Psychopathy research)
-
-
Important Studies:
-
- - Paulhus, D. L., & Williams, K. M. (2002). The Dark Triad of personality: Narcissism, Machiavellianism, and psychopathy.
- - Jones, D. N., & Paulhus, D. L. (2014). Introducing the Short Dark Triad (SD3): A brief measure of dark personality traits.
-
-
- `;
-}
-
-function toggleMoreHistory() {
- const moreHistory = document.getElementById('moreHistory');
- const button = moreHistory.previousElementSibling;
- if (moreHistory && button) {
- moreHistory.classList.toggle('hidden');
- button.textContent = moreHistory.classList.contains('hidden') ? 'Show More' : 'Show Less';
- }
-}
-
-// Add this function to update styles dynamically
-function updateStyles() {
- const root = document.documentElement;
- const isDarkMode = document.body.classList.contains('dark-mode');
-
- // Update CSS variables
- root.style.setProperty('--primary-color', isDarkMode ? '#2980b9' : '#3498db');
- root.style.setProperty('--secondary-color', isDarkMode ? '#27ae60' : '#2ecc71');
- root.style.setProperty('--background-color', isDarkMode ? '#2c3e50' : '#f4f4f4');
- root.style.setProperty('--text-color', isDarkMode ? '#ecf0f1' : '#333');
- root.style.setProperty('--button-hover-color', isDarkMode ? '#3498db' : '#2980b9');
- root.style.setProperty('--assessment-bg', isDarkMode ? '#34495e' : '#ffffff');
- root.style.setProperty('--assessment-shadow', isDarkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)');
-
- // Update specific elements
- const buttons = document.querySelectorAll('button');
- buttons.forEach(button => {
- button.style.backgroundColor = getComputedStyle(root).getPropertyValue('--primary-color');
- button.style.color = isDarkMode ? '#ecf0f1' : '#ffffff';
- });
-
- const assessments = document.querySelectorAll('.assessment');
- assessments.forEach(assessment => {
- assessment.style.backgroundColor = getComputedStyle(root).getPropertyValue('--assessment-bg');
- assessment.style.boxShadow = `0 4px 6px ${getComputedStyle(root).getPropertyValue('--assessment-shadow')}`;
- });
-
- // Update chart colors if chart exists
- if (window.resultsChart) {
- updateChartColors(isDarkMode);
- }
-}
-
-// Call updateStyles when the page loads
-document.addEventListener('DOMContentLoaded', () => {
- updateStyles();
- // ... (rest of your initialization code)
-});
-
-// Expose necessary functions to the global scope
-const functionsToExpose = {
- startAssessment,
- submitAnswer,
- resetAutoAdvance,
- resetAssessment,
- showInterpretation,
- closeInterpretationModal,
- closeModal,
- startStroopTask,
- resetStroopTask,
- calculateZScore,
- toggleMoreHistory
-};
-
-// Use Object.assign to add the functions to the window object
-Object.assign(window, functionsToExpose);
-
-// Add error handling for global function calls
-Object.keys(functionsToExpose).forEach(funcName => {
- const originalFunc = window[funcName];
- window[funcName] = function(...args) {
- try {
- return originalFunc.apply(this, args);
- } catch (error) {
- console.error(`Error in ${funcName}:`, error);
- // Optionally, you could show an error message to the user here
- }
- };
-});
-
-// Ensure all required functions are available
-Object.keys(functionsToExpose).forEach(funcName => {
- if (typeof window[funcName] !== 'function') {
- console.warn(`Function ${funcName} is not properly exposed to the global scope.`);
- }
-});
\ No newline at end of file