diff --git a/package-lock.json b/package-lock.json index 2b7b2bc..702bcac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "@testing-library/user-event": "~14.5.2", "axios": "^1.6.7", "buffer": "^6.0.3", + "canvas": "^2.11.2", "clsx": "^2.1.0", "d3-force": "^3.0.0", "date-fns": "^3.3.1", @@ -62,7 +63,8 @@ "swiper": "^11.0.5", "util": "^0.12.5", "viem": "^2.7.1", - "wagmi": "^2.5.5" + "wagmi": "^2.5.5", + "xmldom": "^0.6.0" }, "devDependencies": { "@types/jest": "~29.5.11", @@ -193,9 +195,15 @@ } }, "node_modules/@aut-labs/d-aut": { +<<<<<<< HEAD + "version": "1.0.156-dev-beta", + "resolved": "https://registry.npmjs.org/@aut-labs/d-aut/-/d-aut-1.0.156-dev-beta.tgz", + "integrity": "sha512-zXsjUXi8o+xpcCOWxMlpR5oSOxDMHhFKEJiU1kuSW5quDRdls0oHTwVOmZ5/Cg9wVpOqcDlIbjhIu7CVUcGo+g==" +======= "version": "1.0.158-dev", "resolved": "https://registry.npmjs.org/@aut-labs/d-aut/-/d-aut-1.0.158-dev.tgz", "integrity": "sha512-WL9LuWdslEjzr5poRAkjuypEZjVYxVOnZ+xMpIfQR+NoYVMeR6vqEOdbUrTDhHkZqoNYvgCkCeoMxDPLfH21PQ==" +>>>>>>> main }, "node_modules/@aut-labs/sdk": { "version": "0.0.160-dev", @@ -3238,6 +3246,33 @@ "react": "16 - 18" } }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "engines": { + "node": ">=8" + } + }, "node_modules/@marker.io/browser": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/@marker.io/browser/-/browser-0.19.0.tgz", @@ -4385,8 +4420,6 @@ }, "node_modules/@parcel/watcher-wasm/node_modules/napi-wasm": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/napi-wasm/-/napi-wasm-1.1.0.tgz", - "integrity": "sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==", "inBundle": true, "license": "MIT" }, @@ -8047,6 +8080,11 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==" }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "node_modules/abitype": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.0.tgz", @@ -8331,6 +8369,24 @@ "node": ">= 8" } }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/arg": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", @@ -9239,6 +9295,20 @@ } ] }, + "node_modules/canvas": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", + "simple-get": "^3.0.3" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/canvas-color-tracker": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/canvas-color-tracker/-/canvas-color-tracker-1.2.1.tgz", @@ -9323,6 +9393,14 @@ "node": ">= 6" } }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "engines": { + "node": ">=10" + } + }, "node_modules/chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", @@ -9690,6 +9768,14 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "bin": { + "color-support": "bin.js" + } + }, "node_modules/colord": { "version": "2.9.3", "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", @@ -9809,6 +9895,11 @@ "node": "^14.18.0 || >=16.10.0" } }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -10667,6 +10758,17 @@ "node": ">=0.10" } }, + "node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", @@ -10778,6 +10880,11 @@ "node": ">=0.4.0" } }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, "node_modules/denque": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", @@ -13222,6 +13329,33 @@ "node": ">=10" } }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs-minipass/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/fs-monkey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz", @@ -13286,6 +13420,26 @@ "node": ">=8" } }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -13636,6 +13790,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, "node_modules/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", @@ -16627,6 +16786,17 @@ "node": ">=6" } }, + "node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -16731,6 +16901,42 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/mipd": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/mipd/-/mipd-0.0.5.tgz", @@ -16926,6 +17132,11 @@ "thenify-all": "^1.0.0" } }, + "node_modules/nan": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.19.0.tgz", + "integrity": "sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -17026,6 +17237,20 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==" }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -17064,6 +17289,18 @@ "node": ">=8" } }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, "node_modules/nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", @@ -20990,6 +21227,35 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -21855,6 +22121,38 @@ "node": ">=6" } }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/temp-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", @@ -23469,6 +23767,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -23808,6 +24114,14 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" }, + "node_modules/xmldom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.6.0.tgz", + "integrity": "sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/xmlhttprequest-ssl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", @@ -24055,9 +24369,15 @@ } }, "@aut-labs/d-aut": { +<<<<<<< HEAD + "version": "1.0.156-dev-beta", + "resolved": "https://registry.npmjs.org/@aut-labs/d-aut/-/d-aut-1.0.156-dev-beta.tgz", + "integrity": "sha512-zXsjUXi8o+xpcCOWxMlpR5oSOxDMHhFKEJiU1kuSW5quDRdls0oHTwVOmZ5/Cg9wVpOqcDlIbjhIu7CVUcGo+g==" +======= "version": "1.0.158-dev", "resolved": "https://registry.npmjs.org/@aut-labs/d-aut/-/d-aut-1.0.158-dev.tgz", "integrity": "sha512-WL9LuWdslEjzr5poRAkjuypEZjVYxVOnZ+xMpIfQR+NoYVMeR6vqEOdbUrTDhHkZqoNYvgCkCeoMxDPLfH21PQ==" +>>>>>>> main }, "@aut-labs/sdk": { "version": "0.0.160-dev", @@ -26169,6 +26489,29 @@ "lottie-web": "^5.10.2" } }, + "@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "requires": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "dependencies": { + "detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==" + } + } + }, "@marker.io/browser": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/@marker.io/browser/-/browser-0.19.0.tgz", @@ -26950,8 +27293,6 @@ "dependencies": { "napi-wasm": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/napi-wasm/-/napi-wasm-1.1.0.tgz", - "integrity": "sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==", "bundled": true } } @@ -29672,6 +30013,11 @@ "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==" }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "abitype": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.0.tgz", @@ -29858,6 +30204,20 @@ "picomatch": "^2.0.4" } }, + "aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + }, + "are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + } + }, "arg": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", @@ -30520,6 +30880,16 @@ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001480.tgz", "integrity": "sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ==" }, + "canvas": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "requires": { + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", + "simple-get": "^3.0.3" + } + }, "canvas-color-tracker": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/canvas-color-tracker/-/canvas-color-tracker-1.2.1.tgz", @@ -30577,6 +30947,11 @@ } } }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" + }, "chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", @@ -30829,6 +31204,11 @@ "simple-swizzle": "^0.2.2" } }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" + }, "colord": { "version": "2.9.3", "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", @@ -30929,6 +31309,11 @@ "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz", "integrity": "sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==" }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + }, "content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -31526,6 +31911,14 @@ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==" }, + "decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "requires": { + "mimic-response": "^2.0.0" + } + }, "dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", @@ -31613,6 +32006,11 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, "denque": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", @@ -33398,6 +33796,29 @@ "universalify": "^2.0.0" } }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } + }, "fs-monkey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz", @@ -33440,6 +33861,22 @@ "resolved": "https://registry.npmjs.org/futoin-hkdf/-/futoin-hkdf-1.5.3.tgz", "integrity": "sha512-SewY5KdMpaoCeh7jachEWFsh1nNlaDjNHZXWqL5IGwtpEYHTgkr2+AMCgNwKWkcc0wpSYrZfR7he4WdmHFtDxQ==" }, + "gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + } + }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -33686,6 +34123,11 @@ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.1.tgz", "integrity": "sha512-6J4rC9ROz0UkOpjn0BRtSSqlewDTDYJNQvy8N8RSrPCduUWId1o9BQPEVII/KKBqRk/ZIQff1YbRkUDCH2N5Sg==" }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, "hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", @@ -35919,6 +36361,11 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, + "mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==" + }, "min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -35992,6 +36439,35 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" }, + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==" + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } + }, "mipd": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/mipd/-/mipd-0.0.5.tgz", @@ -36109,6 +36585,11 @@ "thenify-all": "^1.0.0" } }, + "nan": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.19.0.tgz", + "integrity": "sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==" + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -36189,6 +36670,14 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==" }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "requires": { + "abbrev": "1" + } + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -36212,6 +36701,17 @@ "path-key": "^3.0.0" } }, + "npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "requires": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, "nth-check": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", @@ -38868,6 +39368,21 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" + }, + "simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "requires": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -39525,6 +40040,31 @@ "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==" }, + "tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } + }, "temp-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", @@ -40647,6 +41187,14 @@ "has-tostringtag": "^1.0.1" } }, + "wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "requires": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -40944,6 +41492,11 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" }, + "xmldom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.6.0.tgz", + "integrity": "sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg==" + }, "xmlhttprequest-ssl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", diff --git a/package.json b/package.json index 56699f7..f36a69a 100755 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "@testing-library/user-event": "~14.5.2", "axios": "^1.6.7", "buffer": "^6.0.3", + "canvas": "^2.11.2", "clsx": "^2.1.0", "d3-force": "^3.0.0", "date-fns": "^3.3.1", @@ -90,7 +91,8 @@ "swiper": "^11.0.5", "util": "^0.12.5", "viem": "^2.7.1", - "wagmi": "^2.5.5" + "wagmi": "^2.5.5", + "xmldom": "^0.6.0" }, "devDependencies": { "@types/jest": "~29.5.11", diff --git a/public/index.html b/public/index.html index 635f3d7..c7eabc6 100644 --- a/public/index.html +++ b/public/index.html @@ -1,7 +1,7 @@ - The Nova Hub + The Hub Showcase diff --git a/src/components/Oauth2/oauth2.tsx b/src/components/Oauth2/oauth2.tsx index ab600ed..cf6d439 100644 --- a/src/components/Oauth2/oauth2.tsx +++ b/src/components/Oauth2/oauth2.tsx @@ -27,6 +27,12 @@ const cleanup = (intervalRef, popupRef, handleMessageListener) => { window.removeEventListener("message", handleMessageListener); }; +const xCleanUp = (xIntervalRef) => { + if (xIntervalRef.current) { + clearInterval(xIntervalRef.current); + } +}; + export const useOAuth = () => { const [authenticating, setAuthenticating] = useState(false); const [finsihedFlow, setFinishedFlow] = useState(false); @@ -102,6 +108,7 @@ export const useOAuthSocials = () => { const [finsihedFlow, setFinishedFlow] = useState(false); const popupRef = useRef(); const intervalRef = useRef>(); + const xIntervalRef = useRef>(); const getAuthDiscord = useCallback(async (onSuccess, onFailure) => { setAuthenticating(true); @@ -182,6 +189,7 @@ export const useOAuthSocials = () => { if (error) { onFailure(error); } else { + xCleanUp(xIntervalRef); const response = await axios.post( `${environment.apiUrl}/autID/config/oauth2AccessTokenX`, { @@ -217,9 +225,38 @@ export const useOAuthSocials = () => { } }, 550); + xIntervalRef.current = setInterval(async () => { + const oauthResponse = JSON.parse(localStorage.getItem("OAUTH_RESPONSE")); + if (oauthResponse) { + cleanup(intervalRef, popupRef, handleMessageListener); + localStorage.removeItem("OAUTH_RESPONSE"); + try { + if (oauthResponse.error) { + onFailure(oauthResponse.error); + } else { + const response = await axios.post( + `${environment.apiUrl}/autID/config/oauth2AccessTokenX`, + { + code: oauthResponse.payload.code, + callbackUrl + } + ); + setAuthenticating(false); + popupRef.current.close(); + onSuccess(response.data); + xCleanUp(xIntervalRef); + } + } catch (genericError) { + onFailure(genericError); + console.error(genericError); + } + } + }, 550); + return () => { setAuthenticating(false); cleanup(intervalRef, popupRef, handleMessageListener); + xCleanUp(xIntervalRef); }; }, []); diff --git a/src/pages/Nova/NovaDetails.tsx b/src/pages/Nova/NovaDetails.tsx index d805628..6f3ba19 100644 --- a/src/pages/Nova/NovaDetails.tsx +++ b/src/pages/Nova/NovaDetails.tsx @@ -1,4 +1,4 @@ -import { memo, useEffect, useMemo, useRef } from "react"; +import { memo, useEffect, useMemo, useRef, useState } from "react"; import { Avatar, Box, @@ -23,7 +23,8 @@ import { useCheckHasMintedForNovaQuery, ArchetypeTypes, useGetAllNovasQuery, - useGetNovaTasksQuery + useGetNovaTasksQuery, + communityApi } from "@api/community.api"; import { ipfsCIDToHttpUrl } from "@api/storage.api"; import { ReactComponent as DiscordIcon } from "@assets/SocialIcons/DiscordIcon.svg"; @@ -47,6 +48,7 @@ import { setNovaAddress } from "@store/WalletProvider/WalletProvider"; import { MarketTemplates } from "@api/community.model"; import AutLoading from "@components/AutLoading"; import { filterActiveNovas } from "./utils"; +import { generateAutIdDAOSigil } from "@utils/AutSIgilGenerator/SigilGenerator"; const socialIcons = { discord: DiscordIcon, @@ -56,6 +58,28 @@ const socialIcons = { lensfrens: LensfrensIcon }; +const calculateFontSize = (name: string) => { + const words = name.split(" "); + const longestWordLength = Math.max(...words.map((word) => word.length)); + if (longestWordLength >= 22) { + return "0.85rem !important"; + } else if (longestWordLength >= 20) { + return "0.95rem !important"; + } else if (longestWordLength >= 18) { + return "1.05rem !important"; + } else if (longestWordLength >= 16) { + return "1.15rem !important"; + } else if (longestWordLength >= 14) { + return "1.25rem !important"; + } else if (longestWordLength >= 12) { + return "1.35rem !important"; + } else if (longestWordLength >= 10) { + return "1.45rem !important"; + } else { + return ""; + } +}; + const AutContainer = styled("div")(({ theme }) => ({ display: "flex", height: "100%", @@ -255,6 +279,18 @@ const NovaDetails = () => { }); }, [data, novaName, address]); + const [sigil, setSigil] = useState(null); + + useEffect(() => { + const generate = async () => { + const { toBase64 } = await generateAutIdDAOSigil(nova.properties.address); + setSigil(toBase64()); + }; + if (nova) { + generate(); + } + }, []); + const { data: result, isLoading: checkingIfMinted, @@ -333,7 +369,12 @@ const NovaDetails = () => { // }; }, []); + const onMinted = async (event: CustomEvent) => { + dispatch(communityApi.util.invalidateTags(["hasMinted"])); + }; + useEffect(() => { + window.addEventListener("aut-minted", onMinted); // window.addEventListener("aut_profile", onAutMenuProfile); // window.addEventListener("aut-Init", onAutInit); // window.addEventListener("aut-onConnected", onAutLogin); @@ -347,6 +388,7 @@ const NovaDetails = () => { // if (abort.current) { // abort.current.abort(); // } + window.removeEventListener("aut-minted", onMinted); }; }, []); @@ -403,59 +445,143 @@ const NovaDetails = () => { justifyContent: "center" }} > - - - - {/* TODO: Implement when nova sigil is available */} - {/* {nova?.sigil && typeof nova?.sigil == "string" && ( - - + aria-label="avatar" + > + + + + {sigil && ( + + + + )} - )} */} + + {/* {sigil && ( + + + + )} */}
{ lineHeight={1} variant="h3" marginBottom={2} + fontSize={calculateFontSize(nova?.name as string)} > {nova?.name} diff --git a/src/pages/Nova/ToolbarConnector.tsx b/src/pages/Nova/ToolbarConnector.tsx index fd527ae..a5983ce 100644 --- a/src/pages/Nova/ToolbarConnector.tsx +++ b/src/pages/Nova/ToolbarConnector.tsx @@ -6,7 +6,7 @@ import { useAppDispatch } from "@store/store.model"; import { communityApi } from "@api/community.api"; import { environment } from "@api/environment"; -export const TOOLBAR_HEIGHT = 84; +export const TOOLBAR_HEIGHT = 70; export const ToolbarConnector = () => { const { isConnected, disconnect } = useAutConnector({ @@ -32,6 +32,7 @@ export const ToolbarConnector = () => { sx={{ width: "100%", zIndex: 99, + opacity: 0.9, position: "fixed", top: 0, backgroundColor: "nightBlack.main", diff --git a/src/pages/Oauth2Callback/Callback.tsx b/src/pages/Oauth2Callback/Callback.tsx index d0fe95a..9628b7f 100644 --- a/src/pages/Oauth2Callback/Callback.tsx +++ b/src/pages/Oauth2Callback/Callback.tsx @@ -10,9 +10,12 @@ const Callback = () => { useEffect(() => { const payload = queryToObject(window.location.search.split("?")[1]); const error = payload && payload.error; - - if (!window.opener) { - throw new Error("No window opener"); + if (!window.opener && !error) { + localStorage.setItem("OAUTH_RESPONSE", JSON.stringify({ payload })); + window.close(); + } else if (!window.opener && error) { + localStorage.setItem("OAUTH_RESPONSE", JSON.stringify({ error })); + window.close(); } if (error) { window.opener.postMessage({ @@ -26,7 +29,6 @@ const Callback = () => { payload }); } - // window.close(); }, []); return ( diff --git a/src/utils/AutSIgilGenerator/DrawHoleFunctions.ts b/src/utils/AutSIgilGenerator/DrawHoleFunctions.ts new file mode 100644 index 0000000..1303749 --- /dev/null +++ b/src/utils/AutSIgilGenerator/DrawHoleFunctions.ts @@ -0,0 +1,90 @@ +function holeNine(ctx, hole) { + ctx.drawImage(hole, (hole.height / 2) * -1, (hole.height / 2) * -1); +} +function holeTwo(ctx, hole, zoneHeight) { + ctx.drawImage( + hole, + (hole.height / 2) * -1 - zoneHeight, + (hole.height / 2) * -1 + ); +} +function holeFive(ctx, hole, zoneHeight) { + ctx.drawImage( + hole, + (hole.height / 2) * -1 + zoneHeight, + (hole.height / 2) * -1 + ); +} +function holeFour(ctx, hole, zoneHeight) { + ctx.drawImage( + hole, + (hole.height / 2) * -1, + (hole.height / 2) * -1 - zoneHeight + ); +} +function holeThree(ctx, hole, zoneHeight) { + ctx.drawImage( + hole, + (hole.height / 2) * -1, + (hole.height / 2) * -1 + zoneHeight + ); +} +function holeOne(ctx, hole, zoneHeight) { + ctx.drawImage( + hole, + (hole.height / 2) * -1 - zoneHeight, + (hole.height / 2) * -1 - zoneHeight + ); +} +function holeSeven(ctx, hole, zoneHeight) { + ctx.drawImage( + hole, + (hole.height / 2) * -1 + zoneHeight, + (hole.height / 2) * -1 + zoneHeight + ); +} +function holeSix(ctx, hole, zoneHeight) { + ctx.drawImage( + hole, + (hole.height / 2) * -1 + zoneHeight, + (hole.height / 2) * -1 - zoneHeight + ); +} +function holeEight(ctx, hole, zoneHeight) { + ctx.drawImage( + hole, + (hole.height / 2) * -1 - zoneHeight, + (hole.height / 2) * -1 + zoneHeight + ); +} + +export const drawHole = (value, ctx, hole, zoneHeight) => { + const stringValue = value.toString(); + if (stringValue === "9") { + holeNine(ctx, hole); + } + if (stringValue === "2") { + holeTwo(ctx, hole, zoneHeight); + } + if (stringValue === "5") { + holeFive(ctx, hole, zoneHeight); + } + if (stringValue === "4") { + holeFour(ctx, hole, zoneHeight); + } + if (stringValue === "3") { + holeThree(ctx, hole, zoneHeight); + } + if (stringValue === "1") { + holeOne(ctx, hole, zoneHeight); + } + if (stringValue === "7") { + holeSeven(ctx, hole, zoneHeight); + } + if (stringValue === "6") { + holeSix(ctx, hole, zoneHeight); + } + if (stringValue === "8") { + holeEight(ctx, hole, zoneHeight); + } +}; diff --git a/src/utils/AutSIgilGenerator/DrawScratchFunctions.ts b/src/utils/AutSIgilGenerator/DrawScratchFunctions.ts new file mode 100644 index 0000000..a8afd2f --- /dev/null +++ b/src/utils/AutSIgilGenerator/DrawScratchFunctions.ts @@ -0,0 +1,484 @@ +import { checkReversed } from "./utils"; + +// trip horizontal + +function OneSix(ctx, mark, zoneHeight) { + ctx.drawImage(mark, (mark.height / 2) * -1, -218 - zoneHeight); +} + +function TwoFive(ctx, mark) { + ctx.drawImage(mark, (mark.height / 2) * -1, -218); +} + +function EightSeven(ctx, mark, zoneHeight) { + ctx.drawImage(mark, (mark.height / 2) * -1, -218 + zoneHeight); +} + +// trip vertical + +function OneEight(ctx, mark, zoneHeight) { + ctx.rotate((90 * Math.PI) / 180); + + ctx.drawImage(mark, (mark.height / 2) * -1, -218 + zoneHeight); + + ctx.rotate((-90 * Math.PI) / 180); +} + +function FourThree(ctx, mark) { + ctx.rotate((90 * Math.PI) / 180); + + ctx.drawImage(mark, (mark.height / 2) * -1, -218); + + ctx.rotate((-90 * Math.PI) / 180); +} + +function SixSeven(ctx, mark, zoneHeight) { + ctx.rotate((90 * Math.PI) / 180); + + ctx.drawImage(mark, (mark.height / 2) * -1, -218 - zoneHeight); + + ctx.rotate((-90 * Math.PI) / 180); +} + +// trip left lean + +function OneThree(ctx, mark, triplediagonalOffestX, triplediagonalOffestY) { + ctx.rotate((63 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 - triplediagonalOffestX, + -218 + triplediagonalOffestY + ); + ctx.rotate((-63 * Math.PI) / 180); +} + +function FourSeven(ctx, mark, triplediagonalOffestX, triplediagonalOffestY) { + ctx.rotate((63 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 + triplediagonalOffestX, + -218 - triplediagonalOffestY + ); + ctx.rotate((-63 * Math.PI) / 180); +} + +// trip right lean + +function FourEight(ctx, mark, triplediagonalOffestX, triplediagonalOffestY) { + ctx.rotate((-63 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 - triplediagonalOffestX, + -218 - triplediagonalOffestY + ); + ctx.rotate((63 * Math.PI) / 180); +} +function SixThree(ctx, mark, triplediagonalOffestX, triplediagonalOffestY) { + ctx.rotate((-63 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 + triplediagonalOffestX, + -218 + triplediagonalOffestY + ); + ctx.rotate((63 * Math.PI) / 180); +} + +// trip horizontal left lean +function OneFive(ctx, mark, triplediagonalOffestX, triplediagonalOffestY) { + ctx.rotate((90 * Math.PI) / 180); + ctx.rotate((-63 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 - triplediagonalOffestX, + -218 - triplediagonalOffestY + ); + ctx.rotate((-90 * Math.PI) / 180); + ctx.rotate((63 * Math.PI) / 180); +} + +function TwoSeven(ctx, mark, triplediagonalOffestX, triplediagonalOffestY) { + ctx.rotate((90 * Math.PI) / 180); + ctx.rotate((-63 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 + triplediagonalOffestX, + -218 + triplediagonalOffestY + ); + ctx.rotate((-90 * Math.PI) / 180); + ctx.rotate((63 * Math.PI) / 180); +} + +// trip horizontal right lean + +function TwoSix(ctx, mark, triplediagonalOffestX, triplediagonalOffestY) { + ctx.rotate((90 * Math.PI) / 180); + ctx.rotate((63 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 - triplediagonalOffestX, + -218 + triplediagonalOffestY + ); + ctx.rotate((-90 * Math.PI) / 180); + ctx.rotate((-63 * Math.PI) / 180); +} +function EightFive(ctx, mark, triplediagonalOffestX, triplediagonalOffestY) { + ctx.rotate((90 * Math.PI) / 180); + ctx.rotate((63 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 + triplediagonalOffestX, + -218 - triplediagonalOffestY + ); + ctx.rotate((-90 * Math.PI) / 180); + ctx.rotate((-63 * Math.PI) / 180); +} + +// double + +function OneNine(ctx, mark, doubleDiagonalOffsetX) { + ctx.rotate((45 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 - doubleDiagonalOffsetX, + (mark.height / 2) * -1 + 23 + ); + ctx.rotate((-45 * Math.PI) / 180); +} + +function NineSeven(ctx, mark, doubleDiagonalOffsetX) { + ctx.rotate((45 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 + doubleDiagonalOffsetX, + (mark.height / 2) * -1 + 23 + ); + ctx.rotate((-45 * Math.PI) / 180); +} + +function TwoThree(ctx, mark, zoneDiagonal) { + ctx.rotate((45 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1, + (mark.height / 2) * -1 + 23 + zoneDiagonal / 2 + ); + ctx.rotate((-45 * Math.PI) / 180); +} + +function FourFive(ctx, mark, zoneDiagonal) { + ctx.rotate((45 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1, + (mark.height / 2) * -1 + 23 - zoneDiagonal / 2 + ); + ctx.rotate((-45 * Math.PI) / 180); +} + +// double right + +function NineSix(ctx, mark) { + const doubleDiagonalOffsetX = 90; + + ctx.rotate((-45 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 + doubleDiagonalOffsetX, + (mark.height / 2) * -1 + 23 + ); + ctx.rotate((45 * Math.PI) / 180); +} + +function EightNine(ctx, mark) { + const doubleDiagonalOffsetX = 90; + ctx.rotate((-45 * Math.PI) / 180); + + ctx.drawImage( + mark, + (mark.height / 2) * -1 - doubleDiagonalOffsetX, + (mark.height / 2) * -1 + 23 + ); + ctx.rotate((45 * Math.PI) / 180); +} + +function FourTwo(ctx, mark, zoneDiagonal) { + ctx.rotate((-45 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1, + (mark.height / 2) * -1 + 23 - zoneDiagonal / 2 + ); + ctx.rotate((45 * Math.PI) / 180); +} + +function FiveThree(ctx, mark, zoneDiagonal) { + ctx.rotate((-45 * Math.PI) / 180); + + ctx.drawImage( + mark, + (mark.height / 2) * -1, + (mark.height / 2) * -1 + 23 + zoneDiagonal / 2 + ); + ctx.rotate((45 * Math.PI) / 180); +} + +// double vertical + +function FourNine(ctx, mark, doubleMarkOffset) { + ctx.rotate((90 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 - doubleMarkOffset, + (mark.height / 2) * -1 + 23 + ); + ctx.rotate((-90 * Math.PI) / 180); +} + +function NineThree(ctx, mark, doubleMarkOffset) { + ctx.rotate((90 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 + doubleMarkOffset, + (mark.height / 2) * -1 + 23 + ); + ctx.rotate((-90 * Math.PI) / 180); +} + +function TwoEight(ctx, mark, zoneHeight, doubleMarkOffset) { + ctx.rotate((90 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 + doubleMarkOffset, + (mark.height / 2) * -1 + 23 + zoneHeight + ); + ctx.rotate((-90 * Math.PI) / 180); +} + +function FiveSeven(ctx, mark, zoneHeight, doubleMarkOffset) { + ctx.rotate((90 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 + doubleMarkOffset, + (mark.height / 2) * -1 + 23 - zoneHeight + ); + ctx.rotate((-90 * Math.PI) / 180); +} + +function OneTwo(ctx, mark, zoneHeight, doubleMarkOffset) { + ctx.rotate((90 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 - doubleMarkOffset, + (mark.height / 2) * -1 + 23 + zoneHeight + ); + ctx.rotate((-90 * Math.PI) / 180); +} + +function SixFive(ctx, mark, zoneHeight, doubleMarkOffset) { + ctx.rotate((90 * Math.PI) / 180); + ctx.drawImage( + mark, + (mark.height / 2) * -1 - doubleMarkOffset, + (mark.height / 2) * -1 + 23 - zoneHeight + ); + ctx.rotate((-90 * Math.PI) / 180); +} + +// double horizontal + +function TwoNine(ctx, mark, doubleMarkOffset) { + ctx.drawImage( + mark, + (mark.height / 2) * -1 - doubleMarkOffset, + (mark.height / 2) * -1 + 23 + ); +} + +function NineFive(ctx, mark, doubleMarkOffset) { + ctx.drawImage( + mark, + (mark.height / 2) * -1 + doubleMarkOffset, + (mark.height / 2) * -1 + 23 + ); +} + +function ThreeSeven(ctx, mark, zoneHeight, doubleMarkOffset) { + ctx.drawImage( + mark, + (mark.height / 2) * -1 + doubleMarkOffset, + (mark.height / 2) * -1 + 23 + zoneHeight + ); +} + +function FourSix(ctx, mark, zoneHeight, doubleMarkOffset) { + ctx.drawImage( + mark, + (mark.height / 2) * -1 + doubleMarkOffset, + (mark.height / 2) * -1 + 23 - zoneHeight + ); +} + +function EightThree(ctx, mark, zoneHeight, doubleMarkOffset) { + ctx.drawImage( + mark, + (mark.height / 2) * -1 - doubleMarkOffset, + (mark.height / 2) * -1 + 23 + zoneHeight + ); +} + +function OneFour(ctx, mark, zoneHeight, doubleMarkOffset) { + ctx.drawImage( + mark, + (mark.height / 2) * -1 - doubleMarkOffset, + (mark.height / 2) * -1 + 23 - zoneHeight + ); +} + +// diagonal trip +function OneSeven(ctx, mark) { + ctx.rotate((45 * Math.PI) / 180); + ctx.drawImage(mark, (mark.height / 2) * -1, -260); + + ctx.rotate((-45 * Math.PI) / 180); +} + +function SixEight(ctx, mark) { + ctx.rotate((-45 * Math.PI) / 180); + ctx.drawImage(mark, (mark.height / 2) * -1, -260); + + ctx.rotate((45 * Math.PI) / 180); +} + +export const drawScratch = ( + value, + ctx, + mark3, + mark2, + mark4, + zoneHeight, + zoneDiagonal, + doubleMarkOffset, + triplediagonalOffestX, + triplediagonalOffestY, + doubleDiagonalOffsetX +) => { + if (checkReversed(value, "16")) { + OneSix(ctx, mark3, zoneHeight); + } + if (checkReversed(value, "25")) { + TwoFive(ctx, mark3); + } + if (checkReversed(value, "87")) { + EightSeven(ctx, mark3, zoneHeight); + } + // vertical + if (checkReversed(value, "18")) { + OneEight(ctx, mark3, zoneHeight); + } + if (checkReversed(value, "43")) { + FourThree(ctx, mark3); + } + if (checkReversed(value, "67")) { + SixSeven(ctx, mark3, zoneHeight); + } + // trip lean left + if (checkReversed(value, "13")) { + OneThree(ctx, mark3, triplediagonalOffestX, triplediagonalOffestY); + } + if (checkReversed(value, "47")) { + FourSeven(ctx, mark3, triplediagonalOffestX, triplediagonalOffestY); + } + // trip lean right + if (checkReversed(value, "48")) { + FourEight(ctx, mark3, triplediagonalOffestX, triplediagonalOffestY); + } + if (checkReversed(value, "63")) { + SixThree(ctx, mark3, triplediagonalOffestX, triplediagonalOffestY); + } + // trip horizontal lean left + if (checkReversed(value, "15")) { + OneFive(ctx, mark3, triplediagonalOffestX, triplediagonalOffestY); + } + if (checkReversed(value, "27")) { + TwoSeven(ctx, mark3, triplediagonalOffestX, triplediagonalOffestY); + } + // trip horizontal lean right + if (checkReversed(value, "26")) { + TwoSix(ctx, mark3, triplediagonalOffestX, triplediagonalOffestY); + } + if (checkReversed(value, "85")) { + EightFive(ctx, mark3, triplediagonalOffestX, triplediagonalOffestY); + } + // double diagonal left + if (checkReversed(value, "19")) { + OneNine(ctx, mark2, doubleDiagonalOffsetX); + } + if (checkReversed(value, "97")) { + NineSeven(ctx, mark2, doubleDiagonalOffsetX); + } + if (checkReversed(value, "23")) { + TwoThree(ctx, mark2, zoneDiagonal); + } + if (checkReversed(value, "45")) { + FourFive(ctx, mark2, zoneDiagonal); + } + // double diagonal right + if (checkReversed(value, "96")) { + NineSix(ctx, mark2); + } + if (checkReversed(value, "89")) { + EightNine(ctx, mark2); + } + if (checkReversed(value, "42")) { + FourTwo(ctx, mark2, zoneDiagonal); + } + if (checkReversed(value, "53")) { + FiveThree(ctx, mark2, zoneDiagonal); + } + // double vertical + if (checkReversed(value, "49")) { + FourNine(ctx, mark2, doubleMarkOffset); + } + if (checkReversed(value, "93")) { + NineThree(ctx, mark2, doubleMarkOffset); + } + if (checkReversed(value, "28")) { + TwoEight(ctx, mark2, zoneHeight, doubleMarkOffset); + } + if (checkReversed(value, "57")) { + FiveSeven(ctx, mark2, zoneHeight, doubleMarkOffset); + } + if (checkReversed(value, "12")) { + OneTwo(ctx, mark2, zoneHeight, doubleMarkOffset); + } + if (checkReversed(value, "65")) { + SixFive(ctx, mark2, zoneHeight, doubleMarkOffset); + } + // double horizontal + + if (checkReversed(value, "29")) { + TwoNine(ctx, mark2, doubleMarkOffset); + } + if (checkReversed(value, "95")) { + NineFive(ctx, mark2, doubleMarkOffset); + } + if (checkReversed(value, "37")) { + ThreeSeven(ctx, mark2, zoneHeight, doubleMarkOffset); + } + if (checkReversed(value, "46")) { + FourSix(ctx, mark2, zoneHeight, doubleMarkOffset); + } + if (checkReversed(value, "83")) { + EightThree(ctx, mark2, zoneHeight, doubleMarkOffset); + } + if (checkReversed(value, "14")) { + OneFour(ctx, mark2, zoneHeight, doubleMarkOffset); + } + // diagonal trip + if (checkReversed(value, "17")) { + OneSeven(ctx, mark4); + } + if (checkReversed(value, "68")) { + SixEight(ctx, mark4); + } +}; diff --git a/src/utils/AutSIgilGenerator/ImageLoader.ts b/src/utils/AutSIgilGenerator/ImageLoader.ts new file mode 100644 index 0000000..b0d740a --- /dev/null +++ b/src/utils/AutSIgilGenerator/ImageLoader.ts @@ -0,0 +1,11 @@ +export const LoadImage = (url: string): Promise => { + const image = new Image(); + return new Promise((resolve, reject) => { + image.onerror = reject; + image.onload = () => { + resolve(image); + }; + image.crossOrigin = "Anonymous"; + image.src = url; + }); +}; diff --git a/src/utils/AutSIgilGenerator/Sigil.model.ts b/src/utils/AutSIgilGenerator/Sigil.model.ts new file mode 100644 index 0000000..0221379 --- /dev/null +++ b/src/utils/AutSIgilGenerator/Sigil.model.ts @@ -0,0 +1,6 @@ +import { Canvas } from "canvas"; + +export interface SigilOutput { + previewElement: Canvas; + toBase64: () => string; +} diff --git a/src/utils/AutSIgilGenerator/SigilGenerator.ts b/src/utils/AutSIgilGenerator/SigilGenerator.ts new file mode 100644 index 0000000..1a5f35d --- /dev/null +++ b/src/utils/AutSIgilGenerator/SigilGenerator.ts @@ -0,0 +1,108 @@ +import { SigilOutput } from "./Sigil.model"; +import { LoadImage } from "./ImageLoader"; +import { Scratch } from "./assets/scratch"; +import { Base } from "./assets/base"; +import { Hole } from "./assets/hole"; +import { randomIntFromInterval } from "./utils"; +import { drawScratch } from "./DrawScratchFunctions"; +import { drawHole } from "./DrawHoleFunctions"; +// import * as fs from "fs"; +// import { Blob } from "node:buffer"; +import { + Canvas, + CanvasRenderingContext2D, + createCanvas, + loadImage +} from "canvas"; + +const drawSigil = async (ctx: CanvasRenderingContext2D, address: string) => { + const url3 = Scratch(500, 500); + const url2 = Scratch(500 - 500 / 3, 500 - 500 / 3); + const url4 = Scratch(500 + 500 / 5, 500 + 500 / 5); + const holeUrl = Hole(); + const baseUrl = Base(); + const base = await loadImage(baseUrl); + const mark3 = await loadImage(url3); + const mark2 = await loadImage(url2); + const mark4 = await loadImage(url4); + const hole = await loadImage(holeUrl); + + const d = (base.height as number) * Math.sqrt(2); + const xSquared = (d / 2) ** 2 + (d / 2) ** 2; + const x = Math.sqrt(xSquared) / 2; + ctx.translate(300, 300); + // ctx.drawImage(base as any, x * -1, x * -1); + + const zoneHeight = Math.sqrt(xSquared) / 3; + const zoneDiagonal = zoneHeight * Math.sqrt(2); + const tripleDiagonalOffestX = 30; + const tripleDiagonalOffestY = 60; + + const doubleDiagonalOffsetX = 90; + const doubleMarkOffset = 66; + // for (let i = 0; i < 9; i++) { + // input.push(randomIntFromInterval(1, 9, input[i - 1], input[i - 2])); + // } + + const parsedAddress = parseInt(`0x${address.substring(35)}`, 16); + const baseNine = parsedAddress.toString(9); + const input = baseNine.split(""); + + for (let i = 0; i < input.length; i++) { + if (input[i + 1]) { + const firstNumber = parseInt(input[i], 10) + 1; + const secondNumber = parseInt(input[i + 1], 10) + 1; + const value = [firstNumber, secondNumber].join(""); + if ( + value !== "11" && + value !== "22" && + value !== "33" && + value !== "44" && + value !== "55" && + value !== "66" && + value !== "77" && + value !== "88" && + value !== "99" + ) { + drawScratch( + value, + ctx, + mark3, + mark2, + mark4, + zoneHeight, + zoneDiagonal, + doubleMarkOffset, + tripleDiagonalOffestX, + tripleDiagonalOffestY, + doubleDiagonalOffsetX + ); + } + } + } + // const firstHoleFromBase9 = parseInt(input[0]) + 1; + // const lastHoleFromBase9 = parseInt(input[input.length - 1]) + 1; + // drawHole(firstHoleFromBase9, ctx, hole, zoneHeight); + // drawHole(lastHoleFromBase9, ctx, hole, zoneHeight); +}; + +export const generateAutIdDAOSigil = async ( + address: string +): Promise => { + const canvasWidth = 600; + const canvasHeight = 600; + const canvas = createCanvas(canvasWidth, canvasHeight); + const ctx = canvas.getContext("2d"); + + ctx.imageSmoothingEnabled = true; + // ctx.imageSmoothingQuality = "high"; + + canvas.width = canvasWidth; + canvas.height = canvasHeight; + await drawSigil(ctx, address); + + return { + previewElement: canvas, + toBase64: () => canvas.toDataURL() + } as SigilOutput; +}; diff --git a/src/utils/AutSIgilGenerator/assets/base.ts b/src/utils/AutSIgilGenerator/assets/base.ts new file mode 100644 index 0000000..09b0b2c --- /dev/null +++ b/src/utils/AutSIgilGenerator/assets/base.ts @@ -0,0 +1,61 @@ +/* eslint-disable max-len */ +import { DOMParser, XMLSerializer } from "xmldom"; + +export const Base = (): string => { + const SVGDomElement = new DOMParser().parseFromString( + ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`, + "application/xml" + ); + + const serializedSVG = new XMLSerializer().serializeToString(SVGDomElement); + return `data:image/svg+xml;base64, ${btoa(unescape(encodeURIComponent(serializedSVG)))}`; +}; diff --git a/src/utils/AutSIgilGenerator/assets/hole.ts b/src/utils/AutSIgilGenerator/assets/hole.ts new file mode 100644 index 0000000..dbc3c10 --- /dev/null +++ b/src/utils/AutSIgilGenerator/assets/hole.ts @@ -0,0 +1,35 @@ +/* eslint-disable max-len */ +import { DOMParser, XMLSerializer } from "xmldom"; + +export const Hole = (): string => { + const SVGDomElement = new DOMParser().parseFromString( + ` + + + + + + + + + + + + + + + + + + + + + + + + `, + "application/xml" + ); + const serializedSVG = new XMLSerializer().serializeToString(SVGDomElement); + return `data:image/svg+xml;base64, ${btoa(unescape(encodeURIComponent(serializedSVG)))}`; +}; diff --git a/src/utils/AutSIgilGenerator/assets/scratch.ts b/src/utils/AutSIgilGenerator/assets/scratch.ts new file mode 100644 index 0000000..7ccc8cf --- /dev/null +++ b/src/utils/AutSIgilGenerator/assets/scratch.ts @@ -0,0 +1,41 @@ +/* eslint-disable max-len */ +import { DOMParser, XMLSerializer } from "xmldom"; + +function addNewLines(data) { + const split = data.match(/.{1,76}/g); + + const joined = split.join("\n"); + + // console.log(joined); + + return joined; +} + +export const Scratch = (w: number, h: number): string => { + const SVGDomElement = new DOMParser().parseFromString( + ` + + + + + + + + + + + + + + `, + "application/xml" + ); + const serializedSVG = new XMLSerializer().serializeToString(SVGDomElement); + return `data:image/svg+xml;base64, ${addNewLines(btoa(serializedSVG))}`; +}; diff --git a/src/utils/AutSIgilGenerator/utils.ts b/src/utils/AutSIgilGenerator/utils.ts new file mode 100644 index 0000000..901842a --- /dev/null +++ b/src/utils/AutSIgilGenerator/utils.ts @@ -0,0 +1,23 @@ +export function reverse(s) { + return s.split("").reverse().join(""); +} + +export function checkReversed(input: string, compare: string): boolean { + if (input === compare || reverse(input) === compare) { + return true; + } + return false; +} + +export function randomIntFromInterval( + min, + max, + excludeNumber?, + excludeNumberSecond? +) { + // min and max included + const number = Math.floor(Math.random() * (max - min + 1) + min); + return number === excludeNumber || number === excludeNumberSecond + ? randomIntFromInterval(min, max, excludeNumber) + : number; +}