diff --git a/package-lock.json b/package-lock.json index 70dde6eb..b6853b28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,107 +32,37 @@ } }, "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.24.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", + "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "@babel/highlight": "^7.24.2", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/code-frame/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==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/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==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz", - "integrity": "sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", - "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", + "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -593,9 +523,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.0.tgz", - "integrity": "sha512-JylOEEzDiOryeUnFbQz+oViCXS0KsvR1mvHkoMiu5+UiBvy+RYX7tzlIIIEstF/gVa2tj9AQXk3dgnxv6KxhFg==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -661,9 +591,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", - "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "dev": true }, "node_modules/@jest/schemas": { @@ -678,74 +608,12 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", - "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -794,9 +662,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.0.tgz", - "integrity": "sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.2.tgz", + "integrity": "sha512-3XFIDKWMFZrMnao1mJhnOT1h2g0169Os848NhhmGweEcfJ4rCi+3yMCOLG4zA61rbJdkcrM/DjVZm9Hg5p5w7g==", "cpu": [ "arm" ], @@ -807,9 +675,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.0.tgz", - "integrity": "sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.2.tgz", + "integrity": "sha512-GdxxXbAuM7Y/YQM9/TwwP+L0omeE/lJAR1J+olu36c3LqqZEBdsIWeQ91KBe6nxwOnb06Xh7JS2U5ooWU5/LgQ==", "cpu": [ "arm64" ], @@ -820,9 +688,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.0.tgz", - "integrity": "sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.2.tgz", + "integrity": "sha512-mCMlpzlBgOTdaFs83I4XRr8wNPveJiJX1RLfv4hggyIVhfB5mJfN4P8Z6yKh+oE4Luz+qq1P3kVdWrCKcMYrrA==", "cpu": [ "arm64" ], @@ -833,9 +701,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.0.tgz", - "integrity": "sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.2.tgz", + "integrity": "sha512-yUoEvnH0FBef/NbB1u6d3HNGyruAKnN74LrPAfDQL3O32e3k3OSfLrPgSJmgb3PJrBZWfPyt6m4ZhAFa2nZp2A==", "cpu": [ "x64" ], @@ -846,9 +714,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.0.tgz", - "integrity": "sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.2.tgz", + "integrity": "sha512-GYbLs5ErswU/Xs7aGXqzc3RrdEjKdmoCrgzhJWyFL0r5fL3qd1NPcDKDowDnmcoSiGJeU68/Vy+OMUluRxPiLQ==", "cpu": [ "arm" ], @@ -859,9 +727,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.0.tgz", - "integrity": "sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.2.tgz", + "integrity": "sha512-L1+D8/wqGnKQIlh4Zre9i4R4b4noxzH5DDciyahX4oOz62CphY7WDWqJoQ66zNR4oScLNOqQJfNSIAe/6TPUmQ==", "cpu": [ "arm64" ], @@ -872,9 +740,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.0.tgz", - "integrity": "sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.2.tgz", + "integrity": "sha512-tK5eoKFkXdz6vjfkSTCupUzCo40xueTOiOO6PeEIadlNBkadH1wNOH8ILCPIl8by/Gmb5AGAeQOFeLev7iZDOA==", "cpu": [ "arm64" ], @@ -884,10 +752,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.13.2.tgz", + "integrity": "sha512-zvXvAUGGEYi6tYhcDmb9wlOckVbuD+7z3mzInCSTACJ4DQrdSLPNUeDIcAQW39M3q6PDquqLWu7pnO39uSMRzQ==", + "cpu": [ + "ppc64le" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.0.tgz", - "integrity": "sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.2.tgz", + "integrity": "sha512-C3GSKvMtdudHCN5HdmAMSRYR2kkhgdOfye4w0xzyii7lebVr4riCgmM6lRiSCnJn2w1Xz7ZZzHKuLrjx5620kw==", "cpu": [ "riscv64" ], @@ -897,10 +778,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.13.2.tgz", + "integrity": "sha512-l4U0KDFwzD36j7HdfJ5/TveEQ1fUTjFFQP5qIt9gBqBgu1G8/kCaq5Ok05kd5TG9F8Lltf3MoYsUMw3rNlJ0Yg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.0.tgz", - "integrity": "sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.2.tgz", + "integrity": "sha512-xXMLUAMzrtsvh3cZ448vbXqlUa7ZL8z0MwHp63K2IIID2+DeP5iWIT6g1SN7hg1VxPzqx0xZdiDM9l4n9LRU1A==", "cpu": [ "x64" ], @@ -911,9 +805,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.0.tgz", - "integrity": "sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.2.tgz", + "integrity": "sha512-M/JYAWickafUijWPai4ehrjzVPKRCyDb1SLuO+ZyPfoXgeCEAlgPkNXewFZx0zcnoIe3ay4UjXIMdXQXOZXWqA==", "cpu": [ "x64" ], @@ -924,9 +818,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.0.tgz", - "integrity": "sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.2.tgz", + "integrity": "sha512-2YWwoVg9KRkIKaXSh0mz3NmfurpmYoBBTAXA9qt7VXk0Xy12PoOP40EFuau+ajgALbbhi4uTj3tSG3tVseCjuA==", "cpu": [ "arm64" ], @@ -937,9 +831,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.0.tgz", - "integrity": "sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.2.tgz", + "integrity": "sha512-2FSsE9aQ6OWD20E498NYKEQLneShWes0NGMPQwxWOdws35qQXH+FplabOSP5zEe1pVjurSDOGEVCE2agFwSEsw==", "cpu": [ "ia32" ], @@ -950,9 +844,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.0.tgz", - "integrity": "sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.2.tgz", + "integrity": "sha512-7h7J2nokcdPePdKykd8wtc8QqqkqxIrUz7MHj6aNr8waBRU//NLDVnNjQnqQO6fqtjrtCdftpbTuOKAyrAQETQ==", "cpu": [ "x64" ], @@ -975,15 +869,15 @@ "dev": true }, "node_modules/@types/json-schema": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", - "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/minimist": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", "dev": true }, "node_modules/@types/node": { @@ -996,15 +890,15 @@ } }, "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "dev": true }, "node_modules/@types/semver": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.1.tgz", - "integrity": "sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg==", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, "node_modules/@types/wicg-file-system-access": { @@ -1304,9 +1198,9 @@ } }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1467,14 +1361,6 @@ "node": ">=8" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "optional": true, - "peer": true - }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -1553,18 +1439,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/chalk/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", @@ -1622,14 +1496,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "optional": true, - "peer": true - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2036,67 +1902,6 @@ "node": ">=4.0" } }, - "node_modules/eslint/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -2233,9 +2038,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -2273,9 +2078,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -2330,36 +2135,39 @@ } }, "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { - "locate-path": "^5.0.0", + "locate-path": "^6.0.0", "path-exists": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/flat-cache": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", - "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "dependencies": { - "flatted": "^3.2.7", + "flatted": "^3.2.9", "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { - "node": ">=12.0.0" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true }, "node_modules/fork-awesome": { @@ -2534,18 +2342,6 @@ "node": ">=6" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2555,6 +2351,18 @@ "node": ">=8" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -2589,9 +2397,9 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "engines": { "node": ">= 4" @@ -2678,12 +2486,12 @@ "dev": true }, "node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2819,15 +2627,15 @@ } }, "node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", "dev": true }, "node_modules/keyv": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "dependencies": { "json-buffer": "3.0.1" @@ -2878,15 +2686,18 @@ } }, "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "p-locate": "^4.1.0" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash": { @@ -3075,15 +2886,15 @@ } }, "node_modules/mlly": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", - "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", + "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", "dev": true, "dependencies": { - "acorn": "^8.10.0", - "pathe": "^1.1.1", + "acorn": "^8.11.3", + "pathe": "^1.1.2", "pkg-types": "^1.0.3", - "ufo": "^1.3.0" + "ufo": "^1.3.2" } }, "node_modules/ms": { @@ -3215,30 +3026,33 @@ } }, "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { - "p-limit": "^2.2.0" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-try": { @@ -3323,9 +3137,9 @@ } }, "node_modules/pathe": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", - "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", "dev": true }, "node_modules/pathval": { @@ -3532,6 +3346,58 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/read-pkg-up/node_modules/type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", @@ -3603,9 +3469,9 @@ } }, "node_modules/resolve": { - "version": "1.22.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", - "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { "is-core-module": "^2.13.0", @@ -3667,9 +3533,9 @@ } }, "node_modules/rollup": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.0.tgz", - "integrity": "sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.2.tgz", + "integrity": "sha512-MIlLgsdMprDBXC+4hsPgzWUasLO9CE4zOkj/u6j+Z6j5A4zRY+CtiXAdJyPtgCsc42g658Aeh1DlrdVEJhsL2g==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -3682,19 +3548,21 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.13.0", - "@rollup/rollup-android-arm64": "4.13.0", - "@rollup/rollup-darwin-arm64": "4.13.0", - "@rollup/rollup-darwin-x64": "4.13.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.13.0", - "@rollup/rollup-linux-arm64-gnu": "4.13.0", - "@rollup/rollup-linux-arm64-musl": "4.13.0", - "@rollup/rollup-linux-riscv64-gnu": "4.13.0", - "@rollup/rollup-linux-x64-gnu": "4.13.0", - "@rollup/rollup-linux-x64-musl": "4.13.0", - "@rollup/rollup-win32-arm64-msvc": "4.13.0", - "@rollup/rollup-win32-ia32-msvc": "4.13.0", - "@rollup/rollup-win32-x64-msvc": "4.13.0", + "@rollup/rollup-android-arm-eabi": "4.13.2", + "@rollup/rollup-android-arm64": "4.13.2", + "@rollup/rollup-darwin-arm64": "4.13.2", + "@rollup/rollup-darwin-x64": "4.13.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.13.2", + "@rollup/rollup-linux-arm64-gnu": "4.13.2", + "@rollup/rollup-linux-arm64-musl": "4.13.2", + "@rollup/rollup-linux-powerpc64le-gnu": "4.13.2", + "@rollup/rollup-linux-riscv64-gnu": "4.13.2", + "@rollup/rollup-linux-s390x-gnu": "4.13.2", + "@rollup/rollup-linux-x64-gnu": "4.13.2", + "@rollup/rollup-linux-x64-musl": "4.13.2", + "@rollup/rollup-win32-arm64-msvc": "4.13.2", + "@rollup/rollup-win32-ia32-msvc": "4.13.2", + "@rollup/rollup-win32-x64-msvc": "4.13.2", "fsevents": "~2.3.2" } }, @@ -3742,12 +3610,6 @@ "npm": ">=2.0.0" } }, - "node_modules/rxjs/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -3755,9 +3617,9 @@ "dev": true }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3823,17 +3685,6 @@ "node": ">=8" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-js": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", @@ -3843,18 +3694,6 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", @@ -3866,9 +3705,9 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", "dev": true }, "node_modules/spdx-expression-parse": { @@ -3882,9 +3721,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.13", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz", - "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", "dev": true }, "node_modules/stackback": { @@ -3959,23 +3798,35 @@ } }, "node_modules/strip-literal": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", - "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", + "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", "dev": true, "dependencies": { - "js-tokens": "^8.0.2" + "js-tokens": "^9.0.0" }, "funding": { "url": "https://github.com/sponsors/antfu" } }, "node_modules/strip-literal/node_modules/js-tokens": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", - "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", "dev": true }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -4004,25 +3855,11 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/terser": { - "version": "5.19.4", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.4.tgz", - "integrity": "sha512-6p1DjHeuluwxDXcuT9VR8p64klWJKo1ILiy19s6C9+0Bh2+NWTX6nD9EPppiER4ICkHDVB1RkVpin/YW2nQn/g==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.8.2", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } + "node_modules/synckit/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/text-table": { "version": "0.2.0", @@ -4042,15 +3879,15 @@ "dev": true }, "node_modules/tinybench": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.1.tgz", - "integrity": "sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", "dev": true }, "node_modules/tinypool": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", - "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.3.tgz", + "integrity": "sha512-Ud7uepAklqRH1bvwy22ynrliC7Dljz7Tm8M/0RBUW+YRa4YHhZ6e4PpgE+fu1zr/WqB1kbeuVrdfeuyIBpy4tw==", "dev": true, "engines": { "node": ">=14.0.0" @@ -4099,9 +3936,9 @@ } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, "node_modules/tsutils": { @@ -4119,12 +3956,6 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -4189,9 +4020,9 @@ } }, "node_modules/typedoc/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -4217,9 +4048,9 @@ } }, "node_modules/ufo": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz", - "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", + "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", "dev": true }, "node_modules/undici-types": { @@ -4458,9 +4289,9 @@ } }, "node_modules/vitest/node_modules/npm-run-path": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", - "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", "dev": true, "dependencies": { "path-key": "^4.0.0" diff --git a/src/AEG-IO.ts b/src/AEG-IO.ts index 25d42cf0..bca608e6 100644 --- a/src/AEG-IO.ts +++ b/src/AEG-IO.ts @@ -9,7 +9,7 @@ import {AtomNode} from "./AEG/AtomNode"; import {CutNode} from "./AEG/CutNode"; import {Ellipse} from "./AEG/Ellipse"; import {Point} from "./AEG/Point"; -import {ProofNode} from "./Proof/ProofNode"; +import {ProofModeMove, ProofModeNode} from "./ProofHistory/ProofModeNode"; /** * Describes The Sheet of Assertion in JSON files. @@ -45,21 +45,21 @@ interface atomObj { */ interface proofNodeObj { tree: sheetObj; - appliedRule: string; + appliedRule: ProofModeMove; } /** * Creates and saves a file to the incoming FileSystemFileHandle * and containing the incoming save data. * - * The save data will either be an AEGTree from Draw Mode or a series of ProofNodes from Proof Mode. + * The save data will either be an AEGTree from Draw Mode or a series of ProofModeNodes from Proof Mode. * * @param handle Incoming FileSystemFileHandle. * @param aegData Incoming save data. */ export async function saveFile( handle: FileSystemFileHandle, - saveData: AEGTree | ProofNode[] + saveData: AEGTree | ProofModeNode[] ): Promise { const data: string = JSON.stringify(saveData, null, "\t"); @@ -74,9 +74,9 @@ export async function saveFile( * * @param mode Incoming mode string. * @param fileData Incoming data read from a file. - * @returns AEGTree representation of fileData if in Draw Mode. Otherwise, a series of ProofNodes. + * @returns AEGTree representation of fileData if in Draw Mode. Otherwise, a series of ProofModeNodes. */ -export function loadFile(mode: "Draw" | "Proof", fileData: string): AEGTree | ProofNode[] { +export function loadFile(mode: "Draw" | "Proof", fileData: string): AEGTree | ProofModeNode[] { const data = JSON.parse(fileData); if (mode === "Draw") { @@ -84,12 +84,12 @@ export function loadFile(mode: "Draw" | "Proof", fileData: string): AEGTree | Pr return toTree(childData); } else { //Construct the tree at every step of the proof and store them in an array - const arr: ProofNode[] = []; + const arr: ProofModeNode[] = []; let node: proofNodeObj; for (node of data) { const childData: (atomObj | cutObj)[] = node.tree.internalSheet.internalChildren; - arr.push(new ProofNode(toTree(childData), node.appliedRule)); + arr.push(new ProofModeNode(toTree(childData), node.appliedRule)); } return arr; diff --git a/src/DrawHistory/DrawModeNode.ts b/src/DrawHistory/DrawModeNode.ts new file mode 100644 index 00000000..8cc6e5e2 --- /dev/null +++ b/src/DrawHistory/DrawModeNode.ts @@ -0,0 +1,38 @@ +/** + * @file Contains the DrawModeNode class, which defines a step taken in Draw Mode. + * Also contains the DrawModeMove enum. + * + * @author Ryan R + */ + +import {AEGTree} from "../AEG/AEGTree"; + +export enum DrawModeMove { + CLEAR, + DRAW_ATOM, + DRAW_CUT, + MOVE_SINGLE, + MOVE_MULTI, + COPY_SINGLE, + COPY_MULTI, + DELETE_SINGLE, + DELETE_MULTI, + RESIZE, + COPY_GRAPH, +} + +export class DrawModeNode { + public tree: AEGTree; + public appliedMove: DrawModeMove; + + /** + * Sets tree to the incoming AEGTree and appliedMove to the incoming DrawModeMove. + * + * @param tree Incoming AEGTree. Defaults to a default AEGTree construction. + * @param appliedMove Incoming DrawModeMove. Defaults to CLEAR. + */ + public constructor(tree?: AEGTree, appliedMove?: DrawModeMove) { + this.tree = new AEGTree(tree?.sheet) ?? new AEGTree(); + this.appliedMove = appliedMove ?? DrawModeMove.CLEAR; + } +} diff --git a/src/DrawTools/AtomTool.ts b/src/DrawTools/AtomTool.ts index cfdfdeda..85fb74b8 100644 --- a/src/DrawTools/AtomTool.ts +++ b/src/DrawTools/AtomTool.ts @@ -12,6 +12,7 @@ import {AtomNode} from "../AEG/AtomNode"; import {changeCursorStyle} from "../SharedToolUtils/DrawUtils"; import {drawAtom} from "../SharedToolUtils/DrawUtils"; +import {DrawModeMove} from "../DrawHistory/DrawModeNode"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; @@ -100,6 +101,7 @@ export function atomMouseUp(event: MouseEvent): void { ); if (TreeContext.tree.canInsert(currentAtom) && !wasOut) { TreeContext.tree.insert(currentAtom); + TreeContext.pushToDrawStack(DrawModeMove.DRAW_ATOM); } redrawTree(TreeContext.tree); hasMouseDown = false; @@ -117,11 +119,13 @@ export function atomMouseOut(): void { /** * Constructs a new AtomNode at the incoming Point. - * This AtomNode is created with the incoming string as an identifier and a width and height retrieved from the font's text metrics. + * This AtomNode is created with the incoming string as an identifier and a width + * and height retrieved from the font's text metrics. * * @param identifier Incoming string. * @param origin Incoming Point. - * @returns AtomNode at origin with identifier as its letter and appropriate width and height depending on font. + * @returns AtomNode at origin with identifier as its letter and appropriate width + * and height depending on font. */ function createAtom(identifier: string, origin: Point): AtomNode { atomDisplay.innerHTML = identifier; @@ -137,7 +141,7 @@ function createAtom(identifier: string, origin: Point): AtomNode { /** * Draws currentAtom as legalColor or illegalColor. * legalColor is chosen if currentAtom's position is valid. - * IllegalColor is chose if currentAtom's position is not valid. + * IllegalColor is chosen if currentAtom's position is not valid. */ function determineDrawColor(): void { redrawTree(TreeContext.tree); diff --git a/src/DrawTools/CopyFromDraw.ts b/src/DrawTools/CopyFromDraw.ts index 85da0cee..e7894a03 100644 --- a/src/DrawTools/CopyFromDraw.ts +++ b/src/DrawTools/CopyFromDraw.ts @@ -10,6 +10,7 @@ import {AtomNode} from "../AEG/AtomNode"; import {changeCursorStyle} from "../SharedToolUtils/DrawUtils"; import {cleanCanvas, highlightNode, redrawTree} from "../SharedToolUtils/DrawUtils"; import {CutNode} from "../AEG/CutNode"; +import {DrawModeMove} from "../DrawHistory/DrawModeNode"; import {legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; @@ -85,6 +86,8 @@ export function copyFromDrawMouseUp(): void { } redrawTree(TreeContext.tree); + + TreeContext.pushToDrawStack(DrawModeMove.COPY_GRAPH); } selectedNode = null; diff --git a/src/DrawTools/CopyMultiTool.ts b/src/DrawTools/CopyMultiTool.ts index 62fa3784..2e621fc2 100644 --- a/src/DrawTools/CopyMultiTool.ts +++ b/src/DrawTools/CopyMultiTool.ts @@ -13,6 +13,7 @@ import {AtomNode} from "../AEG/AtomNode"; import {changeCursorStyle, determineAndChangeCursorStyle} from "../SharedToolUtils/DrawUtils"; import {CutNode} from "../AEG/CutNode"; import {drawAtom, redrawTree} from "../SharedToolUtils/DrawUtils"; +import {DrawModeMove} from "../DrawHistory/DrawModeNode"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; @@ -101,6 +102,8 @@ export function copyMultiMouseUp(event: MouseEvent): void { TreeContext.tree.insert(tempAtom); } } + + TreeContext.pushToDrawStack(DrawModeMove.COPY_MULTI); } redrawTree(TreeContext.tree); legalNode = false; diff --git a/src/DrawTools/CopySingleTool.ts b/src/DrawTools/CopySingleTool.ts index d2e20160..533dacb2 100644 --- a/src/DrawTools/CopySingleTool.ts +++ b/src/DrawTools/CopySingleTool.ts @@ -13,6 +13,7 @@ import {AtomNode} from "../AEG/AtomNode"; import {changeCursorStyle, determineAndChangeCursorStyle} from "../SharedToolUtils/DrawUtils"; import {CutNode} from "../AEG/CutNode"; import {drawAtom, drawCut, redrawTree} from "../SharedToolUtils/DrawUtils"; +import {DrawModeMove} from "../DrawHistory/DrawModeNode"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; @@ -106,6 +107,8 @@ export function copySingleMouseUp(event: MouseEvent): void { } } redrawTree(TreeContext.tree); + + TreeContext.pushToDrawStack(DrawModeMove.COPY_SINGLE); } legalNode = false; } diff --git a/src/DrawTools/CutTool.ts b/src/DrawTools/CutTool.ts index 59c594a7..2d0e8459 100644 --- a/src/DrawTools/CutTool.ts +++ b/src/DrawTools/CutTool.ts @@ -14,6 +14,7 @@ import {changeCursorStyle, determineAndChangeCursorStyle} from "../SharedToolUti import {createEllipse, ellipseLargeEnough} from "../SharedToolUtils/EditModeUtils"; import {CutNode} from "../AEG/CutNode"; import {drawCut, drawGuidelines, redrawTree} from "../SharedToolUtils/DrawUtils"; +import {DrawModeMove} from "../DrawHistory/DrawModeNode"; import {Ellipse} from "../AEG/Ellipse"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; @@ -91,6 +92,7 @@ export function cutMouseUp(event: MouseEvent): void { ellipseLargeEnough(newCut.ellipse) ) { TreeContext.tree.insert(newCut); + TreeContext.pushToDrawStack(DrawModeMove.DRAW_CUT); } redrawTree(TreeContext.tree); } diff --git a/src/DrawTools/DeleteMultiTool.ts b/src/DrawTools/DeleteMultiTool.ts index c86edcf6..90770151 100644 --- a/src/DrawTools/DeleteMultiTool.ts +++ b/src/DrawTools/DeleteMultiTool.ts @@ -10,6 +10,7 @@ import {AtomNode} from "../AEG/AtomNode"; import {CutNode} from "../AEG/CutNode"; +import {DrawModeMove} from "../DrawHistory/DrawModeNode"; import {highlightNode, redrawTree} from "../SharedToolUtils/DrawUtils"; import {illegalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; @@ -104,6 +105,7 @@ export function deleteMultiMouseUp(event: MouseEvent): void { TreeContext.tree.clear(); } redrawTree(TreeContext.tree); + TreeContext.pushToDrawStack(DrawModeMove.DELETE_MULTI); } currentNode = null; legalNode = false; diff --git a/src/DrawTools/DeleteSingleTool.ts b/src/DrawTools/DeleteSingleTool.ts index 23ce4f08..d4e36f42 100644 --- a/src/DrawTools/DeleteSingleTool.ts +++ b/src/DrawTools/DeleteSingleTool.ts @@ -11,6 +11,7 @@ import {AtomNode} from "../AEG/AtomNode"; import {CutNode} from "../AEG/CutNode"; import {drawAtom, drawCut, redrawTree} from "../SharedToolUtils/DrawUtils"; +import {DrawModeMove} from "../DrawHistory/DrawModeNode"; import {illegalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; @@ -120,6 +121,7 @@ export function deleteSingleMouseUp(event: MouseEvent): void { readdChildren(TreeContext.tree, currentNode); } redrawTree(TreeContext.tree); + TreeContext.pushToDrawStack(DrawModeMove.DELETE_SINGLE); } currentNode = null; diff --git a/src/DrawTools/DrawClearTool.ts b/src/DrawTools/DrawClearTool.ts index de225d46..32f1cd32 100644 --- a/src/DrawTools/DrawClearTool.ts +++ b/src/DrawTools/DrawClearTool.ts @@ -6,6 +6,7 @@ import {AEGTree} from "../AEG/AEGTree"; import {cleanCanvas, highlightNode, redrawTree} from "../SharedToolUtils/DrawUtils"; +import {DrawModeMove} from "../DrawHistory/DrawModeNode"; import {illegalColor} from "../Themes"; import {TreeContext} from "../TreeContext"; @@ -28,6 +29,7 @@ export function drawClearMouseUp(): void { if (legalNode) { TreeContext.tree = new AEGTree(); redrawTree(TreeContext.tree); + TreeContext.pushToDrawStack(DrawModeMove.CLEAR); } } diff --git a/src/DrawTools/DrawMoveMultiTool.ts b/src/DrawTools/DrawMoveMultiTool.ts index e487d492..2eb48e6d 100644 --- a/src/DrawTools/DrawMoveMultiTool.ts +++ b/src/DrawTools/DrawMoveMultiTool.ts @@ -13,6 +13,7 @@ import {AtomNode} from "../AEG/AtomNode"; import {changeCursorStyle, determineAndChangeCursorStyle} from "../SharedToolUtils/DrawUtils"; import {CutNode} from "../AEG/CutNode"; import {drawAtom, highlightNode, redrawTree} from "../SharedToolUtils/DrawUtils"; +import {DrawModeMove} from "../DrawHistory/DrawModeNode"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; @@ -117,6 +118,7 @@ export function drawMoveMultiMouseUp(event: MouseEvent): void { TreeContext.tree.insert(currentNode); } } + TreeContext.pushToDrawStack(DrawModeMove.MOVE_MULTI); } redrawTree(TreeContext.tree); legalNode = false; diff --git a/src/DrawTools/DrawMoveSingleTool.ts b/src/DrawTools/DrawMoveSingleTool.ts index 6459e827..3b998f99 100644 --- a/src/DrawTools/DrawMoveSingleTool.ts +++ b/src/DrawTools/DrawMoveSingleTool.ts @@ -13,6 +13,7 @@ import {AtomNode} from "../AEG/AtomNode"; import {changeCursorStyle, determineAndChangeCursorStyle} from "../SharedToolUtils/DrawUtils"; import {CutNode} from "../AEG/CutNode"; import {drawAtom, drawCut, redrawTree} from "../SharedToolUtils/DrawUtils"; +import {DrawModeMove} from "../DrawHistory/DrawModeNode"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; @@ -124,6 +125,7 @@ export function drawMoveSingleMouseUp(event: MouseEvent): void { } } redrawTree(TreeContext.tree); + TreeContext.pushToDrawStack(DrawModeMove.MOVE_SINGLE); } legalNode = false; } diff --git a/src/DrawTools/DrawResizeTool.ts b/src/DrawTools/DrawResizeTool.ts index fa9e728c..1f6dabc5 100644 --- a/src/DrawTools/DrawResizeTool.ts +++ b/src/DrawTools/DrawResizeTool.ts @@ -14,6 +14,7 @@ import {AtomNode} from "../AEG/AtomNode"; import {changeCursorStyle, determineAndChangeCursorStyle} from "../SharedToolUtils/DrawUtils"; import {CutNode} from "../AEG/CutNode"; import {determineDirection, drawCut, redrawTree} from "../SharedToolUtils/DrawUtils"; +import {DrawModeMove} from "../DrawHistory/DrawModeNode"; import {ellipseLargeEnough, resizeCut} from "../SharedToolUtils/EditModeUtils"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; @@ -122,6 +123,7 @@ export function drawResizeMouseUp(event: MouseEvent): void { } redrawTree(TreeContext.tree); legalNode = false; + TreeContext.pushToDrawStack(DrawModeMove.RESIZE); } } diff --git a/src/Proof/ProofHistory.ts b/src/ProofHistory/ProofHistory.ts similarity index 63% rename from src/Proof/ProofHistory.ts rename to src/ProofHistory/ProofHistory.ts index 23ea3774..b18ee945 100644 --- a/src/Proof/ProofHistory.ts +++ b/src/ProofHistory/ProofHistory.ts @@ -5,10 +5,24 @@ * @author Dawn Moore */ -import {ProofNode} from "./ProofNode"; +import {ProofModeMove, ProofModeNode} from "./ProofModeNode"; import {redrawProof} from "../SharedToolUtils/DrawUtils"; import {TreeContext} from "../TreeContext"; +const proofMoveToIconStringDict: {[key in ProofModeMove]: string} = { + [ProofModeMove.CLEAR]: "", + [ProofModeMove.DC_INSERT]: "dot-circle-o", + [ProofModeMove.DC_DELETE]: "times-circle", + [ProofModeMove.MOVE_SINGLE]: "mouse-pointer", + [ProofModeMove.MOVE_MULTI]: "arrows", + [ProofModeMove.ITERATION]: "expand", + [ProofModeMove.DEITERATION]: "compress", + [ProofModeMove.INSERTION]: "plus", + [ProofModeMove.ERASURE]: "trash", + [ProofModeMove.RESIZE]: "arrows-alt", + [ProofModeMove.PASTE_GRAPH]: "files-o", +}; + /** * Creates a button representing the incoming ProofNode as a step in the proof history * and allows the user to return to that step. @@ -16,7 +30,7 @@ import {TreeContext} from "../TreeContext"; * @param newStep Incoming ProofNode. * @param step Index of newStep in the history. */ -export function appendStep(newStep: ProofNode, step?: number): void { +export function appendStep(newStep: ProofModeNode, step?: number): void { const newDiv = document.createElement("div"); newDiv.className = "row"; const stepNumber = step ? step : TreeContext.proof.length; @@ -36,20 +50,10 @@ export function appendStep(newStep: ProofNode, step?: number): void { //Determines which type of step was taken to give the created button a corresponding icon. const icon = document.createElement("Text"); - icon.className = - "fa fa-" + - { - "Single Move": "mouse-pointer", - "Multi Move": "arrows", - Resize: "arrows-alt", - "DC Insert": "dot-circle-o", - "DC Delete": "times-circle", - Insertion: "plus", - Erasure: "trash", - Iteration: "expand", - Deiteration: "compress", - Pasted: "files-o", - }[newStep.appliedRule]; + + const iconString = proofMoveToIconStringDict[newStep.appliedRule]; + + icon.className = "fa fa-" + iconString; button.appendChild(icon); newDiv.appendChild(button); @@ -62,7 +66,7 @@ export function appendStep(newStep: ProofNode, step?: number): void { * * @param selectedStep Incoming ProofNode. */ -export function stepBack(selectedStep: ProofNode): void { +export function stepBack(selectedStep: ProofModeNode): void { TreeContext.currentProofStep = selectedStep; redrawProof(); } @@ -77,3 +81,10 @@ export function deleteButtons(stopIndex: number): void { document.getElementById("Row: " + i)?.remove(); } } + +/** + * Removes the most recent move's button from the proof bar. + */ +export function deleteMostRecentButton(): void { + document.getElementById("Row: " + (TreeContext.proof.length + 1))?.remove(); +} diff --git a/src/Proof/ProofNode.ts b/src/ProofHistory/ProofModeNode.ts similarity index 72% rename from src/Proof/ProofNode.ts rename to src/ProofHistory/ProofModeNode.ts index e51a81e0..e88810b3 100644 --- a/src/Proof/ProofNode.ts +++ b/src/ProofHistory/ProofModeNode.ts @@ -7,10 +7,24 @@ import {AEGTree} from "../AEG/AEGTree"; import {TreeContext} from "../TreeContext"; +export enum ProofModeMove { + CLEAR, + DC_INSERT, + DC_DELETE, + MOVE_SINGLE, + MOVE_MULTI, + ITERATION, + DEITERATION, + INSERTION, + ERASURE, + RESIZE, + PASTE_GRAPH, +} + /** * Defines a single step in a proof. */ -export class ProofNode { +export class ProofModeNode { /** * The AEGTree at this proof step. */ @@ -18,9 +32,8 @@ export class ProofNode { /** * Inference rule applied in this ProofNode. - * @todo Make this an enum. -James */ - public appliedRule: string; + public appliedRule: ProofModeMove; /** * Index of this ProofNode in treeContext.ts' proof array. @@ -36,8 +49,8 @@ export class ProofNode { * @param rule Inference rule applied. * If not passed in, appliedRule will be set as an empty string. */ - public constructor(tree?: AEGTree, rule?: string) { - this.appliedRule = rule ?? ""; + public constructor(tree?: AEGTree, rule?: ProofModeMove) { + this.appliedRule = rule ?? ProofModeMove.CLEAR; this.tree = new AEGTree(tree?.sheet); this.index = TreeContext.proof.length; } diff --git a/src/ProofTools/DeiterationTool.ts b/src/ProofTools/DeiterationTool.ts index f732f1b1..c1d2afcd 100644 --- a/src/ProofTools/DeiterationTool.ts +++ b/src/ProofTools/DeiterationTool.ts @@ -13,7 +13,7 @@ import {highlightNode, redrawProof, redrawTree} from "../SharedToolUtils/DrawUti import {illegalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; -import {ProofNode} from "../Proof/ProofNode"; +import {ProofModeMove, ProofModeNode} from "../ProofHistory/ProofModeNode"; import {reInsertNode} from "../SharedToolUtils/EditModeUtils"; import {TreeContext} from "../TreeContext"; @@ -81,7 +81,7 @@ export function deiterationMouseUp(event: MouseEvent): void { if (currentParent instanceof CutNode) { currentParent.remove(currentPoint); } - TreeContext.pushToProof(new ProofNode(currentProofTree, "Deiteration")); + TreeContext.pushToProof(new ProofModeNode(currentProofTree, ProofModeMove.DEITERATION)); } } legalNode = false; diff --git a/src/ProofTools/DoubleCutDeletionTool.ts b/src/ProofTools/DoubleCutDeletionTool.ts index c0721d2a..0fdf3466 100644 --- a/src/ProofTools/DoubleCutDeletionTool.ts +++ b/src/ProofTools/DoubleCutDeletionTool.ts @@ -13,7 +13,7 @@ import {getCurrentProofTree} from "./ProofToolUtils"; import {illegalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; -import {ProofNode} from "../Proof/ProofNode"; +import {ProofModeMove, ProofModeNode} from "../ProofHistory/ProofModeNode"; import {readdChildren, reInsertNode} from "../SharedToolUtils/EditModeUtils"; import {TreeContext} from "../TreeContext"; @@ -75,7 +75,7 @@ export function doubleCutDeletionMouseMove(event: MouseEvent): void { * @param event Incoming MouseEvent. */ export function doubleCutDeletionMouseUp(event: MouseEvent): void { - const nextProof = new ProofNode(currentProofTree, "DC Delete"); + const nextProof = new ProofModeNode(currentProofTree, ProofModeMove.DC_DELETE); currentPoint = new Point(event.x - offset.x, event.y - offset.y); if (legalNode && currentNode instanceof CutNode) { diff --git a/src/ProofTools/DoubleCutInsertionTool.ts b/src/ProofTools/DoubleCutInsertionTool.ts index 0a34f054..a3372529 100644 --- a/src/ProofTools/DoubleCutInsertionTool.ts +++ b/src/ProofTools/DoubleCutInsertionTool.ts @@ -21,7 +21,7 @@ import {getCurrentProofTree} from "./ProofToolUtils"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; -import {ProofNode} from "../Proof/ProofNode"; +import {ProofModeMove, ProofModeNode} from "../ProofHistory/ProofModeNode"; import {TreeContext} from "../TreeContext"; //Checkbox next to "Show Guidelines:" in Proof Mode's Double Cut Insertion tool. @@ -102,7 +102,7 @@ export function doubleCutInsertionMouseUp(event: MouseEvent): void { const largeCut: CutNode = new CutNode(createEllipse(startingPoint, currentPoint)); const smallCut: CutNode = new CutNode(calcSmallEllipse(largeCut.ellipse)); - const nextProof = new ProofNode(currentProofTree, "DC Insert"); + const nextProof = new ProofModeNode(currentProofTree, ProofModeMove.DC_INSERT); if (!wasOut && selectAndHighlightHandler(largeCut, smallCut)) { nextProof.tree.insert(largeCut); diff --git a/src/ProofTools/ErasureTool.ts b/src/ProofTools/ErasureTool.ts index e4232510..8b62344d 100644 --- a/src/ProofTools/ErasureTool.ts +++ b/src/ProofTools/ErasureTool.ts @@ -14,7 +14,7 @@ import {highlightNode, redrawProof, redrawTree} from "../SharedToolUtils/DrawUti import {illegalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; -import {ProofNode} from "../Proof/ProofNode"; +import {ProofModeMove, ProofModeNode} from "../ProofHistory/ProofModeNode"; import {reInsertNode} from "../SharedToolUtils/EditModeUtils"; import {TreeContext} from "../TreeContext"; @@ -75,7 +75,7 @@ export function erasureMouseMove(event: MouseEvent): void { */ export function erasureMouseUp(event: MouseEvent): void { if (legalNode) { - const nextProof = new ProofNode(currentProofTree, "Erasure"); + const nextProof = new ProofModeNode(currentProofTree, ProofModeMove.ERASURE); currentPoint = new Point(event.x - offset.x, event.y - offset.y); const currentParent = nextProof.tree.getLowestParent(currentPoint); diff --git a/src/ProofTools/InsertionTool.ts b/src/ProofTools/InsertionTool.ts index b13f6731..e0d5884c 100644 --- a/src/ProofTools/InsertionTool.ts +++ b/src/ProofTools/InsertionTool.ts @@ -18,7 +18,7 @@ import {getCurrentProofTree} from "./ProofToolUtils"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; -import {ProofNode} from "../Proof/ProofNode"; +import {ProofModeMove, ProofModeNode} from "../ProofHistory/ProofModeNode"; import {TreeContext} from "../TreeContext"; //Node in question. @@ -244,7 +244,7 @@ export function insertionMouseUp(event: MouseEvent): void { ) as AtomNode; currentTree.insert(tempAtom); } - TreeContext.pushToProof(new ProofNode(currentTree, "Insertion")); + TreeContext.pushToProof(new ProofModeNode(currentTree, ProofModeMove.INSERTION)); } } redrawProof(); diff --git a/src/ProofTools/IterationTool.ts b/src/ProofTools/IterationTool.ts index e06bd6bf..fc377b75 100644 --- a/src/ProofTools/IterationTool.ts +++ b/src/ProofTools/IterationTool.ts @@ -23,7 +23,7 @@ import {getCurrentProofTree} from "./ProofToolUtils"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; -import {ProofNode} from "../Proof/ProofNode"; +import {ProofModeMove, ProofModeNode} from "../ProofHistory/ProofModeNode"; import {TreeContext} from "../TreeContext"; //First Point the user clicks. @@ -111,7 +111,7 @@ export function iterationMouseUp(event: MouseEvent): void { const tempAtom: AtomNode = EditModeUtils.alterAtom(currentNode, moveDifference); currentProofTree.insert(tempAtom); } - TreeContext.pushToProof(new ProofNode(currentProofTree, "Iteration")); + TreeContext.pushToProof(new ProofModeNode(currentProofTree, ProofModeMove.ITERATION)); } } redrawProof(); diff --git a/src/ProofTools/PasteInProof.ts b/src/ProofTools/PasteInProof.ts index c89dd101..c997032c 100644 --- a/src/ProofTools/PasteInProof.ts +++ b/src/ProofTools/PasteInProof.ts @@ -8,7 +8,7 @@ import {AEGTree} from "../AEG/AEGTree"; import {changeCursorStyle, redrawProof} from "../SharedToolUtils/DrawUtils"; import {CutNode} from "../AEG/CutNode"; import {getCurrentProofTree} from "./ProofToolUtils"; -import {ProofNode} from "../Proof/ProofNode"; +import {ProofModeMove, ProofModeNode} from "../ProofHistory/ProofModeNode"; import {TreeContext} from "../TreeContext"; //AEG in question. @@ -53,7 +53,7 @@ export function pasteInProofMouseUp(): void { if (legalNode) { changeCursorStyle("cursor: default"); currentTree.sheet = currentGraph; - TreeContext.pushToProof(new ProofNode(currentTree, "Pasted")); + TreeContext.pushToProof(new ProofModeNode(currentTree, ProofModeMove.PASTE_GRAPH)); } legalNode = false; redrawProof(); diff --git a/src/ProofTools/ProofClearTool.ts b/src/ProofTools/ProofClearTool.ts index a3aae742..155f32e7 100644 --- a/src/ProofTools/ProofClearTool.ts +++ b/src/ProofTools/ProofClearTool.ts @@ -6,7 +6,7 @@ import {AEGTree} from "../AEG/AEGTree"; import {cleanCanvas, highlightNode, redrawProof} from "../SharedToolUtils/DrawUtils"; -import {deleteButtons} from "../Proof/ProofHistory"; +import {deleteButtons} from "../ProofHistory/ProofHistory"; import {getCurrentProofTree} from "./ProofToolUtils"; import {illegalColor} from "../Themes"; import {TreeContext} from "../TreeContext"; diff --git a/src/ProofTools/ProofMoveMultiTool.ts b/src/ProofTools/ProofMoveMultiTool.ts index 437243e6..c54ffdc5 100644 --- a/src/ProofTools/ProofMoveMultiTool.ts +++ b/src/ProofTools/ProofMoveMultiTool.ts @@ -22,7 +22,7 @@ import {getCurrentProofTree, isMoveLegal} from "./ProofToolUtils"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; -import {ProofNode} from "../Proof/ProofNode"; +import {ProofModeMove, ProofModeNode} from "../ProofHistory/ProofModeNode"; import {TreeContext} from "../TreeContext"; //First Point the user clicks. @@ -111,7 +111,7 @@ export function proofMoveMultiMouseMove(event: MouseEvent): void { export function proofMoveMultiMouseUp(event: MouseEvent): void { if (legalNode) { changeCursorStyle("cursor: default"); - const nextStep = new ProofNode(currentProofTree, "Multi Move"); + const nextStep = new ProofModeNode(currentProofTree, ProofModeMove.MOVE_MULTI); const moveDifference: Point = new Point( event.x - startingPoint.x, event.y - startingPoint.y diff --git a/src/ProofTools/ProofMoveSingleTool.ts b/src/ProofTools/ProofMoveSingleTool.ts index 84fbc8da..dd9f5835 100644 --- a/src/ProofTools/ProofMoveSingleTool.ts +++ b/src/ProofTools/ProofMoveSingleTool.ts @@ -28,7 +28,7 @@ import {getCurrentProofTree, isMoveLegal} from "./ProofToolUtils"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; -import {ProofNode} from "../Proof/ProofNode"; +import {ProofModeMove, ProofModeNode} from "../ProofHistory/ProofModeNode"; import {TreeContext} from "../TreeContext"; //First Point the user clicks. @@ -120,7 +120,7 @@ export function proofMoveSingleMouseMove(event: MouseEvent): void { export function proofMoveSingleMouseUp(event: MouseEvent): void { if (legalNode) { changeCursorStyle("cursor: default"); - const nextStep = new ProofNode(currentProofTree, "Single Move"); + const nextStep = new ProofModeNode(currentProofTree, ProofModeMove.MOVE_SINGLE); const moveDifference: Point = new Point( event.x - startingPoint.x, event.y - startingPoint.y diff --git a/src/ProofTools/ProofResizeTool.ts b/src/ProofTools/ProofResizeTool.ts index 1ebe2e6f..67297c3a 100644 --- a/src/ProofTools/ProofResizeTool.ts +++ b/src/ProofTools/ProofResizeTool.ts @@ -27,7 +27,7 @@ import {getCurrentProofTree, proofCanInsert} from "./ProofToolUtils"; import {illegalColor, legalColor} from "../Themes"; import {offset} from "../SharedToolUtils/DragTool"; import {Point} from "../AEG/Point"; -import {ProofNode} from "../Proof/ProofNode"; +import {ProofModeMove, ProofModeNode} from "../ProofHistory/ProofModeNode"; import {TreeContext} from "../TreeContext"; //First Point the user clicks. @@ -122,7 +122,9 @@ export function proofResizeMouseUp(event: MouseEvent): void { if (tempCut.ellipse !== null) { if (isValid(tempCut)) { currentProofTree.insert(tempCut); - TreeContext.pushToProof(new ProofNode(currentProofTree, "Resize")); + TreeContext.pushToProof( + new ProofModeNode(currentProofTree, ProofModeMove.RESIZE) + ); } } } diff --git a/src/ToggleModes.ts b/src/ToggleModes.ts index 992764e9..27eed041 100644 --- a/src/ToggleModes.ts +++ b/src/ToggleModes.ts @@ -7,7 +7,7 @@ import {AEGTree} from "./AEG/AEGTree"; import {loadFile} from "./AEG-IO"; -import {ProofNode} from "./Proof/ProofNode"; +import {ProofModeNode} from "./ProofHistory/ProofModeNode"; import {proofString, treeString} from "./index"; import {redrawProof, redrawTree} from "./SharedToolUtils/DrawUtils"; import {Tool, TreeContext} from "./TreeContext"; @@ -75,13 +75,13 @@ export function toggleHandler(): void { drawCachedTool = TreeContext.toolState; if (TreeContext.proof.length === 0) { - TreeContext.pushToProof(new ProofNode()); + TreeContext.pushToProof(new ProofModeNode()); } //Load our proof structure and tool state. - let loadedProof: ProofNode[] | null = null; + let loadedProof: ProofModeNode[] | null = null; if (proofCachedAEG !== null) { - loadedProof = loadFile(TreeContext.modeState, proofCachedAEG) as ProofNode[] | null; + loadedProof = loadFile(TreeContext.modeState, proofCachedAEG) as ProofModeNode[] | null; } if (loadedProof !== null) { TreeContext.proof = loadedProof; diff --git a/src/TreeContext.ts b/src/TreeContext.ts index 0229a6fc..fb2a9d7b 100644 --- a/src/TreeContext.ts +++ b/src/TreeContext.ts @@ -5,8 +5,15 @@ */ import {AEGTree} from "./AEG/AEGTree"; -import {appendStep, deleteButtons} from "./Proof/ProofHistory"; -import {ProofNode} from "./Proof/ProofNode"; +import { + appendStep, + deleteButtons, + deleteMostRecentButton, + stepBack, +} from "./ProofHistory/ProofHistory"; +import {DrawModeMove, DrawModeNode} from "./DrawHistory/DrawModeNode"; +import {ProofModeMove, ProofModeNode} from "./ProofHistory/ProofModeNode"; +import {redrawProof, redrawTree} from "./SharedToolUtils/DrawUtils"; /** * Represents the current tool in use. @@ -42,11 +49,26 @@ export class TreeContext { //Current AEGTree on canvas. public static tree: AEGTree = new AEGTree(); + //For undoing changes in Draw Mode. + public static drawHistoryUndoStack: DrawModeNode[] = []; + + //For redoing changes in Draw Mode. + public static drawHistoryRedoStack: DrawModeNode[] = []; + + //Determines when to clear drawHistoryRedoStack. + private static recentlyUndoneOrRedoneDrawMove = false; + //The proof is a series of ProofNodes. - public static proof: ProofNode[] = []; + public static proof: ProofModeNode[] = []; + + //For redoing changes in Proof Mode. + public static proofHistoryRedoStack: ProofModeNode[] = []; + + //Determines when to clear proofHistoryRedoStack. + private static recentlyUndoneOrRedoneProofMove = false; //Current step in the proof. - public static currentProofStep: ProofNode | undefined; + public static currentProofStep: ProofModeNode | undefined; //Node selected with Draw Mode's "Select for copy to Proof Mode" button. public static selectForProof: AEGTree = new AEGTree(); @@ -57,14 +79,132 @@ export class TreeContext { //Mode the application is in. Defaults to Draw. public static modeState: "Draw" | "Proof" = "Draw"; + /** + * Adds the incoming DrawModeMove and the current tree to drawHistory. + * + * @param newlyAppliedStep Incoming DrawModeMove. + */ + public static pushToDrawStack(newlyAppliedStep: DrawModeMove): void { + if (this.recentlyUndoneOrRedoneDrawMove) { + this.drawHistoryRedoStack = []; + this.recentlyUndoneOrRedoneDrawMove = false; + } + this.drawHistoryUndoStack.push(new DrawModeNode(this.tree, newlyAppliedStep)); + } + + /** + * Pops the most recent Draw Mode move from drawHistoryUndoStack and changes tree accordingly. + */ + public static undoDrawStep(): void { + const mostRecentStep: DrawModeNode | undefined = this.drawHistoryUndoStack.pop(); + + if (mostRecentStep === undefined) { + return; + } else if (this.drawHistoryUndoStack[this.drawHistoryUndoStack.length - 1] === undefined) { + this.tree = new AEGTree(); + redrawTree(this.tree); + this.drawHistoryRedoStack.push(mostRecentStep); + return; + } + + this.drawHistoryRedoStack.push(mostRecentStep); + + this.tree = new AEGTree( + this.drawHistoryUndoStack[this.drawHistoryUndoStack.length - 1].tree.sheet + ); + + redrawTree(this.tree); + + this.recentlyUndoneOrRedoneDrawMove = true; + } + + /** + * Pops the most recent Draw Mode move from drawHistoryRedoStack and changes tree accordingly. + */ + public static redoDrawStep(): void { + const mostRecentStep: DrawModeNode | undefined = this.drawHistoryRedoStack.pop(); + + if (mostRecentStep === undefined) { + return; + } else if (this.drawHistoryRedoStack[this.drawHistoryRedoStack.length - 1] === undefined) { + this.tree = new AEGTree(mostRecentStep.tree.sheet); + redrawTree(this.tree); + this.drawHistoryUndoStack.push(mostRecentStep); + return; + } + + this.drawHistoryUndoStack.push(mostRecentStep); + + this.tree = new AEGTree(mostRecentStep.tree.sheet); + + redrawTree(this.tree); + + this.recentlyUndoneOrRedoneDrawMove = true; + } + + /** + * Undoes the most recent Proof Mode move and deletes that button. + */ + public static undoProofStep(): void { + if (this.proof.length <= 1) { + return; + } + + const mostRecentStep: ProofModeNode | undefined = this.proof.pop(); + + if (mostRecentStep === undefined) { + return; + } else if (this.proof.length === 0) { + deleteMostRecentButton(); + return; + } + + deleteMostRecentButton(); + + this.proofHistoryRedoStack.push(mostRecentStep); + + stepBack(this.proof[this.proof.length - 1]); + redrawProof(); + + this.recentlyUndoneOrRedoneProofMove = true; + } + + /** + * Pops the most recent Proof Mode move from proofHistoryRedoStack and updates proof bar. + */ + public static redoProofStep(): void { + if (this.proofHistoryRedoStack.length === 0) { + return; + } + + const mostRecentStep: ProofModeNode | undefined = this.proofHistoryRedoStack.pop(); + + if (mostRecentStep === undefined) { + return; + } else if ( + this.proofHistoryRedoStack[this.proofHistoryRedoStack.length - 1] === undefined + ) { + this.pushToProof(mostRecentStep); + redrawProof(); + return; + } + + this.recentlyUndoneOrRedoneProofMove = false; + + this.pushToProof(mostRecentStep); + + stepBack(mostRecentStep); + redrawProof(); + } + /** * Returns the most recent step in the proof. * * @returns Most recent step in the proof. */ - public static getLastProofStep(): ProofNode { + public static getLastProofStep(): ProofModeNode { if (TreeContext.proof.length === 0) { - return new ProofNode(new AEGTree()); + return new ProofModeNode(new AEGTree()); } return TreeContext.proof[TreeContext.proof.length - 1]; @@ -77,8 +217,13 @@ export class TreeContext { * * @param newStep Incoming ProofNode. */ - public static pushToProof(newStep: ProofNode): void { - if (newStep.appliedRule === "Pasted") { + public static pushToProof(newStep: ProofModeNode): void { + if (this.recentlyUndoneOrRedoneProofMove) { + this.proofHistoryRedoStack = []; + this.recentlyUndoneOrRedoneProofMove = false; + } + + if (newStep.appliedRule === ProofModeMove.PASTE_GRAPH) { this.proof.pop(); document.getElementById("Row: 1")?.remove(); newStep.index = 0; @@ -108,7 +253,7 @@ export class TreeContext { public static clearProof(): void { deleteButtons(-1); this.proof = []; - this.pushToProof(new ProofNode()); + this.pushToProof(new ProofModeNode()); this.currentProofStep = this.proof[0]; } } diff --git a/src/index.ts b/src/index.ts index 591d1ae8..e10ac301 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,9 +8,9 @@ */ import {AEGTree} from "./AEG/AEGTree"; -import {appendStep} from "./Proof/ProofHistory"; +import {appendStep} from "./ProofHistory/ProofHistory"; import {loadFile, saveFile} from "./AEG-IO"; -import {ProofNode} from "./Proof/ProofNode"; +import {ProofModeNode} from "./ProofHistory/ProofModeNode"; import {redrawProof, redrawTree} from "./SharedToolUtils/DrawUtils"; import {toggleHandler} from "./ToggleModes"; import {Tool, TreeContext} from "./TreeContext"; @@ -60,11 +60,11 @@ export const proofString = document.getElementById("proofS const selectionDisplay = document.getElementById("toProofTools"); window.addEventListener("keydown", keyDownHandler); +canvas.addEventListener("mouseenter", mouseEnterHandler); canvas.addEventListener("mousedown", mouseDownHandler); canvas.addEventListener("mousemove", mouseMoveHandler); canvas.addEventListener("mouseup", mouseUpHandler); canvas.addEventListener("mouseout", mouseOutHandler); -canvas.addEventListener("mouseenter", mouseEnterHandler); //True if the user's mouse is down. Assumed not to be down at the start. let hasMouseDown = false; @@ -115,7 +115,7 @@ declare global { dragTool: Tool; saveMode: () => void; loadMode: () => void; - aegStringify: (treeData: AEGTree | ProofNode[]) => string; + aegStringify: (treeData: AEGTree | ProofModeNode[]) => string; drawMoveSingleTool: Tool; drawMoveMultiTool: Tool; copySingleTool: Tool; @@ -201,7 +201,7 @@ function setTool(state: Tool): void { * @param treeData Incoming data. * @returns Stringification of treeData. */ -export function aegStringify(treeData: AEGTree | ProofNode[]): string { +export function aegStringify(treeData: AEGTree | ProofModeNode[]): string { return JSON.stringify(treeData, null, "\t"); } @@ -210,7 +210,7 @@ export function aegStringify(treeData: AEGTree | ProofNode[]): string { */ async function saveMode() { let name: string; - let data: AEGTree | ProofNode[]; + let data: AEGTree | ProofModeNode[]; if (TreeContext.modeState === "Draw") { name = "AEG Tree"; @@ -291,7 +291,7 @@ async function loadMode(): Promise { //Clears current proof. TreeContext.clearProof(); //Loads data for the new proof. - TreeContext.proof = loadData as ProofNode[]; + TreeContext.proof = loadData as ProofModeNode[]; //Removes default start step. document.getElementById("Row: 1")?.remove(); //Adds button for each step of the loaded proof to the history bar. @@ -311,18 +311,45 @@ async function loadMode(): Promise { } } +/** + * Handles CTRL+Z undo operations according to whether the program is in Draw or Proof Mode. + */ +async function handleUndo(): Promise { + if (TreeContext.modeState === "Draw") { + TreeContext.undoDrawStep(); + } else { + TreeContext.undoProofStep(); + } +} + +/** + * Handles CTRL+Y redo operations according to whether the program is in Draw or Proof Mode. + */ +async function handleRedo(): Promise { + if (TreeContext.modeState === "Draw") { + TreeContext.redoDrawStep(); + } else { + TreeContext.redoProofStep(); + } +} + //TODO: replace all of this with polymorphism -James /** * Calls appropriate keydown method with the incoming KeyboardEvent. * * @param event Incoming KeyboardEvent. - * */ function keyDownHandler(event: KeyboardEvent): void { - if (event.ctrlKey && event.key === "s") { - event.preventDefault(); //Prevents Chrome from saving a .html of the current webpage. - saveMode(); + if (event.ctrlKey) { + event.preventDefault(); //Prevents Chrome from performing default behavior. + if (event.key === "s") { + saveMode(); + } else if (event.key === "z") { + handleUndo(); + } else if (event.key === "y") { + handleRedo(); + } } else { switch (TreeContext.toolState) { case Tool.atomTool: